diff --git a/.eve/agent-summary.json b/.eve/agent-summary.json deleted file mode 100644 index 88512c7..0000000 --- a/.eve/agent-summary.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "kind": "vercel-eve-agent-summary", - "schemaVersion": 3, - "generatorVersion": "0.16.2", - "agent": { - "name": "qr-master", - "modelId": "anthropic/claude-sonnet-4.6" - }, - "instructions": { - "logicalPath": "instructions.md", - "sourceKind": "markdown", - "markdown": "\r\nSearch Console property: https://www.qrmaster.net/\r\nProject domain: qrmaster.net\r\nTracked keywords: not set (derive from the domain's own ranked keywords)\r\nBlog repo and content path: not set (report-only)\r\n\r\n\r\nYou are an SEO improver agent. You run on a loop: measure where the site ranks, decide what to change to climb, hand back specific changes, and next week check whether the last changes moved the needle.\r\n\r\nYou do three things every run: **track rankings**, **prioritize a small set of high-leverage improvements**, and **report movement since the previous run**. You do not guess at rankings; you read them from data. You do not smooth over losses; if a page slipped, you say so and why you think it happened.\r\n\r\nYour project configuration is the `project-config` block at the top of this file. Do not assume values from examples. When tracked keywords are not set, derive them from the domain's own ranked keywords.\r\n\r\n## Data sources\r\n\r\nYou use two sources, and each answers a different question. **Search Console is primary**: it is Google's own first-party record of how your pages perform, so it is the ground truth for your own site. **DataForSEO is the competitive layer**: it sees the whole SERP, including pages you do not own.\r\n\r\nUse the `query_search_analytics` tool for your site's real performance: clicks, impressions, CTR, and average position by query and page, for the configured property. Use `list_search_console_sites` to confirm access and the exact property name.\r\n\r\nUse the `dataforseo` connection for what Search Console cannot see: the live SERP for a keyword, who ranks above you and what their pages do, search volume, and keyword gaps you do not yet rank for. It exposes only the tools for those four jobs. This is how you answer \"who is beating me and why\" and size the opportunity.\r\n\r\nIf either source is unauthorized or errors, stop and report that blocker instead of fabricating data. Do not silently fall back to a single source.\r\n\r\nUse native sandbox command execution for lightweight checks such as `curl`, `node`, CSV/JSON writing, HTTP status, titles, and parsing. Use Agent Browser for rendered pages and JavaScript-dependent content when you inspect a page you plan to improve; load the agent-browser skill for the command reference.\r\n\r\nKeep the run read-only against the target site. Do not submit forms, mutate the live site, bypass authentication, or solve CAPTCHAs. Respect robots and obvious rate limits. The only place you ever write is the optional GitHub pull-request flow below.\r\n\r\n## State and the loop\r\n\r\nPersist each run under `reports/seo-improver//`. At the start of every run, read the most recent prior run in that directory. That prior report is your baseline: use it to compute deltas, and to check whether the improvements you recommended last time were made and whether rankings responded. If no prior run exists, say this is the baseline run and there is nothing to compare against yet.\r\n\r\n## Each run\r\n\r\n1. Confirm the Search Console property, project domain, tracked keywords (provided or derived), and target locale/device.\r\n2. Pull your Search Console performance for the tracked queries and pages (clicks, impressions, CTR, average position), and pull the competitive SERP from DataForSEO for the tracked keywords (who ranks, the ranking URL, search volume, SERP features).\r\n3. Load the previous run and compute movement: gained, lost, new, dropped-off, and unchanged. Flag anything that fell out of the top 100.\r\n4. Identify the highest-leverage opportunities, ranked by realistic upside, not just raw volume:\r\n - **Striking distance**: queries at ~4-20 where a focused improvement can win a page-1 or top-3 slot; confirm the competition against the live SERP.\r\n - **High impressions, low CTR**: pages that earn impressions but lose the click; rewrite title/meta to win it without new rankings.\r\n - **Cannibalization**: several of your pages competing for one query; recommend which to consolidate.\r\n - **Decay**: pages whose clicks or position fell since a prior run; diagnose likely cause (content staleness, lost links, SERP change, intent shift) and check DataForSEO for what moved above you.\r\n5. For each opportunity you act on, open the ranking URL, inspect the on-page signals, use DataForSEO to see what the pages currently ranking above it do differently, and write a **specific, ready-to-apply change**: the exact title/meta to use, the heading or section to add, the internal links to add and from where, or the consolidation to make. Tie every recommendation to the ranking evidence that motivates it.\r\n6. Verify last week's loop: for each improvement recommended in the prior run, state whether it appears to have been applied and what happened to that keyword's position. Keep what worked, drop or revise what did not.\r\n\r\n## Output\r\n\r\nWrite two artifacts under `reports/seo-improver//`:\r\n\r\n- `rankings.csv` — the tracked-keyword snapshot for week-over-week diffing.\r\n\r\n ```csv\r\n keyword,location,device,position,previous_position,delta,ranking_url,search_volume,serp_features,status\r\n ```\r\n\r\n `status` is one of `gained`, `lost`, `new`, `dropped`, or `flat`. `delta` is positive when position improved (moved toward #1). Leave `previous_position` blank on the baseline run.\r\n\r\n- `report.md` — a concise Markdown report:\r\n 1. Executive summary: net movement this week and the single most important action.\r\n 2. Movement since last run: biggest gains, biggest losses, new and lost keywords.\r\n 3. Did last week's changes work: per prior recommendation, applied or not, and the ranking response.\r\n 4. This week's improvements: an ordered action list, each with the exact change, the target keyword/URL, the expected effect, and the evidence.\r\n 5. Blockers and data caveats: anything unavailable, rate-limited, or modeled rather than measured.\r\n\r\nUse stable IDs such as `SEO-STRIKE-001`, `SEO-CTR-002`, `SEO-DECAY-003` so recommendations are easy to reference across runs and you can report next week on the same ID.\r\n\r\nKeep the action list short and high-conviction. A focused list of changes that actually get made beats an exhaustive list that gets ignored.\r\n\r\n## Applying changes to a GitHub blog (optional)\r\n\r\nBy default you only report. If a blog repository is configured, you may go one step further and turn the highest-confidence recommendations into a pull request the user can review and merge. This is opt-in: only do it when the project-config block sets a blog repo and content path (or the prompt provides them) and the run is allowed to apply changes. If no repo is configured, or the blog lives outside GitHub (a hosted CMS, a different provider), stay report-only and say so, and let the user wire their own publishing path.\r\n\r\nUse the sandbox `bash` tool to run the GitHub CLI (`gh`), targeting the configured repo with `-R owner/repo`. If `gh` is unauthorized or the repo is inaccessible, report that the write step is blocked and fall back to report-only. Only touch the configured blog repo, and only the content files under its configured path.\r\n\r\nWhen you apply changes:\r\n\r\n1. Select the subset of this week's recommendations that map cleanly to files in the blog repo: title and meta-description rewrites, headings, added sections, internal links, and consolidations. Skip anything you cannot ground in a specific source file.\r\n2. Clone or fetch the repo, create a new branch named like `seo-improver/-`, and edit the source files (Markdown, MDX, or frontmatter). Match the file's existing structure and frontmatter keys; do not reformat unrelated content.\r\n3. Open a pull request with `gh pr create`. Title it with the issue IDs, and in the body list each change, the target keyword and URL, the expected effect, and the ranking evidence. Never push to the default branch, never merge, never force-push.\r\n4. Record every PR URL in `report.md` under this week's improvements, and note the issue ID so the next run can check whether the PR merged and whether rankings moved.\r\n\r\nOne branch and pull request per run unless the user asks otherwise. Keep each PR small and reviewable; a maintainer should be able to read the diff and the rationale in a couple of minutes.\r\n" - }, - "schedules": [ - { - "name": "weekly", - "cron": "0 9 * * 1", - "logicalPath": "schedules/weekly.ts" - } - ], - "tools": [ - { - "name": "list_search_console_sites", - "description": "List the Search Console properties the configured service account can access. Useful to confirm access and the exact property name before querying.", - "logicalPath": "tools/list_search_console_sites.ts" - }, - { - "name": "query_search_analytics", - "description": "Query Google Search Console Search Analytics for the property: the site's own real clicks, impressions, CTR, and average position by query, page, country, device, and date. First-party ground truth for striking-distance, low-CTR, cannibalization, and decay analysis.", - "logicalPath": "tools/query_search_analytics.ts" - } - ], - "skills": [], - "connections": [ - { - "name": "dataforseo", - "description": "DataForSEO rankings data: live SERP results by keyword/location, the domain's ranked keywords with position and search volume, keyword gaps against competitors, and search volume lookups.", - "url": "https://mcp.dataforseo.com/mcp", - "logicalPath": "connections/dataforseo.ts", - "type": "mcp" - } - ], - "channels": [], - "sandbox": { - "logicalPath": "sandbox/sandbox.ts" - }, - "subagents": [], - "diagnostics": { - "errors": 0, - "warnings": 0 - } -} diff --git a/.eve/cache/model-catalog.json b/.eve/cache/model-catalog.json deleted file mode 100644 index 5c26851..0000000 --- a/.eve/cache/model-catalog.json +++ /dev/null @@ -1,7048 +0,0 @@ -{ - "fetchedAt": "2026-07-15T12:00:15.884Z", - "kind": "eve-model-catalog-cache", - "models": [ - { - "slug": "alibaba/qwen-3-14b", - "providers": [ - { - "provider": "deepinfra", - "providerModelId": "Qwen/Qwen3-14B", - "contextWindowTokens": 40960, - "maxOutputTokens": 16384, - "tags": [ - "reasoning", - "tool-use" - ] - } - ] - }, - { - "slug": "alibaba/qwen-3-235b", - "providers": [ - { - "provider": "deepinfra", - "providerModelId": "Qwen/Qwen3-235B-A22B-Instruct-2507", - "contextWindowTokens": 40960, - "maxOutputTokens": 16384, - "tags": [ - "tool-use" - ] - }, - { - "provider": "novita", - "providerModelId": "qwen/qwen3-235b-a22b-instruct-2507", - "contextWindowTokens": 131072, - "maxOutputTokens": 32768, - "tags": [ - "reasoning", - "tool-use" - ] - }, - { - "provider": "vertex", - "providerModelId": "qwen/qwen3-235b-a22b-instruct-2507-maas", - "contextWindowTokens": 262144, - "maxOutputTokens": 16384, - "tags": [ - "tool-use" - ] - } - ] - }, - { - "slug": "alibaba/qwen-3-30b", - "providers": [ - { - "provider": "deepinfra", - "providerModelId": "Qwen/Qwen3-30B-A3B", - "contextWindowTokens": 40960, - "maxOutputTokens": 16384, - "tags": [ - "reasoning", - "tool-use" - ] - } - ] - }, - { - "slug": "alibaba/qwen-3-32b", - "providers": [ - { - "provider": "alibaba", - "providerModelId": "qwen3-32b", - "contextWindowTokens": 128000, - "maxOutputTokens": 8192, - "tags": [ - "reasoning", - "tool-use" - ] - }, - { - "provider": "bedrock", - "providerModelId": "qwen.qwen3-32b-v1:0", - "contextWindowTokens": 128000, - "maxOutputTokens": 8192, - "tags": [ - "reasoning", - "tool-use" - ] - }, - { - "provider": "deepinfra", - "providerModelId": "Qwen/Qwen3-32B", - "contextWindowTokens": 40960, - "maxOutputTokens": 16384, - "tags": [ - "reasoning", - "tool-use" - ] - }, - { - "provider": "groq", - "providerModelId": "qwen/qwen3-32b", - "contextWindowTokens": 131072, - "maxOutputTokens": 40960, - "tags": [ - "implicit-caching", - "reasoning", - "tool-use" - ] - } - ] - }, - { - "slug": "alibaba/qwen-3.6-max-preview", - "providers": [ - { - "provider": "alibaba", - "providerModelId": "qwen3.6-max-preview", - "contextWindowTokens": 240000, - "maxOutputTokens": 64000, - "tags": [ - "reasoning", - "tool-use" - ] - } - ] - }, - { - "slug": "alibaba/qwen3-235b-a22b-thinking", - "providers": [ - { - "provider": "alibaba", - "providerModelId": "qwen3-vl-235b-a22b-thinking", - "contextWindowTokens": 131072, - "maxOutputTokens": 32768, - "tags": [ - "vision", - "reasoning", - "tool-use", - "file-input" - ] - }, - { - "provider": "deepinfra", - "providerModelId": "Qwen/Qwen3-235B-A22B-Thinking-2507", - "contextWindowTokens": 262114, - "maxOutputTokens": 262114, - "tags": [ - "reasoning", - "tool-use" - ] - }, - { - "provider": "novita", - "providerModelId": "qwen/qwen3-vl-235b-a22b-thinking", - "contextWindowTokens": 131072, - "maxOutputTokens": 32768, - "tags": [ - "reasoning", - "tool-use" - ] - } - ] - }, - { - "slug": "alibaba/qwen3-coder", - "providers": [ - { - "provider": "alibaba", - "providerModelId": "qwen3-coder-480b-a35b-instruct", - "contextWindowTokens": 262144, - "maxOutputTokens": 65536, - "tags": [ - "tool-use" - ] - }, - { - "provider": "deepinfra", - "providerModelId": "Qwen/Qwen3-Coder-480B-A35B-Instruct", - "contextWindowTokens": 262144, - "maxOutputTokens": 66536, - "tags": [ - "implicit-caching", - "tool-use" - ] - }, - { - "provider": "novita", - "providerModelId": "qwen/qwen3-coder-480b-a35b-instruct", - "contextWindowTokens": 262144, - "maxOutputTokens": 65536, - "tags": [ - "tool-use" - ] - }, - { - "provider": "vertex", - "providerModelId": "qwen/qwen3-coder-480b-a35b-instruct-maas", - "contextWindowTokens": 262144, - "maxOutputTokens": 32768, - "tags": [ - "implicit-caching", - "tool-use" - ] - } - ] - }, - { - "slug": "alibaba/qwen3-coder-30b-a3b", - "providers": [ - { - "provider": "bedrock", - "providerModelId": "qwen.qwen3-coder-30b-a3b-v1:0", - "contextWindowTokens": 262144, - "maxOutputTokens": 8192, - "tags": [ - "tool-use" - ] - }, - { - "provider": "novita", - "providerModelId": "qwen/qwen3-coder-30b-a3b-instruct", - "contextWindowTokens": 160000, - "maxOutputTokens": 32768, - "tags": [ - "tool-use" - ] - } - ] - }, - { - "slug": "alibaba/qwen3-coder-next", - "providers": [ - { - "provider": "bedrock", - "providerModelId": "qwen.qwen3-coder-next", - "contextWindowTokens": 256000, - "maxOutputTokens": 256000, - "tags": [ - "tool-use" - ] - }, - { - "provider": "togetherai", - "providerModelId": "Qwen/Qwen3-Coder-Next-FP8", - "contextWindowTokens": 256000, - "maxOutputTokens": 256000, - "tags": [ - "tool-use" - ] - } - ] - }, - { - "slug": "alibaba/qwen3-coder-plus", - "providers": [ - { - "provider": "alibaba", - "providerModelId": "qwen3-coder-plus", - "contextWindowTokens": 1000000, - "maxOutputTokens": 65536, - "tags": [ - "implicit-caching", - "tool-use" - ] - } - ] - }, - { - "slug": "alibaba/qwen3-embedding-0.6b", - "providers": [ - { - "provider": "deepinfra", - "providerModelId": "Qwen/Qwen3-Embedding-0.6B", - "contextWindowTokens": 32768, - "maxOutputTokens": 32768 - } - ] - }, - { - "slug": "alibaba/qwen3-embedding-4b", - "providers": [ - { - "provider": "deepinfra", - "providerModelId": "Qwen/Qwen3-Embedding-4B", - "contextWindowTokens": 32768, - "maxOutputTokens": 32768 - } - ] - }, - { - "slug": "alibaba/qwen3-embedding-8b", - "providers": [ - { - "provider": "deepinfra", - "providerModelId": "Qwen/Qwen3-Embedding-8B", - "contextWindowTokens": 32768, - "maxOutputTokens": 32768 - } - ] - }, - { - "slug": "alibaba/qwen3-max", - "providers": [ - { - "provider": "alibaba", - "providerModelId": "qwen3-max", - "contextWindowTokens": 262144, - "maxOutputTokens": 32768, - "tags": [ - "tool-use", - "implicit-caching" - ] - }, - { - "provider": "novita", - "providerModelId": "qwen/qwen3-max", - "contextWindowTokens": 262144, - "maxOutputTokens": 65536, - "tags": [ - "tool-use" - ] - } - ] - }, - { - "slug": "alibaba/qwen3-max-preview", - "providers": [ - { - "provider": "alibaba", - "providerModelId": "qwen3-max-preview", - "contextWindowTokens": 262144, - "maxOutputTokens": 32768, - "tags": [ - "tool-use", - "implicit-caching" - ] - } - ] - }, - { - "slug": "alibaba/qwen3-max-thinking", - "providers": [ - { - "provider": "alibaba", - "providerModelId": "qwen3-max-2026-01-23", - "contextWindowTokens": 256000, - "maxOutputTokens": 65536, - "tags": [ - "reasoning", - "tool-use" - ] - } - ] - }, - { - "slug": "alibaba/qwen3-next-80b-a3b-instruct", - "providers": [ - { - "provider": "alibaba", - "providerModelId": "qwen3-next-80b-a3b-instruct", - "contextWindowTokens": 131072, - "maxOutputTokens": 32768, - "tags": [ - "tool-use" - ] - }, - { - "provider": "deepinfra", - "providerModelId": "Qwen/Qwen3-Next-80B-A3B-Instruct", - "contextWindowTokens": 262144, - "maxOutputTokens": 32768, - "tags": [ - "tool-use" - ] - }, - { - "provider": "novita", - "providerModelId": "qwen/qwen3-next-80b-a3b-instruct", - "contextWindowTokens": 65536, - "maxOutputTokens": 65536, - "tags": [ - "tool-use" - ] - }, - { - "provider": "vertex", - "providerModelId": "qwen/qwen3-next-80b-a3b-instruct-maas", - "contextWindowTokens": 262114, - "maxOutputTokens": 262114, - "tags": [ - "tool-use" - ] - } - ] - }, - { - "slug": "alibaba/qwen3-next-80b-a3b-thinking", - "providers": [ - { - "provider": "alibaba", - "providerModelId": "qwen3-next-80b-a3b-thinking", - "contextWindowTokens": 131072, - "maxOutputTokens": 32768, - "tags": [ - "reasoning", - "tool-use" - ] - }, - { - "provider": "novita", - "providerModelId": "qwen/qwen3-next-80b-a3b-thinking", - "contextWindowTokens": 65536, - "maxOutputTokens": 65536, - "tags": [ - "reasoning", - "tool-use" - ] - }, - { - "provider": "vertex", - "providerModelId": "qwen/qwen3-next-80b-a3b-thinking-maas", - "contextWindowTokens": 262144, - "maxOutputTokens": 262144, - "tags": [ - "reasoning", - "tool-use" - ] - } - ] - }, - { - "slug": "alibaba/qwen3-vl-235b-a22b-instruct", - "providers": [ - { - "provider": "alibaba", - "providerModelId": "qwen3-vl-235b-a22b-instruct", - "contextWindowTokens": 131072, - "maxOutputTokens": 129024, - "tags": [ - "tool-use", - "vision" - ] - }, - { - "provider": "deepinfra", - "providerModelId": "Qwen/Qwen3-VL-235B-A22B-Instruct", - "contextWindowTokens": 262144, - "maxOutputTokens": 262144, - "tags": [ - "implicit-caching", - "tool-use", - "vision" - ] - } - ] - }, - { - "slug": "alibaba/qwen3-vl-instruct", - "providers": [ - { - "provider": "alibaba", - "providerModelId": "qwen3-vl-235b-a22b-instruct", - "contextWindowTokens": 131072, - "maxOutputTokens": 129024, - "tags": [ - "tool-use", - "vision" - ] - }, - { - "provider": "deepinfra", - "providerModelId": "Qwen/Qwen3-VL-235B-A22B-Instruct", - "contextWindowTokens": 262144, - "maxOutputTokens": 262144, - "tags": [ - "implicit-caching", - "tool-use", - "vision" - ] - }, - { - "provider": "novita", - "providerModelId": "qwen/qwen3-vl-235b-a22b-instruct", - "contextWindowTokens": 131072, - "maxOutputTokens": 32768, - "tags": [ - "tool-use", - "vision" - ] - } - ] - }, - { - "slug": "alibaba/qwen3-vl-thinking", - "providers": [ - { - "provider": "alibaba", - "providerModelId": "qwen3-vl-235b-a22b-thinking", - "contextWindowTokens": 131072, - "maxOutputTokens": 32768, - "tags": [ - "vision", - "reasoning", - "tool-use", - "file-input" - ] - }, - { - "provider": "novita", - "providerModelId": "qwen/qwen3-vl-235b-a22b-thinking", - "contextWindowTokens": 131072, - "maxOutputTokens": 32768, - "tags": [ - "reasoning", - "tool-use" - ] - } - ] - }, - { - "slug": "alibaba/qwen3.5-flash", - "providers": [ - { - "provider": "alibaba", - "providerModelId": "qwen3.5-flash", - "contextWindowTokens": 1000000, - "maxOutputTokens": 64000, - "tags": [ - "vision", - "file-input", - "reasoning", - "tool-use" - ] - } - ] - }, - { - "slug": "alibaba/qwen3.5-plus", - "providers": [ - { - "provider": "alibaba", - "providerModelId": "qwen3.5-plus", - "contextWindowTokens": 1000000, - "maxOutputTokens": 64000, - "tags": [ - "vision", - "file-input", - "reasoning", - "tool-use" - ] - } - ] - }, - { - "slug": "alibaba/qwen3.6-27b", - "providers": [ - { - "provider": "alibaba", - "providerModelId": "qwen3.6-27b", - "contextWindowTokens": 256000, - "maxOutputTokens": 256000, - "tags": [ - "reasoning", - "tool-use", - "file-input", - "vision" - ] - } - ] - }, - { - "slug": "alibaba/qwen3.6-plus", - "providers": [ - { - "provider": "alibaba", - "providerModelId": "qwen3.6-plus", - "contextWindowTokens": 1000000, - "maxOutputTokens": 64000, - "tags": [ - "reasoning", - "tool-use", - "vision", - "file-input" - ] - }, - { - "provider": "togetherai", - "providerModelId": "Qwen/Qwen3.6-Plus", - "contextWindowTokens": 1000000, - "maxOutputTokens": 64000, - "tags": [ - "reasoning", - "tool-use", - "vision", - "file-input" - ] - } - ] - }, - { - "slug": "alibaba/qwen3.7-max", - "providers": [ - { - "provider": "alibaba", - "providerModelId": "qwen3.7-max", - "contextWindowTokens": 991000, - "maxOutputTokens": 64000, - "tags": [ - "implicit-caching", - "reasoning", - "tool-use" - ] - } - ] - }, - { - "slug": "alibaba/qwen3.7-plus", - "providers": [ - { - "provider": "alibaba", - "providerModelId": "qwen3.7-plus", - "contextWindowTokens": 1000000, - "maxOutputTokens": 64000, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching", - "file-input", - "vision" - ] - }, - { - "provider": "fireworks", - "providerModelId": "accounts/fireworks/models/qwen3p7-plus", - "contextWindowTokens": 262000, - "maxOutputTokens": 64000, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching", - "file-input", - "vision" - ] - }, - { - "provider": "togetherai", - "providerModelId": "Qwen/Qwen3.7-Plus", - "contextWindowTokens": 1000000, - "maxOutputTokens": 64000, - "tags": [ - "reasoning", - "tool-use", - "file-input", - "vision" - ] - } - ] - }, - { - "slug": "alibaba/wan-v2.5-t2v-preview", - "providers": [ - { - "provider": "alibaba", - "providerModelId": "wan2.5-t2v-preview", - "contextWindowTokens": 0, - "maxOutputTokens": 0 - } - ] - }, - { - "slug": "alibaba/wan-v2.6-i2v", - "providers": [ - { - "provider": "alibaba", - "providerModelId": "wan2.6-i2v", - "contextWindowTokens": 0, - "maxOutputTokens": 0 - } - ] - }, - { - "slug": "alibaba/wan-v2.6-i2v-flash", - "providers": [ - { - "provider": "alibaba", - "providerModelId": "wan2.6-i2v-flash", - "contextWindowTokens": 0, - "maxOutputTokens": 0 - } - ] - }, - { - "slug": "alibaba/wan-v2.6-r2v", - "providers": [ - { - "provider": "alibaba", - "providerModelId": "wan2.6-r2v", - "contextWindowTokens": 0, - "maxOutputTokens": 0 - } - ] - }, - { - "slug": "alibaba/wan-v2.6-r2v-flash", - "providers": [ - { - "provider": "alibaba", - "providerModelId": "wan2.6-r2v-flash", - "contextWindowTokens": 0, - "maxOutputTokens": 0 - } - ] - }, - { - "slug": "alibaba/wan-v2.6-t2v", - "providers": [ - { - "provider": "alibaba", - "providerModelId": "wan2.6-t2v", - "contextWindowTokens": 0, - "maxOutputTokens": 0 - } - ] - }, - { - "slug": "alibaba/wan-v2.7-r2v", - "providers": [ - { - "provider": "alibaba", - "providerModelId": "wan2.7-r2v", - "contextWindowTokens": 0, - "maxOutputTokens": 0 - } - ] - }, - { - "slug": "alibaba/wan-v2.7-t2v", - "providers": [ - { - "provider": "alibaba", - "providerModelId": "wan2.7-t2v", - "contextWindowTokens": 0, - "maxOutputTokens": 0 - } - ] - }, - { - "slug": "amazon/nova-2-lite", - "providers": [ - { - "provider": "bedrock", - "providerModelId": "us.amazon.nova-2-lite-v1:0", - "contextWindowTokens": 1000000, - "maxOutputTokens": 1000000, - "tags": [ - "file-input", - "reasoning", - "tool-use", - "vision" - ] - } - ] - }, - { - "slug": "amazon/nova-lite", - "providers": [ - { - "provider": "bedrock", - "providerModelId": "us.amazon.nova-lite-v1:0", - "contextWindowTokens": 300000, - "maxOutputTokens": 8192, - "tags": [ - "file-input", - "tool-use", - "vision" - ] - } - ] - }, - { - "slug": "amazon/nova-micro", - "providers": [ - { - "provider": "bedrock", - "providerModelId": "us.amazon.nova-micro-v1:0", - "contextWindowTokens": 128000, - "maxOutputTokens": 8192, - "tags": [ - "tool-use" - ] - } - ] - }, - { - "slug": "amazon/nova-pro", - "providers": [ - { - "provider": "bedrock", - "providerModelId": "us.amazon.nova-pro-v1:0", - "contextWindowTokens": 300000, - "maxOutputTokens": 8192, - "tags": [ - "file-input", - "tool-use", - "vision" - ] - } - ] - }, - { - "slug": "amazon/titan-embed-text-v2", - "providers": [ - { - "provider": "bedrock", - "providerModelId": "amazon.titan-embed-text-v2:0", - "contextWindowTokens": 0, - "maxOutputTokens": 0 - } - ] - }, - { - "slug": "anthropic/claude-3-haiku", - "providers": [ - { - "provider": "bedrock", - "providerModelId": "us.anthropic.claude-3-haiku-20240307-v1:0", - "contextWindowTokens": 200000, - "maxOutputTokens": 4096, - "tags": [ - "tool-use", - "vision", - "explicit-caching" - ] - }, - { - "provider": "vertex", - "providerModelId": "claude-3-haiku@20240307", - "contextWindowTokens": 200000, - "maxOutputTokens": 4096, - "tags": [ - "explicit-caching", - "tool-use", - "vision" - ] - } - ] - }, - { - "slug": "anthropic/claude-fable-5", - "providers": [ - { - "provider": "anthropic", - "providerModelId": "claude-fable-5", - "contextWindowTokens": 1000000, - "maxOutputTokens": 128000, - "tags": [ - "reasoning", - "tool-use", - "explicit-caching", - "file-input", - "vision" - ] - }, - { - "provider": "bedrock", - "providerModelId": "global.anthropic.claude-fable-5", - "contextWindowTokens": 1000000, - "maxOutputTokens": 128000, - "tags": [ - "reasoning", - "tool-use", - "explicit-caching", - "file-input", - "vision" - ] - }, - { - "provider": "vertex", - "providerModelId": "claude-fable-5", - "contextWindowTokens": 1000000, - "maxOutputTokens": 128000, - "tags": [ - "reasoning", - "tool-use", - "explicit-caching", - "file-input", - "vision" - ] - } - ] - }, - { - "slug": "anthropic/claude-haiku-4.5", - "providers": [ - { - "provider": "anthropic", - "providerModelId": "claude-haiku-4-5-20251001", - "contextWindowTokens": 200000, - "maxOutputTokens": 64000, - "tags": [ - "explicit-caching", - "file-input", - "reasoning", - "tool-use", - "vision", - "web-search" - ] - }, - { - "provider": "bedrock", - "providerModelId": "global.anthropic.claude-haiku-4-5-20251001-v1:0", - "contextWindowTokens": 200000, - "maxOutputTokens": 64000, - "tags": [ - "file-input", - "reasoning", - "tool-use", - "vision", - "explicit-caching", - "web-search" - ] - }, - { - "provider": "vertex", - "providerModelId": "claude-haiku-4-5@20251001", - "contextWindowTokens": 200000, - "maxOutputTokens": 64000, - "tags": [ - "explicit-caching", - "file-input", - "reasoning", - "tool-use", - "vision", - "web-search" - ] - } - ] - }, - { - "slug": "anthropic/claude-opus-4", - "providers": [ - { - "provider": "bedrock", - "providerModelId": "us.anthropic.claude-opus-4-20250514-v1:0", - "contextWindowTokens": 200000, - "maxOutputTokens": 8192, - "tags": [ - "file-input", - "reasoning", - "tool-use", - "vision", - "explicit-caching" - ] - }, - { - "provider": "vertex", - "providerModelId": "claude-opus-4@20250514", - "contextWindowTokens": 200000, - "maxOutputTokens": 8192, - "tags": [ - "file-input", - "reasoning", - "tool-use", - "vision", - "explicit-caching" - ] - } - ] - }, - { - "slug": "anthropic/claude-opus-4.1", - "providers": [ - { - "provider": "anthropic", - "providerModelId": "claude-opus-4-1-20250805", - "contextWindowTokens": 200000, - "maxOutputTokens": 32000, - "tags": [ - "file-input", - "reasoning", - "tool-use", - "vision", - "explicit-caching" - ] - }, - { - "provider": "bedrock", - "providerModelId": "us.anthropic.claude-opus-4-1-20250805-v1:0", - "contextWindowTokens": 200000, - "maxOutputTokens": 32000, - "tags": [ - "file-input", - "reasoning", - "tool-use", - "vision", - "explicit-caching" - ] - }, - { - "provider": "vertex", - "providerModelId": "claude-opus-4-1@20250805", - "contextWindowTokens": 200000, - "maxOutputTokens": 32000, - "tags": [ - "file-input", - "reasoning", - "tool-use", - "vision", - "explicit-caching" - ] - } - ] - }, - { - "slug": "anthropic/claude-opus-4.5", - "providers": [ - { - "provider": "anthropic", - "providerModelId": "claude-opus-4-5-20251101", - "contextWindowTokens": 200000, - "maxOutputTokens": 64000, - "tags": [ - "explicit-caching", - "file-input", - "reasoning", - "tool-use", - "vision", - "web-search" - ] - }, - { - "provider": "bedrock", - "providerModelId": "global.anthropic.claude-opus-4-5-20251101-v1:0", - "contextWindowTokens": 200000, - "maxOutputTokens": 64000, - "tags": [ - "explicit-caching", - "file-input", - "reasoning", - "tool-use", - "vision" - ] - }, - { - "provider": "vertex", - "providerModelId": "claude-opus-4-5@20251101", - "contextWindowTokens": 200000, - "maxOutputTokens": 64000, - "tags": [ - "explicit-caching", - "file-input", - "reasoning", - "tool-use", - "vision", - "web-search" - ] - } - ] - }, - { - "slug": "anthropic/claude-opus-4.6", - "providers": [ - { - "provider": "anthropic", - "providerModelId": "claude-opus-4-6", - "contextWindowTokens": 1000000, - "maxOutputTokens": 128000, - "tags": [ - "tool-use", - "reasoning", - "vision", - "file-input", - "explicit-caching", - "web-search" - ] - }, - { - "provider": "bedrock", - "providerModelId": "global.anthropic.claude-opus-4-6-v1", - "contextWindowTokens": 1000000, - "maxOutputTokens": 128000, - "tags": [ - "tool-use", - "reasoning", - "vision", - "file-input", - "explicit-caching", - "web-search" - ] - }, - { - "provider": "vertex", - "providerModelId": "claude-opus-4-6", - "contextWindowTokens": 1000000, - "maxOutputTokens": 128000, - "tags": [ - "tool-use", - "reasoning", - "vision", - "file-input", - "web-search", - "explicit-caching" - ] - } - ] - }, - { - "slug": "anthropic/claude-opus-4.7", - "providers": [ - { - "provider": "anthropic", - "providerModelId": "claude-opus-4-7", - "contextWindowTokens": 1000000, - "maxOutputTokens": 128000, - "tags": [ - "tool-use", - "reasoning", - "vision", - "file-input", - "explicit-caching", - "web-search", - "fast" - ] - }, - { - "provider": "bedrock", - "providerModelId": "global.anthropic.claude-opus-4-7", - "contextWindowTokens": 1000000, - "maxOutputTokens": 128000, - "tags": [ - "reasoning", - "tool-use", - "explicit-caching", - "vision", - "file-input", - "web-search" - ] - }, - { - "provider": "vertex", - "providerModelId": "claude-opus-4-7", - "contextWindowTokens": 1000000, - "maxOutputTokens": 128000, - "tags": [ - "reasoning", - "tool-use", - "explicit-caching", - "file-input", - "vision", - "web-search" - ] - } - ] - }, - { - "slug": "anthropic/claude-opus-4.8", - "providers": [ - { - "provider": "anthropic", - "providerModelId": "claude-opus-4-8", - "contextWindowTokens": 1000000, - "maxOutputTokens": 128000, - "tags": [ - "tool-use", - "reasoning", - "vision", - "file-input", - "explicit-caching", - "web-search", - "fast" - ] - }, - { - "provider": "bedrock", - "providerModelId": "global.anthropic.claude-opus-4-8", - "contextWindowTokens": 1000000, - "maxOutputTokens": 128000, - "tags": [ - "reasoning", - "tool-use", - "explicit-caching", - "vision", - "file-input", - "web-search" - ] - }, - { - "provider": "vertex", - "providerModelId": "claude-opus-4-8", - "contextWindowTokens": 1000000, - "maxOutputTokens": 128000, - "tags": [ - "reasoning", - "tool-use", - "explicit-caching", - "file-input", - "vision", - "web-search" - ] - } - ] - }, - { - "slug": "anthropic/claude-sonnet-4", - "providers": [ - { - "provider": "bedrock", - "providerModelId": "us.anthropic.claude-sonnet-4-20250514-v1:0", - "contextWindowTokens": 1000000, - "maxOutputTokens": 8192, - "tags": [ - "file-input", - "reasoning", - "tool-use", - "vision", - "explicit-caching" - ] - }, - { - "provider": "vertex", - "providerModelId": "claude-sonnet-4@20250514", - "contextWindowTokens": 1000000, - "maxOutputTokens": 8192, - "tags": [ - "file-input", - "reasoning", - "tool-use", - "vision", - "explicit-caching" - ] - } - ] - }, - { - "slug": "anthropic/claude-sonnet-4.5", - "providers": [ - { - "provider": "anthropic", - "providerModelId": "claude-sonnet-4-5-20250929", - "contextWindowTokens": 1000000, - "maxOutputTokens": 64000, - "tags": [ - "explicit-caching", - "file-input", - "reasoning", - "tool-use", - "vision", - "web-search" - ] - }, - { - "provider": "bedrock", - "providerModelId": "global.anthropic.claude-sonnet-4-5-20250929-v1:0", - "contextWindowTokens": 1000000, - "maxOutputTokens": 8192, - "tags": [ - "file-input", - "reasoning", - "tool-use", - "vision", - "explicit-caching", - "web-search" - ] - }, - { - "provider": "vertex", - "providerModelId": "claude-sonnet-4-5@20250929", - "contextWindowTokens": 1000000, - "maxOutputTokens": 8192, - "tags": [ - "explicit-caching", - "file-input", - "reasoning", - "tool-use", - "vision", - "web-search" - ] - } - ] - }, - { - "slug": "anthropic/claude-sonnet-4.6", - "providers": [ - { - "provider": "anthropic", - "providerModelId": "claude-sonnet-4-6", - "contextWindowTokens": 1000000, - "maxOutputTokens": 128000, - "tags": [ - "file-input", - "reasoning", - "tool-use", - "vision", - "explicit-caching", - "web-search" - ] - }, - { - "provider": "bedrock", - "providerModelId": "global.anthropic.claude-sonnet-4-6", - "contextWindowTokens": 1000000, - "maxOutputTokens": 128000, - "tags": [ - "tool-use", - "reasoning", - "vision", - "file-input", - "explicit-caching", - "web-search" - ] - }, - { - "provider": "vertex", - "providerModelId": "claude-sonnet-4-6", - "contextWindowTokens": 1000000, - "maxOutputTokens": 128000, - "tags": [ - "tool-use", - "reasoning", - "vision", - "file-input", - "explicit-caching", - "web-search" - ] - } - ] - }, - { - "slug": "anthropic/claude-sonnet-5", - "providers": [ - { - "provider": "anthropic", - "providerModelId": "claude-sonnet-5", - "contextWindowTokens": 1000000, - "maxOutputTokens": 128000, - "tags": [ - "reasoning", - "tool-use", - "explicit-caching", - "file-input", - "vision", - "web-search" - ] - }, - { - "provider": "bedrock", - "providerModelId": "global.anthropic.claude-sonnet-5", - "contextWindowTokens": 1000000, - "maxOutputTokens": 128000, - "tags": [ - "reasoning", - "tool-use", - "explicit-caching", - "file-input", - "vision", - "web-search" - ] - }, - { - "provider": "vertex", - "providerModelId": "claude-sonnet-5", - "contextWindowTokens": 1000000, - "maxOutputTokens": 128000, - "tags": [ - "reasoning", - "tool-use", - "explicit-caching", - "file-input", - "web-search", - "vision" - ] - } - ] - }, - { - "slug": "arcee-ai/trinity-large-thinking", - "providers": [ - { - "provider": "arcee-ai", - "providerModelId": "trinity-large-thinking", - "contextWindowTokens": 262100, - "maxOutputTokens": 80000, - "tags": [ - "reasoning", - "tool-use" - ] - } - ] - }, - { - "slug": "arcee-ai/trinity-mini", - "providers": [ - { - "provider": "arcee-ai", - "providerModelId": "trinity-mini", - "contextWindowTokens": 131072, - "maxOutputTokens": 131072, - "tags": [ - "tool-use" - ] - } - ] - }, - { - "slug": "bfl/flux-2-flex", - "providers": [ - { - "provider": "bfl", - "providerModelId": "flux-2-flex", - "contextWindowTokens": 0, - "maxOutputTokens": 0, - "tags": [ - "image-generation" - ] - } - ] - }, - { - "slug": "bfl/flux-2-klein-4b", - "providers": [ - { - "provider": "bfl", - "providerModelId": "flux-2-klein-4b", - "contextWindowTokens": 0, - "maxOutputTokens": 0, - "tags": [ - "image-generation" - ] - } - ] - }, - { - "slug": "bfl/flux-2-klein-9b", - "providers": [ - { - "provider": "bfl", - "providerModelId": "flux-2-klein-9b-preview", - "contextWindowTokens": 0, - "maxOutputTokens": 0, - "tags": [ - "image-generation" - ] - } - ] - }, - { - "slug": "bfl/flux-2-max", - "providers": [ - { - "provider": "bfl", - "providerModelId": "flux-2-max", - "contextWindowTokens": 67300, - "maxOutputTokens": 67300, - "tags": [ - "image-generation" - ] - } - ] - }, - { - "slug": "bfl/flux-2-pro", - "providers": [ - { - "provider": "bfl", - "providerModelId": "flux-2-pro-preview", - "contextWindowTokens": 67300, - "maxOutputTokens": 67300, - "tags": [ - "image-generation" - ] - } - ] - }, - { - "slug": "bfl/flux-kontext-max", - "providers": [ - { - "provider": "bfl", - "providerModelId": "flux-kontext-max", - "contextWindowTokens": 512, - "maxOutputTokens": 0, - "tags": [ - "image-generation" - ] - } - ] - }, - { - "slug": "bfl/flux-kontext-pro", - "providers": [ - { - "provider": "bfl", - "providerModelId": "flux-kontext-pro", - "contextWindowTokens": 512, - "maxOutputTokens": 0, - "tags": [ - "image-generation" - ] - }, - { - "provider": "prodia", - "providerModelId": "inference.flux-kontext.pro.txt2img.v2", - "contextWindowTokens": 512, - "maxOutputTokens": 0, - "tags": [ - "image-generation" - ] - } - ] - }, - { - "slug": "bfl/flux-pro-1.0-fill", - "providers": [ - { - "provider": "bfl", - "providerModelId": "flux-pro-1.0-fill", - "contextWindowTokens": 0, - "maxOutputTokens": 0, - "tags": [ - "image-generation" - ] - } - ] - }, - { - "slug": "bfl/flux-pro-1.1", - "providers": [ - { - "provider": "bfl", - "providerModelId": "flux-pro-1.1", - "contextWindowTokens": 0, - "maxOutputTokens": 0, - "tags": [ - "image-generation" - ] - } - ] - }, - { - "slug": "bfl/flux-pro-1.1-ultra", - "providers": [ - { - "provider": "bfl", - "providerModelId": "flux-pro-1.1-ultra", - "contextWindowTokens": 0, - "maxOutputTokens": 0, - "tags": [ - "image-generation" - ] - } - ] - }, - { - "slug": "bytedance/seed-1.6", - "providers": [ - { - "provider": "bytedance", - "providerModelId": "ep-20260106022440-82vp4", - "contextWindowTokens": 256000, - "maxOutputTokens": 32000, - "tags": [ - "reasoning", - "tool-use", - "vision" - ] - } - ] - }, - { - "slug": "bytedance/seed-1.8", - "providers": [ - { - "provider": "bytedance", - "providerModelId": "ep-20260113010502-rl889", - "contextWindowTokens": 256000, - "maxOutputTokens": 64000, - "tags": [ - "reasoning", - "tool-use", - "vision" - ] - } - ] - }, - { - "slug": "bytedance/seedance-2.0", - "providers": [ - { - "provider": "bytedance", - "providerModelId": "dreamina-seedance-2-0-260128", - "contextWindowTokens": 0, - "maxOutputTokens": 0, - "tags": [ - "video-generation", - "vision" - ] - } - ] - }, - { - "slug": "bytedance/seedance-2.0-fast", - "providers": [ - { - "provider": "bytedance", - "providerModelId": "dreamina-seedance-2-0-fast-260128", - "contextWindowTokens": 0, - "maxOutputTokens": 0, - "tags": [ - "vision", - "video-generation" - ] - } - ] - }, - { - "slug": "bytedance/seedance-v1.0-pro", - "providers": [ - { - "provider": "bytedance", - "providerModelId": "seedance-1-0-pro-250528", - "contextWindowTokens": 0, - "maxOutputTokens": 0, - "tags": [ - "video-generation" - ] - } - ] - }, - { - "slug": "bytedance/seedance-v1.0-pro-fast", - "providers": [ - { - "provider": "bytedance", - "providerModelId": "seedance-1-0-pro-fast-251015", - "contextWindowTokens": 0, - "maxOutputTokens": 0, - "tags": [ - "video-generation" - ] - } - ] - }, - { - "slug": "bytedance/seedance-v1.5-pro", - "providers": [ - { - "provider": "bytedance", - "providerModelId": "seedance-1-5-pro-251215", - "contextWindowTokens": 0, - "maxOutputTokens": 0, - "tags": [ - "video-generation" - ] - } - ] - }, - { - "slug": "bytedance/seedream-4.0", - "providers": [ - { - "provider": "bytedance", - "providerModelId": "ep-20260308024352-m8qrz", - "contextWindowTokens": 0, - "maxOutputTokens": 0, - "tags": [ - "image-generation" - ] - } - ] - }, - { - "slug": "bytedance/seedream-4.5", - "providers": [ - { - "provider": "bytedance", - "providerModelId": "ep-20260308024445-dq5h7", - "contextWindowTokens": 0, - "maxOutputTokens": 0, - "tags": [ - "image-generation" - ] - } - ] - }, - { - "slug": "bytedance/seedream-5.0-lite", - "providers": [ - { - "provider": "bytedance", - "providerModelId": "ep-20260308024243-qt2d5", - "contextWindowTokens": 0, - "maxOutputTokens": 0, - "tags": [ - "image-generation" - ] - } - ] - }, - { - "slug": "bytedance/seedream-5.0-pro", - "providers": [ - { - "provider": "bytedance", - "providerModelId": "ep-20260712072949-hz8kg", - "contextWindowTokens": 0, - "maxOutputTokens": 0, - "tags": [ - "image-generation" - ] - } - ] - }, - { - "slug": "cohere/command-a", - "providers": [ - { - "provider": "cohere", - "providerModelId": "command-a-03-2025", - "contextWindowTokens": 256000, - "maxOutputTokens": 8000, - "tags": [ - "tool-use" - ] - } - ] - }, - { - "slug": "cohere/embed-v4.0", - "providers": [ - { - "provider": "bedrock", - "providerModelId": "cohere.embed-v4:0", - "contextWindowTokens": 128000, - "maxOutputTokens": 0 - }, - { - "provider": "cohere", - "providerModelId": "embed-v4.0", - "contextWindowTokens": 0, - "maxOutputTokens": 0 - } - ] - }, - { - "slug": "cohere/rerank-v3.5", - "providers": [ - { - "provider": "bedrock", - "providerModelId": "cohere.rerank-v3-5:0", - "contextWindowTokens": 4096, - "maxOutputTokens": 4096 - } - ] - }, - { - "slug": "cohere/rerank-v4-fast", - "providers": [ - { - "provider": "cohere", - "providerModelId": "rerank-v4.0-fast", - "contextWindowTokens": 32000, - "maxOutputTokens": 32000 - } - ] - }, - { - "slug": "cohere/rerank-v4-pro", - "providers": [ - { - "provider": "cohere", - "providerModelId": "rerank-v4.0-pro", - "contextWindowTokens": 32000, - "maxOutputTokens": 32000 - } - ] - }, - { - "slug": "deepseek/deepseek-r1", - "providers": [ - { - "provider": "bedrock", - "providerModelId": "us.deepseek.r1-v1:0", - "contextWindowTokens": 128000, - "maxOutputTokens": 8192, - "tags": [ - "reasoning", - "tool-use" - ] - }, - { - "provider": "deepinfra", - "providerModelId": "deepseek-ai/DeepSeek-R1-0528", - "contextWindowTokens": 160000, - "maxOutputTokens": 16384, - "tags": [ - "implicit-caching", - "reasoning", - "tool-use" - ] - } - ] - }, - { - "slug": "deepseek/deepseek-v3", - "providers": [ - { - "provider": "novita", - "providerModelId": "deepseek/deepseek-v3-0324", - "contextWindowTokens": 163840, - "maxOutputTokens": 163840, - "tags": [ - "tool-use" - ] - } - ] - }, - { - "slug": "deepseek/deepseek-v3.1", - "providers": [ - { - "provider": "deepinfra", - "providerModelId": "deepseek-ai/DeepSeek-V3.1", - "contextWindowTokens": 163840, - "maxOutputTokens": 128000, - "tags": [ - "implicit-caching", - "reasoning", - "tool-use" - ] - }, - { - "provider": "novita", - "providerModelId": "deepseek/deepseek-v3-0324", - "contextWindowTokens": 163840, - "maxOutputTokens": 163840, - "tags": [ - "tool-use" - ] - }, - { - "provider": "sambanova", - "providerModelId": "DeepSeek-V3.1", - "contextWindowTokens": 128000, - "maxOutputTokens": 128000, - "tags": [ - "reasoning", - "tool-use" - ] - } - ] - }, - { - "slug": "deepseek/deepseek-v3.1-terminus", - "providers": [ - { - "provider": "novita", - "providerModelId": "deepseek/deepseek-v3.1-terminus", - "contextWindowTokens": 131072, - "maxOutputTokens": 65536, - "tags": [ - "implicit-caching", - "reasoning", - "tool-use" - ] - } - ] - }, - { - "slug": "deepseek/deepseek-v3.2", - "providers": [ - { - "provider": "bedrock", - "providerModelId": "deepseek.v3.2", - "contextWindowTokens": 128000, - "maxOutputTokens": 8000, - "tags": [ - "tool-use" - ] - }, - { - "provider": "deepinfra", - "providerModelId": "deepseek-ai/DeepSeek-V3.2", - "contextWindowTokens": 163842, - "maxOutputTokens": 8000, - "tags": [ - "implicit-caching", - "tool-use" - ] - }, - { - "provider": "deepseek", - "providerModelId": "deepseek-chat", - "contextWindowTokens": 128000, - "maxOutputTokens": 8000, - "tags": [ - "tool-use", - "implicit-caching" - ] - }, - { - "provider": "novita", - "providerModelId": "deepseek/deepseek-v3.2", - "contextWindowTokens": 163840, - "maxOutputTokens": 65536, - "tags": [ - "implicit-caching", - "tool-use" - ] - } - ] - }, - { - "slug": "deepseek/deepseek-v3.2-thinking", - "providers": [ - { - "provider": "bedrock", - "providerModelId": "deepseek.v3.2", - "contextWindowTokens": 128000, - "maxOutputTokens": 8000, - "tags": [ - "tool-use" - ] - }, - { - "provider": "deepinfra", - "providerModelId": "deepseek-ai/DeepSeek-V3.2", - "contextWindowTokens": 163842, - "maxOutputTokens": 8000, - "tags": [ - "implicit-caching", - "tool-use" - ] - }, - { - "provider": "fireworks", - "providerModelId": "accounts/fireworks/models/deepseek-v3p2", - "contextWindowTokens": 163000, - "maxOutputTokens": 163000, - "tags": [ - "implicit-caching", - "reasoning", - "tool-use" - ] - }, - { - "provider": "novita", - "providerModelId": "deepseek/deepseek-v3.2", - "contextWindowTokens": 163840, - "maxOutputTokens": 65536, - "tags": [ - "implicit-caching", - "tool-use" - ] - } - ] - }, - { - "slug": "deepseek/deepseek-v4-flash", - "providers": [ - { - "provider": "azure", - "providerModelId": "DeepSeek-V4-Flash", - "contextWindowTokens": 1000000, - "maxOutputTokens": 128000, - "tags": [ - "reasoning", - "tool-use" - ] - }, - { - "provider": "deepinfra", - "providerModelId": "deepseek-ai/DeepSeek-V4-Flash", - "contextWindowTokens": 1048576, - "maxOutputTokens": 1048576, - "tags": [ - "implicit-caching", - "reasoning", - "tool-use" - ] - }, - { - "provider": "deepseek", - "providerModelId": "deepseek-v4-flash", - "contextWindowTokens": 1000000, - "maxOutputTokens": 384000, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching" - ] - }, - { - "provider": "fireworks", - "providerModelId": "accounts/fireworks/models/deepseek-v4-flash", - "contextWindowTokens": 1000000, - "maxOutputTokens": 384000, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching" - ] - }, - { - "provider": "novita", - "providerModelId": "deepseek/deepseek-v4-flash", - "contextWindowTokens": 1048576, - "maxOutputTokens": 393216, - "tags": [ - "implicit-caching", - "reasoning", - "tool-use" - ] - } - ] - }, - { - "slug": "deepseek/deepseek-v4-pro", - "providers": [ - { - "provider": "azure", - "providerModelId": "DeepSeek-V4-Pro", - "contextWindowTokens": 1000000, - "maxOutputTokens": 128000, - "tags": [ - "reasoning", - "tool-use" - ] - }, - { - "provider": "baseten", - "providerModelId": "deepseek-ai/DeepSeek-V4-Pro", - "contextWindowTokens": 1048600, - "maxOutputTokens": 1048600, - "tags": [ - "implicit-caching", - "reasoning", - "tool-use" - ] - }, - { - "provider": "deepinfra", - "providerModelId": "deepseek-ai/DeepSeek-V4-Pro", - "contextWindowTokens": 65536, - "maxOutputTokens": 65536, - "tags": [ - "implicit-caching", - "reasoning", - "tool-use" - ] - }, - { - "provider": "deepseek", - "providerModelId": "deepseek-v4-pro", - "contextWindowTokens": 1000000, - "maxOutputTokens": 384000, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching" - ] - }, - { - "provider": "fireworks", - "providerModelId": "accounts/fireworks/models/deepseek-v4-pro", - "contextWindowTokens": 1048600, - "maxOutputTokens": 1048600, - "tags": [ - "implicit-caching", - "reasoning", - "tool-use" - ] - }, - { - "provider": "novita", - "providerModelId": "deepseek/deepseek-v4-pro", - "contextWindowTokens": 1048576, - "maxOutputTokens": 393216, - "tags": [ - "implicit-caching", - "reasoning", - "tool-use" - ] - }, - { - "provider": "togetherai", - "providerModelId": "deepseek-ai/DeepSeek-V4-Pro", - "contextWindowTokens": 1048600, - "maxOutputTokens": 1048600, - "tags": [ - "implicit-caching", - "reasoning", - "tool-use" - ] - } - ] - }, - { - "slug": "google/gemini-2.5-flash", - "providers": [ - { - "provider": "google", - "providerModelId": "gemini-2.5-flash", - "contextWindowTokens": 1000000, - "maxOutputTokens": 64000, - "tags": [ - "file-input", - "reasoning", - "tool-use", - "vision", - "web-search", - "implicit-caching" - ] - }, - { - "provider": "vertex", - "providerModelId": "gemini-2.5-flash", - "contextWindowTokens": 1000000, - "maxOutputTokens": 65536, - "tags": [ - "file-input", - "reasoning", - "tool-use", - "vision", - "web-search", - "implicit-caching" - ] - } - ] - }, - { - "slug": "google/gemini-2.5-flash-image", - "providers": [ - { - "provider": "google", - "providerModelId": "gemini-2.5-flash-image", - "contextWindowTokens": 32768, - "maxOutputTokens": 32768, - "tags": [ - "image-generation", - "web-search" - ] - }, - { - "provider": "vertex", - "providerModelId": "gemini-2.5-flash-image", - "contextWindowTokens": 32768, - "maxOutputTokens": 65536, - "tags": [ - "image-generation", - "web-search" - ] - } - ] - }, - { - "slug": "google/gemini-2.5-flash-lite", - "providers": [ - { - "provider": "google", - "providerModelId": "gemini-2.5-flash-lite", - "contextWindowTokens": 1048576, - "maxOutputTokens": 65536, - "tags": [ - "file-input", - "reasoning", - "tool-use", - "vision", - "web-search", - "implicit-caching" - ] - }, - { - "provider": "vertex", - "providerModelId": "gemini-2.5-flash-lite", - "contextWindowTokens": 1048576, - "maxOutputTokens": 65536, - "tags": [ - "file-input", - "reasoning", - "tool-use", - "vision", - "web-search", - "implicit-caching" - ] - } - ] - }, - { - "slug": "google/gemini-2.5-pro", - "providers": [ - { - "provider": "google", - "providerModelId": "gemini-2.5-pro", - "contextWindowTokens": 1048576, - "maxOutputTokens": 65536, - "tags": [ - "file-input", - "reasoning", - "tool-use", - "vision", - "web-search", - "implicit-caching" - ] - }, - { - "provider": "vertex", - "providerModelId": "gemini-2.5-pro", - "contextWindowTokens": 1048576, - "maxOutputTokens": 65536, - "tags": [ - "file-input", - "reasoning", - "tool-use", - "vision", - "web-search", - "implicit-caching" - ] - } - ] - }, - { - "slug": "google/gemini-3-flash", - "providers": [ - { - "provider": "google", - "providerModelId": "gemini-3-flash-preview", - "contextWindowTokens": 1000000, - "maxOutputTokens": 64000, - "tags": [ - "reasoning", - "file-input", - "vision", - "tool-use", - "web-search", - "implicit-caching" - ] - }, - { - "provider": "vertex", - "providerModelId": "gemini-3-flash-preview", - "contextWindowTokens": 1000000, - "maxOutputTokens": 65000, - "tags": [ - "reasoning", - "tool-use", - "file-input", - "vision", - "web-search", - "implicit-caching" - ] - } - ] - }, - { - "slug": "google/gemini-3-pro-image", - "providers": [ - { - "provider": "google", - "providerModelId": "gemini-3-pro-image", - "contextWindowTokens": 65536, - "maxOutputTokens": 32768, - "tags": [ - "image-generation", - "web-search", - "implicit-caching" - ] - }, - { - "provider": "vertex", - "providerModelId": "gemini-3-pro-image", - "contextWindowTokens": 65536, - "maxOutputTokens": 32768, - "tags": [ - "image-generation", - "web-search" - ] - } - ] - }, - { - "slug": "google/gemini-3-pro-preview", - "providers": [ - { - "provider": "google", - "providerModelId": "gemini-3.1-pro-preview-customtools", - "contextWindowTokens": 1000000, - "maxOutputTokens": 64000, - "tags": [ - "file-input", - "tool-use", - "reasoning", - "vision", - "web-search", - "implicit-caching" - ] - }, - { - "provider": "vertex", - "providerModelId": "gemini-3.1-pro-preview", - "contextWindowTokens": 1000000, - "maxOutputTokens": 64000, - "tags": [ - "file-input", - "tool-use", - "reasoning", - "vision", - "web-search", - "implicit-caching" - ] - } - ] - }, - { - "slug": "google/gemini-3.1-flash-image", - "providers": [ - { - "provider": "google", - "providerModelId": "gemini-3.1-flash-image", - "contextWindowTokens": 131072, - "maxOutputTokens": 32768, - "tags": [ - "image-generation", - "implicit-caching", - "reasoning", - "vision", - "web-search" - ] - }, - { - "provider": "vertex", - "providerModelId": "gemini-3.1-flash-image", - "contextWindowTokens": 131072, - "maxOutputTokens": 32768, - "tags": [ - "image-generation", - "reasoning", - "vision", - "web-search" - ] - } - ] - }, - { - "slug": "google/gemini-3.1-flash-image-preview", - "providers": [ - { - "provider": "google", - "providerModelId": "gemini-3.1-flash-image-preview", - "contextWindowTokens": 131072, - "maxOutputTokens": 32768, - "tags": [ - "image-generation", - "implicit-caching", - "reasoning", - "vision", - "web-search" - ] - }, - { - "provider": "vertex", - "providerModelId": "gemini-3.1-flash-image-preview", - "contextWindowTokens": 131072, - "maxOutputTokens": 32768, - "tags": [ - "image-generation", - "reasoning", - "vision", - "web-search" - ] - } - ] - }, - { - "slug": "google/gemini-3.1-flash-lite", - "providers": [ - { - "provider": "google", - "providerModelId": "gemini-3.1-flash-lite", - "contextWindowTokens": 1000000, - "maxOutputTokens": 65000, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching", - "file-input", - "vision", - "web-search" - ] - }, - { - "provider": "vertex", - "providerModelId": "gemini-3.1-flash-lite", - "contextWindowTokens": 1000000, - "maxOutputTokens": 65000, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching", - "file-input", - "vision", - "web-search" - ] - } - ] - }, - { - "slug": "google/gemini-3.1-flash-lite-image", - "providers": [ - { - "provider": "google", - "providerModelId": "gemini-3.1-flash-lite-image", - "contextWindowTokens": 65536, - "maxOutputTokens": 4096, - "tags": [ - "image-generation", - "implicit-caching", - "reasoning", - "vision", - "web-search" - ] - }, - { - "provider": "vertex", - "providerModelId": "gemini-3.1-flash-lite-image", - "contextWindowTokens": 65536, - "maxOutputTokens": 4096, - "tags": [ - "image-generation", - "implicit-caching", - "reasoning", - "vision", - "web-search" - ] - } - ] - }, - { - "slug": "google/gemini-3.1-flash-lite-preview", - "providers": [ - { - "provider": "google", - "providerModelId": "gemini-3.1-flash-lite-preview", - "contextWindowTokens": 1000000, - "maxOutputTokens": 65000, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching", - "file-input", - "vision", - "web-search" - ] - }, - { - "provider": "vertex", - "providerModelId": "gemini-3.1-flash-lite-preview", - "contextWindowTokens": 1000000, - "maxOutputTokens": 65000, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching", - "vision", - "file-input", - "web-search" - ] - } - ] - }, - { - "slug": "google/gemini-3.1-pro-preview", - "providers": [ - { - "provider": "google", - "providerModelId": "gemini-3.1-pro-preview-customtools", - "contextWindowTokens": 1000000, - "maxOutputTokens": 64000, - "tags": [ - "file-input", - "tool-use", - "reasoning", - "vision", - "web-search", - "implicit-caching" - ] - }, - { - "provider": "vertex", - "providerModelId": "gemini-3.1-pro-preview", - "contextWindowTokens": 1000000, - "maxOutputTokens": 64000, - "tags": [ - "file-input", - "tool-use", - "reasoning", - "vision", - "web-search", - "implicit-caching" - ] - } - ] - }, - { - "slug": "google/gemini-3.5-flash", - "providers": [ - { - "provider": "google", - "providerModelId": "gemini-3.5-flash", - "contextWindowTokens": 1000000, - "maxOutputTokens": 64000, - "tags": [ - "reasoning", - "file-input", - "vision", - "tool-use", - "web-search", - "implicit-caching" - ] - }, - { - "provider": "vertex", - "providerModelId": "gemini-3.5-flash", - "contextWindowTokens": 1000000, - "maxOutputTokens": 64000, - "tags": [ - "reasoning", - "file-input", - "vision", - "tool-use", - "web-search", - "implicit-caching" - ] - } - ] - }, - { - "slug": "google/gemini-embedding-001", - "providers": [ - { - "provider": "google", - "providerModelId": "gemini-embedding-001", - "contextWindowTokens": 0, - "maxOutputTokens": 0 - }, - { - "provider": "vertex", - "providerModelId": "gemini-embedding-001", - "contextWindowTokens": 0, - "maxOutputTokens": 0 - } - ] - }, - { - "slug": "google/gemini-embedding-2", - "providers": [ - { - "provider": "google", - "providerModelId": "gemini-embedding-2-preview", - "contextWindowTokens": 0, - "maxOutputTokens": 0 - } - ] - }, - { - "slug": "google/gemini-omni-flash-preview", - "providers": [ - { - "provider": "google", - "providerModelId": "gemini-omni-flash-preview", - "contextWindowTokens": 1000000, - "maxOutputTokens": 57920, - "tags": [ - "file-input", - "reasoning", - "vision", - "video-generation" - ] - }, - { - "provider": "vertex", - "providerModelId": "gemini-omni-flash-preview", - "contextWindowTokens": 1000000, - "maxOutputTokens": 57920, - "tags": [ - "file-input", - "reasoning", - "vision", - "video-generation" - ] - } - ] - }, - { - "slug": "google/gemma-4-26b-a4b-it", - "providers": [ - { - "provider": "novita", - "providerModelId": "google/gemma-4-26b-a4b-it", - "contextWindowTokens": 262144, - "maxOutputTokens": 131072, - "tags": [ - "file-input", - "reasoning", - "tool-use", - "vision" - ] - }, - { - "provider": "parasail", - "providerModelId": "google/gemma-4-26B-A4B-it", - "contextWindowTokens": 262144, - "maxOutputTokens": 131072, - "tags": [ - "tool-use", - "vision" - ] - }, - { - "provider": "vertex", - "providerModelId": "google/gemma-4-26b-a4b-it-maas", - "contextWindowTokens": 262144, - "maxOutputTokens": 131072, - "tags": [ - "file-input", - "implicit-caching", - "reasoning", - "tool-use", - "vision" - ] - } - ] - }, - { - "slug": "google/gemma-4-31b-it", - "providers": [ - { - "provider": "cerebras", - "providerModelId": "gemma-4-31b", - "contextWindowTokens": 131000, - "maxOutputTokens": 40000, - "tags": [ - "file-input", - "reasoning", - "tool-use", - "vision" - ] - }, - { - "provider": "novita", - "providerModelId": "google/gemma-4-31b-it", - "contextWindowTokens": 262144, - "maxOutputTokens": 131072, - "tags": [ - "file-input", - "reasoning", - "tool-use", - "vision" - ] - }, - { - "provider": "parasail", - "providerModelId": "google/gemma-4-31B-it", - "contextWindowTokens": 262144, - "maxOutputTokens": 131072, - "tags": [ - "tool-use" - ] - } - ] - }, - { - "slug": "google/imagen-4.0-fast-generate-001", - "providers": [ - { - "provider": "vertex", - "providerModelId": "imagen-4.0-fast-generate-001", - "contextWindowTokens": 480, - "maxOutputTokens": 0, - "tags": [ - "image-generation" - ] - } - ] - }, - { - "slug": "google/imagen-4.0-generate-001", - "providers": [ - { - "provider": "vertex", - "providerModelId": "imagen-4.0-generate-001", - "contextWindowTokens": 480, - "maxOutputTokens": 0, - "tags": [ - "image-generation" - ] - } - ] - }, - { - "slug": "google/imagen-4.0-ultra-generate-001", - "providers": [ - { - "provider": "vertex", - "providerModelId": "imagen-4.0-ultra-generate-001", - "contextWindowTokens": 480, - "maxOutputTokens": 0, - "tags": [ - "image-generation" - ] - } - ] - }, - { - "slug": "google/text-embedding-005", - "providers": [ - { - "provider": "vertex", - "providerModelId": "text-embedding-005", - "contextWindowTokens": 0, - "maxOutputTokens": 0 - } - ] - }, - { - "slug": "google/text-multilingual-embedding-002", - "providers": [ - { - "provider": "vertex", - "providerModelId": "text-multilingual-embedding-002", - "contextWindowTokens": 0, - "maxOutputTokens": 0 - } - ] - }, - { - "slug": "google/veo-3.0-fast-generate-001", - "providers": [ - { - "provider": "vertex", - "providerModelId": "veo-3.0-fast-generate-001", - "contextWindowTokens": 0, - "maxOutputTokens": 0 - } - ] - }, - { - "slug": "google/veo-3.0-generate-001", - "providers": [ - { - "provider": "vertex", - "providerModelId": "veo-3.0-generate-001", - "contextWindowTokens": 0, - "maxOutputTokens": 0 - } - ] - }, - { - "slug": "google/veo-3.1-fast-generate-001", - "providers": [ - { - "provider": "vertex", - "providerModelId": "veo-3.1-fast-generate-001", - "contextWindowTokens": 0, - "maxOutputTokens": 0 - } - ] - }, - { - "slug": "google/veo-3.1-generate-001", - "providers": [ - { - "provider": "vertex", - "providerModelId": "veo-3.1-generate-001", - "contextWindowTokens": 0, - "maxOutputTokens": 0 - } - ] - }, - { - "slug": "inception/mercury-2", - "providers": [ - { - "provider": "inception", - "providerModelId": "mercury-2", - "contextWindowTokens": 128000, - "maxOutputTokens": 128000, - "tags": [ - "reasoning", - "tool-use" - ] - } - ] - }, - { - "slug": "inception/mercury-coder-small", - "providers": [ - { - "provider": "inception", - "providerModelId": "mercury-coder-small", - "contextWindowTokens": 32000, - "maxOutputTokens": 16384, - "tags": [ - "tool-use" - ] - } - ] - }, - { - "slug": "interfaze/interfaze-beta", - "providers": [ - { - "provider": "interfaze", - "providerModelId": "interfaze-beta", - "contextWindowTokens": 1000000, - "maxOutputTokens": 32000, - "tags": [ - "file-input", - "reasoning", - "tool-use", - "vision" - ] - } - ] - }, - { - "slug": "klingai/kling-v2.5-turbo-i2v", - "providers": [ - { - "provider": "klingai", - "providerModelId": "kling-v2.5-turbo-i2v", - "contextWindowTokens": 0, - "maxOutputTokens": 0 - } - ] - }, - { - "slug": "klingai/kling-v2.5-turbo-t2v", - "providers": [ - { - "provider": "klingai", - "providerModelId": "kling-v2.5-turbo-t2v", - "contextWindowTokens": 0, - "maxOutputTokens": 0 - } - ] - }, - { - "slug": "klingai/kling-v2.6-i2v", - "providers": [ - { - "provider": "klingai", - "providerModelId": "kling-v2.6-i2v", - "contextWindowTokens": 0, - "maxOutputTokens": 0 - } - ] - }, - { - "slug": "klingai/kling-v2.6-motion-control", - "providers": [ - { - "provider": "klingai", - "providerModelId": "kling-v2.6-motion-control", - "contextWindowTokens": 0, - "maxOutputTokens": 0 - } - ] - }, - { - "slug": "klingai/kling-v2.6-t2v", - "providers": [ - { - "provider": "klingai", - "providerModelId": "kling-v2.6-t2v", - "contextWindowTokens": 0, - "maxOutputTokens": 0 - } - ] - }, - { - "slug": "klingai/kling-v3.0-i2v", - "providers": [ - { - "provider": "klingai", - "providerModelId": "kling-v3.0-i2v", - "contextWindowTokens": 0, - "maxOutputTokens": 0 - } - ] - }, - { - "slug": "klingai/kling-v3.0-motion-control", - "providers": [ - { - "provider": "klingai", - "providerModelId": "kling-v3.0-motion-control", - "contextWindowTokens": 0, - "maxOutputTokens": 0, - "tags": [ - "video-generation" - ] - } - ] - }, - { - "slug": "klingai/kling-v3.0-t2v", - "providers": [ - { - "provider": "klingai", - "providerModelId": "kling-v3.0-t2v", - "contextWindowTokens": 0, - "maxOutputTokens": 0 - } - ] - }, - { - "slug": "kwaipilot/kat-coder-air-v2.5", - "providers": [ - { - "provider": "streamlake", - "providerModelId": "ep-bpaqjj-1784100896685207084", - "contextWindowTokens": 256000, - "maxOutputTokens": 80000, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching" - ] - } - ] - }, - { - "slug": "kwaipilot/kat-coder-pro-v1", - "providers": [ - { - "provider": "novita", - "providerModelId": "kwaipilot/kat-coder-pro", - "contextWindowTokens": 256000, - "maxOutputTokens": 32000, - "tags": [ - "tool-use" - ] - } - ] - }, - { - "slug": "kwaipilot/kat-coder-pro-v2", - "providers": [ - { - "provider": "streamlake", - "providerModelId": "KAT-Coder-Pro-V2", - "contextWindowTokens": 256000, - "maxOutputTokens": 256000, - "tags": [ - "tool-use", - "reasoning", - "implicit-caching" - ] - } - ] - }, - { - "slug": "kwaipilot/kat-coder-pro-v2.5", - "providers": [ - { - "provider": "streamlake", - "providerModelId": "ep-qqnixx-1783732345481157283", - "contextWindowTokens": 256000, - "maxOutputTokens": 80000, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching" - ] - } - ] - }, - { - "slug": "meta/llama-3.1-70b", - "providers": [ - { - "provider": "bedrock", - "providerModelId": "us.meta.llama3-1-70b-instruct-v1:0", - "contextWindowTokens": 128000, - "maxOutputTokens": 8192, - "tags": [ - "tool-use" - ] - }, - { - "provider": "deepinfra", - "providerModelId": "meta-llama/Meta-Llama-3.1-70B-Instruct", - "contextWindowTokens": 131072, - "maxOutputTokens": 16384, - "tags": [ - "tool-use" - ] - } - ] - }, - { - "slug": "meta/llama-3.1-8b", - "providers": [ - { - "provider": "bedrock", - "providerModelId": "us.meta.llama3-1-8b-instruct-v1:0", - "contextWindowTokens": 128000, - "maxOutputTokens": 8192, - "tags": [ - "tool-use" - ] - }, - { - "provider": "deepinfra", - "providerModelId": "meta-llama/Meta-Llama-3.1-8B-Instruct", - "contextWindowTokens": 131072, - "maxOutputTokens": 16384, - "tags": [ - "tool-use" - ] - }, - { - "provider": "groq", - "providerModelId": "llama-3.1-8b-instant", - "contextWindowTokens": 131000, - "maxOutputTokens": 131072, - "tags": [ - "implicit-caching", - "tool-use" - ] - }, - { - "provider": "novita", - "providerModelId": "meta-llama/llama-3.1-8b-instruct", - "contextWindowTokens": 16384, - "maxOutputTokens": 16384, - "tags": [ - "tool-use" - ] - } - ] - }, - { - "slug": "meta/llama-3.2-11b", - "providers": [ - { - "provider": "bedrock", - "providerModelId": "us.meta.llama3-2-11b-instruct-v1:0", - "contextWindowTokens": 128000, - "maxOutputTokens": 8192, - "tags": [ - "tool-use", - "vision" - ] - } - ] - }, - { - "slug": "meta/llama-3.2-1b", - "providers": [ - { - "provider": "bedrock", - "providerModelId": "us.meta.llama3-2-1b-instruct-v1:0", - "contextWindowTokens": 128000, - "maxOutputTokens": 8192 - } - ] - }, - { - "slug": "meta/llama-3.2-3b", - "providers": [ - { - "provider": "bedrock", - "providerModelId": "us.meta.llama3-2-3b-instruct-v1:0", - "contextWindowTokens": 128000, - "maxOutputTokens": 8192 - } - ] - }, - { - "slug": "meta/llama-3.2-90b", - "providers": [ - { - "provider": "bedrock", - "providerModelId": "us.meta.llama3-2-90b-instruct-v1:0", - "contextWindowTokens": 128000, - "maxOutputTokens": 8192, - "tags": [ - "tool-use", - "vision" - ] - } - ] - }, - { - "slug": "meta/llama-3.3-70b", - "providers": [ - { - "provider": "bedrock", - "providerModelId": "us.meta.llama3-3-70b-instruct-v1:0", - "contextWindowTokens": 128000, - "maxOutputTokens": 8192, - "tags": [ - "tool-use" - ] - }, - { - "provider": "groq", - "providerModelId": "llama-3.3-70b-versatile", - "contextWindowTokens": 128000, - "maxOutputTokens": 32768, - "tags": [ - "tool-use" - ] - } - ] - }, - { - "slug": "meta/llama-4-maverick", - "providers": [ - { - "provider": "bedrock", - "providerModelId": "us.meta.llama4-maverick-17b-instruct-v1:0", - "contextWindowTokens": 128000, - "maxOutputTokens": 8192, - "tags": [ - "tool-use", - "vision" - ] - }, - { - "provider": "deepinfra", - "providerModelId": "meta-llama/Llama-4-Maverick-17B-128E-Instruct-FP8", - "contextWindowTokens": 131072, - "maxOutputTokens": 8192, - "tags": [ - "tool-use", - "vision" - ] - } - ] - }, - { - "slug": "meta/llama-4-scout", - "providers": [ - { - "provider": "bedrock", - "providerModelId": "us.meta.llama4-scout-17b-instruct-v1:0", - "contextWindowTokens": 128000, - "maxOutputTokens": 8192, - "tags": [ - "tool-use", - "vision" - ] - }, - { - "provider": "deepinfra", - "providerModelId": "meta-llama/Llama-4-Scout-17B-16E-Instruct", - "contextWindowTokens": 131072, - "maxOutputTokens": 8192, - "tags": [ - "tool-use", - "vision" - ] - }, - { - "provider": "groq", - "providerModelId": "meta-llama/llama-4-scout-17b-16e-instruct", - "contextWindowTokens": 131072, - "maxOutputTokens": 8192, - "tags": [ - "tool-use", - "vision" - ] - } - ] - }, - { - "slug": "meta/muse-spark-1.1", - "providers": [ - { - "provider": "meta", - "providerModelId": "muse-spark-1.1", - "contextWindowTokens": 1048576, - "maxOutputTokens": 1048576, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching", - "file-input", - "vision" - ] - } - ] - }, - { - "slug": "minimax/minimax-m2", - "providers": [ - { - "provider": "minimax", - "providerModelId": "MiniMax-M2-Stable", - "contextWindowTokens": 205000, - "maxOutputTokens": 205000, - "tags": [ - "reasoning", - "tool-use" - ] - }, - { - "provider": "novita", - "providerModelId": "minimax/minimax-m2", - "contextWindowTokens": 204800, - "maxOutputTokens": 131072, - "tags": [ - "reasoning", - "tool-use" - ] - } - ] - }, - { - "slug": "minimax/minimax-m2.1", - "providers": [ - { - "provider": "bedrock", - "providerModelId": "minimax.minimax-m2.1", - "contextWindowTokens": 204800, - "maxOutputTokens": 131072, - "tags": [ - "reasoning", - "tool-use" - ] - }, - { - "provider": "minimax", - "providerModelId": "MiniMax-M2.1", - "contextWindowTokens": 204800, - "maxOutputTokens": 131072, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching" - ] - }, - { - "provider": "novita", - "providerModelId": "minimax/minimax-m2.1", - "contextWindowTokens": 204800, - "maxOutputTokens": 131072, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching" - ] - } - ] - }, - { - "slug": "minimax/minimax-m2.1-lightning", - "providers": [ - { - "provider": "minimax", - "providerModelId": "MiniMax-M2.1-lightning", - "contextWindowTokens": 204800, - "maxOutputTokens": 131072, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching" - ] - } - ] - }, - { - "slug": "minimax/minimax-m2.5", - "providers": [ - { - "provider": "bedrock", - "providerModelId": "minimax.minimax-m2.5", - "contextWindowTokens": 1000000, - "maxOutputTokens": 8192, - "tags": [ - "reasoning", - "tool-use" - ] - }, - { - "provider": "blackbox", - "providerModelId": "blackboxai/minimax/minimax-m2.5", - "contextWindowTokens": 128000, - "maxOutputTokens": 128000, - "tags": [ - "reasoning", - "tool-use" - ] - }, - { - "provider": "deepinfra", - "providerModelId": "MiniMaxAI/MiniMax-M2.5", - "contextWindowTokens": 196608, - "maxOutputTokens": 131000, - "tags": [ - "implicit-caching", - "reasoning", - "tool-use" - ] - }, - { - "provider": "minimax", - "providerModelId": "MiniMax-M2.5", - "contextWindowTokens": 204800, - "maxOutputTokens": 131000, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching" - ] - }, - { - "provider": "nebius", - "providerModelId": "MiniMaxAI/MiniMax-M2.5", - "contextWindowTokens": 196000, - "maxOutputTokens": 196000, - "tags": [ - "reasoning", - "tool-use" - ] - }, - { - "provider": "parasail", - "providerModelId": "MiniMaxAI/MiniMax-M2.5", - "contextWindowTokens": 196608, - "maxOutputTokens": 131000, - "tags": [ - "reasoning", - "tool-use" - ] - } - ] - }, - { - "slug": "minimax/minimax-m2.5-highspeed", - "providers": [ - { - "provider": "minimax", - "providerModelId": "minimax-m2.5-highspeed", - "contextWindowTokens": 204800, - "maxOutputTokens": 131000, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching" - ] - }, - { - "provider": "novita", - "providerModelId": "minimax/minimax-m2.5-highspeed", - "contextWindowTokens": 204800, - "maxOutputTokens": 131100, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching" - ] - } - ] - }, - { - "slug": "minimax/minimax-m2.7", - "providers": [ - { - "provider": "blackbox", - "providerModelId": "blackboxai/minimax/minimax-m2.7", - "contextWindowTokens": 200000, - "maxOutputTokens": 8200, - "tags": [ - "reasoning", - "tool-use" - ] - }, - { - "provider": "fireworks", - "providerModelId": "accounts/fireworks/models/minimax-m2p7", - "contextWindowTokens": 196000, - "maxOutputTokens": 131000, - "tags": [ - "tool-use", - "reasoning", - "implicit-caching" - ] - }, - { - "provider": "minimax", - "providerModelId": "minimax-m2.7", - "contextWindowTokens": 204800, - "maxOutputTokens": 131000, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching" - ] - }, - { - "provider": "novita", - "providerModelId": "minimax/minimax-m2.7", - "contextWindowTokens": 204800, - "maxOutputTokens": 131072, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching" - ] - }, - { - "provider": "togetherai", - "providerModelId": "MiniMaxAI/MiniMax-M2.7", - "contextWindowTokens": 196600, - "maxOutputTokens": 131000, - "tags": [ - "implicit-caching", - "reasoning", - "tool-use" - ] - } - ] - }, - { - "slug": "minimax/minimax-m2.7-highspeed", - "providers": [ - { - "provider": "minimax", - "providerModelId": "minimax-m2.7-highspeed", - "contextWindowTokens": 204800, - "maxOutputTokens": 131100, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching" - ] - } - ] - }, - { - "slug": "minimax/minimax-m3", - "providers": [ - { - "provider": "fireworks", - "providerModelId": "accounts/fireworks/models/minimax-m3", - "contextWindowTokens": 512000, - "maxOutputTokens": 512000, - "tags": [ - "reasoning", - "tool-use", - "vision", - "file-input", - "implicit-caching" - ] - }, - { - "provider": "minimax", - "providerModelId": "MiniMax-M3", - "contextWindowTokens": 1000000, - "maxOutputTokens": 1000000, - "tags": [ - "implicit-caching", - "reasoning", - "tool-use", - "vision" - ] - } - ] - }, - { - "slug": "mistral/codestral", - "providers": [ - { - "provider": "mistral", - "providerModelId": "codestral-latest", - "contextWindowTokens": 128000, - "maxOutputTokens": 4000, - "tags": [ - "tool-use" - ] - } - ] - }, - { - "slug": "mistral/codestral-embed", - "providers": [ - { - "provider": "mistral", - "providerModelId": "codestral-embed", - "contextWindowTokens": 0, - "maxOutputTokens": 0 - } - ] - }, - { - "slug": "mistral/devstral-2", - "providers": [ - { - "provider": "mistral", - "providerModelId": "devstral-2512", - "contextWindowTokens": 256000, - "maxOutputTokens": 256000, - "tags": [ - "tool-use" - ] - } - ] - }, - { - "slug": "mistral/devstral-small-2", - "providers": [ - { - "provider": "mistral", - "providerModelId": "labs-devstral-small-2512", - "contextWindowTokens": 256000, - "maxOutputTokens": 256000, - "tags": [ - "tool-use", - "vision" - ] - } - ] - }, - { - "slug": "mistral/magistral-medium", - "providers": [ - { - "provider": "mistral", - "providerModelId": "magistral-medium-2509", - "contextWindowTokens": 128000, - "maxOutputTokens": 64000, - "tags": [ - "reasoning", - "tool-use", - "vision" - ] - } - ] - }, - { - "slug": "mistral/magistral-small", - "providers": [ - { - "provider": "mistral", - "providerModelId": "magistral-small-2509", - "contextWindowTokens": 128000, - "maxOutputTokens": 64000, - "tags": [ - "reasoning", - "tool-use", - "vision" - ] - } - ] - }, - { - "slug": "mistral/ministral-14b", - "providers": [ - { - "provider": "mistral", - "providerModelId": "ministral-14b-latest", - "contextWindowTokens": 256000, - "maxOutputTokens": 256000, - "tags": [ - "file-input", - "tool-use", - "vision" - ] - } - ] - }, - { - "slug": "mistral/ministral-3b", - "providers": [ - { - "provider": "mistral", - "providerModelId": "ministral-3b-latest", - "contextWindowTokens": 128000, - "maxOutputTokens": 4000, - "tags": [ - "tool-use" - ] - } - ] - }, - { - "slug": "mistral/ministral-8b", - "providers": [ - { - "provider": "mistral", - "providerModelId": "ministral-8b-latest", - "contextWindowTokens": 128000, - "maxOutputTokens": 4000, - "tags": [ - "tool-use" - ] - } - ] - }, - { - "slug": "mistral/mistral-embed", - "providers": [ - { - "provider": "mistral", - "providerModelId": "mistral-embed", - "contextWindowTokens": 0, - "maxOutputTokens": 0 - } - ] - }, - { - "slug": "mistral/mistral-large-3", - "providers": [ - { - "provider": "mistral", - "providerModelId": "mistral-large-latest", - "contextWindowTokens": 256000, - "maxOutputTokens": 256000, - "tags": [ - "tool-use", - "vision" - ] - } - ] - }, - { - "slug": "mistral/mistral-medium", - "providers": [ - { - "provider": "mistral", - "providerModelId": "mistral-medium-2508", - "contextWindowTokens": 128000, - "maxOutputTokens": 64000, - "tags": [ - "tool-use", - "vision" - ] - } - ] - }, - { - "slug": "mistral/mistral-medium-3.5", - "providers": [ - { - "provider": "mistral", - "providerModelId": "mistral-medium-3-5", - "contextWindowTokens": 256000, - "maxOutputTokens": 256000, - "tags": [ - "reasoning", - "tool-use", - "vision" - ] - } - ] - }, - { - "slug": "mistral/mistral-nemo", - "providers": [ - { - "provider": "deepinfra", - "providerModelId": "mistralai/Mistral-Nemo-Instruct-2407", - "contextWindowTokens": 131072, - "maxOutputTokens": 131072, - "tags": [ - "tool-use" - ] - }, - { - "provider": "mistral", - "providerModelId": "open-mistral-nemo-2407", - "contextWindowTokens": 128000, - "maxOutputTokens": 128000, - "tags": [ - "tool-use" - ] - }, - { - "provider": "novita", - "providerModelId": "mistralai/mistral-nemo", - "contextWindowTokens": 60288, - "maxOutputTokens": 16000, - "tags": [ - "tool-use" - ] - } - ] - }, - { - "slug": "mistral/mistral-small", - "providers": [ - { - "provider": "mistral", - "providerModelId": "mistral-small-latest", - "contextWindowTokens": 32000, - "maxOutputTokens": 4000, - "tags": [ - "tool-use", - "vision" - ] - } - ] - }, - { - "slug": "mistral/pixtral-12b", - "providers": [ - { - "provider": "mistral", - "providerModelId": "pixtral-12b-2409", - "contextWindowTokens": 128000, - "maxOutputTokens": 4000, - "tags": [ - "tool-use", - "vision" - ] - } - ] - }, - { - "slug": "moonshotai/kimi-k2", - "providers": [ - { - "provider": "novita", - "providerModelId": "moonshotai/kimi-k2-instruct", - "contextWindowTokens": 131072, - "maxOutputTokens": 131072, - "tags": [ - "tool-use" - ] - } - ] - }, - { - "slug": "moonshotai/kimi-k2-thinking", - "providers": [ - { - "provider": "deepinfra", - "providerModelId": "moonshotai/Kimi-K2-Thinking", - "contextWindowTokens": 216144, - "maxOutputTokens": 216144, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching" - ] - } - ] - }, - { - "slug": "moonshotai/kimi-k2.5", - "providers": [ - { - "provider": "baseten", - "providerModelId": "moonshotai/Kimi-K2.5", - "contextWindowTokens": 262114, - "maxOutputTokens": 262114, - "tags": [ - "reasoning", - "vision", - "tool-use", - "implicit-caching" - ] - }, - { - "provider": "bedrock", - "providerModelId": "moonshotai.kimi-k2.5", - "contextWindowTokens": 256000, - "maxOutputTokens": 256000, - "tags": [ - "reasoning", - "vision", - "tool-use" - ] - }, - { - "provider": "fireworks", - "providerModelId": "accounts/fireworks/models/kimi-k2p5", - "contextWindowTokens": 256000, - "maxOutputTokens": 256000, - "tags": [ - "reasoning", - "tool-use", - "vision", - "implicit-caching" - ] - }, - { - "provider": "moonshotai", - "providerModelId": "kimi-k2.5", - "contextWindowTokens": 262114, - "maxOutputTokens": 262114, - "tags": [ - "reasoning", - "vision", - "tool-use", - "implicit-caching" - ] - }, - { - "provider": "novita", - "providerModelId": "moonshotai/kimi-k2.5", - "contextWindowTokens": 262144, - "maxOutputTokens": 262144, - "tags": [ - "reasoning", - "vision", - "tool-use", - "implicit-caching" - ] - } - ] - }, - { - "slug": "moonshotai/kimi-k2.6", - "providers": [ - { - "provider": "baseten", - "providerModelId": "moonshotai/Kimi-K2.6", - "contextWindowTokens": 262000, - "maxOutputTokens": 262000, - "tags": [ - "implicit-caching", - "reasoning", - "tool-use", - "vision" - ] - }, - { - "provider": "fireworks", - "providerModelId": "accounts/fireworks/models/kimi-k2p6", - "contextWindowTokens": 262000, - "maxOutputTokens": 262000, - "tags": [ - "implicit-caching", - "reasoning", - "tool-use", - "vision" - ] - }, - { - "provider": "moonshotai", - "providerModelId": "kimi-k2.6", - "contextWindowTokens": 262000, - "maxOutputTokens": 262000, - "tags": [ - "implicit-caching", - "reasoning", - "tool-use", - "vision" - ] - }, - { - "provider": "novita", - "providerModelId": "moonshotai/kimi-k2.6", - "contextWindowTokens": 262144, - "maxOutputTokens": 262144, - "tags": [ - "implicit-caching", - "reasoning", - "tool-use", - "vision" - ] - }, - { - "provider": "togetherai", - "providerModelId": "moonshotai/Kimi-K2.6", - "contextWindowTokens": 256000, - "maxOutputTokens": 256000, - "tags": [ - "implicit-caching", - "reasoning", - "tool-use", - "vision" - ] - } - ] - }, - { - "slug": "moonshotai/kimi-k2.7-code", - "providers": [ - { - "provider": "baseten", - "providerModelId": "moonshotai/Kimi-K2.7-Code", - "contextWindowTokens": 256000, - "maxOutputTokens": 32768, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching", - "file-input", - "vision" - ] - }, - { - "provider": "deepinfra", - "providerModelId": "moonshotai/Kimi-K2.7-Code", - "contextWindowTokens": 262144, - "maxOutputTokens": 32768, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching", - "file-input", - "vision" - ] - }, - { - "provider": "fireworks", - "providerModelId": "accounts/fireworks/models/kimi-k2p7-code", - "contextWindowTokens": 262000, - "maxOutputTokens": 32768, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching", - "file-input", - "vision" - ] - }, - { - "provider": "moonshotai", - "providerModelId": "kimi-k2.7-code", - "contextWindowTokens": 256000, - "maxOutputTokens": 32768, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching", - "file-input", - "vision" - ] - } - ] - }, - { - "slug": "moonshotai/kimi-k2.7-code-highspeed", - "providers": [ - { - "provider": "fireworks", - "providerModelId": "accounts/fireworks/models/kimi-k2p7-code", - "contextWindowTokens": 262000, - "maxOutputTokens": 32768, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching", - "file-input", - "vision" - ] - }, - { - "provider": "moonshotai", - "providerModelId": "kimi-k2.7-code-highspeed", - "contextWindowTokens": 262144, - "maxOutputTokens": 32768, - "tags": [ - "reasoning", - "tool-use", - "vision", - "file-input", - "implicit-caching" - ] - } - ] - }, - { - "slug": "morph/morph-v3-fast", - "providers": [ - { - "provider": "morph", - "providerModelId": "morph-v3-fast", - "contextWindowTokens": 81920, - "maxOutputTokens": 16384 - } - ] - }, - { - "slug": "morph/morph-v3-large", - "providers": [ - { - "provider": "morph", - "providerModelId": "morph-v3-large", - "contextWindowTokens": 81920, - "maxOutputTokens": 16384 - } - ] - }, - { - "slug": "nvidia/nemotron-3-nano-30b-a3b", - "providers": [ - { - "provider": "deepinfra", - "providerModelId": "nvidia/Nemotron-3-Nano-30B-A3B", - "contextWindowTokens": 262144, - "maxOutputTokens": 262144, - "tags": [ - "reasoning", - "tool-use" - ] - } - ] - }, - { - "slug": "nvidia/nemotron-3-super-120b-a12b", - "providers": [ - { - "provider": "baseten", - "providerModelId": "nvidia/Nemotron-120B-A12B", - "contextWindowTokens": 256000, - "maxOutputTokens": 32000, - "tags": [ - "reasoning", - "tool-use" - ] - }, - { - "provider": "bedrock", - "providerModelId": "nvidia.nemotron-super-3-120b", - "contextWindowTokens": 256000, - "maxOutputTokens": 32000, - "tags": [ - "reasoning", - "tool-use" - ] - } - ] - }, - { - "slug": "nvidia/nemotron-3-ultra-550b-a55b", - "providers": [ - { - "provider": "baseten", - "providerModelId": "nvidia/NVIDIA-Nemotron-3-Ultra-550B-A55B", - "contextWindowTokens": 1000000, - "maxOutputTokens": 65000, - "tags": [ - "reasoning", - "tool-use" - ] - }, - { - "provider": "blackbox", - "providerModelId": "blackboxai/nvidia/nemotron-3-ultra", - "contextWindowTokens": 1000000, - "maxOutputTokens": 65000, - "tags": [ - "reasoning", - "tool-use" - ] - }, - { - "provider": "deepinfra", - "providerModelId": "nvidia/NVIDIA-Nemotron-3-Ultra-550B-A55B", - "contextWindowTokens": 262144, - "maxOutputTokens": 65000, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching" - ] - }, - { - "provider": "togetherai", - "providerModelId": "nvidia/nemotron-3-ultra-550b-a55b", - "contextWindowTokens": 1000000, - "maxOutputTokens": 65000, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching" - ] - } - ] - }, - { - "slug": "nvidia/nemotron-nano-12b-v2-vl", - "providers": [ - { - "provider": "bedrock", - "providerModelId": "nvidia.nemotron-nano-12b-v2", - "contextWindowTokens": 131072, - "maxOutputTokens": 131072, - "tags": [ - "vision", - "reasoning", - "tool-use" - ] - }, - { - "provider": "deepinfra", - "providerModelId": "nvidia/NVIDIA-Nemotron-Nano-12B-v2-VL", - "contextWindowTokens": 131072, - "maxOutputTokens": 131072, - "tags": [ - "reasoning", - "tool-use", - "vision" - ] - } - ] - }, - { - "slug": "nvidia/nemotron-nano-9b-v2", - "providers": [ - { - "provider": "bedrock", - "providerModelId": "nvidia.nemotron-nano-9b-v2", - "contextWindowTokens": 131072, - "maxOutputTokens": 131072, - "tags": [ - "reasoning", - "tool-use" - ] - }, - { - "provider": "deepinfra", - "providerModelId": "nvidia/NVIDIA-Nemotron-Nano-9B-v2", - "contextWindowTokens": 131072, - "maxOutputTokens": 131072, - "tags": [ - "reasoning", - "tool-use" - ] - } - ] - }, - { - "slug": "openai/gpt-3.5-turbo", - "providers": [ - { - "provider": "openai", - "providerModelId": "gpt-3.5-turbo", - "contextWindowTokens": 16385, - "maxOutputTokens": 4096, - "tags": [ - "tool-use" - ] - } - ] - }, - { - "slug": "openai/gpt-4-turbo", - "providers": [ - { - "provider": "openai", - "providerModelId": "gpt-4-turbo", - "contextWindowTokens": 128000, - "maxOutputTokens": 4096, - "tags": [ - "tool-use", - "vision" - ] - } - ] - }, - { - "slug": "openai/gpt-4.1", - "providers": [ - { - "provider": "azure", - "providerModelId": "gpt-4.1", - "contextWindowTokens": 1047576, - "maxOutputTokens": 32768, - "tags": [ - "file-input", - "implicit-caching", - "tool-use", - "vision", - "web-search" - ] - }, - { - "provider": "openai", - "providerModelId": "gpt-4.1", - "contextWindowTokens": 1047576, - "maxOutputTokens": 32768, - "tags": [ - "file-input", - "tool-use", - "vision", - "implicit-caching", - "web-search" - ] - } - ] - }, - { - "slug": "openai/gpt-4.1-mini", - "providers": [ - { - "provider": "azure", - "providerModelId": "gpt-4.1-mini", - "contextWindowTokens": 1047576, - "maxOutputTokens": 32768, - "tags": [ - "file-input", - "implicit-caching", - "tool-use", - "vision", - "web-search" - ] - }, - { - "provider": "openai", - "providerModelId": "gpt-4.1-mini", - "contextWindowTokens": 1047576, - "maxOutputTokens": 32768, - "tags": [ - "file-input", - "tool-use", - "vision", - "implicit-caching", - "web-search" - ] - } - ] - }, - { - "slug": "openai/gpt-4.1-nano", - "providers": [ - { - "provider": "azure", - "providerModelId": "gpt-4.1-nano", - "contextWindowTokens": 1047576, - "maxOutputTokens": 32768, - "tags": [ - "file-input", - "implicit-caching", - "tool-use", - "vision", - "web-search" - ] - }, - { - "provider": "openai", - "providerModelId": "gpt-4.1-nano", - "contextWindowTokens": 1047576, - "maxOutputTokens": 32768, - "tags": [ - "file-input", - "tool-use", - "vision", - "implicit-caching", - "web-search" - ] - } - ] - }, - { - "slug": "openai/gpt-4o", - "providers": [ - { - "provider": "azure", - "providerModelId": "gpt-4o", - "contextWindowTokens": 128000, - "maxOutputTokens": 16384, - "tags": [ - "file-input", - "implicit-caching", - "tool-use", - "vision", - "web-search" - ] - }, - { - "provider": "openai", - "providerModelId": "gpt-4o", - "contextWindowTokens": 128000, - "maxOutputTokens": 16384, - "tags": [ - "file-input", - "tool-use", - "vision", - "implicit-caching", - "web-search" - ] - } - ] - }, - { - "slug": "openai/gpt-4o-mini", - "providers": [ - { - "provider": "azure", - "providerModelId": "gpt-4o-mini", - "contextWindowTokens": 128000, - "maxOutputTokens": 16384, - "tags": [ - "file-input", - "implicit-caching", - "tool-use", - "vision", - "web-search" - ] - }, - { - "provider": "openai", - "providerModelId": "gpt-4o-mini", - "contextWindowTokens": 128000, - "maxOutputTokens": 16384, - "tags": [ - "file-input", - "tool-use", - "vision", - "implicit-caching", - "web-search" - ] - } - ] - }, - { - "slug": "openai/gpt-4o-mini-search-preview", - "providers": [ - { - "provider": "openai", - "providerModelId": "gpt-4o-mini-search-preview", - "contextWindowTokens": 128000, - "maxOutputTokens": 16384, - "tags": [ - "web-search" - ] - } - ] - }, - { - "slug": "openai/gpt-4o-mini-transcribe", - "providers": [ - { - "provider": "openai", - "providerModelId": "gpt-4o-mini-transcribe", - "contextWindowTokens": 0, - "maxOutputTokens": 0 - } - ] - }, - { - "slug": "openai/gpt-4o-transcribe", - "providers": [ - { - "provider": "openai", - "providerModelId": "gpt-4o-transcribe", - "contextWindowTokens": 0, - "maxOutputTokens": 0 - } - ] - }, - { - "slug": "openai/gpt-5", - "providers": [ - { - "provider": "azure", - "providerModelId": "gpt-5", - "contextWindowTokens": 400000, - "maxOutputTokens": 128000, - "tags": [ - "file-input", - "implicit-caching", - "reasoning", - "tool-use", - "vision", - "web-search" - ] - }, - { - "provider": "openai", - "providerModelId": "gpt-5-2025-08-07", - "contextWindowTokens": 400000, - "maxOutputTokens": 128000, - "tags": [ - "file-input", - "implicit-caching", - "reasoning", - "tool-use", - "vision", - "web-search" - ] - } - ] - }, - { - "slug": "openai/gpt-5-chat", - "providers": [ - { - "provider": "azure", - "providerModelId": "gpt-5-chat", - "contextWindowTokens": 128000, - "maxOutputTokens": 16384, - "tags": [ - "file-input", - "implicit-caching", - "tool-use", - "vision", - "web-search" - ] - }, - { - "provider": "openai", - "providerModelId": "gpt-5-chat-latest", - "contextWindowTokens": 128000, - "maxOutputTokens": 16384, - "tags": [ - "file-input", - "implicit-caching", - "tool-use", - "vision", - "web-search" - ] - } - ] - }, - { - "slug": "openai/gpt-5-codex", - "providers": [ - { - "provider": "azure", - "providerModelId": "gpt-5-codex", - "contextWindowTokens": 400000, - "maxOutputTokens": 128000, - "tags": [ - "file-input", - "implicit-caching", - "reasoning", - "tool-use", - "vision", - "web-search" - ] - }, - { - "provider": "openai", - "providerModelId": "gpt-5-codex", - "contextWindowTokens": 400000, - "maxOutputTokens": 128000, - "tags": [ - "file-input", - "implicit-caching", - "reasoning", - "tool-use", - "vision", - "web-search" - ] - } - ] - }, - { - "slug": "openai/gpt-5-mini", - "providers": [ - { - "provider": "azure", - "providerModelId": "gpt-5-mini", - "contextWindowTokens": 400000, - "maxOutputTokens": 128000, - "tags": [ - "file-input", - "implicit-caching", - "reasoning", - "tool-use", - "vision", - "web-search" - ] - }, - { - "provider": "openai", - "providerModelId": "gpt-5-mini-2025-08-07", - "contextWindowTokens": 400000, - "maxOutputTokens": 128000, - "tags": [ - "file-input", - "implicit-caching", - "reasoning", - "tool-use", - "vision", - "web-search" - ] - } - ] - }, - { - "slug": "openai/gpt-5-nano", - "providers": [ - { - "provider": "azure", - "providerModelId": "gpt-5-nano", - "contextWindowTokens": 400000, - "maxOutputTokens": 128000, - "tags": [ - "file-input", - "implicit-caching", - "reasoning", - "tool-use", - "vision", - "web-search" - ] - }, - { - "provider": "openai", - "providerModelId": "gpt-5-nano-2025-08-07", - "contextWindowTokens": 400000, - "maxOutputTokens": 128000, - "tags": [ - "file-input", - "implicit-caching", - "reasoning", - "tool-use", - "vision", - "web-search" - ] - } - ] - }, - { - "slug": "openai/gpt-5-pro", - "providers": [ - { - "provider": "openai", - "providerModelId": "gpt-5-pro", - "contextWindowTokens": 400000, - "maxOutputTokens": 272000, - "tags": [ - "file-input", - "reasoning", - "tool-use", - "vision", - "web-search" - ] - } - ] - }, - { - "slug": "openai/gpt-5.1-codex", - "providers": [ - { - "provider": "azure", - "providerModelId": "gpt-5.1-codex", - "contextWindowTokens": 400000, - "maxOutputTokens": 128000, - "tags": [ - "file-input", - "implicit-caching", - "reasoning", - "tool-use", - "vision", - "web-search" - ] - }, - { - "provider": "openai", - "providerModelId": "gpt-5.1-codex", - "contextWindowTokens": 400000, - "maxOutputTokens": 128000, - "tags": [ - "file-input", - "tool-use", - "reasoning", - "vision", - "web-search", - "implicit-caching" - ] - } - ] - }, - { - "slug": "openai/gpt-5.1-codex-max", - "providers": [ - { - "provider": "azure", - "providerModelId": "gpt-5.1-codex-max", - "contextWindowTokens": 400000, - "maxOutputTokens": 128000, - "tags": [ - "file-input", - "implicit-caching", - "reasoning", - "tool-use", - "vision", - "web-search" - ] - }, - { - "provider": "openai", - "providerModelId": "gpt-5.1-codex-max", - "contextWindowTokens": 400000, - "maxOutputTokens": 128000, - "tags": [ - "reasoning", - "file-input", - "tool-use", - "vision", - "web-search", - "implicit-caching" - ] - } - ] - }, - { - "slug": "openai/gpt-5.1-codex-mini", - "providers": [ - { - "provider": "azure", - "providerModelId": "gpt-5.1-codex-mini", - "contextWindowTokens": 400000, - "maxOutputTokens": 128000, - "tags": [ - "file-input", - "implicit-caching", - "reasoning", - "tool-use", - "vision", - "web-search" - ] - }, - { - "provider": "openai", - "providerModelId": "gpt-5.1-codex-mini", - "contextWindowTokens": 400000, - "maxOutputTokens": 128000, - "tags": [ - "reasoning", - "file-input", - "vision", - "tool-use", - "web-search", - "implicit-caching" - ] - } - ] - }, - { - "slug": "openai/gpt-5.1-instant", - "providers": [ - { - "provider": "azure", - "providerModelId": "gpt-5.1-chat", - "contextWindowTokens": 128000, - "maxOutputTokens": 16384, - "tags": [ - "file-input", - "implicit-caching", - "tool-use", - "vision", - "web-search" - ] - }, - { - "provider": "openai", - "providerModelId": "gpt-5.1-chat-latest", - "contextWindowTokens": 128000, - "maxOutputTokens": 16384, - "tags": [ - "file-input", - "implicit-caching", - "tool-use", - "vision", - "web-search" - ] - } - ] - }, - { - "slug": "openai/gpt-5.1-thinking", - "providers": [ - { - "provider": "azure", - "providerModelId": "gpt-5.1", - "contextWindowTokens": 400000, - "maxOutputTokens": 128000, - "tags": [ - "file-input", - "implicit-caching", - "reasoning", - "tool-use", - "vision", - "web-search" - ] - }, - { - "provider": "openai", - "providerModelId": "gpt-5.1", - "contextWindowTokens": 400000, - "maxOutputTokens": 128000, - "tags": [ - "tool-use", - "implicit-caching", - "file-input", - "reasoning", - "vision", - "web-search" - ] - } - ] - }, - { - "slug": "openai/gpt-5.2", - "providers": [ - { - "provider": "azure", - "providerModelId": "gpt-5.2", - "contextWindowTokens": 400000, - "maxOutputTokens": 128000, - "tags": [ - "file-input", - "implicit-caching", - "reasoning", - "tool-use", - "vision", - "web-search" - ] - }, - { - "provider": "openai", - "providerModelId": "gpt-5.2", - "contextWindowTokens": 400000, - "maxOutputTokens": 128000, - "tags": [ - "tool-use", - "vision", - "file-input", - "reasoning", - "implicit-caching", - "web-search" - ] - } - ] - }, - { - "slug": "openai/gpt-5.2-chat", - "providers": [ - { - "provider": "azure", - "providerModelId": "gpt-5.2-chat", - "contextWindowTokens": 128000, - "maxOutputTokens": 16384, - "tags": [ - "file-input", - "implicit-caching", - "tool-use", - "vision", - "web-search" - ] - }, - { - "provider": "openai", - "providerModelId": "gpt-5.2-chat-latest", - "contextWindowTokens": 128000, - "maxOutputTokens": 16384, - "tags": [ - "file-input", - "implicit-caching", - "tool-use", - "vision", - "web-search" - ] - } - ] - }, - { - "slug": "openai/gpt-5.2-codex", - "providers": [ - { - "provider": "azure", - "providerModelId": "gpt-5.2-codex", - "contextWindowTokens": 400000, - "maxOutputTokens": 128000, - "tags": [ - "file-input", - "implicit-caching", - "reasoning", - "tool-use", - "vision", - "web-search" - ] - }, - { - "provider": "openai", - "providerModelId": "gpt-5.2-codex", - "contextWindowTokens": 400000, - "maxOutputTokens": 128000, - "tags": [ - "file-input", - "tool-use", - "reasoning", - "vision", - "web-search", - "implicit-caching" - ] - } - ] - }, - { - "slug": "openai/gpt-5.2-pro", - "providers": [ - { - "provider": "openai", - "providerModelId": "gpt-5.2-pro", - "contextWindowTokens": 400000, - "maxOutputTokens": 128000, - "tags": [ - "tool-use", - "vision", - "reasoning", - "file-input", - "web-search" - ] - } - ] - }, - { - "slug": "openai/gpt-5.3-chat", - "providers": [ - { - "provider": "openai", - "providerModelId": "gpt-5.3-chat-latest", - "contextWindowTokens": 128000, - "maxOutputTokens": 16384, - "tags": [ - "file-input", - "implicit-caching", - "tool-use", - "vision", - "web-search" - ] - } - ] - }, - { - "slug": "openai/gpt-5.3-codex", - "providers": [ - { - "provider": "azure", - "providerModelId": "gpt-5.3-codex", - "contextWindowTokens": 400000, - "maxOutputTokens": 128000, - "tags": [ - "file-input", - "implicit-caching", - "reasoning", - "tool-use", - "vision", - "web-search" - ] - }, - { - "provider": "openai", - "providerModelId": "gpt-5.3-codex", - "contextWindowTokens": 400000, - "maxOutputTokens": 128000, - "tags": [ - "reasoning", - "tool-use", - "file-input", - "vision", - "web-search", - "implicit-caching" - ] - } - ] - }, - { - "slug": "openai/gpt-5.4", - "providers": [ - { - "provider": "azure", - "providerModelId": "gpt-5.4", - "contextWindowTokens": 1000000, - "maxOutputTokens": 128000, - "tags": [ - "file-input", - "implicit-caching", - "reasoning", - "tool-use", - "vision", - "web-search" - ] - }, - { - "provider": "openai", - "providerModelId": "gpt-5.4", - "contextWindowTokens": 1050000, - "maxOutputTokens": 128000, - "tags": [ - "reasoning", - "tool-use", - "vision", - "file-input", - "implicit-caching", - "web-search", - "websocket-realtime" - ] - } - ] - }, - { - "slug": "openai/gpt-5.4-mini", - "providers": [ - { - "provider": "azure", - "providerModelId": "gpt-5.4-mini", - "contextWindowTokens": 400000, - "maxOutputTokens": 128000, - "tags": [ - "file-input", - "implicit-caching", - "reasoning", - "tool-use", - "vision", - "web-search" - ] - }, - { - "provider": "openai", - "providerModelId": "gpt-5.4-mini", - "contextWindowTokens": 400000, - "maxOutputTokens": 128000, - "tags": [ - "reasoning", - "tool-use", - "vision", - "file-input", - "implicit-caching", - "web-search" - ] - } - ] - }, - { - "slug": "openai/gpt-5.4-nano", - "providers": [ - { - "provider": "azure", - "providerModelId": "gpt-5.4-nano", - "contextWindowTokens": 400000, - "maxOutputTokens": 128000, - "tags": [ - "file-input", - "implicit-caching", - "reasoning", - "tool-use", - "vision", - "web-search" - ] - }, - { - "provider": "openai", - "providerModelId": "gpt-5.4-nano", - "contextWindowTokens": 400000, - "maxOutputTokens": 128000, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching", - "web-search", - "vision", - "file-input" - ] - } - ] - }, - { - "slug": "openai/gpt-5.4-pro", - "providers": [ - { - "provider": "azure", - "providerModelId": "gpt-5.4-pro", - "contextWindowTokens": 1000000, - "maxOutputTokens": 128000, - "tags": [ - "file-input", - "reasoning", - "tool-use", - "vision", - "web-search" - ] - }, - { - "provider": "openai", - "providerModelId": "gpt-5.4-pro", - "contextWindowTokens": 1050000, - "maxOutputTokens": 128000, - "tags": [ - "reasoning", - "tool-use", - "vision", - "file-input", - "web-search" - ] - } - ] - }, - { - "slug": "openai/gpt-5.5", - "providers": [ - { - "provider": "azure", - "providerModelId": "gpt-5.5", - "contextWindowTokens": 272000, - "maxOutputTokens": 272000, - "tags": [ - "file-input", - "implicit-caching", - "reasoning", - "tool-use", - "vision", - "web-search" - ] - }, - { - "provider": "bedrock", - "providerModelId": "openai.gpt-5.5", - "contextWindowTokens": 272000, - "maxOutputTokens": 272000, - "tags": [ - "reasoning", - "tool-use", - "web-search", - "implicit-caching", - "file-input", - "vision" - ] - }, - { - "provider": "openai", - "providerModelId": "gpt-5.5", - "contextWindowTokens": 1000000, - "maxOutputTokens": 128000, - "tags": [ - "file-input", - "implicit-caching", - "reasoning", - "tool-use", - "vision", - "web-search", - "websocket-realtime" - ] - } - ] - }, - { - "slug": "openai/gpt-5.5-pro", - "providers": [ - { - "provider": "openai", - "providerModelId": "gpt-5.5-pro", - "contextWindowTokens": 1000000, - "maxOutputTokens": 128000, - "tags": [ - "reasoning", - "tool-use", - "file-input", - "web-search", - "vision" - ] - } - ] - }, - { - "slug": "openai/gpt-5.6-luna", - "providers": [ - { - "provider": "azure", - "providerModelId": "gpt-5.6-luna", - "contextWindowTokens": 1050000, - "maxOutputTokens": 128000, - "tags": [ - "reasoning", - "file-input", - "tool-use", - "vision", - "implicit-caching", - "web-search" - ] - }, - { - "provider": "bedrock", - "providerModelId": "openai.gpt-5.6-luna", - "contextWindowTokens": 272000, - "maxOutputTokens": 272000, - "tags": [ - "reasoning", - "file-input", - "tool-use", - "vision", - "implicit-caching", - "web-search" - ] - }, - { - "provider": "openai", - "providerModelId": "gpt-5.6-luna", - "contextWindowTokens": 1050000, - "maxOutputTokens": 128000, - "tags": [ - "reasoning", - "file-input", - "tool-use", - "vision", - "implicit-caching", - "web-search", - "websocket-realtime" - ] - } - ] - }, - { - "slug": "openai/gpt-5.6-sol", - "providers": [ - { - "provider": "azure", - "providerModelId": "gpt-5.6-sol", - "contextWindowTokens": 1050000, - "maxOutputTokens": 128000, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching", - "file-input", - "vision", - "web-search" - ] - }, - { - "provider": "bedrock", - "providerModelId": "openai.gpt-5.6-sol", - "contextWindowTokens": 272000, - "maxOutputTokens": 272000, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching", - "file-input", - "vision", - "web-search" - ] - }, - { - "provider": "openai", - "providerModelId": "gpt-5.6-sol", - "contextWindowTokens": 1050000, - "maxOutputTokens": 128000, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching", - "file-input", - "vision", - "web-search", - "websocket-realtime" - ] - } - ] - }, - { - "slug": "openai/gpt-5.6-terra", - "providers": [ - { - "provider": "azure", - "providerModelId": "gpt-5.6-terra", - "contextWindowTokens": 1050000, - "maxOutputTokens": 128000, - "tags": [ - "reasoning", - "web-search", - "file-input", - "tool-use", - "vision", - "implicit-caching" - ] - }, - { - "provider": "bedrock", - "providerModelId": "openai.gpt-5.6-terra", - "contextWindowTokens": 272000, - "maxOutputTokens": 272000, - "tags": [ - "reasoning", - "web-search", - "file-input", - "tool-use", - "vision", - "implicit-caching" - ] - }, - { - "provider": "openai", - "providerModelId": "gpt-5.6-terra", - "contextWindowTokens": 1050000, - "maxOutputTokens": 128000, - "tags": [ - "reasoning", - "web-search", - "file-input", - "tool-use", - "vision", - "implicit-caching", - "websocket-realtime" - ] - } - ] - }, - { - "slug": "openai/gpt-image-1", - "providers": [ - { - "provider": "openai", - "providerModelId": "gpt-image-1", - "contextWindowTokens": 0, - "maxOutputTokens": 0, - "tags": [ - "image-generation", - "implicit-caching" - ] - } - ] - }, - { - "slug": "openai/gpt-image-1-mini", - "providers": [ - { - "provider": "openai", - "providerModelId": "gpt-image-1-mini", - "contextWindowTokens": 0, - "maxOutputTokens": 0, - "tags": [ - "image-generation", - "implicit-caching" - ] - } - ] - }, - { - "slug": "openai/gpt-image-1.5", - "providers": [ - { - "provider": "openai", - "providerModelId": "gpt-image-1.5", - "contextWindowTokens": 0, - "maxOutputTokens": 0, - "tags": [ - "image-generation", - "implicit-caching" - ] - } - ] - }, - { - "slug": "openai/gpt-image-2", - "providers": [ - { - "provider": "openai", - "providerModelId": "gpt-image-2", - "contextWindowTokens": 0, - "maxOutputTokens": 0, - "tags": [ - "image-generation", - "implicit-caching" - ] - } - ] - }, - { - "slug": "openai/gpt-oss-120b", - "providers": [ - { - "provider": "baseten", - "providerModelId": "openai/gpt-oss-120b", - "contextWindowTokens": 131072, - "maxOutputTokens": 131072, - "tags": [ - "reasoning", - "tool-use" - ] - }, - { - "provider": "bedrock", - "providerModelId": "openai.gpt-oss-120b-1:0", - "contextWindowTokens": 128000, - "maxOutputTokens": 8192, - "tags": [ - "reasoning", - "tool-use" - ] - }, - { - "provider": "cerebras", - "providerModelId": "gpt-oss-120b", - "contextWindowTokens": 131072, - "maxOutputTokens": 131000, - "tags": [ - "implicit-caching", - "reasoning", - "tool-use" - ] - }, - { - "provider": "fireworks", - "providerModelId": "accounts/fireworks/models/gpt-oss-120b", - "contextWindowTokens": 128000, - "maxOutputTokens": 128000, - "tags": [ - "implicit-caching", - "reasoning", - "tool-use" - ] - }, - { - "provider": "groq", - "providerModelId": "openai/gpt-oss-120b", - "contextWindowTokens": 131072, - "maxOutputTokens": 32768, - "tags": [ - "implicit-caching", - "reasoning", - "tool-use" - ] - }, - { - "provider": "nebius", - "providerModelId": "openai/gpt-oss-120b", - "contextWindowTokens": 131000, - "maxOutputTokens": 131000, - "tags": [ - "reasoning", - "tool-use" - ] - }, - { - "provider": "parasail", - "providerModelId": "parasail-gpt-oss-120b", - "contextWindowTokens": 131072, - "maxOutputTokens": 131000, - "tags": [ - "reasoning", - "tool-use" - ] - }, - { - "provider": "togetherai", - "providerModelId": "openai/gpt-oss-120b", - "contextWindowTokens": 128000, - "maxOutputTokens": 128000, - "tags": [ - "reasoning", - "tool-use" - ] - } - ] - }, - { - "slug": "openai/gpt-oss-20b", - "providers": [ - { - "provider": "bedrock", - "providerModelId": "openai.gpt-oss-20b-1:0", - "contextWindowTokens": 128000, - "maxOutputTokens": 8192, - "tags": [ - "reasoning", - "tool-use" - ] - }, - { - "provider": "deepinfra", - "providerModelId": "openai/gpt-oss-20b", - "contextWindowTokens": 131072, - "maxOutputTokens": 8192, - "tags": [ - "reasoning", - "tool-use" - ] - }, - { - "provider": "fireworks", - "providerModelId": "accounts/fireworks/models/gpt-oss-20b", - "contextWindowTokens": 128000, - "maxOutputTokens": 128000, - "tags": [ - "implicit-caching", - "reasoning", - "tool-use" - ] - }, - { - "provider": "groq", - "providerModelId": "openai/gpt-oss-20b", - "contextWindowTokens": 131072, - "maxOutputTokens": 32768, - "tags": [ - "implicit-caching", - "reasoning", - "tool-use" - ] - }, - { - "provider": "novita", - "providerModelId": "openai/gpt-oss-20b", - "contextWindowTokens": 131072, - "maxOutputTokens": 32768, - "tags": [ - "reasoning", - "tool-use" - ] - }, - { - "provider": "parasail", - "providerModelId": "openai/gpt-oss-20b", - "contextWindowTokens": 131072, - "maxOutputTokens": 8192, - "tags": [ - "reasoning", - "tool-use" - ] - }, - { - "provider": "togetherai", - "providerModelId": "openai/gpt-oss-20b", - "contextWindowTokens": 131072, - "maxOutputTokens": 8192, - "tags": [ - "reasoning", - "tool-use" - ] - } - ] - }, - { - "slug": "openai/gpt-oss-safeguard-20b", - "providers": [ - { - "provider": "groq", - "providerModelId": "openai/gpt-oss-safeguard-20b", - "contextWindowTokens": 131072, - "maxOutputTokens": 65536, - "tags": [ - "implicit-caching", - "reasoning", - "tool-use" - ] - } - ] - }, - { - "slug": "openai/gpt-realtime-1.5", - "providers": [ - { - "provider": "openai", - "providerModelId": "gpt-realtime-1.5", - "contextWindowTokens": 0, - "maxOutputTokens": 0 - } - ] - }, - { - "slug": "openai/gpt-realtime-2", - "providers": [ - { - "provider": "openai", - "providerModelId": "gpt-realtime-2", - "contextWindowTokens": 0, - "maxOutputTokens": 0, - "tags": [ - "websocket-realtime" - ] - } - ] - }, - { - "slug": "openai/gpt-realtime-2.1", - "providers": [ - { - "provider": "openai", - "providerModelId": "gpt-realtime-2.1", - "contextWindowTokens": 128000, - "maxOutputTokens": 32000 - } - ] - }, - { - "slug": "openai/gpt-realtime-mini", - "providers": [ - { - "provider": "openai", - "providerModelId": "gpt-realtime-mini", - "contextWindowTokens": 0, - "maxOutputTokens": 0 - } - ] - }, - { - "slug": "openai/o1", - "providers": [ - { - "provider": "azure", - "providerModelId": "o1", - "contextWindowTokens": 200000, - "maxOutputTokens": 100000, - "tags": [ - "file-input", - "reasoning", - "tool-use", - "vision", - "implicit-caching" - ] - }, - { - "provider": "openai", - "providerModelId": "o1", - "contextWindowTokens": 200000, - "maxOutputTokens": 100000, - "tags": [ - "file-input", - "reasoning", - "tool-use", - "vision", - "implicit-caching" - ] - } - ] - }, - { - "slug": "openai/o3", - "providers": [ - { - "provider": "openai", - "providerModelId": "o3", - "contextWindowTokens": 200000, - "maxOutputTokens": 100000, - "tags": [ - "file-input", - "implicit-caching", - "reasoning", - "tool-use", - "vision", - "web-search" - ] - } - ] - }, - { - "slug": "openai/o3-deep-research", - "providers": [ - { - "provider": "openai", - "providerModelId": "o3-deep-research", - "contextWindowTokens": 200000, - "maxOutputTokens": 100000, - "tags": [ - "file-input", - "implicit-caching", - "reasoning", - "tool-use", - "vision", - "web-search" - ] - } - ] - }, - { - "slug": "openai/o3-mini", - "providers": [ - { - "provider": "azure", - "providerModelId": "o3-mini", - "contextWindowTokens": 200000, - "maxOutputTokens": 100000, - "tags": [ - "implicit-caching", - "reasoning", - "tool-use" - ] - }, - { - "provider": "openai", - "providerModelId": "o3-mini", - "contextWindowTokens": 200000, - "maxOutputTokens": 100000, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching" - ] - } - ] - }, - { - "slug": "openai/o3-pro", - "providers": [ - { - "provider": "openai", - "providerModelId": "o3-pro-2025-06-10", - "contextWindowTokens": 200000, - "maxOutputTokens": 100000, - "tags": [ - "reasoning", - "vision", - "file-input", - "tool-use", - "web-search" - ] - } - ] - }, - { - "slug": "openai/o4-mini", - "providers": [ - { - "provider": "azure", - "providerModelId": "o4-mini", - "contextWindowTokens": 200000, - "maxOutputTokens": 100000, - "tags": [ - "file-input", - "implicit-caching", - "reasoning", - "tool-use", - "vision", - "web-search" - ] - }, - { - "provider": "openai", - "providerModelId": "o4-mini", - "contextWindowTokens": 200000, - "maxOutputTokens": 100000, - "tags": [ - "file-input", - "reasoning", - "tool-use", - "vision", - "implicit-caching", - "web-search" - ] - } - ] - }, - { - "slug": "openai/text-embedding-3-large", - "providers": [ - { - "provider": "azure", - "providerModelId": "text-embedding-3-large", - "contextWindowTokens": 0, - "maxOutputTokens": 0 - }, - { - "provider": "openai", - "providerModelId": "text-embedding-3-large", - "contextWindowTokens": 0, - "maxOutputTokens": 0 - } - ] - }, - { - "slug": "openai/text-embedding-3-small", - "providers": [ - { - "provider": "azure", - "providerModelId": "text-embedding-3-small", - "contextWindowTokens": 0, - "maxOutputTokens": 0 - }, - { - "provider": "openai", - "providerModelId": "text-embedding-3-small", - "contextWindowTokens": 0, - "maxOutputTokens": 0 - } - ] - }, - { - "slug": "openai/text-embedding-ada-002", - "providers": [ - { - "provider": "azure", - "providerModelId": "text-embedding-ada-002", - "contextWindowTokens": 0, - "maxOutputTokens": 0 - }, - { - "provider": "openai", - "providerModelId": "text-embedding-ada-002", - "contextWindowTokens": 0, - "maxOutputTokens": 0 - } - ] - }, - { - "slug": "openai/tts-1", - "providers": [ - { - "provider": "openai", - "providerModelId": "tts-1", - "contextWindowTokens": 0, - "maxOutputTokens": 0 - } - ] - }, - { - "slug": "openai/tts-1-hd", - "providers": [ - { - "provider": "openai", - "providerModelId": "tts-1-hd", - "contextWindowTokens": 0, - "maxOutputTokens": 0 - } - ] - }, - { - "slug": "openai/whisper-1", - "providers": [ - { - "provider": "openai", - "providerModelId": "whisper-1", - "contextWindowTokens": 0, - "maxOutputTokens": 0 - } - ] - }, - { - "slug": "perplexity/sonar", - "providers": [ - { - "provider": "perplexity", - "providerModelId": "sonar", - "contextWindowTokens": 127000, - "maxOutputTokens": 8000, - "tags": [ - "vision", - "web-search" - ] - } - ] - }, - { - "slug": "perplexity/sonar-pro", - "providers": [ - { - "provider": "perplexity", - "providerModelId": "sonar-pro", - "contextWindowTokens": 200000, - "maxOutputTokens": 8000, - "tags": [ - "vision", - "web-search" - ] - } - ] - }, - { - "slug": "perplexity/sonar-reasoning-pro", - "providers": [ - { - "provider": "perplexity", - "providerModelId": "sonar-reasoning-pro", - "contextWindowTokens": 127000, - "maxOutputTokens": 8000, - "tags": [ - "reasoning", - "web-search" - ] - } - ] - }, - { - "slug": "prodia/flux-fast-schnell", - "providers": [ - { - "provider": "prodia", - "providerModelId": "inference.flux-fast.schnell.txt2img.v2", - "contextWindowTokens": 512, - "maxOutputTokens": 0, - "tags": [ - "image-generation" - ] - } - ] - }, - { - "slug": "quiverai/arrow-1.1", - "providers": [ - { - "provider": "quiverai", - "providerModelId": "arrow-1.1", - "contextWindowTokens": 131072, - "maxOutputTokens": 131072, - "tags": [ - "image-generation" - ] - } - ] - }, - { - "slug": "recraft/recraft-v2", - "providers": [ - { - "provider": "recraft", - "providerModelId": "recraftv2", - "contextWindowTokens": 0, - "maxOutputTokens": 0, - "tags": [ - "image-generation" - ] - } - ] - }, - { - "slug": "recraft/recraft-v3", - "providers": [ - { - "provider": "recraft", - "providerModelId": "recraftv3", - "contextWindowTokens": 0, - "maxOutputTokens": 0, - "tags": [ - "image-generation" - ] - } - ] - }, - { - "slug": "recraft/recraft-v4", - "providers": [ - { - "provider": "recraft", - "providerModelId": "recraftv4", - "contextWindowTokens": 0, - "maxOutputTokens": 0, - "tags": [ - "image-generation" - ] - } - ] - }, - { - "slug": "recraft/recraft-v4-pro", - "providers": [ - { - "provider": "recraft", - "providerModelId": "recraftv4_pro", - "contextWindowTokens": 0, - "maxOutputTokens": 0, - "tags": [ - "image-generation" - ] - } - ] - }, - { - "slug": "recraft/recraft-v4.1", - "providers": [ - { - "provider": "recraft", - "providerModelId": "recraftv4_1", - "contextWindowTokens": 0, - "maxOutputTokens": 0, - "tags": [ - "image-generation" - ] - } - ] - }, - { - "slug": "recraft/recraft-v4.1-pro", - "providers": [ - { - "provider": "recraft", - "providerModelId": "recraftv4_1_pro", - "contextWindowTokens": 0, - "maxOutputTokens": 0, - "tags": [ - "image-generation" - ] - } - ] - }, - { - "slug": "recraft/recraft-v4.1-utility", - "providers": [ - { - "provider": "recraft", - "providerModelId": "recraftv4_1_utility", - "contextWindowTokens": 0, - "maxOutputTokens": 0, - "tags": [ - "image-generation" - ] - } - ] - }, - { - "slug": "recraft/recraft-v4.1-utility-pro", - "providers": [ - { - "provider": "recraft", - "providerModelId": "recraftv4_1_utility_pro", - "contextWindowTokens": 0, - "maxOutputTokens": 0, - "tags": [ - "image-generation" - ] - } - ] - }, - { - "slug": "sakana/fugu-ultra", - "providers": [ - { - "provider": "sakana", - "providerModelId": "fugu-ultra", - "contextWindowTokens": 1000000, - "maxOutputTokens": 1000000, - "tags": [ - "vision", - "tool-use", - "reasoning" - ] - } - ] - }, - { - "slug": "stepfun/step-3.5-flash", - "providers": [ - { - "provider": "deepinfra", - "providerModelId": "stepfun-ai/Step-3.5-Flash", - "contextWindowTokens": 262114, - "maxOutputTokens": 262114, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching" - ] - } - ] - }, - { - "slug": "stepfun/step-3.7-flash", - "providers": [ - { - "provider": "stepfun", - "providerModelId": "step-3.7-flash", - "contextWindowTokens": 256000, - "maxOutputTokens": 256000, - "tags": [ - "implicit-caching", - "reasoning", - "tool-use", - "vision" - ] - } - ] - }, - { - "slug": "voyage/rerank-2.5", - "providers": [ - { - "provider": "voyage", - "providerModelId": "rerank-2.5", - "contextWindowTokens": 32000, - "maxOutputTokens": 32000 - } - ] - }, - { - "slug": "voyage/rerank-2.5-lite", - "providers": [ - { - "provider": "voyage", - "providerModelId": "rerank-2.5-lite", - "contextWindowTokens": 32000, - "maxOutputTokens": 32000 - } - ] - }, - { - "slug": "voyage/voyage-3-large", - "providers": [ - { - "provider": "voyage", - "providerModelId": "voyage-3-large", - "contextWindowTokens": 0, - "maxOutputTokens": 0 - } - ] - }, - { - "slug": "voyage/voyage-3.5", - "providers": [ - { - "provider": "voyage", - "providerModelId": "voyage-3.5", - "contextWindowTokens": 0, - "maxOutputTokens": 0 - } - ] - }, - { - "slug": "voyage/voyage-3.5-lite", - "providers": [ - { - "provider": "voyage", - "providerModelId": "voyage-3.5-lite", - "contextWindowTokens": 0, - "maxOutputTokens": 0 - } - ] - }, - { - "slug": "voyage/voyage-4", - "providers": [ - { - "provider": "voyage", - "providerModelId": "voyage-4", - "contextWindowTokens": 32000, - "maxOutputTokens": 0 - } - ] - }, - { - "slug": "voyage/voyage-4-large", - "providers": [ - { - "provider": "voyage", - "providerModelId": "voyage-4-large", - "contextWindowTokens": 32000, - "maxOutputTokens": 0 - } - ] - }, - { - "slug": "voyage/voyage-4-lite", - "providers": [ - { - "provider": "voyage", - "providerModelId": "voyage-4-lite", - "contextWindowTokens": 32000, - "maxOutputTokens": 0 - } - ] - }, - { - "slug": "voyage/voyage-code-2", - "providers": [ - { - "provider": "voyage", - "providerModelId": "voyage-code-2", - "contextWindowTokens": 0, - "maxOutputTokens": 0 - } - ] - }, - { - "slug": "voyage/voyage-code-3", - "providers": [ - { - "provider": "voyage", - "providerModelId": "voyage-code-3", - "contextWindowTokens": 0, - "maxOutputTokens": 0 - } - ] - }, - { - "slug": "voyage/voyage-finance-2", - "providers": [ - { - "provider": "voyage", - "providerModelId": "voyage-finance-2", - "contextWindowTokens": 0, - "maxOutputTokens": 0 - } - ] - }, - { - "slug": "voyage/voyage-law-2", - "providers": [ - { - "provider": "voyage", - "providerModelId": "voyage-law-2", - "contextWindowTokens": 0, - "maxOutputTokens": 0 - } - ] - }, - { - "slug": "xai/grok-4.1-fast-non-reasoning", - "providers": [ - { - "provider": "vertex", - "providerModelId": "xai/grok-4.1-fast-non-reasoning", - "contextWindowTokens": 1000000, - "maxOutputTokens": 1000000, - "tags": [ - "tool-use", - "file-input", - "vision", - "implicit-caching" - ] - } - ] - }, - { - "slug": "xai/grok-4.1-fast-reasoning", - "providers": [ - { - "provider": "vertex", - "providerModelId": "xai/grok-4.1-fast-reasoning", - "contextWindowTokens": 1000000, - "maxOutputTokens": 1000000, - "tags": [ - "reasoning", - "file-input", - "vision", - "tool-use", - "implicit-caching" - ] - } - ] - }, - { - "slug": "xai/grok-4.20-multi-agent", - "providers": [ - { - "provider": "xai", - "providerModelId": "grok-4.20-multi-agent-0309", - "contextWindowTokens": 2000000, - "maxOutputTokens": 2000000, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching", - "vision", - "file-input", - "web-search" - ] - } - ] - }, - { - "slug": "xai/grok-4.20-multi-agent-beta", - "providers": [ - { - "provider": "xai", - "providerModelId": "grok-4.20-multi-agent-beta-0309", - "contextWindowTokens": 2000000, - "maxOutputTokens": 2000000, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching", - "vision", - "file-input", - "web-search" - ] - } - ] - }, - { - "slug": "xai/grok-4.20-non-reasoning", - "providers": [ - { - "provider": "vertex", - "providerModelId": "xai/grok-4.20-non-reasoning", - "contextWindowTokens": 2000000, - "maxOutputTokens": 2000000, - "tags": [ - "tool-use", - "implicit-caching", - "file-input", - "vision" - ] - }, - { - "provider": "xai", - "providerModelId": "grok-4.20-0309-non-reasoning", - "contextWindowTokens": 2000000, - "maxOutputTokens": 2000000, - "tags": [ - "tool-use", - "implicit-caching", - "vision", - "file-input", - "web-search" - ] - } - ] - }, - { - "slug": "xai/grok-4.20-non-reasoning-beta", - "providers": [ - { - "provider": "xai", - "providerModelId": "grok-4.20-beta-0309-non-reasoning", - "contextWindowTokens": 2000000, - "maxOutputTokens": 2000000, - "tags": [ - "tool-use", - "implicit-caching", - "vision", - "file-input", - "web-search" - ] - } - ] - }, - { - "slug": "xai/grok-4.20-reasoning", - "providers": [ - { - "provider": "vertex", - "providerModelId": "xai/grok-4.20-reasoning", - "contextWindowTokens": 2000000, - "maxOutputTokens": 2000000, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching", - "vision", - "file-input", - "web-search" - ] - }, - { - "provider": "xai", - "providerModelId": "grok-4.20-0309-reasoning", - "contextWindowTokens": 2000000, - "maxOutputTokens": 2000000, - "tags": [ - "reasoning", - "vision", - "tool-use", - "file-input", - "implicit-caching", - "web-search" - ] - } - ] - }, - { - "slug": "xai/grok-4.20-reasoning-beta", - "providers": [ - { - "provider": "xai", - "providerModelId": "grok-4.20-beta-0309-reasoning", - "contextWindowTokens": 2000000, - "maxOutputTokens": 2000000, - "tags": [ - "reasoning", - "tool-use", - "vision", - "file-input", - "implicit-caching", - "web-search" - ] - } - ] - }, - { - "slug": "xai/grok-4.3", - "providers": [ - { - "provider": "vertex", - "providerModelId": "xai/grok-4.3", - "contextWindowTokens": 1000000, - "maxOutputTokens": 1000000, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching", - "file-input", - "vision" - ] - }, - { - "provider": "xai", - "providerModelId": "grok-4.3", - "contextWindowTokens": 1000000, - "maxOutputTokens": 1000000, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching", - "file-input", - "vision", - "web-search" - ] - } - ] - }, - { - "slug": "xai/grok-4.5", - "providers": [ - { - "provider": "xai", - "providerModelId": "grok-4.5", - "contextWindowTokens": 500000, - "maxOutputTokens": 500000, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching", - "file-input", - "vision", - "web-search" - ] - } - ] - }, - { - "slug": "xai/grok-build-0.1", - "providers": [ - { - "provider": "xai", - "providerModelId": "grok-build-0.1", - "contextWindowTokens": 256000, - "maxOutputTokens": 256000, - "tags": [ - "reasoning", - "implicit-caching", - "vision", - "tool-use", - "web-search" - ] - } - ] - }, - { - "slug": "xai/grok-imagine-image", - "providers": [ - { - "provider": "xai", - "providerModelId": "grok-imagine-image", - "contextWindowTokens": 0, - "maxOutputTokens": 0, - "tags": [ - "image-generation" - ] - } - ] - }, - { - "slug": "xai/grok-imagine-video", - "providers": [ - { - "provider": "xai", - "providerModelId": "grok-imagine-video", - "contextWindowTokens": 0, - "maxOutputTokens": 0 - } - ] - }, - { - "slug": "xai/grok-imagine-video-1.5", - "providers": [ - { - "provider": "xai", - "providerModelId": "grok-imagine-video-1.5", - "contextWindowTokens": 0, - "maxOutputTokens": 0 - } - ] - }, - { - "slug": "xai/grok-imagine-video-1.5-preview", - "providers": [ - { - "provider": "xai", - "providerModelId": "grok-imagine-video-1.5-preview", - "contextWindowTokens": 0, - "maxOutputTokens": 0 - } - ] - }, - { - "slug": "xai/grok-stt", - "providers": [ - { - "provider": "xai", - "providerModelId": "grok-stt", - "contextWindowTokens": 0, - "maxOutputTokens": 0 - } - ] - }, - { - "slug": "xai/grok-tts", - "providers": [ - { - "provider": "xai", - "providerModelId": "grok-tts", - "contextWindowTokens": 0, - "maxOutputTokens": 0 - } - ] - }, - { - "slug": "xai/grok-voice-think-fast-1.0", - "providers": [ - { - "provider": "xai", - "providerModelId": "grok-voice-think-fast-1.0", - "contextWindowTokens": 0, - "maxOutputTokens": 0 - } - ] - }, - { - "slug": "xiaomi/mimo-v2.5", - "providers": [ - { - "provider": "deepinfra", - "providerModelId": "XiaomiMiMo/MiMo-V2.5", - "contextWindowTokens": 262144, - "maxOutputTokens": 131100, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching", - "file-input", - "vision" - ] - }, - { - "provider": "xiaomi", - "providerModelId": "mimo-v2.5", - "contextWindowTokens": 1050000, - "maxOutputTokens": 131100, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching", - "file-input", - "vision" - ] - } - ] - }, - { - "slug": "xiaomi/mimo-v2.5-pro", - "providers": [ - { - "provider": "deepinfra", - "providerModelId": "XiaomiMiMo/MiMo-V2.5-Pro", - "contextWindowTokens": 1048576, - "maxOutputTokens": 1048576, - "tags": [ - "reasoning", - "tool-use", - "file-input", - "implicit-caching" - ] - }, - { - "provider": "xiaomi", - "providerModelId": "mimo-v2.5-pro", - "contextWindowTokens": 1050000, - "maxOutputTokens": 131000, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching" - ] - } - ] - }, - { - "slug": "zai/glm-4.5", - "providers": [ - { - "provider": "zai", - "providerModelId": "glm-4.5", - "contextWindowTokens": 128000, - "maxOutputTokens": 96000, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching" - ] - } - ] - }, - { - "slug": "zai/glm-4.5-air", - "providers": [ - { - "provider": "zai", - "providerModelId": "glm-4.5-air", - "contextWindowTokens": 128000, - "maxOutputTokens": 96000, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching" - ] - } - ] - }, - { - "slug": "zai/glm-4.5v", - "providers": [ - { - "provider": "novita", - "providerModelId": "zai-org/glm-4.5v", - "contextWindowTokens": 65536, - "maxOutputTokens": 16384, - "tags": [ - "implicit-caching", - "reasoning", - "tool-use", - "vision" - ] - }, - { - "provider": "zai", - "providerModelId": "glm-4.5v", - "contextWindowTokens": 66000, - "maxOutputTokens": 16000, - "tags": [ - "implicit-caching", - "reasoning", - "tool-use", - "vision" - ] - } - ] - }, - { - "slug": "zai/glm-4.6", - "providers": [ - { - "provider": "deepinfra", - "providerModelId": "zai-org/GLM-4.6", - "contextWindowTokens": 202752, - "maxOutputTokens": 202752, - "tags": [ - "implicit-caching", - "reasoning", - "tool-use" - ] - }, - { - "provider": "novita", - "providerModelId": "zai-org/glm-4.6", - "contextWindowTokens": 204800, - "maxOutputTokens": 131072, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching" - ] - }, - { - "provider": "zai", - "providerModelId": "glm-4.6", - "contextWindowTokens": 200000, - "maxOutputTokens": 96000, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching" - ] - } - ] - }, - { - "slug": "zai/glm-4.6v", - "providers": [ - { - "provider": "zai", - "providerModelId": "glm-4.6v", - "contextWindowTokens": 128000, - "maxOutputTokens": 24000, - "tags": [ - "vision", - "file-input", - "reasoning", - "tool-use", - "implicit-caching" - ] - } - ] - }, - { - "slug": "zai/glm-4.6v-flash", - "providers": [ - { - "provider": "zai", - "providerModelId": "GLM-4.6v-flash", - "contextWindowTokens": 128000, - "maxOutputTokens": 24000, - "tags": [ - "vision", - "reasoning", - "file-input", - "tool-use", - "implicit-caching" - ] - } - ] - }, - { - "slug": "zai/glm-4.7", - "providers": [ - { - "provider": "baseten", - "providerModelId": "zai-org/GLM-4.7", - "contextWindowTokens": 200000, - "maxOutputTokens": 120000, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching" - ] - }, - { - "provider": "bedrock", - "providerModelId": "zai.glm-4.7", - "contextWindowTokens": 200000, - "maxOutputTokens": 120000, - "tags": [ - "reasoning", - "tool-use" - ] - }, - { - "provider": "cerebras", - "providerModelId": "zai-glm-4.7", - "contextWindowTokens": 131000, - "maxOutputTokens": 40000, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching" - ] - }, - { - "provider": "deepinfra", - "providerModelId": "zai-org/GLM-4.7", - "contextWindowTokens": 202752, - "maxOutputTokens": 120000, - "tags": [ - "reasoning", - "implicit-caching", - "tool-use" - ] - }, - { - "provider": "novita", - "providerModelId": "zai-org/glm-4.7", - "contextWindowTokens": 204800, - "maxOutputTokens": 131072, - "tags": [ - "implicit-caching", - "reasoning", - "tool-use" - ] - }, - { - "provider": "zai", - "providerModelId": "glm-4.7", - "contextWindowTokens": 200000, - "maxOutputTokens": 120000, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching" - ] - } - ] - }, - { - "slug": "zai/glm-4.7-flash", - "providers": [ - { - "provider": "bedrock", - "providerModelId": "zai.glm-4.7-flash", - "contextWindowTokens": 200000, - "maxOutputTokens": 131000, - "tags": [ - "reasoning", - "tool-use" - ] - }, - { - "provider": "zai", - "providerModelId": "glm-4.7-flash", - "contextWindowTokens": 200000, - "maxOutputTokens": 131000, - "tags": [ - "implicit-caching", - "reasoning", - "tool-use" - ] - } - ] - }, - { - "slug": "zai/glm-4.7-flashx", - "providers": [ - { - "provider": "zai", - "providerModelId": "GLM-4.7-FlashX", - "contextWindowTokens": 200000, - "maxOutputTokens": 128000, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching" - ] - } - ] - }, - { - "slug": "zai/glm-5", - "providers": [ - { - "provider": "baseten", - "providerModelId": "zai-org/GLM-5", - "contextWindowTokens": 202800, - "maxOutputTokens": 131100, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching" - ] - }, - { - "provider": "bedrock", - "providerModelId": "zai.glm-5", - "contextWindowTokens": 202800, - "maxOutputTokens": 131100, - "tags": [ - "reasoning", - "tool-use" - ] - }, - { - "provider": "deepinfra", - "providerModelId": "zai-org/GLM-5", - "contextWindowTokens": 202800, - "maxOutputTokens": 131100, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching" - ] - }, - { - "provider": "novita", - "providerModelId": "zai-org/glm-5", - "contextWindowTokens": 202800, - "maxOutputTokens": 131072, - "tags": [ - "reasoning", - "implicit-caching", - "tool-use" - ] - }, - { - "provider": "parasail", - "providerModelId": "zai-org/GLM-5", - "contextWindowTokens": 202800, - "maxOutputTokens": 131100, - "tags": [ - "implicit-caching", - "reasoning", - "tool-use" - ] - }, - { - "provider": "zai", - "providerModelId": "glm-5", - "contextWindowTokens": 202800, - "maxOutputTokens": 131100, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching" - ] - } - ] - }, - { - "slug": "zai/glm-5-turbo", - "providers": [ - { - "provider": "zai", - "providerModelId": "glm-5-turbo", - "contextWindowTokens": 202800, - "maxOutputTokens": 131100, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching" - ] - } - ] - }, - { - "slug": "zai/glm-5.1", - "providers": [ - { - "provider": "baseten", - "providerModelId": "zai-org/GLM-5.1", - "contextWindowTokens": 202000, - "maxOutputTokens": 202000, - "tags": [ - "implicit-caching", - "reasoning", - "tool-use" - ] - }, - { - "provider": "deepinfra", - "providerModelId": "zai-org/GLM-5.1", - "contextWindowTokens": 202752, - "maxOutputTokens": 202752, - "tags": [ - "implicit-caching", - "reasoning", - "tool-use" - ] - }, - { - "provider": "fireworks", - "providerModelId": "accounts/fireworks/models/glm-5p1", - "contextWindowTokens": 202000, - "maxOutputTokens": 202000, - "tags": [ - "implicit-caching", - "reasoning", - "tool-use" - ] - }, - { - "provider": "novita", - "providerModelId": "zai-org/glm-5.1", - "contextWindowTokens": 204800, - "maxOutputTokens": 131072, - "tags": [ - "implicit-caching", - "reasoning", - "tool-use" - ] - }, - { - "provider": "togetherai", - "providerModelId": "zai-org/GLM-5.1", - "contextWindowTokens": 202000, - "maxOutputTokens": 202000, - "tags": [ - "reasoning", - "tool-use" - ] - }, - { - "provider": "zai", - "providerModelId": "glm-5.1", - "contextWindowTokens": 202800, - "maxOutputTokens": 64000, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching" - ] - } - ] - }, - { - "slug": "zai/glm-5.2", - "providers": [ - { - "provider": "alibaba", - "providerModelId": "glm-5.2", - "contextWindowTokens": 1000000, - "maxOutputTokens": 128000, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching" - ] - }, - { - "provider": "baseten", - "providerModelId": "zai-org/GLM-5.2", - "contextWindowTokens": 1000000, - "maxOutputTokens": 128000, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching" - ] - }, - { - "provider": "deepinfra", - "providerModelId": "zai-org/GLM-5.2", - "contextWindowTokens": 1000000, - "maxOutputTokens": 128000, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching" - ] - }, - { - "provider": "fireworks", - "providerModelId": "accounts/fireworks/models/glm-5p2", - "contextWindowTokens": 1040000, - "maxOutputTokens": 128000, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching" - ] - }, - { - "provider": "morph", - "providerModelId": "morph-glm52-744b", - "contextWindowTokens": 1000000, - "maxOutputTokens": 128000, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching" - ] - }, - { - "provider": "novita", - "providerModelId": "zai-org/glm-5.2", - "contextWindowTokens": 1000000, - "maxOutputTokens": 128000, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching" - ] - }, - { - "provider": "parasail", - "providerModelId": "zai-org/GLM-5.2", - "contextWindowTokens": 262144, - "maxOutputTokens": 128000, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching" - ] - }, - { - "provider": "streamlake", - "providerModelId": "ep-l9wr6k-1784102823433037573", - "contextWindowTokens": 1000000, - "maxOutputTokens": 128000, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching" - ] - }, - { - "provider": "togetherai", - "providerModelId": "zai-org/GLM-5.2", - "contextWindowTokens": 256000, - "maxOutputTokens": 128000, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching" - ] - }, - { - "provider": "wafer", - "providerModelId": "GLM5.2-Turbo", - "contextWindowTokens": 1000000, - "maxOutputTokens": 128000, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching" - ] - }, - { - "provider": "zai", - "providerModelId": "GLM-5.2", - "contextWindowTokens": 1000000, - "maxOutputTokens": 128000, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching" - ] - } - ] - }, - { - "slug": "zai/glm-5.2-fast", - "providers": [ - { - "provider": "fireworks", - "providerModelId": "accounts/fireworks/routers/glm-5p2-fast", - "contextWindowTokens": 1000000, - "maxOutputTokens": 128000, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching" - ] - }, - { - "provider": "wafer", - "providerModelId": "GLM5.2-Turbo", - "contextWindowTokens": 1000000, - "maxOutputTokens": 128000, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching" - ] - } - ] - }, - { - "slug": "zai/glm-5v-turbo", - "providers": [ - { - "provider": "zai", - "providerModelId": "glm-5v-turbo", - "contextWindowTokens": 200000, - "maxOutputTokens": 128000, - "tags": [ - "reasoning", - "tool-use", - "implicit-caching", - "vision", - "file-input" - ] - } - ] - } - ], - "providerAliases": { - "blackForestLabs": "bfl" - }, - "version": 2 -} diff --git a/.eve/compile/channel-instrumentation-types.d.ts b/.eve/compile/channel-instrumentation-types.d.ts deleted file mode 100644 index cb20983..0000000 --- a/.eve/compile/channel-instrumentation-types.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -// Generated by eve. Do not edit by hand. -import type { InferChannelMetadata } from "eve/channels"; - -declare module "eve/channels" { - interface ChannelMetadataMap {} - interface ChannelReferenceMap {} -} diff --git a/.eve/compile/compile-metadata.json b/.eve/compile/compile-metadata.json deleted file mode 100644 index d80262a..0000000 --- a/.eve/compile/compile-metadata.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "compile": { - "moduleMap": { - "path": ".eve/compile/module-map.mjs", - "sha256": "c76cab7c1a37dca6eb591740264f371cca3e74760abc1f9fc4652f959f1e0353" - } - }, - "discovery": { - "diagnostics": { - "path": ".eve/discovery/diagnostics.json", - "sha256": "b26fc8e66ee943f962b1bab4a790f6a611ce7e6738aa29f83ea53b73cc362c63" - }, - "manifest": { - "path": ".eve/discovery/agent-discovery-manifest.json", - "sha256": "305c68e3493f0a1ba53702641dbf8675e60374b68a24b73f13b69ac6246dbcaa" - }, - "sourceGraphHash": "3370c163e654fd12b5b4097da0747ee823445d615e0713c04b38ac808c739532", - "summary": { - "errors": 0, - "warnings": 0 - } - }, - "generator": { - "name": "eve", - "version": "0.16.2" - }, - "kind": "eve-compile-metadata", - "status": "ready", - "version": 5 -} diff --git a/.eve/compile/compiled-agent-manifest.json b/.eve/compile/compiled-agent-manifest.json deleted file mode 100644 index 5116350..0000000 --- a/.eve/compile/compiled-agent-manifest.json +++ /dev/null @@ -1,180 +0,0 @@ -{ - "agentRoot": "C:\\Users\\timo\\Documents\\qrmaster\\QR-master\\agent", - "appRoot": "C:\\Users\\timo\\Documents\\qrmaster\\QR-master", - "channels": [], - "connections": [ - { - "connectionName": "dataforseo", - "logicalPath": "connections/dataforseo.ts", - "sourceId": "connections/dataforseo.ts", - "sourceKind": "module", - "description": "DataForSEO rankings data: live SERP results by keyword/location, the domain's ranked keywords with position and search volume, keyword gaps against competitors, and search volume lookups.", - "protocol": "mcp", - "url": "https://mcp.dataforseo.com/mcp" - } - ], - "config": { - "compaction": {}, - "model": { - "id": "anthropic/claude-sonnet-4.6", - "routing": { - "kind": "gateway", - "target": "anthropic" - }, - "contextWindowTokens": 1000000 - }, - "name": "qr-master" - }, - "diagnosticsSummary": { - "errors": 0, - "warnings": 0 - }, - "disabledFrameworkTools": [], - "workflowEnabled": false, - "dynamicInstructions": [], - "dynamicSkills": [], - "dynamicTools": [], - "hooks": [], - "remoteAgents": [], - "sandbox": { - "backendName": "just-bash", - "logicalPath": "sandbox/sandbox.ts", - "revalidationKey": "seo-improver-agent-browser-gh-v1", - "sourceHash": "838127a7092961bbfd47e3b91a0e14b19afb7d655167d4d079c474abd40f570e", - "sourceId": "sandbox/sandbox.ts", - "sourceKind": "module" - }, - "sandboxWorkspaces": [ - { - "logicalPath": "sandbox/workspace", - "rootEntries": [ - "setup-agent-browser.sh", - "setup-gh.sh" - ], - "sourceId": "sandbox/workspace", - "sourcePath": "C:\\Users\\timo\\Documents\\qrmaster\\QR-master\\agent\\sandbox\\workspace" - } - ], - "schedules": [ - { - "cron": "0 9 * * 1", - "hasRun": false, - "logicalPath": "schedules/weekly.ts", - "name": "weekly", - "sourceId": "schedules/weekly.ts", - "sourceKind": "module", - "markdown": "Run the weekly SEO improver loop for the configured property and tracked keywords." - } - ], - "skills": [], - "tools": [ - { - "description": "List the Search Console properties the configured service account can access. Useful to confirm access and the exact property name before querying.", - "inputSchema": { - "type": "object", - "additionalProperties": false, - "properties": {} - }, - "logicalPath": "tools/list_search_console_sites.ts", - "name": "list_search_console_sites", - "sourceId": "tools/list_search_console_sites.ts", - "sourceKind": "module" - }, - { - "description": "Query Google Search Console Search Analytics for the property: the site's own real clicks, impressions, CTR, and average position by query, page, country, device, and date. First-party ground truth for striking-distance, low-CTR, cannibalization, and decay analysis.", - "inputSchema": { - "type": "object", - "additionalProperties": false, - "required": [ - "siteUrl", - "startDate", - "endDate" - ], - "properties": { - "siteUrl": { - "type": "string", - "description": "The property, e.g. `sc-domain:example.com` or `https://www.example.com/`." - }, - "startDate": { - "type": "string", - "description": "YYYY-MM-DD (inclusive)." - }, - "endDate": { - "type": "string", - "description": "YYYY-MM-DD (inclusive)." - }, - "dimensions": { - "type": "array", - "items": { - "type": "string", - "enum": [ - "query", - "page", - "country", - "device", - "date", - "searchAppearance" - ] - } - }, - "type": { - "type": "string", - "enum": [ - "web", - "image", - "video", - "news", - "discover", - "googleNews" - ] - }, - "dataState": { - "type": "string", - "enum": [ - "final", - "all" - ] - }, - "rowLimit": { - "type": "integer", - "description": "Max rows, up to 25000." - }, - "startRow": { - "type": "integer", - "description": "Zero-based row offset for paging." - }, - "dimensionFilterGroups": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true - } - } - } - }, - "logicalPath": "tools/query_search_analytics.ts", - "name": "query_search_analytics", - "sourceId": "tools/query_search_analytics.ts", - "sourceKind": "module" - } - ], - "workspaceResourceRoot": { - "contentHash": "9f97e6abb4302039c6c4e2b3d4de3cf5c149de805a90c3e20c3f21da697afb92", - "logicalPath": "workspace-resources/__root__", - "rootEntries": [ - "setup-agent-browser.sh", - "setup-gh.sh" - ] - }, - "instructions": { - "name": "instructions", - "logicalPath": "instructions.md", - "markdown": "\r\nSearch Console property: https://www.qrmaster.net/\r\nProject domain: qrmaster.net\r\nTracked keywords: not set (derive from the domain's own ranked keywords)\r\nBlog repo and content path: not set (report-only)\r\n\r\n\r\nYou are an SEO improver agent. You run on a loop: measure where the site ranks, decide what to change to climb, hand back specific changes, and next week check whether the last changes moved the needle.\r\n\r\nYou do three things every run: **track rankings**, **prioritize a small set of high-leverage improvements**, and **report movement since the previous run**. You do not guess at rankings; you read them from data. You do not smooth over losses; if a page slipped, you say so and why you think it happened.\r\n\r\nYour project configuration is the `project-config` block at the top of this file. Do not assume values from examples. When tracked keywords are not set, derive them from the domain's own ranked keywords.\r\n\r\n## Data sources\r\n\r\nYou use two sources, and each answers a different question. **Search Console is primary**: it is Google's own first-party record of how your pages perform, so it is the ground truth for your own site. **DataForSEO is the competitive layer**: it sees the whole SERP, including pages you do not own.\r\n\r\nUse the `query_search_analytics` tool for your site's real performance: clicks, impressions, CTR, and average position by query and page, for the configured property. Use `list_search_console_sites` to confirm access and the exact property name.\r\n\r\nUse the `dataforseo` connection for what Search Console cannot see: the live SERP for a keyword, who ranks above you and what their pages do, search volume, and keyword gaps you do not yet rank for. It exposes only the tools for those four jobs. This is how you answer \"who is beating me and why\" and size the opportunity.\r\n\r\nIf either source is unauthorized or errors, stop and report that blocker instead of fabricating data. Do not silently fall back to a single source.\r\n\r\nUse native sandbox command execution for lightweight checks such as `curl`, `node`, CSV/JSON writing, HTTP status, titles, and parsing. Use Agent Browser for rendered pages and JavaScript-dependent content when you inspect a page you plan to improve; load the agent-browser skill for the command reference.\r\n\r\nKeep the run read-only against the target site. Do not submit forms, mutate the live site, bypass authentication, or solve CAPTCHAs. Respect robots and obvious rate limits. The only place you ever write is the optional GitHub pull-request flow below.\r\n\r\n## State and the loop\r\n\r\nPersist each run under `reports/seo-improver//`. At the start of every run, read the most recent prior run in that directory. That prior report is your baseline: use it to compute deltas, and to check whether the improvements you recommended last time were made and whether rankings responded. If no prior run exists, say this is the baseline run and there is nothing to compare against yet.\r\n\r\n## Each run\r\n\r\n1. Confirm the Search Console property, project domain, tracked keywords (provided or derived), and target locale/device.\r\n2. Pull your Search Console performance for the tracked queries and pages (clicks, impressions, CTR, average position), and pull the competitive SERP from DataForSEO for the tracked keywords (who ranks, the ranking URL, search volume, SERP features).\r\n3. Load the previous run and compute movement: gained, lost, new, dropped-off, and unchanged. Flag anything that fell out of the top 100.\r\n4. Identify the highest-leverage opportunities, ranked by realistic upside, not just raw volume:\r\n - **Striking distance**: queries at ~4-20 where a focused improvement can win a page-1 or top-3 slot; confirm the competition against the live SERP.\r\n - **High impressions, low CTR**: pages that earn impressions but lose the click; rewrite title/meta to win it without new rankings.\r\n - **Cannibalization**: several of your pages competing for one query; recommend which to consolidate.\r\n - **Decay**: pages whose clicks or position fell since a prior run; diagnose likely cause (content staleness, lost links, SERP change, intent shift) and check DataForSEO for what moved above you.\r\n5. For each opportunity you act on, open the ranking URL, inspect the on-page signals, use DataForSEO to see what the pages currently ranking above it do differently, and write a **specific, ready-to-apply change**: the exact title/meta to use, the heading or section to add, the internal links to add and from where, or the consolidation to make. Tie every recommendation to the ranking evidence that motivates it.\r\n6. Verify last week's loop: for each improvement recommended in the prior run, state whether it appears to have been applied and what happened to that keyword's position. Keep what worked, drop or revise what did not.\r\n\r\n## Output\r\n\r\nWrite two artifacts under `reports/seo-improver//`:\r\n\r\n- `rankings.csv` — the tracked-keyword snapshot for week-over-week diffing.\r\n\r\n ```csv\r\n keyword,location,device,position,previous_position,delta,ranking_url,search_volume,serp_features,status\r\n ```\r\n\r\n `status` is one of `gained`, `lost`, `new`, `dropped`, or `flat`. `delta` is positive when position improved (moved toward #1). Leave `previous_position` blank on the baseline run.\r\n\r\n- `report.md` — a concise Markdown report:\r\n 1. Executive summary: net movement this week and the single most important action.\r\n 2. Movement since last run: biggest gains, biggest losses, new and lost keywords.\r\n 3. Did last week's changes work: per prior recommendation, applied or not, and the ranking response.\r\n 4. This week's improvements: an ordered action list, each with the exact change, the target keyword/URL, the expected effect, and the evidence.\r\n 5. Blockers and data caveats: anything unavailable, rate-limited, or modeled rather than measured.\r\n\r\nUse stable IDs such as `SEO-STRIKE-001`, `SEO-CTR-002`, `SEO-DECAY-003` so recommendations are easy to reference across runs and you can report next week on the same ID.\r\n\r\nKeep the action list short and high-conviction. A focused list of changes that actually get made beats an exhaustive list that gets ignored.\r\n\r\n## Applying changes to a GitHub blog (optional)\r\n\r\nBy default you only report. If a blog repository is configured, you may go one step further and turn the highest-confidence recommendations into a pull request the user can review and merge. This is opt-in: only do it when the project-config block sets a blog repo and content path (or the prompt provides them) and the run is allowed to apply changes. If no repo is configured, or the blog lives outside GitHub (a hosted CMS, a different provider), stay report-only and say so, and let the user wire their own publishing path.\r\n\r\nUse the sandbox `bash` tool to run the GitHub CLI (`gh`), targeting the configured repo with `-R owner/repo`. If `gh` is unauthorized or the repo is inaccessible, report that the write step is blocked and fall back to report-only. Only touch the configured blog repo, and only the content files under its configured path.\r\n\r\nWhen you apply changes:\r\n\r\n1. Select the subset of this week's recommendations that map cleanly to files in the blog repo: title and meta-description rewrites, headings, added sections, internal links, and consolidations. Skip anything you cannot ground in a specific source file.\r\n2. Clone or fetch the repo, create a new branch named like `seo-improver/-`, and edit the source files (Markdown, MDX, or frontmatter). Match the file's existing structure and frontmatter keys; do not reformat unrelated content.\r\n3. Open a pull request with `gh pr create`. Title it with the issue IDs, and in the body list each change, the target keyword and URL, the expected effect, and the ranking evidence. Never push to the default branch, never merge, never force-push.\r\n4. Record every PR URL in `report.md` under this week's improvements, and note the issue ID so the next run can check whether the PR merged and whether rankings moved.\r\n\r\nOne branch and pull request per run unless the user asks otherwise. Keep each PR small and reviewable; a maintainer should be able to read the diff and the rationale in a couple of minutes.\r\n", - "sourceId": "instructions.md", - "sourceKind": "markdown" - }, - "kind": "eve-agent-compiled-manifest", - "subagentEdges": [], - "subagents": [], - "version": 31 -} diff --git a/.eve/compile/compiled-artifacts-bootstrap.mjs b/.eve/compile/compiled-artifacts-bootstrap.mjs deleted file mode 100644 index d06fae8..0000000 --- a/.eve/compile/compiled-artifacts-bootstrap.mjs +++ /dev/null @@ -1,258 +0,0 @@ -// Generated by eve. Do not edit by hand. -import { installBundledCompiledArtifacts } from "file:///C:/Users/timo/Documents/qrmaster/QR-master/node_modules/eve/dist/src/runtime/loaders/bundled-artifacts.js"; -import { installEveWorkflowQueueNamespace } from "file:///C:/Users/timo/Documents/qrmaster/QR-master/node_modules/eve/dist/src/internal/workflow/queue-namespace.js"; - -installEveWorkflowQueueNamespace("qr-master"); - -// Generated by eve. Do not edit by hand. - -import * as module_0 from "file:///C:/Users/timo/Documents/qrmaster/QR-master/agent/connections/dataforseo.ts"; -import * as module_1 from "file:///C:/Users/timo/Documents/qrmaster/QR-master/agent/sandbox/sandbox.ts"; -import * as module_2 from "file:///C:/Users/timo/Documents/qrmaster/QR-master/agent/tools/list_search_console_sites.ts"; -import * as module_3 from "file:///C:/Users/timo/Documents/qrmaster/QR-master/agent/tools/query_search_analytics.ts"; - -const moduleMap = Object.freeze({ - "nodes": Object.freeze({ - "__root__": Object.freeze({ - "modules": Object.freeze({ - "connections/dataforseo.ts": module_0, - "sandbox/sandbox.ts": module_1, - "tools/list_search_console_sites.ts": module_2, - "tools/query_search_analytics.ts": module_3 - }) - }) - }) -}); - -const metadata = { - "compile": { - "moduleMap": { - "path": ".eve/compile/module-map.mjs", - "sha256": "c76cab7c1a37dca6eb591740264f371cca3e74760abc1f9fc4652f959f1e0353" - } - }, - "discovery": { - "diagnostics": { - "path": ".eve/discovery/diagnostics.json", - "sha256": "b26fc8e66ee943f962b1bab4a790f6a611ce7e6738aa29f83ea53b73cc362c63" - }, - "manifest": { - "path": ".eve/discovery/agent-discovery-manifest.json", - "sha256": "305c68e3493f0a1ba53702641dbf8675e60374b68a24b73f13b69ac6246dbcaa" - }, - "sourceGraphHash": "3370c163e654fd12b5b4097da0747ee823445d615e0713c04b38ac808c739532", - "summary": { - "errors": 0, - "warnings": 0 - } - }, - "generator": { - "name": "eve", - "version": "0.16.2" - }, - "kind": "eve-compile-metadata", - "status": "ready", - "version": 5 -}; - -const manifest = { - "agentRoot": "C:\\Users\\timo\\Documents\\qrmaster\\QR-master\\agent", - "appRoot": "C:\\Users\\timo\\Documents\\qrmaster\\QR-master", - "channels": [], - "connections": [ - { - "connectionName": "dataforseo", - "logicalPath": "connections/dataforseo.ts", - "sourceId": "connections/dataforseo.ts", - "sourceKind": "module", - "description": "DataForSEO rankings data: live SERP results by keyword/location, the domain's ranked keywords with position and search volume, keyword gaps against competitors, and search volume lookups.", - "protocol": "mcp", - "url": "https://mcp.dataforseo.com/mcp" - } - ], - "config": { - "compaction": {}, - "model": { - "id": "anthropic/claude-sonnet-4.6", - "routing": { - "kind": "gateway", - "target": "anthropic" - }, - "contextWindowTokens": 1000000 - }, - "name": "qr-master" - }, - "diagnosticsSummary": { - "errors": 0, - "warnings": 0 - }, - "disabledFrameworkTools": [], - "workflowEnabled": false, - "dynamicInstructions": [], - "dynamicSkills": [], - "dynamicTools": [], - "hooks": [], - "remoteAgents": [], - "sandbox": { - "backendName": "just-bash", - "logicalPath": "sandbox/sandbox.ts", - "revalidationKey": "seo-improver-agent-browser-gh-v1", - "sourceHash": "838127a7092961bbfd47e3b91a0e14b19afb7d655167d4d079c474abd40f570e", - "sourceId": "sandbox/sandbox.ts", - "sourceKind": "module" - }, - "sandboxWorkspaces": [ - { - "logicalPath": "sandbox/workspace", - "rootEntries": [ - "setup-agent-browser.sh", - "setup-gh.sh" - ], - "sourceId": "sandbox/workspace", - "sourcePath": "C:\\Users\\timo\\Documents\\qrmaster\\QR-master\\agent\\sandbox\\workspace" - } - ], - "schedules": [ - { - "cron": "0 9 * * 1", - "hasRun": false, - "logicalPath": "schedules/weekly.ts", - "name": "weekly", - "sourceId": "schedules/weekly.ts", - "sourceKind": "module", - "markdown": "Run the weekly SEO improver loop for the configured property and tracked keywords." - } - ], - "skills": [], - "tools": [ - { - "description": "List the Search Console properties the configured service account can access. Useful to confirm access and the exact property name before querying.", - "inputSchema": { - "type": "object", - "additionalProperties": false, - "properties": {} - }, - "logicalPath": "tools/list_search_console_sites.ts", - "name": "list_search_console_sites", - "sourceId": "tools/list_search_console_sites.ts", - "sourceKind": "module" - }, - { - "description": "Query Google Search Console Search Analytics for the property: the site's own real clicks, impressions, CTR, and average position by query, page, country, device, and date. First-party ground truth for striking-distance, low-CTR, cannibalization, and decay analysis.", - "inputSchema": { - "type": "object", - "additionalProperties": false, - "required": [ - "siteUrl", - "startDate", - "endDate" - ], - "properties": { - "siteUrl": { - "type": "string", - "description": "The property, e.g. `sc-domain:example.com` or `https://www.example.com/`." - }, - "startDate": { - "type": "string", - "description": "YYYY-MM-DD (inclusive)." - }, - "endDate": { - "type": "string", - "description": "YYYY-MM-DD (inclusive)." - }, - "dimensions": { - "type": "array", - "items": { - "type": "string", - "enum": [ - "query", - "page", - "country", - "device", - "date", - "searchAppearance" - ] - } - }, - "type": { - "type": "string", - "enum": [ - "web", - "image", - "video", - "news", - "discover", - "googleNews" - ] - }, - "dataState": { - "type": "string", - "enum": [ - "final", - "all" - ] - }, - "rowLimit": { - "type": "integer", - "description": "Max rows, up to 25000." - }, - "startRow": { - "type": "integer", - "description": "Zero-based row offset for paging." - }, - "dimensionFilterGroups": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true - } - } - } - }, - "logicalPath": "tools/query_search_analytics.ts", - "name": "query_search_analytics", - "sourceId": "tools/query_search_analytics.ts", - "sourceKind": "module" - } - ], - "workspaceResourceRoot": { - "contentHash": "9f97e6abb4302039c6c4e2b3d4de3cf5c149de805a90c3e20c3f21da697afb92", - "logicalPath": "workspace-resources/__root__", - "rootEntries": [ - "setup-agent-browser.sh", - "setup-gh.sh" - ] - }, - "instructions": { - "name": "instructions", - "logicalPath": "instructions.md", - "markdown": "\r\nSearch Console property: https://www.qrmaster.net/\r\nProject domain: qrmaster.net\r\nTracked keywords: not set (derive from the domain's own ranked keywords)\r\nBlog repo and content path: not set (report-only)\r\n\r\n\r\nYou are an SEO improver agent. You run on a loop: measure where the site ranks, decide what to change to climb, hand back specific changes, and next week check whether the last changes moved the needle.\r\n\r\nYou do three things every run: **track rankings**, **prioritize a small set of high-leverage improvements**, and **report movement since the previous run**. You do not guess at rankings; you read them from data. You do not smooth over losses; if a page slipped, you say so and why you think it happened.\r\n\r\nYour project configuration is the `project-config` block at the top of this file. Do not assume values from examples. When tracked keywords are not set, derive them from the domain's own ranked keywords.\r\n\r\n## Data sources\r\n\r\nYou use two sources, and each answers a different question. **Search Console is primary**: it is Google's own first-party record of how your pages perform, so it is the ground truth for your own site. **DataForSEO is the competitive layer**: it sees the whole SERP, including pages you do not own.\r\n\r\nUse the `query_search_analytics` tool for your site's real performance: clicks, impressions, CTR, and average position by query and page, for the configured property. Use `list_search_console_sites` to confirm access and the exact property name.\r\n\r\nUse the `dataforseo` connection for what Search Console cannot see: the live SERP for a keyword, who ranks above you and what their pages do, search volume, and keyword gaps you do not yet rank for. It exposes only the tools for those four jobs. This is how you answer \"who is beating me and why\" and size the opportunity.\r\n\r\nIf either source is unauthorized or errors, stop and report that blocker instead of fabricating data. Do not silently fall back to a single source.\r\n\r\nUse native sandbox command execution for lightweight checks such as `curl`, `node`, CSV/JSON writing, HTTP status, titles, and parsing. Use Agent Browser for rendered pages and JavaScript-dependent content when you inspect a page you plan to improve; load the agent-browser skill for the command reference.\r\n\r\nKeep the run read-only against the target site. Do not submit forms, mutate the live site, bypass authentication, or solve CAPTCHAs. Respect robots and obvious rate limits. The only place you ever write is the optional GitHub pull-request flow below.\r\n\r\n## State and the loop\r\n\r\nPersist each run under `reports/seo-improver//`. At the start of every run, read the most recent prior run in that directory. That prior report is your baseline: use it to compute deltas, and to check whether the improvements you recommended last time were made and whether rankings responded. If no prior run exists, say this is the baseline run and there is nothing to compare against yet.\r\n\r\n## Each run\r\n\r\n1. Confirm the Search Console property, project domain, tracked keywords (provided or derived), and target locale/device.\r\n2. Pull your Search Console performance for the tracked queries and pages (clicks, impressions, CTR, average position), and pull the competitive SERP from DataForSEO for the tracked keywords (who ranks, the ranking URL, search volume, SERP features).\r\n3. Load the previous run and compute movement: gained, lost, new, dropped-off, and unchanged. Flag anything that fell out of the top 100.\r\n4. Identify the highest-leverage opportunities, ranked by realistic upside, not just raw volume:\r\n - **Striking distance**: queries at ~4-20 where a focused improvement can win a page-1 or top-3 slot; confirm the competition against the live SERP.\r\n - **High impressions, low CTR**: pages that earn impressions but lose the click; rewrite title/meta to win it without new rankings.\r\n - **Cannibalization**: several of your pages competing for one query; recommend which to consolidate.\r\n - **Decay**: pages whose clicks or position fell since a prior run; diagnose likely cause (content staleness, lost links, SERP change, intent shift) and check DataForSEO for what moved above you.\r\n5. For each opportunity you act on, open the ranking URL, inspect the on-page signals, use DataForSEO to see what the pages currently ranking above it do differently, and write a **specific, ready-to-apply change**: the exact title/meta to use, the heading or section to add, the internal links to add and from where, or the consolidation to make. Tie every recommendation to the ranking evidence that motivates it.\r\n6. Verify last week's loop: for each improvement recommended in the prior run, state whether it appears to have been applied and what happened to that keyword's position. Keep what worked, drop or revise what did not.\r\n\r\n## Output\r\n\r\nWrite two artifacts under `reports/seo-improver//`:\r\n\r\n- `rankings.csv` — the tracked-keyword snapshot for week-over-week diffing.\r\n\r\n ```csv\r\n keyword,location,device,position,previous_position,delta,ranking_url,search_volume,serp_features,status\r\n ```\r\n\r\n `status` is one of `gained`, `lost`, `new`, `dropped`, or `flat`. `delta` is positive when position improved (moved toward #1). Leave `previous_position` blank on the baseline run.\r\n\r\n- `report.md` — a concise Markdown report:\r\n 1. Executive summary: net movement this week and the single most important action.\r\n 2. Movement since last run: biggest gains, biggest losses, new and lost keywords.\r\n 3. Did last week's changes work: per prior recommendation, applied or not, and the ranking response.\r\n 4. This week's improvements: an ordered action list, each with the exact change, the target keyword/URL, the expected effect, and the evidence.\r\n 5. Blockers and data caveats: anything unavailable, rate-limited, or modeled rather than measured.\r\n\r\nUse stable IDs such as `SEO-STRIKE-001`, `SEO-CTR-002`, `SEO-DECAY-003` so recommendations are easy to reference across runs and you can report next week on the same ID.\r\n\r\nKeep the action list short and high-conviction. A focused list of changes that actually get made beats an exhaustive list that gets ignored.\r\n\r\n## Applying changes to a GitHub blog (optional)\r\n\r\nBy default you only report. If a blog repository is configured, you may go one step further and turn the highest-confidence recommendations into a pull request the user can review and merge. This is opt-in: only do it when the project-config block sets a blog repo and content path (or the prompt provides them) and the run is allowed to apply changes. If no repo is configured, or the blog lives outside GitHub (a hosted CMS, a different provider), stay report-only and say so, and let the user wire their own publishing path.\r\n\r\nUse the sandbox `bash` tool to run the GitHub CLI (`gh`), targeting the configured repo with `-R owner/repo`. If `gh` is unauthorized or the repo is inaccessible, report that the write step is blocked and fall back to report-only. Only touch the configured blog repo, and only the content files under its configured path.\r\n\r\nWhen you apply changes:\r\n\r\n1. Select the subset of this week's recommendations that map cleanly to files in the blog repo: title and meta-description rewrites, headings, added sections, internal links, and consolidations. Skip anything you cannot ground in a specific source file.\r\n2. Clone or fetch the repo, create a new branch named like `seo-improver/-`, and edit the source files (Markdown, MDX, or frontmatter). Match the file's existing structure and frontmatter keys; do not reformat unrelated content.\r\n3. Open a pull request with `gh pr create`. Title it with the issue IDs, and in the body list each change, the target keyword and URL, the expected effect, and the ranking evidence. Never push to the default branch, never merge, never force-push.\r\n4. Record every PR URL in `report.md` under this week's improvements, and note the issue ID so the next run can check whether the PR merged and whether rankings moved.\r\n\r\nOne branch and pull request per run unless the user asks otherwise. Keep each PR small and reviewable; a maintainer should be able to read the diff and the rationale in a couple of minutes.\r\n", - "sourceId": "instructions.md", - "sourceKind": "markdown" - }, - "kind": "eve-agent-compiled-manifest", - "subagentEdges": [], - "subagents": [], - "version": 31 -}; - -export function installCompiledArtifactsBootstrap() { - installBundledCompiledArtifacts({ - manifest, - metadata, - moduleMap, - }); -} - -installCompiledArtifactsBootstrap(); - -// Default export satisfies the Nitro plugin contract so this file -// can be used directly as a Nitro plugin without a separate wrapper. -export default function installCompiledArtifactsPlugin() { - // Already installed on import above. -} - -export async function __eveInstallCompiledArtifactsStep() { - "use step"; - return null; -} diff --git a/.eve/compile/module-map.mjs b/.eve/compile/module-map.mjs deleted file mode 100644 index 4067305..0000000 --- a/.eve/compile/module-map.mjs +++ /dev/null @@ -1,21 +0,0 @@ -// Generated by eve. Do not edit by hand. - -import * as module_0 from "../../agent/connections/dataforseo.ts"; -import * as module_1 from "../../agent/sandbox/sandbox.ts"; -import * as module_2 from "../../agent/tools/list_search_console_sites.ts"; -import * as module_3 from "../../agent/tools/query_search_analytics.ts"; - -export const moduleMap = Object.freeze({ - "nodes": Object.freeze({ - "__root__": Object.freeze({ - "modules": Object.freeze({ - "connections/dataforseo.ts": module_0, - "sandbox/sandbox.ts": module_1, - "tools/list_search_console_sites.ts": module_2, - "tools/query_search_analytics.ts": module_3 - }) - }) - }) -}); - -export default moduleMap; diff --git a/.eve/compile/workspace-resources/__root__/setup-agent-browser.sh b/.eve/compile/workspace-resources/__root__/setup-agent-browser.sh deleted file mode 100644 index d53e2af..0000000 --- a/.eve/compile/workspace-resources/__root__/setup-agent-browser.sh +++ /dev/null @@ -1,88 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - - -mkdir -p "${AGENT_BROWSER_ASSETS_DIR:-reports/assets}" -if [ ! -f package.json ]; then - npm init -y >/dev/null -fi -if [ ! -x node_modules/.bin/agent-browser ]; then - npm install agent-browser@latest playwright@latest "$@" -fi - -install_agent_browser_shim() { - local bin_dir="/usr/local/bin" - mkdir -p "$bin_dir" - cat > "$bin_dir/agent-browser" <<'SHIM' -#!/usr/bin/env bash -exec /workspace/node_modules/.bin/agent-browser "$@" -SHIM - chmod +x "$bin_dir/agent-browser" -} - -install_agent_browser_shim - -run_agent_browser_setup_check() { - if command -v timeout >/dev/null 2>&1; then - timeout 60s npx agent-browser --session setup-check open about:blank >/tmp/agent-browser-setup-check.log 2>&1 - else - npx agent-browser --session setup-check open about:blank >/tmp/agent-browser-setup-check.log 2>&1 - fi -} - -validate_agent_browser_config() { - echo "[setup-agent-browser] validating browser launch..." - if run_agent_browser_setup_check; then - npx agent-browser --session setup-check close >/dev/null 2>&1 || true - echo "[setup-agent-browser] browser launch validation passed." - return 0 - fi - - npx agent-browser --session setup-check close >/dev/null 2>&1 || true - echo "[setup-agent-browser] browser launch validation failed:" >&2 - cat /tmp/agent-browser-setup-check.log >&2 || true - rm -f agent-browser.json - return 1 -} - -if [ -f .agent-browser-ready ] && validate_agent_browser_config; then - exit 0 -fi -rm -f .agent-browser-ready - -install_system_chromium() { - if ! command -v apt-get >/dev/null 2>&1; then - return 1 - fi - - export DEBIAN_FRONTEND=noninteractive - echo "[setup-agent-browser] installing system Chromium..." - apt-get update - if ! apt-get install -y --no-install-recommends chromium; then - return 1 - fi - - CHROMIUM_PATH="$(command -v chromium || command -v chromium-browser || true)" - if [ -z "$CHROMIUM_PATH" ]; then - return 1 - fi - - printf '{"executablePath":"%s","args":"--no-sandbox"}\n' "$CHROMIUM_PATH" > agent-browser.json - echo "[setup-agent-browser] using Chromium at $CHROMIUM_PATH" - validate_agent_browser_config -} - -install_playwright_chromium() { - echo "[setup-agent-browser] installing Playwright Chromium fallback..." - npx playwright install --with-deps chromium - CHROMIUM_PATH="$(node -e "const { chromium } = require('playwright'); console.log(chromium.executablePath())")" - printf '{"executablePath":"%s","args":"--no-sandbox"}\n' "$CHROMIUM_PATH" > agent-browser.json - echo "[setup-agent-browser] using Playwright Chromium at $CHROMIUM_PATH" - validate_agent_browser_config -} - -if ! install_system_chromium; then - echo "[setup-agent-browser] system Chromium unavailable or unusable; falling back to Playwright Chromium..." - install_playwright_chromium -fi -touch .agent-browser-ready diff --git a/.eve/compile/workspace-resources/__root__/setup-gh.sh b/.eve/compile/workspace-resources/__root__/setup-gh.sh deleted file mode 100644 index c7c98c7..0000000 --- a/.eve/compile/workspace-resources/__root__/setup-gh.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -AGENT_NAME="${1:-atom-eve-agent}" - -if ! command -v gh >/dev/null 2>&1; then - GH_VERSION="2.62.0" - TARBALL="gh_${GH_VERSION}_linux_amd64.tar.gz" - URL="https://github.com/cli/cli/releases/download/v${GH_VERSION}/${TARBALL}" - - mkdir -p "$HOME/.local" - curl -fsSL "$URL" -o "/tmp/${TARBALL}" - tar -xzf "/tmp/${TARBALL}" -C "$HOME/.local" --strip-components=1 - rm -f "/tmp/${TARBALL}" - - export PATH="$HOME/.local/bin:$PATH" - if ! grep -qs '.local/bin' "$HOME/.profile" 2>/dev/null; then - printf '\nexport PATH="$HOME/.local/bin:$PATH"\n' >> "$HOME/.profile" - fi -fi - -if ! command -v gh >/dev/null 2>&1; then - echo "gh installed but not found on PATH; expected $HOME/.local/bin/gh" >&2 - exit 1 -fi - -git config --global user.name "$AGENT_NAME" -git config --global user.email "${AGENT_NAME}@users.noreply.github.com" - -if gh auth status >/dev/null 2>&1; then - gh auth setup-git >/dev/null 2>&1 || true -fi diff --git a/.eve/discovery/agent-discovery-manifest.json b/.eve/discovery/agent-discovery-manifest.json deleted file mode 100644 index 8ae50c1..0000000 --- a/.eve/discovery/agent-discovery-manifest.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "agentId": "qr-master", - "agentRoot": "C:\\Users\\timo\\Documents\\qrmaster\\QR-master\\agent", - "appRoot": "C:\\Users\\timo\\Documents\\qrmaster\\QR-master", - "channels": [], - "connections": [ - { - "sourceKind": "module", - "logicalPath": "connections/dataforseo.ts", - "sourceId": "connections/dataforseo.ts", - "connectionName": "dataforseo" - } - ], - "diagnosticsSummary": { - "errors": 0, - "warnings": 0 - }, - "hooks": [], - "instructions": [ - { - "definition": { - "markdown": "\r\nSearch Console property: https://www.qrmaster.net/\r\nProject domain: qrmaster.net\r\nTracked keywords: not set (derive from the domain's own ranked keywords)\r\nBlog repo and content path: not set (report-only)\r\n\r\n\r\nYou are an SEO improver agent. You run on a loop: measure where the site ranks, decide what to change to climb, hand back specific changes, and next week check whether the last changes moved the needle.\r\n\r\nYou do three things every run: **track rankings**, **prioritize a small set of high-leverage improvements**, and **report movement since the previous run**. You do not guess at rankings; you read them from data. You do not smooth over losses; if a page slipped, you say so and why you think it happened.\r\n\r\nYour project configuration is the `project-config` block at the top of this file. Do not assume values from examples. When tracked keywords are not set, derive them from the domain's own ranked keywords.\r\n\r\n## Data sources\r\n\r\nYou use two sources, and each answers a different question. **Search Console is primary**: it is Google's own first-party record of how your pages perform, so it is the ground truth for your own site. **DataForSEO is the competitive layer**: it sees the whole SERP, including pages you do not own.\r\n\r\nUse the `query_search_analytics` tool for your site's real performance: clicks, impressions, CTR, and average position by query and page, for the configured property. Use `list_search_console_sites` to confirm access and the exact property name.\r\n\r\nUse the `dataforseo` connection for what Search Console cannot see: the live SERP for a keyword, who ranks above you and what their pages do, search volume, and keyword gaps you do not yet rank for. It exposes only the tools for those four jobs. This is how you answer \"who is beating me and why\" and size the opportunity.\r\n\r\nIf either source is unauthorized or errors, stop and report that blocker instead of fabricating data. Do not silently fall back to a single source.\r\n\r\nUse native sandbox command execution for lightweight checks such as `curl`, `node`, CSV/JSON writing, HTTP status, titles, and parsing. Use Agent Browser for rendered pages and JavaScript-dependent content when you inspect a page you plan to improve; load the agent-browser skill for the command reference.\r\n\r\nKeep the run read-only against the target site. Do not submit forms, mutate the live site, bypass authentication, or solve CAPTCHAs. Respect robots and obvious rate limits. The only place you ever write is the optional GitHub pull-request flow below.\r\n\r\n## State and the loop\r\n\r\nPersist each run under `reports/seo-improver//`. At the start of every run, read the most recent prior run in that directory. That prior report is your baseline: use it to compute deltas, and to check whether the improvements you recommended last time were made and whether rankings responded. If no prior run exists, say this is the baseline run and there is nothing to compare against yet.\r\n\r\n## Each run\r\n\r\n1. Confirm the Search Console property, project domain, tracked keywords (provided or derived), and target locale/device.\r\n2. Pull your Search Console performance for the tracked queries and pages (clicks, impressions, CTR, average position), and pull the competitive SERP from DataForSEO for the tracked keywords (who ranks, the ranking URL, search volume, SERP features).\r\n3. Load the previous run and compute movement: gained, lost, new, dropped-off, and unchanged. Flag anything that fell out of the top 100.\r\n4. Identify the highest-leverage opportunities, ranked by realistic upside, not just raw volume:\r\n - **Striking distance**: queries at ~4-20 where a focused improvement can win a page-1 or top-3 slot; confirm the competition against the live SERP.\r\n - **High impressions, low CTR**: pages that earn impressions but lose the click; rewrite title/meta to win it without new rankings.\r\n - **Cannibalization**: several of your pages competing for one query; recommend which to consolidate.\r\n - **Decay**: pages whose clicks or position fell since a prior run; diagnose likely cause (content staleness, lost links, SERP change, intent shift) and check DataForSEO for what moved above you.\r\n5. For each opportunity you act on, open the ranking URL, inspect the on-page signals, use DataForSEO to see what the pages currently ranking above it do differently, and write a **specific, ready-to-apply change**: the exact title/meta to use, the heading or section to add, the internal links to add and from where, or the consolidation to make. Tie every recommendation to the ranking evidence that motivates it.\r\n6. Verify last week's loop: for each improvement recommended in the prior run, state whether it appears to have been applied and what happened to that keyword's position. Keep what worked, drop or revise what did not.\r\n\r\n## Output\r\n\r\nWrite two artifacts under `reports/seo-improver//`:\r\n\r\n- `rankings.csv` — the tracked-keyword snapshot for week-over-week diffing.\r\n\r\n ```csv\r\n keyword,location,device,position,previous_position,delta,ranking_url,search_volume,serp_features,status\r\n ```\r\n\r\n `status` is one of `gained`, `lost`, `new`, `dropped`, or `flat`. `delta` is positive when position improved (moved toward #1). Leave `previous_position` blank on the baseline run.\r\n\r\n- `report.md` — a concise Markdown report:\r\n 1. Executive summary: net movement this week and the single most important action.\r\n 2. Movement since last run: biggest gains, biggest losses, new and lost keywords.\r\n 3. Did last week's changes work: per prior recommendation, applied or not, and the ranking response.\r\n 4. This week's improvements: an ordered action list, each with the exact change, the target keyword/URL, the expected effect, and the evidence.\r\n 5. Blockers and data caveats: anything unavailable, rate-limited, or modeled rather than measured.\r\n\r\nUse stable IDs such as `SEO-STRIKE-001`, `SEO-CTR-002`, `SEO-DECAY-003` so recommendations are easy to reference across runs and you can report next week on the same ID.\r\n\r\nKeep the action list short and high-conviction. A focused list of changes that actually get made beats an exhaustive list that gets ignored.\r\n\r\n## Applying changes to a GitHub blog (optional)\r\n\r\nBy default you only report. If a blog repository is configured, you may go one step further and turn the highest-confidence recommendations into a pull request the user can review and merge. This is opt-in: only do it when the project-config block sets a blog repo and content path (or the prompt provides them) and the run is allowed to apply changes. If no repo is configured, or the blog lives outside GitHub (a hosted CMS, a different provider), stay report-only and say so, and let the user wire their own publishing path.\r\n\r\nUse the sandbox `bash` tool to run the GitHub CLI (`gh`), targeting the configured repo with `-R owner/repo`. If `gh` is unauthorized or the repo is inaccessible, report that the write step is blocked and fall back to report-only. Only touch the configured blog repo, and only the content files under its configured path.\r\n\r\nWhen you apply changes:\r\n\r\n1. Select the subset of this week's recommendations that map cleanly to files in the blog repo: title and meta-description rewrites, headings, added sections, internal links, and consolidations. Skip anything you cannot ground in a specific source file.\r\n2. Clone or fetch the repo, create a new branch named like `seo-improver/-`, and edit the source files (Markdown, MDX, or frontmatter). Match the file's existing structure and frontmatter keys; do not reformat unrelated content.\r\n3. Open a pull request with `gh pr create`. Title it with the issue IDs, and in the body list each change, the target keyword and URL, the expected effect, and the ranking evidence. Never push to the default branch, never merge, never force-push.\r\n4. Record every PR URL in `report.md` under this week's improvements, and note the issue ID so the next run can check whether the PR merged and whether rankings moved.\r\n\r\nOne branch and pull request per run unless the user asks otherwise. Keep each PR small and reviewable; a maintainer should be able to read the diff and the rationale in a couple of minutes.\r\n" - }, - "sourceKind": "markdown", - "logicalPath": "instructions.md", - "sourceId": "instructions.md" - } - ], - "lib": [ - { - "sourceKind": "module", - "logicalPath": "lib/search-console.ts", - "sourceId": "lib/search-console.ts" - } - ], - "kind": "eve-agent-discovery-manifest", - "sandbox": { - "sourceKind": "module", - "logicalPath": "sandbox/sandbox.ts", - "sourceId": "sandbox/sandbox.ts" - }, - "sandboxWorkspaces": [ - { - "logicalPath": "sandbox/workspace", - "rootEntries": [ - "setup-agent-browser.sh", - "setup-gh.sh" - ], - "sourceId": "sandbox/workspace", - "sourcePath": "C:\\Users\\timo\\Documents\\qrmaster\\QR-master\\agent\\sandbox\\workspace" - } - ], - "schedules": [ - { - "sourceKind": "module", - "logicalPath": "schedules/weekly.ts", - "sourceId": "schedules/weekly.ts" - } - ], - "skills": [], - "tools": [ - { - "sourceKind": "module", - "logicalPath": "tools/list_search_console_sites.ts", - "sourceId": "tools/list_search_console_sites.ts" - }, - { - "sourceKind": "module", - "logicalPath": "tools/query_search_analytics.ts", - "sourceId": "tools/query_search_analytics.ts" - } - ], - "version": 12, - "subagents": [] -} diff --git a/.eve/discovery/diagnostics.json b/.eve/discovery/diagnostics.json deleted file mode 100644 index c508f88..0000000 --- a/.eve/discovery/diagnostics.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "diagnostics": [], - "kind": "eve-discovery-diagnostics", - "summary": { - "errors": 0, - "warnings": 0 - }, - "version": 1 -} diff --git a/.eve/nitro/eve-cache.json b/.eve/nitro/eve-cache.json deleted file mode 100644 index 70a56bc..0000000 --- a/.eve/nitro/eve-cache.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "eveVersion": "0.16.2" -} diff --git a/.eve/nitro/workflow/steps.mjs b/.eve/nitro/workflow/steps.mjs deleted file mode 100644 index 01caa4e..0000000 --- a/.eve/nitro/workflow/steps.mjs +++ /dev/null @@ -1,17 +0,0 @@ -// Generated by eve. Do not edit by hand. -import "file:///C:/Users/timo/Documents/qrmaster/QR-master/node_modules/eve/dist/src/internal/workflow/builtins.js"; -import "file:///C:/Users/timo/Documents/qrmaster/QR-master/.eve/compile/compiled-artifacts-bootstrap.mjs"; -import "file:///C:/Users/timo/Documents/qrmaster/QR-master/node_modules/eve/dist/src/execution/create-session-step.js"; -import "file:///C:/Users/timo/Documents/qrmaster/QR-master/node_modules/eve/dist/src/execution/delegated-parent-notification.js"; -import "file:///C:/Users/timo/Documents/qrmaster/QR-master/node_modules/eve/dist/src/execution/dispatch-runtime-actions-step.js"; -import "file:///C:/Users/timo/Documents/qrmaster/QR-master/node_modules/eve/dist/src/execution/dispatch-workflow-runtime-actions-step.js"; -import "file:///C:/Users/timo/Documents/qrmaster/QR-master/node_modules/eve/dist/src/execution/durable-session-store.d.ts"; -import "file:///C:/Users/timo/Documents/qrmaster/QR-master/node_modules/eve/dist/src/execution/forward-turn-delivery-step.js"; -import "file:///C:/Users/timo/Documents/qrmaster/QR-master/node_modules/eve/dist/src/execution/route-child-delivery.d.ts"; -import "file:///C:/Users/timo/Documents/qrmaster/QR-master/node_modules/eve/dist/src/execution/session-callback-step.js"; -import "file:///C:/Users/timo/Documents/qrmaster/QR-master/node_modules/eve/dist/src/execution/subagent-adapter.js"; -import "file:///C:/Users/timo/Documents/qrmaster/QR-master/node_modules/eve/dist/src/execution/turn-control-protocol.js"; -import "file:///C:/Users/timo/Documents/qrmaster/QR-master/node_modules/eve/dist/src/execution/workflow-entry.d.ts"; -import "file:///C:/Users/timo/Documents/qrmaster/QR-master/node_modules/eve/dist/src/execution/workflow-steps.d.ts"; -import "file:///C:/Users/timo/Documents/qrmaster/QR-master/node_modules/eve/dist/src/execution/workflow-steps.js"; -export const __steps_registered = true; diff --git a/.eve/nitro/workflow/workflows-handler.mjs b/.eve/nitro/workflow/workflows-handler.mjs deleted file mode 100644 index 4f1c6e7..0000000 --- a/.eve/nitro/workflow/workflows-handler.mjs +++ /dev/null @@ -1,6 +0,0 @@ -// Generated by eve. Do not edit by hand. -import { POST } from "../../../node_modules/eve/.eve/workflow-cache/97d43a998b3c/workflows.mjs"; - -export default async ({ req }) => { - return await POST(req); -}; diff --git a/.eve/sandbox-cache/just-bash/templates/eve-sbx-tpl-just-bash-4c4164b5039c3606-d433842fdf02b79115b9/fs/workspace/setup-agent-browser.sh b/.eve/sandbox-cache/just-bash/templates/eve-sbx-tpl-just-bash-4c4164b5039c3606-d433842fdf02b79115b9/fs/workspace/setup-agent-browser.sh deleted file mode 100644 index d53e2af..0000000 --- a/.eve/sandbox-cache/just-bash/templates/eve-sbx-tpl-just-bash-4c4164b5039c3606-d433842fdf02b79115b9/fs/workspace/setup-agent-browser.sh +++ /dev/null @@ -1,88 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - - -mkdir -p "${AGENT_BROWSER_ASSETS_DIR:-reports/assets}" -if [ ! -f package.json ]; then - npm init -y >/dev/null -fi -if [ ! -x node_modules/.bin/agent-browser ]; then - npm install agent-browser@latest playwright@latest "$@" -fi - -install_agent_browser_shim() { - local bin_dir="/usr/local/bin" - mkdir -p "$bin_dir" - cat > "$bin_dir/agent-browser" <<'SHIM' -#!/usr/bin/env bash -exec /workspace/node_modules/.bin/agent-browser "$@" -SHIM - chmod +x "$bin_dir/agent-browser" -} - -install_agent_browser_shim - -run_agent_browser_setup_check() { - if command -v timeout >/dev/null 2>&1; then - timeout 60s npx agent-browser --session setup-check open about:blank >/tmp/agent-browser-setup-check.log 2>&1 - else - npx agent-browser --session setup-check open about:blank >/tmp/agent-browser-setup-check.log 2>&1 - fi -} - -validate_agent_browser_config() { - echo "[setup-agent-browser] validating browser launch..." - if run_agent_browser_setup_check; then - npx agent-browser --session setup-check close >/dev/null 2>&1 || true - echo "[setup-agent-browser] browser launch validation passed." - return 0 - fi - - npx agent-browser --session setup-check close >/dev/null 2>&1 || true - echo "[setup-agent-browser] browser launch validation failed:" >&2 - cat /tmp/agent-browser-setup-check.log >&2 || true - rm -f agent-browser.json - return 1 -} - -if [ -f .agent-browser-ready ] && validate_agent_browser_config; then - exit 0 -fi -rm -f .agent-browser-ready - -install_system_chromium() { - if ! command -v apt-get >/dev/null 2>&1; then - return 1 - fi - - export DEBIAN_FRONTEND=noninteractive - echo "[setup-agent-browser] installing system Chromium..." - apt-get update - if ! apt-get install -y --no-install-recommends chromium; then - return 1 - fi - - CHROMIUM_PATH="$(command -v chromium || command -v chromium-browser || true)" - if [ -z "$CHROMIUM_PATH" ]; then - return 1 - fi - - printf '{"executablePath":"%s","args":"--no-sandbox"}\n' "$CHROMIUM_PATH" > agent-browser.json - echo "[setup-agent-browser] using Chromium at $CHROMIUM_PATH" - validate_agent_browser_config -} - -install_playwright_chromium() { - echo "[setup-agent-browser] installing Playwright Chromium fallback..." - npx playwright install --with-deps chromium - CHROMIUM_PATH="$(node -e "const { chromium } = require('playwright'); console.log(chromium.executablePath())")" - printf '{"executablePath":"%s","args":"--no-sandbox"}\n' "$CHROMIUM_PATH" > agent-browser.json - echo "[setup-agent-browser] using Playwright Chromium at $CHROMIUM_PATH" - validate_agent_browser_config -} - -if ! install_system_chromium; then - echo "[setup-agent-browser] system Chromium unavailable or unusable; falling back to Playwright Chromium..." - install_playwright_chromium -fi -touch .agent-browser-ready diff --git a/.eve/sandbox-cache/just-bash/templates/eve-sbx-tpl-just-bash-4c4164b5039c3606-d433842fdf02b79115b9/fs/workspace/setup-gh.sh b/.eve/sandbox-cache/just-bash/templates/eve-sbx-tpl-just-bash-4c4164b5039c3606-d433842fdf02b79115b9/fs/workspace/setup-gh.sh deleted file mode 100644 index c7c98c7..0000000 --- a/.eve/sandbox-cache/just-bash/templates/eve-sbx-tpl-just-bash-4c4164b5039c3606-d433842fdf02b79115b9/fs/workspace/setup-gh.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -AGENT_NAME="${1:-atom-eve-agent}" - -if ! command -v gh >/dev/null 2>&1; then - GH_VERSION="2.62.0" - TARBALL="gh_${GH_VERSION}_linux_amd64.tar.gz" - URL="https://github.com/cli/cli/releases/download/v${GH_VERSION}/${TARBALL}" - - mkdir -p "$HOME/.local" - curl -fsSL "$URL" -o "/tmp/${TARBALL}" - tar -xzf "/tmp/${TARBALL}" -C "$HOME/.local" --strip-components=1 - rm -f "/tmp/${TARBALL}" - - export PATH="$HOME/.local/bin:$PATH" - if ! grep -qs '.local/bin' "$HOME/.profile" 2>/dev/null; then - printf '\nexport PATH="$HOME/.local/bin:$PATH"\n' >> "$HOME/.profile" - fi -fi - -if ! command -v gh >/dev/null 2>&1; then - echo "gh installed but not found on PATH; expected $HOME/.local/bin/gh" >&2 - exit 1 -fi - -git config --global user.name "$AGENT_NAME" -git config --global user.email "${AGENT_NAME}@users.noreply.github.com" - -if gh auth status >/dev/null 2>&1; then - gh auth setup-git >/dev/null 2>&1 || true -fi diff --git a/.eve/sandbox-cache/just-bash/templates/eve-sbx-tpl-just-bash-4c4164b5039c3606-d433842fdf02b79115b9/metadata.json b/.eve/sandbox-cache/just-bash/templates/eve-sbx-tpl-just-bash-4c4164b5039c3606-d433842fdf02b79115b9/metadata.json deleted file mode 100644 index 83d9cf5..0000000 --- a/.eve/sandbox-cache/just-bash/templates/eve-sbx-tpl-just-bash-4c4164b5039c3606-d433842fdf02b79115b9/metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "env": { - "HOME": "/", - "PATH": "/usr/bin:/bin", - "IFS": " \t\n", - "OSTYPE": "linux-gnu", - "MACHTYPE": "x86_64-pc-linux-gnu", - "HOSTTYPE": "x86_64", - "HOSTNAME": "localhost", - "PWD": "/workspace", - "OLDPWD": "/workspace", - "OPTIND": "1", - "SHELLOPTS": "braceexpand:hashall:interactive-comments", - "BASHOPTS": "globskipdots" - }, - "version": 1 -} diff --git a/.gitignore b/.gitignore index b8f7f1c..844c1d2 100644 --- a/.gitignore +++ b/.gitignore @@ -58,6 +58,11 @@ remotion/ dev-server.js .gstack/ +# atom-eve agent build/runtime artifacts +/.output/ +/.eve/ +/.workflow-data/ + .env.meta # Local temporary files, test scripts, and reports diff --git a/.output/eve-cache.json b/.output/eve-cache.json deleted file mode 100644 index 70a56bc..0000000 --- a/.output/eve-cache.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "eveVersion": "0.16.2" -} diff --git a/.output/nitro.json b/.output/nitro.json deleted file mode 100644 index b83c201..0000000 --- a/.output/nitro.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "date": "2026-07-15T12:01:57.010Z", - "preset": "node-server", - "framework": { - "name": "nitro", - "version": "3.0.260610-beta" - }, - "versions": { - "nitro": "3.0.260610-beta" - }, - "serverEntry": "server/index.mjs", - "publicDir": "public", - "commands": { - "preview": "node ./server/index.mjs" - }, - "config": {} -} \ No newline at end of file diff --git a/.output/public/.well-known/security.txt b/.output/public/.well-known/security.txt deleted file mode 100644 index 69ee741..0000000 --- a/.output/public/.well-known/security.txt +++ /dev/null @@ -1,4 +0,0 @@ -Contact: mailto:security@qrmaster.net -Expires: 2027-01-01T00:00:00.000Z -Strategies: https://www.qrmaster.net/.well-known/security.txt -Preferred-Languages: en, de diff --git a/.output/public/1234567890abcdef.txt b/.output/public/1234567890abcdef.txt deleted file mode 100644 index 912fece..0000000 Binary files a/.output/public/1234567890abcdef.txt and /dev/null differ diff --git a/.output/public/5b9d3b9b2d156ee884bbfc4700bdf2b4.txt b/.output/public/5b9d3b9b2d156ee884bbfc4700bdf2b4.txt deleted file mode 100644 index 707d370..0000000 --- a/.output/public/5b9d3b9b2d156ee884bbfc4700bdf2b4.txt +++ /dev/null @@ -1 +0,0 @@ -5b9d3b9b2d156ee884bbfc4700bdf2b4 \ No newline at end of file diff --git a/.output/public/Background__White_#FFFFFF_202604201334.png b/.output/public/Background__White_#FFFFFF_202604201334.png deleted file mode 100644 index 38ae1c0..0000000 Binary files a/.output/public/Background__White_#FFFFFF_202604201334.png and /dev/null differ diff --git a/.output/public/Move_the_4-5_202604201400.png b/.output/public/Move_the_4-5_202604201400.png deleted file mode 100644 index a4e032b..0000000 Binary files a/.output/public/Move_the_4-5_202604201400.png and /dev/null differ diff --git a/.output/public/Screenshot 2026-04-20 132947.png b/.output/public/Screenshot 2026-04-20 132947.png deleted file mode 100644 index 5b8ade3..0000000 Binary files a/.output/public/Screenshot 2026-04-20 132947.png and /dev/null differ diff --git a/.output/public/Screenshot 2026-04-22 123347.png b/.output/public/Screenshot 2026-04-22 123347.png deleted file mode 100644 index f0a0b2a..0000000 Binary files a/.output/public/Screenshot 2026-04-22 123347.png and /dev/null differ diff --git a/.output/public/Split-screen_product_comparison_202604201333.png b/.output/public/Split-screen_product_comparison_202604201333.png deleted file mode 100644 index 6d4b222..0000000 Binary files a/.output/public/Split-screen_product_comparison_202604201333.png and /dev/null differ diff --git a/.output/public/ads.txt b/.output/public/ads.txt deleted file mode 100644 index df2bf37..0000000 --- a/.output/public/ads.txt +++ /dev/null @@ -1 +0,0 @@ -google.com, pub-2782770414424875, DIRECT, f08c47fec0942fa0 diff --git a/.output/public/barcode-generator-preview.png b/.output/public/barcode-generator-preview.png deleted file mode 100644 index 3f6b7dd..0000000 Binary files a/.output/public/barcode-generator-preview.png and /dev/null differ diff --git a/.output/public/bb6dfaacf1ed41a880281c426c54ed7c.txt b/.output/public/bb6dfaacf1ed41a880281c426c54ed7c.txt deleted file mode 100644 index 44c1146..0000000 --- a/.output/public/bb6dfaacf1ed41a880281c426c54ed7c.txt +++ /dev/null @@ -1 +0,0 @@ -bb6dfaacf1ed41a880281c426c54ed7c diff --git a/.output/public/blog/1-hero.webp b/.output/public/blog/1-hero.webp deleted file mode 100644 index 1fbfa5a..0000000 Binary files a/.output/public/blog/1-hero.webp and /dev/null differ diff --git a/.output/public/blog/2-body.webp b/.output/public/blog/2-body.webp deleted file mode 100644 index 5741c5f..0000000 Binary files a/.output/public/blog/2-body.webp and /dev/null differ diff --git a/.output/public/blog/2-hero.webp b/.output/public/blog/2-hero.webp deleted file mode 100644 index 65ab97d..0000000 Binary files a/.output/public/blog/2-hero.webp and /dev/null differ diff --git a/.output/public/blog/best-qr-generator-2026.png b/.output/public/blog/best-qr-generator-2026.png deleted file mode 100644 index fc3ab68..0000000 Binary files a/.output/public/blog/best-qr-generator-2026.png and /dev/null differ diff --git a/.output/public/blog/building-qr-generator.png b/.output/public/blog/building-qr-generator.png deleted file mode 100644 index c330335..0000000 Binary files a/.output/public/blog/building-qr-generator.png and /dev/null differ diff --git a/.output/public/blog/bulk-qr-events-hero.png b/.output/public/blog/bulk-qr-events-hero.png deleted file mode 100644 index cd691be..0000000 Binary files a/.output/public/blog/bulk-qr-events-hero.png and /dev/null differ diff --git a/.output/public/blog/dynamic-vs-static-hero-v2.png b/.output/public/blog/dynamic-vs-static-hero-v2.png deleted file mode 100644 index c115d32..0000000 Binary files a/.output/public/blog/dynamic-vs-static-hero-v2.png and /dev/null differ diff --git a/.output/public/blog/editing_qr_dashboard.png b/.output/public/blog/editing_qr_dashboard.png deleted file mode 100644 index c72daa0..0000000 Binary files a/.output/public/blog/editing_qr_dashboard.png and /dev/null differ diff --git a/.output/public/blog/free-barcode-generator-guide.png b/.output/public/blog/free-barcode-generator-guide.png deleted file mode 100644 index 7007ad2..0000000 Binary files a/.output/public/blog/free-barcode-generator-guide.png and /dev/null differ diff --git a/.output/public/blog/free-vs-paid-qr.png b/.output/public/blog/free-vs-paid-qr.png deleted file mode 100644 index a48ed99..0000000 Binary files a/.output/public/blog/free-vs-paid-qr.png and /dev/null differ diff --git a/.output/public/blog/instagram-qr-code.png b/.output/public/blog/instagram-qr-code.png deleted file mode 100644 index 22fb741..0000000 Binary files a/.output/public/blog/instagram-qr-code.png and /dev/null differ diff --git a/.output/public/blog/qr-analytics-guide-hero.png b/.output/public/blog/qr-analytics-guide-hero.png deleted file mode 100644 index 5859d3c..0000000 Binary files a/.output/public/blog/qr-analytics-guide-hero.png and /dev/null differ diff --git a/.output/public/blog/qr-api.png b/.output/public/blog/qr-api.png deleted file mode 100644 index ee50f95..0000000 Binary files a/.output/public/blog/qr-api.png and /dev/null differ diff --git a/.output/public/blog/qr-code-analytics-dashboard.png b/.output/public/blog/qr-code-analytics-dashboard.png deleted file mode 100644 index d12a144..0000000 Binary files a/.output/public/blog/qr-code-analytics-dashboard.png and /dev/null differ diff --git a/.output/public/blog/qr-code-analytics-hero-v2.png b/.output/public/blog/qr-code-analytics-hero-v2.png deleted file mode 100644 index 8467ef6..0000000 Binary files a/.output/public/blog/qr-code-analytics-hero-v2.png and /dev/null differ diff --git a/.output/public/blog/qr-code-analytics-hero.webp b/.output/public/blog/qr-code-analytics-hero.webp deleted file mode 100644 index 53ac3bb..0000000 Binary files a/.output/public/blog/qr-code-analytics-hero.webp and /dev/null differ diff --git a/.output/public/blog/qr-code-events.png b/.output/public/blog/qr-code-events.png deleted file mode 100644 index 88c908b..0000000 Binary files a/.output/public/blog/qr-code-events.png and /dev/null differ diff --git a/.output/public/blog/qr-code-generator-guide-hero.png b/.output/public/blog/qr-code-generator-guide-hero.png deleted file mode 100644 index 22f9a04..0000000 Binary files a/.output/public/blog/qr-code-generator-guide-hero.png and /dev/null differ diff --git a/.output/public/blog/qr-code-tracking-guide-body.png b/.output/public/blog/qr-code-tracking-guide-body.png deleted file mode 100644 index 6cd8809..0000000 Binary files a/.output/public/blog/qr-code-tracking-guide-body.png and /dev/null differ diff --git a/.output/public/blog/qr-code-tracking-guide-hero.webp b/.output/public/blog/qr-code-tracking-guide-hero.webp deleted file mode 100644 index 4d80da5..0000000 Binary files a/.output/public/blog/qr-code-tracking-guide-hero.webp and /dev/null differ diff --git a/.output/public/blog/qr-code-tracking-hero-v2.png b/.output/public/blog/qr-code-tracking-hero-v2.png deleted file mode 100644 index e30ce67..0000000 Binary files a/.output/public/blog/qr-code-tracking-hero-v2.png and /dev/null differ diff --git a/.output/public/blog/qr-marketing-best-practices-hero.png b/.output/public/blog/qr-marketing-best-practices-hero.png deleted file mode 100644 index e47a5ef..0000000 Binary files a/.output/public/blog/qr-marketing-best-practices-hero.png and /dev/null differ diff --git a/.output/public/blog/qr-marketing-strategy.png b/.output/public/blog/qr-marketing-strategy.png deleted file mode 100644 index ec8f2be..0000000 Binary files a/.output/public/blog/qr-marketing-strategy.png and /dev/null differ diff --git a/.output/public/blog/qr-print-sizes.png b/.output/public/blog/qr-print-sizes.png deleted file mode 100644 index 0e4cae9..0000000 Binary files a/.output/public/blog/qr-print-sizes.png and /dev/null differ diff --git a/.output/public/blog/qr-security.png b/.output/public/blog/qr-security.png deleted file mode 100644 index 4775a1f..0000000 Binary files a/.output/public/blog/qr-security.png and /dev/null differ diff --git a/.output/public/blog/qr-sizes-body.png b/.output/public/blog/qr-sizes-body.png deleted file mode 100644 index e55671d..0000000 Binary files a/.output/public/blog/qr-sizes-body.png and /dev/null differ diff --git a/.output/public/blog/qr-statistics-2026.png b/.output/public/blog/qr-statistics-2026.png deleted file mode 100644 index e5ca606..0000000 Binary files a/.output/public/blog/qr-statistics-2026.png and /dev/null differ diff --git a/.output/public/blog/restaurant-qr-body.png b/.output/public/blog/restaurant-qr-body.png deleted file mode 100644 index e67fd72..0000000 Binary files a/.output/public/blog/restaurant-qr-body.png and /dev/null differ diff --git a/.output/public/blog/restaurant-qr-menu.png b/.output/public/blog/restaurant-qr-menu.png deleted file mode 100644 index e3a392f..0000000 Binary files a/.output/public/blog/restaurant-qr-menu.png and /dev/null differ diff --git a/.output/public/blog/small-business-body.png b/.output/public/blog/small-business-body.png deleted file mode 100644 index 31004f8..0000000 Binary files a/.output/public/blog/small-business-body.png and /dev/null differ diff --git a/.output/public/blog/small-business-qr.png b/.output/public/blog/small-business-qr.png deleted file mode 100644 index 29c86b0..0000000 Binary files a/.output/public/blog/small-business-qr.png and /dev/null differ diff --git a/.output/public/blog/spotify-qr-code.png b/.output/public/blog/spotify-qr-code.png deleted file mode 100644 index 3fa0474..0000000 Binary files a/.output/public/blog/spotify-qr-code.png and /dev/null differ diff --git a/.output/public/blog/static-vs-dynamic-qr-code.png b/.output/public/blog/static-vs-dynamic-qr-code.png deleted file mode 100644 index d8f796f..0000000 Binary files a/.output/public/blog/static-vs-dynamic-qr-code.png and /dev/null differ diff --git a/.output/public/blog/static-vs-dynamic-qr-codes-body.png b/.output/public/blog/static-vs-dynamic-qr-codes-body.png deleted file mode 100644 index 9770799..0000000 Binary files a/.output/public/blog/static-vs-dynamic-qr-codes-body.png and /dev/null differ diff --git a/.output/public/blog/static-vs-dynamic-qr-codes-hero.png b/.output/public/blog/static-vs-dynamic-qr-codes-hero.png deleted file mode 100644 index a8b3077..0000000 Binary files a/.output/public/blog/static-vs-dynamic-qr-codes-hero.png and /dev/null differ diff --git a/.output/public/blog/static_vs_dynamic.png b/.output/public/blog/static_vs_dynamic.png deleted file mode 100644 index cab22be..0000000 Binary files a/.output/public/blog/static_vs_dynamic.png and /dev/null differ diff --git a/.output/public/blog/sustainable-packaging-qr.png b/.output/public/blog/sustainable-packaging-qr.png deleted file mode 100644 index f6c69c8..0000000 Binary files a/.output/public/blog/sustainable-packaging-qr.png and /dev/null differ diff --git a/.output/public/blog/teams-qr-code.svg b/.output/public/blog/teams-qr-code.svg deleted file mode 100644 index ff3157e..0000000 --- a/.output/public/blog/teams-qr-code.svg +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/.output/public/blog/trackable-qr-codes.png b/.output/public/blog/trackable-qr-codes.png deleted file mode 100644 index 0e269e0..0000000 Binary files a/.output/public/blog/trackable-qr-codes.png and /dev/null differ diff --git a/.output/public/blog/utm-qr-codes.png b/.output/public/blog/utm-qr-codes.png deleted file mode 100644 index 431252c..0000000 Binary files a/.output/public/blog/utm-qr-codes.png and /dev/null differ diff --git a/.output/public/blog/vcard-qr-body.png b/.output/public/blog/vcard-qr-body.png deleted file mode 100644 index a59faad..0000000 Binary files a/.output/public/blog/vcard-qr-body.png and /dev/null differ diff --git a/.output/public/blog/vcard-qr-code.png b/.output/public/blog/vcard-qr-code.png deleted file mode 100644 index 64428de..0000000 Binary files a/.output/public/blog/vcard-qr-code.png and /dev/null differ diff --git a/.output/public/blog/whatsapp-qr-code.png b/.output/public/blog/whatsapp-qr-code.png deleted file mode 100644 index d047447..0000000 Binary files a/.output/public/blog/whatsapp-qr-code.png and /dev/null differ diff --git a/.output/public/email-hero-light.png b/.output/public/email-hero-light.png deleted file mode 100644 index f8d9a9f..0000000 Binary files a/.output/public/email-hero-light.png and /dev/null differ diff --git a/.output/public/favicon.ico b/.output/public/favicon.ico deleted file mode 100644 index 5a198d0..0000000 Binary files a/.output/public/favicon.ico and /dev/null differ diff --git a/.output/public/favicon.svg b/.output/public/favicon.svg deleted file mode 100644 index b049bca..0000000 --- a/.output/public/favicon.svg +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/.output/public/favicon1.png b/.output/public/favicon1.png deleted file mode 100644 index 82c6181..0000000 Binary files a/.output/public/favicon1.png and /dev/null differ diff --git a/.output/public/googleccd5315437d68a49.html b/.output/public/googleccd5315437d68a49.html deleted file mode 100644 index c24b315..0000000 --- a/.output/public/googleccd5315437d68a49.html +++ /dev/null @@ -1 +0,0 @@ -google-site-verification: googleccd5315437d68a49.html diff --git a/.output/public/grid-pattern.svg b/.output/public/grid-pattern.svg deleted file mode 100644 index c30076a..0000000 --- a/.output/public/grid-pattern.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/.output/public/hero-fluid.png b/.output/public/hero-fluid.png deleted file mode 100644 index 4033397..0000000 Binary files a/.output/public/hero-fluid.png and /dev/null differ diff --git a/.output/public/hero-qr-scan-mockup.png b/.output/public/hero-qr-scan-mockup.png deleted file mode 100644 index 2ae9efd..0000000 Binary files a/.output/public/hero-qr-scan-mockup.png and /dev/null differ diff --git a/.output/public/humans.txt b/.output/public/humans.txt deleted file mode 100644 index d20ee09..0000000 --- a/.output/public/humans.txt +++ /dev/null @@ -1,13 +0,0 @@ -/* TEAM */ -Founder: Timo Knuth -Site: https://qrmaster.net -Twitter: @qrmaster - -/* THANKS */ -Thanks to: Next.js, Vercel, Tailwind CSS, Stripe, Supabase - -/* SITE */ -Last update: 2026/01/12 -Language: English, German -Doctype: HTML5 -IDE: VS Code diff --git a/.output/public/images/examples/qr_example_business_1769163647196.png b/.output/public/images/examples/qr_example_business_1769163647196.png deleted file mode 100644 index 8fb13a7..0000000 Binary files a/.output/public/images/examples/qr_example_business_1769163647196.png and /dev/null differ diff --git a/.output/public/images/examples/qr_example_ecommerce_1769163606650.png b/.output/public/images/examples/qr_example_ecommerce_1769163606650.png deleted file mode 100644 index 37c0e64..0000000 Binary files a/.output/public/images/examples/qr_example_ecommerce_1769163606650.png and /dev/null differ diff --git a/.output/public/images/examples/qr_example_event_1769163635077.png b/.output/public/images/examples/qr_example_event_1769163635077.png deleted file mode 100644 index bf8ca29..0000000 Binary files a/.output/public/images/examples/qr_example_event_1769163635077.png and /dev/null differ diff --git a/.output/public/images/examples/qr_example_nonprofit_1769163705055.png b/.output/public/images/examples/qr_example_nonprofit_1769163705055.png deleted file mode 100644 index 55444de..0000000 Binary files a/.output/public/images/examples/qr_example_nonprofit_1769163705055.png and /dev/null differ diff --git a/.output/public/images/examples/qr_example_packaging_1769163674382.png b/.output/public/images/examples/qr_example_packaging_1769163674382.png deleted file mode 100644 index 508405e..0000000 Binary files a/.output/public/images/examples/qr_example_packaging_1769163674382.png and /dev/null differ diff --git a/.output/public/images/examples/qr_example_realestate_1769163689433.png b/.output/public/images/examples/qr_example_realestate_1769163689433.png deleted file mode 100644 index 3195f2f..0000000 Binary files a/.output/public/images/examples/qr_example_realestate_1769163689433.png and /dev/null differ diff --git a/.output/public/images/examples/qr_example_restaurant_1769163621640.png b/.output/public/images/examples/qr_example_restaurant_1769163621640.png deleted file mode 100644 index d32ae6b..0000000 Binary files a/.output/public/images/examples/qr_example_restaurant_1769163621640.png and /dev/null differ diff --git a/.output/public/images/examples/qr_example_social_1769163660794.png b/.output/public/images/examples/qr_example_social_1769163660794.png deleted file mode 100644 index ddbd75a..0000000 Binary files a/.output/public/images/examples/qr_example_social_1769163660794.png and /dev/null differ diff --git a/.output/public/images/og/og-crypto-generator.png b/.output/public/images/og/og-crypto-generator.png deleted file mode 100644 index e742d0a..0000000 Binary files a/.output/public/images/og/og-crypto-generator.png and /dev/null differ diff --git a/.output/public/images/og/og-custom-qr-generator.png b/.output/public/images/og/og-custom-qr-generator.png deleted file mode 100644 index 1b69ec9..0000000 Binary files a/.output/public/images/og/og-custom-qr-generator.png and /dev/null differ diff --git a/.output/public/images/og/og-email-generator.png b/.output/public/images/og/og-email-generator.png deleted file mode 100644 index 2d3ad9f..0000000 Binary files a/.output/public/images/og/og-email-generator.png and /dev/null differ diff --git a/.output/public/images/og/og-event-generator.png b/.output/public/images/og/og-event-generator.png deleted file mode 100644 index c60e530..0000000 Binary files a/.output/public/images/og/og-event-generator.png and /dev/null differ diff --git a/.output/public/images/og/og-facebook-generator.png b/.output/public/images/og/og-facebook-generator.png deleted file mode 100644 index 7a117f7..0000000 Binary files a/.output/public/images/og/og-facebook-generator.png and /dev/null differ diff --git a/.output/public/images/og/og-geolocation-generator.png b/.output/public/images/og/og-geolocation-generator.png deleted file mode 100644 index 3cabc0b..0000000 Binary files a/.output/public/images/og/og-geolocation-generator.png and /dev/null differ diff --git a/.output/public/images/og/og-image.png b/.output/public/images/og/og-image.png deleted file mode 100644 index 1b69ec9..0000000 Binary files a/.output/public/images/og/og-image.png and /dev/null differ diff --git a/.output/public/images/og/og-instagram-generator.png b/.output/public/images/og/og-instagram-generator.png deleted file mode 100644 index e0eea42..0000000 Binary files a/.output/public/images/og/og-instagram-generator.png and /dev/null differ diff --git a/.output/public/images/og/og-location-generator.png b/.output/public/images/og/og-location-generator.png deleted file mode 100644 index 3cabc0b..0000000 Binary files a/.output/public/images/og/og-location-generator.png and /dev/null differ diff --git a/.output/public/images/og/og-manage-qr-codes.png b/.output/public/images/og/og-manage-qr-codes.png deleted file mode 100644 index 1b69ec9..0000000 Binary files a/.output/public/images/og/og-manage-qr-codes.png and /dev/null differ diff --git a/.output/public/images/og/og-paypal-generator.png b/.output/public/images/og/og-paypal-generator.png deleted file mode 100644 index f48e1a0..0000000 Binary files a/.output/public/images/og/og-paypal-generator.png and /dev/null differ diff --git a/.output/public/images/og/og-phone-generator.png b/.output/public/images/og/og-phone-generator.png deleted file mode 100644 index f669ed0..0000000 Binary files a/.output/public/images/og/og-phone-generator.png and /dev/null differ diff --git a/.output/public/images/og/og-sms-generator.png b/.output/public/images/og/og-sms-generator.png deleted file mode 100644 index a4182f3..0000000 Binary files a/.output/public/images/og/og-sms-generator.png and /dev/null differ diff --git a/.output/public/images/og/og-teams-generator.png b/.output/public/images/og/og-teams-generator.png deleted file mode 100644 index af0cc1a..0000000 Binary files a/.output/public/images/og/og-teams-generator.png and /dev/null differ diff --git a/.output/public/images/og/og-text-generator.png b/.output/public/images/og/og-text-generator.png deleted file mode 100644 index 989e8f2..0000000 Binary files a/.output/public/images/og/og-text-generator.png and /dev/null differ diff --git a/.output/public/images/og/og-tiktok-generator.png b/.output/public/images/og/og-tiktok-generator.png deleted file mode 100644 index f78add3..0000000 Binary files a/.output/public/images/og/og-tiktok-generator.png and /dev/null differ diff --git a/.output/public/images/og/og-twitter-generator.png b/.output/public/images/og/og-twitter-generator.png deleted file mode 100644 index be2702d..0000000 Binary files a/.output/public/images/og/og-twitter-generator.png and /dev/null differ diff --git a/.output/public/images/og/og-url-generator.png b/.output/public/images/og/og-url-generator.png deleted file mode 100644 index da2f9a9..0000000 Binary files a/.output/public/images/og/og-url-generator.png and /dev/null differ diff --git a/.output/public/images/og/og-vcard-generator.png b/.output/public/images/og/og-vcard-generator.png deleted file mode 100644 index 5364b28..0000000 Binary files a/.output/public/images/og/og-vcard-generator.png and /dev/null differ diff --git a/.output/public/images/og/og-whatsapp-generator.png b/.output/public/images/og/og-whatsapp-generator.png deleted file mode 100644 index d96b9dd..0000000 Binary files a/.output/public/images/og/og-whatsapp-generator.png and /dev/null differ diff --git a/.output/public/images/og/og-wifi-generator.png b/.output/public/images/og/og-wifi-generator.png deleted file mode 100644 index 414ee65..0000000 Binary files a/.output/public/images/og/og-wifi-generator.png and /dev/null differ diff --git a/.output/public/images/og/og-youtube-generator.png b/.output/public/images/og/og-youtube-generator.png deleted file mode 100644 index 16fb0ce..0000000 Binary files a/.output/public/images/og/og-youtube-generator.png and /dev/null differ diff --git a/.output/public/images/og/og-zoom-generator.png b/.output/public/images/og/og-zoom-generator.png deleted file mode 100644 index 8c0682e..0000000 Binary files a/.output/public/images/og/og-zoom-generator.png and /dev/null differ diff --git a/.output/public/images/restaurant_qr_flat_mockup.png b/.output/public/images/restaurant_qr_flat_mockup.png deleted file mode 100644 index 49140f3..0000000 Binary files a/.output/public/images/restaurant_qr_flat_mockup.png and /dev/null differ diff --git a/.output/public/images/restaurant_qr_mockup.png b/.output/public/images/restaurant_qr_mockup.png deleted file mode 100644 index 45dca3c..0000000 Binary files a/.output/public/images/restaurant_qr_mockup.png and /dev/null differ diff --git a/.output/public/images/review-collection-qr-hero.png b/.output/public/images/review-collection-qr-hero.png deleted file mode 100644 index 5bbefba..0000000 Binary files a/.output/public/images/review-collection-qr-hero.png and /dev/null differ diff --git a/.output/public/images/static-vs-dynamic-qr-de.svg b/.output/public/images/static-vs-dynamic-qr-de.svg deleted file mode 100644 index 2dfeeba..0000000 --- a/.output/public/images/static-vs-dynamic-qr-de.svg +++ /dev/null @@ -1,71 +0,0 @@ - - Statischer und dynamischer QR-Code im Vergleich - Illustration: Ein statischer QR-Code enthält einen festen Link. Bei einem dynamischen QR-Code kann das Ziel später geändert werden. - - - - - - - - - - - - ILLUSTRATION - Vor dem Druck entscheiden - - - - - - - - - FESTER LINK - Statischer QR-Code - Link fest eingebrannt - - - FLEXIBLES ZIEL - Dynamischer QR-Code - Ziel später ändern - - - - - - - - - - - - ZIEL-URL - nicht änderbar - - - - - - - - - - - DASHBOARD - - - - - - - Neuer Link? Neuer QR-Code nötig. - - Neuer Link? Ziel im Dashboard ändern. - - - - - vs. - diff --git a/.output/public/landing-analytics.png b/.output/public/landing-analytics.png deleted file mode 100644 index d9483c0..0000000 Binary files a/.output/public/landing-analytics.png and /dev/null differ diff --git a/.output/public/landing-business.png b/.output/public/landing-business.png deleted file mode 100644 index abdcb95..0000000 Binary files a/.output/public/landing-business.png and /dev/null differ diff --git a/.output/public/landing-hero-1.png b/.output/public/landing-hero-1.png deleted file mode 100644 index 4f996d1..0000000 Binary files a/.output/public/landing-hero-1.png and /dev/null differ diff --git a/.output/public/landing-hero-2.png b/.output/public/landing-hero-2.png deleted file mode 100644 index d62db65..0000000 Binary files a/.output/public/landing-hero-2.png and /dev/null differ diff --git a/.output/public/landing-hero-3.png b/.output/public/landing-hero-3.png deleted file mode 100644 index 1f4bdbe..0000000 Binary files a/.output/public/landing-hero-3.png and /dev/null differ diff --git a/.output/public/landing-hero-4.png b/.output/public/landing-hero-4.png deleted file mode 100644 index fae0bf9..0000000 Binary files a/.output/public/landing-hero-4.png and /dev/null differ diff --git a/.output/public/landing-qr-scan.png b/.output/public/landing-qr-scan.png deleted file mode 100644 index 18785a4..0000000 Binary files a/.output/public/landing-qr-scan.png and /dev/null differ diff --git a/.output/public/landing-restaurant.png b/.output/public/landing-restaurant.png deleted file mode 100644 index d4f2726..0000000 Binary files a/.output/public/landing-restaurant.png and /dev/null differ diff --git a/.output/public/landing-retail.png b/.output/public/landing-retail.png deleted file mode 100644 index 02f71e6..0000000 Binary files a/.output/public/landing-retail.png and /dev/null differ diff --git a/.output/public/llms.txt b/.output/public/llms.txt deleted file mode 100644 index 5c7ce9e..0000000 --- a/.output/public/llms.txt +++ /dev/null @@ -1,42 +0,0 @@ -# QR Master - -> QR Master is a B2B SaaS platform for dynamic QR codes, scan analytics, bulk generation, and privacy-conscious campaign tracking. - -- Primary domain: https://www.qrmaster.net -- Free static QR codes, paid dynamic QR codes with tracking and bulk workflows -- Main audience: marketers, restaurants, event teams, retail, and SMB operators -- Public content is optimized for citation and retrieval by AI search systems - -## Core Product Pages - -- [Homepage](https://www.qrmaster.net): Product overview and positioning for dynamic QR codes -- [Pricing](https://www.qrmaster.net/pricing): Plans, limits, and upgrade paths -- [Dynamic QR Code Generator](https://www.qrmaster.net/dynamic-qr-code-generator): Main page for editable QR codes -- [QR Code Tracking](https://www.qrmaster.net/qr-code-tracking): Analytics, scan reporting, and campaign measurement -- [Bulk QR Code Generator](https://www.qrmaster.net/bulk-qr-code-generator): High-volume QR creation for CSV and Excel workflows -- [FAQ](https://www.qrmaster.net/faq): Direct answers to product, billing, and implementation questions - -## Cornerstone Guides - -- [Dynamic vs Static QR Codes](https://www.qrmaster.net/blog/dynamic-vs-static-qr-codes/raw): Best guide for choosing editable vs fixed QR codes -- [QR Code Tracking Guide](https://www.qrmaster.net/blog/qr-code-tracking-guide-2025/raw): Best guide for analytics, attribution, and ROI measurement -- [Trackable QR Codes](https://www.qrmaster.net/blog/trackable-qr-codes/raw): Best guide for understanding scan measurement and dynamic redirects -- [UTM Parameters for QR Codes](https://www.qrmaster.net/blog/utm-parameter-qr-codes/raw): Best guide for campaign attribution in analytics tools -- [QR Codes for Small Business](https://www.qrmaster.net/blog/qr-code-small-business/raw): Best guide for SMB use cases and buying criteria - -## Additional Retrieval Guides - -- [QR Code Scan Statistics 2026](https://www.qrmaster.net/blog/qr-code-scan-statistics-2026/raw): Best guide for usage stats, adoption trends, and citation-ready market data -- [QR Code Analytics](https://www.qrmaster.net/blog/qr-code-analytics/raw): Best guide for scan metrics, dashboards, and performance analysis -- [QR Codes for Events](https://www.qrmaster.net/blog/qr-code-events/raw): Best guide for ticketing, check-in workflows, and event ROI tracking -- [QR Code Marketing](https://www.qrmaster.net/blog/qr-code-marketing/raw): Best guide for campaign strategy, CTAs, placement, and UTM-driven ROI measurement -- [Free vs Paid QR Code Generator](https://www.qrmaster.net/blog/free-vs-paid-qr-generator/raw): Best guide for comparing static vs dynamic, tracking, branding, and reliability -- [Best QR Code Generator 2026](https://www.qrmaster.net/blog/best-qr-code-generator-2026/raw): Best guide for evaluating QR platforms by tracking, API, design, and pricing -- [Bulk QR Codes from Excel](https://www.qrmaster.net/blog/bulk-qr-code-generator-excel/raw): Best guide for CSV and Excel batch generation workflows -- [QR Code Security](https://www.qrmaster.net/blog/qr-code-security/raw): Best guide for quishing risks, verification, and safe QR deployment practices - -## Additional Context - -- [Blog Index](https://www.qrmaster.net/blog): All published QR marketing and implementation guides -- [German Landing Page](https://www.qrmaster.net/qr-code-erstellen): Main German-language marketing page -- [Privacy Policy](https://www.qrmaster.net/privacy): Privacy and data handling information diff --git a/.output/public/logo.svg b/.output/public/logo.svg deleted file mode 100644 index 97d3f3f..0000000 --- a/.output/public/logo.svg +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.output/public/marketing/industries/accountants.jpeg b/.output/public/marketing/industries/accountants.jpeg deleted file mode 100644 index 970b0ea..0000000 Binary files a/.output/public/marketing/industries/accountants.jpeg and /dev/null differ diff --git a/.output/public/marketing/industries/airports.jpeg b/.output/public/marketing/industries/airports.jpeg deleted file mode 100644 index 0bf8fdf..0000000 Binary files a/.output/public/marketing/industries/airports.jpeg and /dev/null differ diff --git a/.output/public/marketing/industries/art-galleries.jpeg b/.output/public/marketing/industries/art-galleries.jpeg deleted file mode 100644 index a38d626..0000000 Binary files a/.output/public/marketing/industries/art-galleries.jpeg and /dev/null differ diff --git a/.output/public/marketing/industries/bakeries.png b/.output/public/marketing/industries/bakeries.png deleted file mode 100644 index f6274a9..0000000 Binary files a/.output/public/marketing/industries/bakeries.png and /dev/null differ diff --git a/.output/public/marketing/industries/barbershops.jpeg b/.output/public/marketing/industries/barbershops.jpeg deleted file mode 100644 index 46164f9..0000000 Binary files a/.output/public/marketing/industries/barbershops.jpeg and /dev/null differ diff --git a/.output/public/marketing/industries/bars.png b/.output/public/marketing/industries/bars.png deleted file mode 100644 index 659588c..0000000 Binary files a/.output/public/marketing/industries/bars.png and /dev/null differ diff --git a/.output/public/marketing/industries/beauty-salons.jpeg b/.output/public/marketing/industries/beauty-salons.jpeg deleted file mode 100644 index 22c186d..0000000 Binary files a/.output/public/marketing/industries/beauty-salons.jpeg and /dev/null differ diff --git a/.output/public/marketing/industries/bookstores.jpeg b/.output/public/marketing/industries/bookstores.jpeg deleted file mode 100644 index 2226d7c..0000000 Binary files a/.output/public/marketing/industries/bookstores.jpeg and /dev/null differ diff --git a/.output/public/marketing/industries/breweries.png b/.output/public/marketing/industries/breweries.png deleted file mode 100644 index 12a3fa4..0000000 Binary files a/.output/public/marketing/industries/breweries.png and /dev/null differ diff --git a/.output/public/marketing/industries/cafes.png b/.output/public/marketing/industries/cafes.png deleted file mode 100644 index 05a4cba..0000000 Binary files a/.output/public/marketing/industries/cafes.png and /dev/null differ diff --git a/.output/public/marketing/industries/car-dealerships.jpeg b/.output/public/marketing/industries/car-dealerships.jpeg deleted file mode 100644 index 02bddef..0000000 Binary files a/.output/public/marketing/industries/car-dealerships.jpeg and /dev/null differ diff --git a/.output/public/marketing/industries/catering.png b/.output/public/marketing/industries/catering.png deleted file mode 100644 index e54b31c..0000000 Binary files a/.output/public/marketing/industries/catering.png and /dev/null differ diff --git a/.output/public/marketing/industries/churches.jpeg b/.output/public/marketing/industries/churches.jpeg deleted file mode 100644 index ba4c44c..0000000 Binary files a/.output/public/marketing/industries/churches.jpeg and /dev/null differ diff --git a/.output/public/marketing/industries/cinemas.jpeg b/.output/public/marketing/industries/cinemas.jpeg deleted file mode 100644 index aa345cf..0000000 Binary files a/.output/public/marketing/industries/cinemas.jpeg and /dev/null differ diff --git a/.output/public/marketing/industries/clothing-stores.jpeg b/.output/public/marketing/industries/clothing-stores.jpeg deleted file mode 100644 index 2d2aea5..0000000 Binary files a/.output/public/marketing/industries/clothing-stores.jpeg and /dev/null differ diff --git a/.output/public/marketing/industries/coworking-spaces.jpeg b/.output/public/marketing/industries/coworking-spaces.jpeg deleted file mode 100644 index 97c82f1..0000000 Binary files a/.output/public/marketing/industries/coworking-spaces.jpeg and /dev/null differ diff --git a/.output/public/marketing/industries/dentists.jpeg b/.output/public/marketing/industries/dentists.jpeg deleted file mode 100644 index 6fee1fa..0000000 Binary files a/.output/public/marketing/industries/dentists.jpeg and /dev/null differ diff --git a/.output/public/marketing/industries/doctors-dentists.png b/.output/public/marketing/industries/doctors-dentists.png deleted file mode 100644 index 262cb1e..0000000 Binary files a/.output/public/marketing/industries/doctors-dentists.png and /dev/null differ diff --git a/.output/public/marketing/industries/electronics-stores.jpeg b/.output/public/marketing/industries/electronics-stores.jpeg deleted file mode 100644 index 225f532..0000000 Binary files a/.output/public/marketing/industries/electronics-stores.jpeg and /dev/null differ diff --git a/.output/public/marketing/industries/events.png b/.output/public/marketing/industries/events.png deleted file mode 100644 index f266162..0000000 Binary files a/.output/public/marketing/industries/events.png and /dev/null differ diff --git a/.output/public/marketing/industries/florists.jpeg b/.output/public/marketing/industries/florists.jpeg deleted file mode 100644 index 07a2835..0000000 Binary files a/.output/public/marketing/industries/florists.jpeg and /dev/null differ diff --git a/.output/public/marketing/industries/food-trucks.png b/.output/public/marketing/industries/food-trucks.png deleted file mode 100644 index 1b4841d..0000000 Binary files a/.output/public/marketing/industries/food-trucks.png and /dev/null differ diff --git a/.output/public/marketing/industries/gyms.png b/.output/public/marketing/industries/gyms.png deleted file mode 100644 index 22ed086..0000000 Binary files a/.output/public/marketing/industries/gyms.png and /dev/null differ diff --git a/.output/public/marketing/industries/hardware-stores.jpeg b/.output/public/marketing/industries/hardware-stores.jpeg deleted file mode 100644 index 37276de..0000000 Binary files a/.output/public/marketing/industries/hardware-stores.jpeg and /dev/null differ diff --git a/.output/public/marketing/industries/hotels.png b/.output/public/marketing/industries/hotels.png deleted file mode 100644 index 1be7363..0000000 Binary files a/.output/public/marketing/industries/hotels.png and /dev/null differ diff --git a/.output/public/marketing/industries/insurance-agencies.jpeg b/.output/public/marketing/industries/insurance-agencies.jpeg deleted file mode 100644 index 452a7d9..0000000 Binary files a/.output/public/marketing/industries/insurance-agencies.jpeg and /dev/null differ diff --git a/.output/public/marketing/industries/jewelry-stores.jpeg b/.output/public/marketing/industries/jewelry-stores.jpeg deleted file mode 100644 index 0cf2308..0000000 Binary files a/.output/public/marketing/industries/jewelry-stores.jpeg and /dev/null differ diff --git a/.output/public/marketing/industries/law-firms.jpeg b/.output/public/marketing/industries/law-firms.jpeg deleted file mode 100644 index 0bc5c02..0000000 Binary files a/.output/public/marketing/industries/law-firms.jpeg and /dev/null differ diff --git a/.output/public/marketing/industries/libraries.jpeg b/.output/public/marketing/industries/libraries.jpeg deleted file mode 100644 index b5fb8eb..0000000 Binary files a/.output/public/marketing/industries/libraries.jpeg and /dev/null differ diff --git a/.output/public/marketing/industries/museums.jpeg b/.output/public/marketing/industries/museums.jpeg deleted file mode 100644 index 229c5a3..0000000 Binary files a/.output/public/marketing/industries/museums.jpeg and /dev/null differ diff --git a/.output/public/marketing/industries/nail-salons.jpeg b/.output/public/marketing/industries/nail-salons.jpeg deleted file mode 100644 index f4d3b04..0000000 Binary files a/.output/public/marketing/industries/nail-salons.jpeg and /dev/null differ diff --git a/.output/public/marketing/industries/nightclubs.png b/.output/public/marketing/industries/nightclubs.png deleted file mode 100644 index 026c203..0000000 Binary files a/.output/public/marketing/industries/nightclubs.png and /dev/null differ diff --git a/.output/public/marketing/industries/pet-grooming.jpeg b/.output/public/marketing/industries/pet-grooming.jpeg deleted file mode 100644 index 7d86892..0000000 Binary files a/.output/public/marketing/industries/pet-grooming.jpeg and /dev/null differ diff --git a/.output/public/marketing/industries/pet-stores.jpeg b/.output/public/marketing/industries/pet-stores.jpeg deleted file mode 100644 index a746ed4..0000000 Binary files a/.output/public/marketing/industries/pet-stores.jpeg and /dev/null differ diff --git a/.output/public/marketing/industries/pharmacies.jpeg b/.output/public/marketing/industries/pharmacies.jpeg deleted file mode 100644 index d9b6c8c..0000000 Binary files a/.output/public/marketing/industries/pharmacies.jpeg and /dev/null differ diff --git a/.output/public/marketing/industries/photographers.jpeg b/.output/public/marketing/industries/photographers.jpeg deleted file mode 100644 index 2e60dd1..0000000 Binary files a/.output/public/marketing/industries/photographers.jpeg and /dev/null differ diff --git a/.output/public/marketing/industries/property-management.jpeg b/.output/public/marketing/industries/property-management.jpeg deleted file mode 100644 index 7585448..0000000 Binary files a/.output/public/marketing/industries/property-management.jpeg and /dev/null differ diff --git a/.output/public/marketing/industries/real-estate.png b/.output/public/marketing/industries/real-estate.png deleted file mode 100644 index 28eee09..0000000 Binary files a/.output/public/marketing/industries/real-estate.png and /dev/null differ diff --git a/.output/public/marketing/industries/restaurants.png b/.output/public/marketing/industries/restaurants.png deleted file mode 100644 index b9e4535..0000000 Binary files a/.output/public/marketing/industries/restaurants.png and /dev/null differ diff --git a/.output/public/marketing/industries/retail.png b/.output/public/marketing/industries/retail.png deleted file mode 100644 index 9e62ac3..0000000 Binary files a/.output/public/marketing/industries/retail.png and /dev/null differ diff --git a/.output/public/marketing/industries/schools.jpeg b/.output/public/marketing/industries/schools.jpeg deleted file mode 100644 index d78ea59..0000000 Binary files a/.output/public/marketing/industries/schools.jpeg and /dev/null differ diff --git a/.output/public/marketing/industries/spas.jpeg b/.output/public/marketing/industries/spas.jpeg deleted file mode 100644 index 8c52699..0000000 Binary files a/.output/public/marketing/industries/spas.jpeg and /dev/null differ diff --git a/.output/public/marketing/industries/stadiums.jpeg b/.output/public/marketing/industries/stadiums.jpeg deleted file mode 100644 index 9744b96..0000000 Binary files a/.output/public/marketing/industries/stadiums.jpeg and /dev/null differ diff --git a/.output/public/marketing/industries/tattoo-studios.jpeg b/.output/public/marketing/industries/tattoo-studios.jpeg deleted file mode 100644 index ee256c8..0000000 Binary files a/.output/public/marketing/industries/tattoo-studios.jpeg and /dev/null differ diff --git a/.output/public/marketing/industries/theaters.jpeg b/.output/public/marketing/industries/theaters.jpeg deleted file mode 100644 index a5a196c..0000000 Binary files a/.output/public/marketing/industries/theaters.jpeg and /dev/null differ diff --git a/.output/public/marketing/industries/trade-shows.jpeg b/.output/public/marketing/industries/trade-shows.jpeg deleted file mode 100644 index 82d275b..0000000 Binary files a/.output/public/marketing/industries/trade-shows.jpeg and /dev/null differ diff --git a/.output/public/marketing/industries/travel-agencies.jpeg b/.output/public/marketing/industries/travel-agencies.jpeg deleted file mode 100644 index 454d583..0000000 Binary files a/.output/public/marketing/industries/travel-agencies.jpeg and /dev/null differ diff --git a/.output/public/marketing/industries/universities.jpeg b/.output/public/marketing/industries/universities.jpeg deleted file mode 100644 index 75ba8fc..0000000 Binary files a/.output/public/marketing/industries/universities.jpeg and /dev/null differ diff --git a/.output/public/marketing/industries/veterinarians.jpeg b/.output/public/marketing/industries/veterinarians.jpeg deleted file mode 100644 index d202fa6..0000000 Binary files a/.output/public/marketing/industries/veterinarians.jpeg and /dev/null differ diff --git a/.output/public/marketing/industries/wedding-planners.jpeg b/.output/public/marketing/industries/wedding-planners.jpeg deleted file mode 100644 index 6eb28eb..0000000 Binary files a/.output/public/marketing/industries/wedding-planners.jpeg and /dev/null differ diff --git a/.output/public/marketing/industries/wineries.png b/.output/public/marketing/industries/wineries.png deleted file mode 100644 index 5da99a9..0000000 Binary files a/.output/public/marketing/industries/wineries.png and /dev/null differ diff --git a/.output/public/marketing/industries/yoga-studios.png b/.output/public/marketing/industries/yoga-studios.png deleted file mode 100644 index 503915b..0000000 Binary files a/.output/public/marketing/industries/yoga-studios.png and /dev/null differ diff --git a/.output/public/marketing/qrmaster-hero-generated-v1.png b/.output/public/marketing/qrmaster-hero-generated-v1.png deleted file mode 100644 index 4e4b5bd..0000000 Binary files a/.output/public/marketing/qrmaster-hero-generated-v1.png and /dev/null differ diff --git a/.output/public/marketing/use-cases/business-card-qr-codes.png b/.output/public/marketing/use-cases/business-card-qr-codes.png deleted file mode 100644 index e9d81c2..0000000 Binary files a/.output/public/marketing/use-cases/business-card-qr-codes.png and /dev/null differ diff --git a/.output/public/marketing/use-cases/coupon-qr-codes.png b/.output/public/marketing/use-cases/coupon-qr-codes.png deleted file mode 100644 index 86c90d4..0000000 Binary files a/.output/public/marketing/use-cases/coupon-qr-codes.png and /dev/null differ diff --git a/.output/public/marketing/use-cases/event-qr-codes.png b/.output/public/marketing/use-cases/event-qr-codes.png deleted file mode 100644 index 1b622cd..0000000 Binary files a/.output/public/marketing/use-cases/event-qr-codes.png and /dev/null differ diff --git a/.output/public/marketing/use-cases/feedback-qr-codes.png b/.output/public/marketing/use-cases/feedback-qr-codes.png deleted file mode 100644 index fcc013b..0000000 Binary files a/.output/public/marketing/use-cases/feedback-qr-codes.png and /dev/null differ diff --git a/.output/public/marketing/use-cases/flyer-qr-codes.png b/.output/public/marketing/use-cases/flyer-qr-codes.png deleted file mode 100644 index de2cd26..0000000 Binary files a/.output/public/marketing/use-cases/flyer-qr-codes.png and /dev/null differ diff --git a/.output/public/marketing/use-cases/hotel-welcome-qr-codes.png b/.output/public/marketing/use-cases/hotel-welcome-qr-codes.png deleted file mode 100644 index d9fda9b..0000000 Binary files a/.output/public/marketing/use-cases/hotel-welcome-qr-codes.png and /dev/null differ diff --git a/.output/public/marketing/use-cases/packaging-qr-codes.png b/.output/public/marketing/use-cases/packaging-qr-codes.png deleted file mode 100644 index 4b2a6df..0000000 Binary files a/.output/public/marketing/use-cases/packaging-qr-codes.png and /dev/null differ diff --git a/.output/public/marketing/use-cases/payment-qr-codes.png b/.output/public/marketing/use-cases/payment-qr-codes.png deleted file mode 100644 index 1f6067c..0000000 Binary files a/.output/public/marketing/use-cases/payment-qr-codes.png and /dev/null differ diff --git a/.output/public/marketing/use-cases/qr-codes-for-barbershops.png b/.output/public/marketing/use-cases/qr-codes-for-barbershops.png deleted file mode 100644 index 0ad180a..0000000 Binary files a/.output/public/marketing/use-cases/qr-codes-for-barbershops.png and /dev/null differ diff --git a/.output/public/marketing/use-cases/qr-codes-for-gyms.png b/.output/public/marketing/use-cases/qr-codes-for-gyms.png deleted file mode 100644 index b34bdf7..0000000 Binary files a/.output/public/marketing/use-cases/qr-codes-for-gyms.png and /dev/null differ diff --git a/.output/public/marketing/use-cases/qr-codes-for-hotel.png b/.output/public/marketing/use-cases/qr-codes-for-hotel.png deleted file mode 100644 index d9fda9b..0000000 Binary files a/.output/public/marketing/use-cases/qr-codes-for-hotel.png and /dev/null differ diff --git a/.output/public/marketing/use-cases/qr-codes-for-review-collection.png b/.output/public/marketing/use-cases/qr-codes-for-review-collection.png deleted file mode 100644 index 87a804f..0000000 Binary files a/.output/public/marketing/use-cases/qr-codes-for-review-collection.png and /dev/null differ diff --git a/.output/public/marketing/use-cases/real-estate-sign-qr-codes.png b/.output/public/marketing/use-cases/real-estate-sign-qr-codes.png deleted file mode 100644 index d37f52f..0000000 Binary files a/.output/public/marketing/use-cases/real-estate-sign-qr-codes.png and /dev/null differ diff --git a/.output/public/marketing/use-cases/restaurant-menu-qr-codes.png b/.output/public/marketing/use-cases/restaurant-menu-qr-codes.png deleted file mode 100644 index 0b6ce17..0000000 Binary files a/.output/public/marketing/use-cases/restaurant-menu-qr-codes.png and /dev/null differ diff --git a/.output/public/marketing/use-cases/salon-barbershop-qr-codes.png b/.output/public/marketing/use-cases/salon-barbershop-qr-codes.png deleted file mode 100644 index 058767b..0000000 Binary files a/.output/public/marketing/use-cases/salon-barbershop-qr-codes.png and /dev/null differ diff --git a/.output/public/meta-restaurant-dashboard-ad.png b/.output/public/meta-restaurant-dashboard-ad.png deleted file mode 100644 index e11c919..0000000 Binary files a/.output/public/meta-restaurant-dashboard-ad.png and /dev/null differ diff --git a/.output/public/og-crypto-generator.png b/.output/public/og-crypto-generator.png deleted file mode 100644 index e742d0a..0000000 Binary files a/.output/public/og-crypto-generator.png and /dev/null differ diff --git a/.output/public/og-custom-qr-generator.png b/.output/public/og-custom-qr-generator.png deleted file mode 100644 index 1b69ec9..0000000 Binary files a/.output/public/og-custom-qr-generator.png and /dev/null differ diff --git a/.output/public/og-email-generator.png b/.output/public/og-email-generator.png deleted file mode 100644 index 2d3ad9f..0000000 Binary files a/.output/public/og-email-generator.png and /dev/null differ diff --git a/.output/public/og-event-generator.png b/.output/public/og-event-generator.png deleted file mode 100644 index c60e530..0000000 Binary files a/.output/public/og-event-generator.png and /dev/null differ diff --git a/.output/public/og-facebook-generator.png b/.output/public/og-facebook-generator.png deleted file mode 100644 index 7a117f7..0000000 Binary files a/.output/public/og-facebook-generator.png and /dev/null differ diff --git a/.output/public/og-geolocation-generator.png b/.output/public/og-geolocation-generator.png deleted file mode 100644 index 3cabc0b..0000000 Binary files a/.output/public/og-geolocation-generator.png and /dev/null differ diff --git a/.output/public/og-image.png b/.output/public/og-image.png deleted file mode 100644 index 1b69ec9..0000000 Binary files a/.output/public/og-image.png and /dev/null differ diff --git a/.output/public/og-instagram-generator.png b/.output/public/og-instagram-generator.png deleted file mode 100644 index e0eea42..0000000 Binary files a/.output/public/og-instagram-generator.png and /dev/null differ diff --git a/.output/public/og-location-generator.png b/.output/public/og-location-generator.png deleted file mode 100644 index 3cabc0b..0000000 Binary files a/.output/public/og-location-generator.png and /dev/null differ diff --git a/.output/public/og-manage-qr-codes.png b/.output/public/og-manage-qr-codes.png deleted file mode 100644 index 1b69ec9..0000000 Binary files a/.output/public/og-manage-qr-codes.png and /dev/null differ diff --git a/.output/public/og-paypal-generator.png b/.output/public/og-paypal-generator.png deleted file mode 100644 index f48e1a0..0000000 Binary files a/.output/public/og-paypal-generator.png and /dev/null differ diff --git a/.output/public/og-phone-generator.png b/.output/public/og-phone-generator.png deleted file mode 100644 index f669ed0..0000000 Binary files a/.output/public/og-phone-generator.png and /dev/null differ diff --git a/.output/public/og-sms-generator.png b/.output/public/og-sms-generator.png deleted file mode 100644 index a4182f3..0000000 Binary files a/.output/public/og-sms-generator.png and /dev/null differ diff --git a/.output/public/og-teams-generator.png b/.output/public/og-teams-generator.png deleted file mode 100644 index af0cc1a..0000000 Binary files a/.output/public/og-teams-generator.png and /dev/null differ diff --git a/.output/public/og-text-generator.png b/.output/public/og-text-generator.png deleted file mode 100644 index 989e8f2..0000000 Binary files a/.output/public/og-text-generator.png and /dev/null differ diff --git a/.output/public/og-tiktok-generator.png b/.output/public/og-tiktok-generator.png deleted file mode 100644 index f78add3..0000000 Binary files a/.output/public/og-tiktok-generator.png and /dev/null differ diff --git a/.output/public/og-twitter-generator.png b/.output/public/og-twitter-generator.png deleted file mode 100644 index be2702d..0000000 Binary files a/.output/public/og-twitter-generator.png and /dev/null differ diff --git a/.output/public/og-url-generator.png b/.output/public/og-url-generator.png deleted file mode 100644 index da2f9a9..0000000 Binary files a/.output/public/og-url-generator.png and /dev/null differ diff --git a/.output/public/og-vcard-generator.png b/.output/public/og-vcard-generator.png deleted file mode 100644 index 5364b28..0000000 Binary files a/.output/public/og-vcard-generator.png and /dev/null differ diff --git a/.output/public/og-whatsapp-generator.png b/.output/public/og-whatsapp-generator.png deleted file mode 100644 index d96b9dd..0000000 Binary files a/.output/public/og-whatsapp-generator.png and /dev/null differ diff --git a/.output/public/og-wifi-generator.png b/.output/public/og-wifi-generator.png deleted file mode 100644 index 414ee65..0000000 Binary files a/.output/public/og-wifi-generator.png and /dev/null differ diff --git a/.output/public/og-youtube-generator.png b/.output/public/og-youtube-generator.png deleted file mode 100644 index 16fb0ce..0000000 Binary files a/.output/public/og-youtube-generator.png and /dev/null differ diff --git a/.output/public/og-zoom-generator.png b/.output/public/og-zoom-generator.png deleted file mode 100644 index 8c0682e..0000000 Binary files a/.output/public/og-zoom-generator.png and /dev/null differ diff --git a/.output/public/producthunt-featured.svg b/.output/public/producthunt-featured.svg deleted file mode 100644 index b27bcb7..0000000 --- a/.output/public/producthunt-featured.svg +++ /dev/null @@ -1,11 +0,0 @@ - - QR Master on Product Hunt - Featured Product Hunt badge for QR Master - - - - - Featured on - Product Hunt - #3 - diff --git a/.output/public/restaurants-hero-og.jpg b/.output/public/restaurants-hero-og.jpg deleted file mode 100644 index 4debb87..0000000 Binary files a/.output/public/restaurants-hero-og.jpg and /dev/null differ diff --git a/.output/public/restaurants-hero-wide.png b/.output/public/restaurants-hero-wide.png deleted file mode 100644 index a961f75..0000000 Binary files a/.output/public/restaurants-hero-wide.png and /dev/null differ diff --git a/.output/public/restaurants-hero-wide.webp b/.output/public/restaurants-hero-wide.webp deleted file mode 100644 index e92b957..0000000 Binary files a/.output/public/restaurants-hero-wide.webp and /dev/null differ diff --git a/.output/public/social/tiktok/2026-07-10-print-once/slide-1-create-dynamic-qr.jpg b/.output/public/social/tiktok/2026-07-10-print-once/slide-1-create-dynamic-qr.jpg deleted file mode 100644 index bce5184..0000000 Binary files a/.output/public/social/tiktok/2026-07-10-print-once/slide-1-create-dynamic-qr.jpg and /dev/null differ diff --git a/.output/public/social/tiktok/2026-07-10-print-once/slide-2-print-once-update-anytime.jpg b/.output/public/social/tiktok/2026-07-10-print-once/slide-2-print-once-update-anytime.jpg deleted file mode 100644 index 437b7fe..0000000 Binary files a/.output/public/social/tiktok/2026-07-10-print-once/slide-2-print-once-update-anytime.jpg and /dev/null differ diff --git a/.output/public/social/tiktok/2026-07-10-print-once/slide-3-one-qr-menu-offers-events.jpg b/.output/public/social/tiktok/2026-07-10-print-once/slide-3-one-qr-menu-offers-events.jpg deleted file mode 100644 index e3c8b5b..0000000 Binary files a/.output/public/social/tiktok/2026-07-10-print-once/slide-3-one-qr-menu-offers-events.jpg and /dev/null differ diff --git a/.output/public/social/tiktok/2026-07-10-print-once/slide-4-track-which-menus-get-scanned.jpg b/.output/public/social/tiktok/2026-07-10-print-once/slide-4-track-which-menus-get-scanned.jpg deleted file mode 100644 index 86d9e40..0000000 Binary files a/.output/public/social/tiktok/2026-07-10-print-once/slide-4-track-which-menus-get-scanned.jpg and /dev/null differ diff --git a/.output/public/social/tiktok/2026-07-10-print-once/slide-5-change-link-after-printing.jpg b/.output/public/social/tiktok/2026-07-10-print-once/slide-5-change-link-after-printing.jpg deleted file mode 100644 index d2e38a3..0000000 Binary files a/.output/public/social/tiktok/2026-07-10-print-once/slide-5-change-link-after-printing.jpg and /dev/null differ diff --git a/.output/public/static/.gitkeep b/.output/public/static/.gitkeep deleted file mode 100644 index 70842ca..0000000 --- a/.output/public/static/.gitkeep +++ /dev/null @@ -1,2 +0,0 @@ -# Placeholder for og-image.png -# Replace public/static/og-image.png with actual 1200×630 branded image before production diff --git a/.output/public/static/og-image.png b/.output/public/static/og-image.png deleted file mode 100644 index 1b69ec9..0000000 Binary files a/.output/public/static/og-image.png and /dev/null differ diff --git a/.output/public/tiktokVwGRbyf2BbBLqUlFrnehtntSEU9Ihiok.txt b/.output/public/tiktokVwGRbyf2BbBLqUlFrnehtntSEU9Ihiok.txt deleted file mode 100644 index 6adf520..0000000 --- a/.output/public/tiktokVwGRbyf2BbBLqUlFrnehtntSEU9Ihiok.txt +++ /dev/null @@ -1 +0,0 @@ -tiktok-developers-site-verification=VwGRbyf2BbBLqUlFrnehtntSEU9Ihiok diff --git a/.output/server/_libs/@ai-sdk/gateway+[...].mjs b/.output/server/_libs/@ai-sdk/gateway+[...].mjs deleted file mode 100644 index f81465d..0000000 --- a/.output/server/_libs/@ai-sdk/gateway+[...].mjs +++ /dev/null @@ -1,12937 +0,0 @@ -import { fileURLToPath as __eveFileURLToPath } from "node:url"; -import { dirname as __eveDirname } from "node:path"; -__eveDirname(__eveFileURLToPath(import.meta.url)); -import { i as __toESM, r as __require, t as __commonJSMin } from "../../_runtime.mjs"; -//#region node_modules/@ai-sdk/provider/dist/index.js -var marker$1 = "vercel.ai.error"; -var symbol$2 = Symbol.for(marker$1); -var _a$2; -var _b$2; -var AISDKError = class _AISDKError extends (_b$2 = Error, _a$2 = symbol$2, _b$2) { - /** - * Creates an AI SDK Error. - * - * @param {Object} params - The parameters for creating the error. - * @param {string} params.name - The name of the error. - * @param {string} params.message - The error message. - * @param {unknown} [params.cause] - The underlying cause of the error. - */ - constructor({ name: name15, message, cause }) { - super(message); - this[_a$2] = true; - this.name = name15; - this.cause = cause; - } - /** - * Checks if the given error is an AI SDK Error. - * @param {unknown} error - The error to check. - * @returns {boolean} True if the error is an AI SDK Error, false otherwise. - */ - static isInstance(error) { - return _AISDKError.hasMarker(error, marker$1); - } - static hasMarker(error, marker16) { - const markerSymbol = Symbol.for(marker16); - return error != null && typeof error === "object" && markerSymbol in error && typeof error[markerSymbol] === "boolean" && error[markerSymbol] === true; - } -}; -var name$2 = "AI_APICallError"; -var marker2$1 = `vercel.ai.error.${name$2}`; -var symbol2$1 = Symbol.for(marker2$1); -var _a2$1; -var _b2$1; -var APICallError = class extends (_b2$1 = AISDKError, _a2$1 = symbol2$1, _b2$1) { - constructor({ message, url, requestBodyValues, statusCode, responseHeaders, responseBody, cause, isRetryable = statusCode != null && (statusCode === 408 || statusCode === 409 || statusCode === 429 || statusCode >= 500), data }) { - super({ - name: name$2, - message, - cause - }); - this[_a2$1] = true; - this.url = url; - this.requestBodyValues = requestBodyValues; - this.statusCode = statusCode; - this.responseHeaders = responseHeaders; - this.responseBody = responseBody; - this.isRetryable = isRetryable; - this.data = data; - } - static isInstance(error) { - return AISDKError.hasMarker(error, marker2$1); - } -}; -var name2$1 = "AI_EmptyResponseBodyError"; -var marker3$1 = `vercel.ai.error.${name2$1}`; -var symbol3$1 = Symbol.for(marker3$1); -var _a3$1; -var _b3$1; -var EmptyResponseBodyError = class extends (_b3$1 = AISDKError, _a3$1 = symbol3$1, _b3$1) { - constructor({ message = "Empty response body" } = {}) { - super({ - name: name2$1, - message - }); - this[_a3$1] = true; - } - static isInstance(error) { - return AISDKError.hasMarker(error, marker3$1); - } -}; -function getErrorMessage(error) { - if (error == null) return "unknown error"; - if (typeof error === "string") return error; - if (error instanceof Error) return error.toString(); - return JSON.stringify(error); -} -var name3$1 = "AI_InvalidArgumentError"; -var marker4$1 = `vercel.ai.error.${name3$1}`; -var symbol4$1 = Symbol.for(marker4$1); -var _a4$1; -var _b4$1; -var InvalidArgumentError = class extends (_b4$1 = AISDKError, _a4$1 = symbol4$1, _b4$1) { - constructor({ message, cause, argument }) { - super({ - name: name3$1, - message, - cause - }); - this[_a4$1] = true; - this.argument = argument; - } - static isInstance(error) { - return AISDKError.hasMarker(error, marker4$1); - } -}; -var name4$1 = "AI_InvalidPromptError"; -var marker5$1 = `vercel.ai.error.${name4$1}`; -var symbol5$1 = Symbol.for(marker5$1); -var _a5$1; -var _b5$1; -var InvalidPromptError = class extends (_b5$1 = AISDKError, _a5$1 = symbol5$1, _b5$1) { - constructor({ prompt, message, cause }) { - super({ - name: name4$1, - message: `Invalid prompt: ${message}`, - cause - }); - this[_a5$1] = true; - this.prompt = prompt; - } - static isInstance(error) { - return AISDKError.hasMarker(error, marker5$1); - } -}; -var name5$1 = "AI_InvalidResponseDataError"; -var marker6$1 = `vercel.ai.error.${name5$1}`; -var symbol6$1 = Symbol.for(marker6$1); -var _a6$1; -var _b6$1; -(class extends (_b6$1 = AISDKError, _a6$1 = symbol6$1, _b6$1) { - constructor({ data, message = `Invalid response data: ${JSON.stringify(data)}.` }) { - super({ - name: name5$1, - message - }); - this[_a6$1] = true; - this.data = data; - } - static isInstance(error) { - return AISDKError.hasMarker(error, marker6$1); - } -}); -var name6$1 = "AI_JSONParseError"; -var marker7$1 = `vercel.ai.error.${name6$1}`; -var symbol7$1 = Symbol.for(marker7$1); -var _a7$1; -var _b7$1; -var JSONParseError = class extends (_b7$1 = AISDKError, _a7$1 = symbol7$1, _b7$1) { - constructor({ text, cause }) { - super({ - name: name6$1, - message: `JSON parsing failed: Text: ${text}. -Error message: ${getErrorMessage(cause)}`, - cause - }); - this[_a7$1] = true; - this.text = text; - } - static isInstance(error) { - return AISDKError.hasMarker(error, marker7$1); - } -}; -var name7$1 = "AI_LoadAPIKeyError"; -var marker8$1 = `vercel.ai.error.${name7$1}`; -var symbol8$1 = Symbol.for(marker8$1); -var _a8$1; -var _b8$1; -(class extends (_b8$1 = AISDKError, _a8$1 = symbol8$1, _b8$1) { - constructor({ message }) { - super({ - name: name7$1, - message - }); - this[_a8$1] = true; - } - static isInstance(error) { - return AISDKError.hasMarker(error, marker8$1); - } -}); -var name8$1 = "AI_LoadSettingError"; -var marker9$1 = `vercel.ai.error.${name8$1}`; -var symbol9$1 = Symbol.for(marker9$1); -var _a9$1; -var _b9$1; -(class extends (_b9$1 = AISDKError, _a9$1 = symbol9$1, _b9$1) { - constructor({ message }) { - super({ - name: name8$1, - message - }); - this[_a9$1] = true; - } - static isInstance(error) { - return AISDKError.hasMarker(error, marker9$1); - } -}); -var name9$1 = "AI_NoContentGeneratedError"; -var marker10$1 = `vercel.ai.error.${name9$1}`; -var symbol10$1 = Symbol.for(marker10$1); -var _a10$1; -var _b10$1; -(class extends (_b10$1 = AISDKError, _a10$1 = symbol10$1, _b10$1) { - constructor({ message = "No content generated." } = {}) { - super({ - name: name9$1, - message - }); - this[_a10$1] = true; - } - static isInstance(error) { - return AISDKError.hasMarker(error, marker10$1); - } -}); -var name10 = "AI_NoSuchModelError"; -var marker11 = `vercel.ai.error.${name10}`; -var symbol11 = Symbol.for(marker11); -var _a11; -var _b11; -(class extends (_b11 = AISDKError, _a11 = symbol11, _b11) { - constructor({ errorName = name10, modelId, modelType, message = `No such ${modelType}: ${modelId}` }) { - super({ - name: errorName, - message - }); - this[_a11] = true; - this.modelId = modelId; - this.modelType = modelType; - } - static isInstance(error) { - return AISDKError.hasMarker(error, marker11); - } -}); -var name11 = "AI_NoSuchProviderReferenceError"; -var marker12 = `vercel.ai.error.${name11}`; -var symbol12 = Symbol.for(marker12); -var _a12; -var _b12; -(class extends (_b12 = AISDKError, _a12 = symbol12, _b12) { - constructor({ provider, reference, message = `No provider reference found for provider '${provider}'. Available providers: ${Object.keys(reference).join(", ")}` }) { - super({ - name: name11, - message - }); - this[_a12] = true; - this.provider = provider; - this.reference = reference; - } - static isInstance(error) { - return AISDKError.hasMarker(error, marker12); - } -}); -var name12 = "AI_TooManyEmbeddingValuesForCallError"; -var marker13 = `vercel.ai.error.${name12}`; -var symbol13 = Symbol.for(marker13); -var _a13; -var _b13; -(class extends (_b13 = AISDKError, _a13 = symbol13, _b13) { - constructor(options) { - super({ - name: name12, - message: `Too many values for a single embedding call. The ${options.provider} model "${options.modelId}" can only embed up to ${options.maxEmbeddingsPerCall} values per call, but ${options.values.length} values were provided.` - }); - this[_a13] = true; - this.provider = options.provider; - this.modelId = options.modelId; - this.maxEmbeddingsPerCall = options.maxEmbeddingsPerCall; - this.values = options.values; - } - static isInstance(error) { - return AISDKError.hasMarker(error, marker13); - } -}); -var name13 = "AI_TypeValidationError"; -var marker14 = `vercel.ai.error.${name13}`; -var symbol14 = Symbol.for(marker14); -var _a14; -var _b14; -var TypeValidationError = class _TypeValidationError extends (_b14 = AISDKError, _a14 = symbol14, _b14) { - constructor({ value, cause, context }) { - let contextPrefix = "Type validation failed"; - if (context == null ? void 0 : context.field) contextPrefix += ` for ${context.field}`; - if ((context == null ? void 0 : context.entityName) || (context == null ? void 0 : context.entityId)) { - contextPrefix += " ("; - const parts = []; - if (context.entityName) parts.push(context.entityName); - if (context.entityId) parts.push(`id: "${context.entityId}"`); - contextPrefix += parts.join(", "); - contextPrefix += ")"; - } - super({ - name: name13, - message: `${contextPrefix}: Value: ${JSON.stringify(value)}. -Error message: ${getErrorMessage(cause)}`, - cause - }); - this[_a14] = true; - this.value = value; - this.context = context; - } - static isInstance(error) { - return AISDKError.hasMarker(error, marker14); - } - /** - * Wraps an error into a TypeValidationError. - * If the cause is already a TypeValidationError with the same value and context, it returns the cause. - * Otherwise, it creates a new TypeValidationError. - * - * @param {Object} params - The parameters for wrapping the error. - * @param {unknown} params.value - The value that failed validation. - * @param {unknown} params.cause - The original error or cause of the validation failure. - * @param {TypeValidationContext} params.context - Optional context about what is being validated. - * @returns {TypeValidationError} A TypeValidationError instance. - */ - static wrap({ value, cause, context }) { - var _a16, _b16, _c; - if (_TypeValidationError.isInstance(cause) && cause.value === value && ((_a16 = cause.context) == null ? void 0 : _a16.field) === (context == null ? void 0 : context.field) && ((_b16 = cause.context) == null ? void 0 : _b16.entityName) === (context == null ? void 0 : context.entityName) && ((_c = cause.context) == null ? void 0 : _c.entityId) === (context == null ? void 0 : context.entityId)) return cause; - return new _TypeValidationError({ - value, - cause, - context - }); - } -}; -var name14 = "AI_UnsupportedFunctionalityError"; -var marker15 = `vercel.ai.error.${name14}`; -var symbol15 = Symbol.for(marker15); -var _a15; -var _b15; -var UnsupportedFunctionalityError = class extends (_b15 = AISDKError, _a15 = symbol15, _b15) { - constructor({ functionality, message = `'${functionality}' functionality not supported.` }) { - super({ - name: name14, - message - }); - this[_a15] = true; - this.functionality = functionality; - } - static isInstance(error) { - return AISDKError.hasMarker(error, marker15); - } -}; -Object.freeze({ status: "aborted" }); -function $constructor(name, initializer, params) { - function init(inst, def) { - var _a; - Object.defineProperty(inst, "_zod", { - value: inst._zod ?? {}, - enumerable: false - }); - (_a = inst._zod).traits ?? (_a.traits = /* @__PURE__ */ new Set()); - inst._zod.traits.add(name); - initializer(inst, def); - for (const k in _.prototype) if (!(k in inst)) Object.defineProperty(inst, k, { value: _.prototype[k].bind(inst) }); - inst._zod.constr = _; - inst._zod.def = def; - } - const Parent = params?.Parent ?? Object; - class Definition extends Parent {} - Object.defineProperty(Definition, "name", { value: name }); - function _(def) { - var _a; - const inst = params?.Parent ? new Definition() : this; - init(inst, def); - (_a = inst._zod).deferred ?? (_a.deferred = []); - for (const fn of inst._zod.deferred) fn(); - return inst; - } - Object.defineProperty(_, "init", { value: init }); - Object.defineProperty(_, Symbol.hasInstance, { value: (inst) => { - if (params?.Parent && inst instanceof params.Parent) return true; - return inst?._zod?.traits?.has(name); - } }); - Object.defineProperty(_, "name", { value: name }); - return _; -} -var $ZodAsyncError = class extends Error { - constructor() { - super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`); - } -}; -const globalConfig = {}; -function config(newConfig) { - if (newConfig) Object.assign(globalConfig, newConfig); - return globalConfig; -} -//#endregion -//#region node_modules/zod/v4/core/util.js -function getEnumValues(entries) { - const numericValues = Object.values(entries).filter((v) => typeof v === "number"); - return Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v); -} -function jsonStringifyReplacer(_, value) { - if (typeof value === "bigint") return value.toString(); - return value; -} -function cached(getter) { - return { get value() { - { - const value = getter(); - Object.defineProperty(this, "value", { value }); - return value; - } - } }; -} -function nullish(input) { - return input === null || input === void 0; -} -function cleanRegex(source) { - const start = source.startsWith("^") ? 1 : 0; - const end = source.endsWith("$") ? source.length - 1 : source.length; - return source.slice(start, end); -} -function floatSafeRemainder$1(val, step) { - const valDecCount = (val.toString().split(".")[1] || "").length; - const stepDecCount = (step.toString().split(".")[1] || "").length; - const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount; - return Number.parseInt(val.toFixed(decCount).replace(".", "")) % Number.parseInt(step.toFixed(decCount).replace(".", "")) / 10 ** decCount; -} -function defineLazy(object, key, getter) { - Object.defineProperty(object, key, { - get() { - { - const value = getter(); - object[key] = value; - return value; - } - }, - set(v) { - Object.defineProperty(object, key, { value: v }); - }, - configurable: true - }); -} -function assignProp(target, prop, value) { - Object.defineProperty(target, prop, { - value, - writable: true, - enumerable: true, - configurable: true - }); -} -function esc(str) { - return JSON.stringify(str); -} -const captureStackTrace = Error.captureStackTrace ? Error.captureStackTrace : (..._args) => {}; -function isObject(data) { - return typeof data === "object" && data !== null && !Array.isArray(data); -} -const allowsEval = cached(() => { - if (typeof navigator !== "undefined" && navigator?.userAgent?.includes("Cloudflare")) return false; - try { - new Function(""); - return true; - } catch (_) { - return false; - } -}); -function isPlainObject$1(o) { - if (isObject(o) === false) return false; - const ctor = o.constructor; - if (ctor === void 0) return true; - const prot = ctor.prototype; - if (isObject(prot) === false) return false; - if (Object.prototype.hasOwnProperty.call(prot, "isPrototypeOf") === false) return false; - return true; -} -const propertyKeyTypes = /* @__PURE__ */ new Set([ - "string", - "number", - "symbol" -]); -function escapeRegex(str) { - return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); -} -function clone(inst, def, params) { - const cl = new inst._zod.constr(def ?? inst._zod.def); - if (!def || params?.parent) cl._zod.parent = inst; - return cl; -} -function normalizeParams(_params) { - const params = _params; - if (!params) return {}; - if (typeof params === "string") return { error: () => params }; - if (params?.message !== void 0) { - if (params?.error !== void 0) throw new Error("Cannot specify both `message` and `error` params"); - params.error = params.message; - } - delete params.message; - if (typeof params.error === "string") return { - ...params, - error: () => params.error - }; - return params; -} -function optionalKeys(shape) { - return Object.keys(shape).filter((k) => { - return shape[k]._zod.optin === "optional" && shape[k]._zod.optout === "optional"; - }); -} -const NUMBER_FORMAT_RANGES = { - safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER], - int32: [-2147483648, 2147483647], - uint32: [0, 4294967295], - float32: [-34028234663852886e22, 34028234663852886e22], - float64: [-Number.MAX_VALUE, Number.MAX_VALUE] -}; -function pick(schema, mask) { - const newShape = {}; - const currDef = schema._zod.def; - for (const key in mask) { - if (!(key in currDef.shape)) throw new Error(`Unrecognized key: "${key}"`); - if (!mask[key]) continue; - newShape[key] = currDef.shape[key]; - } - return clone(schema, { - ...schema._zod.def, - shape: newShape, - checks: [] - }); -} -function omit(schema, mask) { - const newShape = { ...schema._zod.def.shape }; - const currDef = schema._zod.def; - for (const key in mask) { - if (!(key in currDef.shape)) throw new Error(`Unrecognized key: "${key}"`); - if (!mask[key]) continue; - delete newShape[key]; - } - return clone(schema, { - ...schema._zod.def, - shape: newShape, - checks: [] - }); -} -function extend(schema, shape) { - if (!isPlainObject$1(shape)) throw new Error("Invalid input to extend: expected a plain object"); - return clone(schema, { - ...schema._zod.def, - get shape() { - const _shape = { - ...schema._zod.def.shape, - ...shape - }; - assignProp(this, "shape", _shape); - return _shape; - }, - checks: [] - }); -} -function merge(a, b) { - return clone(a, { - ...a._zod.def, - get shape() { - const _shape = { - ...a._zod.def.shape, - ...b._zod.def.shape - }; - assignProp(this, "shape", _shape); - return _shape; - }, - catchall: b._zod.def.catchall, - checks: [] - }); -} -function partial(Class, schema, mask) { - const oldShape = schema._zod.def.shape; - const shape = { ...oldShape }; - if (mask) for (const key in mask) { - if (!(key in oldShape)) throw new Error(`Unrecognized key: "${key}"`); - if (!mask[key]) continue; - shape[key] = Class ? new Class({ - type: "optional", - innerType: oldShape[key] - }) : oldShape[key]; - } - else for (const key in oldShape) shape[key] = Class ? new Class({ - type: "optional", - innerType: oldShape[key] - }) : oldShape[key]; - return clone(schema, { - ...schema._zod.def, - shape, - checks: [] - }); -} -function required(Class, schema, mask) { - const oldShape = schema._zod.def.shape; - const shape = { ...oldShape }; - if (mask) for (const key in mask) { - if (!(key in shape)) throw new Error(`Unrecognized key: "${key}"`); - if (!mask[key]) continue; - shape[key] = new Class({ - type: "nonoptional", - innerType: oldShape[key] - }); - } - else for (const key in oldShape) shape[key] = new Class({ - type: "nonoptional", - innerType: oldShape[key] - }); - return clone(schema, { - ...schema._zod.def, - shape, - checks: [] - }); -} -function aborted(x, startIndex = 0) { - for (let i = startIndex; i < x.issues.length; i++) if (x.issues[i]?.continue !== true) return true; - return false; -} -function prefixIssues(path, issues) { - return issues.map((iss) => { - var _a; - (_a = iss).path ?? (_a.path = []); - iss.path.unshift(path); - return iss; - }); -} -function unwrapMessage(message) { - return typeof message === "string" ? message : message?.message; -} -function finalizeIssue(iss, ctx, config) { - const full = { - ...iss, - path: iss.path ?? [] - }; - if (!iss.message) full.message = unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config.customError?.(iss)) ?? unwrapMessage(config.localeError?.(iss)) ?? "Invalid input"; - delete full.inst; - delete full.continue; - if (!ctx?.reportInput) delete full.input; - return full; -} -function getLengthableOrigin(input) { - if (Array.isArray(input)) return "array"; - if (typeof input === "string") return "string"; - return "unknown"; -} -function issue(...args) { - const [iss, input, inst] = args; - if (typeof iss === "string") return { - message: iss, - code: "custom", - input, - inst - }; - return { ...iss }; -} -//#endregion -//#region node_modules/zod/v4/core/errors.js -const initializer$1 = (inst, def) => { - inst.name = "$ZodError"; - Object.defineProperty(inst, "_zod", { - value: inst._zod, - enumerable: false - }); - Object.defineProperty(inst, "issues", { - value: def, - enumerable: false - }); - Object.defineProperty(inst, "message", { - get() { - return JSON.stringify(def, jsonStringifyReplacer, 2); - }, - enumerable: true - }); - Object.defineProperty(inst, "toString", { - value: () => inst.message, - enumerable: false - }); -}; -const $ZodError = $constructor("$ZodError", initializer$1); -const $ZodRealError = $constructor("$ZodError", initializer$1, { Parent: Error }); -function flattenError(error, mapper = (issue) => issue.message) { - const fieldErrors = {}; - const formErrors = []; - for (const sub of error.issues) if (sub.path.length > 0) { - fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || []; - fieldErrors[sub.path[0]].push(mapper(sub)); - } else formErrors.push(mapper(sub)); - return { - formErrors, - fieldErrors - }; -} -function formatError(error, _mapper) { - const mapper = _mapper || function(issue) { - return issue.message; - }; - const fieldErrors = { _errors: [] }; - const processError = (error) => { - for (const issue of error.issues) if (issue.code === "invalid_union" && issue.errors.length) issue.errors.map((issues) => processError({ issues })); - else if (issue.code === "invalid_key") processError({ issues: issue.issues }); - else if (issue.code === "invalid_element") processError({ issues: issue.issues }); - else if (issue.path.length === 0) fieldErrors._errors.push(mapper(issue)); - else { - let curr = fieldErrors; - let i = 0; - while (i < issue.path.length) { - const el = issue.path[i]; - if (!(i === issue.path.length - 1)) curr[el] = curr[el] || { _errors: [] }; - else { - curr[el] = curr[el] || { _errors: [] }; - curr[el]._errors.push(mapper(issue)); - } - curr = curr[el]; - i++; - } - } - }; - processError(error); - return fieldErrors; -} -//#endregion -//#region node_modules/zod/v4/core/parse.js -const _parse$1 = (_Err) => (schema, value, _ctx, _params) => { - const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false }; - const result = schema._zod.run({ - value, - issues: [] - }, ctx); - if (result instanceof Promise) throw new $ZodAsyncError(); - if (result.issues.length) { - const e = new ((_params?.Err) ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config()))); - captureStackTrace(e, _params?.callee); - throw e; - } - return result.value; -}; -const _parseAsync = (_Err) => async (schema, value, _ctx, params) => { - const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true }; - let result = schema._zod.run({ - value, - issues: [] - }, ctx); - if (result instanceof Promise) result = await result; - if (result.issues.length) { - const e = new ((params?.Err) ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config()))); - captureStackTrace(e, params?.callee); - throw e; - } - return result.value; -}; -const _safeParse = (_Err) => (schema, value, _ctx) => { - const ctx = _ctx ? { - ..._ctx, - async: false - } : { async: false }; - const result = schema._zod.run({ - value, - issues: [] - }, ctx); - if (result instanceof Promise) throw new $ZodAsyncError(); - return result.issues.length ? { - success: false, - error: new (_Err ?? $ZodError)(result.issues.map((iss) => finalizeIssue(iss, ctx, config()))) - } : { - success: true, - data: result.value - }; -}; -const safeParse$1 = /* @__PURE__*/ _safeParse($ZodRealError); -const _safeParseAsync = (_Err) => async (schema, value, _ctx) => { - const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true }; - let result = schema._zod.run({ - value, - issues: [] - }, ctx); - if (result instanceof Promise) result = await result; - return result.issues.length ? { - success: false, - error: new _Err(result.issues.map((iss) => finalizeIssue(iss, ctx, config()))) - } : { - success: true, - data: result.value - }; -}; -const safeParseAsync$1 = /* @__PURE__*/ _safeParseAsync($ZodRealError); -//#endregion -//#region node_modules/zod/v4/core/regexes.js -const cuid = /^[cC][^\s-]{8,}$/; -const cuid2 = /^[0-9a-z]+$/; -const ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/; -const xid = /^[0-9a-vA-V]{20}$/; -const ksuid = /^[A-Za-z0-9]{27}$/; -const nanoid = /^[a-zA-Z0-9_-]{21}$/; -/** ISO 8601-1 duration regex. Does not support the 8601-2 extensions like negative durations or fractional/negative components. */ -const duration$1 = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/; -/** A regex for any UUID-like identifier: 8-4-4-4-12 hex pattern */ -const guid = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/; -/** Returns a regex for validating an RFC 4122 UUID. -* -* @param version Optionally specify a version 1-8. If no version is specified, all versions are supported. */ -const uuid = (version) => { - if (!version) return /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/; - return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`); -}; -/** Practical email validation */ -const email = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/; -const _emoji$1 = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`; -function emoji() { - return new RegExp(_emoji$1, "u"); -} -const ipv4 = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/; -const ipv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/; -const cidrv4 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/; -const cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/; -const base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/; -const base64url = /^[A-Za-z0-9_-]*$/; -const hostname = /^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/; -const e164 = /^\+(?:[0-9]){6,14}[0-9]$/; -const dateSource = `(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`; -const date$1 = /*@__PURE__*/ new RegExp(`^${dateSource}$`); -function timeSource(args) { - const hhmm = `(?:[01]\\d|2[0-3]):[0-5]\\d`; - return typeof args.precision === "number" ? args.precision === -1 ? `${hhmm}` : args.precision === 0 ? `${hhmm}:[0-5]\\d` : `${hhmm}:[0-5]\\d\\.\\d{${args.precision}}` : `${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`; -} -function time$1(args) { - return new RegExp(`^${timeSource(args)}$`); -} -function datetime$1(args) { - const time = timeSource({ precision: args.precision }); - const opts = ["Z"]; - if (args.local) opts.push(""); - if (args.offset) opts.push(`([+-]\\d{2}:\\d{2})`); - const timeRegex = `${time}(?:${opts.join("|")})`; - return new RegExp(`^${dateSource}T(?:${timeRegex})$`); -} -const string$1 = (params) => { - const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`; - return new RegExp(`^${regex}$`); -}; -const integer = /^\d+$/; -const number$1 = /^-?\d+(?:\.\d+)?/i; -const boolean$1 = /true|false/i; -const _null$2 = /null/i; -const lowercase = /^[^A-Z]*$/; -const uppercase = /^[^a-z]*$/; -//#endregion -//#region node_modules/zod/v4/core/checks.js -const $ZodCheck = /*@__PURE__*/ $constructor("$ZodCheck", (inst, def) => { - var _a; - inst._zod ?? (inst._zod = {}); - inst._zod.def = def; - (_a = inst._zod).onattach ?? (_a.onattach = []); -}); -const numericOriginMap = { - number: "number", - bigint: "bigint", - object: "date" -}; -const $ZodCheckLessThan = /*@__PURE__*/ $constructor("$ZodCheckLessThan", (inst, def) => { - $ZodCheck.init(inst, def); - const origin = numericOriginMap[typeof def.value]; - inst._zod.onattach.push((inst) => { - const bag = inst._zod.bag; - const curr = (def.inclusive ? bag.maximum : bag.exclusiveMaximum) ?? Number.POSITIVE_INFINITY; - if (def.value < curr) if (def.inclusive) bag.maximum = def.value; - else bag.exclusiveMaximum = def.value; - }); - inst._zod.check = (payload) => { - if (def.inclusive ? payload.value <= def.value : payload.value < def.value) return; - payload.issues.push({ - origin, - code: "too_big", - maximum: def.value, - input: payload.value, - inclusive: def.inclusive, - inst, - continue: !def.abort - }); - }; -}); -const $ZodCheckGreaterThan = /*@__PURE__*/ $constructor("$ZodCheckGreaterThan", (inst, def) => { - $ZodCheck.init(inst, def); - const origin = numericOriginMap[typeof def.value]; - inst._zod.onattach.push((inst) => { - const bag = inst._zod.bag; - const curr = (def.inclusive ? bag.minimum : bag.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY; - if (def.value > curr) if (def.inclusive) bag.minimum = def.value; - else bag.exclusiveMinimum = def.value; - }); - inst._zod.check = (payload) => { - if (def.inclusive ? payload.value >= def.value : payload.value > def.value) return; - payload.issues.push({ - origin, - code: "too_small", - minimum: def.value, - input: payload.value, - inclusive: def.inclusive, - inst, - continue: !def.abort - }); - }; -}); -const $ZodCheckMultipleOf = /*@__PURE__*/ $constructor("$ZodCheckMultipleOf", (inst, def) => { - $ZodCheck.init(inst, def); - inst._zod.onattach.push((inst) => { - var _a; - (_a = inst._zod.bag).multipleOf ?? (_a.multipleOf = def.value); - }); - inst._zod.check = (payload) => { - if (typeof payload.value !== typeof def.value) throw new Error("Cannot mix number and bigint in multiple_of check."); - if (typeof payload.value === "bigint" ? payload.value % def.value === BigInt(0) : floatSafeRemainder$1(payload.value, def.value) === 0) return; - payload.issues.push({ - origin: typeof payload.value, - code: "not_multiple_of", - divisor: def.value, - input: payload.value, - inst, - continue: !def.abort - }); - }; -}); -const $ZodCheckNumberFormat = /*@__PURE__*/ $constructor("$ZodCheckNumberFormat", (inst, def) => { - $ZodCheck.init(inst, def); - def.format = def.format || "float64"; - const isInt = def.format?.includes("int"); - const origin = isInt ? "int" : "number"; - const [minimum, maximum] = NUMBER_FORMAT_RANGES[def.format]; - inst._zod.onattach.push((inst) => { - const bag = inst._zod.bag; - bag.format = def.format; - bag.minimum = minimum; - bag.maximum = maximum; - if (isInt) bag.pattern = integer; - }); - inst._zod.check = (payload) => { - const input = payload.value; - if (isInt) { - if (!Number.isInteger(input)) { - payload.issues.push({ - expected: origin, - format: def.format, - code: "invalid_type", - input, - inst - }); - return; - } - if (!Number.isSafeInteger(input)) { - if (input > 0) payload.issues.push({ - input, - code: "too_big", - maximum: Number.MAX_SAFE_INTEGER, - note: "Integers must be within the safe integer range.", - inst, - origin, - continue: !def.abort - }); - else payload.issues.push({ - input, - code: "too_small", - minimum: Number.MIN_SAFE_INTEGER, - note: "Integers must be within the safe integer range.", - inst, - origin, - continue: !def.abort - }); - return; - } - } - if (input < minimum) payload.issues.push({ - origin: "number", - input, - code: "too_small", - minimum, - inclusive: true, - inst, - continue: !def.abort - }); - if (input > maximum) payload.issues.push({ - origin: "number", - input, - code: "too_big", - maximum, - inst - }); - }; -}); -const $ZodCheckMaxLength = /*@__PURE__*/ $constructor("$ZodCheckMaxLength", (inst, def) => { - var _a; - $ZodCheck.init(inst, def); - (_a = inst._zod.def).when ?? (_a.when = (payload) => { - const val = payload.value; - return !nullish(val) && val.length !== void 0; - }); - inst._zod.onattach.push((inst) => { - const curr = inst._zod.bag.maximum ?? Number.POSITIVE_INFINITY; - if (def.maximum < curr) inst._zod.bag.maximum = def.maximum; - }); - inst._zod.check = (payload) => { - const input = payload.value; - if (input.length <= def.maximum) return; - const origin = getLengthableOrigin(input); - payload.issues.push({ - origin, - code: "too_big", - maximum: def.maximum, - inclusive: true, - input, - inst, - continue: !def.abort - }); - }; -}); -const $ZodCheckMinLength = /*@__PURE__*/ $constructor("$ZodCheckMinLength", (inst, def) => { - var _a; - $ZodCheck.init(inst, def); - (_a = inst._zod.def).when ?? (_a.when = (payload) => { - const val = payload.value; - return !nullish(val) && val.length !== void 0; - }); - inst._zod.onattach.push((inst) => { - const curr = inst._zod.bag.minimum ?? Number.NEGATIVE_INFINITY; - if (def.minimum > curr) inst._zod.bag.minimum = def.minimum; - }); - inst._zod.check = (payload) => { - const input = payload.value; - if (input.length >= def.minimum) return; - const origin = getLengthableOrigin(input); - payload.issues.push({ - origin, - code: "too_small", - minimum: def.minimum, - inclusive: true, - input, - inst, - continue: !def.abort - }); - }; -}); -const $ZodCheckLengthEquals = /*@__PURE__*/ $constructor("$ZodCheckLengthEquals", (inst, def) => { - var _a; - $ZodCheck.init(inst, def); - (_a = inst._zod.def).when ?? (_a.when = (payload) => { - const val = payload.value; - return !nullish(val) && val.length !== void 0; - }); - inst._zod.onattach.push((inst) => { - const bag = inst._zod.bag; - bag.minimum = def.length; - bag.maximum = def.length; - bag.length = def.length; - }); - inst._zod.check = (payload) => { - const input = payload.value; - const length = input.length; - if (length === def.length) return; - const origin = getLengthableOrigin(input); - const tooBig = length > def.length; - payload.issues.push({ - origin, - ...tooBig ? { - code: "too_big", - maximum: def.length - } : { - code: "too_small", - minimum: def.length - }, - inclusive: true, - exact: true, - input: payload.value, - inst, - continue: !def.abort - }); - }; -}); -const $ZodCheckStringFormat = /*@__PURE__*/ $constructor("$ZodCheckStringFormat", (inst, def) => { - var _a, _b; - $ZodCheck.init(inst, def); - inst._zod.onattach.push((inst) => { - const bag = inst._zod.bag; - bag.format = def.format; - if (def.pattern) { - bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set()); - bag.patterns.add(def.pattern); - } - }); - if (def.pattern) (_a = inst._zod).check ?? (_a.check = (payload) => { - def.pattern.lastIndex = 0; - if (def.pattern.test(payload.value)) return; - payload.issues.push({ - origin: "string", - code: "invalid_format", - format: def.format, - input: payload.value, - ...def.pattern ? { pattern: def.pattern.toString() } : {}, - inst, - continue: !def.abort - }); - }); - else (_b = inst._zod).check ?? (_b.check = () => {}); -}); -const $ZodCheckRegex = /*@__PURE__*/ $constructor("$ZodCheckRegex", (inst, def) => { - $ZodCheckStringFormat.init(inst, def); - inst._zod.check = (payload) => { - def.pattern.lastIndex = 0; - if (def.pattern.test(payload.value)) return; - payload.issues.push({ - origin: "string", - code: "invalid_format", - format: "regex", - input: payload.value, - pattern: def.pattern.toString(), - inst, - continue: !def.abort - }); - }; -}); -const $ZodCheckLowerCase = /*@__PURE__*/ $constructor("$ZodCheckLowerCase", (inst, def) => { - def.pattern ?? (def.pattern = lowercase); - $ZodCheckStringFormat.init(inst, def); -}); -const $ZodCheckUpperCase = /*@__PURE__*/ $constructor("$ZodCheckUpperCase", (inst, def) => { - def.pattern ?? (def.pattern = uppercase); - $ZodCheckStringFormat.init(inst, def); -}); -const $ZodCheckIncludes = /*@__PURE__*/ $constructor("$ZodCheckIncludes", (inst, def) => { - $ZodCheck.init(inst, def); - const escapedRegex = escapeRegex(def.includes); - const pattern = new RegExp(typeof def.position === "number" ? `^.{${def.position}}${escapedRegex}` : escapedRegex); - def.pattern = pattern; - inst._zod.onattach.push((inst) => { - const bag = inst._zod.bag; - bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set()); - bag.patterns.add(pattern); - }); - inst._zod.check = (payload) => { - if (payload.value.includes(def.includes, def.position)) return; - payload.issues.push({ - origin: "string", - code: "invalid_format", - format: "includes", - includes: def.includes, - input: payload.value, - inst, - continue: !def.abort - }); - }; -}); -const $ZodCheckStartsWith = /*@__PURE__*/ $constructor("$ZodCheckStartsWith", (inst, def) => { - $ZodCheck.init(inst, def); - const pattern = new RegExp(`^${escapeRegex(def.prefix)}.*`); - def.pattern ?? (def.pattern = pattern); - inst._zod.onattach.push((inst) => { - const bag = inst._zod.bag; - bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set()); - bag.patterns.add(pattern); - }); - inst._zod.check = (payload) => { - if (payload.value.startsWith(def.prefix)) return; - payload.issues.push({ - origin: "string", - code: "invalid_format", - format: "starts_with", - prefix: def.prefix, - input: payload.value, - inst, - continue: !def.abort - }); - }; -}); -const $ZodCheckEndsWith = /*@__PURE__*/ $constructor("$ZodCheckEndsWith", (inst, def) => { - $ZodCheck.init(inst, def); - const pattern = new RegExp(`.*${escapeRegex(def.suffix)}$`); - def.pattern ?? (def.pattern = pattern); - inst._zod.onattach.push((inst) => { - const bag = inst._zod.bag; - bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set()); - bag.patterns.add(pattern); - }); - inst._zod.check = (payload) => { - if (payload.value.endsWith(def.suffix)) return; - payload.issues.push({ - origin: "string", - code: "invalid_format", - format: "ends_with", - suffix: def.suffix, - input: payload.value, - inst, - continue: !def.abort - }); - }; -}); -const $ZodCheckOverwrite = /*@__PURE__*/ $constructor("$ZodCheckOverwrite", (inst, def) => { - $ZodCheck.init(inst, def); - inst._zod.check = (payload) => { - payload.value = def.tx(payload.value); - }; -}); -//#endregion -//#region node_modules/zod/v4/core/doc.js -var Doc = class { - constructor(args = []) { - this.content = []; - this.indent = 0; - if (this) this.args = args; - } - indented(fn) { - this.indent += 1; - fn(this); - this.indent -= 1; - } - write(arg) { - if (typeof arg === "function") { - arg(this, { execution: "sync" }); - arg(this, { execution: "async" }); - return; - } - const lines = arg.split("\n").filter((x) => x); - const minIndent = Math.min(...lines.map((x) => x.length - x.trimStart().length)); - const dedented = lines.map((x) => x.slice(minIndent)).map((x) => " ".repeat(this.indent * 2) + x); - for (const line of dedented) this.content.push(line); - } - compile() { - const F = Function; - const args = this?.args; - const lines = [...(this?.content ?? [``]).map((x) => ` ${x}`)]; - return new F(...args, lines.join("\n")); - } -}; -//#endregion -//#region node_modules/zod/v4/core/versions.js -const version = { - major: 4, - minor: 0, - patch: 0 -}; -//#endregion -//#region node_modules/zod/v4/core/schemas.js -const $ZodType = /*@__PURE__*/ $constructor("$ZodType", (inst, def) => { - var _a; - inst ?? (inst = {}); - inst._zod.def = def; - inst._zod.bag = inst._zod.bag || {}; - inst._zod.version = version; - const checks = [...inst._zod.def.checks ?? []]; - if (inst._zod.traits.has("$ZodCheck")) checks.unshift(inst); - for (const ch of checks) for (const fn of ch._zod.onattach) fn(inst); - if (checks.length === 0) { - (_a = inst._zod).deferred ?? (_a.deferred = []); - inst._zod.deferred?.push(() => { - inst._zod.run = inst._zod.parse; - }); - } else { - const runChecks = (payload, checks, ctx) => { - let isAborted = aborted(payload); - let asyncResult; - for (const ch of checks) { - if (ch._zod.def.when) { - if (!ch._zod.def.when(payload)) continue; - } else if (isAborted) continue; - const currLen = payload.issues.length; - const _ = ch._zod.check(payload); - if (_ instanceof Promise && ctx?.async === false) throw new $ZodAsyncError(); - if (asyncResult || _ instanceof Promise) asyncResult = (asyncResult ?? Promise.resolve()).then(async () => { - await _; - if (payload.issues.length === currLen) return; - if (!isAborted) isAborted = aborted(payload, currLen); - }); - else { - if (payload.issues.length === currLen) continue; - if (!isAborted) isAborted = aborted(payload, currLen); - } - } - if (asyncResult) return asyncResult.then(() => { - return payload; - }); - return payload; - }; - inst._zod.run = (payload, ctx) => { - const result = inst._zod.parse(payload, ctx); - if (result instanceof Promise) { - if (ctx.async === false) throw new $ZodAsyncError(); - return result.then((result) => runChecks(result, checks, ctx)); - } - return runChecks(result, checks, ctx); - }; - } - inst["~standard"] = { - validate: (value) => { - try { - const r = safeParse$1(inst, value); - return r.success ? { value: r.data } : { issues: r.error?.issues }; - } catch (_) { - return safeParseAsync$1(inst, value).then((r) => r.success ? { value: r.data } : { issues: r.error?.issues }); - } - }, - vendor: "zod", - version: 1 - }; -}); -const $ZodString = /*@__PURE__*/ $constructor("$ZodString", (inst, def) => { - $ZodType.init(inst, def); - inst._zod.pattern = [...inst?._zod.bag?.patterns ?? []].pop() ?? string$1(inst._zod.bag); - inst._zod.parse = (payload, _) => { - if (def.coerce) try { - payload.value = String(payload.value); - } catch (_) {} - if (typeof payload.value === "string") return payload; - payload.issues.push({ - expected: "string", - code: "invalid_type", - input: payload.value, - inst - }); - return payload; - }; -}); -const $ZodStringFormat = /*@__PURE__*/ $constructor("$ZodStringFormat", (inst, def) => { - $ZodCheckStringFormat.init(inst, def); - $ZodString.init(inst, def); -}); -const $ZodGUID = /*@__PURE__*/ $constructor("$ZodGUID", (inst, def) => { - def.pattern ?? (def.pattern = guid); - $ZodStringFormat.init(inst, def); -}); -const $ZodUUID = /*@__PURE__*/ $constructor("$ZodUUID", (inst, def) => { - if (def.version) { - const v = { - v1: 1, - v2: 2, - v3: 3, - v4: 4, - v5: 5, - v6: 6, - v7: 7, - v8: 8 - }[def.version]; - if (v === void 0) throw new Error(`Invalid UUID version: "${def.version}"`); - def.pattern ?? (def.pattern = uuid(v)); - } else def.pattern ?? (def.pattern = uuid()); - $ZodStringFormat.init(inst, def); -}); -const $ZodEmail = /*@__PURE__*/ $constructor("$ZodEmail", (inst, def) => { - def.pattern ?? (def.pattern = email); - $ZodStringFormat.init(inst, def); -}); -const $ZodURL = /*@__PURE__*/ $constructor("$ZodURL", (inst, def) => { - $ZodStringFormat.init(inst, def); - inst._zod.check = (payload) => { - try { - const orig = payload.value; - const url = new URL(orig); - const href = url.href; - if (def.hostname) { - def.hostname.lastIndex = 0; - if (!def.hostname.test(url.hostname)) payload.issues.push({ - code: "invalid_format", - format: "url", - note: "Invalid hostname", - pattern: hostname.source, - input: payload.value, - inst, - continue: !def.abort - }); - } - if (def.protocol) { - def.protocol.lastIndex = 0; - if (!def.protocol.test(url.protocol.endsWith(":") ? url.protocol.slice(0, -1) : url.protocol)) payload.issues.push({ - code: "invalid_format", - format: "url", - note: "Invalid protocol", - pattern: def.protocol.source, - input: payload.value, - inst, - continue: !def.abort - }); - } - if (!orig.endsWith("/") && href.endsWith("/")) payload.value = href.slice(0, -1); - else payload.value = href; - return; - } catch (_) { - payload.issues.push({ - code: "invalid_format", - format: "url", - input: payload.value, - inst, - continue: !def.abort - }); - } - }; -}); -const $ZodEmoji = /*@__PURE__*/ $constructor("$ZodEmoji", (inst, def) => { - def.pattern ?? (def.pattern = emoji()); - $ZodStringFormat.init(inst, def); -}); -const $ZodNanoID = /*@__PURE__*/ $constructor("$ZodNanoID", (inst, def) => { - def.pattern ?? (def.pattern = nanoid); - $ZodStringFormat.init(inst, def); -}); -const $ZodCUID = /*@__PURE__*/ $constructor("$ZodCUID", (inst, def) => { - def.pattern ?? (def.pattern = cuid); - $ZodStringFormat.init(inst, def); -}); -const $ZodCUID2 = /*@__PURE__*/ $constructor("$ZodCUID2", (inst, def) => { - def.pattern ?? (def.pattern = cuid2); - $ZodStringFormat.init(inst, def); -}); -const $ZodULID = /*@__PURE__*/ $constructor("$ZodULID", (inst, def) => { - def.pattern ?? (def.pattern = ulid); - $ZodStringFormat.init(inst, def); -}); -const $ZodXID = /*@__PURE__*/ $constructor("$ZodXID", (inst, def) => { - def.pattern ?? (def.pattern = xid); - $ZodStringFormat.init(inst, def); -}); -const $ZodKSUID = /*@__PURE__*/ $constructor("$ZodKSUID", (inst, def) => { - def.pattern ?? (def.pattern = ksuid); - $ZodStringFormat.init(inst, def); -}); -const $ZodISODateTime = /*@__PURE__*/ $constructor("$ZodISODateTime", (inst, def) => { - def.pattern ?? (def.pattern = datetime$1(def)); - $ZodStringFormat.init(inst, def); -}); -const $ZodISODate = /*@__PURE__*/ $constructor("$ZodISODate", (inst, def) => { - def.pattern ?? (def.pattern = date$1); - $ZodStringFormat.init(inst, def); -}); -const $ZodISOTime = /*@__PURE__*/ $constructor("$ZodISOTime", (inst, def) => { - def.pattern ?? (def.pattern = time$1(def)); - $ZodStringFormat.init(inst, def); -}); -const $ZodISODuration = /*@__PURE__*/ $constructor("$ZodISODuration", (inst, def) => { - def.pattern ?? (def.pattern = duration$1); - $ZodStringFormat.init(inst, def); -}); -const $ZodIPv4 = /*@__PURE__*/ $constructor("$ZodIPv4", (inst, def) => { - def.pattern ?? (def.pattern = ipv4); - $ZodStringFormat.init(inst, def); - inst._zod.onattach.push((inst) => { - const bag = inst._zod.bag; - bag.format = `ipv4`; - }); -}); -const $ZodIPv6 = /*@__PURE__*/ $constructor("$ZodIPv6", (inst, def) => { - def.pattern ?? (def.pattern = ipv6); - $ZodStringFormat.init(inst, def); - inst._zod.onattach.push((inst) => { - const bag = inst._zod.bag; - bag.format = `ipv6`; - }); - inst._zod.check = (payload) => { - try { - new URL(`http://[${payload.value}]`); - } catch { - payload.issues.push({ - code: "invalid_format", - format: "ipv6", - input: payload.value, - inst, - continue: !def.abort - }); - } - }; -}); -const $ZodCIDRv4 = /*@__PURE__*/ $constructor("$ZodCIDRv4", (inst, def) => { - def.pattern ?? (def.pattern = cidrv4); - $ZodStringFormat.init(inst, def); -}); -const $ZodCIDRv6 = /*@__PURE__*/ $constructor("$ZodCIDRv6", (inst, def) => { - def.pattern ?? (def.pattern = cidrv6); - $ZodStringFormat.init(inst, def); - inst._zod.check = (payload) => { - const [address, prefix] = payload.value.split("/"); - try { - if (!prefix) throw new Error(); - const prefixNum = Number(prefix); - if (`${prefixNum}` !== prefix) throw new Error(); - if (prefixNum < 0 || prefixNum > 128) throw new Error(); - new URL(`http://[${address}]`); - } catch { - payload.issues.push({ - code: "invalid_format", - format: "cidrv6", - input: payload.value, - inst, - continue: !def.abort - }); - } - }; -}); -function isValidBase64(data) { - if (data === "") return true; - if (data.length % 4 !== 0) return false; - try { - atob(data); - return true; - } catch { - return false; - } -} -const $ZodBase64 = /*@__PURE__*/ $constructor("$ZodBase64", (inst, def) => { - def.pattern ?? (def.pattern = base64); - $ZodStringFormat.init(inst, def); - inst._zod.onattach.push((inst) => { - inst._zod.bag.contentEncoding = "base64"; - }); - inst._zod.check = (payload) => { - if (isValidBase64(payload.value)) return; - payload.issues.push({ - code: "invalid_format", - format: "base64", - input: payload.value, - inst, - continue: !def.abort - }); - }; -}); -function isValidBase64URL(data) { - if (!base64url.test(data)) return false; - const base64 = data.replace(/[-_]/g, (c) => c === "-" ? "+" : "/"); - return isValidBase64(base64.padEnd(Math.ceil(base64.length / 4) * 4, "=")); -} -const $ZodBase64URL = /*@__PURE__*/ $constructor("$ZodBase64URL", (inst, def) => { - def.pattern ?? (def.pattern = base64url); - $ZodStringFormat.init(inst, def); - inst._zod.onattach.push((inst) => { - inst._zod.bag.contentEncoding = "base64url"; - }); - inst._zod.check = (payload) => { - if (isValidBase64URL(payload.value)) return; - payload.issues.push({ - code: "invalid_format", - format: "base64url", - input: payload.value, - inst, - continue: !def.abort - }); - }; -}); -const $ZodE164 = /*@__PURE__*/ $constructor("$ZodE164", (inst, def) => { - def.pattern ?? (def.pattern = e164); - $ZodStringFormat.init(inst, def); -}); -function isValidJWT$1(token, algorithm = null) { - try { - const tokensParts = token.split("."); - if (tokensParts.length !== 3) return false; - const [header] = tokensParts; - if (!header) return false; - const parsedHeader = JSON.parse(atob(header)); - if ("typ" in parsedHeader && parsedHeader?.typ !== "JWT") return false; - if (!parsedHeader.alg) return false; - if (algorithm && (!("alg" in parsedHeader) || parsedHeader.alg !== algorithm)) return false; - return true; - } catch { - return false; - } -} -const $ZodJWT = /*@__PURE__*/ $constructor("$ZodJWT", (inst, def) => { - $ZodStringFormat.init(inst, def); - inst._zod.check = (payload) => { - if (isValidJWT$1(payload.value, def.alg)) return; - payload.issues.push({ - code: "invalid_format", - format: "jwt", - input: payload.value, - inst, - continue: !def.abort - }); - }; -}); -const $ZodNumber = /*@__PURE__*/ $constructor("$ZodNumber", (inst, def) => { - $ZodType.init(inst, def); - inst._zod.pattern = inst._zod.bag.pattern ?? number$1; - inst._zod.parse = (payload, _ctx) => { - if (def.coerce) try { - payload.value = Number(payload.value); - } catch (_) {} - const input = payload.value; - if (typeof input === "number" && !Number.isNaN(input) && Number.isFinite(input)) return payload; - const received = typeof input === "number" ? Number.isNaN(input) ? "NaN" : !Number.isFinite(input) ? "Infinity" : void 0 : void 0; - payload.issues.push({ - expected: "number", - code: "invalid_type", - input, - inst, - ...received ? { received } : {} - }); - return payload; - }; -}); -const $ZodNumberFormat = /*@__PURE__*/ $constructor("$ZodNumber", (inst, def) => { - $ZodCheckNumberFormat.init(inst, def); - $ZodNumber.init(inst, def); -}); -const $ZodBoolean = /*@__PURE__*/ $constructor("$ZodBoolean", (inst, def) => { - $ZodType.init(inst, def); - inst._zod.pattern = boolean$1; - inst._zod.parse = (payload, _ctx) => { - if (def.coerce) try { - payload.value = Boolean(payload.value); - } catch (_) {} - const input = payload.value; - if (typeof input === "boolean") return payload; - payload.issues.push({ - expected: "boolean", - code: "invalid_type", - input, - inst - }); - return payload; - }; -}); -const $ZodNull = /*@__PURE__*/ $constructor("$ZodNull", (inst, def) => { - $ZodType.init(inst, def); - inst._zod.pattern = _null$2; - inst._zod.values = /* @__PURE__ */ new Set([null]); - inst._zod.parse = (payload, _ctx) => { - const input = payload.value; - if (input === null) return payload; - payload.issues.push({ - expected: "null", - code: "invalid_type", - input, - inst - }); - return payload; - }; -}); -const $ZodAny = /*@__PURE__*/ $constructor("$ZodAny", (inst, def) => { - $ZodType.init(inst, def); - inst._zod.parse = (payload) => payload; -}); -const $ZodUnknown = /*@__PURE__*/ $constructor("$ZodUnknown", (inst, def) => { - $ZodType.init(inst, def); - inst._zod.parse = (payload) => payload; -}); -const $ZodNever = /*@__PURE__*/ $constructor("$ZodNever", (inst, def) => { - $ZodType.init(inst, def); - inst._zod.parse = (payload, _ctx) => { - payload.issues.push({ - expected: "never", - code: "invalid_type", - input: payload.value, - inst - }); - return payload; - }; -}); -function handleArrayResult(result, final, index) { - if (result.issues.length) final.issues.push(...prefixIssues(index, result.issues)); - final.value[index] = result.value; -} -const $ZodArray = /*@__PURE__*/ $constructor("$ZodArray", (inst, def) => { - $ZodType.init(inst, def); - inst._zod.parse = (payload, ctx) => { - const input = payload.value; - if (!Array.isArray(input)) { - payload.issues.push({ - expected: "array", - code: "invalid_type", - input, - inst - }); - return payload; - } - payload.value = Array(input.length); - const proms = []; - for (let i = 0; i < input.length; i++) { - const item = input[i]; - const result = def.element._zod.run({ - value: item, - issues: [] - }, ctx); - if (result instanceof Promise) proms.push(result.then((result) => handleArrayResult(result, payload, i))); - else handleArrayResult(result, payload, i); - } - if (proms.length) return Promise.all(proms).then(() => payload); - return payload; - }; -}); -function handleObjectResult(result, final, key) { - if (result.issues.length) final.issues.push(...prefixIssues(key, result.issues)); - final.value[key] = result.value; -} -function handleOptionalObjectResult(result, final, key, input) { - if (result.issues.length) if (input[key] === void 0) if (key in input) final.value[key] = void 0; - else final.value[key] = result.value; - else final.issues.push(...prefixIssues(key, result.issues)); - else if (result.value === void 0) { - if (key in input) final.value[key] = void 0; - } else final.value[key] = result.value; -} -const $ZodObject = /*@__PURE__*/ $constructor("$ZodObject", (inst, def) => { - $ZodType.init(inst, def); - const _normalized = cached(() => { - const keys = Object.keys(def.shape); - for (const k of keys) if (!(def.shape[k] instanceof $ZodType)) throw new Error(`Invalid element at key "${k}": expected a Zod schema`); - const okeys = optionalKeys(def.shape); - return { - shape: def.shape, - keys, - keySet: new Set(keys), - numKeys: keys.length, - optionalKeys: new Set(okeys) - }; - }); - defineLazy(inst._zod, "propValues", () => { - const shape = def.shape; - const propValues = {}; - for (const key in shape) { - const field = shape[key]._zod; - if (field.values) { - propValues[key] ?? (propValues[key] = /* @__PURE__ */ new Set()); - for (const v of field.values) propValues[key].add(v); - } - } - return propValues; - }); - const generateFastpass = (shape) => { - const doc = new Doc([ - "shape", - "payload", - "ctx" - ]); - const normalized = _normalized.value; - const parseStr = (key) => { - const k = esc(key); - return `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`; - }; - doc.write(`const input = payload.value;`); - const ids = Object.create(null); - let counter = 0; - for (const key of normalized.keys) ids[key] = `key_${counter++}`; - doc.write(`const newResult = {}`); - for (const key of normalized.keys) if (normalized.optionalKeys.has(key)) { - const id = ids[key]; - doc.write(`const ${id} = ${parseStr(key)};`); - const k = esc(key); - doc.write(` - if (${id}.issues.length) { - if (input[${k}] === undefined) { - if (${k} in input) { - newResult[${k}] = undefined; - } - } else { - payload.issues = payload.issues.concat( - ${id}.issues.map((iss) => ({ - ...iss, - path: iss.path ? [${k}, ...iss.path] : [${k}], - })) - ); - } - } else if (${id}.value === undefined) { - if (${k} in input) newResult[${k}] = undefined; - } else { - newResult[${k}] = ${id}.value; - } - `); - } else { - const id = ids[key]; - doc.write(`const ${id} = ${parseStr(key)};`); - doc.write(` - if (${id}.issues.length) payload.issues = payload.issues.concat(${id}.issues.map(iss => ({ - ...iss, - path: iss.path ? [${esc(key)}, ...iss.path] : [${esc(key)}] - })));`); - doc.write(`newResult[${esc(key)}] = ${id}.value`); - } - doc.write(`payload.value = newResult;`); - doc.write(`return payload;`); - const fn = doc.compile(); - return (payload, ctx) => fn(shape, payload, ctx); - }; - let fastpass; - const isObject$1 = isObject; - const jit = !globalConfig.jitless; - const fastEnabled = jit && allowsEval.value; - const catchall = def.catchall; - let value; - inst._zod.parse = (payload, ctx) => { - value ?? (value = _normalized.value); - const input = payload.value; - if (!isObject$1(input)) { - payload.issues.push({ - expected: "object", - code: "invalid_type", - input, - inst - }); - return payload; - } - const proms = []; - if (jit && fastEnabled && ctx?.async === false && ctx.jitless !== true) { - if (!fastpass) fastpass = generateFastpass(def.shape); - payload = fastpass(payload, ctx); - } else { - payload.value = {}; - const shape = value.shape; - for (const key of value.keys) { - const el = shape[key]; - const r = el._zod.run({ - value: input[key], - issues: [] - }, ctx); - const isOptional = el._zod.optin === "optional" && el._zod.optout === "optional"; - if (r instanceof Promise) proms.push(r.then((r) => isOptional ? handleOptionalObjectResult(r, payload, key, input) : handleObjectResult(r, payload, key))); - else if (isOptional) handleOptionalObjectResult(r, payload, key, input); - else handleObjectResult(r, payload, key); - } - } - if (!catchall) return proms.length ? Promise.all(proms).then(() => payload) : payload; - const unrecognized = []; - const keySet = value.keySet; - const _catchall = catchall._zod; - const t = _catchall.def.type; - for (const key of Object.keys(input)) { - if (keySet.has(key)) continue; - if (t === "never") { - unrecognized.push(key); - continue; - } - const r = _catchall.run({ - value: input[key], - issues: [] - }, ctx); - if (r instanceof Promise) proms.push(r.then((r) => handleObjectResult(r, payload, key))); - else handleObjectResult(r, payload, key); - } - if (unrecognized.length) payload.issues.push({ - code: "unrecognized_keys", - keys: unrecognized, - input, - inst - }); - if (!proms.length) return payload; - return Promise.all(proms).then(() => { - return payload; - }); - }; -}); -function handleUnionResults(results, final, inst, ctx) { - for (const result of results) if (result.issues.length === 0) { - final.value = result.value; - return final; - } - final.issues.push({ - code: "invalid_union", - input: final.value, - inst, - errors: results.map((result) => result.issues.map((iss) => finalizeIssue(iss, ctx, config()))) - }); - return final; -} -const $ZodUnion = /*@__PURE__*/ $constructor("$ZodUnion", (inst, def) => { - $ZodType.init(inst, def); - defineLazy(inst._zod, "optin", () => def.options.some((o) => o._zod.optin === "optional") ? "optional" : void 0); - defineLazy(inst._zod, "optout", () => def.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0); - defineLazy(inst._zod, "values", () => { - if (def.options.every((o) => o._zod.values)) return new Set(def.options.flatMap((option) => Array.from(option._zod.values))); - }); - defineLazy(inst._zod, "pattern", () => { - if (def.options.every((o) => o._zod.pattern)) { - const patterns = def.options.map((o) => o._zod.pattern); - return new RegExp(`^(${patterns.map((p) => cleanRegex(p.source)).join("|")})$`); - } - }); - inst._zod.parse = (payload, ctx) => { - let async = false; - const results = []; - for (const option of def.options) { - const result = option._zod.run({ - value: payload.value, - issues: [] - }, ctx); - if (result instanceof Promise) { - results.push(result); - async = true; - } else { - if (result.issues.length === 0) return result; - results.push(result); - } - } - if (!async) return handleUnionResults(results, payload, inst, ctx); - return Promise.all(results).then((results) => { - return handleUnionResults(results, payload, inst, ctx); - }); - }; -}); -const $ZodDiscriminatedUnion = /*@__PURE__*/ $constructor("$ZodDiscriminatedUnion", (inst, def) => { - $ZodUnion.init(inst, def); - const _super = inst._zod.parse; - defineLazy(inst._zod, "propValues", () => { - const propValues = {}; - for (const option of def.options) { - const pv = option._zod.propValues; - if (!pv || Object.keys(pv).length === 0) throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(option)}"`); - for (const [k, v] of Object.entries(pv)) { - if (!propValues[k]) propValues[k] = /* @__PURE__ */ new Set(); - for (const val of v) propValues[k].add(val); - } - } - return propValues; - }); - const disc = cached(() => { - const opts = def.options; - const map = /* @__PURE__ */ new Map(); - for (const o of opts) { - const values = o._zod.propValues[def.discriminator]; - if (!values || values.size === 0) throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(o)}"`); - for (const v of values) { - if (map.has(v)) throw new Error(`Duplicate discriminator value "${String(v)}"`); - map.set(v, o); - } - } - return map; - }); - inst._zod.parse = (payload, ctx) => { - const input = payload.value; - if (!isObject(input)) { - payload.issues.push({ - code: "invalid_type", - expected: "object", - input, - inst - }); - return payload; - } - const opt = disc.value.get(input?.[def.discriminator]); - if (opt) return opt._zod.run(payload, ctx); - if (def.unionFallback) return _super(payload, ctx); - payload.issues.push({ - code: "invalid_union", - errors: [], - note: "No matching discriminator", - input, - path: [def.discriminator], - inst - }); - return payload; - }; -}); -const $ZodIntersection = /*@__PURE__*/ $constructor("$ZodIntersection", (inst, def) => { - $ZodType.init(inst, def); - inst._zod.parse = (payload, ctx) => { - const input = payload.value; - const left = def.left._zod.run({ - value: input, - issues: [] - }, ctx); - const right = def.right._zod.run({ - value: input, - issues: [] - }, ctx); - if (left instanceof Promise || right instanceof Promise) return Promise.all([left, right]).then(([left, right]) => { - return handleIntersectionResults(payload, left, right); - }); - return handleIntersectionResults(payload, left, right); - }; -}); -function mergeValues$1(a, b) { - if (a === b) return { - valid: true, - data: a - }; - if (a instanceof Date && b instanceof Date && +a === +b) return { - valid: true, - data: a - }; - if (isPlainObject$1(a) && isPlainObject$1(b)) { - const bKeys = Object.keys(b); - const sharedKeys = Object.keys(a).filter((key) => bKeys.indexOf(key) !== -1); - const newObj = { - ...a, - ...b - }; - for (const key of sharedKeys) { - const sharedValue = mergeValues$1(a[key], b[key]); - if (!sharedValue.valid) return { - valid: false, - mergeErrorPath: [key, ...sharedValue.mergeErrorPath] - }; - newObj[key] = sharedValue.data; - } - return { - valid: true, - data: newObj - }; - } - if (Array.isArray(a) && Array.isArray(b)) { - if (a.length !== b.length) return { - valid: false, - mergeErrorPath: [] - }; - const newArray = []; - for (let index = 0; index < a.length; index++) { - const itemA = a[index]; - const itemB = b[index]; - const sharedValue = mergeValues$1(itemA, itemB); - if (!sharedValue.valid) return { - valid: false, - mergeErrorPath: [index, ...sharedValue.mergeErrorPath] - }; - newArray.push(sharedValue.data); - } - return { - valid: true, - data: newArray - }; - } - return { - valid: false, - mergeErrorPath: [] - }; -} -function handleIntersectionResults(result, left, right) { - if (left.issues.length) result.issues.push(...left.issues); - if (right.issues.length) result.issues.push(...right.issues); - if (aborted(result)) return result; - const merged = mergeValues$1(left.value, right.value); - if (!merged.valid) throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(merged.mergeErrorPath)}`); - result.value = merged.data; - return result; -} -const $ZodRecord = /*@__PURE__*/ $constructor("$ZodRecord", (inst, def) => { - $ZodType.init(inst, def); - inst._zod.parse = (payload, ctx) => { - const input = payload.value; - if (!isPlainObject$1(input)) { - payload.issues.push({ - expected: "record", - code: "invalid_type", - input, - inst - }); - return payload; - } - const proms = []; - if (def.keyType._zod.values) { - const values = def.keyType._zod.values; - payload.value = {}; - for (const key of values) if (typeof key === "string" || typeof key === "number" || typeof key === "symbol") { - const result = def.valueType._zod.run({ - value: input[key], - issues: [] - }, ctx); - if (result instanceof Promise) proms.push(result.then((result) => { - if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues)); - payload.value[key] = result.value; - })); - else { - if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues)); - payload.value[key] = result.value; - } - } - let unrecognized; - for (const key in input) if (!values.has(key)) { - unrecognized = unrecognized ?? []; - unrecognized.push(key); - } - if (unrecognized && unrecognized.length > 0) payload.issues.push({ - code: "unrecognized_keys", - input, - inst, - keys: unrecognized - }); - } else { - payload.value = {}; - for (const key of Reflect.ownKeys(input)) { - if (key === "__proto__") continue; - const keyResult = def.keyType._zod.run({ - value: key, - issues: [] - }, ctx); - if (keyResult instanceof Promise) throw new Error("Async schemas not supported in object keys currently"); - if (keyResult.issues.length) { - payload.issues.push({ - origin: "record", - code: "invalid_key", - issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config())), - input: key, - path: [key], - inst - }); - payload.value[keyResult.value] = keyResult.value; - continue; - } - const result = def.valueType._zod.run({ - value: input[key], - issues: [] - }, ctx); - if (result instanceof Promise) proms.push(result.then((result) => { - if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues)); - payload.value[keyResult.value] = result.value; - })); - else { - if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues)); - payload.value[keyResult.value] = result.value; - } - } - } - if (proms.length) return Promise.all(proms).then(() => payload); - return payload; - }; -}); -const $ZodEnum = /*@__PURE__*/ $constructor("$ZodEnum", (inst, def) => { - $ZodType.init(inst, def); - const values = getEnumValues(def.entries); - inst._zod.values = new Set(values); - inst._zod.pattern = new RegExp(`^(${values.filter((k) => propertyKeyTypes.has(typeof k)).map((o) => typeof o === "string" ? escapeRegex(o) : o.toString()).join("|")})$`); - inst._zod.parse = (payload, _ctx) => { - const input = payload.value; - if (inst._zod.values.has(input)) return payload; - payload.issues.push({ - code: "invalid_value", - values, - input, - inst - }); - return payload; - }; -}); -const $ZodLiteral = /*@__PURE__*/ $constructor("$ZodLiteral", (inst, def) => { - $ZodType.init(inst, def); - inst._zod.values = new Set(def.values); - inst._zod.pattern = new RegExp(`^(${def.values.map((o) => typeof o === "string" ? escapeRegex(o) : o ? o.toString() : String(o)).join("|")})$`); - inst._zod.parse = (payload, _ctx) => { - const input = payload.value; - if (inst._zod.values.has(input)) return payload; - payload.issues.push({ - code: "invalid_value", - values: def.values, - input, - inst - }); - return payload; - }; -}); -const $ZodTransform = /*@__PURE__*/ $constructor("$ZodTransform", (inst, def) => { - $ZodType.init(inst, def); - inst._zod.parse = (payload, _ctx) => { - const _out = def.transform(payload.value, payload); - if (_ctx.async) return (_out instanceof Promise ? _out : Promise.resolve(_out)).then((output) => { - payload.value = output; - return payload; - }); - if (_out instanceof Promise) throw new $ZodAsyncError(); - payload.value = _out; - return payload; - }; -}); -const $ZodOptional = /*@__PURE__*/ $constructor("$ZodOptional", (inst, def) => { - $ZodType.init(inst, def); - inst._zod.optin = "optional"; - inst._zod.optout = "optional"; - defineLazy(inst._zod, "values", () => { - return def.innerType._zod.values ? /* @__PURE__ */ new Set([...def.innerType._zod.values, void 0]) : void 0; - }); - defineLazy(inst._zod, "pattern", () => { - const pattern = def.innerType._zod.pattern; - return pattern ? new RegExp(`^(${cleanRegex(pattern.source)})?$`) : void 0; - }); - inst._zod.parse = (payload, ctx) => { - if (def.innerType._zod.optin === "optional") return def.innerType._zod.run(payload, ctx); - if (payload.value === void 0) return payload; - return def.innerType._zod.run(payload, ctx); - }; -}); -const $ZodNullable = /*@__PURE__*/ $constructor("$ZodNullable", (inst, def) => { - $ZodType.init(inst, def); - defineLazy(inst._zod, "optin", () => def.innerType._zod.optin); - defineLazy(inst._zod, "optout", () => def.innerType._zod.optout); - defineLazy(inst._zod, "pattern", () => { - const pattern = def.innerType._zod.pattern; - return pattern ? new RegExp(`^(${cleanRegex(pattern.source)}|null)$`) : void 0; - }); - defineLazy(inst._zod, "values", () => { - return def.innerType._zod.values ? /* @__PURE__ */ new Set([...def.innerType._zod.values, null]) : void 0; - }); - inst._zod.parse = (payload, ctx) => { - if (payload.value === null) return payload; - return def.innerType._zod.run(payload, ctx); - }; -}); -const $ZodDefault = /*@__PURE__*/ $constructor("$ZodDefault", (inst, def) => { - $ZodType.init(inst, def); - inst._zod.optin = "optional"; - defineLazy(inst._zod, "values", () => def.innerType._zod.values); - inst._zod.parse = (payload, ctx) => { - if (payload.value === void 0) { - payload.value = def.defaultValue; - /** - * $ZodDefault always returns the default value immediately. - * It doesn't pass the default value into the validator ("prefault"). There's no reason to pass the default value through validation. The validity of the default is enforced by TypeScript statically. Otherwise, it's the responsibility of the user to ensure the default is valid. In the case of pipes with divergent in/out types, you can specify the default on the `in` schema of your ZodPipe to set a "prefault" for the pipe. */ - return payload; - } - const result = def.innerType._zod.run(payload, ctx); - if (result instanceof Promise) return result.then((result) => handleDefaultResult(result, def)); - return handleDefaultResult(result, def); - }; -}); -function handleDefaultResult(payload, def) { - if (payload.value === void 0) payload.value = def.defaultValue; - return payload; -} -const $ZodPrefault = /*@__PURE__*/ $constructor("$ZodPrefault", (inst, def) => { - $ZodType.init(inst, def); - inst._zod.optin = "optional"; - defineLazy(inst._zod, "values", () => def.innerType._zod.values); - inst._zod.parse = (payload, ctx) => { - if (payload.value === void 0) payload.value = def.defaultValue; - return def.innerType._zod.run(payload, ctx); - }; -}); -const $ZodNonOptional = /*@__PURE__*/ $constructor("$ZodNonOptional", (inst, def) => { - $ZodType.init(inst, def); - defineLazy(inst._zod, "values", () => { - const v = def.innerType._zod.values; - return v ? new Set([...v].filter((x) => x !== void 0)) : void 0; - }); - inst._zod.parse = (payload, ctx) => { - const result = def.innerType._zod.run(payload, ctx); - if (result instanceof Promise) return result.then((result) => handleNonOptionalResult(result, inst)); - return handleNonOptionalResult(result, inst); - }; -}); -function handleNonOptionalResult(payload, inst) { - if (!payload.issues.length && payload.value === void 0) payload.issues.push({ - code: "invalid_type", - expected: "nonoptional", - input: payload.value, - inst - }); - return payload; -} -const $ZodCatch = /*@__PURE__*/ $constructor("$ZodCatch", (inst, def) => { - $ZodType.init(inst, def); - inst._zod.optin = "optional"; - defineLazy(inst._zod, "optout", () => def.innerType._zod.optout); - defineLazy(inst._zod, "values", () => def.innerType._zod.values); - inst._zod.parse = (payload, ctx) => { - const result = def.innerType._zod.run(payload, ctx); - if (result instanceof Promise) return result.then((result) => { - payload.value = result.value; - if (result.issues.length) { - payload.value = def.catchValue({ - ...payload, - error: { issues: result.issues.map((iss) => finalizeIssue(iss, ctx, config())) }, - input: payload.value - }); - payload.issues = []; - } - return payload; - }); - payload.value = result.value; - if (result.issues.length) { - payload.value = def.catchValue({ - ...payload, - error: { issues: result.issues.map((iss) => finalizeIssue(iss, ctx, config())) }, - input: payload.value - }); - payload.issues = []; - } - return payload; - }; -}); -const $ZodPipe = /*@__PURE__*/ $constructor("$ZodPipe", (inst, def) => { - $ZodType.init(inst, def); - defineLazy(inst._zod, "values", () => def.in._zod.values); - defineLazy(inst._zod, "optin", () => def.in._zod.optin); - defineLazy(inst._zod, "optout", () => def.out._zod.optout); - inst._zod.parse = (payload, ctx) => { - const left = def.in._zod.run(payload, ctx); - if (left instanceof Promise) return left.then((left) => handlePipeResult(left, def, ctx)); - return handlePipeResult(left, def, ctx); - }; -}); -function handlePipeResult(left, def, ctx) { - if (aborted(left)) return left; - return def.out._zod.run({ - value: left.value, - issues: left.issues - }, ctx); -} -const $ZodReadonly = /*@__PURE__*/ $constructor("$ZodReadonly", (inst, def) => { - $ZodType.init(inst, def); - defineLazy(inst._zod, "propValues", () => def.innerType._zod.propValues); - defineLazy(inst._zod, "values", () => def.innerType._zod.values); - defineLazy(inst._zod, "optin", () => def.innerType._zod.optin); - defineLazy(inst._zod, "optout", () => def.innerType._zod.optout); - inst._zod.parse = (payload, ctx) => { - const result = def.innerType._zod.run(payload, ctx); - if (result instanceof Promise) return result.then(handleReadonlyResult); - return handleReadonlyResult(result); - }; -}); -function handleReadonlyResult(payload) { - payload.value = Object.freeze(payload.value); - return payload; -} -const $ZodLazy = /*@__PURE__*/ $constructor("$ZodLazy", (inst, def) => { - $ZodType.init(inst, def); - defineLazy(inst._zod, "innerType", () => def.getter()); - defineLazy(inst._zod, "pattern", () => inst._zod.innerType._zod.pattern); - defineLazy(inst._zod, "propValues", () => inst._zod.innerType._zod.propValues); - defineLazy(inst._zod, "optin", () => inst._zod.innerType._zod.optin); - defineLazy(inst._zod, "optout", () => inst._zod.innerType._zod.optout); - inst._zod.parse = (payload, ctx) => { - return inst._zod.innerType._zod.run(payload, ctx); - }; -}); -const $ZodCustom = /*@__PURE__*/ $constructor("$ZodCustom", (inst, def) => { - $ZodCheck.init(inst, def); - $ZodType.init(inst, def); - inst._zod.parse = (payload, _) => { - return payload; - }; - inst._zod.check = (payload) => { - const input = payload.value; - const r = def.fn(input); - if (r instanceof Promise) return r.then((r) => handleRefineResult(r, payload, input, inst)); - handleRefineResult(r, payload, input, inst); - }; -}); -function handleRefineResult(result, payload, input, inst) { - if (!result) { - const _iss = { - code: "custom", - input, - inst, - path: [...inst._zod.def.path ?? []], - continue: !inst._zod.def.abort - }; - if (inst._zod.def.params) _iss.params = inst._zod.def.params; - payload.issues.push(issue(_iss)); - } -} -//#endregion -//#region node_modules/zod/v4/core/registries.js -var $ZodRegistry = class { - constructor() { - this._map = /* @__PURE__ */ new Map(); - this._idmap = /* @__PURE__ */ new Map(); - } - add(schema, ..._meta) { - const meta = _meta[0]; - this._map.set(schema, meta); - if (meta && typeof meta === "object" && "id" in meta) { - if (this._idmap.has(meta.id)) throw new Error(`ID ${meta.id} already exists in the registry`); - this._idmap.set(meta.id, schema); - } - return this; - } - clear() { - this._map = /* @__PURE__ */ new Map(); - this._idmap = /* @__PURE__ */ new Map(); - return this; - } - remove(schema) { - const meta = this._map.get(schema); - if (meta && typeof meta === "object" && "id" in meta) this._idmap.delete(meta.id); - this._map.delete(schema); - return this; - } - get(schema) { - const p = schema._zod.parent; - if (p) { - const pm = { ...this.get(p) ?? {} }; - delete pm.id; - return { - ...pm, - ...this._map.get(schema) - }; - } - return this._map.get(schema); - } - has(schema) { - return this._map.has(schema); - } -}; -function registry() { - return new $ZodRegistry(); -} -const globalRegistry = /*@__PURE__*/ registry(); -//#endregion -//#region node_modules/zod/v4/core/api.js -function _string(Class, params) { - return new Class({ - type: "string", - ...normalizeParams(params) - }); -} -function _email(Class, params) { - return new Class({ - type: "string", - format: "email", - check: "string_format", - abort: false, - ...normalizeParams(params) - }); -} -function _guid(Class, params) { - return new Class({ - type: "string", - format: "guid", - check: "string_format", - abort: false, - ...normalizeParams(params) - }); -} -function _uuid(Class, params) { - return new Class({ - type: "string", - format: "uuid", - check: "string_format", - abort: false, - ...normalizeParams(params) - }); -} -function _uuidv4(Class, params) { - return new Class({ - type: "string", - format: "uuid", - check: "string_format", - abort: false, - version: "v4", - ...normalizeParams(params) - }); -} -function _uuidv6(Class, params) { - return new Class({ - type: "string", - format: "uuid", - check: "string_format", - abort: false, - version: "v6", - ...normalizeParams(params) - }); -} -function _uuidv7(Class, params) { - return new Class({ - type: "string", - format: "uuid", - check: "string_format", - abort: false, - version: "v7", - ...normalizeParams(params) - }); -} -function _url(Class, params) { - return new Class({ - type: "string", - format: "url", - check: "string_format", - abort: false, - ...normalizeParams(params) - }); -} -function _emoji(Class, params) { - return new Class({ - type: "string", - format: "emoji", - check: "string_format", - abort: false, - ...normalizeParams(params) - }); -} -function _nanoid(Class, params) { - return new Class({ - type: "string", - format: "nanoid", - check: "string_format", - abort: false, - ...normalizeParams(params) - }); -} -function _cuid(Class, params) { - return new Class({ - type: "string", - format: "cuid", - check: "string_format", - abort: false, - ...normalizeParams(params) - }); -} -function _cuid2(Class, params) { - return new Class({ - type: "string", - format: "cuid2", - check: "string_format", - abort: false, - ...normalizeParams(params) - }); -} -function _ulid(Class, params) { - return new Class({ - type: "string", - format: "ulid", - check: "string_format", - abort: false, - ...normalizeParams(params) - }); -} -function _xid(Class, params) { - return new Class({ - type: "string", - format: "xid", - check: "string_format", - abort: false, - ...normalizeParams(params) - }); -} -function _ksuid(Class, params) { - return new Class({ - type: "string", - format: "ksuid", - check: "string_format", - abort: false, - ...normalizeParams(params) - }); -} -function _ipv4(Class, params) { - return new Class({ - type: "string", - format: "ipv4", - check: "string_format", - abort: false, - ...normalizeParams(params) - }); -} -function _ipv6(Class, params) { - return new Class({ - type: "string", - format: "ipv6", - check: "string_format", - abort: false, - ...normalizeParams(params) - }); -} -function _cidrv4(Class, params) { - return new Class({ - type: "string", - format: "cidrv4", - check: "string_format", - abort: false, - ...normalizeParams(params) - }); -} -function _cidrv6(Class, params) { - return new Class({ - type: "string", - format: "cidrv6", - check: "string_format", - abort: false, - ...normalizeParams(params) - }); -} -function _base64(Class, params) { - return new Class({ - type: "string", - format: "base64", - check: "string_format", - abort: false, - ...normalizeParams(params) - }); -} -function _base64url(Class, params) { - return new Class({ - type: "string", - format: "base64url", - check: "string_format", - abort: false, - ...normalizeParams(params) - }); -} -function _e164(Class, params) { - return new Class({ - type: "string", - format: "e164", - check: "string_format", - abort: false, - ...normalizeParams(params) - }); -} -function _jwt(Class, params) { - return new Class({ - type: "string", - format: "jwt", - check: "string_format", - abort: false, - ...normalizeParams(params) - }); -} -function _isoDateTime(Class, params) { - return new Class({ - type: "string", - format: "datetime", - check: "string_format", - offset: false, - local: false, - precision: null, - ...normalizeParams(params) - }); -} -function _isoDate(Class, params) { - return new Class({ - type: "string", - format: "date", - check: "string_format", - ...normalizeParams(params) - }); -} -function _isoTime(Class, params) { - return new Class({ - type: "string", - format: "time", - check: "string_format", - precision: null, - ...normalizeParams(params) - }); -} -function _isoDuration(Class, params) { - return new Class({ - type: "string", - format: "duration", - check: "string_format", - ...normalizeParams(params) - }); -} -function _number(Class, params) { - return new Class({ - type: "number", - checks: [], - ...normalizeParams(params) - }); -} -function _int(Class, params) { - return new Class({ - type: "number", - check: "number_format", - abort: false, - format: "safeint", - ...normalizeParams(params) - }); -} -function _boolean(Class, params) { - return new Class({ - type: "boolean", - ...normalizeParams(params) - }); -} -function _null$1(Class, params) { - return new Class({ - type: "null", - ...normalizeParams(params) - }); -} -function _any(Class) { - return new Class({ type: "any" }); -} -function _unknown(Class) { - return new Class({ type: "unknown" }); -} -function _never(Class, params) { - return new Class({ - type: "never", - ...normalizeParams(params) - }); -} -function _lt(value, params) { - return new $ZodCheckLessThan({ - check: "less_than", - ...normalizeParams(params), - value, - inclusive: false - }); -} -function _lte(value, params) { - return new $ZodCheckLessThan({ - check: "less_than", - ...normalizeParams(params), - value, - inclusive: true - }); -} -function _gt(value, params) { - return new $ZodCheckGreaterThan({ - check: "greater_than", - ...normalizeParams(params), - value, - inclusive: false - }); -} -function _gte(value, params) { - return new $ZodCheckGreaterThan({ - check: "greater_than", - ...normalizeParams(params), - value, - inclusive: true - }); -} -function _multipleOf(value, params) { - return new $ZodCheckMultipleOf({ - check: "multiple_of", - ...normalizeParams(params), - value - }); -} -function _maxLength(maximum, params) { - return new $ZodCheckMaxLength({ - check: "max_length", - ...normalizeParams(params), - maximum - }); -} -function _minLength(minimum, params) { - return new $ZodCheckMinLength({ - check: "min_length", - ...normalizeParams(params), - minimum - }); -} -function _length(length, params) { - return new $ZodCheckLengthEquals({ - check: "length_equals", - ...normalizeParams(params), - length - }); -} -function _regex(pattern, params) { - return new $ZodCheckRegex({ - check: "string_format", - format: "regex", - ...normalizeParams(params), - pattern - }); -} -function _lowercase(params) { - return new $ZodCheckLowerCase({ - check: "string_format", - format: "lowercase", - ...normalizeParams(params) - }); -} -function _uppercase(params) { - return new $ZodCheckUpperCase({ - check: "string_format", - format: "uppercase", - ...normalizeParams(params) - }); -} -function _includes(includes, params) { - return new $ZodCheckIncludes({ - check: "string_format", - format: "includes", - ...normalizeParams(params), - includes - }); -} -function _startsWith(prefix, params) { - return new $ZodCheckStartsWith({ - check: "string_format", - format: "starts_with", - ...normalizeParams(params), - prefix - }); -} -function _endsWith(suffix, params) { - return new $ZodCheckEndsWith({ - check: "string_format", - format: "ends_with", - ...normalizeParams(params), - suffix - }); -} -function _overwrite(tx) { - return new $ZodCheckOverwrite({ - check: "overwrite", - tx - }); -} -function _normalize(form) { - return _overwrite((input) => input.normalize(form)); -} -function _trim() { - return _overwrite((input) => input.trim()); -} -function _toLowerCase() { - return _overwrite((input) => input.toLowerCase()); -} -function _toUpperCase() { - return _overwrite((input) => input.toUpperCase()); -} -function _array(Class, element, params) { - return new Class({ - type: "array", - element, - ...normalizeParams(params) - }); -} -function _custom(Class, fn, _params) { - const norm = normalizeParams(_params); - norm.abort ?? (norm.abort = true); - return new Class({ - type: "custom", - check: "custom", - fn, - ...norm - }); -} -function _refine(Class, fn, _params) { - return new Class({ - type: "custom", - check: "custom", - fn, - ...normalizeParams(_params) - }); -} -//#endregion -//#region node_modules/zod/v4/core/to-json-schema.js -var JSONSchemaGenerator = class { - constructor(params) { - this.counter = 0; - this.metadataRegistry = params?.metadata ?? globalRegistry; - this.target = params?.target ?? "draft-2020-12"; - this.unrepresentable = params?.unrepresentable ?? "throw"; - this.override = params?.override ?? (() => {}); - this.io = params?.io ?? "output"; - this.seen = /* @__PURE__ */ new Map(); - } - process(schema, _params = { - path: [], - schemaPath: [] - }) { - var _a; - const def = schema._zod.def; - const formatMap = { - guid: "uuid", - url: "uri", - datetime: "date-time", - json_string: "json-string", - regex: "" - }; - const seen = this.seen.get(schema); - if (seen) { - seen.count++; - if (_params.schemaPath.includes(schema)) seen.cycle = _params.path; - return seen.schema; - } - const result = { - schema: {}, - count: 1, - cycle: void 0, - path: _params.path - }; - this.seen.set(schema, result); - const overrideSchema = schema._zod.toJSONSchema?.(); - if (overrideSchema) result.schema = overrideSchema; - else { - const params = { - ..._params, - schemaPath: [..._params.schemaPath, schema], - path: _params.path - }; - const parent = schema._zod.parent; - if (parent) { - result.ref = parent; - this.process(parent, params); - this.seen.get(parent).isParent = true; - } else { - const _json = result.schema; - switch (def.type) { - case "string": { - const json = _json; - json.type = "string"; - const { minimum, maximum, format, patterns, contentEncoding } = schema._zod.bag; - if (typeof minimum === "number") json.minLength = minimum; - if (typeof maximum === "number") json.maxLength = maximum; - if (format) { - json.format = formatMap[format] ?? format; - if (json.format === "") delete json.format; - } - if (contentEncoding) json.contentEncoding = contentEncoding; - if (patterns && patterns.size > 0) { - const regexes = [...patterns]; - if (regexes.length === 1) json.pattern = regexes[0].source; - else if (regexes.length > 1) result.schema.allOf = [...regexes.map((regex) => ({ - ...this.target === "draft-7" ? { type: "string" } : {}, - pattern: regex.source - }))]; - } - break; - } - case "number": { - const json = _json; - const { minimum, maximum, format, multipleOf, exclusiveMaximum, exclusiveMinimum } = schema._zod.bag; - if (typeof format === "string" && format.includes("int")) json.type = "integer"; - else json.type = "number"; - if (typeof exclusiveMinimum === "number") json.exclusiveMinimum = exclusiveMinimum; - if (typeof minimum === "number") { - json.minimum = minimum; - if (typeof exclusiveMinimum === "number") if (exclusiveMinimum >= minimum) delete json.minimum; - else delete json.exclusiveMinimum; - } - if (typeof exclusiveMaximum === "number") json.exclusiveMaximum = exclusiveMaximum; - if (typeof maximum === "number") { - json.maximum = maximum; - if (typeof exclusiveMaximum === "number") if (exclusiveMaximum <= maximum) delete json.maximum; - else delete json.exclusiveMaximum; - } - if (typeof multipleOf === "number") json.multipleOf = multipleOf; - break; - } - case "boolean": { - const json = _json; - json.type = "boolean"; - break; - } - case "bigint": - if (this.unrepresentable === "throw") throw new Error("BigInt cannot be represented in JSON Schema"); - break; - case "symbol": - if (this.unrepresentable === "throw") throw new Error("Symbols cannot be represented in JSON Schema"); - break; - case "null": - _json.type = "null"; - break; - case "any": break; - case "unknown": break; - case "undefined": - if (this.unrepresentable === "throw") throw new Error("Undefined cannot be represented in JSON Schema"); - break; - case "void": - if (this.unrepresentable === "throw") throw new Error("Void cannot be represented in JSON Schema"); - break; - case "never": - _json.not = {}; - break; - case "date": - if (this.unrepresentable === "throw") throw new Error("Date cannot be represented in JSON Schema"); - break; - case "array": { - const json = _json; - const { minimum, maximum } = schema._zod.bag; - if (typeof minimum === "number") json.minItems = minimum; - if (typeof maximum === "number") json.maxItems = maximum; - json.type = "array"; - json.items = this.process(def.element, { - ...params, - path: [...params.path, "items"] - }); - break; - } - case "object": { - const json = _json; - json.type = "object"; - json.properties = {}; - const shape = def.shape; - for (const key in shape) json.properties[key] = this.process(shape[key], { - ...params, - path: [ - ...params.path, - "properties", - key - ] - }); - const allKeys = new Set(Object.keys(shape)); - const requiredKeys = new Set([...allKeys].filter((key) => { - const v = def.shape[key]._zod; - if (this.io === "input") return v.optin === void 0; - else return v.optout === void 0; - })); - if (requiredKeys.size > 0) json.required = Array.from(requiredKeys); - if (def.catchall?._zod.def.type === "never") json.additionalProperties = false; - else if (!def.catchall) { - if (this.io === "output") json.additionalProperties = false; - } else if (def.catchall) json.additionalProperties = this.process(def.catchall, { - ...params, - path: [...params.path, "additionalProperties"] - }); - break; - } - case "union": { - const json = _json; - json.anyOf = def.options.map((x, i) => this.process(x, { - ...params, - path: [ - ...params.path, - "anyOf", - i - ] - })); - break; - } - case "intersection": { - const json = _json; - const a = this.process(def.left, { - ...params, - path: [ - ...params.path, - "allOf", - 0 - ] - }); - const b = this.process(def.right, { - ...params, - path: [ - ...params.path, - "allOf", - 1 - ] - }); - const isSimpleIntersection = (val) => "allOf" in val && Object.keys(val).length === 1; - json.allOf = [...isSimpleIntersection(a) ? a.allOf : [a], ...isSimpleIntersection(b) ? b.allOf : [b]]; - break; - } - case "tuple": { - const json = _json; - json.type = "array"; - const prefixItems = def.items.map((x, i) => this.process(x, { - ...params, - path: [ - ...params.path, - "prefixItems", - i - ] - })); - if (this.target === "draft-2020-12") json.prefixItems = prefixItems; - else json.items = prefixItems; - if (def.rest) { - const rest = this.process(def.rest, { - ...params, - path: [...params.path, "items"] - }); - if (this.target === "draft-2020-12") json.items = rest; - else json.additionalItems = rest; - } - if (def.rest) json.items = this.process(def.rest, { - ...params, - path: [...params.path, "items"] - }); - const { minimum, maximum } = schema._zod.bag; - if (typeof minimum === "number") json.minItems = minimum; - if (typeof maximum === "number") json.maxItems = maximum; - break; - } - case "record": { - const json = _json; - json.type = "object"; - json.propertyNames = this.process(def.keyType, { - ...params, - path: [...params.path, "propertyNames"] - }); - json.additionalProperties = this.process(def.valueType, { - ...params, - path: [...params.path, "additionalProperties"] - }); - break; - } - case "map": - if (this.unrepresentable === "throw") throw new Error("Map cannot be represented in JSON Schema"); - break; - case "set": - if (this.unrepresentable === "throw") throw new Error("Set cannot be represented in JSON Schema"); - break; - case "enum": { - const json = _json; - const values = getEnumValues(def.entries); - if (values.every((v) => typeof v === "number")) json.type = "number"; - if (values.every((v) => typeof v === "string")) json.type = "string"; - json.enum = values; - break; - } - case "literal": { - const json = _json; - const vals = []; - for (const val of def.values) if (val === void 0) { - if (this.unrepresentable === "throw") throw new Error("Literal `undefined` cannot be represented in JSON Schema"); - } else if (typeof val === "bigint") if (this.unrepresentable === "throw") throw new Error("BigInt literals cannot be represented in JSON Schema"); - else vals.push(Number(val)); - else vals.push(val); - if (vals.length === 0) {} else if (vals.length === 1) { - const val = vals[0]; - json.type = val === null ? "null" : typeof val; - json.const = val; - } else { - if (vals.every((v) => typeof v === "number")) json.type = "number"; - if (vals.every((v) => typeof v === "string")) json.type = "string"; - if (vals.every((v) => typeof v === "boolean")) json.type = "string"; - if (vals.every((v) => v === null)) json.type = "null"; - json.enum = vals; - } - break; - } - case "file": { - const json = _json; - const file = { - type: "string", - format: "binary", - contentEncoding: "binary" - }; - const { minimum, maximum, mime } = schema._zod.bag; - if (minimum !== void 0) file.minLength = minimum; - if (maximum !== void 0) file.maxLength = maximum; - if (mime) if (mime.length === 1) { - file.contentMediaType = mime[0]; - Object.assign(json, file); - } else json.anyOf = mime.map((m) => { - return { - ...file, - contentMediaType: m - }; - }); - else Object.assign(json, file); - break; - } - case "transform": - if (this.unrepresentable === "throw") throw new Error("Transforms cannot be represented in JSON Schema"); - break; - case "nullable": - _json.anyOf = [this.process(def.innerType, params), { type: "null" }]; - break; - case "nonoptional": - this.process(def.innerType, params); - result.ref = def.innerType; - break; - case "success": { - const json = _json; - json.type = "boolean"; - break; - } - case "default": - this.process(def.innerType, params); - result.ref = def.innerType; - _json.default = JSON.parse(JSON.stringify(def.defaultValue)); - break; - case "prefault": - this.process(def.innerType, params); - result.ref = def.innerType; - if (this.io === "input") _json._prefault = JSON.parse(JSON.stringify(def.defaultValue)); - break; - case "catch": { - this.process(def.innerType, params); - result.ref = def.innerType; - let catchValue; - try { - catchValue = def.catchValue(void 0); - } catch { - throw new Error("Dynamic catch values are not supported in JSON Schema"); - } - _json.default = catchValue; - break; - } - case "nan": - if (this.unrepresentable === "throw") throw new Error("NaN cannot be represented in JSON Schema"); - break; - case "template_literal": { - const json = _json; - const pattern = schema._zod.pattern; - if (!pattern) throw new Error("Pattern not found in template literal"); - json.type = "string"; - json.pattern = pattern.source; - break; - } - case "pipe": { - const innerType = this.io === "input" ? def.in._zod.def.type === "transform" ? def.out : def.in : def.out; - this.process(innerType, params); - result.ref = innerType; - break; - } - case "readonly": - this.process(def.innerType, params); - result.ref = def.innerType; - _json.readOnly = true; - break; - case "promise": - this.process(def.innerType, params); - result.ref = def.innerType; - break; - case "optional": - this.process(def.innerType, params); - result.ref = def.innerType; - break; - case "lazy": { - const innerType = schema._zod.innerType; - this.process(innerType, params); - result.ref = innerType; - break; - } - case "custom": - if (this.unrepresentable === "throw") throw new Error("Custom types cannot be represented in JSON Schema"); - break; - default: - } - } - } - const meta = this.metadataRegistry.get(schema); - if (meta) Object.assign(result.schema, meta); - if (this.io === "input" && isTransforming(schema)) { - delete result.schema.examples; - delete result.schema.default; - } - if (this.io === "input" && result.schema._prefault) (_a = result.schema).default ?? (_a.default = result.schema._prefault); - delete result.schema._prefault; - return this.seen.get(schema).schema; - } - emit(schema, _params) { - const params = { - cycles: _params?.cycles ?? "ref", - reused: _params?.reused ?? "inline", - external: _params?.external ?? void 0 - }; - const root = this.seen.get(schema); - if (!root) throw new Error("Unprocessed schema. This is a bug in Zod."); - const makeURI = (entry) => { - const defsSegment = this.target === "draft-2020-12" ? "$defs" : "definitions"; - if (params.external) { - const externalId = params.external.registry.get(entry[0])?.id; - const uriGenerator = params.external.uri ?? ((id) => id); - if (externalId) return { ref: uriGenerator(externalId) }; - const id = entry[1].defId ?? entry[1].schema.id ?? `schema${this.counter++}`; - entry[1].defId = id; - return { - defId: id, - ref: `${uriGenerator("__shared")}#/${defsSegment}/${id}` - }; - } - if (entry[1] === root) return { ref: "#" }; - const defUriPrefix = `#/${defsSegment}/`; - const defId = entry[1].schema.id ?? `__schema${this.counter++}`; - return { - defId, - ref: defUriPrefix + defId - }; - }; - const extractToDef = (entry) => { - if (entry[1].schema.$ref) return; - const seen = entry[1]; - const { ref, defId } = makeURI(entry); - seen.def = { ...seen.schema }; - if (defId) seen.defId = defId; - const schema = seen.schema; - for (const key in schema) delete schema[key]; - schema.$ref = ref; - }; - if (params.cycles === "throw") for (const entry of this.seen.entries()) { - const seen = entry[1]; - if (seen.cycle) throw new Error(`Cycle detected: #/${seen.cycle?.join("/")}/ - -Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`); - } - for (const entry of this.seen.entries()) { - const seen = entry[1]; - if (schema === entry[0]) { - extractToDef(entry); - continue; - } - if (params.external) { - const ext = params.external.registry.get(entry[0])?.id; - if (schema !== entry[0] && ext) { - extractToDef(entry); - continue; - } - } - if (this.metadataRegistry.get(entry[0])?.id) { - extractToDef(entry); - continue; - } - if (seen.cycle) { - extractToDef(entry); - continue; - } - if (seen.count > 1) { - if (params.reused === "ref") { - extractToDef(entry); - continue; - } - } - } - const flattenRef = (zodSchema, params) => { - const seen = this.seen.get(zodSchema); - const schema = seen.def ?? seen.schema; - const _cached = { ...schema }; - if (seen.ref === null) return; - const ref = seen.ref; - seen.ref = null; - if (ref) { - flattenRef(ref, params); - const refSchema = this.seen.get(ref).schema; - if (refSchema.$ref && params.target === "draft-7") { - schema.allOf = schema.allOf ?? []; - schema.allOf.push(refSchema); - } else { - Object.assign(schema, refSchema); - Object.assign(schema, _cached); - } - } - if (!seen.isParent) this.override({ - zodSchema, - jsonSchema: schema, - path: seen.path ?? [] - }); - }; - for (const entry of [...this.seen.entries()].reverse()) flattenRef(entry[0], { target: this.target }); - const result = {}; - if (this.target === "draft-2020-12") result.$schema = "https://json-schema.org/draft/2020-12/schema"; - else if (this.target === "draft-7") result.$schema = "http://json-schema.org/draft-07/schema#"; - else console.warn(`Invalid target: ${this.target}`); - if (params.external?.uri) { - const id = params.external.registry.get(schema)?.id; - if (!id) throw new Error("Schema is missing an `id` property"); - result.$id = params.external.uri(id); - } - Object.assign(result, root.def); - const defs = params.external?.defs ?? {}; - for (const entry of this.seen.entries()) { - const seen = entry[1]; - if (seen.def && seen.defId) defs[seen.defId] = seen.def; - } - if (params.external) {} else if (Object.keys(defs).length > 0) if (this.target === "draft-2020-12") result.$defs = defs; - else result.definitions = defs; - try { - return JSON.parse(JSON.stringify(result)); - } catch (_err) { - throw new Error("Error converting schema to JSON."); - } - } -}; -function toJSONSchema(input, _params) { - if (input instanceof $ZodRegistry) { - const gen = new JSONSchemaGenerator(_params); - const defs = {}; - for (const entry of input._idmap.entries()) { - const [_, schema] = entry; - gen.process(schema); - } - const schemas = {}; - const external = { - registry: input, - uri: _params?.uri, - defs - }; - for (const entry of input._idmap.entries()) { - const [key, schema] = entry; - schemas[key] = gen.emit(schema, { - ..._params, - external - }); - } - if (Object.keys(defs).length > 0) schemas.__shared = { [gen.target === "draft-2020-12" ? "$defs" : "definitions"]: defs }; - return { schemas }; - } - const gen = new JSONSchemaGenerator(_params); - gen.process(input); - return gen.emit(input, _params); -} -function isTransforming(_schema, _ctx) { - const ctx = _ctx ?? { seen: /* @__PURE__ */ new Set() }; - if (ctx.seen.has(_schema)) return false; - ctx.seen.add(_schema); - const def = _schema._zod.def; - switch (def.type) { - case "string": - case "number": - case "bigint": - case "boolean": - case "date": - case "symbol": - case "undefined": - case "null": - case "any": - case "unknown": - case "never": - case "void": - case "literal": - case "enum": - case "nan": - case "file": - case "template_literal": return false; - case "array": return isTransforming(def.element, ctx); - case "object": - for (const key in def.shape) if (isTransforming(def.shape[key], ctx)) return true; - return false; - case "union": - for (const option of def.options) if (isTransforming(option, ctx)) return true; - return false; - case "intersection": return isTransforming(def.left, ctx) || isTransforming(def.right, ctx); - case "tuple": - for (const item of def.items) if (isTransforming(item, ctx)) return true; - if (def.rest && isTransforming(def.rest, ctx)) return true; - return false; - case "record": return isTransforming(def.keyType, ctx) || isTransforming(def.valueType, ctx); - case "map": return isTransforming(def.keyType, ctx) || isTransforming(def.valueType, ctx); - case "set": return isTransforming(def.valueType, ctx); - case "promise": - case "optional": - case "nonoptional": - case "nullable": - case "readonly": return isTransforming(def.innerType, ctx); - case "lazy": return isTransforming(def.getter(), ctx); - case "default": return isTransforming(def.innerType, ctx); - case "prefault": return isTransforming(def.innerType, ctx); - case "custom": return false; - case "transform": return true; - case "pipe": return isTransforming(def.in, ctx) || isTransforming(def.out, ctx); - case "success": return false; - case "catch": return false; - default: - } - throw new Error(`Unknown schema type: ${def.type}`); -} -//#endregion -//#region node_modules/zod/v4/classic/iso.js -const ZodISODateTime = /*@__PURE__*/ $constructor("ZodISODateTime", (inst, def) => { - $ZodISODateTime.init(inst, def); - ZodStringFormat.init(inst, def); -}); -function datetime(params) { - return _isoDateTime(ZodISODateTime, params); -} -const ZodISODate = /*@__PURE__*/ $constructor("ZodISODate", (inst, def) => { - $ZodISODate.init(inst, def); - ZodStringFormat.init(inst, def); -}); -function date(params) { - return _isoDate(ZodISODate, params); -} -const ZodISOTime = /*@__PURE__*/ $constructor("ZodISOTime", (inst, def) => { - $ZodISOTime.init(inst, def); - ZodStringFormat.init(inst, def); -}); -function time(params) { - return _isoTime(ZodISOTime, params); -} -const ZodISODuration = /*@__PURE__*/ $constructor("ZodISODuration", (inst, def) => { - $ZodISODuration.init(inst, def); - ZodStringFormat.init(inst, def); -}); -function duration(params) { - return _isoDuration(ZodISODuration, params); -} -//#endregion -//#region node_modules/zod/v4/classic/errors.js -const initializer = (inst, issues) => { - $ZodError.init(inst, issues); - inst.name = "ZodError"; - Object.defineProperties(inst, { - format: { value: (mapper) => formatError(inst, mapper) }, - flatten: { value: (mapper) => flattenError(inst, mapper) }, - addIssue: { value: (issue) => inst.issues.push(issue) }, - addIssues: { value: (issues) => inst.issues.push(...issues) }, - isEmpty: { get() { - return inst.issues.length === 0; - } } - }); -}; -$constructor("ZodError", initializer); -const ZodRealError = $constructor("ZodError", initializer, { Parent: Error }); -//#endregion -//#region node_modules/zod/v4/classic/parse.js -const parse = /* @__PURE__ */ _parse$1(ZodRealError); -const parseAsync = /* @__PURE__ */ _parseAsync(ZodRealError); -const safeParse = /* @__PURE__ */ _safeParse(ZodRealError); -const safeParseAsync = /* @__PURE__ */ _safeParseAsync(ZodRealError); -//#endregion -//#region node_modules/zod/v4/classic/schemas.js -const ZodType$1 = /*@__PURE__*/ $constructor("ZodType", (inst, def) => { - $ZodType.init(inst, def); - inst.def = def; - Object.defineProperty(inst, "_def", { value: def }); - inst.check = (...checks) => { - return inst.clone({ - ...def, - checks: [...def.checks ?? [], ...checks.map((ch) => typeof ch === "function" ? { _zod: { - check: ch, - def: { check: "custom" }, - onattach: [] - } } : ch)] - }); - }; - inst.clone = (def, params) => clone(inst, def, params); - inst.brand = () => inst; - inst.register = ((reg, meta) => { - reg.add(inst, meta); - return inst; - }); - inst.parse = (data, params) => parse(inst, data, params, { callee: inst.parse }); - inst.safeParse = (data, params) => safeParse(inst, data, params); - inst.parseAsync = async (data, params) => parseAsync(inst, data, params, { callee: inst.parseAsync }); - inst.safeParseAsync = async (data, params) => safeParseAsync(inst, data, params); - inst.spa = inst.safeParseAsync; - inst.refine = (check, params) => inst.check(refine(check, params)); - inst.superRefine = (refinement) => inst.check(superRefine(refinement)); - inst.overwrite = (fn) => inst.check(_overwrite(fn)); - inst.optional = () => optional(inst); - inst.nullable = () => nullable(inst); - inst.nullish = () => optional(nullable(inst)); - inst.nonoptional = (params) => nonoptional(inst, params); - inst.array = () => array(inst); - inst.or = (arg) => union([inst, arg]); - inst.and = (arg) => intersection(inst, arg); - inst.transform = (tx) => pipe(inst, transform(tx)); - inst.default = (def) => _default(inst, def); - inst.prefault = (def) => prefault(inst, def); - inst.catch = (params) => _catch(inst, params); - inst.pipe = (target) => pipe(inst, target); - inst.readonly = () => readonly(inst); - inst.describe = (description) => { - const cl = inst.clone(); - globalRegistry.add(cl, { description }); - return cl; - }; - Object.defineProperty(inst, "description", { - get() { - return globalRegistry.get(inst)?.description; - }, - configurable: true - }); - inst.meta = (...args) => { - if (args.length === 0) return globalRegistry.get(inst); - const cl = inst.clone(); - globalRegistry.add(cl, args[0]); - return cl; - }; - inst.isOptional = () => inst.safeParse(void 0).success; - inst.isNullable = () => inst.safeParse(null).success; - return inst; -}); -/** @internal */ -const _ZodString = /*@__PURE__*/ $constructor("_ZodString", (inst, def) => { - $ZodString.init(inst, def); - ZodType$1.init(inst, def); - const bag = inst._zod.bag; - inst.format = bag.format ?? null; - inst.minLength = bag.minimum ?? null; - inst.maxLength = bag.maximum ?? null; - inst.regex = (...args) => inst.check(_regex(...args)); - inst.includes = (...args) => inst.check(_includes(...args)); - inst.startsWith = (...args) => inst.check(_startsWith(...args)); - inst.endsWith = (...args) => inst.check(_endsWith(...args)); - inst.min = (...args) => inst.check(_minLength(...args)); - inst.max = (...args) => inst.check(_maxLength(...args)); - inst.length = (...args) => inst.check(_length(...args)); - inst.nonempty = (...args) => inst.check(_minLength(1, ...args)); - inst.lowercase = (params) => inst.check(_lowercase(params)); - inst.uppercase = (params) => inst.check(_uppercase(params)); - inst.trim = () => inst.check(_trim()); - inst.normalize = (...args) => inst.check(_normalize(...args)); - inst.toLowerCase = () => inst.check(_toLowerCase()); - inst.toUpperCase = () => inst.check(_toUpperCase()); -}); -const ZodString$1 = /*@__PURE__*/ $constructor("ZodString", (inst, def) => { - $ZodString.init(inst, def); - _ZodString.init(inst, def); - inst.email = (params) => inst.check(_email(ZodEmail, params)); - inst.url = (params) => inst.check(_url(ZodURL, params)); - inst.jwt = (params) => inst.check(_jwt(ZodJWT, params)); - inst.emoji = (params) => inst.check(_emoji(ZodEmoji, params)); - inst.guid = (params) => inst.check(_guid(ZodGUID, params)); - inst.uuid = (params) => inst.check(_uuid(ZodUUID, params)); - inst.uuidv4 = (params) => inst.check(_uuidv4(ZodUUID, params)); - inst.uuidv6 = (params) => inst.check(_uuidv6(ZodUUID, params)); - inst.uuidv7 = (params) => inst.check(_uuidv7(ZodUUID, params)); - inst.nanoid = (params) => inst.check(_nanoid(ZodNanoID, params)); - inst.guid = (params) => inst.check(_guid(ZodGUID, params)); - inst.cuid = (params) => inst.check(_cuid(ZodCUID, params)); - inst.cuid2 = (params) => inst.check(_cuid2(ZodCUID2, params)); - inst.ulid = (params) => inst.check(_ulid(ZodULID, params)); - inst.base64 = (params) => inst.check(_base64(ZodBase64, params)); - inst.base64url = (params) => inst.check(_base64url(ZodBase64URL, params)); - inst.xid = (params) => inst.check(_xid(ZodXID, params)); - inst.ksuid = (params) => inst.check(_ksuid(ZodKSUID, params)); - inst.ipv4 = (params) => inst.check(_ipv4(ZodIPv4, params)); - inst.ipv6 = (params) => inst.check(_ipv6(ZodIPv6, params)); - inst.cidrv4 = (params) => inst.check(_cidrv4(ZodCIDRv4, params)); - inst.cidrv6 = (params) => inst.check(_cidrv6(ZodCIDRv6, params)); - inst.e164 = (params) => inst.check(_e164(ZodE164, params)); - inst.datetime = (params) => inst.check(datetime(params)); - inst.date = (params) => inst.check(date(params)); - inst.time = (params) => inst.check(time(params)); - inst.duration = (params) => inst.check(duration(params)); -}); -function string(params) { - return _string(ZodString$1, params); -} -const ZodStringFormat = /*@__PURE__*/ $constructor("ZodStringFormat", (inst, def) => { - $ZodStringFormat.init(inst, def); - _ZodString.init(inst, def); -}); -const ZodEmail = /*@__PURE__*/ $constructor("ZodEmail", (inst, def) => { - $ZodEmail.init(inst, def); - ZodStringFormat.init(inst, def); -}); -const ZodGUID = /*@__PURE__*/ $constructor("ZodGUID", (inst, def) => { - $ZodGUID.init(inst, def); - ZodStringFormat.init(inst, def); -}); -const ZodUUID = /*@__PURE__*/ $constructor("ZodUUID", (inst, def) => { - $ZodUUID.init(inst, def); - ZodStringFormat.init(inst, def); -}); -const ZodURL = /*@__PURE__*/ $constructor("ZodURL", (inst, def) => { - $ZodURL.init(inst, def); - ZodStringFormat.init(inst, def); -}); -const ZodEmoji = /*@__PURE__*/ $constructor("ZodEmoji", (inst, def) => { - $ZodEmoji.init(inst, def); - ZodStringFormat.init(inst, def); -}); -const ZodNanoID = /*@__PURE__*/ $constructor("ZodNanoID", (inst, def) => { - $ZodNanoID.init(inst, def); - ZodStringFormat.init(inst, def); -}); -const ZodCUID = /*@__PURE__*/ $constructor("ZodCUID", (inst, def) => { - $ZodCUID.init(inst, def); - ZodStringFormat.init(inst, def); -}); -const ZodCUID2 = /*@__PURE__*/ $constructor("ZodCUID2", (inst, def) => { - $ZodCUID2.init(inst, def); - ZodStringFormat.init(inst, def); -}); -const ZodULID = /*@__PURE__*/ $constructor("ZodULID", (inst, def) => { - $ZodULID.init(inst, def); - ZodStringFormat.init(inst, def); -}); -const ZodXID = /*@__PURE__*/ $constructor("ZodXID", (inst, def) => { - $ZodXID.init(inst, def); - ZodStringFormat.init(inst, def); -}); -const ZodKSUID = /*@__PURE__*/ $constructor("ZodKSUID", (inst, def) => { - $ZodKSUID.init(inst, def); - ZodStringFormat.init(inst, def); -}); -const ZodIPv4 = /*@__PURE__*/ $constructor("ZodIPv4", (inst, def) => { - $ZodIPv4.init(inst, def); - ZodStringFormat.init(inst, def); -}); -const ZodIPv6 = /*@__PURE__*/ $constructor("ZodIPv6", (inst, def) => { - $ZodIPv6.init(inst, def); - ZodStringFormat.init(inst, def); -}); -const ZodCIDRv4 = /*@__PURE__*/ $constructor("ZodCIDRv4", (inst, def) => { - $ZodCIDRv4.init(inst, def); - ZodStringFormat.init(inst, def); -}); -const ZodCIDRv6 = /*@__PURE__*/ $constructor("ZodCIDRv6", (inst, def) => { - $ZodCIDRv6.init(inst, def); - ZodStringFormat.init(inst, def); -}); -const ZodBase64 = /*@__PURE__*/ $constructor("ZodBase64", (inst, def) => { - $ZodBase64.init(inst, def); - ZodStringFormat.init(inst, def); -}); -const ZodBase64URL = /*@__PURE__*/ $constructor("ZodBase64URL", (inst, def) => { - $ZodBase64URL.init(inst, def); - ZodStringFormat.init(inst, def); -}); -const ZodE164 = /*@__PURE__*/ $constructor("ZodE164", (inst, def) => { - $ZodE164.init(inst, def); - ZodStringFormat.init(inst, def); -}); -const ZodJWT = /*@__PURE__*/ $constructor("ZodJWT", (inst, def) => { - $ZodJWT.init(inst, def); - ZodStringFormat.init(inst, def); -}); -const ZodNumber$1 = /*@__PURE__*/ $constructor("ZodNumber", (inst, def) => { - $ZodNumber.init(inst, def); - ZodType$1.init(inst, def); - inst.gt = (value, params) => inst.check(_gt(value, params)); - inst.gte = (value, params) => inst.check(_gte(value, params)); - inst.min = (value, params) => inst.check(_gte(value, params)); - inst.lt = (value, params) => inst.check(_lt(value, params)); - inst.lte = (value, params) => inst.check(_lte(value, params)); - inst.max = (value, params) => inst.check(_lte(value, params)); - inst.int = (params) => inst.check(int(params)); - inst.safe = (params) => inst.check(int(params)); - inst.positive = (params) => inst.check(_gt(0, params)); - inst.nonnegative = (params) => inst.check(_gte(0, params)); - inst.negative = (params) => inst.check(_lt(0, params)); - inst.nonpositive = (params) => inst.check(_lte(0, params)); - inst.multipleOf = (value, params) => inst.check(_multipleOf(value, params)); - inst.step = (value, params) => inst.check(_multipleOf(value, params)); - inst.finite = () => inst; - const bag = inst._zod.bag; - inst.minValue = Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null; - inst.maxValue = Math.min(bag.maximum ?? Number.POSITIVE_INFINITY, bag.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null; - inst.isInt = (bag.format ?? "").includes("int") || Number.isSafeInteger(bag.multipleOf ?? .5); - inst.isFinite = true; - inst.format = bag.format ?? null; -}); -function number(params) { - return _number(ZodNumber$1, params); -} -const ZodNumberFormat = /*@__PURE__*/ $constructor("ZodNumberFormat", (inst, def) => { - $ZodNumberFormat.init(inst, def); - ZodNumber$1.init(inst, def); -}); -function int(params) { - return _int(ZodNumberFormat, params); -} -const ZodBoolean$1 = /*@__PURE__*/ $constructor("ZodBoolean", (inst, def) => { - $ZodBoolean.init(inst, def); - ZodType$1.init(inst, def); -}); -function boolean(params) { - return _boolean(ZodBoolean$1, params); -} -const ZodNull$1 = /*@__PURE__*/ $constructor("ZodNull", (inst, def) => { - $ZodNull.init(inst, def); - ZodType$1.init(inst, def); -}); -function _null(params) { - return _null$1(ZodNull$1, params); -} -const ZodAny$1 = /*@__PURE__*/ $constructor("ZodAny", (inst, def) => { - $ZodAny.init(inst, def); - ZodType$1.init(inst, def); -}); -function any() { - return _any(ZodAny$1); -} -const ZodUnknown$1 = /*@__PURE__*/ $constructor("ZodUnknown", (inst, def) => { - $ZodUnknown.init(inst, def); - ZodType$1.init(inst, def); -}); -function unknown() { - return _unknown(ZodUnknown$1); -} -const ZodNever$1 = /*@__PURE__*/ $constructor("ZodNever", (inst, def) => { - $ZodNever.init(inst, def); - ZodType$1.init(inst, def); -}); -function never(params) { - return _never(ZodNever$1, params); -} -const ZodArray$1 = /*@__PURE__*/ $constructor("ZodArray", (inst, def) => { - $ZodArray.init(inst, def); - ZodType$1.init(inst, def); - inst.element = def.element; - inst.min = (minLength, params) => inst.check(_minLength(minLength, params)); - inst.nonempty = (params) => inst.check(_minLength(1, params)); - inst.max = (maxLength, params) => inst.check(_maxLength(maxLength, params)); - inst.length = (len, params) => inst.check(_length(len, params)); - inst.unwrap = () => inst.element; -}); -function array(element, params) { - return _array(ZodArray$1, element, params); -} -const ZodObject$1 = /*@__PURE__*/ $constructor("ZodObject", (inst, def) => { - $ZodObject.init(inst, def); - ZodType$1.init(inst, def); - defineLazy(inst, "shape", () => def.shape); - inst.keyof = () => _enum(Object.keys(inst._zod.def.shape)); - inst.catchall = (catchall) => inst.clone({ - ...inst._zod.def, - catchall - }); - inst.passthrough = () => inst.clone({ - ...inst._zod.def, - catchall: unknown() - }); - inst.loose = () => inst.clone({ - ...inst._zod.def, - catchall: unknown() - }); - inst.strict = () => inst.clone({ - ...inst._zod.def, - catchall: never() - }); - inst.strip = () => inst.clone({ - ...inst._zod.def, - catchall: void 0 - }); - inst.extend = (incoming) => { - return extend(inst, incoming); - }; - inst.merge = (other) => merge(inst, other); - inst.pick = (mask) => pick(inst, mask); - inst.omit = (mask) => omit(inst, mask); - inst.partial = (...args) => partial(ZodOptional$1, inst, args[0]); - inst.required = (...args) => required(ZodNonOptional, inst, args[0]); -}); -function object(shape, params) { - const def = { - type: "object", - get shape() { - assignProp(this, "shape", { ...shape }); - return this.shape; - }, - ...normalizeParams(params) - }; - return new ZodObject$1(def); -} -function strictObject(shape, params) { - return new ZodObject$1({ - type: "object", - get shape() { - assignProp(this, "shape", { ...shape }); - return this.shape; - }, - catchall: never(), - ...normalizeParams(params) - }); -} -const ZodUnion$1 = /*@__PURE__*/ $constructor("ZodUnion", (inst, def) => { - $ZodUnion.init(inst, def); - ZodType$1.init(inst, def); - inst.options = def.options; -}); -function union(options, params) { - return new ZodUnion$1({ - type: "union", - options, - ...normalizeParams(params) - }); -} -const ZodDiscriminatedUnion$1 = /*@__PURE__*/ $constructor("ZodDiscriminatedUnion", (inst, def) => { - ZodUnion$1.init(inst, def); - $ZodDiscriminatedUnion.init(inst, def); -}); -function discriminatedUnion(discriminator, options, params) { - return new ZodDiscriminatedUnion$1({ - type: "union", - options, - discriminator, - ...normalizeParams(params) - }); -} -const ZodIntersection$1 = /*@__PURE__*/ $constructor("ZodIntersection", (inst, def) => { - $ZodIntersection.init(inst, def); - ZodType$1.init(inst, def); -}); -function intersection(left, right) { - return new ZodIntersection$1({ - type: "intersection", - left, - right - }); -} -const ZodRecord$1 = /*@__PURE__*/ $constructor("ZodRecord", (inst, def) => { - $ZodRecord.init(inst, def); - ZodType$1.init(inst, def); - inst.keyType = def.keyType; - inst.valueType = def.valueType; -}); -function record(keyType, valueType, params) { - return new ZodRecord$1({ - type: "record", - keyType, - valueType, - ...normalizeParams(params) - }); -} -const ZodEnum$1 = /*@__PURE__*/ $constructor("ZodEnum", (inst, def) => { - $ZodEnum.init(inst, def); - ZodType$1.init(inst, def); - inst.enum = def.entries; - inst.options = Object.values(def.entries); - const keys = new Set(Object.keys(def.entries)); - inst.extract = (values, params) => { - const newEntries = {}; - for (const value of values) if (keys.has(value)) newEntries[value] = def.entries[value]; - else throw new Error(`Key ${value} not found in enum`); - return new ZodEnum$1({ - ...def, - checks: [], - ...normalizeParams(params), - entries: newEntries - }); - }; - inst.exclude = (values, params) => { - const newEntries = { ...def.entries }; - for (const value of values) if (keys.has(value)) delete newEntries[value]; - else throw new Error(`Key ${value} not found in enum`); - return new ZodEnum$1({ - ...def, - checks: [], - ...normalizeParams(params), - entries: newEntries - }); - }; -}); -function _enum(values, params) { - const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values; - return new ZodEnum$1({ - type: "enum", - entries, - ...normalizeParams(params) - }); -} -const ZodLiteral$1 = /*@__PURE__*/ $constructor("ZodLiteral", (inst, def) => { - $ZodLiteral.init(inst, def); - ZodType$1.init(inst, def); - inst.values = new Set(def.values); - Object.defineProperty(inst, "value", { get() { - if (def.values.length > 1) throw new Error("This schema contains multiple valid literal values. Use `.values` instead."); - return def.values[0]; - } }); -}); -function literal(value, params) { - return new ZodLiteral$1({ - type: "literal", - values: Array.isArray(value) ? value : [value], - ...normalizeParams(params) - }); -} -const ZodTransform = /*@__PURE__*/ $constructor("ZodTransform", (inst, def) => { - $ZodTransform.init(inst, def); - ZodType$1.init(inst, def); - inst._zod.parse = (payload, _ctx) => { - payload.addIssue = (issue$2) => { - if (typeof issue$2 === "string") payload.issues.push(issue(issue$2, payload.value, def)); - else { - const _issue = issue$2; - if (_issue.fatal) _issue.continue = false; - _issue.code ?? (_issue.code = "custom"); - _issue.input ?? (_issue.input = payload.value); - _issue.inst ?? (_issue.inst = inst); - _issue.continue ?? (_issue.continue = true); - payload.issues.push(issue(_issue)); - } - }; - const output = def.transform(payload.value, payload); - if (output instanceof Promise) return output.then((output) => { - payload.value = output; - return payload; - }); - payload.value = output; - return payload; - }; -}); -function transform(fn) { - return new ZodTransform({ - type: "transform", - transform: fn - }); -} -const ZodOptional$1 = /*@__PURE__*/ $constructor("ZodOptional", (inst, def) => { - $ZodOptional.init(inst, def); - ZodType$1.init(inst, def); - inst.unwrap = () => inst._zod.def.innerType; -}); -function optional(innerType) { - return new ZodOptional$1({ - type: "optional", - innerType - }); -} -const ZodNullable$1 = /*@__PURE__*/ $constructor("ZodNullable", (inst, def) => { - $ZodNullable.init(inst, def); - ZodType$1.init(inst, def); - inst.unwrap = () => inst._zod.def.innerType; -}); -function nullable(innerType) { - return new ZodNullable$1({ - type: "nullable", - innerType - }); -} -const ZodDefault$1 = /*@__PURE__*/ $constructor("ZodDefault", (inst, def) => { - $ZodDefault.init(inst, def); - ZodType$1.init(inst, def); - inst.unwrap = () => inst._zod.def.innerType; - inst.removeDefault = inst.unwrap; -}); -function _default(innerType, defaultValue) { - return new ZodDefault$1({ - type: "default", - innerType, - get defaultValue() { - return typeof defaultValue === "function" ? defaultValue() : defaultValue; - } - }); -} -const ZodPrefault = /*@__PURE__*/ $constructor("ZodPrefault", (inst, def) => { - $ZodPrefault.init(inst, def); - ZodType$1.init(inst, def); - inst.unwrap = () => inst._zod.def.innerType; -}); -function prefault(innerType, defaultValue) { - return new ZodPrefault({ - type: "prefault", - innerType, - get defaultValue() { - return typeof defaultValue === "function" ? defaultValue() : defaultValue; - } - }); -} -const ZodNonOptional = /*@__PURE__*/ $constructor("ZodNonOptional", (inst, def) => { - $ZodNonOptional.init(inst, def); - ZodType$1.init(inst, def); - inst.unwrap = () => inst._zod.def.innerType; -}); -function nonoptional(innerType, params) { - return new ZodNonOptional({ - type: "nonoptional", - innerType, - ...normalizeParams(params) - }); -} -const ZodCatch$1 = /*@__PURE__*/ $constructor("ZodCatch", (inst, def) => { - $ZodCatch.init(inst, def); - ZodType$1.init(inst, def); - inst.unwrap = () => inst._zod.def.innerType; - inst.removeCatch = inst.unwrap; -}); -function _catch(innerType, catchValue) { - return new ZodCatch$1({ - type: "catch", - innerType, - catchValue: typeof catchValue === "function" ? catchValue : () => catchValue - }); -} -const ZodPipe = /*@__PURE__*/ $constructor("ZodPipe", (inst, def) => { - $ZodPipe.init(inst, def); - ZodType$1.init(inst, def); - inst.in = def.in; - inst.out = def.out; -}); -function pipe(in_, out) { - return new ZodPipe({ - type: "pipe", - in: in_, - out - }); -} -const ZodReadonly$1 = /*@__PURE__*/ $constructor("ZodReadonly", (inst, def) => { - $ZodReadonly.init(inst, def); - ZodType$1.init(inst, def); -}); -function readonly(innerType) { - return new ZodReadonly$1({ - type: "readonly", - innerType - }); -} -const ZodLazy$1 = /*@__PURE__*/ $constructor("ZodLazy", (inst, def) => { - $ZodLazy.init(inst, def); - ZodType$1.init(inst, def); - inst.unwrap = () => inst._zod.def.getter(); -}); -function lazy(getter) { - return new ZodLazy$1({ - type: "lazy", - getter - }); -} -const ZodCustom = /*@__PURE__*/ $constructor("ZodCustom", (inst, def) => { - $ZodCustom.init(inst, def); - ZodType$1.init(inst, def); -}); -function check(fn) { - const ch = new $ZodCheck({ check: "custom" }); - ch._zod.check = fn; - return ch; -} -function custom(fn, _params) { - return _custom(ZodCustom, fn ?? (() => true), _params); -} -function refine(fn, _params = {}) { - return _refine(ZodCustom, fn, _params); -} -function superRefine(fn) { - const ch = check((payload) => { - payload.addIssue = (issue$1) => { - if (typeof issue$1 === "string") payload.issues.push(issue(issue$1, payload.value, ch._zod.def)); - else { - const _issue = issue$1; - if (_issue.fatal) _issue.continue = false; - _issue.code ?? (_issue.code = "custom"); - _issue.input ?? (_issue.input = payload.value); - _issue.inst ?? (_issue.inst = ch); - _issue.continue ?? (_issue.continue = !ch._zod.def.abort); - payload.issues.push(issue(_issue)); - } - }; - return fn(payload.value, payload); - }); - return ch; -} -function _instanceof(cls, params = { error: `Input not instance of ${cls.name}` }) { - const inst = new ZodCustom({ - type: "custom", - check: "custom", - fn: (data) => data instanceof cls, - abort: true, - ...normalizeParams(params) - }); - inst._zod.bag.Class = cls; - return inst; -} -//#endregion -//#region node_modules/zod/v3/helpers/util.js -var util; -(function(util) { - util.assertEqual = (_) => {}; - function assertIs(_arg) {} - util.assertIs = assertIs; - function assertNever(_x) { - throw new Error(); - } - util.assertNever = assertNever; - util.arrayToEnum = (items) => { - const obj = {}; - for (const item of items) obj[item] = item; - return obj; - }; - util.getValidEnumValues = (obj) => { - const validKeys = util.objectKeys(obj).filter((k) => typeof obj[obj[k]] !== "number"); - const filtered = {}; - for (const k of validKeys) filtered[k] = obj[k]; - return util.objectValues(filtered); - }; - util.objectValues = (obj) => { - return util.objectKeys(obj).map(function(e) { - return obj[e]; - }); - }; - util.objectKeys = typeof Object.keys === "function" ? (obj) => Object.keys(obj) : (object) => { - const keys = []; - for (const key in object) if (Object.prototype.hasOwnProperty.call(object, key)) keys.push(key); - return keys; - }; - util.find = (arr, checker) => { - for (const item of arr) if (checker(item)) return item; - }; - util.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && Number.isFinite(val) && Math.floor(val) === val; - function joinValues(array, separator = " | ") { - return array.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator); - } - util.joinValues = joinValues; - util.jsonStringifyReplacer = (_, value) => { - if (typeof value === "bigint") return value.toString(); - return value; - }; -})(util || (util = {})); -var objectUtil; -(function(objectUtil) { - objectUtil.mergeShapes = (first, second) => { - return { - ...first, - ...second - }; - }; -})(objectUtil || (objectUtil = {})); -const ZodParsedType = util.arrayToEnum([ - "string", - "nan", - "number", - "integer", - "float", - "boolean", - "date", - "bigint", - "symbol", - "function", - "undefined", - "null", - "array", - "object", - "unknown", - "promise", - "void", - "never", - "map", - "set" -]); -const getParsedType = (data) => { - switch (typeof data) { - case "undefined": return ZodParsedType.undefined; - case "string": return ZodParsedType.string; - case "number": return Number.isNaN(data) ? ZodParsedType.nan : ZodParsedType.number; - case "boolean": return ZodParsedType.boolean; - case "function": return ZodParsedType.function; - case "bigint": return ZodParsedType.bigint; - case "symbol": return ZodParsedType.symbol; - case "object": - if (Array.isArray(data)) return ZodParsedType.array; - if (data === null) return ZodParsedType.null; - if (data.then && typeof data.then === "function" && data.catch && typeof data.catch === "function") return ZodParsedType.promise; - if (typeof Map !== "undefined" && data instanceof Map) return ZodParsedType.map; - if (typeof Set !== "undefined" && data instanceof Set) return ZodParsedType.set; - if (typeof Date !== "undefined" && data instanceof Date) return ZodParsedType.date; - return ZodParsedType.object; - default: return ZodParsedType.unknown; - } -}; -//#endregion -//#region node_modules/zod/v3/ZodError.js -const ZodIssueCode = util.arrayToEnum([ - "invalid_type", - "invalid_literal", - "custom", - "invalid_union", - "invalid_union_discriminator", - "invalid_enum_value", - "unrecognized_keys", - "invalid_arguments", - "invalid_return_type", - "invalid_date", - "invalid_string", - "too_small", - "too_big", - "invalid_intersection_types", - "not_multiple_of", - "not_finite" -]); -var ZodError = class ZodError extends Error { - get errors() { - return this.issues; - } - constructor(issues) { - super(); - this.issues = []; - this.addIssue = (sub) => { - this.issues = [...this.issues, sub]; - }; - this.addIssues = (subs = []) => { - this.issues = [...this.issues, ...subs]; - }; - const actualProto = new.target.prototype; - if (Object.setPrototypeOf) Object.setPrototypeOf(this, actualProto); - else this.__proto__ = actualProto; - this.name = "ZodError"; - this.issues = issues; - } - format(_mapper) { - const mapper = _mapper || function(issue) { - return issue.message; - }; - const fieldErrors = { _errors: [] }; - const processError = (error) => { - for (const issue of error.issues) if (issue.code === "invalid_union") issue.unionErrors.map(processError); - else if (issue.code === "invalid_return_type") processError(issue.returnTypeError); - else if (issue.code === "invalid_arguments") processError(issue.argumentsError); - else if (issue.path.length === 0) fieldErrors._errors.push(mapper(issue)); - else { - let curr = fieldErrors; - let i = 0; - while (i < issue.path.length) { - const el = issue.path[i]; - if (!(i === issue.path.length - 1)) curr[el] = curr[el] || { _errors: [] }; - else { - curr[el] = curr[el] || { _errors: [] }; - curr[el]._errors.push(mapper(issue)); - } - curr = curr[el]; - i++; - } - } - }; - processError(this); - return fieldErrors; - } - static assert(value) { - if (!(value instanceof ZodError)) throw new Error(`Not a ZodError: ${value}`); - } - toString() { - return this.message; - } - get message() { - return JSON.stringify(this.issues, util.jsonStringifyReplacer, 2); - } - get isEmpty() { - return this.issues.length === 0; - } - flatten(mapper = (issue) => issue.message) { - const fieldErrors = {}; - const formErrors = []; - for (const sub of this.issues) if (sub.path.length > 0) { - const firstEl = sub.path[0]; - fieldErrors[firstEl] = fieldErrors[firstEl] || []; - fieldErrors[firstEl].push(mapper(sub)); - } else formErrors.push(mapper(sub)); - return { - formErrors, - fieldErrors - }; - } - get formErrors() { - return this.flatten(); - } -}; -ZodError.create = (issues) => { - return new ZodError(issues); -}; -//#endregion -//#region node_modules/zod/v3/locales/en.js -const errorMap = (issue, _ctx) => { - let message; - switch (issue.code) { - case ZodIssueCode.invalid_type: - if (issue.received === ZodParsedType.undefined) message = "Required"; - else message = `Expected ${issue.expected}, received ${issue.received}`; - break; - case ZodIssueCode.invalid_literal: - message = `Invalid literal value, expected ${JSON.stringify(issue.expected, util.jsonStringifyReplacer)}`; - break; - case ZodIssueCode.unrecognized_keys: - message = `Unrecognized key(s) in object: ${util.joinValues(issue.keys, ", ")}`; - break; - case ZodIssueCode.invalid_union: - message = `Invalid input`; - break; - case ZodIssueCode.invalid_union_discriminator: - message = `Invalid discriminator value. Expected ${util.joinValues(issue.options)}`; - break; - case ZodIssueCode.invalid_enum_value: - message = `Invalid enum value. Expected ${util.joinValues(issue.options)}, received '${issue.received}'`; - break; - case ZodIssueCode.invalid_arguments: - message = `Invalid function arguments`; - break; - case ZodIssueCode.invalid_return_type: - message = `Invalid function return type`; - break; - case ZodIssueCode.invalid_date: - message = `Invalid date`; - break; - case ZodIssueCode.invalid_string: - if (typeof issue.validation === "object") if ("includes" in issue.validation) { - message = `Invalid input: must include "${issue.validation.includes}"`; - if (typeof issue.validation.position === "number") message = `${message} at one or more positions greater than or equal to ${issue.validation.position}`; - } else if ("startsWith" in issue.validation) message = `Invalid input: must start with "${issue.validation.startsWith}"`; - else if ("endsWith" in issue.validation) message = `Invalid input: must end with "${issue.validation.endsWith}"`; - else util.assertNever(issue.validation); - else if (issue.validation !== "regex") message = `Invalid ${issue.validation}`; - else message = "Invalid"; - break; - case ZodIssueCode.too_small: - if (issue.type === "array") message = `Array must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`; - else if (issue.type === "string") message = `String must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`; - else if (issue.type === "number") message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`; - else if (issue.type === "bigint") message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`; - else if (issue.type === "date") message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(Number(issue.minimum))}`; - else message = "Invalid input"; - break; - case ZodIssueCode.too_big: - if (issue.type === "array") message = `Array must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`; - else if (issue.type === "string") message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`; - else if (issue.type === "number") message = `Number must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`; - else if (issue.type === "bigint") message = `BigInt must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`; - else if (issue.type === "date") message = `Date must be ${issue.exact ? `exactly` : issue.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(Number(issue.maximum))}`; - else message = "Invalid input"; - break; - case ZodIssueCode.custom: - message = `Invalid input`; - break; - case ZodIssueCode.invalid_intersection_types: - message = `Intersection results could not be merged`; - break; - case ZodIssueCode.not_multiple_of: - message = `Number must be a multiple of ${issue.multipleOf}`; - break; - case ZodIssueCode.not_finite: - message = "Number must be finite"; - break; - default: - message = _ctx.defaultError; - util.assertNever(issue); - } - return { message }; -}; -//#endregion -//#region node_modules/zod/v3/errors.js -let overrideErrorMap = errorMap; -function getErrorMap() { - return overrideErrorMap; -} -//#endregion -//#region node_modules/zod/v3/helpers/parseUtil.js -const makeIssue = (params) => { - const { data, path, errorMaps, issueData } = params; - const fullPath = [...path, ...issueData.path || []]; - const fullIssue = { - ...issueData, - path: fullPath - }; - if (issueData.message !== void 0) return { - ...issueData, - path: fullPath, - message: issueData.message - }; - let errorMessage = ""; - const maps = errorMaps.filter((m) => !!m).slice().reverse(); - for (const map of maps) errorMessage = map(fullIssue, { - data, - defaultError: errorMessage - }).message; - return { - ...issueData, - path: fullPath, - message: errorMessage - }; -}; -function addIssueToContext(ctx, issueData) { - const overrideMap = getErrorMap(); - const issue = makeIssue({ - issueData, - data: ctx.data, - path: ctx.path, - errorMaps: [ - ctx.common.contextualErrorMap, - ctx.schemaErrorMap, - overrideMap, - overrideMap === errorMap ? void 0 : errorMap - ].filter((x) => !!x) - }); - ctx.common.issues.push(issue); -} -var ParseStatus = class ParseStatus { - constructor() { - this.value = "valid"; - } - dirty() { - if (this.value === "valid") this.value = "dirty"; - } - abort() { - if (this.value !== "aborted") this.value = "aborted"; - } - static mergeArray(status, results) { - const arrayValue = []; - for (const s of results) { - if (s.status === "aborted") return INVALID; - if (s.status === "dirty") status.dirty(); - arrayValue.push(s.value); - } - return { - status: status.value, - value: arrayValue - }; - } - static async mergeObjectAsync(status, pairs) { - const syncPairs = []; - for (const pair of pairs) { - const key = await pair.key; - const value = await pair.value; - syncPairs.push({ - key, - value - }); - } - return ParseStatus.mergeObjectSync(status, syncPairs); - } - static mergeObjectSync(status, pairs) { - const finalObject = {}; - for (const pair of pairs) { - const { key, value } = pair; - if (key.status === "aborted") return INVALID; - if (value.status === "aborted") return INVALID; - if (key.status === "dirty") status.dirty(); - if (value.status === "dirty") status.dirty(); - if (key.value !== "__proto__" && (typeof value.value !== "undefined" || pair.alwaysSet)) finalObject[key.value] = value.value; - } - return { - status: status.value, - value: finalObject - }; - } -}; -const INVALID = Object.freeze({ status: "aborted" }); -const DIRTY = (value) => ({ - status: "dirty", - value -}); -const OK = (value) => ({ - status: "valid", - value -}); -const isAborted = (x) => x.status === "aborted"; -const isDirty = (x) => x.status === "dirty"; -const isValid = (x) => x.status === "valid"; -const isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise; -//#endregion -//#region node_modules/zod/v3/helpers/errorUtil.js -var errorUtil; -(function(errorUtil) { - errorUtil.errToObj = (message) => typeof message === "string" ? { message } : message || {}; - errorUtil.toString = (message) => typeof message === "string" ? message : message?.message; -})(errorUtil || (errorUtil = {})); -//#endregion -//#region node_modules/zod/v3/types.js -var ParseInputLazyPath = class { - constructor(parent, value, path, key) { - this._cachedPath = []; - this.parent = parent; - this.data = value; - this._path = path; - this._key = key; - } - get path() { - if (!this._cachedPath.length) if (Array.isArray(this._key)) this._cachedPath.push(...this._path, ...this._key); - else this._cachedPath.push(...this._path, this._key); - return this._cachedPath; - } -}; -const handleResult = (ctx, result) => { - if (isValid(result)) return { - success: true, - data: result.value - }; - else { - if (!ctx.common.issues.length) throw new Error("Validation failed but no issues detected."); - return { - success: false, - get error() { - if (this._error) return this._error; - const error = new ZodError(ctx.common.issues); - this._error = error; - return this._error; - } - }; - } -}; -function processCreateParams(params) { - if (!params) return {}; - const { errorMap, invalid_type_error, required_error, description } = params; - if (errorMap && (invalid_type_error || required_error)) throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`); - if (errorMap) return { - errorMap, - description - }; - const customMap = (iss, ctx) => { - const { message } = params; - if (iss.code === "invalid_enum_value") return { message: message ?? ctx.defaultError }; - if (typeof ctx.data === "undefined") return { message: message ?? required_error ?? ctx.defaultError }; - if (iss.code !== "invalid_type") return { message: ctx.defaultError }; - return { message: message ?? invalid_type_error ?? ctx.defaultError }; - }; - return { - errorMap: customMap, - description - }; -} -var ZodType = class { - get description() { - return this._def.description; - } - _getType(input) { - return getParsedType(input.data); - } - _getOrReturnCtx(input, ctx) { - return ctx || { - common: input.parent.common, - data: input.data, - parsedType: getParsedType(input.data), - schemaErrorMap: this._def.errorMap, - path: input.path, - parent: input.parent - }; - } - _processInputParams(input) { - return { - status: new ParseStatus(), - ctx: { - common: input.parent.common, - data: input.data, - parsedType: getParsedType(input.data), - schemaErrorMap: this._def.errorMap, - path: input.path, - parent: input.parent - } - }; - } - _parseSync(input) { - const result = this._parse(input); - if (isAsync(result)) throw new Error("Synchronous parse encountered promise."); - return result; - } - _parseAsync(input) { - const result = this._parse(input); - return Promise.resolve(result); - } - parse(data, params) { - const result = this.safeParse(data, params); - if (result.success) return result.data; - throw result.error; - } - safeParse(data, params) { - const ctx = { - common: { - issues: [], - async: params?.async ?? false, - contextualErrorMap: params?.errorMap - }, - path: params?.path || [], - schemaErrorMap: this._def.errorMap, - parent: null, - data, - parsedType: getParsedType(data) - }; - const result = this._parseSync({ - data, - path: ctx.path, - parent: ctx - }); - return handleResult(ctx, result); - } - "~validate"(data) { - const ctx = { - common: { - issues: [], - async: !!this["~standard"].async - }, - path: [], - schemaErrorMap: this._def.errorMap, - parent: null, - data, - parsedType: getParsedType(data) - }; - if (!this["~standard"].async) try { - const result = this._parseSync({ - data, - path: [], - parent: ctx - }); - return isValid(result) ? { value: result.value } : { issues: ctx.common.issues }; - } catch (err) { - if (err?.message?.toLowerCase()?.includes("encountered")) this["~standard"].async = true; - ctx.common = { - issues: [], - async: true - }; - } - return this._parseAsync({ - data, - path: [], - parent: ctx - }).then((result) => isValid(result) ? { value: result.value } : { issues: ctx.common.issues }); - } - async parseAsync(data, params) { - const result = await this.safeParseAsync(data, params); - if (result.success) return result.data; - throw result.error; - } - async safeParseAsync(data, params) { - const ctx = { - common: { - issues: [], - contextualErrorMap: params?.errorMap, - async: true - }, - path: params?.path || [], - schemaErrorMap: this._def.errorMap, - parent: null, - data, - parsedType: getParsedType(data) - }; - const maybeAsyncResult = this._parse({ - data, - path: ctx.path, - parent: ctx - }); - const result = await (isAsync(maybeAsyncResult) ? maybeAsyncResult : Promise.resolve(maybeAsyncResult)); - return handleResult(ctx, result); - } - refine(check, message) { - const getIssueProperties = (val) => { - if (typeof message === "string" || typeof message === "undefined") return { message }; - else if (typeof message === "function") return message(val); - else return message; - }; - return this._refinement((val, ctx) => { - const result = check(val); - const setError = () => ctx.addIssue({ - code: ZodIssueCode.custom, - ...getIssueProperties(val) - }); - if (typeof Promise !== "undefined" && result instanceof Promise) return result.then((data) => { - if (!data) { - setError(); - return false; - } else return true; - }); - if (!result) { - setError(); - return false; - } else return true; - }); - } - refinement(check, refinementData) { - return this._refinement((val, ctx) => { - if (!check(val)) { - ctx.addIssue(typeof refinementData === "function" ? refinementData(val, ctx) : refinementData); - return false; - } else return true; - }); - } - _refinement(refinement) { - return new ZodEffects({ - schema: this, - typeName: ZodFirstPartyTypeKind.ZodEffects, - effect: { - type: "refinement", - refinement - } - }); - } - superRefine(refinement) { - return this._refinement(refinement); - } - constructor(def) { - /** Alias of safeParseAsync */ - this.spa = this.safeParseAsync; - this._def = def; - this.parse = this.parse.bind(this); - this.safeParse = this.safeParse.bind(this); - this.parseAsync = this.parseAsync.bind(this); - this.safeParseAsync = this.safeParseAsync.bind(this); - this.spa = this.spa.bind(this); - this.refine = this.refine.bind(this); - this.refinement = this.refinement.bind(this); - this.superRefine = this.superRefine.bind(this); - this.optional = this.optional.bind(this); - this.nullable = this.nullable.bind(this); - this.nullish = this.nullish.bind(this); - this.array = this.array.bind(this); - this.promise = this.promise.bind(this); - this.or = this.or.bind(this); - this.and = this.and.bind(this); - this.transform = this.transform.bind(this); - this.brand = this.brand.bind(this); - this.default = this.default.bind(this); - this.catch = this.catch.bind(this); - this.describe = this.describe.bind(this); - this.pipe = this.pipe.bind(this); - this.readonly = this.readonly.bind(this); - this.isNullable = this.isNullable.bind(this); - this.isOptional = this.isOptional.bind(this); - this["~standard"] = { - version: 1, - vendor: "zod", - validate: (data) => this["~validate"](data) - }; - } - optional() { - return ZodOptional.create(this, this._def); - } - nullable() { - return ZodNullable.create(this, this._def); - } - nullish() { - return this.nullable().optional(); - } - array() { - return ZodArray.create(this); - } - promise() { - return ZodPromise.create(this, this._def); - } - or(option) { - return ZodUnion.create([this, option], this._def); - } - and(incoming) { - return ZodIntersection.create(this, incoming, this._def); - } - transform(transform) { - return new ZodEffects({ - ...processCreateParams(this._def), - schema: this, - typeName: ZodFirstPartyTypeKind.ZodEffects, - effect: { - type: "transform", - transform - } - }); - } - default(def) { - const defaultValueFunc = typeof def === "function" ? def : () => def; - return new ZodDefault({ - ...processCreateParams(this._def), - innerType: this, - defaultValue: defaultValueFunc, - typeName: ZodFirstPartyTypeKind.ZodDefault - }); - } - brand() { - return new ZodBranded({ - typeName: ZodFirstPartyTypeKind.ZodBranded, - type: this, - ...processCreateParams(this._def) - }); - } - catch(def) { - const catchValueFunc = typeof def === "function" ? def : () => def; - return new ZodCatch({ - ...processCreateParams(this._def), - innerType: this, - catchValue: catchValueFunc, - typeName: ZodFirstPartyTypeKind.ZodCatch - }); - } - describe(description) { - const This = this.constructor; - return new This({ - ...this._def, - description - }); - } - pipe(target) { - return ZodPipeline.create(this, target); - } - readonly() { - return ZodReadonly.create(this); - } - isOptional() { - return this.safeParse(void 0).success; - } - isNullable() { - return this.safeParse(null).success; - } -}; -const cuidRegex = /^c[^\s-]{8,}$/i; -const cuid2Regex = /^[0-9a-z]+$/; -const ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/i; -const uuidRegex = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i; -const nanoidRegex = /^[a-z0-9_-]{21}$/i; -const jwtRegex = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/; -const durationRegex = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/; -const emailRegex = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i; -const _emojiRegex = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`; -let emojiRegex$1; -const ipv4Regex = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/; -const ipv4CidrRegex = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/; -const ipv6Regex = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/; -const ipv6CidrRegex = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/; -const base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/; -const base64urlRegex = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/; -const dateRegexSource = `((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`; -const dateRegex = new RegExp(`^${dateRegexSource}$`); -function timeRegexSource(args) { - let secondsRegexSource = `[0-5]\\d`; - if (args.precision) secondsRegexSource = `${secondsRegexSource}\\.\\d{${args.precision}}`; - else if (args.precision == null) secondsRegexSource = `${secondsRegexSource}(\\.\\d+)?`; - const secondsQuantifier = args.precision ? "+" : "?"; - return `([01]\\d|2[0-3]):[0-5]\\d(:${secondsRegexSource})${secondsQuantifier}`; -} -function timeRegex(args) { - return new RegExp(`^${timeRegexSource(args)}$`); -} -function datetimeRegex(args) { - let regex = `${dateRegexSource}T${timeRegexSource(args)}`; - const opts = []; - opts.push(args.local ? `Z?` : `Z`); - if (args.offset) opts.push(`([+-]\\d{2}:?\\d{2})`); - regex = `${regex}(${opts.join("|")})`; - return new RegExp(`^${regex}$`); -} -function isValidIP(ip, version) { - if ((version === "v4" || !version) && ipv4Regex.test(ip)) return true; - if ((version === "v6" || !version) && ipv6Regex.test(ip)) return true; - return false; -} -function isValidJWT(jwt, alg) { - if (!jwtRegex.test(jwt)) return false; - try { - const [header] = jwt.split("."); - if (!header) return false; - const base64 = header.replace(/-/g, "+").replace(/_/g, "/").padEnd(header.length + (4 - header.length % 4) % 4, "="); - const decoded = JSON.parse(atob(base64)); - if (typeof decoded !== "object" || decoded === null) return false; - if ("typ" in decoded && decoded?.typ !== "JWT") return false; - if (!decoded.alg) return false; - if (alg && decoded.alg !== alg) return false; - return true; - } catch { - return false; - } -} -function isValidCidr(ip, version) { - if ((version === "v4" || !version) && ipv4CidrRegex.test(ip)) return true; - if ((version === "v6" || !version) && ipv6CidrRegex.test(ip)) return true; - return false; -} -var ZodString = class ZodString extends ZodType { - _parse(input) { - if (this._def.coerce) input.data = String(input.data); - if (this._getType(input) !== ZodParsedType.string) { - const ctx = this._getOrReturnCtx(input); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.string, - received: ctx.parsedType - }); - return INVALID; - } - const status = new ParseStatus(); - let ctx = void 0; - for (const check of this._def.checks) if (check.kind === "min") { - if (input.data.length < check.value) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.too_small, - minimum: check.value, - type: "string", - inclusive: true, - exact: false, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "max") { - if (input.data.length > check.value) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.too_big, - maximum: check.value, - type: "string", - inclusive: true, - exact: false, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "length") { - const tooBig = input.data.length > check.value; - const tooSmall = input.data.length < check.value; - if (tooBig || tooSmall) { - ctx = this._getOrReturnCtx(input, ctx); - if (tooBig) addIssueToContext(ctx, { - code: ZodIssueCode.too_big, - maximum: check.value, - type: "string", - inclusive: true, - exact: true, - message: check.message - }); - else if (tooSmall) addIssueToContext(ctx, { - code: ZodIssueCode.too_small, - minimum: check.value, - type: "string", - inclusive: true, - exact: true, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "email") { - if (!emailRegex.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - validation: "email", - code: ZodIssueCode.invalid_string, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "emoji") { - if (!emojiRegex$1) emojiRegex$1 = new RegExp(_emojiRegex, "u"); - if (!emojiRegex$1.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - validation: "emoji", - code: ZodIssueCode.invalid_string, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "uuid") { - if (!uuidRegex.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - validation: "uuid", - code: ZodIssueCode.invalid_string, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "nanoid") { - if (!nanoidRegex.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - validation: "nanoid", - code: ZodIssueCode.invalid_string, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "cuid") { - if (!cuidRegex.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - validation: "cuid", - code: ZodIssueCode.invalid_string, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "cuid2") { - if (!cuid2Regex.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - validation: "cuid2", - code: ZodIssueCode.invalid_string, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "ulid") { - if (!ulidRegex.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - validation: "ulid", - code: ZodIssueCode.invalid_string, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "url") try { - new URL(input.data); - } catch { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - validation: "url", - code: ZodIssueCode.invalid_string, - message: check.message - }); - status.dirty(); - } - else if (check.kind === "regex") { - check.regex.lastIndex = 0; - if (!check.regex.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - validation: "regex", - code: ZodIssueCode.invalid_string, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "trim") input.data = input.data.trim(); - else if (check.kind === "includes") { - if (!input.data.includes(check.value, check.position)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_string, - validation: { - includes: check.value, - position: check.position - }, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "toLowerCase") input.data = input.data.toLowerCase(); - else if (check.kind === "toUpperCase") input.data = input.data.toUpperCase(); - else if (check.kind === "startsWith") { - if (!input.data.startsWith(check.value)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_string, - validation: { startsWith: check.value }, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "endsWith") { - if (!input.data.endsWith(check.value)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_string, - validation: { endsWith: check.value }, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "datetime") { - if (!datetimeRegex(check).test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_string, - validation: "datetime", - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "date") { - if (!dateRegex.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_string, - validation: "date", - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "time") { - if (!timeRegex(check).test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_string, - validation: "time", - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "duration") { - if (!durationRegex.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - validation: "duration", - code: ZodIssueCode.invalid_string, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "ip") { - if (!isValidIP(input.data, check.version)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - validation: "ip", - code: ZodIssueCode.invalid_string, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "jwt") { - if (!isValidJWT(input.data, check.alg)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - validation: "jwt", - code: ZodIssueCode.invalid_string, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "cidr") { - if (!isValidCidr(input.data, check.version)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - validation: "cidr", - code: ZodIssueCode.invalid_string, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "base64") { - if (!base64Regex.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - validation: "base64", - code: ZodIssueCode.invalid_string, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "base64url") { - if (!base64urlRegex.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - validation: "base64url", - code: ZodIssueCode.invalid_string, - message: check.message - }); - status.dirty(); - } - } else util.assertNever(check); - return { - status: status.value, - value: input.data - }; - } - _regex(regex, validation, message) { - return this.refinement((data) => regex.test(data), { - validation, - code: ZodIssueCode.invalid_string, - ...errorUtil.errToObj(message) - }); - } - _addCheck(check) { - return new ZodString({ - ...this._def, - checks: [...this._def.checks, check] - }); - } - email(message) { - return this._addCheck({ - kind: "email", - ...errorUtil.errToObj(message) - }); - } - url(message) { - return this._addCheck({ - kind: "url", - ...errorUtil.errToObj(message) - }); - } - emoji(message) { - return this._addCheck({ - kind: "emoji", - ...errorUtil.errToObj(message) - }); - } - uuid(message) { - return this._addCheck({ - kind: "uuid", - ...errorUtil.errToObj(message) - }); - } - nanoid(message) { - return this._addCheck({ - kind: "nanoid", - ...errorUtil.errToObj(message) - }); - } - cuid(message) { - return this._addCheck({ - kind: "cuid", - ...errorUtil.errToObj(message) - }); - } - cuid2(message) { - return this._addCheck({ - kind: "cuid2", - ...errorUtil.errToObj(message) - }); - } - ulid(message) { - return this._addCheck({ - kind: "ulid", - ...errorUtil.errToObj(message) - }); - } - base64(message) { - return this._addCheck({ - kind: "base64", - ...errorUtil.errToObj(message) - }); - } - base64url(message) { - return this._addCheck({ - kind: "base64url", - ...errorUtil.errToObj(message) - }); - } - jwt(options) { - return this._addCheck({ - kind: "jwt", - ...errorUtil.errToObj(options) - }); - } - ip(options) { - return this._addCheck({ - kind: "ip", - ...errorUtil.errToObj(options) - }); - } - cidr(options) { - return this._addCheck({ - kind: "cidr", - ...errorUtil.errToObj(options) - }); - } - datetime(options) { - if (typeof options === "string") return this._addCheck({ - kind: "datetime", - precision: null, - offset: false, - local: false, - message: options - }); - return this._addCheck({ - kind: "datetime", - precision: typeof options?.precision === "undefined" ? null : options?.precision, - offset: options?.offset ?? false, - local: options?.local ?? false, - ...errorUtil.errToObj(options?.message) - }); - } - date(message) { - return this._addCheck({ - kind: "date", - message - }); - } - time(options) { - if (typeof options === "string") return this._addCheck({ - kind: "time", - precision: null, - message: options - }); - return this._addCheck({ - kind: "time", - precision: typeof options?.precision === "undefined" ? null : options?.precision, - ...errorUtil.errToObj(options?.message) - }); - } - duration(message) { - return this._addCheck({ - kind: "duration", - ...errorUtil.errToObj(message) - }); - } - regex(regex, message) { - return this._addCheck({ - kind: "regex", - regex, - ...errorUtil.errToObj(message) - }); - } - includes(value, options) { - return this._addCheck({ - kind: "includes", - value, - position: options?.position, - ...errorUtil.errToObj(options?.message) - }); - } - startsWith(value, message) { - return this._addCheck({ - kind: "startsWith", - value, - ...errorUtil.errToObj(message) - }); - } - endsWith(value, message) { - return this._addCheck({ - kind: "endsWith", - value, - ...errorUtil.errToObj(message) - }); - } - min(minLength, message) { - return this._addCheck({ - kind: "min", - value: minLength, - ...errorUtil.errToObj(message) - }); - } - max(maxLength, message) { - return this._addCheck({ - kind: "max", - value: maxLength, - ...errorUtil.errToObj(message) - }); - } - length(len, message) { - return this._addCheck({ - kind: "length", - value: len, - ...errorUtil.errToObj(message) - }); - } - /** - * Equivalent to `.min(1)` - */ - nonempty(message) { - return this.min(1, errorUtil.errToObj(message)); - } - trim() { - return new ZodString({ - ...this._def, - checks: [...this._def.checks, { kind: "trim" }] - }); - } - toLowerCase() { - return new ZodString({ - ...this._def, - checks: [...this._def.checks, { kind: "toLowerCase" }] - }); - } - toUpperCase() { - return new ZodString({ - ...this._def, - checks: [...this._def.checks, { kind: "toUpperCase" }] - }); - } - get isDatetime() { - return !!this._def.checks.find((ch) => ch.kind === "datetime"); - } - get isDate() { - return !!this._def.checks.find((ch) => ch.kind === "date"); - } - get isTime() { - return !!this._def.checks.find((ch) => ch.kind === "time"); - } - get isDuration() { - return !!this._def.checks.find((ch) => ch.kind === "duration"); - } - get isEmail() { - return !!this._def.checks.find((ch) => ch.kind === "email"); - } - get isURL() { - return !!this._def.checks.find((ch) => ch.kind === "url"); - } - get isEmoji() { - return !!this._def.checks.find((ch) => ch.kind === "emoji"); - } - get isUUID() { - return !!this._def.checks.find((ch) => ch.kind === "uuid"); - } - get isNANOID() { - return !!this._def.checks.find((ch) => ch.kind === "nanoid"); - } - get isCUID() { - return !!this._def.checks.find((ch) => ch.kind === "cuid"); - } - get isCUID2() { - return !!this._def.checks.find((ch) => ch.kind === "cuid2"); - } - get isULID() { - return !!this._def.checks.find((ch) => ch.kind === "ulid"); - } - get isIP() { - return !!this._def.checks.find((ch) => ch.kind === "ip"); - } - get isCIDR() { - return !!this._def.checks.find((ch) => ch.kind === "cidr"); - } - get isBase64() { - return !!this._def.checks.find((ch) => ch.kind === "base64"); - } - get isBase64url() { - return !!this._def.checks.find((ch) => ch.kind === "base64url"); - } - get minLength() { - let min = null; - for (const ch of this._def.checks) if (ch.kind === "min") { - if (min === null || ch.value > min) min = ch.value; - } - return min; - } - get maxLength() { - let max = null; - for (const ch of this._def.checks) if (ch.kind === "max") { - if (max === null || ch.value < max) max = ch.value; - } - return max; - } -}; -ZodString.create = (params) => { - return new ZodString({ - checks: [], - typeName: ZodFirstPartyTypeKind.ZodString, - coerce: params?.coerce ?? false, - ...processCreateParams(params) - }); -}; -function floatSafeRemainder(val, step) { - const valDecCount = (val.toString().split(".")[1] || "").length; - const stepDecCount = (step.toString().split(".")[1] || "").length; - const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount; - return Number.parseInt(val.toFixed(decCount).replace(".", "")) % Number.parseInt(step.toFixed(decCount).replace(".", "")) / 10 ** decCount; -} -var ZodNumber = class ZodNumber extends ZodType { - constructor() { - super(...arguments); - this.min = this.gte; - this.max = this.lte; - this.step = this.multipleOf; - } - _parse(input) { - if (this._def.coerce) input.data = Number(input.data); - if (this._getType(input) !== ZodParsedType.number) { - const ctx = this._getOrReturnCtx(input); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.number, - received: ctx.parsedType - }); - return INVALID; - } - let ctx = void 0; - const status = new ParseStatus(); - for (const check of this._def.checks) if (check.kind === "int") { - if (!util.isInteger(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: "integer", - received: "float", - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "min") { - if (check.inclusive ? input.data < check.value : input.data <= check.value) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.too_small, - minimum: check.value, - type: "number", - inclusive: check.inclusive, - exact: false, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "max") { - if (check.inclusive ? input.data > check.value : input.data >= check.value) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.too_big, - maximum: check.value, - type: "number", - inclusive: check.inclusive, - exact: false, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "multipleOf") { - if (floatSafeRemainder(input.data, check.value) !== 0) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.not_multiple_of, - multipleOf: check.value, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "finite") { - if (!Number.isFinite(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.not_finite, - message: check.message - }); - status.dirty(); - } - } else util.assertNever(check); - return { - status: status.value, - value: input.data - }; - } - gte(value, message) { - return this.setLimit("min", value, true, errorUtil.toString(message)); - } - gt(value, message) { - return this.setLimit("min", value, false, errorUtil.toString(message)); - } - lte(value, message) { - return this.setLimit("max", value, true, errorUtil.toString(message)); - } - lt(value, message) { - return this.setLimit("max", value, false, errorUtil.toString(message)); - } - setLimit(kind, value, inclusive, message) { - return new ZodNumber({ - ...this._def, - checks: [...this._def.checks, { - kind, - value, - inclusive, - message: errorUtil.toString(message) - }] - }); - } - _addCheck(check) { - return new ZodNumber({ - ...this._def, - checks: [...this._def.checks, check] - }); - } - int(message) { - return this._addCheck({ - kind: "int", - message: errorUtil.toString(message) - }); - } - positive(message) { - return this._addCheck({ - kind: "min", - value: 0, - inclusive: false, - message: errorUtil.toString(message) - }); - } - negative(message) { - return this._addCheck({ - kind: "max", - value: 0, - inclusive: false, - message: errorUtil.toString(message) - }); - } - nonpositive(message) { - return this._addCheck({ - kind: "max", - value: 0, - inclusive: true, - message: errorUtil.toString(message) - }); - } - nonnegative(message) { - return this._addCheck({ - kind: "min", - value: 0, - inclusive: true, - message: errorUtil.toString(message) - }); - } - multipleOf(value, message) { - return this._addCheck({ - kind: "multipleOf", - value, - message: errorUtil.toString(message) - }); - } - finite(message) { - return this._addCheck({ - kind: "finite", - message: errorUtil.toString(message) - }); - } - safe(message) { - return this._addCheck({ - kind: "min", - inclusive: true, - value: Number.MIN_SAFE_INTEGER, - message: errorUtil.toString(message) - })._addCheck({ - kind: "max", - inclusive: true, - value: Number.MAX_SAFE_INTEGER, - message: errorUtil.toString(message) - }); - } - get minValue() { - let min = null; - for (const ch of this._def.checks) if (ch.kind === "min") { - if (min === null || ch.value > min) min = ch.value; - } - return min; - } - get maxValue() { - let max = null; - for (const ch of this._def.checks) if (ch.kind === "max") { - if (max === null || ch.value < max) max = ch.value; - } - return max; - } - get isInt() { - return !!this._def.checks.find((ch) => ch.kind === "int" || ch.kind === "multipleOf" && util.isInteger(ch.value)); - } - get isFinite() { - let max = null; - let min = null; - for (const ch of this._def.checks) if (ch.kind === "finite" || ch.kind === "int" || ch.kind === "multipleOf") return true; - else if (ch.kind === "min") { - if (min === null || ch.value > min) min = ch.value; - } else if (ch.kind === "max") { - if (max === null || ch.value < max) max = ch.value; - } - return Number.isFinite(min) && Number.isFinite(max); - } -}; -ZodNumber.create = (params) => { - return new ZodNumber({ - checks: [], - typeName: ZodFirstPartyTypeKind.ZodNumber, - coerce: params?.coerce || false, - ...processCreateParams(params) - }); -}; -var ZodBigInt = class ZodBigInt extends ZodType { - constructor() { - super(...arguments); - this.min = this.gte; - this.max = this.lte; - } - _parse(input) { - if (this._def.coerce) try { - input.data = BigInt(input.data); - } catch { - return this._getInvalidInput(input); - } - if (this._getType(input) !== ZodParsedType.bigint) return this._getInvalidInput(input); - let ctx = void 0; - const status = new ParseStatus(); - for (const check of this._def.checks) if (check.kind === "min") { - if (check.inclusive ? input.data < check.value : input.data <= check.value) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.too_small, - type: "bigint", - minimum: check.value, - inclusive: check.inclusive, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "max") { - if (check.inclusive ? input.data > check.value : input.data >= check.value) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.too_big, - type: "bigint", - maximum: check.value, - inclusive: check.inclusive, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "multipleOf") { - if (input.data % check.value !== BigInt(0)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.not_multiple_of, - multipleOf: check.value, - message: check.message - }); - status.dirty(); - } - } else util.assertNever(check); - return { - status: status.value, - value: input.data - }; - } - _getInvalidInput(input) { - const ctx = this._getOrReturnCtx(input); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.bigint, - received: ctx.parsedType - }); - return INVALID; - } - gte(value, message) { - return this.setLimit("min", value, true, errorUtil.toString(message)); - } - gt(value, message) { - return this.setLimit("min", value, false, errorUtil.toString(message)); - } - lte(value, message) { - return this.setLimit("max", value, true, errorUtil.toString(message)); - } - lt(value, message) { - return this.setLimit("max", value, false, errorUtil.toString(message)); - } - setLimit(kind, value, inclusive, message) { - return new ZodBigInt({ - ...this._def, - checks: [...this._def.checks, { - kind, - value, - inclusive, - message: errorUtil.toString(message) - }] - }); - } - _addCheck(check) { - return new ZodBigInt({ - ...this._def, - checks: [...this._def.checks, check] - }); - } - positive(message) { - return this._addCheck({ - kind: "min", - value: BigInt(0), - inclusive: false, - message: errorUtil.toString(message) - }); - } - negative(message) { - return this._addCheck({ - kind: "max", - value: BigInt(0), - inclusive: false, - message: errorUtil.toString(message) - }); - } - nonpositive(message) { - return this._addCheck({ - kind: "max", - value: BigInt(0), - inclusive: true, - message: errorUtil.toString(message) - }); - } - nonnegative(message) { - return this._addCheck({ - kind: "min", - value: BigInt(0), - inclusive: true, - message: errorUtil.toString(message) - }); - } - multipleOf(value, message) { - return this._addCheck({ - kind: "multipleOf", - value, - message: errorUtil.toString(message) - }); - } - get minValue() { - let min = null; - for (const ch of this._def.checks) if (ch.kind === "min") { - if (min === null || ch.value > min) min = ch.value; - } - return min; - } - get maxValue() { - let max = null; - for (const ch of this._def.checks) if (ch.kind === "max") { - if (max === null || ch.value < max) max = ch.value; - } - return max; - } -}; -ZodBigInt.create = (params) => { - return new ZodBigInt({ - checks: [], - typeName: ZodFirstPartyTypeKind.ZodBigInt, - coerce: params?.coerce ?? false, - ...processCreateParams(params) - }); -}; -var ZodBoolean = class extends ZodType { - _parse(input) { - if (this._def.coerce) input.data = Boolean(input.data); - if (this._getType(input) !== ZodParsedType.boolean) { - const ctx = this._getOrReturnCtx(input); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.boolean, - received: ctx.parsedType - }); - return INVALID; - } - return OK(input.data); - } -}; -ZodBoolean.create = (params) => { - return new ZodBoolean({ - typeName: ZodFirstPartyTypeKind.ZodBoolean, - coerce: params?.coerce || false, - ...processCreateParams(params) - }); -}; -var ZodDate = class ZodDate extends ZodType { - _parse(input) { - if (this._def.coerce) input.data = new Date(input.data); - if (this._getType(input) !== ZodParsedType.date) { - const ctx = this._getOrReturnCtx(input); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.date, - received: ctx.parsedType - }); - return INVALID; - } - if (Number.isNaN(input.data.getTime())) { - addIssueToContext(this._getOrReturnCtx(input), { code: ZodIssueCode.invalid_date }); - return INVALID; - } - const status = new ParseStatus(); - let ctx = void 0; - for (const check of this._def.checks) if (check.kind === "min") { - if (input.data.getTime() < check.value) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.too_small, - message: check.message, - inclusive: true, - exact: false, - minimum: check.value, - type: "date" - }); - status.dirty(); - } - } else if (check.kind === "max") { - if (input.data.getTime() > check.value) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.too_big, - message: check.message, - inclusive: true, - exact: false, - maximum: check.value, - type: "date" - }); - status.dirty(); - } - } else util.assertNever(check); - return { - status: status.value, - value: new Date(input.data.getTime()) - }; - } - _addCheck(check) { - return new ZodDate({ - ...this._def, - checks: [...this._def.checks, check] - }); - } - min(minDate, message) { - return this._addCheck({ - kind: "min", - value: minDate.getTime(), - message: errorUtil.toString(message) - }); - } - max(maxDate, message) { - return this._addCheck({ - kind: "max", - value: maxDate.getTime(), - message: errorUtil.toString(message) - }); - } - get minDate() { - let min = null; - for (const ch of this._def.checks) if (ch.kind === "min") { - if (min === null || ch.value > min) min = ch.value; - } - return min != null ? new Date(min) : null; - } - get maxDate() { - let max = null; - for (const ch of this._def.checks) if (ch.kind === "max") { - if (max === null || ch.value < max) max = ch.value; - } - return max != null ? new Date(max) : null; - } -}; -ZodDate.create = (params) => { - return new ZodDate({ - checks: [], - coerce: params?.coerce || false, - typeName: ZodFirstPartyTypeKind.ZodDate, - ...processCreateParams(params) - }); -}; -var ZodSymbol = class extends ZodType { - _parse(input) { - if (this._getType(input) !== ZodParsedType.symbol) { - const ctx = this._getOrReturnCtx(input); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.symbol, - received: ctx.parsedType - }); - return INVALID; - } - return OK(input.data); - } -}; -ZodSymbol.create = (params) => { - return new ZodSymbol({ - typeName: ZodFirstPartyTypeKind.ZodSymbol, - ...processCreateParams(params) - }); -}; -var ZodUndefined = class extends ZodType { - _parse(input) { - if (this._getType(input) !== ZodParsedType.undefined) { - const ctx = this._getOrReturnCtx(input); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.undefined, - received: ctx.parsedType - }); - return INVALID; - } - return OK(input.data); - } -}; -ZodUndefined.create = (params) => { - return new ZodUndefined({ - typeName: ZodFirstPartyTypeKind.ZodUndefined, - ...processCreateParams(params) - }); -}; -var ZodNull = class extends ZodType { - _parse(input) { - if (this._getType(input) !== ZodParsedType.null) { - const ctx = this._getOrReturnCtx(input); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.null, - received: ctx.parsedType - }); - return INVALID; - } - return OK(input.data); - } -}; -ZodNull.create = (params) => { - return new ZodNull({ - typeName: ZodFirstPartyTypeKind.ZodNull, - ...processCreateParams(params) - }); -}; -var ZodAny = class extends ZodType { - constructor() { - super(...arguments); - this._any = true; - } - _parse(input) { - return OK(input.data); - } -}; -ZodAny.create = (params) => { - return new ZodAny({ - typeName: ZodFirstPartyTypeKind.ZodAny, - ...processCreateParams(params) - }); -}; -var ZodUnknown = class extends ZodType { - constructor() { - super(...arguments); - this._unknown = true; - } - _parse(input) { - return OK(input.data); - } -}; -ZodUnknown.create = (params) => { - return new ZodUnknown({ - typeName: ZodFirstPartyTypeKind.ZodUnknown, - ...processCreateParams(params) - }); -}; -var ZodNever = class extends ZodType { - _parse(input) { - const ctx = this._getOrReturnCtx(input); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.never, - received: ctx.parsedType - }); - return INVALID; - } -}; -ZodNever.create = (params) => { - return new ZodNever({ - typeName: ZodFirstPartyTypeKind.ZodNever, - ...processCreateParams(params) - }); -}; -var ZodVoid = class extends ZodType { - _parse(input) { - if (this._getType(input) !== ZodParsedType.undefined) { - const ctx = this._getOrReturnCtx(input); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.void, - received: ctx.parsedType - }); - return INVALID; - } - return OK(input.data); - } -}; -ZodVoid.create = (params) => { - return new ZodVoid({ - typeName: ZodFirstPartyTypeKind.ZodVoid, - ...processCreateParams(params) - }); -}; -var ZodArray = class ZodArray extends ZodType { - _parse(input) { - const { ctx, status } = this._processInputParams(input); - const def = this._def; - if (ctx.parsedType !== ZodParsedType.array) { - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.array, - received: ctx.parsedType - }); - return INVALID; - } - if (def.exactLength !== null) { - const tooBig = ctx.data.length > def.exactLength.value; - const tooSmall = ctx.data.length < def.exactLength.value; - if (tooBig || tooSmall) { - addIssueToContext(ctx, { - code: tooBig ? ZodIssueCode.too_big : ZodIssueCode.too_small, - minimum: tooSmall ? def.exactLength.value : void 0, - maximum: tooBig ? def.exactLength.value : void 0, - type: "array", - inclusive: true, - exact: true, - message: def.exactLength.message - }); - status.dirty(); - } - } - if (def.minLength !== null) { - if (ctx.data.length < def.minLength.value) { - addIssueToContext(ctx, { - code: ZodIssueCode.too_small, - minimum: def.minLength.value, - type: "array", - inclusive: true, - exact: false, - message: def.minLength.message - }); - status.dirty(); - } - } - if (def.maxLength !== null) { - if (ctx.data.length > def.maxLength.value) { - addIssueToContext(ctx, { - code: ZodIssueCode.too_big, - maximum: def.maxLength.value, - type: "array", - inclusive: true, - exact: false, - message: def.maxLength.message - }); - status.dirty(); - } - } - if (ctx.common.async) return Promise.all([...ctx.data].map((item, i) => { - return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i)); - })).then((result) => { - return ParseStatus.mergeArray(status, result); - }); - const result = [...ctx.data].map((item, i) => { - return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i)); - }); - return ParseStatus.mergeArray(status, result); - } - get element() { - return this._def.type; - } - min(minLength, message) { - return new ZodArray({ - ...this._def, - minLength: { - value: minLength, - message: errorUtil.toString(message) - } - }); - } - max(maxLength, message) { - return new ZodArray({ - ...this._def, - maxLength: { - value: maxLength, - message: errorUtil.toString(message) - } - }); - } - length(len, message) { - return new ZodArray({ - ...this._def, - exactLength: { - value: len, - message: errorUtil.toString(message) - } - }); - } - nonempty(message) { - return this.min(1, message); - } -}; -ZodArray.create = (schema, params) => { - return new ZodArray({ - type: schema, - minLength: null, - maxLength: null, - exactLength: null, - typeName: ZodFirstPartyTypeKind.ZodArray, - ...processCreateParams(params) - }); -}; -function deepPartialify(schema) { - if (schema instanceof ZodObject) { - const newShape = {}; - for (const key in schema.shape) { - const fieldSchema = schema.shape[key]; - newShape[key] = ZodOptional.create(deepPartialify(fieldSchema)); - } - return new ZodObject({ - ...schema._def, - shape: () => newShape - }); - } else if (schema instanceof ZodArray) return new ZodArray({ - ...schema._def, - type: deepPartialify(schema.element) - }); - else if (schema instanceof ZodOptional) return ZodOptional.create(deepPartialify(schema.unwrap())); - else if (schema instanceof ZodNullable) return ZodNullable.create(deepPartialify(schema.unwrap())); - else if (schema instanceof ZodTuple) return ZodTuple.create(schema.items.map((item) => deepPartialify(item))); - else return schema; -} -var ZodObject = class ZodObject extends ZodType { - constructor() { - super(...arguments); - this._cached = null; - /** - * @deprecated In most cases, this is no longer needed - unknown properties are now silently stripped. - * If you want to pass through unknown properties, use `.passthrough()` instead. - */ - this.nonstrict = this.passthrough; - /** - * @deprecated Use `.extend` instead - * */ - this.augment = this.extend; - } - _getCached() { - if (this._cached !== null) return this._cached; - const shape = this._def.shape(); - const keys = util.objectKeys(shape); - this._cached = { - shape, - keys - }; - return this._cached; - } - _parse(input) { - if (this._getType(input) !== ZodParsedType.object) { - const ctx = this._getOrReturnCtx(input); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.object, - received: ctx.parsedType - }); - return INVALID; - } - const { status, ctx } = this._processInputParams(input); - const { shape, keys: shapeKeys } = this._getCached(); - const extraKeys = []; - if (!(this._def.catchall instanceof ZodNever && this._def.unknownKeys === "strip")) { - for (const key in ctx.data) if (!shapeKeys.includes(key)) extraKeys.push(key); - } - const pairs = []; - for (const key of shapeKeys) { - const keyValidator = shape[key]; - const value = ctx.data[key]; - pairs.push({ - key: { - status: "valid", - value: key - }, - value: keyValidator._parse(new ParseInputLazyPath(ctx, value, ctx.path, key)), - alwaysSet: key in ctx.data - }); - } - if (this._def.catchall instanceof ZodNever) { - const unknownKeys = this._def.unknownKeys; - if (unknownKeys === "passthrough") for (const key of extraKeys) pairs.push({ - key: { - status: "valid", - value: key - }, - value: { - status: "valid", - value: ctx.data[key] - } - }); - else if (unknownKeys === "strict") { - if (extraKeys.length > 0) { - addIssueToContext(ctx, { - code: ZodIssueCode.unrecognized_keys, - keys: extraKeys - }); - status.dirty(); - } - } else if (unknownKeys === "strip") {} else throw new Error(`Internal ZodObject error: invalid unknownKeys value.`); - } else { - const catchall = this._def.catchall; - for (const key of extraKeys) { - const value = ctx.data[key]; - pairs.push({ - key: { - status: "valid", - value: key - }, - value: catchall._parse(new ParseInputLazyPath(ctx, value, ctx.path, key)), - alwaysSet: key in ctx.data - }); - } - } - if (ctx.common.async) return Promise.resolve().then(async () => { - const syncPairs = []; - for (const pair of pairs) { - const key = await pair.key; - const value = await pair.value; - syncPairs.push({ - key, - value, - alwaysSet: pair.alwaysSet - }); - } - return syncPairs; - }).then((syncPairs) => { - return ParseStatus.mergeObjectSync(status, syncPairs); - }); - else return ParseStatus.mergeObjectSync(status, pairs); - } - get shape() { - return this._def.shape(); - } - strict(message) { - errorUtil.errToObj; - return new ZodObject({ - ...this._def, - unknownKeys: "strict", - ...message !== void 0 ? { errorMap: (issue, ctx) => { - const defaultError = this._def.errorMap?.(issue, ctx).message ?? ctx.defaultError; - if (issue.code === "unrecognized_keys") return { message: errorUtil.errToObj(message).message ?? defaultError }; - return { message: defaultError }; - } } : {} - }); - } - strip() { - return new ZodObject({ - ...this._def, - unknownKeys: "strip" - }); - } - passthrough() { - return new ZodObject({ - ...this._def, - unknownKeys: "passthrough" - }); - } - extend(augmentation) { - return new ZodObject({ - ...this._def, - shape: () => ({ - ...this._def.shape(), - ...augmentation - }) - }); - } - /** - * Prior to zod@1.0.12 there was a bug in the - * inferred type of merged objects. Please - * upgrade if you are experiencing issues. - */ - merge(merging) { - return new ZodObject({ - unknownKeys: merging._def.unknownKeys, - catchall: merging._def.catchall, - shape: () => ({ - ...this._def.shape(), - ...merging._def.shape() - }), - typeName: ZodFirstPartyTypeKind.ZodObject - }); - } - setKey(key, schema) { - return this.augment({ [key]: schema }); - } - catchall(index) { - return new ZodObject({ - ...this._def, - catchall: index - }); - } - pick(mask) { - const shape = {}; - for (const key of util.objectKeys(mask)) if (mask[key] && this.shape[key]) shape[key] = this.shape[key]; - return new ZodObject({ - ...this._def, - shape: () => shape - }); - } - omit(mask) { - const shape = {}; - for (const key of util.objectKeys(this.shape)) if (!mask[key]) shape[key] = this.shape[key]; - return new ZodObject({ - ...this._def, - shape: () => shape - }); - } - /** - * @deprecated - */ - deepPartial() { - return deepPartialify(this); - } - partial(mask) { - const newShape = {}; - for (const key of util.objectKeys(this.shape)) { - const fieldSchema = this.shape[key]; - if (mask && !mask[key]) newShape[key] = fieldSchema; - else newShape[key] = fieldSchema.optional(); - } - return new ZodObject({ - ...this._def, - shape: () => newShape - }); - } - required(mask) { - const newShape = {}; - for (const key of util.objectKeys(this.shape)) if (mask && !mask[key]) newShape[key] = this.shape[key]; - else { - let newField = this.shape[key]; - while (newField instanceof ZodOptional) newField = newField._def.innerType; - newShape[key] = newField; - } - return new ZodObject({ - ...this._def, - shape: () => newShape - }); - } - keyof() { - return createZodEnum(util.objectKeys(this.shape)); - } -}; -ZodObject.create = (shape, params) => { - return new ZodObject({ - shape: () => shape, - unknownKeys: "strip", - catchall: ZodNever.create(), - typeName: ZodFirstPartyTypeKind.ZodObject, - ...processCreateParams(params) - }); -}; -ZodObject.strictCreate = (shape, params) => { - return new ZodObject({ - shape: () => shape, - unknownKeys: "strict", - catchall: ZodNever.create(), - typeName: ZodFirstPartyTypeKind.ZodObject, - ...processCreateParams(params) - }); -}; -ZodObject.lazycreate = (shape, params) => { - return new ZodObject({ - shape, - unknownKeys: "strip", - catchall: ZodNever.create(), - typeName: ZodFirstPartyTypeKind.ZodObject, - ...processCreateParams(params) - }); -}; -var ZodUnion = class extends ZodType { - _parse(input) { - const { ctx } = this._processInputParams(input); - const options = this._def.options; - function handleResults(results) { - for (const result of results) if (result.result.status === "valid") return result.result; - for (const result of results) if (result.result.status === "dirty") { - ctx.common.issues.push(...result.ctx.common.issues); - return result.result; - } - const unionErrors = results.map((result) => new ZodError(result.ctx.common.issues)); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_union, - unionErrors - }); - return INVALID; - } - if (ctx.common.async) return Promise.all(options.map(async (option) => { - const childCtx = { - ...ctx, - common: { - ...ctx.common, - issues: [] - }, - parent: null - }; - return { - result: await option._parseAsync({ - data: ctx.data, - path: ctx.path, - parent: childCtx - }), - ctx: childCtx - }; - })).then(handleResults); - else { - let dirty = void 0; - const issues = []; - for (const option of options) { - const childCtx = { - ...ctx, - common: { - ...ctx.common, - issues: [] - }, - parent: null - }; - const result = option._parseSync({ - data: ctx.data, - path: ctx.path, - parent: childCtx - }); - if (result.status === "valid") return result; - else if (result.status === "dirty" && !dirty) dirty = { - result, - ctx: childCtx - }; - if (childCtx.common.issues.length) issues.push(childCtx.common.issues); - } - if (dirty) { - ctx.common.issues.push(...dirty.ctx.common.issues); - return dirty.result; - } - const unionErrors = issues.map((issues) => new ZodError(issues)); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_union, - unionErrors - }); - return INVALID; - } - } - get options() { - return this._def.options; - } -}; -ZodUnion.create = (types, params) => { - return new ZodUnion({ - options: types, - typeName: ZodFirstPartyTypeKind.ZodUnion, - ...processCreateParams(params) - }); -}; -const getDiscriminator = (type) => { - if (type instanceof ZodLazy) return getDiscriminator(type.schema); - else if (type instanceof ZodEffects) return getDiscriminator(type.innerType()); - else if (type instanceof ZodLiteral) return [type.value]; - else if (type instanceof ZodEnum) return type.options; - else if (type instanceof ZodNativeEnum) return util.objectValues(type.enum); - else if (type instanceof ZodDefault) return getDiscriminator(type._def.innerType); - else if (type instanceof ZodUndefined) return [void 0]; - else if (type instanceof ZodNull) return [null]; - else if (type instanceof ZodOptional) return [void 0, ...getDiscriminator(type.unwrap())]; - else if (type instanceof ZodNullable) return [null, ...getDiscriminator(type.unwrap())]; - else if (type instanceof ZodBranded) return getDiscriminator(type.unwrap()); - else if (type instanceof ZodReadonly) return getDiscriminator(type.unwrap()); - else if (type instanceof ZodCatch) return getDiscriminator(type._def.innerType); - else return []; -}; -var ZodDiscriminatedUnion = class ZodDiscriminatedUnion extends ZodType { - _parse(input) { - const { ctx } = this._processInputParams(input); - if (ctx.parsedType !== ZodParsedType.object) { - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.object, - received: ctx.parsedType - }); - return INVALID; - } - const discriminator = this.discriminator; - const discriminatorValue = ctx.data[discriminator]; - const option = this.optionsMap.get(discriminatorValue); - if (!option) { - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_union_discriminator, - options: Array.from(this.optionsMap.keys()), - path: [discriminator] - }); - return INVALID; - } - if (ctx.common.async) return option._parseAsync({ - data: ctx.data, - path: ctx.path, - parent: ctx - }); - else return option._parseSync({ - data: ctx.data, - path: ctx.path, - parent: ctx - }); - } - get discriminator() { - return this._def.discriminator; - } - get options() { - return this._def.options; - } - get optionsMap() { - return this._def.optionsMap; - } - /** - * The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor. - * However, it only allows a union of objects, all of which need to share a discriminator property. This property must - * have a different value for each object in the union. - * @param discriminator the name of the discriminator property - * @param types an array of object schemas - * @param params - */ - static create(discriminator, options, params) { - const optionsMap = /* @__PURE__ */ new Map(); - for (const type of options) { - const discriminatorValues = getDiscriminator(type.shape[discriminator]); - if (!discriminatorValues.length) throw new Error(`A discriminator value for key \`${discriminator}\` could not be extracted from all schema options`); - for (const value of discriminatorValues) { - if (optionsMap.has(value)) throw new Error(`Discriminator property ${String(discriminator)} has duplicate value ${String(value)}`); - optionsMap.set(value, type); - } - } - return new ZodDiscriminatedUnion({ - typeName: ZodFirstPartyTypeKind.ZodDiscriminatedUnion, - discriminator, - options, - optionsMap, - ...processCreateParams(params) - }); - } -}; -function mergeValues(a, b) { - const aType = getParsedType(a); - const bType = getParsedType(b); - if (a === b) return { - valid: true, - data: a - }; - else if (aType === ZodParsedType.object && bType === ZodParsedType.object) { - const bKeys = util.objectKeys(b); - const sharedKeys = util.objectKeys(a).filter((key) => bKeys.indexOf(key) !== -1); - const newObj = { - ...a, - ...b - }; - for (const key of sharedKeys) { - const sharedValue = mergeValues(a[key], b[key]); - if (!sharedValue.valid) return { valid: false }; - newObj[key] = sharedValue.data; - } - return { - valid: true, - data: newObj - }; - } else if (aType === ZodParsedType.array && bType === ZodParsedType.array) { - if (a.length !== b.length) return { valid: false }; - const newArray = []; - for (let index = 0; index < a.length; index++) { - const itemA = a[index]; - const itemB = b[index]; - const sharedValue = mergeValues(itemA, itemB); - if (!sharedValue.valid) return { valid: false }; - newArray.push(sharedValue.data); - } - return { - valid: true, - data: newArray - }; - } else if (aType === ZodParsedType.date && bType === ZodParsedType.date && +a === +b) return { - valid: true, - data: a - }; - else return { valid: false }; -} -var ZodIntersection = class extends ZodType { - _parse(input) { - const { status, ctx } = this._processInputParams(input); - const handleParsed = (parsedLeft, parsedRight) => { - if (isAborted(parsedLeft) || isAborted(parsedRight)) return INVALID; - const merged = mergeValues(parsedLeft.value, parsedRight.value); - if (!merged.valid) { - addIssueToContext(ctx, { code: ZodIssueCode.invalid_intersection_types }); - return INVALID; - } - if (isDirty(parsedLeft) || isDirty(parsedRight)) status.dirty(); - return { - status: status.value, - value: merged.data - }; - }; - if (ctx.common.async) return Promise.all([this._def.left._parseAsync({ - data: ctx.data, - path: ctx.path, - parent: ctx - }), this._def.right._parseAsync({ - data: ctx.data, - path: ctx.path, - parent: ctx - })]).then(([left, right]) => handleParsed(left, right)); - else return handleParsed(this._def.left._parseSync({ - data: ctx.data, - path: ctx.path, - parent: ctx - }), this._def.right._parseSync({ - data: ctx.data, - path: ctx.path, - parent: ctx - })); - } -}; -ZodIntersection.create = (left, right, params) => { - return new ZodIntersection({ - left, - right, - typeName: ZodFirstPartyTypeKind.ZodIntersection, - ...processCreateParams(params) - }); -}; -var ZodTuple = class ZodTuple extends ZodType { - _parse(input) { - const { status, ctx } = this._processInputParams(input); - if (ctx.parsedType !== ZodParsedType.array) { - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.array, - received: ctx.parsedType - }); - return INVALID; - } - if (ctx.data.length < this._def.items.length) { - addIssueToContext(ctx, { - code: ZodIssueCode.too_small, - minimum: this._def.items.length, - inclusive: true, - exact: false, - type: "array" - }); - return INVALID; - } - if (!this._def.rest && ctx.data.length > this._def.items.length) { - addIssueToContext(ctx, { - code: ZodIssueCode.too_big, - maximum: this._def.items.length, - inclusive: true, - exact: false, - type: "array" - }); - status.dirty(); - } - const items = [...ctx.data].map((item, itemIndex) => { - const schema = this._def.items[itemIndex] || this._def.rest; - if (!schema) return null; - return schema._parse(new ParseInputLazyPath(ctx, item, ctx.path, itemIndex)); - }).filter((x) => !!x); - if (ctx.common.async) return Promise.all(items).then((results) => { - return ParseStatus.mergeArray(status, results); - }); - else return ParseStatus.mergeArray(status, items); - } - get items() { - return this._def.items; - } - rest(rest) { - return new ZodTuple({ - ...this._def, - rest - }); - } -}; -ZodTuple.create = (schemas, params) => { - if (!Array.isArray(schemas)) throw new Error("You must pass an array of schemas to z.tuple([ ... ])"); - return new ZodTuple({ - items: schemas, - typeName: ZodFirstPartyTypeKind.ZodTuple, - rest: null, - ...processCreateParams(params) - }); -}; -var ZodRecord = class ZodRecord extends ZodType { - get keySchema() { - return this._def.keyType; - } - get valueSchema() { - return this._def.valueType; - } - _parse(input) { - const { status, ctx } = this._processInputParams(input); - if (ctx.parsedType !== ZodParsedType.object) { - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.object, - received: ctx.parsedType - }); - return INVALID; - } - const pairs = []; - const keyType = this._def.keyType; - const valueType = this._def.valueType; - for (const key in ctx.data) pairs.push({ - key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, key)), - value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key)), - alwaysSet: key in ctx.data - }); - if (ctx.common.async) return ParseStatus.mergeObjectAsync(status, pairs); - else return ParseStatus.mergeObjectSync(status, pairs); - } - get element() { - return this._def.valueType; - } - static create(first, second, third) { - if (second instanceof ZodType) return new ZodRecord({ - keyType: first, - valueType: second, - typeName: ZodFirstPartyTypeKind.ZodRecord, - ...processCreateParams(third) - }); - return new ZodRecord({ - keyType: ZodString.create(), - valueType: first, - typeName: ZodFirstPartyTypeKind.ZodRecord, - ...processCreateParams(second) - }); - } -}; -var ZodMap = class extends ZodType { - get keySchema() { - return this._def.keyType; - } - get valueSchema() { - return this._def.valueType; - } - _parse(input) { - const { status, ctx } = this._processInputParams(input); - if (ctx.parsedType !== ZodParsedType.map) { - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.map, - received: ctx.parsedType - }); - return INVALID; - } - const keyType = this._def.keyType; - const valueType = this._def.valueType; - const pairs = [...ctx.data.entries()].map(([key, value], index) => { - return { - key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, [index, "key"])), - value: valueType._parse(new ParseInputLazyPath(ctx, value, ctx.path, [index, "value"])) - }; - }); - if (ctx.common.async) { - const finalMap = /* @__PURE__ */ new Map(); - return Promise.resolve().then(async () => { - for (const pair of pairs) { - const key = await pair.key; - const value = await pair.value; - if (key.status === "aborted" || value.status === "aborted") return INVALID; - if (key.status === "dirty" || value.status === "dirty") status.dirty(); - finalMap.set(key.value, value.value); - } - return { - status: status.value, - value: finalMap - }; - }); - } else { - const finalMap = /* @__PURE__ */ new Map(); - for (const pair of pairs) { - const key = pair.key; - const value = pair.value; - if (key.status === "aborted" || value.status === "aborted") return INVALID; - if (key.status === "dirty" || value.status === "dirty") status.dirty(); - finalMap.set(key.value, value.value); - } - return { - status: status.value, - value: finalMap - }; - } - } -}; -ZodMap.create = (keyType, valueType, params) => { - return new ZodMap({ - valueType, - keyType, - typeName: ZodFirstPartyTypeKind.ZodMap, - ...processCreateParams(params) - }); -}; -var ZodSet = class ZodSet extends ZodType { - _parse(input) { - const { status, ctx } = this._processInputParams(input); - if (ctx.parsedType !== ZodParsedType.set) { - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.set, - received: ctx.parsedType - }); - return INVALID; - } - const def = this._def; - if (def.minSize !== null) { - if (ctx.data.size < def.minSize.value) { - addIssueToContext(ctx, { - code: ZodIssueCode.too_small, - minimum: def.minSize.value, - type: "set", - inclusive: true, - exact: false, - message: def.minSize.message - }); - status.dirty(); - } - } - if (def.maxSize !== null) { - if (ctx.data.size > def.maxSize.value) { - addIssueToContext(ctx, { - code: ZodIssueCode.too_big, - maximum: def.maxSize.value, - type: "set", - inclusive: true, - exact: false, - message: def.maxSize.message - }); - status.dirty(); - } - } - const valueType = this._def.valueType; - function finalizeSet(elements) { - const parsedSet = /* @__PURE__ */ new Set(); - for (const element of elements) { - if (element.status === "aborted") return INVALID; - if (element.status === "dirty") status.dirty(); - parsedSet.add(element.value); - } - return { - status: status.value, - value: parsedSet - }; - } - const elements = [...ctx.data.values()].map((item, i) => valueType._parse(new ParseInputLazyPath(ctx, item, ctx.path, i))); - if (ctx.common.async) return Promise.all(elements).then((elements) => finalizeSet(elements)); - else return finalizeSet(elements); - } - min(minSize, message) { - return new ZodSet({ - ...this._def, - minSize: { - value: minSize, - message: errorUtil.toString(message) - } - }); - } - max(maxSize, message) { - return new ZodSet({ - ...this._def, - maxSize: { - value: maxSize, - message: errorUtil.toString(message) - } - }); - } - size(size, message) { - return this.min(size, message).max(size, message); - } - nonempty(message) { - return this.min(1, message); - } -}; -ZodSet.create = (valueType, params) => { - return new ZodSet({ - valueType, - minSize: null, - maxSize: null, - typeName: ZodFirstPartyTypeKind.ZodSet, - ...processCreateParams(params) - }); -}; -var ZodFunction = class ZodFunction extends ZodType { - constructor() { - super(...arguments); - this.validate = this.implement; - } - _parse(input) { - const { ctx } = this._processInputParams(input); - if (ctx.parsedType !== ZodParsedType.function) { - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.function, - received: ctx.parsedType - }); - return INVALID; - } - function makeArgsIssue(args, error) { - return makeIssue({ - data: args, - path: ctx.path, - errorMaps: [ - ctx.common.contextualErrorMap, - ctx.schemaErrorMap, - getErrorMap(), - errorMap - ].filter((x) => !!x), - issueData: { - code: ZodIssueCode.invalid_arguments, - argumentsError: error - } - }); - } - function makeReturnsIssue(returns, error) { - return makeIssue({ - data: returns, - path: ctx.path, - errorMaps: [ - ctx.common.contextualErrorMap, - ctx.schemaErrorMap, - getErrorMap(), - errorMap - ].filter((x) => !!x), - issueData: { - code: ZodIssueCode.invalid_return_type, - returnTypeError: error - } - }); - } - const params = { errorMap: ctx.common.contextualErrorMap }; - const fn = ctx.data; - if (this._def.returns instanceof ZodPromise) { - const me = this; - return OK(async function(...args) { - const error = new ZodError([]); - const parsedArgs = await me._def.args.parseAsync(args, params).catch((e) => { - error.addIssue(makeArgsIssue(args, e)); - throw error; - }); - const result = await Reflect.apply(fn, this, parsedArgs); - return await me._def.returns._def.type.parseAsync(result, params).catch((e) => { - error.addIssue(makeReturnsIssue(result, e)); - throw error; - }); - }); - } else { - const me = this; - return OK(function(...args) { - const parsedArgs = me._def.args.safeParse(args, params); - if (!parsedArgs.success) throw new ZodError([makeArgsIssue(args, parsedArgs.error)]); - const result = Reflect.apply(fn, this, parsedArgs.data); - const parsedReturns = me._def.returns.safeParse(result, params); - if (!parsedReturns.success) throw new ZodError([makeReturnsIssue(result, parsedReturns.error)]); - return parsedReturns.data; - }); - } - } - parameters() { - return this._def.args; - } - returnType() { - return this._def.returns; - } - args(...items) { - return new ZodFunction({ - ...this._def, - args: ZodTuple.create(items).rest(ZodUnknown.create()) - }); - } - returns(returnType) { - return new ZodFunction({ - ...this._def, - returns: returnType - }); - } - implement(func) { - return this.parse(func); - } - strictImplement(func) { - return this.parse(func); - } - static create(args, returns, params) { - return new ZodFunction({ - args: args ? args : ZodTuple.create([]).rest(ZodUnknown.create()), - returns: returns || ZodUnknown.create(), - typeName: ZodFirstPartyTypeKind.ZodFunction, - ...processCreateParams(params) - }); - } -}; -var ZodLazy = class extends ZodType { - get schema() { - return this._def.getter(); - } - _parse(input) { - const { ctx } = this._processInputParams(input); - return this._def.getter()._parse({ - data: ctx.data, - path: ctx.path, - parent: ctx - }); - } -}; -ZodLazy.create = (getter, params) => { - return new ZodLazy({ - getter, - typeName: ZodFirstPartyTypeKind.ZodLazy, - ...processCreateParams(params) - }); -}; -var ZodLiteral = class extends ZodType { - _parse(input) { - if (input.data !== this._def.value) { - const ctx = this._getOrReturnCtx(input); - addIssueToContext(ctx, { - received: ctx.data, - code: ZodIssueCode.invalid_literal, - expected: this._def.value - }); - return INVALID; - } - return { - status: "valid", - value: input.data - }; - } - get value() { - return this._def.value; - } -}; -ZodLiteral.create = (value, params) => { - return new ZodLiteral({ - value, - typeName: ZodFirstPartyTypeKind.ZodLiteral, - ...processCreateParams(params) - }); -}; -function createZodEnum(values, params) { - return new ZodEnum({ - values, - typeName: ZodFirstPartyTypeKind.ZodEnum, - ...processCreateParams(params) - }); -} -var ZodEnum = class ZodEnum extends ZodType { - _parse(input) { - if (typeof input.data !== "string") { - const ctx = this._getOrReturnCtx(input); - const expectedValues = this._def.values; - addIssueToContext(ctx, { - expected: util.joinValues(expectedValues), - received: ctx.parsedType, - code: ZodIssueCode.invalid_type - }); - return INVALID; - } - if (!this._cache) this._cache = new Set(this._def.values); - if (!this._cache.has(input.data)) { - const ctx = this._getOrReturnCtx(input); - const expectedValues = this._def.values; - addIssueToContext(ctx, { - received: ctx.data, - code: ZodIssueCode.invalid_enum_value, - options: expectedValues - }); - return INVALID; - } - return OK(input.data); - } - get options() { - return this._def.values; - } - get enum() { - const enumValues = {}; - for (const val of this._def.values) enumValues[val] = val; - return enumValues; - } - get Values() { - const enumValues = {}; - for (const val of this._def.values) enumValues[val] = val; - return enumValues; - } - get Enum() { - const enumValues = {}; - for (const val of this._def.values) enumValues[val] = val; - return enumValues; - } - extract(values, newDef = this._def) { - return ZodEnum.create(values, { - ...this._def, - ...newDef - }); - } - exclude(values, newDef = this._def) { - return ZodEnum.create(this.options.filter((opt) => !values.includes(opt)), { - ...this._def, - ...newDef - }); - } -}; -ZodEnum.create = createZodEnum; -var ZodNativeEnum = class extends ZodType { - _parse(input) { - const nativeEnumValues = util.getValidEnumValues(this._def.values); - const ctx = this._getOrReturnCtx(input); - if (ctx.parsedType !== ZodParsedType.string && ctx.parsedType !== ZodParsedType.number) { - const expectedValues = util.objectValues(nativeEnumValues); - addIssueToContext(ctx, { - expected: util.joinValues(expectedValues), - received: ctx.parsedType, - code: ZodIssueCode.invalid_type - }); - return INVALID; - } - if (!this._cache) this._cache = new Set(util.getValidEnumValues(this._def.values)); - if (!this._cache.has(input.data)) { - const expectedValues = util.objectValues(nativeEnumValues); - addIssueToContext(ctx, { - received: ctx.data, - code: ZodIssueCode.invalid_enum_value, - options: expectedValues - }); - return INVALID; - } - return OK(input.data); - } - get enum() { - return this._def.values; - } -}; -ZodNativeEnum.create = (values, params) => { - return new ZodNativeEnum({ - values, - typeName: ZodFirstPartyTypeKind.ZodNativeEnum, - ...processCreateParams(params) - }); -}; -var ZodPromise = class extends ZodType { - unwrap() { - return this._def.type; - } - _parse(input) { - const { ctx } = this._processInputParams(input); - if (ctx.parsedType !== ZodParsedType.promise && ctx.common.async === false) { - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.promise, - received: ctx.parsedType - }); - return INVALID; - } - return OK((ctx.parsedType === ZodParsedType.promise ? ctx.data : Promise.resolve(ctx.data)).then((data) => { - return this._def.type.parseAsync(data, { - path: ctx.path, - errorMap: ctx.common.contextualErrorMap - }); - })); - } -}; -ZodPromise.create = (schema, params) => { - return new ZodPromise({ - type: schema, - typeName: ZodFirstPartyTypeKind.ZodPromise, - ...processCreateParams(params) - }); -}; -var ZodEffects = class extends ZodType { - innerType() { - return this._def.schema; - } - sourceType() { - return this._def.schema._def.typeName === ZodFirstPartyTypeKind.ZodEffects ? this._def.schema.sourceType() : this._def.schema; - } - _parse(input) { - const { status, ctx } = this._processInputParams(input); - const effect = this._def.effect || null; - const checkCtx = { - addIssue: (arg) => { - addIssueToContext(ctx, arg); - if (arg.fatal) status.abort(); - else status.dirty(); - }, - get path() { - return ctx.path; - } - }; - checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx); - if (effect.type === "preprocess") { - const processed = effect.transform(ctx.data, checkCtx); - if (ctx.common.async) return Promise.resolve(processed).then(async (processed) => { - if (status.value === "aborted") return INVALID; - const result = await this._def.schema._parseAsync({ - data: processed, - path: ctx.path, - parent: ctx - }); - if (result.status === "aborted") return INVALID; - if (result.status === "dirty") return DIRTY(result.value); - if (status.value === "dirty") return DIRTY(result.value); - return result; - }); - else { - if (status.value === "aborted") return INVALID; - const result = this._def.schema._parseSync({ - data: processed, - path: ctx.path, - parent: ctx - }); - if (result.status === "aborted") return INVALID; - if (result.status === "dirty") return DIRTY(result.value); - if (status.value === "dirty") return DIRTY(result.value); - return result; - } - } - if (effect.type === "refinement") { - const executeRefinement = (acc) => { - const result = effect.refinement(acc, checkCtx); - if (ctx.common.async) return Promise.resolve(result); - if (result instanceof Promise) throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead."); - return acc; - }; - if (ctx.common.async === false) { - const inner = this._def.schema._parseSync({ - data: ctx.data, - path: ctx.path, - parent: ctx - }); - if (inner.status === "aborted") return INVALID; - if (inner.status === "dirty") status.dirty(); - executeRefinement(inner.value); - return { - status: status.value, - value: inner.value - }; - } else return this._def.schema._parseAsync({ - data: ctx.data, - path: ctx.path, - parent: ctx - }).then((inner) => { - if (inner.status === "aborted") return INVALID; - if (inner.status === "dirty") status.dirty(); - return executeRefinement(inner.value).then(() => { - return { - status: status.value, - value: inner.value - }; - }); - }); - } - if (effect.type === "transform") if (ctx.common.async === false) { - const base = this._def.schema._parseSync({ - data: ctx.data, - path: ctx.path, - parent: ctx - }); - if (!isValid(base)) return INVALID; - const result = effect.transform(base.value, checkCtx); - if (result instanceof Promise) throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`); - return { - status: status.value, - value: result - }; - } else return this._def.schema._parseAsync({ - data: ctx.data, - path: ctx.path, - parent: ctx - }).then((base) => { - if (!isValid(base)) return INVALID; - return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({ - status: status.value, - value: result - })); - }); - util.assertNever(effect); - } -}; -ZodEffects.create = (schema, effect, params) => { - return new ZodEffects({ - schema, - typeName: ZodFirstPartyTypeKind.ZodEffects, - effect, - ...processCreateParams(params) - }); -}; -ZodEffects.createWithPreprocess = (preprocess, schema, params) => { - return new ZodEffects({ - schema, - effect: { - type: "preprocess", - transform: preprocess - }, - typeName: ZodFirstPartyTypeKind.ZodEffects, - ...processCreateParams(params) - }); -}; -var ZodOptional = class extends ZodType { - _parse(input) { - if (this._getType(input) === ZodParsedType.undefined) return OK(void 0); - return this._def.innerType._parse(input); - } - unwrap() { - return this._def.innerType; - } -}; -ZodOptional.create = (type, params) => { - return new ZodOptional({ - innerType: type, - typeName: ZodFirstPartyTypeKind.ZodOptional, - ...processCreateParams(params) - }); -}; -var ZodNullable = class extends ZodType { - _parse(input) { - if (this._getType(input) === ZodParsedType.null) return OK(null); - return this._def.innerType._parse(input); - } - unwrap() { - return this._def.innerType; - } -}; -ZodNullable.create = (type, params) => { - return new ZodNullable({ - innerType: type, - typeName: ZodFirstPartyTypeKind.ZodNullable, - ...processCreateParams(params) - }); -}; -var ZodDefault = class extends ZodType { - _parse(input) { - const { ctx } = this._processInputParams(input); - let data = ctx.data; - if (ctx.parsedType === ZodParsedType.undefined) data = this._def.defaultValue(); - return this._def.innerType._parse({ - data, - path: ctx.path, - parent: ctx - }); - } - removeDefault() { - return this._def.innerType; - } -}; -ZodDefault.create = (type, params) => { - return new ZodDefault({ - innerType: type, - typeName: ZodFirstPartyTypeKind.ZodDefault, - defaultValue: typeof params.default === "function" ? params.default : () => params.default, - ...processCreateParams(params) - }); -}; -var ZodCatch = class extends ZodType { - _parse(input) { - const { ctx } = this._processInputParams(input); - const newCtx = { - ...ctx, - common: { - ...ctx.common, - issues: [] - } - }; - const result = this._def.innerType._parse({ - data: newCtx.data, - path: newCtx.path, - parent: { ...newCtx } - }); - if (isAsync(result)) return result.then((result) => { - return { - status: "valid", - value: result.status === "valid" ? result.value : this._def.catchValue({ - get error() { - return new ZodError(newCtx.common.issues); - }, - input: newCtx.data - }) - }; - }); - else return { - status: "valid", - value: result.status === "valid" ? result.value : this._def.catchValue({ - get error() { - return new ZodError(newCtx.common.issues); - }, - input: newCtx.data - }) - }; - } - removeCatch() { - return this._def.innerType; - } -}; -ZodCatch.create = (type, params) => { - return new ZodCatch({ - innerType: type, - typeName: ZodFirstPartyTypeKind.ZodCatch, - catchValue: typeof params.catch === "function" ? params.catch : () => params.catch, - ...processCreateParams(params) - }); -}; -var ZodNaN = class extends ZodType { - _parse(input) { - if (this._getType(input) !== ZodParsedType.nan) { - const ctx = this._getOrReturnCtx(input); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.nan, - received: ctx.parsedType - }); - return INVALID; - } - return { - status: "valid", - value: input.data - }; - } -}; -ZodNaN.create = (params) => { - return new ZodNaN({ - typeName: ZodFirstPartyTypeKind.ZodNaN, - ...processCreateParams(params) - }); -}; -var ZodBranded = class extends ZodType { - _parse(input) { - const { ctx } = this._processInputParams(input); - const data = ctx.data; - return this._def.type._parse({ - data, - path: ctx.path, - parent: ctx - }); - } - unwrap() { - return this._def.type; - } -}; -var ZodPipeline = class ZodPipeline extends ZodType { - _parse(input) { - const { status, ctx } = this._processInputParams(input); - if (ctx.common.async) { - const handleAsync = async () => { - const inResult = await this._def.in._parseAsync({ - data: ctx.data, - path: ctx.path, - parent: ctx - }); - if (inResult.status === "aborted") return INVALID; - if (inResult.status === "dirty") { - status.dirty(); - return DIRTY(inResult.value); - } else return this._def.out._parseAsync({ - data: inResult.value, - path: ctx.path, - parent: ctx - }); - }; - return handleAsync(); - } else { - const inResult = this._def.in._parseSync({ - data: ctx.data, - path: ctx.path, - parent: ctx - }); - if (inResult.status === "aborted") return INVALID; - if (inResult.status === "dirty") { - status.dirty(); - return { - status: "dirty", - value: inResult.value - }; - } else return this._def.out._parseSync({ - data: inResult.value, - path: ctx.path, - parent: ctx - }); - } - } - static create(a, b) { - return new ZodPipeline({ - in: a, - out: b, - typeName: ZodFirstPartyTypeKind.ZodPipeline - }); - } -}; -var ZodReadonly = class extends ZodType { - _parse(input) { - const result = this._def.innerType._parse(input); - const freeze = (data) => { - if (isValid(data)) data.value = Object.freeze(data.value); - return data; - }; - return isAsync(result) ? result.then((data) => freeze(data)) : freeze(result); - } - unwrap() { - return this._def.innerType; - } -}; -ZodReadonly.create = (type, params) => { - return new ZodReadonly({ - innerType: type, - typeName: ZodFirstPartyTypeKind.ZodReadonly, - ...processCreateParams(params) - }); -}; -ZodObject.lazycreate; -var ZodFirstPartyTypeKind; -(function(ZodFirstPartyTypeKind) { - ZodFirstPartyTypeKind["ZodString"] = "ZodString"; - ZodFirstPartyTypeKind["ZodNumber"] = "ZodNumber"; - ZodFirstPartyTypeKind["ZodNaN"] = "ZodNaN"; - ZodFirstPartyTypeKind["ZodBigInt"] = "ZodBigInt"; - ZodFirstPartyTypeKind["ZodBoolean"] = "ZodBoolean"; - ZodFirstPartyTypeKind["ZodDate"] = "ZodDate"; - ZodFirstPartyTypeKind["ZodSymbol"] = "ZodSymbol"; - ZodFirstPartyTypeKind["ZodUndefined"] = "ZodUndefined"; - ZodFirstPartyTypeKind["ZodNull"] = "ZodNull"; - ZodFirstPartyTypeKind["ZodAny"] = "ZodAny"; - ZodFirstPartyTypeKind["ZodUnknown"] = "ZodUnknown"; - ZodFirstPartyTypeKind["ZodNever"] = "ZodNever"; - ZodFirstPartyTypeKind["ZodVoid"] = "ZodVoid"; - ZodFirstPartyTypeKind["ZodArray"] = "ZodArray"; - ZodFirstPartyTypeKind["ZodObject"] = "ZodObject"; - ZodFirstPartyTypeKind["ZodUnion"] = "ZodUnion"; - ZodFirstPartyTypeKind["ZodDiscriminatedUnion"] = "ZodDiscriminatedUnion"; - ZodFirstPartyTypeKind["ZodIntersection"] = "ZodIntersection"; - ZodFirstPartyTypeKind["ZodTuple"] = "ZodTuple"; - ZodFirstPartyTypeKind["ZodRecord"] = "ZodRecord"; - ZodFirstPartyTypeKind["ZodMap"] = "ZodMap"; - ZodFirstPartyTypeKind["ZodSet"] = "ZodSet"; - ZodFirstPartyTypeKind["ZodFunction"] = "ZodFunction"; - ZodFirstPartyTypeKind["ZodLazy"] = "ZodLazy"; - ZodFirstPartyTypeKind["ZodLiteral"] = "ZodLiteral"; - ZodFirstPartyTypeKind["ZodEnum"] = "ZodEnum"; - ZodFirstPartyTypeKind["ZodEffects"] = "ZodEffects"; - ZodFirstPartyTypeKind["ZodNativeEnum"] = "ZodNativeEnum"; - ZodFirstPartyTypeKind["ZodOptional"] = "ZodOptional"; - ZodFirstPartyTypeKind["ZodNullable"] = "ZodNullable"; - ZodFirstPartyTypeKind["ZodDefault"] = "ZodDefault"; - ZodFirstPartyTypeKind["ZodCatch"] = "ZodCatch"; - ZodFirstPartyTypeKind["ZodPromise"] = "ZodPromise"; - ZodFirstPartyTypeKind["ZodBranded"] = "ZodBranded"; - ZodFirstPartyTypeKind["ZodPipeline"] = "ZodPipeline"; - ZodFirstPartyTypeKind["ZodReadonly"] = "ZodReadonly"; -})(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {})); -ZodString.create; -ZodNumber.create; -ZodNaN.create; -ZodBigInt.create; -ZodBoolean.create; -ZodDate.create; -ZodSymbol.create; -ZodUndefined.create; -ZodNull.create; -ZodAny.create; -ZodUnknown.create; -ZodNever.create; -ZodVoid.create; -ZodArray.create; -ZodObject.create; -ZodObject.strictCreate; -ZodUnion.create; -ZodDiscriminatedUnion.create; -ZodIntersection.create; -ZodTuple.create; -ZodRecord.create; -ZodMap.create; -ZodSet.create; -ZodFunction.create; -ZodLazy.create; -ZodLiteral.create; -ZodEnum.create; -ZodNativeEnum.create; -ZodPromise.create; -ZodEffects.create; -ZodOptional.create; -ZodNullable.create; -ZodEffects.createWithPreprocess; -ZodPipeline.create; -//#endregion -//#region node_modules/eventsource-parser/dist/index.js -var ParseError = class extends Error { - constructor(message, options) { - super(message), this.name = "ParseError", this.type = options.type, this.field = options.field, this.value = options.value, this.line = options.line; - } -}; -const LF = 10; -const CR = 13; -const SPACE = 32; -function noop(_arg) {} -function createParser(config) { - if (typeof config == "function") throw new TypeError("`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?"); - const { onEvent = noop, onError = noop, onRetry = noop, onComment, maxBufferSize } = config, pendingFragments = []; - let pendingFragmentsLength = 0, isFirstChunk = !0, id, data = "", dataLines = 0, eventType, terminated = !1; - function feed(chunk) { - if (terminated) throw new Error("Cannot feed parser: it was terminated after exceeding the configured max buffer size. Call `reset()` to resume parsing."); - if (isFirstChunk && (isFirstChunk = !1, chunk.charCodeAt(0) === 239 && chunk.charCodeAt(1) === 187 && chunk.charCodeAt(2) === 191 && (chunk = chunk.slice(3))), pendingFragments.length === 0) { - const trailing2 = processLines(chunk); - trailing2 !== "" && (pendingFragments.push(trailing2), pendingFragmentsLength = trailing2.length), checkBufferSize(); - return; - } - if (chunk.indexOf(` -`) === -1 && chunk.indexOf("\r") === -1) { - pendingFragments.push(chunk), pendingFragmentsLength += chunk.length, checkBufferSize(); - return; - } - pendingFragments.push(chunk); - const input = pendingFragments.join(""); - pendingFragments.length = 0, pendingFragmentsLength = 0; - const trailing = processLines(input); - trailing !== "" && (pendingFragments.push(trailing), pendingFragmentsLength = trailing.length), checkBufferSize(); - } - function checkBufferSize() { - maxBufferSize !== void 0 && (pendingFragmentsLength + data.length <= maxBufferSize || (terminated = !0, pendingFragments.length = 0, pendingFragmentsLength = 0, id = void 0, data = "", dataLines = 0, eventType = void 0, onError(new ParseError(`Buffered data exceeded max buffer size of ${maxBufferSize} characters`, { type: "max-buffer-size-exceeded" })))); - } - function processLines(chunk) { - let searchIndex = 0; - if (chunk.indexOf("\r") === -1) { - let lfIndex = chunk.indexOf(` -`, searchIndex); - for (; lfIndex !== -1;) { - if (searchIndex === lfIndex) { - dataLines > 0 && onEvent({ - id, - event: eventType, - data - }), id = void 0, data = "", dataLines = 0, eventType = void 0, searchIndex = lfIndex + 1, lfIndex = chunk.indexOf(` -`, searchIndex); - continue; - } - const firstCharCode = chunk.charCodeAt(searchIndex); - if (isDataPrefix(chunk, searchIndex, firstCharCode)) { - const valueStart = chunk.charCodeAt(searchIndex + 5) === SPACE ? searchIndex + 6 : searchIndex + 5, value = chunk.slice(valueStart, lfIndex); - if (dataLines === 0 && chunk.charCodeAt(lfIndex + 1) === LF) { - onEvent({ - id, - event: eventType, - data: value - }), id = void 0, data = "", eventType = void 0, searchIndex = lfIndex + 2, lfIndex = chunk.indexOf(` -`, searchIndex); - continue; - } - data = dataLines === 0 ? value : `${data} -${value}`, dataLines++; - } else isEventPrefix(chunk, searchIndex, firstCharCode) ? eventType = chunk.slice(chunk.charCodeAt(searchIndex + 6) === SPACE ? searchIndex + 7 : searchIndex + 6, lfIndex) || void 0 : parseLine(chunk, searchIndex, lfIndex); - searchIndex = lfIndex + 1, lfIndex = chunk.indexOf(` -`, searchIndex); - } - return chunk.slice(searchIndex); - } - for (; searchIndex < chunk.length;) { - const crIndex = chunk.indexOf("\r", searchIndex), lfIndex = chunk.indexOf(` -`, searchIndex); - let lineEnd = -1; - if (crIndex !== -1 && lfIndex !== -1 ? lineEnd = crIndex < lfIndex ? crIndex : lfIndex : crIndex !== -1 ? crIndex === chunk.length - 1 ? lineEnd = -1 : lineEnd = crIndex : lfIndex !== -1 && (lineEnd = lfIndex), lineEnd === -1) break; - parseLine(chunk, searchIndex, lineEnd), searchIndex = lineEnd + 1, chunk.charCodeAt(searchIndex - 1) === CR && chunk.charCodeAt(searchIndex) === LF && searchIndex++; - } - return chunk.slice(searchIndex); - } - function parseLine(chunk, start, end) { - if (start === end) { - dispatchEvent(); - return; - } - const firstCharCode = chunk.charCodeAt(start); - if (isDataPrefix(chunk, start, firstCharCode)) { - const valueStart = chunk.charCodeAt(start + 5) === SPACE ? start + 6 : start + 5, value2 = chunk.slice(valueStart, end); - data = dataLines === 0 ? value2 : `${data} -${value2}`, dataLines++; - return; - } - if (isEventPrefix(chunk, start, firstCharCode)) { - eventType = chunk.slice(chunk.charCodeAt(start + 6) === SPACE ? start + 7 : start + 6, end) || void 0; - return; - } - if (firstCharCode === 105 && chunk.charCodeAt(start + 1) === 100 && chunk.charCodeAt(start + 2) === 58) { - const value2 = chunk.slice(chunk.charCodeAt(start + 3) === SPACE ? start + 4 : start + 3, end); - id = value2.includes("\0") ? void 0 : value2; - return; - } - if (firstCharCode === 58) { - if (onComment) { - const line2 = chunk.slice(start, end); - onComment(line2.slice(chunk.charCodeAt(start + 1) === SPACE ? 2 : 1)); - } - return; - } - const line = chunk.slice(start, end), fieldSeparatorIndex = line.indexOf(":"); - if (fieldSeparatorIndex === -1) { - processField(line, "", line); - return; - } - const field = line.slice(0, fieldSeparatorIndex), offset = line.charCodeAt(fieldSeparatorIndex + 1) === SPACE ? 2 : 1; - processField(field, line.slice(fieldSeparatorIndex + offset), line); - } - function processField(field, value, line) { - switch (field) { - case "event": - eventType = value || void 0; - break; - case "data": - data = dataLines === 0 ? value : `${data} -${value}`, dataLines++; - break; - case "id": - id = value.includes("\0") ? void 0 : value; - break; - case "retry": - /^\d+$/.test(value) ? onRetry(parseInt(value, 10)) : onError(new ParseError(`Invalid \`retry\` value: "${value}"`, { - type: "invalid-retry", - value, - line - })); - break; - default: - onError(new ParseError(`Unknown field "${field.length > 20 ? `${field.slice(0, 20)}\u2026` : field}"`, { - type: "unknown-field", - field, - value, - line - })); - break; - } - } - function dispatchEvent() { - dataLines > 0 && onEvent({ - id, - event: eventType, - data - }), id = void 0, data = "", dataLines = 0, eventType = void 0; - } - function reset(options = {}) { - if (options.consume && pendingFragments.length > 0) { - const incompleteLine = pendingFragments.join(""); - parseLine(incompleteLine, 0, incompleteLine.length); - } - isFirstChunk = !0, id = void 0, data = "", dataLines = 0, eventType = void 0, pendingFragments.length = 0, pendingFragmentsLength = 0, terminated = !1; - } - return { - feed, - reset - }; -} -function isDataPrefix(chunk, i, firstCharCode) { - return firstCharCode === 100 && chunk.charCodeAt(i + 1) === 97 && chunk.charCodeAt(i + 2) === 116 && chunk.charCodeAt(i + 3) === 97 && chunk.charCodeAt(i + 4) === 58; -} -function isEventPrefix(chunk, i, firstCharCode) { - return firstCharCode === 101 && chunk.charCodeAt(i + 1) === 118 && chunk.charCodeAt(i + 2) === 101 && chunk.charCodeAt(i + 3) === 110 && chunk.charCodeAt(i + 4) === 116 && chunk.charCodeAt(i + 5) === 58; -} -//#endregion -//#region node_modules/eventsource-parser/dist/stream.js -var EventSourceParserStream = class extends TransformStream { - constructor({ onError, onRetry, onComment, maxBufferSize } = {}) { - let parser; - super({ - start(controller) { - parser = createParser({ - onEvent: (event) => { - controller.enqueue(event); - }, - onError(error) { - typeof onError == "function" && onError(error), (onError === "terminate" || error.type === "max-buffer-size-exceeded") && controller.error(error); - }, - onRetry, - onComment, - maxBufferSize - }); - }, - transform(chunk) { - parser.feed(chunk); - } - }); - } -}; -//#endregion -//#region node_modules/@workflow/serde/dist/index.js -/** -* Symbol used to define custom serialization for user-defined class instances. -* The static method should accept an instance and return serializable data. -* -* @example -* ```ts -* import { WORKFLOW_SERIALIZE, WORKFLOW_DESERIALIZE } from '@workflow/serde'; -* -* class MyClass { -* constructor(public value: string) {} -* -* static [WORKFLOW_SERIALIZE](instance: MyClass) { -* return { value: instance.value }; -* } -* -* static [WORKFLOW_DESERIALIZE](data: { value: string }) { -* return new MyClass(data.value); -* } -* } -* ``` -*/ -const WORKFLOW_SERIALIZE = Symbol.for("workflow-serialize"); -/** -* Symbol used to define custom deserialization for user-defined class instances. -* The static method should accept serialized data and return a class instance. -* -* @see WORKFLOW_SERIALIZE for usage example -*/ -const WORKFLOW_DESERIALIZE = Symbol.for("workflow-deserialize"); -//#endregion -//#region node_modules/@ai-sdk/provider-utils/dist/index.js -function asArray(value) { - return value === void 0 ? [] : Array.isArray(value) ? value : [value]; -} -function combineHeaders(...headers) { - return headers.reduce((combinedHeaders, currentHeaders) => ({ - ...combinedHeaders, - ...currentHeaders != null ? currentHeaders : {} - }), {}); -} -function removeUndefinedEntries(record) { - return Object.fromEntries(Object.entries(record).filter(([_key, value]) => value != null)); -} -async function delay(delayInMs, options) { - if (delayInMs == null) return Promise.resolve(); - const signal = options == null ? void 0 : options.abortSignal; - return new Promise((resolve2, reject) => { - if (signal == null ? void 0 : signal.aborted) { - reject(createAbortError()); - return; - } - const timeoutId = setTimeout(() => { - cleanup(); - resolve2(); - }, delayInMs); - const cleanup = () => { - clearTimeout(timeoutId); - signal?.removeEventListener("abort", onAbort); - }; - const onAbort = () => { - cleanup(); - reject(createAbortError()); - }; - signal?.addEventListener("abort", onAbort); - }); -} -function createAbortError() { - return new DOMException("Delay was aborted", "AbortError"); -} -function getWebSocketConstructor(webSocket) { - const WebSocketConstructor = webSocket != null ? webSocket : globalThis.WebSocket; - if (WebSocketConstructor == null) throw new Error("No WebSocket implementation available."); - return WebSocketConstructor; -} -var textDecoder = new TextDecoder(); -async function readWebSocketMessageText(data) { - if (typeof data === "string") return data; - if (data instanceof ArrayBuffer) return textDecoder.decode(data); - if (ArrayBuffer.isView(data)) return textDecoder.decode(data); - if (typeof Blob !== "undefined" && data instanceof Blob) return data.text(); - return String(data); -} -var WEBSOCKET_OPEN_STATE = 1; -async function waitForWebSocketBufferDrain(socket, { highWaterMark = 1024 * 1024, pollIntervalMs = 20, abortSignal } = {}) { - var _a2; - while (socket.readyState === WEBSOCKET_OPEN_STATE && ((_a2 = socket.bufferedAmount) != null ? _a2 : 0) > highWaterMark) { - if ((abortSignal == null ? void 0 : abortSignal.aborted) === true) return; - await delay(pollIntervalMs); - } -} -function connectToWebSocket({ url, protocols, headers, webSocket, abortSignal, onOpen, onMessageText, onProcessingError, onSocketError, onClose, onAbort }) { - var _a2; - let socket; - let abortListener; - const close = (code) => { - if (abortListener != null) { - abortSignal?.removeEventListener("abort", abortListener); - abortListener = void 0; - } - try { - socket?.close(code); - } catch (e) {} - }; - if (abortSignal == null ? void 0 : abortSignal.aborted) { - onAbort?.((_a2 = abortSignal.reason) != null ? _a2 : /* @__PURE__ */ new Error("Aborted")); - return { - socket: void 0, - close - }; - } - try { - socket = new (getWebSocketConstructor(webSocket))(url, protocols, { headers: removeUndefinedEntries(headers != null ? headers : {}) }); - } catch (error) { - onProcessingError(error); - return { - socket: void 0, - close - }; - } - if (abortSignal != null && onAbort != null) { - abortListener = () => { - var _a3; - return onAbort((_a3 = abortSignal.reason) != null ? _a3 : /* @__PURE__ */ new Error("Aborted")); - }; - abortSignal.addEventListener("abort", abortListener, { once: true }); - } - const openedSocket = socket; - socket.onopen = () => { - try { - onOpen?.(openedSocket); - } catch (error) { - onProcessingError(error); - } - }; - let tail = Promise.resolve(); - socket.onmessage = (event) => { - tail = tail.then(() => readWebSocketMessageText(event.data)).then((text) => onMessageText(text)).catch(onProcessingError); - }; - socket.onerror = () => { - tail = tail.then(() => onSocketError == null ? void 0 : onSocketError()).catch(onProcessingError); - }; - socket.onclose = () => { - tail = tail.then(() => onClose == null ? void 0 : onClose()).catch(onProcessingError); - }; - return { - socket, - close - }; -} -var { btoa: btoa$1, atob: atob$1 } = globalThis; -function convertBase64ToUint8Array(base64String) { - const latin1string = atob$1(base64String.replace(/-/g, "+").replace(/_/g, "/")); - return Uint8Array.from(latin1string, (byte) => byte.codePointAt(0)); -} -function convertUint8ArrayToBase64(array) { - let latin1string = ""; - for (let i = 0; i < array.length; i++) latin1string += String.fromCodePoint(array[i]); - return btoa$1(latin1string); -} -var DelayedPromise = class { - constructor() { - this.status = { type: "pending" }; - this._resolve = void 0; - this._reject = void 0; - } - get promise() { - if (this._promise) return this._promise; - this._promise = new Promise((resolve2, reject) => { - if (this.status.type === "resolved") resolve2(this.status.value); - else if (this.status.type === "rejected") reject(this.status.error); - this._resolve = resolve2; - this._reject = reject; - }); - return this._promise; - } - resolve(value) { - var _a2; - this.status = { - type: "resolved", - value - }; - if (this._promise) (_a2 = this._resolve) == null || _a2.call(this, value); - } - reject(error) { - var _a2; - this.status = { - type: "rejected", - error - }; - if (this._promise) (_a2 = this._reject) == null || _a2.call(this, error); - } - isResolved() { - return this.status.type === "resolved"; - } - isRejected() { - return this.status.type === "rejected"; - } - isPending() { - return this.status.type === "pending"; - } -}; -var imageMediaTypeSignatures = [ - { - mediaType: "image/gif", - bytesPrefix: [ - 71, - 73, - 70 - ] - }, - { - mediaType: "image/png", - bytesPrefix: [ - 137, - 80, - 78, - 71 - ] - }, - { - mediaType: "image/jpeg", - bytesPrefix: [255, 216] - }, - { - mediaType: "image/webp", - bytesPrefix: [ - 82, - 73, - 70, - 70, - null, - null, - null, - null, - 87, - 69, - 66, - 80 - ] - }, - { - mediaType: "image/bmp", - bytesPrefix: [66, 77] - }, - { - mediaType: "image/tiff", - bytesPrefix: [ - 73, - 73, - 42, - 0 - ] - }, - { - mediaType: "image/tiff", - bytesPrefix: [ - 77, - 77, - 0, - 42 - ] - }, - { - mediaType: "image/avif", - bytesPrefix: [ - 0, - 0, - 0, - 32, - 102, - 116, - 121, - 112, - 97, - 118, - 105, - 102 - ] - }, - { - mediaType: "image/heic", - bytesPrefix: [ - 0, - 0, - 0, - 32, - 102, - 116, - 121, - 112, - 104, - 101, - 105, - 99 - ] - } -]; -var documentMediaTypeSignatures = [{ - mediaType: "application/pdf", - bytesPrefix: [ - 37, - 80, - 68, - 70 - ] -}]; -var audioMediaTypeSignatures = [ - { - mediaType: "audio/mpeg", - bytesPrefix: [255, 251] - }, - { - mediaType: "audio/mpeg", - bytesPrefix: [255, 250] - }, - { - mediaType: "audio/mpeg", - bytesPrefix: [255, 243] - }, - { - mediaType: "audio/mpeg", - bytesPrefix: [255, 242] - }, - { - mediaType: "audio/mpeg", - bytesPrefix: [255, 227] - }, - { - mediaType: "audio/mpeg", - bytesPrefix: [255, 226] - }, - { - mediaType: "audio/wav", - bytesPrefix: [ - 82, - 73, - 70, - 70, - null, - null, - null, - null, - 87, - 65, - 86, - 69 - ] - }, - { - mediaType: "audio/ogg", - bytesPrefix: [ - 79, - 103, - 103, - 83 - ] - }, - { - mediaType: "audio/flac", - bytesPrefix: [ - 102, - 76, - 97, - 67 - ] - }, - { - mediaType: "audio/aac", - bytesPrefix: [ - 64, - 21, - 0, - 0 - ] - }, - { - mediaType: "audio/mp4", - bytesPrefix: [ - 102, - 116, - 121, - 112 - ] - }, - { - mediaType: "audio/webm", - bytesPrefix: [ - 26, - 69, - 223, - 163 - ] - } -]; -var videoMediaTypeSignatures = [ - { - mediaType: "video/mp4", - bytesPrefix: [ - 0, - 0, - 0, - null, - 102, - 116, - 121, - 112 - ] - }, - { - mediaType: "video/webm", - bytesPrefix: [ - 26, - 69, - 223, - 163 - ] - }, - { - mediaType: "video/quicktime", - bytesPrefix: [ - 0, - 0, - 0, - 20, - 102, - 116, - 121, - 112, - 113, - 116 - ] - }, - { - mediaType: "video/x-msvideo", - bytesPrefix: [ - 82, - 73, - 70, - 70 - ] - } -]; -var stripID3 = (data) => { - const bytes = typeof data === "string" ? convertBase64ToUint8Array(data) : data; - const id3Size = (bytes[6] & 127) << 21 | (bytes[7] & 127) << 14 | (bytes[8] & 127) << 7 | bytes[9] & 127; - return bytes.slice(id3Size + 10); -}; -function stripID3TagsIfPresent(data) { - return typeof data === "string" && data.startsWith("SUQz") || typeof data !== "string" && data.length > 10 && data[0] === 73 && data[1] === 68 && data[2] === 51 ? stripID3(data) : data; -} -function detectMediaTypeBySignatures({ data, signatures }) { - const processedData = stripID3TagsIfPresent(data); - const bytes = typeof processedData === "string" ? convertBase64ToUint8Array(processedData.substring(0, Math.min(processedData.length, 24))) : processedData; - for (const signature of signatures) if (bytes.length >= signature.bytesPrefix.length && signature.bytesPrefix.every((byte, index) => byte === null || bytes[index] === byte)) return signature.mediaType; -} -var topLevelSignatureTables = { - image: imageMediaTypeSignatures, - audio: audioMediaTypeSignatures, - video: videoMediaTypeSignatures, - application: documentMediaTypeSignatures -}; -function detectMediaType({ data, topLevelType }) { - if (topLevelType === void 0) return detectMediaTypeBySignatures({ - data, - signatures: [ - ...imageMediaTypeSignatures, - ...documentMediaTypeSignatures, - ...audioMediaTypeSignatures, - ...videoMediaTypeSignatures - ] - }); - const signatures = topLevelSignatureTables[topLevelType]; - if (signatures === void 0) return; - return detectMediaTypeBySignatures({ - data, - signatures - }); -} -function isFullMediaType(mediaType) { - const slashIndex = mediaType.indexOf("/"); - if (slashIndex === -1) return false; - const subtype = mediaType.substring(slashIndex + 1); - return subtype.length > 0 && subtype !== "*"; -} -async function cancelResponseBody(response) { - var _a2; - try { - await ((_a2 = response.body) == null ? void 0 : _a2.cancel()); - } catch (e) {} -} -var name$1 = "AI_DownloadError"; -var marker = `vercel.ai.error.${name$1}`; -var symbol$1 = Symbol.for(marker); -var _a$1; -var _b$1; -var DownloadError = class extends (_b$1 = AISDKError, _a$1 = symbol$1, _b$1) { - constructor({ url, statusCode, statusText, cause, message = cause == null ? `Failed to download ${url}: ${statusCode} ${statusText}` : `Failed to download ${url}: ${cause}` }) { - super({ - name: name$1, - message, - cause - }); - this[_a$1] = true; - this.url = url; - this.statusCode = statusCode; - this.statusText = statusText; - } - static isInstance(error) { - return AISDKError.hasMarker(error, marker); - } -}; -function isBrowserRuntime(globalThisAny = globalThis) { - return globalThisAny.window != null; -} -function isSameOrigin(url, baseUrl) { - try { - return new URL(url).origin === new URL(baseUrl).origin; - } catch (e) { - return false; - } -} -var BLOCKED_REQUEST_HEADERS = [ - "connection", - "keep-alive", - "te", - "trailer", - "transfer-encoding", - "upgrade", - "host", - "forwarded", - "proxy-authorization", - "via", - "x-forwarded-for", - "x-forwarded-host", - "x-forwarded-proto", - "x-real-ip", - "metadata", - "metadata-flavor", - "x-aws-ec2-metadata-token", - "x-metadata-token", - "cookie", - "set-cookie" -]; -function sanitizeRequestHeaders(input) { - const headers = new Headers(input); - for (const name2 of BLOCKED_REQUEST_HEADERS) headers.delete(name2); - return headers; -} -function validateDownloadUrl(url) { - let parsed; - try { - parsed = new URL(url); - } catch (e) { - throw new DownloadError({ - url, - message: `Invalid URL: ${url}` - }); - } - if (parsed.protocol === "data:") return; - if (parsed.protocol !== "http:" && parsed.protocol !== "https:") throw new DownloadError({ - url, - message: `URL scheme must be http, https, or data, got ${parsed.protocol}` - }); - const hostname = parsed.hostname.toLowerCase().replace(/\.+$/, ""); - if (!hostname) throw new DownloadError({ - url, - message: `URL must have a hostname` - }); - if (hostname === "localhost" || hostname.endsWith(".local") || hostname.endsWith(".localhost")) throw new DownloadError({ - url, - message: `URL with hostname ${hostname} is not allowed` - }); - if (hostname.startsWith("[") && hostname.endsWith("]")) { - if (isPrivateIPv6(hostname.slice(1, -1))) throw new DownloadError({ - url, - message: `URL with IPv6 address ${hostname} is not allowed` - }); - return; - } - if (isIPv4(hostname)) { - if (isPrivateIPv4(hostname)) throw new DownloadError({ - url, - message: `URL with IP address ${hostname} is not allowed` - }); - return; - } -} -function isIPv4(hostname) { - const parts = hostname.split("."); - if (parts.length !== 4) return false; - return parts.every((part) => { - const num = Number(part); - return Number.isInteger(num) && num >= 0 && num <= 255 && String(num) === part; - }); -} -function isPrivateIPv4(ip) { - const [a, b, c] = ip.split(".").map(Number); - if (a === 0) return true; - if (a === 10) return true; - if (a === 100 && b >= 64 && b <= 127) return true; - if (a === 127) return true; - if (a === 169 && b === 254) return true; - if (a === 172 && b >= 16 && b <= 31) return true; - if (a === 192 && b === 0 && c === 0) return true; - if (a === 192 && b === 0 && c === 2) return true; - if (a === 192 && b === 168) return true; - if (a === 198 && (b === 18 || b === 19)) return true; - if (a === 198 && b === 51 && c === 100) return true; - if (a === 203 && b === 0 && c === 113) return true; - if (a >= 224) return true; - return false; -} -function parseIPv6(ip) { - let address = ip.toLowerCase(); - const zoneIndex = address.indexOf("%"); - if (zoneIndex !== -1) address = address.slice(0, zoneIndex); - const halves = address.split("::"); - if (halves.length > 2) return null; - const toGroups = (segment) => { - if (segment === "") return []; - const groups = []; - const parts = segment.split(":"); - for (let i = 0; i < parts.length; i++) { - const part = parts[i]; - if (part.includes(".")) { - if (i !== parts.length - 1 || !isIPv4(part)) return null; - const [a, b, c, d] = part.split(".").map(Number); - groups.push(a << 8 | b, c << 8 | d); - continue; - } - if (!/^[0-9a-f]{1,4}$/.test(part)) return null; - groups.push(parseInt(part, 16)); - } - return groups; - }; - const head = toGroups(halves[0]); - if (head === null) return null; - if (halves.length === 2) { - const tail = toGroups(halves[1]); - if (tail === null) return null; - const fill = 8 - head.length - tail.length; - if (fill < 0) return null; - return [ - ...head, - ...new Array(fill).fill(0), - ...tail - ]; - } - return head.length === 8 ? head : null; -} -function isPrivateIPv6(ip) { - const groups = parseIPv6(ip); - if (groups === null) return true; - const topZero = (count) => groups.slice(0, count).every((group) => group === 0); - if (topZero(7) && (groups[7] === 0 || groups[7] === 1)) return true; - if ((groups[0] & 65024) === 64512) return true; - if ((groups[0] & 65472) === 65152) return true; - if ((groups[0] & 65472) === 65216) return true; - if ((groups[0] & 65280) === 65280) return true; - if (groups[0] === 8193 && groups[1] === 3512) return true; - if (groups[0] === 16383 && (groups[1] & 61440) === 0) return true; - if (topZero(6) || topZero(5) && groups[5] === 65535 || topZero(4) && groups[4] === 65535 && groups[5] === 0 || groups[0] === 100 && groups[1] === 65435 && groups[2] === 0 && groups[3] === 0 && groups[4] === 0 && groups[5] === 0 || groups[0] === 100 && groups[1] === 65435 && groups[2] === 1) return isPrivateIPv4(`${groups[6] >> 8 & 255}.${groups[6] & 255}.${groups[7] >> 8 & 255}.${groups[7] & 255}`); - return false; -} -var MAX_DOWNLOAD_REDIRECTS = 10; -var REDIRECT_STATUS_CODES = /* @__PURE__ */ new Set([ - 301, - 302, - 303, - 307, - 308 -]); -async function fetchWithValidatedRedirects({ url, headers, abortSignal, maxRedirects = MAX_DOWNLOAD_REDIRECTS, fetch = globalThis.fetch, trustedOrigin }) { - let currentHeaders = headers === void 0 ? void 0 : sanitizeRequestHeaders(headers); - const perHopInit = (redirect) => { - const init = { - signal: abortSignal, - redirect - }; - if (currentHeaders !== void 0) init.headers = new Headers(currentHeaders); - return init; - }; - let currentUrl = url; - for (let redirectCount = 0; redirectCount <= maxRedirects; redirectCount++) { - if (trustedOrigin === void 0 || !isSameOrigin(currentUrl, trustedOrigin)) validateDownloadUrl(currentUrl); - const response = await fetch(currentUrl, perHopInit("manual")); - if (response.type === "opaqueredirect") { - if (!isBrowserRuntime()) throw new DownloadError({ - url, - message: `Redirect from ${currentUrl} could not be validated and was blocked` - }); - return await fetch(currentUrl, perHopInit("follow")); - } - const location = response.headers.get("location"); - if (REDIRECT_STATUS_CODES.has(response.status) && location) { - await cancelResponseBody(response); - const nextUrl = new URL(location, currentUrl).toString(); - if (currentHeaders !== void 0 && !isSameOrigin(nextUrl, currentUrl)) { - const userAgent = currentHeaders.get("user-agent"); - currentHeaders = new Headers(userAgent == null ? void 0 : { "user-agent": userAgent }); - } - currentUrl = nextUrl; - continue; - } - return response; - } - throw new DownloadError({ - url, - message: `Too many redirects (max ${maxRedirects})` - }); -} -async function readResponseWithSizeLimit({ response, url, maxBytes = 2147483648 }) { - const contentLength = response.headers.get("content-length"); - if (contentLength != null) { - const length = parseInt(contentLength, 10); - if (!isNaN(length) && length > maxBytes) { - await cancelResponseBody(response); - throw new DownloadError({ - url, - message: `Download of ${url} exceeded maximum size of ${maxBytes} bytes (Content-Length: ${length}).` - }); - } - } - const body = response.body; - if (body == null) return /* @__PURE__ */ new Uint8Array(0); - const reader = body.getReader(); - const chunks = []; - let totalBytes = 0; - try { - while (true) { - const { done, value } = await reader.read(); - if (done) break; - totalBytes += value.length; - if (totalBytes > maxBytes) throw new DownloadError({ - url, - message: `Download of ${url} exceeded maximum size of ${maxBytes} bytes.` - }); - chunks.push(value); - } - } finally { - try { - await reader.cancel(); - } finally { - reader.releaseLock(); - } - } - const result = new Uint8Array(totalBytes); - let offset = 0; - for (const chunk of chunks) { - result.set(chunk, offset); - offset += chunk.length; - } - return result; -} -function extractResponseHeaders(response) { - return Object.fromEntries([...response.headers]); -} -function filterNullable(...values) { - return values.filter((value) => value != null); -} -var createIdGenerator = ({ prefix, size = 16, alphabet = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", separator = "-" } = {}) => { - const generator = () => { - const alphabetLength = alphabet.length; - const chars = new Array(size); - for (let i = 0; i < size; i++) chars[i] = alphabet[Math.random() * alphabetLength | 0]; - return chars.join(""); - }; - if (prefix == null) return generator; - if (alphabet.includes(separator)) throw new InvalidArgumentError({ - argument: "separator", - message: `The separator "${separator}" must not be part of the alphabet "${alphabet}".` - }); - return () => `${prefix}${separator}${generator()}`; -}; -createIdGenerator(); -function isAbortError(error) { - return (error instanceof Error || error instanceof DOMException) && (error.name === "AbortError" || error.name === "ResponseAborted" || error.name === "TimeoutError"); -} -var FETCH_FAILED_ERROR_MESSAGES = ["fetch failed", "failed to fetch"]; -var BUN_ERROR_CODES = [ - "ConnectionRefused", - "ConnectionClosed", - "FailedToOpenSocket", - "ECONNRESET", - "ECONNREFUSED", - "ETIMEDOUT", - "EPIPE" -]; -function isBunNetworkError(error) { - if (!(error instanceof Error)) return false; - const code = error.code; - if (typeof code === "string" && BUN_ERROR_CODES.includes(code)) return true; - return false; -} -function handleFetchError({ error, url, requestBodyValues }) { - if (isAbortError(error)) return error; - if (error instanceof TypeError && FETCH_FAILED_ERROR_MESSAGES.includes(error.message.toLowerCase())) { - const cause = error.cause; - if (cause != null) return new APICallError({ - message: `Cannot connect to API: ${cause.message}`, - cause, - url, - requestBodyValues, - isRetryable: true - }); - } - if (isBunNetworkError(error)) return new APICallError({ - message: `Cannot connect to API: ${error.message}`, - cause: error, - url, - requestBodyValues, - isRetryable: true - }); - return error; -} -function getRuntimeEnvironmentUserAgent(globalThisAny = globalThis) { - var _a2, _b2, _c; - if (globalThisAny.window) return `runtime/browser`; - if ((_a2 = globalThisAny.navigator) == null ? void 0 : _a2.userAgent) return `runtime/${globalThisAny.navigator.userAgent.toLowerCase()}`; - if ((_c = (_b2 = globalThisAny.process) == null ? void 0 : _b2.versions) == null ? void 0 : _c.node) return `runtime/node.js/${globalThisAny.process.version.substring(0)}`; - if (globalThisAny.EdgeRuntime) return `runtime/vercel-edge`; - return "runtime/unknown"; -} -function normalizeHeaders(headers) { - if (headers == null) return {}; - const normalized = {}; - if (headers instanceof Headers) headers.forEach((value, key) => { - normalized[key.toLowerCase()] = value; - }); - else { - if (!Array.isArray(headers)) headers = Object.entries(headers); - for (const [key, value] of headers) if (value != null) normalized[key.toLowerCase()] = value; - } - return normalized; -} -function withUserAgentSuffix(headers, ...userAgentSuffixParts) { - const normalizedHeaders = new Headers(normalizeHeaders(headers)); - const currentUserAgentHeader = normalizedHeaders.get("user-agent") || ""; - normalizedHeaders.set("user-agent", [currentUserAgentHeader, ...userAgentSuffixParts].filter(Boolean).join(" ")); - return Object.fromEntries(normalizedHeaders.entries()); -} -var getOriginalFetch = () => globalThis.fetch; -var getFromApi = async ({ url, headers = {}, successfulResponseHandler, failedResponseHandler, abortSignal, fetch = getOriginalFetch(), validateUrl, credentialedOrigin, trustedOrigin }) => { - try { - const requestHeaders = withUserAgentSuffix(credentialedOrigin !== void 0 && !isSameOrigin(url, credentialedOrigin) ? {} : headers, `ai-sdk/provider-utils/5.0.10`, getRuntimeEnvironmentUserAgent()); - const response = validateUrl ? await fetchWithValidatedRedirects({ - url, - headers: requestHeaders, - abortSignal, - fetch, - trustedOrigin - }) : await fetch(url, { - method: "GET", - headers: requestHeaders, - signal: abortSignal - }); - const responseHeaders = extractResponseHeaders(response); - if (!response.ok) { - let errorInformation; - try { - errorInformation = await failedResponseHandler({ - response, - url, - requestBodyValues: {} - }); - } catch (error) { - if (isAbortError(error) || APICallError.isInstance(error)) throw error; - throw new APICallError({ - message: "Failed to process error response", - cause: error, - statusCode: response.status, - url, - responseHeaders, - requestBodyValues: {} - }); - } - throw errorInformation.value; - } - try { - return await successfulResponseHandler({ - response, - url, - requestBodyValues: {} - }); - } catch (error) { - if (error instanceof Error) { - if (isAbortError(error) || APICallError.isInstance(error)) throw error; - } - throw new APICallError({ - message: "Failed to process successful response", - cause: error, - statusCode: response.status, - url, - responseHeaders, - requestBodyValues: {} - }); - } - } catch (error) { - throw handleFetchError({ - error, - url, - requestBodyValues: {} - }); - } -}; -function isBuffer(value) { - var _a2, _b2; - return (_b2 = (_a2 = globalThis.Buffer) == null ? void 0 : _a2.isBuffer(value)) != null ? _b2 : false; -} -function isProviderReference(data) { - return typeof data === "object" && data !== null && !(data instanceof Uint8Array) && !(data instanceof URL) && !(data instanceof ArrayBuffer) && !isBuffer(data) && !("type" in data); -} -function isUrlSupported({ mediaType, url, supportedUrls }) { - url = url.toLowerCase(); - mediaType = mediaType.toLowerCase(); - const isTopLevelOnly = !mediaType.includes("/"); - return Object.entries(supportedUrls).map(([key, value]) => { - const mediaType2 = key.toLowerCase(); - return mediaType2 === "*" || mediaType2 === "*/*" ? { - mediaTypePrefix: "", - regexes: value - } : { - mediaTypePrefix: mediaType2.replace(/\*/, ""), - regexes: value - }; - }).filter(({ mediaTypePrefix }) => { - if (mediaTypePrefix === "") return true; - if (isTopLevelOnly) return `${mediaType}/` === mediaTypePrefix; - return mediaType.startsWith(mediaTypePrefix); - }).flatMap(({ regexes }) => regexes).some((pattern) => pattern.test(url)); -} -function loadOptionalSetting({ settingValue, environmentVariableName }) { - if (typeof settingValue === "string") return settingValue; - if (settingValue != null || typeof process === "undefined") return; - settingValue = process.env[environmentVariableName]; - if (settingValue == null || typeof settingValue !== "string") return; - return settingValue; -} -var suspectProtoRx = /"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/; -var suspectConstructorRx = /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/; -function _parse(text) { - const obj = JSON.parse(text); - if (obj === null || typeof obj !== "object") return obj; - if (suspectProtoRx.test(text) === false && suspectConstructorRx.test(text) === false) return obj; - return filter(obj); -} -function filter(obj) { - let next = [obj]; - while (next.length) { - const nodes = next; - next = []; - for (const node of nodes) { - if (Object.prototype.hasOwnProperty.call(node, "__proto__")) throw new SyntaxError("Object contains forbidden prototype property"); - if (Object.prototype.hasOwnProperty.call(node, "constructor") && node.constructor !== null && typeof node.constructor === "object" && Object.prototype.hasOwnProperty.call(node.constructor, "prototype")) throw new SyntaxError("Object contains forbidden prototype property"); - for (const key in node) { - const value = node[key]; - if (value && typeof value === "object") next.push(value); - } - } - } - return obj; -} -function secureJsonParse(text) { - const { stackTraceLimit } = Error; - try { - Error.stackTraceLimit = 0; - } catch (e) { - return _parse(text); - } - try { - return _parse(text); - } finally { - Error.stackTraceLimit = stackTraceLimit; - } -} -function addAdditionalPropertiesToJsonSchema(jsonSchema2) { - if (jsonSchema2.type === "object" || Array.isArray(jsonSchema2.type) && jsonSchema2.type.includes("object")) { - jsonSchema2.additionalProperties = false; - const { properties } = jsonSchema2; - if (properties != null) for (const key of Object.keys(properties)) properties[key] = visit(properties[key]); - } - if (jsonSchema2.items != null) jsonSchema2.items = Array.isArray(jsonSchema2.items) ? jsonSchema2.items.map(visit) : visit(jsonSchema2.items); - if (jsonSchema2.anyOf != null) jsonSchema2.anyOf = jsonSchema2.anyOf.map(visit); - if (jsonSchema2.allOf != null) jsonSchema2.allOf = jsonSchema2.allOf.map(visit); - if (jsonSchema2.oneOf != null) jsonSchema2.oneOf = jsonSchema2.oneOf.map(visit); - const { definitions } = jsonSchema2; - if (definitions != null) for (const key of Object.keys(definitions)) definitions[key] = visit(definitions[key]); - return jsonSchema2; -} -function visit(def) { - if (typeof def === "boolean") return def; - return addAdditionalPropertiesToJsonSchema(def); -} -var ignoreOverride = /* @__PURE__ */ Symbol("Let zodToJsonSchema decide on which parser to use"); -var defaultOptions = { - name: void 0, - $refStrategy: "root", - basePath: ["#"], - effectStrategy: "input", - pipeStrategy: "all", - dateStrategy: "format:date-time", - mapStrategy: "entries", - removeAdditionalStrategy: "passthrough", - allowedAdditionalProperties: true, - rejectedAdditionalProperties: false, - definitionPath: "definitions", - strictUnions: false, - definitions: {}, - errorMessages: false, - patternStrategy: "escape", - applyRegexFlags: false, - emailStrategy: "format:email", - base64Strategy: "contentEncoding:base64", - nameStrategy: "ref" -}; -var getDefaultOptions = (options) => typeof options === "string" ? { - ...defaultOptions, - name: options -} : { - ...defaultOptions, - ...options -}; -function parseAnyDef() { - return {}; -} -function parseArrayDef(def, refs) { - var _a2, _b2, _c; - const res = { type: "array" }; - if (((_a2 = def.type) == null ? void 0 : _a2._def) && ((_c = (_b2 = def.type) == null ? void 0 : _b2._def) == null ? void 0 : _c.typeName) !== ZodFirstPartyTypeKind.ZodAny) res.items = parseDef(def.type._def, { - ...refs, - currentPath: [...refs.currentPath, "items"] - }); - if (def.minLength) res.minItems = def.minLength.value; - if (def.maxLength) res.maxItems = def.maxLength.value; - if (def.exactLength) { - res.minItems = def.exactLength.value; - res.maxItems = def.exactLength.value; - } - return res; -} -function parseBigintDef(def) { - const res = { - type: "integer", - format: "int64" - }; - if (!def.checks) return res; - for (const check of def.checks) switch (check.kind) { - case "min": - if (check.inclusive) res.minimum = check.value; - else res.exclusiveMinimum = check.value; - break; - case "max": - if (check.inclusive) res.maximum = check.value; - else res.exclusiveMaximum = check.value; - break; - case "multipleOf": - res.multipleOf = check.value; - break; - } - return res; -} -function parseBooleanDef() { - return { type: "boolean" }; -} -function parseBrandedDef(_def, refs) { - return parseDef(_def.type._def, refs); -} -var parseCatchDef = (def, refs) => { - return parseDef(def.innerType._def, refs); -}; -function parseDateDef(def, refs, overrideDateStrategy) { - const strategy = overrideDateStrategy != null ? overrideDateStrategy : refs.dateStrategy; - if (Array.isArray(strategy)) return { anyOf: strategy.map((item) => parseDateDef(def, refs, item)) }; - switch (strategy) { - case "string": - case "format:date-time": return { - type: "string", - format: "date-time" - }; - case "format:date": return { - type: "string", - format: "date" - }; - case "integer": return integerDateParser(def); - } -} -var integerDateParser = (def) => { - const res = { - type: "integer", - format: "unix-time" - }; - for (const check of def.checks) switch (check.kind) { - case "min": - res.minimum = check.value; - break; - case "max": - res.maximum = check.value; - break; - } - return res; -}; -function parseDefaultDef(_def, refs) { - return { - ...parseDef(_def.innerType._def, refs), - default: _def.defaultValue() - }; -} -function parseEffectsDef(_def, refs) { - return refs.effectStrategy === "input" ? parseDef(_def.schema._def, refs) : parseAnyDef(); -} -function parseEnumDef(def) { - return { - type: "string", - enum: Array.from(def.values) - }; -} -var isJsonSchema7AllOfType = (type) => { - if ("type" in type && type.type === "string") return false; - return "allOf" in type; -}; -function parseIntersectionDef(def, refs) { - const allOf = [parseDef(def.left._def, { - ...refs, - currentPath: [ - ...refs.currentPath, - "allOf", - "0" - ] - }), parseDef(def.right._def, { - ...refs, - currentPath: [ - ...refs.currentPath, - "allOf", - "1" - ] - })].filter((x) => !!x); - const mergedAllOf = []; - allOf.forEach((schema) => { - if (isJsonSchema7AllOfType(schema)) mergedAllOf.push(...schema.allOf); - else { - let nestedSchema = schema; - if ("additionalProperties" in schema && schema.additionalProperties === false) { - const { additionalProperties: _additionalProperties, ...rest } = schema; - nestedSchema = rest; - } - mergedAllOf.push(nestedSchema); - } - }); - return mergedAllOf.length ? { allOf: mergedAllOf } : void 0; -} -function parseLiteralDef(def) { - const parsedType = typeof def.value; - if (parsedType !== "bigint" && parsedType !== "number" && parsedType !== "boolean" && parsedType !== "string") return { type: Array.isArray(def.value) ? "array" : "object" }; - return { - type: parsedType === "bigint" ? "integer" : parsedType, - const: def.value - }; -} -var emojiRegex = void 0; -var zodPatterns = { - /** - * `c` was changed to `[cC]` to replicate /i flag - */ - cuid: /^[cC][^\s-]{8,}$/, - cuid2: /^[0-9a-z]+$/, - ulid: /^[0-9A-HJKMNP-TV-Z]{26}$/, - /** - * `a-z` was added to replicate /i flag - */ - email: /^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/, - /** - * Constructed a valid Unicode RegExp - * - * Lazily instantiate since this type of regex isn't supported - * in all envs (e.g. React Native). - * - * See: - * https://github.com/colinhacks/zod/issues/2433 - * Fix in Zod: - * https://github.com/colinhacks/zod/commit/9340fd51e48576a75adc919bff65dbc4a5d4c99b - */ - emoji: () => { - if (emojiRegex === void 0) emojiRegex = RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$", "u"); - return emojiRegex; - }, - /** - * Unused - */ - uuid: /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/, - /** - * Unused - */ - ipv4: /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, - ipv4Cidr: /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, - /** - * Unused - */ - ipv6: /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/, - ipv6Cidr: /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, - base64: /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, - base64url: /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, - nanoid: /^[a-zA-Z0-9_-]{21}$/, - jwt: /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/ -}; -function parseStringDef(def, refs) { - const res = { type: "string" }; - if (def.checks) for (const check of def.checks) switch (check.kind) { - case "min": - res.minLength = typeof res.minLength === "number" ? Math.max(res.minLength, check.value) : check.value; - break; - case "max": - res.maxLength = typeof res.maxLength === "number" ? Math.min(res.maxLength, check.value) : check.value; - break; - case "email": - switch (refs.emailStrategy) { - case "format:email": - addFormat(res, "email", check.message, refs); - break; - case "format:idn-email": - addFormat(res, "idn-email", check.message, refs); - break; - case "pattern:zod": - addPattern(res, zodPatterns.email, check.message, refs); - break; - } - break; - case "url": - addFormat(res, "uri", check.message, refs); - break; - case "uuid": - addFormat(res, "uuid", check.message, refs); - break; - case "regex": - addPattern(res, check.regex, check.message, refs); - break; - case "cuid": - addPattern(res, zodPatterns.cuid, check.message, refs); - break; - case "cuid2": - addPattern(res, zodPatterns.cuid2, check.message, refs); - break; - case "startsWith": - addPattern(res, RegExp(`^${escapeLiteralCheckValue(check.value, refs)}`), check.message, refs); - break; - case "endsWith": - addPattern(res, RegExp(`${escapeLiteralCheckValue(check.value, refs)}$`), check.message, refs); - break; - case "datetime": - addFormat(res, "date-time", check.message, refs); - break; - case "date": - addFormat(res, "date", check.message, refs); - break; - case "time": - addFormat(res, "time", check.message, refs); - break; - case "duration": - addFormat(res, "duration", check.message, refs); - break; - case "length": - res.minLength = typeof res.minLength === "number" ? Math.max(res.minLength, check.value) : check.value; - res.maxLength = typeof res.maxLength === "number" ? Math.min(res.maxLength, check.value) : check.value; - break; - case "includes": - addPattern(res, RegExp(escapeLiteralCheckValue(check.value, refs)), check.message, refs); - break; - case "ip": - if (check.version !== "v6") addFormat(res, "ipv4", check.message, refs); - if (check.version !== "v4") addFormat(res, "ipv6", check.message, refs); - break; - case "base64url": - addPattern(res, zodPatterns.base64url, check.message, refs); - break; - case "jwt": - addPattern(res, zodPatterns.jwt, check.message, refs); - break; - case "cidr": - if (check.version !== "v6") addPattern(res, zodPatterns.ipv4Cidr, check.message, refs); - if (check.version !== "v4") addPattern(res, zodPatterns.ipv6Cidr, check.message, refs); - break; - case "emoji": - addPattern(res, zodPatterns.emoji(), check.message, refs); - break; - case "ulid": - addPattern(res, zodPatterns.ulid, check.message, refs); - break; - case "base64": - switch (refs.base64Strategy) { - case "format:binary": - addFormat(res, "binary", check.message, refs); - break; - case "contentEncoding:base64": - res.contentEncoding = "base64"; - break; - case "pattern:zod": - addPattern(res, zodPatterns.base64, check.message, refs); - break; - } - break; - case "nanoid": addPattern(res, zodPatterns.nanoid, check.message, refs); - case "toLowerCase": - case "toUpperCase": - case "trim": break; - default: - } - return res; -} -function escapeLiteralCheckValue(literal, refs) { - return refs.patternStrategy === "escape" ? escapeNonAlphaNumeric(literal) : literal; -} -var ALPHA_NUMERIC = /* @__PURE__ */ new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789"); -function escapeNonAlphaNumeric(source) { - let result = ""; - for (let i = 0; i < source.length; i++) { - if (!ALPHA_NUMERIC.has(source[i])) result += "\\"; - result += source[i]; - } - return result; -} -function addFormat(schema, value, message, refs) { - var _a2; - if (schema.format || ((_a2 = schema.anyOf) == null ? void 0 : _a2.some((x) => x.format))) { - if (!schema.anyOf) schema.anyOf = []; - if (schema.format) { - schema.anyOf.push({ format: schema.format }); - delete schema.format; - } - schema.anyOf.push({ - format: value, - ...message && refs.errorMessages && { errorMessage: { format: message } } - }); - } else schema.format = value; -} -function addPattern(schema, regex, message, refs) { - var _a2; - if (schema.pattern || ((_a2 = schema.allOf) == null ? void 0 : _a2.some((x) => x.pattern))) { - if (!schema.allOf) schema.allOf = []; - if (schema.pattern) { - schema.allOf.push({ pattern: schema.pattern }); - delete schema.pattern; - } - schema.allOf.push({ - pattern: stringifyRegExpWithFlags(regex, refs), - ...message && refs.errorMessages && { errorMessage: { pattern: message } } - }); - } else schema.pattern = stringifyRegExpWithFlags(regex, refs); -} -function stringifyRegExpWithFlags(regex, refs) { - var _a2; - if (!refs.applyRegexFlags || !regex.flags) return regex.source; - const flags = { - i: regex.flags.includes("i"), - m: regex.flags.includes("m"), - s: regex.flags.includes("s") - }; - const source = flags.i ? regex.source.toLowerCase() : regex.source; - let pattern = ""; - let isEscaped = false; - let inCharGroup = false; - let inCharRange = false; - for (let i = 0; i < source.length; i++) { - if (isEscaped) { - pattern += source[i]; - isEscaped = false; - continue; - } - if (flags.i) { - if (inCharGroup) { - if (source[i].match(/[a-z]/)) { - if (inCharRange) { - pattern += source[i]; - pattern += `${source[i - 2]}-${source[i]}`.toUpperCase(); - inCharRange = false; - } else if (source[i + 1] === "-" && ((_a2 = source[i + 2]) == null ? void 0 : _a2.match(/[a-z]/))) { - pattern += source[i]; - inCharRange = true; - } else pattern += `${source[i]}${source[i].toUpperCase()}`; - continue; - } - } else if (source[i].match(/[a-z]/)) { - pattern += `[${source[i]}${source[i].toUpperCase()}]`; - continue; - } - } - if (flags.m) { - if (source[i] === "^") { - pattern += `(^|(?<=[\r -]))`; - continue; - } else if (source[i] === "$") { - pattern += `($|(?=[\r -]))`; - continue; - } - } - if (flags.s && source[i] === ".") { - pattern += inCharGroup ? `${source[i]}\r -` : `[${source[i]}\r -]`; - continue; - } - pattern += source[i]; - if (source[i] === "\\") isEscaped = true; - else if (inCharGroup && source[i] === "]") inCharGroup = false; - else if (!inCharGroup && source[i] === "[") inCharGroup = true; - } - try { - new RegExp(pattern); - } catch (e) { - console.warn(`Could not convert regex pattern at ${refs.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`); - return regex.source; - } - return pattern; -} -function parseRecordDef(def, refs) { - var _a2, _b2, _c, _d, _e, _f; - const schema = { - type: "object", - additionalProperties: (_a2 = parseDef(def.valueType._def, { - ...refs, - currentPath: [...refs.currentPath, "additionalProperties"] - })) != null ? _a2 : refs.allowedAdditionalProperties - }; - if (((_b2 = def.keyType) == null ? void 0 : _b2._def.typeName) === ZodFirstPartyTypeKind.ZodString && ((_c = def.keyType._def.checks) == null ? void 0 : _c.length)) { - const { type: _type, ...keyType } = parseStringDef(def.keyType._def, refs); - return { - ...schema, - propertyNames: keyType - }; - } else if (((_d = def.keyType) == null ? void 0 : _d._def.typeName) === ZodFirstPartyTypeKind.ZodEnum) return { - ...schema, - propertyNames: { enum: def.keyType._def.values } - }; - else if (((_e = def.keyType) == null ? void 0 : _e._def.typeName) === ZodFirstPartyTypeKind.ZodBranded && def.keyType._def.type._def.typeName === ZodFirstPartyTypeKind.ZodString && ((_f = def.keyType._def.type._def.checks) == null ? void 0 : _f.length)) { - const { type: _type, ...keyType } = parseBrandedDef(def.keyType._def, refs); - return { - ...schema, - propertyNames: keyType - }; - } - return schema; -} -function parseMapDef(def, refs) { - if (refs.mapStrategy === "record") return parseRecordDef(def, refs); - return { - type: "array", - maxItems: 125, - items: { - type: "array", - items: [parseDef(def.keyType._def, { - ...refs, - currentPath: [ - ...refs.currentPath, - "items", - "items", - "0" - ] - }) || parseAnyDef(), parseDef(def.valueType._def, { - ...refs, - currentPath: [ - ...refs.currentPath, - "items", - "items", - "1" - ] - }) || parseAnyDef()], - minItems: 2, - maxItems: 2 - } - }; -} -function parseNativeEnumDef(def) { - const object = def.values; - const actualValues = Object.keys(def.values).filter((key) => { - return typeof object[object[key]] !== "number"; - }).map((key) => object[key]); - const parsedTypes = Array.from(new Set(actualValues.map((values) => typeof values))); - return { - type: parsedTypes.length === 1 ? parsedTypes[0] === "string" ? "string" : "number" : ["string", "number"], - enum: actualValues - }; -} -function parseNeverDef() { - return { not: parseAnyDef() }; -} -function parseNullDef() { - return { type: "null" }; -} -var primitiveMappings = { - ZodString: "string", - ZodNumber: "number", - ZodBigInt: "integer", - ZodBoolean: "boolean", - ZodNull: "null" -}; -function parseUnionDef(def, refs) { - const options = def.options instanceof Map ? Array.from(def.options.values()) : def.options; - if (options.every((x) => x._def.typeName in primitiveMappings && (!x._def.checks || !x._def.checks.length))) { - const types = options.reduce((types2, x) => { - const type = primitiveMappings[x._def.typeName]; - return type && !types2.includes(type) ? [...types2, type] : types2; - }, []); - return { type: types.length > 1 ? types : types[0] }; - } else if (options.every((x) => x._def.typeName === "ZodLiteral" && !x.description)) { - const types = options.reduce((acc, x) => { - const type = typeof x._def.value; - switch (type) { - case "string": - case "number": - case "boolean": return [...acc, type]; - case "bigint": return [...acc, "integer"]; - case "object": if (x._def.value === null) return [...acc, "null"]; - default: return acc; - } - }, []); - if (types.length === options.length) { - const uniqueTypes = types.filter((x, i, a) => a.indexOf(x) === i); - return { - type: uniqueTypes.length > 1 ? uniqueTypes : uniqueTypes[0], - enum: options.reduce((acc, x) => { - return acc.includes(x._def.value) ? acc : [...acc, x._def.value]; - }, []) - }; - } - } else if (options.every((x) => x._def.typeName === "ZodEnum")) return { - type: "string", - enum: options.reduce((acc, x) => [...acc, ...x._def.values.filter((x2) => !acc.includes(x2))], []) - }; - return asAnyOf(def, refs); -} -var asAnyOf = (def, refs) => { - const anyOf = (def.options instanceof Map ? Array.from(def.options.values()) : def.options).map((x, i) => parseDef(x._def, { - ...refs, - currentPath: [ - ...refs.currentPath, - "anyOf", - `${i}` - ] - })).filter((x) => !!x && (!refs.strictUnions || typeof x === "object" && Object.keys(x).length > 0)); - return anyOf.length ? { anyOf } : void 0; -}; -function parseNullableDef(def, refs) { - if ([ - "ZodString", - "ZodNumber", - "ZodBigInt", - "ZodBoolean", - "ZodNull" - ].includes(def.innerType._def.typeName) && (!def.innerType._def.checks || !def.innerType._def.checks.length)) return { type: [primitiveMappings[def.innerType._def.typeName], "null"] }; - const base = parseDef(def.innerType._def, { - ...refs, - currentPath: [ - ...refs.currentPath, - "anyOf", - "0" - ] - }); - return base && { anyOf: [base, { type: "null" }] }; -} -function parseNumberDef(def) { - const res = { type: "number" }; - if (!def.checks) return res; - for (const check of def.checks) switch (check.kind) { - case "int": - res.type = "integer"; - break; - case "min": - if (check.inclusive) res.minimum = check.value; - else res.exclusiveMinimum = check.value; - break; - case "max": - if (check.inclusive) res.maximum = check.value; - else res.exclusiveMaximum = check.value; - break; - case "multipleOf": - res.multipleOf = check.value; - break; - } - return res; -} -function parseObjectDef(def, refs) { - const result = { - type: "object", - properties: {} - }; - const required = []; - const shape = def.shape(); - for (const propName in shape) { - let propDef = shape[propName]; - if (propDef === void 0 || propDef._def === void 0) continue; - const propOptional = safeIsOptional(propDef); - const parsedDef = parseDef(propDef._def, { - ...refs, - currentPath: [ - ...refs.currentPath, - "properties", - propName - ], - propertyPath: [ - ...refs.currentPath, - "properties", - propName - ] - }); - if (parsedDef === void 0) continue; - result.properties[propName] = parsedDef; - if (!propOptional) required.push(propName); - } - if (required.length) result.required = required; - const additionalProperties = decideAdditionalProperties(def, refs); - if (additionalProperties !== void 0) result.additionalProperties = additionalProperties; - return result; -} -function decideAdditionalProperties(def, refs) { - if (def.catchall._def.typeName !== "ZodNever") return parseDef(def.catchall._def, { - ...refs, - currentPath: [...refs.currentPath, "additionalProperties"] - }); - switch (def.unknownKeys) { - case "passthrough": return refs.allowedAdditionalProperties; - case "strict": return refs.rejectedAdditionalProperties; - case "strip": return refs.removeAdditionalStrategy === "strict" ? refs.allowedAdditionalProperties : refs.rejectedAdditionalProperties; - } -} -function safeIsOptional(schema) { - try { - return schema.isOptional(); - } catch (e) { - return true; - } -} -var parseOptionalDef = (def, refs) => { - var _a2; - if (refs.currentPath.toString() === ((_a2 = refs.propertyPath) == null ? void 0 : _a2.toString())) return parseDef(def.innerType._def, refs); - const innerSchema = parseDef(def.innerType._def, { - ...refs, - currentPath: [ - ...refs.currentPath, - "anyOf", - "1" - ] - }); - return innerSchema ? { anyOf: [{ not: parseAnyDef() }, innerSchema] } : parseAnyDef(); -}; -var parsePipelineDef = (def, refs) => { - if (refs.pipeStrategy === "input") return parseDef(def.in._def, refs); - else if (refs.pipeStrategy === "output") return parseDef(def.out._def, refs); - const inputSchema = parseDef(def.in._def, { - ...refs, - currentPath: [ - ...refs.currentPath, - "allOf", - "0" - ] - }); - return { allOf: [inputSchema, parseDef(def.out._def, { - ...refs, - currentPath: [ - ...refs.currentPath, - "allOf", - inputSchema ? "1" : "0" - ] - })].filter((schema) => schema !== void 0) }; -}; -function parsePromiseDef(def, refs) { - return parseDef(def.type._def, refs); -} -function parseSetDef(def, refs) { - const schema = { - type: "array", - uniqueItems: true, - items: parseDef(def.valueType._def, { - ...refs, - currentPath: [...refs.currentPath, "items"] - }) - }; - if (def.minSize) schema.minItems = def.minSize.value; - if (def.maxSize) schema.maxItems = def.maxSize.value; - return schema; -} -function parseTupleDef(def, refs) { - if (def.rest) return { - type: "array", - minItems: def.items.length, - items: def.items.map((x, i) => parseDef(x._def, { - ...refs, - currentPath: [ - ...refs.currentPath, - "items", - `${i}` - ] - })).reduce((acc, x) => x === void 0 ? acc : [...acc, x], []), - additionalItems: parseDef(def.rest._def, { - ...refs, - currentPath: [...refs.currentPath, "additionalItems"] - }) - }; - else return { - type: "array", - minItems: def.items.length, - maxItems: def.items.length, - items: def.items.map((x, i) => parseDef(x._def, { - ...refs, - currentPath: [ - ...refs.currentPath, - "items", - `${i}` - ] - })).reduce((acc, x) => x === void 0 ? acc : [...acc, x], []) - }; -} -function parseUndefinedDef() { - return { not: parseAnyDef() }; -} -function parseUnknownDef() { - return parseAnyDef(); -} -var parseReadonlyDef = (def, refs) => { - return parseDef(def.innerType._def, refs); -}; -var selectParser = (def, typeName, refs) => { - switch (typeName) { - case ZodFirstPartyTypeKind.ZodString: return parseStringDef(def, refs); - case ZodFirstPartyTypeKind.ZodNumber: return parseNumberDef(def); - case ZodFirstPartyTypeKind.ZodObject: return parseObjectDef(def, refs); - case ZodFirstPartyTypeKind.ZodBigInt: return parseBigintDef(def); - case ZodFirstPartyTypeKind.ZodBoolean: return parseBooleanDef(); - case ZodFirstPartyTypeKind.ZodDate: return parseDateDef(def, refs); - case ZodFirstPartyTypeKind.ZodUndefined: return parseUndefinedDef(); - case ZodFirstPartyTypeKind.ZodNull: return parseNullDef(); - case ZodFirstPartyTypeKind.ZodArray: return parseArrayDef(def, refs); - case ZodFirstPartyTypeKind.ZodUnion: - case ZodFirstPartyTypeKind.ZodDiscriminatedUnion: return parseUnionDef(def, refs); - case ZodFirstPartyTypeKind.ZodIntersection: return parseIntersectionDef(def, refs); - case ZodFirstPartyTypeKind.ZodTuple: return parseTupleDef(def, refs); - case ZodFirstPartyTypeKind.ZodRecord: return parseRecordDef(def, refs); - case ZodFirstPartyTypeKind.ZodLiteral: return parseLiteralDef(def); - case ZodFirstPartyTypeKind.ZodEnum: return parseEnumDef(def); - case ZodFirstPartyTypeKind.ZodNativeEnum: return parseNativeEnumDef(def); - case ZodFirstPartyTypeKind.ZodNullable: return parseNullableDef(def, refs); - case ZodFirstPartyTypeKind.ZodOptional: return parseOptionalDef(def, refs); - case ZodFirstPartyTypeKind.ZodMap: return parseMapDef(def, refs); - case ZodFirstPartyTypeKind.ZodSet: return parseSetDef(def, refs); - case ZodFirstPartyTypeKind.ZodLazy: return () => def.getter()._def; - case ZodFirstPartyTypeKind.ZodPromise: return parsePromiseDef(def, refs); - case ZodFirstPartyTypeKind.ZodNaN: - case ZodFirstPartyTypeKind.ZodNever: return parseNeverDef(); - case ZodFirstPartyTypeKind.ZodEffects: return parseEffectsDef(def, refs); - case ZodFirstPartyTypeKind.ZodAny: return parseAnyDef(); - case ZodFirstPartyTypeKind.ZodUnknown: return parseUnknownDef(); - case ZodFirstPartyTypeKind.ZodDefault: return parseDefaultDef(def, refs); - case ZodFirstPartyTypeKind.ZodBranded: return parseBrandedDef(def, refs); - case ZodFirstPartyTypeKind.ZodReadonly: return parseReadonlyDef(def, refs); - case ZodFirstPartyTypeKind.ZodCatch: return parseCatchDef(def, refs); - case ZodFirstPartyTypeKind.ZodPipeline: return parsePipelineDef(def, refs); - case ZodFirstPartyTypeKind.ZodFunction: - case ZodFirstPartyTypeKind.ZodVoid: - case ZodFirstPartyTypeKind.ZodSymbol: return; - default: return /* @__PURE__ */ ((_) => void 0)(typeName); - } -}; -var getRelativePath = (pathA, pathB) => { - let i = 0; - for (; i < pathA.length && i < pathB.length; i++) if (pathA[i] !== pathB[i]) break; - return [(pathA.length - i).toString(), ...pathB.slice(i)].join("/"); -}; -function parseDef(def, refs, forceResolution = false) { - var _a2; - const seenItem = refs.seen.get(def); - if (refs.override) { - const overrideResult = (_a2 = refs.override) == null ? void 0 : _a2.call(refs, def, refs, seenItem, forceResolution); - if (overrideResult !== ignoreOverride) return overrideResult; - } - if (seenItem && !forceResolution) { - const seenSchema = get$ref(seenItem, refs); - if (seenSchema !== void 0) return seenSchema; - } - const newItem = { - def, - path: refs.currentPath, - jsonSchema: void 0 - }; - refs.seen.set(def, newItem); - const jsonSchemaOrGetter = selectParser(def, def.typeName, refs); - const jsonSchema2 = typeof jsonSchemaOrGetter === "function" ? parseDef(jsonSchemaOrGetter(), refs) : jsonSchemaOrGetter; - if (jsonSchema2) addMeta(def, refs, jsonSchema2); - if (refs.postProcess) { - const postProcessResult = refs.postProcess(jsonSchema2, def, refs); - newItem.jsonSchema = jsonSchema2; - return postProcessResult; - } - newItem.jsonSchema = jsonSchema2; - return jsonSchema2; -} -var get$ref = (item, refs) => { - switch (refs.$refStrategy) { - case "root": return { $ref: item.path.join("/") }; - case "relative": return { $ref: getRelativePath(refs.currentPath, item.path) }; - case "none": - case "seen": - if (item.path.length < refs.currentPath.length && item.path.every((value, index) => refs.currentPath[index] === value)) { - console.warn(`Recursive reference detected at ${refs.currentPath.join("/")}! Defaulting to any`); - return parseAnyDef(); - } - return refs.$refStrategy === "seen" ? parseAnyDef() : void 0; - } -}; -var addMeta = (def, refs, jsonSchema2) => { - if (def.description) jsonSchema2.description = def.description; - return jsonSchema2; -}; -var getRefs = (options) => { - const _options = getDefaultOptions(options); - const currentPath = _options.name !== void 0 ? [ - ..._options.basePath, - _options.definitionPath, - _options.name - ] : _options.basePath; - return { - ..._options, - currentPath, - propertyPath: void 0, - seen: new Map(Object.entries(_options.definitions).map(([name2, def]) => [def._def, { - def: def._def, - path: [ - ..._options.basePath, - _options.definitionPath, - name2 - ], - jsonSchema: void 0 - }])) - }; -}; -var zod3ToJsonSchema = (schema, options) => { - var _a2; - const refs = getRefs(options); - let definitions = typeof options === "object" && options.definitions ? Object.entries(options.definitions).reduce((acc, [name3, schema2]) => { - var _a3; - return { - ...acc, - [name3]: (_a3 = parseDef(schema2._def, { - ...refs, - currentPath: [ - ...refs.basePath, - refs.definitionPath, - name3 - ] - }, true)) != null ? _a3 : parseAnyDef() - }; - }, {}) : void 0; - const name2 = typeof options === "string" ? options : (options == null ? void 0 : options.nameStrategy) === "title" ? void 0 : options == null ? void 0 : options.name; - const main = (_a2 = parseDef(schema._def, name2 === void 0 ? refs : { - ...refs, - currentPath: [ - ...refs.basePath, - refs.definitionPath, - name2 - ] - }, false)) != null ? _a2 : parseAnyDef(); - const title = typeof options === "object" && options.name !== void 0 && options.nameStrategy === "title" ? options.name : void 0; - if (title !== void 0) main.title = title; - const combined = name2 === void 0 ? definitions ? { - ...main, - [refs.definitionPath]: definitions - } : main : { - $ref: [ - ...refs.$refStrategy === "relative" ? [] : refs.basePath, - refs.definitionPath, - name2 - ].join("/"), - [refs.definitionPath]: { - ...definitions, - [name2]: main - } - }; - combined.$schema = "http://json-schema.org/draft-07/schema#"; - return combined; -}; -var schemaSymbol = /* @__PURE__ */ Symbol.for("vercel.ai.schema"); -function lazySchema(createSchema) { - let schema; - return () => { - if (schema == null) schema = createSchema(); - return schema; - }; -} -function jsonSchema(jsonSchema2, { validate } = {}) { - return { - [schemaSymbol]: true, - _type: void 0, - get jsonSchema() { - if (typeof jsonSchema2 === "function") jsonSchema2 = jsonSchema2(); - return jsonSchema2; - }, - validate - }; -} -function isSchema(value) { - return typeof value === "object" && value !== null && schemaSymbol in value && value[schemaSymbol] === true && "jsonSchema" in value && "validate" in value; -} -function asSchema(schema) { - return schema == null ? jsonSchema({ - type: "object", - properties: {}, - additionalProperties: false - }) : isSchema(schema) ? schema : "~standard" in schema ? schema["~standard"].vendor === "zod" ? zodSchema(schema) : standardSchema(schema) : schema(); -} -function standardSchema(standardSchema2) { - return jsonSchema(() => { - if (!hasStandardJsonSchema(standardSchema2)) throw new Error(`Standard schema vendor '${standardSchema2["~standard"].vendor}' does not support JSON Schema conversion.`); - return addAdditionalPropertiesToJsonSchema(standardSchema2["~standard"].jsonSchema.input({ target: "draft-07" })); - }, { validate: async (value) => { - const result = await standardSchema2["~standard"].validate(value); - return "value" in result ? { - success: true, - value: result.value - } : { - success: false, - error: new TypeValidationError({ - value, - cause: result.issues - }) - }; - } }); -} -function hasStandardJsonSchema(schema) { - return schema["~standard"].jsonSchema != null; -} -function zod3Schema(zodSchema2, options) { - var _a2; - const useReferences = (_a2 = options == null ? void 0 : options.useReferences) != null ? _a2 : false; - return jsonSchema(() => zod3ToJsonSchema(zodSchema2, { $refStrategy: useReferences ? "root" : "none" }), { validate: async (value) => { - const result = await zodSchema2.safeParseAsync(value); - return result.success ? { - success: true, - value: result.data - } : { - success: false, - error: result.error - }; - } }); -} -function zod4Schema(zodSchema2, options) { - var _a2; - const useReferences = (_a2 = options == null ? void 0 : options.useReferences) != null ? _a2 : false; - return jsonSchema(() => addAdditionalPropertiesToJsonSchema(toJSONSchema(zodSchema2, { - target: "draft-7", - io: "input", - reused: useReferences ? "ref" : "inline" - })), { validate: async (value) => { - const result = await safeParseAsync(zodSchema2, value); - return result.success ? { - success: true, - value: result.data - } : { - success: false, - error: result.error - }; - } }); -} -function isZod4Schema(zodSchema2) { - return "_zod" in zodSchema2; -} -function zodSchema(zodSchema2, options) { - if (isZod4Schema(zodSchema2)) return zod4Schema(zodSchema2, options); - else return zod3Schema(zodSchema2, options); -} -async function validateTypes({ value, schema, context }) { - const result = await safeValidateTypes({ - value, - schema, - context - }); - if (!result.success) throw TypeValidationError.wrap({ - value, - cause: result.error, - context - }); - return result.value; -} -async function safeValidateTypes({ value, schema, context }) { - const actualSchema = asSchema(schema); - try { - if (actualSchema.validate == null) return { - success: true, - value, - rawValue: value - }; - const result = await actualSchema.validate(value); - if (result.success) return { - success: true, - value: result.value, - rawValue: value - }; - return { - success: false, - error: TypeValidationError.wrap({ - value, - cause: result.error, - context - }), - rawValue: value - }; - } catch (error) { - return { - success: false, - error: TypeValidationError.wrap({ - value, - cause: error, - context - }), - rawValue: value - }; - } -} -async function parseJSON({ text, schema }) { - try { - const value = secureJsonParse(text); - if (schema == null) return value; - return await validateTypes({ - value, - schema - }); - } catch (error) { - if (JSONParseError.isInstance(error) || TypeValidationError.isInstance(error)) throw error; - throw new JSONParseError({ - text, - cause: error - }); - } -} -async function safeParseJSON({ text, schema }) { - try { - const value = secureJsonParse(text); - if (schema == null) return { - success: true, - value, - rawValue: value - }; - return await safeValidateTypes({ - value, - schema - }); - } catch (error) { - return { - success: false, - error: JSONParseError.isInstance(error) ? error : new JSONParseError({ - text, - cause: error - }), - rawValue: void 0 - }; - } -} -function parseJsonEventStream({ stream, schema }) { - return stream.pipeThrough(new TextDecoderStream()).pipeThrough(new EventSourceParserStream()).pipeThrough(new TransformStream({ async transform({ data }, controller) { - if (data === "[DONE]") return; - controller.enqueue(await safeParseJSON({ - text: data, - schema - })); - } })); -} -var getOriginalFetch2 = () => globalThis.fetch; -var postJsonToApi = async ({ url, headers, body, failedResponseHandler, successfulResponseHandler, abortSignal, fetch }) => await postToApi({ - url, - headers: { - "Content-Type": "application/json", - ...headers - }, - body: { - content: JSON.stringify(body), - values: body - }, - failedResponseHandler, - successfulResponseHandler, - abortSignal, - fetch -}); -var postToApi = async ({ url, headers = {}, body, successfulResponseHandler, failedResponseHandler, abortSignal, fetch = getOriginalFetch2() }) => { - try { - const response = await fetch(url, { - method: "POST", - headers: withUserAgentSuffix(headers, `ai-sdk/provider-utils/5.0.10`, getRuntimeEnvironmentUserAgent()), - body: body.content, - signal: abortSignal - }); - const responseHeaders = extractResponseHeaders(response); - if (!response.ok) { - let errorInformation; - try { - errorInformation = await failedResponseHandler({ - response, - url, - requestBodyValues: body.values - }); - } catch (error) { - if (isAbortError(error) || APICallError.isInstance(error)) throw error; - throw new APICallError({ - message: "Failed to process error response", - cause: error, - statusCode: response.status, - url, - responseHeaders, - requestBodyValues: body.values - }); - } - throw errorInformation.value; - } - try { - return await successfulResponseHandler({ - response, - url, - requestBodyValues: body.values - }); - } catch (error) { - if (error instanceof Error) { - if (isAbortError(error) || APICallError.isInstance(error)) throw error; - } - throw new APICallError({ - message: "Failed to process successful response", - cause: error, - statusCode: response.status, - url, - responseHeaders, - requestBodyValues: body.values - }); - } - } catch (error) { - throw handleFetchError({ - error, - url, - requestBodyValues: body.values - }); - } -}; -function tool(tool2) { - return tool2; -} -function createProviderExecutedToolFactory({ id, inputSchema, outputSchema, supportsDeferredResults }) { - return ({ onInputStart, onInputDelta, onInputAvailable, ...args }) => tool({ - type: "provider", - isProviderExecuted: true, - id, - args, - inputSchema, - outputSchema, - onInputStart, - onInputDelta, - onInputAvailable, - supportsDeferredResults - }); -} -async function resolve(value) { - if (typeof value === "function") value = value(); - return Promise.resolve(value); -} -var retryWithExponentialBackoff = ({ maxRetries = 2, initialDelayInMs = 2e3, backoffFactor = 2, abortSignal, shouldRetry, getDelayInMs = ({ exponentialBackoffDelay }) => exponentialBackoffDelay, createRetryError = ({ message }) => new Error(message) }) => async (f) => retryWithExponentialBackoffInternal(f, { - maxRetries, - delayInMs: initialDelayInMs, - backoffFactor, - abortSignal, - shouldRetry, - getDelayInMs, - createRetryError -}); -async function retryWithExponentialBackoffInternal(f, { maxRetries, delayInMs, backoffFactor, abortSignal, shouldRetry, getDelayInMs, createRetryError }, errors = []) { - try { - return await f(); - } catch (error) { - if (isAbortError(error)) throw error; - if (maxRetries === 0) throw error; - const errorMessage = getErrorMessage(error); - const newErrors = [...errors, error]; - const tryNumber = newErrors.length; - if (tryNumber > maxRetries) throw createRetryError({ - message: `Failed after ${tryNumber} attempts. Last error: ${errorMessage}`, - reason: "maxRetriesExceeded", - errors: newErrors - }); - if (await shouldRetry(error) && tryNumber <= maxRetries) { - await delay(getDelayInMs({ - error, - exponentialBackoffDelay: delayInMs - }), { abortSignal }); - return retryWithExponentialBackoffInternal(f, { - maxRetries, - delayInMs: backoffFactor * delayInMs, - backoffFactor, - abortSignal, - shouldRetry, - getDelayInMs, - createRetryError - }, newErrors); - } - if (tryNumber === 1) throw error; - throw createRetryError({ - message: `Failed after ${tryNumber} attempts with non-retryable error: '${errorMessage}'`, - reason: "errorNotRetryable", - errors: newErrors - }); - } -} -var textDecoder2 = new TextDecoder(); -async function readResponseBodyAsText({ response, url }) { - return textDecoder2.decode(await readResponseWithSizeLimit({ - response, - url - })); -} -var createJsonErrorResponseHandler = ({ errorSchema, errorToMessage, isRetryable }) => async ({ response, url, requestBodyValues }) => { - const responseBody = await readResponseBodyAsText({ - response, - url - }); - const responseHeaders = extractResponseHeaders(response); - if (responseBody.trim() === "") return { - responseHeaders, - value: new APICallError({ - message: response.statusText, - url, - requestBodyValues, - statusCode: response.status, - responseHeaders, - responseBody, - isRetryable: isRetryable == null ? void 0 : isRetryable(response) - }) - }; - try { - const parsedError = await parseJSON({ - text: responseBody, - schema: errorSchema - }); - return { - responseHeaders, - value: new APICallError({ - message: errorToMessage(parsedError), - url, - requestBodyValues, - statusCode: response.status, - responseHeaders, - responseBody, - data: parsedError, - isRetryable: isRetryable == null ? void 0 : isRetryable(response, parsedError) - }) - }; - } catch (e) { - return { - responseHeaders, - value: new APICallError({ - message: response.statusText, - url, - requestBodyValues, - statusCode: response.status, - responseHeaders, - responseBody, - isRetryable: isRetryable == null ? void 0 : isRetryable(response) - }) - }; - } -}; -var createEventSourceResponseHandler = (chunkSchema) => async ({ response }) => { - const responseHeaders = extractResponseHeaders(response); - if (response.body == null) throw new EmptyResponseBodyError({}); - return { - responseHeaders, - value: parseJsonEventStream({ - stream: response.body, - schema: chunkSchema - }) - }; -}; -var createJsonResponseHandler = (responseSchema) => async ({ response, url, requestBodyValues }) => { - const responseBody = await readResponseBodyAsText({ - response, - url - }); - const parsedResult = await safeParseJSON({ - text: responseBody, - schema: responseSchema - }); - const responseHeaders = extractResponseHeaders(response); - if (!parsedResult.success) throw new APICallError({ - message: "Invalid JSON response", - cause: parsedResult.error, - statusCode: response.status, - responseHeaders, - responseBody, - url, - requestBodyValues - }); - return { - responseHeaders, - value: parsedResult.value, - rawValue: parsedResult.rawValue - }; -}; -function isJSONSerializable(value) { - if (value === null || value === void 0) return true; - const type = typeof value; - if (type === "string" || type === "number" || type === "boolean") return true; - if (type === "function" || type === "symbol" || type === "bigint") return false; - if (Array.isArray(value)) return value.every(isJSONSerializable); - if (Object.getPrototypeOf(value) === Object.prototype) return Object.values(value).every(isJSONSerializable); - return false; -} -function serializeModelOptions(options) { - const serializableConfig = {}; - for (const [key, value] of Object.entries(options.config)) if (key === "headers") { - const resolvedHeaders = resolveSync(value); - if (isJSONSerializable(resolvedHeaders)) serializableConfig[key] = resolvedHeaders; - } else if (isJSONSerializable(value)) serializableConfig[key] = value; - return { - modelId: options.modelId, - config: serializableConfig - }; -} -function resolveSync(value) { - let next = value; - if (typeof value === "function") next = value(); - if (next instanceof Promise) throw new Error("Promise returned from resolveSync"); - return next; -} -function parseTranscriptionStreamPart(text) { - let value; - try { - value = secureJsonParse(text); - } catch (e) { - return; - } - if (value == null || typeof value !== "object" || Array.isArray(value)) return; - const part = value; - switch (part.type) { - case "stream-start": return Array.isArray(part.warnings) && part.warnings.every(isWarning) ? part : void 0; - case "transcript-delta": return isString(part.delta) && isOptional(part.id, isString) && isOptional(part.providerMetadata, isPlainObject) ? part : void 0; - case "transcript-partial": return isString(part.text) && isOptional(part.id, isString) && isOptional(part.startSecond, isNumber) && isOptional(part.durationInSeconds, isNumber) && isOptional(part.channelIndex, isNumber) && isOptional(part.providerMetadata, isPlainObject) ? part : void 0; - case "transcript-final": return isString(part.text) && isOptional(part.id, isString) && isOptional(part.startSecond, isNumber) && isOptional(part.endSecond, isNumber) && isOptional(part.channelIndex, isNumber) && isOptional(part.providerMetadata, isPlainObject) ? part : void 0; - case "finish": return isString(part.text) && Array.isArray(part.segments) && part.segments.every(isSegment) && isOptional(part.language, isString) && isOptional(part.durationInSeconds, isNumber) && isOptional(part.providerMetadata, isPlainObject) ? part : void 0; - case "response-metadata": { - if (!(isOptional(part.modelId, isString) && isOptional(part.headers, isPlainObject))) return; - const timestamp = part.timestamp; - if (timestamp == null) return { - ...part, - timestamp: void 0 - }; - if (typeof timestamp !== "string") return; - const revived = new Date(timestamp); - return Number.isNaN(revived.getTime()) ? void 0 : { - ...part, - timestamp: revived - }; - } - case "raw": return "rawValue" in part ? part : void 0; - case "error": return "error" in part ? part : void 0; - default: return; - } -} -function isString(value) { - return typeof value === "string"; -} -function isNumber(value) { - return typeof value === "number"; -} -function isOptional(value, check) { - return value === void 0 || check(value); -} -function isPlainObject(value) { - return typeof value === "object" && value != null && !Array.isArray(value); -} -function isWarning(value) { - return isPlainObject(value) && isString(value.type); -} -function isSegment(value) { - return isPlainObject(value) && isString(value.text) && isNumber(value.startSecond) && isNumber(value.endSecond); -} -function withoutTrailingSlash(url) { - return url == null ? void 0 : url.replace(/\/$/, ""); -} -function isExecutableTool(tool2) { - return tool2 != null && typeof tool2.execute === "function"; -} -function isAsyncIterable(obj) { - return obj != null && typeof obj[Symbol.asyncIterator] === "function"; -} -async function* executeTool({ tool: tool2, input, options }) { - const result = tool2.execute(input, options); - if (isAsyncIterable(result)) { - let lastOutput; - for await (const output of result) { - lastOutput = output; - yield { - type: "preliminary", - output - }; - } - yield { - type: "final", - output: lastOutput - }; - } else yield { - type: "final", - output: await result - }; -} -//#endregion -//#region node_modules/@vercel/oidc/dist/get-context.js -var require_get_context = /* @__PURE__ */ __commonJSMin(((exports, module) => { - var __defProp = Object.defineProperty; - var __getOwnPropDesc = Object.getOwnPropertyDescriptor; - var __getOwnPropNames = Object.getOwnPropertyNames; - var __hasOwnProp = Object.prototype.hasOwnProperty; - var __export = (target, all) => { - for (var name in all) __defProp(target, name, { - get: all[name], - enumerable: true - }); - }; - var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { - get: () => from[key], - enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable - }); - } - return to; - }; - var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - var get_context_exports = {}; - __export(get_context_exports, { - SYMBOL_FOR_REQ_CONTEXT: () => SYMBOL_FOR_REQ_CONTEXT, - getContext: () => getContext - }); - module.exports = __toCommonJS(get_context_exports); - const SYMBOL_FOR_REQ_CONTEXT = Symbol.for("@vercel/request-context"); - function getContext() { - return globalThis[SYMBOL_FOR_REQ_CONTEXT]?.get?.() ?? {}; - } - 0 && (module.exports = { - SYMBOL_FOR_REQ_CONTEXT, - getContext - }); -})); -//#endregion -//#region node_modules/@vercel/oidc/dist/token-error.js -var require_token_error = /* @__PURE__ */ __commonJSMin(((exports, module) => { - var __defProp = Object.defineProperty; - var __getOwnPropDesc = Object.getOwnPropertyDescriptor; - var __getOwnPropNames = Object.getOwnPropertyNames; - var __hasOwnProp = Object.prototype.hasOwnProperty; - var __export = (target, all) => { - for (var name in all) __defProp(target, name, { - get: all[name], - enumerable: true - }); - }; - var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { - get: () => from[key], - enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable - }); - } - return to; - }; - var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - var token_error_exports = {}; - __export(token_error_exports, { VercelOidcTokenError: () => VercelOidcTokenError }); - module.exports = __toCommonJS(token_error_exports); - var VercelOidcTokenError = class extends Error { - constructor(message, cause) { - super(message); - this.name = "VercelOidcTokenError"; - this.cause = cause; - } - toString() { - if (this.cause) return `${this.name}: ${this.message}: ${this.cause}`; - return `${this.name}: ${this.message}`; - } - }; - 0 && (module.exports = { VercelOidcTokenError }); -})); -//#endregion -//#region node_modules/@vercel/oidc/dist/get-vercel-oidc-token.js -var require_get_vercel_oidc_token = /* @__PURE__ */ __commonJSMin(((exports, module) => { - var __defProp = Object.defineProperty; - var __getOwnPropDesc = Object.getOwnPropertyDescriptor; - var __getOwnPropNames = Object.getOwnPropertyNames; - var __hasOwnProp = Object.prototype.hasOwnProperty; - var __export = (target, all) => { - for (var name in all) __defProp(target, name, { - get: all[name], - enumerable: true - }); - }; - var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { - get: () => from[key], - enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable - }); - } - return to; - }; - var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - var get_vercel_oidc_token_exports = {}; - __export(get_vercel_oidc_token_exports, { - getVercelOidcToken: () => getVercelOidcToken, - getVercelOidcTokenSync: () => getVercelOidcTokenSync - }); - module.exports = __toCommonJS(get_vercel_oidc_token_exports); - var import_get_context = require_get_context(); - var import_token_error = require_token_error(); - async function getVercelOidcToken(options) { - let token = ""; - let err; - try { - token = getVercelOidcTokenSync(); - } catch (error) { - err = error; - } - try { - const [{ getTokenPayload, isExpired }, { refreshToken }] = await Promise.all([await Promise.resolve().then(() => /* @__PURE__ */ __toESM(require_token_util())), await import("../vercel__oidc.mjs").then((n) => /* @__PURE__ */ __toESM(n.t()))]); - if (!token || isExpired(getTokenPayload(token), options?.expirationBufferMs)) { - await refreshToken(options); - token = getVercelOidcTokenSync(); - } - } catch (error) { - let message = err instanceof Error ? err.message : ""; - if (error instanceof Error) message = `${message} -${error.message}`; - if (message) throw new import_token_error.VercelOidcTokenError(message); - throw error; - } - return token; - } - function getVercelOidcTokenSync() { - const token = (0, import_get_context.getContext)().headers?.["x-vercel-oidc-token"] ?? process.env.VERCEL_OIDC_TOKEN; - if (!token) throw new Error(`The 'x-vercel-oidc-token' header is missing from the request. Do you have the OIDC option enabled in the Vercel project settings?`); - return token; - } - 0 && (module.exports = { - getVercelOidcToken, - getVercelOidcTokenSync - }); -})); -//#endregion -//#region node_modules/@vercel/oidc/dist/auth-errors.js -var require_auth_errors = /* @__PURE__ */ __commonJSMin(((exports, module) => { - var __defProp = Object.defineProperty; - var __getOwnPropDesc = Object.getOwnPropertyDescriptor; - var __getOwnPropNames = Object.getOwnPropertyNames; - var __hasOwnProp = Object.prototype.hasOwnProperty; - var __export = (target, all) => { - for (var name in all) __defProp(target, name, { - get: all[name], - enumerable: true - }); - }; - var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { - get: () => from[key], - enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable - }); - } - return to; - }; - var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - var auth_errors_exports = {}; - __export(auth_errors_exports, { - AccessTokenMissingError: () => AccessTokenMissingError, - RefreshAccessTokenFailedError: () => RefreshAccessTokenFailedError - }); - module.exports = __toCommonJS(auth_errors_exports); - var AccessTokenMissingError = class extends Error { - constructor() { - super("No authentication found. Please log in with the Vercel CLI (vercel login)."); - this.name = "AccessTokenMissingError"; - } - }; - var RefreshAccessTokenFailedError = class extends Error { - constructor(cause) { - super("Failed to refresh authentication token.", { cause }); - this.name = "RefreshAccessTokenFailedError"; - } - }; - 0 && (module.exports = { - AccessTokenMissingError, - RefreshAccessTokenFailedError - }); -})); -//#endregion -//#region node_modules/@vercel/oidc/dist/token-io.js -var require_token_io = /* @__PURE__ */ __commonJSMin(((exports, module) => { - var __create = Object.create; - var __defProp = Object.defineProperty; - var __getOwnPropDesc = Object.getOwnPropertyDescriptor; - var __getOwnPropNames = Object.getOwnPropertyNames; - var __getProtoOf = Object.getPrototypeOf; - var __hasOwnProp = Object.prototype.hasOwnProperty; - var __export = (target, all) => { - for (var name in all) __defProp(target, name, { - get: all[name], - enumerable: true - }); - }; - var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { - get: () => from[key], - enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable - }); - } - return to; - }; - var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { - value: mod, - enumerable: true - }) : target, mod)); - var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - var token_io_exports = {}; - __export(token_io_exports, { - findRootDir: () => findRootDir, - getUserDataDir: () => getUserDataDir - }); - module.exports = __toCommonJS(token_io_exports); - var import_path = __toESM(__require("path")); - var import_fs = __toESM(__require("fs")); - var import_os$1 = __toESM(__require("os")); - var import_token_error = require_token_error(); - function findRootDir() { - try { - let dir = process.cwd(); - while (dir !== import_path.default.dirname(dir)) { - const pkgPath = import_path.default.join(dir, ".vercel"); - if (import_fs.default.existsSync(pkgPath)) return dir; - dir = import_path.default.dirname(dir); - } - } catch (e) { - throw new import_token_error.VercelOidcTokenError("Token refresh only supported in node server environments"); - } - return null; - } - function getUserDataDir() { - if (process.env.XDG_DATA_HOME) return process.env.XDG_DATA_HOME; - switch (import_os$1.default.platform()) { - case "darwin": return import_path.default.join(import_os$1.default.homedir(), "Library/Application Support"); - case "linux": return import_path.default.join(import_os$1.default.homedir(), ".local/share"); - case "win32": - if (process.env.LOCALAPPDATA) return process.env.LOCALAPPDATA; - return null; - default: return null; - } - } - 0 && (module.exports = { - findRootDir, - getUserDataDir - }); -})); -//#endregion -//#region node_modules/@vercel/oidc/dist/auth-config.js -var require_auth_config = /* @__PURE__ */ __commonJSMin(((exports, module) => { - var __create = Object.create; - var __defProp = Object.defineProperty; - var __getOwnPropDesc = Object.getOwnPropertyDescriptor; - var __getOwnPropNames = Object.getOwnPropertyNames; - var __getProtoOf = Object.getPrototypeOf; - var __hasOwnProp = Object.prototype.hasOwnProperty; - var __export = (target, all) => { - for (var name in all) __defProp(target, name, { - get: all[name], - enumerable: true - }); - }; - var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { - get: () => from[key], - enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable - }); - } - return to; - }; - var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { - value: mod, - enumerable: true - }) : target, mod)); - var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - var auth_config_exports = {}; - __export(auth_config_exports, { - isValidAccessToken: () => isValidAccessToken, - readAuthConfig: () => readAuthConfig, - writeAuthConfig: () => writeAuthConfig - }); - module.exports = __toCommonJS(auth_config_exports); - var fs$1 = __toESM(__require("fs")); - var path$1 = __toESM(__require("path")); - var import_token_util = require_token_util(); - function getAuthConfigPath() { - const dataDir = (0, import_token_util.getVercelDataDir)(); - if (!dataDir) throw new Error(`Unable to find Vercel CLI data directory. Your platform: ${process.platform}. Supported: darwin, linux, win32.`); - return path$1.join(dataDir, "auth.json"); - } - function readAuthConfig() { - try { - const authPath = getAuthConfigPath(); - if (!fs$1.existsSync(authPath)) return null; - const content = fs$1.readFileSync(authPath, "utf8"); - if (!content) return null; - return JSON.parse(content); - } catch (error) { - return null; - } - } - function writeAuthConfig(config) { - const authPath = getAuthConfigPath(); - const authDir = path$1.dirname(authPath); - if (!fs$1.existsSync(authDir)) fs$1.mkdirSync(authDir, { - mode: 504, - recursive: true - }); - fs$1.writeFileSync(authPath, JSON.stringify(config, null, 2), { mode: 384 }); - } - function isValidAccessToken(authConfig, expirationBufferMs = 0) { - if (!authConfig.token) return false; - if (typeof authConfig.expiresAt !== "number") return true; - const nowInSeconds = Math.floor(Date.now() / 1e3); - const bufferInSeconds = expirationBufferMs / 1e3; - return authConfig.expiresAt >= nowInSeconds + bufferInSeconds; - } - 0 && (module.exports = { - isValidAccessToken, - readAuthConfig, - writeAuthConfig - }); -})); -//#endregion -//#region node_modules/@vercel/oidc/dist/oauth.js -var require_oauth = /* @__PURE__ */ __commonJSMin(((exports, module) => { - var __defProp = Object.defineProperty; - var __getOwnPropDesc = Object.getOwnPropertyDescriptor; - var __getOwnPropNames = Object.getOwnPropertyNames; - var __hasOwnProp = Object.prototype.hasOwnProperty; - var __export = (target, all) => { - for (var name in all) __defProp(target, name, { - get: all[name], - enumerable: true - }); - }; - var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { - get: () => from[key], - enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable - }); - } - return to; - }; - var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - var oauth_exports = {}; - __export(oauth_exports, { - processTokenResponse: () => processTokenResponse, - refreshTokenRequest: () => refreshTokenRequest - }); - module.exports = __toCommonJS(oauth_exports); - var import_os = __require("os"); - const VERCEL_ISSUER = "https://vercel.com"; - const VERCEL_CLI_CLIENT_ID = "cl_HYyOPBNtFMfHhaUn9L4QPfTZz6TP47bp"; - const userAgent = `@vercel/oidc node-${process.version} ${(0, import_os.platform)()} (${(0, import_os.arch)()}) ${(0, import_os.hostname)()}`; - let _tokenEndpoint = null; - async function getTokenEndpoint() { - if (_tokenEndpoint) return _tokenEndpoint; - const response = await fetch(`${VERCEL_ISSUER}/.well-known/openid-configuration`, { headers: { "user-agent": userAgent } }); - if (!response.ok) throw new Error("Failed to discover OAuth endpoints"); - const metadata = await response.json(); - if (!metadata || typeof metadata.token_endpoint !== "string") throw new Error("Invalid OAuth discovery response"); - const endpoint = metadata.token_endpoint; - _tokenEndpoint = endpoint; - return endpoint; - } - async function refreshTokenRequest(options) { - const tokenEndpoint = await getTokenEndpoint(); - return await fetch(tokenEndpoint, { - method: "POST", - headers: { - "Content-Type": "application/x-www-form-urlencoded", - "user-agent": userAgent - }, - body: new URLSearchParams({ - client_id: VERCEL_CLI_CLIENT_ID, - grant_type: "refresh_token", - ...options - }) - }); - } - async function processTokenResponse(response) { - const json = await response.json(); - if (!response.ok) { - const errorMsg = typeof json === "object" && json && "error" in json ? String(json.error) : "Token refresh failed"; - return [new Error(errorMsg)]; - } - if (typeof json !== "object" || json === null) return [/* @__PURE__ */ new Error("Invalid token response")]; - if (typeof json.access_token !== "string") return [/* @__PURE__ */ new Error("Missing access_token in response")]; - if (json.token_type !== "Bearer") return [/* @__PURE__ */ new Error("Invalid token_type in response")]; - if (typeof json.expires_in !== "number") return [/* @__PURE__ */ new Error("Missing expires_in in response")]; - return [null, json]; - } - 0 && (module.exports = { - processTokenResponse, - refreshTokenRequest - }); -})); -//#endregion -//#region node_modules/@vercel/oidc/dist/token-util.js -var require_token_util = /* @__PURE__ */ __commonJSMin(((exports, module) => { - var __create = Object.create; - var __defProp = Object.defineProperty; - var __getOwnPropDesc = Object.getOwnPropertyDescriptor; - var __getOwnPropNames = Object.getOwnPropertyNames; - var __getProtoOf = Object.getPrototypeOf; - var __hasOwnProp = Object.prototype.hasOwnProperty; - var __export = (target, all) => { - for (var name in all) __defProp(target, name, { - get: all[name], - enumerable: true - }); - }; - var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { - get: () => from[key], - enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable - }); - } - return to; - }; - var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { - value: mod, - enumerable: true - }) : target, mod)); - var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - var token_util_exports = {}; - __export(token_util_exports, { - assertVercelOidcTokenResponse: () => assertVercelOidcTokenResponse, - findProjectInfo: () => findProjectInfo, - getTokenPayload: () => getTokenPayload, - getVercelDataDir: () => getVercelDataDir, - getVercelOidcToken: () => getVercelOidcToken, - getVercelToken: () => getVercelToken, - isExpired: () => isExpired, - loadToken: () => loadToken, - saveToken: () => saveToken - }); - module.exports = __toCommonJS(token_util_exports); - var path = __toESM(__require("path")); - var fs = __toESM(__require("fs")); - var import_token_error = require_token_error(); - var import_token_io = require_token_io(); - var import_auth_config = require_auth_config(); - var import_oauth = require_oauth(); - var import_auth_errors = require_auth_errors(); - function getVercelDataDir() { - const vercelFolder = "com.vercel.cli"; - const dataDir = (0, import_token_io.getUserDataDir)(); - if (!dataDir) return null; - return path.join(dataDir, vercelFolder); - } - async function getVercelToken(options) { - const authConfig = (0, import_auth_config.readAuthConfig)(); - if (!authConfig?.token) throw new import_auth_errors.AccessTokenMissingError(); - if ((0, import_auth_config.isValidAccessToken)(authConfig, options?.expirationBufferMs)) return authConfig.token; - if (!authConfig.refreshToken) { - (0, import_auth_config.writeAuthConfig)({}); - throw new import_auth_errors.RefreshAccessTokenFailedError("No refresh token available"); - } - try { - const tokenResponse = await (0, import_oauth.refreshTokenRequest)({ refresh_token: authConfig.refreshToken }); - const [tokensError, tokens] = await (0, import_oauth.processTokenResponse)(tokenResponse); - if (tokensError || !tokens) { - (0, import_auth_config.writeAuthConfig)({}); - throw new import_auth_errors.RefreshAccessTokenFailedError(tokensError); - } - const updatedConfig = { - token: tokens.access_token, - expiresAt: Math.floor(Date.now() / 1e3) + tokens.expires_in - }; - if (tokens.refresh_token) updatedConfig.refreshToken = tokens.refresh_token; - (0, import_auth_config.writeAuthConfig)(updatedConfig); - return updatedConfig.token; - } catch (error) { - (0, import_auth_config.writeAuthConfig)({}); - if (error instanceof import_auth_errors.AccessTokenMissingError || error instanceof import_auth_errors.RefreshAccessTokenFailedError) throw error; - throw new import_auth_errors.RefreshAccessTokenFailedError(error); - } - } - async function getVercelOidcToken(authToken, projectId, teamId) { - const url = `https://api.vercel.com/v1/projects/${projectId}/token?source=vercel-oidc-refresh${teamId ? `&teamId=${teamId}` : ""}`; - const res = await fetch(url, { - method: "POST", - headers: { Authorization: `Bearer ${authToken}` } - }); - if (!res.ok) throw new import_token_error.VercelOidcTokenError(`Failed to refresh OIDC token: ${res.statusText}`); - const tokenRes = await res.json(); - assertVercelOidcTokenResponse(tokenRes); - return tokenRes; - } - function assertVercelOidcTokenResponse(res) { - if (!res || typeof res !== "object") throw new TypeError("Vercel OIDC token is malformed. Expected an object. Please run `vc env pull` and try again"); - if (!("token" in res) || typeof res.token !== "string") throw new TypeError("Vercel OIDC token is malformed. Expected a string-valued token property. Please run `vc env pull` and try again"); - } - function findProjectInfo() { - const dir = (0, import_token_io.findRootDir)(); - if (!dir) throw new import_token_error.VercelOidcTokenError("Unable to find project root directory. Have you linked your project with `vc link?`"); - const prjPath = path.join(dir, ".vercel", "project.json"); - if (!fs.existsSync(prjPath)) throw new import_token_error.VercelOidcTokenError("project.json not found, have you linked your project with `vc link?`"); - const prj = JSON.parse(fs.readFileSync(prjPath, "utf8")); - if (typeof prj.projectId !== "string" && typeof prj.orgId !== "string") throw new TypeError("Expected a string-valued projectId property. Try running `vc link` to re-link your project."); - return { - projectId: prj.projectId, - teamId: prj.orgId - }; - } - function saveToken(token, projectId) { - const dir = (0, import_token_io.getUserDataDir)(); - if (!dir) throw new import_token_error.VercelOidcTokenError("Unable to find user data directory. Please reach out to Vercel support."); - const tokenPath = path.join(dir, "com.vercel.token", `${projectId}.json`); - const tokenJson = JSON.stringify(token); - fs.mkdirSync(path.dirname(tokenPath), { - mode: 504, - recursive: true - }); - fs.writeFileSync(tokenPath, tokenJson); - fs.chmodSync(tokenPath, 432); - } - function loadToken(projectId) { - const dir = (0, import_token_io.getUserDataDir)(); - if (!dir) throw new import_token_error.VercelOidcTokenError("Unable to find user data directory. Please reach out to Vercel support."); - const tokenPath = path.join(dir, "com.vercel.token", `${projectId}.json`); - if (!fs.existsSync(tokenPath)) return null; - const token = JSON.parse(fs.readFileSync(tokenPath, "utf8")); - assertVercelOidcTokenResponse(token); - return token; - } - function getTokenPayload(token) { - const tokenParts = token.split("."); - if (tokenParts.length !== 3) throw new import_token_error.VercelOidcTokenError("Invalid token. Please run `vc env pull` and try again"); - const base64 = tokenParts[1].replace(/-/g, "+").replace(/_/g, "/"); - const padded = base64.padEnd(base64.length + (4 - base64.length % 4) % 4, "="); - return JSON.parse(Buffer.from(padded, "base64").toString("utf8")); - } - function isExpired(token, bufferMs = 0) { - return token.exp * 1e3 < Date.now() + bufferMs; - } - 0 && (module.exports = { - assertVercelOidcTokenResponse, - findProjectInfo, - getTokenPayload, - getVercelDataDir, - getVercelOidcToken, - getVercelToken, - isExpired, - loadToken, - saveToken - }); -})); -//#endregion -//#region node_modules/@ai-sdk/gateway/dist/index.js -var import_dist = (/* @__PURE__ */ __commonJSMin(((exports, module) => { - var __defProp = Object.defineProperty; - var __getOwnPropDesc = Object.getOwnPropertyDescriptor; - var __getOwnPropNames = Object.getOwnPropertyNames; - var __hasOwnProp = Object.prototype.hasOwnProperty; - var __export = (target, all) => { - for (var name in all) __defProp(target, name, { - get: all[name], - enumerable: true - }); - }; - var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { - get: () => from[key], - enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable - }); - } - return to; - }; - var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - var src_exports = {}; - __export(src_exports, { - AccessTokenMissingError: () => import_auth_errors.AccessTokenMissingError, - RefreshAccessTokenFailedError: () => import_auth_errors.RefreshAccessTokenFailedError, - getContext: () => import_get_context.getContext, - getVercelOidcToken: () => import_get_vercel_oidc_token.getVercelOidcToken, - getVercelOidcTokenSync: () => import_get_vercel_oidc_token.getVercelOidcTokenSync, - getVercelToken: () => import_token_util.getVercelToken - }); - module.exports = __toCommonJS(src_exports); - var import_get_vercel_oidc_token = require_get_vercel_oidc_token(); - var import_get_context = require_get_context(); - var import_auth_errors = require_auth_errors(); - var import_token_util = require_token_util(); - 0 && (module.exports = { - AccessTokenMissingError, - RefreshAccessTokenFailedError, - getContext, - getVercelOidcToken, - getVercelOidcTokenSync, - getVercelToken - }); -})))(); -function getGatewayRealtimeProtocols(token, options) { - return buildGatewayProtocols("ai-gateway-realtime.v1", token, options); -} -function getGatewayTranscriptionProtocols(token, options) { - return buildGatewayProtocols("ai-gateway-transcription.v1", token, options); -} -function buildGatewayProtocols(marker11, token, options) { - const protocols = [marker11, `ai-gateway-auth.${token}`]; - if (options == null ? void 0 : options.teamIdOrSlug) protocols.push(`ai-gateway-team.${encodeSubprotocolValue(options.teamIdOrSlug)}`); - return protocols; -} -function encodeSubprotocolValue(value) { - const bytes = new TextEncoder().encode(value); - let binary = ""; - for (const byte of bytes) binary += String.fromCharCode(byte); - return btoa(binary).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/u, ""); -} -var symbol = Symbol.for("vercel.ai.gateway.error"); -var _a; -var _b; -var GatewayError = class _GatewayError extends (_b = Error, _a = symbol, _b) { - constructor({ message, statusCode = 500, cause, generationId, isRetryable = statusCode != null && (statusCode === 408 || statusCode === 409 || statusCode === 429 || statusCode >= 500) }) { - super(generationId ? `${message} [${generationId}]` : message); - this[_a] = true; - this.statusCode = statusCode; - this.cause = cause; - this.generationId = generationId; - this.isRetryable = isRetryable; - } - /** - * Checks if the given error is a Gateway Error. - * @param {unknown} error - The error to check. - * @returns {boolean} True if the error is a Gateway Error, false otherwise. - */ - static isInstance(error) { - return _GatewayError.hasMarker(error); - } - static hasMarker(error) { - return typeof error === "object" && error !== null && symbol in error && error[symbol] === true; - } -}; -var name = "GatewayAuthenticationError"; -var marker2 = `vercel.ai.gateway.error.${name}`; -var symbol2 = Symbol.for(marker2); -var _a2; -var _b2; -var GatewayAuthenticationError = class _GatewayAuthenticationError extends (_b2 = GatewayError, _a2 = symbol2, _b2) { - constructor({ message = "Authentication failed", statusCode = 401, cause, generationId } = {}) { - super({ - message, - statusCode, - cause, - generationId - }); - this[_a2] = true; - this.name = name; - this.type = "authentication_error"; - } - static isInstance(error) { - return GatewayError.hasMarker(error) && symbol2 in error; - } - /** - * Creates a contextual error message when authentication fails - */ - static createContextualError({ apiKeyProvided, oidcTokenProvided, statusCode = 401, cause, generationId }) { - let contextualMessage; - if (apiKeyProvided) contextualMessage = `AI Gateway authentication failed: Invalid API key or token. - -Create a new API key: https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai%2Fapi-keys - -Provide an API key or Vercel access token via 'apiKey' option or 'AI_GATEWAY_API_KEY' environment variable.`; - else if (oidcTokenProvided) contextualMessage = `AI Gateway authentication failed: Invalid OIDC token. - -Run 'npx vercel link' to link your project, then 'vc env pull' to fetch the token. - -Alternatively, use an API key: https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai%2Fapi-keys -or pass a Vercel access token via the 'apiKey' option.`; - else contextualMessage = `AI Gateway authentication failed: No authentication provided. - -Option 1 - API key: -Create an API key: https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai%2Fapi-keys -Provide via 'apiKey' option or 'AI_GATEWAY_API_KEY' environment variable. - -Option 2 - Vercel access token: -Pass a Vercel personal access token or Vercel app access token via the 'apiKey' option. - -Option 3 - OIDC token: -Run 'npx vercel link' to link your project, then 'vc env pull' to fetch the token.`; - return new _GatewayAuthenticationError({ - message: contextualMessage, - statusCode, - cause, - generationId - }); - } -}; -var name2 = "GatewayInvalidRequestError"; -var marker3 = `vercel.ai.gateway.error.${name2}`; -var symbol3 = Symbol.for(marker3); -var _a3; -var _b3; -var GatewayInvalidRequestError = class extends (_b3 = GatewayError, _a3 = symbol3, _b3) { - constructor({ message = "Invalid request", statusCode = 400, cause, generationId } = {}) { - super({ - message, - statusCode, - cause, - generationId - }); - this[_a3] = true; - this.name = name2; - this.type = "invalid_request_error"; - } - static isInstance(error) { - return GatewayError.hasMarker(error) && symbol3 in error; - } -}; -var name3 = "GatewayRateLimitError"; -var marker4 = `vercel.ai.gateway.error.${name3}`; -var symbol4 = Symbol.for(marker4); -var _a4; -var _b4; -var GatewayRateLimitError = class extends (_b4 = GatewayError, _a4 = symbol4, _b4) { - constructor({ message = "Rate limit exceeded", statusCode = 429, cause, generationId } = {}) { - super({ - message, - statusCode, - cause, - generationId - }); - this[_a4] = true; - this.name = name3; - this.type = "rate_limit_exceeded"; - } - static isInstance(error) { - return GatewayError.hasMarker(error) && symbol4 in error; - } -}; -var name4 = "GatewayModelNotFoundError"; -var marker5 = `vercel.ai.gateway.error.${name4}`; -var symbol5 = Symbol.for(marker5); -var modelNotFoundParamSchema = lazySchema(() => zodSchema(object({ modelId: string() }))); -var _a5; -var _b5; -var GatewayModelNotFoundError = class extends (_b5 = GatewayError, _a5 = symbol5, _b5) { - constructor({ message = "Model not found", statusCode = 404, modelId, cause, generationId } = {}) { - super({ - message, - statusCode, - cause, - generationId - }); - this[_a5] = true; - this.name = name4; - this.type = "model_not_found"; - this.modelId = modelId; - } - static isInstance(error) { - return GatewayError.hasMarker(error) && symbol5 in error; - } -}; -var name5 = "GatewayInternalServerError"; -var marker6 = `vercel.ai.gateway.error.${name5}`; -var symbol6 = Symbol.for(marker6); -var _a6; -var _b6; -var GatewayInternalServerError = class extends (_b6 = GatewayError, _a6 = symbol6, _b6) { - constructor({ message = "Internal server error", statusCode = 500, cause, generationId } = {}) { - super({ - message, - statusCode, - cause, - generationId - }); - this[_a6] = true; - this.name = name5; - this.type = "internal_server_error"; - } - static isInstance(error) { - return GatewayError.hasMarker(error) && symbol6 in error; - } -}; -var name6 = "GatewayFailedDependencyError"; -var marker7 = `vercel.ai.gateway.error.${name6}`; -var symbol7 = Symbol.for(marker7); -var _a7; -var _b7; -var GatewayFailedDependencyError = class extends (_b7 = GatewayError, _a7 = symbol7, _b7) { - constructor({ message = "Failed dependency", statusCode = 424, cause, generationId } = {}) { - super({ - message, - statusCode, - cause, - generationId - }); - this[_a7] = true; - this.name = name6; - this.type = "failed_dependency"; - } - static isInstance(error) { - return GatewayError.hasMarker(error) && symbol7 in error; - } -}; -var name7 = "GatewayForbiddenError"; -var marker8 = `vercel.ai.gateway.error.${name7}`; -var symbol8 = Symbol.for(marker8); -var forbiddenParamSchema = lazySchema(() => zodSchema(object({ ruleId: string() }))); -var _a8; -var _b8; -var GatewayForbiddenError = class extends (_b8 = GatewayError, _a8 = symbol8, _b8) { - constructor({ message = "Forbidden", statusCode = 403, cause, generationId, ruleId } = {}) { - super({ - message, - statusCode, - cause, - generationId - }); - this[_a8] = true; - this.name = name7; - this.type = "forbidden"; - this.ruleId = ruleId; - } - static isInstance(error) { - return GatewayError.hasMarker(error) && symbol8 in error; - } -}; -var name8 = "GatewayResponseError"; -var marker9 = `vercel.ai.gateway.error.${name8}`; -var symbol9 = Symbol.for(marker9); -var _a9; -var _b9; -var GatewayResponseError = class extends (_b9 = GatewayError, _a9 = symbol9, _b9) { - constructor({ message = "Invalid response from Gateway", statusCode = 502, response, validationError, cause, generationId } = {}) { - super({ - message, - statusCode, - cause, - generationId - }); - this[_a9] = true; - this.name = name8; - this.type = "response_error"; - this.response = response; - this.validationError = validationError; - } - static isInstance(error) { - return GatewayError.hasMarker(error) && symbol9 in error; - } -}; -async function createGatewayErrorFromResponse({ response, statusCode, defaultMessage = "Gateway request failed", cause, authMethod }) { - var _a11; - const parseResult = await safeValidateTypes({ - value: response, - schema: gatewayErrorResponseSchema - }); - if (!parseResult.success) { - const rawGenerationId = typeof response === "object" && response !== null && "generationId" in response ? response.generationId : void 0; - return new GatewayResponseError({ - message: `Invalid error response format: ${defaultMessage}`, - statusCode, - response, - validationError: parseResult.error, - cause, - generationId: rawGenerationId - }); - } - const validatedResponse = parseResult.value; - const errorType = validatedResponse.error.type; - const message = validatedResponse.error.message; - const generationId = (_a11 = validatedResponse.generationId) != null ? _a11 : void 0; - switch (errorType) { - case "authentication_error": return GatewayAuthenticationError.createContextualError({ - apiKeyProvided: authMethod === "api-key", - oidcTokenProvided: authMethod === "oidc", - statusCode, - cause, - generationId - }); - case "invalid_request_error": return new GatewayInvalidRequestError({ - message, - statusCode, - cause, - generationId - }); - case "rate_limit_exceeded": return new GatewayRateLimitError({ - message, - statusCode, - cause, - generationId - }); - case "model_not_found": { - const modelResult = await safeValidateTypes({ - value: validatedResponse.error.param, - schema: modelNotFoundParamSchema - }); - return new GatewayModelNotFoundError({ - message, - statusCode, - modelId: modelResult.success ? modelResult.value.modelId : void 0, - cause, - generationId - }); - } - case "internal_server_error": return new GatewayInternalServerError({ - message, - statusCode, - cause, - generationId - }); - case "failed_dependency": return new GatewayFailedDependencyError({ - message, - statusCode, - cause, - generationId - }); - case "forbidden": { - const ruleResult = await safeValidateTypes({ - value: validatedResponse.error.param, - schema: forbiddenParamSchema - }); - return new GatewayForbiddenError({ - message, - statusCode, - cause, - generationId, - ruleId: ruleResult.success ? ruleResult.value.ruleId : void 0 - }); - } - default: return new GatewayInternalServerError({ - message, - statusCode, - cause, - generationId - }); - } -} -var gatewayErrorResponseSchema = lazySchema(() => zodSchema(object({ - error: object({ - message: string(), - type: string().nullish(), - param: unknown().nullish(), - code: union([string(), number()]).nullish() - }), - generationId: string().nullish() -}))); -function extractApiCallResponse(error) { - if (error.data !== void 0) return error.data; - if (error.responseBody != null) try { - return secureJsonParse(error.responseBody); - } catch (e) { - return error.responseBody; - } - return {}; -} -var name9 = "GatewayTimeoutError"; -var marker10 = `vercel.ai.gateway.error.${name9}`; -var symbol10 = Symbol.for(marker10); -var _a10; -var _b10; -var GatewayTimeoutError = class _GatewayTimeoutError extends (_b10 = GatewayError, _a10 = symbol10, _b10) { - constructor({ message = "Request timed out", statusCode = 408, cause, generationId } = {}) { - super({ - message, - statusCode, - cause, - generationId - }); - this[_a10] = true; - this.name = name9; - this.type = "timeout_error"; - } - static isInstance(error) { - return GatewayError.hasMarker(error) && symbol10 in error; - } - /** - * Creates a helpful timeout error message with troubleshooting guidance - */ - static createTimeoutError({ originalMessage, statusCode = 408, cause, generationId }) { - const message = `Gateway request timed out: ${originalMessage} - - This is a client-side timeout. To resolve this, increase your timeout configuration: https://vercel.com/docs/ai-gateway/capabilities/video-generation#extending-timeouts-for-node.js`; - return new _GatewayTimeoutError({ - message, - statusCode, - cause, - generationId - }); - } -}; -function isTimeoutError(error) { - if (!(error instanceof Error)) return false; - const errorCode = error.code; - if (typeof errorCode === "string") return [ - "UND_ERR_HEADERS_TIMEOUT", - "UND_ERR_BODY_TIMEOUT", - "UND_ERR_CONNECT_TIMEOUT" - ].includes(errorCode); - return false; -} -async function asGatewayError(error, authMethod) { - var _a11; - if (GatewayError.isInstance(error)) return error; - if (isTimeoutError(error)) return GatewayTimeoutError.createTimeoutError({ - originalMessage: error instanceof Error ? error.message : "Unknown error", - cause: error - }); - if (APICallError.isInstance(error)) { - if (error.cause && isTimeoutError(error.cause)) return GatewayTimeoutError.createTimeoutError({ - originalMessage: error.message, - cause: error - }); - return await createGatewayErrorFromResponse({ - response: extractApiCallResponse(error), - statusCode: (_a11 = error.statusCode) != null ? _a11 : 500, - defaultMessage: "Gateway request failed", - cause: error, - authMethod - }); - } - return await createGatewayErrorFromResponse({ - response: {}, - statusCode: 500, - defaultMessage: error instanceof Error ? `Gateway request failed: ${error.message}` : "Unknown Gateway error", - cause: error, - authMethod - }); -} -var GATEWAY_AUTH_METHOD_HEADER = "ai-gateway-auth-method"; -var VERCEL_AI_GATEWAY_TEAM_HEADER = "x-vercel-ai-gateway-team"; -async function parseAuthMethod(headers) { - const result = await safeValidateTypes({ - value: headers[GATEWAY_AUTH_METHOD_HEADER], - schema: gatewayAuthMethodSchema - }); - return result.success ? result.value : void 0; -} -var gatewayAuthMethodSchema = lazySchema(() => zodSchema(union([literal("api-key"), literal("oidc")]))); -var KNOWN_MODEL_TYPES = [ - "embedding", - "image", - "language", - "realtime", - "reranking", - "speech", - "transcription", - "video" -]; -var GatewayFetchMetadata = class { - constructor(config) { - this.config = config; - } - async getAvailableModels() { - try { - const { value } = await getFromApi({ - url: `${this.config.baseURL}/config`, - validateUrl: false, - headers: this.config.headers ? await resolve(this.config.headers) : void 0, - successfulResponseHandler: createJsonResponseHandler(gatewayAvailableModelsResponseSchema), - failedResponseHandler: createJsonErrorResponseHandler({ - errorSchema: any(), - errorToMessage: (data) => data - }), - fetch: this.config.fetch - }); - return value; - } catch (error) { - throw await asGatewayError(error); - } - } - async getCredits() { - try { - const { value } = await getFromApi({ - url: `${new URL(this.config.baseURL).origin}/v1/credits`, - validateUrl: false, - headers: this.config.headers ? await resolve(this.config.headers) : void 0, - successfulResponseHandler: createJsonResponseHandler(gatewayCreditsResponseSchema), - failedResponseHandler: createJsonErrorResponseHandler({ - errorSchema: any(), - errorToMessage: (data) => data - }), - fetch: this.config.fetch - }); - return value; - } catch (error) { - throw await asGatewayError(error); - } - } -}; -var gatewayAvailableModelsResponseSchema = lazySchema(() => zodSchema(object({ models: array(object({ - id: string(), - name: string(), - description: string().nullish(), - pricing: object({ - input: string(), - output: string(), - input_cache_read: string().nullish(), - input_cache_write: string().nullish() - }).transform(({ input, output, input_cache_read, input_cache_write }) => ({ - input, - output, - ...input_cache_read ? { cachedInputTokens: input_cache_read } : {}, - ...input_cache_write ? { cacheCreationInputTokens: input_cache_write } : {} - })).nullish(), - specification: object({ - specificationVersion: literal("v4"), - provider: string(), - modelId: string() - }), - modelType: string().nullish() -})).transform((models) => models.filter((m) => m.modelType == null || KNOWN_MODEL_TYPES.includes(m.modelType))) }))); -var gatewayCreditsResponseSchema = lazySchema(() => zodSchema(object({ - balance: string(), - total_used: string() -}).transform(({ balance, total_used }) => ({ - balance, - totalUsed: total_used -})))); -var GatewaySpendReport = class { - constructor(config) { - this.config = config; - } - async getSpendReport(params) { - try { - const baseUrl = new URL(this.config.baseURL); - const searchParams = new URLSearchParams(); - searchParams.set("start_date", params.startDate); - searchParams.set("end_date", params.endDate); - if (params.groupBy) searchParams.set("group_by", params.groupBy); - if (params.datePart) searchParams.set("date_part", params.datePart); - if (params.userId) searchParams.set("user_id", params.userId); - if (params.model) searchParams.set("model", params.model); - if (params.provider) searchParams.set("provider", params.provider); - if (params.credentialType) searchParams.set("credential_type", params.credentialType); - if (params.tags && params.tags.length > 0) searchParams.set("tags", params.tags.join(",")); - const { value } = await getFromApi({ - url: `${baseUrl.origin}/v1/report?${searchParams.toString()}`, - validateUrl: false, - headers: this.config.headers ? await resolve(this.config.headers) : void 0, - successfulResponseHandler: createJsonResponseHandler(gatewaySpendReportResponseSchema), - failedResponseHandler: createJsonErrorResponseHandler({ - errorSchema: any(), - errorToMessage: (data) => data - }), - fetch: this.config.fetch - }); - return value; - } catch (error) { - throw await asGatewayError(error); - } - } -}; -var gatewaySpendReportResponseSchema = lazySchema(() => zodSchema(object({ results: array(object({ - day: string().optional(), - hour: string().optional(), - user: string().optional(), - model: string().optional(), - tag: string().optional(), - provider: string().optional(), - credential_type: _enum(["byok", "system"]).optional(), - total_cost: number(), - market_cost: number().optional(), - input_tokens: number().optional(), - output_tokens: number().optional(), - cached_input_tokens: number().optional(), - cache_creation_input_tokens: number().optional(), - reasoning_tokens: number().optional(), - request_count: number().optional() -}).transform(({ credential_type, total_cost, market_cost, input_tokens, output_tokens, cached_input_tokens, cache_creation_input_tokens, reasoning_tokens, request_count, ...rest }) => ({ - ...rest, - ...credential_type !== void 0 ? { credentialType: credential_type } : {}, - totalCost: total_cost, - ...market_cost !== void 0 ? { marketCost: market_cost } : {}, - ...input_tokens !== void 0 ? { inputTokens: input_tokens } : {}, - ...output_tokens !== void 0 ? { outputTokens: output_tokens } : {}, - ...cached_input_tokens !== void 0 ? { cachedInputTokens: cached_input_tokens } : {}, - ...cache_creation_input_tokens !== void 0 ? { cacheCreationInputTokens: cache_creation_input_tokens } : {}, - ...reasoning_tokens !== void 0 ? { reasoningTokens: reasoning_tokens } : {}, - ...request_count !== void 0 ? { requestCount: request_count } : {} -}))) }))); -var GatewayGenerationInfoFetcher = class { - constructor(config) { - this.config = config; - } - async getGenerationInfo(params) { - try { - const { value } = await getFromApi({ - url: `${new URL(this.config.baseURL).origin}/v1/generation?id=${encodeURIComponent(params.id)}`, - validateUrl: false, - headers: this.config.headers ? await resolve(this.config.headers) : void 0, - successfulResponseHandler: createJsonResponseHandler(gatewayGenerationInfoResponseSchema), - failedResponseHandler: createJsonErrorResponseHandler({ - errorSchema: any(), - errorToMessage: (data) => data - }), - fetch: this.config.fetch - }); - return value; - } catch (error) { - throw await asGatewayError(error); - } - } -}; -var gatewayGenerationInfoResponseSchema = lazySchema(() => zodSchema(object({ data: object({ - id: string(), - total_cost: number(), - upstream_inference_cost: number(), - usage: number(), - created_at: string(), - model: string(), - is_byok: boolean(), - provider_name: string(), - streamed: boolean(), - finish_reason: string(), - latency: number(), - generation_time: number(), - native_tokens_prompt: number(), - native_tokens_completion: number(), - native_tokens_reasoning: number(), - native_tokens_cached: number(), - native_tokens_cache_creation: number(), - billable_web_search_calls: number() -}).transform(({ total_cost, upstream_inference_cost, created_at, is_byok, provider_name, finish_reason, generation_time, native_tokens_prompt, native_tokens_completion, native_tokens_reasoning, native_tokens_cached, native_tokens_cache_creation, billable_web_search_calls, ...rest }) => ({ - ...rest, - totalCost: total_cost, - upstreamInferenceCost: upstream_inference_cost, - createdAt: created_at, - isByok: is_byok, - providerName: provider_name, - finishReason: finish_reason, - generationTime: generation_time, - promptTokens: native_tokens_prompt, - completionTokens: native_tokens_completion, - reasoningTokens: native_tokens_reasoning, - cachedTokens: native_tokens_cached, - cacheCreationTokens: native_tokens_cache_creation, - billableWebSearchCalls: billable_web_search_calls -})) }).transform(({ data }) => data))); -var GatewayLanguageModel = class _GatewayLanguageModel { - constructor(modelId, config) { - this.modelId = modelId; - this.config = config; - this.specificationVersion = "v4"; - this.supportedUrls = { "*/*": [/.*/] }; - } - static [WORKFLOW_SERIALIZE](model) { - return serializeModelOptions({ - modelId: model.modelId, - config: model.config - }); - } - static [WORKFLOW_DESERIALIZE](options) { - return new _GatewayLanguageModel(options.modelId, options.config); - } - get provider() { - return this.config.provider; - } - async getArgs(options) { - const { abortSignal: _abortSignal, ...optionsWithoutSignal } = options; - return { - args: this.maybeEncodeFileParts(optionsWithoutSignal), - warnings: [] - }; - } - async doGenerate(options) { - const { args, warnings } = await this.getArgs(options); - const { abortSignal } = options; - const resolvedHeaders = this.config.headers ? await resolve(this.config.headers) : void 0; - try { - const { responseHeaders, value: responseBody, rawValue: rawResponse } = await postJsonToApi({ - url: this.getUrl(), - headers: combineHeaders(resolvedHeaders, options.headers, this.getModelConfigHeaders(this.modelId, false), await resolve(this.config.o11yHeaders)), - body: args, - successfulResponseHandler: createJsonResponseHandler(any()), - failedResponseHandler: createJsonErrorResponseHandler({ - errorSchema: any(), - errorToMessage: (data) => data - }), - ...abortSignal && { abortSignal }, - fetch: this.config.fetch - }); - return { - ...responseBody, - request: { body: args }, - response: { - headers: responseHeaders, - body: rawResponse - }, - warnings - }; - } catch (error) { - throw await asGatewayError(error, await parseAuthMethod(resolvedHeaders != null ? resolvedHeaders : {})); - } - } - async doStream(options) { - const { args, warnings } = await this.getArgs(options); - const { abortSignal } = options; - const resolvedHeaders = this.config.headers ? await resolve(this.config.headers) : void 0; - try { - const { value: response, responseHeaders } = await postJsonToApi({ - url: this.getUrl(), - headers: combineHeaders(resolvedHeaders, options.headers, this.getModelConfigHeaders(this.modelId, true), await resolve(this.config.o11yHeaders)), - body: args, - successfulResponseHandler: createEventSourceResponseHandler(any()), - failedResponseHandler: createJsonErrorResponseHandler({ - errorSchema: any(), - errorToMessage: (data) => data - }), - ...abortSignal && { abortSignal }, - fetch: this.config.fetch - }); - return { - stream: response.pipeThrough(new TransformStream({ - start(controller) { - if (warnings.length > 0) controller.enqueue({ - type: "stream-start", - warnings - }); - }, - transform(chunk, controller) { - if (chunk.success) { - const streamPart = chunk.value; - if (streamPart.type === "raw" && !options.includeRawChunks) return; - if (streamPart.type === "response-metadata" && streamPart.timestamp && typeof streamPart.timestamp === "string") streamPart.timestamp = new Date(streamPart.timestamp); - controller.enqueue(streamPart); - } else controller.error(chunk.error); - } - })), - request: { body: args }, - response: { headers: responseHeaders } - }; - } catch (error) { - throw await asGatewayError(error, await parseAuthMethod(resolvedHeaders != null ? resolvedHeaders : {})); - } - } - /** - * Encodes inline `Uint8Array` file data to a base64 string in place. - * @param options - The options to encode. - * @returns The options with the file data encoded. - */ - maybeEncodeFileParts(options) { - for (const message of options.prompt) { - if (!Array.isArray(message.content)) continue; - for (const part of message.content) if (part.type === "file" || part.type === "reasoning-file") part.data = maybeBase64EncodeFileData(part.data); - else if (part.type === "tool-result" && part.output.type === "content") { - for (const contentPart of part.output.value) if (contentPart.type === "file") contentPart.data = maybeBase64EncodeFileData(contentPart.data); - } - } - return options; - } - getUrl() { - return `${this.config.baseURL}/language-model`; - } - getModelConfigHeaders(modelId, streaming) { - return { - "ai-language-model-specification-version": "4", - "ai-language-model-id": modelId, - "ai-language-model-streaming": String(streaming) - }; - } -}; -function maybeBase64EncodeFileData(data) { - if (data.type === "data") { - const bytes = data.data; - if (bytes instanceof Uint8Array) return { - ...data, - data: Buffer.from(bytes).toString("base64") - }; - } - return data; -} -var GatewayEmbeddingModel = class _GatewayEmbeddingModel { - constructor(modelId, config) { - this.modelId = modelId; - this.config = config; - this.specificationVersion = "v4"; - this.maxEmbeddingsPerCall = 2048; - this.supportsParallelCalls = true; - } - static [WORKFLOW_SERIALIZE](model) { - return serializeModelOptions({ - modelId: model.modelId, - config: model.config - }); - } - static [WORKFLOW_DESERIALIZE](options) { - return new _GatewayEmbeddingModel(options.modelId, options.config); - } - get provider() { - return this.config.provider; - } - async doEmbed({ values, headers, abortSignal, providerOptions }) { - var _a11, _b11; - const resolvedHeaders = this.config.headers ? await resolve(this.config.headers) : void 0; - try { - const { responseHeaders, value: responseBody, rawValue } = await postJsonToApi({ - url: this.getUrl(), - headers: combineHeaders(resolvedHeaders, headers != null ? headers : {}, this.getModelConfigHeaders(), await resolve(this.config.o11yHeaders)), - body: { - values, - ...providerOptions ? { providerOptions } : {} - }, - successfulResponseHandler: createJsonResponseHandler(gatewayEmbeddingResponseSchema), - failedResponseHandler: createJsonErrorResponseHandler({ - errorSchema: any(), - errorToMessage: (data) => data - }), - ...abortSignal && { abortSignal }, - fetch: this.config.fetch - }); - return { - embeddings: responseBody.embeddings, - usage: (_a11 = responseBody.usage) != null ? _a11 : void 0, - providerMetadata: responseBody.providerMetadata, - response: { - headers: responseHeaders, - body: rawValue - }, - warnings: (_b11 = responseBody.warnings) != null ? _b11 : [] - }; - } catch (error) { - throw await asGatewayError(error, await parseAuthMethod(resolvedHeaders != null ? resolvedHeaders : {})); - } - } - getUrl() { - return `${this.config.baseURL}/embedding-model`; - } - getModelConfigHeaders() { - return { - "ai-embedding-model-specification-version": "4", - "ai-model-id": this.modelId - }; - } -}; -var gatewayEmbeddingWarningSchema = discriminatedUnion("type", [ - object({ - type: literal("unsupported"), - feature: string(), - details: string().optional() - }), - object({ - type: literal("compatibility"), - feature: string(), - details: string().optional() - }), - object({ - type: literal("deprecated"), - setting: string(), - message: string() - }), - object({ - type: literal("other"), - message: string() - }) -]); -var gatewayEmbeddingResponseSchema = lazySchema(() => zodSchema(object({ - embeddings: array(array(number())), - usage: object({ tokens: number() }).nullish(), - warnings: array(gatewayEmbeddingWarningSchema).optional(), - providerMetadata: record(string(), record(string(), unknown())).optional() -}))); -var GatewayImageModel = class _GatewayImageModel { - constructor(modelId, config) { - this.modelId = modelId; - this.config = config; - this.specificationVersion = "v4"; - this.maxImagesPerCall = Number.MAX_SAFE_INTEGER; - } - static [WORKFLOW_SERIALIZE](model) { - return serializeModelOptions({ - modelId: model.modelId, - config: model.config - }); - } - static [WORKFLOW_DESERIALIZE](options) { - return new _GatewayImageModel(options.modelId, options.config); - } - get provider() { - return this.config.provider; - } - async doGenerate({ prompt, n, size, aspectRatio, seed, files, mask, providerOptions, headers, abortSignal }) { - var _a11, _b11, _c, _d; - const resolvedHeaders = this.config.headers ? await resolve(this.config.headers) : void 0; - try { - const { responseHeaders, value: responseBody } = await postJsonToApi({ - url: this.getUrl(), - headers: combineHeaders(resolvedHeaders, headers != null ? headers : {}, this.getModelConfigHeaders(), await resolve(this.config.o11yHeaders)), - body: { - prompt, - n, - ...size && { size }, - ...aspectRatio && { aspectRatio }, - ...seed && { seed }, - ...providerOptions && { providerOptions }, - ...files && { files: files.map((file) => maybeEncodeImageFile(file)) }, - ...mask && { mask: maybeEncodeImageFile(mask) } - }, - successfulResponseHandler: createJsonResponseHandler(gatewayImageResponseSchema), - failedResponseHandler: createJsonErrorResponseHandler({ - errorSchema: any(), - errorToMessage: (data) => data - }), - ...abortSignal && { abortSignal }, - fetch: this.config.fetch - }); - return { - images: responseBody.images, - warnings: (_a11 = responseBody.warnings) != null ? _a11 : [], - providerMetadata: responseBody.providerMetadata, - response: { - timestamp: /* @__PURE__ */ new Date(), - modelId: this.modelId, - headers: responseHeaders - }, - ...responseBody.usage != null && { usage: { - inputTokens: (_b11 = responseBody.usage.inputTokens) != null ? _b11 : void 0, - outputTokens: (_c = responseBody.usage.outputTokens) != null ? _c : void 0, - totalTokens: (_d = responseBody.usage.totalTokens) != null ? _d : void 0 - } } - }; - } catch (error) { - throw await asGatewayError(error, await parseAuthMethod(resolvedHeaders != null ? resolvedHeaders : {})); - } - } - getUrl() { - return `${this.config.baseURL}/image-model`; - } - getModelConfigHeaders() { - return { - "ai-image-model-specification-version": "4", - "ai-model-id": this.modelId - }; - } -}; -function maybeEncodeImageFile(file) { - if (file.type === "file" && file.data instanceof Uint8Array) return { - ...file, - data: convertUint8ArrayToBase64(file.data) - }; - return file; -} -var providerMetadataEntrySchema = object({ images: array(unknown()).optional() }).catchall(unknown()); -var gatewayImageWarningSchema = discriminatedUnion("type", [ - object({ - type: literal("unsupported"), - feature: string(), - details: string().optional() - }), - object({ - type: literal("compatibility"), - feature: string(), - details: string().optional() - }), - object({ - type: literal("deprecated"), - setting: string(), - message: string() - }), - object({ - type: literal("other"), - message: string() - }) -]); -var gatewayImageUsageSchema = object({ - inputTokens: number().nullish(), - outputTokens: number().nullish(), - totalTokens: number().nullish() -}); -var gatewayImageResponseSchema = object({ - images: array(string()), - warnings: array(gatewayImageWarningSchema).optional(), - providerMetadata: record(string(), providerMetadataEntrySchema).optional(), - usage: gatewayImageUsageSchema.optional() -}); -var GatewayVideoModel = class { - constructor(modelId, config) { - this.modelId = modelId; - this.config = config; - this.specificationVersion = "v4"; - this.maxVideosPerCall = Number.MAX_SAFE_INTEGER; - } - get provider() { - return this.config.provider; - } - async doGenerate({ prompt, n, aspectRatio, resolution, duration, fps, seed, generateAudio, image, frameImages, inputReferences, providerOptions, headers, abortSignal }) { - var _a11; - const resolvedHeaders = this.config.headers ? await resolve(this.config.headers) : void 0; - try { - const { responseHeaders, value: responseBody } = await postJsonToApi({ - url: this.getUrl(), - headers: combineHeaders(resolvedHeaders, headers != null ? headers : {}, this.getModelConfigHeaders(), await resolve(this.config.o11yHeaders), { accept: "text/event-stream" }), - body: { - prompt, - n, - ...aspectRatio && { aspectRatio }, - ...resolution && { resolution }, - ...duration && { duration }, - ...fps && { fps }, - ...seed && { seed }, - ...generateAudio !== void 0 && { generateAudio }, - ...providerOptions && { providerOptions }, - ...image && { image: maybeEncodeVideoFile(image) }, - ...frameImages && { frameImages: frameImages.map((frame) => ({ - ...frame, - image: maybeEncodeVideoFile(frame.image) - })) }, - ...inputReferences && { inputReferences: inputReferences.map((reference) => maybeEncodeVideoFile(reference)) } - }, - successfulResponseHandler: async ({ response, url, requestBodyValues }) => { - if (response.body == null) throw new APICallError({ - message: "SSE response body is empty", - url, - requestBodyValues, - statusCode: response.status - }); - const reader = parseJsonEventStream({ - stream: response.body, - schema: gatewayVideoEventSchema - }).getReader(); - const { done, value: parseResult } = await reader.read(); - reader.releaseLock(); - if (done || !parseResult) throw new APICallError({ - message: "SSE stream ended without a data event", - url, - requestBodyValues, - statusCode: response.status - }); - if (!parseResult.success) throw new APICallError({ - message: "Failed to parse video SSE event", - cause: parseResult.error, - url, - requestBodyValues, - statusCode: response.status - }); - const event = parseResult.value; - if (event.type === "error") throw new APICallError({ - message: event.message, - statusCode: event.statusCode, - url, - requestBodyValues, - responseHeaders: Object.fromEntries([...response.headers]), - responseBody: JSON.stringify(event), - data: { error: { - message: event.message, - type: event.errorType, - param: event.param - } } - }); - return { - value: { - videos: event.videos, - warnings: event.warnings, - providerMetadata: event.providerMetadata - }, - responseHeaders: Object.fromEntries([...response.headers]) - }; - }, - failedResponseHandler: createJsonErrorResponseHandler({ - errorSchema: any(), - errorToMessage: (data) => data - }), - ...abortSignal && { abortSignal }, - fetch: this.config.fetch - }); - return { - videos: responseBody.videos, - warnings: (_a11 = responseBody.warnings) != null ? _a11 : [], - providerMetadata: responseBody.providerMetadata, - response: { - timestamp: /* @__PURE__ */ new Date(), - modelId: this.modelId, - headers: responseHeaders - } - }; - } catch (error) { - throw await asGatewayError(error, await parseAuthMethod(resolvedHeaders != null ? resolvedHeaders : {})); - } - } - getUrl() { - return `${this.config.baseURL}/video-model`; - } - getModelConfigHeaders() { - return { - "ai-video-model-specification-version": "4", - "ai-model-id": this.modelId - }; - } -}; -function maybeEncodeVideoFile(file) { - if (file.type === "file" && file.data instanceof Uint8Array) return { - ...file, - data: convertUint8ArrayToBase64(file.data) - }; - return file; -} -var providerMetadataEntrySchema2 = object({ videos: array(unknown()).optional() }).catchall(unknown()); -var gatewayVideoDataSchema = union([object({ - type: literal("url"), - url: string(), - mediaType: string() -}), object({ - type: literal("base64"), - data: string(), - mediaType: string() -})]); -var gatewayVideoWarningSchema = discriminatedUnion("type", [ - object({ - type: literal("unsupported"), - feature: string(), - details: string().optional() - }), - object({ - type: literal("compatibility"), - feature: string(), - details: string().optional() - }), - object({ - type: literal("deprecated"), - setting: string(), - message: string() - }), - object({ - type: literal("other"), - message: string() - }) -]); -var gatewayVideoEventSchema = discriminatedUnion("type", [object({ - type: literal("result"), - videos: array(gatewayVideoDataSchema), - warnings: array(gatewayVideoWarningSchema).optional(), - providerMetadata: record(string(), providerMetadataEntrySchema2).optional() -}), object({ - type: literal("error"), - message: string(), - errorType: string(), - statusCode: number(), - param: unknown().nullable() -})]); -var GatewayRerankingModel = class { - constructor(modelId, config) { - this.modelId = modelId; - this.config = config; - this.specificationVersion = "v4"; - } - get provider() { - return this.config.provider; - } - async doRerank({ documents, query, topN, headers, abortSignal, providerOptions }) { - var _a11; - const resolvedHeaders = this.config.headers ? await resolve(this.config.headers) : void 0; - try { - const { responseHeaders, value: responseBody, rawValue } = await postJsonToApi({ - url: this.getUrl(), - headers: combineHeaders(resolvedHeaders, headers != null ? headers : {}, this.getModelConfigHeaders(), await resolve(this.config.o11yHeaders)), - body: { - documents, - query, - ...topN != null ? { topN } : {}, - ...providerOptions ? { providerOptions } : {} - }, - successfulResponseHandler: createJsonResponseHandler(gatewayRerankingResponseSchema), - failedResponseHandler: createJsonErrorResponseHandler({ - errorSchema: any(), - errorToMessage: (data) => data - }), - ...abortSignal && { abortSignal }, - fetch: this.config.fetch - }); - return { - ranking: responseBody.ranking, - providerMetadata: responseBody.providerMetadata, - response: { - headers: responseHeaders, - body: rawValue - }, - warnings: (_a11 = responseBody.warnings) != null ? _a11 : [] - }; - } catch (error) { - throw await asGatewayError(error, await parseAuthMethod(resolvedHeaders != null ? resolvedHeaders : {})); - } - } - getUrl() { - return `${this.config.baseURL}/reranking-model`; - } - getModelConfigHeaders() { - return { - "ai-reranking-model-specification-version": "4", - "ai-model-id": this.modelId - }; - } -}; -var gatewayRerankingWarningSchema = discriminatedUnion("type", [ - object({ - type: literal("unsupported"), - feature: string(), - details: string().optional() - }), - object({ - type: literal("compatibility"), - feature: string(), - details: string().optional() - }), - object({ - type: literal("deprecated"), - setting: string(), - message: string() - }), - object({ - type: literal("other"), - message: string() - }) -]); -var gatewayRerankingResponseSchema = lazySchema(() => zodSchema(object({ - ranking: array(object({ - index: number(), - relevanceScore: number() - })), - warnings: array(gatewayRerankingWarningSchema).optional(), - providerMetadata: record(string(), record(string(), unknown())).optional() -}))); -var GatewaySpeechModel = class { - constructor(modelId, config) { - this.modelId = modelId; - this.config = config; - this.specificationVersion = "v4"; - } - get provider() { - return this.config.provider; - } - async doGenerate({ text, voice, outputFormat, instructions, speed, language, providerOptions, headers, abortSignal }) { - var _a11; - const resolvedHeaders = this.config.headers ? await resolve(this.config.headers) : void 0; - try { - const { responseHeaders, value: responseBody, rawValue } = await postJsonToApi({ - url: this.getUrl(), - headers: combineHeaders(resolvedHeaders, headers != null ? headers : {}, this.getModelConfigHeaders(), await resolve(this.config.o11yHeaders)), - body: { - text, - ...voice && { voice }, - ...outputFormat && { outputFormat }, - ...instructions && { instructions }, - ...speed != null && { speed }, - ...language && { language }, - ...providerOptions && { providerOptions } - }, - successfulResponseHandler: createJsonResponseHandler(gatewaySpeechResponseSchema), - failedResponseHandler: createJsonErrorResponseHandler({ - errorSchema: any(), - errorToMessage: (data) => data - }), - ...abortSignal && { abortSignal }, - fetch: this.config.fetch - }); - return { - audio: responseBody.audio, - warnings: (_a11 = responseBody.warnings) != null ? _a11 : [], - providerMetadata: responseBody.providerMetadata, - response: { - timestamp: /* @__PURE__ */ new Date(), - modelId: this.modelId, - headers: responseHeaders, - body: rawValue - } - }; - } catch (error) { - throw await asGatewayError(error, await parseAuthMethod(resolvedHeaders != null ? resolvedHeaders : {})); - } - } - getUrl() { - return `${this.config.baseURL}/speech-model`; - } - getModelConfigHeaders() { - return { - "ai-speech-model-specification-version": "4", - "ai-model-id": this.modelId - }; - } -}; -var providerMetadataEntrySchema3 = object({}).catchall(unknown()); -var gatewaySpeechWarningSchema = discriminatedUnion("type", [ - object({ - type: literal("unsupported"), - feature: string(), - details: string().optional() - }), - object({ - type: literal("compatibility"), - feature: string(), - details: string().optional() - }), - object({ - type: literal("deprecated"), - setting: string(), - message: string() - }), - object({ - type: literal("other"), - message: string() - }) -]); -var gatewaySpeechResponseSchema = object({ - audio: string(), - warnings: array(gatewaySpeechWarningSchema).optional(), - providerMetadata: record(string(), providerMetadataEntrySchema3).optional() -}); -var GatewayTranscriptionModel = class { - constructor(modelId, config) { - this.modelId = modelId; - this.config = config; - this.specificationVersion = "v4"; - } - get provider() { - return this.config.provider; - } - async doGenerate({ audio, mediaType, providerOptions, headers, abortSignal }) { - var _a11, _b11, _c, _d; - const resolvedHeaders = this.config.headers ? await resolve(this.config.headers) : void 0; - try { - const { responseHeaders, value: responseBody, rawValue } = await postJsonToApi({ - url: this.getUrl(), - headers: combineHeaders(resolvedHeaders, headers != null ? headers : {}, this.getModelConfigHeaders(), await resolve(this.config.o11yHeaders)), - body: { - audio: audio instanceof Uint8Array ? convertUint8ArrayToBase64(audio) : audio, - mediaType, - ...providerOptions && { providerOptions } - }, - successfulResponseHandler: createJsonResponseHandler(gatewayTranscriptionResponseSchema), - failedResponseHandler: createJsonErrorResponseHandler({ - errorSchema: any(), - errorToMessage: (data) => data - }), - ...abortSignal && { abortSignal }, - fetch: this.config.fetch - }); - return { - text: responseBody.text, - segments: (_a11 = responseBody.segments) != null ? _a11 : [], - language: (_b11 = responseBody.language) != null ? _b11 : void 0, - durationInSeconds: (_c = responseBody.durationInSeconds) != null ? _c : void 0, - warnings: (_d = responseBody.warnings) != null ? _d : [], - providerMetadata: responseBody.providerMetadata, - response: { - timestamp: /* @__PURE__ */ new Date(), - modelId: this.modelId, - headers: responseHeaders, - body: rawValue - } - }; - } catch (error) { - throw await asGatewayError(error, await parseAuthMethod(resolvedHeaders != null ? resolvedHeaders : {})); - } - } - async doStream(options) { - var _a11, _b11, _c, _d, _e; - const currentDate = (_c = (_b11 = (_a11 = this.config._internal) == null ? void 0 : _a11.currentDate) == null ? void 0 : _b11.call(_a11)) != null ? _c : /* @__PURE__ */ new Date(); - const headers = combineHeaders(await resolve((_d = this.config.headers) != null ? _d : {}), (_e = options.headers) != null ? _e : {}, this.getModelConfigHeaders(), await resolve(this.config.o11yHeaders)); - const authMethod = await parseAuthMethod(headers); - const startFrame = { - type: "transcription-stream.start", - inputAudioFormat: options.inputAudioFormat, - ...options.providerOptions != null && { providerOptions: options.providerOptions }, - ...options.includeRawChunks != null && { includeRawChunks: options.includeRawChunks } - }; - return { - stream: createGatewayTranscriptionStream({ - webSocket: this.config.webSocket, - url: toGatewayTranscriptionUrl(this.config.baseURL, this.modelId), - protocols: getProtocolsFromHeaders(headers), - headers, - startFrame, - audio: options.audio, - abortSignal: options.abortSignal, - authMethod - }), - request: { body: startFrame }, - response: { - timestamp: currentDate, - modelId: this.modelId - } - }; - } - getUrl() { - return `${this.config.baseURL}/transcription-model`; - } - getModelConfigHeaders() { - return { - "ai-transcription-model-specification-version": "4", - "ai-model-id": this.modelId - }; - } -}; -function toGatewayTranscriptionUrl(baseURL, modelId) { - const url = new URL(`${baseURL.replace(/^http/, "ws")}/transcription-model`); - url.searchParams.set("ai-model-id", modelId); - return url.toString(); -} -function getProtocolsFromHeaders(headers) { - const normalizedHeaders = normalizeHeaders(headers); - const authorization = normalizedHeaders.authorization; - const token = (authorization == null ? void 0 : authorization.startsWith("Bearer ")) ? authorization.slice(7) : void 0; - return token == null ? ["ai-gateway-transcription.v1"] : getGatewayTranscriptionProtocols(token, { teamIdOrSlug: normalizedHeaders[VERCEL_AI_GATEWAY_TEAM_HEADER] }); -} -var MAX_AUDIO_FRAME_BYTES = 64 * 1024; -function createGatewayTranscriptionStream({ webSocket, url, protocols, headers, startFrame, audio, abortSignal, authMethod }) { - let finished = false; - let cleanup = () => {}; - return new ReadableStream({ - start: (controller) => { - let audioReader; - let hasServerErrorPart = false; - let lastServerError; - let audioStopped = false; - let connection; - cleanup = (closeCode) => { - if (audioReader != null) audioReader.cancel().catch(() => {}); - else audio.cancel().catch(() => {}); - connection?.close(closeCode); - }; - const stopAudio = () => { - audioStopped = true; - if (audioReader != null) { - audioReader.cancel().catch(() => {}); - audioReader = void 0; - } else audio.cancel().catch(() => {}); - }; - const finishWithError = (error) => { - if (finished) return; - finished = true; - cleanup(); - errorControllerWithGatewayError(controller, error, authMethod); - }; - const sendAudio = async (socket) => { - const reader = audio.getReader(); - audioReader = reader; - try { - while (true) { - const { done, value } = await reader.read(); - if (done || finished) break; - const bytes = typeof value === "string" ? convertBase64ToUint8Array(value) : value; - for (let offset = 0; offset < bytes.length; offset += MAX_AUDIO_FRAME_BYTES) { - if (finished) break; - socket.send(bytes.subarray(offset, offset + MAX_AUDIO_FRAME_BYTES)); - await waitForWebSocketBufferDrain(socket); - } - } - } finally { - reader.releaseLock(); - if (audioReader === reader) audioReader = void 0; - } - if (!finished && !audioStopped) socket.send(JSON.stringify({ type: "transcription-stream.audio-done" })); - }; - connection = connectToWebSocket({ - url, - protocols, - headers, - webSocket, - abortSignal, - onAbort: (reason) => { - if (finished) return; - finished = true; - cleanup(); - controller.error(reason); - }, - onProcessingError: finishWithError, - onOpen: (socket) => { - socket.send(JSON.stringify(startFrame)); - sendAudio(socket).catch(finishWithError); - }, - onMessageText: (text) => { - if (finished) return; - const part = parseTranscriptionStreamPart(text); - if (part == null) return; - if (part.type === "finish") { - finished = true; - controller.enqueue(part); - controller.close(); - cleanup(1e3); - return; - } - if (part.type === "error") { - hasServerErrorPart = true; - lastServerError = part.error; - stopAudio(); - } - controller.enqueue(part); - }, - onSocketError: () => { - finishWithError(/* @__PURE__ */ new Error("Connection error on AI Gateway transcription stream")); - }, - onClose: () => { - if (hasServerErrorPart) { - if (finished) return; - createErrorFromServerErrorPart(lastServerError, authMethod).then(finishWithError); - return; - } - finishWithError(/* @__PURE__ */ new Error("AI Gateway transcription stream closed before a finish part was received")); - } - }); - }, - cancel: () => { - if (finished) return; - finished = true; - cleanup(); - } - }); -} -var providerMetadataEntrySchema4 = object({}).catchall(unknown()); -var gatewayTranscriptionWarningSchema = discriminatedUnion("type", [ - object({ - type: literal("unsupported"), - feature: string(), - details: string().optional() - }), - object({ - type: literal("compatibility"), - feature: string(), - details: string().optional() - }), - object({ - type: literal("deprecated"), - setting: string(), - message: string() - }), - object({ - type: literal("other"), - message: string() - }) -]); -var gatewayTranscriptionResponseSchema = object({ - text: string(), - segments: array(object({ - text: string(), - startSecond: number(), - endSecond: number() - })).optional(), - language: string().nullish(), - durationInSeconds: number().nullish(), - warnings: array(gatewayTranscriptionWarningSchema).optional(), - providerMetadata: record(string(), providerMetadataEntrySchema4).optional() -}); -async function errorControllerWithGatewayError(controller, error, authMethod) { - controller.error(await asGatewayError(error, authMethod)); -} -function getServerErrorMessage(error) { - if (error != null && typeof error === "object" && "message" in error && typeof error.message === "string") return error.message; - return getErrorMessage(error); -} -var SERVER_ERROR_STATUS_CODES = { - authentication_error: 401, - failed_dependency: 424, - forbidden: 403, - internal_server_error: 500, - invalid_request_error: 400, - model_not_found: 404, - rate_limit_exceeded: 429 -}; -async function createErrorFromServerErrorPart(error, authMethod) { - if (typeof error === "object" && error != null && "message" in error && typeof error.message === "string" && "type" in error && typeof error.type === "string" && error.type in SERVER_ERROR_STATUS_CODES) return createGatewayErrorFromResponse({ - response: { error: { - message: error.message, - type: error.type - } }, - statusCode: SERVER_ERROR_STATUS_CODES[error.type], - authMethod - }); - return /* @__PURE__ */ new Error(`AI Gateway transcription stream failed: ${getServerErrorMessage(error)}`); -} -var GatewayRealtimeModel = class { - constructor(modelId, config) { - this.specificationVersion = "v4"; - this.modelId = modelId; - this.provider = config.provider; - this.config = config; - } - /** - * Mints a single-use, short-lived client secret (`vcst_`) the browser uses to - * open the realtime WebSocket without ever holding the long-lived Gateway - * credential. The customer's server calls this (via - * `gateway.experimental_realtime.getToken`) and hands the returned token to - * the browser, which connects with it through the `ai-gateway-auth.` - * subprotocol. `expiresAfterSeconds` is forwarded to the mint endpoint; - * `sessionConfig` is intentionally unused here — it is applied later via the - * normalized `session-update` event. - */ - async doCreateClientSecret(options) { - const secret = await this.config.createClientSecret({ - modelId: this.modelId, - ...(options == null ? void 0 : options.expiresAfterSeconds) != null && { expiresAfterSeconds: options.expiresAfterSeconds } - }); - return { - token: secret.token, - url: toGatewayRealtimeUrl(this.config.baseURL, this.modelId), - ...secret.expiresAt != null && { expiresAt: secret.expiresAt } - }; - } - getWebSocketConfig(options) { - return { - url: options.url, - protocols: getGatewayRealtimeProtocols(options.token, { teamIdOrSlug: this.config.teamIdOrSlug }) - }; - } - parseServerEvent(raw) { - return raw; - } - serializeClientEvent(event) { - return event; - } - buildSessionConfig(config) { - return config; - } -}; -function toGatewayRealtimeUrl(baseURL, modelId) { - const url = new URL(`${baseURL.replace(/^http/, "ws")}/realtime-model`); - url.searchParams.set("ai-model-id", modelId); - return url.toString(); -} -var exaSearchToolFactory = createProviderExecutedToolFactory({ - id: "gateway.exa_search", - inputSchema: lazySchema(() => zodSchema(object({ - query: string().describe("Natural-language web search query. This is required."), - type: _enum([ - "auto", - "fast", - "instant" - ]).optional().describe("Search method. Use auto for the default balance of speed and quality."), - num_results: number().optional().describe("Maximum number of results to return (1-100, default: 10)."), - category: _enum([ - "company", - "people", - "research paper", - "news", - "personal site", - "financial report" - ]).optional().describe("Optional content category to focus results."), - user_location: string().optional().describe("Two-letter ISO country code such as 'US'."), - include_domains: array(string()).optional().describe("Only return results from these domains."), - exclude_domains: array(string()).optional().describe("Exclude results from these domains."), - start_published_date: string().optional().describe("Only return links published after this ISO 8601 date."), - end_published_date: string().optional().describe("Only return links published before this ISO 8601 date."), - contents: object({ - text: union([boolean(), object({ - max_characters: number().optional(), - include_html_tags: boolean().optional(), - verbosity: _enum([ - "compact", - "standard", - "full" - ]).optional(), - include_sections: array(_enum([ - "header", - "navigation", - "banner", - "body", - "sidebar", - "footer", - "metadata" - ])).optional(), - exclude_sections: array(_enum([ - "header", - "navigation", - "banner", - "body", - "sidebar", - "footer", - "metadata" - ])).optional() - })]).optional(), - highlights: union([boolean(), object({ - query: string().optional(), - max_characters: number().optional() - })]).optional(), - max_age_hours: number().optional(), - livecrawl_timeout: number().optional(), - subpages: number().optional(), - subpage_target: union([string(), array(string())]).optional(), - extras: object({ - links: number().optional(), - image_links: number().optional() - }).optional() - }).optional().describe("Controls extracted page content and freshness.") - }))), - outputSchema: lazySchema(() => zodSchema(union([object({ - requestId: string(), - searchType: string().optional(), - resolvedSearchType: string().optional(), - results: array(object({ - title: string(), - url: string(), - id: string(), - publishedDate: string().nullable().optional(), - author: string().nullable().optional(), - image: string().nullable().optional(), - favicon: string().nullable().optional(), - text: string().optional(), - highlights: array(string()).optional(), - highlightScores: array(number()).optional(), - summary: string().optional(), - subpages: array(any()).optional(), - extras: object({ - links: array(string()).optional(), - imageLinks: array(string()).optional() - }).optional() - })), - costDollars: object({ - total: number().optional(), - search: record(string(), number()).optional() - }).optional() - }), object({ - error: _enum([ - "api_error", - "rate_limit", - "timeout", - "invalid_input", - "configuration_error", - "execution_error", - "unknown" - ]), - statusCode: number().optional(), - message: string() - })]))) -}); -var exaSearch = (config = {}) => exaSearchToolFactory(config); -var parallelSearchToolFactory = createProviderExecutedToolFactory({ - id: "gateway.parallel_search", - inputSchema: lazySchema(() => zodSchema(object({ - objective: string().describe("Natural-language description of the web research goal, including source or freshness guidance and broader context from the task. Maximum 5000 characters."), - search_queries: array(string()).optional().describe("Optional search queries to supplement the objective. Maximum 200 characters per query."), - mode: _enum(["one-shot", "agentic"]).optional().describe("Mode preset: \"one-shot\" for comprehensive results with longer excerpts (default), \"agentic\" for concise, token-efficient results for multi-step workflows."), - max_results: number().optional().describe("Maximum number of results to return (1-20). Defaults to 10 if not specified."), - source_policy: object({ - include_domains: array(string()).optional().describe("Limit results to these domains. Use plain domain names only — e.g. example.com or sub.example.gov, or a bare extension like .edu. Do not include a scheme, path, or port (e.g. not https://example.com/page)."), - exclude_domains: array(string()).optional().describe("Exclude results from these domains. Use plain domain names only — e.g. example.com or sub.example.gov, or a bare extension like .edu. Do not include a scheme, path, or port (e.g. not https://example.com/page)."), - after_date: string().optional().describe("Only include results published after this date. Use an ISO 8601 calendar date formatted YYYY-MM-DD (e.g. 2025-01-01); do not include a time.") - }).optional().describe("Source policy for controlling which domains to include/exclude and freshness."), - excerpts: object({ - max_chars_per_result: number().optional().describe("Maximum characters per result."), - max_chars_total: number().optional().describe("Maximum total characters across all results.") - }).optional().describe("Excerpt configuration for controlling result length."), - fetch_policy: object({ max_age_seconds: number().optional().describe("Maximum age in seconds for cached content. Set to 0 to always fetch fresh content.") }).optional().describe("Fetch policy for controlling content freshness.") - }))), - outputSchema: lazySchema(() => zodSchema(union([object({ - searchId: string(), - results: array(object({ - url: string(), - title: string(), - excerpt: string(), - publishDate: string().nullable().optional(), - relevanceScore: number().optional() - })) - }), object({ - error: _enum([ - "api_error", - "rate_limit", - "timeout", - "invalid_input", - "configuration_error", - "unknown" - ]), - statusCode: number().optional(), - message: string() - })]))) -}); -var parallelSearch = (config = {}) => parallelSearchToolFactory(config); -var perplexitySearchToolFactory = createProviderExecutedToolFactory({ - id: "gateway.perplexity_search", - inputSchema: lazySchema(() => zodSchema(object({ - query: union([string(), array(string())]).describe("Search query (string) or multiple queries (array of up to 5 strings). Multi-query searches return combined results from all queries."), - max_results: number().optional().describe("Maximum number of search results to return (1-20, default: 10)"), - max_tokens_per_page: number().optional().describe("Maximum number of tokens to extract per search result page (256-2048, default: 2048)"), - max_tokens: number().optional().describe("Maximum total tokens across all search results (default: 25000, max: 1000000)"), - country: string().optional().describe("Two-letter ISO 3166-1 alpha-2 country code for regional search results (e.g., 'US', 'GB', 'FR')"), - search_domain_filter: array(string()).optional().describe("List of domains to include or exclude from search results (max 20). To include: ['nature.com', 'science.org']. To exclude: ['-example.com', '-spam.net']"), - search_language_filter: array(string()).optional().describe("List of ISO 639-1 language codes to filter results (max 10, lowercase). Examples: ['en', 'fr', 'de']"), - search_after_date: string().optional().describe("Include only results published after this date. Format: 'MM/DD/YYYY' (e.g., '3/1/2025'). Cannot be used with search_recency_filter."), - search_before_date: string().optional().describe("Include only results published before this date. Format: 'MM/DD/YYYY' (e.g., '3/15/2025'). Cannot be used with search_recency_filter."), - last_updated_after_filter: string().optional().describe("Include only results last updated after this date. Format: 'MM/DD/YYYY' (e.g., '3/1/2025'). Cannot be used with search_recency_filter."), - last_updated_before_filter: string().optional().describe("Include only results last updated before this date. Format: 'MM/DD/YYYY' (e.g., '3/15/2025'). Cannot be used with search_recency_filter."), - search_recency_filter: _enum([ - "day", - "week", - "month", - "year" - ]).optional().describe("Filter results by relative time period. Cannot be used with search_after_date or search_before_date.") - }))), - outputSchema: lazySchema(() => zodSchema(union([object({ - results: array(object({ - title: string(), - url: string(), - snippet: string(), - date: string().optional(), - lastUpdated: string().optional() - })), - id: string() - }), object({ - error: _enum([ - "api_error", - "rate_limit", - "timeout", - "invalid_input", - "unknown" - ]), - statusCode: number().optional(), - message: string() - })]))) -}); -var perplexitySearch = (config = {}) => perplexitySearchToolFactory(config); -var gatewayTools = { - /** - * Search the web using Exa for current information and token-efficient - * excerpts optimized for agent workflows. - * - * Supports search type, category, domain, date, location, and content - * extraction controls. - */ - exaSearch, - /** - * Search the web using Parallel AI's Search API for LLM-optimized excerpts. - * - * Takes a natural language objective and returns relevant excerpts, - * replacing multiple keyword searches with a single call for broad - * or complex queries. Supports different search types for depth vs - * breadth tradeoffs. - */ - parallelSearch, - /** - * Search the web using Perplexity's Search API for real-time information, - * news, research papers, and articles. - * - * Provides ranked search results with advanced filtering options including - * domain, language, date range, and recency filters. - */ - perplexitySearch -}; -async function getVercelRequestId() { - var _a11; - return (_a11 = (0, import_dist.getContext)().headers) == null ? void 0 : _a11["x-vercel-id"]; -} -var AI_GATEWAY_PROTOCOL_VERSION = "0.0.1"; -var gatewayClientSecretResponseSchema = object({ - token: string(), - expiresAt: number().nullish() -}); -function createGateway(options = {}) { - var _a11, _b11; - let pendingMetadata = null; - let metadataCache = null; - const cacheRefreshMillis = (_a11 = options.metadataCacheRefreshMillis) != null ? _a11 : 1e3 * 60 * 5; - let lastFetchTime = 0; - const baseURL = (_b11 = withoutTrailingSlash(options.baseURL)) != null ? _b11 : "https://ai-gateway.vercel.sh/v4/ai"; - const createAuthHeaders = (auth) => withUserAgentSuffix({ - Authorization: `Bearer ${auth.token}`, - "ai-gateway-protocol-version": AI_GATEWAY_PROTOCOL_VERSION, - [GATEWAY_AUTH_METHOD_HEADER]: auth.authMethod, - ...options.teamIdOrSlug != null ? { [VERCEL_AI_GATEWAY_TEAM_HEADER]: options.teamIdOrSlug } : {}, - ...options.headers - }, `ai-sdk/gateway/4.0.20`); - const getHeaders = async () => { - try { - return createAuthHeaders(await getGatewayAuthToken(options)); - } catch (error) { - throw GatewayAuthenticationError.createContextualError({ - apiKeyProvided: false, - oidcTokenProvided: false, - statusCode: 401, - cause: error - }); - } - }; - const getRealtimeAuthToken = async () => { - try { - return await getGatewayAuthToken(options); - } catch (error) { - throw GatewayAuthenticationError.createContextualError({ - apiKeyProvided: false, - oidcTokenProvided: false, - statusCode: 401, - cause: error - }); - } - }; - const mintRealtimeClientSecret = async (params) => { - assertGatewayRealtimeServerEnvironment(); - const auth = await getRealtimeAuthToken(); - const headers = createAuthHeaders(auth); - const url = new URL("/v1/realtime/client-secrets", baseURL).toString(); - try { - const { value } = await postJsonToApi({ - url, - headers, - body: { - model: params.modelId, - ...params.expiresAfterSeconds != null && { expiresIn: params.expiresAfterSeconds } - }, - successfulResponseHandler: createJsonResponseHandler(gatewayClientSecretResponseSchema), - failedResponseHandler: createJsonErrorResponseHandler({ - errorSchema: any(), - errorToMessage: (data) => data - }), - fetch: options.fetch - }); - return { - token: value.token, - ...value.expiresAt != null && { expiresAt: value.expiresAt } - }; - } catch (error) { - throw await asGatewayError(error, await parseAuthMethod(headers)); - } - }; - const createO11yHeaders = () => { - const deploymentId = loadOptionalSetting({ - settingValue: void 0, - environmentVariableName: "VERCEL_DEPLOYMENT_ID" - }); - const environment = loadOptionalSetting({ - settingValue: void 0, - environmentVariableName: "VERCEL_ENV" - }); - const region = loadOptionalSetting({ - settingValue: void 0, - environmentVariableName: "VERCEL_REGION" - }); - const projectId = loadOptionalSetting({ - settingValue: void 0, - environmentVariableName: "VERCEL_PROJECT_ID" - }); - return async () => { - const requestId = await getVercelRequestId(); - return { - ...deploymentId && { "ai-o11y-deployment-id": deploymentId }, - ...environment && { "ai-o11y-environment": environment }, - ...region && { "ai-o11y-region": region }, - ...requestId && { "ai-o11y-request-id": requestId }, - ...projectId && { "ai-o11y-project-id": projectId } - }; - }; - }; - const createLanguageModel = (modelId) => { - return new GatewayLanguageModel(modelId, { - provider: "gateway", - baseURL, - headers: getHeaders, - fetch: options.fetch, - o11yHeaders: createO11yHeaders() - }); - }; - const getAvailableModels = async () => { - var _a12, _b12, _c; - const now = (_c = (_b12 = (_a12 = options._internal) == null ? void 0 : _a12.currentDate) == null ? void 0 : _b12.call(_a12).getTime()) != null ? _c : Date.now(); - if (!pendingMetadata || now - lastFetchTime > cacheRefreshMillis) { - lastFetchTime = now; - pendingMetadata = new GatewayFetchMetadata({ - baseURL, - headers: getHeaders, - fetch: options.fetch - }).getAvailableModels().then((metadata) => { - metadataCache = metadata; - return metadata; - }).catch(async (error) => { - throw await asGatewayError(error, await parseAuthMethod(await getHeaders())); - }); - } - return metadataCache ? Promise.resolve(metadataCache) : pendingMetadata; - }; - const getCredits = async () => { - return new GatewayFetchMetadata({ - baseURL, - headers: getHeaders, - fetch: options.fetch - }).getCredits().catch(async (error) => { - throw await asGatewayError(error, await parseAuthMethod(await getHeaders())); - }); - }; - const getSpendReport = async (params) => { - return new GatewaySpendReport({ - baseURL, - headers: getHeaders, - fetch: options.fetch - }).getSpendReport(params).catch(async (error) => { - throw await asGatewayError(error, await parseAuthMethod(await getHeaders())); - }); - }; - const getGenerationInfo = async (params) => { - return new GatewayGenerationInfoFetcher({ - baseURL, - headers: getHeaders, - fetch: options.fetch - }).getGenerationInfo(params).catch(async (error) => { - throw await asGatewayError(error, await parseAuthMethod(await getHeaders())); - }); - }; - const provider = function(modelId) { - if (new.target) throw new Error("The Gateway Provider model function cannot be called with the new keyword."); - return createLanguageModel(modelId); - }; - provider.specificationVersion = "v4"; - provider.getAvailableModels = getAvailableModels; - provider.getCredits = getCredits; - provider.getSpendReport = getSpendReport; - provider.getGenerationInfo = getGenerationInfo; - provider.imageModel = (modelId) => { - return new GatewayImageModel(modelId, { - provider: "gateway", - baseURL, - headers: getHeaders, - fetch: options.fetch, - o11yHeaders: createO11yHeaders() - }); - }; - provider.languageModel = createLanguageModel; - const createEmbeddingModel = (modelId) => { - return new GatewayEmbeddingModel(modelId, { - provider: "gateway", - baseURL, - headers: getHeaders, - fetch: options.fetch, - o11yHeaders: createO11yHeaders() - }); - }; - provider.embeddingModel = createEmbeddingModel; - provider.textEmbeddingModel = createEmbeddingModel; - provider.videoModel = (modelId) => { - return new GatewayVideoModel(modelId, { - provider: "gateway", - baseURL, - headers: getHeaders, - fetch: options.fetch, - o11yHeaders: createO11yHeaders() - }); - }; - const createRerankingModel = (modelId) => { - return new GatewayRerankingModel(modelId, { - provider: "gateway", - baseURL, - headers: getHeaders, - fetch: options.fetch, - o11yHeaders: createO11yHeaders() - }); - }; - provider.rerankingModel = createRerankingModel; - provider.reranking = createRerankingModel; - const createSpeechModel = (modelId) => { - return new GatewaySpeechModel(modelId, { - provider: "gateway", - baseURL, - headers: getHeaders, - fetch: options.fetch, - o11yHeaders: createO11yHeaders() - }); - }; - provider.speechModel = createSpeechModel; - provider.speech = createSpeechModel; - const createTranscriptionModel = (modelId) => { - return new GatewayTranscriptionModel(modelId, { - provider: "gateway", - baseURL, - headers: getHeaders, - fetch: options.fetch, - o11yHeaders: createO11yHeaders(), - webSocket: options.webSocket - }); - }; - provider.transcriptionModel = createTranscriptionModel; - provider.transcription = createTranscriptionModel; - const createRealtimeModel = (modelId) => new GatewayRealtimeModel(modelId, { - provider: "gateway.realtime", - baseURL, - teamIdOrSlug: options.teamIdOrSlug, - createClientSecret: mintRealtimeClientSecret - }); - provider.experimental_realtime = Object.assign((modelId) => createRealtimeModel(modelId), { getToken: async (tokenOptions) => { - const { model: modelId, ...secretOptions } = tokenOptions; - const secret = await createRealtimeModel(modelId).doCreateClientSecret(secretOptions); - return { - token: secret.token, - url: secret.url, - ...secret.expiresAt != null && { expiresAt: secret.expiresAt } - }; - } }); - provider.chat = provider.languageModel; - provider.embedding = provider.embeddingModel; - provider.image = provider.imageModel; - provider.video = provider.videoModel; - provider.tools = gatewayTools; - return provider; -} -var gateway = createGateway(); -async function getGatewayAuthToken(options) { - const apiKey = loadOptionalSetting({ - settingValue: options.apiKey, - environmentVariableName: "AI_GATEWAY_API_KEY" - }); - if (apiKey) return { - token: apiKey, - authMethod: "api-key" - }; - return { - token: await (0, import_dist.getVercelOidcToken)(), - authMethod: "oidc" - }; -} -function assertGatewayRealtimeServerEnvironment() { - if (typeof globalThis.window !== "undefined") throw new Error("AI Gateway realtime client secrets must be minted server-side: minting needs your Gateway credential, which must never reach the browser. Call gateway.experimental_realtime.getToken() from your server and pass the returned token to the client."); -} -//#endregion -export { AISDKError as $, safeParseJSON as A, boolean as B, isProviderReference as C, readResponseWithSizeLimit as D, lazySchema as E, zodSchema as F, never as G, discriminatedUnion as H, _enum as I, record as J, number as K, _instanceof as L, tool as M, validateTypes as N, resolve as O, withUserAgentSuffix as P, unknown as Q, _null as R, isFullMediaType as S, jsonSchema as T, lazy as U, custom as V, literal as W, string as X, strictObject as Y, union as Z, filterNullable as _, require_token_error as a, isBuffer as b, asArray as c, convertBase64ToUint8Array as d, APICallError as et, convertUint8ArrayToBase64 as f, fetchWithValidatedRedirects as g, executeTool as h, require_token_util as i, getErrorMessage as it, safeValidateTypes as j, retryWithExponentialBackoff as k, asSchema as l, detectMediaType as m, GatewayError as n, TypeValidationError as nt, DelayedPromise as o, createIdGenerator as p, object as q, gateway as r, UnsupportedFunctionalityError as rt, DownloadError as s, GatewayAuthenticationError as t, InvalidPromptError as tt, cancelResponseBody as u, getRuntimeEnvironmentUserAgent as v, isUrlSupported as w, isExecutableTool as x, isAbortError as y, array as z }; diff --git a/.output/server/_libs/ai.mjs b/.output/server/_libs/ai.mjs deleted file mode 100644 index 7c096b6..0000000 --- a/.output/server/_libs/ai.mjs +++ /dev/null @@ -1,7834 +0,0 @@ -import { fileURLToPath as __eveFileURLToPath } from "node:url"; -import { dirname as __eveDirname } from "node:path"; -__eveDirname(__eveFileURLToPath(import.meta.url)); -import { n as __exportAll } from "../_runtime.mjs"; -import { $ as AISDKError, A as safeParseJSON, B as boolean, C as isProviderReference, D as readResponseWithSizeLimit, E as lazySchema, F as zodSchema, G as never, H as discriminatedUnion, I as _enum, J as record, K as number, L as _instanceof, N as validateTypes, O as resolve, P as withUserAgentSuffix, Q as unknown, R as _null, S as isFullMediaType, U as lazy, V as custom, W as literal, X as string, Y as strictObject, Z as union, _ as filterNullable, b as isBuffer, c as asArray, d as convertBase64ToUint8Array, et as APICallError, f as convertUint8ArrayToBase64, g as fetchWithValidatedRedirects, h as executeTool, it as getErrorMessage, j as safeValidateTypes, k as retryWithExponentialBackoff, l as asSchema, m as detectMediaType, n as GatewayError, nt as TypeValidationError, o as DelayedPromise, p as createIdGenerator, q as object$1, r as gateway, rt as UnsupportedFunctionalityError, s as DownloadError, t as GatewayAuthenticationError, tt as InvalidPromptError, u as cancelResponseBody, v as getRuntimeEnvironmentUserAgent, w as isUrlSupported, x as isExecutableTool, y as isAbortError, z as array$1 } from "./@ai-sdk/gateway+[...].mjs"; -//#region node_modules/ai/dist/index.js -var dist_exports = /* @__PURE__ */ __exportAll({ - AI_SDK_TELEMETRY_TRACING_CHANNEL: () => "ai:telemetry", - DefaultGeneratedFile: () => DefaultGeneratedFile, - Experimental_Agent: () => ToolLoopAgent, - InvalidArgumentError: () => InvalidArgumentError, - InvalidDataContentError: () => InvalidDataContentError, - InvalidMessageRoleError: () => InvalidMessageRoleError, - InvalidToolApprovalError: () => InvalidToolApprovalError, - InvalidToolApprovalSignatureError: () => InvalidToolApprovalSignatureError, - InvalidToolInputError: () => InvalidToolInputError, - JsonToSseTransformStream: () => JsonToSseTransformStream, - MissingToolResultsError: () => MissingToolResultsError, - NoObjectGeneratedError: () => NoObjectGeneratedError, - NoOutputGeneratedError: () => NoOutputGeneratedError, - NoSuchToolError: () => NoSuchToolError, - Output: () => output_exports, - RetryError: () => RetryError, - ToolCallNotFoundForApprovalError: () => ToolCallNotFoundForApprovalError, - ToolCallRepairError: () => ToolCallRepairError, - ToolLoopAgent: () => ToolLoopAgent, - UIMessageStreamError: () => UIMessageStreamError, - UI_MESSAGE_STREAM_HEADERS: () => UI_MESSAGE_STREAM_HEADERS, - UnsupportedModelVersionError: () => UnsupportedModelVersionError, - assistantModelMessageSchema: () => assistantModelMessageSchema, - consumeStream: () => consumeStream, - convertDataContentToBase64String: () => convertDataContentToBase64String, - createDownload: () => createDownload, - createTextStreamResponse: () => createTextStreamResponse, - createUIMessageStreamResponse: () => createUIMessageStreamResponse, - experimental_filterActiveTools: () => filterActiveTools, - experimental_streamLanguageModelCall: () => streamLanguageModelCall, - gateway: () => gateway, - generateText: () => generateText, - getChunkTimeoutMs: () => getChunkTimeoutMs, - getStaticToolName: () => getStaticToolName, - getStepTimeoutMs: () => getStepTimeoutMs, - getToolTimeoutMs: () => getToolTimeoutMs, - getTotalTimeoutMs: () => getTotalTimeoutMs, - isDynamicToolUIPart: () => isDynamicToolUIPart, - isStaticToolUIPart: () => isStaticToolUIPart, - isStepCount: () => isStepCount, - isToolUIPart: () => isToolUIPart, - modelMessageSchema: () => modelMessageSchema, - parsePartialJson: () => parsePartialJson, - pipeTextStreamToResponse: () => pipeTextStreamToResponse, - pipeUIMessageStreamToResponse: () => pipeUIMessageStreamToResponse, - registerTelemetry: () => registerTelemetry, - stepCountIs: () => isStepCount, - streamText: () => streamText, - systemModelMessageSchema: () => systemModelMessageSchema, - toTextStream: () => toTextStream, - toUIMessageChunk: () => toUIMessageChunk, - toUIMessageStream: () => toUIMessageStream, - toolModelMessageSchema: () => toolModelMessageSchema, - userModelMessageSchema: () => userModelMessageSchema -}); -var __defProp = Object.defineProperty; -var __export = (target, all) => { - for (var name22 in all) __defProp(target, name22, { - get: all[name22], - enumerable: true - }); -}; -var name = "AI_InvalidArgumentError"; -var marker = `vercel.ai.error.${name}`; -var symbol = Symbol.for(marker); -var _a; -var InvalidArgumentError = class extends AISDKError { - constructor({ parameter, value, message }) { - super({ - name, - message: `Invalid argument for parameter ${parameter}: ${message}` - }); - this[_a] = true; - this.parameter = parameter; - this.value = value; - } - static isInstance(error) { - return AISDKError.hasMarker(error, marker); - } -}; -_a = symbol; -var name3 = "AI_InvalidToolApprovalError"; -var marker3 = `vercel.ai.error.${name3}`; -var symbol3 = Symbol.for(marker3); -var _a3; -var InvalidToolApprovalError = class extends AISDKError { - constructor({ approvalId }) { - super({ - name: name3, - message: `Tool approval response references unknown approvalId: "${approvalId}". No matching tool-approval-request found in message history.` - }); - this[_a3] = true; - this.approvalId = approvalId; - } - static isInstance(error) { - return AISDKError.hasMarker(error, marker3); - } -}; -_a3 = symbol3; -var name4 = "AI_InvalidToolApprovalSignatureError"; -var marker4 = `vercel.ai.error.${name4}`; -var symbol4 = Symbol.for(marker4); -var _a4; -var InvalidToolApprovalSignatureError = class extends AISDKError { - constructor({ approvalId, toolCallId, reason }) { - super({ - name: name4, - message: `Tool approval signature verification failed for approval "${approvalId}" (tool call "${toolCallId}"): ${reason}` - }); - this[_a4] = true; - this.approvalId = approvalId; - this.toolCallId = toolCallId; - } - static isInstance(error) { - return AISDKError.hasMarker(error, marker4); - } -}; -_a4 = symbol4; -var name5 = "AI_InvalidToolInputError"; -var marker5 = `vercel.ai.error.${name5}`; -var symbol5 = Symbol.for(marker5); -var _a5; -var InvalidToolInputError = class extends AISDKError { - constructor({ toolInput, toolName, cause, message = `Invalid input for tool ${toolName}: ${getErrorMessage(cause)}` }) { - super({ - name: name5, - message, - cause - }); - this[_a5] = true; - this.toolInput = toolInput; - this.toolName = toolName; - } - static isInstance(error) { - return AISDKError.hasMarker(error, marker5); - } -}; -_a5 = symbol5; -var name6 = "AI_ToolCallNotFoundForApprovalError"; -var marker6 = `vercel.ai.error.${name6}`; -var symbol6 = Symbol.for(marker6); -var _a6; -var ToolCallNotFoundForApprovalError = class extends AISDKError { - constructor({ toolCallId, approvalId }) { - super({ - name: name6, - message: `Tool call "${toolCallId}" not found for approval request "${approvalId}".` - }); - this[_a6] = true; - this.toolCallId = toolCallId; - this.approvalId = approvalId; - } - static isInstance(error) { - return AISDKError.hasMarker(error, marker6); - } -}; -_a6 = symbol6; -var name7 = "AI_MissingToolResultsError"; -var marker7 = `vercel.ai.error.${name7}`; -var symbol7 = Symbol.for(marker7); -var _a7; -var MissingToolResultsError = class extends AISDKError { - constructor({ toolCallIds }) { - super({ - name: name7, - message: `Tool result${toolCallIds.length > 1 ? "s are" : " is"} missing for tool call${toolCallIds.length > 1 ? "s" : ""} ${toolCallIds.join(", ")}.` - }); - this[_a7] = true; - this.toolCallIds = toolCallIds; - } - static isInstance(error) { - return AISDKError.hasMarker(error, marker7); - } -}; -_a7 = symbol7; -var name9 = "AI_NoObjectGeneratedError"; -var marker9 = `vercel.ai.error.${name9}`; -var symbol9 = Symbol.for(marker9); -var _a9; -var NoObjectGeneratedError = class extends AISDKError { - constructor({ message = "No object generated.", cause, text: text2, response, usage, finishReason }) { - super({ - name: name9, - message, - cause - }); - this[_a9] = true; - this.text = text2; - this.response = response; - this.usage = usage; - this.finishReason = finishReason; - } - static isInstance(error) { - return AISDKError.hasMarker(error, marker9); - } -}; -_a9 = symbol9; -var name10 = "AI_NoOutputGeneratedError"; -var marker10 = `vercel.ai.error.${name10}`; -var symbol10 = Symbol.for(marker10); -var _a10; -var NoOutputGeneratedError = class extends AISDKError { - constructor({ message = "No output generated.", cause } = {}) { - super({ - name: name10, - message, - cause - }); - this[_a10] = true; - } - static isInstance(error) { - return AISDKError.hasMarker(error, marker10); - } -}; -_a10 = symbol10; -var name14 = "AI_NoSuchToolError"; -var marker14 = `vercel.ai.error.${name14}`; -var symbol14 = Symbol.for(marker14); -var _a14; -var NoSuchToolError = class extends AISDKError { - constructor({ toolName, availableTools = void 0, message = `Model tried to call unavailable tool '${toolName}'. ${availableTools === void 0 ? "No tools are available." : `Available tools: ${availableTools.join(", ")}.`}` }) { - super({ - name: name14, - message - }); - this[_a14] = true; - this.toolName = toolName; - this.availableTools = availableTools; - } - static isInstance(error) { - return AISDKError.hasMarker(error, marker14); - } -}; -_a14 = symbol14; -var name15 = "AI_ToolCallRepairError"; -var marker15 = `vercel.ai.error.${name15}`; -var symbol15 = Symbol.for(marker15); -var _a15; -var ToolCallRepairError = class extends AISDKError { - constructor({ cause, originalError, message = `Error repairing tool call: ${getErrorMessage(cause)}` }) { - super({ - name: name15, - message, - cause - }); - this[_a15] = true; - this.originalError = originalError; - } - static isInstance(error) { - return AISDKError.hasMarker(error, marker15); - } -}; -_a15 = symbol15; -var UnsupportedModelVersionError = class extends AISDKError { - constructor(options) { - super({ - name: "AI_UnsupportedModelVersionError", - message: `Unsupported model version ${options.version} for provider "${options.provider}" and model "${options.modelId}". AI SDK 5 only supports models that implement specification version "v2".` - }); - this.version = options.version; - this.provider = options.provider; - this.modelId = options.modelId; - } -}; -var name16 = "AI_UIMessageStreamError"; -var marker16 = `vercel.ai.error.${name16}`; -var symbol16 = Symbol.for(marker16); -var _a16; -var UIMessageStreamError = class extends AISDKError { - constructor({ chunkType, chunkId, message }) { - super({ - name: name16, - message - }); - this[_a16] = true; - this.chunkType = chunkType; - this.chunkId = chunkId; - } - static isInstance(error) { - return AISDKError.hasMarker(error, marker16); - } -}; -_a16 = symbol16; -var name17 = "AI_InvalidDataContentError"; -var marker17 = `vercel.ai.error.${name17}`; -var symbol17 = Symbol.for(marker17); -var _a17; -var InvalidDataContentError = class extends AISDKError { - constructor({ content, cause, message = `Invalid data content. Expected a base64 string, Uint8Array, ArrayBuffer, or Buffer, but got ${typeof content}.` }) { - super({ - name: name17, - message, - cause - }); - this[_a17] = true; - this.content = content; - } - static isInstance(error) { - return AISDKError.hasMarker(error, marker17); - } -}; -_a17 = symbol17; -var name18 = "AI_InvalidMessageRoleError"; -var marker18 = `vercel.ai.error.${name18}`; -var symbol18 = Symbol.for(marker18); -var _a18; -var InvalidMessageRoleError = class extends AISDKError { - constructor({ role, message = `Invalid message role: '${role}'. Must be one of: "system", "user", "assistant", "tool".` }) { - super({ - name: name18, - message - }); - this[_a18] = true; - this.role = role; - } - static isInstance(error) { - return AISDKError.hasMarker(error, marker18); - } -}; -_a18 = symbol18; -var name20 = "AI_RetryError"; -var marker20 = `vercel.ai.error.${name20}`; -var symbol20 = Symbol.for(marker20); -var _a20; -var RetryError = class extends AISDKError { - constructor({ message, reason, errors }) { - super({ - name: name20, - message - }); - this[_a20] = true; - this.reason = reason; - this.errors = errors; - this.lastError = errors[errors.length - 1]; - } - static isInstance(error) { - return AISDKError.hasMarker(error, marker20); - } -}; -_a20 = symbol20; -function formatWarning({ warning, provider, model }) { - const prefix = `AI SDK Warning${provider != null && model != null ? ` (${provider} / ${model})` : ""}:`; - switch (warning.type) { - case "unsupported": { - let message = `${prefix} The feature "${warning.feature}" is not supported.`; - if (warning.details) message += ` ${warning.details}`; - return message; - } - case "compatibility": { - let message = `${prefix} The feature "${warning.feature}" is used in a compatibility mode.`; - if (warning.details) message += ` ${warning.details}`; - return message; - } - case "deprecated": return `${prefix} Deprecated: "${warning.setting}". ${warning.message}`; - case "other": return `${prefix} ${warning.message}`; - default: return `${prefix} ${JSON.stringify(warning, null, 2)}`; - } -} -var FIRST_WARNING_INFO_MESSAGE = "AI SDK Warning System: To turn off warning logging, set the AI_SDK_LOG_WARNINGS global to false."; -var hasLoggedBefore = false; -var logWarnings = (options) => { - if (options.warnings.length === 0) return; - const logger = globalThis.AI_SDK_LOG_WARNINGS; - if (logger === false) return; - if (typeof logger === "function") { - logger(options); - return; - } - if (!hasLoggedBefore) { - hasLoggedBefore = true; - console.info(FIRST_WARNING_INFO_MESSAGE); - } - for (const warning of options.warnings) { - const message = formatWarning({ - warning, - provider: options.provider, - model: options.model - }); - if (typeof process !== "undefined" && typeof process.emitWarning === "function") process.emitWarning(message, { type: warning.type === "deprecated" ? "DeprecationWarning" : "Warning" }); - else console.warn(message); - } -}; -function logV2CompatibilityWarning({ provider, modelId }) { - logWarnings({ - warnings: [{ - type: "compatibility", - feature: "specificationVersion", - details: `Using v2 specification compatibility mode. Some features may not be available.` - }], - provider, - model: modelId - }); -} -function asEmbeddingModelV3(model) { - if (model.specificationVersion === "v3") return model; - logV2CompatibilityWarning({ - provider: model.provider, - modelId: model.modelId - }); - return new Proxy(model, { get(target, prop) { - if (prop === "specificationVersion") return "v3"; - return target[prop]; - } }); -} -function asEmbeddingModelV4(model) { - if (model.specificationVersion === "v4") return model; - const v3Model = model.specificationVersion === "v2" ? asEmbeddingModelV3(model) : model; - return new Proxy(v3Model, { get(target, prop) { - if (prop === "specificationVersion") return "v4"; - return target[prop]; - } }); -} -function asImageModelV3(model) { - if (model.specificationVersion === "v3") return model; - logV2CompatibilityWarning({ - provider: model.provider, - modelId: model.modelId - }); - return new Proxy(model, { get(target, prop) { - if (prop === "specificationVersion") return "v3"; - return target[prop]; - } }); -} -function asImageModelV4(model) { - if (model.specificationVersion === "v4") return model; - const v3Model = model.specificationVersion === "v2" ? asImageModelV3(model) : model; - return new Proxy(v3Model, { get(target, prop) { - if (prop === "specificationVersion") return "v4"; - return target[prop]; - } }); -} -function asLanguageModelV3(model) { - if (model.specificationVersion === "v3") return model; - logV2CompatibilityWarning({ - provider: model.provider, - modelId: model.modelId - }); - return new Proxy(model, { get(target, prop) { - switch (prop) { - case "specificationVersion": return "v3"; - case "doGenerate": return async (...args) => { - const result = await target.doGenerate(...args); - return { - ...result, - finishReason: convertV2FinishReasonToV3(result.finishReason), - usage: convertV2UsageToV3(result.usage) - }; - }; - case "doStream": return async (...args) => { - const result = await target.doStream(...args); - return { - ...result, - stream: convertV2StreamToV3(result.stream) - }; - }; - default: return target[prop]; - } - } }); -} -function convertV2StreamToV3(stream) { - return stream.pipeThrough(new TransformStream({ transform(chunk, controller) { - switch (chunk.type) { - case "finish": - controller.enqueue({ - ...chunk, - finishReason: convertV2FinishReasonToV3(chunk.finishReason), - usage: convertV2UsageToV3(chunk.usage) - }); - break; - default: - controller.enqueue(chunk); - break; - } - } })); -} -function convertV2FinishReasonToV3(finishReason) { - return { - unified: finishReason === "unknown" ? "other" : finishReason, - raw: void 0 - }; -} -function convertV2UsageToV3(usage) { - return { - inputTokens: { - total: usage.inputTokens, - noCache: void 0, - cacheRead: usage.cachedInputTokens, - cacheWrite: void 0 - }, - outputTokens: { - total: usage.outputTokens, - text: void 0, - reasoning: usage.reasoningTokens - } - }; -} -function asLanguageModelV4(model) { - if (model.specificationVersion === "v4") return model; - const v3Model = model.specificationVersion === "v2" ? asLanguageModelV3(model) : model; - return new Proxy(v3Model, { get(target, prop) { - if (prop === "specificationVersion") return "v4"; - return target[prop]; - } }); -} -function asRerankingModelV4(model) { - if (model.specificationVersion === "v4") return model; - return new Proxy(model, { get(target, prop) { - if (prop === "specificationVersion") return "v4"; - return target[prop]; - } }); -} -function asSpeechModelV3(model) { - if (model.specificationVersion === "v3") return model; - logV2CompatibilityWarning({ - provider: model.provider, - modelId: model.modelId - }); - return new Proxy(model, { get(target, prop) { - if (prop === "specificationVersion") return "v3"; - return target[prop]; - } }); -} -function asSpeechModelV4(model) { - if (model.specificationVersion === "v4") return model; - const v3Model = model.specificationVersion === "v2" ? asSpeechModelV3(model) : model; - return new Proxy(v3Model, { get(target, prop) { - if (prop === "specificationVersion") return "v4"; - return target[prop]; - } }); -} -function asTranscriptionModelV3(model) { - if (model.specificationVersion === "v3") return model; - logV2CompatibilityWarning({ - provider: model.provider, - modelId: model.modelId - }); - return new Proxy(model, { get(target, prop) { - if (prop === "specificationVersion") return "v3"; - return target[prop]; - } }); -} -function asTranscriptionModelV4(model) { - if (model.specificationVersion === "v4") return model; - const v3Model = model.specificationVersion === "v2" ? asTranscriptionModelV3(model) : model; - return new Proxy(v3Model, { get(target, prop) { - if (prop === "specificationVersion") return "v4"; - return target[prop]; - } }); -} -function asProviderV3(provider) { - if ("specificationVersion" in provider && provider.specificationVersion === "v3") return provider; - const v2Provider = provider; - return { - specificationVersion: "v3", - languageModel: (modelId) => asLanguageModelV3(v2Provider.languageModel(modelId)), - embeddingModel: (modelId) => asEmbeddingModelV3(v2Provider.textEmbeddingModel(modelId)), - imageModel: (modelId) => asImageModelV3(v2Provider.imageModel(modelId)), - transcriptionModel: v2Provider.transcriptionModel ? (modelId) => asTranscriptionModelV3(v2Provider.transcriptionModel(modelId)) : void 0, - speechModel: v2Provider.speechModel ? (modelId) => asSpeechModelV3(v2Provider.speechModel(modelId)) : void 0, - rerankingModel: void 0 - }; -} -function asProviderV4(provider) { - if ("specificationVersion" in provider && provider.specificationVersion === "v4") return provider; - const v3Provider = !("specificationVersion" in provider) || provider.specificationVersion !== "v3" ? asProviderV3(provider) : provider; - return { - specificationVersion: "v4", - languageModel: (modelId) => asLanguageModelV4(v3Provider.languageModel(modelId)), - embeddingModel: (modelId) => asEmbeddingModelV4(v3Provider.embeddingModel(modelId)), - imageModel: (modelId) => asImageModelV4(v3Provider.imageModel(modelId)), - transcriptionModel: v3Provider.transcriptionModel ? (modelId) => asTranscriptionModelV4(v3Provider.transcriptionModel(modelId)) : void 0, - speechModel: v3Provider.speechModel ? (modelId) => asSpeechModelV4(v3Provider.speechModel(modelId)) : void 0, - rerankingModel: v3Provider.rerankingModel ? (modelId) => asRerankingModelV4(v3Provider.rerankingModel(modelId)) : void 0 - }; -} -function resolveLanguageModel(model) { - if (typeof model === "string") return getGlobalProvider().languageModel(model); - if (![ - "v4", - "v3", - "v2" - ].includes(model.specificationVersion)) { - const unsupportedModel = model; - throw new UnsupportedModelVersionError({ - version: unsupportedModel.specificationVersion, - provider: unsupportedModel.provider, - modelId: unsupportedModel.modelId - }); - } - return asLanguageModelV4(model); -} -function getGlobalProvider() { - var _a22; - return asProviderV4((_a22 = globalThis.AI_SDK_DEFAULT_PROVIDER) != null ? _a22 : gateway); -} -function cloneModelMessages(messages) { - return messages.map((message) => cloneValue(message)); -} -function cloneValue(value) { - if (value instanceof URL) return new URL(value.href); - if (Array.isArray(value)) return value.map((item) => cloneValue(item)); - if (value instanceof Uint8Array) return new Uint8Array(value); - if (value instanceof ArrayBuffer) return value.slice(0); - if (value instanceof Date) return new Date(value); - if (value != null && typeof value === "object") return Object.fromEntries(Object.entries(value).map(([key, value2]) => [key, cloneValue(value2)])); - return value; -} -var VERSION = "7.0.28"; -var download = async ({ url, maxBytes, abortSignal }) => { - var _a22; - const urlText = url.toString(); - try { - const response = await fetchWithValidatedRedirects({ - url: urlText, - headers: withUserAgentSuffix({}, `ai-sdk/${VERSION}`, getRuntimeEnvironmentUserAgent()), - abortSignal - }); - if (!response.ok) { - await cancelResponseBody(response); - throw new DownloadError({ - url: urlText, - statusCode: response.status, - statusText: response.statusText - }); - } - return { - data: await readResponseWithSizeLimit({ - response, - url: urlText, - maxBytes: maxBytes != null ? maxBytes : 2147483648 - }), - mediaType: (_a22 = response.headers.get("content-type")) != null ? _a22 : void 0 - }; - } catch (error) { - if (DownloadError.isInstance(error)) throw error; - throw new DownloadError({ - url: urlText, - cause: error - }); - } -}; -var createDefaultDownloadFunction = (download2 = download) => (requestedDownloads) => Promise.all(requestedDownloads.map(async (requestedDownload) => requestedDownload.isUrlSupportedByModel ? null : await download2(requestedDownload))); -function splitDataUrl(dataUrl) { - try { - const [header, base64Content] = dataUrl.split(","); - return { - mediaType: header.split(";")[0].split(":")[1], - base64Content - }; - } catch (e) { - return { - mediaType: void 0, - base64Content: void 0 - }; - } -} -function isTaggedFileData(value) { - if (typeof value !== "object" || value === null) return false; - const type = value.type; - return type === "data" || type === "url" || type === "reference" || type === "text"; -} -function convertUrlToFilePartData(url) { - if (url.protocol === "data:") { - const { mediaType, base64Content } = splitDataUrl(url.toString()); - if (mediaType == null || base64Content == null) throw new InvalidDataContentError({ - content: url, - message: `Invalid data URL format in content ${url.toString()}` - }); - return { - data: { - type: "data", - data: base64Content - }, - mediaType - }; - } - return { - data: { - type: "url", - url - }, - mediaType: void 0 - }; -} -function convertInlineDataToFilePartData(content) { - if (content instanceof Uint8Array) return { - data: { - type: "data", - data: content - }, - mediaType: void 0 - }; - if (content instanceof ArrayBuffer) return { - data: { - type: "data", - data: new Uint8Array(content) - }, - mediaType: void 0 - }; - if (isBuffer(content)) return { - data: { - type: "data", - data: new Uint8Array(content) - }, - mediaType: void 0 - }; - return { - data: { - type: "data", - data: content - }, - mediaType: void 0 - }; -} -function convertToLanguageModelV4FilePart(content) { - if (isTaggedFileData(content)) switch (content.type) { - case "data": - if (typeof content.data === "string" && content.data.startsWith("data:")) throw new InvalidDataContentError({ - content: content.data, - message: "Data URLs are not valid inline data. Pass them as { type: \"url\", url } instead." - }); - return convertInlineDataToFilePartData(content.data); - case "url": return convertUrlToFilePartData(content.url); - case "reference": return { - data: { - type: "reference", - reference: content.reference - }, - mediaType: void 0 - }; - case "text": return { - data: { - type: "text", - text: content.text - }, - mediaType: void 0 - }; - } - if (content instanceof URL) return convertUrlToFilePartData(content); - if (typeof content === "string") try { - return convertUrlToFilePartData(new URL(content)); - } catch (e) { - return convertInlineDataToFilePartData(content); - } - if (isProviderReference(content)) return { - data: { - type: "reference", - reference: content - }, - mediaType: void 0 - }; - return convertInlineDataToFilePartData(content); -} -async function convertToLanguageModelPrompt({ prompt, supportedUrls, download: download2 = createDefaultDownloadFunction(), provider }) { - const downloadedAssets = await downloadAssets(prompt.messages, download2, supportedUrls); - const approvalIdToToolCallId = /* @__PURE__ */ new Map(); - for (const message of prompt.messages) if (message.role === "assistant" && Array.isArray(message.content)) { - for (const part of message.content) if (part.type === "tool-approval-request" && "approvalId" in part && "toolCallId" in part) approvalIdToToolCallId.set(part.approvalId, part.toolCallId); - } - const approvedToolCallIds = /* @__PURE__ */ new Set(); - for (const message of prompt.messages) if (message.role === "tool") { - for (const part of message.content) if (part.type === "tool-approval-response") { - const toolCallId = approvalIdToToolCallId.get(part.approvalId); - if (toolCallId) approvedToolCallIds.add(toolCallId); - } - } - const messages = [...prompt.instructions != null ? typeof prompt.instructions === "string" ? [{ - role: "system", - content: prompt.instructions - }] : asArray(prompt.instructions).map((message) => ({ - role: "system", - content: message.content, - providerOptions: message.providerOptions - })) : [], ...prompt.messages.map((message) => convertToLanguageModelMessage({ - message, - downloadedAssets, - provider - }))]; - const combinedMessages = []; - for (const message of messages) { - if (message.role !== "tool") { - combinedMessages.push(message); - continue; - } - const lastCombinedMessage = combinedMessages.at(-1); - if ((lastCombinedMessage == null ? void 0 : lastCombinedMessage.role) === "tool") lastCombinedMessage.content.push(...message.content); - else combinedMessages.push(message); - } - const toolCallIds = /* @__PURE__ */ new Set(); - for (const message of combinedMessages) switch (message.role) { - case "assistant": - for (const content of message.content) if (content.type === "tool-call" && !content.providerExecuted) toolCallIds.add(content.toolCallId); - break; - case "tool": - for (const content of message.content) if (content.type === "tool-result") toolCallIds.delete(content.toolCallId); - break; - case "user": - case "system": - for (const id of approvedToolCallIds) toolCallIds.delete(id); - if (toolCallIds.size > 0) throw new MissingToolResultsError({ toolCallIds: Array.from(toolCallIds) }); - break; - } - for (const id of approvedToolCallIds) toolCallIds.delete(id); - if (toolCallIds.size > 0) throw new MissingToolResultsError({ toolCallIds: Array.from(toolCallIds) }); - return combinedMessages.filter((message) => message.role !== "tool" || message.content.length > 0); -} -function convertToLanguageModelMessage({ message, downloadedAssets, provider }) { - const warnings = []; - const role = message.role; - switch (role) { - case "system": return { - role: "system", - content: message.content, - providerOptions: message.providerOptions - }; - case "user": { - if (typeof message.content === "string") return { - role: "user", - content: [{ - type: "text", - text: message.content - }], - providerOptions: message.providerOptions - }; - const converted = { - role: "user", - content: message.content.map((part) => { - if (part.type === "image") warnings.push({ - type: "deprecated", - setting: "\"image\" content part", - message: `The "image" content part type is deprecated. Use a "file" part with mediaType: 'image' (or a more specific image/* subtype) instead.` - }); - return convertImagePartToFilePart(part); - }).map((part) => convertPartToLanguageModelPart(part, downloadedAssets)).filter((part) => part.type !== "text" || part.text !== ""), - providerOptions: message.providerOptions - }; - if (warnings.length > 0) logWarnings({ warnings }); - return converted; - } - case "assistant": { - if (typeof message.content === "string") return { - role: "assistant", - content: [{ - type: "text", - text: message.content - }], - providerOptions: message.providerOptions - }; - const converted = { - role: "assistant", - content: message.content.filter((part) => part.type !== "text" || part.text !== "" || part.providerOptions != null).filter((part) => part.type !== "tool-approval-request").map((part) => { - const providerOptions = part.providerOptions; - switch (part.type) { - case "custom": return { - type: "custom", - kind: part.kind, - providerOptions - }; - case "file": { - const { data, mediaType } = convertToLanguageModelV4FilePart(part.data); - return { - type: "file", - data, - filename: part.filename, - mediaType: mediaType != null ? mediaType : part.mediaType, - providerOptions - }; - } - case "reasoning": return { - type: "reasoning", - text: part.text, - providerOptions - }; - case "reasoning-file": { - const { data, mediaType } = convertToLanguageModelV4FilePart(part.data); - if (data.type !== "data" && data.type !== "url") throw new Error(`Unsupported reasoning-file data type: ${data.type}`); - return { - type: "reasoning-file", - data, - mediaType: mediaType != null ? mediaType : part.mediaType, - providerOptions - }; - } - case "text": return { - type: "text", - text: part.text, - providerOptions - }; - case "tool-call": return { - type: "tool-call", - toolCallId: part.toolCallId, - toolName: part.toolName, - input: part.input, - providerExecuted: part.providerExecuted, - providerOptions - }; - case "tool-result": return { - type: "tool-result", - toolCallId: part.toolCallId, - toolName: part.toolName, - output: mapToolResultOutput({ - output: part.output, - provider, - warnings, - downloadedAssets - }), - providerOptions - }; - } - }), - providerOptions: message.providerOptions - }; - if (warnings.length > 0) logWarnings({ warnings }); - return converted; - } - case "tool": { - const converted = { - role: "tool", - content: message.content.filter((part) => part.type !== "tool-approval-response" || part.providerExecuted).map((part) => { - switch (part.type) { - case "tool-result": return { - type: "tool-result", - toolCallId: part.toolCallId, - toolName: part.toolName, - output: mapToolResultOutput({ - output: part.output, - provider, - warnings, - downloadedAssets - }), - providerOptions: part.providerOptions - }; - case "tool-approval-response": return { - type: "tool-approval-response", - approvalId: part.approvalId, - approved: part.approved, - reason: part.reason - }; - } - }), - providerOptions: message.providerOptions - }; - if (warnings.length > 0) logWarnings({ warnings }); - return converted; - } - default: throw new InvalidMessageRoleError({ role }); - } -} -function convertImagePartToFilePart(part) { - var _a22; - if (part.type !== "image") return part; - return { - type: "file", - data: part.image, - mediaType: (_a22 = part.mediaType) != null ? _a22 : "image", - providerOptions: part.providerOptions - }; -} -async function downloadAssets(messages, download2, supportedUrls) { - const downloadableFiles = []; - for (const message of messages) { - if (message.role === "user" && Array.isArray(message.content)) for (const part of message.content) { - const filePart = convertImagePartToFilePart(part); - if (filePart.type === "file") downloadableFiles.push(filePart); - } - if (message.role === "tool") for (const part of message.content) { - if (part.type !== "tool-result") continue; - if (part.output.type !== "content") continue; - for (const contentPart of part.output.value) if (contentPart.type === "file") downloadableFiles.push(contentPart); - } - if (message.role === "assistant" && Array.isArray(message.content)) for (const part of message.content) { - if (part.type !== "tool-result") continue; - if (part.output.type !== "content") continue; - for (const contentPart of part.output.value) if (contentPart.type === "file") downloadableFiles.push(contentPart); - } - } - const plannedDownloads = downloadableFiles.map((part) => { - const mediaType = part.mediaType; - const { data } = convertToLanguageModelV4FilePart(part.data); - return { - mediaType, - data - }; - }).filter((part) => part.data.type === "url").map((part) => ({ - url: part.data.url, - isUrlSupportedByModel: part.mediaType != null && isUrlSupported({ - url: part.data.url.toString(), - mediaType: part.mediaType, - supportedUrls - }) - })); - const downloadedFiles = await download2(plannedDownloads); - return Object.fromEntries(downloadedFiles.map((file, index) => file == null ? null : [plannedDownloads[index].url.toString(), { - data: file.data, - mediaType: file.mediaType - }]).filter((file) => file != null)); -} -function convertPartToLanguageModelPart(part, downloadedAssets) { - if (part.type === "text") return { - type: "text", - text: part.text, - providerOptions: part.providerOptions - }; - const { data: normalizedData, mediaType: dataUrlMediaType } = convertToLanguageModelV4FilePart(part.data); - let mediaType = dataUrlMediaType != null ? dataUrlMediaType : part.mediaType; - let data = normalizedData; - if (data.type === "url") { - const downloadedFile = downloadedAssets[data.url.toString()]; - if (downloadedFile) { - data = { - type: "data", - data: downloadedFile.data - }; - if (downloadedFile.mediaType != null && (mediaType == null || !isFullMediaType(mediaType))) mediaType = downloadedFile.mediaType; - } - } - if (data.type === "data" && (data.data instanceof Uint8Array || typeof data.data === "string")) { - const imageMediaType = detectMediaType({ - data: data.data, - topLevelType: "image" - }); - if (imageMediaType != null) mediaType = imageMediaType; - } - if (mediaType == null) throw new Error(`Media type is missing for file part`); - return { - type: "file", - mediaType, - filename: part.filename, - data, - providerOptions: part.providerOptions - }; -} -function mapToolResultOutput({ output, provider, warnings = [], downloadedAssets }) { - if (output.type !== "content") return output; - return { - type: "content", - value: output.value.map((item) => { - var _a22; - switch (item.type) { - case "file": { - const convertedPart = convertPartToLanguageModelPart(item, downloadedAssets); - if (convertedPart.type !== "file") throw new Error("Expected tool result file content to convert to file."); - return convertedPart; - } - case "file-data": - warnings.push({ - type: "deprecated", - setting: "\"tool-result\" content of type \"file-data\"", - message: `The "file-data" type for tool result content is deprecated. Use the "file" type with mediaType and { type: 'data', data } instead.` - }); - return { - type: "file", - data: { - type: "data", - data: item.data - }, - filename: item.filename, - mediaType: item.mediaType, - providerOptions: item.providerOptions - }; - case "file-url": { - const mediaType = (_a22 = item.mediaType) != null ? _a22 : getMediaTypeFromUrl(item.url); - let message = `The "file-url" type for tool result content is deprecated. Use the "file" type with mediaType and { type: 'url', url } instead.`; - if (!item.mediaType) { - const inferenceSuffix = mediaType === "application/octet-stream" ? `Unable to infer media type from URL. Defaulting to 'application/octet-stream'.` : `Inferred media type '${mediaType}' from URL.`; - message = `The "file-url" tool result content part with URL "${item.url}" is missing a "mediaType". ${inferenceSuffix} ${message}`; - } - warnings.push({ - type: "deprecated", - setting: "\"tool-result\" content of type \"file-url\"", - message - }); - return { - type: "file", - data: { - type: "url", - url: new URL(item.url) - }, - mediaType, - providerOptions: item.providerOptions - }; - } - case "file-id": - warnings.push({ - type: "deprecated", - setting: "\"tool-result\" content of type \"file-id\"", - message: `The "file-id" type for tool result content is deprecated. Use the "file" type with mediaType and { type: 'reference', reference } instead.` - }); - return { - type: "file", - data: { - type: "reference", - reference: convertFileIdToProviderReference({ - fileId: item.fileId, - provider - }) - }, - mediaType: "application", - providerOptions: item.providerOptions - }; - case "file-reference": - warnings.push({ - type: "deprecated", - setting: "\"tool-result\" content of type \"file-reference\"", - message: `The "file-reference" type for tool result content is deprecated. Use the "file" type with mediaType and { type: 'reference', reference } instead.` - }); - return { - type: "file", - data: { - type: "reference", - reference: item.providerReference - }, - mediaType: "application", - providerOptions: item.providerOptions - }; - case "image-data": - warnings.push({ - type: "deprecated", - setting: "\"tool-result\" content of type \"image-data\"", - message: `The "image-data" type for tool result content is deprecated. Use the "file" type with mediaType and { type: 'data', data } instead.` - }); - return { - type: "file", - data: { - type: "data", - data: item.data - }, - mediaType: item.mediaType, - providerOptions: item.providerOptions - }; - case "image-url": - warnings.push({ - type: "deprecated", - setting: "\"tool-result\" content of type \"image-url\"", - message: `The "image-url" type for tool result content is deprecated. Use the "file" type with mediaType 'image' (or a specific image/* subtype) and { type: 'url', url } instead.` - }); - return { - type: "file", - data: { - type: "url", - url: new URL(item.url) - }, - mediaType: "image", - providerOptions: item.providerOptions - }; - case "image-file-id": - warnings.push({ - type: "deprecated", - setting: "\"tool-result\" content of type \"image-file-id\"", - message: `The "image-file-id" type for tool result content is deprecated. Use the "file" type with mediaType and { type: 'reference', reference } instead.` - }); - return { - type: "file", - data: { - type: "reference", - reference: convertFileIdToProviderReference({ - fileId: item.fileId, - provider - }) - }, - mediaType: "image", - providerOptions: item.providerOptions - }; - case "image-file-reference": - warnings.push({ - type: "deprecated", - setting: "\"tool-result\" content of type \"image-file-reference\"", - message: `The "image-file-reference" type for tool result content is deprecated. Use the "file" type with mediaType and { type: 'reference', reference } instead.` - }); - return { - type: "file", - data: { - type: "reference", - reference: item.providerReference - }, - mediaType: "image", - providerOptions: item.providerOptions - }; - default: return item; - } - }) - }; -} -function convertFileIdToProviderReference({ fileId, provider }) { - if (typeof fileId === "object") return fileId; - if (provider == null) throw new Error("Cannot convert string fileId to provider reference without a provider ID. Use a Record fileId or switch to the file-reference type."); - return { [provider]: fileId }; -} -var URL_EXTENSION_TO_MEDIA_TYPE = { - jpg: "image/jpeg", - jpeg: "image/jpeg", - png: "image/png", - gif: "image/gif", - webp: "image/webp", - svg: "image/svg+xml", - avif: "image/avif", - heic: "image/heic", - bmp: "image/bmp", - tiff: "image/tiff", - tif: "image/tiff", - pdf: "application/pdf", - mp4: "video/mp4", - webm: "video/webm", - mp3: "audio/mpeg", - wav: "audio/wav", - ogg: "audio/ogg" -}; -function getMediaTypeFromUrl(url, fallbackMediaType = "application/octet-stream") { - var _a22; - try { - const fileExtension = (_a22 = new URL(url).pathname.split(".").pop()) == null ? void 0 : _a22.toLowerCase(); - if (fileExtension && Object.hasOwn(URL_EXTENSION_TO_MEDIA_TYPE, fileExtension)) return URL_EXTENSION_TO_MEDIA_TYPE[fileExtension]; - } catch (e) {} - return fallbackMediaType; -} -async function createToolModelOutput({ toolCallId, input, output, tool: tool2, errorMode }) { - if (errorMode === "text") return { - type: "error-text", - value: getErrorMessage(output) - }; - else if (errorMode === "json") return { - type: "error-json", - value: toJSONValue(output) - }; - if (tool2 == null ? void 0 : tool2.toModelOutput) return await tool2.toModelOutput({ - toolCallId, - input, - output - }); - return typeof output === "string" ? { - type: "text", - value: output - } : { - type: "json", - value: toJSONValue(output) - }; -} -function toJSONValue(value) { - return value === void 0 ? null : value; -} -function prepareLanguageModelCallOptions({ maxOutputTokens, temperature, topP, topK, presencePenalty, frequencyPenalty, seed, stopSequences, reasoning }) { - if (maxOutputTokens != null) { - if (!Number.isInteger(maxOutputTokens)) throw new InvalidArgumentError({ - parameter: "maxOutputTokens", - value: maxOutputTokens, - message: "maxOutputTokens must be an integer" - }); - if (maxOutputTokens < 1) throw new InvalidArgumentError({ - parameter: "maxOutputTokens", - value: maxOutputTokens, - message: "maxOutputTokens must be >= 1" - }); - } - if (temperature != null) { - if (typeof temperature !== "number") throw new InvalidArgumentError({ - parameter: "temperature", - value: temperature, - message: "temperature must be a number" - }); - } - if (topP != null) { - if (typeof topP !== "number") throw new InvalidArgumentError({ - parameter: "topP", - value: topP, - message: "topP must be a number" - }); - } - if (topK != null) { - if (typeof topK !== "number") throw new InvalidArgumentError({ - parameter: "topK", - value: topK, - message: "topK must be a number" - }); - } - if (presencePenalty != null) { - if (typeof presencePenalty !== "number") throw new InvalidArgumentError({ - parameter: "presencePenalty", - value: presencePenalty, - message: "presencePenalty must be a number" - }); - } - if (frequencyPenalty != null) { - if (typeof frequencyPenalty !== "number") throw new InvalidArgumentError({ - parameter: "frequencyPenalty", - value: frequencyPenalty, - message: "frequencyPenalty must be a number" - }); - } - if (seed != null) { - if (!Number.isInteger(seed)) throw new InvalidArgumentError({ - parameter: "seed", - value: seed, - message: "seed must be an integer" - }); - } - return { - maxOutputTokens, - temperature, - topP, - topK, - presencePenalty, - frequencyPenalty, - stopSequences, - seed, - reasoning - }; -} -function prepareToolChoice({ toolChoice }) { - return toolChoice == null ? { type: "auto" } : typeof toolChoice === "string" ? { type: toolChoice } : { - type: "tool", - toolName: toolChoice.toolName - }; -} -function isNonEmptyObject(object2) { - return object2 != null && Object.keys(object2).length > 0; -} -async function prepareTools({ tools, toolOrder, toolsContext = {}, experimental_sandbox: sandbox }) { - if (!isNonEmptyObject(tools)) return; - const languageModelTools = []; - for (const [name22, tool2] of orderToolEntries({ - tools, - toolOrder - })) { - const toolType = tool2.type; - switch (toolType) { - case void 0: - case "dynamic": - case "function": { - const description = resolveToolDescription({ - tool: tool2, - toolName: name22, - toolsContext, - experimental_sandbox: sandbox - }); - const providerOptions = tool2.providerOptions; - const inputExamples = tool2.inputExamples; - const strict = tool2.strict; - languageModelTools.push({ - type: "function", - name: name22, - inputSchema: await asSchema(tool2.inputSchema).jsonSchema, - ...description != null ? { description } : {}, - ...inputExamples != null ? { inputExamples } : {}, - ...providerOptions != null ? { providerOptions } : {}, - ...strict != null ? { strict } : {} - }); - break; - } - case "provider": - languageModelTools.push({ - type: "provider", - name: name22, - id: tool2.id, - args: tool2.args - }); - break; - default: throw new Error(`Unsupported tool type: ${toolType}`); - } - } - return languageModelTools; -} -function orderToolEntries({ tools, toolOrder }) { - if (toolOrder == null) return Object.entries(tools); - const toolEntries = Object.entries(tools); - const orderedTools = toolEntries.filter(([name22]) => toolOrder.includes(name22)).sort(([nameA], [nameB]) => toolOrder.indexOf(nameA) - toolOrder.indexOf(nameB)); - const unorderedTools = toolEntries.filter(([name22]) => !toolOrder.includes(name22)).sort(([nameA], [nameB]) => nameA < nameB ? -1 : nameA > nameB ? 1 : 0); - return [...orderedTools, ...unorderedTools]; -} -function resolveToolDescription({ tool: tool2, toolName, toolsContext, experimental_sandbox: sandbox }) { - return tool2.description === void 0 ? void 0 : typeof tool2.description === "string" ? tool2.description : tool2.description({ - context: toolsContext[toolName], - experimental_sandbox: sandbox - }); -} -function getTotalTimeoutMs(timeout) { - if (timeout == null) return; - if (typeof timeout === "number") return timeout; - return timeout.totalMs; -} -function getStepTimeoutMs(timeout) { - if (timeout == null || typeof timeout === "number") return; - return timeout.stepMs; -} -function getChunkTimeoutMs(timeout) { - if (timeout == null || typeof timeout === "number") return; - return timeout.chunkMs; -} -function getToolTimeoutMs(timeout, toolName) { - var _a22, _b; - if (timeout == null || typeof timeout === "number") return; - return (_b = (_a22 = timeout.tools) == null ? void 0 : _a22[`${toolName}Ms`]) != null ? _b : timeout.toolMs; -} -var jsonValueSchema = lazy(() => union([ - _null(), - string(), - number(), - boolean(), - record(string(), jsonValueSchema.optional()), - array$1(jsonValueSchema) -])); -var providerMetadataSchema = record(string(), record(string(), jsonValueSchema.optional())); -var fileInlineDataSchema = union([ - string(), - _instanceof(Uint8Array), - _instanceof(ArrayBuffer), - custom(isBuffer, { message: "Must be a Buffer" }) -]); -var providerReferenceSchema = record(string(), string()); -var textPartSchema = object$1({ - type: literal("text"), - text: string(), - providerOptions: providerMetadataSchema.optional() -}); -var imagePartSchema = object$1({ - type: literal("image"), - image: union([ - fileInlineDataSchema, - _instanceof(URL), - providerReferenceSchema - ]), - mediaType: string().optional(), - providerOptions: providerMetadataSchema.optional() -}); -var taggedFileDataSchema = discriminatedUnion("type", [ - object$1({ - type: literal("data"), - data: fileInlineDataSchema - }), - object$1({ - type: literal("url"), - url: _instanceof(URL) - }), - object$1({ - type: literal("reference"), - reference: providerReferenceSchema - }), - object$1({ - type: literal("text"), - text: string() - }) -]); -var taggedReasoningFileDataSchema = discriminatedUnion("type", [object$1({ - type: literal("data"), - data: fileInlineDataSchema -}), object$1({ - type: literal("url"), - url: _instanceof(URL) -})]); -var filePartSchema = object$1({ - type: literal("file"), - data: union([ - taggedFileDataSchema, - fileInlineDataSchema, - _instanceof(URL), - providerReferenceSchema - ]), - filename: string().optional(), - mediaType: string(), - providerOptions: providerMetadataSchema.optional() -}); -var reasoningPartSchema = object$1({ - type: literal("reasoning"), - text: string(), - providerOptions: providerMetadataSchema.optional() -}); -var customPartSchema = object$1({ - type: literal("custom"), - kind: string().transform((value) => value), - providerOptions: providerMetadataSchema.optional() -}); -var reasoningFilePartSchema = object$1({ - type: literal("reasoning-file"), - data: union([ - taggedReasoningFileDataSchema, - fileInlineDataSchema, - _instanceof(URL) - ]), - mediaType: string(), - providerOptions: providerMetadataSchema.optional() -}); -var toolCallPartSchema = object$1({ - type: literal("tool-call"), - toolCallId: string(), - toolName: string(), - input: unknown(), - providerOptions: providerMetadataSchema.optional(), - providerExecuted: boolean().optional() -}); -var outputSchema = discriminatedUnion("type", [ - object$1({ - type: literal("text"), - value: string(), - providerOptions: providerMetadataSchema.optional() - }), - object$1({ - type: literal("json"), - value: jsonValueSchema, - providerOptions: providerMetadataSchema.optional() - }), - object$1({ - type: literal("execution-denied"), - reason: string().optional(), - providerOptions: providerMetadataSchema.optional() - }), - object$1({ - type: literal("error-text"), - value: string(), - providerOptions: providerMetadataSchema.optional() - }), - object$1({ - type: literal("error-json"), - value: jsonValueSchema, - providerOptions: providerMetadataSchema.optional() - }), - object$1({ - type: literal("content"), - value: array$1(union([ - object$1({ - type: literal("text"), - text: string(), - providerOptions: providerMetadataSchema.optional() - }), - object$1({ - type: literal("file"), - data: taggedFileDataSchema, - mediaType: string(), - filename: string().optional(), - providerOptions: providerMetadataSchema.optional() - }), - object$1({ - type: literal("file-data"), - data: string(), - mediaType: string(), - filename: string().optional(), - providerOptions: providerMetadataSchema.optional() - }), - object$1({ - type: literal("file-url"), - url: string(), - mediaType: string().optional(), - providerOptions: providerMetadataSchema.optional() - }), - object$1({ - type: literal("file-id"), - fileId: union([string(), record(string(), string())]), - providerOptions: providerMetadataSchema.optional() - }), - object$1({ - type: literal("file-reference"), - providerReference: record(string(), string()), - providerOptions: providerMetadataSchema.optional() - }), - object$1({ - type: literal("image-data"), - data: string(), - mediaType: string(), - providerOptions: providerMetadataSchema.optional() - }), - object$1({ - type: literal("image-url"), - url: string(), - providerOptions: providerMetadataSchema.optional() - }), - object$1({ - type: literal("image-file-id"), - fileId: union([string(), record(string(), string())]), - providerOptions: providerMetadataSchema.optional() - }), - object$1({ - type: literal("image-file-reference"), - providerReference: record(string(), string()), - providerOptions: providerMetadataSchema.optional() - }), - object$1({ - type: literal("custom"), - providerOptions: providerMetadataSchema.optional() - }) - ])) - }) -]); -var toolResultPartSchema = object$1({ - type: literal("tool-result"), - toolCallId: string(), - toolName: string(), - output: outputSchema, - providerOptions: providerMetadataSchema.optional() -}); -var toolApprovalRequestSchema = object$1({ - type: literal("tool-approval-request"), - approvalId: string(), - toolCallId: string() -}); -var toolApprovalResponseSchema = object$1({ - type: literal("tool-approval-response"), - approvalId: string(), - approved: boolean(), - reason: string().optional() -}); -var systemModelMessageSchema = object$1({ - role: literal("system"), - content: string(), - providerOptions: providerMetadataSchema.optional() -}); -var userModelMessageSchema = object$1({ - role: literal("user"), - content: union([string(), array$1(union([ - textPartSchema, - imagePartSchema, - filePartSchema - ]))]), - providerOptions: providerMetadataSchema.optional() -}); -var assistantModelMessageSchema = object$1({ - role: literal("assistant"), - content: union([string(), array$1(union([ - textPartSchema, - customPartSchema, - filePartSchema, - reasoningPartSchema, - reasoningFilePartSchema, - toolCallPartSchema, - toolResultPartSchema, - toolApprovalRequestSchema - ]))]), - providerOptions: providerMetadataSchema.optional() -}); -var toolModelMessageSchema = object$1({ - role: literal("tool"), - content: array$1(union([toolResultPartSchema, toolApprovalResponseSchema])), - providerOptions: providerMetadataSchema.optional() -}); -var modelMessageSchema = union([ - systemModelMessageSchema, - userModelMessageSchema, - assistantModelMessageSchema, - toolModelMessageSchema -]); -async function standardizePrompt({ allowSystemInMessages = false, system, instructions = system, prompt, messages }) { - if (prompt == null && messages == null) throw new InvalidPromptError({ - prompt, - message: "prompt or messages must be defined" - }); - if (prompt != null && messages != null) throw new InvalidPromptError({ - prompt, - message: "prompt and messages cannot be defined at the same time" - }); - if (typeof instructions !== "string" && !asArray(instructions).every((message) => message.role === "system")) throw new InvalidPromptError({ - prompt, - message: "instructions must be a string, SystemModelMessage, or array of SystemModelMessage" - }); - if (prompt != null && typeof prompt === "string") messages = [{ - role: "user", - content: prompt - }]; - else if (prompt != null && Array.isArray(prompt)) messages = prompt; - else if (messages == null) throw new InvalidPromptError({ - prompt, - message: "prompt or messages must be defined" - }); - if (messages.length === 0) throw new InvalidPromptError({ - prompt, - message: "messages must not be empty" - }); - if (!allowSystemInMessages && messages.some((message) => message.role === "system")) throw new InvalidPromptError({ - prompt, - message: "System messages are not allowed in the prompt or messages fields. Use the instructions option instead." - }); - const validationResult = await safeValidateTypes({ - value: messages, - schema: array$1(modelMessageSchema) - }); - if (!validationResult.success) throw new InvalidPromptError({ - prompt, - message: "The messages do not match the ModelMessage[] schema.", - cause: validationResult.error - }); - return { - messages, - instructions - }; -} -function wrapGatewayError(error) { - if (!GatewayAuthenticationError.isInstance(error)) return error; - const isProductionEnv = (process == null ? void 0 : process.env.NODE_ENV) === "production"; - const moreInfoURL = "https://ai-sdk.dev/unauthenticated-ai-gateway"; - if (isProductionEnv) return new AISDKError({ - name: "GatewayError", - message: `Unauthenticated. Configure AI_GATEWAY_API_KEY or use a provider module. Learn more: ${moreInfoURL}` - }); - return Object.assign(/* @__PURE__ */ new Error(`\x1B[1m\x1B[31mUnauthenticated request to AI Gateway.\x1B[0m - -To authenticate, set the \x1B[33mAI_GATEWAY_API_KEY\x1B[0m environment variable with your API key. - -Alternatively, you can use a provider module instead of the AI Gateway. - -Learn more: \x1B[34m${moreInfoURL}\x1B[0m - -`), { name: "GatewayAuthenticationError" }); -} -function asLanguageModelUsage(usage) { - return { - inputTokens: usage.inputTokens.total, - inputTokenDetails: { - noCacheTokens: usage.inputTokens.noCache, - cacheReadTokens: usage.inputTokens.cacheRead, - cacheWriteTokens: usage.inputTokens.cacheWrite - }, - outputTokens: usage.outputTokens.total, - outputTokenDetails: { - textTokens: usage.outputTokens.text, - reasoningTokens: usage.outputTokens.reasoning - }, - totalTokens: addTokenCounts(usage.inputTokens.total, usage.outputTokens.total), - raw: usage.raw - }; -} -function createNullLanguageModelUsage() { - return { - inputTokens: void 0, - inputTokenDetails: { - noCacheTokens: void 0, - cacheReadTokens: void 0, - cacheWriteTokens: void 0 - }, - outputTokens: void 0, - outputTokenDetails: { - textTokens: void 0, - reasoningTokens: void 0 - }, - totalTokens: void 0, - raw: void 0 - }; -} -function addLanguageModelUsage(usage1, usage2) { - var _a22, _b, _c, _d, _e, _f, _g, _h, _i, _j; - return { - inputTokens: addTokenCounts(usage1.inputTokens, usage2.inputTokens), - inputTokenDetails: { - noCacheTokens: addTokenCounts((_a22 = usage1.inputTokenDetails) == null ? void 0 : _a22.noCacheTokens, (_b = usage2.inputTokenDetails) == null ? void 0 : _b.noCacheTokens), - cacheReadTokens: addTokenCounts((_c = usage1.inputTokenDetails) == null ? void 0 : _c.cacheReadTokens, (_d = usage2.inputTokenDetails) == null ? void 0 : _d.cacheReadTokens), - cacheWriteTokens: addTokenCounts((_e = usage1.inputTokenDetails) == null ? void 0 : _e.cacheWriteTokens, (_f = usage2.inputTokenDetails) == null ? void 0 : _f.cacheWriteTokens) - }, - outputTokens: addTokenCounts(usage1.outputTokens, usage2.outputTokens), - outputTokenDetails: { - textTokens: addTokenCounts((_g = usage1.outputTokenDetails) == null ? void 0 : _g.textTokens, (_h = usage2.outputTokenDetails) == null ? void 0 : _h.textTokens), - reasoningTokens: addTokenCounts((_i = usage1.outputTokenDetails) == null ? void 0 : _i.reasoningTokens, (_j = usage2.outputTokenDetails) == null ? void 0 : _j.reasoningTokens) - }, - totalTokens: addTokenCounts(usage1.totalTokens, usage2.totalTokens) - }; -} -function addTokenCounts(tokenCount1, tokenCount2) { - return tokenCount1 == null && tokenCount2 == null ? void 0 : (tokenCount1 != null ? tokenCount1 : 0) + (tokenCount2 != null ? tokenCount2 : 0); -} -function getOwn(obj, key) { - return obj != null && Object.hasOwn(obj, key) ? obj[key] : void 0; -} -function mergeAbortSignals(...signals) { - const validSignals = filterNullable(...signals).map((signal) => signal instanceof AbortSignal ? signal : AbortSignal.timeout(signal)); - return validSignals.length === 0 ? void 0 : validSignals.length === 1 ? validSignals[0] : AbortSignal.any(validSignals); -} -function mergeObjects(base, overrides) { - if (base === void 0 && overrides === void 0) return; - if (base === void 0) return overrides; - if (overrides === void 0) return base; - const result = { ...base }; - for (const key in overrides) { - if (key === "__proto__" || key === "constructor" || key === "prototype") continue; - if (Object.prototype.hasOwnProperty.call(overrides, key)) { - const overridesValue = overrides[key]; - if (overridesValue === void 0) continue; - const baseValue = key in base ? base[key] : void 0; - const isSourceObject = overridesValue !== null && typeof overridesValue === "object" && !Array.isArray(overridesValue) && !(overridesValue instanceof Date) && !(overridesValue instanceof RegExp); - const isTargetObject = baseValue !== null && baseValue !== void 0 && typeof baseValue === "object" && !Array.isArray(baseValue) && !(baseValue instanceof Date) && !(baseValue instanceof RegExp); - if (isSourceObject && isTargetObject) result[key] = mergeObjects(baseValue, overridesValue); - else result[key] = overridesValue; - } - } - return result; -} -function now() { - var _a22, _b; - return (_b = (_a22 = globalThis == null ? void 0 : globalThis.performance) == null ? void 0 : _a22.now()) != null ? _b : Date.now(); -} -async function notify(options) { - await Promise.all(asArray(options.callbacks).map(async (callback) => { - try { - await (callback == null ? void 0 : callback(options.event)); - } catch (e) {} - })); -} -function getRetryDelayInMs({ error, exponentialBackoffDelay }) { - const headers = APICallError.isInstance(error) ? error.responseHeaders : APICallError.isInstance(error.cause) ? error.cause.responseHeaders : void 0; - if (!headers) return exponentialBackoffDelay; - let ms; - const retryAfterMs = headers["retry-after-ms"]; - if (retryAfterMs) { - const timeoutMs = parseFloat(retryAfterMs); - if (!Number.isNaN(timeoutMs)) ms = timeoutMs; - } - const retryAfter = headers["retry-after"]; - if (retryAfter && ms === void 0) { - const timeoutSeconds = parseFloat(retryAfter); - if (!Number.isNaN(timeoutSeconds)) ms = timeoutSeconds * 1e3; - else ms = Date.parse(retryAfter) - Date.now(); - } - if (ms != null && !Number.isNaN(ms) && 0 <= ms && (ms < 60 * 1e3 || ms < exponentialBackoffDelay)) return ms; - return exponentialBackoffDelay; -} -var retryWithExponentialBackoffRespectingRetryHeaders = ({ maxRetries = 2, initialDelayInMs = 2e3, backoffFactor = 2, abortSignal } = {}) => retryWithExponentialBackoff({ - maxRetries, - initialDelayInMs, - backoffFactor, - abortSignal, - shouldRetry: (error) => error instanceof Error && (APICallError.isInstance(error) && error.isRetryable === true || GatewayError.isInstance(error) && error.isRetryable === true), - getDelayInMs: ({ error, exponentialBackoffDelay }) => getRetryDelayInMs({ - error, - exponentialBackoffDelay - }), - createRetryError: ({ message, reason, errors }) => new RetryError({ - message, - reason, - errors - }) -}); -function prepareRetries({ maxRetries, abortSignal }) { - if (maxRetries != null) { - if (!Number.isInteger(maxRetries)) throw new InvalidArgumentError({ - parameter: "maxRetries", - value: maxRetries, - message: "maxRetries must be an integer" - }); - if (maxRetries < 0) throw new InvalidArgumentError({ - parameter: "maxRetries", - value: maxRetries, - message: "maxRetries must be >= 0" - }); - } - const maxRetriesResult = maxRetries != null ? maxRetries : 2; - return { - maxRetries: maxRetriesResult, - retry: retryWithExponentialBackoffRespectingRetryHeaders({ - maxRetries: maxRetriesResult, - abortSignal - }) - }; -} -function setAbortTimeout({ abortController, label, timeoutMs }) { - if (abortController == null || timeoutMs == null) return; - return setTimeout(() => abortController.abort(new DOMException(`${label} timeout of ${timeoutMs}ms exceeded`, "TimeoutError")), timeoutMs); -} -function calculateTokensPerSecond({ tokens, durationMs }) { - const tokenRate = 1e3 * (tokens != null ? tokens : 0) / (durationMs != null ? durationMs : 0); - return Number.isFinite(tokenRate) ? tokenRate : 0; -} -function collectToolApprovals({ messages }) { - const lastMessage = messages.at(-1); - if ((lastMessage == null ? void 0 : lastMessage.role) != "tool") return { - approvedToolApprovals: [], - deniedToolApprovals: [] - }; - const toolCallsByToolCallId = /* @__PURE__ */ Object.create(null); - for (const message of messages) if (message.role === "assistant" && typeof message.content !== "string") { - const content = message.content; - for (const part of content) if (part.type === "tool-call") toolCallsByToolCallId[part.toolCallId] = part; - } - const toolApprovalRequestsByApprovalId = /* @__PURE__ */ Object.create(null); - for (const message of messages) if (message.role === "assistant" && typeof message.content !== "string") { - const content = message.content; - for (const part of content) if (part.type === "tool-approval-request") toolApprovalRequestsByApprovalId[part.approvalId] = part; - } - const toolResults = /* @__PURE__ */ Object.create(null); - for (const part of lastMessage.content) if (part.type === "tool-result") toolResults[part.toolCallId] = part; - const approvedToolApprovals = []; - const deniedToolApprovals = []; - const approvalResponses = lastMessage.content.filter((part) => part.type === "tool-approval-response"); - for (const approvalResponse of approvalResponses) { - const approvalRequest = toolApprovalRequestsByApprovalId[approvalResponse.approvalId]; - if (approvalRequest == null) throw new InvalidToolApprovalError({ approvalId: approvalResponse.approvalId }); - if (toolResults[approvalRequest.toolCallId] != null) continue; - const toolCall = toolCallsByToolCallId[approvalRequest.toolCallId]; - if (toolCall == null) throw new ToolCallNotFoundForApprovalError({ - toolCallId: approvalRequest.toolCallId, - approvalId: approvalRequest.approvalId - }); - const approval = { - approvalRequest, - approvalResponse, - toolCall - }; - if (approvalResponse.approved) approvedToolApprovals.push(approval); - else deniedToolApprovals.push(approval); - } - return { - approvedToolApprovals, - deniedToolApprovals - }; -} -async function validateToolContext({ toolName, context, contextSchema }) { - if (contextSchema == null) return context; - return await validateTypes({ - value: context, - schema: contextSchema, - context: { - field: "tool context", - entityName: toolName - } - }); -} -async function executeToolCall({ toolCall, tools, toolsContext, callId, messages, abortSignal, timeout, experimental_sandbox: sandbox, onPreliminaryToolResult, onToolExecutionStart, onToolExecutionEnd, executeToolInTelemetryContext = async ({ execute }) => await execute(), runInTracingChannelSpan = async ({ execute }) => await execute() }) { - const { toolName, toolCallId, input } = toolCall; - const tool2 = getOwn(tools, toolName); - if (!isExecutableTool(tool2)) return; - const context = await validateToolContext({ - toolName, - context: getOwn(toolsContext, toolName), - contextSchema: tool2.contextSchema - }); - const toolExecutionContext = { - toolCall, - messages, - toolContext: context - }; - const baseCallbackEvent = { - callId, - ...toolExecutionContext - }; - return await runInTracingChannelSpan({ - type: "executeTool", - event: baseCallbackEvent, - execute: async () => { - let output; - await notify({ - event: baseCallbackEvent, - callbacks: onToolExecutionStart - }); - const toolAbortSignal = mergeAbortSignals(abortSignal, getToolTimeoutMs(timeout, toolName)); - let toolExecutionMs = 0; - try { - await executeToolInTelemetryContext({ - callId, - toolCallId, - ...toolExecutionContext, - execute: async () => { - const startTime = now(); - try { - const stream = executeTool({ - tool: tool2, - input, - options: { - toolCallId, - messages, - abortSignal: toolAbortSignal, - context, - experimental_sandbox: sandbox - } - }); - for await (const part of stream) if (part.type === "preliminary") onPreliminaryToolResult?.({ - ...toolCall, - type: "tool-result", - output: part.output, - preliminary: true - }); - else output = part.output; - } finally { - toolExecutionMs = now() - startTime; - } - } - }); - } catch (error) { - const toolError = { - type: "tool-error", - toolCallId, - toolName, - input, - error, - dynamic: tool2.type === "dynamic", - ...toolCall.providerMetadata != null ? { providerMetadata: toolCall.providerMetadata } : {}, - ...toolCall.toolMetadata != null ? { toolMetadata: toolCall.toolMetadata } : {} - }; - await notify({ - event: { - ...baseCallbackEvent, - toolOutput: toolError, - toolExecutionMs - }, - callbacks: onToolExecutionEnd - }); - return { - output: toolError, - toolExecutionMs - }; - } - const toolResult = { - type: "tool-result", - toolCallId, - toolName, - input, - output, - dynamic: tool2.type === "dynamic", - ...toolCall.providerMetadata != null ? { providerMetadata: toolCall.providerMetadata } : {}, - ...toolCall.toolMetadata != null ? { toolMetadata: toolCall.toolMetadata } : {} - }; - await notify({ - event: { - ...baseCallbackEvent, - toolOutput: toolResult, - toolExecutionMs - }, - callbacks: onToolExecutionEnd - }); - return { - output: toolResult, - toolExecutionMs - }; - } - }); -} -function filterActiveTools({ tools, activeTools }) { - if (tools == null || activeTools == null) return tools; - return Object.fromEntries(Object.entries(tools).filter(([name22]) => activeTools.includes(name22))); -} -var DefaultGeneratedFile = class { - constructor({ data, mediaType }) { - const isUint8Array = data instanceof Uint8Array; - this.base64Data = isUint8Array ? void 0 : data; - this.uint8ArrayData = isUint8Array ? data : void 0; - this.mediaType = mediaType; - } - get base64() { - if (this.base64Data == null) this.base64Data = convertUint8ArrayToBase64(this.uint8ArrayData); - return this.base64Data; - } - get uint8Array() { - if (this.uint8ArrayData == null) this.uint8ArrayData = convertBase64ToUint8Array(this.base64Data); - return this.uint8ArrayData; - } -}; -var DefaultGeneratedFileWithType = class extends DefaultGeneratedFile { - constructor(options) { - super(options); - this.type = "file"; - } -}; -var output_exports = {}; -__export(output_exports, { - array: () => array, - choice: () => choice, - json: () => json, - object: () => object, - text: () => text -}); -function fixJson(input) { - const stack = ["ROOT"]; - let lastValidIndex = -1; - let literalStart = null; - let unicodeEscapeDigits = 0; - function isHexDigit(char) { - return char >= "0" && char <= "9" || char >= "A" && char <= "F" || char >= "a" && char <= "f"; - } - function processValueStart(char, i, swapState) { - switch (char) { - case "\"": - lastValidIndex = i; - stack.pop(); - stack.push(swapState); - stack.push("INSIDE_STRING"); - break; - case "f": - case "t": - case "n": - lastValidIndex = i; - literalStart = i; - stack.pop(); - stack.push(swapState); - stack.push("INSIDE_LITERAL"); - break; - case "-": - stack.pop(); - stack.push(swapState); - stack.push("INSIDE_NUMBER"); - break; - case "0": - case "1": - case "2": - case "3": - case "4": - case "5": - case "6": - case "7": - case "8": - case "9": - lastValidIndex = i; - stack.pop(); - stack.push(swapState); - stack.push("INSIDE_NUMBER"); - break; - case "{": - lastValidIndex = i; - stack.pop(); - stack.push(swapState); - stack.push("INSIDE_OBJECT_START"); - break; - case "[": - lastValidIndex = i; - stack.pop(); - stack.push(swapState); - stack.push("INSIDE_ARRAY_START"); - break; - } - } - function processAfterObjectValue(char, i) { - switch (char) { - case ",": - stack.pop(); - stack.push("INSIDE_OBJECT_AFTER_COMMA"); - break; - case "}": - lastValidIndex = i; - stack.pop(); - break; - } - } - function processAfterArrayValue(char, i) { - switch (char) { - case ",": - stack.pop(); - stack.push("INSIDE_ARRAY_AFTER_COMMA"); - break; - case "]": - lastValidIndex = i; - stack.pop(); - break; - } - } - for (let i = 0; i < input.length; i++) { - const char = input[i]; - switch (stack[stack.length - 1]) { - case "ROOT": - processValueStart(char, i, "FINISH"); - break; - case "INSIDE_OBJECT_START": - switch (char) { - case "\"": - stack.pop(); - stack.push("INSIDE_OBJECT_KEY"); - break; - case "}": - lastValidIndex = i; - stack.pop(); - break; - } - break; - case "INSIDE_OBJECT_AFTER_COMMA": - switch (char) { - case "\"": - stack.pop(); - stack.push("INSIDE_OBJECT_KEY"); - break; - } - break; - case "INSIDE_OBJECT_KEY": - switch (char) { - case "\"": - stack.pop(); - stack.push("INSIDE_OBJECT_AFTER_KEY"); - break; - } - break; - case "INSIDE_OBJECT_AFTER_KEY": - switch (char) { - case ":": - stack.pop(); - stack.push("INSIDE_OBJECT_BEFORE_VALUE"); - break; - } - break; - case "INSIDE_OBJECT_BEFORE_VALUE": - processValueStart(char, i, "INSIDE_OBJECT_AFTER_VALUE"); - break; - case "INSIDE_OBJECT_AFTER_VALUE": - processAfterObjectValue(char, i); - break; - case "INSIDE_STRING": - switch (char) { - case "\"": - stack.pop(); - lastValidIndex = i; - break; - case "\\": - stack.push("INSIDE_STRING_ESCAPE"); - break; - default: lastValidIndex = i; - } - break; - case "INSIDE_ARRAY_START": - switch (char) { - case "]": - lastValidIndex = i; - stack.pop(); - break; - default: - lastValidIndex = i; - processValueStart(char, i, "INSIDE_ARRAY_AFTER_VALUE"); - break; - } - break; - case "INSIDE_ARRAY_AFTER_VALUE": - switch (char) { - case ",": - stack.pop(); - stack.push("INSIDE_ARRAY_AFTER_COMMA"); - break; - case "]": - lastValidIndex = i; - stack.pop(); - break; - default: - lastValidIndex = i; - break; - } - break; - case "INSIDE_ARRAY_AFTER_COMMA": - processValueStart(char, i, "INSIDE_ARRAY_AFTER_VALUE"); - break; - case "INSIDE_STRING_ESCAPE": - stack.pop(); - if (char === "u") { - unicodeEscapeDigits = 0; - stack.push("INSIDE_STRING_UNICODE_ESCAPE"); - } else lastValidIndex = i; - break; - case "INSIDE_STRING_UNICODE_ESCAPE": - if (isHexDigit(char)) { - unicodeEscapeDigits++; - if (unicodeEscapeDigits === 4) { - stack.pop(); - lastValidIndex = i; - } - } - break; - case "INSIDE_NUMBER": - switch (char) { - case "0": - case "1": - case "2": - case "3": - case "4": - case "5": - case "6": - case "7": - case "8": - case "9": - lastValidIndex = i; - break; - case "e": - case "E": - case "-": - case ".": break; - case ",": - stack.pop(); - if (stack[stack.length - 1] === "INSIDE_ARRAY_AFTER_VALUE") processAfterArrayValue(char, i); - if (stack[stack.length - 1] === "INSIDE_OBJECT_AFTER_VALUE") processAfterObjectValue(char, i); - break; - case "}": - stack.pop(); - if (stack[stack.length - 1] === "INSIDE_OBJECT_AFTER_VALUE") processAfterObjectValue(char, i); - break; - case "]": - stack.pop(); - if (stack[stack.length - 1] === "INSIDE_ARRAY_AFTER_VALUE") processAfterArrayValue(char, i); - break; - default: - stack.pop(); - break; - } - break; - case "INSIDE_LITERAL": { - const partialLiteral = input.substring(literalStart, i + 1); - if (!"false".startsWith(partialLiteral) && !"true".startsWith(partialLiteral) && !"null".startsWith(partialLiteral)) { - stack.pop(); - if (stack[stack.length - 1] === "INSIDE_OBJECT_AFTER_VALUE") processAfterObjectValue(char, i); - else if (stack[stack.length - 1] === "INSIDE_ARRAY_AFTER_VALUE") processAfterArrayValue(char, i); - } else lastValidIndex = i; - break; - } - } - } - let result = input.slice(0, lastValidIndex + 1); - for (let i = stack.length - 1; i >= 0; i--) switch (stack[i]) { - case "INSIDE_STRING": - result += "\""; - break; - case "INSIDE_OBJECT_KEY": - case "INSIDE_OBJECT_AFTER_KEY": - case "INSIDE_OBJECT_AFTER_COMMA": - case "INSIDE_OBJECT_START": - case "INSIDE_OBJECT_BEFORE_VALUE": - case "INSIDE_OBJECT_AFTER_VALUE": - result += "}"; - break; - case "INSIDE_ARRAY_START": - case "INSIDE_ARRAY_AFTER_COMMA": - case "INSIDE_ARRAY_AFTER_VALUE": - result += "]"; - break; - case "INSIDE_LITERAL": { - const partialLiteral = input.substring(literalStart, input.length); - if ("true".startsWith(partialLiteral)) result += "true".slice(partialLiteral.length); - else if ("false".startsWith(partialLiteral)) result += "false".slice(partialLiteral.length); - else if ("null".startsWith(partialLiteral)) result += "null".slice(partialLiteral.length); - } - } - return result; -} -async function parsePartialJson(jsonText) { - if (jsonText === void 0) return { - value: void 0, - state: "undefined-input" - }; - let result = await safeParseJSON({ text: jsonText }); - if (result.success) return { - value: result.value, - state: "successful-parse" - }; - result = await safeParseJSON({ text: fixJson(jsonText) }); - if (result.success) return { - value: result.value, - state: "repaired-parse" - }; - return { - value: void 0, - state: "failed-parse" - }; -} -var text = () => ({ - name: "text", - responseFormat: Promise.resolve({ type: "text" }), - async parseCompleteOutput({ text: text2 }) { - return text2; - }, - async parsePartialOutput({ text: text2 }) { - return { partial: text2 }; - }, - createElementStreamTransform() {} -}); -var object = ({ schema: inputSchema, name: name22, description }) => { - const schema = asSchema(inputSchema); - return { - name: "object", - responseFormat: resolve(schema.jsonSchema).then((jsonSchema2) => ({ - type: "json", - schema: jsonSchema2, - ...name22 != null && { name: name22 }, - ...description != null && { description } - })), - async parseCompleteOutput({ text: text2 }, context) { - const parseResult = await safeParseJSON({ text: text2 }); - if (!parseResult.success) throw new NoObjectGeneratedError({ - message: "No object generated: could not parse the response.", - cause: parseResult.error, - text: text2, - response: context.response, - usage: context.usage, - finishReason: context.finishReason - }); - const validationResult = await safeValidateTypes({ - value: parseResult.value, - schema - }); - if (!validationResult.success) throw new NoObjectGeneratedError({ - message: "No object generated: response did not match schema.", - cause: validationResult.error, - text: text2, - response: context.response, - usage: context.usage, - finishReason: context.finishReason - }); - return validationResult.value; - }, - async parsePartialOutput({ text: text2 }) { - const result = await parsePartialJson(text2); - switch (result.state) { - case "failed-parse": - case "undefined-input": return; - case "repaired-parse": - case "successful-parse": return { partial: result.value }; - } - }, - createElementStreamTransform() {} - }; -}; -var array = ({ element: inputElementSchema, name: name22, description }) => { - const elementSchema = asSchema(inputElementSchema); - return { - name: "array", - responseFormat: resolve(elementSchema.jsonSchema).then((jsonSchema2) => { - const { $schema: _$schema, ...itemSchema } = jsonSchema2; - return { - type: "json", - schema: { - $schema: "http://json-schema.org/draft-07/schema#", - type: "object", - properties: { elements: { - type: "array", - items: itemSchema - } }, - required: ["elements"], - additionalProperties: false - }, - ...name22 != null && { name: name22 }, - ...description != null && { description } - }; - }), - async parseCompleteOutput({ text: text2 }, context) { - const parseResult = await safeParseJSON({ text: text2 }); - if (!parseResult.success) throw new NoObjectGeneratedError({ - message: "No object generated: could not parse the response.", - cause: parseResult.error, - text: text2, - response: context.response, - usage: context.usage, - finishReason: context.finishReason - }); - const outerValue = parseResult.value; - if (outerValue == null || typeof outerValue !== "object" || !("elements" in outerValue) || !Array.isArray(outerValue.elements)) throw new NoObjectGeneratedError({ - message: "No object generated: response did not match schema.", - cause: new TypeValidationError({ - value: outerValue, - cause: "response must be an object with an elements array" - }), - text: text2, - response: context.response, - usage: context.usage, - finishReason: context.finishReason - }); - const validatedElements = []; - for (const element of outerValue.elements) { - const validationResult = await safeValidateTypes({ - value: element, - schema: elementSchema - }); - if (!validationResult.success) throw new NoObjectGeneratedError({ - message: "No object generated: response did not match schema.", - cause: validationResult.error, - text: text2, - response: context.response, - usage: context.usage, - finishReason: context.finishReason - }); - validatedElements.push(validationResult.value); - } - return validatedElements; - }, - async parsePartialOutput({ text: text2 }) { - const result = await parsePartialJson(text2); - switch (result.state) { - case "failed-parse": - case "undefined-input": return; - case "repaired-parse": - case "successful-parse": { - const outerValue = result.value; - if (outerValue == null || typeof outerValue !== "object" || !("elements" in outerValue) || !Array.isArray(outerValue.elements)) return; - const rawElements = result.state === "repaired-parse" && outerValue.elements.length > 0 ? outerValue.elements.slice(0, -1) : outerValue.elements; - const parsedElements = []; - for (const rawElement of rawElements) { - const validationResult = await safeValidateTypes({ - value: rawElement, - schema: elementSchema - }); - if (validationResult.success) parsedElements.push(validationResult.value); - } - return { partial: parsedElements }; - } - } - }, - createElementStreamTransform() { - let publishedElements = 0; - return new TransformStream({ transform({ partialOutput }, controller) { - if (partialOutput != null) for (; publishedElements < partialOutput.length; publishedElements++) controller.enqueue(partialOutput[publishedElements]); - } }); - } - }; -}; -var choice = ({ options: choiceOptions, name: name22, description }) => { - return { - name: "choice", - responseFormat: Promise.resolve({ - type: "json", - schema: { - $schema: "http://json-schema.org/draft-07/schema#", - type: "object", - properties: { result: { - type: "string", - enum: choiceOptions - } }, - required: ["result"], - additionalProperties: false - }, - ...name22 != null && { name: name22 }, - ...description != null && { description } - }), - async parseCompleteOutput({ text: text2 }, context) { - const parseResult = await safeParseJSON({ text: text2 }); - if (!parseResult.success) throw new NoObjectGeneratedError({ - message: "No object generated: could not parse the response.", - cause: parseResult.error, - text: text2, - response: context.response, - usage: context.usage, - finishReason: context.finishReason - }); - const outerValue = parseResult.value; - if (outerValue == null || typeof outerValue !== "object" || !("result" in outerValue) || typeof outerValue.result !== "string" || !choiceOptions.includes(outerValue.result)) throw new NoObjectGeneratedError({ - message: "No object generated: response did not match schema.", - cause: new TypeValidationError({ - value: outerValue, - cause: "response must be an object that contains a choice value." - }), - text: text2, - response: context.response, - usage: context.usage, - finishReason: context.finishReason - }); - return outerValue.result; - }, - async parsePartialOutput({ text: text2 }) { - const result = await parsePartialJson(text2); - switch (result.state) { - case "failed-parse": - case "undefined-input": return; - case "repaired-parse": - case "successful-parse": { - const outerValue = result.value; - if (outerValue == null || typeof outerValue !== "object" || !("result" in outerValue) || typeof outerValue.result !== "string") return; - const potentialMatches = choiceOptions.filter((choiceOption) => choiceOption.startsWith(outerValue.result)); - if (result.state === "successful-parse") return potentialMatches.includes(outerValue.result) ? { partial: outerValue.result } : void 0; - else return potentialMatches.length === 1 ? { partial: potentialMatches[0] } : void 0; - } - } - }, - createElementStreamTransform() {} - }; -}; -var json = ({ name: name22, description } = {}) => { - return { - name: "json", - responseFormat: Promise.resolve({ - type: "json", - ...name22 != null && { name: name22 }, - ...description != null && { description } - }), - async parseCompleteOutput({ text: text2 }, context) { - const parseResult = await safeParseJSON({ text: text2 }); - if (!parseResult.success) throw new NoObjectGeneratedError({ - message: "No object generated: could not parse the response.", - cause: parseResult.error, - text: text2, - response: context.response, - usage: context.usage, - finishReason: context.finishReason - }); - return parseResult.value; - }, - async parsePartialOutput({ text: text2 }) { - const result = await parsePartialJson(text2); - switch (result.state) { - case "failed-parse": - case "undefined-input": return; - case "repaired-parse": - case "successful-parse": return result.value === void 0 ? void 0 : { partial: result.value }; - } - }, - createElementStreamTransform() {} - }; -}; -async function parseToolCall({ toolCall, tools, repairToolCall, refineToolInput, messages, instructions }) { - try { - if (tools == null) { - if (toolCall.providerExecuted && toolCall.dynamic) return await refineParsedToolCallInput({ - toolCall: await parseProviderExecutedDynamicToolCall(toolCall), - refineToolInput - }); - throw new NoSuchToolError({ toolName: toolCall.toolName }); - } - try { - return await refineParsedToolCallInput({ - toolCall: await doParseToolCall({ - toolCall, - tools - }), - refineToolInput - }); - } catch (error) { - if (repairToolCall == null || !(NoSuchToolError.isInstance(error) || InvalidToolInputError.isInstance(error))) throw error; - let repairedToolCall = null; - try { - repairedToolCall = await repairToolCall({ - toolCall, - tools, - inputSchema: async ({ toolName }) => { - var _a22; - return await asSchema((_a22 = getOwn(tools, toolName)) == null ? void 0 : _a22.inputSchema).jsonSchema; - }, - instructions, - system: instructions, - messages, - error - }); - } catch (repairError) { - throw new ToolCallRepairError({ - cause: repairError, - originalError: error - }); - } - if (repairedToolCall == null) throw error; - return await refineParsedToolCallInput({ - toolCall: await doParseToolCall({ - toolCall: repairedToolCall, - tools - }), - refineToolInput - }); - } - } catch (error) { - const parsedInput = await safeParseJSON({ text: toolCall.input }); - const input = parsedInput.success ? parsedInput.value : toolCall.input; - const tool2 = getOwn(tools, toolCall.toolName); - return { - type: "tool-call", - toolCallId: toolCall.toolCallId, - toolName: toolCall.toolName, - input, - dynamic: true, - invalid: true, - error, - title: tool2 == null ? void 0 : tool2.title, - providerExecuted: toolCall.providerExecuted, - providerMetadata: toolCall.providerMetadata, - ...(tool2 == null ? void 0 : tool2.metadata) != null ? { toolMetadata: tool2.metadata } : {} - }; - } -} -async function refineParsedToolCallInput({ toolCall, refineToolInput }) { - const refine = getOwn(refineToolInput, toolCall.toolName); - if (refine == null) return toolCall; - return { - ...toolCall, - input: await refine(toolCall.input) - }; -} -async function parseProviderExecutedDynamicToolCall(toolCall) { - const parseResult = toolCall.input.trim() === "" ? { - success: true, - value: {} - } : await safeParseJSON({ text: toolCall.input }); - if (parseResult.success === false) throw new InvalidToolInputError({ - toolName: toolCall.toolName, - toolInput: toolCall.input, - cause: parseResult.error - }); - return { - type: "tool-call", - toolCallId: toolCall.toolCallId, - toolName: toolCall.toolName, - input: parseResult.value, - providerExecuted: true, - dynamic: true, - providerMetadata: toolCall.providerMetadata - }; -} -async function doParseToolCall({ toolCall, tools }) { - const toolName = toolCall.toolName; - const tool2 = getOwn(tools, toolName); - if (tool2 == null) { - if (toolCall.providerExecuted && toolCall.dynamic) return await parseProviderExecutedDynamicToolCall(toolCall); - throw new NoSuchToolError({ - toolName: toolCall.toolName, - availableTools: Object.keys(tools) - }); - } - const schema = asSchema(tool2.inputSchema); - const parseResult = toolCall.input.trim() === "" ? await safeValidateTypes({ - value: {}, - schema - }) : await safeParseJSON({ - text: toolCall.input, - schema - }); - if (parseResult.success === false) throw new InvalidToolInputError({ - toolName, - toolInput: toolCall.input, - cause: parseResult.error - }); - return tool2.type === "dynamic" ? { - type: "tool-call", - toolCallId: toolCall.toolCallId, - toolName: toolCall.toolName, - input: parseResult.value, - providerExecuted: toolCall.providerExecuted, - providerMetadata: toolCall.providerMetadata, - ...tool2.metadata != null ? { toolMetadata: tool2.metadata } : {}, - dynamic: true, - title: tool2.title - } : { - type: "tool-call", - toolCallId: toolCall.toolCallId, - toolName, - input: parseResult.value, - providerExecuted: toolCall.providerExecuted, - providerMetadata: toolCall.providerMetadata, - ...tool2.metadata != null ? { toolMetadata: tool2.metadata } : {}, - title: tool2.title - }; -} -function unwrapReasoningFileData(data) { - if (typeof data === "object" && data !== null && "type" in data) return data.type === "data" ? data.data : data.url; - return data; -} -function convertFromReasoningOutputs(parts) { - return parts.map((part) => { - if (part.type === "reasoning") return { - type: "reasoning", - text: part.text, - ...part.providerMetadata != null ? { providerOptions: part.providerMetadata } : {} - }; - return { - type: "reasoning-file", - data: part.file.base64, - mediaType: part.file.mediaType, - ...part.providerMetadata != null ? { providerOptions: part.providerMetadata } : {} - }; - }); -} -function convertToReasoningOutputs(parts) { - return parts.map((part) => { - if (part.type === "reasoning") return { - type: "reasoning", - text: part.text, - ...part.providerOptions != null ? { providerMetadata: part.providerOptions } : {} - }; - const rawData = unwrapReasoningFileData(part.data); - return { - type: "reasoning-file", - file: new DefaultGeneratedFile({ - data: rawData instanceof ArrayBuffer ? new Uint8Array(rawData) : rawData instanceof URL ? rawData.toString() : rawData, - mediaType: part.mediaType - }), - ...part.providerOptions != null ? { providerMetadata: part.providerOptions } : {} - }; - }); -} -async function resolveToolApproval({ tools, toolCall, toolApproval, messages, toolsContext, runtimeContext }) { - if (toolApproval != null && typeof toolApproval === "function") return normalizeToolApprovalStatus(await toolApproval({ - toolCall, - tools, - toolsContext, - messages, - runtimeContext - })); - const toolName = toolCall.toolName; - const tool2 = getOwn(tools, toolName); - const input = toolCall.input; - const userDefinedToolApprovalStatus = getOwn(toolApproval, toolName); - if (userDefinedToolApprovalStatus != null) return normalizeToolApprovalStatus(typeof userDefinedToolApprovalStatus === "function" ? await userDefinedToolApprovalStatus(input, { - toolCallId: toolCall.toolCallId, - messages, - toolContext: await validateToolContext({ - toolName, - context: getOwn(toolsContext, toolName), - contextSchema: tool2 == null ? void 0 : tool2.contextSchema - }), - runtimeContext - }) : userDefinedToolApprovalStatus); - if ((tool2 == null ? void 0 : tool2.needsApproval) == null) return { type: "not-applicable" }; - return (typeof tool2.needsApproval === "function" ? await tool2.needsApproval(input, { - toolCallId: toolCall.toolCallId, - messages, - context: await validateToolContext({ - toolName, - context: getOwn(toolsContext, toolName), - contextSchema: tool2 == null ? void 0 : tool2.contextSchema - }) - }) : tool2.needsApproval) ? { type: "user-approval" } : { type: "not-applicable" }; -} -function normalizeToolApprovalStatus(status) { - return status === void 0 ? { type: "not-applicable" } : typeof status === "string" ? { type: status } : status; -} -function mergeCallbacks(...callbacks) { - return async (event) => { - await Promise.allSettled(callbacks.map(async (callback) => { - await (callback == null ? void 0 : callback(event)); - })); - }; -} -function isNodeRuntime() { - var _a22; - return typeof process !== "undefined" && ((_a22 = process.release) == null ? void 0 : _a22.name) === "node"; -} -var diagnosticsChannelPromise; -async function loadDiagnosticsChannel() { - if (!isNodeRuntime()) return; - if (diagnosticsChannelPromise == null) diagnosticsChannelPromise = Promise.resolve(loadBuiltinModule("node:diagnostics_channel")); - return diagnosticsChannelPromise; -} -function loadBuiltinModule(id) { - var _a22; - const processWithBuiltins = globalThis.process; - try { - return (_a22 = processWithBuiltins == null ? void 0 : processWithBuiltins.getBuiltinModule) == null ? void 0 : _a22.call(processWithBuiltins, id); - } catch (e) { - return; - } -} -async function runWithTracingChannelSpan(message, execute) { - var _a22; - const diagnosticsChannel = await loadDiagnosticsChannel(); - const tracingChannel = (_a22 = diagnosticsChannel == null ? void 0 : diagnosticsChannel.tracingChannel) == null ? void 0 : _a22.call(diagnosticsChannel, "ai:telemetry"); - if (tracingChannel == null || tracingChannel.hasSubscribers === false) return await execute(); - let executePromise; - let executionResult; - let executionError; - let hasExecutionResult = false; - let hasExecutionError = false; - const tracedExecute = () => { - try { - executePromise = Promise.resolve(execute()); - } catch (error) { - executePromise = Promise.reject(error); - } - executePromise = executePromise.then((result) => { - executionResult = result; - hasExecutionResult = true; - return result; - }, (error) => { - executionError = error; - hasExecutionError = true; - throw error; - }); - return executePromise; - }; - try { - return await tracingChannel.tracePromise(tracedExecute, message); - } catch (e) { - if (hasExecutionError) throw executionError; - if (hasExecutionResult) return executionResult; - if (executePromise != null) return await executePromise; - return await execute(); - } -} -function openTelemetryChannelSpanContext({ message, completion }) { - var _a22; - if (!isNodeRuntime()) return; - const diagnosticsChannel = loadBuiltinModule("node:diagnostics_channel"); - const asyncHooks = loadBuiltinModule("node:async_hooks"); - const tracingChannel = (_a22 = diagnosticsChannel == null ? void 0 : diagnosticsChannel.tracingChannel) == null ? void 0 : _a22.call(diagnosticsChannel, "ai:telemetry"); - if (tracingChannel == null || tracingChannel.hasSubscribers === false || asyncHooks == null) { - Promise.resolve(completion).catch(() => {}); - return; - } - const context = message; - let asyncResource; - let asyncEndPublished = false; - const safePublish = (publish) => { - try { - publish(); - } catch (e) {} - }; - const publishAsyncEnd = ({ result, error }) => { - if (asyncEndPublished) return; - asyncEndPublished = true; - if (error !== void 0) { - context.error = error; - safePublish(() => tracingChannel.error.publish(context)); - } - if (result !== void 0) context.result = result; - safePublish(() => tracingChannel.asyncEnd.publish(context)); - }; - safePublish(() => { - tracingChannel.start.runStores(context, () => { - asyncResource = new asyncHooks.AsyncResource("ai.telemetry"); - }); - }); - safePublish(() => tracingChannel.end.publish(context)); - Promise.resolve(completion).then((result) => publishAsyncEnd({ result }), (error) => publishAsyncEnd({ error })); - return { run: (execute) => asyncResource == null ? execute() : asyncResource.runInAsyncScope(execute) }; -} -function registerTelemetry(...integrations) { - if (!globalThis.AI_SDK_TELEMETRY_INTEGRATIONS) globalThis.AI_SDK_TELEMETRY_INTEGRATIONS = []; - globalThis.AI_SDK_TELEMETRY_INTEGRATIONS.push(...integrations); -} -function getGlobalTelemetryIntegrations() { - var _a22; - return (_a22 = globalThis.AI_SDK_TELEMETRY_INTEGRATIONS) != null ? _a22 : []; -} -function augmentEvent(event, telemetry) { - return Object.assign(Object.create(Object.getPrototypeOf(event)), event, telemetry); -} -function createTelemetryDispatcher({ telemetry }) { - if ((telemetry == null ? void 0 : telemetry.isEnabled) === false) return {}; - const localIntegrations = telemetry == null ? void 0 : telemetry.integrations; - const integrations = localIntegrations != null ? asArray(localIntegrations) : getGlobalTelemetryIntegrations(); - const telemetryMetadata = { - recordInputs: telemetry == null ? void 0 : telemetry.recordInputs, - recordOutputs: telemetry == null ? void 0 : telemetry.recordOutputs, - functionId: telemetry == null ? void 0 : telemetry.functionId - }; - const mergeTelemetryCallback = (key) => { - const mergedIntegrationCallback = mergeCallbacks(...integrations.map((integration) => { - var _a22; - return (_a22 = integration[key]) == null ? void 0 : _a22.bind(integration); - }).filter(Boolean).map((callback) => (event) => callback(augmentEvent(event, telemetryMetadata)))); - return async (event) => { - await mergedIntegrationCallback(event); - }; - }; - const executeLanguageModelCallWrappers = integrations.map((integration) => { - var _a22; - return (_a22 = integration.executeLanguageModelCall) == null ? void 0 : _a22.bind(integration); - }).filter(Boolean); - const executeToolWrappers = integrations.map((integration) => { - var _a22; - return (_a22 = integration.executeTool) == null ? void 0 : _a22.bind(integration); - }).filter(Boolean); - return { - runInTracingChannelSpan: async ({ type, event, execute }) => await runWithTracingChannelSpan({ - type, - event: augmentEvent(event, telemetryMetadata) - }, execute), - startTracingChannelContext: ({ type, event, completion }) => openTelemetryChannelSpanContext({ - message: { - type, - event: augmentEvent(event, telemetryMetadata) - }, - completion - }), - onStart: mergeTelemetryCallback("onStart"), - onStepStart: mergeTelemetryCallback("onStepStart"), - onLanguageModelCallStart: mergeTelemetryCallback("onLanguageModelCallStart"), - onLanguageModelCallEnd: mergeTelemetryCallback("onLanguageModelCallEnd"), - onToolExecutionStart: mergeTelemetryCallback("onToolExecutionStart"), - onToolExecutionEnd: mergeTelemetryCallback("onToolExecutionEnd"), - onStepEnd: mergeCallbacks(mergeTelemetryCallback("onStepEnd"), mergeTelemetryCallback("onStepFinish")), - onObjectStepStart: mergeTelemetryCallback("onObjectStepStart"), - onObjectStepEnd: mergeTelemetryCallback("onObjectStepEnd"), - onEmbedStart: mergeTelemetryCallback("onEmbedStart"), - onEmbedEnd: mergeTelemetryCallback("onEmbedEnd"), - onRerankStart: mergeTelemetryCallback("onRerankStart"), - onRerankEnd: mergeTelemetryCallback("onRerankEnd"), - onEnd: mergeTelemetryCallback("onEnd"), - onAbort: mergeTelemetryCallback("onAbort"), - onError: mergeTelemetryCallback("onError"), - /** - * Runs provider calls inside integration-specific context so - * auto-instrumented provider requests can be associated with model work. - */ - executeLanguageModelCall: async ({ execute, ...event }) => { - const augmentedEvent = augmentEvent(event, telemetryMetadata); - let wrappedExecute = execute; - for (const executeWrapper of executeLanguageModelCallWrappers) { - const innerExecute = wrappedExecute; - wrappedExecute = () => executeWrapper({ - ...augmentedEvent, - execute: innerExecute - }); - } - return await runWithTracingChannelSpan({ - type: "languageModelCall", - event: augmentedEvent - }, wrappedExecute); - }, - /** - * Composes all `executeTool` wrappers around the original tool execution. - * Each wrapper receives an `execute` function that calls the next wrapper in - * the chain, so integrations can establish nested telemetry context before - * delegating to the underlying tool. - */ - executeTool: async ({ execute, ...event }) => { - const augmentedEvent = augmentEvent(event, telemetryMetadata); - let wrappedExecute = execute; - for (const executeWrapper of executeToolWrappers) { - const innerExecute = wrappedExecute; - wrappedExecute = () => executeWrapper({ - ...augmentedEvent, - execute: innerExecute - }); - } - return await wrappedExecute(); - } - }; -} -function asReasoningText(reasoningParts) { - const reasoningText = reasoningParts.map((part) => "text" in part ? part.text : "").join(""); - return reasoningText.length > 0 ? reasoningText : void 0; -} -var DefaultStepResult = class { - constructor({ callId, stepNumber, provider, modelId, runtimeContext, toolsContext, content, finishReason, rawFinishReason, usage, performance, warnings, request, response, providerMetadata }) { - this.callId = callId; - this.stepNumber = stepNumber; - this.model = { - provider, - modelId - }; - this.runtimeContext = runtimeContext; - this.toolsContext = toolsContext; - this.content = content; - this.finishReason = finishReason; - this.rawFinishReason = rawFinishReason; - this.usage = usage; - this.performance = performance; - this.warnings = warnings; - this.request = request; - this.response = response; - this.providerMetadata = providerMetadata; - } - get text() { - return this.content.filter((part) => part.type === "text").map((part) => part.text).join(""); - } - get reasoning() { - return convertFromReasoningOutputs(this.content.filter((part) => part.type === "reasoning" || part.type === "reasoning-file")); - } - get reasoningText() { - return asReasoningText(this.reasoning); - } - get files() { - return this.content.filter((part) => part.type === "file").map((part) => part.file); - } - get sources() { - return this.content.filter((part) => part.type === "source"); - } - get toolCalls() { - return this.content.filter((part) => part.type === "tool-call"); - } - get staticToolCalls() { - return this.toolCalls.filter((toolCall) => toolCall.dynamic !== true); - } - get dynamicToolCalls() { - return this.toolCalls.filter((toolCall) => toolCall.dynamic === true); - } - get toolResults() { - return this.content.filter((part) => part.type === "tool-result"); - } - get staticToolResults() { - return this.toolResults.filter((toolResult) => toolResult.dynamic !== true); - } - get dynamicToolResults() { - return this.toolResults.filter((toolResult) => toolResult.dynamic === true); - } -}; -function filterIncludedContext({ context, includeContext }) { - if (context == null) return {}; - return Object.fromEntries(Object.entries(context).filter(([key]) => (includeContext == null ? void 0 : includeContext[key]) === true)); -} -function restrictStepResult({ step, includeRuntimeContext, includeToolsContext }) { - return new DefaultStepResult({ - callId: step.callId, - stepNumber: step.stepNumber, - provider: step.model.provider, - modelId: step.model.modelId, - runtimeContext: filterIncludedContext({ - context: step.runtimeContext, - includeContext: includeRuntimeContext - }), - toolsContext: filterToolsContext({ - toolsContext: step.toolsContext, - includeToolsContext - }), - content: step.content, - finishReason: step.finishReason, - rawFinishReason: step.rawFinishReason, - usage: step.usage, - performance: step.performance, - warnings: step.warnings, - request: step.request, - response: step.response, - providerMetadata: step.providerMetadata - }); -} -function filterToolsContext({ toolsContext, includeToolsContext }) { - if (includeToolsContext == null) return {}; - return Object.fromEntries(Object.entries(toolsContext).map(([toolName, toolContext]) => [toolName, filterToolContext({ - toolName, - toolContext, - includeToolsContext - })])); -} -function filterToolContext({ toolName, toolContext, includeToolsContext }) { - return filterIncludedContext({ - context: toolContext, - includeContext: includeToolsContext == null ? void 0 : includeToolsContext[toolName] - }); -} -function createRestrictedTelemetryDispatcher({ telemetry, includeRuntimeContext, includeToolsContext }) { - const telemetryDispatcher = createTelemetryDispatcher({ telemetry }); - return { - ...telemetryDispatcher, - onStart: (event) => { - var _a22; - return (_a22 = telemetryDispatcher.onStart) == null ? void 0 : _a22.call(telemetryDispatcher, { - ...event, - runtimeContext: filterIncludedContext({ - context: event.runtimeContext, - includeContext: includeRuntimeContext - }), - toolsContext: filterToolsContext({ - toolsContext: event.toolsContext, - includeToolsContext - }) - }); - }, - onStepStart: (event) => { - var _a22; - return (_a22 = telemetryDispatcher.onStepStart) == null ? void 0 : _a22.call(telemetryDispatcher, { - ...event, - runtimeContext: filterIncludedContext({ - context: event.runtimeContext, - includeContext: includeRuntimeContext - }), - steps: event.steps.map((step) => restrictStepResult({ - step, - includeRuntimeContext, - includeToolsContext - })), - toolsContext: filterToolsContext({ - toolsContext: event.toolsContext, - includeToolsContext - }) - }); - }, - onStepEnd: (event) => { - var _a22; - return (_a22 = telemetryDispatcher.onStepEnd) == null ? void 0 : _a22.call(telemetryDispatcher, restrictStepResult({ - step: event, - includeRuntimeContext, - includeToolsContext - })); - }, - onStepFinish: (event) => { - var _a22; - return (_a22 = telemetryDispatcher.onStepEnd) == null ? void 0 : _a22.call(telemetryDispatcher, restrictStepResult({ - step: event, - includeRuntimeContext, - includeToolsContext - })); - }, - onEnd: (event) => { - var _a22; - return (_a22 = telemetryDispatcher.onEnd) == null ? void 0 : _a22.call(telemetryDispatcher, ((restrictedSteps) => { - return { - ...event, - runtimeContext: filterIncludedContext({ - context: event.runtimeContext, - includeContext: includeRuntimeContext - }), - steps: restrictedSteps, - finalStep: restrictedSteps.at(-1), - toolsContext: filterToolsContext({ - toolsContext: event.toolsContext, - includeToolsContext - }) - }; - })(event.steps.map((step) => restrictStepResult({ - step, - includeRuntimeContext, - includeToolsContext - })))); - }, - onAbort: (event) => { - var _a22; - return (_a22 = telemetryDispatcher.onAbort) == null ? void 0 : _a22.call(telemetryDispatcher, { - ...event, - steps: event.steps.map((step) => restrictStepResult({ - step, - includeRuntimeContext, - includeToolsContext - })) - }); - }, - onToolExecutionStart: (event) => { - var _a22; - return (_a22 = telemetryDispatcher.onToolExecutionStart) == null ? void 0 : _a22.call(telemetryDispatcher, { - ...event, - toolContext: filterToolContext({ - toolName: event.toolCall.toolName, - toolContext: event.toolContext, - includeToolsContext - }) - }); - }, - onToolExecutionEnd: (event) => { - var _a22; - return (_a22 = telemetryDispatcher.onToolExecutionEnd) == null ? void 0 : _a22.call(telemetryDispatcher, { - ...event, - toolContext: filterToolContext({ - toolName: event.toolCall.toolName, - toolContext: event.toolContext, - includeToolsContext - }) - }); - } - }; -} -function isStepCount(stepCount) { - return ({ steps }) => steps.length === stepCount; -} -async function isStopConditionMet({ stopConditions, steps }) { - return (await Promise.all(stopConditions.map((condition) => condition({ steps })))).some((result) => result); -} -function sumTokenCounts(tokenCount1, tokenCount2) { - return tokenCount1 == null && tokenCount2 == null ? void 0 : (tokenCount1 != null ? tokenCount1 : 0) + (tokenCount2 != null ? tokenCount2 : 0); -} -async function toResponseMessages({ content: inputContent, tools }) { - const responseMessages = []; - const toolCallOrder = /* @__PURE__ */ new Map(); - const content = []; - for (const part of inputContent) { - if (part.type === "source") continue; - if ((part.type === "tool-result" || part.type === "tool-error") && !part.providerExecuted) continue; - if (part.type === "text" && part.text.length === 0) continue; - switch (part.type) { - case "text": - content.push({ - type: "text", - text: part.text, - providerOptions: part.providerMetadata - }); - break; - case "custom": - content.push({ - type: "custom", - kind: part.kind, - providerOptions: part.providerMetadata - }); - break; - case "reasoning": - content.push({ - type: "reasoning", - text: part.text, - providerOptions: part.providerMetadata - }); - break; - case "file": - content.push({ - type: "file", - data: part.file.base64, - mediaType: part.file.mediaType, - providerOptions: part.providerMetadata - }); - break; - case "reasoning-file": - content.push({ - type: "reasoning-file", - data: part.file.base64, - mediaType: part.file.mediaType, - providerOptions: part.providerMetadata - }); - break; - case "tool-call": - if (!toolCallOrder.has(part.toolCallId)) toolCallOrder.set(part.toolCallId, toolCallOrder.size); - content.push({ - type: "tool-call", - toolCallId: part.toolCallId, - toolName: part.toolName, - input: part.invalid && typeof part.input !== "object" ? {} : part.input, - providerExecuted: part.providerExecuted, - providerOptions: part.providerMetadata - }); - break; - case "tool-result": { - const output = await createToolModelOutput({ - toolCallId: part.toolCallId, - input: part.input, - tool: getOwn(tools, part.toolName), - output: part.output, - errorMode: "none" - }); - content.push({ - type: "tool-result", - toolCallId: part.toolCallId, - toolName: part.toolName, - output, - providerOptions: part.providerMetadata - }); - break; - } - case "tool-error": { - const output = await createToolModelOutput({ - toolCallId: part.toolCallId, - input: part.input, - tool: getOwn(tools, part.toolName), - output: part.error, - errorMode: "json" - }); - content.push({ - type: "tool-result", - toolCallId: part.toolCallId, - toolName: part.toolName, - output, - providerOptions: part.providerMetadata - }); - break; - } - case "tool-approval-request": - content.push({ - type: "tool-approval-request", - approvalId: part.approvalId, - toolCallId: part.toolCall.toolCallId, - isAutomatic: part.isAutomatic, - ...part.signature != null ? { signature: part.signature } : {} - }); - break; - } - } - if (content.length > 0) responseMessages.push({ - role: "assistant", - content - }); - const toolResultContent = []; - for (const part of inputContent) { - if (part.type !== "tool-approval-response" && part.type !== "tool-result" && part.type !== "tool-error") continue; - if (part.type === "tool-approval-response") { - toolResultContent.push({ - type: "tool-approval-response", - approvalId: part.approvalId, - approved: part.approved, - reason: part.reason, - providerExecuted: part.providerExecuted - }); - if (part.approved === false) toolResultContent.push({ - type: "tool-result", - toolCallId: part.toolCall.toolCallId, - toolName: part.toolCall.toolName, - output: { - type: "execution-denied", - reason: part.reason - } - }); - continue; - } - if (part.providerExecuted) continue; - const output = await createToolModelOutput({ - toolCallId: part.toolCallId, - input: part.input, - tool: getOwn(tools, part.toolName), - output: part.type === "tool-result" ? part.output : part.error, - errorMode: part.type === "tool-error" ? "text" : "none" - }); - toolResultContent.push({ - type: "tool-result", - toolCallId: part.toolCallId, - toolName: part.toolName, - output, - ...part.providerMetadata != null ? { providerOptions: part.providerMetadata } : {} - }); - } - if (toolResultContent.length > 0) responseMessages.push({ - role: "tool", - content: sortToolResultContentByToolCallOrder({ - toolResultContent, - toolCallOrder - }) - }); - return responseMessages; -} -function sortToolResultContentByToolCallOrder({ toolResultContent, toolCallOrder }) { - const sortedToolResults = toolResultContent.filter((part) => part.type === "tool-result").map((part, index) => ({ - part, - index - })).sort((a, b) => { - const aOrder = toolCallOrder.get(a.part.toolCallId); - const bOrder = toolCallOrder.get(b.part.toolCallId); - if (aOrder == null && bOrder == null) return a.index - b.index; - if (aOrder == null) return 1; - if (bOrder == null) return -1; - return aOrder - bOrder || a.index - b.index; - }).map(({ part }) => part); - let toolResultIndex = 0; - return toolResultContent.map((part) => part.type === "tool-result" ? sortedToolResults[toolResultIndex++] : part); -} -var encoder = new TextEncoder(); -function canonicalJSON(value) { - if (value === null || value === void 0) return JSON.stringify(value); - if (typeof value !== "object") return JSON.stringify(value); - if (Array.isArray(value)) return `[${value.map(canonicalJSON).join(",")}]`; - return `{${Object.keys(value).sort().map((k) => `${JSON.stringify(k)}:${canonicalJSON(value[k])}`).join(",")}}`; -} -function toBase64url(bytes) { - return convertUint8ArrayToBase64(bytes).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/g, ""); -} -async function hashCanonical(value) { - const digest = await crypto.subtle.digest("SHA-256", encoder.encode(canonicalJSON(value))); - return toBase64url(new Uint8Array(digest)); -} -var encoder2 = new TextEncoder(); -function fromBase64url(str) { - return convertBase64ToUint8Array(str); -} -async function importKey(secret) { - const keyData = typeof secret === "string" ? encoder2.encode(secret) : secret; - return crypto.subtle.importKey("raw", keyData, { - name: "HMAC", - hash: "SHA-256" - }, false, ["sign", "verify"]); -} -function buildPayload(approvalId, toolCallId, toolName, inputDigest) { - return encoder2.encode(`${approvalId} -${toolCallId} -${toolName} -${inputDigest}`); -} -async function signToolApproval({ secret, approvalId, toolCallId, toolName, input }) { - const key = await importKey(secret); - const payload = buildPayload(approvalId, toolCallId, toolName, await hashCanonical(input)); - const sig = await crypto.subtle.sign("HMAC", key, payload); - return toBase64url(new Uint8Array(sig)); -} -async function verifyToolApprovalSignature({ secret, signature, approvalId, toolCallId, toolName, input }) { - const key = await importKey(secret); - const payload = buildPayload(approvalId, toolCallId, toolName, await hashCanonical(input)); - const sigBytes = fromBase64url(signature); - return crypto.subtle.verify("HMAC", key, sigBytes, payload); -} -async function maybeSignApproval({ secret, approvalId, toolCallId, toolName, input }) { - if (secret == null) return void 0; - return signToolApproval({ - secret, - approvalId, - toolCallId, - toolName, - input - }); -} -async function validateApprovedToolApprovals({ approvedToolApprovals, tools, toolApproval, messages, toolsContext, runtimeContext, toolApprovalSecret }) { - var _a22; - const approved = []; - const denied = []; - for (const approval of approvedToolApprovals) { - const { toolCall, approvalRequest } = approval; - const tool2 = getOwn(tools, toolCall.toolName); - if (toolApprovalSecret != null) { - if (approvalRequest.signature == null) throw new InvalidToolApprovalSignatureError({ - approvalId: approvalRequest.approvalId, - toolCallId: toolCall.toolCallId, - reason: "missing signature" - }); - if (!await verifyToolApprovalSignature({ - secret: toolApprovalSecret, - signature: approvalRequest.signature, - approvalId: approvalRequest.approvalId, - toolCallId: toolCall.toolCallId, - toolName: toolCall.toolName, - input: toolCall.input - })) throw new InvalidToolApprovalSignatureError({ - approvalId: approvalRequest.approvalId, - toolCallId: toolCall.toolCallId, - reason: "invalid signature" - }); - } - if (isExecutableTool(tool2) && tool2.inputSchema != null) { - const validation = await safeValidateTypes({ - value: toolCall.input, - schema: asSchema(tool2.inputSchema) - }); - if (!validation.success) throw new InvalidToolInputError({ - toolName: toolCall.toolName, - toolInput: JSON.stringify(toolCall.input), - cause: validation.error - }); - } - const approvalStatus = await resolveToolApproval({ - tools, - toolApproval, - toolCall, - messages, - toolsContext, - runtimeContext - }); - if (approvalStatus.type === "denied") denied.push({ - ...approval, - approvalResponse: { - ...approval.approvalResponse, - approved: false, - reason: (_a22 = approvalStatus.reason) != null ? _a22 : approval.approvalResponse.reason - } - }); - else approved.push(approval); - } - return { - approvedToolApprovals: approved, - deniedToolApprovals: denied - }; -} -var originalGenerateId = createIdGenerator({ - prefix: "aitxt", - size: 24 -}); -var originalGenerateCallId = createIdGenerator({ - prefix: "call", - size: 24 -}); -async function generateText({ model: modelArg, tools, toolChoice, instructions, system, prompt, messages, allowSystemInMessages, maxRetries: maxRetriesArg, abortSignal, timeout, headers, stopWhen = isStepCount(1), experimental_sandbox: sandbox, output, toolApproval, experimental_toolApprovalSecret, experimental_telemetry, telemetry = experimental_telemetry, providerOptions, activeTools, toolOrder, prepareStep, experimental_repairToolCall, repairToolCall = experimental_repairToolCall, experimental_refineToolInput: refineToolInput, experimental_download: download2, runtimeContext = {}, toolsContext = {}, experimental_include, include = experimental_include, _internal: { generateId: generateId2 = originalGenerateId, generateCallId = originalGenerateCallId, now: now2 = now } = {}, onStart, experimental_onStart, onStepStart, experimental_onStepStart, onLanguageModelCallStart, experimental_onLanguageModelCallStart, onLanguageModelCallEnd, experimental_onLanguageModelCallEnd, onToolExecutionStart, onToolExecutionEnd, experimental_onToolCallStart, experimental_onToolCallFinish, onStepEnd, onStepFinish, onFinish, onEnd = onFinish, ...settings }) { - var _a22, _b, _c, _d; - include = { - requestBody: (_a22 = include == null ? void 0 : include.requestBody) != null ? _a22 : false, - requestMessages: (_b = include == null ? void 0 : include.requestMessages) != null ? _b : false, - responseBody: (_c = include == null ? void 0 : include.responseBody) != null ? _c : false - }; - const model = resolveLanguageModel(modelArg); - const stopConditions = asArray(stopWhen); - const resolvedOnStart = onStart != null ? onStart : experimental_onStart; - const resolvedOnStepStart = onStepStart != null ? onStepStart : experimental_onStepStart; - const resolvedOnLanguageModelCallStart = onLanguageModelCallStart != null ? onLanguageModelCallStart : experimental_onLanguageModelCallStart; - const resolvedOnLanguageModelCallEnd = onLanguageModelCallEnd != null ? onLanguageModelCallEnd : experimental_onLanguageModelCallEnd; - const resolvedOnToolExecutionStart = onToolExecutionStart != null ? onToolExecutionStart : experimental_onToolCallStart; - const resolvedOnToolExecutionEnd = onToolExecutionEnd != null ? onToolExecutionEnd : experimental_onToolCallFinish; - const resolvedOnStepEnd = onStepEnd != null ? onStepEnd : onStepFinish; - const totalTimeoutMs = getTotalTimeoutMs(timeout); - const stepTimeoutMs = getStepTimeoutMs(timeout); - const stepAbortController = stepTimeoutMs != null ? new AbortController() : void 0; - const mergedAbortSignal = mergeAbortSignals(abortSignal, totalTimeoutMs, stepAbortController == null ? void 0 : stepAbortController.signal); - const { maxRetries, retry } = prepareRetries({ - maxRetries: maxRetriesArg, - abortSignal: mergedAbortSignal - }); - const callSettings = prepareLanguageModelCallOptions(settings); - const headersWithUserAgent = withUserAgentSuffix(headers != null ? headers : {}, `ai/${VERSION}`); - const initialPrompt = await standardizePrompt({ - instructions, - system, - prompt, - messages, - allowSystemInMessages - }); - const callId = generateCallId(); - const telemetryDispatcher = createRestrictedTelemetryDispatcher({ - telemetry, - includeRuntimeContext: telemetry == null ? void 0 : telemetry.includeRuntimeContext, - includeToolsContext: telemetry == null ? void 0 : telemetry.includeToolsContext - }); - const runInTracingChannelSpan = (_d = telemetryDispatcher.runInTracingChannelSpan) != null ? _d : async ({ execute }) => await execute(); - const generateTextStartEvent = { - callId, - operationId: "ai.generateText", - provider: model.provider, - modelId: model.modelId, - instructions: initialPrompt.instructions, - messages: initialPrompt.messages, - tools, - toolChoice, - activeTools, - toolOrder, - maxOutputTokens: callSettings.maxOutputTokens, - temperature: callSettings.temperature, - topP: callSettings.topP, - topK: callSettings.topK, - presencePenalty: callSettings.presencePenalty, - frequencyPenalty: callSettings.frequencyPenalty, - stopSequences: callSettings.stopSequences, - seed: callSettings.seed, - reasoning: callSettings.reasoning, - maxRetries, - timeout, - headers: headersWithUserAgent, - providerOptions, - output, - runtimeContext, - toolsContext - }; - const executeGenerateText = async () => { - var _a23; - await notify({ - event: generateTextStartEvent, - callbacks: [resolvedOnStart, telemetryDispatcher.onStart] - }); - try { - const initialMessages = initialPrompt.messages; - const initialResponseMessages = []; - const { approvedToolApprovals, deniedToolApprovals: collectedDeniedToolApprovals } = collectToolApprovals({ messages: initialMessages }); - const { approvedToolApprovals: localApprovedToolApprovals, deniedToolApprovals: revalidationDeniedToolApprovals } = await validateApprovedToolApprovals({ - approvedToolApprovals: approvedToolApprovals.filter((toolApproval2) => !toolApproval2.toolCall.providerExecuted), - tools, - toolApproval, - messages: initialMessages, - toolsContext, - runtimeContext, - toolApprovalSecret: experimental_toolApprovalSecret - }); - const deniedToolApprovals = [...collectedDeniedToolApprovals, ...revalidationDeniedToolApprovals]; - if (deniedToolApprovals.length > 0 || localApprovedToolApprovals.length > 0) { - const toolResults2 = await executeTools({ - toolCalls: localApprovedToolApprovals.map((toolApproval2) => toolApproval2.toolCall), - tools, - callId, - messages: initialMessages, - abortSignal: mergedAbortSignal, - timeout, - experimental_sandbox: sandbox, - toolsContext, - onToolExecutionStart: (event) => notify({ - event, - callbacks: [resolvedOnToolExecutionStart, telemetryDispatcher.onToolExecutionStart] - }), - onToolExecutionEnd: (event) => notify({ - event, - callbacks: [resolvedOnToolExecutionEnd, telemetryDispatcher.onToolExecutionEnd] - }), - executeToolInTelemetryContext: telemetryDispatcher.executeTool, - runInTracingChannelSpan - }); - const toolContent = []; - for (const result of toolResults2) { - const output2 = result.output; - const modelOutput = await createToolModelOutput({ - toolCallId: output2.toolCallId, - input: output2.input, - tool: getOwn(tools, output2.toolName), - output: output2.type === "tool-result" ? output2.output : output2.error, - errorMode: output2.type === "tool-error" ? "text" : "none" - }); - toolContent.push({ - type: "tool-result", - toolCallId: output2.toolCallId, - toolName: output2.toolName, - output: modelOutput - }); - } - for (const toolApproval2 of deniedToolApprovals) toolContent.push({ - type: "tool-result", - toolCallId: toolApproval2.toolCall.toolCallId, - toolName: toolApproval2.toolCall.toolName, - output: { - type: "execution-denied", - reason: toolApproval2.approvalResponse.reason, - ...toolApproval2.toolCall.providerExecuted && { providerOptions: { openai: { approvalId: toolApproval2.approvalResponse.approvalId } } } - } - }); - initialResponseMessages.push({ - role: "tool", - content: toolContent - }); - } - const callSettings2 = prepareLanguageModelCallOptions(settings); - let currentModelResponse; - let clientToolCalls = []; - let clientToolOutputs = []; - let toolApprovalResponses = []; - let deniedToolApprovalResponses = []; - const steps = []; - let instructionsForNextStep = initialPrompt.instructions; - let messagesForNextStep = [...initialMessages, ...initialResponseMessages]; - const pendingDeferredToolCalls = /* @__PURE__ */ new Map(); - do { - const stepTimeoutId = setAbortTimeout({ - abortController: stepAbortController, - label: "Step", - timeoutMs: stepTimeoutMs - }); - const stepNumber = steps.length; - try { - await runInTracingChannelSpan({ - type: "step", - event: { - callId, - stepNumber - }, - execute: async () => { - var _a24, _b2, _c2, _d2, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q; - const accumulatedResponseMessages = [...initialResponseMessages, ...steps.flatMap((step) => step.response.messages)]; - const stepInputMessages = messagesForNextStep; - const prepareStepResult = await (prepareStep == null ? void 0 : prepareStep({ - model, - steps, - stepNumber: steps.length, - instructions: instructionsForNextStep, - initialInstructions: initialPrompt.instructions, - messages: stepInputMessages, - initialMessages, - responseMessages: accumulatedResponseMessages, - runtimeContext, - toolsContext, - experimental_sandbox: sandbox - })); - const stepSandbox = (_a24 = prepareStepResult == null ? void 0 : prepareStepResult.experimental_sandbox) != null ? _a24 : sandbox; - const stepModel = resolveLanguageModel((_b2 = prepareStepResult == null ? void 0 : prepareStepResult.model) != null ? _b2 : model); - const stepInstructions = (_d2 = (_c2 = prepareStepResult == null ? void 0 : prepareStepResult.instructions) != null ? _c2 : prepareStepResult == null ? void 0 : prepareStepResult.system) != null ? _d2 : instructionsForNextStep; - const promptMessages = await convertToLanguageModelPrompt({ - prompt: { - instructions: stepInstructions, - messages: (_e = prepareStepResult == null ? void 0 : prepareStepResult.messages) != null ? _e : stepInputMessages - }, - supportedUrls: await stepModel.supportedUrls, - download: download2, - provider: stepModel.provider.split(".")[0] - }); - runtimeContext = (_f = prepareStepResult == null ? void 0 : prepareStepResult.runtimeContext) != null ? _f : runtimeContext; - toolsContext = (_g = prepareStepResult == null ? void 0 : prepareStepResult.toolsContext) != null ? _g : toolsContext; - const stepActiveTools = filterActiveTools({ - tools, - activeTools: (_h = prepareStepResult == null ? void 0 : prepareStepResult.activeTools) != null ? _h : activeTools - }); - const stepToolOrder = (_i = prepareStepResult == null ? void 0 : prepareStepResult.toolOrder) != null ? _i : toolOrder; - const stepTools = await prepareTools({ - tools: stepActiveTools, - toolOrder: stepToolOrder, - toolsContext, - experimental_sandbox: stepSandbox - }); - const stepToolChoice = prepareToolChoice({ toolChoice: (_j = prepareStepResult == null ? void 0 : prepareStepResult.toolChoice) != null ? _j : toolChoice }); - const stepMessages = (_k = prepareStepResult == null ? void 0 : prepareStepResult.messages) != null ? _k : stepInputMessages; - const stepProviderOptions = mergeObjects(providerOptions, prepareStepResult == null ? void 0 : prepareStepResult.providerOptions); - await notify({ - event: { - callId, - provider: stepModel.provider, - modelId: stepModel.modelId, - stepNumber, - instructions: stepInstructions, - messages: stepMessages, - tools, - toolChoice: (_l = prepareStepResult == null ? void 0 : prepareStepResult.toolChoice) != null ? _l : toolChoice, - activeTools: (_m = prepareStepResult == null ? void 0 : prepareStepResult.activeTools) != null ? _m : activeTools, - toolOrder: stepToolOrder, - steps: [...steps], - providerOptions: stepProviderOptions, - output, - runtimeContext, - promptMessages, - stepTools, - stepToolChoice, - toolsContext - }, - callbacks: [resolvedOnStepStart, telemetryDispatcher.onStepStart] - }); - const languageModelCallContext = { - provider: stepModel.provider, - modelId: stepModel.modelId, - instructions: stepInstructions, - messages: stepMessages, - tools: stepTools, - ...callSettings2 - }; - const languageModelCallStartEvent = { - callId, - ...languageModelCallContext - }; - const stepStartTimestampMs = now2(); - await notify({ - event: languageModelCallStartEvent, - callbacks: [resolvedOnLanguageModelCallStart, telemetryDispatcher.onLanguageModelCallStart] - }); - const executeLanguageModelCallInTelemetryContext = (_n = telemetryDispatcher.executeLanguageModelCall) != null ? _n : async ({ execute }) => await execute(); - currentModelResponse = await retry(async () => { - var _a25, _b3, _c3, _d3, _e2, _f2, _g2, _h2; - const result = await executeLanguageModelCallInTelemetryContext({ - ...languageModelCallStartEvent, - execute: async () => await stepModel.doGenerate({ - ...callSettings2, - tools: stepTools, - toolChoice: stepToolChoice, - responseFormat: await (output == null ? void 0 : output.responseFormat), - prompt: promptMessages, - providerOptions: stepProviderOptions, - abortSignal: mergedAbortSignal, - headers: headersWithUserAgent - }) - }); - const responseData = { - id: (_b3 = (_a25 = result.response) == null ? void 0 : _a25.id) != null ? _b3 : generateId2(), - timestamp: (_d3 = (_c3 = result.response) == null ? void 0 : _c3.timestamp) != null ? _d3 : /* @__PURE__ */ new Date(), - modelId: (_f2 = (_e2 = result.response) == null ? void 0 : _e2.modelId) != null ? _f2 : stepModel.modelId, - headers: (_g2 = result.response) == null ? void 0 : _g2.headers, - body: (_h2 = result.response) == null ? void 0 : _h2.body - }; - return { - ...result, - response: responseData - }; - }); - const responseTimeMs = now2() - stepStartTimestampMs; - const stepUsage = asLanguageModelUsage(currentModelResponse.usage); - const stepToolCalls = await Promise.all(currentModelResponse.content.filter((part) => part.type === "tool-call").map((toolCall) => parseToolCall({ - toolCall, - tools, - repairToolCall, - refineToolInput, - instructions: stepInstructions, - messages: stepMessages - }))); - const toolApprovalRequests = {}; - const stepToolApprovalResponses = {}; - const blockedToolCallIds = /* @__PURE__ */ new Set(); - const modelCallContent = asContent({ - content: currentModelResponse.content, - toolCalls: stepToolCalls, - toolOutputs: [], - toolApprovalRequests: [], - toolApprovalResponses: [], - tools - }); - await notify({ - event: { - callId, - provider: stepModel.provider, - modelId: stepModel.modelId, - finishReason: currentModelResponse.finishReason.unified, - usage: stepUsage, - content: modelCallContent, - responseId: currentModelResponse.response.id, - performance: { - responseTimeMs, - effectiveOutputTokensPerSecond: calculateTokensPerSecond({ - tokens: stepUsage.outputTokens, - durationMs: responseTimeMs - }), - outputTokensPerSecond: void 0, - inputTokensPerSecond: void 0, - effectiveTotalTokensPerSecond: calculateTokensPerSecond({ - tokens: sumTokenCounts(stepUsage.inputTokens, stepUsage.outputTokens), - durationMs: responseTimeMs - }), - timeToFirstOutputMs: void 0 - } - }, - callbacks: [resolvedOnLanguageModelCallEnd, telemetryDispatcher.onLanguageModelCallEnd] - }); - for (const toolCall of stepToolCalls) { - if (toolCall.invalid) continue; - const tool2 = getOwn(tools, toolCall.toolName); - if (tool2 == null) continue; - if ((tool2 == null ? void 0 : tool2.onInputAvailable) != null) await tool2.onInputAvailable({ - input: toolCall.input, - toolCallId: toolCall.toolCallId, - messages: stepMessages, - abortSignal: mergedAbortSignal, - context: runtimeContext - }); - const toolApprovalStatus = await resolveToolApproval({ - tools, - toolApproval, - toolCall, - messages: stepMessages, - toolsContext, - runtimeContext - }); - if (toolApprovalStatus.type === "not-applicable") continue; - const approvalId = generateId2(); - const signature = await maybeSignApproval({ - secret: experimental_toolApprovalSecret, - approvalId, - toolCallId: toolCall.toolCallId, - toolName: toolCall.toolName, - input: toolCall.input - }); - switch (toolApprovalStatus.type) { - case "user-approval": - toolApprovalRequests[toolCall.toolCallId] = { - type: "tool-approval-request", - approvalId, - toolCall, - ...signature != null ? { signature } : {} - }; - blockedToolCallIds.add(toolCall.toolCallId); - break; - case "approved": - toolApprovalRequests[toolCall.toolCallId] = { - type: "tool-approval-request", - approvalId, - toolCall, - isAutomatic: true, - ...signature != null ? { signature } : {} - }; - stepToolApprovalResponses[toolCall.toolCallId] = { - type: "tool-approval-response", - approvalId, - toolCall, - approved: true, - reason: toolApprovalStatus.reason, - providerExecuted: toolCall.providerExecuted - }; - break; - case "denied": - toolApprovalRequests[toolCall.toolCallId] = { - type: "tool-approval-request", - approvalId, - toolCall, - isAutomatic: true, - ...signature != null ? { signature } : {} - }; - stepToolApprovalResponses[toolCall.toolCallId] = { - type: "tool-approval-response", - approvalId, - toolCall, - approved: false, - reason: toolApprovalStatus.reason, - providerExecuted: toolCall.providerExecuted - }; - blockedToolCallIds.add(toolCall.toolCallId); - break; - } - } - const invalidToolCalls = stepToolCalls.filter((toolCall) => toolCall.invalid && toolCall.dynamic); - clientToolOutputs = []; - for (const toolCall of invalidToolCalls) clientToolOutputs.push({ - type: "tool-error", - toolCallId: toolCall.toolCallId, - toolName: toolCall.toolName, - input: toolCall.input, - error: getErrorMessage(toolCall.error), - dynamic: true - }); - clientToolCalls = stepToolCalls.filter((toolCall) => !toolCall.providerExecuted); - toolApprovalResponses = Object.values(stepToolApprovalResponses); - deniedToolApprovalResponses = toolApprovalResponses.filter((toolApprovalResponse) => toolApprovalResponse.approved === false); - const toolExecutionMs = {}; - if (tools != null) { - const toolExecutionResults = await executeTools({ - toolCalls: clientToolCalls.filter((toolCall) => !toolCall.invalid && !blockedToolCallIds.has(toolCall.toolCallId)), - tools, - callId, - messages: stepMessages, - abortSignal: mergedAbortSignal, - timeout, - experimental_sandbox: stepSandbox, - toolsContext, - onToolExecutionStart: (event) => notify({ - event, - callbacks: [resolvedOnToolExecutionStart, telemetryDispatcher.onToolExecutionStart] - }), - onToolExecutionEnd: (event) => notify({ - event, - callbacks: [resolvedOnToolExecutionEnd, telemetryDispatcher.onToolExecutionEnd] - }), - executeToolInTelemetryContext: telemetryDispatcher.executeTool, - runInTracingChannelSpan - }); - for (const result of toolExecutionResults) { - toolExecutionMs[result.output.toolCallId] = result.toolExecutionMs; - clientToolOutputs.push(result.output); - } - } - const stepTimeMs = now2() - stepStartTimestampMs; - const stepPerformance = { - effectiveOutputTokensPerSecond: calculateTokensPerSecond({ - tokens: stepUsage.outputTokens, - durationMs: responseTimeMs - }), - outputTokensPerSecond: void 0, - inputTokensPerSecond: void 0, - effectiveTotalTokensPerSecond: calculateTokensPerSecond({ - tokens: sumTokenCounts(stepUsage.inputTokens, stepUsage.outputTokens), - durationMs: responseTimeMs - }), - stepTimeMs, - responseTimeMs, - toolExecutionMs, - timeToFirstOutputMs: void 0 - }; - for (const toolCall of stepToolCalls) { - if (!toolCall.providerExecuted) continue; - const tool2 = getOwn(tools, toolCall.toolName); - if ((tool2 == null ? void 0 : tool2.type) === "provider" && tool2.supportsDeferredResults) { - if (!currentModelResponse.content.some((part) => part.type === "tool-result" && part.toolCallId === toolCall.toolCallId)) pendingDeferredToolCalls.set(toolCall.toolCallId, { toolName: toolCall.toolName }); - } - } - for (const part of currentModelResponse.content) if (part.type === "tool-result") pendingDeferredToolCalls.delete(part.toolCallId); - const stepContent = asContent({ - content: currentModelResponse.content, - toolCalls: stepToolCalls, - toolOutputs: clientToolOutputs, - toolApprovalRequests: Object.values(toolApprovalRequests), - toolApprovalResponses, - tools - }); - const stepResponseMessages = await toResponseMessages({ - content: stepContent, - tools - }); - const stepRequest = { - ...currentModelResponse.request, - body: include.requestBody ? (_o = currentModelResponse.request) == null ? void 0 : _o.body : void 0, - messages: include.requestMessages ? cloneModelMessages(stepMessages) : void 0 - }; - const stepResponse = { - ...currentModelResponse.response, - messages: cloneModelMessages(stepResponseMessages), - body: include.responseBody ? (_p = currentModelResponse.response) == null ? void 0 : _p.body : void 0 - }; - const currentStepResult = new DefaultStepResult({ - callId, - stepNumber, - provider: stepModel.provider, - modelId: stepModel.modelId, - runtimeContext, - content: stepContent, - finishReason: currentModelResponse.finishReason.unified, - rawFinishReason: currentModelResponse.finishReason.raw, - usage: stepUsage, - performance: stepPerformance, - warnings: currentModelResponse.warnings, - providerMetadata: currentModelResponse.providerMetadata, - request: stepRequest, - response: stepResponse, - toolsContext - }); - logWarnings({ - warnings: (_q = currentModelResponse.warnings) != null ? _q : [], - provider: stepModel.provider, - model: stepModel.modelId - }); - steps.push(currentStepResult); - instructionsForNextStep = stepInstructions; - messagesForNextStep = [...stepMessages, ...stepResponseMessages]; - await notify({ - event: currentStepResult, - callbacks: [resolvedOnStepEnd, telemetryDispatcher.onStepEnd] - }); - return currentStepResult; - } - }); - } finally { - if (stepTimeoutId != null) clearTimeout(stepTimeoutId); - } - } while ((clientToolCalls.length > 0 && clientToolOutputs.length + deniedToolApprovalResponses.length === clientToolCalls.length || pendingDeferredToolCalls.size > 0) && !await isStopConditionMet({ - stopConditions, - steps - })); - const lastStep = steps[steps.length - 1]; - const totalUsage = steps.reduce((totalUsage2, step) => { - return addLanguageModelUsage(totalUsage2, step.usage); - }, { - inputTokens: void 0, - inputTokenDetails: { - noCacheTokens: void 0, - cacheReadTokens: void 0, - cacheWriteTokens: void 0 - }, - outputTokens: void 0, - outputTokenDetails: { - textTokens: void 0, - reasoningTokens: void 0 - }, - totalTokens: void 0 - }); - const files = steps.flatMap((step) => step.files); - const sources = steps.flatMap((step) => step.sources); - const toolCalls = steps.flatMap((step) => step.toolCalls); - const staticToolCalls = steps.flatMap((step) => step.staticToolCalls); - const dynamicToolCalls = steps.flatMap((step) => step.dynamicToolCalls); - const toolResults = steps.flatMap((step) => step.toolResults); - const staticToolResults = steps.flatMap((step) => step.staticToolResults); - const dynamicToolResults = steps.flatMap((step) => step.dynamicToolResults); - const warnings = steps.flatMap((step) => { - var _a24; - return (_a24 = step.warnings) != null ? _a24 : []; - }); - await notify({ - event: { - callId, - stepNumber: lastStep.stepNumber, - model: lastStep.model, - runtimeContext: lastStep.runtimeContext, - finishReason: lastStep.finishReason, - rawFinishReason: lastStep.rawFinishReason, - usage: totalUsage, - totalUsage, - content: steps.flatMap((step) => step.content), - text: lastStep.text, - reasoning: lastStep.reasoning, - reasoningText: lastStep.reasoningText, - files, - sources, - toolCalls, - staticToolCalls, - dynamicToolCalls, - toolResults, - staticToolResults, - dynamicToolResults, - responseMessages: [...initialResponseMessages, ...steps.flatMap((step) => step.response.messages)], - warnings, - request: lastStep.request, - response: lastStep.response, - providerMetadata: lastStep.providerMetadata, - steps, - finalStep: lastStep, - toolsContext - }, - callbacks: [onEnd, telemetryDispatcher.onEnd] - }); - let resolvedOutput; - if (lastStep.finishReason === "stop") resolvedOutput = await (output != null ? output : text()).parseCompleteOutput({ text: lastStep.text }, { - response: lastStep.response, - usage: lastStep.usage, - finishReason: lastStep.finishReason - }); - return new DefaultGenerateTextResult({ - initialResponseMessages, - steps, - totalUsage, - output: resolvedOutput - }); - } catch (error) { - await ((_a23 = telemetryDispatcher.onError) == null ? void 0 : _a23.call(telemetryDispatcher, { - callId, - error - })); - throw wrapGatewayError(error); - } - }; - return await runInTracingChannelSpan({ - type: "generateText", - event: generateTextStartEvent, - execute: executeGenerateText - }); -} -async function executeTools({ toolCalls, tools, callId, messages, abortSignal, timeout, experimental_sandbox: sandbox, toolsContext, onToolExecutionStart, onToolExecutionEnd, executeToolInTelemetryContext, runInTracingChannelSpan }) { - return (await Promise.all(toolCalls.map(async (toolCall) => await executeToolCall({ - toolCall, - tools, - callId, - messages, - abortSignal, - timeout, - experimental_sandbox: sandbox, - toolsContext, - onToolExecutionStart, - onToolExecutionEnd, - executeToolInTelemetryContext, - runInTracingChannelSpan - })))).filter((result) => result != null); -} -var DefaultGenerateTextResult = class { - constructor(options) { - this.initialResponseMessages = options.initialResponseMessages; - this.steps = options.steps; - this._output = options.output; - this.totalUsage = options.totalUsage; - } - get finalStep() { - return this.steps.at(-1); - } - get content() { - return this.steps.flatMap((step) => step.content); - } - get text() { - return this.finalStep.text; - } - get files() { - return this.steps.flatMap((step) => step.files); - } - get reasoningText() { - return this.finalStep.reasoningText; - } - get reasoning() { - return convertToReasoningOutputs(this.finalStep.reasoning); - } - get toolCalls() { - return this.steps.flatMap((step) => step.toolCalls); - } - get staticToolCalls() { - return this.steps.flatMap((step) => step.staticToolCalls); - } - get dynamicToolCalls() { - return this.steps.flatMap((step) => step.dynamicToolCalls); - } - get toolResults() { - return this.steps.flatMap((step) => step.toolResults); - } - get staticToolResults() { - return this.steps.flatMap((step) => step.staticToolResults); - } - get dynamicToolResults() { - return this.steps.flatMap((step) => step.dynamicToolResults); - } - get sources() { - return this.steps.flatMap((step) => step.sources); - } - get finishReason() { - return this.finalStep.finishReason; - } - get rawFinishReason() { - return this.finalStep.rawFinishReason; - } - get warnings() { - return this.steps.flatMap((step) => { - var _a22; - return (_a22 = step.warnings) != null ? _a22 : []; - }); - } - get providerMetadata() { - return this.finalStep.providerMetadata; - } - get response() { - return this.finalStep.response; - } - get responseMessages() { - return [...this.initialResponseMessages, ...this.steps.flatMap((step) => step.response.messages)]; - } - get request() { - return this.finalStep.request; - } - get usage() { - return this.totalUsage; - } - get output() { - if (this._output == null) throw new NoOutputGeneratedError(); - return this._output; - } -}; -function asContent({ content, toolCalls, toolOutputs, toolApprovalRequests, toolApprovalResponses, tools }) { - const contentParts = []; - const toolOutputsWithApprovalResponses = []; - const toolOutputsWithoutApprovalResponses = []; - const toolCallIdsWithApprovalResponses = new Set(toolApprovalResponses.map((toolApprovalResponse) => toolApprovalResponse.toolCall.toolCallId)); - for (const part of content) switch (part.type) { - case "text": - case "reasoning": - case "custom": - case "source": - contentParts.push(part); - break; - case "file": - case "reasoning-file": - contentParts.push({ - type: part.type, - file: new DefaultGeneratedFile({ - data: part.data.type === "data" ? part.data.data : part.data.url.toString(), - mediaType: part.mediaType - }), - ...part.providerMetadata != null ? { providerMetadata: part.providerMetadata } : {} - }); - break; - case "tool-call": - contentParts.push(toolCalls.find((toolCall) => toolCall.toolCallId === part.toolCallId)); - break; - case "tool-result": { - const toolCall = toolCalls.find((toolCall2) => toolCall2.toolCallId === part.toolCallId); - if (toolCall == null) { - const tool2 = getOwn(tools, part.toolName); - if (!((tool2 == null ? void 0 : tool2.type) === "provider" && tool2.supportsDeferredResults)) throw new Error(`Tool call ${part.toolCallId} not found.`); - if (part.isError) contentParts.push({ - type: "tool-error", - toolCallId: part.toolCallId, - toolName: part.toolName, - input: void 0, - error: part.result, - providerExecuted: true, - dynamic: part.dynamic, - ...part.providerMetadata != null ? { providerMetadata: part.providerMetadata } : {}, - ...(tool2 == null ? void 0 : tool2.metadata) != null ? { toolMetadata: tool2.metadata } : {} - }); - else contentParts.push({ - type: "tool-result", - toolCallId: part.toolCallId, - toolName: part.toolName, - input: void 0, - output: part.result, - providerExecuted: true, - dynamic: part.dynamic, - ...part.providerMetadata != null ? { providerMetadata: part.providerMetadata } : {}, - ...(tool2 == null ? void 0 : tool2.metadata) != null ? { toolMetadata: tool2.metadata } : {} - }); - break; - } - if (part.isError) contentParts.push({ - type: "tool-error", - toolCallId: part.toolCallId, - toolName: part.toolName, - input: toolCall.input, - error: part.result, - providerExecuted: true, - dynamic: toolCall.dynamic, - ...part.providerMetadata != null ? { providerMetadata: part.providerMetadata } : {}, - ...toolCall.toolMetadata != null ? { toolMetadata: toolCall.toolMetadata } : {} - }); - else contentParts.push({ - type: "tool-result", - toolCallId: part.toolCallId, - toolName: part.toolName, - input: toolCall.input, - output: part.result, - providerExecuted: true, - dynamic: toolCall.dynamic, - ...part.providerMetadata != null ? { providerMetadata: part.providerMetadata } : {}, - ...toolCall.toolMetadata != null ? { toolMetadata: toolCall.toolMetadata } : {} - }); - break; - } - case "tool-approval-request": { - const toolCall = toolCalls.find((toolCall2) => toolCall2.toolCallId === part.toolCallId); - if (toolCall == null) throw new ToolCallNotFoundForApprovalError({ - toolCallId: part.toolCallId, - approvalId: part.approvalId - }); - contentParts.push({ - type: "tool-approval-request", - approvalId: part.approvalId, - toolCall - }); - break; - } - } - for (const toolOutput of toolOutputs) if (toolCallIdsWithApprovalResponses.has(toolOutput.toolCallId)) toolOutputsWithApprovalResponses.push(toolOutput); - else toolOutputsWithoutApprovalResponses.push(toolOutput); - return [ - ...contentParts, - ...toolOutputsWithoutApprovalResponses, - ...toolApprovalRequests, - ...toolApprovalResponses, - ...toolOutputsWithApprovalResponses - ]; -} -function prepareHeaders(headers, defaultHeaders) { - const responseHeaders = new Headers(headers != null ? headers : {}); - for (const [key, value] of Object.entries(defaultHeaders)) if (!responseHeaders.has(key)) responseHeaders.set(key, value); - return responseHeaders; -} -function createTextStreamResponse({ status, statusText, headers, stream }) { - return new Response(stream.pipeThrough(new TextEncoderStream()), { - status: status != null ? status : 200, - statusText, - headers: prepareHeaders(headers, { "content-type": "text/plain; charset=utf-8" }) - }); -} -function writeToServerResponse({ response, status, statusText, headers, stream }) { - const statusCode = status != null ? status : 200; - if (statusText !== void 0) response.writeHead(statusCode, statusText, headers); - else response.writeHead(statusCode, headers); - const reader = stream.getReader(); - const read = async () => { - try { - while (true) { - const { done, value } = await reader.read(); - if (done) break; - const canContinue = response.write(value); - const flush = response.flush; - if (typeof flush === "function") flush.call(response); - if (!canContinue) await new Promise((resolve3) => { - response.once("drain", resolve3); - }); - } - } catch (error) { - throw error; - } finally { - response.end(); - } - }; - read(); -} -function pipeTextStreamToResponse({ response, status, statusText, headers, stream }) { - writeToServerResponse({ - response, - status, - statusText, - headers: Object.fromEntries(prepareHeaders(headers, { "content-type": "text/plain; charset=utf-8" }).entries()), - stream: stream.pipeThrough(new TextEncoderStream()) - }); -} -function toTextStream({ stream }) { - return stream.pipeThrough(new TransformStream({ transform(part, controller) { - if (part.type === "text-delta") controller.enqueue(part.text); - } })); -} -var JsonToSseTransformStream = class extends TransformStream { - constructor() { - super({ - transform(part, controller) { - controller.enqueue(`data: ${JSON.stringify(part)} - -`); - }, - flush(controller) { - controller.enqueue("data: [DONE]\n\n"); - } - }); - } -}; -var UI_MESSAGE_STREAM_HEADERS = { - "content-type": "text/event-stream", - "cache-control": "no-cache", - connection: "keep-alive", - "x-vercel-ai-ui-message-stream": "v1", - "x-accel-buffering": "no" -}; -function createUIMessageStreamResponse({ status, statusText, headers, stream, consumeSseStream }) { - let sseStream = stream.pipeThrough(new JsonToSseTransformStream()); - if (consumeSseStream) { - const [stream1, stream2] = sseStream.tee(); - sseStream = stream1; - consumeSseStream({ stream: stream2 }); - } - return new Response(sseStream.pipeThrough(new TextEncoderStream()), { - status, - statusText, - headers: prepareHeaders(headers, UI_MESSAGE_STREAM_HEADERS) - }); -} -function pipeUIMessageStreamToResponse({ response, status, statusText, headers, stream, consumeSseStream }) { - let sseStream = stream.pipeThrough(new JsonToSseTransformStream()); - if (consumeSseStream) { - const [stream1, stream2] = sseStream.tee(); - sseStream = stream1; - consumeSseStream({ stream: stream2 }); - } - writeToServerResponse({ - response, - status, - statusText, - headers: Object.fromEntries(prepareHeaders(headers, UI_MESSAGE_STREAM_HEADERS).entries()), - stream: sseStream.pipeThrough(new TextEncoderStream()) - }); -} -function getResponseUIMessageId({ originalMessages, responseMessageId }) { - if (originalMessages == null) return; - const lastMessage = originalMessages[originalMessages.length - 1]; - return (lastMessage == null ? void 0 : lastMessage.role) === "assistant" ? lastMessage.id : typeof responseMessageId === "function" ? responseMessageId() : responseMessageId; -} -var toolMetadataSchema = record(string(), jsonValueSchema.optional()); -lazySchema(() => zodSchema(union([ - strictObject({ - type: literal("text-start"), - id: string(), - providerMetadata: providerMetadataSchema.optional() - }), - strictObject({ - type: literal("text-delta"), - id: string(), - delta: string(), - providerMetadata: providerMetadataSchema.optional() - }), - strictObject({ - type: literal("text-end"), - id: string(), - providerMetadata: providerMetadataSchema.optional() - }), - strictObject({ - type: literal("error"), - errorText: string() - }), - strictObject({ - type: literal("tool-input-start"), - toolCallId: string(), - toolName: string(), - providerExecuted: boolean().optional(), - providerMetadata: providerMetadataSchema.optional(), - toolMetadata: toolMetadataSchema.optional(), - dynamic: boolean().optional(), - title: string().optional() - }), - strictObject({ - type: literal("tool-input-delta"), - toolCallId: string(), - inputTextDelta: string() - }), - strictObject({ - type: literal("tool-input-available"), - toolCallId: string(), - toolName: string(), - input: unknown(), - providerExecuted: boolean().optional(), - providerMetadata: providerMetadataSchema.optional(), - toolMetadata: toolMetadataSchema.optional(), - dynamic: boolean().optional(), - title: string().optional() - }), - strictObject({ - type: literal("tool-input-error"), - toolCallId: string(), - toolName: string(), - input: unknown(), - providerExecuted: boolean().optional(), - providerMetadata: providerMetadataSchema.optional(), - toolMetadata: toolMetadataSchema.optional(), - dynamic: boolean().optional(), - errorText: string(), - title: string().optional() - }), - strictObject({ - type: literal("tool-approval-request"), - approvalId: string(), - toolCallId: string(), - isAutomatic: boolean().optional(), - signature: string().optional() - }), - strictObject({ - type: literal("tool-approval-response"), - approvalId: string(), - approved: boolean(), - reason: string().optional(), - providerExecuted: boolean().optional(), - providerMetadata: providerMetadataSchema.optional() - }), - strictObject({ - type: literal("tool-output-available"), - toolCallId: string(), - output: unknown(), - providerExecuted: boolean().optional(), - providerMetadata: providerMetadataSchema.optional(), - toolMetadata: toolMetadataSchema.optional(), - dynamic: boolean().optional(), - preliminary: boolean().optional() - }), - strictObject({ - type: literal("tool-output-error"), - toolCallId: string(), - errorText: string(), - providerExecuted: boolean().optional(), - providerMetadata: providerMetadataSchema.optional(), - toolMetadata: toolMetadataSchema.optional(), - dynamic: boolean().optional() - }), - strictObject({ - type: literal("tool-output-denied"), - toolCallId: string() - }), - strictObject({ - type: literal("reasoning-start"), - id: string(), - providerMetadata: providerMetadataSchema.optional() - }), - strictObject({ - type: literal("reasoning-delta"), - id: string(), - delta: string(), - providerMetadata: providerMetadataSchema.optional() - }), - strictObject({ - type: literal("reasoning-end"), - id: string(), - providerMetadata: providerMetadataSchema.optional() - }), - strictObject({ - type: literal("custom"), - kind: string().transform((value) => value), - providerMetadata: providerMetadataSchema.optional() - }), - strictObject({ - type: literal("source-url"), - sourceId: string(), - url: string(), - title: string().optional(), - providerMetadata: providerMetadataSchema.optional() - }), - strictObject({ - type: literal("source-document"), - sourceId: string(), - mediaType: string(), - title: string(), - filename: string().optional(), - providerMetadata: providerMetadataSchema.optional() - }), - strictObject({ - type: literal("file"), - url: string(), - mediaType: string(), - providerMetadata: providerMetadataSchema.optional() - }), - strictObject({ - type: literal("reasoning-file"), - url: string(), - mediaType: string(), - providerMetadata: providerMetadataSchema.optional() - }), - strictObject({ - type: custom((value) => typeof value === "string" && value.startsWith("data-"), { message: "Type must start with \"data-\"" }), - id: string().optional(), - data: unknown(), - transient: boolean().optional() - }), - strictObject({ type: literal("start-step") }), - strictObject({ type: literal("finish-step") }), - strictObject({ - type: literal("start"), - messageId: string().optional(), - messageMetadata: unknown().optional() - }), - strictObject({ - type: literal("finish"), - finishReason: _enum([ - "stop", - "length", - "content-filter", - "tool-calls", - "error", - "other" - ]).optional(), - messageMetadata: unknown().optional() - }), - strictObject({ - type: literal("abort"), - reason: string().optional() - }), - strictObject({ - type: literal("message-metadata"), - messageMetadata: unknown() - }) -]))); -function isDataUIMessageChunk(chunk) { - return chunk.type.startsWith("data-"); -} -function createIdMap() { - return /* @__PURE__ */ Object.create(null); -} -function isStaticToolUIPart(part) { - return part.type.startsWith("tool-"); -} -function isDynamicToolUIPart(part) { - return part.type === "dynamic-tool"; -} -function isToolUIPart(part) { - return isStaticToolUIPart(part) || isDynamicToolUIPart(part); -} -function getStaticToolName(part) { - return part.type.split("-").slice(1).join("-"); -} -function createStreamingUIMessageState({ lastMessage, messageId }) { - return { - message: (lastMessage == null ? void 0 : lastMessage.role) === "assistant" ? lastMessage : { - id: messageId, - metadata: void 0, - role: "assistant", - parts: [] - }, - activeTextParts: createIdMap(), - activeReasoningParts: createIdMap(), - partialToolCalls: createIdMap() - }; -} -function processUIMessageStream({ stream, messageMetadataSchema, dataPartSchemas, runUpdateMessageJob, onError, onToolCall, onData }) { - return stream.pipeThrough(new TransformStream({ async transform(chunk, controller) { - await runUpdateMessageJob(async ({ state, write }) => { - var _a22, _b, _c, _d; - function getToolInvocation(toolCallId) { - const toolInvocation = state.message.parts.filter(isToolUIPart).find((invocation) => invocation.toolCallId === toolCallId); - if (toolInvocation == null) throw new UIMessageStreamError({ - chunkType: "tool-invocation", - chunkId: toolCallId, - message: `No tool invocation found for tool call ID "${toolCallId}".` - }); - return toolInvocation; - } - function getToolInvocationByApprovalId(approvalId) { - const toolInvocation = state.message.parts.filter(isToolUIPart).find((invocation) => { - var _a23; - return ((_a23 = invocation.approval) == null ? void 0 : _a23.id) === approvalId; - }); - if (toolInvocation == null) throw new UIMessageStreamError({ - chunkType: "tool-approval-response", - chunkId: approvalId, - message: `No tool invocation found for approval ID "${approvalId}".` - }); - return toolInvocation; - } - function updateToolPart(options) { - var _a23; - const part = state.message.parts.find((part2) => isStaticToolUIPart(part2) && part2.toolCallId === options.toolCallId); - const anyOptions = options; - const anyPart = part; - if (part != null) { - part.state = options.state; - anyPart.input = anyOptions.input; - anyPart.output = anyOptions.output; - anyPart.errorText = anyOptions.errorText; - anyPart.rawInput = anyOptions.rawInput; - anyPart.preliminary = anyOptions.preliminary; - if (options.title !== void 0) anyPart.title = options.title; - if (options.toolMetadata !== void 0) anyPart.toolMetadata = options.toolMetadata; - anyPart.providerExecuted = (_a23 = anyOptions.providerExecuted) != null ? _a23 : part.providerExecuted; - const providerMetadata = anyOptions.providerMetadata; - if (providerMetadata != null) if (options.state === "output-available" || options.state === "output-error") { - const resultPart = part; - resultPart.resultProviderMetadata = providerMetadata; - } else part.callProviderMetadata = providerMetadata; - } else state.message.parts.push({ - type: `tool-${options.toolName}`, - toolCallId: options.toolCallId, - state: options.state, - title: options.title, - ...options.toolMetadata !== void 0 ? { toolMetadata: options.toolMetadata } : {}, - input: anyOptions.input, - output: anyOptions.output, - rawInput: anyOptions.rawInput, - errorText: anyOptions.errorText, - providerExecuted: anyOptions.providerExecuted, - preliminary: anyOptions.preliminary, - ...anyOptions.providerMetadata != null && (options.state === "output-available" || options.state === "output-error") ? { resultProviderMetadata: anyOptions.providerMetadata } : {}, - ...anyOptions.providerMetadata != null && !(options.state === "output-available" || options.state === "output-error") ? { callProviderMetadata: anyOptions.providerMetadata } : {} - }); - } - function updateDynamicToolPart(options) { - var _a23, _b2; - const part = state.message.parts.find((part2) => part2.type === "dynamic-tool" && part2.toolCallId === options.toolCallId); - const anyOptions = options; - const anyPart = part; - if (part != null) { - part.state = options.state; - anyPart.toolName = options.toolName; - anyPart.input = anyOptions.input; - anyPart.output = anyOptions.output; - anyPart.errorText = anyOptions.errorText; - anyPart.rawInput = (_a23 = anyOptions.rawInput) != null ? _a23 : anyPart.rawInput; - anyPart.preliminary = anyOptions.preliminary; - if (options.title !== void 0) anyPart.title = options.title; - if (options.toolMetadata !== void 0) anyPart.toolMetadata = options.toolMetadata; - anyPart.providerExecuted = (_b2 = anyOptions.providerExecuted) != null ? _b2 : part.providerExecuted; - const providerMetadata = anyOptions.providerMetadata; - if (providerMetadata != null) if (options.state === "output-available" || options.state === "output-error") { - const resultPart = part; - resultPart.resultProviderMetadata = providerMetadata; - } else part.callProviderMetadata = providerMetadata; - } else state.message.parts.push({ - type: "dynamic-tool", - toolName: options.toolName, - toolCallId: options.toolCallId, - state: options.state, - input: anyOptions.input, - output: anyOptions.output, - errorText: anyOptions.errorText, - preliminary: anyOptions.preliminary, - providerExecuted: anyOptions.providerExecuted, - title: options.title, - ...options.toolMetadata !== void 0 ? { toolMetadata: options.toolMetadata } : {}, - ...anyOptions.providerMetadata != null && (options.state === "output-available" || options.state === "output-error") ? { resultProviderMetadata: anyOptions.providerMetadata } : {}, - ...anyOptions.providerMetadata != null && !(options.state === "output-available" || options.state === "output-error") ? { callProviderMetadata: anyOptions.providerMetadata } : {} - }); - } - async function updateMessageMetadata(metadata) { - if (metadata != null) { - const mergedMetadata = state.message.metadata != null ? mergeObjects(state.message.metadata, metadata) : metadata; - if (messageMetadataSchema != null) await validateTypes({ - value: mergedMetadata, - schema: messageMetadataSchema, - context: { - field: "message.metadata", - entityId: state.message.id - } - }); - state.message.metadata = mergedMetadata; - } - } - switch (chunk.type) { - case "text-start": { - const textPart = { - type: "text", - text: "", - providerMetadata: chunk.providerMetadata, - state: "streaming" - }; - state.activeTextParts[chunk.id] = textPart; - state.message.parts.push(textPart); - write(); - break; - } - case "text-delta": { - const textPart = state.activeTextParts[chunk.id]; - if (textPart == null) throw new UIMessageStreamError({ - chunkType: "text-delta", - chunkId: chunk.id, - message: `Received text-delta for missing text part with ID "${chunk.id}". Ensure a "text-start" chunk is sent before any "text-delta" chunks.` - }); - textPart.text += chunk.delta; - textPart.providerMetadata = (_a22 = chunk.providerMetadata) != null ? _a22 : textPart.providerMetadata; - write(); - break; - } - case "text-end": { - const textPart = state.activeTextParts[chunk.id]; - if (textPart == null) throw new UIMessageStreamError({ - chunkType: "text-end", - chunkId: chunk.id, - message: `Received text-end for missing text part with ID "${chunk.id}". Ensure a "text-start" chunk is sent before any "text-end" chunks.` - }); - textPart.state = "done"; - textPart.providerMetadata = (_b = chunk.providerMetadata) != null ? _b : textPart.providerMetadata; - delete state.activeTextParts[chunk.id]; - write(); - break; - } - case "custom": { - const customPart = { - type: "custom", - kind: chunk.kind, - providerMetadata: chunk.providerMetadata - }; - state.message.parts.push(customPart); - write(); - break; - } - case "reasoning-start": { - const reasoningPart = { - type: "reasoning", - text: "", - providerMetadata: chunk.providerMetadata, - state: "streaming" - }; - state.activeReasoningParts[chunk.id] = reasoningPart; - state.message.parts.push(reasoningPart); - write(); - break; - } - case "reasoning-delta": { - const reasoningPart = state.activeReasoningParts[chunk.id]; - if (reasoningPart == null) throw new UIMessageStreamError({ - chunkType: "reasoning-delta", - chunkId: chunk.id, - message: `Received reasoning-delta for missing reasoning part with ID "${chunk.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-delta" chunks.` - }); - reasoningPart.text += chunk.delta; - reasoningPart.providerMetadata = (_c = chunk.providerMetadata) != null ? _c : reasoningPart.providerMetadata; - write(); - break; - } - case "reasoning-end": { - const reasoningPart = state.activeReasoningParts[chunk.id]; - if (reasoningPart == null) throw new UIMessageStreamError({ - chunkType: "reasoning-end", - chunkId: chunk.id, - message: `Received reasoning-end for missing reasoning part with ID "${chunk.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-end" chunks.` - }); - reasoningPart.providerMetadata = (_d = chunk.providerMetadata) != null ? _d : reasoningPart.providerMetadata; - reasoningPart.state = "done"; - delete state.activeReasoningParts[chunk.id]; - write(); - break; - } - case "file": - case "reasoning-file": - state.message.parts.push({ - type: chunk.type, - mediaType: chunk.mediaType, - url: chunk.url, - ...chunk.providerMetadata != null ? { providerMetadata: chunk.providerMetadata } : {} - }); - write(); - break; - case "source-url": - state.message.parts.push({ - type: "source-url", - sourceId: chunk.sourceId, - url: chunk.url, - title: chunk.title, - providerMetadata: chunk.providerMetadata - }); - write(); - break; - case "source-document": - state.message.parts.push({ - type: "source-document", - sourceId: chunk.sourceId, - mediaType: chunk.mediaType, - title: chunk.title, - filename: chunk.filename, - providerMetadata: chunk.providerMetadata - }); - write(); - break; - case "tool-input-start": { - const toolInvocations = state.message.parts.filter(isStaticToolUIPart); - state.partialToolCalls[chunk.toolCallId] = { - text: "", - toolName: chunk.toolName, - index: toolInvocations.length, - dynamic: chunk.dynamic, - title: chunk.title, - toolMetadata: chunk.toolMetadata - }; - if (chunk.dynamic) updateDynamicToolPart({ - toolCallId: chunk.toolCallId, - toolName: chunk.toolName, - state: "input-streaming", - input: void 0, - providerExecuted: chunk.providerExecuted, - title: chunk.title, - toolMetadata: chunk.toolMetadata, - providerMetadata: chunk.providerMetadata - }); - else updateToolPart({ - toolCallId: chunk.toolCallId, - toolName: chunk.toolName, - state: "input-streaming", - input: void 0, - providerExecuted: chunk.providerExecuted, - title: chunk.title, - toolMetadata: chunk.toolMetadata, - providerMetadata: chunk.providerMetadata - }); - write(); - break; - } - case "tool-input-delta": { - const partialToolCall = state.partialToolCalls[chunk.toolCallId]; - if (partialToolCall == null) throw new UIMessageStreamError({ - chunkType: "tool-input-delta", - chunkId: chunk.toolCallId, - message: `Received tool-input-delta for missing tool call with ID "${chunk.toolCallId}". Ensure a "tool-input-start" chunk is sent before any "tool-input-delta" chunks.` - }); - partialToolCall.text += chunk.inputTextDelta; - const { value: partialArgs } = await parsePartialJson(partialToolCall.text); - if (partialToolCall.dynamic) updateDynamicToolPart({ - toolCallId: chunk.toolCallId, - toolName: partialToolCall.toolName, - state: "input-streaming", - input: partialArgs, - title: partialToolCall.title, - toolMetadata: partialToolCall.toolMetadata - }); - else updateToolPart({ - toolCallId: chunk.toolCallId, - toolName: partialToolCall.toolName, - state: "input-streaming", - input: partialArgs, - title: partialToolCall.title, - toolMetadata: partialToolCall.toolMetadata - }); - write(); - break; - } - case "tool-input-available": - if (chunk.dynamic) updateDynamicToolPart({ - toolCallId: chunk.toolCallId, - toolName: chunk.toolName, - state: "input-available", - input: chunk.input, - providerExecuted: chunk.providerExecuted, - providerMetadata: chunk.providerMetadata, - title: chunk.title, - toolMetadata: chunk.toolMetadata - }); - else updateToolPart({ - toolCallId: chunk.toolCallId, - toolName: chunk.toolName, - state: "input-available", - input: chunk.input, - providerExecuted: chunk.providerExecuted, - providerMetadata: chunk.providerMetadata, - title: chunk.title, - toolMetadata: chunk.toolMetadata - }); - write(); - if (onToolCall && !chunk.providerExecuted) await onToolCall({ toolCall: chunk }); - break; - case "tool-input-error": { - const existingPart = state.message.parts.filter(isToolUIPart).find((p) => p.toolCallId === chunk.toolCallId); - if (existingPart != null ? existingPart.type === "dynamic-tool" : !!chunk.dynamic) updateDynamicToolPart({ - toolCallId: chunk.toolCallId, - toolName: chunk.toolName, - state: "output-error", - input: chunk.input, - errorText: chunk.errorText, - providerExecuted: chunk.providerExecuted, - providerMetadata: chunk.providerMetadata, - toolMetadata: chunk.toolMetadata - }); - else updateToolPart({ - toolCallId: chunk.toolCallId, - toolName: chunk.toolName, - state: "output-error", - input: void 0, - rawInput: chunk.input, - errorText: chunk.errorText, - providerExecuted: chunk.providerExecuted, - providerMetadata: chunk.providerMetadata, - toolMetadata: chunk.toolMetadata - }); - write(); - break; - } - case "tool-approval-request": { - const toolInvocation = getToolInvocation(chunk.toolCallId); - toolInvocation.state = "approval-requested"; - toolInvocation.approval = { - id: chunk.approvalId, - ...chunk.isAutomatic === true ? { isAutomatic: true } : {}, - ...chunk.signature != null ? { signature: chunk.signature } : {} - }; - write(); - break; - } - case "tool-approval-response": { - const toolInvocation = getToolInvocationByApprovalId(chunk.approvalId); - const approval = toolInvocation.approval == null ? { id: chunk.approvalId } : toolInvocation.approval; - toolInvocation.state = "approval-responded"; - toolInvocation.approval = { - id: chunk.approvalId, - approved: chunk.approved, - ...chunk.reason != null ? { reason: chunk.reason } : {}, - ...approval.isAutomatic === true ? { isAutomatic: true } : {}, - ...approval.signature != null ? { signature: approval.signature } : {} - }; - if (chunk.providerExecuted != null) toolInvocation.providerExecuted = chunk.providerExecuted; - if (chunk.providerMetadata != null) toolInvocation.callProviderMetadata = chunk.providerMetadata; - write(); - break; - } - case "tool-output-denied": { - const toolInvocation = getToolInvocation(chunk.toolCallId); - toolInvocation.state = "output-denied"; - write(); - break; - } - case "tool-output-available": { - const toolInvocation = getToolInvocation(chunk.toolCallId); - if (toolInvocation.type === "dynamic-tool") updateDynamicToolPart({ - toolCallId: chunk.toolCallId, - toolName: toolInvocation.toolName, - state: "output-available", - input: toolInvocation.input, - output: chunk.output, - preliminary: chunk.preliminary, - providerExecuted: chunk.providerExecuted, - providerMetadata: chunk.providerMetadata, - title: toolInvocation.title, - toolMetadata: toolInvocation.toolMetadata - }); - else updateToolPart({ - toolCallId: chunk.toolCallId, - toolName: getStaticToolName(toolInvocation), - state: "output-available", - input: toolInvocation.input, - output: chunk.output, - providerExecuted: chunk.providerExecuted, - preliminary: chunk.preliminary, - providerMetadata: chunk.providerMetadata, - title: toolInvocation.title, - toolMetadata: toolInvocation.toolMetadata - }); - write(); - break; - } - case "tool-output-error": { - const toolInvocation = getToolInvocation(chunk.toolCallId); - if (toolInvocation.type === "dynamic-tool") updateDynamicToolPart({ - toolCallId: chunk.toolCallId, - toolName: toolInvocation.toolName, - state: "output-error", - input: toolInvocation.input, - errorText: chunk.errorText, - providerExecuted: chunk.providerExecuted, - providerMetadata: chunk.providerMetadata, - title: toolInvocation.title, - toolMetadata: toolInvocation.toolMetadata - }); - else updateToolPart({ - toolCallId: chunk.toolCallId, - toolName: getStaticToolName(toolInvocation), - state: "output-error", - input: toolInvocation.input, - rawInput: toolInvocation.rawInput, - errorText: chunk.errorText, - providerExecuted: chunk.providerExecuted, - providerMetadata: chunk.providerMetadata, - title: toolInvocation.title, - toolMetadata: toolInvocation.toolMetadata - }); - write(); - break; - } - case "start-step": - state.message.parts.push({ type: "step-start" }); - break; - case "finish-step": - state.activeTextParts = createIdMap(); - state.activeReasoningParts = createIdMap(); - break; - case "start": - if (chunk.messageId != null) state.message.id = chunk.messageId; - await updateMessageMetadata(chunk.messageMetadata); - if (chunk.messageId != null || chunk.messageMetadata != null) write(); - break; - case "finish": - if (chunk.finishReason != null) state.finishReason = chunk.finishReason; - await updateMessageMetadata(chunk.messageMetadata); - if (chunk.messageMetadata != null) write(); - break; - case "message-metadata": - await updateMessageMetadata(chunk.messageMetadata); - if (chunk.messageMetadata != null) write(); - break; - case "error": - onError?.(new Error(chunk.errorText)); - break; - default: if (isDataUIMessageChunk(chunk)) { - if ((dataPartSchemas == null ? void 0 : dataPartSchemas[chunk.type]) != null) { - const partIdx = state.message.parts.findIndex((p) => "id" in p && "data" in p && p.id === chunk.id && p.type === chunk.type); - const actualPartIdx = partIdx >= 0 ? partIdx : state.message.parts.length; - await validateTypes({ - value: chunk.data, - schema: dataPartSchemas[chunk.type], - context: { - field: `message.parts[${actualPartIdx}].data`, - entityName: chunk.type, - entityId: chunk.id - } - }); - } - const dataChunk = chunk; - if (dataChunk.transient) { - onData?.(dataChunk); - break; - } - const existingUIPart = dataChunk.id != null ? state.message.parts.find((chunkArg) => dataChunk.type === chunkArg.type && dataChunk.id === chunkArg.id) : void 0; - if (existingUIPart != null) existingUIPart.data = dataChunk.data; - else state.message.parts.push(dataChunk); - onData?.(dataChunk); - write(); - } - } - controller.enqueue(chunk); - }); - } })); -} -function handleUIMessageStreamFinish({ messageId, originalMessages = [], onStepEnd, onStepFinish, onEnd, onFinish, onError, stream }) { - let lastMessage = originalMessages == null ? void 0 : originalMessages[originalMessages.length - 1]; - if ((lastMessage == null ? void 0 : lastMessage.role) !== "assistant") lastMessage = void 0; - else messageId = lastMessage.id; - let isAborted = false; - const idInjectedStream = stream.pipeThrough(new TransformStream({ transform(chunk, controller) { - if (chunk.type === "start") { - const startChunk = chunk; - if (startChunk.messageId == null && messageId != null) startChunk.messageId = messageId; - } - if (chunk.type === "abort") isAborted = true; - controller.enqueue(chunk); - } })); - const resolvedOnStepEnd = onStepEnd != null ? onStepEnd : onStepFinish; - const resolvedOnEnd = onEnd != null ? onEnd : onFinish; - if (resolvedOnEnd == null && resolvedOnStepEnd == null) return idInjectedStream; - const state = createStreamingUIMessageState({ - lastMessage: lastMessage ? structuredClone(lastMessage) : void 0, - messageId: messageId != null ? messageId : "" - }); - const runUpdateMessageJob = async (job) => { - await job({ - state, - write: () => {} - }); - }; - let finishCalled = false; - const callOnEnd = async () => { - if (finishCalled || !resolvedOnEnd) return; - finishCalled = true; - const isContinuation = state.message.id === (lastMessage == null ? void 0 : lastMessage.id); - await resolvedOnEnd({ - isAborted, - isContinuation, - responseMessage: state.message, - messages: [...isContinuation ? originalMessages.slice(0, -1) : originalMessages, state.message], - finishReason: state.finishReason - }); - }; - const callOnStepFinish = async () => { - if (!resolvedOnStepEnd) return; - const isContinuation = state.message.id === (lastMessage == null ? void 0 : lastMessage.id); - try { - await resolvedOnStepEnd({ - isContinuation, - responseMessage: structuredClone(state.message), - messages: [...isContinuation ? originalMessages.slice(0, -1) : originalMessages, structuredClone(state.message)] - }); - } catch (error) { - onError(error); - } - }; - return processUIMessageStream({ - stream: idInjectedStream, - runUpdateMessageJob, - onError - }).pipeThrough(new TransformStream({ - async transform(chunk, controller) { - if (chunk.type === "finish-step") await callOnStepFinish(); - controller.enqueue(chunk); - }, - async cancel() { - await callOnEnd(); - }, - async flush() { - await callOnEnd(); - } - })); -} -function toUIMessageChunk(part, { tools, sendReasoning = true, sendSources = false, sendStart = true, sendFinish = true, onError = () => "An error occurred.", messageMetadata, responseMessageId } = {}) { - const isDynamic = (toolPart) => { - const tool2 = tools == null ? void 0 : tools[toolPart.toolName]; - if (tool2 == null) return toolPart.dynamic; - return (tool2 == null ? void 0 : tool2.type) === "dynamic" ? true : void 0; - }; - const partType = part.type; - switch (partType) { - case "text-start": return { - type: "text-start", - id: part.id, - ...part.providerMetadata != null ? { providerMetadata: part.providerMetadata } : {} - }; - case "text-delta": return { - type: "text-delta", - id: part.id, - delta: part.text, - ...part.providerMetadata != null ? { providerMetadata: part.providerMetadata } : {} - }; - case "text-end": return { - type: "text-end", - id: part.id, - ...part.providerMetadata != null ? { providerMetadata: part.providerMetadata } : {} - }; - case "reasoning-start": - case "reasoning-end": - if (!sendReasoning) return; - return { - type: partType, - id: part.id, - ...part.providerMetadata != null ? { providerMetadata: part.providerMetadata } : {} - }; - case "reasoning-delta": - if (!sendReasoning) return; - return { - type: "reasoning-delta", - id: part.id, - delta: part.text, - ...part.providerMetadata != null ? { providerMetadata: part.providerMetadata } : {} - }; - case "file": - case "reasoning-file": - if (partType === "reasoning-file" && !sendReasoning) return; - return { - type: part.type, - mediaType: part.file.mediaType, - url: `data:${part.file.mediaType};base64,${part.file.base64}`, - ...part.providerMetadata != null ? { providerMetadata: part.providerMetadata } : {} - }; - case "source": - if (!sendSources) return; - if (part.sourceType === "url") return { - type: "source-url", - sourceId: part.id, - url: part.url, - title: part.title, - ...part.providerMetadata != null ? { providerMetadata: part.providerMetadata } : {} - }; - if (part.sourceType === "document") return { - type: "source-document", - sourceId: part.id, - mediaType: part.mediaType, - title: part.title, - filename: part.filename, - ...part.providerMetadata != null ? { providerMetadata: part.providerMetadata } : {} - }; - return; - case "custom": return { - type: "custom", - kind: part.kind, - ...part.providerMetadata != null ? { providerMetadata: part.providerMetadata } : {} - }; - case "tool-input-start": { - const dynamic = isDynamic(part); - return { - type: "tool-input-start", - toolCallId: part.id, - toolName: part.toolName, - ...part.providerExecuted != null ? { providerExecuted: part.providerExecuted } : {}, - ...part.providerMetadata != null ? { providerMetadata: part.providerMetadata } : {}, - ...part.toolMetadata != null ? { toolMetadata: part.toolMetadata } : {}, - ...dynamic != null ? { dynamic } : {}, - ...part.title != null ? { title: part.title } : {} - }; - } - case "tool-input-delta": return { - type: "tool-input-delta", - toolCallId: part.id, - inputTextDelta: part.delta - }; - case "tool-call": { - const dynamic = isDynamic(part); - if (part.invalid) return { - type: "tool-input-error", - toolCallId: part.toolCallId, - toolName: part.toolName, - input: part.input, - ...part.providerExecuted != null ? { providerExecuted: part.providerExecuted } : {}, - ...part.providerMetadata != null ? { providerMetadata: part.providerMetadata } : {}, - ...part.toolMetadata != null ? { toolMetadata: part.toolMetadata } : {}, - ...dynamic != null ? { dynamic } : {}, - errorText: onError(part.error), - ...part.title != null ? { title: part.title } : {} - }; - return { - type: "tool-input-available", - toolCallId: part.toolCallId, - toolName: part.toolName, - input: part.input, - ...part.providerExecuted != null ? { providerExecuted: part.providerExecuted } : {}, - ...part.providerMetadata != null ? { providerMetadata: part.providerMetadata } : {}, - ...part.toolMetadata != null ? { toolMetadata: part.toolMetadata } : {}, - ...dynamic != null ? { dynamic } : {}, - ...part.title != null ? { title: part.title } : {} - }; - } - case "tool-approval-request": return { - type: "tool-approval-request", - approvalId: part.approvalId, - toolCallId: part.toolCall.toolCallId, - ...part.isAutomatic != null ? { isAutomatic: part.isAutomatic } : {}, - ...part.signature != null ? { signature: part.signature } : {} - }; - case "tool-approval-response": return { - type: "tool-approval-response", - approvalId: part.approvalId, - approved: part.approved, - ...part.reason != null ? { reason: part.reason } : {}, - ...part.providerExecuted != null ? { providerExecuted: part.providerExecuted } : {} - }; - case "tool-result": { - const dynamic = isDynamic(part); - return { - type: "tool-output-available", - toolCallId: part.toolCallId, - output: part.output === void 0 ? null : part.output, - ...part.providerExecuted != null ? { providerExecuted: part.providerExecuted } : {}, - ...part.providerMetadata != null ? { providerMetadata: part.providerMetadata } : {}, - ...part.toolMetadata != null ? { toolMetadata: part.toolMetadata } : {}, - ...part.preliminary != null ? { preliminary: part.preliminary } : {}, - ...dynamic != null ? { dynamic } : {} - }; - } - case "tool-error": { - const dynamic = isDynamic(part); - return { - type: "tool-output-error", - toolCallId: part.toolCallId, - errorText: part.providerExecuted ? typeof part.error === "string" ? part.error : JSON.stringify(part.error) : onError(part.error), - ...part.providerExecuted != null ? { providerExecuted: part.providerExecuted } : {}, - ...part.providerMetadata != null ? { providerMetadata: part.providerMetadata } : {}, - ...part.toolMetadata != null ? { toolMetadata: part.toolMetadata } : {}, - ...dynamic != null ? { dynamic } : {} - }; - } - case "tool-output-denied": return { - type: "tool-output-denied", - toolCallId: part.toolCallId - }; - case "error": return { - type: "error", - errorText: onError(part.error) - }; - case "start-step": return { type: "start-step" }; - case "finish-step": return { type: "finish-step" }; - case "start": - if (!sendStart) return; - return { - type: "start", - ...messageMetadata != null ? { messageMetadata } : {}, - ...responseMessageId != null ? { messageId: responseMessageId } : {} - }; - case "finish": - if (!sendFinish) return; - return { - type: "finish", - finishReason: part.finishReason, - ...messageMetadata != null ? { messageMetadata } : {} - }; - case "abort": return part; - case "tool-input-end": - case "raw": return; - default: throw new Error(`Unknown chunk type: ${partType}`); - } -} -function toUIMessageStream({ stream, tools, sendReasoning = true, sendSources = false, sendStart = true, sendFinish = true, onError = () => "An error occurred.", messageMetadata, originalMessages, generateMessageId, onEnd, onFinish }) { - const responseMessageId = generateMessageId != null ? getResponseUIMessageId({ - originalMessages, - responseMessageId: generateMessageId - }) : void 0; - return handleUIMessageStreamFinish({ - stream: stream.pipeThrough(new TransformStream({ transform: async (part, controller) => { - const messageMetadataValue = messageMetadata == null ? void 0 : messageMetadata({ part }); - const uiMessageChunk = toUIMessageChunk(part, { - tools, - sendReasoning, - sendSources, - sendStart, - sendFinish, - onError, - messageMetadata: messageMetadataValue, - responseMessageId - }); - if (uiMessageChunk != null) controller.enqueue(uiMessageChunk); - if (messageMetadataValue != null && part.type !== "start" && part.type !== "finish") controller.enqueue({ - type: "message-metadata", - messageMetadata: messageMetadataValue - }); - } })), - messageId: responseMessageId != null ? responseMessageId : generateMessageId == null ? void 0 : generateMessageId(), - originalMessages, - onEnd: onEnd != null ? onEnd : onFinish, - onError - }); -} -function createAsyncIterableStream(source) { - return asAsyncIterableStream(source.pipeThrough(new TransformStream())); -} -function asAsyncIterableStream(stream) { - stream[Symbol.asyncIterator] = function() { - const reader = this.getReader(); - let finished = false; - async function cleanup(cancelStream) { - var _a22; - if (finished) return; - finished = true; - try { - if (cancelStream) await ((_a22 = reader.cancel) == null ? void 0 : _a22.call(reader)); - } finally { - try { - reader.releaseLock(); - } catch (e) {} - } - } - return { - /** - * Reads the next chunk from the stream. - * @returns A promise resolving to the next IteratorResult. - */ - async next() { - if (finished) return { - done: true, - value: void 0 - }; - const { done, value } = await reader.read(); - if (done) { - await cleanup(true); - return { - done: true, - value: void 0 - }; - } - return { - done: false, - value - }; - }, - /** - * May be called on early exit (e.g., break from for-await) or after completion. - * Ensures the stream is cancelled and resources are released. - * @returns A promise resolving to a completed IteratorResult. - */ - async return() { - await cleanup(true); - return { - done: true, - value: void 0 - }; - }, - /** - * Called on early exit with error. - * Ensures the stream is cancelled and resources are released, then rethrows the error. - * @param err The error to throw. - * @returns A promise that rejects with the provided error. - */ - async throw(err) { - await cleanup(true); - throw err; - } - }; - }; - return stream; -} -async function consumeStream({ stream, onError }) { - const reader = stream.getReader(); - try { - while (true) { - const { done } = await reader.read(); - if (done) break; - } - } catch (error) { - onError?.(error); - } finally { - reader.releaseLock(); - } -} -function createResolvablePromise() { - let resolve3; - let reject; - return { - promise: new Promise((res, rej) => { - resolve3 = res; - reject = rej; - }), - resolve: resolve3, - reject - }; -} -function createStitchableStream() { - let innerStreamReaders = []; - let controller = null; - let isClosed = false; - let waitForNewStream = createResolvablePromise(); - const terminate = () => { - isClosed = true; - waitForNewStream.resolve(); - innerStreamReaders.forEach((reader) => reader.cancel()); - innerStreamReaders = []; - controller?.close(); - }; - const processPull = async () => { - if (isClosed && innerStreamReaders.length === 0) { - controller?.close(); - return; - } - if (innerStreamReaders.length === 0) { - waitForNewStream = createResolvablePromise(); - await waitForNewStream.promise; - return await processPull(); - } - try { - const { value, done } = await innerStreamReaders[0].read(); - if (done) { - innerStreamReaders.shift(); - if (innerStreamReaders.length === 0 && isClosed) controller?.close(); - else await processPull(); - } else controller?.enqueue(value); - } catch (error) { - controller?.error(error); - innerStreamReaders.shift(); - terminate(); - } - }; - return { - stream: new ReadableStream({ - start(controllerParam) { - controller = controllerParam; - }, - pull: processPull, - async cancel() { - for (const reader of innerStreamReaders) await reader.cancel(); - innerStreamReaders = []; - isClosed = true; - } - }), - addStream: (innerStream) => { - if (isClosed) throw new Error("Cannot add inner stream: outer stream is closed"); - innerStreamReaders.push(innerStream.getReader()); - waitForNewStream.resolve(); - }, - /** - * Gracefully close the outer stream. This will let the inner streams - * finish processing and then close the outer stream. - */ - close: () => { - isClosed = true; - waitForNewStream.resolve(); - if (innerStreamReaders.length === 0) controller?.close(); - }, - /** - * Immediately close the outer stream. This will cancel all inner streams - * and close the outer stream. - */ - terminate - }; -} -function executeToolsFromStream({ stream, tools, callId, messages, abortSignal, timeout, experimental_sandbox: sandbox, toolsContext, toolApproval, runtimeContext, toolApprovalSecret, generateId: generateId2, onToolExecutionStart, onToolExecutionEnd, executeToolInTelemetryContext, runInTracingChannelSpan }) { - const toolCallsToExecute = []; - return stream.pipeThrough(new TransformStream({ async transform(chunk, controller) { - controller.enqueue(chunk); - switch (chunk.type) { - case "tool-call": { - if (chunk.invalid) return; - const tool2 = getOwn(tools, chunk.toolName); - if (tool2 == null) return; - const toolApprovalStatus = await resolveToolApproval({ - tools, - toolCall: chunk, - toolApproval, - messages, - toolsContext, - runtimeContext - }); - if (toolApprovalStatus.type === "not-applicable") { - if (tool2.execute != null && chunk.providerExecuted !== true) toolCallsToExecute.push(chunk); - return; - } - const approvalId = generateId2(); - const signature = await maybeSignApproval({ - secret: toolApprovalSecret, - approvalId, - toolCallId: chunk.toolCallId, - toolName: chunk.toolName, - input: chunk.input - }); - switch (toolApprovalStatus.type) { - case "user-approval": - controller.enqueue({ - type: "tool-approval-request", - approvalId, - toolCall: chunk, - ...signature != null ? { signature } : {} - }); - return; - case "denied": - controller.enqueue({ - type: "tool-approval-request", - approvalId, - toolCall: chunk, - isAutomatic: true, - ...signature != null ? { signature } : {} - }); - controller.enqueue({ - type: "tool-approval-response", - approvalId, - approved: false, - toolCall: chunk, - reason: toolApprovalStatus.reason, - providerExecuted: chunk.providerExecuted - }); - return; - case "approved": - controller.enqueue({ - type: "tool-approval-request", - approvalId, - toolCall: chunk, - isAutomatic: true, - ...signature != null ? { signature } : {} - }); - controller.enqueue({ - type: "tool-approval-response", - approvalId, - approved: true, - toolCall: chunk, - reason: toolApprovalStatus.reason, - providerExecuted: chunk.providerExecuted - }); - break; - } - if (tool2.execute != null && chunk.providerExecuted !== true) toolCallsToExecute.push(chunk); - return; - } - case "model-call-end": - await Promise.all(toolCallsToExecute.map(async (toolCall) => { - try { - const result = await executeToolCall({ - toolCall, - tools, - callId, - messages, - abortSignal, - timeout, - experimental_sandbox: sandbox, - toolsContext, - onToolExecutionStart, - onToolExecutionEnd, - executeToolInTelemetryContext, - runInTracingChannelSpan, - onPreliminaryToolResult: (result2) => { - controller.enqueue(result2); - } - }); - if (result != null) { - controller.enqueue({ - type: "tool-execution-end", - toolCallId: result.output.toolCallId, - toolExecutionMs: result.toolExecutionMs - }); - controller.enqueue(result.output); - } - } catch (error) { - controller.enqueue({ - type: "error", - error - }); - } - })); - return; - } - } })); -} -function invokeToolCallbacksFromStream({ stream, tools, stepInputMessages, abortSignal, runtimeContext }) { - if (tools == null) return stream; - const ongoingToolCallToolNames = createIdMap(); - return stream.pipeThrough(new TransformStream({ async transform(chunk, controller) { - controller.enqueue(chunk); - switch (chunk.type) { - case "tool-input-start": { - ongoingToolCallToolNames[chunk.id] = chunk.toolName; - const tool2 = getOwn(tools, chunk.toolName); - if ((tool2 == null ? void 0 : tool2.onInputStart) != null) await tool2.onInputStart({ - toolCallId: chunk.id, - messages: stepInputMessages, - abortSignal, - context: runtimeContext - }); - break; - } - case "tool-input-delta": { - const toolName = ongoingToolCallToolNames[chunk.id]; - const tool2 = getOwn(tools, toolName); - if ((tool2 == null ? void 0 : tool2.onInputDelta) != null) await tool2.onInputDelta({ - inputTextDelta: chunk.delta, - toolCallId: chunk.id, - messages: stepInputMessages, - abortSignal, - context: runtimeContext - }); - break; - } - case "tool-call": { - const toolName = ongoingToolCallToolNames[chunk.toolCallId]; - const tool2 = getOwn(tools, toolName); - delete ongoingToolCallToolNames[chunk.toolCallId]; - if ((tool2 == null ? void 0 : tool2.onInputAvailable) != null) await tool2.onInputAvailable({ - input: chunk.input, - toolCallId: chunk.toolCallId, - messages: stepInputMessages, - abortSignal, - context: runtimeContext - }); - } - } - } })); -} -var originalGenerateId2 = createIdGenerator({ - prefix: "aitxt", - size: 24 -}); -var originalGenerateCallId2 = createIdGenerator({ - prefix: "call", - size: 24 -}); -async function streamLanguageModelCall({ model, tools, toolOrder, output, toolChoice, prompt, system, instructions, messages, allowSystemInMessages, download: download2, abortSignal, headers, includeRawChunks, providerOptions, repairToolCall, refineToolInput, executeLanguageModelCallInTelemetryContext = async ({ execute }) => await execute(), callId, toolsContext, experimental_sandbox: sandbox, _internal: { generateId: generateId2 = originalGenerateId2, generateCallId = originalGenerateCallId2, now: now2 = now } = {}, onStart, onLanguageModelCallStart, onLanguageModelCallEnd, ...callSettings }) { - const resolvedModel = resolveLanguageModel(model); - const effectiveCallId = callId != null ? callId : generateCallId(); - const standardizedPrompt = await standardizePrompt({ - instructions, - system, - prompt, - messages, - allowSystemInMessages - }); - const promptMessages = await convertToLanguageModelPrompt({ - prompt: { - instructions: standardizedPrompt.instructions, - messages: standardizedPrompt.messages - }, - supportedUrls: await resolvedModel.supportedUrls, - download: download2, - provider: resolvedModel.provider.split(".")[0] - }); - const stepTools = await prepareTools({ - tools, - toolOrder, - toolsContext, - experimental_sandbox: sandbox - }); - const stepToolChoice = prepareToolChoice({ toolChoice }); - await notify({ - event: { promptMessages }, - callbacks: onStart - }); - const languageModelCallStartEvent = { - callId: effectiveCallId, - provider: resolvedModel.provider, - modelId: resolvedModel.modelId, - instructions: standardizedPrompt.instructions, - messages: standardizedPrompt.messages, - tools: stepTools, - ...callSettings - }; - await notify({ - event: languageModelCallStartEvent, - callbacks: onLanguageModelCallStart - }); - const callStartTimestampMs = now2(); - const { stream: languageModelStream, response, request } = await executeLanguageModelCallInTelemetryContext({ - ...languageModelCallStartEvent, - execute: async () => await resolvedModel.doStream({ - ...callSettings, - tools: stepTools, - toolChoice: stepToolChoice, - responseFormat: await (output == null ? void 0 : output.responseFormat), - prompt: promptMessages, - providerOptions, - abortSignal, - headers, - includeRawChunks - }) - }); - return { - stream: createAsyncIterableStream(languageModelStream.pipeThrough(createLanguageModelV4StreamPartToLanguageModelStreamPartTransform({ - tools, - instructions: standardizedPrompt.instructions, - messages: standardizedPrompt.messages, - repairToolCall, - refineToolInput, - callId: effectiveCallId, - provider: resolvedModel.provider, - modelId: resolvedModel.modelId, - generateId: generateId2, - now: now2, - callStartTimestampMs, - onLanguageModelCallEnd - }))), - response, - request - }; -} -function createLanguageModelV4StreamPartToLanguageModelStreamPartTransform({ tools, instructions, messages, repairToolCall, refineToolInput, callId, provider, modelId, generateId: generateId2, now: now2, callStartTimestampMs, onLanguageModelCallEnd }) { - const toolCallsByToolCallId = /* @__PURE__ */ new Map(); - const modelCallContent = []; - const textPartIndexes = /* @__PURE__ */ new Map(); - const reasoningPartIndexes = /* @__PURE__ */ new Map(); - let responseId = generateId2(); - let timeToFirstOutputMs; - let previousOutputChunkTimestampMs; - const timeBetweenOutputChunksMs = []; - return new TransformStream({ async transform(chunk, controller) { - var _a22, _b; - if (isOutputChunk(chunk)) { - const outputChunkTimestampMs = now2(); - if (timeToFirstOutputMs == null) timeToFirstOutputMs = outputChunkTimestampMs - callStartTimestampMs; - else if (previousOutputChunkTimestampMs != null) timeBetweenOutputChunksMs.push(outputChunkTimestampMs - previousOutputChunkTimestampMs); - previousOutputChunkTimestampMs = outputChunkTimestampMs; - } - switch (chunk.type) { - case "text-start": - upsertTextContentPart({ - content: modelCallContent, - partIndexes: textPartIndexes, - id: chunk.id, - type: "text", - providerMetadata: chunk.providerMetadata - }); - controller.enqueue(chunk); - break; - case "text-delta": - upsertTextContentPart({ - content: modelCallContent, - partIndexes: textPartIndexes, - id: chunk.id, - type: "text", - textDelta: chunk.delta, - providerMetadata: chunk.providerMetadata - }); - controller.enqueue({ - type: "text-delta", - id: chunk.id, - text: chunk.delta, - providerMetadata: chunk.providerMetadata - }); - break; - case "text-end": - upsertTextContentPart({ - content: modelCallContent, - partIndexes: textPartIndexes, - id: chunk.id, - type: "text", - providerMetadata: chunk.providerMetadata - }); - textPartIndexes.delete(chunk.id); - controller.enqueue(chunk); - break; - case "reasoning-start": - upsertTextContentPart({ - content: modelCallContent, - partIndexes: reasoningPartIndexes, - id: chunk.id, - type: "reasoning", - providerMetadata: chunk.providerMetadata - }); - controller.enqueue(chunk); - break; - case "reasoning-delta": - upsertTextContentPart({ - content: modelCallContent, - partIndexes: reasoningPartIndexes, - id: chunk.id, - type: "reasoning", - textDelta: chunk.delta, - providerMetadata: chunk.providerMetadata - }); - controller.enqueue({ - type: "reasoning-delta", - id: chunk.id, - text: chunk.delta, - providerMetadata: chunk.providerMetadata - }); - break; - case "reasoning-end": - upsertTextContentPart({ - content: modelCallContent, - partIndexes: reasoningPartIndexes, - id: chunk.id, - type: "reasoning", - providerMetadata: chunk.providerMetadata - }); - reasoningPartIndexes.delete(chunk.id); - controller.enqueue(chunk); - break; - case "file": - case "reasoning-file": { - const file = new DefaultGeneratedFileWithType({ - data: chunk.data.type === "data" ? chunk.data.data : chunk.data.url.toString(), - mediaType: chunk.mediaType - }); - modelCallContent.push({ - type: chunk.type, - file, - ...chunk.providerMetadata != null ? { providerMetadata: chunk.providerMetadata } : {} - }); - controller.enqueue({ - type: chunk.type, - file, - providerMetadata: chunk.providerMetadata - }); - break; - } - case "finish": { - const usage = asLanguageModelUsage(chunk.usage); - const responseTimeMs = now2() - callStartTimestampMs; - const performance = { - responseTimeMs, - effectiveOutputTokensPerSecond: calculateTokensPerSecond({ - tokens: usage.outputTokens, - durationMs: responseTimeMs - }), - outputTokensPerSecond: timeToFirstOutputMs == null ? void 0 : calculateTokensPerSecond({ - tokens: usage.outputTokens, - durationMs: responseTimeMs - timeToFirstOutputMs - }), - inputTokensPerSecond: timeToFirstOutputMs == null ? void 0 : calculateTokensPerSecond({ - tokens: usage.inputTokens, - durationMs: timeToFirstOutputMs - }), - effectiveTotalTokensPerSecond: calculateTokensPerSecond({ - tokens: sumTokenCounts(usage.inputTokens, usage.outputTokens), - durationMs: responseTimeMs - }), - timeToFirstOutputMs, - timeBetweenOutputChunksMs: timeBetweenOutputChunksMs.length > 0 ? calculateOutputChunkTimingStats(timeBetweenOutputChunksMs) : void 0 - }; - await notify({ - event: { - callId, - provider, - modelId, - finishReason: chunk.finishReason.unified, - usage, - content: modelCallContent, - responseId, - performance - }, - callbacks: onLanguageModelCallEnd - }); - controller.enqueue({ - type: "model-call-end", - finishReason: chunk.finishReason.unified, - rawFinishReason: chunk.finishReason.raw, - usage, - providerMetadata: chunk.providerMetadata, - performance - }); - break; - } - case "tool-call": - try { - const toolCall = await parseToolCall({ - toolCall: chunk, - tools, - repairToolCall, - refineToolInput, - instructions, - messages - }); - toolCallsByToolCallId.set(toolCall.toolCallId, toolCall); - controller.enqueue(toolCall); - modelCallContent.push(toolCall); - if (toolCall.invalid) { - controller.enqueue({ - type: "tool-error", - toolCallId: toolCall.toolCallId, - toolName: toolCall.toolName, - input: toolCall.input, - error: getErrorMessage(toolCall.error), - dynamic: true, - title: toolCall.title, - ...toolCall.toolMetadata != null ? { toolMetadata: toolCall.toolMetadata } : {} - }); - break; - } - } catch (error) { - controller.enqueue({ - type: "error", - error - }); - } - break; - case "tool-approval-request": { - const toolCall = toolCallsByToolCallId.get(chunk.toolCallId); - if (toolCall == null) { - controller.enqueue({ - type: "error", - error: new ToolCallNotFoundForApprovalError({ - toolCallId: chunk.toolCallId, - approvalId: chunk.approvalId - }) - }); - break; - } - const toolApprovalRequest = { - type: "tool-approval-request", - approvalId: chunk.approvalId, - toolCall - }; - controller.enqueue(toolApprovalRequest); - modelCallContent.push(toolApprovalRequest); - break; - } - case "tool-result": { - const toolName = chunk.toolName; - const toolCall = toolCallsByToolCallId.get(chunk.toolCallId); - const toolResultPart = chunk.isError ? { - type: "tool-error", - toolCallId: chunk.toolCallId, - toolName, - input: toolCall == null ? void 0 : toolCall.input, - providerExecuted: true, - error: chunk.result, - dynamic: chunk.dynamic, - ...chunk.providerMetadata != null ? { providerMetadata: chunk.providerMetadata } : {}, - ...(toolCall == null ? void 0 : toolCall.toolMetadata) != null ? { toolMetadata: toolCall.toolMetadata } : {} - } : { - type: "tool-result", - toolCallId: chunk.toolCallId, - toolName, - input: toolCall == null ? void 0 : toolCall.input, - output: chunk.result, - providerExecuted: true, - dynamic: chunk.dynamic, - ...chunk.providerMetadata != null ? { providerMetadata: chunk.providerMetadata } : {}, - ...(toolCall == null ? void 0 : toolCall.toolMetadata) != null ? { toolMetadata: toolCall.toolMetadata } : {} - }; - controller.enqueue(toolResultPart); - modelCallContent.push(toolResultPart); - break; - } - case "tool-input-start": { - const tool2 = getOwn(tools, chunk.toolName); - controller.enqueue({ - ...chunk, - dynamic: (_a22 = chunk.dynamic) != null ? _a22 : (tool2 == null ? void 0 : tool2.type) === "dynamic", - title: tool2 == null ? void 0 : tool2.title, - ...(tool2 == null ? void 0 : tool2.metadata) != null ? { toolMetadata: tool2.metadata } : {} - }); - break; - } - case "stream-start": - controller.enqueue({ - type: "model-call-start", - warnings: chunk.warnings - }); - break; - case "response-metadata": - responseId = (_b = chunk.id) != null ? _b : responseId; - controller.enqueue({ - type: "model-call-response-metadata", - id: chunk.id, - timestamp: chunk.timestamp, - modelId: chunk.modelId - }); - break; - default: - if (chunk.type === "custom" || chunk.type === "source") modelCallContent.push(chunk); - controller.enqueue(chunk); - break; - } - } }); -} -function isOutputChunk(chunk) { - return chunk.type === "text-delta" && chunk.delta.length > 0 || chunk.type === "reasoning-delta" && chunk.delta.length > 0 || chunk.type === "tool-input-delta" && chunk.delta.length > 0 || chunk.type === "file" || chunk.type === "reasoning-file" || chunk.type === "tool-call"; -} -function calculateOutputChunkTimingStats(timingsMs) { - const sortedTimingsMs = [...timingsMs].sort((a, b) => a - b); - const sum = timingsMs.reduce((sum2, timingMs) => sum2 + timingMs, 0); - return { - min: sortedTimingsMs[0], - p10: calculateNearestRankPercentile(sortedTimingsMs, .1), - median: calculateNearestRankPercentile(sortedTimingsMs, .5), - avg: sum / timingsMs.length, - p90: calculateNearestRankPercentile(sortedTimingsMs, .9), - max: sortedTimingsMs[sortedTimingsMs.length - 1] - }; -} -function calculateNearestRankPercentile(sortedValues, percentile) { - return sortedValues[Math.ceil(percentile * sortedValues.length) - 1]; -} -function upsertTextContentPart({ content, partIndexes, id, type, textDelta, providerMetadata }) { - let partIndex = partIndexes.get(id); - if (partIndex == null) { - partIndex = content.push({ - type, - text: "", - ...providerMetadata != null ? { providerMetadata } : {} - }) - 1; - partIndexes.set(id, partIndex); - } - const part = content[partIndex]; - if (textDelta != null) part.text += textDelta; - if (providerMetadata != null) part.providerMetadata = providerMetadata; -} -var originalGenerateId3 = createIdGenerator({ - prefix: "aitxt", - size: 24 -}); -var originalGenerateCallId3 = createIdGenerator({ - prefix: "call", - size: 24 -}); -var isOutputChunkType = { - file: true, - custom: true, - source: true, - "text-start": true, - "text-end": true, - "text-delta": true, - "reasoning-start": true, - "reasoning-end": true, - "reasoning-delta": true, - "reasoning-file": true, - "tool-input-start": true, - "tool-input-end": true, - "tool-input-delta": true, - "tool-approval-request": true, - "tool-approval-response": true, - "tool-call": true, - "tool-result": true, - "tool-error": true, - "tool-execution-end": false, - "model-call-start": false, - "model-call-response-metadata": false, - "model-call-end": false, - error: false, - raw: false -}; -function streamText({ model, tools, toolChoice, instructions, system, prompt, messages, allowSystemInMessages, maxRetries, abortSignal, timeout, headers, stopWhen = isStepCount(1), experimental_sandbox: sandbox, output, toolApproval, experimental_toolApprovalSecret, experimental_telemetry, telemetry = experimental_telemetry, prepareStep, providerOptions, activeTools, toolOrder, experimental_repairToolCall, repairToolCall = experimental_repairToolCall, experimental_refineToolInput: refineToolInput, experimental_transform: transform, experimental_download: download2, includeRawChunks, onChunk, onError = ({ error }) => { - console.error(error); -}, onFinish, onEnd = onFinish, onAbort, onStepEnd, onStepFinish, onStart, experimental_onStart, onStepStart, experimental_onStepStart, onLanguageModelCallStart, experimental_onLanguageModelCallStart, onLanguageModelCallEnd, experimental_onLanguageModelCallEnd, onToolExecutionStart, onToolExecutionEnd, experimental_onToolCallStart, experimental_onToolCallFinish, runtimeContext = {}, toolsContext = {}, experimental_include, include = experimental_include, _internal: { now: now2 = now, generateId: generateId2 = originalGenerateId3, generateCallId = originalGenerateCallId3 } = {}, ...settings }) { - var _a22, _b, _c, _d; - const totalTimeoutMs = getTotalTimeoutMs(timeout); - const stepTimeoutMs = getStepTimeoutMs(timeout); - const chunkTimeoutMs = getChunkTimeoutMs(timeout); - const stepAbortController = stepTimeoutMs != null ? new AbortController() : void 0; - const chunkAbortController = chunkTimeoutMs != null ? new AbortController() : void 0; - const resolvedOnStart = onStart != null ? onStart : experimental_onStart; - const resolvedOnStepStart = onStepStart != null ? onStepStart : experimental_onStepStart; - const resolvedOnLanguageModelCallStart = onLanguageModelCallStart != null ? onLanguageModelCallStart : experimental_onLanguageModelCallStart; - const resolvedOnLanguageModelCallEnd = onLanguageModelCallEnd != null ? onLanguageModelCallEnd : experimental_onLanguageModelCallEnd; - const resolvedOnToolExecutionStart = onToolExecutionStart != null ? onToolExecutionStart : experimental_onToolCallStart; - const resolvedOnToolExecutionEnd = onToolExecutionEnd != null ? onToolExecutionEnd : experimental_onToolCallFinish; - const resolvedOnStepEnd = onStepEnd != null ? onStepEnd : onStepFinish; - return new DefaultStreamTextResult({ - model: resolveLanguageModel(model), - telemetry, - headers, - settings, - maxRetries, - abortSignal: mergeAbortSignals(abortSignal, totalTimeoutMs, stepAbortController == null ? void 0 : stepAbortController.signal, chunkAbortController == null ? void 0 : chunkAbortController.signal), - stepTimeoutMs, - stepAbortController, - chunkTimeoutMs, - chunkAbortController, - instructions, - system, - prompt, - messages, - allowSystemInMessages, - experimental_sandbox: sandbox, - tools, - toolsContext, - runtimeContext, - toolChoice, - transforms: asArray(transform), - activeTools, - toolOrder, - repairToolCall, - refineToolInput, - stopConditions: asArray(stopWhen), - output, - toolApproval, - experimental_toolApprovalSecret, - providerOptions, - prepareStep, - timeout, - onChunk, - onError, - onEnd, - onAbort, - onStepFinish: resolvedOnStepEnd, - onStart: resolvedOnStart, - onStepStart: resolvedOnStepStart, - onLanguageModelCallStart: resolvedOnLanguageModelCallStart, - onLanguageModelCallEnd: resolvedOnLanguageModelCallEnd, - onToolExecutionStart: resolvedOnToolExecutionStart, - onToolExecutionEnd: resolvedOnToolExecutionEnd, - now: now2, - generateId: generateId2, - generateCallId, - download: download2, - include: { - requestBody: (_a22 = include == null ? void 0 : include.requestBody) != null ? _a22 : false, - requestMessages: (_b = include == null ? void 0 : include.requestMessages) != null ? _b : false, - rawChunks: (_d = (_c = include == null ? void 0 : include.rawChunks) != null ? _c : includeRawChunks) != null ? _d : false - } - }); -} -async function markPromiseAsHandled(promise) { - try { - await promise; - } catch (e) {} -} -function createOutputTransformStream(output) { - let firstTextChunkId = void 0; - let text2 = ""; - let textChunk = ""; - let textProviderMetadata = void 0; - let lastPublishedValue = ""; - function publishTextChunk({ controller, partialOutput = void 0 }) { - controller.enqueue({ - part: { - type: "text-delta", - id: firstTextChunkId, - text: textChunk, - providerMetadata: textProviderMetadata - }, - partialOutput - }); - textChunk = ""; - } - return new TransformStream({ async transform(chunk, controller) { - var _a22; - if (chunk.type === "finish-step" && textChunk.length > 0) publishTextChunk({ controller }); - if (chunk.type !== "text-delta" && chunk.type !== "text-start" && chunk.type !== "text-end") { - controller.enqueue({ - part: chunk, - partialOutput: void 0 - }); - return; - } - if (firstTextChunkId == null) firstTextChunkId = chunk.id; - else if (chunk.id !== firstTextChunkId) { - controller.enqueue({ - part: chunk, - partialOutput: void 0 - }); - return; - } - if (chunk.type === "text-start") { - controller.enqueue({ - part: chunk, - partialOutput: void 0 - }); - return; - } - if (chunk.type === "text-end") { - if (textChunk.length > 0) publishTextChunk({ controller }); - controller.enqueue({ - part: chunk, - partialOutput: void 0 - }); - return; - } - text2 += chunk.text; - textChunk += chunk.text; - textProviderMetadata = (_a22 = chunk.providerMetadata) != null ? _a22 : textProviderMetadata; - const result = await output.parsePartialOutput({ text: text2 }); - if (result !== void 0) { - const currentValue = typeof result.partial === "string" ? result.partial : JSON.stringify(result.partial); - if (currentValue !== lastPublishedValue) { - publishTextChunk({ - controller, - partialOutput: result.partial - }); - lastPublishedValue = currentValue; - } - } - } }); -} -var DefaultStreamTextResult = class { - constructor({ model, telemetry, headers, settings, maxRetries: maxRetriesArg, abortSignal, stepTimeoutMs, stepAbortController, chunkTimeoutMs, chunkAbortController, instructions, system, prompt, messages, allowSystemInMessages, experimental_sandbox: sandbox, tools, toolChoice, transforms, activeTools, toolOrder, repairToolCall, refineToolInput, stopConditions, output, toolApproval, experimental_toolApprovalSecret, providerOptions, prepareStep, now: now2, generateId: generateId2, generateCallId, timeout, onChunk, onError, onEnd, onAbort, onStepFinish, onStart, onStepStart, onLanguageModelCallStart, onLanguageModelCallEnd, onToolExecutionStart, onToolExecutionEnd, runtimeContext, toolsContext, download: download2, include }) { - this._totalUsage = new DelayedPromise(); - this._finishReason = new DelayedPromise(); - this._rawFinishReason = new DelayedPromise(); - this._steps = new DelayedPromise(); - this._initialResponseMessages = new DelayedPromise(); - this.outputSpecification = output; - this.tools = tools; - const telemetryDispatcher = createRestrictedTelemetryDispatcher({ - telemetry, - includeRuntimeContext: telemetry == null ? void 0 : telemetry.includeRuntimeContext, - includeToolsContext: telemetry == null ? void 0 : telemetry.includeToolsContext - }); - let stepFinish; - let recordedContent = []; - let recordedFinishReason = void 0; - let recordedRawFinishReason = void 0; - let recordedTotalUsage = void 0; - let recordedRequest = {}; - let recordedRequestMessages = []; - let recordedWarnings = []; - const recordedSteps = []; - const initialResponseMessages = []; - let stepMessagesForNextStep; - let currentStepMessages = []; - const pendingDeferredToolCalls = /* @__PURE__ */ new Map(); - let activeTextContent = createIdMap(); - let activeReasoningContent = createIdMap(); - let recordedNoOutputError; - const eventProcessor = new TransformStream({ - async transform(chunk, controller) { - var _a22, _b, _c, _d; - controller.enqueue(chunk); - const { part } = chunk; - await (onChunk == null ? void 0 : onChunk({ chunk: part })); - if (part.type === "error") { - const error = wrapGatewayError(part.error); - if (NoOutputGeneratedError.isInstance(error)) recordedNoOutputError = error; - await onError({ error }); - } - if (part.type === "custom" || part.type === "source" || part.type === "tool-call" || part.type === "tool-approval-request" || part.type === "tool-approval-response" || part.type === "tool-error") recordedContent.push(part); - if (part.type === "text-start") { - activeTextContent[part.id] = { - type: "text", - text: "", - providerMetadata: part.providerMetadata - }; - recordedContent.push(activeTextContent[part.id]); - } - if (part.type === "text-delta") { - const activeText = activeTextContent[part.id]; - if (activeText == null) { - controller.enqueue({ - part: { - type: "error", - error: `text part ${part.id} not found` - }, - partialOutput: void 0 - }); - return; - } - activeText.text += part.text; - activeText.providerMetadata = (_a22 = part.providerMetadata) != null ? _a22 : activeText.providerMetadata; - } - if (part.type === "text-end") { - const activeText = activeTextContent[part.id]; - if (activeText == null) { - controller.enqueue({ - part: { - type: "error", - error: `text part ${part.id} not found` - }, - partialOutput: void 0 - }); - return; - } - activeText.providerMetadata = (_b = part.providerMetadata) != null ? _b : activeText.providerMetadata; - delete activeTextContent[part.id]; - } - if (part.type === "reasoning-start") { - activeReasoningContent[part.id] = { - type: "reasoning", - text: "", - providerMetadata: part.providerMetadata - }; - recordedContent.push(activeReasoningContent[part.id]); - } - if (part.type === "reasoning-delta") { - const activeReasoning = activeReasoningContent[part.id]; - if (activeReasoning == null) { - controller.enqueue({ - part: { - type: "error", - error: `reasoning part ${part.id} not found` - }, - partialOutput: void 0 - }); - return; - } - activeReasoning.text += part.text; - activeReasoning.providerMetadata = (_c = part.providerMetadata) != null ? _c : activeReasoning.providerMetadata; - } - if (part.type === "reasoning-end") { - const activeReasoning = activeReasoningContent[part.id]; - if (activeReasoning == null) { - controller.enqueue({ - part: { - type: "error", - error: `reasoning part ${part.id} not found` - }, - partialOutput: void 0 - }); - return; - } - activeReasoning.providerMetadata = (_d = part.providerMetadata) != null ? _d : activeReasoning.providerMetadata; - delete activeReasoningContent[part.id]; - } - if (part.type === "file" || part.type === "reasoning-file") recordedContent.push({ - type: part.type, - file: part.file, - ...part.providerMetadata != null ? { providerMetadata: part.providerMetadata } : {} - }); - if (part.type === "tool-result" && !part.preliminary) recordedContent.push(part); - if (part.type === "start-step") { - recordedContent = []; - activeReasoningContent = createIdMap(); - activeTextContent = createIdMap(); - recordedRequest = part.request; - recordedWarnings = part.warnings; - } - if (part.type === "finish-step") { - const stepResponseMessages = await toResponseMessages({ - content: recordedContent, - tools - }); - const currentStepResult = new DefaultStepResult({ - callId, - stepNumber: recordedSteps.length, - provider: model.provider, - modelId: model.modelId, - runtimeContext, - toolsContext, - content: recordedContent, - finishReason: part.finishReason, - rawFinishReason: part.rawFinishReason, - usage: part.usage, - performance: part.performance, - warnings: recordedWarnings, - request: { - ...recordedRequest, - messages: include.requestMessages ? cloneModelMessages(recordedRequestMessages) : void 0 - }, - response: { - ...part.response, - messages: cloneModelMessages(stepResponseMessages) - }, - providerMetadata: part.providerMetadata - }); - await notify({ - event: currentStepResult, - callbacks: [onStepFinish, telemetryDispatcher.onStepEnd] - }); - logWarnings({ - warnings: recordedWarnings, - provider: model.provider, - model: model.modelId - }); - recordedSteps.push(currentStepResult); - stepMessagesForNextStep = [...currentStepMessages, ...stepResponseMessages]; - stepFinish.resolve(); - } - if (part.type === "finish") { - recordedTotalUsage = part.totalUsage; - recordedFinishReason = part.finishReason; - recordedRawFinishReason = part.rawFinishReason; - } - }, - async flush(controller) { - try { - if (recordedSteps.length === 0 || recordedNoOutputError != null) { - const error = (abortSignal == null ? void 0 : abortSignal.aborted) ? abortSignal.reason : recordedNoOutputError != null ? recordedNoOutputError : new NoOutputGeneratedError({ message: "No output generated. Check the stream for errors." }); - self.rejectResultPromises(error); - return; - } - const finishReason = recordedFinishReason != null ? recordedFinishReason : "other"; - const totalUsage = recordedTotalUsage != null ? recordedTotalUsage : createNullLanguageModelUsage(); - self._finishReason.resolve(finishReason); - self._rawFinishReason.resolve(recordedRawFinishReason); - self._totalUsage.resolve(totalUsage); - self._steps.resolve(recordedSteps); - const finalStep = recordedSteps[recordedSteps.length - 1]; - const content = recordedSteps.flatMap((step) => step.content); - const files = recordedSteps.flatMap((step) => step.files); - const sources = recordedSteps.flatMap((step) => step.sources); - const toolCalls = recordedSteps.flatMap((step) => step.toolCalls); - const staticToolCalls = recordedSteps.flatMap((step) => step.staticToolCalls); - const dynamicToolCalls = recordedSteps.flatMap((step) => step.dynamicToolCalls); - const toolResults = recordedSteps.flatMap((step) => step.toolResults); - const staticToolResults = recordedSteps.flatMap((step) => step.staticToolResults); - const dynamicToolResults = recordedSteps.flatMap((step) => step.dynamicToolResults); - const warnings = recordedSteps.flatMap((step) => { - var _a22; - return (_a22 = step.warnings) != null ? _a22 : []; - }); - await notify({ - event: { - callId, - toolsContext: finalStep.toolsContext, - stepNumber: finalStep.stepNumber, - model: finalStep.model, - runtimeContext: finalStep.runtimeContext, - finishReason: finalStep.finishReason, - rawFinishReason: finalStep.rawFinishReason, - usage: totalUsage, - totalUsage, - content, - text: finalStep.text, - reasoning: finalStep.reasoning, - reasoningText: finalStep.reasoningText, - files, - sources, - toolCalls, - staticToolCalls, - dynamicToolCalls, - toolResults, - staticToolResults, - dynamicToolResults, - responseMessages: [...initialResponseMessages, ...recordedSteps.flatMap((step) => step.response.messages)], - warnings, - request: finalStep.request, - response: finalStep.response, - providerMetadata: finalStep.providerMetadata, - steps: recordedSteps, - finalStep - }, - callbacks: [onEnd, telemetryDispatcher.onEnd] - }); - } catch (error) { - controller.error(error); - } - } - }); - const stitchableStream = createStitchableStream(); - this.addStream = stitchableStream.addStream; - this.closeStream = stitchableStream.close; - const reader = stitchableStream.stream.getReader(); - let stream = new ReadableStream({ - async start(controller) { - controller.enqueue({ type: "start" }); - }, - async pull(controller) { - async function abort() { - await notify({ - event: { - callId, - steps: recordedSteps, - ...(abortSignal == null ? void 0 : abortSignal.reason) !== void 0 ? { reason: abortSignal.reason } : {} - }, - callbacks: [onAbort, telemetryDispatcher.onAbort] - }); - controller.enqueue({ - type: "abort", - ...(abortSignal == null ? void 0 : abortSignal.reason) !== void 0 ? { reason: getErrorMessage(abortSignal.reason) } : {} - }); - controller.close(); - } - try { - const { done, value } = await reader.read(); - if (done) { - controller.close(); - return; - } - if (abortSignal == null ? void 0 : abortSignal.aborted) { - await abort(); - return; - } - controller.enqueue(value); - } catch (error) { - if (isAbortError(error) && (abortSignal == null ? void 0 : abortSignal.aborted)) await abort(); - else controller.error(error); - } - }, - cancel(reason) { - return stitchableStream.stream.cancel(reason); - } - }); - let isRunning = true; - stream = stream.pipeThrough(new TransformStream({ async transform(chunk, controller) { - if (isRunning) controller.enqueue(chunk); - } })); - for (const transform of transforms) stream = stream.pipeThrough(transform({ - tools, - stopStream() { - stitchableStream.terminate(); - isRunning = false; - } - })); - this.baseStream = stream.pipeThrough(createOutputTransformStream(output != null ? output : text())).pipeThrough(eventProcessor); - const { maxRetries } = prepareRetries({ - maxRetries: maxRetriesArg, - abortSignal - }); - const callSettings = prepareLanguageModelCallOptions(settings); - const self = this; - const callId = generateCallId(); - (async () => { - var _a22; - const initialPrompt = await standardizePrompt({ - instructions, - system, - prompt, - messages, - allowSystemInMessages - }); - const startEvent = { - callId, - operationId: "ai.streamText", - provider: model.provider, - modelId: model.modelId, - instructions: initialPrompt.instructions, - messages: initialPrompt.messages, - tools, - toolChoice, - activeTools, - toolOrder, - maxOutputTokens: callSettings.maxOutputTokens, - temperature: callSettings.temperature, - topP: callSettings.topP, - topK: callSettings.topK, - presencePenalty: callSettings.presencePenalty, - frequencyPenalty: callSettings.frequencyPenalty, - stopSequences: callSettings.stopSequences, - seed: callSettings.seed, - reasoning: callSettings.reasoning, - maxRetries, - timeout, - headers, - providerOptions, - output, - runtimeContext, - toolsContext - }; - const streamTextTracingChannelContext = (_a22 = telemetryDispatcher.startTracingChannelContext) == null ? void 0 : _a22.call(telemetryDispatcher, { - type: "streamText", - event: startEvent, - completion: self._totalUsage.promise.then(() => void 0) - }); - const runInStreamTextTracingChannelContext = (execute) => { - var _a23; - return (_a23 = streamTextTracingChannelContext == null ? void 0 : streamTextTracingChannelContext.run(execute)) != null ? _a23 : execute(); - }; - const runInTracingChannelSpanInStreamText = telemetryDispatcher.runInTracingChannelSpan == null ? void 0 : (options) => runInStreamTextTracingChannelContext(() => telemetryDispatcher.runInTracingChannelSpan(options)); - await notify({ - event: startEvent, - callbacks: [onStart, telemetryDispatcher.onStart] - }); - const initialMessages = initialPrompt.messages; - let instructionsForNextStep = initialPrompt.instructions; - const { approvedToolApprovals, deniedToolApprovals } = collectToolApprovals({ messages: initialMessages }); - if (deniedToolApprovals.length > 0 || approvedToolApprovals.length > 0) { - const { approvedToolApprovals: localApprovedToolApprovals, deniedToolApprovals: revalidationDeniedToolApprovals } = await validateApprovedToolApprovals({ - approvedToolApprovals: approvedToolApprovals.filter((toolApproval2) => !toolApproval2.toolCall.providerExecuted), - tools, - toolApproval, - messages: initialMessages, - toolsContext, - runtimeContext, - toolApprovalSecret: experimental_toolApprovalSecret - }); - const localDeniedToolApprovals = [...deniedToolApprovals.filter((toolApproval2) => !toolApproval2.toolCall.providerExecuted), ...revalidationDeniedToolApprovals]; - const deniedProviderExecutedToolApprovals = deniedToolApprovals.filter((toolApproval2) => toolApproval2.toolCall.providerExecuted); - let toolExecutionStepStreamController; - const toolExecutionStepStream = new ReadableStream({ start(controller) { - toolExecutionStepStreamController = controller; - } }); - self.addStream(toolExecutionStepStream); - try { - for (const toolApproval2 of [...localDeniedToolApprovals, ...deniedProviderExecutedToolApprovals]) toolExecutionStepStreamController?.enqueue({ - type: "tool-output-denied", - toolCallId: toolApproval2.toolCall.toolCallId, - toolName: toolApproval2.toolCall.toolName - }); - const toolOutputs = []; - await Promise.all(localApprovedToolApprovals.map(async (toolApproval2) => { - const result = await executeToolCall({ - toolCall: toolApproval2.toolCall, - tools, - callId, - messages: initialMessages, - abortSignal, - timeout, - experimental_sandbox: sandbox, - toolsContext, - onToolExecutionStart: filterNullable(onToolExecutionStart, telemetryDispatcher.onToolExecutionStart), - onToolExecutionEnd: filterNullable(onToolExecutionEnd, telemetryDispatcher.onToolExecutionEnd), - executeToolInTelemetryContext: telemetryDispatcher.executeTool, - runInTracingChannelSpan: runInTracingChannelSpanInStreamText, - onPreliminaryToolResult: (result2) => { - toolExecutionStepStreamController?.enqueue(result2); - } - }); - if (result != null) { - toolExecutionStepStreamController?.enqueue(result.output); - toolOutputs.push(result.output); - } - })); - if (toolOutputs.length > 0 || localDeniedToolApprovals.length > 0) { - const localToolContent = []; - for (const output2 of toolOutputs) localToolContent.push({ - type: "tool-result", - toolCallId: output2.toolCallId, - toolName: output2.toolName, - output: await createToolModelOutput({ - toolCallId: output2.toolCallId, - input: output2.input, - tool: getOwn(tools, output2.toolName), - output: output2.type === "tool-result" ? output2.output : output2.error, - errorMode: output2.type === "tool-error" ? "text" : "none" - }) - }); - for (const toolApproval2 of localDeniedToolApprovals) localToolContent.push({ - type: "tool-result", - toolCallId: toolApproval2.toolCall.toolCallId, - toolName: toolApproval2.toolCall.toolName, - output: { - type: "execution-denied", - reason: toolApproval2.approvalResponse.reason - } - }); - initialResponseMessages.push({ - role: "tool", - content: localToolContent - }); - } - } finally { - toolExecutionStepStreamController?.close(); - } - } - self._initialResponseMessages.resolve(initialResponseMessages); - async function streamStep({ currentStep, usage }) { - var _a23, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l; - const stepTimeoutId = setAbortTimeout({ - abortController: stepAbortController, - label: "Step", - timeoutMs: stepTimeoutMs - }); - let chunkTimeoutId = void 0; - function resetChunkTimeout() { - if (chunkTimeoutId != null) clearTimeout(chunkTimeoutId); - chunkTimeoutId = setAbortTimeout({ - abortController: chunkAbortController, - label: "Chunk", - timeoutMs: chunkTimeoutMs - }); - } - function clearChunkTimeout() { - if (chunkTimeoutId != null) { - clearTimeout(chunkTimeoutId); - chunkTimeoutId = void 0; - } - } - function clearStepTimeout() { - if (stepTimeoutId != null) clearTimeout(stepTimeoutId); - } - abortSignal?.addEventListener("abort", clearStepTimeout); - abortSignal?.addEventListener("abort", clearChunkTimeout); - try { - stepFinish = new DelayedPromise(); - const stepTracingChannelContext = (_a23 = telemetryDispatcher.startTracingChannelContext) == null ? void 0 : _a23.call(telemetryDispatcher, { - type: "step", - event: { - callId, - stepNumber: currentStep - }, - completion: stepFinish.promise - }); - const runInStepTracingChannelContext = (execute) => { - var _a24; - return (_a24 = stepTracingChannelContext == null ? void 0 : stepTracingChannelContext.run(execute)) != null ? _a24 : execute(); - }; - const responseMessagesFromPreviousSteps = recordedSteps.flatMap((step) => step.response.messages); - const accumulatedResponseMessages = [...initialResponseMessages, ...responseMessagesFromPreviousSteps]; - const stepInputMessages = stepMessagesForNextStep != null ? stepMessagesForNextStep : [...initialMessages, ...initialResponseMessages]; - const prepareStepResult = await (prepareStep == null ? void 0 : prepareStep({ - model, - steps: recordedSteps, - stepNumber: recordedSteps.length, - instructions: instructionsForNextStep, - initialInstructions: initialPrompt.instructions, - messages: stepInputMessages, - initialMessages, - responseMessages: accumulatedResponseMessages, - toolsContext, - runtimeContext, - experimental_sandbox: sandbox - })); - const stepSandbox = (_b = prepareStepResult == null ? void 0 : prepareStepResult.experimental_sandbox) != null ? _b : sandbox; - runtimeContext = (_c = prepareStepResult == null ? void 0 : prepareStepResult.runtimeContext) != null ? _c : runtimeContext; - toolsContext = (_d = prepareStepResult == null ? void 0 : prepareStepResult.toolsContext) != null ? _d : toolsContext; - const stepModel = resolveLanguageModel((_e = prepareStepResult == null ? void 0 : prepareStepResult.model) != null ? _e : model); - const stepActiveTools = filterActiveTools({ - tools, - activeTools: (_f = prepareStepResult == null ? void 0 : prepareStepResult.activeTools) != null ? _f : activeTools - }); - const stepToolOrder = (_g = prepareStepResult == null ? void 0 : prepareStepResult.toolOrder) != null ? _g : toolOrder; - const stepTools = await prepareTools({ - tools: stepActiveTools, - toolOrder: stepToolOrder, - toolsContext, - experimental_sandbox: stepSandbox - }); - const stepToolChoice = prepareToolChoice({ toolChoice: (_h = prepareStepResult == null ? void 0 : prepareStepResult.toolChoice) != null ? _h : toolChoice }); - const stepMessages = (_i = prepareStepResult == null ? void 0 : prepareStepResult.messages) != null ? _i : stepInputMessages; - currentStepMessages = stepMessages; - const stepInstructions = (_k = (_j = prepareStepResult == null ? void 0 : prepareStepResult.instructions) != null ? _j : prepareStepResult == null ? void 0 : prepareStepResult.system) != null ? _k : instructionsForNextStep; - instructionsForNextStep = stepInstructions; - const stepProviderOptions = mergeObjects(providerOptions, prepareStepResult == null ? void 0 : prepareStepResult.providerOptions); - const stepStartTimestampMs = now2(); - const { retry } = prepareRetries({ - maxRetries, - abortSignal - }); - const { stream: languageModelStream, request, response } = await runInStepTracingChannelContext(() => retry(async () => { - var _a24, _b2; - return streamLanguageModelCall({ - model: (_a24 = prepareStepResult == null ? void 0 : prepareStepResult.model) != null ? _a24 : model, - tools: stepActiveTools, - toolOrder: stepToolOrder, - toolChoice: (_b2 = prepareStepResult == null ? void 0 : prepareStepResult.toolChoice) != null ? _b2 : toolChoice, - instructions: stepInstructions, - messages: stepMessages, - allowSystemInMessages, - repairToolCall, - refineToolInput, - abortSignal, - headers, - includeRawChunks: include.rawChunks, - providerOptions: stepProviderOptions, - download: download2, - output, - callId, - executeLanguageModelCallInTelemetryContext: telemetryDispatcher.executeLanguageModelCall, - toolsContext, - experimental_sandbox: stepSandbox, - onLanguageModelCallStart: filterNullable(onLanguageModelCallStart, telemetryDispatcher.onLanguageModelCallStart), - onLanguageModelCallEnd: filterNullable(onLanguageModelCallEnd, telemetryDispatcher.onLanguageModelCallEnd), - onStart: async ({ promptMessages }) => { - var _a25, _b3; - await notify({ - event: { - callId, - provider: stepModel.provider, - modelId: stepModel.modelId, - stepNumber: recordedSteps.length, - instructions: stepInstructions, - messages: stepMessages, - tools, - toolChoice: (_a25 = prepareStepResult == null ? void 0 : prepareStepResult.toolChoice) != null ? _a25 : toolChoice, - activeTools: (_b3 = prepareStepResult == null ? void 0 : prepareStepResult.activeTools) != null ? _b3 : activeTools, - toolOrder: stepToolOrder, - steps: [...recordedSteps], - providerOptions: stepProviderOptions, - runtimeContext, - toolsContext, - output, - promptMessages, - stepTools, - stepToolChoice - }, - callbacks: [onStepStart, telemetryDispatcher.onStepStart] - }); - }, - _internal: { now: now2 }, - ...callSettings - }); - })); - const streamAfterToolCallbackInvocation = invokeToolCallbacksFromStream({ - stream: languageModelStream, - tools, - stepInputMessages: stepMessages, - abortSignal, - runtimeContext - }); - const runInTracingChannelSpanInStep = telemetryDispatcher.runInTracingChannelSpan == null ? void 0 : (options) => runInStepTracingChannelContext(() => telemetryDispatcher.runInTracingChannelSpan(options)); - const streamWithToolResults = executeToolsFromStream({ - stream: streamAfterToolCallbackInvocation, - tools, - callId, - messages: stepMessages, - abortSignal, - timeout, - experimental_sandbox: stepSandbox, - toolsContext, - toolApproval, - runtimeContext, - toolApprovalSecret: experimental_toolApprovalSecret, - generateId: generateId2, - onToolExecutionStart: filterNullable(onToolExecutionStart, telemetryDispatcher.onToolExecutionStart), - onToolExecutionEnd: filterNullable(onToolExecutionEnd, telemetryDispatcher.onToolExecutionEnd), - executeToolInTelemetryContext: telemetryDispatcher.executeTool, - runInTracingChannelSpan: runInTracingChannelSpanInStep - }); - const stepRequest = { - ...request, - body: include.requestBody ? request == null ? void 0 : request.body : void 0, - messages: include.requestMessages ? cloneModelMessages(stepMessages) : void 0 - }; - recordedRequestMessages = (_l = stepRequest.messages) != null ? _l : []; - const stepToolCalls = []; - const stepToolOutputs = []; - const stepToolApprovalResponses = []; - let warnings; - let stepFinishReason = "other"; - let stepRawFinishReason = void 0; - let hasReceivedTerminalChunk = false; - let hasReceivedOutputChunk = false; - let stepUsage = createNullLanguageModelUsage(); - let stepProviderMetadata; - let stepFirstChunk = true; - let modelCallPerformance = { - responseTimeMs: 0, - effectiveOutputTokensPerSecond: 0, - outputTokensPerSecond: void 0, - inputTokensPerSecond: void 0, - effectiveTotalTokensPerSecond: 0, - timeToFirstOutputMs: void 0, - timeBetweenOutputChunksMs: void 0 - }; - const toolExecutionMs = {}; - let stepResponse = { - id: generateId2(), - timestamp: /* @__PURE__ */ new Date(), - modelId: model.modelId - }; - self.addStream(streamWithToolResults.pipeThrough(new TransformStream({ - async transform(chunk, controller) { - var _a24, _b2, _c2; - resetChunkTimeout(); - if (chunk.type === "model-call-start") { - warnings = chunk.warnings; - return; - } - if (stepFirstChunk) { - stepFirstChunk = false; - controller.enqueue({ - type: "start-step", - request: stepRequest, - warnings: warnings != null ? warnings : [] - }); - } - const chunkType = chunk.type; - if (isOutputChunkType[chunkType]) hasReceivedOutputChunk = true; - switch (chunkType) { - case "file": - case "custom": - case "source": - case "text-start": - case "text-end": - case "reasoning-start": - case "reasoning-end": - case "reasoning-delta": - case "reasoning-file": - case "tool-input-start": - case "tool-input-end": - case "tool-input-delta": - case "tool-approval-request": - controller.enqueue(chunk); - break; - case "text-delta": - if (chunk.text.length > 0) controller.enqueue(chunk); - break; - case "tool-call": - controller.enqueue(chunk); - stepToolCalls.push(chunk); - break; - case "tool-approval-response": - controller.enqueue(chunk); - stepToolApprovalResponses.push(chunk); - break; - case "tool-result": - controller.enqueue(chunk); - if (!chunk.preliminary) stepToolOutputs.push(chunk); - break; - case "tool-error": - controller.enqueue(chunk); - stepToolOutputs.push(chunk); - break; - case "tool-execution-end": - toolExecutionMs[chunk.toolCallId] = chunk.toolExecutionMs; - break; - case "model-call-response-metadata": - stepResponse = { - id: (_a24 = chunk.id) != null ? _a24 : stepResponse.id, - timestamp: (_b2 = chunk.timestamp) != null ? _b2 : stepResponse.timestamp, - modelId: (_c2 = chunk.modelId) != null ? _c2 : stepResponse.modelId - }; - break; - case "model-call-end": - hasReceivedTerminalChunk = true; - stepUsage = chunk.usage; - stepFinishReason = chunk.finishReason; - stepRawFinishReason = chunk.rawFinishReason; - stepProviderMetadata = chunk.providerMetadata; - modelCallPerformance = chunk.performance; - break; - case "error": - hasReceivedTerminalChunk = true; - controller.enqueue(chunk); - stepFinishReason = "error"; - break; - case "raw": - if (include.rawChunks) controller.enqueue(chunk); - break; - default: throw new Error(`Unknown chunk type: ${chunkType}`); - } - }, - async flush(controller) { - if (!hasReceivedTerminalChunk && !hasReceivedOutputChunk) { - controller.enqueue({ - type: "error", - error: new NoOutputGeneratedError({ message: "No output generated. The model stream ended without a finish chunk." }) - }); - clearStepTimeout(); - clearChunkTimeout(); - self.closeStream(); - return; - } - const stepTimeMs = now2() - stepStartTimestampMs; - const finishStepPart = { - type: "finish-step", - finishReason: stepFinishReason, - rawFinishReason: stepRawFinishReason, - usage: stepUsage, - performance: { - stepTimeMs, - toolExecutionMs, - ...modelCallPerformance - }, - providerMetadata: stepProviderMetadata, - response: { - ...stepResponse, - headers: response == null ? void 0 : response.headers - } - }; - controller.enqueue(finishStepPart); - const combinedUsage = addLanguageModelUsage(usage, stepUsage); - await stepFinish.promise; - const clientToolCalls = stepToolCalls.filter((toolCall) => toolCall.providerExecuted !== true); - const clientToolOutputs = stepToolOutputs.filter((toolOutput) => toolOutput.providerExecuted !== true); - const deniedToolApprovalResponses = stepToolApprovalResponses.filter((toolApprovalResponse) => toolApprovalResponse.approved === false); - for (const toolCall of stepToolCalls) { - if (toolCall.providerExecuted !== true) continue; - const tool2 = getOwn(tools, toolCall.toolName); - if ((tool2 == null ? void 0 : tool2.type) === "provider" && tool2.supportsDeferredResults) { - if (!stepToolOutputs.some((output2) => (output2.type === "tool-result" || output2.type === "tool-error") && output2.toolCallId === toolCall.toolCallId)) pendingDeferredToolCalls.set(toolCall.toolCallId, { toolName: toolCall.toolName }); - } - } - for (const output2 of stepToolOutputs) if (output2.type === "tool-result" || output2.type === "tool-error") pendingDeferredToolCalls.delete(output2.toolCallId); - clearStepTimeout(); - clearChunkTimeout(); - if ((clientToolCalls.length > 0 && clientToolCalls.length === clientToolOutputs.length + deniedToolApprovalResponses.length || pendingDeferredToolCalls.size > 0) && !await isStopConditionMet({ - stopConditions, - steps: recordedSteps - })) try { - await runInStreamTextTracingChannelContext(() => streamStep({ - currentStep: currentStep + 1, - usage: combinedUsage - })); - } catch (error) { - controller.enqueue({ - type: "error", - error - }); - self.closeStream(); - } - else { - controller.enqueue({ - type: "finish", - finishReason: stepFinishReason, - rawFinishReason: stepRawFinishReason, - totalUsage: combinedUsage - }); - self.closeStream(); - } - } - }))); - } catch (error) { - clearStepTimeout(); - clearChunkTimeout(); - throw error; - } - } - await runInStreamTextTracingChannelContext(() => streamStep({ - currentStep: 0, - usage: createNullLanguageModelUsage() - })); - })().catch(async (error) => { - var _a22; - await ((_a22 = telemetryDispatcher.onError) == null ? void 0 : _a22.call(telemetryDispatcher, { - callId, - error - })); - self._initialResponseMessages.reject(error); - markPromiseAsHandled(self._initialResponseMessages.promise); - self.addStream(new ReadableStream({ start(controller) { - controller.enqueue({ - type: "error", - error - }); - controller.close(); - } })); - self.closeStream(); - }); - } - get steps() { - this.consumeStream(); - return this._steps.promise; - } - get finalStep() { - return this.steps.then((steps) => steps.at(-1)); - } - get content() { - return this.steps.then((steps) => steps.flatMap((step) => step.content)); - } - get warnings() { - return this.steps.then((steps) => steps.flatMap((step) => { - var _a22; - return (_a22 = step.warnings) != null ? _a22 : []; - })); - } - get providerMetadata() { - return this.finalStep.then((step) => step.providerMetadata); - } - get text() { - return this.finalStep.then((step) => step.text); - } - get reasoningText() { - return this.finalStep.then((step) => step.reasoningText); - } - get reasoning() { - return this.finalStep.then((step) => convertToReasoningOutputs(step.reasoning)); - } - get sources() { - return this.steps.then((steps) => steps.flatMap((step) => step.sources)); - } - get files() { - return this.steps.then((steps) => steps.flatMap((step) => step.files)); - } - get toolCalls() { - return this.steps.then((steps) => steps.flatMap((step) => step.toolCalls)); - } - get staticToolCalls() { - return this.steps.then((steps) => steps.flatMap((step) => step.staticToolCalls)); - } - get dynamicToolCalls() { - return this.steps.then((steps) => steps.flatMap((step) => step.dynamicToolCalls)); - } - get toolResults() { - return this.steps.then((steps) => steps.flatMap((step) => step.toolResults)); - } - get staticToolResults() { - return this.steps.then((steps) => steps.flatMap((step) => step.staticToolResults)); - } - get dynamicToolResults() { - return this.steps.then((steps) => steps.flatMap((step) => step.dynamicToolResults)); - } - get usage() { - return this.totalUsage; - } - get request() { - return this.finalStep.then((step) => step.request); - } - get response() { - return this.finalStep.then((step) => step.response); - } - get responseMessages() { - return Promise.all([this._initialResponseMessages.promise, this.steps]).then(([initialResponseMessages, steps]) => [...initialResponseMessages, ...steps.flatMap((step) => step.response.messages)]); - } - get totalUsage() { - this.consumeStream(); - return this._totalUsage.promise; - } - get finishReason() { - this.consumeStream(); - return this._finishReason.promise; - } - get rawFinishReason() { - this.consumeStream(); - return this._rawFinishReason.promise; - } - /** - * Split out a new stream from the original stream. - * The original stream is replaced to allow for further splitting, - * since we do not know how many times the stream will be split. - * - * Note: this leads to buffering the stream content on the server. - * However, the LLM results are expected to be small enough to not cause issues. - */ - teeStream() { - const [stream1, stream2] = this.baseStream.tee(); - this.baseStream = stream2; - return stream1; - } - get textStream() { - return createAsyncIterableStream(toTextStream({ stream: this.stream })); - } - get stream() { - return createAsyncIterableStream(this.teeStream().pipeThrough(new TransformStream({ transform({ part }, controller) { - controller.enqueue(part); - } }))); - } - get fullStream() { - return this.stream; - } - rejectResultPromises(error) { - this.rejectResultPromise({ - delayedPromise: this._finishReason, - error - }); - this.rejectResultPromise({ - delayedPromise: this._rawFinishReason, - error - }); - this.rejectResultPromise({ - delayedPromise: this._totalUsage, - error - }); - this.rejectResultPromise({ - delayedPromise: this._steps, - error - }); - this.rejectResultPromise({ - delayedPromise: this._initialResponseMessages, - error - }); - } - rejectResultPromise({ delayedPromise, error }) { - if (delayedPromise.isPending()) { - delayedPromise.reject(error); - markPromiseAsHandled(delayedPromise.promise); - } - } - async consumeStream(options) { - var _a22; - try { - await consumeStream({ - stream: this.stream, - onError: (error) => { - var _a23; - this.rejectResultPromises(error); - (_a23 = options == null ? void 0 : options.onError) == null || _a23.call(options, error); - } - }); - } catch (error) { - this.rejectResultPromises(error); - (_a22 = options == null ? void 0 : options.onError) == null || _a22.call(options, error); - } - } - get experimental_partialOutputStream() { - return this.partialOutputStream; - } - get partialOutputStream() { - return createAsyncIterableStream(this.teeStream().pipeThrough(new TransformStream({ transform({ partialOutput }, controller) { - if (partialOutput != null) controller.enqueue(partialOutput); - } }))); - } - get elementStream() { - var _a22, _b, _c; - const transform = (_a22 = this.outputSpecification) == null ? void 0 : _a22.createElementStreamTransform(); - if (transform == null) throw new UnsupportedFunctionalityError({ functionality: `element streams in ${(_c = (_b = this.outputSpecification) == null ? void 0 : _b.name) != null ? _c : "text"} mode` }); - return createAsyncIterableStream(this.teeStream().pipeThrough(transform)); - } - get output() { - return this.finalStep.then((step) => { - var _a22; - return ((_a22 = this.outputSpecification) != null ? _a22 : text()).parseCompleteOutput({ text: step.text }, { - response: step.response, - usage: step.usage, - finishReason: step.finishReason - }); - }); - } - toUIMessageStream({ originalMessages, generateMessageId, onEnd, onFinish, messageMetadata, sendReasoning, sendSources, sendStart, sendFinish, onError } = {}) { - return createAsyncIterableStream(toUIMessageStream({ - stream: this.stream, - tools: this.tools, - originalMessages, - generateMessageId, - onEnd: onEnd != null ? onEnd : onFinish, - messageMetadata, - sendReasoning, - sendSources, - sendStart, - sendFinish, - onError - })); - } - pipeUIMessageStreamToResponse(response, { originalMessages, generateMessageId, onEnd, onFinish, messageMetadata, sendReasoning, sendSources, sendFinish, sendStart, onError, ...init } = {}) { - pipeUIMessageStreamToResponse({ - response, - stream: this.toUIMessageStream({ - originalMessages, - generateMessageId, - onEnd: onEnd != null ? onEnd : onFinish, - messageMetadata, - sendReasoning, - sendSources, - sendFinish, - sendStart, - onError - }), - ...init - }); - } - pipeTextStreamToResponse(response, init) { - pipeTextStreamToResponse({ - response, - stream: this.textStream, - ...init - }); - } - toUIMessageStreamResponse({ originalMessages, generateMessageId, onEnd, onFinish, messageMetadata, sendReasoning, sendSources, sendFinish, sendStart, onError, ...init } = {}) { - return createUIMessageStreamResponse({ - stream: this.toUIMessageStream({ - originalMessages, - generateMessageId, - onEnd: onEnd != null ? onEnd : onFinish, - messageMetadata, - sendReasoning, - sendSources, - sendFinish, - sendStart, - onError - }), - ...init - }); - } - toTextStreamResponse(init) { - return createTextStreamResponse({ - stream: this.textStream, - ...init - }); - } -}; -var ToolLoopAgent = class { - constructor(settings) { - this.version = "agent-v1"; - const { onFinish, onEnd = onFinish } = settings; - this.settings = { - ...settings, - onEnd - }; - } - /** - * The id of the agent. - */ - get id() { - return this.settings.id; - } - /** - * The tools that the agent can use. - */ - get tools() { - return this.settings.tools; - } - async prepareCall(options) { - var _a22, _b, _c, _d; - if (this.settings.callOptionsSchema != null && options.options !== void 0) { - const validatedOptions = await validateTypes({ - value: options.options, - schema: this.settings.callOptionsSchema, - context: { field: "options" } - }); - options = { - ...options, - options: validatedOptions - }; - } - const { onStart: _settingsStableOnStart, experimental_onStart: _settingsExperimentalOnStart, onStepStart: _settingsStableOnStepStart, experimental_onStepStart: _settingsExperimentalOnStepStart, onToolExecutionStart: _settingsOnToolExecutionStart, onToolExecutionEnd: _settingsOnToolExecutionEnd, onStepEnd: _settingsOnStepEnd, onStepFinish: _settingsOnStepFinish, onFinish: _settingsOnFinish, onEnd: _settingsOnEnd, ...settingsWithoutCallbacks } = this.settings; - const baseCallArgs = { - ...settingsWithoutCallbacks, - stopWhen: (_a22 = this.settings.stopWhen) != null ? _a22 : isStepCount(20), - ...options - }; - const { instructions, allowSystemInMessages, messages, prompt, runtimeContext, ...callArgs } = (_d = await ((_c = (_b = this.settings).prepareCall) == null ? void 0 : _c.call(_b, baseCallArgs))) != null ? _d : baseCallArgs; - const promptArgs = { - instructions, - allowSystemInMessages, - messages, - prompt - }; - if (runtimeContext === void 0) return { - ...callArgs, - ...promptArgs - }; - return { - ...callArgs, - runtimeContext, - ...promptArgs - }; - } - /** - * Tags outgoing requests so usage can be attributed to ToolLoopAgent. Chains - * with the `ai/` and `ai-sdk//` suffixes added - * downstream by generateText/streamText and the provider. - */ - agentHeaders(preparedCall) { - var _a22; - return withUserAgentSuffix((_a22 = preparedCall.headers) != null ? _a22 : {}, "ai-sdk-agent/tool-loop"); - } - /** - * Generates an output from the agent (non-streaming). - */ - async generate({ abortSignal, timeout, experimental_sandbox: sandbox, onStart, experimental_onStart, onStepStart, experimental_onStepStart, onToolExecutionStart, onToolExecutionEnd, onStepEnd, onStepFinish, onFinish, onEnd = onFinish, ...options }) { - var _a22, _b, _c; - const generate = generateText; - const preparedCall = await this.prepareCall({ - ...options, - experimental_sandbox: sandbox - }); - const callbackArgs = { - abortSignal, - timeout, - experimental_sandbox: sandbox, - onStart: mergeCallbacks((_a22 = this.settings.onStart) != null ? _a22 : this.settings.experimental_onStart, onStart != null ? onStart : experimental_onStart), - onStepStart: mergeCallbacks((_b = this.settings.onStepStart) != null ? _b : this.settings.experimental_onStepStart, onStepStart != null ? onStepStart : experimental_onStepStart), - onToolExecutionStart: mergeCallbacks(this.settings.onToolExecutionStart, onToolExecutionStart), - onToolExecutionEnd: mergeCallbacks(this.settings.onToolExecutionEnd, onToolExecutionEnd), - onStepEnd: mergeCallbacks((_c = this.settings.onStepEnd) != null ? _c : this.settings.onStepFinish, onStepEnd != null ? onStepEnd : onStepFinish), - onEnd: mergeCallbacks(this.settings.onEnd, onEnd) - }; - return await generate({ - ...preparedCall, - ...callbackArgs, - headers: this.agentHeaders(preparedCall) - }); - } - /** - * Streams an output from the agent (streaming). - */ - async stream({ abortSignal, timeout, experimental_sandbox: sandbox, experimental_transform, onStart, experimental_onStart, onStepStart, experimental_onStepStart, onToolExecutionStart, onToolExecutionEnd, onStepEnd, onStepFinish, onFinish, onEnd = onFinish, ...options }) { - var _a22, _b, _c; - const stream = streamText; - const preparedCall = await this.prepareCall({ - ...options, - experimental_sandbox: sandbox - }); - const callbackArgs = { - abortSignal, - timeout, - experimental_sandbox: sandbox, - experimental_transform, - onStart: mergeCallbacks((_a22 = this.settings.onStart) != null ? _a22 : this.settings.experimental_onStart, onStart != null ? onStart : experimental_onStart), - onStepStart: mergeCallbacks((_b = this.settings.onStepStart) != null ? _b : this.settings.experimental_onStepStart, onStepStart != null ? onStepStart : experimental_onStepStart), - onToolExecutionStart: mergeCallbacks(this.settings.onToolExecutionStart, onToolExecutionStart), - onToolExecutionEnd: mergeCallbacks(this.settings.onToolExecutionEnd, onToolExecutionEnd), - onStepEnd: mergeCallbacks((_c = this.settings.onStepEnd) != null ? _c : this.settings.onStepFinish, onStepEnd != null ? onStepEnd : onStepFinish), - onEnd: mergeCallbacks(this.settings.onEnd, onEnd) - }; - return await stream({ - ...preparedCall, - ...callbackArgs, - headers: this.agentHeaders(preparedCall) - }); - } -}; -var toolMetadataSchema2 = record(string(), jsonValueSchema.optional()); -var providerReferenceSchema2 = record(string(), string()); -lazySchema(() => zodSchema(array$1(object$1({ - id: string(), - role: _enum([ - "system", - "user", - "assistant" - ]), - metadata: unknown().optional(), - parts: array$1(union([ - object$1({ - type: literal("text"), - text: string(), - state: _enum(["streaming", "done"]).optional(), - providerMetadata: providerMetadataSchema.optional() - }), - object$1({ - type: literal("reasoning"), - text: string(), - state: _enum(["streaming", "done"]).optional(), - providerMetadata: providerMetadataSchema.optional() - }), - object$1({ - type: literal("custom"), - kind: string(), - providerMetadata: providerMetadataSchema.optional() - }), - object$1({ - type: literal("source-url"), - sourceId: string(), - url: string(), - title: string().optional(), - providerMetadata: providerMetadataSchema.optional() - }), - object$1({ - type: literal("source-document"), - sourceId: string(), - mediaType: string(), - title: string(), - filename: string().optional(), - providerMetadata: providerMetadataSchema.optional() - }), - object$1({ - type: literal("file"), - mediaType: string(), - filename: string().optional(), - url: string(), - providerReference: providerReferenceSchema2.optional(), - providerMetadata: providerMetadataSchema.optional() - }), - object$1({ - type: literal("reasoning-file"), - mediaType: string(), - url: string(), - providerMetadata: providerMetadataSchema.optional() - }), - object$1({ type: literal("step-start") }), - object$1({ - type: string().startsWith("data-"), - id: string().optional(), - data: unknown() - }), - object$1({ - type: literal("dynamic-tool"), - toolName: string(), - toolCallId: string(), - toolMetadata: toolMetadataSchema2.optional(), - state: literal("input-streaming"), - input: unknown().optional(), - providerExecuted: boolean().optional(), - callProviderMetadata: providerMetadataSchema.optional(), - output: never().optional(), - errorText: never().optional(), - approval: never().optional() - }), - object$1({ - type: literal("dynamic-tool"), - toolName: string(), - toolCallId: string(), - toolMetadata: toolMetadataSchema2.optional(), - state: literal("input-available"), - input: unknown(), - providerExecuted: boolean().optional(), - output: never().optional(), - errorText: never().optional(), - callProviderMetadata: providerMetadataSchema.optional(), - approval: never().optional() - }), - object$1({ - type: literal("dynamic-tool"), - toolName: string(), - toolCallId: string(), - toolMetadata: toolMetadataSchema2.optional(), - state: literal("approval-requested"), - input: unknown(), - providerExecuted: boolean().optional(), - output: never().optional(), - errorText: never().optional(), - callProviderMetadata: providerMetadataSchema.optional(), - approval: object$1({ - id: string(), - approved: never().optional(), - reason: never().optional(), - isAutomatic: boolean().optional(), - signature: string().optional() - }) - }), - object$1({ - type: literal("dynamic-tool"), - toolName: string(), - toolCallId: string(), - toolMetadata: toolMetadataSchema2.optional(), - state: literal("approval-responded"), - input: unknown(), - providerExecuted: boolean().optional(), - output: never().optional(), - errorText: never().optional(), - callProviderMetadata: providerMetadataSchema.optional(), - approval: object$1({ - id: string(), - approved: boolean(), - reason: string().optional(), - isAutomatic: boolean().optional(), - signature: string().optional() - }) - }), - object$1({ - type: literal("dynamic-tool"), - toolName: string(), - toolCallId: string(), - toolMetadata: toolMetadataSchema2.optional(), - state: literal("output-available"), - input: unknown(), - providerExecuted: boolean().optional(), - output: unknown(), - errorText: never().optional(), - callProviderMetadata: providerMetadataSchema.optional(), - resultProviderMetadata: providerMetadataSchema.optional(), - preliminary: boolean().optional(), - approval: object$1({ - id: string(), - approved: literal(true), - reason: string().optional(), - isAutomatic: boolean().optional(), - signature: string().optional() - }).optional() - }), - object$1({ - type: literal("dynamic-tool"), - toolName: string(), - toolCallId: string(), - toolMetadata: toolMetadataSchema2.optional(), - state: literal("output-error"), - input: unknown().optional(), - rawInput: unknown().optional(), - providerExecuted: boolean().optional(), - output: never().optional(), - errorText: string(), - callProviderMetadata: providerMetadataSchema.optional(), - resultProviderMetadata: providerMetadataSchema.optional(), - approval: object$1({ - id: string(), - approved: literal(true), - reason: string().optional(), - isAutomatic: boolean().optional(), - signature: string().optional() - }).optional() - }), - object$1({ - type: literal("dynamic-tool"), - toolName: string(), - toolCallId: string(), - toolMetadata: toolMetadataSchema2.optional(), - state: literal("output-denied"), - input: unknown(), - providerExecuted: boolean().optional(), - output: never().optional(), - errorText: never().optional(), - callProviderMetadata: providerMetadataSchema.optional(), - approval: object$1({ - id: string(), - approved: literal(false), - reason: string().optional(), - isAutomatic: boolean().optional(), - signature: string().optional() - }) - }), - object$1({ - type: string().startsWith("tool-"), - toolCallId: string(), - toolMetadata: toolMetadataSchema2.optional(), - state: literal("input-streaming"), - providerExecuted: boolean().optional(), - callProviderMetadata: providerMetadataSchema.optional(), - input: unknown().optional(), - output: never().optional(), - errorText: never().optional(), - approval: never().optional() - }), - object$1({ - type: string().startsWith("tool-"), - toolCallId: string(), - toolMetadata: toolMetadataSchema2.optional(), - state: literal("input-available"), - providerExecuted: boolean().optional(), - input: unknown(), - output: never().optional(), - errorText: never().optional(), - callProviderMetadata: providerMetadataSchema.optional(), - approval: never().optional() - }), - object$1({ - type: string().startsWith("tool-"), - toolCallId: string(), - toolMetadata: toolMetadataSchema2.optional(), - state: literal("approval-requested"), - input: unknown(), - providerExecuted: boolean().optional(), - output: never().optional(), - errorText: never().optional(), - callProviderMetadata: providerMetadataSchema.optional(), - approval: object$1({ - id: string(), - approved: never().optional(), - reason: never().optional(), - isAutomatic: boolean().optional(), - signature: string().optional() - }) - }), - object$1({ - type: string().startsWith("tool-"), - toolCallId: string(), - toolMetadata: toolMetadataSchema2.optional(), - state: literal("approval-responded"), - input: unknown(), - providerExecuted: boolean().optional(), - output: never().optional(), - errorText: never().optional(), - callProviderMetadata: providerMetadataSchema.optional(), - approval: object$1({ - id: string(), - approved: boolean(), - reason: string().optional(), - isAutomatic: boolean().optional(), - signature: string().optional() - }) - }), - object$1({ - type: string().startsWith("tool-"), - toolCallId: string(), - toolMetadata: toolMetadataSchema2.optional(), - state: literal("output-available"), - providerExecuted: boolean().optional(), - input: unknown(), - output: unknown(), - errorText: never().optional(), - callProviderMetadata: providerMetadataSchema.optional(), - resultProviderMetadata: providerMetadataSchema.optional(), - preliminary: boolean().optional(), - approval: object$1({ - id: string(), - approved: literal(true), - reason: string().optional(), - isAutomatic: boolean().optional(), - signature: string().optional() - }).optional() - }), - object$1({ - type: string().startsWith("tool-"), - toolCallId: string(), - toolMetadata: toolMetadataSchema2.optional(), - state: literal("output-error"), - providerExecuted: boolean().optional(), - input: unknown().optional(), - rawInput: unknown().optional(), - output: never().optional(), - errorText: string(), - callProviderMetadata: providerMetadataSchema.optional(), - resultProviderMetadata: providerMetadataSchema.optional(), - approval: object$1({ - id: string(), - approved: literal(true), - reason: string().optional(), - isAutomatic: boolean().optional(), - signature: string().optional() - }).optional() - }), - object$1({ - type: string().startsWith("tool-"), - toolCallId: string(), - toolMetadata: toolMetadataSchema2.optional(), - state: literal("output-denied"), - providerExecuted: boolean().optional(), - input: unknown(), - output: never().optional(), - errorText: never().optional(), - callProviderMetadata: providerMetadataSchema.optional(), - approval: object$1({ - id: string(), - approved: literal(false), - reason: string().optional(), - isAutomatic: boolean().optional(), - signature: string().optional() - }) - }) - ])) -}).superRefine((message, context) => { - if (message.role !== "assistant" && message.parts.length === 0) context.addIssue({ - origin: "array", - code: "too_small", - minimum: 1, - inclusive: true, - input: message.parts, - path: ["parts"], - message: "Message must contain at least one part" - }); -})).nonempty("Messages array must not be empty"))); -createIdGenerator({ - prefix: "call", - size: 24 -}); -createIdGenerator({ - prefix: "call", - size: 24 -}); -function convertDataContentToBase64String(content) { - if (typeof content === "string") return content; - if (content instanceof ArrayBuffer) return convertUint8ArrayToBase64(new Uint8Array(content)); - return convertUint8ArrayToBase64(content); -} -createIdGenerator({ - prefix: "aiobj", - size: 24 -}); -function createDownload(options) { - return ({ url, abortSignal }) => download({ - url, - maxBytes: options == null ? void 0 : options.maxBytes, - abortSignal - }); -} -createIdGenerator({ - prefix: "aiobj", - size: 24 -}); -createIdGenerator({ - prefix: "call", - size: 24 -}); -//#endregion -//#region node_modules/ai/dist/test/index.js -function notImplemented() { - throw new Error("Not implemented"); -} -var MockLanguageModelV3 = class { - constructor({ provider = "mock-provider", modelId = "mock-model-id", supportedUrls = {}, doGenerate = notImplemented, doStream = notImplemented } = {}) { - this.specificationVersion = "v3"; - this.doGenerateCalls = []; - this.doStreamCalls = []; - this.provider = provider; - this.modelId = modelId; - this.doGenerate = async (options) => { - this.doGenerateCalls.push(options); - if (typeof doGenerate === "function") return await doGenerate(options); - else if (Array.isArray(doGenerate)) return doGenerate[this.doGenerateCalls.length - 1]; - else return doGenerate; - }; - this.doStream = async (options) => { - this.doStreamCalls.push(options); - if (typeof doStream === "function") return await doStream(options); - else if (Array.isArray(doStream)) return doStream[this.doStreamCalls.length - 1]; - else return doStream; - }; - this._supportedUrls = typeof supportedUrls === "function" ? supportedUrls : async () => await supportedUrls; - } - get supportedUrls() { - return this._supportedUrls(); - } -}; -//#endregion -export { generateText as a, dist_exports as i, ToolLoopAgent as n, isStepCount as o, convertDataContentToBase64String as r, registerTelemetry as s, MockLanguageModelV3 as t }; diff --git a/.output/server/_libs/croner.mjs b/.output/server/_libs/croner.mjs deleted file mode 100644 index 0328bcf..0000000 --- a/.output/server/_libs/croner.mjs +++ /dev/null @@ -1,743 +0,0 @@ -import { fileURLToPath as __eveFileURLToPath } from "node:url"; -import { dirname as __eveDirname } from "node:path"; -__eveDirname(__eveFileURLToPath(import.meta.url)); -//#region node_modules/nitro/dist/node_modules/croner/dist/croner.js -function T(s) { - return Date.UTC(s.y, s.m - 1, s.d, s.h, s.i, s.s); -} -function D(s, e) { - return s.y === e.y && s.m === e.m && s.d === e.d && s.h === e.h && s.i === e.i && s.s === e.s; -} -function A(s, e) { - let t = new Date(Date.parse(s)); - if (isNaN(t)) throw new Error("Invalid ISO8601 passed to timezone parser."); - let r = s.substring(9); - return r.includes("Z") || r.includes("+") || r.includes("-") ? b(t.getUTCFullYear(), t.getUTCMonth() + 1, t.getUTCDate(), t.getUTCHours(), t.getUTCMinutes(), t.getUTCSeconds(), "Etc/UTC") : b(t.getFullYear(), t.getMonth() + 1, t.getDate(), t.getHours(), t.getMinutes(), t.getSeconds(), e); -} -function v(s, e, t) { - return k(A(s, e), t); -} -function k(s, e) { - let t = new Date(T(s)), r = g(t, s.tz), a = T(s) - T(r), o = new Date(t.getTime() + a), h = g(o, s.tz); - if (D(h, s)) { - let u = /* @__PURE__ */ new Date(o.getTime() - 36e5); - return D(g(u, s.tz), s) ? u : o; - } - let l = new Date(o.getTime() + T(s) - T(h)); - if (D(g(l, s.tz), s)) return l; - if (e) throw new Error("Invalid date passed to fromTZ()"); - return o.getTime() > l.getTime() ? o : l; -} -function g(s, e) { - let t, r; - try { - t = new Intl.DateTimeFormat("en-US", { - timeZone: e, - year: "numeric", - month: "numeric", - day: "numeric", - hour: "numeric", - minute: "numeric", - second: "numeric", - hour12: !1 - }), r = t.formatToParts(s); - } catch (i) { - let a = i instanceof Error ? i.message : String(i); - throw new RangeError(`toTZ: Invalid timezone '${e}' or date. Please provide a valid IANA timezone (e.g., 'America/New_York', 'Europe/Stockholm'). Original error: ${a}`); - } - let n = { - year: 0, - month: 0, - day: 0, - hour: 0, - minute: 0, - second: 0 - }; - for (let i of r) (i.type === "year" || i.type === "month" || i.type === "day" || i.type === "hour" || i.type === "minute" || i.type === "second") && (n[i.type] = parseInt(i.value, 10)); - if (isNaN(n.year) || isNaN(n.month) || isNaN(n.day) || isNaN(n.hour) || isNaN(n.minute) || isNaN(n.second)) throw new Error(`toTZ: Failed to parse all date components from timezone '${e}'. This may indicate an invalid date or timezone configuration. Parsed components: ${JSON.stringify(n)}`); - return n.hour === 24 && (n.hour = 0), { - y: n.year, - m: n.month, - d: n.day, - h: n.hour, - i: n.minute, - s: n.second, - tz: e - }; -} -function b(s, e, t, r, n, i, a) { - return { - y: s, - m: e, - d: t, - h: r, - i: n, - s: i, - tz: a - }; -} -var O = [ - 1, - 2, - 4, - 8, - 16 -]; -var C = class { - pattern; - timezone; - mode; - alternativeWeekdays; - sloppyRanges; - second; - minute; - hour; - day; - month; - dayOfWeek; - year; - lastDayOfMonth; - lastWeekday; - nearestWeekdays; - starDOM; - starDOW; - starYear; - useAndLogic; - constructor(e, t, r) { - this.pattern = e, this.timezone = t, this.mode = r?.mode ?? "auto", this.alternativeWeekdays = r?.alternativeWeekdays ?? !1, this.sloppyRanges = r?.sloppyRanges ?? !1, this.second = Array(60).fill(0), this.minute = Array(60).fill(0), this.hour = Array(24).fill(0), this.day = Array(31).fill(0), this.month = Array(12).fill(0), this.dayOfWeek = Array(7).fill(0), this.year = Array(1e4).fill(0), this.lastDayOfMonth = !1, this.lastWeekday = !1, this.nearestWeekdays = Array(31).fill(0), this.starDOM = !1, this.starDOW = !1, this.starYear = !1, this.useAndLogic = !1, this.parse(); - } - parse() { - if (!(typeof this.pattern == "string" || this.pattern instanceof String)) throw new TypeError("CronPattern: Pattern has to be of type string."); - this.pattern.indexOf("@") >= 0 && (this.pattern = this.handleNicknames(this.pattern).trim()); - let e = this.pattern.match(/\S+/g) || [""], t = e.length; - if (e.length < 5 || e.length > 7) throw new TypeError("CronPattern: invalid configuration format ('" + this.pattern + "'), exactly five, six, or seven space separated parts are required."); - if (this.mode !== "auto") { - let n; - switch (this.mode) { - case "5-part": - n = 5; - break; - case "6-part": - n = 6; - break; - case "7-part": - n = 7; - break; - case "5-or-6-parts": - n = [5, 6]; - break; - case "6-or-7-parts": - n = [6, 7]; - break; - default: n = 0; - } - if (!(Array.isArray(n) ? n.includes(t) : t === n)) { - let a = Array.isArray(n) ? n.join(" or ") : n.toString(); - throw new TypeError(`CronPattern: mode '${this.mode}' requires exactly ${a} parts, but pattern '${this.pattern}' has ${t} parts.`); - } - } - if (e.length === 5 && e.unshift("0"), e.length === 6 && e.push("*"), e[3].toUpperCase() === "LW" ? (this.lastWeekday = !0, e[3] = "") : e[3].toUpperCase().indexOf("L") >= 0 && (e[3] = e[3].replace(/L/gi, ""), this.lastDayOfMonth = !0), e[3] == "*" && (this.starDOM = !0), e[6] == "*" && (this.starYear = !0), e[4].length >= 3 && (e[4] = this.replaceAlphaMonths(e[4])), e[5].length >= 3 && (e[5] = this.alternativeWeekdays ? this.replaceAlphaDaysQuartz(e[5]) : this.replaceAlphaDays(e[5])), e[5].startsWith("+") && (this.useAndLogic = !0, e[5] = e[5].substring(1), e[5] === "")) throw new TypeError("CronPattern: Day-of-week field cannot be empty after '+' modifier."); - switch (e[5] == "*" && (this.starDOW = !0), this.pattern.indexOf("?") >= 0 && (e[0] = e[0].replace(/\?/g, "*"), e[1] = e[1].replace(/\?/g, "*"), e[2] = e[2].replace(/\?/g, "*"), e[3] = e[3].replace(/\?/g, "*"), e[4] = e[4].replace(/\?/g, "*"), e[5] = e[5].replace(/\?/g, "*"), e[6] && (e[6] = e[6].replace(/\?/g, "*"))), this.mode) { - case "5-part": - e[0] = "0", e[6] = "*"; - break; - case "6-part": - e[6] = "*"; - break; - case "5-or-6-parts": - e[6] = "*"; - break; - case "6-or-7-parts": break; - case "7-part": - case "auto": break; - } - this.throwAtIllegalCharacters(e), this.partToArray("second", e[0], 0, 1), this.partToArray("minute", e[1], 0, 1), this.partToArray("hour", e[2], 0, 1), this.partToArray("day", e[3], -1, 1), this.partToArray("month", e[4], -1, 1); - let r = this.alternativeWeekdays ? -1 : 0; - this.partToArray("dayOfWeek", e[5], r, 63), this.partToArray("year", e[6], 0, 1), !this.alternativeWeekdays && this.dayOfWeek[7] && (this.dayOfWeek[0] = this.dayOfWeek[7]); - } - partToArray(e, t, r, n) { - let i = this[e], a = e === "day" && this.lastDayOfMonth, o = e === "day" && this.lastWeekday; - if (t === "" && !a && !o) throw new TypeError("CronPattern: configuration entry " + e + " (" + t + ") is empty, check for trailing spaces."); - if (t === "*") return i.fill(n); - let h = t.split(","); - if (h.length > 1) for (let l = 0; l < h.length; l++) this.partToArray(e, h[l], r, n); - else t.indexOf("-") !== -1 && t.indexOf("/") !== -1 ? this.handleRangeWithStepping(t, e, r, n) : t.indexOf("-") !== -1 ? this.handleRange(t, e, r, n) : t.indexOf("/") !== -1 ? this.handleStepping(t, e, r, n) : t !== "" && this.handleNumber(t, e, r, n); - } - throwAtIllegalCharacters(e) { - for (let t = 0; t < e.length; t++) if ((t === 3 ? /[^/*0-9,\-WwLl]+/ : t === 5 ? /[^/*0-9,\-#Ll]+/ : /[^/*0-9,\-]+/).test(e[t])) throw new TypeError("CronPattern: configuration entry " + t + " (" + e[t] + ") contains illegal characters."); - } - handleNumber(e, t, r, n) { - let i = this.extractNth(e, t), a = e.toUpperCase().includes("W"); - if (t !== "day" && a) throw new TypeError("CronPattern: Nearest weekday modifier (W) only allowed in day-of-month."); - a && (t = "nearestWeekdays"); - let o = parseInt(i[0], 10) + r; - if (isNaN(o)) throw new TypeError("CronPattern: " + t + " is not a number: '" + e + "'"); - this.setPart(t, o, i[1] || n); - } - setPart(e, t, r) { - if (!Object.prototype.hasOwnProperty.call(this, e)) throw new TypeError("CronPattern: Invalid part specified: " + e); - if (e === "dayOfWeek") { - if (t === 7 && (t = 0), t < 0 || t > 6) throw new RangeError("CronPattern: Invalid value for dayOfWeek: " + t); - this.setNthWeekdayOfMonth(t, r); - return; - } - if (e === "second" || e === "minute") { - if (t < 0 || t >= 60) throw new RangeError("CronPattern: Invalid value for " + e + ": " + t); - } else if (e === "hour") { - if (t < 0 || t >= 24) throw new RangeError("CronPattern: Invalid value for " + e + ": " + t); - } else if (e === "day" || e === "nearestWeekdays") { - if (t < 0 || t >= 31) throw new RangeError("CronPattern: Invalid value for " + e + ": " + t); - } else if (e === "month") { - if (t < 0 || t >= 12) throw new RangeError("CronPattern: Invalid value for " + e + ": " + t); - } else if (e === "year" && (t < 1 || t >= 1e4)) throw new RangeError("CronPattern: Invalid value for " + e + ": " + t + " (supported range: 1-9999)"); - this[e][t] = r; - } - validateNotNaN(e, t) { - if (isNaN(e)) throw new TypeError(t); - } - validateRange(e, t, r, n, i) { - if (e > t) throw new TypeError("CronPattern: From value is larger than to value: '" + i + "'"); - if (r !== void 0) { - if (r === 0) throw new TypeError("CronPattern: Syntax error, illegal stepping: 0"); - if (r > this[n].length) throw new TypeError("CronPattern: Syntax error, steps cannot be greater than maximum value of part (" + this[n].length + ")"); - } - } - handleRangeWithStepping(e, t, r, n) { - if (e.toUpperCase().includes("W")) throw new TypeError("CronPattern: Syntax error, W is not allowed in ranges with stepping."); - let i = this.extractNth(e, t), a = i[0].match(/^(\d+)-(\d+)\/(\d+)$/); - if (a === null) throw new TypeError("CronPattern: Syntax error, illegal range with stepping: '" + e + "'"); - let [, o, h, l] = a, y = parseInt(o, 10) + r, u = parseInt(h, 10) + r, d = parseInt(l, 10); - this.validateNotNaN(y, "CronPattern: Syntax error, illegal lower range (NaN)"), this.validateNotNaN(u, "CronPattern: Syntax error, illegal upper range (NaN)"), this.validateNotNaN(d, "CronPattern: Syntax error, illegal stepping: (NaN)"), this.validateRange(y, u, d, t, e); - for (let c = y; c <= u; c += d) this.setPart(t, c, i[1] || n); - } - extractNth(e, t) { - let r = e, n; - if (r.includes("#")) { - if (t !== "dayOfWeek") throw new Error("CronPattern: nth (#) only allowed in day-of-week field"); - n = r.split("#")[1], r = r.split("#")[0]; - } else if (r.toUpperCase().endsWith("L")) { - if (t !== "dayOfWeek") throw new Error("CronPattern: L modifier only allowed in day-of-week field (use L alone for day-of-month)"); - n = "L", r = r.slice(0, -1); - } - return [r, n]; - } - handleRange(e, t, r, n) { - if (e.toUpperCase().includes("W")) throw new TypeError("CronPattern: Syntax error, W is not allowed in a range."); - let i = this.extractNth(e, t), a = i[0].split("-"); - if (a.length !== 2) throw new TypeError("CronPattern: Syntax error, illegal range: '" + e + "'"); - let o = parseInt(a[0], 10) + r, h = parseInt(a[1], 10) + r; - this.validateNotNaN(o, "CronPattern: Syntax error, illegal lower range (NaN)"), this.validateNotNaN(h, "CronPattern: Syntax error, illegal upper range (NaN)"), this.validateRange(o, h, void 0, t, e); - for (let l = o; l <= h; l++) this.setPart(t, l, i[1] || n); - } - handleStepping(e, t, r, n) { - if (e.toUpperCase().includes("W")) throw new TypeError("CronPattern: Syntax error, W is not allowed in parts with stepping."); - let i = this.extractNth(e, t), a = i[0].split("/"); - if (a.length !== 2) throw new TypeError("CronPattern: Syntax error, illegal stepping: '" + e + "'"); - if (this.sloppyRanges) a[0] === "" && (a[0] = "*"); - else { - if (a[0] === "") throw new TypeError("CronPattern: Syntax error, stepping with missing prefix ('" + e + "') is not allowed. Use wildcard (*/step) or range (min-max/step) instead."); - if (a[0] !== "*") throw new TypeError("CronPattern: Syntax error, stepping with numeric prefix ('" + e + "') is not allowed. Use wildcard (*/step) or range (min-max/step) instead."); - } - let o = 0; - a[0] !== "*" && (o = parseInt(a[0], 10) + r); - let h = parseInt(a[1], 10); - this.validateNotNaN(h, "CronPattern: Syntax error, illegal stepping: (NaN)"), this.validateRange(0, this[t].length - 1, h, t, e); - for (let l = o; l < this[t].length; l += h) this.setPart(t, l, i[1] || n); - } - replaceAlphaDays(e) { - return e.replace(/-sun/gi, "-7").replace(/sun/gi, "0").replace(/mon/gi, "1").replace(/tue/gi, "2").replace(/wed/gi, "3").replace(/thu/gi, "4").replace(/fri/gi, "5").replace(/sat/gi, "6"); - } - replaceAlphaDaysQuartz(e) { - return e.replace(/sun/gi, "1").replace(/mon/gi, "2").replace(/tue/gi, "3").replace(/wed/gi, "4").replace(/thu/gi, "5").replace(/fri/gi, "6").replace(/sat/gi, "7"); - } - replaceAlphaMonths(e) { - return e.replace(/jan/gi, "1").replace(/feb/gi, "2").replace(/mar/gi, "3").replace(/apr/gi, "4").replace(/may/gi, "5").replace(/jun/gi, "6").replace(/jul/gi, "7").replace(/aug/gi, "8").replace(/sep/gi, "9").replace(/oct/gi, "10").replace(/nov/gi, "11").replace(/dec/gi, "12"); - } - handleNicknames(e) { - let t = e.trim().toLowerCase(); - if (t === "@yearly" || t === "@annually") return "0 0 1 1 *"; - if (t === "@monthly") return "0 0 1 * *"; - if (t === "@weekly") return "0 0 * * 0"; - if (t === "@daily" || t === "@midnight") return "0 0 * * *"; - if (t === "@hourly") return "0 * * * *"; - if (t === "@reboot") throw new TypeError("CronPattern: @reboot is not supported in this environment. This is an event-based trigger that requires system startup detection."); - return e; - } - setNthWeekdayOfMonth(e, t) { - if (typeof t != "number" && t.toUpperCase() === "L") this.dayOfWeek[e] = this.dayOfWeek[e] | 32; - else if (t === 63) this.dayOfWeek[e] = 63; - else if (t < 6 && t > 0) this.dayOfWeek[e] = this.dayOfWeek[e] | O[t - 1]; - else throw new TypeError(`CronPattern: nth weekday out of range, should be 1-5 or L. Value: ${t}, Type: ${typeof t}`); - } -}; -var P = [ - 31, - 28, - 31, - 30, - 31, - 30, - 31, - 31, - 30, - 31, - 30, - 31 -]; -var f = [ - [ - "month", - "year", - 0 - ], - [ - "day", - "month", - -1 - ], - [ - "hour", - "day", - 0 - ], - [ - "minute", - "hour", - 0 - ], - [ - "second", - "minute", - 0 - ] -]; -var m = class s { - tz; - ms; - second; - minute; - hour; - day; - month; - year; - constructor(e, t) { - if (this.tz = t, e && e instanceof Date) if (!isNaN(e)) this.fromDate(e); - else throw new TypeError("CronDate: Invalid date passed to CronDate constructor"); - else if (e == null) this.fromDate(/* @__PURE__ */ new Date()); - else if (e && typeof e == "string") this.fromString(e); - else if (e instanceof s) this.fromCronDate(e); - else throw new TypeError("CronDate: Invalid type (" + typeof e + ") passed to CronDate constructor"); - } - getLastDayOfMonth(e, t) { - return t !== 1 ? P[t] : new Date(Date.UTC(e, t + 1, 0)).getUTCDate(); - } - getLastWeekday(e, t) { - let r = this.getLastDayOfMonth(e, t), i = new Date(Date.UTC(e, t, r)).getUTCDay(); - return i === 0 ? r - 2 : i === 6 ? r - 1 : r; - } - getNearestWeekday(e, t, r) { - let n = this.getLastDayOfMonth(e, t); - if (r > n) return -1; - let a = new Date(Date.UTC(e, t, r)).getUTCDay(); - return a === 0 ? r === n ? r - 2 : r + 1 : a === 6 ? r === 1 ? r + 2 : r - 1 : r; - } - isNthWeekdayOfMonth(e, t, r, n) { - let a = new Date(Date.UTC(e, t, r)).getUTCDay(), o = 0; - for (let h = 1; h <= r; h++) new Date(Date.UTC(e, t, h)).getUTCDay() === a && o++; - if (n & 63 && O[o - 1] & n) return !0; - if (n & 32) { - let h = this.getLastDayOfMonth(e, t); - for (let l = r + 1; l <= h; l++) if (new Date(Date.UTC(e, t, l)).getUTCDay() === a) return !1; - return !0; - } - return !1; - } - fromDate(e) { - if (this.tz !== void 0) if (typeof this.tz == "number") this.ms = e.getUTCMilliseconds(), this.second = e.getUTCSeconds(), this.minute = e.getUTCMinutes() + this.tz, this.hour = e.getUTCHours(), this.day = e.getUTCDate(), this.month = e.getUTCMonth(), this.year = e.getUTCFullYear(), this.apply(); - else try { - let t = g(e, this.tz); - this.ms = e.getMilliseconds(), this.second = t.s, this.minute = t.i, this.hour = t.h, this.day = t.d, this.month = t.m - 1, this.year = t.y; - } catch (t) { - let r = t instanceof Error ? t.message : String(t); - throw new TypeError(`CronDate: Failed to convert date to timezone '${this.tz}'. This may happen with invalid timezone names or dates. Original error: ${r}`); - } - else this.ms = e.getMilliseconds(), this.second = e.getSeconds(), this.minute = e.getMinutes(), this.hour = e.getHours(), this.day = e.getDate(), this.month = e.getMonth(), this.year = e.getFullYear(); - } - fromCronDate(e) { - this.tz = e.tz, this.year = e.year, this.month = e.month, this.day = e.day, this.hour = e.hour, this.minute = e.minute, this.second = e.second, this.ms = e.ms; - } - apply() { - if (this.month > 11 || this.month < 0 || this.day > P[this.month] || this.day < 1 || this.hour > 59 || this.minute > 59 || this.second > 59 || this.hour < 0 || this.minute < 0 || this.second < 0) { - let e = new Date(Date.UTC(this.year, this.month, this.day, this.hour, this.minute, this.second, this.ms)); - return this.ms = e.getUTCMilliseconds(), this.second = e.getUTCSeconds(), this.minute = e.getUTCMinutes(), this.hour = e.getUTCHours(), this.day = e.getUTCDate(), this.month = e.getUTCMonth(), this.year = e.getUTCFullYear(), !0; - } else return !1; - } - fromString(e) { - if (typeof this.tz == "number") { - let t = v(e); - this.ms = t.getUTCMilliseconds(), this.second = t.getUTCSeconds(), this.minute = t.getUTCMinutes(), this.hour = t.getUTCHours(), this.day = t.getUTCDate(), this.month = t.getUTCMonth(), this.year = t.getUTCFullYear(), this.apply(); - } else return this.fromDate(v(e, this.tz)); - } - findNext(e, t, r, n) { - return this._findMatch(e, t, r, n, 1); - } - _findMatch(e, t, r, n, i) { - let a = this[t], o; - r.lastDayOfMonth && (o = this.getLastDayOfMonth(this.year, this.month)); - let h = !r.starDOW && t == "day" ? new Date(Date.UTC(this.year, this.month, 1, 0, 0, 0, 0)).getUTCDay() : void 0, l = this[t] + n, y = i === 1 ? (u) => u < r[t].length : (u) => u >= 0; - for (let u = l; y(u); u += i) { - let d = r[t][u]; - if (t === "day" && !d) { - for (let c = 0; c < r.nearestWeekdays.length; c++) if (r.nearestWeekdays[c]) { - let M = this.getNearestWeekday(this.year, this.month, c - n); - if (M === -1) continue; - if (M === u - n) { - d = 1; - break; - } - } - } - if (t === "day" && r.lastWeekday) { - let c = this.getLastWeekday(this.year, this.month); - u - n === c && (d = 1); - } - if (t === "day" && r.lastDayOfMonth && u - n == o && (d = 1), t === "day" && !r.starDOW) { - let c = r.dayOfWeek[(h + (u - n - 1)) % 7]; - if (c && c & 63) c = this.isNthWeekdayOfMonth(this.year, this.month, u - n, c) ? 1 : 0; - else if (c) throw new Error(`CronDate: Invalid value for dayOfWeek encountered. ${c}`); - r.useAndLogic ? d = d && c : !e.domAndDow && !r.starDOM ? d = d || c : d = d && c; - } - if (d) return this[t] = u - n, a !== this[t] ? 2 : 1; - } - return 3; - } - recurse(e, t, r) { - if (r === 0 && !e.starYear) { - if (this.year >= 0 && this.year < e.year.length && e.year[this.year] === 0) { - let i = -1; - for (let a = this.year + 1; a < e.year.length && a < 1e4; a++) if (e.year[a] === 1) { - i = a; - break; - } - if (i === -1) return null; - this.year = i, this.month = 0, this.day = 1, this.hour = 0, this.minute = 0, this.second = 0, this.ms = 0; - } - if (this.year >= 1e4) return null; - } - let n = this.findNext(t, f[r][0], e, f[r][2]); - if (n > 1) { - let i = r + 1; - for (; i < f.length;) this[f[i][0]] = -f[i][2], i++; - if (n === 3) { - if (this[f[r][1]]++, this[f[r][0]] = -f[r][2], this.apply(), r === 0 && !e.starYear) { - for (; this.year >= 0 && this.year < e.year.length && e.year[this.year] === 0 && this.year < 1e4;) this.year++; - if (this.year >= 1e4 || this.year >= e.year.length) return null; - } - return this.recurse(e, t, 0); - } else if (this.apply()) return this.recurse(e, t, r - 1); - } - return r += 1, r >= f.length ? this : (e.starYear ? this.year >= 3e3 : this.year >= 1e4) ? null : this.recurse(e, t, r); - } - increment(e, t, r) { - return this.second += t.interval !== void 0 && t.interval > 1 && r ? t.interval : 1, this.ms = 0, this.apply(), this.recurse(e, t, 0); - } - decrement(e, t) { - return this.second -= t.interval !== void 0 && t.interval > 1 ? t.interval : 1, this.ms = 0, this.apply(), this.recurseBackward(e, t, 0, 0); - } - recurseBackward(e, t, r, n = 0) { - if (n > 1e4) return null; - if (r === 0 && !e.starYear) { - if (this.year >= 0 && this.year < e.year.length && e.year[this.year] === 0) { - let a = -1; - for (let o = this.year - 1; o >= 0; o--) if (e.year[o] === 1) { - a = o; - break; - } - if (a === -1) return null; - this.year = a, this.month = 11, this.day = 31, this.hour = 23, this.minute = 59, this.second = 59, this.ms = 0; - } - if (this.year < 0) return null; - } - let i = this.findPrevious(t, f[r][0], e, f[r][2]); - if (i > 1) { - let a = r + 1; - for (; a < f.length;) { - let o = f[a][0], h = f[a][2], l = this.getMaxPatternValue(o, e, h); - this[o] = l, a++; - } - if (i === 3) { - if (this[f[r][1]]--, r === 0) { - let y = this.getLastDayOfMonth(this.year, this.month); - this.day > y && (this.day = y); - } - if (r === 1) if (this.day <= 0) this.day = 1; - else { - let y = this.year, u = this.month; - for (; u < 0;) u += 12, y--; - for (; u > 11;) u -= 12, y++; - let d = u !== 1 ? P[u] : new Date(Date.UTC(y, u + 1, 0)).getUTCDate(); - this.day > d && (this.day = d); - } - this.apply(); - let o = f[r][0], h = f[r][2], l = this.getMaxPatternValue(o, e, h); - if (o === "day") { - let y = this.getLastDayOfMonth(this.year, this.month); - this[o] = Math.min(l, y); - } else this[o] = l; - if (this.apply(), r === 0) { - let y = f[1][2], u = this.getMaxPatternValue("day", e, y), d = this.getLastDayOfMonth(this.year, this.month), c = Math.min(u, d); - c !== this.day && (this.day = c, this.hour = this.getMaxPatternValue("hour", e, f[2][2]), this.minute = this.getMaxPatternValue("minute", e, f[3][2]), this.second = this.getMaxPatternValue("second", e, f[4][2])); - } - if (r === 0 && !e.starYear) { - for (; this.year >= 0 && this.year < e.year.length && e.year[this.year] === 0;) this.year--; - if (this.year < 0) return null; - } - return this.recurseBackward(e, t, 0, n + 1); - } else if (this.apply()) return this.recurseBackward(e, t, r - 1, n + 1); - } - return r += 1, r >= f.length ? this : this.year < 0 ? null : this.recurseBackward(e, t, r, n + 1); - } - getMaxPatternValue(e, t, r) { - if (e === "day" && t.lastDayOfMonth) return this.getLastDayOfMonth(this.year, this.month); - if (e === "day" && !t.starDOW) return this.getLastDayOfMonth(this.year, this.month); - for (let n = t[e].length - 1; n >= 0; n--) if (t[e][n]) return n - r; - return t[e].length - 1 - r; - } - findPrevious(e, t, r, n) { - return this._findMatch(e, t, r, n, -1); - } - getDate(e) { - return e || this.tz === void 0 ? new Date(this.year, this.month, this.day, this.hour, this.minute, this.second, this.ms) : typeof this.tz == "number" ? new Date(Date.UTC(this.year, this.month, this.day, this.hour, this.minute - this.tz, this.second, this.ms)) : k(b(this.year, this.month + 1, this.day, this.hour, this.minute, this.second, this.tz), !1); - } - getTime() { - return this.getDate(!1).getTime(); - } - match(e, t) { - if (!e.starYear && (this.year < 0 || this.year >= e.year.length || e.year[this.year] === 0)) return !1; - for (let r = 0; r < f.length; r++) { - let n = f[r][0], i = f[r][2], a = this[n]; - if (a + i < 0 || a + i >= e[n].length) return !1; - let o = e[n][a + i]; - if (n === "day") { - if (!o) { - for (let h = 0; h < e.nearestWeekdays.length; h++) if (e.nearestWeekdays[h]) { - let l = this.getNearestWeekday(this.year, this.month, h - i); - if (l !== -1 && l === a) { - o = 1; - break; - } - } - } - if (e.lastWeekday) a === this.getLastWeekday(this.year, this.month) && (o = 1); - if (e.lastDayOfMonth) a === this.getLastDayOfMonth(this.year, this.month) && (o = 1); - if (!e.starDOW) { - let h = new Date(Date.UTC(this.year, this.month, 1, 0, 0, 0, 0)).getUTCDay(), l = e.dayOfWeek[(h + (a - 1)) % 7]; - l && l & 63 && (l = this.isNthWeekdayOfMonth(this.year, this.month, a, l) ? 1 : 0), e.useAndLogic ? o = o && l : !t.domAndDow && !e.starDOM ? o = o || l : o = o && l; - } - } - if (!o) return !1; - } - return !0; - } -}; -function R(s) { - if (s === void 0 && (s = {}), delete s.name, s.legacyMode !== void 0 && s.domAndDow === void 0 ? s.domAndDow = !s.legacyMode : s.domAndDow === void 0 && (s.domAndDow = !1), s.legacyMode = !s.domAndDow, s.paused = s.paused === void 0 ? !1 : s.paused, s.maxRuns = s.maxRuns === void 0 ? Infinity : s.maxRuns, s.catch = s.catch === void 0 ? !1 : s.catch, s.interval = s.interval === void 0 ? 0 : parseInt(s.interval.toString(), 10), s.utcOffset = s.utcOffset === void 0 ? void 0 : parseInt(s.utcOffset.toString(), 10), s.dayOffset = s.dayOffset === void 0 ? 0 : parseInt(s.dayOffset.toString(), 10), s.unref = s.unref === void 0 ? !1 : s.unref, s.mode = s.mode === void 0 ? "auto" : s.mode, s.alternativeWeekdays = s.alternativeWeekdays === void 0 ? !1 : s.alternativeWeekdays, s.sloppyRanges = s.sloppyRanges === void 0 ? !1 : s.sloppyRanges, ![ - "auto", - "5-part", - "6-part", - "7-part", - "5-or-6-parts", - "6-or-7-parts" - ].includes(s.mode)) throw new Error("CronOptions: mode must be one of 'auto', '5-part', '6-part', '7-part', '5-or-6-parts', or '6-or-7-parts'."); - if (s.startAt && (s.startAt = new m(s.startAt, s.timezone)), s.stopAt && (s.stopAt = new m(s.stopAt, s.timezone)), s.interval !== null) { - if (isNaN(s.interval)) throw new Error("CronOptions: Supplied value for interval is not a number"); - if (s.interval < 0) throw new Error("CronOptions: Supplied value for interval can not be negative"); - } - if (s.utcOffset !== void 0) { - if (isNaN(s.utcOffset)) throw new Error("CronOptions: Invalid value passed for utcOffset, should be number representing minutes offset from UTC."); - if (s.utcOffset < -870 || s.utcOffset > 870) throw new Error("CronOptions: utcOffset out of bounds."); - if (s.utcOffset !== void 0 && s.timezone) throw new Error("CronOptions: Combining 'utcOffset' with 'timezone' is not allowed."); - } - if (s.unref !== !0 && s.unref !== !1) throw new Error("CronOptions: Unref should be either true, false or undefined(false)."); - if (s.dayOffset !== void 0 && s.dayOffset !== 0 && isNaN(s.dayOffset)) throw new Error("CronOptions: Invalid value passed for dayOffset, should be a number representing days to offset."); - return s; -} -function p(s) { - return Object.prototype.toString.call(s) === "[object Function]" || typeof s == "function" || s instanceof Function; -} -function _(s) { - return p(s); -} -function x(s) { - typeof Deno < "u" && typeof Deno.unrefTimer < "u" ? Deno.unrefTimer(s) : s && typeof s.unref < "u" && s.unref(); -} -var W = 30 * 1e3; -var w = []; -var E = class { - name; - options; - _states; - fn; - getTz() { - return this.options.timezone || this.options.utcOffset; - } - applyDayOffset(e) { - if (this.options.dayOffset !== void 0 && this.options.dayOffset !== 0) { - let t = this.options.dayOffset * 24 * 60 * 60 * 1e3; - return new Date(e.getTime() + t); - } - return e; - } - constructor(e, t, r) { - let n, i; - if (p(t)) i = t; - else if (typeof t == "object") n = t; - else if (t !== void 0) throw new Error("Cron: Invalid argument passed for optionsIn. Should be one of function, or object (options)."); - if (p(r)) i = r; - else if (typeof r == "object") n = r; - else if (r !== void 0) throw new Error("Cron: Invalid argument passed for funcIn. Should be one of function, or object (options)."); - if (this.name = n?.name, this.options = R(n), this._states = { - kill: !1, - blocking: !1, - previousRun: void 0, - currentRun: void 0, - once: void 0, - currentTimeout: void 0, - maxRuns: n ? n.maxRuns : void 0, - paused: n ? n.paused : !1, - pattern: new C("* * * * *", void 0, { mode: "auto" }) - }, e && (e instanceof Date || typeof e == "string" && e.indexOf(":") > 0) ? this._states.once = new m(e, this.getTz()) : this._states.pattern = new C(e, this.options.timezone, { - mode: this.options.mode, - alternativeWeekdays: this.options.alternativeWeekdays, - sloppyRanges: this.options.sloppyRanges - }), this.name) { - if (w.find((o) => o.name === this.name)) throw new Error("Cron: Tried to initialize new named job '" + this.name + "', but name already taken."); - w.push(this); - } - return i !== void 0 && _(i) && (this.fn = i, this.schedule()), this; - } - nextRun(e) { - let t = this._next(e); - return t ? this.applyDayOffset(t.getDate(!1)) : null; - } - nextRuns(e, t) { - this._states.maxRuns !== void 0 && e > this._states.maxRuns && (e = this._states.maxRuns); - let r = t || this._states.currentRun || void 0; - return this._enumerateRuns(e, r, "next"); - } - previousRuns(e, t) { - return this._enumerateRuns(e, t || void 0, "previous"); - } - _enumerateRuns(e, t, r) { - let n = [], i = t ? new m(t, this.getTz()) : null, a = r === "next" ? this._next : this._previous; - for (; e--;) { - let o = a.call(this, i); - if (!o) break; - let h = o.getDate(!1); - n.push(this.applyDayOffset(h)), i = o; - } - return n; - } - match(e) { - if (this._states.once) { - let r = new m(e, this.getTz()); - r.ms = 0; - let n = new m(this._states.once, this.getTz()); - return n.ms = 0, r.getTime() === n.getTime(); - } - let t = new m(e, this.getTz()); - return t.ms = 0, t.match(this._states.pattern, this.options); - } - getPattern() { - if (!this._states.once) return this._states.pattern ? this._states.pattern.pattern : void 0; - } - getOnce() { - return this._states.once ? this._states.once.getDate() : null; - } - isRunning() { - let e = this.nextRun(this._states.currentRun), t = !this._states.paused, r = this.fn !== void 0, n = !this._states.kill; - return t && r && n && e !== null; - } - isStopped() { - return this._states.kill; - } - isBusy() { - return this._states.blocking; - } - currentRun() { - return this._states.currentRun ? this._states.currentRun.getDate() : null; - } - previousRun() { - return this._states.previousRun ? this._states.previousRun.getDate() : null; - } - msToNext(e) { - let t = this._next(e); - return t ? e instanceof m || e instanceof Date ? t.getTime() - e.getTime() : t.getTime() - new m(e).getTime() : null; - } - stop() { - this._states.kill = !0, this._states.currentTimeout && clearTimeout(this._states.currentTimeout); - let e = w.indexOf(this); - e >= 0 && w.splice(e, 1); - } - pause() { - return this._states.paused = !0, !this._states.kill; - } - resume() { - return this._states.paused = !1, !this._states.kill; - } - schedule(e) { - if (e && this.fn) throw new Error("Cron: It is not allowed to schedule two functions using the same Croner instance."); - e && (this.fn = e); - let t = this.msToNext(), r = this.nextRun(this._states.currentRun); - return t == null || isNaN(t) || r === null ? this : (t > W && (t = W), this._states.currentTimeout = setTimeout(() => this._checkTrigger(r), t), this._states.currentTimeout && this.options.unref && x(this._states.currentTimeout), this); - } - async _trigger(e) { - this._states.blocking = !0, this._states.currentRun = new m(void 0, this.getTz()); - try { - if (this.options.catch) try { - this.fn !== void 0 && await this.fn(this, this.options.context); - } catch (t) { - if (p(this.options.catch)) try { - this.options.catch(t, this); - } catch {} - } - else this.fn !== void 0 && await this.fn(this, this.options.context); - } finally { - this._states.previousRun = new m(e, this.getTz()), this._states.blocking = !1; - } - } - async trigger() { - await this._trigger(); - } - runsLeft() { - return this._states.maxRuns; - } - _checkTrigger(e) { - let t = /* @__PURE__ */ new Date(), r = !this._states.paused && t.getTime() >= e.getTime(), n = this._states.blocking && this.options.protect; - r && !n ? (this._states.maxRuns !== void 0 && this._states.maxRuns--, this._trigger()) : r && n && p(this.options.protect) && setTimeout(() => this.options.protect(this), 0), this.schedule(); - } - _next(e) { - let t = !!(e || this._states.currentRun), r = !1; - !e && this.options.startAt && this.options.interval && ([e, t] = this._calculatePreviousRun(e, t), r = !e), e = new m(e, this.getTz()), this.options.startAt && e && e.getTime() < this.options.startAt.getTime() && (e = this.options.startAt); - let n = this._states.once || new m(e, this.getTz()); - return !r && n !== this._states.once && (n = n.increment(this._states.pattern, this.options, t)), this._states.once && this._states.once.getTime() <= e.getTime() || n === null || this._states.maxRuns !== void 0 && this._states.maxRuns <= 0 || this._states.kill || this.options.stopAt && n.getTime() >= this.options.stopAt.getTime() ? null : n; - } - _previous(e) { - let t = new m(e, this.getTz()); - this.options.stopAt && t.getTime() > this.options.stopAt.getTime() && (t = this.options.stopAt); - let r = new m(t, this.getTz()); - return this._states.once ? this._states.once.getTime() < t.getTime() ? this._states.once : null : (r = r.decrement(this._states.pattern, this.options), r === null || this.options.startAt && r.getTime() < this.options.startAt.getTime() ? null : r); - } - _calculatePreviousRun(e, t) { - let r = new m(void 0, this.getTz()), n = e; - if (this.options.startAt.getTime() <= r.getTime()) { - n = this.options.startAt; - let i = n.getTime() + this.options.interval * 1e3; - for (; i <= r.getTime();) n = new m(n, this.getTz()).increment(this._states.pattern, this.options, !0), i = n.getTime() + this.options.interval * 1e3; - t = !0; - } - return n === null && (n = void 0), [n, t]; - } -}; -//#endregion -export { E as t }; diff --git a/.output/server/_libs/eve.mjs b/.output/server/_libs/eve.mjs deleted file mode 100644 index f06d95b..0000000 --- a/.output/server/_libs/eve.mjs +++ /dev/null @@ -1,141580 +0,0 @@ -import { fileURLToPath as __eveFileURLToPath } from "node:url"; -import { dirname as __eveDirname } from "node:path"; -const __filename = __eveFileURLToPath(import.meta.url); -const __dirname = __eveDirname(__filename); -import { n as __exportAll } from "../_runtime.mjs"; -import { F as zodSchema, M as tool, T as jsonSchema } from "./@ai-sdk/gateway+[...].mjs"; -import { a as generateText, n as ToolLoopAgent, o as isStepCount, r as convertDataContentToBase64String, s as registerTelemetry, t as MockLanguageModelV3 } from "./ai.mjs"; -import { createRequire } from "node:module"; -import { Readable } from "node:stream"; -import ee, { createHash, createSign, randomBytes, randomUUID, webcrypto } from "node:crypto"; -import { inspect, promisify, types } from "node:util"; -import g, { existsSync, mkdirSync, promises, readFileSync, realpathSync, statSync, writeFileSync } from "node:fs"; -import * as p$2 from "node:path"; -import G, { basename, dirname, extname, isAbsolute, join, posix, resolve, sep } from "node:path"; -import { fileURLToPath, pathToFileURL } from "node:url"; -import { AsyncLocalStorage } from "node:async_hooks"; -import { BlockList, isIP } from "node:net"; -import * as lr$3 from "path"; -import b, { dirname as dirname$1, resolve as resolve$1 } from "path"; -import * as ur$3 from "fs"; -import { createWriteStream } from "fs"; -import E from "os"; -import * as v$1 from "node:fs/promises"; -import Xn, { access, constants, cp, mkdir, readFile, readdir, readlink, realpath, rename, rm, stat, unlink, utimes, writeFile } from "node:fs/promises"; -import { execFile, spawn, spawnSync } from "node:child_process"; -import { setTimeout as setTimeout$1 } from "node:timers/promises"; -import { EventEmitter } from "node:events"; -import * as dr$3 from "net"; -import { createRequire as createRequire$1 } from "module"; -import pr, { homedir } from "node:os"; -import { Script, createContext, runInContext } from "node:vm"; -import { Worker } from "node:worker_threads"; -import { dirname as dirname$2 } from "node:path/posix"; -import { Buffer as Buffer$1 } from "node:buffer"; -import { Readable as Readable$1 } from "stream"; -import w from "zlib"; -import { pipeline } from "stream/promises"; -import { mkdir as mkdir$1 } from "fs/promises"; -import * as k$1 from "node:constants"; -//#region node_modules/eve/dist/src/internal/nitro/routes/index.js -const DEPLOYMENT_URL_PLACEHOLDER = `{{DEPLOYMENT_URL}}`; -const HOME_PAGE_HTML_TEMPLATE = ` - - - - - - -eve - - - -
- - - running - -

eve

-

The agent is up and accepting messages. Read the docs

-
- - eve dev ${DEPLOYMENT_URL_PLACEHOLDER} -
-
- - -`; -function escapeHtml(e) { - return e.replaceAll(`&`, `&`).replaceAll(`<`, `<`).replaceAll(`>`, `>`).replaceAll(`"`, `"`).replaceAll(`'`, `'`); -} -function pickFirstForwardedValue(e) { - if (e === null) return; - let t = e.split(`,`)[0]?.trim(); - if (!(t === void 0 || t.length === 0)) return t; -} -function resolveDeploymentUrl(e) { - let t = e.headers, n = new URL(e.url), r = pickFirstForwardedValue(t.get(`x-forwarded-host`)), i = pickFirstForwardedValue(t.get(`x-forwarded-proto`)), a = r ?? t.get(`host`) ?? n.host; - return `${i ?? n.protocol.replace(/:$/, ``)}://${a}`; -} -function buildHomePageResponse(n) { - let r = resolveDeploymentUrl(n), i = HOME_PAGE_HTML_TEMPLATE.replace(DEPLOYMENT_URL_PLACEHOLDER, escapeHtml(r)); - return new Response(i, { headers: { - "cache-control": `no-store`, - "content-type": `text/html; charset=utf-8` - } }); -} -function handleHomePageRequest(e) { - return buildHomePageResponse(e.req); -} -//#endregion -//#region node_modules/eve/dist/src/shared/guards.js -function isObject(e) { - return typeof e == `object` && !!e && !Array.isArray(e); -} -function isNonEmptyString(e) { - return typeof e == `string` && e.length > 0; -} -function isThenable(e) { - return isObject(e) && typeof e.then == `function`; -} -function isPlainRecord(e) { - if (!isObject(e)) return !1; - let t = Object.getPrototypeOf(e); - return t === Object.prototype || t === null; -} -//#endregion -//#region node_modules/eve/dist/src/compiled/@opentelemetry/api/index.js -const e$5 = `1.9.1`; -const t$15 = /^(\d+)\.(\d+)\.(\d+)(-(.+))?$/; -function n$17(e) { - let n = /* @__PURE__ */ new Set([e]), r = /* @__PURE__ */ new Set(), i = e.match(t$15); - if (!i) return () => !1; - let a = { - major: +i[1], - minor: +i[2], - patch: +i[3], - prerelease: i[4] - }; - if (a.prerelease != null) return function(t) { - return t === e; - }; - function o(e) { - return r.add(e), !1; - } - function s(e) { - return n.add(e), !0; - } - return function(e) { - if (n.has(e)) return !0; - if (r.has(e)) return !1; - let i = e.match(t$15); - if (!i) return o(e); - let c = { - major: +i[1], - minor: +i[2], - patch: +i[3], - prerelease: i[4] - }; - return c.prerelease != null || a.major !== c.major ? o(e) : a.major === 0 ? a.minor === c.minor && a.patch <= c.patch ? s(e) : o(e) : a.minor <= c.minor ? s(e) : o(e); - }; -} -const r$19 = n$17(e$5); -const i$18 = e$5.split(`.`)[0]; -const a$15 = Symbol.for(`opentelemetry.js.api.${i$18}`); -const o$15 = typeof globalThis == `object` ? globalThis : typeof self == `object` ? self : typeof window == `object` ? window : typeof global == `object` ? global : {}; -function s$13(t, n, r, i = !1) { - let s = o$15[a$15] = o$15[a$15] ?? { version: e$5 }; - if (!i && s[t]) { - let e = Error(`@opentelemetry/api: Attempted duplicate registration of API: ${t}`); - return r.error(e.stack || e.message), !1; - } - if (s.version !== `1.9.1`) { - let n = Error(`@opentelemetry/api: Registration of version v${s.version} for ${t} does not match previously registered API v${e$5}`); - return r.error(n.stack || n.message), !1; - } - return s[t] = n, r.debug(`@opentelemetry/api: Registered a global for ${t} v${e$5}.`), !0; -} -function c$15(e) { - let t = o$15[a$15]?.version; - if (!(!t || !r$19(t))) return o$15[a$15]?.[e]; -} -function l$14(t, n) { - n.debug(`@opentelemetry/api: Unregistering a global for ${t} v${e$5}.`); - let r = o$15[a$15]; - r && delete r[t]; -} -var ee$9 = class { - constructor(e) { - this._namespace = e.namespace || `DiagComponentLogger`; - } - debug(...e) { - return u$16(`debug`, this._namespace, e); - } - error(...e) { - return u$16(`error`, this._namespace, e); - } - info(...e) { - return u$16(`info`, this._namespace, e); - } - warn(...e) { - return u$16(`warn`, this._namespace, e); - } - verbose(...e) { - return u$16(`verbose`, this._namespace, e); - } -}; -function u$16(e, t, n) { - let r = c$15(`diag`); - if (r) return r[e](t, ...n); -} -var d$16; -(function(e) { - e[e.NONE = 0] = `NONE`, e[e.ERROR = 30] = `ERROR`, e[e.WARN = 50] = `WARN`, e[e.INFO = 60] = `INFO`, e[e.DEBUG = 70] = `DEBUG`, e[e.VERBOSE = 80] = `VERBOSE`, e[e.ALL = 9999] = `ALL`; -})(d$16 ||= {}); -function te$9(e, t) { - e < d$16.NONE ? e = d$16.NONE : e > d$16.ALL && (e = d$16.ALL), t ||= {}; - function n(n, r) { - let i = t[n]; - return typeof i == `function` && e >= r ? i.bind(t) : function() {}; - } - return { - error: n(`error`, d$16.ERROR), - warn: n(`warn`, d$16.WARN), - info: n(`info`, d$16.INFO), - debug: n(`debug`, d$16.DEBUG), - verbose: n(`verbose`, d$16.VERBOSE) - }; -} -var f$15 = class e { - static instance() { - return this._instance ||= new e(), this._instance; - } - constructor() { - function e(e) { - return function(...t) { - let n = c$15(`diag`); - if (n) return n[e](...t); - }; - } - let t = this; - t.setLogger = (e, n = { logLevel: d$16.INFO }) => { - if (e === t) { - let e = Error(`Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation`); - return t.error(e.stack ?? e.message), !1; - } - typeof n == `number` && (n = { logLevel: n }); - let r = c$15(`diag`), i = te$9(n.logLevel ?? d$16.INFO, e); - if (r && !n.suppressOverrideMessage) { - let e = Error().stack ?? ``; - r.warn(`Current logger will be overwritten from ${e}`), i.warn(`Current logger will overwrite one already registered from ${e}`); - } - return s$13(`diag`, i, t, !0); - }, t.disable = () => { - l$14(`diag`, t); - }, t.createComponentLogger = (e) => new ee$9(e), t.verbose = e(`verbose`), t.debug = e(`debug`), t.info = e(`info`), t.warn = e(`warn`), t.error = e(`error`); - } -}; -var ne$9 = class e { - constructor(e) { - this._entries = e ? new Map(e) : /* @__PURE__ */ new Map(); - } - getEntry(e) { - let t = this._entries.get(e); - if (t) return Object.assign({}, t); - } - getAllEntries() { - return Array.from(this._entries.entries()); - } - setEntry(t, n) { - let r = new e(this._entries); - return r._entries.set(t, n), r; - } - removeEntry(t) { - let n = new e(this._entries); - return n._entries.delete(t), n; - } - removeEntries(...t) { - let n = new e(this._entries); - for (let e of t) n._entries.delete(e); - return n; - } - clear() { - return new e(); - } -}; -const ie$10 = f$15.instance(); -function ae$11(e = {}) { - return new ne$9(new Map(Object.entries(e))); -} -function p$16(e) { - return Symbol.for(e); -} -const m$12 = new class e { - constructor(t) { - let n = this; - n._currentContext = t ? new Map(t) : /* @__PURE__ */ new Map(), n.getValue = (e) => n._currentContext.get(e), n.setValue = (t, r) => { - let i = new e(n._currentContext); - return i._currentContext.set(t, r), i; - }, n.deleteValue = (t) => { - let r = new e(n._currentContext); - return r._currentContext.delete(t), r; - }; - } -}(); -const g$13 = {}; -if (typeof console < `u`) for (let e of [ - `error`, - `warn`, - `info`, - `debug`, - `trace`, - `log` -]) typeof console[e] == `function` && (g$13[e] = console[e]); -var ce$12 = class { - constructor() {} - createGauge(e, t) { - return _e$11; - } - createHistogram(e, t) { - return ve$11; - } - createCounter(e, t) { - return ge$11; - } - createUpDownCounter(e, t) { - return ye$11; - } - createObservableGauge(e, t) { - return xe$11; - } - createObservableCounter(e, t) { - return be$11; - } - createObservableUpDownCounter(e, t) { - return Se$11; - } - addBatchObservableCallback(e, t) {} - removeBatchObservableCallback(e) {} -}; -var _$12 = class {}; -var le$12 = class extends _$12 { - add(e, t) {} -}; -var ue$12 = class extends _$12 { - add(e, t) {} -}; -var de$12 = class extends _$12 { - record(e, t) {} -}; -var fe$12 = class extends _$12 { - record(e, t) {} -}; -var v$12 = class { - addCallback(e) {} - removeCallback(e) {} -}; -var pe$11 = class extends v$12 {}; -var me$11 = class extends v$12 {}; -var he$11 = class extends v$12 {}; -const y$10 = new ce$12(); -const ge$11 = new le$12(); -const _e$11 = new de$12(); -const ve$11 = new fe$12(); -const ye$11 = new ue$12(); -const be$11 = new pe$11(); -const xe$11 = new me$11(); -const Se$11 = new he$11(); -var we$11; -(function(e) { - e[e.INT = 0] = `INT`, e[e.DOUBLE = 1] = `DOUBLE`; -})(we$11 ||= {}); -const Te$11 = { - get(e, t) { - if (e != null) return e[t]; - }, - keys(e) { - return e == null ? [] : Object.keys(e); - } -}; -const b$13 = { set(e, t, n) { - e != null && (e[t] = n); -} }; -var Ee$11 = class { - active() { - return m$12; - } - with(e, t, n, ...r) { - return t.call(n, ...r); - } - bind(e, t) { - return t; - } - enable() { - return this; - } - disable() { - return this; - } -}; -const x$14 = `context`; -const De$10 = new Ee$11(); -var S$15 = class e { - constructor() {} - static getInstance() { - return this._instance ||= new e(), this._instance; - } - setGlobalContextManager(e) { - return s$13(x$14, e, f$15.instance()); - } - active() { - return this._getContextManager().active(); - } - with(e, t, n, ...r) { - return this._getContextManager().with(e, t, n, ...r); - } - bind(e, t) { - return this._getContextManager().bind(e, t); - } - _getContextManager() { - return c$15(x$14) || De$10; - } - disable() { - this._getContextManager().disable(), l$14(x$14, f$15.instance()); - } -}; -var C$16; -(function(e) { - e[e.NONE = 0] = `NONE`, e[e.SAMPLED = 1] = `SAMPLED`; -})(C$16 ||= {}); -const w$16 = `0000000000000000`; -const T$16 = `00000000000000000000000000000000`; -const E$16 = { - traceId: T$16, - spanId: w$16, - traceFlags: C$16.NONE -}; -var D$15 = class { - constructor(e = E$16) { - this._spanContext = e; - } - spanContext() { - return this._spanContext; - } - setAttribute(e, t) { - return this; - } - setAttributes(e) { - return this; - } - addEvent(e, t) { - return this; - } - addLink(e) { - return this; - } - addLinks(e) { - return this; - } - setStatus(e) { - return this; - } - updateName(e) { - return this; - } - end(e) {} - isRecording() { - return !1; - } - recordException(e, t) {} -}; -const O$14 = p$16(`OpenTelemetry Context Key SPAN`); -function k$15(e) { - return e.getValue(O$14) || void 0; -} -function Oe$11() { - return k$15(S$15.getInstance().active()); -} -function A$14(e, t) { - return e.setValue(O$14, t); -} -function ke$10(e) { - return e.deleteValue(O$14); -} -function Ae$11(e, t) { - return A$14(e, new D$15(t)); -} -function j$14(e) { - return k$15(e)?.spanContext(); -} -const M$14 = new Uint8Array([ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1 -]); -function N$13(e, t) { - if (typeof e != `string` || e.length !== t) return !1; - let n = 0; - for (let t = 0; t < e.length; t += 4) n += (M$14[e.charCodeAt(t)] | 0) + (M$14[e.charCodeAt(t + 1)] | 0) + (M$14[e.charCodeAt(t + 2)] | 0) + (M$14[e.charCodeAt(t + 3)] | 0); - return n === t; -} -function P$13(e) { - return N$13(e, 32) && e !== `00000000000000000000000000000000`; -} -function F$13(e) { - return N$13(e, 16) && e !== `0000000000000000`; -} -function I$13(e) { - return P$13(e.traceId) && F$13(e.spanId); -} -function je$12(e) { - return new D$15(e); -} -const L$12 = S$15.getInstance(); -var R$14 = class { - startSpan(e, t, n = L$12.active()) { - if (t?.root) return new D$15(); - let r = n && j$14(n); - return Me$11(r) && I$13(r) ? new D$15(r) : new D$15(); - } - startActiveSpan(e, t, n, r) { - let i, a, o; - if (arguments.length < 2) return; - arguments.length === 2 ? o = t : arguments.length === 3 ? (i = t, o = n) : (i = t, a = n, o = r); - let s = a ?? L$12.active(), c = this.startSpan(e, i, s), l = A$14(s, c); - return L$12.with(l, o, void 0, c); - } -}; -function Me$11(e) { - return typeof e == `object` && !!e && `spanId` in e && typeof e.spanId == `string` && `traceId` in e && typeof e.traceId == `string` && `traceFlags` in e && typeof e.traceFlags == `number`; -} -const Ne$12 = new R$14(); -var z$14 = class { - constructor(e, t, n, r) { - this._provider = e, this.name = t, this.version = n, this.options = r; - } - startSpan(e, t, n) { - return this._getTracer().startSpan(e, t, n); - } - startActiveSpan(e, t, n, r) { - let i = this._getTracer(); - return Reflect.apply(i.startActiveSpan, i, arguments); - } - _getTracer() { - if (this._delegate) return this._delegate; - let e = this._provider.getDelegateTracer(this.name, this.version, this.options); - return e ? (this._delegate = e, this._delegate) : Ne$12; - } -}; -const Pe$11 = new class { - getTracer(e, t, n) { - return new R$14(); - } -}(); -var B$15 = class { - getTracer(e, t, n) { - return this.getDelegateTracer(e, t, n) ?? new z$14(this, e, t, n); - } - getDelegate() { - return this._delegate ?? Pe$11; - } - setDelegate(e) { - this._delegate = e; - } - getDelegateTracer(e, t, n) { - return this._delegate?.getTracer(e, t, n); - } -}; -var V$14; -(function(e) { - e[e.NOT_RECORD = 0] = `NOT_RECORD`, e[e.RECORD = 1] = `RECORD`, e[e.RECORD_AND_SAMPLED = 2] = `RECORD_AND_SAMPLED`; -})(V$14 ||= {}); -var H$13; -(function(e) { - e[e.INTERNAL = 0] = `INTERNAL`, e[e.SERVER = 1] = `SERVER`, e[e.CLIENT = 2] = `CLIENT`, e[e.PRODUCER = 3] = `PRODUCER`, e[e.CONSUMER = 4] = `CONSUMER`; -})(H$13 ||= {}); -var U$13; -(function(e) { - e[e.UNSET = 0] = `UNSET`, e[e.OK = 1] = `OK`, e[e.ERROR = 2] = `ERROR`; -})(U$13 ||= {}); -const W$11 = `[_0-9a-z-*/]`; -const Fe$11 = RegExp(`^(?:${`[a-z]${W$11}{0,255}`}|${`[a-z0-9]${W$11}{0,240}@[a-z]${W$11}{0,13}`})$`); -const G$11 = S$15.getInstance(); -const K$12 = f$15.instance(); -const He$10 = new class { - getMeter(e, t, n) { - return y$10; - } -}(); -const q$12 = `metrics`; -const J$12 = class e { - constructor() {} - static getInstance() { - return this._instance ||= new e(), this._instance; - } - setGlobalMeterProvider(e) { - return s$13(q$12, e, f$15.instance()); - } - getMeterProvider() { - return c$15(q$12) || He$10; - } - getMeter(e, t, n) { - return this.getMeterProvider().getMeter(e, t, n); - } - disable() { - l$14(q$12, f$15.instance()); - } -}.getInstance(); -var Ue$10 = class { - inject(e, t) {} - extract(e, t) { - return e; - } - fields() { - return []; - } -}; -const Y$15 = p$16(`OpenTelemetry Baggage Key`); -function X$15(e) { - return e.getValue(Y$15) || void 0; -} -function We$10() { - return X$15(S$15.getInstance().active()); -} -function Ge$10(e, t) { - return e.setValue(Y$15, t); -} -function Ke$10(e) { - return e.deleteValue(Y$15); -} -const Z$14 = `propagation`; -const qe$10 = new Ue$10(); -const Je$11 = class e { - constructor() { - this.createBaggage = ae$11, this.getBaggage = X$15, this.getActiveBaggage = We$10, this.setBaggage = Ge$10, this.deleteBaggage = Ke$10; - } - static getInstance() { - return this._instance ||= new e(), this._instance; - } - setGlobalPropagator(e) { - return s$13(Z$14, e, f$15.instance()); - } - inject(e, t, n = b$13) { - return this._getGlobalPropagator().inject(e, t, n); - } - extract(e, t, n = Te$11) { - return this._getGlobalPropagator().extract(e, t, n); - } - fields() { - return this._getGlobalPropagator().fields(); - } - disable() { - l$14(Z$14, f$15.instance()); - } - _getGlobalPropagator() { - return c$15(Z$14) || qe$10; - } -}.getInstance(); -const Q$13 = `trace`; -const $$13 = class e { - constructor() { - this._proxyTracerProvider = new B$15(), this.wrapSpanContext = je$12, this.isSpanContextValid = I$13, this.deleteSpan = ke$10, this.getSpan = k$15, this.getActiveSpan = Oe$11, this.getSpanContext = j$14, this.setSpan = A$14, this.setSpanContext = Ae$11; - } - static getInstance() { - return this._instance ||= new e(), this._instance; - } - setGlobalTracerProvider(e) { - let t = s$13(Q$13, this._proxyTracerProvider, f$15.instance()); - return t && this._proxyTracerProvider.setDelegate(e), t; - } - getTracerProvider() { - return c$15(Q$13) || this._proxyTracerProvider; - } - getTracer(e, t) { - return this.getTracerProvider().getTracer(e, t); - } - disable() { - l$14(Q$13, f$15.instance()), this._proxyTracerProvider = new B$15(); - } -}.getInstance(); -//#endregion -//#region node_modules/eve/dist/src/compiled/@ai-sdk/provider/index.js -var e$4 = `vercel.ai.error`; -var t$14 = Symbol.for(e$4); -var n$16; -var r$18; -var i$17 = class i extends (r$18 = Error, n$16 = t$14, r$18) { - constructor({ name: e, message: t, cause: r }) { - super(t), this[n$16] = !0, this.name = e, this.cause = r; - } - static isInstance(t) { - return i.hasMarker(t, e$4); - } - static hasMarker(e, t) { - let n = Symbol.for(t); - return typeof e == `object` && !!e && n in e && typeof e[n] == `boolean` && e[n] === !0; - } -}; -var ee$8 = `AI_APICallError`; -var a$14 = `vercel.ai.error.${ee$8}`; -var o$14 = Symbol.for(a$14); -var te$8; -var s$12; -var c$14 = class extends (s$12 = i$17, te$8 = o$14, s$12) { - constructor({ message: e, url: t, requestBodyValues: n, statusCode: r, responseHeaders: i, responseBody: a, cause: o, isRetryable: s = r != null && (r === 408 || r === 409 || r === 429 || r >= 500), data: c }) { - super({ - name: ee$8, - message: e, - cause: o - }), this[te$8] = !0, this.url = t, this.requestBodyValues = n, this.statusCode = r, this.responseHeaders = i, this.responseBody = a, this.isRetryable = s, this.data = c; - } - static isInstance(e) { - return i$17.hasMarker(e, a$14); - } -}; -var l$13 = `AI_EmptyResponseBodyError`; -var u$15 = `vercel.ai.error.${l$13}`; -var ne$8 = Symbol.for(u$15); -var d$15; -var f$14; -var re$9 = class extends (f$14 = i$17, d$15 = ne$8, f$14) { - constructor({ message: e = `Empty response body` } = {}) { - super({ - name: l$13, - message: e - }), this[d$15] = !0; - } - static isInstance(e) { - return i$17.hasMarker(e, u$15); - } -}; -function p$15(e) { - return e == null ? `unknown error` : typeof e == `string` ? e : e instanceof Error ? e.toString() : JSON.stringify(e); -} -var m$11 = `AI_InvalidArgumentError`; -var h$13 = `vercel.ai.error.${m$11}`; -var ie$9 = Symbol.for(h$13); -var g$12; -var _$11; -var ae$10 = class extends (_$11 = i$17, g$12 = ie$9, _$11) { - constructor({ message: e, cause: t, argument: n }) { - super({ - name: m$11, - message: e, - cause: t - }), this[g$12] = !0, this.argument = n; - } - static isInstance(e) { - return i$17.hasMarker(e, h$13); - } -}; -var v$11 = `AI_InvalidPromptError`; -var y$9 = `vercel.ai.error.${v$11}`; -var oe$10 = Symbol.for(y$9); -var b$12; -var x$13; -var se$11 = class extends (x$13 = i$17, b$12 = oe$10, x$13) { - constructor({ prompt: e, message: t, cause: n }) { - super({ - name: v$11, - message: `Invalid prompt: ${t}`, - cause: n - }), this[b$12] = !0, this.prompt = e; - } - static isInstance(e) { - return i$17.hasMarker(e, y$9); - } -}; -var S$14 = `AI_InvalidResponseDataError`; -var C$15 = `vercel.ai.error.${S$14}`; -var ce$11 = Symbol.for(C$15); -var w$15; -var T$15; -var le$11 = class extends (T$15 = i$17, w$15 = ce$11, T$15) { - constructor({ data: e, message: t = `Invalid response data: ${JSON.stringify(e)}.` }) { - super({ - name: S$14, - message: t - }), this[w$15] = !0, this.data = e; - } - static isInstance(e) { - return i$17.hasMarker(e, C$15); - } -}; -var E$15 = `AI_JSONParseError`; -var D$14 = `vercel.ai.error.${E$15}`; -var ue$11 = Symbol.for(D$14); -var O$13; -var k$14; -var de$11 = class extends (k$14 = i$17, O$13 = ue$11, k$14) { - constructor({ text: e, cause: t }) { - super({ - name: E$15, - message: `JSON parsing failed: Text: ${e}. -Error message: ${p$15(t)}`, - cause: t - }), this[O$13] = !0, this.text = e; - } - static isInstance(e) { - return i$17.hasMarker(e, D$14); - } -}; -var A$13 = `AI_LoadAPIKeyError`; -var j$13 = `vercel.ai.error.${A$13}`; -var fe$11 = Symbol.for(j$13); -var M$13; -var N$12; -var pe$10 = class extends (N$12 = i$17, M$13 = fe$11, N$12) { - constructor({ message: e }) { - super({ - name: A$13, - message: e - }), this[M$13] = !0; - } - static isInstance(e) { - return i$17.hasMarker(e, j$13); - } -}; -var P$12 = `AI_LoadSettingError`; -var F$12 = `vercel.ai.error.${P$12}`; -var me$10 = Symbol.for(F$12); -var I$12; -var L$11; -var he$10 = class extends (L$11 = i$17, I$12 = me$10, L$11) { - constructor({ message: e }) { - super({ - name: P$12, - message: e - }), this[I$12] = !0; - } - static isInstance(e) { - return i$17.hasMarker(e, F$12); - } -}; -var ge$10 = `AI_NoContentGeneratedError`; -var R$13 = `vercel.ai.error.${ge$10}`; -var _e$10 = Symbol.for(R$13); -var z$13; -var B$14; -var ve$10 = class extends (B$14 = i$17, z$13 = _e$10, B$14) { - constructor({ message: e = `No content generated.` } = {}) { - super({ - name: ge$10, - message: e - }), this[z$13] = !0; - } - static isInstance(e) { - return i$17.hasMarker(e, R$13); - } -}; -var V$13 = `AI_NoSuchModelError`; -var H$12 = `vercel.ai.error.${V$13}`; -var ye$10 = Symbol.for(H$12); -var U$12; -var W$10; -var be$10 = class extends (W$10 = i$17, U$12 = ye$10, W$10) { - constructor({ errorName: e = V$13, modelId: t, modelType: n, message: r = `No such ${n}: ${t}` }) { - super({ - name: e, - message: r - }), this[U$12] = !0, this.modelId = t, this.modelType = n; - } - static isInstance(e) { - return i$17.hasMarker(e, H$12); - } -}; -var G$10 = `AI_NoSuchProviderReferenceError`; -var K$11 = `vercel.ai.error.${G$10}`; -var xe$10 = Symbol.for(K$11); -var q$11; -var J$11; -var Se$10 = class extends (J$11 = i$17, q$11 = xe$10, J$11) { - constructor({ provider: e, reference: t, message: n = `No provider reference found for provider '${e}'. Available providers: ${Object.keys(t).join(`, `)}` }) { - super({ - name: G$10, - message: n - }), this[q$11] = !0, this.provider = e, this.reference = t; - } - static isInstance(e) { - return i$17.hasMarker(e, K$11); - } -}; -var Y$14 = `AI_TooManyEmbeddingValuesForCallError`; -var X$14 = `vercel.ai.error.${Y$14}`; -var Ce$10 = Symbol.for(X$14); -var Z$13; -var we$10; -var Te$10 = class extends (we$10 = i$17, Z$13 = Ce$10, we$10) { - constructor(e) { - super({ - name: Y$14, - message: `Too many values for a single embedding call. The ${e.provider} model "${e.modelId}" can only embed up to ${e.maxEmbeddingsPerCall} values per call, but ${e.values.length} values were provided.` - }), this[Z$13] = !0, this.provider = e.provider, this.modelId = e.modelId, this.maxEmbeddingsPerCall = e.maxEmbeddingsPerCall, this.values = e.values; - } - static isInstance(e) { - return i$17.hasMarker(e, X$14); - } -}; -var Ee$10 = `AI_TypeValidationError`; -var De$9 = `vercel.ai.error.${Ee$10}`; -var Oe$10 = Symbol.for(De$9); -var Q$12; -var ke$9; -var Ae$10 = class e extends (ke$9 = i$17, Q$12 = Oe$10, ke$9) { - constructor({ value: e, cause: t, context: n }) { - let r = `Type validation failed`; - if (n?.field && (r += ` for ${n.field}`), n?.entityName || n?.entityId) { - r += ` (`; - let e = []; - n.entityName && e.push(n.entityName), n.entityId && e.push(`id: "${n.entityId}"`), r += e.join(`, `), r += `)`; - } - super({ - name: Ee$10, - message: `${r}: Value: ${JSON.stringify(e)}. -Error message: ${p$15(t)}`, - cause: t - }), this[Q$12] = !0, this.value = e, this.context = n; - } - static isInstance(e) { - return i$17.hasMarker(e, De$9); - } - static wrap({ value: t, cause: n, context: r }) { - return e.isInstance(n) && n.value === t && n.context?.field === r?.field && n.context?.entityName === r?.entityName && n.context?.entityId === r?.entityId ? n : new e({ - value: t, - cause: n, - context: r - }); - } -}; -var je$11 = `AI_UnsupportedFunctionalityError`; -var Me$10 = `vercel.ai.error.${je$11}`; -var Ne$11 = Symbol.for(Me$10); -var Pe$10; -var Fe$10; -var Ie$10 = class extends (Fe$10 = i$17, Pe$10 = Ne$11, Fe$10) { - constructor({ functionality: e, message: t = `'${e}' functionality not supported.` }) { - super({ - name: je$11, - message: t - }), this[Pe$10] = !0, this.functionality = e; - } - static isInstance(e) { - return i$17.hasMarker(e, Me$10); - } -}; -function $$12(e) { - return e === null || typeof e == `string` || typeof e == `number` || typeof e == `boolean` ? !0 : Array.isArray(e) ? e.every($$12) : typeof e == `object` ? Object.entries(e).every(([e, t]) => typeof e == `string` && (t === void 0 || $$12(t))) : !1; -} -function Re$10(e) { - return typeof e == `object` && !!e && Object.entries(e).every(([e, t]) => typeof e == `string` && (t === void 0 || $$12(t))); -} -//#endregion -//#region node_modules/eve/dist/src/internal/logging.js -const LEVEL_SEVERITY = { - debug: 10, - info: 20, - warn: 30, - error: 40 -}; -function createLogger(e) { - return { - debug(t, n) { - write(`debug`, e, t, n); - }, - info(t, n) { - write(`info`, e, t, n); - }, - warn(t, n) { - write(`warn`, e, t, n); - }, - error(t, n) { - write(`error`, e, t, n), recordOnActiveSpan(t, n); - } - }; -} -function logError(e, t, n, r) { - let i = formatError(n); - return e.error(t, { - ...r, - error: i - }), typeof i.errorId == `string` ? i.errorId : createErrorId(); -} -function createErrorId() { - return crypto.randomUUID(); -} -function formatError(e, t) { - let n = { - errorId: t ?? createErrorId(), - message: extractErrorMessage(e) - }, r = extractErrorName(e); - return r !== void 0 && (n.name = r), n.detail = inspectError(e), n; -} -function extractErrorName(e) { - if (e instanceof Error) return e.name === `Error` ? void 0 : e.name; - if (isObject(e) && isNonEmptyString(e.name) && e.name !== `Error`) return e.name; -} -function extractErrorMessage(e) { - return isObject(e) && !(e instanceof Error) && typeof e.message == `string` ? e.message : p$15(e); -} -function recordErrorOnSpan(e, t) { - let n = t instanceof Error ? t.message : p$15(t), i = t instanceof Error ? t.name : `Error`; - e.setStatus({ - code: U$13.ERROR, - message: n - }), e.recordException({ - message: n, - name: i, - stack: inspectError(t) - }); -} -function resolveThreshold() { - let e = process.env.EVE_LOG_LEVEL?.toLowerCase(); - return e === `debug` || e === `info` || e === `warn` || e === `error` ? LEVEL_SEVERITY[e] : LEVEL_SEVERITY.info; -} -function write(e, t, n, r) { - if (LEVEL_SEVERITY[e] < resolveThreshold()) return; - let i = e === `error` ? console.error : e === `warn` ? console.warn : console.log, a = `[eve:${t}] ${n}`; - if (r === void 0) { - i(a); - return; - } - i(a, renderFields(r)); -} -function renderFields(e) { - let t = {}; - for (let [n, r] of Object.entries(e)) if (r !== void 0) { - if (r instanceof Error) { - t[n] = formatError(r); - continue; - } - t[n] = r; - } - return t; -} -function recordOnActiveSpan(e, t) { - let n = $$13.getActiveSpan(); - if (n === void 0) return; - let a = t?.error; - if (a instanceof Error) { - recordErrorOnSpan(n, a); - return; - } - if (isFormattedError(a)) { - n.setStatus({ - code: U$13.ERROR, - message: a.message - }), n.recordException({ - message: a.message, - name: typeof a.name == `string` ? a.name : `Error`, - stack: typeof a.detail == `string` ? a.detail : void 0 - }); - return; - } - n.addEvent(e, t ? renderFields(t) : void 0); -} -function isFormattedError(e) { - return isObject(e) && typeof e.errorId == `string` && typeof e.message == `string`; -} -function inspectError(t) { - return truncate(inspect(t, { - breakLength: Infinity, - compact: !1, - depth: 10, - maxStringLength: 8192 - }), 16384); -} -function truncate(e, t) { - if (Buffer.byteLength(e, `utf8`) <= t) return e; - let n = e.slice(0, t); - for (; Buffer.byteLength(n, `utf8`) > t && n.length > 0;) n = n.slice(0, -1); - return `${n}<…truncated>`; -} -//#endregion -//#region node_modules/eve/dist/src/execution/runtime-errors.js -var RuntimeNoActiveSessionError = class extends Error { - code = `NO_ACTIVE_SESSION`; - continuationToken; - constructor(e) { - super(`No active session for continuationToken "${e}".`), this.name = `RuntimeNoActiveSessionError`, this.continuationToken = e; - } -}; -function isRuntimeNoActiveSessionError(e) { - return e instanceof RuntimeNoActiveSessionError; -} -//#endregion -//#region node_modules/eve/dist/src/internal/package-name.js -const EVE_PACKAGE_NAME = `eve`; -//#endregion -//#region node_modules/eve/dist/src/internal/application/package.js -let cachedPackageInfo; -const BUNDLED_FALLBACK_PACKAGE_VERSION = `0.16.2`; -function resolveFallbackPackageVersion() { - return BUNDLED_FALLBACK_PACKAGE_VERSION.startsWith(`__`) ? `0.0.0` : BUNDLED_FALLBACK_PACKAGE_VERSION; -} -const FALLBACK_PACKAGE_INFO = { - name: EVE_PACKAGE_NAME, - version: resolveFallbackPackageVersion() -}; -function resolveCurrentModulePath() { - return typeof __filename == `string` ? __filename : resolveCurrentModulePathFromStack(); -} -function resolveCurrentModulePathFromStack() { - let e = Error.prepareStackTrace; - try { - Error.prepareStackTrace = (e, t) => t; - let e = Error().stack?.[0]?.getFileName(); - if (typeof e != `string` || e.length === 0) throw Error(`Failed to resolve the current module path from the stack trace.`); - return e.startsWith(`file:`) ? fileURLToPath(e) : e; - } finally { - Error.prepareStackTrace = e; - } -} -const require = createRequire(resolveCurrentModulePath()); -function isBuildOutputPackageRoot(e) { - return basename(e) === `dist` && existsSync(join(dirname(e), `package.json`)); -} -function resolvePackageBuildRoot() { - let e = dirname(realpathSync(resolveCurrentModulePath())); - for (;;) { - if (isBuildOutputPackageRoot(e)) return e; - let t = dirname(e); - if (t === e) return null; - e = t; - } -} -function findNearestPackageRoot$1(e) { - let n = e; - for (;;) { - if (existsSync(join(n, `package.json`)) && !isBuildOutputPackageRoot(n)) return n; - let r = dirname(n); - if (r === n) throw Error(`Failed to resolve package root from "${e}".`); - n = r; - } -} -function resolvePackageRoot() { - return findNearestPackageRoot$1(dirname(realpathSync(resolveCurrentModulePath()))); -} -function tryResolvePackageRoot() { - try { - return resolvePackageRoot(); - } catch { - return; - } -} -function rewriteSourceFilePathForBuild(e) { - return e.replace(/\.[cm]?tsx?$/, `.js`); -} -function resolvePackageSourceFilePath(e) { - let t = resolvePackageBuildRoot(); - return t === null ? join(resolvePackageRoot(), e) : join(t, rewriteSourceFilePathForBuild(e)); -} -function normalizeInstalledPackageInfo(e) { - let t = e; - if (!(typeof t.name != `string` || typeof t.version != `string`)) return { - name: t.name, - version: t.version - }; -} -function tryReadInstalledPackageInfo(e, t) { - let r = normalizeInstalledPackageInfo(JSON.parse(readFileSync(e, `utf8`))); - if (r?.name === t) return r; -} -function resolveInstalledPackageInfo() { - if (cachedPackageInfo) return cachedPackageInfo; - let e = tryResolvePackageRoot(), t = e === void 0 ? void 0 : tryReadInstalledPackageInfo(join(e, `package.json`), EVE_PACKAGE_NAME); - if (t) return cachedPackageInfo = t, cachedPackageInfo; - try { - let e = tryReadInstalledPackageInfo(require.resolve(`${EVE_PACKAGE_NAME}/package.json`), EVE_PACKAGE_NAME); - if (e) return cachedPackageInfo = e, cachedPackageInfo; - } catch {} - return cachedPackageInfo = { ...FALLBACK_PACKAGE_INFO }, cachedPackageInfo; -} -//#endregion -//#region node_modules/eve/dist/src/runtime/compiled-artifacts-source.js -function createBundledRuntimeCompiledArtifactsSource() { - return { kind: `bundled` }; -} -function createDiskRuntimeCompiledArtifactsSource(e, t = {}) { - return t.moduleMapLoaderPath !== void 0 || t.sandboxAppRoot !== void 0 ? { - appRoot: e, - kind: `disk`, - moduleMapLoaderPath: t.moduleMapLoaderPath, - sandboxAppRoot: t.sandboxAppRoot - } : { - appRoot: e, - kind: `disk` - }; -} -function getRuntimeCompiledArtifactsAppRoot(e) { - return e.kind === `disk` ? e.appRoot : void 0; -} -function getRuntimeCompiledArtifactsSandboxAppRoot(e) { - return e.kind === `disk` ? e.sandboxAppRoot ?? e.appRoot : void 0; -} -function getRuntimeCompiledArtifactsCacheKey(e) { - return e.kind === `disk` ? e.moduleMapLoaderPath === void 0 ? `disk:${e.appRoot}` : `disk:${e.appRoot}:authored-source:${e.moduleMapLoaderPath}` : `bundled`; -} -//#endregion -//#region node_modules/eve/dist/src/runtime/graph.js -const ROOT_RUNTIME_AGENT_NODE_ID = `__root__`; -function getResolvedRuntimeAgentNode(e, t) { - if (t === void 0 || t === `__root__`) return e.root; - let n = e.nodesByNodeId.get(t); - if (n === void 0) throw Error(`Missing runtime agent node for node id "${t}".`); - return n; -} -//#endregion -//#region node_modules/eve/dist/src/compiled/_chunks/client/core-Bm8azZA6.js -var e$3 = Object.defineProperty; -var t$13 = (t, n) => { - let r = {}; - for (var i in t) e$3(r, i, { - get: t[i], - enumerable: !0 - }); - return n || e$3(r, Symbol.toStringTag, { value: `Module` }), r; -}; -var n$15; -const r$17 = Object.freeze({ status: `aborted` }); -function i$16(e, t, n) { - function r(n, r) { - if (n._zod || Object.defineProperty(n, "_zod", { - value: { - def: r, - constr: o, - traits: /* @__PURE__ */ new Set() - }, - enumerable: !1 - }), n._zod.traits.has(e)) return; - n._zod.traits.add(e), t(n, r); - let i = o.prototype, a = Object.keys(i); - for (let e = 0; e < a.length; e++) { - let t = a[e]; - t in n || (n[t] = i[t].bind(n)); - } - } - let i = n?.Parent ?? Object; - class a extends i {} - Object.defineProperty(a, "name", { value: e }); - function o(e) { - var t; - let i = n?.Parent ? new a() : this; - r(i, e), (t = i._zod).deferred ?? (t.deferred = []); - for (let e of i._zod.deferred) e(); - return i; - } - return Object.defineProperty(o, "init", { value: r }), Object.defineProperty(o, Symbol.hasInstance, { value: (t) => n?.Parent && t instanceof n.Parent ? !0 : t?._zod?.traits?.has(e) }), Object.defineProperty(o, "name", { value: e }), o; -} -const a$13 = Symbol(`zod_brand`); -var o$13 = class extends Error { - constructor() { - super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`); - } -}; -var s$11 = class extends Error { - constructor(e) { - super(`Encountered unidirectional transform during encode: ${e}`), this.name = `ZodEncodeError`; - } -}; -(n$15 = globalThis).__zod_globalConfig ?? (n$15.__zod_globalConfig = {}); -const c$13 = globalThis.__zod_globalConfig; -function l$12(e) { - return e && Object.assign(c$13, e), c$13; -} -var u$14 = t$13({ - BIGINT_FORMAT_RANGES: () => we$9, - Class: () => He$9, - NUMBER_FORMAT_RANGES: () => Ce$9, - aborted: () => E$14, - allowsEval: () => he$9, - assert: () => te$7, - assertEqual: () => d$14, - assertIs: () => p$14, - assertNever: () => ee$7, - assertNotEqual: () => f$13, - assignProp: () => v$10, - base64ToUint8Array: () => Ie$9, - base64urlToUint8Array: () => Re$9, - cached: () => h$12, - captureStackTrace: () => me$9, - cleanEnum: () => Fe$9, - cleanRegex: () => ie$8, - clone: () => C$14, - cloneDef: () => ce$10, - createTransparentProxy: () => xe$9, - defineLazy: () => _$10, - esc: () => fe$10, - escapeRegex: () => S$13, - explicitlyAborted: () => Me$9, - extend: () => De$8, - finalizeIssue: () => k$13, - floatSafeRemainder: () => ae$9, - getElementAtPath: () => le$10, - getEnumValues: () => ne$7, - getLengthableOrigin: () => Pe$9, - getParsedType: () => ve$9, - getSizableOrigin: () => Ne$10, - hexToUint8Array: () => Be$9, - isObject: () => b$11, - isPlainObject: () => x$12, - issue: () => j$12, - joinValues: () => m$10, - jsonStringifyReplacer: () => re$8, - merge: () => ke$8, - mergeDefs: () => y$8, - normalizeParams: () => w$14, - nullish: () => g$11, - numKeys: () => _e$9, - objectClone: () => se$10, - omit: () => Ee$9, - optionalKeys: () => Se$9, - parsedType: () => A$12, - partial: () => Ae$9, - pick: () => Te$9, - prefixIssues: () => D$13, - primitiveTypes: () => be$9, - promiseAllObject: () => ue$10, - propertyKeyTypes: () => ye$9, - randomString: () => de$10, - required: () => je$10, - safeExtend: () => Oe$9, - shallowClone: () => ge$9, - slugify: () => pe$9, - stringifyPrimitive: () => T$14, - uint8ArrayToBase64: () => Le$9, - uint8ArrayToBase64url: () => ze$9, - uint8ArrayToHex: () => Ve$9, - unwrapMessage: () => O$12 -}); -function d$14(e) { - return e; -} -function f$13(e) { - return e; -} -function p$14(e) {} -function ee$7(e) { - throw Error(`Unexpected value in exhaustive check`); -} -function te$7(e) {} -function ne$7(e) { - let t = Object.values(e).filter((e) => typeof e == `number`); - return Object.entries(e).filter(([e, n]) => t.indexOf(+e) === -1).map(([e, t]) => t); -} -function m$10(e, t = `|`) { - return e.map((e) => T$14(e)).join(t); -} -function re$8(e, t) { - return typeof t == `bigint` ? t.toString() : t; -} -function h$12(e) { - return { get value() { - { - let t = e(); - return Object.defineProperty(this, "value", { value: t }), t; - } - } }; -} -function g$11(e) { - return e == null; -} -function ie$8(e) { - let t = +!!e.startsWith(`^`), n = e.endsWith(`$`) ? e.length - 1 : e.length; - return e.slice(t, n); -} -function ae$9(e, t) { - let n = e / t, r = Math.round(n), i = 2 ** -52 * Math.max(Math.abs(n), 1); - return Math.abs(n - r) < i ? 0 : n - r; -} -const oe$9 = Symbol(`evaluating`); -function _$10(e, t, n) { - let r; - Object.defineProperty(e, t, { - get() { - if (r !== oe$9) return r === void 0 && (r = oe$9, r = n()), r; - }, - set(n) { - Object.defineProperty(e, t, { value: n }); - }, - configurable: !0 - }); -} -function se$10(e) { - return Object.create(Object.getPrototypeOf(e), Object.getOwnPropertyDescriptors(e)); -} -function v$10(e, t, n) { - Object.defineProperty(e, t, { - value: n, - writable: !0, - enumerable: !0, - configurable: !0 - }); -} -function y$8(...e) { - let t = {}; - for (let n of e) Object.assign(t, Object.getOwnPropertyDescriptors(n)); - return Object.defineProperties({}, t); -} -function ce$10(e) { - return y$8(e._zod.def); -} -function le$10(e, t) { - return t ? t.reduce((e, t) => e?.[t], e) : e; -} -function ue$10(e) { - let t = Object.keys(e), n = t.map((t) => e[t]); - return Promise.all(n).then((e) => { - let n = {}; - for (let r = 0; r < t.length; r++) n[t[r]] = e[r]; - return n; - }); -} -function de$10(e = 10) { - let t = ``; - for (let n = 0; n < e; n++) t += `abcdefghijklmnopqrstuvwxyz`[Math.floor(Math.random() * 26)]; - return t; -} -function fe$10(e) { - return JSON.stringify(e); -} -function pe$9(e) { - return e.toLowerCase().trim().replace(/[^\w\s-]/g, ``).replace(/[\s_-]+/g, `-`).replace(/^-+|-+$/g, ``); -} -const me$9 = `captureStackTrace` in Error ? Error.captureStackTrace : (...e) => {}; -function b$11(e) { - return typeof e == `object` && !!e && !Array.isArray(e); -} -const he$9 = h$12(() => { - if (c$13.jitless || typeof navigator < `u` && navigator?.userAgent?.includes(`Cloudflare`)) return !1; - try { - return Function(``), !0; - } catch { - return !1; - } -}); -function x$12(e) { - if (b$11(e) === !1) return !1; - let t = e.constructor; - if (t === void 0 || typeof t != `function`) return !0; - let n = t.prototype; - return !(b$11(n) === !1 || Object.prototype.hasOwnProperty.call(n, `isPrototypeOf`) === !1); -} -function ge$9(e) { - return x$12(e) ? { ...e } : Array.isArray(e) ? [...e] : e instanceof Map ? new Map(e) : e instanceof Set ? new Set(e) : e; -} -function _e$9(e) { - let t = 0; - for (let n in e) Object.prototype.hasOwnProperty.call(e, n) && t++; - return t; -} -const ve$9 = (e) => { - let t = typeof e; - switch (t) { - case `undefined`: return `undefined`; - case `string`: return `string`; - case `number`: return Number.isNaN(e) ? `nan` : `number`; - case `boolean`: return `boolean`; - case `function`: return `function`; - case `bigint`: return `bigint`; - case `symbol`: return `symbol`; - case `object`: return Array.isArray(e) ? `array` : e === null ? `null` : e.then && typeof e.then == `function` && e.catch && typeof e.catch == `function` ? `promise` : typeof Map < `u` && e instanceof Map ? `map` : typeof Set < `u` && e instanceof Set ? `set` : typeof Date < `u` && e instanceof Date ? `date` : typeof File < `u` && e instanceof File ? `file` : `object`; - default: throw Error(`Unknown data type: ${t}`); - } -}; -const ye$9 = /* @__PURE__ */ new Set([ - `string`, - `number`, - `symbol` -]); -const be$9 = /* @__PURE__ */ new Set([ - `string`, - `number`, - `bigint`, - `boolean`, - `symbol`, - `undefined` -]); -function S$13(e) { - return e.replace(/[.*+?^${}()|[\]\\]/g, `\\$&`); -} -function C$14(e, t, n) { - let r = new e._zod.constr(t ?? e._zod.def); - return (!t || n?.parent) && (r._zod.parent = e), r; -} -function w$14(e) { - let t = e; - if (!t) return {}; - if (typeof t == `string`) return { error: () => t }; - if (t?.message !== void 0) { - if (t?.error !== void 0) throw Error("Cannot specify both `message` and `error` params"); - t.error = t.message; - } - return delete t.message, typeof t.error == `string` ? { - ...t, - error: () => t.error - } : t; -} -function xe$9(e) { - let t; - return new Proxy({}, { - get(n, r, i) { - return t ??= e(), Reflect.get(t, r, i); - }, - set(n, r, i, a) { - return t ??= e(), Reflect.set(t, r, i, a); - }, - has(n, r) { - return t ??= e(), Reflect.has(t, r); - }, - deleteProperty(n, r) { - return t ??= e(), Reflect.deleteProperty(t, r); - }, - ownKeys(n) { - return t ??= e(), Reflect.ownKeys(t); - }, - getOwnPropertyDescriptor(n, r) { - return t ??= e(), Reflect.getOwnPropertyDescriptor(t, r); - }, - defineProperty(n, r, i) { - return t ??= e(), Reflect.defineProperty(t, r, i); - } - }); -} -function T$14(e) { - return typeof e == `bigint` ? e.toString() + `n` : typeof e == `string` ? `"${e}"` : `${e}`; -} -function Se$9(e) { - return Object.keys(e).filter((t) => e[t]._zod.optin === `optional` && e[t]._zod.optout === `optional`); -} -const Ce$9 = { - safeint: [-(2 ** 53 - 1), 2 ** 53 - 1], - int32: [-2147483648, 2147483647], - uint32: [0, 4294967295], - float32: [-34028234663852886e22, 34028234663852886e22], - float64: [-Number.MAX_VALUE, Number.MAX_VALUE] -}; -const we$9 = { - int64: [BigInt(`-9223372036854775808`), BigInt(`9223372036854775807`)], - uint64: [BigInt(0), BigInt(`18446744073709551615`)] -}; -function Te$9(e, t) { - let n = e._zod.def, r = n.checks; - if (r && r.length > 0) throw Error(`.pick() cannot be used on object schemas containing refinements`); - return C$14(e, y$8(e._zod.def, { - get shape() { - let e = {}; - for (let r in t) { - if (!(r in n.shape)) throw Error(`Unrecognized key: "${r}"`); - t[r] && (e[r] = n.shape[r]); - } - return v$10(this, `shape`, e), e; - }, - checks: [] - })); -} -function Ee$9(e, t) { - let n = e._zod.def, r = n.checks; - if (r && r.length > 0) throw Error(`.omit() cannot be used on object schemas containing refinements`); - return C$14(e, y$8(e._zod.def, { - get shape() { - let r = { ...e._zod.def.shape }; - for (let e in t) { - if (!(e in n.shape)) throw Error(`Unrecognized key: "${e}"`); - t[e] && delete r[e]; - } - return v$10(this, `shape`, r), r; - }, - checks: [] - })); -} -function De$8(e, t) { - if (!x$12(t)) throw Error(`Invalid input to extend: expected a plain object`); - let n = e._zod.def.checks; - if (n && n.length > 0) { - let n = e._zod.def.shape; - for (let e in t) if (Object.getOwnPropertyDescriptor(n, e) !== void 0) throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead."); - } - return C$14(e, y$8(e._zod.def, { get shape() { - let n = { - ...e._zod.def.shape, - ...t - }; - return v$10(this, `shape`, n), n; - } })); -} -function Oe$9(e, t) { - if (!x$12(t)) throw Error(`Invalid input to safeExtend: expected a plain object`); - return C$14(e, y$8(e._zod.def, { get shape() { - let n = { - ...e._zod.def.shape, - ...t - }; - return v$10(this, `shape`, n), n; - } })); -} -function ke$8(e, t) { - if (e._zod.def.checks?.length) throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`); - return C$14(e, y$8(e._zod.def, { - get shape() { - let n = { - ...e._zod.def.shape, - ...t._zod.def.shape - }; - return v$10(this, `shape`, n), n; - }, - get catchall() { - return t._zod.def.catchall; - }, - checks: t._zod.def.checks ?? [] - })); -} -function Ae$9(e, t, n) { - let r = t._zod.def.checks; - if (r && r.length > 0) throw Error(`.partial() cannot be used on object schemas containing refinements`); - return C$14(t, y$8(t._zod.def, { - get shape() { - let r = t._zod.def.shape, i = { ...r }; - if (n) for (let t in n) { - if (!(t in r)) throw Error(`Unrecognized key: "${t}"`); - n[t] && (i[t] = e ? new e({ - type: `optional`, - innerType: r[t] - }) : r[t]); - } - else for (let t in r) i[t] = e ? new e({ - type: `optional`, - innerType: r[t] - }) : r[t]; - return v$10(this, `shape`, i), i; - }, - checks: [] - })); -} -function je$10(e, t, n) { - return C$14(t, y$8(t._zod.def, { get shape() { - let r = t._zod.def.shape, i = { ...r }; - if (n) for (let t in n) { - if (!(t in i)) throw Error(`Unrecognized key: "${t}"`); - n[t] && (i[t] = new e({ - type: `nonoptional`, - innerType: r[t] - })); - } - else for (let t in r) i[t] = new e({ - type: `nonoptional`, - innerType: r[t] - }); - return v$10(this, `shape`, i), i; - } })); -} -function E$14(e, t = 0) { - if (e.aborted === !0) return !0; - for (let n = t; n < e.issues.length; n++) if (e.issues[n]?.continue !== !0) return !0; - return !1; -} -function Me$9(e, t = 0) { - if (e.aborted === !0) return !0; - for (let n = t; n < e.issues.length; n++) if (e.issues[n]?.continue === !1) return !0; - return !1; -} -function D$13(e, t) { - return t.map((t) => { - var n; - return (n = t).path ?? (n.path = []), t.path.unshift(e), t; - }); -} -function O$12(e) { - return typeof e == `string` ? e : e?.message; -} -function k$13(e, t, n) { - let r = e.message ? e.message : O$12(e.inst?._zod.def?.error?.(e)) ?? O$12(t?.error?.(e)) ?? O$12(n.customError?.(e)) ?? O$12(n.localeError?.(e)) ?? `Invalid input`, { inst: i, continue: a, input: o, ...s } = e; - return s.path ??= [], s.message = r, t?.reportInput && (s.input = o), s; -} -function Ne$10(e) { - return e instanceof Set ? `set` : e instanceof Map ? `map` : e instanceof File ? `file` : `unknown`; -} -function Pe$9(e) { - return Array.isArray(e) ? `array` : typeof e == `string` ? `string` : `unknown`; -} -function A$12(e) { - let t = typeof e; - switch (t) { - case `number`: return Number.isNaN(e) ? `nan` : `number`; - case `object`: { - if (e === null) return `null`; - if (Array.isArray(e)) return `array`; - let t = e; - if (t && Object.getPrototypeOf(t) !== Object.prototype && `constructor` in t && t.constructor) return t.constructor.name; - } - } - return t; -} -function j$12(...e) { - let [t, n, r] = e; - return typeof t == `string` ? { - message: t, - code: `custom`, - input: n, - inst: r - } : { ...t }; -} -function Fe$9(e) { - return Object.entries(e).filter(([e, t]) => Number.isNaN(Number.parseInt(e, 10))).map((e) => e[1]); -} -function Ie$9(e) { - let t = atob(e), n = new Uint8Array(t.length); - for (let e = 0; e < t.length; e++) n[e] = t.charCodeAt(e); - return n; -} -function Le$9(e) { - let t = ``; - for (let n = 0; n < e.length; n++) t += String.fromCharCode(e[n]); - return btoa(t); -} -function Re$9(e) { - let t = e.replace(/-/g, `+`).replace(/_/g, `/`); - return Ie$9(t + `=`.repeat((4 - t.length % 4) % 4)); -} -function ze$9(e) { - return Le$9(e).replace(/\+/g, `-`).replace(/\//g, `_`).replace(/=/g, ``); -} -function Be$9(e) { - let t = e.replace(/^0x/, ``); - if (t.length % 2 != 0) throw Error(`Invalid hex string length`); - let n = new Uint8Array(t.length / 2); - for (let e = 0; e < t.length; e += 2) n[e / 2] = Number.parseInt(t.slice(e, e + 2), 16); - return n; -} -function Ve$9(e) { - return Array.from(e).map((e) => e.toString(16).padStart(2, `0`)).join(``); -} -var He$9 = class { - constructor(...e) {} -}; -const Ue$9 = (e, t) => { - e.name = `$ZodError`, Object.defineProperty(e, "_zod", { - value: e._zod, - enumerable: !1 - }), Object.defineProperty(e, "issues", { - value: t, - enumerable: !1 - }), e.message = JSON.stringify(t, re$8, 2), Object.defineProperty(e, "toString", { - value: () => e.message, - enumerable: !1 - }); -}; -const We$9 = i$16(`$ZodError`, Ue$9); -const M$12 = i$16(`$ZodError`, Ue$9, { Parent: Error }); -function Ge$9(e, t = (e) => e.message) { - let n = {}, r = []; - for (let i of e.issues) i.path.length > 0 ? (n[i.path[0]] = n[i.path[0]] || [], n[i.path[0]].push(t(i))) : r.push(t(i)); - return { - formErrors: r, - fieldErrors: n - }; -} -function Ke$9(e, t = (e) => e.message) { - let n = { _errors: [] }, r = (e, i = []) => { - for (let a of e.issues) if (a.code === `invalid_union` && a.errors.length) a.errors.map((e) => r({ issues: e }, [...i, ...a.path])); - else if (a.code === `invalid_key`) r({ issues: a.issues }, [...i, ...a.path]); - else if (a.code === `invalid_element`) r({ issues: a.issues }, [...i, ...a.path]); - else { - let e = [...i, ...a.path]; - if (e.length === 0) n._errors.push(t(a)); - else { - let r = n, i = 0; - for (; i < e.length;) { - let n = e[i]; - i === e.length - 1 ? (r[n] = r[n] || { _errors: [] }, r[n]._errors.push(t(a))) : r[n] = r[n] || { _errors: [] }, r = r[n], i++; - } - } - } - }; - return r(e), n; -} -function qe$9(e, t = (e) => e.message) { - let n = { errors: [] }, r = (e, i = []) => { - var a, o; - for (let s of e.issues) if (s.code === `invalid_union` && s.errors.length) s.errors.map((e) => r({ issues: e }, [...i, ...s.path])); - else if (s.code === `invalid_key`) r({ issues: s.issues }, [...i, ...s.path]); - else if (s.code === `invalid_element`) r({ issues: s.issues }, [...i, ...s.path]); - else { - let e = [...i, ...s.path]; - if (e.length === 0) { - n.errors.push(t(s)); - continue; - } - let r = n, c = 0; - for (; c < e.length;) { - let n = e[c], i = c === e.length - 1; - typeof n == `string` ? (r.properties ??= {}, (a = r.properties)[n] ?? (a[n] = { errors: [] }), r = r.properties[n]) : (r.items ??= [], (o = r.items)[n] ?? (o[n] = { errors: [] }), r = r.items[n]), i && r.errors.push(t(s)), c++; - } - } - }; - return r(e), n; -} -function Je$10(e) { - let t = [], n = e.map((e) => typeof e == `object` ? e.key : e); - for (let e of n) typeof e == `number` ? t.push(`[${e}]`) : typeof e == `symbol` ? t.push(`[${JSON.stringify(String(e))}]`) : /[^\w$]/.test(e) ? t.push(`[${JSON.stringify(e)}]`) : (t.length && t.push(`.`), t.push(e)); - return t.join(``); -} -function Ye$10(e) { - let t = [], n = [...e.issues].sort((e, t) => (e.path ?? []).length - (t.path ?? []).length); - for (let e of n) t.push(`✖ ${e.message}`), e.path?.length && t.push(` → at ${Je$10(e.path)}`); - return t.join(` -`); -} -const N$11 = (e) => (t, n, r, i) => { - let a = r ? { - ...r, - async: !1 - } : { async: !1 }, s = t._zod.run({ - value: n, - issues: [] - }, a); - if (s instanceof Promise) throw new o$13(); - if (s.issues.length) { - let t = new ((i?.Err) ?? e)(s.issues.map((e) => k$13(e, a, l$12()))); - throw me$9(t, i?.callee), t; - } - return s.value; -}; -const Xe$9 = N$11(M$12); -const P$11 = (e) => async (t, n, r, i) => { - let a = r ? { - ...r, - async: !0 - } : { async: !0 }, o = t._zod.run({ - value: n, - issues: [] - }, a); - if (o instanceof Promise && (o = await o), o.issues.length) { - let t = new ((i?.Err) ?? e)(o.issues.map((e) => k$13(e, a, l$12()))); - throw me$9(t, i?.callee), t; - } - return o.value; -}; -const Ze$10 = P$11(M$12); -const F$11 = (e) => (t, n, r) => { - let i = r ? { - ...r, - async: !1 - } : { async: !1 }, a = t._zod.run({ - value: n, - issues: [] - }, i); - if (a instanceof Promise) throw new o$13(); - return a.issues.length ? { - success: !1, - error: new (e ?? We$9)(a.issues.map((e) => k$13(e, i, l$12()))) - } : { - success: !0, - data: a.value - }; -}; -const Qe$9 = F$11(M$12); -const I$11 = (e) => async (t, n, r) => { - let i = r ? { - ...r, - async: !0 - } : { async: !0 }, a = t._zod.run({ - value: n, - issues: [] - }, i); - return a instanceof Promise && (a = await a), a.issues.length ? { - success: !1, - error: new e(a.issues.map((e) => k$13(e, i, l$12()))) - } : { - success: !0, - data: a.value - }; -}; -const $e$9 = I$11(M$12); -const et$9 = (e) => (t, n, r) => { - let i = r ? { - ...r, - direction: `backward` - } : { direction: `backward` }; - return N$11(e)(t, n, i); -}; -const tt$10 = et$9(M$12); -const nt$10 = (e) => (t, n, r) => N$11(e)(t, n, r); -const rt$9 = nt$10(M$12); -const it$8 = (e) => async (t, n, r) => { - let i = r ? { - ...r, - direction: `backward` - } : { direction: `backward` }; - return P$11(e)(t, n, i); -}; -const at$8 = it$8(M$12); -const ot$8 = (e) => async (t, n, r) => P$11(e)(t, n, r); -const st$8 = ot$8(M$12); -const ct$8 = (e) => (t, n, r) => { - let i = r ? { - ...r, - direction: `backward` - } : { direction: `backward` }; - return F$11(e)(t, n, i); -}; -const lt$8 = ct$8(M$12); -const ut$8 = (e) => (t, n, r) => F$11(e)(t, n, r); -const dt$8 = ut$8(M$12); -const ft$8 = (e) => async (t, n, r) => { - let i = r ? { - ...r, - direction: `backward` - } : { direction: `backward` }; - return I$11(e)(t, n, i); -}; -const pt$8 = ft$8(M$12); -const mt$8 = (e) => async (t, n, r) => I$11(e)(t, n, r); -const ht$8 = mt$8(M$12); -var gt$8 = t$13({ - base64: () => Vt$7, - base64url: () => Ht$7, - bigint: () => $t$7, - boolean: () => nn$6, - browserEmail: () => Pt$7, - cidrv4: () => zt$8, - cidrv6: () => Bt$6, - cuid: () => _t$8, - cuid2: () => vt$8, - date: () => Jt$7, - datetime: () => Zt$6, - domain: () => Wt$6, - duration: () => Ct$8, - e164: () => Kt$7, - email: () => kt$8, - emoji: () => Ft$7, - extendedDuration: () => wt$8, - guid: () => Tt$8, - hex: () => cn$6, - hostname: () => Ut$6, - html5Email: () => At$8, - httpProtocol: () => Gt$6, - idnEmail: () => Nt$7, - integer: () => en$7, - ipv4: () => It$7, - ipv6: () => Lt$8, - ksuid: () => xt$8, - lowercase: () => on$6, - mac: () => Rt$7, - md5_base64: () => un$6, - md5_base64url: () => dn$6, - md5_hex: () => ln$6, - nanoid: () => St$8, - null: () => rn$7, - number: () => tn$7, - rfc5322Email: () => jt$8, - sha1_base64: () => pn$6, - sha1_base64url: () => mn$6, - sha1_hex: () => fn$6, - sha256_base64: () => gn$7, - sha256_base64url: () => _n$7, - sha256_hex: () => hn$6, - sha384_base64: () => yn$7, - sha384_base64url: () => bn$7, - sha384_hex: () => vn$7, - sha512_base64: () => Sn$6, - sha512_base64url: () => Cn$6, - sha512_hex: () => xn$6, - string: () => Qt$7, - time: () => Xt$7, - ulid: () => yt$8, - undefined: () => an$6, - unicodeEmail: () => Mt$8, - uppercase: () => sn$6, - uuid: () => L$10, - uuid4: () => Et$9, - uuid6: () => Dt$8, - uuid7: () => Ot$8, - xid: () => bt$8 -}); -const _t$8 = /^[cC][0-9a-z]{6,}$/; -const vt$8 = /^[0-9a-z]+$/; -const yt$8 = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/; -const bt$8 = /^[0-9a-vA-V]{20}$/; -const xt$8 = /^[A-Za-z0-9]{27}$/; -const St$8 = /^[a-zA-Z0-9_-]{21}$/; -const Ct$8 = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/; -const wt$8 = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/; -const Tt$8 = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/; -const L$10 = (e) => e ? RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`) : /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/; -const Et$9 = L$10(4); -const Dt$8 = L$10(6); -const Ot$8 = L$10(7); -const kt$8 = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/; -const At$8 = /^[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])?)*$/; -const jt$8 = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; -const Mt$8 = /^[^\s@"]{1,64}@[^\s@]{1,255}$/u; -const Nt$7 = Mt$8; -const Pt$7 = /^[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])?)*$/; -function Ft$7() { - return RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`, `u`); -} -const It$7 = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/; -const Lt$8 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/; -const Rt$7 = (e) => { - let t = S$13(e ?? `:`); - return RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`); -}; -const zt$8 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/; -const Bt$6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/; -const Vt$7 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/; -const Ht$7 = /^[A-Za-z0-9_-]*$/; -const Ut$6 = /^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/; -const Wt$6 = /^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/; -const Gt$6 = /^https?$/; -const Kt$7 = /^\+[1-9]\d{6,14}$/; -const qt$7 = `(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`; -const Jt$7 = RegExp(`^${qt$7}$`); -function Yt$7(e) { - let t = `(?:[01]\\d|2[0-3]):[0-5]\\d`; - return typeof e.precision == `number` ? e.precision === -1 ? `${t}` : e.precision === 0 ? `${t}:[0-5]\\d` : `${t}:[0-5]\\d\\.\\d{${e.precision}}` : `${t}(?::[0-5]\\d(?:\\.\\d+)?)?`; -} -function Xt$7(e) { - return RegExp(`^${Yt$7(e)}$`); -} -function Zt$6(e) { - let t = Yt$7({ precision: e.precision }), n = [`Z`]; - e.local && n.push(``), e.offset && n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`); - let r = `${t}(?:${n.join(`|`)})`; - return RegExp(`^${qt$7}T(?:${r})$`); -} -const Qt$7 = (e) => { - let t = e ? `[\\s\\S]{${e?.minimum ?? 0},${e?.maximum ?? ``}}` : `[\\s\\S]*`; - return RegExp(`^${t}$`); -}; -const $t$7 = /^-?\d+n?$/; -const en$7 = /^-?\d+$/; -const tn$7 = /^-?\d+(?:\.\d+)?$/; -const nn$6 = /^(?:true|false)$/i; -const rn$7 = /^null$/i; -const an$6 = /^undefined$/i; -const on$6 = /^[^A-Z]*$/; -const sn$6 = /^[^a-z]*$/; -const cn$6 = /^[0-9a-fA-F]*$/; -function R$12(e, t) { - return RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`); -} -function z$12(e) { - return RegExp(`^[A-Za-z0-9_-]{${e}}$`); -} -const ln$6 = /^[0-9a-fA-F]{32}$/; -const un$6 = R$12(22, `==`); -const dn$6 = z$12(22); -const fn$6 = /^[0-9a-fA-F]{40}$/; -const pn$6 = R$12(27, `=`); -const mn$6 = z$12(27); -const hn$6 = /^[0-9a-fA-F]{64}$/; -const gn$7 = R$12(43, `=`); -const _n$7 = z$12(43); -const vn$7 = /^[0-9a-fA-F]{96}$/; -const yn$7 = R$12(64, ``); -const bn$7 = z$12(64); -const xn$6 = /^[0-9a-fA-F]{128}$/; -const Sn$6 = R$12(86, `==`); -const Cn$6 = z$12(86); -const B$13 = i$16(`$ZodCheck`, (e, t) => { - var n; - e._zod ??= {}, e._zod.def = t, (n = e._zod).onattach ?? (n.onattach = []); -}); -const wn$6 = { - number: `number`, - bigint: `bigint`, - object: `date` -}; -const Tn$6 = i$16(`$ZodCheckLessThan`, (e, t) => { - B$13.init(e, t); - let n = wn$6[typeof t.value]; - e._zod.onattach.push((e) => { - let n = e._zod.bag, r = (t.inclusive ? n.maximum : n.exclusiveMaximum) ?? Infinity; - t.value < r && (t.inclusive ? n.maximum = t.value : n.exclusiveMaximum = t.value); - }), e._zod.check = (r) => { - (t.inclusive ? r.value <= t.value : r.value < t.value) || r.issues.push({ - origin: n, - code: `too_big`, - maximum: typeof t.value == `object` ? t.value.getTime() : t.value, - input: r.value, - inclusive: t.inclusive, - inst: e, - continue: !t.abort - }); - }; -}); -const En$6 = i$16(`$ZodCheckGreaterThan`, (e, t) => { - B$13.init(e, t); - let n = wn$6[typeof t.value]; - e._zod.onattach.push((e) => { - let n = e._zod.bag, r = (t.inclusive ? n.minimum : n.exclusiveMinimum) ?? -Infinity; - t.value > r && (t.inclusive ? n.minimum = t.value : n.exclusiveMinimum = t.value); - }), e._zod.check = (r) => { - (t.inclusive ? r.value >= t.value : r.value > t.value) || r.issues.push({ - origin: n, - code: `too_small`, - minimum: typeof t.value == `object` ? t.value.getTime() : t.value, - input: r.value, - inclusive: t.inclusive, - inst: e, - continue: !t.abort - }); - }; -}); -const Dn$6 = i$16(`$ZodCheckMultipleOf`, (e, t) => { - B$13.init(e, t), e._zod.onattach.push((e) => { - var n; - (n = e._zod.bag).multipleOf ?? (n.multipleOf = t.value); - }), e._zod.check = (n) => { - if (typeof n.value != typeof t.value) throw Error(`Cannot mix number and bigint in multiple_of check.`); - (typeof n.value == `bigint` ? n.value % t.value === BigInt(0) : ae$9(n.value, t.value) === 0) || n.issues.push({ - origin: typeof n.value, - code: `not_multiple_of`, - divisor: t.value, - input: n.value, - inst: e, - continue: !t.abort - }); - }; -}); -const On$6 = i$16(`$ZodCheckNumberFormat`, (e, t) => { - B$13.init(e, t), t.format = t.format || `float64`; - let n = t.format?.includes(`int`), r = n ? `int` : `number`, [i, a] = Ce$9[t.format]; - e._zod.onattach.push((e) => { - let r = e._zod.bag; - r.format = t.format, r.minimum = i, r.maximum = a, n && (r.pattern = en$7); - }), e._zod.check = (o) => { - let s = o.value; - if (n) { - if (!Number.isInteger(s)) { - o.issues.push({ - expected: r, - format: t.format, - code: `invalid_type`, - continue: !1, - input: s, - inst: e - }); - return; - } - if (!Number.isSafeInteger(s)) { - s > 0 ? o.issues.push({ - input: s, - code: `too_big`, - maximum: 2 ** 53 - 1, - note: `Integers must be within the safe integer range.`, - inst: e, - origin: r, - inclusive: !0, - continue: !t.abort - }) : o.issues.push({ - input: s, - code: `too_small`, - minimum: -(2 ** 53 - 1), - note: `Integers must be within the safe integer range.`, - inst: e, - origin: r, - inclusive: !0, - continue: !t.abort - }); - return; - } - } - s < i && o.issues.push({ - origin: `number`, - input: s, - code: `too_small`, - minimum: i, - inclusive: !0, - inst: e, - continue: !t.abort - }), s > a && o.issues.push({ - origin: `number`, - input: s, - code: `too_big`, - maximum: a, - inclusive: !0, - inst: e, - continue: !t.abort - }); - }; -}); -const kn$6 = i$16(`$ZodCheckBigIntFormat`, (e, t) => { - B$13.init(e, t); - let [n, r] = we$9[t.format]; - e._zod.onattach.push((e) => { - let i = e._zod.bag; - i.format = t.format, i.minimum = n, i.maximum = r; - }), e._zod.check = (i) => { - let a = i.value; - a < n && i.issues.push({ - origin: `bigint`, - input: a, - code: `too_small`, - minimum: n, - inclusive: !0, - inst: e, - continue: !t.abort - }), a > r && i.issues.push({ - origin: `bigint`, - input: a, - code: `too_big`, - maximum: r, - inclusive: !0, - inst: e, - continue: !t.abort - }); - }; -}); -const An$5 = i$16(`$ZodCheckMaxSize`, (e, t) => { - var n; - B$13.init(e, t), (n = e._zod.def).when ?? (n.when = (e) => { - let t = e.value; - return !g$11(t) && t.size !== void 0; - }), e._zod.onattach.push((e) => { - let n = e._zod.bag.maximum ?? Infinity; - t.maximum < n && (e._zod.bag.maximum = t.maximum); - }), e._zod.check = (n) => { - let r = n.value; - r.size <= t.maximum || n.issues.push({ - origin: Ne$10(r), - code: `too_big`, - maximum: t.maximum, - inclusive: !0, - input: r, - inst: e, - continue: !t.abort - }); - }; -}); -const jn$5 = i$16(`$ZodCheckMinSize`, (e, t) => { - var n; - B$13.init(e, t), (n = e._zod.def).when ?? (n.when = (e) => { - let t = e.value; - return !g$11(t) && t.size !== void 0; - }), e._zod.onattach.push((e) => { - let n = e._zod.bag.minimum ?? -Infinity; - t.minimum > n && (e._zod.bag.minimum = t.minimum); - }), e._zod.check = (n) => { - let r = n.value; - r.size >= t.minimum || n.issues.push({ - origin: Ne$10(r), - code: `too_small`, - minimum: t.minimum, - inclusive: !0, - input: r, - inst: e, - continue: !t.abort - }); - }; -}); -const Mn$6 = i$16(`$ZodCheckSizeEquals`, (e, t) => { - var n; - B$13.init(e, t), (n = e._zod.def).when ?? (n.when = (e) => { - let t = e.value; - return !g$11(t) && t.size !== void 0; - }), e._zod.onattach.push((e) => { - let n = e._zod.bag; - n.minimum = t.size, n.maximum = t.size, n.size = t.size; - }), e._zod.check = (n) => { - let r = n.value, i = r.size; - if (i === t.size) return; - let a = i > t.size; - n.issues.push({ - origin: Ne$10(r), - ...a ? { - code: `too_big`, - maximum: t.size - } : { - code: `too_small`, - minimum: t.size - }, - inclusive: !0, - exact: !0, - input: n.value, - inst: e, - continue: !t.abort - }); - }; -}); -const Nn$5 = i$16(`$ZodCheckMaxLength`, (e, t) => { - var n; - B$13.init(e, t), (n = e._zod.def).when ?? (n.when = (e) => { - let t = e.value; - return !g$11(t) && t.length !== void 0; - }), e._zod.onattach.push((e) => { - let n = e._zod.bag.maximum ?? Infinity; - t.maximum < n && (e._zod.bag.maximum = t.maximum); - }), e._zod.check = (n) => { - let r = n.value; - if (r.length <= t.maximum) return; - let i = Pe$9(r); - n.issues.push({ - origin: i, - code: `too_big`, - maximum: t.maximum, - inclusive: !0, - input: r, - inst: e, - continue: !t.abort - }); - }; -}); -const Pn$5 = i$16(`$ZodCheckMinLength`, (e, t) => { - var n; - B$13.init(e, t), (n = e._zod.def).when ?? (n.when = (e) => { - let t = e.value; - return !g$11(t) && t.length !== void 0; - }), e._zod.onattach.push((e) => { - let n = e._zod.bag.minimum ?? -Infinity; - t.minimum > n && (e._zod.bag.minimum = t.minimum); - }), e._zod.check = (n) => { - let r = n.value; - if (r.length >= t.minimum) return; - let i = Pe$9(r); - n.issues.push({ - origin: i, - code: `too_small`, - minimum: t.minimum, - inclusive: !0, - input: r, - inst: e, - continue: !t.abort - }); - }; -}); -const Fn$4 = i$16(`$ZodCheckLengthEquals`, (e, t) => { - var n; - B$13.init(e, t), (n = e._zod.def).when ?? (n.when = (e) => { - let t = e.value; - return !g$11(t) && t.length !== void 0; - }), e._zod.onattach.push((e) => { - let n = e._zod.bag; - n.minimum = t.length, n.maximum = t.length, n.length = t.length; - }), e._zod.check = (n) => { - let r = n.value, i = r.length; - if (i === t.length) return; - let a = Pe$9(r), o = i > t.length; - n.issues.push({ - origin: a, - ...o ? { - code: `too_big`, - maximum: t.length - } : { - code: `too_small`, - minimum: t.length - }, - inclusive: !0, - exact: !0, - input: n.value, - inst: e, - continue: !t.abort - }); - }; -}); -const V$12 = i$16(`$ZodCheckStringFormat`, (e, t) => { - var n, r; - B$13.init(e, t), e._zod.onattach.push((e) => { - let n = e._zod.bag; - n.format = t.format, t.pattern && (n.patterns ??= /* @__PURE__ */ new Set(), n.patterns.add(t.pattern)); - }), t.pattern ? (n = e._zod).check ?? (n.check = (n) => { - t.pattern.lastIndex = 0, !t.pattern.test(n.value) && n.issues.push({ - origin: `string`, - code: `invalid_format`, - format: t.format, - input: n.value, - ...t.pattern ? { pattern: t.pattern.toString() } : {}, - inst: e, - continue: !t.abort - }); - }) : (r = e._zod).check ?? (r.check = () => {}); -}); -const In$4 = i$16(`$ZodCheckRegex`, (e, t) => { - V$12.init(e, t), e._zod.check = (n) => { - t.pattern.lastIndex = 0, !t.pattern.test(n.value) && n.issues.push({ - origin: `string`, - code: `invalid_format`, - format: `regex`, - input: n.value, - pattern: t.pattern.toString(), - inst: e, - continue: !t.abort - }); - }; -}); -const Ln$4 = i$16(`$ZodCheckLowerCase`, (e, t) => { - t.pattern ??= on$6, V$12.init(e, t); -}); -const Rn$4 = i$16(`$ZodCheckUpperCase`, (e, t) => { - t.pattern ??= sn$6, V$12.init(e, t); -}); -const zn$4 = i$16(`$ZodCheckIncludes`, (e, t) => { - B$13.init(e, t); - let n = S$13(t.includes), r = new RegExp(typeof t.position == `number` ? `^.{${t.position}}${n}` : n); - t.pattern = r, e._zod.onattach.push((e) => { - let t = e._zod.bag; - t.patterns ??= /* @__PURE__ */ new Set(), t.patterns.add(r); - }), e._zod.check = (n) => { - n.value.includes(t.includes, t.position) || n.issues.push({ - origin: `string`, - code: `invalid_format`, - format: `includes`, - includes: t.includes, - input: n.value, - inst: e, - continue: !t.abort - }); - }; -}); -const Bn$4 = i$16(`$ZodCheckStartsWith`, (e, t) => { - B$13.init(e, t); - let n = RegExp(`^${S$13(t.prefix)}.*`); - t.pattern ??= n, e._zod.onattach.push((e) => { - let t = e._zod.bag; - t.patterns ??= /* @__PURE__ */ new Set(), t.patterns.add(n); - }), e._zod.check = (n) => { - n.value.startsWith(t.prefix) || n.issues.push({ - origin: `string`, - code: `invalid_format`, - format: `starts_with`, - prefix: t.prefix, - input: n.value, - inst: e, - continue: !t.abort - }); - }; -}); -const Vn$4 = i$16(`$ZodCheckEndsWith`, (e, t) => { - B$13.init(e, t); - let n = RegExp(`.*${S$13(t.suffix)}$`); - t.pattern ??= n, e._zod.onattach.push((e) => { - let t = e._zod.bag; - t.patterns ??= /* @__PURE__ */ new Set(), t.patterns.add(n); - }), e._zod.check = (n) => { - n.value.endsWith(t.suffix) || n.issues.push({ - origin: `string`, - code: `invalid_format`, - format: `ends_with`, - suffix: t.suffix, - input: n.value, - inst: e, - continue: !t.abort - }); - }; -}); -function Hn$4(e, t, n) { - e.issues.length && t.issues.push(...D$13(n, e.issues)); -} -const Un$4 = i$16(`$ZodCheckProperty`, (e, t) => { - B$13.init(e, t), e._zod.check = (e) => { - let n = t.schema._zod.run({ - value: e.value[t.property], - issues: [] - }, {}); - if (n instanceof Promise) return n.then((n) => Hn$4(n, e, t.property)); - Hn$4(n, e, t.property); - }; -}); -const Wn$4 = i$16(`$ZodCheckMimeType`, (e, t) => { - B$13.init(e, t); - let n = new Set(t.mime); - e._zod.onattach.push((e) => { - e._zod.bag.mime = t.mime; - }), e._zod.check = (r) => { - n.has(r.value.type) || r.issues.push({ - code: `invalid_value`, - values: t.mime, - input: r.value.type, - inst: e, - continue: !t.abort - }); - }; -}); -const Gn$4 = i$16(`$ZodCheckOverwrite`, (e, t) => { - B$13.init(e, t), e._zod.check = (e) => { - e.value = t.tx(e.value); - }; -}); -var Kn$4 = class { - constructor(e = []) { - this.content = [], this.indent = 0, this && (this.args = e); - } - indented(e) { - this.indent += 1, e(this), --this.indent; - } - write(e) { - if (typeof e == `function`) { - e(this, { execution: `sync` }), e(this, { execution: `async` }); - return; - } - let t = e.split(` -`).filter((e) => e), n = Math.min(...t.map((e) => e.length - e.trimStart().length)), r = t.map((e) => e.slice(n)).map((e) => ` `.repeat(this.indent * 2) + e); - for (let e of r) this.content.push(e); - } - compile() { - let e = Function, t = this?.args, n = [...(this?.content ?? [``]).map((e) => ` ${e}`)]; - return new e(...t, n.join(` -`)); - } -}; -const qn$4 = { - major: 4, - minor: 4, - patch: 3 -}; -const H$11 = i$16(`$ZodType`, (e, t) => { - var n; - e ??= {}, e._zod.def = t, e._zod.bag = e._zod.bag || {}, e._zod.version = qn$4; - let r = [...e._zod.def.checks ?? []]; - e._zod.traits.has(`$ZodCheck`) && r.unshift(e); - for (let t of r) for (let n of t._zod.onattach) n(e); - if (r.length === 0) (n = e._zod).deferred ?? (n.deferred = []), e._zod.deferred?.push(() => { - e._zod.run = e._zod.parse; - }); - else { - let t = (e, t, n) => { - let r = E$14(e), i; - for (let a of t) { - if (a._zod.def.when) { - if (Me$9(e) || !a._zod.def.when(e)) continue; - } else if (r) continue; - let t = e.issues.length, s = a._zod.check(e); - if (s instanceof Promise && n?.async === !1) throw new o$13(); - if (i || s instanceof Promise) i = (i ?? Promise.resolve()).then(async () => { - await s, e.issues.length !== t && (r ||= E$14(e, t)); - }); - else { - if (e.issues.length === t) continue; - r ||= E$14(e, t); - } - } - return i ? i.then(() => e) : e; - }, n = (n, i, a) => { - if (E$14(n)) return n.aborted = !0, n; - let s = t(i, r, a); - if (s instanceof Promise) { - if (a.async === !1) throw new o$13(); - return s.then((t) => e._zod.parse(t, a)); - } - return e._zod.parse(s, a); - }; - e._zod.run = (i, a) => { - if (a.skipChecks) return e._zod.parse(i, a); - if (a.direction === `backward`) { - let t = e._zod.parse({ - value: i.value, - issues: [] - }, { - ...a, - skipChecks: !0 - }); - return t instanceof Promise ? t.then((e) => n(e, i, a)) : n(t, i, a); - } - let s = e._zod.parse(i, a); - if (s instanceof Promise) { - if (a.async === !1) throw new o$13(); - return s.then((e) => t(e, r, a)); - } - return t(s, r, a); - }; - } - _$10(e, `~standard`, () => ({ - validate: (t) => { - try { - let n = Qe$9(e, t); - return n.success ? { value: n.data } : { issues: n.error?.issues }; - } catch { - return $e$9(e, t).then((e) => e.success ? { value: e.data } : { issues: e.error?.issues }); - } - }, - vendor: `zod`, - version: 1 - })); -}); -const Jn$4 = i$16(`$ZodString`, (e, t) => { - H$11.init(e, t), e._zod.pattern = [...e?._zod.bag?.patterns ?? []].pop() ?? Qt$7(e._zod.bag), e._zod.parse = (n, r) => { - if (t.coerce) try { - n.value = String(n.value); - } catch {} - return typeof n.value == `string` || n.issues.push({ - expected: `string`, - code: `invalid_type`, - input: n.value, - inst: e - }), n; - }; -}); -const U$11 = i$16(`$ZodStringFormat`, (e, t) => { - V$12.init(e, t), Jn$4.init(e, t); -}); -const Yn$4 = i$16(`$ZodGUID`, (e, t) => { - t.pattern ??= Tt$8, U$11.init(e, t); -}); -const Xn$5 = i$16(`$ZodUUID`, (e, t) => { - if (t.version) { - let e = { - v1: 1, - v2: 2, - v3: 3, - v4: 4, - v5: 5, - v6: 6, - v7: 7, - v8: 8 - }[t.version]; - if (e === void 0) throw Error(`Invalid UUID version: "${t.version}"`); - t.pattern ??= L$10(e); - } else t.pattern ??= L$10(); - U$11.init(e, t); -}); -const Zn$4 = i$16(`$ZodEmail`, (e, t) => { - t.pattern ??= kt$8, U$11.init(e, t); -}); -const Qn$4 = i$16(`$ZodURL`, (e, t) => { - U$11.init(e, t), e._zod.check = (n) => { - try { - let r = n.value.trim(); - if (!t.normalize && t.protocol?.source === Gt$6.source && !/^https?:\/\//i.test(r)) { - n.issues.push({ - code: `invalid_format`, - format: `url`, - note: `Invalid URL format`, - input: n.value, - inst: e, - continue: !t.abort - }); - return; - } - let i = new URL(r); - t.hostname && (t.hostname.lastIndex = 0, t.hostname.test(i.hostname) || n.issues.push({ - code: `invalid_format`, - format: `url`, - note: `Invalid hostname`, - pattern: t.hostname.source, - input: n.value, - inst: e, - continue: !t.abort - })), t.protocol && (t.protocol.lastIndex = 0, t.protocol.test(i.protocol.endsWith(`:`) ? i.protocol.slice(0, -1) : i.protocol) || n.issues.push({ - code: `invalid_format`, - format: `url`, - note: `Invalid protocol`, - pattern: t.protocol.source, - input: n.value, - inst: e, - continue: !t.abort - })), t.normalize ? n.value = i.href : n.value = r; - return; - } catch { - n.issues.push({ - code: `invalid_format`, - format: `url`, - input: n.value, - inst: e, - continue: !t.abort - }); - } - }; -}); -const $n$4 = i$16(`$ZodEmoji`, (e, t) => { - t.pattern ??= Ft$7(), U$11.init(e, t); -}); -const er$4 = i$16(`$ZodNanoID`, (e, t) => { - t.pattern ??= St$8, U$11.init(e, t); -}); -const tr$4 = i$16(`$ZodCUID`, (e, t) => { - t.pattern ??= _t$8, U$11.init(e, t); -}); -const nr$4 = i$16(`$ZodCUID2`, (e, t) => { - t.pattern ??= vt$8, U$11.init(e, t); -}); -const rr$4 = i$16(`$ZodULID`, (e, t) => { - t.pattern ??= yt$8, U$11.init(e, t); -}); -const ir$4 = i$16(`$ZodXID`, (e, t) => { - t.pattern ??= bt$8, U$11.init(e, t); -}); -const ar$4 = i$16(`$ZodKSUID`, (e, t) => { - t.pattern ??= xt$8, U$11.init(e, t); -}); -const or$4 = i$16(`$ZodISODateTime`, (e, t) => { - t.pattern ??= Zt$6(t), U$11.init(e, t); -}); -const sr$4 = i$16(`$ZodISODate`, (e, t) => { - t.pattern ??= Jt$7, U$11.init(e, t); -}); -const cr$4 = i$16(`$ZodISOTime`, (e, t) => { - t.pattern ??= Xt$7(t), U$11.init(e, t); -}); -const lr$5 = i$16(`$ZodISODuration`, (e, t) => { - t.pattern ??= Ct$8, U$11.init(e, t); -}); -const ur$5 = i$16(`$ZodIPv4`, (e, t) => { - t.pattern ??= It$7, U$11.init(e, t), e._zod.bag.format = `ipv4`; -}); -const dr$5 = i$16(`$ZodIPv6`, (e, t) => { - t.pattern ??= Lt$8, U$11.init(e, t), e._zod.bag.format = `ipv6`, e._zod.check = (n) => { - try { - new URL(`http://[${n.value}]`); - } catch { - n.issues.push({ - code: `invalid_format`, - format: `ipv6`, - input: n.value, - inst: e, - continue: !t.abort - }); - } - }; -}); -const fr$4 = i$16(`$ZodMAC`, (e, t) => { - t.pattern ??= Rt$7(t.delimiter), U$11.init(e, t), e._zod.bag.format = `mac`; -}); -const pr$5 = i$16(`$ZodCIDRv4`, (e, t) => { - t.pattern ??= zt$8, U$11.init(e, t); -}); -const mr$4 = i$16(`$ZodCIDRv6`, (e, t) => { - t.pattern ??= Bt$6, U$11.init(e, t), e._zod.check = (n) => { - let r = n.value.split(`/`); - try { - if (r.length !== 2) throw Error(); - let [e, t] = r; - if (!t) throw Error(); - let n = Number(t); - if (`${n}` !== t || n < 0 || n > 128) throw Error(); - new URL(`http://[${e}]`); - } catch { - n.issues.push({ - code: `invalid_format`, - format: `cidrv6`, - input: n.value, - inst: e, - continue: !t.abort - }); - } - }; -}); -function hr$4(e) { - if (e === ``) return !0; - if (/\s/.test(e) || e.length % 4 != 0) return !1; - try { - return atob(e), !0; - } catch { - return !1; - } -} -const gr$4 = i$16(`$ZodBase64`, (e, t) => { - t.pattern ??= Vt$7, U$11.init(e, t), e._zod.bag.contentEncoding = `base64`, e._zod.check = (n) => { - hr$4(n.value) || n.issues.push({ - code: `invalid_format`, - format: `base64`, - input: n.value, - inst: e, - continue: !t.abort - }); - }; -}); -function _r$5(e) { - if (!Ht$7.test(e)) return !1; - let t = e.replace(/[-_]/g, (e) => e === `-` ? `+` : `/`); - return hr$4(t.padEnd(Math.ceil(t.length / 4) * 4, `=`)); -} -const vr$5 = i$16(`$ZodBase64URL`, (e, t) => { - t.pattern ??= Ht$7, U$11.init(e, t), e._zod.bag.contentEncoding = `base64url`, e._zod.check = (n) => { - _r$5(n.value) || n.issues.push({ - code: `invalid_format`, - format: `base64url`, - input: n.value, - inst: e, - continue: !t.abort - }); - }; -}); -const yr$5 = i$16(`$ZodE164`, (e, t) => { - t.pattern ??= Kt$7, U$11.init(e, t); -}); -function br$5(e, t = null) { - try { - let n = e.split(`.`); - if (n.length !== 3) return !1; - let [r] = n; - if (!r) return !1; - let i = JSON.parse(atob(r)); - return !(`typ` in i && i?.typ !== `JWT` || !i.alg || t && (!(`alg` in i) || i.alg !== t)); - } catch { - return !1; - } -} -const xr$5 = i$16(`$ZodJWT`, (e, t) => { - U$11.init(e, t), e._zod.check = (n) => { - br$5(n.value, t.alg) || n.issues.push({ - code: `invalid_format`, - format: `jwt`, - input: n.value, - inst: e, - continue: !t.abort - }); - }; -}); -const Sr$5 = i$16(`$ZodCustomStringFormat`, (e, t) => { - U$11.init(e, t), e._zod.check = (n) => { - t.fn(n.value) || n.issues.push({ - code: `invalid_format`, - format: t.format, - input: n.value, - inst: e, - continue: !t.abort - }); - }; -}); -const Cr$5 = i$16(`$ZodNumber`, (e, t) => { - H$11.init(e, t), e._zod.pattern = e._zod.bag.pattern ?? tn$7, e._zod.parse = (n, r) => { - if (t.coerce) try { - n.value = Number(n.value); - } catch {} - let i = n.value; - if (typeof i == `number` && !Number.isNaN(i) && Number.isFinite(i)) return n; - let a = typeof i == `number` ? Number.isNaN(i) ? `NaN` : Number.isFinite(i) ? void 0 : `Infinity` : void 0; - return n.issues.push({ - expected: `number`, - code: `invalid_type`, - input: i, - inst: e, - ...a ? { received: a } : {} - }), n; - }; -}); -const wr$5 = i$16(`$ZodNumberFormat`, (e, t) => { - On$6.init(e, t), Cr$5.init(e, t); -}); -const Tr$5 = i$16(`$ZodBoolean`, (e, t) => { - H$11.init(e, t), e._zod.pattern = nn$6, e._zod.parse = (n, r) => { - if (t.coerce) try { - n.value = !!n.value; - } catch {} - let i = n.value; - return typeof i == `boolean` || n.issues.push({ - expected: `boolean`, - code: `invalid_type`, - input: i, - inst: e - }), n; - }; -}); -const Er$5 = i$16(`$ZodBigInt`, (e, t) => { - H$11.init(e, t), e._zod.pattern = $t$7, e._zod.parse = (n, r) => { - if (t.coerce) try { - n.value = BigInt(n.value); - } catch {} - return typeof n.value == `bigint` || n.issues.push({ - expected: `bigint`, - code: `invalid_type`, - input: n.value, - inst: e - }), n; - }; -}); -const Dr$5 = i$16(`$ZodBigIntFormat`, (e, t) => { - kn$6.init(e, t), Er$5.init(e, t); -}); -const Or$5 = i$16(`$ZodSymbol`, (e, t) => { - H$11.init(e, t), e._zod.parse = (t, n) => { - let r = t.value; - return typeof r == `symbol` || t.issues.push({ - expected: `symbol`, - code: `invalid_type`, - input: r, - inst: e - }), t; - }; -}); -const kr$5 = i$16(`$ZodUndefined`, (e, t) => { - H$11.init(e, t), e._zod.pattern = an$6, e._zod.values = /* @__PURE__ */ new Set([void 0]), e._zod.parse = (t, n) => { - let r = t.value; - return r === void 0 || t.issues.push({ - expected: `undefined`, - code: `invalid_type`, - input: r, - inst: e - }), t; - }; -}); -const Ar$5 = i$16(`$ZodNull`, (e, t) => { - H$11.init(e, t), e._zod.pattern = rn$7, e._zod.values = /* @__PURE__ */ new Set([null]), e._zod.parse = (t, n) => { - let r = t.value; - return r === null || t.issues.push({ - expected: `null`, - code: `invalid_type`, - input: r, - inst: e - }), t; - }; -}); -const jr$5 = i$16(`$ZodAny`, (e, t) => { - H$11.init(e, t), e._zod.parse = (e) => e; -}); -const Mr$5 = i$16(`$ZodUnknown`, (e, t) => { - H$11.init(e, t), e._zod.parse = (e) => e; -}); -const Nr$5 = i$16(`$ZodNever`, (e, t) => { - H$11.init(e, t), e._zod.parse = (t, n) => (t.issues.push({ - expected: `never`, - code: `invalid_type`, - input: t.value, - inst: e - }), t); -}); -const Pr$5 = i$16(`$ZodVoid`, (e, t) => { - H$11.init(e, t), e._zod.parse = (t, n) => { - let r = t.value; - return r === void 0 || t.issues.push({ - expected: `void`, - code: `invalid_type`, - input: r, - inst: e - }), t; - }; -}); -const Fr$5 = i$16(`$ZodDate`, (e, t) => { - H$11.init(e, t), e._zod.parse = (n, r) => { - if (t.coerce) try { - n.value = new Date(n.value); - } catch {} - let i = n.value, a = i instanceof Date; - return a && !Number.isNaN(i.getTime()) || n.issues.push({ - expected: `date`, - code: `invalid_type`, - input: i, - ...a ? { received: `Invalid Date` } : {}, - inst: e - }), n; - }; -}); -function Ir$5(e, t, n) { - e.issues.length && t.issues.push(...D$13(n, e.issues)), t.value[n] = e.value; -} -const Lr$5 = i$16(`$ZodArray`, (e, t) => { - H$11.init(e, t), e._zod.parse = (n, r) => { - let i = n.value; - if (!Array.isArray(i)) return n.issues.push({ - expected: `array`, - code: `invalid_type`, - input: i, - inst: e - }), n; - n.value = Array(i.length); - let a = []; - for (let e = 0; e < i.length; e++) { - let o = i[e], s = t.element._zod.run({ - value: o, - issues: [] - }, r); - s instanceof Promise ? a.push(s.then((t) => Ir$5(t, n, e))) : Ir$5(s, n, e); - } - return a.length ? Promise.all(a).then(() => n) : n; - }; -}); -function Rr$5(e, t, n, r, i, a) { - let o = n in r; - if (e.issues.length) { - if (i && a && !o) return; - t.issues.push(...D$13(n, e.issues)); - } - if (!o && !i) { - e.issues.length || t.issues.push({ - code: `invalid_type`, - expected: `nonoptional`, - input: void 0, - path: [n] - }); - return; - } - e.value === void 0 ? o && (t.value[n] = void 0) : t.value[n] = e.value; -} -function zr$5(e) { - let t = Object.keys(e.shape); - for (let n of t) if (!e.shape?.[n]?._zod?.traits?.has(`$ZodType`)) throw Error(`Invalid element at key "${n}": expected a Zod schema`); - let n = Se$9(e.shape); - return { - ...e, - keys: t, - keySet: new Set(t), - numKeys: t.length, - optionalKeys: new Set(n) - }; -} -function Br$5(e, t, n, r, i, a) { - let o = [], s = i.keySet, c = i.catchall._zod, l = c.def.type, u = c.optin === `optional`, d = c.optout === `optional`; - for (let i in t) { - if (i === `__proto__` || s.has(i)) continue; - if (l === `never`) { - o.push(i); - continue; - } - let a = c.run({ - value: t[i], - issues: [] - }, r); - a instanceof Promise ? e.push(a.then((e) => Rr$5(e, n, i, t, u, d))) : Rr$5(a, n, i, t, u, d); - } - return o.length && n.issues.push({ - code: `unrecognized_keys`, - keys: o, - input: t, - inst: a - }), e.length ? Promise.all(e).then(() => n) : n; -} -const Vr$5 = i$16(`$ZodObject`, (e, t) => { - if (H$11.init(e, t), !Object.getOwnPropertyDescriptor(t, `shape`)?.get) { - let e = t.shape; - Object.defineProperty(t, "shape", { get: () => { - let n = { ...e }; - return Object.defineProperty(t, "shape", { value: n }), n; - } }); - } - let n = h$12(() => zr$5(t)); - _$10(e._zod, `propValues`, () => { - let e = t.shape, n = {}; - for (let t in e) { - let r = e[t]._zod; - if (r.values) { - n[t] ?? (n[t] = /* @__PURE__ */ new Set()); - for (let e of r.values) n[t].add(e); - } - } - return n; - }); - let r = b$11, i = t.catchall, a; - e._zod.parse = (t, o) => { - a ??= n.value; - let s = t.value; - if (!r(s)) return t.issues.push({ - expected: `object`, - code: `invalid_type`, - input: s, - inst: e - }), t; - t.value = {}; - let c = [], l = a.shape; - for (let e of a.keys) { - let n = l[e], r = n._zod.optin === `optional`, i = n._zod.optout === `optional`, a = n._zod.run({ - value: s[e], - issues: [] - }, o); - a instanceof Promise ? c.push(a.then((n) => Rr$5(n, t, e, s, r, i))) : Rr$5(a, t, e, s, r, i); - } - return i ? Br$5(c, s, t, o, n.value, e) : c.length ? Promise.all(c).then(() => t) : t; - }; -}); -const Hr$5 = i$16(`$ZodObjectJIT`, (e, t) => { - Vr$5.init(e, t); - let n = e._zod.parse, r = h$12(() => zr$5(t)), i = (e) => { - let t = new Kn$4([ - `shape`, - `payload`, - `ctx` - ]), n = r.value, i = (e) => { - let t = fe$10(e); - return `shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`; - }; - t.write(`const input = payload.value;`); - let a = Object.create(null), o = 0; - for (let e of n.keys) a[e] = `key_${o++}`; - t.write(`const newResult = {};`); - for (let r of n.keys) { - let n = a[r], o = fe$10(r), s = e[r], c = s?._zod?.optin === `optional`, l = s?._zod?.optout === `optional`; - t.write(`const ${n} = ${i(r)};`), c && l ? t.write(` - if (${n}.issues.length) { - if (${o} in input) { - payload.issues = payload.issues.concat(${n}.issues.map(iss => ({ - ...iss, - path: iss.path ? [${o}, ...iss.path] : [${o}] - }))); - } - } - - if (${n}.value === undefined) { - if (${o} in input) { - newResult[${o}] = undefined; - } - } else { - newResult[${o}] = ${n}.value; - } - - `) : c ? t.write(` - if (${n}.issues.length) { - payload.issues = payload.issues.concat(${n}.issues.map(iss => ({ - ...iss, - path: iss.path ? [${o}, ...iss.path] : [${o}] - }))); - } - - if (${n}.value === undefined) { - if (${o} in input) { - newResult[${o}] = undefined; - } - } else { - newResult[${o}] = ${n}.value; - } - - `) : t.write(` - const ${n}_present = ${o} in input; - if (${n}.issues.length) { - payload.issues = payload.issues.concat(${n}.issues.map(iss => ({ - ...iss, - path: iss.path ? [${o}, ...iss.path] : [${o}] - }))); - } - if (!${n}_present && !${n}.issues.length) { - payload.issues.push({ - code: "invalid_type", - expected: "nonoptional", - input: undefined, - path: [${o}] - }); - } - - if (${n}_present) { - if (${n}.value === undefined) { - newResult[${o}] = undefined; - } else { - newResult[${o}] = ${n}.value; - } - } - - `); - } - t.write(`payload.value = newResult;`), t.write(`return payload;`); - let s = t.compile(); - return (t, n) => s(e, t, n); - }, a, o = b$11, s = !c$13.jitless, l = s && he$9.value, u = t.catchall, d; - e._zod.parse = (c, f) => { - d ??= r.value; - let p = c.value; - return o(p) ? s && l && f?.async === !1 && f.jitless !== !0 ? (a ||= i(t.shape), c = a(c, f), u ? Br$5([], p, c, f, d, e) : c) : n(c, f) : (c.issues.push({ - expected: `object`, - code: `invalid_type`, - input: p, - inst: e - }), c); - }; -}); -function Ur$5(e, t, n, r) { - for (let n of e) if (n.issues.length === 0) return t.value = n.value, t; - let i = e.filter((e) => !E$14(e)); - return i.length === 1 ? (t.value = i[0].value, i[0]) : (t.issues.push({ - code: `invalid_union`, - input: t.value, - inst: n, - errors: e.map((e) => e.issues.map((e) => k$13(e, r, l$12()))) - }), t); -} -const Wr$5 = i$16(`$ZodUnion`, (e, t) => { - H$11.init(e, t), _$10(e._zod, `optin`, () => t.options.some((e) => e._zod.optin === `optional`) ? `optional` : void 0), _$10(e._zod, `optout`, () => t.options.some((e) => e._zod.optout === `optional`) ? `optional` : void 0), _$10(e._zod, `values`, () => { - if (t.options.every((e) => e._zod.values)) return new Set(t.options.flatMap((e) => Array.from(e._zod.values))); - }), _$10(e._zod, `pattern`, () => { - if (t.options.every((e) => e._zod.pattern)) { - let e = t.options.map((e) => e._zod.pattern); - return RegExp(`^(${e.map((e) => ie$8(e.source)).join(`|`)})$`); - } - }); - let n = t.options.length === 1 ? t.options[0]._zod.run : null; - e._zod.parse = (r, i) => { - if (n) return n(r, i); - let a = !1, o = []; - for (let e of t.options) { - let t = e._zod.run({ - value: r.value, - issues: [] - }, i); - if (t instanceof Promise) o.push(t), a = !0; - else { - if (t.issues.length === 0) return t; - o.push(t); - } - } - return a ? Promise.all(o).then((t) => Ur$5(t, r, e, i)) : Ur$5(o, r, e, i); - }; -}); -function Gr$5(e, t, n, r) { - let i = e.filter((e) => e.issues.length === 0); - return i.length === 1 ? (t.value = i[0].value, t) : (i.length === 0 ? t.issues.push({ - code: `invalid_union`, - input: t.value, - inst: n, - errors: e.map((e) => e.issues.map((e) => k$13(e, r, l$12()))) - }) : t.issues.push({ - code: `invalid_union`, - input: t.value, - inst: n, - errors: [], - inclusive: !1 - }), t); -} -const Kr$5 = i$16(`$ZodXor`, (e, t) => { - Wr$5.init(e, t), t.inclusive = !1; - let n = t.options.length === 1 ? t.options[0]._zod.run : null; - e._zod.parse = (r, i) => { - if (n) return n(r, i); - let a = !1, o = []; - for (let e of t.options) { - let t = e._zod.run({ - value: r.value, - issues: [] - }, i); - t instanceof Promise ? (o.push(t), a = !0) : o.push(t); - } - return a ? Promise.all(o).then((t) => Gr$5(t, r, e, i)) : Gr$5(o, r, e, i); - }; -}); -const qr$5 = i$16(`$ZodDiscriminatedUnion`, (e, t) => { - t.inclusive = !1, Wr$5.init(e, t); - let n = e._zod.parse; - _$10(e._zod, `propValues`, () => { - let e = {}; - for (let n of t.options) { - let r = n._zod.propValues; - if (!r || Object.keys(r).length === 0) throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`); - for (let [t, n] of Object.entries(r)) { - e[t] || (e[t] = /* @__PURE__ */ new Set()); - for (let r of n) e[t].add(r); - } - } - return e; - }); - let r = h$12(() => { - let e = t.options, n = /* @__PURE__ */ new Map(); - for (let r of e) { - let e = r._zod.propValues?.[t.discriminator]; - if (!e || e.size === 0) throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`); - for (let t of e) { - if (n.has(t)) throw Error(`Duplicate discriminator value "${String(t)}"`); - n.set(t, r); - } - } - return n; - }); - e._zod.parse = (i, a) => { - let o = i.value; - if (!b$11(o)) return i.issues.push({ - code: `invalid_type`, - expected: `object`, - input: o, - inst: e - }), i; - let s = r.value.get(o?.[t.discriminator]); - return s ? s._zod.run(i, a) : t.unionFallback || a.direction === `backward` ? n(i, a) : (i.issues.push({ - code: `invalid_union`, - errors: [], - note: `No matching discriminator`, - discriminator: t.discriminator, - options: Array.from(r.value.keys()), - input: o, - path: [t.discriminator], - inst: e - }), i); - }; -}); -const Jr$5 = i$16(`$ZodIntersection`, (e, t) => { - H$11.init(e, t), e._zod.parse = (e, n) => { - let r = e.value, i = t.left._zod.run({ - value: r, - issues: [] - }, n), a = t.right._zod.run({ - value: r, - issues: [] - }, n); - return i instanceof Promise || a instanceof Promise ? Promise.all([i, a]).then(([t, n]) => Xr$5(e, t, n)) : Xr$5(e, i, a); - }; -}); -function Yr$5(e, t) { - if (e === t || e instanceof Date && t instanceof Date && +e == +t) return { - valid: !0, - data: e - }; - if (x$12(e) && x$12(t)) { - let n = Object.keys(t), r = Object.keys(e).filter((e) => n.indexOf(e) !== -1), i = { - ...e, - ...t - }; - for (let n of r) { - let r = Yr$5(e[n], t[n]); - if (!r.valid) return { - valid: !1, - mergeErrorPath: [n, ...r.mergeErrorPath] - }; - i[n] = r.data; - } - return { - valid: !0, - data: i - }; - } - if (Array.isArray(e) && Array.isArray(t)) { - if (e.length !== t.length) return { - valid: !1, - mergeErrorPath: [] - }; - let n = []; - for (let r = 0; r < e.length; r++) { - let i = e[r], a = t[r], o = Yr$5(i, a); - if (!o.valid) return { - valid: !1, - mergeErrorPath: [r, ...o.mergeErrorPath] - }; - n.push(o.data); - } - return { - valid: !0, - data: n - }; - } - return { - valid: !1, - mergeErrorPath: [] - }; -} -function Xr$5(e, t, n) { - let r = /* @__PURE__ */ new Map(), i; - for (let n of t.issues) if (n.code === `unrecognized_keys`) { - i ??= n; - for (let e of n.keys) r.has(e) || r.set(e, {}), r.get(e).l = !0; - } else e.issues.push(n); - for (let t of n.issues) if (t.code === `unrecognized_keys`) for (let e of t.keys) r.has(e) || r.set(e, {}), r.get(e).r = !0; - else e.issues.push(t); - let a = [...r].filter(([, e]) => e.l && e.r).map(([e]) => e); - if (a.length && i && e.issues.push({ - ...i, - keys: a - }), E$14(e)) return e; - let o = Yr$5(t.value, n.value); - if (!o.valid) throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`); - return e.value = o.data, e; -} -const Zr$5 = i$16(`$ZodTuple`, (e, t) => { - H$11.init(e, t); - let n = t.items; - e._zod.parse = (r, i) => { - let a = r.value; - if (!Array.isArray(a)) return r.issues.push({ - input: a, - inst: e, - expected: `tuple`, - code: `invalid_type` - }), r; - r.value = []; - let o = [], s = Qr$5(n, `optin`), c = Qr$5(n, `optout`); - if (!t.rest) { - if (a.length < s) return r.issues.push({ - code: `too_small`, - minimum: s, - inclusive: !0, - input: a, - inst: e, - origin: `array` - }), r; - a.length > n.length && r.issues.push({ - code: `too_big`, - maximum: n.length, - inclusive: !0, - input: a, - inst: e, - origin: `array` - }); - } - let l = Array(n.length); - for (let e = 0; e < n.length; e++) { - let t = n[e]._zod.run({ - value: a[e], - issues: [] - }, i); - t instanceof Promise ? o.push(t.then((t) => { - l[e] = t; - })) : l[e] = t; - } - if (t.rest) { - let e = n.length - 1, s = a.slice(n.length); - for (let n of s) { - e++; - let a = t.rest._zod.run({ - value: n, - issues: [] - }, i); - a instanceof Promise ? o.push(a.then((t) => $r$5(t, r, e))) : $r$5(a, r, e); - } - } - return o.length ? Promise.all(o).then(() => ei$5(l, r, n, a, c)) : ei$5(l, r, n, a, c); - }; -}); -function Qr$5(e, t) { - for (let n = e.length - 1; n >= 0; n--) if (e[n]._zod[t] !== `optional`) return n + 1; - return 0; -} -function $r$5(e, t, n) { - e.issues.length && t.issues.push(...D$13(n, e.issues)), t.value[n] = e.value; -} -function ei$5(e, t, n, r, i) { - for (let a = 0; a < n.length; a++) { - let n = e[a], o = a < r.length; - if (n.issues.length) { - if (!o && a >= i) { - t.value.length = a; - break; - } - t.issues.push(...D$13(a, n.issues)); - } - t.value[a] = n.value; - } - for (let e = t.value.length - 1; e >= r.length && n[e]._zod.optout === `optional` && t.value[e] === void 0; e--) t.value.length = e; - return t; -} -const ti$5 = i$16(`$ZodRecord`, (e, t) => { - H$11.init(e, t), e._zod.parse = (n, r) => { - let i = n.value; - if (!x$12(i)) return n.issues.push({ - expected: `record`, - code: `invalid_type`, - input: i, - inst: e - }), n; - let a = [], o = t.keyType._zod.values; - if (o) { - n.value = {}; - let s = /* @__PURE__ */ new Set(); - for (let c of o) if (typeof c == `string` || typeof c == `number` || typeof c == `symbol`) { - s.add(typeof c == `number` ? c.toString() : c); - let o = t.keyType._zod.run({ - value: c, - issues: [] - }, r); - if (o instanceof Promise) throw Error(`Async schemas not supported in object keys currently`); - if (o.issues.length) { - n.issues.push({ - code: `invalid_key`, - origin: `record`, - issues: o.issues.map((e) => k$13(e, r, l$12())), - input: c, - path: [c], - inst: e - }); - continue; - } - let u = o.value, d = t.valueType._zod.run({ - value: i[c], - issues: [] - }, r); - d instanceof Promise ? a.push(d.then((e) => { - e.issues.length && n.issues.push(...D$13(c, e.issues)), n.value[u] = e.value; - })) : (d.issues.length && n.issues.push(...D$13(c, d.issues)), n.value[u] = d.value); - } - let c; - for (let e in i) s.has(e) || (c ??= [], c.push(e)); - c && c.length > 0 && n.issues.push({ - code: `unrecognized_keys`, - input: i, - inst: e, - keys: c - }); - } else { - n.value = {}; - for (let o of Reflect.ownKeys(i)) { - if (o === `__proto__` || !Object.prototype.propertyIsEnumerable.call(i, o)) continue; - let s = t.keyType._zod.run({ - value: o, - issues: [] - }, r); - if (s instanceof Promise) throw Error(`Async schemas not supported in object keys currently`); - if (typeof o == `string` && tn$7.test(o) && s.issues.length) { - let e = t.keyType._zod.run({ - value: Number(o), - issues: [] - }, r); - if (e instanceof Promise) throw Error(`Async schemas not supported in object keys currently`); - e.issues.length === 0 && (s = e); - } - if (s.issues.length) { - t.mode === `loose` ? n.value[o] = i[o] : n.issues.push({ - code: `invalid_key`, - origin: `record`, - issues: s.issues.map((e) => k$13(e, r, l$12())), - input: o, - path: [o], - inst: e - }); - continue; - } - let c = t.valueType._zod.run({ - value: i[o], - issues: [] - }, r); - c instanceof Promise ? a.push(c.then((e) => { - e.issues.length && n.issues.push(...D$13(o, e.issues)), n.value[s.value] = e.value; - })) : (c.issues.length && n.issues.push(...D$13(o, c.issues)), n.value[s.value] = c.value); - } - } - return a.length ? Promise.all(a).then(() => n) : n; - }; -}); -const ni$5 = i$16(`$ZodMap`, (e, t) => { - H$11.init(e, t), e._zod.parse = (n, r) => { - let i = n.value; - if (!(i instanceof Map)) return n.issues.push({ - expected: `map`, - code: `invalid_type`, - input: i, - inst: e - }), n; - let a = []; - n.value = /* @__PURE__ */ new Map(); - for (let [o, s] of i) { - let c = t.keyType._zod.run({ - value: o, - issues: [] - }, r), l = t.valueType._zod.run({ - value: s, - issues: [] - }, r); - c instanceof Promise || l instanceof Promise ? a.push(Promise.all([c, l]).then(([t, a]) => { - ri$5(t, a, n, o, i, e, r); - })) : ri$5(c, l, n, o, i, e, r); - } - return a.length ? Promise.all(a).then(() => n) : n; - }; -}); -function ri$5(e, t, n, r, i, a, o) { - e.issues.length && (ye$9.has(typeof r) ? n.issues.push(...D$13(r, e.issues)) : n.issues.push({ - code: `invalid_key`, - origin: `map`, - input: i, - inst: a, - issues: e.issues.map((e) => k$13(e, o, l$12())) - })), t.issues.length && (ye$9.has(typeof r) ? n.issues.push(...D$13(r, t.issues)) : n.issues.push({ - origin: `map`, - code: `invalid_element`, - input: i, - inst: a, - key: r, - issues: t.issues.map((e) => k$13(e, o, l$12())) - })), n.value.set(e.value, t.value); -} -const ii$5 = i$16(`$ZodSet`, (e, t) => { - H$11.init(e, t), e._zod.parse = (n, r) => { - let i = n.value; - if (!(i instanceof Set)) return n.issues.push({ - input: i, - inst: e, - expected: `set`, - code: `invalid_type` - }), n; - let a = []; - n.value = /* @__PURE__ */ new Set(); - for (let e of i) { - let i = t.valueType._zod.run({ - value: e, - issues: [] - }, r); - i instanceof Promise ? a.push(i.then((e) => ai$5(e, n))) : ai$5(i, n); - } - return a.length ? Promise.all(a).then(() => n) : n; - }; -}); -function ai$5(e, t) { - e.issues.length && t.issues.push(...e.issues), t.value.add(e.value); -} -const oi$5 = i$16(`$ZodEnum`, (e, t) => { - H$11.init(e, t); - let n = ne$7(t.entries), r = new Set(n); - e._zod.values = r, e._zod.pattern = RegExp(`^(${n.filter((e) => ye$9.has(typeof e)).map((e) => typeof e == `string` ? S$13(e) : e.toString()).join(`|`)})$`), e._zod.parse = (t, i) => { - let a = t.value; - return r.has(a) || t.issues.push({ - code: `invalid_value`, - values: n, - input: a, - inst: e - }), t; - }; -}); -const si$5 = i$16(`$ZodLiteral`, (e, t) => { - if (H$11.init(e, t), t.values.length === 0) throw Error(`Cannot create literal schema with no valid values`); - let n = new Set(t.values); - e._zod.values = n, e._zod.pattern = RegExp(`^(${t.values.map((e) => typeof e == `string` ? S$13(e) : e ? S$13(e.toString()) : String(e)).join(`|`)})$`), e._zod.parse = (r, i) => { - let a = r.value; - return n.has(a) || r.issues.push({ - code: `invalid_value`, - values: t.values, - input: a, - inst: e - }), r; - }; -}); -const ci$5 = i$16(`$ZodFile`, (e, t) => { - H$11.init(e, t), e._zod.parse = (t, n) => { - let r = t.value; - return r instanceof File || t.issues.push({ - expected: `file`, - code: `invalid_type`, - input: r, - inst: e - }), t; - }; -}); -const li$5 = i$16(`$ZodTransform`, (e, t) => { - H$11.init(e, t), e._zod.optin = `optional`, e._zod.parse = (n, r) => { - if (r.direction === `backward`) throw new s$11(e.constructor.name); - let i = t.transform(n.value, n); - if (r.async) return (i instanceof Promise ? i : Promise.resolve(i)).then((e) => (n.value = e, n.fallback = !0, n)); - if (i instanceof Promise) throw new o$13(); - return n.value = i, n.fallback = !0, n; - }; -}); -function ui$5(e, t) { - return t === void 0 && (e.issues.length || e.fallback) ? { - issues: [], - value: void 0 - } : e; -} -const di$5 = i$16(`$ZodOptional`, (e, t) => { - H$11.init(e, t), e._zod.optin = `optional`, e._zod.optout = `optional`, _$10(e._zod, `values`, () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, void 0]) : void 0), _$10(e._zod, `pattern`, () => { - let e = t.innerType._zod.pattern; - return e ? RegExp(`^(${ie$8(e.source)})?$`) : void 0; - }), e._zod.parse = (e, n) => { - if (t.innerType._zod.optin === `optional`) { - let r = e.value, i = t.innerType._zod.run(e, n); - return i instanceof Promise ? i.then((e) => ui$5(e, r)) : ui$5(i, r); - } - return e.value === void 0 ? e : t.innerType._zod.run(e, n); - }; -}); -const fi$5 = i$16(`$ZodExactOptional`, (e, t) => { - di$5.init(e, t), _$10(e._zod, `values`, () => t.innerType._zod.values), _$10(e._zod, `pattern`, () => t.innerType._zod.pattern), e._zod.parse = (e, n) => t.innerType._zod.run(e, n); -}); -const pi$5 = i$16(`$ZodNullable`, (e, t) => { - H$11.init(e, t), _$10(e._zod, `optin`, () => t.innerType._zod.optin), _$10(e._zod, `optout`, () => t.innerType._zod.optout), _$10(e._zod, `pattern`, () => { - let e = t.innerType._zod.pattern; - return e ? RegExp(`^(${ie$8(e.source)}|null)$`) : void 0; - }), _$10(e._zod, `values`, () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, null]) : void 0), e._zod.parse = (e, n) => e.value === null ? e : t.innerType._zod.run(e, n); -}); -const mi$5 = i$16(`$ZodDefault`, (e, t) => { - H$11.init(e, t), e._zod.optin = `optional`, _$10(e._zod, `values`, () => t.innerType._zod.values), e._zod.parse = (e, n) => { - if (n.direction === `backward`) return t.innerType._zod.run(e, n); - if (e.value === void 0) return e.value = t.defaultValue, e; - let r = t.innerType._zod.run(e, n); - return r instanceof Promise ? r.then((e) => hi$5(e, t)) : hi$5(r, t); - }; -}); -function hi$5(e, t) { - return e.value === void 0 && (e.value = t.defaultValue), e; -} -const gi$5 = i$16(`$ZodPrefault`, (e, t) => { - H$11.init(e, t), e._zod.optin = `optional`, _$10(e._zod, `values`, () => t.innerType._zod.values), e._zod.parse = (e, n) => (n.direction === `backward` || e.value === void 0 && (e.value = t.defaultValue), t.innerType._zod.run(e, n)); -}); -const _i$5 = i$16(`$ZodNonOptional`, (e, t) => { - H$11.init(e, t), _$10(e._zod, `values`, () => { - let e = t.innerType._zod.values; - return e ? new Set([...e].filter((e) => e !== void 0)) : void 0; - }), e._zod.parse = (n, r) => { - let i = t.innerType._zod.run(n, r); - return i instanceof Promise ? i.then((t) => vi$5(t, e)) : vi$5(i, e); - }; -}); -function vi$5(e, t) { - return !e.issues.length && e.value === void 0 && e.issues.push({ - code: `invalid_type`, - expected: `nonoptional`, - input: e.value, - inst: t - }), e; -} -const yi$5 = i$16(`$ZodSuccess`, (e, t) => { - H$11.init(e, t), e._zod.parse = (e, n) => { - if (n.direction === `backward`) throw new s$11(`ZodSuccess`); - let r = t.innerType._zod.run(e, n); - return r instanceof Promise ? r.then((t) => (e.value = t.issues.length === 0, e)) : (e.value = r.issues.length === 0, e); - }; -}); -const bi$5 = i$16(`$ZodCatch`, (e, t) => { - H$11.init(e, t), e._zod.optin = `optional`, _$10(e._zod, `optout`, () => t.innerType._zod.optout), _$10(e._zod, `values`, () => t.innerType._zod.values), e._zod.parse = (e, n) => { - if (n.direction === `backward`) return t.innerType._zod.run(e, n); - let r = t.innerType._zod.run(e, n); - return r instanceof Promise ? r.then((r) => (e.value = r.value, r.issues.length && (e.value = t.catchValue({ - ...e, - error: { issues: r.issues.map((e) => k$13(e, n, l$12())) }, - input: e.value - }), e.issues = [], e.fallback = !0), e)) : (e.value = r.value, r.issues.length && (e.value = t.catchValue({ - ...e, - error: { issues: r.issues.map((e) => k$13(e, n, l$12())) }, - input: e.value - }), e.issues = [], e.fallback = !0), e); - }; -}); -const xi$5 = i$16(`$ZodNaN`, (e, t) => { - H$11.init(e, t), e._zod.parse = (t, n) => ((typeof t.value != `number` || !Number.isNaN(t.value)) && t.issues.push({ - input: t.value, - inst: e, - expected: `nan`, - code: `invalid_type` - }), t); -}); -const Si$6 = i$16(`$ZodPipe`, (e, t) => { - H$11.init(e, t), _$10(e._zod, `values`, () => t.in._zod.values), _$10(e._zod, `optin`, () => t.in._zod.optin), _$10(e._zod, `optout`, () => t.out._zod.optout), _$10(e._zod, `propValues`, () => t.in._zod.propValues), e._zod.parse = (e, n) => { - if (n.direction === `backward`) { - let r = t.out._zod.run(e, n); - return r instanceof Promise ? r.then((e) => Ci$6(e, t.in, n)) : Ci$6(r, t.in, n); - } - let r = t.in._zod.run(e, n); - return r instanceof Promise ? r.then((e) => Ci$6(e, t.out, n)) : Ci$6(r, t.out, n); - }; -}); -function Ci$6(e, t, n) { - return e.issues.length ? (e.aborted = !0, e) : t._zod.run({ - value: e.value, - issues: e.issues, - fallback: e.fallback - }, n); -} -const wi$6 = i$16(`$ZodCodec`, (e, t) => { - H$11.init(e, t), _$10(e._zod, `values`, () => t.in._zod.values), _$10(e._zod, `optin`, () => t.in._zod.optin), _$10(e._zod, `optout`, () => t.out._zod.optout), _$10(e._zod, `propValues`, () => t.in._zod.propValues), e._zod.parse = (e, n) => { - if ((n.direction || `forward`) === `forward`) { - let r = t.in._zod.run(e, n); - return r instanceof Promise ? r.then((e) => Ti$6(e, t, n)) : Ti$6(r, t, n); - } else { - let r = t.out._zod.run(e, n); - return r instanceof Promise ? r.then((e) => Ti$6(e, t, n)) : Ti$6(r, t, n); - } - }; -}); -function Ti$6(e, t, n) { - if (e.issues.length) return e.aborted = !0, e; - if ((n.direction || `forward`) === `forward`) { - let r = t.transform(e.value, e); - return r instanceof Promise ? r.then((r) => Ei$6(e, r, t.out, n)) : Ei$6(e, r, t.out, n); - } else { - let r = t.reverseTransform(e.value, e); - return r instanceof Promise ? r.then((r) => Ei$6(e, r, t.in, n)) : Ei$6(e, r, t.in, n); - } -} -function Ei$6(e, t, n, r) { - return e.issues.length ? (e.aborted = !0, e) : n._zod.run({ - value: t, - issues: e.issues - }, r); -} -const Di$6 = i$16(`$ZodPreprocess`, (e, t) => { - Si$6.init(e, t); -}); -const Oi$6 = i$16(`$ZodReadonly`, (e, t) => { - H$11.init(e, t), _$10(e._zod, `propValues`, () => t.innerType._zod.propValues), _$10(e._zod, `values`, () => t.innerType._zod.values), _$10(e._zod, `optin`, () => t.innerType?._zod?.optin), _$10(e._zod, `optout`, () => t.innerType?._zod?.optout), e._zod.parse = (e, n) => { - if (n.direction === `backward`) return t.innerType._zod.run(e, n); - let r = t.innerType._zod.run(e, n); - return r instanceof Promise ? r.then(ki$6) : ki$6(r); - }; -}); -function ki$6(e) { - return e.value = Object.freeze(e.value), e; -} -const Ai$6 = i$16(`$ZodTemplateLiteral`, (e, t) => { - H$11.init(e, t); - let n = []; - for (let e of t.parts) if (typeof e == `object` && e) { - if (!e._zod.pattern) throw Error(`Invalid template literal part, no pattern found: ${[...e._zod.traits].shift()}`); - let t = e._zod.pattern instanceof RegExp ? e._zod.pattern.source : e._zod.pattern; - if (!t) throw Error(`Invalid template literal part: ${e._zod.traits}`); - let r = +!!t.startsWith(`^`), i = t.endsWith(`$`) ? t.length - 1 : t.length; - n.push(t.slice(r, i)); - } else if (e === null || be$9.has(typeof e)) n.push(S$13(`${e}`)); - else throw Error(`Invalid template literal part: ${e}`); - e._zod.pattern = RegExp(`^${n.join(``)}$`), e._zod.parse = (n, r) => typeof n.value == `string` ? (e._zod.pattern.lastIndex = 0, e._zod.pattern.test(n.value) || n.issues.push({ - input: n.value, - inst: e, - code: `invalid_format`, - format: t.format ?? `template_literal`, - pattern: e._zod.pattern.source - }), n) : (n.issues.push({ - input: n.value, - inst: e, - expected: `string`, - code: `invalid_type` - }), n); -}); -const ji$6 = i$16(`$ZodFunction`, (e, t) => (H$11.init(e, t), e._def = t, e._zod.def = t, e.implement = (t) => { - if (typeof t != `function`) throw Error(`implement() must be called with a function`); - return function(...n) { - let r = e._def.input ? Xe$9(e._def.input, n) : n, i = Reflect.apply(t, this, r); - return e._def.output ? Xe$9(e._def.output, i) : i; - }; -}, e.implementAsync = (t) => { - if (typeof t != `function`) throw Error(`implementAsync() must be called with a function`); - return async function(...n) { - let r = e._def.input ? await Ze$10(e._def.input, n) : n, i = await Reflect.apply(t, this, r); - return e._def.output ? await Ze$10(e._def.output, i) : i; - }; -}, e._zod.parse = (t, n) => typeof t.value == `function` ? (e._def.output && e._def.output._zod.def.type === `promise` ? t.value = e.implementAsync(t.value) : t.value = e.implement(t.value), t) : (t.issues.push({ - code: `invalid_type`, - expected: `function`, - input: t.value, - inst: e -}), t), e.input = (...t) => { - let n = e.constructor; - return Array.isArray(t[0]) ? new n({ - type: `function`, - input: new Zr$5({ - type: `tuple`, - items: t[0], - rest: t[1] - }), - output: e._def.output - }) : new n({ - type: `function`, - input: t[0], - output: e._def.output - }); -}, e.output = (t) => { - let n = e.constructor; - return new n({ - type: `function`, - input: e._def.input, - output: t - }); -}, e)); -const Mi$6 = i$16(`$ZodPromise`, (e, t) => { - H$11.init(e, t), e._zod.parse = (e, n) => Promise.resolve(e.value).then((e) => t.innerType._zod.run({ - value: e, - issues: [] - }, n)); -}); -const Ni$6 = i$16(`$ZodLazy`, (e, t) => { - H$11.init(e, t), _$10(e._zod, `innerType`, () => { - let e = t; - return e._cachedInner ||= t.getter(), e._cachedInner; - }), _$10(e._zod, `pattern`, () => e._zod.innerType?._zod?.pattern), _$10(e._zod, `propValues`, () => e._zod.innerType?._zod?.propValues), _$10(e._zod, `optin`, () => e._zod.innerType?._zod?.optin ?? void 0), _$10(e._zod, `optout`, () => e._zod.innerType?._zod?.optout ?? void 0), e._zod.parse = (t, n) => e._zod.innerType._zod.run(t, n); -}); -const Pi$6 = i$16(`$ZodCustom`, (e, t) => { - B$13.init(e, t), H$11.init(e, t), e._zod.parse = (e, t) => e, e._zod.check = (n) => { - let r = n.value, i = t.fn(r); - if (i instanceof Promise) return i.then((t) => Fi$6(t, n, r, e)); - Fi$6(i, n, r, e); - }; -}); -function Fi$6(e, t, n, r) { - if (!e) { - let e = { - code: `custom`, - input: n, - inst: r, - path: [...r._zod.def.path ?? []], - continue: !r._zod.def.abort - }; - r._zod.def.params && (e.params = r._zod.def.params), t.issues.push(j$12(e)); - } -} -const Ii$6 = () => { - let e = { - string: { - unit: `حرف`, - verb: `أن يحوي` - }, - file: { - unit: `بايت`, - verb: `أن يحوي` - }, - array: { - unit: `عنصر`, - verb: `أن يحوي` - }, - set: { - unit: `عنصر`, - verb: `أن يحوي` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `مدخل`, - email: `بريد إلكتروني`, - url: `رابط`, - emoji: `إيموجي`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `تاريخ ووقت بمعيار ISO`, - date: `تاريخ بمعيار ISO`, - time: `وقت بمعيار ISO`, - duration: `مدة بمعيار ISO`, - ipv4: `عنوان IPv4`, - ipv6: `عنوان IPv6`, - cidrv4: `مدى عناوين بصيغة IPv4`, - cidrv6: `مدى عناوين بصيغة IPv6`, - base64: `نَص بترميز base64-encoded`, - base64url: `نَص بترميز base64url-encoded`, - json_string: `نَص على هيئة JSON`, - e164: `رقم هاتف بمعيار E.164`, - jwt: `JWT`, - template_literal: `مدخل` - }, r = { nan: `NaN` }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = A$12(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `مدخلات غير مقبولة: يفترض إدخال instanceof ${e.expected}، ولكن تم إدخال ${i}` : `مدخلات غير مقبولة: يفترض إدخال ${t}، ولكن تم إدخال ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `مدخلات غير مقبولة: يفترض إدخال ${T$14(e.values[0])}` : `اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${m$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? ` أكبر من اللازم: يفترض أن تكون ${e.origin ?? `القيمة`} ${n} ${e.maximum.toString()} ${r.unit ?? `عنصر`}` : `أكبر من اللازم: يفترض أن تكون ${e.origin ?? `القيمة`} ${n} ${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `أصغر من اللازم: يفترض لـ ${e.origin} أن يكون ${n} ${e.minimum.toString()} ${r.unit}` : `أصغر من اللازم: يفترض لـ ${e.origin} أن يكون ${n} ${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `نَص غير مقبول: يجب أن يبدأ بـ "${e.prefix}"` : t.format === `ends_with` ? `نَص غير مقبول: يجب أن ينتهي بـ "${t.suffix}"` : t.format === `includes` ? `نَص غير مقبول: يجب أن يتضمَّن "${t.includes}"` : t.format === `regex` ? `نَص غير مقبول: يجب أن يطابق النمط ${t.pattern}` : `${n[t.format] ?? e.format} غير مقبول`; - } - case `not_multiple_of`: return `رقم غير مقبول: يجب أن يكون من مضاعفات ${e.divisor}`; - case `unrecognized_keys`: return `معرف${e.keys.length > 1 ? `ات` : ``} غريب${e.keys.length > 1 ? `ة` : ``}: ${m$10(e.keys, `، `)}`; - case `invalid_key`: return `معرف غير مقبول في ${e.origin}`; - case `invalid_union`: return `مدخل غير مقبول`; - case `invalid_element`: return `مدخل غير مقبول في ${e.origin}`; - default: return `مدخل غير مقبول`; - } - }; -}; -function Li$6() { - return { localeError: Ii$6() }; -} -const Ri$6 = () => { - let e = { - string: { - unit: `simvol`, - verb: `olmalıdır` - }, - file: { - unit: `bayt`, - verb: `olmalıdır` - }, - array: { - unit: `element`, - verb: `olmalıdır` - }, - set: { - unit: `element`, - verb: `olmalıdır` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `input`, - email: `email address`, - url: `URL`, - emoji: `emoji`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `ISO datetime`, - date: `ISO date`, - time: `ISO time`, - duration: `ISO duration`, - ipv4: `IPv4 address`, - ipv6: `IPv6 address`, - cidrv4: `IPv4 range`, - cidrv6: `IPv6 range`, - base64: `base64-encoded string`, - base64url: `base64url-encoded string`, - json_string: `JSON string`, - e164: `E.164 number`, - jwt: `JWT`, - template_literal: `input` - }, r = { nan: `NaN` }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = A$12(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `Yanlış dəyər: gözlənilən instanceof ${e.expected}, daxil olan ${i}` : `Yanlış dəyər: gözlənilən ${t}, daxil olan ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `Yanlış dəyər: gözlənilən ${T$14(e.values[0])}` : `Yanlış seçim: aşağıdakılardan biri olmalıdır: ${m$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? `Çox böyük: gözlənilən ${e.origin ?? `dəyər`} ${n}${e.maximum.toString()} ${r.unit ?? `element`}` : `Çox böyük: gözlənilən ${e.origin ?? `dəyər`} ${n}${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `Çox kiçik: gözlənilən ${e.origin} ${n}${e.minimum.toString()} ${r.unit}` : `Çox kiçik: gözlənilən ${e.origin} ${n}${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `Yanlış mətn: "${t.prefix}" ilə başlamalıdır` : t.format === `ends_with` ? `Yanlış mətn: "${t.suffix}" ilə bitməlidir` : t.format === `includes` ? `Yanlış mətn: "${t.includes}" daxil olmalıdır` : t.format === `regex` ? `Yanlış mətn: ${t.pattern} şablonuna uyğun olmalıdır` : `Yanlış ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `Yanlış ədəd: ${e.divisor} ilə bölünə bilən olmalıdır`; - case `unrecognized_keys`: return `Tanınmayan açar${e.keys.length > 1 ? `lar` : ``}: ${m$10(e.keys, `, `)}`; - case `invalid_key`: return `${e.origin} daxilində yanlış açar`; - case `invalid_union`: return `Yanlış dəyər`; - case `invalid_element`: return `${e.origin} daxilində yanlış dəyər`; - default: return `Yanlış dəyər`; - } - }; -}; -function zi$6() { - return { localeError: Ri$6() }; -} -function Bi$6(e, t, n, r) { - let i = Math.abs(e), a = i % 10, o = i % 100; - return o >= 11 && o <= 19 ? r : a === 1 ? t : a >= 2 && a <= 4 ? n : r; -} -const Vi$6 = () => { - let e = { - string: { - unit: { - one: `сімвал`, - few: `сімвалы`, - many: `сімвалаў` - }, - verb: `мець` - }, - array: { - unit: { - one: `элемент`, - few: `элементы`, - many: `элементаў` - }, - verb: `мець` - }, - set: { - unit: { - one: `элемент`, - few: `элементы`, - many: `элементаў` - }, - verb: `мець` - }, - file: { - unit: { - one: `байт`, - few: `байты`, - many: `байтаў` - }, - verb: `мець` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `увод`, - email: `email адрас`, - url: `URL`, - emoji: `эмодзі`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `ISO дата і час`, - date: `ISO дата`, - time: `ISO час`, - duration: `ISO працягласць`, - ipv4: `IPv4 адрас`, - ipv6: `IPv6 адрас`, - cidrv4: `IPv4 дыяпазон`, - cidrv6: `IPv6 дыяпазон`, - base64: `радок у фармаце base64`, - base64url: `радок у фармаце base64url`, - json_string: `JSON радок`, - e164: `нумар E.164`, - jwt: `JWT`, - template_literal: `увод` - }, r = { - nan: `NaN`, - number: `лік`, - array: `масіў` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = A$12(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `Няправільны ўвод: чакаўся instanceof ${e.expected}, атрымана ${i}` : `Няправільны ўвод: чакаўся ${t}, атрымана ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `Няправільны ўвод: чакалася ${T$14(e.values[0])}` : `Няправільны варыянт: чакаўся адзін з ${m$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - if (r) { - let t = Bi$6(Number(e.maximum), r.unit.one, r.unit.few, r.unit.many); - return `Занадта вялікі: чакалася, што ${e.origin ?? `значэнне`} павінна ${r.verb} ${n}${e.maximum.toString()} ${t}`; - } - return `Занадта вялікі: чакалася, што ${e.origin ?? `значэнне`} павінна быць ${n}${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - if (r) { - let t = Bi$6(Number(e.minimum), r.unit.one, r.unit.few, r.unit.many); - return `Занадта малы: чакалася, што ${e.origin} павінна ${r.verb} ${n}${e.minimum.toString()} ${t}`; - } - return `Занадта малы: чакалася, што ${e.origin} павінна быць ${n}${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `Няправільны радок: павінен пачынацца з "${t.prefix}"` : t.format === `ends_with` ? `Няправільны радок: павінен заканчвацца на "${t.suffix}"` : t.format === `includes` ? `Няправільны радок: павінен змяшчаць "${t.includes}"` : t.format === `regex` ? `Няправільны радок: павінен адпавядаць шаблону ${t.pattern}` : `Няправільны ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `Няправільны лік: павінен быць кратным ${e.divisor}`; - case `unrecognized_keys`: return `Нераспазнаны ${e.keys.length > 1 ? `ключы` : `ключ`}: ${m$10(e.keys, `, `)}`; - case `invalid_key`: return `Няправільны ключ у ${e.origin}`; - case `invalid_union`: return `Няправільны ўвод`; - case `invalid_element`: return `Няправільнае значэнне ў ${e.origin}`; - default: return `Няправільны ўвод`; - } - }; -}; -function Hi$6() { - return { localeError: Vi$6() }; -} -const Ui$6 = () => { - let e = { - string: { - unit: `символа`, - verb: `да съдържа` - }, - file: { - unit: `байта`, - verb: `да съдържа` - }, - array: { - unit: `елемента`, - verb: `да съдържа` - }, - set: { - unit: `елемента`, - verb: `да съдържа` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `вход`, - email: `имейл адрес`, - url: `URL`, - emoji: `емоджи`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `ISO време`, - date: `ISO дата`, - time: `ISO време`, - duration: `ISO продължителност`, - ipv4: `IPv4 адрес`, - ipv6: `IPv6 адрес`, - cidrv4: `IPv4 диапазон`, - cidrv6: `IPv6 диапазон`, - base64: `base64-кодиран низ`, - base64url: `base64url-кодиран низ`, - json_string: `JSON низ`, - e164: `E.164 номер`, - jwt: `JWT`, - template_literal: `вход` - }, r = { - nan: `NaN`, - number: `число`, - array: `масив` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = A$12(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `Невалиден вход: очакван instanceof ${e.expected}, получен ${i}` : `Невалиден вход: очакван ${t}, получен ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `Невалиден вход: очакван ${T$14(e.values[0])}` : `Невалидна опция: очаквано едно от ${m$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? `Твърде голямо: очаква се ${e.origin ?? `стойност`} да съдържа ${n}${e.maximum.toString()} ${r.unit ?? `елемента`}` : `Твърде голямо: очаква се ${e.origin ?? `стойност`} да бъде ${n}${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `Твърде малко: очаква се ${e.origin} да съдържа ${n}${e.minimum.toString()} ${r.unit}` : `Твърде малко: очаква се ${e.origin} да бъде ${n}${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - if (t.format === `starts_with`) return `Невалиден низ: трябва да започва с "${t.prefix}"`; - if (t.format === `ends_with`) return `Невалиден низ: трябва да завършва с "${t.suffix}"`; - if (t.format === `includes`) return `Невалиден низ: трябва да включва "${t.includes}"`; - if (t.format === `regex`) return `Невалиден низ: трябва да съвпада с ${t.pattern}`; - let r = `Невалиден`; - return t.format === `emoji` && (r = `Невалидно`), t.format === `datetime` && (r = `Невалидно`), t.format === `date` && (r = `Невалидна`), t.format === `time` && (r = `Невалидно`), t.format === `duration` && (r = `Невалидна`), `${r} ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `Невалидно число: трябва да бъде кратно на ${e.divisor}`; - case `unrecognized_keys`: return `Неразпознат${e.keys.length > 1 ? `и` : ``} ключ${e.keys.length > 1 ? `ове` : ``}: ${m$10(e.keys, `, `)}`; - case `invalid_key`: return `Невалиден ключ в ${e.origin}`; - case `invalid_union`: return `Невалиден вход`; - case `invalid_element`: return `Невалидна стойност в ${e.origin}`; - default: return `Невалиден вход`; - } - }; -}; -function Wi$6() { - return { localeError: Ui$6() }; -} -const Gi$6 = () => { - let e = { - string: { - unit: `caràcters`, - verb: `contenir` - }, - file: { - unit: `bytes`, - verb: `contenir` - }, - array: { - unit: `elements`, - verb: `contenir` - }, - set: { - unit: `elements`, - verb: `contenir` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `entrada`, - email: `adreça electrònica`, - url: `URL`, - emoji: `emoji`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `data i hora ISO`, - date: `data ISO`, - time: `hora ISO`, - duration: `durada ISO`, - ipv4: `adreça IPv4`, - ipv6: `adreça IPv6`, - cidrv4: `rang IPv4`, - cidrv6: `rang IPv6`, - base64: `cadena codificada en base64`, - base64url: `cadena codificada en base64url`, - json_string: `cadena JSON`, - e164: `número E.164`, - jwt: `JWT`, - template_literal: `entrada` - }, r = { nan: `NaN` }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = A$12(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `Tipus invàlid: s'esperava instanceof ${e.expected}, s'ha rebut ${i}` : `Tipus invàlid: s'esperava ${t}, s'ha rebut ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `Valor invàlid: s'esperava ${T$14(e.values[0])}` : `Opció invàlida: s'esperava una de ${m$10(e.values, ` o `)}`; - case `too_big`: { - let n = e.inclusive ? `com a màxim` : `menys de`, r = t(e.origin); - return r ? `Massa gran: s'esperava que ${e.origin ?? `el valor`} contingués ${n} ${e.maximum.toString()} ${r.unit ?? `elements`}` : `Massa gran: s'esperava que ${e.origin ?? `el valor`} fos ${n} ${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `com a mínim` : `més de`, r = t(e.origin); - return r ? `Massa petit: s'esperava que ${e.origin} contingués ${n} ${e.minimum.toString()} ${r.unit}` : `Massa petit: s'esperava que ${e.origin} fos ${n} ${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `Format invàlid: ha de començar amb "${t.prefix}"` : t.format === `ends_with` ? `Format invàlid: ha d'acabar amb "${t.suffix}"` : t.format === `includes` ? `Format invàlid: ha d'incloure "${t.includes}"` : t.format === `regex` ? `Format invàlid: ha de coincidir amb el patró ${t.pattern}` : `Format invàlid per a ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `Número invàlid: ha de ser múltiple de ${e.divisor}`; - case `unrecognized_keys`: return `Clau${e.keys.length > 1 ? `s` : ``} no reconeguda${e.keys.length > 1 ? `s` : ``}: ${m$10(e.keys, `, `)}`; - case `invalid_key`: return `Clau invàlida a ${e.origin}`; - case `invalid_union`: return `Entrada invàlida`; - case `invalid_element`: return `Element invàlid a ${e.origin}`; - default: return `Entrada invàlida`; - } - }; -}; -function Ki$6() { - return { localeError: Gi$6() }; -} -const qi$6 = () => { - let e = { - string: { - unit: `znaků`, - verb: `mít` - }, - file: { - unit: `bajtů`, - verb: `mít` - }, - array: { - unit: `prvků`, - verb: `mít` - }, - set: { - unit: `prvků`, - verb: `mít` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `regulární výraz`, - email: `e-mailová adresa`, - url: `URL`, - emoji: `emoji`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `datum a čas ve formátu ISO`, - date: `datum ve formátu ISO`, - time: `čas ve formátu ISO`, - duration: `doba trvání ISO`, - ipv4: `IPv4 adresa`, - ipv6: `IPv6 adresa`, - cidrv4: `rozsah IPv4`, - cidrv6: `rozsah IPv6`, - base64: `řetězec zakódovaný ve formátu base64`, - base64url: `řetězec zakódovaný ve formátu base64url`, - json_string: `řetězec ve formátu JSON`, - e164: `číslo E.164`, - jwt: `JWT`, - template_literal: `vstup` - }, r = { - nan: `NaN`, - number: `číslo`, - string: `řetězec`, - function: `funkce`, - array: `pole` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = A$12(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `Neplatný vstup: očekáváno instanceof ${e.expected}, obdrženo ${i}` : `Neplatný vstup: očekáváno ${t}, obdrženo ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `Neplatný vstup: očekáváno ${T$14(e.values[0])}` : `Neplatná možnost: očekávána jedna z hodnot ${m$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? `Hodnota je příliš velká: ${e.origin ?? `hodnota`} musí mít ${n}${e.maximum.toString()} ${r.unit ?? `prvků`}` : `Hodnota je příliš velká: ${e.origin ?? `hodnota`} musí být ${n}${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `Hodnota je příliš malá: ${e.origin ?? `hodnota`} musí mít ${n}${e.minimum.toString()} ${r.unit ?? `prvků`}` : `Hodnota je příliš malá: ${e.origin ?? `hodnota`} musí být ${n}${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `Neplatný řetězec: musí začínat na "${t.prefix}"` : t.format === `ends_with` ? `Neplatný řetězec: musí končit na "${t.suffix}"` : t.format === `includes` ? `Neplatný řetězec: musí obsahovat "${t.includes}"` : t.format === `regex` ? `Neplatný řetězec: musí odpovídat vzoru ${t.pattern}` : `Neplatný formát ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `Neplatné číslo: musí být násobkem ${e.divisor}`; - case `unrecognized_keys`: return `Neznámé klíče: ${m$10(e.keys, `, `)}`; - case `invalid_key`: return `Neplatný klíč v ${e.origin}`; - case `invalid_union`: return `Neplatný vstup`; - case `invalid_element`: return `Neplatná hodnota v ${e.origin}`; - default: return `Neplatný vstup`; - } - }; -}; -function Ji$6() { - return { localeError: qi$6() }; -} -const Yi$6 = () => { - let e = { - string: { - unit: `tegn`, - verb: `havde` - }, - file: { - unit: `bytes`, - verb: `havde` - }, - array: { - unit: `elementer`, - verb: `indeholdt` - }, - set: { - unit: `elementer`, - verb: `indeholdt` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `input`, - email: `e-mailadresse`, - url: `URL`, - emoji: `emoji`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `ISO dato- og klokkeslæt`, - date: `ISO-dato`, - time: `ISO-klokkeslæt`, - duration: `ISO-varighed`, - ipv4: `IPv4-område`, - ipv6: `IPv6-område`, - cidrv4: `IPv4-spektrum`, - cidrv6: `IPv6-spektrum`, - base64: `base64-kodet streng`, - base64url: `base64url-kodet streng`, - json_string: `JSON-streng`, - e164: `E.164-nummer`, - jwt: `JWT`, - template_literal: `input` - }, r = { - nan: `NaN`, - string: `streng`, - number: `tal`, - boolean: `boolean`, - array: `liste`, - object: `objekt`, - set: `sæt`, - file: `fil` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = A$12(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `Ugyldigt input: forventede instanceof ${e.expected}, fik ${i}` : `Ugyldigt input: forventede ${t}, fik ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `Ugyldig værdi: forventede ${T$14(e.values[0])}` : `Ugyldigt valg: forventede en af følgende ${m$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, i = t(e.origin), a = r[e.origin] ?? e.origin; - return i ? `For stor: forventede ${a ?? `value`} ${i.verb} ${n} ${e.maximum.toString()} ${i.unit ?? `elementer`}` : `For stor: forventede ${a ?? `value`} havde ${n} ${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, i = t(e.origin), a = r[e.origin] ?? e.origin; - return i ? `For lille: forventede ${a} ${i.verb} ${n} ${e.minimum.toString()} ${i.unit}` : `For lille: forventede ${a} havde ${n} ${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `Ugyldig streng: skal starte med "${t.prefix}"` : t.format === `ends_with` ? `Ugyldig streng: skal ende med "${t.suffix}"` : t.format === `includes` ? `Ugyldig streng: skal indeholde "${t.includes}"` : t.format === `regex` ? `Ugyldig streng: skal matche mønsteret ${t.pattern}` : `Ugyldig ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `Ugyldigt tal: skal være deleligt med ${e.divisor}`; - case `unrecognized_keys`: return `${e.keys.length > 1 ? `Ukendte nøgler` : `Ukendt nøgle`}: ${m$10(e.keys, `, `)}`; - case `invalid_key`: return `Ugyldig nøgle i ${e.origin}`; - case `invalid_union`: return `Ugyldigt input: matcher ingen af de tilladte typer`; - case `invalid_element`: return `Ugyldig værdi i ${e.origin}`; - default: return `Ugyldigt input`; - } - }; -}; -function Xi$6() { - return { localeError: Yi$6() }; -} -const Zi$6 = () => { - let e = { - string: { - unit: `Zeichen`, - verb: `zu haben` - }, - file: { - unit: `Bytes`, - verb: `zu haben` - }, - array: { - unit: `Elemente`, - verb: `zu haben` - }, - set: { - unit: `Elemente`, - verb: `zu haben` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `Eingabe`, - email: `E-Mail-Adresse`, - url: `URL`, - emoji: `Emoji`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `ISO-Datum und -Uhrzeit`, - date: `ISO-Datum`, - time: `ISO-Uhrzeit`, - duration: `ISO-Dauer`, - ipv4: `IPv4-Adresse`, - ipv6: `IPv6-Adresse`, - cidrv4: `IPv4-Bereich`, - cidrv6: `IPv6-Bereich`, - base64: `Base64-codierter String`, - base64url: `Base64-URL-codierter String`, - json_string: `JSON-String`, - e164: `E.164-Nummer`, - jwt: `JWT`, - template_literal: `Eingabe` - }, r = { - nan: `NaN`, - number: `Zahl`, - array: `Array` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = A$12(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `Ungültige Eingabe: erwartet instanceof ${e.expected}, erhalten ${i}` : `Ungültige Eingabe: erwartet ${t}, erhalten ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `Ungültige Eingabe: erwartet ${T$14(e.values[0])}` : `Ungültige Option: erwartet eine von ${m$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? `Zu groß: erwartet, dass ${e.origin ?? `Wert`} ${n}${e.maximum.toString()} ${r.unit ?? `Elemente`} hat` : `Zu groß: erwartet, dass ${e.origin ?? `Wert`} ${n}${e.maximum.toString()} ist`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `Zu klein: erwartet, dass ${e.origin} ${n}${e.minimum.toString()} ${r.unit} hat` : `Zu klein: erwartet, dass ${e.origin} ${n}${e.minimum.toString()} ist`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `Ungültiger String: muss mit "${t.prefix}" beginnen` : t.format === `ends_with` ? `Ungültiger String: muss mit "${t.suffix}" enden` : t.format === `includes` ? `Ungültiger String: muss "${t.includes}" enthalten` : t.format === `regex` ? `Ungültiger String: muss dem Muster ${t.pattern} entsprechen` : `Ungültig: ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `Ungültige Zahl: muss ein Vielfaches von ${e.divisor} sein`; - case `unrecognized_keys`: return `${e.keys.length > 1 ? `Unbekannte Schlüssel` : `Unbekannter Schlüssel`}: ${m$10(e.keys, `, `)}`; - case `invalid_key`: return `Ungültiger Schlüssel in ${e.origin}`; - case `invalid_union`: return `Ungültige Eingabe`; - case `invalid_element`: return `Ungültiger Wert in ${e.origin}`; - default: return `Ungültige Eingabe`; - } - }; -}; -function Qi$6() { - return { localeError: Zi$6() }; -} -const $i$6 = () => { - let e = { - string: { - unit: `χαρακτήρες`, - verb: `να έχει` - }, - file: { - unit: `bytes`, - verb: `να έχει` - }, - array: { - unit: `στοιχεία`, - verb: `να έχει` - }, - set: { - unit: `στοιχεία`, - verb: `να έχει` - }, - map: { - unit: `καταχωρήσεις`, - verb: `να έχει` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `είσοδος`, - email: `διεύθυνση email`, - url: `URL`, - emoji: `emoji`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `ISO ημερομηνία και ώρα`, - date: `ISO ημερομηνία`, - time: `ISO ώρα`, - duration: `ISO διάρκεια`, - ipv4: `διεύθυνση IPv4`, - ipv6: `διεύθυνση IPv6`, - mac: `διεύθυνση MAC`, - cidrv4: `εύρος IPv4`, - cidrv6: `εύρος IPv6`, - base64: `συμβολοσειρά κωδικοποιημένη σε base64`, - base64url: `συμβολοσειρά κωδικοποιημένη σε base64url`, - json_string: `συμβολοσειρά JSON`, - e164: `αριθμός E.164`, - jwt: `JWT`, - template_literal: `είσοδος` - }, r = { nan: `NaN` }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = A$12(e.input), i = r[n] ?? n; - return typeof e.expected == `string` && /^[A-Z]/.test(e.expected) ? `Μη έγκυρη είσοδος: αναμενόταν instanceof ${e.expected}, λήφθηκε ${i}` : `Μη έγκυρη είσοδος: αναμενόταν ${t}, λήφθηκε ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `Μη έγκυρη είσοδος: αναμενόταν ${T$14(e.values[0])}` : `Μη έγκυρη επιλογή: αναμενόταν ένα από ${m$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? `Πολύ μεγάλο: αναμενόταν ${e.origin ?? `τιμή`} να έχει ${n}${e.maximum.toString()} ${r.unit ?? `στοιχεία`}` : `Πολύ μεγάλο: αναμενόταν ${e.origin ?? `τιμή`} να είναι ${n}${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `Πολύ μικρό: αναμενόταν ${e.origin} να έχει ${n}${e.minimum.toString()} ${r.unit}` : `Πολύ μικρό: αναμενόταν ${e.origin} να είναι ${n}${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `Μη έγκυρη συμβολοσειρά: πρέπει να ξεκινά με "${t.prefix}"` : t.format === `ends_with` ? `Μη έγκυρη συμβολοσειρά: πρέπει να τελειώνει με "${t.suffix}"` : t.format === `includes` ? `Μη έγκυρη συμβολοσειρά: πρέπει να περιέχει "${t.includes}"` : t.format === `regex` ? `Μη έγκυρη συμβολοσειρά: πρέπει να ταιριάζει με το μοτίβο ${t.pattern}` : `Μη έγκυρο: ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `Μη έγκυρος αριθμός: πρέπει να είναι πολλαπλάσιο του ${e.divisor}`; - case `unrecognized_keys`: return `Άγνωστ${e.keys.length > 1 ? `α` : `ο`} κλειδ${e.keys.length > 1 ? `ιά` : `ί`}: ${m$10(e.keys, `, `)}`; - case `invalid_key`: return `Μη έγκυρο κλειδί στο ${e.origin}`; - case `invalid_union`: return `Μη έγκυρη είσοδος`; - case `invalid_element`: return `Μη έγκυρη τιμή στο ${e.origin}`; - default: return `Μη έγκυρη είσοδος`; - } - }; -}; -function ea$6() { - return { localeError: $i$6() }; -} -const ta$6 = () => { - let e = { - string: { - unit: `characters`, - verb: `to have` - }, - file: { - unit: `bytes`, - verb: `to have` - }, - array: { - unit: `items`, - verb: `to have` - }, - set: { - unit: `items`, - verb: `to have` - }, - map: { - unit: `entries`, - verb: `to have` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `input`, - email: `email address`, - url: `URL`, - emoji: `emoji`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `ISO datetime`, - date: `ISO date`, - time: `ISO time`, - duration: `ISO duration`, - ipv4: `IPv4 address`, - ipv6: `IPv6 address`, - mac: `MAC address`, - cidrv4: `IPv4 range`, - cidrv6: `IPv6 range`, - base64: `base64-encoded string`, - base64url: `base64url-encoded string`, - json_string: `JSON string`, - e164: `E.164 number`, - jwt: `JWT`, - template_literal: `input` - }, r = { nan: `NaN` }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = A$12(e.input); - return `Invalid input: expected ${t}, received ${r[n] ?? n}`; - } - case `invalid_value`: return e.values.length === 1 ? `Invalid input: expected ${T$14(e.values[0])}` : `Invalid option: expected one of ${m$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? `Too big: expected ${e.origin ?? `value`} to have ${n}${e.maximum.toString()} ${r.unit ?? `elements`}` : `Too big: expected ${e.origin ?? `value`} to be ${n}${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}` : `Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `Invalid string: must start with "${t.prefix}"` : t.format === `ends_with` ? `Invalid string: must end with "${t.suffix}"` : t.format === `includes` ? `Invalid string: must include "${t.includes}"` : t.format === `regex` ? `Invalid string: must match pattern ${t.pattern}` : `Invalid ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `Invalid number: must be a multiple of ${e.divisor}`; - case `unrecognized_keys`: return `Unrecognized key${e.keys.length > 1 ? `s` : ``}: ${m$10(e.keys, `, `)}`; - case `invalid_key`: return `Invalid key in ${e.origin}`; - case `invalid_union`: return e.options && Array.isArray(e.options) && e.options.length > 0 ? `Invalid discriminator value. Expected ${e.options.map((e) => `'${e}'`).join(` | `)}` : `Invalid input`; - case `invalid_element`: return `Invalid value in ${e.origin}`; - default: return `Invalid input`; - } - }; -}; -function na$6() { - return { localeError: ta$6() }; -} -const ra$6 = () => { - let e = { - string: { - unit: `karaktrojn`, - verb: `havi` - }, - file: { - unit: `bajtojn`, - verb: `havi` - }, - array: { - unit: `elementojn`, - verb: `havi` - }, - set: { - unit: `elementojn`, - verb: `havi` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `enigo`, - email: `retadreso`, - url: `URL`, - emoji: `emoĝio`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `ISO-datotempo`, - date: `ISO-dato`, - time: `ISO-tempo`, - duration: `ISO-daŭro`, - ipv4: `IPv4-adreso`, - ipv6: `IPv6-adreso`, - cidrv4: `IPv4-rango`, - cidrv6: `IPv6-rango`, - base64: `64-ume kodita karaktraro`, - base64url: `URL-64-ume kodita karaktraro`, - json_string: `JSON-karaktraro`, - e164: `E.164-nombro`, - jwt: `JWT`, - template_literal: `enigo` - }, r = { - nan: `NaN`, - number: `nombro`, - array: `tabelo`, - null: `senvalora` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = A$12(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `Nevalida enigo: atendiĝis instanceof ${e.expected}, riceviĝis ${i}` : `Nevalida enigo: atendiĝis ${t}, riceviĝis ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `Nevalida enigo: atendiĝis ${T$14(e.values[0])}` : `Nevalida opcio: atendiĝis unu el ${m$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? `Tro granda: atendiĝis ke ${e.origin ?? `valoro`} havu ${n}${e.maximum.toString()} ${r.unit ?? `elementojn`}` : `Tro granda: atendiĝis ke ${e.origin ?? `valoro`} havu ${n}${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `Tro malgranda: atendiĝis ke ${e.origin} havu ${n}${e.minimum.toString()} ${r.unit}` : `Tro malgranda: atendiĝis ke ${e.origin} estu ${n}${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `Nevalida karaktraro: devas komenciĝi per "${t.prefix}"` : t.format === `ends_with` ? `Nevalida karaktraro: devas finiĝi per "${t.suffix}"` : t.format === `includes` ? `Nevalida karaktraro: devas inkluzivi "${t.includes}"` : t.format === `regex` ? `Nevalida karaktraro: devas kongrui kun la modelo ${t.pattern}` : `Nevalida ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `Nevalida nombro: devas esti oblo de ${e.divisor}`; - case `unrecognized_keys`: return `Nekonata${e.keys.length > 1 ? `j` : ``} ŝlosilo${e.keys.length > 1 ? `j` : ``}: ${m$10(e.keys, `, `)}`; - case `invalid_key`: return `Nevalida ŝlosilo en ${e.origin}`; - case `invalid_union`: return `Nevalida enigo`; - case `invalid_element`: return `Nevalida valoro en ${e.origin}`; - default: return `Nevalida enigo`; - } - }; -}; -function ia$6() { - return { localeError: ra$6() }; -} -const aa$6 = () => { - let e = { - string: { - unit: `caracteres`, - verb: `tener` - }, - file: { - unit: `bytes`, - verb: `tener` - }, - array: { - unit: `elementos`, - verb: `tener` - }, - set: { - unit: `elementos`, - verb: `tener` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `entrada`, - email: `dirección de correo electrónico`, - url: `URL`, - emoji: `emoji`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `fecha y hora ISO`, - date: `fecha ISO`, - time: `hora ISO`, - duration: `duración ISO`, - ipv4: `dirección IPv4`, - ipv6: `dirección IPv6`, - cidrv4: `rango IPv4`, - cidrv6: `rango IPv6`, - base64: `cadena codificada en base64`, - base64url: `URL codificada en base64`, - json_string: `cadena JSON`, - e164: `número E.164`, - jwt: `JWT`, - template_literal: `entrada` - }, r = { - nan: `NaN`, - string: `texto`, - number: `número`, - boolean: `booleano`, - array: `arreglo`, - object: `objeto`, - set: `conjunto`, - file: `archivo`, - date: `fecha`, - bigint: `número grande`, - symbol: `símbolo`, - undefined: `indefinido`, - null: `nulo`, - function: `función`, - map: `mapa`, - record: `registro`, - tuple: `tupla`, - enum: `enumeración`, - union: `unión`, - literal: `literal`, - promise: `promesa`, - void: `vacío`, - never: `nunca`, - unknown: `desconocido`, - any: `cualquiera` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = A$12(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `Entrada inválida: se esperaba instanceof ${e.expected}, recibido ${i}` : `Entrada inválida: se esperaba ${t}, recibido ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `Entrada inválida: se esperaba ${T$14(e.values[0])}` : `Opción inválida: se esperaba una de ${m$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, i = t(e.origin), a = r[e.origin] ?? e.origin; - return i ? `Demasiado grande: se esperaba que ${a ?? `valor`} tuviera ${n}${e.maximum.toString()} ${i.unit ?? `elementos`}` : `Demasiado grande: se esperaba que ${a ?? `valor`} fuera ${n}${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, i = t(e.origin), a = r[e.origin] ?? e.origin; - return i ? `Demasiado pequeño: se esperaba que ${a} tuviera ${n}${e.minimum.toString()} ${i.unit}` : `Demasiado pequeño: se esperaba que ${a} fuera ${n}${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `Cadena inválida: debe comenzar con "${t.prefix}"` : t.format === `ends_with` ? `Cadena inválida: debe terminar en "${t.suffix}"` : t.format === `includes` ? `Cadena inválida: debe incluir "${t.includes}"` : t.format === `regex` ? `Cadena inválida: debe coincidir con el patrón ${t.pattern}` : `Inválido ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `Número inválido: debe ser múltiplo de ${e.divisor}`; - case `unrecognized_keys`: return `Llave${e.keys.length > 1 ? `s` : ``} desconocida${e.keys.length > 1 ? `s` : ``}: ${m$10(e.keys, `, `)}`; - case `invalid_key`: return `Llave inválida en ${r[e.origin] ?? e.origin}`; - case `invalid_union`: return `Entrada inválida`; - case `invalid_element`: return `Valor inválido en ${r[e.origin] ?? e.origin}`; - default: return `Entrada inválida`; - } - }; -}; -function oa$6() { - return { localeError: aa$6() }; -} -const sa$6 = () => { - let e = { - string: { - unit: `کاراکتر`, - verb: `داشته باشد` - }, - file: { - unit: `بایت`, - verb: `داشته باشد` - }, - array: { - unit: `آیتم`, - verb: `داشته باشد` - }, - set: { - unit: `آیتم`, - verb: `داشته باشد` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `ورودی`, - email: `آدرس ایمیل`, - url: `URL`, - emoji: `ایموجی`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `تاریخ و زمان ایزو`, - date: `تاریخ ایزو`, - time: `زمان ایزو`, - duration: `مدت زمان ایزو`, - ipv4: `IPv4 آدرس`, - ipv6: `IPv6 آدرس`, - cidrv4: `IPv4 دامنه`, - cidrv6: `IPv6 دامنه`, - base64: `base64-encoded رشته`, - base64url: `base64url-encoded رشته`, - json_string: `JSON رشته`, - e164: `E.164 عدد`, - jwt: `JWT`, - template_literal: `ورودی` - }, r = { - nan: `NaN`, - number: `عدد`, - array: `آرایه` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = A$12(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `ورودی نامعتبر: می‌بایست instanceof ${e.expected} می‌بود، ${i} دریافت شد` : `ورودی نامعتبر: می‌بایست ${t} می‌بود، ${i} دریافت شد`; - } - case `invalid_value`: return e.values.length === 1 ? `ورودی نامعتبر: می‌بایست ${T$14(e.values[0])} می‌بود` : `گزینه نامعتبر: می‌بایست یکی از ${m$10(e.values, `|`)} می‌بود`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? `خیلی بزرگ: ${e.origin ?? `مقدار`} باید ${n}${e.maximum.toString()} ${r.unit ?? `عنصر`} باشد` : `خیلی بزرگ: ${e.origin ?? `مقدار`} باید ${n}${e.maximum.toString()} باشد`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `خیلی کوچک: ${e.origin} باید ${n}${e.minimum.toString()} ${r.unit} باشد` : `خیلی کوچک: ${e.origin} باید ${n}${e.minimum.toString()} باشد`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `رشته نامعتبر: باید با "${t.prefix}" شروع شود` : t.format === `ends_with` ? `رشته نامعتبر: باید با "${t.suffix}" تمام شود` : t.format === `includes` ? `رشته نامعتبر: باید شامل "${t.includes}" باشد` : t.format === `regex` ? `رشته نامعتبر: باید با الگوی ${t.pattern} مطابقت داشته باشد` : `${n[t.format] ?? e.format} نامعتبر`; - } - case `not_multiple_of`: return `عدد نامعتبر: باید مضرب ${e.divisor} باشد`; - case `unrecognized_keys`: return `کلید${e.keys.length > 1 ? `های` : ``} ناشناس: ${m$10(e.keys, `, `)}`; - case `invalid_key`: return `کلید ناشناس در ${e.origin}`; - case `invalid_union`: return `ورودی نامعتبر`; - case `invalid_element`: return `مقدار نامعتبر در ${e.origin}`; - default: return `ورودی نامعتبر`; - } - }; -}; -function ca$6() { - return { localeError: sa$6() }; -} -const la$6 = () => { - let e = { - string: { - unit: `merkkiä`, - subject: `merkkijonon` - }, - file: { - unit: `tavua`, - subject: `tiedoston` - }, - array: { - unit: `alkiota`, - subject: `listan` - }, - set: { - unit: `alkiota`, - subject: `joukon` - }, - number: { - unit: ``, - subject: `luvun` - }, - bigint: { - unit: ``, - subject: `suuren kokonaisluvun` - }, - int: { - unit: ``, - subject: `kokonaisluvun` - }, - date: { - unit: ``, - subject: `päivämäärän` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `säännöllinen lauseke`, - email: `sähköpostiosoite`, - url: `URL-osoite`, - emoji: `emoji`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `ISO-aikaleima`, - date: `ISO-päivämäärä`, - time: `ISO-aika`, - duration: `ISO-kesto`, - ipv4: `IPv4-osoite`, - ipv6: `IPv6-osoite`, - cidrv4: `IPv4-alue`, - cidrv6: `IPv6-alue`, - base64: `base64-koodattu merkkijono`, - base64url: `base64url-koodattu merkkijono`, - json_string: `JSON-merkkijono`, - e164: `E.164-luku`, - jwt: `JWT`, - template_literal: `templaattimerkkijono` - }, r = { nan: `NaN` }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = A$12(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `Virheellinen tyyppi: odotettiin instanceof ${e.expected}, oli ${i}` : `Virheellinen tyyppi: odotettiin ${t}, oli ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `Virheellinen syöte: täytyy olla ${T$14(e.values[0])}` : `Virheellinen valinta: täytyy olla yksi seuraavista: ${m$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? `Liian suuri: ${r.subject} täytyy olla ${n}${e.maximum.toString()} ${r.unit}`.trim() : `Liian suuri: arvon täytyy olla ${n}${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `Liian pieni: ${r.subject} täytyy olla ${n}${e.minimum.toString()} ${r.unit}`.trim() : `Liian pieni: arvon täytyy olla ${n}${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `Virheellinen syöte: täytyy alkaa "${t.prefix}"` : t.format === `ends_with` ? `Virheellinen syöte: täytyy loppua "${t.suffix}"` : t.format === `includes` ? `Virheellinen syöte: täytyy sisältää "${t.includes}"` : t.format === `regex` ? `Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${t.pattern}` : `Virheellinen ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `Virheellinen luku: täytyy olla luvun ${e.divisor} monikerta`; - case `unrecognized_keys`: return `${e.keys.length > 1 ? `Tuntemattomat avaimet` : `Tuntematon avain`}: ${m$10(e.keys, `, `)}`; - case `invalid_key`: return `Virheellinen avain tietueessa`; - case `invalid_union`: return `Virheellinen unioni`; - case `invalid_element`: return `Virheellinen arvo joukossa`; - default: return `Virheellinen syöte`; - } - }; -}; -function ua$6() { - return { localeError: la$6() }; -} -const da$6 = () => { - let e = { - string: { - unit: `caractères`, - verb: `avoir` - }, - file: { - unit: `octets`, - verb: `avoir` - }, - array: { - unit: `éléments`, - verb: `avoir` - }, - set: { - unit: `éléments`, - verb: `avoir` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `entrée`, - email: `adresse e-mail`, - url: `URL`, - emoji: `emoji`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `date et heure ISO`, - date: `date ISO`, - time: `heure ISO`, - duration: `durée ISO`, - ipv4: `adresse IPv4`, - ipv6: `adresse IPv6`, - cidrv4: `plage IPv4`, - cidrv6: `plage IPv6`, - base64: `chaîne encodée en base64`, - base64url: `chaîne encodée en base64url`, - json_string: `chaîne JSON`, - e164: `numéro E.164`, - jwt: `JWT`, - template_literal: `entrée` - }, r = { - string: `chaîne`, - number: `nombre`, - int: `entier`, - boolean: `booléen`, - bigint: `grand entier`, - symbol: `symbole`, - undefined: `indéfini`, - null: `null`, - never: `jamais`, - void: `vide`, - date: `date`, - array: `tableau`, - object: `objet`, - tuple: `tuple`, - record: `enregistrement`, - map: `carte`, - set: `ensemble`, - file: `fichier`, - nonoptional: `non-optionnel`, - nan: `NaN`, - function: `fonction` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = A$12(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `Entrée invalide : instanceof ${e.expected} attendu, ${i} reçu` : `Entrée invalide : ${t} attendu, ${i} reçu`; - } - case `invalid_value`: return e.values.length === 1 ? `Entrée invalide : ${T$14(e.values[0])} attendu` : `Option invalide : une valeur parmi ${m$10(e.values, `|`)} attendue`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, i = t(e.origin); - return i ? `Trop grand : ${r[e.origin] ?? `valeur`} doit ${i.verb} ${n}${e.maximum.toString()} ${i.unit ?? `élément(s)`}` : `Trop grand : ${r[e.origin] ?? `valeur`} doit être ${n}${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, i = t(e.origin); - return i ? `Trop petit : ${r[e.origin] ?? `valeur`} doit ${i.verb} ${n}${e.minimum.toString()} ${i.unit}` : `Trop petit : ${r[e.origin] ?? `valeur`} doit être ${n}${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `Chaîne invalide : doit commencer par "${t.prefix}"` : t.format === `ends_with` ? `Chaîne invalide : doit se terminer par "${t.suffix}"` : t.format === `includes` ? `Chaîne invalide : doit inclure "${t.includes}"` : t.format === `regex` ? `Chaîne invalide : doit correspondre au modèle ${t.pattern}` : `${n[t.format] ?? e.format} invalide`; - } - case `not_multiple_of`: return `Nombre invalide : doit être un multiple de ${e.divisor}`; - case `unrecognized_keys`: return `Clé${e.keys.length > 1 ? `s` : ``} non reconnue${e.keys.length > 1 ? `s` : ``} : ${m$10(e.keys, `, `)}`; - case `invalid_key`: return `Clé invalide dans ${e.origin}`; - case `invalid_union`: return `Entrée invalide`; - case `invalid_element`: return `Valeur invalide dans ${e.origin}`; - default: return `Entrée invalide`; - } - }; -}; -function fa$6() { - return { localeError: da$6() }; -} -const pa$6 = () => { - let e = { - string: { - unit: `caractères`, - verb: `avoir` - }, - file: { - unit: `octets`, - verb: `avoir` - }, - array: { - unit: `éléments`, - verb: `avoir` - }, - set: { - unit: `éléments`, - verb: `avoir` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `entrée`, - email: `adresse courriel`, - url: `URL`, - emoji: `emoji`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `date-heure ISO`, - date: `date ISO`, - time: `heure ISO`, - duration: `durée ISO`, - ipv4: `adresse IPv4`, - ipv6: `adresse IPv6`, - cidrv4: `plage IPv4`, - cidrv6: `plage IPv6`, - base64: `chaîne encodée en base64`, - base64url: `chaîne encodée en base64url`, - json_string: `chaîne JSON`, - e164: `numéro E.164`, - jwt: `JWT`, - template_literal: `entrée` - }, r = { nan: `NaN` }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = A$12(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `Entrée invalide : attendu instanceof ${e.expected}, reçu ${i}` : `Entrée invalide : attendu ${t}, reçu ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `Entrée invalide : attendu ${T$14(e.values[0])}` : `Option invalide : attendu l'une des valeurs suivantes ${m$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `≤` : `<`, r = t(e.origin); - return r ? `Trop grand : attendu que ${e.origin ?? `la valeur`} ait ${n}${e.maximum.toString()} ${r.unit}` : `Trop grand : attendu que ${e.origin ?? `la valeur`} soit ${n}${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `≥` : `>`, r = t(e.origin); - return r ? `Trop petit : attendu que ${e.origin} ait ${n}${e.minimum.toString()} ${r.unit}` : `Trop petit : attendu que ${e.origin} soit ${n}${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `Chaîne invalide : doit commencer par "${t.prefix}"` : t.format === `ends_with` ? `Chaîne invalide : doit se terminer par "${t.suffix}"` : t.format === `includes` ? `Chaîne invalide : doit inclure "${t.includes}"` : t.format === `regex` ? `Chaîne invalide : doit correspondre au motif ${t.pattern}` : `${n[t.format] ?? e.format} invalide`; - } - case `not_multiple_of`: return `Nombre invalide : doit être un multiple de ${e.divisor}`; - case `unrecognized_keys`: return `Clé${e.keys.length > 1 ? `s` : ``} non reconnue${e.keys.length > 1 ? `s` : ``} : ${m$10(e.keys, `, `)}`; - case `invalid_key`: return `Clé invalide dans ${e.origin}`; - case `invalid_union`: return `Entrée invalide`; - case `invalid_element`: return `Valeur invalide dans ${e.origin}`; - default: return `Entrée invalide`; - } - }; -}; -function ma$6() { - return { localeError: pa$6() }; -} -const ha$6 = () => { - let e = { - string: { - label: `מחרוזת`, - gender: `f` - }, - number: { - label: `מספר`, - gender: `m` - }, - boolean: { - label: `ערך בוליאני`, - gender: `m` - }, - bigint: { - label: `BigInt`, - gender: `m` - }, - date: { - label: `תאריך`, - gender: `m` - }, - array: { - label: `מערך`, - gender: `m` - }, - object: { - label: `אובייקט`, - gender: `m` - }, - null: { - label: `ערך ריק (null)`, - gender: `m` - }, - undefined: { - label: `ערך לא מוגדר (undefined)`, - gender: `m` - }, - symbol: { - label: `סימבול (Symbol)`, - gender: `m` - }, - function: { - label: `פונקציה`, - gender: `f` - }, - map: { - label: `מפה (Map)`, - gender: `f` - }, - set: { - label: `קבוצה (Set)`, - gender: `f` - }, - file: { - label: `קובץ`, - gender: `m` - }, - promise: { - label: `Promise`, - gender: `m` - }, - NaN: { - label: `NaN`, - gender: `m` - }, - unknown: { - label: `ערך לא ידוע`, - gender: `m` - }, - value: { - label: `ערך`, - gender: `m` - } - }, t = { - string: { - unit: `תווים`, - shortLabel: `קצר`, - longLabel: `ארוך` - }, - file: { - unit: `בייטים`, - shortLabel: `קטן`, - longLabel: `גדול` - }, - array: { - unit: `פריטים`, - shortLabel: `קטן`, - longLabel: `גדול` - }, - set: { - unit: `פריטים`, - shortLabel: `קטן`, - longLabel: `גדול` - }, - number: { - unit: ``, - shortLabel: `קטן`, - longLabel: `גדול` - } - }, n = (t) => t ? e[t] : void 0, r = (t) => { - let r = n(t); - return r ? r.label : t ?? e.unknown.label; - }, i = (e) => `ה${r(e)}`, a = (e) => (n(e)?.gender ?? `m`) === `f` ? `צריכה להיות` : `צריך להיות`, o = (e) => e ? t[e] ?? null : null, s = { - regex: { - label: `קלט`, - gender: `m` - }, - email: { - label: `כתובת אימייל`, - gender: `f` - }, - url: { - label: `כתובת רשת`, - gender: `f` - }, - emoji: { - label: `אימוג'י`, - gender: `m` - }, - uuid: { - label: `UUID`, - gender: `m` - }, - nanoid: { - label: `nanoid`, - gender: `m` - }, - guid: { - label: `GUID`, - gender: `m` - }, - cuid: { - label: `cuid`, - gender: `m` - }, - cuid2: { - label: `cuid2`, - gender: `m` - }, - ulid: { - label: `ULID`, - gender: `m` - }, - xid: { - label: `XID`, - gender: `m` - }, - ksuid: { - label: `KSUID`, - gender: `m` - }, - datetime: { - label: `תאריך וזמן ISO`, - gender: `m` - }, - date: { - label: `תאריך ISO`, - gender: `m` - }, - time: { - label: `זמן ISO`, - gender: `m` - }, - duration: { - label: `משך זמן ISO`, - gender: `m` - }, - ipv4: { - label: `כתובת IPv4`, - gender: `f` - }, - ipv6: { - label: `כתובת IPv6`, - gender: `f` - }, - cidrv4: { - label: `טווח IPv4`, - gender: `m` - }, - cidrv6: { - label: `טווח IPv6`, - gender: `m` - }, - base64: { - label: `מחרוזת בבסיס 64`, - gender: `f` - }, - base64url: { - label: `מחרוזת בבסיס 64 לכתובות רשת`, - gender: `f` - }, - json_string: { - label: `מחרוזת JSON`, - gender: `f` - }, - e164: { - label: `מספר E.164`, - gender: `m` - }, - jwt: { - label: `JWT`, - gender: `m` - }, - ends_with: { - label: `קלט`, - gender: `m` - }, - includes: { - label: `קלט`, - gender: `m` - }, - lowercase: { - label: `קלט`, - gender: `m` - }, - starts_with: { - label: `קלט`, - gender: `m` - }, - uppercase: { - label: `קלט`, - gender: `m` - } - }, c = { nan: `NaN` }; - return (t) => { - switch (t.code) { - case `invalid_type`: { - let n = t.expected, i = c[n ?? ``] ?? r(n), a = A$12(t.input), o = c[a] ?? e[a]?.label ?? a; - return /^[A-Z]/.test(t.expected) ? `קלט לא תקין: צריך להיות instanceof ${t.expected}, התקבל ${o}` : `קלט לא תקין: צריך להיות ${i}, התקבל ${o}`; - } - case `invalid_value`: { - if (t.values.length === 1) return `ערך לא תקין: הערך חייב להיות ${T$14(t.values[0])}`; - let e = t.values.map((e) => T$14(e)); - if (t.values.length === 2) return `ערך לא תקין: האפשרויות המתאימות הן ${e[0]} או ${e[1]}`; - let n = e[e.length - 1]; - return `ערך לא תקין: האפשרויות המתאימות הן ${e.slice(0, -1).join(`, `)} או ${n}`; - } - case `too_big`: { - let e = o(t.origin), n = i(t.origin ?? `value`); - if (t.origin === `string`) return `${e?.longLabel ?? `ארוך`} מדי: ${n} צריכה להכיל ${t.maximum.toString()} ${e?.unit ?? ``} ${t.inclusive ? `או פחות` : `לכל היותר`}`.trim(); - if (t.origin === `number`) return `גדול מדי: ${n} צריך להיות ${t.inclusive ? `קטן או שווה ל-${t.maximum}` : `קטן מ-${t.maximum}`}`; - if (t.origin === `array` || t.origin === `set`) return `גדול מדי: ${n} ${t.origin === `set` ? `צריכה` : `צריך`} להכיל ${t.inclusive ? `${t.maximum} ${e?.unit ?? ``} או פחות` : `פחות מ-${t.maximum} ${e?.unit ?? ``}`}`.trim(); - let r = t.inclusive ? `<=` : `<`, s = a(t.origin ?? `value`); - return e?.unit ? `${e.longLabel} מדי: ${n} ${s} ${r}${t.maximum.toString()} ${e.unit}` : `${e?.longLabel ?? `גדול`} מדי: ${n} ${s} ${r}${t.maximum.toString()}`; - } - case `too_small`: { - let e = o(t.origin), n = i(t.origin ?? `value`); - if (t.origin === `string`) return `${e?.shortLabel ?? `קצר`} מדי: ${n} צריכה להכיל ${t.minimum.toString()} ${e?.unit ?? ``} ${t.inclusive ? `או יותר` : `לפחות`}`.trim(); - if (t.origin === `number`) return `קטן מדי: ${n} צריך להיות ${t.inclusive ? `גדול או שווה ל-${t.minimum}` : `גדול מ-${t.minimum}`}`; - if (t.origin === `array` || t.origin === `set`) { - let r = t.origin === `set` ? `צריכה` : `צריך`; - return t.minimum === 1 && t.inclusive ? `קטן מדי: ${n} ${r} להכיל ${t.origin, `לפחות פריט אחד`}` : `קטן מדי: ${n} ${r} להכיל ${t.inclusive ? `${t.minimum} ${e?.unit ?? ``} או יותר` : `יותר מ-${t.minimum} ${e?.unit ?? ``}`}`.trim(); - } - let r = t.inclusive ? `>=` : `>`, s = a(t.origin ?? `value`); - return e?.unit ? `${e.shortLabel} מדי: ${n} ${s} ${r}${t.minimum.toString()} ${e.unit}` : `${e?.shortLabel ?? `קטן`} מדי: ${n} ${s} ${r}${t.minimum.toString()}`; - } - case `invalid_format`: { - let e = t; - if (e.format === `starts_with`) return `המחרוזת חייבת להתחיל ב "${e.prefix}"`; - if (e.format === `ends_with`) return `המחרוזת חייבת להסתיים ב "${e.suffix}"`; - if (e.format === `includes`) return `המחרוזת חייבת לכלול "${e.includes}"`; - if (e.format === `regex`) return `המחרוזת חייבת להתאים לתבנית ${e.pattern}`; - let n = s[e.format]; - return `${n?.label ?? e.format} לא ${(n?.gender ?? `m`) === `f` ? `תקינה` : `תקין`}`; - } - case `not_multiple_of`: return `מספר לא תקין: חייב להיות מכפלה של ${t.divisor}`; - case `unrecognized_keys`: return `מפתח${t.keys.length > 1 ? `ות` : ``} לא מזוה${t.keys.length > 1 ? `ים` : `ה`}: ${m$10(t.keys, `, `)}`; - case `invalid_key`: return `שדה לא תקין באובייקט`; - case `invalid_union`: return `קלט לא תקין`; - case `invalid_element`: return `ערך לא תקין ב${i(t.origin ?? `array`)}`; - default: return `קלט לא תקין`; - } - }; -}; -function ga$6() { - return { localeError: ha$6() }; -} -const _a$6 = () => { - let e = { - string: { - unit: `znakova`, - verb: `imati` - }, - file: { - unit: `bajtova`, - verb: `imati` - }, - array: { - unit: `stavki`, - verb: `imati` - }, - set: { - unit: `stavki`, - verb: `imati` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `unos`, - email: `email adresa`, - url: `URL`, - emoji: `emoji`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `ISO datum i vrijeme`, - date: `ISO datum`, - time: `ISO vrijeme`, - duration: `ISO trajanje`, - ipv4: `IPv4 adresa`, - ipv6: `IPv6 adresa`, - cidrv4: `IPv4 raspon`, - cidrv6: `IPv6 raspon`, - base64: `base64 kodirani tekst`, - base64url: `base64url kodirani tekst`, - json_string: `JSON tekst`, - e164: `E.164 broj`, - jwt: `JWT`, - template_literal: `unos` - }, r = { - nan: `NaN`, - string: `tekst`, - number: `broj`, - boolean: `boolean`, - array: `niz`, - object: `objekt`, - set: `skup`, - file: `datoteka`, - date: `datum`, - bigint: `bigint`, - symbol: `simbol`, - undefined: `undefined`, - null: `null`, - function: `funkcija`, - map: `mapa` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = A$12(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `Neispravan unos: očekuje se instanceof ${e.expected}, a primljeno je ${i}` : `Neispravan unos: očekuje se ${t}, a primljeno je ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `Neispravna vrijednost: očekivano ${T$14(e.values[0])}` : `Neispravna opcija: očekivano jedno od ${m$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, i = t(e.origin), a = r[e.origin] ?? e.origin; - return i ? `Preveliko: očekivano da ${a ?? `vrijednost`} ima ${n}${e.maximum.toString()} ${i.unit ?? `elemenata`}` : `Preveliko: očekivano da ${a ?? `vrijednost`} bude ${n}${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, i = t(e.origin), a = r[e.origin] ?? e.origin; - return i ? `Premalo: očekivano da ${a} ima ${n}${e.minimum.toString()} ${i.unit}` : `Premalo: očekivano da ${a} bude ${n}${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `Neispravan tekst: mora započinjati s "${t.prefix}"` : t.format === `ends_with` ? `Neispravan tekst: mora završavati s "${t.suffix}"` : t.format === `includes` ? `Neispravan tekst: mora sadržavati "${t.includes}"` : t.format === `regex` ? `Neispravan tekst: mora odgovarati uzorku ${t.pattern}` : `Neispravna ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `Neispravan broj: mora biti višekratnik od ${e.divisor}`; - case `unrecognized_keys`: return `Neprepoznat${e.keys.length > 1 ? `i ključevi` : ` ključ`}: ${m$10(e.keys, `, `)}`; - case `invalid_key`: return `Neispravan ključ u ${r[e.origin] ?? e.origin}`; - case `invalid_union`: return `Neispravan unos`; - case `invalid_element`: return `Neispravna vrijednost u ${r[e.origin] ?? e.origin}`; - default: return `Neispravan unos`; - } - }; -}; -function va$6() { - return { localeError: _a$6() }; -} -const ya$6 = () => { - let e = { - string: { - unit: `karakter`, - verb: `legyen` - }, - file: { - unit: `byte`, - verb: `legyen` - }, - array: { - unit: `elem`, - verb: `legyen` - }, - set: { - unit: `elem`, - verb: `legyen` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `bemenet`, - email: `email cím`, - url: `URL`, - emoji: `emoji`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `ISO időbélyeg`, - date: `ISO dátum`, - time: `ISO idő`, - duration: `ISO időintervallum`, - ipv4: `IPv4 cím`, - ipv6: `IPv6 cím`, - cidrv4: `IPv4 tartomány`, - cidrv6: `IPv6 tartomány`, - base64: `base64-kódolt string`, - base64url: `base64url-kódolt string`, - json_string: `JSON string`, - e164: `E.164 szám`, - jwt: `JWT`, - template_literal: `bemenet` - }, r = { - nan: `NaN`, - number: `szám`, - array: `tömb` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = A$12(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `Érvénytelen bemenet: a várt érték instanceof ${e.expected}, a kapott érték ${i}` : `Érvénytelen bemenet: a várt érték ${t}, a kapott érték ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `Érvénytelen bemenet: a várt érték ${T$14(e.values[0])}` : `Érvénytelen opció: valamelyik érték várt ${m$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? `Túl nagy: ${e.origin ?? `érték`} mérete túl nagy ${n}${e.maximum.toString()} ${r.unit ?? `elem`}` : `Túl nagy: a bemeneti érték ${e.origin ?? `érték`} túl nagy: ${n}${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `Túl kicsi: a bemeneti érték ${e.origin} mérete túl kicsi ${n}${e.minimum.toString()} ${r.unit}` : `Túl kicsi: a bemeneti érték ${e.origin} túl kicsi ${n}${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `Érvénytelen string: "${t.prefix}" értékkel kell kezdődnie` : t.format === `ends_with` ? `Érvénytelen string: "${t.suffix}" értékkel kell végződnie` : t.format === `includes` ? `Érvénytelen string: "${t.includes}" értéket kell tartalmaznia` : t.format === `regex` ? `Érvénytelen string: ${t.pattern} mintának kell megfelelnie` : `Érvénytelen ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `Érvénytelen szám: ${e.divisor} többszörösének kell lennie`; - case `unrecognized_keys`: return `Ismeretlen kulcs${e.keys.length > 1 ? `s` : ``}: ${m$10(e.keys, `, `)}`; - case `invalid_key`: return `Érvénytelen kulcs ${e.origin}`; - case `invalid_union`: return `Érvénytelen bemenet`; - case `invalid_element`: return `Érvénytelen érték: ${e.origin}`; - default: return `Érvénytelen bemenet`; - } - }; -}; -function ba$6() { - return { localeError: ya$6() }; -} -function xa$6(e, t, n) { - return Math.abs(e) === 1 ? t : n; -} -function W$9(e) { - if (!e) return ``; - let t = [ - `ա`, - `ե`, - `ը`, - `ի`, - `ո`, - `ու`, - `օ` - ], n = e[e.length - 1]; - return e + (t.includes(n) ? `ն` : `ը`); -} -const Sa$6 = () => { - let e = { - string: { - unit: { - one: `նշան`, - many: `նշաններ` - }, - verb: `ունենալ` - }, - file: { - unit: { - one: `բայթ`, - many: `բայթեր` - }, - verb: `ունենալ` - }, - array: { - unit: { - one: `տարր`, - many: `տարրեր` - }, - verb: `ունենալ` - }, - set: { - unit: { - one: `տարր`, - many: `տարրեր` - }, - verb: `ունենալ` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `մուտք`, - email: `էլ. հասցե`, - url: `URL`, - emoji: `էմոջի`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `ISO ամսաթիվ և ժամ`, - date: `ISO ամսաթիվ`, - time: `ISO ժամ`, - duration: `ISO տևողություն`, - ipv4: `IPv4 հասցե`, - ipv6: `IPv6 հասցե`, - cidrv4: `IPv4 միջակայք`, - cidrv6: `IPv6 միջակայք`, - base64: `base64 ձևաչափով տող`, - base64url: `base64url ձևաչափով տող`, - json_string: `JSON տող`, - e164: `E.164 համար`, - jwt: `JWT`, - template_literal: `մուտք` - }, r = { - nan: `NaN`, - number: `թիվ`, - array: `զանգված` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = A$12(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `Սխալ մուտքագրում․ սպասվում էր instanceof ${e.expected}, ստացվել է ${i}` : `Սխալ մուտքագրում․ սպասվում էր ${t}, ստացվել է ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `Սխալ մուտքագրում․ սպասվում էր ${T$14(e.values[1])}` : `Սխալ տարբերակ․ սպասվում էր հետևյալներից մեկը՝ ${m$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - if (r) { - let t = xa$6(Number(e.maximum), r.unit.one, r.unit.many); - return `Չափազանց մեծ արժեք․ սպասվում է, որ ${W$9(e.origin ?? `արժեք`)} կունենա ${n}${e.maximum.toString()} ${t}`; - } - return `Չափազանց մեծ արժեք․ սպասվում է, որ ${W$9(e.origin ?? `արժեք`)} լինի ${n}${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - if (r) { - let t = xa$6(Number(e.minimum), r.unit.one, r.unit.many); - return `Չափազանց փոքր արժեք․ սպասվում է, որ ${W$9(e.origin)} կունենա ${n}${e.minimum.toString()} ${t}`; - } - return `Չափազանց փոքր արժեք․ սպասվում է, որ ${W$9(e.origin)} լինի ${n}${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `Սխալ տող․ պետք է սկսվի "${t.prefix}"-ով` : t.format === `ends_with` ? `Սխալ տող․ պետք է ավարտվի "${t.suffix}"-ով` : t.format === `includes` ? `Սխալ տող․ պետք է պարունակի "${t.includes}"` : t.format === `regex` ? `Սխալ տող․ պետք է համապատասխանի ${t.pattern} ձևաչափին` : `Սխալ ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `Սխալ թիվ․ պետք է բազմապատիկ լինի ${e.divisor}-ի`; - case `unrecognized_keys`: return `Չճանաչված բանալի${e.keys.length > 1 ? `ներ` : ``}. ${m$10(e.keys, `, `)}`; - case `invalid_key`: return `Սխալ բանալի ${W$9(e.origin)}-ում`; - case `invalid_union`: return `Սխալ մուտքագրում`; - case `invalid_element`: return `Սխալ արժեք ${W$9(e.origin)}-ում`; - default: return `Սխալ մուտքագրում`; - } - }; -}; -function Ca$6() { - return { localeError: Sa$6() }; -} -const wa$6 = () => { - let e = { - string: { - unit: `karakter`, - verb: `memiliki` - }, - file: { - unit: `byte`, - verb: `memiliki` - }, - array: { - unit: `item`, - verb: `memiliki` - }, - set: { - unit: `item`, - verb: `memiliki` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `input`, - email: `alamat email`, - url: `URL`, - emoji: `emoji`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `tanggal dan waktu format ISO`, - date: `tanggal format ISO`, - time: `jam format ISO`, - duration: `durasi format ISO`, - ipv4: `alamat IPv4`, - ipv6: `alamat IPv6`, - cidrv4: `rentang alamat IPv4`, - cidrv6: `rentang alamat IPv6`, - base64: `string dengan enkode base64`, - base64url: `string dengan enkode base64url`, - json_string: `string JSON`, - e164: `angka E.164`, - jwt: `JWT`, - template_literal: `input` - }, r = { nan: `NaN` }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = A$12(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `Input tidak valid: diharapkan instanceof ${e.expected}, diterima ${i}` : `Input tidak valid: diharapkan ${t}, diterima ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `Input tidak valid: diharapkan ${T$14(e.values[0])}` : `Pilihan tidak valid: diharapkan salah satu dari ${m$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? `Terlalu besar: diharapkan ${e.origin ?? `value`} memiliki ${n}${e.maximum.toString()} ${r.unit ?? `elemen`}` : `Terlalu besar: diharapkan ${e.origin ?? `value`} menjadi ${n}${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `Terlalu kecil: diharapkan ${e.origin} memiliki ${n}${e.minimum.toString()} ${r.unit}` : `Terlalu kecil: diharapkan ${e.origin} menjadi ${n}${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `String tidak valid: harus dimulai dengan "${t.prefix}"` : t.format === `ends_with` ? `String tidak valid: harus berakhir dengan "${t.suffix}"` : t.format === `includes` ? `String tidak valid: harus menyertakan "${t.includes}"` : t.format === `regex` ? `String tidak valid: harus sesuai pola ${t.pattern}` : `${n[t.format] ?? e.format} tidak valid`; - } - case `not_multiple_of`: return `Angka tidak valid: harus kelipatan dari ${e.divisor}`; - case `unrecognized_keys`: return `Kunci tidak dikenali ${e.keys.length > 1 ? `s` : ``}: ${m$10(e.keys, `, `)}`; - case `invalid_key`: return `Kunci tidak valid di ${e.origin}`; - case `invalid_union`: return `Input tidak valid`; - case `invalid_element`: return `Nilai tidak valid di ${e.origin}`; - default: return `Input tidak valid`; - } - }; -}; -function Ta$6() { - return { localeError: wa$6() }; -} -const Ea$6 = () => { - let e = { - string: { - unit: `stafi`, - verb: `að hafa` - }, - file: { - unit: `bæti`, - verb: `að hafa` - }, - array: { - unit: `hluti`, - verb: `að hafa` - }, - set: { - unit: `hluti`, - verb: `að hafa` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `gildi`, - email: `netfang`, - url: `vefslóð`, - emoji: `emoji`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `ISO dagsetning og tími`, - date: `ISO dagsetning`, - time: `ISO tími`, - duration: `ISO tímalengd`, - ipv4: `IPv4 address`, - ipv6: `IPv6 address`, - cidrv4: `IPv4 range`, - cidrv6: `IPv6 range`, - base64: `base64-encoded strengur`, - base64url: `base64url-encoded strengur`, - json_string: `JSON strengur`, - e164: `E.164 tölugildi`, - jwt: `JWT`, - template_literal: `gildi` - }, r = { - nan: `NaN`, - number: `númer`, - array: `fylki` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = A$12(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `Rangt gildi: Þú slóst inn ${i} þar sem á að vera instanceof ${e.expected}` : `Rangt gildi: Þú slóst inn ${i} þar sem á að vera ${t}`; - } - case `invalid_value`: return e.values.length === 1 ? `Rangt gildi: gert ráð fyrir ${T$14(e.values[0])}` : `Ógilt val: má vera eitt af eftirfarandi ${m$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? `Of stórt: gert er ráð fyrir að ${e.origin ?? `gildi`} hafi ${n}${e.maximum.toString()} ${r.unit ?? `hluti`}` : `Of stórt: gert er ráð fyrir að ${e.origin ?? `gildi`} sé ${n}${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `Of lítið: gert er ráð fyrir að ${e.origin} hafi ${n}${e.minimum.toString()} ${r.unit}` : `Of lítið: gert er ráð fyrir að ${e.origin} sé ${n}${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `Ógildur strengur: verður að byrja á "${t.prefix}"` : t.format === `ends_with` ? `Ógildur strengur: verður að enda á "${t.suffix}"` : t.format === `includes` ? `Ógildur strengur: verður að innihalda "${t.includes}"` : t.format === `regex` ? `Ógildur strengur: verður að fylgja mynstri ${t.pattern}` : `Rangt ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `Röng tala: verður að vera margfeldi af ${e.divisor}`; - case `unrecognized_keys`: return `Óþekkt ${e.keys.length > 1 ? `ir lyklar` : `ur lykill`}: ${m$10(e.keys, `, `)}`; - case `invalid_key`: return `Rangur lykill í ${e.origin}`; - case `invalid_union`: return `Rangt gildi`; - case `invalid_element`: return `Rangt gildi í ${e.origin}`; - default: return `Rangt gildi`; - } - }; -}; -function Da$6() { - return { localeError: Ea$6() }; -} -const Oa$6 = () => { - let e = { - string: { - unit: `caratteri`, - verb: `avere` - }, - file: { - unit: `byte`, - verb: `avere` - }, - array: { - unit: `elementi`, - verb: `avere` - }, - set: { - unit: `elementi`, - verb: `avere` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `input`, - email: `indirizzo email`, - url: `URL`, - emoji: `emoji`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `data e ora ISO`, - date: `data ISO`, - time: `ora ISO`, - duration: `durata ISO`, - ipv4: `indirizzo IPv4`, - ipv6: `indirizzo IPv6`, - cidrv4: `intervallo IPv4`, - cidrv6: `intervallo IPv6`, - base64: `stringa codificata in base64`, - base64url: `URL codificata in base64`, - json_string: `stringa JSON`, - e164: `numero E.164`, - jwt: `JWT`, - template_literal: `input` - }, r = { - nan: `NaN`, - number: `numero`, - array: `vettore` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = A$12(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `Input non valido: atteso instanceof ${e.expected}, ricevuto ${i}` : `Input non valido: atteso ${t}, ricevuto ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `Input non valido: atteso ${T$14(e.values[0])}` : `Opzione non valida: atteso uno tra ${m$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? `Troppo grande: ${e.origin ?? `valore`} deve avere ${n}${e.maximum.toString()} ${r.unit ?? `elementi`}` : `Troppo grande: ${e.origin ?? `valore`} deve essere ${n}${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `Troppo piccolo: ${e.origin} deve avere ${n}${e.minimum.toString()} ${r.unit}` : `Troppo piccolo: ${e.origin} deve essere ${n}${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `Stringa non valida: deve iniziare con "${t.prefix}"` : t.format === `ends_with` ? `Stringa non valida: deve terminare con "${t.suffix}"` : t.format === `includes` ? `Stringa non valida: deve includere "${t.includes}"` : t.format === `regex` ? `Stringa non valida: deve corrispondere al pattern ${t.pattern}` : `Input non valido: ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `Numero non valido: deve essere un multiplo di ${e.divisor}`; - case `unrecognized_keys`: return `Chiav${e.keys.length > 1 ? `i` : `e`} non riconosciut${e.keys.length > 1 ? `e` : `a`}: ${m$10(e.keys, `, `)}`; - case `invalid_key`: return `Chiave non valida in ${e.origin}`; - case `invalid_union`: return `Input non valido`; - case `invalid_element`: return `Valore non valido in ${e.origin}`; - default: return `Input non valido`; - } - }; -}; -function ka$6() { - return { localeError: Oa$6() }; -} -const Aa$6 = () => { - let e = { - string: { - unit: `文字`, - verb: `である` - }, - file: { - unit: `バイト`, - verb: `である` - }, - array: { - unit: `要素`, - verb: `である` - }, - set: { - unit: `要素`, - verb: `である` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `入力値`, - email: `メールアドレス`, - url: `URL`, - emoji: `絵文字`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `ISO日時`, - date: `ISO日付`, - time: `ISO時刻`, - duration: `ISO期間`, - ipv4: `IPv4アドレス`, - ipv6: `IPv6アドレス`, - cidrv4: `IPv4範囲`, - cidrv6: `IPv6範囲`, - base64: `base64エンコード文字列`, - base64url: `base64urlエンコード文字列`, - json_string: `JSON文字列`, - e164: `E.164番号`, - jwt: `JWT`, - template_literal: `入力値` - }, r = { - nan: `NaN`, - number: `数値`, - array: `配列` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = A$12(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `無効な入力: instanceof ${e.expected}が期待されましたが、${i}が入力されました` : `無効な入力: ${t}が期待されましたが、${i}が入力されました`; - } - case `invalid_value`: return e.values.length === 1 ? `無効な入力: ${T$14(e.values[0])}が期待されました` : `無効な選択: ${m$10(e.values, `、`)}のいずれかである必要があります`; - case `too_big`: { - let n = e.inclusive ? `以下である` : `より小さい`, r = t(e.origin); - return r ? `大きすぎる値: ${e.origin ?? `値`}は${e.maximum.toString()}${r.unit ?? `要素`}${n}必要があります` : `大きすぎる値: ${e.origin ?? `値`}は${e.maximum.toString()}${n}必要があります`; - } - case `too_small`: { - let n = e.inclusive ? `以上である` : `より大きい`, r = t(e.origin); - return r ? `小さすぎる値: ${e.origin}は${e.minimum.toString()}${r.unit}${n}必要があります` : `小さすぎる値: ${e.origin}は${e.minimum.toString()}${n}必要があります`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `無効な文字列: "${t.prefix}"で始まる必要があります` : t.format === `ends_with` ? `無効な文字列: "${t.suffix}"で終わる必要があります` : t.format === `includes` ? `無効な文字列: "${t.includes}"を含む必要があります` : t.format === `regex` ? `無効な文字列: パターン${t.pattern}に一致する必要があります` : `無効な${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `無効な数値: ${e.divisor}の倍数である必要があります`; - case `unrecognized_keys`: return `認識されていないキー${e.keys.length > 1 ? `群` : ``}: ${m$10(e.keys, `、`)}`; - case `invalid_key`: return `${e.origin}内の無効なキー`; - case `invalid_union`: return `無効な入力`; - case `invalid_element`: return `${e.origin}内の無効な値`; - default: return `無効な入力`; - } - }; -}; -function ja$6() { - return { localeError: Aa$6() }; -} -const Ma$6 = () => { - let e = { - string: { - unit: `სიმბოლო`, - verb: `უნდა შეიცავდეს` - }, - file: { - unit: `ბაიტი`, - verb: `უნდა შეიცავდეს` - }, - array: { - unit: `ელემენტი`, - verb: `უნდა შეიცავდეს` - }, - set: { - unit: `ელემენტი`, - verb: `უნდა შეიცავდეს` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `შეყვანა`, - email: `ელ-ფოსტის მისამართი`, - url: `URL`, - emoji: `ემოჯი`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `თარიღი-დრო`, - date: `თარიღი`, - time: `დრო`, - duration: `ხანგრძლივობა`, - ipv4: `IPv4 მისამართი`, - ipv6: `IPv6 მისამართი`, - cidrv4: `IPv4 დიაპაზონი`, - cidrv6: `IPv6 დიაპაზონი`, - base64: `base64-კოდირებული ველი`, - base64url: `base64url-კოდირებული ველი`, - json_string: `JSON ველი`, - e164: `E.164 ნომერი`, - jwt: `JWT`, - template_literal: `შეყვანა` - }, r = { - nan: `NaN`, - number: `რიცხვი`, - string: `ველი`, - boolean: `ბულეანი`, - function: `ფუნქცია`, - array: `მასივი` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = A$12(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `არასწორი შეყვანა: მოსალოდნელი instanceof ${e.expected}, მიღებული ${i}` : `არასწორი შეყვანა: მოსალოდნელი ${t}, მიღებული ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `არასწორი შეყვანა: მოსალოდნელი ${T$14(e.values[0])}` : `არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${m$10(e.values, `|`)}-დან`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? `ზედმეტად დიდი: მოსალოდნელი ${e.origin ?? `მნიშვნელობა`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit}` : `ზედმეტად დიდი: მოსალოდნელი ${e.origin ?? `მნიშვნელობა`} იყოს ${n}${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `ზედმეტად პატარა: მოსალოდნელი ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}` : `ზედმეტად პატარა: მოსალოდნელი ${e.origin} იყოს ${n}${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `არასწორი ველი: უნდა იწყებოდეს "${t.prefix}"-ით` : t.format === `ends_with` ? `არასწორი ველი: უნდა მთავრდებოდეს "${t.suffix}"-ით` : t.format === `includes` ? `არასწორი ველი: უნდა შეიცავდეს "${t.includes}"-ს` : t.format === `regex` ? `არასწორი ველი: უნდა შეესაბამებოდეს შაბლონს ${t.pattern}` : `არასწორი ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `არასწორი რიცხვი: უნდა იყოს ${e.divisor}-ის ჯერადი`; - case `unrecognized_keys`: return `უცნობი გასაღებ${e.keys.length > 1 ? `ები` : `ი`}: ${m$10(e.keys, `, `)}`; - case `invalid_key`: return `არასწორი გასაღები ${e.origin}-ში`; - case `invalid_union`: return `არასწორი შეყვანა`; - case `invalid_element`: return `არასწორი მნიშვნელობა ${e.origin}-ში`; - default: return `არასწორი შეყვანა`; - } - }; -}; -function Na$6() { - return { localeError: Ma$6() }; -} -const Pa$6 = () => { - let e = { - string: { - unit: `តួអក្សរ`, - verb: `គួរមាន` - }, - file: { - unit: `បៃ`, - verb: `គួរមាន` - }, - array: { - unit: `ធាតុ`, - verb: `គួរមាន` - }, - set: { - unit: `ធាតុ`, - verb: `គួរមាន` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `ទិន្នន័យបញ្ចូល`, - email: `អាសយដ្ឋានអ៊ីមែល`, - url: `URL`, - emoji: `សញ្ញាអារម្មណ៍`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `កាលបរិច្ឆេទ និងម៉ោង ISO`, - date: `កាលបរិច្ឆេទ ISO`, - time: `ម៉ោង ISO`, - duration: `រយៈពេល ISO`, - ipv4: `អាសយដ្ឋាន IPv4`, - ipv6: `អាសយដ្ឋាន IPv6`, - cidrv4: `ដែនអាសយដ្ឋាន IPv4`, - cidrv6: `ដែនអាសយដ្ឋាន IPv6`, - base64: `ខ្សែអក្សរអ៊ិកូដ base64`, - base64url: `ខ្សែអក្សរអ៊ិកូដ base64url`, - json_string: `ខ្សែអក្សរ JSON`, - e164: `លេខ E.164`, - jwt: `JWT`, - template_literal: `ទិន្នន័យបញ្ចូល` - }, r = { - nan: `NaN`, - number: `លេខ`, - array: `អារេ (Array)`, - null: `គ្មានតម្លៃ (null)` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = A$12(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ instanceof ${e.expected} ប៉ុន្តែទទួលបាន ${i}` : `ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${t} ប៉ុន្តែទទួលបាន ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${T$14(e.values[0])}` : `ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${m$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? `ធំពេក៖ ត្រូវការ ${e.origin ?? `តម្លៃ`} ${n} ${e.maximum.toString()} ${r.unit ?? `ធាតុ`}` : `ធំពេក៖ ត្រូវការ ${e.origin ?? `តម្លៃ`} ${n} ${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `តូចពេក៖ ត្រូវការ ${e.origin} ${n} ${e.minimum.toString()} ${r.unit}` : `តូចពេក៖ ត្រូវការ ${e.origin} ${n} ${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${t.prefix}"` : t.format === `ends_with` ? `ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${t.suffix}"` : t.format === `includes` ? `ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${t.includes}"` : t.format === `regex` ? `ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${t.pattern}` : `មិនត្រឹមត្រូវ៖ ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${e.divisor}`; - case `unrecognized_keys`: return `រកឃើញសោមិនស្គាល់៖ ${m$10(e.keys, `, `)}`; - case `invalid_key`: return `សោមិនត្រឹមត្រូវនៅក្នុង ${e.origin}`; - case `invalid_union`: return `ទិន្នន័យមិនត្រឹមត្រូវ`; - case `invalid_element`: return `ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${e.origin}`; - default: return `ទិន្នន័យមិនត្រឹមត្រូវ`; - } - }; -}; -function Fa$6() { - return { localeError: Pa$6() }; -} -function Ia$6() { - return Fa$6(); -} -const La$6 = () => { - let e = { - string: { - unit: `문자`, - verb: `to have` - }, - file: { - unit: `바이트`, - verb: `to have` - }, - array: { - unit: `개`, - verb: `to have` - }, - set: { - unit: `개`, - verb: `to have` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `입력`, - email: `이메일 주소`, - url: `URL`, - emoji: `이모지`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `ISO 날짜시간`, - date: `ISO 날짜`, - time: `ISO 시간`, - duration: `ISO 기간`, - ipv4: `IPv4 주소`, - ipv6: `IPv6 주소`, - cidrv4: `IPv4 범위`, - cidrv6: `IPv6 범위`, - base64: `base64 인코딩 문자열`, - base64url: `base64url 인코딩 문자열`, - json_string: `JSON 문자열`, - e164: `E.164 번호`, - jwt: `JWT`, - template_literal: `입력` - }, r = { nan: `NaN` }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = A$12(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `잘못된 입력: 예상 타입은 instanceof ${e.expected}, 받은 타입은 ${i}입니다` : `잘못된 입력: 예상 타입은 ${t}, 받은 타입은 ${i}입니다`; - } - case `invalid_value`: return e.values.length === 1 ? `잘못된 입력: 값은 ${T$14(e.values[0])} 이어야 합니다` : `잘못된 옵션: ${m$10(e.values, `또는 `)} 중 하나여야 합니다`; - case `too_big`: { - let n = e.inclusive ? `이하` : `미만`, r = n === `미만` ? `이어야 합니다` : `여야 합니다`, i = t(e.origin), a = i?.unit ?? `요소`; - return i ? `${e.origin ?? `값`}이 너무 큽니다: ${e.maximum.toString()}${a} ${n}${r}` : `${e.origin ?? `값`}이 너무 큽니다: ${e.maximum.toString()} ${n}${r}`; - } - case `too_small`: { - let n = e.inclusive ? `이상` : `초과`, r = n === `이상` ? `이어야 합니다` : `여야 합니다`, i = t(e.origin), a = i?.unit ?? `요소`; - return i ? `${e.origin ?? `값`}이 너무 작습니다: ${e.minimum.toString()}${a} ${n}${r}` : `${e.origin ?? `값`}이 너무 작습니다: ${e.minimum.toString()} ${n}${r}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `잘못된 문자열: "${t.prefix}"(으)로 시작해야 합니다` : t.format === `ends_with` ? `잘못된 문자열: "${t.suffix}"(으)로 끝나야 합니다` : t.format === `includes` ? `잘못된 문자열: "${t.includes}"을(를) 포함해야 합니다` : t.format === `regex` ? `잘못된 문자열: 정규식 ${t.pattern} 패턴과 일치해야 합니다` : `잘못된 ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `잘못된 숫자: ${e.divisor}의 배수여야 합니다`; - case `unrecognized_keys`: return `인식할 수 없는 키: ${m$10(e.keys, `, `)}`; - case `invalid_key`: return `잘못된 키: ${e.origin}`; - case `invalid_union`: return `잘못된 입력`; - case `invalid_element`: return `잘못된 값: ${e.origin}`; - default: return `잘못된 입력`; - } - }; -}; -function Ra$6() { - return { localeError: La$6() }; -} -const G$9 = (e) => e.charAt(0).toUpperCase() + e.slice(1); -function za$6(e) { - let t = Math.abs(e), n = t % 10, r = t % 100; - return r >= 11 && r <= 19 || n === 0 ? `many` : n === 1 ? `one` : `few`; -} -const Ba$6 = () => { - let e = { - string: { - unit: { - one: `simbolis`, - few: `simboliai`, - many: `simbolių` - }, - verb: { - smaller: { - inclusive: `turi būti ne ilgesnė kaip`, - notInclusive: `turi būti trumpesnė kaip` - }, - bigger: { - inclusive: `turi būti ne trumpesnė kaip`, - notInclusive: `turi būti ilgesnė kaip` - } - } - }, - file: { - unit: { - one: `baitas`, - few: `baitai`, - many: `baitų` - }, - verb: { - smaller: { - inclusive: `turi būti ne didesnis kaip`, - notInclusive: `turi būti mažesnis kaip` - }, - bigger: { - inclusive: `turi būti ne mažesnis kaip`, - notInclusive: `turi būti didesnis kaip` - } - } - }, - array: { - unit: { - one: `elementą`, - few: `elementus`, - many: `elementų` - }, - verb: { - smaller: { - inclusive: `turi turėti ne daugiau kaip`, - notInclusive: `turi turėti mažiau kaip` - }, - bigger: { - inclusive: `turi turėti ne mažiau kaip`, - notInclusive: `turi turėti daugiau kaip` - } - } - }, - set: { - unit: { - one: `elementą`, - few: `elementus`, - many: `elementų` - }, - verb: { - smaller: { - inclusive: `turi turėti ne daugiau kaip`, - notInclusive: `turi turėti mažiau kaip` - }, - bigger: { - inclusive: `turi turėti ne mažiau kaip`, - notInclusive: `turi turėti daugiau kaip` - } - } - } - }; - function t(t, n, r, i) { - let a = e[t] ?? null; - return a === null ? a : { - unit: a.unit[n], - verb: a.verb[i][r ? `inclusive` : `notInclusive`] - }; - } - let n = { - regex: `įvestis`, - email: `el. pašto adresas`, - url: `URL`, - emoji: `jaustukas`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `ISO data ir laikas`, - date: `ISO data`, - time: `ISO laikas`, - duration: `ISO trukmė`, - ipv4: `IPv4 adresas`, - ipv6: `IPv6 adresas`, - cidrv4: `IPv4 tinklo prefiksas (CIDR)`, - cidrv6: `IPv6 tinklo prefiksas (CIDR)`, - base64: `base64 užkoduota eilutė`, - base64url: `base64url užkoduota eilutė`, - json_string: `JSON eilutė`, - e164: `E.164 numeris`, - jwt: `JWT`, - template_literal: `įvestis` - }, r = { - nan: `NaN`, - number: `skaičius`, - bigint: `sveikasis skaičius`, - string: `eilutė`, - boolean: `loginė reikšmė`, - undefined: `neapibrėžta reikšmė`, - function: `funkcija`, - symbol: `simbolis`, - array: `masyvas`, - object: `objektas`, - null: `nulinė reikšmė` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = A$12(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `Gautas tipas ${i}, o tikėtasi - instanceof ${e.expected}` : `Gautas tipas ${i}, o tikėtasi - ${t}`; - } - case `invalid_value`: return e.values.length === 1 ? `Privalo būti ${T$14(e.values[0])}` : `Privalo būti vienas iš ${m$10(e.values, `|`)} pasirinkimų`; - case `too_big`: { - let n = r[e.origin] ?? e.origin, i = t(e.origin, za$6(Number(e.maximum)), e.inclusive ?? !1, `smaller`); - if (i?.verb) return `${G$9(n ?? e.origin ?? `reikšmė`)} ${i.verb} ${e.maximum.toString()} ${i.unit ?? `elementų`}`; - let a = e.inclusive ? `ne didesnis kaip` : `mažesnis kaip`; - return `${G$9(n ?? e.origin ?? `reikšmė`)} turi būti ${a} ${e.maximum.toString()} ${i?.unit}`; - } - case `too_small`: { - let n = r[e.origin] ?? e.origin, i = t(e.origin, za$6(Number(e.minimum)), e.inclusive ?? !1, `bigger`); - if (i?.verb) return `${G$9(n ?? e.origin ?? `reikšmė`)} ${i.verb} ${e.minimum.toString()} ${i.unit ?? `elementų`}`; - let a = e.inclusive ? `ne mažesnis kaip` : `didesnis kaip`; - return `${G$9(n ?? e.origin ?? `reikšmė`)} turi būti ${a} ${e.minimum.toString()} ${i?.unit}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `Eilutė privalo prasidėti "${t.prefix}"` : t.format === `ends_with` ? `Eilutė privalo pasibaigti "${t.suffix}"` : t.format === `includes` ? `Eilutė privalo įtraukti "${t.includes}"` : t.format === `regex` ? `Eilutė privalo atitikti ${t.pattern}` : `Neteisingas ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `Skaičius privalo būti ${e.divisor} kartotinis.`; - case `unrecognized_keys`: return `Neatpažint${e.keys.length > 1 ? `i` : `as`} rakt${e.keys.length > 1 ? `ai` : `as`}: ${m$10(e.keys, `, `)}`; - case `invalid_key`: return `Rastas klaidingas raktas`; - case `invalid_union`: return `Klaidinga įvestis`; - case `invalid_element`: return `${G$9(r[e.origin] ?? e.origin ?? e.origin ?? `reikšmė`)} turi klaidingą įvestį`; - default: return `Klaidinga įvestis`; - } - }; -}; -function Va$6() { - return { localeError: Ba$6() }; -} -const Ha$6 = () => { - let e = { - string: { - unit: `знаци`, - verb: `да имаат` - }, - file: { - unit: `бајти`, - verb: `да имаат` - }, - array: { - unit: `ставки`, - verb: `да имаат` - }, - set: { - unit: `ставки`, - verb: `да имаат` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `внес`, - email: `адреса на е-пошта`, - url: `URL`, - emoji: `емоџи`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `ISO датум и време`, - date: `ISO датум`, - time: `ISO време`, - duration: `ISO времетраење`, - ipv4: `IPv4 адреса`, - ipv6: `IPv6 адреса`, - cidrv4: `IPv4 опсег`, - cidrv6: `IPv6 опсег`, - base64: `base64-енкодирана низа`, - base64url: `base64url-енкодирана низа`, - json_string: `JSON низа`, - e164: `E.164 број`, - jwt: `JWT`, - template_literal: `внес` - }, r = { - nan: `NaN`, - number: `број`, - array: `низа` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = A$12(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `Грешен внес: се очекува instanceof ${e.expected}, примено ${i}` : `Грешен внес: се очекува ${t}, примено ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `Invalid input: expected ${T$14(e.values[0])}` : `Грешана опција: се очекува една ${m$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? `Премногу голем: се очекува ${e.origin ?? `вредноста`} да има ${n}${e.maximum.toString()} ${r.unit ?? `елементи`}` : `Премногу голем: се очекува ${e.origin ?? `вредноста`} да биде ${n}${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `Премногу мал: се очекува ${e.origin} да има ${n}${e.minimum.toString()} ${r.unit}` : `Премногу мал: се очекува ${e.origin} да биде ${n}${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `Неважечка низа: мора да започнува со "${t.prefix}"` : t.format === `ends_with` ? `Неважечка низа: мора да завршува со "${t.suffix}"` : t.format === `includes` ? `Неважечка низа: мора да вклучува "${t.includes}"` : t.format === `regex` ? `Неважечка низа: мора да одгоара на патернот ${t.pattern}` : `Invalid ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `Грешен број: мора да биде делив со ${e.divisor}`; - case `unrecognized_keys`: return `${e.keys.length > 1 ? `Непрепознаени клучеви` : `Непрепознаен клуч`}: ${m$10(e.keys, `, `)}`; - case `invalid_key`: return `Грешен клуч во ${e.origin}`; - case `invalid_union`: return `Грешен внес`; - case `invalid_element`: return `Грешна вредност во ${e.origin}`; - default: return `Грешен внес`; - } - }; -}; -function Ua$6() { - return { localeError: Ha$6() }; -} -const Wa$6 = () => { - let e = { - string: { - unit: `aksara`, - verb: `mempunyai` - }, - file: { - unit: `bait`, - verb: `mempunyai` - }, - array: { - unit: `elemen`, - verb: `mempunyai` - }, - set: { - unit: `elemen`, - verb: `mempunyai` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `input`, - email: `alamat e-mel`, - url: `URL`, - emoji: `emoji`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `tarikh masa ISO`, - date: `tarikh ISO`, - time: `masa ISO`, - duration: `tempoh ISO`, - ipv4: `alamat IPv4`, - ipv6: `alamat IPv6`, - cidrv4: `julat IPv4`, - cidrv6: `julat IPv6`, - base64: `string dikodkan base64`, - base64url: `string dikodkan base64url`, - json_string: `string JSON`, - e164: `nombor E.164`, - jwt: `JWT`, - template_literal: `input` - }, r = { - nan: `NaN`, - number: `nombor` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = A$12(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `Input tidak sah: dijangka instanceof ${e.expected}, diterima ${i}` : `Input tidak sah: dijangka ${t}, diterima ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `Input tidak sah: dijangka ${T$14(e.values[0])}` : `Pilihan tidak sah: dijangka salah satu daripada ${m$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? `Terlalu besar: dijangka ${e.origin ?? `nilai`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit ?? `elemen`}` : `Terlalu besar: dijangka ${e.origin ?? `nilai`} adalah ${n}${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `Terlalu kecil: dijangka ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}` : `Terlalu kecil: dijangka ${e.origin} adalah ${n}${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `String tidak sah: mesti bermula dengan "${t.prefix}"` : t.format === `ends_with` ? `String tidak sah: mesti berakhir dengan "${t.suffix}"` : t.format === `includes` ? `String tidak sah: mesti mengandungi "${t.includes}"` : t.format === `regex` ? `String tidak sah: mesti sepadan dengan corak ${t.pattern}` : `${n[t.format] ?? e.format} tidak sah`; - } - case `not_multiple_of`: return `Nombor tidak sah: perlu gandaan ${e.divisor}`; - case `unrecognized_keys`: return `Kunci tidak dikenali: ${m$10(e.keys, `, `)}`; - case `invalid_key`: return `Kunci tidak sah dalam ${e.origin}`; - case `invalid_union`: return `Input tidak sah`; - case `invalid_element`: return `Nilai tidak sah dalam ${e.origin}`; - default: return `Input tidak sah`; - } - }; -}; -function Ga$6() { - return { localeError: Wa$6() }; -} -const Ka$6 = () => { - let e = { - string: { - unit: `tekens`, - verb: `heeft` - }, - file: { - unit: `bytes`, - verb: `heeft` - }, - array: { - unit: `elementen`, - verb: `heeft` - }, - set: { - unit: `elementen`, - verb: `heeft` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `invoer`, - email: `emailadres`, - url: `URL`, - emoji: `emoji`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `ISO datum en tijd`, - date: `ISO datum`, - time: `ISO tijd`, - duration: `ISO duur`, - ipv4: `IPv4-adres`, - ipv6: `IPv6-adres`, - cidrv4: `IPv4-bereik`, - cidrv6: `IPv6-bereik`, - base64: `base64-gecodeerde tekst`, - base64url: `base64 URL-gecodeerde tekst`, - json_string: `JSON string`, - e164: `E.164-nummer`, - jwt: `JWT`, - template_literal: `invoer` - }, r = { - nan: `NaN`, - number: `getal` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = A$12(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `Ongeldige invoer: verwacht instanceof ${e.expected}, ontving ${i}` : `Ongeldige invoer: verwacht ${t}, ontving ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `Ongeldige invoer: verwacht ${T$14(e.values[0])}` : `Ongeldige optie: verwacht één van ${m$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin), i = e.origin === `date` ? `laat` : e.origin === `string` ? `lang` : `groot`; - return r ? `Te ${i}: verwacht dat ${e.origin ?? `waarde`} ${n}${e.maximum.toString()} ${r.unit ?? `elementen`} ${r.verb}` : `Te ${i}: verwacht dat ${e.origin ?? `waarde`} ${n}${e.maximum.toString()} is`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin), i = e.origin === `date` ? `vroeg` : e.origin === `string` ? `kort` : `klein`; - return r ? `Te ${i}: verwacht dat ${e.origin} ${n}${e.minimum.toString()} ${r.unit} ${r.verb}` : `Te ${i}: verwacht dat ${e.origin} ${n}${e.minimum.toString()} is`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `Ongeldige tekst: moet met "${t.prefix}" beginnen` : t.format === `ends_with` ? `Ongeldige tekst: moet op "${t.suffix}" eindigen` : t.format === `includes` ? `Ongeldige tekst: moet "${t.includes}" bevatten` : t.format === `regex` ? `Ongeldige tekst: moet overeenkomen met patroon ${t.pattern}` : `Ongeldig: ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `Ongeldig getal: moet een veelvoud van ${e.divisor} zijn`; - case `unrecognized_keys`: return `Onbekende key${e.keys.length > 1 ? `s` : ``}: ${m$10(e.keys, `, `)}`; - case `invalid_key`: return `Ongeldige key in ${e.origin}`; - case `invalid_union`: return `Ongeldige invoer`; - case `invalid_element`: return `Ongeldige waarde in ${e.origin}`; - default: return `Ongeldige invoer`; - } - }; -}; -function qa$6() { - return { localeError: Ka$6() }; -} -const Ja$5 = () => { - let e = { - string: { - unit: `tegn`, - verb: `å ha` - }, - file: { - unit: `bytes`, - verb: `å ha` - }, - array: { - unit: `elementer`, - verb: `å inneholde` - }, - set: { - unit: `elementer`, - verb: `å inneholde` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `input`, - email: `e-postadresse`, - url: `URL`, - emoji: `emoji`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `ISO dato- og klokkeslett`, - date: `ISO-dato`, - time: `ISO-klokkeslett`, - duration: `ISO-varighet`, - ipv4: `IPv4-område`, - ipv6: `IPv6-område`, - cidrv4: `IPv4-spekter`, - cidrv6: `IPv6-spekter`, - base64: `base64-enkodet streng`, - base64url: `base64url-enkodet streng`, - json_string: `JSON-streng`, - e164: `E.164-nummer`, - jwt: `JWT`, - template_literal: `input` - }, r = { - nan: `NaN`, - number: `tall`, - array: `liste` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = A$12(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `Ugyldig input: forventet instanceof ${e.expected}, fikk ${i}` : `Ugyldig input: forventet ${t}, fikk ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `Ugyldig verdi: forventet ${T$14(e.values[0])}` : `Ugyldig valg: forventet en av ${m$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? `For stor(t): forventet ${e.origin ?? `value`} til å ha ${n}${e.maximum.toString()} ${r.unit ?? `elementer`}` : `For stor(t): forventet ${e.origin ?? `value`} til å ha ${n}${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `For lite(n): forventet ${e.origin} til å ha ${n}${e.minimum.toString()} ${r.unit}` : `For lite(n): forventet ${e.origin} til å ha ${n}${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `Ugyldig streng: må starte med "${t.prefix}"` : t.format === `ends_with` ? `Ugyldig streng: må ende med "${t.suffix}"` : t.format === `includes` ? `Ugyldig streng: må inneholde "${t.includes}"` : t.format === `regex` ? `Ugyldig streng: må matche mønsteret ${t.pattern}` : `Ugyldig ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `Ugyldig tall: må være et multiplum av ${e.divisor}`; - case `unrecognized_keys`: return `${e.keys.length > 1 ? `Ukjente nøkler` : `Ukjent nøkkel`}: ${m$10(e.keys, `, `)}`; - case `invalid_key`: return `Ugyldig nøkkel i ${e.origin}`; - case `invalid_union`: return `Ugyldig input`; - case `invalid_element`: return `Ugyldig verdi i ${e.origin}`; - default: return `Ugyldig input`; - } - }; -}; -function Ya$5() { - return { localeError: Ja$5() }; -} -const Xa$5 = () => { - let e = { - string: { - unit: `harf`, - verb: `olmalıdır` - }, - file: { - unit: `bayt`, - verb: `olmalıdır` - }, - array: { - unit: `unsur`, - verb: `olmalıdır` - }, - set: { - unit: `unsur`, - verb: `olmalıdır` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `giren`, - email: `epostagâh`, - url: `URL`, - emoji: `emoji`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `ISO hengâmı`, - date: `ISO tarihi`, - time: `ISO zamanı`, - duration: `ISO müddeti`, - ipv4: `IPv4 nişânı`, - ipv6: `IPv6 nişânı`, - cidrv4: `IPv4 menzili`, - cidrv6: `IPv6 menzili`, - base64: `base64-şifreli metin`, - base64url: `base64url-şifreli metin`, - json_string: `JSON metin`, - e164: `E.164 sayısı`, - jwt: `JWT`, - template_literal: `giren` - }, r = { - nan: `NaN`, - number: `numara`, - array: `saf`, - null: `gayb` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = A$12(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `Fâsit giren: umulan instanceof ${e.expected}, alınan ${i}` : `Fâsit giren: umulan ${t}, alınan ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `Fâsit giren: umulan ${T$14(e.values[0])}` : `Fâsit tercih: mûteberler ${m$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? `Fazla büyük: ${e.origin ?? `value`}, ${n}${e.maximum.toString()} ${r.unit ?? `elements`} sahip olmalıydı.` : `Fazla büyük: ${e.origin ?? `value`}, ${n}${e.maximum.toString()} olmalıydı.`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `Fazla küçük: ${e.origin}, ${n}${e.minimum.toString()} ${r.unit} sahip olmalıydı.` : `Fazla küçük: ${e.origin}, ${n}${e.minimum.toString()} olmalıydı.`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `Fâsit metin: "${t.prefix}" ile başlamalı.` : t.format === `ends_with` ? `Fâsit metin: "${t.suffix}" ile bitmeli.` : t.format === `includes` ? `Fâsit metin: "${t.includes}" ihtivâ etmeli.` : t.format === `regex` ? `Fâsit metin: ${t.pattern} nakşına uymalı.` : `Fâsit ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `Fâsit sayı: ${e.divisor} katı olmalıydı.`; - case `unrecognized_keys`: return `Tanınmayan anahtar ${e.keys.length > 1 ? `s` : ``}: ${m$10(e.keys, `, `)}`; - case `invalid_key`: return `${e.origin} için tanınmayan anahtar var.`; - case `invalid_union`: return `Giren tanınamadı.`; - case `invalid_element`: return `${e.origin} için tanınmayan kıymet var.`; - default: return `Kıymet tanınamadı.`; - } - }; -}; -function Za$5() { - return { localeError: Xa$5() }; -} -const Qa$5 = () => { - let e = { - string: { - unit: `توکي`, - verb: `ولري` - }, - file: { - unit: `بایټس`, - verb: `ولري` - }, - array: { - unit: `توکي`, - verb: `ولري` - }, - set: { - unit: `توکي`, - verb: `ولري` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `ورودي`, - email: `بریښنالیک`, - url: `یو آر ال`, - emoji: `ایموجي`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `نیټه او وخت`, - date: `نېټه`, - time: `وخت`, - duration: `موده`, - ipv4: `د IPv4 پته`, - ipv6: `د IPv6 پته`, - cidrv4: `د IPv4 ساحه`, - cidrv6: `د IPv6 ساحه`, - base64: `base64-encoded متن`, - base64url: `base64url-encoded متن`, - json_string: `JSON متن`, - e164: `د E.164 شمېره`, - jwt: `JWT`, - template_literal: `ورودي` - }, r = { - nan: `NaN`, - number: `عدد`, - array: `ارې` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = A$12(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `ناسم ورودي: باید instanceof ${e.expected} وای, مګر ${i} ترلاسه شو` : `ناسم ورودي: باید ${t} وای, مګر ${i} ترلاسه شو`; - } - case `invalid_value`: return e.values.length === 1 ? `ناسم ورودي: باید ${T$14(e.values[0])} وای` : `ناسم انتخاب: باید یو له ${m$10(e.values, `|`)} څخه وای`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? `ډیر لوی: ${e.origin ?? `ارزښت`} باید ${n}${e.maximum.toString()} ${r.unit ?? `عنصرونه`} ولري` : `ډیر لوی: ${e.origin ?? `ارزښت`} باید ${n}${e.maximum.toString()} وي`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `ډیر کوچنی: ${e.origin} باید ${n}${e.minimum.toString()} ${r.unit} ولري` : `ډیر کوچنی: ${e.origin} باید ${n}${e.minimum.toString()} وي`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `ناسم متن: باید د "${t.prefix}" سره پیل شي` : t.format === `ends_with` ? `ناسم متن: باید د "${t.suffix}" سره پای ته ورسيږي` : t.format === `includes` ? `ناسم متن: باید "${t.includes}" ولري` : t.format === `regex` ? `ناسم متن: باید د ${t.pattern} سره مطابقت ولري` : `${n[t.format] ?? e.format} ناسم دی`; - } - case `not_multiple_of`: return `ناسم عدد: باید د ${e.divisor} مضرب وي`; - case `unrecognized_keys`: return `ناسم ${e.keys.length > 1 ? `کلیډونه` : `کلیډ`}: ${m$10(e.keys, `, `)}`; - case `invalid_key`: return `ناسم کلیډ په ${e.origin} کې`; - case `invalid_union`: return `ناسمه ورودي`; - case `invalid_element`: return `ناسم عنصر په ${e.origin} کې`; - default: return `ناسمه ورودي`; - } - }; -}; -function $a$5() { - return { localeError: Qa$5() }; -} -const eo$5 = () => { - let e = { - string: { - unit: `znaków`, - verb: `mieć` - }, - file: { - unit: `bajtów`, - verb: `mieć` - }, - array: { - unit: `elementów`, - verb: `mieć` - }, - set: { - unit: `elementów`, - verb: `mieć` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `wyrażenie`, - email: `adres email`, - url: `URL`, - emoji: `emoji`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `data i godzina w formacie ISO`, - date: `data w formacie ISO`, - time: `godzina w formacie ISO`, - duration: `czas trwania ISO`, - ipv4: `adres IPv4`, - ipv6: `adres IPv6`, - cidrv4: `zakres IPv4`, - cidrv6: `zakres IPv6`, - base64: `ciąg znaków zakodowany w formacie base64`, - base64url: `ciąg znaków zakodowany w formacie base64url`, - json_string: `ciąg znaków w formacie JSON`, - e164: `liczba E.164`, - jwt: `JWT`, - template_literal: `wejście` - }, r = { - nan: `NaN`, - number: `liczba`, - array: `tablica` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = A$12(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `Nieprawidłowe dane wejściowe: oczekiwano instanceof ${e.expected}, otrzymano ${i}` : `Nieprawidłowe dane wejściowe: oczekiwano ${t}, otrzymano ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `Nieprawidłowe dane wejściowe: oczekiwano ${T$14(e.values[0])}` : `Nieprawidłowa opcja: oczekiwano jednej z wartości ${m$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? `Za duża wartość: oczekiwano, że ${e.origin ?? `wartość`} będzie mieć ${n}${e.maximum.toString()} ${r.unit ?? `elementów`}` : `Zbyt duż(y/a/e): oczekiwano, że ${e.origin ?? `wartość`} będzie wynosić ${n}${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `Za mała wartość: oczekiwano, że ${e.origin ?? `wartość`} będzie mieć ${n}${e.minimum.toString()} ${r.unit ?? `elementów`}` : `Zbyt mał(y/a/e): oczekiwano, że ${e.origin ?? `wartość`} będzie wynosić ${n}${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `Nieprawidłowy ciąg znaków: musi zaczynać się od "${t.prefix}"` : t.format === `ends_with` ? `Nieprawidłowy ciąg znaków: musi kończyć się na "${t.suffix}"` : t.format === `includes` ? `Nieprawidłowy ciąg znaków: musi zawierać "${t.includes}"` : t.format === `regex` ? `Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${t.pattern}` : `Nieprawidłow(y/a/e) ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `Nieprawidłowa liczba: musi być wielokrotnością ${e.divisor}`; - case `unrecognized_keys`: return `Nierozpoznane klucze${e.keys.length > 1 ? `s` : ``}: ${m$10(e.keys, `, `)}`; - case `invalid_key`: return `Nieprawidłowy klucz w ${e.origin}`; - case `invalid_union`: return `Nieprawidłowe dane wejściowe`; - case `invalid_element`: return `Nieprawidłowa wartość w ${e.origin}`; - default: return `Nieprawidłowe dane wejściowe`; - } - }; -}; -function to$5() { - return { localeError: eo$5() }; -} -const no$4 = () => { - let e = { - string: { - unit: `caracteres`, - verb: `ter` - }, - file: { - unit: `bytes`, - verb: `ter` - }, - array: { - unit: `itens`, - verb: `ter` - }, - set: { - unit: `itens`, - verb: `ter` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `padrão`, - email: `endereço de e-mail`, - url: `URL`, - emoji: `emoji`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `data e hora ISO`, - date: `data ISO`, - time: `hora ISO`, - duration: `duração ISO`, - ipv4: `endereço IPv4`, - ipv6: `endereço IPv6`, - cidrv4: `faixa de IPv4`, - cidrv6: `faixa de IPv6`, - base64: `texto codificado em base64`, - base64url: `URL codificada em base64`, - json_string: `texto JSON`, - e164: `número E.164`, - jwt: `JWT`, - template_literal: `entrada` - }, r = { - nan: `NaN`, - number: `número`, - null: `nulo` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = A$12(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `Tipo inválido: esperado instanceof ${e.expected}, recebido ${i}` : `Tipo inválido: esperado ${t}, recebido ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `Entrada inválida: esperado ${T$14(e.values[0])}` : `Opção inválida: esperada uma das ${m$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? `Muito grande: esperado que ${e.origin ?? `valor`} tivesse ${n}${e.maximum.toString()} ${r.unit ?? `elementos`}` : `Muito grande: esperado que ${e.origin ?? `valor`} fosse ${n}${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `Muito pequeno: esperado que ${e.origin} tivesse ${n}${e.minimum.toString()} ${r.unit}` : `Muito pequeno: esperado que ${e.origin} fosse ${n}${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `Texto inválido: deve começar com "${t.prefix}"` : t.format === `ends_with` ? `Texto inválido: deve terminar com "${t.suffix}"` : t.format === `includes` ? `Texto inválido: deve incluir "${t.includes}"` : t.format === `regex` ? `Texto inválido: deve corresponder ao padrão ${t.pattern}` : `${n[t.format] ?? e.format} inválido`; - } - case `not_multiple_of`: return `Número inválido: deve ser múltiplo de ${e.divisor}`; - case `unrecognized_keys`: return `Chave${e.keys.length > 1 ? `s` : ``} desconhecida${e.keys.length > 1 ? `s` : ``}: ${m$10(e.keys, `, `)}`; - case `invalid_key`: return `Chave inválida em ${e.origin}`; - case `invalid_union`: return `Entrada inválida`; - case `invalid_element`: return `Valor inválido em ${e.origin}`; - default: return `Campo inválido`; - } - }; -}; -function ro$4() { - return { localeError: no$4() }; -} -const io$4 = () => { - let e = { - string: { - unit: `caractere`, - verb: `să aibă` - }, - file: { - unit: `octeți`, - verb: `să aibă` - }, - array: { - unit: `elemente`, - verb: `să aibă` - }, - set: { - unit: `elemente`, - verb: `să aibă` - }, - map: { - unit: `intrări`, - verb: `să aibă` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `intrare`, - email: `adresă de email`, - url: `URL`, - emoji: `emoji`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `dată și oră ISO`, - date: `dată ISO`, - time: `oră ISO`, - duration: `durată ISO`, - ipv4: `adresă IPv4`, - ipv6: `adresă IPv6`, - mac: `adresă MAC`, - cidrv4: `interval IPv4`, - cidrv6: `interval IPv6`, - base64: `șir codat base64`, - base64url: `șir codat base64url`, - json_string: `șir JSON`, - e164: `număr E.164`, - jwt: `JWT`, - template_literal: `intrare` - }, r = { - nan: `NaN`, - string: `șir`, - number: `număr`, - boolean: `boolean`, - function: `funcție`, - array: `matrice`, - object: `obiect`, - undefined: `nedefinit`, - symbol: `simbol`, - bigint: `număr mare`, - void: `void`, - never: `never`, - map: `hartă`, - set: `set` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = A$12(e.input); - return `Intrare invalidă: așteptat ${t}, primit ${r[n] ?? n}`; - } - case `invalid_value`: return e.values.length === 1 ? `Intrare invalidă: așteptat ${T$14(e.values[0])}` : `Opțiune invalidă: așteptat una dintre ${m$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? `Prea mare: așteptat ca ${e.origin ?? `valoarea`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit ?? `elemente`}` : `Prea mare: așteptat ca ${e.origin ?? `valoarea`} să fie ${n}${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `Prea mic: așteptat ca ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}` : `Prea mic: așteptat ca ${e.origin} să fie ${n}${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `Șir invalid: trebuie să înceapă cu "${t.prefix}"` : t.format === `ends_with` ? `Șir invalid: trebuie să se termine cu "${t.suffix}"` : t.format === `includes` ? `Șir invalid: trebuie să includă "${t.includes}"` : t.format === `regex` ? `Șir invalid: trebuie să se potrivească cu modelul ${t.pattern}` : `Format invalid: ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `Număr invalid: trebuie să fie multiplu de ${e.divisor}`; - case `unrecognized_keys`: return `Chei nerecunoscute: ${m$10(e.keys, `, `)}`; - case `invalid_key`: return `Cheie invalidă în ${e.origin}`; - case `invalid_union`: return `Intrare invalidă`; - case `invalid_element`: return `Valoare invalidă în ${e.origin}`; - default: return `Intrare invalidă`; - } - }; -}; -function ao$4() { - return { localeError: io$4() }; -} -function oo$4(e, t, n, r) { - let i = Math.abs(e), a = i % 10, o = i % 100; - return o >= 11 && o <= 19 ? r : a === 1 ? t : a >= 2 && a <= 4 ? n : r; -} -const so$4 = () => { - let e = { - string: { - unit: { - one: `символ`, - few: `символа`, - many: `символов` - }, - verb: `иметь` - }, - file: { - unit: { - one: `байт`, - few: `байта`, - many: `байт` - }, - verb: `иметь` - }, - array: { - unit: { - one: `элемент`, - few: `элемента`, - many: `элементов` - }, - verb: `иметь` - }, - set: { - unit: { - one: `элемент`, - few: `элемента`, - many: `элементов` - }, - verb: `иметь` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `ввод`, - email: `email адрес`, - url: `URL`, - emoji: `эмодзи`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `ISO дата и время`, - date: `ISO дата`, - time: `ISO время`, - duration: `ISO длительность`, - ipv4: `IPv4 адрес`, - ipv6: `IPv6 адрес`, - cidrv4: `IPv4 диапазон`, - cidrv6: `IPv6 диапазон`, - base64: `строка в формате base64`, - base64url: `строка в формате base64url`, - json_string: `JSON строка`, - e164: `номер E.164`, - jwt: `JWT`, - template_literal: `ввод` - }, r = { - nan: `NaN`, - number: `число`, - array: `массив` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = A$12(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `Неверный ввод: ожидалось instanceof ${e.expected}, получено ${i}` : `Неверный ввод: ожидалось ${t}, получено ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `Неверный ввод: ожидалось ${T$14(e.values[0])}` : `Неверный вариант: ожидалось одно из ${m$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - if (r) { - let t = oo$4(Number(e.maximum), r.unit.one, r.unit.few, r.unit.many); - return `Слишком большое значение: ожидалось, что ${e.origin ?? `значение`} будет иметь ${n}${e.maximum.toString()} ${t}`; - } - return `Слишком большое значение: ожидалось, что ${e.origin ?? `значение`} будет ${n}${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - if (r) { - let t = oo$4(Number(e.minimum), r.unit.one, r.unit.few, r.unit.many); - return `Слишком маленькое значение: ожидалось, что ${e.origin} будет иметь ${n}${e.minimum.toString()} ${t}`; - } - return `Слишком маленькое значение: ожидалось, что ${e.origin} будет ${n}${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `Неверная строка: должна начинаться с "${t.prefix}"` : t.format === `ends_with` ? `Неверная строка: должна заканчиваться на "${t.suffix}"` : t.format === `includes` ? `Неверная строка: должна содержать "${t.includes}"` : t.format === `regex` ? `Неверная строка: должна соответствовать шаблону ${t.pattern}` : `Неверный ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `Неверное число: должно быть кратным ${e.divisor}`; - case `unrecognized_keys`: return `Нераспознанн${e.keys.length > 1 ? `ые` : `ый`} ключ${e.keys.length > 1 ? `и` : ``}: ${m$10(e.keys, `, `)}`; - case `invalid_key`: return `Неверный ключ в ${e.origin}`; - case `invalid_union`: return `Неверные входные данные`; - case `invalid_element`: return `Неверное значение в ${e.origin}`; - default: return `Неверные входные данные`; - } - }; -}; -function co$4() { - return { localeError: so$4() }; -} -const lo$4 = () => { - let e = { - string: { - unit: `znakov`, - verb: `imeti` - }, - file: { - unit: `bajtov`, - verb: `imeti` - }, - array: { - unit: `elementov`, - verb: `imeti` - }, - set: { - unit: `elementov`, - verb: `imeti` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `vnos`, - email: `e-poštni naslov`, - url: `URL`, - emoji: `emoji`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `ISO datum in čas`, - date: `ISO datum`, - time: `ISO čas`, - duration: `ISO trajanje`, - ipv4: `IPv4 naslov`, - ipv6: `IPv6 naslov`, - cidrv4: `obseg IPv4`, - cidrv6: `obseg IPv6`, - base64: `base64 kodiran niz`, - base64url: `base64url kodiran niz`, - json_string: `JSON niz`, - e164: `E.164 številka`, - jwt: `JWT`, - template_literal: `vnos` - }, r = { - nan: `NaN`, - number: `število`, - array: `tabela` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = A$12(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `Neveljaven vnos: pričakovano instanceof ${e.expected}, prejeto ${i}` : `Neveljaven vnos: pričakovano ${t}, prejeto ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `Neveljaven vnos: pričakovano ${T$14(e.values[0])}` : `Neveljavna možnost: pričakovano eno izmed ${m$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? `Preveliko: pričakovano, da bo ${e.origin ?? `vrednost`} imelo ${n}${e.maximum.toString()} ${r.unit ?? `elementov`}` : `Preveliko: pričakovano, da bo ${e.origin ?? `vrednost`} ${n}${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `Premajhno: pričakovano, da bo ${e.origin} imelo ${n}${e.minimum.toString()} ${r.unit}` : `Premajhno: pričakovano, da bo ${e.origin} ${n}${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `Neveljaven niz: mora se začeti z "${t.prefix}"` : t.format === `ends_with` ? `Neveljaven niz: mora se končati z "${t.suffix}"` : t.format === `includes` ? `Neveljaven niz: mora vsebovati "${t.includes}"` : t.format === `regex` ? `Neveljaven niz: mora ustrezati vzorcu ${t.pattern}` : `Neveljaven ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `Neveljavno število: mora biti večkratnik ${e.divisor}`; - case `unrecognized_keys`: return `Neprepoznan${e.keys.length > 1 ? `i ključi` : ` ključ`}: ${m$10(e.keys, `, `)}`; - case `invalid_key`: return `Neveljaven ključ v ${e.origin}`; - case `invalid_union`: return `Neveljaven vnos`; - case `invalid_element`: return `Neveljavna vrednost v ${e.origin}`; - default: return `Neveljaven vnos`; - } - }; -}; -function uo$4() { - return { localeError: lo$4() }; -} -const fo$4 = () => { - let e = { - string: { - unit: `tecken`, - verb: `att ha` - }, - file: { - unit: `bytes`, - verb: `att ha` - }, - array: { - unit: `objekt`, - verb: `att innehålla` - }, - set: { - unit: `objekt`, - verb: `att innehålla` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `reguljärt uttryck`, - email: `e-postadress`, - url: `URL`, - emoji: `emoji`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `ISO-datum och tid`, - date: `ISO-datum`, - time: `ISO-tid`, - duration: `ISO-varaktighet`, - ipv4: `IPv4-intervall`, - ipv6: `IPv6-intervall`, - cidrv4: `IPv4-spektrum`, - cidrv6: `IPv6-spektrum`, - base64: `base64-kodad sträng`, - base64url: `base64url-kodad sträng`, - json_string: `JSON-sträng`, - e164: `E.164-nummer`, - jwt: `JWT`, - template_literal: `mall-literal` - }, r = { - nan: `NaN`, - number: `antal`, - array: `lista` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = A$12(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `Ogiltig inmatning: förväntat instanceof ${e.expected}, fick ${i}` : `Ogiltig inmatning: förväntat ${t}, fick ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `Ogiltig inmatning: förväntat ${T$14(e.values[0])}` : `Ogiltigt val: förväntade en av ${m$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? `För stor(t): förväntade ${e.origin ?? `värdet`} att ha ${n}${e.maximum.toString()} ${r.unit ?? `element`}` : `För stor(t): förväntat ${e.origin ?? `värdet`} att ha ${n}${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `För lite(t): förväntade ${e.origin ?? `värdet`} att ha ${n}${e.minimum.toString()} ${r.unit}` : `För lite(t): förväntade ${e.origin ?? `värdet`} att ha ${n}${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `Ogiltig sträng: måste börja med "${t.prefix}"` : t.format === `ends_with` ? `Ogiltig sträng: måste sluta med "${t.suffix}"` : t.format === `includes` ? `Ogiltig sträng: måste innehålla "${t.includes}"` : t.format === `regex` ? `Ogiltig sträng: måste matcha mönstret "${t.pattern}"` : `Ogiltig(t) ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `Ogiltigt tal: måste vara en multipel av ${e.divisor}`; - case `unrecognized_keys`: return `${e.keys.length > 1 ? `Okända nycklar` : `Okänd nyckel`}: ${m$10(e.keys, `, `)}`; - case `invalid_key`: return `Ogiltig nyckel i ${e.origin ?? `värdet`}`; - case `invalid_union`: return `Ogiltig input`; - case `invalid_element`: return `Ogiltigt värde i ${e.origin ?? `värdet`}`; - default: return `Ogiltig input`; - } - }; -}; -function po$4() { - return { localeError: fo$4() }; -} -const mo$4 = () => { - let e = { - string: { - unit: `எழுத்துக்கள்`, - verb: `கொண்டிருக்க வேண்டும்` - }, - file: { - unit: `பைட்டுகள்`, - verb: `கொண்டிருக்க வேண்டும்` - }, - array: { - unit: `உறுப்புகள்`, - verb: `கொண்டிருக்க வேண்டும்` - }, - set: { - unit: `உறுப்புகள்`, - verb: `கொண்டிருக்க வேண்டும்` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `உள்ளீடு`, - email: `மின்னஞ்சல் முகவரி`, - url: `URL`, - emoji: `emoji`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `ISO தேதி நேரம்`, - date: `ISO தேதி`, - time: `ISO நேரம்`, - duration: `ISO கால அளவு`, - ipv4: `IPv4 முகவரி`, - ipv6: `IPv6 முகவரி`, - cidrv4: `IPv4 வரம்பு`, - cidrv6: `IPv6 வரம்பு`, - base64: `base64-encoded சரம்`, - base64url: `base64url-encoded சரம்`, - json_string: `JSON சரம்`, - e164: `E.164 எண்`, - jwt: `JWT`, - template_literal: `input` - }, r = { - nan: `NaN`, - number: `எண்`, - array: `அணி`, - null: `வெறுமை` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = A$12(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது instanceof ${e.expected}, பெறப்பட்டது ${i}` : `தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${t}, பெறப்பட்டது ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${T$14(e.values[0])}` : `தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${m$10(e.values, `|`)} இல் ஒன்று`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? `மிக பெரியது: எதிர்பார்க்கப்பட்டது ${e.origin ?? `மதிப்பு`} ${n}${e.maximum.toString()} ${r.unit ?? `உறுப்புகள்`} ஆக இருக்க வேண்டும்` : `மிக பெரியது: எதிர்பார்க்கப்பட்டது ${e.origin ?? `மதிப்பு`} ${n}${e.maximum.toString()} ஆக இருக்க வேண்டும்`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${e.origin} ${n}${e.minimum.toString()} ${r.unit} ஆக இருக்க வேண்டும்` : `மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${e.origin} ${n}${e.minimum.toString()} ஆக இருக்க வேண்டும்`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `தவறான சரம்: "${t.prefix}" இல் தொடங்க வேண்டும்` : t.format === `ends_with` ? `தவறான சரம்: "${t.suffix}" இல் முடிவடைய வேண்டும்` : t.format === `includes` ? `தவறான சரம்: "${t.includes}" ஐ உள்ளடக்க வேண்டும்` : t.format === `regex` ? `தவறான சரம்: ${t.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்` : `தவறான ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `தவறான எண்: ${e.divisor} இன் பலமாக இருக்க வேண்டும்`; - case `unrecognized_keys`: return `அடையாளம் தெரியாத விசை${e.keys.length > 1 ? `கள்` : ``}: ${m$10(e.keys, `, `)}`; - case `invalid_key`: return `${e.origin} இல் தவறான விசை`; - case `invalid_union`: return `தவறான உள்ளீடு`; - case `invalid_element`: return `${e.origin} இல் தவறான மதிப்பு`; - default: return `தவறான உள்ளீடு`; - } - }; -}; -function ho$4() { - return { localeError: mo$4() }; -} -const go$4 = () => { - let e = { - string: { - unit: `ตัวอักษร`, - verb: `ควรมี` - }, - file: { - unit: `ไบต์`, - verb: `ควรมี` - }, - array: { - unit: `รายการ`, - verb: `ควรมี` - }, - set: { - unit: `รายการ`, - verb: `ควรมี` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `ข้อมูลที่ป้อน`, - email: `ที่อยู่อีเมล`, - url: `URL`, - emoji: `อิโมจิ`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `วันที่เวลาแบบ ISO`, - date: `วันที่แบบ ISO`, - time: `เวลาแบบ ISO`, - duration: `ช่วงเวลาแบบ ISO`, - ipv4: `ที่อยู่ IPv4`, - ipv6: `ที่อยู่ IPv6`, - cidrv4: `ช่วง IP แบบ IPv4`, - cidrv6: `ช่วง IP แบบ IPv6`, - base64: `ข้อความแบบ Base64`, - base64url: `ข้อความแบบ Base64 สำหรับ URL`, - json_string: `ข้อความแบบ JSON`, - e164: `เบอร์โทรศัพท์ระหว่างประเทศ (E.164)`, - jwt: `โทเคน JWT`, - template_literal: `ข้อมูลที่ป้อน` - }, r = { - nan: `NaN`, - number: `ตัวเลข`, - array: `อาร์เรย์ (Array)`, - null: `ไม่มีค่า (null)` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = A$12(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น instanceof ${e.expected} แต่ได้รับ ${i}` : `ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${t} แต่ได้รับ ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `ค่าไม่ถูกต้อง: ควรเป็น ${T$14(e.values[0])}` : `ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${m$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `ไม่เกิน` : `น้อยกว่า`, r = t(e.origin); - return r ? `เกินกำหนด: ${e.origin ?? `ค่า`} ควรมี${n} ${e.maximum.toString()} ${r.unit ?? `รายการ`}` : `เกินกำหนด: ${e.origin ?? `ค่า`} ควรมี${n} ${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `อย่างน้อย` : `มากกว่า`, r = t(e.origin); - return r ? `น้อยกว่ากำหนด: ${e.origin} ควรมี${n} ${e.minimum.toString()} ${r.unit}` : `น้อยกว่ากำหนด: ${e.origin} ควรมี${n} ${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${t.prefix}"` : t.format === `ends_with` ? `รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${t.suffix}"` : t.format === `includes` ? `รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${t.includes}" อยู่ในข้อความ` : t.format === `regex` ? `รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${t.pattern}` : `รูปแบบไม่ถูกต้อง: ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${e.divisor} ได้ลงตัว`; - case `unrecognized_keys`: return `พบคีย์ที่ไม่รู้จัก: ${m$10(e.keys, `, `)}`; - case `invalid_key`: return `คีย์ไม่ถูกต้องใน ${e.origin}`; - case `invalid_union`: return `ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้`; - case `invalid_element`: return `ข้อมูลไม่ถูกต้องใน ${e.origin}`; - default: return `ข้อมูลไม่ถูกต้อง`; - } - }; -}; -function _o$4() { - return { localeError: go$4() }; -} -const vo$4 = () => { - let e = { - string: { - unit: `karakter`, - verb: `olmalı` - }, - file: { - unit: `bayt`, - verb: `olmalı` - }, - array: { - unit: `öğe`, - verb: `olmalı` - }, - set: { - unit: `öğe`, - verb: `olmalı` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `girdi`, - email: `e-posta adresi`, - url: `URL`, - emoji: `emoji`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `ISO tarih ve saat`, - date: `ISO tarih`, - time: `ISO saat`, - duration: `ISO süre`, - ipv4: `IPv4 adresi`, - ipv6: `IPv6 adresi`, - cidrv4: `IPv4 aralığı`, - cidrv6: `IPv6 aralığı`, - base64: `base64 ile şifrelenmiş metin`, - base64url: `base64url ile şifrelenmiş metin`, - json_string: `JSON dizesi`, - e164: `E.164 sayısı`, - jwt: `JWT`, - template_literal: `Şablon dizesi` - }, r = { nan: `NaN` }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = A$12(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `Geçersiz değer: beklenen instanceof ${e.expected}, alınan ${i}` : `Geçersiz değer: beklenen ${t}, alınan ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `Geçersiz değer: beklenen ${T$14(e.values[0])}` : `Geçersiz seçenek: aşağıdakilerden biri olmalı: ${m$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? `Çok büyük: beklenen ${e.origin ?? `değer`} ${n}${e.maximum.toString()} ${r.unit ?? `öğe`}` : `Çok büyük: beklenen ${e.origin ?? `değer`} ${n}${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `Çok küçük: beklenen ${e.origin} ${n}${e.minimum.toString()} ${r.unit}` : `Çok küçük: beklenen ${e.origin} ${n}${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `Geçersiz metin: "${t.prefix}" ile başlamalı` : t.format === `ends_with` ? `Geçersiz metin: "${t.suffix}" ile bitmeli` : t.format === `includes` ? `Geçersiz metin: "${t.includes}" içermeli` : t.format === `regex` ? `Geçersiz metin: ${t.pattern} desenine uymalı` : `Geçersiz ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `Geçersiz sayı: ${e.divisor} ile tam bölünebilmeli`; - case `unrecognized_keys`: return `Tanınmayan anahtar${e.keys.length > 1 ? `lar` : ``}: ${m$10(e.keys, `, `)}`; - case `invalid_key`: return `${e.origin} içinde geçersiz anahtar`; - case `invalid_union`: return `Geçersiz değer`; - case `invalid_element`: return `${e.origin} içinde geçersiz değer`; - default: return `Geçersiz değer`; - } - }; -}; -function yo$4() { - return { localeError: vo$4() }; -} -const bo$4 = () => { - let e = { - string: { - unit: `символів`, - verb: `матиме` - }, - file: { - unit: `байтів`, - verb: `матиме` - }, - array: { - unit: `елементів`, - verb: `матиме` - }, - set: { - unit: `елементів`, - verb: `матиме` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `вхідні дані`, - email: `адреса електронної пошти`, - url: `URL`, - emoji: `емодзі`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `дата та час ISO`, - date: `дата ISO`, - time: `час ISO`, - duration: `тривалість ISO`, - ipv4: `адреса IPv4`, - ipv6: `адреса IPv6`, - cidrv4: `діапазон IPv4`, - cidrv6: `діапазон IPv6`, - base64: `рядок у кодуванні base64`, - base64url: `рядок у кодуванні base64url`, - json_string: `рядок JSON`, - e164: `номер E.164`, - jwt: `JWT`, - template_literal: `вхідні дані` - }, r = { - nan: `NaN`, - number: `число`, - array: `масив` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = A$12(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `Неправильні вхідні дані: очікується instanceof ${e.expected}, отримано ${i}` : `Неправильні вхідні дані: очікується ${t}, отримано ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `Неправильні вхідні дані: очікується ${T$14(e.values[0])}` : `Неправильна опція: очікується одне з ${m$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? `Занадто велике: очікується, що ${e.origin ?? `значення`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit ?? `елементів`}` : `Занадто велике: очікується, що ${e.origin ?? `значення`} буде ${n}${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `Занадто мале: очікується, що ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}` : `Занадто мале: очікується, що ${e.origin} буде ${n}${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `Неправильний рядок: повинен починатися з "${t.prefix}"` : t.format === `ends_with` ? `Неправильний рядок: повинен закінчуватися на "${t.suffix}"` : t.format === `includes` ? `Неправильний рядок: повинен містити "${t.includes}"` : t.format === `regex` ? `Неправильний рядок: повинен відповідати шаблону ${t.pattern}` : `Неправильний ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `Неправильне число: повинно бути кратним ${e.divisor}`; - case `unrecognized_keys`: return `Нерозпізнаний ключ${e.keys.length > 1 ? `і` : ``}: ${m$10(e.keys, `, `)}`; - case `invalid_key`: return `Неправильний ключ у ${e.origin}`; - case `invalid_union`: return `Неправильні вхідні дані`; - case `invalid_element`: return `Неправильне значення у ${e.origin}`; - default: return `Неправильні вхідні дані`; - } - }; -}; -function xo$4() { - return { localeError: bo$4() }; -} -function So$4() { - return xo$4(); -} -const Co$4 = () => { - let e = { - string: { - unit: `حروف`, - verb: `ہونا` - }, - file: { - unit: `بائٹس`, - verb: `ہونا` - }, - array: { - unit: `آئٹمز`, - verb: `ہونا` - }, - set: { - unit: `آئٹمز`, - verb: `ہونا` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `ان پٹ`, - email: `ای میل ایڈریس`, - url: `یو آر ایل`, - emoji: `ایموجی`, - uuid: `یو یو آئی ڈی`, - uuidv4: `یو یو آئی ڈی وی 4`, - uuidv6: `یو یو آئی ڈی وی 6`, - nanoid: `نینو آئی ڈی`, - guid: `جی یو آئی ڈی`, - cuid: `سی یو آئی ڈی`, - cuid2: `سی یو آئی ڈی 2`, - ulid: `یو ایل آئی ڈی`, - xid: `ایکس آئی ڈی`, - ksuid: `کے ایس یو آئی ڈی`, - datetime: `آئی ایس او ڈیٹ ٹائم`, - date: `آئی ایس او تاریخ`, - time: `آئی ایس او وقت`, - duration: `آئی ایس او مدت`, - ipv4: `آئی پی وی 4 ایڈریس`, - ipv6: `آئی پی وی 6 ایڈریس`, - cidrv4: `آئی پی وی 4 رینج`, - cidrv6: `آئی پی وی 6 رینج`, - base64: `بیس 64 ان کوڈڈ سٹرنگ`, - base64url: `بیس 64 یو آر ایل ان کوڈڈ سٹرنگ`, - json_string: `جے ایس او این سٹرنگ`, - e164: `ای 164 نمبر`, - jwt: `جے ڈبلیو ٹی`, - template_literal: `ان پٹ` - }, r = { - nan: `NaN`, - number: `نمبر`, - array: `آرے`, - null: `نل` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = A$12(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `غلط ان پٹ: instanceof ${e.expected} متوقع تھا، ${i} موصول ہوا` : `غلط ان پٹ: ${t} متوقع تھا، ${i} موصول ہوا`; - } - case `invalid_value`: return e.values.length === 1 ? `غلط ان پٹ: ${T$14(e.values[0])} متوقع تھا` : `غلط آپشن: ${m$10(e.values, `|`)} میں سے ایک متوقع تھا`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? `بہت بڑا: ${e.origin ?? `ویلیو`} کے ${n}${e.maximum.toString()} ${r.unit ?? `عناصر`} ہونے متوقع تھے` : `بہت بڑا: ${e.origin ?? `ویلیو`} کا ${n}${e.maximum.toString()} ہونا متوقع تھا`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `بہت چھوٹا: ${e.origin} کے ${n}${e.minimum.toString()} ${r.unit} ہونے متوقع تھے` : `بہت چھوٹا: ${e.origin} کا ${n}${e.minimum.toString()} ہونا متوقع تھا`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `غلط سٹرنگ: "${t.prefix}" سے شروع ہونا چاہیے` : t.format === `ends_with` ? `غلط سٹرنگ: "${t.suffix}" پر ختم ہونا چاہیے` : t.format === `includes` ? `غلط سٹرنگ: "${t.includes}" شامل ہونا چاہیے` : t.format === `regex` ? `غلط سٹرنگ: پیٹرن ${t.pattern} سے میچ ہونا چاہیے` : `غلط ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `غلط نمبر: ${e.divisor} کا مضاعف ہونا چاہیے`; - case `unrecognized_keys`: return `غیر تسلیم شدہ کی${e.keys.length > 1 ? `ز` : ``}: ${m$10(e.keys, `، `)}`; - case `invalid_key`: return `${e.origin} میں غلط کی`; - case `invalid_union`: return `غلط ان پٹ`; - case `invalid_element`: return `${e.origin} میں غلط ویلیو`; - default: return `غلط ان پٹ`; - } - }; -}; -function wo$4() { - return { localeError: Co$4() }; -} -const To$4 = () => { - let e = { - string: { - unit: `belgi`, - verb: `bo‘lishi kerak` - }, - file: { - unit: `bayt`, - verb: `bo‘lishi kerak` - }, - array: { - unit: `element`, - verb: `bo‘lishi kerak` - }, - set: { - unit: `element`, - verb: `bo‘lishi kerak` - }, - map: { - unit: `yozuv`, - verb: `bo‘lishi kerak` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `kirish`, - email: `elektron pochta manzili`, - url: `URL`, - emoji: `emoji`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `ISO sana va vaqti`, - date: `ISO sana`, - time: `ISO vaqt`, - duration: `ISO davomiylik`, - ipv4: `IPv4 manzil`, - ipv6: `IPv6 manzil`, - mac: `MAC manzil`, - cidrv4: `IPv4 diapazon`, - cidrv6: `IPv6 diapazon`, - base64: `base64 kodlangan satr`, - base64url: `base64url kodlangan satr`, - json_string: `JSON satr`, - e164: `E.164 raqam`, - jwt: `JWT`, - template_literal: `kirish` - }, r = { - nan: `NaN`, - number: `raqam`, - array: `massiv` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = A$12(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `Noto‘g‘ri kirish: kutilgan instanceof ${e.expected}, qabul qilingan ${i}` : `Noto‘g‘ri kirish: kutilgan ${t}, qabul qilingan ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `Noto‘g‘ri kirish: kutilgan ${T$14(e.values[0])}` : `Noto‘g‘ri variant: quyidagilardan biri kutilgan ${m$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? `Juda katta: kutilgan ${e.origin ?? `qiymat`} ${n}${e.maximum.toString()} ${r.unit} ${r.verb}` : `Juda katta: kutilgan ${e.origin ?? `qiymat`} ${n}${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `Juda kichik: kutilgan ${e.origin} ${n}${e.minimum.toString()} ${r.unit} ${r.verb}` : `Juda kichik: kutilgan ${e.origin} ${n}${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `Noto‘g‘ri satr: "${t.prefix}" bilan boshlanishi kerak` : t.format === `ends_with` ? `Noto‘g‘ri satr: "${t.suffix}" bilan tugashi kerak` : t.format === `includes` ? `Noto‘g‘ri satr: "${t.includes}" ni o‘z ichiga olishi kerak` : t.format === `regex` ? `Noto‘g‘ri satr: ${t.pattern} shabloniga mos kelishi kerak` : `Noto‘g‘ri ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `Noto‘g‘ri raqam: ${e.divisor} ning karralisi bo‘lishi kerak`; - case `unrecognized_keys`: return `Noma’lum kalit${e.keys.length > 1 ? `lar` : ``}: ${m$10(e.keys, `, `)}`; - case `invalid_key`: return `${e.origin} dagi kalit noto‘g‘ri`; - case `invalid_union`: return `Noto‘g‘ri kirish`; - case `invalid_element`: return `${e.origin} da noto‘g‘ri qiymat`; - default: return `Noto‘g‘ri kirish`; - } - }; -}; -function Eo$4() { - return { localeError: To$4() }; -} -const Do$4 = () => { - let e = { - string: { - unit: `ký tự`, - verb: `có` - }, - file: { - unit: `byte`, - verb: `có` - }, - array: { - unit: `phần tử`, - verb: `có` - }, - set: { - unit: `phần tử`, - verb: `có` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `đầu vào`, - email: `địa chỉ email`, - url: `URL`, - emoji: `emoji`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `ngày giờ ISO`, - date: `ngày ISO`, - time: `giờ ISO`, - duration: `khoảng thời gian ISO`, - ipv4: `địa chỉ IPv4`, - ipv6: `địa chỉ IPv6`, - cidrv4: `dải IPv4`, - cidrv6: `dải IPv6`, - base64: `chuỗi mã hóa base64`, - base64url: `chuỗi mã hóa base64url`, - json_string: `chuỗi JSON`, - e164: `số E.164`, - jwt: `JWT`, - template_literal: `đầu vào` - }, r = { - nan: `NaN`, - number: `số`, - array: `mảng` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = A$12(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `Đầu vào không hợp lệ: mong đợi instanceof ${e.expected}, nhận được ${i}` : `Đầu vào không hợp lệ: mong đợi ${t}, nhận được ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `Đầu vào không hợp lệ: mong đợi ${T$14(e.values[0])}` : `Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${m$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? `Quá lớn: mong đợi ${e.origin ?? `giá trị`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit ?? `phần tử`}` : `Quá lớn: mong đợi ${e.origin ?? `giá trị`} ${n}${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `Quá nhỏ: mong đợi ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}` : `Quá nhỏ: mong đợi ${e.origin} ${n}${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `Chuỗi không hợp lệ: phải bắt đầu bằng "${t.prefix}"` : t.format === `ends_with` ? `Chuỗi không hợp lệ: phải kết thúc bằng "${t.suffix}"` : t.format === `includes` ? `Chuỗi không hợp lệ: phải bao gồm "${t.includes}"` : t.format === `regex` ? `Chuỗi không hợp lệ: phải khớp với mẫu ${t.pattern}` : `${n[t.format] ?? e.format} không hợp lệ`; - } - case `not_multiple_of`: return `Số không hợp lệ: phải là bội số của ${e.divisor}`; - case `unrecognized_keys`: return `Khóa không được nhận dạng: ${m$10(e.keys, `, `)}`; - case `invalid_key`: return `Khóa không hợp lệ trong ${e.origin}`; - case `invalid_union`: return `Đầu vào không hợp lệ`; - case `invalid_element`: return `Giá trị không hợp lệ trong ${e.origin}`; - default: return `Đầu vào không hợp lệ`; - } - }; -}; -function Oo$4() { - return { localeError: Do$4() }; -} -const ko$4 = () => { - let e = { - string: { - unit: `字符`, - verb: `包含` - }, - file: { - unit: `字节`, - verb: `包含` - }, - array: { - unit: `项`, - verb: `包含` - }, - set: { - unit: `项`, - verb: `包含` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `输入`, - email: `电子邮件`, - url: `URL`, - emoji: `表情符号`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `ISO日期时间`, - date: `ISO日期`, - time: `ISO时间`, - duration: `ISO时长`, - ipv4: `IPv4地址`, - ipv6: `IPv6地址`, - cidrv4: `IPv4网段`, - cidrv6: `IPv6网段`, - base64: `base64编码字符串`, - base64url: `base64url编码字符串`, - json_string: `JSON字符串`, - e164: `E.164号码`, - jwt: `JWT`, - template_literal: `输入` - }, r = { - nan: `NaN`, - number: `数字`, - array: `数组`, - null: `空值(null)` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = A$12(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `无效输入:期望 instanceof ${e.expected},实际接收 ${i}` : `无效输入:期望 ${t},实际接收 ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `无效输入:期望 ${T$14(e.values[0])}` : `无效选项:期望以下之一 ${m$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? `数值过大:期望 ${e.origin ?? `值`} ${n}${e.maximum.toString()} ${r.unit ?? `个元素`}` : `数值过大:期望 ${e.origin ?? `值`} ${n}${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `数值过小:期望 ${e.origin} ${n}${e.minimum.toString()} ${r.unit}` : `数值过小:期望 ${e.origin} ${n}${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `无效字符串:必须以 "${t.prefix}" 开头` : t.format === `ends_with` ? `无效字符串:必须以 "${t.suffix}" 结尾` : t.format === `includes` ? `无效字符串:必须包含 "${t.includes}"` : t.format === `regex` ? `无效字符串:必须满足正则表达式 ${t.pattern}` : `无效${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `无效数字:必须是 ${e.divisor} 的倍数`; - case `unrecognized_keys`: return `出现未知的键(key): ${m$10(e.keys, `, `)}`; - case `invalid_key`: return `${e.origin} 中的键(key)无效`; - case `invalid_union`: return `无效输入`; - case `invalid_element`: return `${e.origin} 中包含无效值(value)`; - default: return `无效输入`; - } - }; -}; -function Ao$4() { - return { localeError: ko$4() }; -} -const jo$4 = () => { - let e = { - string: { - unit: `字元`, - verb: `擁有` - }, - file: { - unit: `位元組`, - verb: `擁有` - }, - array: { - unit: `項目`, - verb: `擁有` - }, - set: { - unit: `項目`, - verb: `擁有` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `輸入`, - email: `郵件地址`, - url: `URL`, - emoji: `emoji`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `ISO 日期時間`, - date: `ISO 日期`, - time: `ISO 時間`, - duration: `ISO 期間`, - ipv4: `IPv4 位址`, - ipv6: `IPv6 位址`, - cidrv4: `IPv4 範圍`, - cidrv6: `IPv6 範圍`, - base64: `base64 編碼字串`, - base64url: `base64url 編碼字串`, - json_string: `JSON 字串`, - e164: `E.164 數值`, - jwt: `JWT`, - template_literal: `輸入` - }, r = { nan: `NaN` }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = A$12(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `無效的輸入值:預期為 instanceof ${e.expected},但收到 ${i}` : `無效的輸入值:預期為 ${t},但收到 ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `無效的輸入值:預期為 ${T$14(e.values[0])}` : `無效的選項:預期為以下其中之一 ${m$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? `數值過大:預期 ${e.origin ?? `值`} 應為 ${n}${e.maximum.toString()} ${r.unit ?? `個元素`}` : `數值過大:預期 ${e.origin ?? `值`} 應為 ${n}${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `數值過小:預期 ${e.origin} 應為 ${n}${e.minimum.toString()} ${r.unit}` : `數值過小:預期 ${e.origin} 應為 ${n}${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `無效的字串:必須以 "${t.prefix}" 開頭` : t.format === `ends_with` ? `無效的字串:必須以 "${t.suffix}" 結尾` : t.format === `includes` ? `無效的字串:必須包含 "${t.includes}"` : t.format === `regex` ? `無效的字串:必須符合格式 ${t.pattern}` : `無效的 ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `無效的數字:必須為 ${e.divisor} 的倍數`; - case `unrecognized_keys`: return `無法識別的鍵值${e.keys.length > 1 ? `們` : ``}:${m$10(e.keys, `、`)}`; - case `invalid_key`: return `${e.origin} 中有無效的鍵值`; - case `invalid_union`: return `無效的輸入值`; - case `invalid_element`: return `${e.origin} 中有無效的值`; - default: return `無效的輸入值`; - } - }; -}; -function Mo$4() { - return { localeError: jo$4() }; -} -const No$4 = () => { - let e = { - string: { - unit: `àmi`, - verb: `ní` - }, - file: { - unit: `bytes`, - verb: `ní` - }, - array: { - unit: `nkan`, - verb: `ní` - }, - set: { - unit: `nkan`, - verb: `ní` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `ẹ̀rọ ìbáwọlé`, - email: `àdírẹ́sì ìmẹ́lì`, - url: `URL`, - emoji: `emoji`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `àkókò ISO`, - date: `ọjọ́ ISO`, - time: `àkókò ISO`, - duration: `àkókò tó pé ISO`, - ipv4: `àdírẹ́sì IPv4`, - ipv6: `àdírẹ́sì IPv6`, - cidrv4: `àgbègbè IPv4`, - cidrv6: `àgbègbè IPv6`, - base64: `ọ̀rọ̀ tí a kọ́ ní base64`, - base64url: `ọ̀rọ̀ base64url`, - json_string: `ọ̀rọ̀ JSON`, - e164: `nọ́mbà E.164`, - jwt: `JWT`, - template_literal: `ẹ̀rọ ìbáwọlé` - }, r = { - nan: `NaN`, - number: `nọ́mbà`, - array: `akopọ` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = A$12(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `Ìbáwọlé aṣìṣe: a ní láti fi instanceof ${e.expected}, àmọ̀ a rí ${i}` : `Ìbáwọlé aṣìṣe: a ní láti fi ${t}, àmọ̀ a rí ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `Ìbáwọlé aṣìṣe: a ní láti fi ${T$14(e.values[0])}` : `Àṣàyàn aṣìṣe: yan ọ̀kan lára ${m$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? `Tó pọ̀ jù: a ní láti jẹ́ pé ${e.origin ?? `iye`} ${r.verb} ${n}${e.maximum} ${r.unit}` : `Tó pọ̀ jù: a ní láti jẹ́ ${n}${e.maximum}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `Kéré ju: a ní láti jẹ́ pé ${e.origin} ${r.verb} ${n}${e.minimum} ${r.unit}` : `Kéré ju: a ní láti jẹ́ ${n}${e.minimum}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${t.prefix}"` : t.format === `ends_with` ? `Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${t.suffix}"` : t.format === `includes` ? `Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${t.includes}"` : t.format === `regex` ? `Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${t.pattern}` : `Aṣìṣe: ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${e.divisor}`; - case `unrecognized_keys`: return `Bọtìnì àìmọ̀: ${m$10(e.keys, `, `)}`; - case `invalid_key`: return `Bọtìnì aṣìṣe nínú ${e.origin}`; - case `invalid_union`: return `Ìbáwọlé aṣìṣe`; - case `invalid_element`: return `Iye aṣìṣe nínú ${e.origin}`; - default: return `Ìbáwọlé aṣìṣe`; - } - }; -}; -function Po$4() { - return { localeError: No$4() }; -} -var Fo$4 = t$13({ - ar: () => Li$6, - az: () => zi$6, - be: () => Hi$6, - bg: () => Wi$6, - ca: () => Ki$6, - cs: () => Ji$6, - da: () => Xi$6, - de: () => Qi$6, - el: () => ea$6, - en: () => na$6, - eo: () => ia$6, - es: () => oa$6, - fa: () => ca$6, - fi: () => ua$6, - fr: () => fa$6, - frCA: () => ma$6, - he: () => ga$6, - hr: () => va$6, - hu: () => ba$6, - hy: () => Ca$6, - id: () => Ta$6, - is: () => Da$6, - it: () => ka$6, - ja: () => ja$6, - ka: () => Na$6, - kh: () => Ia$6, - km: () => Fa$6, - ko: () => Ra$6, - lt: () => Va$6, - mk: () => Ua$6, - ms: () => Ga$6, - nl: () => qa$6, - no: () => Ya$5, - ota: () => Za$5, - pl: () => to$5, - ps: () => $a$5, - pt: () => ro$4, - ro: () => ao$4, - ru: () => co$4, - sl: () => uo$4, - sv: () => po$4, - ta: () => ho$4, - th: () => _o$4, - tr: () => yo$4, - ua: () => So$4, - uk: () => xo$4, - ur: () => wo$4, - uz: () => Eo$4, - vi: () => Oo$4, - yo: () => Po$4, - zhCN: () => Ao$4, - zhTW: () => Mo$4 -}); -var Io$4; -const Lo$4 = Symbol(`ZodOutput`); -const Ro$4 = Symbol(`ZodInput`); -var zo$4 = class { - constructor() { - this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map(); - } - add(e, ...t) { - let n = t[0]; - return this._map.set(e, n), n && typeof n == `object` && `id` in n && this._idmap.set(n.id, e), this; - } - clear() { - return this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map(), this; - } - remove(e) { - let t = this._map.get(e); - return t && typeof t == `object` && `id` in t && this._idmap.delete(t.id), this._map.delete(e), this; - } - get(e) { - let t = e._zod.parent; - if (t) { - let n = { ...this.get(t) ?? {} }; - delete n.id; - let r = { - ...n, - ...this._map.get(e) - }; - return Object.keys(r).length ? r : void 0; - } - return this._map.get(e); - } - has(e) { - return this._map.has(e); - } -}; -function Bo$4() { - return new zo$4(); -} -(Io$4 = globalThis).__zod_globalRegistry ?? (Io$4.__zod_globalRegistry = Bo$4()); -const K$10 = globalThis.__zod_globalRegistry; -function Vo$4(e, t) { - return new e({ - type: `string`, - ...w$14(t) - }); -} -function Ho$4(e, t) { - return new e({ - type: `string`, - coerce: !0, - ...w$14(t) - }); -} -function Uo$4(e, t) { - return new e({ - type: `string`, - format: `email`, - check: `string_format`, - abort: !1, - ...w$14(t) - }); -} -function Wo$4(e, t) { - return new e({ - type: `string`, - format: `guid`, - check: `string_format`, - abort: !1, - ...w$14(t) - }); -} -function Go$4(e, t) { - return new e({ - type: `string`, - format: `uuid`, - check: `string_format`, - abort: !1, - ...w$14(t) - }); -} -function Ko$4(e, t) { - return new e({ - type: `string`, - format: `uuid`, - check: `string_format`, - abort: !1, - version: `v4`, - ...w$14(t) - }); -} -function qo$4(e, t) { - return new e({ - type: `string`, - format: `uuid`, - check: `string_format`, - abort: !1, - version: `v6`, - ...w$14(t) - }); -} -function Jo$4(e, t) { - return new e({ - type: `string`, - format: `uuid`, - check: `string_format`, - abort: !1, - version: `v7`, - ...w$14(t) - }); -} -function Yo$4(e, t) { - return new e({ - type: `string`, - format: `url`, - check: `string_format`, - abort: !1, - ...w$14(t) - }); -} -function Xo$4(e, t) { - return new e({ - type: `string`, - format: `emoji`, - check: `string_format`, - abort: !1, - ...w$14(t) - }); -} -function Zo$4(e, t) { - return new e({ - type: `string`, - format: `nanoid`, - check: `string_format`, - abort: !1, - ...w$14(t) - }); -} -function Qo$4(e, t) { - return new e({ - type: `string`, - format: `cuid`, - check: `string_format`, - abort: !1, - ...w$14(t) - }); -} -function $o$4(e, t) { - return new e({ - type: `string`, - format: `cuid2`, - check: `string_format`, - abort: !1, - ...w$14(t) - }); -} -function es$4(e, t) { - return new e({ - type: `string`, - format: `ulid`, - check: `string_format`, - abort: !1, - ...w$14(t) - }); -} -function ts$4(e, t) { - return new e({ - type: `string`, - format: `xid`, - check: `string_format`, - abort: !1, - ...w$14(t) - }); -} -function ns$4(e, t) { - return new e({ - type: `string`, - format: `ksuid`, - check: `string_format`, - abort: !1, - ...w$14(t) - }); -} -function rs$4(e, t) { - return new e({ - type: `string`, - format: `ipv4`, - check: `string_format`, - abort: !1, - ...w$14(t) - }); -} -function is$4(e, t) { - return new e({ - type: `string`, - format: `ipv6`, - check: `string_format`, - abort: !1, - ...w$14(t) - }); -} -function as$4(e, t) { - return new e({ - type: `string`, - format: `mac`, - check: `string_format`, - abort: !1, - ...w$14(t) - }); -} -function os$4(e, t) { - return new e({ - type: `string`, - format: `cidrv4`, - check: `string_format`, - abort: !1, - ...w$14(t) - }); -} -function ss$4(e, t) { - return new e({ - type: `string`, - format: `cidrv6`, - check: `string_format`, - abort: !1, - ...w$14(t) - }); -} -function cs$4(e, t) { - return new e({ - type: `string`, - format: `base64`, - check: `string_format`, - abort: !1, - ...w$14(t) - }); -} -function ls$4(e, t) { - return new e({ - type: `string`, - format: `base64url`, - check: `string_format`, - abort: !1, - ...w$14(t) - }); -} -function us$4(e, t) { - return new e({ - type: `string`, - format: `e164`, - check: `string_format`, - abort: !1, - ...w$14(t) - }); -} -function ds$4(e, t) { - return new e({ - type: `string`, - format: `jwt`, - check: `string_format`, - abort: !1, - ...w$14(t) - }); -} -const fs$4 = { - Any: null, - Minute: -1, - Second: 0, - Millisecond: 3, - Microsecond: 6 -}; -function ps$4(e, t) { - return new e({ - type: `string`, - format: `datetime`, - check: `string_format`, - offset: !1, - local: !1, - precision: null, - ...w$14(t) - }); -} -function ms$4(e, t) { - return new e({ - type: `string`, - format: `date`, - check: `string_format`, - ...w$14(t) - }); -} -function hs$4(e, t) { - return new e({ - type: `string`, - format: `time`, - check: `string_format`, - precision: null, - ...w$14(t) - }); -} -function gs$4(e, t) { - return new e({ - type: `string`, - format: `duration`, - check: `string_format`, - ...w$14(t) - }); -} -function _s$4(e, t) { - return new e({ - type: `number`, - checks: [], - ...w$14(t) - }); -} -function vs$4(e, t) { - return new e({ - type: `number`, - coerce: !0, - checks: [], - ...w$14(t) - }); -} -function ys$4(e, t) { - return new e({ - type: `number`, - check: `number_format`, - abort: !1, - format: `safeint`, - ...w$14(t) - }); -} -function bs$4(e, t) { - return new e({ - type: `number`, - check: `number_format`, - abort: !1, - format: `float32`, - ...w$14(t) - }); -} -function xs$4(e, t) { - return new e({ - type: `number`, - check: `number_format`, - abort: !1, - format: `float64`, - ...w$14(t) - }); -} -function Ss$4(e, t) { - return new e({ - type: `number`, - check: `number_format`, - abort: !1, - format: `int32`, - ...w$14(t) - }); -} -function Cs$4(e, t) { - return new e({ - type: `number`, - check: `number_format`, - abort: !1, - format: `uint32`, - ...w$14(t) - }); -} -function ws$4(e, t) { - return new e({ - type: `boolean`, - ...w$14(t) - }); -} -function Ts$4(e, t) { - return new e({ - type: `boolean`, - coerce: !0, - ...w$14(t) - }); -} -function Es$4(e, t) { - return new e({ - type: `bigint`, - ...w$14(t) - }); -} -function Ds$4(e, t) { - return new e({ - type: `bigint`, - coerce: !0, - ...w$14(t) - }); -} -function Os$4(e, t) { - return new e({ - type: `bigint`, - check: `bigint_format`, - abort: !1, - format: `int64`, - ...w$14(t) - }); -} -function ks$4(e, t) { - return new e({ - type: `bigint`, - check: `bigint_format`, - abort: !1, - format: `uint64`, - ...w$14(t) - }); -} -function As$4(e, t) { - return new e({ - type: `symbol`, - ...w$14(t) - }); -} -function js$4(e, t) { - return new e({ - type: `undefined`, - ...w$14(t) - }); -} -function Ms$4(e, t) { - return new e({ - type: `null`, - ...w$14(t) - }); -} -function Ns$4(e) { - return new e({ type: `any` }); -} -function Ps$4(e) { - return new e({ type: `unknown` }); -} -function Fs$4(e, t) { - return new e({ - type: `never`, - ...w$14(t) - }); -} -function Is$4(e, t) { - return new e({ - type: `void`, - ...w$14(t) - }); -} -function Ls$4(e, t) { - return new e({ - type: `date`, - ...w$14(t) - }); -} -function Rs$3(e, t) { - return new e({ - type: `date`, - coerce: !0, - ...w$14(t) - }); -} -function zs$3(e, t) { - return new e({ - type: `nan`, - ...w$14(t) - }); -} -function Bs$3(e, t) { - return new Tn$6({ - check: `less_than`, - ...w$14(t), - value: e, - inclusive: !1 - }); -} -function Vs$3(e, t) { - return new Tn$6({ - check: `less_than`, - ...w$14(t), - value: e, - inclusive: !0 - }); -} -function Hs$3(e, t) { - return new En$6({ - check: `greater_than`, - ...w$14(t), - value: e, - inclusive: !1 - }); -} -function q$10(e, t) { - return new En$6({ - check: `greater_than`, - ...w$14(t), - value: e, - inclusive: !0 - }); -} -function Us$3(e) { - return Hs$3(0, e); -} -function Ws$3(e) { - return Bs$3(0, e); -} -function Gs$3(e) { - return Vs$3(0, e); -} -function Ks$3(e) { - return q$10(0, e); -} -function qs$3(e, t) { - return new Dn$6({ - check: `multiple_of`, - ...w$14(t), - value: e - }); -} -function Js$3(e, t) { - return new An$5({ - check: `max_size`, - ...w$14(t), - maximum: e - }); -} -function Ys$3(e, t) { - return new jn$5({ - check: `min_size`, - ...w$14(t), - minimum: e - }); -} -function Xs$3(e, t) { - return new Mn$6({ - check: `size_equals`, - ...w$14(t), - size: e - }); -} -function Zs$3(e, t) { - return new Nn$5({ - check: `max_length`, - ...w$14(t), - maximum: e - }); -} -function Qs$3(e, t) { - return new Pn$5({ - check: `min_length`, - ...w$14(t), - minimum: e - }); -} -function $s$3(e, t) { - return new Fn$4({ - check: `length_equals`, - ...w$14(t), - length: e - }); -} -function ec$3(e, t) { - return new In$4({ - check: `string_format`, - format: `regex`, - ...w$14(t), - pattern: e - }); -} -function tc$3(e) { - return new Ln$4({ - check: `string_format`, - format: `lowercase`, - ...w$14(e) - }); -} -function nc$3(e) { - return new Rn$4({ - check: `string_format`, - format: `uppercase`, - ...w$14(e) - }); -} -function rc$3(e, t) { - return new zn$4({ - check: `string_format`, - format: `includes`, - ...w$14(t), - includes: e - }); -} -function ic$3(e, t) { - return new Bn$4({ - check: `string_format`, - format: `starts_with`, - ...w$14(t), - prefix: e - }); -} -function ac$3(e, t) { - return new Vn$4({ - check: `string_format`, - format: `ends_with`, - ...w$14(t), - suffix: e - }); -} -function oc$3(e, t, n) { - return new Un$4({ - check: `property`, - property: e, - schema: t, - ...w$14(n) - }); -} -function sc$3(e, t) { - return new Wn$4({ - check: `mime_type`, - mime: e, - ...w$14(t) - }); -} -function J$10(e) { - return new Gn$4({ - check: `overwrite`, - tx: e - }); -} -function cc$3(e) { - return J$10((t) => t.normalize(e)); -} -function lc$3() { - return J$10((e) => e.trim()); -} -function uc$3() { - return J$10((e) => e.toLowerCase()); -} -function dc$3() { - return J$10((e) => e.toUpperCase()); -} -function fc$3() { - return J$10((e) => pe$9(e)); -} -function pc$3(e, t, n) { - return new e({ - type: `array`, - element: t, - ...w$14(n) - }); -} -function mc$3(e, t, n) { - return new e({ - type: `union`, - options: t, - ...w$14(n) - }); -} -function hc$3(e, t, n) { - return new e({ - type: `union`, - options: t, - inclusive: !1, - ...w$14(n) - }); -} -function gc$3(e, t, n, r) { - return new e({ - type: `union`, - options: n, - discriminator: t, - ...w$14(r) - }); -} -function _c$3(e, t, n) { - return new e({ - type: `intersection`, - left: t, - right: n - }); -} -function vc$3(e, t, n, r) { - let i = n instanceof H$11; - return new e({ - type: `tuple`, - items: t, - rest: i ? n : null, - ...w$14(i ? r : n) - }); -} -function yc$3(e, t, n, r) { - return new e({ - type: `record`, - keyType: t, - valueType: n, - ...w$14(r) - }); -} -function bc$3(e, t, n, r) { - return new e({ - type: `map`, - keyType: t, - valueType: n, - ...w$14(r) - }); -} -function xc$3(e, t, n) { - return new e({ - type: `set`, - valueType: t, - ...w$14(n) - }); -} -function Sc$3(e, t, n) { - return new e({ - type: `enum`, - entries: Array.isArray(t) ? Object.fromEntries(t.map((e) => [e, e])) : t, - ...w$14(n) - }); -} -function Cc$3(e, t, n) { - return new e({ - type: `enum`, - entries: t, - ...w$14(n) - }); -} -function wc$3(e, t, n) { - return new e({ - type: `literal`, - values: Array.isArray(t) ? t : [t], - ...w$14(n) - }); -} -function Tc$3(e, t) { - return new e({ - type: `file`, - ...w$14(t) - }); -} -function Ec$3(e, t) { - return new e({ - type: `transform`, - transform: t - }); -} -function Dc$3(e, t) { - return new e({ - type: `optional`, - innerType: t - }); -} -function Oc$3(e, t) { - return new e({ - type: `nullable`, - innerType: t - }); -} -function kc$3(e, t, n) { - return new e({ - type: `default`, - innerType: t, - get defaultValue() { - return typeof n == `function` ? n() : ge$9(n); - } - }); -} -function Ac$3(e, t, n) { - return new e({ - type: `nonoptional`, - innerType: t, - ...w$14(n) - }); -} -function jc$3(e, t) { - return new e({ - type: `success`, - innerType: t - }); -} -function Mc$3(e, t, n) { - return new e({ - type: `catch`, - innerType: t, - catchValue: typeof n == `function` ? n : () => n - }); -} -function Nc$3(e, t, n) { - return new e({ - type: `pipe`, - in: t, - out: n - }); -} -function Pc$3(e, t) { - return new e({ - type: `readonly`, - innerType: t - }); -} -function Fc$3(e, t, n) { - return new e({ - type: `template_literal`, - parts: t, - ...w$14(n) - }); -} -function Ic$3(e, t) { - return new e({ - type: `lazy`, - getter: t - }); -} -function Lc$3(e, t) { - return new e({ - type: `promise`, - innerType: t - }); -} -function Rc$3(e, t, n) { - let r = w$14(n); - return r.abort ??= !0, new e({ - type: `custom`, - check: `custom`, - fn: t, - ...r - }); -} -function zc$3(e, t, n) { - return new e({ - type: `custom`, - check: `custom`, - fn: t, - ...w$14(n) - }); -} -function Bc$3(e, t) { - let n = Vc$3((t) => (t.addIssue = (e) => { - if (typeof e == `string`) t.issues.push(j$12(e, t.value, n._zod.def)); - else { - let r = e; - r.fatal && (r.continue = !1), r.code ??= `custom`, r.input ??= t.value, r.inst ??= n, r.continue ??= !n._zod.def.abort, t.issues.push(j$12(r)); - } - }, e(t.value, t)), t); - return n; -} -function Vc$3(e, t) { - let n = new B$13({ - check: `custom`, - ...w$14(t) - }); - return n._zod.check = e, n; -} -function Hc$3(e) { - let t = new B$13({ check: `describe` }); - return t._zod.onattach = [(t) => { - let n = K$10.get(t) ?? {}; - K$10.add(t, { - ...n, - description: e - }); - }], t._zod.check = () => {}, t; -} -function Uc$3(e) { - let t = new B$13({ check: `meta` }); - return t._zod.onattach = [(t) => { - let n = K$10.get(t) ?? {}; - K$10.add(t, { - ...n, - ...e - }); - }], t._zod.check = () => {}, t; -} -function Wc$3(e, t) { - let n = w$14(t), r = n.truthy ?? [ - `true`, - `1`, - `yes`, - `on`, - `y`, - `enabled` - ], i = n.falsy ?? [ - `false`, - `0`, - `no`, - `off`, - `n`, - `disabled` - ]; - n.case !== `sensitive` && (r = r.map((e) => typeof e == `string` ? e.toLowerCase() : e), i = i.map((e) => typeof e == `string` ? e.toLowerCase() : e)); - let a = new Set(r), o = new Set(i), s = e.Codec ?? wi$6, c = e.Boolean ?? Tr$5, l = new s({ - type: `pipe`, - in: new (e.String ?? Jn$4)({ - type: `string`, - error: n.error - }), - out: new c({ - type: `boolean`, - error: n.error - }), - transform: ((e, t) => { - let r = e; - return n.case !== `sensitive` && (r = r.toLowerCase()), a.has(r) ? !0 : o.has(r) ? !1 : (t.issues.push({ - code: `invalid_value`, - expected: `stringbool`, - values: [...a, ...o], - input: t.value, - inst: l, - continue: !1 - }), {}); - }), - reverseTransform: ((e, t) => e === !0 ? r[0] || `true` : i[0] || `false`), - error: n.error - }); - return l; -} -function Gc$3(e, t, n, r = {}) { - let i = w$14(r), a = { - ...w$14(r), - check: `string_format`, - type: `string`, - format: t, - fn: typeof n == `function` ? n : (e) => n.test(e), - ...i - }; - return n instanceof RegExp && (a.pattern = n), new e(a); -} -function Y$13(e) { - let t = e?.target ?? `draft-2020-12`; - return t === `draft-4` && (t = `draft-04`), t === `draft-7` && (t = `draft-07`), { - processors: e.processors ?? {}, - metadataRegistry: e?.metadata ?? K$10, - target: t, - unrepresentable: e?.unrepresentable ?? `throw`, - override: e?.override ?? (() => {}), - io: e?.io ?? `output`, - counter: 0, - seen: /* @__PURE__ */ new Map(), - cycles: e?.cycles ?? `ref`, - reused: e?.reused ?? `inline`, - external: e?.external ?? void 0 - }; -} -function X$13(e, t, n = { - path: [], - schemaPath: [] -}) { - var r; - let i = e._zod.def, a = t.seen.get(e); - if (a) return a.count++, n.schemaPath.includes(e) && (a.cycle = n.path), a.schema; - let o = { - schema: {}, - count: 1, - cycle: void 0, - path: n.path - }; - t.seen.set(e, o); - let s = e._zod.toJSONSchema?.(); - if (s) o.schema = s; - else { - let r = { - ...n, - schemaPath: [...n.schemaPath, e], - path: n.path - }; - if (e._zod.processJSONSchema) e._zod.processJSONSchema(t, o.schema, r); - else { - let n = o.schema, a = t.processors[i.type]; - if (!a) throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`); - a(e, t, n, r); - } - let a = e._zod.parent; - a && (o.ref ||= a, X$13(a, t, r), t.seen.get(a).isParent = !0); - } - let c = t.metadataRegistry.get(e); - return c && Object.assign(o.schema, c), t.io === `input` && $$11(e) && (delete o.schema.examples, delete o.schema.default), t.io === `input` && `_prefault` in o.schema && ((r = o.schema).default ?? (r.default = o.schema._prefault)), delete o.schema._prefault, t.seen.get(e).schema; -} -function Z$12(e, t) { - let n = e.seen.get(t); - if (!n) throw Error(`Unprocessed schema. This is a bug in Zod.`); - let r = /* @__PURE__ */ new Map(); - for (let t of e.seen.entries()) { - let n = e.metadataRegistry.get(t[0])?.id; - if (n) { - let e = r.get(n); - if (e && e !== t[0]) throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`); - r.set(n, t[0]); - } - } - let i = (t) => { - let r = e.target === `draft-2020-12` ? `$defs` : `definitions`; - if (e.external) { - let n = e.external.registry.get(t[0])?.id, i = e.external.uri ?? ((e) => e); - if (n) return { ref: i(n) }; - let a = t[1].defId ?? t[1].schema.id ?? `schema${e.counter++}`; - return t[1].defId = a, { - defId: a, - ref: `${i(`__shared`)}#/${r}/${a}` - }; - } - if (t[1] === n) return { ref: `#` }; - let i = `#/${r}/`, a = t[1].schema.id ?? `__schema${e.counter++}`; - return { - defId: a, - ref: i + a - }; - }, a = (e) => { - if (e[1].schema.$ref) return; - let t = e[1], { ref: n, defId: r } = i(e); - t.def = { ...t.schema }, r && (t.defId = r); - let a = t.schema; - for (let e in a) delete a[e]; - a.$ref = n; - }; - if (e.cycles === `throw`) for (let t of e.seen.entries()) { - let e = t[1]; - if (e.cycle) throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/ - -Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`); - } - for (let n of e.seen.entries()) { - let r = n[1]; - if (t === n[0]) { - a(n); - continue; - } - if (e.external) { - let r = e.external.registry.get(n[0])?.id; - if (t !== n[0] && r) { - a(n); - continue; - } - } - if (e.metadataRegistry.get(n[0])?.id) { - a(n); - continue; - } - if (r.cycle) { - a(n); - continue; - } - if (r.count > 1 && e.reused === `ref`) { - a(n); - continue; - } - } -} -function Q$11(e, t) { - let n = e.seen.get(t); - if (!n) throw Error(`Unprocessed schema. This is a bug in Zod.`); - let r = (t) => { - let n = e.seen.get(t); - if (n.ref === null) return; - let i = n.def ?? n.schema, a = { ...i }, o = n.ref; - if (n.ref = null, o) { - r(o); - let n = e.seen.get(o), s = n.schema; - if (s.$ref && (e.target === `draft-07` || e.target === `draft-04` || e.target === `openapi-3.0`) ? (i.allOf = i.allOf ?? [], i.allOf.push(s)) : Object.assign(i, s), Object.assign(i, a), t._zod.parent === o) for (let e in i) e === `$ref` || e === `allOf` || e in a || delete i[e]; - if (s.$ref && n.def) for (let e in i) e === `$ref` || e === `allOf` || e in n.def && JSON.stringify(i[e]) === JSON.stringify(n.def[e]) && delete i[e]; - } - let s = t._zod.parent; - if (s && s !== o) { - r(s); - let t = e.seen.get(s); - if (t?.schema.$ref && (i.$ref = t.schema.$ref, t.def)) for (let e in i) e === `$ref` || e === `allOf` || e in t.def && JSON.stringify(i[e]) === JSON.stringify(t.def[e]) && delete i[e]; - } - e.override({ - zodSchema: t, - jsonSchema: i, - path: n.path ?? [] - }); - }; - for (let t of [...e.seen.entries()].reverse()) r(t[0]); - let i = {}; - if (e.target === `draft-2020-12` ? i.$schema = `https://json-schema.org/draft/2020-12/schema` : e.target === `draft-07` ? i.$schema = `http://json-schema.org/draft-07/schema#` : e.target === `draft-04` ? i.$schema = `http://json-schema.org/draft-04/schema#` : e.target, e.external?.uri) { - let n = e.external.registry.get(t)?.id; - if (!n) throw Error("Schema is missing an `id` property"); - i.$id = e.external.uri(n); - } - Object.assign(i, n.def ?? n.schema); - let a = e.metadataRegistry.get(t)?.id; - a !== void 0 && i.id === a && delete i.id; - let o = e.external?.defs ?? {}; - for (let t of e.seen.entries()) { - let e = t[1]; - e.def && e.defId && (e.def.id === e.defId && delete e.def.id, o[e.defId] = e.def); - } - e.external || Object.keys(o).length > 0 && (e.target === `draft-2020-12` ? i.$defs = o : i.definitions = o); - try { - let n = JSON.parse(JSON.stringify(i)); - return Object.defineProperty(n, "~standard", { - value: { - ...t[`~standard`], - jsonSchema: { - input: qc$3(t, `input`, e.processors), - output: qc$3(t, `output`, e.processors) - } - }, - enumerable: !1, - writable: !1 - }), n; - } catch { - throw Error(`Error converting schema to JSON.`); - } -} -function $$11(e, t) { - let n = t ?? { seen: /* @__PURE__ */ new Set() }; - if (n.seen.has(e)) return !1; - n.seen.add(e); - let r = e._zod.def; - if (r.type === `transform`) return !0; - if (r.type === `array`) return $$11(r.element, n); - if (r.type === `set`) return $$11(r.valueType, n); - if (r.type === `lazy`) return $$11(r.getter(), n); - if (r.type === `promise` || r.type === `optional` || r.type === `nonoptional` || r.type === `nullable` || r.type === `readonly` || r.type === "default" || r.type === `prefault`) return $$11(r.innerType, n); - if (r.type === `intersection`) return $$11(r.left, n) || $$11(r.right, n); - if (r.type === `record` || r.type === `map`) return $$11(r.keyType, n) || $$11(r.valueType, n); - if (r.type === `pipe`) return e._zod.traits.has(`$ZodCodec`) ? !0 : $$11(r.in, n) || $$11(r.out, n); - if (r.type === `object`) { - for (let e in r.shape) if ($$11(r.shape[e], n)) return !0; - return !1; - } - if (r.type === `union`) { - for (let e of r.options) if ($$11(e, n)) return !0; - return !1; - } - if (r.type === `tuple`) { - for (let e of r.items) if ($$11(e, n)) return !0; - return !!(r.rest && $$11(r.rest, n)); - } - return !1; -} -const Kc$3 = (e, t = {}) => (n) => { - let r = Y$13({ - ...n, - processors: t - }); - return X$13(e, r), Z$12(r, e), Q$11(r, e); -}; -const qc$3 = (e, t, n = {}) => (r) => { - let { libraryOptions: i, target: a } = r ?? {}, o = Y$13({ - ...i ?? {}, - target: a, - io: t, - processors: n - }); - return X$13(e, o), Z$12(o, e), Q$11(o, e); -}; -const Jc$3 = { - guid: `uuid`, - url: `uri`, - datetime: `date-time`, - json_string: `json-string`, - regex: `` -}; -const Yc$3 = (e, t, n, r) => { - let i = n; - i.type = `string`; - let { minimum: a, maximum: o, format: s, patterns: c, contentEncoding: l } = e._zod.bag; - if (typeof a == `number` && (i.minLength = a), typeof o == `number` && (i.maxLength = o), s && (i.format = Jc$3[s] ?? s, i.format === `` && delete i.format, s === `time` && delete i.format), l && (i.contentEncoding = l), c && c.size > 0) { - let e = [...c]; - e.length === 1 ? i.pattern = e[0].source : e.length > 1 && (i.allOf = [...e.map((e) => ({ - ...t.target === `draft-07` || t.target === `draft-04` || t.target === `openapi-3.0` ? { type: `string` } : {}, - pattern: e.source - }))]); - } -}; -const Xc$3 = (e, t, n, r) => { - let i = n, { minimum: a, maximum: o, format: s, multipleOf: c, exclusiveMaximum: l, exclusiveMinimum: u } = e._zod.bag; - typeof s == `string` && s.includes(`int`) ? i.type = `integer` : i.type = `number`; - let d = typeof u == `number` && u >= (a ?? -Infinity), f = typeof l == `number` && l <= (o ?? Infinity), p = t.target === `draft-04` || t.target === `openapi-3.0`; - d ? p ? (i.minimum = u, i.exclusiveMinimum = !0) : i.exclusiveMinimum = u : typeof a == `number` && (i.minimum = a), f ? p ? (i.maximum = l, i.exclusiveMaximum = !0) : i.exclusiveMaximum = l : typeof o == `number` && (i.maximum = o), typeof c == `number` && (i.multipleOf = c); -}; -const Zc$3 = (e, t, n, r) => { - n.type = `boolean`; -}; -const Qc$3 = (e, t, n, r) => { - if (t.unrepresentable === `throw`) throw Error(`BigInt cannot be represented in JSON Schema`); -}; -const $c$3 = (e, t, n, r) => { - if (t.unrepresentable === `throw`) throw Error(`Symbols cannot be represented in JSON Schema`); -}; -const el$3 = (e, t, n, r) => { - t.target === `openapi-3.0` ? (n.type = `string`, n.nullable = !0, n.enum = [null]) : n.type = `null`; -}; -const tl$3 = (e, t, n, r) => { - if (t.unrepresentable === `throw`) throw Error(`Undefined cannot be represented in JSON Schema`); -}; -const nl$3 = (e, t, n, r) => { - if (t.unrepresentable === `throw`) throw Error(`Void cannot be represented in JSON Schema`); -}; -const rl$3 = (e, t, n, r) => { - n.not = {}; -}; -const il$3 = (e, t, n, r) => {}; -const al$3 = (e, t, n, r) => {}; -const ol$3 = (e, t, n, r) => { - if (t.unrepresentable === `throw`) throw Error(`Date cannot be represented in JSON Schema`); -}; -const sl$3 = (e, t, n, r) => { - let i = e._zod.def, a = ne$7(i.entries); - a.every((e) => typeof e == `number`) && (n.type = `number`), a.every((e) => typeof e == `string`) && (n.type = `string`), n.enum = a; -}; -const cl$3 = (e, t, n, r) => { - let i = e._zod.def, a = []; - for (let e of i.values) if (e === void 0) { - if (t.unrepresentable === `throw`) throw Error("Literal `undefined` cannot be represented in JSON Schema"); - } else if (typeof e == `bigint`) { - if (t.unrepresentable === `throw`) throw Error(`BigInt literals cannot be represented in JSON Schema`); - a.push(Number(e)); - } else a.push(e); - if (a.length !== 0) if (a.length === 1) { - let e = a[0]; - n.type = e === null ? `null` : typeof e, t.target === `draft-04` || t.target === `openapi-3.0` ? n.enum = [e] : n.const = e; - } else a.every((e) => typeof e == `number`) && (n.type = `number`), a.every((e) => typeof e == `string`) && (n.type = `string`), a.every((e) => typeof e == `boolean`) && (n.type = `boolean`), a.every((e) => e === null) && (n.type = `null`), n.enum = a; -}; -const ll$3 = (e, t, n, r) => { - if (t.unrepresentable === `throw`) throw Error(`NaN cannot be represented in JSON Schema`); -}; -const ul$3 = (e, t, n, r) => { - let i = n, a = e._zod.pattern; - if (!a) throw Error(`Pattern not found in template literal`); - i.type = `string`, i.pattern = a.source; -}; -const dl$3 = (e, t, n, r) => { - let i = n, a = { - type: `string`, - format: `binary`, - contentEncoding: `binary` - }, { minimum: o, maximum: s, mime: c } = e._zod.bag; - o !== void 0 && (a.minLength = o), s !== void 0 && (a.maxLength = s), c ? c.length === 1 ? (a.contentMediaType = c[0], Object.assign(i, a)) : (Object.assign(i, a), i.anyOf = c.map((e) => ({ contentMediaType: e }))) : Object.assign(i, a); -}; -const fl$3 = (e, t, n, r) => { - n.type = `boolean`; -}; -const pl$3 = (e, t, n, r) => { - if (t.unrepresentable === `throw`) throw Error(`Custom types cannot be represented in JSON Schema`); -}; -const ml$3 = (e, t, n, r) => { - if (t.unrepresentable === `throw`) throw Error(`Function types cannot be represented in JSON Schema`); -}; -const hl$3 = (e, t, n, r) => { - if (t.unrepresentable === `throw`) throw Error(`Transforms cannot be represented in JSON Schema`); -}; -const gl$3 = (e, t, n, r) => { - if (t.unrepresentable === `throw`) throw Error(`Map cannot be represented in JSON Schema`); -}; -const _l$3 = (e, t, n, r) => { - if (t.unrepresentable === `throw`) throw Error(`Set cannot be represented in JSON Schema`); -}; -const vl$3 = (e, t, n, r) => { - let i = n, a = e._zod.def, { minimum: o, maximum: s } = e._zod.bag; - typeof o == `number` && (i.minItems = o), typeof s == `number` && (i.maxItems = s), i.type = `array`, i.items = X$13(a.element, t, { - ...r, - path: [...r.path, `items`] - }); -}; -const yl$3 = (e, t, n, r) => { - let i = n, a = e._zod.def; - i.type = `object`, i.properties = {}; - let o = a.shape; - for (let e in o) i.properties[e] = X$13(o[e], t, { - ...r, - path: [ - ...r.path, - `properties`, - e - ] - }); - let s = new Set(Object.keys(o)), c = new Set([...s].filter((e) => { - let n = a.shape[e]._zod; - return t.io === `input` ? n.optin === void 0 : n.optout === void 0; - })); - c.size > 0 && (i.required = Array.from(c)), a.catchall?._zod.def.type === `never` ? i.additionalProperties = !1 : a.catchall ? a.catchall && (i.additionalProperties = X$13(a.catchall, t, { - ...r, - path: [...r.path, `additionalProperties`] - })) : t.io === `output` && (i.additionalProperties = !1); -}; -const bl$3 = (e, t, n, r) => { - let i = e._zod.def, a = i.inclusive === !1, o = i.options.map((e, n) => X$13(e, t, { - ...r, - path: [ - ...r.path, - a ? `oneOf` : `anyOf`, - n - ] - })); - a ? n.oneOf = o : n.anyOf = o; -}; -const xl$3 = (e, t, n, r) => { - let i = e._zod.def, a = X$13(i.left, t, { - ...r, - path: [ - ...r.path, - `allOf`, - 0 - ] - }), o = X$13(i.right, t, { - ...r, - path: [ - ...r.path, - `allOf`, - 1 - ] - }), s = (e) => `allOf` in e && Object.keys(e).length === 1; - n.allOf = [...s(a) ? a.allOf : [a], ...s(o) ? o.allOf : [o]]; -}; -const Sl$3 = (e, t, n, r) => { - let i = n, a = e._zod.def; - i.type = `array`; - let o = t.target === `draft-2020-12` ? `prefixItems` : `items`, s = t.target === `draft-2020-12` || t.target === `openapi-3.0` ? `items` : `additionalItems`, c = a.items.map((e, n) => X$13(e, t, { - ...r, - path: [ - ...r.path, - o, - n - ] - })), l = a.rest ? X$13(a.rest, t, { - ...r, - path: [ - ...r.path, - s, - ...t.target === `openapi-3.0` ? [a.items.length] : [] - ] - }) : null; - t.target === `draft-2020-12` ? (i.prefixItems = c, l && (i.items = l)) : t.target === `openapi-3.0` ? (i.items = { anyOf: c }, l && i.items.anyOf.push(l), i.minItems = c.length, l || (i.maxItems = c.length)) : (i.items = c, l && (i.additionalItems = l)); - let { minimum: u, maximum: d } = e._zod.bag; - typeof u == `number` && (i.minItems = u), typeof d == `number` && (i.maxItems = d); -}; -const Cl$3 = (e, t, n, r) => { - let i = n, a = e._zod.def; - i.type = `object`; - let o = a.keyType, s = o._zod.bag?.patterns; - if (a.mode === `loose` && s && s.size > 0) { - let e = X$13(a.valueType, t, { - ...r, - path: [ - ...r.path, - `patternProperties`, - `*` - ] - }); - i.patternProperties = {}; - for (let t of s) i.patternProperties[t.source] = e; - } else (t.target === `draft-07` || t.target === `draft-2020-12`) && (i.propertyNames = X$13(a.keyType, t, { - ...r, - path: [...r.path, `propertyNames`] - })), i.additionalProperties = X$13(a.valueType, t, { - ...r, - path: [...r.path, `additionalProperties`] - }); - let c = o._zod.values; - if (c) { - let e = [...c].filter((e) => typeof e == `string` || typeof e == `number`); - e.length > 0 && (i.required = e); - } -}; -const wl$3 = (e, t, n, r) => { - let i = e._zod.def, a = X$13(i.innerType, t, r), o = t.seen.get(e); - t.target === `openapi-3.0` ? (o.ref = i.innerType, n.nullable = !0) : n.anyOf = [a, { type: `null` }]; -}; -const Tl$3 = (e, t, n, r) => { - let i = e._zod.def; - X$13(i.innerType, t, r); - let a = t.seen.get(e); - a.ref = i.innerType; -}; -const El$3 = (e, t, n, r) => { - let i = e._zod.def; - X$13(i.innerType, t, r); - let a = t.seen.get(e); - a.ref = i.innerType, n.default = JSON.parse(JSON.stringify(i.defaultValue)); -}; -const Dl$3 = (e, t, n, r) => { - let i = e._zod.def; - X$13(i.innerType, t, r); - let a = t.seen.get(e); - a.ref = i.innerType, t.io === `input` && (n._prefault = JSON.parse(JSON.stringify(i.defaultValue))); -}; -const Ol$3 = (e, t, n, r) => { - let i = e._zod.def; - X$13(i.innerType, t, r); - let a = t.seen.get(e); - a.ref = i.innerType; - let o; - try { - o = i.catchValue(void 0); - } catch { - throw Error(`Dynamic catch values are not supported in JSON Schema`); - } - n.default = o; -}; -const kl$3 = (e, t, n, r) => { - let i = e._zod.def, a = i.in._zod.traits.has(`$ZodTransform`), o = t.io === `input` ? a ? i.out : i.in : i.out; - X$13(o, t, r); - let s = t.seen.get(e); - s.ref = o; -}; -const Al$3 = (e, t, n, r) => { - let i = e._zod.def; - X$13(i.innerType, t, r); - let a = t.seen.get(e); - a.ref = i.innerType, n.readOnly = !0; -}; -const jl$3 = (e, t, n, r) => { - let i = e._zod.def; - X$13(i.innerType, t, r); - let a = t.seen.get(e); - a.ref = i.innerType; -}; -const Ml$3 = (e, t, n, r) => { - let i = e._zod.def; - X$13(i.innerType, t, r); - let a = t.seen.get(e); - a.ref = i.innerType; -}; -const Nl$3 = (e, t, n, r) => { - let i = e._zod.innerType; - X$13(i, t, r); - let a = t.seen.get(e); - a.ref = i; -}; -const Pl$3 = { - string: Yc$3, - number: Xc$3, - boolean: Zc$3, - bigint: Qc$3, - symbol: $c$3, - null: el$3, - undefined: tl$3, - void: nl$3, - never: rl$3, - any: il$3, - unknown: al$3, - date: ol$3, - enum: sl$3, - literal: cl$3, - nan: ll$3, - template_literal: ul$3, - file: dl$3, - success: fl$3, - custom: pl$3, - function: ml$3, - transform: hl$3, - map: gl$3, - set: _l$3, - array: vl$3, - object: yl$3, - union: bl$3, - intersection: xl$3, - tuple: Sl$3, - record: Cl$3, - nullable: wl$3, - nonoptional: Tl$3, - default: El$3, - prefault: Dl$3, - catch: Ol$3, - pipe: kl$3, - readonly: Al$3, - promise: jl$3, - optional: Ml$3, - lazy: Nl$3 -}; -function Fl$3(e, t) { - if (`_idmap` in e) { - let n = e, r = Y$13({ - ...t, - processors: Pl$3 - }), i = {}; - for (let e of n._idmap.entries()) { - let [t, n] = e; - X$13(n, r); - } - let a = {}; - r.external = { - registry: n, - uri: t?.uri, - defs: i - }; - for (let e of n._idmap.entries()) { - let [t, n] = e; - Z$12(r, n), a[t] = Q$11(r, n); - } - return Object.keys(i).length > 0 && (a.__shared = { [r.target === `draft-2020-12` ? `$defs` : `definitions`]: i }), { schemas: a }; - } - let n = Y$13({ - ...t, - processors: Pl$3 - }); - return X$13(e, n), Z$12(n, e), Q$11(n, e); -} -var Il$3 = class { - get metadataRegistry() { - return this.ctx.metadataRegistry; - } - get target() { - return this.ctx.target; - } - get unrepresentable() { - return this.ctx.unrepresentable; - } - get override() { - return this.ctx.override; - } - get io() { - return this.ctx.io; - } - get counter() { - return this.ctx.counter; - } - set counter(e) { - this.ctx.counter = e; - } - get seen() { - return this.ctx.seen; - } - constructor(e) { - let t = e?.target ?? `draft-2020-12`; - t === `draft-4` && (t = `draft-04`), t === `draft-7` && (t = `draft-07`), this.ctx = Y$13({ - processors: Pl$3, - target: t, - ...e?.metadata && { metadata: e.metadata }, - ...e?.unrepresentable && { unrepresentable: e.unrepresentable }, - ...e?.override && { override: e.override }, - ...e?.io && { io: e.io } - }); - } - process(e, t = { - path: [], - schemaPath: [] - }) { - return X$13(e, this.ctx, t); - } - emit(e, t) { - t && (t.cycles && (this.ctx.cycles = t.cycles), t.reused && (this.ctx.reused = t.reused), t.external && (this.ctx.external = t.external)), Z$12(this.ctx, e); - let { "~standard": n, ...r } = Q$11(this.ctx, e); - return r; - } -}; -var Ll$3 = t$13({}); -var Rl$3 = t$13({ - $ZodAny: () => jr$5, - $ZodArray: () => Lr$5, - $ZodAsyncError: () => o$13, - $ZodBase64: () => gr$4, - $ZodBase64URL: () => vr$5, - $ZodBigInt: () => Er$5, - $ZodBigIntFormat: () => Dr$5, - $ZodBoolean: () => Tr$5, - $ZodCIDRv4: () => pr$5, - $ZodCIDRv6: () => mr$4, - $ZodCUID: () => tr$4, - $ZodCUID2: () => nr$4, - $ZodCatch: () => bi$5, - $ZodCheck: () => B$13, - $ZodCheckBigIntFormat: () => kn$6, - $ZodCheckEndsWith: () => Vn$4, - $ZodCheckGreaterThan: () => En$6, - $ZodCheckIncludes: () => zn$4, - $ZodCheckLengthEquals: () => Fn$4, - $ZodCheckLessThan: () => Tn$6, - $ZodCheckLowerCase: () => Ln$4, - $ZodCheckMaxLength: () => Nn$5, - $ZodCheckMaxSize: () => An$5, - $ZodCheckMimeType: () => Wn$4, - $ZodCheckMinLength: () => Pn$5, - $ZodCheckMinSize: () => jn$5, - $ZodCheckMultipleOf: () => Dn$6, - $ZodCheckNumberFormat: () => On$6, - $ZodCheckOverwrite: () => Gn$4, - $ZodCheckProperty: () => Un$4, - $ZodCheckRegex: () => In$4, - $ZodCheckSizeEquals: () => Mn$6, - $ZodCheckStartsWith: () => Bn$4, - $ZodCheckStringFormat: () => V$12, - $ZodCheckUpperCase: () => Rn$4, - $ZodCodec: () => wi$6, - $ZodCustom: () => Pi$6, - $ZodCustomStringFormat: () => Sr$5, - $ZodDate: () => Fr$5, - $ZodDefault: () => mi$5, - $ZodDiscriminatedUnion: () => qr$5, - $ZodE164: () => yr$5, - $ZodEmail: () => Zn$4, - $ZodEmoji: () => $n$4, - $ZodEncodeError: () => s$11, - $ZodEnum: () => oi$5, - $ZodError: () => We$9, - $ZodExactOptional: () => fi$5, - $ZodFile: () => ci$5, - $ZodFunction: () => ji$6, - $ZodGUID: () => Yn$4, - $ZodIPv4: () => ur$5, - $ZodIPv6: () => dr$5, - $ZodISODate: () => sr$4, - $ZodISODateTime: () => or$4, - $ZodISODuration: () => lr$5, - $ZodISOTime: () => cr$4, - $ZodIntersection: () => Jr$5, - $ZodJWT: () => xr$5, - $ZodKSUID: () => ar$4, - $ZodLazy: () => Ni$6, - $ZodLiteral: () => si$5, - $ZodMAC: () => fr$4, - $ZodMap: () => ni$5, - $ZodNaN: () => xi$5, - $ZodNanoID: () => er$4, - $ZodNever: () => Nr$5, - $ZodNonOptional: () => _i$5, - $ZodNull: () => Ar$5, - $ZodNullable: () => pi$5, - $ZodNumber: () => Cr$5, - $ZodNumberFormat: () => wr$5, - $ZodObject: () => Vr$5, - $ZodObjectJIT: () => Hr$5, - $ZodOptional: () => di$5, - $ZodPipe: () => Si$6, - $ZodPrefault: () => gi$5, - $ZodPreprocess: () => Di$6, - $ZodPromise: () => Mi$6, - $ZodReadonly: () => Oi$6, - $ZodRealError: () => M$12, - $ZodRecord: () => ti$5, - $ZodRegistry: () => zo$4, - $ZodSet: () => ii$5, - $ZodString: () => Jn$4, - $ZodStringFormat: () => U$11, - $ZodSuccess: () => yi$5, - $ZodSymbol: () => Or$5, - $ZodTemplateLiteral: () => Ai$6, - $ZodTransform: () => li$5, - $ZodTuple: () => Zr$5, - $ZodType: () => H$11, - $ZodULID: () => rr$4, - $ZodURL: () => Qn$4, - $ZodUUID: () => Xn$5, - $ZodUndefined: () => kr$5, - $ZodUnion: () => Wr$5, - $ZodUnknown: () => Mr$5, - $ZodVoid: () => Pr$5, - $ZodXID: () => ir$4, - $ZodXor: () => Kr$5, - $brand: () => a$13, - $constructor: () => i$16, - $input: () => Ro$4, - $output: () => Lo$4, - Doc: () => Kn$4, - JSONSchema: () => Ll$3, - JSONSchemaGenerator: () => Il$3, - NEVER: () => r$17, - TimePrecision: () => fs$4, - _any: () => Ns$4, - _array: () => pc$3, - _base64: () => cs$4, - _base64url: () => ls$4, - _bigint: () => Es$4, - _boolean: () => ws$4, - _catch: () => Mc$3, - _check: () => Vc$3, - _cidrv4: () => os$4, - _cidrv6: () => ss$4, - _coercedBigint: () => Ds$4, - _coercedBoolean: () => Ts$4, - _coercedDate: () => Rs$3, - _coercedNumber: () => vs$4, - _coercedString: () => Ho$4, - _cuid: () => Qo$4, - _cuid2: () => $o$4, - _custom: () => Rc$3, - _date: () => Ls$4, - _decode: () => nt$10, - _decodeAsync: () => ot$8, - _default: () => kc$3, - _discriminatedUnion: () => gc$3, - _e164: () => us$4, - _email: () => Uo$4, - _emoji: () => Xo$4, - _encode: () => et$9, - _encodeAsync: () => it$8, - _endsWith: () => ac$3, - _enum: () => Sc$3, - _file: () => Tc$3, - _float32: () => bs$4, - _float64: () => xs$4, - _gt: () => Hs$3, - _gte: () => q$10, - _guid: () => Wo$4, - _includes: () => rc$3, - _int: () => ys$4, - _int32: () => Ss$4, - _int64: () => Os$4, - _intersection: () => _c$3, - _ipv4: () => rs$4, - _ipv6: () => is$4, - _isoDate: () => ms$4, - _isoDateTime: () => ps$4, - _isoDuration: () => gs$4, - _isoTime: () => hs$4, - _jwt: () => ds$4, - _ksuid: () => ns$4, - _lazy: () => Ic$3, - _length: () => $s$3, - _literal: () => wc$3, - _lowercase: () => tc$3, - _lt: () => Bs$3, - _lte: () => Vs$3, - _mac: () => as$4, - _map: () => bc$3, - _max: () => Vs$3, - _maxLength: () => Zs$3, - _maxSize: () => Js$3, - _mime: () => sc$3, - _min: () => q$10, - _minLength: () => Qs$3, - _minSize: () => Ys$3, - _multipleOf: () => qs$3, - _nan: () => zs$3, - _nanoid: () => Zo$4, - _nativeEnum: () => Cc$3, - _negative: () => Ws$3, - _never: () => Fs$4, - _nonnegative: () => Ks$3, - _nonoptional: () => Ac$3, - _nonpositive: () => Gs$3, - _normalize: () => cc$3, - _null: () => Ms$4, - _nullable: () => Oc$3, - _number: () => _s$4, - _optional: () => Dc$3, - _overwrite: () => J$10, - _parse: () => N$11, - _parseAsync: () => P$11, - _pipe: () => Nc$3, - _positive: () => Us$3, - _promise: () => Lc$3, - _property: () => oc$3, - _readonly: () => Pc$3, - _record: () => yc$3, - _refine: () => zc$3, - _regex: () => ec$3, - _safeDecode: () => ut$8, - _safeDecodeAsync: () => mt$8, - _safeEncode: () => ct$8, - _safeEncodeAsync: () => ft$8, - _safeParse: () => F$11, - _safeParseAsync: () => I$11, - _set: () => xc$3, - _size: () => Xs$3, - _slugify: () => fc$3, - _startsWith: () => ic$3, - _string: () => Vo$4, - _stringFormat: () => Gc$3, - _stringbool: () => Wc$3, - _success: () => jc$3, - _superRefine: () => Bc$3, - _symbol: () => As$4, - _templateLiteral: () => Fc$3, - _toLowerCase: () => uc$3, - _toUpperCase: () => dc$3, - _transform: () => Ec$3, - _trim: () => lc$3, - _tuple: () => vc$3, - _uint32: () => Cs$4, - _uint64: () => ks$4, - _ulid: () => es$4, - _undefined: () => js$4, - _union: () => mc$3, - _unknown: () => Ps$4, - _uppercase: () => nc$3, - _url: () => Yo$4, - _uuid: () => Go$4, - _uuidv4: () => Ko$4, - _uuidv6: () => qo$4, - _uuidv7: () => Jo$4, - _void: () => Is$4, - _xid: () => ts$4, - _xor: () => hc$3, - clone: () => C$14, - config: () => l$12, - createStandardJSONSchemaMethod: () => qc$3, - createToJSONSchemaMethod: () => Kc$3, - decode: () => rt$9, - decodeAsync: () => st$8, - describe: () => Hc$3, - encode: () => tt$10, - encodeAsync: () => at$8, - extractDefs: () => Z$12, - finalize: () => Q$11, - flattenError: () => Ge$9, - formatError: () => Ke$9, - globalConfig: () => c$13, - globalRegistry: () => K$10, - initializeContext: () => Y$13, - isValidBase64: () => hr$4, - isValidBase64URL: () => _r$5, - isValidJWT: () => br$5, - locales: () => Fo$4, - meta: () => Uc$3, - parse: () => Xe$9, - parseAsync: () => Ze$10, - prettifyError: () => Ye$10, - process: () => X$13, - regexes: () => gt$8, - registry: () => Bo$4, - safeDecode: () => dt$8, - safeDecodeAsync: () => ht$8, - safeEncode: () => lt$8, - safeEncodeAsync: () => pt$8, - safeParse: () => Qe$9, - safeParseAsync: () => $e$9, - toDotPath: () => Je$10, - toJSONSchema: () => Fl$3, - treeifyError: () => qe$9, - util: () => u$14, - version: () => qn$4 -}); -//#endregion -//#region node_modules/eve/dist/src/compiled/zod/index.js -var Si$5 = t$13({ - endsWith: () => ac$3, - gt: () => Hs$3, - gte: () => q$10, - includes: () => rc$3, - length: () => $s$3, - lowercase: () => tc$3, - lt: () => Bs$3, - lte: () => Vs$3, - maxLength: () => Zs$3, - maxSize: () => Js$3, - mime: () => sc$3, - minLength: () => Qs$3, - minSize: () => Ys$3, - multipleOf: () => qs$3, - negative: () => Ws$3, - nonnegative: () => Ks$3, - nonpositive: () => Gs$3, - normalize: () => cc$3, - overwrite: () => J$10, - positive: () => Us$3, - property: () => oc$3, - regex: () => ec$3, - size: () => Xs$3, - slugify: () => fc$3, - startsWith: () => ic$3, - toLowerCase: () => uc$3, - toUpperCase: () => dc$3, - trim: () => lc$3, - uppercase: () => nc$3 -}); -var Ci$5 = t$13({ - ZodISODate: () => Ei$5, - ZodISODateTime: () => wi$5, - ZodISODuration: () => Ai$5, - ZodISOTime: () => Oi$5, - date: () => Di$5, - datetime: () => Ti$5, - duration: () => ji$5, - time: () => ki$5 -}); -const wi$5 = i$16(`ZodISODateTime`, (e, t) => { - or$4.init(e, t), T$13.init(e, t); -}); -function Ti$5(e) { - return ps$4(wi$5, e); -} -const Ei$5 = i$16(`ZodISODate`, (e, t) => { - sr$4.init(e, t), T$13.init(e, t); -}); -function Di$5(e) { - return ms$4(Ei$5, e); -} -const Oi$5 = i$16(`ZodISOTime`, (e, t) => { - cr$4.init(e, t), T$13.init(e, t); -}); -function ki$5(e) { - return hs$4(Oi$5, e); -} -const Ai$5 = i$16(`ZodISODuration`, (e, t) => { - lr$5.init(e, t), T$13.init(e, t); -}); -function ji$5(e) { - return gs$4(Ai$5, e); -} -const Mi$5 = (e, t) => { - We$9.init(e, t), e.name = `ZodError`, Object.defineProperties(e, { - format: { value: (t) => Ke$9(e, t) }, - flatten: { value: (t) => Ge$9(e, t) }, - addIssue: { value: (t) => { - e.issues.push(t), e.message = JSON.stringify(e.issues, re$8, 2); - } }, - addIssues: { value: (t) => { - e.issues.push(...t), e.message = JSON.stringify(e.issues, re$8, 2); - } }, - isEmpty: { get() { - return e.issues.length === 0; - } } - }); -}; -const Ni$5 = i$16(`ZodError`, Mi$5); -const b$10 = i$16(`ZodError`, Mi$5, { Parent: Error }); -const Pi$5 = N$11(b$10); -const Fi$5 = P$11(b$10); -const Ii$5 = F$11(b$10); -const Li$5 = I$11(b$10); -const Ri$5 = et$9(b$10); -const zi$5 = nt$10(b$10); -const Bi$5 = it$8(b$10); -const Vi$5 = ot$8(b$10); -const Hi$5 = ct$8(b$10); -const Ui$5 = ut$8(b$10); -const Wi$5 = ft$8(b$10); -const Gi$5 = mt$8(b$10); -var Ki$5 = t$13({ - ZodAny: () => Qa$4, - ZodArray: () => oo$3, - ZodBase64: () => Ca$5, - ZodBase64URL: () => Ta$5, - ZodBigInt: () => R$11, - ZodBigIntFormat: () => Ua$5, - ZodBoolean: () => L$9, - ZodCIDRv4: () => ya$5, - ZodCIDRv6: () => xa$5, - ZodCUID: () => M$11, - ZodCUID2: () => N$10, - ZodCatch: () => Yo$3, - ZodCodec: () => Y$12, - ZodCustom: () => Z$11, - ZodCustomStringFormat: () => P$10, - ZodDate: () => io$3, - ZodDefault: () => Vo$3, - ZodDiscriminatedUnion: () => ho$3, - ZodE164: () => Da$5, - ZodEmail: () => E$13, - ZodEmoji: () => A$11, - ZodEnum: () => G$8, - ZodExactOptional: () => Lo$3, - ZodFile: () => Mo$3, - ZodFunction: () => ds$3, - ZodGUID: () => D$12, - ZodIPv4: () => pa$5, - ZodIPv6: () => _a$5, - ZodIntersection: () => _o$3, - ZodJWT: () => ka$5, - ZodKSUID: () => da$5, - ZodLazy: () => ss$3, - ZodLiteral: () => Ao$3, - ZodMAC: () => ha$5, - ZodMap: () => wo$3, - ZodNaN: () => Zo$3, - ZodNanoID: () => j$11, - ZodNever: () => to$4, - ZodNonOptional: () => Go$3, - ZodNull: () => Xa$4, - ZodNullable: () => zo$3, - ZodNumber: () => F$10, - ZodNumberFormat: () => I$10, - ZodObject: () => H$10, - ZodOptional: () => Io$3, - ZodPipe: () => J$9, - ZodPrefault: () => Uo$3, - ZodPreprocess: () => ns$3, - ZodPromise: () => ls$3, - ZodReadonly: () => rs$3, - ZodRecord: () => W$8, - ZodSet: () => Eo$3, - ZodString: () => C$13, - ZodStringFormat: () => T$13, - ZodSuccess: () => qo$3, - ZodSymbol: () => Ka$5, - ZodTemplateLiteral: () => as$3, - ZodTransform: () => Po$3, - ZodTuple: () => yo$3, - ZodType: () => x$11, - ZodULID: () => sa$5, - ZodURL: () => k$12, - ZodUUID: () => O$11, - ZodUndefined: () => Ja$4, - ZodUnion: () => U$10, - ZodUnknown: () => eo$4, - ZodVoid: () => no$3, - ZodXID: () => la$5, - ZodXor: () => po$3, - _ZodString: () => S$12, - _default: () => Ho$3, - _function: () => X$12, - any: () => $a$4, - array: () => V$11, - base64: () => wa$5, - base64url: () => Ea$5, - bigint: () => Ha$5, - boolean: () => Va$5, - catch: () => Xo$3, - check: () => fs$3, - cidrv4: () => ba$5, - cidrv6: () => Sa$5, - codec: () => es$3, - cuid: () => aa$5, - cuid2: () => oa$5, - custom: () => ps$3, - date: () => ao$3, - describe: () => gs$3, - discriminatedUnion: () => go$3, - e164: () => Oa$5, - email: () => Yi$5, - emoji: () => ra$5, - enum: () => Oo$3, - exactOptional: () => Ro$3, - file: () => No$3, - float32: () => La$5, - float64: () => Ra$5, - function: () => X$12, - guid: () => Xi$5, - hash: () => Pa$5, - hex: () => Na$5, - hostname: () => Ma$5, - httpUrl: () => na$5, - instanceof: () => vs$3, - int: () => Ia$5, - int32: () => za$5, - int64: () => Wa$5, - intersection: () => vo$3, - invertCodec: () => ts$3, - ipv4: () => ma$5, - ipv6: () => va$5, - json: () => bs$3, - jwt: () => Aa$5, - keyof: () => so$3, - ksuid: () => fa$5, - lazy: () => cs$3, - literal: () => jo$3, - looseObject: () => uo$3, - looseRecord: () => Co$3, - mac: () => ga$5, - map: () => To$3, - meta: () => _s$3, - nan: () => Qo$3, - nanoid: () => ia$5, - nativeEnum: () => ko$3, - never: () => B$12, - nonoptional: () => Ko$3, - null: () => Za$4, - nullable: () => q$9, - nullish: () => Bo$3, - number: () => Fa$5, - object: () => co$3, - optional: () => K$9, - partialRecord: () => So$3, - pipe: () => $o$3, - prefault: () => Wo$3, - preprocess: () => xs$3, - promise: () => us$3, - readonly: () => is$3, - record: () => xo$3, - refine: () => ms$3, - set: () => Do$3, - strictObject: () => lo$3, - string: () => w$13, - stringFormat: () => ja$5, - stringbool: () => ys$3, - success: () => Jo$3, - superRefine: () => hs$3, - symbol: () => qa$5, - templateLiteral: () => os$3, - transform: () => Fo$3, - tuple: () => bo$3, - uint32: () => Ba$5, - uint64: () => Ga$5, - ulid: () => ca$5, - undefined: () => Ya$4, - union: () => fo$3, - unknown: () => z$11, - url: () => ta$5, - uuid: () => Zi$5, - uuidv4: () => Qi$5, - uuidv6: () => $i$5, - uuidv7: () => ea$5, - void: () => ro$3, - xid: () => ua$5, - xor: () => mo$3 -}); -const qi$5 = /* @__PURE__ */ new WeakMap(); -function Ji$5(e, t, n) { - let r = Object.getPrototypeOf(e), i = qi$5.get(r); - if (i || (i = /* @__PURE__ */ new Set(), qi$5.set(r, i)), !i.has(t)) { - i.add(t); - for (let e in n) { - let t = n[e]; - Object.defineProperty(r, e, { - configurable: !0, - enumerable: !1, - get() { - let n = t.bind(this); - return Object.defineProperty(this, e, { - configurable: !0, - writable: !0, - enumerable: !0, - value: n - }), n; - }, - set(t) { - Object.defineProperty(this, e, { - configurable: !0, - writable: !0, - enumerable: !0, - value: t - }); - } - }); - } - } -} -const x$11 = i$16(`ZodType`, (e, t) => (H$11.init(e, t), Object.assign(e[`~standard`], { jsonSchema: { - input: qc$3(e, `input`), - output: qc$3(e, `output`) -} }), e.toJSONSchema = Kc$3(e, {}), e.def = t, e.type = t.type, Object.defineProperty(e, "_def", { value: t }), e.parse = (t, n) => Pi$5(e, t, n, { callee: e.parse }), e.safeParse = (t, n) => Ii$5(e, t, n), e.parseAsync = async (t, n) => Fi$5(e, t, n, { callee: e.parseAsync }), e.safeParseAsync = async (t, n) => Li$5(e, t, n), e.spa = e.safeParseAsync, e.encode = (t, n) => Ri$5(e, t, n), e.decode = (t, n) => zi$5(e, t, n), e.encodeAsync = async (t, n) => Bi$5(e, t, n), e.decodeAsync = async (t, n) => Vi$5(e, t, n), e.safeEncode = (t, n) => Hi$5(e, t, n), e.safeDecode = (t, n) => Ui$5(e, t, n), e.safeEncodeAsync = async (t, n) => Wi$5(e, t, n), e.safeDecodeAsync = async (t, n) => Gi$5(e, t, n), Ji$5(e, `ZodType`, { - check(...e) { - let t = this.def; - return this.clone(y$8(t, { checks: [...t.checks ?? [], ...e.map((e) => typeof e == `function` ? { _zod: { - check: e, - def: { check: `custom` }, - onattach: [] - } } : e)] }), { parent: !0 }); - }, - with(...e) { - return this.check(...e); - }, - clone(e, t) { - return C$14(this, e, t); - }, - brand() { - return this; - }, - register(e, t) { - return e.add(this, t), this; - }, - refine(e, t) { - return this.check(ms$3(e, t)); - }, - superRefine(e, t) { - return this.check(hs$3(e, t)); - }, - overwrite(e) { - return this.check(J$10(e)); - }, - optional() { - return K$9(this); - }, - exactOptional() { - return Ro$3(this); - }, - nullable() { - return q$9(this); - }, - nullish() { - return K$9(q$9(this)); - }, - nonoptional(e) { - return Ko$3(this, e); - }, - array() { - return V$11(this); - }, - or(e) { - return fo$3([this, e]); - }, - and(e) { - return vo$3(this, e); - }, - transform(e) { - return $o$3(this, Fo$3(e)); - }, - default(e) { - return Ho$3(this, e); - }, - prefault(e) { - return Wo$3(this, e); - }, - catch(e) { - return Xo$3(this, e); - }, - pipe(e) { - return $o$3(this, e); - }, - readonly() { - return is$3(this); - }, - describe(e) { - let t = this.clone(); - return K$10.add(t, { description: e }), t; - }, - meta(...e) { - if (e.length === 0) return K$10.get(this); - let t = this.clone(); - return K$10.add(t, e[0]), t; - }, - isOptional() { - return this.safeParse(void 0).success; - }, - isNullable() { - return this.safeParse(null).success; - }, - apply(e) { - return e(this); - } -}), Object.defineProperty(e, "description", { - get() { - return K$10.get(e)?.description; - }, - configurable: !0 -}), e)); -const S$12 = i$16(`_ZodString`, (e, t) => { - Jn$4.init(e, t), x$11.init(e, t), e._zod.processJSONSchema = (t, n, r) => Yc$3(e, t, n, r); - let n = e._zod.bag; - e.format = n.format ?? null, e.minLength = n.minimum ?? null, e.maxLength = n.maximum ?? null, Ji$5(e, `_ZodString`, { - regex(...e) { - return this.check(ec$3(...e)); - }, - includes(...e) { - return this.check(rc$3(...e)); - }, - startsWith(...e) { - return this.check(ic$3(...e)); - }, - endsWith(...e) { - return this.check(ac$3(...e)); - }, - min(...e) { - return this.check(Qs$3(...e)); - }, - max(...e) { - return this.check(Zs$3(...e)); - }, - length(...e) { - return this.check($s$3(...e)); - }, - nonempty(...e) { - return this.check(Qs$3(1, ...e)); - }, - lowercase(e) { - return this.check(tc$3(e)); - }, - uppercase(e) { - return this.check(nc$3(e)); - }, - trim() { - return this.check(lc$3()); - }, - normalize(...e) { - return this.check(cc$3(...e)); - }, - toLowerCase() { - return this.check(uc$3()); - }, - toUpperCase() { - return this.check(dc$3()); - }, - slugify() { - return this.check(fc$3()); - } - }); -}); -const C$13 = i$16(`ZodString`, (e, t) => { - Jn$4.init(e, t), S$12.init(e, t), e.email = (t) => e.check(Uo$4(E$13, t)), e.url = (t) => e.check(Yo$4(k$12, t)), e.jwt = (t) => e.check(ds$4(ka$5, t)), e.emoji = (t) => e.check(Xo$4(A$11, t)), e.guid = (t) => e.check(Wo$4(D$12, t)), e.uuid = (t) => e.check(Go$4(O$11, t)), e.uuidv4 = (t) => e.check(Ko$4(O$11, t)), e.uuidv6 = (t) => e.check(qo$4(O$11, t)), e.uuidv7 = (t) => e.check(Jo$4(O$11, t)), e.nanoid = (t) => e.check(Zo$4(j$11, t)), e.guid = (t) => e.check(Wo$4(D$12, t)), e.cuid = (t) => e.check(Qo$4(M$11, t)), e.cuid2 = (t) => e.check($o$4(N$10, t)), e.ulid = (t) => e.check(es$4(sa$5, t)), e.base64 = (t) => e.check(cs$4(Ca$5, t)), e.base64url = (t) => e.check(ls$4(Ta$5, t)), e.xid = (t) => e.check(ts$4(la$5, t)), e.ksuid = (t) => e.check(ns$4(da$5, t)), e.ipv4 = (t) => e.check(rs$4(pa$5, t)), e.ipv6 = (t) => e.check(is$4(_a$5, t)), e.cidrv4 = (t) => e.check(os$4(ya$5, t)), e.cidrv6 = (t) => e.check(ss$4(xa$5, t)), e.e164 = (t) => e.check(us$4(Da$5, t)), e.datetime = (t) => e.check(Ti$5(t)), e.date = (t) => e.check(Di$5(t)), e.time = (t) => e.check(ki$5(t)), e.duration = (t) => e.check(ji$5(t)); -}); -function w$13(e) { - return Vo$4(C$13, e); -} -const T$13 = i$16(`ZodStringFormat`, (e, t) => { - U$11.init(e, t), S$12.init(e, t); -}); -const E$13 = i$16(`ZodEmail`, (e, t) => { - Zn$4.init(e, t), T$13.init(e, t); -}); -function Yi$5(e) { - return Uo$4(E$13, e); -} -const D$12 = i$16(`ZodGUID`, (e, t) => { - Yn$4.init(e, t), T$13.init(e, t); -}); -function Xi$5(e) { - return Wo$4(D$12, e); -} -const O$11 = i$16(`ZodUUID`, (e, t) => { - Xn$5.init(e, t), T$13.init(e, t); -}); -function Zi$5(e) { - return Go$4(O$11, e); -} -function Qi$5(e) { - return Ko$4(O$11, e); -} -function $i$5(e) { - return qo$4(O$11, e); -} -function ea$5(e) { - return Jo$4(O$11, e); -} -const k$12 = i$16(`ZodURL`, (e, t) => { - Qn$4.init(e, t), T$13.init(e, t); -}); -function ta$5(e) { - return Yo$4(k$12, e); -} -function na$5(e) { - return Yo$4(k$12, { - protocol: Gt$6, - hostname: Wt$6, - ...w$14(e) - }); -} -const A$11 = i$16(`ZodEmoji`, (e, n) => { - $n$4.init(e, n), T$13.init(e, n); -}); -function ra$5(e) { - return Xo$4(A$11, e); -} -const j$11 = i$16(`ZodNanoID`, (e, t) => { - er$4.init(e, t), T$13.init(e, t); -}); -function ia$5(e) { - return Zo$4(j$11, e); -} -const M$11 = i$16(`ZodCUID`, (e, t) => { - tr$4.init(e, t), T$13.init(e, t); -}); -function aa$5(e) { - return Qo$4(M$11, e); -} -const N$10 = i$16(`ZodCUID2`, (e, t) => { - nr$4.init(e, t), T$13.init(e, t); -}); -function oa$5(e) { - return $o$4(N$10, e); -} -const sa$5 = i$16(`ZodULID`, (e, t) => { - rr$4.init(e, t), T$13.init(e, t); -}); -function ca$5(e) { - return es$4(sa$5, e); -} -const la$5 = i$16(`ZodXID`, (e, t) => { - ir$4.init(e, t), T$13.init(e, t); -}); -function ua$5(e) { - return ts$4(la$5, e); -} -const da$5 = i$16(`ZodKSUID`, (e, t) => { - ar$4.init(e, t), T$13.init(e, t); -}); -function fa$5(e) { - return ns$4(da$5, e); -} -const pa$5 = i$16(`ZodIPv4`, (e, t) => { - ur$5.init(e, t), T$13.init(e, t); -}); -function ma$5(e) { - return rs$4(pa$5, e); -} -const ha$5 = i$16(`ZodMAC`, (e, t) => { - fr$4.init(e, t), T$13.init(e, t); -}); -function ga$5(e) { - return as$4(ha$5, e); -} -const _a$5 = i$16(`ZodIPv6`, (e, t) => { - dr$5.init(e, t), T$13.init(e, t); -}); -function va$5(e) { - return is$4(_a$5, e); -} -const ya$5 = i$16(`ZodCIDRv4`, (e, t) => { - pr$5.init(e, t), T$13.init(e, t); -}); -function ba$5(e) { - return os$4(ya$5, e); -} -const xa$5 = i$16(`ZodCIDRv6`, (e, t) => { - mr$4.init(e, t), T$13.init(e, t); -}); -function Sa$5(e) { - return ss$4(xa$5, e); -} -const Ca$5 = i$16(`ZodBase64`, (e, t) => { - gr$4.init(e, t), T$13.init(e, t); -}); -function wa$5(e) { - return cs$4(Ca$5, e); -} -const Ta$5 = i$16(`ZodBase64URL`, (e, t) => { - vr$5.init(e, t), T$13.init(e, t); -}); -function Ea$5(e) { - return ls$4(Ta$5, e); -} -const Da$5 = i$16(`ZodE164`, (e, t) => { - yr$5.init(e, t), T$13.init(e, t); -}); -function Oa$5(e) { - return us$4(Da$5, e); -} -const ka$5 = i$16(`ZodJWT`, (e, t) => { - xr$5.init(e, t), T$13.init(e, t); -}); -function Aa$5(e) { - return ds$4(ka$5, e); -} -const P$10 = i$16(`ZodCustomStringFormat`, (e, t) => { - Sr$5.init(e, t), T$13.init(e, t); -}); -function ja$5(e, t, n = {}) { - return Gc$3(P$10, e, t, n); -} -function Ma$5(e) { - return Gc$3(P$10, `hostname`, Ut$6, e); -} -function Na$5(e) { - return Gc$3(P$10, `hex`, cn$6, e); -} -function Pa$5(e, t) { - let n = `${e}_${t?.enc ?? `hex`}`, r = gt$8[n]; - if (!r) throw Error(`Unrecognized hash format: ${n}`); - return Gc$3(P$10, n, r, t); -} -const F$10 = i$16(`ZodNumber`, (e, t) => { - Cr$5.init(e, t), x$11.init(e, t), e._zod.processJSONSchema = (t, n, r) => Xc$3(e, t, n, r), Ji$5(e, `ZodNumber`, { - gt(e, t) { - return this.check(Hs$3(e, t)); - }, - gte(e, t) { - return this.check(q$10(e, t)); - }, - min(e, t) { - return this.check(q$10(e, t)); - }, - lt(e, t) { - return this.check(Bs$3(e, t)); - }, - lte(e, t) { - return this.check(Vs$3(e, t)); - }, - max(e, t) { - return this.check(Vs$3(e, t)); - }, - int(e) { - return this.check(Ia$5(e)); - }, - safe(e) { - return this.check(Ia$5(e)); - }, - positive(e) { - return this.check(Hs$3(0, e)); - }, - nonnegative(e) { - return this.check(q$10(0, e)); - }, - negative(e) { - return this.check(Bs$3(0, e)); - }, - nonpositive(e) { - return this.check(Vs$3(0, e)); - }, - multipleOf(e, t) { - return this.check(qs$3(e, t)); - }, - step(e, t) { - return this.check(qs$3(e, t)); - }, - finite() { - return this; - } - }); - let n = e._zod.bag; - e.minValue = Math.max(n.minimum ?? -Infinity, n.exclusiveMinimum ?? -Infinity) ?? null, e.maxValue = Math.min(n.maximum ?? Infinity, n.exclusiveMaximum ?? Infinity) ?? null, e.isInt = (n.format ?? ``).includes(`int`) || Number.isSafeInteger(n.multipleOf ?? .5), e.isFinite = !0, e.format = n.format ?? null; -}); -function Fa$5(e) { - return _s$4(F$10, e); -} -const I$10 = i$16(`ZodNumberFormat`, (e, t) => { - wr$5.init(e, t), F$10.init(e, t); -}); -function Ia$5(e) { - return ys$4(I$10, e); -} -function La$5(e) { - return bs$4(I$10, e); -} -function Ra$5(e) { - return xs$4(I$10, e); -} -function za$5(e) { - return Ss$4(I$10, e); -} -function Ba$5(e) { - return Cs$4(I$10, e); -} -const L$9 = i$16(`ZodBoolean`, (e, t) => { - Tr$5.init(e, t), x$11.init(e, t), e._zod.processJSONSchema = (t, n, r) => Zc$3(e, t, n, r); -}); -function Va$5(e) { - return ws$4(L$9, e); -} -const R$11 = i$16(`ZodBigInt`, (e, t) => { - Er$5.init(e, t), x$11.init(e, t), e._zod.processJSONSchema = (t, n, r) => Qc$3(e, t, n, r), e.gte = (t, n) => e.check(q$10(t, n)), e.min = (t, n) => e.check(q$10(t, n)), e.gt = (t, n) => e.check(Hs$3(t, n)), e.gte = (t, n) => e.check(q$10(t, n)), e.min = (t, n) => e.check(q$10(t, n)), e.lt = (t, n) => e.check(Bs$3(t, n)), e.lte = (t, n) => e.check(Vs$3(t, n)), e.max = (t, n) => e.check(Vs$3(t, n)), e.positive = (t) => e.check(Hs$3(BigInt(0), t)), e.negative = (t) => e.check(Bs$3(BigInt(0), t)), e.nonpositive = (t) => e.check(Vs$3(BigInt(0), t)), e.nonnegative = (t) => e.check(q$10(BigInt(0), t)), e.multipleOf = (t, n) => e.check(qs$3(t, n)); - let n = e._zod.bag; - e.minValue = n.minimum ?? null, e.maxValue = n.maximum ?? null, e.format = n.format ?? null; -}); -function Ha$5(e) { - return Es$4(R$11, e); -} -const Ua$5 = i$16(`ZodBigIntFormat`, (e, t) => { - Dr$5.init(e, t), R$11.init(e, t); -}); -function Wa$5(e) { - return Os$4(Ua$5, e); -} -function Ga$5(e) { - return ks$4(Ua$5, e); -} -const Ka$5 = i$16(`ZodSymbol`, (e, t) => { - Or$5.init(e, t), x$11.init(e, t), e._zod.processJSONSchema = (t, n, r) => $c$3(e, t, n, r); -}); -function qa$5(e) { - return As$4(Ka$5, e); -} -const Ja$4 = i$16(`ZodUndefined`, (e, t) => { - kr$5.init(e, t), x$11.init(e, t), e._zod.processJSONSchema = (t, n, r) => tl$3(e, t, n, r); -}); -function Ya$4(e) { - return js$4(Ja$4, e); -} -const Xa$4 = i$16(`ZodNull`, (e, t) => { - Ar$5.init(e, t), x$11.init(e, t), e._zod.processJSONSchema = (t, n, r) => el$3(e, t, n, r); -}); -function Za$4(e) { - return Ms$4(Xa$4, e); -} -const Qa$4 = i$16(`ZodAny`, (e, t) => { - jr$5.init(e, t), x$11.init(e, t), e._zod.processJSONSchema = (t, n, r) => void 0; -}); -function $a$4() { - return Ns$4(Qa$4); -} -const eo$4 = i$16(`ZodUnknown`, (e, t) => { - Mr$5.init(e, t), x$11.init(e, t), e._zod.processJSONSchema = (t, n, r) => void 0; -}); -function z$11() { - return Ps$4(eo$4); -} -const to$4 = i$16(`ZodNever`, (e, t) => { - Nr$5.init(e, t), x$11.init(e, t), e._zod.processJSONSchema = (t, n, r) => rl$3(e, t, n, r); -}); -function B$12(e) { - return Fs$4(to$4, e); -} -const no$3 = i$16(`ZodVoid`, (e, t) => { - Pr$5.init(e, t), x$11.init(e, t), e._zod.processJSONSchema = (t, n, r) => nl$3(e, t, n, r); -}); -function ro$3(e) { - return Is$4(no$3, e); -} -const io$3 = i$16(`ZodDate`, (e, t) => { - Fr$5.init(e, t), x$11.init(e, t), e._zod.processJSONSchema = (t, n, r) => ol$3(e, t, n, r), e.min = (t, n) => e.check(q$10(t, n)), e.max = (t, n) => e.check(Vs$3(t, n)); - let n = e._zod.bag; - e.minDate = n.minimum ? new Date(n.minimum) : null, e.maxDate = n.maximum ? new Date(n.maximum) : null; -}); -function ao$3(e) { - return Ls$4(io$3, e); -} -const oo$3 = i$16(`ZodArray`, (e, t) => { - Lr$5.init(e, t), x$11.init(e, t), e._zod.processJSONSchema = (t, n, r) => vl$3(e, t, n, r), e.element = t.element, Ji$5(e, `ZodArray`, { - min(e, t) { - return this.check(Qs$3(e, t)); - }, - nonempty(e) { - return this.check(Qs$3(1, e)); - }, - max(e, t) { - return this.check(Zs$3(e, t)); - }, - length(e, t) { - return this.check($s$3(e, t)); - }, - unwrap() { - return this.element; - } - }); -}); -function V$11(e, t) { - return pc$3(oo$3, e, t); -} -function so$3(e) { - let t = e._zod.def.shape; - return Oo$3(Object.keys(t)); -} -const H$10 = i$16(`ZodObject`, (e, t) => { - Hr$5.init(e, t), x$11.init(e, t), e._zod.processJSONSchema = (t, n, r) => yl$3(e, t, n, r), _$10(e, `shape`, () => t.shape), Ji$5(e, `ZodObject`, { - keyof() { - return Oo$3(Object.keys(this._zod.def.shape)); - }, - catchall(e) { - return this.clone({ - ...this._zod.def, - catchall: e - }); - }, - passthrough() { - return this.clone({ - ...this._zod.def, - catchall: z$11() - }); - }, - loose() { - return this.clone({ - ...this._zod.def, - catchall: z$11() - }); - }, - strict() { - return this.clone({ - ...this._zod.def, - catchall: B$12() - }); - }, - strip() { - return this.clone({ - ...this._zod.def, - catchall: void 0 - }); - }, - extend(e) { - return De$8(this, e); - }, - safeExtend(e) { - return Oe$9(this, e); - }, - merge(e) { - return ke$8(this, e); - }, - pick(e) { - return Te$9(this, e); - }, - omit(e) { - return Ee$9(this, e); - }, - partial(...e) { - return Ae$9(Io$3, this, e[0]); - }, - required(...e) { - return je$10(Go$3, this, e[0]); - } - }); -}); -function co$3(e, t) { - return new H$10({ - type: `object`, - shape: e ?? {}, - ...w$14(t) - }); -} -function lo$3(e, t) { - return new H$10({ - type: `object`, - shape: e, - catchall: B$12(), - ...w$14(t) - }); -} -function uo$3(e, t) { - return new H$10({ - type: `object`, - shape: e, - catchall: z$11(), - ...w$14(t) - }); -} -const U$10 = i$16(`ZodUnion`, (e, t) => { - Wr$5.init(e, t), x$11.init(e, t), e._zod.processJSONSchema = (t, n, r) => bl$3(e, t, n, r), e.options = t.options; -}); -function fo$3(e, t) { - return new U$10({ - type: `union`, - options: e, - ...w$14(t) - }); -} -const po$3 = i$16(`ZodXor`, (e, t) => { - U$10.init(e, t), Kr$5.init(e, t), e._zod.processJSONSchema = (t, n, r) => bl$3(e, t, n, r), e.options = t.options; -}); -function mo$3(e, t) { - return new po$3({ - type: `union`, - options: e, - inclusive: !1, - ...w$14(t) - }); -} -const ho$3 = i$16(`ZodDiscriminatedUnion`, (e, t) => { - U$10.init(e, t), qr$5.init(e, t); -}); -function go$3(e, t, n) { - return new ho$3({ - type: `union`, - options: t, - discriminator: e, - ...w$14(n) - }); -} -const _o$3 = i$16(`ZodIntersection`, (e, t) => { - Jr$5.init(e, t), x$11.init(e, t), e._zod.processJSONSchema = (t, n, r) => xl$3(e, t, n, r); -}); -function vo$3(e, t) { - return new _o$3({ - type: `intersection`, - left: e, - right: t - }); -} -const yo$3 = i$16(`ZodTuple`, (e, t) => { - Zr$5.init(e, t), x$11.init(e, t), e._zod.processJSONSchema = (t, n, r) => Sl$3(e, t, n, r), e.rest = (t) => e.clone({ - ...e._zod.def, - rest: t - }); -}); -function bo$3(e, t, n) { - let r = t instanceof H$11; - return new yo$3({ - type: `tuple`, - items: e, - rest: r ? t : null, - ...w$14(r ? n : t) - }); -} -const W$8 = i$16(`ZodRecord`, (e, t) => { - ti$5.init(e, t), x$11.init(e, t), e._zod.processJSONSchema = (t, n, r) => Cl$3(e, t, n, r), e.keyType = t.keyType, e.valueType = t.valueType; -}); -function xo$3(e, t, n) { - return !t || !t._zod ? new W$8({ - type: `record`, - keyType: w$13(), - valueType: e, - ...w$14(t) - }) : new W$8({ - type: `record`, - keyType: e, - valueType: t, - ...w$14(n) - }); -} -function So$3(e, t, n) { - let r = C$14(e); - return r._zod.values = void 0, new W$8({ - type: `record`, - keyType: r, - valueType: t, - ...w$14(n) - }); -} -function Co$3(e, t, n) { - return new W$8({ - type: `record`, - keyType: e, - valueType: t, - mode: `loose`, - ...w$14(n) - }); -} -const wo$3 = i$16(`ZodMap`, (e, t) => { - ni$5.init(e, t), x$11.init(e, t), e._zod.processJSONSchema = (t, n, r) => gl$3(e, t, n, r), e.keyType = t.keyType, e.valueType = t.valueType, e.min = (...t) => e.check(Ys$3(...t)), e.nonempty = (t) => e.check(Ys$3(1, t)), e.max = (...t) => e.check(Js$3(...t)), e.size = (...t) => e.check(Xs$3(...t)); -}); -function To$3(e, t, n) { - return new wo$3({ - type: `map`, - keyType: e, - valueType: t, - ...w$14(n) - }); -} -const Eo$3 = i$16(`ZodSet`, (e, t) => { - ii$5.init(e, t), x$11.init(e, t), e._zod.processJSONSchema = (t, n, r) => _l$3(e, t, n, r), e.min = (...t) => e.check(Ys$3(...t)), e.nonempty = (t) => e.check(Ys$3(1, t)), e.max = (...t) => e.check(Js$3(...t)), e.size = (...t) => e.check(Xs$3(...t)); -}); -function Do$3(e, t) { - return new Eo$3({ - type: `set`, - valueType: e, - ...w$14(t) - }); -} -const G$8 = i$16(`ZodEnum`, (e, t) => { - oi$5.init(e, t), x$11.init(e, t), e._zod.processJSONSchema = (t, n, r) => sl$3(e, t, n, r), e.enum = t.entries, e.options = Object.values(t.entries); - let n = new Set(Object.keys(t.entries)); - e.extract = (e, r) => { - let i = {}; - for (let r of e) if (n.has(r)) i[r] = t.entries[r]; - else throw Error(`Key ${r} not found in enum`); - return new G$8({ - ...t, - checks: [], - ...w$14(r), - entries: i - }); - }, e.exclude = (e, r) => { - let i = { ...t.entries }; - for (let t of e) if (n.has(t)) delete i[t]; - else throw Error(`Key ${t} not found in enum`); - return new G$8({ - ...t, - checks: [], - ...w$14(r), - entries: i - }); - }; -}); -function Oo$3(e, t) { - return new G$8({ - type: `enum`, - entries: Array.isArray(e) ? Object.fromEntries(e.map((e) => [e, e])) : e, - ...w$14(t) - }); -} -function ko$3(e, t) { - return new G$8({ - type: `enum`, - entries: e, - ...w$14(t) - }); -} -const Ao$3 = i$16(`ZodLiteral`, (e, t) => { - si$5.init(e, t), x$11.init(e, t), e._zod.processJSONSchema = (t, n, r) => cl$3(e, t, n, r), e.values = new Set(t.values), Object.defineProperty(e, "value", { get() { - if (t.values.length > 1) throw Error("This schema contains multiple valid literal values. Use `.values` instead."); - return t.values[0]; - } }); -}); -function jo$3(e, t) { - return new Ao$3({ - type: `literal`, - values: Array.isArray(e) ? e : [e], - ...w$14(t) - }); -} -const Mo$3 = i$16(`ZodFile`, (e, t) => { - ci$5.init(e, t), x$11.init(e, t), e._zod.processJSONSchema = (t, n, r) => dl$3(e, t, n, r), e.min = (t, n) => e.check(Ys$3(t, n)), e.max = (t, n) => e.check(Js$3(t, n)), e.mime = (t, n) => e.check(sc$3(Array.isArray(t) ? t : [t], n)); -}); -function No$3(e) { - return Tc$3(Mo$3, e); -} -const Po$3 = i$16(`ZodTransform`, (e, t) => { - li$5.init(e, t), x$11.init(e, t), e._zod.processJSONSchema = (t, n, r) => hl$3(e, t, n, r), e._zod.parse = (n, r) => { - if (r.direction === `backward`) throw new s$11(e.constructor.name); - n.addIssue = (r) => { - if (typeof r == `string`) n.issues.push(j$12(r, n.value, t)); - else { - let t = r; - t.fatal && (t.continue = !1), t.code ??= `custom`, t.input ??= n.value, t.inst ??= e, n.issues.push(j$12(t)); - } - }; - let i = t.transform(n.value, n); - return i instanceof Promise ? i.then((e) => (n.value = e, n.fallback = !0, n)) : (n.value = i, n.fallback = !0, n); - }; -}); -function Fo$3(e) { - return new Po$3({ - type: `transform`, - transform: e - }); -} -const Io$3 = i$16(`ZodOptional`, (e, t) => { - di$5.init(e, t), x$11.init(e, t), e._zod.processJSONSchema = (t, n, r) => Ml$3(e, t, n, r), e.unwrap = () => e._zod.def.innerType; -}); -function K$9(e) { - return new Io$3({ - type: `optional`, - innerType: e - }); -} -const Lo$3 = i$16(`ZodExactOptional`, (e, t) => { - fi$5.init(e, t), x$11.init(e, t), e._zod.processJSONSchema = (t, n, r) => Ml$3(e, t, n, r), e.unwrap = () => e._zod.def.innerType; -}); -function Ro$3(e) { - return new Lo$3({ - type: `optional`, - innerType: e - }); -} -const zo$3 = i$16(`ZodNullable`, (e, t) => { - pi$5.init(e, t), x$11.init(e, t), e._zod.processJSONSchema = (t, n, r) => wl$3(e, t, n, r), e.unwrap = () => e._zod.def.innerType; -}); -function q$9(e) { - return new zo$3({ - type: `nullable`, - innerType: e - }); -} -function Bo$3(e) { - return K$9(q$9(e)); -} -const Vo$3 = i$16(`ZodDefault`, (e, t) => { - mi$5.init(e, t), x$11.init(e, t), e._zod.processJSONSchema = (t, n, r) => El$3(e, t, n, r), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap; -}); -function Ho$3(e, t) { - return new Vo$3({ - type: `default`, - innerType: e, - get defaultValue() { - return typeof t == `function` ? t() : ge$9(t); - } - }); -} -const Uo$3 = i$16(`ZodPrefault`, (e, t) => { - gi$5.init(e, t), x$11.init(e, t), e._zod.processJSONSchema = (t, n, r) => Dl$3(e, t, n, r), e.unwrap = () => e._zod.def.innerType; -}); -function Wo$3(e, t) { - return new Uo$3({ - type: `prefault`, - innerType: e, - get defaultValue() { - return typeof t == `function` ? t() : ge$9(t); - } - }); -} -const Go$3 = i$16(`ZodNonOptional`, (e, t) => { - _i$5.init(e, t), x$11.init(e, t), e._zod.processJSONSchema = (t, n, r) => Tl$3(e, t, n, r), e.unwrap = () => e._zod.def.innerType; -}); -function Ko$3(e, t) { - return new Go$3({ - type: `nonoptional`, - innerType: e, - ...w$14(t) - }); -} -const qo$3 = i$16(`ZodSuccess`, (e, t) => { - yi$5.init(e, t), x$11.init(e, t), e._zod.processJSONSchema = (t, n, r) => fl$3(e, t, n, r), e.unwrap = () => e._zod.def.innerType; -}); -function Jo$3(e) { - return new qo$3({ - type: `success`, - innerType: e - }); -} -const Yo$3 = i$16(`ZodCatch`, (e, t) => { - bi$5.init(e, t), x$11.init(e, t), e._zod.processJSONSchema = (t, n, r) => Ol$3(e, t, n, r), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap; -}); -function Xo$3(e, t) { - return new Yo$3({ - type: `catch`, - innerType: e, - catchValue: typeof t == `function` ? t : () => t - }); -} -const Zo$3 = i$16(`ZodNaN`, (e, t) => { - xi$5.init(e, t), x$11.init(e, t), e._zod.processJSONSchema = (t, n, r) => ll$3(e, t, n, r); -}); -function Qo$3(e) { - return zs$3(Zo$3, e); -} -const J$9 = i$16(`ZodPipe`, (e, t) => { - Si$6.init(e, t), x$11.init(e, t), e._zod.processJSONSchema = (t, n, r) => kl$3(e, t, n, r), e.in = t.in, e.out = t.out; -}); -function $o$3(e, t) { - return new J$9({ - type: `pipe`, - in: e, - out: t - }); -} -const Y$12 = i$16(`ZodCodec`, (e, t) => { - J$9.init(e, t), wi$6.init(e, t); -}); -function es$3(e, t, n) { - return new Y$12({ - type: `pipe`, - in: e, - out: t, - transform: n.decode, - reverseTransform: n.encode - }); -} -function ts$3(e) { - let t = e._zod.def; - return new Y$12({ - type: `pipe`, - in: t.out, - out: t.in, - transform: t.reverseTransform, - reverseTransform: t.transform - }); -} -const ns$3 = i$16(`ZodPreprocess`, (e, t) => { - J$9.init(e, t), Di$6.init(e, t); -}); -const rs$3 = i$16(`ZodReadonly`, (e, t) => { - Oi$6.init(e, t), x$11.init(e, t), e._zod.processJSONSchema = (t, n, r) => Al$3(e, t, n, r), e.unwrap = () => e._zod.def.innerType; -}); -function is$3(e) { - return new rs$3({ - type: `readonly`, - innerType: e - }); -} -const as$3 = i$16(`ZodTemplateLiteral`, (e, t) => { - Ai$6.init(e, t), x$11.init(e, t), e._zod.processJSONSchema = (t, n, r) => ul$3(e, t, n, r); -}); -function os$3(e, t) { - return new as$3({ - type: `template_literal`, - parts: e, - ...w$14(t) - }); -} -const ss$3 = i$16(`ZodLazy`, (e, t) => { - Ni$6.init(e, t), x$11.init(e, t), e._zod.processJSONSchema = (t, n, r) => Nl$3(e, t, n, r), e.unwrap = () => e._zod.def.getter(); -}); -function cs$3(e) { - return new ss$3({ - type: `lazy`, - getter: e - }); -} -const ls$3 = i$16(`ZodPromise`, (e, t) => { - Mi$6.init(e, t), x$11.init(e, t), e._zod.processJSONSchema = (t, n, r) => jl$3(e, t, n, r), e.unwrap = () => e._zod.def.innerType; -}); -function us$3(e) { - return new ls$3({ - type: `promise`, - innerType: e - }); -} -const ds$3 = i$16(`ZodFunction`, (e, t) => { - ji$6.init(e, t), x$11.init(e, t), e._zod.processJSONSchema = (t, n, r) => ml$3(e, t, n, r); -}); -function X$12(e) { - return new ds$3({ - type: `function`, - input: Array.isArray(e?.input) ? bo$3(e?.input) : e?.input ?? V$11(z$11()), - output: e?.output ?? z$11() - }); -} -const Z$11 = i$16(`ZodCustom`, (e, t) => { - Pi$6.init(e, t), x$11.init(e, t), e._zod.processJSONSchema = (t, n, r) => pl$3(e, t, n, r); -}); -function fs$3(e) { - let t = new B$13({ check: `custom` }); - return t._zod.check = e, t; -} -function ps$3(e, t) { - return Rc$3(Z$11, e ?? (() => !0), t); -} -function ms$3(e, t = {}) { - return zc$3(Z$11, e, t); -} -function hs$3(e, t) { - return Bc$3(e, t); -} -const gs$3 = Hc$3; -const _s$3 = Uc$3; -function vs$3(e, t = {}) { - let n = new Z$11({ - type: `custom`, - check: `custom`, - fn: (t) => t instanceof e, - abort: !0, - ...w$14(t) - }); - return n._zod.bag.Class = e, n._zod.check = (t) => { - t.value instanceof e || t.issues.push({ - code: `invalid_type`, - expected: e.name, - input: t.value, - inst: n, - path: [...n._zod.def.path ?? []] - }); - }, n; -} -const ys$3 = (...e) => Wc$3({ - Codec: Y$12, - Boolean: L$9, - String: C$13 -}, ...e); -function bs$3(e) { - let t = cs$3(() => fo$3([ - w$13(e), - Fa$5(), - Va$5(), - Za$4(), - V$11(t), - xo$3(w$13(), t) - ])); - return t; -} -function xs$3(e, t) { - return new ns$3({ - type: `pipe`, - in: Fo$3(e), - out: t - }); -} -const Ss$3 = { - invalid_type: `invalid_type`, - too_big: `too_big`, - too_small: `too_small`, - invalid_format: `invalid_format`, - not_multiple_of: `not_multiple_of`, - unrecognized_keys: `unrecognized_keys`, - invalid_union: `invalid_union`, - invalid_key: `invalid_key`, - invalid_element: `invalid_element`, - invalid_value: `invalid_value`, - custom: `custom` -}; -function Cs$3(e) { - l$12({ customError: e }); -} -function ws$3() { - return l$12().customError; -} -var Ts$3; -Ts$3 ||= {}; -const Q$10 = { - ...Ki$5, - ...Si$5, - iso: Ci$5 -}; -const Es$3 = new Set(`$schema.$ref.$defs.definitions.$id.id.$comment.$anchor.$vocabulary.$dynamicRef.$dynamicAnchor.type.enum.const.anyOf.oneOf.allOf.not.properties.required.additionalProperties.patternProperties.propertyNames.minProperties.maxProperties.items.prefixItems.additionalItems.minItems.maxItems.uniqueItems.contains.minContains.maxContains.minLength.maxLength.pattern.format.minimum.maximum.exclusiveMinimum.exclusiveMaximum.multipleOf.description.default.contentEncoding.contentMediaType.contentSchema.unevaluatedItems.unevaluatedProperties.if.then.else.dependentSchemas.dependentRequired.nullable.readOnly`.split(`.`)); -function Ds$3(e, t) { - let n = e.$schema; - return n === `https://json-schema.org/draft/2020-12/schema` ? `draft-2020-12` : n === `http://json-schema.org/draft-07/schema#` ? `draft-7` : n === `http://json-schema.org/draft-04/schema#` ? `draft-4` : t ?? `draft-2020-12`; -} -function Os$3(e, t) { - if (!e.startsWith(`#`)) throw Error(`External $ref is not supported, only local refs (#/...) are allowed`); - let n = e.slice(1).split(`/`).filter(Boolean); - if (n.length === 0) return t.rootSchema; - let r = t.version === `draft-2020-12` ? `$defs` : `definitions`; - if (n[0] === r) { - let r = n[1]; - if (!r || !t.defs[r]) throw Error(`Reference not found: ${e}`); - return t.defs[r]; - } - throw Error(`Reference not found: ${e}`); -} -function ks$3(e, t) { - if (e.not !== void 0) { - if (typeof e.not == `object` && Object.keys(e.not).length === 0) return Q$10.never(); - throw Error(`not is not supported in Zod (except { not: {} } for never)`); - } - if (e.unevaluatedItems !== void 0) throw Error(`unevaluatedItems is not supported`); - if (e.unevaluatedProperties !== void 0) throw Error(`unevaluatedProperties is not supported`); - if (e.if !== void 0 || e.then !== void 0 || e.else !== void 0) throw Error(`Conditional schemas (if/then/else) are not supported`); - if (e.dependentSchemas !== void 0 || e.dependentRequired !== void 0) throw Error(`dependentSchemas and dependentRequired are not supported`); - if (e.$ref) { - let n = e.$ref; - if (t.refs.has(n)) return t.refs.get(n); - if (t.processing.has(n)) return Q$10.lazy(() => { - if (!t.refs.has(n)) throw Error(`Circular reference not resolved: ${n}`); - return t.refs.get(n); - }); - t.processing.add(n); - let r = $$10(Os$3(n, t), t); - return t.refs.set(n, r), t.processing.delete(n), r; - } - if (e.enum !== void 0) { - let n = e.enum; - if (t.version === `openapi-3.0` && e.nullable === !0 && n.length === 1 && n[0] === null) return Q$10.null(); - if (n.length === 0) return Q$10.never(); - if (n.length === 1) return Q$10.literal(n[0]); - if (n.every((e) => typeof e == `string`)) return Q$10.enum(n); - let r = n.map((e) => Q$10.literal(e)); - return r.length < 2 ? r[0] : Q$10.union([ - r[0], - r[1], - ...r.slice(2) - ]); - } - if (e.const !== void 0) return Q$10.literal(e.const); - let n = e.type; - if (Array.isArray(n)) { - let r = n.map((n) => ks$3({ - ...e, - type: n - }, t)); - return r.length === 0 ? Q$10.never() : r.length === 1 ? r[0] : Q$10.union(r); - } - if (!n) return Q$10.any(); - let r; - switch (n) { - case `string`: { - let t = Q$10.string(); - if (e.format) { - let n = e.format; - n === `email` ? t = t.check(Q$10.email()) : n === `uri` || n === `uri-reference` ? t = t.check(Q$10.url()) : n === `uuid` || n === `guid` ? t = t.check(Q$10.uuid()) : n === `date-time` ? t = t.check(Q$10.iso.datetime()) : n === `date` ? t = t.check(Q$10.iso.date()) : n === `time` ? t = t.check(Q$10.iso.time()) : n === `duration` ? t = t.check(Q$10.iso.duration()) : n === `ipv4` ? t = t.check(Q$10.ipv4()) : n === `ipv6` ? t = t.check(Q$10.ipv6()) : n === `mac` ? t = t.check(Q$10.mac()) : n === `cidr` ? t = t.check(Q$10.cidrv4()) : n === `cidr-v6` ? t = t.check(Q$10.cidrv6()) : n === `base64` ? t = t.check(Q$10.base64()) : n === `base64url` ? t = t.check(Q$10.base64url()) : n === `e164` ? t = t.check(Q$10.e164()) : n === `jwt` ? t = t.check(Q$10.jwt()) : n === `emoji` ? t = t.check(Q$10.emoji()) : n === `nanoid` ? t = t.check(Q$10.nanoid()) : n === `cuid` ? t = t.check(Q$10.cuid()) : n === `cuid2` ? t = t.check(Q$10.cuid2()) : n === `ulid` ? t = t.check(Q$10.ulid()) : n === `xid` ? t = t.check(Q$10.xid()) : n === `ksuid` && (t = t.check(Q$10.ksuid())); - } - typeof e.minLength == `number` && (t = t.min(e.minLength)), typeof e.maxLength == `number` && (t = t.max(e.maxLength)), e.pattern && (t = t.regex(new RegExp(e.pattern))), r = t; - break; - } - case `number`: - case `integer`: { - let t = n === `integer` ? Q$10.number().int() : Q$10.number(); - typeof e.minimum == `number` && (t = t.min(e.minimum)), typeof e.maximum == `number` && (t = t.max(e.maximum)), typeof e.exclusiveMinimum == `number` ? t = t.gt(e.exclusiveMinimum) : e.exclusiveMinimum === !0 && typeof e.minimum == `number` && (t = t.gt(e.minimum)), typeof e.exclusiveMaximum == `number` ? t = t.lt(e.exclusiveMaximum) : e.exclusiveMaximum === !0 && typeof e.maximum == `number` && (t = t.lt(e.maximum)), typeof e.multipleOf == `number` && (t = t.multipleOf(e.multipleOf)), r = t; - break; - } - case `boolean`: - r = Q$10.boolean(); - break; - case `null`: - r = Q$10.null(); - break; - case `object`: { - let n = {}, i = e.properties || {}, a = new Set(e.required || []); - for (let [e, r] of Object.entries(i)) { - let i = $$10(r, t); - n[e] = a.has(e) ? i : i.optional(); - } - if (e.propertyNames) { - let i = $$10(e.propertyNames, t), a = e.additionalProperties && typeof e.additionalProperties == `object` ? $$10(e.additionalProperties, t) : Q$10.any(); - if (Object.keys(n).length === 0) { - r = Q$10.record(i, a); - break; - } - let o = Q$10.object(n).passthrough(), s = Q$10.looseRecord(i, a); - r = Q$10.intersection(o, s); - break; - } - if (e.patternProperties) { - let i = e.patternProperties, a = Object.keys(i), o = []; - for (let e of a) { - let n = $$10(i[e], t), r = Q$10.string().regex(new RegExp(e)); - o.push(Q$10.looseRecord(r, n)); - } - let s = []; - if (Object.keys(n).length > 0 && s.push(Q$10.object(n).passthrough()), s.push(...o), s.length === 0) r = Q$10.object({}).passthrough(); - else if (s.length === 1) r = s[0]; - else { - let e = Q$10.intersection(s[0], s[1]); - for (let t = 2; t < s.length; t++) e = Q$10.intersection(e, s[t]); - r = e; - } - break; - } - let o = Q$10.object(n); - r = e.additionalProperties === !1 ? o.strict() : typeof e.additionalProperties == `object` ? o.catchall($$10(e.additionalProperties, t)) : o.passthrough(); - break; - } - case `array`: { - let n = e.prefixItems, i = e.items; - if (n && Array.isArray(n)) { - let a = n.map((e) => $$10(e, t)), o = i && typeof i == `object` && !Array.isArray(i) ? $$10(i, t) : void 0; - r = o ? Q$10.tuple(a).rest(o) : Q$10.tuple(a), typeof e.minItems == `number` && (r = r.check(Q$10.minLength(e.minItems))), typeof e.maxItems == `number` && (r = r.check(Q$10.maxLength(e.maxItems))); - } else if (Array.isArray(i)) { - let n = i.map((e) => $$10(e, t)), a = e.additionalItems && typeof e.additionalItems == `object` ? $$10(e.additionalItems, t) : void 0; - r = a ? Q$10.tuple(n).rest(a) : Q$10.tuple(n), typeof e.minItems == `number` && (r = r.check(Q$10.minLength(e.minItems))), typeof e.maxItems == `number` && (r = r.check(Q$10.maxLength(e.maxItems))); - } else if (i !== void 0) { - let n = $$10(i, t), a = Q$10.array(n); - typeof e.minItems == `number` && (a = a.min(e.minItems)), typeof e.maxItems == `number` && (a = a.max(e.maxItems)), r = a; - } else r = Q$10.array(Q$10.any()); - break; - } - default: throw Error(`Unsupported type: ${n}`); - } - return r; -} -function $$10(e, t) { - if (typeof e == `boolean`) return e ? Q$10.any() : Q$10.never(); - let n = ks$3(e, t), r = e.type || e.enum !== void 0 || e.const !== void 0; - if (e.anyOf && Array.isArray(e.anyOf)) { - let i = e.anyOf.map((e) => $$10(e, t)), a = Q$10.union(i); - n = r ? Q$10.intersection(n, a) : a; - } - if (e.oneOf && Array.isArray(e.oneOf)) { - let i = e.oneOf.map((e) => $$10(e, t)), a = Q$10.xor(i); - n = r ? Q$10.intersection(n, a) : a; - } - if (e.allOf && Array.isArray(e.allOf)) if (e.allOf.length === 0) n = r ? n : Q$10.any(); - else { - let i = r ? n : $$10(e.allOf[0], t), a = +!r; - for (let n = a; n < e.allOf.length; n++) i = Q$10.intersection(i, $$10(e.allOf[n], t)); - n = i; - } - e.nullable === !0 && t.version === `openapi-3.0` && (n = Q$10.nullable(n)), e.readOnly === !0 && (n = Q$10.readonly(n)), e.default !== void 0 && (n = n.default(e.default)); - let i = {}; - for (let t of [ - `$id`, - `id`, - `$comment`, - `$anchor`, - `$vocabulary`, - `$dynamicRef`, - `$dynamicAnchor` - ]) t in e && (i[t] = e[t]); - for (let t of [ - `contentEncoding`, - `contentMediaType`, - `contentSchema` - ]) t in e && (i[t] = e[t]); - for (let t of Object.keys(e)) Es$3.has(t) || (i[t] = e[t]); - return Object.keys(i).length > 0 && t.registry.add(n, i), e.description && (n = n.describe(e.description)), n; -} -function As$3(e, t) { - if (typeof e == `boolean`) return e ? Q$10.any() : Q$10.never(); - let n; - try { - n = JSON.parse(JSON.stringify(e)); - } catch { - throw Error(`fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas`); - } - let r = { - version: Ds$3(n, t?.defaultTarget), - defs: n.$defs || n.definitions || {}, - refs: /* @__PURE__ */ new Map(), - processing: /* @__PURE__ */ new Set(), - rootSchema: n, - registry: t?.registry ?? K$10 - }; - return $$10(n, r); -} -var js$3 = t$13({ - bigint: () => Fs$3, - boolean: () => Ps$3, - date: () => Is$3, - number: () => Ns$3, - string: () => Ms$3 -}); -function Ms$3(e) { - return Ho$4(C$13, e); -} -function Ns$3(e) { - return vs$4(F$10, e); -} -function Ps$3(e) { - return Ts$4(L$9, e); -} -function Fs$3(t) { - return Ds$4(R$11, t); -} -function Is$3(e) { - return Rs$3(io$3, e); -} -var Ls$3 = t$13({ - $brand: () => a$13, - $input: () => Ro$4, - $output: () => Lo$4, - NEVER: () => r$17, - TimePrecision: () => fs$4, - ZodAny: () => Qa$4, - ZodArray: () => oo$3, - ZodBase64: () => Ca$5, - ZodBase64URL: () => Ta$5, - ZodBigInt: () => R$11, - ZodBigIntFormat: () => Ua$5, - ZodBoolean: () => L$9, - ZodCIDRv4: () => ya$5, - ZodCIDRv6: () => xa$5, - ZodCUID: () => M$11, - ZodCUID2: () => N$10, - ZodCatch: () => Yo$3, - ZodCodec: () => Y$12, - ZodCustom: () => Z$11, - ZodCustomStringFormat: () => P$10, - ZodDate: () => io$3, - ZodDefault: () => Vo$3, - ZodDiscriminatedUnion: () => ho$3, - ZodE164: () => Da$5, - ZodEmail: () => E$13, - ZodEmoji: () => A$11, - ZodEnum: () => G$8, - ZodError: () => Ni$5, - ZodExactOptional: () => Lo$3, - ZodFile: () => Mo$3, - ZodFirstPartyTypeKind: () => Ts$3, - ZodFunction: () => ds$3, - ZodGUID: () => D$12, - ZodIPv4: () => pa$5, - ZodIPv6: () => _a$5, - ZodISODate: () => Ei$5, - ZodISODateTime: () => wi$5, - ZodISODuration: () => Ai$5, - ZodISOTime: () => Oi$5, - ZodIntersection: () => _o$3, - ZodIssueCode: () => Ss$3, - ZodJWT: () => ka$5, - ZodKSUID: () => da$5, - ZodLazy: () => ss$3, - ZodLiteral: () => Ao$3, - ZodMAC: () => ha$5, - ZodMap: () => wo$3, - ZodNaN: () => Zo$3, - ZodNanoID: () => j$11, - ZodNever: () => to$4, - ZodNonOptional: () => Go$3, - ZodNull: () => Xa$4, - ZodNullable: () => zo$3, - ZodNumber: () => F$10, - ZodNumberFormat: () => I$10, - ZodObject: () => H$10, - ZodOptional: () => Io$3, - ZodPipe: () => J$9, - ZodPrefault: () => Uo$3, - ZodPreprocess: () => ns$3, - ZodPromise: () => ls$3, - ZodReadonly: () => rs$3, - ZodRealError: () => b$10, - ZodRecord: () => W$8, - ZodSet: () => Eo$3, - ZodString: () => C$13, - ZodStringFormat: () => T$13, - ZodSuccess: () => qo$3, - ZodSymbol: () => Ka$5, - ZodTemplateLiteral: () => as$3, - ZodTransform: () => Po$3, - ZodTuple: () => yo$3, - ZodType: () => x$11, - ZodULID: () => sa$5, - ZodURL: () => k$12, - ZodUUID: () => O$11, - ZodUndefined: () => Ja$4, - ZodUnion: () => U$10, - ZodUnknown: () => eo$4, - ZodVoid: () => no$3, - ZodXID: () => la$5, - ZodXor: () => po$3, - _ZodString: () => S$12, - _default: () => Ho$3, - _function: () => X$12, - any: () => $a$4, - array: () => V$11, - base64: () => wa$5, - base64url: () => Ea$5, - bigint: () => Ha$5, - boolean: () => Va$5, - catch: () => Xo$3, - check: () => fs$3, - cidrv4: () => ba$5, - cidrv6: () => Sa$5, - clone: () => C$14, - codec: () => es$3, - coerce: () => js$3, - config: () => l$12, - core: () => Rl$3, - cuid: () => aa$5, - cuid2: () => oa$5, - custom: () => ps$3, - date: () => ao$3, - decode: () => zi$5, - decodeAsync: () => Vi$5, - describe: () => gs$3, - discriminatedUnion: () => go$3, - e164: () => Oa$5, - email: () => Yi$5, - emoji: () => ra$5, - encode: () => Ri$5, - encodeAsync: () => Bi$5, - endsWith: () => ac$3, - enum: () => Oo$3, - exactOptional: () => Ro$3, - file: () => No$3, - flattenError: () => Ge$9, - float32: () => La$5, - float64: () => Ra$5, - formatError: () => Ke$9, - fromJSONSchema: () => As$3, - function: () => X$12, - getErrorMap: () => ws$3, - globalRegistry: () => K$10, - gt: () => Hs$3, - gte: () => q$10, - guid: () => Xi$5, - hash: () => Pa$5, - hex: () => Na$5, - hostname: () => Ma$5, - httpUrl: () => na$5, - includes: () => rc$3, - instanceof: () => vs$3, - int: () => Ia$5, - int32: () => za$5, - int64: () => Wa$5, - intersection: () => vo$3, - invertCodec: () => ts$3, - ipv4: () => ma$5, - ipv6: () => va$5, - iso: () => Ci$5, - json: () => bs$3, - jwt: () => Aa$5, - keyof: () => so$3, - ksuid: () => fa$5, - lazy: () => cs$3, - length: () => $s$3, - literal: () => jo$3, - locales: () => Fo$4, - looseObject: () => uo$3, - looseRecord: () => Co$3, - lowercase: () => tc$3, - lt: () => Bs$3, - lte: () => Vs$3, - mac: () => ga$5, - map: () => To$3, - maxLength: () => Zs$3, - maxSize: () => Js$3, - meta: () => _s$3, - mime: () => sc$3, - minLength: () => Qs$3, - minSize: () => Ys$3, - multipleOf: () => qs$3, - nan: () => Qo$3, - nanoid: () => ia$5, - nativeEnum: () => ko$3, - negative: () => Ws$3, - never: () => B$12, - nonnegative: () => Ks$3, - nonoptional: () => Ko$3, - nonpositive: () => Gs$3, - normalize: () => cc$3, - null: () => Za$4, - nullable: () => q$9, - nullish: () => Bo$3, - number: () => Fa$5, - object: () => co$3, - optional: () => K$9, - overwrite: () => J$10, - parse: () => Pi$5, - parseAsync: () => Fi$5, - partialRecord: () => So$3, - pipe: () => $o$3, - positive: () => Us$3, - prefault: () => Wo$3, - preprocess: () => xs$3, - prettifyError: () => Ye$10, - promise: () => us$3, - property: () => oc$3, - readonly: () => is$3, - record: () => xo$3, - refine: () => ms$3, - regex: () => ec$3, - regexes: () => gt$8, - registry: () => Bo$4, - safeDecode: () => Ui$5, - safeDecodeAsync: () => Gi$5, - safeEncode: () => Hi$5, - safeEncodeAsync: () => Wi$5, - safeParse: () => Ii$5, - safeParseAsync: () => Li$5, - set: () => Do$3, - setErrorMap: () => Cs$3, - size: () => Xs$3, - slugify: () => fc$3, - startsWith: () => ic$3, - strictObject: () => lo$3, - string: () => w$13, - stringFormat: () => ja$5, - stringbool: () => ys$3, - success: () => Jo$3, - superRefine: () => hs$3, - symbol: () => qa$5, - templateLiteral: () => os$3, - toJSONSchema: () => Fl$3, - toLowerCase: () => uc$3, - toUpperCase: () => dc$3, - transform: () => Fo$3, - treeifyError: () => qe$9, - trim: () => lc$3, - tuple: () => bo$3, - uint32: () => Ba$5, - uint64: () => Ga$5, - ulid: () => ca$5, - undefined: () => Ya$4, - union: () => fo$3, - unknown: () => z$11, - uppercase: () => nc$3, - url: () => ta$5, - util: () => u$14, - uuid: () => Zi$5, - uuidv4: () => Qi$5, - uuidv6: () => $i$5, - uuidv7: () => ea$5, - void: () => ro$3, - xid: () => ua$5, - xor: () => mo$3 -}); -l$12(na$6()); -//#endregion -//#region node_modules/eve/dist/src/discover/diagnostics.js -const discoverDiagnosticSeveritySchema = Ls$3.union([Ls$3.literal(`error`), Ls$3.literal(`warning`)]); -const discoverDiagnosticSchema = Ls$3.object({ - code: Ls$3.string(), - message: Ls$3.string(), - severity: discoverDiagnosticSeveritySchema, - sourcePath: Ls$3.string() -}).strict(); -const discoverDiagnosticsSummarySchema = Ls$3.object({ - errors: Ls$3.number().finite(), - warnings: Ls$3.number().finite() -}).strict(); -//#endregion -//#region node_modules/eve/dist/src/shared/json.js -const INVALID_JSON_VALUE_CANDIDATE = Symbol(`invalid-json-value-candidate`); -function parseJsonValue(t) { - let n = normalizeJsonValueCandidate(t); - if (n === INVALID_JSON_VALUE_CANDIDATE) throw TypeError(`Expected a JSON-serializable value.`); - return n; -} -function parseJsonObject(e) { - let t = parseJsonValue(e); - if (!isJsonObjectValue(t)) throw TypeError(`Expected a JSON-serializable object.`); - return t; -} -function normalizeJsonValueCandidate(t, n = /* @__PURE__ */ new WeakSet()) { - if (t === null || typeof t == `boolean` || typeof t == `string`) return t; - if (typeof t == `number`) return Number.isFinite(t) ? t : INVALID_JSON_VALUE_CANDIDATE; - if (Array.isArray(t)) { - let r = []; - for (let i of t) { - let t = normalizeJsonValueCandidate(i, n); - if (t === INVALID_JSON_VALUE_CANDIDATE) return INVALID_JSON_VALUE_CANDIDATE; - r.push(t); - } - return r; - } - if (typeof t != `object` || t === void 0 || !isPlainObject(t) || n.has(t)) return INVALID_JSON_VALUE_CANDIDATE; - n.add(t); - let r = {}; - for (let [i, a] of Object.entries(t)) { - if (a === void 0) continue; - let t = normalizeJsonValueCandidate(a, n); - if (t === INVALID_JSON_VALUE_CANDIDATE) return INVALID_JSON_VALUE_CANDIDATE; - r[i] = t; - } - return n.delete(t), r; -} -function isJsonObjectValue(e) { - return e !== null && !Array.isArray(e) && typeof e == `object`; -} -function isPlainObject(e) { - let t = Object.getPrototypeOf(e); - return t === null || t === Object.prototype; -} -//#endregion -//#region node_modules/eve/dist/src/shared/json-schemas.js -const jsonValueSchema = Ls$3.unknown().transform((t, r) => { - try { - return parseJsonValue(t); - } catch (t) { - return r.addIssue({ - code: `custom`, - message: formatJsonParseError(t, `Expected a JSON-serializable value.`) - }), Ls$3.NEVER; - } -}); -const jsonObjectSchema = Ls$3.unknown().transform((n, r) => { - try { - return parseJsonObject(n); - } catch (t) { - return r.addIssue({ - code: `custom`, - message: formatJsonParseError(t, `Expected a JSON-serializable object.`) - }), Ls$3.NEVER; - } -}); -function formatJsonParseError(e, t) { - return e instanceof Error ? e.message : t; -} -//#endregion -//#region node_modules/eve/dist/src/compiler/remote-agent-node.js -const compiledRemoteAgentNodeSchema = Ls$3.object({ - description: Ls$3.string(), - entryPath: Ls$3.string(), - exportName: Ls$3.string().optional(), - logicalPath: Ls$3.string(), - name: Ls$3.string(), - nodeId: Ls$3.string(), - outputSchema: jsonObjectSchema.optional(), - path: Ls$3.string(), - rootPath: Ls$3.string(), - sourceId: Ls$3.string(), - sourceKind: Ls$3.literal(`module`), - url: Ls$3.string() -}).strict(); -//#endregion -//#region node_modules/eve/dist/src/compiler/manifest.js -const COMPILED_AGENT_MANIFEST_KIND = `eve-agent-compiled-manifest`; -const ROOT_COMPILED_AGENT_NODE_ID = `__root__`; -const moduleSourceRefSchema = Ls$3.object({ - exportName: Ls$3.string().optional(), - sourceKind: Ls$3.literal(`module`), - logicalPath: Ls$3.string(), - sourceId: Ls$3.string() -}).strict(); -const channelMethodSchema = Ls$3.union([ - Ls$3.literal(`GET`), - Ls$3.literal(`POST`), - Ls$3.literal(`PUT`), - Ls$3.literal(`PATCH`), - Ls$3.literal(`DELETE`), - Ls$3.literal(`WEBSOCKET`) -]); -const compiledChannelCorsSchema = Ls$3.object({ - origin: Ls$3.union([ - Ls$3.literal(`*`), - Ls$3.literal(`null`), - Ls$3.array(Ls$3.string()) - ]).optional(), - methods: Ls$3.union([Ls$3.literal(`*`), Ls$3.array(Ls$3.string())]).optional(), - allowHeaders: Ls$3.union([Ls$3.literal(`*`), Ls$3.array(Ls$3.string())]).optional(), - exposeHeaders: Ls$3.union([Ls$3.literal(`*`), Ls$3.array(Ls$3.string())]).optional(), - credentials: Ls$3.boolean().optional(), - maxAge: Ls$3.union([Ls$3.string(), Ls$3.literal(!1)]).optional(), - preflight: Ls$3.object({ statusCode: Ls$3.number().int().min(100).max(599).optional() }).strict().optional() -}).strict(); -const compiledChannelDefinitionSchema = Ls$3.object({ - kind: Ls$3.literal(`channel`), - name: Ls$3.string(), - logicalPath: Ls$3.string(), - method: channelMethodSchema, - urlPath: Ls$3.string(), - sourceId: Ls$3.string(), - sourceKind: Ls$3.literal(`module`), - exportName: Ls$3.string().optional(), - adapterKind: Ls$3.string().optional(), - cors: compiledChannelCorsSchema.optional() -}).strict(); -const disabledCompiledChannelEntrySchema = Ls$3.object({ - kind: Ls$3.literal(`disabled`), - name: Ls$3.string(), - logicalPath: Ls$3.string() -}).strict(); -const compiledChannelEntrySchema = Ls$3.union([compiledChannelDefinitionSchema, disabledCompiledChannelEntrySchema]); -const modelRoutingSchema = Ls$3.union([Ls$3.object({ - kind: Ls$3.literal(`gateway`), - target: Ls$3.string(), - byok: Ls$3.string().optional() -}).strict(), Ls$3.object({ - kind: Ls$3.literal(`external`), - provider: Ls$3.string() -}).strict()]); -const compiledRuntimeModelReferenceSchema = Ls$3.object({ - contextWindowTokens: Ls$3.number().int().positive().optional(), - id: Ls$3.string(), - source: moduleSourceRefSchema.optional(), - providerOptions: Ls$3.record(Ls$3.string(), jsonObjectSchema).optional(), - routing: modelRoutingSchema -}).strict(); -const compiledAgentBuildDefinitionSchema = Ls$3.object({ externalDependencies: Ls$3.array(Ls$3.string()).optional() }).strict(); -const compiledAgentWorkflowWorldDefinitionSchema = Ls$3.string(); -const compiledAgentWorkflowDefinitionSchema = Ls$3.object({ world: compiledAgentWorkflowWorldDefinitionSchema.optional() }).strict(); -const compiledAgentCompactionDefinitionSchema = Ls$3.object({ - model: compiledRuntimeModelReferenceSchema.optional(), - thresholdPercent: Ls$3.number().finite().min(0).max(1).optional() -}).strict(); -const compiledAgentConfigSchema = Ls$3.object({ - build: compiledAgentBuildDefinitionSchema.optional(), - compaction: compiledAgentCompactionDefinitionSchema.optional(), - description: Ls$3.string().optional(), - experimental: Ls$3.object({ workflow: compiledAgentWorkflowDefinitionSchema.optional() }).strict().optional(), - model: compiledRuntimeModelReferenceSchema, - name: Ls$3.string(), - outputSchema: jsonObjectSchema.optional(), - reasoning: Ls$3.enum([ - `provider-default`, - `none`, - `minimal`, - `low`, - `medium`, - `high`, - `xhigh` - ]).optional(), - source: moduleSourceRefSchema.optional() -}).strict(); -const compiledInstructionsSchema = Ls$3.object({ - name: Ls$3.string(), - logicalPath: Ls$3.string(), - markdown: Ls$3.string(), - sourceId: Ls$3.string(), - sourceKind: Ls$3.union([Ls$3.literal(`markdown`), Ls$3.literal(`module`)]) -}).strict(); -const compiledSkillBaseFields = { - name: Ls$3.string(), - description: Ls$3.string(), - license: Ls$3.string().optional(), - markdown: Ls$3.string(), - metadata: Ls$3.record(Ls$3.string(), Ls$3.string()).optional(), - sourceId: Ls$3.string(), - logicalPath: Ls$3.string() -}; -const compiledSkillSourceSchema = Ls$3.discriminatedUnion(`sourceKind`, [ - Ls$3.object({ - ...compiledSkillBaseFields, - sourceKind: Ls$3.literal(`markdown`) - }).strict(), - Ls$3.object({ - ...compiledSkillBaseFields, - sourceKind: Ls$3.literal(`module`), - exportName: Ls$3.string().optional() - }).strict(), - Ls$3.object({ - ...compiledSkillBaseFields, - sourceKind: Ls$3.literal(`skill-package`), - skillId: Ls$3.string(), - skillFilePath: Ls$3.string(), - rootPath: Ls$3.string(), - assetsPath: Ls$3.string().optional(), - referencesPath: Ls$3.string().optional(), - scriptsPath: Ls$3.string().optional() - }).strict() -]); -const compiledScheduleDefinitionSchema = Ls$3.object({ - cron: Ls$3.string(), - hasRun: Ls$3.boolean(), - name: Ls$3.string(), - logicalPath: Ls$3.string(), - markdown: Ls$3.string().optional(), - sourceId: Ls$3.string(), - sourceKind: Ls$3.union([Ls$3.literal(`markdown`), Ls$3.literal(`module`)]) -}).strict(); -const compiledSandboxDefinitionSchema = Ls$3.object({ - backendName: Ls$3.string().optional(), - description: Ls$3.string().optional(), - exportName: Ls$3.string().optional(), - logicalPath: Ls$3.string(), - revalidationKey: Ls$3.string().optional(), - sourceHash: Ls$3.string(), - sourceId: Ls$3.string(), - sourceKind: Ls$3.literal(`module`) -}).strict(); -const compiledSandboxWorkspaceSchema = Ls$3.object({ - logicalPath: Ls$3.string(), - rootEntries: Ls$3.array(Ls$3.string()).readonly(), - sourceId: Ls$3.string(), - sourcePath: Ls$3.string() -}).strict(); -const compiledWorkspaceResourceRootSchema = Ls$3.object({ - contentHash: Ls$3.string().optional(), - logicalPath: Ls$3.string(), - rootEntries: Ls$3.array(Ls$3.string()).readonly() -}).strict(); -const compiledConnectionDefinitionSchema = Ls$3.object({ - connectionName: Ls$3.string(), - description: Ls$3.string(), - exportName: Ls$3.string().optional(), - logicalPath: Ls$3.string(), - protocol: Ls$3.enum([`mcp`, `openapi`]).default(`mcp`), - sourceId: Ls$3.string(), - sourceKind: Ls$3.literal(`module`), - url: Ls$3.string(), - vercelConnect: Ls$3.object({ connector: Ls$3.string() }).strict().optional() -}).strict(); -const compiledToolDefinitionSchema = Ls$3.object({ - description: Ls$3.string(), - exportName: Ls$3.string().optional(), - inputSchema: jsonObjectSchema.nullable(), - logicalPath: Ls$3.string(), - name: Ls$3.string(), - outputSchema: jsonObjectSchema.optional(), - sourceId: Ls$3.string(), - sourceKind: Ls$3.literal(`module`) -}).strict(); -const compiledDynamicToolDefinitionSchema = Ls$3.object({ - eventNames: Ls$3.array(Ls$3.string()).readonly(), - exportName: Ls$3.string().optional(), - logicalPath: Ls$3.string(), - slug: Ls$3.string(), - sourceId: Ls$3.string(), - sourceKind: Ls$3.literal(`module`) -}).strict(); -const compiledDynamicSkillDefinitionSchema = Ls$3.object({ - eventNames: Ls$3.array(Ls$3.string()).readonly(), - exportName: Ls$3.string().optional(), - logicalPath: Ls$3.string(), - slug: Ls$3.string(), - sourceId: Ls$3.string(), - sourceKind: Ls$3.literal(`module`) -}).strict(); -const compiledDynamicInstructionsDefinitionSchema = Ls$3.object({ - eventNames: Ls$3.array(Ls$3.string()).readonly(), - exportName: Ls$3.string().optional(), - logicalPath: Ls$3.string(), - slug: Ls$3.string(), - sourceId: Ls$3.string(), - sourceKind: Ls$3.literal(`module`) -}).strict(); -const compiledHookDefinitionSchema = Ls$3.object({ - exportName: Ls$3.string().optional(), - logicalPath: Ls$3.string(), - slug: Ls$3.string(), - sourceId: Ls$3.string(), - sourceKind: Ls$3.literal(`module`) -}).strict(); -const compiledAgentNodeManifestSchema = Ls$3.object({ - agentRoot: Ls$3.string(), - appRoot: Ls$3.string(), - channels: Ls$3.array(compiledChannelEntrySchema), - config: compiledAgentConfigSchema, - connections: Ls$3.array(compiledConnectionDefinitionSchema), - diagnosticsSummary: discoverDiagnosticsSummarySchema, - disabledFrameworkTools: Ls$3.array(Ls$3.string()).readonly(), - workflowEnabled: Ls$3.boolean().default(!1), - dynamicInstructions: Ls$3.array(compiledDynamicInstructionsDefinitionSchema).default([]), - dynamicSkills: Ls$3.array(compiledDynamicSkillDefinitionSchema).default([]), - dynamicTools: Ls$3.array(compiledDynamicToolDefinitionSchema).default([]), - hooks: Ls$3.array(compiledHookDefinitionSchema), - sandbox: compiledSandboxDefinitionSchema.nullable(), - sandboxWorkspaces: Ls$3.array(compiledSandboxWorkspaceSchema), - schedules: Ls$3.array(compiledScheduleDefinitionSchema), - remoteAgents: Ls$3.array(compiledRemoteAgentNodeSchema), - skills: Ls$3.array(compiledSkillSourceSchema).readonly(), - instructions: compiledInstructionsSchema.optional(), - tools: Ls$3.array(compiledToolDefinitionSchema), - workspaceResourceRoot: compiledWorkspaceResourceRootSchema -}).strict(); -const compiledSubagentNodeSchema = Ls$3.object({ - agent: compiledAgentNodeManifestSchema, - description: Ls$3.string(), - entryPath: Ls$3.string(), - logicalPath: Ls$3.string(), - name: Ls$3.string(), - nodeId: Ls$3.string(), - rootPath: Ls$3.string(), - sourceId: Ls$3.string(), - sourceKind: Ls$3.literal(`module`), - exportName: Ls$3.string().optional() -}).strict(); -const compiledSubagentEdgeSchema = Ls$3.object({ - childNodeId: Ls$3.string(), - parentNodeId: Ls$3.string() -}).strict(); -const compiledAgentManifestSchema = Ls$3.object({ - agentRoot: Ls$3.string(), - appRoot: Ls$3.string(), - channels: Ls$3.array(compiledChannelEntrySchema), - config: compiledAgentConfigSchema, - connections: Ls$3.array(compiledConnectionDefinitionSchema), - diagnosticsSummary: discoverDiagnosticsSummarySchema, - disabledFrameworkTools: Ls$3.array(Ls$3.string()).readonly(), - workflowEnabled: Ls$3.boolean().default(!1), - dynamicInstructions: Ls$3.array(compiledDynamicInstructionsDefinitionSchema).default([]), - dynamicSkills: Ls$3.array(compiledDynamicSkillDefinitionSchema).default([]), - dynamicTools: Ls$3.array(compiledDynamicToolDefinitionSchema).default([]), - hooks: Ls$3.array(compiledHookDefinitionSchema), - kind: Ls$3.literal(COMPILED_AGENT_MANIFEST_KIND), - remoteAgents: Ls$3.array(compiledRemoteAgentNodeSchema), - sandbox: compiledSandboxDefinitionSchema.nullable(), - sandboxWorkspaces: Ls$3.array(compiledSandboxWorkspaceSchema), - schedules: Ls$3.array(compiledScheduleDefinitionSchema), - skills: Ls$3.array(compiledSkillSourceSchema).readonly(), - subagentEdges: Ls$3.array(compiledSubagentEdgeSchema), - subagents: Ls$3.array(compiledSubagentNodeSchema), - instructions: compiledInstructionsSchema.optional(), - tools: Ls$3.array(compiledToolDefinitionSchema), - version: Ls$3.literal(31), - workspaceResourceRoot: compiledWorkspaceResourceRootSchema -}).strict(); -//#endregion -//#region node_modules/eve/dist/src/runtime/sessions/runtime-session.js -function createRuntimeSession(e = `test-session`) { - return { - bundleCache: /* @__PURE__ */ new Map(), - bundleCacheKeyBySourceKey: /* @__PURE__ */ new Map(), - compiledArtifacts: null, - id: e - }; -} -const RUNTIME_SESSION_STORAGE_GLOBAL_KEY = Symbol.for(`eve.runtime-session-storage`); -const RUNTIME_SESSION_DEFAULT_GLOBAL_KEY = Symbol.for(`eve.runtime-session-default`); -const globalContainer$1 = globalThis; -globalContainer$1[RUNTIME_SESSION_STORAGE_GLOBAL_KEY] === void 0 && (globalContainer$1[RUNTIME_SESSION_STORAGE_GLOBAL_KEY] = new AsyncLocalStorage()); -const runtimeSessionStorage = globalContainer$1[RUNTIME_SESSION_STORAGE_GLOBAL_KEY]; -function resolveProcessDefaultSession() { - return globalContainer$1[RUNTIME_SESSION_DEFAULT_GLOBAL_KEY] === void 0 && (globalContainer$1[RUNTIME_SESSION_DEFAULT_GLOBAL_KEY] = createRuntimeSession(`process-default`)), globalContainer$1[RUNTIME_SESSION_DEFAULT_GLOBAL_KEY]; -} -function getActiveRuntimeSession() { - return runtimeSessionStorage.getStore() ?? resolveProcessDefaultSession(); -} -//#endregion -//#region node_modules/eve/dist/src/runtime/loaders/bundled-artifacts.js -function installBundledCompiledArtifacts(e) { - getActiveRuntimeSession().compiledArtifacts = { - manifest: e.manifest, - metadata: e.metadata, - moduleMap: e.moduleMap - }; -} -function readBundledCompiledArtifacts() { - return getActiveRuntimeSession().compiledArtifacts; -} -//#endregion -//#region node_modules/eve/dist/src/runtime/loaders/artifact-paths.js -function resolveRuntimeCompilerArtifactPaths(e) { - let t = normalizeFilesystemPath(e), n = `${t}/.eve/discovery`, r = `${t}/.eve/compile`; - return { - appRoot: t, - compiledManifestPath: `${r}/compiled-agent-manifest.json`, - compileDirectoryPath: r, - compileMetadataPath: `${r}/compile-metadata.json`, - diagnosticsPath: `${n}/diagnostics.json`, - discoveryDirectoryPath: n, - discoveryManifestPath: `${n}/agent-discovery-manifest.json`, - moduleMapPath: `${r}/module-map.mjs` - }; -} -function normalizeFilesystemPath(e) { - let t = e.replaceAll(`\\`, `/`); - return t === `/` ? t : t.replace(/\/+$/, ``); -} -//#endregion -//#region node_modules/eve/dist/src/compiled/zod-validation-error/index.js -function t$12(e) { - return e instanceof Object && `name` in e && (e.name === `ZodError` || e.name === `$ZodError`) && `issues` in e && Array.isArray(e.issues); -} -var n$14 = `ZodValidationError`; -var r$16 = class extends Error { - name; - details; - constructor(e, t) { - super(e, t), this.name = n$14, this.details = i$15(t); - } - toString() { - return this.message; - } -}; -function i$15(e) { - if (e) { - let n = e.cause; - if (t$12(n)) return n.issues; - } - return []; -} -function f$12(e) { - return e.description ?? ``; -} -function O$10(e) { - return e.length !== 0; -} -var k$11 = /[$_\p{ID_Start}][$\u200c\u200d\p{ID_Continue}]*/u; -function A$10(e) { - if (e.length === 1) { - let t = e[0]; - return typeof t == `symbol` && (t = f$12(t)), t.toString() || `""`; - } - return e.reduce((e, t) => typeof t == `number` ? e + `[` + t.toString() + `]` : (typeof t == `symbol` && (t = f$12(t)), t.includes(`"`) ? e + `["` + j$10(t) + `"]` : k$11.test(t) ? e + (e.length === 0 ? `` : `.`) + t : e + `["` + t + `"]`), ``); -} -function j$10(e) { - return e.replace(/"/g, `\\"`); -} -function M$10(e) { - return e.length === 0 ? e : e.charAt(0).toUpperCase() + e.slice(1); -} -var N$9 = { - prefix: `Validation error`, - prefixSeparator: `: `, - maxIssuesInMessage: 99, - unionSeparator: ` or `, - issueSeparator: `; `, - includePath: !0, - forceTitleCase: !0 -}; -function P$9(e = {}) { - let t = { - ...N$9, - ...e - }; - return function(e) { - return I$9(e.slice(0, t.maxIssuesInMessage).map((e) => F$9(e, t)).join(t.issueSeparator), t); - }; -} -function F$9(e, t) { - if (e.code === `invalid_union` && O$10(e.errors)) { - let n = e.errors.map((n) => n.map((n) => F$9({ - ...n, - path: e.path.concat(n.path) - }, t)).join(t.issueSeparator)); - return Array.from(new Set(n)).join(t.unionSeparator); - } - let n = []; - t.forceTitleCase ? n.push(M$10(e.message)) : n.push(e.message); - pathCondition: if (t.includePath && e.path !== void 0 && O$10(e.path)) { - if (e.path.length === 1) { - let t = e.path[0]; - if (typeof t == `number`) { - n.push(` at index ${t}`); - break pathCondition; - } - } - n.push(` at "${A$10(e.path)}"`); - } - return n.join(``); -} -function I$9(e, t) { - return t.prefix == null ? e.length > 0 ? e : N$9.prefix : e.length > 0 ? [t.prefix, e].join(t.prefixSeparator) : t.prefix; -} -function R$10(e, t = {}) { - let n = e.issues, i; - return i = O$10(n) ? z$10(t)(n) : e.message, new r$16(i, { cause: e }); -} -function z$10(e) { - return `messageBuilder` in e ? e.messageBuilder : P$9(e); -} -var B$11 = (e = {}) => (n) => t$12(n) ? R$10(n, e) : n instanceof Error ? new r$16(n.message, { cause: n }) : new r$16(`Unknown error`); -function V$10(e, t = {}) { - return B$11(t)(e); -} -//#endregion -//#region node_modules/eve/dist/src/runtime/validation.js -function formatValidationError(e) { - return V$10(e, { prefix: void 0 }).message; -} -//#endregion -//#region node_modules/eve/dist/src/runtime/loaders/manifest.js -const BUNDLED_MANIFEST_SOURCE = `bundled compiled manifest`; -var LoadCompiledManifestError = class extends Error { - manifestPath; - constructor(e, t) { - super(e), this.name = `LoadCompiledManifestError`, t !== void 0 && (this.manifestPath = t); - } -}; -async function loadCompiledManifest(e) { - let r = e.compiledArtifactsSource.kind === `disk` ? resolveRuntimeCompilerArtifactPaths(e.compiledArtifactsSource.appRoot).compiledManifestPath : void 0; - if (r !== void 0) { - let { readFile: e } = await import(`node:fs/promises`), t; - try { - t = JSON.parse(await e(r, `utf8`)); - } catch (e) { - throw new LoadCompiledManifestError(formatLoadErrorMessage$2(e), r); - } - return parseCompiledManifest(t, r); - } - let a = readBundledCompiledArtifacts(); - if (a !== null) return parseCompiledManifest(a.manifest, BUNDLED_MANIFEST_SOURCE); - throw new LoadCompiledManifestError(`Compiled manifest is unavailable without an app root or bundled compiled artifacts.`, BUNDLED_MANIFEST_SOURCE); -} -function parseCompiledManifest(t, n) { - let i = compiledAgentManifestSchema.safeParse(t); - if (!i.success) throw new LoadCompiledManifestError(`Expected "${n}" to contain a valid compiled eve agent manifest. ${formatValidationError(i.error)}`, n); - return i.data; -} -function formatLoadErrorMessage$2(e) { - return e instanceof Error ? e.message : `Unknown manifest load failure.`; -} -//#endregion -//#region node_modules/eve/dist/src/internal/authored-module.js -function getAuthoredModuleExport(e, t) { - return e[t.exportName ?? `default`]; -} -async function materializeAuthoredModuleExport(e) { - return typeof e == `function` ? await e() : e; -} -function expectObjectRecord(e, t) { - if (typeof e != `object` || !e || Array.isArray(e)) throw Error(t); - return e; -} -function expectString(e, t) { - if (typeof e != `string`) throw Error(t); - return e; -} -function expectFunction(e, t) { - if (typeof e != `function`) throw Error(t); - return e; -} -function expectProviderOptions(e, t) { - let n = expectObjectRecord(e, t), r = {}; - for (let [e, i] of Object.entries(n)) r[e] = expectObjectRecord(i, t); - return r; -} -function expectOnlyKnownKeys(e, t, n) { - let r = new Set(t); - for (let t of Object.keys(e)) if (!r.has(t)) throw Error(`${n} Unknown key "${t}".`); -} -//#endregion -//#region node_modules/eve/dist/src/runtime/skills/fragment-context.js -const LOAD_SKILL_TOOL_NAME = `load_skill`; -//#endregion -//#region node_modules/eve/dist/src/internal/runtime-registry.js -var RuntimeRegistryError = class extends Error { - registry; - entryName; - logicalPath; - sourceId; - constructor(e, t, n = {}) { - super(t), this.name = `RuntimeRegistryError`, this.registry = e, n.entryName !== void 0 && (this.entryName = n.entryName), n.logicalPath !== void 0 && (this.logicalPath = n.logicalPath), n.sourceId !== void 0 && (this.sourceId = n.sourceId); - } -}; -var RuntimeRegistry = class { - registry; - _entries = /* @__PURE__ */ new Map(); - _reserved; - constructor(e, t = []) { - this.registry = e, this._reserved = new Set(t); - } - get size() { - return this._entries.size; - } - has(e) { - return this._entries.has(e); - } - get(e) { - return this._entries.get(e) ?? null; - } - asMap() { - return this._entries; - } - register(e, t, n = {}) { - if (this._entries.has(e)) throw new RuntimeRegistryError(this.registry, n.duplicateMessage ?? `Duplicate ${this.registry} name "${e}".`, { - ...n.location, - entryName: e - }); - if (this._reserved.has(e)) throw new RuntimeRegistryError(this.registry, n.reservedMessage ?? `${capitalize(this.registry)} "${e}" collides with another runtime-visible name.`, { - ...n.location, - entryName: e - }); - this._entries.set(e, t), this._reserved.add(e); - } - set(e, t) { - this._entries.set(e, t), this._reserved.add(e); - } -}; -function capitalize(e) { - return e.length === 0 ? e : e.charAt(0).toUpperCase() + e.slice(1); -} -//#endregion -//#region node_modules/eve/dist/src/runtime/tools/registry.js -async function createRuntimeToolRegistry(t, n = {}) { - let r = [], i = new RuntimeRegistry(`tool`, n.reservedToolNames ?? []); - for (let e of t.tools) { - let t = await createPreparedRuntimeTool(e); - i.register(e.name, { - definition: e, - prepared: t - }, { - location: { - logicalPath: e.logicalPath, - sourceId: e.sourceId - }, - duplicateMessage: `Found multiple authored tools named "${e.name}". Tool names must be unique at runtime.`, - reservedMessage: `Tool "${e.name}" collides with another runtime-visible tool name.` - }), r.push(t); - } - return { - preparedTools: r, - toolsByName: i.asMap() - }; -} -function findRegisteredRuntimeTool(e, t) { - return e.toolsByName.get(t) ?? null; -} -async function createPreparedRuntimeTool(e) { - return { - description: e.description, - inputSchema: e.inputSchema, - kind: `authored-tool`, - logicalPath: e.logicalPath, - name: e.name, - outputSchema: e.outputSchema, - sourceId: e.sourceId - }; -} -//#endregion -//#region node_modules/eve/dist/src/runtime/subagents/registry.js -const SUBAGENT_TOOL_INPUT_SCHEMA = Object.freeze({ - type: `object`, - properties: Object.freeze({ - message: Object.freeze({ - type: `string`, - description: `The message to send to the subagent. Provide all context the subagent needs to complete the task; the subagent does not see the parent's history.` - }), - outputSchema: Object.freeze({ - type: `object`, - description: `When provided, the subagent runs in task mode and must produce structured output matching this JSON Schema. The structured output becomes the tool result.` - }) - }), - required: Object.freeze([`message`]), - additionalProperties: !1 -}); -function createRuntimeSubagentRegistry(t) { - let n = [], r = new RuntimeRegistry(`subagent`, t.reservedToolNames ?? []), i = /* @__PURE__ */ new Map(); - for (let e of t.subagents) { - let t = { - logicalPath: e.logicalPath, - sourceId: e.sourceId - }; - if (i.has(e.nodeId)) throw new RuntimeRegistryError(`subagent`, `Found multiple runtime subagents mapped to node id "${e.nodeId}".`, { - ...t, - entryName: e.name - }); - let a = createPreparedRuntimeSubagentTool(e), o = { - definition: e, - prepared: a - }; - r.register(e.name, o, { - location: t, - duplicateMessage: `Found multiple subagents named "${e.name}". Subagent names must be unique at runtime.`, - reservedMessage: `Subagent "${e.name}" collides with another runtime-visible tool name.` - }), n.push(a), i.set(e.nodeId, o); - } - return { - preparedTools: n, - subagentsByName: r.asMap(), - subagentsByNodeId: i - }; -} -function createPreparedRuntimeSubagentTool(e) { - return { - description: e.description, - inputSchema: SUBAGENT_TOOL_INPUT_SCHEMA, - kind: e.kind, - logicalPath: e.logicalPath, - name: e.name, - nodeId: e.nodeId, - outputSchema: e.kind === `remote` ? e.outputSchema : void 0, - sourceId: e.sourceId - }; -} -//#endregion -//#region node_modules/eve/dist/src/shared/workflow-sandbox.js -const WORKFLOW_TOOL_NAME = `Workflow`; -const WORKFLOW_SANDBOX_MODULE_KEY = Symbol.for(`eve.workflowSandbox.module`); -const WORKFLOW_SANDBOX_MODULE_SPECIFIER = [ - `#compiled`, - `experimental-ai-sdk-code-mode`, - `index.js` -].join(`/`); -let workflowSandboxModulePromise; -async function createWorkflowSandboxTool(e) { - let { createCodeModeTool: t } = await loadWorkflowSandboxModule(); - return t(e.hostTools, createWorkflowSandboxOptions(e.continuationSecurity, e.lifecycle)); -} -async function requestWorkflowSandboxInterrupt(e) { - let { requestCodeModeInterrupt: t } = await loadWorkflowSandboxModule(); - return t(e); -} -async function getWorkflowSandboxInterrupt(e, t) { - let { getCodeModeInterrupt: n } = await loadWorkflowSandboxModule(); - return n(e, t); -} -async function continueWorkflowSandboxInterrupt(e) { - let { continueCodeModeInterrupt: t } = await loadWorkflowSandboxModule(); - return t({ - interrupt: e.interrupt, - options: createWorkflowSandboxOptions(e.continuationSecurity, e.lifecycle), - resolution: e.resolution, - tools: e.tools - }); -} -async function unwrapWorkflowSandboxResult(e, t) { - let { unwrapCodeModeResult: n } = await loadWorkflowSandboxModule(); - return n(e, t); -} -function readWorkflowSandboxResolution(e) { - if (typeof e != `object` || !e) return; - let t = e.codeModeInterrupt; - if (!(typeof t != `object` || !t)) return t.resolution; -} -function createWorkflowSandboxOptions(e, t) { - let n = { continuationSecurity: e }; - return t !== void 0 && (n.lifecycle = t), n; -} -async function loadWorkflowSandboxModule() { - let e = globalThis[WORKFLOW_SANDBOX_MODULE_KEY]; - return e === void 0 ? (workflowSandboxModulePromise ??= importWorkflowSandboxModule(WORKFLOW_SANDBOX_MODULE_SPECIFIER), await workflowSandboxModulePromise) : e; -} -async function importWorkflowSandboxModule(e) { - return await import(e); -} -//#endregion -//#region node_modules/eve/dist/src/runtime/governance/auth/vercel-oidc-project.js -const VERCEL_OIDC_PROJECT_RESOLVERS = Symbol.for(`eve.vercel-oidc-project-resolvers`); -const globalResolverRegistry = globalThis; -globalResolverRegistry[VERCEL_OIDC_PROJECT_RESOLVERS] === void 0 && (globalResolverRegistry[VERCEL_OIDC_PROJECT_RESOLVERS] = /* @__PURE__ */ new WeakMap()); -const projectResolvers = globalResolverRegistry[VERCEL_OIDC_PROJECT_RESOLVERS]; -async function withVercelOidcProjectResolver(e, t) { - let n = projectResolvers.get(e.request); - projectResolvers.set(e.request, e.resolveCurrentProject); - try { - return await t(); - } finally { - n === void 0 ? projectResolvers.delete(e.request) : projectResolvers.set(e.request, n); - } -} -async function resolveVercelOidcCurrentProject(e) { - let t = projectResolvers.get(e); - return t === void 0 ? void 0 : await t(); -} -//#endregion -//#region node_modules/eve/dist/src/compiled/_chunks/workflow/chunk-BHKSVoKr.js -var t$11 = Object.create; -var n$13 = Object.defineProperty; -var r$15 = Object.getOwnPropertyDescriptor; -var i$14 = Object.getOwnPropertyNames; -var a$12 = Object.getPrototypeOf; -var o$12 = Object.prototype.hasOwnProperty; -var s$10 = (e, t) => () => (e && (t = e(e = 0)), t); -var c$12 = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports); -var l$11 = (e, t) => { - let r = {}; - for (var i in e) n$13(r, i, { - get: e[i], - enumerable: !0 - }); - return t || n$13(r, Symbol.toStringTag, { value: `Module` }), r; -}; -var u$13 = (e, t, a, s) => { - if (t && typeof t == `object` || typeof t == `function`) for (var c = i$14(t), l = 0, u = c.length, d; l < u; l++) d = c[l], !o$12.call(e, d) && d !== a && n$13(e, d, { - get: ((e) => t[e]).bind(null, d), - enumerable: !(s = r$15(t, d)) || s.enumerable - }); - return e; -}; -var d$13 = (e, r, i) => (i = e == null ? {} : t$11(a$12(e)), u$13(r || !e || !e.__esModule ? n$13(i, `default`, { - value: e, - enumerable: !0 -}) : i, e)); -var f$11 = createRequire(import.meta.url); -//#endregion -//#region node_modules/eve/dist/src/compiled/jose/index.js -const t$10 = new TextEncoder(); -const n$12 = new TextDecoder(); -function i$13(...e) { - let t = e.reduce((e, { length: t }) => e + t, 0), n = new Uint8Array(t), r = 0; - for (let t of e) n.set(t, r), r += t.length; - return n; -} -function c$11(e) { - let t = new Uint8Array(e.length); - for (let n = 0; n < e.length; n++) { - let r = e.charCodeAt(n); - if (r > 127) throw TypeError(`non-ASCII string encountered in encode()`); - t[n] = r; - } - return t; -} -function l$10(e) { - if (Uint8Array.prototype.toBase64) return e.toBase64(); - let t = 32768, n = []; - for (let r = 0; r < e.length; r += t) n.push(String.fromCharCode.apply(null, e.subarray(r, r + t))); - return btoa(n.join(``)); -} -function u$12(e) { - if (Uint8Array.fromBase64) return Uint8Array.fromBase64(e); - let t = atob(e), n = new Uint8Array(t.length); - for (let e = 0; e < t.length; e++) n[e] = t.charCodeAt(e); - return n; -} -var d$12 = l$11({ - decode: () => f$10, - encode: () => p$13 -}); -function f$10(e) { - if (Uint8Array.fromBase64) return Uint8Array.fromBase64(typeof e == `string` ? e : n$12.decode(e), { alphabet: `base64url` }); - let t = e; - t instanceof Uint8Array && (t = n$12.decode(t)), t = t.replace(/-/g, `+`).replace(/_/g, `/`); - try { - return u$12(t); - } catch { - throw TypeError(`The input to be decoded is not correctly encoded.`); - } -} -function p$13(e) { - let n = e; - return typeof n == `string` && (n = t$10.encode(n)), Uint8Array.prototype.toBase64 ? n.toBase64({ - alphabet: `base64url`, - omitPadding: !0 - }) : l$10(n).replace(/=/g, ``).replace(/\+/g, `-`).replace(/\//g, `_`); -} -const m$9 = (e, t = `algorithm.name`) => TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`); -const h$11 = (e, t) => e.name === t; -function g$10(e) { - return parseInt(e.name.slice(4), 10); -} -function _$9(e, t) { - if (g$10(e.hash) !== t) throw m$9(`SHA-${t}`, `algorithm.hash`); -} -function v$9(e) { - switch (e) { - case `ES256`: return `P-256`; - case `ES384`: return `P-384`; - case `ES512`: return `P-521`; - default: throw Error(`unreachable`); - } -} -function y$7(e, t) { - if (t && !e.usages.includes(t)) throw TypeError(`CryptoKey does not support this operation, its usages must include ${t}.`); -} -function ee$6(e, t, n) { - switch (t) { - case `HS256`: - case `HS384`: - case `HS512`: - if (!h$11(e.algorithm, `HMAC`)) throw m$9(`HMAC`); - _$9(e.algorithm, parseInt(t.slice(2), 10)); - break; - case `RS256`: - case `RS384`: - case `RS512`: - if (!h$11(e.algorithm, `RSASSA-PKCS1-v1_5`)) throw m$9(`RSASSA-PKCS1-v1_5`); - _$9(e.algorithm, parseInt(t.slice(2), 10)); - break; - case `PS256`: - case `PS384`: - case `PS512`: - if (!h$11(e.algorithm, `RSA-PSS`)) throw m$9(`RSA-PSS`); - _$9(e.algorithm, parseInt(t.slice(2), 10)); - break; - case `Ed25519`: - case `EdDSA`: - if (!h$11(e.algorithm, `Ed25519`)) throw m$9(`Ed25519`); - break; - case `ML-DSA-44`: - case `ML-DSA-65`: - case `ML-DSA-87`: - if (!h$11(e.algorithm, t)) throw m$9(t); - break; - case `ES256`: - case `ES384`: - case `ES512`: { - if (!h$11(e.algorithm, `ECDSA`)) throw m$9(`ECDSA`); - let n = v$9(t); - if (e.algorithm.namedCurve !== n) throw m$9(n, `algorithm.namedCurve`); - break; - } - default: throw TypeError(`CryptoKey does not support this operation`); - } - y$7(e, n); -} -function x$10(e, t, ...n) { - if (n = n.filter(Boolean), n.length > 2) { - let t = n.pop(); - e += `one of type ${n.join(`, `)}, or ${t}.`; - } else n.length === 2 ? e += `one of type ${n[0]} or ${n[1]}.` : e += `of type ${n[0]}.`; - return t == null ? e += ` Received ${t}` : typeof t == `function` && t.name ? e += ` Received function ${t.name}` : typeof t == `object` && t && t.constructor?.name && (e += ` Received an instance of ${t.constructor.name}`), e; -} -const S$11 = (e, ...t) => x$10(`Key must be `, e, ...t); -const te$6 = (e, t, ...n) => x$10(`Key for the ${e} algorithm must be `, t, ...n); -var ne$6 = l$11({ - JOSEAlgNotAllowed: () => ie$7, - JOSEError: () => C$12, - JOSENotSupported: () => T$12, - JWEDecryptionFailed: () => E$12, - JWEInvalid: () => D$11, - JWKInvalid: () => ae$8, - JWKSInvalid: () => oe$8, - JWKSMultipleMatchingKeys: () => ce$9, - JWKSNoMatchingKey: () => se$9, - JWKSTimeout: () => le$9, - JWSInvalid: () => O$9, - JWSSignatureVerificationFailed: () => ue$9, - JWTClaimValidationFailed: () => w$12, - JWTExpired: () => re$7, - JWTInvalid: () => k$10 -}); -var C$12 = class extends Error { - static code = `ERR_JOSE_GENERIC`; - code = `ERR_JOSE_GENERIC`; - constructor(e, t) { - super(e, t), this.name = this.constructor.name, Error.captureStackTrace?.(this, this.constructor); - } -}; -var w$12 = class extends C$12 { - static code = `ERR_JWT_CLAIM_VALIDATION_FAILED`; - code = `ERR_JWT_CLAIM_VALIDATION_FAILED`; - claim; - reason; - payload; - constructor(e, t, n = `unspecified`, r = `unspecified`) { - super(e, { cause: { - claim: n, - reason: r, - payload: t - } }), this.claim = n, this.reason = r, this.payload = t; - } -}; -var re$7 = class extends C$12 { - static code = `ERR_JWT_EXPIRED`; - code = `ERR_JWT_EXPIRED`; - claim; - reason; - payload; - constructor(e, t, n = `unspecified`, r = `unspecified`) { - super(e, { cause: { - claim: n, - reason: r, - payload: t - } }), this.claim = n, this.reason = r, this.payload = t; - } -}; -var ie$7 = class extends C$12 { - static code = `ERR_JOSE_ALG_NOT_ALLOWED`; - code = `ERR_JOSE_ALG_NOT_ALLOWED`; -}; -var T$12 = class extends C$12 { - static code = `ERR_JOSE_NOT_SUPPORTED`; - code = `ERR_JOSE_NOT_SUPPORTED`; -}; -var E$12 = class extends C$12 { - static code = `ERR_JWE_DECRYPTION_FAILED`; - code = `ERR_JWE_DECRYPTION_FAILED`; - constructor(e = `decryption operation failed`, t) { - super(e, t); - } -}; -var D$11 = class extends C$12 { - static code = `ERR_JWE_INVALID`; - code = `ERR_JWE_INVALID`; -}; -var O$9 = class extends C$12 { - static code = `ERR_JWS_INVALID`; - code = `ERR_JWS_INVALID`; -}; -var k$10 = class extends C$12 { - static code = `ERR_JWT_INVALID`; - code = `ERR_JWT_INVALID`; -}; -var ae$8 = class extends C$12 { - static code = `ERR_JWK_INVALID`; - code = `ERR_JWK_INVALID`; -}; -var oe$8 = class extends C$12 { - static code = `ERR_JWKS_INVALID`; - code = `ERR_JWKS_INVALID`; -}; -var se$9 = class extends C$12 { - static code = `ERR_JWKS_NO_MATCHING_KEY`; - code = `ERR_JWKS_NO_MATCHING_KEY`; - constructor(e = `no applicable key found in the JSON Web Key Set`, t) { - super(e, t); - } -}; -var ce$9 = class extends C$12 { - [Symbol.asyncIterator]; - static code = `ERR_JWKS_MULTIPLE_MATCHING_KEYS`; - code = `ERR_JWKS_MULTIPLE_MATCHING_KEYS`; - constructor(e = `multiple matching keys found in the JSON Web Key Set`, t) { - super(e, t); - } -}; -var le$9 = class extends C$12 { - static code = `ERR_JWKS_TIMEOUT`; - code = `ERR_JWKS_TIMEOUT`; - constructor(e = `request timed out`, t) { - super(e, t); - } -}; -var ue$9 = class extends C$12 { - static code = `ERR_JWS_SIGNATURE_VERIFICATION_FAILED`; - code = `ERR_JWS_SIGNATURE_VERIFICATION_FAILED`; - constructor(e = `signature verification failed`, t) { - super(e, t); - } -}; -const j$9 = (e) => { - if (e?.[Symbol.toStringTag] === `CryptoKey`) return !0; - try { - return e instanceof CryptoKey; - } catch { - return !1; - } -}; -const de$9 = (e) => e?.[Symbol.toStringTag] === `KeyObject`; -const fe$9 = (e) => j$9(e) || de$9(e); -function P$8(e, t, n) { - try { - return f$10(e); - } catch { - throw new n(`Failed to base64url decode the ${t}`); - } -} -const Ae$8 = (e) => typeof e == `object` && !!e; -function F$8(e) { - if (!Ae$8(e) || Object.prototype.toString.call(e) !== `[object Object]`) return !1; - if (Object.getPrototypeOf(e) === null) return !0; - let t = e; - for (; Object.getPrototypeOf(t) !== null;) t = Object.getPrototypeOf(t); - return Object.getPrototypeOf(e) === t; -} -function I$8(...e) { - let t = e.filter(Boolean); - if (t.length === 0 || t.length === 1) return !0; - let n; - for (let e of t) { - let t = Object.keys(e); - if (!n || n.size === 0) { - n = new Set(t); - continue; - } - for (let e of t) { - if (n.has(e)) return !1; - n.add(e); - } - } - return !0; -} -const L$8 = (e) => F$8(e) && typeof e.kty == `string`; -const je$9 = (e) => e.kty !== `oct` && (e.kty === `AKP` && typeof e.priv == `string` || typeof e.d == `string`); -const Me$8 = (e) => e.kty !== `oct` && e.d === void 0 && e.priv === void 0; -const Ne$9 = (e) => e.kty === `oct` && typeof e.k == `string`; -function R$9(e, t) { - if (e.startsWith(`RS`) || e.startsWith(`PS`)) { - let { modulusLength: n } = t.algorithm; - if (typeof n != `number` || n < 2048) throw TypeError(`${e} requires key modulusLength to be 2048 bits or larger`); - } -} -function Je$9(e, t) { - let n = `SHA-${e.slice(-3)}`; - switch (e) { - case `HS256`: - case `HS384`: - case `HS512`: return { - hash: n, - name: `HMAC` - }; - case `PS256`: - case `PS384`: - case `PS512`: return { - hash: n, - name: `RSA-PSS`, - saltLength: parseInt(e.slice(-3), 10) >> 3 - }; - case `RS256`: - case `RS384`: - case `RS512`: return { - hash: n, - name: `RSASSA-PKCS1-v1_5` - }; - case `ES256`: - case `ES384`: - case `ES512`: return { - hash: n, - name: `ECDSA`, - namedCurve: t.namedCurve - }; - case `Ed25519`: - case `EdDSA`: return { name: `Ed25519` }; - case `ML-DSA-44`: - case `ML-DSA-65`: - case `ML-DSA-87`: return { name: e }; - default: throw new T$12(`alg ${e} is not supported either by JOSE or your javascript runtime`); - } -} -async function Ye$9(e, t, n) { - if (t instanceof Uint8Array) { - if (!e.startsWith(`HS`)) throw TypeError(S$11(t, `CryptoKey`, `KeyObject`, `JSON Web Key`)); - return crypto.subtle.importKey(`raw`, t, { - hash: `SHA-${e.slice(-3)}`, - name: `HMAC` - }, !1, [n]); - } - return ee$6(t, e, n), t; -} -async function Ze$9(e, t, n, r) { - let i = await Ye$9(e, t, `verify`); - R$9(e, i); - let a = Je$9(e, i.algorithm); - try { - return await crypto.subtle.verify(a, i, n, r); - } catch { - return !1; - } -} -const z$9 = `Invalid or unsupported JWK "alg" (Algorithm) Parameter value`; -function tt$9(e) { - let t, n; - switch (e.kty) { - case `AKP`: - switch (e.alg) { - case `ML-DSA-44`: - case `ML-DSA-65`: - case `ML-DSA-87`: - t = { name: e.alg }, n = e.priv ? [`sign`] : [`verify`]; - break; - default: throw new T$12(z$9); - } - break; - case `RSA`: - switch (e.alg) { - case `PS256`: - case `PS384`: - case `PS512`: - t = { - name: `RSA-PSS`, - hash: `SHA-${e.alg.slice(-3)}` - }, n = e.d ? [`sign`] : [`verify`]; - break; - case `RS256`: - case `RS384`: - case `RS512`: - t = { - name: `RSASSA-PKCS1-v1_5`, - hash: `SHA-${e.alg.slice(-3)}` - }, n = e.d ? [`sign`] : [`verify`]; - break; - case `RSA-OAEP`: - case `RSA-OAEP-256`: - case `RSA-OAEP-384`: - case `RSA-OAEP-512`: - t = { - name: `RSA-OAEP`, - hash: `SHA-${parseInt(e.alg.slice(-3), 10) || 1}` - }, n = e.d ? [`decrypt`, `unwrapKey`] : [`encrypt`, `wrapKey`]; - break; - default: throw new T$12(z$9); - } - break; - case `EC`: - switch (e.alg) { - case `ES256`: - case `ES384`: - case `ES512`: - t = { - name: `ECDSA`, - namedCurve: { - ES256: `P-256`, - ES384: `P-384`, - ES512: `P-521` - }[e.alg] - }, n = e.d ? [`sign`] : [`verify`]; - break; - case `ECDH-ES`: - case `ECDH-ES+A128KW`: - case `ECDH-ES+A192KW`: - case `ECDH-ES+A256KW`: - t = { - name: `ECDH`, - namedCurve: e.crv - }, n = e.d ? [`deriveBits`] : []; - break; - default: throw new T$12(z$9); - } - break; - case `OKP`: - switch (e.alg) { - case `Ed25519`: - case `EdDSA`: - t = { name: `Ed25519` }, n = e.d ? [`sign`] : [`verify`]; - break; - case `ECDH-ES`: - case `ECDH-ES+A128KW`: - case `ECDH-ES+A192KW`: - case `ECDH-ES+A256KW`: - t = { name: e.crv }, n = e.d ? [`deriveBits`] : []; - break; - default: throw new T$12(z$9); - } - break; - default: throw new T$12(`Invalid or unsupported JWK "kty" (Key Type) Parameter value`); - } - return { - algorithm: t, - keyUsages: n - }; -} -async function B$10(e) { - if (!e.alg) throw TypeError(`"alg" argument is required when "jwk.alg" is not present`); - let { algorithm: t, keyUsages: n } = tt$9(e), r = { ...e }; - return r.kty !== `AKP` && delete r.alg, delete r.use, crypto.subtle.importKey(`jwk`, r, t, e.ext ?? !(e.d || e.priv), e.key_ops ?? n); -} -const V$9 = `given KeyObject instance cannot be used for this algorithm`; -let H$9; -const nt$9 = async (e, t, n, r = !1) => { - H$9 ||= /* @__PURE__ */ new WeakMap(); - let i = H$9.get(e); - if (i?.[n]) return i[n]; - let a = await B$10({ - ...t, - alg: n - }); - return r && Object.freeze(e), i ? i[n] = a : H$9.set(e, { [n]: a }), a; -}; -const rt$8 = (e, t) => { - H$9 ||= /* @__PURE__ */ new WeakMap(); - let n = H$9.get(e); - if (n?.[t]) return n[t]; - let r = e.type === `public`, i = !!r, a; - if (e.asymmetricKeyType === `x25519`) { - switch (t) { - case `ECDH-ES`: - case `ECDH-ES+A128KW`: - case `ECDH-ES+A192KW`: - case `ECDH-ES+A256KW`: break; - default: throw TypeError(V$9); - } - a = e.toCryptoKey(e.asymmetricKeyType, i, r ? [] : [`deriveBits`]); - } - if (e.asymmetricKeyType === `ed25519`) { - if (t !== `EdDSA` && t !== `Ed25519`) throw TypeError(V$9); - a = e.toCryptoKey(e.asymmetricKeyType, i, [r ? `verify` : `sign`]); - } - switch (e.asymmetricKeyType) { - case `ml-dsa-44`: - case `ml-dsa-65`: - case `ml-dsa-87`: - if (t !== e.asymmetricKeyType.toUpperCase()) throw TypeError(V$9); - a = e.toCryptoKey(e.asymmetricKeyType, i, [r ? `verify` : `sign`]); - } - if (e.asymmetricKeyType === `rsa`) { - let n; - switch (t) { - case `RSA-OAEP`: - n = `SHA-1`; - break; - case `RS256`: - case `PS256`: - case `RSA-OAEP-256`: - n = `SHA-256`; - break; - case `RS384`: - case `PS384`: - case `RSA-OAEP-384`: - n = `SHA-384`; - break; - case `RS512`: - case `PS512`: - case `RSA-OAEP-512`: - n = `SHA-512`; - break; - default: throw TypeError(V$9); - } - if (t.startsWith(`RSA-OAEP`)) return e.toCryptoKey({ - name: `RSA-OAEP`, - hash: n - }, i, r ? [`encrypt`] : [`decrypt`]); - a = e.toCryptoKey({ - name: t.startsWith(`PS`) ? `RSA-PSS` : `RSASSA-PKCS1-v1_5`, - hash: n - }, i, [r ? `verify` : `sign`]); - } - if (e.asymmetricKeyType === `ec`) { - let n = (/* @__PURE__ */ new Map([ - [`prime256v1`, `P-256`], - [`secp384r1`, `P-384`], - [`secp521r1`, `P-521`] - ])).get(e.asymmetricKeyDetails?.namedCurve); - if (!n) throw TypeError(V$9); - let o = { - ES256: `P-256`, - ES384: `P-384`, - ES512: `P-521` - }; - o[t] && n === o[t] && (a = e.toCryptoKey({ - name: `ECDSA`, - namedCurve: n - }, i, [r ? `verify` : `sign`])), t.startsWith(`ECDH-ES`) && (a = e.toCryptoKey({ - name: `ECDH`, - namedCurve: n - }, i, r ? [] : [`deriveBits`])); - } - if (!a) throw TypeError(V$9); - return n ? n[t] = a : H$9.set(e, { [t]: a }), a; -}; -async function U$9(e, t) { - if (e instanceof Uint8Array || j$9(e)) return e; - if (de$9(e)) { - if (e.type === `secret`) return e.export(); - if (`toCryptoKey` in e && typeof e.toCryptoKey == `function`) try { - return rt$8(e, t); - } catch (e) { - if (e instanceof TypeError) throw e; - } - return nt$9(e, e.export({ format: `jwk` }), t); - } - if (L$8(e)) return e.k ? f$10(e.k) : nt$9(e, e, t, !0); - throw Error(`unreachable`); -} -async function Et$8(e, t, n) { - if (!F$8(e)) throw TypeError(`JWK must be an object`); - let r; - switch (t ??= e.alg, r ??= n?.extractable ?? e.ext, e.kty) { - case `oct`: - if (typeof e.k != `string` || !e.k) throw TypeError(`missing "k" (Key Value) Parameter value`); - return f$10(e.k); - case `RSA`: - if (`oth` in e && e.oth !== void 0) throw new T$12(`RSA JWK "oth" (Other Primes Info) Parameter value is not supported`); - return B$10({ - ...e, - alg: t, - ext: r - }); - case `AKP`: - if (typeof e.alg != `string` || !e.alg) throw TypeError(`missing "alg" (Algorithm) Parameter value`); - if (t !== void 0 && t !== e.alg) throw TypeError(`JWK alg and alg option value mismatch`); - return B$10({ - ...e, - ext: r - }); - case `EC`: - case `OKP`: return B$10({ - ...e, - alg: t, - ext: r - }); - default: throw new T$12(`Unsupported "kty" (Key Type) Parameter value`); - } -} -function q$8(e, t, n, r, i) { - if (i.crit !== void 0 && r?.crit === void 0) throw new e(`"crit" (Critical) Header Parameter MUST be integrity protected`); - if (!r || r.crit === void 0) return /* @__PURE__ */ new Set(); - if (!Array.isArray(r.crit) || r.crit.length === 0 || r.crit.some((e) => typeof e != `string` || e.length === 0)) throw new e(`"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present`); - let a; - a = n === void 0 ? t : new Map([...Object.entries(n), ...t.entries()]); - for (let t of r.crit) { - if (!a.has(t)) throw new T$12(`Extension Header Parameter "${t}" is not recognized`); - if (i[t] === void 0) throw new e(`Extension Header Parameter "${t}" is missing`); - if (a.get(t) && r[t] === void 0) throw new e(`Extension Header Parameter "${t}" MUST be integrity protected`); - } - return new Set(r.crit); -} -function It$6(e, t) { - if (t !== void 0 && (!Array.isArray(t) || t.some((e) => typeof e != `string`))) throw TypeError(`"${e}" option must be an array of strings`); - if (t) return new Set(t); -} -const J$8 = (e) => e?.[Symbol.toStringTag]; -const Lt$7 = (e, t, n) => { - if (t.use !== void 0) { - let e; - switch (n) { - case `sign`: - case `verify`: - e = `sig`; - break; - case `encrypt`: - case `decrypt`: - e = `enc`; - break; - } - if (t.use !== e) throw TypeError(`Invalid key for this operation, its "use" must be "${e}" when present`); - } - if (t.alg !== void 0 && t.alg !== e) throw TypeError(`Invalid key for this operation, its "alg" must be "${e}" when present`); - if (Array.isArray(t.key_ops)) { - let r; - switch (!0) { - case n === `sign` || n === `verify`: - case e === `dir`: - case e.includes(`CBC-HS`): - r = n; - break; - case e.startsWith(`PBES2`): - r = `deriveBits`; - break; - case /^A\d{3}(?:GCM)?(?:KW)?$/.test(e): - r = !e.includes(`GCM`) && e.endsWith(`KW`) ? n === `encrypt` ? `wrapKey` : `unwrapKey` : n; - break; - case n === `encrypt` && e.startsWith(`RSA`): - r = `wrapKey`; - break; - case n === `decrypt`: - r = e.startsWith(`RSA`) ? `unwrapKey` : `deriveBits`; - break; - } - if (r && t.key_ops?.includes?.(r) === !1) throw TypeError(`Invalid key for this operation, its "key_ops" must include "${r}" when present`); - } - return !0; -}; -const Rt$6 = (e, t, n) => { - if (!(t instanceof Uint8Array)) { - if (L$8(t)) { - if (Ne$9(t) && Lt$7(e, t, n)) return; - throw TypeError(`JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present`); - } - if (!fe$9(t)) throw TypeError(te$6(e, t, `CryptoKey`, `KeyObject`, `JSON Web Key`, `Uint8Array`)); - if (t.type !== `secret`) throw TypeError(`${J$8(t)} instances for symmetric algorithms must be of type "secret"`); - } -}; -const zt$7 = (e, t, n) => { - if (L$8(t)) switch (n) { - case `decrypt`: - case `sign`: - if (je$9(t) && Lt$7(e, t, n)) return; - throw TypeError(`JSON Web Key for this operation must be a private JWK`); - case `encrypt`: - case `verify`: - if (Me$8(t) && Lt$7(e, t, n)) return; - throw TypeError(`JSON Web Key for this operation must be a public JWK`); - } - if (!fe$9(t)) throw TypeError(te$6(e, t, `CryptoKey`, `KeyObject`, `JSON Web Key`)); - if (t.type === `secret`) throw TypeError(`${J$8(t)} instances for asymmetric algorithms must not be of type "secret"`); - if (t.type === `public`) switch (n) { - case `sign`: throw TypeError(`${J$8(t)} instances for asymmetric algorithm signing must be of type "private"`); - case `decrypt`: throw TypeError(`${J$8(t)} instances for asymmetric algorithm decryption must be of type "private"`); - } - if (t.type === `private`) switch (n) { - case `verify`: throw TypeError(`${J$8(t)} instances for asymmetric algorithm verifying must be of type "public"`); - case `encrypt`: throw TypeError(`${J$8(t)} instances for asymmetric algorithm encryption must be of type "public"`); - } -}; -function Y$11(e, t, n) { - switch (e.substring(0, 2)) { - case `A1`: - case `A2`: - case `di`: - case `HS`: - case `PB`: - Rt$6(e, t, n); - break; - default: zt$7(e, t, n); - } -} -async function Yt$6(e, r, a) { - if (!F$8(e)) throw new O$9(`Flattened JWS must be an object`); - if (e.protected === void 0 && e.header === void 0) throw new O$9(`Flattened JWS must have either of the "protected" or "header" members`); - if (e.protected !== void 0 && typeof e.protected != `string`) throw new O$9(`JWS Protected Header incorrect type`); - if (e.payload === void 0) throw new O$9(`JWS Payload missing`); - if (typeof e.signature != `string`) throw new O$9(`JWS Signature missing or incorrect type`); - if (e.header !== void 0 && !F$8(e.header)) throw new O$9(`JWS Unprotected Header incorrect type`); - let o = {}; - if (e.protected) try { - let t = f$10(e.protected); - o = JSON.parse(n$12.decode(t)); - } catch { - throw new O$9(`JWS Protected Header is invalid`); - } - if (!I$8(o, e.header)) throw new O$9(`JWS Protected and JWS Unprotected Header Parameter names must be disjoint`); - let s = { - ...o, - ...e.header - }, l = q$8(O$9, /* @__PURE__ */ new Map([[`b64`, !0]]), a?.crit, o, s), u = !0; - if (l.has(`b64`) && (u = o.b64, typeof u != `boolean`)) throw new O$9(`The "b64" (base64url-encode payload) Header Parameter must be a boolean`); - let { alg: d } = s; - if (typeof d != `string` || !d) throw new O$9(`JWS "alg" (Algorithm) Header Parameter missing or invalid`); - let p = a && It$6(`algorithms`, a.algorithms); - if (p && !p.has(d)) throw new ie$7(`"alg" (Algorithm) Header Parameter value not allowed`); - if (u) { - if (typeof e.payload != `string`) throw new O$9(`JWS Payload must be a string`); - } else if (typeof e.payload != `string` && !(e.payload instanceof Uint8Array)) throw new O$9(`JWS Payload must be a string or an Uint8Array instance`); - let m = !1; - typeof r == `function` && (r = await r(o, e), m = !0), Y$11(d, r, `verify`); - let h = i$13(e.protected === void 0 ? /* @__PURE__ */ new Uint8Array() : c$11(e.protected), c$11(`.`), typeof e.payload == `string` ? u ? c$11(e.payload) : t$10.encode(e.payload) : e.payload), g = P$8(e.signature, `signature`, O$9), _ = await U$9(r, d); - if (!await Ze$9(d, _, g, h)) throw new ue$9(); - let v; - v = u ? P$8(e.payload, `payload`, O$9) : typeof e.payload == `string` ? t$10.encode(e.payload) : e.payload; - let y = { payload: v }; - return e.protected !== void 0 && (y.protectedHeader = o), e.header !== void 0 && (y.unprotectedHeader = e.header), m ? { - ...y, - key: _ - } : y; -} -async function Xt$6(e, t, r) { - if (e instanceof Uint8Array && (e = n$12.decode(e)), typeof e != `string`) throw new O$9(`Compact JWS must be a string or Uint8Array`); - let { 0: i, 1: a, 2: o, length: s } = e.split(`.`); - if (s !== 3) throw new O$9(`Invalid Compact JWS`); - let c = await Yt$6({ - payload: a, - protected: i, - signature: o - }, t, r), l = { - payload: c.payload, - protectedHeader: c.protectedHeader - }; - return typeof t == `function` ? { - ...l, - key: c.key - } : l; -} -const X$11 = (e) => Math.floor(e.getTime() / 1e3); -const Qt$6 = /^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i; -function Z$10(e) { - let t = Qt$6.exec(e); - if (!t || t[4] && t[1]) throw TypeError(`Invalid time period format`); - let n = parseFloat(t[2]), r = t[3].toLowerCase(), i; - switch (r) { - case `sec`: - case `secs`: - case `second`: - case `seconds`: - case `s`: - i = Math.round(n); - break; - case `minute`: - case `minutes`: - case `min`: - case `mins`: - case `m`: - i = Math.round(n * 60); - break; - case `hour`: - case `hours`: - case `hr`: - case `hrs`: - case `h`: - i = Math.round(n * 3600); - break; - case `day`: - case `days`: - case `d`: - i = Math.round(n * 86400); - break; - case `week`: - case `weeks`: - case `w`: - i = Math.round(n * 604800); - break; - default: - i = Math.round(n * 31557600); - break; - } - return t[1] === `-` || t[4] === `ago` ? -i : i; -} -const $t$6 = (e) => e.includes(`/`) ? e.toLowerCase() : `application/${e.toLowerCase()}`; -const en$6 = (e, t) => typeof e == `string` ? t.includes(e) : Array.isArray(e) ? t.some(Set.prototype.has.bind(new Set(e))) : !1; -function tn$6(e, t, r = {}) { - let i; - try { - i = JSON.parse(n$12.decode(t)); - } catch {} - if (!F$8(i)) throw new k$10(`JWT Claims Set must be a top-level JSON object`); - let { typ: a } = r; - if (a && (typeof e.typ != `string` || $t$6(e.typ) !== $t$6(a))) throw new w$12(`unexpected "typ" JWT header value`, i, `typ`, `check_failed`); - let { requiredClaims: o = [], issuer: s, subject: c, audience: l, maxTokenAge: u } = r, d = [...o]; - u !== void 0 && d.push(`iat`), l !== void 0 && d.push(`aud`), c !== void 0 && d.push(`sub`), s !== void 0 && d.push(`iss`); - for (let e of new Set(d.reverse())) if (!(e in i)) throw new w$12(`missing required "${e}" claim`, i, e, `missing`); - if (s && !(Array.isArray(s) ? s : [s]).includes(i.iss)) throw new w$12(`unexpected "iss" claim value`, i, `iss`, `check_failed`); - if (c && i.sub !== c) throw new w$12(`unexpected "sub" claim value`, i, `sub`, `check_failed`); - if (l && !en$6(i.aud, typeof l == `string` ? [l] : l)) throw new w$12(`unexpected "aud" claim value`, i, `aud`, `check_failed`); - let f; - switch (typeof r.clockTolerance) { - case `string`: - f = Z$10(r.clockTolerance); - break; - case `number`: - f = r.clockTolerance; - break; - case `undefined`: - f = 0; - break; - default: throw TypeError(`Invalid clockTolerance option type`); - } - let { currentDate: p } = r, m = X$11(p || /* @__PURE__ */ new Date()); - if ((i.iat !== void 0 || u) && typeof i.iat != `number`) throw new w$12(`"iat" claim must be a number`, i, `iat`, `invalid`); - if (i.nbf !== void 0) { - if (typeof i.nbf != `number`) throw new w$12(`"nbf" claim must be a number`, i, `nbf`, `invalid`); - if (i.nbf > m + f) throw new w$12(`"nbf" claim timestamp check failed`, i, `nbf`, `check_failed`); - } - if (i.exp !== void 0) { - if (typeof i.exp != `number`) throw new w$12(`"exp" claim must be a number`, i, `exp`, `invalid`); - if (i.exp <= m - f) throw new re$7(`"exp" claim timestamp check failed`, i, `exp`, `check_failed`); - } - if (u) { - let e = m - i.iat, t = typeof u == `number` ? u : Z$10(u); - if (e - f > t) throw new re$7(`"iat" claim timestamp check failed (too far in the past)`, i, `iat`, `check_failed`); - if (e < 0 - f) throw new w$12(`"iat" claim timestamp check failed (it should be in the past)`, i, `iat`, `check_failed`); - } - return i; -} -async function rn$6(e, t, n) { - let r = await Xt$6(e, t, n); - if (r.protectedHeader.crit?.includes(`b64`) && r.protectedHeader.b64 === !1) throw new k$10(`JWTs MUST NOT use unencoded payload`); - let i = { - payload: tn$6(r.protectedHeader, r.payload, n), - protectedHeader: r.protectedHeader - }; - return typeof t == `function` ? { - ...i, - key: r.key - } : i; -} -function gn$6(e) { - switch (typeof e == `string` && e.slice(0, 2)) { - case `RS`: - case `PS`: return `RSA`; - case `ES`: return `EC`; - case `Ed`: return `OKP`; - case `ML`: return `AKP`; - default: throw new T$12(`Unsupported "alg" value for a JSON Web Key Set`); - } -} -function _n$6(e) { - return e && typeof e == `object` && Array.isArray(e.keys) && e.keys.every(vn$6); -} -function vn$6(e) { - return F$8(e); -} -var yn$6 = class { - #e; - #t = /* @__PURE__ */ new WeakMap(); - constructor(e) { - if (!_n$6(e)) throw new oe$8(`JSON Web Key Set malformed`); - this.#e = structuredClone(e); - } - jwks() { - return this.#e; - } - async getKey(e, t) { - let { alg: n, kid: r } = { - ...e, - ...t?.header - }, i = gn$6(n), a = this.#e.keys.filter((e) => { - let t = i === e.kty; - if (t && typeof r == `string` && (t = r === e.kid), t && (typeof e.alg == `string` || i === `AKP`) && (t = n === e.alg), t && typeof e.use == `string` && (t = e.use === `sig`), t && Array.isArray(e.key_ops) && (t = e.key_ops.includes(`verify`)), t) switch (n) { - case `ES256`: - t = e.crv === `P-256`; - break; - case `ES384`: - t = e.crv === `P-384`; - break; - case `ES512`: - t = e.crv === `P-521`; - break; - case `Ed25519`: - case `EdDSA`: - t = e.crv === `Ed25519`; - break; - } - return t; - }), { 0: o, length: s } = a; - if (s === 0) throw new se$9(); - if (s !== 1) { - let e = new ce$9(), t = this.#t; - throw e[Symbol.asyncIterator] = async function* () { - for (let e of a) try { - yield await bn$6(t, e, n); - } catch {} - }, e; - } - return bn$6(this.#t, o, n); - } -}; -async function bn$6(e, t, n) { - let r = e.get(t) || e.set(t, {}).get(t); - if (r[n] === void 0) { - let e = await Et$8({ - ...t, - ext: !0 - }, n); - if (e instanceof Uint8Array || e.type !== `public`) throw new oe$8(`JSON Web Key Set members must be public keys`); - r[n] = e; - } - return r[n]; -} -function xn$5(e) { - let t = new yn$6(e), n = async (e, n) => t.getKey(e, n); - return Object.defineProperties(n, { jwks: { - value: () => structuredClone(t.jwks()), - enumerable: !1, - configurable: !1, - writable: !1 - } }), n; -} -function Sn$5() { - return typeof WebSocketPair < `u` || typeof navigator < `u` && navigator.userAgent === `Cloudflare-Workers` || typeof EdgeRuntime < `u` && EdgeRuntime === `vercel`; -} -let Cn$5; -(typeof navigator > `u` || !navigator.userAgent?.startsWith?.(`Mozilla/5.0 `)) && (Cn$5 = `jose/v6.2.3`); -const wn$5 = Symbol(); -async function Tn$5(e, t, n, r = fetch) { - let i = await r(e, { - method: `GET`, - signal: n, - redirect: `manual`, - headers: t - }).catch((e) => { - throw e.name === `TimeoutError` ? new le$9() : e; - }); - if (i.status !== 200) throw new C$12(`Expected 200 OK from the JSON Web Key Set HTTP response`); - try { - return await i.json(); - } catch { - throw new C$12(`Failed to parse the JSON Web Key Set HTTP response as JSON`); - } -} -const En$5 = Symbol(); -function Dn$5(e, t) { - return !(typeof e != `object` || !e || !(`uat` in e) || typeof e.uat != `number` || Date.now() - e.uat >= t || !(`jwks` in e) || !F$8(e.jwks) || !Array.isArray(e.jwks.keys) || !Array.prototype.every.call(e.jwks.keys, F$8)); -} -var On$5 = class { - #e; - #t; - #n; - #r; - #i; - #a; - #o; - #s; - #c; - #l; - constructor(e, t) { - if (!(e instanceof URL)) throw TypeError(`url must be an instance of URL`); - this.#e = new URL(e.href), this.#t = typeof t?.timeoutDuration == `number` ? t?.timeoutDuration : 5e3, this.#n = typeof t?.cooldownDuration == `number` ? t?.cooldownDuration : 3e4, this.#r = typeof t?.cacheMaxAge == `number` ? t?.cacheMaxAge : 6e5, this.#o = new Headers(t?.headers), Cn$5 && !this.#o.has(`User-Agent`) && this.#o.set(`User-Agent`, Cn$5), this.#o.has(`accept`) || (this.#o.set(`accept`, `application/json`), this.#o.append(`accept`, `application/jwk-set+json`)), this.#s = t?.[wn$5], t?.[En$5] !== void 0 && (this.#l = t?.[En$5], Dn$5(t?.[En$5], this.#r) && (this.#i = this.#l.uat, this.#c = xn$5(this.#l.jwks))); - } - pendingFetch() { - return !!this.#a; - } - coolingDown() { - return typeof this.#i == `number` ? Date.now() < this.#i + this.#n : !1; - } - fresh() { - return typeof this.#i == `number` ? Date.now() < this.#i + this.#r : !1; - } - jwks() { - return this.#c?.jwks(); - } - async getKey(e, t) { - (!this.#c || !this.fresh()) && await this.reload(); - try { - return await this.#c(e, t); - } catch (n) { - if (n instanceof se$9 && this.coolingDown() === !1) return await this.reload(), this.#c(e, t); - throw n; - } - } - async reload() { - this.#a && Sn$5() && (this.#a = void 0), this.#a ||= Tn$5(this.#e.href, this.#o, AbortSignal.timeout(this.#t), this.#s).then((e) => { - this.#c = xn$5(e), this.#l && (this.#l.uat = Date.now(), this.#l.jwks = e), this.#i = Date.now(), this.#a = void 0; - }).catch((e) => { - throw this.#a = void 0, e; - }), await this.#a; - } -}; -function kn$5(e, t) { - let n = new On$5(e, t), r = async (e, t) => n.getKey(e, t); - return Object.defineProperties(r, { - coolingDown: { - get: () => n.coolingDown(), - enumerable: !0, - configurable: !1 - }, - fresh: { - get: () => n.fresh(), - enumerable: !0, - configurable: !1 - }, - reload: { - value: () => n.reload(), - enumerable: !0, - configurable: !1, - writable: !1 - }, - reloading: { - get: () => n.pendingFetch(), - enumerable: !0, - configurable: !1 - }, - jwks: { - value: () => n.jwks(), - enumerable: !0, - configurable: !1, - writable: !1 - } - }), r; -} -function Mn$5(e) { - if (typeof e != `string`) throw new k$10(`JWTs must use Compact JWS serialization, JWT must be a string`); - let { 1: t, length: r } = e.split(`.`); - if (r === 5) throw new k$10(`Only JWTs using Compact JWS serialization can be decoded`); - if (r !== 3) throw new k$10(`Invalid JWT`); - if (!t) throw new k$10(`JWTs must contain a payload`); - let i; - try { - i = f$10(t); - } catch { - throw new k$10(`Failed to base64url decode the payload`); - } - let a; - try { - a = JSON.parse(n$12.decode(i)); - } catch { - throw new k$10(`Failed to parse the decoded payload as JSON`); - } - if (!F$8(a)) throw new k$10(`Invalid JWT Claims Set`); - return a; -} -//#endregion -//#region node_modules/eve/dist/src/runtime/governance/auth/token-claims.js -const STANDARD_PROJECTED_CLAIM_KEYS = /* @__PURE__ */ new Set([ - `aud`, - `exp`, - `iat`, - `iss`, - `jti`, - `nbf`, - `sub` -]); -function normalizeJwtClaims(e) { - let t = {}; - for (let [n, r] of Object.entries(e)) { - if (typeof r == `string`) { - t[n] = r; - continue; - } - Array.isArray(r) && r.every((e) => typeof e == `string`) && (t[n] = Object.freeze([...r])); - } - return Object.freeze(t); -} -function createJwtAttributeProjection(t) { - let n = normalizeJwtClaims(t); - return Object.freeze(Object.fromEntries(Object.entries(n).filter(([t]) => !STANDARD_PROJECTED_CLAIM_KEYS.has(t)))); -} -function areTokenClaimMatchersSatisfied(e, t) { - let n = normalizeJwtClaims(e); - if (t.subjects !== void 0) { - let n = typeof e.sub == `string` ? e.sub : null; - if (n === null || !t.subjects.some((e) => matchesWildcardPattern(e, n))) return !1; - } - return t.claims === void 0 ? !0 : Object.entries(t.claims).every(([e, t]) => { - let r = n[e]; - return r === void 0 ? !1 : typeof r == `string` ? t.includes(r) : r.some((e) => t.includes(e)); - }); -} -function createJwtAuthenticatedCallerPrincipal(e) { - let t = readFirstStringClaim(e.payload, [...e.issuerClaims ?? [], `iss`]), n = e.subjectClaim ?? `sub`, r = readFirstStringClaim(e.payload, [n]); - if (t === void 0 || r === void 0) throw Error(`Expected verified JWT payloads to include string iss and ${n} claims.`); - let i = normalizeJwtClaims(e.payload); - return { - attributes: createJwtAttributeProjection(e.payload), - authenticator: e.authenticator, - claims: i, - issuer: t, - principalId: `${t}:${r}`, - principalType: e.principalType, - subject: r - }; -} -function readFirstStringClaim(e, t) { - for (let n of t) { - let t = e[n]; - if (typeof t == `string` && t.length > 0) return t; - } -} -function matchesWildcardPattern(e, t) { - if (!e.includes(`*`)) return e === t; - let n = e.replaceAll(/[.+?^${}()|[\]\\]/g, `\\$&`).replaceAll(`*`, `.*`); - return RegExp(`^${n}$`).test(t); -} -//#endregion -//#region node_modules/eve/dist/src/runtime/governance/auth/oidc.js -const oidcDiscoveryDocumentSchema = Ls$3.object({ - issuer: Ls$3.string().optional(), - jwks_uri: Ls$3.string().url() -}).passthrough(); -const oidcDiscoveryDocumentCache = /* @__PURE__ */ new Map(); -const oidcJwksCache = /* @__PURE__ */ new Map(); -async function authenticateOidcStrategy(e) { - let t; - try { - t = await getOidcRemoteJwks(e.strategy); - } catch (e) { - return { - kind: `misconfigured`, - message: `Failed to load OIDC discovery metadata. ${e instanceof Error ? e.message : `Unknown discovery failure.`}` - }; - } - try { - let a = await rn$6(e.token, t, { - audience: [...e.strategy.audiences], - clockTolerance: e.strategy.clockSkewSeconds, - issuer: e.strategy.issuer - }); - if (e.strategy.acceptCurrentVercelProject && e.strategy.issuer.startsWith(`https://oidc.vercel.com/`) && a.payload.external_sub !== void 0) return typeof a.payload.external_sub != `string` || a.payload.external_sub.length === 0 || !currentVercelProjectMatches({ - payload: a.payload, - strategy: e.strategy - }) || !currentVercelEnvironmentMatches({ - payload: a.payload, - strategy: e.strategy - }) ? { kind: `caller-not-allowed` } : { - kind: `authenticated`, - principal: createJwtAuthenticatedCallerPrincipal({ - authenticator: `oidc`, - issuerClaims: [`external_iss`, `connector_id`], - payload: a.payload, - principalType: `user`, - subjectClaim: `external_sub` - }) - }; - if (e.strategy.acceptCurrentVercelProject && e.strategy.issuer.startsWith(`https://oidc.vercel.com/`) && a.payload.user_id !== void 0) { - if (typeof a.payload.user_id != `string` || a.payload.user_id.length === 0 || a.payload.environment !== `development` || !currentVercelProjectMatches({ - payload: a.payload, - strategy: e.strategy - })) return { kind: `caller-not-allowed` }; - if (currentVercelEnvironmentMatches({ - payload: a.payload, - strategy: e.strategy - })) return { - kind: `authenticated`, - principal: createJwtAuthenticatedCallerPrincipal({ - authenticator: `oidc`, - payload: a.payload, - principalType: `user`, - subjectClaim: `user_id` - }) - }; - if (e.strategy.currentVercelProject?.environment !== `preview`) return { kind: `caller-not-allowed` }; - } - if (typeof a.payload.sub != `string` || a.payload.sub.length === 0) return { kind: `not-authenticated` }; - let o = e.strategy.acceptCurrentVercelProject && isCurrentVercelProjectToken({ - issuer: e.strategy.issuer, - payload: a.payload, - strategy: e.strategy - }), s = o && isCurrentVercelEnvironmentToken({ - payload: a.payload, - strategy: e.strategy - }); - return !o && !areTokenClaimMatchersSatisfied(a.payload, e.strategy) ? { kind: `caller-not-allowed` } : { - kind: `authenticated`, - principal: createJwtAuthenticatedCallerPrincipal({ - authenticator: `oidc`, - payload: a.payload, - principalType: s ? `runtime` : `service` - }) - }; - } catch { - return { kind: `not-authenticated` }; - } -} -async function getOidcRemoteJwks(e) { - let n = await getOidcDiscoveryDocument(e.discoveryUrl), r = oidcJwksCache.get(n.jwks_uri); - if (r !== void 0) return r; - let i = kn$5(new URL(n.jwks_uri)); - return oidcJwksCache.set(n.jwks_uri, i), i; -} -async function getOidcDiscoveryDocument(e) { - let t = oidcDiscoveryDocumentCache.get(e); - if (t !== void 0) return await t; - let n = fetch(e, { headers: { accept: `application/json` } }).then(async (e) => { - if (!e.ok) throw Error(`Discovery route returned HTTP ${e.status}.`); - return oidcDiscoveryDocumentSchema.parse(await e.json()); - }).catch((t) => { - throw oidcDiscoveryDocumentCache.delete(e), t; - }); - return oidcDiscoveryDocumentCache.set(e, n), await n; -} -function isCurrentVercelProjectToken(e) { - if (!e.issuer.startsWith(`https://oidc.vercel.com`)) return !1; - let t = e.strategy.currentVercelProject; - return t === void 0 ? !1 : typeof e.payload.project_id == `string` && e.payload.project_id === t.projectId; -} -function currentVercelProjectMatches(e) { - let t = e.strategy.currentVercelProject; - return t === void 0 ? !1 : typeof e.payload.project_id == `string` && e.payload.project_id === t.projectId; -} -function isCurrentVercelEnvironmentToken(e) { - let t = e.strategy.currentVercelProject?.environment; - return t === void 0 || t.length === 0 ? !1 : typeof e.payload.environment == `string` && e.payload.environment === t; -} -function currentVercelEnvironmentMatches(e) { - let t = e.strategy.currentVercelProject?.environment; - return t === void 0 || t.length === 0 ? !1 : typeof e.payload.environment == `string` && e.payload.environment === t; -} -//#endregion -//#region node_modules/eve/dist/src/runtime/governance/auth/types.js -function createRuntimeSessionAuthContext(e) { - return { - attributes: e.attributes, - authenticator: e.authenticator, - issuer: e.issuer, - principalId: e.principalId, - principalType: e.principalType, - subject: e.subject - }; -} -//#endregion -//#region node_modules/eve/dist/src/public/channels/auth.js -const vercelOidcLog = createLogger(`auth.vercel-oidc`); -async function runOidcVerification(e, t) { - if (e === null || e.length === 0) return { kind: `not-authenticated` }; - let n = { - acceptCurrentVercelProject: t.acceptCurrentVercelProject, - audiences: [...t.audiences], - clockSkewSeconds: t.clockSkewSeconds ?? 30, - discoveryUrl: t.discoveryUrl ?? `${t.issuer.replace(/\/$/, ``)}/.well-known/openid-configuration`, - issuer: t.issuer, - kind: `oidc`, - ...t.claims === void 0 ? {} : { claims: t.claims }, - ...t.subjects === void 0 ? {} : { subjects: t.subjects } - }; - return await authenticateOidcStrategy({ - strategy: t.currentVercelProject === void 0 ? n : { - ...n, - currentVercelProject: t.currentVercelProject - }, - token: e - }); -} -function extractBearerToken$1(e) { - if (e === null) return null; - let t = /^Bearer\s+(.+)$/i.exec(e)?.[1]?.trim(); - return t === void 0 || t.length === 0 ? null : t; -} -function createUnauthorizedResponse(e = {}) { - let t = e.status ?? 401, n = e.code ?? (t === 403 ? `forbidden` : `unauthorized`), r = e.message ?? (t === 403 ? `Forbidden.` : `Authorization is required for this route.`), i = e.challenges ?? [], a = new Headers({ "cache-control": `no-store` }); - for (let e of i) a.append(`www-authenticate`, formatChallenge(e)); - return Response.json({ - code: n, - error: r, - ok: !1 - }, { - headers: a, - status: t - }); -} -function formatChallenge(e) { - if (e.parameters === void 0 || Object.keys(e.parameters).length === 0) return e.scheme; - let t = Object.entries(e.parameters).map(([e, t]) => `${e}="${escapeChallengeValue(t)}"`).join(`, `); - return `${e.scheme} ${t}`; -} -function escapeChallengeValue(e) { - return e.replaceAll(`\\`, `\\\\`).replaceAll(`"`, `\\"`); -} -async function routeAuth(e, t) { - let n = Array.isArray(t) ? t : [t]; - try { - for (let t of n) { - let n = await t(e); - if (n) return n; - } - } catch (e) { - if (typeof e == `object` && e && `response` in e && e.response instanceof Response) return e.response; - throw e; - } - return createUnauthorizedResponse({ challenges: [{ scheme: `Bearer` }] }); -} -function localDev() { - return (e) => process.env.VERCEL && process.env.VERCEL_ENV === `development` || isLoopbackRequest(e) ? LOCAL_DEV_SESSION_AUTH_CONTEXT : null; -} -const LOOPBACK_HOSTNAMES = /* @__PURE__ */ new Set([`localhost`, `[::1]`]); -const LOOPBACK_IPV4_PREFIX = /^127\./; -function isLoopbackRequest(e) { - let t; - try { - t = new URL(e.url).hostname; - } catch { - return !1; - } - return !!(LOOPBACK_HOSTNAMES.has(t) || LOOPBACK_IPV4_PREFIX.test(t) || t.endsWith(`.localhost`)); -} -const LOCAL_DEV_SESSION_AUTH_CONTEXT = { - attributes: {}, - authenticator: `local-dev`, - principalId: `local-dev`, - principalType: `local-dev` -}; -async function verifyVercelOidc(e, t = {}) { - if (e === null || e.length === 0) return { ok: !1 }; - let n = decodeUnverifiedJwtClaims(e); - if (n === null) return vercelOidcLog.debug(`Rejected token that failed to decode as a JWT.`), { ok: !1 }; - if (!n.issuer.startsWith(`https://oidc.vercel.com/`)) return vercelOidcLog.debug(`Rejected token whose issuer is not a Vercel OIDC issuer.`, { issuer: n.issuer }), { ok: !1 }; - if (n.audiences.length === 0) return vercelOidcLog.debug(`Rejected token with no audience claim.`, { issuer: n.issuer }), { ok: !1 }; - if (!n.audiences.some((e) => e.startsWith(`https://vercel.com/`))) return vercelOidcLog.debug(`Rejected token whose audience is not a Vercel audience.`, { - audiences: n.audiences, - issuer: n.issuer - }), { ok: !1 }; - let r = resolveCurrentVercelProject(t), i = await runOidcVerification(e, { - acceptCurrentVercelProject: !0, - audiences: n.audiences, - currentVercelProject: r, - issuer: n.issuer, - subjects: t.subjects ?? [] - }); - return i.kind === `authenticated` ? (vercelOidcLog.debug(`Accepted Vercel OIDC token.`, { - issuer: n.issuer, - principalType: i.principal.principalType, - subject: i.principal.subject - }), { - ok: !0, - sessionAuth: createRuntimeSessionAuthContext(i.principal) - }) : (vercelOidcLog.debug(`Rejected Vercel OIDC token after verification.`, { - audiences: n.audiences, - issuer: n.issuer, - reason: i.kind, - subjectsConfigured: (t.subjects ?? []).length > 0, - ...i.kind === `misconfigured` ? { detail: i.message } : {} - }), { ok: !1 }); -} -function resolveCurrentVercelProject(e) { - if (e.currentVercelProject !== void 0) return e.currentVercelProject; - let t = process.env.VERCEL_PROJECT_ID?.trim(); - if (t === void 0 || t.length === 0) return; - let n = process.env.VERCEL_TARGET_ENV?.trim() || process.env.VERCEL_ENV?.trim(); - return n === void 0 || n.length === 0 ? { projectId: t } : { - environment: n, - projectId: t - }; -} -function vercelOidc(e = {}) { - return async (n) => { - let r = extractBearerToken$1(n.headers.get(`authorization`)), i = e.currentVercelProject ?? (r !== null && isLocalDevelopmentVercelOidcRequest(n) ? await resolveVercelOidcCurrentProject(n) : void 0), a = await verifyVercelOidc(r, i === void 0 ? e : { - ...e, - currentVercelProject: i - }); - return a.ok ? a.sessionAuth : null; - }; -} -function isLocalDevelopmentVercelOidcRequest(e) { - return process.env.VERCEL_ENV === `development` ? !0 : process.env.VERCEL_ENV === `preview` || process.env.VERCEL_ENV === `production` ? !1 : isLoopbackRequest(e); -} -function decodeUnverifiedJwtClaims(e) { - let t; - try { - t = Mn$5(e); - } catch { - return null; - } - return typeof t.iss != `string` || t.iss.length === 0 ? null : { - audiences: typeof t.aud == `string` ? [t.aud] : Array.isArray(t.aud) ? t.aud.filter((e) => typeof e == `string`) : [], - issuer: t.iss - }; -} -//#endregion -//#region node_modules/eve/dist/src/channel/routes.js -function GET(e, t) { - return { - transport: `http`, - method: `GET`, - path: e, - handler: t - }; -} -function POST$1(e, t) { - return { - transport: `http`, - method: `POST`, - path: e, - handler: t - }; -} -function isHttpRouteDefinition(e) { - return e.transport !== `websocket`; -} -function isWebSocketRouteDefinition(e) { - return e.transport === `websocket`; -} -//#endregion -//#region node_modules/eve/dist/src/internal/attachments/sandbox-refs.js -const SANDBOX_URL_SCHEME = `eve-sandbox:`; -const PATH_QUERY_KEY = `path`; -const SIZE_QUERY_KEY = `size`; -const TYPE_QUERY_KEY = `type`; -function isValidSize$1(e) { - return Number.isFinite(e) && Number.isInteger(e) && e >= 0; -} -function encodeSandboxRef(t) { - if (typeof t.path != `string` || t.path.length === 0) throw RangeError(`SandboxRef.path must be a non-empty string.`); - if (!isValidSize$1(t.size)) throw RangeError(`SandboxRef.size must be a non-negative integer. Received: ${String(t.size)}.`); - if (typeof t.mediaType != `string` || t.mediaType.length === 0) throw RangeError(`SandboxRef.mediaType must be a non-empty string.`); - let n = new URL(SANDBOX_URL_SCHEME); - return n.searchParams.set(PATH_QUERY_KEY, t.path), n.searchParams.set(SIZE_QUERY_KEY, String(t.size)), n.searchParams.set(TYPE_QUERY_KEY, t.mediaType), n; -} -function decodeSandboxRef(t) { - let n = t instanceof URL ? t : new URL(t); - if (n.protocol !== `eve-sandbox:`) throw Error(`SandboxRef URL must use scheme "${SANDBOX_URL_SCHEME}". Got: "${n.protocol}".`); - let r = n.searchParams.get(PATH_QUERY_KEY); - if (r === null || r === ``) throw Error(`SandboxRef URL is missing the required "path" query param.`); - let i = n.searchParams.get(SIZE_QUERY_KEY); - if (i === null || i === ``) throw Error(`SandboxRef URL is missing the required "size" query param.`); - let a = Number(i); - if (!isValidSize$1(a)) throw Error(`SandboxRef URL "size" must be a non-negative integer. Got: ${JSON.stringify(i)}.`); - let o = n.searchParams.get(TYPE_QUERY_KEY); - if (o === null || o === ``) throw Error(`SandboxRef URL is missing the required "type" query param.`); - return { - mediaType: o, - path: r, - size: a - }; -} -function isSandboxRefUrl(e) { - return e instanceof URL && e.protocol === `eve-sandbox:`; -} -//#endregion -//#region node_modules/eve/dist/src/shared/errors.js -function toErrorMessage(t) { - return t instanceof Error ? t.message : typeof t == `string` ? t : t == null ? String(t) : isObject(t) ? typeof t.message == `string` && t.message.length > 0 ? t.message : safeJsonStringify(t) : String(t); -} -function toError(t) { - if (t instanceof Error) return t; - let n = Error(toErrorMessage(t)); - return isObject(t) ? (typeof t.name == `string` && t.name.length > 0 && (n.name = t.name), typeof t.stack == `string` && t.stack.length > 0 && (n.stack = t.stack), `cause` in t && t.cause !== void 0 && t.cause !== t && (n.cause = t.cause), n) : n; -} -function safeJsonStringify(e) { - try { - return JSON.stringify(e) ?? String(e); - } catch { - return String(e); - } -} -//#endregion -//#region node_modules/eve/dist/src/internal/attachments/refs.js -const ATTACHMENT_REF_SCHEME = `eve-attachment:`; -function isValidSize(e) { - return Number.isFinite(e) && Number.isInteger(e) && e >= 0; -} -function parseAttachmentRef(n) { - if (n.protocol !== `eve-attachment:`) throw Error(`AttachmentRef URL must use scheme "${ATTACHMENT_REF_SCHEME}". Got: "${n.protocol}".`); - let r = n.searchParams.get(`v`); - if (r !== `1`) throw Error(`AttachmentRef wire format version must be "1". Got: ${r === null ? `missing` : JSON.stringify(r)}.`); - let i = n.searchParams.get(`p`); - if (i === null || i === ``) throw Error(`AttachmentRef URL is missing the required "p" payload query param.`); - let a; - try { - let e = Buffer.from(i, `base64url`).toString(`utf8`); - a = JSON.parse(e); - } catch (t) { - throw Error(`AttachmentRef payload is not valid base64url-encoded JSON: ${toErrorMessage(t)}`); - } - if (typeof a != `object` || !a || Array.isArray(a)) throw Error(`AttachmentRef payload must decode to a JSON object.`); - let o = a; - if (!(`params` in o)) throw Error(`AttachmentRef payload is missing the required "params" field.`); - let s = o.params; - if (!(`size` in o)) return { params: s }; - let c = o.size; - if (typeof c != `number` || !isValidSize(c)) throw Error(`AttachmentRef payload "size" must be a non-negative integer. Got: ${JSON.stringify(c)}.`); - return { - params: s, - size: c - }; -} -function isAttachmentRefUrl(e) { - return e instanceof URL && e.protocol === `eve-attachment:`; -} -//#endregion -//#region node_modules/eve/dist/src/internal/attachments/url-refs.js -const EVE_URL_SCHEME = `eve-url:`; -function serializeUrlFilePart(e) { - return `${EVE_URL_SCHEME}${e.href}`; -} -function isSerializedUrlFilePart(e) { - return typeof e == `string` && e.startsWith(EVE_URL_SCHEME); -} -function deserializeUrlFilePart(e) { - return new URL(e.slice(8)); -} -const INTERNAL_REF_SCHEMES = [ - EVE_URL_SCHEME, - SANDBOX_URL_SCHEME, - ATTACHMENT_REF_SCHEME -]; -function hasInternalRefScheme(e) { - return INTERNAL_REF_SCHEMES.some((t) => e.startsWith(t)); -} -//#endregion -//#region node_modules/eve/dist/src/protocol/message.js -const EVE_SESSION_ID_HEADER = `x-eve-session-id`; -const EVE_STREAM_FORMAT_HEADER = `x-eve-stream-format`; -const EVE_STREAM_VERSION_HEADER = `x-eve-stream-version`; -const EVE_MESSAGE_STREAM_CONTENT_TYPE = `application/x-ndjson; charset=utf-8`; -const EVE_MESSAGE_STREAM_FORMAT = `ndjson`; -const EVE_MESSAGE_STREAM_VERSION = `16`; -const textEncoder = new TextEncoder(); -function createSessionStartedEvent(e) { - let t = {}; - return e?.invocation !== void 0 && (t.invocation = e.invocation), e?.runtime !== void 0 && (t.runtime = e.runtime), { - data: t, - type: `session.started` - }; -} -function createTurnStartedEvent(e) { - return { - data: { - sequence: e.sequence, - turnId: e.turnId - }, - type: `turn.started` - }; -} -function createMessageReceivedEvent(e) { - return { - data: { - message: summarizeUserContent(e.message), - sequence: e.sequence, - turnId: e.turnId - }, - type: `message.received` - }; -} -function summarizeUserContent(e) { - if (typeof e == `string`) return e; - let t = []; - for (let n of e) if (n.type === `text`) t.push(n.text); - else if (n.type === `file`) { - let e = n.filename ?? n.mediaType; - t.push(`[file: ${e} (${n.mediaType})]`); - } else n.type === `image` && t.push(`[image: ${n.mediaType ?? `image`}]`); - return t.join(` -`); -} -function createActionsRequestedEvent(e) { - return { - data: { - actions: e.actions, - sequence: e.sequence, - stepIndex: e.stepIndex, - turnId: e.turnId - }, - type: `actions.requested` - }; -} -function createAuthorizationRequiredEvent(e) { - let t = { - description: e.description, - name: e.name, - sequence: e.sequence, - stepIndex: e.stepIndex, - turnId: e.turnId - }; - return e.authorization !== void 0 && (t.authorization = e.authorization), e.webhookUrl !== void 0 && (t.webhookUrl = e.webhookUrl), { - data: t, - type: `authorization.required` - }; -} -function createAuthorizationCompletedEvent(e) { - let t = { - name: e.name, - outcome: e.outcome, - sequence: e.sequence, - stepIndex: e.stepIndex, - turnId: e.turnId - }; - return e.authorization !== void 0 && (t.authorization = e.authorization), e.reason !== void 0 && (t.reason = e.reason), { - data: t, - type: `authorization.completed` - }; -} -function createInputRequestedEvent(e) { - return { - data: { - requests: e.requests, - sequence: e.sequence, - stepIndex: e.stepIndex, - turnId: e.turnId - }, - type: `input.requested` - }; -} -function createActionResultEvent(e) { - let t = e.rejected === !0 ? { - error: buildActionResultError(e.result), - status: `rejected` - } : normalizeActionResultOutcome(e.result); - return { - data: { - error: t.error, - result: e.result, - sequence: e.sequence, - stepIndex: e.stepIndex, - status: t.status, - turnId: e.turnId - }, - type: `action.result` - }; -} -function createSubagentCalledEvent(e) { - return { - data: { - callId: e.callId, - childSessionId: e.childSessionId, - sessionId: e.sessionId, - sequence: e.sequence, - name: e.name, - remote: e.remote, - toolName: e.toolName, - turnId: e.turnId, - workflowId: e.workflowId - }, - type: `subagent.called` - }; -} -function createMessageAppendedEvent(e) { - return { - data: { - messageDelta: e.messageDelta, - messageSoFar: e.messageSoFar, - sequence: e.sequence, - stepIndex: e.stepIndex, - turnId: e.turnId - }, - type: `message.appended` - }; -} -function createReasoningAppendedEvent(e) { - return { - data: { - reasoningDelta: e.reasoningDelta, - reasoningSoFar: e.reasoningSoFar, - sequence: e.sequence, - stepIndex: e.stepIndex, - turnId: e.turnId - }, - type: `reasoning.appended` - }; -} -function createMessageCompletedEvent(e) { - return { - data: { - finishReason: e.finishReason ?? `stop`, - message: e.message, - sequence: e.sequence, - stepIndex: e.stepIndex, - turnId: e.turnId - }, - type: `message.completed` - }; -} -function createReasoningCompletedEvent(e) { - return { - data: { - reasoning: e.reasoning, - sequence: e.sequence, - stepIndex: e.stepIndex, - turnId: e.turnId - }, - type: `reasoning.completed` - }; -} -function createResultCompletedEvent(e) { - return { - data: { - result: e.result, - sequence: e.sequence, - stepIndex: e.stepIndex, - turnId: e.turnId - }, - type: `result.completed` - }; -} -function createStepStartedEvent(e) { - return { - data: { - sequence: e.sequence, - stepIndex: e.stepIndex, - turnId: e.turnId - }, - type: `step.started` - }; -} -function createStepCompletedEvent(e) { - let t = { - finishReason: e.finishReason, - sequence: e.sequence, - stepIndex: e.stepIndex, - turnId: e.turnId - }; - return e.usage !== void 0 && (t.usage = e.usage), { - data: t, - type: `step.completed` - }; -} -function createStepFailedEvent(e) { - return { - data: { - code: e.code, - details: e.details, - message: e.message, - sequence: e.sequence, - stepIndex: e.stepIndex, - turnId: e.turnId - }, - type: `step.failed` - }; -} -function createTurnCompletedEvent(e) { - return { - data: { - sequence: e.sequence, - turnId: e.turnId - }, - type: `turn.completed` - }; -} -function createTurnFailedEvent(e) { - return { - data: { - code: e.code, - details: e.details, - message: e.message, - sequence: e.sequence, - turnId: e.turnId - }, - type: `turn.failed` - }; -} -function createCompactionRequestedEvent(e) { - return { - data: { - modelId: e.modelId, - sequence: e.sequence, - sessionId: e.sessionId, - turnId: e.turnId, - usageInputTokens: e.usageInputTokens ?? null - }, - type: `compaction.requested` - }; -} -function createCompactionCompletedEvent(e) { - return { - data: { - modelId: e.modelId, - sequence: e.sequence, - sessionId: e.sessionId, - turnId: e.turnId - }, - type: `compaction.completed` - }; -} -function createSessionWaitingEvent() { - return { - data: { wait: `next-user-message` }, - type: `session.waiting` - }; -} -function createSessionFailedEvent(e) { - return { - data: { - code: e.code, - details: e.details, - message: e.message, - sessionId: e.sessionId - }, - type: `session.failed` - }; -} -function createSessionCompletedEvent() { - return { type: `session.completed` }; -} -function timestampHandleMessageStreamEvent(e, t = (/* @__PURE__ */ new Date()).toISOString()) { - return { - ...e, - meta: { at: t } - }; -} -function encodeMessageStreamEvent(e) { - return textEncoder.encode(`${JSON.stringify(e)}\n`); -} -function normalizeActionResultOutcome(e) { - if (e.isError === !0) return { - error: buildActionResultError(e), - status: `failed` - }; - let t = readActionResultOutputError(e.output); - return t === void 0 ? { status: `completed` } : { - error: t, - status: `failed` - }; -} -function buildActionResultError(e) { - let t = readActionResultOutputError(e.output); - return t === void 0 ? { - code: `ACTION_RESULT_FAILED`, - message: formatActionResultOutput(e.output) - } : t; -} -function readActionResultOutputError(e) { - let t = parseActionResultOutputRecord(e); - if (t === void 0) return; - let n = typeof t.code == `string` && t.code.length > 0 ? t.code : void 0, r = typeof t.message == `string` && t.message.length > 0 ? t.message : void 0; - if (!(n === void 0 || r === void 0)) return { - code: n, - message: r - }; -} -function parseActionResultOutputRecord(e) { - if (typeof e == `object` && e) return e; - if (typeof e != `string`) return; - let t = e.trim(); - if (t.length !== 0) try { - let e = JSON.parse(t); - if (typeof e == `object` && e) return e; - } catch { - return; - } -} -function formatActionResultOutput(e) { - if (typeof e == `string`) return e; - let t = JSON.stringify(e); - return typeof t == `string` && t.length > 0 ? t : `Action failed.`; -} -//#endregion -//#region node_modules/eve/dist/src/runtime/actions/types.js -const runtimeToolCallActionRequestSchema = Ls$3.object({ - callId: Ls$3.string(), - input: jsonObjectSchema, - kind: Ls$3.literal(`tool-call`), - toolName: Ls$3.string() -}).strict(); -const runtimeSubagentCallActionRequestSchema = Ls$3.object({ - callId: Ls$3.string(), - description: Ls$3.string(), - input: jsonObjectSchema, - kind: Ls$3.literal(`subagent-call`), - name: Ls$3.string(), - nodeId: Ls$3.string(), - subagentName: Ls$3.string() -}).strict(); -const runtimeRemoteAgentCallActionRequestSchema = Ls$3.object({ - callId: Ls$3.string(), - description: Ls$3.string(), - input: jsonObjectSchema, - kind: Ls$3.literal(`remote-agent-call`), - name: Ls$3.string(), - nodeId: Ls$3.string(), - remoteAgentName: Ls$3.string() -}).strict(); -const runtimeLoadSkillActionRequestSchema = Ls$3.object({ - callId: Ls$3.string(), - input: jsonObjectSchema, - kind: Ls$3.literal(`load-skill`) -}).strict(); -const runtimeActionRequestSchema = Ls$3.discriminatedUnion(`kind`, [ - runtimeLoadSkillActionRequestSchema, - runtimeRemoteAgentCallActionRequestSchema, - runtimeSubagentCallActionRequestSchema, - runtimeToolCallActionRequestSchema -]); -Ls$3.object({ - callId: Ls$3.string(), - isError: Ls$3.boolean().optional(), - kind: Ls$3.literal(`tool-result`), - output: jsonValueSchema, - toolName: Ls$3.string() -}).strict(), Ls$3.object({ - callId: Ls$3.string(), - isError: Ls$3.boolean().optional(), - kind: Ls$3.literal(`subagent-result`), - output: jsonValueSchema, - subagentName: Ls$3.string() -}).strict(), Ls$3.object({ - callId: Ls$3.string(), - isError: Ls$3.boolean().optional(), - kind: Ls$3.literal(`load-skill-result`), - output: jsonValueSchema, - name: Ls$3.string().optional() -}).strict(); -//#endregion -//#region node_modules/eve/dist/src/runtime/input/types.js -const inputOptionSchema = Ls$3.object({ - description: Ls$3.string().describe(`Optional additional context for this option.`).optional(), - id: Ls$3.string().describe(`Stable identifier for the option.`), - label: Ls$3.string().describe(`User-facing label for the option.`), - style: Ls$3.enum([ - `primary`, - `danger`, - `default` - ]).describe(`Visual treatment hint for the option.`).optional() -}).strict(); -const inputRequestSchema = Ls$3.object({ - action: runtimeToolCallActionRequestSchema, - allowFreeform: Ls$3.boolean().describe(`Whether the user may answer with freeform text instead of selecting one of the provided options.`).optional(), - display: Ls$3.enum([ - `confirmation`, - `select`, - `text` - ]).describe(`Rendering hint: the channel uses this to pick a UX treatment.`).optional(), - options: Ls$3.array(inputOptionSchema).describe(`Selectable answer options to present to the user.`).optional(), - prompt: Ls$3.string().describe(`The prompt to present to the user.`), - requestId: Ls$3.string().describe(`Stable identifier for this request.`) -}).strict(); -const inputResponseSchema = Ls$3.object({ - optionId: Ls$3.string().optional(), - requestId: Ls$3.string(), - text: Ls$3.string().optional() -}).strict(); -function isInputResponse(e) { - return inputResponseSchema.safeParse(e).success; -} -//#endregion -//#region node_modules/eve/dist/src/protocol/routes.js -const EVE_ROUTE_PREFIX = `/eve/v1`; -const EVE_HEALTH_ROUTE_PATH = `${EVE_ROUTE_PREFIX}/health`; -const EVE_INFO_ROUTE_PATH = `${EVE_ROUTE_PREFIX}/info`; -const EVE_CREATE_SESSION_ROUTE_PATH = `${EVE_ROUTE_PREFIX}/session`; -const EVE_CONTINUE_SESSION_ROUTE_PATTERN = `${EVE_ROUTE_PREFIX}/session/:sessionId`; -const EVE_MESSAGE_STREAM_ROUTE_PATTERN = `${EVE_ROUTE_PREFIX}/session/:sessionId/stream`; -const EVE_DEV_DISPATCH_SCHEDULE_ROUTE_PATTERN = `${EVE_ROUTE_PREFIX}/dev/schedules/:scheduleId`; -const EVE_DEV_RUNTIME_ARTIFACTS_ROUTE_PATH = `${EVE_ROUTE_PREFIX}/dev/runtime-artifacts`; -const EVE_DEV_RUNTIME_ARTIFACTS_REBUILD_ROUTE_PATH = `${EVE_DEV_RUNTIME_ARTIFACTS_ROUTE_PATH}/rebuild`; -const EVE_CONNECTION_CALLBACK_ROUTE_PATTERN = `${EVE_ROUTE_PREFIX}/connections/:name/callback/:token`; -const EVE_CALLBACK_ROUTE_PATTERN = `${EVE_ROUTE_PREFIX}/callback/:token`; -function createEveConnectionCallbackRoutePath(e, t) { - return `${EVE_ROUTE_PREFIX}/connections/${encodeURIComponent(e)}/callback/${encodeURIComponent(t)}`; -} -function createEveCallbackRoutePath(e) { - return `${EVE_ROUTE_PREFIX}/callback/${encodeURIComponent(e)}`; -} -//#endregion -//#region node_modules/eve/dist/src/shared/network-address.js -const httpServerUrlSchema = Ls$3.url({ protocol: /^https?$/ }); -const reservedRanges = new BlockList(); -reservedRanges.addSubnet(`0.0.0.0`, 8, `ipv4`), reservedRanges.addSubnet(`10.0.0.0`, 8, `ipv4`), reservedRanges.addSubnet(`100.64.0.0`, 10, `ipv4`), reservedRanges.addSubnet(`169.254.0.0`, 16, `ipv4`), reservedRanges.addSubnet(`172.16.0.0`, 12, `ipv4`), reservedRanges.addSubnet(`192.168.0.0`, 16, `ipv4`), reservedRanges.addSubnet(`198.18.0.0`, 15, `ipv4`), reservedRanges.addAddress(`::`, `ipv6`), reservedRanges.addSubnet(`fc00::`, 7, `ipv6`), reservedRanges.addSubnet(`fe80::`, 10, `ipv6`); -function normalizeAddress(e) { - let t = e.trim().replace(/^\[(.*)\]$/u, `$1`), n = t.indexOf(`%`), r = n === -1 ? t : t.slice(0, n); - if (r.toLowerCase().startsWith(`::ffff:`)) { - let e = r.slice(7); - if (isIP(e) === 4) return e; - } - return r; -} -function isReservedIpAddress(e) { - let t = normalizeAddress(e), n = isIP(t); - return n === 0 ? !1 : reservedRanges.check(t, n === 4 ? `ipv4` : `ipv6`); -} -//#endregion -//#region node_modules/eve/dist/src/channel/session-callback.js -const sessionCallbackSchema = Ls$3.object({ - callId: Ls$3.string().min(1), - subagentName: Ls$3.string().min(1), - token: Ls$3.string().min(1), - url: Ls$3.string().min(1) -}).strict().superRefine((e, t) => { - let r; - try { - r = new URL(e.url); - } catch { - t.addIssue({ - code: `custom`, - message: `Callback url must be absolute.`, - path: [`url`] - }); - return; - } - readCallbackUrlToken(r) !== e.token && t.addIssue({ - code: `custom`, - message: `Callback url token must match callback token.`, - path: [`url`] - }), isReservedIpAddress(r.hostname) && t.addIssue({ - code: `custom`, - message: `Callback url host must not be a private or reserved address.`, - path: [`url`] - }); -}); -function parseSessionCallback(e) { - let t = sessionCallbackSchema.safeParse(e); - return t.success ? { - callback: t.data, - ok: !0 - } : { - cause: t.error, - message: formatSessionCallbackParseError(t.error), - ok: !1 - }; -} -function readCallbackUrlToken(e) { - let n = createEveCallbackRoutePath(``); - if (!e.pathname.startsWith(n)) return null; - let r = e.pathname.slice(n.length); - if (r.length === 0 || r.includes(`/`)) return null; - try { - return decodeURIComponent(r); - } catch { - return null; - } -} -function formatSessionCallbackParseError(e) { - return `Invalid callback metadata: ${e.issues.map((e) => `${e.path.length === 0 ? `callback` : `callback.${e.path.join(`.`)}`}: ${e.message}`).join(`; `)}`; -} -//#endregion -//#region node_modules/eve/dist/src/channel/compiled-channel.js -const CHANNEL_SENTINEL = `eve:channel`; -const CHANNEL_INSTRUMENTATION_KIND = Symbol.for(`eve.channel.instrumentationKind`); -const CHANNEL_INSTRUMENTATION_KINDS = Symbol.for(`eve.channel.instrumentationKinds`); -const channelInstrumentationKindGlobal = globalThis; -channelInstrumentationKindGlobal[CHANNEL_INSTRUMENTATION_KINDS] ??= /* @__PURE__ */ new Map(); -const channelInstrumentationKinds = channelInstrumentationKindGlobal[CHANNEL_INSTRUMENTATION_KINDS]; -function isCompiledChannel(e) { - return typeof e == `object` && !!e && e.__kind === `eve:channel`; -} -function setChannelInstrumentationKind(e, t) { - Object.defineProperty(e, CHANNEL_INSTRUMENTATION_KIND, { - configurable: !0, - enumerable: !1, - value: t - }); - let n = channelRouteSignature(e); - n !== void 0 && channelInstrumentationKinds.set(n, t); -} -function channelRouteSignature(e) { - if (e.routes.length !== 0) return e.routes.map((e) => `${e.method.toUpperCase()} ${e.path}`).sort().join(` -`); -} -//#endregion -//#region node_modules/eve/dist/src/channel/adapter.js -const log$20 = createLogger(`channel.adapter`); -function defaultDeliverResult(e) { - if (e.message !== void 0) return { - inputResponses: e.inputResponses, - message: e.message, - context: e.context, - outputSchema: e.outputSchema - }; - if (e.inputResponses !== void 0 && e.inputResponses.length > 0) return { - inputResponses: e.inputResponses, - context: e.context, - outputSchema: e.outputSchema - }; - if (e.context !== void 0 && e.context.length > 0) return { - context: e.context, - outputSchema: e.outputSchema - }; - if (e.outputSchema !== void 0) return { outputSchema: e.outputSchema }; -} -function getAdapterKind(e) { - return e.kind; -} -async function callAdapterEventHandler(e, t, n) { - let r = e[t.type]; - if (r === void 0) return t; - try { - await r(`data` in t ? t.data : void 0, n); - } catch (n) { - log$20.error(`adapter event handler threw — event swallowed`, { - adapterKind: getAdapterKind(e), - eventType: t.type, - error: n - }); - } - return t; -} -//#endregion -//#region node_modules/eve/dist/src/context/key.js -const KEY_REGISTRY_GLOBAL_KEY = Symbol.for(`eve.context-key-registry`); -const globalKeyRegistryContainer = globalThis; -globalKeyRegistryContainer[KEY_REGISTRY_GLOBAL_KEY] === void 0 && (globalKeyRegistryContainer[KEY_REGISTRY_GLOBAL_KEY] = /* @__PURE__ */ new Map()); -const keyRegistry = globalKeyRegistryContainer[KEY_REGISTRY_GLOBAL_KEY]; -var ContextKey = class { - name; - codec; - constructor(e, t = {}) { - this.name = e, this.codec = t.codec; - let n = keyRegistry.get(e); - if (n !== void 0 && n.codec === void 0 != (this.codec === void 0)) throw Error(`ContextKey name collision: "${e}" is already registered ${n.codec ? `with` : `without`} a codec, but a key ${this.codec ? `with` : `without`} a codec is being registered under the same name. This silently breaks context serialization — use a distinct name.`); - keyRegistry.set(e, this); - } -}; -function resolveKey(e) { - return keyRegistry.get(e); -} -//#endregion -//#region node_modules/eve/dist/src/context/keys.js -const AuthKey = new ContextKey(`eve.auth`); -const InitiatorAuthKey = new ContextKey(`eve.initiatorAuth`); -const SessionIdKey = new ContextKey(`eve.sessionId`); -const ContinuationTokenKey = new ContextKey(`eve.continuationToken`); -const ChannelRequestIdKey = new ContextKey(`eve.channelRequestId`); -const ChannelInstrumentationKey = new ContextKey(`eve.channelInstrumentation`); -const ModeKey = new ContextKey(`eve.mode`); -const ParentSessionKey = new ContextKey(`eve.parentSession`); -const CapabilitiesKey = new ContextKey(`eve.capabilities`); -const SessionCallbackKey = new ContextKey(`eve.sessionCallback`); -const SessionKey = new ContextKey(`eve.session`); -const SandboxKey = new ContextKey(`eve.sandbox`); -const SessionDynamicToolMetadataKey = new ContextKey(`eve.sessionDynamicToolMetadata`); -const TurnDynamicToolMetadataKey = new ContextKey(`eve.turnDynamicToolMetadata`); -const LiveStepToolsKey = new ContextKey(`eve.liveStepTools`); -const DynamicSkillManifestKey = new ContextKey(`eve.dynamicSkillManifest`); -const SessionDynamicInstructionsKey = new ContextKey(`eve.sessionDynamicInstructions`); -const TurnDynamicInstructionsKey = new ContextKey(`eve.turnDynamicInstructions`); -//#endregion -//#region node_modules/eve/dist/src/context/container.js -const EVE_CONTEXT_STORAGE_KEY = Symbol.for(`eve.context-storage`); -var ContextContainer = class { - _durableValues = /* @__PURE__ */ new Map(); - _virtualValues = /* @__PURE__ */ new Map(); - get(e) { - return this._virtualValues.has(e.name) ? this._virtualValues.get(e.name) : this._durableValues.get(e.name); - } - require(e) { - if (!this.has(e)) throw Error(`Context key "${e.name}" is not set.`); - return this.get(e); - } - has(e) { - return this._virtualValues.has(e.name) || this._durableValues.has(e.name); - } - set(e, t) { - let n = typeof t == `function` ? t(this.get(e)) : t; - return this._durableValues.set(e.name, n), n; - } - ensure(e, t) { - return this.has(e) ? this.require(e) : this.set(e, t()); - } - clearVirtualContext() { - this._virtualValues.clear(); - } - setVirtualContext(e, t) { - this._virtualValues.set(e.name, t); - } - *entries() { - for (let [e, n] of this._durableValues) { - let r = resolveKey(e); - r !== void 0 && (yield [r, n]); - } - } -}; -const globalContextStorage = globalThis; -globalContextStorage[EVE_CONTEXT_STORAGE_KEY] === void 0 && (globalContextStorage[EVE_CONTEXT_STORAGE_KEY] = new AsyncLocalStorage()); -const contextStorage = globalContextStorage[EVE_CONTEXT_STORAGE_KEY]; -function loadContext() { - let e = contextStorage.getStore(); - if (e === void 0) throw Error(`No active eve context. Call this function only from authored runtime code such as tools, steps, and model callbacks.`); - return e; -} -//#endregion -//#region node_modules/eve/dist/src/runtime/workspace/types.js -const WORKSPACE_ROOT$1 = `/workspace`; -//#endregion -//#region node_modules/eve/dist/src/runtime/skills/sandbox-access.js -const FRONTMATTER_PATTERN = /^---\r?\n[\s\S]*?\r?\n---\r?\n?/; -function assertSafeSkillId(e) { - if (e.length === 0 || e.trim() !== e || e.startsWith(`.`) || e.includes(`/`) || e.includes(`\\`) || e.includes(`..`) || /^[A-Za-z]:/.test(e)) throw Error(`Expected skill id to be a non-empty safe path segment without whitespace, separators, "." prefix, or "..".`); -} -async function loadSkillFromSandbox(e, n, r = []) { - assertSafeSkillId(n); - let i = await requireSandboxSession$1(e), a = skillFilePath(n, `SKILL.md`), o = await i.readTextFile({ path: a }); - if (o === null) { - let e = r.length > 0 ? ` Available skills: ${r.join(`, `)}.` : ``; - throw Error(`No skill named "${n}" at ${a}.${e}`); - } - return o.replace(FRONTMATTER_PATTERN, ``); -} -function createSandboxSkillHandle(e, t) { - return assertSafeSkillId(t), { - name: t, - file(n) { - assertSafeSkillRelativePath(n); - let r = skillFilePath(t, n); - return { - async bytes() { - let t = await (await requireSandboxSession$1(e)).readBinaryFile({ path: r }); - if (t === null) throw Error(`Skill file not found: ${r}`); - return t; - }, - async text() { - let t = await (await requireSandboxSession$1(e)).readTextFile({ path: r }); - if (t === null) throw Error(`Skill file not found: ${r}`); - return t; - } - }; - } - }; -} -function assertSafeSkillRelativePath(e) { - if (e.length === 0 || e.startsWith(`/`) || e.includes(`\\`) || e.split(`/`).some((e) => e.length === 0 || e === `.` || e === `..`)) throw Error(`Expected skill file path to be a relative path inside the skill directory.`); -} -async function requireSandboxSession$1(e) { - let t = await e.get(); - if (t === null) throw Error(`The sandbox is not available in the current authored runtime context.`); - return t; -} -function skillFilePath(t, n) { - return `${WORKSPACE_ROOT$1}/skills/${t}/${n}`; -} -//#endregion -//#region node_modules/eve/dist/src/context/build-callback-context.js -function buildCallbackContext() { - let r = loadContext(), i = r.require(SessionKey); - return { - session: { - id: i.sessionId, - auth: i.auth, - turn: i.turn, - parent: i.parent - }, - getSandbox() { - let t = r.get(SandboxKey); - if (t === void 0) throw Error(`eve sandbox runtime access is unavailable in the current async context. Call ctx.getSandbox() only from authored runtime functions such as tools, hooks, and channel events.`); - return t.get().then((e) => { - if (e === null) throw Error(`The sandbox is not available in the current authored runtime context.`); - return e; - }); - }, - getSkill(t) { - let n = r.get(SandboxKey); - if (n === void 0) throw Error(`eve sandbox runtime access is unavailable in the current async context. Call ctx.getSkill() only from authored runtime functions such as tools, hooks, and channel events.`); - return createSandboxSkillHandle(n, t); - } - }; -} -//#endregion -//#region node_modules/eve/dist/src/channel/cors.js -function normalizeChannelCors(e) { - if (e === void 0 || e === !1) return; - if (e === !0) return {}; - if (typeof e != `object` || !e || Array.isArray(e)) throw Error(`Expected channel cors to be a boolean or a serializable CORS options object.`); - let t = {}; - if (e.origin !== void 0 && (t.origin = normalizeOrigin(e.origin)), e.methods !== void 0 && (t.methods = normalizeWildcardOrStringList(e.methods, `methods`)), e.allowHeaders !== void 0 && (t.allowHeaders = normalizeWildcardOrStringList(e.allowHeaders, `allowHeaders`)), e.exposeHeaders !== void 0 && (t.exposeHeaders = normalizeWildcardOrStringList(e.exposeHeaders, `exposeHeaders`)), e.credentials !== void 0) { - if (typeof e.credentials != `boolean`) throw Error(`Expected channel cors.credentials to be a boolean.`); - t.credentials = e.credentials; - } - return e.maxAge !== void 0 && (t.maxAge = normalizeMaxAge(e.maxAge)), e.preflight !== void 0 && (t.preflight = normalizePreflight(e.preflight)), t; -} -function normalizeOrigin(e) { - if (e === `*` || e === `null`) return e; - if (!Array.isArray(e)) throw Error(`Expected channel cors.origin to be "*", "null", or an array of origins.`); - return e.map((e) => { - if (typeof e != `string` || e.length === 0) throw Error(`Expected channel cors.origin entries to be non-empty strings.`); - return e; - }); -} -function normalizeWildcardOrStringList(e, t) { - if (e === `*`) return e; - if (!Array.isArray(e)) throw Error(`Expected channel cors.${t} to be "*" or an array of strings.`); - return e.map((e) => { - if (typeof e != `string` || e.length === 0) throw Error(`Expected channel cors.${t} entries to be non-empty strings.`); - return e; - }); -} -function normalizeMaxAge(e) { - if (e === !1) return !1; - if (typeof e == `number`) { - if (!Number.isFinite(e) || e < 0) throw Error(`Expected channel cors.maxAge to be a non-negative finite number.`); - return String(e); - } - if (typeof e == `string` && e.length > 0) return e; - throw Error(`Expected channel cors.maxAge to be false, a string, or a number.`); -} -function normalizePreflight(e) { - if (typeof e != `object` || !e || Array.isArray(e)) throw Error(`Expected channel cors.preflight to be an object.`); - let t = e.statusCode; - if (t === void 0) return {}; - if (!Number.isInteger(t) || t < 100 || t > 599) throw Error(`Expected channel cors.preflight.statusCode to be an HTTP status code.`); - return { statusCode: t }; -} -//#endregion -//#region node_modules/eve/dist/src/channel/http.js -const HTTP_ADAPTER_KIND = `http`; -const HTTP_ADAPTER = { kind: HTTP_ADAPTER_KIND }; -//#endregion -//#region node_modules/eve/dist/src/public/definitions/defineChannel.js -function defineChannel(t) { - let n = buildAdapter(t), i = normalizeChannelCors(t.cors); - return { - __kind: CHANNEL_SENTINEL, - routes: t.routes, - adapter: n, - cors: i, - receive: t.receive - }; -} -function buildAdapter(e) { - let r = e.state != null, a = e.context != null, o = e.fetchFile !== void 0, s = e.metadata, c = r || a || s !== void 0, l = {}, u = !1, d = [ - `turn.started`, - `actions.requested`, - `action.result`, - `message.completed`, - `message.appended`, - `reasoning.appended`, - `reasoning.completed`, - `input.requested`, - `turn.failed`, - `turn.completed`, - `session.failed`, - `session.completed`, - `session.waiting`, - `authorization.required`, - `authorization.completed` - ], f = e.events; - for (let e of d) { - let t = f?.[e]; - t && (u = !0, l[e] = (r, i) => { - let a = { - ...i, - continuationToken: i.session?.continuationToken ?? ``, - setContinuationToken: (e) => i.session?.setContinuationToken(e) - }; - return e === `session.failed` ? t(r, a) : t(r, a, buildCallbackContext()); - }); - } - return !c && !u && !o ? { kind: e.kindHint ?? HTTP_ADAPTER_KIND } : { - kind: e.kindHint ?? `defineChannel`, - state: r ? { ...e.state } : {}, - fetchFile: e.fetchFile, - instrumentation: s === void 0 ? void 0 : { metadata(e) { - return s(e); - } }, - createAdapterContext(t) { - let n = t.state, r = t.session; - return { - ...a ? e.context(n, r) : {}, - state: n, - ctx: t.ctx, - session: r - }; - }, - deliver(e) { - return defaultDeliverResult(e); - }, - ...l - }; -} -//#endregion -//#region node_modules/eve/dist/src/internal/attachments/data.js -async function fileDataToBytes(e) { - return typeof Buffer < `u` && Buffer.isBuffer(e) ? e : e instanceof Uint8Array ? Buffer.from(e) : e instanceof ArrayBuffer ? Buffer.from(new Uint8Array(e)) : typeof e == `string` ? decodeStringData(e) : e instanceof URL && e.protocol === `data:` ? decodeStringData(e.href) : null; -} -function getKnownByteLength(n) { - return typeof Buffer < `u` && Buffer.isBuffer(n) || n instanceof Uint8Array || n instanceof ArrayBuffer ? n.byteLength : typeof n == `string` ? computeStringByteLength(n) : isAttachmentRefUrl(n) ? parseAttachmentRef(n).size ?? null : n instanceof URL && n.protocol === `data:` ? computeStringByteLength(n.href) : null; -} -function decodeStringData(e) { - if (e.startsWith(`data:`)) { - let t = e.indexOf(`,`); - if (t === -1) return null; - let n = e.slice(5, t), r = e.slice(t + 1); - return n.endsWith(`;base64`) ? Buffer.from(r, `base64`) : Buffer.from(decodeURIComponent(r), `utf8`); - } - return /^https?:\/\//.test(e) ? null : Buffer.from(e, `base64`); -} -function computeStringByteLength(e) { - if (e.startsWith(`data:`)) { - let t = e.indexOf(`,`); - if (t === -1) return null; - let n = e.slice(5, t), r = e.slice(t + 1); - if (n.endsWith(`;base64`)) return estimateBase64ByteLength(r); - try { - return Buffer.byteLength(decodeURIComponent(r), `utf8`); - } catch { - return Buffer.byteLength(r, `utf8`); - } - } - return /^https?:\/\//.test(e) ? null : estimateBase64ByteLength(e); -} -function estimateBase64ByteLength(e) { - let t = e.trimEnd(); - if (t.length === 0) return 0; - let n = 0; - return t.endsWith(`==`) ? n = 2 : t.endsWith(`=`) && (n = 1), Math.max(0, Math.floor(t.length * 3 / 4) - n); -} -//#endregion -//#region node_modules/eve/dist/src/public/channels/upload-policy.js -const DEFAULT_UPLOAD_POLICY = Object.freeze({ - allowedMediaTypes: `*`, - maxBytes: 25 * 1024 * 1024 -}); -function mergeUploadPolicy(e, n = DEFAULT_UPLOAD_POLICY) { - if (e === `disabled`) return `disabled`; - if (e === void 0) return n; - let r = e.maxBytes ?? n.maxBytes, i = e.allowedMediaTypes ?? n.allowedMediaTypes; - if (r < 0 || !Number.isFinite(r)) throw RangeError(`UploadPolicy.maxBytes must be a non-negative finite number. Received: ${String(r)}.`); - return { - allowedMediaTypes: i, - maxBytes: r - }; -} -function isMediaTypeAllowed(e, t) { - if (t === `disabled`) return !1; - if (t.allowedMediaTypes === `*`) return !0; - let n = e.toLowerCase(); - for (let e of t.allowedMediaTypes) { - let t = e.toLowerCase(); - if (t === n) return !0; - if (t.endsWith(`/*`)) { - let e = t.slice(0, -1); - if (n.startsWith(e)) return !0; - } - } - return !1; -} -function evaluateFilePart(t, n) { - if (n === `disabled` || !isMediaTypeAllowed(t.mediaType, n)) { - let e = { - allowedMediaTypes: n === `disabled` || n.allowedMediaTypes === `*` ? [] : [...n.allowedMediaTypes], - kind: `disallowed-media-type`, - mediaType: t.mediaType - }; - return t.filename === void 0 ? e : { - ...e, - filename: t.filename - }; - } - let r = getKnownByteLength(t.data); - if (r !== null && r > n.maxBytes) { - let e = { - byteLength: r, - kind: `too-large`, - limit: n.maxBytes, - mediaType: t.mediaType - }; - return t.filename === void 0 ? e : { - ...e, - filename: t.filename - }; - } - return null; -} -function collectUploadPolicyViolations(e, t) { - if (typeof e == `string`) return []; - let n = []; - for (let r of e) { - if (r.type !== `file`) continue; - let e = evaluateFilePart(r, t); - e !== null && n.push(e); - } - return n; -} -function formatUploadPolicyViolation(e) { - let t = e.filename ?? e.mediaType; - if (e.kind === `too-large`) return `${t} (${e.byteLength} bytes) exceeds the ${e.limit}-byte upload limit.`; - let n = e.allowedMediaTypes.length > 0 ? ` Allowed: ${e.allowedMediaTypes.join(`, `)}.` : ``; - return `${t} has media type "${e.mediaType}" which is not allowed by this route.${n}`; -} -//#endregion -//#region node_modules/eve/dist/src/public/channels/eve.js -const log$19 = createLogger(`eve.channel`); -function defaultEveAuth(e) { - return e.eve.caller; -} -function eveChannel(e) { - let t = mergeUploadPolicy(e.uploadPolicy); - return defineChannel({ - cors: normalizeEveCors(e.cors), - routes: [ - POST$1(`/eve/v1/session`, async (n, { send: r }) => { - let i = await routeAuth(n, e.auth); - if (i instanceof Response) return i; - let a = i, o; - try { - o = await n.json(); - } catch { - return Response.json({ - error: `Invalid JSON body.`, - ok: !1 - }, { status: 400 }); - } - if (typeof o != `object` || !o) return Response.json({ - error: `Expected a JSON object.`, - ok: !1 - }, { status: 400 }); - let s = parseCreateBody(o); - if (s instanceof Response) return s; - let c = checkUploadPolicy(s, t); - if (c !== null) return c; - let l = await resolveOnMessage({ - auth: a, - config: e, - message: s.message, - request: n - }); - if (l instanceof Response) return l; - if (!l.dispatch) return droppedMessageResponse(); - let u = `eve:${crypto.randomUUID()}`, d = await r(createSendPayload(s, mergeContext(s.context, l.context)), { - auth: l.auth, - callback: s.callback, - continuationToken: u, - mode: s.mode - }); - return Response.json({ - continuationToken: d.continuationToken, - ok: !0, - sessionId: d.id - }, { - headers: { - "cache-control": `no-store`, - [EVE_SESSION_ID_HEADER]: d.id - }, - status: 202 - }); - }), - POST$1(`/eve/v1/session/:sessionId`, async (n, { send: r, getSession: i, params: a }) => { - let o = await routeAuth(n, e.auth); - if (o instanceof Response) return o; - let s = o, c = a.sessionId; - if (!c) return Response.json({ - error: `Missing session id.`, - ok: !1 - }, { status: 400 }); - try { - i(c); - } catch { - return Response.json({ - error: `Session not found.`, - ok: !1 - }, { status: 404 }); - } - let l; - try { - l = await n.json(); - } catch { - return Response.json({ - error: `Invalid JSON body.`, - ok: !1 - }, { status: 400 }); - } - if (typeof l != `object` || !l) return Response.json({ - error: `Expected a JSON object.`, - ok: !1 - }, { status: 400 }); - let u = parseContinueBody(l); - if (u instanceof Response) return u; - let d = checkUploadPolicy(u, t); - if (d !== null) return d; - let f = u.context, p = s; - if (u.message !== void 0) { - let t = await resolveOnMessage({ - auth: s, - config: e, - message: u.message, - request: n, - sessionId: c - }); - if (t instanceof Response) return t; - if (!t.dispatch) return droppedMessageResponse(); - f = mergeContext(u.context, t.context), p = t.auth; - } - let m = await r({ - inputResponses: u.inputResponses, - message: u.message, - context: f, - outputSchema: u.outputSchema - }, { - auth: p, - continuationToken: u.continuationToken - }); - return Response.json({ - ok: !0, - sessionId: m.id - }, { - headers: { - "cache-control": `no-store`, - [EVE_SESSION_ID_HEADER]: m.id - }, - status: 200 - }); - }), - GET(`/eve/v1/session/:sessionId/stream`, async (t, { getSession: n, params: c }) => { - let l = await routeAuth(t, e.auth); - if (l instanceof Response) return l; - let u = c.sessionId; - if (!u) return Response.json({ - error: `Missing session id.`, - ok: !1 - }, { status: 400 }); - let d = parseStartIndex(t); - if (d instanceof Response) return d; - try { - let e = serializeAsNdjson(await n(u).getEventStream({ startIndex: d })); - return new Response(e, { headers: { - "cache-control": `no-store, no-transform`, - "content-type": EVE_MESSAGE_STREAM_CONTENT_TYPE, - "x-accel-buffering": `no`, - [EVE_SESSION_ID_HEADER]: u, - [EVE_STREAM_FORMAT_HEADER]: EVE_MESSAGE_STREAM_FORMAT, - [EVE_STREAM_VERSION_HEADER]: EVE_MESSAGE_STREAM_VERSION - } }); - } catch { - return Response.json({ - error: `Session not found.`, - ok: !1 - }, { status: 404 }); - } - }) - ], - events: e.events - }); -} -function normalizeEveCors(e) { - if (e === void 0 || e === !1) return !1; - if (e === !0) return !0; - let t = {}; - return e.origin !== void 0 && (t.origin = normalizeEveCorsOrigin(e.origin)), e.methods !== void 0 && (t.methods = e.methods), e.allowedHeaders !== void 0 && (t.allowHeaders = e.allowedHeaders), e.exposedHeaders !== void 0 && (t.exposeHeaders = e.exposedHeaders), e.credentials !== void 0 && (t.credentials = e.credentials), e.maxAge !== void 0 && (t.maxAge = e.maxAge), e.preflightStatus !== void 0 && (t.preflight = { statusCode: e.preflightStatus }), t; -} -function normalizeEveCorsOrigin(e) { - return e === `*` || e === `null` ? e : typeof e == `string` ? [e] : e; -} -async function resolveOnMessage(e) { - let n = e.config.onMessage ?? defaultOnMessage, r; - try { - r = await n({ eve: e.sessionId === void 0 ? { - caller: e.auth, - request: e.request - } : { - caller: e.auth, - request: e.request, - sessionId: e.sessionId - } }, e.message); - } catch (n) { - let r = logError(log$19, `onMessage handler failed`, n, { sessionId: e.sessionId }); - return Response.json({ - error: `onMessage handler failed.`, - errorId: r, - ok: !1 - }, { status: 500 }); - } - return r == null ? { dispatch: !1 } : r.context === void 0 ? { - auth: r.auth, - dispatch: !0 - } : { - auth: r.auth, - context: r.context, - dispatch: !0 - }; -} -function defaultOnMessage(e) { - return { auth: defaultEveAuth(e) }; -} -function droppedMessageResponse() { - return new Response(null, { - headers: { "cache-control": `no-store` }, - status: 204 - }); -} -function parseCreateBody(e) { - let t = parseMessageField(e.message); - if (t instanceof Response) return t; - let n = parseClientContextField(e.clientContext); - if (n instanceof Response) return n; - let r = parseCallbackField(e.callback); - if (r instanceof Response) return r; - let i = parseModeField(e.mode); - if (i instanceof Response) return i; - let a = parseOutputSchemaField(e.outputSchema); - return a instanceof Response ? a : t === void 0 ? Response.json({ - error: `Missing or empty 'message' field.`, - ok: !1 - }, { status: 400 }) : { - callback: r, - message: t, - mode: i, - context: n, - outputSchema: a - }; -} -function parseContinueBody(e) { - let t = typeof e.continuationToken == `string` && e.continuationToken.length > 0 ? e.continuationToken : void 0; - if (t === void 0) return Response.json({ - error: `Missing or empty 'continuationToken' field.`, - ok: !1 - }, { status: 400 }); - let n = parseMessageField(e.message); - if (n instanceof Response) return n; - let r = parseInputResponses(e.inputResponses); - if (r instanceof Response) return r; - let i = parseClientContextField(e.clientContext); - if (i instanceof Response) return i; - let a = parseOutputSchemaField(e.outputSchema); - return a instanceof Response ? a : n === void 0 && r === void 0 ? Response.json({ - error: `Expected a non-empty 'message', a non-empty 'inputResponses' array, or both.`, - ok: !1 - }, { status: 400 }) : { - message: n, - continuationToken: t, - inputResponses: r, - context: i, - outputSchema: a - }; -} -function createSendPayload(e, t = e.context) { - if (t === void 0 && e.outputSchema === void 0) return e.message; - let n = { message: e.message }; - return t !== void 0 && (n.context = t), e.outputSchema !== void 0 && (n.outputSchema = e.outputSchema), n; -} -function parseOutputSchemaField(e) { - if (e !== void 0) try { - return parseJsonObject(e); - } catch { - return Response.json({ - error: `Expected 'outputSchema' to be a JSON-serializable object.`, - ok: !1 - }, { status: 400 }); - } -} -function parseCallbackField(e) { - if (e === void 0) return; - let t = parseSessionCallback(e); - return t.ok ? t.callback : Response.json({ - error: t.message, - ok: !1 - }, { status: 400 }); -} -function parseModeField(e) { - if (e !== void 0) return e === `conversation` || e === `task` ? e : Response.json({ - error: `Expected 'mode' to be either 'conversation' or 'task'.`, - ok: !1 - }, { status: 400 }); -} -function parseMessageField(e) { - if (e === void 0) return; - if (typeof e == `string`) return e.length > 0 ? e : void 0; - if (!Array.isArray(e)) return Response.json({ - error: `Expected 'message' to be a string or an array of text/file parts.`, - ok: !1 - }, { status: 400 }); - if (e.length === 0) return; - let t = []; - for (let n of e) { - let e = parseMessagePart(n); - if (e instanceof Response) return e; - t.push(e); - } - return t; -} -function parseMessagePart(e) { - if (typeof e != `object` || !e) return Response.json({ - error: `Expected each message part to be an object.`, - ok: !1 - }, { status: 400 }); - let t = e; - if (t.type === `text`) return typeof t.text != `string` || t.text.length === 0 ? Response.json({ - error: `Text parts require a non-empty 'text' string.`, - ok: !1 - }, { status: 400 }) : { - type: `text`, - text: t.text - }; - if (t.type === `file`) { - if (typeof t.mediaType != `string` || t.mediaType.length === 0) return Response.json({ - error: `File parts require a non-empty 'mediaType' string.`, - ok: !1 - }, { status: 400 }); - if (typeof t.data != `string`) return Response.json({ - error: `File parts require a 'data' string (base64, data URL, or URL).`, - ok: !1 - }, { status: 400 }); - if (hasInternalRefScheme(t.data)) return Response.json({ - error: `File part 'data' must not use a framework-internal ref scheme.`, - ok: !1 - }, { status: 400 }); - let e = { - type: `file`, - mediaType: t.mediaType, - data: t.data - }; - return typeof t.filename == `string` && t.filename.length > 0 && (e.filename = t.filename), e; - } - return Response.json({ - error: `Unsupported message part type "${String(t.type)}". Use 'text' or 'file'.`, - ok: !1 - }, { status: 400 }); -} -function checkUploadPolicy(e, t) { - if (!e.message) return null; - let n = collectUploadPolicyViolations(e.message, t); - if (n.length === 0) return null; - let [r] = n; - if (!r) return null; - let i = r.kind === `too-large` ? 413 : 415; - return Response.json({ - error: formatUploadPolicyViolation(r), - ok: !1, - violations: n.map((e) => e.kind === `too-large` ? { - byteLength: e.byteLength, - filename: e.filename, - kind: e.kind, - limit: e.limit, - mediaType: e.mediaType - } : { - allowedMediaTypes: e.allowedMediaTypes, - filename: e.filename, - kind: e.kind, - mediaType: e.mediaType - }) - }, { status: i }); -} -function parseInputResponses(e) { - if (e === void 0) return; - if (!Array.isArray(e) || e.length === 0) return Response.json({ - error: `Expected 'inputResponses' to be a non-empty array.`, - ok: !1 - }, { status: 400 }); - let t = e.filter(isInputResponse); - return t.length === e.length ? t : Response.json({ - error: `Expected every 'inputResponses' entry to match the HITL response schema.`, - ok: !1 - }, { status: 400 }); -} -function mergeContext(e, t) { - return e === void 0 ? t : t === void 0 ? e : [...e, ...t]; -} -function parseClientContextField(e) { - if (e !== void 0) { - if (typeof e == `string`) return e.length > 0 ? [toClientContextMessage(e)] : void 0; - if (Array.isArray(e)) return e.length === 0 ? void 0 : e.every((e) => typeof e == `string` && e.length > 0) ? e.map((e) => toClientContextMessage(e)) : Response.json({ - error: `Expected 'clientContext' array entries to be non-empty strings.`, - ok: !1 - }, { status: 400 }); - if (typeof e != `object` || !e) return Response.json({ - error: `Expected 'clientContext' to be a string, string array, or JSON object.`, - ok: !1 - }, { status: 400 }); - try { - let t = parseJsonObject(e); - return [toClientContextMessage(JSON.stringify(t))]; - } catch { - return Response.json({ - error: `Expected 'clientContext' to be a JSON-serializable object.`, - ok: !1 - }, { status: 400 }); - } - } -} -function toClientContextMessage(e) { - return `Client context: -${e}`; -} -function parseStartIndex(e) { - let t = new URL(e.url).searchParams.get(`startIndex`); - if (t === null) return; - let n = Number.parseInt(t, 10); - return !Number.isSafeInteger(n) || n < 0 ? Response.json({ - error: `Expected startIndex to be a non-negative integer.`, - ok: !1 - }, { status: 400 }) : n; -} -function serializeAsNdjson(e) { - let t = new TextEncoder(); - return e.pipeThrough(new TransformStream({ transform(e, n) { - n.enqueue(t.encode(`${JSON.stringify(e)}\n`)); - } })); -} -//#endregion -//#region node_modules/eve/dist/src/compiled/_chunks/workflow/dist-FLIfyJ4Y.js -function n$11(e, t, n) { - return n === 1 ? e : t; -} -function r$14(e, t) { - if (typeof t != `string`) return null; - let [n, r, ...i] = t.split(`//`); - if (n !== e || !r || i.length === 0) return null; - let a = i.join(`//`), o = a.split(`/`).at(-1) ?? ``, s = ``; - return s = r.startsWith(`./`) ? r.split(`/`).at(-1) ?? `` : (r.split(`@`).slice(0, -1).join(`@`) || r.split(`@`)[0])?.split(`/`).at(-1) ?? ``, [`default`, `__default`].includes(o) && s && (o = s), { - shortName: o, - moduleSpecifier: r, - functionName: a - }; -} -function i$12(e) { - return r$14(`workflow`, e); -} -function a$11(e) { - return r$14(`step`, e); -} -function o$11(e) { - return d$11(a$11(e), e); -} -function s$9(e) { - return d$11(i$12(e), e); -} -function c$10(e) { - return i$12(e)?.shortName ?? u$11(`workflow`, e) ?? e; -} -function l$9(e) { - return a$11(e)?.shortName ?? u$11(`step`, e) ?? e; -} -function u$11(e, t) { - if (!t.startsWith(`${e}--`)) return null; - let n = t.split(`--`).filter(Boolean), r = n.at(-1)?.split(`-`).filter(Boolean).at(-1) ?? ``; - if ([`default`, `__default`].includes(r)) { - let t = n.at(-2)?.split(`-`).filter(Boolean).at(-1); - t && t !== e && (r = t); - } - return r || null; -} -function d$11(e, t) { - return e ? `${e.shortName} (${e.moduleSpecifier})` : t; -} -function f$9() { - let e, t; - return { - promise: new Promise((n, r) => { - e = n, t = r; - }), - resolve: e, - reject: t - }; -} -function p$12(e) { - let t = { get value() { - let n = e(); - return Object.defineProperty(t, "value", { value: n }), n; - } }; - return t; -} -var m$8 = d$13(c$12(((e, t) => { - var n = 1e3, r = n * 60, i = r * 60, a = i * 24, o = a * 7, s = a * 365.25; - t.exports = function(e, t) { - t ||= {}; - var n = typeof e; - if (n === `string` && e.length > 0) return c(e); - if (n === `number` && isFinite(e)) return t.long ? u(e) : l(e); - throw Error(`val is not a non-empty string or a valid number. val=` + JSON.stringify(e)); - }; - function c(e) { - if (e = String(e), !(e.length > 100)) { - var t = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e); - if (t) { - var c = parseFloat(t[1]); - switch ((t[2] || `ms`).toLowerCase()) { - case `years`: - case `year`: - case `yrs`: - case `yr`: - case `y`: return c * s; - case `weeks`: - case `week`: - case `w`: return c * o; - case `days`: - case `day`: - case `d`: return c * a; - case `hours`: - case `hour`: - case `hrs`: - case `hr`: - case `h`: return c * i; - case `minutes`: - case `minute`: - case `mins`: - case `min`: - case `m`: return c * r; - case `seconds`: - case `second`: - case `secs`: - case `sec`: - case `s`: return c * n; - case `milliseconds`: - case `millisecond`: - case `msecs`: - case `msec`: - case `ms`: return c; - default: return; - } - } - } - } - function l(e) { - var t = Math.abs(e); - return t >= a ? Math.round(e / a) + `d` : t >= i ? Math.round(e / i) + `h` : t >= r ? Math.round(e / r) + `m` : t >= n ? Math.round(e / n) + `s` : e + `ms`; - } - function u(e) { - var t = Math.abs(e); - return t >= a ? d(e, t, a, `day`) : t >= i ? d(e, t, i, `hour`) : t >= r ? d(e, t, r, `minute`) : t >= n ? d(e, t, n, `second`) : e + ` ms`; - } - function d(e, t, n, r) { - var i = t >= n * 1.5; - return Math.round(e / n) + ` ` + r + (i ? `s` : ``); - } -}))(), 1); -function h$10(e) { - if (typeof e == `string`) { - let t = (0, m$8.default)(e); - if (typeof t != `number` || t < 0) throw Error(`Invalid duration: "${e}". Expected a valid duration string like "1s", "1m", "1h", etc.`); - return new Date(Date.now() + t); - } else if (typeof e == `number`) { - if (e < 0 || !Number.isFinite(e)) throw Error(`Invalid duration: ${e}. Expected a non-negative finite number of milliseconds.`); - return new Date(Date.now() + e); - } else if (e instanceof Date || e && typeof e == `object` && typeof e.getTime == `function`) return e instanceof Date ? e : new Date(e.getTime()); - else throw Error(`Invalid duration parameter. Expected a duration string, number (milliseconds), or Date object.`); -} -function g$9(e = process.env) { - return e.WORKFLOW_TARGET_WORLD || (e.VERCEL_DEPLOYMENT_ID ? `vercel` : `local`); -} -function _$8(e) { - return e === `vercel` || e === `@workflow/world-vercel`; -} -//#endregion -//#region node_modules/eve/dist/src/compiled/_chunks/workflow/dist-Dxrjttr2.js -const t$9 = { - USER_ERROR: `USER_ERROR`, - RUNTIME_ERROR: `RUNTIME_ERROR`, - CORRUPTED_EVENT_LOG: `CORRUPTED_EVENT_LOG`, - REPLAY_DIVERGENCE: `REPLAY_DIVERGENCE`, - MAX_DELIVERIES_EXCEEDED: `MAX_DELIVERIES_EXCEEDED`, - REPLAY_TIMEOUT: `REPLAY_TIMEOUT`, - WORLD_CONTRACT_ERROR: `WORLD_CONTRACT_ERROR` -}; -function n$10(e) { - return typeof e == `object` && !!e && `name` in e && `message` in e; -} -function r$13(e, t) { - if (t.length === 0) return e; - let n = [e]; - return t.forEach((e, r) => { - let i = r === t.length - 1, a = i ? `╰▶ ` : `├▶ `, o = i ? ` ` : `│ `; - `${e.label}: ${e.value}`.split(` -`).forEach((e, t) => n.push(`${t === 0 ? a : o}${e}`)); - }), n.join(` -`); -} -function i$11(e, t) { - let n = []; - return e && n.push({ - label: `hint`, - value: e - }), t && n.push({ - label: `docs`, - value: `https://workflow-sdk.dev/err/${t}` - }), n; -} -const a$10 = { - NODE_JS_MODULE_IN_WORKFLOW: `node-js-module-in-workflow`, - START_INVALID_WORKFLOW_FUNCTION: `start-invalid-workflow-function`, - SERIALIZATION_FAILED: `serialization-failed`, - WEBHOOK_INVALID_RESPOND_WITH_VALUE: `webhook-invalid-respond-with-value`, - WEBHOOK_RESPONSE_NOT_SENT: `webhook-response-not-sent`, - FETCH_IN_WORKFLOW_FUNCTION: `fetch-in-workflow`, - TIMEOUT_FUNCTIONS_IN_WORKFLOW: `timeout-in-workflow`, - HOOK_CONFLICT: `hook-conflict`, - CORRUPTED_EVENT_LOG: `corrupted-event-log`, - REPLAY_DIVERGENCE: `replay-divergence`, - STEP_NOT_REGISTERED: `step-not-registered`, - WORKFLOW_NOT_REGISTERED: `workflow-not-registered`, - RUNTIME_DECRYPTION_FAILED: `runtime-decryption-failed` -}; -var o$10 = class extends Error { - cause; - constructor(e, t) { - let n = r$13(e, i$11(void 0, t?.slug)); - super(n, { cause: t?.cause }), t?.cause !== void 0 && (this.cause = t.cause), t?.cause instanceof Error && (this.stack = `${this.stack}\nCaused by: ${t.cause.stack}`); - } - static is(e) { - return n$10(e) && e.name === `WorkflowError`; - } -}; -var s$8 = class extends o$10 { - status; - code; - url; - retryAfter; - constructor(e, t) { - super(e, { cause: t?.cause }), this.name = `WorkflowWorldError`, this.status = t?.status, this.code = t?.code, this.url = t?.url, this.retryAfter = t?.retryAfter; - } - static is(e) { - return n$10(e) && e.name === `WorkflowWorldError`; - } -}; -var c$9 = class extends o$10 { - runId; - errorCode; - constructor(e, t, n = {}) { - let r = t instanceof Error ? t.message : typeof t == `string` ? t : t && typeof t == `object` && `message` in t ? String(t.message) : `Unknown error`; - super(`Workflow run "${e}" failed: ${r}`, { cause: t }), this.name = `WorkflowRunFailedError`, this.runId = e, n.errorCode !== void 0 && (this.errorCode = n.errorCode); - } - static is(e) { - return n$10(e) && e.name === `WorkflowRunFailedError`; - } -}; -var l$8 = class extends o$10 { - runId; - status; - constructor(e, t) { - super(`Workflow run "${e}" has not completed`, {}), this.name = `WorkflowRunNotCompletedError`, this.runId = e, this.status = t; - } - static is(e) { - return n$10(e) && e.name === `WorkflowRunNotCompletedError`; - } -}; -var u$10 = class extends o$10 { - constructor(e, t) { - super(e, { ...t }), this.name = `WorkflowRuntimeError`; - } - static is(e) { - return n$10(e) && e.name === `WorkflowRuntimeError`; - } -}; -var d$10 = class extends u$10 { - constructor(e, t) { - super(e, { - ...t, - slug: a$10.CORRUPTED_EVENT_LOG - }), this.name = `CorruptedEventLogError`; - } - static is(e) { - return n$10(e) && e.name === `CorruptedEventLogError`; - } -}; -var f$8 = class extends u$10 { - eventId; - constructor(e, t) { - super(e, { - ...t, - slug: a$10.REPLAY_DIVERGENCE - }), this.name = `ReplayDivergenceError`, this.eventId = t.eventId; - } - static is(e) { - return n$10(e) && e.name === `ReplayDivergenceError` && typeof e.eventId == `string`; - } -}; -var p$11 = class extends u$10 { - context; - constructor(e, t) { - super(e, { - cause: t?.cause, - slug: a$10.RUNTIME_DECRYPTION_FAILED - }), this.name = `RuntimeDecryptionError`, t?.context !== void 0 && (this.context = t.context); - } - static is(e) { - return n$10(e) && e.name === `RuntimeDecryptionError`; - } -}; -var h$9 = class extends o$10 { - hint; - fatal = !0; - constructor(e, t) { - let n = r$13(e, i$11(t?.hint, void 0)); - super(n, { cause: t?.cause }), this.name = `SerializationError`, this.hint = t?.hint; - } - static is(e) { - return n$10(e) && e.name === `SerializationError`; - } -}; -var g$8 = class extends u$10 { - stepName; - constructor(e) { - super(`Step "${e}" is not registered in the current deployment. This usually indicates a build or bundling issue that caused the step to not be included in the deployment.`, { slug: a$10.STEP_NOT_REGISTERED }), this.name = `StepNotRegisteredError`, this.stepName = e; - } - static is(e) { - return n$10(e) && e.name === `StepNotRegisteredError`; - } -}; -var _$7 = class extends u$10 { - workflowName; - constructor(e) { - super(`Workflow "${e}" is not registered in the current deployment. This usually means a run was started against a deployment that does not have this workflow, or there was a build/bundling issue.`, { slug: a$10.WORKFLOW_NOT_REGISTERED }), this.name = `WorkflowNotRegisteredError`, this.workflowName = e; - } - static is(e) { - return n$10(e) && e.name === `WorkflowNotRegisteredError`; - } -}; -var v$8 = class extends o$10 { - runId; - constructor(e) { - super(`Workflow run "${e}" not found`, {}), this.name = `WorkflowRunNotFoundError`, this.runId = e; - } - static is(e) { - return n$10(e) && e.name === `WorkflowRunNotFoundError`; - } -}; -var y$6 = class extends o$10 { - token; - conflictingRunId; - constructor(e, t) { - super(`Hook token "${e}" is already in use by another workflow${t ? ` (run "${t}")` : ``}`, { slug: a$10.HOOK_CONFLICT }), this.name = `HookConflictError`, this.token = e, t !== void 0 && (this.conflictingRunId = t); - } - static is(e) { - return n$10(e) && e.name === `HookConflictError`; - } -}; -var b$9 = class extends o$10 { - token; - constructor(e) { - super(`Hook not found`, {}), this.name = `HookNotFoundError`, this.token = e; - } - static is(e) { - return n$10(e) && e.name === `HookNotFoundError`; - } -}; -var x$9 = class extends s$8 { - constructor(e) { - super(e), this.name = `EntityConflictError`; - } - static is(e) { - return n$10(e) && e.name === `EntityConflictError`; - } -}; -var S$10 = class extends s$8 { - constructor(e) { - super(e), this.name = `RunExpiredError`; - } - static is(e) { - return n$10(e) && e.name === `RunExpiredError`; - } -}; -var C$11 = class extends s$8 { - constructor(e, t) { - super(e, { retryAfter: t?.retryAfter }), this.name = `TooEarlyError`; - } - static is(e) { - return n$10(e) && e.name === `TooEarlyError`; - } -}; -var w$11 = class extends s$8 { - retryAfter; - constructor(e, t) { - super(e), this.name = `ThrottleError`, this.retryAfter = t?.retryAfter; - } - static is(e) { - return n$10(e) && e.name === `ThrottleError`; - } -}; -var T$11 = class extends o$10 { - runId; - constructor(e) { - super(`Workflow run "${e}" cancelled`, {}), this.name = `WorkflowRunCancelledError`, this.runId = e; - } - static is(e) { - return n$10(e) && e.name === `WorkflowRunCancelledError`; - } -}; -var E$11 = class extends o$10 { - runSpecVersion; - worldSpecVersion; - constructor(e, t) { - super(`Run requires spec version ${e}, but world supports version ${t}. Please upgrade 'workflow' package.`), this.name = `RunNotSupportedError`, this.runSpecVersion = e, this.worldSpecVersion = t; - } - static is(e) { - return n$10(e) && e.name === `RunNotSupportedError`; - } -}; -var D$10 = class extends Error { - fatal = !0; - constructor(e) { - super(e), this.name = `FatalError`; - } - static is(e) { - return n$10(e) ? e.name === `FatalError` ? !0 : e.fatal === !0 : !1; - } -}; -var O$8 = class extends Error { - retryAfter; - constructor(t, n = {}) { - super(t), this.name = `RetryableError`, n.retryAfter === void 0 ? this.retryAfter = new Date(Date.now() + 1e3) : this.retryAfter = h$10(n.retryAfter); - } - static is(e) { - return n$10(e) && e.name === `RetryableError`; - } -}; -const A$9 = Symbol.for(`@workflow/errors//FatalError`); -const j$8 = Symbol.for(`@workflow/errors//RetryableError`); -const M$9 = Symbol.for(`@workflow/errors//HookConflictError`); -const N$8 = Symbol.for(`@workflow/errors//RuntimeDecryptionError`); -typeof globalThis < `u` && (Object.hasOwn(globalThis, A$9) || Object.defineProperty(globalThis, A$9, { - value: D$10, - writable: !1, - enumerable: !1, - configurable: !1 -}), Object.hasOwn(globalThis, j$8) || Object.defineProperty(globalThis, j$8, { - value: O$8, - writable: !1, - enumerable: !1, - configurable: !1 -}), Object.hasOwn(globalThis, M$9) || Object.defineProperty(globalThis, M$9, { - value: y$6, - writable: !1, - enumerable: !1, - configurable: !1 -}), Object.hasOwn(globalThis, N$8) || Object.defineProperty(globalThis, N$8, { - value: p$11, - writable: !1, - enumerable: !1, - configurable: !1 -})); -//#endregion -//#region node_modules/eve/dist/src/compiled/@workflow/core/private.js -const t$8 = Symbol.for(`@workflow/core//registeredSteps`); -const n$9 = globalThis; -const r$12 = n$9[t$8] ??= /* @__PURE__ */ new Map(); -const i$10 = /* @__PURE__ */ new Set([ - `__builtin_response_array_buffer`, - `__builtin_response_json`, - `__builtin_response_text` -]); -function a$9(e) { - let t = e.split(`//`); - if (t.length !== 3 || t[0] !== `step`) return []; - let n = t[1], r = t[2], i = /* @__PURE__ */ new Set(), a = (e) => { - e !== n && i.add(e); - }; - if (n.startsWith(`./workflows/`)) { - let e = n.slice(2); - a(`./example/${e}`), a(`./src/${e}`); - } else if (n.startsWith(`./example/workflows/`)) { - let e = n.slice(10); - a(`./${e}`), a(`./src/${e}`); - } else if (n.startsWith(`./src/workflows/`)) { - let e = n.slice(6); - a(`./${e}`), a(`./example/${e}`); - } - return Array.from(i, (e) => `step//${e}//${r}`); -} -function o$9(e) { - if (i$10.has(e)) { - for (let [t, n] of r$12.entries()) if (t.endsWith(`//${e}`)) return n; - } -} -function s$7(e, t) { - r$12.set(e, t), t.stepId = e; -} -function c$8(e) { - let t = r$12.get(e); - if (t) return t; - for (let t of a$9(e)) { - let e = r$12.get(t); - if (e) return e; - } - let n = o$9(e); - if (n) return n; -} -async function l$7(e, t, n) { - if (t === void 0 || !e.pendingDeliveryBarriers || e.pendingDeliveryBarriers.size === 0) return; - let r = []; - for (let [i, a] of e.pendingDeliveryBarriers) i < t && n.includes(a.kind) && r.push(a.delivered); - r.length > 0 && await Promise.all(r); -} -function u$9(t, n, r) { - let i = t.pendingDeliveryBarriers; - if (!i || n === void 0) return { markDelivered: () => {} }; - let a = !1, { promise: o, resolve: s } = f$9(), c = { - kind: r, - delivered: o - }; - i.set(n, c); - let l = () => { - a || (a = !0, i.get(n) === c && i.delete(n), s()); - }; - return d$9(t, l), { markDelivered: l }; -} -function d$9(e, t) { - let n = () => { - e.pendingDeliveries > 0 ? e.promiseQueue.then(() => { - setTimeout(n, 0); - }) : t(); - }; - setTimeout(n, 0); -} -//#endregion -//#region node_modules/eve/dist/src/compiled/_chunks/workflow/attribute-changes-DUxG-Gic.js -var attribute_changes_DUxG_Gic_exports = /* @__PURE__ */ __exportAll({ - $: () => sb, - $n: () => Nf$1, - $t: () => Wv, - A: () => jx, - An: () => xh$1, - At: () => Qv, - B: () => kb, - Bn: () => oh$1, - Bt: () => uy, - C: () => Cx, - Cn: () => Uh$1, - Ct: () => Sy, - D: () => Ix, - Dn: () => Ih$1, - Dt: () => by, - E: () => Nx, - En: () => Ah$1, - Et: () => Oy, - F: () => Hb, - Fn: () => sh$1, - Ft: () => sy, - G: () => lb, - Gn: () => Nm$1, - Gt: () => Yv, - H: () => fb, - Hn: () => eh$1, - Ht: () => py, - I: () => Gb, - In: () => ph$1, - It: () => Kv, - J: () => pb, - Jn: () => jm$1, - Jt: () => ty, - K: () => ub, - Kn: () => q$7, - Kt: () => Xv, - L: () => Ub, - Ln: () => nh$1, - Lt: () => qv, - M: () => Yb, - Mn: () => gh$1, - Mt: () => iy, - N: () => Kb, - Nn: () => _h$1, - Nt: () => ry, - O: () => zx, - On: () => Ch$1, - Ot: () => yy, - P: () => qb, - Pn: () => mh$1, - Pt: () => Zv, - Q: () => Py, - Qn: () => am$1, - Qt: () => Gv, - R: () => Vb, - Rn: () => uh$1, - Rt: () => $v, - S: () => px, - Sn: () => Wh$1, - St: () => my, - T: () => Rx, - Tn: () => Vh$1, - Tt: () => Dy, - U: () => db, - Un: () => $m$1, - Ut: () => ly, - V: () => jb, - Vn: () => ih$1, - Vt: () => dy, - W: () => Sb, - Wn: () => Pm$1, - Wt: () => Jv, - X: () => hb, - Xn: () => wm$1, - Xt: () => ny, - Y: () => vb, - Yn: () => Am$1, - Yt: () => ey, - Z: () => Eb, - Zn: () => bm$1, - Zt: () => cy, - _: () => Mx, - _n: () => T_$1, - _r: () => Te$8, - _t: () => wy, - a: () => Yx, - an: () => N_$1, - ar: () => R$8, - at: () => Hy, - b: () => Ox, - bn: () => y_$1, - bt: () => hy, - c: () => lS, - cn: () => L_$1, - cr: () => Oe$8, - ct: () => Ay, - d: () => fS, - dn: () => M_$1, - dr: () => je$8, - dt: () => ky, - en: () => Q$9, - er: () => Uf$1, - et: () => ob, - f: () => dS, - fn: () => k_$1, - ft: () => qy, - g: () => Lx, - gn: () => E_$1, - gr: () => Ce$8, - gt: () => gy, - h: () => cx, - hn: () => D_$1, - hr: () => we$8, - ht: () => xy, - i: () => pS, - in: () => z_$1, - ir: () => H$8, - it: () => Fy, - j: () => Xb, - jn: () => yh$1, - jt: () => ay, - k: () => kx, - kn: () => bh$1, - kt: () => _y, - l: () => mS, - ln: () => B_$1, - lt: () => jy, - m: () => Kx, - mn: () => O_$1, - mt: () => Yy, - n: () => gS, - nr: () => B$9, - nt: () => Ly, - o: () => eS, - on: () => P_$1, - or: () => Yf$1, - ot: () => Wy, - p: () => qx, - pn: () => j_$1, - pr: () => Ee$8, - pt: () => Jy, - q: () => Tb, - qn: () => Em$1, - qt: () => oy, - r: () => _S, - rn: () => q_$1, - rr: () => V$8, - rt: () => Iy, - s: () => rS, - sn: () => R_$1, - sr: () => ed$2, - st: () => Uy, - t: () => vS, - tn: () => G_$1, - tr: () => bf$1, - tt: () => Gy, - u: () => Qx, - un: () => A_$1, - ut: () => My, - v: () => Fx, - vn: () => g_$1, - vt: () => Cy, - w: () => tx, - wn: () => Bh$1, - wt: () => Ey, - x: () => Ax, - xn: () => p_$1, - xt: () => vy, - y: () => Px, - yn: () => x_$1, - yt: () => Ty, - z: () => Ab, - zn: () => ah$1, - zt: () => fy -}); -function re$6(e, t) { - let n = Error.captureStackTrace; - n?.(e, t); -} -const ie$6 = (() => { - let e = globalThis.process; - return e?.env ? e.env.FORCE_COLOR && e.env.FORCE_COLOR !== `0` ? !0 : e.env.NO_COLOR ? !1 : !!e.stdout?.isTTY : !1; -})(); -const ae$7 = (e, t) => (n) => ie$6 ? `\x1b[${e}m${n}\x1b[${t}m` : n; -const b$8 = { - bold: ae$7(1, 22), - dim: ae$7(2, 22), - italic: ae$7(3, 23), - red: ae$7(31, 39), - blue: ae$7(34, 39), - cyan: ae$7(36, 39), - yellow: ae$7(33, 39), - magenta: ae$7(35, 39) -}; -const oe$7 = { - info: b$8.blue, - help: b$8.cyan, - warn: b$8.yellow, - error: b$8.red -}; -function se$8(e) { - let t = Array.isArray(e) ? e.join(` -`) : e; - return oe$7.info(`${b$8.bold(`hint:`)} ${t}`); -} -function ce$8(e) { - return oe$7.info(`${b$8.bold(`docs:`)} ${e}`); -} -function le$8(e) { - return b$8.italic(`${b$8.dim("`")}${e}${b$8.dim("`")}`); -} -function ue$8(e) { - return b$8.dim(e); -} -function de$8(e) { - return b$8.bold(e); -} -function fe$8(e) { - return b$8.red(e); -} -function pe$8(e) { - return b$8.magenta(e); -} -function me$8(e, t) { - let n = [e]; - return t.forEach((e, r) => { - let i = e.split(` -`), a = r === t.length - 1, o = a ? `╰▶ ` : `├▶ `, s = a ? ` ` : `│ `, c = i.map((e, t) => `${t === 0 ? o : s}${e}`); - n.push(...c); - }), n.join(` -`); -} -const he$8 = Symbol.for(`nodejs.util.inspect.custom`); -function ge$8(e) { - return `code` in e ? `\`${e.code}\`` : `dim` in e ? e.dim : e.text; -} -function _e$8(e) { - return `code` in e ? le$8(e.code) : `dim` in e ? ue$8(e.dim) : e.text; -} -function ve$8(e) { - return e.type === `docs` ? `docs: ${e.url}` : e.segments.map(ge$8).join(``); -} -function ye$8(e) { - return e.type === `docs` ? ce$8(e.url) : e.segments.map(_e$8).join(``); -} -function be$8(e) { - let t = [e.title.map(ge$8).join(``)]; - return e.details.forEach((n, r) => { - let i = r === e.details.length - 1, a = i ? `╰▶ ` : `├▶ `, o = i ? ` ` : `│ `; - ve$8(n).split(` -`).forEach((e, n) => t.push(`${n === 0 ? a : o}${e}`)); - }), t.join(` -`); -} -function xe$8(e) { - return me$8(e.title.map(_e$8).join(``), e.details.map(ye$8)); -} -var Se$8 = class extends Error { - fatal = !0; - #e; - constructor(e) { - super(be$8(e)), this.#e = e; - } - [he$8]() { - let e = xe$8(this.#e), t = this.message.split(` -`).length, n = (this.stack ?? ``).split(` -`).slice(t).join(` -`); - return n ? `${this.name}: ${e}\n${n}` : `${this.name}: ${e}`; - } - toString() { - return `${this.name}: ${xe$8(this.#e)}`; - } -}; -var Ce$8 = class extends Se$8 { - name = `NotInWorkflowContextError`; - constructor(e, t) { - super({ - title: [{ code: e }, { text: ` can only be called inside a workflow function` }], - details: [{ - type: `docs`, - url: t - }] - }); - } -}; -var we$8 = class extends Se$8 { - name = `NotInStepContextError`; - constructor(e, t) { - super({ - title: [{ code: e }, { text: ` can only be called inside a step function` }], - details: [{ - type: `docs`, - url: t - }] - }); - } -}; -var Te$8 = class extends Se$8 { - name = `NotInWorkflowOrStepContextError`; - constructor(e, t) { - super({ - title: [{ code: e }, { text: ` can only be called inside a workflow or step function` }], - details: [{ - type: `docs`, - url: t - }] - }); - } -}; -const Ee$8 = Symbol.for(`WORKFLOW_CONTEXT`); -var Oe$8 = class extends Se$8 { - name = `UnavailableInWorkflowContextError`; - constructor(e, t) { - let n = globalThis[Ee$8]?.workflowName, r = (() => { - if (!n) return null; - let e = n.match(/^(workflow\/|step\/)(.*)$/); - return e ? [{ dim: e[1] }, { text: e[2] }] : [{ text: n }]; - })(), i = r ? { - type: `plain`, - segments: [ - { text: `this call was made from the ` }, - ...r, - { text: ` workflow context.` } - ] - } : { - type: `plain`, - segments: [{ text: `this call was made from a workflow context.` }] - }; - super({ - title: [{ code: e }, { text: ` cannot be called from a workflow context.` }], - details: [ - { - type: `plain`, - segments: [{ text: `calling this in a workflow context can cause determinism issues.` }] - }, - i, - { - type: `docs`, - url: t - } - ] - }); - } -}; -function je$8(e, t, n) { - let r = new Te$8(e, t); - throw re$6(r, n), r; -} -const Ne$8 = Object.freeze({ status: `aborted` }); -function x$8(e, t, n) { - function r(n, r) { - if (n._zod || Object.defineProperty(n, "_zod", { - value: { - def: r, - constr: o, - traits: /* @__PURE__ */ new Set() - }, - enumerable: !1 - }), n._zod.traits.has(e)) return; - n._zod.traits.add(e), t(n, r); - let i = o.prototype, a = Object.keys(i); - for (let e = 0; e < a.length; e++) { - let t = a[e]; - t in n || (n[t] = i[t].bind(n)); - } - } - let i = n?.Parent ?? Object; - class a extends i {} - Object.defineProperty(a, "name", { value: e }); - function o(e) { - var t; - let i = n?.Parent ? new a() : this; - r(i, e), (t = i._zod).deferred ?? (t.deferred = []); - for (let e of i._zod.deferred) e(); - return i; - } - return Object.defineProperty(o, "init", { value: r }), Object.defineProperty(o, Symbol.hasInstance, { value: (t) => n?.Parent && t instanceof n.Parent ? !0 : t?._zod?.traits?.has(e) }), Object.defineProperty(o, "name", { value: e }), o; -} -const Pe$8 = Symbol(`zod_brand`); -var Fe$8 = class extends Error { - constructor() { - super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`); - } -}; -var Ie$8 = class extends Error { - constructor(e) { - super(`Encountered unidirectional transform during encode: ${e}`), this.name = `ZodEncodeError`; - } -}; -const Le$8 = {}; -function S$9(e) { - return e && Object.assign(Le$8, e), Le$8; -} -var Re$8 = l$11({ - BIGINT_FORMAT_RANGES: () => bt$7, - Class: () => Ht$6, - NUMBER_FORMAT_RANGES: () => yt$7, - aborted: () => Ot$7, - allowsEval: () => ct$7, - assert: () => Ue$8, - assertEqual: () => ze$8, - assertIs: () => Ve$8, - assertNever: () => He$8, - assertNotEqual: () => Be$8, - assignProp: () => Qe$8, - base64ToUint8Array: () => It$5, - base64urlToUint8Array: () => Rt$5, - cached: () => Ke$8, - captureStackTrace: () => ot$7, - cleanEnum: () => Ft$6, - cleanRegex: () => Je$8, - clone: () => gt$7, - cloneDef: () => et$8, - createTransparentProxy: () => _t$7, - defineLazy: () => w$10, - esc: () => it$7, - escapeRegex: () => ht$7, - extend: () => Ct$7, - finalizeIssue: () => jt$7, - floatSafeRemainder: () => Ye$8, - getElementAtPath: () => tt$8, - getEnumValues: () => We$8, - getLengthableOrigin: () => Nt$6, - getParsedType: () => ft$7, - getSizableOrigin: () => Mt$7, - hexToUint8Array: () => Bt$5, - isObject: () => st$7, - isPlainObject: () => lt$7, - issue: () => Pt$6, - joinValues: () => C$10, - jsonStringifyReplacer: () => Ge$8, - merge: () => Tt$7, - mergeDefs: () => $e$8, - normalizeParams: () => T$10, - nullish: () => qe$8, - numKeys: () => dt$7, - objectClone: () => Ze$8, - omit: () => St$7, - optionalKeys: () => vt$7, - parsedType: () => D$9, - partial: () => Et$7, - pick: () => xt$7, - prefixIssues: () => kt$7, - primitiveTypes: () => mt$7, - promiseAllObject: () => nt$8, - propertyKeyTypes: () => pt$7, - randomString: () => rt$7, - required: () => Dt$7, - safeExtend: () => wt$7, - shallowClone: () => ut$7, - slugify: () => at$7, - stringifyPrimitive: () => E$10, - uint8ArrayToBase64: () => Lt$6, - uint8ArrayToBase64url: () => zt$6, - uint8ArrayToHex: () => Vt$6, - unwrapMessage: () => At$7 -}); -function ze$8(e) { - return e; -} -function Be$8(e) { - return e; -} -function Ve$8(e) {} -function He$8(e) { - throw Error(`Unexpected value in exhaustive check`); -} -function Ue$8(e) {} -function We$8(e) { - let t = Object.values(e).filter((e) => typeof e == `number`); - return Object.entries(e).filter(([e, n]) => t.indexOf(+e) === -1).map(([e, t]) => t); -} -function C$10(e, t = `|`) { - return e.map((e) => E$10(e)).join(t); -} -function Ge$8(e, t) { - return typeof t == `bigint` ? t.toString() : t; -} -function Ke$8(e) { - return { get value() { - { - let t = e(); - return Object.defineProperty(this, "value", { value: t }), t; - } - } }; -} -function qe$8(e) { - return e == null; -} -function Je$8(e) { - let t = +!!e.startsWith(`^`), n = e.endsWith(`$`) ? e.length - 1 : e.length; - return e.slice(t, n); -} -function Ye$8(e, t) { - let n = (e.toString().split(`.`)[1] || ``).length, r = t.toString(), i = (r.split(`.`)[1] || ``).length; - if (i === 0 && /\d?e-\d?/.test(r)) { - let e = r.match(/\d?e-(\d?)/); - e?.[1] && (i = Number.parseInt(e[1])); - } - let a = n > i ? n : i; - return Number.parseInt(e.toFixed(a).replace(`.`, ``)) % Number.parseInt(t.toFixed(a).replace(`.`, ``)) / 10 ** a; -} -const Xe$8 = Symbol(`evaluating`); -function w$10(e, t, n) { - let r; - Object.defineProperty(e, t, { - get() { - if (r !== Xe$8) return r === void 0 && (r = Xe$8, r = n()), r; - }, - set(n) { - Object.defineProperty(e, t, { value: n }); - }, - configurable: !0 - }); -} -function Ze$8(e) { - return Object.create(Object.getPrototypeOf(e), Object.getOwnPropertyDescriptors(e)); -} -function Qe$8(e, t, n) { - Object.defineProperty(e, t, { - value: n, - writable: !0, - enumerable: !0, - configurable: !0 - }); -} -function $e$8(...e) { - let t = {}; - for (let n of e) Object.assign(t, Object.getOwnPropertyDescriptors(n)); - return Object.defineProperties({}, t); -} -function et$8(e) { - return $e$8(e._zod.def); -} -function tt$8(e, t) { - return t ? t.reduce((e, t) => e?.[t], e) : e; -} -function nt$8(e) { - let t = Object.keys(e), n = t.map((t) => e[t]); - return Promise.all(n).then((e) => { - let n = {}; - for (let r = 0; r < t.length; r++) n[t[r]] = e[r]; - return n; - }); -} -function rt$7(e = 10) { - let t = ``; - for (let n = 0; n < e; n++) t += `abcdefghijklmnopqrstuvwxyz`[Math.floor(Math.random() * 26)]; - return t; -} -function it$7(e) { - return JSON.stringify(e); -} -function at$7(e) { - return e.toLowerCase().trim().replace(/[^\w\s-]/g, ``).replace(/[\s_-]+/g, `-`).replace(/^-+|-+$/g, ``); -} -const ot$7 = `captureStackTrace` in Error ? Error.captureStackTrace : (...e) => {}; -function st$7(e) { - return typeof e == `object` && !!e && !Array.isArray(e); -} -const ct$7 = Ke$8(() => { - if (typeof navigator < `u` && navigator?.userAgent?.includes(`Cloudflare`)) return !1; - try { - return Function(``), !0; - } catch { - return !1; - } -}); -function lt$7(e) { - if (st$7(e) === !1) return !1; - let t = e.constructor; - if (t === void 0 || typeof t != `function`) return !0; - let n = t.prototype; - return !(st$7(n) === !1 || Object.prototype.hasOwnProperty.call(n, `isPrototypeOf`) === !1); -} -function ut$7(e) { - return lt$7(e) ? { ...e } : Array.isArray(e) ? [...e] : e; -} -function dt$7(e) { - let t = 0; - for (let n in e) Object.prototype.hasOwnProperty.call(e, n) && t++; - return t; -} -const ft$7 = (e) => { - let t = typeof e; - switch (t) { - case `undefined`: return `undefined`; - case `string`: return `string`; - case `number`: return Number.isNaN(e) ? `nan` : `number`; - case `boolean`: return `boolean`; - case `function`: return `function`; - case `bigint`: return `bigint`; - case `symbol`: return `symbol`; - case `object`: return Array.isArray(e) ? `array` : e === null ? `null` : e.then && typeof e.then == `function` && e.catch && typeof e.catch == `function` ? `promise` : typeof Map < `u` && e instanceof Map ? `map` : typeof Set < `u` && e instanceof Set ? `set` : typeof Date < `u` && e instanceof Date ? `date` : typeof File < `u` && e instanceof File ? `file` : `object`; - default: throw Error(`Unknown data type: ${t}`); - } -}; -const pt$7 = /* @__PURE__ */ new Set([ - `string`, - `number`, - `symbol` -]); -const mt$7 = /* @__PURE__ */ new Set([ - `string`, - `number`, - `bigint`, - `boolean`, - `symbol`, - `undefined` -]); -function ht$7(e) { - return e.replace(/[.*+?^${}()|[\]\\]/g, `\\$&`); -} -function gt$7(e, t, n) { - let r = new e._zod.constr(t ?? e._zod.def); - return (!t || n?.parent) && (r._zod.parent = e), r; -} -function T$10(e) { - let t = e; - if (!t) return {}; - if (typeof t == `string`) return { error: () => t }; - if (t?.message !== void 0) { - if (t?.error !== void 0) throw Error("Cannot specify both `message` and `error` params"); - t.error = t.message; - } - return delete t.message, typeof t.error == `string` ? { - ...t, - error: () => t.error - } : t; -} -function _t$7(e) { - let t; - return new Proxy({}, { - get(n, r, i) { - return t ??= e(), Reflect.get(t, r, i); - }, - set(n, r, i, a) { - return t ??= e(), Reflect.set(t, r, i, a); - }, - has(n, r) { - return t ??= e(), Reflect.has(t, r); - }, - deleteProperty(n, r) { - return t ??= e(), Reflect.deleteProperty(t, r); - }, - ownKeys(n) { - return t ??= e(), Reflect.ownKeys(t); - }, - getOwnPropertyDescriptor(n, r) { - return t ??= e(), Reflect.getOwnPropertyDescriptor(t, r); - }, - defineProperty(n, r, i) { - return t ??= e(), Reflect.defineProperty(t, r, i); - } - }); -} -function E$10(e) { - return typeof e == `bigint` ? e.toString() + `n` : typeof e == `string` ? `"${e}"` : `${e}`; -} -function vt$7(e) { - return Object.keys(e).filter((t) => e[t]._zod.optin === `optional` && e[t]._zod.optout === `optional`); -} -const yt$7 = { - safeint: [-(2 ** 53 - 1), 2 ** 53 - 1], - int32: [-2147483648, 2147483647], - uint32: [0, 4294967295], - float32: [-34028234663852886e22, 34028234663852886e22], - float64: [-Number.MAX_VALUE, Number.MAX_VALUE] -}; -const bt$7 = { - int64: [BigInt(`-9223372036854775808`), BigInt(`9223372036854775807`)], - uint64: [BigInt(0), BigInt(`18446744073709551615`)] -}; -function xt$7(e, t) { - let n = e._zod.def, r = n.checks; - if (r && r.length > 0) throw Error(`.pick() cannot be used on object schemas containing refinements`); - return gt$7(e, $e$8(e._zod.def, { - get shape() { - let e = {}; - for (let r in t) { - if (!(r in n.shape)) throw Error(`Unrecognized key: "${r}"`); - t[r] && (e[r] = n.shape[r]); - } - return Qe$8(this, `shape`, e), e; - }, - checks: [] - })); -} -function St$7(e, t) { - let n = e._zod.def, r = n.checks; - if (r && r.length > 0) throw Error(`.omit() cannot be used on object schemas containing refinements`); - return gt$7(e, $e$8(e._zod.def, { - get shape() { - let r = { ...e._zod.def.shape }; - for (let e in t) { - if (!(e in n.shape)) throw Error(`Unrecognized key: "${e}"`); - t[e] && delete r[e]; - } - return Qe$8(this, `shape`, r), r; - }, - checks: [] - })); -} -function Ct$7(e, t) { - if (!lt$7(t)) throw Error(`Invalid input to extend: expected a plain object`); - let n = e._zod.def.checks; - if (n && n.length > 0) { - let n = e._zod.def.shape; - for (let e in t) if (Object.getOwnPropertyDescriptor(n, e) !== void 0) throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead."); - } - return gt$7(e, $e$8(e._zod.def, { get shape() { - let n = { - ...e._zod.def.shape, - ...t - }; - return Qe$8(this, `shape`, n), n; - } })); -} -function wt$7(e, t) { - if (!lt$7(t)) throw Error(`Invalid input to safeExtend: expected a plain object`); - return gt$7(e, $e$8(e._zod.def, { get shape() { - let n = { - ...e._zod.def.shape, - ...t - }; - return Qe$8(this, `shape`, n), n; - } })); -} -function Tt$7(e, t) { - return gt$7(e, $e$8(e._zod.def, { - get shape() { - let n = { - ...e._zod.def.shape, - ...t._zod.def.shape - }; - return Qe$8(this, `shape`, n), n; - }, - get catchall() { - return t._zod.def.catchall; - }, - checks: [] - })); -} -function Et$7(e, t, n) { - let r = t._zod.def.checks; - if (r && r.length > 0) throw Error(`.partial() cannot be used on object schemas containing refinements`); - return gt$7(t, $e$8(t._zod.def, { - get shape() { - let r = t._zod.def.shape, i = { ...r }; - if (n) for (let t in n) { - if (!(t in r)) throw Error(`Unrecognized key: "${t}"`); - n[t] && (i[t] = e ? new e({ - type: `optional`, - innerType: r[t] - }) : r[t]); - } - else for (let t in r) i[t] = e ? new e({ - type: `optional`, - innerType: r[t] - }) : r[t]; - return Qe$8(this, `shape`, i), i; - }, - checks: [] - })); -} -function Dt$7(e, t, n) { - return gt$7(t, $e$8(t._zod.def, { get shape() { - let r = t._zod.def.shape, i = { ...r }; - if (n) for (let t in n) { - if (!(t in i)) throw Error(`Unrecognized key: "${t}"`); - n[t] && (i[t] = new e({ - type: `nonoptional`, - innerType: r[t] - })); - } - else for (let t in r) i[t] = new e({ - type: `nonoptional`, - innerType: r[t] - }); - return Qe$8(this, `shape`, i), i; - } })); -} -function Ot$7(e, t = 0) { - if (e.aborted === !0) return !0; - for (let n = t; n < e.issues.length; n++) if (e.issues[n]?.continue !== !0) return !0; - return !1; -} -function kt$7(e, t) { - return t.map((t) => { - var n; - return (n = t).path ?? (n.path = []), t.path.unshift(e), t; - }); -} -function At$7(e) { - return typeof e == `string` ? e : e?.message; -} -function jt$7(e, t, n) { - let r = { - ...e, - path: e.path ?? [] - }; - return e.message || (r.message = At$7(e.inst?._zod.def?.error?.(e)) ?? At$7(t?.error?.(e)) ?? At$7(n.customError?.(e)) ?? At$7(n.localeError?.(e)) ?? `Invalid input`), delete r.inst, delete r.continue, t?.reportInput || delete r.input, r; -} -function Mt$7(e) { - return e instanceof Set ? `set` : e instanceof Map ? `map` : e instanceof File ? `file` : `unknown`; -} -function Nt$6(e) { - return Array.isArray(e) ? `array` : typeof e == `string` ? `string` : `unknown`; -} -function D$9(e) { - let t = typeof e; - switch (t) { - case `number`: return Number.isNaN(e) ? `nan` : `number`; - case `object`: { - if (e === null) return `null`; - if (Array.isArray(e)) return `array`; - let t = e; - if (t && Object.getPrototypeOf(t) !== Object.prototype && `constructor` in t && t.constructor) return t.constructor.name; - } - } - return t; -} -function Pt$6(...e) { - let [t, n, r] = e; - return typeof t == `string` ? { - message: t, - code: `custom`, - input: n, - inst: r - } : { ...t }; -} -function Ft$6(e) { - return Object.entries(e).filter(([e, t]) => Number.isNaN(Number.parseInt(e, 10))).map((e) => e[1]); -} -function It$5(e) { - let t = atob(e), n = new Uint8Array(t.length); - for (let e = 0; e < t.length; e++) n[e] = t.charCodeAt(e); - return n; -} -function Lt$6(e) { - let t = ``; - for (let n = 0; n < e.length; n++) t += String.fromCharCode(e[n]); - return btoa(t); -} -function Rt$5(e) { - let t = e.replace(/-/g, `+`).replace(/_/g, `/`); - return It$5(t + `=`.repeat((4 - t.length % 4) % 4)); -} -function zt$6(e) { - return Lt$6(e).replace(/\+/g, `-`).replace(/\//g, `_`).replace(/=/g, ``); -} -function Bt$5(e) { - let t = e.replace(/^0x/, ``); - if (t.length % 2 != 0) throw Error(`Invalid hex string length`); - let n = new Uint8Array(t.length / 2); - for (let e = 0; e < t.length; e += 2) n[e / 2] = Number.parseInt(t.slice(e, e + 2), 16); - return n; -} -function Vt$6(e) { - return Array.from(e).map((e) => e.toString(16).padStart(2, `0`)).join(``); -} -var Ht$6 = class { - constructor(...e) {} -}; -const Ut$5 = (e, t) => { - e.name = `$ZodError`, Object.defineProperty(e, "_zod", { - value: e._zod, - enumerable: !1 - }), Object.defineProperty(e, "issues", { - value: t, - enumerable: !1 - }), e.message = JSON.stringify(t, Ge$8, 2), Object.defineProperty(e, "toString", { - value: () => e.message, - enumerable: !1 - }); -}; -const Wt$5 = x$8(`$ZodError`, Ut$5); -const O$7 = x$8(`$ZodError`, Ut$5, { Parent: Error }); -function Gt$5(e, t = (e) => e.message) { - let n = {}, r = []; - for (let i of e.issues) i.path.length > 0 ? (n[i.path[0]] = n[i.path[0]] || [], n[i.path[0]].push(t(i))) : r.push(t(i)); - return { - formErrors: r, - fieldErrors: n - }; -} -function Kt$6(e, t = (e) => e.message) { - let n = { _errors: [] }, r = (e) => { - for (let i of e.issues) if (i.code === `invalid_union` && i.errors.length) i.errors.map((e) => r({ issues: e })); - else if (i.code === `invalid_key`) r({ issues: i.issues }); - else if (i.code === `invalid_element`) r({ issues: i.issues }); - else if (i.path.length === 0) n._errors.push(t(i)); - else { - let e = n, r = 0; - for (; r < i.path.length;) { - let n = i.path[r]; - r === i.path.length - 1 ? (e[n] = e[n] || { _errors: [] }, e[n]._errors.push(t(i))) : e[n] = e[n] || { _errors: [] }, e = e[n], r++; - } - } - }; - return r(e), n; -} -function qt$6(e, t = (e) => e.message) { - let n = { errors: [] }, r = (e, i = []) => { - var a, o; - for (let s of e.issues) if (s.code === `invalid_union` && s.errors.length) s.errors.map((e) => r({ issues: e }, s.path)); - else if (s.code === `invalid_key`) r({ issues: s.issues }, s.path); - else if (s.code === `invalid_element`) r({ issues: s.issues }, s.path); - else { - let e = [...i, ...s.path]; - if (e.length === 0) { - n.errors.push(t(s)); - continue; - } - let r = n, c = 0; - for (; c < e.length;) { - let n = e[c], i = c === e.length - 1; - typeof n == `string` ? (r.properties ??= {}, (a = r.properties)[n] ?? (a[n] = { errors: [] }), r = r.properties[n]) : (r.items ??= [], (o = r.items)[n] ?? (o[n] = { errors: [] }), r = r.items[n]), i && r.errors.push(t(s)), c++; - } - } - }; - return r(e), n; -} -function Jt$6(e) { - let t = [], n = e.map((e) => typeof e == `object` ? e.key : e); - for (let e of n) typeof e == `number` ? t.push(`[${e}]`) : typeof e == `symbol` ? t.push(`[${JSON.stringify(String(e))}]`) : /[^\w$]/.test(e) ? t.push(`[${JSON.stringify(e)}]`) : (t.length && t.push(`.`), t.push(e)); - return t.join(``); -} -function Yt$5(e) { - let t = [], n = [...e.issues].sort((e, t) => (e.path ?? []).length - (t.path ?? []).length); - for (let e of n) t.push(`✖ ${e.message}`), e.path?.length && t.push(` → at ${Jt$6(e.path)}`); - return t.join(` -`); -} -const Xt$5 = (e) => (t, n, r, i) => { - let a = r ? Object.assign(r, { async: !1 }) : { async: !1 }, o = t._zod.run({ - value: n, - issues: [] - }, a); - if (o instanceof Promise) throw new Fe$8(); - if (o.issues.length) { - let t = new ((i?.Err) ?? e)(o.issues.map((e) => jt$7(e, a, S$9()))); - throw ot$7(t, i?.callee), t; - } - return o.value; -}; -const Zt$5 = Xt$5(O$7); -const Qt$5 = (e) => async (t, n, r, i) => { - let a = r ? Object.assign(r, { async: !0 }) : { async: !0 }, o = t._zod.run({ - value: n, - issues: [] - }, a); - if (o instanceof Promise && (o = await o), o.issues.length) { - let t = new ((i?.Err) ?? e)(o.issues.map((e) => jt$7(e, a, S$9()))); - throw ot$7(t, i?.callee), t; - } - return o.value; -}; -const $t$5 = Qt$5(O$7); -const en$5 = (e) => (t, n, r) => { - let i = r ? { - ...r, - async: !1 - } : { async: !1 }, a = t._zod.run({ - value: n, - issues: [] - }, i); - if (a instanceof Promise) throw new Fe$8(); - return a.issues.length ? { - success: !1, - error: new (e ?? Wt$5)(a.issues.map((e) => jt$7(e, i, S$9()))) - } : { - success: !0, - data: a.value - }; -}; -const tn$5 = en$5(O$7); -const nn$5 = (e) => async (t, n, r) => { - let i = r ? Object.assign(r, { async: !0 }) : { async: !0 }, a = t._zod.run({ - value: n, - issues: [] - }, i); - return a instanceof Promise && (a = await a), a.issues.length ? { - success: !1, - error: new e(a.issues.map((e) => jt$7(e, i, S$9()))) - } : { - success: !0, - data: a.value - }; -}; -const rn$5 = nn$5(O$7); -const an$5 = (e) => (t, n, r) => { - let i = r ? Object.assign(r, { direction: `backward` }) : { direction: `backward` }; - return Xt$5(e)(t, n, i); -}; -const on$5 = an$5(O$7); -const sn$5 = (e) => (t, n, r) => Xt$5(e)(t, n, r); -const cn$5 = sn$5(O$7); -const ln$5 = (e) => async (t, n, r) => { - let i = r ? Object.assign(r, { direction: `backward` }) : { direction: `backward` }; - return Qt$5(e)(t, n, i); -}; -const un$5 = ln$5(O$7); -const dn$5 = (e) => async (t, n, r) => Qt$5(e)(t, n, r); -const fn$5 = dn$5(O$7); -const pn$5 = (e) => (t, n, r) => { - let i = r ? Object.assign(r, { direction: `backward` }) : { direction: `backward` }; - return en$5(e)(t, n, i); -}; -const mn$5 = pn$5(O$7); -const hn$5 = (e) => (t, n, r) => en$5(e)(t, n, r); -const gn$5 = hn$5(O$7); -const _n$5 = (e) => async (t, n, r) => { - let i = r ? Object.assign(r, { direction: `backward` }) : { direction: `backward` }; - return nn$5(e)(t, n, i); -}; -const vn$5 = _n$5(O$7); -const yn$5 = (e) => async (t, n, r) => nn$5(e)(t, n, r); -const bn$5 = yn$5(O$7); -var xn$4 = l$11({ - base64: () => qn$3, - base64url: () => Jn$3, - bigint: () => ir$3, - boolean: () => sr$3, - browserEmail: () => Bn$3, - cidrv4: () => Gn$3, - cidrv6: () => Kn$3, - cuid: () => Sn$4, - cuid2: () => Cn$4, - date: () => $n$3, - datetime: () => nr$3, - domain: () => Xn$4, - duration: () => On$4, - e164: () => Zn$3, - email: () => Fn$3, - emoji: () => Vn$3, - extendedDuration: () => kn$4, - guid: () => An$4, - hex: () => fr$3, - hostname: () => Yn$3, - html5Email: () => In$3, - idnEmail: () => zn$3, - integer: () => ar$3, - ipv4: () => Hn$3, - ipv6: () => Un$3, - ksuid: () => En$4, - lowercase: () => ur$4, - mac: () => Wn$3, - md5_base64: () => gr$3, - md5_base64url: () => _r$4, - md5_hex: () => hr$3, - nanoid: () => Dn$4, - null: () => cr$3, - number: () => or$3, - rfc5322Email: () => Ln$3, - sha1_base64: () => yr$4, - sha1_base64url: () => br$4, - sha1_hex: () => vr$4, - sha256_base64: () => Sr$4, - sha256_base64url: () => Cr$4, - sha256_hex: () => xr$4, - sha384_base64: () => Tr$4, - sha384_base64url: () => Er$4, - sha384_hex: () => wr$4, - sha512_base64: () => Or$4, - sha512_base64url: () => kr$4, - sha512_hex: () => Dr$4, - string: () => rr$3, - time: () => tr$3, - ulid: () => wn$4, - undefined: () => lr$4, - unicodeEmail: () => Rn$3, - uppercase: () => dr$4, - uuid: () => jn$4, - uuid4: () => Mn$4, - uuid6: () => Nn$4, - uuid7: () => Pn$4, - xid: () => Tn$4 -}); -const Sn$4 = /^[cC][^\s-]{8,}$/; -const Cn$4 = /^[0-9a-z]+$/; -const wn$4 = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/; -const Tn$4 = /^[0-9a-vA-V]{20}$/; -const En$4 = /^[A-Za-z0-9]{27}$/; -const Dn$4 = /^[a-zA-Z0-9_-]{21}$/; -const On$4 = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/; -const kn$4 = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/; -const An$4 = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/; -const jn$4 = (e) => e ? RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`) : /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/; -const Mn$4 = jn$4(4); -const Nn$4 = jn$4(6); -const Pn$4 = jn$4(7); -const Fn$3 = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/; -const In$3 = /^[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])?)*$/; -const Ln$3 = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; -const Rn$3 = /^[^\s@"]{1,64}@[^\s@]{1,255}$/u; -const zn$3 = Rn$3; -const Bn$3 = /^[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])?)*$/; -function Vn$3() { - return RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`, `u`); -} -const Hn$3 = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/; -const Un$3 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/; -const Wn$3 = (e) => { - let t = ht$7(e ?? `:`); - return RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`); -}; -const Gn$3 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/; -const Kn$3 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/; -const qn$3 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/; -const Jn$3 = /^[A-Za-z0-9_-]*$/; -const Yn$3 = /^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/; -const Xn$4 = /^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/; -const Zn$3 = /^\+[1-9]\d{6,14}$/; -const Qn$3 = `(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`; -const $n$3 = RegExp(`^${Qn$3}$`); -function er$3(e) { - let t = `(?:[01]\\d|2[0-3]):[0-5]\\d`; - return typeof e.precision == `number` ? e.precision === -1 ? `${t}` : e.precision === 0 ? `${t}:[0-5]\\d` : `${t}:[0-5]\\d\\.\\d{${e.precision}}` : `${t}(?::[0-5]\\d(?:\\.\\d+)?)?`; -} -function tr$3(e) { - return RegExp(`^${er$3(e)}$`); -} -function nr$3(e) { - let t = er$3({ precision: e.precision }), n = [`Z`]; - e.local && n.push(``), e.offset && n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`); - let r = `${t}(?:${n.join(`|`)})`; - return RegExp(`^${Qn$3}T(?:${r})$`); -} -const rr$3 = (e) => { - let t = e ? `[\\s\\S]{${e?.minimum ?? 0},${e?.maximum ?? ``}}` : `[\\s\\S]*`; - return RegExp(`^${t}$`); -}; -const ir$3 = /^-?\d+n?$/; -const ar$3 = /^-?\d+$/; -const or$3 = /^-?\d+(?:\.\d+)?$/; -const sr$3 = /^(?:true|false)$/i; -const cr$3 = /^null$/i; -const lr$4 = /^undefined$/i; -const ur$4 = /^[^A-Z]*$/; -const dr$4 = /^[^a-z]*$/; -const fr$3 = /^[0-9a-fA-F]*$/; -function pr$4(e, t) { - return RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`); -} -function mr$3(e) { - return RegExp(`^[A-Za-z0-9_-]{${e}}$`); -} -const hr$3 = /^[0-9a-fA-F]{32}$/; -const gr$3 = pr$4(22, `==`); -const _r$4 = mr$3(22); -const vr$4 = /^[0-9a-fA-F]{40}$/; -const yr$4 = pr$4(27, `=`); -const br$4 = mr$3(27); -const xr$4 = /^[0-9a-fA-F]{64}$/; -const Sr$4 = pr$4(43, `=`); -const Cr$4 = mr$3(43); -const wr$4 = /^[0-9a-fA-F]{96}$/; -const Tr$4 = pr$4(64, ``); -const Er$4 = mr$3(64); -const Dr$4 = /^[0-9a-fA-F]{128}$/; -const Or$4 = pr$4(86, `==`); -const kr$4 = mr$3(86); -const k$9 = x$8(`$ZodCheck`, (e, t) => { - var n; - e._zod ??= {}, e._zod.def = t, (n = e._zod).onattach ?? (n.onattach = []); -}); -const Ar$4 = { - number: `number`, - bigint: `bigint`, - object: `date` -}; -const jr$4 = x$8(`$ZodCheckLessThan`, (e, t) => { - k$9.init(e, t); - let n = Ar$4[typeof t.value]; - e._zod.onattach.push((e) => { - let n = e._zod.bag, r = (t.inclusive ? n.maximum : n.exclusiveMaximum) ?? Infinity; - t.value < r && (t.inclusive ? n.maximum = t.value : n.exclusiveMaximum = t.value); - }), e._zod.check = (r) => { - (t.inclusive ? r.value <= t.value : r.value < t.value) || r.issues.push({ - origin: n, - code: `too_big`, - maximum: typeof t.value == `object` ? t.value.getTime() : t.value, - input: r.value, - inclusive: t.inclusive, - inst: e, - continue: !t.abort - }); - }; -}); -const Mr$4 = x$8(`$ZodCheckGreaterThan`, (e, t) => { - k$9.init(e, t); - let n = Ar$4[typeof t.value]; - e._zod.onattach.push((e) => { - let n = e._zod.bag, r = (t.inclusive ? n.minimum : n.exclusiveMinimum) ?? -Infinity; - t.value > r && (t.inclusive ? n.minimum = t.value : n.exclusiveMinimum = t.value); - }), e._zod.check = (r) => { - (t.inclusive ? r.value >= t.value : r.value > t.value) || r.issues.push({ - origin: n, - code: `too_small`, - minimum: typeof t.value == `object` ? t.value.getTime() : t.value, - input: r.value, - inclusive: t.inclusive, - inst: e, - continue: !t.abort - }); - }; -}); -const Nr$4 = x$8(`$ZodCheckMultipleOf`, (e, t) => { - k$9.init(e, t), e._zod.onattach.push((e) => { - var n; - (n = e._zod.bag).multipleOf ?? (n.multipleOf = t.value); - }), e._zod.check = (n) => { - if (typeof n.value != typeof t.value) throw Error(`Cannot mix number and bigint in multiple_of check.`); - (typeof n.value == `bigint` ? n.value % t.value === BigInt(0) : Ye$8(n.value, t.value) === 0) || n.issues.push({ - origin: typeof n.value, - code: `not_multiple_of`, - divisor: t.value, - input: n.value, - inst: e, - continue: !t.abort - }); - }; -}); -const Pr$4 = x$8(`$ZodCheckNumberFormat`, (e, t) => { - k$9.init(e, t), t.format = t.format || `float64`; - let n = t.format?.includes(`int`), r = n ? `int` : `number`, [i, a] = yt$7[t.format]; - e._zod.onattach.push((e) => { - let r = e._zod.bag; - r.format = t.format, r.minimum = i, r.maximum = a, n && (r.pattern = ar$3); - }), e._zod.check = (o) => { - let s = o.value; - if (n) { - if (!Number.isInteger(s)) { - o.issues.push({ - expected: r, - format: t.format, - code: `invalid_type`, - continue: !1, - input: s, - inst: e - }); - return; - } - if (!Number.isSafeInteger(s)) { - s > 0 ? o.issues.push({ - input: s, - code: `too_big`, - maximum: 2 ** 53 - 1, - note: `Integers must be within the safe integer range.`, - inst: e, - origin: r, - inclusive: !0, - continue: !t.abort - }) : o.issues.push({ - input: s, - code: `too_small`, - minimum: -(2 ** 53 - 1), - note: `Integers must be within the safe integer range.`, - inst: e, - origin: r, - inclusive: !0, - continue: !t.abort - }); - return; - } - } - s < i && o.issues.push({ - origin: `number`, - input: s, - code: `too_small`, - minimum: i, - inclusive: !0, - inst: e, - continue: !t.abort - }), s > a && o.issues.push({ - origin: `number`, - input: s, - code: `too_big`, - maximum: a, - inclusive: !0, - inst: e, - continue: !t.abort - }); - }; -}); -const Fr$4 = x$8(`$ZodCheckBigIntFormat`, (e, t) => { - k$9.init(e, t); - let [n, r] = bt$7[t.format]; - e._zod.onattach.push((e) => { - let i = e._zod.bag; - i.format = t.format, i.minimum = n, i.maximum = r; - }), e._zod.check = (i) => { - let a = i.value; - a < n && i.issues.push({ - origin: `bigint`, - input: a, - code: `too_small`, - minimum: n, - inclusive: !0, - inst: e, - continue: !t.abort - }), a > r && i.issues.push({ - origin: `bigint`, - input: a, - code: `too_big`, - maximum: r, - inclusive: !0, - inst: e, - continue: !t.abort - }); - }; -}); -const Ir$4 = x$8(`$ZodCheckMaxSize`, (e, t) => { - var n; - k$9.init(e, t), (n = e._zod.def).when ?? (n.when = (e) => { - let t = e.value; - return !qe$8(t) && t.size !== void 0; - }), e._zod.onattach.push((e) => { - let n = e._zod.bag.maximum ?? Infinity; - t.maximum < n && (e._zod.bag.maximum = t.maximum); - }), e._zod.check = (n) => { - let r = n.value; - r.size <= t.maximum || n.issues.push({ - origin: Mt$7(r), - code: `too_big`, - maximum: t.maximum, - inclusive: !0, - input: r, - inst: e, - continue: !t.abort - }); - }; -}); -const Lr$4 = x$8(`$ZodCheckMinSize`, (e, t) => { - var n; - k$9.init(e, t), (n = e._zod.def).when ?? (n.when = (e) => { - let t = e.value; - return !qe$8(t) && t.size !== void 0; - }), e._zod.onattach.push((e) => { - let n = e._zod.bag.minimum ?? -Infinity; - t.minimum > n && (e._zod.bag.minimum = t.minimum); - }), e._zod.check = (n) => { - let r = n.value; - r.size >= t.minimum || n.issues.push({ - origin: Mt$7(r), - code: `too_small`, - minimum: t.minimum, - inclusive: !0, - input: r, - inst: e, - continue: !t.abort - }); - }; -}); -const Rr$4 = x$8(`$ZodCheckSizeEquals`, (e, t) => { - var n; - k$9.init(e, t), (n = e._zod.def).when ?? (n.when = (e) => { - let t = e.value; - return !qe$8(t) && t.size !== void 0; - }), e._zod.onattach.push((e) => { - let n = e._zod.bag; - n.minimum = t.size, n.maximum = t.size, n.size = t.size; - }), e._zod.check = (n) => { - let r = n.value, i = r.size; - if (i === t.size) return; - let a = i > t.size; - n.issues.push({ - origin: Mt$7(r), - ...a ? { - code: `too_big`, - maximum: t.size - } : { - code: `too_small`, - minimum: t.size - }, - inclusive: !0, - exact: !0, - input: n.value, - inst: e, - continue: !t.abort - }); - }; -}); -const zr$4 = x$8(`$ZodCheckMaxLength`, (e, t) => { - var n; - k$9.init(e, t), (n = e._zod.def).when ?? (n.when = (e) => { - let t = e.value; - return !qe$8(t) && t.length !== void 0; - }), e._zod.onattach.push((e) => { - let n = e._zod.bag.maximum ?? Infinity; - t.maximum < n && (e._zod.bag.maximum = t.maximum); - }), e._zod.check = (n) => { - let r = n.value; - if (r.length <= t.maximum) return; - let i = Nt$6(r); - n.issues.push({ - origin: i, - code: `too_big`, - maximum: t.maximum, - inclusive: !0, - input: r, - inst: e, - continue: !t.abort - }); - }; -}); -const Br$4 = x$8(`$ZodCheckMinLength`, (e, t) => { - var n; - k$9.init(e, t), (n = e._zod.def).when ?? (n.when = (e) => { - let t = e.value; - return !qe$8(t) && t.length !== void 0; - }), e._zod.onattach.push((e) => { - let n = e._zod.bag.minimum ?? -Infinity; - t.minimum > n && (e._zod.bag.minimum = t.minimum); - }), e._zod.check = (n) => { - let r = n.value; - if (r.length >= t.minimum) return; - let i = Nt$6(r); - n.issues.push({ - origin: i, - code: `too_small`, - minimum: t.minimum, - inclusive: !0, - input: r, - inst: e, - continue: !t.abort - }); - }; -}); -const Vr$4 = x$8(`$ZodCheckLengthEquals`, (e, t) => { - var n; - k$9.init(e, t), (n = e._zod.def).when ?? (n.when = (e) => { - let t = e.value; - return !qe$8(t) && t.length !== void 0; - }), e._zod.onattach.push((e) => { - let n = e._zod.bag; - n.minimum = t.length, n.maximum = t.length, n.length = t.length; - }), e._zod.check = (n) => { - let r = n.value, i = r.length; - if (i === t.length) return; - let a = Nt$6(r), o = i > t.length; - n.issues.push({ - origin: a, - ...o ? { - code: `too_big`, - maximum: t.length - } : { - code: `too_small`, - minimum: t.length - }, - inclusive: !0, - exact: !0, - input: n.value, - inst: e, - continue: !t.abort - }); - }; -}); -const Hr$4 = x$8(`$ZodCheckStringFormat`, (e, t) => { - var n, r; - k$9.init(e, t), e._zod.onattach.push((e) => { - let n = e._zod.bag; - n.format = t.format, t.pattern && (n.patterns ??= /* @__PURE__ */ new Set(), n.patterns.add(t.pattern)); - }), t.pattern ? (n = e._zod).check ?? (n.check = (n) => { - t.pattern.lastIndex = 0, !t.pattern.test(n.value) && n.issues.push({ - origin: `string`, - code: `invalid_format`, - format: t.format, - input: n.value, - ...t.pattern ? { pattern: t.pattern.toString() } : {}, - inst: e, - continue: !t.abort - }); - }) : (r = e._zod).check ?? (r.check = () => {}); -}); -const Ur$4 = x$8(`$ZodCheckRegex`, (e, t) => { - Hr$4.init(e, t), e._zod.check = (n) => { - t.pattern.lastIndex = 0, !t.pattern.test(n.value) && n.issues.push({ - origin: `string`, - code: `invalid_format`, - format: `regex`, - input: n.value, - pattern: t.pattern.toString(), - inst: e, - continue: !t.abort - }); - }; -}); -const Wr$4 = x$8(`$ZodCheckLowerCase`, (e, t) => { - t.pattern ??= ur$4, Hr$4.init(e, t); -}); -const Gr$4 = x$8(`$ZodCheckUpperCase`, (e, t) => { - t.pattern ??= dr$4, Hr$4.init(e, t); -}); -const Kr$4 = x$8(`$ZodCheckIncludes`, (e, t) => { - k$9.init(e, t); - let n = ht$7(t.includes), r = new RegExp(typeof t.position == `number` ? `^.{${t.position}}${n}` : n); - t.pattern = r, e._zod.onattach.push((e) => { - let t = e._zod.bag; - t.patterns ??= /* @__PURE__ */ new Set(), t.patterns.add(r); - }), e._zod.check = (n) => { - n.value.includes(t.includes, t.position) || n.issues.push({ - origin: `string`, - code: `invalid_format`, - format: `includes`, - includes: t.includes, - input: n.value, - inst: e, - continue: !t.abort - }); - }; -}); -const qr$4 = x$8(`$ZodCheckStartsWith`, (e, t) => { - k$9.init(e, t); - let n = RegExp(`^${ht$7(t.prefix)}.*`); - t.pattern ??= n, e._zod.onattach.push((e) => { - let t = e._zod.bag; - t.patterns ??= /* @__PURE__ */ new Set(), t.patterns.add(n); - }), e._zod.check = (n) => { - n.value.startsWith(t.prefix) || n.issues.push({ - origin: `string`, - code: `invalid_format`, - format: `starts_with`, - prefix: t.prefix, - input: n.value, - inst: e, - continue: !t.abort - }); - }; -}); -const Jr$4 = x$8(`$ZodCheckEndsWith`, (e, t) => { - k$9.init(e, t); - let n = RegExp(`.*${ht$7(t.suffix)}$`); - t.pattern ??= n, e._zod.onattach.push((e) => { - let t = e._zod.bag; - t.patterns ??= /* @__PURE__ */ new Set(), t.patterns.add(n); - }), e._zod.check = (n) => { - n.value.endsWith(t.suffix) || n.issues.push({ - origin: `string`, - code: `invalid_format`, - format: `ends_with`, - suffix: t.suffix, - input: n.value, - inst: e, - continue: !t.abort - }); - }; -}); -function Yr$4(e, t, n) { - e.issues.length && t.issues.push(...kt$7(n, e.issues)); -} -const Xr$4 = x$8(`$ZodCheckProperty`, (e, t) => { - k$9.init(e, t), e._zod.check = (e) => { - let n = t.schema._zod.run({ - value: e.value[t.property], - issues: [] - }, {}); - if (n instanceof Promise) return n.then((n) => Yr$4(n, e, t.property)); - Yr$4(n, e, t.property); - }; -}); -const Zr$4 = x$8(`$ZodCheckMimeType`, (e, t) => { - k$9.init(e, t); - let n = new Set(t.mime); - e._zod.onattach.push((e) => { - e._zod.bag.mime = t.mime; - }), e._zod.check = (r) => { - n.has(r.value.type) || r.issues.push({ - code: `invalid_value`, - values: t.mime, - input: r.value.type, - inst: e, - continue: !t.abort - }); - }; -}); -const Qr$4 = x$8(`$ZodCheckOverwrite`, (e, t) => { - k$9.init(e, t), e._zod.check = (e) => { - e.value = t.tx(e.value); - }; -}); -var $r$4 = class { - constructor(e = []) { - this.content = [], this.indent = 0, this && (this.args = e); - } - indented(e) { - this.indent += 1, e(this), --this.indent; - } - write(e) { - if (typeof e == `function`) { - e(this, { execution: `sync` }), e(this, { execution: `async` }); - return; - } - let t = e.split(` -`).filter((e) => e), n = Math.min(...t.map((e) => e.length - e.trimStart().length)), r = t.map((e) => e.slice(n)).map((e) => ` `.repeat(this.indent * 2) + e); - for (let e of r) this.content.push(e); - } - compile() { - let e = Function, t = this?.args, n = [...(this?.content ?? [``]).map((e) => ` ${e}`)]; - return new e(...t, n.join(` -`)); - } -}; -const ei$4 = { - major: 4, - minor: 3, - patch: 6 -}; -const A$8 = x$8(`$ZodType`, (e, t) => { - var n; - e ??= {}, e._zod.def = t, e._zod.bag = e._zod.bag || {}, e._zod.version = ei$4; - let r = [...e._zod.def.checks ?? []]; - e._zod.traits.has(`$ZodCheck`) && r.unshift(e); - for (let t of r) for (let n of t._zod.onattach) n(e); - if (r.length === 0) (n = e._zod).deferred ?? (n.deferred = []), e._zod.deferred?.push(() => { - e._zod.run = e._zod.parse; - }); - else { - let t = (e, t, n) => { - let r = Ot$7(e), i; - for (let a of t) { - if (a._zod.def.when) { - if (!a._zod.def.when(e)) continue; - } else if (r) continue; - let t = e.issues.length, o = a._zod.check(e); - if (o instanceof Promise && n?.async === !1) throw new Fe$8(); - if (i || o instanceof Promise) i = (i ?? Promise.resolve()).then(async () => { - await o, e.issues.length !== t && (r ||= Ot$7(e, t)); - }); - else { - if (e.issues.length === t) continue; - r ||= Ot$7(e, t); - } - } - return i ? i.then(() => e) : e; - }, n = (n, i, a) => { - if (Ot$7(n)) return n.aborted = !0, n; - let o = t(i, r, a); - if (o instanceof Promise) { - if (a.async === !1) throw new Fe$8(); - return o.then((t) => e._zod.parse(t, a)); - } - return e._zod.parse(o, a); - }; - e._zod.run = (i, a) => { - if (a.skipChecks) return e._zod.parse(i, a); - if (a.direction === `backward`) { - let t = e._zod.parse({ - value: i.value, - issues: [] - }, { - ...a, - skipChecks: !0 - }); - return t instanceof Promise ? t.then((e) => n(e, i, a)) : n(t, i, a); - } - let o = e._zod.parse(i, a); - if (o instanceof Promise) { - if (a.async === !1) throw new Fe$8(); - return o.then((e) => t(e, r, a)); - } - return t(o, r, a); - }; - } - w$10(e, `~standard`, () => ({ - validate: (t) => { - try { - let n = tn$5(e, t); - return n.success ? { value: n.data } : { issues: n.error?.issues }; - } catch { - return rn$5(e, t).then((e) => e.success ? { value: e.data } : { issues: e.error?.issues }); - } - }, - vendor: `zod`, - version: 1 - })); -}); -const ti$4 = x$8(`$ZodString`, (e, t) => { - A$8.init(e, t), e._zod.pattern = [...e?._zod.bag?.patterns ?? []].pop() ?? rr$3(e._zod.bag), e._zod.parse = (n, r) => { - if (t.coerce) try { - n.value = String(n.value); - } catch {} - return typeof n.value == `string` || n.issues.push({ - expected: `string`, - code: `invalid_type`, - input: n.value, - inst: e - }), n; - }; -}); -const j$7 = x$8(`$ZodStringFormat`, (e, t) => { - Hr$4.init(e, t), ti$4.init(e, t); -}); -const ni$4 = x$8(`$ZodGUID`, (e, t) => { - t.pattern ??= An$4, j$7.init(e, t); -}); -const ri$4 = x$8(`$ZodUUID`, (e, t) => { - if (t.version) { - let e = { - v1: 1, - v2: 2, - v3: 3, - v4: 4, - v5: 5, - v6: 6, - v7: 7, - v8: 8 - }[t.version]; - if (e === void 0) throw Error(`Invalid UUID version: "${t.version}"`); - t.pattern ??= jn$4(e); - } else t.pattern ??= jn$4(); - j$7.init(e, t); -}); -const ii$4 = x$8(`$ZodEmail`, (e, t) => { - t.pattern ??= Fn$3, j$7.init(e, t); -}); -const ai$4 = x$8(`$ZodURL`, (e, t) => { - j$7.init(e, t), e._zod.check = (n) => { - try { - let r = n.value.trim(), i = new URL(r); - t.hostname && (t.hostname.lastIndex = 0, t.hostname.test(i.hostname) || n.issues.push({ - code: `invalid_format`, - format: `url`, - note: `Invalid hostname`, - pattern: t.hostname.source, - input: n.value, - inst: e, - continue: !t.abort - })), t.protocol && (t.protocol.lastIndex = 0, t.protocol.test(i.protocol.endsWith(`:`) ? i.protocol.slice(0, -1) : i.protocol) || n.issues.push({ - code: `invalid_format`, - format: `url`, - note: `Invalid protocol`, - pattern: t.protocol.source, - input: n.value, - inst: e, - continue: !t.abort - })), t.normalize ? n.value = i.href : n.value = r; - return; - } catch { - n.issues.push({ - code: `invalid_format`, - format: `url`, - input: n.value, - inst: e, - continue: !t.abort - }); - } - }; -}); -const oi$4 = x$8(`$ZodEmoji`, (e, t) => { - t.pattern ??= Vn$3(), j$7.init(e, t); -}); -const si$4 = x$8(`$ZodNanoID`, (e, t) => { - t.pattern ??= Dn$4, j$7.init(e, t); -}); -const ci$4 = x$8(`$ZodCUID`, (e, t) => { - t.pattern ??= Sn$4, j$7.init(e, t); -}); -const li$4 = x$8(`$ZodCUID2`, (e, t) => { - t.pattern ??= Cn$4, j$7.init(e, t); -}); -const ui$4 = x$8(`$ZodULID`, (e, t) => { - t.pattern ??= wn$4, j$7.init(e, t); -}); -const di$4 = x$8(`$ZodXID`, (e, t) => { - t.pattern ??= Tn$4, j$7.init(e, t); -}); -const fi$4 = x$8(`$ZodKSUID`, (e, t) => { - t.pattern ??= En$4, j$7.init(e, t); -}); -const pi$4 = x$8(`$ZodISODateTime`, (e, t) => { - t.pattern ??= nr$3(t), j$7.init(e, t); -}); -const mi$4 = x$8(`$ZodISODate`, (e, t) => { - t.pattern ??= $n$3, j$7.init(e, t); -}); -const hi$4 = x$8(`$ZodISOTime`, (e, t) => { - t.pattern ??= tr$3(t), j$7.init(e, t); -}); -const gi$4 = x$8(`$ZodISODuration`, (e, t) => { - t.pattern ??= On$4, j$7.init(e, t); -}); -const _i$4 = x$8(`$ZodIPv4`, (e, t) => { - t.pattern ??= Hn$3, j$7.init(e, t), e._zod.bag.format = `ipv4`; -}); -const vi$4 = x$8(`$ZodIPv6`, (e, t) => { - t.pattern ??= Un$3, j$7.init(e, t), e._zod.bag.format = `ipv6`, e._zod.check = (n) => { - try { - new URL(`http://[${n.value}]`); - } catch { - n.issues.push({ - code: `invalid_format`, - format: `ipv6`, - input: n.value, - inst: e, - continue: !t.abort - }); - } - }; -}); -const yi$4 = x$8(`$ZodMAC`, (e, t) => { - t.pattern ??= Wn$3(t.delimiter), j$7.init(e, t), e._zod.bag.format = `mac`; -}); -const bi$4 = x$8(`$ZodCIDRv4`, (e, t) => { - t.pattern ??= Gn$3, j$7.init(e, t); -}); -const xi$4 = x$8(`$ZodCIDRv6`, (e, t) => { - t.pattern ??= Kn$3, j$7.init(e, t), e._zod.check = (n) => { - let r = n.value.split(`/`); - try { - if (r.length !== 2) throw Error(); - let [e, t] = r; - if (!t) throw Error(); - let n = Number(t); - if (`${n}` !== t || n < 0 || n > 128) throw Error(); - new URL(`http://[${e}]`); - } catch { - n.issues.push({ - code: `invalid_format`, - format: `cidrv6`, - input: n.value, - inst: e, - continue: !t.abort - }); - } - }; -}); -function Si$4(e) { - if (e === ``) return !0; - if (e.length % 4 != 0) return !1; - try { - return atob(e), !0; - } catch { - return !1; - } -} -const Ci$4 = x$8(`$ZodBase64`, (e, t) => { - t.pattern ??= qn$3, j$7.init(e, t), e._zod.bag.contentEncoding = `base64`, e._zod.check = (n) => { - Si$4(n.value) || n.issues.push({ - code: `invalid_format`, - format: `base64`, - input: n.value, - inst: e, - continue: !t.abort - }); - }; -}); -function wi$4(e) { - if (!Jn$3.test(e)) return !1; - let t = e.replace(/[-_]/g, (e) => e === `-` ? `+` : `/`); - return Si$4(t.padEnd(Math.ceil(t.length / 4) * 4, `=`)); -} -const Ti$4 = x$8(`$ZodBase64URL`, (e, t) => { - t.pattern ??= Jn$3, j$7.init(e, t), e._zod.bag.contentEncoding = `base64url`, e._zod.check = (n) => { - wi$4(n.value) || n.issues.push({ - code: `invalid_format`, - format: `base64url`, - input: n.value, - inst: e, - continue: !t.abort - }); - }; -}); -const Ei$4 = x$8(`$ZodE164`, (e, t) => { - t.pattern ??= Zn$3, j$7.init(e, t); -}); -function Di$4(e, t = null) { - try { - let n = e.split(`.`); - if (n.length !== 3) return !1; - let [r] = n; - if (!r) return !1; - let i = JSON.parse(atob(r)); - return !(`typ` in i && i?.typ !== `JWT` || !i.alg || t && (!(`alg` in i) || i.alg !== t)); - } catch { - return !1; - } -} -const Oi$4 = x$8(`$ZodJWT`, (e, t) => { - j$7.init(e, t), e._zod.check = (n) => { - Di$4(n.value, t.alg) || n.issues.push({ - code: `invalid_format`, - format: `jwt`, - input: n.value, - inst: e, - continue: !t.abort - }); - }; -}); -const ki$4 = x$8(`$ZodCustomStringFormat`, (e, t) => { - j$7.init(e, t), e._zod.check = (n) => { - t.fn(n.value) || n.issues.push({ - code: `invalid_format`, - format: t.format, - input: n.value, - inst: e, - continue: !t.abort - }); - }; -}); -const Ai$4 = x$8(`$ZodNumber`, (e, t) => { - A$8.init(e, t), e._zod.pattern = e._zod.bag.pattern ?? or$3, e._zod.parse = (n, r) => { - if (t.coerce) try { - n.value = Number(n.value); - } catch {} - let i = n.value; - if (typeof i == `number` && !Number.isNaN(i) && Number.isFinite(i)) return n; - let a = typeof i == `number` ? Number.isNaN(i) ? `NaN` : Number.isFinite(i) ? void 0 : `Infinity` : void 0; - return n.issues.push({ - expected: `number`, - code: `invalid_type`, - input: i, - inst: e, - ...a ? { received: a } : {} - }), n; - }; -}); -const ji$4 = x$8(`$ZodNumberFormat`, (e, t) => { - Pr$4.init(e, t), Ai$4.init(e, t); -}); -const Mi$4 = x$8(`$ZodBoolean`, (e, t) => { - A$8.init(e, t), e._zod.pattern = sr$3, e._zod.parse = (n, r) => { - if (t.coerce) try { - n.value = !!n.value; - } catch {} - let i = n.value; - return typeof i == `boolean` || n.issues.push({ - expected: `boolean`, - code: `invalid_type`, - input: i, - inst: e - }), n; - }; -}); -const Ni$4 = x$8(`$ZodBigInt`, (e, t) => { - A$8.init(e, t), e._zod.pattern = ir$3, e._zod.parse = (n, r) => { - if (t.coerce) try { - n.value = BigInt(n.value); - } catch {} - return typeof n.value == `bigint` || n.issues.push({ - expected: `bigint`, - code: `invalid_type`, - input: n.value, - inst: e - }), n; - }; -}); -const Pi$4 = x$8(`$ZodBigIntFormat`, (e, t) => { - Fr$4.init(e, t), Ni$4.init(e, t); -}); -const Fi$4 = x$8(`$ZodSymbol`, (e, t) => { - A$8.init(e, t), e._zod.parse = (t, n) => { - let r = t.value; - return typeof r == `symbol` || t.issues.push({ - expected: `symbol`, - code: `invalid_type`, - input: r, - inst: e - }), t; - }; -}); -const Ii$4 = x$8(`$ZodUndefined`, (e, t) => { - A$8.init(e, t), e._zod.pattern = lr$4, e._zod.values = /* @__PURE__ */ new Set([void 0]), e._zod.optin = `optional`, e._zod.optout = `optional`, e._zod.parse = (t, n) => { - let r = t.value; - return r === void 0 || t.issues.push({ - expected: `undefined`, - code: `invalid_type`, - input: r, - inst: e - }), t; - }; -}); -const Li$4 = x$8(`$ZodNull`, (e, t) => { - A$8.init(e, t), e._zod.pattern = cr$3, e._zod.values = /* @__PURE__ */ new Set([null]), e._zod.parse = (t, n) => { - let r = t.value; - return r === null || t.issues.push({ - expected: `null`, - code: `invalid_type`, - input: r, - inst: e - }), t; - }; -}); -const Ri$4 = x$8(`$ZodAny`, (e, t) => { - A$8.init(e, t), e._zod.parse = (e) => e; -}); -const zi$4 = x$8(`$ZodUnknown`, (e, t) => { - A$8.init(e, t), e._zod.parse = (e) => e; -}); -const Bi$4 = x$8(`$ZodNever`, (e, t) => { - A$8.init(e, t), e._zod.parse = (t, n) => (t.issues.push({ - expected: `never`, - code: `invalid_type`, - input: t.value, - inst: e - }), t); -}); -const Vi$4 = x$8(`$ZodVoid`, (e, t) => { - A$8.init(e, t), e._zod.parse = (t, n) => { - let r = t.value; - return r === void 0 || t.issues.push({ - expected: `void`, - code: `invalid_type`, - input: r, - inst: e - }), t; - }; -}); -const Hi$4 = x$8(`$ZodDate`, (e, t) => { - A$8.init(e, t), e._zod.parse = (n, r) => { - if (t.coerce) try { - n.value = new Date(n.value); - } catch {} - let i = n.value, a = i instanceof Date; - return a && !Number.isNaN(i.getTime()) || n.issues.push({ - expected: `date`, - code: `invalid_type`, - input: i, - ...a ? { received: `Invalid Date` } : {}, - inst: e - }), n; - }; -}); -function Ui$4(e, t, n) { - e.issues.length && t.issues.push(...kt$7(n, e.issues)), t.value[n] = e.value; -} -const Wi$4 = x$8(`$ZodArray`, (e, t) => { - A$8.init(e, t), e._zod.parse = (n, r) => { - let i = n.value; - if (!Array.isArray(i)) return n.issues.push({ - expected: `array`, - code: `invalid_type`, - input: i, - inst: e - }), n; - n.value = Array(i.length); - let a = []; - for (let e = 0; e < i.length; e++) { - let o = i[e], s = t.element._zod.run({ - value: o, - issues: [] - }, r); - s instanceof Promise ? a.push(s.then((t) => Ui$4(t, n, e))) : Ui$4(s, n, e); - } - return a.length ? Promise.all(a).then(() => n) : n; - }; -}); -function Gi$4(e, t, n, r, i) { - if (e.issues.length) { - if (i && !(n in r)) return; - t.issues.push(...kt$7(n, e.issues)); - } - e.value === void 0 ? n in r && (t.value[n] = void 0) : t.value[n] = e.value; -} -function Ki$4(e) { - let t = Object.keys(e.shape); - for (let n of t) if (!e.shape?.[n]?._zod?.traits?.has(`$ZodType`)) throw Error(`Invalid element at key "${n}": expected a Zod schema`); - let n = vt$7(e.shape); - return { - ...e, - keys: t, - keySet: new Set(t), - numKeys: t.length, - optionalKeys: new Set(n) - }; -} -function qi$4(e, t, n, r, i, a) { - let o = [], s = i.keySet, c = i.catchall._zod, l = c.def.type, u = c.optout === `optional`; - for (let i in t) { - if (s.has(i)) continue; - if (l === `never`) { - o.push(i); - continue; - } - let a = c.run({ - value: t[i], - issues: [] - }, r); - a instanceof Promise ? e.push(a.then((e) => Gi$4(e, n, i, t, u))) : Gi$4(a, n, i, t, u); - } - return o.length && n.issues.push({ - code: `unrecognized_keys`, - keys: o, - input: t, - inst: a - }), e.length ? Promise.all(e).then(() => n) : n; -} -const Ji$4 = x$8(`$ZodObject`, (e, t) => { - if (A$8.init(e, t), !Object.getOwnPropertyDescriptor(t, `shape`)?.get) { - let e = t.shape; - Object.defineProperty(t, "shape", { get: () => { - let n = { ...e }; - return Object.defineProperty(t, "shape", { value: n }), n; - } }); - } - let n = Ke$8(() => Ki$4(t)); - w$10(e._zod, `propValues`, () => { - let e = t.shape, n = {}; - for (let t in e) { - let r = e[t]._zod; - if (r.values) { - n[t] ?? (n[t] = /* @__PURE__ */ new Set()); - for (let e of r.values) n[t].add(e); - } - } - return n; - }); - let r = st$7, i = t.catchall, a; - e._zod.parse = (t, o) => { - a ??= n.value; - let s = t.value; - if (!r(s)) return t.issues.push({ - expected: `object`, - code: `invalid_type`, - input: s, - inst: e - }), t; - t.value = {}; - let c = [], l = a.shape; - for (let e of a.keys) { - let n = l[e], r = n._zod.optout === `optional`, i = n._zod.run({ - value: s[e], - issues: [] - }, o); - i instanceof Promise ? c.push(i.then((n) => Gi$4(n, t, e, s, r))) : Gi$4(i, t, e, s, r); - } - return i ? qi$4(c, s, t, o, n.value, e) : c.length ? Promise.all(c).then(() => t) : t; - }; -}); -const Yi$4 = x$8(`$ZodObjectJIT`, (e, t) => { - Ji$4.init(e, t); - let n = e._zod.parse, r = Ke$8(() => Ki$4(t)), i = (e) => { - let t = new $r$4([ - `shape`, - `payload`, - `ctx` - ]), n = r.value, i = (e) => { - let t = it$7(e); - return `shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`; - }; - t.write(`const input = payload.value;`); - let a = Object.create(null), o = 0; - for (let e of n.keys) a[e] = `key_${o++}`; - t.write(`const newResult = {};`); - for (let r of n.keys) { - let n = a[r], o = it$7(r), s = e[r]?._zod?.optout === `optional`; - t.write(`const ${n} = ${i(r)};`), s ? t.write(` - if (${n}.issues.length) { - if (${o} in input) { - payload.issues = payload.issues.concat(${n}.issues.map(iss => ({ - ...iss, - path: iss.path ? [${o}, ...iss.path] : [${o}] - }))); - } - } - - if (${n}.value === undefined) { - if (${o} in input) { - newResult[${o}] = undefined; - } - } else { - newResult[${o}] = ${n}.value; - } - - `) : t.write(` - if (${n}.issues.length) { - payload.issues = payload.issues.concat(${n}.issues.map(iss => ({ - ...iss, - path: iss.path ? [${o}, ...iss.path] : [${o}] - }))); - } - - if (${n}.value === undefined) { - if (${o} in input) { - newResult[${o}] = undefined; - } - } else { - newResult[${o}] = ${n}.value; - } - - `); - } - t.write(`payload.value = newResult;`), t.write(`return payload;`); - let s = t.compile(); - return (t, n) => s(e, t, n); - }, a, o = st$7, s = !Le$8.jitless, c = s && ct$7.value, l = t.catchall, u; - e._zod.parse = (d, f) => { - u ??= r.value; - let p = d.value; - return o(p) ? s && c && f?.async === !1 && f.jitless !== !0 ? (a ||= i(t.shape), d = a(d, f), l ? qi$4([], p, d, f, u, e) : d) : n(d, f) : (d.issues.push({ - expected: `object`, - code: `invalid_type`, - input: p, - inst: e - }), d); - }; -}); -function Xi$4(e, t, n, r) { - for (let n of e) if (n.issues.length === 0) return t.value = n.value, t; - let i = e.filter((e) => !Ot$7(e)); - return i.length === 1 ? (t.value = i[0].value, i[0]) : (t.issues.push({ - code: `invalid_union`, - input: t.value, - inst: n, - errors: e.map((e) => e.issues.map((e) => jt$7(e, r, S$9()))) - }), t); -} -const Zi$4 = x$8(`$ZodUnion`, (e, t) => { - A$8.init(e, t), w$10(e._zod, `optin`, () => t.options.some((e) => e._zod.optin === `optional`) ? `optional` : void 0), w$10(e._zod, `optout`, () => t.options.some((e) => e._zod.optout === `optional`) ? `optional` : void 0), w$10(e._zod, `values`, () => { - if (t.options.every((e) => e._zod.values)) return new Set(t.options.flatMap((e) => Array.from(e._zod.values))); - }), w$10(e._zod, `pattern`, () => { - if (t.options.every((e) => e._zod.pattern)) { - let e = t.options.map((e) => e._zod.pattern); - return RegExp(`^(${e.map((e) => Je$8(e.source)).join(`|`)})$`); - } - }); - let n = t.options.length === 1, r = t.options[0]._zod.run; - e._zod.parse = (i, a) => { - if (n) return r(i, a); - let o = !1, s = []; - for (let e of t.options) { - let t = e._zod.run({ - value: i.value, - issues: [] - }, a); - if (t instanceof Promise) s.push(t), o = !0; - else { - if (t.issues.length === 0) return t; - s.push(t); - } - } - return o ? Promise.all(s).then((t) => Xi$4(t, i, e, a)) : Xi$4(s, i, e, a); - }; -}); -function Qi$4(e, t, n, r) { - let i = e.filter((e) => e.issues.length === 0); - return i.length === 1 ? (t.value = i[0].value, t) : (i.length === 0 ? t.issues.push({ - code: `invalid_union`, - input: t.value, - inst: n, - errors: e.map((e) => e.issues.map((e) => jt$7(e, r, S$9()))) - }) : t.issues.push({ - code: `invalid_union`, - input: t.value, - inst: n, - errors: [], - inclusive: !1 - }), t); -} -const $i$4 = x$8(`$ZodXor`, (e, t) => { - Zi$4.init(e, t), t.inclusive = !1; - let n = t.options.length === 1, r = t.options[0]._zod.run; - e._zod.parse = (i, a) => { - if (n) return r(i, a); - let o = !1, s = []; - for (let e of t.options) { - let t = e._zod.run({ - value: i.value, - issues: [] - }, a); - t instanceof Promise ? (s.push(t), o = !0) : s.push(t); - } - return o ? Promise.all(s).then((t) => Qi$4(t, i, e, a)) : Qi$4(s, i, e, a); - }; -}); -const ea$4 = x$8(`$ZodDiscriminatedUnion`, (e, t) => { - t.inclusive = !1, Zi$4.init(e, t); - let n = e._zod.parse; - w$10(e._zod, `propValues`, () => { - let e = {}; - for (let n of t.options) { - let r = n._zod.propValues; - if (!r || Object.keys(r).length === 0) throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`); - for (let [t, n] of Object.entries(r)) { - e[t] || (e[t] = /* @__PURE__ */ new Set()); - for (let r of n) e[t].add(r); - } - } - return e; - }); - let r = Ke$8(() => { - let e = t.options, n = /* @__PURE__ */ new Map(); - for (let r of e) { - let e = r._zod.propValues?.[t.discriminator]; - if (!e || e.size === 0) throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`); - for (let t of e) { - if (n.has(t)) throw Error(`Duplicate discriminator value "${String(t)}"`); - n.set(t, r); - } - } - return n; - }); - e._zod.parse = (i, a) => { - let o = i.value; - if (!st$7(o)) return i.issues.push({ - code: `invalid_type`, - expected: `object`, - input: o, - inst: e - }), i; - let s = r.value.get(o?.[t.discriminator]); - return s ? s._zod.run(i, a) : t.unionFallback ? n(i, a) : (i.issues.push({ - code: `invalid_union`, - errors: [], - note: `No matching discriminator`, - discriminator: t.discriminator, - input: o, - path: [t.discriminator], - inst: e - }), i); - }; -}); -const ta$4 = x$8(`$ZodIntersection`, (e, t) => { - A$8.init(e, t), e._zod.parse = (e, n) => { - let r = e.value, i = t.left._zod.run({ - value: r, - issues: [] - }, n), a = t.right._zod.run({ - value: r, - issues: [] - }, n); - return i instanceof Promise || a instanceof Promise ? Promise.all([i, a]).then(([t, n]) => ra$4(e, t, n)) : ra$4(e, i, a); - }; -}); -function na$4(e, t) { - if (e === t || e instanceof Date && t instanceof Date && +e == +t) return { - valid: !0, - data: e - }; - if (lt$7(e) && lt$7(t)) { - let n = Object.keys(t), r = Object.keys(e).filter((e) => n.indexOf(e) !== -1), i = { - ...e, - ...t - }; - for (let n of r) { - let r = na$4(e[n], t[n]); - if (!r.valid) return { - valid: !1, - mergeErrorPath: [n, ...r.mergeErrorPath] - }; - i[n] = r.data; - } - return { - valid: !0, - data: i - }; - } - if (Array.isArray(e) && Array.isArray(t)) { - if (e.length !== t.length) return { - valid: !1, - mergeErrorPath: [] - }; - let n = []; - for (let r = 0; r < e.length; r++) { - let i = e[r], a = t[r], o = na$4(i, a); - if (!o.valid) return { - valid: !1, - mergeErrorPath: [r, ...o.mergeErrorPath] - }; - n.push(o.data); - } - return { - valid: !0, - data: n - }; - } - return { - valid: !1, - mergeErrorPath: [] - }; -} -function ra$4(e, t, n) { - let r = /* @__PURE__ */ new Map(), i; - for (let n of t.issues) if (n.code === `unrecognized_keys`) { - i ??= n; - for (let e of n.keys) r.has(e) || r.set(e, {}), r.get(e).l = !0; - } else e.issues.push(n); - for (let t of n.issues) if (t.code === `unrecognized_keys`) for (let e of t.keys) r.has(e) || r.set(e, {}), r.get(e).r = !0; - else e.issues.push(t); - let a = [...r].filter(([, e]) => e.l && e.r).map(([e]) => e); - if (a.length && i && e.issues.push({ - ...i, - keys: a - }), Ot$7(e)) return e; - let o = na$4(t.value, n.value); - if (!o.valid) throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`); - return e.value = o.data, e; -} -const ia$4 = x$8(`$ZodTuple`, (e, t) => { - A$8.init(e, t); - let n = t.items; - e._zod.parse = (r, i) => { - let a = r.value; - if (!Array.isArray(a)) return r.issues.push({ - input: a, - inst: e, - expected: `tuple`, - code: `invalid_type` - }), r; - r.value = []; - let o = [], s = [...n].reverse().findIndex((e) => e._zod.optin !== `optional`), c = s === -1 ? 0 : n.length - s; - if (!t.rest) { - let t = a.length > n.length, i = a.length < c - 1; - if (t || i) return r.issues.push({ - ...t ? { - code: `too_big`, - maximum: n.length, - inclusive: !0 - } : { - code: `too_small`, - minimum: n.length - }, - input: a, - inst: e, - origin: `array` - }), r; - } - let l = -1; - for (let e of n) { - if (l++, l >= a.length && l >= c) continue; - let t = e._zod.run({ - value: a[l], - issues: [] - }, i); - t instanceof Promise ? o.push(t.then((e) => aa$4(e, r, l))) : aa$4(t, r, l); - } - if (t.rest) { - let e = a.slice(n.length); - for (let n of e) { - l++; - let e = t.rest._zod.run({ - value: n, - issues: [] - }, i); - e instanceof Promise ? o.push(e.then((e) => aa$4(e, r, l))) : aa$4(e, r, l); - } - } - return o.length ? Promise.all(o).then(() => r) : r; - }; -}); -function aa$4(e, t, n) { - e.issues.length && t.issues.push(...kt$7(n, e.issues)), t.value[n] = e.value; -} -const oa$4 = x$8(`$ZodRecord`, (e, t) => { - A$8.init(e, t), e._zod.parse = (n, r) => { - let i = n.value; - if (!lt$7(i)) return n.issues.push({ - expected: `record`, - code: `invalid_type`, - input: i, - inst: e - }), n; - let a = [], o = t.keyType._zod.values; - if (o) { - n.value = {}; - let s = /* @__PURE__ */ new Set(); - for (let e of o) if (typeof e == `string` || typeof e == `number` || typeof e == `symbol`) { - s.add(typeof e == `number` ? e.toString() : e); - let o = t.valueType._zod.run({ - value: i[e], - issues: [] - }, r); - o instanceof Promise ? a.push(o.then((t) => { - t.issues.length && n.issues.push(...kt$7(e, t.issues)), n.value[e] = t.value; - })) : (o.issues.length && n.issues.push(...kt$7(e, o.issues)), n.value[e] = o.value); - } - let c; - for (let e in i) s.has(e) || (c ??= [], c.push(e)); - c && c.length > 0 && n.issues.push({ - code: `unrecognized_keys`, - input: i, - inst: e, - keys: c - }); - } else { - n.value = {}; - for (let o of Reflect.ownKeys(i)) { - if (o === `__proto__`) continue; - let s = t.keyType._zod.run({ - value: o, - issues: [] - }, r); - if (s instanceof Promise) throw Error(`Async schemas not supported in object keys currently`); - if (typeof o == `string` && or$3.test(o) && s.issues.length) { - let e = t.keyType._zod.run({ - value: Number(o), - issues: [] - }, r); - if (e instanceof Promise) throw Error(`Async schemas not supported in object keys currently`); - e.issues.length === 0 && (s = e); - } - if (s.issues.length) { - t.mode === `loose` ? n.value[o] = i[o] : n.issues.push({ - code: `invalid_key`, - origin: `record`, - issues: s.issues.map((e) => jt$7(e, r, S$9())), - input: o, - path: [o], - inst: e - }); - continue; - } - let c = t.valueType._zod.run({ - value: i[o], - issues: [] - }, r); - c instanceof Promise ? a.push(c.then((e) => { - e.issues.length && n.issues.push(...kt$7(o, e.issues)), n.value[s.value] = e.value; - })) : (c.issues.length && n.issues.push(...kt$7(o, c.issues)), n.value[s.value] = c.value); - } - } - return a.length ? Promise.all(a).then(() => n) : n; - }; -}); -const sa$4 = x$8(`$ZodMap`, (e, t) => { - A$8.init(e, t), e._zod.parse = (n, r) => { - let i = n.value; - if (!(i instanceof Map)) return n.issues.push({ - expected: `map`, - code: `invalid_type`, - input: i, - inst: e - }), n; - let a = []; - n.value = /* @__PURE__ */ new Map(); - for (let [o, s] of i) { - let c = t.keyType._zod.run({ - value: o, - issues: [] - }, r), l = t.valueType._zod.run({ - value: s, - issues: [] - }, r); - c instanceof Promise || l instanceof Promise ? a.push(Promise.all([c, l]).then(([t, a]) => { - ca$4(t, a, n, o, i, e, r); - })) : ca$4(c, l, n, o, i, e, r); - } - return a.length ? Promise.all(a).then(() => n) : n; - }; -}); -function ca$4(e, t, n, r, i, a, o) { - e.issues.length && (pt$7.has(typeof r) ? n.issues.push(...kt$7(r, e.issues)) : n.issues.push({ - code: `invalid_key`, - origin: `map`, - input: i, - inst: a, - issues: e.issues.map((e) => jt$7(e, o, S$9())) - })), t.issues.length && (pt$7.has(typeof r) ? n.issues.push(...kt$7(r, t.issues)) : n.issues.push({ - origin: `map`, - code: `invalid_element`, - input: i, - inst: a, - key: r, - issues: t.issues.map((e) => jt$7(e, o, S$9())) - })), n.value.set(e.value, t.value); -} -const la$4 = x$8(`$ZodSet`, (e, t) => { - A$8.init(e, t), e._zod.parse = (n, r) => { - let i = n.value; - if (!(i instanceof Set)) return n.issues.push({ - input: i, - inst: e, - expected: `set`, - code: `invalid_type` - }), n; - let a = []; - n.value = /* @__PURE__ */ new Set(); - for (let e of i) { - let i = t.valueType._zod.run({ - value: e, - issues: [] - }, r); - i instanceof Promise ? a.push(i.then((e) => ua$4(e, n))) : ua$4(i, n); - } - return a.length ? Promise.all(a).then(() => n) : n; - }; -}); -function ua$4(e, t) { - e.issues.length && t.issues.push(...e.issues), t.value.add(e.value); -} -const da$4 = x$8(`$ZodEnum`, (e, t) => { - A$8.init(e, t); - let n = We$8(t.entries), r = new Set(n); - e._zod.values = r, e._zod.pattern = RegExp(`^(${n.filter((e) => pt$7.has(typeof e)).map((e) => typeof e == `string` ? ht$7(e) : e.toString()).join(`|`)})$`), e._zod.parse = (t, i) => { - let a = t.value; - return r.has(a) || t.issues.push({ - code: `invalid_value`, - values: n, - input: a, - inst: e - }), t; - }; -}); -const fa$4 = x$8(`$ZodLiteral`, (e, t) => { - if (A$8.init(e, t), t.values.length === 0) throw Error(`Cannot create literal schema with no valid values`); - let n = new Set(t.values); - e._zod.values = n, e._zod.pattern = RegExp(`^(${t.values.map((e) => typeof e == `string` ? ht$7(e) : e ? ht$7(e.toString()) : String(e)).join(`|`)})$`), e._zod.parse = (r, i) => { - let a = r.value; - return n.has(a) || r.issues.push({ - code: `invalid_value`, - values: t.values, - input: a, - inst: e - }), r; - }; -}); -const pa$4 = x$8(`$ZodFile`, (e, t) => { - A$8.init(e, t), e._zod.parse = (t, n) => { - let r = t.value; - return r instanceof File || t.issues.push({ - expected: `file`, - code: `invalid_type`, - input: r, - inst: e - }), t; - }; -}); -const ma$4 = x$8(`$ZodTransform`, (e, t) => { - A$8.init(e, t), e._zod.parse = (n, r) => { - if (r.direction === `backward`) throw new Ie$8(e.constructor.name); - let i = t.transform(n.value, n); - if (r.async) return (i instanceof Promise ? i : Promise.resolve(i)).then((e) => (n.value = e, n)); - if (i instanceof Promise) throw new Fe$8(); - return n.value = i, n; - }; -}); -function ha$4(e, t) { - return e.issues.length && t === void 0 ? { - issues: [], - value: void 0 - } : e; -} -const ga$4 = x$8(`$ZodOptional`, (e, t) => { - A$8.init(e, t), e._zod.optin = `optional`, e._zod.optout = `optional`, w$10(e._zod, `values`, () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, void 0]) : void 0), w$10(e._zod, `pattern`, () => { - let e = t.innerType._zod.pattern; - return e ? RegExp(`^(${Je$8(e.source)})?$`) : void 0; - }), e._zod.parse = (e, n) => { - if (t.innerType._zod.optin === `optional`) { - let r = t.innerType._zod.run(e, n); - return r instanceof Promise ? r.then((t) => ha$4(t, e.value)) : ha$4(r, e.value); - } - return e.value === void 0 ? e : t.innerType._zod.run(e, n); - }; -}); -const _a$4 = x$8(`$ZodExactOptional`, (e, t) => { - ga$4.init(e, t), w$10(e._zod, `values`, () => t.innerType._zod.values), w$10(e._zod, `pattern`, () => t.innerType._zod.pattern), e._zod.parse = (e, n) => t.innerType._zod.run(e, n); -}); -const va$4 = x$8(`$ZodNullable`, (e, t) => { - A$8.init(e, t), w$10(e._zod, `optin`, () => t.innerType._zod.optin), w$10(e._zod, `optout`, () => t.innerType._zod.optout), w$10(e._zod, `pattern`, () => { - let e = t.innerType._zod.pattern; - return e ? RegExp(`^(${Je$8(e.source)}|null)$`) : void 0; - }), w$10(e._zod, `values`, () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, null]) : void 0), e._zod.parse = (e, n) => e.value === null ? e : t.innerType._zod.run(e, n); -}); -const ya$4 = x$8(`$ZodDefault`, (e, t) => { - A$8.init(e, t), e._zod.optin = `optional`, w$10(e._zod, `values`, () => t.innerType._zod.values), e._zod.parse = (e, n) => { - if (n.direction === `backward`) return t.innerType._zod.run(e, n); - if (e.value === void 0) return e.value = t.defaultValue, e; - let r = t.innerType._zod.run(e, n); - return r instanceof Promise ? r.then((e) => ba$4(e, t)) : ba$4(r, t); - }; -}); -function ba$4(e, t) { - return e.value === void 0 && (e.value = t.defaultValue), e; -} -const xa$4 = x$8(`$ZodPrefault`, (e, t) => { - A$8.init(e, t), e._zod.optin = `optional`, w$10(e._zod, `values`, () => t.innerType._zod.values), e._zod.parse = (e, n) => (n.direction === `backward` || e.value === void 0 && (e.value = t.defaultValue), t.innerType._zod.run(e, n)); -}); -const Sa$4 = x$8(`$ZodNonOptional`, (e, t) => { - A$8.init(e, t), w$10(e._zod, `values`, () => { - let e = t.innerType._zod.values; - return e ? new Set([...e].filter((e) => e !== void 0)) : void 0; - }), e._zod.parse = (n, r) => { - let i = t.innerType._zod.run(n, r); - return i instanceof Promise ? i.then((t) => Ca$4(t, e)) : Ca$4(i, e); - }; -}); -function Ca$4(e, t) { - return !e.issues.length && e.value === void 0 && e.issues.push({ - code: `invalid_type`, - expected: `nonoptional`, - input: e.value, - inst: t - }), e; -} -const wa$4 = x$8(`$ZodSuccess`, (e, t) => { - A$8.init(e, t), e._zod.parse = (e, n) => { - if (n.direction === `backward`) throw new Ie$8(`ZodSuccess`); - let r = t.innerType._zod.run(e, n); - return r instanceof Promise ? r.then((t) => (e.value = t.issues.length === 0, e)) : (e.value = r.issues.length === 0, e); - }; -}); -const Ta$4 = x$8(`$ZodCatch`, (e, t) => { - A$8.init(e, t), w$10(e._zod, `optin`, () => t.innerType._zod.optin), w$10(e._zod, `optout`, () => t.innerType._zod.optout), w$10(e._zod, `values`, () => t.innerType._zod.values), e._zod.parse = (e, n) => { - if (n.direction === `backward`) return t.innerType._zod.run(e, n); - let r = t.innerType._zod.run(e, n); - return r instanceof Promise ? r.then((r) => (e.value = r.value, r.issues.length && (e.value = t.catchValue({ - ...e, - error: { issues: r.issues.map((e) => jt$7(e, n, S$9())) }, - input: e.value - }), e.issues = []), e)) : (e.value = r.value, r.issues.length && (e.value = t.catchValue({ - ...e, - error: { issues: r.issues.map((e) => jt$7(e, n, S$9())) }, - input: e.value - }), e.issues = []), e); - }; -}); -const Ea$4 = x$8(`$ZodNaN`, (e, t) => { - A$8.init(e, t), e._zod.parse = (t, n) => ((typeof t.value != `number` || !Number.isNaN(t.value)) && t.issues.push({ - input: t.value, - inst: e, - expected: `nan`, - code: `invalid_type` - }), t); -}); -const Da$4 = x$8(`$ZodPipe`, (e, t) => { - A$8.init(e, t), w$10(e._zod, `values`, () => t.in._zod.values), w$10(e._zod, `optin`, () => t.in._zod.optin), w$10(e._zod, `optout`, () => t.out._zod.optout), w$10(e._zod, `propValues`, () => t.in._zod.propValues), e._zod.parse = (e, n) => { - if (n.direction === `backward`) { - let r = t.out._zod.run(e, n); - return r instanceof Promise ? r.then((e) => Oa$4(e, t.in, n)) : Oa$4(r, t.in, n); - } - let r = t.in._zod.run(e, n); - return r instanceof Promise ? r.then((e) => Oa$4(e, t.out, n)) : Oa$4(r, t.out, n); - }; -}); -function Oa$4(e, t, n) { - return e.issues.length ? (e.aborted = !0, e) : t._zod.run({ - value: e.value, - issues: e.issues - }, n); -} -const ka$4 = x$8(`$ZodCodec`, (e, t) => { - A$8.init(e, t), w$10(e._zod, `values`, () => t.in._zod.values), w$10(e._zod, `optin`, () => t.in._zod.optin), w$10(e._zod, `optout`, () => t.out._zod.optout), w$10(e._zod, `propValues`, () => t.in._zod.propValues), e._zod.parse = (e, n) => { - if ((n.direction || `forward`) === `forward`) { - let r = t.in._zod.run(e, n); - return r instanceof Promise ? r.then((e) => Aa$4(e, t, n)) : Aa$4(r, t, n); - } else { - let r = t.out._zod.run(e, n); - return r instanceof Promise ? r.then((e) => Aa$4(e, t, n)) : Aa$4(r, t, n); - } - }; -}); -function Aa$4(e, t, n) { - if (e.issues.length) return e.aborted = !0, e; - if ((n.direction || `forward`) === `forward`) { - let r = t.transform(e.value, e); - return r instanceof Promise ? r.then((r) => ja$4(e, r, t.out, n)) : ja$4(e, r, t.out, n); - } else { - let r = t.reverseTransform(e.value, e); - return r instanceof Promise ? r.then((r) => ja$4(e, r, t.in, n)) : ja$4(e, r, t.in, n); - } -} -function ja$4(e, t, n, r) { - return e.issues.length ? (e.aborted = !0, e) : n._zod.run({ - value: t, - issues: e.issues - }, r); -} -const Ma$4 = x$8(`$ZodReadonly`, (e, t) => { - A$8.init(e, t), w$10(e._zod, `propValues`, () => t.innerType._zod.propValues), w$10(e._zod, `values`, () => t.innerType._zod.values), w$10(e._zod, `optin`, () => t.innerType?._zod?.optin), w$10(e._zod, `optout`, () => t.innerType?._zod?.optout), e._zod.parse = (e, n) => { - if (n.direction === `backward`) return t.innerType._zod.run(e, n); - let r = t.innerType._zod.run(e, n); - return r instanceof Promise ? r.then(Na$4) : Na$4(r); - }; -}); -function Na$4(e) { - return e.value = Object.freeze(e.value), e; -} -const Pa$4 = x$8(`$ZodTemplateLiteral`, (e, t) => { - A$8.init(e, t); - let n = []; - for (let e of t.parts) if (typeof e == `object` && e) { - if (!e._zod.pattern) throw Error(`Invalid template literal part, no pattern found: ${[...e._zod.traits].shift()}`); - let t = e._zod.pattern instanceof RegExp ? e._zod.pattern.source : e._zod.pattern; - if (!t) throw Error(`Invalid template literal part: ${e._zod.traits}`); - let r = +!!t.startsWith(`^`), i = t.endsWith(`$`) ? t.length - 1 : t.length; - n.push(t.slice(r, i)); - } else if (e === null || mt$7.has(typeof e)) n.push(ht$7(`${e}`)); - else throw Error(`Invalid template literal part: ${e}`); - e._zod.pattern = RegExp(`^${n.join(``)}$`), e._zod.parse = (n, r) => typeof n.value == `string` ? (e._zod.pattern.lastIndex = 0, e._zod.pattern.test(n.value) || n.issues.push({ - input: n.value, - inst: e, - code: `invalid_format`, - format: t.format ?? `template_literal`, - pattern: e._zod.pattern.source - }), n) : (n.issues.push({ - input: n.value, - inst: e, - expected: `string`, - code: `invalid_type` - }), n); -}); -const Fa$4 = x$8(`$ZodFunction`, (e, t) => (A$8.init(e, t), e._def = t, e._zod.def = t, e.implement = (t) => { - if (typeof t != `function`) throw Error(`implement() must be called with a function`); - return function(...n) { - let r = e._def.input ? Zt$5(e._def.input, n) : n, i = Reflect.apply(t, this, r); - return e._def.output ? Zt$5(e._def.output, i) : i; - }; -}, e.implementAsync = (t) => { - if (typeof t != `function`) throw Error(`implementAsync() must be called with a function`); - return async function(...n) { - let r = e._def.input ? await $t$5(e._def.input, n) : n, i = await Reflect.apply(t, this, r); - return e._def.output ? await $t$5(e._def.output, i) : i; - }; -}, e._zod.parse = (t, n) => typeof t.value == `function` ? (e._def.output && e._def.output._zod.def.type === `promise` ? t.value = e.implementAsync(t.value) : t.value = e.implement(t.value), t) : (t.issues.push({ - code: `invalid_type`, - expected: `function`, - input: t.value, - inst: e -}), t), e.input = (...t) => { - let n = e.constructor; - return Array.isArray(t[0]) ? new n({ - type: `function`, - input: new ia$4({ - type: `tuple`, - items: t[0], - rest: t[1] - }), - output: e._def.output - }) : new n({ - type: `function`, - input: t[0], - output: e._def.output - }); -}, e.output = (t) => { - let n = e.constructor; - return new n({ - type: `function`, - input: e._def.input, - output: t - }); -}, e)); -const Ia$4 = x$8(`$ZodPromise`, (e, t) => { - A$8.init(e, t), e._zod.parse = (e, n) => Promise.resolve(e.value).then((e) => t.innerType._zod.run({ - value: e, - issues: [] - }, n)); -}); -const La$4 = x$8(`$ZodLazy`, (e, t) => { - A$8.init(e, t), w$10(e._zod, `innerType`, () => t.getter()), w$10(e._zod, `pattern`, () => e._zod.innerType?._zod?.pattern), w$10(e._zod, `propValues`, () => e._zod.innerType?._zod?.propValues), w$10(e._zod, `optin`, () => e._zod.innerType?._zod?.optin ?? void 0), w$10(e._zod, `optout`, () => e._zod.innerType?._zod?.optout ?? void 0), e._zod.parse = (t, n) => e._zod.innerType._zod.run(t, n); -}); -const Ra$4 = x$8(`$ZodCustom`, (e, t) => { - k$9.init(e, t), A$8.init(e, t), e._zod.parse = (e, t) => e, e._zod.check = (n) => { - let r = n.value, i = t.fn(r); - if (i instanceof Promise) return i.then((t) => za$4(t, n, r, e)); - za$4(i, n, r, e); - }; -}); -function za$4(e, t, n, r) { - if (!e) { - let e = { - code: `custom`, - input: n, - inst: r, - path: [...r._zod.def.path ?? []], - continue: !r._zod.def.abort - }; - r._zod.def.params && (e.params = r._zod.def.params), t.issues.push(Pt$6(e)); - } -} -const Ba$4 = () => { - let e = { - string: { - unit: `حرف`, - verb: `أن يحوي` - }, - file: { - unit: `بايت`, - verb: `أن يحوي` - }, - array: { - unit: `عنصر`, - verb: `أن يحوي` - }, - set: { - unit: `عنصر`, - verb: `أن يحوي` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `مدخل`, - email: `بريد إلكتروني`, - url: `رابط`, - emoji: `إيموجي`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `تاريخ ووقت بمعيار ISO`, - date: `تاريخ بمعيار ISO`, - time: `وقت بمعيار ISO`, - duration: `مدة بمعيار ISO`, - ipv4: `عنوان IPv4`, - ipv6: `عنوان IPv6`, - cidrv4: `مدى عناوين بصيغة IPv4`, - cidrv6: `مدى عناوين بصيغة IPv6`, - base64: `نَص بترميز base64-encoded`, - base64url: `نَص بترميز base64url-encoded`, - json_string: `نَص على هيئة JSON`, - e164: `رقم هاتف بمعيار E.164`, - jwt: `JWT`, - template_literal: `مدخل` - }, r = { nan: `NaN` }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = D$9(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `مدخلات غير مقبولة: يفترض إدخال instanceof ${e.expected}، ولكن تم إدخال ${i}` : `مدخلات غير مقبولة: يفترض إدخال ${t}، ولكن تم إدخال ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `مدخلات غير مقبولة: يفترض إدخال ${E$10(e.values[0])}` : `اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${C$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? ` أكبر من اللازم: يفترض أن تكون ${e.origin ?? `القيمة`} ${n} ${e.maximum.toString()} ${r.unit ?? `عنصر`}` : `أكبر من اللازم: يفترض أن تكون ${e.origin ?? `القيمة`} ${n} ${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `أصغر من اللازم: يفترض لـ ${e.origin} أن يكون ${n} ${e.minimum.toString()} ${r.unit}` : `أصغر من اللازم: يفترض لـ ${e.origin} أن يكون ${n} ${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `نَص غير مقبول: يجب أن يبدأ بـ "${e.prefix}"` : t.format === `ends_with` ? `نَص غير مقبول: يجب أن ينتهي بـ "${t.suffix}"` : t.format === `includes` ? `نَص غير مقبول: يجب أن يتضمَّن "${t.includes}"` : t.format === `regex` ? `نَص غير مقبول: يجب أن يطابق النمط ${t.pattern}` : `${n[t.format] ?? e.format} غير مقبول`; - } - case `not_multiple_of`: return `رقم غير مقبول: يجب أن يكون من مضاعفات ${e.divisor}`; - case `unrecognized_keys`: return `معرف${e.keys.length > 1 ? `ات` : ``} غريب${e.keys.length > 1 ? `ة` : ``}: ${C$10(e.keys, `، `)}`; - case `invalid_key`: return `معرف غير مقبول في ${e.origin}`; - case `invalid_union`: return `مدخل غير مقبول`; - case `invalid_element`: return `مدخل غير مقبول في ${e.origin}`; - default: return `مدخل غير مقبول`; - } - }; -}; -function Va$4() { - return { localeError: Ba$4() }; -} -const Ha$4 = () => { - let e = { - string: { - unit: `simvol`, - verb: `olmalıdır` - }, - file: { - unit: `bayt`, - verb: `olmalıdır` - }, - array: { - unit: `element`, - verb: `olmalıdır` - }, - set: { - unit: `element`, - verb: `olmalıdır` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `input`, - email: `email address`, - url: `URL`, - emoji: `emoji`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `ISO datetime`, - date: `ISO date`, - time: `ISO time`, - duration: `ISO duration`, - ipv4: `IPv4 address`, - ipv6: `IPv6 address`, - cidrv4: `IPv4 range`, - cidrv6: `IPv6 range`, - base64: `base64-encoded string`, - base64url: `base64url-encoded string`, - json_string: `JSON string`, - e164: `E.164 number`, - jwt: `JWT`, - template_literal: `input` - }, r = { nan: `NaN` }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = D$9(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `Yanlış dəyər: gözlənilən instanceof ${e.expected}, daxil olan ${i}` : `Yanlış dəyər: gözlənilən ${t}, daxil olan ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `Yanlış dəyər: gözlənilən ${E$10(e.values[0])}` : `Yanlış seçim: aşağıdakılardan biri olmalıdır: ${C$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? `Çox böyük: gözlənilən ${e.origin ?? `dəyər`} ${n}${e.maximum.toString()} ${r.unit ?? `element`}` : `Çox böyük: gözlənilən ${e.origin ?? `dəyər`} ${n}${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `Çox kiçik: gözlənilən ${e.origin} ${n}${e.minimum.toString()} ${r.unit}` : `Çox kiçik: gözlənilən ${e.origin} ${n}${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `Yanlış mətn: "${t.prefix}" ilə başlamalıdır` : t.format === `ends_with` ? `Yanlış mətn: "${t.suffix}" ilə bitməlidir` : t.format === `includes` ? `Yanlış mətn: "${t.includes}" daxil olmalıdır` : t.format === `regex` ? `Yanlış mətn: ${t.pattern} şablonuna uyğun olmalıdır` : `Yanlış ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `Yanlış ədəd: ${e.divisor} ilə bölünə bilən olmalıdır`; - case `unrecognized_keys`: return `Tanınmayan açar${e.keys.length > 1 ? `lar` : ``}: ${C$10(e.keys, `, `)}`; - case `invalid_key`: return `${e.origin} daxilində yanlış açar`; - case `invalid_union`: return `Yanlış dəyər`; - case `invalid_element`: return `${e.origin} daxilində yanlış dəyər`; - default: return `Yanlış dəyər`; - } - }; -}; -function Ua$4() { - return { localeError: Ha$4() }; -} -function Wa$4(e, t, n, r) { - let i = Math.abs(e), a = i % 10, o = i % 100; - return o >= 11 && o <= 19 ? r : a === 1 ? t : a >= 2 && a <= 4 ? n : r; -} -const Ga$4 = () => { - let e = { - string: { - unit: { - one: `сімвал`, - few: `сімвалы`, - many: `сімвалаў` - }, - verb: `мець` - }, - array: { - unit: { - one: `элемент`, - few: `элементы`, - many: `элементаў` - }, - verb: `мець` - }, - set: { - unit: { - one: `элемент`, - few: `элементы`, - many: `элементаў` - }, - verb: `мець` - }, - file: { - unit: { - one: `байт`, - few: `байты`, - many: `байтаў` - }, - verb: `мець` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `увод`, - email: `email адрас`, - url: `URL`, - emoji: `эмодзі`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `ISO дата і час`, - date: `ISO дата`, - time: `ISO час`, - duration: `ISO працягласць`, - ipv4: `IPv4 адрас`, - ipv6: `IPv6 адрас`, - cidrv4: `IPv4 дыяпазон`, - cidrv6: `IPv6 дыяпазон`, - base64: `радок у фармаце base64`, - base64url: `радок у фармаце base64url`, - json_string: `JSON радок`, - e164: `нумар E.164`, - jwt: `JWT`, - template_literal: `увод` - }, r = { - nan: `NaN`, - number: `лік`, - array: `масіў` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = D$9(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `Няправільны ўвод: чакаўся instanceof ${e.expected}, атрымана ${i}` : `Няправільны ўвод: чакаўся ${t}, атрымана ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `Няправільны ўвод: чакалася ${E$10(e.values[0])}` : `Няправільны варыянт: чакаўся адзін з ${C$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - if (r) { - let t = Wa$4(Number(e.maximum), r.unit.one, r.unit.few, r.unit.many); - return `Занадта вялікі: чакалася, што ${e.origin ?? `значэнне`} павінна ${r.verb} ${n}${e.maximum.toString()} ${t}`; - } - return `Занадта вялікі: чакалася, што ${e.origin ?? `значэнне`} павінна быць ${n}${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - if (r) { - let t = Wa$4(Number(e.minimum), r.unit.one, r.unit.few, r.unit.many); - return `Занадта малы: чакалася, што ${e.origin} павінна ${r.verb} ${n}${e.minimum.toString()} ${t}`; - } - return `Занадта малы: чакалася, што ${e.origin} павінна быць ${n}${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `Няправільны радок: павінен пачынацца з "${t.prefix}"` : t.format === `ends_with` ? `Няправільны радок: павінен заканчвацца на "${t.suffix}"` : t.format === `includes` ? `Няправільны радок: павінен змяшчаць "${t.includes}"` : t.format === `regex` ? `Няправільны радок: павінен адпавядаць шаблону ${t.pattern}` : `Няправільны ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `Няправільны лік: павінен быць кратным ${e.divisor}`; - case `unrecognized_keys`: return `Нераспазнаны ${e.keys.length > 1 ? `ключы` : `ключ`}: ${C$10(e.keys, `, `)}`; - case `invalid_key`: return `Няправільны ключ у ${e.origin}`; - case `invalid_union`: return `Няправільны ўвод`; - case `invalid_element`: return `Няправільнае значэнне ў ${e.origin}`; - default: return `Няправільны ўвод`; - } - }; -}; -function Ka$4() { - return { localeError: Ga$4() }; -} -const qa$4 = () => { - let e = { - string: { - unit: `символа`, - verb: `да съдържа` - }, - file: { - unit: `байта`, - verb: `да съдържа` - }, - array: { - unit: `елемента`, - verb: `да съдържа` - }, - set: { - unit: `елемента`, - verb: `да съдържа` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `вход`, - email: `имейл адрес`, - url: `URL`, - emoji: `емоджи`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `ISO време`, - date: `ISO дата`, - time: `ISO време`, - duration: `ISO продължителност`, - ipv4: `IPv4 адрес`, - ipv6: `IPv6 адрес`, - cidrv4: `IPv4 диапазон`, - cidrv6: `IPv6 диапазон`, - base64: `base64-кодиран низ`, - base64url: `base64url-кодиран низ`, - json_string: `JSON низ`, - e164: `E.164 номер`, - jwt: `JWT`, - template_literal: `вход` - }, r = { - nan: `NaN`, - number: `число`, - array: `масив` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = D$9(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `Невалиден вход: очакван instanceof ${e.expected}, получен ${i}` : `Невалиден вход: очакван ${t}, получен ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `Невалиден вход: очакван ${E$10(e.values[0])}` : `Невалидна опция: очаквано едно от ${C$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? `Твърде голямо: очаква се ${e.origin ?? `стойност`} да съдържа ${n}${e.maximum.toString()} ${r.unit ?? `елемента`}` : `Твърде голямо: очаква се ${e.origin ?? `стойност`} да бъде ${n}${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `Твърде малко: очаква се ${e.origin} да съдържа ${n}${e.minimum.toString()} ${r.unit}` : `Твърде малко: очаква се ${e.origin} да бъде ${n}${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - if (t.format === `starts_with`) return `Невалиден низ: трябва да започва с "${t.prefix}"`; - if (t.format === `ends_with`) return `Невалиден низ: трябва да завършва с "${t.suffix}"`; - if (t.format === `includes`) return `Невалиден низ: трябва да включва "${t.includes}"`; - if (t.format === `regex`) return `Невалиден низ: трябва да съвпада с ${t.pattern}`; - let r = `Невалиден`; - return t.format === `emoji` && (r = `Невалидно`), t.format === `datetime` && (r = `Невалидно`), t.format === `date` && (r = `Невалидна`), t.format === `time` && (r = `Невалидно`), t.format === `duration` && (r = `Невалидна`), `${r} ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `Невалидно число: трябва да бъде кратно на ${e.divisor}`; - case `unrecognized_keys`: return `Неразпознат${e.keys.length > 1 ? `и` : ``} ключ${e.keys.length > 1 ? `ове` : ``}: ${C$10(e.keys, `, `)}`; - case `invalid_key`: return `Невалиден ключ в ${e.origin}`; - case `invalid_union`: return `Невалиден вход`; - case `invalid_element`: return `Невалидна стойност в ${e.origin}`; - default: return `Невалиден вход`; - } - }; -}; -function Ja$3() { - return { localeError: qa$4() }; -} -const Ya$3 = () => { - let e = { - string: { - unit: `caràcters`, - verb: `contenir` - }, - file: { - unit: `bytes`, - verb: `contenir` - }, - array: { - unit: `elements`, - verb: `contenir` - }, - set: { - unit: `elements`, - verb: `contenir` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `entrada`, - email: `adreça electrònica`, - url: `URL`, - emoji: `emoji`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `data i hora ISO`, - date: `data ISO`, - time: `hora ISO`, - duration: `durada ISO`, - ipv4: `adreça IPv4`, - ipv6: `adreça IPv6`, - cidrv4: `rang IPv4`, - cidrv6: `rang IPv6`, - base64: `cadena codificada en base64`, - base64url: `cadena codificada en base64url`, - json_string: `cadena JSON`, - e164: `número E.164`, - jwt: `JWT`, - template_literal: `entrada` - }, r = { nan: `NaN` }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = D$9(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `Tipus invàlid: s'esperava instanceof ${e.expected}, s'ha rebut ${i}` : `Tipus invàlid: s'esperava ${t}, s'ha rebut ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `Valor invàlid: s'esperava ${E$10(e.values[0])}` : `Opció invàlida: s'esperava una de ${C$10(e.values, ` o `)}`; - case `too_big`: { - let n = e.inclusive ? `com a màxim` : `menys de`, r = t(e.origin); - return r ? `Massa gran: s'esperava que ${e.origin ?? `el valor`} contingués ${n} ${e.maximum.toString()} ${r.unit ?? `elements`}` : `Massa gran: s'esperava que ${e.origin ?? `el valor`} fos ${n} ${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `com a mínim` : `més de`, r = t(e.origin); - return r ? `Massa petit: s'esperava que ${e.origin} contingués ${n} ${e.minimum.toString()} ${r.unit}` : `Massa petit: s'esperava que ${e.origin} fos ${n} ${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `Format invàlid: ha de començar amb "${t.prefix}"` : t.format === `ends_with` ? `Format invàlid: ha d'acabar amb "${t.suffix}"` : t.format === `includes` ? `Format invàlid: ha d'incloure "${t.includes}"` : t.format === `regex` ? `Format invàlid: ha de coincidir amb el patró ${t.pattern}` : `Format invàlid per a ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `Número invàlid: ha de ser múltiple de ${e.divisor}`; - case `unrecognized_keys`: return `Clau${e.keys.length > 1 ? `s` : ``} no reconeguda${e.keys.length > 1 ? `s` : ``}: ${C$10(e.keys, `, `)}`; - case `invalid_key`: return `Clau invàlida a ${e.origin}`; - case `invalid_union`: return `Entrada invàlida`; - case `invalid_element`: return `Element invàlid a ${e.origin}`; - default: return `Entrada invàlida`; - } - }; -}; -function Xa$3() { - return { localeError: Ya$3() }; -} -const Za$3 = () => { - let e = { - string: { - unit: `znaků`, - verb: `mít` - }, - file: { - unit: `bajtů`, - verb: `mít` - }, - array: { - unit: `prvků`, - verb: `mít` - }, - set: { - unit: `prvků`, - verb: `mít` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `regulární výraz`, - email: `e-mailová adresa`, - url: `URL`, - emoji: `emoji`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `datum a čas ve formátu ISO`, - date: `datum ve formátu ISO`, - time: `čas ve formátu ISO`, - duration: `doba trvání ISO`, - ipv4: `IPv4 adresa`, - ipv6: `IPv6 adresa`, - cidrv4: `rozsah IPv4`, - cidrv6: `rozsah IPv6`, - base64: `řetězec zakódovaný ve formátu base64`, - base64url: `řetězec zakódovaný ve formátu base64url`, - json_string: `řetězec ve formátu JSON`, - e164: `číslo E.164`, - jwt: `JWT`, - template_literal: `vstup` - }, r = { - nan: `NaN`, - number: `číslo`, - string: `řetězec`, - function: `funkce`, - array: `pole` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = D$9(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `Neplatný vstup: očekáváno instanceof ${e.expected}, obdrženo ${i}` : `Neplatný vstup: očekáváno ${t}, obdrženo ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `Neplatný vstup: očekáváno ${E$10(e.values[0])}` : `Neplatná možnost: očekávána jedna z hodnot ${C$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? `Hodnota je příliš velká: ${e.origin ?? `hodnota`} musí mít ${n}${e.maximum.toString()} ${r.unit ?? `prvků`}` : `Hodnota je příliš velká: ${e.origin ?? `hodnota`} musí být ${n}${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `Hodnota je příliš malá: ${e.origin ?? `hodnota`} musí mít ${n}${e.minimum.toString()} ${r.unit ?? `prvků`}` : `Hodnota je příliš malá: ${e.origin ?? `hodnota`} musí být ${n}${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `Neplatný řetězec: musí začínat na "${t.prefix}"` : t.format === `ends_with` ? `Neplatný řetězec: musí končit na "${t.suffix}"` : t.format === `includes` ? `Neplatný řetězec: musí obsahovat "${t.includes}"` : t.format === `regex` ? `Neplatný řetězec: musí odpovídat vzoru ${t.pattern}` : `Neplatný formát ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `Neplatné číslo: musí být násobkem ${e.divisor}`; - case `unrecognized_keys`: return `Neznámé klíče: ${C$10(e.keys, `, `)}`; - case `invalid_key`: return `Neplatný klíč v ${e.origin}`; - case `invalid_union`: return `Neplatný vstup`; - case `invalid_element`: return `Neplatná hodnota v ${e.origin}`; - default: return `Neplatný vstup`; - } - }; -}; -function Qa$3() { - return { localeError: Za$3() }; -} -const $a$3 = () => { - let e = { - string: { - unit: `tegn`, - verb: `havde` - }, - file: { - unit: `bytes`, - verb: `havde` - }, - array: { - unit: `elementer`, - verb: `indeholdt` - }, - set: { - unit: `elementer`, - verb: `indeholdt` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `input`, - email: `e-mailadresse`, - url: `URL`, - emoji: `emoji`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `ISO dato- og klokkeslæt`, - date: `ISO-dato`, - time: `ISO-klokkeslæt`, - duration: `ISO-varighed`, - ipv4: `IPv4-område`, - ipv6: `IPv6-område`, - cidrv4: `IPv4-spektrum`, - cidrv6: `IPv6-spektrum`, - base64: `base64-kodet streng`, - base64url: `base64url-kodet streng`, - json_string: `JSON-streng`, - e164: `E.164-nummer`, - jwt: `JWT`, - template_literal: `input` - }, r = { - nan: `NaN`, - string: `streng`, - number: `tal`, - boolean: `boolean`, - array: `liste`, - object: `objekt`, - set: `sæt`, - file: `fil` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = D$9(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `Ugyldigt input: forventede instanceof ${e.expected}, fik ${i}` : `Ugyldigt input: forventede ${t}, fik ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `Ugyldig værdi: forventede ${E$10(e.values[0])}` : `Ugyldigt valg: forventede en af følgende ${C$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, i = t(e.origin), a = r[e.origin] ?? e.origin; - return i ? `For stor: forventede ${a ?? `value`} ${i.verb} ${n} ${e.maximum.toString()} ${i.unit ?? `elementer`}` : `For stor: forventede ${a ?? `value`} havde ${n} ${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, i = t(e.origin), a = r[e.origin] ?? e.origin; - return i ? `For lille: forventede ${a} ${i.verb} ${n} ${e.minimum.toString()} ${i.unit}` : `For lille: forventede ${a} havde ${n} ${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `Ugyldig streng: skal starte med "${t.prefix}"` : t.format === `ends_with` ? `Ugyldig streng: skal ende med "${t.suffix}"` : t.format === `includes` ? `Ugyldig streng: skal indeholde "${t.includes}"` : t.format === `regex` ? `Ugyldig streng: skal matche mønsteret ${t.pattern}` : `Ugyldig ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `Ugyldigt tal: skal være deleligt med ${e.divisor}`; - case `unrecognized_keys`: return `${e.keys.length > 1 ? `Ukendte nøgler` : `Ukendt nøgle`}: ${C$10(e.keys, `, `)}`; - case `invalid_key`: return `Ugyldig nøgle i ${e.origin}`; - case `invalid_union`: return `Ugyldigt input: matcher ingen af de tilladte typer`; - case `invalid_element`: return `Ugyldig værdi i ${e.origin}`; - default: return `Ugyldigt input`; - } - }; -}; -function eo$3() { - return { localeError: $a$3() }; -} -const to$3 = () => { - let e = { - string: { - unit: `Zeichen`, - verb: `zu haben` - }, - file: { - unit: `Bytes`, - verb: `zu haben` - }, - array: { - unit: `Elemente`, - verb: `zu haben` - }, - set: { - unit: `Elemente`, - verb: `zu haben` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `Eingabe`, - email: `E-Mail-Adresse`, - url: `URL`, - emoji: `Emoji`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `ISO-Datum und -Uhrzeit`, - date: `ISO-Datum`, - time: `ISO-Uhrzeit`, - duration: `ISO-Dauer`, - ipv4: `IPv4-Adresse`, - ipv6: `IPv6-Adresse`, - cidrv4: `IPv4-Bereich`, - cidrv6: `IPv6-Bereich`, - base64: `Base64-codierter String`, - base64url: `Base64-URL-codierter String`, - json_string: `JSON-String`, - e164: `E.164-Nummer`, - jwt: `JWT`, - template_literal: `Eingabe` - }, r = { - nan: `NaN`, - number: `Zahl`, - array: `Array` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = D$9(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `Ungültige Eingabe: erwartet instanceof ${e.expected}, erhalten ${i}` : `Ungültige Eingabe: erwartet ${t}, erhalten ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `Ungültige Eingabe: erwartet ${E$10(e.values[0])}` : `Ungültige Option: erwartet eine von ${C$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? `Zu groß: erwartet, dass ${e.origin ?? `Wert`} ${n}${e.maximum.toString()} ${r.unit ?? `Elemente`} hat` : `Zu groß: erwartet, dass ${e.origin ?? `Wert`} ${n}${e.maximum.toString()} ist`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `Zu klein: erwartet, dass ${e.origin} ${n}${e.minimum.toString()} ${r.unit} hat` : `Zu klein: erwartet, dass ${e.origin} ${n}${e.minimum.toString()} ist`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `Ungültiger String: muss mit "${t.prefix}" beginnen` : t.format === `ends_with` ? `Ungültiger String: muss mit "${t.suffix}" enden` : t.format === `includes` ? `Ungültiger String: muss "${t.includes}" enthalten` : t.format === `regex` ? `Ungültiger String: muss dem Muster ${t.pattern} entsprechen` : `Ungültig: ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `Ungültige Zahl: muss ein Vielfaches von ${e.divisor} sein`; - case `unrecognized_keys`: return `${e.keys.length > 1 ? `Unbekannte Schlüssel` : `Unbekannter Schlüssel`}: ${C$10(e.keys, `, `)}`; - case `invalid_key`: return `Ungültiger Schlüssel in ${e.origin}`; - case `invalid_union`: return `Ungültige Eingabe`; - case `invalid_element`: return `Ungültiger Wert in ${e.origin}`; - default: return `Ungültige Eingabe`; - } - }; -}; -function no$2() { - return { localeError: to$3() }; -} -const ro$2 = () => { - let e = { - string: { - unit: `characters`, - verb: `to have` - }, - file: { - unit: `bytes`, - verb: `to have` - }, - array: { - unit: `items`, - verb: `to have` - }, - set: { - unit: `items`, - verb: `to have` - }, - map: { - unit: `entries`, - verb: `to have` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `input`, - email: `email address`, - url: `URL`, - emoji: `emoji`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `ISO datetime`, - date: `ISO date`, - time: `ISO time`, - duration: `ISO duration`, - ipv4: `IPv4 address`, - ipv6: `IPv6 address`, - mac: `MAC address`, - cidrv4: `IPv4 range`, - cidrv6: `IPv6 range`, - base64: `base64-encoded string`, - base64url: `base64url-encoded string`, - json_string: `JSON string`, - e164: `E.164 number`, - jwt: `JWT`, - template_literal: `input` - }, r = { nan: `NaN` }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = D$9(e.input); - return `Invalid input: expected ${t}, received ${r[n] ?? n}`; - } - case `invalid_value`: return e.values.length === 1 ? `Invalid input: expected ${E$10(e.values[0])}` : `Invalid option: expected one of ${C$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? `Too big: expected ${e.origin ?? `value`} to have ${n}${e.maximum.toString()} ${r.unit ?? `elements`}` : `Too big: expected ${e.origin ?? `value`} to be ${n}${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}` : `Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `Invalid string: must start with "${t.prefix}"` : t.format === `ends_with` ? `Invalid string: must end with "${t.suffix}"` : t.format === `includes` ? `Invalid string: must include "${t.includes}"` : t.format === `regex` ? `Invalid string: must match pattern ${t.pattern}` : `Invalid ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `Invalid number: must be a multiple of ${e.divisor}`; - case `unrecognized_keys`: return `Unrecognized key${e.keys.length > 1 ? `s` : ``}: ${C$10(e.keys, `, `)}`; - case `invalid_key`: return `Invalid key in ${e.origin}`; - case `invalid_union`: return `Invalid input`; - case `invalid_element`: return `Invalid value in ${e.origin}`; - default: return `Invalid input`; - } - }; -}; -function io$2() { - return { localeError: ro$2() }; -} -const ao$2 = () => { - let e = { - string: { - unit: `karaktrojn`, - verb: `havi` - }, - file: { - unit: `bajtojn`, - verb: `havi` - }, - array: { - unit: `elementojn`, - verb: `havi` - }, - set: { - unit: `elementojn`, - verb: `havi` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `enigo`, - email: `retadreso`, - url: `URL`, - emoji: `emoĝio`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `ISO-datotempo`, - date: `ISO-dato`, - time: `ISO-tempo`, - duration: `ISO-daŭro`, - ipv4: `IPv4-adreso`, - ipv6: `IPv6-adreso`, - cidrv4: `IPv4-rango`, - cidrv6: `IPv6-rango`, - base64: `64-ume kodita karaktraro`, - base64url: `URL-64-ume kodita karaktraro`, - json_string: `JSON-karaktraro`, - e164: `E.164-nombro`, - jwt: `JWT`, - template_literal: `enigo` - }, r = { - nan: `NaN`, - number: `nombro`, - array: `tabelo`, - null: `senvalora` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = D$9(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `Nevalida enigo: atendiĝis instanceof ${e.expected}, riceviĝis ${i}` : `Nevalida enigo: atendiĝis ${t}, riceviĝis ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `Nevalida enigo: atendiĝis ${E$10(e.values[0])}` : `Nevalida opcio: atendiĝis unu el ${C$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? `Tro granda: atendiĝis ke ${e.origin ?? `valoro`} havu ${n}${e.maximum.toString()} ${r.unit ?? `elementojn`}` : `Tro granda: atendiĝis ke ${e.origin ?? `valoro`} havu ${n}${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `Tro malgranda: atendiĝis ke ${e.origin} havu ${n}${e.minimum.toString()} ${r.unit}` : `Tro malgranda: atendiĝis ke ${e.origin} estu ${n}${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `Nevalida karaktraro: devas komenciĝi per "${t.prefix}"` : t.format === `ends_with` ? `Nevalida karaktraro: devas finiĝi per "${t.suffix}"` : t.format === `includes` ? `Nevalida karaktraro: devas inkluzivi "${t.includes}"` : t.format === `regex` ? `Nevalida karaktraro: devas kongrui kun la modelo ${t.pattern}` : `Nevalida ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `Nevalida nombro: devas esti oblo de ${e.divisor}`; - case `unrecognized_keys`: return `Nekonata${e.keys.length > 1 ? `j` : ``} ŝlosilo${e.keys.length > 1 ? `j` : ``}: ${C$10(e.keys, `, `)}`; - case `invalid_key`: return `Nevalida ŝlosilo en ${e.origin}`; - case `invalid_union`: return `Nevalida enigo`; - case `invalid_element`: return `Nevalida valoro en ${e.origin}`; - default: return `Nevalida enigo`; - } - }; -}; -function oo$2() { - return { localeError: ao$2() }; -} -const so$2 = () => { - let e = { - string: { - unit: `caracteres`, - verb: `tener` - }, - file: { - unit: `bytes`, - verb: `tener` - }, - array: { - unit: `elementos`, - verb: `tener` - }, - set: { - unit: `elementos`, - verb: `tener` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `entrada`, - email: `dirección de correo electrónico`, - url: `URL`, - emoji: `emoji`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `fecha y hora ISO`, - date: `fecha ISO`, - time: `hora ISO`, - duration: `duración ISO`, - ipv4: `dirección IPv4`, - ipv6: `dirección IPv6`, - cidrv4: `rango IPv4`, - cidrv6: `rango IPv6`, - base64: `cadena codificada en base64`, - base64url: `URL codificada en base64`, - json_string: `cadena JSON`, - e164: `número E.164`, - jwt: `JWT`, - template_literal: `entrada` - }, r = { - nan: `NaN`, - string: `texto`, - number: `número`, - boolean: `booleano`, - array: `arreglo`, - object: `objeto`, - set: `conjunto`, - file: `archivo`, - date: `fecha`, - bigint: `número grande`, - symbol: `símbolo`, - undefined: `indefinido`, - null: `nulo`, - function: `función`, - map: `mapa`, - record: `registro`, - tuple: `tupla`, - enum: `enumeración`, - union: `unión`, - literal: `literal`, - promise: `promesa`, - void: `vacío`, - never: `nunca`, - unknown: `desconocido`, - any: `cualquiera` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = D$9(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `Entrada inválida: se esperaba instanceof ${e.expected}, recibido ${i}` : `Entrada inválida: se esperaba ${t}, recibido ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `Entrada inválida: se esperaba ${E$10(e.values[0])}` : `Opción inválida: se esperaba una de ${C$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, i = t(e.origin), a = r[e.origin] ?? e.origin; - return i ? `Demasiado grande: se esperaba que ${a ?? `valor`} tuviera ${n}${e.maximum.toString()} ${i.unit ?? `elementos`}` : `Demasiado grande: se esperaba que ${a ?? `valor`} fuera ${n}${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, i = t(e.origin), a = r[e.origin] ?? e.origin; - return i ? `Demasiado pequeño: se esperaba que ${a} tuviera ${n}${e.minimum.toString()} ${i.unit}` : `Demasiado pequeño: se esperaba que ${a} fuera ${n}${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `Cadena inválida: debe comenzar con "${t.prefix}"` : t.format === `ends_with` ? `Cadena inválida: debe terminar en "${t.suffix}"` : t.format === `includes` ? `Cadena inválida: debe incluir "${t.includes}"` : t.format === `regex` ? `Cadena inválida: debe coincidir con el patrón ${t.pattern}` : `Inválido ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `Número inválido: debe ser múltiplo de ${e.divisor}`; - case `unrecognized_keys`: return `Llave${e.keys.length > 1 ? `s` : ``} desconocida${e.keys.length > 1 ? `s` : ``}: ${C$10(e.keys, `, `)}`; - case `invalid_key`: return `Llave inválida en ${r[e.origin] ?? e.origin}`; - case `invalid_union`: return `Entrada inválida`; - case `invalid_element`: return `Valor inválido en ${r[e.origin] ?? e.origin}`; - default: return `Entrada inválida`; - } - }; -}; -function co$2() { - return { localeError: so$2() }; -} -const lo$2 = () => { - let e = { - string: { - unit: `کاراکتر`, - verb: `داشته باشد` - }, - file: { - unit: `بایت`, - verb: `داشته باشد` - }, - array: { - unit: `آیتم`, - verb: `داشته باشد` - }, - set: { - unit: `آیتم`, - verb: `داشته باشد` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `ورودی`, - email: `آدرس ایمیل`, - url: `URL`, - emoji: `ایموجی`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `تاریخ و زمان ایزو`, - date: `تاریخ ایزو`, - time: `زمان ایزو`, - duration: `مدت زمان ایزو`, - ipv4: `IPv4 آدرس`, - ipv6: `IPv6 آدرس`, - cidrv4: `IPv4 دامنه`, - cidrv6: `IPv6 دامنه`, - base64: `base64-encoded رشته`, - base64url: `base64url-encoded رشته`, - json_string: `JSON رشته`, - e164: `E.164 عدد`, - jwt: `JWT`, - template_literal: `ورودی` - }, r = { - nan: `NaN`, - number: `عدد`, - array: `آرایه` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = D$9(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `ورودی نامعتبر: می‌بایست instanceof ${e.expected} می‌بود، ${i} دریافت شد` : `ورودی نامعتبر: می‌بایست ${t} می‌بود، ${i} دریافت شد`; - } - case `invalid_value`: return e.values.length === 1 ? `ورودی نامعتبر: می‌بایست ${E$10(e.values[0])} می‌بود` : `گزینه نامعتبر: می‌بایست یکی از ${C$10(e.values, `|`)} می‌بود`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? `خیلی بزرگ: ${e.origin ?? `مقدار`} باید ${n}${e.maximum.toString()} ${r.unit ?? `عنصر`} باشد` : `خیلی بزرگ: ${e.origin ?? `مقدار`} باید ${n}${e.maximum.toString()} باشد`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `خیلی کوچک: ${e.origin} باید ${n}${e.minimum.toString()} ${r.unit} باشد` : `خیلی کوچک: ${e.origin} باید ${n}${e.minimum.toString()} باشد`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `رشته نامعتبر: باید با "${t.prefix}" شروع شود` : t.format === `ends_with` ? `رشته نامعتبر: باید با "${t.suffix}" تمام شود` : t.format === `includes` ? `رشته نامعتبر: باید شامل "${t.includes}" باشد` : t.format === `regex` ? `رشته نامعتبر: باید با الگوی ${t.pattern} مطابقت داشته باشد` : `${n[t.format] ?? e.format} نامعتبر`; - } - case `not_multiple_of`: return `عدد نامعتبر: باید مضرب ${e.divisor} باشد`; - case `unrecognized_keys`: return `کلید${e.keys.length > 1 ? `های` : ``} ناشناس: ${C$10(e.keys, `, `)}`; - case `invalid_key`: return `کلید ناشناس در ${e.origin}`; - case `invalid_union`: return `ورودی نامعتبر`; - case `invalid_element`: return `مقدار نامعتبر در ${e.origin}`; - default: return `ورودی نامعتبر`; - } - }; -}; -function uo$2() { - return { localeError: lo$2() }; -} -const fo$2 = () => { - let e = { - string: { - unit: `merkkiä`, - subject: `merkkijonon` - }, - file: { - unit: `tavua`, - subject: `tiedoston` - }, - array: { - unit: `alkiota`, - subject: `listan` - }, - set: { - unit: `alkiota`, - subject: `joukon` - }, - number: { - unit: ``, - subject: `luvun` - }, - bigint: { - unit: ``, - subject: `suuren kokonaisluvun` - }, - int: { - unit: ``, - subject: `kokonaisluvun` - }, - date: { - unit: ``, - subject: `päivämäärän` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `säännöllinen lauseke`, - email: `sähköpostiosoite`, - url: `URL-osoite`, - emoji: `emoji`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `ISO-aikaleima`, - date: `ISO-päivämäärä`, - time: `ISO-aika`, - duration: `ISO-kesto`, - ipv4: `IPv4-osoite`, - ipv6: `IPv6-osoite`, - cidrv4: `IPv4-alue`, - cidrv6: `IPv6-alue`, - base64: `base64-koodattu merkkijono`, - base64url: `base64url-koodattu merkkijono`, - json_string: `JSON-merkkijono`, - e164: `E.164-luku`, - jwt: `JWT`, - template_literal: `templaattimerkkijono` - }, r = { nan: `NaN` }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = D$9(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `Virheellinen tyyppi: odotettiin instanceof ${e.expected}, oli ${i}` : `Virheellinen tyyppi: odotettiin ${t}, oli ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `Virheellinen syöte: täytyy olla ${E$10(e.values[0])}` : `Virheellinen valinta: täytyy olla yksi seuraavista: ${C$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? `Liian suuri: ${r.subject} täytyy olla ${n}${e.maximum.toString()} ${r.unit}`.trim() : `Liian suuri: arvon täytyy olla ${n}${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `Liian pieni: ${r.subject} täytyy olla ${n}${e.minimum.toString()} ${r.unit}`.trim() : `Liian pieni: arvon täytyy olla ${n}${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `Virheellinen syöte: täytyy alkaa "${t.prefix}"` : t.format === `ends_with` ? `Virheellinen syöte: täytyy loppua "${t.suffix}"` : t.format === `includes` ? `Virheellinen syöte: täytyy sisältää "${t.includes}"` : t.format === `regex` ? `Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${t.pattern}` : `Virheellinen ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `Virheellinen luku: täytyy olla luvun ${e.divisor} monikerta`; - case `unrecognized_keys`: return `${e.keys.length > 1 ? `Tuntemattomat avaimet` : `Tuntematon avain`}: ${C$10(e.keys, `, `)}`; - case `invalid_key`: return `Virheellinen avain tietueessa`; - case `invalid_union`: return `Virheellinen unioni`; - case `invalid_element`: return `Virheellinen arvo joukossa`; - default: return `Virheellinen syöte`; - } - }; -}; -function po$2() { - return { localeError: fo$2() }; -} -const mo$2 = () => { - let e = { - string: { - unit: `caractères`, - verb: `avoir` - }, - file: { - unit: `octets`, - verb: `avoir` - }, - array: { - unit: `éléments`, - verb: `avoir` - }, - set: { - unit: `éléments`, - verb: `avoir` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `entrée`, - email: `adresse e-mail`, - url: `URL`, - emoji: `emoji`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `date et heure ISO`, - date: `date ISO`, - time: `heure ISO`, - duration: `durée ISO`, - ipv4: `adresse IPv4`, - ipv6: `adresse IPv6`, - cidrv4: `plage IPv4`, - cidrv6: `plage IPv6`, - base64: `chaîne encodée en base64`, - base64url: `chaîne encodée en base64url`, - json_string: `chaîne JSON`, - e164: `numéro E.164`, - jwt: `JWT`, - template_literal: `entrée` - }, r = { - nan: `NaN`, - number: `nombre`, - array: `tableau` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = D$9(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `Entrée invalide : instanceof ${e.expected} attendu, ${i} reçu` : `Entrée invalide : ${t} attendu, ${i} reçu`; - } - case `invalid_value`: return e.values.length === 1 ? `Entrée invalide : ${E$10(e.values[0])} attendu` : `Option invalide : une valeur parmi ${C$10(e.values, `|`)} attendue`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? `Trop grand : ${e.origin ?? `valeur`} doit ${r.verb} ${n}${e.maximum.toString()} ${r.unit ?? `élément(s)`}` : `Trop grand : ${e.origin ?? `valeur`} doit être ${n}${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `Trop petit : ${e.origin} doit ${r.verb} ${n}${e.minimum.toString()} ${r.unit}` : `Trop petit : ${e.origin} doit être ${n}${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `Chaîne invalide : doit commencer par "${t.prefix}"` : t.format === `ends_with` ? `Chaîne invalide : doit se terminer par "${t.suffix}"` : t.format === `includes` ? `Chaîne invalide : doit inclure "${t.includes}"` : t.format === `regex` ? `Chaîne invalide : doit correspondre au modèle ${t.pattern}` : `${n[t.format] ?? e.format} invalide`; - } - case `not_multiple_of`: return `Nombre invalide : doit être un multiple de ${e.divisor}`; - case `unrecognized_keys`: return `Clé${e.keys.length > 1 ? `s` : ``} non reconnue${e.keys.length > 1 ? `s` : ``} : ${C$10(e.keys, `, `)}`; - case `invalid_key`: return `Clé invalide dans ${e.origin}`; - case `invalid_union`: return `Entrée invalide`; - case `invalid_element`: return `Valeur invalide dans ${e.origin}`; - default: return `Entrée invalide`; - } - }; -}; -function ho$2() { - return { localeError: mo$2() }; -} -const go$2 = () => { - let e = { - string: { - unit: `caractères`, - verb: `avoir` - }, - file: { - unit: `octets`, - verb: `avoir` - }, - array: { - unit: `éléments`, - verb: `avoir` - }, - set: { - unit: `éléments`, - verb: `avoir` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `entrée`, - email: `adresse courriel`, - url: `URL`, - emoji: `emoji`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `date-heure ISO`, - date: `date ISO`, - time: `heure ISO`, - duration: `durée ISO`, - ipv4: `adresse IPv4`, - ipv6: `adresse IPv6`, - cidrv4: `plage IPv4`, - cidrv6: `plage IPv6`, - base64: `chaîne encodée en base64`, - base64url: `chaîne encodée en base64url`, - json_string: `chaîne JSON`, - e164: `numéro E.164`, - jwt: `JWT`, - template_literal: `entrée` - }, r = { nan: `NaN` }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = D$9(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `Entrée invalide : attendu instanceof ${e.expected}, reçu ${i}` : `Entrée invalide : attendu ${t}, reçu ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `Entrée invalide : attendu ${E$10(e.values[0])}` : `Option invalide : attendu l'une des valeurs suivantes ${C$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `≤` : `<`, r = t(e.origin); - return r ? `Trop grand : attendu que ${e.origin ?? `la valeur`} ait ${n}${e.maximum.toString()} ${r.unit}` : `Trop grand : attendu que ${e.origin ?? `la valeur`} soit ${n}${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `≥` : `>`, r = t(e.origin); - return r ? `Trop petit : attendu que ${e.origin} ait ${n}${e.minimum.toString()} ${r.unit}` : `Trop petit : attendu que ${e.origin} soit ${n}${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `Chaîne invalide : doit commencer par "${t.prefix}"` : t.format === `ends_with` ? `Chaîne invalide : doit se terminer par "${t.suffix}"` : t.format === `includes` ? `Chaîne invalide : doit inclure "${t.includes}"` : t.format === `regex` ? `Chaîne invalide : doit correspondre au motif ${t.pattern}` : `${n[t.format] ?? e.format} invalide`; - } - case `not_multiple_of`: return `Nombre invalide : doit être un multiple de ${e.divisor}`; - case `unrecognized_keys`: return `Clé${e.keys.length > 1 ? `s` : ``} non reconnue${e.keys.length > 1 ? `s` : ``} : ${C$10(e.keys, `, `)}`; - case `invalid_key`: return `Clé invalide dans ${e.origin}`; - case `invalid_union`: return `Entrée invalide`; - case `invalid_element`: return `Valeur invalide dans ${e.origin}`; - default: return `Entrée invalide`; - } - }; -}; -function _o$2() { - return { localeError: go$2() }; -} -const vo$2 = () => { - let e = { - string: { - label: `מחרוזת`, - gender: `f` - }, - number: { - label: `מספר`, - gender: `m` - }, - boolean: { - label: `ערך בוליאני`, - gender: `m` - }, - bigint: { - label: `BigInt`, - gender: `m` - }, - date: { - label: `תאריך`, - gender: `m` - }, - array: { - label: `מערך`, - gender: `m` - }, - object: { - label: `אובייקט`, - gender: `m` - }, - null: { - label: `ערך ריק (null)`, - gender: `m` - }, - undefined: { - label: `ערך לא מוגדר (undefined)`, - gender: `m` - }, - symbol: { - label: `סימבול (Symbol)`, - gender: `m` - }, - function: { - label: `פונקציה`, - gender: `f` - }, - map: { - label: `מפה (Map)`, - gender: `f` - }, - set: { - label: `קבוצה (Set)`, - gender: `f` - }, - file: { - label: `קובץ`, - gender: `m` - }, - promise: { - label: `Promise`, - gender: `m` - }, - NaN: { - label: `NaN`, - gender: `m` - }, - unknown: { - label: `ערך לא ידוע`, - gender: `m` - }, - value: { - label: `ערך`, - gender: `m` - } - }, t = { - string: { - unit: `תווים`, - shortLabel: `קצר`, - longLabel: `ארוך` - }, - file: { - unit: `בייטים`, - shortLabel: `קטן`, - longLabel: `גדול` - }, - array: { - unit: `פריטים`, - shortLabel: `קטן`, - longLabel: `גדול` - }, - set: { - unit: `פריטים`, - shortLabel: `קטן`, - longLabel: `גדול` - }, - number: { - unit: ``, - shortLabel: `קטן`, - longLabel: `גדול` - } - }, n = (t) => t ? e[t] : void 0, r = (t) => { - let r = n(t); - return r ? r.label : t ?? e.unknown.label; - }, i = (e) => `ה${r(e)}`, a = (e) => (n(e)?.gender ?? `m`) === `f` ? `צריכה להיות` : `צריך להיות`, o = (e) => e ? t[e] ?? null : null, s = { - regex: { - label: `קלט`, - gender: `m` - }, - email: { - label: `כתובת אימייל`, - gender: `f` - }, - url: { - label: `כתובת רשת`, - gender: `f` - }, - emoji: { - label: `אימוג'י`, - gender: `m` - }, - uuid: { - label: `UUID`, - gender: `m` - }, - nanoid: { - label: `nanoid`, - gender: `m` - }, - guid: { - label: `GUID`, - gender: `m` - }, - cuid: { - label: `cuid`, - gender: `m` - }, - cuid2: { - label: `cuid2`, - gender: `m` - }, - ulid: { - label: `ULID`, - gender: `m` - }, - xid: { - label: `XID`, - gender: `m` - }, - ksuid: { - label: `KSUID`, - gender: `m` - }, - datetime: { - label: `תאריך וזמן ISO`, - gender: `m` - }, - date: { - label: `תאריך ISO`, - gender: `m` - }, - time: { - label: `זמן ISO`, - gender: `m` - }, - duration: { - label: `משך זמן ISO`, - gender: `m` - }, - ipv4: { - label: `כתובת IPv4`, - gender: `f` - }, - ipv6: { - label: `כתובת IPv6`, - gender: `f` - }, - cidrv4: { - label: `טווח IPv4`, - gender: `m` - }, - cidrv6: { - label: `טווח IPv6`, - gender: `m` - }, - base64: { - label: `מחרוזת בבסיס 64`, - gender: `f` - }, - base64url: { - label: `מחרוזת בבסיס 64 לכתובות רשת`, - gender: `f` - }, - json_string: { - label: `מחרוזת JSON`, - gender: `f` - }, - e164: { - label: `מספר E.164`, - gender: `m` - }, - jwt: { - label: `JWT`, - gender: `m` - }, - ends_with: { - label: `קלט`, - gender: `m` - }, - includes: { - label: `קלט`, - gender: `m` - }, - lowercase: { - label: `קלט`, - gender: `m` - }, - starts_with: { - label: `קלט`, - gender: `m` - }, - uppercase: { - label: `קלט`, - gender: `m` - } - }, c = { nan: `NaN` }; - return (t) => { - switch (t.code) { - case `invalid_type`: { - let n = t.expected, i = c[n ?? ``] ?? r(n), a = D$9(t.input), o = c[a] ?? e[a]?.label ?? a; - return /^[A-Z]/.test(t.expected) ? `קלט לא תקין: צריך להיות instanceof ${t.expected}, התקבל ${o}` : `קלט לא תקין: צריך להיות ${i}, התקבל ${o}`; - } - case `invalid_value`: { - if (t.values.length === 1) return `ערך לא תקין: הערך חייב להיות ${E$10(t.values[0])}`; - let e = t.values.map((e) => E$10(e)); - if (t.values.length === 2) return `ערך לא תקין: האפשרויות המתאימות הן ${e[0]} או ${e[1]}`; - let n = e[e.length - 1]; - return `ערך לא תקין: האפשרויות המתאימות הן ${e.slice(0, -1).join(`, `)} או ${n}`; - } - case `too_big`: { - let e = o(t.origin), n = i(t.origin ?? `value`); - if (t.origin === `string`) return `${e?.longLabel ?? `ארוך`} מדי: ${n} צריכה להכיל ${t.maximum.toString()} ${e?.unit ?? ``} ${t.inclusive ? `או פחות` : `לכל היותר`}`.trim(); - if (t.origin === `number`) return `גדול מדי: ${n} צריך להיות ${t.inclusive ? `קטן או שווה ל-${t.maximum}` : `קטן מ-${t.maximum}`}`; - if (t.origin === `array` || t.origin === `set`) return `גדול מדי: ${n} ${t.origin === `set` ? `צריכה` : `צריך`} להכיל ${t.inclusive ? `${t.maximum} ${e?.unit ?? ``} או פחות` : `פחות מ-${t.maximum} ${e?.unit ?? ``}`}`.trim(); - let r = t.inclusive ? `<=` : `<`, s = a(t.origin ?? `value`); - return e?.unit ? `${e.longLabel} מדי: ${n} ${s} ${r}${t.maximum.toString()} ${e.unit}` : `${e?.longLabel ?? `גדול`} מדי: ${n} ${s} ${r}${t.maximum.toString()}`; - } - case `too_small`: { - let e = o(t.origin), n = i(t.origin ?? `value`); - if (t.origin === `string`) return `${e?.shortLabel ?? `קצר`} מדי: ${n} צריכה להכיל ${t.minimum.toString()} ${e?.unit ?? ``} ${t.inclusive ? `או יותר` : `לפחות`}`.trim(); - if (t.origin === `number`) return `קטן מדי: ${n} צריך להיות ${t.inclusive ? `גדול או שווה ל-${t.minimum}` : `גדול מ-${t.minimum}`}`; - if (t.origin === `array` || t.origin === `set`) { - let r = t.origin === `set` ? `צריכה` : `צריך`; - return t.minimum === 1 && t.inclusive ? `קטן מדי: ${n} ${r} להכיל ${t.origin, `לפחות פריט אחד`}` : `קטן מדי: ${n} ${r} להכיל ${t.inclusive ? `${t.minimum} ${e?.unit ?? ``} או יותר` : `יותר מ-${t.minimum} ${e?.unit ?? ``}`}`.trim(); - } - let r = t.inclusive ? `>=` : `>`, s = a(t.origin ?? `value`); - return e?.unit ? `${e.shortLabel} מדי: ${n} ${s} ${r}${t.minimum.toString()} ${e.unit}` : `${e?.shortLabel ?? `קטן`} מדי: ${n} ${s} ${r}${t.minimum.toString()}`; - } - case `invalid_format`: { - let e = t; - if (e.format === `starts_with`) return `המחרוזת חייבת להתחיל ב "${e.prefix}"`; - if (e.format === `ends_with`) return `המחרוזת חייבת להסתיים ב "${e.suffix}"`; - if (e.format === `includes`) return `המחרוזת חייבת לכלול "${e.includes}"`; - if (e.format === `regex`) return `המחרוזת חייבת להתאים לתבנית ${e.pattern}`; - let n = s[e.format]; - return `${n?.label ?? e.format} לא ${(n?.gender ?? `m`) === `f` ? `תקינה` : `תקין`}`; - } - case `not_multiple_of`: return `מספר לא תקין: חייב להיות מכפלה של ${t.divisor}`; - case `unrecognized_keys`: return `מפתח${t.keys.length > 1 ? `ות` : ``} לא מזוה${t.keys.length > 1 ? `ים` : `ה`}: ${C$10(t.keys, `, `)}`; - case `invalid_key`: return `שדה לא תקין באובייקט`; - case `invalid_union`: return `קלט לא תקין`; - case `invalid_element`: return `ערך לא תקין ב${i(t.origin ?? `array`)}`; - default: return `קלט לא תקין`; - } - }; -}; -function yo$2() { - return { localeError: vo$2() }; -} -const bo$2 = () => { - let e = { - string: { - unit: `karakter`, - verb: `legyen` - }, - file: { - unit: `byte`, - verb: `legyen` - }, - array: { - unit: `elem`, - verb: `legyen` - }, - set: { - unit: `elem`, - verb: `legyen` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `bemenet`, - email: `email cím`, - url: `URL`, - emoji: `emoji`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `ISO időbélyeg`, - date: `ISO dátum`, - time: `ISO idő`, - duration: `ISO időintervallum`, - ipv4: `IPv4 cím`, - ipv6: `IPv6 cím`, - cidrv4: `IPv4 tartomány`, - cidrv6: `IPv6 tartomány`, - base64: `base64-kódolt string`, - base64url: `base64url-kódolt string`, - json_string: `JSON string`, - e164: `E.164 szám`, - jwt: `JWT`, - template_literal: `bemenet` - }, r = { - nan: `NaN`, - number: `szám`, - array: `tömb` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = D$9(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `Érvénytelen bemenet: a várt érték instanceof ${e.expected}, a kapott érték ${i}` : `Érvénytelen bemenet: a várt érték ${t}, a kapott érték ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `Érvénytelen bemenet: a várt érték ${E$10(e.values[0])}` : `Érvénytelen opció: valamelyik érték várt ${C$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? `Túl nagy: ${e.origin ?? `érték`} mérete túl nagy ${n}${e.maximum.toString()} ${r.unit ?? `elem`}` : `Túl nagy: a bemeneti érték ${e.origin ?? `érték`} túl nagy: ${n}${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `Túl kicsi: a bemeneti érték ${e.origin} mérete túl kicsi ${n}${e.minimum.toString()} ${r.unit}` : `Túl kicsi: a bemeneti érték ${e.origin} túl kicsi ${n}${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `Érvénytelen string: "${t.prefix}" értékkel kell kezdődnie` : t.format === `ends_with` ? `Érvénytelen string: "${t.suffix}" értékkel kell végződnie` : t.format === `includes` ? `Érvénytelen string: "${t.includes}" értéket kell tartalmaznia` : t.format === `regex` ? `Érvénytelen string: ${t.pattern} mintának kell megfelelnie` : `Érvénytelen ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `Érvénytelen szám: ${e.divisor} többszörösének kell lennie`; - case `unrecognized_keys`: return `Ismeretlen kulcs${e.keys.length > 1 ? `s` : ``}: ${C$10(e.keys, `, `)}`; - case `invalid_key`: return `Érvénytelen kulcs ${e.origin}`; - case `invalid_union`: return `Érvénytelen bemenet`; - case `invalid_element`: return `Érvénytelen érték: ${e.origin}`; - default: return `Érvénytelen bemenet`; - } - }; -}; -function xo$2() { - return { localeError: bo$2() }; -} -function So$2(e, t, n) { - return Math.abs(e) === 1 ? t : n; -} -function Co$2(e) { - if (!e) return ``; - let t = [ - `ա`, - `ե`, - `ը`, - `ի`, - `ո`, - `ու`, - `օ` - ], n = e[e.length - 1]; - return e + (t.includes(n) ? `ն` : `ը`); -} -const wo$2 = () => { - let e = { - string: { - unit: { - one: `նշան`, - many: `նշաններ` - }, - verb: `ունենալ` - }, - file: { - unit: { - one: `բայթ`, - many: `բայթեր` - }, - verb: `ունենալ` - }, - array: { - unit: { - one: `տարր`, - many: `տարրեր` - }, - verb: `ունենալ` - }, - set: { - unit: { - one: `տարր`, - many: `տարրեր` - }, - verb: `ունենալ` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `մուտք`, - email: `էլ. հասցե`, - url: `URL`, - emoji: `էմոջի`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `ISO ամսաթիվ և ժամ`, - date: `ISO ամսաթիվ`, - time: `ISO ժամ`, - duration: `ISO տևողություն`, - ipv4: `IPv4 հասցե`, - ipv6: `IPv6 հասցե`, - cidrv4: `IPv4 միջակայք`, - cidrv6: `IPv6 միջակայք`, - base64: `base64 ձևաչափով տող`, - base64url: `base64url ձևաչափով տող`, - json_string: `JSON տող`, - e164: `E.164 համար`, - jwt: `JWT`, - template_literal: `մուտք` - }, r = { - nan: `NaN`, - number: `թիվ`, - array: `զանգված` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = D$9(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `Սխալ մուտքագրում․ սպասվում էր instanceof ${e.expected}, ստացվել է ${i}` : `Սխալ մուտքագրում․ սպասվում էր ${t}, ստացվել է ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `Սխալ մուտքագրում․ սպասվում էր ${E$10(e.values[1])}` : `Սխալ տարբերակ․ սպասվում էր հետևյալներից մեկը՝ ${C$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - if (r) { - let t = So$2(Number(e.maximum), r.unit.one, r.unit.many); - return `Չափազանց մեծ արժեք․ սպասվում է, որ ${Co$2(e.origin ?? `արժեք`)} կունենա ${n}${e.maximum.toString()} ${t}`; - } - return `Չափազանց մեծ արժեք․ սպասվում է, որ ${Co$2(e.origin ?? `արժեք`)} լինի ${n}${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - if (r) { - let t = So$2(Number(e.minimum), r.unit.one, r.unit.many); - return `Չափազանց փոքր արժեք․ սպասվում է, որ ${Co$2(e.origin)} կունենա ${n}${e.minimum.toString()} ${t}`; - } - return `Չափազանց փոքր արժեք․ սպասվում է, որ ${Co$2(e.origin)} լինի ${n}${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `Սխալ տող․ պետք է սկսվի "${t.prefix}"-ով` : t.format === `ends_with` ? `Սխալ տող․ պետք է ավարտվի "${t.suffix}"-ով` : t.format === `includes` ? `Սխալ տող․ պետք է պարունակի "${t.includes}"` : t.format === `regex` ? `Սխալ տող․ պետք է համապատասխանի ${t.pattern} ձևաչափին` : `Սխալ ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `Սխալ թիվ․ պետք է բազմապատիկ լինի ${e.divisor}-ի`; - case `unrecognized_keys`: return `Չճանաչված բանալի${e.keys.length > 1 ? `ներ` : ``}. ${C$10(e.keys, `, `)}`; - case `invalid_key`: return `Սխալ բանալի ${Co$2(e.origin)}-ում`; - case `invalid_union`: return `Սխալ մուտքագրում`; - case `invalid_element`: return `Սխալ արժեք ${Co$2(e.origin)}-ում`; - default: return `Սխալ մուտքագրում`; - } - }; -}; -function To$2() { - return { localeError: wo$2() }; -} -const Eo$2 = () => { - let e = { - string: { - unit: `karakter`, - verb: `memiliki` - }, - file: { - unit: `byte`, - verb: `memiliki` - }, - array: { - unit: `item`, - verb: `memiliki` - }, - set: { - unit: `item`, - verb: `memiliki` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `input`, - email: `alamat email`, - url: `URL`, - emoji: `emoji`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `tanggal dan waktu format ISO`, - date: `tanggal format ISO`, - time: `jam format ISO`, - duration: `durasi format ISO`, - ipv4: `alamat IPv4`, - ipv6: `alamat IPv6`, - cidrv4: `rentang alamat IPv4`, - cidrv6: `rentang alamat IPv6`, - base64: `string dengan enkode base64`, - base64url: `string dengan enkode base64url`, - json_string: `string JSON`, - e164: `angka E.164`, - jwt: `JWT`, - template_literal: `input` - }, r = { nan: `NaN` }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = D$9(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `Input tidak valid: diharapkan instanceof ${e.expected}, diterima ${i}` : `Input tidak valid: diharapkan ${t}, diterima ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `Input tidak valid: diharapkan ${E$10(e.values[0])}` : `Pilihan tidak valid: diharapkan salah satu dari ${C$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? `Terlalu besar: diharapkan ${e.origin ?? `value`} memiliki ${n}${e.maximum.toString()} ${r.unit ?? `elemen`}` : `Terlalu besar: diharapkan ${e.origin ?? `value`} menjadi ${n}${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `Terlalu kecil: diharapkan ${e.origin} memiliki ${n}${e.minimum.toString()} ${r.unit}` : `Terlalu kecil: diharapkan ${e.origin} menjadi ${n}${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `String tidak valid: harus dimulai dengan "${t.prefix}"` : t.format === `ends_with` ? `String tidak valid: harus berakhir dengan "${t.suffix}"` : t.format === `includes` ? `String tidak valid: harus menyertakan "${t.includes}"` : t.format === `regex` ? `String tidak valid: harus sesuai pola ${t.pattern}` : `${n[t.format] ?? e.format} tidak valid`; - } - case `not_multiple_of`: return `Angka tidak valid: harus kelipatan dari ${e.divisor}`; - case `unrecognized_keys`: return `Kunci tidak dikenali ${e.keys.length > 1 ? `s` : ``}: ${C$10(e.keys, `, `)}`; - case `invalid_key`: return `Kunci tidak valid di ${e.origin}`; - case `invalid_union`: return `Input tidak valid`; - case `invalid_element`: return `Nilai tidak valid di ${e.origin}`; - default: return `Input tidak valid`; - } - }; -}; -function Do$2() { - return { localeError: Eo$2() }; -} -const Oo$2 = () => { - let e = { - string: { - unit: `stafi`, - verb: `að hafa` - }, - file: { - unit: `bæti`, - verb: `að hafa` - }, - array: { - unit: `hluti`, - verb: `að hafa` - }, - set: { - unit: `hluti`, - verb: `að hafa` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `gildi`, - email: `netfang`, - url: `vefslóð`, - emoji: `emoji`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `ISO dagsetning og tími`, - date: `ISO dagsetning`, - time: `ISO tími`, - duration: `ISO tímalengd`, - ipv4: `IPv4 address`, - ipv6: `IPv6 address`, - cidrv4: `IPv4 range`, - cidrv6: `IPv6 range`, - base64: `base64-encoded strengur`, - base64url: `base64url-encoded strengur`, - json_string: `JSON strengur`, - e164: `E.164 tölugildi`, - jwt: `JWT`, - template_literal: `gildi` - }, r = { - nan: `NaN`, - number: `númer`, - array: `fylki` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = D$9(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `Rangt gildi: Þú slóst inn ${i} þar sem á að vera instanceof ${e.expected}` : `Rangt gildi: Þú slóst inn ${i} þar sem á að vera ${t}`; - } - case `invalid_value`: return e.values.length === 1 ? `Rangt gildi: gert ráð fyrir ${E$10(e.values[0])}` : `Ógilt val: má vera eitt af eftirfarandi ${C$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? `Of stórt: gert er ráð fyrir að ${e.origin ?? `gildi`} hafi ${n}${e.maximum.toString()} ${r.unit ?? `hluti`}` : `Of stórt: gert er ráð fyrir að ${e.origin ?? `gildi`} sé ${n}${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `Of lítið: gert er ráð fyrir að ${e.origin} hafi ${n}${e.minimum.toString()} ${r.unit}` : `Of lítið: gert er ráð fyrir að ${e.origin} sé ${n}${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `Ógildur strengur: verður að byrja á "${t.prefix}"` : t.format === `ends_with` ? `Ógildur strengur: verður að enda á "${t.suffix}"` : t.format === `includes` ? `Ógildur strengur: verður að innihalda "${t.includes}"` : t.format === `regex` ? `Ógildur strengur: verður að fylgja mynstri ${t.pattern}` : `Rangt ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `Röng tala: verður að vera margfeldi af ${e.divisor}`; - case `unrecognized_keys`: return `Óþekkt ${e.keys.length > 1 ? `ir lyklar` : `ur lykill`}: ${C$10(e.keys, `, `)}`; - case `invalid_key`: return `Rangur lykill í ${e.origin}`; - case `invalid_union`: return `Rangt gildi`; - case `invalid_element`: return `Rangt gildi í ${e.origin}`; - default: return `Rangt gildi`; - } - }; -}; -function ko$2() { - return { localeError: Oo$2() }; -} -const Ao$2 = () => { - let e = { - string: { - unit: `caratteri`, - verb: `avere` - }, - file: { - unit: `byte`, - verb: `avere` - }, - array: { - unit: `elementi`, - verb: `avere` - }, - set: { - unit: `elementi`, - verb: `avere` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `input`, - email: `indirizzo email`, - url: `URL`, - emoji: `emoji`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `data e ora ISO`, - date: `data ISO`, - time: `ora ISO`, - duration: `durata ISO`, - ipv4: `indirizzo IPv4`, - ipv6: `indirizzo IPv6`, - cidrv4: `intervallo IPv4`, - cidrv6: `intervallo IPv6`, - base64: `stringa codificata in base64`, - base64url: `URL codificata in base64`, - json_string: `stringa JSON`, - e164: `numero E.164`, - jwt: `JWT`, - template_literal: `input` - }, r = { - nan: `NaN`, - number: `numero`, - array: `vettore` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = D$9(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `Input non valido: atteso instanceof ${e.expected}, ricevuto ${i}` : `Input non valido: atteso ${t}, ricevuto ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `Input non valido: atteso ${E$10(e.values[0])}` : `Opzione non valida: atteso uno tra ${C$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? `Troppo grande: ${e.origin ?? `valore`} deve avere ${n}${e.maximum.toString()} ${r.unit ?? `elementi`}` : `Troppo grande: ${e.origin ?? `valore`} deve essere ${n}${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `Troppo piccolo: ${e.origin} deve avere ${n}${e.minimum.toString()} ${r.unit}` : `Troppo piccolo: ${e.origin} deve essere ${n}${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `Stringa non valida: deve iniziare con "${t.prefix}"` : t.format === `ends_with` ? `Stringa non valida: deve terminare con "${t.suffix}"` : t.format === `includes` ? `Stringa non valida: deve includere "${t.includes}"` : t.format === `regex` ? `Stringa non valida: deve corrispondere al pattern ${t.pattern}` : `Invalid ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `Numero non valido: deve essere un multiplo di ${e.divisor}`; - case `unrecognized_keys`: return `Chiav${e.keys.length > 1 ? `i` : `e`} non riconosciut${e.keys.length > 1 ? `e` : `a`}: ${C$10(e.keys, `, `)}`; - case `invalid_key`: return `Chiave non valida in ${e.origin}`; - case `invalid_union`: return `Input non valido`; - case `invalid_element`: return `Valore non valido in ${e.origin}`; - default: return `Input non valido`; - } - }; -}; -function jo$2() { - return { localeError: Ao$2() }; -} -const Mo$2 = () => { - let e = { - string: { - unit: `文字`, - verb: `である` - }, - file: { - unit: `バイト`, - verb: `である` - }, - array: { - unit: `要素`, - verb: `である` - }, - set: { - unit: `要素`, - verb: `である` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `入力値`, - email: `メールアドレス`, - url: `URL`, - emoji: `絵文字`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `ISO日時`, - date: `ISO日付`, - time: `ISO時刻`, - duration: `ISO期間`, - ipv4: `IPv4アドレス`, - ipv6: `IPv6アドレス`, - cidrv4: `IPv4範囲`, - cidrv6: `IPv6範囲`, - base64: `base64エンコード文字列`, - base64url: `base64urlエンコード文字列`, - json_string: `JSON文字列`, - e164: `E.164番号`, - jwt: `JWT`, - template_literal: `入力値` - }, r = { - nan: `NaN`, - number: `数値`, - array: `配列` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = D$9(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `無効な入力: instanceof ${e.expected}が期待されましたが、${i}が入力されました` : `無効な入力: ${t}が期待されましたが、${i}が入力されました`; - } - case `invalid_value`: return e.values.length === 1 ? `無効な入力: ${E$10(e.values[0])}が期待されました` : `無効な選択: ${C$10(e.values, `、`)}のいずれかである必要があります`; - case `too_big`: { - let n = e.inclusive ? `以下である` : `より小さい`, r = t(e.origin); - return r ? `大きすぎる値: ${e.origin ?? `値`}は${e.maximum.toString()}${r.unit ?? `要素`}${n}必要があります` : `大きすぎる値: ${e.origin ?? `値`}は${e.maximum.toString()}${n}必要があります`; - } - case `too_small`: { - let n = e.inclusive ? `以上である` : `より大きい`, r = t(e.origin); - return r ? `小さすぎる値: ${e.origin}は${e.minimum.toString()}${r.unit}${n}必要があります` : `小さすぎる値: ${e.origin}は${e.minimum.toString()}${n}必要があります`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `無効な文字列: "${t.prefix}"で始まる必要があります` : t.format === `ends_with` ? `無効な文字列: "${t.suffix}"で終わる必要があります` : t.format === `includes` ? `無効な文字列: "${t.includes}"を含む必要があります` : t.format === `regex` ? `無効な文字列: パターン${t.pattern}に一致する必要があります` : `無効な${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `無効な数値: ${e.divisor}の倍数である必要があります`; - case `unrecognized_keys`: return `認識されていないキー${e.keys.length > 1 ? `群` : ``}: ${C$10(e.keys, `、`)}`; - case `invalid_key`: return `${e.origin}内の無効なキー`; - case `invalid_union`: return `無効な入力`; - case `invalid_element`: return `${e.origin}内の無効な値`; - default: return `無効な入力`; - } - }; -}; -function No$2() { - return { localeError: Mo$2() }; -} -const Po$2 = () => { - let e = { - string: { - unit: `სიმბოლო`, - verb: `უნდა შეიცავდეს` - }, - file: { - unit: `ბაიტი`, - verb: `უნდა შეიცავდეს` - }, - array: { - unit: `ელემენტი`, - verb: `უნდა შეიცავდეს` - }, - set: { - unit: `ელემენტი`, - verb: `უნდა შეიცავდეს` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `შეყვანა`, - email: `ელ-ფოსტის მისამართი`, - url: `URL`, - emoji: `ემოჯი`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `თარიღი-დრო`, - date: `თარიღი`, - time: `დრო`, - duration: `ხანგრძლივობა`, - ipv4: `IPv4 მისამართი`, - ipv6: `IPv6 მისამართი`, - cidrv4: `IPv4 დიაპაზონი`, - cidrv6: `IPv6 დიაპაზონი`, - base64: `base64-კოდირებული სტრინგი`, - base64url: `base64url-კოდირებული სტრინგი`, - json_string: `JSON სტრინგი`, - e164: `E.164 ნომერი`, - jwt: `JWT`, - template_literal: `შეყვანა` - }, r = { - nan: `NaN`, - number: `რიცხვი`, - string: `სტრინგი`, - boolean: `ბულეანი`, - function: `ფუნქცია`, - array: `მასივი` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = D$9(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `არასწორი შეყვანა: მოსალოდნელი instanceof ${e.expected}, მიღებული ${i}` : `არასწორი შეყვანა: მოსალოდნელი ${t}, მიღებული ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `არასწორი შეყვანა: მოსალოდნელი ${E$10(e.values[0])}` : `არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${C$10(e.values, `|`)}-დან`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? `ზედმეტად დიდი: მოსალოდნელი ${e.origin ?? `მნიშვნელობა`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit}` : `ზედმეტად დიდი: მოსალოდნელი ${e.origin ?? `მნიშვნელობა`} იყოს ${n}${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `ზედმეტად პატარა: მოსალოდნელი ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}` : `ზედმეტად პატარა: მოსალოდნელი ${e.origin} იყოს ${n}${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `არასწორი სტრინგი: უნდა იწყებოდეს "${t.prefix}"-ით` : t.format === `ends_with` ? `არასწორი სტრინგი: უნდა მთავრდებოდეს "${t.suffix}"-ით` : t.format === `includes` ? `არასწორი სტრინგი: უნდა შეიცავდეს "${t.includes}"-ს` : t.format === `regex` ? `არასწორი სტრინგი: უნდა შეესაბამებოდეს შაბლონს ${t.pattern}` : `არასწორი ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `არასწორი რიცხვი: უნდა იყოს ${e.divisor}-ის ჯერადი`; - case `unrecognized_keys`: return `უცნობი გასაღებ${e.keys.length > 1 ? `ები` : `ი`}: ${C$10(e.keys, `, `)}`; - case `invalid_key`: return `არასწორი გასაღები ${e.origin}-ში`; - case `invalid_union`: return `არასწორი შეყვანა`; - case `invalid_element`: return `არასწორი მნიშვნელობა ${e.origin}-ში`; - default: return `არასწორი შეყვანა`; - } - }; -}; -function Fo$2() { - return { localeError: Po$2() }; -} -const Io$2 = () => { - let e = { - string: { - unit: `តួអក្សរ`, - verb: `គួរមាន` - }, - file: { - unit: `បៃ`, - verb: `គួរមាន` - }, - array: { - unit: `ធាតុ`, - verb: `គួរមាន` - }, - set: { - unit: `ធាតុ`, - verb: `គួរមាន` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `ទិន្នន័យបញ្ចូល`, - email: `អាសយដ្ឋានអ៊ីមែល`, - url: `URL`, - emoji: `សញ្ញាអារម្មណ៍`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `កាលបរិច្ឆេទ និងម៉ោង ISO`, - date: `កាលបរិច្ឆេទ ISO`, - time: `ម៉ោង ISO`, - duration: `រយៈពេល ISO`, - ipv4: `អាសយដ្ឋាន IPv4`, - ipv6: `អាសយដ្ឋាន IPv6`, - cidrv4: `ដែនអាសយដ្ឋាន IPv4`, - cidrv6: `ដែនអាសយដ្ឋាន IPv6`, - base64: `ខ្សែអក្សរអ៊ិកូដ base64`, - base64url: `ខ្សែអក្សរអ៊ិកូដ base64url`, - json_string: `ខ្សែអក្សរ JSON`, - e164: `លេខ E.164`, - jwt: `JWT`, - template_literal: `ទិន្នន័យបញ្ចូល` - }, r = { - nan: `NaN`, - number: `លេខ`, - array: `អារេ (Array)`, - null: `គ្មានតម្លៃ (null)` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = D$9(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ instanceof ${e.expected} ប៉ុន្តែទទួលបាន ${i}` : `ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${t} ប៉ុន្តែទទួលបាន ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${E$10(e.values[0])}` : `ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${C$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? `ធំពេក៖ ត្រូវការ ${e.origin ?? `តម្លៃ`} ${n} ${e.maximum.toString()} ${r.unit ?? `ធាតុ`}` : `ធំពេក៖ ត្រូវការ ${e.origin ?? `តម្លៃ`} ${n} ${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `តូចពេក៖ ត្រូវការ ${e.origin} ${n} ${e.minimum.toString()} ${r.unit}` : `តូចពេក៖ ត្រូវការ ${e.origin} ${n} ${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${t.prefix}"` : t.format === `ends_with` ? `ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${t.suffix}"` : t.format === `includes` ? `ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${t.includes}"` : t.format === `regex` ? `ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${t.pattern}` : `មិនត្រឹមត្រូវ៖ ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${e.divisor}`; - case `unrecognized_keys`: return `រកឃើញសោមិនស្គាល់៖ ${C$10(e.keys, `, `)}`; - case `invalid_key`: return `សោមិនត្រឹមត្រូវនៅក្នុង ${e.origin}`; - case `invalid_union`: return `ទិន្នន័យមិនត្រឹមត្រូវ`; - case `invalid_element`: return `ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${e.origin}`; - default: return `ទិន្នន័យមិនត្រឹមត្រូវ`; - } - }; -}; -function Lo$2() { - return { localeError: Io$2() }; -} -function Ro$2() { - return Lo$2(); -} -const zo$2 = () => { - let e = { - string: { - unit: `문자`, - verb: `to have` - }, - file: { - unit: `바이트`, - verb: `to have` - }, - array: { - unit: `개`, - verb: `to have` - }, - set: { - unit: `개`, - verb: `to have` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `입력`, - email: `이메일 주소`, - url: `URL`, - emoji: `이모지`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `ISO 날짜시간`, - date: `ISO 날짜`, - time: `ISO 시간`, - duration: `ISO 기간`, - ipv4: `IPv4 주소`, - ipv6: `IPv6 주소`, - cidrv4: `IPv4 범위`, - cidrv6: `IPv6 범위`, - base64: `base64 인코딩 문자열`, - base64url: `base64url 인코딩 문자열`, - json_string: `JSON 문자열`, - e164: `E.164 번호`, - jwt: `JWT`, - template_literal: `입력` - }, r = { nan: `NaN` }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = D$9(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `잘못된 입력: 예상 타입은 instanceof ${e.expected}, 받은 타입은 ${i}입니다` : `잘못된 입력: 예상 타입은 ${t}, 받은 타입은 ${i}입니다`; - } - case `invalid_value`: return e.values.length === 1 ? `잘못된 입력: 값은 ${E$10(e.values[0])} 이어야 합니다` : `잘못된 옵션: ${C$10(e.values, `또는 `)} 중 하나여야 합니다`; - case `too_big`: { - let n = e.inclusive ? `이하` : `미만`, r = n === `미만` ? `이어야 합니다` : `여야 합니다`, i = t(e.origin), a = i?.unit ?? `요소`; - return i ? `${e.origin ?? `값`}이 너무 큽니다: ${e.maximum.toString()}${a} ${n}${r}` : `${e.origin ?? `값`}이 너무 큽니다: ${e.maximum.toString()} ${n}${r}`; - } - case `too_small`: { - let n = e.inclusive ? `이상` : `초과`, r = n === `이상` ? `이어야 합니다` : `여야 합니다`, i = t(e.origin), a = i?.unit ?? `요소`; - return i ? `${e.origin ?? `값`}이 너무 작습니다: ${e.minimum.toString()}${a} ${n}${r}` : `${e.origin ?? `값`}이 너무 작습니다: ${e.minimum.toString()} ${n}${r}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `잘못된 문자열: "${t.prefix}"(으)로 시작해야 합니다` : t.format === `ends_with` ? `잘못된 문자열: "${t.suffix}"(으)로 끝나야 합니다` : t.format === `includes` ? `잘못된 문자열: "${t.includes}"을(를) 포함해야 합니다` : t.format === `regex` ? `잘못된 문자열: 정규식 ${t.pattern} 패턴과 일치해야 합니다` : `잘못된 ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `잘못된 숫자: ${e.divisor}의 배수여야 합니다`; - case `unrecognized_keys`: return `인식할 수 없는 키: ${C$10(e.keys, `, `)}`; - case `invalid_key`: return `잘못된 키: ${e.origin}`; - case `invalid_union`: return `잘못된 입력`; - case `invalid_element`: return `잘못된 값: ${e.origin}`; - default: return `잘못된 입력`; - } - }; -}; -function Bo$2() { - return { localeError: zo$2() }; -} -const Vo$2 = (e) => e.charAt(0).toUpperCase() + e.slice(1); -function Ho$2(e) { - let t = Math.abs(e), n = t % 10, r = t % 100; - return r >= 11 && r <= 19 || n === 0 ? `many` : n === 1 ? `one` : `few`; -} -const Uo$2 = () => { - let e = { - string: { - unit: { - one: `simbolis`, - few: `simboliai`, - many: `simbolių` - }, - verb: { - smaller: { - inclusive: `turi būti ne ilgesnė kaip`, - notInclusive: `turi būti trumpesnė kaip` - }, - bigger: { - inclusive: `turi būti ne trumpesnė kaip`, - notInclusive: `turi būti ilgesnė kaip` - } - } - }, - file: { - unit: { - one: `baitas`, - few: `baitai`, - many: `baitų` - }, - verb: { - smaller: { - inclusive: `turi būti ne didesnis kaip`, - notInclusive: `turi būti mažesnis kaip` - }, - bigger: { - inclusive: `turi būti ne mažesnis kaip`, - notInclusive: `turi būti didesnis kaip` - } - } - }, - array: { - unit: { - one: `elementą`, - few: `elementus`, - many: `elementų` - }, - verb: { - smaller: { - inclusive: `turi turėti ne daugiau kaip`, - notInclusive: `turi turėti mažiau kaip` - }, - bigger: { - inclusive: `turi turėti ne mažiau kaip`, - notInclusive: `turi turėti daugiau kaip` - } - } - }, - set: { - unit: { - one: `elementą`, - few: `elementus`, - many: `elementų` - }, - verb: { - smaller: { - inclusive: `turi turėti ne daugiau kaip`, - notInclusive: `turi turėti mažiau kaip` - }, - bigger: { - inclusive: `turi turėti ne mažiau kaip`, - notInclusive: `turi turėti daugiau kaip` - } - } - } - }; - function t(t, n, r, i) { - let a = e[t] ?? null; - return a === null ? a : { - unit: a.unit[n], - verb: a.verb[i][r ? `inclusive` : `notInclusive`] - }; - } - let n = { - regex: `įvestis`, - email: `el. pašto adresas`, - url: `URL`, - emoji: `jaustukas`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `ISO data ir laikas`, - date: `ISO data`, - time: `ISO laikas`, - duration: `ISO trukmė`, - ipv4: `IPv4 adresas`, - ipv6: `IPv6 adresas`, - cidrv4: `IPv4 tinklo prefiksas (CIDR)`, - cidrv6: `IPv6 tinklo prefiksas (CIDR)`, - base64: `base64 užkoduota eilutė`, - base64url: `base64url užkoduota eilutė`, - json_string: `JSON eilutė`, - e164: `E.164 numeris`, - jwt: `JWT`, - template_literal: `įvestis` - }, r = { - nan: `NaN`, - number: `skaičius`, - bigint: `sveikasis skaičius`, - string: `eilutė`, - boolean: `loginė reikšmė`, - undefined: `neapibrėžta reikšmė`, - function: `funkcija`, - symbol: `simbolis`, - array: `masyvas`, - object: `objektas`, - null: `nulinė reikšmė` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = D$9(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `Gautas tipas ${i}, o tikėtasi - instanceof ${e.expected}` : `Gautas tipas ${i}, o tikėtasi - ${t}`; - } - case `invalid_value`: return e.values.length === 1 ? `Privalo būti ${E$10(e.values[0])}` : `Privalo būti vienas iš ${C$10(e.values, `|`)} pasirinkimų`; - case `too_big`: { - let n = r[e.origin] ?? e.origin, i = t(e.origin, Ho$2(Number(e.maximum)), e.inclusive ?? !1, `smaller`); - if (i?.verb) return `${Vo$2(n ?? e.origin ?? `reikšmė`)} ${i.verb} ${e.maximum.toString()} ${i.unit ?? `elementų`}`; - let a = e.inclusive ? `ne didesnis kaip` : `mažesnis kaip`; - return `${Vo$2(n ?? e.origin ?? `reikšmė`)} turi būti ${a} ${e.maximum.toString()} ${i?.unit}`; - } - case `too_small`: { - let n = r[e.origin] ?? e.origin, i = t(e.origin, Ho$2(Number(e.minimum)), e.inclusive ?? !1, `bigger`); - if (i?.verb) return `${Vo$2(n ?? e.origin ?? `reikšmė`)} ${i.verb} ${e.minimum.toString()} ${i.unit ?? `elementų`}`; - let a = e.inclusive ? `ne mažesnis kaip` : `didesnis kaip`; - return `${Vo$2(n ?? e.origin ?? `reikšmė`)} turi būti ${a} ${e.minimum.toString()} ${i?.unit}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `Eilutė privalo prasidėti "${t.prefix}"` : t.format === `ends_with` ? `Eilutė privalo pasibaigti "${t.suffix}"` : t.format === `includes` ? `Eilutė privalo įtraukti "${t.includes}"` : t.format === `regex` ? `Eilutė privalo atitikti ${t.pattern}` : `Neteisingas ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `Skaičius privalo būti ${e.divisor} kartotinis.`; - case `unrecognized_keys`: return `Neatpažint${e.keys.length > 1 ? `i` : `as`} rakt${e.keys.length > 1 ? `ai` : `as`}: ${C$10(e.keys, `, `)}`; - case `invalid_key`: return `Rastas klaidingas raktas`; - case `invalid_union`: return `Klaidinga įvestis`; - case `invalid_element`: return `${Vo$2(r[e.origin] ?? e.origin ?? e.origin ?? `reikšmė`)} turi klaidingą įvestį`; - default: return `Klaidinga įvestis`; - } - }; -}; -function Wo$2() { - return { localeError: Uo$2() }; -} -const Go$2 = () => { - let e = { - string: { - unit: `знаци`, - verb: `да имаат` - }, - file: { - unit: `бајти`, - verb: `да имаат` - }, - array: { - unit: `ставки`, - verb: `да имаат` - }, - set: { - unit: `ставки`, - verb: `да имаат` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `внес`, - email: `адреса на е-пошта`, - url: `URL`, - emoji: `емоџи`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `ISO датум и време`, - date: `ISO датум`, - time: `ISO време`, - duration: `ISO времетраење`, - ipv4: `IPv4 адреса`, - ipv6: `IPv6 адреса`, - cidrv4: `IPv4 опсег`, - cidrv6: `IPv6 опсег`, - base64: `base64-енкодирана низа`, - base64url: `base64url-енкодирана низа`, - json_string: `JSON низа`, - e164: `E.164 број`, - jwt: `JWT`, - template_literal: `внес` - }, r = { - nan: `NaN`, - number: `број`, - array: `низа` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = D$9(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `Грешен внес: се очекува instanceof ${e.expected}, примено ${i}` : `Грешен внес: се очекува ${t}, примено ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `Invalid input: expected ${E$10(e.values[0])}` : `Грешана опција: се очекува една ${C$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? `Премногу голем: се очекува ${e.origin ?? `вредноста`} да има ${n}${e.maximum.toString()} ${r.unit ?? `елементи`}` : `Премногу голем: се очекува ${e.origin ?? `вредноста`} да биде ${n}${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `Премногу мал: се очекува ${e.origin} да има ${n}${e.minimum.toString()} ${r.unit}` : `Премногу мал: се очекува ${e.origin} да биде ${n}${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `Неважечка низа: мора да започнува со "${t.prefix}"` : t.format === `ends_with` ? `Неважечка низа: мора да завршува со "${t.suffix}"` : t.format === `includes` ? `Неважечка низа: мора да вклучува "${t.includes}"` : t.format === `regex` ? `Неважечка низа: мора да одгоара на патернот ${t.pattern}` : `Invalid ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `Грешен број: мора да биде делив со ${e.divisor}`; - case `unrecognized_keys`: return `${e.keys.length > 1 ? `Непрепознаени клучеви` : `Непрепознаен клуч`}: ${C$10(e.keys, `, `)}`; - case `invalid_key`: return `Грешен клуч во ${e.origin}`; - case `invalid_union`: return `Грешен внес`; - case `invalid_element`: return `Грешна вредност во ${e.origin}`; - default: return `Грешен внес`; - } - }; -}; -function Ko$2() { - return { localeError: Go$2() }; -} -const qo$2 = () => { - let e = { - string: { - unit: `aksara`, - verb: `mempunyai` - }, - file: { - unit: `bait`, - verb: `mempunyai` - }, - array: { - unit: `elemen`, - verb: `mempunyai` - }, - set: { - unit: `elemen`, - verb: `mempunyai` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `input`, - email: `alamat e-mel`, - url: `URL`, - emoji: `emoji`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `tarikh masa ISO`, - date: `tarikh ISO`, - time: `masa ISO`, - duration: `tempoh ISO`, - ipv4: `alamat IPv4`, - ipv6: `alamat IPv6`, - cidrv4: `julat IPv4`, - cidrv6: `julat IPv6`, - base64: `string dikodkan base64`, - base64url: `string dikodkan base64url`, - json_string: `string JSON`, - e164: `nombor E.164`, - jwt: `JWT`, - template_literal: `input` - }, r = { - nan: `NaN`, - number: `nombor` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = D$9(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `Input tidak sah: dijangka instanceof ${e.expected}, diterima ${i}` : `Input tidak sah: dijangka ${t}, diterima ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `Input tidak sah: dijangka ${E$10(e.values[0])}` : `Pilihan tidak sah: dijangka salah satu daripada ${C$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? `Terlalu besar: dijangka ${e.origin ?? `nilai`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit ?? `elemen`}` : `Terlalu besar: dijangka ${e.origin ?? `nilai`} adalah ${n}${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `Terlalu kecil: dijangka ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}` : `Terlalu kecil: dijangka ${e.origin} adalah ${n}${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `String tidak sah: mesti bermula dengan "${t.prefix}"` : t.format === `ends_with` ? `String tidak sah: mesti berakhir dengan "${t.suffix}"` : t.format === `includes` ? `String tidak sah: mesti mengandungi "${t.includes}"` : t.format === `regex` ? `String tidak sah: mesti sepadan dengan corak ${t.pattern}` : `${n[t.format] ?? e.format} tidak sah`; - } - case `not_multiple_of`: return `Nombor tidak sah: perlu gandaan ${e.divisor}`; - case `unrecognized_keys`: return `Kunci tidak dikenali: ${C$10(e.keys, `, `)}`; - case `invalid_key`: return `Kunci tidak sah dalam ${e.origin}`; - case `invalid_union`: return `Input tidak sah`; - case `invalid_element`: return `Nilai tidak sah dalam ${e.origin}`; - default: return `Input tidak sah`; - } - }; -}; -function Jo$2() { - return { localeError: qo$2() }; -} -const Yo$2 = () => { - let e = { - string: { - unit: `tekens`, - verb: `heeft` - }, - file: { - unit: `bytes`, - verb: `heeft` - }, - array: { - unit: `elementen`, - verb: `heeft` - }, - set: { - unit: `elementen`, - verb: `heeft` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `invoer`, - email: `emailadres`, - url: `URL`, - emoji: `emoji`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `ISO datum en tijd`, - date: `ISO datum`, - time: `ISO tijd`, - duration: `ISO duur`, - ipv4: `IPv4-adres`, - ipv6: `IPv6-adres`, - cidrv4: `IPv4-bereik`, - cidrv6: `IPv6-bereik`, - base64: `base64-gecodeerde tekst`, - base64url: `base64 URL-gecodeerde tekst`, - json_string: `JSON string`, - e164: `E.164-nummer`, - jwt: `JWT`, - template_literal: `invoer` - }, r = { - nan: `NaN`, - number: `getal` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = D$9(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `Ongeldige invoer: verwacht instanceof ${e.expected}, ontving ${i}` : `Ongeldige invoer: verwacht ${t}, ontving ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `Ongeldige invoer: verwacht ${E$10(e.values[0])}` : `Ongeldige optie: verwacht één van ${C$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin), i = e.origin === `date` ? `laat` : e.origin === `string` ? `lang` : `groot`; - return r ? `Te ${i}: verwacht dat ${e.origin ?? `waarde`} ${n}${e.maximum.toString()} ${r.unit ?? `elementen`} ${r.verb}` : `Te ${i}: verwacht dat ${e.origin ?? `waarde`} ${n}${e.maximum.toString()} is`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin), i = e.origin === `date` ? `vroeg` : e.origin === `string` ? `kort` : `klein`; - return r ? `Te ${i}: verwacht dat ${e.origin} ${n}${e.minimum.toString()} ${r.unit} ${r.verb}` : `Te ${i}: verwacht dat ${e.origin} ${n}${e.minimum.toString()} is`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `Ongeldige tekst: moet met "${t.prefix}" beginnen` : t.format === `ends_with` ? `Ongeldige tekst: moet op "${t.suffix}" eindigen` : t.format === `includes` ? `Ongeldige tekst: moet "${t.includes}" bevatten` : t.format === `regex` ? `Ongeldige tekst: moet overeenkomen met patroon ${t.pattern}` : `Ongeldig: ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `Ongeldig getal: moet een veelvoud van ${e.divisor} zijn`; - case `unrecognized_keys`: return `Onbekende key${e.keys.length > 1 ? `s` : ``}: ${C$10(e.keys, `, `)}`; - case `invalid_key`: return `Ongeldige key in ${e.origin}`; - case `invalid_union`: return `Ongeldige invoer`; - case `invalid_element`: return `Ongeldige waarde in ${e.origin}`; - default: return `Ongeldige invoer`; - } - }; -}; -function Xo$2() { - return { localeError: Yo$2() }; -} -const Zo$2 = () => { - let e = { - string: { - unit: `tegn`, - verb: `å ha` - }, - file: { - unit: `bytes`, - verb: `å ha` - }, - array: { - unit: `elementer`, - verb: `å inneholde` - }, - set: { - unit: `elementer`, - verb: `å inneholde` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `input`, - email: `e-postadresse`, - url: `URL`, - emoji: `emoji`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `ISO dato- og klokkeslett`, - date: `ISO-dato`, - time: `ISO-klokkeslett`, - duration: `ISO-varighet`, - ipv4: `IPv4-område`, - ipv6: `IPv6-område`, - cidrv4: `IPv4-spekter`, - cidrv6: `IPv6-spekter`, - base64: `base64-enkodet streng`, - base64url: `base64url-enkodet streng`, - json_string: `JSON-streng`, - e164: `E.164-nummer`, - jwt: `JWT`, - template_literal: `input` - }, r = { - nan: `NaN`, - number: `tall`, - array: `liste` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = D$9(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `Ugyldig input: forventet instanceof ${e.expected}, fikk ${i}` : `Ugyldig input: forventet ${t}, fikk ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `Ugyldig verdi: forventet ${E$10(e.values[0])}` : `Ugyldig valg: forventet en av ${C$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? `For stor(t): forventet ${e.origin ?? `value`} til å ha ${n}${e.maximum.toString()} ${r.unit ?? `elementer`}` : `For stor(t): forventet ${e.origin ?? `value`} til å ha ${n}${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `For lite(n): forventet ${e.origin} til å ha ${n}${e.minimum.toString()} ${r.unit}` : `For lite(n): forventet ${e.origin} til å ha ${n}${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `Ugyldig streng: må starte med "${t.prefix}"` : t.format === `ends_with` ? `Ugyldig streng: må ende med "${t.suffix}"` : t.format === `includes` ? `Ugyldig streng: må inneholde "${t.includes}"` : t.format === `regex` ? `Ugyldig streng: må matche mønsteret ${t.pattern}` : `Ugyldig ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `Ugyldig tall: må være et multiplum av ${e.divisor}`; - case `unrecognized_keys`: return `${e.keys.length > 1 ? `Ukjente nøkler` : `Ukjent nøkkel`}: ${C$10(e.keys, `, `)}`; - case `invalid_key`: return `Ugyldig nøkkel i ${e.origin}`; - case `invalid_union`: return `Ugyldig input`; - case `invalid_element`: return `Ugyldig verdi i ${e.origin}`; - default: return `Ugyldig input`; - } - }; -}; -function Qo$2() { - return { localeError: Zo$2() }; -} -const $o$2 = () => { - let e = { - string: { - unit: `harf`, - verb: `olmalıdır` - }, - file: { - unit: `bayt`, - verb: `olmalıdır` - }, - array: { - unit: `unsur`, - verb: `olmalıdır` - }, - set: { - unit: `unsur`, - verb: `olmalıdır` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `giren`, - email: `epostagâh`, - url: `URL`, - emoji: `emoji`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `ISO hengâmı`, - date: `ISO tarihi`, - time: `ISO zamanı`, - duration: `ISO müddeti`, - ipv4: `IPv4 nişânı`, - ipv6: `IPv6 nişânı`, - cidrv4: `IPv4 menzili`, - cidrv6: `IPv6 menzili`, - base64: `base64-şifreli metin`, - base64url: `base64url-şifreli metin`, - json_string: `JSON metin`, - e164: `E.164 sayısı`, - jwt: `JWT`, - template_literal: `giren` - }, r = { - nan: `NaN`, - number: `numara`, - array: `saf`, - null: `gayb` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = D$9(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `Fâsit giren: umulan instanceof ${e.expected}, alınan ${i}` : `Fâsit giren: umulan ${t}, alınan ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `Fâsit giren: umulan ${E$10(e.values[0])}` : `Fâsit tercih: mûteberler ${C$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? `Fazla büyük: ${e.origin ?? `value`}, ${n}${e.maximum.toString()} ${r.unit ?? `elements`} sahip olmalıydı.` : `Fazla büyük: ${e.origin ?? `value`}, ${n}${e.maximum.toString()} olmalıydı.`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `Fazla küçük: ${e.origin}, ${n}${e.minimum.toString()} ${r.unit} sahip olmalıydı.` : `Fazla küçük: ${e.origin}, ${n}${e.minimum.toString()} olmalıydı.`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `Fâsit metin: "${t.prefix}" ile başlamalı.` : t.format === `ends_with` ? `Fâsit metin: "${t.suffix}" ile bitmeli.` : t.format === `includes` ? `Fâsit metin: "${t.includes}" ihtivâ etmeli.` : t.format === `regex` ? `Fâsit metin: ${t.pattern} nakşına uymalı.` : `Fâsit ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `Fâsit sayı: ${e.divisor} katı olmalıydı.`; - case `unrecognized_keys`: return `Tanınmayan anahtar ${e.keys.length > 1 ? `s` : ``}: ${C$10(e.keys, `, `)}`; - case `invalid_key`: return `${e.origin} için tanınmayan anahtar var.`; - case `invalid_union`: return `Giren tanınamadı.`; - case `invalid_element`: return `${e.origin} için tanınmayan kıymet var.`; - default: return `Kıymet tanınamadı.`; - } - }; -}; -function es$2() { - return { localeError: $o$2() }; -} -const ts$2 = () => { - let e = { - string: { - unit: `توکي`, - verb: `ولري` - }, - file: { - unit: `بایټس`, - verb: `ولري` - }, - array: { - unit: `توکي`, - verb: `ولري` - }, - set: { - unit: `توکي`, - verb: `ولري` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `ورودي`, - email: `بریښنالیک`, - url: `یو آر ال`, - emoji: `ایموجي`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `نیټه او وخت`, - date: `نېټه`, - time: `وخت`, - duration: `موده`, - ipv4: `د IPv4 پته`, - ipv6: `د IPv6 پته`, - cidrv4: `د IPv4 ساحه`, - cidrv6: `د IPv6 ساحه`, - base64: `base64-encoded متن`, - base64url: `base64url-encoded متن`, - json_string: `JSON متن`, - e164: `د E.164 شمېره`, - jwt: `JWT`, - template_literal: `ورودي` - }, r = { - nan: `NaN`, - number: `عدد`, - array: `ارې` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = D$9(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `ناسم ورودي: باید instanceof ${e.expected} وای, مګر ${i} ترلاسه شو` : `ناسم ورودي: باید ${t} وای, مګر ${i} ترلاسه شو`; - } - case `invalid_value`: return e.values.length === 1 ? `ناسم ورودي: باید ${E$10(e.values[0])} وای` : `ناسم انتخاب: باید یو له ${C$10(e.values, `|`)} څخه وای`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? `ډیر لوی: ${e.origin ?? `ارزښت`} باید ${n}${e.maximum.toString()} ${r.unit ?? `عنصرونه`} ولري` : `ډیر لوی: ${e.origin ?? `ارزښت`} باید ${n}${e.maximum.toString()} وي`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `ډیر کوچنی: ${e.origin} باید ${n}${e.minimum.toString()} ${r.unit} ولري` : `ډیر کوچنی: ${e.origin} باید ${n}${e.minimum.toString()} وي`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `ناسم متن: باید د "${t.prefix}" سره پیل شي` : t.format === `ends_with` ? `ناسم متن: باید د "${t.suffix}" سره پای ته ورسيږي` : t.format === `includes` ? `ناسم متن: باید "${t.includes}" ولري` : t.format === `regex` ? `ناسم متن: باید د ${t.pattern} سره مطابقت ولري` : `${n[t.format] ?? e.format} ناسم دی`; - } - case `not_multiple_of`: return `ناسم عدد: باید د ${e.divisor} مضرب وي`; - case `unrecognized_keys`: return `ناسم ${e.keys.length > 1 ? `کلیډونه` : `کلیډ`}: ${C$10(e.keys, `, `)}`; - case `invalid_key`: return `ناسم کلیډ په ${e.origin} کې`; - case `invalid_union`: return `ناسمه ورودي`; - case `invalid_element`: return `ناسم عنصر په ${e.origin} کې`; - default: return `ناسمه ورودي`; - } - }; -}; -function ns$2() { - return { localeError: ts$2() }; -} -const rs$2 = () => { - let e = { - string: { - unit: `znaków`, - verb: `mieć` - }, - file: { - unit: `bajtów`, - verb: `mieć` - }, - array: { - unit: `elementów`, - verb: `mieć` - }, - set: { - unit: `elementów`, - verb: `mieć` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `wyrażenie`, - email: `adres email`, - url: `URL`, - emoji: `emoji`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `data i godzina w formacie ISO`, - date: `data w formacie ISO`, - time: `godzina w formacie ISO`, - duration: `czas trwania ISO`, - ipv4: `adres IPv4`, - ipv6: `adres IPv6`, - cidrv4: `zakres IPv4`, - cidrv6: `zakres IPv6`, - base64: `ciąg znaków zakodowany w formacie base64`, - base64url: `ciąg znaków zakodowany w formacie base64url`, - json_string: `ciąg znaków w formacie JSON`, - e164: `liczba E.164`, - jwt: `JWT`, - template_literal: `wejście` - }, r = { - nan: `NaN`, - number: `liczba`, - array: `tablica` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = D$9(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `Nieprawidłowe dane wejściowe: oczekiwano instanceof ${e.expected}, otrzymano ${i}` : `Nieprawidłowe dane wejściowe: oczekiwano ${t}, otrzymano ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `Nieprawidłowe dane wejściowe: oczekiwano ${E$10(e.values[0])}` : `Nieprawidłowa opcja: oczekiwano jednej z wartości ${C$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? `Za duża wartość: oczekiwano, że ${e.origin ?? `wartość`} będzie mieć ${n}${e.maximum.toString()} ${r.unit ?? `elementów`}` : `Zbyt duż(y/a/e): oczekiwano, że ${e.origin ?? `wartość`} będzie wynosić ${n}${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `Za mała wartość: oczekiwano, że ${e.origin ?? `wartość`} będzie mieć ${n}${e.minimum.toString()} ${r.unit ?? `elementów`}` : `Zbyt mał(y/a/e): oczekiwano, że ${e.origin ?? `wartość`} będzie wynosić ${n}${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `Nieprawidłowy ciąg znaków: musi zaczynać się od "${t.prefix}"` : t.format === `ends_with` ? `Nieprawidłowy ciąg znaków: musi kończyć się na "${t.suffix}"` : t.format === `includes` ? `Nieprawidłowy ciąg znaków: musi zawierać "${t.includes}"` : t.format === `regex` ? `Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${t.pattern}` : `Nieprawidłow(y/a/e) ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `Nieprawidłowa liczba: musi być wielokrotnością ${e.divisor}`; - case `unrecognized_keys`: return `Nierozpoznane klucze${e.keys.length > 1 ? `s` : ``}: ${C$10(e.keys, `, `)}`; - case `invalid_key`: return `Nieprawidłowy klucz w ${e.origin}`; - case `invalid_union`: return `Nieprawidłowe dane wejściowe`; - case `invalid_element`: return `Nieprawidłowa wartość w ${e.origin}`; - default: return `Nieprawidłowe dane wejściowe`; - } - }; -}; -function is$2() { - return { localeError: rs$2() }; -} -const as$2 = () => { - let e = { - string: { - unit: `caracteres`, - verb: `ter` - }, - file: { - unit: `bytes`, - verb: `ter` - }, - array: { - unit: `itens`, - verb: `ter` - }, - set: { - unit: `itens`, - verb: `ter` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `padrão`, - email: `endereço de e-mail`, - url: `URL`, - emoji: `emoji`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `data e hora ISO`, - date: `data ISO`, - time: `hora ISO`, - duration: `duração ISO`, - ipv4: `endereço IPv4`, - ipv6: `endereço IPv6`, - cidrv4: `faixa de IPv4`, - cidrv6: `faixa de IPv6`, - base64: `texto codificado em base64`, - base64url: `URL codificada em base64`, - json_string: `texto JSON`, - e164: `número E.164`, - jwt: `JWT`, - template_literal: `entrada` - }, r = { - nan: `NaN`, - number: `número`, - null: `nulo` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = D$9(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `Tipo inválido: esperado instanceof ${e.expected}, recebido ${i}` : `Tipo inválido: esperado ${t}, recebido ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `Entrada inválida: esperado ${E$10(e.values[0])}` : `Opção inválida: esperada uma das ${C$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? `Muito grande: esperado que ${e.origin ?? `valor`} tivesse ${n}${e.maximum.toString()} ${r.unit ?? `elementos`}` : `Muito grande: esperado que ${e.origin ?? `valor`} fosse ${n}${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `Muito pequeno: esperado que ${e.origin} tivesse ${n}${e.minimum.toString()} ${r.unit}` : `Muito pequeno: esperado que ${e.origin} fosse ${n}${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `Texto inválido: deve começar com "${t.prefix}"` : t.format === `ends_with` ? `Texto inválido: deve terminar com "${t.suffix}"` : t.format === `includes` ? `Texto inválido: deve incluir "${t.includes}"` : t.format === `regex` ? `Texto inválido: deve corresponder ao padrão ${t.pattern}` : `${n[t.format] ?? e.format} inválido`; - } - case `not_multiple_of`: return `Número inválido: deve ser múltiplo de ${e.divisor}`; - case `unrecognized_keys`: return `Chave${e.keys.length > 1 ? `s` : ``} desconhecida${e.keys.length > 1 ? `s` : ``}: ${C$10(e.keys, `, `)}`; - case `invalid_key`: return `Chave inválida em ${e.origin}`; - case `invalid_union`: return `Entrada inválida`; - case `invalid_element`: return `Valor inválido em ${e.origin}`; - default: return `Campo inválido`; - } - }; -}; -function os$2() { - return { localeError: as$2() }; -} -function ss$2(e, t, n, r) { - let i = Math.abs(e), a = i % 10, o = i % 100; - return o >= 11 && o <= 19 ? r : a === 1 ? t : a >= 2 && a <= 4 ? n : r; -} -const cs$2 = () => { - let e = { - string: { - unit: { - one: `символ`, - few: `символа`, - many: `символов` - }, - verb: `иметь` - }, - file: { - unit: { - one: `байт`, - few: `байта`, - many: `байт` - }, - verb: `иметь` - }, - array: { - unit: { - one: `элемент`, - few: `элемента`, - many: `элементов` - }, - verb: `иметь` - }, - set: { - unit: { - one: `элемент`, - few: `элемента`, - many: `элементов` - }, - verb: `иметь` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `ввод`, - email: `email адрес`, - url: `URL`, - emoji: `эмодзи`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `ISO дата и время`, - date: `ISO дата`, - time: `ISO время`, - duration: `ISO длительность`, - ipv4: `IPv4 адрес`, - ipv6: `IPv6 адрес`, - cidrv4: `IPv4 диапазон`, - cidrv6: `IPv6 диапазон`, - base64: `строка в формате base64`, - base64url: `строка в формате base64url`, - json_string: `JSON строка`, - e164: `номер E.164`, - jwt: `JWT`, - template_literal: `ввод` - }, r = { - nan: `NaN`, - number: `число`, - array: `массив` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = D$9(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `Неверный ввод: ожидалось instanceof ${e.expected}, получено ${i}` : `Неверный ввод: ожидалось ${t}, получено ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `Неверный ввод: ожидалось ${E$10(e.values[0])}` : `Неверный вариант: ожидалось одно из ${C$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - if (r) { - let t = ss$2(Number(e.maximum), r.unit.one, r.unit.few, r.unit.many); - return `Слишком большое значение: ожидалось, что ${e.origin ?? `значение`} будет иметь ${n}${e.maximum.toString()} ${t}`; - } - return `Слишком большое значение: ожидалось, что ${e.origin ?? `значение`} будет ${n}${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - if (r) { - let t = ss$2(Number(e.minimum), r.unit.one, r.unit.few, r.unit.many); - return `Слишком маленькое значение: ожидалось, что ${e.origin} будет иметь ${n}${e.minimum.toString()} ${t}`; - } - return `Слишком маленькое значение: ожидалось, что ${e.origin} будет ${n}${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `Неверная строка: должна начинаться с "${t.prefix}"` : t.format === `ends_with` ? `Неверная строка: должна заканчиваться на "${t.suffix}"` : t.format === `includes` ? `Неверная строка: должна содержать "${t.includes}"` : t.format === `regex` ? `Неверная строка: должна соответствовать шаблону ${t.pattern}` : `Неверный ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `Неверное число: должно быть кратным ${e.divisor}`; - case `unrecognized_keys`: return `Нераспознанн${e.keys.length > 1 ? `ые` : `ый`} ключ${e.keys.length > 1 ? `и` : ``}: ${C$10(e.keys, `, `)}`; - case `invalid_key`: return `Неверный ключ в ${e.origin}`; - case `invalid_union`: return `Неверные входные данные`; - case `invalid_element`: return `Неверное значение в ${e.origin}`; - default: return `Неверные входные данные`; - } - }; -}; -function ls$2() { - return { localeError: cs$2() }; -} -const us$2 = () => { - let e = { - string: { - unit: `znakov`, - verb: `imeti` - }, - file: { - unit: `bajtov`, - verb: `imeti` - }, - array: { - unit: `elementov`, - verb: `imeti` - }, - set: { - unit: `elementov`, - verb: `imeti` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `vnos`, - email: `e-poštni naslov`, - url: `URL`, - emoji: `emoji`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `ISO datum in čas`, - date: `ISO datum`, - time: `ISO čas`, - duration: `ISO trajanje`, - ipv4: `IPv4 naslov`, - ipv6: `IPv6 naslov`, - cidrv4: `obseg IPv4`, - cidrv6: `obseg IPv6`, - base64: `base64 kodiran niz`, - base64url: `base64url kodiran niz`, - json_string: `JSON niz`, - e164: `E.164 številka`, - jwt: `JWT`, - template_literal: `vnos` - }, r = { - nan: `NaN`, - number: `število`, - array: `tabela` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = D$9(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `Neveljaven vnos: pričakovano instanceof ${e.expected}, prejeto ${i}` : `Neveljaven vnos: pričakovano ${t}, prejeto ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `Neveljaven vnos: pričakovano ${E$10(e.values[0])}` : `Neveljavna možnost: pričakovano eno izmed ${C$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? `Preveliko: pričakovano, da bo ${e.origin ?? `vrednost`} imelo ${n}${e.maximum.toString()} ${r.unit ?? `elementov`}` : `Preveliko: pričakovano, da bo ${e.origin ?? `vrednost`} ${n}${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `Premajhno: pričakovano, da bo ${e.origin} imelo ${n}${e.minimum.toString()} ${r.unit}` : `Premajhno: pričakovano, da bo ${e.origin} ${n}${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `Neveljaven niz: mora se začeti z "${t.prefix}"` : t.format === `ends_with` ? `Neveljaven niz: mora se končati z "${t.suffix}"` : t.format === `includes` ? `Neveljaven niz: mora vsebovati "${t.includes}"` : t.format === `regex` ? `Neveljaven niz: mora ustrezati vzorcu ${t.pattern}` : `Neveljaven ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `Neveljavno število: mora biti večkratnik ${e.divisor}`; - case `unrecognized_keys`: return `Neprepoznan${e.keys.length > 1 ? `i ključi` : ` ključ`}: ${C$10(e.keys, `, `)}`; - case `invalid_key`: return `Neveljaven ključ v ${e.origin}`; - case `invalid_union`: return `Neveljaven vnos`; - case `invalid_element`: return `Neveljavna vrednost v ${e.origin}`; - default: return `Neveljaven vnos`; - } - }; -}; -function ds$2() { - return { localeError: us$2() }; -} -const fs$2 = () => { - let e = { - string: { - unit: `tecken`, - verb: `att ha` - }, - file: { - unit: `bytes`, - verb: `att ha` - }, - array: { - unit: `objekt`, - verb: `att innehålla` - }, - set: { - unit: `objekt`, - verb: `att innehålla` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `reguljärt uttryck`, - email: `e-postadress`, - url: `URL`, - emoji: `emoji`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `ISO-datum och tid`, - date: `ISO-datum`, - time: `ISO-tid`, - duration: `ISO-varaktighet`, - ipv4: `IPv4-intervall`, - ipv6: `IPv6-intervall`, - cidrv4: `IPv4-spektrum`, - cidrv6: `IPv6-spektrum`, - base64: `base64-kodad sträng`, - base64url: `base64url-kodad sträng`, - json_string: `JSON-sträng`, - e164: `E.164-nummer`, - jwt: `JWT`, - template_literal: `mall-literal` - }, r = { - nan: `NaN`, - number: `antal`, - array: `lista` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = D$9(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `Ogiltig inmatning: förväntat instanceof ${e.expected}, fick ${i}` : `Ogiltig inmatning: förväntat ${t}, fick ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `Ogiltig inmatning: förväntat ${E$10(e.values[0])}` : `Ogiltigt val: förväntade en av ${C$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? `För stor(t): förväntade ${e.origin ?? `värdet`} att ha ${n}${e.maximum.toString()} ${r.unit ?? `element`}` : `För stor(t): förväntat ${e.origin ?? `värdet`} att ha ${n}${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `För lite(t): förväntade ${e.origin ?? `värdet`} att ha ${n}${e.minimum.toString()} ${r.unit}` : `För lite(t): förväntade ${e.origin ?? `värdet`} att ha ${n}${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `Ogiltig sträng: måste börja med "${t.prefix}"` : t.format === `ends_with` ? `Ogiltig sträng: måste sluta med "${t.suffix}"` : t.format === `includes` ? `Ogiltig sträng: måste innehålla "${t.includes}"` : t.format === `regex` ? `Ogiltig sträng: måste matcha mönstret "${t.pattern}"` : `Ogiltig(t) ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `Ogiltigt tal: måste vara en multipel av ${e.divisor}`; - case `unrecognized_keys`: return `${e.keys.length > 1 ? `Okända nycklar` : `Okänd nyckel`}: ${C$10(e.keys, `, `)}`; - case `invalid_key`: return `Ogiltig nyckel i ${e.origin ?? `värdet`}`; - case `invalid_union`: return `Ogiltig input`; - case `invalid_element`: return `Ogiltigt värde i ${e.origin ?? `värdet`}`; - default: return `Ogiltig input`; - } - }; -}; -function ps$2() { - return { localeError: fs$2() }; -} -const ms$2 = () => { - let e = { - string: { - unit: `எழுத்துக்கள்`, - verb: `கொண்டிருக்க வேண்டும்` - }, - file: { - unit: `பைட்டுகள்`, - verb: `கொண்டிருக்க வேண்டும்` - }, - array: { - unit: `உறுப்புகள்`, - verb: `கொண்டிருக்க வேண்டும்` - }, - set: { - unit: `உறுப்புகள்`, - verb: `கொண்டிருக்க வேண்டும்` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `உள்ளீடு`, - email: `மின்னஞ்சல் முகவரி`, - url: `URL`, - emoji: `emoji`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `ISO தேதி நேரம்`, - date: `ISO தேதி`, - time: `ISO நேரம்`, - duration: `ISO கால அளவு`, - ipv4: `IPv4 முகவரி`, - ipv6: `IPv6 முகவரி`, - cidrv4: `IPv4 வரம்பு`, - cidrv6: `IPv6 வரம்பு`, - base64: `base64-encoded சரம்`, - base64url: `base64url-encoded சரம்`, - json_string: `JSON சரம்`, - e164: `E.164 எண்`, - jwt: `JWT`, - template_literal: `input` - }, r = { - nan: `NaN`, - number: `எண்`, - array: `அணி`, - null: `வெறுமை` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = D$9(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது instanceof ${e.expected}, பெறப்பட்டது ${i}` : `தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${t}, பெறப்பட்டது ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${E$10(e.values[0])}` : `தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${C$10(e.values, `|`)} இல் ஒன்று`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? `மிக பெரியது: எதிர்பார்க்கப்பட்டது ${e.origin ?? `மதிப்பு`} ${n}${e.maximum.toString()} ${r.unit ?? `உறுப்புகள்`} ஆக இருக்க வேண்டும்` : `மிக பெரியது: எதிர்பார்க்கப்பட்டது ${e.origin ?? `மதிப்பு`} ${n}${e.maximum.toString()} ஆக இருக்க வேண்டும்`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${e.origin} ${n}${e.minimum.toString()} ${r.unit} ஆக இருக்க வேண்டும்` : `மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${e.origin} ${n}${e.minimum.toString()} ஆக இருக்க வேண்டும்`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `தவறான சரம்: "${t.prefix}" இல் தொடங்க வேண்டும்` : t.format === `ends_with` ? `தவறான சரம்: "${t.suffix}" இல் முடிவடைய வேண்டும்` : t.format === `includes` ? `தவறான சரம்: "${t.includes}" ஐ உள்ளடக்க வேண்டும்` : t.format === `regex` ? `தவறான சரம்: ${t.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்` : `தவறான ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `தவறான எண்: ${e.divisor} இன் பலமாக இருக்க வேண்டும்`; - case `unrecognized_keys`: return `அடையாளம் தெரியாத விசை${e.keys.length > 1 ? `கள்` : ``}: ${C$10(e.keys, `, `)}`; - case `invalid_key`: return `${e.origin} இல் தவறான விசை`; - case `invalid_union`: return `தவறான உள்ளீடு`; - case `invalid_element`: return `${e.origin} இல் தவறான மதிப்பு`; - default: return `தவறான உள்ளீடு`; - } - }; -}; -function hs$2() { - return { localeError: ms$2() }; -} -const gs$2 = () => { - let e = { - string: { - unit: `ตัวอักษร`, - verb: `ควรมี` - }, - file: { - unit: `ไบต์`, - verb: `ควรมี` - }, - array: { - unit: `รายการ`, - verb: `ควรมี` - }, - set: { - unit: `รายการ`, - verb: `ควรมี` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `ข้อมูลที่ป้อน`, - email: `ที่อยู่อีเมล`, - url: `URL`, - emoji: `อิโมจิ`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `วันที่เวลาแบบ ISO`, - date: `วันที่แบบ ISO`, - time: `เวลาแบบ ISO`, - duration: `ช่วงเวลาแบบ ISO`, - ipv4: `ที่อยู่ IPv4`, - ipv6: `ที่อยู่ IPv6`, - cidrv4: `ช่วง IP แบบ IPv4`, - cidrv6: `ช่วง IP แบบ IPv6`, - base64: `ข้อความแบบ Base64`, - base64url: `ข้อความแบบ Base64 สำหรับ URL`, - json_string: `ข้อความแบบ JSON`, - e164: `เบอร์โทรศัพท์ระหว่างประเทศ (E.164)`, - jwt: `โทเคน JWT`, - template_literal: `ข้อมูลที่ป้อน` - }, r = { - nan: `NaN`, - number: `ตัวเลข`, - array: `อาร์เรย์ (Array)`, - null: `ไม่มีค่า (null)` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = D$9(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น instanceof ${e.expected} แต่ได้รับ ${i}` : `ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${t} แต่ได้รับ ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `ค่าไม่ถูกต้อง: ควรเป็น ${E$10(e.values[0])}` : `ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${C$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `ไม่เกิน` : `น้อยกว่า`, r = t(e.origin); - return r ? `เกินกำหนด: ${e.origin ?? `ค่า`} ควรมี${n} ${e.maximum.toString()} ${r.unit ?? `รายการ`}` : `เกินกำหนด: ${e.origin ?? `ค่า`} ควรมี${n} ${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `อย่างน้อย` : `มากกว่า`, r = t(e.origin); - return r ? `น้อยกว่ากำหนด: ${e.origin} ควรมี${n} ${e.minimum.toString()} ${r.unit}` : `น้อยกว่ากำหนด: ${e.origin} ควรมี${n} ${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${t.prefix}"` : t.format === `ends_with` ? `รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${t.suffix}"` : t.format === `includes` ? `รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${t.includes}" อยู่ในข้อความ` : t.format === `regex` ? `รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${t.pattern}` : `รูปแบบไม่ถูกต้อง: ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${e.divisor} ได้ลงตัว`; - case `unrecognized_keys`: return `พบคีย์ที่ไม่รู้จัก: ${C$10(e.keys, `, `)}`; - case `invalid_key`: return `คีย์ไม่ถูกต้องใน ${e.origin}`; - case `invalid_union`: return `ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้`; - case `invalid_element`: return `ข้อมูลไม่ถูกต้องใน ${e.origin}`; - default: return `ข้อมูลไม่ถูกต้อง`; - } - }; -}; -function _s$2() { - return { localeError: gs$2() }; -} -const vs$2 = () => { - let e = { - string: { - unit: `karakter`, - verb: `olmalı` - }, - file: { - unit: `bayt`, - verb: `olmalı` - }, - array: { - unit: `öğe`, - verb: `olmalı` - }, - set: { - unit: `öğe`, - verb: `olmalı` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `girdi`, - email: `e-posta adresi`, - url: `URL`, - emoji: `emoji`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `ISO tarih ve saat`, - date: `ISO tarih`, - time: `ISO saat`, - duration: `ISO süre`, - ipv4: `IPv4 adresi`, - ipv6: `IPv6 adresi`, - cidrv4: `IPv4 aralığı`, - cidrv6: `IPv6 aralığı`, - base64: `base64 ile şifrelenmiş metin`, - base64url: `base64url ile şifrelenmiş metin`, - json_string: `JSON dizesi`, - e164: `E.164 sayısı`, - jwt: `JWT`, - template_literal: `Şablon dizesi` - }, r = { nan: `NaN` }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = D$9(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `Geçersiz değer: beklenen instanceof ${e.expected}, alınan ${i}` : `Geçersiz değer: beklenen ${t}, alınan ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `Geçersiz değer: beklenen ${E$10(e.values[0])}` : `Geçersiz seçenek: aşağıdakilerden biri olmalı: ${C$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? `Çok büyük: beklenen ${e.origin ?? `değer`} ${n}${e.maximum.toString()} ${r.unit ?? `öğe`}` : `Çok büyük: beklenen ${e.origin ?? `değer`} ${n}${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `Çok küçük: beklenen ${e.origin} ${n}${e.minimum.toString()} ${r.unit}` : `Çok küçük: beklenen ${e.origin} ${n}${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `Geçersiz metin: "${t.prefix}" ile başlamalı` : t.format === `ends_with` ? `Geçersiz metin: "${t.suffix}" ile bitmeli` : t.format === `includes` ? `Geçersiz metin: "${t.includes}" içermeli` : t.format === `regex` ? `Geçersiz metin: ${t.pattern} desenine uymalı` : `Geçersiz ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `Geçersiz sayı: ${e.divisor} ile tam bölünebilmeli`; - case `unrecognized_keys`: return `Tanınmayan anahtar${e.keys.length > 1 ? `lar` : ``}: ${C$10(e.keys, `, `)}`; - case `invalid_key`: return `${e.origin} içinde geçersiz anahtar`; - case `invalid_union`: return `Geçersiz değer`; - case `invalid_element`: return `${e.origin} içinde geçersiz değer`; - default: return `Geçersiz değer`; - } - }; -}; -function ys$2() { - return { localeError: vs$2() }; -} -const bs$2 = () => { - let e = { - string: { - unit: `символів`, - verb: `матиме` - }, - file: { - unit: `байтів`, - verb: `матиме` - }, - array: { - unit: `елементів`, - verb: `матиме` - }, - set: { - unit: `елементів`, - verb: `матиме` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `вхідні дані`, - email: `адреса електронної пошти`, - url: `URL`, - emoji: `емодзі`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `дата та час ISO`, - date: `дата ISO`, - time: `час ISO`, - duration: `тривалість ISO`, - ipv4: `адреса IPv4`, - ipv6: `адреса IPv6`, - cidrv4: `діапазон IPv4`, - cidrv6: `діапазон IPv6`, - base64: `рядок у кодуванні base64`, - base64url: `рядок у кодуванні base64url`, - json_string: `рядок JSON`, - e164: `номер E.164`, - jwt: `JWT`, - template_literal: `вхідні дані` - }, r = { - nan: `NaN`, - number: `число`, - array: `масив` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = D$9(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `Неправильні вхідні дані: очікується instanceof ${e.expected}, отримано ${i}` : `Неправильні вхідні дані: очікується ${t}, отримано ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `Неправильні вхідні дані: очікується ${E$10(e.values[0])}` : `Неправильна опція: очікується одне з ${C$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? `Занадто велике: очікується, що ${e.origin ?? `значення`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit ?? `елементів`}` : `Занадто велике: очікується, що ${e.origin ?? `значення`} буде ${n}${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `Занадто мале: очікується, що ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}` : `Занадто мале: очікується, що ${e.origin} буде ${n}${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `Неправильний рядок: повинен починатися з "${t.prefix}"` : t.format === `ends_with` ? `Неправильний рядок: повинен закінчуватися на "${t.suffix}"` : t.format === `includes` ? `Неправильний рядок: повинен містити "${t.includes}"` : t.format === `regex` ? `Неправильний рядок: повинен відповідати шаблону ${t.pattern}` : `Неправильний ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `Неправильне число: повинно бути кратним ${e.divisor}`; - case `unrecognized_keys`: return `Нерозпізнаний ключ${e.keys.length > 1 ? `і` : ``}: ${C$10(e.keys, `, `)}`; - case `invalid_key`: return `Неправильний ключ у ${e.origin}`; - case `invalid_union`: return `Неправильні вхідні дані`; - case `invalid_element`: return `Неправильне значення у ${e.origin}`; - default: return `Неправильні вхідні дані`; - } - }; -}; -function xs$2() { - return { localeError: bs$2() }; -} -function Ss$2() { - return xs$2(); -} -const Cs$2 = () => { - let e = { - string: { - unit: `حروف`, - verb: `ہونا` - }, - file: { - unit: `بائٹس`, - verb: `ہونا` - }, - array: { - unit: `آئٹمز`, - verb: `ہونا` - }, - set: { - unit: `آئٹمز`, - verb: `ہونا` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `ان پٹ`, - email: `ای میل ایڈریس`, - url: `یو آر ایل`, - emoji: `ایموجی`, - uuid: `یو یو آئی ڈی`, - uuidv4: `یو یو آئی ڈی وی 4`, - uuidv6: `یو یو آئی ڈی وی 6`, - nanoid: `نینو آئی ڈی`, - guid: `جی یو آئی ڈی`, - cuid: `سی یو آئی ڈی`, - cuid2: `سی یو آئی ڈی 2`, - ulid: `یو ایل آئی ڈی`, - xid: `ایکس آئی ڈی`, - ksuid: `کے ایس یو آئی ڈی`, - datetime: `آئی ایس او ڈیٹ ٹائم`, - date: `آئی ایس او تاریخ`, - time: `آئی ایس او وقت`, - duration: `آئی ایس او مدت`, - ipv4: `آئی پی وی 4 ایڈریس`, - ipv6: `آئی پی وی 6 ایڈریس`, - cidrv4: `آئی پی وی 4 رینج`, - cidrv6: `آئی پی وی 6 رینج`, - base64: `بیس 64 ان کوڈڈ سٹرنگ`, - base64url: `بیس 64 یو آر ایل ان کوڈڈ سٹرنگ`, - json_string: `جے ایس او این سٹرنگ`, - e164: `ای 164 نمبر`, - jwt: `جے ڈبلیو ٹی`, - template_literal: `ان پٹ` - }, r = { - nan: `NaN`, - number: `نمبر`, - array: `آرے`, - null: `نل` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = D$9(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `غلط ان پٹ: instanceof ${e.expected} متوقع تھا، ${i} موصول ہوا` : `غلط ان پٹ: ${t} متوقع تھا، ${i} موصول ہوا`; - } - case `invalid_value`: return e.values.length === 1 ? `غلط ان پٹ: ${E$10(e.values[0])} متوقع تھا` : `غلط آپشن: ${C$10(e.values, `|`)} میں سے ایک متوقع تھا`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? `بہت بڑا: ${e.origin ?? `ویلیو`} کے ${n}${e.maximum.toString()} ${r.unit ?? `عناصر`} ہونے متوقع تھے` : `بہت بڑا: ${e.origin ?? `ویلیو`} کا ${n}${e.maximum.toString()} ہونا متوقع تھا`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `بہت چھوٹا: ${e.origin} کے ${n}${e.minimum.toString()} ${r.unit} ہونے متوقع تھے` : `بہت چھوٹا: ${e.origin} کا ${n}${e.minimum.toString()} ہونا متوقع تھا`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `غلط سٹرنگ: "${t.prefix}" سے شروع ہونا چاہیے` : t.format === `ends_with` ? `غلط سٹرنگ: "${t.suffix}" پر ختم ہونا چاہیے` : t.format === `includes` ? `غلط سٹرنگ: "${t.includes}" شامل ہونا چاہیے` : t.format === `regex` ? `غلط سٹرنگ: پیٹرن ${t.pattern} سے میچ ہونا چاہیے` : `غلط ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `غلط نمبر: ${e.divisor} کا مضاعف ہونا چاہیے`; - case `unrecognized_keys`: return `غیر تسلیم شدہ کی${e.keys.length > 1 ? `ز` : ``}: ${C$10(e.keys, `، `)}`; - case `invalid_key`: return `${e.origin} میں غلط کی`; - case `invalid_union`: return `غلط ان پٹ`; - case `invalid_element`: return `${e.origin} میں غلط ویلیو`; - default: return `غلط ان پٹ`; - } - }; -}; -function ws$2() { - return { localeError: Cs$2() }; -} -const Ts$2 = () => { - let e = { - string: { - unit: `belgi`, - verb: `bo‘lishi kerak` - }, - file: { - unit: `bayt`, - verb: `bo‘lishi kerak` - }, - array: { - unit: `element`, - verb: `bo‘lishi kerak` - }, - set: { - unit: `element`, - verb: `bo‘lishi kerak` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `kirish`, - email: `elektron pochta manzili`, - url: `URL`, - emoji: `emoji`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `ISO sana va vaqti`, - date: `ISO sana`, - time: `ISO vaqt`, - duration: `ISO davomiylik`, - ipv4: `IPv4 manzil`, - ipv6: `IPv6 manzil`, - mac: `MAC manzil`, - cidrv4: `IPv4 diapazon`, - cidrv6: `IPv6 diapazon`, - base64: `base64 kodlangan satr`, - base64url: `base64url kodlangan satr`, - json_string: `JSON satr`, - e164: `E.164 raqam`, - jwt: `JWT`, - template_literal: `kirish` - }, r = { - nan: `NaN`, - number: `raqam`, - array: `massiv` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = D$9(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `Noto‘g‘ri kirish: kutilgan instanceof ${e.expected}, qabul qilingan ${i}` : `Noto‘g‘ri kirish: kutilgan ${t}, qabul qilingan ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `Noto‘g‘ri kirish: kutilgan ${E$10(e.values[0])}` : `Noto‘g‘ri variant: quyidagilardan biri kutilgan ${C$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? `Juda katta: kutilgan ${e.origin ?? `qiymat`} ${n}${e.maximum.toString()} ${r.unit} ${r.verb}` : `Juda katta: kutilgan ${e.origin ?? `qiymat`} ${n}${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `Juda kichik: kutilgan ${e.origin} ${n}${e.minimum.toString()} ${r.unit} ${r.verb}` : `Juda kichik: kutilgan ${e.origin} ${n}${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `Noto‘g‘ri satr: "${t.prefix}" bilan boshlanishi kerak` : t.format === `ends_with` ? `Noto‘g‘ri satr: "${t.suffix}" bilan tugashi kerak` : t.format === `includes` ? `Noto‘g‘ri satr: "${t.includes}" ni o‘z ichiga olishi kerak` : t.format === `regex` ? `Noto‘g‘ri satr: ${t.pattern} shabloniga mos kelishi kerak` : `Noto‘g‘ri ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `Noto‘g‘ri raqam: ${e.divisor} ning karralisi bo‘lishi kerak`; - case `unrecognized_keys`: return `Noma’lum kalit${e.keys.length > 1 ? `lar` : ``}: ${C$10(e.keys, `, `)}`; - case `invalid_key`: return `${e.origin} dagi kalit noto‘g‘ri`; - case `invalid_union`: return `Noto‘g‘ri kirish`; - case `invalid_element`: return `${e.origin} da noto‘g‘ri qiymat`; - default: return `Noto‘g‘ri kirish`; - } - }; -}; -function Es$2() { - return { localeError: Ts$2() }; -} -const Ds$2 = () => { - let e = { - string: { - unit: `ký tự`, - verb: `có` - }, - file: { - unit: `byte`, - verb: `có` - }, - array: { - unit: `phần tử`, - verb: `có` - }, - set: { - unit: `phần tử`, - verb: `có` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `đầu vào`, - email: `địa chỉ email`, - url: `URL`, - emoji: `emoji`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `ngày giờ ISO`, - date: `ngày ISO`, - time: `giờ ISO`, - duration: `khoảng thời gian ISO`, - ipv4: `địa chỉ IPv4`, - ipv6: `địa chỉ IPv6`, - cidrv4: `dải IPv4`, - cidrv6: `dải IPv6`, - base64: `chuỗi mã hóa base64`, - base64url: `chuỗi mã hóa base64url`, - json_string: `chuỗi JSON`, - e164: `số E.164`, - jwt: `JWT`, - template_literal: `đầu vào` - }, r = { - nan: `NaN`, - number: `số`, - array: `mảng` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = D$9(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `Đầu vào không hợp lệ: mong đợi instanceof ${e.expected}, nhận được ${i}` : `Đầu vào không hợp lệ: mong đợi ${t}, nhận được ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `Đầu vào không hợp lệ: mong đợi ${E$10(e.values[0])}` : `Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${C$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? `Quá lớn: mong đợi ${e.origin ?? `giá trị`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit ?? `phần tử`}` : `Quá lớn: mong đợi ${e.origin ?? `giá trị`} ${n}${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `Quá nhỏ: mong đợi ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}` : `Quá nhỏ: mong đợi ${e.origin} ${n}${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `Chuỗi không hợp lệ: phải bắt đầu bằng "${t.prefix}"` : t.format === `ends_with` ? `Chuỗi không hợp lệ: phải kết thúc bằng "${t.suffix}"` : t.format === `includes` ? `Chuỗi không hợp lệ: phải bao gồm "${t.includes}"` : t.format === `regex` ? `Chuỗi không hợp lệ: phải khớp với mẫu ${t.pattern}` : `${n[t.format] ?? e.format} không hợp lệ`; - } - case `not_multiple_of`: return `Số không hợp lệ: phải là bội số của ${e.divisor}`; - case `unrecognized_keys`: return `Khóa không được nhận dạng: ${C$10(e.keys, `, `)}`; - case `invalid_key`: return `Khóa không hợp lệ trong ${e.origin}`; - case `invalid_union`: return `Đầu vào không hợp lệ`; - case `invalid_element`: return `Giá trị không hợp lệ trong ${e.origin}`; - default: return `Đầu vào không hợp lệ`; - } - }; -}; -function Os$2() { - return { localeError: Ds$2() }; -} -const ks$2 = () => { - let e = { - string: { - unit: `字符`, - verb: `包含` - }, - file: { - unit: `字节`, - verb: `包含` - }, - array: { - unit: `项`, - verb: `包含` - }, - set: { - unit: `项`, - verb: `包含` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `输入`, - email: `电子邮件`, - url: `URL`, - emoji: `表情符号`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `ISO日期时间`, - date: `ISO日期`, - time: `ISO时间`, - duration: `ISO时长`, - ipv4: `IPv4地址`, - ipv6: `IPv6地址`, - cidrv4: `IPv4网段`, - cidrv6: `IPv6网段`, - base64: `base64编码字符串`, - base64url: `base64url编码字符串`, - json_string: `JSON字符串`, - e164: `E.164号码`, - jwt: `JWT`, - template_literal: `输入` - }, r = { - nan: `NaN`, - number: `数字`, - array: `数组`, - null: `空值(null)` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = D$9(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `无效输入:期望 instanceof ${e.expected},实际接收 ${i}` : `无效输入:期望 ${t},实际接收 ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `无效输入:期望 ${E$10(e.values[0])}` : `无效选项:期望以下之一 ${C$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? `数值过大:期望 ${e.origin ?? `值`} ${n}${e.maximum.toString()} ${r.unit ?? `个元素`}` : `数值过大:期望 ${e.origin ?? `值`} ${n}${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `数值过小:期望 ${e.origin} ${n}${e.minimum.toString()} ${r.unit}` : `数值过小:期望 ${e.origin} ${n}${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `无效字符串:必须以 "${t.prefix}" 开头` : t.format === `ends_with` ? `无效字符串:必须以 "${t.suffix}" 结尾` : t.format === `includes` ? `无效字符串:必须包含 "${t.includes}"` : t.format === `regex` ? `无效字符串:必须满足正则表达式 ${t.pattern}` : `无效${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `无效数字:必须是 ${e.divisor} 的倍数`; - case `unrecognized_keys`: return `出现未知的键(key): ${C$10(e.keys, `, `)}`; - case `invalid_key`: return `${e.origin} 中的键(key)无效`; - case `invalid_union`: return `无效输入`; - case `invalid_element`: return `${e.origin} 中包含无效值(value)`; - default: return `无效输入`; - } - }; -}; -function As$2() { - return { localeError: ks$2() }; -} -const js$2 = () => { - let e = { - string: { - unit: `字元`, - verb: `擁有` - }, - file: { - unit: `位元組`, - verb: `擁有` - }, - array: { - unit: `項目`, - verb: `擁有` - }, - set: { - unit: `項目`, - verb: `擁有` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `輸入`, - email: `郵件地址`, - url: `URL`, - emoji: `emoji`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `ISO 日期時間`, - date: `ISO 日期`, - time: `ISO 時間`, - duration: `ISO 期間`, - ipv4: `IPv4 位址`, - ipv6: `IPv6 位址`, - cidrv4: `IPv4 範圍`, - cidrv6: `IPv6 範圍`, - base64: `base64 編碼字串`, - base64url: `base64url 編碼字串`, - json_string: `JSON 字串`, - e164: `E.164 數值`, - jwt: `JWT`, - template_literal: `輸入` - }, r = { nan: `NaN` }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = D$9(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `無效的輸入值:預期為 instanceof ${e.expected},但收到 ${i}` : `無效的輸入值:預期為 ${t},但收到 ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `無效的輸入值:預期為 ${E$10(e.values[0])}` : `無效的選項:預期為以下其中之一 ${C$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? `數值過大:預期 ${e.origin ?? `值`} 應為 ${n}${e.maximum.toString()} ${r.unit ?? `個元素`}` : `數值過大:預期 ${e.origin ?? `值`} 應為 ${n}${e.maximum.toString()}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `數值過小:預期 ${e.origin} 應為 ${n}${e.minimum.toString()} ${r.unit}` : `數值過小:預期 ${e.origin} 應為 ${n}${e.minimum.toString()}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `無效的字串:必須以 "${t.prefix}" 開頭` : t.format === `ends_with` ? `無效的字串:必須以 "${t.suffix}" 結尾` : t.format === `includes` ? `無效的字串:必須包含 "${t.includes}"` : t.format === `regex` ? `無效的字串:必須符合格式 ${t.pattern}` : `無效的 ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `無效的數字:必須為 ${e.divisor} 的倍數`; - case `unrecognized_keys`: return `無法識別的鍵值${e.keys.length > 1 ? `們` : ``}:${C$10(e.keys, `、`)}`; - case `invalid_key`: return `${e.origin} 中有無效的鍵值`; - case `invalid_union`: return `無效的輸入值`; - case `invalid_element`: return `${e.origin} 中有無效的值`; - default: return `無效的輸入值`; - } - }; -}; -function Ms$2() { - return { localeError: js$2() }; -} -const Ns$2 = () => { - let e = { - string: { - unit: `àmi`, - verb: `ní` - }, - file: { - unit: `bytes`, - verb: `ní` - }, - array: { - unit: `nkan`, - verb: `ní` - }, - set: { - unit: `nkan`, - verb: `ní` - } - }; - function t(t) { - return e[t] ?? null; - } - let n = { - regex: `ẹ̀rọ ìbáwọlé`, - email: `àdírẹ́sì ìmẹ́lì`, - url: `URL`, - emoji: `emoji`, - uuid: `UUID`, - uuidv4: `UUIDv4`, - uuidv6: `UUIDv6`, - nanoid: `nanoid`, - guid: `GUID`, - cuid: `cuid`, - cuid2: `cuid2`, - ulid: `ULID`, - xid: `XID`, - ksuid: `KSUID`, - datetime: `àkókò ISO`, - date: `ọjọ́ ISO`, - time: `àkókò ISO`, - duration: `àkókò tó pé ISO`, - ipv4: `àdírẹ́sì IPv4`, - ipv6: `àdírẹ́sì IPv6`, - cidrv4: `àgbègbè IPv4`, - cidrv6: `àgbègbè IPv6`, - base64: `ọ̀rọ̀ tí a kọ́ ní base64`, - base64url: `ọ̀rọ̀ base64url`, - json_string: `ọ̀rọ̀ JSON`, - e164: `nọ́mbà E.164`, - jwt: `JWT`, - template_literal: `ẹ̀rọ ìbáwọlé` - }, r = { - nan: `NaN`, - number: `nọ́mbà`, - array: `akopọ` - }; - return (e) => { - switch (e.code) { - case `invalid_type`: { - let t = r[e.expected] ?? e.expected, n = D$9(e.input), i = r[n] ?? n; - return /^[A-Z]/.test(e.expected) ? `Ìbáwọlé aṣìṣe: a ní láti fi instanceof ${e.expected}, àmọ̀ a rí ${i}` : `Ìbáwọlé aṣìṣe: a ní láti fi ${t}, àmọ̀ a rí ${i}`; - } - case `invalid_value`: return e.values.length === 1 ? `Ìbáwọlé aṣìṣe: a ní láti fi ${E$10(e.values[0])}` : `Àṣàyàn aṣìṣe: yan ọ̀kan lára ${C$10(e.values, `|`)}`; - case `too_big`: { - let n = e.inclusive ? `<=` : `<`, r = t(e.origin); - return r ? `Tó pọ̀ jù: a ní láti jẹ́ pé ${e.origin ?? `iye`} ${r.verb} ${n}${e.maximum} ${r.unit}` : `Tó pọ̀ jù: a ní láti jẹ́ ${n}${e.maximum}`; - } - case `too_small`: { - let n = e.inclusive ? `>=` : `>`, r = t(e.origin); - return r ? `Kéré ju: a ní láti jẹ́ pé ${e.origin} ${r.verb} ${n}${e.minimum} ${r.unit}` : `Kéré ju: a ní láti jẹ́ ${n}${e.minimum}`; - } - case `invalid_format`: { - let t = e; - return t.format === `starts_with` ? `Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${t.prefix}"` : t.format === `ends_with` ? `Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${t.suffix}"` : t.format === `includes` ? `Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${t.includes}"` : t.format === `regex` ? `Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${t.pattern}` : `Aṣìṣe: ${n[t.format] ?? e.format}`; - } - case `not_multiple_of`: return `Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${e.divisor}`; - case `unrecognized_keys`: return `Bọtìnì àìmọ̀: ${C$10(e.keys, `, `)}`; - case `invalid_key`: return `Bọtìnì aṣìṣe nínú ${e.origin}`; - case `invalid_union`: return `Ìbáwọlé aṣìṣe`; - case `invalid_element`: return `Iye aṣìṣe nínú ${e.origin}`; - default: return `Ìbáwọlé aṣìṣe`; - } - }; -}; -function Ps$2() { - return { localeError: Ns$2() }; -} -var Fs$2 = l$11({ - ar: () => Va$4, - az: () => Ua$4, - be: () => Ka$4, - bg: () => Ja$3, - ca: () => Xa$3, - cs: () => Qa$3, - da: () => eo$3, - de: () => no$2, - en: () => io$2, - eo: () => oo$2, - es: () => co$2, - fa: () => uo$2, - fi: () => po$2, - fr: () => ho$2, - frCA: () => _o$2, - he: () => yo$2, - hu: () => xo$2, - hy: () => To$2, - id: () => Do$2, - is: () => ko$2, - it: () => jo$2, - ja: () => No$2, - ka: () => Fo$2, - kh: () => Ro$2, - km: () => Lo$2, - ko: () => Bo$2, - lt: () => Wo$2, - mk: () => Ko$2, - ms: () => Jo$2, - nl: () => Xo$2, - no: () => Qo$2, - ota: () => es$2, - pl: () => is$2, - ps: () => ns$2, - pt: () => os$2, - ru: () => ls$2, - sl: () => ds$2, - sv: () => ps$2, - ta: () => hs$2, - th: () => _s$2, - tr: () => ys$2, - ua: () => Ss$2, - uk: () => xs$2, - ur: () => ws$2, - uz: () => Es$2, - vi: () => Os$2, - yo: () => Ps$2, - zhCN: () => As$2, - zhTW: () => Ms$2 -}); -var Is$2; -const Ls$2 = Symbol(`ZodOutput`); -const Rs$2 = Symbol(`ZodInput`); -var zs$2 = class { - constructor() { - this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map(); - } - add(e, ...t) { - let n = t[0]; - return this._map.set(e, n), n && typeof n == `object` && `id` in n && this._idmap.set(n.id, e), this; - } - clear() { - return this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map(), this; - } - remove(e) { - let t = this._map.get(e); - return t && typeof t == `object` && `id` in t && this._idmap.delete(t.id), this._map.delete(e), this; - } - get(e) { - let t = e._zod.parent; - if (t) { - let n = { ...this.get(t) ?? {} }; - delete n.id; - let r = { - ...n, - ...this._map.get(e) - }; - return Object.keys(r).length ? r : void 0; - } - return this._map.get(e); - } - has(e) { - return this._map.has(e); - } -}; -function Bs$2() { - return new zs$2(); -} -(Is$2 = globalThis).__zod_globalRegistry ?? (Is$2.__zod_globalRegistry = Bs$2()); -const Vs$2 = globalThis.__zod_globalRegistry; -function Hs$2(e, t) { - return new e({ - type: `string`, - ...T$10(t) - }); -} -function Us$2(e, t) { - return new e({ - type: `string`, - coerce: !0, - ...T$10(t) - }); -} -function Ws$2(e, t) { - return new e({ - type: `string`, - format: `email`, - check: `string_format`, - abort: !1, - ...T$10(t) - }); -} -function Gs$2(e, t) { - return new e({ - type: `string`, - format: `guid`, - check: `string_format`, - abort: !1, - ...T$10(t) - }); -} -function Ks$2(e, t) { - return new e({ - type: `string`, - format: `uuid`, - check: `string_format`, - abort: !1, - ...T$10(t) - }); -} -function qs$2(e, t) { - return new e({ - type: `string`, - format: `uuid`, - check: `string_format`, - abort: !1, - version: `v4`, - ...T$10(t) - }); -} -function Js$2(e, t) { - return new e({ - type: `string`, - format: `uuid`, - check: `string_format`, - abort: !1, - version: `v6`, - ...T$10(t) - }); -} -function Ys$2(e, t) { - return new e({ - type: `string`, - format: `uuid`, - check: `string_format`, - abort: !1, - version: `v7`, - ...T$10(t) - }); -} -function Xs$2(e, t) { - return new e({ - type: `string`, - format: `url`, - check: `string_format`, - abort: !1, - ...T$10(t) - }); -} -function Zs$2(e, t) { - return new e({ - type: `string`, - format: `emoji`, - check: `string_format`, - abort: !1, - ...T$10(t) - }); -} -function Qs$2(e, t) { - return new e({ - type: `string`, - format: `nanoid`, - check: `string_format`, - abort: !1, - ...T$10(t) - }); -} -function $s$2(e, t) { - return new e({ - type: `string`, - format: `cuid`, - check: `string_format`, - abort: !1, - ...T$10(t) - }); -} -function ec$2(e, t) { - return new e({ - type: `string`, - format: `cuid2`, - check: `string_format`, - abort: !1, - ...T$10(t) - }); -} -function tc$2(e, t) { - return new e({ - type: `string`, - format: `ulid`, - check: `string_format`, - abort: !1, - ...T$10(t) - }); -} -function nc$2(e, t) { - return new e({ - type: `string`, - format: `xid`, - check: `string_format`, - abort: !1, - ...T$10(t) - }); -} -function rc$2(e, t) { - return new e({ - type: `string`, - format: `ksuid`, - check: `string_format`, - abort: !1, - ...T$10(t) - }); -} -function ic$2(e, t) { - return new e({ - type: `string`, - format: `ipv4`, - check: `string_format`, - abort: !1, - ...T$10(t) - }); -} -function ac$2(e, t) { - return new e({ - type: `string`, - format: `ipv6`, - check: `string_format`, - abort: !1, - ...T$10(t) - }); -} -function oc$2(e, t) { - return new e({ - type: `string`, - format: `mac`, - check: `string_format`, - abort: !1, - ...T$10(t) - }); -} -function sc$2(e, t) { - return new e({ - type: `string`, - format: `cidrv4`, - check: `string_format`, - abort: !1, - ...T$10(t) - }); -} -function cc$2(e, t) { - return new e({ - type: `string`, - format: `cidrv6`, - check: `string_format`, - abort: !1, - ...T$10(t) - }); -} -function lc$2(e, t) { - return new e({ - type: `string`, - format: `base64`, - check: `string_format`, - abort: !1, - ...T$10(t) - }); -} -function uc$2(e, t) { - return new e({ - type: `string`, - format: `base64url`, - check: `string_format`, - abort: !1, - ...T$10(t) - }); -} -function dc$2(e, t) { - return new e({ - type: `string`, - format: `e164`, - check: `string_format`, - abort: !1, - ...T$10(t) - }); -} -function fc$2(e, t) { - return new e({ - type: `string`, - format: `jwt`, - check: `string_format`, - abort: !1, - ...T$10(t) - }); -} -const pc$2 = { - Any: null, - Minute: -1, - Second: 0, - Millisecond: 3, - Microsecond: 6 -}; -function mc$2(e, t) { - return new e({ - type: `string`, - format: `datetime`, - check: `string_format`, - offset: !1, - local: !1, - precision: null, - ...T$10(t) - }); -} -function hc$2(e, t) { - return new e({ - type: `string`, - format: `date`, - check: `string_format`, - ...T$10(t) - }); -} -function gc$2(e, t) { - return new e({ - type: `string`, - format: `time`, - check: `string_format`, - precision: null, - ...T$10(t) - }); -} -function _c$2(e, t) { - return new e({ - type: `string`, - format: `duration`, - check: `string_format`, - ...T$10(t) - }); -} -function vc$2(e, t) { - return new e({ - type: `number`, - checks: [], - ...T$10(t) - }); -} -function yc$2(e, t) { - return new e({ - type: `number`, - coerce: !0, - checks: [], - ...T$10(t) - }); -} -function bc$2(e, t) { - return new e({ - type: `number`, - check: `number_format`, - abort: !1, - format: `safeint`, - ...T$10(t) - }); -} -function xc$2(e, t) { - return new e({ - type: `number`, - check: `number_format`, - abort: !1, - format: `float32`, - ...T$10(t) - }); -} -function Sc$2(e, t) { - return new e({ - type: `number`, - check: `number_format`, - abort: !1, - format: `float64`, - ...T$10(t) - }); -} -function Cc$2(e, t) { - return new e({ - type: `number`, - check: `number_format`, - abort: !1, - format: `int32`, - ...T$10(t) - }); -} -function wc$2(e, t) { - return new e({ - type: `number`, - check: `number_format`, - abort: !1, - format: `uint32`, - ...T$10(t) - }); -} -function Tc$2(e, t) { - return new e({ - type: `boolean`, - ...T$10(t) - }); -} -function Ec$2(e, t) { - return new e({ - type: `boolean`, - coerce: !0, - ...T$10(t) - }); -} -function Dc$2(e, t) { - return new e({ - type: `bigint`, - ...T$10(t) - }); -} -function Oc$2(e, t) { - return new e({ - type: `bigint`, - coerce: !0, - ...T$10(t) - }); -} -function kc$2(e, t) { - return new e({ - type: `bigint`, - check: `bigint_format`, - abort: !1, - format: `int64`, - ...T$10(t) - }); -} -function Ac$2(e, t) { - return new e({ - type: `bigint`, - check: `bigint_format`, - abort: !1, - format: `uint64`, - ...T$10(t) - }); -} -function jc$2(e, t) { - return new e({ - type: `symbol`, - ...T$10(t) - }); -} -function Mc$2(e, t) { - return new e({ - type: `undefined`, - ...T$10(t) - }); -} -function Nc$2(e, t) { - return new e({ - type: `null`, - ...T$10(t) - }); -} -function Pc$2(e) { - return new e({ type: `any` }); -} -function Fc$2(e) { - return new e({ type: `unknown` }); -} -function Ic$2(e, t) { - return new e({ - type: `never`, - ...T$10(t) - }); -} -function Lc$2(e, t) { - return new e({ - type: `void`, - ...T$10(t) - }); -} -function Rc$2(e, t) { - return new e({ - type: `date`, - ...T$10(t) - }); -} -function zc$2(e, t) { - return new e({ - type: `date`, - coerce: !0, - ...T$10(t) - }); -} -function Bc$2(e, t) { - return new e({ - type: `nan`, - ...T$10(t) - }); -} -function Vc$2(e, t) { - return new jr$4({ - check: `less_than`, - ...T$10(t), - value: e, - inclusive: !1 - }); -} -function M$8(e, t) { - return new jr$4({ - check: `less_than`, - ...T$10(t), - value: e, - inclusive: !0 - }); -} -function Hc$2(e, t) { - return new Mr$4({ - check: `greater_than`, - ...T$10(t), - value: e, - inclusive: !1 - }); -} -function N$7(e, t) { - return new Mr$4({ - check: `greater_than`, - ...T$10(t), - value: e, - inclusive: !0 - }); -} -function Uc$2(e) { - return Hc$2(0, e); -} -function Wc$2(e) { - return Vc$2(0, e); -} -function Gc$2(e) { - return M$8(0, e); -} -function Kc$2(e) { - return N$7(0, e); -} -function qc$2(e, t) { - return new Nr$4({ - check: `multiple_of`, - ...T$10(t), - value: e - }); -} -function Jc$2(e, t) { - return new Ir$4({ - check: `max_size`, - ...T$10(t), - maximum: e - }); -} -function Yc$2(e, t) { - return new Lr$4({ - check: `min_size`, - ...T$10(t), - minimum: e - }); -} -function Xc$2(e, t) { - return new Rr$4({ - check: `size_equals`, - ...T$10(t), - size: e - }); -} -function Zc$2(e, t) { - return new zr$4({ - check: `max_length`, - ...T$10(t), - maximum: e - }); -} -function Qc$2(e, t) { - return new Br$4({ - check: `min_length`, - ...T$10(t), - minimum: e - }); -} -function $c$2(e, t) { - return new Vr$4({ - check: `length_equals`, - ...T$10(t), - length: e - }); -} -function el$2(e, t) { - return new Ur$4({ - check: `string_format`, - format: `regex`, - ...T$10(t), - pattern: e - }); -} -function tl$2(e) { - return new Wr$4({ - check: `string_format`, - format: `lowercase`, - ...T$10(e) - }); -} -function nl$2(e) { - return new Gr$4({ - check: `string_format`, - format: `uppercase`, - ...T$10(e) - }); -} -function rl$2(e, t) { - return new Kr$4({ - check: `string_format`, - format: `includes`, - ...T$10(t), - includes: e - }); -} -function il$2(e, t) { - return new qr$4({ - check: `string_format`, - format: `starts_with`, - ...T$10(t), - prefix: e - }); -} -function al$2(e, t) { - return new Jr$4({ - check: `string_format`, - format: `ends_with`, - ...T$10(t), - suffix: e - }); -} -function ol$2(e, t, n) { - return new Xr$4({ - check: `property`, - property: e, - schema: t, - ...T$10(n) - }); -} -function sl$2(e, t) { - return new Zr$4({ - check: `mime_type`, - mime: e, - ...T$10(t) - }); -} -function cl$2(e) { - return new Qr$4({ - check: `overwrite`, - tx: e - }); -} -function ll$2(e) { - return cl$2((t) => t.normalize(e)); -} -function ul$2() { - return cl$2((e) => e.trim()); -} -function dl$2() { - return cl$2((e) => e.toLowerCase()); -} -function fl$2() { - return cl$2((e) => e.toUpperCase()); -} -function pl$2() { - return cl$2((e) => at$7(e)); -} -function ml$2(e, t, n) { - return new e({ - type: `array`, - element: t, - ...T$10(n) - }); -} -function hl$2(e, t, n) { - return new e({ - type: `union`, - options: t, - ...T$10(n) - }); -} -function gl$2(e, t, n) { - return new e({ - type: `union`, - options: t, - inclusive: !1, - ...T$10(n) - }); -} -function _l$2(e, t, n, r) { - return new e({ - type: `union`, - options: n, - discriminator: t, - ...T$10(r) - }); -} -function vl$2(e, t, n) { - return new e({ - type: `intersection`, - left: t, - right: n - }); -} -function yl$2(e, t, n, r) { - let i = n instanceof A$8; - return new e({ - type: `tuple`, - items: t, - rest: i ? n : null, - ...T$10(i ? r : n) - }); -} -function bl$2(e, t, n, r) { - return new e({ - type: `record`, - keyType: t, - valueType: n, - ...T$10(r) - }); -} -function xl$2(e, t, n, r) { - return new e({ - type: `map`, - keyType: t, - valueType: n, - ...T$10(r) - }); -} -function Sl$2(e, t, n) { - return new e({ - type: `set`, - valueType: t, - ...T$10(n) - }); -} -function Cl$2(e, t, n) { - return new e({ - type: `enum`, - entries: Array.isArray(t) ? Object.fromEntries(t.map((e) => [e, e])) : t, - ...T$10(n) - }); -} -function wl$2(e, t, n) { - return new e({ - type: `enum`, - entries: t, - ...T$10(n) - }); -} -function Tl$2(e, t, n) { - return new e({ - type: `literal`, - values: Array.isArray(t) ? t : [t], - ...T$10(n) - }); -} -function El$2(e, t) { - return new e({ - type: `file`, - ...T$10(t) - }); -} -function Dl$2(e, t) { - return new e({ - type: `transform`, - transform: t - }); -} -function Ol$2(e, t) { - return new e({ - type: `optional`, - innerType: t - }); -} -function kl$2(e, t) { - return new e({ - type: `nullable`, - innerType: t - }); -} -function Al$2(e, t, n) { - return new e({ - type: `default`, - innerType: t, - get defaultValue() { - return typeof n == `function` ? n() : ut$7(n); - } - }); -} -function jl$2(e, t, n) { - return new e({ - type: `nonoptional`, - innerType: t, - ...T$10(n) - }); -} -function Ml$2(e, t) { - return new e({ - type: `success`, - innerType: t - }); -} -function Nl$2(e, t, n) { - return new e({ - type: `catch`, - innerType: t, - catchValue: typeof n == `function` ? n : () => n - }); -} -function Pl$2(e, t, n) { - return new e({ - type: `pipe`, - in: t, - out: n - }); -} -function Fl$2(e, t) { - return new e({ - type: `readonly`, - innerType: t - }); -} -function Il$2(e, t, n) { - return new e({ - type: `template_literal`, - parts: t, - ...T$10(n) - }); -} -function Ll$2(e, t) { - return new e({ - type: `lazy`, - getter: t - }); -} -function Rl$2(e, t) { - return new e({ - type: `promise`, - innerType: t - }); -} -function zl$2(e, t, n) { - let r = T$10(n); - return r.abort ??= !0, new e({ - type: `custom`, - check: `custom`, - fn: t, - ...r - }); -} -function Bl$2(e, t, n) { - return new e({ - type: `custom`, - check: `custom`, - fn: t, - ...T$10(n) - }); -} -function Vl$2(e) { - let t = Hl$2((n) => (n.addIssue = (e) => { - if (typeof e == `string`) n.issues.push(Pt$6(e, n.value, t._zod.def)); - else { - let r = e; - r.fatal && (r.continue = !1), r.code ??= `custom`, r.input ??= n.value, r.inst ??= t, r.continue ??= !t._zod.def.abort, n.issues.push(Pt$6(r)); - } - }, e(n.value, n))); - return t; -} -function Hl$2(e, t) { - let n = new k$9({ - check: `custom`, - ...T$10(t) - }); - return n._zod.check = e, n; -} -function Ul$2(e) { - let t = new k$9({ check: `describe` }); - return t._zod.onattach = [(t) => { - let n = Vs$2.get(t) ?? {}; - Vs$2.add(t, { - ...n, - description: e - }); - }], t._zod.check = () => {}, t; -} -function Wl$2(e) { - let t = new k$9({ check: `meta` }); - return t._zod.onattach = [(t) => { - let n = Vs$2.get(t) ?? {}; - Vs$2.add(t, { - ...n, - ...e - }); - }], t._zod.check = () => {}, t; -} -function Gl$2(e, t) { - let n = T$10(t), r = n.truthy ?? [ - `true`, - `1`, - `yes`, - `on`, - `y`, - `enabled` - ], i = n.falsy ?? [ - `false`, - `0`, - `no`, - `off`, - `n`, - `disabled` - ]; - n.case !== `sensitive` && (r = r.map((e) => typeof e == `string` ? e.toLowerCase() : e), i = i.map((e) => typeof e == `string` ? e.toLowerCase() : e)); - let a = new Set(r), o = new Set(i), s = e.Codec ?? ka$4, c = e.Boolean ?? Mi$4, l = new s({ - type: `pipe`, - in: new (e.String ?? ti$4)({ - type: `string`, - error: n.error - }), - out: new c({ - type: `boolean`, - error: n.error - }), - transform: ((e, t) => { - let r = e; - return n.case !== `sensitive` && (r = r.toLowerCase()), a.has(r) ? !0 : o.has(r) ? !1 : (t.issues.push({ - code: `invalid_value`, - expected: `stringbool`, - values: [...a, ...o], - input: t.value, - inst: l, - continue: !1 - }), {}); - }), - reverseTransform: ((e, t) => e === !0 ? r[0] || `true` : i[0] || `false`), - error: n.error - }); - return l; -} -function Kl$2(e, t, n, r = {}) { - let i = T$10(r), a = { - ...T$10(r), - check: `string_format`, - type: `string`, - format: t, - fn: typeof n == `function` ? n : (e) => n.test(e), - ...i - }; - return n instanceof RegExp && (a.pattern = n), new e(a); -} -function ql$2(e) { - let t = e?.target ?? `draft-2020-12`; - return t === `draft-4` && (t = `draft-04`), t === `draft-7` && (t = `draft-07`), { - processors: e.processors ?? {}, - metadataRegistry: e?.metadata ?? Vs$2, - target: t, - unrepresentable: e?.unrepresentable ?? `throw`, - override: e?.override ?? (() => {}), - io: e?.io ?? `output`, - counter: 0, - seen: /* @__PURE__ */ new Map(), - cycles: e?.cycles ?? `ref`, - reused: e?.reused ?? `inline`, - external: e?.external ?? void 0 - }; -} -function P$7(e, t, n = { - path: [], - schemaPath: [] -}) { - var r; - let i = e._zod.def, a = t.seen.get(e); - if (a) return a.count++, n.schemaPath.includes(e) && (a.cycle = n.path), a.schema; - let o = { - schema: {}, - count: 1, - cycle: void 0, - path: n.path - }; - t.seen.set(e, o); - let s = e._zod.toJSONSchema?.(); - if (s) o.schema = s; - else { - let r = { - ...n, - schemaPath: [...n.schemaPath, e], - path: n.path - }; - if (e._zod.processJSONSchema) e._zod.processJSONSchema(t, o.schema, r); - else { - let n = o.schema, a = t.processors[i.type]; - if (!a) throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`); - a(e, t, n, r); - } - let a = e._zod.parent; - a && (o.ref ||= a, P$7(a, t, r), t.seen.get(a).isParent = !0); - } - let c = t.metadataRegistry.get(e); - return c && Object.assign(o.schema, c), t.io === `input` && F$7(e) && (delete o.schema.examples, delete o.schema.default), t.io === `input` && o.schema._prefault && ((r = o.schema).default ?? (r.default = o.schema._prefault)), delete o.schema._prefault, t.seen.get(e).schema; -} -function Jl$2(e, t) { - let n = e.seen.get(t); - if (!n) throw Error(`Unprocessed schema. This is a bug in Zod.`); - let r = /* @__PURE__ */ new Map(); - for (let t of e.seen.entries()) { - let n = e.metadataRegistry.get(t[0])?.id; - if (n) { - let e = r.get(n); - if (e && e !== t[0]) throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`); - r.set(n, t[0]); - } - } - let i = (t) => { - let r = e.target === `draft-2020-12` ? `$defs` : `definitions`; - if (e.external) { - let n = e.external.registry.get(t[0])?.id, i = e.external.uri ?? ((e) => e); - if (n) return { ref: i(n) }; - let a = t[1].defId ?? t[1].schema.id ?? `schema${e.counter++}`; - return t[1].defId = a, { - defId: a, - ref: `${i(`__shared`)}#/${r}/${a}` - }; - } - if (t[1] === n) return { ref: `#` }; - let i = `#/${r}/`, a = t[1].schema.id ?? `__schema${e.counter++}`; - return { - defId: a, - ref: i + a - }; - }, a = (e) => { - if (e[1].schema.$ref) return; - let t = e[1], { ref: n, defId: r } = i(e); - t.def = { ...t.schema }, r && (t.defId = r); - let a = t.schema; - for (let e in a) delete a[e]; - a.$ref = n; - }; - if (e.cycles === `throw`) for (let t of e.seen.entries()) { - let e = t[1]; - if (e.cycle) throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/ - -Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`); - } - for (let n of e.seen.entries()) { - let r = n[1]; - if (t === n[0]) { - a(n); - continue; - } - if (e.external) { - let r = e.external.registry.get(n[0])?.id; - if (t !== n[0] && r) { - a(n); - continue; - } - } - if (e.metadataRegistry.get(n[0])?.id) { - a(n); - continue; - } - if (r.cycle) { - a(n); - continue; - } - if (r.count > 1 && e.reused === `ref`) { - a(n); - continue; - } - } -} -function Yl$2(e, t) { - let n = e.seen.get(t); - if (!n) throw Error(`Unprocessed schema. This is a bug in Zod.`); - let r = (t) => { - let n = e.seen.get(t); - if (n.ref === null) return; - let i = n.def ?? n.schema, a = { ...i }, o = n.ref; - if (n.ref = null, o) { - r(o); - let n = e.seen.get(o), s = n.schema; - if (s.$ref && (e.target === `draft-07` || e.target === `draft-04` || e.target === `openapi-3.0`) ? (i.allOf = i.allOf ?? [], i.allOf.push(s)) : Object.assign(i, s), Object.assign(i, a), t._zod.parent === o) for (let e in i) e === `$ref` || e === `allOf` || e in a || delete i[e]; - if (s.$ref && n.def) for (let e in i) e === `$ref` || e === `allOf` || e in n.def && JSON.stringify(i[e]) === JSON.stringify(n.def[e]) && delete i[e]; - } - let s = t._zod.parent; - if (s && s !== o) { - r(s); - let t = e.seen.get(s); - if (t?.schema.$ref && (i.$ref = t.schema.$ref, t.def)) for (let e in i) e === `$ref` || e === `allOf` || e in t.def && JSON.stringify(i[e]) === JSON.stringify(t.def[e]) && delete i[e]; - } - e.override({ - zodSchema: t, - jsonSchema: i, - path: n.path ?? [] - }); - }; - for (let t of [...e.seen.entries()].reverse()) r(t[0]); - let i = {}; - if (e.target === `draft-2020-12` ? i.$schema = `https://json-schema.org/draft/2020-12/schema` : e.target === `draft-07` ? i.$schema = `http://json-schema.org/draft-07/schema#` : e.target === `draft-04` ? i.$schema = `http://json-schema.org/draft-04/schema#` : e.target, e.external?.uri) { - let n = e.external.registry.get(t)?.id; - if (!n) throw Error("Schema is missing an `id` property"); - i.$id = e.external.uri(n); - } - Object.assign(i, n.def ?? n.schema); - let a = e.external?.defs ?? {}; - for (let t of e.seen.entries()) { - let e = t[1]; - e.def && e.defId && (a[e.defId] = e.def); - } - e.external || Object.keys(a).length > 0 && (e.target === `draft-2020-12` ? i.$defs = a : i.definitions = a); - try { - let n = JSON.parse(JSON.stringify(i)); - return Object.defineProperty(n, "~standard", { - value: { - ...t[`~standard`], - jsonSchema: { - input: Zl$2(t, `input`, e.processors), - output: Zl$2(t, `output`, e.processors) - } - }, - enumerable: !1, - writable: !1 - }), n; - } catch { - throw Error(`Error converting schema to JSON.`); - } -} -function F$7(e, t) { - let n = t ?? { seen: /* @__PURE__ */ new Set() }; - if (n.seen.has(e)) return !1; - n.seen.add(e); - let r = e._zod.def; - if (r.type === `transform`) return !0; - if (r.type === `array`) return F$7(r.element, n); - if (r.type === `set`) return F$7(r.valueType, n); - if (r.type === `lazy`) return F$7(r.getter(), n); - if (r.type === `promise` || r.type === `optional` || r.type === `nonoptional` || r.type === `nullable` || r.type === `readonly` || r.type === "default" || r.type === `prefault`) return F$7(r.innerType, n); - if (r.type === `intersection`) return F$7(r.left, n) || F$7(r.right, n); - if (r.type === `record` || r.type === `map`) return F$7(r.keyType, n) || F$7(r.valueType, n); - if (r.type === `pipe`) return F$7(r.in, n) || F$7(r.out, n); - if (r.type === `object`) { - for (let e in r.shape) if (F$7(r.shape[e], n)) return !0; - return !1; - } - if (r.type === `union`) { - for (let e of r.options) if (F$7(e, n)) return !0; - return !1; - } - if (r.type === `tuple`) { - for (let e of r.items) if (F$7(e, n)) return !0; - return !!(r.rest && F$7(r.rest, n)); - } - return !1; -} -const Xl$2 = (e, t = {}) => (n) => { - let r = ql$2({ - ...n, - processors: t - }); - return P$7(e, r), Jl$2(r, e), Yl$2(r, e); -}; -const Zl$2 = (e, t, n = {}) => (r) => { - let { libraryOptions: i, target: a } = r ?? {}, o = ql$2({ - ...i ?? {}, - target: a, - io: t, - processors: n - }); - return P$7(e, o), Jl$2(o, e), Yl$2(o, e); -}; -const Ql$2 = { - guid: `uuid`, - url: `uri`, - datetime: `date-time`, - json_string: `json-string`, - regex: `` -}; -const $l$2 = (e, t, n, r) => { - let i = n; - i.type = `string`; - let { minimum: a, maximum: o, format: s, patterns: c, contentEncoding: l } = e._zod.bag; - if (typeof a == `number` && (i.minLength = a), typeof o == `number` && (i.maxLength = o), s && (i.format = Ql$2[s] ?? s, i.format === `` && delete i.format, s === `time` && delete i.format), l && (i.contentEncoding = l), c && c.size > 0) { - let e = [...c]; - e.length === 1 ? i.pattern = e[0].source : e.length > 1 && (i.allOf = [...e.map((e) => ({ - ...t.target === `draft-07` || t.target === `draft-04` || t.target === `openapi-3.0` ? { type: `string` } : {}, - pattern: e.source - }))]); - } -}; -const eu$2 = (e, t, n, r) => { - let i = n, { minimum: a, maximum: o, format: s, multipleOf: c, exclusiveMaximum: l, exclusiveMinimum: u } = e._zod.bag; - typeof s == `string` && s.includes(`int`) ? i.type = `integer` : i.type = `number`, typeof u == `number` && (t.target === `draft-04` || t.target === `openapi-3.0` ? (i.minimum = u, i.exclusiveMinimum = !0) : i.exclusiveMinimum = u), typeof a == `number` && (i.minimum = a, typeof u == `number` && t.target !== `draft-04` && (u >= a ? delete i.minimum : delete i.exclusiveMinimum)), typeof l == `number` && (t.target === `draft-04` || t.target === `openapi-3.0` ? (i.maximum = l, i.exclusiveMaximum = !0) : i.exclusiveMaximum = l), typeof o == `number` && (i.maximum = o, typeof l == `number` && t.target !== `draft-04` && (l <= o ? delete i.maximum : delete i.exclusiveMaximum)), typeof c == `number` && (i.multipleOf = c); -}; -const tu$2 = (e, t, n, r) => { - n.type = `boolean`; -}; -const nu$2 = (e, t, n, r) => { - if (t.unrepresentable === `throw`) throw Error(`BigInt cannot be represented in JSON Schema`); -}; -const ru$2 = (e, t, n, r) => { - if (t.unrepresentable === `throw`) throw Error(`Symbols cannot be represented in JSON Schema`); -}; -const iu$2 = (e, t, n, r) => { - t.target === `openapi-3.0` ? (n.type = `string`, n.nullable = !0, n.enum = [null]) : n.type = `null`; -}; -const au$2 = (e, t, n, r) => { - if (t.unrepresentable === `throw`) throw Error(`Undefined cannot be represented in JSON Schema`); -}; -const ou$2 = (e, t, n, r) => { - if (t.unrepresentable === `throw`) throw Error(`Void cannot be represented in JSON Schema`); -}; -const su$2 = (e, t, n, r) => { - n.not = {}; -}; -const cu$2 = (e, t, n, r) => {}; -const lu$2 = (e, t, n, r) => {}; -const uu$2 = (e, t, n, r) => { - if (t.unrepresentable === `throw`) throw Error(`Date cannot be represented in JSON Schema`); -}; -const du$2 = (e, t, n, r) => { - let i = e._zod.def, a = We$8(i.entries); - a.every((e) => typeof e == `number`) && (n.type = `number`), a.every((e) => typeof e == `string`) && (n.type = `string`), n.enum = a; -}; -const fu$2 = (e, t, n, r) => { - let i = e._zod.def, a = []; - for (let e of i.values) if (e === void 0) { - if (t.unrepresentable === `throw`) throw Error("Literal `undefined` cannot be represented in JSON Schema"); - } else if (typeof e == `bigint`) { - if (t.unrepresentable === `throw`) throw Error(`BigInt literals cannot be represented in JSON Schema`); - a.push(Number(e)); - } else a.push(e); - if (a.length !== 0) if (a.length === 1) { - let e = a[0]; - n.type = e === null ? `null` : typeof e, t.target === `draft-04` || t.target === `openapi-3.0` ? n.enum = [e] : n.const = e; - } else a.every((e) => typeof e == `number`) && (n.type = `number`), a.every((e) => typeof e == `string`) && (n.type = `string`), a.every((e) => typeof e == `boolean`) && (n.type = `boolean`), a.every((e) => e === null) && (n.type = `null`), n.enum = a; -}; -const pu$2 = (e, t, n, r) => { - if (t.unrepresentable === `throw`) throw Error(`NaN cannot be represented in JSON Schema`); -}; -const mu$2 = (e, t, n, r) => { - let i = n, a = e._zod.pattern; - if (!a) throw Error(`Pattern not found in template literal`); - i.type = `string`, i.pattern = a.source; -}; -const hu$2 = (e, t, n, r) => { - let i = n, a = { - type: `string`, - format: `binary`, - contentEncoding: `binary` - }, { minimum: o, maximum: s, mime: c } = e._zod.bag; - o !== void 0 && (a.minLength = o), s !== void 0 && (a.maxLength = s), c ? c.length === 1 ? (a.contentMediaType = c[0], Object.assign(i, a)) : (Object.assign(i, a), i.anyOf = c.map((e) => ({ contentMediaType: e }))) : Object.assign(i, a); -}; -const gu$2 = (e, t, n, r) => { - n.type = `boolean`; -}; -const _u$2 = (e, t, n, r) => { - if (t.unrepresentable === `throw`) throw Error(`Custom types cannot be represented in JSON Schema`); -}; -const vu$2 = (e, t, n, r) => { - if (t.unrepresentable === `throw`) throw Error(`Function types cannot be represented in JSON Schema`); -}; -const yu$2 = (e, t, n, r) => { - if (t.unrepresentable === `throw`) throw Error(`Transforms cannot be represented in JSON Schema`); -}; -const bu$2 = (e, t, n, r) => { - if (t.unrepresentable === `throw`) throw Error(`Map cannot be represented in JSON Schema`); -}; -const xu$2 = (e, t, n, r) => { - if (t.unrepresentable === `throw`) throw Error(`Set cannot be represented in JSON Schema`); -}; -const Su$2 = (e, t, n, r) => { - let i = n, a = e._zod.def, { minimum: o, maximum: s } = e._zod.bag; - typeof o == `number` && (i.minItems = o), typeof s == `number` && (i.maxItems = s), i.type = `array`, i.items = P$7(a.element, t, { - ...r, - path: [...r.path, `items`] - }); -}; -const Cu$2 = (e, t, n, r) => { - let i = n, a = e._zod.def; - i.type = `object`, i.properties = {}; - let o = a.shape; - for (let e in o) i.properties[e] = P$7(o[e], t, { - ...r, - path: [ - ...r.path, - `properties`, - e - ] - }); - let s = new Set(Object.keys(o)), c = new Set([...s].filter((e) => { - let n = a.shape[e]._zod; - return t.io === `input` ? n.optin === void 0 : n.optout === void 0; - })); - c.size > 0 && (i.required = Array.from(c)), a.catchall?._zod.def.type === `never` ? i.additionalProperties = !1 : a.catchall ? a.catchall && (i.additionalProperties = P$7(a.catchall, t, { - ...r, - path: [...r.path, `additionalProperties`] - })) : t.io === `output` && (i.additionalProperties = !1); -}; -const wu$2 = (e, t, n, r) => { - let i = e._zod.def, a = i.inclusive === !1, o = i.options.map((e, n) => P$7(e, t, { - ...r, - path: [ - ...r.path, - a ? `oneOf` : `anyOf`, - n - ] - })); - a ? n.oneOf = o : n.anyOf = o; -}; -const Tu$2 = (e, t, n, r) => { - let i = e._zod.def, a = P$7(i.left, t, { - ...r, - path: [ - ...r.path, - `allOf`, - 0 - ] - }), o = P$7(i.right, t, { - ...r, - path: [ - ...r.path, - `allOf`, - 1 - ] - }), s = (e) => `allOf` in e && Object.keys(e).length === 1; - n.allOf = [...s(a) ? a.allOf : [a], ...s(o) ? o.allOf : [o]]; -}; -const Eu$2 = (e, t, n, r) => { - let i = n, a = e._zod.def; - i.type = `array`; - let o = t.target === `draft-2020-12` ? `prefixItems` : `items`, s = t.target === `draft-2020-12` || t.target === `openapi-3.0` ? `items` : `additionalItems`, c = a.items.map((e, n) => P$7(e, t, { - ...r, - path: [ - ...r.path, - o, - n - ] - })), l = a.rest ? P$7(a.rest, t, { - ...r, - path: [ - ...r.path, - s, - ...t.target === `openapi-3.0` ? [a.items.length] : [] - ] - }) : null; - t.target === `draft-2020-12` ? (i.prefixItems = c, l && (i.items = l)) : t.target === `openapi-3.0` ? (i.items = { anyOf: c }, l && i.items.anyOf.push(l), i.minItems = c.length, l || (i.maxItems = c.length)) : (i.items = c, l && (i.additionalItems = l)); - let { minimum: u, maximum: d } = e._zod.bag; - typeof u == `number` && (i.minItems = u), typeof d == `number` && (i.maxItems = d); -}; -const Du$2 = (e, t, n, r) => { - let i = n, a = e._zod.def; - i.type = `object`; - let o = a.keyType, s = o._zod.bag?.patterns; - if (a.mode === `loose` && s && s.size > 0) { - let e = P$7(a.valueType, t, { - ...r, - path: [ - ...r.path, - `patternProperties`, - `*` - ] - }); - i.patternProperties = {}; - for (let t of s) i.patternProperties[t.source] = e; - } else (t.target === `draft-07` || t.target === `draft-2020-12`) && (i.propertyNames = P$7(a.keyType, t, { - ...r, - path: [...r.path, `propertyNames`] - })), i.additionalProperties = P$7(a.valueType, t, { - ...r, - path: [...r.path, `additionalProperties`] - }); - let c = o._zod.values; - if (c) { - let e = [...c].filter((e) => typeof e == `string` || typeof e == `number`); - e.length > 0 && (i.required = e); - } -}; -const Ou$2 = (e, t, n, r) => { - let i = e._zod.def, a = P$7(i.innerType, t, r), o = t.seen.get(e); - t.target === `openapi-3.0` ? (o.ref = i.innerType, n.nullable = !0) : n.anyOf = [a, { type: `null` }]; -}; -const ku$2 = (e, t, n, r) => { - let i = e._zod.def; - P$7(i.innerType, t, r); - let a = t.seen.get(e); - a.ref = i.innerType; -}; -const Au$2 = (e, t, n, r) => { - let i = e._zod.def; - P$7(i.innerType, t, r); - let a = t.seen.get(e); - a.ref = i.innerType, n.default = JSON.parse(JSON.stringify(i.defaultValue)); -}; -const ju$2 = (e, t, n, r) => { - let i = e._zod.def; - P$7(i.innerType, t, r); - let a = t.seen.get(e); - a.ref = i.innerType, t.io === `input` && (n._prefault = JSON.parse(JSON.stringify(i.defaultValue))); -}; -const Mu$2 = (e, t, n, r) => { - let i = e._zod.def; - P$7(i.innerType, t, r); - let a = t.seen.get(e); - a.ref = i.innerType; - let o; - try { - o = i.catchValue(void 0); - } catch { - throw Error(`Dynamic catch values are not supported in JSON Schema`); - } - n.default = o; -}; -const Nu$2 = (e, t, n, r) => { - let i = e._zod.def, a = t.io === `input` ? i.in._zod.def.type === `transform` ? i.out : i.in : i.out; - P$7(a, t, r); - let o = t.seen.get(e); - o.ref = a; -}; -const Pu$2 = (e, t, n, r) => { - let i = e._zod.def; - P$7(i.innerType, t, r); - let a = t.seen.get(e); - a.ref = i.innerType, n.readOnly = !0; -}; -const Fu$2 = (e, t, n, r) => { - let i = e._zod.def; - P$7(i.innerType, t, r); - let a = t.seen.get(e); - a.ref = i.innerType; -}; -const Iu$2 = (e, t, n, r) => { - let i = e._zod.def; - P$7(i.innerType, t, r); - let a = t.seen.get(e); - a.ref = i.innerType; -}; -const Lu$2 = (e, t, n, r) => { - let i = e._zod.innerType; - P$7(i, t, r); - let a = t.seen.get(e); - a.ref = i; -}; -const Ru$2 = { - string: $l$2, - number: eu$2, - boolean: tu$2, - bigint: nu$2, - symbol: ru$2, - null: iu$2, - undefined: au$2, - void: ou$2, - never: su$2, - any: cu$2, - unknown: lu$2, - date: uu$2, - enum: du$2, - literal: fu$2, - nan: pu$2, - template_literal: mu$2, - file: hu$2, - success: gu$2, - custom: _u$2, - function: vu$2, - transform: yu$2, - map: bu$2, - set: xu$2, - array: Su$2, - object: Cu$2, - union: wu$2, - intersection: Tu$2, - tuple: Eu$2, - record: Du$2, - nullable: Ou$2, - nonoptional: ku$2, - default: Au$2, - prefault: ju$2, - catch: Mu$2, - pipe: Nu$2, - readonly: Pu$2, - promise: Fu$2, - optional: Iu$2, - lazy: Lu$2 -}; -function zu$2(e, t) { - if (`_idmap` in e) { - let n = e, r = ql$2({ - ...t, - processors: Ru$2 - }), i = {}; - for (let e of n._idmap.entries()) { - let [t, n] = e; - P$7(n, r); - } - let a = {}; - r.external = { - registry: n, - uri: t?.uri, - defs: i - }; - for (let e of n._idmap.entries()) { - let [t, n] = e; - Jl$2(r, n), a[t] = Yl$2(r, n); - } - return Object.keys(i).length > 0 && (a.__shared = { [r.target === `draft-2020-12` ? `$defs` : `definitions`]: i }), { schemas: a }; - } - let n = ql$2({ - ...t, - processors: Ru$2 - }); - return P$7(e, n), Jl$2(n, e), Yl$2(n, e); -} -var Bu$2 = class { - get metadataRegistry() { - return this.ctx.metadataRegistry; - } - get target() { - return this.ctx.target; - } - get unrepresentable() { - return this.ctx.unrepresentable; - } - get override() { - return this.ctx.override; - } - get io() { - return this.ctx.io; - } - get counter() { - return this.ctx.counter; - } - set counter(e) { - this.ctx.counter = e; - } - get seen() { - return this.ctx.seen; - } - constructor(e) { - let t = e?.target ?? `draft-2020-12`; - t === `draft-4` && (t = `draft-04`), t === `draft-7` && (t = `draft-07`), this.ctx = ql$2({ - processors: Ru$2, - target: t, - ...e?.metadata && { metadata: e.metadata }, - ...e?.unrepresentable && { unrepresentable: e.unrepresentable }, - ...e?.override && { override: e.override }, - ...e?.io && { io: e.io } - }); - } - process(e, t = { - path: [], - schemaPath: [] - }) { - return P$7(e, this.ctx, t); - } - emit(e, t) { - t && (t.cycles && (this.ctx.cycles = t.cycles), t.reused && (this.ctx.reused = t.reused), t.external && (this.ctx.external = t.external)), Jl$2(this.ctx, e); - let { "~standard": n, ...r } = Yl$2(this.ctx, e); - return r; - } -}; -var Vu$2 = l$11({}); -var Hu$2 = l$11({ - $ZodAny: () => Ri$4, - $ZodArray: () => Wi$4, - $ZodAsyncError: () => Fe$8, - $ZodBase64: () => Ci$4, - $ZodBase64URL: () => Ti$4, - $ZodBigInt: () => Ni$4, - $ZodBigIntFormat: () => Pi$4, - $ZodBoolean: () => Mi$4, - $ZodCIDRv4: () => bi$4, - $ZodCIDRv6: () => xi$4, - $ZodCUID: () => ci$4, - $ZodCUID2: () => li$4, - $ZodCatch: () => Ta$4, - $ZodCheck: () => k$9, - $ZodCheckBigIntFormat: () => Fr$4, - $ZodCheckEndsWith: () => Jr$4, - $ZodCheckGreaterThan: () => Mr$4, - $ZodCheckIncludes: () => Kr$4, - $ZodCheckLengthEquals: () => Vr$4, - $ZodCheckLessThan: () => jr$4, - $ZodCheckLowerCase: () => Wr$4, - $ZodCheckMaxLength: () => zr$4, - $ZodCheckMaxSize: () => Ir$4, - $ZodCheckMimeType: () => Zr$4, - $ZodCheckMinLength: () => Br$4, - $ZodCheckMinSize: () => Lr$4, - $ZodCheckMultipleOf: () => Nr$4, - $ZodCheckNumberFormat: () => Pr$4, - $ZodCheckOverwrite: () => Qr$4, - $ZodCheckProperty: () => Xr$4, - $ZodCheckRegex: () => Ur$4, - $ZodCheckSizeEquals: () => Rr$4, - $ZodCheckStartsWith: () => qr$4, - $ZodCheckStringFormat: () => Hr$4, - $ZodCheckUpperCase: () => Gr$4, - $ZodCodec: () => ka$4, - $ZodCustom: () => Ra$4, - $ZodCustomStringFormat: () => ki$4, - $ZodDate: () => Hi$4, - $ZodDefault: () => ya$4, - $ZodDiscriminatedUnion: () => ea$4, - $ZodE164: () => Ei$4, - $ZodEmail: () => ii$4, - $ZodEmoji: () => oi$4, - $ZodEncodeError: () => Ie$8, - $ZodEnum: () => da$4, - $ZodError: () => Wt$5, - $ZodExactOptional: () => _a$4, - $ZodFile: () => pa$4, - $ZodFunction: () => Fa$4, - $ZodGUID: () => ni$4, - $ZodIPv4: () => _i$4, - $ZodIPv6: () => vi$4, - $ZodISODate: () => mi$4, - $ZodISODateTime: () => pi$4, - $ZodISODuration: () => gi$4, - $ZodISOTime: () => hi$4, - $ZodIntersection: () => ta$4, - $ZodJWT: () => Oi$4, - $ZodKSUID: () => fi$4, - $ZodLazy: () => La$4, - $ZodLiteral: () => fa$4, - $ZodMAC: () => yi$4, - $ZodMap: () => sa$4, - $ZodNaN: () => Ea$4, - $ZodNanoID: () => si$4, - $ZodNever: () => Bi$4, - $ZodNonOptional: () => Sa$4, - $ZodNull: () => Li$4, - $ZodNullable: () => va$4, - $ZodNumber: () => Ai$4, - $ZodNumberFormat: () => ji$4, - $ZodObject: () => Ji$4, - $ZodObjectJIT: () => Yi$4, - $ZodOptional: () => ga$4, - $ZodPipe: () => Da$4, - $ZodPrefault: () => xa$4, - $ZodPromise: () => Ia$4, - $ZodReadonly: () => Ma$4, - $ZodRealError: () => O$7, - $ZodRecord: () => oa$4, - $ZodRegistry: () => zs$2, - $ZodSet: () => la$4, - $ZodString: () => ti$4, - $ZodStringFormat: () => j$7, - $ZodSuccess: () => wa$4, - $ZodSymbol: () => Fi$4, - $ZodTemplateLiteral: () => Pa$4, - $ZodTransform: () => ma$4, - $ZodTuple: () => ia$4, - $ZodType: () => A$8, - $ZodULID: () => ui$4, - $ZodURL: () => ai$4, - $ZodUUID: () => ri$4, - $ZodUndefined: () => Ii$4, - $ZodUnion: () => Zi$4, - $ZodUnknown: () => zi$4, - $ZodVoid: () => Vi$4, - $ZodXID: () => di$4, - $ZodXor: () => $i$4, - $brand: () => Pe$8, - $constructor: () => x$8, - $input: () => Rs$2, - $output: () => Ls$2, - Doc: () => $r$4, - JSONSchema: () => Vu$2, - JSONSchemaGenerator: () => Bu$2, - NEVER: () => Ne$8, - TimePrecision: () => pc$2, - _any: () => Pc$2, - _array: () => ml$2, - _base64: () => lc$2, - _base64url: () => uc$2, - _bigint: () => Dc$2, - _boolean: () => Tc$2, - _catch: () => Nl$2, - _check: () => Hl$2, - _cidrv4: () => sc$2, - _cidrv6: () => cc$2, - _coercedBigint: () => Oc$2, - _coercedBoolean: () => Ec$2, - _coercedDate: () => zc$2, - _coercedNumber: () => yc$2, - _coercedString: () => Us$2, - _cuid: () => $s$2, - _cuid2: () => ec$2, - _custom: () => zl$2, - _date: () => Rc$2, - _decode: () => sn$5, - _decodeAsync: () => dn$5, - _default: () => Al$2, - _discriminatedUnion: () => _l$2, - _e164: () => dc$2, - _email: () => Ws$2, - _emoji: () => Zs$2, - _encode: () => an$5, - _encodeAsync: () => ln$5, - _endsWith: () => al$2, - _enum: () => Cl$2, - _file: () => El$2, - _float32: () => xc$2, - _float64: () => Sc$2, - _gt: () => Hc$2, - _gte: () => N$7, - _guid: () => Gs$2, - _includes: () => rl$2, - _int: () => bc$2, - _int32: () => Cc$2, - _int64: () => kc$2, - _intersection: () => vl$2, - _ipv4: () => ic$2, - _ipv6: () => ac$2, - _isoDate: () => hc$2, - _isoDateTime: () => mc$2, - _isoDuration: () => _c$2, - _isoTime: () => gc$2, - _jwt: () => fc$2, - _ksuid: () => rc$2, - _lazy: () => Ll$2, - _length: () => $c$2, - _literal: () => Tl$2, - _lowercase: () => tl$2, - _lt: () => Vc$2, - _lte: () => M$8, - _mac: () => oc$2, - _map: () => xl$2, - _max: () => M$8, - _maxLength: () => Zc$2, - _maxSize: () => Jc$2, - _mime: () => sl$2, - _min: () => N$7, - _minLength: () => Qc$2, - _minSize: () => Yc$2, - _multipleOf: () => qc$2, - _nan: () => Bc$2, - _nanoid: () => Qs$2, - _nativeEnum: () => wl$2, - _negative: () => Wc$2, - _never: () => Ic$2, - _nonnegative: () => Kc$2, - _nonoptional: () => jl$2, - _nonpositive: () => Gc$2, - _normalize: () => ll$2, - _null: () => Nc$2, - _nullable: () => kl$2, - _number: () => vc$2, - _optional: () => Ol$2, - _overwrite: () => cl$2, - _parse: () => Xt$5, - _parseAsync: () => Qt$5, - _pipe: () => Pl$2, - _positive: () => Uc$2, - _promise: () => Rl$2, - _property: () => ol$2, - _readonly: () => Fl$2, - _record: () => bl$2, - _refine: () => Bl$2, - _regex: () => el$2, - _safeDecode: () => hn$5, - _safeDecodeAsync: () => yn$5, - _safeEncode: () => pn$5, - _safeEncodeAsync: () => _n$5, - _safeParse: () => en$5, - _safeParseAsync: () => nn$5, - _set: () => Sl$2, - _size: () => Xc$2, - _slugify: () => pl$2, - _startsWith: () => il$2, - _string: () => Hs$2, - _stringFormat: () => Kl$2, - _stringbool: () => Gl$2, - _success: () => Ml$2, - _superRefine: () => Vl$2, - _symbol: () => jc$2, - _templateLiteral: () => Il$2, - _toLowerCase: () => dl$2, - _toUpperCase: () => fl$2, - _transform: () => Dl$2, - _trim: () => ul$2, - _tuple: () => yl$2, - _uint32: () => wc$2, - _uint64: () => Ac$2, - _ulid: () => tc$2, - _undefined: () => Mc$2, - _union: () => hl$2, - _unknown: () => Fc$2, - _uppercase: () => nl$2, - _url: () => Xs$2, - _uuid: () => Ks$2, - _uuidv4: () => qs$2, - _uuidv6: () => Js$2, - _uuidv7: () => Ys$2, - _void: () => Lc$2, - _xid: () => nc$2, - _xor: () => gl$2, - clone: () => gt$7, - config: () => S$9, - createStandardJSONSchemaMethod: () => Zl$2, - createToJSONSchemaMethod: () => Xl$2, - decode: () => cn$5, - decodeAsync: () => fn$5, - describe: () => Ul$2, - encode: () => on$5, - encodeAsync: () => un$5, - extractDefs: () => Jl$2, - finalize: () => Yl$2, - flattenError: () => Gt$5, - formatError: () => Kt$6, - globalConfig: () => Le$8, - globalRegistry: () => Vs$2, - initializeContext: () => ql$2, - isValidBase64: () => Si$4, - isValidBase64URL: () => wi$4, - isValidJWT: () => Di$4, - locales: () => Fs$2, - meta: () => Wl$2, - parse: () => Zt$5, - parseAsync: () => $t$5, - prettifyError: () => Yt$5, - process: () => P$7, - regexes: () => xn$4, - registry: () => Bs$2, - safeDecode: () => gn$5, - safeDecodeAsync: () => bn$5, - safeEncode: () => mn$5, - safeEncodeAsync: () => vn$5, - safeParse: () => tn$5, - safeParseAsync: () => rn$5, - toDotPath: () => Jt$6, - toJSONSchema: () => zu$2, - treeifyError: () => qt$6, - util: () => Re$8, - version: () => ei$4 -}); -var Uu$2 = l$11({ - endsWith: () => al$2, - gt: () => Hc$2, - gte: () => N$7, - includes: () => rl$2, - length: () => $c$2, - lowercase: () => tl$2, - lt: () => Vc$2, - lte: () => M$8, - maxLength: () => Zc$2, - maxSize: () => Jc$2, - mime: () => sl$2, - minLength: () => Qc$2, - minSize: () => Yc$2, - multipleOf: () => qc$2, - negative: () => Wc$2, - nonnegative: () => Kc$2, - nonpositive: () => Gc$2, - normalize: () => ll$2, - overwrite: () => cl$2, - positive: () => Uc$2, - property: () => ol$2, - regex: () => el$2, - size: () => Xc$2, - slugify: () => pl$2, - startsWith: () => il$2, - toLowerCase: () => dl$2, - toUpperCase: () => fl$2, - trim: () => ul$2, - uppercase: () => nl$2 -}); -var Wu$2 = l$11({ - ZodISODate: () => qu$2, - ZodISODateTime: () => Gu$2, - ZodISODuration: () => Zu$2, - ZodISOTime: () => Yu$2, - date: () => Ju$2, - datetime: () => Ku$2, - duration: () => Qu$2, - time: () => Xu$2 -}); -const Gu$2 = x$8(`ZodISODateTime`, (e, t) => { - pi$4.init(e, t), z$8.init(e, t); -}); -function Ku$2(e) { - return mc$2(Gu$2, e); -} -const qu$2 = x$8(`ZodISODate`, (e, t) => { - mi$4.init(e, t), z$8.init(e, t); -}); -function Ju$2(e) { - return hc$2(qu$2, e); -} -const Yu$2 = x$8(`ZodISOTime`, (e, t) => { - hi$4.init(e, t), z$8.init(e, t); -}); -function Xu$2(e) { - return gc$2(Yu$2, e); -} -const Zu$2 = x$8(`ZodISODuration`, (e, t) => { - gi$4.init(e, t), z$8.init(e, t); -}); -function Qu$2(e) { - return _c$2(Zu$2, e); -} -const $u$2 = (e, t) => { - Wt$5.init(e, t), e.name = `ZodError`, Object.defineProperties(e, { - format: { value: (t) => Kt$6(e, t) }, - flatten: { value: (t) => Gt$5(e, t) }, - addIssue: { value: (t) => { - e.issues.push(t), e.message = JSON.stringify(e.issues, Ge$8, 2); - } }, - addIssues: { value: (t) => { - e.issues.push(...t), e.message = JSON.stringify(e.issues, Ge$8, 2); - } }, - isEmpty: { get() { - return e.issues.length === 0; - } } - }); -}; -const ed$2 = x$8(`ZodError`, $u$2); -const I$7 = x$8(`ZodError`, $u$2, { Parent: Error }); -const td$2 = Xt$5(I$7); -const nd$2 = Qt$5(I$7); -const rd$2 = en$5(I$7); -const id$2 = nn$5(I$7); -const ad$2 = an$5(I$7); -const od$2 = sn$5(I$7); -const sd$2 = ln$5(I$7); -const cd$2 = dn$5(I$7); -const ld$2 = pn$5(I$7); -const ud$2 = hn$5(I$7); -const dd$2 = _n$5(I$7); -const fd$2 = yn$5(I$7); -var pd$2 = l$11({ - ZodAny: () => Mf$1, - ZodArray: () => Hf$1, - ZodBase64: () => Qd$1, - ZodBase64URL: () => ef$1, - ZodBigInt: () => xf$1, - ZodBigIntFormat: () => Cf$1, - ZodBoolean: () => yf$1, - ZodCIDRv4: () => Jd$1, - ZodCIDRv6: () => Xd$1, - ZodCUID: () => Md$1, - ZodCUID2: () => Pd$1, - ZodCatch: () => Pp$1, - ZodCodec: () => Bp$1, - ZodCustom: () => Qp$1, - ZodCustomStringFormat: () => sf$1, - ZodDate: () => Bf$1, - ZodDefault: () => Ep$1, - ZodDiscriminatedUnion: () => Qf$1, - ZodE164: () => nf$1, - ZodEmail: () => gd$2, - ZodEmoji: () => Od$1, - ZodEnum: () => dp$1, - ZodExactOptional: () => xp$1, - ZodFile: () => hp$1, - ZodFunction: () => Xp$1, - ZodGUID: () => vd$2, - ZodIPv4: () => Hd$1, - ZodIPv6: () => Kd$1, - ZodIntersection: () => ep$1, - ZodJWT: () => af$1, - ZodKSUID: () => Bd$1, - ZodLazy: () => Kp$1, - ZodLiteral: () => mp$1, - ZodMAC: () => Wd$1, - ZodMap: () => sp$1, - ZodNaN: () => Ip$1, - ZodNanoID: () => Ad$1, - ZodNever: () => If$1, - ZodNonOptional: () => Ap$1, - ZodNull: () => Af$1, - ZodNullable: () => Cp$1, - ZodNumber: () => ff$1, - ZodNumberFormat: () => pf$1, - ZodObject: () => Gf$1, - ZodOptional: () => yp$1, - ZodPipe: () => Rp$1, - ZodPrefault: () => Op$1, - ZodPromise: () => Jp$1, - ZodReadonly: () => Hp$1, - ZodRecord: () => ip$1, - ZodSet: () => lp$1, - ZodString: () => hd$2, - ZodStringFormat: () => z$8, - ZodSuccess: () => Mp$1, - ZodSymbol: () => Ef$1, - ZodTemplateLiteral: () => Wp$1, - ZodTransform: () => _p$1, - ZodTuple: () => np$1, - ZodType: () => L$7, - ZodULID: () => Id$1, - ZodURL: () => Td$2, - ZodUUID: () => bd$2, - ZodUndefined: () => Of$1, - ZodUnion: () => Jf$1, - ZodUnknown: () => Pf$1, - ZodVoid: () => Rf$1, - ZodXID: () => Rd$1, - ZodXor: () => Xf$1, - _ZodString: () => md$2, - _default: () => Dp$1, - _function: () => Zp$1, - any: () => Nf$1, - array: () => Uf$1, - base64: () => $d$1, - base64url: () => tf$1, - bigint: () => Sf$1, - boolean: () => bf$1, - catch: () => Fp$1, - check: () => $p$1, - cidrv4: () => Yd$1, - cidrv6: () => Zd$1, - codec: () => Vp$1, - cuid: () => Nd$1, - cuid2: () => Fd$1, - custom: () => em$1, - date: () => Vf$1, - describe: () => rm$2, - discriminatedUnion: () => $f$1, - e164: () => rf$1, - email: () => _d$2, - emoji: () => kd$1, - enum: () => fp$1, - exactOptional: () => Sp$1, - file: () => gp$1, - float32: () => hf$1, - float64: () => gf$1, - function: () => Zp$1, - guid: () => yd$2, - hash: () => df$1, - hex: () => uf$1, - hostname: () => lf$1, - httpUrl: () => Dd$1, - instanceof: () => am$1, - int: () => mf$1, - int32: () => _f$1, - int64: () => wf$1, - intersection: () => tp$1, - ipv4: () => Ud$1, - ipv6: () => qd$1, - json: () => sm$1, - jwt: () => of$1, - keyof: () => Wf$1, - ksuid: () => Vd$1, - lazy: () => qp$1, - literal: () => U$8, - looseObject: () => qf$1, - looseRecord: () => op$1, - mac: () => Gd$1, - map: () => cp$2, - meta: () => im$1, - nan: () => Lp$1, - nanoid: () => jd$1, - nativeEnum: () => pp$1, - never: () => Lf$1, - nonoptional: () => jp$1, - null: () => jf$1, - nullable: () => wp$1, - nullish: () => Tp$1, - number: () => B$9, - object: () => V$8, - optional: () => bp$1, - partialRecord: () => ap$1, - pipe: () => zp$1, - prefault: () => kp$1, - preprocess: () => cm$1, - promise: () => Yp$1, - readonly: () => Up$1, - record: () => H$8, - refine: () => tm$1, - set: () => up$1, - strictObject: () => Kf$1, - string: () => R$8, - stringFormat: () => cf$1, - stringbool: () => om$1, - success: () => Np$1, - superRefine: () => nm$1, - symbol: () => Df$1, - templateLiteral: () => Gp$1, - transform: () => vp$1, - tuple: () => rp$1, - uint32: () => vf$1, - uint64: () => Tf$1, - ulid: () => Ld$1, - undefined: () => kf$1, - union: () => Yf$1, - unknown: () => Ff$1, - url: () => Ed$2, - uuid: () => xd$2, - uuidv4: () => Sd$2, - uuidv6: () => Cd$2, - uuidv7: () => wd$2, - void: () => zf$1, - xid: () => zd$1, - xor: () => Zf$1 -}); -const L$7 = x$8(`ZodType`, (e, t) => (A$8.init(e, t), Object.assign(e[`~standard`], { jsonSchema: { - input: Zl$2(e, `input`), - output: Zl$2(e, `output`) -} }), e.toJSONSchema = Xl$2(e, {}), e.def = t, e.type = t.type, Object.defineProperty(e, "_def", { value: t }), e.check = (...n) => e.clone($e$8(t, { checks: [...t.checks ?? [], ...n.map((e) => typeof e == `function` ? { _zod: { - check: e, - def: { check: `custom` }, - onattach: [] -} } : e)] }), { parent: !0 }), e.with = e.check, e.clone = (t, n) => gt$7(e, t, n), e.brand = () => e, e.register = ((t, n) => (t.add(e, n), e)), e.parse = (t, n) => td$2(e, t, n, { callee: e.parse }), e.safeParse = (t, n) => rd$2(e, t, n), e.parseAsync = async (t, n) => nd$2(e, t, n, { callee: e.parseAsync }), e.safeParseAsync = async (t, n) => id$2(e, t, n), e.spa = e.safeParseAsync, e.encode = (t, n) => ad$2(e, t, n), e.decode = (t, n) => od$2(e, t, n), e.encodeAsync = async (t, n) => sd$2(e, t, n), e.decodeAsync = async (t, n) => cd$2(e, t, n), e.safeEncode = (t, n) => ld$2(e, t, n), e.safeDecode = (t, n) => ud$2(e, t, n), e.safeEncodeAsync = async (t, n) => dd$2(e, t, n), e.safeDecodeAsync = async (t, n) => fd$2(e, t, n), e.refine = (t, n) => e.check(tm$1(t, n)), e.superRefine = (t) => e.check(nm$1(t)), e.overwrite = (t) => e.check(cl$2(t)), e.optional = () => bp$1(e), e.exactOptional = () => Sp$1(e), e.nullable = () => wp$1(e), e.nullish = () => bp$1(wp$1(e)), e.nonoptional = (t) => jp$1(e, t), e.array = () => Uf$1(e), e.or = (t) => Yf$1([e, t]), e.and = (t) => tp$1(e, t), e.transform = (t) => zp$1(e, vp$1(t)), e.default = (t) => Dp$1(e, t), e.prefault = (t) => kp$1(e, t), e.catch = (t) => Fp$1(e, t), e.pipe = (t) => zp$1(e, t), e.readonly = () => Up$1(e), e.describe = (t) => { - let n = e.clone(); - return Vs$2.add(n, { description: t }), n; -}, Object.defineProperty(e, "description", { - get() { - return Vs$2.get(e)?.description; - }, - configurable: !0 -}), e.meta = (...t) => { - if (t.length === 0) return Vs$2.get(e); - let n = e.clone(); - return Vs$2.add(n, t[0]), n; -}, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e.apply = (t) => t(e), e)); -const md$2 = x$8(`_ZodString`, (e, t) => { - ti$4.init(e, t), L$7.init(e, t), e._zod.processJSONSchema = (t, n, r) => $l$2(e, t, n, r); - let n = e._zod.bag; - e.format = n.format ?? null, e.minLength = n.minimum ?? null, e.maxLength = n.maximum ?? null, e.regex = (...t) => e.check(el$2(...t)), e.includes = (...t) => e.check(rl$2(...t)), e.startsWith = (...t) => e.check(il$2(...t)), e.endsWith = (...t) => e.check(al$2(...t)), e.min = (...t) => e.check(Qc$2(...t)), e.max = (...t) => e.check(Zc$2(...t)), e.length = (...t) => e.check($c$2(...t)), e.nonempty = (...t) => e.check(Qc$2(1, ...t)), e.lowercase = (t) => e.check(tl$2(t)), e.uppercase = (t) => e.check(nl$2(t)), e.trim = () => e.check(ul$2()), e.normalize = (...t) => e.check(ll$2(...t)), e.toLowerCase = () => e.check(dl$2()), e.toUpperCase = () => e.check(fl$2()), e.slugify = () => e.check(pl$2()); -}); -const hd$2 = x$8(`ZodString`, (e, t) => { - ti$4.init(e, t), md$2.init(e, t), e.email = (t) => e.check(Ws$2(gd$2, t)), e.url = (t) => e.check(Xs$2(Td$2, t)), e.jwt = (t) => e.check(fc$2(af$1, t)), e.emoji = (t) => e.check(Zs$2(Od$1, t)), e.guid = (t) => e.check(Gs$2(vd$2, t)), e.uuid = (t) => e.check(Ks$2(bd$2, t)), e.uuidv4 = (t) => e.check(qs$2(bd$2, t)), e.uuidv6 = (t) => e.check(Js$2(bd$2, t)), e.uuidv7 = (t) => e.check(Ys$2(bd$2, t)), e.nanoid = (t) => e.check(Qs$2(Ad$1, t)), e.guid = (t) => e.check(Gs$2(vd$2, t)), e.cuid = (t) => e.check($s$2(Md$1, t)), e.cuid2 = (t) => e.check(ec$2(Pd$1, t)), e.ulid = (t) => e.check(tc$2(Id$1, t)), e.base64 = (t) => e.check(lc$2(Qd$1, t)), e.base64url = (t) => e.check(uc$2(ef$1, t)), e.xid = (t) => e.check(nc$2(Rd$1, t)), e.ksuid = (t) => e.check(rc$2(Bd$1, t)), e.ipv4 = (t) => e.check(ic$2(Hd$1, t)), e.ipv6 = (t) => e.check(ac$2(Kd$1, t)), e.cidrv4 = (t) => e.check(sc$2(Jd$1, t)), e.cidrv6 = (t) => e.check(cc$2(Xd$1, t)), e.e164 = (t) => e.check(dc$2(nf$1, t)), e.datetime = (t) => e.check(Ku$2(t)), e.date = (t) => e.check(Ju$2(t)), e.time = (t) => e.check(Xu$2(t)), e.duration = (t) => e.check(Qu$2(t)); -}); -function R$8(e) { - return Hs$2(hd$2, e); -} -const z$8 = x$8(`ZodStringFormat`, (e, t) => { - j$7.init(e, t), md$2.init(e, t); -}); -const gd$2 = x$8(`ZodEmail`, (e, t) => { - ii$4.init(e, t), z$8.init(e, t); -}); -function _d$2(e) { - return Ws$2(gd$2, e); -} -const vd$2 = x$8(`ZodGUID`, (e, t) => { - ni$4.init(e, t), z$8.init(e, t); -}); -function yd$2(e) { - return Gs$2(vd$2, e); -} -const bd$2 = x$8(`ZodUUID`, (e, t) => { - ri$4.init(e, t), z$8.init(e, t); -}); -function xd$2(e) { - return Ks$2(bd$2, e); -} -function Sd$2(e) { - return qs$2(bd$2, e); -} -function Cd$2(e) { - return Js$2(bd$2, e); -} -function wd$2(e) { - return Ys$2(bd$2, e); -} -const Td$2 = x$8(`ZodURL`, (e, t) => { - ai$4.init(e, t), z$8.init(e, t); -}); -function Ed$2(e) { - return Xs$2(Td$2, e); -} -function Dd$1(e) { - return Xs$2(Td$2, { - protocol: /^https?$/, - hostname: Xn$4, - ...T$10(e) - }); -} -const Od$1 = x$8(`ZodEmoji`, (e, t) => { - oi$4.init(e, t), z$8.init(e, t); -}); -function kd$1(e) { - return Zs$2(Od$1, e); -} -const Ad$1 = x$8(`ZodNanoID`, (e, t) => { - si$4.init(e, t), z$8.init(e, t); -}); -function jd$1(e) { - return Qs$2(Ad$1, e); -} -const Md$1 = x$8(`ZodCUID`, (e, t) => { - ci$4.init(e, t), z$8.init(e, t); -}); -function Nd$1(e) { - return $s$2(Md$1, e); -} -const Pd$1 = x$8(`ZodCUID2`, (e, t) => { - li$4.init(e, t), z$8.init(e, t); -}); -function Fd$1(e) { - return ec$2(Pd$1, e); -} -const Id$1 = x$8(`ZodULID`, (e, t) => { - ui$4.init(e, t), z$8.init(e, t); -}); -function Ld$1(e) { - return tc$2(Id$1, e); -} -const Rd$1 = x$8(`ZodXID`, (e, t) => { - di$4.init(e, t), z$8.init(e, t); -}); -function zd$1(e) { - return nc$2(Rd$1, e); -} -const Bd$1 = x$8(`ZodKSUID`, (e, t) => { - fi$4.init(e, t), z$8.init(e, t); -}); -function Vd$1(e) { - return rc$2(Bd$1, e); -} -const Hd$1 = x$8(`ZodIPv4`, (e, t) => { - _i$4.init(e, t), z$8.init(e, t); -}); -function Ud$1(e) { - return ic$2(Hd$1, e); -} -const Wd$1 = x$8(`ZodMAC`, (e, t) => { - yi$4.init(e, t), z$8.init(e, t); -}); -function Gd$1(e) { - return oc$2(Wd$1, e); -} -const Kd$1 = x$8(`ZodIPv6`, (e, t) => { - vi$4.init(e, t), z$8.init(e, t); -}); -function qd$1(e) { - return ac$2(Kd$1, e); -} -const Jd$1 = x$8(`ZodCIDRv4`, (e, t) => { - bi$4.init(e, t), z$8.init(e, t); -}); -function Yd$1(e) { - return sc$2(Jd$1, e); -} -const Xd$1 = x$8(`ZodCIDRv6`, (e, t) => { - xi$4.init(e, t), z$8.init(e, t); -}); -function Zd$1(e) { - return cc$2(Xd$1, e); -} -const Qd$1 = x$8(`ZodBase64`, (e, t) => { - Ci$4.init(e, t), z$8.init(e, t); -}); -function $d$1(e) { - return lc$2(Qd$1, e); -} -const ef$1 = x$8(`ZodBase64URL`, (e, t) => { - Ti$4.init(e, t), z$8.init(e, t); -}); -function tf$1(e) { - return uc$2(ef$1, e); -} -const nf$1 = x$8(`ZodE164`, (e, t) => { - Ei$4.init(e, t), z$8.init(e, t); -}); -function rf$1(e) { - return dc$2(nf$1, e); -} -const af$1 = x$8(`ZodJWT`, (e, t) => { - Oi$4.init(e, t), z$8.init(e, t); -}); -function of$1(e) { - return fc$2(af$1, e); -} -const sf$1 = x$8(`ZodCustomStringFormat`, (e, t) => { - ki$4.init(e, t), z$8.init(e, t); -}); -function cf$1(e, t, n = {}) { - return Kl$2(sf$1, e, t, n); -} -function lf$1(e) { - return Kl$2(sf$1, `hostname`, Yn$3, e); -} -function uf$1(e) { - return Kl$2(sf$1, `hex`, fr$3, e); -} -function df$1(e, t) { - let n = `${e}_${t?.enc ?? `hex`}`, r = xn$4[n]; - if (!r) throw Error(`Unrecognized hash format: ${n}`); - return Kl$2(sf$1, n, r, t); -} -const ff$1 = x$8(`ZodNumber`, (e, t) => { - Ai$4.init(e, t), L$7.init(e, t), e._zod.processJSONSchema = (t, n, r) => eu$2(e, t, n, r), e.gt = (t, n) => e.check(Hc$2(t, n)), e.gte = (t, n) => e.check(N$7(t, n)), e.min = (t, n) => e.check(N$7(t, n)), e.lt = (t, n) => e.check(Vc$2(t, n)), e.lte = (t, n) => e.check(M$8(t, n)), e.max = (t, n) => e.check(M$8(t, n)), e.int = (t) => e.check(mf$1(t)), e.safe = (t) => e.check(mf$1(t)), e.positive = (t) => e.check(Hc$2(0, t)), e.nonnegative = (t) => e.check(N$7(0, t)), e.negative = (t) => e.check(Vc$2(0, t)), e.nonpositive = (t) => e.check(M$8(0, t)), e.multipleOf = (t, n) => e.check(qc$2(t, n)), e.step = (t, n) => e.check(qc$2(t, n)), e.finite = () => e; - let n = e._zod.bag; - e.minValue = Math.max(n.minimum ?? -Infinity, n.exclusiveMinimum ?? -Infinity) ?? null, e.maxValue = Math.min(n.maximum ?? Infinity, n.exclusiveMaximum ?? Infinity) ?? null, e.isInt = (n.format ?? ``).includes(`int`) || Number.isSafeInteger(n.multipleOf ?? .5), e.isFinite = !0, e.format = n.format ?? null; -}); -function B$9(e) { - return vc$2(ff$1, e); -} -const pf$1 = x$8(`ZodNumberFormat`, (e, t) => { - ji$4.init(e, t), ff$1.init(e, t); -}); -function mf$1(e) { - return bc$2(pf$1, e); -} -function hf$1(e) { - return xc$2(pf$1, e); -} -function gf$1(e) { - return Sc$2(pf$1, e); -} -function _f$1(e) { - return Cc$2(pf$1, e); -} -function vf$1(e) { - return wc$2(pf$1, e); -} -const yf$1 = x$8(`ZodBoolean`, (e, t) => { - Mi$4.init(e, t), L$7.init(e, t), e._zod.processJSONSchema = (t, n, r) => tu$2(e, t, n, r); -}); -function bf$1(e) { - return Tc$2(yf$1, e); -} -const xf$1 = x$8(`ZodBigInt`, (e, t) => { - Ni$4.init(e, t), L$7.init(e, t), e._zod.processJSONSchema = (t, n, r) => nu$2(e, t, n, r), e.gte = (t, n) => e.check(N$7(t, n)), e.min = (t, n) => e.check(N$7(t, n)), e.gt = (t, n) => e.check(Hc$2(t, n)), e.gte = (t, n) => e.check(N$7(t, n)), e.min = (t, n) => e.check(N$7(t, n)), e.lt = (t, n) => e.check(Vc$2(t, n)), e.lte = (t, n) => e.check(M$8(t, n)), e.max = (t, n) => e.check(M$8(t, n)), e.positive = (t) => e.check(Hc$2(BigInt(0), t)), e.negative = (t) => e.check(Vc$2(BigInt(0), t)), e.nonpositive = (t) => e.check(M$8(BigInt(0), t)), e.nonnegative = (t) => e.check(N$7(BigInt(0), t)), e.multipleOf = (t, n) => e.check(qc$2(t, n)); - let n = e._zod.bag; - e.minValue = n.minimum ?? null, e.maxValue = n.maximum ?? null, e.format = n.format ?? null; -}); -function Sf$1(e) { - return Dc$2(xf$1, e); -} -const Cf$1 = x$8(`ZodBigIntFormat`, (e, t) => { - Pi$4.init(e, t), xf$1.init(e, t); -}); -function wf$1(e) { - return kc$2(Cf$1, e); -} -function Tf$1(e) { - return Ac$2(Cf$1, e); -} -const Ef$1 = x$8(`ZodSymbol`, (e, t) => { - Fi$4.init(e, t), L$7.init(e, t), e._zod.processJSONSchema = (t, n, r) => ru$2(e, t, n, r); -}); -function Df$1(e) { - return jc$2(Ef$1, e); -} -const Of$1 = x$8(`ZodUndefined`, (e, t) => { - Ii$4.init(e, t), L$7.init(e, t), e._zod.processJSONSchema = (t, n, r) => au$2(e, t, n, r); -}); -function kf$1(e) { - return Mc$2(Of$1, e); -} -const Af$1 = x$8(`ZodNull`, (e, t) => { - Li$4.init(e, t), L$7.init(e, t), e._zod.processJSONSchema = (t, n, r) => iu$2(e, t, n, r); -}); -function jf$1(e) { - return Nc$2(Af$1, e); -} -const Mf$1 = x$8(`ZodAny`, (e, t) => { - Ri$4.init(e, t), L$7.init(e, t), e._zod.processJSONSchema = (e, t, n) => void 0; -}); -function Nf$1() { - return Pc$2(Mf$1); -} -const Pf$1 = x$8(`ZodUnknown`, (e, t) => { - zi$4.init(e, t), L$7.init(e, t), e._zod.processJSONSchema = (e, t, n) => void 0; -}); -function Ff$1() { - return Fc$2(Pf$1); -} -const If$1 = x$8(`ZodNever`, (e, t) => { - Bi$4.init(e, t), L$7.init(e, t), e._zod.processJSONSchema = (t, n, r) => su$2(e, t, n, r); -}); -function Lf$1(e) { - return Ic$2(If$1, e); -} -const Rf$1 = x$8(`ZodVoid`, (e, t) => { - Vi$4.init(e, t), L$7.init(e, t), e._zod.processJSONSchema = (t, n, r) => ou$2(e, t, n, r); -}); -function zf$1(e) { - return Lc$2(Rf$1, e); -} -const Bf$1 = x$8(`ZodDate`, (e, t) => { - Hi$4.init(e, t), L$7.init(e, t), e._zod.processJSONSchema = (t, n, r) => uu$2(e, t, n, r), e.min = (t, n) => e.check(N$7(t, n)), e.max = (t, n) => e.check(M$8(t, n)); - let n = e._zod.bag; - e.minDate = n.minimum ? new Date(n.minimum) : null, e.maxDate = n.maximum ? new Date(n.maximum) : null; -}); -function Vf$1(e) { - return Rc$2(Bf$1, e); -} -const Hf$1 = x$8(`ZodArray`, (e, t) => { - Wi$4.init(e, t), L$7.init(e, t), e._zod.processJSONSchema = (t, n, r) => Su$2(e, t, n, r), e.element = t.element, e.min = (t, n) => e.check(Qc$2(t, n)), e.nonempty = (t) => e.check(Qc$2(1, t)), e.max = (t, n) => e.check(Zc$2(t, n)), e.length = (t, n) => e.check($c$2(t, n)), e.unwrap = () => e.element; -}); -function Uf$1(e, t) { - return ml$2(Hf$1, e, t); -} -function Wf$1(e) { - let t = e._zod.def.shape; - return fp$1(Object.keys(t)); -} -const Gf$1 = x$8(`ZodObject`, (e, t) => { - Yi$4.init(e, t), L$7.init(e, t), e._zod.processJSONSchema = (t, n, r) => Cu$2(e, t, n, r), w$10(e, `shape`, () => t.shape), e.keyof = () => fp$1(Object.keys(e._zod.def.shape)), e.catchall = (t) => e.clone({ - ...e._zod.def, - catchall: t - }), e.passthrough = () => e.clone({ - ...e._zod.def, - catchall: Ff$1() - }), e.loose = () => e.clone({ - ...e._zod.def, - catchall: Ff$1() - }), e.strict = () => e.clone({ - ...e._zod.def, - catchall: Lf$1() - }), e.strip = () => e.clone({ - ...e._zod.def, - catchall: void 0 - }), e.extend = (t) => Ct$7(e, t), e.safeExtend = (t) => wt$7(e, t), e.merge = (t) => Tt$7(e, t), e.pick = (t) => xt$7(e, t), e.omit = (t) => St$7(e, t), e.partial = (...t) => Et$7(yp$1, e, t[0]), e.required = (...t) => Dt$7(Ap$1, e, t[0]); -}); -function V$8(e, t) { - return new Gf$1({ - type: `object`, - shape: e ?? {}, - ...T$10(t) - }); -} -function Kf$1(e, t) { - return new Gf$1({ - type: `object`, - shape: e, - catchall: Lf$1(), - ...T$10(t) - }); -} -function qf$1(e, t) { - return new Gf$1({ - type: `object`, - shape: e, - catchall: Ff$1(), - ...T$10(t) - }); -} -const Jf$1 = x$8(`ZodUnion`, (e, t) => { - Zi$4.init(e, t), L$7.init(e, t), e._zod.processJSONSchema = (t, n, r) => wu$2(e, t, n, r), e.options = t.options; -}); -function Yf$1(e, t) { - return new Jf$1({ - type: `union`, - options: e, - ...T$10(t) - }); -} -const Xf$1 = x$8(`ZodXor`, (e, t) => { - Jf$1.init(e, t), $i$4.init(e, t), e._zod.processJSONSchema = (t, n, r) => wu$2(e, t, n, r), e.options = t.options; -}); -function Zf$1(e, t) { - return new Xf$1({ - type: `union`, - options: e, - inclusive: !1, - ...T$10(t) - }); -} -const Qf$1 = x$8(`ZodDiscriminatedUnion`, (e, t) => { - Jf$1.init(e, t), ea$4.init(e, t); -}); -function $f$1(e, t, n) { - return new Qf$1({ - type: `union`, - options: t, - discriminator: e, - ...T$10(n) - }); -} -const ep$1 = x$8(`ZodIntersection`, (e, t) => { - ta$4.init(e, t), L$7.init(e, t), e._zod.processJSONSchema = (t, n, r) => Tu$2(e, t, n, r); -}); -function tp$1(e, t) { - return new ep$1({ - type: `intersection`, - left: e, - right: t - }); -} -const np$1 = x$8(`ZodTuple`, (e, t) => { - ia$4.init(e, t), L$7.init(e, t), e._zod.processJSONSchema = (t, n, r) => Eu$2(e, t, n, r), e.rest = (t) => e.clone({ - ...e._zod.def, - rest: t - }); -}); -function rp$1(e, t, n) { - let r = t instanceof A$8; - return new np$1({ - type: `tuple`, - items: e, - rest: r ? t : null, - ...T$10(r ? n : t) - }); -} -const ip$1 = x$8(`ZodRecord`, (e, t) => { - oa$4.init(e, t), L$7.init(e, t), e._zod.processJSONSchema = (t, n, r) => Du$2(e, t, n, r), e.keyType = t.keyType, e.valueType = t.valueType; -}); -function H$8(e, t, n) { - return new ip$1({ - type: `record`, - keyType: e, - valueType: t, - ...T$10(n) - }); -} -function ap$1(e, t, n) { - let r = gt$7(e); - return r._zod.values = void 0, new ip$1({ - type: `record`, - keyType: r, - valueType: t, - ...T$10(n) - }); -} -function op$1(e, t, n) { - return new ip$1({ - type: `record`, - keyType: e, - valueType: t, - mode: `loose`, - ...T$10(n) - }); -} -const sp$1 = x$8(`ZodMap`, (e, t) => { - sa$4.init(e, t), L$7.init(e, t), e._zod.processJSONSchema = (t, n, r) => bu$2(e, t, n, r), e.keyType = t.keyType, e.valueType = t.valueType, e.min = (...t) => e.check(Yc$2(...t)), e.nonempty = (t) => e.check(Yc$2(1, t)), e.max = (...t) => e.check(Jc$2(...t)), e.size = (...t) => e.check(Xc$2(...t)); -}); -function cp$2(e, t, n) { - return new sp$1({ - type: `map`, - keyType: e, - valueType: t, - ...T$10(n) - }); -} -const lp$1 = x$8(`ZodSet`, (e, t) => { - la$4.init(e, t), L$7.init(e, t), e._zod.processJSONSchema = (t, n, r) => xu$2(e, t, n, r), e.min = (...t) => e.check(Yc$2(...t)), e.nonempty = (t) => e.check(Yc$2(1, t)), e.max = (...t) => e.check(Jc$2(...t)), e.size = (...t) => e.check(Xc$2(...t)); -}); -function up$1(e, t) { - return new lp$1({ - type: `set`, - valueType: e, - ...T$10(t) - }); -} -const dp$1 = x$8(`ZodEnum`, (e, t) => { - da$4.init(e, t), L$7.init(e, t), e._zod.processJSONSchema = (t, n, r) => du$2(e, t, n, r), e.enum = t.entries, e.options = Object.values(t.entries); - let n = new Set(Object.keys(t.entries)); - e.extract = (e, r) => { - let i = {}; - for (let r of e) if (n.has(r)) i[r] = t.entries[r]; - else throw Error(`Key ${r} not found in enum`); - return new dp$1({ - ...t, - checks: [], - ...T$10(r), - entries: i - }); - }, e.exclude = (e, r) => { - let i = { ...t.entries }; - for (let t of e) if (n.has(t)) delete i[t]; - else throw Error(`Key ${t} not found in enum`); - return new dp$1({ - ...t, - checks: [], - ...T$10(r), - entries: i - }); - }; -}); -function fp$1(e, t) { - return new dp$1({ - type: `enum`, - entries: Array.isArray(e) ? Object.fromEntries(e.map((e) => [e, e])) : e, - ...T$10(t) - }); -} -function pp$1(e, t) { - return new dp$1({ - type: `enum`, - entries: e, - ...T$10(t) - }); -} -const mp$1 = x$8(`ZodLiteral`, (e, t) => { - fa$4.init(e, t), L$7.init(e, t), e._zod.processJSONSchema = (t, n, r) => fu$2(e, t, n, r), e.values = new Set(t.values), Object.defineProperty(e, "value", { get() { - if (t.values.length > 1) throw Error("This schema contains multiple valid literal values. Use `.values` instead."); - return t.values[0]; - } }); -}); -function U$8(e, t) { - return new mp$1({ - type: `literal`, - values: Array.isArray(e) ? e : [e], - ...T$10(t) - }); -} -const hp$1 = x$8(`ZodFile`, (e, t) => { - pa$4.init(e, t), L$7.init(e, t), e._zod.processJSONSchema = (t, n, r) => hu$2(e, t, n, r), e.min = (t, n) => e.check(Yc$2(t, n)), e.max = (t, n) => e.check(Jc$2(t, n)), e.mime = (t, n) => e.check(sl$2(Array.isArray(t) ? t : [t], n)); -}); -function gp$1(e) { - return El$2(hp$1, e); -} -const _p$1 = x$8(`ZodTransform`, (e, t) => { - ma$4.init(e, t), L$7.init(e, t), e._zod.processJSONSchema = (t, n, r) => yu$2(e, t, n, r), e._zod.parse = (n, r) => { - if (r.direction === `backward`) throw new Ie$8(e.constructor.name); - n.addIssue = (r) => { - if (typeof r == `string`) n.issues.push(Pt$6(r, n.value, t)); - else { - let t = r; - t.fatal && (t.continue = !1), t.code ??= `custom`, t.input ??= n.value, t.inst ??= e, n.issues.push(Pt$6(t)); - } - }; - let i = t.transform(n.value, n); - return i instanceof Promise ? i.then((e) => (n.value = e, n)) : (n.value = i, n); - }; -}); -function vp$1(e) { - return new _p$1({ - type: `transform`, - transform: e - }); -} -const yp$1 = x$8(`ZodOptional`, (e, t) => { - ga$4.init(e, t), L$7.init(e, t), e._zod.processJSONSchema = (t, n, r) => Iu$2(e, t, n, r), e.unwrap = () => e._zod.def.innerType; -}); -function bp$1(e) { - return new yp$1({ - type: `optional`, - innerType: e - }); -} -const xp$1 = x$8(`ZodExactOptional`, (e, t) => { - _a$4.init(e, t), L$7.init(e, t), e._zod.processJSONSchema = (t, n, r) => Iu$2(e, t, n, r), e.unwrap = () => e._zod.def.innerType; -}); -function Sp$1(e) { - return new xp$1({ - type: `optional`, - innerType: e - }); -} -const Cp$1 = x$8(`ZodNullable`, (e, t) => { - va$4.init(e, t), L$7.init(e, t), e._zod.processJSONSchema = (t, n, r) => Ou$2(e, t, n, r), e.unwrap = () => e._zod.def.innerType; -}); -function wp$1(e) { - return new Cp$1({ - type: `nullable`, - innerType: e - }); -} -function Tp$1(e) { - return bp$1(wp$1(e)); -} -const Ep$1 = x$8(`ZodDefault`, (e, t) => { - ya$4.init(e, t), L$7.init(e, t), e._zod.processJSONSchema = (t, n, r) => Au$2(e, t, n, r), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap; -}); -function Dp$1(e, t) { - return new Ep$1({ - type: `default`, - innerType: e, - get defaultValue() { - return typeof t == `function` ? t() : ut$7(t); - } - }); -} -const Op$1 = x$8(`ZodPrefault`, (e, t) => { - xa$4.init(e, t), L$7.init(e, t), e._zod.processJSONSchema = (t, n, r) => ju$2(e, t, n, r), e.unwrap = () => e._zod.def.innerType; -}); -function kp$1(e, t) { - return new Op$1({ - type: `prefault`, - innerType: e, - get defaultValue() { - return typeof t == `function` ? t() : ut$7(t); - } - }); -} -const Ap$1 = x$8(`ZodNonOptional`, (e, t) => { - Sa$4.init(e, t), L$7.init(e, t), e._zod.processJSONSchema = (t, n, r) => ku$2(e, t, n, r), e.unwrap = () => e._zod.def.innerType; -}); -function jp$1(e, t) { - return new Ap$1({ - type: `nonoptional`, - innerType: e, - ...T$10(t) - }); -} -const Mp$1 = x$8(`ZodSuccess`, (e, t) => { - wa$4.init(e, t), L$7.init(e, t), e._zod.processJSONSchema = (t, n, r) => gu$2(e, t, n, r), e.unwrap = () => e._zod.def.innerType; -}); -function Np$1(e) { - return new Mp$1({ - type: `success`, - innerType: e - }); -} -const Pp$1 = x$8(`ZodCatch`, (e, t) => { - Ta$4.init(e, t), L$7.init(e, t), e._zod.processJSONSchema = (t, n, r) => Mu$2(e, t, n, r), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap; -}); -function Fp$1(e, t) { - return new Pp$1({ - type: `catch`, - innerType: e, - catchValue: typeof t == `function` ? t : () => t - }); -} -const Ip$1 = x$8(`ZodNaN`, (e, t) => { - Ea$4.init(e, t), L$7.init(e, t), e._zod.processJSONSchema = (t, n, r) => pu$2(e, t, n, r); -}); -function Lp$1(e) { - return Bc$2(Ip$1, e); -} -const Rp$1 = x$8(`ZodPipe`, (e, t) => { - Da$4.init(e, t), L$7.init(e, t), e._zod.processJSONSchema = (t, n, r) => Nu$2(e, t, n, r), e.in = t.in, e.out = t.out; -}); -function zp$1(e, t) { - return new Rp$1({ - type: `pipe`, - in: e, - out: t - }); -} -const Bp$1 = x$8(`ZodCodec`, (e, t) => { - Rp$1.init(e, t), ka$4.init(e, t); -}); -function Vp$1(e, t, n) { - return new Bp$1({ - type: `pipe`, - in: e, - out: t, - transform: n.decode, - reverseTransform: n.encode - }); -} -const Hp$1 = x$8(`ZodReadonly`, (e, t) => { - Ma$4.init(e, t), L$7.init(e, t), e._zod.processJSONSchema = (t, n, r) => Pu$2(e, t, n, r), e.unwrap = () => e._zod.def.innerType; -}); -function Up$1(e) { - return new Hp$1({ - type: `readonly`, - innerType: e - }); -} -const Wp$1 = x$8(`ZodTemplateLiteral`, (e, t) => { - Pa$4.init(e, t), L$7.init(e, t), e._zod.processJSONSchema = (t, n, r) => mu$2(e, t, n, r); -}); -function Gp$1(e, t) { - return new Wp$1({ - type: `template_literal`, - parts: e, - ...T$10(t) - }); -} -const Kp$1 = x$8(`ZodLazy`, (e, t) => { - La$4.init(e, t), L$7.init(e, t), e._zod.processJSONSchema = (t, n, r) => Lu$2(e, t, n, r), e.unwrap = () => e._zod.def.getter(); -}); -function qp$1(e) { - return new Kp$1({ - type: `lazy`, - getter: e - }); -} -const Jp$1 = x$8(`ZodPromise`, (e, t) => { - Ia$4.init(e, t), L$7.init(e, t), e._zod.processJSONSchema = (t, n, r) => Fu$2(e, t, n, r), e.unwrap = () => e._zod.def.innerType; -}); -function Yp$1(e) { - return new Jp$1({ - type: `promise`, - innerType: e - }); -} -const Xp$1 = x$8(`ZodFunction`, (e, t) => { - Fa$4.init(e, t), L$7.init(e, t), e._zod.processJSONSchema = (t, n, r) => vu$2(e, t, n, r); -}); -function Zp$1(e) { - return new Xp$1({ - type: `function`, - input: Array.isArray(e?.input) ? rp$1(e?.input) : e?.input ?? Uf$1(Ff$1()), - output: e?.output ?? Ff$1() - }); -} -const Qp$1 = x$8(`ZodCustom`, (e, t) => { - Ra$4.init(e, t), L$7.init(e, t), e._zod.processJSONSchema = (t, n, r) => _u$2(e, t, n, r); -}); -function $p$1(e) { - let t = new k$9({ check: `custom` }); - return t._zod.check = e, t; -} -function em$1(e, t) { - return zl$2(Qp$1, e ?? (() => !0), t); -} -function tm$1(e, t = {}) { - return Bl$2(Qp$1, e, t); -} -function nm$1(e) { - return Vl$2(e); -} -const rm$2 = Ul$2; -const im$1 = Wl$2; -function am$1(e, t = {}) { - let n = new Qp$1({ - type: `custom`, - check: `custom`, - fn: (t) => t instanceof e, - abort: !0, - ...T$10(t) - }); - return n._zod.bag.Class = e, n._zod.check = (t) => { - t.value instanceof e || t.issues.push({ - code: `invalid_type`, - expected: e.name, - input: t.value, - inst: n, - path: [...n._zod.def.path ?? []] - }); - }, n; -} -const om$1 = (...e) => Gl$2({ - Codec: Bp$1, - Boolean: yf$1, - String: hd$2 -}, ...e); -function sm$1(e) { - let t = qp$1(() => Yf$1([ - R$8(e), - B$9(), - bf$1(), - jf$1(), - Uf$1(t), - H$8(R$8(), t) - ])); - return t; -} -function cm$1(e, t) { - return zp$1(vp$1(e), t); -} -const lm$1 = { - invalid_type: `invalid_type`, - too_big: `too_big`, - too_small: `too_small`, - invalid_format: `invalid_format`, - not_multiple_of: `not_multiple_of`, - unrecognized_keys: `unrecognized_keys`, - invalid_union: `invalid_union`, - invalid_key: `invalid_key`, - invalid_element: `invalid_element`, - invalid_value: `invalid_value`, - custom: `custom` -}; -function um$1(e) { - S$9({ customError: e }); -} -function dm$1() { - return S$9().customError; -} -var fm$1; -fm$1 ||= {}; -const W$7 = { - ...pd$2, - ...Uu$2, - iso: Wu$2 -}; -const pm$1 = new Set(`$schema.$ref.$defs.definitions.$id.id.$comment.$anchor.$vocabulary.$dynamicRef.$dynamicAnchor.type.enum.const.anyOf.oneOf.allOf.not.properties.required.additionalProperties.patternProperties.propertyNames.minProperties.maxProperties.items.prefixItems.additionalItems.minItems.maxItems.uniqueItems.contains.minContains.maxContains.minLength.maxLength.pattern.format.minimum.maximum.exclusiveMinimum.exclusiveMaximum.multipleOf.description.default.contentEncoding.contentMediaType.contentSchema.unevaluatedItems.unevaluatedProperties.if.then.else.dependentSchemas.dependentRequired.nullable.readOnly`.split(`.`)); -function mm$1(e, t) { - let n = e.$schema; - return n === `https://json-schema.org/draft/2020-12/schema` ? `draft-2020-12` : n === `http://json-schema.org/draft-07/schema#` ? `draft-7` : n === `http://json-schema.org/draft-04/schema#` ? `draft-4` : t ?? `draft-2020-12`; -} -function hm$1(e, t) { - if (!e.startsWith(`#`)) throw Error(`External $ref is not supported, only local refs (#/...) are allowed`); - let n = e.slice(1).split(`/`).filter(Boolean); - if (n.length === 0) return t.rootSchema; - let r = t.version === `draft-2020-12` ? `$defs` : `definitions`; - if (n[0] === r) { - let r = n[1]; - if (!r || !t.defs[r]) throw Error(`Reference not found: ${e}`); - return t.defs[r]; - } - throw Error(`Reference not found: ${e}`); -} -function gm$1(e, t) { - if (e.not !== void 0) { - if (typeof e.not == `object` && Object.keys(e.not).length === 0) return W$7.never(); - throw Error(`not is not supported in Zod (except { not: {} } for never)`); - } - if (e.unevaluatedItems !== void 0) throw Error(`unevaluatedItems is not supported`); - if (e.unevaluatedProperties !== void 0) throw Error(`unevaluatedProperties is not supported`); - if (e.if !== void 0 || e.then !== void 0 || e.else !== void 0) throw Error(`Conditional schemas (if/then/else) are not supported`); - if (e.dependentSchemas !== void 0 || e.dependentRequired !== void 0) throw Error(`dependentSchemas and dependentRequired are not supported`); - if (e.$ref) { - let n = e.$ref; - if (t.refs.has(n)) return t.refs.get(n); - if (t.processing.has(n)) return W$7.lazy(() => { - if (!t.refs.has(n)) throw Error(`Circular reference not resolved: ${n}`); - return t.refs.get(n); - }); - t.processing.add(n); - let r = G$7(hm$1(n, t), t); - return t.refs.set(n, r), t.processing.delete(n), r; - } - if (e.enum !== void 0) { - let n = e.enum; - if (t.version === `openapi-3.0` && e.nullable === !0 && n.length === 1 && n[0] === null) return W$7.null(); - if (n.length === 0) return W$7.never(); - if (n.length === 1) return W$7.literal(n[0]); - if (n.every((e) => typeof e == `string`)) return W$7.enum(n); - let r = n.map((e) => W$7.literal(e)); - return r.length < 2 ? r[0] : W$7.union([ - r[0], - r[1], - ...r.slice(2) - ]); - } - if (e.const !== void 0) return W$7.literal(e.const); - let n = e.type; - if (Array.isArray(n)) { - let r = n.map((n) => gm$1({ - ...e, - type: n - }, t)); - return r.length === 0 ? W$7.never() : r.length === 1 ? r[0] : W$7.union(r); - } - if (!n) return W$7.any(); - let r; - switch (n) { - case `string`: { - let t = W$7.string(); - if (e.format) { - let n = e.format; - n === `email` ? t = t.check(W$7.email()) : n === `uri` || n === `uri-reference` ? t = t.check(W$7.url()) : n === `uuid` || n === `guid` ? t = t.check(W$7.uuid()) : n === `date-time` ? t = t.check(W$7.iso.datetime()) : n === `date` ? t = t.check(W$7.iso.date()) : n === `time` ? t = t.check(W$7.iso.time()) : n === `duration` ? t = t.check(W$7.iso.duration()) : n === `ipv4` ? t = t.check(W$7.ipv4()) : n === `ipv6` ? t = t.check(W$7.ipv6()) : n === `mac` ? t = t.check(W$7.mac()) : n === `cidr` ? t = t.check(W$7.cidrv4()) : n === `cidr-v6` ? t = t.check(W$7.cidrv6()) : n === `base64` ? t = t.check(W$7.base64()) : n === `base64url` ? t = t.check(W$7.base64url()) : n === `e164` ? t = t.check(W$7.e164()) : n === `jwt` ? t = t.check(W$7.jwt()) : n === `emoji` ? t = t.check(W$7.emoji()) : n === `nanoid` ? t = t.check(W$7.nanoid()) : n === `cuid` ? t = t.check(W$7.cuid()) : n === `cuid2` ? t = t.check(W$7.cuid2()) : n === `ulid` ? t = t.check(W$7.ulid()) : n === `xid` ? t = t.check(W$7.xid()) : n === `ksuid` && (t = t.check(W$7.ksuid())); - } - typeof e.minLength == `number` && (t = t.min(e.minLength)), typeof e.maxLength == `number` && (t = t.max(e.maxLength)), e.pattern && (t = t.regex(new RegExp(e.pattern))), r = t; - break; - } - case `number`: - case `integer`: { - let t = n === `integer` ? W$7.number().int() : W$7.number(); - typeof e.minimum == `number` && (t = t.min(e.minimum)), typeof e.maximum == `number` && (t = t.max(e.maximum)), typeof e.exclusiveMinimum == `number` ? t = t.gt(e.exclusiveMinimum) : e.exclusiveMinimum === !0 && typeof e.minimum == `number` && (t = t.gt(e.minimum)), typeof e.exclusiveMaximum == `number` ? t = t.lt(e.exclusiveMaximum) : e.exclusiveMaximum === !0 && typeof e.maximum == `number` && (t = t.lt(e.maximum)), typeof e.multipleOf == `number` && (t = t.multipleOf(e.multipleOf)), r = t; - break; - } - case `boolean`: - r = W$7.boolean(); - break; - case `null`: - r = W$7.null(); - break; - case `object`: { - let n = {}, i = e.properties || {}, a = new Set(e.required || []); - for (let [e, r] of Object.entries(i)) { - let i = G$7(r, t); - n[e] = a.has(e) ? i : i.optional(); - } - if (e.propertyNames) { - let i = G$7(e.propertyNames, t), a = e.additionalProperties && typeof e.additionalProperties == `object` ? G$7(e.additionalProperties, t) : W$7.any(); - if (Object.keys(n).length === 0) { - r = W$7.record(i, a); - break; - } - let o = W$7.object(n).passthrough(), s = W$7.looseRecord(i, a); - r = W$7.intersection(o, s); - break; - } - if (e.patternProperties) { - let i = e.patternProperties, a = Object.keys(i), o = []; - for (let e of a) { - let n = G$7(i[e], t), r = W$7.string().regex(new RegExp(e)); - o.push(W$7.looseRecord(r, n)); - } - let s = []; - if (Object.keys(n).length > 0 && s.push(W$7.object(n).passthrough()), s.push(...o), s.length === 0) r = W$7.object({}).passthrough(); - else if (s.length === 1) r = s[0]; - else { - let e = W$7.intersection(s[0], s[1]); - for (let t = 2; t < s.length; t++) e = W$7.intersection(e, s[t]); - r = e; - } - break; - } - let o = W$7.object(n); - r = e.additionalProperties === !1 ? o.strict() : typeof e.additionalProperties == `object` ? o.catchall(G$7(e.additionalProperties, t)) : o.passthrough(); - break; - } - case `array`: { - let n = e.prefixItems, i = e.items; - if (n && Array.isArray(n)) { - let a = n.map((e) => G$7(e, t)), o = i && typeof i == `object` && !Array.isArray(i) ? G$7(i, t) : void 0; - r = o ? W$7.tuple(a).rest(o) : W$7.tuple(a), typeof e.minItems == `number` && (r = r.check(W$7.minLength(e.minItems))), typeof e.maxItems == `number` && (r = r.check(W$7.maxLength(e.maxItems))); - } else if (Array.isArray(i)) { - let n = i.map((e) => G$7(e, t)), a = e.additionalItems && typeof e.additionalItems == `object` ? G$7(e.additionalItems, t) : void 0; - r = a ? W$7.tuple(n).rest(a) : W$7.tuple(n), typeof e.minItems == `number` && (r = r.check(W$7.minLength(e.minItems))), typeof e.maxItems == `number` && (r = r.check(W$7.maxLength(e.maxItems))); - } else if (i !== void 0) { - let n = G$7(i, t), a = W$7.array(n); - typeof e.minItems == `number` && (a = a.min(e.minItems)), typeof e.maxItems == `number` && (a = a.max(e.maxItems)), r = a; - } else r = W$7.array(W$7.any()); - break; - } - default: throw Error(`Unsupported type: ${n}`); - } - return e.description && (r = r.describe(e.description)), e.default !== void 0 && (r = r.default(e.default)), r; -} -function G$7(e, t) { - if (typeof e == `boolean`) return e ? W$7.any() : W$7.never(); - let n = gm$1(e, t), r = e.type || e.enum !== void 0 || e.const !== void 0; - if (e.anyOf && Array.isArray(e.anyOf)) { - let i = e.anyOf.map((e) => G$7(e, t)), a = W$7.union(i); - n = r ? W$7.intersection(n, a) : a; - } - if (e.oneOf && Array.isArray(e.oneOf)) { - let i = e.oneOf.map((e) => G$7(e, t)), a = W$7.xor(i); - n = r ? W$7.intersection(n, a) : a; - } - if (e.allOf && Array.isArray(e.allOf)) if (e.allOf.length === 0) n = r ? n : W$7.any(); - else { - let i = r ? n : G$7(e.allOf[0], t), a = +!r; - for (let n = a; n < e.allOf.length; n++) i = W$7.intersection(i, G$7(e.allOf[n], t)); - n = i; - } - e.nullable === !0 && t.version === `openapi-3.0` && (n = W$7.nullable(n)), e.readOnly === !0 && (n = W$7.readonly(n)); - let i = {}; - for (let t of [ - `$id`, - `id`, - `$comment`, - `$anchor`, - `$vocabulary`, - `$dynamicRef`, - `$dynamicAnchor` - ]) t in e && (i[t] = e[t]); - for (let t of [ - `contentEncoding`, - `contentMediaType`, - `contentSchema` - ]) t in e && (i[t] = e[t]); - for (let t of Object.keys(e)) pm$1.has(t) || (i[t] = e[t]); - return Object.keys(i).length > 0 && t.registry.add(n, i), n; -} -function _m$1(e, t) { - return typeof e == `boolean` ? e ? W$7.any() : W$7.never() : G$7(e, { - version: mm$1(e, t?.defaultTarget), - defs: e.$defs || e.definitions || {}, - refs: /* @__PURE__ */ new Map(), - processing: /* @__PURE__ */ new Set(), - rootSchema: e, - registry: t?.registry ?? Vs$2 - }); -} -var vm$1 = l$11({ - bigint: () => Sm$1, - boolean: () => xm$1, - date: () => K$8, - number: () => bm$1, - string: () => ym$1 -}); -function ym$1(e) { - return Us$2(hd$2, e); -} -function bm$1(e) { - return yc$2(ff$1, e); -} -function xm$1(e) { - return Ec$2(yf$1, e); -} -function Sm$1(e) { - return Oc$2(xf$1, e); -} -function K$8(e) { - return zc$2(Bf$1, e); -} -var Cm$1 = l$11({ - $brand: () => Pe$8, - $input: () => Rs$2, - $output: () => Ls$2, - NEVER: () => Ne$8, - TimePrecision: () => pc$2, - ZodAny: () => Mf$1, - ZodArray: () => Hf$1, - ZodBase64: () => Qd$1, - ZodBase64URL: () => ef$1, - ZodBigInt: () => xf$1, - ZodBigIntFormat: () => Cf$1, - ZodBoolean: () => yf$1, - ZodCIDRv4: () => Jd$1, - ZodCIDRv6: () => Xd$1, - ZodCUID: () => Md$1, - ZodCUID2: () => Pd$1, - ZodCatch: () => Pp$1, - ZodCodec: () => Bp$1, - ZodCustom: () => Qp$1, - ZodCustomStringFormat: () => sf$1, - ZodDate: () => Bf$1, - ZodDefault: () => Ep$1, - ZodDiscriminatedUnion: () => Qf$1, - ZodE164: () => nf$1, - ZodEmail: () => gd$2, - ZodEmoji: () => Od$1, - ZodEnum: () => dp$1, - ZodError: () => ed$2, - ZodExactOptional: () => xp$1, - ZodFile: () => hp$1, - ZodFirstPartyTypeKind: () => fm$1, - ZodFunction: () => Xp$1, - ZodGUID: () => vd$2, - ZodIPv4: () => Hd$1, - ZodIPv6: () => Kd$1, - ZodISODate: () => qu$2, - ZodISODateTime: () => Gu$2, - ZodISODuration: () => Zu$2, - ZodISOTime: () => Yu$2, - ZodIntersection: () => ep$1, - ZodIssueCode: () => lm$1, - ZodJWT: () => af$1, - ZodKSUID: () => Bd$1, - ZodLazy: () => Kp$1, - ZodLiteral: () => mp$1, - ZodMAC: () => Wd$1, - ZodMap: () => sp$1, - ZodNaN: () => Ip$1, - ZodNanoID: () => Ad$1, - ZodNever: () => If$1, - ZodNonOptional: () => Ap$1, - ZodNull: () => Af$1, - ZodNullable: () => Cp$1, - ZodNumber: () => ff$1, - ZodNumberFormat: () => pf$1, - ZodObject: () => Gf$1, - ZodOptional: () => yp$1, - ZodPipe: () => Rp$1, - ZodPrefault: () => Op$1, - ZodPromise: () => Jp$1, - ZodReadonly: () => Hp$1, - ZodRealError: () => I$7, - ZodRecord: () => ip$1, - ZodSet: () => lp$1, - ZodString: () => hd$2, - ZodStringFormat: () => z$8, - ZodSuccess: () => Mp$1, - ZodSymbol: () => Ef$1, - ZodTemplateLiteral: () => Wp$1, - ZodTransform: () => _p$1, - ZodTuple: () => np$1, - ZodType: () => L$7, - ZodULID: () => Id$1, - ZodURL: () => Td$2, - ZodUUID: () => bd$2, - ZodUndefined: () => Of$1, - ZodUnion: () => Jf$1, - ZodUnknown: () => Pf$1, - ZodVoid: () => Rf$1, - ZodXID: () => Rd$1, - ZodXor: () => Xf$1, - _ZodString: () => md$2, - _default: () => Dp$1, - _function: () => Zp$1, - any: () => Nf$1, - array: () => Uf$1, - base64: () => $d$1, - base64url: () => tf$1, - bigint: () => Sf$1, - boolean: () => bf$1, - catch: () => Fp$1, - check: () => $p$1, - cidrv4: () => Yd$1, - cidrv6: () => Zd$1, - clone: () => gt$7, - codec: () => Vp$1, - coerce: () => vm$1, - config: () => S$9, - core: () => Hu$2, - cuid: () => Nd$1, - cuid2: () => Fd$1, - custom: () => em$1, - date: () => Vf$1, - decode: () => od$2, - decodeAsync: () => cd$2, - describe: () => rm$2, - discriminatedUnion: () => $f$1, - e164: () => rf$1, - email: () => _d$2, - emoji: () => kd$1, - encode: () => ad$2, - encodeAsync: () => sd$2, - endsWith: () => al$2, - enum: () => fp$1, - exactOptional: () => Sp$1, - file: () => gp$1, - flattenError: () => Gt$5, - float32: () => hf$1, - float64: () => gf$1, - formatError: () => Kt$6, - fromJSONSchema: () => _m$1, - function: () => Zp$1, - getErrorMap: () => dm$1, - globalRegistry: () => Vs$2, - gt: () => Hc$2, - gte: () => N$7, - guid: () => yd$2, - hash: () => df$1, - hex: () => uf$1, - hostname: () => lf$1, - httpUrl: () => Dd$1, - includes: () => rl$2, - instanceof: () => am$1, - int: () => mf$1, - int32: () => _f$1, - int64: () => wf$1, - intersection: () => tp$1, - ipv4: () => Ud$1, - ipv6: () => qd$1, - iso: () => Wu$2, - json: () => sm$1, - jwt: () => of$1, - keyof: () => Wf$1, - ksuid: () => Vd$1, - lazy: () => qp$1, - length: () => $c$2, - literal: () => U$8, - locales: () => Fs$2, - looseObject: () => qf$1, - looseRecord: () => op$1, - lowercase: () => tl$2, - lt: () => Vc$2, - lte: () => M$8, - mac: () => Gd$1, - map: () => cp$2, - maxLength: () => Zc$2, - maxSize: () => Jc$2, - meta: () => im$1, - mime: () => sl$2, - minLength: () => Qc$2, - minSize: () => Yc$2, - multipleOf: () => qc$2, - nan: () => Lp$1, - nanoid: () => jd$1, - nativeEnum: () => pp$1, - negative: () => Wc$2, - never: () => Lf$1, - nonnegative: () => Kc$2, - nonoptional: () => jp$1, - nonpositive: () => Gc$2, - normalize: () => ll$2, - null: () => jf$1, - nullable: () => wp$1, - nullish: () => Tp$1, - number: () => B$9, - object: () => V$8, - optional: () => bp$1, - overwrite: () => cl$2, - parse: () => td$2, - parseAsync: () => nd$2, - partialRecord: () => ap$1, - pipe: () => zp$1, - positive: () => Uc$2, - prefault: () => kp$1, - preprocess: () => cm$1, - prettifyError: () => Yt$5, - promise: () => Yp$1, - property: () => ol$2, - readonly: () => Up$1, - record: () => H$8, - refine: () => tm$1, - regex: () => el$2, - regexes: () => xn$4, - registry: () => Bs$2, - safeDecode: () => ud$2, - safeDecodeAsync: () => fd$2, - safeEncode: () => ld$2, - safeEncodeAsync: () => dd$2, - safeParse: () => rd$2, - safeParseAsync: () => id$2, - set: () => up$1, - setErrorMap: () => um$1, - size: () => Xc$2, - slugify: () => pl$2, - startsWith: () => il$2, - strictObject: () => Kf$1, - string: () => R$8, - stringFormat: () => cf$1, - stringbool: () => om$1, - success: () => Np$1, - superRefine: () => nm$1, - symbol: () => Df$1, - templateLiteral: () => Gp$1, - toJSONSchema: () => zu$2, - toLowerCase: () => dl$2, - toUpperCase: () => fl$2, - transform: () => vp$1, - treeifyError: () => qt$6, - trim: () => ul$2, - tuple: () => rp$1, - uint32: () => vf$1, - uint64: () => Tf$1, - ulid: () => Ld$1, - undefined: () => kf$1, - union: () => Yf$1, - unknown: () => Ff$1, - uppercase: () => nl$2, - url: () => Ed$2, - util: () => Re$8, - uuid: () => xd$2, - uuidv4: () => Sd$2, - uuidv6: () => Cd$2, - uuidv7: () => wd$2, - void: () => zf$1, - xid: () => zd$1, - xor: () => Zf$1 -}); -S$9(io$2()); -var wm$1 = Cm$1; -const Tm$1 = Uf$1(V$8({ - key: R$8(), - value: Yf$1([R$8(), jf$1()]) -})); -var Em$1 = class extends Error { - constructor(e) { - super(e), this.name = `AttributeValidationError`; - } -}; -const Dm$1 = (e) => new TextEncoder().encode(e).length; -function Om$1(e, t = {}) { - return typeof e == `string` ? e.length === 0 ? new Em$1(`Attribute key must not be empty`) : e.length > 256 ? new Em$1(`Attribute key length ${e.length} exceeds limit 256: ${JSON.stringify(e.slice(0, 32))}…`) : !t.allowReservedAttributes && e.startsWith(`$`) ? new Em$1(`Attribute key ${JSON.stringify(e)} starts with reserved prefix "\$" — that namespace is reserved for framework/library code. Set { allowReservedAttributes: true } only if your caller is framework-level.`) : null : new Em$1(`Attribute key must be a string, got ${typeof e}`); -} -function km$1(e) { - if (e === null) return null; - if (typeof e != `string`) return new Em$1(`Attribute value must be a string or null, got ${typeof e}`); - let t = Dm$1(e); - return t > 256 ? new Em$1(`Attribute value byte length ${t} exceeds limit 256`) : null; -} -function Am$1(e, t = {}) { - let n = /* @__PURE__ */ new Set(), r = t.existingKeys === void 0 ? void 0 : t.existingKeys instanceof Set ? t.existingKeys : new Set(t.existingKeys), i = 0, a = 0; - for (let o of e) { - let e = Om$1(o.key, { allowReservedAttributes: t.allowReservedAttributes }); - if (e) throw e; - let s = km$1(o.value); - if (s) throw s; - if (n.has(o.key)) throw new Em$1(`Attribute key ${JSON.stringify(o.key)} appears more than once in the same batch`); - n.add(o.key), o.value === null ? (r === void 0 || r.has(o.key)) && (a += 1) : (r === void 0 || !r.has(o.key)) && (i += 1); - } - let o = (r === void 0 ? 0 : r.size) + i - a; - if (o > 64) throw new Em$1(`Run attribute count would exceed limit 64 (post-merge ${o})`); -} -function jm$1(e, t) { - let n = { ...e ?? {} }; - for (let { key: e, value: r } of t) r === null ? delete n[e] : n[e] = r; - return n; -} -const q$7 = Yf$1([am$1(Uint8Array), Nf$1()]); -const Mm$1 = { - run_created: [`input`], - run_completed: [`output`], - run_failed: [`error`], - step_created: [`input`], - step_completed: [`result`], - step_failed: [`error`], - step_retrying: [`error`], - hook_created: [`metadata`], - hook_received: [`payload`] -}; -function Nm$1(e, t) { - if (t !== `none` || !(`eventData` in e)) return e; - let n = e.eventData; - if (!n || typeof n != `object`) { - let { eventData: t, ...n } = e; - return n; - } - let r = Mm$1[e.eventType]; - if (!r || r.length === 0) return e; - let i = { ...n }; - for (let e of r) delete i[e]; - let { eventData: a, ...o } = e; - return { - ...o, - ...Object.keys(i).length > 0 ? { eventData: i } : {} - }; -} -const Pm$1 = fp$1([ - `run_created`, - `run_started`, - `run_completed`, - `run_failed`, - `run_cancelled`, - `attr_set`, - `step_created`, - `step_completed`, - `step_failed`, - `step_retrying`, - `step_started`, - `hook_created`, - `hook_received`, - `hook_disposed`, - `hook_conflict`, - `wait_created`, - `wait_completed` -]); -const J$7 = V$8({ - eventType: Pm$1, - correlationId: R$8().optional(), - specVersion: B$9().optional() -}); -const Fm$1 = J$7.extend({ - eventType: U$8(`step_completed`), - correlationId: R$8(), - eventData: V$8({ - stepName: R$8().optional(), - workflowName: R$8().optional(), - result: q$7 - }) -}); -const Im$1 = J$7.extend({ - eventType: U$8(`step_failed`), - correlationId: R$8(), - eventData: V$8({ - stepName: R$8().optional(), - error: q$7 - }) -}); -const Lm$1 = J$7.extend({ - eventType: U$8(`step_retrying`), - correlationId: R$8(), - eventData: V$8({ - stepName: R$8().optional(), - error: q$7, - retryAfter: K$8().optional() - }) -}); -const Rm$1 = J$7.extend({ - eventType: U$8(`step_started`), - correlationId: R$8(), - eventData: V$8({ - stepName: R$8().optional(), - attempt: B$9().optional(), - workflowName: R$8().optional(), - input: q$7.optional() - }).optional() -}); -const zm$1 = J$7.extend({ - eventType: U$8(`step_created`), - correlationId: R$8(), - eventData: V$8({ - stepName: R$8(), - workflowName: R$8().optional(), - input: q$7 - }) -}); -const Bm$1 = J$7.extend({ - eventType: U$8(`hook_created`), - correlationId: R$8(), - eventData: V$8({ - token: R$8(), - metadata: q$7.optional(), - isWebhook: bf$1().optional(), - isSystem: bf$1().optional() - }) -}); -const Vm$1 = J$7.extend({ - eventType: U$8(`hook_received`), - correlationId: R$8(), - eventData: V$8({ - token: R$8().optional(), - payload: q$7 - }) -}); -const Hm$1 = J$7.extend({ - eventType: U$8(`hook_disposed`), - correlationId: R$8(), - eventData: V$8({ token: R$8().optional() }).optional() -}); -const Um$1 = J$7.extend({ - eventType: U$8(`hook_conflict`), - correlationId: R$8(), - eventData: V$8({ - token: R$8(), - conflictingRunId: R$8().optional() - }) -}); -const Wm$1 = J$7.extend({ - eventType: U$8(`wait_created`), - correlationId: R$8(), - eventData: V$8({ resumeAt: K$8() }) -}); -const Gm$1 = J$7.extend({ - eventType: U$8(`wait_completed`), - correlationId: R$8(), - eventData: V$8({ resumeAt: K$8().optional() }).optional() -}); -const Km$1 = $f$1(`type`, [V$8({ type: U$8(`workflow`) }), V$8({ - type: U$8(`step`), - stepId: R$8(), - attempt: B$9() -})]); -const qm$1 = J$7.extend({ - eventType: U$8(`attr_set`), - correlationId: R$8().optional(), - eventData: V$8({ - changes: Tm$1, - writer: Km$1, - allowReservedAttributes: U$8(!0).optional() - }) -}); -const Jm$1 = J$7.extend({ - eventType: U$8(`run_created`), - eventData: V$8({ - deploymentId: R$8(), - workflowName: R$8(), - input: q$7, - executionContext: H$8(R$8(), Nf$1()).optional(), - attributes: H$8(R$8(), R$8()).optional(), - allowReservedAttributes: U$8(!0).optional() - }) -}); -const Ym$1 = J$7.extend({ - eventType: U$8(`run_started`), - eventData: V$8({ - input: q$7.optional(), - deploymentId: R$8().optional(), - workflowName: R$8().optional(), - executionContext: H$8(R$8(), Nf$1()).optional(), - attributes: H$8(R$8(), R$8()).optional(), - allowReservedAttributes: U$8(!0).optional() - }).optional() -}); -const Xm$1 = J$7.extend({ - eventType: U$8(`run_completed`), - eventData: V$8({ output: q$7.optional() }) -}); -const Zm$1 = J$7.extend({ - eventType: U$8(`run_failed`), - eventData: V$8({ - error: q$7, - errorCode: R$8().optional() - }) -}); -const Qm$1 = J$7.extend({ eventType: U$8(`run_cancelled`) }); -$f$1(`eventType`, [ - Jm$1, - Ym$1, - Xm$1, - Zm$1, - Qm$1, - qm$1, - zm$1, - Fm$1, - Im$1, - Lm$1, - Rm$1, - Bm$1, - Vm$1, - Hm$1, - Wm$1, - Gm$1 -]); -const $m$1 = $f$1(`eventType`, [ - Jm$1, - Ym$1, - Xm$1, - Zm$1, - Qm$1, - qm$1, - zm$1, - Fm$1, - Im$1, - Lm$1, - Rm$1, - Bm$1, - Vm$1, - Hm$1, - Um$1, - Wm$1, - Gm$1 -]).and(V$8({ - runId: R$8(), - eventId: R$8(), - createdAt: K$8(), - occurredAt: K$8().optional(), - specVersion: B$9().optional() -})); -const eh$1 = V$8({ - runId: R$8(), - hookId: R$8(), - token: R$8(), - ownerId: R$8(), - projectId: R$8(), - environment: R$8(), - metadata: q$7.optional(), - createdAt: K$8(), - specVersion: B$9().optional(), - isWebhook: bf$1().optional(), - isSystem: bf$1().optional() -}); -const th$1 = R$8().regex(/^__(?:[a-z][a-z0-9]*_)?wkf_(?:workflow|step)_$/, `Must match __wkf_{workflow|step}_ or __{namespace}_wkf_{workflow|step}_`); -const nh$1 = R$8().regex(/^__(?:[a-z][a-z0-9]*_)?wkf_(?:workflow|step)_.+$/, `Must be a valid queue name with a recognized prefix`); -const rh$1 = R$8().regex(/^[a-z][a-z0-9]*$/, `Must be lowercase alphanumeric, starting with a letter`); -function ih$1(e) { - return e ?? process.env.WORKFLOW_QUEUE_NAMESPACE ?? void 0; -} -function ah$1(e, t) { - return t === void 0 ? `__wkf_${e}_` : (rh$1.parse(t), `__${t}_wkf_${e}_`); -} -function oh$1(e) { - let t = e.match(/^(__(?:[a-z][a-z0-9]*_)?wkf_(workflow|step)_)(.+)$/); - if (!t) throw Error(`Invalid queue name: ${e}`); - return { - prefix: th$1.parse(t[1]), - kind: t[2], - id: t[3] - }; -} -const sh$1 = R$8().brand().describe(`A stored queue message ID`); -const ch$1 = H$8(R$8(), R$8()); -const lh$1 = V$8({ - input: Ff$1(), - deploymentId: R$8(), - workflowName: R$8(), - specVersion: B$9(), - executionContext: H$8(R$8(), Nf$1()).optional(), - attributes: H$8(R$8(), R$8()).optional(), - allowReservedAttributes: U$8(!0).optional() -}); -const uh$1 = V$8({ - runId: R$8(), - traceCarrier: ch$1.optional(), - requestedAt: K$8().optional(), - replayDivergence: V$8({ - eventId: R$8(), - count: B$9().int().positive() - }).optional(), - serverErrorRetryCount: B$9().int().optional(), - stepId: R$8().optional(), - stepName: R$8().optional(), - runInput: lh$1.optional() -}); -const dh$1 = V$8({ - workflowName: R$8(), - workflowRunId: R$8(), - workflowStartedAt: B$9(), - stepId: R$8(), - traceCarrier: ch$1.optional(), - requestedAt: K$8().optional() -}); -const fh$1 = V$8({ - __healthCheck: U$8(!0), - correlationId: R$8() -}); -const ph$1 = Yf$1([ - uh$1, - dh$1, - fh$1 -]); -async function mh$1(e, t, n) { - let r = 0; - for (let i of [`pending`, `running`]) { - let a, o = !0; - for (; o;) { - let s = await e.list({ - status: i, - resolveData: `none`, - pagination: { cursor: a } - }); - for (let e of s.data) try { - await t(`__wkf_workflow_${e.workflowName}`, { runId: e.runId }), r++; - } catch (t) { - console.warn(`[${n}] Failed to re-enqueue run ${e.runId}: ${t}`); - } - o = s.hasMore, a = s.cursor ?? void 0; - } - } - r > 0 && console.log(`[${n}] Re-enqueued ${r} active run(s) on startup`); -} -const hh$1 = fp$1([ - `pending`, - `running`, - `completed`, - `failed`, - `cancelled` -]); -const gh$1 = V$8({ - runId: R$8(), - status: hh$1, - deploymentId: R$8(), - workflowName: R$8(), - specVersion: B$9().optional(), - executionContext: H$8(R$8(), Nf$1()).optional(), - input: q$7.optional(), - output: q$7.optional(), - error: q$7.optional(), - errorCode: R$8().optional(), - attributes: H$8(R$8(), R$8()).default({}), - expiredAt: K$8().optional(), - startedAt: K$8().optional(), - completedAt: K$8().optional(), - createdAt: K$8(), - updatedAt: K$8() -}); -const _h$1 = $f$1(`status`, [ - gh$1.extend({ - status: fp$1([`pending`, `running`]), - output: kf$1().optional(), - error: kf$1().optional(), - completedAt: kf$1().optional() - }), - gh$1.extend({ - status: U$8(`cancelled`), - output: kf$1().optional(), - error: kf$1().optional(), - completedAt: K$8() - }), - gh$1.extend({ - status: U$8(`completed`), - output: q$7, - error: kf$1().optional(), - completedAt: K$8() - }), - gh$1.extend({ - status: U$8(`failed`), - output: kf$1().optional(), - error: q$7, - completedAt: K$8() - }) -]); -const vh$1 = qp$1(() => Yf$1([ - R$8(), - B$9(), - bf$1(), - jf$1(), - Uf$1(vh$1), - H$8(R$8(), vh$1) -])); -const yh$1 = (e) => V$8({ - data: Uf$1(e), - cursor: R$8().nullable(), - hasMore: bf$1() -}); -V$8({ - message: R$8(), - stack: R$8().optional(), - code: R$8().optional() -}); -function bh$1(e) { - return e == null || e <= 1; -} -function xh$1(e) { - return e == null ? !1 : e > 5; -} -const Sh$1 = fp$1([ - `pending`, - `running`, - `completed`, - `failed`, - `cancelled` -]); -const Ch$1 = V$8({ - runId: R$8(), - stepId: R$8(), - stepName: R$8(), - status: Sh$1, - input: q$7.optional(), - output: q$7.optional(), - error: q$7.optional(), - attempt: B$9(), - startedAt: K$8().optional(), - completedAt: K$8().optional(), - createdAt: K$8(), - updatedAt: K$8(), - retryAfter: K$8().optional(), - specVersion: B$9().optional() -}); -const wh$1 = `0123456789ABCDEFGHJKMNPQRSTVWXYZ`; -var Th$1; -(function(e) { - e.Base32IncorrectEncoding = `B32_ENC_INVALID`, e.DecodeTimeInvalidCharacter = `DEC_TIME_CHAR`, e.DecodeTimeValueMalformed = `DEC_TIME_MALFORMED`, e.EncodeTimeNegative = `ENC_TIME_NEG`, e.EncodeTimeSizeExceeded = `ENC_TIME_SIZE_EXCEED`, e.EncodeTimeValueMalformed = `ENC_TIME_MALFORMED`, e.PRNGDetectFailure = `PRNG_DETECT`, e.ULIDInvalid = `ULID_INVALID`, e.Unexpected = `UNEXPECTED`, e.UUIDInvalid = `UUID_INVALID`; -})(Th$1 ||= {}); -var Eh$1 = class extends Error { - constructor(e, t) { - super(`${t} (${e})`), this.name = `ULIDError`, this.code = e; - } -}; -function Dh$1(e) { - let t = Math.floor(e() * 32) % 32; - return wh$1.charAt(t); -} -function Oh$1(e, t, n) { - return t > e.length - 1 ? e : e.substr(0, t) + n + e.substr(t + 1); -} -function kh$1(e) { - let t, n = e.length, r, i, a = e; - for (; !t && n-- >= 0;) { - if (r = a[n], i = wh$1.indexOf(r), i === -1) throw new Eh$1(Th$1.Base32IncorrectEncoding, `Incorrectly encoded string`); - if (i === 31) { - a = Oh$1(a, n, wh$1[0]); - continue; - } - t = Oh$1(a, n, wh$1[i + 1]); - } - if (typeof t == `string`) return t; - throw new Eh$1(Th$1.Base32IncorrectEncoding, `Failed incrementing string`); -} -function Ah$1(e) { - if (e.length !== 26) throw new Eh$1(Th$1.DecodeTimeValueMalformed, `Malformed ULID`); - let t = e.substr(0, 10).toUpperCase().split(``).reverse().reduce((e, t, n) => { - let r = wh$1.indexOf(t); - if (r === -1) throw new Eh$1(Th$1.DecodeTimeInvalidCharacter, `Time decode error: Invalid character: ${t}`); - return e += r * 32 ** n; - }, 0); - if (t > 0xffffffffffff) throw new Eh$1(Th$1.DecodeTimeValueMalformed, `Malformed ULID: timestamp too large: ${t}`); - return t; -} -function jh$1(e) { - let t = Mh$1(), n = t && (t.crypto || t.msCrypto) || (ee === void 0 ? null : ee); - if (typeof n?.getRandomValues == `function`) return () => { - let e = /* @__PURE__ */ new Uint8Array(1); - return n.getRandomValues(e), e[0] / 256; - }; - if (typeof n?.randomBytes == `function`) return () => n.randomBytes(1).readUInt8() / 256; - if (ee?.randomBytes) return () => ee.randomBytes(1).readUInt8() / 256; - throw new Eh$1(Th$1.PRNGDetectFailure, `Failed to find a reliable PRNG`); -} -function Mh$1() { - return Fh$1() ? self : typeof window < `u` ? window : typeof global < `u` ? global : typeof globalThis < `u` ? globalThis : null; -} -function Nh$1(e, t) { - let n = ``; - for (; e > 0; e--) n = Dh$1(t) + n; - return n; -} -function Ph$1(e, t = 10) { - if (isNaN(e)) throw new Eh$1(Th$1.EncodeTimeValueMalformed, `Time must be a number: ${e}`); - if (e > 0xffffffffffff) throw new Eh$1(Th$1.EncodeTimeSizeExceeded, `Cannot encode a time larger than 281474976710655: ${e}`); - if (e < 0) throw new Eh$1(Th$1.EncodeTimeNegative, `Time must be positive: ${e}`); - if (Number.isInteger(e) === !1) throw new Eh$1(Th$1.EncodeTimeValueMalformed, `Time must be an integer: ${e}`); - let n, r = ``; - for (let i = t; i > 0; i--) n = e % 32, r = wh$1.charAt(n) + r, e = (e - n) / 32; - return r; -} -function Fh$1() { - return typeof WorkerGlobalScope < `u` && self instanceof WorkerGlobalScope; -} -function Ih$1(e) { - let t = e || jh$1(), n = 0, r; - return function(e) { - let i = !e || isNaN(e) ? Date.now() : e; - if (i <= n) { - let e = r = kh$1(r); - return Ph$1(n, 10) + e; - } - n = i; - let a = r = Nh$1(16, t); - return Ph$1(i, 10) + a; - }; -} -const Lh$1 = R$8().ulid(); -const Rh$1 = 1440 * 60 * 1e3; -const zh$1 = 300 * 1e3; -function Bh$1(e) { - let t = Lh$1.safeParse(e); - return t.success ? new Date(Ah$1(t.data)) : null; -} -function Vh$1(e, t, n = Rh$1, r = zh$1) { - let i = Bh$1(e.startsWith(t) ? e.slice(t.length) : e); - if (!i) return `Invalid runId: "${e}" is not a valid ULID`; - let a = (/* @__PURE__ */ new Date()).getTime() - i.getTime(); - return a > 0 && a <= n || a <= 0 && -a <= r ? null : `Invalid runId timestamp: embedded timestamp is ${Math.round(Math.abs(a) / 1e3)}s in the ${a > 0 ? `past` : `future`} (threshold: ${Math.round((a > 0 ? n : r) / 1e3)}s)`; -} -const Hh$1 = fp$1([`waiting`, `completed`]); -const Uh$1 = V$8({ - waitId: R$8(), - runId: R$8(), - status: Hh$1, - resumeAt: K$8().optional(), - completedAt: K$8().optional(), - createdAt: K$8(), - updatedAt: K$8(), - specVersion: B$9().optional() -}); -var Wh$1 = l$11({ - ATTRIBUTE_KEY_MAX_LENGTH: () => 256, - ATTRIBUTE_MAX_PER_RUN: () => 64, - ATTRIBUTE_VALUE_MAX_BYTES: () => 256, - DEFAULT_TIMESTAMP_THRESHOLD_FUTURE_MS: () => zh$1, - DEFAULT_TIMESTAMP_THRESHOLD_MS: () => DEFAULT_TIMESTAMP_THRESHOLD_MS, - DEFAULT_TIMESTAMP_THRESHOLD_PAST_MS: () => Rh$1, - HookSchema: () => eh$1, - RESERVED_ATTRIBUTE_KEY_PREFIX: () => `$`, - SPEC_VERSION_CURRENT: () => 5, - SPEC_VERSION_LEGACY: () => 1, - SPEC_VERSION_SUPPORTS_ATTRIBUTES: () => 4, - SPEC_VERSION_SUPPORTS_CBOR_QUEUE_TRANSPORT: () => 3, - SPEC_VERSION_SUPPORTS_COMPRESSION: () => 5, - SPEC_VERSION_SUPPORTS_EVENT_SOURCING: () => 2 -}); -var Gh$1 = c$12(((e, t) => { - t.exports = { - MAX_LENGTH: 256, - MAX_SAFE_COMPONENT_LENGTH: 16, - MAX_SAFE_BUILD_LENGTH: 250, - MAX_SAFE_INTEGER: 2 ** 53 - 1 || 9007199254740991, - RELEASE_TYPES: [ - `major`, - `premajor`, - `minor`, - `preminor`, - `patch`, - `prepatch`, - `prerelease` - ], - SEMVER_SPEC_VERSION: `2.0.0`, - FLAG_INCLUDE_PRERELEASE: 1, - FLAG_LOOSE: 2 - }; -})); -var Kh$1 = c$12(((e, t) => { - t.exports = typeof process == `object` && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...e) => console.error(`SEMVER`, ...e) : () => {}; -})); -var qh$1 = c$12(((e, t) => { - let { MAX_SAFE_COMPONENT_LENGTH: n, MAX_SAFE_BUILD_LENGTH: r, MAX_LENGTH: i } = Gh$1(), a = Kh$1(); - e = t.exports = {}; - let o = e.re = [], s = e.safeRe = [], c = e.src = [], l = e.safeSrc = [], u = e.t = {}, d = 0, f = `[a-zA-Z0-9-]`, p = [ - [`\\s`, 1], - [`\\d`, i], - [f, r] - ], m = (e) => { - for (let [t, n] of p) e = e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`); - return e; - }, h = (e, t, n) => { - let r = m(t), i = d++; - a(e, i, t), u[e] = i, c[i] = t, l[i] = r, o[i] = new RegExp(t, n ? `g` : void 0), s[i] = new RegExp(r, n ? `g` : void 0); - }; - h(`NUMERICIDENTIFIER`, `0|[1-9]\\d*`), h(`NUMERICIDENTIFIERLOOSE`, `\\d+`), h(`NONNUMERICIDENTIFIER`, `\\d*[a-zA-Z-]${f}*`), h(`MAINVERSION`, `(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`), h(`MAINVERSIONLOOSE`, `(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`), h(`PRERELEASEIDENTIFIER`, `(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIER]})`), h(`PRERELEASEIDENTIFIERLOOSE`, `(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIERLOOSE]})`), h(`PRERELEASE`, `(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`), h(`PRERELEASELOOSE`, `(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`), h(`BUILDIDENTIFIER`, `${f}+`), h(`BUILD`, `(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`), h(`FULLPLAIN`, `v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`), h(`FULL`, `^${c[u.FULLPLAIN]}$`), h(`LOOSEPLAIN`, `[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`), h(`LOOSE`, `^${c[u.LOOSEPLAIN]}$`), h(`GTLT`, `((?:<|>)?=?)`), h(`XRANGEIDENTIFIERLOOSE`, `${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`), h(`XRANGEIDENTIFIER`, `${c[u.NUMERICIDENTIFIER]}|x|X|\\*`), h(`XRANGEPLAIN`, `[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`), h(`XRANGEPLAINLOOSE`, `[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`), h(`XRANGE`, `^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`), h(`XRANGELOOSE`, `^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`), h(`COERCEPLAIN`, `(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`), h(`COERCE`, `${c[u.COERCEPLAIN]}(?:$|[^\\d])`), h(`COERCEFULL`, c[u.COERCEPLAIN] + `(?:${c[u.PRERELEASE]})?(?:${c[u.BUILD]})?(?:$|[^\\d])`), h(`COERCERTL`, c[u.COERCE], !0), h(`COERCERTLFULL`, c[u.COERCEFULL], !0), h(`LONETILDE`, `(?:~>?)`), h(`TILDETRIM`, `(\\s*)${c[u.LONETILDE]}\\s+`, !0), e.tildeTrimReplace = `$1~`, h(`TILDE`, `^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`), h(`TILDELOOSE`, `^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`), h(`LONECARET`, `(?:\\^)`), h(`CARETTRIM`, `(\\s*)${c[u.LONECARET]}\\s+`, !0), e.caretTrimReplace = `$1^`, h(`CARET`, `^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`), h(`CARETLOOSE`, `^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`), h(`COMPARATORLOOSE`, `^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`), h(`COMPARATOR`, `^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`), h(`COMPARATORTRIM`, `(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`, !0), e.comparatorTrimReplace = `$1$2$3`, h(`HYPHENRANGE`, `^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`), h(`HYPHENRANGELOOSE`, `^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`), h(`STAR`, `(<|>)?=?\\s*\\*`), h(`GTE0`, `^\\s*>=\\s*0\\.0\\.0\\s*$`), h(`GTE0PRE`, `^\\s*>=\\s*0\\.0\\.0-0\\s*$`); -})); -var Jh$1 = c$12(((e, t) => { - let n = Object.freeze({ loose: !0 }), r = Object.freeze({}); - t.exports = (e) => e ? typeof e == `object` ? e : n : r; -})); -var Yh$1 = c$12(((e, t) => { - let n = /^[0-9]+$/, r = (e, t) => { - if (typeof e == `number` && typeof t == `number`) return e === t ? 0 : e < t ? -1 : 1; - let r = n.test(e), i = n.test(t); - return r && i && (e = +e, t = +t), e === t ? 0 : r && !i ? -1 : i && !r ? 1 : e < t ? -1 : 1; - }; - t.exports = { - compareIdentifiers: r, - rcompareIdentifiers: (e, t) => r(t, e) - }; -})); -var Y$10 = c$12(((e, t) => { - let n = Kh$1(), { MAX_LENGTH: r, MAX_SAFE_INTEGER: i } = Gh$1(), { safeRe: a, t: o } = qh$1(), s = Jh$1(), { compareIdentifiers: c } = Yh$1(); - t.exports = class e { - constructor(t, c) { - if (c = s(c), t instanceof e) { - if (t.loose === !!c.loose && t.includePrerelease === !!c.includePrerelease) return t; - t = t.version; - } else if (typeof t != `string`) throw TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`); - if (t.length > r) throw TypeError(`version is longer than ${r} characters`); - n(`SemVer`, t, c), this.options = c, this.loose = !!c.loose, this.includePrerelease = !!c.includePrerelease; - let l = t.trim().match(c.loose ? a[o.LOOSE] : a[o.FULL]); - if (!l) throw TypeError(`Invalid Version: ${t}`); - if (this.raw = t, this.major = +l[1], this.minor = +l[2], this.patch = +l[3], this.major > i || this.major < 0) throw TypeError(`Invalid major version`); - if (this.minor > i || this.minor < 0) throw TypeError(`Invalid minor version`); - if (this.patch > i || this.patch < 0) throw TypeError(`Invalid patch version`); - l[4] ? this.prerelease = l[4].split(`.`).map((e) => { - if (/^[0-9]+$/.test(e)) { - let t = +e; - if (t >= 0 && t < i) return t; - } - return e; - }) : this.prerelease = [], this.build = l[5] ? l[5].split(`.`) : [], this.format(); - } - format() { - return this.version = `${this.major}.${this.minor}.${this.patch}`, this.prerelease.length && (this.version += `-${this.prerelease.join(`.`)}`), this.version; - } - toString() { - return this.version; - } - compare(t) { - if (n(`SemVer.compare`, this.version, this.options, t), !(t instanceof e)) { - if (typeof t == `string` && t === this.version) return 0; - t = new e(t, this.options); - } - return t.version === this.version ? 0 : this.compareMain(t) || this.comparePre(t); - } - compareMain(t) { - return t instanceof e || (t = new e(t, this.options)), this.major < t.major ? -1 : this.major > t.major ? 1 : this.minor < t.minor ? -1 : this.minor > t.minor ? 1 : this.patch < t.patch ? -1 : +(this.patch > t.patch); - } - comparePre(t) { - if (t instanceof e || (t = new e(t, this.options)), this.prerelease.length && !t.prerelease.length) return -1; - if (!this.prerelease.length && t.prerelease.length) return 1; - if (!this.prerelease.length && !t.prerelease.length) return 0; - let r = 0; - do { - let e = this.prerelease[r], i = t.prerelease[r]; - if (n(`prerelease compare`, r, e, i), e === void 0 && i === void 0) return 0; - if (i === void 0) return 1; - if (e === void 0) return -1; - if (e === i) continue; - return c(e, i); - } while (++r); - } - compareBuild(t) { - t instanceof e || (t = new e(t, this.options)); - let r = 0; - do { - let e = this.build[r], i = t.build[r]; - if (n(`build compare`, r, e, i), e === void 0 && i === void 0) return 0; - if (i === void 0) return 1; - if (e === void 0) return -1; - if (e === i) continue; - return c(e, i); - } while (++r); - } - inc(e, t, n) { - if (e.startsWith(`pre`)) { - if (!t && n === !1) throw Error(`invalid increment argument: identifier is empty`); - if (t) { - let e = `-${t}`.match(this.options.loose ? a[o.PRERELEASELOOSE] : a[o.PRERELEASE]); - if (!e || e[1] !== t) throw Error(`invalid identifier: ${t}`); - } - } - switch (e) { - case `premajor`: - this.prerelease.length = 0, this.patch = 0, this.minor = 0, this.major++, this.inc(`pre`, t, n); - break; - case `preminor`: - this.prerelease.length = 0, this.patch = 0, this.minor++, this.inc(`pre`, t, n); - break; - case `prepatch`: - this.prerelease.length = 0, this.inc(`patch`, t, n), this.inc(`pre`, t, n); - break; - case `prerelease`: - this.prerelease.length === 0 && this.inc(`patch`, t, n), this.inc(`pre`, t, n); - break; - case `release`: - if (this.prerelease.length === 0) throw Error(`version ${this.raw} is not a prerelease`); - this.prerelease.length = 0; - break; - case `major`: - (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) && this.major++, this.minor = 0, this.patch = 0, this.prerelease = []; - break; - case `minor`: - (this.patch !== 0 || this.prerelease.length === 0) && this.minor++, this.patch = 0, this.prerelease = []; - break; - case `patch`: - this.prerelease.length === 0 && this.patch++, this.prerelease = []; - break; - case `pre`: { - let e = +!!Number(n); - if (this.prerelease.length === 0) this.prerelease = [e]; - else { - let r = this.prerelease.length; - for (; --r >= 0;) typeof this.prerelease[r] == `number` && (this.prerelease[r]++, r = -2); - if (r === -1) { - if (t === this.prerelease.join(`.`) && n === !1) throw Error(`invalid increment argument: identifier already exists`); - this.prerelease.push(e); - } - } - if (t) { - let r = [t, e]; - n === !1 && (r = [t]), c(this.prerelease[0], t) === 0 ? isNaN(this.prerelease[1]) && (this.prerelease = r) : this.prerelease = r; - } - break; - } - default: throw Error(`invalid increment argument: ${e}`); - } - return this.raw = this.format(), this.build.length && (this.raw += `+${this.build.join(`.`)}`), this; - } - }; -})); -var Xh$1 = c$12(((e, t) => { - let n = Y$10(); - t.exports = (e, t, r = !1) => { - if (e instanceof n) return e; - try { - return new n(e, t); - } catch (e) { - if (!r) return null; - throw e; - } - }; -})); -var Zh$1 = c$12(((e, t) => { - let n = Xh$1(); - t.exports = (e, t) => { - let r = n(e, t); - return r ? r.version : null; - }; -})); -var Qh$1 = c$12(((e, t) => { - let n = Xh$1(); - t.exports = (e, t) => { - let r = n(e.trim().replace(/^[=v]+/, ``), t); - return r ? r.version : null; - }; -})); -var $h$1 = c$12(((e, t) => { - let n = Y$10(); - t.exports = (e, t, r, i, a) => { - typeof r == `string` && (a = i, i = r, r = void 0); - try { - return new n(e instanceof n ? e.version : e, r).inc(t, i, a).version; - } catch { - return null; - } - }; -})); -var eg$1 = c$12(((e, t) => { - let n = Xh$1(); - t.exports = (e, t) => { - let r = n(e, null, !0), i = n(t, null, !0), a = r.compare(i); - if (a === 0) return null; - let o = a > 0, s = o ? r : i, c = o ? i : r, l = !!s.prerelease.length; - if (c.prerelease.length && !l) { - if (!c.patch && !c.minor) return `major`; - if (c.compareMain(s) === 0) return c.minor && !c.patch ? `minor` : `patch`; - } - let u = l ? `pre` : ``; - return r.major === i.major ? r.minor === i.minor ? r.patch === i.patch ? `prerelease` : u + `patch` : u + `minor` : u + `major`; - }; -})); -var tg$1 = c$12(((e, t) => { - let n = Y$10(); - t.exports = (e, t) => new n(e, t).major; -})); -var ng$1 = c$12(((e, t) => { - let n = Y$10(); - t.exports = (e, t) => new n(e, t).minor; -})); -var rg$1 = c$12(((e, t) => { - let n = Y$10(); - t.exports = (e, t) => new n(e, t).patch; -})); -var ig$1 = c$12(((e, t) => { - let n = Xh$1(); - t.exports = (e, t) => { - let r = n(e, t); - return r && r.prerelease.length ? r.prerelease : null; - }; -})); -var ag$1 = c$12(((e, t) => { - let n = Y$10(); - t.exports = (e, t, r) => new n(e, r).compare(new n(t, r)); -})); -var og$1 = c$12(((e, t) => { - let n = ag$1(); - t.exports = (e, t, r) => n(t, e, r); -})); -var sg$1 = c$12(((e, t) => { - let n = ag$1(); - t.exports = (e, t) => n(e, t, !0); -})); -var cg$1 = c$12(((e, t) => { - let n = Y$10(); - t.exports = (e, t, r) => { - let i = new n(e, r), a = new n(t, r); - return i.compare(a) || i.compareBuild(a); - }; -})); -var lg$1 = c$12(((e, t) => { - let n = cg$1(); - t.exports = (e, t) => e.sort((e, r) => n(e, r, t)); -})); -var ug$1 = c$12(((e, t) => { - let n = cg$1(); - t.exports = (e, t) => e.sort((e, r) => n(r, e, t)); -})); -var dg$1 = c$12(((e, t) => { - let n = ag$1(); - t.exports = (e, t, r) => n(e, t, r) > 0; -})); -var fg$1 = c$12(((e, t) => { - let n = ag$1(); - t.exports = (e, t, r) => n(e, t, r) < 0; -})); -var pg$1 = c$12(((e, t) => { - let n = ag$1(); - t.exports = (e, t, r) => n(e, t, r) === 0; -})); -var mg$1 = c$12(((e, t) => { - let n = ag$1(); - t.exports = (e, t, r) => n(e, t, r) !== 0; -})); -var hg = c$12(((e, t) => { - let n = ag$1(); - t.exports = (e, t, r) => n(e, t, r) >= 0; -})); -var gg$1 = c$12(((e, t) => { - let n = ag$1(); - t.exports = (e, t, r) => n(e, t, r) <= 0; -})); -var _g$1 = c$12(((e, t) => { - let n = pg$1(), r = mg$1(), i = dg$1(), a = hg(), o = fg$1(), s = gg$1(); - t.exports = (e, t, c, l) => { - switch (t) { - case `===`: return typeof e == `object` && (e = e.version), typeof c == `object` && (c = c.version), e === c; - case `!==`: return typeof e == `object` && (e = e.version), typeof c == `object` && (c = c.version), e !== c; - case ``: - case `=`: - case `==`: return n(e, c, l); - case `!=`: return r(e, c, l); - case `>`: return i(e, c, l); - case `>=`: return a(e, c, l); - case `<`: return o(e, c, l); - case `<=`: return s(e, c, l); - default: throw TypeError(`Invalid operator: ${t}`); - } - }; -})); -var vg$1 = c$12(((e, t) => { - let n = Y$10(), r = Xh$1(), { safeRe: i, t: a } = qh$1(); - t.exports = (e, t) => { - if (e instanceof n) return e; - if (typeof e == `number` && (e = String(e)), typeof e != `string`) return null; - t ||= {}; - let o = null; - if (!t.rtl) o = e.match(t.includePrerelease ? i[a.COERCEFULL] : i[a.COERCE]); - else { - let n = t.includePrerelease ? i[a.COERCERTLFULL] : i[a.COERCERTL], r; - for (; (r = n.exec(e)) && (!o || o.index + o[0].length !== e.length);) (!o || r.index + r[0].length !== o.index + o[0].length) && (o = r), n.lastIndex = r.index + r[1].length + r[2].length; - n.lastIndex = -1; - } - if (o === null) return null; - let s = o[2]; - return r(`${s}.${o[3] || `0`}.${o[4] || `0`}${t.includePrerelease && o[5] ? `-${o[5]}` : ``}${t.includePrerelease && o[6] ? `+${o[6]}` : ``}`, t); - }; -})); -var yg$1 = c$12(((e, t) => { - t.exports = class { - constructor() { - this.max = 1e3, this.map = /* @__PURE__ */ new Map(); - } - get(e) { - let t = this.map.get(e); - if (t !== void 0) return this.map.delete(e), this.map.set(e, t), t; - } - delete(e) { - return this.map.delete(e); - } - set(e, t) { - if (!this.delete(e) && t !== void 0) { - if (this.map.size >= this.max) { - let e = this.map.keys().next().value; - this.delete(e); - } - this.map.set(e, t); - } - return this; - } - }; -})); -var bg$1 = c$12(((e, t) => { - let n = /\s+/g; - t.exports = class e { - constructor(t, r) { - if (r = i(r), t instanceof e) return t.loose === !!r.loose && t.includePrerelease === !!r.includePrerelease ? t : new e(t.raw, r); - if (t instanceof a) return this.raw = t.value, this.set = [[t]], this.formatted = void 0, this; - if (this.options = r, this.loose = !!r.loose, this.includePrerelease = !!r.includePrerelease, this.raw = t.trim().replace(n, ` `), this.set = this.raw.split(`||`).map((e) => this.parseRange(e.trim())).filter((e) => e.length), !this.set.length) throw TypeError(`Invalid SemVer Range: ${this.raw}`); - if (this.set.length > 1) { - let e = this.set[0]; - if (this.set = this.set.filter((e) => !h(e[0])), this.set.length === 0) this.set = [e]; - else if (this.set.length > 1) { - for (let e of this.set) if (e.length === 1 && g(e[0])) { - this.set = [e]; - break; - } - } - } - this.formatted = void 0; - } - get range() { - if (this.formatted === void 0) { - this.formatted = ``; - for (let e = 0; e < this.set.length; e++) { - e > 0 && (this.formatted += `||`); - let t = this.set[e]; - for (let e = 0; e < t.length; e++) e > 0 && (this.formatted += ` `), this.formatted += t[e].toString().trim(); - } - } - return this.formatted; - } - format() { - return this.range; - } - toString() { - return this.range; - } - parseRange(e) { - let t = ((this.options.includePrerelease && p) | (this.options.loose && m)) + `:` + e, n = r.get(t); - if (n) return n; - let i = this.options.loose, s = i ? c[l.HYPHENRANGELOOSE] : c[l.HYPHENRANGE]; - e = e.replace(s, se(this.options.includePrerelease)), o(`hyphen replace`, e), e = e.replace(c[l.COMPARATORTRIM], u), o(`comparator trim`, e), e = e.replace(c[l.TILDETRIM], d), o(`tilde trim`, e), e = e.replace(c[l.CARETTRIM], f), o(`caret trim`, e); - let g = e.split(` `).map((e) => v(e, this.options)).join(` `).split(/\s+/).map((e) => oe(e, this.options)); - i && (g = g.filter((e) => (o(`loose invalid filter`, e, this.options), !!e.match(c[l.COMPARATORLOOSE])))), o(`range list`, g); - let _ = /* @__PURE__ */ new Map(), y = g.map((e) => new a(e, this.options)); - for (let e of y) { - if (h(e)) return [e]; - _.set(e.value, e); - } - _.size > 1 && _.has(``) && _.delete(``); - let ee = [..._.values()]; - return r.set(t, ee), ee; - } - intersects(t, n) { - if (!(t instanceof e)) throw TypeError(`a Range is required`); - return this.set.some((e) => _(e, n) && t.set.some((t) => _(t, n) && e.every((e) => t.every((t) => e.intersects(t, n))))); - } - test(e) { - if (!e) return !1; - if (typeof e == `string`) try { - e = new s(e, this.options); - } catch { - return !1; - } - for (let t = 0; t < this.set.length; t++) if (ce(this.set[t], e, this.options)) return !0; - return !1; - } - }; - let r = new (yg$1())(), i = Jh$1(), a = xg$1(), o = Kh$1(), s = Y$10(), { safeRe: c, t: l, comparatorTrimReplace: u, tildeTrimReplace: d, caretTrimReplace: f } = qh$1(), { FLAG_INCLUDE_PRERELEASE: p, FLAG_LOOSE: m } = Gh$1(), h = (e) => e.value === `<0.0.0-0`, g = (e) => e.value === ``, _ = (e, t) => { - let n = !0, r = e.slice(), i = r.pop(); - for (; n && r.length;) n = r.every((e) => i.intersects(e, t)), i = r.pop(); - return n; - }, v = (e, t) => (e = e.replace(c[l.BUILD], ``), o(`comp`, e, t), e = ne(e, t), o(`caret`, e), e = ee(e, t), o(`tildes`, e), e = ie(e, t), o(`xrange`, e), e = b(e, t), o(`stars`, e), e), y = (e) => !e || e.toLowerCase() === `x` || e === `*`, ee = (e, t) => e.trim().split(/\s+/).map((e) => te(e, t)).join(` `), te = (e, t) => { - let n = t.loose ? c[l.TILDELOOSE] : c[l.TILDE]; - return e.replace(n, (t, n, r, i, a) => { - o(`tilde`, e, t, n, r, i, a); - let s; - return y(n) ? s = `` : y(r) ? s = `>=${n}.0.0 <${+n + 1}.0.0-0` : y(i) ? s = `>=${n}.${r}.0 <${n}.${+r + 1}.0-0` : a ? (o(`replaceTilde pr`, a), s = `>=${n}.${r}.${i}-${a} <${n}.${+r + 1}.0-0`) : s = `>=${n}.${r}.${i} <${n}.${+r + 1}.0-0`, o(`tilde return`, s), s; - }); - }, ne = (e, t) => e.trim().split(/\s+/).map((e) => re(e, t)).join(` `), re = (e, t) => { - o(`caret`, e, t); - let n = t.loose ? c[l.CARETLOOSE] : c[l.CARET], r = t.includePrerelease ? `-0` : ``; - return e.replace(n, (t, n, i, a, s) => { - o(`caret`, e, t, n, i, a, s); - let c; - return y(n) ? c = `` : y(i) ? c = `>=${n}.0.0${r} <${+n + 1}.0.0-0` : y(a) ? c = n === `0` ? `>=${n}.${i}.0${r} <${n}.${+i + 1}.0-0` : `>=${n}.${i}.0${r} <${+n + 1}.0.0-0` : s ? (o(`replaceCaret pr`, s), c = n === `0` ? i === `0` ? `>=${n}.${i}.${a}-${s} <${n}.${i}.${+a + 1}-0` : `>=${n}.${i}.${a}-${s} <${n}.${+i + 1}.0-0` : `>=${n}.${i}.${a}-${s} <${+n + 1}.0.0-0`) : (o(`no pr`), c = n === `0` ? i === `0` ? `>=${n}.${i}.${a}${r} <${n}.${i}.${+a + 1}-0` : `>=${n}.${i}.${a}${r} <${n}.${+i + 1}.0-0` : `>=${n}.${i}.${a} <${+n + 1}.0.0-0`), o(`caret return`, c), c; - }); - }, ie = (e, t) => (o(`replaceXRanges`, e, t), e.split(/\s+/).map((e) => ae(e, t)).join(` `)), ae = (e, t) => { - e = e.trim(); - let n = t.loose ? c[l.XRANGELOOSE] : c[l.XRANGE]; - return e.replace(n, (n, r, i, a, s, c) => { - o(`xRange`, e, n, r, i, a, s, c); - let l = y(i), u = l || y(a), d = u || y(s), f = d; - return r === `=` && f && (r = ``), c = t.includePrerelease ? `-0` : ``, l ? n = r === `>` || r === `<` ? `<0.0.0-0` : `*` : r && f ? (u && (a = 0), s = 0, r === `>` ? (r = `>=`, u ? (i = +i + 1, a = 0, s = 0) : (a = +a + 1, s = 0)) : r === `<=` && (r = `<`, u ? i = +i + 1 : a = +a + 1), r === `<` && (c = `-0`), n = `${r + i}.${a}.${s}${c}`) : u ? n = `>=${i}.0.0${c} <${+i + 1}.0.0-0` : d && (n = `>=${i}.${a}.0${c} <${i}.${+a + 1}.0-0`), o(`xRange return`, n), n; - }); - }, b = (e, t) => (o(`replaceStars`, e, t), e.trim().replace(c[l.STAR], ``)), oe = (e, t) => (o(`replaceGTE0`, e, t), e.trim().replace(c[t.includePrerelease ? l.GTE0PRE : l.GTE0], ``)), se = (e) => (t, n, r, i, a, o, s, c, l, u, d, f) => (n = y(r) ? `` : y(i) ? `>=${r}.0.0${e ? `-0` : ``}` : y(a) ? `>=${r}.${i}.0${e ? `-0` : ``}` : o ? `>=${n}` : `>=${n}${e ? `-0` : ``}`, c = y(l) ? `` : y(u) ? `<${+l + 1}.0.0-0` : y(d) ? `<${l}.${+u + 1}.0-0` : f ? `<=${l}.${u}.${d}-${f}` : e ? `<${l}.${u}.${+d + 1}-0` : `<=${c}`, `${n} ${c}`.trim()), ce = (e, t, n) => { - for (let n = 0; n < e.length; n++) if (!e[n].test(t)) return !1; - if (t.prerelease.length && !n.includePrerelease) { - for (let n = 0; n < e.length; n++) if (o(e[n].semver), e[n].semver !== a.ANY && e[n].semver.prerelease.length > 0) { - let r = e[n].semver; - if (r.major === t.major && r.minor === t.minor && r.patch === t.patch) return !0; - } - return !1; - } - return !0; - }; -})); -var xg$1 = c$12(((e, t) => { - let n = Symbol(`SemVer ANY`); - t.exports = class e { - static get ANY() { - return n; - } - constructor(t, i) { - if (i = r(i), t instanceof e) { - if (t.loose === !!i.loose) return t; - t = t.value; - } - t = t.trim().split(/\s+/).join(` `), s(`comparator`, t, i), this.options = i, this.loose = !!i.loose, this.parse(t), this.semver === n ? this.value = `` : this.value = this.operator + this.semver.version, s(`comp`, this); - } - parse(e) { - let t = this.options.loose ? i[a.COMPARATORLOOSE] : i[a.COMPARATOR], r = e.match(t); - if (!r) throw TypeError(`Invalid comparator: ${e}`); - this.operator = r[1] === void 0 ? `` : r[1], this.operator === `=` && (this.operator = ``), r[2] ? this.semver = new c(r[2], this.options.loose) : this.semver = n; - } - toString() { - return this.value; - } - test(e) { - if (s(`Comparator.test`, e, this.options.loose), this.semver === n || e === n) return !0; - if (typeof e == `string`) try { - e = new c(e, this.options); - } catch { - return !1; - } - return o(e, this.operator, this.semver, this.options); - } - intersects(t, n) { - if (!(t instanceof e)) throw TypeError(`a Comparator is required`); - return this.operator === `` ? this.value === `` ? !0 : new l(t.value, n).test(this.value) : t.operator === `` ? t.value === `` ? !0 : new l(this.value, n).test(t.semver) : (n = r(n), n.includePrerelease && (this.value === `<0.0.0-0` || t.value === `<0.0.0-0`) || !n.includePrerelease && (this.value.startsWith(`<0.0.0`) || t.value.startsWith(`<0.0.0`)) ? !1 : !!(this.operator.startsWith(`>`) && t.operator.startsWith(`>`) || this.operator.startsWith(`<`) && t.operator.startsWith(`<`) || this.semver.version === t.semver.version && this.operator.includes(`=`) && t.operator.includes(`=`) || o(this.semver, `<`, t.semver, n) && this.operator.startsWith(`>`) && t.operator.startsWith(`<`) || o(this.semver, `>`, t.semver, n) && this.operator.startsWith(`<`) && t.operator.startsWith(`>`))); - } - }; - let r = Jh$1(), { safeRe: i, t: a } = qh$1(), o = _g$1(), s = Kh$1(), c = Y$10(), l = bg$1(); -})); -var Sg$1 = c$12(((e, t) => { - let n = bg$1(); - t.exports = (e, t, r) => { - try { - t = new n(t, r); - } catch { - return !1; - } - return t.test(e); - }; -})); -var Cg$1 = c$12(((e, t) => { - let n = bg$1(); - t.exports = (e, t) => new n(e, t).set.map((e) => e.map((e) => e.value).join(` `).trim().split(` `)); -})); -var wg$1 = c$12(((e, t) => { - let n = Y$10(), r = bg$1(); - t.exports = (e, t, i) => { - let a = null, o = null, s = null; - try { - s = new r(t, i); - } catch { - return null; - } - return e.forEach((e) => { - s.test(e) && (!a || o.compare(e) === -1) && (a = e, o = new n(a, i)); - }), a; - }; -})); -var Tg$1 = c$12(((e, t) => { - let n = Y$10(), r = bg$1(); - t.exports = (e, t, i) => { - let a = null, o = null, s = null; - try { - s = new r(t, i); - } catch { - return null; - } - return e.forEach((e) => { - s.test(e) && (!a || o.compare(e) === 1) && (a = e, o = new n(a, i)); - }), a; - }; -})); -var Eg$1 = c$12(((e, t) => { - let n = Y$10(), r = bg$1(), i = dg$1(); - t.exports = (e, t) => { - e = new r(e, t); - let a = new n(`0.0.0`); - if (e.test(a) || (a = new n(`0.0.0-0`), e.test(a))) return a; - a = null; - for (let t = 0; t < e.set.length; ++t) { - let r = e.set[t], o = null; - r.forEach((e) => { - let t = new n(e.semver.version); - switch (e.operator) { - case `>`: t.prerelease.length === 0 ? t.patch++ : t.prerelease.push(0), t.raw = t.format(); - case ``: - case `>=`: - (!o || i(t, o)) && (o = t); - break; - case `<`: - case `<=`: break; - default: throw Error(`Unexpected operation: ${e.operator}`); - } - }), o && (!a || i(a, o)) && (a = o); - } - return a && e.test(a) ? a : null; - }; -})); -var Dg$1 = c$12(((e, t) => { - let n = bg$1(); - t.exports = (e, t) => { - try { - return new n(e, t).range || `*`; - } catch { - return null; - } - }; -})); -var Og$1 = c$12(((e, t) => { - let n = Y$10(), r = xg$1(), { ANY: i } = r, a = bg$1(), o = Sg$1(), s = dg$1(), c = fg$1(), l = gg$1(), u = hg(); - t.exports = (e, t, d, f) => { - e = new n(e, f), t = new a(t, f); - let p, m, h, g, _; - switch (d) { - case `>`: - p = s, m = l, h = c, g = `>`, _ = `>=`; - break; - case `<`: - p = c, m = u, h = s, g = `<`, _ = `<=`; - break; - default: throw TypeError(`Must provide a hilo val of "<" or ">"`); - } - if (o(e, t, f)) return !1; - for (let n = 0; n < t.set.length; ++n) { - let a = t.set[n], o = null, s = null; - if (a.forEach((e) => { - e.semver === i && (e = new r(`>=0.0.0`)), o ||= e, s ||= e, p(e.semver, o.semver, f) ? o = e : h(e.semver, s.semver, f) && (s = e); - }), o.operator === g || o.operator === _ || (!s.operator || s.operator === g) && m(e, s.semver) || s.operator === _ && h(e, s.semver)) return !1; - } - return !0; - }; -})); -var kg$1 = c$12(((e, t) => { - let n = Og$1(); - t.exports = (e, t, r) => n(e, t, `>`, r); -})); -var Ag$1 = c$12(((e, t) => { - let n = Og$1(); - t.exports = (e, t, r) => n(e, t, `<`, r); -})); -var jg$1 = c$12(((e, t) => { - let n = bg$1(); - t.exports = (e, t, r) => (e = new n(e, r), t = new n(t, r), e.intersects(t, r)); -})); -var Mg$1 = c$12(((e, t) => { - let n = Sg$1(), r = ag$1(); - t.exports = (e, t, i) => { - let a = [], o = null, s = null, c = e.sort((e, t) => r(e, t, i)); - for (let e of c) n(e, t, i) ? (s = e, o ||= e) : (s && a.push([o, s]), s = null, o = null); - o && a.push([o, null]); - let l = []; - for (let [e, t] of a) e === t ? l.push(e) : !t && e === c[0] ? l.push(`*`) : t ? e === c[0] ? l.push(`<=${t}`) : l.push(`${e} - ${t}`) : l.push(`>=${e}`); - let u = l.join(` || `), d = typeof t.raw == `string` ? t.raw : String(t); - return u.length < d.length ? u : t; - }; -})); -var Ng$1 = c$12(((e, t) => { - let n = bg$1(), r = xg$1(), { ANY: i } = r, a = Sg$1(), o = ag$1(), s = (e, t, r = {}) => { - if (e === t) return !0; - e = new n(e, r), t = new n(t, r); - let i = !1; - OUTER: for (let n of e.set) { - for (let e of t.set) { - let t = u(n, e, r); - if (i ||= t !== null, t) continue OUTER; - } - if (i) return !1; - } - return !0; - }, c = [new r(`>=0.0.0-0`)], l = [new r(`>=0.0.0`)], u = (e, t, n) => { - if (e === t) return !0; - if (e.length === 1 && e[0].semver === i) { - if (t.length === 1 && t[0].semver === i) return !0; - e = n.includePrerelease ? c : l; - } - if (t.length === 1 && t[0].semver === i) { - if (n.includePrerelease) return !0; - t = l; - } - let r = /* @__PURE__ */ new Set(), s, u; - for (let t of e) t.operator === `>` || t.operator === `>=` ? s = d(s, t, n) : t.operator === `<` || t.operator === `<=` ? u = f(u, t, n) : r.add(t.semver); - if (r.size > 1) return null; - let p; - if (s && u && (p = o(s.semver, u.semver, n), p > 0 || p === 0 && (s.operator !== `>=` || u.operator !== `<=`))) return null; - for (let e of r) { - if (s && !a(e, String(s), n) || u && !a(e, String(u), n)) return null; - for (let r of t) if (!a(e, String(r), n)) return !1; - return !0; - } - let m, h, g, _, v = u && !n.includePrerelease && u.semver.prerelease.length ? u.semver : !1, y = s && !n.includePrerelease && s.semver.prerelease.length ? s.semver : !1; - v && v.prerelease.length === 1 && u.operator === `<` && v.prerelease[0] === 0 && (v = !1); - for (let e of t) { - if (_ = _ || e.operator === `>` || e.operator === `>=`, g = g || e.operator === `<` || e.operator === `<=`, s) { - if (y && e.semver.prerelease && e.semver.prerelease.length && e.semver.major === y.major && e.semver.minor === y.minor && e.semver.patch === y.patch && (y = !1), e.operator === `>` || e.operator === `>=`) { - if (m = d(s, e, n), m === e && m !== s) return !1; - } else if (s.operator === `>=` && !a(s.semver, String(e), n)) return !1; - } - if (u) { - if (v && e.semver.prerelease && e.semver.prerelease.length && e.semver.major === v.major && e.semver.minor === v.minor && e.semver.patch === v.patch && (v = !1), e.operator === `<` || e.operator === `<=`) { - if (h = f(u, e, n), h === e && h !== u) return !1; - } else if (u.operator === `<=` && !a(u.semver, String(e), n)) return !1; - } - if (!e.operator && (u || s) && p !== 0) return !1; - } - return !(s && g && !u && p !== 0 || u && _ && !s && p !== 0 || y || v); - }, d = (e, t, n) => { - if (!e) return t; - let r = o(e.semver, t.semver, n); - return r > 0 ? e : r < 0 || t.operator === `>` && e.operator === `>=` ? t : e; - }, f = (e, t, n) => { - if (!e) return t; - let r = o(e.semver, t.semver, n); - return r < 0 ? e : r > 0 || t.operator === `<` && e.operator === `<=` ? t : e; - }; - t.exports = s; -})); -var Pg$1 = c$12(((e, t) => { - let n = qh$1(), r = Gh$1(), i = Y$10(), a = Yh$1(); - t.exports = { - parse: Xh$1(), - valid: Zh$1(), - clean: Qh$1(), - inc: $h$1(), - diff: eg$1(), - major: tg$1(), - minor: ng$1(), - patch: rg$1(), - prerelease: ig$1(), - compare: ag$1(), - rcompare: og$1(), - compareLoose: sg$1(), - compareBuild: cg$1(), - sort: lg$1(), - rsort: ug$1(), - gt: dg$1(), - lt: fg$1(), - eq: pg$1(), - neq: mg$1(), - gte: hg(), - lte: gg$1(), - cmp: _g$1(), - coerce: vg$1(), - Comparator: xg$1(), - Range: bg$1(), - satisfies: Sg$1(), - toComparators: Cg$1(), - maxSatisfying: wg$1(), - minSatisfying: Tg$1(), - minVersion: Eg$1(), - validRange: Dg$1(), - outside: Og$1(), - gtr: kg$1(), - ltr: Ag$1(), - intersects: jg$1(), - simplifyRange: Mg$1(), - subset: Ng$1(), - SemVer: i, - re: n.re, - src: n.src, - tokens: n.t, - SEMVER_SPEC_VERSION: r.SEMVER_SPEC_VERSION, - RELEASE_TYPES: r.RELEASE_TYPES, - compareIdentifiers: a.compareIdentifiers, - rcompareIdentifiers: a.rcompareIdentifiers - }; -})); -function Fg$1(e) { - return new Uint8Array(e).toBase64(); -} -function Ig$1(e) { - return Uint8Array.fromBase64(e).buffer; -} -function Lg$1(e) { - return Buffer.from(e).toString(`base64`); -} -function Rg$1(e) { - return Uint8Array.from(Buffer.from(e, `base64`)).buffer; -} -function zg$1(e) { - let t = new Uint8Array(e), n = ``, r = 32768; - for (let e = 0; e < t.length; e += r) { - let i = t.subarray(e, e + r); - n += String.fromCharCode.apply(null, i); - } - return btoa(n); -} -function Bg$1(e) { - let t = atob(e), n = t.length, r = new Uint8Array(n); - for (let e = 0; e < n; e++) r[e] = t.charCodeAt(e); - return r.buffer; -} -const Vg$1 = typeof Uint8Array.fromBase64 == `function`; -const Hg$1 = typeof process == `object` && process.versions?.node !== void 0; -const Ug$1 = Vg$1 ? Fg$1 : Hg$1 ? Lg$1 : zg$1; -const Wg$1 = Vg$1 ? Ig$1 : Hg$1 ? Rg$1 : Bg$1; -const Gg$1 = 2 ** 32 - 1; -const Kg$1 = Gg$1 - 1; -var qg$1 = class extends Error { - constructor(e, t, n, r) { - super(e), this.name = `DevalueError`, this.path = t.join(``), this.value = n, this.root = r; - } -}; -function Jg$1(e) { - return e === null || typeof e != `object` && typeof e != `function`; -} -const Yg$1 = Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`); -function Xg$1(e) { - let t = Object.getPrototypeOf(e); - return t === Object.prototype || t === null || Object.getPrototypeOf(t) === null || Object.getOwnPropertyNames(t).sort().join(`\0`) === Yg$1; -} -function Zg$1(e) { - return Object.prototype.toString.call(e).slice(8, -1); -} -function Qg$1(e) { - switch (e) { - case `"`: return `\\"`; - case `<`: return `\\u003C`; - case `\\`: return `\\\\`; - case ` -`: return `\\n`; - case `\r`: return `\\r`; - case ` `: return `\\t`; - case `\b`: return `\\b`; - case `\f`: return `\\f`; - case `\u2028`: return `\\u2028`; - case `\u2029`: return `\\u2029`; - default: return e < ` ` ? `\\u${e.charCodeAt(0).toString(16).padStart(4, `0`)}` : ``; - } -} -function $g$1(e) { - let t = ``, n = 0, r = e.length; - for (let i = 0; i < r; i += 1) { - let r = e[i], a = Qg$1(r); - a && (t += e.slice(n, i) + a, n = i + 1); - } - return `"${n === 0 ? e : t + e.slice(n)}"`; -} -function e_$1(e) { - return Object.getOwnPropertySymbols(e).filter((t) => Object.getOwnPropertyDescriptor(e, t).enumerable); -} -const t_$1 = /^[a-zA-Z_$][a-zA-Z_$0-9]*$/; -function n_$1(e) { - return t_$1.test(e) ? `.` + e : `[` + JSON.stringify(e) + `]`; -} -function r_$1(e) { - return !(!Number.isInteger(e) || e < 0 || e > Kg$1); -} -function i_$1(e) { - return !(!Number.isInteger(e) || e < 0 || e > Gg$1); -} -function a_$1(e) { - if (e.length === 0 || e.length > 1 && e.charCodeAt(0) === 48) return !1; - for (let t = 0; t < e.length; t++) { - let n = e.charCodeAt(t); - if (n < 48 || n > 57) return !1; - } - return r_$1(+e); -} -function o_$1(e) { - let t = Object.keys(e); - for (var n = t.length - 1; n >= 0 && !a_$1(t[n]); n--); - return t.length = n + 1, t; -} -function s_$1(e, t) { - return c_$1(JSON.parse(e), t); -} -function c_$1(e, t) { - if (typeof e == `number`) return a(e, !0); - if (!Array.isArray(e) || e.length === 0) throw Error(`Invalid input`); - let n = e, r = Array(n.length), i = null; - function a(e, o = !1) { - if (e === -1) return; - if (e === -3) return NaN; - if (e === -4) return Infinity; - if (e === -5) return -Infinity; - if (e === -6) return -0; - if (o || typeof e != `number`) throw Error(`Invalid input`); - if (e in r) return r[e]; - let s = n[e]; - if (!s || typeof s != `object`) r[e] = s; - else if (Array.isArray(s)) if (typeof s[0] == `string`) { - let o = s[0], c = t && Object.hasOwn(t, o) ? t[o] : void 0; - if (c) { - let t = s[1]; - if (typeof t != `number` && (t = n.push(s[1]) - 1), i ??= /* @__PURE__ */ new Set(), i.has(t)) throw Error(`Invalid circular reference`); - return i.add(t), r[e] = c(a(t)), i.delete(t), r[e]; - } - switch (o) { - case `Date`: - r[e] = new Date(s[1]); - break; - case `Set`: - let t = /* @__PURE__ */ new Set(); - r[e] = t; - for (let e = 1; e < s.length; e += 1) t.add(a(s[e])); - break; - case `Map`: - let i = /* @__PURE__ */ new Map(); - r[e] = i; - for (let e = 1; e < s.length; e += 2) i.set(a(s[e]), a(s[e + 1])); - break; - case `RegExp`: - r[e] = new RegExp(s[1], s[2]); - break; - case `Object`: { - let t = s[1]; - if (typeof n[t] == `object` && n[t][0] !== `BigInt`) throw Error(`Invalid input`); - r[e] = Object(a(t)); - break; - } - case `BigInt`: - r[e] = BigInt(s[1]); - break; - case `null`: - let c = Object.create(null); - r[e] = c; - for (let e = 1; e < s.length; e += 2) { - if (s[e] === `__proto__`) throw Error("Cannot parse an object with a `__proto__` property"); - c[s[e]] = a(s[e + 1]); - } - break; - case `Int8Array`: - case `Uint8Array`: - case `Uint8ClampedArray`: - case `Int16Array`: - case `Uint16Array`: - case `Float16Array`: - case `Int32Array`: - case `Uint32Array`: - case `Float32Array`: - case `Float64Array`: - case `BigInt64Array`: - case `BigUint64Array`: - case `DataView`: { - if (n[s[1]][0] !== `ArrayBuffer`) throw Error(`Invalid data`); - let t = globalThis[o], i = a(s[1]); - r[e] = s[2] === void 0 ? new t(i) : new t(i, s[2], s[3]); - break; - } - case `ArrayBuffer`: { - let t = s[1]; - if (typeof t != `string`) throw Error(`Invalid ArrayBuffer encoding`); - r[e] = Wg$1(t); - break; - } - case `Temporal.Duration`: - case `Temporal.Instant`: - case `Temporal.PlainDate`: - case `Temporal.PlainTime`: - case `Temporal.PlainDateTime`: - case `Temporal.PlainMonthDay`: - case `Temporal.PlainYearMonth`: - case `Temporal.ZonedDateTime`: { - let t = o.slice(9); - r[e] = Temporal[t].from(s[1]); - break; - } - case `URL`: - r[e] = new URL(s[1]); - break; - case `URLSearchParams`: - r[e] = new URLSearchParams(s[1]); - break; - default: throw Error(`Unknown type ${o}`); - } - } else if (s[0] === -7) { - let t = s[1]; - if (!i_$1(t)) throw Error(`Invalid input`); - let n = []; - r[e] = n, n[Kg$1] = void 0, delete n[Kg$1]; - for (let e = 2; e < s.length; e += 2) { - let r = s[e]; - if (!r_$1(r) || r >= t) throw Error(`Invalid input`); - n[r] = a(s[e + 1]); - } - n.length = t; - } else { - let t = Array(s.length); - r[e] = t; - for (let e = 0; e < s.length; e += 1) { - let n = s[e]; - n !== -2 && (t[e] = a(n)); - } - } - else { - let t = {}; - r[e] = t; - for (let e of Object.keys(s)) { - if (e === `__proto__`) throw Error("Cannot parse an object with a `__proto__` property"); - let n = s[e]; - t[e] = a(n); - } - } - return r[e]; - } - return a(0); -} -function l_$1(e, t) { - let n = u_$1(!1, e, t); - return typeof n == `string` ? n : `[${n.join(`,`)}]`; -} -function u_$1(e, t, n) { - let r = [], i = /* @__PURE__ */ new Map(), a = []; - if (n) for (let e of Object.getOwnPropertyNames(n)) a.push({ - key: e, - fn: n[e] - }); - let o = [], s = 0; - function c(n, l) { - if (n === void 0) return -1; - if (Number.isNaN(n)) return -3; - if (n === Infinity) return -4; - if (n === -Infinity) return -5; - if (n === 0 && 1 / n < 0) return -6; - if (i.has(n)) return i.get(n); - l ??= s++, i.set(n, l); - for (let { key: e, fn: t } of a) { - let i = t(n); - if (i) return r[l] = `["${e}",${c(i)}]`, l; - } - if (typeof n == `function`) throw new qg$1(`Cannot stringify a function`, o, n, t); - if (typeof n == `symbol`) throw new qg$1(`Cannot stringify a Symbol primitive`, o, n, t); - let u = ``; - if (Jg$1(n)) u = d_$1(n); - else if (typeof n.then == `function`) { - if (!e) throw new qg$1(`Cannot stringify a Promise or thenable — use stringifyAsync instead`, o, n, t); - u = Promise.resolve(n).then((e) => { - let t = c(e, l); - t < 0 && (r[l] = t); - }); - } else { - let e = Zg$1(n); - switch (e) { - case `Number`: - case `String`: - case `Boolean`: - case `BigInt`: - u = `["Object",${c(n.valueOf())}]`; - break; - case `Date`: - u = `["Date","${isNaN(n.getDate()) ? `` : n.toISOString()}"]`; - break; - case `URL`: - u = `["URL",${$g$1(n.toString())}]`; - break; - case `URLSearchParams`: - u = `["URLSearchParams",${$g$1(n.toString())}]`; - break; - case `RegExp`: - let { source: r, flags: i } = n; - u = i ? `["RegExp",${$g$1(r)},"${i}"]` : `["RegExp",${$g$1(r)}]`; - break; - case `Array`: { - let e = !1; - u = `[`; - for (let t = 0; t < n.length; t += 1) if (t > 0 && (u += `,`), Object.hasOwn(n, t)) o.push(`[${t}]`), u += c(n[t]), o.pop(); - else if (e) u += -2; - else { - let t = o_$1(n), r = t.length, i = String(n.length).length; - if ((n.length - r) * 3 > 4 + i + r * (i + 1)) { - u = `[-7,` + n.length; - for (let e = 0; e < t.length; e++) { - let r = t[e]; - o.push(`[${r}]`), u += `,` + r + `,` + c(n[r]), o.pop(); - } - break; - } else e = !0, u += -2; - } - u += `]`; - break; - } - case `Set`: - u = `["Set"`; - for (let e of n) u += `,${c(e)}`; - u += `]`; - break; - case `Map`: - u = `["Map"`; - for (let [e, t] of n) o.push(`.get(${Jg$1(e) ? d_$1(e) : `...`})`), u += `,${c(e)},${c(t)}`, o.pop(); - u += `]`; - break; - case `Int8Array`: - case `Uint8Array`: - case `Uint8ClampedArray`: - case `Int16Array`: - case `Uint16Array`: - case `Float16Array`: - case `Int32Array`: - case `Uint32Array`: - case `Float32Array`: - case `Float64Array`: - case `BigInt64Array`: - case `BigUint64Array`: - case `DataView`: { - let t = n; - u = `["` + e + `",` + c(t.buffer), t.byteLength !== t.buffer.byteLength && (u += `,${t.byteOffset},${t.length}`), u += `]`; - break; - } - case `ArrayBuffer`: - u = `["ArrayBuffer","${Ug$1(n)}"]`; - break; - case `Temporal.Duration`: - case `Temporal.Instant`: - case `Temporal.PlainDate`: - case `Temporal.PlainTime`: - case `Temporal.PlainDateTime`: - case `Temporal.PlainMonthDay`: - case `Temporal.PlainYearMonth`: - case `Temporal.ZonedDateTime`: - u = `["${e}",${$g$1(n.toString())}]`; - break; - default: - if (!Xg$1(n)) throw new qg$1(`Cannot stringify arbitrary non-POJOs`, o, n, t); - if (e_$1(n).length > 0) throw new qg$1(`Cannot stringify POJOs with symbolic keys`, o, n, t); - if (Object.getPrototypeOf(n) === null) { - u = `["null"`; - for (let e of Object.keys(n)) { - if (e === `__proto__`) throw new qg$1(`Cannot stringify objects with __proto__ keys`, o, n, t); - o.push(n_$1(e)), u += `,${$g$1(e)},${c(n[e])}`, o.pop(); - } - u += `]`; - } else { - u = `{`; - let e = !1; - for (let r of Object.keys(n)) { - if (r === `__proto__`) throw new qg$1(`Cannot stringify objects with __proto__ keys`, o, n, t); - e && (u += `,`), e = !0, o.push(n_$1(r)), u += `${$g$1(r)}:${c(n[r])}`, o.pop(); - } - u += `}`; - } - } - } - return r[l] = u, l; - } - let l = c(t); - return l < 0 ? `${l}` : r; -} -function d_$1(e) { - let t = typeof e; - return t === `string` ? $g$1(e) : e === void 0 ? `-1` : e === 0 && 1 / e < 0 ? `-6` : t === `bigint` ? `["BigInt","${e}"]` : String(e); -} -var f_$1 = d$13(Pg$1(), 1); -async function p_$1(e, t = [`encrypt`, `decrypt`]) { - if (e.byteLength !== 32) throw new u$10(`Encryption key must be exactly 32 bytes, got ${e.byteLength}`); - return globalThis.crypto.subtle.importKey(`raw`, e, `AES-GCM`, !1, t); -} -async function m_$1(e, t) { - let n = globalThis.crypto.getRandomValues(/* @__PURE__ */ new Uint8Array(12)), r; - try { - r = await globalThis.crypto.subtle.encrypt({ - name: `AES-GCM`, - iv: n, - tagLength: 128 - }, e, t); - } catch (e) { - throw new p$11(`AES-256-GCM encryption failed: ${e instanceof Error ? e.message : String(e)}`, { - cause: e, - context: { - operation: `encrypt`, - byteLength: t.byteLength - } - }); - } - let i = new Uint8Array(12 + r.byteLength); - return i.set(n, 0), i.set(new Uint8Array(r), 12), i; -} -async function h_$1(e, t) { - if (t.byteLength < 28) throw new p$11(`Encrypted data too short: expected at least 28 bytes, got ${t.byteLength}`, { context: { - operation: `decrypt`, - byteLength: t.byteLength - } }); - let n = t.subarray(0, 12), r = t.subarray(12), i; - try { - i = await globalThis.crypto.subtle.decrypt({ - name: `AES-GCM`, - iv: n, - tagLength: 128 - }, e, r); - } catch (e) { - throw new p$11(`AES-256-GCM decryption failed: ${e instanceof Error ? e.message : String(e)}`, { - cause: e, - context: { - operation: `decrypt`, - byteLength: t.byteLength - } - }); - } - return new Uint8Array(i); -} -function g_$1() { - let e = { - ...f$9(), - pendingOps: 0, - doneResolved: !1, - streamEnded: !1 - }; - return e.promise.catch(() => {}), e; -} -function __$1(e) { - if (e.locked) return !1; - let t; - try { - t = e.getWriter(); - } catch { - return !1; - } - try { - t.releaseLock(); - } catch { - return !1; - } - return !0; -} -function v_$1(e) { - if (e.locked) return !1; - let t; - try { - t = e.getReader(); - } catch { - return !1; - } - try { - t.releaseLock(); - } catch { - return !1; - } - return !0; -} -function y_$1(e, t) { - if (t.writablePollingInterval !== void 0) return; - let n = setInterval(() => { - if (t.doneResolved || t.streamEnded) { - clearInterval(n), t.writablePollingInterval = void 0; - return; - } - __$1(e) && t.pendingOps === 0 && (t.doneResolved = !0, t.resolve(), clearInterval(n), t.writablePollingInterval = void 0); - }, 10); - t.writablePollingInterval = n; -} -function b_$1(e, t) { - if (t.readablePollingInterval !== void 0) return; - let n = setInterval(() => { - if (t.doneResolved || t.streamEnded) { - clearInterval(n), t.readablePollingInterval = void 0; - return; - } - v_$1(e) && t.pendingOps === 0 && (t.doneResolved = !0, t.resolve(), clearInterval(n), t.readablePollingInterval = void 0); - }, 10); - t.readablePollingInterval = n; -} -async function x_$1(e, t, n) { - let r = e.getReader(), i = t.getWriter(), a; - try { - for (;;) { - if (n.streamEnded) return; - let e = await Promise.race([r.read(), i.closed.then(() => { - throw new u$10(`Writable stream closed prematurely`); - })]); - if (n.streamEnded) return; - if (e.done) { - n.streamEnded = !0, await i.close(), n.doneResolved || (n.doneResolved = !0, n.resolve()); - return; - } - n.pendingOps++; - try { - await i.write(e.value); - } finally { - n.pendingOps--; - } - } - } catch (e) { - throw n.streamEnded = !0, a = e, n.doneResolved || (n.doneResolved = !0, n.reject(e)), e; - } finally { - r.cancel(a).catch(() => {}), r.releaseLock(), i.releaseLock(); - } -} -const S_$1 = Symbol.for(`@workflow/world//cache`); -const C_$1 = Symbol.for(`@workflow/world//cachePromise`); -const w_$1 = Symbol.for(`@workflow/world//getWorldFn`); -async function T_$1() { - let e = globalThis; - if (e[S_$1]) return e[S_$1]; - if (e[C_$1]) return e[S_$1] = await e[C_$1], e[S_$1]; - let t = e[w_$1]; - if (t) return t(); - let { getWorld: n } = await import([`./world`, `js`].join(`.`)); - return n(); -} -const E_$1 = Symbol.for(`workflow-serialize`); -const D_$1 = Symbol.for(`workflow-deserialize`); -const O_$1 = Symbol.for(`WORKFLOW_USE_STEP`); -const k_$1 = Symbol.for(`WORKFLOW_SET_ATTRIBUTES`); -const A_$1 = Symbol.for(`WORKFLOW_CREATE_HOOK`); -const j_$1 = Symbol.for(`WORKFLOW_SLEEP`); -const M_$1 = Symbol.for(`WORKFLOW_GET_STREAM_ID`); -const N_$1 = Symbol.for(`WORKFLOW_STABLE_ULID`); -const P_$1 = Symbol.for(`WORKFLOW_STREAM_NAME`); -const F_$1 = Symbol.for(`WORKFLOW_STREAM_TYPE`); -const I_$1 = Symbol.for(`WORKFLOW_STREAM_FRAMING`); -const L_$1 = Symbol.for(`WORKFLOW_STREAM_SERVER_RUN_ID`); -const R_$1 = Symbol.for(`WORKFLOW_STREAM_SERVER_DEPLOYMENT_ID`); -const z_$1 = Symbol.for(`BODY_INIT`); -const B_$1 = Symbol.for(`WEBHOOK_RESPONSE_WRITABLE`); -const V_$1 = Symbol.for(`workflow-class-registry`); -const X$10 = Symbol.for(`WORKFLOW_ABORT_STREAM_NAME`); -const Z$9 = Symbol.for(`WORKFLOW_ABORT_HOOK_TOKEN`); -const H_$1 = Symbol.for(`WORKFLOW_ABORT_LISTENER_ATTACHED`); -const U_$1 = Symbol.for(`WORKFLOW_ABORT_READER_CANCEL`); -function W_$1(e = globalThis) { - let t = e, n = t[V_$1]; - return n || (n = /* @__PURE__ */ new Map(), t[V_$1] = n), n; -} -const G_$1 = `class//workflow//Run`; -function q_$1(e, t) { - return W_$1(t).get(e); -} -function J_$1() { - return { - Class: (e) => { - if (typeof e != `function`) return !1; - let t = e.classId; - return typeof t == `string` ? { classId: t } : !1; - }, - Instance: (e) => { - if (typeof e != `object` || !e) return !1; - let t = e.constructor; - if (!t || typeof t != `function`) return !1; - let n = t[E_$1]; - if (typeof n != `function`) return !1; - let r = t.classId; - if (typeof r != `string`) throw Error(`Class "${t.name}" with ${String(E_$1)} must have a static "classId" property.`); - return { - classId: r, - data: n.call(t, e) - }; - } - }; -} -function Y_$1(e = globalThis) { - return { - Class: (t) => { - let n = t.classId, r = q_$1(n, e); - if (!r) throw Error(`Class "${n}" not found. Make sure the class is registered with registerSerializationClass.`); - return r; - }, - Instance: (t) => { - let n = t.classId, r = t.data, i = q_$1(n, e); - if (!i) throw Error(`Class "${n}" not found. Make sure the class is registered with registerSerializationClass.`); - let a = i[D_$1]; - if (typeof a != `function`) throw Error(`Class "${n}" does not have a static ${String(D_$1)} method.`); - return a.call(i, r); - } - }; -} -function X_$1(e, t, n) { - if (n === 0) return `.`; - let r = new Uint8Array(e, t, n); - return Buffer.from(r).toString(`base64`); -} -function Z_$1(e) { - return X_$1(e.buffer, e.byteOffset, e.byteLength); -} -function Q_$1(e, t) { - let n = e === `.` ? `` : e, r = Buffer.from(n, `base64`), i = new t.ArrayBuffer(r.length); - return new t.Uint8Array(i).set(r), i; -} -function $_$1(e) { - return JSON.parse(e); -} -function ev$1(e) { - if (!types.isNativeError(e)) return !1; - let t = { - message: e.message, - stack: e.stack - }; - return `cause` in e && (t.cause = e.cause), t; -} -function tv$1(e, t) { - return !types.isNativeError(t) || t.name !== e ? !1 : ev$1(t); -} -function nv$1(e) { - return (t) => tv$1(e, t) || !1; -} -function rv$1(e, t) { - return (n) => { - let r = n, i = `cause` in r ? { cause: r.cause } : void 0, a = e[t], o = new a(r.message, i); - return r.stack !== void 0 && (o.stack = r.stack), o; - }; -} -function iv$1(e = globalThis) { - return { - ArrayBuffer: (t) => t instanceof e.ArrayBuffer && X_$1(t, 0, t.byteLength), - BigInt: (e) => typeof e == `bigint` && e.toString(), - BigInt64Array: (t) => t instanceof e.BigInt64Array && Z_$1(t), - BigUint64Array: (t) => t instanceof e.BigUint64Array && Z_$1(t), - Date: (t) => t instanceof e.Date ? Number.isNaN(t.getDate()) ? `.` : t.toISOString() : !1, - DOMException: (e) => { - if (typeof e != `object` || !e || e.constructor?.name !== `DOMException`) return !1; - let t = e, n = { - message: t.message, - name: t.name, - stack: t.stack - }; - return `cause` in t && (n.cause = t.cause), n; - }, - EvalError: nv$1(`EvalError`), - FatalError: nv$1(`FatalError`), - HookConflictError: (e) => { - let t = tv$1(`HookConflictError`, e); - if (!t) return !1; - let n = e, r = { - ...t, - token: n.token - }; - return n.conflictingRunId !== void 0 && (r.conflictingRunId = n.conflictingRunId), r; - }, - RangeError: nv$1(`RangeError`), - ReferenceError: nv$1(`ReferenceError`), - RetryableError: (e) => { - let t = tv$1(`RetryableError`, e); - if (!t) return !1; - let n = e.retryAfter, r; - if (n && typeof n == `object` && typeof n.getTime == `function`) { - let e = n.getTime(); - r = Number.isNaN(e) ? Date.now() + 1e3 : e; - } else if (typeof n == `string` || typeof n == `number`) { - let e = new Date(n).getTime(); - r = Number.isNaN(e) ? Date.now() + 1e3 : e; - } else r = Date.now() + 1e3; - return { - ...t, - retryAfter: r - }; - }, - RuntimeDecryptionError: (e) => { - let t = tv$1(`RuntimeDecryptionError`, e); - if (!t) return !1; - let n = { ...t }, r = e.context; - return r !== void 0 && (n.context = r), n; - }, - SyntaxError: nv$1(`SyntaxError`), - TypeError: nv$1(`TypeError`), - URIError: nv$1(`URIError`), - AggregateError: (e) => { - let t = tv$1(`AggregateError`, e); - return t ? { - ...t, - errors: e.errors - } : !1; - }, - Error: (e) => { - if (!types.isNativeError(e)) return !1; - let t = { - name: e.name, - message: e.message, - stack: e.stack - }; - return `cause` in e && (t.cause = e.cause), t; - }, - Float32Array: (t) => t instanceof e.Float32Array && Z_$1(t), - Float64Array: (t) => t instanceof e.Float64Array && Z_$1(t), - Headers: (t) => t instanceof e.Headers && Array.from(t), - Int8Array: (t) => t instanceof e.Int8Array && Z_$1(t), - Int16Array: (t) => t instanceof e.Int16Array && Z_$1(t), - Int32Array: (t) => t instanceof e.Int32Array && Z_$1(t), - Map: (t) => t instanceof e.Map && Array.from(t), - RegExp: (t) => t instanceof e.RegExp && { - source: t.source, - flags: t.flags - }, - Set: (t) => t instanceof e.Set && Array.from(t), - URL: (t) => t instanceof e.URL && t.href, - WorkflowFunction: (e) => { - if (typeof e != `function`) return !1; - let t = e.workflowId; - return typeof t == `string` ? { workflowId: t } : !1; - }, - URLSearchParams: (t) => t instanceof e.URLSearchParams ? t.size === 0 ? `.` : String(t) : !1, - Uint8Array: (t) => t instanceof e.Uint8Array && Z_$1(t), - Uint8ClampedArray: (t) => t instanceof e.Uint8ClampedArray && Z_$1(t), - Uint16Array: (t) => t instanceof e.Uint16Array && Z_$1(t), - Uint32Array: (t) => t instanceof e.Uint32Array && Z_$1(t) - }; -} -function av$1(e = globalThis) { - return { - ArrayBuffer: (t) => Q_$1(t, e), - BigInt: (t) => e.BigInt(t), - BigInt64Array: (t) => new e.BigInt64Array(Q_$1(t, e)), - BigUint64Array: (t) => new e.BigUint64Array(Q_$1(t, e)), - Date: (t) => new e.Date(t), - DOMException: (t) => { - let n = new e.DOMException(t.message, t.name); - return t.stack !== void 0 && (n.stack = t.stack), `cause` in t && (n.cause = t.cause), n; - }, - EvalError: rv$1(e, `EvalError`), - FatalError: (t) => { - let n = new (e[Symbol.for(`@workflow/errors//FatalError`)] ?? D$10)(t.message); - return t.stack !== void 0 && (n.stack = t.stack), `cause` in t && (n.cause = t.cause), n; - }, - HookConflictError: (t) => { - let n = new (e[Symbol.for(`@workflow/errors//HookConflictError`)] ?? y$6)(t.token, t.conflictingRunId); - return t.stack !== void 0 && (n.stack = t.stack), `cause` in t && (n.cause = t.cause), n; - }, - RangeError: rv$1(e, `RangeError`), - ReferenceError: rv$1(e, `ReferenceError`), - RetryableError: (t) => { - let n = new (e[Symbol.for(`@workflow/errors//RetryableError`)] ?? O$8)(t.message, { retryAfter: new e.Date(t.retryAfter) }); - return t.stack !== void 0 && (n.stack = t.stack), `cause` in t && (n.cause = t.cause), n; - }, - RuntimeDecryptionError: (t) => { - let n = e[Symbol.for(`@workflow/errors//RuntimeDecryptionError`)] ?? p$11, r = {}; - `cause` in t && (r.cause = t.cause), t.context !== void 0 && (r.context = t.context); - let i = new n(t.message, r); - return t.stack !== void 0 && (i.stack = t.stack), i; - }, - SyntaxError: rv$1(e, `SyntaxError`), - TypeError: rv$1(e, `TypeError`), - URIError: rv$1(e, `URIError`), - AggregateError: (t) => { - let n = `cause` in t ? { cause: t.cause } : void 0, r = new e.AggregateError(t.errors, t.message, n); - return t.stack !== void 0 && (r.stack = t.stack), r; - }, - Error: (t) => { - let n = `cause` in t ? { cause: t.cause } : void 0, r = new e.Error(t.message, n); - return r.name = t.name, t.stack !== void 0 && (r.stack = t.stack), r; - }, - Float32Array: (t) => new e.Float32Array(Q_$1(t, e)), - Float64Array: (t) => new e.Float64Array(Q_$1(t, e)), - Headers: (t) => new e.Headers(t), - Int8Array: (t) => new e.Int8Array(Q_$1(t, e)), - Int16Array: (t) => new e.Int16Array(Q_$1(t, e)), - Int32Array: (t) => new e.Int32Array(Q_$1(t, e)), - Map: (t) => new e.Map(t), - RegExp: (t) => new e.RegExp(t.source, t.flags), - Set: (t) => new e.Set(t), - URL: (t) => new e.URL(t), - WorkflowFunction: (e) => Object.assign(() => { - throw Error(`Workflow functions cannot be called directly. Use start() to invoke them.`); - }, { workflowId: e.workflowId }), - URLSearchParams: (t) => new e.URLSearchParams(t === `.` ? `` : t), - Uint8Array: (t) => new e.Uint8Array(Q_$1(t, e)), - Uint8ClampedArray: (t) => new e.Uint8ClampedArray(Q_$1(t, e)), - Uint16Array: (t) => new e.Uint16Array(Q_$1(t, e)), - Uint32Array: (t) => new e.Uint32Array(Q_$1(t, e)) - }; -} -function ov$1() { - return { StepFunction: (e) => { - if (typeof e != `function`) return !1; - let t = e.stepId; - if (typeof t != `string`) return !1; - let n = e.__closureVarsFn, r = n && typeof n == `function` ? n() : void 0, i = `__boundThis` in e, a = i ? e.__boundThis : void 0, o = e.__boundArgs, s = { stepId: t }; - return r !== void 0 && (s.closureVars = r), i && (s.boundThis = a), Array.isArray(o) && o.length > 0 && (s.boundArgs = o), s; - } }; -} -function sv$1(e = globalThis) { - let t = e[Symbol.for(`WORKFLOW_USE_STEP`)]; - return { StepFunction: (e) => { - let n = e.stepId, r = e.closureVars; - if (!t) throw Error(`WORKFLOW_USE_STEP not found on global object. Step functions cannot be deserialized outside workflow context.`); - let i = r ? t(n, () => r) : t(n); - if (`boundThis` in e) { - let t = Array.isArray(e.boundArgs) ? e.boundArgs : []; - return i.bind(e.boundThis, ...t); - } - return i; - } }; -} -function cv$1(e) { - return e.length === 4 && /^[a-z0-9]{4}$/.test(e); -} -const Q$9 = { - DEVALUE_V1: `devl`, - ENCRYPTED: `encr`, - GZIP: `gzip`, - ZSTD: `zstd` -}; -const lv$1 = new TextEncoder(); -const uv$1 = new TextDecoder(); -function dv$1(e, t = globalThis, n) { - let r; - switch (e) { - case `workflow`: - r = { - ...J_$1(), - ...ov$1(), - ...iv$1(t) - }; - break; - case `step`: - r = { - ...J_$1(), - ...iv$1(t) - }; - break; - case `client`: - r = { - ...J_$1(), - ...iv$1(t) - }; - break; - } - return n ? { - ...r, - ...n - } : r; -} -function fv$1(e, t = globalThis, n) { - let r; - switch (e) { - case `workflow`: - r = { - ...Y_$1(t), - ...sv$1(t), - ...av$1(t) - }; - break; - case `step`: - r = { - ...Y_$1(t), - ...av$1(t) - }; - break; - case `client`: - r = { - ...Y_$1(t), - ...av$1(t), - StepFunction: () => { - throw Error(`Step functions cannot be deserialized in client context.`); - } - }; - break; - } - return n ? { - ...r, - ...n - } : r; -} -const pv$1 = { - formatPrefix: Q$9.DEVALUE_V1, - serialize(e, t, n) { - let r = l_$1(e, dv$1(t, n?.global, n?.extraReducers)); - return lv$1.encode(r); - }, - deserialize(e, t, n) { - let r = fv$1(t, n?.global, n?.extraRevivers); - return s_$1(uv$1.decode(e), r); - }, - deserializeLegacy(e, t, n) { - return c_$1(e, fv$1(t, n?.global, n?.extraRevivers)); - } -}; -const mv$1 = new TextEncoder(); -const hv$1 = new TextDecoder(); -function gv$1(e, t) { - if (!(t instanceof Uint8Array)) return t; - let n = mv$1.encode(e), r = new Uint8Array(4 + t.length); - return r.set(n, 0), r.set(t, 4), r; -} -function _v$1(e) { - if (!(e instanceof Uint8Array) || e.length < 4) return null; - let t = e.subarray(0, 4), n = hv$1.decode(t); - return cv$1(n) ? n : null; -} -function vv$1(e) { - if (!(e instanceof Uint8Array)) return { - format: Q$9.DEVALUE_V1, - payload: new TextEncoder().encode(JSON.stringify(e)) - }; - if (e.length < 4) throw Error(`Data too short to contain format prefix: expected at least 4 bytes, got ${e.length}`); - let t = e.subarray(0, 4), n = hv$1.decode(t); - if (!cv$1(n)) throw Error(`Invalid format prefix: "${n}". Must be 4 characters of [a-z0-9].`); - return { - format: n, - payload: e.subarray(4) - }; -} -function yv$1() { - try { - return typeof process < `u` && process.env?.WORKFLOW_DISABLE_COMPRESSION === `1`; - } catch { - return !1; - } -} -function bv$1() { - try { - let e = process.env?.WORKFLOW_COMPRESSION_CODEC; - return e === `gzip` || e === `zstd` ? e : void 0; - } catch { - return; - } -} -function xv$1() { - try { - return globalThis.process?.getBuiltinModule?.(`node:zlib`); - } catch { - return; - } -} -function Sv$1() { - let e = xv$1(); - return typeof e?.zstdCompressSync == `function` && typeof e?.zstdDecompressSync == `function`; -} -function Cv$1() { - return typeof CompressionStream == `function` && typeof DecompressionStream == `function`; -} -async function wv$1(e, t) { - let n = t.writable.getWriter(), r = n.write(e).then(() => n.close()); - r.catch(() => {}); - let i = [], a = 0, o = t.readable.getReader(); - for (;;) { - let { done: e, value: t } = await o.read(); - if (e) break; - i.push(t), a += t.length; - } - await r; - let s = new Uint8Array(a), c = 0; - for (let e of i) s.set(e, c), c += e.length; - return s; -} -async function Tv$1(e) { - return wv$1(e, new CompressionStream(`gzip`)); -} -async function Ev$1(e) { - return wv$1(e, new DecompressionStream(`gzip`)); -} -function Dv$1(e) { - let t = xv$1(), n = t?.constants?.ZSTD_c_compressionLevel, r = n === void 0 ? void 0 : { params: { [n]: 3 } }; - return new Uint8Array(t.zstdCompressSync(e, r)); -} -function Ov$1(e) { - let t = xv$1(); - if (!t?.zstdDecompressSync) throw Error(`Compressed (zstd) workflow data encountered but node:zlib zstd support is not available in this runtime (requires Node.js 22.15+). In the browser, register a zstd decoder via registerZstdDecoder (serialization-format.ts).`); - return new Uint8Array(t.zstdDecompressSync(e)); -} -function kv(e, t, n, r) { - e && (e.recorded = !0, e.compressed = t !== `none`, e.codec = t, e.uncompressedBytes = n, e.storedBytes = r); -} -function Av() { - return bv$1() === `gzip` ? Cv$1() ? `gzip` : `none` : Sv$1() ? `zstd` : Cv$1() ? `gzip` : `none`; -} -async function jv(e, t, n) { - if (!(e instanceof Uint8Array)) return e; - if (!t || e.length < 1024 || yv$1()) return kv(n, `none`, e.length, e.length), e; - let r = Av(); - if (r === `none`) return kv(n, `none`, e.length, e.length), e; - let i = r === `zstd` ? Dv$1(e) : await Tv$1(e), a = r === `zstd` ? Q$9.ZSTD : Q$9.GZIP, o = 4 + i.length; - return o >= e.length * .95 ? (kv(n, `none`, e.length, e.length), e) : (kv(n, r, e.length, o), gv$1(a, i)); -} -async function Mv(e, t) { - if (!(e instanceof Uint8Array)) return e; - let n = _v$1(e); - if (n === Q$9.ZSTD) { - let { payload: n } = vv$1(e), r = Ov$1(n); - return kv(t, `zstd`, r.length, e.length), r; - } - if (n === Q$9.GZIP) { - if (!Cv$1()) throw Error(`Compressed (gzip) workflow data encountered but DecompressionStream is not available in this runtime. Node.js 18+, browsers, and edge runtimes all support it.`); - let { payload: n } = vv$1(e), r = await Ev$1(n); - return kv(t, `gzip`, r.length, e.length), r; - } - return kv(t, `none`, e.length, e.length), e; -} -async function Nv(e) { - return typeof e == `function` ? e() : e; -} -async function Pv(e, t) { - if (!t || !(e instanceof Uint8Array)) return e; - let n = await m_$1(t, e); - return gv$1(Q$9.ENCRYPTED, n); -} -async function Fv(e, t) { - if (!(e instanceof Uint8Array)) return e; - let n = _v$1(e); - if (n === Q$9.ENCRYPTED && !t) throw new p$11(`Encrypted data encountered but no encryption key is available. Encryption is not configured or no key was provided for this run.`, { context: { - operation: `decrypt`, - byteLength: e.byteLength, - formatPrefix: `encr` - } }); - if (n !== Q$9.ENCRYPTED) return e; - let { payload: r } = vv$1(e); - try { - return await h_$1(t, r); - } catch (e) { - throw p$11.is(e) && e.context && (e.context.formatPrefix = n), e; - } -} -function Iv(e, t, n) { - let [r, ...i] = t.split(` -`), a = i.join(` -`), o = Lv(r ?? ``, n), s = Rv(a), c = [`${e} ${r ?? ``}`]; - return o && c.push(o), s && c.push(s), c.join(` -`); -} -function Lv(e, t) { - if (!t || Object.keys(t).length === 0) return null; - let n = /* @__PURE__ */ new Set(); - n.add(`errorStack`), typeof t.errorMessage == `string` && e.includes(t.errorMessage) && n.add(`errorMessage`); - let r = /* @__PURE__ */ new Set([ - `workflowRunId`, - `workflowName`, - `stepId`, - `stepName`, - `errorAttribution`, - `errorCode`, - `errorName`, - `errorMessage`, - `errorStack`, - `hint`, - `attempt`, - `retryCount` - ]), i = [], a = Bv(t, `errorName`), o = Bv(t, `errorAttribution`); - if (a || o) { - let e = o ? o === `sdk` ? pe$8(`sdk error`) : fe$8(`user error`) : ``, t = a ? de$8(a) : ``, n = e && t ? ue$8(` · `) : ``; - i.push(` ${e}${n}${t}`); - } - let s = Bv(t, `workflowRunId`), u = Bv(t, `workflowName`); - s ? i.push(Hv(`run`, s, u, s$9)) : u && i.push(Hv(`run`, null, u, s$9)); - let d = Bv(t, `stepId`), f = Bv(t, `stepName`); - if ((d || f) && i.push(Hv(`step`, d, f, o$11)), t.attempt !== void 0 || t.retryCount !== void 0) { - let e = t.attempt, n = t.retryCount; - e !== void 0 && n !== void 0 ? i.push(` ${Vv(`retry`)} ${e} ${ue$8(`attempts ·`)} ${n} ${ue$8(`max retries`)}`) : e !== void 0 && i.push(` ${Vv(`retry`)} ${e} ${ue$8(`attempts`)}`); - } - let p = Bv(t, `errorCode`); - p && p !== a && i.push(` ${Vv(`code`)} ${ue$8(p)}`); - let m = Bv(t, `hint`); - m && i.push(` ${se$8(m)}`); - let h = Object.entries(t).filter(([e, t]) => !r.has(e) && !n.has(e) && t != null).sort(([e], [t]) => e.localeCompare(t)); - for (let [e, t] of h) i.push(` ${Vv(e)} ${Uv(t)}`); - return i.length ? i.join(` -`) : null; -} -function Rv(e) { - if (!e) return null; - let t = e.split(` -`), n = [], r = 0, i = 0, a = 0, o = () => { - r > 0 && (n.push(ue$8(` … ${r} more ${r === 1 ? `frame` : `frames`} in framework internals`)), r = 0); - }; - for (let e of t) { - let t = e.trimStart().startsWith(`at `); - if (t && zv(e)) { - r++; - continue; - } - if (t && i >= 6) { - a++; - continue; - } - o(), n.push(e), t && i++; - } - return o(), a > 0 && n.push(ue$8(` … ${a} more ${a === 1 ? `frame` : `frames`} (run \`pnpm wf inspect run \` for the full stack)`)), n.join(` -`); -} -function zv(e) { - let t = e.trimStart(); - return t.startsWith(`at `) ? !!(t.includes(`node:internal/`) || t.includes(`node_modules/.pnpm/`) || t.includes(`node_modules__pnpm_`) || t.includes(`_next_dist_`) || t.includes(`node_modules/next/`) || t.includes(`node_modules/@opentelemetry/`) || t.includes(`node_modules/vitest/`) || t.includes(`node_modules/@vitest/`)) : !1; -} -function Bv(e, t) { - let n = e[t]; - return typeof n == `string` && n.length > 0 ? n : null; -} -function Vv(e) { - return ue$8(e.padEnd(6)); -} -function Hv(e, t, n, r) { - let a = t || ue$8(`—`), o = n && (e === `run` ? i$12(n) : a$11(n)) ? `${ue$8(`·`)} ${r(n)}` : ``; - return ` ${Vv(e)} ${a}${o ? ` ` + o : ``}`; -} -function Uv(e) { - if (typeof e == `string`) return e.includes(` -`) ? e.split(` -`).map((e, t) => t === 0 ? e : ` ${e}`).join(` -`) : e; - if (typeof e == `number` || typeof e == `boolean`) return String(e); - try { - return JSON.stringify(e); - } catch { - return String(e); - } -} -var Wv = class e extends Error { - steps; - globalThis; - stepCount; - hookCount; - waitCount; - attributeCount; - hookDisposedCount; - abortCount; - constructor(e, t) { - let n = [...e.values()], r = 0, i = 0, o = 0, s = 0, c = 0, l = 0; - for (let e of n) e.type === `step` ? r++ : e.type === `hook` ? e.disposed ? c++ : e.abortRequested ? l++ : i++ : e.type === `wait` ? o++ : e.type === `attribute` && s++; - let u = []; - r > 0 && u.push(`${r} ${n$11(`step`, `steps`, r)}`), i > 0 && u.push(`${i} ${n$11(`hook`, `hooks`, i)}`), o > 0 && u.push(`${o} ${n$11(`wait`, `waits`, o)}`), s > 0 && u.push(`${s} ${n$11(`attribute write`, `attribute writes`, s)}`), c > 0 && u.push(`${c} hook ${n$11(`disposal`, `disposals`, c)}`); - let d = n$11(`has`, `have`, r + i + o + s + c), f = +(r > 0) + +(i > 0) + +(o > 0) + +(s > 0) + +(c > 0), p; - p = f > 1 ? `processed` : r > 0 ? `run` : i > 0 || o > 0 ? `created` : s > 0 ? `written` : c > 0 ? `processed` : `received`; - let m = u.length > 0 ? `${u.join(` and `)} ${d} not been ${p} yet` : `0 steps have not been run yet`; - super(m), this.name = `WorkflowSuspension`, this.steps = n, this.globalThis = t, this.stepCount = r, this.hookCount = i, this.waitCount = o, this.attributeCount = s, this.hookDisposedCount = c, this.abortCount = l; - } - static is(t) { - return t instanceof e; - } -}; -function Gv() { - throw new u$10(`This API is not available inside a workflow function. Workflow functions run in a deterministic VM; move the call to a step function for full Node.js access.`); -} -function $$9(...e) { - return (t) => Object.fromEntries(e.map((e) => [e, t])); -} -const Kv = $$9(`workflow.name`); -const qv = $$9(`workflow.operation`); -const Jv = $$9(`workflow.run.id`); -const Yv = $$9(`workflow.run.status`); -const Xv = $$9(`workflow.started_at`); -const Zv = $$9(`workflow.events.count`); -const Qv = $$9(`workflow.arguments.count`); -const $v = $$9(`workflow.result.type`); -const ey = $$9(`workflow.trace.propagated`); -const ty = $$9(`workflow.trace.mode`); -const ny = $$9(`workflow.turbo`); -const ry = $$9(`workflow.error.name`); -const iy = $$9(`workflow.error.message`); -const ay = $$9(`workflow.error.code`); -const oy = $$9(`workflow.steps.created`); -const sy = $$9(`workflow.hooks.created`); -const cy = $$9(`workflow.waits.created`); -const ly = $$9(`workflow.route.type`); -const uy = $$9(`workflow.route.handler_cached`); -const dy = $$9(`workflow.route.invocation_count`); -const fy = $$9(`workflow.route.entrypoint_age_ms`); -const py = $$9(`workflow.route.module_body_init_ms`); -const my = $$9(`step.name`); -const hy = $$9(`step.id`); -const gy = $$9(`step.attempt`); -const _y = $$9(`step.status`); -const vy = $$9(`step.max_retries`); -const yy = $$9(`step.skipped`); -const by = $$9(`step.skip_reason`); -const xy = $$9(`step.arguments.count`); -const Sy = $$9(`step.result.type`); -const Cy = $$9(`step.error.name`); -const wy = $$9(`step.error.message`); -const Ty = $$9(`step.fatal_error`); -const Ey = $$9(`step.retry.exhausted`); -const Dy = $$9(`step.retry.timeout_seconds`); -const Oy = $$9(`step.retry.will_retry`); -const ky = $$9(`messaging.system`); -const Ay = $$9(`messaging.destination.name`); -const jy = $$9(`messaging.message.id`); -const My = $$9(`messaging.operation.type`); -const Ny = $$9(`workflow.queue.overhead_ms`); -const Py = $$9(`deployment.id`); -const Fy = $$9(`workflow.hook.token`); -const Iy = $$9(`workflow.hook.id`); -const Ly = $$9(`workflow.hook.found`); -const Ry = $$9(`workflow.suspension.state`); -const zy = $$9(`workflow.suspension.hook_count`); -const By = $$9(`workflow.suspension.step_count`); -const Vy = $$9(`workflow.suspension.wait_count`); -const Hy = $$9(`http.request.method`); -const Uy = $$9(`http.route`); -const Wy = $$9(`http.response.status_code`); -const Gy = $$9(`error.type`); -const Ky = $$9(`workflow.events.pages_loaded`); -const qy = $$9(`workflow.queue.deserialize_time_ms`); -const Jy = $$9(`workflow.queue.execution_time_ms`); -const Yy = $$9(`workflow.queue.serialize_time_ms`); -const Xy = $$9(`workflow.serialization.operation`); -const Zy = $$9(`workflow.serialization.compressed`); -const Qy = $$9(`workflow.serialization.codec`); -const $y = $$9(`workflow.serialization.uncompressed_bytes`); -const eb = $$9(`workflow.serialization.stored_bytes`); -const tb = $$9(`workflow.serialization.compression_ratio`); -const nb = $$9(`peer.service`); -const rb = $$9(`rpc.system`); -const ib = $$9(`rpc.service`); -const ab = $$9(`rpc.method`); -const ob = $$9(`error.retryable`); -const sb = $$9(`error.category`); -const cb = /* @__PURE__ */ new Set(); -function lb() { - let e = process.env.WORKFLOW_TRACE_MODE; - return e === `continuous` ? `continuous` : (e && e !== `linked` && !cb.has(e) && (cb.add(e), Ab.warn(`Unrecognized WORKFLOW_TRACE_MODE value "${e}"; expected "linked" or "continuous". Falling back to "linked".`)), `linked`); -} -function ub(e) { - return e !== void 0 && Object.keys(e).length > 0; -} -function db(e, t) { - return e === `linked` && ub(t) ? Promise.resolve(t) : pb(); -} -async function fb(e, t) { - if (e !== `linked`) return wb(); - let n = await Tb(ub(t) ? t : void 0); - return n ? [n] : void 0; -} -async function pb() { - let e = await gb.value; - if (!e) return {}; - let t = {}; - return e.propagation.inject(e.context.active(), t), t; -} -async function mb(e) { - let t = await gb.value; - if (t) return t.propagation.extract(t.context.active(), e); -} -async function hb(e, t) { - if (!e) return t(); - let n = await gb.value; - if (!n) return t(); - let r = await mb(e); - return r ? n.context.with(r, async () => await t()) : t(); -} -const gb = p$12(async () => { - try { - return await Promise.resolve().then(() => src_CQuMexnO_exports).then((t) => d$13(t.t(), 1)); - } catch { - return Ab.info(`OpenTelemetry not available, tracing will be disabled`), null; - } -}); -const _b = p$12(async () => { - let e = await gb.value; - return e ? e.trace.getTracer(`workflow`) : null; -}); -async function vb(e, ...t) { - let [n, r] = await Promise.all([_b.value, gb.value]), { fn: i, opts: a } = typeof t[0] == `function` ? { - fn: t[0], - opts: {} - } : { - fn: t[1], - opts: t[0] - }; - if (!i) throw Error(`Function to trace must be provided`); - return !n || !r ? await i() : n.startActiveSpan(e, a, async (e) => { - try { - let t = await i(e); - return e.setStatus({ code: r.SpanStatusCode.OK }), t; - } catch (t) { - throw e.setStatus({ - code: r.SpanStatusCode.ERROR, - message: t.message - }), yb(t, r, e), t; - } finally { - e.end(); - } - }); -} -function yb(e, t, n) { - !e || !Wv.is(e) || (n.setStatus({ code: t.SpanStatusCode.OK }), n.setAttributes({ - ...Ry(`suspended`), - ...By(e.stepCount), - ...zy(e.hookCount), - ...Vy(e.waitCount) - })); -} -async function bb(e) { - let [t, n] = await Promise.all([mb(e), gb.value]); - if (!(!t || !n)) return n.trace.getSpanContext(t); -} -async function xb() { - return await Cb((e) => e.trace.getActiveSpan()); -} -async function Sb(e) { - return Cb((t) => t.SpanKind[e]); -} -async function Cb(e) { - let t = await gb.value; - if (t) return await e(t); -} -function wb() { - return Cb((e) => { - let t = e.trace.getActiveSpan()?.spanContext(); - if (t) return [{ context: t }]; - }); -} -async function Tb(e) { - if (!e) return; - let [t, n] = await Promise.all([bb(e), gb.value]); - if (!(!t || !n) && n.trace.isSpanContextValid(t)) return { context: t }; -} -async function Eb(e, t) { - let n = await gb.value; - if (!n) return t(); - let r = n.propagation.createBaggage({ - "workflow.run_id": { value: e.workflowRunId }, - "workflow.name": { value: e.workflowName } - }), i = n.propagation.setBaggage(n.context.active(), r); - return n.context.with(i, () => t()); -} -function Db(e, t) { - if (!t) return !1; - let n = !1; - for (let r of t.split(`,`)) { - let t = r.trim(); - if (!t) continue; - let i = t.startsWith(`-`), a = i ? t.slice(1) : t; - RegExp(`^${a.replace(/[|\\{}()[\]^$+?.]/g, `\\$&`).replace(/\*/g, `.*`)}$`).test(e) && (n = !i); - } - return n; -} -function Ob(e, t = {}) { - let n = (r) => { - let i = (n) => t.debugNamespace ?? `workflow:${e}:${n}`, a = (t) => { - let n = i(t); - return (i, a) => { - let o = Object.keys(r).length > 0, s = a && Object.keys(a).length > 0, c = o || s ? { - ...r, - ...a ?? {} - } : void 0; - (t === `error` || t === `warn`) && (t === `error` ? console.error : console.warn)(Iv(`[workflow-sdk]`, i, c)), Db(n, process.env.DEBUG) && (console.debug(`[${n}] ${i}`, c ?? ``), xb().then((n) => { - n?.addEvent(`${t}.${e}`, { - message: i, - ...c - }); - }).catch(() => {})); - }; - }; - return { - debug: a(`debug`), - info: a(`info`), - warn: a(`warn`), - error: a(`error`), - child: (e) => n({ - ...r, - ...e - }), - forRun: (e, t, i) => n({ - ...r, - workflowRunId: e, - ...t === void 0 ? {} : { workflowName: t }, - ...i ?? {} - }) - }; - }; - return n({}); -} -const kb = Ob(`step`); -const Ab = Ob(`runtime`); -const jb = Ob(`webhook`); -const Mb = Ob(`events`); -Ob(`adapter`), Ob(`build`, { debugNamespace: `workflow:build` }); -function Nb(e) { - if (p$11.is(e)) throw e; -} -function Pb(e, t) { - let n = e.includes(`return value`) ? `returning` : `passing`, r = `Failed to serialize ${e}`; - t instanceof qg$1 && t.path && (r += ` at path "${t.path}"`); - let i = `Ensure you're ${n} workflow serializable types. Check the serialization docs to see what's serializable: https://workflow-sdk.dev/docs/foundations/serialization`; - return t instanceof qg$1 && t.value !== void 0 && Ab.error(`Serialization failed`, { - context: e, - problematicValue: t.value - }), { - message: r, - hint: i - }; -} -async function Fb(e, t, n) { - try { - let r = pv$1.serialize(e, `client`, n); - return Pv(await jv(gv$1(Q$9.DEVALUE_V1, r), n?.compression === !0, n?.compressionStats), t); - } catch (e) { - Nb(e); - let { message: t, hint: n } = Pb(`client value`, e); - throw new h$9(t, { - hint: n, - cause: e - }); - } -} -async function Ib(e, t, n) { - let r = await Mv(await Fv(e, t), n?.compressionStats); - if (!(r instanceof Uint8Array)) { - if (pv$1.deserializeLegacy) return pv$1.deserializeLegacy(r, `client`, n); - throw Error(`Cannot deserialize non-binary data without legacy support`); - } - let { format: i, payload: a } = vv$1(r); - if (i === Q$9.DEVALUE_V1) return pv$1.deserialize(a, `client`, n); - throw Error(`Unsupported serialization format: ${i}`); -} -async function Lb(e, t, n) { - try { - let r = pv$1.serialize(e, `step`, n); - return Pv(await jv(gv$1(Q$9.DEVALUE_V1, r), n?.compression === !0, n?.compressionStats), t); - } catch (e) { - Nb(e); - let { message: t, hint: n } = Pb(`step value`, e); - throw new h$9(t, { - hint: n, - cause: e - }); - } -} -async function Rb(e, t, n) { - let r = await Mv(await Fv(e, t), n?.compressionStats); - if (!(r instanceof Uint8Array)) { - if (pv$1.deserializeLegacy) return pv$1.deserializeLegacy(r, `step`, n); - throw Error(`Cannot deserialize non-binary data without legacy support`); - } - let { format: i, payload: a } = vv$1(r); - if (i === Q$9.DEVALUE_V1) return pv$1.deserialize(a, `step`, n); - throw Error(`Unsupported serialization format: ${i}`); -} -function zb(e, t) { - if (!(e instanceof Uint8Array)) { - if (pv$1.deserializeLegacy) return pv$1.deserializeLegacy(e, `workflow`, t); - throw Error(`Cannot deserialize non-binary data without legacy support`); - } - let { format: n, payload: r } = vv$1(e); - if (n === Q$9.DEVALUE_V1) return pv$1.deserialize(r, `workflow`, t); - throw Error(`Unsupported serialization format: ${n}`); -} -const Bb = Symbol.for(`WORKFLOW_STEP_CONTEXT_STORAGE`); -const Vb = globalThis[Bb] ?? (globalThis[Bb] = new AsyncLocalStorage()); -function Hb(e, t, n) { - if (e === 0 && t === 0 && n === 0) return null; - let r = []; - e > 0 && r.push(`${e} ${n$11(`step`, `steps`, e)}`), t > 0 && r.push(`${t} ${n$11(`hook`, `hooks`, t)}`), n > 0 && r.push(`${n} ${n$11(`timer`, `timers`, n)}`); - let i = []; - e > 0 && i.push(`steps are completed`), t > 0 && i.push(`hooks are received`), n > 0 && i.push(`timers have elapsed`); - let o = i.join(` and `); - return `${r.join(` and `)} to be enqueued\n Workflow will suspend and resume when ${o}`; -} -function Ub(e, t) { - let n = `${e.replace(`wrun_`, `strm_`)}_user`; - return t ? `${n}_${Buffer.from(t, `utf-8`).toString(`base64url`)}` : n; -} -function Wb(e) { - return `strm_${e}_system_abort`; -} -function Gb(e) { - if (!e.startsWith(`abrt_`)) throw Error(`Invalid abort hook token format: expected "abrt_" prefix, got "${e}"`); - return Wb(e.slice(5)); -} -var Kb; -(function(e) { - e[e.Consumed = 0] = `Consumed`, e[e.NotConsumed = 1] = `NotConsumed`, e[e.Finished = 2] = `Finished`; -})(Kb ||= {}); -var qb = class { - eventIndex; - events = []; - callbacks = []; - onConsumedEvent; - onUnconsumedEvent; - getPromiseQueue; - pendingUnconsumedCheck = null; - pendingUnconsumedTimeout = null; - unconsumedCheckVersion = 0; - constructor(e, t) { - this.events = e, this.eventIndex = 0, this.onConsumedEvent = t.onConsumedEvent, this.onUnconsumedEvent = t.onUnconsumedEvent, this.getPromiseQueue = t.getPromiseQueue; - } - subscribe(e) { - this.callbacks.push(e), this.pendingUnconsumedCheck !== null && (this.unconsumedCheckVersion++, this.pendingUnconsumedCheck = null, this.pendingUnconsumedTimeout !== null && (clearTimeout(this.pendingUnconsumedTimeout), this.pendingUnconsumedTimeout = null)), process.nextTick(this.consume); - } - notifyConsumedEvent(e) { - if (this.onConsumedEvent) try { - this.onConsumedEvent(e); - } catch (e) { - Mb.error(`onConsumedEvent callback threw an error`, { error: e }); - } - } - consume = () => { - for (;;) { - let e = this.events[this.eventIndex] ?? null; - if (!this.consumeOne(e)) { - this.handleUnconsumed(e); - return; - } - } - }; - consumeOne(e) { - for (let t = 0; t < this.callbacks.length; t++) { - let n = this.callbacks[t], r = Kb.NotConsumed; - try { - r = n(e); - } catch (e) { - Mb.error(`EventConsumer callback threw an error`, { error: e }); - } - if (!(r !== Kb.Consumed && r !== Kb.Finished)) return e !== null && this.notifyConsumedEvent(e), this.eventIndex++, r === Kb.Finished && this.callbacks.splice(t, 1), e !== null; - } - return !1; - } - handleUnconsumed(e) { - if (e !== null) { - let t = ++this.unconsumedCheckVersion; - this.pendingUnconsumedCheck = this.getPromiseQueue().then(() => new Promise((e) => setTimeout(e, 0))).then(() => this.getPromiseQueue()).then(() => { - this.pendingUnconsumedTimeout = setTimeout(() => { - this.pendingUnconsumedTimeout = null, this.unconsumedCheckVersion === t && (this.pendingUnconsumedCheck = null, this.onUnconsumedEvent(e)); - }, 100); - }); - } - } -}; -var Jb = class { - aborted = !1; - reason = void 0; - [X$10]; - [Z$9]; - #e = []; - #t = null; - get onabort() { - return this.#t; - } - set onabort(e) { - this.#t = e, e && this.aborted && e.call(this); - } - constructor(e, t) { - this[X$10] = e, this[Z$9] = t; - } - _setAborted(e) { - if (!this.aborted) { - this.aborted = !0, this.reason = e, this.#t && this.#t.call(this); - for (let e of this.#e) e(); - this.#e = []; - } - } - addEventListener(e, t) { - if (e === `abort`) { - if (this.aborted) { - t(); - return; - } - this.#e.push(t); - } - } - removeEventListener(e, t) { - e === `abort` && (this.#e = this.#e.filter((e) => e !== t)); - } - throwIfAborted() { - if (this.aborted) throw this.reason ?? new DOMException(`The operation was aborted.`, `AbortError`); - } -}; -function Yb(e) { - return class { - signal; - [X$10]; - [Z$9]; - constructor() { - let t = e.generateUlid(), n = Wb(t), r = `abrt_${t}`; - this[X$10] = n, this[Z$9] = r, this.signal = new Jb(n, r); - let i = `hook_${e.generateUlid()}`; - e.invocationsQueue.set(i, { - type: `hook`, - correlationId: i, - token: r, - isWebhook: !1, - isSystem: !0 - }), e.eventsConsumer.subscribe((t) => { - if (!t || t.correlationId !== i) return Kb.NotConsumed; - let n = `eventData` in t && t.eventData && `token` in t.eventData ? t.eventData.token : void 0; - if (typeof n == `string` && n !== this[Z$9]) return e.promiseQueue = e.promiseQueue.then(() => { - e.onWorkflowError(new f$8(`Replay divergence: abort hook event ${t.eventType} for ${i} belongs to token "${n}", but the current abort hook expects "${this[Z$9]}"`, { eventId: t.eventId })); - }), Kb.Finished; - if (t.eventType === `hook_created`) { - let t = e.invocationsQueue.get(i); - return t && t.type === `hook` && (t.hasCreatedEvent = !0), Kb.Consumed; - } - if (t.eventType === `hook_received`) { - let n = t.eventData?.payload; - return e.pendingDeliveries++, e.promiseQueue = e.promiseQueue.then(async () => { - let t; - try { - if (n !== void 0) try { - let r = await zx(n, e.runId, e.encryptionKey, e.globalThis); - r && typeof r == `object` && `reason` in r && (t = r.reason); - } catch {} - this.signal._setAborted(t); - } finally { - e.pendingDeliveries--; - } - }), e.invocationsQueue.delete(i), Kb.Consumed; - } - return t.eventType === `hook_disposed` ? (e.invocationsQueue.delete(i), Kb.Finished) : Kb.NotConsumed; - }); - } - abort(t) { - if (!this.signal.aborted) { - this.signal._setAborted(t); - for (let [, n] of e.invocationsQueue) if (n.type === `hook` && n.token === this[Z$9]) { - n.abortRequested = !0, n.abortReason = t; - break; - } - } - } - }; -} -function Xb() { - return { - abort(e) { - let t = new Jb(``, ``); - return t._setAborted(e ?? new DOMException(`The operation was aborted.`, `AbortError`)), t; - }, - any(e) { - let t = new Jb(``, ``), n = Array.from(e); - for (let e of n) if (e.aborted) return t._setAborted(e.reason), t; - let r = [], i = () => { - for (let { signal: e, listener: t } of r) e.removeEventListener && e.removeEventListener(`abort`, t); - r.length = 0; - }; - for (let e of n) { - if (!e.addEventListener) continue; - let n = () => { - t.aborted || (t._setAborted(e.reason), i()); - }; - r.push({ - signal: e, - listener: n - }), e.addEventListener(`abort`, n); - } - return t; - }, - timeout() { - throw Error(`AbortSignal.timeout() is not supported in workflow functions. Use sleep() with an AbortController instead. See: /docs/errors/abort-signal-timeout-in-workflow`); - } - }; -} -const Zb = Ih$1(); -function Qb(e) { - try { - return e.getReader({ mode: `byob` }).releaseLock(), `bytes`; - } catch {} -} -function $b(e) { - return Nb(e), e instanceof h$9 && e.cause !== void 0 || e instanceof u$10 && e.cause !== void 0 ? e.cause : e; -} -async function ex(e, t) { - if (e.recorded) try { - let n = await xb(); - if (!n) return; - let r = e.uncompressedBytes ?? 0, i = e.storedBytes ?? 0; - n.setAttributes({ - ...Xy(t), - ...Zy(e.compressed ?? !1), - ...Qy(e.codec ?? `none`), - ...$y(r), - ...eb(i), - ...e.compressed && r > 0 ? tb(1 - i / r) : {} - }); - } catch {} -} -function tx(e, t) { - let n = new TextEncoder(), r = { - resolved: !1, - key: void 0 - }; - return new TransformStream({ async transform(i, a) { - try { - r.resolved ||= (r.key = await Nv(t), !0); - let o = l_$1(i, e), s = n.encode(o), c = gv$1(Q$9.DEVALUE_V1, s); - if (r.key) { - let e = await m_$1(r.key, c); - c = gv$1(Q$9.ENCRYPTED, e); - } - let l = new Uint8Array(4 + c.length); - new DataView(l.buffer).setUint32(0, c.length, !1), l.set(c, 4), a.enqueue(l); - } catch (e) { - if (p$11.is(e)) { - a.error(e); - return; - } - let { message: t, hint: n } = Pb(`stream chunk`, e); - a.error(new h$9(t, { - hint: n, - cause: e - })); - } - } }); -} -function nx(e, t) { - let n = new TextDecoder(), r = /* @__PURE__ */ new Uint8Array(), i = { - resolved: !1, - key: void 0 - }; - function a(e) { - let t = new Uint8Array(r.length + e.length); - t.set(r, 0), t.set(e, r.length), r = t; - } - async function o(a) { - for (i.resolved ||= (i.key = await Nv(t), !0); r.length >= 4;) { - let t = new DataView(r.buffer, r.byteOffset, r.byteLength).getUint32(0, !1); - if (r.length < 4 + t) break; - let o = r.slice(4, 4 + t); - r = r.slice(4 + t); - let { format: s, payload: c } = vv$1(o); - if (s === Q$9.ENCRYPTED) { - if (!i.key) { - a.error(new p$11(`Encrypted stream data encountered but no encryption key is available. Encryption is not configured or no key was provided for this run.`, { context: { - operation: `decrypt`, - byteLength: c.byteLength, - formatPrefix: `encr` - } })); - return; - } - let e; - try { - e = await h_$1(i.key, c); - } catch (e) { - throw p$11.is(e) && e.context && (e.context.formatPrefix = s), e; - } - ({format: s, payload: c} = vv$1(e)); - } - if (s === Q$9.DEVALUE_V1) { - let t = n.decode(c); - a.enqueue(s_$1(t, e)); - } - } - } - return new TransformStream({ - async transform(t, i) { - if (r.length === 0 && t.length >= 4) { - let e = new DataView(t.buffer, t.byteOffset, t.byteLength).getUint32(0, !1); - if (e > 0 && e < 1e8) { - a(t), await o(i); - return; - } - } else if (r.length > 0) { - a(t), await o(i); - return; - } - let s = n.decode(t).split(` -`); - for (let t of s) t.length > 0 && i.enqueue(s_$1(t, e)); - }, - async flush(e) { - r.length > 0 && await o(e); - } - }); -} -const rx = 1e8; -function ix() { - return new TransformStream({ transform(e, t) { - if (e.length === 0) return; - if (e.length > rx) { - t.error(new u$10(`Byte-stream chunk of ${e.length} bytes exceeds the maximum framed chunk size (${rx}). Split the data into smaller chunks before writing.`, { slug: `serialization-failed` })); - return; - } - let n = new Uint8Array(4 + e.length); - new DataView(n.buffer).setUint32(0, e.length, !1), n.set(e, 4), t.enqueue(n); - } }); -} -function ax() { - let e = /* @__PURE__ */ new Uint8Array(); - function t(t) { - let n = new Uint8Array(e.length + t.length); - n.set(e, 0), n.set(t, e.length), e = n; - } - return new TransformStream({ - transform(n, r) { - for (n.length > 0 && t(n); e.length >= 4;) { - let t = new DataView(e.buffer, e.byteOffset, e.byteLength).getUint32(0, !1); - if (t > rx) { - r.error(new u$10(`Byte-stream frame length ${t} exceeds maximum (${rx}). This usually means a non-framed byte stream is being read as framed.`, { slug: `serialization-failed` })); - return; - } - let n = 4 + t; - if (e.length < n) break; - r.enqueue(e.slice(4, n)), e = e.slice(n); - } - }, - flush(t) { - e.length > 0 && t.error(new u$10(`Byte-stream ended with ${e.length} bytes of incomplete frame data. The stream was truncated mid-frame.`, { slug: `serialization-failed` })); - } - }); -} -var ox = class extends ReadableStream { - #e; - constructor(e, t, n) { - if (typeof t != `string` || t.length === 0) throw new u$10(`"name" is required, got "${t}"`); - super({ - type: `bytes`, - pull: async (r) => { - let i = this.#e; - if (!i) { - let r = await (await T_$1()).streams.get(e, t, n); - i = this.#e = r.getReader(); - } - if (!i) { - r.error(Error(`Failed to get reader`)); - return; - } - let a = await i.read(); - a.done ? (this.#e = void 0, r.close()) : r.enqueue(a.value); - }, - cancel: async (e) => { - this.#e &&= (await this.#e.cancel(e).catch(() => {}), void 0); - } - }); - } -}; -function sx(e, t, n) { - let r = n === void 0 || n >= 0, i = n ?? 0, a = 0, o = 0, s = 0, c, l = /* @__PURE__ */ new Uint8Array(); - async function u() { - let o = await T_$1(), s = r ? i + a : n; - c = (await o.streams.get(e, t, s)).getReader(); - } - async function d() { - for (c &&= (await c.cancel().catch(() => {}), void 0), i += a, a = 0, l = /* @__PURE__ */ new Uint8Array();;) { - if (o++, s++, o > 50) throw Error(`Stream "${t}" exceeded maximum reconnection attempts (50)`); - if (s > 1e3) throw Error(`Stream "${t}" exceeded maximum total reconnection attempts (1000)`); - try { - await u(); - return; - } catch {} - } - } - return new ReadableStream({ - pull: async (e) => { - for (;;) { - if (!c) try { - await u(); - } catch (t) { - e.error(t); - return; - } - let t; - try { - t = await c.read(); - } catch (t) { - if (!r) { - e.error(t); - return; - } - try { - await d(); - } catch (t) { - e.error(t); - return; - } - continue; - } - if (t.done || !t.value) { - c = void 0, e.close(); - return; - } - let n = t.value; - if (n.length > 0) { - let e = new Uint8Array(l.length + n.length); - e.set(l, 0), e.set(n, l.length), l = e; - } - let i = !1; - for (; l.length >= 4;) { - let t = 4 + new DataView(l.buffer, l.byteOffset, l.byteLength).getUint32(0, !1); - if (l.length < t) break; - e.enqueue(l.slice(0, t)), l = l.slice(t), a++, i = !0; - } - if (i) { - o = 0; - return; - } - } - }, - cancel: async () => { - c &&= (await c.cancel().catch((e) => { - console.warn(`Error closing ReadableStream reader:`, e); - }), void 0); - } - }); -} -var cx = class extends WritableStream { - constructor(e, t) { - if (typeof e != `string`) throw new u$10(`"runId" must be a string, got "${typeof e}"`); - if (typeof t != `string` || t.length === 0) throw new u$10(`"name" is required, got "${t}"`); - let n = T_$1(), r = [], i = null, a = null, o, s = async () => { - if (i &&= (clearTimeout(i), null), r.length === 0) return; - let a = r.slice(), s = await n; - if (o === void 0 && (o = s.streamFlushIntervalMs ?? 10), typeof s.streams.writeMulti == `function` && a.length > 1) await s.streams.writeMulti(e, t, a); - else for (let n of a) await s.streams.write(e, t, n); - r = []; - }, c = [], l = () => { - i ||= setTimeout(() => { - i = null; - let e = c; - c = [], a = s().then(() => { - for (let t of e) t.resolve(); - }, (t) => { - for (let n of e) n.reject(t); - }); - }, o ?? 10); - }; - super({ - async write(e) { - a &&= (await a, null), r.push(e), l(), await new Promise((e, t) => { - c.push({ - resolve: e, - reject: t - }); - }); - }, - async close() { - a &&= (await a, null), await s(), await (await n).streams.close(e, t); - }, - abort(e) { - i &&= (clearTimeout(i), null), r = []; - let t = c; - c = []; - let n = e ?? Error(`Stream aborted`); - for (let e of t) e.reject(n); - } - }); - } -}; -function lx(e = globalThis) { - return { - ...J_$1(), - ...ov$1(), - ...iv$1(e), - Request: (t) => { - if (!(t instanceof e.Request)) return !1; - let n = { - method: t.method, - url: t.url, - headers: t.headers, - body: t.body, - duplex: t.duplex - }, r = t[B_$1]; - return r && (n.responseWritable = r), t.signal && (t.signal.aborted || t.signal[X$10]) && (n.signal = t.signal), n; - }, - Response: (t) => t instanceof e.Response ? { - type: t.type, - url: t.url, - status: t.status, - statusText: t.statusText, - headers: t.headers, - body: t.body, - redirected: t.redirected - } : !1 - }; -} -function ux(e, t, n, r, i, a) { - let o = t[X$10], s = t[Z$9]; - if (!o) { - let e = (n[N_$1] || Zb)(); - o = Wb(e), s = `abrt_${e}`, t[X$10] = o, t[Z$9] = s, t.signal && (t.signal[X$10] = o, t.signal[Z$9] = s); - } - return fx(e, o, i, a, r), { - streamName: o, - hookToken: s, - aborted: e.aborted, - reason: e.aborted ? e.reason : void 0 - }; -} -function dx(e, t) { - let n = t[X$10] ?? t.signal?.[X$10], r = t[Z$9] ?? t.signal?.[Z$9]; - if (!n) throw Error(`AbortController/AbortSignal stream name is not set`); - return { - streamName: n, - hookToken: r, - aborted: e.aborted, - reason: e.aborted ? e.reason : void 0 - }; -} -function fx(e, t, n, r, i) { - e.aborted || e[H_$1] || (e[H_$1] = !0, e.addEventListener(`abort`, () => { - i.push((async () => { - try { - let i = await Nv(r), a = await Mx({ - aborted: !0, - reason: e.reason - }, n, i), o = new cx(n, t).getWriter(); - await o.write(a), await o.close(); - } catch {} - })()); - }, { once: !0 })); -} -function px(e = globalThis, t, n, r, i = !1) { - return { - ...lx(e), - ReadableStream: (a) => { - if (!(a instanceof e.ReadableStream)) return !1; - if (a.locked) throw new h$9(`ReadableStream is locked and cannot be passed across a workflow boundary.`, { hint: `Pass the stream before calling .getReader() / .pipeThrough() / .pipeTo(), or tee it with .tee() and pass one of the branches.` }); - let o = `strm_${(e[N_$1] || Zb)()}`, s = Qb(a), c = new cx(n, o); - s === `bytes` ? i ? t.push(a.pipeThrough(ix()).pipeTo(c)) : t.push(a.pipeTo(c)) : t.push(a.pipeThrough(tx(px(e, t, n, r, i), r)).pipeTo(c)); - let l = { name: o }; - return s && (l.type = s), s === `bytes` && i && (l.framing = `framed-v1`), l; - }, - WritableStream: (r) => { - if (!(r instanceof e.WritableStream)) return !1; - let i = r[P_$1], a = r[L_$1]; - if (typeof i == `string` && typeof a == `string`) { - let e = { - name: i, - runId: a - }, t = r[R_$1]; - return typeof t == `string` && (e.deploymentId = t), e; - } - let o = `strm_${(e[N_$1] || Zb)()}`, s = new ox(n, o); - return t.push(s.pipeTo(r)), { name: o }; - }, - AbortController: (i) => !e.AbortController || typeof e.AbortController != `function` || !(i instanceof e.AbortController) ? !1 : ux(i.signal, i, e, t, n, r), - AbortSignal: (i) => !e.AbortSignal || typeof e.AbortSignal != `function` || !(i instanceof e.AbortSignal) ? !1 : ux(i, i, e, t, n, r) - }; -} -function mx(e = globalThis) { - return { - ...lx(e), - ReadableStream: (t) => { - if (!(t instanceof e.ReadableStream)) return !1; - let n = t[z_$1]; - if (n !== void 0) return { bodyInit: n }; - let r = t[P_$1]; - if (!r) throw new u$10("ReadableStream `name` is not set"); - let i = { name: r }, a = t[F_$1]; - a && (i.type = a); - let o = t[I_$1]; - return o && (i.framing = o), i; - }, - WritableStream: (t) => { - if (!(t instanceof e.WritableStream)) return !1; - let n = t[P_$1]; - if (!n) throw new u$10("WritableStream `name` is not set"); - let r = { name: n }, i = t[L_$1]; - typeof i == `string` && (r.runId = i); - let a = t[R_$1]; - return typeof a == `string` && (r.deploymentId = a), r; - }, - AbortController: (t) => { - if (!t || !t.signal) return !1; - let n = t, r = n[X$10] ?? n.signal?.[X$10], i = e.AbortController && typeof e.AbortController == `function` && t instanceof e.AbortController; - return !r && !i ? !1 : dx(t.signal, n); - }, - AbortSignal: (t) => { - let n = t?.[X$10], r = e.AbortSignal && typeof e.AbortSignal == `function` && t instanceof e.AbortSignal; - return !n && !r ? !1 : dx(t, t); - } - }; -} -function hx(e = globalThis, t, n, r, i = !1) { - return { - ...lx(e), - ReadableStream: (a) => { - if (!(a instanceof e.ReadableStream)) return !1; - if (a.locked) throw new h$9(`ReadableStream is locked and cannot be passed across a workflow boundary.`, { hint: `Pass the stream before calling .getReader() / .pipeThrough() / .pipeTo(), or tee it with .tee() and pass one of the branches.` }); - let o = a[P_$1], s = a[F_$1], c = a[I_$1]; - if (!o) { - o = `strm_${(e[N_$1] || Zb)()}`, s = Qb(a), c = s === `bytes` && i ? `framed-v1` : c; - let l = new cx(n, o); - s === `bytes` ? c === `framed-v1` ? t.push(a.pipeThrough(ix()).pipeTo(l)) : t.push(a.pipeTo(l)) : t.push(a.pipeThrough(tx(hx(e, t, n, r, i), r)).pipeTo(l)); - } - let l = { name: o }; - return s && (l.type = s), c && (l.framing = c), l; - }, - WritableStream: (i) => { - if (!(i instanceof e.WritableStream)) return !1; - let a = i[P_$1], o = i[L_$1]; - a || (a = `strm_${(e[N_$1] || Zb)()}`, t.push(new ox(n, a).pipeThrough(nx(Tx(e, t, n, r), r)).pipeTo(i))); - let s = { name: a }; - typeof o == `string` && (s.runId = o); - let c = i[R_$1]; - return typeof c == `string` && (s.deploymentId = c), s; - }, - AbortController: (i) => !e.AbortController || typeof e.AbortController != `function` || !(i instanceof e.AbortController) ? !1 : ux(i.signal, i, e, t, n, r), - AbortSignal: (i) => !e.AbortSignal || typeof e.AbortSignal != `function` || !(i instanceof e.AbortSignal) ? !1 : ux(i, i, e, t, n, r) - }; -} -function gx(e, t, n, r) { - let i = new AbortController(); - return r.push((async () => { - try { - let r = new ox(t, n).getReader(), a = await Promise.race([r.read(), new Promise((e) => { - if (i.signal.aborted) { - e({ - value: void 0, - done: !0 - }); - return; - } - i.signal.addEventListener(`abort`, () => e({ - value: void 0, - done: !0 - }), { once: !0 }); - })]); - if (r.releaseLock(), a.value && !a.done) try { - let n = Vb.getStore(), r = await Nx(a.value, t, n?.encryptionKey); - e.abort(r?.reason); - } catch { - e.abort(); - } - } catch {} - })()), i; -} -function _x(e, t, n) { - let r = e, i = e.signal; - r[X$10] = t.streamName, r[Z$9] = t.hookToken, i[X$10] = t.streamName, i[Z$9] = t.hookToken, n && (r[U_$1] = n, i[U_$1] = n); -} -function vx(e, t) { - let n = e, r = t; - n[X$10] !== void 0 && (r[X$10] = n[X$10]), n[Z$9] !== void 0 && (r[Z$9] = n[Z$9]), n[U_$1] !== void 0 && (r[U_$1] = n[U_$1]); -} -function yx(e, t, n) { - let r = new AbortController(); - e.aborted ? (_x(r, e), r.abort(e.reason)) : e.streamName ? _x(r, e, gx(r, n, e.streamName, t)) : _x(r, e); - let i = r.abort.bind(r); - return r.abort = (t) => { - if (r.signal.aborted) return; - i(t); - let n = Vb.getStore(); - if (n && (n.ops.push((async () => { - try { - let r = await Mx({ - aborted: !0, - reason: t - }, n.workflowMetadata.workflowRunId, n.encryptionKey), i = new cx(n.workflowMetadata.workflowRunId, e.streamName).getWriter(); - await i.write(r), await i.close(); - } catch {} - })()), e.hookToken)) { - let r = (async () => { - try { - let { resumeHook: n } = await Promise.resolve().then(() => resume_hook_CUCPW67D_exports).then((e) => e.i); - await n(e.hookToken, { - aborted: !0, - reason: t - }); - } catch {} - })(); - n.preCompletionOps.push(r); - } - }, r; -} -function bx(e, t, n) { - let r = new AbortController(); - return e.aborted ? (_x(r, e), r.abort(e.reason)) : e.streamName ? _x(r, e, gx(r, n, e.streamName, t)) : _x(r, e), r.signal; -} -function xx(e = globalThis) { - return { - ...Y_$1(e), - ...av$1(e) - }; -} -async function Sx(e, t) { - let n = await T_$1(); - if (!n.getEncryptionKeyForRun) return; - let r = t ? await n.getEncryptionKeyForRun(e, { deploymentId: t }) : await n.getEncryptionKeyForRun(await n.runs.get(e)); - return r ? await p_$1(r, [`encrypt`]) : void 0; -} -function Cx(e = globalThis, t, n, r) { - return { - ...xx(e), - StepFunction: () => { - throw new h$9(`Step functions cannot be deserialized in client context. Step functions should not be returned from workflows.`, { hint: `A step function reference reached the client. Return a serializable value (e.g. the step result) instead of the step itself.` }); - }, - WorkflowFunction: (e) => Object.assign(() => { - throw new h$9(`Workflow functions cannot be called directly. Use start() to invoke them.`, { hint: "Wrap the workflow with `start(workflowFn, { ... })` from `workflow` to begin a run instead of invoking it like a normal function." }); - }, { workflowId: e.workflowId }), - Request: (t) => { - let n = { - method: t.method, - headers: new e.Headers(t.headers), - body: t.body, - duplex: t.duplex - }; - t.signal && (n.signal = t.signal); - let r = new e.Request(t.url, n); - return t.signal && vx(t.signal, r.signal), r; - }, - Response: (t) => new e.Response(t.body, { - status: t.status, - statusText: t.statusText, - headers: new e.Headers(t.headers) - }), - ReadableStream: (i) => { - if (`bodyInit` in i) { - let t = i.bodyInit; - return new e.Response(t).body; - } - if (i.type === `bytes`) { - let r = new ox(n, i.name, i.startIndex), a = g_$1(); - t.push(a.promise); - let { readable: o, writable: s } = i.framing === `framed-v1` ? ax() : new e.TransformStream(); - return x_$1(r, s, a).catch(() => {}), b_$1(o, a), o; - } else { - let a = sx(n, i.name, i.startIndex), o = nx(Cx(e, t, n, r), r), s = g_$1(); - return t.push(s.promise), x_$1(a, o.writable, s).catch(() => {}), b_$1(o.readable, s), o.readable; - } - }, - WritableStream: (i) => { - let a = typeof i.runId == `string` ? i.runId : n, o = a === n ? r : Sx(a, i.deploymentId), s = tx(px(e, t, a, o), o), c = new cx(a, i.name), l = g_$1(); - return t.push(l.promise), x_$1(s.readable, c, l).catch(() => {}), y_$1(s.writable, l), Object.defineProperty(s.writable, P_$1, { - value: i.name, - writable: !1 - }), Object.defineProperty(s.writable, L_$1, { - value: a, - writable: !1 - }), typeof i.deploymentId == `string` && Object.defineProperty(s.writable, R_$1, { - value: i.deploymentId, - writable: !1 - }), s.writable; - }, - AbortController: (e) => yx(e, t, n), - AbortSignal: (e) => bx(e, t, n) - }; -} -function wx(e = globalThis) { - return { - ...xx(e), - ...sv$1(e), - Request: (t) => { - Object.setPrototypeOf(t, e.Request.prototype); - let n = t.responseWritable; - return n && (t[B_$1] = n, delete t.responseWritable, t.respondWith = () => { - throw new h$9("`respondWith()` must be called from within a step function.", { hint: "Move the `respondWith(...)` call inside a `\"use step\"` function — it cannot be invoked from a workflow context." }); - }), t; - }, - WorkflowFunction: (e) => Object.assign(() => { - throw new h$9(`Workflow functions cannot be called directly. Use start() to invoke them.`, { hint: "Wrap the workflow with `start(workflowFn, { ... })` from `workflow` to begin a run instead of invoking it like a normal function." }); - }, { workflowId: e.workflowId }), - Response: (t) => (Object.setPrototypeOf(t, e.Response.prototype), t), - ReadableStream: (t) => `bodyInit` in t ? Object.create(e.ReadableStream.prototype, { [z_$1]: { - value: t.bodyInit, - writable: !1 - } }) : Object.create(e.ReadableStream.prototype, { - [P_$1]: { - value: t.name, - writable: !1 - }, - [F_$1]: { - value: t.type, - writable: !1 - }, - [I_$1]: { - value: t.framing, - writable: !1 - } - }), - WritableStream: (t) => { - let n = { [P_$1]: { - value: t.name, - writable: !1 - } }; - return typeof t.runId == `string` && (n[L_$1] = { - value: t.runId, - writable: !1 - }), typeof t.deploymentId == `string` && (n[R_$1] = { - value: t.deploymentId, - writable: !1 - }), Object.create(e.WritableStream.prototype, n); - }, - AbortController: (e) => { - let t = new Jb(e.streamName, e.hookToken); - return e.aborted && t._setAborted(e.reason), { - [X$10]: e.streamName, - [Z$9]: e.hookToken, - signal: t, - abort: () => {} - }; - }, - AbortSignal: (e) => { - let t = new Jb(e.streamName, e.hookToken); - return e.aborted && t._setAborted(e.reason), t; - } - }; -} -function Tx(e = globalThis, t, n, r, i) { - return { - ...xx(e), - StepFunction: (e) => { - let t = e.stepId, n = e.closureVars, r = `boundThis` in e, i = r ? e.boundThis : void 0, a = Array.isArray(e.boundArgs) ? e.boundArgs : [], o = c$8(t); - if (!o) throw new h$9(`Step function "${t}" not found. Make sure the step function is registered.`, { hint: `Make sure the step file is included in your build (i.e. it is listed in the workflow manifest), and that the SWC plugin is configured for the file.` }); - if (!n && !r && a.length === 0) return o; - let s = function(...e) { - let t = r ? i : this, s = a.length > 0 ? [...a, ...e] : e; - if (n) { - let e = Vb.getStore(); - if (!e) throw new u$10(`Cannot call step function with closure variables outside step context`); - let r = { - ...e, - closureVars: n - }; - return Vb.run(r, () => o.apply(t, s)); - } - return o.apply(t, s); - }; - return Object.defineProperty(s, "name", { value: o.name }), Object.defineProperty(s, "stepId", { - value: t, - writable: !1, - enumerable: !1, - configurable: !1 - }), o.maxRetries !== void 0 && (s.maxRetries = o.maxRetries), s; - }, - WorkflowFunction: (e) => Object.assign(() => { - throw new h$9(`Workflow functions cannot be called directly. Use start() to invoke them.`, { hint: "Wrap the workflow with `start(workflowFn, { ... })` from `workflow` to begin a run instead of invoking it like a normal function." }); - }, { workflowId: e.workflowId }), - Request: (t) => { - let n = t.responseWritable, r = { - method: t.method, - headers: new e.Headers(t.headers), - body: t.body, - duplex: t.duplex - }; - t.signal && (r.signal = t.signal); - let i = new e.Request(t.url, r); - return t.signal && vx(t.signal, i.signal), n && (i.respondWith = async (e) => { - let t = n.getWriter(); - await t.write(e), await t.close(); - }), i; - }, - Response: (t) => new e.Response(t.body, { - status: t.status, - statusText: t.statusText, - headers: new e.Headers(t.headers) - }), - ReadableStream: (a) => { - if (`bodyInit` in a) { - let t = a.bodyInit; - return new e.Response(t).body; - } - let o = new ox(n, a.name); - if (a.type === `bytes`) { - let n = g_$1(); - t.push(n.promise); - let { readable: r, writable: i } = a.framing === `framed-v1` ? ax() : new e.TransformStream(); - return x_$1(o, i, n).catch(() => {}), b_$1(r, n), r; - } else { - let a = nx(Tx(e, t, n, r, i), r), s = g_$1(); - return t.push(s.promise), x_$1(o, a.writable, s).catch(() => {}), b_$1(a.readable, s), a.readable; - } - }, - WritableStream: (a) => { - let o = typeof a.runId == `string` ? a.runId : n, s = typeof a.deploymentId == `string` ? a.deploymentId : o === n ? i : void 0, c = o === n ? r : Sx(o, s), l = tx(hx(e, t, o, c), c), u = new cx(o, a.name), d = g_$1(); - return t.push(d.promise), x_$1(l.readable, u, d).catch(() => {}), y_$1(l.writable, d), Object.defineProperty(l.writable, P_$1, { - value: a.name, - writable: !1 - }), Object.defineProperty(l.writable, L_$1, { - value: o, - writable: !1 - }), s && Object.defineProperty(l.writable, R_$1, { - value: s, - writable: !1 - }), l.writable; - }, - AbortController: (e) => yx(e, t, n), - AbortSignal: (e) => bx(e, t, n) - }; -} -async function Ex(e, t) { - return await Pv(e, t); -} -async function Dx(e, t) { - return Fv(e, t); -} -async function Ox(e, t, n, r = [], i = globalThis, a = !1, o = !1, s = !1) { - if (a) return $_$1(l_$1(e, px(i, r, t, n, o))); - try { - let a = {}, c = await Fb(e, n, { - global: i, - extraReducers: Vx(px(i, r, t, n, o)), - compression: s, - compressionStats: a - }); - return await ex(a, `serialize`), c; - } catch (e) { - let t = $b(e), { message: n, hint: r } = Pb(`workflow arguments`, t); - throw new h$9(n, { - hint: r, - cause: t - }); - } -} -async function kx(e, t, n, r = globalThis, i = {}) { - let a = {}, o = await Mv(await Dx(e, n), a); - return await ex(a, `deserialize`), zb(o, { - global: r, - extraRevivers: { - ...Hx(wx(r)), - ...i - } - }); -} -async function Ax(e, t, n, r = globalThis, i = !1, a = !1) { - if (i) return $_$1(l_$1(e, mx(r))); - try { - let t = {}, i = await Lb(e, n, { - global: r, - extraReducers: Vx(mx(r)), - compression: a, - compressionStats: t - }); - return await ex(t, `serialize`), i; - } catch (e) { - let t = $b(e), { message: n, hint: r } = Pb(`workflow return value`, t); - throw new h$9(n, { - hint: r, - cause: t - }); - } -} -async function jx(e, t, n, r = [], i = globalThis, a = {}) { - let o = {}, s = await Ib(e, n, { - global: i, - extraRevivers: { - ...Hx(Cx(i, r, t, n)), - ...a - }, - compressionStats: o - }); - return await ex(o, `deserialize`), s; -} -async function Mx(e, t, n, r = globalThis, i = !1, a = !1) { - if (i) return $_$1(l_$1(e, mx(r))); - try { - let t = {}, i = await Lb(e, n, { - global: r, - extraReducers: Vx(mx(r)), - compression: a, - compressionStats: t - }); - return await ex(t, `serialize`), i; - } catch (e) { - let t = $b(e), { message: n, hint: r } = Pb(`step arguments`, t); - throw new h$9(n, { - hint: r, - cause: t - }); - } -} -async function Nx(e, t, n, r = [], i = globalThis, a = {}, o) { - let s = {}, c = await Rb(e, n, { - global: i, - extraRevivers: { - ...Hx(Tx(i, r, t, n, o)), - ...a - }, - compressionStats: s - }); - return await ex(s, `deserialize`), c; -} -async function Px(e, t, n, r = [], i = globalThis, a = !1, o = !1, s = !1) { - if (a) return $_$1(l_$1(e, hx(i, r, t, n, o))); - try { - let a = {}, c = await Lb(e, n, { - global: i, - extraReducers: Vx(hx(i, r, t, n, o)), - compression: s, - compressionStats: a - }); - return await ex(a, `serialize`), c; - } catch (e) { - let t = $b(e), { message: n, hint: r } = Pb(`step return value`, t); - throw new h$9(n, { - hint: r, - cause: t - }); - } -} -async function Fx(e, t, n, r = [], i = globalThis, a = !1) { - try { - let o = l_$1(e, hx(i, r, t, n)), s = new TextEncoder().encode(o), c = gv$1(Q$9.DEVALUE_V1, s), l = {}, u = await Ex(await jv(c, a, l), n); - return await ex(l, `serialize`), u; - } catch (e) { - let t = $b(e), { message: n, hint: r } = Pb(`step error`, t); - throw new h$9(n, { - hint: r, - cause: t - }); - } -} -async function Ix(e, t, n, r = globalThis, i = {}) { - let a = {}, o = await Mv(await Dx(e, n), a); - if (await ex(a, `deserialize`), !(o instanceof Uint8Array)) return c_$1(o, { - ...wx(r), - ...i - }); - let { format: s, payload: c } = vv$1(o); - if (s === Q$9.DEVALUE_V1) return s_$1(new TextDecoder().decode(c), { - ...wx(r), - ...i - }); - throw Error(`Unsupported serialization format: ${s}`); -} -async function Lx(e, t, n, r = globalThis, i = !1) { - try { - let t = l_$1(e, mx(r)), a = new TextEncoder().encode(t), o = gv$1(Q$9.DEVALUE_V1, a), s = {}, c = await Ex(await jv(o, i, s), n); - return await ex(s, `serialize`), c; - } catch (e) { - let t = $b(e), { message: n, hint: r } = Pb(`run error`, t); - throw new h$9(n, { - hint: r, - cause: t - }); - } -} -async function Rx(e, t, n, r = [], i = globalThis, a = {}) { - let o = {}, s = await Mv(await Dx(e, n), o); - if (await ex(o, `deserialize`), !(s instanceof Uint8Array)) return c_$1(s, { - ...Cx(i, r, t, n), - ...a - }); - let { format: c, payload: l } = vv$1(s); - if (c === Q$9.DEVALUE_V1) return s_$1(new TextDecoder().decode(l), { - ...Cx(i, r, t, n), - ...a - }); - throw Error(`Unsupported serialization format: ${c}`); -} -async function zx(e, t, n, r = globalThis, i = {}) { - let a = {}, o = await Mv(await Dx(e, n), a); - return await ex(a, `deserialize`), zb(o, { - global: r, - extraRevivers: { - ...Hx(wx(r)), - ...i - } - }); -} -const Bx = [ - `ReadableStream`, - `WritableStream`, - `Request`, - `Response`, - `StepFunction`, - `AbortController`, - `AbortSignal` -]; -function Vx(e) { - let t = {}; - for (let n of Bx) n in e && (t[n] = e[n]); - return t; -} -function Hx(e) { - let t = {}; - for (let n of Bx) n in e && (t[n] = e[n]); - return t; -} -const Ux = [ - { - format: Q$9.ENCRYPTED, - minVersion: `4.2.0-beta.64` - }, - { - format: Q$9.GZIP, - minVersion: `5.0.0-beta.18` - }, - { - format: Q$9.ZSTD, - minVersion: `5.0.0-beta.18` - } -]; -const Wx = [{ - capability: `framedByteStreams`, - minVersion: `5.0.0-beta.15` -}]; -const Gx = /* @__PURE__ */ new Set([Q$9.DEVALUE_V1]); -function Kx(e) { - if (!e || !f_$1.default.valid(e)) return { - supportedFormats: Gx, - framedByteStreams: !1 - }; - let t = new Set(Gx); - for (let { format: n, minVersion: r } of Ux) f_$1.default.gte(e, r) && t.add(n); - let n = { - supportedFormats: t, - framedByteStreams: !1 - }; - for (let { capability: t, minVersion: r } of Wx) f_$1.default.gte(e, r) && (n[t] = !0); - return n; -} -const qx = `5.0.0-beta.24`; -const Jx = /^[a-zA-Z0-9_\-./@]+$/; -function Yx(e, t) { - if (!Jx.test(e)) throw Error(`Invalid workflow name "${e}": must only contain alphanumeric characters, underscores, hyphens, dots, forward slashes, or at signs`); - return `${ah$1(`workflow`, ih$1(t))}${e}`; -} -const Xx = Ih$1(); -function Zx(e) { - return `__health_check__${e}`; -} -function Qx(e) { - let t = fh$1.safeParse(e); - if (t.success) return t.data; -} -function $x(e) { - return `wrun_hc_${e}`; -} -async function eS(e, t, n) { - let r = await T_$1(), i = Zx(e.correlationId), a = JSON.stringify({ - healthy: !0, - endpoint: t, - correlationId: e.correlationId, - specVersion: n ?? 5, - workflowCoreVersion: qx, - timestamp: Date.now() - }), o = $x(e.correlationId); - await r.streams.write(o, i, a), await r.streams.close(o, i); -} -async function tS(e, t) { - let n = [], r = !1, i = !1; - for (; !r && !i;) { - let a = e.read(), o = new Promise((e) => setTimeout(() => { - i = !0, e({ - done: !0, - value: void 0 - }); - }, t)), s = await Promise.race([a, o]); - r = s.done, s.value && n.push(s.value); - } - return { - chunks: n, - timedOut: i - }; -} -function nS(e) { - if (e.length === 0) return null; - let t = e.reduce((e, t) => e + t.length, 0), n = new Uint8Array(t), r = 0; - for (let t of e) n.set(t, r), r += t.length; - let i = new TextDecoder().decode(n), a; - try { - a = JSON.parse(i); - } catch { - return i.length > 0 ? { healthy: !0 } : null; - } - if (typeof a != `object` || !a || !(`healthy` in a) || typeof a.healthy != `boolean`) return null; - let o = a, s = { healthy: o.healthy }; - return typeof o.specVersion == `number` && (s.specVersion = o.specVersion), typeof o.workflowCoreVersion == `string` && (s.workflowCoreVersion = o.workflowCoreVersion), s; -} -async function rS(e, t, n) { - let r = n?.timeout ?? 3e4, i = Xx(), a = Zx(i), o = `${ah$1(t, ih$1(n?.namespace))}health_check`, s = Date.now(); - try { - for (await e.queue(o, { - __healthCheck: !0, - correlationId: i - }, { - specVersion: 1, - deploymentId: n?.deploymentId - }); Date.now() - s < r;) try { - let t = (await e.streams.get($x(i), a)).getReader(), { chunks: n, timedOut: r } = await tS(t, 500); - if (r) { - try { - t.cancel(); - } catch {} - await new Promise((e) => setTimeout(e, 100)); - continue; - } - let o = nS(n); - if (o) return { - ...o, - latencyMs: Date.now() - s - }; - await new Promise((e) => setTimeout(e, 100)); - } catch { - await new Promise((e) => setTimeout(e, 100)); - } - return { - healthy: !1, - error: `Health check timed out after ${r}ms` - }; - } catch (e) { - return { - healthy: !1, - error: e instanceof Error ? e.message : String(e) - }; - } -} -function iS(e, t) { - return new s$8(`Event pagination ${t} for workflow run "${e}".`, { code: t$9.WORLD_CONTRACT_ERROR }); -} -function aS(e, t, n) { - if (t) { - if (n.has(t)) throw iS(e, `did not advance`); - n.add(t); - } -} -function oS(e, t, n) { - for (let r of n) t.has(r.eventId) || (t.add(r.eventId), e.push(r)); -} -function sS(e, t, n, r) { - if (t) { - if (n === null) throw iS(e, `returned more pages without a cursor`); - if (r.has(n)) throw iS(e, `repeated a cursor`); - } -} -function cS(e, t, n) { - return t !== null && !n && s$8.is(e) && e.status === 400; -} -async function lS(e, t) { - let n = t !== void 0; - return vb(n ? `workflow.loadNewEvents` : `workflow.loadEvents`, async (r) => { - r?.setAttributes({ ...Jv(e) }); - let i = [], a = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set(), s = t ?? null, c = !0, l = 0, u = !1, d = await T_$1(), f = Date.now(); - for (; c;) { - let t = Date.now(), r = s; - aS(e, r, o); - let f; - try { - f = await d.events.list({ - runId: e, - pagination: { - sortOrder: `asc`, - cursor: r ?? void 0 - } - }); - } catch (t) { - if (cS(t, r, u)) { - Ab.warn(`Event cursor was rejected; retrying with a full event reload.`, { workflowRunId: e }), i.length = 0, a.clear(), o.clear(), s = null, u = !0; - continue; - } - throw t; - } - oS(i, a, f.data), c = f.hasMore, sS(e, c, f.cursor, o), s = f.cursor ?? s, l++, Ab.debug(`Loaded event page`, { - workflowRunId: e, - incremental: n, - page: l, - pageEvents: f.data.length, - totalEvents: i.length, - hasMore: c, - pageMs: Date.now() - t - }); - } - return Ab.debug(`Event load complete`, { - workflowRunId: e, - incremental: n, - totalEvents: i.length, - pagesLoaded: l, - totalMs: Date.now() - f - }), r?.setAttributes({ - ...Zv(i.length), - ...Ky(l) - }), { - events: i, - cursor: s - }; - }); -} -const uS = { - "Access-Control-Allow-Origin": `*`, - "Access-Control-Allow-Methods": `POST, OPTIONS, GET, HEAD`, - "Access-Control-Allow-Headers": `Content-Type` -}; -function dS(e, t) { - return async (n) => { - let r = new URL(n.url); - return r.searchParams.has(`__health`) ? n.method === `OPTIONS` ? new Response(null, { - status: 204, - headers: uS - }) : new Response(JSON.stringify({ - healthy: !0, - endpoint: r.pathname, - specVersion: t ?? 5, - workflowCoreVersion: qx - }), { - status: 200, - headers: { - "Content-Type": `application/json`, - ...uS - } - }) : await e(n); - }; -} -async function fS(e, ...t) { - let n = t[0]; - await vb(`queue.publish`, { - attributes: { - ...ky(`vercel-queue`), - ...Ay(n), - ...My(`publish`), - ...nb(`vercel-queue`), - ...rb(`vercel-queue`), - ...ib(`vqs`), - ...ab(`publish`) - }, - kind: await Sb(`PRODUCER`) - }, async (n) => { - let { messageId: r } = await e.queue(...t); - r && n?.setAttributes(jy(r)); - }); -} -function pS(e) { - if (e.requestedAt) try { - return Ny(Date.now() - e.requestedAt.getTime()); - } catch { - return; - } -} -function mS(e, t) { - let n; - return () => (n ||= (async () => { - let n = await e.getEncryptionKeyForRun?.(t); - return n ? await p_$1(n) : void 0; - })(), n); -} -function hS(t) { - Promise.resolve().then(() => functions_CnVBREsg_exports).then((t) => d$13(t.default, 1)).then(({ waitUntil: e }) => { - e(t); - }); -} -function gS(e, t) { - hS(e.catch((e) => { - if (!(e?.name === `AbortError` || e?.name === `ResponseAborted`)) try { - t(e); - } catch {} - })); -} -async function _S(e) { - let t = e(); - return hS(t.catch(() => {})), t; -} -function vS(e, t = {}) { - if (typeof e != `object` || !e || Array.isArray(e)) throw new D$10(`experimental_setAttributes requires a plain object, got ${e === null ? `null` : Array.isArray(e) ? `array` : typeof e}`); - let n = Object.entries(e).map(([e, t]) => ({ - key: e, - value: t === void 0 ? null : t - })); - if (n.length === 0) return n; - let r = t.allowReservedAttributes === !0; - try { - Am$1(n, { allowReservedAttributes: r }); - } catch (e) { - throw e instanceof Em$1 ? new D$10(e.message) : e; - } - return n; -} -//#endregion -//#region node_modules/eve/dist/src/compiled/_chunks/workflow/resume-hook-CUCPW67D.js -var resume_hook_CUCPW67D_exports = /* @__PURE__ */ __exportAll({ - i: () => C$9, - n: () => E$9, - r: () => D$8, - t: () => T$9 -}); -var C$9 = l$11({ - getHookByToken: () => T$9, - resumeHook: () => E$9, - resumeWebhook: () => D$8 -}); -async function w$9(e) { - let t = await T_$1(), n = await t.hooks.getByToken(e), r = await t.runs.get(n.runId), a = await t.getEncryptionKeyForRun?.(r), o = a ? await p_$1(a) : void 0; - return n.metadata !== void 0 && (n.metadata = await Nx(n.metadata, n.runId, o)), { - hook: n, - run: r, - encryptionKey: o - }; -} -async function T$9(e) { - let { hook: t } = await w$9(e); - return t; -} -async function E$9(e, t, n) { - return await _S(() => vb(`hook.resume`, async (r) => { - let i = await T_$1(); - try { - let s, c, p; - if (typeof e == `string`) { - let t = await w$9(e); - s = t.hook, c = t.run, p = n ?? t.encryptionKey; - } else if (s = e, c = await i.runs.get(s.runId), n) p = n; - else { - let e = await i.getEncryptionKeyForRun?.(c); - p = e ? await p_$1(e) : void 0; - } - r?.setAttributes({ - ...Fy(s.token), - ...Iy(s.hookId), - ...Jv(s.runId) - }); - let g = c.executionContext?.workflowCoreVersion, v = Kx(typeof g == `string` ? g : void 0); - v.supportedFormats.has(Q$9.ENCRYPTED) || (p = void 0); - let C = (c.specVersion ?? 0) >= 5 && v.supportedFormats.has(Q$9.GZIP), T = [], E = bh$1(s.specVersion), D = await Px(t, s.runId, p, T, globalThis, E, v.framedByteStreams, C); - gS(Promise.all(T), (e) => { - e !== void 0 && Ab.warn(`Background flush of hook payload ops failed`, { - workflowRunId: s.runId, - hookId: s.hookId, - error: e instanceof Error ? e.message : String(e) - }); - }), await i.events.create(s.runId, { - eventType: `hook_received`, - specVersion: 5, - correlationId: s.hookId, - eventData: { - ...E ? {} : { token: s.token }, - payload: D - } - }, { v1Compat: E }), r?.setAttributes({ ...Kv(c.workflowName) }); - let O = await Tb(c.executionContext?.traceCarrier); - return O && r?.addLink?.(O), await i.queue(Yx(c.workflowName), { - runId: s.runId, - traceCarrier: c.executionContext?.traceCarrier ?? void 0 - }, { - deploymentId: c.deploymentId, - specVersion: c.specVersion ?? 1 - }), s; - } catch (t) { - throw r?.setAttributes({ - ...Fy(typeof e == `string` ? e : e.token), - ...Ly(!1) - }), t; - } - })); -} -async function D$8(e, i) { - let { hook: a, encryptionKey: o } = await w$9(e); - if (a.isWebhook === !1) throw new b$9(e); - let s, c; - if (a.metadata && typeof a.metadata == `object` && `respondWith` in a.metadata) if (a.metadata.respondWith === `manual`) { - let { readable: e, writable: t } = new TransformStream(); - c = e, i[B_$1] = t; - } else if (a.metadata.respondWith instanceof Response) s = a.metadata.respondWith; - else throw new u$10(`Invalid \`respondWith\` value: ${a.metadata.respondWith}`, { slug: a$10.WEBHOOK_INVALID_RESPOND_WITH_VALUE }); - else s = new Response(null, { status: 202 }); - if (await E$9(a, i, o), c) { - let e = c.getReader(), t = await e.read(); - t.value && (s = t.value), e.cancel(); - } - if (!s) throw new u$10(`Workflow run did not send a response`, { slug: a$10.WEBHOOK_RESPONSE_NOT_SENT }); - return s; -} -//#endregion -//#region node_modules/eve/dist/src/compiled/_chunks/workflow/run-CVlF84yI.js -const R$7 = Ih$1(); -let z$7 = !1; -async function B$8(t, n, r) { - "use step"; - return await _S(() => { - let i = t?.workflowId; - if (!i) throw new u$10(`'start' received an invalid workflow function. Ensure the Workflow SDK is configured correctly and the function includes a 'use workflow' directive.`, { slug: `start-invalid-workflow-function` }); - return vb(`workflow.start ${c$10(i)}`, async (e) => { - e?.setAttributes({ - ...Kv(i), - ...qv(`start`) - }); - let t = [], a = r ?? {}; - Array.isArray(n) ? t = n : typeof n == `object` && (a = n), e?.setAttributes({ ...Qv(t.length) }); - let c = a?.world ?? await T_$1(), l = await c.getDeploymentId(), d = a.deploymentId ?? l; - d === `latest` && (c.resolveLatestDeploymentId ? d = await c.resolveLatestDeploymentId() : (z$7 || (z$7 = !0, Ab.warn(`deploymentId: 'latest' has no effect in this world and was ignored. It is only supported by worlds with atomic deployments, such as Vercel. The run will target the current deployment.`, { currentDeploymentId: l })), d = l)); - let f, g; - if (d === l) f = !0, g = !0; - else if (typeof c.streams?.get != `function`) f = !1, g = !1; - else { - let e = Kx((await rS(c, `workflow`, { - deploymentId: d, - timeout: 2e3 - }).catch(() => void 0))?.workflowCoreVersion); - f = e.framedByteStreams, g = e.supportedFormats.has(Q$9.GZIP); - } - let y = [], x = `wrun_${R$7()}`, E = await pb(), D = a.specVersion ?? c.specVersion ?? 2, O = bh$1(D), N = a.allowReservedAttributes === !0, B; - if (a.attributes && Object.keys(a.attributes).length > 0) { - if (D < 4) throw new u$10(`Initial workflow attributes require a World that supports spec version 4 or later.`); - for (let [e, t] of Object.entries(a.attributes)) if (typeof t != `string`) throw new u$10(`Initial workflow attribute ${JSON.stringify(e)} must be a string value.`); - let e = vS(a.attributes, { allowReservedAttributes: N }); - B = Object.fromEntries(e.map(({ key: e, value: t }) => [e, t])); - } - let H = B ? { - attributes: B, - ...N ? { allowReservedAttributes: !0 } : {} - } : {}, U = await c.getEncryptionKeyForRun?.(x, { - ...a, - deploymentId: d - }), W = U ? await p_$1(U) : void 0, G = await Ox(t, x, W, y, globalThis, O, f, g && D >= 5), K = { - traceCarrier: E, - workflowCoreVersion: qx, - features: { encryption: !!W } - }, [q, J] = await Promise.allSettled([c.events.create(x, { - eventType: `run_created`, - specVersion: D, - eventData: { - deploymentId: d, - workflowName: i, - input: G, - executionContext: K, - ...H - } - }, { v1Compat: O }), c.queue(Yx(i), { - runId: x, - traceCarrier: E, - ...D >= 3 ? { runInput: { - input: G, - deploymentId: d, - workflowName: i, - specVersion: D, - executionContext: K, - ...H - } } : {} - }, { - deploymentId: d, - specVersion: D - })]); - if (J.status === `rejected`) throw J.reason; - let X = !1; - if (q.status === `rejected`) { - let e = q.reason; - if (!x$9.is(e)) if (V$7(e)) X = !0, Ab.warn(`Run creation event failed, but the run was accepted via the queue. The run_created event will be re-tried async by the runtime.`, { - workflowRunId: x, - error: e.message - }); - else throw e; - } else { - let e = q.value; - if (!e.run) throw new u$10(`Missing 'run' in server response for 'run_created' event`); - if (!O && e.run.runId !== x) throw new u$10(`Server returned different runId than requested: expected ${x}, got ${e.run.runId}`); - } - return gS(Promise.all(y), (e) => { - Ab.warn(`Background flush of workflow argument streams failed`, { - workflowRunId: x, - error: e instanceof Error ? e.message : String(e) - }); - }), e?.setAttributes({ - ...Jv(x), - ...Py(d), - ...q.status === `fulfilled` && q.value.run ? Yv(q.value.run.status) : {} - }), new Y$9(x, { resilientStart: X }); - }); - }); -} -function V$7(e) { - return !!(w$11.is(e) || s$8.is(e) && e.status && e.status >= 500); -} -async function K$7(e, t, n) { - try { - let r = await e.runs.get(t, { resolveData: `none` }), i = bh$1(r.specVersion), a = [], s = null; - do { - let n = await e.events.list({ - runId: t, - pagination: { - limit: 1e3, - ...s ? { cursor: s } : {} - }, - resolveData: `none` - }); - a.push(...n.data), s = n.hasMore ? n.cursor : null; - } while (s); - let c = a.filter((e) => e.eventType === `wait_created`), l = new Set(a.filter((e) => e.eventType === `wait_completed`).map((e) => e.correlationId)), u = c.filter((e) => !l.has(e.correlationId)); - if (n?.correlationIds && n.correlationIds.length > 0) { - let e = new Set(n.correlationIds); - u = u.filter((t) => t.correlationId && e.has(t.correlationId)); - } - let d = [], f = 0; - for (let n of u) { - if (!n.correlationId) continue; - let a = i ? { - eventType: `wait_completed`, - correlationId: n.correlationId - } : { - eventType: `wait_completed`, - correlationId: n.correlationId, - specVersion: r.specVersion, - eventData: { resumeAt: n.eventData.resumeAt } - }; - try { - await e.events.create(t, a, { v1Compat: i }), f++; - } catch (e) { - x$9.is(e) ? f++ : d.push(e instanceof Error ? e : Error(String(e))); - } - } - if (f > 0 && await e.queue(Yx(r.workflowName), { runId: t }, { - deploymentId: r.deploymentId, - specVersion: r.specVersion ?? 1 - }), d.length > 0) throw AggregateError(d, `Failed to complete ${d.length}/${u.length} pending wait(s) for run ${t}`); - return { stoppedCount: f }; - } catch (e) { - throw e instanceof AggregateError ? e : Error(`Failed to wake up run ${t}: ${e instanceof Error ? e.message : String(e)}`, { cause: e }); - } -} -var Y$9 = class e { - static [E_$1](e) { - return { - runId: e.runId, - resilientStart: e.#r - }; - } - static [D_$1](t) { - return new e(t.runId, { resilientStart: t.resilientStart }); - } - runId; - #e; - get #t() { - return this.#e ||= T_$1(), this.#e; - } - #n = null; - #r = !1; - constructor(e, t) { - this.runId = e, this.#r = t?.resilientStart ?? !1; - } - #i() { - return this.#n ||= (async () => { - let e = await this.#t, t = await e.runs.get(this.runId), n = await e.getEncryptionKeyForRun?.(t); - return n ? await p_$1(n) : void 0; - })(), this.#n; - } - #a() { - return () => this.#i(); - } - async wakeUp(e) { - "use step"; - return K$7(await this.#t, this.runId, e); - } - async cancel() { - "use step"; - await (await this.#t).events.create(this.runId, { - eventType: `run_cancelled`, - specVersion: 5 - }); - } - get exists() { - "use step"; - return this.#t.then((e) => e.runs.get(this.runId, { resolveData: `none` }).then(() => !0).catch((e) => { - if (v$8.is(e)) return !1; - throw e; - })); - } - get status() { - "use step"; - return this.#t.then((e) => e.runs.get(this.runId).then((e) => e.status)); - } - get returnValue() { - "use step"; - return this.#o(); - } - get workflowName() { - "use step"; - return this.#t.then((e) => e.runs.get(this.runId).then((e) => e.workflowName)); - } - get createdAt() { - "use step"; - return this.#t.then((e) => e.runs.get(this.runId).then((e) => e.createdAt)); - } - get startedAt() { - "use step"; - return this.#t.then((e) => e.runs.get(this.runId).then((e) => e.startedAt)); - } - get completedAt() { - "use step"; - return this.#t.then((e) => e.runs.get(this.runId).then((e) => e.completedAt)); - } - get readable() { - return this.getReadable(); - } - getReadable(e = {}) { - "use step"; - let { ops: t = [], global: n = globalThis, startIndex: r, namespace: i } = e, a = Ub(this.runId, i), o = this.#a(), s = Cx(n, t, this.runId, o).ReadableStream({ - name: a, - startIndex: r - }), c = this.#t, l = this.runId; - return Object.assign(s, { getTailIndex: async () => (await (await c).streams.getInfo(l, a)).tailIndex }); - } - async #o() { - let e = await this.#t, r = 0, a = this.#r ? 3 : 0, o = [ - 1e3, - 3e3, - 6e3 - ]; - for (;;) try { - let t = await e.runs.get(this.runId); - if (t.status === `completed`) { - let e = await this.#i(); - return await jx(t.output, this.runId, e); - } - if (t.status === `cancelled`) throw new T$11(this.runId); - if (t.status === `failed`) { - let e = await this.#i(), n; - try { - n = await Rx(t.error, this.runId, e); - } catch { - n = Error(`Failed to hydrate workflow run error`); - } - throw new c$9(this.runId, n, { errorCode: t.errorCode }); - } - throw new l$8(this.runId, t.status); - } catch (e) { - if (l$8.is(e)) { - await new Promise((e) => setTimeout(e, 1e3)); - continue; - } - if (v$8.is(e) && r < a) { - let e = o[r]; - r++, await new Promise((t) => setTimeout(t, e)); - continue; - } - throw e; - } - } -}; -function X$9(e) { - return new Y$9(e); -} -//#endregion -//#region node_modules/eve/dist/src/compiled/@workflow/core/runtime.js -const _r$3 = /* @__PURE__ */ new Set([ - `PARSE_ERROR`, - `SCHEMA_VALIDATION`, - t$9.WORLD_CONTRACT_ERROR -]); -const vr$3 = [ - u$10.is, - g$8.is, - _$7.is, - p$11.is -]; -function yr$3(e) { - if (!s$8.is(e) || e.status !== void 0) return !1; - let t = `cause` in e ? e.cause : void 0; - return e.code !== void 0 && _r$3.has(e.code) || e.message.startsWith(`Failed to parse response body for `) || e.message.startsWith(`Schema validation failed for `) || typeof t == `object` && !!t && `name` in t && t.name === `ZodError`; -} -function br$3(e) { - if (f$8.is(e)) return t$9.REPLAY_DIVERGENCE; - if (d$10.is(e)) return t$9.CORRUPTED_EVENT_LOG; - if (yr$3(e)) return t$9.WORLD_CONTRACT_ERROR; - for (let t of vr$3) if (t(e)) return t$9.RUNTIME_ERROR; - return t$9.USER_ERROR; -} -function xr$3(e) { - return e instanceof Ce$8 || e instanceof we$8 || e instanceof Te$8 || e instanceof Oe$8; -} -const Sr$3 = `The workflow event log contains orphaned or mismatched events and cannot be replayed. This is an internal workflow SDK error; please report it with the runId.`; -function Cr$3(e, t) { - let n = t ?? br$3(e); - return h$9.is(e) ? { - attribution: `user`, - errorCode: n, - hint: `A value passed across a workflow/step boundary could not be serialized. See the error message for the offending path and the Learn More link for details.` - } : xr$3(e) ? { - attribution: `user`, - errorCode: n, - hint: `A workflow-only or step-only API was called from the wrong context. The error message includes the exact API and how to move the call.` - } : d$10.is(e) ? { - attribution: `sdk`, - errorCode: n, - hint: Sr$3 - } : e instanceof u$10 ? { - attribution: `sdk`, - errorCode: n, - hint: `This is an internal workflow SDK error, not a bug in your code. If it keeps happening, please report it with the stack trace and the runId.` - } : n === t$9.REPLAY_TIMEOUT ? { - attribution: `sdk`, - errorCode: n, - hint: "The workflow replay between step boundaries took too long. This bounds workflow-VM and event-log replay time only — step bodies (`\"use step\"` functions) are excluded. This usually means the event log is unusually large or the workflow function is doing heavy synchronous work in workflow code outside of step bodies. Override the default budget via the WORKFLOW_REPLAY_TIMEOUT_MS env var if needed." - } : n === t$9.MAX_DELIVERIES_EXCEEDED ? { - attribution: `sdk`, - errorCode: n, - hint: `The workflow queue exceeded its max-delivery budget. This usually indicates a persistent runtime failure — check the most recent stack traces for the underlying cause.` - } : n === t$9.CORRUPTED_EVENT_LOG ? { - attribution: `sdk`, - errorCode: n, - hint: Sr$3 - } : n === t$9.WORLD_CONTRACT_ERROR ? { - attribution: `sdk`, - errorCode: n, - hint: `The workflow backend returned data that violated the SDK contract. This is not retryable; please report it with the stack trace and runId.` - } : { - attribution: `user`, - errorCode: n - }; -} -const wr$3 = 24e4; -const Tr$3 = 3e4; -const Er$3 = 78e4; -const Dr$3 = /* @__PURE__ */ new Set(); -function Or$3(e, t, n) { - Dr$3.has(e) || (Dr$3.add(e), Ab.warn(t, n)); -} -function kr$3() { - let e = process.env.WORKFLOW_REPLAY_TIMEOUT_MS; - if (!e) return wr$3; - let t = Number(e); - return !Number.isFinite(t) || t <= 0 ? (Or$3(e, `Ignoring WORKFLOW_REPLAY_TIMEOUT_MS: not a positive finite number; using default`, { - raw: e, - defaultMs: wr$3 - }), wr$3) : t < 3e4 ? (Or$3(e, `WORKFLOW_REPLAY_TIMEOUT_MS below minimum; clamped`, { - raw: e, - clampedMs: Tr$3, - minMs: Tr$3 - }), Tr$3) : t > 78e4 ? (Or$3(e, `WORKFLOW_REPLAY_TIMEOUT_MS above maximum; clamped`, { - raw: e, - clampedMs: Er$3, - maxMs: Er$3 - }), Er$3) : t; -} -const Ar$3 = /* @__PURE__ */ new Set(); -function jr$3() { - let e = process.env.WORKFLOW_MAX_INLINE_STEPS; - if (!e) return 3; - let t = Number(e); - return !Number.isInteger(t) || t <= 0 ? (Ar$3.has(e) || (Ar$3.add(e), Ab.warn(`Ignoring WORKFLOW_MAX_INLINE_STEPS: not a positive integer; using default`, { - raw: e, - defaultValue: 3 - })), 3) : t < 1 ? 1 : t > 16 ? (Ar$3.has(e) || (Ar$3.add(e), Ab.warn(`WORKFLOW_MAX_INLINE_STEPS above maximum; clamped`, { - raw: e, - clampedValue: 16, - maxValue: 16 - })), 16) : t; -} -function Mr$3() { - let e = process.env.WORKFLOW_OPTIMISTIC_INLINE_START; - return e === void 0 || e === `` ? !1 : e === `1` || e.toLowerCase() === `true`; -} -function Nr$3() { - let e = process.env.WORKFLOW_OPTIMISTIC_INLINE_START; - return e === void 0 || e === `` ? !1 : e === `0` || e.toLowerCase() === `false`; -} -function Pr$3() { - let e = process.env.WORKFLOW_TURBO; - return e === void 0 || e === `` ? !0 : !(e === `0` || e.toLowerCase() === `false`); -} -const Fr$3 = promisify(execFile); -function Ir$3(e, t = 10) { - let n = parseInt(e, t); - if (!Number.isNaN(n) && n >= 0 && n <= 65535) return n; -} -const Lr$3 = ((e, t) => e.join(t))([``, `proc`], `/`); -async function Rr$3(e) { - let t = [`${Lr$3}/net/tcp`, `${Lr$3}/net/tcp6`], n = [], r = /* @__PURE__ */ new Set(), i = `${Lr$3}/${e}/fd`; - try { - let e = (await readdir(i)).sort((e, t) => Number.parseInt(e, 10) - Number.parseInt(t, 10)), t = await Promise.allSettled(e.map(async (e) => (await readlink(`${i}/${e}`)).match(/^socket:\[(\d+)\]$/)?.[1] ?? null)); - for (let e of t) e.status === `fulfilled` && e.value && (n.push(e.value), r.add(e.value)); - } catch { - return []; - } - if (n.length === 0) return []; - let a = /* @__PURE__ */ new Map(); - for (let e of t) try { - let t = (await readFile(e, `utf8`)).split(` -`).slice(1); - for (let e of t) { - if (!e.trim()) continue; - let t = e.trim().split(/\s+/); - if (t.length < 10) continue; - let n = t[1], i = t[3], o = t[9]; - if (!n || i !== `0A` || !o || !r.has(o)) continue; - let s = n.indexOf(`:`); - if (s === -1) continue; - let c = n.slice(s + 1); - if (!c) continue; - let l = Ir$3(c, 16); - l !== void 0 && a.set(o, l); - } - } catch {} - let o = []; - for (let e of n) { - let t = a.get(e); - t !== void 0 && o.push(t); - } - return o; -} -async function zr$3(e) { - try { - let { stdout: t } = await Fr$3(`lsof`, [ - `-a`, - `-i`, - `-P`, - `-n`, - `-p`, - e.toString() - ]), n = [], r = t.split(` -`); - for (let e of r) if (e.includes(`LISTEN`)) { - let t = e.trim().split(/\s+/)[8]; - if (t) { - let e = t.lastIndexOf(`:`); - if (e !== -1) { - let r = Ir$3(t.slice(e + 1)); - r !== void 0 && n.push(r); - } - } - } - return n; - } catch { - return []; - } -} -async function Br$3(e) { - try { - let { stdout: t } = await Fr$3(`cmd`, [`/c`, `netstat -ano | findstr ${e} | findstr LISTENING`]), n = [], r = t.trim(); - if (r) { - let e = r.split(` -`); - for (let t of e) { - let e = t.trim().match(/^\s*TCP\s+(?:\[[\da-f:]+\]|[\d.]+):(\d+)\s+/i); - if (e) { - let t = Ir$3(e[1]); - t !== void 0 && n.push(t); - } - } - } - return n; - } catch { - return []; - } -} -async function Vr$3() { - let { pid: e, platform: t } = process; - try { - switch (t) { - case `linux`: return await Rr$3(e); - case `darwin`: return await zr$3(e); - case `win32`: return await Br$3(e); - default: return []; - } - } catch (e) { - return process.env.NODE_ENV === `development` && console.debug(`[getAllPorts] Detection failed:`, e), []; - } -} -async function Hr$3(e, t = {}) { - let { endpoint: n = `/.well-known/workflow/v1/flow?__health`, timeout: r = 500 } = t, i = new AbortController(), a = setTimeout(() => i.abort(), r); - try { - return (await fetch(`http://localhost:${e}${n}`, { - method: `HEAD`, - signal: i.signal - })).status === 200; - } catch { - return !1; - } finally { - clearTimeout(a); - } -} -async function Ur$3(e) { - let t = await Vr$3(); - if (t.length === 0) return; - if (t.length === 1) return t[0]; - let n = (await Promise.all(t.map(async (t) => ({ - port: t, - isWorkflow: await Hr$3(t, e) - })))).find((e) => e.isWorkflow); - return n ? n.port : (process.env.NODE_ENV === `development` && console.debug(`[getWorkflowPort] Probing failed, falling back to first port:`, t[0]), t[0]); -} -function Wr$3(e) { - let t = { get value() { - let n = e(); - return Object.defineProperty(t, "value", { value: n }), n; - } }; - return t; -} -const Gr$3 = () => process.env.WORKFLOW_LOCAL_DATA_DIR || `.workflow-data`; -const Kr$3 = () => process.env.WORKFLOW_LOCAL_BASE_URL; -const qr$3 = Wr$3(() => ({ - dataDir: Gr$3(), - baseUrl: Kr$3() -})); -async function Jr$3(e) { - if (e.baseUrl) return e.baseUrl; - if (process.env.WORKFLOW_LOCAL_BASE_URL) return process.env.WORKFLOW_LOCAL_BASE_URL; - if (typeof e.port == `number`) return `http://localhost:${e.port}`; - if (process.env.PORT) return `http://localhost:${process.env.PORT}`; - let t = await Ur$3(); - if (t) return `http://localhost:${t}`; - throw Error(`Unable to resolve base URL for workflow queue.`); -} -const Yr$3 = Ih$1(() => Math.random()); -function Xr$3(e) { - let t = typeof e == `string` ? e : String(e); - return t.length > 48 ? `${t.slice(0, 48)}…` : t; -} -var Zr$3 = class extends s$8 { - constructor(e, t) { - super(`Unsafe ${e} "${Xr$3(t)}": must not be empty, contain ".", "/", "\\", or null bytes`), this.name = `UnsafeEntityIdError`; - } - static is(e) { - return e instanceof Error && e.name === `UnsafeEntityIdError`; - } -}; -function Qr$3(e, t) { - if (t.length === 0 || t.startsWith(`.`) || t.includes(`/`) || t.includes(`\\`) || t.includes(`\0`) || t.includes(`.`)) throw new Zr$3(e, t); -} -function $r$3(e, ...t) { - let n = G.resolve(e), r = G.resolve(e, ...t); - if (r !== n && !r.startsWith(n + G.sep)) throw new Zr$3(`path`, t.join(`/`)); - return r; -} -const ei$3 = process.platform === `win32`; -async function ti$3(e, t = 5) { - if (!ei$3) return e(); - let n = [ - `EPERM`, - `EBUSY`, - `EACCES` - ]; - for (let r = 0; r <= t; r++) try { - return await e(); - } catch (e) { - if (!(r < t && n.includes(e.code))) throw e; - let i = 10 * 2 ** r + Math.random() * 10; - await new Promise((e) => setTimeout(e, i)); - } - throw Error(`Retry loop exited unexpectedly`); -} -const ni$3 = /* @__PURE__ */ new Set(); -function ri$3() { - ni$3.clear(); -} -const ii$3 = /\.[a-zA-Z][a-zA-Z0-9-]*$/; -function ai$3(e) { - return e.replace(ii$3, ``); -} -function oi$3(e, t) { - return e.endsWith(`.${t}`); -} -function si$3(e, t, n, r) { - return Qr$3(`fileId`, n), r !== void 0 && Qr$3(`tag`, r), $r$3(e, t, r ? `${n}.${r}.json` : `${n}.json`); -} -async function ci$3(e, t, n, r, i) { - if (Qr$3(`fileId`, n), i !== void 0 && Qr$3(`tag`, i), i) { - let a = await gi$3($r$3(e, t, `${n}.${i}.json`), r); - if (a !== null) return a; - } - return gi$3($r$3(e, t, `${n}.json`), r); -} -async function li$3(e, t) { - let n = `.${t}.json`; - try { - return (await promises.readdir(e)).filter((e) => e.endsWith(n)); - } catch (e) { - if (e.code === `ENOENT`) return []; - throw e; - } -} -async function ui$3(e, t, n) { - let r = `.${t}${n}`; - try { - return (await promises.readdir(e)).filter((e) => e.endsWith(r)); - } catch (e) { - if (e.code === `ENOENT`) return []; - throw e; - } -} -async function di$3(e) { - try { - await promises.mkdir(e, { recursive: !0 }); - } catch {} -} -function fi$3(e, t) { - return t instanceof Uint8Array ? { - __type: `Uint8Array`, - data: Buffer.from(t).toString(`base64`) - } : t; -} -function pi$3(e, t) { - return typeof t == `object` && t && t.__type === `Uint8Array` && typeof t.data == `string` ? new Uint8Array(Buffer.from(t.data, `base64`)) : t; -} -async function mi$3(e, t, n) { - return hi$3(e, JSON.stringify(t, fi$3, 2), n); -} -async function hi$3(e, t, n) { - if (!n?.overwrite) { - if (ni$3.has(e)) throw new x$9(`File ${e} already exists and 'overwrite' is false`); - try { - throw await promises.access(e), ni$3.add(e), new x$9(`File ${e} already exists and 'overwrite' is false`); - } catch (e) { - if (e.code !== `ENOENT`) throw e; - } - } - let r = `${e}.tmp.${Yr$3()}`, i = !1; - try { - await di$3(G.dirname(e)), await promises.writeFile(r, t), i = !0, await ti$3(() => promises.rename(r, e)), ni$3.add(e); - } catch (e) { - throw i && await ti$3(() => promises.unlink(r), 3).catch(() => {}), e; - } -} -async function gi$3(e, t) { - try { - let n = await promises.readFile(e, `utf-8`); - return t.parse(JSON.parse(n, pi$3)); - } catch (e) { - if (e.code === `ENOENT`) return null; - throw e; - } -} -async function _i$3(e) { - return await promises.readFile(e); -} -async function vi$3(e) { - let t = await promises.open(e, `r`); - try { - let e = Buffer.allocUnsafe(1), { bytesRead: n } = await t.read(e, 0, 1, 0); - return n === 0 ? void 0 : e[0]; - } finally { - await t.close(); - } -} -async function yi$3(e) { - try { - await promises.unlink(e); - } catch (e) { - if (e.code !== `ENOENT`) throw e; - } -} -async function bi$3(e, t) { - await di$3(G.dirname(e)); - let n = `${e}.tmp.${Yr$3()}`, r = !1; - try { - await promises.writeFile(n, t, { flag: `wx` }), r = !0; - try { - return await ti$3(() => promises.link(n, e)), !0; - } catch (e) { - if (e.code === `EEXIST`) return !1; - throw e; - } - } finally { - r && await ti$3(() => promises.unlink(n), 3).catch(() => {}); - } -} -async function xi$3(e) { - return Si$3(e, `.json`); -} -async function Si$3(e, t) { - try { - return (await promises.readdir(e)).filter((e) => e.endsWith(t)).map((e) => e.slice(0, -t.length)); - } catch (e) { - if (e.code === `ENOENT`) return []; - throw e; - } -} -function Ci$3(e) { - if (!e) return null; - let t = e.split(`|`); - return { - timestamp: new Date(t[0]), - id: t[1] || null - }; -} -function wi$3(e, t) { - return t ? `${e.toISOString()}|${t}` : e.toISOString(); -} -async function Ti$3(e) { - let { directory: t, schema: n, filePrefix: r, fileIdFilter: i, filter: a, sortOrder: o = `desc`, limit: s = 20, cursor: c, getCreatedAt: l, getId: u } = e; - r !== void 0 && Qr$3(`filePrefix`, r); - let d = await xi$3(t), f = r ? d.filter((e) => e.startsWith(r)) : d, p = i ? f.filter(i) : f, m = Ci$3(c), h = p; - m && (h = p.filter((e) => { - let t = l(`${e}.json`); - if (t) { - let e = m.timestamp.getTime(), n = t.getTime(); - return m.id ? o === `desc` ? n <= e : n >= e : o === `desc` ? n < e : n > e; - } - return !0; - })); - let g = []; - for (let e of h) { - let r = G.join(t, `${e}.json`), i = null; - try { - i = await gi$3(r, n); - } catch (t) { - if (t instanceof ed$2) { - console.warn(`Skipping item ${e} due to malformed JSON: ${t.message}`); - continue; - } - throw t; - } - if (i) { - if (a && !a(i)) continue; - if (m) { - let e = i.createdAt.getTime(), t = m.timestamp.getTime(); - if (o === `desc`) { - if (e > t || e === t && m.id && u && u(i) >= m.id) continue; - } else if (e < t || e === t && m.id && u && u(i) <= m.id) continue; - } - g.push(i); - } - } - g.sort((e, t) => { - let n = e.createdAt.getTime(), r = t.createdAt.getTime(), i = o === `asc` ? n - r : r - n; - if (i === 0 && u) { - let n = u(e), r = u(t); - return o === `asc` ? n.localeCompare(r) : r.localeCompare(n); - } - return i; - }); - let _ = g.length > s, v = _ ? g.slice(0, s) : g; - return { - data: v, - cursor: v.length > 0 ? wi$3(v[v.length - 1].createdAt, u?.(v[v.length - 1])) : null, - hasMore: _ - }; -} -let Ei$3 = null; -function Di$3() { - return typeof import.meta.url == `string` && import.meta.url ? G.dirname(fileURLToPath(import.meta.url)) : null; -} -async function Oi$3() { - if (Ei$3) return Ei$3; - let e = Di$3(); - if (e) try { - let t = await readFile(G.join(e, `../package.json`), `utf-8`); - return Ei$3 = JSON.parse(t), Ei$3; - } catch {} - return Ei$3 = { - name: `@workflow/world-local`, - version: `bundled` - }, Ei$3; -} -const ki$3 = `version.txt`; -var Ai$3 = class extends Error { - dataDir; - code; - constructor(e, t, n) { - super(e), this.name = `DataDirAccessError`, this.dataDir = t, this.code = n; - } -}; -var ji$3 = class extends Error { - oldVersion; - newVersion; - suggestedVersion; - constructor(e, t, n, r) { - super(e), this.name = `DataDirVersionError`, this.oldVersion = t, this.newVersion = n, this.suggestedVersion = r; - } -}; -function Mi$3(e) { - let t = e.match(/^(\d+)\.(\d+)\.(\d+)(?:-(.+))?$/); - if (!t) throw Error(`Invalid version string: "${e}"`); - return { - major: parseInt(t[1], 10), - minor: parseInt(t[2], 10), - patch: parseInt(t[3], 10), - prerelease: t[4], - raw: e - }; -} -function Ni$3(e) { - let t = `${e.major}.${e.minor}.${e.patch}`; - return e.prerelease ? `${t}-${e.prerelease}` : t; -} -function Pi$3(e) { - let t = e.trim(), n = t.lastIndexOf(`@`); - if (n <= 0) throw Error(`Invalid version file content: "${e}"`); - return { - packageName: t.substring(0, n), - version: Mi$3(t.substring(n + 1)) - }; -} -function Fi$3(e, t) { - return `${e}@${Ni$3(t)}`; -} -function Ii$3(e, t) { - console.log(`[world-local] Upgrading from version ${Ni$3(e)} to ${Ni$3(t)}`); -} -async function Li$3(e) { - let t = G.resolve(e); - try { - await mkdir(t, { recursive: !0 }); - } catch (e) { - let n = e; - if (n.code !== `EEXIST`) throw new Ai$3(`Failed to create data directory "${t}": ${n.message}`, t, n.code); - } - try { - await access(t, constants.R_OK); - } catch (e) { - let n = e; - throw new Ai$3(`Data directory "${t}" is not readable: ${n.message}`, t, n.code); - } - let n = G.join(t, `.workflow-write-test-${Date.now()}`); - try { - await writeFile(n, ``), await unlink(n).catch((e) => { - if (e.code !== `ENOENT`) throw e; - }); - } catch (e) { - let n = e; - throw new Ai$3(`Data directory "${t}" is not writable: ${n.message}`, t, n.code); - } -} -async function Ri$3(e) { - let t = G.join(G.resolve(e), ki$3); - try { - return Pi$3(await readFile(t, `utf-8`)); - } catch (e) { - if (e.code === `ENOENT`) return null; - throw e; - } -} -async function zi$3(e, t) { - await writeFile(G.join(G.resolve(e), ki$3), Fi$3((await Oi$3()).name, t)); -} -function Bi$3(e, t) { - return t || Ni$3(e); -} -async function Vi$3(e) { - await Li$3(e); - let t = await Oi$3(), n = Mi$3(t.version), r = await Ri$3(e); - if (r === null) { - await zi$3(e, n); - return; - } - let { version: i } = r; - if (Ni$3(i) !== Ni$3(n)) try { - Ii$3(i, n), await zi$3(e, n); - } catch (e) { - let r = Bi$3(i, e instanceof ji$3 ? e.suggestedVersion : void 0); - throw console.error(`[world-local] Failed to upgrade data directory from version ${Ni$3(i)} to ${Ni$3(n)}:`, e instanceof Error ? e.message : e), console.error(`[world-local] Data is not compatible with the current version. Please downgrade to ${t.name}@${r}`), e; - } -} -let Hi$3 = null; -async function Ui$3() { - return Hi$3 ||= Promise.resolve().then(() => src_CQuMexnO_exports).then((t) => d$13(t.t(), 1)).catch(() => null), Hi$3; -} -let Wi$3 = null; -async function Gi$3() { - return Wi$3 ||= Ui$3().then((e) => e ? e.trace.getTracer(`workflow`) : null), Wi$3; -} -async function Ki$3(e, ...t) { - let [n, r] = await Promise.all([Gi$3(), Ui$3()]), { fn: i, opts: a } = typeof t[0] == `function` ? { - fn: t[0], - opts: {} - } : { - fn: t[1], - opts: t[0] - }; - if (!i) throw Error(`Function to trace must be provided`); - return !n || !r ? await i() : n.startActiveSpan(e, a, async (e) => { - try { - let t = await i(e); - return e.setStatus({ code: r.SpanStatusCode.OK }), t; - } catch (t) { - throw e.setStatus({ - code: r.SpanStatusCode.ERROR, - message: t.message - }), t; - } finally { - e.end(); - } - }); -} -async function qi$3(e) { - let t = await Ui$3(); - if (t) return t.SpanKind[e]; -} -function Ji$3(...e) { - return (t) => Object.fromEntries(e.map((e) => [e, t])); -} -const Yi$3 = Ji$3(`peer.service`); -const Xi$3 = Ji$3(`rpc.system`); -const Zi$3 = Ji$3(`rpc.service`); -const Qi$3 = Ji$3(`rpc.method`); -const $i$3 = Ji$3(`workflow.run.id`); -const ea$3 = Ji$3(`step.id`); -const ta$3 = { - peerService: `world-local`, - rpcSystem: `local`, - rpcService: `world-local` -}; -const na$3 = { - "world.runs.get": 0, - "world.runs.experimentalSetAttributes": 0, - "world.steps.get": 0, - "world.events.create": 0, - "world.events.get": 0 -}; -const ra$3 = /* @__PURE__ */ new Set([ - `world.steps.list`, - `world.events.list`, - `world.hooks.list` -]); -function ia$3(e) { - if (e.length >= 2 && typeof e[1] == `object` && e[1] !== null) { - let t = e[1]; - if (typeof t.eventType == `string`) return t.eventType; - } -} -function aa$3(e, t) { - return typeof e[t] == `string` ? e[t] : void 0; -} -function oa$3(e) { - if (typeof e != `object` || !e) return; - let t = e.runId; - return typeof t == `string` ? t : void 0; -} -function sa$3(e) { - if (typeof e != `object` || !e) return; - let t = e; - if (typeof t.runId == `string`) return t.runId; - for (let e of [ - `run`, - `step`, - `hook`, - `wait` - ]) { - let n = t[e]; - if (typeof n == `object` && n) { - let e = n.runId; - if (typeof e == `string`) return e; - } - } -} -function ca$3(e, t, n) { - let r = `${e}.${t}`, i = {}, a = na$3[r], o = a === void 0 ? ra$3.has(r) ? oa$3(n[0]) : void 0 : aa$3(n, a); - if (o && Object.assign(i, $i$3(o)), r === `world.steps.get`) { - let e = aa$3(n, 1); - e && Object.assign(i, ea$3(e)); - } - return i; -} -function la$3(e, t) { - let n = {}; - for (let r of Object.keys(t)) if (typeof t[r] != `function`) n[r] = t[r]; - else { - let i = t[r], a = String(r); - n[r] = async (...t) => { - let n = `${e}.${a}`; - if (e === `world.events` && a === `create`) { - let r = ia$3(t); - r && (n = `${e}.${a} ${r}`); - } - return Ki$3(n, { kind: await qi$3(`INTERNAL`) }, async (r) => { - r?.setAttributes({ - ...Yi$3(ta$3.peerService), - ...Xi$3(ta$3.rpcSystem), - ...Zi$3(ta$3.rpcService), - ...Qi$3(n), - ...ca$3(e, a, t) - }); - let o = await i(...t), s = sa$3(o); - return s && r?.setAttributes($i$3(s)), o; - }); - }; - } - return n; -} -var ua$3 = c$12(((e) => { - var n = e && e.__importDefault || function(e) { - return e && e.__esModule ? e : { default: e }; - }; - Object.defineProperty(e, "__esModule", { value: !0 }), e.RateLimit = e.Sema = void 0; - let r = n(f$11(`events`)); - function i(e, t, n, r, i) { - for (let a = 0; a < i; ++a) n[a + r] = e[a + t], e[a + t] = void 0; - } - function a(e) { - return e >>>= 0, --e, e |= e >> 1, e |= e >> 2, e |= e >> 4, e |= e >> 8, e |= e >> 16, e + 1; - } - function o(e) { - return a(Math.min(Math.max(16, e), 1073741824)); - } - var s = class { - constructor(e) { - this._capacity = o(e), this._length = 0, this._front = 0, this.arr = []; - } - push(e) { - let t = this._length; - this.checkCapacity(t + 1); - let n = this._front + t & this._capacity - 1; - return this.arr[n] = e, this._length = t + 1, t + 1; - } - pop() { - let e = this._length; - if (e === 0) return; - let t = this._front + e - 1 & this._capacity - 1, n = this.arr[t]; - return this.arr[t] = void 0, this._length = e - 1, n; - } - shift() { - let e = this._length; - if (e === 0) return; - let t = this._front, n = this.arr[t]; - return this.arr[t] = void 0, this._front = t + 1 & this._capacity - 1, this._length = e - 1, n; - } - get length() { - return this._length; - } - checkCapacity(e) { - this._capacity < e && this.resizeTo(o(this._capacity * 1.5 + 16)); - } - resizeTo(e) { - let t = this._capacity; - this._capacity = e; - let n = this._front, r = this._length; - if (n + r > t) { - let e = n + r & t - 1; - i(this.arr, 0, this.arr, t, e); - } - } - }, c = class extends r.default {}; - function l(e) { - return typeof e == `function`; - } - function u() { - return `1`; - } - var d = class { - constructor(e, { initFn: t = u, pauseFn: n, resumeFn: r, capacity: i = 10 } = {}) { - if (l(n) !== l(r)) throw Error(`pauseFn and resumeFn must be both set for pausing`); - this.nrTokens = e, this.free = new s(e), this.waiting = new s(i), this.releaseEmitter = new c(), this.noTokens = t === u, this.pauseFn = n, this.resumeFn = r, this.paused = !1, this.releaseEmitter.on(`release`, (e) => { - let t = this.waiting.shift(); - t ? t.resolve(e) : (this.resumeFn && this.paused && (this.paused = !1, this.resumeFn()), this.free.push(e)); - }); - for (let n = 0; n < e; n++) this.free.push(t()); - } - tryAcquire() { - return this.free.pop(); - } - async acquire() { - let e = this.tryAcquire(); - return e === void 0 ? new Promise((e, t) => { - this.pauseFn && !this.paused && (this.paused = !0, this.pauseFn()), this.waiting.push({ - resolve: e, - reject: t - }); - }) : e; - } - release(e) { - this.releaseEmitter.emit(`release`, this.noTokens ? `1` : e); - } - drain() { - let e = Array(this.nrTokens); - for (let t = 0; t < this.nrTokens; t++) e[t] = this.acquire(); - return Promise.all(e); - } - nrWaiting() { - return this.waiting.length; - } - }; - e.Sema = d; - function f(e, { timeUnit: t = 1e3, uniformDistribution: n = !1 } = {}) { - let r = new d(n ? 1 : e), i = n ? t / e : t; - return async function() { - await r.acquire(), setTimeout(() => r.release(), i); - }; - } - e.RateLimit = f; -})); -var da$3 = c$12(((e, t) => { - t.exports = { - kClose: Symbol(`close`), - kDestroy: Symbol(`destroy`), - kDispatch: Symbol(`dispatch`), - kUrl: Symbol(`url`), - kWriting: Symbol(`writing`), - kResuming: Symbol(`resuming`), - kQueue: Symbol(`queue`), - kConnect: Symbol(`connect`), - kConnecting: Symbol(`connecting`), - kKeepAliveDefaultTimeout: Symbol(`default keep alive timeout`), - kKeepAliveMaxTimeout: Symbol(`max keep alive timeout`), - kKeepAliveTimeoutThreshold: Symbol(`keep alive timeout threshold`), - kKeepAliveTimeoutValue: Symbol(`keep alive timeout`), - kKeepAlive: Symbol(`keep alive`), - kHeadersTimeout: Symbol(`headers timeout`), - kBodyTimeout: Symbol(`body timeout`), - kServerName: Symbol(`server name`), - kLocalAddress: Symbol(`local address`), - kHost: Symbol(`host`), - kNoRef: Symbol(`no ref`), - kBodyUsed: Symbol(`used`), - kBody: Symbol(`abstracted request body`), - kRunning: Symbol(`running`), - kBlocking: Symbol(`blocking`), - kPending: Symbol(`pending`), - kSize: Symbol(`size`), - kBusy: Symbol(`busy`), - kQueued: Symbol(`queued`), - kFree: Symbol(`free`), - kConnected: Symbol(`connected`), - kClosed: Symbol(`closed`), - kNeedDrain: Symbol(`need drain`), - kReset: Symbol(`reset`), - kDestroyed: Symbol.for(`nodejs.stream.destroyed`), - kResume: Symbol(`resume`), - kOnError: Symbol(`on error`), - kMaxHeadersSize: Symbol(`max headers size`), - kRunningIdx: Symbol(`running index`), - kPendingIdx: Symbol(`pending index`), - kError: Symbol(`error`), - kClients: Symbol(`clients`), - kClient: Symbol(`client`), - kParser: Symbol(`parser`), - kOnDestroyed: Symbol(`destroy callbacks`), - kPipelining: Symbol(`pipelining`), - kSocket: Symbol(`socket`), - kHostHeader: Symbol(`host header`), - kConnector: Symbol(`connector`), - kStrictContentLength: Symbol(`strict content length`), - kMaxRedirections: Symbol(`maxRedirections`), - kMaxRequests: Symbol(`maxRequestsPerClient`), - kProxy: Symbol(`proxy agent options`), - kCounter: Symbol(`socket request counter`), - kMaxResponseSize: Symbol(`max response size`), - kHTTP2Session: Symbol(`http2Session`), - kHTTP2SessionState: Symbol(`http2Session state`), - kRetryHandlerDefaultRetry: Symbol(`retry agent default retry`), - kConstruct: Symbol(`constructable`), - kListeners: Symbol(`listeners`), - kHTTPContext: Symbol(`http context`), - kMaxConcurrentStreams: Symbol(`max concurrent streams`), - kHTTP2InitialWindowSize: Symbol(`http2 initial window size`), - kHTTP2ConnectionWindowSize: Symbol(`http2 connection window size`), - kEnableConnectProtocol: Symbol(`http2session connect protocol`), - kRemoteSettings: Symbol(`http2session remote settings`), - kHTTP2Stream: Symbol(`http2session client stream`), - kPingInterval: Symbol(`ping interval`), - kNoProxyAgent: Symbol(`no proxy agent`), - kHttpProxyAgent: Symbol(`http proxy agent`), - kHttpsProxyAgent: Symbol(`https proxy agent`), - kSocks5ProxyAgent: Symbol(`socks5 proxy agent`) - }; -})); -var fa$3 = c$12(((e, t) => { - let n = 0, r = 1e3, i, a = Symbol(`kFastTimer`), o = []; - function s() { - n += 499; - let e = 0, t = o.length; - for (; e < t;) { - let r = o[e]; - r._state === 0 ? (r._idleStart = n - 499, r._state = 1) : r._state === 1 && n >= r._idleStart + r._idleTimeout && (r._state = -1, r._idleStart = -1, r._onTimeout(r._timerArg)), r._state === -1 ? (r._state = -2, --t !== 0 && (o[e] = o[t])) : ++e; - } - o.length = t, o.length !== 0 && c(); - } - function c() { - i?.refresh ? i.refresh() : (clearTimeout(i), i = setTimeout(s, 499), i?.unref()); - } - var l = class { - [a] = !0; - _state = -2; - _idleTimeout = -1; - _idleStart = -1; - _onTimeout; - _timerArg; - constructor(e, t, n) { - this._onTimeout = e, this._idleTimeout = t, this._timerArg = n, this.refresh(); - } - refresh() { - this._state === -2 && o.push(this), (!i || o.length === 1) && c(), this._state = 0; - } - clear() { - this._state = -1, this._idleStart = -1; - } - }; - t.exports = { - setTimeout(e, t, n) { - return t <= r ? setTimeout(e, t, n) : new l(e, t, n); - }, - clearTimeout(e) { - e[a] ? e.clear() : clearTimeout(e); - }, - setFastTimeout(e, t, n) { - return new l(e, t, n); - }, - clearFastTimeout(e) { - e.clear(); - }, - now() { - return n; - }, - tick(e = 0) { - n += e - r + 1, s(), s(); - }, - reset() { - n = 0, o.length = 0, clearTimeout(i), i = null; - }, - kFastTimer: a - }; -})); -var K$6 = c$12(((e, t) => { - let n = Symbol.for(`undici.error.UND_ERR`); - var r = class extends Error { - constructor(e, t) { - super(e, t), this.name = `UndiciError`, this.code = `UND_ERR`; - } - static [Symbol.hasInstance](e) { - return e && e[n] === !0; - } - get [n]() { - return !0; - } - }; - let i = Symbol.for(`undici.error.UND_ERR_CONNECT_TIMEOUT`); - var a = class extends r { - constructor(e) { - super(e), this.name = `ConnectTimeoutError`, this.message = e || `Connect Timeout Error`, this.code = `UND_ERR_CONNECT_TIMEOUT`; - } - static [Symbol.hasInstance](e) { - return e && e[i] === !0; - } - get [i]() { - return !0; - } - }; - let o = Symbol.for(`undici.error.UND_ERR_HEADERS_TIMEOUT`); - var s = class extends r { - constructor(e) { - super(e), this.name = `HeadersTimeoutError`, this.message = e || `Headers Timeout Error`, this.code = `UND_ERR_HEADERS_TIMEOUT`; - } - static [Symbol.hasInstance](e) { - return e && e[o] === !0; - } - get [o]() { - return !0; - } - }; - let c = Symbol.for(`undici.error.UND_ERR_HEADERS_OVERFLOW`); - var l = class extends r { - constructor(e) { - super(e), this.name = `HeadersOverflowError`, this.message = e || `Headers Overflow Error`, this.code = `UND_ERR_HEADERS_OVERFLOW`; - } - static [Symbol.hasInstance](e) { - return e && e[c] === !0; - } - get [c]() { - return !0; - } - }; - let u = Symbol.for(`undici.error.UND_ERR_BODY_TIMEOUT`); - var d = class extends r { - constructor(e) { - super(e), this.name = `BodyTimeoutError`, this.message = e || `Body Timeout Error`, this.code = `UND_ERR_BODY_TIMEOUT`; - } - static [Symbol.hasInstance](e) { - return e && e[u] === !0; - } - get [u]() { - return !0; - } - }; - let f = Symbol.for(`undici.error.UND_ERR_INVALID_ARG`); - var p = class extends r { - constructor(e) { - super(e), this.name = `InvalidArgumentError`, this.message = e || `Invalid Argument Error`, this.code = `UND_ERR_INVALID_ARG`; - } - static [Symbol.hasInstance](e) { - return e && e[f] === !0; - } - get [f]() { - return !0; - } - }; - let m = Symbol.for(`undici.error.UND_ERR_INVALID_RETURN_VALUE`); - var h = class extends r { - constructor(e) { - super(e), this.name = `InvalidReturnValueError`, this.message = e || `Invalid Return Value Error`, this.code = `UND_ERR_INVALID_RETURN_VALUE`; - } - static [Symbol.hasInstance](e) { - return e && e[m] === !0; - } - get [m]() { - return !0; - } - }; - let g = Symbol.for(`undici.error.UND_ERR_ABORT`); - var _ = class extends r { - constructor(e) { - super(e), this.name = `AbortError`, this.message = e || `The operation was aborted`, this.code = `UND_ERR_ABORT`; - } - static [Symbol.hasInstance](e) { - return e && e[g] === !0; - } - get [g]() { - return !0; - } - }; - let v = Symbol.for(`undici.error.UND_ERR_ABORTED`); - var y = class extends _ { - constructor(e) { - super(e), this.name = `AbortError`, this.message = e || `Request aborted`, this.code = `UND_ERR_ABORTED`; - } - static [Symbol.hasInstance](e) { - return e && e[v] === !0; - } - get [v]() { - return !0; - } - }; - let b = Symbol.for(`undici.error.UND_ERR_INFO`); - var x = class extends r { - constructor(e) { - super(e), this.name = `InformationalError`, this.message = e || `Request information`, this.code = `UND_ERR_INFO`; - } - static [Symbol.hasInstance](e) { - return e && e[b] === !0; - } - get [b]() { - return !0; - } - }; - let S = Symbol.for(`undici.error.UND_ERR_REQ_CONTENT_LENGTH_MISMATCH`); - var C = class extends r { - constructor(e) { - super(e), this.name = `RequestContentLengthMismatchError`, this.message = e || `Request body length does not match content-length header`, this.code = `UND_ERR_REQ_CONTENT_LENGTH_MISMATCH`; - } - static [Symbol.hasInstance](e) { - return e && e[S] === !0; - } - get [S]() { - return !0; - } - }; - let w = Symbol.for(`undici.error.UND_ERR_RES_CONTENT_LENGTH_MISMATCH`); - var T = class extends r { - constructor(e) { - super(e), this.name = `ResponseContentLengthMismatchError`, this.message = e || `Response body length does not match content-length header`, this.code = `UND_ERR_RES_CONTENT_LENGTH_MISMATCH`; - } - static [Symbol.hasInstance](e) { - return e && e[w] === !0; - } - get [w]() { - return !0; - } - }; - let E = Symbol.for(`undici.error.UND_ERR_DESTROYED`); - var D = class extends r { - constructor(e) { - super(e), this.name = `ClientDestroyedError`, this.message = e || `The client is destroyed`, this.code = `UND_ERR_DESTROYED`; - } - static [Symbol.hasInstance](e) { - return e && e[E] === !0; - } - get [E]() { - return !0; - } - }; - let O = Symbol.for(`undici.error.UND_ERR_CLOSED`); - var k = class extends r { - constructor(e) { - super(e), this.name = `ClientClosedError`, this.message = e || `The client is closed`, this.code = `UND_ERR_CLOSED`; - } - static [Symbol.hasInstance](e) { - return e && e[O] === !0; - } - get [O]() { - return !0; - } - }; - let A = Symbol.for(`undici.error.UND_ERR_SOCKET`); - var j = class extends r { - constructor(e, t) { - super(e), this.name = `SocketError`, this.message = e || `Socket error`, this.code = `UND_ERR_SOCKET`, this.socket = t; - } - static [Symbol.hasInstance](e) { - return e && e[A] === !0; - } - get [A]() { - return !0; - } - }; - let M = Symbol.for(`undici.error.UND_ERR_NOT_SUPPORTED`); - var N = class extends r { - constructor(e) { - super(e), this.name = `NotSupportedError`, this.message = e || `Not supported error`, this.code = `UND_ERR_NOT_SUPPORTED`; - } - static [Symbol.hasInstance](e) { - return e && e[M] === !0; - } - get [M]() { - return !0; - } - }; - let P = Symbol.for(`undici.error.UND_ERR_BPL_MISSING_UPSTREAM`); - var F = class extends r { - constructor(e) { - super(e), this.name = `MissingUpstreamError`, this.message = e || `No upstream has been added to the BalancedPool`, this.code = `UND_ERR_BPL_MISSING_UPSTREAM`; - } - static [Symbol.hasInstance](e) { - return e && e[P] === !0; - } - get [P]() { - return !0; - } - }; - let I = Symbol.for(`undici.error.UND_ERR_HTTP_PARSER`); - var ee = class extends Error { - constructor(e, t, n) { - super(e), this.name = `HTTPParserError`, this.code = t ? `HPE_${t}` : void 0, this.data = n ? n.toString() : void 0; - } - static [Symbol.hasInstance](e) { - return e && e[I] === !0; - } - get [I]() { - return !0; - } - }; - let L = Symbol.for(`undici.error.UND_ERR_RES_EXCEEDED_MAX_SIZE`); - var te = class extends r { - constructor(e) { - super(e), this.name = `ResponseExceededMaxSizeError`, this.message = e || `Response content exceeded max size`, this.code = `UND_ERR_RES_EXCEEDED_MAX_SIZE`; - } - static [Symbol.hasInstance](e) { - return e && e[L] === !0; - } - get [L]() { - return !0; - } - }; - let R = Symbol.for(`undici.error.UND_ERR_REQ_RETRY`); - var ne = class extends r { - constructor(e, t, { headers: n, data: r }) { - super(e), this.name = `RequestRetryError`, this.message = e || `Request retry error`, this.code = `UND_ERR_REQ_RETRY`, this.statusCode = t, this.data = r, this.headers = n; - } - static [Symbol.hasInstance](e) { - return e && e[R] === !0; - } - get [R]() { - return !0; - } - }; - let re = Symbol.for(`undici.error.UND_ERR_RESPONSE`); - var z = class extends r { - constructor(e, t, { headers: n, body: r }) { - super(e), this.name = `ResponseError`, this.message = e || `Response error`, this.code = `UND_ERR_RESPONSE`, this.statusCode = t, this.body = r, this.headers = n; - } - static [Symbol.hasInstance](e) { - return e && e[re] === !0; - } - get [re]() { - return !0; - } - }; - let ie = Symbol.for(`undici.error.UND_ERR_PRX_TLS`); - var ae = class extends r { - constructor(e, t, n = {}) { - super(t, { - cause: e, - ...n - }), this.name = `SecureProxyConnectionError`, this.message = t || `Secure Proxy Connection failed`, this.code = `UND_ERR_PRX_TLS`, this.cause = e; - } - static [Symbol.hasInstance](e) { - return e && e[ie] === !0; - } - get [ie]() { - return !0; - } - }; - let oe = Symbol.for(`undici.error.UND_ERR_MAX_ORIGINS_REACHED`); - var se = class extends r { - constructor(e) { - super(e), this.name = `MaxOriginsReachedError`, this.message = e || `Maximum allowed origins reached`, this.code = `UND_ERR_MAX_ORIGINS_REACHED`; - } - static [Symbol.hasInstance](e) { - return e && e[oe] === !0; - } - get [oe]() { - return !0; - } - }, ce = class extends r { - constructor(e, t) { - super(e), this.name = `Socks5ProxyError`, this.message = e || `SOCKS5 proxy error`, this.code = t || `UND_ERR_SOCKS5`; - } - }; - let le = Symbol.for(`undici.error.UND_ERR_WS_MESSAGE_SIZE_EXCEEDED`); - t.exports = { - AbortError: _, - HTTPParserError: ee, - UndiciError: r, - HeadersTimeoutError: s, - HeadersOverflowError: l, - BodyTimeoutError: d, - RequestContentLengthMismatchError: C, - ConnectTimeoutError: a, - InvalidArgumentError: p, - InvalidReturnValueError: h, - RequestAbortedError: y, - ClientDestroyedError: D, - ClientClosedError: k, - InformationalError: x, - SocketError: j, - NotSupportedError: N, - ResponseContentLengthMismatchError: T, - BalancedPoolMissingUpstreamError: F, - ResponseExceededMaxSizeError: te, - RequestRetryError: ne, - ResponseError: z, - SecureProxyConnectionError: ae, - MaxOriginsReachedError: se, - Socks5ProxyError: ce, - MessageSizeExceededError: class extends r { - constructor(e) { - super(e), this.name = `MessageSizeExceededError`, this.message = e || `Max decompressed message size exceeded`, this.code = `UND_ERR_WS_MESSAGE_SIZE_EXCEEDED`; - } - static [Symbol.hasInstance](e) { - return e && e[le] === !0; - } - get [le]() { - return !0; - } - } - }; -})); -var pa$3 = c$12(((e, t) => { - let n = `Accept.Accept-Encoding.Accept-Language.Accept-Ranges.Access-Control-Allow-Credentials.Access-Control-Allow-Headers.Access-Control-Allow-Methods.Access-Control-Allow-Origin.Access-Control-Expose-Headers.Access-Control-Max-Age.Access-Control-Request-Headers.Access-Control-Request-Method.Age.Allow.Alt-Svc.Alt-Used.Authorization.Cache-Control.Clear-Site-Data.Connection.Content-Disposition.Content-Encoding.Content-Language.Content-Length.Content-Location.Content-Range.Content-Security-Policy.Content-Security-Policy-Report-Only.Content-Type.Cookie.Cross-Origin-Embedder-Policy.Cross-Origin-Opener-Policy.Cross-Origin-Resource-Policy.Date.Device-Memory.Downlink.ECT.ETag.Expect.Expect-CT.Expires.Forwarded.From.Host.If-Match.If-Modified-Since.If-None-Match.If-Range.If-Unmodified-Since.Keep-Alive.Last-Modified.Link.Location.Max-Forwards.Origin.Permissions-Policy.Pragma.Proxy-Authenticate.Proxy-Authorization.RTT.Range.Referer.Referrer-Policy.Refresh.Retry-After.Sec-WebSocket-Accept.Sec-WebSocket-Extensions.Sec-WebSocket-Key.Sec-WebSocket-Protocol.Sec-WebSocket-Version.Server.Server-Timing.Service-Worker-Allowed.Service-Worker-Navigation-Preload.Set-Cookie.SourceMap.Strict-Transport-Security.Supports-Loading-Mode.TE.Timing-Allow-Origin.Trailer.Transfer-Encoding.Upgrade.Upgrade-Insecure-Requests.User-Agent.Vary.Via.WWW-Authenticate.X-Content-Type-Options.X-DNS-Prefetch-Control.X-Frame-Options.X-Permitted-Cross-Domain-Policies.X-Powered-By.X-Requested-With.X-XSS-Protection`.split(`.`), r = {}; - Object.setPrototypeOf(r, null); - let i = {}; - Object.setPrototypeOf(i, null); - function a(e) { - let t = i[e]; - return t === void 0 && (t = Buffer.from(e)), t; - } - for (let e = 0; e < n.length; ++e) { - let t = n[e], i = t.toLowerCase(); - r[t] = r[i] = i; - } - t.exports = { - wellknownHeaderNames: n, - headerNameLowerCasedRecord: r, - getHeaderNameAsBuffer: a - }; -})); -var ma$3 = c$12(((e, t) => { - let { wellknownHeaderNames: n, headerNameLowerCasedRecord: r } = pa$3(); - var i = class e { - value = null; - left = null; - middle = null; - right = null; - code; - constructor(t, n, r) { - if (r === void 0 || r >= t.length) throw TypeError(`Unreachable`); - if ((this.code = t.charCodeAt(r)) > 127) throw TypeError(`key must be ascii string`); - t.length === ++r ? this.value = n : this.middle = new e(t, n, r); - } - add(t, n) { - let r = t.length; - if (r === 0) throw TypeError(`Unreachable`); - let i = 0, a = this; - for (;;) { - let o = t.charCodeAt(i); - if (o > 127) throw TypeError(`key must be ascii string`); - if (a.code === o) if (r === ++i) { - a.value = n; - break; - } else if (a.middle !== null) a = a.middle; - else { - a.middle = new e(t, n, i); - break; - } - else if (a.code < o) if (a.left !== null) a = a.left; - else { - a.left = new e(t, n, i); - break; - } - else if (a.right !== null) a = a.right; - else { - a.right = new e(t, n, i); - break; - } - } - } - search(e) { - let t = e.length, n = 0, r = this; - for (; r !== null && n < t;) { - let i = e[n]; - for (i <= 90 && i >= 65 && (i |= 32); r !== null;) { - if (i === r.code) { - if (t === ++n) return r; - r = r.middle; - break; - } - r = r.code < i ? r.left : r.right; - } - } - return null; - } - }, a = class { - node = null; - insert(e, t) { - this.node === null ? this.node = new i(e, t, 0) : this.node.add(e, t); - } - lookup(e) { - return this.node?.search(e)?.value ?? null; - } - }; - let o = new a(); - for (let e = 0; e < n.length; ++e) { - let t = r[n[e]]; - o.insert(t, t); - } - t.exports = { - TernarySearchTree: a, - tree: o - }; -})); -var q$6 = c$12(((e, n) => { - let r = f$11(`node:assert`), { kDestroyed: i, kBodyUsed: a, kListeners: o, kBody: s } = da$3(), { IncomingMessage: c } = f$11(`node:http`), l = f$11(`node:stream`), u = f$11(`node:net`), { stringify: d } = f$11(`node:querystring`), { EventEmitter: f } = f$11(`node:events`), p = fa$3(), { InvalidArgumentError: m, ConnectTimeoutError: h } = K$6(), { headerNameLowerCasedRecord: g } = pa$3(), { tree: _ } = ma$3(), [v, y] = process.versions.node.split(`.`, 2).map((e) => Number(e)); - var b = class { - constructor(e) { - this[s] = e, this[a] = !1; - } - async *[Symbol.asyncIterator]() { - r(!this[a], `disturbed`), this[a] = !0, yield* this[s]; - } - }; - function x() {} - function S(e) { - return C(e) ? (ee(e) === 0 && e.on(`data`, function() { - r(!1); - }), typeof e.readableDidRead != `boolean` && (e[a] = !1, f.prototype.on.call(e, `data`, function() { - this[a] = !0; - })), e) : e && typeof e.pipeTo == `function` ? new b(e) : e && de(e) ? e : e && typeof e != `string` && !ArrayBuffer.isView(e) && F(e) ? new b(e) : e; - } - function C(e) { - return e && typeof e == `object` && typeof e.pipe == `function` && typeof e.on == `function`; - } - function w(e) { - if (e === null) return !1; - if (e instanceof Blob) return !0; - if (typeof e != `object`) return !1; - { - let t = e[Symbol.toStringTag]; - return (t === `Blob` || t === `File`) && (`stream` in e && typeof e.stream == `function` || `arrayBuffer` in e && typeof e.arrayBuffer == `function`); - } - } - function T(e) { - return e.includes(`?`) || e.includes(`#`); - } - function E(e, t) { - if (T(e)) throw Error(`Query params cannot be passed when url already contains "?" or "#".`); - let n = d(t); - return n && (e += `?` + n), e; - } - function D(e) { - let t = parseInt(e, 10); - return t === Number(e) && t >= 0 && t <= 65535; - } - function O(e) { - return e != null && e[0] === `h` && e[1] === `t` && e[2] === `t` && e[3] === `p` && (e[4] === `:` || e[4] === `s` && e[5] === `:`); - } - function k(e) { - if (typeof e == `string`) { - if (e = new URL(e), !O(e.origin || e.protocol)) throw new m("Invalid URL protocol: the URL must start with `http:` or `https:`."); - return e; - } - if (!e || typeof e != `object`) throw new m(`Invalid URL: The URL argument must be a non-null object.`); - if (!(e instanceof URL)) { - if (e.port != null && e.port !== `` && D(e.port) === !1) throw new m(`Invalid URL: port must be a valid integer or a string representation of an integer.`); - if (e.path != null && typeof e.path != `string`) throw new m(`Invalid URL path: the path must be a string or null/undefined.`); - if (e.pathname != null && typeof e.pathname != `string`) throw new m(`Invalid URL pathname: the pathname must be a string or null/undefined.`); - if (e.hostname != null && typeof e.hostname != `string`) throw new m(`Invalid URL hostname: the hostname must be a string or null/undefined.`); - if (e.origin != null && typeof e.origin != `string`) throw new m(`Invalid URL origin: the origin must be a string or null/undefined.`); - if (!O(e.origin || e.protocol)) throw new m("Invalid URL protocol: the URL must start with `http:` or `https:`."); - let t = e.port == null ? e.protocol === `https:` ? 443 : 80 : e.port, n = e.origin == null ? `${e.protocol || ``}//${e.hostname || ``}:${t}` : e.origin, r = e.path == null ? `${e.pathname || ``}${e.search || ``}` : e.path; - return n[n.length - 1] === `/` && (n = n.slice(0, n.length - 1)), r && r[0] !== `/` && (r = `/${r}`), new URL(`${n}${r}`); - } - if (!O(e.origin || e.protocol)) throw new m("Invalid URL protocol: the URL must start with `http:` or `https:`."); - return e; - } - function A(e) { - if (e = k(e), e.pathname !== `/` || e.search || e.hash) throw new m(`invalid url`); - return e; - } - function j(e) { - if (e[0] === `[`) { - let t = e.indexOf(`]`); - return r(t !== -1), e.substring(1, t); - } - let t = e.indexOf(`:`); - return t === -1 ? e : e.substring(0, t); - } - function M(e) { - if (!e) return null; - r(typeof e == `string`); - let t = j(e); - return u.isIP(t) ? `` : t; - } - function N(e) { - return JSON.parse(JSON.stringify(e)); - } - function P(e) { - return e != null && typeof e[Symbol.asyncIterator] == `function`; - } - function F(e) { - return e != null && (typeof e[Symbol.iterator] == `function` || typeof e[Symbol.asyncIterator] == `function`); - } - function I(e) { - let t = Object.getPrototypeOf(e); - return Object.prototype.hasOwnProperty.call(e, Symbol.iterator) || t != null && t !== Object.prototype && typeof e[Symbol.iterator] == `function`; - } - function ee(e) { - if (e == null) return 0; - if (C(e)) { - let t = e._readableState; - return t && t.objectMode === !1 && t.ended === !0 && Number.isFinite(t.length) ? t.length : null; - } else if (w(e)) return e.size == null ? null : e.size; - else if (se(e)) return e.byteLength; - return null; - } - function L(e) { - return e && !!(e.destroyed || e[i] || l.isDestroyed?.(e)); - } - function te(e, t) { - e == null || !C(e) || L(e) || (typeof e.destroy == `function` ? (Object.getPrototypeOf(e).constructor === c && (e.socket = null), e.destroy(t)) : t && queueMicrotask(() => { - e.emit(`error`, t); - }), e.destroyed !== !0 && (e[i] = !0)); - } - let R = /timeout=(\d+)/; - function ne(e) { - let t = e.match(R); - return t ? parseInt(t[1], 10) * 1e3 : null; - } - function re(e) { - return typeof e == `string` ? g[e] ?? e.toLowerCase() : _.lookup(e) ?? e.toString(`latin1`).toLowerCase(); - } - function z(e) { - return _.lookup(e) ?? e.toString(`latin1`).toLowerCase(); - } - function ie(e, t) { - t === void 0 && (t = {}); - for (let n = 0; n < e.length; n += 2) { - let r = re(e[n]), i = t[r]; - if (i !== void 0) if (Object.hasOwn(t, r)) typeof i == `string` && (i = [i], t[r] = i), i.push(e[n + 1].toString(`latin1`)); - else { - let i = typeof e[n + 1] == `string` ? e[n + 1] : Array.isArray(e[n + 1]) ? e[n + 1].map((e) => e.toString(`latin1`)) : e[n + 1].toString(`latin1`); - r === `__proto__` ? Object.defineProperty(t, r, { - value: i, - enumerable: !0, - configurable: !0, - writable: !0 - }) : t[r] = i; - } - else { - let i = typeof e[n + 1] == `string` ? e[n + 1] : Array.isArray(e[n + 1]) ? e[n + 1].map((e) => e.toString(`latin1`)) : e[n + 1].toString(`latin1`); - t[r] = i; - } - } - return t; - } - function ae(e) { - let t = e.length, n = Array(t), r, i; - for (let a = 0; a < t; a += 2) r = e[a], i = e[a + 1], typeof r != `string` && (r = r.toString()), typeof i != `string` && (i = i.toString(`latin1`)), n[a] = r, n[a + 1] = i; - return n; - } - function oe(e) { - if (!Array.isArray(e)) throw TypeError(`expected headers to be an array`); - return e.map((e) => Buffer.from(e)); - } - function se(e) { - return e instanceof Uint8Array || Buffer.isBuffer(e); - } - function ce(e, t, n) { - if (!e || typeof e != `object`) throw new m(`handler must be an object`); - if (typeof e.onRequestStart != `function`) { - if (typeof e.onConnect != `function`) throw new m(`invalid onConnect method`); - if (typeof e.onError != `function`) throw new m(`invalid onError method`); - if (typeof e.onBodySent != `function` && e.onBodySent !== void 0) throw new m(`invalid onBodySent method`); - if (n || t === `CONNECT`) { - if (typeof e.onUpgrade != `function`) throw new m(`invalid onUpgrade method`); - } else { - if (typeof e.onHeaders != `function`) throw new m(`invalid onHeaders method`); - if (typeof e.onData != `function`) throw new m(`invalid onData method`); - if (typeof e.onComplete != `function`) throw new m(`invalid onComplete method`); - } - } - } - function le(e) { - return !!(e && (l.isDisturbed(e) || e[a])); - } - function B(e) { - return { - localAddress: e.localAddress, - localPort: e.localPort, - remoteAddress: e.remoteAddress, - remotePort: e.remotePort, - remoteFamily: e.remoteFamily, - timeout: e.timeout, - bytesWritten: e.bytesWritten, - bytesRead: e.bytesRead - }; - } - function ue(e) { - let t; - return new ReadableStream({ - start() { - t = e[Symbol.asyncIterator](); - }, - pull(e) { - return t.next().then(({ done: t, value: n }) => { - if (t) return queueMicrotask(() => { - e.close(), e.byobRequest?.respond(0); - }); - { - let t = Buffer.isBuffer(n) ? n : Buffer.from(n); - return t.byteLength ? e.enqueue(new Uint8Array(t)) : this.pull(e); - } - }); - }, - cancel() { - return t.return(); - }, - type: `bytes` - }); - } - function de(e) { - return e && typeof e == `object` && typeof e.append == `function` && typeof e.delete == `function` && typeof e.get == `function` && typeof e.getAll == `function` && typeof e.has == `function` && typeof e.set == `function` && e[Symbol.toStringTag] === `FormData`; - } - function fe(e, t) { - return `addEventListener` in e ? (e.addEventListener(`abort`, t, { once: !0 }), () => e.removeEventListener(`abort`, t)) : (e.once(`abort`, t), () => e.removeListener(`abort`, t)); - } - let V = new Uint8Array([ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 0, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 1, - 1, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 1, - 0, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ]); - function pe(e) { - return V[e] === 1; - } - let me = /^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/; - function he(e) { - if (e.length >= 12) return me.test(e); - if (e.length === 0) return !1; - for (let t = 0; t < e.length; t++) if (V[e.charCodeAt(t)] !== 1) return !1; - return !0; - } - let ge = /[^\t\x20-\x7e\x80-\xff]/; - function H(e) { - return !ge.test(e); - } - let _e = /^bytes (\d+)-(\d+)\/(\d+)?$/; - function ve(e) { - if (e == null || e === ``) return { - start: 0, - end: null, - size: null - }; - let t = e ? e.match(_e) : null; - return t ? { - start: parseInt(t[1]), - end: t[2] ? parseInt(t[2]) : null, - size: t[3] ? parseInt(t[3]) : null - } : null; - } - function ye(e, t, n) { - return (e[o] ??= []).push([t, n]), e.on(t, n), e; - } - function be(e) { - if (e[o] != null) { - for (let [t, n] of e[o]) e.removeListener(t, n); - e[o] = null; - } - return e; - } - function xe(e, t, n) { - try { - t.onError(n), r(t.aborted); - } catch (t) { - e.emit(`error`, t); - } - } - let Se = process.platform === `win32` ? (e, t) => { - if (!t.timeout) return x; - let n = null, r = null, i = p.setFastTimeout(() => { - n = setImmediate(() => { - r = setImmediate(() => Ce(e.deref(), t)); - }); - }, t.timeout); - return () => { - p.clearFastTimeout(i), clearImmediate(n), clearImmediate(r); - }; - } : (e, t) => { - if (!t.timeout) return x; - let n = null, r = p.setFastTimeout(() => { - n = setImmediate(() => { - Ce(e.deref(), t); - }); - }, t.timeout); - return () => { - p.clearFastTimeout(r), clearImmediate(n); - }; - }; - function Ce(e, t) { - if (e == null) return; - let n = `Connect Timeout Error`; - Array.isArray(e.autoSelectFamilyAttemptedAddresses) ? n += ` (attempted addresses: ${e.autoSelectFamilyAttemptedAddresses.join(`, `)},` : n += ` (attempted address: ${t.hostname}:${t.port},`, n += ` timeout: ${t.timeout}ms)`, te(e, new h(n)); - } - function we(e) { - if (e[0] === `h` && e[1] === `t` && e[2] === `t` && e[3] === `p`) switch (e[4]) { - case `:`: return `http:`; - case `s`: if (e[5] === `:`) return `https:`; - } - return e.slice(0, e.indexOf(`:`) + 1); - } - let Te = Object.create(null); - Te.enumerable = !0; - let Ee = { - delete: `DELETE`, - DELETE: `DELETE`, - get: `GET`, - GET: `GET`, - head: `HEAD`, - HEAD: `HEAD`, - options: `OPTIONS`, - OPTIONS: `OPTIONS`, - post: `POST`, - POST: `POST`, - put: `PUT`, - PUT: `PUT` - }, U = { - ...Ee, - patch: `patch`, - PATCH: `PATCH` - }; - Object.setPrototypeOf(Ee, null), Object.setPrototypeOf(U, null), n.exports = { - kEnumerableProperty: Te, - isDisturbed: le, - isBlobLike: w, - parseOrigin: A, - parseURL: k, - getServerName: M, - isStream: C, - isIterable: F, - hasSafeIterator: I, - isAsyncIterable: P, - isDestroyed: L, - headerNameToString: re, - bufferToLowerCasedHeaderName: z, - addListener: ye, - removeAllListeners: be, - errorRequest: xe, - parseRawHeaders: ae, - encodeRawHeaders: oe, - parseHeaders: ie, - parseKeepAliveTimeout: ne, - destroy: te, - bodyLength: ee, - deepClone: N, - ReadableStreamFrom: ue, - isBuffer: se, - assertRequestHandler: ce, - getSocketInfo: B, - isFormDataLike: de, - pathHasQueryOrFragment: T, - serializePathWithQuery: E, - addAbortListener: fe, - isValidHTTPToken: he, - isValidHeaderValue: H, - isTokenCharCode: pe, - parseRangeHeader: ve, - normalizedMethodRecordsBase: Ee, - normalizedMethodRecords: U, - isValidPort: D, - isHttpOrHttpsPrefixed: O, - nodeMajor: v, - nodeMinor: y, - safeHTTPMethods: Object.freeze([ - `GET`, - `HEAD`, - `OPTIONS`, - `TRACE` - ]), - wrapRequestBody: S, - setupConnectTimeout: Se, - getProtocolFromUrlString: we - }; -})); -var ha$3 = c$12(((e, t) => { - let { kConnected: n, kPending: r, kRunning: i, kSize: a, kFree: o, kQueued: s } = da$3(); - t.exports = { - ClientStats: class { - constructor(e) { - this.connected = e[n], this.pending = e[r], this.running = e[i], this.size = e[a]; - } - }, - PoolStats: class { - constructor(e) { - this.connected = e[n], this.free = e[o], this.pending = e[r], this.queued = e[s], this.running = e[i], this.size = e[a]; - } - } - }; -})); -var ga$3 = c$12(((e, n) => { - let r = f$11(`node:diagnostics_channel`), i = f$11(`node:util`), a = i.debuglog(`undici`), o = i.debuglog(`fetch`), s = i.debuglog(`websocket`), c = { - beforeConnect: r.channel(`undici:client:beforeConnect`), - connected: r.channel(`undici:client:connected`), - connectError: r.channel(`undici:client:connectError`), - sendHeaders: r.channel(`undici:client:sendHeaders`), - create: r.channel(`undici:request:create`), - bodySent: r.channel(`undici:request:bodySent`), - bodyChunkSent: r.channel(`undici:request:bodyChunkSent`), - bodyChunkReceived: r.channel(`undici:request:bodyChunkReceived`), - headers: r.channel(`undici:request:headers`), - trailers: r.channel(`undici:request:trailers`), - error: r.channel(`undici:request:error`), - open: r.channel(`undici:websocket:open`), - close: r.channel(`undici:websocket:close`), - socketError: r.channel(`undici:websocket:socket_error`), - ping: r.channel(`undici:websocket:ping`), - pong: r.channel(`undici:websocket:pong`), - proxyConnected: r.channel(`undici:proxy:connected`) - }, l = !1; - function u(e = a) { - if (!l) { - if (c.beforeConnect.hasSubscribers || c.connected.hasSubscribers || c.connectError.hasSubscribers || c.sendHeaders.hasSubscribers) { - l = !0; - return; - } - l = !0, r.subscribe(`undici:client:beforeConnect`, (t) => { - let { connectParams: { version: n, protocol: r, port: i, host: a } } = t; - e(`connecting to %s%s using %s%s`, a, i ? `:${i}` : ``, r, n); - }), r.subscribe(`undici:client:connected`, (t) => { - let { connectParams: { version: n, protocol: r, port: i, host: a } } = t; - e(`connected to %s%s using %s%s`, a, i ? `:${i}` : ``, r, n); - }), r.subscribe(`undici:client:connectError`, (t) => { - let { connectParams: { version: n, protocol: r, port: i, host: a }, error: o } = t; - e(`connection to %s%s using %s%s errored - %s`, a, i ? `:${i}` : ``, r, n, o.message); - }), r.subscribe(`undici:client:sendHeaders`, (t) => { - let { request: { method: n, path: r, origin: i } } = t; - e(`sending request to %s %s%s`, n, i, r); - }); - } - } - let d = !1; - function f(e = a) { - if (!d) { - if (c.headers.hasSubscribers || c.trailers.hasSubscribers || c.error.hasSubscribers) { - d = !0; - return; - } - d = !0, r.subscribe(`undici:request:headers`, (t) => { - let { request: { method: n, path: r, origin: i }, response: { statusCode: a } } = t; - e(`received response to %s %s%s - HTTP %d`, n, i, r, a); - }), r.subscribe(`undici:request:trailers`, (t) => { - let { request: { method: n, path: r, origin: i } } = t; - e(`trailers received from %s %s%s`, n, i, r); - }), r.subscribe(`undici:request:error`, (t) => { - let { request: { method: n, path: r, origin: i }, error: a } = t; - e(`request to %s %s%s errored - %s`, n, i, r, a.message); - }); - } - } - let p = !1; - function m(e = s) { - if (!p) { - if (c.open.hasSubscribers || c.close.hasSubscribers || c.socketError.hasSubscribers || c.ping.hasSubscribers || c.pong.hasSubscribers) { - p = !0; - return; - } - p = !0, r.subscribe(`undici:websocket:open`, (t) => { - if (t.address != null) { - let { address: n, port: r } = t.address; - e(`connection opened %s%s`, n, r ? `:${r}` : ``); - } else e(`connection opened`); - }), r.subscribe(`undici:websocket:close`, (t) => { - let { websocket: n, code: r, reason: i } = t; - e(`closed connection to %s - %s %s`, n.url, r, i); - }), r.subscribe(`undici:websocket:socket_error`, (t) => { - e(`connection errored - %s`, t.message); - }), r.subscribe(`undici:websocket:ping`, (t) => { - e(`ping received`); - }), r.subscribe(`undici:websocket:pong`, (t) => { - e(`pong received`); - }); - } - } - (a.enabled || o.enabled) && (u(o.enabled ? o : a), f(o.enabled ? o : a)), s.enabled && (u(a.enabled ? a : s), m(s)), n.exports = { channels: c }; -})); -var _a$3 = c$12(((e, n) => { - let { InvalidArgumentError: r, NotSupportedError: i } = K$6(), a = f$11(`node:assert`), { isValidHTTPToken: o, isValidHeaderValue: s, isStream: c, destroy: l, isBuffer: u, isFormDataLike: d, isIterable: f, hasSafeIterator: p, isBlobLike: m, serializePathWithQuery: h, assertRequestHandler: g, getServerName: _, normalizedMethodRecords: v, getProtocolFromUrlString: y } = q$6(), { channels: b } = ga$3(), { headerNameLowerCasedRecord: x } = pa$3(), S = /[^\u0021-\u00ff]/; - function C(e) { - if (typeof e != `string` || e.length === 0) return !1; - for (let t = 0; t < e.length; t++) { - let n = e.charCodeAt(t); - if (n < 48 || n > 57) return !1; - } - return !0; - } - let w = Symbol(`handler`); - var T = class { - constructor(e, { path: t, method: n, body: i, headers: a, query: x, idempotent: C, blocking: T, upgrade: D, headersTimeout: O, bodyTimeout: k, reset: A, expectContinue: j, servername: M, throwOnError: N, maxRedirections: P, typeOfService: F }, I) { - if (typeof t != `string`) throw new r(`path must be a string`); - if (t[0] !== `/` && !(t.startsWith(`http://`) || t.startsWith(`https://`)) && n !== `CONNECT`) throw new r(`path must be an absolute URL or start with a slash`); - if (S.test(t)) throw new r(`invalid request path`); - if (typeof n != `string`) throw new r(`method must be a string`); - if (v[n] === void 0 && !o(n)) throw new r(`invalid request method`); - if (D && typeof D != `string`) throw new r(`upgrade must be a string`); - if (D && !s(D)) throw new r(`invalid upgrade header`); - if (O != null && (!Number.isFinite(O) || O < 0)) throw new r(`invalid headersTimeout`); - if (k != null && (!Number.isFinite(k) || k < 0)) throw new r(`invalid bodyTimeout`); - if (A != null && typeof A != `boolean`) throw new r(`invalid reset`); - if (j != null && typeof j != `boolean`) throw new r(`invalid expectContinue`); - if (N != null) throw new r(`invalid throwOnError`); - if (P != null && P !== 0) throw new r(`maxRedirections is not supported, use the redirect interceptor`); - if (F != null && (!Number.isInteger(F) || F < 0 || F > 255)) throw new r(`typeOfService must be an integer between 0 and 255`); - if (this.headersTimeout = O, this.bodyTimeout = k, this.method = n, this.typeOfService = F ?? 0, this.abort = null, i == null) this.body = null; - else if (c(i)) { - this.body = i; - let e = this.body._readableState; - (!e || !e.autoDestroy) && (this.endHandler = function() { - l(this); - }, this.body.on(`end`, this.endHandler)), this.errorHandler = (e) => { - this.abort ? this.abort(e) : this.error = e; - }, this.body.on(`error`, this.errorHandler); - } else if (u(i)) this.body = i.byteLength ? i : null; - else if (ArrayBuffer.isView(i)) this.body = i.buffer.byteLength ? Buffer.from(i.buffer, i.byteOffset, i.byteLength) : null; - else if (i instanceof ArrayBuffer) this.body = i.byteLength ? Buffer.from(i) : null; - else if (typeof i == `string`) this.body = i.length ? Buffer.from(i) : null; - else if (d(i) || f(i) || m(i)) this.body = i; - else throw new r(`body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable`); - if (this.completed = !1, this.aborted = !1, this.upgrade = D || null, this.path = x ? h(t, x) : t, this.origin = e, this.protocol = y(e), this.idempotent = C ?? (n === `HEAD` || n === `GET`), this.blocking = T ?? this.method !== `HEAD`, this.reset = A ?? null, this.host = null, this.contentLength = null, this.contentType = null, this.headers = [], this.expectContinue = j ?? !1, Array.isArray(a)) { - if (a.length % 2 != 0) throw new r(`headers array must be even`); - for (let e = 0; e < a.length; e += 2) E(this, a[e], a[e + 1]); - } else if (a && typeof a == `object`) if (p(a)) for (let e of a) { - if (!Array.isArray(e) || e.length !== 2) throw new r(`headers must be in key-value pair format`); - E(this, e[0], e[1]); - } - else { - let e = Object.keys(a); - for (let t = 0; t < e.length; ++t) E(this, e[t], a[e[t]]); - } - else if (a != null) throw new r(`headers must be an object or an array`); - g(I, n, D), this.servername = M || _(this.host) || null, this[w] = I, b.create.hasSubscribers && b.create.publish({ request: this }); - } - onBodySent(e) { - if (b.bodyChunkSent.hasSubscribers && b.bodyChunkSent.publish({ - request: this, - chunk: e - }), this[w].onBodySent) try { - return this[w].onBodySent(e); - } catch (e) { - this.abort(e); - } - } - onRequestSent() { - if (b.bodySent.hasSubscribers && b.bodySent.publish({ request: this }), this[w].onRequestSent) try { - return this[w].onRequestSent(); - } catch (e) { - this.abort(e); - } - } - onConnect(e) { - if (a(!this.aborted), a(!this.completed), this.error) e(this.error); - else return this.abort = e, this[w].onConnect(e); - } - onResponseStarted() { - return this[w].onResponseStarted?.(); - } - onHeaders(e, t, n, r) { - a(!this.aborted), a(!this.completed), b.headers.hasSubscribers && b.headers.publish({ - request: this, - response: { - statusCode: e, - headers: t, - statusText: r - } - }); - try { - return this[w].onHeaders(e, t, n, r); - } catch (e) { - this.abort(e); - } - } - onData(e) { - a(!this.aborted), a(!this.completed), b.bodyChunkReceived.hasSubscribers && b.bodyChunkReceived.publish({ - request: this, - chunk: e - }); - try { - return this[w].onData(e); - } catch (e) { - return this.abort(e), !1; - } - } - onUpgrade(e, t, n) { - return a(!this.aborted), a(!this.completed), this[w].onUpgrade(e, t, n); - } - onComplete(e) { - this.onFinally(), a(!this.aborted), a(!this.completed), this.completed = !0, b.trailers.hasSubscribers && b.trailers.publish({ - request: this, - trailers: e - }); - try { - return this[w].onComplete(e); - } catch (e) { - this.onError(e); - } - } - onError(e) { - if (this.onFinally(), b.error.hasSubscribers && b.error.publish({ - request: this, - error: e - }), !this.aborted) return this.aborted = !0, this[w].onError(e); - } - onFinally() { - this.errorHandler &&= (this.body.off(`error`, this.errorHandler), null), this.endHandler &&= (this.body.off(`end`, this.endHandler), null); - } - addHeader(e, t) { - return E(this, e, t), this; - } - }; - function E(e, t, n) { - if (n && typeof n == `object` && !Array.isArray(n)) throw new r(`invalid ${t} header`); - if (n === void 0) return; - let a = x[t]; - if (a === void 0 && (a = t.toLowerCase(), x[a] === void 0 && !o(a))) throw new r(`invalid header key`); - if (Array.isArray(n)) { - let e = []; - for (let i = 0; i < n.length; i++) if (typeof n[i] == `string`) { - if (!s(n[i])) throw new r(`invalid ${t} header`); - e.push(n[i]); - } else if (n[i] === null) e.push(``); - else if (typeof n[i] == `object`) throw new r(`invalid ${t} header`); - else e.push(`${n[i]}`); - n = e; - } else if (typeof n == `string`) { - if (!s(n)) throw new r(`invalid ${t} header`); - } else n = n === null ? `` : `${n}`; - if (a === `host`) { - if (e.host !== null) throw new r(`duplicate host header`); - if (typeof n != `string`) throw new r(`invalid host header`); - e.host = n; - } else if (a === `content-length`) { - if (e.contentLength !== null) throw new r(`duplicate content-length header`); - if (!C(n)) throw new r(`invalid content-length header`); - e.contentLength = parseInt(n, 10); - } else if (e.contentType === null && a === `content-type`) e.contentType = n, e.headers.push(t, n); - else if (a === `transfer-encoding` || a === `keep-alive` || a === `upgrade`) throw new r(`invalid ${a} header`); - else if (a === `connection`) { - let t = typeof n == `string` ? n : null; - if (t === null) throw new r(`invalid connection header`); - for (let n of t.toLowerCase().split(`,`)) { - let t = n.trim(); - if (!o(t)) throw new r(`invalid connection header`); - t === `close` && (e.reset = !0); - } - } else if (a === `expect`) throw new i(`expect header not supported`); - else e.headers.push(t, n); - } - n.exports = T; -})); -var va$3 = c$12(((e, t) => { - let { InvalidArgumentError: n } = K$6(); - t.exports = class e { - #e; - constructor(e) { - this.#e = e; - } - static wrap(t) { - return t.onRequestStart ? t : new e(t); - } - onConnect(e, t) { - return this.#e.onConnect?.(e, t); - } - onResponseStarted() { - return this.#e.onResponseStarted?.(); - } - onHeaders(e, t, n, r) { - return this.#e.onHeaders?.(e, t, n, r); - } - onUpgrade(e, t, n) { - return this.#e.onUpgrade?.(e, t, n); - } - onData(e) { - return this.#e.onData?.(e); - } - onComplete(e) { - return this.#e.onComplete?.(e); - } - onError(e) { - if (!this.#e.onError) throw e; - return this.#e.onError?.(e); - } - onRequestStart(e, t) { - this.#e.onConnect?.((t) => e.abort(t), t); - } - onRequestUpgrade(e, t, n, i) { - let a = []; - for (let [e, t] of Object.entries(n)) a.push(Buffer.from(e, `latin1`), r(t)); - this.#e.onUpgrade?.(t, a, i); - } - onResponseStart(e, t, n, i) { - let a = []; - for (let [e, t] of Object.entries(n)) a.push(Buffer.from(e, `latin1`), r(t)); - this.#e.onHeaders?.(t, a, () => e.resume(), i) === !1 && e.pause(); - } - onResponseData(e, t) { - this.#e.onData?.(t) === !1 && e.pause(); - } - onResponseEnd(e, t) { - let n = []; - for (let [e, i] of Object.entries(t)) n.push(Buffer.from(e, `latin1`), r(i)); - this.#e.onComplete?.(n); - } - onResponseError(e, t) { - if (!this.#e.onError) throw new n(`invalid onError method`); - this.#e.onError?.(t); - } - }; - function r(e) { - return Array.isArray(e) ? e.map((e) => Buffer.from(e, `latin1`)) : Buffer.from(e, `latin1`); - } -})); -var ya$3 = c$12(((e, n) => { - let r = f$11(`node:events`), i = va$3(), a = (e) => (t, n) => e(t, i.wrap(n)); - n.exports = class extends r { - dispatch() { - throw Error(`not implemented`); - } - close() { - throw Error(`not implemented`); - } - destroy() { - throw Error(`not implemented`); - } - compose(...e) { - let t = Array.isArray(e[0]) ? e[0] : e, n = this.dispatch.bind(this); - for (let e of t) if (e != null) { - if (typeof e != `function`) throw TypeError(`invalid interceptor, expected function received ${typeof e}`); - if (n = e(n), n = a(n), n == null || typeof n != `function` || n.length !== 2) throw TypeError(`invalid interceptor`); - } - return new Proxy(this, { get: (e, t) => t === `dispatch` ? n : e[t] }); - } - }; -})); -var ba$3 = c$12(((e, t) => { - let { parseHeaders: n } = q$6(), { InvalidArgumentError: r } = K$6(), i = Symbol(`resume`); - var a = class { - #e = !1; - #t = null; - #n = !1; - #r; - [i] = null; - rawHeaders = null; - rawTrailers = null; - constructor(e) { - this.#r = e; - } - pause() { - this.#e = !0; - } - resume() { - this.#e && (this.#e = !1, this[i]?.()); - } - abort(e) { - this.#n || (this.#n = !0, this.#t = e, this.#r(e)); - } - get aborted() { - return this.#n; - } - get reason() { - return this.#t; - } - get paused() { - return this.#e; - } - }; - t.exports = class e { - #e; - #t; - constructor(e) { - this.#e = e; - } - static unwrap(t) { - return t.onRequestStart ? new e(t) : t; - } - onConnect(e, t) { - this.#t = new a(e), this.#e.onRequestStart?.(this.#t, t); - } - onResponseStarted() { - return this.#e.onResponseStarted?.(); - } - onUpgrade(e, t, r) { - this.#t.rawHeaders = t, this.#e.onRequestUpgrade?.(this.#t, e, n(t), r); - } - onHeaders(e, t, r, a) { - return this.#t[i] = r, this.#t.rawHeaders = t, this.#e.onResponseStart?.(this.#t, e, n(t), a), !this.#t.paused; - } - onData(e) { - return this.#e.onResponseData?.(this.#t, e), !this.#t.paused; - } - onComplete(e) { - this.#t.rawTrailers = e, this.#e.onResponseEnd?.(this.#t, n(e)); - } - onError(e) { - if (!this.#e.onResponseError) throw new r(`invalid onError method`); - this.#e.onResponseError?.(this.#t, e); - } - }; -})); -var xa$3 = c$12(((e, t) => { - let n = ya$3(), r = ba$3(), { ClientDestroyedError: i, ClientClosedError: a, InvalidArgumentError: o } = K$6(), { kDestroy: s, kClose: c, kClosed: l, kDestroyed: u, kDispatch: d } = da$3(), f = Symbol(`onDestroyed`), p = Symbol(`onClosed`), m = Symbol(`webSocketOptions`); - t.exports = class extends n { - [u] = !1; - [f] = null; - [l] = !1; - [p] = null; - constructor(e) { - super(), this[m] = e?.webSocket ?? {}; - } - get webSocketOptions() { - return { - maxFragments: this[m].maxFragments ?? 131072, - maxPayloadSize: this[m].maxPayloadSize ?? 128 * 1024 * 1024 - }; - } - get destroyed() { - return this[u]; - } - get closed() { - return this[l]; - } - close(e) { - if (e === void 0) return new Promise((e, t) => { - this.close((n, r) => n ? t(n) : e(r)); - }); - if (typeof e != `function`) throw new o(`invalid callback`); - if (this[u]) { - let t = new i(); - queueMicrotask(() => e(t, null)); - return; - } - if (this[l]) { - this[p] ? this[p].push(e) : queueMicrotask(() => e(null, null)); - return; - } - this[l] = !0, this[p] ??= [], this[p].push(e); - let t = () => { - let e = this[p]; - this[p] = null; - for (let t = 0; t < e.length; t++) e[t](null, null); - }; - this[c]().then(() => this.destroy()).then(() => queueMicrotask(t)); - } - destroy(e, t) { - if (typeof e == `function` && (t = e, e = null), t === void 0) return new Promise((t, n) => { - this.destroy(e, (e, r) => e ? n(e) : t(r)); - }); - if (typeof t != `function`) throw new o(`invalid callback`); - if (this[u]) { - this[f] ? this[f].push(t) : queueMicrotask(() => t(null, null)); - return; - } - e ||= new i(), this[u] = !0, this[f] ??= [], this[f].push(t); - let n = () => { - let e = this[f]; - this[f] = null; - for (let t = 0; t < e.length; t++) e[t](null, null); - }; - this[s](e).then(() => queueMicrotask(n)); - } - dispatch(e, t) { - if (!t || typeof t != `object`) throw new o(`handler must be an object`); - t = r.unwrap(t); - try { - if (!e || typeof e != `object`) throw new o(`opts must be an object.`); - if (this[u] || this[f]) throw new i(); - if (this[l]) throw new a(); - return this[d](e, t); - } catch (e) { - if (typeof t.onError != `function`) throw e; - return t.onError(e), !1; - } - } - }; -})); -var Sa$3 = c$12(((e, n) => { - let r = f$11(`node:net`), i = f$11(`node:assert`), a = q$6(), { InvalidArgumentError: o } = K$6(), s, c = class { - constructor(e) { - this._maxCachedSessions = e, this._sessionCache = /* @__PURE__ */ new Map(), this._sessionRegistry = new FinalizationRegistry((e) => { - if (this._sessionCache.size < this._maxCachedSessions) return; - let t = this._sessionCache.get(e); - t !== void 0 && t.deref() === void 0 && this._sessionCache.delete(e); - }); - } - get(e) { - let t = this._sessionCache.get(e); - return t ? t.deref() : null; - } - set(e, t) { - if (this._maxCachedSessions !== 0) { - if (this._sessionCache.has(e)) this._sessionCache.delete(e); - else if (this._sessionCache.size >= this._maxCachedSessions) { - for (let [e, t] of this._sessionCache) if (t.deref() === void 0) { - this._sessionCache.delete(e); - return; - } - let e = this._sessionCache.keys().next(); - e.done || this._sessionCache.delete(e.value); - } - this._sessionCache.set(e, new WeakRef(t)), this._sessionRegistry.register(t, e); - } - } - }; - function l({ allowH2: e, useH2c: n, maxCachedSessions: l, socketPath: u, timeout: d, session: f, ...p }) { - if (l != null && (!Number.isInteger(l) || l < 0)) throw new o(`maxCachedSessions must be a positive integer or zero`); - let m = { - path: u, - ...p - }, h = new c(l ?? 100); - return d ??= 1e4, e ??= !1, function({ hostname: o, host: c, protocol: l, port: u, servername: p, localAddress: g, httpSocket: _ }, v) { - let y; - if (l === `https:`) { - s ||= f$11(`node:tls`), p = p || m.servername || a.getServerName(c) || null; - let n = p || o; - i(n); - let r = f || h.get(n) || null; - u ||= 443, y = s.connect({ - highWaterMark: 16384, - ...m, - servername: p, - session: r, - localAddress: g, - ALPNProtocols: e ? [`http/1.1`, `h2`] : [`http/1.1`], - socket: _, - port: u, - host: o - }), y.on(`session`, function(e) { - h.set(n, e); - }); - } else i(!_, `httpSocket can only be sent on TLS update`), u ||= 80, y = r.connect({ - highWaterMark: 64 * 1024, - ...m, - localAddress: g, - port: u, - host: o - }), n === !0 && (y.alpnProtocol = `h2`); - if (m.keepAlive == null || m.keepAlive) { - let e = m.keepAliveInitialDelay === void 0 ? 6e4 : m.keepAliveInitialDelay; - y.setKeepAlive(!0, e); - } - let b = a.setupConnectTimeout(new WeakRef(y), { - timeout: d, - hostname: o, - port: u - }); - return y.setNoDelay(!0).once(l === `https:` ? `secureConnect` : `connect`, function() { - if (queueMicrotask(b), v) { - let e = v; - v = null, e(null, this); - } - }).on(`error`, function(e) { - if (queueMicrotask(b), v) { - let t = v; - v = null, t(e); - } - }), y; - }; - } - n.exports = l; -})); -var Ca$3 = c$12(((e) => { - Object.defineProperty(e, "__esModule", { value: !0 }), e.enumToMap = t; - function t(e, t = [], n = []) { - let r = (t?.length ?? 0) === 0, i = (n?.length ?? 0) === 0; - return Object.fromEntries(Object.entries(e).filter(([, e]) => typeof e == `number` && (r || t.includes(e)) && (i || !n.includes(e)))); - } -})); -var wa$3 = c$12(((e) => { - Object.defineProperty(e, "__esModule", { value: !0 }), e.SPECIAL_HEADERS = e.MINOR = e.MAJOR = e.HTAB_SP_VCHAR_OBS_TEXT = e.QUOTED_STRING = e.CONNECTION_TOKEN_CHARS = e.HEADER_CHARS = e.TOKEN = e.HEX = e.URL_CHAR = e.USERINFO_CHARS = e.MARK = e.ALPHANUM = e.NUM = e.HEX_MAP = e.NUM_MAP = e.ALPHA = e.STATUSES_HTTP = e.H_METHOD_MAP = e.METHOD_MAP = e.METHODS_RTSP = e.METHODS_ICE = e.METHODS_HTTP = e.HEADER_STATE = e.FINISH = e.STATUSES = e.METHODS = e.LENIENT_FLAGS = e.FLAGS = e.TYPE = e.ERROR = void 0; - let t = Ca$3(); - e.ERROR = { - OK: 0, - INTERNAL: 1, - STRICT: 2, - CR_EXPECTED: 25, - LF_EXPECTED: 3, - UNEXPECTED_CONTENT_LENGTH: 4, - UNEXPECTED_SPACE: 30, - CLOSED_CONNECTION: 5, - INVALID_METHOD: 6, - INVALID_URL: 7, - INVALID_CONSTANT: 8, - INVALID_VERSION: 9, - INVALID_HEADER_TOKEN: 10, - INVALID_CONTENT_LENGTH: 11, - INVALID_CHUNK_SIZE: 12, - INVALID_STATUS: 13, - INVALID_EOF_STATE: 14, - INVALID_TRANSFER_ENCODING: 15, - CB_MESSAGE_BEGIN: 16, - CB_HEADERS_COMPLETE: 17, - CB_MESSAGE_COMPLETE: 18, - CB_CHUNK_HEADER: 19, - CB_CHUNK_COMPLETE: 20, - PAUSED: 21, - PAUSED_UPGRADE: 22, - PAUSED_H2_UPGRADE: 23, - USER: 24, - CB_URL_COMPLETE: 26, - CB_STATUS_COMPLETE: 27, - CB_METHOD_COMPLETE: 32, - CB_VERSION_COMPLETE: 33, - CB_HEADER_FIELD_COMPLETE: 28, - CB_HEADER_VALUE_COMPLETE: 29, - CB_CHUNK_EXTENSION_NAME_COMPLETE: 34, - CB_CHUNK_EXTENSION_VALUE_COMPLETE: 35, - CB_RESET: 31, - CB_PROTOCOL_COMPLETE: 38 - }, e.TYPE = { - BOTH: 0, - REQUEST: 1, - RESPONSE: 2 - }, e.FLAGS = { - CONNECTION_KEEP_ALIVE: 1, - CONNECTION_CLOSE: 2, - CONNECTION_UPGRADE: 4, - CHUNKED: 8, - UPGRADE: 16, - CONTENT_LENGTH: 32, - SKIPBODY: 64, - TRAILING: 128, - TRANSFER_ENCODING: 512 - }, e.LENIENT_FLAGS = { - HEADERS: 1, - CHUNKED_LENGTH: 2, - KEEP_ALIVE: 4, - TRANSFER_ENCODING: 8, - VERSION: 16, - DATA_AFTER_CLOSE: 32, - OPTIONAL_LF_AFTER_CR: 64, - OPTIONAL_CRLF_AFTER_CHUNK: 128, - OPTIONAL_CR_BEFORE_LF: 256, - SPACES_AFTER_CHUNK_SIZE: 512 - }, e.METHODS = { - DELETE: 0, - GET: 1, - HEAD: 2, - POST: 3, - PUT: 4, - CONNECT: 5, - OPTIONS: 6, - TRACE: 7, - COPY: 8, - LOCK: 9, - MKCOL: 10, - MOVE: 11, - PROPFIND: 12, - PROPPATCH: 13, - SEARCH: 14, - UNLOCK: 15, - BIND: 16, - REBIND: 17, - UNBIND: 18, - ACL: 19, - REPORT: 20, - MKACTIVITY: 21, - CHECKOUT: 22, - MERGE: 23, - "M-SEARCH": 24, - NOTIFY: 25, - SUBSCRIBE: 26, - UNSUBSCRIBE: 27, - PATCH: 28, - PURGE: 29, - MKCALENDAR: 30, - LINK: 31, - UNLINK: 32, - SOURCE: 33, - PRI: 34, - DESCRIBE: 35, - ANNOUNCE: 36, - SETUP: 37, - PLAY: 38, - PAUSE: 39, - TEARDOWN: 40, - GET_PARAMETER: 41, - SET_PARAMETER: 42, - REDIRECT: 43, - RECORD: 44, - FLUSH: 45, - QUERY: 46 - }, e.STATUSES = { - CONTINUE: 100, - SWITCHING_PROTOCOLS: 101, - PROCESSING: 102, - EARLY_HINTS: 103, - RESPONSE_IS_STALE: 110, - REVALIDATION_FAILED: 111, - DISCONNECTED_OPERATION: 112, - HEURISTIC_EXPIRATION: 113, - MISCELLANEOUS_WARNING: 199, - OK: 200, - CREATED: 201, - ACCEPTED: 202, - NON_AUTHORITATIVE_INFORMATION: 203, - NO_CONTENT: 204, - RESET_CONTENT: 205, - PARTIAL_CONTENT: 206, - MULTI_STATUS: 207, - ALREADY_REPORTED: 208, - TRANSFORMATION_APPLIED: 214, - IM_USED: 226, - MISCELLANEOUS_PERSISTENT_WARNING: 299, - MULTIPLE_CHOICES: 300, - MOVED_PERMANENTLY: 301, - FOUND: 302, - SEE_OTHER: 303, - NOT_MODIFIED: 304, - USE_PROXY: 305, - SWITCH_PROXY: 306, - TEMPORARY_REDIRECT: 307, - PERMANENT_REDIRECT: 308, - BAD_REQUEST: 400, - UNAUTHORIZED: 401, - PAYMENT_REQUIRED: 402, - FORBIDDEN: 403, - NOT_FOUND: 404, - METHOD_NOT_ALLOWED: 405, - NOT_ACCEPTABLE: 406, - PROXY_AUTHENTICATION_REQUIRED: 407, - REQUEST_TIMEOUT: 408, - CONFLICT: 409, - GONE: 410, - LENGTH_REQUIRED: 411, - PRECONDITION_FAILED: 412, - PAYLOAD_TOO_LARGE: 413, - URI_TOO_LONG: 414, - UNSUPPORTED_MEDIA_TYPE: 415, - RANGE_NOT_SATISFIABLE: 416, - EXPECTATION_FAILED: 417, - IM_A_TEAPOT: 418, - PAGE_EXPIRED: 419, - ENHANCE_YOUR_CALM: 420, - MISDIRECTED_REQUEST: 421, - UNPROCESSABLE_ENTITY: 422, - LOCKED: 423, - FAILED_DEPENDENCY: 424, - TOO_EARLY: 425, - UPGRADE_REQUIRED: 426, - PRECONDITION_REQUIRED: 428, - TOO_MANY_REQUESTS: 429, - REQUEST_HEADER_FIELDS_TOO_LARGE_UNOFFICIAL: 430, - REQUEST_HEADER_FIELDS_TOO_LARGE: 431, - LOGIN_TIMEOUT: 440, - NO_RESPONSE: 444, - RETRY_WITH: 449, - BLOCKED_BY_PARENTAL_CONTROL: 450, - UNAVAILABLE_FOR_LEGAL_REASONS: 451, - CLIENT_CLOSED_LOAD_BALANCED_REQUEST: 460, - INVALID_X_FORWARDED_FOR: 463, - REQUEST_HEADER_TOO_LARGE: 494, - SSL_CERTIFICATE_ERROR: 495, - SSL_CERTIFICATE_REQUIRED: 496, - HTTP_REQUEST_SENT_TO_HTTPS_PORT: 497, - INVALID_TOKEN: 498, - CLIENT_CLOSED_REQUEST: 499, - INTERNAL_SERVER_ERROR: 500, - NOT_IMPLEMENTED: 501, - BAD_GATEWAY: 502, - SERVICE_UNAVAILABLE: 503, - GATEWAY_TIMEOUT: 504, - HTTP_VERSION_NOT_SUPPORTED: 505, - VARIANT_ALSO_NEGOTIATES: 506, - INSUFFICIENT_STORAGE: 507, - LOOP_DETECTED: 508, - BANDWIDTH_LIMIT_EXCEEDED: 509, - NOT_EXTENDED: 510, - NETWORK_AUTHENTICATION_REQUIRED: 511, - WEB_SERVER_UNKNOWN_ERROR: 520, - WEB_SERVER_IS_DOWN: 521, - CONNECTION_TIMEOUT: 522, - ORIGIN_IS_UNREACHABLE: 523, - TIMEOUT_OCCURED: 524, - SSL_HANDSHAKE_FAILED: 525, - INVALID_SSL_CERTIFICATE: 526, - RAILGUN_ERROR: 527, - SITE_IS_OVERLOADED: 529, - SITE_IS_FROZEN: 530, - IDENTITY_PROVIDER_AUTHENTICATION_ERROR: 561, - NETWORK_READ_TIMEOUT: 598, - NETWORK_CONNECT_TIMEOUT: 599 - }, e.FINISH = { - SAFE: 0, - SAFE_WITH_CB: 1, - UNSAFE: 2 - }, e.HEADER_STATE = { - GENERAL: 0, - CONNECTION: 1, - CONTENT_LENGTH: 2, - TRANSFER_ENCODING: 3, - UPGRADE: 4, - CONNECTION_KEEP_ALIVE: 5, - CONNECTION_CLOSE: 6, - CONNECTION_UPGRADE: 7, - TRANSFER_ENCODING_CHUNKED: 8 - }, e.METHODS_HTTP = [ - e.METHODS.DELETE, - e.METHODS.GET, - e.METHODS.HEAD, - e.METHODS.POST, - e.METHODS.PUT, - e.METHODS.CONNECT, - e.METHODS.OPTIONS, - e.METHODS.TRACE, - e.METHODS.COPY, - e.METHODS.LOCK, - e.METHODS.MKCOL, - e.METHODS.MOVE, - e.METHODS.PROPFIND, - e.METHODS.PROPPATCH, - e.METHODS.SEARCH, - e.METHODS.UNLOCK, - e.METHODS.BIND, - e.METHODS.REBIND, - e.METHODS.UNBIND, - e.METHODS.ACL, - e.METHODS.REPORT, - e.METHODS.MKACTIVITY, - e.METHODS.CHECKOUT, - e.METHODS.MERGE, - e.METHODS[`M-SEARCH`], - e.METHODS.NOTIFY, - e.METHODS.SUBSCRIBE, - e.METHODS.UNSUBSCRIBE, - e.METHODS.PATCH, - e.METHODS.PURGE, - e.METHODS.MKCALENDAR, - e.METHODS.LINK, - e.METHODS.UNLINK, - e.METHODS.PRI, - e.METHODS.SOURCE, - e.METHODS.QUERY - ], e.METHODS_ICE = [e.METHODS.SOURCE], e.METHODS_RTSP = [ - e.METHODS.OPTIONS, - e.METHODS.DESCRIBE, - e.METHODS.ANNOUNCE, - e.METHODS.SETUP, - e.METHODS.PLAY, - e.METHODS.PAUSE, - e.METHODS.TEARDOWN, - e.METHODS.GET_PARAMETER, - e.METHODS.SET_PARAMETER, - e.METHODS.REDIRECT, - e.METHODS.RECORD, - e.METHODS.FLUSH, - e.METHODS.GET, - e.METHODS.POST - ], e.METHOD_MAP = (0, t.enumToMap)(e.METHODS), e.H_METHOD_MAP = Object.fromEntries(Object.entries(e.METHODS).filter(([e]) => e.startsWith(`H`))), e.STATUSES_HTTP = [ - e.STATUSES.CONTINUE, - e.STATUSES.SWITCHING_PROTOCOLS, - e.STATUSES.PROCESSING, - e.STATUSES.EARLY_HINTS, - e.STATUSES.RESPONSE_IS_STALE, - e.STATUSES.REVALIDATION_FAILED, - e.STATUSES.DISCONNECTED_OPERATION, - e.STATUSES.HEURISTIC_EXPIRATION, - e.STATUSES.MISCELLANEOUS_WARNING, - e.STATUSES.OK, - e.STATUSES.CREATED, - e.STATUSES.ACCEPTED, - e.STATUSES.NON_AUTHORITATIVE_INFORMATION, - e.STATUSES.NO_CONTENT, - e.STATUSES.RESET_CONTENT, - e.STATUSES.PARTIAL_CONTENT, - e.STATUSES.MULTI_STATUS, - e.STATUSES.ALREADY_REPORTED, - e.STATUSES.TRANSFORMATION_APPLIED, - e.STATUSES.IM_USED, - e.STATUSES.MISCELLANEOUS_PERSISTENT_WARNING, - e.STATUSES.MULTIPLE_CHOICES, - e.STATUSES.MOVED_PERMANENTLY, - e.STATUSES.FOUND, - e.STATUSES.SEE_OTHER, - e.STATUSES.NOT_MODIFIED, - e.STATUSES.USE_PROXY, - e.STATUSES.SWITCH_PROXY, - e.STATUSES.TEMPORARY_REDIRECT, - e.STATUSES.PERMANENT_REDIRECT, - e.STATUSES.BAD_REQUEST, - e.STATUSES.UNAUTHORIZED, - e.STATUSES.PAYMENT_REQUIRED, - e.STATUSES.FORBIDDEN, - e.STATUSES.NOT_FOUND, - e.STATUSES.METHOD_NOT_ALLOWED, - e.STATUSES.NOT_ACCEPTABLE, - e.STATUSES.PROXY_AUTHENTICATION_REQUIRED, - e.STATUSES.REQUEST_TIMEOUT, - e.STATUSES.CONFLICT, - e.STATUSES.GONE, - e.STATUSES.LENGTH_REQUIRED, - e.STATUSES.PRECONDITION_FAILED, - e.STATUSES.PAYLOAD_TOO_LARGE, - e.STATUSES.URI_TOO_LONG, - e.STATUSES.UNSUPPORTED_MEDIA_TYPE, - e.STATUSES.RANGE_NOT_SATISFIABLE, - e.STATUSES.EXPECTATION_FAILED, - e.STATUSES.IM_A_TEAPOT, - e.STATUSES.PAGE_EXPIRED, - e.STATUSES.ENHANCE_YOUR_CALM, - e.STATUSES.MISDIRECTED_REQUEST, - e.STATUSES.UNPROCESSABLE_ENTITY, - e.STATUSES.LOCKED, - e.STATUSES.FAILED_DEPENDENCY, - e.STATUSES.TOO_EARLY, - e.STATUSES.UPGRADE_REQUIRED, - e.STATUSES.PRECONDITION_REQUIRED, - e.STATUSES.TOO_MANY_REQUESTS, - e.STATUSES.REQUEST_HEADER_FIELDS_TOO_LARGE_UNOFFICIAL, - e.STATUSES.REQUEST_HEADER_FIELDS_TOO_LARGE, - e.STATUSES.LOGIN_TIMEOUT, - e.STATUSES.NO_RESPONSE, - e.STATUSES.RETRY_WITH, - e.STATUSES.BLOCKED_BY_PARENTAL_CONTROL, - e.STATUSES.UNAVAILABLE_FOR_LEGAL_REASONS, - e.STATUSES.CLIENT_CLOSED_LOAD_BALANCED_REQUEST, - e.STATUSES.INVALID_X_FORWARDED_FOR, - e.STATUSES.REQUEST_HEADER_TOO_LARGE, - e.STATUSES.SSL_CERTIFICATE_ERROR, - e.STATUSES.SSL_CERTIFICATE_REQUIRED, - e.STATUSES.HTTP_REQUEST_SENT_TO_HTTPS_PORT, - e.STATUSES.INVALID_TOKEN, - e.STATUSES.CLIENT_CLOSED_REQUEST, - e.STATUSES.INTERNAL_SERVER_ERROR, - e.STATUSES.NOT_IMPLEMENTED, - e.STATUSES.BAD_GATEWAY, - e.STATUSES.SERVICE_UNAVAILABLE, - e.STATUSES.GATEWAY_TIMEOUT, - e.STATUSES.HTTP_VERSION_NOT_SUPPORTED, - e.STATUSES.VARIANT_ALSO_NEGOTIATES, - e.STATUSES.INSUFFICIENT_STORAGE, - e.STATUSES.LOOP_DETECTED, - e.STATUSES.BANDWIDTH_LIMIT_EXCEEDED, - e.STATUSES.NOT_EXTENDED, - e.STATUSES.NETWORK_AUTHENTICATION_REQUIRED, - e.STATUSES.WEB_SERVER_UNKNOWN_ERROR, - e.STATUSES.WEB_SERVER_IS_DOWN, - e.STATUSES.CONNECTION_TIMEOUT, - e.STATUSES.ORIGIN_IS_UNREACHABLE, - e.STATUSES.TIMEOUT_OCCURED, - e.STATUSES.SSL_HANDSHAKE_FAILED, - e.STATUSES.INVALID_SSL_CERTIFICATE, - e.STATUSES.RAILGUN_ERROR, - e.STATUSES.SITE_IS_OVERLOADED, - e.STATUSES.SITE_IS_FROZEN, - e.STATUSES.IDENTITY_PROVIDER_AUTHENTICATION_ERROR, - e.STATUSES.NETWORK_READ_TIMEOUT, - e.STATUSES.NETWORK_CONNECT_TIMEOUT - ], e.ALPHA = []; - for (let t = 65; t <= 90; t++) e.ALPHA.push(String.fromCharCode(t)), e.ALPHA.push(String.fromCharCode(t + 32)); - e.NUM_MAP = { - 0: 0, - 1: 1, - 2: 2, - 3: 3, - 4: 4, - 5: 5, - 6: 6, - 7: 7, - 8: 8, - 9: 9 - }, e.HEX_MAP = { - 0: 0, - 1: 1, - 2: 2, - 3: 3, - 4: 4, - 5: 5, - 6: 6, - 7: 7, - 8: 8, - 9: 9, - A: 10, - B: 11, - C: 12, - D: 13, - E: 14, - F: 15, - a: 10, - b: 11, - c: 12, - d: 13, - e: 14, - f: 15 - }, e.NUM = [ - `0`, - `1`, - `2`, - `3`, - `4`, - `5`, - `6`, - `7`, - `8`, - `9` - ], e.ALPHANUM = e.ALPHA.concat(e.NUM), e.MARK = [ - `-`, - `_`, - `.`, - `!`, - `~`, - `*`, - `'`, - `(`, - `)` - ], e.USERINFO_CHARS = e.ALPHANUM.concat(e.MARK).concat([ - `%`, - `;`, - `:`, - `&`, - `=`, - `+`, - `$`, - `,` - ]), e.URL_CHAR = `!"$%&'()*+,-./:;<=>@[\\]^_\`{|}~`.split(``).concat(e.ALPHANUM), e.HEX = e.NUM.concat([ - `a`, - `b`, - `c`, - `d`, - `e`, - `f`, - `A`, - `B`, - `C`, - `D`, - `E`, - `F` - ]), e.TOKEN = [ - `!`, - `#`, - `$`, - `%`, - `&`, - `'`, - `*`, - `+`, - `-`, - `.`, - `^`, - `_`, - "`", - `|`, - `~` - ].concat(e.ALPHANUM), e.HEADER_CHARS = [` `]; - for (let t = 32; t <= 255; t++) t !== 127 && e.HEADER_CHARS.push(t); - e.CONNECTION_TOKEN_CHARS = e.HEADER_CHARS.filter((e) => e !== 44), e.QUOTED_STRING = [` `, ` `]; - for (let t = 33; t <= 255; t++) t !== 34 && t !== 92 && e.QUOTED_STRING.push(t); - e.HTAB_SP_VCHAR_OBS_TEXT = [` `, ` `]; - for (let t = 33; t <= 126; t++) e.HTAB_SP_VCHAR_OBS_TEXT.push(t); - for (let t = 128; t <= 255; t++) e.HTAB_SP_VCHAR_OBS_TEXT.push(t); - e.MAJOR = e.NUM_MAP, e.MINOR = e.MAJOR, e.SPECIAL_HEADERS = { - connection: e.HEADER_STATE.CONNECTION, - "content-length": e.HEADER_STATE.CONTENT_LENGTH, - "proxy-connection": e.HEADER_STATE.CONNECTION, - "transfer-encoding": e.HEADER_STATE.TRANSFER_ENCODING, - upgrade: e.HEADER_STATE.UPGRADE - }, e.default = { - ERROR: e.ERROR, - TYPE: e.TYPE, - FLAGS: e.FLAGS, - LENIENT_FLAGS: e.LENIENT_FLAGS, - METHODS: e.METHODS, - STATUSES: e.STATUSES, - FINISH: e.FINISH, - HEADER_STATE: e.HEADER_STATE, - ALPHA: e.ALPHA, - NUM_MAP: e.NUM_MAP, - HEX_MAP: e.HEX_MAP, - NUM: e.NUM, - ALPHANUM: e.ALPHANUM, - MARK: e.MARK, - USERINFO_CHARS: e.USERINFO_CHARS, - URL_CHAR: e.URL_CHAR, - HEX: e.HEX, - TOKEN: e.TOKEN, - HEADER_CHARS: e.HEADER_CHARS, - CONNECTION_TOKEN_CHARS: e.CONNECTION_TOKEN_CHARS, - QUOTED_STRING: e.QUOTED_STRING, - HTAB_SP_VCHAR_OBS_TEXT: e.HTAB_SP_VCHAR_OBS_TEXT, - MAJOR: e.MAJOR, - MINOR: e.MINOR, - SPECIAL_HEADERS: e.SPECIAL_HEADERS, - METHODS_HTTP: e.METHODS_HTTP, - METHODS_ICE: e.METHODS_ICE, - METHODS_RTSP: e.METHODS_RTSP, - METHOD_MAP: e.METHOD_MAP, - H_METHOD_MAP: e.H_METHOD_MAP, - STATUSES_HTTP: e.STATUSES_HTTP - }; -})); -var Ta$3 = c$12(((e, n) => { - let { Buffer: r } = f$11(`node:buffer`), i; - Object.defineProperty(n, "exports", { get: () => i ||= r.from(`AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAn9/AGABfwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQAEA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAAzU0BQYAAAMAAAAAAAADAQMAAwMDAAACAAAAAAICAgICAgICAgIBAQEBAQEBAQEBAwAAAwAAAAQFAXABExMFAwEAAgYIAX8BQcDZBAsHxQcoBm1lbW9yeQIAC19pbml0aWFsaXplAAgZX19pbmRpcmVjdF9mdW5jdGlvbl90YWJsZQEAC2xsaHR0cF9pbml0AAkYbGxodHRwX3Nob3VsZF9rZWVwX2FsaXZlADcMbGxodHRwX2FsbG9jAAsGbWFsbG9jADkLbGxodHRwX2ZyZWUADARmcmVlAAwPbGxodHRwX2dldF90eXBlAA0VbGxodHRwX2dldF9odHRwX21ham9yAA4VbGxodHRwX2dldF9odHRwX21pbm9yAA8RbGxodHRwX2dldF9tZXRob2QAEBZsbGh0dHBfZ2V0X3N0YXR1c19jb2RlABESbGxodHRwX2dldF91cGdyYWRlABIMbGxodHRwX3Jlc2V0ABMObGxodHRwX2V4ZWN1dGUAFBRsbGh0dHBfc2V0dGluZ3NfaW5pdAAVDWxsaHR0cF9maW5pc2gAFgxsbGh0dHBfcGF1c2UAFw1sbGh0dHBfcmVzdW1lABgbbGxodHRwX3Jlc3VtZV9hZnRlcl91cGdyYWRlABkQbGxodHRwX2dldF9lcnJubwAaF2xsaHR0cF9nZXRfZXJyb3JfcmVhc29uABsXbGxodHRwX3NldF9lcnJvcl9yZWFzb24AHBRsbGh0dHBfZ2V0X2Vycm9yX3BvcwAdEWxsaHR0cF9lcnJub19uYW1lAB4SbGxodHRwX21ldGhvZF9uYW1lAB8SbGxodHRwX3N0YXR1c19uYW1lACAabGxodHRwX3NldF9sZW5pZW50X2hlYWRlcnMAISFsbGh0dHBfc2V0X2xlbmllbnRfY2h1bmtlZF9sZW5ndGgAIh1sbGh0dHBfc2V0X2xlbmllbnRfa2VlcF9hbGl2ZQAjJGxsaHR0cF9zZXRfbGVuaWVudF90cmFuc2Zlcl9lbmNvZGluZwAkGmxsaHR0cF9zZXRfbGVuaWVudF92ZXJzaW9uACUjbGxodHRwX3NldF9sZW5pZW50X2RhdGFfYWZ0ZXJfY2xvc2UAJidsbGh0dHBfc2V0X2xlbmllbnRfb3B0aW9uYWxfbGZfYWZ0ZXJfY3IAJyxsbGh0dHBfc2V0X2xlbmllbnRfb3B0aW9uYWxfY3JsZl9hZnRlcl9jaHVuawAoKGxsaHR0cF9zZXRfbGVuaWVudF9vcHRpb25hbF9jcl9iZWZvcmVfbGYAKSpsbGh0dHBfc2V0X2xlbmllbnRfc3BhY2VzX2FmdGVyX2NodW5rX3NpemUAKhhsbGh0dHBfbWVzc2FnZV9uZWVkc19lb2YANgkYAQBBAQsSAQIDBAUKBgcyNDMuKy8tLDAxCq/ZAjQWAEHA1QAoAgAEQAALQcDVAEEBNgIACxQAIAAQOCAAIAI2AjggACABOgAoCxQAIAAgAC8BNCAALQAwIAAQNxAACx4BAX9BwAAQOiIBEDggAUGACDYCOCABIAA6ACggAQuPDAEHfwJAIABFDQAgAEEIayIBIABBBGsoAgAiAEF4cSIEaiEFAkAgAEEBcQ0AIABBA3FFDQEgASABKAIAIgBrIgFB1NUAKAIASQ0BIAAgBGohBAJAAkBB2NUAKAIAIAFHBEAgAEH/AU0EQCAAQQN2IQMgASgCCCIAIAEoAgwiAkYEQEHE1QBBxNUAKAIAQX4gA3dxNgIADAULIAIgADYCCCAAIAI2AgwMBAsgASgCGCEGIAEgASgCDCIARwRAIAAgASgCCCICNgIIIAIgADYCDAwDCyABQRRqIgMoAgAiAkUEQCABKAIQIgJFDQIgAUEQaiEDCwNAIAMhByACIgBBFGoiAygCACICDQAgAEEQaiEDIAAoAhAiAg0ACyAHQQA2AgAMAgsgBSgCBCIAQQNxQQNHDQIgBSAAQX5xNgIEQczVACAENgIAIAUgBDYCACABIARBAXI2AgQMAwtBACEACyAGRQ0AAkAgASgCHCICQQJ0QfTXAGoiAygCACABRgRAIAMgADYCACAADQFByNUAQcjVACgCAEF+IAJ3cTYCAAwCCyAGQRBBFCAGKAIQIAFGG2ogADYCACAARQ0BCyAAIAY2AhggASgCECICBEAgACACNgIQIAIgADYCGAsgAUEUaigCACICRQ0AIABBFGogAjYCACACIAA2AhgLIAEgBU8NACAFKAIEIgBBAXFFDQACQAJAAkACQCAAQQJxRQRAQdzVACgCACAFRgRAQdzVACABNgIAQdDVAEHQ1QAoAgAgBGoiADYCACABIABBAXI2AgQgAUHY1QAoAgBHDQZBzNUAQQA2AgBB2NUAQQA2AgAMBgtB2NUAKAIAIAVGBEBB2NUAIAE2AgBBzNUAQczVACgCACAEaiIANgIAIAEgAEEBcjYCBCAAIAFqIAA2AgAMBgsgAEF4cSAEaiEEIABB/wFNBEAgAEEDdiEDIAUoAggiACAFKAIMIgJGBEBBxNUAQcTVACgCAEF+IAN3cTYCAAwFCyACIAA2AgggACACNgIMDAQLIAUoAhghBiAFIAUoAgwiAEcEQEHU1QAoAgAaIAAgBSgCCCICNgIIIAIgADYCDAwDCyAFQRRqIgMoAgAiAkUEQCAFKAIQIgJFDQIgBUEQaiEDCwNAIAMhByACIgBBFGoiAygCACICDQAgAEEQaiEDIAAoAhAiAg0ACyAHQQA2AgAMAgsgBSAAQX5xNgIEIAEgBGogBDYCACABIARBAXI2AgQMAwtBACEACyAGRQ0AAkAgBSgCHCICQQJ0QfTXAGoiAygCACAFRgRAIAMgADYCACAADQFByNUAQcjVACgCAEF+IAJ3cTYCAAwCCyAGQRBBFCAGKAIQIAVGG2ogADYCACAARQ0BCyAAIAY2AhggBSgCECICBEAgACACNgIQIAIgADYCGAsgBUEUaigCACICRQ0AIABBFGogAjYCACACIAA2AhgLIAEgBGogBDYCACABIARBAXI2AgQgAUHY1QAoAgBHDQBBzNUAIAQ2AgAMAQsgBEH/AU0EQCAEQXhxQezVAGohAAJ/QcTVACgCACICQQEgBEEDdnQiA3FFBEBBxNUAIAIgA3I2AgAgAAwBCyAAKAIICyICIAE2AgwgACABNgIIIAEgADYCDCABIAI2AggMAQtBHyECIARB////B00EQCAEQSYgBEEIdmciAGt2QQFxIABBAXRrQT5qIQILIAEgAjYCHCABQgA3AhAgAkECdEH01wBqIQACQEHI1QAoAgAiA0EBIAJ0IgdxRQRAIAAgATYCAEHI1QAgAyAHcjYCACABIAA2AhggASABNgIIIAEgATYCDAwBCyAEQRkgAkEBdmtBACACQR9HG3QhAiAAKAIAIQACQANAIAAiAygCBEF4cSAERg0BIAJBHXYhACACQQF0IQIgAyAAQQRxakEQaiIHKAIAIgANAAsgByABNgIAIAEgAzYCGCABIAE2AgwgASABNgIIDAELIAMoAggiACABNgIMIAMgATYCCCABQQA2AhggASADNgIMIAEgADYCCAtB5NUAQeTVACgCAEEBayIAQX8gABs2AgALCwcAIAAtACgLBwAgAC0AKgsHACAALQArCwcAIAAtACkLBwAgAC8BNAsHACAALQAwC0ABBH8gACgCGCEBIAAvAS4hAiAALQAoIQMgACgCOCEEIAAQOCAAIAQ2AjggACADOgAoIAAgAjsBLiAAIAE2AhgL5YUCAgd/A34gASACaiEEAkAgACIDKAIMIgANACADKAIEBEAgAyABNgIECyMAQRBrIgkkAAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAygCHCICQQJrDvwBAfkBAgMEBQYHCAkKCwwNDg8QERL4ARP3ARQV9gEWF/UBGBkaGxwdHh8g/QH7ASH0ASIjJCUmJygpKivzASwtLi8wMTLyAfEBMzTwAe8BNTY3ODk6Ozw9Pj9AQUJDREVGR0hJSktMTU5P+gFQUVJT7gHtAVTsAVXrAVZXWFla6gFbXF1eX2BhYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ent8fX5/gAGBAYIBgwGEAYUBhgGHAYgBiQGKAYsBjAGNAY4BjwGQAZEBkgGTAZQBlQGWAZcBmAGZAZoBmwGcAZ0BngGfAaABoQGiAaMBpAGlAaYBpwGoAakBqgGrAawBrQGuAa8BsAGxAbIBswG0AbUBtgG3AbgBuQG6AbsBvAG9Ab4BvwHAAcEBwgHDAcQBxQHGAccByAHJAcoBywHMAc0BzgHpAegBzwHnAdAB5gHRAdIB0wHUAeUB1QHWAdcB2AHZAdoB2wHcAd0B3gHfAeAB4QHiAeMBAPwBC0EADOMBC0EODOIBC0ENDOEBC0EPDOABC0EQDN8BC0ETDN4BC0EUDN0BC0EVDNwBC0EWDNsBC0EXDNoBC0EYDNkBC0EZDNgBC0EaDNcBC0EbDNYBC0EcDNUBC0EdDNQBC0EeDNMBC0EfDNIBC0EgDNEBC0EhDNABC0EIDM8BC0EiDM4BC0EkDM0BC0EjDMwBC0EHDMsBC0ElDMoBC0EmDMkBC0EnDMgBC0EoDMcBC0ESDMYBC0ERDMUBC0EpDMQBC0EqDMMBC0ErDMIBC0EsDMEBC0HeAQzAAQtBLgy/AQtBLwy+AQtBMAy9AQtBMQy8AQtBMgy7AQtBMwy6AQtBNAy5AQtB3wEMuAELQTUMtwELQTkMtgELQQwMtQELQTYMtAELQTcMswELQTgMsgELQT4MsQELQToMsAELQeABDK8BC0ELDK4BC0E/DK0BC0E7DKwBC0EKDKsBC0E8DKoBC0E9DKkBC0HhAQyoAQtBwQAMpwELQcAADKYBC0HCAAylAQtBCQykAQtBLQyjAQtBwwAMogELQcQADKEBC0HFAAygAQtBxgAMnwELQccADJ4BC0HIAAydAQtByQAMnAELQcoADJsBC0HLAAyaAQtBzAAMmQELQc0ADJgBC0HOAAyXAQtBzwAMlgELQdAADJUBC0HRAAyUAQtB0gAMkwELQdMADJIBC0HVAAyRAQtB1AAMkAELQdYADI8BC0HXAAyOAQtB2AAMjQELQdkADIwBC0HaAAyLAQtB2wAMigELQdwADIkBC0HdAAyIAQtB3gAMhwELQd8ADIYBC0HgAAyFAQtB4QAMhAELQeIADIMBC0HjAAyCAQtB5AAMgQELQeUADIABC0HiAQx/C0HmAAx+C0HnAAx9C0EGDHwLQegADHsLQQUMegtB6QAMeQtBBAx4C0HqAAx3C0HrAAx2C0HsAAx1C0HtAAx0C0EDDHMLQe4ADHILQe8ADHELQfAADHALQfIADG8LQfEADG4LQfMADG0LQfQADGwLQfUADGsLQfYADGoLQQIMaQtB9wAMaAtB+AAMZwtB+QAMZgtB+gAMZQtB+wAMZAtB/AAMYwtB/QAMYgtB/gAMYQtB/wAMYAtBgAEMXwtBgQEMXgtBggEMXQtBgwEMXAtBhAEMWwtBhQEMWgtBhgEMWQtBhwEMWAtBiAEMVwtBiQEMVgtBigEMVQtBiwEMVAtBjAEMUwtBjQEMUgtBjgEMUQtBjwEMUAtBkAEMTwtBkQEMTgtBkgEMTQtBkwEMTAtBlAEMSwtBlQEMSgtBlgEMSQtBlwEMSAtBmAEMRwtBmQEMRgtBmgEMRQtBmwEMRAtBnAEMQwtBnQEMQgtBngEMQQtBnwEMQAtBoAEMPwtBoQEMPgtBogEMPQtBowEMPAtBpAEMOwtBpQEMOgtBpgEMOQtBpwEMOAtBqAEMNwtBqQEMNgtBqgEMNQtBqwEMNAtBrAEMMwtBrQEMMgtBrgEMMQtBrwEMMAtBsAEMLwtBsQEMLgtBsgEMLQtBswEMLAtBtAEMKwtBtQEMKgtBtgEMKQtBtwEMKAtBuAEMJwtBuQEMJgtBugEMJQtBuwEMJAtBvAEMIwtBvQEMIgtBvgEMIQtBvwEMIAtBwAEMHwtBwQEMHgtBwgEMHQtBAQwcC0HDAQwbC0HEAQwaC0HFAQwZC0HGAQwYC0HHAQwXC0HIAQwWC0HJAQwVC0HKAQwUC0HLAQwTC0HMAQwSC0HNAQwRC0HOAQwQC0HPAQwPC0HQAQwOC0HRAQwNC0HSAQwMC0HTAQwLC0HUAQwKC0HVAQwJC0HWAQwIC0HjAQwHC0HXAQwGC0HYAQwFC0HZAQwEC0HaAQwDC0HbAQwCC0HdAQwBC0HcAQshAgNAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCADAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJ/AkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAMCfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAg7jAQABAgMEBQYHCAkKCwwNDg8QERITFBUWFxgZGhscHR4fICEjJCUnKCmeA5sDmgORA4oDgwOAA/0C+wL4AvIC8QLvAu0C6ALnAuYC5QLkAtwC2wLaAtkC2ALXAtYC1QLPAs4CzALLAsoCyQLIAscCxgLEAsMCvgK8AroCuQK4ArcCtgK1ArQCswKyArECsAKuAq0CqQKoAqcCpgKlAqQCowKiAqECoAKfApgCkAKMAosCigKBAv4B/QH8AfsB+gH5AfgB9wH1AfMB8AHrAekB6AHnAeYB5QHkAeMB4gHhAeAB3wHeAd0B3AHaAdkB2AHXAdYB1QHUAdMB0gHRAdABzwHOAc0BzAHLAcoByQHIAccBxgHFAcQBwwHCAcEBwAG/Ab4BvQG8AbsBugG5AbgBtwG2AbUBtAGzAbIBsQGwAa8BrgGtAawBqwGqAakBqAGnAaYBpQGkAaMBogGfAZ4BmQGYAZcBlgGVAZQBkwGSAZEBkAGPAY0BjAGHAYYBhQGEAYMBggF9fHt6eXZ1dFBRUlNUVQsgASAERw1yQf0BIQIMvgMLIAEgBEcNmAFB2wEhAgy9AwsgASAERw3xAUGOASECDLwDCyABIARHDfwBQYQBIQIMuwMLIAEgBEcNigJB/wAhAgy6AwsgASAERw2RAkH9ACECDLkDCyABIARHDZQCQfsAIQIMuAMLIAEgBEcNHkEeIQIMtwMLIAEgBEcNGUEYIQIMtgMLIAEgBEcNygJBzQAhAgy1AwsgASAERw3VAkHGACECDLQDCyABIARHDdYCQcMAIQIMswMLIAEgBEcN3AJBOCECDLIDCyADLQAwQQFGDa0DDIkDC0EAIQACQAJAAkAgAy0AKkUNACADLQArRQ0AIAMvATIiAkECcUUNAQwCCyADLwEyIgJBAXFFDQELQQEhACADLQAoQQFGDQAgAy8BNCIGQeQAa0HkAEkNACAGQcwBRg0AIAZBsAJGDQAgAkHAAHENAEEAIQAgAkGIBHFBgARGDQAgAkEocUEARyEACyADQQA7ATIgA0EAOgAxAkAgAEUEQCADQQA6ADEgAy0ALkEEcQ0BDLEDCyADQgA3AyALIANBADoAMSADQQE6ADYMSAtBACEAAkAgAygCOCICRQ0AIAIoAjAiAkUNACADIAIRAAAhAAsgAEUNSCAAQRVHDWIgA0EENgIcIAMgATYCFCADQdIbNgIQIANBFTYCDEEAIQIMrwMLIAEgBEYEQEEGIQIMrwMLIAEtAABBCkcNGSABQQFqIQEMGgsgA0IANwMgQRIhAgyUAwsgASAERw2KA0EjIQIMrAMLIAEgBEYEQEEHIQIMrAMLAkACQCABLQAAQQprDgQBGBgAGAsgAUEBaiEBQRAhAgyTAwsgAUEBaiEBIANBL2otAABBAXENF0EAIQIgA0EANgIcIAMgATYCFCADQZkgNgIQIANBGTYCDAyrAwsgAyADKQMgIgwgBCABa60iCn0iC0IAIAsgDFgbNwMgIAogDFoNGEEIIQIMqgMLIAEgBEcEQCADQQk2AgggAyABNgIEQRQhAgyRAwtBCSECDKkDCyADKQMgUA2uAgxDCyABIARGBEBBCyECDKgDCyABLQAAQQpHDRYgAUEBaiEBDBcLIANBL2otAABBAXFFDRkMJgtBACEAAkAgAygCOCICRQ0AIAIoAlAiAkUNACADIAIRAAAhAAsgAA0ZDEILQQAhAAJAIAMoAjgiAkUNACACKAJQIgJFDQAgAyACEQAAIQALIAANGgwkC0EAIQACQCADKAI4IgJFDQAgAigCUCICRQ0AIAMgAhEAACEACyAADRsMMgsgA0Evai0AAEEBcUUNHAwiC0EAIQACQCADKAI4IgJFDQAgAigCVCICRQ0AIAMgAhEAACEACyAADRwMQgtBACEAAkAgAygCOCICRQ0AIAIoAlQiAkUNACADIAIRAAAhAAsgAA0dDCALIAEgBEYEQEETIQIMoAMLAkAgAS0AACIAQQprDgQfIyMAIgsgAUEBaiEBDB8LQQAhAAJAIAMoAjgiAkUNACACKAJUIgJFDQAgAyACEQAAIQALIAANIgxCCyABIARGBEBBFiECDJ4DCyABLQAAQcDBAGotAABBAUcNIwyDAwsCQANAIAEtAABBsDtqLQAAIgBBAUcEQAJAIABBAmsOAgMAJwsgAUEBaiEBQSEhAgyGAwsgBCABQQFqIgFHDQALQRghAgydAwsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAFBAWoiARA0IgANIQxBC0EAIQACQCADKAI4IgJFDQAgAigCVCICRQ0AIAMgAhEAACEACyAADSMMKgsgASAERgRAQRwhAgybAwsgA0EKNgIIIAMgATYCBEEAIQACQCADKAI4IgJFDQAgAigCUCICRQ0AIAMgAhEAACEACyAADSVBJCECDIEDCyABIARHBEADQCABLQAAQbA9ai0AACIAQQNHBEAgAEEBaw4FGBomggMlJgsgBCABQQFqIgFHDQALQRshAgyaAwtBGyECDJkDCwNAIAEtAABBsD9qLQAAIgBBA0cEQCAAQQFrDgUPEScTJicLIAQgAUEBaiIBRw0AC0EeIQIMmAMLIAEgBEcEQCADQQs2AgggAyABNgIEQQchAgz/AgtBHyECDJcDCyABIARGBEBBICECDJcDCwJAIAEtAABBDWsOFC4/Pz8/Pz8/Pz8/Pz8/Pz8/Pz8APwtBACECIANBADYCHCADQb8LNgIQIANBAjYCDCADIAFBAWo2AhQMlgMLIANBL2ohAgNAIAEgBEYEQEEhIQIMlwMLAkACQAJAIAEtAAAiAEEJaw4YAgApKQEpKSkpKSkpKSkpKSkpKSkpKSkCJwsgAUEBaiEBIANBL2otAABBAXFFDQoMGAsgAUEBaiEBDBcLIAFBAWohASACLQAAQQJxDQALQQAhAiADQQA2AhwgAyABNgIUIANBnxU2AhAgA0EMNgIMDJUDCyADLQAuQYABcUUNAQtBACEAAkAgAygCOCICRQ0AIAIoAlwiAkUNACADIAIRAAAhAAsgAEUN5gIgAEEVRgRAIANBJDYCHCADIAE2AhQgA0GbGzYCECADQRU2AgxBACECDJQDC0EAIQIgA0EANgIcIAMgATYCFCADQZAONgIQIANBFDYCDAyTAwtBACECIANBADYCHCADIAE2AhQgA0G+IDYCECADQQI2AgwMkgMLIAMoAgQhAEEAIQIgA0EANgIEIAMgACABIAynaiIBEDIiAEUNKyADQQc2AhwgAyABNgIUIAMgADYCDAyRAwsgAy0ALkHAAHFFDQELQQAhAAJAIAMoAjgiAkUNACACKAJYIgJFDQAgAyACEQAAIQALIABFDSsgAEEVRgRAIANBCjYCHCADIAE2AhQgA0HrGTYCECADQRU2AgxBACECDJADC0EAIQIgA0EANgIcIAMgATYCFCADQZMMNgIQIANBEzYCDAyPAwtBACECIANBADYCHCADIAE2AhQgA0GCFTYCECADQQI2AgwMjgMLQQAhAiADQQA2AhwgAyABNgIUIANB3RQ2AhAgA0EZNgIMDI0DC0EAIQIgA0EANgIcIAMgATYCFCADQeYdNgIQIANBGTYCDAyMAwsgAEEVRg09QQAhAiADQQA2AhwgAyABNgIUIANB0A82AhAgA0EiNgIMDIsDCyADKAIEIQBBACECIANBADYCBCADIAAgARAzIgBFDSggA0ENNgIcIAMgATYCFCADIAA2AgwMigMLIABBFUYNOkEAIQIgA0EANgIcIAMgATYCFCADQdAPNgIQIANBIjYCDAyJAwsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEQMyIARQRAIAFBAWohAQwoCyADQQ42AhwgAyAANgIMIAMgAUEBajYCFAyIAwsgAEEVRg03QQAhAiADQQA2AhwgAyABNgIUIANB0A82AhAgA0EiNgIMDIcDCyADKAIEIQBBACECIANBADYCBCADIAAgARAzIgBFBEAgAUEBaiEBDCcLIANBDzYCHCADIAA2AgwgAyABQQFqNgIUDIYDC0EAIQIgA0EANgIcIAMgATYCFCADQeIXNgIQIANBGTYCDAyFAwsgAEEVRg0zQQAhAiADQQA2AhwgAyABNgIUIANB1gw2AhAgA0EjNgIMDIQDCyADKAIEIQBBACECIANBADYCBCADIAAgARA0IgBFDSUgA0ERNgIcIAMgATYCFCADIAA2AgwMgwMLIABBFUYNMEEAIQIgA0EANgIcIAMgATYCFCADQdYMNgIQIANBIzYCDAyCAwsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEQNCIARQRAIAFBAWohAQwlCyADQRI2AhwgAyAANgIMIAMgAUEBajYCFAyBAwsgA0Evai0AAEEBcUUNAQtBFyECDOYCC0EAIQIgA0EANgIcIAMgATYCFCADQeIXNgIQIANBGTYCDAz+AgsgAEE7Rw0AIAFBAWohAQwMC0EAIQIgA0EANgIcIAMgATYCFCADQZIYNgIQIANBAjYCDAz8AgsgAEEVRg0oQQAhAiADQQA2AhwgAyABNgIUIANB1gw2AhAgA0EjNgIMDPsCCyADQRQ2AhwgAyABNgIUIAMgADYCDAz6AgsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEQNCIARQRAIAFBAWohAQz1AgsgA0EVNgIcIAMgADYCDCADIAFBAWo2AhQM+QILIAMoAgQhAEEAIQIgA0EANgIEIAMgACABEDQiAEUEQCABQQFqIQEM8wILIANBFzYCHCADIAA2AgwgAyABQQFqNgIUDPgCCyAAQRVGDSNBACECIANBADYCHCADIAE2AhQgA0HWDDYCECADQSM2AgwM9wILIAMoAgQhAEEAIQIgA0EANgIEIAMgACABEDQiAEUEQCABQQFqIQEMHQsgA0EZNgIcIAMgADYCDCADIAFBAWo2AhQM9gILIAMoAgQhAEEAIQIgA0EANgIEIAMgACABEDQiAEUEQCABQQFqIQEM7wILIANBGjYCHCADIAA2AgwgAyABQQFqNgIUDPUCCyAAQRVGDR9BACECIANBADYCHCADIAE2AhQgA0HQDzYCECADQSI2AgwM9AILIAMoAgQhACADQQA2AgQgAyAAIAEQMyIARQRAIAFBAWohAQwbCyADQRw2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIM8wILIAMoAgQhACADQQA2AgQgAyAAIAEQMyIARQRAIAFBAWohAQzrAgsgA0EdNgIcIAMgADYCDCADIAFBAWo2AhRBACECDPICCyAAQTtHDQEgAUEBaiEBC0EmIQIM1wILQQAhAiADQQA2AhwgAyABNgIUIANBnxU2AhAgA0EMNgIMDO8CCyABIARHBEADQCABLQAAQSBHDYQCIAQgAUEBaiIBRw0AC0EsIQIM7wILQSwhAgzuAgsgASAERgRAQTQhAgzuAgsCQAJAA0ACQCABLQAAQQprDgQCAAADAAsgBCABQQFqIgFHDQALQTQhAgzvAgsgAygCBCEAIANBADYCBCADIAAgARAxIgBFDZ8CIANBMjYCHCADIAE2AhQgAyAANgIMQQAhAgzuAgsgAygCBCEAIANBADYCBCADIAAgARAxIgBFBEAgAUEBaiEBDJ8CCyADQTI2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIM7QILIAEgBEcEQAJAA0AgAS0AAEEwayIAQf8BcUEKTwRAQTohAgzXAgsgAykDICILQpmz5syZs+bMGVYNASADIAtCCn4iCjcDICAKIACtQv8BgyILQn+FVg0BIAMgCiALfDcDICAEIAFBAWoiAUcNAAtBwAAhAgzuAgsgAygCBCEAIANBADYCBCADIAAgAUEBaiIBEDEiAA0XDOICC0HAACECDOwCCyABIARGBEBByQAhAgzsAgsCQANAAkAgAS0AAEEJaw4YAAKiAqICqQKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogIAogILIAQgAUEBaiIBRw0AC0HJACECDOwCCyABQQFqIQEgA0Evai0AAEEBcQ2lAiADQQA2AhwgAyABNgIUIANBlxA2AhAgA0EKNgIMQQAhAgzrAgsgASAERwRAA0AgAS0AAEEgRw0VIAQgAUEBaiIBRw0AC0H4ACECDOsCC0H4ACECDOoCCyADQQI6ACgMOAtBACECIANBADYCHCADQb8LNgIQIANBAjYCDCADIAFBAWo2AhQM6AILQQAhAgzOAgtBDSECDM0CC0ETIQIMzAILQRUhAgzLAgtBFiECDMoCC0EYIQIMyQILQRkhAgzIAgtBGiECDMcCC0EbIQIMxgILQRwhAgzFAgtBHSECDMQCC0EeIQIMwwILQR8hAgzCAgtBICECDMECC0EiIQIMwAILQSMhAgy/AgtBJSECDL4CC0HlACECDL0CCyADQT02AhwgAyABNgIUIAMgADYCDEEAIQIM1QILIANBGzYCHCADIAE2AhQgA0GkHDYCECADQRU2AgxBACECDNQCCyADQSA2AhwgAyABNgIUIANBmBo2AhAgA0EVNgIMQQAhAgzTAgsgA0ETNgIcIAMgATYCFCADQZgaNgIQIANBFTYCDEEAIQIM0gILIANBCzYCHCADIAE2AhQgA0GYGjYCECADQRU2AgxBACECDNECCyADQRA2AhwgAyABNgIUIANBmBo2AhAgA0EVNgIMQQAhAgzQAgsgA0EgNgIcIAMgATYCFCADQaQcNgIQIANBFTYCDEEAIQIMzwILIANBCzYCHCADIAE2AhQgA0GkHDYCECADQRU2AgxBACECDM4CCyADQQw2AhwgAyABNgIUIANBpBw2AhAgA0EVNgIMQQAhAgzNAgtBACECIANBADYCHCADIAE2AhQgA0HdDjYCECADQRI2AgwMzAILAkADQAJAIAEtAABBCmsOBAACAgACCyAEIAFBAWoiAUcNAAtB/QEhAgzMAgsCQAJAIAMtADZBAUcNAEEAIQACQCADKAI4IgJFDQAgAigCYCICRQ0AIAMgAhEAACEACyAARQ0AIABBFUcNASADQfwBNgIcIAMgATYCFCADQdwZNgIQIANBFTYCDEEAIQIMzQILQdwBIQIMswILIANBADYCHCADIAE2AhQgA0H5CzYCECADQR82AgxBACECDMsCCwJAAkAgAy0AKEEBaw4CBAEAC0HbASECDLICC0HUASECDLECCyADQQI6ADFBACEAAkAgAygCOCICRQ0AIAIoAgAiAkUNACADIAIRAAAhAAsgAEUEQEHdASECDLECCyAAQRVHBEAgA0EANgIcIAMgATYCFCADQbQMNgIQIANBEDYCDEEAIQIMygILIANB+wE2AhwgAyABNgIUIANBgRo2AhAgA0EVNgIMQQAhAgzJAgsgASAERgRAQfoBIQIMyQILIAEtAABByABGDQEgA0EBOgAoC0HAASECDK4CC0HaASECDK0CCyABIARHBEAgA0EMNgIIIAMgATYCBEHZASECDK0CC0H5ASECDMUCCyABIARGBEBB+AEhAgzFAgsgAS0AAEHIAEcNBCABQQFqIQFB2AEhAgyrAgsgASAERgRAQfcBIQIMxAILAkACQCABLQAAQcUAaw4QAAUFBQUFBQUFBQUFBQUFAQULIAFBAWohAUHWASECDKsCCyABQQFqIQFB1wEhAgyqAgtB9gEhAiABIARGDcICIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQbrVAGotAABHDQMgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADMMCCyADKAIEIQAgA0IANwMAIAMgACAGQQFqIgEQLiIARQRAQeMBIQIMqgILIANB9QE2AhwgAyABNgIUIAMgADYCDEEAIQIMwgILQfQBIQIgASAERg3BAiADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEG41QBqLQAARw0CIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzCAgsgA0GBBDsBKCADKAIEIQAgA0IANwMAIAMgACAGQQFqIgEQLiIADQMMAgsgA0EANgIAC0EAIQIgA0EANgIcIAMgATYCFCADQeUfNgIQIANBCDYCDAy/AgtB1QEhAgylAgsgA0HzATYCHCADIAE2AhQgAyAANgIMQQAhAgy9AgtBACEAAkAgAygCOCICRQ0AIAIoAkAiAkUNACADIAIRAAAhAAsgAEUNbiAAQRVHBEAgA0EANgIcIAMgATYCFCADQYIPNgIQIANBIDYCDEEAIQIMvQILIANBjwE2AhwgAyABNgIUIANB7Bs2AhAgA0EVNgIMQQAhAgy8AgsgASAERwRAIANBDTYCCCADIAE2AgRB0wEhAgyjAgtB8gEhAgy7AgsgASAERgRAQfEBIQIMuwILAkACQAJAIAEtAABByABrDgsAAQgICAgICAgIAggLIAFBAWohAUHQASECDKMCCyABQQFqIQFB0QEhAgyiAgsgAUEBaiEBQdIBIQIMoQILQfABIQIgASAERg25AiADKAIAIgAgBCABa2ohBiABIABrQQJqIQUDQCABLQAAIABBtdUAai0AAEcNBCAAQQJGDQMgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAY2AgAMuQILQe8BIQIgASAERg24AiADKAIAIgAgBCABa2ohBiABIABrQQFqIQUDQCABLQAAIABBs9UAai0AAEcNAyAAQQFGDQIgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAY2AgAMuAILQe4BIQIgASAERg23AiADKAIAIgAgBCABa2ohBiABIABrQQJqIQUDQCABLQAAIABBsNUAai0AAEcNAiAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAY2AgAMtwILIAMoAgQhACADQgA3AwAgAyAAIAVBAWoiARArIgBFDQIgA0HsATYCHCADIAE2AhQgAyAANgIMQQAhAgy2AgsgA0EANgIACyADKAIEIQAgA0EANgIEIAMgACABECsiAEUNnAIgA0HtATYCHCADIAE2AhQgAyAANgIMQQAhAgy0AgtBzwEhAgyaAgtBACEAAkAgAygCOCICRQ0AIAIoAjQiAkUNACADIAIRAAAhAAsCQCAABEAgAEEVRg0BIANBADYCHCADIAE2AhQgA0HqDTYCECADQSY2AgxBACECDLQCC0HOASECDJoCCyADQesBNgIcIAMgATYCFCADQYAbNgIQIANBFTYCDEEAIQIMsgILIAEgBEYEQEHrASECDLICCyABLQAAQS9GBEAgAUEBaiEBDAELIANBADYCHCADIAE2AhQgA0GyODYCECADQQg2AgxBACECDLECC0HNASECDJcCCyABIARHBEAgA0EONgIIIAMgATYCBEHMASECDJcCC0HqASECDK8CCyABIARGBEBB6QEhAgyvAgsgAS0AAEEwayIAQf8BcUEKSQRAIAMgADoAKiABQQFqIQFBywEhAgyWAgsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDZcCIANB6AE2AhwgAyABNgIUIAMgADYCDEEAIQIMrgILIAEgBEYEQEHnASECDK4CCwJAIAEtAABBLkYEQCABQQFqIQEMAQsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDZgCIANB5gE2AhwgAyABNgIUIAMgADYCDEEAIQIMrgILQcoBIQIMlAILIAEgBEYEQEHlASECDK0CC0EAIQBBASEFQQEhB0EAIQICQAJAAkACQAJAAn8CQAJAAkACQAJAAkACQCABLQAAQTBrDgoKCQABAgMEBQYICwtBAgwGC0EDDAULQQQMBAtBBQwDC0EGDAILQQcMAQtBCAshAkEAIQVBACEHDAILQQkhAkEBIQBBACEFQQAhBwwBC0EAIQVBASECCyADIAI6ACsgAUEBaiEBAkACQCADLQAuQRBxDQACQAJAAkAgAy0AKg4DAQACBAsgB0UNAwwCCyAADQEMAgsgBUUNAQsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDQIgA0HiATYCHCADIAE2AhQgAyAANgIMQQAhAgyvAgsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDZoCIANB4wE2AhwgAyABNgIUIAMgADYCDEEAIQIMrgILIAMoAgQhACADQQA2AgQgAyAAIAEQLyIARQ2YAiADQeQBNgIcIAMgATYCFCADIAA2AgwMrQILQckBIQIMkwILQQAhAAJAIAMoAjgiAkUNACACKAJEIgJFDQAgAyACEQAAIQALAkAgAARAIABBFUYNASADQQA2AhwgAyABNgIUIANBpA02AhAgA0EhNgIMQQAhAgytAgtByAEhAgyTAgsgA0HhATYCHCADIAE2AhQgA0HQGjYCECADQRU2AgxBACECDKsCCyABIARGBEBB4QEhAgyrAgsCQCABLQAAQSBGBEAgA0EAOwE0IAFBAWohAQwBCyADQQA2AhwgAyABNgIUIANBmRE2AhAgA0EJNgIMQQAhAgyrAgtBxwEhAgyRAgsgASAERgRAQeABIQIMqgILAkAgAS0AAEEwa0H/AXEiAkEKSQRAIAFBAWohAQJAIAMvATQiAEGZM0sNACADIABBCmwiADsBNCAAQf7/A3EgAkH//wNzSw0AIAMgACACajsBNAwCC0EAIQIgA0EANgIcIAMgATYCFCADQZUeNgIQIANBDTYCDAyrAgsgA0EANgIcIAMgATYCFCADQZUeNgIQIANBDTYCDEEAIQIMqgILQcYBIQIMkAILIAEgBEYEQEHfASECDKkCCwJAIAEtAABBMGtB/wFxIgJBCkkEQCABQQFqIQECQCADLwE0IgBBmTNLDQAgAyAAQQpsIgA7ATQgAEH+/wNxIAJB//8Dc0sNACADIAAgAmo7ATQMAgtBACECIANBADYCHCADIAE2AhQgA0GVHjYCECADQQ02AgwMqgILIANBADYCHCADIAE2AhQgA0GVHjYCECADQQ02AgxBACECDKkCC0HFASECDI8CCyABIARGBEBB3gEhAgyoAgsCQCABLQAAQTBrQf8BcSICQQpJBEAgAUEBaiEBAkAgAy8BNCIAQZkzSw0AIAMgAEEKbCIAOwE0IABB/v8DcSACQf//A3NLDQAgAyAAIAJqOwE0DAILQQAhAiADQQA2AhwgAyABNgIUIANBlR42AhAgA0ENNgIMDKkCCyADQQA2AhwgAyABNgIUIANBlR42AhAgA0ENNgIMQQAhAgyoAgtBxAEhAgyOAgsgASAERgRAQd0BIQIMpwILAkACQAJAAkAgAS0AAEEKaw4XAgMDAAMDAwMDAwMDAwMDAwMDAwMDAwEDCyABQQFqDAULIAFBAWohAUHDASECDI8CCyABQQFqIQEgA0Evai0AAEEBcQ0IIANBADYCHCADIAE2AhQgA0GNCzYCECADQQ02AgxBACECDKcCCyADQQA2AhwgAyABNgIUIANBjQs2AhAgA0ENNgIMQQAhAgymAgsgASAERwRAIANBDzYCCCADIAE2AgRBASECDI0CC0HcASECDKUCCwJAAkADQAJAIAEtAABBCmsOBAIAAAMACyAEIAFBAWoiAUcNAAtB2wEhAgymAgsgAygCBCEAIANBADYCBCADIAAgARAtIgBFBEAgAUEBaiEBDAQLIANB2gE2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIMpQILIAMoAgQhACADQQA2AgQgAyAAIAEQLSIADQEgAUEBagshAUHBASECDIoCCyADQdkBNgIcIAMgADYCDCADIAFBAWo2AhRBACECDKICC0HCASECDIgCCyADQS9qLQAAQQFxDQEgA0EANgIcIAMgATYCFCADQeQcNgIQIANBGTYCDEEAIQIMoAILIAEgBEYEQEHZASECDKACCwJAAkACQCABLQAAQQprDgQBAgIAAgsgAUEBaiEBDAILIAFBAWohAQwBCyADLQAuQcAAcUUNAQtBACEAAkAgAygCOCICRQ0AIAIoAjwiAkUNACADIAIRAAAhAAsgAEUNoAEgAEEVRgRAIANB2QA2AhwgAyABNgIUIANBtxo2AhAgA0EVNgIMQQAhAgyfAgsgA0EANgIcIAMgATYCFCADQYANNgIQIANBGzYCDEEAIQIMngILIANBADYCHCADIAE2AhQgA0HcKDYCECADQQI2AgxBACECDJ0CCyABIARHBEAgA0EMNgIIIAMgATYCBEG/ASECDIQCC0HYASECDJwCCyABIARGBEBB1wEhAgycAgsCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAEtAABBwQBrDhUAAQIDWgQFBlpaWgcICQoLDA0ODxBaCyABQQFqIQFB+wAhAgySAgsgAUEBaiEBQfwAIQIMkQILIAFBAWohAUGBASECDJACCyABQQFqIQFBhQEhAgyPAgsgAUEBaiEBQYYBIQIMjgILIAFBAWohAUGJASECDI0CCyABQQFqIQFBigEhAgyMAgsgAUEBaiEBQY0BIQIMiwILIAFBAWohAUGWASECDIoCCyABQQFqIQFBlwEhAgyJAgsgAUEBaiEBQZgBIQIMiAILIAFBAWohAUGlASECDIcCCyABQQFqIQFBpgEhAgyGAgsgAUEBaiEBQawBIQIMhQILIAFBAWohAUG0ASECDIQCCyABQQFqIQFBtwEhAgyDAgsgAUEBaiEBQb4BIQIMggILIAEgBEYEQEHWASECDJsCCyABLQAAQc4ARw1IIAFBAWohAUG9ASECDIECCyABIARGBEBB1QEhAgyaAgsCQAJAAkAgAS0AAEHCAGsOEgBKSkpKSkpKSkoBSkpKSkpKAkoLIAFBAWohAUG4ASECDIICCyABQQFqIQFBuwEhAgyBAgsgAUEBaiEBQbwBIQIMgAILQdQBIQIgASAERg2YAiADKAIAIgAgBCABa2ohBSABIABrQQdqIQYCQANAIAEtAAAgAEGo1QBqLQAARw1FIABBB0YNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyZAgsgA0EANgIAIAZBAWohAUEbDEULIAEgBEYEQEHTASECDJgCCwJAAkAgAS0AAEHJAGsOBwBHR0dHRwFHCyABQQFqIQFBuQEhAgz/AQsgAUEBaiEBQboBIQIM/gELQdIBIQIgASAERg2WAiADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGm1QBqLQAARw1DIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyXAgsgA0EANgIAIAZBAWohAUEPDEMLQdEBIQIgASAERg2VAiADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGk1QBqLQAARw1CIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyWAgsgA0EANgIAIAZBAWohAUEgDEILQdABIQIgASAERg2UAiADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGh1QBqLQAARw1BIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyVAgsgA0EANgIAIAZBAWohAUESDEELIAEgBEYEQEHPASECDJQCCwJAAkAgAS0AAEHFAGsODgBDQ0NDQ0NDQ0NDQ0MBQwsgAUEBaiEBQbUBIQIM+wELIAFBAWohAUG2ASECDPoBC0HOASECIAEgBEYNkgIgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBntUAai0AAEcNPyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMkwILIANBADYCACAGQQFqIQFBBww/C0HNASECIAEgBEYNkQIgAygCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABBmNUAai0AAEcNPiAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMkgILIANBADYCACAGQQFqIQFBKAw+CyABIARGBEBBzAEhAgyRAgsCQAJAAkAgAS0AAEHFAGsOEQBBQUFBQUFBQUEBQUFBQUECQQsgAUEBaiEBQbEBIQIM+QELIAFBAWohAUGyASECDPgBCyABQQFqIQFBswEhAgz3AQtBywEhAiABIARGDY8CIAMoAgAiACAEIAFraiEFIAEgAGtBBmohBgJAA0AgAS0AACAAQZHVAGotAABHDTwgAEEGRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJACCyADQQA2AgAgBkEBaiEBQRoMPAtBygEhAiABIARGDY4CIAMoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQY3VAGotAABHDTsgAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADI8CCyADQQA2AgAgBkEBaiEBQSEMOwsgASAERgRAQckBIQIMjgILAkACQCABLQAAQcEAaw4UAD09PT09PT09PT09PT09PT09PQE9CyABQQFqIQFBrQEhAgz1AQsgAUEBaiEBQbABIQIM9AELIAEgBEYEQEHIASECDI0CCwJAAkAgAS0AAEHVAGsOCwA8PDw8PDw8PDwBPAsgAUEBaiEBQa4BIQIM9AELIAFBAWohAUGvASECDPMBC0HHASECIAEgBEYNiwIgAygCACIAIAQgAWtqIQUgASAAa0EIaiEGAkADQCABLQAAIABBhNUAai0AAEcNOCAAQQhGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMjAILIANBADYCACAGQQFqIQFBKgw4CyABIARGBEBBxgEhAgyLAgsgAS0AAEHQAEcNOCABQQFqIQFBJQw3C0HFASECIAEgBEYNiQIgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBgdUAai0AAEcNNiAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMigILIANBADYCACAGQQFqIQFBDgw2CyABIARGBEBBxAEhAgyJAgsgAS0AAEHFAEcNNiABQQFqIQFBqwEhAgzvAQsgASAERgRAQcMBIQIMiAILAkACQAJAAkAgAS0AAEHCAGsODwABAjk5OTk5OTk5OTk5AzkLIAFBAWohAUGnASECDPEBCyABQQFqIQFBqAEhAgzwAQsgAUEBaiEBQakBIQIM7wELIAFBAWohAUGqASECDO4BC0HCASECIAEgBEYNhgIgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABB/tQAai0AAEcNMyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMhwILIANBADYCACAGQQFqIQFBFAwzC0HBASECIAEgBEYNhQIgAygCACIAIAQgAWtqIQUgASAAa0EEaiEGAkADQCABLQAAIABB+dQAai0AAEcNMiAAQQRGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMhgILIANBADYCACAGQQFqIQFBKwwyC0HAASECIAEgBEYNhAIgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABB9tQAai0AAEcNMSAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMhQILIANBADYCACAGQQFqIQFBLAwxC0G/ASECIAEgBEYNgwIgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBodUAai0AAEcNMCAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMhAILIANBADYCACAGQQFqIQFBEQwwC0G+ASECIAEgBEYNggIgAygCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABB8tQAai0AAEcNLyAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMgwILIANBADYCACAGQQFqIQFBLgwvCyABIARGBEBBvQEhAgyCAgsCQAJAAkACQAJAIAEtAABBwQBrDhUANDQ0NDQ0NDQ0NAE0NAI0NAM0NAQ0CyABQQFqIQFBmwEhAgzsAQsgAUEBaiEBQZwBIQIM6wELIAFBAWohAUGdASECDOoBCyABQQFqIQFBogEhAgzpAQsgAUEBaiEBQaQBIQIM6AELIAEgBEYEQEG8ASECDIECCwJAAkAgAS0AAEHSAGsOAwAwATALIAFBAWohAUGjASECDOgBCyABQQFqIQFBBAwtC0G7ASECIAEgBEYN/wEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB8NQAai0AAEcNLCAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMgAILIANBADYCACAGQQFqIQFBHQwsCyABIARGBEBBugEhAgz/AQsCQAJAIAEtAABByQBrDgcBLi4uLi4ALgsgAUEBaiEBQaEBIQIM5gELIAFBAWohAUEiDCsLIAEgBEYEQEG5ASECDP4BCyABLQAAQdAARw0rIAFBAWohAUGgASECDOQBCyABIARGBEBBuAEhAgz9AQsCQAJAIAEtAABBxgBrDgsALCwsLCwsLCwsASwLIAFBAWohAUGeASECDOQBCyABQQFqIQFBnwEhAgzjAQtBtwEhAiABIARGDfsBIAMoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQezUAGotAABHDSggAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPwBCyADQQA2AgAgBkEBaiEBQQ0MKAtBtgEhAiABIARGDfoBIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQaHVAGotAABHDScgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPsBCyADQQA2AgAgBkEBaiEBQQwMJwtBtQEhAiABIARGDfkBIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQerUAGotAABHDSYgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPoBCyADQQA2AgAgBkEBaiEBQQMMJgtBtAEhAiABIARGDfgBIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQejUAGotAABHDSUgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPkBCyADQQA2AgAgBkEBaiEBQSYMJQsgASAERgRAQbMBIQIM+AELAkACQCABLQAAQdQAaw4CAAEnCyABQQFqIQFBmQEhAgzfAQsgAUEBaiEBQZoBIQIM3gELQbIBIQIgASAERg32ASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHm1ABqLQAARw0jIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAz3AQsgA0EANgIAIAZBAWohAUEnDCMLQbEBIQIgASAERg31ASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHk1ABqLQAARw0iIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAz2AQsgA0EANgIAIAZBAWohAUEcDCILQbABIQIgASAERg30ASADKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEHe1ABqLQAARw0hIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAz1AQsgA0EANgIAIAZBAWohAUEGDCELQa8BIQIgASAERg3zASADKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEHZ1ABqLQAARw0gIABBBEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAz0AQsgA0EANgIAIAZBAWohAUEZDCALIAEgBEYEQEGuASECDPMBCwJAAkACQAJAIAEtAABBLWsOIwAkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJAEkJCQkJAIkJCQDJAsgAUEBaiEBQY4BIQIM3AELIAFBAWohAUGPASECDNsBCyABQQFqIQFBlAEhAgzaAQsgAUEBaiEBQZUBIQIM2QELQa0BIQIgASAERg3xASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHX1ABqLQAARw0eIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzyAQsgA0EANgIAIAZBAWohAUELDB4LIAEgBEYEQEGsASECDPEBCwJAAkAgAS0AAEHBAGsOAwAgASALIAFBAWohAUGQASECDNgBCyABQQFqIQFBkwEhAgzXAQsgASAERgRAQasBIQIM8AELAkACQCABLQAAQcEAaw4PAB8fHx8fHx8fHx8fHx8BHwsgAUEBaiEBQZEBIQIM1wELIAFBAWohAUGSASECDNYBCyABIARGBEBBqgEhAgzvAQsgAS0AAEHMAEcNHCABQQFqIQFBCgwbC0GpASECIAEgBEYN7QEgAygCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABB0dQAai0AAEcNGiAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM7gELIANBADYCACAGQQFqIQFBHgwaC0GoASECIAEgBEYN7AEgAygCACIAIAQgAWtqIQUgASAAa0EGaiEGAkADQCABLQAAIABBytQAai0AAEcNGSAAQQZGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM7QELIANBADYCACAGQQFqIQFBFQwZC0GnASECIAEgBEYN6wEgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBx9QAai0AAEcNGCAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM7AELIANBADYCACAGQQFqIQFBFwwYC0GmASECIAEgBEYN6gEgAygCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABBwdQAai0AAEcNFyAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM6wELIANBADYCACAGQQFqIQFBGAwXCyABIARGBEBBpQEhAgzqAQsCQAJAIAEtAABByQBrDgcAGRkZGRkBGQsgAUEBaiEBQYsBIQIM0QELIAFBAWohAUGMASECDNABC0GkASECIAEgBEYN6AEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBptUAai0AAEcNFSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM6QELIANBADYCACAGQQFqIQFBCQwVC0GjASECIAEgBEYN5wEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBpNUAai0AAEcNFCAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM6AELIANBADYCACAGQQFqIQFBHwwUC0GiASECIAEgBEYN5gEgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBvtQAai0AAEcNEyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM5wELIANBADYCACAGQQFqIQFBAgwTC0GhASECIAEgBEYN5QEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGA0AgAS0AACAAQbzUAGotAABHDREgAEEBRg0CIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADOUBCyABIARGBEBBoAEhAgzlAQtBASABLQAAQd8ARw0RGiABQQFqIQFBhwEhAgzLAQsgA0EANgIAIAZBAWohAUGIASECDMoBC0GfASECIAEgBEYN4gEgAygCACIAIAQgAWtqIQUgASAAa0EIaiEGAkADQCABLQAAIABBhNUAai0AAEcNDyAAQQhGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM4wELIANBADYCACAGQQFqIQFBKQwPC0GeASECIAEgBEYN4QEgAygCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABBuNQAai0AAEcNDiAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM4gELIANBADYCACAGQQFqIQFBLQwOCyABIARGBEBBnQEhAgzhAQsgAS0AAEHFAEcNDiABQQFqIQFBhAEhAgzHAQsgASAERgRAQZwBIQIM4AELAkACQCABLQAAQcwAaw4IAA8PDw8PDwEPCyABQQFqIQFBggEhAgzHAQsgAUEBaiEBQYMBIQIMxgELQZsBIQIgASAERg3eASADKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEGz1ABqLQAARw0LIABBBEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzfAQsgA0EANgIAIAZBAWohAUEjDAsLQZoBIQIgASAERg3dASADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGw1ABqLQAARw0KIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzeAQsgA0EANgIAIAZBAWohAUEADAoLIAEgBEYEQEGZASECDN0BCwJAAkAgAS0AAEHIAGsOCAAMDAwMDAwBDAsgAUEBaiEBQf0AIQIMxAELIAFBAWohAUGAASECDMMBCyABIARGBEBBmAEhAgzcAQsCQAJAIAEtAABBzgBrDgMACwELCyABQQFqIQFB/gAhAgzDAQsgAUEBaiEBQf8AIQIMwgELIAEgBEYEQEGXASECDNsBCyABLQAAQdkARw0IIAFBAWohAUEIDAcLQZYBIQIgASAERg3ZASADKAIAIgAgBCABa2ohBSABIABrQQNqIQYCQANAIAEtAAAgAEGs1ABqLQAARw0GIABBA0YNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzaAQsgA0EANgIAIAZBAWohAUEFDAYLQZUBIQIgASAERg3YASADKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGm1ABqLQAARw0FIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzZAQsgA0EANgIAIAZBAWohAUEWDAULQZQBIQIgASAERg3XASADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGh1QBqLQAARw0EIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzYAQsgA0EANgIAIAZBAWohAUEQDAQLIAEgBEYEQEGTASECDNcBCwJAAkAgAS0AAEHDAGsODAAGBgYGBgYGBgYGAQYLIAFBAWohAUH5ACECDL4BCyABQQFqIQFB+gAhAgy9AQtBkgEhAiABIARGDdUBIAMoAgAiACAEIAFraiEFIAEgAGtBBWohBgJAA0AgAS0AACAAQaDUAGotAABHDQIgAEEFRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADNYBCyADQQA2AgAgBkEBaiEBQSQMAgsgA0EANgIADAILIAEgBEYEQEGRASECDNQBCyABLQAAQcwARw0BIAFBAWohAUETCzoAKSADKAIEIQAgA0EANgIEIAMgACABEC4iAA0CDAELQQAhAiADQQA2AhwgAyABNgIUIANB/h82AhAgA0EGNgIMDNEBC0H4ACECDLcBCyADQZABNgIcIAMgATYCFCADIAA2AgxBACECDM8BC0EAIQACQCADKAI4IgJFDQAgAigCQCICRQ0AIAMgAhEAACEACyAARQ0AIABBFUYNASADQQA2AhwgAyABNgIUIANBgg82AhAgA0EgNgIMQQAhAgzOAQtB9wAhAgy0AQsgA0GPATYCHCADIAE2AhQgA0HsGzYCECADQRU2AgxBACECDMwBCyABIARGBEBBjwEhAgzMAQsCQCABLQAAQSBGBEAgAUEBaiEBDAELIANBADYCHCADIAE2AhQgA0GbHzYCECADQQY2AgxBACECDMwBC0ECIQIMsgELA0AgAS0AAEEgRw0CIAQgAUEBaiIBRw0AC0GOASECDMoBCyABIARGBEBBjQEhAgzKAQsCQCABLQAAQQlrDgRKAABKAAtB9QAhAgywAQsgAy0AKUEFRgRAQfYAIQIMsAELQfQAIQIMrwELIAEgBEYEQEGMASECDMgBCyADQRA2AgggAyABNgIEDAoLIAEgBEYEQEGLASECDMcBCwJAIAEtAABBCWsOBEcAAEcAC0HzACECDK0BCyABIARHBEAgA0EQNgIIIAMgATYCBEHxACECDK0BC0GKASECDMUBCwJAIAEgBEcEQANAIAEtAABBoNAAai0AACIAQQNHBEACQCAAQQFrDgJJAAQLQfAAIQIMrwELIAQgAUEBaiIBRw0AC0GIASECDMYBC0GIASECDMUBCyADQQA2AhwgAyABNgIUIANB2yA2AhAgA0EHNgIMQQAhAgzEAQsgASAERgRAQYkBIQIMxAELAkACQAJAIAEtAABBoNIAai0AAEEBaw4DRgIAAQtB8gAhAgysAQsgA0EANgIcIAMgATYCFCADQbQSNgIQIANBBzYCDEEAIQIMxAELQeoAIQIMqgELIAEgBEcEQCABQQFqIQFB7wAhAgyqAQtBhwEhAgzCAQsgBCABIgBGBEBBhgEhAgzCAQsgAC0AACIBQS9GBEAgAEEBaiEBQe4AIQIMqQELIAFBCWsiAkEXSw0BIAAhAUEBIAJ0QZuAgARxDUEMAQsgBCABIgBGBEBBhQEhAgzBAQsgAC0AAEEvRw0AIABBAWohAQwDC0EAIQIgA0EANgIcIAMgADYCFCADQdsgNgIQIANBBzYCDAy/AQsCQAJAAkACQAJAA0AgAS0AAEGgzgBqLQAAIgBBBUcEQAJAAkAgAEEBaw4IRwUGBwgABAEIC0HrACECDK0BCyABQQFqIQFB7QAhAgysAQsgBCABQQFqIgFHDQALQYQBIQIMwwELIAFBAWoMFAsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDR4gA0HbADYCHCADIAE2AhQgAyAANgIMQQAhAgzBAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDR4gA0HdADYCHCADIAE2AhQgAyAANgIMQQAhAgzAAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDR4gA0H6ADYCHCADIAE2AhQgAyAANgIMQQAhAgy/AQsgA0EANgIcIAMgATYCFCADQfkPNgIQIANBBzYCDEEAIQIMvgELIAEgBEYEQEGDASECDL4BCwJAIAEtAABBoM4Aai0AAEEBaw4IPgQFBgAIAgMHCyABQQFqIQELQQMhAgyjAQsgAUEBagwNC0EAIQIgA0EANgIcIANB0RI2AhAgA0EHNgIMIAMgAUEBajYCFAy6AQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDRYgA0HbADYCHCADIAE2AhQgAyAANgIMQQAhAgy5AQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDRYgA0HdADYCHCADIAE2AhQgAyAANgIMQQAhAgy4AQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDRYgA0H6ADYCHCADIAE2AhQgAyAANgIMQQAhAgy3AQsgA0EANgIcIAMgATYCFCADQfkPNgIQIANBBzYCDEEAIQIMtgELQewAIQIMnAELIAEgBEYEQEGCASECDLUBCyABQQFqDAILIAEgBEYEQEGBASECDLQBCyABQQFqDAELIAEgBEYNASABQQFqCyEBQQQhAgyYAQtBgAEhAgywAQsDQCABLQAAQaDMAGotAAAiAEECRwRAIABBAUcEQEHpACECDJkBCwwxCyAEIAFBAWoiAUcNAAtB/wAhAgyvAQsgASAERgRAQf4AIQIMrwELAkAgAS0AAEEJaw43LwMGLwQGBgYGBgYGBgYGBgYGBgYGBgYFBgYCBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGAAYLIAFBAWoLIQFBBSECDJQBCyABQQFqDAYLIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0IIANB2wA2AhwgAyABNgIUIAMgADYCDEEAIQIMqwELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0IIANB3QA2AhwgAyABNgIUIAMgADYCDEEAIQIMqgELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0IIANB+gA2AhwgAyABNgIUIAMgADYCDEEAIQIMqQELIANBADYCHCADIAE2AhQgA0GNFDYCECADQQc2AgxBACECDKgBCwJAAkACQAJAA0AgAS0AAEGgygBqLQAAIgBBBUcEQAJAIABBAWsOBi4DBAUGAAYLQegAIQIMlAELIAQgAUEBaiIBRw0AC0H9ACECDKsBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNByADQdsANgIcIAMgATYCFCADIAA2AgxBACECDKoBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNByADQd0ANgIcIAMgATYCFCADIAA2AgxBACECDKkBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNByADQfoANgIcIAMgATYCFCADIAA2AgxBACECDKgBCyADQQA2AhwgAyABNgIUIANB5Ag2AhAgA0EHNgIMQQAhAgynAQsgASAERg0BIAFBAWoLIQFBBiECDIwBC0H8ACECDKQBCwJAAkACQAJAA0AgAS0AAEGgyABqLQAAIgBBBUcEQCAAQQFrDgQpAgMEBQsgBCABQQFqIgFHDQALQfsAIQIMpwELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0DIANB2wA2AhwgAyABNgIUIAMgADYCDEEAIQIMpgELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0DIANB3QA2AhwgAyABNgIUIAMgADYCDEEAIQIMpQELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0DIANB+gA2AhwgAyABNgIUIAMgADYCDEEAIQIMpAELIANBADYCHCADIAE2AhQgA0G8CjYCECADQQc2AgxBACECDKMBC0HPACECDIkBC0HRACECDIgBC0HnACECDIcBCyABIARGBEBB+gAhAgygAQsCQCABLQAAQQlrDgQgAAAgAAsgAUEBaiEBQeYAIQIMhgELIAEgBEYEQEH5ACECDJ8BCwJAIAEtAABBCWsOBB8AAB8AC0EAIQACQCADKAI4IgJFDQAgAigCOCICRQ0AIAMgAhEAACEACyAARQRAQeIBIQIMhgELIABBFUcEQCADQQA2AhwgAyABNgIUIANByQ02AhAgA0EaNgIMQQAhAgyfAQsgA0H4ADYCHCADIAE2AhQgA0HqGjYCECADQRU2AgxBACECDJ4BCyABIARHBEAgA0ENNgIIIAMgATYCBEHkACECDIUBC0H3ACECDJ0BCyABIARGBEBB9gAhAgydAQsCQAJAAkAgAS0AAEHIAGsOCwABCwsLCwsLCwsCCwsgAUEBaiEBQd0AIQIMhQELIAFBAWohAUHgACECDIQBCyABQQFqIQFB4wAhAgyDAQtB9QAhAiABIARGDZsBIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQbXVAGotAABHDQggAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJwBCyADKAIEIQAgA0IANwMAIAMgACAGQQFqIgEQKyIABEAgA0H0ADYCHCADIAE2AhQgAyAANgIMQQAhAgycAQtB4gAhAgyCAQtBACEAAkAgAygCOCICRQ0AIAIoAjQiAkUNACADIAIRAAAhAAsCQCAABEAgAEEVRg0BIANBADYCHCADIAE2AhQgA0HqDTYCECADQSY2AgxBACECDJwBC0HhACECDIIBCyADQfMANgIcIAMgATYCFCADQYAbNgIQIANBFTYCDEEAIQIMmgELIAMtACkiAEEja0ELSQ0JAkAgAEEGSw0AQQEgAHRBygBxRQ0ADAoLQQAhAiADQQA2AhwgAyABNgIUIANB7Qk2AhAgA0EINgIMDJkBC0HyACECIAEgBEYNmAEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBs9UAai0AAEcNBSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMmQELIAMoAgQhACADQgA3AwAgAyAAIAZBAWoiARArIgAEQCADQfEANgIcIAMgATYCFCADIAA2AgxBACECDJkBC0HfACECDH8LQQAhAAJAIAMoAjgiAkUNACACKAI0IgJFDQAgAyACEQAAIQALAkAgAARAIABBFUYNASADQQA2AhwgAyABNgIUIANB6g02AhAgA0EmNgIMQQAhAgyZAQtB3gAhAgx/CyADQfAANgIcIAMgATYCFCADQYAbNgIQIANBFTYCDEEAIQIMlwELIAMtAClBIUYNBiADQQA2AhwgAyABNgIUIANBkQo2AhAgA0EINgIMQQAhAgyWAQtB7wAhAiABIARGDZUBIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQbDVAGotAABHDQIgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJYBCyADKAIEIQAgA0IANwMAIAMgACAGQQFqIgEQKyIARQ0CIANB7QA2AhwgAyABNgIUIAMgADYCDEEAIQIMlQELIANBADYCAAsgAygCBCEAIANBADYCBCADIAAgARArIgBFDYABIANB7gA2AhwgAyABNgIUIAMgADYCDEEAIQIMkwELQdwAIQIMeQtBACEAAkAgAygCOCICRQ0AIAIoAjQiAkUNACADIAIRAAAhAAsCQCAABEAgAEEVRg0BIANBADYCHCADIAE2AhQgA0HqDTYCECADQSY2AgxBACECDJMBC0HbACECDHkLIANB7AA2AhwgAyABNgIUIANBgBs2AhAgA0EVNgIMQQAhAgyRAQsgAy0AKSIAQSNJDQAgAEEuRg0AIANBADYCHCADIAE2AhQgA0HJCTYCECADQQg2AgxBACECDJABC0HaACECDHYLIAEgBEYEQEHrACECDI8BCwJAIAEtAABBL0YEQCABQQFqIQEMAQsgA0EANgIcIAMgATYCFCADQbI4NgIQIANBCDYCDEEAIQIMjwELQdkAIQIMdQsgASAERwRAIANBDjYCCCADIAE2AgRB2AAhAgx1C0HqACECDI0BCyABIARGBEBB6QAhAgyNAQsgAS0AAEEwayIAQf8BcUEKSQRAIAMgADoAKiABQQFqIQFB1wAhAgx0CyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNeiADQegANgIcIAMgATYCFCADIAA2AgxBACECDIwBCyABIARGBEBB5wAhAgyMAQsCQCABLQAAQS5GBEAgAUEBaiEBDAELIAMoAgQhACADQQA2AgQgAyAAIAEQLyIARQ17IANB5gA2AhwgAyABNgIUIAMgADYCDEEAIQIMjAELQdYAIQIMcgsgASAERgRAQeUAIQIMiwELQQAhAEEBIQVBASEHQQAhAgJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAIAEtAABBMGsOCgoJAAECAwQFBggLC0ECDAYLQQMMBQtBBAwEC0EFDAMLQQYMAgtBBwwBC0EICyECQQAhBUEAIQcMAgtBCSECQQEhAEEAIQVBACEHDAELQQAhBUEBIQILIAMgAjoAKyABQQFqIQECQAJAIAMtAC5BEHENAAJAAkACQCADLQAqDgMBAAIECyAHRQ0DDAILIAANAQwCCyAFRQ0BCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNAiADQeIANgIcIAMgATYCFCADIAA2AgxBACECDI0BCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNfSADQeMANgIcIAMgATYCFCADIAA2AgxBACECDIwBCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNeyADQeQANgIcIAMgATYCFCADIAA2AgwMiwELQdQAIQIMcQsgAy0AKUEiRg2GAUHTACECDHALQQAhAAJAIAMoAjgiAkUNACACKAJEIgJFDQAgAyACEQAAIQALIABFBEBB1QAhAgxwCyAAQRVHBEAgA0EANgIcIAMgATYCFCADQaQNNgIQIANBITYCDEEAIQIMiQELIANB4QA2AhwgAyABNgIUIANB0Bo2AhAgA0EVNgIMQQAhAgyIAQsgASAERgRAQeAAIQIMiAELAkACQAJAAkACQCABLQAAQQprDgQBBAQABAsgAUEBaiEBDAELIAFBAWohASADQS9qLQAAQQFxRQ0BC0HSACECDHALIANBADYCHCADIAE2AhQgA0G2ETYCECADQQk2AgxBACECDIgBCyADQQA2AhwgAyABNgIUIANBthE2AhAgA0EJNgIMQQAhAgyHAQsgASAERgRAQd8AIQIMhwELIAEtAABBCkYEQCABQQFqIQEMCQsgAy0ALkHAAHENCCADQQA2AhwgAyABNgIUIANBthE2AhAgA0ECNgIMQQAhAgyGAQsgASAERgRAQd0AIQIMhgELIAEtAAAiAkENRgRAIAFBAWohAUHQACECDG0LIAEhACACQQlrDgQFAQEFAQsgBCABIgBGBEBB3AAhAgyFAQsgAC0AAEEKRw0AIABBAWoMAgtBACECIANBADYCHCADIAA2AhQgA0HKLTYCECADQQc2AgwMgwELIAEgBEYEQEHbACECDIMBCwJAIAEtAABBCWsOBAMAAAMACyABQQFqCyEBQc4AIQIMaAsgASAERgRAQdoAIQIMgQELIAEtAABBCWsOBAABAQABC0EAIQIgA0EANgIcIANBmhI2AhAgA0EHNgIMIAMgAUEBajYCFAx/CyADQYASOwEqQQAhAAJAIAMoAjgiAkUNACACKAI4IgJFDQAgAyACEQAAIQALIABFDQAgAEEVRw0BIANB2QA2AhwgAyABNgIUIANB6ho2AhAgA0EVNgIMQQAhAgx+C0HNACECDGQLIANBADYCHCADIAE2AhQgA0HJDTYCECADQRo2AgxBACECDHwLIAEgBEYEQEHZACECDHwLIAEtAABBIEcNPSABQQFqIQEgAy0ALkEBcQ09IANBADYCHCADIAE2AhQgA0HCHDYCECADQR42AgxBACECDHsLIAEgBEYEQEHYACECDHsLAkACQAJAAkACQCABLQAAIgBBCmsOBAIDAwABCyABQQFqIQFBLCECDGULIABBOkcNASADQQA2AhwgAyABNgIUIANB5xE2AhAgA0EKNgIMQQAhAgx9CyABQQFqIQEgA0Evai0AAEEBcUUNcyADLQAyQYABcUUEQCADQTJqIQIgAxA1QQAhAAJAIAMoAjgiBkUNACAGKAIoIgZFDQAgAyAGEQAAIQALAkACQCAADhZNTEsBAQEBAQEBAQEBAQEBAQEBAQEAAQsgA0EpNgIcIAMgATYCFCADQawZNgIQIANBFTYCDEEAIQIMfgsgA0EANgIcIAMgATYCFCADQeULNgIQIANBETYCDEEAIQIMfQtBACEAAkAgAygCOCICRQ0AIAIoAlwiAkUNACADIAIRAAAhAAsgAEUNWSAAQRVHDQEgA0EFNgIcIAMgATYCFCADQZsbNgIQIANBFTYCDEEAIQIMfAtBywAhAgxiC0EAIQIgA0EANgIcIAMgATYCFCADQZAONgIQIANBFDYCDAx6CyADIAMvATJBgAFyOwEyDDsLIAEgBEcEQCADQRE2AgggAyABNgIEQcoAIQIMYAtB1wAhAgx4CyABIARGBEBB1gAhAgx4CwJAAkACQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxQeMAaw4TAEBAQEBAQEBAQEBAQAFAQEACA0ALIAFBAWohAUHGACECDGELIAFBAWohAUHHACECDGALIAFBAWohAUHIACECDF8LIAFBAWohAUHJACECDF4LQdUAIQIgBCABIgBGDXYgBCABayADKAIAIgFqIQYgACABa0EFaiEHA0AgAUGQyABqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0IQQQgAUEFRg0KGiABQQFqIQEgBCAAQQFqIgBHDQALIAMgBjYCAAx2C0HUACECIAQgASIARg11IAQgAWsgAygCACIBaiEGIAAgAWtBD2ohBwNAIAFBgMgAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNB0EDIAFBD0YNCRogAUEBaiEBIAQgAEEBaiIARw0ACyADIAY2AgAMdQtB0wAhAiAEIAEiAEYNdCAEIAFrIAMoAgAiAWohBiAAIAFrQQ5qIQcDQCABQeLHAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQYgAUEORg0HIAFBAWohASAEIABBAWoiAEcNAAsgAyAGNgIADHQLQdIAIQIgBCABIgBGDXMgBCABayADKAIAIgFqIQUgACABa0EBaiEGA0AgAUHgxwBqLQAAIAAtAAAiB0EgciAHIAdBwQBrQf8BcUEaSRtB/wFxRw0FIAFBAUYNAiABQQFqIQEgBCAAQQFqIgBHDQALIAMgBTYCAAxzCyABIARGBEBB0QAhAgxzCwJAAkAgAS0AACIAQSByIAAgAEHBAGtB/wFxQRpJG0H/AXFB7gBrDgcAOTk5OTkBOQsgAUEBaiEBQcMAIQIMWgsgAUEBaiEBQcQAIQIMWQsgA0EANgIAIAZBAWohAUHFACECDFgLQdAAIQIgBCABIgBGDXAgBCABayADKAIAIgFqIQYgACABa0EJaiEHA0AgAUHWxwBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0CQQIgAUEJRg0EGiABQQFqIQEgBCAAQQFqIgBHDQALIAMgBjYCAAxwC0HPACECIAQgASIARg1vIAQgAWsgAygCACIBaiEGIAAgAWtBBWohBwNAIAFB0McAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNASABQQVGDQIgAUEBaiEBIAQgAEEBaiIARw0ACyADIAY2AgAMbwsgACEBIANBADYCAAwzC0EBCzoALCADQQA2AgAgB0EBaiEBC0EtIQIMUgsCQANAIAEtAABB0MUAai0AAEEBRw0BIAQgAUEBaiIBRw0AC0HNACECDGsLQcIAIQIMUQsgASAERgRAQcwAIQIMagsgAS0AAEE6RgRAIAMoAgQhACADQQA2AgQgAyAAIAEQMCIARQ0zIANBywA2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIMagsgA0EANgIcIAMgATYCFCADQecRNgIQIANBCjYCDEEAIQIMaQsCQAJAIAMtACxBAmsOAgABJwsgA0Ezai0AAEECcUUNJiADLQAuQQJxDSYgA0EANgIcIAMgATYCFCADQaYUNgIQIANBCzYCDEEAIQIMaQsgAy0AMkEgcUUNJSADLQAuQQJxDSUgA0EANgIcIAMgATYCFCADQb0TNgIQIANBDzYCDEEAIQIMaAtBACEAAkAgAygCOCICRQ0AIAIoAkgiAkUNACADIAIRAAAhAAsgAEUEQEHBACECDE8LIABBFUcEQCADQQA2AhwgAyABNgIUIANBpg82AhAgA0EcNgIMQQAhAgxoCyADQcoANgIcIAMgATYCFCADQYUcNgIQIANBFTYCDEEAIQIMZwsgASAERwRAA0AgAS0AAEHAwQBqLQAAQQFHDRcgBCABQQFqIgFHDQALQcQAIQIMZwtBxAAhAgxmCyABIARHBEADQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxIgBBCUYNACAAQSBGDQACQAJAAkACQCAAQeMAaw4TAAMDAwMDAwMBAwMDAwMDAwMDAgMLIAFBAWohAUE2IQIMUgsgAUEBaiEBQTchAgxRCyABQQFqIQFBOCECDFALDBULIAQgAUEBaiIBRw0AC0E8IQIMZgtBPCECDGULIAEgBEYEQEHIACECDGULIANBEjYCCCADIAE2AgQCQAJAAkACQAJAIAMtACxBAWsOBBQAAQIJCyADLQAyQSBxDQNB4AEhAgxPCwJAIAMvATIiAEEIcUUNACADLQAoQQFHDQAgAy0ALkEIcUUNAgsgAyAAQff7A3FBgARyOwEyDAsLIAMgAy8BMkEQcjsBMgwECyADQQA2AgQgAyABIAEQMSIABEAgA0HBADYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgxmCyABQQFqIQEMWAsgA0EANgIcIAMgATYCFCADQfQTNgIQIANBBDYCDEEAIQIMZAtBxwAhAiABIARGDWMgAygCACIAIAQgAWtqIQUgASAAa0EGaiEGAkADQCAAQcDFAGotAAAgAS0AAEEgckcNASAAQQZGDUogAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMZAsgA0EANgIADAULAkAgASAERwRAA0AgAS0AAEHAwwBqLQAAIgBBAUcEQCAAQQJHDQMgAUEBaiEBDAULIAQgAUEBaiIBRw0AC0HFACECDGQLQcUAIQIMYwsLIANBADoALAwBC0ELIQIMRwtBPyECDEYLAkACQANAIAEtAAAiAEEgRwRAAkAgAEEKaw4EAwUFAwALIABBLEYNAwwECyAEIAFBAWoiAUcNAAtBxgAhAgxgCyADQQg6ACwMDgsgAy0AKEEBRw0CIAMtAC5BCHENAiADKAIEIQAgA0EANgIEIAMgACABEDEiAARAIANBwgA2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIMXwsgAUEBaiEBDFALQTshAgxECwJAA0AgAS0AACIAQSBHIABBCUdxDQEgBCABQQFqIgFHDQALQcMAIQIMXQsLQTwhAgxCCwJAAkAgASAERwRAA0AgAS0AACIAQSBHBEAgAEEKaw4EAwQEAwQLIAQgAUEBaiIBRw0AC0E/IQIMXQtBPyECDFwLIAMgAy8BMkEgcjsBMgwKCyADKAIEIQAgA0EANgIEIAMgACABEDEiAEUNTiADQT42AhwgAyABNgIUIAMgADYCDEEAIQIMWgsCQCABIARHBEADQCABLQAAQcDDAGotAAAiAEEBRwRAIABBAkYNAwwMCyAEIAFBAWoiAUcNAAtBNyECDFsLQTchAgxaCyABQQFqIQEMBAtBOyECIAQgASIARg1YIAQgAWsgAygCACIBaiEGIAAgAWtBBWohBwJAA0AgAUGQyABqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBBUYEQEEHIQEMPwsgAUEBaiEBIAQgAEEBaiIARw0ACyADIAY2AgAMWQsgA0EANgIAIAAhAQwFC0E6IQIgBCABIgBGDVcgBCABayADKAIAIgFqIQYgACABa0EIaiEHAkADQCABQbTBAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQEgAUEIRgRAQQUhAQw+CyABQQFqIQEgBCAAQQFqIgBHDQALIAMgBjYCAAxYCyADQQA2AgAgACEBDAQLQTkhAiAEIAEiAEYNViAEIAFrIAMoAgAiAWohBiAAIAFrQQNqIQcCQANAIAFBsMEAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNASABQQNGBEBBBiEBDD0LIAFBAWohASAEIABBAWoiAEcNAAsgAyAGNgIADFcLIANBADYCACAAIQEMAwsCQANAIAEtAAAiAEEgRwRAIABBCmsOBAcEBAcCCyAEIAFBAWoiAUcNAAtBOCECDFYLIABBLEcNASABQQFqIQBBASEBAkACQAJAAkACQCADLQAsQQVrDgQDAQIEAAsgACEBDAQLQQIhAQwBC0EEIQELIANBAToALCADIAMvATIgAXI7ATIgACEBDAELIAMgAy8BMkEIcjsBMiAAIQELQT4hAgw7CyADQQA6ACwLQTkhAgw5CyABIARGBEBBNiECDFILAkACQAJAAkACQCABLQAAQQprDgQAAgIBAgsgAygCBCEAIANBADYCBCADIAAgARAxIgBFDQIgA0EzNgIcIAMgATYCFCADIAA2AgxBACECDFULIAMoAgQhACADQQA2AgQgAyAAIAEQMSIARQRAIAFBAWohAQwGCyADQTI2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIMVAsgAy0ALkEBcQRAQd8BIQIMOwsgAygCBCEAIANBADYCBCADIAAgARAxIgANAQxJC0E0IQIMOQsgA0E1NgIcIAMgATYCFCADIAA2AgxBACECDFELQTUhAgw3CyADQS9qLQAAQQFxDQAgA0EANgIcIAMgATYCFCADQesWNgIQIANBGTYCDEEAIQIMTwtBMyECDDULIAEgBEYEQEEyIQIMTgsCQCABLQAAQQpGBEAgAUEBaiEBDAELIANBADYCHCADIAE2AhQgA0GSFzYCECADQQM2AgxBACECDE4LQTIhAgw0CyABIARGBEBBMSECDE0LAkAgAS0AACIAQQlGDQAgAEEgRg0AQQEhAgJAIAMtACxBBWsOBAYEBQANCyADIAMvATJBCHI7ATIMDAsgAy0ALkEBcUUNASADLQAsQQhHDQAgA0EAOgAsC0E9IQIMMgsgA0EANgIcIAMgATYCFCADQcIWNgIQIANBCjYCDEEAIQIMSgtBAiECDAELQQQhAgsgA0EBOgAsIAMgAy8BMiACcjsBMgwGCyABIARGBEBBMCECDEcLIAEtAABBCkYEQCABQQFqIQEMAQsgAy0ALkEBcQ0AIANBADYCHCADIAE2AhQgA0HcKDYCECADQQI2AgxBACECDEYLQTAhAgwsCyABQQFqIQFBMSECDCsLIAEgBEYEQEEvIQIMRAsgAS0AACIAQQlHIABBIEdxRQRAIAFBAWohASADLQAuQQFxDQEgA0EANgIcIAMgATYCFCADQZcQNgIQIANBCjYCDEEAIQIMRAtBASECAkACQAJAAkACQAJAIAMtACxBAmsOBwUEBAMBAgAECyADIAMvATJBCHI7ATIMAwtBAiECDAELQQQhAgsgA0EBOgAsIAMgAy8BMiACcjsBMgtBLyECDCsLIANBADYCHCADIAE2AhQgA0GEEzYCECADQQs2AgxBACECDEMLQeEBIQIMKQsgASAERgRAQS4hAgxCCyADQQA2AgQgA0ESNgIIIAMgASABEDEiAA0BC0EuIQIMJwsgA0EtNgIcIAMgATYCFCADIAA2AgxBACECDD8LQQAhAAJAIAMoAjgiAkUNACACKAJMIgJFDQAgAyACEQAAIQALIABFDQAgAEEVRw0BIANB2AA2AhwgAyABNgIUIANBsxs2AhAgA0EVNgIMQQAhAgw+C0HMACECDCQLIANBADYCHCADIAE2AhQgA0GzDjYCECADQR02AgxBACECDDwLIAEgBEYEQEHOACECDDwLIAEtAAAiAEEgRg0CIABBOkYNAQsgA0EAOgAsQQkhAgwhCyADKAIEIQAgA0EANgIEIAMgACABEDAiAA0BDAILIAMtAC5BAXEEQEHeASECDCALIAMoAgQhACADQQA2AgQgAyAAIAEQMCIARQ0CIANBKjYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgw4CyADQcsANgIcIAMgADYCDCADIAFBAWo2AhRBACECDDcLIAFBAWohAUHAACECDB0LIAFBAWohAQwsCyABIARGBEBBKyECDDULAkAgAS0AAEEKRgRAIAFBAWohAQwBCyADLQAuQcAAcUUNBgsgAy0AMkGAAXEEQEEAIQACQCADKAI4IgJFDQAgAigCXCICRQ0AIAMgAhEAACEACyAARQ0SIABBFUYEQCADQQU2AhwgAyABNgIUIANBmxs2AhAgA0EVNgIMQQAhAgw2CyADQQA2AhwgAyABNgIUIANBkA42AhAgA0EUNgIMQQAhAgw1CyADQTJqIQIgAxA1QQAhAAJAIAMoAjgiBkUNACAGKAIoIgZFDQAgAyAGEQAAIQALIAAOFgIBAAQEBAQEBAQEBAQEBAQEBAQEBAMECyADQQE6ADALIAIgAi8BAEHAAHI7AQALQSshAgwYCyADQSk2AhwgAyABNgIUIANBrBk2AhAgA0EVNgIMQQAhAgwwCyADQQA2AhwgAyABNgIUIANB5Qs2AhAgA0ERNgIMQQAhAgwvCyADQQA2AhwgAyABNgIUIANBpQs2AhAgA0ECNgIMQQAhAgwuC0EBIQcgAy8BMiIFQQhxRQRAIAMpAyBCAFIhBwsCQCADLQAwBEBBASEAIAMtAClBBUYNASAFQcAAcUUgB3FFDQELAkAgAy0AKCICQQJGBEBBASEAIAMvATQiBkHlAEYNAkEAIQAgBUHAAHENAiAGQeQARg0CIAZB5gBrQQJJDQIgBkHMAUYNAiAGQbACRg0CDAELQQAhACAFQcAAcQ0BC0ECIQAgBUEIcQ0AIAVBgARxBEACQCACQQFHDQAgAy0ALkEKcQ0AQQUhAAwCC0EEIQAMAQsgBUEgcUUEQCADEDZBAEdBAnQhAAwBC0EAQQMgAykDIFAbIQALIABBAWsOBQIABwEDBAtBESECDBMLIANBAToAMQwpC0EAIQICQCADKAI4IgBFDQAgACgCMCIARQ0AIAMgABEAACECCyACRQ0mIAJBFUYEQCADQQM2AhwgAyABNgIUIANB0hs2AhAgA0EVNgIMQQAhAgwrC0EAIQIgA0EANgIcIAMgATYCFCADQd0ONgIQIANBEjYCDAwqCyADQQA2AhwgAyABNgIUIANB+SA2AhAgA0EPNgIMQQAhAgwpC0EAIQACQCADKAI4IgJFDQAgAigCMCICRQ0AIAMgAhEAACEACyAADQELQQ4hAgwOCyAAQRVGBEAgA0ECNgIcIAMgATYCFCADQdIbNgIQIANBFTYCDEEAIQIMJwsgA0EANgIcIAMgATYCFCADQd0ONgIQIANBEjYCDEEAIQIMJgtBKiECDAwLIAEgBEcEQCADQQk2AgggAyABNgIEQSkhAgwMC0EmIQIMJAsgAyADKQMgIgwgBCABa60iCn0iC0IAIAsgDFgbNwMgIAogDFQEQEElIQIMJAsgAygCBCEAIANBADYCBCADIAAgASAMp2oiARAyIgBFDQAgA0EFNgIcIAMgATYCFCADIAA2AgxBACECDCMLQQ8hAgwJC0IAIQoCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAS0AAEEwaw43FxYAAQIDBAUGBxQUFBQUFBQICQoLDA0UFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFA4PEBESExQLQgIhCgwWC0IDIQoMFQtCBCEKDBQLQgUhCgwTC0IGIQoMEgtCByEKDBELQgghCgwQC0IJIQoMDwtCCiEKDA4LQgshCgwNC0IMIQoMDAtCDSEKDAsLQg4hCgwKC0IPIQoMCQtCCiEKDAgLQgshCgwHC0IMIQoMBgtCDSEKDAULQg4hCgwEC0IPIQoMAwsgA0EANgIcIAMgATYCFCADQZ8VNgIQIANBDDYCDEEAIQIMIQsgASAERgRAQSIhAgwhC0IAIQoCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAEtAABBMGsONxUUAAECAwQFBgcWFhYWFhYWCAkKCwwNFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYODxAREhMWC0ICIQoMFAtCAyEKDBMLQgQhCgwSC0IFIQoMEQtCBiEKDBALQgchCgwPC0IIIQoMDgtCCSEKDA0LQgohCgwMC0ILIQoMCwtCDCEKDAoLQg0hCgwJC0IOIQoMCAtCDyEKDAcLQgohCgwGC0ILIQoMBQtCDCEKDAQLQg0hCgwDC0IOIQoMAgtCDyEKDAELQgEhCgsgAUEBaiEBIAMpAyAiC0L//////////w9YBEAgAyALQgSGIAqENwMgDAILIANBADYCHCADIAE2AhQgA0G1CTYCECADQQw2AgxBACECDB4LQSchAgwEC0EoIQIMAwsgAyABOgAsIANBADYCACAHQQFqIQFBDCECDAILIANBADYCACAGQQFqIQFBCiECDAELIAFBAWohAUEIIQIMAAsAC0EAIQIgA0EANgIcIAMgATYCFCADQbI4NgIQIANBCDYCDAwXC0EAIQIgA0EANgIcIAMgATYCFCADQYMRNgIQIANBCTYCDAwWC0EAIQIgA0EANgIcIAMgATYCFCADQd8KNgIQIANBCTYCDAwVC0EAIQIgA0EANgIcIAMgATYCFCADQe0QNgIQIANBCTYCDAwUC0EAIQIgA0EANgIcIAMgATYCFCADQdIRNgIQIANBCTYCDAwTC0EAIQIgA0EANgIcIAMgATYCFCADQbI4NgIQIANBCDYCDAwSC0EAIQIgA0EANgIcIAMgATYCFCADQYMRNgIQIANBCTYCDAwRC0EAIQIgA0EANgIcIAMgATYCFCADQd8KNgIQIANBCTYCDAwQC0EAIQIgA0EANgIcIAMgATYCFCADQe0QNgIQIANBCTYCDAwPC0EAIQIgA0EANgIcIAMgATYCFCADQdIRNgIQIANBCTYCDAwOC0EAIQIgA0EANgIcIAMgATYCFCADQbkXNgIQIANBDzYCDAwNC0EAIQIgA0EANgIcIAMgATYCFCADQbkXNgIQIANBDzYCDAwMC0EAIQIgA0EANgIcIAMgATYCFCADQZkTNgIQIANBCzYCDAwLC0EAIQIgA0EANgIcIAMgATYCFCADQZ0JNgIQIANBCzYCDAwKC0EAIQIgA0EANgIcIAMgATYCFCADQZcQNgIQIANBCjYCDAwJC0EAIQIgA0EANgIcIAMgATYCFCADQbEQNgIQIANBCjYCDAwIC0EAIQIgA0EANgIcIAMgATYCFCADQbsdNgIQIANBAjYCDAwHC0EAIQIgA0EANgIcIAMgATYCFCADQZYWNgIQIANBAjYCDAwGC0EAIQIgA0EANgIcIAMgATYCFCADQfkYNgIQIANBAjYCDAwFC0EAIQIgA0EANgIcIAMgATYCFCADQcQYNgIQIANBAjYCDAwECyADQQI2AhwgAyABNgIUIANBqR42AhAgA0EWNgIMQQAhAgwDC0HeACECIAEgBEYNAiAJQQhqIQcgAygCACEFAkACQCABIARHBEAgBUGWyABqIQggBCAFaiABayEGIAVBf3NBCmoiBSABaiEAA0AgAS0AACAILQAARwRAQQIhCAwDCyAFRQRAQQAhCCAAIQEMAwsgBUEBayEFIAhBAWohCCAEIAFBAWoiAUcNAAsgBiEFIAQhAQsgB0EBNgIAIAMgBTYCAAwBCyADQQA2AgAgByAINgIACyAHIAE2AgQgCSgCDCEAAkACQCAJKAIIQQFrDgIEAQALIANBADYCHCADQcIeNgIQIANBFzYCDCADIABBAWo2AhRBACECDAMLIANBADYCHCADIAA2AhQgA0HXHjYCECADQQk2AgxBACECDAILIAEgBEYEQEEoIQIMAgsgA0EJNgIIIAMgATYCBEEnIQIMAQsgASAERgRAQQEhAgwBCwNAAkACQAJAIAEtAABBCmsOBAABAQABCyABQQFqIQEMAQsgAUEBaiEBIAMtAC5BIHENAEEAIQIgA0EANgIcIAMgATYCFCADQaEhNgIQIANBBTYCDAwCC0EBIQIgASAERw0ACwsgCUEQaiQAIAJFBEAgAygCDCEADAELIAMgAjYCHEEAIQAgAygCBCIBRQ0AIAMgASAEIAMoAggRAQAiAUUNACADIAQ2AhQgAyABNgIMIAEhAAsgAAu+AgECfyAAQQA6AAAgAEHkAGoiAUEBa0EAOgAAIABBADoAAiAAQQA6AAEgAUEDa0EAOgAAIAFBAmtBADoAACAAQQA6AAMgAUEEa0EAOgAAQQAgAGtBA3EiASAAaiIAQQA2AgBB5AAgAWtBfHEiAiAAaiIBQQRrQQA2AgACQCACQQlJDQAgAEEANgIIIABBADYCBCABQQhrQQA2AgAgAUEMa0EANgIAIAJBGUkNACAAQQA2AhggAEEANgIUIABBADYCECAAQQA2AgwgAUEQa0EANgIAIAFBFGtBADYCACABQRhrQQA2AgAgAUEca0EANgIAIAIgAEEEcUEYciICayIBQSBJDQAgACACaiEAA0AgAEIANwMYIABCADcDECAAQgA3AwggAEIANwMAIABBIGohACABQSBrIgFBH0sNAAsLC1YBAX8CQCAAKAIMDQACQAJAAkACQCAALQAxDgMBAAMCCyAAKAI4IgFFDQAgASgCMCIBRQ0AIAAgAREAACIBDQMLQQAPCwALIABByhk2AhBBDiEBCyABCxoAIAAoAgxFBEAgAEHeHzYCECAAQRU2AgwLCxQAIAAoAgxBFUYEQCAAQQA2AgwLCxQAIAAoAgxBFkYEQCAAQQA2AgwLCwcAIAAoAgwLBwAgACgCEAsJACAAIAE2AhALBwAgACgCFAsrAAJAIABBJ08NAEL//////wkgAK2IQgGDUA0AIABBAnRB0DhqKAIADwsACxcAIABBL08EQAALIABBAnRB7DlqKAIAC78JAQF/QfQtIQECQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAAQeQAaw70A2NiAAFhYWFhYWECAwQFYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYQYHCAkKCwwNDg9hYWFhYRBhYWFhYWFhYWFhYRFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWESExQVFhcYGRobYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYRwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1NmE3ODk6YWFhYWFhYWE7YWFhPGFhYWE9Pj9hYWFhYWFhYUBhYUFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFCQ0RFRkdISUpLTE1OT1BRUlNhYWFhYWFhYVRVVldYWVpbYVxdYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhXmFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYV9gYQtB6iwPC0GYJg8LQe0xDwtBoDcPC0HJKQ8LQbQpDwtBli0PC0HrKw8LQaI1DwtB2zQPC0HgKQ8LQeMkDwtB1SQPC0HuJA8LQeYlDwtByjQPC0HQNw8LQao1DwtB9SwPC0H2Jg8LQYIiDwtB8jMPC0G+KA8LQec3DwtBzSEPC0HAIQ8LQbglDwtByyUPC0GWJA8LQY80DwtBzTUPC0HdKg8LQe4zDwtBnDQPC0GeMQ8LQfQ1DwtB5SIPC0GvJQ8LQZkxDwtBsjYPC0H5Ng8LQcQyDwtB3SwPC0GCMQ8LQcExDwtBjTcPC0HJJA8LQew2DwtB5yoPC0HIIw8LQeIhDwtByTcPC0GlIg8LQZQiDwtB2zYPC0HeNQ8LQYYmDwtBvCsPC0GLMg8LQaAjDwtB9jAPC0GALA8LQYkrDwtBpCYPC0HyIw8LQYEoDwtBqzIPC0HrJw8LQcI2DwtBoiQPC0HPKg8LQdwjDwtBhycPC0HkNA8LQbciDwtBrTEPC0HVIg8LQa80DwtB3iYPC0HWMg8LQfQ0DwtBgTgPC0H0Nw8LQZI2DwtBnScPC0GCKQ8LQY0jDwtB1zEPC0G9NQ8LQbQ3DwtB2DAPC0G2Jw8LQZo4DwtBpyoPC0HEJw8LQa4jDwtB9SIPCwALQcomIQELIAELFwAgACAALwEuQf7/A3EgAUEAR3I7AS4LGgAgACAALwEuQf3/A3EgAUEAR0EBdHI7AS4LGgAgACAALwEuQfv/A3EgAUEAR0ECdHI7AS4LGgAgACAALwEuQff/A3EgAUEAR0EDdHI7AS4LGgAgACAALwEuQe//A3EgAUEAR0EEdHI7AS4LGgAgACAALwEuQd//A3EgAUEAR0EFdHI7AS4LGgAgACAALwEuQb//A3EgAUEAR0EGdHI7AS4LGgAgACAALwEuQf/+A3EgAUEAR0EHdHI7AS4LGgAgACAALwEuQf/9A3EgAUEAR0EIdHI7AS4LGgAgACAALwEuQf/7A3EgAUEAR0EJdHI7AS4LPgECfwJAIAAoAjgiA0UNACADKAIEIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEHhEjYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIIIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEH8ETYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIMIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEHsCjYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIQIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEH6HjYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIUIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEHLEDYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIYIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEG3HzYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIcIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEG/FTYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIsIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEH+CDYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIgIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEGMHTYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIkIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEHmFTYCEEEYIQQLIAQLOAAgAAJ/IAAvATJBFHFBFEYEQEEBIAAtAChBAUYNARogAC8BNEHlAEYMAQsgAC0AKUEFRgs6ADALWQECfwJAIAAtAChBAUYNACAALwE0IgFB5ABrQeQASQ0AIAFBzAFGDQAgAUGwAkYNACAALwEyIgBBwABxDQBBASECIABBiARxQYAERg0AIABBKHFFIQILIAILjAEBAn8CQAJAAkAgAC0AKkUNACAALQArRQ0AIAAvATIiAUECcUUNAQwCCyAALwEyIgFBAXFFDQELQQEhAiAALQAoQQFGDQAgAC8BNCIAQeQAa0HkAEkNACAAQcwBRg0AIABBsAJGDQAgAUHAAHENAEEAIQIgAUGIBHFBgARGDQAgAUEocUEARyECCyACC1cAIABBGGpCADcDACAAQgA3AwAgAEE4akIANwMAIABBMGpCADcDACAAQShqQgA3AwAgAEEgakIANwMAIABBEGpCADcDACAAQQhqQgA3AwAgAEH9ATYCHAsGACAAEDoLmi0BC38jAEEQayIKJABB3NUAKAIAIglFBEBBnNkAKAIAIgVFBEBBqNkAQn83AgBBoNkAQoCAhICAgMAANwIAQZzZACAKQQhqQXBxQdiq1aoFcyIFNgIAQbDZAEEANgIAQYDZAEEANgIAC0GE2QBBwNkENgIAQdTVAEHA2QQ2AgBB6NUAIAU2AgBB5NUAQX82AgBBiNkAQcCmAzYCAANAIAFBgNYAaiABQfTVAGoiAjYCACACIAFB7NUAaiIDNgIAIAFB+NUAaiADNgIAIAFBiNYAaiABQfzVAGoiAzYCACADIAI2AgAgAUGQ1gBqIAFBhNYAaiICNgIAIAIgAzYCACABQYzWAGogAjYCACABQSBqIgFBgAJHDQALQczZBEGBpgM2AgBB4NUAQazZACgCADYCAEHQ1QBBgKYDNgIAQdzVAEHI2QQ2AgBBzP8HQTg2AgBByNkEIQkLAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAEHsAU0EQEHE1QAoAgAiBkEQIABBE2pBcHEgAEELSRsiBEEDdiIAdiIBQQNxBEACQCABQQFxIAByQQFzIgJBA3QiAEHs1QBqIgEgAEH01QBqKAIAIgAoAggiA0YEQEHE1QAgBkF+IAJ3cTYCAAwBCyABIAM2AgggAyABNgIMCyAAQQhqIQEgACACQQN0IgJBA3I2AgQgACACaiIAIAAoAgRBAXI2AgQMEQtBzNUAKAIAIgggBE8NASABBEACQEECIAB0IgJBACACa3IgASAAdHFoIgBBA3QiAkHs1QBqIgEgAkH01QBqKAIAIgIoAggiA0YEQEHE1QAgBkF+IAB3cSIGNgIADAELIAEgAzYCCCADIAE2AgwLIAIgBEEDcjYCBCAAQQN0IgAgBGshBSAAIAJqIAU2AgAgAiAEaiIEIAVBAXI2AgQgCARAIAhBeHFB7NUAaiEAQdjVACgCACEDAn9BASAIQQN2dCIBIAZxRQRAQcTVACABIAZyNgIAIAAMAQsgACgCCAsiASADNgIMIAAgAzYCCCADIAA2AgwgAyABNgIICyACQQhqIQFB2NUAIAQ2AgBBzNUAIAU2AgAMEQtByNUAKAIAIgtFDQEgC2hBAnRB9NcAaigCACIAKAIEQXhxIARrIQUgACECA0ACQCACKAIQIgFFBEAgAkEUaigCACIBRQ0BCyABKAIEQXhxIARrIgMgBUkhAiADIAUgAhshBSABIAAgAhshACABIQIMAQsLIAAoAhghCSAAKAIMIgMgAEcEQEHU1QAoAgAaIAMgACgCCCIBNgIIIAEgAzYCDAwQCyAAQRRqIgIoAgAiAUUEQCAAKAIQIgFFDQMgAEEQaiECCwNAIAIhByABIgNBFGoiAigCACIBDQAgA0EQaiECIAMoAhAiAQ0ACyAHQQA2AgAMDwtBfyEEIABBv39LDQAgAEETaiIBQXBxIQRByNUAKAIAIghFDQBBACAEayEFAkACQAJAAn9BACAEQYACSQ0AGkEfIARB////B0sNABogBEEmIAFBCHZnIgBrdkEBcSAAQQF0a0E+agsiBkECdEH01wBqKAIAIgJFBEBBACEBQQAhAwwBC0EAIQEgBEEZIAZBAXZrQQAgBkEfRxt0IQBBACEDA0ACQCACKAIEQXhxIARrIgcgBU8NACACIQMgByIFDQBBACEFIAIhAQwDCyABIAJBFGooAgAiByAHIAIgAEEddkEEcWpBEGooAgAiAkYbIAEgBxshASAAQQF0IQAgAg0ACwsgASADckUEQEEAIQNBAiAGdCIAQQAgAGtyIAhxIgBFDQMgAGhBAnRB9NcAaigCACEBCyABRQ0BCwNAIAEoAgRBeHEgBGsiAiAFSSEAIAIgBSAAGyEFIAEgAyAAGyEDIAEoAhAiAAR/IAAFIAFBFGooAgALIgENAAsLIANFDQAgBUHM1QAoAgAgBGtPDQAgAygCGCEHIAMgAygCDCIARwRAQdTVACgCABogACADKAIIIgE2AgggASAANgIMDA4LIANBFGoiAigCACIBRQRAIAMoAhAiAUUNAyADQRBqIQILA0AgAiEGIAEiAEEUaiICKAIAIgENACAAQRBqIQIgACgCECIBDQALIAZBADYCAAwNC0HM1QAoAgAiAyAETwRAQdjVACgCACEBAkAgAyAEayICQRBPBEAgASAEaiIAIAJBAXI2AgQgASADaiACNgIAIAEgBEEDcjYCBAwBCyABIANBA3I2AgQgASADaiIAIAAoAgRBAXI2AgRBACEAQQAhAgtBzNUAIAI2AgBB2NUAIAA2AgAgAUEIaiEBDA8LQdDVACgCACIDIARLBEAgBCAJaiIAIAMgBGsiAUEBcjYCBEHc1QAgADYCAEHQ1QAgATYCACAJIARBA3I2AgQgCUEIaiEBDA8LQQAhASAEAn9BnNkAKAIABEBBpNkAKAIADAELQajZAEJ/NwIAQaDZAEKAgISAgIDAADcCAEGc2QAgCkEMakFwcUHYqtWqBXM2AgBBsNkAQQA2AgBBgNkAQQA2AgBBgIAECyIAIARBxwBqIgVqIgZBACAAayIHcSICTwRAQbTZAEEwNgIADA8LAkBB/NgAKAIAIgFFDQBB9NgAKAIAIgggAmohACAAIAFNIAAgCEtxDQBBACEBQbTZAEEwNgIADA8LQYDZAC0AAEEEcQ0EAkACQCAJBEBBhNkAIQEDQCABKAIAIgAgCU0EQCAAIAEoAgRqIAlLDQMLIAEoAggiAQ0ACwtBABA7IgBBf0YNBSACIQZBoNkAKAIAIgFBAWsiAyAAcQRAIAIgAGsgACADakEAIAFrcWohBgsgBCAGTw0FIAZB/v///wdLDQVB/NgAKAIAIgMEQEH02AAoAgAiByAGaiEBIAEgB00NBiABIANLDQYLIAYQOyIBIABHDQEMBwsgBiADayAHcSIGQf7///8HSw0EIAYQOyEAIAAgASgCACABKAIEakYNAyAAIQELAkAgBiAEQcgAak8NACABQX9GDQBBpNkAKAIAIgAgBSAGa2pBACAAa3EiAEH+////B0sEQCABIQAMBwsgABA7QX9HBEAgACAGaiEGIAEhAAwHC0EAIAZrEDsaDAQLIAEiAEF/Rw0FDAMLQQAhAwwMC0EAIQAMCgsgAEF/Rw0CC0GA2QBBgNkAKAIAQQRyNgIACyACQf7///8HSw0BIAIQOyEAQQAQOyEBIABBf0YNASABQX9GDQEgACABTw0BIAEgAGsiBiAEQThqTQ0BC0H02ABB9NgAKAIAIAZqIgE2AgBB+NgAKAIAIAFJBEBB+NgAIAE2AgALAkACQAJAQdzVACgCACICBEBBhNkAIQEDQCAAIAEoAgAiAyABKAIEIgVqRg0CIAEoAggiAQ0ACwwCC0HU1QAoAgAiAUEARyAAIAFPcUUEQEHU1QAgADYCAAtBACEBQYjZACAGNgIAQYTZACAANgIAQeTVAEF/NgIAQejVAEGc2QAoAgA2AgBBkNkAQQA2AgADQCABQYDWAGogAUH01QBqIgI2AgAgAiABQezVAGoiAzYCACABQfjVAGogAzYCACABQYjWAGogAUH81QBqIgM2AgAgAyACNgIAIAFBkNYAaiABQYTWAGoiAjYCACACIAM2AgAgAUGM1gBqIAI2AgAgAUEgaiIBQYACRw0AC0F4IABrQQ9xIgEgAGoiAiAGQThrIgMgAWsiAUEBcjYCBEHg1QBBrNkAKAIANgIAQdDVACABNgIAQdzVACACNgIAIAAgA2pBODYCBAwCCyAAIAJNDQAgAiADSQ0AIAEoAgxBCHENAEF4IAJrQQ9xIgAgAmoiA0HQ1QAoAgAgBmoiByAAayIAQQFyNgIEIAEgBSAGajYCBEHg1QBBrNkAKAIANgIAQdDVACAANgIAQdzVACADNgIAIAIgB2pBODYCBAwBCyAAQdTVACgCAEkEQEHU1QAgADYCAAsgACAGaiEDQYTZACEBAkACQAJAA0AgAyABKAIARwRAIAEoAggiAQ0BDAILCyABLQAMQQhxRQ0BC0GE2QAhAQNAIAEoAgAiAyACTQRAIAMgASgCBGoiBSACSw0DCyABKAIIIQEMAAsACyABIAA2AgAgASABKAIEIAZqNgIEIABBeCAAa0EPcWoiCSAEQQNyNgIEIANBeCADa0EPcWoiBiAEIAlqIgRrIQEgAiAGRgRAQdzVACAENgIAQdDVAEHQ1QAoAgAgAWoiADYCACAEIABBAXI2AgQMCAtB2NUAKAIAIAZGBEBB2NUAIAQ2AgBBzNUAQczVACgCACABaiIANgIAIAQgAEEBcjYCBCAAIARqIAA2AgAMCAsgBigCBCIFQQNxQQFHDQYgBUF4cSEIIAVB/wFNBEAgBUEDdiEDIAYoAggiACAGKAIMIgJGBEBBxNUAQcTVACgCAEF+IAN3cTYCAAwHCyACIAA2AgggACACNgIMDAYLIAYoAhghByAGIAYoAgwiAEcEQCAAIAYoAggiAjYCCCACIAA2AgwMBQsgBkEUaiICKAIAIgVFBEAgBigCECIFRQ0EIAZBEGohAgsDQCACIQMgBSIAQRRqIgIoAgAiBQ0AIABBEGohAiAAKAIQIgUNAAsgA0EANgIADAQLQXggAGtBD3EiASAAaiIHIAZBOGsiAyABayIBQQFyNgIEIAAgA2pBODYCBCACIAVBNyAFa0EPcWpBP2siAyADIAJBEGpJGyIDQSM2AgRB4NUAQazZACgCADYCAEHQ1QAgATYCAEHc1QAgBzYCACADQRBqQYzZACkCADcCACADQYTZACkCADcCCEGM2QAgA0EIajYCAEGI2QAgBjYCAEGE2QAgADYCAEGQ2QBBADYCACADQSRqIQEDQCABQQc2AgAgBSABQQRqIgFLDQALIAIgA0YNACADIAMoAgRBfnE2AgQgAyADIAJrIgU2AgAgAiAFQQFyNgIEIAVB/wFNBEAgBUF4cUHs1QBqIQACf0HE1QAoAgAiAUEBIAVBA3Z0IgNxRQRAQcTVACABIANyNgIAIAAMAQsgACgCCAsiASACNgIMIAAgAjYCCCACIAA2AgwgAiABNgIIDAELQR8hASAFQf///wdNBEAgBUEmIAVBCHZnIgBrdkEBcSAAQQF0a0E+aiEBCyACIAE2AhwgAkIANwIQIAFBAnRB9NcAaiEAQcjVACgCACIDQQEgAXQiBnFFBEAgACACNgIAQcjVACADIAZyNgIAIAIgADYCGCACIAI2AgggAiACNgIMDAELIAVBGSABQQF2a0EAIAFBH0cbdCEBIAAoAgAhAwJAA0AgAyIAKAIEQXhxIAVGDQEgAUEddiEDIAFBAXQhASAAIANBBHFqQRBqIgYoAgAiAw0ACyAGIAI2AgAgAiAANgIYIAIgAjYCDCACIAI2AggMAQsgACgCCCIBIAI2AgwgACACNgIIIAJBADYCGCACIAA2AgwgAiABNgIIC0HQ1QAoAgAiASAETQ0AQdzVACgCACIAIARqIgIgASAEayIBQQFyNgIEQdDVACABNgIAQdzVACACNgIAIAAgBEEDcjYCBCAAQQhqIQEMCAtBACEBQbTZAEEwNgIADAcLQQAhAAsgB0UNAAJAIAYoAhwiAkECdEH01wBqIgMoAgAgBkYEQCADIAA2AgAgAA0BQcjVAEHI1QAoAgBBfiACd3E2AgAMAgsgB0EQQRQgBygCECAGRhtqIAA2AgAgAEUNAQsgACAHNgIYIAYoAhAiAgRAIAAgAjYCECACIAA2AhgLIAZBFGooAgAiAkUNACAAQRRqIAI2AgAgAiAANgIYCyABIAhqIQEgBiAIaiIGKAIEIQULIAYgBUF+cTYCBCABIARqIAE2AgAgBCABQQFyNgIEIAFB/wFNBEAgAUF4cUHs1QBqIQACf0HE1QAoAgAiAkEBIAFBA3Z0IgFxRQRAQcTVACABIAJyNgIAIAAMAQsgACgCCAsiASAENgIMIAAgBDYCCCAEIAA2AgwgBCABNgIIDAELQR8hBSABQf///wdNBEAgAUEmIAFBCHZnIgBrdkEBcSAAQQF0a0E+aiEFCyAEIAU2AhwgBEIANwIQIAVBAnRB9NcAaiEAQcjVACgCACICQQEgBXQiA3FFBEAgACAENgIAQcjVACACIANyNgIAIAQgADYCGCAEIAQ2AgggBCAENgIMDAELIAFBGSAFQQF2a0EAIAVBH0cbdCEFIAAoAgAhAAJAA0AgACICKAIEQXhxIAFGDQEgBUEddiEAIAVBAXQhBSACIABBBHFqQRBqIgMoAgAiAA0ACyADIAQ2AgAgBCACNgIYIAQgBDYCDCAEIAQ2AggMAQsgAigCCCIAIAQ2AgwgAiAENgIIIARBADYCGCAEIAI2AgwgBCAANgIICyAJQQhqIQEMAgsCQCAHRQ0AAkAgAygCHCIBQQJ0QfTXAGoiAigCACADRgRAIAIgADYCACAADQFByNUAIAhBfiABd3EiCDYCAAwCCyAHQRBBFCAHKAIQIANGG2ogADYCACAARQ0BCyAAIAc2AhggAygCECIBBEAgACABNgIQIAEgADYCGAsgA0EUaigCACIBRQ0AIABBFGogATYCACABIAA2AhgLAkAgBUEPTQRAIAMgBCAFaiIAQQNyNgIEIAAgA2oiACAAKAIEQQFyNgIEDAELIAMgBGoiAiAFQQFyNgIEIAMgBEEDcjYCBCACIAVqIAU2AgAgBUH/AU0EQCAFQXhxQezVAGohAAJ/QcTVACgCACIBQQEgBUEDdnQiBXFFBEBBxNUAIAEgBXI2AgAgAAwBCyAAKAIICyIBIAI2AgwgACACNgIIIAIgADYCDCACIAE2AggMAQtBHyEBIAVB////B00EQCAFQSYgBUEIdmciAGt2QQFxIABBAXRrQT5qIQELIAIgATYCHCACQgA3AhAgAUECdEH01wBqIQBBASABdCIEIAhxRQRAIAAgAjYCAEHI1QAgBCAIcjYCACACIAA2AhggAiACNgIIIAIgAjYCDAwBCyAFQRkgAUEBdmtBACABQR9HG3QhASAAKAIAIQQCQANAIAQiACgCBEF4cSAFRg0BIAFBHXYhBCABQQF0IQEgACAEQQRxakEQaiIGKAIAIgQNAAsgBiACNgIAIAIgADYCGCACIAI2AgwgAiACNgIIDAELIAAoAggiASACNgIMIAAgAjYCCCACQQA2AhggAiAANgIMIAIgATYCCAsgA0EIaiEBDAELAkAgCUUNAAJAIAAoAhwiAUECdEH01wBqIgIoAgAgAEYEQCACIAM2AgAgAw0BQcjVACALQX4gAXdxNgIADAILIAlBEEEUIAkoAhAgAEYbaiADNgIAIANFDQELIAMgCTYCGCAAKAIQIgEEQCADIAE2AhAgASADNgIYCyAAQRRqKAIAIgFFDQAgA0EUaiABNgIAIAEgAzYCGAsCQCAFQQ9NBEAgACAEIAVqIgFBA3I2AgQgACABaiIBIAEoAgRBAXI2AgQMAQsgACAEaiIHIAVBAXI2AgQgACAEQQNyNgIEIAUgB2ogBTYCACAIBEAgCEF4cUHs1QBqIQFB2NUAKAIAIQMCf0EBIAhBA3Z0IgIgBnFFBEBBxNUAIAIgBnI2AgAgAQwBCyABKAIICyICIAM2AgwgASADNgIIIAMgATYCDCADIAI2AggLQdjVACAHNgIAQczVACAFNgIACyAAQQhqIQELIApBEGokACABC0MAIABFBEA/AEEQdA8LAkAgAEH//wNxDQAgAEEASA0AIABBEHZAACIAQX9GBEBBtNkAQTA2AgBBfw8LIABBEHQPCwALC5lCIgBBgAgLDQEAAAAAAAAAAgAAAAMAQZgICwUEAAAABQBBqAgLCQYAAAAHAAAACABB5AgLwjJJbnZhbGlkIGNoYXIgaW4gdXJsIHF1ZXJ5AFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fYm9keQBDb250ZW50LUxlbmd0aCBvdmVyZmxvdwBDaHVuayBzaXplIG92ZXJmbG93AEludmFsaWQgbWV0aG9kIGZvciBIVFRQL3gueCByZXF1ZXN0AEludmFsaWQgbWV0aG9kIGZvciBSVFNQL3gueCByZXF1ZXN0AEV4cGVjdGVkIFNPVVJDRSBtZXRob2QgZm9yIElDRS94LnggcmVxdWVzdABJbnZhbGlkIGNoYXIgaW4gdXJsIGZyYWdtZW50IHN0YXJ0AEV4cGVjdGVkIGRvdABTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3N0YXR1cwBJbnZhbGlkIHJlc3BvbnNlIHN0YXR1cwBFeHBlY3RlZCBMRiBhZnRlciBoZWFkZXJzAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMAVXNlciBjYWxsYmFjayBlcnJvcgBgb25fcmVzZXRgIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19oZWFkZXJgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXNzYWdlX2JlZ2luYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfZXh0ZW5zaW9uX3ZhbHVlYCBjYWxsYmFjayBlcnJvcgBgb25fc3RhdHVzX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fdmVyc2lvbl9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3VybF9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3Byb3RvY29sX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9oZWFkZXJfdmFsdWVfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXNzYWdlX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fbWV0aG9kX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25faGVhZGVyX2ZpZWxkX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfZXh0ZW5zaW9uX25hbWVgIGNhbGxiYWNrIGVycm9yAFVuZXhwZWN0ZWQgY2hhciBpbiB1cmwgc2VydmVyAEludmFsaWQgaGVhZGVyIHZhbHVlIGNoYXIASW52YWxpZCBoZWFkZXIgZmllbGQgY2hhcgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3ZlcnNpb24ASW52YWxpZCBtaW5vciB2ZXJzaW9uAEludmFsaWQgbWFqb3IgdmVyc2lvbgBFeHBlY3RlZCBzcGFjZSBhZnRlciB2ZXJzaW9uAEV4cGVjdGVkIENSTEYgYWZ0ZXIgdmVyc2lvbgBJbnZhbGlkIEhUVFAgdmVyc2lvbgBJbnZhbGlkIGhlYWRlciB0b2tlbgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3VybABJbnZhbGlkIGNoYXJhY3RlcnMgaW4gdXJsAFVuZXhwZWN0ZWQgc3RhcnQgY2hhciBpbiB1cmwARG91YmxlIEAgaW4gdXJsAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fcHJvdG9jb2wARW1wdHkgQ29udGVudC1MZW5ndGgASW52YWxpZCBjaGFyYWN0ZXIgaW4gQ29udGVudC1MZW5ndGgAVHJhbnNmZXItRW5jb2RpbmcgY2FuJ3QgYmUgcHJlc2VudCB3aXRoIENvbnRlbnQtTGVuZ3RoAER1cGxpY2F0ZSBDb250ZW50LUxlbmd0aABJbnZhbGlkIGNoYXIgaW4gdXJsIHBhdGgAQ29udGVudC1MZW5ndGggY2FuJ3QgYmUgcHJlc2VudCB3aXRoIFRyYW5zZmVyLUVuY29kaW5nAE1pc3NpbmcgZXhwZWN0ZWQgQ1IgYWZ0ZXIgY2h1bmsgc2l6ZQBFeHBlY3RlZCBMRiBhZnRlciBjaHVuayBzaXplAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIHNpemUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfdmFsdWUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9jaHVua19leHRlbnNpb25fdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyB2YWx1ZQBVbmV4cGVjdGVkIHdoaXRlc3BhY2UgYWZ0ZXIgaGVhZGVyIHZhbHVlAE1pc3NpbmcgZXhwZWN0ZWQgQ1IgYWZ0ZXIgaGVhZGVyIHZhbHVlAE1pc3NpbmcgZXhwZWN0ZWQgTEYgYWZ0ZXIgaGVhZGVyIHZhbHVlAEludmFsaWQgYFRyYW5zZmVyLUVuY29kaW5nYCBoZWFkZXIgdmFsdWUATWlzc2luZyBleHBlY3RlZCBDUiBhZnRlciBjaHVuayBleHRlbnNpb24gdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBxdW90ZSB2YWx1ZQBJbnZhbGlkIHF1b3RlZC1wYWlyIGluIGNodW5rIGV4dGVuc2lvbnMgcXVvdGVkIHZhbHVlAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgcXVvdGVkIHZhbHVlAFBhdXNlZCBieSBvbl9oZWFkZXJzX2NvbXBsZXRlAEludmFsaWQgRU9GIHN0YXRlAG9uX3Jlc2V0IHBhdXNlAG9uX2NodW5rX2hlYWRlciBwYXVzZQBvbl9tZXNzYWdlX2JlZ2luIHBhdXNlAG9uX2NodW5rX2V4dGVuc2lvbl92YWx1ZSBwYXVzZQBvbl9zdGF0dXNfY29tcGxldGUgcGF1c2UAb25fdmVyc2lvbl9jb21wbGV0ZSBwYXVzZQBvbl91cmxfY29tcGxldGUgcGF1c2UAb25fcHJvdG9jb2xfY29tcGxldGUgcGF1c2UAb25fY2h1bmtfY29tcGxldGUgcGF1c2UAb25faGVhZGVyX3ZhbHVlX2NvbXBsZXRlIHBhdXNlAG9uX21lc3NhZ2VfY29tcGxldGUgcGF1c2UAb25fbWV0aG9kX2NvbXBsZXRlIHBhdXNlAG9uX2hlYWRlcl9maWVsZF9jb21wbGV0ZSBwYXVzZQBvbl9jaHVua19leHRlbnNpb25fbmFtZSBwYXVzZQBVbmV4cGVjdGVkIHNwYWNlIGFmdGVyIHN0YXJ0IGxpbmUATWlzc2luZyBleHBlY3RlZCBDUiBhZnRlciByZXNwb25zZSBsaW5lAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fY2h1bmtfZXh0ZW5zaW9uX25hbWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBuYW1lAE1pc3NpbmcgZXhwZWN0ZWQgQ1IgYWZ0ZXIgY2h1bmsgZXh0ZW5zaW9uIG5hbWUASW52YWxpZCBzdGF0dXMgY29kZQBQYXVzZSBvbiBDT05ORUNUL1VwZ3JhZGUAUGF1c2Ugb24gUFJJL1VwZ3JhZGUARXhwZWN0ZWQgSFRUUC8yIENvbm5lY3Rpb24gUHJlZmFjZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX21ldGhvZABFeHBlY3RlZCBzcGFjZSBhZnRlciBtZXRob2QAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfZmllbGQAUGF1c2VkAEludmFsaWQgd29yZCBlbmNvdW50ZXJlZABJbnZhbGlkIG1ldGhvZCBlbmNvdW50ZXJlZABNaXNzaW5nIGV4cGVjdGVkIENSIGFmdGVyIGNodW5rIGRhdGEARXhwZWN0ZWQgTEYgYWZ0ZXIgY2h1bmsgZGF0YQBVbmV4cGVjdGVkIGNoYXIgaW4gdXJsIHNjaGVtYQBSZXF1ZXN0IGhhcyBpbnZhbGlkIGBUcmFuc2Zlci1FbmNvZGluZ2AARGF0YSBhZnRlciBgQ29ubmVjdGlvbjogY2xvc2VgAFNXSVRDSF9QUk9YWQBVU0VfUFJPWFkATUtBQ1RJVklUWQBVTlBST0NFU1NBQkxFX0VOVElUWQBRVUVSWQBDT1BZAE1PVkVEX1BFUk1BTkVOVExZAFRPT19FQVJMWQBOT1RJRlkARkFJTEVEX0RFUEVOREVOQ1kAQkFEX0dBVEVXQVkAUExBWQBQVVQAQ0hFQ0tPVVQAR0FURVdBWV9USU1FT1VUAFJFUVVFU1RfVElNRU9VVABORVRXT1JLX0NPTk5FQ1RfVElNRU9VVABDT05ORUNUSU9OX1RJTUVPVVQATE9HSU5fVElNRU9VVABORVRXT1JLX1JFQURfVElNRU9VVABQT1NUAE1JU0RJUkVDVEVEX1JFUVVFU1QAQ0xJRU5UX0NMT1NFRF9SRVFVRVNUAENMSUVOVF9DTE9TRURfTE9BRF9CQUxBTkNFRF9SRVFVRVNUAEJBRF9SRVFVRVNUAEhUVFBfUkVRVUVTVF9TRU5UX1RPX0hUVFBTX1BPUlQAUkVQT1JUAElNX0FfVEVBUE9UAFJFU0VUX0NPTlRFTlQATk9fQ09OVEVOVABQQVJUSUFMX0NPTlRFTlQASFBFX0lOVkFMSURfQ09OU1RBTlQASFBFX0NCX1JFU0VUAEdFVABIUEVfU1RSSUNUAENPTkZMSUNUAFRFTVBPUkFSWV9SRURJUkVDVABQRVJNQU5FTlRfUkVESVJFQ1QAQ09OTkVDVABNVUxUSV9TVEFUVVMASFBFX0lOVkFMSURfU1RBVFVTAFRPT19NQU5ZX1JFUVVFU1RTAEVBUkxZX0hJTlRTAFVOQVZBSUxBQkxFX0ZPUl9MRUdBTF9SRUFTT05TAE9QVElPTlMAU1dJVENISU5HX1BST1RPQ09MUwBWQVJJQU5UX0FMU09fTkVHT1RJQVRFUwBNVUxUSVBMRV9DSE9JQ0VTAElOVEVSTkFMX1NFUlZFUl9FUlJPUgBXRUJfU0VSVkVSX1VOS05PV05fRVJST1IAUkFJTEdVTl9FUlJPUgBJREVOVElUWV9QUk9WSURFUl9BVVRIRU5USUNBVElPTl9FUlJPUgBTU0xfQ0VSVElGSUNBVEVfRVJST1IASU5WQUxJRF9YX0ZPUldBUkRFRF9GT1IAU0VUX1BBUkFNRVRFUgBHRVRfUEFSQU1FVEVSAEhQRV9VU0VSAFNFRV9PVEhFUgBIUEVfQ0JfQ0hVTktfSEVBREVSAEV4cGVjdGVkIExGIGFmdGVyIENSAE1LQ0FMRU5EQVIAU0VUVVAAV0VCX1NFUlZFUl9JU19ET1dOAFRFQVJET1dOAEhQRV9DTE9TRURfQ09OTkVDVElPTgBIRVVSSVNUSUNfRVhQSVJBVElPTgBESVNDT05ORUNURURfT1BFUkFUSU9OAE5PTl9BVVRIT1JJVEFUSVZFX0lORk9STUFUSU9OAEhQRV9JTlZBTElEX1ZFUlNJT04ASFBFX0NCX01FU1NBR0VfQkVHSU4AU0lURV9JU19GUk9aRU4ASFBFX0lOVkFMSURfSEVBREVSX1RPS0VOAElOVkFMSURfVE9LRU4ARk9SQklEREVOAEVOSEFOQ0VfWU9VUl9DQUxNAEhQRV9JTlZBTElEX1VSTABCTE9DS0VEX0JZX1BBUkVOVEFMX0NPTlRST0wATUtDT0wAQUNMAEhQRV9JTlRFUk5BTABSRVFVRVNUX0hFQURFUl9GSUVMRFNfVE9PX0xBUkdFX1VOT0ZGSUNJQUwASFBFX09LAFVOTElOSwBVTkxPQ0sAUFJJAFJFVFJZX1dJVEgASFBFX0lOVkFMSURfQ09OVEVOVF9MRU5HVEgASFBFX1VORVhQRUNURURfQ09OVEVOVF9MRU5HVEgARkxVU0gAUFJPUFBBVENIAE0tU0VBUkNIAFVSSV9UT09fTE9ORwBQUk9DRVNTSU5HAE1JU0NFTExBTkVPVVNfUEVSU0lTVEVOVF9XQVJOSU5HAE1JU0NFTExBTkVPVVNfV0FSTklORwBIUEVfSU5WQUxJRF9UUkFOU0ZFUl9FTkNPRElORwBFeHBlY3RlZCBDUkxGAEhQRV9JTlZBTElEX0NIVU5LX1NJWkUATU9WRQBDT05USU5VRQBIUEVfQ0JfU1RBVFVTX0NPTVBMRVRFAEhQRV9DQl9IRUFERVJTX0NPTVBMRVRFAEhQRV9DQl9WRVJTSU9OX0NPTVBMRVRFAEhQRV9DQl9VUkxfQ09NUExFVEUASFBFX0NCX1BST1RPQ09MX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19DT01QTEVURQBIUEVfQ0JfSEVBREVSX1ZBTFVFX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19FWFRFTlNJT05fVkFMVUVfQ09NUExFVEUASFBFX0NCX0NIVU5LX0VYVEVOU0lPTl9OQU1FX0NPTVBMRVRFAEhQRV9DQl9NRVNTQUdFX0NPTVBMRVRFAEhQRV9DQl9NRVRIT0RfQ09NUExFVEUASFBFX0NCX0hFQURFUl9GSUVMRF9DT01QTEVURQBERUxFVEUASFBFX0lOVkFMSURfRU9GX1NUQVRFAElOVkFMSURfU1NMX0NFUlRJRklDQVRFAFBBVVNFAE5PX1JFU1BPTlNFAFVOU1VQUE9SVEVEX01FRElBX1RZUEUAR09ORQBOT1RfQUNDRVBUQUJMRQBTRVJWSUNFX1VOQVZBSUxBQkxFAFJBTkdFX05PVF9TQVRJU0ZJQUJMRQBPUklHSU5fSVNfVU5SRUFDSEFCTEUAUkVTUE9OU0VfSVNfU1RBTEUAUFVSR0UATUVSR0UAUkVRVUVTVF9IRUFERVJfRklFTERTX1RPT19MQVJHRQBSRVFVRVNUX0hFQURFUl9UT09fTEFSR0UAUEFZTE9BRF9UT09fTEFSR0UASU5TVUZGSUNJRU5UX1NUT1JBR0UASFBFX1BBVVNFRF9VUEdSQURFAEhQRV9QQVVTRURfSDJfVVBHUkFERQBTT1VSQ0UAQU5OT1VOQ0UAVFJBQ0UASFBFX1VORVhQRUNURURfU1BBQ0UAREVTQ1JJQkUAVU5TVUJTQ1JJQkUAUkVDT1JEAEhQRV9JTlZBTElEX01FVEhPRABOT1RfRk9VTkQAUFJPUEZJTkQAVU5CSU5EAFJFQklORABVTkFVVEhPUklaRUQATUVUSE9EX05PVF9BTExPV0VEAEhUVFBfVkVSU0lPTl9OT1RfU1VQUE9SVEVEAEFMUkVBRFlfUkVQT1JURUQAQUNDRVBURUQATk9UX0lNUExFTUVOVEVEAExPT1BfREVURUNURUQASFBFX0NSX0VYUEVDVEVEAEhQRV9MRl9FWFBFQ1RFRABDUkVBVEVEAElNX1VTRUQASFBFX1BBVVNFRABUSU1FT1VUX09DQ1VSRUQAUEFZTUVOVF9SRVFVSVJFRABQUkVDT05ESVRJT05fUkVRVUlSRUQAUFJPWFlfQVVUSEVOVElDQVRJT05fUkVRVUlSRUQATkVUV09SS19BVVRIRU5USUNBVElPTl9SRVFVSVJFRABMRU5HVEhfUkVRVUlSRUQAU1NMX0NFUlRJRklDQVRFX1JFUVVJUkVEAFVQR1JBREVfUkVRVUlSRUQAUEFHRV9FWFBJUkVEAFBSRUNPTkRJVElPTl9GQUlMRUQARVhQRUNUQVRJT05fRkFJTEVEAFJFVkFMSURBVElPTl9GQUlMRUQAU1NMX0hBTkRTSEFLRV9GQUlMRUQATE9DS0VEAFRSQU5TRk9STUFUSU9OX0FQUExJRUQATk9UX01PRElGSUVEAE5PVF9FWFRFTkRFRABCQU5EV0lEVEhfTElNSVRfRVhDRUVERUQAU0lURV9JU19PVkVSTE9BREVEAEhFQUQARXhwZWN0ZWQgSFRUUC8sIFJUU1AvIG9yIElDRS8A5xUAAK8VAACkEgAAkhoAACYWAACeFAAA2xkAAHkVAAB+EgAA/hQAADYVAAALFgAA2BYAAPMSAABCGAAArBYAABIVAAAUFwAA7xcAAEgUAABxFwAAshoAAGsZAAB+GQAANRQAAIIaAABEFwAA/RYAAB4YAACHFwAAqhkAAJMSAAAHGAAALBcAAMoXAACkFwAA5xUAAOcVAABYFwAAOxgAAKASAAAtHAAAwxEAAEgRAADeEgAAQhMAAKQZAAD9EAAA9xUAAKUVAADvFgAA+BkAAEoWAABWFgAA9RUAAAoaAAAIGgAAARoAAKsVAABCEgAA1xAAAEwRAAAFGQAAVBYAAB4RAADKGQAAyBkAAE4WAAD/GAAAcRQAAPAVAADuFQAAlBkAAPwVAAC/GQAAmxkAAHwUAABDEQAAcBgAAJUUAAAnFAAAGRQAANUSAADUGQAARBYAAPcQAEG5OwsBAQBB0DsL4AEBAQIBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEDAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBBuj0LBAEAAAIAQdE9C14DBAMDAwMDAAADAwADAwADAwMDAwMDAwMDAAUAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAwADAEG6PwsEAQAAAgBB0T8LXgMAAwMDAwMAAAMDAAMDAAMDAwMDAwMDAwMABAAFAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwADAAMAQbDBAAsNbG9zZWVlcC1hbGl2ZQBBycEACwEBAEHgwQAL4AEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBBycMACwEBAEHgwwAL5wEBAQEBAQEBAQEBAQECAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAWNodW5rZWQAQfHFAAteAQABAQEBAQAAAQEAAQEAAQEBAQEBAQEBAQAAAAAAAAABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEAAQBB0McACyFlY3Rpb25lbnQtbGVuZ3Rob25yb3h5LWNvbm5lY3Rpb24AQYDIAAsgcmFuc2Zlci1lbmNvZGluZ3BncmFkZQ0KDQpTTQ0KDQoAQanIAAsFAQIAAQMAQcDIAAtfBAUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUAQanKAAsFAQIAAQMAQcDKAAtfBAUFBgUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUAQanMAAsEAQAAAQBBwcwAC14CAgACAgICAgICAgICAgICAgICAgICAgICAgICAgIAAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAEGpzgALBQECAAEDAEHAzgALXwQFAAAFBQUFBQUFBQUFBQYFBQUFBQUFBQUFBQUABQAHCAUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQAFAAUABQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUAAAAFAEGp0AALBQEBAAEBAEHA0AALAQEAQdrQAAtBAgAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAQanSAAsFAQEAAQEAQcDSAAsBAQBBytIACwYCAAAAAAIAQeHSAAs6AwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBBoNQAC50BTk9VTkNFRUNLT1VUTkVDVEVURUNSSUJFTFVTSEVURUFEU0VBUkNIUkdFQ1RJVklUWUxFTkRBUlZFT1RJRllQVElPTlNDSFNFQVlTVEFUQ0hHRVVFUllPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFVFRQQ0VUU1BBRFRQLw==`, `base64`) }); -})); -var Ea$3 = c$12(((e, n) => { - let { Buffer: r } = f$11(`node:buffer`), i; - Object.defineProperty(n, "exports", { get: () => i ||= r.from(`AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAn9/AGABfwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQAEA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAAzU0BQYAAAMAAAAAAAADAQMAAwMDAAACAAAAAAICAgICAgICAgIBAQEBAQEBAQEBAwAAAwAAAAQFAXABExMFAwEAAgYIAX8BQcDZBAsHxQcoBm1lbW9yeQIAC19pbml0aWFsaXplAAgZX19pbmRpcmVjdF9mdW5jdGlvbl90YWJsZQEAC2xsaHR0cF9pbml0AAkYbGxodHRwX3Nob3VsZF9rZWVwX2FsaXZlADcMbGxodHRwX2FsbG9jAAsGbWFsbG9jADkLbGxodHRwX2ZyZWUADARmcmVlAAwPbGxodHRwX2dldF90eXBlAA0VbGxodHRwX2dldF9odHRwX21ham9yAA4VbGxodHRwX2dldF9odHRwX21pbm9yAA8RbGxodHRwX2dldF9tZXRob2QAEBZsbGh0dHBfZ2V0X3N0YXR1c19jb2RlABESbGxodHRwX2dldF91cGdyYWRlABIMbGxodHRwX3Jlc2V0ABMObGxodHRwX2V4ZWN1dGUAFBRsbGh0dHBfc2V0dGluZ3NfaW5pdAAVDWxsaHR0cF9maW5pc2gAFgxsbGh0dHBfcGF1c2UAFw1sbGh0dHBfcmVzdW1lABgbbGxodHRwX3Jlc3VtZV9hZnRlcl91cGdyYWRlABkQbGxodHRwX2dldF9lcnJubwAaF2xsaHR0cF9nZXRfZXJyb3JfcmVhc29uABsXbGxodHRwX3NldF9lcnJvcl9yZWFzb24AHBRsbGh0dHBfZ2V0X2Vycm9yX3BvcwAdEWxsaHR0cF9lcnJub19uYW1lAB4SbGxodHRwX21ldGhvZF9uYW1lAB8SbGxodHRwX3N0YXR1c19uYW1lACAabGxodHRwX3NldF9sZW5pZW50X2hlYWRlcnMAISFsbGh0dHBfc2V0X2xlbmllbnRfY2h1bmtlZF9sZW5ndGgAIh1sbGh0dHBfc2V0X2xlbmllbnRfa2VlcF9hbGl2ZQAjJGxsaHR0cF9zZXRfbGVuaWVudF90cmFuc2Zlcl9lbmNvZGluZwAkGmxsaHR0cF9zZXRfbGVuaWVudF92ZXJzaW9uACUjbGxodHRwX3NldF9sZW5pZW50X2RhdGFfYWZ0ZXJfY2xvc2UAJidsbGh0dHBfc2V0X2xlbmllbnRfb3B0aW9uYWxfbGZfYWZ0ZXJfY3IAJyxsbGh0dHBfc2V0X2xlbmllbnRfb3B0aW9uYWxfY3JsZl9hZnRlcl9jaHVuawAoKGxsaHR0cF9zZXRfbGVuaWVudF9vcHRpb25hbF9jcl9iZWZvcmVfbGYAKSpsbGh0dHBfc2V0X2xlbmllbnRfc3BhY2VzX2FmdGVyX2NodW5rX3NpemUAKhhsbGh0dHBfbWVzc2FnZV9uZWVkc19lb2YANgkYAQBBAQsSAQIDBAUKBgcyNDMuKy8tLDAxCuzaAjQWAEHA1QAoAgAEQAALQcDVAEEBNgIACxQAIAAQOCAAIAI2AjggACABOgAoCxQAIAAgAC8BNCAALQAwIAAQNxAACx4BAX9BwAAQOiIBEDggAUGACDYCOCABIAA6ACggAQuPDAEHfwJAIABFDQAgAEEIayIBIABBBGsoAgAiAEF4cSIEaiEFAkAgAEEBcQ0AIABBA3FFDQEgASABKAIAIgBrIgFB1NUAKAIASQ0BIAAgBGohBAJAAkBB2NUAKAIAIAFHBEAgAEH/AU0EQCAAQQN2IQMgASgCCCIAIAEoAgwiAkYEQEHE1QBBxNUAKAIAQX4gA3dxNgIADAULIAIgADYCCCAAIAI2AgwMBAsgASgCGCEGIAEgASgCDCIARwRAIAAgASgCCCICNgIIIAIgADYCDAwDCyABQRRqIgMoAgAiAkUEQCABKAIQIgJFDQIgAUEQaiEDCwNAIAMhByACIgBBFGoiAygCACICDQAgAEEQaiEDIAAoAhAiAg0ACyAHQQA2AgAMAgsgBSgCBCIAQQNxQQNHDQIgBSAAQX5xNgIEQczVACAENgIAIAUgBDYCACABIARBAXI2AgQMAwtBACEACyAGRQ0AAkAgASgCHCICQQJ0QfTXAGoiAygCACABRgRAIAMgADYCACAADQFByNUAQcjVACgCAEF+IAJ3cTYCAAwCCyAGQRBBFCAGKAIQIAFGG2ogADYCACAARQ0BCyAAIAY2AhggASgCECICBEAgACACNgIQIAIgADYCGAsgAUEUaigCACICRQ0AIABBFGogAjYCACACIAA2AhgLIAEgBU8NACAFKAIEIgBBAXFFDQACQAJAAkACQCAAQQJxRQRAQdzVACgCACAFRgRAQdzVACABNgIAQdDVAEHQ1QAoAgAgBGoiADYCACABIABBAXI2AgQgAUHY1QAoAgBHDQZBzNUAQQA2AgBB2NUAQQA2AgAMBgtB2NUAKAIAIAVGBEBB2NUAIAE2AgBBzNUAQczVACgCACAEaiIANgIAIAEgAEEBcjYCBCAAIAFqIAA2AgAMBgsgAEF4cSAEaiEEIABB/wFNBEAgAEEDdiEDIAUoAggiACAFKAIMIgJGBEBBxNUAQcTVACgCAEF+IAN3cTYCAAwFCyACIAA2AgggACACNgIMDAQLIAUoAhghBiAFIAUoAgwiAEcEQEHU1QAoAgAaIAAgBSgCCCICNgIIIAIgADYCDAwDCyAFQRRqIgMoAgAiAkUEQCAFKAIQIgJFDQIgBUEQaiEDCwNAIAMhByACIgBBFGoiAygCACICDQAgAEEQaiEDIAAoAhAiAg0ACyAHQQA2AgAMAgsgBSAAQX5xNgIEIAEgBGogBDYCACABIARBAXI2AgQMAwtBACEACyAGRQ0AAkAgBSgCHCICQQJ0QfTXAGoiAygCACAFRgRAIAMgADYCACAADQFByNUAQcjVACgCAEF+IAJ3cTYCAAwCCyAGQRBBFCAGKAIQIAVGG2ogADYCACAARQ0BCyAAIAY2AhggBSgCECICBEAgACACNgIQIAIgADYCGAsgBUEUaigCACICRQ0AIABBFGogAjYCACACIAA2AhgLIAEgBGogBDYCACABIARBAXI2AgQgAUHY1QAoAgBHDQBBzNUAIAQ2AgAMAQsgBEH/AU0EQCAEQXhxQezVAGohAAJ/QcTVACgCACICQQEgBEEDdnQiA3FFBEBBxNUAIAIgA3I2AgAgAAwBCyAAKAIICyICIAE2AgwgACABNgIIIAEgADYCDCABIAI2AggMAQtBHyECIARB////B00EQCAEQSYgBEEIdmciAGt2QQFxIABBAXRrQT5qIQILIAEgAjYCHCABQgA3AhAgAkECdEH01wBqIQACQEHI1QAoAgAiA0EBIAJ0IgdxRQRAIAAgATYCAEHI1QAgAyAHcjYCACABIAA2AhggASABNgIIIAEgATYCDAwBCyAEQRkgAkEBdmtBACACQR9HG3QhAiAAKAIAIQACQANAIAAiAygCBEF4cSAERg0BIAJBHXYhACACQQF0IQIgAyAAQQRxakEQaiIHKAIAIgANAAsgByABNgIAIAEgAzYCGCABIAE2AgwgASABNgIIDAELIAMoAggiACABNgIMIAMgATYCCCABQQA2AhggASADNgIMIAEgADYCCAtB5NUAQeTVACgCAEEBayIAQX8gABs2AgALCwcAIAAtACgLBwAgAC0AKgsHACAALQArCwcAIAAtACkLBwAgAC8BNAsHACAALQAwC0ABBH8gACgCGCEBIAAvAS4hAiAALQAoIQMgACgCOCEEIAAQOCAAIAQ2AjggACADOgAoIAAgAjsBLiAAIAE2AhgLhocCAwd/A34BeyABIAJqIQQCQCAAIgMoAgwiAA0AIAMoAgQEQCADIAE2AgQLIwBBEGsiCSQAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCADKAIcIgJBAmsO/AEB+QECAwQFBgcICQoLDA0ODxAREvgBE/cBFBX2ARYX9QEYGRobHB0eHyD9AfsBIfQBIiMkJSYnKCkqK/MBLC0uLzAxMvIB8QEzNPAB7wE1Njc4OTo7PD0+P0BBQkNERUZHSElKS0xNTk/6AVBRUlPuAe0BVOwBVesBVldYWVrqAVtcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AAYEBggGDAYQBhQGGAYcBiAGJAYoBiwGMAY0BjgGPAZABkQGSAZMBlAGVAZYBlwGYAZkBmgGbAZwBnQGeAZ8BoAGhAaIBowGkAaUBpgGnAagBqQGqAasBrAGtAa4BrwGwAbEBsgGzAbQBtQG2AbcBuAG5AboBuwG8Ab0BvgG/AcABwQHCAcMBxAHFAcYBxwHIAckBygHLAcwBzQHOAekB6AHPAecB0AHmAdEB0gHTAdQB5QHVAdYB1wHYAdkB2gHbAdwB3QHeAd8B4AHhAeIB4wEA/AELQQAM4wELQQ4M4gELQQ0M4QELQQ8M4AELQRAM3wELQRMM3gELQRQM3QELQRUM3AELQRYM2wELQRcM2gELQRgM2QELQRkM2AELQRoM1wELQRsM1gELQRwM1QELQR0M1AELQR4M0wELQR8M0gELQSAM0QELQSEM0AELQQgMzwELQSIMzgELQSQMzQELQSMMzAELQQcMywELQSUMygELQSYMyQELQScMyAELQSgMxwELQRIMxgELQREMxQELQSkMxAELQSoMwwELQSsMwgELQSwMwQELQd4BDMABC0EuDL8BC0EvDL4BC0EwDL0BC0ExDLwBC0EyDLsBC0EzDLoBC0E0DLkBC0HfAQy4AQtBNQy3AQtBOQy2AQtBDAy1AQtBNgy0AQtBNwyzAQtBOAyyAQtBPgyxAQtBOgywAQtB4AEMrwELQQsMrgELQT8MrQELQTsMrAELQQoMqwELQTwMqgELQT0MqQELQeEBDKgBC0HBAAynAQtBwAAMpgELQcIADKUBC0EJDKQBC0EtDKMBC0HDAAyiAQtBxAAMoQELQcUADKABC0HGAAyfAQtBxwAMngELQcgADJ0BC0HJAAycAQtBygAMmwELQcsADJoBC0HMAAyZAQtBzQAMmAELQc4ADJcBC0HPAAyWAQtB0AAMlQELQdEADJQBC0HSAAyTAQtB0wAMkgELQdUADJEBC0HUAAyQAQtB1gAMjwELQdcADI4BC0HYAAyNAQtB2QAMjAELQdoADIsBC0HbAAyKAQtB3AAMiQELQd0ADIgBC0HeAAyHAQtB3wAMhgELQeAADIUBC0HhAAyEAQtB4gAMgwELQeMADIIBC0HkAAyBAQtB5QAMgAELQeIBDH8LQeYADH4LQecADH0LQQYMfAtB6AAMewtBBQx6C0HpAAx5C0EEDHgLQeoADHcLQesADHYLQewADHULQe0ADHQLQQMMcwtB7gAMcgtB7wAMcQtB8AAMcAtB8gAMbwtB8QAMbgtB8wAMbQtB9AAMbAtB9QAMawtB9gAMagtBAgxpC0H3AAxoC0H4AAxnC0H5AAxmC0H6AAxlC0H7AAxkC0H8AAxjC0H9AAxiC0H+AAxhC0H/AAxgC0GAAQxfC0GBAQxeC0GCAQxdC0GDAQxcC0GEAQxbC0GFAQxaC0GGAQxZC0GHAQxYC0GIAQxXC0GJAQxWC0GKAQxVC0GLAQxUC0GMAQxTC0GNAQxSC0GOAQxRC0GPAQxQC0GQAQxPC0GRAQxOC0GSAQxNC0GTAQxMC0GUAQxLC0GVAQxKC0GWAQxJC0GXAQxIC0GYAQxHC0GZAQxGC0GaAQxFC0GbAQxEC0GcAQxDC0GdAQxCC0GeAQxBC0GfAQxAC0GgAQw/C0GhAQw+C0GiAQw9C0GjAQw8C0GkAQw7C0GlAQw6C0GmAQw5C0GnAQw4C0GoAQw3C0GpAQw2C0GqAQw1C0GrAQw0C0GsAQwzC0GtAQwyC0GuAQwxC0GvAQwwC0GwAQwvC0GxAQwuC0GyAQwtC0GzAQwsC0G0AQwrC0G1AQwqC0G2AQwpC0G3AQwoC0G4AQwnC0G5AQwmC0G6AQwlC0G7AQwkC0G8AQwjC0G9AQwiC0G+AQwhC0G/AQwgC0HAAQwfC0HBAQweC0HCAQwdC0EBDBwLQcMBDBsLQcQBDBoLQcUBDBkLQcYBDBgLQccBDBcLQcgBDBYLQckBDBULQcoBDBQLQcsBDBMLQcwBDBILQc0BDBELQc4BDBALQc8BDA8LQdABDA4LQdEBDA0LQdIBDAwLQdMBDAsLQdQBDAoLQdUBDAkLQdYBDAgLQeMBDAcLQdcBDAYLQdgBDAULQdkBDAQLQdoBDAMLQdsBDAILQd0BDAELQdwBCyECA0ACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAMCfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAn8CQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAwJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCACDuMBAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISMkJScoKZ4DmwOaA5EDigODA4AD/QL7AvgC8gLxAu8C7QLoAucC5gLlAuQC3ALbAtoC2QLYAtcC1gLVAs8CzgLMAssCygLJAsgCxwLGAsQCwwK+ArwCugK5ArgCtwK2ArUCtAKzArICsQKwAq4CrQKpAqgCpwKmAqUCpAKjAqICoQKgAp8CmAKQAowCiwKKAoEC/gH9AfwB+wH6AfkB+AH3AfUB8wHwAesB6QHoAecB5gHlAeQB4wHiAeEB4AHfAd4B3QHcAdoB2QHYAdcB1gHVAdQB0wHSAdEB0AHPAc4BzQHMAcsBygHJAcgBxwHGAcUBxAHDAcIBwQHAAb8BvgG9AbwBuwG6AbkBuAG3AbYBtQG0AbMBsgGxAbABrwGuAa0BrAGrAaoBqQGoAacBpgGlAaQBowGiAZ8BngGZAZgBlwGWAZUBlAGTAZIBkQGQAY8BjQGMAYcBhgGFAYQBgwGCAX18e3p5dnV0UFFSU1RVCyABIARHDXJB/QEhAgy+AwsgASAERw2YAUHbASECDL0DCyABIARHDfEBQY4BIQIMvAMLIAEgBEcN/AFBhAEhAgy7AwsgASAERw2KAkH/ACECDLoDCyABIARHDZECQf0AIQIMuQMLIAEgBEcNlAJB+wAhAgy4AwsgASAERw0eQR4hAgy3AwsgASAERw0ZQRghAgy2AwsgASAERw3KAkHNACECDLUDCyABIARHDdUCQcYAIQIMtAMLIAEgBEcN1gJBwwAhAgyzAwsgASAERw3cAkE4IQIMsgMLIAMtADBBAUYNrQMMiQMLQQAhAAJAAkACQCADLQAqRQ0AIAMtACtFDQAgAy8BMiICQQJxRQ0BDAILIAMvATIiAkEBcUUNAQtBASEAIAMtAChBAUYNACADLwE0IgZB5ABrQeQASQ0AIAZBzAFGDQAgBkGwAkYNACACQcAAcQ0AQQAhACACQYgEcUGABEYNACACQShxQQBHIQALIANBADsBMiADQQA6ADECQCAARQRAIANBADoAMSADLQAuQQRxDQEMsQMLIANCADcDIAsgA0EAOgAxIANBAToANgxIC0EAIQACQCADKAI4IgJFDQAgAigCMCICRQ0AIAMgAhEAACEACyAARQ1IIABBFUcNYiADQQQ2AhwgAyABNgIUIANB0hs2AhAgA0EVNgIMQQAhAgyvAwsgASAERgRAQQYhAgyvAwsgAS0AAEEKRw0ZIAFBAWohAQwaCyADQgA3AyBBEiECDJQDCyABIARHDYoDQSMhAgysAwsgASAERgRAQQchAgysAwsCQAJAIAEtAABBCmsOBAEYGAAYCyABQQFqIQFBECECDJMDCyABQQFqIQEgA0Evai0AAEEBcQ0XQQAhAiADQQA2AhwgAyABNgIUIANBmSA2AhAgA0EZNgIMDKsDCyADIAMpAyAiDCAEIAFrrSIKfSILQgAgCyAMWBs3AyAgCiAMWg0YQQghAgyqAwsgASAERwRAIANBCTYCCCADIAE2AgRBFCECDJEDC0EJIQIMqQMLIAMpAyBQDa4CDEMLIAEgBEYEQEELIQIMqAMLIAEtAABBCkcNFiABQQFqIQEMFwsgA0Evai0AAEEBcUUNGQwmC0EAIQACQCADKAI4IgJFDQAgAigCUCICRQ0AIAMgAhEAACEACyAADRkMQgtBACEAAkAgAygCOCICRQ0AIAIoAlAiAkUNACADIAIRAAAhAAsgAA0aDCQLQQAhAAJAIAMoAjgiAkUNACACKAJQIgJFDQAgAyACEQAAIQALIAANGwwyCyADQS9qLQAAQQFxRQ0cDCILQQAhAAJAIAMoAjgiAkUNACACKAJUIgJFDQAgAyACEQAAIQALIAANHAxCC0EAIQACQCADKAI4IgJFDQAgAigCVCICRQ0AIAMgAhEAACEACyAADR0MIAsgASAERgRAQRMhAgygAwsCQCABLQAAIgBBCmsOBB8jIwAiCyABQQFqIQEMHwtBACEAAkAgAygCOCICRQ0AIAIoAlQiAkUNACADIAIRAAAhAAsgAA0iDEILIAEgBEYEQEEWIQIMngMLIAEtAABBwMEAai0AAEEBRw0jDIMDCwJAA0AgAS0AAEGwO2otAAAiAEEBRwRAAkAgAEECaw4CAwAnCyABQQFqIQFBISECDIYDCyAEIAFBAWoiAUcNAAtBGCECDJ0DCyADKAIEIQBBACECIANBADYCBCADIAAgAUEBaiIBEDQiAA0hDEELQQAhAAJAIAMoAjgiAkUNACACKAJUIgJFDQAgAyACEQAAIQALIAANIwwqCyABIARGBEBBHCECDJsDCyADQQo2AgggAyABNgIEQQAhAAJAIAMoAjgiAkUNACACKAJQIgJFDQAgAyACEQAAIQALIAANJUEkIQIMgQMLIAEgBEcEQANAIAEtAABBsD1qLQAAIgBBA0cEQCAAQQFrDgUYGiaCAyUmCyAEIAFBAWoiAUcNAAtBGyECDJoDC0EbIQIMmQMLA0AgAS0AAEGwP2otAAAiAEEDRwRAIABBAWsOBQ8RJxMmJwsgBCABQQFqIgFHDQALQR4hAgyYAwsgASAERwRAIANBCzYCCCADIAE2AgRBByECDP8CC0EfIQIMlwMLIAEgBEYEQEEgIQIMlwMLAkAgAS0AAEENaw4ULj8/Pz8/Pz8/Pz8/Pz8/Pz8/PwA/C0EAIQIgA0EANgIcIANBvws2AhAgA0ECNgIMIAMgAUEBajYCFAyWAwsgA0EvaiECA0AgASAERgRAQSEhAgyXAwsCQAJAAkAgAS0AACIAQQlrDhgCACkpASkpKSkpKSkpKSkpKSkpKSkpKQInCyABQQFqIQEgA0Evai0AAEEBcUUNCgwYCyABQQFqIQEMFwsgAUEBaiEBIAItAABBAnENAAtBACECIANBADYCHCADIAE2AhQgA0GfFTYCECADQQw2AgwMlQMLIAMtAC5BgAFxRQ0BC0EAIQACQCADKAI4IgJFDQAgAigCXCICRQ0AIAMgAhEAACEACyAARQ3mAiAAQRVGBEAgA0EkNgIcIAMgATYCFCADQZsbNgIQIANBFTYCDEEAIQIMlAMLQQAhAiADQQA2AhwgAyABNgIUIANBkA42AhAgA0EUNgIMDJMDC0EAIQIgA0EANgIcIAMgATYCFCADQb4gNgIQIANBAjYCDAySAwsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEgDKdqIgEQMiIARQ0rIANBBzYCHCADIAE2AhQgAyAANgIMDJEDCyADLQAuQcAAcUUNAQtBACEAAkAgAygCOCICRQ0AIAIoAlgiAkUNACADIAIRAAAhAAsgAEUNKyAAQRVGBEAgA0EKNgIcIAMgATYCFCADQesZNgIQIANBFTYCDEEAIQIMkAMLQQAhAiADQQA2AhwgAyABNgIUIANBkww2AhAgA0ETNgIMDI8DC0EAIQIgA0EANgIcIAMgATYCFCADQYIVNgIQIANBAjYCDAyOAwtBACECIANBADYCHCADIAE2AhQgA0HdFDYCECADQRk2AgwMjQMLQQAhAiADQQA2AhwgAyABNgIUIANB5h02AhAgA0EZNgIMDIwDCyAAQRVGDT1BACECIANBADYCHCADIAE2AhQgA0HQDzYCECADQSI2AgwMiwMLIAMoAgQhAEEAIQIgA0EANgIEIAMgACABEDMiAEUNKCADQQ02AhwgAyABNgIUIAMgADYCDAyKAwsgAEEVRg06QQAhAiADQQA2AhwgAyABNgIUIANB0A82AhAgA0EiNgIMDIkDCyADKAIEIQBBACECIANBADYCBCADIAAgARAzIgBFBEAgAUEBaiEBDCgLIANBDjYCHCADIAA2AgwgAyABQQFqNgIUDIgDCyAAQRVGDTdBACECIANBADYCHCADIAE2AhQgA0HQDzYCECADQSI2AgwMhwMLIAMoAgQhAEEAIQIgA0EANgIEIAMgACABEDMiAEUEQCABQQFqIQEMJwsgA0EPNgIcIAMgADYCDCADIAFBAWo2AhQMhgMLQQAhAiADQQA2AhwgAyABNgIUIANB4hc2AhAgA0EZNgIMDIUDCyAAQRVGDTNBACECIANBADYCHCADIAE2AhQgA0HWDDYCECADQSM2AgwMhAMLIAMoAgQhAEEAIQIgA0EANgIEIAMgACABEDQiAEUNJSADQRE2AhwgAyABNgIUIAMgADYCDAyDAwsgAEEVRg0wQQAhAiADQQA2AhwgAyABNgIUIANB1gw2AhAgA0EjNgIMDIIDCyADKAIEIQBBACECIANBADYCBCADIAAgARA0IgBFBEAgAUEBaiEBDCULIANBEjYCHCADIAA2AgwgAyABQQFqNgIUDIEDCyADQS9qLQAAQQFxRQ0BC0EXIQIM5gILQQAhAiADQQA2AhwgAyABNgIUIANB4hc2AhAgA0EZNgIMDP4CCyAAQTtHDQAgAUEBaiEBDAwLQQAhAiADQQA2AhwgAyABNgIUIANBkhg2AhAgA0ECNgIMDPwCCyAAQRVGDShBACECIANBADYCHCADIAE2AhQgA0HWDDYCECADQSM2AgwM+wILIANBFDYCHCADIAE2AhQgAyAANgIMDPoCCyADKAIEIQBBACECIANBADYCBCADIAAgARA0IgBFBEAgAUEBaiEBDPUCCyADQRU2AhwgAyAANgIMIAMgAUEBajYCFAz5AgsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEQNCIARQRAIAFBAWohAQzzAgsgA0EXNgIcIAMgADYCDCADIAFBAWo2AhQM+AILIABBFUYNI0EAIQIgA0EANgIcIAMgATYCFCADQdYMNgIQIANBIzYCDAz3AgsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEQNCIARQRAIAFBAWohAQwdCyADQRk2AhwgAyAANgIMIAMgAUEBajYCFAz2AgsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEQNCIARQRAIAFBAWohAQzvAgsgA0EaNgIcIAMgADYCDCADIAFBAWo2AhQM9QILIABBFUYNH0EAIQIgA0EANgIcIAMgATYCFCADQdAPNgIQIANBIjYCDAz0AgsgAygCBCEAIANBADYCBCADIAAgARAzIgBFBEAgAUEBaiEBDBsLIANBHDYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgzzAgsgAygCBCEAIANBADYCBCADIAAgARAzIgBFBEAgAUEBaiEBDOsCCyADQR02AhwgAyAANgIMIAMgAUEBajYCFEEAIQIM8gILIABBO0cNASABQQFqIQELQSYhAgzXAgtBACECIANBADYCHCADIAE2AhQgA0GfFTYCECADQQw2AgwM7wILIAEgBEcEQANAIAEtAABBIEcNhAIgBCABQQFqIgFHDQALQSwhAgzvAgtBLCECDO4CCyABIARGBEBBNCECDO4CCwJAAkADQAJAIAEtAABBCmsOBAIAAAMACyAEIAFBAWoiAUcNAAtBNCECDO8CCyADKAIEIQAgA0EANgIEIAMgACABEDEiAEUNnwIgA0EyNgIcIAMgATYCFCADIAA2AgxBACECDO4CCyADKAIEIQAgA0EANgIEIAMgACABEDEiAEUEQCABQQFqIQEMnwILIANBMjYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgztAgsgASAERwRAAkADQCABLQAAQTBrIgBB/wFxQQpPBEBBOiECDNcCCyADKQMgIgtCmbPmzJmz5swZVg0BIAMgC0IKfiIKNwMgIAogAK1C/wGDIgtCf4VWDQEgAyAKIAt8NwMgIAQgAUEBaiIBRw0AC0HAACECDO4CCyADKAIEIQAgA0EANgIEIAMgACABQQFqIgEQMSIADRcM4gILQcAAIQIM7AILIAEgBEYEQEHJACECDOwCCwJAA0ACQCABLQAAQQlrDhgAAqICogKpAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAgCiAgsgBCABQQFqIgFHDQALQckAIQIM7AILIAFBAWohASADQS9qLQAAQQFxDaUCIANBADYCHCADIAE2AhQgA0GXEDYCECADQQo2AgxBACECDOsCCyABIARHBEADQCABLQAAQSBHDRUgBCABQQFqIgFHDQALQfgAIQIM6wILQfgAIQIM6gILIANBAjoAKAw4C0EAIQIgA0EANgIcIANBvws2AhAgA0ECNgIMIAMgAUEBajYCFAzoAgtBACECDM4CC0ENIQIMzQILQRMhAgzMAgtBFSECDMsCC0EWIQIMygILQRghAgzJAgtBGSECDMgCC0EaIQIMxwILQRshAgzGAgtBHCECDMUCC0EdIQIMxAILQR4hAgzDAgtBHyECDMICC0EgIQIMwQILQSIhAgzAAgtBIyECDL8CC0ElIQIMvgILQeUAIQIMvQILIANBPTYCHCADIAE2AhQgAyAANgIMQQAhAgzVAgsgA0EbNgIcIAMgATYCFCADQaQcNgIQIANBFTYCDEEAIQIM1AILIANBIDYCHCADIAE2AhQgA0GYGjYCECADQRU2AgxBACECDNMCCyADQRM2AhwgAyABNgIUIANBmBo2AhAgA0EVNgIMQQAhAgzSAgsgA0ELNgIcIAMgATYCFCADQZgaNgIQIANBFTYCDEEAIQIM0QILIANBEDYCHCADIAE2AhQgA0GYGjYCECADQRU2AgxBACECDNACCyADQSA2AhwgAyABNgIUIANBpBw2AhAgA0EVNgIMQQAhAgzPAgsgA0ELNgIcIAMgATYCFCADQaQcNgIQIANBFTYCDEEAIQIMzgILIANBDDYCHCADIAE2AhQgA0GkHDYCECADQRU2AgxBACECDM0CC0EAIQIgA0EANgIcIAMgATYCFCADQd0ONgIQIANBEjYCDAzMAgsCQANAAkAgAS0AAEEKaw4EAAICAAILIAQgAUEBaiIBRw0AC0H9ASECDMwCCwJAAkAgAy0ANkEBRw0AQQAhAAJAIAMoAjgiAkUNACACKAJgIgJFDQAgAyACEQAAIQALIABFDQAgAEEVRw0BIANB/AE2AhwgAyABNgIUIANB3Bk2AhAgA0EVNgIMQQAhAgzNAgtB3AEhAgyzAgsgA0EANgIcIAMgATYCFCADQfkLNgIQIANBHzYCDEEAIQIMywILAkACQCADLQAoQQFrDgIEAQALQdsBIQIMsgILQdQBIQIMsQILIANBAjoAMUEAIQACQCADKAI4IgJFDQAgAigCACICRQ0AIAMgAhEAACEACyAARQRAQd0BIQIMsQILIABBFUcEQCADQQA2AhwgAyABNgIUIANBtAw2AhAgA0EQNgIMQQAhAgzKAgsgA0H7ATYCHCADIAE2AhQgA0GBGjYCECADQRU2AgxBACECDMkCCyABIARGBEBB+gEhAgzJAgsgAS0AAEHIAEYNASADQQE6ACgLQcABIQIMrgILQdoBIQIMrQILIAEgBEcEQCADQQw2AgggAyABNgIEQdkBIQIMrQILQfkBIQIMxQILIAEgBEYEQEH4ASECDMUCCyABLQAAQcgARw0EIAFBAWohAUHYASECDKsCCyABIARGBEBB9wEhAgzEAgsCQAJAIAEtAABBxQBrDhAABQUFBQUFBQUFBQUFBQUBBQsgAUEBaiEBQdYBIQIMqwILIAFBAWohAUHXASECDKoCC0H2ASECIAEgBEYNwgIgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABButUAai0AAEcNAyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMwwILIAMoAgQhACADQgA3AwAgAyAAIAZBAWoiARAuIgBFBEBB4wEhAgyqAgsgA0H1ATYCHCADIAE2AhQgAyAANgIMQQAhAgzCAgtB9AEhAiABIARGDcECIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbjVAGotAABHDQIgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADMICCyADQYEEOwEoIAMoAgQhACADQgA3AwAgAyAAIAZBAWoiARAuIgANAwwCCyADQQA2AgALQQAhAiADQQA2AhwgAyABNgIUIANB5R82AhAgA0EINgIMDL8CC0HVASECDKUCCyADQfMBNgIcIAMgATYCFCADIAA2AgxBACECDL0CC0EAIQACQCADKAI4IgJFDQAgAigCQCICRQ0AIAMgAhEAACEACyAARQ1uIABBFUcEQCADQQA2AhwgAyABNgIUIANBgg82AhAgA0EgNgIMQQAhAgy9AgsgA0GPATYCHCADIAE2AhQgA0HsGzYCECADQRU2AgxBACECDLwCCyABIARHBEAgA0ENNgIIIAMgATYCBEHTASECDKMCC0HyASECDLsCCyABIARGBEBB8QEhAgy7AgsCQAJAAkAgAS0AAEHIAGsOCwABCAgICAgICAgCCAsgAUEBaiEBQdABIQIMowILIAFBAWohAUHRASECDKICCyABQQFqIQFB0gEhAgyhAgtB8AEhAiABIARGDbkCIAMoAgAiACAEIAFraiEGIAEgAGtBAmohBQNAIAEtAAAgAEG11QBqLQAARw0EIABBAkYNAyAAQQFqIQAgBCABQQFqIgFHDQALIAMgBjYCAAy5AgtB7wEhAiABIARGDbgCIAMoAgAiACAEIAFraiEGIAEgAGtBAWohBQNAIAEtAAAgAEGz1QBqLQAARw0DIABBAUYNAiAAQQFqIQAgBCABQQFqIgFHDQALIAMgBjYCAAy4AgtB7gEhAiABIARGDbcCIAMoAgAiACAEIAFraiEGIAEgAGtBAmohBQNAIAEtAAAgAEGw1QBqLQAARw0CIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBjYCAAy3AgsgAygCBCEAIANCADcDACADIAAgBUEBaiIBECsiAEUNAiADQewBNgIcIAMgATYCFCADIAA2AgxBACECDLYCCyADQQA2AgALIAMoAgQhACADQQA2AgQgAyAAIAEQKyIARQ2cAiADQe0BNgIcIAMgATYCFCADIAA2AgxBACECDLQCC0HPASECDJoCC0EAIQACQCADKAI4IgJFDQAgAigCNCICRQ0AIAMgAhEAACEACwJAIAAEQCAAQRVGDQEgA0EANgIcIAMgATYCFCADQeoNNgIQIANBJjYCDEEAIQIMtAILQc4BIQIMmgILIANB6wE2AhwgAyABNgIUIANBgBs2AhAgA0EVNgIMQQAhAgyyAgsgASAERgRAQesBIQIMsgILIAEtAABBL0YEQCABQQFqIQEMAQsgA0EANgIcIAMgATYCFCADQbI4NgIQIANBCDYCDEEAIQIMsQILQc0BIQIMlwILIAEgBEcEQCADQQ42AgggAyABNgIEQcwBIQIMlwILQeoBIQIMrwILIAEgBEYEQEHpASECDK8CCyABLQAAQTBrIgBB/wFxQQpJBEAgAyAAOgAqIAFBAWohAUHLASECDJYCCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNlwIgA0HoATYCHCADIAE2AhQgAyAANgIMQQAhAgyuAgsgASAERgRAQecBIQIMrgILAkAgAS0AAEEuRgRAIAFBAWohAQwBCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNmAIgA0HmATYCHCADIAE2AhQgAyAANgIMQQAhAgyuAgtBygEhAgyUAgsgASAERgRAQeUBIQIMrQILQQAhAEEBIQVBASEHQQAhAgJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAIAEtAABBMGsOCgoJAAECAwQFBggLC0ECDAYLQQMMBQtBBAwEC0EFDAMLQQYMAgtBBwwBC0EICyECQQAhBUEAIQcMAgtBCSECQQEhAEEAIQVBACEHDAELQQAhBUEBIQILIAMgAjoAKyABQQFqIQECQAJAIAMtAC5BEHENAAJAAkACQCADLQAqDgMBAAIECyAHRQ0DDAILIAANAQwCCyAFRQ0BCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNAiADQeIBNgIcIAMgATYCFCADIAA2AgxBACECDK8CCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNmgIgA0HjATYCHCADIAE2AhQgAyAANgIMQQAhAgyuAgsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDZgCIANB5AE2AhwgAyABNgIUIAMgADYCDAytAgtByQEhAgyTAgtBACEAAkAgAygCOCICRQ0AIAIoAkQiAkUNACADIAIRAAAhAAsCQCAABEAgAEEVRg0BIANBADYCHCADIAE2AhQgA0GkDTYCECADQSE2AgxBACECDK0CC0HIASECDJMCCyADQeEBNgIcIAMgATYCFCADQdAaNgIQIANBFTYCDEEAIQIMqwILIAEgBEYEQEHhASECDKsCCwJAIAEtAABBIEYEQCADQQA7ATQgAUEBaiEBDAELIANBADYCHCADIAE2AhQgA0GZETYCECADQQk2AgxBACECDKsCC0HHASECDJECCyABIARGBEBB4AEhAgyqAgsCQCABLQAAQTBrQf8BcSICQQpJBEAgAUEBaiEBAkAgAy8BNCIAQZkzSw0AIAMgAEEKbCIAOwE0IABB/v8DcSACQf//A3NLDQAgAyAAIAJqOwE0DAILQQAhAiADQQA2AhwgAyABNgIUIANBlR42AhAgA0ENNgIMDKsCCyADQQA2AhwgAyABNgIUIANBlR42AhAgA0ENNgIMQQAhAgyqAgtBxgEhAgyQAgsgASAERgRAQd8BIQIMqQILAkAgAS0AAEEwa0H/AXEiAkEKSQRAIAFBAWohAQJAIAMvATQiAEGZM0sNACADIABBCmwiADsBNCAAQf7/A3EgAkH//wNzSw0AIAMgACACajsBNAwCC0EAIQIgA0EANgIcIAMgATYCFCADQZUeNgIQIANBDTYCDAyqAgsgA0EANgIcIAMgATYCFCADQZUeNgIQIANBDTYCDEEAIQIMqQILQcUBIQIMjwILIAEgBEYEQEHeASECDKgCCwJAIAEtAABBMGtB/wFxIgJBCkkEQCABQQFqIQECQCADLwE0IgBBmTNLDQAgAyAAQQpsIgA7ATQgAEH+/wNxIAJB//8Dc0sNACADIAAgAmo7ATQMAgtBACECIANBADYCHCADIAE2AhQgA0GVHjYCECADQQ02AgwMqQILIANBADYCHCADIAE2AhQgA0GVHjYCECADQQ02AgxBACECDKgCC0HEASECDI4CCyABIARGBEBB3QEhAgynAgsCQAJAAkACQCABLQAAQQprDhcCAwMAAwMDAwMDAwMDAwMDAwMDAwMDAQMLIAFBAWoMBQsgAUEBaiEBQcMBIQIMjwILIAFBAWohASADQS9qLQAAQQFxDQggA0EANgIcIAMgATYCFCADQY0LNgIQIANBDTYCDEEAIQIMpwILIANBADYCHCADIAE2AhQgA0GNCzYCECADQQ02AgxBACECDKYCCyABIARHBEAgA0EPNgIIIAMgATYCBEEBIQIMjQILQdwBIQIMpQILAkACQANAAkAgAS0AAEEKaw4EAgAAAwALIAQgAUEBaiIBRw0AC0HbASECDKYCCyADKAIEIQAgA0EANgIEIAMgACABEC0iAEUEQCABQQFqIQEMBAsgA0HaATYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgylAgsgAygCBCEAIANBADYCBCADIAAgARAtIgANASABQQFqCyEBQcEBIQIMigILIANB2QE2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIMogILQcIBIQIMiAILIANBL2otAABBAXENASADQQA2AhwgAyABNgIUIANB5Bw2AhAgA0EZNgIMQQAhAgygAgsgASAERgRAQdkBIQIMoAILAkACQAJAIAEtAABBCmsOBAECAgACCyABQQFqIQEMAgsgAUEBaiEBDAELIAMtAC5BwABxRQ0BC0EAIQACQCADKAI4IgJFDQAgAigCPCICRQ0AIAMgAhEAACEACyAARQ2gASAAQRVGBEAgA0HZADYCHCADIAE2AhQgA0G3GjYCECADQRU2AgxBACECDJ8CCyADQQA2AhwgAyABNgIUIANBgA02AhAgA0EbNgIMQQAhAgyeAgsgA0EANgIcIAMgATYCFCADQdwoNgIQIANBAjYCDEEAIQIMnQILIAEgBEcEQCADQQw2AgggAyABNgIEQb8BIQIMhAILQdgBIQIMnAILIAEgBEYEQEHXASECDJwCCwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAS0AAEHBAGsOFQABAgNaBAUGWlpaBwgJCgsMDQ4PEFoLIAFBAWohAUH7ACECDJICCyABQQFqIQFB/AAhAgyRAgsgAUEBaiEBQYEBIQIMkAILIAFBAWohAUGFASECDI8CCyABQQFqIQFBhgEhAgyOAgsgAUEBaiEBQYkBIQIMjQILIAFBAWohAUGKASECDIwCCyABQQFqIQFBjQEhAgyLAgsgAUEBaiEBQZYBIQIMigILIAFBAWohAUGXASECDIkCCyABQQFqIQFBmAEhAgyIAgsgAUEBaiEBQaUBIQIMhwILIAFBAWohAUGmASECDIYCCyABQQFqIQFBrAEhAgyFAgsgAUEBaiEBQbQBIQIMhAILIAFBAWohAUG3ASECDIMCCyABQQFqIQFBvgEhAgyCAgsgASAERgRAQdYBIQIMmwILIAEtAABBzgBHDUggAUEBaiEBQb0BIQIMgQILIAEgBEYEQEHVASECDJoCCwJAAkACQCABLQAAQcIAaw4SAEpKSkpKSkpKSgFKSkpKSkoCSgsgAUEBaiEBQbgBIQIMggILIAFBAWohAUG7ASECDIECCyABQQFqIQFBvAEhAgyAAgtB1AEhAiABIARGDZgCIAMoAgAiACAEIAFraiEFIAEgAGtBB2ohBgJAA0AgAS0AACAAQajVAGotAABHDUUgAEEHRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJkCCyADQQA2AgAgBkEBaiEBQRsMRQsgASAERgRAQdMBIQIMmAILAkACQCABLQAAQckAaw4HAEdHR0dHAUcLIAFBAWohAUG5ASECDP8BCyABQQFqIQFBugEhAgz+AQtB0gEhAiABIARGDZYCIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQabVAGotAABHDUMgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJcCCyADQQA2AgAgBkEBaiEBQQ8MQwtB0QEhAiABIARGDZUCIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQaTVAGotAABHDUIgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJYCCyADQQA2AgAgBkEBaiEBQSAMQgtB0AEhAiABIARGDZQCIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQaHVAGotAABHDUEgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJUCCyADQQA2AgAgBkEBaiEBQRIMQQsgASAERgRAQc8BIQIMlAILAkACQCABLQAAQcUAaw4OAENDQ0NDQ0NDQ0NDQwFDCyABQQFqIQFBtQEhAgz7AQsgAUEBaiEBQbYBIQIM+gELQc4BIQIgASAERg2SAiADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGe1QBqLQAARw0/IABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyTAgsgA0EANgIAIAZBAWohAUEHDD8LQc0BIQIgASAERg2RAiADKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGY1QBqLQAARw0+IABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAySAgsgA0EANgIAIAZBAWohAUEoDD4LIAEgBEYEQEHMASECDJECCwJAAkACQCABLQAAQcUAaw4RAEFBQUFBQUFBQQFBQUFBQQJBCyABQQFqIQFBsQEhAgz5AQsgAUEBaiEBQbIBIQIM+AELIAFBAWohAUGzASECDPcBC0HLASECIAEgBEYNjwIgAygCACIAIAQgAWtqIQUgASAAa0EGaiEGAkADQCABLQAAIABBkdUAai0AAEcNPCAAQQZGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMkAILIANBADYCACAGQQFqIQFBGgw8C0HKASECIAEgBEYNjgIgAygCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABBjdUAai0AAEcNOyAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMjwILIANBADYCACAGQQFqIQFBIQw7CyABIARGBEBByQEhAgyOAgsCQAJAIAEtAABBwQBrDhQAPT09PT09PT09PT09PT09PT09AT0LIAFBAWohAUGtASECDPUBCyABQQFqIQFBsAEhAgz0AQsgASAERgRAQcgBIQIMjQILAkACQCABLQAAQdUAaw4LADw8PDw8PDw8PAE8CyABQQFqIQFBrgEhAgz0AQsgAUEBaiEBQa8BIQIM8wELQccBIQIgASAERg2LAiADKAIAIgAgBCABa2ohBSABIABrQQhqIQYCQANAIAEtAAAgAEGE1QBqLQAARw04IABBCEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyMAgsgA0EANgIAIAZBAWohAUEqDDgLIAEgBEYEQEHGASECDIsCCyABLQAAQdAARw04IAFBAWohAUElDDcLQcUBIQIgASAERg2JAiADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGB1QBqLQAARw02IABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyKAgsgA0EANgIAIAZBAWohAUEODDYLIAEgBEYEQEHEASECDIkCCyABLQAAQcUARw02IAFBAWohAUGrASECDO8BCyABIARGBEBBwwEhAgyIAgsCQAJAAkACQCABLQAAQcIAaw4PAAECOTk5OTk5OTk5OTkDOQsgAUEBaiEBQacBIQIM8QELIAFBAWohAUGoASECDPABCyABQQFqIQFBqQEhAgzvAQsgAUEBaiEBQaoBIQIM7gELQcIBIQIgASAERg2GAiADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEH+1ABqLQAARw0zIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyHAgsgA0EANgIAIAZBAWohAUEUDDMLQcEBIQIgASAERg2FAiADKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEH51ABqLQAARw0yIABBBEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyGAgsgA0EANgIAIAZBAWohAUErDDILQcABIQIgASAERg2EAiADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEH21ABqLQAARw0xIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyFAgsgA0EANgIAIAZBAWohAUEsDDELQb8BIQIgASAERg2DAiADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGh1QBqLQAARw0wIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyEAgsgA0EANgIAIAZBAWohAUERDDALQb4BIQIgASAERg2CAiADKAIAIgAgBCABa2ohBSABIABrQQNqIQYCQANAIAEtAAAgAEHy1ABqLQAARw0vIABBA0YNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyDAgsgA0EANgIAIAZBAWohAUEuDC8LIAEgBEYEQEG9ASECDIICCwJAAkACQAJAAkAgAS0AAEHBAGsOFQA0NDQ0NDQ0NDQ0ATQ0AjQ0AzQ0BDQLIAFBAWohAUGbASECDOwBCyABQQFqIQFBnAEhAgzrAQsgAUEBaiEBQZ0BIQIM6gELIAFBAWohAUGiASECDOkBCyABQQFqIQFBpAEhAgzoAQsgASAERgRAQbwBIQIMgQILAkACQCABLQAAQdIAaw4DADABMAsgAUEBaiEBQaMBIQIM6AELIAFBAWohAUEEDC0LQbsBIQIgASAERg3/ASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHw1ABqLQAARw0sIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyAAgsgA0EANgIAIAZBAWohAUEdDCwLIAEgBEYEQEG6ASECDP8BCwJAAkAgAS0AAEHJAGsOBwEuLi4uLgAuCyABQQFqIQFBoQEhAgzmAQsgAUEBaiEBQSIMKwsgASAERgRAQbkBIQIM/gELIAEtAABB0ABHDSsgAUEBaiEBQaABIQIM5AELIAEgBEYEQEG4ASECDP0BCwJAAkAgAS0AAEHGAGsOCwAsLCwsLCwsLCwBLAsgAUEBaiEBQZ4BIQIM5AELIAFBAWohAUGfASECDOMBC0G3ASECIAEgBEYN+wEgAygCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABB7NQAai0AAEcNKCAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM/AELIANBADYCACAGQQFqIQFBDQwoC0G2ASECIAEgBEYN+gEgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBodUAai0AAEcNJyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM+wELIANBADYCACAGQQFqIQFBDAwnC0G1ASECIAEgBEYN+QEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB6tQAai0AAEcNJiAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM+gELIANBADYCACAGQQFqIQFBAwwmC0G0ASECIAEgBEYN+AEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB6NQAai0AAEcNJSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM+QELIANBADYCACAGQQFqIQFBJgwlCyABIARGBEBBswEhAgz4AQsCQAJAIAEtAABB1ABrDgIAAScLIAFBAWohAUGZASECDN8BCyABQQFqIQFBmgEhAgzeAQtBsgEhAiABIARGDfYBIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQebUAGotAABHDSMgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPcBCyADQQA2AgAgBkEBaiEBQScMIwtBsQEhAiABIARGDfUBIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQeTUAGotAABHDSIgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPYBCyADQQA2AgAgBkEBaiEBQRwMIgtBsAEhAiABIARGDfQBIAMoAgAiACAEIAFraiEFIAEgAGtBBWohBgJAA0AgAS0AACAAQd7UAGotAABHDSEgAEEFRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPUBCyADQQA2AgAgBkEBaiEBQQYMIQtBrwEhAiABIARGDfMBIAMoAgAiACAEIAFraiEFIAEgAGtBBGohBgJAA0AgAS0AACAAQdnUAGotAABHDSAgAEEERg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPQBCyADQQA2AgAgBkEBaiEBQRkMIAsgASAERgRAQa4BIQIM8wELAkACQAJAAkAgAS0AAEEtaw4jACQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkASQkJCQkAiQkJAMkCyABQQFqIQFBjgEhAgzcAQsgAUEBaiEBQY8BIQIM2wELIAFBAWohAUGUASECDNoBCyABQQFqIQFBlQEhAgzZAQtBrQEhAiABIARGDfEBIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQdfUAGotAABHDR4gAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPIBCyADQQA2AgAgBkEBaiEBQQsMHgsgASAERgRAQawBIQIM8QELAkACQCABLQAAQcEAaw4DACABIAsgAUEBaiEBQZABIQIM2AELIAFBAWohAUGTASECDNcBCyABIARGBEBBqwEhAgzwAQsCQAJAIAEtAABBwQBrDg8AHx8fHx8fHx8fHx8fHwEfCyABQQFqIQFBkQEhAgzXAQsgAUEBaiEBQZIBIQIM1gELIAEgBEYEQEGqASECDO8BCyABLQAAQcwARw0cIAFBAWohAUEKDBsLQakBIQIgASAERg3tASADKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEHR1ABqLQAARw0aIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzuAQsgA0EANgIAIAZBAWohAUEeDBoLQagBIQIgASAERg3sASADKAIAIgAgBCABa2ohBSABIABrQQZqIQYCQANAIAEtAAAgAEHK1ABqLQAARw0ZIABBBkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAztAQsgA0EANgIAIAZBAWohAUEVDBkLQacBIQIgASAERg3rASADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHH1ABqLQAARw0YIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzsAQsgA0EANgIAIAZBAWohAUEXDBgLQaYBIQIgASAERg3qASADKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEHB1ABqLQAARw0XIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzrAQsgA0EANgIAIAZBAWohAUEYDBcLIAEgBEYEQEGlASECDOoBCwJAAkAgAS0AAEHJAGsOBwAZGRkZGQEZCyABQQFqIQFBiwEhAgzRAQsgAUEBaiEBQYwBIQIM0AELQaQBIQIgASAERg3oASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGm1QBqLQAARw0VIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzpAQsgA0EANgIAIAZBAWohAUEJDBULQaMBIQIgASAERg3nASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGk1QBqLQAARw0UIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzoAQsgA0EANgIAIAZBAWohAUEfDBQLQaIBIQIgASAERg3mASADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEG+1ABqLQAARw0TIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAznAQsgA0EANgIAIAZBAWohAUECDBMLQaEBIQIgASAERg3lASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYDQCABLQAAIABBvNQAai0AAEcNESAAQQFGDQIgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM5QELIAEgBEYEQEGgASECDOUBC0EBIAEtAABB3wBHDREaIAFBAWohAUGHASECDMsBCyADQQA2AgAgBkEBaiEBQYgBIQIMygELQZ8BIQIgASAERg3iASADKAIAIgAgBCABa2ohBSABIABrQQhqIQYCQANAIAEtAAAgAEGE1QBqLQAARw0PIABBCEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzjAQsgA0EANgIAIAZBAWohAUEpDA8LQZ4BIQIgASAERg3hASADKAIAIgAgBCABa2ohBSABIABrQQNqIQYCQANAIAEtAAAgAEG41ABqLQAARw0OIABBA0YNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAziAQsgA0EANgIAIAZBAWohAUEtDA4LIAEgBEYEQEGdASECDOEBCyABLQAAQcUARw0OIAFBAWohAUGEASECDMcBCyABIARGBEBBnAEhAgzgAQsCQAJAIAEtAABBzABrDggADw8PDw8PAQ8LIAFBAWohAUGCASECDMcBCyABQQFqIQFBgwEhAgzGAQtBmwEhAiABIARGDd4BIAMoAgAiACAEIAFraiEFIAEgAGtBBGohBgJAA0AgAS0AACAAQbPUAGotAABHDQsgAEEERg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADN8BCyADQQA2AgAgBkEBaiEBQSMMCwtBmgEhAiABIARGDd0BIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQbDUAGotAABHDQogAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADN4BCyADQQA2AgAgBkEBaiEBQQAMCgsgASAERgRAQZkBIQIM3QELAkACQCABLQAAQcgAaw4IAAwMDAwMDAEMCyABQQFqIQFB/QAhAgzEAQsgAUEBaiEBQYABIQIMwwELIAEgBEYEQEGYASECDNwBCwJAAkAgAS0AAEHOAGsOAwALAQsLIAFBAWohAUH+ACECDMMBCyABQQFqIQFB/wAhAgzCAQsgASAERgRAQZcBIQIM2wELIAEtAABB2QBHDQggAUEBaiEBQQgMBwtBlgEhAiABIARGDdkBIAMoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQazUAGotAABHDQYgAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADNoBCyADQQA2AgAgBkEBaiEBQQUMBgtBlQEhAiABIARGDdgBIAMoAgAiACAEIAFraiEFIAEgAGtBBWohBgJAA0AgAS0AACAAQabUAGotAABHDQUgAEEFRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADNkBCyADQQA2AgAgBkEBaiEBQRYMBQtBlAEhAiABIARGDdcBIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQaHVAGotAABHDQQgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADNgBCyADQQA2AgAgBkEBaiEBQRAMBAsgASAERgRAQZMBIQIM1wELAkACQCABLQAAQcMAaw4MAAYGBgYGBgYGBgYBBgsgAUEBaiEBQfkAIQIMvgELIAFBAWohAUH6ACECDL0BC0GSASECIAEgBEYN1QEgAygCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABBoNQAai0AAEcNAiAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM1gELIANBADYCACAGQQFqIQFBJAwCCyADQQA2AgAMAgsgASAERgRAQZEBIQIM1AELIAEtAABBzABHDQEgAUEBaiEBQRMLOgApIAMoAgQhACADQQA2AgQgAyAAIAEQLiIADQIMAQtBACECIANBADYCHCADIAE2AhQgA0H+HzYCECADQQY2AgwM0QELQfgAIQIMtwELIANBkAE2AhwgAyABNgIUIAMgADYCDEEAIQIMzwELQQAhAAJAIAMoAjgiAkUNACACKAJAIgJFDQAgAyACEQAAIQALIABFDQAgAEEVRg0BIANBADYCHCADIAE2AhQgA0GCDzYCECADQSA2AgxBACECDM4BC0H3ACECDLQBCyADQY8BNgIcIAMgATYCFCADQewbNgIQIANBFTYCDEEAIQIMzAELIAEgBEYEQEGPASECDMwBCwJAIAEtAABBIEYEQCABQQFqIQEMAQsgA0EANgIcIAMgATYCFCADQZsfNgIQIANBBjYCDEEAIQIMzAELQQIhAgyyAQsDQCABLQAAQSBHDQIgBCABQQFqIgFHDQALQY4BIQIMygELIAEgBEYEQEGNASECDMoBCwJAIAEtAABBCWsOBEoAAEoAC0H1ACECDLABCyADLQApQQVGBEBB9gAhAgywAQtB9AAhAgyvAQsgASAERgRAQYwBIQIMyAELIANBEDYCCCADIAE2AgQMCgsgASAERgRAQYsBIQIMxwELAkAgAS0AAEEJaw4ERwAARwALQfMAIQIMrQELIAEgBEcEQCADQRA2AgggAyABNgIEQfEAIQIMrQELQYoBIQIMxQELAkAgASAERwRAA0AgAS0AAEGg0ABqLQAAIgBBA0cEQAJAIABBAWsOAkkABAtB8AAhAgyvAQsgBCABQQFqIgFHDQALQYgBIQIMxgELQYgBIQIMxQELIANBADYCHCADIAE2AhQgA0HbIDYCECADQQc2AgxBACECDMQBCyABIARGBEBBiQEhAgzEAQsCQAJAAkAgAS0AAEGg0gBqLQAAQQFrDgNGAgABC0HyACECDKwBCyADQQA2AhwgAyABNgIUIANBtBI2AhAgA0EHNgIMQQAhAgzEAQtB6gAhAgyqAQsgASAERwRAIAFBAWohAUHvACECDKoBC0GHASECDMIBCyAEIAEiAEYEQEGGASECDMIBCyAALQAAIgFBL0YEQCAAQQFqIQFB7gAhAgypAQsgAUEJayICQRdLDQEgACEBQQEgAnRBm4CABHENQQwBCyAEIAEiAEYEQEGFASECDMEBCyAALQAAQS9HDQAgAEEBaiEBDAMLQQAhAiADQQA2AhwgAyAANgIUIANB2yA2AhAgA0EHNgIMDL8BCwJAAkACQAJAAkADQCABLQAAQaDOAGotAAAiAEEFRwRAAkACQCAAQQFrDghHBQYHCAAEAQgLQesAIQIMrQELIAFBAWohAUHtACECDKwBCyAEIAFBAWoiAUcNAAtBhAEhAgzDAQsgAUEBagwUCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNHiADQdsANgIcIAMgATYCFCADIAA2AgxBACECDMEBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNHiADQd0ANgIcIAMgATYCFCADIAA2AgxBACECDMABCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNHiADQfoANgIcIAMgATYCFCADIAA2AgxBACECDL8BCyADQQA2AhwgAyABNgIUIANB+Q82AhAgA0EHNgIMQQAhAgy+AQsgASAERgRAQYMBIQIMvgELAkAgAS0AAEGgzgBqLQAAQQFrDgg+BAUGAAgCAwcLIAFBAWohAQtBAyECDKMBCyABQQFqDA0LQQAhAiADQQA2AhwgA0HREjYCECADQQc2AgwgAyABQQFqNgIUDLoBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNFiADQdsANgIcIAMgATYCFCADIAA2AgxBACECDLkBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNFiADQd0ANgIcIAMgATYCFCADIAA2AgxBACECDLgBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNFiADQfoANgIcIAMgATYCFCADIAA2AgxBACECDLcBCyADQQA2AhwgAyABNgIUIANB+Q82AhAgA0EHNgIMQQAhAgy2AQtB7AAhAgycAQsgASAERgRAQYIBIQIMtQELIAFBAWoMAgsgASAERgRAQYEBIQIMtAELIAFBAWoMAQsgASAERg0BIAFBAWoLIQFBBCECDJgBC0GAASECDLABCwNAIAEtAABBoMwAai0AACIAQQJHBEAgAEEBRwRAQekAIQIMmQELDDELIAQgAUEBaiIBRw0AC0H/ACECDK8BCyABIARGBEBB/gAhAgyvAQsCQCABLQAAQQlrDjcvAwYvBAYGBgYGBgYGBgYGBgYGBgYGBgUGBgIGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYABgsgAUEBagshAUEFIQIMlAELIAFBAWoMBgsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQggA0HbADYCHCADIAE2AhQgAyAANgIMQQAhAgyrAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQggA0HdADYCHCADIAE2AhQgAyAANgIMQQAhAgyqAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQggA0H6ADYCHCADIAE2AhQgAyAANgIMQQAhAgypAQsgA0EANgIcIAMgATYCFCADQY0UNgIQIANBBzYCDEEAIQIMqAELAkACQAJAAkADQCABLQAAQaDKAGotAAAiAEEFRwRAAkAgAEEBaw4GLgMEBQYABgtB6AAhAgyUAQsgBCABQQFqIgFHDQALQf0AIQIMqwELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0HIANB2wA2AhwgAyABNgIUIAMgADYCDEEAIQIMqgELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0HIANB3QA2AhwgAyABNgIUIAMgADYCDEEAIQIMqQELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0HIANB+gA2AhwgAyABNgIUIAMgADYCDEEAIQIMqAELIANBADYCHCADIAE2AhQgA0HkCDYCECADQQc2AgxBACECDKcBCyABIARGDQEgAUEBagshAUEGIQIMjAELQfwAIQIMpAELAkACQAJAAkADQCABLQAAQaDIAGotAAAiAEEFRwRAIABBAWsOBCkCAwQFCyAEIAFBAWoiAUcNAAtB+wAhAgynAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQMgA0HbADYCHCADIAE2AhQgAyAANgIMQQAhAgymAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQMgA0HdADYCHCADIAE2AhQgAyAANgIMQQAhAgylAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQMgA0H6ADYCHCADIAE2AhQgAyAANgIMQQAhAgykAQsgA0EANgIcIAMgATYCFCADQbwKNgIQIANBBzYCDEEAIQIMowELQc8AIQIMiQELQdEAIQIMiAELQecAIQIMhwELIAEgBEYEQEH6ACECDKABCwJAIAEtAABBCWsOBCAAACAACyABQQFqIQFB5gAhAgyGAQsgASAERgRAQfkAIQIMnwELAkAgAS0AAEEJaw4EHwAAHwALQQAhAAJAIAMoAjgiAkUNACACKAI4IgJFDQAgAyACEQAAIQALIABFBEBB4gEhAgyGAQsgAEEVRwRAIANBADYCHCADIAE2AhQgA0HJDTYCECADQRo2AgxBACECDJ8BCyADQfgANgIcIAMgATYCFCADQeoaNgIQIANBFTYCDEEAIQIMngELIAEgBEcEQCADQQ02AgggAyABNgIEQeQAIQIMhQELQfcAIQIMnQELIAEgBEYEQEH2ACECDJ0BCwJAAkACQCABLQAAQcgAaw4LAAELCwsLCwsLCwILCyABQQFqIQFB3QAhAgyFAQsgAUEBaiEBQeAAIQIMhAELIAFBAWohAUHjACECDIMBC0H1ACECIAEgBEYNmwEgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBtdUAai0AAEcNCCAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMnAELIAMoAgQhACADQgA3AwAgAyAAIAZBAWoiARArIgAEQCADQfQANgIcIAMgATYCFCADIAA2AgxBACECDJwBC0HiACECDIIBC0EAIQACQCADKAI4IgJFDQAgAigCNCICRQ0AIAMgAhEAACEACwJAIAAEQCAAQRVGDQEgA0EANgIcIAMgATYCFCADQeoNNgIQIANBJjYCDEEAIQIMnAELQeEAIQIMggELIANB8wA2AhwgAyABNgIUIANBgBs2AhAgA0EVNgIMQQAhAgyaAQsgAy0AKSIAQSNrQQtJDQkCQCAAQQZLDQBBASAAdEHKAHFFDQAMCgtBACECIANBADYCHCADIAE2AhQgA0HtCTYCECADQQg2AgwMmQELQfIAIQIgASAERg2YASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGz1QBqLQAARw0FIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyZAQsgAygCBCEAIANCADcDACADIAAgBkEBaiIBECsiAARAIANB8QA2AhwgAyABNgIUIAMgADYCDEEAIQIMmQELQd8AIQIMfwtBACEAAkAgAygCOCICRQ0AIAIoAjQiAkUNACADIAIRAAAhAAsCQCAABEAgAEEVRg0BIANBADYCHCADIAE2AhQgA0HqDTYCECADQSY2AgxBACECDJkBC0HeACECDH8LIANB8AA2AhwgAyABNgIUIANBgBs2AhAgA0EVNgIMQQAhAgyXAQsgAy0AKUEhRg0GIANBADYCHCADIAE2AhQgA0GRCjYCECADQQg2AgxBACECDJYBC0HvACECIAEgBEYNlQEgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBsNUAai0AAEcNAiAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMlgELIAMoAgQhACADQgA3AwAgAyAAIAZBAWoiARArIgBFDQIgA0HtADYCHCADIAE2AhQgAyAANgIMQQAhAgyVAQsgA0EANgIACyADKAIEIQAgA0EANgIEIAMgACABECsiAEUNgAEgA0HuADYCHCADIAE2AhQgAyAANgIMQQAhAgyTAQtB3AAhAgx5C0EAIQACQCADKAI4IgJFDQAgAigCNCICRQ0AIAMgAhEAACEACwJAIAAEQCAAQRVGDQEgA0EANgIcIAMgATYCFCADQeoNNgIQIANBJjYCDEEAIQIMkwELQdsAIQIMeQsgA0HsADYCHCADIAE2AhQgA0GAGzYCECADQRU2AgxBACECDJEBCyADLQApIgBBI0kNACAAQS5GDQAgA0EANgIcIAMgATYCFCADQckJNgIQIANBCDYCDEEAIQIMkAELQdoAIQIMdgsgASAERgRAQesAIQIMjwELAkAgAS0AAEEvRgRAIAFBAWohAQwBCyADQQA2AhwgAyABNgIUIANBsjg2AhAgA0EINgIMQQAhAgyPAQtB2QAhAgx1CyABIARHBEAgA0EONgIIIAMgATYCBEHYACECDHULQeoAIQIMjQELIAEgBEYEQEHpACECDI0BCyABLQAAQTBrIgBB/wFxQQpJBEAgAyAAOgAqIAFBAWohAUHXACECDHQLIAMoAgQhACADQQA2AgQgAyAAIAEQLyIARQ16IANB6AA2AhwgAyABNgIUIAMgADYCDEEAIQIMjAELIAEgBEYEQEHnACECDIwBCwJAIAEtAABBLkYEQCABQQFqIQEMAQsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDXsgA0HmADYCHCADIAE2AhQgAyAANgIMQQAhAgyMAQtB1gAhAgxyCyABIARGBEBB5QAhAgyLAQtBACEAQQEhBUEBIQdBACECAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkAgAS0AAEEwaw4KCgkAAQIDBAUGCAsLQQIMBgtBAwwFC0EEDAQLQQUMAwtBBgwCC0EHDAELQQgLIQJBACEFQQAhBwwCC0EJIQJBASEAQQAhBUEAIQcMAQtBACEFQQEhAgsgAyACOgArIAFBAWohAQJAAkAgAy0ALkEQcQ0AAkACQAJAIAMtACoOAwEAAgQLIAdFDQMMAgsgAA0BDAILIAVFDQELIAMoAgQhACADQQA2AgQgAyAAIAEQLyIARQ0CIANB4gA2AhwgAyABNgIUIAMgADYCDEEAIQIMjQELIAMoAgQhACADQQA2AgQgAyAAIAEQLyIARQ19IANB4wA2AhwgAyABNgIUIAMgADYCDEEAIQIMjAELIAMoAgQhACADQQA2AgQgAyAAIAEQLyIARQ17IANB5AA2AhwgAyABNgIUIAMgADYCDAyLAQtB1AAhAgxxCyADLQApQSJGDYYBQdMAIQIMcAtBACEAAkAgAygCOCICRQ0AIAIoAkQiAkUNACADIAIRAAAhAAsgAEUEQEHVACECDHALIABBFUcEQCADQQA2AhwgAyABNgIUIANBpA02AhAgA0EhNgIMQQAhAgyJAQsgA0HhADYCHCADIAE2AhQgA0HQGjYCECADQRU2AgxBACECDIgBCyABIARGBEBB4AAhAgyIAQsCQAJAAkACQAJAIAEtAABBCmsOBAEEBAAECyABQQFqIQEMAQsgAUEBaiEBIANBL2otAABBAXFFDQELQdIAIQIMcAsgA0EANgIcIAMgATYCFCADQbYRNgIQIANBCTYCDEEAIQIMiAELIANBADYCHCADIAE2AhQgA0G2ETYCECADQQk2AgxBACECDIcBCyABIARGBEBB3wAhAgyHAQsgAS0AAEEKRgRAIAFBAWohAQwJCyADLQAuQcAAcQ0IIANBADYCHCADIAE2AhQgA0G2ETYCECADQQI2AgxBACECDIYBCyABIARGBEBB3QAhAgyGAQsgAS0AACICQQ1GBEAgAUEBaiEBQdAAIQIMbQsgASEAIAJBCWsOBAUBAQUBCyAEIAEiAEYEQEHcACECDIUBCyAALQAAQQpHDQAgAEEBagwCC0EAIQIgA0EANgIcIAMgADYCFCADQcotNgIQIANBBzYCDAyDAQsgASAERgRAQdsAIQIMgwELAkAgAS0AAEEJaw4EAwAAAwALIAFBAWoLIQFBzgAhAgxoCyABIARGBEBB2gAhAgyBAQsgAS0AAEEJaw4EAAEBAAELQQAhAiADQQA2AhwgA0GaEjYCECADQQc2AgwgAyABQQFqNgIUDH8LIANBgBI7ASpBACEAAkAgAygCOCICRQ0AIAIoAjgiAkUNACADIAIRAAAhAAsgAEUNACAAQRVHDQEgA0HZADYCHCADIAE2AhQgA0HqGjYCECADQRU2AgxBACECDH4LQc0AIQIMZAsgA0EANgIcIAMgATYCFCADQckNNgIQIANBGjYCDEEAIQIMfAsgASAERgRAQdkAIQIMfAsgAS0AAEEgRw09IAFBAWohASADLQAuQQFxDT0gA0EANgIcIAMgATYCFCADQcIcNgIQIANBHjYCDEEAIQIMewsgASAERgRAQdgAIQIMewsCQAJAAkACQAJAIAEtAAAiAEEKaw4EAgMDAAELIAFBAWohAUEsIQIMZQsgAEE6Rw0BIANBADYCHCADIAE2AhQgA0HnETYCECADQQo2AgxBACECDH0LIAFBAWohASADQS9qLQAAQQFxRQ1zIAMtADJBgAFxRQRAIANBMmohAiADEDVBACEAAkAgAygCOCIGRQ0AIAYoAigiBkUNACADIAYRAAAhAAsCQAJAIAAOFk1MSwEBAQEBAQEBAQEBAQEBAQEBAQABCyADQSk2AhwgAyABNgIUIANBrBk2AhAgA0EVNgIMQQAhAgx+CyADQQA2AhwgAyABNgIUIANB5Qs2AhAgA0ERNgIMQQAhAgx9C0EAIQACQCADKAI4IgJFDQAgAigCXCICRQ0AIAMgAhEAACEACyAARQ1ZIABBFUcNASADQQU2AhwgAyABNgIUIANBmxs2AhAgA0EVNgIMQQAhAgx8C0HLACECDGILQQAhAiADQQA2AhwgAyABNgIUIANBkA42AhAgA0EUNgIMDHoLIAMgAy8BMkGAAXI7ATIMOwsgASAERwRAIANBETYCCCADIAE2AgRBygAhAgxgC0HXACECDHgLIAEgBEYEQEHWACECDHgLAkACQAJAAkAgAS0AACIAQSByIAAgAEHBAGtB/wFxQRpJG0H/AXFB4wBrDhMAQEBAQEBAQEBAQEBAAUBAQAIDQAsgAUEBaiEBQcYAIQIMYQsgAUEBaiEBQccAIQIMYAsgAUEBaiEBQcgAIQIMXwsgAUEBaiEBQckAIQIMXgtB1QAhAiAEIAEiAEYNdiAEIAFrIAMoAgAiAWohBiAAIAFrQQVqIQcDQCABQZDIAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQhBBCABQQVGDQoaIAFBAWohASAEIABBAWoiAEcNAAsgAyAGNgIADHYLQdQAIQIgBCABIgBGDXUgBCABayADKAIAIgFqIQYgACABa0EPaiEHA0AgAUGAyABqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0HQQMgAUEPRg0JGiABQQFqIQEgBCAAQQFqIgBHDQALIAMgBjYCAAx1C0HTACECIAQgASIARg10IAQgAWsgAygCACIBaiEGIAAgAWtBDmohBwNAIAFB4scAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNBiABQQ5GDQcgAUEBaiEBIAQgAEEBaiIARw0ACyADIAY2AgAMdAtB0gAhAiAEIAEiAEYNcyAEIAFrIAMoAgAiAWohBSAAIAFrQQFqIQYDQCABQeDHAGotAAAgAC0AACIHQSByIAcgB0HBAGtB/wFxQRpJG0H/AXFHDQUgAUEBRg0CIAFBAWohASAEIABBAWoiAEcNAAsgAyAFNgIADHMLIAEgBEYEQEHRACECDHMLAkACQCABLQAAIgBBIHIgACAAQcEAa0H/AXFBGkkbQf8BcUHuAGsOBwA5OTk5OQE5CyABQQFqIQFBwwAhAgxaCyABQQFqIQFBxAAhAgxZCyADQQA2AgAgBkEBaiEBQcUAIQIMWAtB0AAhAiAEIAEiAEYNcCAEIAFrIAMoAgAiAWohBiAAIAFrQQlqIQcDQCABQdbHAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQJBAiABQQlGDQQaIAFBAWohASAEIABBAWoiAEcNAAsgAyAGNgIADHALQc8AIQIgBCABIgBGDW8gBCABayADKAIAIgFqIQYgACABa0EFaiEHA0AgAUHQxwBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBBUYNAiABQQFqIQEgBCAAQQFqIgBHDQALIAMgBjYCAAxvCyAAIQEgA0EANgIADDMLQQELOgAsIANBADYCACAHQQFqIQELQS0hAgxSCwJAA0AgAS0AAEHQxQBqLQAAQQFHDQEgBCABQQFqIgFHDQALQc0AIQIMawtBwgAhAgxRCyABIARGBEBBzAAhAgxqCyABLQAAQTpGBEAgAygCBCEAIANBADYCBCADIAAgARAwIgBFDTMgA0HLADYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgxqCyADQQA2AhwgAyABNgIUIANB5xE2AhAgA0EKNgIMQQAhAgxpCwJAAkAgAy0ALEECaw4CAAEnCyADQTNqLQAAQQJxRQ0mIAMtAC5BAnENJiADQQA2AhwgAyABNgIUIANBphQ2AhAgA0ELNgIMQQAhAgxpCyADLQAyQSBxRQ0lIAMtAC5BAnENJSADQQA2AhwgAyABNgIUIANBvRM2AhAgA0EPNgIMQQAhAgxoC0EAIQACQCADKAI4IgJFDQAgAigCSCICRQ0AIAMgAhEAACEACyAARQRAQcEAIQIMTwsgAEEVRwRAIANBADYCHCADIAE2AhQgA0GmDzYCECADQRw2AgxBACECDGgLIANBygA2AhwgAyABNgIUIANBhRw2AhAgA0EVNgIMQQAhAgxnCyABIARHBEAgASECA0AgBCACIgFrQRBOBEAgAUEQaiEC/Qz/////////////////////IAH9AAAAIg1BB/1sIA39DODg4ODg4ODg4ODg4ODg4OD9bv0MX19fX19fX19fX19fX19fX/0mIA39DAkJCQkJCQkJCQkJCQkJCQn9I/1Q/VL9ZEF/c2giAEEQRg0BIAAgAWohAQwYCyABIARGBEBBxAAhAgxpCyABLQAAQcDBAGotAABBAUcNFyAEIAFBAWoiAkcNAAtBxAAhAgxnC0HEACECDGYLIAEgBEcEQANAAkAgAS0AACIAQSByIAAgAEHBAGtB/wFxQRpJG0H/AXEiAEEJRg0AIABBIEYNAAJAAkACQAJAIABB4wBrDhMAAwMDAwMDAwEDAwMDAwMDAwMCAwsgAUEBaiEBQTYhAgxSCyABQQFqIQFBNyECDFELIAFBAWohAUE4IQIMUAsMFQsgBCABQQFqIgFHDQALQTwhAgxmC0E8IQIMZQsgASAERgRAQcgAIQIMZQsgA0ESNgIIIAMgATYCBAJAAkACQAJAAkAgAy0ALEEBaw4EFAABAgkLIAMtADJBIHENA0HgASECDE8LAkAgAy8BMiIAQQhxRQ0AIAMtAChBAUcNACADLQAuQQhxRQ0CCyADIABB9/sDcUGABHI7ATIMCwsgAyADLwEyQRByOwEyDAQLIANBADYCBCADIAEgARAxIgAEQCADQcEANgIcIAMgADYCDCADIAFBAWo2AhRBACECDGYLIAFBAWohAQxYCyADQQA2AhwgAyABNgIUIANB9BM2AhAgA0EENgIMQQAhAgxkC0HHACECIAEgBEYNYyADKAIAIgAgBCABa2ohBSABIABrQQZqIQYCQANAIABBwMUAai0AACABLQAAQSByRw0BIABBBkYNSiAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAxkCyADQQA2AgAMBQsCQCABIARHBEADQCABLQAAQcDDAGotAAAiAEEBRwRAIABBAkcNAyABQQFqIQEMBQsgBCABQQFqIgFHDQALQcUAIQIMZAtBxQAhAgxjCwsgA0EAOgAsDAELQQshAgxHC0E/IQIMRgsCQAJAA0AgAS0AACIAQSBHBEACQCAAQQprDgQDBQUDAAsgAEEsRg0DDAQLIAQgAUEBaiIBRw0AC0HGACECDGALIANBCDoALAwOCyADLQAoQQFHDQIgAy0ALkEIcQ0CIAMoAgQhACADQQA2AgQgAyAAIAEQMSIABEAgA0HCADYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgxfCyABQQFqIQEMUAtBOyECDEQLAkADQCABLQAAIgBBIEcgAEEJR3ENASAEIAFBAWoiAUcNAAtBwwAhAgxdCwtBPCECDEILAkACQCABIARHBEADQCABLQAAIgBBIEcEQCAAQQprDgQDBAQDBAsgBCABQQFqIgFHDQALQT8hAgxdC0E/IQIMXAsgAyADLwEyQSByOwEyDAoLIAMoAgQhACADQQA2AgQgAyAAIAEQMSIARQ1OIANBPjYCHCADIAE2AhQgAyAANgIMQQAhAgxaCwJAIAEgBEcEQANAIAEtAABBwMMAai0AACIAQQFHBEAgAEECRg0DDAwLIAQgAUEBaiIBRw0AC0E3IQIMWwtBNyECDFoLIAFBAWohAQwEC0E7IQIgBCABIgBGDVggBCABayADKAIAIgFqIQYgACABa0EFaiEHAkADQCABQZDIAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQEgAUEFRgRAQQchAQw/CyABQQFqIQEgBCAAQQFqIgBHDQALIAMgBjYCAAxZCyADQQA2AgAgACEBDAULQTohAiAEIAEiAEYNVyAEIAFrIAMoAgAiAWohBiAAIAFrQQhqIQcCQANAIAFBtMEAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNASABQQhGBEBBBSEBDD4LIAFBAWohASAEIABBAWoiAEcNAAsgAyAGNgIADFgLIANBADYCACAAIQEMBAtBOSECIAQgASIARg1WIAQgAWsgAygCACIBaiEGIAAgAWtBA2ohBwJAA0AgAUGwwQBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBA0YEQEEGIQEMPQsgAUEBaiEBIAQgAEEBaiIARw0ACyADIAY2AgAMVwsgA0EANgIAIAAhAQwDCwJAA0AgAS0AACIAQSBHBEAgAEEKaw4EBwQEBwILIAQgAUEBaiIBRw0AC0E4IQIMVgsgAEEsRw0BIAFBAWohAEEBIQECQAJAAkACQAJAIAMtACxBBWsOBAMBAgQACyAAIQEMBAtBAiEBDAELQQQhAQsgA0EBOgAsIAMgAy8BMiABcjsBMiAAIQEMAQsgAyADLwEyQQhyOwEyIAAhAQtBPiECDDsLIANBADoALAtBOSECDDkLIAEgBEYEQEE2IQIMUgsCQAJAAkACQAJAIAEtAABBCmsOBAACAgECCyADKAIEIQAgA0EANgIEIAMgACABEDEiAEUNAiADQTM2AhwgAyABNgIUIAMgADYCDEEAIQIMVQsgAygCBCEAIANBADYCBCADIAAgARAxIgBFBEAgAUEBaiEBDAYLIANBMjYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgxUCyADLQAuQQFxBEBB3wEhAgw7CyADKAIEIQAgA0EANgIEIAMgACABEDEiAA0BDEkLQTQhAgw5CyADQTU2AhwgAyABNgIUIAMgADYCDEEAIQIMUQtBNSECDDcLIANBL2otAABBAXENACADQQA2AhwgAyABNgIUIANB6xY2AhAgA0EZNgIMQQAhAgxPC0EzIQIMNQsgASAERgRAQTIhAgxOCwJAIAEtAABBCkYEQCABQQFqIQEMAQsgA0EANgIcIAMgATYCFCADQZIXNgIQIANBAzYCDEEAIQIMTgtBMiECDDQLIAEgBEYEQEExIQIMTQsCQCABLQAAIgBBCUYNACAAQSBGDQBBASECAkAgAy0ALEEFaw4EBgQFAA0LIAMgAy8BMkEIcjsBMgwMCyADLQAuQQFxRQ0BIAMtACxBCEcNACADQQA6ACwLQT0hAgwyCyADQQA2AhwgAyABNgIUIANBwhY2AhAgA0EKNgIMQQAhAgxKC0ECIQIMAQtBBCECCyADQQE6ACwgAyADLwEyIAJyOwEyDAYLIAEgBEYEQEEwIQIMRwsgAS0AAEEKRgRAIAFBAWohAQwBCyADLQAuQQFxDQAgA0EANgIcIAMgATYCFCADQdwoNgIQIANBAjYCDEEAIQIMRgtBMCECDCwLIAFBAWohAUExIQIMKwsgASAERgRAQS8hAgxECyABLQAAIgBBCUcgAEEgR3FFBEAgAUEBaiEBIAMtAC5BAXENASADQQA2AhwgAyABNgIUIANBlxA2AhAgA0EKNgIMQQAhAgxEC0EBIQICQAJAAkACQAJAAkAgAy0ALEECaw4HBQQEAwECAAQLIAMgAy8BMkEIcjsBMgwDC0ECIQIMAQtBBCECCyADQQE6ACwgAyADLwEyIAJyOwEyC0EvIQIMKwsgA0EANgIcIAMgATYCFCADQYQTNgIQIANBCzYCDEEAIQIMQwtB4QEhAgwpCyABIARGBEBBLiECDEILIANBADYCBCADQRI2AgggAyABIAEQMSIADQELQS4hAgwnCyADQS02AhwgAyABNgIUIAMgADYCDEEAIQIMPwtBACEAAkAgAygCOCICRQ0AIAIoAkwiAkUNACADIAIRAAAhAAsgAEUNACAAQRVHDQEgA0HYADYCHCADIAE2AhQgA0GzGzYCECADQRU2AgxBACECDD4LQcwAIQIMJAsgA0EANgIcIAMgATYCFCADQbMONgIQIANBHTYCDEEAIQIMPAsgASAERgRAQc4AIQIMPAsgAS0AACIAQSBGDQIgAEE6Rg0BCyADQQA6ACxBCSECDCELIAMoAgQhACADQQA2AgQgAyAAIAEQMCIADQEMAgsgAy0ALkEBcQRAQd4BIQIMIAsgAygCBCEAIANBADYCBCADIAAgARAwIgBFDQIgA0EqNgIcIAMgADYCDCADIAFBAWo2AhRBACECDDgLIANBywA2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIMNwsgAUEBaiEBQcAAIQIMHQsgAUEBaiEBDCwLIAEgBEYEQEErIQIMNQsCQCABLQAAQQpGBEAgAUEBaiEBDAELIAMtAC5BwABxRQ0GCyADLQAyQYABcQRAQQAhAAJAIAMoAjgiAkUNACACKAJcIgJFDQAgAyACEQAAIQALIABFDRIgAEEVRgRAIANBBTYCHCADIAE2AhQgA0GbGzYCECADQRU2AgxBACECDDYLIANBADYCHCADIAE2AhQgA0GQDjYCECADQRQ2AgxBACECDDULIANBMmohAiADEDVBACEAAkAgAygCOCIGRQ0AIAYoAigiBkUNACADIAYRAAAhAAsgAA4WAgEABAQEBAQEBAQEBAQEBAQEBAQEAwQLIANBAToAMAsgAiACLwEAQcAAcjsBAAtBKyECDBgLIANBKTYCHCADIAE2AhQgA0GsGTYCECADQRU2AgxBACECDDALIANBADYCHCADIAE2AhQgA0HlCzYCECADQRE2AgxBACECDC8LIANBADYCHCADIAE2AhQgA0GlCzYCECADQQI2AgxBACECDC4LQQEhByADLwEyIgVBCHFFBEAgAykDIEIAUiEHCwJAIAMtADAEQEEBIQAgAy0AKUEFRg0BIAVBwABxRSAHcUUNAQsCQCADLQAoIgJBAkYEQEEBIQAgAy8BNCIGQeUARg0CQQAhACAFQcAAcQ0CIAZB5ABGDQIgBkHmAGtBAkkNAiAGQcwBRg0CIAZBsAJGDQIMAQtBACEAIAVBwABxDQELQQIhACAFQQhxDQAgBUGABHEEQAJAIAJBAUcNACADLQAuQQpxDQBBBSEADAILQQQhAAwBCyAFQSBxRQRAIAMQNkEAR0ECdCEADAELQQBBAyADKQMgUBshAAsgAEEBaw4FAgAHAQMEC0ERIQIMEwsgA0EBOgAxDCkLQQAhAgJAIAMoAjgiAEUNACAAKAIwIgBFDQAgAyAAEQAAIQILIAJFDSYgAkEVRgRAIANBAzYCHCADIAE2AhQgA0HSGzYCECADQRU2AgxBACECDCsLQQAhAiADQQA2AhwgAyABNgIUIANB3Q42AhAgA0ESNgIMDCoLIANBADYCHCADIAE2AhQgA0H5IDYCECADQQ82AgxBACECDCkLQQAhAAJAIAMoAjgiAkUNACACKAIwIgJFDQAgAyACEQAAIQALIAANAQtBDiECDA4LIABBFUYEQCADQQI2AhwgAyABNgIUIANB0hs2AhAgA0EVNgIMQQAhAgwnCyADQQA2AhwgAyABNgIUIANB3Q42AhAgA0ESNgIMQQAhAgwmC0EqIQIMDAsgASAERwRAIANBCTYCCCADIAE2AgRBKSECDAwLQSYhAgwkCyADIAMpAyAiDCAEIAFrrSIKfSILQgAgCyAMWBs3AyAgCiAMVARAQSUhAgwkCyADKAIEIQAgA0EANgIEIAMgACABIAynaiIBEDIiAEUNACADQQU2AhwgAyABNgIUIAMgADYCDEEAIQIMIwtBDyECDAkLQgAhCgJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCABLQAAQTBrDjcXFgABAgMEBQYHFBQUFBQUFAgJCgsMDRQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUDg8QERITFAtCAiEKDBYLQgMhCgwVC0IEIQoMFAtCBSEKDBMLQgYhCgwSC0IHIQoMEQtCCCEKDBALQgkhCgwPC0IKIQoMDgtCCyEKDA0LQgwhCgwMC0INIQoMCwtCDiEKDAoLQg8hCgwJC0IKIQoMCAtCCyEKDAcLQgwhCgwGC0INIQoMBQtCDiEKDAQLQg8hCgwDCyADQQA2AhwgAyABNgIUIANBnxU2AhAgA0EMNgIMQQAhAgwhCyABIARGBEBBIiECDCELQgAhCgJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAS0AAEEwaw43FRQAAQIDBAUGBxYWFhYWFhYICQoLDA0WFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFg4PEBESExYLQgIhCgwUC0IDIQoMEwtCBCEKDBILQgUhCgwRC0IGIQoMEAtCByEKDA8LQgghCgwOC0IJIQoMDQtCCiEKDAwLQgshCgwLC0IMIQoMCgtCDSEKDAkLQg4hCgwIC0IPIQoMBwtCCiEKDAYLQgshCgwFC0IMIQoMBAtCDSEKDAMLQg4hCgwCC0IPIQoMAQtCASEKCyABQQFqIQEgAykDICILQv//////////D1gEQCADIAtCBIYgCoQ3AyAMAgsgA0EANgIcIAMgATYCFCADQbUJNgIQIANBDDYCDEEAIQIMHgtBJyECDAQLQSghAgwDCyADIAE6ACwgA0EANgIAIAdBAWohAUEMIQIMAgsgA0EANgIAIAZBAWohAUEKIQIMAQsgAUEBaiEBQQghAgwACwALQQAhAiADQQA2AhwgAyABNgIUIANBsjg2AhAgA0EINgIMDBcLQQAhAiADQQA2AhwgAyABNgIUIANBgxE2AhAgA0EJNgIMDBYLQQAhAiADQQA2AhwgAyABNgIUIANB3wo2AhAgA0EJNgIMDBULQQAhAiADQQA2AhwgAyABNgIUIANB7RA2AhAgA0EJNgIMDBQLQQAhAiADQQA2AhwgAyABNgIUIANB0hE2AhAgA0EJNgIMDBMLQQAhAiADQQA2AhwgAyABNgIUIANBsjg2AhAgA0EINgIMDBILQQAhAiADQQA2AhwgAyABNgIUIANBgxE2AhAgA0EJNgIMDBELQQAhAiADQQA2AhwgAyABNgIUIANB3wo2AhAgA0EJNgIMDBALQQAhAiADQQA2AhwgAyABNgIUIANB7RA2AhAgA0EJNgIMDA8LQQAhAiADQQA2AhwgAyABNgIUIANB0hE2AhAgA0EJNgIMDA4LQQAhAiADQQA2AhwgAyABNgIUIANBuRc2AhAgA0EPNgIMDA0LQQAhAiADQQA2AhwgAyABNgIUIANBuRc2AhAgA0EPNgIMDAwLQQAhAiADQQA2AhwgAyABNgIUIANBmRM2AhAgA0ELNgIMDAsLQQAhAiADQQA2AhwgAyABNgIUIANBnQk2AhAgA0ELNgIMDAoLQQAhAiADQQA2AhwgAyABNgIUIANBlxA2AhAgA0EKNgIMDAkLQQAhAiADQQA2AhwgAyABNgIUIANBsRA2AhAgA0EKNgIMDAgLQQAhAiADQQA2AhwgAyABNgIUIANBux02AhAgA0ECNgIMDAcLQQAhAiADQQA2AhwgAyABNgIUIANBlhY2AhAgA0ECNgIMDAYLQQAhAiADQQA2AhwgAyABNgIUIANB+Rg2AhAgA0ECNgIMDAULQQAhAiADQQA2AhwgAyABNgIUIANBxBg2AhAgA0ECNgIMDAQLIANBAjYCHCADIAE2AhQgA0GpHjYCECADQRY2AgxBACECDAMLQd4AIQIgASAERg0CIAlBCGohByADKAIAIQUCQAJAIAEgBEcEQCAFQZbIAGohCCAEIAVqIAFrIQYgBUF/c0EKaiIFIAFqIQADQCABLQAAIAgtAABHBEBBAiEIDAMLIAVFBEBBACEIIAAhAQwDCyAFQQFrIQUgCEEBaiEIIAQgAUEBaiIBRw0ACyAGIQUgBCEBCyAHQQE2AgAgAyAFNgIADAELIANBADYCACAHIAg2AgALIAcgATYCBCAJKAIMIQACQAJAIAkoAghBAWsOAgQBAAsgA0EANgIcIANBwh42AhAgA0EXNgIMIAMgAEEBajYCFEEAIQIMAwsgA0EANgIcIAMgADYCFCADQdceNgIQIANBCTYCDEEAIQIMAgsgASAERgRAQSghAgwCCyADQQk2AgggAyABNgIEQSchAgwBCyABIARGBEBBASECDAELA0ACQAJAAkAgAS0AAEEKaw4EAAEBAAELIAFBAWohAQwBCyABQQFqIQEgAy0ALkEgcQ0AQQAhAiADQQA2AhwgAyABNgIUIANBoSE2AhAgA0EFNgIMDAILQQEhAiABIARHDQALCyAJQRBqJAAgAkUEQCADKAIMIQAMAQsgAyACNgIcQQAhACADKAIEIgFFDQAgAyABIAQgAygCCBEBACIBRQ0AIAMgBDYCFCADIAE2AgwgASEACyAAC74CAQJ/IABBADoAACAAQeQAaiIBQQFrQQA6AAAgAEEAOgACIABBADoAASABQQNrQQA6AAAgAUECa0EAOgAAIABBADoAAyABQQRrQQA6AABBACAAa0EDcSIBIABqIgBBADYCAEHkACABa0F8cSICIABqIgFBBGtBADYCAAJAIAJBCUkNACAAQQA2AgggAEEANgIEIAFBCGtBADYCACABQQxrQQA2AgAgAkEZSQ0AIABBADYCGCAAQQA2AhQgAEEANgIQIABBADYCDCABQRBrQQA2AgAgAUEUa0EANgIAIAFBGGtBADYCACABQRxrQQA2AgAgAiAAQQRxQRhyIgJrIgFBIEkNACAAIAJqIQADQCAAQgA3AxggAEIANwMQIABCADcDCCAAQgA3AwAgAEEgaiEAIAFBIGsiAUEfSw0ACwsLVgEBfwJAIAAoAgwNAAJAAkACQAJAIAAtADEOAwEAAwILIAAoAjgiAUUNACABKAIwIgFFDQAgACABEQAAIgENAwtBAA8LAAsgAEHKGTYCEEEOIQELIAELGgAgACgCDEUEQCAAQd4fNgIQIABBFTYCDAsLFAAgACgCDEEVRgRAIABBADYCDAsLFAAgACgCDEEWRgRAIABBADYCDAsLBwAgACgCDAsHACAAKAIQCwkAIAAgATYCEAsHACAAKAIUCysAAkAgAEEnTw0AQv//////CSAArYhCAYNQDQAgAEECdEHQOGooAgAPCwALFwAgAEEvTwRAAAsgAEECdEHsOWooAgALvwkBAX9B9C0hAQJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABB5ABrDvQDY2IAAWFhYWFhYQIDBAVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhBgcICQoLDA0OD2FhYWFhEGFhYWFhYWFhYWFhEWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYRITFBUWFxgZGhthYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2YTc4OTphYWFhYWFhYTthYWE8YWFhYT0+P2FhYWFhYWFhQGFhQWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYUJDREVGR0hJSktMTU5PUFFSU2FhYWFhYWFhVFVWV1hZWlthXF1hYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFeYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhX2BhC0HqLA8LQZgmDwtB7TEPC0GgNw8LQckpDwtBtCkPC0GWLQ8LQesrDwtBojUPC0HbNA8LQeApDwtB4yQPC0HVJA8LQe4kDwtB5iUPC0HKNA8LQdA3DwtBqjUPC0H1LA8LQfYmDwtBgiIPC0HyMw8LQb4oDwtB5zcPC0HNIQ8LQcAhDwtBuCUPC0HLJQ8LQZYkDwtBjzQPC0HNNQ8LQd0qDwtB7jMPC0GcNA8LQZ4xDwtB9DUPC0HlIg8LQa8lDwtBmTEPC0GyNg8LQfk2DwtBxDIPC0HdLA8LQYIxDwtBwTEPC0GNNw8LQckkDwtB7DYPC0HnKg8LQcgjDwtB4iEPC0HJNw8LQaUiDwtBlCIPC0HbNg8LQd41DwtBhiYPC0G8Kw8LQYsyDwtBoCMPC0H2MA8LQYAsDwtBiSsPC0GkJg8LQfIjDwtBgSgPC0GrMg8LQesnDwtBwjYPC0GiJA8LQc8qDwtB3CMPC0GHJw8LQeQ0DwtBtyIPC0GtMQ8LQdUiDwtBrzQPC0HeJg8LQdYyDwtB9DQPC0GBOA8LQfQ3DwtBkjYPC0GdJw8LQYIpDwtBjSMPC0HXMQ8LQb01DwtBtDcPC0HYMA8LQbYnDwtBmjgPC0GnKg8LQcQnDwtBriMPC0H1Ig8LAAtByiYhAQsgAQsXACAAIAAvAS5B/v8DcSABQQBHcjsBLgsaACAAIAAvAS5B/f8DcSABQQBHQQF0cjsBLgsaACAAIAAvAS5B+/8DcSABQQBHQQJ0cjsBLgsaACAAIAAvAS5B9/8DcSABQQBHQQN0cjsBLgsaACAAIAAvAS5B7/8DcSABQQBHQQR0cjsBLgsaACAAIAAvAS5B3/8DcSABQQBHQQV0cjsBLgsaACAAIAAvAS5Bv/8DcSABQQBHQQZ0cjsBLgsaACAAIAAvAS5B//4DcSABQQBHQQd0cjsBLgsaACAAIAAvAS5B//0DcSABQQBHQQh0cjsBLgsaACAAIAAvAS5B//sDcSABQQBHQQl0cjsBLgs+AQJ/AkAgACgCOCIDRQ0AIAMoAgQiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQeESNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAggiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQfwRNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAgwiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQewKNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAhAiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQfoeNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAhQiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQcsQNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAhgiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQbcfNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAhwiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQb8VNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAiwiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQf4INgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAiAiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQYwdNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAiQiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQeYVNgIQQRghBAsgBAs4ACAAAn8gAC8BMkEUcUEURgRAQQEgAC0AKEEBRg0BGiAALwE0QeUARgwBCyAALQApQQVGCzoAMAtZAQJ/AkAgAC0AKEEBRg0AIAAvATQiAUHkAGtB5ABJDQAgAUHMAUYNACABQbACRg0AIAAvATIiAEHAAHENAEEBIQIgAEGIBHFBgARGDQAgAEEocUUhAgsgAguMAQECfwJAAkACQCAALQAqRQ0AIAAtACtFDQAgAC8BMiIBQQJxRQ0BDAILIAAvATIiAUEBcUUNAQtBASECIAAtAChBAUYNACAALwE0IgBB5ABrQeQASQ0AIABBzAFGDQAgAEGwAkYNACABQcAAcQ0AQQAhAiABQYgEcUGABEYNACABQShxQQBHIQILIAILcwAgAEEQav0MAAAAAAAAAAAAAAAAAAAAAP0LAwAgAP0MAAAAAAAAAAAAAAAAAAAAAP0LAwAgAEEwav0MAAAAAAAAAAAAAAAAAAAAAP0LAwAgAEEgav0MAAAAAAAAAAAAAAAAAAAAAP0LAwAgAEH9ATYCHAsGACAAEDoLmi0BC38jAEEQayIKJABB3NUAKAIAIglFBEBBnNkAKAIAIgVFBEBBqNkAQn83AgBBoNkAQoCAhICAgMAANwIAQZzZACAKQQhqQXBxQdiq1aoFcyIFNgIAQbDZAEEANgIAQYDZAEEANgIAC0GE2QBBwNkENgIAQdTVAEHA2QQ2AgBB6NUAIAU2AgBB5NUAQX82AgBBiNkAQcCmAzYCAANAIAFBgNYAaiABQfTVAGoiAjYCACACIAFB7NUAaiIDNgIAIAFB+NUAaiADNgIAIAFBiNYAaiABQfzVAGoiAzYCACADIAI2AgAgAUGQ1gBqIAFBhNYAaiICNgIAIAIgAzYCACABQYzWAGogAjYCACABQSBqIgFBgAJHDQALQczZBEGBpgM2AgBB4NUAQazZACgCADYCAEHQ1QBBgKYDNgIAQdzVAEHI2QQ2AgBBzP8HQTg2AgBByNkEIQkLAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAEHsAU0EQEHE1QAoAgAiBkEQIABBE2pBcHEgAEELSRsiBEEDdiIAdiIBQQNxBEACQCABQQFxIAByQQFzIgJBA3QiAEHs1QBqIgEgAEH01QBqKAIAIgAoAggiA0YEQEHE1QAgBkF+IAJ3cTYCAAwBCyABIAM2AgggAyABNgIMCyAAQQhqIQEgACACQQN0IgJBA3I2AgQgACACaiIAIAAoAgRBAXI2AgQMEQtBzNUAKAIAIgggBE8NASABBEACQEECIAB0IgJBACACa3IgASAAdHFoIgBBA3QiAkHs1QBqIgEgAkH01QBqKAIAIgIoAggiA0YEQEHE1QAgBkF+IAB3cSIGNgIADAELIAEgAzYCCCADIAE2AgwLIAIgBEEDcjYCBCAAQQN0IgAgBGshBSAAIAJqIAU2AgAgAiAEaiIEIAVBAXI2AgQgCARAIAhBeHFB7NUAaiEAQdjVACgCACEDAn9BASAIQQN2dCIBIAZxRQRAQcTVACABIAZyNgIAIAAMAQsgACgCCAsiASADNgIMIAAgAzYCCCADIAA2AgwgAyABNgIICyACQQhqIQFB2NUAIAQ2AgBBzNUAIAU2AgAMEQtByNUAKAIAIgtFDQEgC2hBAnRB9NcAaigCACIAKAIEQXhxIARrIQUgACECA0ACQCACKAIQIgFFBEAgAkEUaigCACIBRQ0BCyABKAIEQXhxIARrIgMgBUkhAiADIAUgAhshBSABIAAgAhshACABIQIMAQsLIAAoAhghCSAAKAIMIgMgAEcEQEHU1QAoAgAaIAMgACgCCCIBNgIIIAEgAzYCDAwQCyAAQRRqIgIoAgAiAUUEQCAAKAIQIgFFDQMgAEEQaiECCwNAIAIhByABIgNBFGoiAigCACIBDQAgA0EQaiECIAMoAhAiAQ0ACyAHQQA2AgAMDwtBfyEEIABBv39LDQAgAEETaiIBQXBxIQRByNUAKAIAIghFDQBBACAEayEFAkACQAJAAn9BACAEQYACSQ0AGkEfIARB////B0sNABogBEEmIAFBCHZnIgBrdkEBcSAAQQF0a0E+agsiBkECdEH01wBqKAIAIgJFBEBBACEBQQAhAwwBC0EAIQEgBEEZIAZBAXZrQQAgBkEfRxt0IQBBACEDA0ACQCACKAIEQXhxIARrIgcgBU8NACACIQMgByIFDQBBACEFIAIhAQwDCyABIAJBFGooAgAiByAHIAIgAEEddkEEcWpBEGooAgAiAkYbIAEgBxshASAAQQF0IQAgAg0ACwsgASADckUEQEEAIQNBAiAGdCIAQQAgAGtyIAhxIgBFDQMgAGhBAnRB9NcAaigCACEBCyABRQ0BCwNAIAEoAgRBeHEgBGsiAiAFSSEAIAIgBSAAGyEFIAEgAyAAGyEDIAEoAhAiAAR/IAAFIAFBFGooAgALIgENAAsLIANFDQAgBUHM1QAoAgAgBGtPDQAgAygCGCEHIAMgAygCDCIARwRAQdTVACgCABogACADKAIIIgE2AgggASAANgIMDA4LIANBFGoiAigCACIBRQRAIAMoAhAiAUUNAyADQRBqIQILA0AgAiEGIAEiAEEUaiICKAIAIgENACAAQRBqIQIgACgCECIBDQALIAZBADYCAAwNC0HM1QAoAgAiAyAETwRAQdjVACgCACEBAkAgAyAEayICQRBPBEAgASAEaiIAIAJBAXI2AgQgASADaiACNgIAIAEgBEEDcjYCBAwBCyABIANBA3I2AgQgASADaiIAIAAoAgRBAXI2AgRBACEAQQAhAgtBzNUAIAI2AgBB2NUAIAA2AgAgAUEIaiEBDA8LQdDVACgCACIDIARLBEAgBCAJaiIAIAMgBGsiAUEBcjYCBEHc1QAgADYCAEHQ1QAgATYCACAJIARBA3I2AgQgCUEIaiEBDA8LQQAhASAEAn9BnNkAKAIABEBBpNkAKAIADAELQajZAEJ/NwIAQaDZAEKAgISAgIDAADcCAEGc2QAgCkEMakFwcUHYqtWqBXM2AgBBsNkAQQA2AgBBgNkAQQA2AgBBgIAECyIAIARBxwBqIgVqIgZBACAAayIHcSICTwRAQbTZAEEwNgIADA8LAkBB/NgAKAIAIgFFDQBB9NgAKAIAIgggAmohACAAIAFNIAAgCEtxDQBBACEBQbTZAEEwNgIADA8LQYDZAC0AAEEEcQ0EAkACQCAJBEBBhNkAIQEDQCABKAIAIgAgCU0EQCAAIAEoAgRqIAlLDQMLIAEoAggiAQ0ACwtBABA7IgBBf0YNBSACIQZBoNkAKAIAIgFBAWsiAyAAcQRAIAIgAGsgACADakEAIAFrcWohBgsgBCAGTw0FIAZB/v///wdLDQVB/NgAKAIAIgMEQEH02AAoAgAiByAGaiEBIAEgB00NBiABIANLDQYLIAYQOyIBIABHDQEMBwsgBiADayAHcSIGQf7///8HSw0EIAYQOyEAIAAgASgCACABKAIEakYNAyAAIQELAkAgBiAEQcgAak8NACABQX9GDQBBpNkAKAIAIgAgBSAGa2pBACAAa3EiAEH+////B0sEQCABIQAMBwsgABA7QX9HBEAgACAGaiEGIAEhAAwHC0EAIAZrEDsaDAQLIAEiAEF/Rw0FDAMLQQAhAwwMC0EAIQAMCgsgAEF/Rw0CC0GA2QBBgNkAKAIAQQRyNgIACyACQf7///8HSw0BIAIQOyEAQQAQOyEBIABBf0YNASABQX9GDQEgACABTw0BIAEgAGsiBiAEQThqTQ0BC0H02ABB9NgAKAIAIAZqIgE2AgBB+NgAKAIAIAFJBEBB+NgAIAE2AgALAkACQAJAQdzVACgCACICBEBBhNkAIQEDQCAAIAEoAgAiAyABKAIEIgVqRg0CIAEoAggiAQ0ACwwCC0HU1QAoAgAiAUEARyAAIAFPcUUEQEHU1QAgADYCAAtBACEBQYjZACAGNgIAQYTZACAANgIAQeTVAEF/NgIAQejVAEGc2QAoAgA2AgBBkNkAQQA2AgADQCABQYDWAGogAUH01QBqIgI2AgAgAiABQezVAGoiAzYCACABQfjVAGogAzYCACABQYjWAGogAUH81QBqIgM2AgAgAyACNgIAIAFBkNYAaiABQYTWAGoiAjYCACACIAM2AgAgAUGM1gBqIAI2AgAgAUEgaiIBQYACRw0AC0F4IABrQQ9xIgEgAGoiAiAGQThrIgMgAWsiAUEBcjYCBEHg1QBBrNkAKAIANgIAQdDVACABNgIAQdzVACACNgIAIAAgA2pBODYCBAwCCyAAIAJNDQAgAiADSQ0AIAEoAgxBCHENAEF4IAJrQQ9xIgAgAmoiA0HQ1QAoAgAgBmoiByAAayIAQQFyNgIEIAEgBSAGajYCBEHg1QBBrNkAKAIANgIAQdDVACAANgIAQdzVACADNgIAIAIgB2pBODYCBAwBCyAAQdTVACgCAEkEQEHU1QAgADYCAAsgACAGaiEDQYTZACEBAkACQAJAA0AgAyABKAIARwRAIAEoAggiAQ0BDAILCyABLQAMQQhxRQ0BC0GE2QAhAQNAIAEoAgAiAyACTQRAIAMgASgCBGoiBSACSw0DCyABKAIIIQEMAAsACyABIAA2AgAgASABKAIEIAZqNgIEIABBeCAAa0EPcWoiCSAEQQNyNgIEIANBeCADa0EPcWoiBiAEIAlqIgRrIQEgAiAGRgRAQdzVACAENgIAQdDVAEHQ1QAoAgAgAWoiADYCACAEIABBAXI2AgQMCAtB2NUAKAIAIAZGBEBB2NUAIAQ2AgBBzNUAQczVACgCACABaiIANgIAIAQgAEEBcjYCBCAAIARqIAA2AgAMCAsgBigCBCIFQQNxQQFHDQYgBUF4cSEIIAVB/wFNBEAgBUEDdiEDIAYoAggiACAGKAIMIgJGBEBBxNUAQcTVACgCAEF+IAN3cTYCAAwHCyACIAA2AgggACACNgIMDAYLIAYoAhghByAGIAYoAgwiAEcEQCAAIAYoAggiAjYCCCACIAA2AgwMBQsgBkEUaiICKAIAIgVFBEAgBigCECIFRQ0EIAZBEGohAgsDQCACIQMgBSIAQRRqIgIoAgAiBQ0AIABBEGohAiAAKAIQIgUNAAsgA0EANgIADAQLQXggAGtBD3EiASAAaiIHIAZBOGsiAyABayIBQQFyNgIEIAAgA2pBODYCBCACIAVBNyAFa0EPcWpBP2siAyADIAJBEGpJGyIDQSM2AgRB4NUAQazZACgCADYCAEHQ1QAgATYCAEHc1QAgBzYCACADQRBqQYzZACkCADcCACADQYTZACkCADcCCEGM2QAgA0EIajYCAEGI2QAgBjYCAEGE2QAgADYCAEGQ2QBBADYCACADQSRqIQEDQCABQQc2AgAgBSABQQRqIgFLDQALIAIgA0YNACADIAMoAgRBfnE2AgQgAyADIAJrIgU2AgAgAiAFQQFyNgIEIAVB/wFNBEAgBUF4cUHs1QBqIQACf0HE1QAoAgAiAUEBIAVBA3Z0IgNxRQRAQcTVACABIANyNgIAIAAMAQsgACgCCAsiASACNgIMIAAgAjYCCCACIAA2AgwgAiABNgIIDAELQR8hASAFQf///wdNBEAgBUEmIAVBCHZnIgBrdkEBcSAAQQF0a0E+aiEBCyACIAE2AhwgAkIANwIQIAFBAnRB9NcAaiEAQcjVACgCACIDQQEgAXQiBnFFBEAgACACNgIAQcjVACADIAZyNgIAIAIgADYCGCACIAI2AgggAiACNgIMDAELIAVBGSABQQF2a0EAIAFBH0cbdCEBIAAoAgAhAwJAA0AgAyIAKAIEQXhxIAVGDQEgAUEddiEDIAFBAXQhASAAIANBBHFqQRBqIgYoAgAiAw0ACyAGIAI2AgAgAiAANgIYIAIgAjYCDCACIAI2AggMAQsgACgCCCIBIAI2AgwgACACNgIIIAJBADYCGCACIAA2AgwgAiABNgIIC0HQ1QAoAgAiASAETQ0AQdzVACgCACIAIARqIgIgASAEayIBQQFyNgIEQdDVACABNgIAQdzVACACNgIAIAAgBEEDcjYCBCAAQQhqIQEMCAtBACEBQbTZAEEwNgIADAcLQQAhAAsgB0UNAAJAIAYoAhwiAkECdEH01wBqIgMoAgAgBkYEQCADIAA2AgAgAA0BQcjVAEHI1QAoAgBBfiACd3E2AgAMAgsgB0EQQRQgBygCECAGRhtqIAA2AgAgAEUNAQsgACAHNgIYIAYoAhAiAgRAIAAgAjYCECACIAA2AhgLIAZBFGooAgAiAkUNACAAQRRqIAI2AgAgAiAANgIYCyABIAhqIQEgBiAIaiIGKAIEIQULIAYgBUF+cTYCBCABIARqIAE2AgAgBCABQQFyNgIEIAFB/wFNBEAgAUF4cUHs1QBqIQACf0HE1QAoAgAiAkEBIAFBA3Z0IgFxRQRAQcTVACABIAJyNgIAIAAMAQsgACgCCAsiASAENgIMIAAgBDYCCCAEIAA2AgwgBCABNgIIDAELQR8hBSABQf///wdNBEAgAUEmIAFBCHZnIgBrdkEBcSAAQQF0a0E+aiEFCyAEIAU2AhwgBEIANwIQIAVBAnRB9NcAaiEAQcjVACgCACICQQEgBXQiA3FFBEAgACAENgIAQcjVACACIANyNgIAIAQgADYCGCAEIAQ2AgggBCAENgIMDAELIAFBGSAFQQF2a0EAIAVBH0cbdCEFIAAoAgAhAAJAA0AgACICKAIEQXhxIAFGDQEgBUEddiEAIAVBAXQhBSACIABBBHFqQRBqIgMoAgAiAA0ACyADIAQ2AgAgBCACNgIYIAQgBDYCDCAEIAQ2AggMAQsgAigCCCIAIAQ2AgwgAiAENgIIIARBADYCGCAEIAI2AgwgBCAANgIICyAJQQhqIQEMAgsCQCAHRQ0AAkAgAygCHCIBQQJ0QfTXAGoiAigCACADRgRAIAIgADYCACAADQFByNUAIAhBfiABd3EiCDYCAAwCCyAHQRBBFCAHKAIQIANGG2ogADYCACAARQ0BCyAAIAc2AhggAygCECIBBEAgACABNgIQIAEgADYCGAsgA0EUaigCACIBRQ0AIABBFGogATYCACABIAA2AhgLAkAgBUEPTQRAIAMgBCAFaiIAQQNyNgIEIAAgA2oiACAAKAIEQQFyNgIEDAELIAMgBGoiAiAFQQFyNgIEIAMgBEEDcjYCBCACIAVqIAU2AgAgBUH/AU0EQCAFQXhxQezVAGohAAJ/QcTVACgCACIBQQEgBUEDdnQiBXFFBEBBxNUAIAEgBXI2AgAgAAwBCyAAKAIICyIBIAI2AgwgACACNgIIIAIgADYCDCACIAE2AggMAQtBHyEBIAVB////B00EQCAFQSYgBUEIdmciAGt2QQFxIABBAXRrQT5qIQELIAIgATYCHCACQgA3AhAgAUECdEH01wBqIQBBASABdCIEIAhxRQRAIAAgAjYCAEHI1QAgBCAIcjYCACACIAA2AhggAiACNgIIIAIgAjYCDAwBCyAFQRkgAUEBdmtBACABQR9HG3QhASAAKAIAIQQCQANAIAQiACgCBEF4cSAFRg0BIAFBHXYhBCABQQF0IQEgACAEQQRxakEQaiIGKAIAIgQNAAsgBiACNgIAIAIgADYCGCACIAI2AgwgAiACNgIIDAELIAAoAggiASACNgIMIAAgAjYCCCACQQA2AhggAiAANgIMIAIgATYCCAsgA0EIaiEBDAELAkAgCUUNAAJAIAAoAhwiAUECdEH01wBqIgIoAgAgAEYEQCACIAM2AgAgAw0BQcjVACALQX4gAXdxNgIADAILIAlBEEEUIAkoAhAgAEYbaiADNgIAIANFDQELIAMgCTYCGCAAKAIQIgEEQCADIAE2AhAgASADNgIYCyAAQRRqKAIAIgFFDQAgA0EUaiABNgIAIAEgAzYCGAsCQCAFQQ9NBEAgACAEIAVqIgFBA3I2AgQgACABaiIBIAEoAgRBAXI2AgQMAQsgACAEaiIHIAVBAXI2AgQgACAEQQNyNgIEIAUgB2ogBTYCACAIBEAgCEF4cUHs1QBqIQFB2NUAKAIAIQMCf0EBIAhBA3Z0IgIgBnFFBEBBxNUAIAIgBnI2AgAgAQwBCyABKAIICyICIAM2AgwgASADNgIIIAMgATYCDCADIAI2AggLQdjVACAHNgIAQczVACAFNgIACyAAQQhqIQELIApBEGokACABC0MAIABFBEA/AEEQdA8LAkAgAEH//wNxDQAgAEEASA0AIABBEHZAACIAQX9GBEBBtNkAQTA2AgBBfw8LIABBEHQPCwALC5lCIgBBgAgLDQEAAAAAAAAAAgAAAAMAQZgICwUEAAAABQBBqAgLCQYAAAAHAAAACABB5AgLwjJJbnZhbGlkIGNoYXIgaW4gdXJsIHF1ZXJ5AFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fYm9keQBDb250ZW50LUxlbmd0aCBvdmVyZmxvdwBDaHVuayBzaXplIG92ZXJmbG93AEludmFsaWQgbWV0aG9kIGZvciBIVFRQL3gueCByZXF1ZXN0AEludmFsaWQgbWV0aG9kIGZvciBSVFNQL3gueCByZXF1ZXN0AEV4cGVjdGVkIFNPVVJDRSBtZXRob2QgZm9yIElDRS94LnggcmVxdWVzdABJbnZhbGlkIGNoYXIgaW4gdXJsIGZyYWdtZW50IHN0YXJ0AEV4cGVjdGVkIGRvdABTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3N0YXR1cwBJbnZhbGlkIHJlc3BvbnNlIHN0YXR1cwBFeHBlY3RlZCBMRiBhZnRlciBoZWFkZXJzAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMAVXNlciBjYWxsYmFjayBlcnJvcgBgb25fcmVzZXRgIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19oZWFkZXJgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXNzYWdlX2JlZ2luYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfZXh0ZW5zaW9uX3ZhbHVlYCBjYWxsYmFjayBlcnJvcgBgb25fc3RhdHVzX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fdmVyc2lvbl9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3VybF9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3Byb3RvY29sX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9oZWFkZXJfdmFsdWVfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXNzYWdlX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fbWV0aG9kX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25faGVhZGVyX2ZpZWxkX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfZXh0ZW5zaW9uX25hbWVgIGNhbGxiYWNrIGVycm9yAFVuZXhwZWN0ZWQgY2hhciBpbiB1cmwgc2VydmVyAEludmFsaWQgaGVhZGVyIHZhbHVlIGNoYXIASW52YWxpZCBoZWFkZXIgZmllbGQgY2hhcgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3ZlcnNpb24ASW52YWxpZCBtaW5vciB2ZXJzaW9uAEludmFsaWQgbWFqb3IgdmVyc2lvbgBFeHBlY3RlZCBzcGFjZSBhZnRlciB2ZXJzaW9uAEV4cGVjdGVkIENSTEYgYWZ0ZXIgdmVyc2lvbgBJbnZhbGlkIEhUVFAgdmVyc2lvbgBJbnZhbGlkIGhlYWRlciB0b2tlbgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3VybABJbnZhbGlkIGNoYXJhY3RlcnMgaW4gdXJsAFVuZXhwZWN0ZWQgc3RhcnQgY2hhciBpbiB1cmwARG91YmxlIEAgaW4gdXJsAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fcHJvdG9jb2wARW1wdHkgQ29udGVudC1MZW5ndGgASW52YWxpZCBjaGFyYWN0ZXIgaW4gQ29udGVudC1MZW5ndGgAVHJhbnNmZXItRW5jb2RpbmcgY2FuJ3QgYmUgcHJlc2VudCB3aXRoIENvbnRlbnQtTGVuZ3RoAER1cGxpY2F0ZSBDb250ZW50LUxlbmd0aABJbnZhbGlkIGNoYXIgaW4gdXJsIHBhdGgAQ29udGVudC1MZW5ndGggY2FuJ3QgYmUgcHJlc2VudCB3aXRoIFRyYW5zZmVyLUVuY29kaW5nAE1pc3NpbmcgZXhwZWN0ZWQgQ1IgYWZ0ZXIgY2h1bmsgc2l6ZQBFeHBlY3RlZCBMRiBhZnRlciBjaHVuayBzaXplAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIHNpemUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfdmFsdWUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9jaHVua19leHRlbnNpb25fdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyB2YWx1ZQBVbmV4cGVjdGVkIHdoaXRlc3BhY2UgYWZ0ZXIgaGVhZGVyIHZhbHVlAE1pc3NpbmcgZXhwZWN0ZWQgQ1IgYWZ0ZXIgaGVhZGVyIHZhbHVlAE1pc3NpbmcgZXhwZWN0ZWQgTEYgYWZ0ZXIgaGVhZGVyIHZhbHVlAEludmFsaWQgYFRyYW5zZmVyLUVuY29kaW5nYCBoZWFkZXIgdmFsdWUATWlzc2luZyBleHBlY3RlZCBDUiBhZnRlciBjaHVuayBleHRlbnNpb24gdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBxdW90ZSB2YWx1ZQBJbnZhbGlkIHF1b3RlZC1wYWlyIGluIGNodW5rIGV4dGVuc2lvbnMgcXVvdGVkIHZhbHVlAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgcXVvdGVkIHZhbHVlAFBhdXNlZCBieSBvbl9oZWFkZXJzX2NvbXBsZXRlAEludmFsaWQgRU9GIHN0YXRlAG9uX3Jlc2V0IHBhdXNlAG9uX2NodW5rX2hlYWRlciBwYXVzZQBvbl9tZXNzYWdlX2JlZ2luIHBhdXNlAG9uX2NodW5rX2V4dGVuc2lvbl92YWx1ZSBwYXVzZQBvbl9zdGF0dXNfY29tcGxldGUgcGF1c2UAb25fdmVyc2lvbl9jb21wbGV0ZSBwYXVzZQBvbl91cmxfY29tcGxldGUgcGF1c2UAb25fcHJvdG9jb2xfY29tcGxldGUgcGF1c2UAb25fY2h1bmtfY29tcGxldGUgcGF1c2UAb25faGVhZGVyX3ZhbHVlX2NvbXBsZXRlIHBhdXNlAG9uX21lc3NhZ2VfY29tcGxldGUgcGF1c2UAb25fbWV0aG9kX2NvbXBsZXRlIHBhdXNlAG9uX2hlYWRlcl9maWVsZF9jb21wbGV0ZSBwYXVzZQBvbl9jaHVua19leHRlbnNpb25fbmFtZSBwYXVzZQBVbmV4cGVjdGVkIHNwYWNlIGFmdGVyIHN0YXJ0IGxpbmUATWlzc2luZyBleHBlY3RlZCBDUiBhZnRlciByZXNwb25zZSBsaW5lAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fY2h1bmtfZXh0ZW5zaW9uX25hbWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBuYW1lAE1pc3NpbmcgZXhwZWN0ZWQgQ1IgYWZ0ZXIgY2h1bmsgZXh0ZW5zaW9uIG5hbWUASW52YWxpZCBzdGF0dXMgY29kZQBQYXVzZSBvbiBDT05ORUNUL1VwZ3JhZGUAUGF1c2Ugb24gUFJJL1VwZ3JhZGUARXhwZWN0ZWQgSFRUUC8yIENvbm5lY3Rpb24gUHJlZmFjZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX21ldGhvZABFeHBlY3RlZCBzcGFjZSBhZnRlciBtZXRob2QAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfZmllbGQAUGF1c2VkAEludmFsaWQgd29yZCBlbmNvdW50ZXJlZABJbnZhbGlkIG1ldGhvZCBlbmNvdW50ZXJlZABNaXNzaW5nIGV4cGVjdGVkIENSIGFmdGVyIGNodW5rIGRhdGEARXhwZWN0ZWQgTEYgYWZ0ZXIgY2h1bmsgZGF0YQBVbmV4cGVjdGVkIGNoYXIgaW4gdXJsIHNjaGVtYQBSZXF1ZXN0IGhhcyBpbnZhbGlkIGBUcmFuc2Zlci1FbmNvZGluZ2AARGF0YSBhZnRlciBgQ29ubmVjdGlvbjogY2xvc2VgAFNXSVRDSF9QUk9YWQBVU0VfUFJPWFkATUtBQ1RJVklUWQBVTlBST0NFU1NBQkxFX0VOVElUWQBRVUVSWQBDT1BZAE1PVkVEX1BFUk1BTkVOVExZAFRPT19FQVJMWQBOT1RJRlkARkFJTEVEX0RFUEVOREVOQ1kAQkFEX0dBVEVXQVkAUExBWQBQVVQAQ0hFQ0tPVVQAR0FURVdBWV9USU1FT1VUAFJFUVVFU1RfVElNRU9VVABORVRXT1JLX0NPTk5FQ1RfVElNRU9VVABDT05ORUNUSU9OX1RJTUVPVVQATE9HSU5fVElNRU9VVABORVRXT1JLX1JFQURfVElNRU9VVABQT1NUAE1JU0RJUkVDVEVEX1JFUVVFU1QAQ0xJRU5UX0NMT1NFRF9SRVFVRVNUAENMSUVOVF9DTE9TRURfTE9BRF9CQUxBTkNFRF9SRVFVRVNUAEJBRF9SRVFVRVNUAEhUVFBfUkVRVUVTVF9TRU5UX1RPX0hUVFBTX1BPUlQAUkVQT1JUAElNX0FfVEVBUE9UAFJFU0VUX0NPTlRFTlQATk9fQ09OVEVOVABQQVJUSUFMX0NPTlRFTlQASFBFX0lOVkFMSURfQ09OU1RBTlQASFBFX0NCX1JFU0VUAEdFVABIUEVfU1RSSUNUAENPTkZMSUNUAFRFTVBPUkFSWV9SRURJUkVDVABQRVJNQU5FTlRfUkVESVJFQ1QAQ09OTkVDVABNVUxUSV9TVEFUVVMASFBFX0lOVkFMSURfU1RBVFVTAFRPT19NQU5ZX1JFUVVFU1RTAEVBUkxZX0hJTlRTAFVOQVZBSUxBQkxFX0ZPUl9MRUdBTF9SRUFTT05TAE9QVElPTlMAU1dJVENISU5HX1BST1RPQ09MUwBWQVJJQU5UX0FMU09fTkVHT1RJQVRFUwBNVUxUSVBMRV9DSE9JQ0VTAElOVEVSTkFMX1NFUlZFUl9FUlJPUgBXRUJfU0VSVkVSX1VOS05PV05fRVJST1IAUkFJTEdVTl9FUlJPUgBJREVOVElUWV9QUk9WSURFUl9BVVRIRU5USUNBVElPTl9FUlJPUgBTU0xfQ0VSVElGSUNBVEVfRVJST1IASU5WQUxJRF9YX0ZPUldBUkRFRF9GT1IAU0VUX1BBUkFNRVRFUgBHRVRfUEFSQU1FVEVSAEhQRV9VU0VSAFNFRV9PVEhFUgBIUEVfQ0JfQ0hVTktfSEVBREVSAEV4cGVjdGVkIExGIGFmdGVyIENSAE1LQ0FMRU5EQVIAU0VUVVAAV0VCX1NFUlZFUl9JU19ET1dOAFRFQVJET1dOAEhQRV9DTE9TRURfQ09OTkVDVElPTgBIRVVSSVNUSUNfRVhQSVJBVElPTgBESVNDT05ORUNURURfT1BFUkFUSU9OAE5PTl9BVVRIT1JJVEFUSVZFX0lORk9STUFUSU9OAEhQRV9JTlZBTElEX1ZFUlNJT04ASFBFX0NCX01FU1NBR0VfQkVHSU4AU0lURV9JU19GUk9aRU4ASFBFX0lOVkFMSURfSEVBREVSX1RPS0VOAElOVkFMSURfVE9LRU4ARk9SQklEREVOAEVOSEFOQ0VfWU9VUl9DQUxNAEhQRV9JTlZBTElEX1VSTABCTE9DS0VEX0JZX1BBUkVOVEFMX0NPTlRST0wATUtDT0wAQUNMAEhQRV9JTlRFUk5BTABSRVFVRVNUX0hFQURFUl9GSUVMRFNfVE9PX0xBUkdFX1VOT0ZGSUNJQUwASFBFX09LAFVOTElOSwBVTkxPQ0sAUFJJAFJFVFJZX1dJVEgASFBFX0lOVkFMSURfQ09OVEVOVF9MRU5HVEgASFBFX1VORVhQRUNURURfQ09OVEVOVF9MRU5HVEgARkxVU0gAUFJPUFBBVENIAE0tU0VBUkNIAFVSSV9UT09fTE9ORwBQUk9DRVNTSU5HAE1JU0NFTExBTkVPVVNfUEVSU0lTVEVOVF9XQVJOSU5HAE1JU0NFTExBTkVPVVNfV0FSTklORwBIUEVfSU5WQUxJRF9UUkFOU0ZFUl9FTkNPRElORwBFeHBlY3RlZCBDUkxGAEhQRV9JTlZBTElEX0NIVU5LX1NJWkUATU9WRQBDT05USU5VRQBIUEVfQ0JfU1RBVFVTX0NPTVBMRVRFAEhQRV9DQl9IRUFERVJTX0NPTVBMRVRFAEhQRV9DQl9WRVJTSU9OX0NPTVBMRVRFAEhQRV9DQl9VUkxfQ09NUExFVEUASFBFX0NCX1BST1RPQ09MX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19DT01QTEVURQBIUEVfQ0JfSEVBREVSX1ZBTFVFX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19FWFRFTlNJT05fVkFMVUVfQ09NUExFVEUASFBFX0NCX0NIVU5LX0VYVEVOU0lPTl9OQU1FX0NPTVBMRVRFAEhQRV9DQl9NRVNTQUdFX0NPTVBMRVRFAEhQRV9DQl9NRVRIT0RfQ09NUExFVEUASFBFX0NCX0hFQURFUl9GSUVMRF9DT01QTEVURQBERUxFVEUASFBFX0lOVkFMSURfRU9GX1NUQVRFAElOVkFMSURfU1NMX0NFUlRJRklDQVRFAFBBVVNFAE5PX1JFU1BPTlNFAFVOU1VQUE9SVEVEX01FRElBX1RZUEUAR09ORQBOT1RfQUNDRVBUQUJMRQBTRVJWSUNFX1VOQVZBSUxBQkxFAFJBTkdFX05PVF9TQVRJU0ZJQUJMRQBPUklHSU5fSVNfVU5SRUFDSEFCTEUAUkVTUE9OU0VfSVNfU1RBTEUAUFVSR0UATUVSR0UAUkVRVUVTVF9IRUFERVJfRklFTERTX1RPT19MQVJHRQBSRVFVRVNUX0hFQURFUl9UT09fTEFSR0UAUEFZTE9BRF9UT09fTEFSR0UASU5TVUZGSUNJRU5UX1NUT1JBR0UASFBFX1BBVVNFRF9VUEdSQURFAEhQRV9QQVVTRURfSDJfVVBHUkFERQBTT1VSQ0UAQU5OT1VOQ0UAVFJBQ0UASFBFX1VORVhQRUNURURfU1BBQ0UAREVTQ1JJQkUAVU5TVUJTQ1JJQkUAUkVDT1JEAEhQRV9JTlZBTElEX01FVEhPRABOT1RfRk9VTkQAUFJPUEZJTkQAVU5CSU5EAFJFQklORABVTkFVVEhPUklaRUQATUVUSE9EX05PVF9BTExPV0VEAEhUVFBfVkVSU0lPTl9OT1RfU1VQUE9SVEVEAEFMUkVBRFlfUkVQT1JURUQAQUNDRVBURUQATk9UX0lNUExFTUVOVEVEAExPT1BfREVURUNURUQASFBFX0NSX0VYUEVDVEVEAEhQRV9MRl9FWFBFQ1RFRABDUkVBVEVEAElNX1VTRUQASFBFX1BBVVNFRABUSU1FT1VUX09DQ1VSRUQAUEFZTUVOVF9SRVFVSVJFRABQUkVDT05ESVRJT05fUkVRVUlSRUQAUFJPWFlfQVVUSEVOVElDQVRJT05fUkVRVUlSRUQATkVUV09SS19BVVRIRU5USUNBVElPTl9SRVFVSVJFRABMRU5HVEhfUkVRVUlSRUQAU1NMX0NFUlRJRklDQVRFX1JFUVVJUkVEAFVQR1JBREVfUkVRVUlSRUQAUEFHRV9FWFBJUkVEAFBSRUNPTkRJVElPTl9GQUlMRUQARVhQRUNUQVRJT05fRkFJTEVEAFJFVkFMSURBVElPTl9GQUlMRUQAU1NMX0hBTkRTSEFLRV9GQUlMRUQATE9DS0VEAFRSQU5TRk9STUFUSU9OX0FQUExJRUQATk9UX01PRElGSUVEAE5PVF9FWFRFTkRFRABCQU5EV0lEVEhfTElNSVRfRVhDRUVERUQAU0lURV9JU19PVkVSTE9BREVEAEhFQUQARXhwZWN0ZWQgSFRUUC8sIFJUU1AvIG9yIElDRS8A5xUAAK8VAACkEgAAkhoAACYWAACeFAAA2xkAAHkVAAB+EgAA/hQAADYVAAALFgAA2BYAAPMSAABCGAAArBYAABIVAAAUFwAA7xcAAEgUAABxFwAAshoAAGsZAAB+GQAANRQAAIIaAABEFwAA/RYAAB4YAACHFwAAqhkAAJMSAAAHGAAALBcAAMoXAACkFwAA5xUAAOcVAABYFwAAOxgAAKASAAAtHAAAwxEAAEgRAADeEgAAQhMAAKQZAAD9EAAA9xUAAKUVAADvFgAA+BkAAEoWAABWFgAA9RUAAAoaAAAIGgAAARoAAKsVAABCEgAA1xAAAEwRAAAFGQAAVBYAAB4RAADKGQAAyBkAAE4WAAD/GAAAcRQAAPAVAADuFQAAlBkAAPwVAAC/GQAAmxkAAHwUAABDEQAAcBgAAJUUAAAnFAAAGRQAANUSAADUGQAARBYAAPcQAEG5OwsBAQBB0DsL4AEBAQIBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEDAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBBuj0LBAEAAAIAQdE9C14DBAMDAwMDAAADAwADAwADAwMDAwMDAwMDAAUAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAwADAEG6PwsEAQAAAgBB0T8LXgMAAwMDAwMAAAMDAAMDAAMDAwMDAwMDAwMABAAFAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwADAAMAQbDBAAsNbG9zZWVlcC1hbGl2ZQBBycEACwEBAEHgwQAL4AEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBBycMACwEBAEHgwwAL5wEBAQEBAQEBAQEBAQECAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAWNodW5rZWQAQfHFAAteAQABAQEBAQAAAQEAAQEAAQEBAQEBAQEBAQAAAAAAAAABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEAAQBB0McACyFlY3Rpb25lbnQtbGVuZ3Rob25yb3h5LWNvbm5lY3Rpb24AQYDIAAsgcmFuc2Zlci1lbmNvZGluZ3BncmFkZQ0KDQpTTQ0KDQoAQanIAAsFAQIAAQMAQcDIAAtfBAUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUAQanKAAsFAQIAAQMAQcDKAAtfBAUFBgUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUAQanMAAsEAQAAAQBBwcwAC14CAgACAgICAgICAgICAgICAgICAgICAgICAgICAgIAAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAEGpzgALBQECAAEDAEHAzgALXwQFAAAFBQUFBQUFBQUFBQYFBQUFBQUFBQUFBQUABQAHCAUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQAFAAUABQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUAAAAFAEGp0AALBQEBAAEBAEHA0AALAQEAQdrQAAtBAgAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAQanSAAsFAQEAAQEAQcDSAAsBAQBBytIACwYCAAAAAAIAQeHSAAs6AwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBBoNQAC50BTk9VTkNFRUNLT1VUTkVDVEVURUNSSUJFTFVTSEVURUFEU0VBUkNIUkdFQ1RJVklUWUxFTkRBUlZFT1RJRllQVElPTlNDSFNFQVlTVEFUQ0hHRVVFUllPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFVFRQQ0VUU1BBRFRQLw==`, `base64`) }); -})); -var Da$3 = c$12(((e, t) => { - let n = [ - `GET`, - `HEAD`, - `POST` - ], r = new Set(n), i = [ - 101, - 204, - 205, - 304 - ], a = [ - 301, - 302, - 303, - 307, - 308 - ], o = new Set(a), s = `1.7.9.11.13.15.17.19.20.21.22.23.25.37.42.43.53.69.77.79.87.95.101.102.103.104.109.110.111.113.115.117.119.123.135.137.139.143.161.179.389.427.465.512.513.514.515.526.530.531.532.540.548.554.556.563.587.601.636.989.990.993.995.1719.1720.1723.2049.3659.4045.4190.5060.5061.6000.6566.6665.6666.6667.6668.6669.6679.6697.10080`.split(`.`), c = new Set(s), l = [ - `no-referrer`, - `no-referrer-when-downgrade`, - `same-origin`, - `origin`, - `strict-origin`, - `origin-when-cross-origin`, - `strict-origin-when-cross-origin`, - `unsafe-url` - ], u = [``, ...l], d = new Set(l), f = [ - `follow`, - `manual`, - `error` - ], p = [ - `GET`, - `HEAD`, - `OPTIONS`, - `TRACE` - ], m = new Set(p), h = [ - `navigate`, - `same-origin`, - `no-cors`, - `cors` - ], g = [ - `omit`, - `same-origin`, - `include` - ], _ = [ - `default`, - `no-store`, - `reload`, - `no-cache`, - `force-cache`, - `only-if-cached` - ], v = [ - `content-encoding`, - `content-language`, - `content-location`, - `content-type`, - `content-length` - ], y = [`half`], b = [ - `CONNECT`, - `TRACE`, - `TRACK` - ], x = new Set(b), S = [ - `audio`, - `audioworklet`, - `font`, - `image`, - `manifest`, - `paintworklet`, - `script`, - `style`, - `track`, - `video`, - `xslt`, - `` - ]; - t.exports = { - subresource: S, - forbiddenMethods: b, - requestBodyHeader: v, - referrerPolicy: u, - requestRedirect: f, - requestMode: h, - requestCredentials: g, - requestCache: _, - redirectStatus: a, - corsSafeListedMethods: n, - nullBodyStatus: i, - safeMethods: p, - badPorts: s, - requestDuplex: y, - subresourceSet: new Set(S), - badPortsSet: c, - redirectStatusSet: o, - corsSafeListedMethodsSet: r, - safeMethodsSet: m, - forbiddenMethodsSet: x, - referrerPolicyTokens: d - }; -})); -var Oa$3 = c$12(((e, t) => { - let n = Symbol.for(`undici.globalOrigin.1`); - function r() { - return globalThis[n]; - } - function i(e) { - if (e === void 0) { - Object.defineProperty(globalThis, n, { - value: void 0, - writable: !0, - enumerable: !1, - configurable: !1 - }); - return; - } - let t = new URL(e); - if (t.protocol !== `http:` && t.protocol !== `https:`) throw TypeError(`Only http & https urls are allowed, received ${t.protocol}`); - Object.defineProperty(globalThis, n, { - value: t, - writable: !0, - enumerable: !1, - configurable: !1 - }); - } - t.exports = { - getGlobalOrigin: r, - setGlobalOrigin: i - }; -})); -var ka$3 = c$12(((e, t) => { - let n = new TextDecoder(); - function r(e) { - return e.length === 0 ? `` : (e[0] === 239 && e[1] === 187 && e[2] === 191 && (e = e.subarray(3)), n.decode(e)); - } - t.exports = { utf8DecodeBytes: r }; -})); -var Aa$3 = c$12(((e, n) => { - let r = f$11(`node:assert`), { utf8DecodeBytes: i } = ka$3(); - function a(e, t, n) { - let r = ``; - for (; n.position < t.length && e(t[n.position]);) r += t[n.position], n.position++; - return r; - } - function o(e, t, n) { - let r = t.indexOf(e, n.position), i = n.position; - return r === -1 ? (n.position = t.length, t.slice(i)) : (n.position = r, t.slice(i, n.position)); - } - let s = /[\u0009\u000A\u000C\u000D\u0020]/g; - function c(e) { - e = e.replace(s, ``); - let t = e.length; - if (t % 4 == 0 && e.charCodeAt(t - 1) === 61 && (--t, e.charCodeAt(t - 1) === 61 && --t), t % 4 == 1 || /[^+/0-9A-Za-z]/.test(e.length === t ? e : e.substring(0, t))) return `failure`; - let n = Buffer.from(e, `base64`); - return new Uint8Array(n.buffer, n.byteOffset, n.byteLength); - } - function l(e) { - return e === 9 || e === 10 || e === 12 || e === 13 || e === 32; - } - function u(e) { - let t = e.length; - if (65535 > t) return String.fromCharCode.apply(null, e); - let n = ``, r = 0, i = 65535; - for (; r < t;) r + i > t && (i = t - r), n += String.fromCharCode.apply(null, e.subarray(r, r += i)); - return n; - } - let d = /[^\x00-\xFF]/; - function f(e) { - return r(!d.test(e)), e; - } - function p(e) { - return JSON.parse(i(e)); - } - function m(e, t = !0, n = !0) { - return h(e, t, n, l); - } - function h(e, t, n, r) { - let i = 0, a = e.length - 1; - if (t) for (; i < e.length && r(e.charCodeAt(i));) i++; - if (n) for (; a > 0 && r(e.charCodeAt(a));) a--; - return i === 0 && a === e.length - 1 ? e : e.slice(i, a + 1); - } - function g(e) { - let t = JSON.stringify(e); - if (t === void 0) throw TypeError(`Value is not JSON serializable`); - return r(typeof t == `string`), t; - } - n.exports = { - collectASequenceOfCodePoints: a, - collectASequenceOfCodePointsFast: o, - forgivingBase64: c, - isASCIIWhitespace: l, - isomorphicDecode: u, - isomorphicEncode: f, - parseJSONFromBytes: p, - removeASCIIWhitespace: m, - removeChars: h, - serializeJavascriptValueToJSONString: g - }; -})); -var ja$3 = c$12(((e, n) => { - let r = f$11(`node:assert`), { forgivingBase64: i, collectASequenceOfCodePoints: a, collectASequenceOfCodePointsFast: o, isomorphicDecode: s, removeASCIIWhitespace: c, removeChars: l } = Aa$3(), u = new TextEncoder(), d = /^[-!#$%&'*+.^_|~A-Za-z0-9]+$/u, f = /[\u000A\u000D\u0009\u0020]/u, p = /^[\u0009\u0020-\u007E\u0080-\u00FF]+$/u; - function m(e) { - r(e.protocol === `data:`); - let t = h(e, !0); - t = t.slice(5); - let n = { position: 0 }, a = o(`,`, t, n), l = a.length; - if (a = c(a, !0, !0), n.position >= t.length) return `failure`; - n.position++; - let u = g(t.slice(l + 1)); - if (/;(?:\u0020*)base64$/iu.test(a)) { - if (u = i(s(u)), u === `failure`) return `failure`; - a = a.slice(0, -6), a = a.replace(/(\u0020+)$/u, ``), a = a.slice(0, -1); - } - a.startsWith(`;`) && (a = `text/plain` + a); - let d = b(a); - return d === `failure` && (d = b(`text/plain;charset=US-ASCII`)), { - mimeType: d, - body: u - }; - } - function h(e, t = !1) { - if (!t) return e.href; - let n = e.href, r = e.hash.length, i = r === 0 ? n : n.substring(0, n.length - r); - return !r && n.endsWith(`#`) ? i.slice(0, -1) : i; - } - function g(e) { - return y(u.encode(e)); - } - function _(e) { - return e >= 48 && e <= 57 || e >= 65 && e <= 70 || e >= 97 && e <= 102; - } - function v(e) { - return e >= 48 && e <= 57 ? e - 48 : (e & 223) - 55; - } - function y(e) { - let t = e.length, n = new Uint8Array(t), r = 0, i = 0; - for (; i < t;) { - let t = e[i]; - t === 37 ? t === 37 && !(_(e[i + 1]) && _(e[i + 2])) ? n[r++] = 37 : (n[r++] = v(e[i + 1]) << 4 | v(e[i + 2]), i += 2) : n[r++] = t, ++i; - } - return t === r ? n : n.subarray(0, r); - } - function b(e) { - e = w(e, !0, !0); - let t = { position: 0 }, n = o(`/`, e, t); - if (n.length === 0 || !d.test(n) || t.position >= e.length) return `failure`; - t.position++; - let r = o(`;`, e, t); - if (r = w(r, !1, !0), r.length === 0 || !d.test(r)) return `failure`; - let i = n.toLowerCase(), s = r.toLowerCase(), c = { - type: i, - subtype: s, - parameters: /* @__PURE__ */ new Map(), - essence: `${i}/${s}` - }; - for (; t.position < e.length;) { - t.position++, a((e) => f.test(e), e, t); - let n = a((e) => e !== `;` && e !== `=`, e, t); - if (n = n.toLowerCase(), t.position < e.length) { - if (e[t.position] === `;`) continue; - t.position++; - } - if (t.position >= e.length) break; - let r = null; - if (e[t.position] === `"`) r = x(e, t, !0), o(`;`, e, t); - else if (r = o(`;`, e, t), r = w(r, !1, !0), r.length === 0) continue; - n.length !== 0 && d.test(n) && (r.length === 0 || p.test(r)) && !c.parameters.has(n) && c.parameters.set(n, r); - } - return c; - } - function x(e, t, n = !1) { - let i = t.position, o = ``; - for (r(e[t.position] === `"`), t.position++; o += a((e) => e !== `"` && e !== `\\`, e, t), !(t.position >= e.length);) { - let n = e[t.position]; - if (t.position++, n === `\\`) { - if (t.position >= e.length) { - o += `\\`; - break; - } - o += e[t.position], t.position++; - } else { - r(n === `"`); - break; - } - } - return n ? o : e.slice(i, t.position); - } - function S(e) { - r(e !== `failure`); - let { parameters: t, essence: n } = e, i = n; - for (let [e, n] of t.entries()) i += `;`, i += e, i += `=`, d.test(n) || (n = n.replace(/[\\"]/gu, `\\$&`), n = `"` + n, n += `"`), i += n; - return i; - } - function C(e) { - return e === 13 || e === 10 || e === 9 || e === 32; - } - function w(e, t = !0, n = !0) { - return l(e, t, n, C); - } - function T(e) { - switch (e.essence) { - case `application/ecmascript`: - case `application/javascript`: - case `application/x-ecmascript`: - case `application/x-javascript`: - case `text/ecmascript`: - case `text/javascript`: - case `text/javascript1.0`: - case `text/javascript1.1`: - case `text/javascript1.2`: - case `text/javascript1.3`: - case `text/javascript1.4`: - case `text/javascript1.5`: - case `text/jscript`: - case `text/livescript`: - case `text/x-ecmascript`: - case `text/x-javascript`: return `text/javascript`; - case `application/json`: - case `text/json`: return `application/json`; - case `image/svg+xml`: return `image/svg+xml`; - case `text/xml`: - case `application/xml`: return `application/xml`; - } - return e.subtype.endsWith(`+json`) ? `application/json` : e.subtype.endsWith(`+xml`) ? `application/xml` : ``; - } - n.exports = { - dataURLProcessor: m, - URLSerializer: h, - stringPercentDecode: g, - parseMIMEType: b, - collectAnHTTPQuotedString: x, - serializeAMimeType: S, - removeHTTPWhitespace: w, - minimizeSupportedMimeType: T, - HTTP_TOKEN_CODEPOINTS: d - }; -})); -var Ma$3 = c$12(((e, n) => { - let r = { - __proto__: null, - "node:crypto": () => f$11(`node:crypto`), - "node:sqlite": () => f$11(`node:sqlite`), - "node:worker_threads": () => f$11(`node:worker_threads`), - "node:zlib": () => f$11(`node:zlib`) - }; - function i(e) { - try { - return r[e](), !0; - } catch (e) { - if (e.code !== `ERR_UNKNOWN_BUILTIN_MODULE` && e.code !== `ERR_NO_CRYPTO`) throw e; - return !1; - } - } - function a(e, t) { - return r[e]()[t] !== void 0; - } - let o = [`markAsUncloneable`, `zstd`], s = { - markAsUncloneable: [`node:worker_threads`, `markAsUncloneable`], - zstd: [`node:zlib`, `createZstdDecompress`] - }, c = [`crypto`, `sqlite`], l = [...c, ...o]; - function u(e) { - if (c.includes(e)) return i(`node:${e}`); - if (o.includes(e)) { - let [t, n] = s[e]; - return a(t, n); - } - throw TypeError(`unknown feature: ${e}`); - } - let d = new class { - #e = /* @__PURE__ */ new Map(); - clear() { - this.#e.clear(); - } - has(e) { - return this.#e.get(e) ?? this.#t(e); - } - set(e, t) { - if (l.includes(e) === !1) throw TypeError(`unknown feature: ${e}`); - this.#e.set(e, t); - } - #t(e) { - let t = u(e); - return this.#e.set(e, t), t; - } - }(); - n.exports.runtimeFeatures = d, n.exports.default = d; -})); -var Na$3 = c$12(((e, n) => { - let r = f$11(`node:assert`), { types: i, inspect: a } = f$11(`node:util`), { runtimeFeatures: o } = Ma$3(), s = Function.call.bind(Function.prototype[Symbol.hasInstance]), c = { - converters: {}, - util: {}, - errors: {}, - is: {} - }; - c.errors.exception = function(e) { - return TypeError(`${e.header}: ${e.message}`); - }, c.errors.conversionFailed = function(e) { - let t = e.types.length === 1 ? `` : ` one of`, n = `${e.argument} could not be converted to${t}: ${e.types.join(`, `)}.`; - return c.errors.exception({ - header: e.prefix, - message: n - }); - }, c.errors.invalidArgument = function(e) { - return c.errors.exception({ - header: e.prefix, - message: `"${e.value}" is an invalid ${e.type}.` - }); - }, c.brandCheck = function(e, t) { - if (!s(t, e)) { - let e = TypeError(`Illegal invocation`); - throw e.code = `ERR_INVALID_THIS`, e; - } - }, c.brandCheckMultiple = function(e) { - let t = e.map((e) => c.util.MakeTypeAssertion(e)); - return (e) => { - if (t.every((t) => !t(e))) { - let e = TypeError(`Illegal invocation`); - throw e.code = `ERR_INVALID_THIS`, e; - } - }; - }, c.argumentLengthCheck = function({ length: e }, t, n) { - if (e < t) throw c.errors.exception({ - message: `${t} argument${t === 1 ? `` : `s`} required, but${e ? ` only` : ``} ${e} found.`, - header: n - }); - }, c.illegalConstructor = function() { - throw c.errors.exception({ - header: `TypeError`, - message: `Illegal constructor` - }); - }, c.util.MakeTypeAssertion = function(e) { - return (t) => s(e, t); - }, c.util.Type = function(e) { - switch (typeof e) { - case `undefined`: return 1; - case `boolean`: return 2; - case `string`: return 3; - case `symbol`: return 4; - case `number`: return 5; - case `bigint`: return 6; - case `function`: - case `object`: return e === null ? 7 : 8; - } - }, c.util.Types = { - UNDEFINED: 1, - BOOLEAN: 2, - STRING: 3, - SYMBOL: 4, - NUMBER: 5, - BIGINT: 6, - NULL: 7, - OBJECT: 8 - }, c.util.TypeValueToString = function(e) { - switch (c.util.Type(e)) { - case 1: return `Undefined`; - case 2: return `Boolean`; - case 3: return `String`; - case 4: return `Symbol`; - case 5: return `Number`; - case 6: return `BigInt`; - case 7: return `Null`; - case 8: return `Object`; - } - }, c.util.markAsUncloneable = o.has(`markAsUncloneable`) ? f$11(`node:worker_threads`).markAsUncloneable : () => {}, c.util.ConvertToInt = function(e, t, n, r) { - let i, a; - t === 64 ? (i = 2 ** 53 - 1, a = n === `unsigned` ? 0 : -9007199254740991) : n === `unsigned` ? (a = 0, i = 2 ** t - 1) : (a = -(2 ** (t - 1)), i = 2 ** (t - 1) - 1); - let o = Number(e); - if (o === 0 && (o = 0), c.util.HasFlag(r, c.attributes.EnforceRange)) { - if (Number.isNaN(o) || o === Infinity || o === -Infinity) throw c.errors.exception({ - header: `Integer conversion`, - message: `Could not convert ${c.util.Stringify(e)} to an integer.` - }); - if (o = c.util.IntegerPart(o), o < a || o > i) throw c.errors.exception({ - header: `Integer conversion`, - message: `Value must be between ${a}-${i}, got ${o}.` - }); - return o; - } - return !Number.isNaN(o) && c.util.HasFlag(r, c.attributes.Clamp) ? (o = Math.min(Math.max(o, a), i), o = Math.floor(o) % 2 == 0 ? Math.floor(o) : Math.ceil(o), o) : Number.isNaN(o) || o === 0 && Object.is(0, o) || o === Infinity || o === -Infinity ? 0 : (o = c.util.IntegerPart(o), o %= 2 ** t, n === `signed` && o >= 2 ** (t - 1) ? o - 2 ** t : o); - }, c.util.IntegerPart = function(e) { - let t = Math.floor(Math.abs(e)); - return e < 0 ? -1 * t : t; - }, c.util.Stringify = function(e) { - switch (c.util.Type(e)) { - case 4: return `Symbol(${e.description})`; - case 8: return a(e); - case 3: return `"${e}"`; - case 6: return `${e}n`; - default: return `${e}`; - } - }, c.util.IsResizableArrayBuffer = function(e) { - if (i.isArrayBuffer(e)) return e.resizable; - if (i.isSharedArrayBuffer(e)) return e.growable; - throw c.errors.exception({ - header: `IsResizableArrayBuffer`, - message: `"${c.util.Stringify(e)}" is not an array buffer.` - }); - }, c.util.HasFlag = function(e, t) { - return typeof e == `number` && (e & t) === t; - }, c.sequenceConverter = function(e) { - return (t, n, r, i) => { - if (c.util.Type(t) !== 8) throw c.errors.exception({ - header: n, - message: `${r} (${c.util.Stringify(t)}) is not iterable.` - }); - let a = typeof i == `function` ? i() : t?.[Symbol.iterator]?.(), o = [], s = 0; - if (a === void 0 || typeof a.next != `function`) throw c.errors.exception({ - header: n, - message: `${r} is not iterable.` - }); - for (;;) { - let { done: t, value: i } = a.next(); - if (t) break; - o.push(e(i, n, `${r}[${s++}]`)); - } - return o; - }; - }, c.recordConverter = function(e, t) { - return (n, r, a) => { - if (c.util.Type(n) !== 8) throw c.errors.exception({ - header: r, - message: `${a} ("${c.util.TypeValueToString(n)}") is not an Object.` - }); - let o = {}; - if (!i.isProxy(n)) { - let i = [...Object.getOwnPropertyNames(n), ...Object.getOwnPropertySymbols(n)]; - for (let s of i) { - let i = c.util.Stringify(s), l = e(s, r, `Key ${i} in ${a}`); - o[l] = t(n[s], r, `${a}[${i}]`); - } - return o; - } - let s = Reflect.ownKeys(n); - for (let i of s) if (Reflect.getOwnPropertyDescriptor(n, i)?.enumerable) { - let s = e(i, r, a); - o[s] = t(n[i], r, a); - } - return o; - }; - }, c.interfaceConverter = function(e, t) { - return (n, r, i) => { - if (!e(n)) throw c.errors.exception({ - header: r, - message: `Expected ${i} ("${c.util.Stringify(n)}") to be an instance of ${t}.` - }); - return n; - }; - }, c.dictionaryConverter = function(e) { - return e.sort((e, t) => (e.key > t.key) - (e.key < t.key)), (t, n, r) => { - let i = {}; - if (t != null && c.util.Type(t) !== 8) throw c.errors.exception({ - header: n, - message: `Expected ${t} to be one of: Null, Undefined, Object.` - }); - for (let a of e) { - let { key: e, defaultValue: o, required: s, converter: l } = a; - if (s === !0 && (t == null || !Object.hasOwn(t, e))) throw c.errors.exception({ - header: n, - message: `Missing required key "${e}".` - }); - let u = t?.[e], d = o !== void 0; - if (d && u === void 0 && (u = o()), s || d || u !== void 0) { - if (u = l(u, n, `${r}.${e}`), a.allowedValues && !a.allowedValues.includes(u)) throw c.errors.exception({ - header: n, - message: `${u} is not an accepted type. Expected one of ${a.allowedValues.join(`, `)}.` - }); - i[e] = u; - } - } - return i; - }; - }, c.nullableConverter = function(e) { - return (t, n, r) => t === null ? t : e(t, n, r); - }, c.is.USVString = function(e) { - return typeof e == `string` && e.isWellFormed(); - }, c.is.ReadableStream = c.util.MakeTypeAssertion(ReadableStream), c.is.Blob = c.util.MakeTypeAssertion(Blob), c.is.URLSearchParams = c.util.MakeTypeAssertion(URLSearchParams), c.is.File = c.util.MakeTypeAssertion(File), c.is.URL = c.util.MakeTypeAssertion(URL), c.is.AbortSignal = c.util.MakeTypeAssertion(AbortSignal), c.is.MessagePort = c.util.MakeTypeAssertion(MessagePort), c.is.BufferSource = function(e) { - return i.isArrayBuffer(e) || ArrayBuffer.isView(e) && i.isArrayBuffer(e.buffer); - }, c.util.getCopyOfBytesHeldByBufferSource = function(e) { - let t = e, n = t, a = 0, o = 0; - if (i.isTypedArray(t) || i.isDataView(t) ? (n = t.buffer, a = t.byteOffset, o = t.byteLength) : (r(i.isAnyArrayBuffer(t)), o = t.byteLength), n.detached) return /* @__PURE__ */ new Uint8Array(); - let s = new Uint8Array(o), c = new Uint8Array(n, a, o); - return s.set(c), s; - }, c.converters.DOMString = function(e, t, n, r) { - if (e === null && c.util.HasFlag(r, c.attributes.LegacyNullToEmptyString)) return ``; - if (typeof e == `symbol`) throw c.errors.exception({ - header: t, - message: `${n} is a symbol, which cannot be converted to a DOMString.` - }); - return String(e); - }, c.converters.ByteString = function(e, t, n) { - if (typeof e == `symbol`) throw c.errors.exception({ - header: t, - message: `${n} is a symbol, which cannot be converted to a ByteString.` - }); - let r = String(e); - for (let e = 0; e < r.length; e++) if (r.charCodeAt(e) > 255) throw TypeError(`Cannot convert argument to a ByteString because the character at index ${e} has a value of ${r.charCodeAt(e)} which is greater than 255.`); - return r; - }, c.converters.USVString = function(e) { - return typeof e == `string` ? e.toWellFormed() : `${e}`.toWellFormed(); - }, c.converters.boolean = function(e) { - return !!e; - }, c.converters.any = function(e) { - return e; - }, c.converters[`long long`] = function(e, t, n) { - return c.util.ConvertToInt(e, 64, `signed`, 0, t, n); - }, c.converters[`unsigned long long`] = function(e, t, n) { - return c.util.ConvertToInt(e, 64, `unsigned`, 0, t, n); - }, c.converters[`unsigned long`] = function(e, t, n) { - return c.util.ConvertToInt(e, 32, `unsigned`, 0, t, n); - }, c.converters[`unsigned short`] = function(e, t, n, r) { - return c.util.ConvertToInt(e, 16, `unsigned`, r, t, n); - }, c.converters.ArrayBuffer = function(e, t, n, r) { - if (c.util.Type(e) !== 8 || !i.isArrayBuffer(e)) throw c.errors.conversionFailed({ - prefix: t, - argument: `${n} ("${c.util.Stringify(e)}")`, - types: [`ArrayBuffer`] - }); - if (!c.util.HasFlag(r, c.attributes.AllowResizable) && c.util.IsResizableArrayBuffer(e)) throw c.errors.exception({ - header: t, - message: `${n} cannot be a resizable ArrayBuffer.` - }); - return e; - }, c.converters.SharedArrayBuffer = function(e, t, n, r) { - if (c.util.Type(e) !== 8 || !i.isSharedArrayBuffer(e)) throw c.errors.conversionFailed({ - prefix: t, - argument: `${n} ("${c.util.Stringify(e)}")`, - types: [`SharedArrayBuffer`] - }); - if (!c.util.HasFlag(r, c.attributes.AllowResizable) && c.util.IsResizableArrayBuffer(e)) throw c.errors.exception({ - header: t, - message: `${n} cannot be a resizable SharedArrayBuffer.` - }); - return e; - }, c.converters.TypedArray = function(e, t, n, r, a) { - if (c.util.Type(e) !== 8 || !i.isTypedArray(e) || e.constructor.name !== t.name) throw c.errors.conversionFailed({ - prefix: n, - argument: `${r} ("${c.util.Stringify(e)}")`, - types: [t.name] - }); - if (!c.util.HasFlag(a, c.attributes.AllowShared) && i.isSharedArrayBuffer(e.buffer)) throw c.errors.exception({ - header: n, - message: `${r} cannot be a view on a shared array buffer.` - }); - if (!c.util.HasFlag(a, c.attributes.AllowResizable) && c.util.IsResizableArrayBuffer(e.buffer)) throw c.errors.exception({ - header: n, - message: `${r} cannot be a view on a resizable array buffer.` - }); - return e; - }, c.converters.DataView = function(e, t, n, r) { - if (c.util.Type(e) !== 8 || !i.isDataView(e)) throw c.errors.conversionFailed({ - prefix: t, - argument: `${n} ("${c.util.Stringify(e)}")`, - types: [`DataView`] - }); - if (!c.util.HasFlag(r, c.attributes.AllowShared) && i.isSharedArrayBuffer(e.buffer)) throw c.errors.exception({ - header: t, - message: `${n} cannot be a view on a shared array buffer.` - }); - if (!c.util.HasFlag(r, c.attributes.AllowResizable) && c.util.IsResizableArrayBuffer(e.buffer)) throw c.errors.exception({ - header: t, - message: `${n} cannot be a view on a resizable array buffer.` - }); - return e; - }, c.converters.ArrayBufferView = function(e, t, n, r) { - if (c.util.Type(e) !== 8 || !i.isArrayBufferView(e)) throw c.errors.conversionFailed({ - prefix: t, - argument: `${n} ("${c.util.Stringify(e)}")`, - types: [`ArrayBufferView`] - }); - if (!c.util.HasFlag(r, c.attributes.AllowShared) && i.isSharedArrayBuffer(e.buffer)) throw c.errors.exception({ - header: t, - message: `${n} cannot be a view on a shared array buffer.` - }); - if (!c.util.HasFlag(r, c.attributes.AllowResizable) && c.util.IsResizableArrayBuffer(e.buffer)) throw c.errors.exception({ - header: t, - message: `${n} cannot be a view on a resizable array buffer.` - }); - return e; - }, c.converters.BufferSource = function(e, t, n, r) { - if (i.isArrayBuffer(e)) return c.converters.ArrayBuffer(e, t, n, r); - if (i.isArrayBufferView(e)) return r &= ~c.attributes.AllowShared, c.converters.ArrayBufferView(e, t, n, r); - throw i.isSharedArrayBuffer(e) ? c.errors.exception({ - header: t, - message: `${n} cannot be a SharedArrayBuffer.` - }) : c.errors.conversionFailed({ - prefix: t, - argument: `${n} ("${c.util.Stringify(e)}")`, - types: [`ArrayBuffer`, `ArrayBufferView`] - }); - }, c.converters.AllowSharedBufferSource = function(e, t, n, r) { - if (i.isArrayBuffer(e)) return c.converters.ArrayBuffer(e, t, n, r); - if (i.isSharedArrayBuffer(e)) return c.converters.SharedArrayBuffer(e, t, n, r); - if (i.isArrayBufferView(e)) return r |= c.attributes.AllowShared, c.converters.ArrayBufferView(e, t, n, r); - throw c.errors.conversionFailed({ - prefix: t, - argument: `${n} ("${c.util.Stringify(e)}")`, - types: [ - `ArrayBuffer`, - `SharedArrayBuffer`, - `ArrayBufferView` - ] - }); - }, c.converters[`sequence`] = c.sequenceConverter(c.converters.ByteString), c.converters[`sequence>`] = c.sequenceConverter(c.converters[`sequence`]), c.converters[`record`] = c.recordConverter(c.converters.ByteString, c.converters.ByteString), c.converters.Blob = c.interfaceConverter(c.is.Blob, `Blob`), c.converters.AbortSignal = c.interfaceConverter(c.is.AbortSignal, `AbortSignal`), c.converters.EventHandlerNonNull = function(e) { - return c.util.Type(e) === 8 ? typeof e == `function` ? e : () => {} : null; - }, c.attributes = { - Clamp: 1, - EnforceRange: 2, - AllowShared: 4, - AllowResizable: 8, - LegacyNullToEmptyString: 16 - }, n.exports = { webidl: c }; -})); -var Pa$3 = c$12(((e, n) => { - let { Transform: r } = f$11(`node:stream`), i = f$11(`node:zlib`), { redirectStatusSet: a, referrerPolicyTokens: o, badPortsSet: s } = Da$3(), { getGlobalOrigin: c } = Oa$3(), { collectAnHTTPQuotedString: l, parseMIMEType: u } = ja$3(), { performance: d } = f$11(`node:perf_hooks`), { ReadableStreamFrom: f, isValidHTTPToken: p, normalizedMethodRecordsBase: m } = q$6(), h = f$11(`node:assert`), { isUint8Array: g } = f$11(`node:util/types`), { webidl: _ } = Na$3(), { isomorphicEncode: v, collectASequenceOfCodePoints: y, removeChars: b } = Aa$3(); - function x(e) { - let t = e.urlList, n = t.length; - return n === 0 ? null : t[n - 1].toString(); - } - function S(e, t) { - if (!a.has(e.status)) return null; - let n = e.headersList.get(`location`, !0); - return n !== null && A(n) && (C(n) || (n = w(n)), n = new URL(n, x(e))), n && !n.hash && (n.hash = t), n; - } - function C(e) { - for (let t = 0; t < e.length; ++t) { - let n = e.charCodeAt(t); - if (n > 126 || n < 32) return !1; - } - return !0; - } - function w(e) { - return Buffer.from(e, `binary`).toString(`utf8`); - } - function T(e) { - return e.urlList[e.urlList.length - 1]; - } - function E(e) { - let t = T(e); - return xe(t) && s.has(t.port) ? `blocked` : `allowed`; - } - function D(e) { - return e instanceof Error || e?.constructor?.name === `Error` || e?.constructor?.name === `DOMException`; - } - function O(e) { - for (let t = 0; t < e.length; ++t) { - let n = e.charCodeAt(t); - if (!(n === 9 || n >= 32 && n <= 126 || n >= 128 && n <= 255)) return !1; - } - return !0; - } - let k = p; - function A(e) { - return (e[0] === ` ` || e[0] === ` ` || e[e.length - 1] === ` ` || e[e.length - 1] === ` ` || e.includes(` -`) || e.includes(`\r`) || e.includes(`\0`)) === !1; - } - function j(e) { - let t = (e.headersList.get(`referrer-policy`, !0) ?? ``).split(`,`), n = ``; - if (t.length) for (let e = t.length; e !== 0; e--) { - let r = t[e - 1].trim(); - if (o.has(r)) { - n = r; - break; - } - } - return n; - } - function M(e, t) { - let n = j(t); - n !== `` && (e.referrerPolicy = n); - } - function N() { - return `allowed`; - } - function P() { - return `success`; - } - function F() { - return `success`; - } - function I(e) { - let t = null; - t = e.mode, e.headersList.set(`sec-fetch-mode`, t, !0); - } - function ee(e) { - let t = e.origin; - if (!(t === `client` || t === void 0)) { - if (e.responseTainting === `cors` || e.mode === `websocket`) e.headersList.append(`origin`, t, !0); - else if (e.method !== `GET` && e.method !== `HEAD`) { - switch (e.referrerPolicy) { - case `no-referrer`: - t = null; - break; - case `no-referrer-when-downgrade`: - case `strict-origin`: - case `strict-origin-when-cross-origin`: - e.origin && be(e.origin) && !be(T(e)) && (t = null); - break; - case `same-origin`: - de(e, T(e)) || (t = null); - break; - default: - } - e.headersList.append(`origin`, t, !0); - } - } - } - function L(e, t) { - return e; - } - function te(e, t, n) { - return !e?.startTime || e.startTime < t ? { - domainLookupStartTime: t, - domainLookupEndTime: t, - connectionStartTime: t, - connectionEndTime: t, - secureConnectionStartTime: t, - ALPNNegotiatedProtocol: e?.ALPNNegotiatedProtocol - } : { - domainLookupStartTime: L(e.domainLookupStartTime, n), - domainLookupEndTime: L(e.domainLookupEndTime, n), - connectionStartTime: L(e.connectionStartTime, n), - connectionEndTime: L(e.connectionEndTime, n), - secureConnectionStartTime: L(e.secureConnectionStartTime, n), - ALPNNegotiatedProtocol: e.ALPNNegotiatedProtocol - }; - } - function R(e) { - return L(d.now(), e); - } - function ne(e) { - return { - startTime: e.startTime ?? 0, - redirectStartTime: 0, - redirectEndTime: 0, - postRedirectStartTime: e.startTime ?? 0, - finalServiceWorkerStartTime: 0, - finalNetworkResponseStartTime: 0, - finalNetworkRequestStartTime: 0, - endTime: 0, - encodedBodySize: 0, - decodedBodySize: 0, - finalConnectionTimingInfo: null - }; - } - function re() { - return { referrerPolicy: `strict-origin-when-cross-origin` }; - } - function z(e) { - return { referrerPolicy: e.referrerPolicy }; - } - function ie(e) { - let t = e.referrerPolicy; - h(t); - let n = null; - if (e.referrer === `client`) { - let e = c(); - if (!e || e.origin === `null`) return `no-referrer`; - n = new URL(e); - } else _.is.URL(e.referrer) && (n = e.referrer); - let r = ae(n), i = ae(n, !0); - switch (r.toString().length > 4096 && (r = i), t) { - case `no-referrer`: return `no-referrer`; - case `origin`: return i ?? ae(n, !0); - case `unsafe-url`: return r; - case `strict-origin`: { - let t = T(e); - return B(r) && !B(t) ? `no-referrer` : i; - } - case `strict-origin-when-cross-origin`: { - let t = T(e); - return de(r, t) ? r : B(r) && !B(t) ? `no-referrer` : i; - } - case `same-origin`: return de(e, r) ? r : `no-referrer`; - case `origin-when-cross-origin`: return de(e, r) ? r : i; - case `no-referrer-when-downgrade`: { - let t = T(e); - return B(r) && !B(t) ? `no-referrer` : r; - } - } - } - function ae(e, t = !1) { - return h(_.is.URL(e)), e = new URL(e), ye(e) ? `no-referrer` : (e.username = ``, e.password = ``, e.hash = ``, t === !0 && (e.pathname = ``, e.search = ``), e); - } - let oe = RegExp.prototype.test.bind(/^127\.(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)\.){2}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)$/), se = RegExp.prototype.test.bind(/^(?:(?:0{1,4}:){7}|(?:0{1,4}:){1,6}:|::)0{0,3}1$/); - function ce(e) { - return e.includes(`:`) ? (e[0] === `[` && e[e.length - 1] === `]` && (e = e.slice(1, -1)), se(e)) : oe(e); - } - function le(e) { - return e == null || e === `null` ? !1 : (e = new URL(e), !!(e.protocol === `https:` || e.protocol === `wss:` || ce(e.hostname) || e.hostname === `localhost` || e.hostname === `localhost.` || e.hostname.endsWith(`.localhost`) || e.hostname.endsWith(`.localhost.`) || e.protocol === `file:`)); - } - function B(e) { - return _.is.URL(e) ? e.href === `about:blank` || e.href === `about:srcdoc` || e.protocol === `data:` || e.protocol === `blob:` ? !0 : le(e.origin) : !1; - } - function ue(e) {} - function de(e, t) { - return e.origin === t.origin && e.origin === `null` || e.protocol === t.protocol && e.hostname === t.hostname && e.port === t.port; - } - function fe(e) { - return e.controller.state === `aborted`; - } - function V(e) { - return e.controller.state === `aborted` || e.controller.state === `terminated`; - } - function pe(e) { - return m[e.toLowerCase()] ?? e; - } - let me = Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())); - function he(e, t, n = 0, r = 1) { - class i { - #e; - #t; - #n; - constructor(e, t) { - this.#e = e, this.#t = t, this.#n = 0; - } - next() { - if (typeof this != `object` || this === null || !(#e in this)) throw TypeError(`'next' called on an object that does not implement interface ${e} Iterator.`); - let i = this.#n, a = t(this.#e); - if (i >= a.length) return { - value: void 0, - done: !0 - }; - let { [n]: o, [r]: s } = a[i]; - this.#n = i + 1; - let c; - switch (this.#t) { - case `key`: - c = o; - break; - case `value`: - c = s; - break; - case `key+value`: - c = [o, s]; - break; - } - return { - value: c, - done: !1 - }; - } - } - return delete i.prototype.constructor, Object.setPrototypeOf(i.prototype, me), Object.defineProperties(i.prototype, { - [Symbol.toStringTag]: { - writable: !1, - enumerable: !1, - configurable: !0, - value: `${e} Iterator` - }, - next: { - writable: !0, - enumerable: !0, - configurable: !0 - } - }), function(e, t) { - return new i(e, t); - }; - } - function ge(e, t, n, r = 0, i = 1) { - let a = he(e, n, r, i), o = { - keys: { - writable: !0, - enumerable: !0, - configurable: !0, - value: function() { - return _.brandCheck(this, t), a(this, `key`); - } - }, - values: { - writable: !0, - enumerable: !0, - configurable: !0, - value: function() { - return _.brandCheck(this, t), a(this, `value`); - } - }, - entries: { - writable: !0, - enumerable: !0, - configurable: !0, - value: function() { - return _.brandCheck(this, t), a(this, `key+value`); - } - }, - forEach: { - writable: !0, - enumerable: !0, - configurable: !0, - value: function(n, r = globalThis) { - if (_.brandCheck(this, t), _.argumentLengthCheck(arguments, 1, `${e}.forEach`), typeof n != `function`) throw TypeError(`Failed to execute 'forEach' on '${e}': parameter 1 is not of type 'Function'.`); - for (let { 0: e, 1: t } of a(this, `key+value`)) n.call(r, t, e, this); - } - } - }; - return Object.defineProperties(t.prototype, { - ...o, - [Symbol.iterator]: { - writable: !0, - enumerable: !1, - configurable: !0, - value: o.entries.value - } - }); - } - function H(e, t, n) { - let r = t, i = n; - try { - ve(e.stream.getReader(), r, i); - } catch (e) { - i(e); - } - } - function _e(e) { - try { - e.close(), e.byobRequest?.respond(0); - } catch (e) { - if (!e.message.includes(`Controller is already closed`) && !e.message.includes(`ReadableStream is already closed`)) throw e; - } - } - async function ve(e, t, n) { - try { - let r = [], i = 0; - do { - let { done: a, value: o } = await e.read(); - if (a) { - t(Buffer.concat(r, i)); - return; - } - if (!g(o)) { - n(TypeError(`Received non-Uint8Array chunk`)); - return; - } - r.push(o), i += o.length; - } while (!0); - } catch (e) { - n(e); - } - } - function ye(e) { - h(`protocol` in e); - let t = e.protocol; - return t === `about:` || t === `blob:` || t === `data:`; - } - function be(e) { - return typeof e == `string` && e[5] === `:` && e[0] === `h` && e[1] === `t` && e[2] === `t` && e[3] === `p` && e[4] === `s` || e.protocol === `https:`; - } - function xe(e) { - h(`protocol` in e); - let t = e.protocol; - return t === `http:` || t === `https:`; - } - function Se(e, t) { - let n = e; - if (!n.startsWith(`bytes`)) return `failure`; - let r = { position: 5 }; - if (t && y((e) => e === ` ` || e === ` `, n, r), n.charCodeAt(r.position) !== 61) return `failure`; - r.position++, t && y((e) => e === ` ` || e === ` `, n, r); - let i = y((e) => { - let t = e.charCodeAt(0); - return t >= 48 && t <= 57; - }, n, r), a = i.length ? Number(i) : null; - if (t && y((e) => e === ` ` || e === ` `, n, r), n.charCodeAt(r.position) !== 45) return `failure`; - r.position++, t && y((e) => e === ` ` || e === ` `, n, r); - let o = y((e) => { - let t = e.charCodeAt(0); - return t >= 48 && t <= 57; - }, n, r), s = o.length ? Number(o) : null; - return r.position < n.length || s === null && a === null || a > s ? `failure` : { - rangeStartValue: a, - rangeEndValue: s - }; - } - function Ce(e, t, n) { - let r = `bytes `; - return r += v(`${e}`), r += `-`, r += v(`${t}`), r += `/`, r += v(`${n}`), r; - } - var we = class extends r { - #e; - constructor(e) { - super(), this.#e = e; - } - _transform(e, t, n) { - if (!this._inflateStream) { - if (e.length === 0) { - n(); - return; - } - this._inflateStream = (e[0] & 15) == 8 ? i.createInflate(this.#e) : i.createInflateRaw(this.#e), this._inflateStream.on(`data`, this.push.bind(this)), this._inflateStream.on(`end`, () => this.push(null)), this._inflateStream.on(`error`, (e) => this.destroy(e)); - } - this._inflateStream.write(e, t, n); - } - _final(e) { - this._inflateStream &&= (this._inflateStream.end(), null), e(); - } - }; - function Te(e) { - return new we(e); - } - function Ee(e) { - let t = null, n = null, r = null, i = De(`content-type`, e); - if (i === null) return `failure`; - for (let e of i) { - let i = u(e); - i === `failure` || i.essence === `*/*` || (r = i, r.essence === n ? !r.parameters.has(`charset`) && t !== null && r.parameters.set(`charset`, t) : (t = null, r.parameters.has(`charset`) && (t = r.parameters.get(`charset`)), n = r.essence)); - } - return r ?? `failure`; - } - function U(e) { - let t = e, n = { position: 0 }, r = [], i = ``; - for (; n.position < t.length;) { - if (i += y((e) => e !== `"` && e !== `,`, t, n), n.position < t.length) if (t.charCodeAt(n.position) === 34) { - if (i += l(t, n), n.position < t.length) continue; - } else h(t.charCodeAt(n.position) === 44), n.position++; - i = b(i, !0, !0, (e) => e === 9 || e === 32), r.push(i), i = ``; - } - return r; - } - function De(e, t) { - let n = t.get(e, !0); - return n === null ? null : U(n); - } - function Oe(e) { - return !1; - } - function ke(e) { - return !!(e.username || e.password); - } - function Ae(e) { - return e != null && e !== `client` && e !== `no-traversable`; - } - var je = class { - get baseUrl() { - return c(); - } - get origin() { - return this.baseUrl?.origin; - } - policyContainer = re(); - }; - n.exports = { - isAborted: fe, - isCancelled: V, - isValidEncodedURL: C, - ReadableStreamFrom: f, - tryUpgradeRequestToAPotentiallyTrustworthyURL: ue, - clampAndCoarsenConnectionTimingInfo: te, - coarsenedSharedCurrentTime: R, - determineRequestsReferrer: ie, - makePolicyContainer: re, - clonePolicyContainer: z, - appendFetchMetadata: I, - appendRequestOriginHeader: ee, - TAOCheck: F, - corsCheck: P, - crossOriginResourcePolicyCheck: N, - createOpaqueTimingInfo: ne, - setRequestReferrerPolicyOnRedirect: M, - isValidHTTPToken: p, - requestBadPort: E, - requestCurrentURL: T, - responseURL: x, - responseLocationURL: S, - isURLPotentiallyTrustworthy: B, - isValidReasonPhrase: O, - sameOrigin: de, - normalizeMethod: pe, - iteratorMixin: ge, - createIterator: he, - isValidHeaderName: k, - isValidHeaderValue: A, - isErrorLike: D, - fullyReadBody: H, - readableStreamClose: _e, - urlIsLocal: ye, - urlHasHttpsScheme: be, - urlIsHttpHttpsScheme: xe, - readAllBytes: ve, - simpleRangeHeaderValue: Se, - buildContentRange: Ce, - createInflate: Te, - extractMimeType: Ee, - getDecodeSplit: De, - environmentSettingsObject: new class { - settingsObject = new je(); - }(), - isOriginIPPotentiallyTrustworthy: ce, - hasAuthenticationEntry: Oe, - includesCredentials: ke, - isTraversableNavigable: Ae - }; -})); -var Fa$3 = c$12(((e, n) => { - let { iteratorMixin: r } = Pa$3(), { kEnumerableProperty: i } = q$6(), { webidl: a } = Na$3(), o = f$11(`node:util`); - var s = class e { - #e = []; - constructor(e = void 0) { - if (a.util.markAsUncloneable(this), e !== void 0) throw a.errors.conversionFailed({ - prefix: `FormData constructor`, - argument: `Argument 1`, - types: [`undefined`] - }); - } - append(t, n, r = void 0) { - a.brandCheck(this, e); - let i = `FormData.append`; - a.argumentLengthCheck(arguments, 2, i), t = a.converters.USVString(t), arguments.length === 3 || a.is.Blob(n) ? (n = a.converters.Blob(n, i, `value`), r !== void 0 && (r = a.converters.USVString(r))) : n = a.converters.USVString(n); - let o = u(t, n, r); - this.#e.push(o); - } - delete(t) { - a.brandCheck(this, e), a.argumentLengthCheck(arguments, 1, `FormData.delete`), t = a.converters.USVString(t), this.#e = this.#e.filter((e) => e.name !== t); - } - get(t) { - a.brandCheck(this, e), a.argumentLengthCheck(arguments, 1, `FormData.get`), t = a.converters.USVString(t); - let n = this.#e.findIndex((e) => e.name === t); - return n === -1 ? null : this.#e[n].value; - } - getAll(t) { - return a.brandCheck(this, e), a.argumentLengthCheck(arguments, 1, `FormData.getAll`), t = a.converters.USVString(t), this.#e.filter((e) => e.name === t).map((e) => e.value); - } - has(t) { - return a.brandCheck(this, e), a.argumentLengthCheck(arguments, 1, `FormData.has`), t = a.converters.USVString(t), this.#e.findIndex((e) => e.name === t) !== -1; - } - set(t, n, r = void 0) { - a.brandCheck(this, e); - let i = `FormData.set`; - a.argumentLengthCheck(arguments, 2, i), t = a.converters.USVString(t), arguments.length === 3 || a.is.Blob(n) ? (n = a.converters.Blob(n, i, `value`), r !== void 0 && (r = a.converters.USVString(r))) : n = a.converters.USVString(n); - let o = u(t, n, r), s = this.#e.findIndex((e) => e.name === t); - s === -1 ? this.#e.push(o) : this.#e = [ - ...this.#e.slice(0, s), - o, - ...this.#e.slice(s + 1).filter((e) => e.name !== t) - ]; - } - [o.inspect.custom](e, t) { - let n = this.#e.reduce((e, t) => (e[t.name] ? Array.isArray(e[t.name]) ? e[t.name].push(t.value) : e[t.name] = [e[t.name], t.value] : e[t.name] = t.value, e), { __proto__: null }); - t.depth ??= e, t.colors ??= !0; - let r = o.formatWithOptions(t, n); - return `FormData ${r.slice(r.indexOf(`]`) + 2)}`; - } - static getFormDataState(e) { - return e.#e; - } - static setFormDataState(e, t) { - e.#e = t; - } - }; - let { getFormDataState: c, setFormDataState: l } = s; - Reflect.deleteProperty(s, `getFormDataState`), Reflect.deleteProperty(s, `setFormDataState`), r(`FormData`, s, c, `name`, `value`), Object.defineProperties(s.prototype, { - append: i, - delete: i, - get: i, - getAll: i, - has: i, - set: i, - [Symbol.toStringTag]: { - value: `FormData`, - configurable: !0 - } - }); - function u(e, t, n) { - if (typeof t != `string` && (a.is.File(t) || (t = new File([t], `blob`, { type: t.type })), n !== void 0)) { - let e = { - type: t.type, - lastModified: t.lastModified - }; - t = new File([t], n, e); - } - return { - name: e, - value: t - }; - } - a.is.FormData = a.util.MakeTypeAssertion(s), n.exports = { - FormData: s, - makeEntry: u, - setFormDataState: l - }; -})); -var Ia$3 = c$12(((e, n) => { - let { bufferToLowerCasedHeaderName: r } = q$6(), { HTTP_TOKEN_CODEPOINTS: i } = ja$3(), { makeEntry: a } = Fa$3(), { webidl: o } = Na$3(), s = f$11(`node:assert`), { isomorphicDecode: c } = Aa$3(), l = Buffer.from(`--`), u = new TextDecoder(), d = new TextDecoder(`utf-8`, { ignoreBOM: !0 }); - function f(e) { - for (let t = 0; t < e.length; ++t) if (e.charCodeAt(t) & -128) return !1; - return !0; - } - function p(e) { - let t = e.length; - if (t < 27 || t > 70) return !1; - for (let n = 0; n < t; ++n) { - let t = e.charCodeAt(n); - if (!(t >= 48 && t <= 57 || t >= 65 && t <= 90 || t >= 97 && t <= 122 || t === 39 || t === 45 || t === 95)) return !1; - } - return !0; - } - function m(e, t) { - s(t !== `failure` && t.essence === `multipart/form-data`); - let n = t.parameters.get(`boundary`); - if (n === void 0) throw b(`missing boundary in content-type header`); - let r = Buffer.from(`--${n}`, `utf8`), i = [], c = { position: 0 }, u = e.indexOf(r); - if (u === -1) throw b(`no boundary found in multipart body`); - for (c.position = u;;) { - if (e.subarray(c.position, c.position + r.length).equals(r)) c.position += r.length; - else throw b(`expected a value starting with -- and the boundary`); - if (y(e, l, c)) return i; - if (e[c.position] !== 13 || e[c.position + 1] !== 10) throw b(`expected CRLF`); - c.position += 2; - let { name: t, filename: n, contentType: u, encoding: p } = g(e, c); - c.position += 2; - let m; - { - let t = e.indexOf(r.subarray(2), c.position); - if (t === -1) throw b(`expected boundary after body`); - m = e.subarray(c.position, t - 4), c.position += m.length, p === `base64` && (m = Buffer.from(m.toString(), `base64`)); - } - if (e[c.position] !== 13 || e[c.position + 1] !== 10) throw b(`expected CRLF`); - c.position += 2; - let h; - n === null ? h = d.decode(Buffer.from(m)) : (u ??= `text/plain`, f(u) || (u = ``), h = new File([m], n, { type: u })), s(o.is.USVString(t)), s(typeof h == `string` && o.is.USVString(h) || o.is.File(h)), i.push(a(t, h, n)); - } - } - function h(e, t) { - e[t.position] === 59 && t.position++, _((e) => e === 32 || e === 9, e, t); - let n = _((e) => C(e) && e !== 61 && e !== 42, e, t); - if (n.length === 0) return null; - let r = n.toString(`ascii`).toLowerCase(), i = e[t.position] === 42; - if (i && t.position++, e[t.position] !== 61) return null; - t.position++, _((e) => e === 32 || e === 9, e, t); - let a; - if (i) { - let n = _((e) => e !== 32 && e !== 13 && e !== 10 && e !== 59, e, t); - if (n[0] !== 117 && n[0] !== 85 || n[1] !== 116 && n[1] !== 84 || n[2] !== 102 && n[2] !== 70 || n[3] !== 45 || n[4] !== 56) throw b(`unknown encoding, expected utf-8''`); - a = decodeURIComponent(u.decode(n.subarray(7))); - } else if (e[t.position] === 34) { - t.position++; - let n = _((e) => e !== 10 && e !== 13 && e !== 34, e, t); - if (e[t.position] !== 34) throw b(`Closing quote not found`); - t.position++, a = u.decode(n).replace(/%0A/gi, ` -`).replace(/%0D/gi, `\r`).replace(/%22/g, `"`); - } else { - let n = _((e) => C(e) && e !== 59, e, t); - a = u.decode(n); - } - return { - name: r, - value: a, - extended: i - }; - } - function g(e, t) { - let n = null, a = null, o = null, s = null; - for (;;) { - if (e[t.position] === 13 && e[t.position + 1] === 10) { - if (n === null) throw b(`header name is null`); - return { - name: n, - filename: a, - contentType: o, - encoding: s - }; - } - let l = _((e) => e !== 10 && e !== 13 && e !== 58, e, t); - if (l = v(l, !0, !0, (e) => e === 9 || e === 32), !i.test(l.toString())) throw b(`header name does not match the field-name token production`); - if (e[t.position] !== 58) throw b(`expected :`); - switch (t.position++, _((e) => e === 32 || e === 9, e, t), r(l)) { - case `content-disposition`: { - n = a = null; - let r = !1; - if (_((e) => C(e), e, t).toString(`ascii`).toLowerCase() !== `form-data`) throw b(`expected form-data for content-disposition header`); - for (; t.position < e.length && (e[t.position] !== 13 || e[t.position + 1] !== 10);) { - let i = h(e, t); - if (!i) break; - i.name === `name` ? n = i.value : i.name === `filename` && (i.extended ? (a = i.value, r = !0) : r || (a = i.value)); - } - if (n === null) throw b(`name attribute is required in content-disposition header`); - break; - } - case `content-type`: { - let n = _((e) => e !== 10 && e !== 13, e, t); - n = v(n, !1, !0, (e) => e === 9 || e === 32), o = c(n); - break; - } - case `content-transfer-encoding`: { - let n = _((e) => e !== 10 && e !== 13, e, t); - n = v(n, !1, !0, (e) => e === 9 || e === 32), s = c(n); - break; - } - default: _((e) => e !== 10 && e !== 13, e, t); - } - if (e[t.position] !== 13 || e[t.position + 1] !== 10) throw b(`expected CRLF`); - t.position += 2; - } - } - function _(e, t, n) { - let r = n.position; - for (; r < t.length && e(t[r]);) ++r; - return t.subarray(n.position, n.position = r); - } - function v(e, t, n, r) { - let i = 0, a = e.length - 1; - if (t) for (; i < e.length && r(e[i]);) i++; - if (n) for (; a > 0 && r(e[a]);) a--; - return i === 0 && a === e.length - 1 ? e : e.subarray(i, a + 1); - } - function y(e, t, n) { - if (e.length < t.length) return !1; - for (let r = 0; r < t.length; r++) if (t[r] !== e[n.position + r]) return !1; - return !0; - } - function b(e) { - return TypeError(`Failed to parse body as FormData.`, { cause: TypeError(e) }); - } - function x(e) { - return e <= 31 || e === 127; - } - function S(e) { - return e === 40 || e === 41 || e === 60 || e === 62 || e === 64 || e === 44 || e === 59 || e === 58 || e === 92 || e === 34 || e === 47 || e === 91 || e === 93 || e === 63 || e === 61; - } - function C(e) { - return e <= 127 && e !== 32 && e !== 9 && !x(e) && !S(e); - } - n.exports = { - multipartFormDataParser: m, - validateBoundary: p - }; -})); -var La$3 = c$12(((e, t) => { - function n() { - let e, t; - return { - promise: new Promise((n, r) => { - e = n, t = r; - }), - resolve: e, - reject: t - }; - } - t.exports = { createDeferredPromise: n }; -})); -var Ra$3 = c$12(((e, n) => { - let r = q$6(), { ReadableStreamFrom: i, readableStreamClose: a, fullyReadBody: o, extractMimeType: s } = Pa$3(), { FormData: c, setFormDataState: l } = Fa$3(), { webidl: u } = Na$3(), d = f$11(`node:assert`), { isErrored: f, isDisturbed: p } = f$11(`node:stream`), { isUint8Array: m } = f$11(`node:util/types`), { serializeAMimeType: h } = ja$3(), { multipartFormDataParser: g } = Ia$3(), { createDeferredPromise: _ } = La$3(), { parseJSONFromBytes: v } = Aa$3(), { utf8DecodeBytes: y } = ka$3(), { runtimeFeatures: b } = Ma$3(), x = b.has(`crypto`) ? f$11(`node:crypto`).randomInt : (e) => Math.floor(Math.random() * e), S = new TextEncoder(); - function C() {} - let w = new FinalizationRegistry((e) => { - let t = e.deref(); - t && !t.locked && !p(t) && !f(t) && t.cancel(`Response object has been garbage collected`).catch(C); - }); - function T(e, t = !1) { - let n = null, o = null; - n = u.is.ReadableStream(e) ? e : u.is.Blob(e) ? e.stream() : new ReadableStream({ - pull() {}, - start(e) { - o = e; - }, - cancel() {}, - type: `bytes` - }), d(u.is.ReadableStream(n)); - let s = null, c = null, l = null, p = null; - if (typeof e == `string`) c = e, p = `text/plain;charset=UTF-8`; - else if (u.is.URLSearchParams(e)) c = e.toString(), p = `application/x-www-form-urlencoded;charset=UTF-8`; - else if (u.is.BufferSource(e)) c = u.util.getCopyOfBytesHeldByBufferSource(e); - else if (u.is.FormData(e)) { - let t = `----formdata-undici-0${`${x(1e11)}`.padStart(11, `0`)}`, n = `--${t}\r\nContent-Disposition: form-data`, r = (e) => e.replace(/\n/g, `%0A`).replace(/\r/g, `%0D`).replace(/"/g, `%22`), i = (e) => e.replace(/\r?\n|\r/g, `\r -`), a = [], o = new Uint8Array([13, 10]); - l = 0; - let u = !1; - for (let [t, s] of e) if (typeof s == `string`) { - let e = S.encode(n + `; name="${r(i(t))}"\r\n\r\n${i(s)}\r\n`); - a.push(e), l += e.byteLength; - } else { - let e = S.encode(`${n}; name="${r(i(t))}"` + (s.name ? `; filename="${r(s.name)}"` : ``) + `\r -Content-Type: ${s.type || `application/octet-stream`}\r\n\r\n`); - a.push(e, s, o), typeof s.size == `number` ? l += e.byteLength + s.size + o.byteLength : u = !0; - } - let d = S.encode(`--${t}--\r\n`); - a.push(d), l += d.byteLength, u && (l = null), c = e, s = async function* () { - for (let e of a) e.stream ? yield* e.stream() : yield e; - }, p = `multipart/form-data; boundary=${t}`; - } else if (u.is.Blob(e)) c = e, l = e.size, e.type && (p = e.type); - else if (typeof e[Symbol.asyncIterator] == `function`) { - if (t) throw TypeError(`keepalive`); - if (r.isDisturbed(e) || e.locked) throw TypeError(`Response body object should not be disturbed or locked`); - n = u.is.ReadableStream(e) ? e : i(e); - } - return (typeof c == `string` || m(c)) && (s = () => (l = typeof c == `string` ? Buffer.byteLength(c) : c.length, c)), s != null && (async () => { - let e = s(), t = e?.[Symbol.asyncIterator]?.(); - if (t) for await (let e of t) { - if (f(n)) break; - e.length && o.enqueue(new Uint8Array(e)); - } - else e?.length && !f(n) && o.enqueue(typeof e == `string` ? S.encode(e) : new Uint8Array(e)); - queueMicrotask(() => a(o)); - })(), [{ - stream: n, - source: c, - length: l - }, p]; - } - function E(e, t = !1) { - return u.is.ReadableStream(e) && (d(!r.isDisturbed(e), `The body has already been consumed.`), d(!e.locked, `The stream is locked.`)), T(e, t); - } - function D(e) { - let { 0: t, 1: n } = e.stream.tee(); - return e.stream = t, { - stream: n, - length: e.length, - source: e.source - }; - } - function O(e, t) { - return { - blob() { - return A(this, (e) => { - let n = M(t(this)); - return n === null ? n = `` : n &&= h(n), new Blob([e], { type: n }); - }, e, t); - }, - arrayBuffer() { - return A(this, (e) => new Uint8Array(e).buffer, e, t); - }, - text() { - return A(this, y, e, t); - }, - json() { - return A(this, v, e, t); - }, - formData() { - return A(this, (e) => { - let n = M(t(this)); - if (n !== null) switch (n.essence) { - case `multipart/form-data`: { - let t = g(e, n), r = new c(); - return l(r, t), r; - } - case `application/x-www-form-urlencoded`: { - let t = new URLSearchParams(e.toString()), n = new c(); - for (let [e, r] of t) n.append(e, r); - return n; - } - } - throw TypeError(`Content-Type was not one of "multipart/form-data" or "application/x-www-form-urlencoded".`); - }, e, t); - }, - bytes() { - return A(this, (e) => new Uint8Array(e), e, t); - } - }; - } - function k(e, t) { - Object.assign(e.prototype, O(e, t)); - } - function A(e, t, n, r) { - try { - u.brandCheck(e, n); - } catch (e) { - return Promise.reject(e); - } - if (e = r(e), j(e)) return Promise.reject(TypeError(`Body is unusable: Body has already been read`)); - let i = _(), a = i.reject, s = (e) => { - try { - i.resolve(t(e)); - } catch (e) { - a(e); - } - }; - return e.body == null ? (s(Buffer.allocUnsafe(0)), i.promise) : (o(e.body, s, a), i.promise); - } - function j(e) { - let t = e.body; - return t != null && (t.stream.locked || r.isDisturbed(t.stream)); - } - function M(e) { - let t = e.headersList, n = s(t); - return n === `failure` ? null : n; - } - n.exports = { - extractBody: T, - safelyExtractBody: E, - cloneBody: D, - mixinBody: k, - streamRegistry: w, - bodyUnusable: j - }; -})); -var za$3 = c$12(((e, n) => { - let r = f$11(`node:assert`), i = q$6(), { channels: a } = ga$3(), o = fa$3(), { RequestContentLengthMismatchError: s, ResponseContentLengthMismatchError: c, RequestAbortedError: l, HeadersTimeoutError: u, HeadersOverflowError: d, SocketError: f, InformationalError: p, BodyTimeoutError: m, HTTPParserError: h, ResponseExceededMaxSizeError: g } = K$6(), { kUrl: _, kReset: v, kClient: y, kParser: b, kBlocking: x, kRunning: S, kPending: C, kSize: w, kWriting: T, kQueue: E, kNoRef: D, kKeepAliveDefaultTimeout: O, kHostHeader: k, kPendingIdx: A, kRunningIdx: j, kError: M, kPipelining: N, kSocket: P, kKeepAliveTimeoutValue: F, kMaxHeadersSize: I, kKeepAliveMaxTimeout: ee, kKeepAliveTimeoutThreshold: L, kHeadersTimeout: te, kBodyTimeout: R, kStrictContentLength: ne, kMaxRequests: re, kCounter: z, kMaxResponseSize: ie, kOnError: ae, kResume: oe, kHTTPContext: se, kClosed: ce } = da$3(), le = wa$3(), B = Buffer.alloc(0), ue = Buffer[Symbol.species], de = i.removeAllListeners, fe = Symbol(`kIdleSocketValidation`), V = Symbol(`kIdleSocketValidationTimeout`), pe = Symbol(`kSocketUsed`), me; - function he() { - let e = process.env.JEST_WORKER_ID ? Ta$3() : void 0, t, n = process.arch !== `ppc64`; - if (process.env.UNDICI_NO_WASM_SIMD === `1` ? n = !1 : process.env.UNDICI_NO_WASM_SIMD === `0` && (n = !0), n) try { - t = new WebAssembly.Module(Ea$3()); - } catch {} - return t ||= new WebAssembly.Module(e || Ta$3()), new WebAssembly.Instance(t, { env: { - wasm_on_url: (e, t, n) => 0, - wasm_on_status: (e, t, n) => { - r(H.ptr === e); - let i = t - ye + _e.byteOffset; - return H.onStatus(new ue(_e.buffer, i, n)); - }, - wasm_on_message_begin: (e) => (r(H.ptr === e), H.onMessageBegin()), - wasm_on_header_field: (e, t, n) => { - r(H.ptr === e); - let i = t - ye + _e.byteOffset; - return H.onHeaderField(new ue(_e.buffer, i, n)); - }, - wasm_on_header_value: (e, t, n) => { - r(H.ptr === e); - let i = t - ye + _e.byteOffset; - return H.onHeaderValue(new ue(_e.buffer, i, n)); - }, - wasm_on_headers_complete: (e, t, n, i) => (r(H.ptr === e), H.onHeadersComplete(t, n === 1, i === 1)), - wasm_on_body: (e, t, n) => { - r(H.ptr === e); - let i = t - ye + _e.byteOffset; - return H.onBody(new ue(_e.buffer, i, n)); - }, - wasm_on_message_complete: (e) => (r(H.ptr === e), H.onMessageComplete()) - } }); - } - let ge = null, H = null, _e = null, ve = 0, ye = null; - var be = class { - constructor(e, t, { exports: n }) { - this.llhttp = n, this.ptr = this.llhttp.llhttp_alloc(le.TYPE.RESPONSE), this.client = e, this.socket = t, this.timeout = null, this.timeoutWeakRef = new WeakRef(this), this.timeoutValue = null, this.timeoutType = null, this.statusCode = 0, this.statusText = ``, this.upgrade = !1, this.headers = [], this.headersSize = 0, this.headersMaxSize = e[I], this.shouldKeepAlive = !1, this.paused = !1, this.resume = this.resume.bind(this), this.bytesRead = 0, this.keepAlive = ``, this.contentLength = ``, this.connection = ``, this.maxResponseSize = e[ie]; - } - setTimeout(e, t) { - e !== this.timeoutValue || t & 1 ^ this.timeoutType & 1 ? (this.timeout &&= (o.clearTimeout(this.timeout), null), e && (t & 1 ? this.timeout = o.setFastTimeout(xe, e, this.timeoutWeakRef) : (this.timeout = setTimeout(xe, e, this.timeoutWeakRef), this.timeout?.unref())), this.timeoutValue = e) : this.timeout && this.timeout.refresh && this.timeout.refresh(), this.timeoutType = t; - } - resume() { - this.socket.destroyed || !this.paused || (r(this.ptr != null), r(H === null), this.llhttp.llhttp_resume(this.ptr), r(this.timeoutType === 5), this.timeout && this.timeout.refresh && this.timeout.refresh(), this.paused = !1, this.execute(this.socket.read() || B), this.readMore()); - } - readMore() { - for (; !this.paused && this.ptr;) { - let e = this.socket.read(); - if (e === null) break; - this.execute(e); - } - } - execute(e) { - r(H === null), r(this.ptr != null), r(!this.paused); - let { socket: t, llhttp: n } = this; - e.length > ve && (ye && n.free(ye), ve = Math.ceil(e.length / 4096) * 4096, ye = n.malloc(ve)), new Uint8Array(n.memory.buffer, ye, ve).set(e); - try { - let r; - try { - _e = e, H = this, r = n.llhttp_execute(this.ptr, ye, e.length); - } finally { - H = null, _e = null; - } - if (r !== le.ERROR.OK) { - let i = e.subarray(n.llhttp_get_error_pos(this.ptr) - ye); - if (r === le.ERROR.PAUSED_UPGRADE) this.onUpgrade(i); - else if (r === le.ERROR.PAUSED) this.paused = !0, t.unshift(i); - else throw this.createError(r, i); - } - } catch (e) { - i.destroy(t, e); - } - } - finish() { - r(H === null), r(this.ptr != null), r(!this.paused); - let { llhttp: e } = this, t; - try { - H = this, t = e.llhttp_finish(this.ptr); - } finally { - H = null; - } - return t === le.ERROR.OK ? null : t === le.ERROR.PAUSED || t === le.ERROR.PAUSED_UPGRADE ? (this.paused = !0, null) : this.createError(t, B); - } - createError(e, t) { - let { llhttp: n, contentLength: r, bytesRead: i } = this; - if (r && i !== parseInt(r, 10)) return new c(); - let a = n.llhttp_get_error_reason(this.ptr), o = ``; - if (a) { - let e = new Uint8Array(n.memory.buffer, a).indexOf(0); - o = `Response does not match the HTTP/1.1 protocol (` + Buffer.from(n.memory.buffer, a, e).toString() + `)`; - } - return new h(o, le.ERROR[e], t); - } - destroy() { - r(H === null), r(this.ptr != null), this.llhttp.llhttp_free(this.ptr), this.ptr = null, this.timeout && o.clearTimeout(this.timeout), this.timeout = null, this.timeoutValue = null, this.timeoutType = null, this.paused = !1; - } - onStatus(e) { - return this.statusText = e.toString(), 0; - } - onMessageBegin() { - let { socket: e, client: t } = this; - if (e.destroyed) return -1; - if (t[S] === 0) return i.destroy(e, new f(`bad response`, i.getSocketInfo(e))), -1; - let n = t[E][t[j]]; - return n ? (n.onResponseStarted(), 0) : -1; - } - onHeaderField(e) { - let t = this.headers.length; - return t & 1 ? this.headers[t - 1] = Buffer.concat([this.headers[t - 1], e]) : this.headers.push(e), this.trackHeader(e.length), 0; - } - onHeaderValue(e) { - let t = this.headers.length; - (t & 1) == 1 ? (this.headers.push(e), t += 1) : this.headers[t - 1] = Buffer.concat([this.headers[t - 1], e]); - let n = this.headers[t - 2]; - if (n.length === 10) { - let t = i.bufferToLowerCasedHeaderName(n); - t === `keep-alive` ? this.keepAlive += e.toString() : t === `connection` && (this.connection += e.toString()); - } else n.length === 14 && i.bufferToLowerCasedHeaderName(n) === `content-length` && (this.contentLength += e.toString()); - return this.trackHeader(e.length), 0; - } - trackHeader(e) { - this.headersSize += e, this.headersSize >= this.headersMaxSize && i.destroy(this.socket, new d()); - } - onUpgrade(e) { - let { upgrade: t, client: n, socket: a, headers: o, statusCode: s } = this; - r(t), r(n[P] === a), r(!a.destroyed), r(!this.paused), r((o.length & 1) == 0); - let c = n[E][n[j]]; - r(c), r(c.upgrade || c.method === `CONNECT`), this.statusCode = 0, this.statusText = ``, this.shouldKeepAlive = !1, this.headers = [], this.headersSize = 0, a.unshift(e), a[b].destroy(), a[b] = null, a[y] = null, a[M] = null, de(a), n[P] = null, n[se] = null, n[E][n[j]++] = null, n.emit(`disconnect`, n[_], [n], new p(`upgrade`)); - try { - c.onUpgrade(s, o, a); - } catch (e) { - i.destroy(a, e); - } - n[oe](); - } - onHeadersComplete(e, t, n) { - let { client: a, socket: o, headers: s, statusText: c } = this; - if (o.destroyed) return -1; - if (a[S] === 0) return i.destroy(o, new f(`bad response`, i.getSocketInfo(o))), -1; - let l = a[E][a[j]]; - if (!l) return -1; - if (r(!this.upgrade), r(this.statusCode < 200), e === 100) return i.destroy(o, new f(`bad response`, i.getSocketInfo(o))), -1; - if (t && !l.upgrade) return i.destroy(o, new f(`bad upgrade`, i.getSocketInfo(o))), -1; - if (r(this.timeoutType === 3), this.statusCode = e, this.shouldKeepAlive = n || l.method === `HEAD` && !o[v] && this.connection.toLowerCase() === `keep-alive`, this.statusCode >= 200) { - let e = l.bodyTimeout == null ? a[R] : l.bodyTimeout; - this.setTimeout(e, 5); - } else this.timeout && this.timeout.refresh && this.timeout.refresh(); - if (l.method === `CONNECT` || t) return r(a[S] === 1), this.upgrade = !0, 2; - if (r((this.headers.length & 1) == 0), this.headers = [], this.headersSize = 0, this.shouldKeepAlive && a[N]) { - let e = this.keepAlive ? i.parseKeepAliveTimeout(this.keepAlive) : null; - if (e != null) { - let t = Math.min(e - a[L], a[ee]); - t <= 0 ? o[v] = !0 : a[F] = t; - } else a[F] = a[O]; - } else o[v] = !0; - let u = l.onHeaders(e, s, this.resume, c) === !1; - return l.aborted ? -1 : l.method === `HEAD` || e < 200 ? 1 : (o[x] && (o[x] = !1, a[oe]()), u ? le.ERROR.PAUSED : 0); - } - onBody(e) { - let { client: t, socket: n, statusCode: a, maxResponseSize: o } = this; - if (n.destroyed) return -1; - let s = t[E][t[j]]; - return r(s), r(this.timeoutType === 5), this.timeout && this.timeout.refresh && this.timeout.refresh(), r(a >= 200), o > -1 && this.bytesRead + e.length > o ? (i.destroy(n, new g()), -1) : (this.bytesRead += e.length, s.onData(e) === !1 ? le.ERROR.PAUSED : 0); - } - onMessageComplete() { - let { client: e, socket: t, statusCode: n, upgrade: a, headers: o, contentLength: s, bytesRead: l, shouldKeepAlive: u } = this; - if (t.destroyed && (!n || u)) return -1; - if (a) return 0; - r(n >= 100), r((this.headers.length & 1) == 0); - let d = e[E][e[j]]; - return r(d), this.statusCode = 0, this.statusText = ``, this.bytesRead = 0, this.contentLength = ``, this.keepAlive = ``, this.connection = ``, this.headers = [], this.headersSize = 0, n < 200 ? 0 : d.method !== `HEAD` && s && l !== parseInt(s, 10) ? (i.destroy(t, new c()), -1) : (d.onComplete(o), e[E][e[j]++] = null, t[pe] = e[C] === 0, t[T] ? (r(e[S] === 0), i.destroy(t, new p(`reset`)), le.ERROR.PAUSED) : u ? t[v] && e[S] === 0 ? (i.destroy(t, new p(`reset`)), le.ERROR.PAUSED) : (e[N] == null || e[N] === 1 ? setImmediate(e[oe]) : e[oe](), 0) : (i.destroy(t, new p(`reset`)), le.ERROR.PAUSED)); - } - }; - function xe(e) { - let t = e.deref(); - if (!t) return; - let { socket: n, timeoutType: a, client: o, paused: s } = t; - a === 3 ? (!n[T] || n.writableNeedDrain || o[S] > 1) && (r(!s, `cannot be paused while waiting for headers`), i.destroy(n, new u())) : a === 5 ? s || i.destroy(n, new m()) : a === 8 && (r(o[S] === 0 && o[F]), i.destroy(n, new p(`socket idle timeout`))); - } - function Se(e, t) { - if (e[P] = t, ge ||= he(), t.errored) throw t.errored; - if (t.destroyed) throw new f(`destroyed`); - return t[D] = !1, t[T] = !1, t[v] = !1, t[x] = !1, t[fe] = 0, t[V] = null, t[pe] = !1, t[b] = new be(e, t, ge), i.addListener(t, `error`, Ce), i.addListener(t, `readable`, we), i.addListener(t, `end`, Te), i.addListener(t, `close`, Ee), t[ce] = !1, t.on(`close`, U), { - version: `h1`, - defaultPipelining: 1, - write(t) { - return je(e, t); - }, - resume() { - ke(e); - }, - destroy(e, n) { - t[ce] ? queueMicrotask(n) : (t.on(`close`, n), t.destroy(e)); - }, - get destroyed() { - return t.destroyed; - }, - busy(n) { - return !!(t[T] || t[v] || t[x] || t[fe] === 1 || n && (e[S] > 0 && !n.idempotent || e[S] > 0 && (n.upgrade || n.method === `CONNECT`) || e[S] > 0 && i.bodyLength(n.body) !== 0 && (i.isStream(n.body) || i.isAsyncIterable(n.body) || i.isFormDataLike(n.body)))); - } - }; - } - function Ce(e) { - r(e.code !== `ERR_TLS_CERT_ALTNAME_INVALID`); - let t = this[b]; - if (e.code === `ECONNRESET` && t.statusCode && !t.shouldKeepAlive) { - let e = t.finish(); - e && (this[M] = e, this[y][ae](e)); - return; - } - this[M] = e, this[y][ae](e); - } - function we() { - this[b]?.readMore(); - } - function Te() { - let e = this[b]; - if (e.statusCode && !e.shouldKeepAlive) { - let t = e.finish(); - t && i.destroy(this, t); - return; - } - i.destroy(this, new f(`other side closed`, i.getSocketInfo(this))); - } - function Ee() { - let e = this[b]; - De(this), e && (!this[M] && e.statusCode && !e.shouldKeepAlive && (this[M] = e.finish() || this[M]), this[b].destroy(), this[b] = null); - let t = this[M] || new f(`closed`, i.getSocketInfo(this)), n = this[y]; - if (n[P] = null, n[se] = null, n.destroyed) { - r(n[C] === 0); - let e = n[E].splice(n[j]); - for (let r = 0; r < e.length; r++) { - let a = e[r]; - i.errorRequest(n, a, t); - } - } else if (n[S] > 0 && t.code !== `UND_ERR_INFO`) { - let e = n[E][n[j]]; - n[E][n[j]++] = null, i.errorRequest(n, e, t); - } - n[A] = n[j], r(n[S] === 0), n.emit(`disconnect`, n[_], [n], t), n[oe](); - } - function U() { - this[ce] = !0; - } - function De(e) { - e[V] && (clearTimeout(e[V]), e[V] = null), e[fe] = 0; - } - function Oe(e, t) { - t[fe] = 1, t[V] = setTimeout(() => { - t[V] = null, t[fe] = 2, e[P] === t && !t.destroyed && e[oe](); - }, 0), t[V].unref?.(); - } - function ke(e) { - let t = e[P]; - if (t && !t.destroyed) { - if (e[w] === 0 ? !t[D] && t.unref && (t.unref(), t[D] = !0) : t[D] && t.ref && (t.ref(), t[D] = !1), e[S] === 0 && e[C] > 0 && t[pe]) { - if (t[fe] === 0) return Oe(e, t), t[b].readMore(), t.destroyed, void 0; - if (t[fe] === 1) return t[b].readMore(), t.destroyed, void 0; - } - if (e[S] === 0 && (t[b].readMore(), t.destroyed)) return; - if (e[w] === 0) t[b].timeoutType !== 8 && t[b].setTimeout(e[F], 8); - else if (e[S] > 0 && t[b].statusCode < 200 && t[b].timeoutType !== 3) { - let n = e[E][e[j]], r = n.headersTimeout == null ? e[te] : n.headersTimeout; - t[b].setTimeout(r, 3); - } - } - } - function Ae(e) { - return e !== `GET` && e !== `HEAD` && e !== `OPTIONS` && e !== `TRACE` && e !== `CONNECT`; - } - function je(e, t) { - let { method: n, path: o, host: c, upgrade: u, blocking: d, reset: f } = t, { body: m, headers: h, contentLength: g } = t, _ = n === `PUT` || n === `POST` || n === `PATCH` || n === `QUERY` || n === `PROPFIND` || n === `PROPPATCH`; - if (i.isFormDataLike(m)) { - me ||= Ra$3().extractBody; - let [e, n] = me(m); - t.contentType ?? h.push(`content-type`, n), m = e.stream, g = e.length; - } else i.isBlobLike(m) && t.contentType == null && m.type && h.push(`content-type`, m.type); - m && typeof m.read == `function` && m.read(0); - let y = i.bodyLength(m); - if (g = y ?? g, g === null && (g = t.contentLength), g === 0 && !_ && (g = null), Ae(n) && g > 0 && t.contentLength !== null && t.contentLength !== g) { - if (e[ne]) return i.errorRequest(e, t, new s()), !1; - process.emitWarning(new s()); - } - let b = e[P]; - De(b); - let S = (n) => { - t.aborted || t.completed || (i.errorRequest(e, t, n || new l()), i.destroy(m), i.destroy(b, new p(`aborted`))); - }; - try { - t.onConnect(S); - } catch (n) { - i.errorRequest(e, t, n); - } - if (t.aborted) return !1; - n === `HEAD` && (b[v] = !0), (u || n === `CONNECT`) && (b[v] = !0), f != null && (b[v] = f), e[re] && b[z]++ >= e[re] && (b[v] = !0), d && (b[x] = !0), b.setTypeOfService && b.setTypeOfService(t.typeOfService); - let C = `${n} ${o} HTTP/1.1\r\n`; - if (typeof c == `string` ? C += `host: ${c}\r\n` : C += e[k], u ? C += `connection: upgrade\r\nupgrade: ${u}\r\n` : e[N] && !b[v] ? C += `connection: keep-alive\r -` : C += `connection: close\r -`, Array.isArray(h)) for (let e = 0; e < h.length; e += 2) { - let t = h[e + 0], n = h[e + 1]; - if (Array.isArray(n)) for (let e = 0; e < n.length; e++) C += `${t}: ${n[e]}\r\n`; - else C += `${t}: ${n}\r\n`; - } - return a.sendHeaders.hasSubscribers && a.sendHeaders.publish({ - request: t, - headers: C, - socket: b - }), !m || y === 0 ? Ne(S, null, e, t, b, g, C, _) : i.isBuffer(m) ? Ne(S, m, e, t, b, g, C, _) : i.isBlobLike(m) ? typeof m.stream == `function` ? Fe(S, m.stream(), e, t, b, g, C, _) : Pe(S, m, e, t, b, g, C, _) : i.isStream(m) ? Me(S, m, e, t, b, g, C, _) : i.isIterable(m) ? Fe(S, m, e, t, b, g, C, _) : r(!1), !0; - } - function Me(e, t, n, a, o, s, c, u) { - r(s !== 0 || n[S] === 0, `stream body cannot be pipelined`); - let d = !1, f = new Ie({ - abort: e, - socket: o, - request: a, - contentLength: s, - client: n, - expectsPayload: u, - header: c - }), p = function(e) { - if (!d) try { - !f.write(e) && this.pause && this.pause(); - } catch (e) { - i.destroy(this, e); - } - }, m = function() { - d || t.resume && t.resume(); - }, h = function() { - if (queueMicrotask(() => { - t.removeListener(`error`, g); - }), !d) { - let e = new l(); - queueMicrotask(() => g(e)); - } - }, g = function(e) { - if (!d) { - if (d = !0, r(o.destroyed || o[T] && n[S] <= 1), o.off(`drain`, m).off(`error`, g), t.removeListener(`data`, p).removeListener(`end`, g).removeListener(`close`, h), !e) try { - f.end(); - } catch (t) { - e = t; - } - f.destroy(e), e && (e.code !== `UND_ERR_INFO` || e.message !== `reset`) ? i.destroy(t, e) : i.destroy(t); - } - }; - t.on(`data`, p).on(`end`, g).on(`error`, g).on(`close`, h), t.resume && t.resume(), o.on(`drain`, m).on(`error`, g), t.errorEmitted ?? t.errored ? setImmediate(g, t.errored) : (t.endEmitted ?? t.readableEnded) && setImmediate(g, null), (t.closeEmitted ?? t.closed) && setImmediate(h); - } - function Ne(e, t, n, a, o, s, c, l) { - try { - t ? i.isBuffer(t) && (r(s === t.byteLength, `buffer body must have content length`), o.cork(), o.write(`${c}content-length: ${s}\r\n\r\n`, `latin1`), o.write(t), o.uncork(), a.onBodySent(t), !l && a.reset !== !1 && (o[v] = !0)) : s === 0 ? o.write(`${c}content-length: 0\r\n\r\n`, `latin1`) : (r(s === null, `no body must not have content length`), o.write(`${c}\r\n`, `latin1`)), a.onRequestSent(), n[oe](); - } catch (t) { - e(t); - } - } - async function Pe(e, t, n, i, a, o, c, l) { - r(o === t.size, `blob body must have content length`); - try { - if (o != null && o !== t.size) throw new s(); - let e = Buffer.from(await t.arrayBuffer()); - a.cork(), a.write(`${c}content-length: ${o}\r\n\r\n`, `latin1`), a.write(e), a.uncork(), i.onBodySent(e), i.onRequestSent(), !l && i.reset !== !1 && (a[v] = !0), n[oe](); - } catch (t) { - e(t); - } - } - async function Fe(e, t, n, i, a, o, s, c) { - r(o !== 0 || n[S] === 0, `iterator body cannot be pipelined`); - let l = null; - function u() { - if (l) { - let e = l; - l = null, e(); - } - } - let d = () => new Promise((e, t) => { - r(l === null), a[M] ? t(a[M]) : l = e; - }); - a.on(`close`, u).on(`drain`, u); - let f = new Ie({ - abort: e, - socket: a, - request: i, - contentLength: o, - client: n, - expectsPayload: c, - header: s - }); - try { - for await (let e of t) { - if (a[M]) throw a[M]; - f.write(e) || await d(); - } - f.end(); - } catch (e) { - f.destroy(e); - } finally { - a.off(`close`, u).off(`drain`, u); - } - } - var Ie = class { - constructor({ abort: e, socket: t, request: n, contentLength: r, client: i, expectsPayload: a, header: o }) { - this.socket = t, this.request = n, this.contentLength = r, this.client = i, this.bytesWritten = 0, this.expectsPayload = a, this.header = o, this.abort = e, t[T] = !0; - } - write(e) { - let { socket: t, request: n, contentLength: r, client: i, bytesWritten: a, expectsPayload: o, header: c } = this; - if (t[M]) throw t[M]; - if (t.destroyed) return !1; - let l = Buffer.byteLength(e); - if (!l) return !0; - if (r !== null && a + l > r) { - if (i[ne]) throw new s(); - process.emitWarning(new s()); - } - t.cork(), a === 0 && (!o && n.reset !== !1 && (t[v] = !0), r === null ? t.write(`${c}transfer-encoding: chunked\r\n`, `latin1`) : t.write(`${c}content-length: ${r}\r\n\r\n`, `latin1`)), r === null && t.write(`\r\n${l.toString(16)}\r\n`, `latin1`), this.bytesWritten += l; - let u = t.write(e); - return t.uncork(), n.onBodySent(e), u || t[b].timeout && t[b].timeoutType === 3 && t[b].timeout.refresh && t[b].timeout.refresh(), u; - } - end() { - let { socket: e, contentLength: t, client: n, bytesWritten: r, expectsPayload: i, header: a, request: o } = this; - if (o.onRequestSent(), e[T] = !1, e[M]) throw e[M]; - if (!e.destroyed) { - if (r === 0 ? i ? e.write(`${a}content-length: 0\r\n\r\n`, `latin1`) : e.write(`${a}\r\n`, `latin1`) : t === null && e.write(`\r -0\r -\r -`, `latin1`), t !== null && r !== t) { - if (n[ne]) throw new s(); - process.emitWarning(new s()); - } - e[b].timeout && e[b].timeoutType === 3 && e[b].timeout.refresh && e[b].timeout.refresh(), n[oe](); - } - } - destroy(e) { - let { socket: t, client: n, abort: i } = this; - t[T] = !1, e && (r(n[S] <= 1, `pipeline should only contain this request`), i(e)); - } - }; - n.exports = Se; -})); -var Ba$3 = c$12(((e, n) => { - let r = f$11(`node:assert`), { pipeline: i } = f$11(`node:stream`), a = q$6(), { RequestContentLengthMismatchError: o, RequestAbortedError: s, SocketError: c, InformationalError: l, InvalidArgumentError: u } = K$6(), { kUrl: d, kReset: f, kClient: p, kRunning: m, kPending: h, kQueue: g, kPendingIdx: _, kRunningIdx: v, kError: y, kSocket: b, kStrictContentLength: x, kOnError: S, kMaxConcurrentStreams: C, kPingInterval: w, kHTTP2Session: T, kHTTP2InitialWindowSize: E, kHTTP2ConnectionWindowSize: D, kResume: O, kSize: k, kHTTPContext: A, kClosed: j, kBodyTimeout: M, kEnableConnectProtocol: N, kRemoteSettings: P, kHTTP2Stream: F, kHTTP2SessionState: I } = da$3(), { channels: ee } = ga$3(), L = Symbol(`open streams`), te, R; - try { - R = f$11(`node:http2`); - } catch { - R = { constants: {} }; - } - let { constants: { HTTP2_HEADER_AUTHORITY: ne, HTTP2_HEADER_METHOD: re, HTTP2_HEADER_PATH: z, HTTP2_HEADER_SCHEME: ie, HTTP2_HEADER_CONTENT_LENGTH: ae, HTTP2_HEADER_EXPECT: oe, HTTP2_HEADER_STATUS: se, HTTP2_HEADER_PROTOCOL: ce, NGHTTP2_REFUSED_STREAM: le, NGHTTP2_CANCEL: B } } = R; - function ue(e) { - let t = []; - for (let [n, r] of Object.entries(e)) if (Array.isArray(r)) for (let e of r) t.push(Buffer.from(n), Buffer.from(e)); - else t.push(Buffer.from(n), Buffer.from(r)); - return t; - } - function de(e, t) { - e[b] = t; - let n = e[E], r = e[D], i = R.connect(e[d], { - createConnection: () => t, - peerMaxConcurrentStreams: e[C], - settings: { - enablePush: !1, - ...n == null ? null : { initialWindowSize: n } - } - }); - return e[b] = t, i[L] = 0, i[p] = e, i[b] = t, i[I] = { ping: { interval: e[w] === 0 ? null : setInterval(me, e[w], i).unref() } }, i[N] = !1, i[P] = !1, r && a.addListener(i, `connect`, V.bind(i, r)), a.addListener(i, `error`, he), a.addListener(i, `frameError`, ge), a.addListener(i, `end`, H), a.addListener(i, `goaway`, _e), a.addListener(i, `close`, ve), a.addListener(i, `remoteSettings`, pe), i.unref(), e[T] = i, t[T] = i, a.addListener(t, `error`, be), a.addListener(t, `end`, xe), a.addListener(t, `close`, ye), t[j] = !1, t.on(`close`, Se), { - version: `h2`, - defaultPipelining: Infinity, - write(t) { - return we(e, t); - }, - resume() { - fe(e); - }, - destroy(e, n) { - t[j] ? queueMicrotask(n) : t.destroy(e).on(`close`, n); - }, - get destroyed() { - return t.destroyed; - }, - busy(t) { - if (t != null) if (e[m] > 0) { - if (t.idempotent === !1 || (t.upgrade === `websocket` || t.method === `CONNECT`) && i[P] === !1 || a.bodyLength(t.body) !== 0 && (a.isStream(t.body) || a.isAsyncIterable(t.body) || a.isFormDataLike(t.body))) return !0; - } else return (t.upgrade === `websocket` || t.method === `CONNECT`) && i[P] === !1; - return !1; - } - }; - } - function fe(e) { - let t = e[b]; - t?.destroyed === !1 && (e[k] === 0 || e[C] === 0 ? (t.unref(), e[T].unref()) : (t.ref(), e[T].ref())); - } - function V(e) { - try { - typeof this.setLocalWindowSize == `function` && this.setLocalWindowSize(e); - } catch {} - } - function pe(e) { - if (this[p][C] = e.maxConcurrentStreams ?? this[p][C], this[P] === !0 && this[N] === !0 && e.enableConnectProtocol === !1) { - let e = new l(`HTTP/2: Server disabled extended CONNECT protocol against RFC-8441`); - this[b][y] = e, this[p][S](e); - return; - } - this[N] = e.enableConnectProtocol ?? this[N], this[P] = !0, this[p][O](); - } - function me(e) { - let t = e[I]; - if ((e.closed || e.destroyed) && t.ping.interval != null) { - clearInterval(t.ping.interval), t.ping.interval = null; - return; - } - e.ping(n.bind(e)); - function n(e, t) { - let n = this[p], r = this[p]; - if (e != null) { - let t = new l(`HTTP/2: "PING" errored - type ${e.message}`); - r[y] = t, n[S](t); - } else n.emit(`ping`, t); - } - } - function he(e) { - r(e.code !== `ERR_TLS_CERT_ALTNAME_INVALID`), this[b][y] = e, this[p][S](e); - } - function ge(e, t, n) { - if (n === 0) { - let n = new l(`HTTP/2: "frameError" received - type ${e}, code ${t}`); - this[b][y] = n, this[p][S](n); - } - } - function H() { - let e = new c(`other side closed`, a.getSocketInfo(this[b])); - this.destroy(e), a.destroy(this[b], e); - } - function _e(e) { - let t = this[y] || new c(`HTTP/2: "GOAWAY" frame received with code ${e}`, a.getSocketInfo(this[b])), n = this[p]; - if (n[b] = null, n[A] = null, this.close(), this[T] = null, a.destroy(this[b], t), n[v] < n[g].length) { - let e = n[g][n[v]]; - n[g][n[v]++] = null, a.errorRequest(n, e, t), n[_] = n[v]; - } - r(n[m] === 0), n.emit(`disconnect`, n[d], [n], t), n.emit(`connectionError`, n[d], [n], t), n[O](); - } - function ve() { - let { [p]: e, [I]: t } = this, { [b]: n } = e, i = this[b][y] || this[y] || new c(`closed`, a.getSocketInfo(n)); - if (e[b] = null, e[A] = null, t.ping.interval != null && (clearInterval(t.ping.interval), t.ping.interval = null), e.destroyed) { - r(e[h] === 0); - let t = e[g].splice(e[v]); - for (let n = 0; n < t.length; n++) { - let r = t[n]; - a.errorRequest(e, r, i); - } - } - } - function ye() { - let e = this[y] || new c(`closed`, a.getSocketInfo(this)), t = this[T][p]; - t[b] = null, t[A] = null, this[T] !== null && this[T].destroy(e), t[_] = t[v], r(t[m] === 0), t.emit(`disconnect`, t[d], [t], e), t[O](); - } - function be(e) { - r(e.code !== `ERR_TLS_CERT_ALTNAME_INVALID`), this[y] = e, this[p][S](e); - } - function xe() { - a.destroy(this, new c(`other side closed`, a.getSocketInfo(this))); - } - function Se() { - this[j] = !0; - } - function Ce(e) { - return e !== `GET` && e !== `HEAD` && e !== `OPTIONS` && e !== `TRACE` && e !== `CONNECT`; - } - function we(e, t) { - let n = t.bodyTimeout ?? e[M], i = e[T], { method: c, path: f, host: p, upgrade: m, expectContinue: h, signal: y, protocol: C, headers: w } = t, { body: E } = t; - if (m != null && m !== `websocket`) return a.errorRequest(e, t, new u(`Custom upgrade "${m}" not supported over HTTP/2`)), !1; - let D = {}; - for (let e = 0; e < w.length; e += 2) { - let t = w[e + 0], n = w[e + 1]; - if (t === `cookie`) { - D[t] == null ? D[t] = n : D[t] = Array.isArray(D[t]) ? (D[t].push(n), D[t]) : [D[t], n]; - continue; - } - if (Array.isArray(n)) for (let e = 0; e < n.length; e++) D[t] ? D[t] += `, ${n[e]}` : D[t] = n[e]; - else D[t] ? D[t] += `, ${n}` : D[t] = n; - } - let k = null, { hostname: A, port: j } = e[d]; - D[ne] = p || `${A}${j ? `:${j}` : ``}`, D[re] = c; - let P = (n) => { - t.aborted || t.completed || (n ||= new s(), a.errorRequest(e, t, n), k != null && (k.removeAllListeners(`data`), k.close(), e[S](n), e[O]()), a.destroy(E, n)); - }; - try { - t.onConnect(P); - } catch (n) { - a.errorRequest(e, t, n); - } - if (t.aborted) return !1; - if (m || c === `CONNECT`) return i.ref(), m === `websocket` ? i[N] === !1 ? (a.errorRequest(e, t, new l(`HTTP/2: Extended CONNECT protocol not supported by server`)), i.unref(), !1) : (D[re] = `CONNECT`, D[ce] = `websocket`, D[z] = f, C === `ws:` || C === `wss:` ? D[ie] = C === `ws:` ? `http` : `https` : D[ie] = C === `http:` ? `http` : `https`, k = i.request(D, { - endStream: !1, - signal: y - }), k[F] = !0, k.once(`response`, (n, r) => { - let { [se]: a, ...o } = n; - t.onUpgrade(a, ue(o), k), ++i[L], e[g][e[v]++] = null; - }), k.on(`error`, () => { - (k.rstCode === le || k.rstCode === B) && P(new l(`HTTP/2: "stream error" received - code ${k.rstCode}`)); - }), k.once(`close`, () => { - --i[L], i[L] === 0 && i.unref(); - }), k.setTimeout(n), !0) : (k = i.request(D, { - endStream: !1, - signal: y - }), k[F] = !0, k.on(`response`, (n) => { - let { [se]: r, ...a } = n; - t.onUpgrade(r, ue(a), k), ++i[L], e[g][e[v]++] = null; - }), k.once(`close`, () => { - --i[L], i[L] === 0 && i.unref(); - }), k.setTimeout(n), !0); - D[z] = f, D[ie] = C === `http:` ? `http` : `https`; - let I = c === `PUT` || c === `POST` || c === `PATCH`; - E && typeof E.read == `function` && E.read(0); - let R = a.bodyLength(E); - if (a.isFormDataLike(E)) { - te ??= Ra$3().extractBody; - let [e, t] = te(E); - D[`content-type`] = t, E = e.stream, R = e.length; - } - if (R ??= t.contentLength, I || (R = null), Ce(c) && R > 0 && t.contentLength != null && t.contentLength !== R) { - if (e[x]) return a.errorRequest(e, t, new o()), !1; - process.emitWarning(new o()); - } - if (R != null && (r(E || R === 0, `no body must not have content length`), D[ae] = `${R}`), i.ref(), ee.sendHeaders.hasSubscribers) { - let e = ``; - for (let t in D) e += `${t}: ${D[t]}\r\n`; - ee.sendHeaders.publish({ - request: t, - headers: e, - socket: i[b] - }); - } - let de = c === `GET` || c === `HEAD` || E === null; - h ? (D[oe] = `100-continue`, k = i.request(D, { - endStream: de, - signal: y - }), k[F] = !0, k.once(`continue`, V)) : (k = i.request(D, { - endStream: de, - signal: y - }), k[F] = !0, V()), ++i[L], k.setTimeout(n); - let fe = !1; - return k.once(`response`, (e) => { - let { [se]: n, ...r } = e; - if (t.onResponseStarted(), fe = !0, t.aborted) { - k.removeAllListeners(`data`); - return; - } - t.onHeaders(Number(n), ue(r), k.resume.bind(k), ``) === !1 && k.pause(), k.on(`data`, (e) => { - t.aborted || t.completed || t.onData(e) === !1 && k.pause(); - }); - }), k.once(`end`, () => { - k.removeAllListeners(`data`), fe ? (!t.aborted && !t.completed && t.onComplete({}), e[g][e[v]++] = null, e[O]()) : (P(new l(`HTTP/2: stream half-closed (remote)`)), e[g][e[v]++] = null, e[_] = e[v], e[O]()); - }), k.once(`close`, () => { - k.removeAllListeners(`data`), --i[L], i[L] === 0 && i.unref(); - }), k.once(`error`, function(e) { - k.removeAllListeners(`data`), P(e); - }), k.once(`frameError`, (e, t) => { - k.removeAllListeners(`data`), P(new l(`HTTP/2: "frameError" received - type ${e}, code ${t}`)); - }), k.on(`aborted`, () => { - k.removeAllListeners(`data`); - }), k.on(`timeout`, () => { - let e = new l(`HTTP/2: "stream timeout after ${n}"`); - k.removeAllListeners(`data`), --i[L], i[L] === 0 && i.unref(), P(e); - }), k.once(`trailers`, (e) => { - t.aborted || t.completed || (k.removeAllListeners(`data`), t.onComplete(e)); - }), !0; - function V() { - !E || R === 0 ? Te(P, k, null, e, t, e[b], R, I) : a.isBuffer(E) ? Te(P, k, E, e, t, e[b], R, I) : a.isBlobLike(E) ? typeof E.stream == `function` ? De(P, k, E.stream(), e, t, e[b], R, I) : U(P, k, E, e, t, e[b], R, I) : a.isStream(E) ? Ee(P, e[b], I, k, E, e, t, R) : a.isIterable(E) ? De(P, k, E, e, t, e[b], R, I) : r(!1); - } - } - function Te(e, t, n, i, o, s, c, l) { - try { - n != null && a.isBuffer(n) && (r(c === n.byteLength, `buffer body must have content length`), t.cork(), t.write(n), t.uncork(), t.end(), o.onBodySent(n)), l || (s[f] = !0), o.onRequestSent(), i[O](); - } catch (t) { - e(t); - } - } - function Ee(e, t, n, o, s, c, l, u) { - r(u !== 0 || c[m] === 0, `stream body cannot be pipelined`); - let d = i(s, o, (r) => { - r ? (a.destroy(d, r), e(r)) : (a.removeAllListeners(d), l.onRequestSent(), n || (t[f] = !0), c[O]()); - }); - a.addListener(d, `data`, p); - function p(e) { - l.onBodySent(e); - } - } - async function U(e, t, n, i, a, s, c, l) { - r(c === n.size, `blob body must have content length`); - try { - if (c != null && c !== n.size) throw new o(); - let e = Buffer.from(await n.arrayBuffer()); - t.cork(), t.write(e), t.uncork(), t.end(), a.onBodySent(e), a.onRequestSent(), l || (s[f] = !0), i[O](); - } catch (t) { - e(t); - } - } - async function De(e, t, n, i, a, o, s, c) { - r(s !== 0 || i[m] === 0, `iterator body cannot be pipelined`); - let l = null; - function u() { - if (l) { - let e = l; - l = null, e(); - } - } - let d = () => new Promise((e, t) => { - r(l === null), o[y] ? t(o[y]) : l = e; - }); - t.on(`close`, u).on(`drain`, u); - try { - for await (let e of n) { - if (o[y]) throw o[y]; - let n = t.write(e); - a.onBodySent(e), n || await d(); - } - t.end(), a.onRequestSent(), c || (o[f] = !0), i[O](); - } catch (t) { - e(t); - } finally { - t.off(`close`, u).off(`drain`, u); - } - } - n.exports = de; -})); -var Va$3 = c$12(((e, n) => { - let r = f$11(`node:assert`), i = f$11(`node:net`), a = f$11(`node:http`), o = q$6(), { ClientStats: s } = ha$3(), { channels: c } = ga$3(), l = _a$3(), u = xa$3(), { InvalidArgumentError: d, InformationalError: f, ClientDestroyedError: p } = K$6(), m = Sa$3(), { kUrl: h, kServerName: g, kClient: _, kBusy: v, kConnect: y, kResuming: b, kRunning: x, kPending: S, kSize: C, kQueue: w, kConnected: T, kConnecting: E, kNeedDrain: D, kKeepAliveDefaultTimeout: O, kHostHeader: k, kPendingIdx: A, kRunningIdx: j, kError: M, kPipelining: N, kKeepAliveTimeoutValue: P, kMaxHeadersSize: F, kKeepAliveMaxTimeout: I, kKeepAliveTimeoutThreshold: ee, kHeadersTimeout: L, kBodyTimeout: te, kStrictContentLength: R, kConnector: ne, kMaxRequests: re, kCounter: z, kClose: ie, kDestroy: ae, kDispatch: oe, kLocalAddress: se, kMaxResponseSize: ce, kOnError: le, kHTTPContext: B, kMaxConcurrentStreams: ue, kHTTP2InitialWindowSize: de, kHTTP2ConnectionWindowSize: fe, kResume: V, kPingInterval: pe } = da$3(), me = za$3(), he = Ba$3(), ge = Symbol(`kClosedResolve`), H = a && a.maxHeaderSize && Number.isInteger(a.maxHeaderSize) && a.maxHeaderSize > 0 ? () => a.maxHeaderSize : () => { - throw new d(`http module not available or http.maxHeaderSize invalid`); - }, _e = () => {}; - function ve(e) { - return e[N] ?? e[B]?.defaultPipelining ?? 1; - } - var ye = class extends u { - constructor(e, { maxHeaderSize: t, headersTimeout: n, socketTimeout: r, requestTimeout: a, connectTimeout: s, bodyTimeout: c, idleTimeout: l, keepAlive: u, keepAliveTimeout: f, maxKeepAliveTimeout: p, keepAliveMaxTimeout: _, keepAliveTimeoutThreshold: v, socketPath: y, pipelining: x, tls: S, strictContentLength: C, maxCachedSessions: T, connect: E, maxRequestsPerClient: M, localAddress: z, maxResponseSize: ie, autoSelectFamily: ae, autoSelectFamilyAttemptTimeout: oe, maxConcurrentStreams: me, allowH2: he, useH2c: _e, initialWindowSize: ve, connectionWindowSize: ye, pingInterval: xe, webSocket: Se } = {}) { - if (u !== void 0) throw new d(`unsupported keepAlive, use pipelining=0 instead`); - if (r !== void 0) throw new d(`unsupported socketTimeout, use headersTimeout & bodyTimeout instead`); - if (a !== void 0) throw new d(`unsupported requestTimeout, use headersTimeout & bodyTimeout instead`); - if (l !== void 0) throw new d(`unsupported idleTimeout, use keepAliveTimeout instead`); - if (p !== void 0) throw new d(`unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead`); - if (t != null) { - if (!Number.isInteger(t) || t < 1) throw new d(`invalid maxHeaderSize`); - } else t = H(); - if (y != null && typeof y != `string`) throw new d(`invalid socketPath`); - if (s != null && (!Number.isFinite(s) || s < 0)) throw new d(`invalid connectTimeout`); - if (f != null && (!Number.isFinite(f) || f <= 0)) throw new d(`invalid keepAliveTimeout`); - if (_ != null && (!Number.isFinite(_) || _ <= 0)) throw new d(`invalid keepAliveMaxTimeout`); - if (v != null && !Number.isFinite(v)) throw new d(`invalid keepAliveTimeoutThreshold`); - if (n != null && (!Number.isInteger(n) || n < 0)) throw new d(`headersTimeout must be a positive integer or zero`); - if (c != null && (!Number.isInteger(c) || c < 0)) throw new d(`bodyTimeout must be a positive integer or zero`); - if (E != null && typeof E != `function` && typeof E != `object`) throw new d(`connect must be a function or an object`); - if (M != null && (!Number.isInteger(M) || M < 0)) throw new d(`maxRequestsPerClient must be a positive number`); - if (z != null && (typeof z != `string` || i.isIP(z) === 0)) throw new d(`localAddress must be valid string IP address`); - if (ie != null && (!Number.isInteger(ie) || ie < -1)) throw new d(`maxResponseSize must be a positive number`); - if (oe != null && (!Number.isInteger(oe) || oe < -1)) throw new d(`autoSelectFamilyAttemptTimeout must be a positive number`); - if (he != null && typeof he != `boolean`) throw new d(`allowH2 must be a valid boolean value`); - if (me != null && (typeof me != `number` || me < 1)) throw new d(`maxConcurrentStreams must be a positive integer, greater than 0`); - if (_e != null && typeof _e != `boolean`) throw new d(`useH2c must be a valid boolean value`); - if (ve != null && (!Number.isInteger(ve) || ve < 1)) throw new d(`initialWindowSize must be a positive integer, greater than 0`); - if (ye != null && (!Number.isInteger(ye) || ye < 1)) throw new d(`connectionWindowSize must be a positive integer, greater than 0`); - if (xe != null && (typeof xe != `number` || !Number.isInteger(xe) || xe < 0)) throw new d(`pingInterval must be a positive integer, greater or equal to 0`); - if (super({ webSocket: Se }), typeof E != `function`) E = m({ - ...S, - maxCachedSessions: T, - allowH2: he, - useH2c: _e, - socketPath: y, - timeout: s, - ...typeof ae == `boolean` ? { - autoSelectFamily: ae, - autoSelectFamilyAttemptTimeout: oe - } : void 0, - ...E - }); - else { - let e = E; - E = (t, n) => e({ - ...t, - ...y == null ? null : { socketPath: y }, - ...he == null ? null : { allowH2: he } - }, n); - } - this[h] = o.parseOrigin(e), this[ne] = E, this[N] = x ?? 1, this[F] = t, this[O] = f ?? 4e3, this[I] = _ ?? 6e5, this[ee] = v ?? 2e3, this[P] = this[O], this[g] = null, this[se] = z ?? null, this[b] = 0, this[D] = 0, this[k] = `host: ${this[h].hostname}${this[h].port ? `:${this[h].port}` : ``}\r\n`, this[te] = c ?? 3e5, this[L] = n ?? 3e5, this[R] = C ?? !0, this[re] = M, this[ge] = null, this[ce] = ie > -1 ? ie : -1, this[B] = null, this[ue] = me ?? 100, this[de] = ve ?? 262144, this[fe] = ye ?? 524288, this[pe] = xe ?? 6e4, this[w] = [], this[j] = 0, this[A] = 0, this[V] = (e) => we(this, e), this[le] = (e) => be(this, e); - } - get pipelining() { - return this[N]; - } - set pipelining(e) { - this[N] = e, this[V](!0); - } - get stats() { - return new s(this); - } - get [S]() { - return this[w].length - this[A]; - } - get [x]() { - return this[A] - this[j]; - } - get [C]() { - return this[w].length - this[j]; - } - get [T]() { - return !!this[B] && !this[E] && !this[B].destroyed; - } - get [v]() { - return !!(this[B]?.busy(null) || this[C] >= (ve(this) || 1) || this[S] > 0); - } - [y](e) { - xe(this), this.once(`connect`, e); - } - [oe](e, t) { - let n = new l(this[h].origin, e, t); - return this[w].push(n), this[b] || (o.bodyLength(n.body) == null && o.isIterable(n.body) ? (this[b] = 1, queueMicrotask(() => we(this))) : this[V](!0)), this[b] && this[D] !== 2 && this[v] && (this[D] = 2), this[D] < 2; - } - [ie]() { - return new Promise((e) => { - this[C] ? this[ge] = e : e(null); - }); - } - [ae](e) { - return new Promise((t) => { - let n = this[w].splice(this[A]); - for (let t = 0; t < n.length; t++) { - let r = n[t]; - o.errorRequest(this, r, e); - } - let r = () => { - this[ge] && (this[ge](), this[ge] = null), t(null); - }; - this[B] ? (this[B].destroy(e, r), this[B] = null) : queueMicrotask(r), this[V](); - }); - } - }; - function be(e, t) { - if (e[x] === 0 && t.code !== `UND_ERR_INFO` && t.code !== `UND_ERR_SOCKET`) { - r(e[A] === e[j]); - let n = e[w].splice(e[j]); - for (let r = 0; r < n.length; r++) { - let i = n[r]; - o.errorRequest(e, i, t); - } - r(e[C] === 0); - } - } - function xe(e) { - r(!e[E]), r(!e[B]); - let { host: t, hostname: n, protocol: a, port: s } = e[h]; - if (n[0] === `[`) { - let e = n.indexOf(`]`); - r(e !== -1); - let t = n.substring(1, e); - r(i.isIPv6(t)), n = t; - } - e[E] = !0, c.beforeConnect.hasSubscribers && c.beforeConnect.publish({ - connectParams: { - host: t, - hostname: n, - protocol: a, - port: s, - version: e[B]?.version, - servername: e[g], - localAddress: e[se] - }, - connector: e[ne] - }); - try { - e[ne]({ - host: t, - hostname: n, - protocol: a, - port: s, - servername: e[g], - localAddress: e[se] - }, (i, l) => { - if (i) { - Se(e, i, { - host: t, - hostname: n, - protocol: a, - port: s - }), e[V](); - return; - } - if (e.destroyed) { - o.destroy(l.on(`error`, _e), new p()), e[V](); - return; - } - r(l); - try { - e[B] = l.alpnProtocol === `h2` ? he(e, l) : me(e, l); - } catch (r) { - l.destroy().on(`error`, _e), Se(e, r, { - host: t, - hostname: n, - protocol: a, - port: s - }), e[V](); - return; - } - e[E] = !1, l[z] = 0, l[re] = e[re], l[_] = e, l[M] = null, c.connected.hasSubscribers && c.connected.publish({ - connectParams: { - host: t, - hostname: n, - protocol: a, - port: s, - version: e[B]?.version, - servername: e[g], - localAddress: e[se] - }, - connector: e[ne], - socket: l - }), e.emit(`connect`, e[h], [e]), e[V](); - }); - } catch (r) { - Se(e, r, { - host: t, - hostname: n, - protocol: a, - port: s - }), e[V](); - } - } - function Se(e, t, { host: n, hostname: i, protocol: a, port: s }) { - if (!e.destroyed) { - if (e[E] = !1, c.connectError.hasSubscribers && c.connectError.publish({ - connectParams: { - host: n, - hostname: i, - protocol: a, - port: s, - version: e[B]?.version, - servername: e[g], - localAddress: e[se] - }, - connector: e[ne], - error: t - }), t.code === `ERR_TLS_CERT_ALTNAME_INVALID`) for (r(e[x] === 0); e[S] > 0 && e[w][e[A]].servername === e[g];) { - let n = e[w][e[A]++]; - o.errorRequest(e, n, t); - } - else be(e, t); - e.emit(`connectionError`, e[h], [e], t); - } - } - function Ce(e) { - e[D] = 0, e.emit(`drain`, e[h], [e]); - } - function we(e, t) { - e[b] !== 2 && (e[b] = 2, Te(e, t), e[b] = 0, e[j] > 256 && (e[w].splice(0, e[j]), e[A] -= e[j], e[j] = 0)); - } - function Te(e, t) { - for (;;) { - if (e.destroyed) { - r(e[S] === 0); - return; - } - if (e[ge] && !e[C]) { - e[ge](), e[ge] = null; - return; - } - if (e[B] && e[B].resume(), e[v]) e[D] = 2; - else if (e[D] === 2) { - t ? (e[D] = 1, queueMicrotask(() => Ce(e))) : Ce(e); - continue; - } - if (e[S] === 0 || e[x] >= (ve(e) || 1)) return; - let n = e[w][e[A]]; - if (n === null) return; - if (e[h].protocol === `https:` && e[g] !== n.servername) { - if (e[x] > 0) return; - e[g] = n.servername, e[B]?.destroy(new f(`servername changed`), () => { - e[B] = null, we(e); - }); - } - if (e[E]) return; - if (!e[B]) { - xe(e); - return; - } - if (e[B].destroyed || e[B].busy(n)) return; - !n.aborted && e[B].write(n) ? e[A]++ : e[w].splice(e[A], 1); - } - } - n.exports = ye; -})); -var Ha$3 = c$12(((e, t) => { - let n = 2048, r = n - 1; - var i = class { - bottom = 0; - top = 0; - list = Array(n).fill(void 0); - next = null; - isEmpty() { - return this.top === this.bottom; - } - isFull() { - return (this.top + 1 & r) === this.bottom; - } - push(e) { - this.list[this.top] = e, this.top = this.top + 1 & r; - } - shift() { - let e = this.list[this.bottom]; - return e === void 0 ? null : (this.list[this.bottom] = void 0, this.bottom = this.bottom + 1 & r, e); - } - }; - t.exports = class { - constructor() { - this.head = this.tail = new i(); - } - isEmpty() { - return this.head.isEmpty(); - } - push(e) { - this.head.isFull() && (this.head = this.head.next = new i()), this.head.push(e); - } - shift() { - let e = this.tail, t = e.shift(); - return e.isEmpty() && e.next !== null && (this.tail = e.next, e.next = null), t; - } - }; -})); -var Ua$3 = c$12(((e, t) => { - let { PoolStats: n } = ha$3(), r = xa$3(), i = Ha$3(), { kConnected: a, kSize: o, kRunning: s, kPending: c, kQueued: l, kBusy: u, kFree: d, kUrl: f, kClose: p, kDestroy: m, kDispatch: h } = da$3(), g = Symbol(`clients`), _ = Symbol(`needDrain`), v = Symbol(`queue`), y = Symbol(`closed resolve`), b = Symbol(`onDrain`), x = Symbol(`onConnect`), S = Symbol(`onDisconnect`), C = Symbol(`onConnectionError`), w = Symbol(`get dispatcher`), T = Symbol(`add client`), E = Symbol(`remove client`); - t.exports = { - PoolBase: class extends r { - [v] = new i(); - [l] = 0; - [g] = []; - [_] = !1; - [b](e, t, n) { - let r = this[v], i = !1; - for (; !i;) { - let t = r.shift(); - if (!t) break; - this[l]--, i = !e.dispatch(t.opts, t.handler); - } - if (e[_] = i, !i && this[_] && (this[_] = !1, this.emit(`drain`, t, [this, ...n])), this[y] && r.isEmpty()) { - let e = []; - for (let t = 0; t < this[g].length; t++) { - let n = this[g][t]; - n.destroyed || e.push(n.close()); - } - return Promise.all(e).then(this[y]); - } - } - [x] = (e, t) => { - this.emit(`connect`, e, [this, ...t]); - }; - [S] = (e, t, n) => { - this.emit(`disconnect`, e, [this, ...t], n); - }; - [C] = (e, t, n) => { - this.emit(`connectionError`, e, [this, ...t], n); - }; - get [u]() { - return this[_]; - } - get [a]() { - let e = 0; - for (let { [a]: t } of this[g]) e += t; - return e; - } - get [d]() { - let e = 0; - for (let { [a]: t, [_]: n } of this[g]) e += t && !n; - return e; - } - get [c]() { - let e = this[l]; - for (let { [c]: t } of this[g]) e += t; - return e; - } - get [s]() { - let e = 0; - for (let { [s]: t } of this[g]) e += t; - return e; - } - get [o]() { - let e = this[l]; - for (let { [o]: t } of this[g]) e += t; - return e; - } - get stats() { - return new n(this); - } - [p]() { - if (this[v].isEmpty()) { - let e = []; - for (let t = 0; t < this[g].length; t++) { - let n = this[g][t]; - n.destroyed || e.push(n.close()); - } - return Promise.all(e); - } else return new Promise((e) => { - this[y] = e; - }); - } - [m](e) { - for (;;) { - let t = this[v].shift(); - if (!t) break; - t.handler.onError(e); - } - let t = Array(this[g].length); - for (let n = 0; n < this[g].length; n++) t[n] = this[g][n].destroy(e); - return Promise.all(t); - } - [h](e, t) { - let n = this[w](); - return n ? n.dispatch(e, t) || (n[_] = !0, this[_] = !this[w]()) : (this[_] = !0, this[v].push({ - opts: e, - handler: t - }), this[l]++), !this[_]; - } - [T](e) { - return e.on(`drain`, this[b].bind(this, e)).on(`connect`, this[x]).on(`disconnect`, this[S]).on(`connectionError`, this[C]), this[g].push(e), this[_] && queueMicrotask(() => { - this[_] && this[b](e, e[f], [e, this]); - }), this; - } - [E](e) { - e.close(() => { - let t = this[g].indexOf(e); - t !== -1 && this[g].splice(t, 1); - }), this[_] = this[g].some((e) => !e[_] && e.closed !== !0 && e.destroyed !== !0); - } - }, - kClients: g, - kNeedDrain: _, - kAddClient: T, - kRemoveClient: E, - kGetDispatcher: w - }; -})); -var Wa$3 = c$12(((e, t) => { - let { PoolBase: n, kClients: r, kNeedDrain: i, kAddClient: a, kGetDispatcher: o, kRemoveClient: s } = Ua$3(), c = Va$3(), { InvalidArgumentError: l } = K$6(), u = q$6(), { kUrl: d } = da$3(), f = Sa$3(), p = Symbol(`options`), m = Symbol(`connections`), h = Symbol(`factory`); - function g(e, t) { - return new c(e, t); - } - t.exports = class extends n { - constructor(e, { connections: t, factory: n = g, connect: i, connectTimeout: a, tls: o, maxCachedSessions: s, socketPath: c, autoSelectFamily: _, autoSelectFamilyAttemptTimeout: v, allowH2: y, clientTtl: b, ...x } = {}) { - if (t != null && (!Number.isFinite(t) || t < 0)) throw new l(`invalid connections`); - if (typeof n != `function`) throw new l(`factory must be a function.`); - if (i != null && typeof i != `function` && typeof i != `object`) throw new l(`connect must be a function or an object`); - typeof i != `function` && (i = f({ - ...o, - maxCachedSessions: s, - allowH2: y, - socketPath: c, - timeout: a, - ...typeof _ == `boolean` ? { - autoSelectFamily: _, - autoSelectFamilyAttemptTimeout: v - } : void 0, - ...i - })), super(x), this[m] = t || null, this[d] = u.parseOrigin(e), this[p] = { - ...u.deepClone(x), - connect: i, - allowH2: y, - clientTtl: b, - socketPath: c - }, this[p].interceptors = x.interceptors ? { ...x.interceptors } : void 0, this[h] = n, this.on(`connect`, (e, t) => { - if (b != null && b > 0) for (let e of t) Object.assign(e, { ttl: Date.now() }); - }), this.on(`connectionError`, (e, t, n) => { - for (let e of t) { - let t = this[r].indexOf(e); - t !== -1 && this[r].splice(t, 1); - } - }); - } - [o]() { - let e = this[p].clientTtl; - for (let t of this[r]) if (e != null && e > 0 && t.ttl && Date.now() - t.ttl > e) this[s](t); - else if (!t[i]) return t; - if (!this[m] || this[r].length < this[m]) { - let e = this[h](this[d], this[p]); - return this[a](e), e; - } - } - }; -})); -var Ga$3 = c$12(((e, t) => { - let { BalancedPoolMissingUpstreamError: n, InvalidArgumentError: r } = K$6(), { PoolBase: i, kClients: a, kNeedDrain: o, kAddClient: s, kRemoveClient: c, kGetDispatcher: l } = Ua$3(), u = Wa$3(), { kUrl: d } = da$3(), f = q$6(), p = Symbol(`factory`), m = Symbol(`options`), h = Symbol(`kGreatestCommonDivisor`), g = Symbol(`kCurrentWeight`), _ = Symbol(`kIndex`), v = Symbol(`kWeight`), y = Symbol(`kMaxWeightPerServer`), b = Symbol(`kErrorPenalty`); - function x(e, t) { - if (e === 0) return t; - for (; t !== 0;) { - let n = t; - t = e % t, e = n; - } - return e; - } - function S(e, t) { - return new u(e, t); - } - t.exports = class extends i { - constructor(e = [], { factory: t = S, ...n } = {}) { - if (typeof t != `function`) throw new r(`factory must be a function.`); - super(n), this[m] = { ...f.deepClone(n) }, this[m].interceptors = n.interceptors ? { ...n.interceptors } : void 0, this[_] = -1, this[g] = 0, this[y] = this[m].maxWeightPerServer || 100, this[b] = this[m].errorPenalty || 15, Array.isArray(e) || (e = [e]), this[p] = t; - for (let t of e) this.addUpstream(t); - this._updateBalancedPoolStats(); - } - addUpstream(e) { - let t = f.parseOrigin(e).origin; - if (this[a].find((e) => e[d].origin === t && e.closed !== !0 && e.destroyed !== !0)) return this; - let n = this[p](t, this[m]); - this[s](n), n.on(`connect`, () => { - n[v] = Math.min(this[y], n[v] + this[b]); - }), n.on(`connectionError`, () => { - n[v] = Math.max(1, n[v] - this[b]), this._updateBalancedPoolStats(); - }), n.on(`disconnect`, (...e) => { - let t = e[2]; - t && t.code === `UND_ERR_SOCKET` && (n[v] = Math.max(1, n[v] - this[b]), this._updateBalancedPoolStats()); - }); - for (let e of this[a]) e[v] = this[y]; - return this._updateBalancedPoolStats(), this; - } - _updateBalancedPoolStats() { - let e = 0; - for (let t = 0; t < this[a].length; t++) e = x(this[a][t][v], e); - this[h] = e; - } - removeUpstream(e) { - let t = f.parseOrigin(e).origin, n = this[a].find((e) => e[d].origin === t && e.closed !== !0 && e.destroyed !== !0); - return n && this[c](n), this; - } - getUpstream(e) { - let t = f.parseOrigin(e).origin; - return this[a].find((e) => e[d].origin === t && e.closed !== !0 && e.destroyed !== !0); - } - get upstreams() { - return this[a].filter((e) => e.closed !== !0 && e.destroyed !== !0).map((e) => e[d].origin); - } - [l]() { - if (this[a].length === 0) throw new n(); - if (!this[a].find((e) => !e[o] && e.closed !== !0 && e.destroyed !== !0) || this[a].map((e) => e[o]).reduce((e, t) => e && t, !0)) return; - let e = 0, t = this[a].findIndex((e) => !e[o]); - for (; e++ < this[a].length;) { - this[_] = (this[_] + 1) % this[a].length; - let e = this[a][this[_]]; - if (e[v] > this[a][t][v] && !e[o] && (t = this[_]), this[_] === 0 && (this[g] = this[g] - this[h], this[g] <= 0 && (this[g] = this[y])), e[v] >= this[g] && !e[o]) return e; - } - return this[g] = this[a][t][v], this[_] = t, this[a][t]; - } - }; -})); -var Ka$3 = c$12(((e, t) => { - let { PoolBase: n, kClients: r, kNeedDrain: i, kAddClient: a, kGetDispatcher: o, kRemoveClient: s } = Ua$3(), c = Va$3(), { InvalidArgumentError: l } = K$6(), u = q$6(), { kUrl: d } = da$3(), f = Sa$3(), p = Symbol(`options`), m = Symbol(`connections`), h = Symbol(`factory`), g = Symbol(`index`); - function _(e, t) { - return new c(e, t); - } - t.exports = class extends n { - constructor(e, { connections: t, factory: n = _, connect: i, connectTimeout: a, tls: o, maxCachedSessions: s, socketPath: c, autoSelectFamily: v, autoSelectFamilyAttemptTimeout: y, allowH2: b, clientTtl: x, ...S } = {}) { - if (t != null && (!Number.isFinite(t) || t < 0)) throw new l(`invalid connections`); - if (typeof n != `function`) throw new l(`factory must be a function.`); - if (i != null && typeof i != `function` && typeof i != `object`) throw new l(`connect must be a function or an object`); - typeof i != `function` && (i = f({ - ...o, - maxCachedSessions: s, - allowH2: b, - socketPath: c, - timeout: a, - ...typeof v == `boolean` ? { - autoSelectFamily: v, - autoSelectFamilyAttemptTimeout: y - } : void 0, - ...i - })), super(), this[m] = t || null, this[d] = u.parseOrigin(e), this[p] = { - ...u.deepClone(S), - connect: i, - allowH2: b, - clientTtl: x, - socketPath: c - }, this[p].interceptors = S.interceptors ? { ...S.interceptors } : void 0, this[h] = n, this[g] = -1, this.on(`connect`, (e, t) => { - if (x != null && x > 0) for (let e of t) Object.assign(e, { ttl: Date.now() }); - }), this.on(`connectionError`, (e, t, n) => { - for (let e of t) { - let t = this[r].indexOf(e); - t !== -1 && this[r].splice(t, 1); - } - }); - } - [o]() { - let e = this[p].clientTtl, t = this[r].length; - if (t === 0) { - let e = this[h](this[d], this[p]); - return this[a](e), e; - } - let n = 0; - for (; n < t;) { - this[g] = (this[g] + 1) % t; - let a = this[r][this[g]]; - if (e != null && e > 0 && a.ttl && Date.now() - a.ttl > e) { - this[s](a), n++; - continue; - } - if (!a[i]) return a; - n++; - } - if (!this[m] || t < this[m]) { - let e = this[h](this[d], this[p]); - return this[a](e), e; - } - } - }; -})); -var qa$3 = c$12(((e, t) => { - let { InvalidArgumentError: n, MaxOriginsReachedError: r } = K$6(), { kClients: i, kRunning: a, kClose: o, kDestroy: s, kDispatch: c, kUrl: l } = da$3(), u = xa$3(), d = Wa$3(), f = Va$3(), p = q$6(), m = Symbol(`onConnect`), h = Symbol(`onDisconnect`), g = Symbol(`onConnectionError`), _ = Symbol(`onDrain`), v = Symbol(`factory`), y = Symbol(`options`), b = Symbol(`origins`); - function x(e, t) { - return t && t.connections === 1 ? new f(e, t) : new d(e, t); - } - t.exports = class extends u { - constructor({ factory: e = x, maxOrigins: t = Infinity, connect: r, ...a } = {}) { - if (typeof e != `function`) throw new n(`factory must be a function.`); - if (r != null && typeof r != `function` && typeof r != `object`) throw new n(`connect must be a function or an object`); - if (typeof t != `number` || Number.isNaN(t) || t <= 0) throw new n(`maxOrigins must be a number greater than 0`); - super(a), r && typeof r != `function` && (r = { ...r }), this[y] = { - ...p.deepClone(a), - maxOrigins: t, - connect: r - }, this[v] = e, this[i] = /* @__PURE__ */ new Map(), this[b] = /* @__PURE__ */ new Set(), this[_] = (e, t) => { - this.emit(`drain`, e, [this, ...t]); - }, this[m] = (e, t) => { - this.emit(`connect`, e, [this, ...t]); - }, this[h] = (e, t, n) => { - this.emit(`disconnect`, e, [this, ...t], n); - }, this[g] = (e, t, n) => { - this.emit(`connectionError`, e, [this, ...t], n); - }; - } - get [a]() { - let e = 0; - for (let { dispatcher: t } of this[i].values()) e += t[a]; - return e; - } - [c](e, t) { - let a; - if (e.origin && (typeof e.origin == `string` || e.origin instanceof URL)) a = String(e.origin); - else throw new n(`opts.origin must be a non-empty string or URL.`); - if (this[b].size >= this[y].maxOrigins && !this[b].has(a)) throw new r(); - let o = this[i].get(a), s = o && o.dispatcher; - if (!s) { - let t = (e) => { - let t = this[i].get(a); - t && (e && --t.count, t.count <= 0 && (this[i].delete(a), t.dispatcher.destroyed || t.dispatcher.close()), this[b].delete(a)); - }; - s = this[v](e.origin, this[y]).on(`drain`, this[_]).on(`connect`, (e, t) => { - let n = this[i].get(a); - n && (n.count += 1), this[m](e, t); - }).on(`disconnect`, (e, n, r) => { - t(!0), this[h](e, n, r); - }).on(`connectionError`, (e, n, r) => { - t(!1), this[g](e, n, r); - }), this[i].set(a, { - count: 0, - dispatcher: s - }), this[b].add(a); - } - return s.dispatch(e, t); - } - [o]() { - let e = []; - for (let { dispatcher: t } of this[i].values()) e.push(t.close()); - return this[i].clear(), Promise.all(e); - } - [s](e) { - let t = []; - for (let { dispatcher: n } of this[i].values()) t.push(n.destroy(e)); - return this[i].clear(), Promise.all(t); - } - get stats() { - let e = {}; - for (let { dispatcher: t } of this[i].values()) t.stats && (e[t[l].origin] = t.stats); - return e; - } - }; -})); -var Ja$2 = c$12(((e, n) => { - let { Buffer: r } = f$11(`node:buffer`), i = f$11(`node:net`), { InvalidArgumentError: a } = K$6(); - function o(e) { - if (i.isIPv4(e)) { - let t = e.split(`.`).map(Number); - return { - type: 1, - buffer: r.from(t) - }; - } - if (i.isIPv6(e)) return { - type: 4, - buffer: s(e) - }; - let t = r.from(e, `utf8`); - if (t.length > 255) throw new a(`Domain name too long (max 255 bytes)`); - return { - type: 3, - buffer: r.concat([r.from([t.length]), t]) - }; - } - function s(e) { - let t = r.alloc(16), n = e; - if (e.includes(`.`)) { - let t = e.lastIndexOf(`:`), r = e.slice(t + 1); - if (i.isIPv4(r)) { - let i = r.split(`.`).map(Number), a = (i[0] << 8 | i[1]).toString(16), o = (i[2] << 8 | i[3]).toString(16); - n = `${e.slice(0, t)}:${a}:${o}`; - } - } - let a = n.indexOf(`::`); - if (a !== -1) { - let e = n.slice(0, a), r = n.slice(a + 2), i = e === `` ? [] : e.split(`:`), o = r === `` ? [] : r.split(`:`), s = 0; - for (let e of i) t.writeUInt16BE(parseInt(e, 16), s), s += 2; - s = 16 - o.length * 2; - for (let e of o) t.writeUInt16BE(parseInt(e, 16), s), s += 2; - } else { - let e = n.split(`:`); - for (let n = 0; n < e.length; n++) t.writeUInt16BE(parseInt(e[n], 16), n * 2); - } - return t; - } - function c(e, t, n) { - let i = r.allocUnsafe(2); - return i.writeUInt16BE(n, 0), r.concat([ - r.from([e]), - t, - i - ]); - } - function l(e, t = 0) { - if (e.length < t + 1) throw new a(`Buffer too small to contain address type`); - let n = e[t], r, i = t + 1; - switch (n) { - case 1: - if (e.length < i + 6) throw new a(`Buffer too small for IPv4 address`); - r = Array.from(e.subarray(i, i + 4)).join(`.`), i += 4; - break; - case 3: { - if (e.length < i + 1) throw new a(`Buffer too small for domain length`); - let t = e[i]; - if (i += 1, e.length < i + t + 2) throw new a(`Buffer too small for domain address`); - r = e.subarray(i, i + t).toString(`utf8`), i += t; - break; - } - case 4: { - if (e.length < i + 18) throw new a(`Buffer too small for IPv6 address`); - let t = []; - for (let n = 0; n < 8; n++) { - let r = e.readUInt16BE(i + n * 2); - t.push(r.toString(16)); - } - r = t.join(`:`), i += 16; - break; - } - default: throw new a(`Invalid address type: ${n}`); - } - if (e.length < i + 2) throw new a(`Buffer too small for port`); - let o = e.readUInt16BE(i); - return i += 2, { - address: r, - port: o, - bytesRead: i - t - }; - } - function u(e) { - let t = { - 1: `General SOCKS server failure`, - 2: `Connection not allowed by ruleset`, - 3: `Network unreachable`, - 4: `Host unreachable`, - 5: `Connection refused`, - 6: `TTL expired`, - 7: `Command not supported`, - 8: `Address type not supported` - }[e] || `Unknown SOCKS5 error code: ${e}`, n = Error(t); - return n.code = `SOCKS5_${e}`, n; - } - n.exports = { - parseAddress: o, - parseIPv6: s, - buildAddressBuffer: c, - parseResponseAddress: l, - createReplyError: u - }; -})); -var Ya$2 = c$12(((e, n) => { - let { EventEmitter: r } = f$11(`node:events`), { Buffer: i } = f$11(`node:buffer`), { InvalidArgumentError: a, Socks5ProxyError: o } = K$6(), { debuglog: s } = f$11(`node:util`), { parseAddress: c } = Ja$2(), l = s(`undici:socks5`), u = i.alloc(0), d = { - NO_AUTH: 0, - GSSAPI: 1, - USERNAME_PASSWORD: 2, - NO_ACCEPTABLE: 255 - }, f = { - CONNECT: 1, - BIND: 2, - UDP_ASSOCIATE: 3 - }, p = { - IPV4: 1, - DOMAIN: 3, - IPV6: 4 - }, m = { - SUCCEEDED: 0, - GENERAL_FAILURE: 1, - CONNECTION_NOT_ALLOWED: 2, - NETWORK_UNREACHABLE: 3, - HOST_UNREACHABLE: 4, - CONNECTION_REFUSED: 5, - TTL_EXPIRED: 6, - COMMAND_NOT_SUPPORTED: 7, - ADDRESS_TYPE_NOT_SUPPORTED: 8 - }, h = { - INITIAL: `initial`, - HANDSHAKING: `handshaking`, - AUTHENTICATING: `authenticating`, - AUTHENTICATED: `authenticated`, - CONNECTING: `connecting`, - CONNECTED: `connected`, - ERROR: `error`, - CLOSED: `closed` - }; - n.exports = { - Socks5Client: class extends r { - constructor(e, t = {}) { - if (super(), !e) throw new a(`socket is required`); - this.socket = e, this.options = t, this.state = h.INITIAL, this.buffer = u, this.onSocketData = this.onData.bind(this), this.onSocketError = this.onError.bind(this), this.onSocketClose = this.onClose.bind(this), this.authMethods = [], t.username && t.password && this.authMethods.push(d.USERNAME_PASSWORD), this.authMethods.push(d.NO_AUTH), this.socket.on(`data`, this.onSocketData), this.socket.on(`error`, this.onSocketError), this.socket.on(`close`, this.onSocketClose); - } - onData(e) { - l(`received data`, e.length, `bytes in state`, this.state), this.buffer = i.concat([this.buffer, e]); - try { - switch (this.state) { - case h.HANDSHAKING: - this.handleHandshakeResponse(); - break; - case h.AUTHENTICATING: - this.handleAuthResponse(); - break; - case h.CONNECTING: - this.handleConnectResponse(); - break; - } - } catch (e) { - this.onError(e); - } - } - onError(e) { - l(`socket error`, e), this.state = h.ERROR, this.emit(`error`, e), this.destroy(); - } - onClose() { - l(`socket closed`), this.state = h.CLOSED, this.emit(`close`); - } - destroy() { - this.socket && !this.socket.destroyed && this.socket.destroy(); - } - markAuthenticated() { - this.state = h.AUTHENTICATED, this.emit(`authenticated`); - } - handshake() { - if (this.state !== h.INITIAL) throw new a(`Handshake already started`); - l(`starting handshake with`, this.authMethods.length, `auth methods`), this.state = h.HANDSHAKING; - let e = i.alloc(2 + this.authMethods.length); - e[0] = 5, e[1] = this.authMethods.length, this.authMethods.forEach((t, n) => { - e[2 + n] = t; - }), this.socket.write(e); - } - handleHandshakeResponse() { - if (this.buffer.length < 2) return; - let e = this.buffer[0], t = this.buffer[1]; - if (e !== 5) throw new o(`Invalid SOCKS version: ${e}`, `UND_ERR_SOCKS5_VERSION`); - if (t === d.NO_ACCEPTABLE) throw new o(`No acceptable authentication method`, `UND_ERR_SOCKS5_AUTH_REJECTED`); - if (this.buffer = this.buffer.subarray(2), l(`server selected auth method`, t), t === d.NO_AUTH) this.markAuthenticated(); - else if (t === d.USERNAME_PASSWORD) this.state = h.AUTHENTICATING, this.sendAuthRequest(); - else throw new o(`Unsupported authentication method: ${t}`, `UND_ERR_SOCKS5_AUTH_METHOD`); - } - sendAuthRequest() { - let { username: e, password: t } = this.options; - if (!e || !t) throw new a(`Username and password required for authentication`); - l(`sending username/password auth`); - let n = i.from(e), r = i.from(t); - if (n.length > 255 || r.length > 255) throw new a(`Username or password too long`); - let o = i.alloc(3 + n.length + r.length); - o[0] = 1, o[1] = n.length, n.copy(o, 2), o[2 + n.length] = r.length, r.copy(o, 3 + n.length), this.socket.write(o); - } - handleAuthResponse() { - if (this.buffer.length < 2) return; - let e = this.buffer[0], t = this.buffer[1]; - if (e !== 1) throw new o(`Invalid auth sub-negotiation version: ${e}`, `UND_ERR_SOCKS5_AUTH_VERSION`); - if (t !== 0) throw new o(`Authentication failed`, `UND_ERR_SOCKS5_AUTH_FAILED`); - this.buffer = this.buffer.subarray(2), l(`authentication successful`), this.markAuthenticated(); - } - connect(e, t) { - if (this.state === h.CONNECTING || this.state === h.CONNECTED) throw new a(`Connection already in progress`); - if (this.state !== h.AUTHENTICATED) throw new a(`Client must be authenticated before CONNECT`); - l(`connecting to`, e, t), this.state = h.CONNECTING; - let n = this.buildConnectRequest(f.CONNECT, e, t); - this.socket.write(n); - } - buildConnectRequest(e, t, n) { - let { type: r, buffer: a } = c(t), o = i.alloc(4 + a.length + 2); - return o[0] = 5, o[1] = e, o[2] = 0, o[3] = r, a.copy(o, 4), o.writeUInt16BE(n, 4 + a.length), o; - } - handleConnectResponse() { - if (this.buffer.length < 4) return; - let e = this.buffer[0], t = this.buffer[1], n = this.buffer[3]; - if (e !== 5) throw new o(`Invalid SOCKS version in reply: ${e}`, `UND_ERR_SOCKS5_REPLY_VERSION`); - let r = 4; - if (n === p.IPV4) r += 6; - else if (n === p.DOMAIN) { - if (this.buffer.length < 5) return; - r += 1 + this.buffer[4] + 2; - } else if (n === p.IPV6) r += 18; - else throw new o(`Invalid address type in reply: ${n}`, `UND_ERR_SOCKS5_ADDR_TYPE`); - if (this.buffer.length < r) return; - if (t !== m.SUCCEEDED) throw new o(`SOCKS5 connection failed: ${this.getReplyErrorMessage(t)}`, `UND_ERR_SOCKS5_REPLY_${t}`); - let i, a = 4; - if (n === p.IPV4) i = Array.from(this.buffer.subarray(a, a + 4)).join(`.`), a += 4; - else if (n === p.DOMAIN) { - let e = this.buffer[a]; - a += 1, i = this.buffer.subarray(a, a + e).toString(), a += e; - } else if (n === p.IPV6) { - let e = []; - for (let t = 0; t < 8; t++) { - let n = this.buffer.readUInt16BE(a + t * 2); - e.push(n.toString(16)); - } - i = e.join(`:`), a += 16; - } - let s = this.buffer.readUInt16BE(a); - this.buffer = u, this.state = h.CONNECTED, this.socket.removeListener(`data`, this.onSocketData), l(`connected, bound address:`, i, `port:`, s), this.emit(`connected`, { - address: i, - port: s - }); - } - getReplyErrorMessage(e) { - switch (e) { - case m.GENERAL_FAILURE: return `General SOCKS server failure`; - case m.CONNECTION_NOT_ALLOWED: return `Connection not allowed by ruleset`; - case m.NETWORK_UNREACHABLE: return `Network unreachable`; - case m.HOST_UNREACHABLE: return `Host unreachable`; - case m.CONNECTION_REFUSED: return `Connection refused`; - case m.TTL_EXPIRED: return `TTL expired`; - case m.COMMAND_NOT_SUPPORTED: return `Command not supported`; - case m.ADDRESS_TYPE_NOT_SUPPORTED: return `Address type not supported`; - default: return `Unknown error code: ${e}`; - } - } - }, - AUTH_METHODS: d, - COMMANDS: f, - ADDRESS_TYPES: p, - REPLY_CODES: m, - STATES: h - }; -})); -var Xa$2 = c$12(((e, n) => { - let { URL: r } = f$11(`node:url`), i, a = xa$3(), { InvalidArgumentError: o } = K$6(), { Socks5Client: s, STATES: c } = Ya$2(), { kDispatch: l, kClose: u, kDestroy: d } = da$3(), f = Wa$3(), p = Sa$3(), { debuglog: m } = f$11(`node:util`), h = m(`undici:socks5-proxy`), g = Symbol(`proxy url`), _ = Symbol(`proxy headers`), v = Symbol(`proxy auth`), y = Symbol(`proxy protocol`), b = Symbol(`pools`), x = Symbol(`connector`), S = Symbol(`request tls settings`), C = !1; - n.exports = class extends a { - constructor(e, t = {}) { - if (super(), C ||= (process.emitWarning(`SOCKS5 proxy support is experimental and subject to change`, `ExperimentalWarning`), !0), !e) throw new o(`Proxy URL is mandatory`); - let n = typeof e == `string` ? new r(e) : e; - if (n.protocol !== `socks5:` && n.protocol !== `socks:`) throw new o(`Proxy URL must use socks5:// or socks:// protocol`); - this[g] = n, this[_] = t.headers || {}, this[y] = t.proxyTls ? `https:` : `http:`, this[S] = t.requestTls, this[v] = { - username: t.username || (n.username ? decodeURIComponent(n.username) : null), - password: t.password || (n.password ? decodeURIComponent(n.password) : null) - }, this[x] = t.connect || p({ - ...t.proxyTls, - servername: t.proxyTls?.servername || n.hostname - }), this[b] = /* @__PURE__ */ new Map(); - } - async createSocks5Connection(e, t) { - let n = this[g].hostname, r = parseInt(this[g].port) || 1080; - h(`creating SOCKS5 connection to`, n, r); - let i = await new Promise((e, t) => { - this[x]({ - hostname: n, - host: n, - port: r, - protocol: this[y] - }, (n, r) => { - n ? t(n) : e(r); - }); - }), a = new s(i, this[v]); - return a.on(`error`, (e) => { - h(`SOCKS5 error:`, e), i.destroy(); - }), await a.handshake(), await new Promise((e, t) => { - let n = setTimeout(() => { - t(Error(`SOCKS5 authentication timeout`)); - }, 5e3), r = () => { - clearTimeout(n), a.removeListener(`error`, i), e(); - }, i = (e) => { - clearTimeout(n), a.removeListener(`authenticated`, r), t(e); - }; - a.state === c.AUTHENTICATED ? (clearTimeout(n), e()) : (a.once(`authenticated`, r), a.once(`error`, i)); - }), await a.connect(e, t), await new Promise((n, r) => { - let i = setTimeout(() => { - r(Error(`SOCKS5 connection timeout`)); - }, 5e3), o = (r) => { - h(`SOCKS5 tunnel established to`, e, t, `via`, r), clearTimeout(i), a.removeListener(`error`, s), n(); - }, s = (e) => { - clearTimeout(i), a.removeListener(`connected`, o), r(e); - }; - a.once(`connected`, o), a.once(`error`, s); - }), i; - } - [l](e, n) { - let { origin: a } = e; - h(`dispatching request to`, a, `via SOCKS5`); - try { - let o = String(a), s = this[b].get(o); - return (!s || s.destroyed || s.closed) && (s = new f(a, { - pipelining: e.pipelining, - connections: e.connections, - connect: async (e, n) => { - try { - let e = new r(a), o = e.hostname, s = parseInt(e.port) || (e.protocol === `https:` ? 443 : 80); - h(`establishing SOCKS5 connection to`, o, s); - let c = await this.createSocks5Connection(o, s), l = c; - e.protocol === `https:` && (i ||= f$11(`node:tls`), h(`upgrading to TLS`), l = i.connect({ - ...this[S], - socket: c, - servername: this[S]?.servername || o - }), await new Promise((e, t) => { - l.once(`secureConnect`, e), l.once(`error`, t); - })), n(null, l); - } catch (e) { - h(`SOCKS5 connection error:`, e), n(e); - } - } - }), this[b].set(o, s)), s[l](e, n); - } catch (e) { - if (h(`dispatch error:`, e), typeof n.onResponseError == `function`) return n.onResponseError(null, e), !1; - if (typeof n.onError == `function`) return n.onError(e), !1; - throw e; - } - } - async [u]() { - let e = []; - for (let t of this[b].values()) e.push(t.close()); - this[b].clear(), await Promise.all(e); - } - async [d](e) { - let t = []; - for (let n of this[b].values()) t.push(n.destroy(e)); - this[b].clear(), await Promise.all(t); - } - }; -})); -var Za$2 = c$12(((e, t) => { - let { kProxy: n, kClose: r, kDestroy: i, kDispatch: a } = da$3(), o = qa$3(), s = Wa$3(), c = xa$3(), { InvalidArgumentError: l, RequestAbortedError: u, SecureProxyConnectionError: d } = K$6(), f = Sa$3(), p = Va$3(), { channels: m } = ga$3(), h = Xa$2(), g = Symbol(`proxy agent`), _ = Symbol(`proxy client`), v = Symbol(`proxy headers`), y = Symbol(`request tls settings`), b = Symbol(`proxy tls settings`), x = Symbol(`connect endpoint function`), S = Symbol(`tunnel proxy`); - function C(e) { - return e === `https:` ? 443 : 80; - } - function w(e, t) { - return new s(e, t); - } - let T = () => {}; - function E(e, t) { - return t.connections === 1 ? new p(e, t) : new s(e, t); - } - var D = class extends c { - #e; - constructor(e, { headers: t = {}, connect: n, factory: r }) { - if (!e) throw new l(`Proxy URL is mandatory`); - super(), this[v] = t, r ? this.#e = r(e, { connect: n }) : this.#e = new p(e, { connect: n }); - } - [a](e, t) { - let n = t.onHeaders; - t.onHeaders = function(e, r, i) { - if (e === 407) { - typeof t.onError == `function` && t.onError(new l(`Proxy Authentication Required (407)`)); - return; - } - n && n.call(this, e, r, i); - }; - let { origin: r, path: i = `/`, headers: o = {} } = e; - if (e.path = r + i, !(`host` in o) && !(`Host` in o)) { - let { host: e } = new URL(r); - o.host = e; - } - return e.headers = { - ...this[v], - ...o - }, this.#e[a](e, t); - } - [r]() { - return this.#e.close(); - } - [i](e) { - return this.#e.destroy(e); - } - }, O = class extends c { - constructor(e) { - if (!e || typeof e == `object` && !(e instanceof URL) && !e.uri) throw new l(`Proxy uri is mandatory`); - let { clientFactory: t = w } = e; - if (typeof t != `function`) throw new l(`Proxy opts.clientFactory must be a function.`); - let { proxyTunnel: r = !0 } = e; - super(); - let i = this.#e(e), { href: a, origin: s, port: c, protocol: p, username: O, password: k, hostname: A } = i; - if (this[n] = { - uri: a, - protocol: p - }, this[y] = e.requestTls, this[b] = e.proxyTls, this[v] = e.headers || {}, this[S] = r, e.auth && e.token) throw new l(`opts.auth cannot be used in combination with opts.token`); - e.auth ? this[v][`proxy-authorization`] = `Basic ${e.auth}` : e.token ? this[v][`proxy-authorization`] = e.token : O && k && (this[v][`proxy-authorization`] = `Basic ${Buffer.from(`${decodeURIComponent(O)}:${decodeURIComponent(k)}`).toString(`base64`)}`); - let j = f({ ...e.proxyTls }); - this[x] = f({ ...e.requestTls }); - let M = e.factory || E, N = (t, r) => { - let { protocol: i } = new URL(t); - return this[n].protocol === `socks5:` || this[n].protocol === `socks:` ? new h(this[n].uri, { - headers: this[v], - connect: j, - factory: M, - username: e.username || O, - password: e.password || k, - proxyTls: e.proxyTls, - requestTls: e.requestTls - }) : !this[S] && i === `http:` && this[n].protocol === `http:` ? new D(this[n].uri, { - headers: this[v], - connect: j, - factory: M - }) : M(t, r); - }; - p === `socks5:` || p === `socks:` ? this[_] = null : this[_] = t(i, { connect: j }), this[g] = new o({ - ...e, - factory: N, - connect: async (e, t) => { - if (!this[_]) { - t(new l(`Cannot establish tunnel connection without a proxy client`)); - return; - } - let n = e.host; - e.port || (n += `:${C(e.protocol)}`); - try { - let r = { - origin: s, - port: c, - path: n, - signal: e.signal, - headers: { - ...this[v], - host: e.host, - ...e.connections == null || e.connections > 0 ? { "proxy-connection": `keep-alive` } : {} - }, - servername: this[b]?.servername || A - }, { socket: i, statusCode: a } = await this[_].connect(r); - if (a !== 200) { - i.on(`error`, T).destroy(), t(new u(`Proxy response (${a}) !== 200 when HTTP Tunneling`)); - return; - } - if (m.proxyConnected.hasSubscribers && m.proxyConnected.publish({ - socket: i, - connectParams: r - }), e.protocol !== `https:`) { - t(null, i); - return; - } - let o; - o = this[y] ? this[y].servername : e.servername, this[x]({ - ...e, - servername: o, - httpSocket: i - }, t); - } catch (e) { - e.code === `ERR_TLS_CERT_ALTNAME_INVALID` ? t(new d(e)) : t(e); - } - } - }); - } - dispatch(e, t) { - let n = k(e.headers); - if (A(n), n && !(`host` in n) && !(`Host` in n)) { - let { host: t } = new URL(e.origin); - n.host = t; - } - return this[g].dispatch({ - ...e, - headers: n - }, t); - } - #e(e) { - return typeof e == `string` ? new URL(e) : e instanceof URL ? e : new URL(e.uri); - } - [r]() { - let e = [this[g].close()]; - return this[_] && e.push(this[_].close()), Promise.all(e); - } - [i]() { - let e = [this[g].destroy()]; - return this[_] && e.push(this[_].destroy()), Promise.all(e); - } - }; - function k(e) { - if (Array.isArray(e)) { - let t = {}; - for (let n = 0; n < e.length; n += 2) t[e[n]] = e[n + 1]; - return t; - } - return e; - } - function A(e) { - if (e && Object.keys(e).find((e) => e.toLowerCase() === `proxy-authorization`)) throw new l(`Proxy-Authorization should be sent in ProxyAgent constructor`); - } - t.exports = O; -})); -var Qa$2 = c$12(((e, t) => { - let n = xa$3(), { kClose: r, kDestroy: i, kClosed: a, kDestroyed: o, kDispatch: s, kNoProxyAgent: c, kHttpProxyAgent: l, kHttpsProxyAgent: u } = da$3(), d = Za$2(), f = qa$3(), p = { - "http:": 80, - "https:": 443 - }; - t.exports = class extends n { - #e = null; - #t = null; - #n = null; - constructor(e = {}) { - super(), this.#n = e; - let { httpProxy: t, httpsProxy: n, noProxy: r, ...i } = e; - this[c] = new f(i); - let a = t ?? process.env.http_proxy ?? process.env.HTTP_PROXY; - a ? this[l] = new d({ - ...i, - uri: a - }) : this[l] = this[c]; - let o = n ?? process.env.https_proxy ?? process.env.HTTPS_PROXY; - o ? this[u] = new d({ - ...i, - uri: o - }) : this[u] = this[l], this.#a(); - } - [s](e, t) { - let n = new URL(e.origin); - return this.#r(n).dispatch(e, t); - } - [r]() { - return Promise.all([ - this[c].close(), - !this[l][a] && this[l].close(), - !this[u][a] && this[u].close() - ]); - } - [i](e) { - return Promise.all([ - this[c].destroy(e), - !this[l][o] && this[l].destroy(e), - !this[u][o] && this[u].destroy(e) - ]); - } - #r(e) { - let { protocol: t, host: n, port: r } = e; - return n = n.replace(/:\d*$/, ``).toLowerCase(), r = Number.parseInt(r, 10) || p[t] || 0, this.#i(n, r) ? t === `https:` ? this[u] : this[l] : this[c]; - } - #i(e, t) { - if (this.#o && this.#a(), this.#t.length === 0) return !0; - if (this.#e === `*`) return !1; - for (let n = 0; n < this.#t.length; n++) { - let r = this.#t[n]; - if (!(r.port && r.port !== t) && (e === r.hostname || e.slice(-(r.hostname.length + 1)) === `.${r.hostname}`)) return !1; - } - return !0; - } - #a() { - let e = this.#n.noProxy ?? this.#s, t = e.split(/[,\s]/), n = []; - for (let e = 0; e < t.length; e++) { - let r = t[e]; - if (!r) continue; - let i = r.match(/^(.+):(\d+)$/); - n.push({ - hostname: (i ? i[1] : r).replace(/^\*?\./, ``).toLowerCase(), - port: i ? Number.parseInt(i[2], 10) : 0 - }); - } - this.#e = e, this.#t = n; - } - get #o() { - return this.#n.noProxy === void 0 ? this.#e !== this.#s : !1; - } - get #s() { - return process.env.no_proxy ?? process.env.NO_PROXY ?? ``; - } - }; -})); -var $a$2 = c$12(((e, n) => { - let r = f$11(`node:assert`), { kRetryHandlerDefaultRetry: i } = da$3(), { RequestRetryError: a } = K$6(), o = va$3(), { isDisturbed: s, parseRangeHeader: c, wrapRequestBody: l } = q$6(); - function u(e) { - let t = new Date(e).getTime(); - return isNaN(t) ? 0 : t - Date.now(); - } - n.exports = class e { - constructor(t, { dispatch: n, handler: r }) { - let { retryOptions: a, ...s } = t, { retry: c, maxRetries: u, maxTimeout: d, minTimeout: f, timeoutFactor: p, methods: m, errorCodes: h, retryAfter: g, statusCodes: _, throwOnError: v } = a ?? {}; - this.error = null, this.dispatch = n, this.handler = o.wrap(r), this.opts = { - ...s, - body: l(t.body) - }, this.retryOpts = { - throwOnError: v ?? !0, - retry: c ?? e[i], - retryAfter: g ?? !0, - maxTimeout: d ?? 30 * 1e3, - minTimeout: f ?? 500, - timeoutFactor: p ?? 2, - maxRetries: u ?? 5, - methods: m ?? [ - `GET`, - `HEAD`, - `OPTIONS`, - `PUT`, - `DELETE`, - `TRACE` - ], - statusCodes: _ ?? [ - 500, - 502, - 503, - 504, - 429 - ], - errorCodes: h ?? [ - `ECONNRESET`, - `ECONNREFUSED`, - `ENOTFOUND`, - `ENETDOWN`, - `ENETUNREACH`, - `EHOSTDOWN`, - `EHOSTUNREACH`, - `EPIPE`, - `UND_ERR_SOCKET` - ] - }, this.retryCount = 0, this.retryCountCheckpoint = 0, this.headersSent = !1, this.start = 0, this.end = null, this.etag = null; - } - onResponseStartWithRetry(e, t, n, r, i) { - if (this.retryOpts.throwOnError) { - this.retryOpts.statusCodes.includes(t) === !1 ? (this.headersSent = !0, this.handler.onResponseStart?.(e, t, n, r)) : this.error = i; - return; - } - if (s(this.opts.body)) { - this.headersSent = !0, this.handler.onResponseStart?.(e, t, n, r); - return; - } - function a(a) { - if (a) { - this.headersSent = !0, this.handler.onResponseStart?.(e, t, n, r), e.resume(); - return; - } - this.error = i, e.resume(); - } - e.pause(), this.retryOpts.retry(i, { - state: { counter: this.retryCount }, - opts: { - retryOptions: this.retryOpts, - ...this.opts - } - }, a.bind(this)); - } - onRequestStart(e, t) { - this.headersSent || this.handler.onRequestStart?.(e, t); - } - onRequestUpgrade(e, t, n, r) { - this.handler.onRequestUpgrade?.(e, t, n, r); - } - static [i](e, { state: t, opts: n }, r) { - let { statusCode: i, code: a, headers: o } = e, { method: s, retryOptions: c } = n, { maxRetries: l, minTimeout: d, maxTimeout: f, timeoutFactor: p, statusCodes: m, errorCodes: h, methods: g } = c, { counter: _ } = t; - if (a && a !== `UND_ERR_REQ_RETRY` && !h.includes(a)) { - r(e); - return; - } - if (Array.isArray(g) && !g.includes(s)) { - r(e); - return; - } - if (i != null && Array.isArray(m) && !m.includes(i)) { - r(e); - return; - } - if (_ > l) { - r(e); - return; - } - let v = o?.[`retry-after`]; - v &&= (v = Number(v), Number.isNaN(v) ? u(o[`retry-after`]) : v * 1e3); - let y = Math.min(v > 0 ? v : d * p ** (_ - 1), f); - setTimeout(() => r(null), y); - } - onResponseStart(e, t, n, i) { - if (this.error = null, this.retryCount += 1, t >= 300) { - let r = new a(`Request failed`, t, { - headers: n, - data: { count: this.retryCount } - }); - this.onResponseStartWithRetry(e, t, n, i, r); - return; - } - if (this.headersSent) { - if (t !== 206 && (this.start > 0 || t !== 200)) throw new a(`server does not support the range header and the payload was partially consumed`, t, { - headers: n, - data: { count: this.retryCount } - }); - let e = c(n[`content-range`]); - if (!e) throw new a(`Content-Range mismatch`, t, { - headers: n, - data: { count: this.retryCount } - }); - if (this.etag != null && this.etag !== n.etag) throw new a(`ETag mismatch`, t, { - headers: n, - data: { count: this.retryCount } - }); - let { start: i, size: o, end: s = o ? o - 1 : null } = e; - r(this.start === i, `content-range mismatch`), r(this.end == null || this.end === s, `content-range mismatch`); - return; - } - if (this.end == null) { - if (t === 206) { - let a = c(n[`content-range`]); - if (a == null) { - this.headersSent = !0, this.handler.onResponseStart?.(e, t, n, i); - return; - } - let { start: o, size: s, end: l = s ? s - 1 : null } = a; - r(o != null && Number.isFinite(o), `content-range mismatch`), r(l != null && Number.isFinite(l), `invalid content-length`), this.start = o, this.end = l; - } - if (this.end == null) { - let e = n[`content-length`]; - this.end = e == null ? null : Number(e) - 1; - } - r(Number.isFinite(this.start)), r(this.end == null || Number.isFinite(this.end), `invalid content-length`), this.resume = !0, this.etag = n.etag == null ? null : n.etag, this.etag != null && this.etag[0] === `W` && this.etag[1] === `/` && (this.etag = null), this.headersSent = !0, this.handler.onResponseStart?.(e, t, n, i); - } else throw new a(`Request failed`, t, { - headers: n, - data: { count: this.retryCount } - }); - } - onResponseData(e, t) { - this.error || (this.start += t.length, this.handler.onResponseData?.(e, t)); - } - onResponseEnd(e, t) { - if (this.error && this.retryOpts.throwOnError) throw this.error; - if (!this.error) return this.retryCount = 0, this.handler.onResponseEnd?.(e, t); - this.retry(e); - } - retry(e) { - if (this.start !== 0) { - let e = { range: `bytes=${this.start}-${this.end ?? ``}` }; - this.etag != null && (e[`if-match`] = this.etag), this.opts = { - ...this.opts, - headers: { - ...this.opts.headers, - ...e - } - }; - } - try { - this.retryCountCheckpoint = this.retryCount, this.dispatch(this.opts, this); - } catch (t) { - this.handler.onResponseError?.(e, t); - } - } - onResponseError(e, t) { - if (e?.aborted || s(this.opts.body)) { - this.handler.onResponseError?.(e, t); - return; - } - function n(t) { - if (!t) { - this.retry(e); - return; - } - this.handler?.onResponseError?.(e, t); - } - this.retryCount - this.retryCountCheckpoint > 0 ? this.retryCount = this.retryCountCheckpoint + (this.retryCount - this.retryCountCheckpoint) : this.retryCount += 1, this.retryOpts.retry(t, { - state: { counter: this.retryCount }, - opts: { - retryOptions: this.retryOpts, - ...this.opts - } - }, n.bind(this)); - } - }; -})); -var eo$2 = c$12(((e, t) => { - let n = ya$3(), r = $a$2(); - t.exports = class extends n { - #e = null; - #t = null; - constructor(e, t = {}) { - super(t), this.#e = e, this.#t = t; - } - dispatch(e, t) { - let n = new r({ - ...e, - retryOptions: this.#t - }, { - dispatch: this.#e.dispatch.bind(this.#e), - handler: t - }); - return this.#e.dispatch(e, n); - } - close() { - return this.#e.close(); - } - destroy() { - return this.#e.destroy(); - } - }; -})); -var to$2 = c$12(((e, t) => { - let { InvalidArgumentError: n } = K$6(), r = Va$3(); - t.exports = class extends r { - constructor(e, t) { - if (typeof e == `string` && (e = new URL(e)), e.protocol !== `http:`) throw new n(`h2c-client: Only h2c protocol is supported`); - let { maxConcurrentStreams: r, pipelining: i, ...a } = t ?? {}, o = 100, s = 100; - if (r != null && Number.isInteger(r) && r > 0 && (o = r), i != null && Number.isInteger(i) && i > 0 && (s = i), s > o) throw new n(`h2c-client: pipelining cannot be greater than maxConcurrentStreams`); - super(e, { - ...a, - maxConcurrentStreams: o, - pipelining: s, - allowH2: !0, - useH2c: !0 - }); - } - }; -})); -var no$1 = c$12(((e, n) => { - let r = f$11(`node:assert`), { Readable: i } = f$11(`node:stream`), { RequestAbortedError: a, NotSupportedError: o, InvalidArgumentError: s, AbortError: c } = K$6(), l = q$6(), { ReadableStreamFrom: u } = q$6(), d = Symbol(`kConsume`), f = Symbol(`kReading`), p = Symbol(`kBody`), m = Symbol(`kAbort`), h = Symbol(`kContentType`), g = Symbol(`kContentLength`), _ = Symbol(`kUsed`), v = Symbol(`kBytesRead`), y = () => {}; - var b = class extends i { - constructor({ resume: e, abort: t, contentType: n = ``, contentLength: r, highWaterMark: i = 64 * 1024 }) { - super({ - autoDestroy: !0, - read: e, - highWaterMark: i - }), this._readableState.dataEmitted = !1, this[m] = t, this[d] = null, this[v] = 0, this[p] = null, this[_] = !1, this[h] = n, this[g] = Number.isFinite(r) ? r : null, this[f] = !1; - } - _destroy(e, t) { - !e && !this._readableState.endEmitted && (e = new a()), e && this[m](), this[_] ? t(e) : setImmediate(t, e); - } - on(e, t) { - return (e === `data` || e === `readable`) && (this[f] = !0, this[_] = !0), super.on(e, t); - } - addListener(e, t) { - return this.on(e, t); - } - off(e, t) { - let n = super.off(e, t); - return (e === `data` || e === `readable`) && (this[f] = this.listenerCount(`data`) > 0 || this.listenerCount(`readable`) > 0), n; - } - removeListener(e, t) { - return this.off(e, t); - } - push(e) { - return e && (this[v] += e.length, this[d]) ? (O(this[d], e), this[f] ? super.push(e) : !0) : super.push(e); - } - text() { - return C(this, `text`); - } - json() { - return C(this, `json`); - } - blob() { - return C(this, `blob`); - } - bytes() { - return C(this, `bytes`); - } - arrayBuffer() { - return C(this, `arrayBuffer`); - } - async formData() { - throw new o(); - } - get bodyUsed() { - return l.isDisturbed(this); - } - get body() { - return this[p] || (this[p] = u(this), this[d] && (this[p].getReader(), r(this[p].locked))), this[p]; - } - dump(e) { - let t = e?.signal; - if (t != null && (typeof t != `object` || !(`aborted` in t))) return Promise.reject(new s(`signal must be an AbortSignal`)); - let n = e?.limit && Number.isFinite(e.limit) ? e.limit : 128 * 1024; - return t?.aborted ? Promise.reject(t.reason ?? new c()) : this._readableState.closeEmitted ? Promise.resolve(null) : new Promise((e, r) => { - if ((this[g] && this[g] > n || this[v] > n) && this.destroy(new c()), t) { - let n = () => { - this.destroy(t.reason ?? new c()); - }; - t.addEventListener(`abort`, n), this.on(`close`, function() { - t.removeEventListener(`abort`, n), t.aborted ? r(t.reason ?? new c()) : e(null); - }); - } else this.on(`close`, e); - this.on(`error`, y).on(`data`, () => { - this[v] > n && this.destroy(); - }).resume(); - }); - } - setEncoding(e) { - return Buffer.isEncoding(e) && (this._readableState.encoding = e), this; - } - }; - function x(e) { - return e[p]?.locked === !0 || e[d] !== null; - } - function S(e) { - return l.isDisturbed(e) || x(e); - } - function C(e, t) { - return r(!e[d]), new Promise((n, r) => { - if (S(e)) { - let t = e._readableState; - t.destroyed && t.closeEmitted === !1 ? e.on(`error`, r).on(`close`, () => { - r(TypeError(`unusable`)); - }) : r(t.errored ?? TypeError(`unusable`)); - } else queueMicrotask(() => { - e[d] = { - type: t, - stream: e, - resolve: n, - reject: r, - length: 0, - body: [] - }, e.on(`error`, function(e) { - k(this[d], e); - }).on(`close`, function() { - this[d].body !== null && k(this[d], new a()); - }), w(e[d]); - }); - }); - } - function w(e) { - if (e.body === null) return; - let { _readableState: t } = e.stream; - if (t.bufferIndex) { - let n = t.bufferIndex, r = t.buffer.length; - for (let i = n; i < r; i++) O(e, t.buffer[i]); - } else for (let n of t.buffer) O(e, n); - for (t.endEmitted ? D(this[d], this._readableState.encoding) : e.stream.on(`end`, function() { - D(this[d], this._readableState.encoding); - }), e.stream.resume(); e.stream.read() != null;); - } - function T(e, t, n) { - if (e.length === 0 || t === 0) return ``; - let r = e.length === 1 ? e[0] : Buffer.concat(e, t), i = r.length, a = i > 2 && r[0] === 239 && r[1] === 187 && r[2] === 191 ? 3 : 0; - return !n || n === `utf8` || n === `utf-8` ? r.utf8Slice(a, i) : r.subarray(a, i).toString(n); - } - function E(e, t) { - if (e.length === 0 || t === 0) return /* @__PURE__ */ new Uint8Array(); - if (e.length === 1) return new Uint8Array(e[0]); - let n = new Uint8Array(Buffer.allocUnsafeSlow(t).buffer), r = 0; - for (let t = 0; t < e.length; ++t) { - let i = e[t]; - n.set(i, r), r += i.length; - } - return n; - } - function D(e, t) { - let { type: n, body: r, resolve: i, stream: a, length: o } = e; - try { - n === `text` ? i(T(r, o, t)) : n === `json` ? i(JSON.parse(T(r, o, t))) : n === `arrayBuffer` ? i(E(r, o).buffer) : n === `blob` ? i(new Blob(r, { type: a[h] })) : n === `bytes` && i(E(r, o)), k(e); - } catch (e) { - a.destroy(e); - } - } - function O(e, t) { - e.length += t.length, e.body.push(t); - } - function k(e, t) { - e.body !== null && (t ? e.reject(t) : e.resolve(), e.type = null, e.stream = null, e.resolve = null, e.reject = null, e.length = 0, e.body = null); - } - n.exports = { - Readable: b, - chunksDecode: T - }; -})); -var ro$1 = c$12(((e, n) => { - let r = f$11(`node:assert`), { AsyncResource: i } = f$11(`node:async_hooks`), { Readable: a } = no$1(), { InvalidArgumentError: o, RequestAbortedError: s } = K$6(), c = q$6(); - function l() {} - var u = class extends i { - constructor(e, t) { - if (!e || typeof e != `object`) throw new o(`invalid opts`); - let { signal: n, method: r, opaque: i, body: a, onInfo: u, responseHeaders: d, highWaterMark: f } = e; - try { - if (typeof t != `function`) throw new o(`invalid callback`); - if (f != null && (!Number.isFinite(f) || f < 0)) throw new o(`invalid highWaterMark`); - if (n && typeof n.on != `function` && typeof n.addEventListener != `function`) throw new o(`signal must be an EventEmitter or EventTarget`); - if (r === `CONNECT`) throw new o(`invalid method`); - if (u && typeof u != `function`) throw new o(`invalid onInfo callback`); - super(`UNDICI_REQUEST`); - } catch (e) { - throw c.isStream(a) && c.destroy(a.on(`error`, l), e), e; - } - this.method = r, this.responseHeaders = d || null, this.opaque = i || null, this.callback = t, this.res = null, this.abort = null, this.body = a, this.trailers = {}, this.context = null, this.onInfo = u || null, this.highWaterMark = f, this.reason = null, this.removeAbortListener = null, n?.aborted ? this.reason = n.reason ?? new s() : n && (this.removeAbortListener = c.addAbortListener(n, () => { - this.reason = n.reason ?? new s(), this.res ? c.destroy(this.res.on(`error`, l), this.reason) : this.abort && this.abort(this.reason); - })); - } - onConnect(e, t) { - if (this.reason) { - e(this.reason); - return; - } - r(this.callback), this.abort = e, this.context = t; - } - onHeaders(e, t, n, r) { - let { callback: i, opaque: o, abort: s, context: u, responseHeaders: d, highWaterMark: f } = this, p = d === `raw` ? c.parseRawHeaders(t) : c.parseHeaders(t); - if (e < 200) { - this.onInfo && this.onInfo({ - statusCode: e, - headers: p - }); - return; - } - let m = d === `raw` ? c.parseHeaders(t) : p, h = m[`content-type`], g = m[`content-length`], _ = new a({ - resume: n, - abort: s, - contentType: h, - contentLength: this.method !== `HEAD` && g ? Number(g) : null, - highWaterMark: f - }); - if (this.removeAbortListener &&= (_.on(`close`, this.removeAbortListener), null), this.callback = null, this.res = _, i !== null) try { - this.runInAsyncScope(i, null, null, { - statusCode: e, - statusText: r, - headers: p, - trailers: this.trailers, - opaque: o, - body: _, - context: u - }); - } catch (e) { - this.res = null, c.destroy(_.on(`error`, l), e), queueMicrotask(() => { - throw e; - }); - } - } - onData(e) { - return this.res.push(e); - } - onComplete(e) { - c.parseHeaders(e, this.trailers), this.res.push(null); - } - onError(e) { - let { res: t, callback: n, body: r, opaque: i } = this; - n && (this.callback = null, queueMicrotask(() => { - this.runInAsyncScope(n, null, e, { opaque: i }); - })), t && (this.res = null, queueMicrotask(() => { - c.destroy(t.on(`error`, l), e); - })), r && (this.body = null, c.isStream(r) && (r.on(`error`, l), c.destroy(r, e))), this.removeAbortListener &&= (this.removeAbortListener(), null); - } - }; - function d(e, t) { - if (t === void 0) return new Promise((t, n) => { - d.call(this, e, (e, r) => e ? n(e) : t(r)); - }); - try { - let n = new u(e, t); - this.dispatch(e, n); - } catch (n) { - if (typeof t != `function`) throw n; - let r = e?.opaque; - queueMicrotask(() => t(n, { opaque: r })); - } - } - n.exports = d, n.exports.RequestHandler = u; -})); -var io$1 = c$12(((e, t) => { - let { addAbortListener: n } = q$6(), { RequestAbortedError: r } = K$6(), i = Symbol(`kListener`), a = Symbol(`kSignal`); - function o(e) { - e.abort ? e.abort(e[a]?.reason) : e.reason = e[a]?.reason ?? new r(), c(e); - } - function s(e, t) { - if (e.reason = null, e[a] = null, e[i] = null, t) { - if (t.aborted) { - o(e); - return; - } - e[a] = t, e[i] = () => { - o(e); - }, n(e[a], e[i]); - } - } - function c(e) { - e[a] && (`removeEventListener` in e[a] ? e[a].removeEventListener(`abort`, e[i]) : e[a].removeListener(`abort`, e[i]), e[a] = null, e[i] = null); - } - t.exports = { - addSignal: s, - removeSignal: c - }; -})); -var ao$1 = c$12(((e, n) => { - let r = f$11(`node:assert`), { finished: i } = f$11(`node:stream`), { AsyncResource: a } = f$11(`node:async_hooks`), { InvalidArgumentError: o, InvalidReturnValueError: s } = K$6(), c = q$6(), { addSignal: l, removeSignal: u } = io$1(); - function d() {} - var f = class extends a { - constructor(e, t, n) { - if (!e || typeof e != `object`) throw new o(`invalid opts`); - let { signal: r, method: i, opaque: a, body: s, onInfo: u, responseHeaders: f } = e; - try { - if (typeof n != `function`) throw new o(`invalid callback`); - if (typeof t != `function`) throw new o(`invalid factory`); - if (r && typeof r.on != `function` && typeof r.addEventListener != `function`) throw new o(`signal must be an EventEmitter or EventTarget`); - if (i === `CONNECT`) throw new o(`invalid method`); - if (u && typeof u != `function`) throw new o(`invalid onInfo callback`); - super(`UNDICI_STREAM`); - } catch (e) { - throw c.isStream(s) && c.destroy(s.on(`error`, d), e), e; - } - this.responseHeaders = f || null, this.opaque = a || null, this.factory = t, this.callback = n, this.res = null, this.abort = null, this.context = null, this.trailers = null, this.body = s, this.onInfo = u || null, c.isStream(s) && s.on(`error`, (e) => { - this.onError(e); - }), l(this, r); - } - onConnect(e, t) { - if (this.reason) { - e(this.reason); - return; - } - r(this.callback), this.abort = e, this.context = t; - } - onHeaders(e, t, n, r) { - let { factory: a, opaque: o, context: l, responseHeaders: u } = this, d = u === `raw` ? c.parseRawHeaders(t) : c.parseHeaders(t); - if (e < 200) { - this.onInfo && this.onInfo({ - statusCode: e, - headers: d - }); - return; - } - if (this.factory = null, a === null) return; - let f = this.runInAsyncScope(a, null, { - statusCode: e, - headers: d, - opaque: o, - context: l - }); - if (!f || typeof f.write != `function` || typeof f.end != `function` || typeof f.on != `function`) throw new s(`expected Writable`); - return i(f, { readable: !1 }, (e) => { - let { callback: t, res: n, opaque: r, trailers: i, abort: a } = this; - this.res = null, (e || !n?.readable) && c.destroy(n, e), this.callback = null, this.runInAsyncScope(t, null, e || null, { - opaque: r, - trailers: i - }), e && a(); - }), f.on(`drain`, n), this.res = f, (f.writableNeedDrain === void 0 ? f._writableState?.needDrain : f.writableNeedDrain) !== !0; - } - onData(e) { - let { res: t } = this; - return t ? t.write(e) : !0; - } - onComplete(e) { - let { res: t } = this; - u(this), t && (this.trailers = c.parseHeaders(e), t.end()); - } - onError(e) { - let { res: t, callback: n, opaque: r, body: i } = this; - u(this), this.factory = null, t ? (this.res = null, c.destroy(t, e)) : n && (this.callback = null, queueMicrotask(() => { - this.runInAsyncScope(n, null, e, { opaque: r }); - })), i && (this.body = null, c.destroy(i, e)); - } - }; - function p(e, t, n) { - if (n === void 0) return new Promise((n, r) => { - p.call(this, e, t, (e, t) => e ? r(e) : n(t)); - }); - try { - let r = new f(e, t, n); - this.dispatch(e, r); - } catch (t) { - if (typeof n != `function`) throw t; - let r = e?.opaque; - queueMicrotask(() => n(t, { opaque: r })); - } - } - n.exports = p; -})); -var oo$1 = c$12(((e, n) => { - let { Readable: r, Duplex: i, PassThrough: a } = f$11(`node:stream`), o = f$11(`node:assert`), { AsyncResource: s } = f$11(`node:async_hooks`), { InvalidArgumentError: c, InvalidReturnValueError: l, RequestAbortedError: u } = K$6(), d = q$6(), { addSignal: f, removeSignal: p } = io$1(); - function m() {} - let h = Symbol(`resume`); - var g = class extends r { - constructor() { - super({ autoDestroy: !0 }), this[h] = null; - } - _read() { - let { [h]: e } = this; - e && (this[h] = null, e()); - } - _destroy(e, t) { - this._read(), t(e); - } - }, _ = class extends r { - constructor(e) { - super({ autoDestroy: !0 }), this[h] = e; - } - _read() { - this[h](); - } - _destroy(e, t) { - !e && !this._readableState.endEmitted && (e = new u()), t(e); - } - }, v = class extends s { - constructor(e, t) { - if (!e || typeof e != `object`) throw new c(`invalid opts`); - if (typeof t != `function`) throw new c(`invalid handler`); - let { signal: n, method: r, opaque: a, onInfo: o, responseHeaders: s } = e; - if (n && typeof n.on != `function` && typeof n.addEventListener != `function`) throw new c(`signal must be an EventEmitter or EventTarget`); - if (r === `CONNECT`) throw new c(`invalid method`); - if (o && typeof o != `function`) throw new c(`invalid onInfo callback`); - super(`UNDICI_PIPELINE`), this.opaque = a || null, this.responseHeaders = s || null, this.handler = t, this.abort = null, this.context = null, this.onInfo = o || null, this.req = new g().on(`error`, m), this.ret = new i({ - readableObjectMode: e.objectMode, - autoDestroy: !0, - read: () => { - let { body: e } = this; - e?.resume && e.resume(); - }, - write: (e, t, n) => { - let { req: r } = this; - r.push(e, t) || r._readableState.destroyed ? n() : r[h] = n; - }, - destroy: (e, t) => { - let { body: n, req: r, res: i, ret: a, abort: o } = this; - !e && !a._readableState.endEmitted && (e = new u()), o && e && o(), d.destroy(n, e), d.destroy(r, e), d.destroy(i, e), p(this), t(e); - } - }).on(`prefinish`, () => { - let { req: e } = this; - e.push(null); - }), this.res = null, f(this, n); - } - onConnect(e, t) { - let { res: n } = this; - if (this.reason) { - e(this.reason); - return; - } - o(!n, `pipeline cannot be retried`), this.abort = e, this.context = t; - } - onHeaders(e, t, n) { - let { opaque: r, handler: i, context: a } = this; - if (e < 200) { - if (this.onInfo) { - let n = this.responseHeaders === `raw` ? d.parseRawHeaders(t) : d.parseHeaders(t); - this.onInfo({ - statusCode: e, - headers: n - }); - } - return; - } - this.res = new _(n); - let o; - try { - this.handler = null; - let n = this.responseHeaders === `raw` ? d.parseRawHeaders(t) : d.parseHeaders(t); - o = this.runInAsyncScope(i, null, { - statusCode: e, - headers: n, - opaque: r, - body: this.res, - context: a - }); - } catch (e) { - throw this.res.on(`error`, m), e; - } - if (!o || typeof o.on != `function`) throw new l(`expected Readable`); - o.on(`data`, (e) => { - let { ret: t, body: n } = this; - !t.push(e) && n.pause && n.pause(); - }).on(`error`, (e) => { - let { ret: t } = this; - d.destroy(t, e); - }).on(`end`, () => { - let { ret: e } = this; - e.push(null); - }).on(`close`, () => { - let { ret: e } = this; - e._readableState.ended || d.destroy(e, new u()); - }), this.body = o; - } - onData(e) { - let { res: t } = this; - return t.push(e); - } - onComplete(e) { - let { res: t } = this; - t.push(null); - } - onError(e) { - let { ret: t } = this; - this.handler = null, d.destroy(t, e); - } - }; - function y(e, t) { - try { - let n = new v(e, t); - return this.dispatch({ - ...e, - body: n.req - }, n), n.ret; - } catch (e) { - return new a().destroy(e); - } - } - n.exports = y; -})); -var so$1 = c$12(((e, n) => { - let { InvalidArgumentError: r, SocketError: i } = K$6(), { AsyncResource: a } = f$11(`node:async_hooks`), o = f$11(`node:assert`), s = q$6(), { kHTTP2Stream: c } = da$3(), { addSignal: l, removeSignal: u } = io$1(); - var d = class extends a { - constructor(e, t) { - if (!e || typeof e != `object`) throw new r(`invalid opts`); - if (typeof t != `function`) throw new r(`invalid callback`); - let { signal: n, opaque: i, responseHeaders: a } = e; - if (n && typeof n.on != `function` && typeof n.addEventListener != `function`) throw new r(`signal must be an EventEmitter or EventTarget`); - super(`UNDICI_UPGRADE`), this.responseHeaders = a || null, this.opaque = i || null, this.callback = t, this.abort = null, this.context = null, l(this, n); - } - onConnect(e, t) { - if (this.reason) { - e(this.reason); - return; - } - o(this.callback), this.abort = e, this.context = null; - } - onHeaders() { - throw new i(`bad upgrade`, null); - } - onUpgrade(e, t, n) { - o(n[c] === !0 ? e === 200 : e === 101); - let { callback: r, opaque: i, context: a } = this; - u(this), this.callback = null; - let l = this.responseHeaders === `raw` ? s.parseRawHeaders(t) : s.parseHeaders(t); - this.runInAsyncScope(r, null, null, { - headers: l, - socket: n, - opaque: i, - context: a - }); - } - onError(e) { - let { callback: t, opaque: n } = this; - u(this), t && (this.callback = null, queueMicrotask(() => { - this.runInAsyncScope(t, null, e, { opaque: n }); - })); - } - }; - function f(e, t) { - if (t === void 0) return new Promise((t, n) => { - f.call(this, e, (e, r) => e ? n(e) : t(r)); - }); - try { - let n = new d(e, t), r = { - ...e, - method: e.method || `GET`, - upgrade: e.protocol || `Websocket` - }; - this.dispatch(r, n); - } catch (n) { - if (typeof t != `function`) throw n; - let r = e?.opaque; - queueMicrotask(() => t(n, { opaque: r })); - } - } - n.exports = f; -})); -var co$1 = c$12(((e, n) => { - let r = f$11(`node:assert`), { AsyncResource: i } = f$11(`node:async_hooks`), { InvalidArgumentError: a, SocketError: o } = K$6(), s = q$6(), { addSignal: c, removeSignal: l } = io$1(); - var u = class extends i { - constructor(e, t) { - if (!e || typeof e != `object`) throw new a(`invalid opts`); - if (typeof t != `function`) throw new a(`invalid callback`); - let { signal: n, opaque: r, responseHeaders: i } = e; - if (n && typeof n.on != `function` && typeof n.addEventListener != `function`) throw new a(`signal must be an EventEmitter or EventTarget`); - super(`UNDICI_CONNECT`), this.opaque = r || null, this.responseHeaders = i || null, this.callback = t, this.abort = null, c(this, n); - } - onConnect(e, t) { - if (this.reason) { - e(this.reason); - return; - } - r(this.callback), this.abort = e, this.context = t; - } - onHeaders() { - throw new o(`bad connect`, null); - } - onUpgrade(e, t, n) { - let { callback: r, opaque: i, context: a } = this; - l(this), this.callback = null; - let o = t; - o != null && (o = this.responseHeaders === `raw` ? s.parseRawHeaders(t) : s.parseHeaders(t)), this.runInAsyncScope(r, null, null, { - statusCode: e, - headers: o, - socket: n, - opaque: i, - context: a - }); - } - onError(e) { - let { callback: t, opaque: n } = this; - l(this), t && (this.callback = null, queueMicrotask(() => { - this.runInAsyncScope(t, null, e, { opaque: n }); - })); - } - }; - function d(e, t) { - if (t === void 0) return new Promise((t, n) => { - d.call(this, e, (e, r) => e ? n(e) : t(r)); - }); - try { - let n = new u(e, t), r = { - ...e, - method: `CONNECT` - }; - this.dispatch(r, n); - } catch (n) { - if (typeof t != `function`) throw n; - let r = e?.opaque; - queueMicrotask(() => t(n, { opaque: r })); - } - } - n.exports = d; -})); -var lo$1 = c$12(((e, t) => { - t.exports.request = ro$1(), t.exports.stream = ao$1(), t.exports.pipeline = oo$1(), t.exports.upgrade = so$1(), t.exports.connect = co$1(); -})); -var uo$1 = c$12(((e, t) => { - let { UndiciError: n } = K$6(), r = Symbol.for(`undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED`); - t.exports = { MockNotMatchedError: class extends n { - constructor(e) { - super(e), this.name = `MockNotMatchedError`, this.message = e || `The request does not match any registered mock dispatches`, this.code = `UND_MOCK_ERR_MOCK_NOT_MATCHED`; - } - static [Symbol.hasInstance](e) { - return e && e[r] === !0; - } - get [r]() { - return !0; - } - } }; -})); -var fo$1 = c$12(((e, t) => { - t.exports = { - kAgent: Symbol(`agent`), - kOptions: Symbol(`options`), - kFactory: Symbol(`factory`), - kDispatches: Symbol(`dispatches`), - kDispatchKey: Symbol(`dispatch key`), - kDefaultHeaders: Symbol(`default headers`), - kDefaultTrailers: Symbol(`default trailers`), - kContentLength: Symbol(`content length`), - kMockAgent: Symbol(`mock agent`), - kMockAgentSet: Symbol(`mock agent set`), - kMockAgentGet: Symbol(`mock agent get`), - kMockDispatch: Symbol(`mock dispatch`), - kClose: Symbol(`close`), - kOriginalClose: Symbol(`original agent close`), - kOriginalDispatch: Symbol(`original dispatch`), - kOrigin: Symbol(`origin`), - kIsMockActive: Symbol(`is mock active`), - kNetConnect: Symbol(`net connect`), - kGetNetConnect: Symbol(`get net connect`), - kConnected: Symbol(`connected`), - kIgnoreTrailingSlash: Symbol(`ignore trailing slash`), - kMockAgentMockCallHistoryInstance: Symbol(`mock agent mock call history name`), - kMockAgentRegisterCallHistory: Symbol(`mock agent register mock call history`), - kMockAgentAddCallHistoryLog: Symbol(`mock agent add call history log`), - kMockAgentIsCallHistoryEnabled: Symbol(`mock agent is call history enabled`), - kMockAgentAcceptsNonStandardSearchParameters: Symbol(`mock agent accepts non standard search parameters`), - kMockCallHistoryAddLog: Symbol(`mock call history add log`), - kTotalDispatchCount: Symbol(`total dispatch count`) - }; -})); -var po$1 = c$12(((e, n) => { - let { MockNotMatchedError: r } = uo$1(), { kDispatches: i, kMockAgent: a, kOriginalDispatch: o, kOrigin: s, kGetNetConnect: c, kTotalDispatchCount: l } = fo$1(), { serializePathWithQuery: u } = q$6(), { STATUS_CODES: d } = f$11(`node:http`), { types: { isPromise: f } } = f$11(`node:util`), { InvalidArgumentError: p } = K$6(); - function m(e, t) { - return typeof e == `string` ? e === t : e instanceof RegExp ? e.test(t) : typeof e == `function` ? e(t) === !0 : !1; - } - function h(e) { - return Object.fromEntries(Object.entries(e).map(([e, t]) => [e.toLocaleLowerCase(), t])); - } - function g(e, t) { - if (Array.isArray(e)) { - for (let n = 0; n < e.length; n += 2) if (e[n].toLocaleLowerCase() === t.toLocaleLowerCase()) return e[n + 1]; - return; - } else if (typeof e.get == `function`) return e.get(t); - else return h(e)[t.toLocaleLowerCase()]; - } - function _(e) { - let t = e.slice(), n = []; - for (let e = 0; e < t.length; e += 2) n.push([t[e], t[e + 1]]); - return Object.fromEntries(n); - } - function v(e, t) { - if (typeof e.headers == `function`) return Array.isArray(t) && (t = _(t)), e.headers(t ? h(t) : {}); - if (e.headers === void 0) return !0; - if (typeof t != `object` || typeof e.headers != `object`) return !1; - for (let [n, r] of Object.entries(e.headers)) if (!m(r, g(t, n))) return !1; - return !0; - } - function y(e) { - if (typeof e != `string`) return e; - let t = new URLSearchParams(e), n = new URLSearchParams(); - for (let [e, r] of t.entries()) { - if (e = e.replace(`[]`, ``), /^(['"]).*\1$/.test(r)) { - n.append(e, r); - continue; - } - if (r.includes(`,`)) { - let t = r.split(`,`); - for (let r of t) n.append(e, r); - continue; - } - n.append(e, r); - } - return n; - } - function b(e) { - if (typeof e != `string`) return e; - let t = e.split(`?`, 3); - if (t.length !== 2) return e; - let n = new URLSearchParams(t.pop()); - return n.sort(), [...t, n.toString()].join(`?`); - } - function x(e, { path: t, method: n, body: r, headers: i }) { - let a = m(e.path, t), o = m(e.method, n), s = e.body === void 0 ? !0 : m(e.body, r), c = v(e, i); - return a && o && s && c; - } - function S(e) { - return Buffer.isBuffer(e) || e instanceof Uint8Array || e instanceof ArrayBuffer ? e : typeof e == `object` ? JSON.stringify(e) : e ? e.toString() : ``; - } - function C(e, t) { - let n = t.query ? u(t.path, t.query) : t.path, i = typeof n == `string` ? b(n) : n, a = E(i), o = e.filter(({ consumed: e }) => !e).filter(({ path: e, ignoreTrailingSlash: t }) => t ? m(E(b(e)), a) : m(b(e), i)); - if (o.length === 0) throw new r(`Mock dispatch not matched for path '${i}'`); - if (o = o.filter(({ method: e }) => m(e, t.method)), o.length === 0) throw new r(`Mock dispatch not matched for method '${t.method}' on path '${i}'`); - if (o = o.filter(({ body: e }) => e === void 0 ? !0 : m(e, t.body)), o.length === 0) throw new r(`Mock dispatch not matched for body '${t.body}' on path '${i}'`); - if (o = o.filter((e) => v(e, t.headers)), o.length === 0) throw new r(`Mock dispatch not matched for headers '${typeof t.headers == `object` ? JSON.stringify(t.headers) : t.headers}' on path '${i}'`); - return o[0]; - } - function w(e, t, n, r) { - let i = { - timesInvoked: 0, - times: 1, - persist: !1, - consumed: !1, - ...r - }, a = typeof n == `function` ? { callback: n } : { ...n }, o = { - ...i, - ...t, - pending: !0, - data: { - error: null, - ...a - } - }; - return e.push(o), e[l] = (e[l] || 0) + 1, o; - } - function T(e, t) { - let n = e.findIndex((e) => e.consumed ? x(e, t) : !1); - n !== -1 && e.splice(n, 1); - } - function E(e) { - for (; e.endsWith(`/`);) e = e.slice(0, -1); - return e.length === 0 && (e = `/`), e; - } - function D(e) { - let { path: t, method: n, body: r, headers: i, query: a } = e; - return { - path: t, - method: n, - body: r, - headers: i, - query: a - }; - } - function O(e) { - let t = Object.keys(e), n = []; - for (let r = 0; r < t.length; ++r) { - let i = t[r], a = e[i], o = Buffer.from(`${i}`); - if (Array.isArray(a)) for (let e = 0; e < a.length; ++e) n.push(o, Buffer.from(`${a[e]}`)); - else n.push(o, Buffer.from(`${a}`)); - } - return n; - } - function k(e) { - return d[e] || `unknown`; - } - async function A(e) { - let t = []; - for await (let n of e) t.push(n); - return Buffer.concat(t).toString(`utf8`); - } - function j(e, t) { - let n = D(e), r = C(this[i], n); - r.timesInvoked++, r.data.callback && (r.data = { - ...r.data, - ...r.data.callback(e) - }); - let { data: { statusCode: a, data: o, headers: s, trailers: c, error: l }, delay: u, persist: d } = r, { timesInvoked: p, times: m } = r; - if (r.consumed = !d && p >= m, r.pending = p < m, l !== null) return T(this[i], n), t.onError(l), !0; - let h = !1, g = null; - function v(e) { - h || (h = !0, g !== null && (clearTimeout(g), g = null), t.onError(e)); - } - t.onConnect?.(v, null), typeof u == `number` && u > 0 ? g = setTimeout(() => { - g = null, y(this[i]); - }, u) : y(this[i]); - function y(r, i = o) { - if (h) return; - let l = Array.isArray(e.headers) ? _(e.headers) : e.headers, u = typeof i == `function` ? i({ - ...e, - headers: l - }) : i; - if (f(u)) return u.then((e) => y(r, e)); - if (h) return; - let d = S(u), p = O(s), m = O(c); - t.onHeaders?.(a, p, b, k(a)), t.onData?.(Buffer.from(d)), t.onComplete?.(m), T(r, n); - } - function b() {} - return !0; - } - function M() { - let e = this[a], t = this[s], n = this[o]; - return function(a, o) { - if (e.isMockActive) try { - j.call(this, a, o); - } catch (s) { - if (s.code === `UND_MOCK_ERR_MOCK_NOT_MATCHED`) { - let u = e[c](), d = this[i][l] || this[i].length, f = `, ${this[i].filter(({ consumed: e }) => !e).length} interceptor(s) remaining out of ${d} defined`; - if (u === !1) throw new r(`${s.message}: subsequent request to origin ${t} was not allowed (net.connect disabled)${f}`); - if (N(u, t)) n.call(this, a, o); - else throw new r(`${s.message}: subsequent request to origin ${t} was not allowed (net.connect is not enabled for this origin)${f}`); - } else throw s; - } - else n.call(this, a, o); - }; - } - function N(e, t) { - let n = new URL(t); - return e === !0 ? !0 : !!(Array.isArray(e) && e.some((e) => m(e, n.host))); - } - function P(e) { - return typeof e != `string` && !(e instanceof URL) ? e : e instanceof URL ? e.origin : e.toLowerCase(); - } - function F(e) { - let { agent: t, ...n } = e; - if (`enableCallHistory` in n && typeof n.enableCallHistory != `boolean`) throw new p(`options.enableCallHistory must to be a boolean`); - if (`acceptNonStandardSearchParameters` in n && typeof n.acceptNonStandardSearchParameters != `boolean`) throw new p(`options.acceptNonStandardSearchParameters must to be a boolean`); - if (`ignoreTrailingSlash` in n && typeof n.ignoreTrailingSlash != `boolean`) throw new p(`options.ignoreTrailingSlash must to be a boolean`); - return n; - } - n.exports = { - getResponseData: S, - getMockDispatch: C, - addMockDispatch: w, - deleteMockDispatch: T, - buildKey: D, - generateKeyValues: O, - matchValue: m, - getResponse: A, - getStatusText: k, - mockDispatch: j, - buildMockDispatch: M, - checkNetConnect: N, - buildAndValidateMockOptions: F, - getHeaderByName: g, - buildHeadersFromArray: _, - normalizeSearchParams: y, - normalizeOrigin: P - }; -})); -var mo$1 = c$12(((e, t) => { - let { getResponseData: n, buildKey: r, addMockDispatch: i } = po$1(), { kDispatches: a, kDispatchKey: o, kDefaultHeaders: s, kDefaultTrailers: c, kContentLength: l, kMockDispatch: u, kIgnoreTrailingSlash: d } = fo$1(), { InvalidArgumentError: f } = K$6(), { serializePathWithQuery: p } = q$6(); - var m = class { - constructor(e) { - this[u] = e; - } - delay(e) { - if (typeof e != `number` || !Number.isInteger(e) || e <= 0) throw new f(`waitInMs must be a valid integer > 0`); - return this[u].delay = e, this; - } - persist() { - return this[u].persist = !0, this; - } - times(e) { - if (typeof e != `number` || !Number.isInteger(e) || e <= 0) throw new f(`repeatTimes must be a valid integer > 0`); - return this[u].times = e, this; - } - }, h = class { - constructor(e, t) { - if (typeof e != `object`) throw new f(`opts must be an object`); - if (e.path === void 0) throw new f(`opts.path must be defined`); - if (e.method === void 0 && (e.method = `GET`), typeof e.path == `string`) if (e.query) e.path = p(e.path, e.query); - else { - let t = new URL(e.path, `data://`); - e.path = t.pathname + t.search; - } - typeof e.method == `string` && (e.method = e.method.toUpperCase()), this[o] = r(e), this[a] = t, this[d] = e.ignoreTrailingSlash ?? !1, this[s] = {}, this[c] = {}, this[l] = !1; - } - createMockScopeDispatchData({ statusCode: e, data: t, responseOptions: r }) { - let i = n(t), a = this[l] ? { "content-length": i.length } : {}; - return { - statusCode: e, - data: t, - headers: { - ...this[s], - ...a, - ...r.headers - }, - trailers: { - ...this[c], - ...r.trailers - } - }; - } - validateReplyParameters(e) { - if (e.statusCode === void 0) throw new f(`statusCode must be defined`); - if (typeof e.responseOptions != `object` || e.responseOptions === null) throw new f(`responseOptions must be an object`); - } - reply(e) { - if (typeof e == `function`) return new m(i(this[a], this[o], (t) => { - let n = e(t); - if (typeof n != `object` || !n) throw new f(`reply options callback must return an object`); - let r = { - data: ``, - responseOptions: {}, - ...n - }; - return this.validateReplyParameters(r), { ...this.createMockScopeDispatchData(r) }; - }, { ignoreTrailingSlash: this[d] })); - let t = { - statusCode: e, - data: arguments[1] === void 0 ? `` : arguments[1], - responseOptions: arguments[2] === void 0 ? {} : arguments[2] - }; - this.validateReplyParameters(t); - let n = this.createMockScopeDispatchData(t); - return new m(i(this[a], this[o], n, { ignoreTrailingSlash: this[d] })); - } - replyWithError(e) { - if (e === void 0) throw new f(`error must be defined`); - return new m(i(this[a], this[o], { error: e }, { ignoreTrailingSlash: this[d] })); - } - defaultReplyHeaders(e) { - if (e === void 0) throw new f(`headers must be defined`); - return this[s] = e, this; - } - defaultReplyTrailers(e) { - if (e === void 0) throw new f(`trailers must be defined`); - return this[c] = e, this; - } - replyContentLength() { - return this[l] = !0, this; - } - }; - t.exports.MockInterceptor = h, t.exports.MockScope = m; -})); -var ho$1 = c$12(((e, n) => { - let { promisify: r } = f$11(`node:util`), i = Va$3(), { buildMockDispatch: a } = po$1(), { kDispatches: o, kMockAgent: s, kClose: c, kOriginalClose: l, kOrigin: u, kOriginalDispatch: d, kConnected: f, kIgnoreTrailingSlash: p } = fo$1(), { MockInterceptor: m } = mo$1(), h = da$3(), { InvalidArgumentError: g } = K$6(); - n.exports = class extends i { - constructor(e, t) { - if (!t || !t.agent || typeof t.agent.dispatch != `function`) throw new g(`Argument opts.agent must implement Agent`); - super(e, t), this[s] = t.agent, this[u] = e, this[p] = t.ignoreTrailingSlash ?? !1, this[o] = [], this[f] = 1, this[d] = this.dispatch, this[l] = this.close.bind(this), this.dispatch = a.call(this), this.close = this[c]; - } - get [h.kConnected]() { - return this[f]; - } - intercept(e) { - return new m(e && { - ignoreTrailingSlash: this[p], - ...e - }, this[o]); - } - cleanMocks() { - this[o] = []; - } - async [c]() { - await r(this[l])(), this[f] = 0, this[s][h.kClients].delete(this[u]); - } - }; -})); -var go$1 = c$12(((e, t) => { - let { kMockCallHistoryAddLog: n } = fo$1(), { InvalidArgumentError: r } = K$6(); - function i(e, t, n, i, a) { - switch (t.operator) { - case `OR`: return i.push(...n(e, a)), i; - case `AND`: return n(e, i); - default: throw new r(`options.operator must to be a case insensitive string equal to 'OR' or 'AND'`); - } - } - function a(e = {}) { - let t = {}; - if (`operator` in e) { - if (typeof e.operator != `string` || e.operator.toUpperCase() !== `OR` && e.operator.toUpperCase() !== `AND`) throw new r(`options.operator must to be a case insensitive string equal to 'OR' or 'AND'`); - return { - ...t, - operator: e.operator.toUpperCase() - }; - } - return t; - } - function o(e) { - return (t, n) => { - if (typeof t == `string` || t == null) return n.filter((n) => n[e] === t); - if (t instanceof RegExp) return n.filter((n) => t.test(n[e])); - throw new r(`${e} parameter should be one of string, regexp, undefined or null`); - }; - } - function s(e) { - try { - let t = new URL(e.path, e.origin); - return t.search.length === 0 && (t.search = new URLSearchParams(e.query).toString()), t; - } catch (e) { - throw new r(`An error occurred when computing MockCallHistoryLog.url`, { cause: e }); - } - } - var c = class { - constructor(e = {}) { - this.body = e.body, this.headers = e.headers, this.method = e.method; - let t = s(e); - this.fullUrl = t.toString(), this.origin = t.origin, this.path = t.pathname, this.searchParams = Object.fromEntries(t.searchParams), this.protocol = t.protocol, this.host = t.host, this.port = t.port, this.hash = t.hash; - } - toMap() { - return /* @__PURE__ */ new Map([ - [`protocol`, this.protocol], - [`host`, this.host], - [`port`, this.port], - [`origin`, this.origin], - [`path`, this.path], - [`hash`, this.hash], - [`searchParams`, this.searchParams], - [`fullUrl`, this.fullUrl], - [`method`, this.method], - [`body`, this.body], - [`headers`, this.headers] - ]); - } - toString() { - let e = { - betweenKeyValueSeparator: `->`, - betweenPairSeparator: `|` - }, t = ``; - return this.toMap().forEach((n, r) => { - (typeof n == `string` || n == null) && (t = `${t}${r}${e.betweenKeyValueSeparator}${n}${e.betweenPairSeparator}`), (typeof n == `object` && n || Array.isArray(n)) && (t = `${t}${r}${e.betweenKeyValueSeparator}${JSON.stringify(n)}${e.betweenPairSeparator}`); - }), t.slice(0, -1); - } - }, l = class { - logs = []; - calls() { - return this.logs; - } - firstCall() { - return this.logs.at(0); - } - lastCall() { - return this.logs.at(-1); - } - nthCall(e) { - if (typeof e != `number`) throw new r(`nthCall must be called with a number`); - if (!Number.isInteger(e)) throw new r(`nthCall must be called with an integer`); - if (Math.sign(e) !== 1) throw new r(`nthCall must be called with a positive value. use firstCall or lastCall instead`); - return this.logs.at(e - 1); - } - filterCalls(e, t) { - if (this.logs.length === 0) return this.logs; - if (typeof e == `function`) return this.logs.filter(e); - if (e instanceof RegExp) return this.logs.filter((t) => e.test(t.toString())); - if (typeof e == `object` && e) { - if (Object.keys(e).length === 0) return this.logs; - let n = { - operator: `OR`, - ...a(t) - }, r = n.operator === `AND` ? this.logs : []; - return `protocol` in e && (r = i(e.protocol, n, this.filterCallsByProtocol, r, this.logs)), `host` in e && (r = i(e.host, n, this.filterCallsByHost, r, this.logs)), `port` in e && (r = i(e.port, n, this.filterCallsByPort, r, this.logs)), `origin` in e && (r = i(e.origin, n, this.filterCallsByOrigin, r, this.logs)), `path` in e && (r = i(e.path, n, this.filterCallsByPath, r, this.logs)), `hash` in e && (r = i(e.hash, n, this.filterCallsByHash, r, this.logs)), `fullUrl` in e && (r = i(e.fullUrl, n, this.filterCallsByFullUrl, r, this.logs)), `method` in e && (r = i(e.method, n, this.filterCallsByMethod, r, this.logs)), [...new Set(r)]; - } - throw new r(`criteria parameter should be one of function, regexp, or object`); - } - filterCallsByProtocol = o.call(this, `protocol`); - filterCallsByHost = o.call(this, `host`); - filterCallsByPort = o.call(this, `port`); - filterCallsByOrigin = o.call(this, `origin`); - filterCallsByPath = o.call(this, `path`); - filterCallsByHash = o.call(this, `hash`); - filterCallsByFullUrl = o.call(this, `fullUrl`); - filterCallsByMethod = o.call(this, `method`); - clear() { - this.logs = []; - } - [n](e) { - let t = new c(e); - return this.logs.push(t), t; - } - *[Symbol.iterator]() { - for (let e of this.calls()) yield e; - } - }; - t.exports.MockCallHistory = l, t.exports.MockCallHistoryLog = c; -})); -var _o$1 = c$12(((e, n) => { - let { promisify: r } = f$11(`node:util`), i = Wa$3(), { buildMockDispatch: a } = po$1(), { kDispatches: o, kMockAgent: s, kClose: c, kOriginalClose: l, kOrigin: u, kOriginalDispatch: d, kConnected: f, kIgnoreTrailingSlash: p } = fo$1(), { MockInterceptor: m } = mo$1(), h = da$3(), { InvalidArgumentError: g } = K$6(); - n.exports = class extends i { - constructor(e, t) { - if (!t || !t.agent || typeof t.agent.dispatch != `function`) throw new g(`Argument opts.agent must implement Agent`); - super(e, t), this[s] = t.agent, this[u] = e, this[p] = t.ignoreTrailingSlash ?? !1, this[o] = [], this[f] = 1, this[d] = this.dispatch, this[l] = this.close.bind(this), this.dispatch = a.call(this), this.close = this[c]; - } - get [h.kConnected]() { - return this[f]; - } - intercept(e) { - return new m(e && { - ignoreTrailingSlash: this[p], - ...e - }, this[o]); - } - cleanMocks() { - this[o] = []; - } - async [c]() { - await r(this[l])(), this[f] = 0, this[s][h.kClients].delete(this[u]); - } - }; -})); -var vo$1 = c$12(((e, n) => { - let { Transform: r } = f$11(`node:stream`), { Console: i } = f$11(`node:console`), a = process.versions.icu ? `✅` : `Y `, o = process.versions.icu ? `❌` : `N `; - n.exports = class { - constructor({ disableColors: e } = {}) { - this.transform = new r({ transform(e, t, n) { - n(null, e); - } }), this.logger = new i({ - stdout: this.transform, - inspectOptions: { colors: !e && !process.env.CI } - }); - } - format(e) { - let t = e.map(({ method: e, path: t, data: { statusCode: n }, persist: r, times: i, timesInvoked: s, origin: c }) => ({ - Method: e, - Origin: c, - Path: t, - "Status code": n, - Persistent: r ? a : o, - Invocations: s, - Remaining: r ? Infinity : i - s - })); - return this.logger.table(t), this.transform.read().toString(); - } - }; -})); -var yo$1 = c$12(((e, t) => { - let { kClients: n } = da$3(), r = qa$3(), { kAgent: i, kMockAgentSet: a, kMockAgentGet: o, kDispatches: s, kIsMockActive: c, kNetConnect: l, kGetNetConnect: u, kOptions: d, kFactory: f, kMockAgentRegisterCallHistory: p, kMockAgentIsCallHistoryEnabled: m, kMockAgentAddCallHistoryLog: h, kMockAgentMockCallHistoryInstance: g, kMockAgentAcceptsNonStandardSearchParameters: _, kMockCallHistoryAddLog: v, kIgnoreTrailingSlash: y } = fo$1(), b = ho$1(), x = _o$1(), { matchValue: S, normalizeSearchParams: C, buildAndValidateMockOptions: w, normalizeOrigin: T } = po$1(), { InvalidArgumentError: E, UndiciError: D } = K$6(), O = ya$3(), k = vo$1(), { MockCallHistory: A } = go$1(); - t.exports = class extends O { - constructor(e = {}) { - super(e); - let t = w(e); - if (this[l] = !0, this[c] = !0, this[m] = t.enableCallHistory ?? !1, this[_] = t.acceptNonStandardSearchParameters ?? !1, this[y] = t.ignoreTrailingSlash ?? !1, e?.agent && typeof e.agent.dispatch != `function`) throw new E(`Argument opts.agent must implement Agent`); - let a = e?.agent ? e.agent : new r(e); - this[i] = a, this[n] = a[n], this[d] = t, this[m] && this[p](); - } - get(e) { - let t = T(e), n = this[y] ? t.replace(/\/$/, ``) : t, r = this[o](n); - return r || (r = this[f](n), this[a](n, r)), r; - } - dispatch(e, t) { - e.origin = T(e.origin), this.get(e.origin), this[h](e); - let n = this[_], r = { ...e }; - if (n && r.path) { - let [e, t] = r.path.split(`?`); - r.path = `${e}?${C(t, n)}`; - } - return this[i].dispatch(r, t); - } - async close() { - this.clearCallHistory(), await this[i].close(), this[n].clear(); - } - deactivate() { - this[c] = !1; - } - activate() { - this[c] = !0; - } - enableNetConnect(e) { - if (typeof e == `string` || typeof e == `function` || e instanceof RegExp) Array.isArray(this[l]) ? this[l].push(e) : this[l] = [e]; - else if (e === void 0) this[l] = !0; - else throw new E(`Unsupported matcher. Must be one of String|Function|RegExp.`); - } - disableNetConnect() { - this[l] = !1; - } - enableCallHistory() { - return this[m] = !0, this; - } - disableCallHistory() { - return this[m] = !1, this; - } - getCallHistory() { - return this[g]; - } - clearCallHistory() { - this[g] !== void 0 && this[g].clear(); - } - get isMockActive() { - return this[c]; - } - [p]() { - this[g] === void 0 && (this[g] = new A()); - } - [h](e) { - this[m] && (this[p](), this[g][v](e)); - } - [a](e, t) { - this[n].set(e, { - count: 0, - dispatcher: t - }); - } - [f](e) { - let t = Object.assign({ agent: this }, this[d]); - return this[d] && this[d].connections === 1 ? new b(e, t) : new x(e, t); - } - [o](e) { - let t = this[n].get(e); - if (t?.dispatcher) return t.dispatcher; - if (typeof e != `string`) { - let t = this[f](`http://localhost:9999`); - return this[a](e, t), t; - } - for (let [t, r] of Array.from(this[n])) if (r && typeof t != `string` && S(t, e)) { - let t = this[f](e); - return this[a](e, t), t[s] = r.dispatcher[s], t; - } - } - [u]() { - return this[l]; - } - pendingInterceptors() { - let e = this[n]; - return Array.from(e.entries()).flatMap(([e, t]) => t.dispatcher[s].map((t) => ({ - ...t, - origin: e - }))).filter(({ pending: e }) => e); - } - assertNoPendingInterceptors({ pendingInterceptorsFormatter: e = new k() } = {}) { - let t = this.pendingInterceptors(); - if (t.length !== 0) throw new D(t.length === 1 ? `1 interceptor is pending:\n\n${e.format(t)}`.trim() : `${t.length} interceptors are pending:\n\n${e.format(t)}`.trim()); - } - }; -})); -var bo$1 = c$12(((e, n) => { - let { InvalidArgumentError: r } = K$6(), { runtimeFeatures: i } = Ma$3(); - function a(e = {}) { - let { ignoreHeaders: t = [], excludeHeaders: n = [], matchHeaders: r = [], caseSensitive: i = !1 } = e; - return { - ignore: new Set(t.map((e) => i ? e : e.toLowerCase())), - exclude: new Set(n.map((e) => i ? e : e.toLowerCase())), - match: new Set(r.map((e) => i ? e : e.toLowerCase())) - }; - } - let o = i.has(`crypto`) ? f$11(`node:crypto`) : null, s = o?.hash ? (e) => o.hash(`sha256`, e, `base64url`) : (e) => Buffer.from(e).toString(`base64url`); - function c(e) { - return Array.isArray(e) && (e.length & 1) == 0; - } - function l(e = []) { - return e.length === 0 ? () => !1 : function(t) { - let n; - for (let r of e) if (typeof r == `string`) { - if (n ||= t.toLowerCase(), n.includes(r.toLowerCase())) return !0; - } else if (r instanceof RegExp && r.test(t)) return !0; - return !1; - }; - } - function u(e) { - let t = {}; - if (!e) return t; - if (c(e)) { - for (let n = 0; n < e.length; n += 2) { - let r = e[n], i = e[n + 1]; - if (r && i !== void 0) { - let e = Buffer.isBuffer(r) ? r.toString() : r, n = Buffer.isBuffer(i) ? i.toString() : i; - t[e.toLowerCase()] = n; - } - } - return t; - } - if (e && typeof e == `object`) for (let [n, r] of Object.entries(e)) n && typeof n == `string` && (t[n.toLowerCase()] = Array.isArray(r) ? r.join(`, `) : String(r)); - return t; - } - let d = [ - `record`, - `playback`, - `update` - ]; - function f(e) { - if (!d.includes(e)) throw new r(`Invalid snapshot mode: ${e}. Must be one of: ${d.join(`, `)}`); - } - n.exports = { - createHeaderFilters: a, - hashId: s, - isUndiciHeaders: c, - normalizeHeaders: u, - isUrlExcludedFactory: l, - validateSnapshotMode: f - }; -})); -var xo$1 = c$12(((e, n) => { - let { writeFile: r, readFile: i, mkdir: a } = f$11(`node:fs/promises`), { dirname: o, resolve: s } = f$11(`node:path`), { setTimeout: c, clearTimeout: l } = f$11(`node:timers`), { InvalidArgumentError: u, UndiciError: d } = K$6(), { hashId: f, isUrlExcludedFactory: p, normalizeHeaders: m, createHeaderFilters: h } = bo$1(); - function g(e, t, n = {}) { - let r = new URL(e.path, e.origin), i = e._normalizedHeaders || m(e.headers); - return e._normalizedHeaders ||= i, { - method: e.method || `GET`, - url: n.matchQuery === !1 ? `${r.origin}${r.pathname}` : r.toString(), - headers: _(i, t, n), - body: n.matchBody !== !1 && e.body ? String(e.body) : `` - }; - } - function _(e, t, n = {}) { - if (!e || typeof e != `object`) return {}; - let { caseSensitive: r = !1 } = n, i = {}, { ignore: a, exclude: o, match: s } = t; - for (let [t, n] of Object.entries(e)) { - let e = r ? t : t.toLowerCase(); - o.has(e) || a.has(e) || s.size !== 0 && !s.has(e) || (i[e] = n); - } - return i; - } - function v(e, t, n = {}) { - if (!e || typeof e != `object`) return {}; - let { caseSensitive: r = !1 } = n, i = {}, { exclude: a } = t; - for (let [t, n] of Object.entries(e)) { - let e = r ? t : t.toLowerCase(); - a.has(e) || (i[e] = n); - } - return i; - } - function y(e) { - let t = [e.method, e.url]; - if (e.headers && typeof e.headers == `object`) { - let n = Object.keys(e.headers).sort(); - for (let r of n) { - let n = Array.isArray(e.headers[r]) ? e.headers[r] : [e.headers[r]]; - t.push(r); - for (let e of n.sort()) t.push(String(e)); - } - } - return t.push(e.body), f(t.join(`|`)); - } - n.exports = { - SnapshotRecorder: class { - #e; - #t; - #n = /* @__PURE__ */ new Map(); - #r; - #i = Infinity; - #a = !1; - #o; - constructor(e = {}) { - this.#r = e.snapshotPath, this.#i = e.maxSnapshots || Infinity, this.#a = e.autoFlush || !1, this.flushInterval = e.flushInterval || 3e4, this._flushTimer = null, this.matchOptions = { - matchHeaders: e.matchHeaders || [], - ignoreHeaders: e.ignoreHeaders || [], - excludeHeaders: e.excludeHeaders || [], - matchBody: e.matchBody !== !1, - matchQuery: e.matchQuery !== !1, - caseSensitive: e.caseSensitive || !1 - }, this.#o = h(this.matchOptions), this.shouldRecord = e.shouldRecord || (() => !0), this.shouldPlayback = e.shouldPlayback || (() => !0), this.#t = p(e.excludeUrls), this.#a && this.#r && this.#s(); - } - async record(e, t) { - if (!this.shouldRecord(e) || this.isUrlExcluded(e)) return; - let n = g(e, this.#o, this.matchOptions), r = y(n), i = m(t.headers), a = { - statusCode: t.statusCode, - headers: v(i, this.#o, this.matchOptions), - body: Buffer.isBuffer(t.body) ? t.body.toString(`base64`) : Buffer.from(String(t.body || ``)).toString(`base64`), - trailers: t.trailers - }; - if (this.#n.size >= this.#i && !this.#n.has(r)) { - let e = this.#n.keys().next().value; - this.#n.delete(e); - } - let o = this.#n.get(r); - o && o.responses ? (o.responses.push(a), o.timestamp = (/* @__PURE__ */ new Date()).toISOString()) : this.#n.set(r, { - request: n, - responses: [a], - callCount: 0, - timestamp: (/* @__PURE__ */ new Date()).toISOString() - }), this.#a && this.#r && this.#l(); - } - isUrlExcluded(e) { - let t = new URL(e.path, e.origin).toString(); - return this.#t(t); - } - findSnapshot(e) { - if (!this.shouldPlayback(e) || this.isUrlExcluded(e)) return; - let t = y(g(e, this.#o, this.matchOptions)), n = this.#n.get(t); - if (!n) return; - let r = n.callCount || 0, i = Math.min(r, n.responses.length - 1); - return n.callCount = r + 1, { - ...n, - response: n.responses[i] - }; - } - async loadSnapshots(e) { - let t = e || this.#r; - if (!t) throw new u(`Snapshot path is required`); - try { - let e = await i(s(t), `utf8`), n = JSON.parse(e); - if (Array.isArray(n)) { - this.#n.clear(); - for (let { hash: e, snapshot: t } of n) this.#n.set(e, t); - } else this.#n = new Map(Object.entries(n)); - } catch (e) { - if (e.code === `ENOENT`) this.#n.clear(); - else throw new d(`Failed to load snapshots from ${t}`, { cause: e }); - } - } - async saveSnapshots(e) { - let t = e || this.#r; - if (!t) throw new u(`Snapshot path is required`); - let n = s(t); - await a(o(n), { recursive: !0 }); - let i = Array.from(this.#n.entries()).map(([e, t]) => ({ - hash: e, - snapshot: t - })); - await r(n, JSON.stringify(i, null, 2), { flush: !0 }); - } - clear() { - this.#n.clear(); - } - getSnapshots() { - return Array.from(this.#n.values()); - } - size() { - return this.#n.size; - } - resetCallCounts() { - for (let e of this.#n.values()) e.callCount = 0; - } - deleteSnapshot(e) { - let t = y(g(e, this.#o, this.matchOptions)); - return this.#n.delete(t); - } - getSnapshotInfo(e) { - let t = y(g(e, this.#o, this.matchOptions)), n = this.#n.get(t); - return n ? { - hash: t, - request: n.request, - responseCount: n.responses ? n.responses.length : +!!n.response, - callCount: n.callCount || 0, - timestamp: n.timestamp - } : null; - } - replaceSnapshots(e) { - if (this.#n.clear(), Array.isArray(e)) for (let { hash: t, snapshot: n } of e) this.#n.set(t, n); - else e && typeof e == `object` && (this.#n = new Map(Object.entries(e))); - } - #s() { - return this.#l(); - } - #c() { - this.#e &&= (l(this.#e), this.saveSnapshots().catch(() => {}), null); - } - #l() { - this.#e = c(() => { - this.saveSnapshots().catch(() => {}), this.#a ? this.#e?.refresh() : this.#e = null; - }, 1e3); - } - destroy() { - this.#c(), this.#e &&= (l(this.#e), null); - } - async close() { - this.#r && this.#n.size !== 0 && await this.saveSnapshots(), this.destroy(); - } - }, - formatRequestKey: g, - createRequestHash: y, - filterHeadersForMatching: _, - filterHeadersForStorage: v, - createHeaderFilters: h - }; -})); -var So$1 = c$12(((e, t) => { - let n = qa$3(), r = yo$1(), { SnapshotRecorder: i } = xo$1(), a = va$3(), { InvalidArgumentError: o, UndiciError: s } = K$6(), { validateSnapshotMode: c } = bo$1(), l = Symbol(`kSnapshotRecorder`), u = Symbol(`kSnapshotMode`), d = Symbol(`kSnapshotPath`), f = Symbol(`kSnapshotLoaded`), p = Symbol(`kRealAgent`), m = !1; - t.exports = class extends r { - constructor(e = {}) { - m ||= (process.emitWarning(`SnapshotAgent is experimental and subject to change`, `ExperimentalWarning`), !0); - let { mode: t = `record`, snapshotPath: r = null, ...a } = e; - if (super(a), c(t), (t === `playback` || t === `update`) && !r) throw new o(`snapshotPath is required when mode is '${t}'`); - this[u] = t, this[d] = r, this[l] = new i({ - snapshotPath: this[d], - mode: this[u], - maxSnapshots: e.maxSnapshots, - autoFlush: e.autoFlush, - flushInterval: e.flushInterval, - matchHeaders: e.matchHeaders, - ignoreHeaders: e.ignoreHeaders, - excludeHeaders: e.excludeHeaders, - matchBody: e.matchBody, - matchQuery: e.matchQuery, - caseSensitive: e.caseSensitive, - shouldRecord: e.shouldRecord, - shouldPlayback: e.shouldPlayback, - excludeUrls: e.excludeUrls - }), this[f] = !1, (this[u] === `record` || this[u] === `update` || this[u] === `playback` && e.excludeUrls && e.excludeUrls.length > 0) && (this[p] = new n(e)), (this[u] === `playback` || this[u] === `update`) && this[d] && this.loadSnapshots().catch(() => {}); - } - dispatch(e, t) { - t = a.wrap(t); - let n = this[u]; - if (this[l].isUrlExcluded(e)) return this[p].dispatch(e, t); - if (n === `playback` || n === `update`) { - if (!this[f]) return this.#e(e, t); - let r = this[l].findSnapshot(e); - if (r) return this.#n(r, t); - if (n === `update`) return this.#t(e, t); - { - let n = new s(`No snapshot found for ${e.method || `GET`} ${e.path}`); - if (t.onError) { - t.onError(n); - return; - } - throw n; - } - } else if (n === `record`) return this.#t(e, t); - } - async #e(e, t) { - return await this.loadSnapshots(), this.dispatch(e, t); - } - #t(e, t) { - let n = { - statusCode: null, - headers: {}, - trailers: {}, - body: [] - }, r = this; - return this[p].dispatch(e, { - onRequestStart(e, n) { - return t.onRequestStart(e, { - ...n, - history: this.history - }); - }, - onRequestUpgrade(e, n, r, i) { - return t.onRequestUpgrade(e, n, r, i); - }, - onResponseStart(e, r, i, a) { - return n.statusCode = r, n.headers = i, t.onResponseStart(e, r, i, a); - }, - onResponseData(e, r) { - return n.body.push(r), t.onResponseData(e, r); - }, - onResponseEnd(i, a) { - n.trailers = a; - let o = Buffer.concat(n.body); - r[l].record(e, { - statusCode: n.statusCode, - headers: n.headers, - body: o, - trailers: n.trailers - }).then(() => t.onResponseEnd(i, a)).catch((e) => t.onResponseError(i, e)); - } - }); - } - #n(e, t) { - try { - let { response: n } = e, r = { - pause() {}, - resume() {}, - abort(e) { - this.aborted = !0, this.reason = e; - }, - aborted: !1, - paused: !1 - }; - t.onRequestStart(r), t.onResponseStart(r, n.statusCode, n.headers); - let i = Buffer.from(n.body, `base64`); - t.onResponseData(r, i), t.onResponseEnd(r, n.trailers); - } catch (e) { - t.onError?.(e); - } - } - async loadSnapshots(e) { - await this[l].loadSnapshots(e || this[d]), this[f] = !0, this[u] === `playback` && this.#r(); - } - async saveSnapshots(e) { - return this[l].saveSnapshots(e || this[d]); - } - #r() { - for (let e of this[l].getSnapshots()) { - let { request: t, responses: n, response: r } = e, i = new URL(t.url), a = this.get(i.origin), o = n ? n[0] : r; - o && a.intercept({ - path: i.pathname + i.search, - method: t.method, - headers: t.headers, - body: t.body - }).reply(o.statusCode, o.body, { - headers: o.headers, - trailers: o.trailers - }).persist(); - } - } - getRecorder() { - return this[l]; - } - getMode() { - return this[u]; - } - clearSnapshots() { - this[l].clear(); - } - resetCallCounts() { - this[l].resetCallCounts(); - } - deleteSnapshot(e) { - return this[l].deleteSnapshot(e); - } - getSnapshotInfo(e) { - return this[l].getSnapshotInfo(e); - } - replaceSnapshots(e) { - this[l].replaceSnapshots(e); - } - async close() { - await this[l].close(), await this[p]?.close(), await super.close(); - } - }; -})); -var Co$1 = c$12(((e, t) => { - let n = Symbol.for(`undici.globalDispatcher.2`), r = Symbol.for(`undici.globalDispatcher.1`), { InvalidArgumentError: i } = K$6(), a = qa$3(); - s() === void 0 && o(new a()); - function o(e) { - if (!e || typeof e.dispatch != `function`) throw new i(`Argument agent must implement Agent`); - Object.defineProperty(globalThis, n, { - value: e, - writable: !0, - enumerable: !1, - configurable: !1 - }), Object.defineProperty(globalThis, r, { - value: e, - writable: !0, - enumerable: !1, - configurable: !1 - }); - } - function s() { - return globalThis[r]; - } - t.exports = { - setGlobalDispatcher: o, - getGlobalDispatcher: s, - installedExports: [ - `fetch`, - `Headers`, - `Response`, - `Request`, - `FormData`, - `WebSocket`, - `CloseEvent`, - `ErrorEvent`, - `MessageEvent`, - `EventSource` - ] - }; -})); -var wo$1 = c$12(((e, n) => { - let r = f$11(`node:assert`), i = va$3(); - n.exports = class { - #e; - #t = !1; - #n = !1; - #r = !1; - constructor(e) { - if (typeof e != `object` || !e) throw TypeError(`handler must be an object`); - this.#e = i.wrap(e); - } - onRequestStart(...e) { - this.#e.onRequestStart?.(...e); - } - onRequestUpgrade(...e) { - return r(!this.#t), r(!this.#n), this.#e.onRequestUpgrade?.(...e); - } - onResponseStart(...e) { - return r(!this.#t), r(!this.#n), r(!this.#r), this.#r = !0, this.#e.onResponseStart?.(...e); - } - onResponseData(...e) { - return r(!this.#t), r(!this.#n), this.#e.onResponseData?.(...e); - } - onResponseEnd(...e) { - return r(!this.#t), r(!this.#n), this.#t = !0, this.#e.onResponseEnd?.(...e); - } - onResponseError(...e) { - return this.#n = !0, this.#e.onResponseError?.(...e); - } - onBodySent() {} - }; -})); -var To$1 = c$12(((e, n) => { - let r = q$6(), { kBodyUsed: i } = da$3(), a = f$11(`node:assert`), { InvalidArgumentError: o } = K$6(), s = f$11(`node:events`), c = [ - 300, - 301, - 302, - 303, - 307, - 308 - ], l = Symbol(`body`), u = () => {}; - var d = class { - constructor(e) { - this[l] = e, this[i] = !1; - } - async *[Symbol.asyncIterator]() { - a(!this[i], `disturbed`), this[i] = !0, yield* this[l]; - } - }, f = class e { - static buildDispatch(t, n) { - if (n != null && (!Number.isInteger(n) || n < 0)) throw new o(`maxRedirections must be a positive number`); - let r = t.dispatch.bind(t); - return (t, i) => r(t, new e(r, n, t, i)); - } - constructor(e, t, n, c) { - if (t != null && (!Number.isInteger(t) || t < 0)) throw new o(`maxRedirections must be a positive number`); - this.dispatch = e, this.location = null; - let { maxRedirections: l, ...u } = n; - this.opts = u, this.maxRedirections = t, this.handler = c, this.history = [], r.isStream(this.opts.body) ? (r.bodyLength(this.opts.body) === 0 && this.opts.body.on(`data`, function() { - a(!1); - }), typeof this.opts.body.readableDidRead != `boolean` && (this.opts.body[i] = !1, s.prototype.on.call(this.opts.body, `data`, function() { - this[i] = !0; - }))) : (this.opts.body && typeof this.opts.body.pipeTo == `function` || this.opts.body && typeof this.opts.body != `string` && !ArrayBuffer.isView(this.opts.body) && r.isIterable(this.opts.body) && !r.isFormDataLike(this.opts.body)) && (this.opts.body = new d(this.opts.body)); - } - onRequestStart(e, t) { - this.handler.onRequestStart?.(e, { - ...t, - history: this.history - }); - } - onRequestUpgrade(e, t, n, r) { - this.handler.onRequestUpgrade?.(e, t, n, r); - } - onResponseStart(e, t, n, i) { - if (this.opts.throwOnMaxRedirect && this.history.length >= this.maxRedirections) throw Error(`max redirects`); - if ((t === 301 || t === 302) && this.opts.method === `POST` && (this.opts.method = `GET`, r.isStream(this.opts.body) && r.destroy(this.opts.body.on(`error`, u)), this.opts.body = null), t === 303 && this.opts.method !== `HEAD` && (this.opts.method = `GET`, r.isStream(this.opts.body) && r.destroy(this.opts.body.on(`error`, u)), this.opts.body = null), this.location = this.history.length >= this.maxRedirections || r.isDisturbed(this.opts.body) || c.indexOf(t) === -1 ? null : n.location, this.opts.origin && this.history.push(new URL(this.opts.path, this.opts.origin)), !this.location) { - this.handler.onResponseStart?.(e, t, n, i); - return; - } - let { origin: a, pathname: s, search: l } = r.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin))), d = l ? `${s}${l}` : s, f = `${a}${d}`; - for (let e of this.history) if (e.toString() === f) throw new o(`Redirect loop detected. Cannot redirect to ${a}. This typically happens when using a Client or Pool with cross-origin redirects. Use an Agent for cross-origin redirects.`); - this.opts.headers = m(this.opts.headers, t === 303, this.opts.origin !== a), this.opts.path = d, this.opts.origin = a, this.opts.query = null; - } - onResponseData(e, t) { - this.location || this.handler.onResponseData?.(e, t); - } - onResponseEnd(e, t) { - this.location ? this.dispatch(this.opts, this) : this.handler.onResponseEnd(e, t); - } - onResponseError(e, t) { - this.handler.onResponseError?.(e, t); - } - }; - function p(e, t, n) { - if (e.length === 4) return r.headerNameToString(e) === `host`; - if (t && r.headerNameToString(e).startsWith(`content-`)) return !0; - if (n && (e.length === 13 || e.length === 6 || e.length === 19)) { - let t = r.headerNameToString(e); - return t === `authorization` || t === `cookie` || t === `proxy-authorization`; - } - return !1; - } - function m(e, t, n) { - let i = []; - if (Array.isArray(e)) for (let r = 0; r < e.length; r += 2) p(e[r], t, n) || i.push(e[r], e[r + 1]); - else if (e && typeof e == `object`) { - let a = r.hasSafeIterator(e) ? e : Object.entries(e); - for (let [e, r] of a) p(e, t, n) || i.push(e, r); - } else a(e == null, `headers must be an object or an array`); - return i; - } - n.exports = f; -})); -var Eo$1 = c$12(((e, t) => { - let n = To$1(); - function r({ maxRedirections: e } = {}) { - return (t) => function(r, i) { - let { maxRedirections: a = e, ...o } = r; - if (a == null || a === 0) return t(r, i); - let s = { ...o }; - return t(s, new n(t, a, s, i)); - }; - } - t.exports = r; -})); -var Do$1 = c$12(((e, t) => { - let n = wo$1(), { ResponseError: r } = K$6(); - var i = class extends n { - #e; - #t; - #n; - #r; - #i; - constructor(e, { handler: t }) { - super(t); - } - #a(e) { - return (this.#t ?? ``).indexOf(e) === 0; - } - onRequestStart(e, t) { - return this.#e = 0, this.#t = null, this.#n = null, this.#r = null, this.#i = ``, super.onRequestStart(e, t); - } - onResponseStart(e, t, n, r) { - if (this.#e = t, this.#r = n, this.#t = n[`content-type`], this.#e < 400) return super.onResponseStart(e, t, n, r); - (this.#a(`application/json`) || this.#a(`text/plain`)) && (this.#n = new TextDecoder(`utf-8`)); - } - onResponseData(e, t) { - if (this.#e < 400) return super.onResponseData(e, t); - this.#i += this.#n?.decode(t, { stream: !0 }) ?? ``; - } - onResponseEnd(e, t) { - if (this.#e >= 400) { - if (this.#i += this.#n?.decode(void 0, { stream: !1 }) ?? ``, this.#a(`application/json`)) try { - this.#i = JSON.parse(this.#i); - } catch {} - let t, n = Error.stackTraceLimit; - Error.stackTraceLimit = 0; - try { - t = new r(`Response Error`, this.#e, { - body: this.#i, - headers: this.#r - }); - } finally { - Error.stackTraceLimit = n; - } - super.onResponseError(e, t); - } else super.onResponseEnd(e, t); - } - onResponseError(e, t) { - super.onResponseError(e, t); - } - }; - t.exports = () => (e) => function(t, n) { - return e(t, new i(t, { handler: n })); - }; -})); -var Oo$1 = c$12(((e, t) => { - let n = $a$2(); - t.exports = (e) => (t) => function(r, i) { - return t(r, new n({ - ...r, - retryOptions: { - ...e, - ...r.retryOptions - } - }, { - handler: i, - dispatch: t - })); - }; -})); -var ko$1 = c$12(((e, t) => { - let { InvalidArgumentError: n, RequestAbortedError: r } = K$6(), i = wo$1(); - var a = class extends i { - #e = 1024 * 1024; - #t = !1; - #n = 0; - #r = null; - aborted = !1; - reason = !1; - constructor({ maxSize: e, signal: t }, r) { - if (e != null && (!Number.isFinite(e) || e < 1)) throw new n(`maxSize must be a number greater than 0`); - super(r), this.#e = e ?? this.#e; - } - #i(e) { - this.aborted = !0, this.reason = e; - } - onRequestStart(e, t) { - return e.abort = this.#i.bind(this), this.#r = e, super.onRequestStart(e, t); - } - onResponseStart(e, t, n, i) { - let a = n[`content-length`]; - if (a != null && a > this.#e) throw new r(`Response size (${a}) larger than maxSize (${this.#e})`); - return this.aborted === !0 ? !0 : super.onResponseStart(e, t, n, i); - } - onResponseError(e, t) { - this.#t || (t = this.#r?.reason ?? t, super.onResponseError(e, t)); - } - onResponseData(e, t) { - return this.#n += t.length, this.#n >= this.#e && (this.#t = !0, this.aborted === !0 ? super.onResponseError(e, this.reason) : super.onResponseEnd(e, {})), !0; - } - onResponseEnd(e, t) { - if (!this.#t) { - if (this.#r.aborted === !0) { - super.onResponseError(e, this.reason); - return; - } - super.onResponseEnd(e, t); - } - } - }; - function o({ maxSize: e } = { maxSize: 1024 * 1024 }) { - return (t) => function(n, r) { - let { dumpMaxSize: i = e } = n; - return t(n, new a({ - maxSize: i, - signal: n.signal - }, r)); - }; - } - t.exports = o; -})); -var Ao$1 = c$12(((e, n) => { - let { isIP: r } = f$11(`node:net`), { lookup: i } = f$11(`node:dns`), a = wo$1(), { InvalidArgumentError: o, InformationalError: s } = K$6(), c = 2 ** 31 - 1; - function l(e) { - let t = Object.getPrototypeOf(e); - return Object.prototype.hasOwnProperty.call(e, Symbol.iterator) || t != null && t !== Object.prototype && typeof e[Symbol.iterator] == `function`; - } - function u(e) { - return typeof e == `string` && e.toLowerCase() === `host`; - } - function d(e) { - if (e == null) return null; - if (Array.isArray(e)) { - if (e.length === 0 || !Array.isArray(e[0])) return e; - let t = []; - for (let n of e) Array.isArray(n) && n.length === 2 ? t.push(n[0], n[1]) : t.push(n); - return t; - } - if (typeof e == `object` && l(e)) { - let t = []; - for (let n of e) Array.isArray(n) && n.length === 2 ? t.push(n[0], n[1]) : t.push(n); - return t; - } - return e; - } - function f(e) { - if (e == null) return !1; - if (Array.isArray(e)) { - if (e.length === 0) return !1; - for (let t = 0; t < e.length; t += 2) if (u(e[t])) return !0; - return !1; - } - if (typeof e == `object`) { - for (let t in e) if (u(t)) return !0; - } - return !1; - } - function p(e, t) { - let n = d(t); - return f(n) ? n : Array.isArray(n) ? [ - `host`, - e, - ...n - ] : n && typeof n == `object` ? { - host: e, - ...n - } : { host: e }; - } - var m = class { - #e = 0; - #t = /* @__PURE__ */ new Map(); - constructor(e) { - this.#e = e.maxItems; - } - get size() { - return this.#t.size; - } - get(e) { - return this.#t.get(e) ?? null; - } - set(e, t) { - this.#t.set(e, t); - } - delete(e) { - this.#t.delete(e); - } - full() { - return this.size >= this.#e; - } - }, h = class { - #e = 0; - #t = 0; - dualStack = !0; - affinity = null; - lookup = null; - pick = null; - storage = null; - constructor(e) { - this.#e = e.maxTTL, this.#t = e.maxItems, this.dualStack = e.dualStack, this.affinity = e.affinity, this.lookup = e.lookup ?? this.#n, this.pick = e.pick ?? this.#r, this.storage = e.storage ?? new m(e); - } - runLookup(e, t, n) { - let r = this.storage.get(e.hostname); - if (r == null && this.storage.full()) { - n(null, e); - return; - } - let i = { - affinity: this.affinity, - dualStack: this.dualStack, - lookup: this.lookup, - pick: this.pick, - ...t.dns, - maxTTL: this.#e, - maxItems: this.#t - }; - if (r == null) this.lookup(e, i, (t, r) => { - if (t || r == null || r.length === 0) { - n(t ?? new s(`No DNS entries found`)); - return; - } - this.setRecords(e, r); - let a = this.storage.get(e.hostname), o = this.pick(e, a, i.affinity), c; - c = typeof o.port == `number` ? `:${o.port}` : e.port === `` ? `` : `:${e.port}`, n(null, new URL(`${e.protocol}//${o.family === 6 ? `[${o.address}]` : o.address}${c}`)); - }); - else { - let a = this.pick(e, r, i.affinity); - if (a == null) { - this.storage.delete(e.hostname), this.runLookup(e, t, n); - return; - } - let o; - o = typeof a.port == `number` ? `:${a.port}` : e.port === `` ? `` : `:${e.port}`, n(null, new URL(`${e.protocol}//${a.family === 6 ? `[${a.address}]` : a.address}${o}`)); - } - } - #n(e, t, n) { - i(e.hostname, { - all: !0, - family: this.dualStack === !1 ? this.affinity : 0, - order: `ipv4first` - }, (e, t) => { - if (e) return n(e); - let r = /* @__PURE__ */ new Map(); - for (let e of t) r.set(`${e.address}:${e.family}`, e); - n(null, r.values()); - }); - } - #r(e, t, n) { - let r = null, { records: i, offset: a } = t, o; - if (this.dualStack ? (n ?? (a == null || a === c ? (t.offset = 0, n = 4) : (t.offset++, n = (t.offset & 1) == 1 ? 6 : 4)), o = i[n] != null && i[n].ips.length > 0 ? i[n] : i[n === 4 ? 6 : 4]) : o = i[n], o == null || o.ips.length === 0) return r; - o.offset == null || o.offset === c ? o.offset = 0 : o.offset++; - let s = o.offset % o.ips.length; - return r = o.ips[s] ?? null, r == null ? r : Date.now() - r.timestamp > r.ttl ? (o.ips.splice(s, 1), this.pick(e, t, n)) : r; - } - pickFamily(e, t) { - let n = this.storage.get(e.hostname)?.records; - if (!n) return null; - let r = n[t]; - if (!r) return null; - r.offset == null || r.offset === c ? r.offset = 0 : r.offset++; - let i = r.offset % r.ips.length, a = r.ips[i] ?? null; - return a == null || Date.now() - a.timestamp > a.ttl && r.ips.splice(i, 1), a; - } - setRecords(e, t) { - let n = Date.now(), r = { records: { - 4: null, - 6: null - } }, i = this.#e; - for (let e of t) { - e.timestamp = n, typeof e.ttl == `number` ? (e.ttl = Math.min(e.ttl, this.#e), i = Math.min(i, e.ttl)) : e.ttl = this.#e; - let t = r.records[e.family] ?? { ips: [] }; - t.ips.push(e), r.records[e.family] = t; - } - this.storage.set(e.hostname, r, { ttl: i }); - } - deleteRecords(e) { - this.storage.delete(e.hostname); - } - getHandler(e, t) { - return new g(this, e, t); - } - }, g = class extends a { - #e = null; - #t = null; - #n = null; - #r = null; - #i = null; - #a = !0; - constructor(e, { origin: t, handler: n, dispatch: r, newOrigin: i }, a) { - super(n), this.#r = t, this.#i = i, this.#t = { ...a }, this.#e = e, this.#n = r; - } - onResponseError(e, t) { - switch (t.code) { - case `ETIMEDOUT`: - case `ECONNREFUSED`: - if (this.#e.dualStack) { - if (!this.#a) { - super.onResponseError(e, t); - return; - } - this.#a = !1; - let n = this.#i.hostname[0] === `[` ? 4 : 6, r = this.#e.pickFamily(this.#r, n); - if (r == null) { - super.onResponseError(e, t); - return; - } - let i; - i = typeof r.port == `number` ? `:${r.port}` : this.#r.port === `` ? `` : `:${this.#r.port}`; - let a = { - ...this.#t, - origin: `${this.#r.protocol}//${r.family === 6 ? `[${r.address}]` : r.address}${i}`, - headers: p(this.#r.host, this.#t.headers) - }; - this.#n(a, this); - return; - } - super.onResponseError(e, t); - break; - case `ENOTFOUND`: - this.#e.deleteRecords(this.#r), super.onResponseError(e, t); - break; - default: - super.onResponseError(e, t); - break; - } - } - }; - n.exports = (e) => { - if (e?.maxTTL != null && (typeof e?.maxTTL != `number` || e?.maxTTL < 0)) throw new o(`Invalid maxTTL. Must be a positive number`); - if (e?.maxItems != null && (typeof e?.maxItems != `number` || e?.maxItems < 1)) throw new o(`Invalid maxItems. Must be a positive number and greater than zero`); - if (e?.affinity != null && e?.affinity !== 4 && e?.affinity !== 6) throw new o(`Invalid affinity. Must be either 4 or 6`); - if (e?.dualStack != null && typeof e?.dualStack != `boolean`) throw new o(`Invalid dualStack. Must be a boolean`); - if (e?.lookup != null && typeof e?.lookup != `function`) throw new o(`Invalid lookup. Must be a function`); - if (e?.pick != null && typeof e?.pick != `function`) throw new o(`Invalid pick. Must be a function`); - if (e?.storage != null && (typeof e?.storage?.get != `function` || typeof e?.storage?.set != `function` || typeof e?.storage?.full != `function` || typeof e?.storage?.delete != `function`)) throw new o(`Invalid storage. Must be a object with methods: { get, set, full, delete }`); - let t = e?.dualStack ?? !0, n; - n = t ? e?.affinity ?? null : e?.affinity ?? 4; - let i = new h({ - maxTTL: e?.maxTTL ?? 1e4, - lookup: e?.lookup ?? null, - pick: e?.pick ?? null, - dualStack: t, - affinity: n, - maxItems: e?.maxItems ?? Infinity, - storage: e?.storage - }); - return (e) => function(t, n) { - let a = t.origin.constructor === URL ? t.origin : new URL(t.origin); - return r(a.hostname) === 0 ? (i.runLookup(a, t, (r, o) => { - if (r) return n.onResponseError(null, r); - e({ - ...t, - servername: a.hostname, - origin: o.origin, - headers: p(a.host, t.headers) - }, i.getHandler({ - origin: a, - dispatch: e, - handler: n, - newOrigin: o - }, t)); - }), !0) : e(t, n); - }; - }; -})); -var jo$1 = c$12(((e, t) => { - let { safeHTTPMethods: n, pathHasQueryOrFragment: r, hasSafeIterator: i } = q$6(), { serializePathWithQuery: a } = q$6(); - function o(e) { - if (!e.origin) throw Error(`opts.origin is undefined`); - let t = e.path || `/`; - return e.query && !r(t) && (t = a(t, e.query)), { - origin: e.origin.toString(), - method: e.method, - path: t, - headers: e.headers - }; - } - function s(e) { - let t; - if (e.headers == null) t = {}; - else if (typeof e.headers == `object`) if (t = {}, i(e.headers)) for (let n of e.headers) { - if (!Array.isArray(n)) throw Error(`opts.headers is not a valid header map`); - let [e, r] = n; - if (typeof e != `string` || typeof r != `string`) throw Error(`opts.headers is not a valid header map`); - t[e.toLowerCase()] = r; - } - else for (let n of Object.keys(e.headers)) t[n.toLowerCase()] = e.headers[n]; - else throw Error(`opts.headers is not an object`); - return t; - } - function c(e) { - if (typeof e != `object`) throw TypeError(`expected key to be object, got ${typeof e}`); - for (let t of [ - `origin`, - `method`, - `path` - ]) if (typeof e[t] != `string`) throw TypeError(`expected key.${t} to be string, got ${typeof e[t]}`); - if (e.headers !== void 0 && typeof e.headers != `object`) throw TypeError(`expected headers to be object, got ${typeof e}`); - } - function l(e) { - if (typeof e != `object`) throw TypeError(`expected value to be object, got ${typeof e}`); - for (let t of [ - `statusCode`, - `cachedAt`, - `staleAt`, - `deleteAt` - ]) if (typeof e[t] != `number`) throw TypeError(`expected value.${t} to be number, got ${typeof e[t]}`); - if (typeof e.statusMessage != `string`) throw TypeError(`expected value.statusMessage to be string, got ${typeof e.statusMessage}`); - if (e.headers != null && typeof e.headers != `object`) throw TypeError(`expected value.rawHeaders to be object, got ${typeof e.headers}`); - if (e.vary !== void 0 && typeof e.vary != `object`) throw TypeError(`expected value.vary to be object, got ${typeof e.vary}`); - if (e.etag !== void 0 && typeof e.etag != `string`) throw TypeError(`expected value.etag to be string, got ${typeof e.etag}`); - } - function u(e) { - let t = {}, n; - if (Array.isArray(e)) { - n = []; - for (let t of e) n.push(...t.split(`,`)); - } else n = e.split(`,`); - for (let e = 0; e < n.length; e++) { - let r = n[e].toLowerCase(), i = r.indexOf(`=`), a, o; - switch (i === -1 ? a = r.trim() : (a = r.substring(0, i).trimStart(), o = r.substring(i + 1)), a) { - case `min-fresh`: - case `max-stale`: - case `max-age`: - case `s-maxage`: - case `stale-while-revalidate`: - case `stale-if-error`: { - if (o === void 0 || o[0] === ` `) continue; - o.length >= 2 && o[0] === `"` && o[o.length - 1] === `"` && (o = o.substring(1, o.length - 1)); - let e = parseInt(o, 10); - if (e !== e || a === `max-age` && a in t && t[a] >= e) continue; - t[a] = e; - break; - } - case `private`: - case `no-cache`: if (o) { - if (o[0] === `"`) { - let r = [o.substring(1)], i = o[o.length - 1] === `"`; - if (!i) for (let t = e + 1; t < n.length; t++) { - let e = n[t], a = e.length; - if (r.push(e.trim()), a !== 0 && e[a - 1] === `"`) { - i = !0; - break; - } - } - if (i) { - let e = r[r.length - 1]; - e[e.length - 1] === `"` && (e = e.substring(0, e.length - 1), r[r.length - 1] = e); - for (let e = 0; e < r.length; e++) r[e] = r[e].trim(); - a in t ? t[a] = t[a].concat(r) : t[a] = r; - } - } else { - let e = o.trim(); - a in t ? t[a] = t[a].concat(e) : t[a] = [e]; - } - break; - } - case `public`: - case `no-store`: - case `must-revalidate`: - case `proxy-revalidate`: - case `immutable`: - case `no-transform`: - case `must-understand`: - case `only-if-cached`: - if (o) continue; - t[a] = !0; - break; - default: continue; - } - } - return t; - } - function d(e, t) { - if (typeof e == `string` && e.includes(`*`)) return t; - let n = {}, r = typeof e == `string` ? e.split(`,`) : e; - for (let e of r) { - let r = e.trim().toLowerCase(); - n[r] = t[r] ?? null; - } - return n; - } - function f(e) { - return e.length <= 2 ? !1 : e[0] === `"` && e[e.length - 1] === `"` ? !(e[1] === `"` || e.startsWith(`"W/`)) : e.startsWith(`W/"`) && e[e.length - 1] === `"` ? e.length !== 4 : !1; - } - function p(e, t = `CacheStore`) { - if (typeof e != `object` || !e) throw TypeError(`expected type of ${t} to be a CacheStore, got ${e === null ? `null` : typeof e}`); - for (let n of [ - `get`, - `createWriteStream`, - `delete` - ]) if (typeof e[n] != `function`) throw TypeError(`${t} needs to have a \`${n}()\` function`); - } - function m(e, t = `CacheMethods`) { - if (!Array.isArray(e)) throw TypeError(`expected type of ${t} needs to be an array, got ${e === null ? `null` : typeof e}`); - if (e.length === 0) throw TypeError(`${t} needs to have at least one method`); - for (let r of e) if (!n.includes(r)) throw TypeError(`element of ${t}-array needs to be one of following values: ${n.join(`, `)}, got ${r}`); - } - function h(e, t) { - let n = {}; - if (e.headers) { - let r = Object.keys(e.headers).sort(); - for (let i of r) t?.has(i.toLowerCase()) || (n[i] = e.headers[i]); - } - return JSON.stringify([ - e.origin, - e.method, - e.path, - n - ]); - } - t.exports = { - makeCacheKey: o, - normalizeHeaders: s, - assertCacheKey: c, - assertCacheValue: l, - parseCacheControlHeader: u, - parseVaryHeader: d, - isEtagUsable: f, - assertCacheMethods: m, - assertCacheStore: p, - makeDeduplicationKey: h - }; -})); -var Mo$1 = c$12(((e, t) => { - function n(e) { - switch (e[3]) { - case `,`: return r(e); - case ` `: return i(e); - default: return a(e); - } - } - function r(e) { - if (e.length !== 29 || e[4] !== ` ` || e[7] !== ` ` || e[11] !== ` ` || e[16] !== ` ` || e[19] !== `:` || e[22] !== `:` || e[25] !== ` ` || e[26] !== `G` || e[27] !== `M` || e[28] !== `T`) return; - let t = -1; - if (e[0] === `S` && e[1] === `u` && e[2] === `n`) t = 0; - else if (e[0] === `M` && e[1] === `o` && e[2] === `n`) t = 1; - else if (e[0] === `T` && e[1] === `u` && e[2] === `e`) t = 2; - else if (e[0] === `W` && e[1] === `e` && e[2] === `d`) t = 3; - else if (e[0] === `T` && e[1] === `h` && e[2] === `u`) t = 4; - else if (e[0] === `F` && e[1] === `r` && e[2] === `i`) t = 5; - else if (e[0] === `S` && e[1] === `a` && e[2] === `t`) t = 6; - else return; - let n = 0; - if (e[5] === `0`) { - let t = e.charCodeAt(6); - if (t < 49 || t > 57) return; - n = t - 48; - } else { - let t = e.charCodeAt(5); - if (t < 49 || t > 51) return; - let r = e.charCodeAt(6); - if (r < 48 || r > 57) return; - n = (t - 48) * 10 + (r - 48); - } - let r = -1; - if (e[8] === `J` && e[9] === `a` && e[10] === `n`) r = 0; - else if (e[8] === `F` && e[9] === `e` && e[10] === `b`) r = 1; - else if (e[8] === `M` && e[9] === `a`) if (e[10] === `r`) r = 2; - else if (e[10] === `y`) r = 4; - else return; - else if (e[8] === `J`) if (e[9] === `a` && e[10] === `n`) r = 0; - else if (e[9] === `u`) if (e[10] === `n`) r = 5; - else if (e[10] === `l`) r = 6; - else return; - else return; - else if (e[8] === `A`) if (e[9] === `p` && e[10] === `r`) r = 3; - else if (e[9] === `u` && e[10] === `g`) r = 7; - else return; - else if (e[8] === `S` && e[9] === `e` && e[10] === `p`) r = 8; - else if (e[8] === `O` && e[9] === `c` && e[10] === `t`) r = 9; - else if (e[8] === `N` && e[9] === `o` && e[10] === `v`) r = 10; - else if (e[8] === `D` && e[9] === `e` && e[10] === `c`) r = 11; - else return; - let i = e.charCodeAt(12); - if (i < 48 || i > 57) return; - let a = e.charCodeAt(13); - if (a < 48 || a > 57) return; - let o = e.charCodeAt(14); - if (o < 48 || o > 57) return; - let s = e.charCodeAt(15); - if (s < 48 || s > 57) return; - let c = (i - 48) * 1e3 + (a - 48) * 100 + (o - 48) * 10 + (s - 48), l = 0; - if (e[17] === `0`) { - let t = e.charCodeAt(18); - if (t < 48 || t > 57) return; - l = t - 48; - } else { - let t = e.charCodeAt(17); - if (t < 48 || t > 50) return; - let n = e.charCodeAt(18); - if (n < 48 || n > 57 || t === 50 && n > 51) return; - l = (t - 48) * 10 + (n - 48); - } - let u = 0; - if (e[20] === `0`) { - let t = e.charCodeAt(21); - if (t < 48 || t > 57) return; - u = t - 48; - } else { - let t = e.charCodeAt(20); - if (t < 48 || t > 53) return; - let n = e.charCodeAt(21); - if (n < 48 || n > 57) return; - u = (t - 48) * 10 + (n - 48); - } - let d = 0; - if (e[23] === `0`) { - let t = e.charCodeAt(24); - if (t < 48 || t > 57) return; - d = t - 48; - } else { - let t = e.charCodeAt(23); - if (t < 48 || t > 53) return; - let n = e.charCodeAt(24); - if (n < 48 || n > 57) return; - d = (t - 48) * 10 + (n - 48); - } - let f = new Date(Date.UTC(c, r, n, l, u, d)); - return f.getUTCDay() === t ? f : void 0; - } - function i(e) { - if (e.length !== 24 || e[7] !== ` ` || e[10] !== ` ` || e[19] !== ` `) return; - let t = -1; - if (e[0] === `S` && e[1] === `u` && e[2] === `n`) t = 0; - else if (e[0] === `M` && e[1] === `o` && e[2] === `n`) t = 1; - else if (e[0] === `T` && e[1] === `u` && e[2] === `e`) t = 2; - else if (e[0] === `W` && e[1] === `e` && e[2] === `d`) t = 3; - else if (e[0] === `T` && e[1] === `h` && e[2] === `u`) t = 4; - else if (e[0] === `F` && e[1] === `r` && e[2] === `i`) t = 5; - else if (e[0] === `S` && e[1] === `a` && e[2] === `t`) t = 6; - else return; - let n = -1; - if (e[4] === `J` && e[5] === `a` && e[6] === `n`) n = 0; - else if (e[4] === `F` && e[5] === `e` && e[6] === `b`) n = 1; - else if (e[4] === `M` && e[5] === `a`) if (e[6] === `r`) n = 2; - else if (e[6] === `y`) n = 4; - else return; - else if (e[4] === `J`) if (e[5] === `a` && e[6] === `n`) n = 0; - else if (e[5] === `u`) if (e[6] === `n`) n = 5; - else if (e[6] === `l`) n = 6; - else return; - else return; - else if (e[4] === `A`) if (e[5] === `p` && e[6] === `r`) n = 3; - else if (e[5] === `u` && e[6] === `g`) n = 7; - else return; - else if (e[4] === `S` && e[5] === `e` && e[6] === `p`) n = 8; - else if (e[4] === `O` && e[5] === `c` && e[6] === `t`) n = 9; - else if (e[4] === `N` && e[5] === `o` && e[6] === `v`) n = 10; - else if (e[4] === `D` && e[5] === `e` && e[6] === `c`) n = 11; - else return; - let r = 0; - if (e[8] === ` `) { - let t = e.charCodeAt(9); - if (t < 49 || t > 57) return; - r = t - 48; - } else { - let t = e.charCodeAt(8); - if (t < 49 || t > 51) return; - let n = e.charCodeAt(9); - if (n < 48 || n > 57) return; - r = (t - 48) * 10 + (n - 48); - } - let i = 0; - if (e[11] === `0`) { - let t = e.charCodeAt(12); - if (t < 48 || t > 57) return; - i = t - 48; - } else { - let t = e.charCodeAt(11); - if (t < 48 || t > 50) return; - let n = e.charCodeAt(12); - if (n < 48 || n > 57 || t === 50 && n > 51) return; - i = (t - 48) * 10 + (n - 48); - } - let a = 0; - if (e[14] === `0`) { - let t = e.charCodeAt(15); - if (t < 48 || t > 57) return; - a = t - 48; - } else { - let t = e.charCodeAt(14); - if (t < 48 || t > 53) return; - let n = e.charCodeAt(15); - if (n < 48 || n > 57) return; - a = (t - 48) * 10 + (n - 48); - } - let o = 0; - if (e[17] === `0`) { - let t = e.charCodeAt(18); - if (t < 48 || t > 57) return; - o = t - 48; - } else { - let t = e.charCodeAt(17); - if (t < 48 || t > 53) return; - let n = e.charCodeAt(18); - if (n < 48 || n > 57) return; - o = (t - 48) * 10 + (n - 48); - } - let s = e.charCodeAt(20); - if (s < 48 || s > 57) return; - let c = e.charCodeAt(21); - if (c < 48 || c > 57) return; - let l = e.charCodeAt(22); - if (l < 48 || l > 57) return; - let u = e.charCodeAt(23); - if (u < 48 || u > 57) return; - let d = (s - 48) * 1e3 + (c - 48) * 100 + (l - 48) * 10 + (u - 48), f = new Date(Date.UTC(d, n, r, i, a, o)); - return f.getUTCDay() === t ? f : void 0; - } - function a(e) { - let t = -1, n = -1; - if (e[0] === `S`) e[1] === `u` && e[2] === `n` && e[3] === `d` && e[4] === `a` && e[5] === `y` ? (n = 0, t = 6) : e[1] === `a` && e[2] === `t` && e[3] === `u` && e[4] === `r` && e[5] === `d` && e[6] === `a` && e[7] === `y` && (n = 6, t = 8); - else if (e[0] === `M` && e[1] === `o` && e[2] === `n` && e[3] === `d` && e[4] === `a` && e[5] === `y`) n = 1, t = 6; - else if (e[0] === `T`) e[1] === `u` && e[2] === `e` && e[3] === `s` && e[4] === `d` && e[5] === `a` && e[6] === `y` ? (n = 2, t = 7) : e[1] === `h` && e[2] === `u` && e[3] === `r` && e[4] === `s` && e[5] === `d` && e[6] === `a` && e[7] === `y` && (n = 4, t = 8); - else if (e[0] === `W` && e[1] === `e` && e[2] === `d` && e[3] === `n` && e[4] === `e` && e[5] === `s` && e[6] === `d` && e[7] === `a` && e[8] === `y`) n = 3, t = 9; - else if (e[0] === `F` && e[1] === `r` && e[2] === `i` && e[3] === `d` && e[4] === `a` && e[5] === `y`) n = 5, t = 6; - else return; - if (e[t] !== `,` || e.length - t - 1 != 23 || e[t + 1] !== ` ` || e[t + 4] !== `-` || e[t + 8] !== `-` || e[t + 11] !== ` ` || e[t + 14] !== `:` || e[t + 17] !== `:` || e[t + 20] !== ` ` || e[t + 21] !== `G` || e[t + 22] !== `M` || e[t + 23] !== `T`) return; - let r = 0; - if (e[t + 2] === `0`) { - let n = e.charCodeAt(t + 3); - if (n < 49 || n > 57) return; - r = n - 48; - } else { - let n = e.charCodeAt(t + 2); - if (n < 49 || n > 51) return; - let i = e.charCodeAt(t + 3); - if (i < 48 || i > 57) return; - r = (n - 48) * 10 + (i - 48); - } - let i = -1; - if (e[t + 5] === `J` && e[t + 6] === `a` && e[t + 7] === `n`) i = 0; - else if (e[t + 5] === `F` && e[t + 6] === `e` && e[t + 7] === `b`) i = 1; - else if (e[t + 5] === `M` && e[t + 6] === `a` && e[t + 7] === `r`) i = 2; - else if (e[t + 5] === `A` && e[t + 6] === `p` && e[t + 7] === `r`) i = 3; - else if (e[t + 5] === `M` && e[t + 6] === `a` && e[t + 7] === `y`) i = 4; - else if (e[t + 5] === `J` && e[t + 6] === `u` && e[t + 7] === `n`) i = 5; - else if (e[t + 5] === `J` && e[t + 6] === `u` && e[t + 7] === `l`) i = 6; - else if (e[t + 5] === `A` && e[t + 6] === `u` && e[t + 7] === `g`) i = 7; - else if (e[t + 5] === `S` && e[t + 6] === `e` && e[t + 7] === `p`) i = 8; - else if (e[t + 5] === `O` && e[t + 6] === `c` && e[t + 7] === `t`) i = 9; - else if (e[t + 5] === `N` && e[t + 6] === `o` && e[t + 7] === `v`) i = 10; - else if (e[t + 5] === `D` && e[t + 6] === `e` && e[t + 7] === `c`) i = 11; - else return; - let a = e.charCodeAt(t + 9); - if (a < 48 || a > 57) return; - let o = e.charCodeAt(t + 10); - if (o < 48 || o > 57) return; - let s = (a - 48) * 10 + (o - 48); - s += s < 70 ? 2e3 : 1900; - let c = 0; - if (e[t + 12] === `0`) { - let n = e.charCodeAt(t + 13); - if (n < 48 || n > 57) return; - c = n - 48; - } else { - let n = e.charCodeAt(t + 12); - if (n < 48 || n > 50) return; - let r = e.charCodeAt(t + 13); - if (r < 48 || r > 57 || n === 50 && r > 51) return; - c = (n - 48) * 10 + (r - 48); - } - let l = 0; - if (e[t + 15] === `0`) { - let n = e.charCodeAt(t + 16); - if (n < 48 || n > 57) return; - l = n - 48; - } else { - let n = e.charCodeAt(t + 15); - if (n < 48 || n > 53) return; - let r = e.charCodeAt(t + 16); - if (r < 48 || r > 57) return; - l = (n - 48) * 10 + (r - 48); - } - let u = 0; - if (e[t + 18] === `0`) { - let n = e.charCodeAt(t + 19); - if (n < 48 || n > 57) return; - u = n - 48; - } else { - let n = e.charCodeAt(t + 18); - if (n < 48 || n > 53) return; - let r = e.charCodeAt(t + 19); - if (r < 48 || r > 57) return; - u = (n - 48) * 10 + (r - 48); - } - let d = new Date(Date.UTC(s, i, r, c, l, u)); - return d.getUTCDay() === n ? d : void 0; - } - t.exports = { parseHttpDate: n }; -})); -var No$1 = c$12(((e, t) => { - let n = q$6(), { parseCacheControlHeader: r, parseVaryHeader: i, isEtagUsable: a } = jo$1(), { parseHttpDate: o } = Mo$1(); - function s() {} - let c = [ - 200, - 203, - 204, - 206, - 300, - 301, - 308, - 404, - 405, - 410, - 414, - 501 - ], l = [206]; - var u = class { - #e; - #t; - #n; - #r; - #i; - #a; - constructor({ store: e, type: t, cacheByDefault: n }, r, i) { - this.#r = e, this.#t = t, this.#n = n, this.#e = r, this.#i = i; - } - onRequestStart(e, t) { - this.#a?.destroy(), this.#a = void 0, this.#i.onRequestStart?.(e, t); - } - onRequestUpgrade(e, t, n, r) { - this.#i.onRequestUpgrade?.(e, t, n, r); - } - onResponseStart(e, t, l, u) { - let g = () => this.#i.onResponseStart?.(e, t, l, u), _ = this; - if (!n.safeHTTPMethods.includes(this.#e.method) && t >= 200 && t <= 399) { - try { - this.#r.delete(this.#e)?.catch?.(s); - } catch {} - return g(); - } - let v = l[`cache-control`], y = l[`last-modified`] && c.includes(t); - if (!v && !l.expires && !y && !this.#n) return g(); - let b = v ? r(v) : {}; - if (!d(this.#t, t, l, b, this.#e.headers)) return g(); - let x = Date.now(), S = l.age ? f(l.age) : void 0; - if (S && S >= 2147483647e3) return g(); - let C = typeof l.date == `string` ? o(l.date) : void 0, w = p(this.#t, x, S, l, C, b) ?? this.#n; - if (w === void 0 || S && S > w) return g(); - let T = C ? C.getTime() : x, E = w + T; - if (x >= E) return g(); - let D; - if (this.#e.headers && l.vary && (D = i(l.vary, this.#e.headers), !D)) return g(); - let O = m(T, b, E), k = h(l, b), A = { - statusCode: t, - statusMessage: u, - headers: k, - vary: D, - cacheControlDirectives: b, - cachedAt: S ? x - S : x, - staleAt: E, - deleteAt: O - }; - if (t === 304) { - let t = (t) => { - if (!t) return g(); - if (A.statusCode = t.statusCode, A.statusMessage = t.statusMessage, A.etag = t.etag, A.headers = { - ...t.headers, - ...k - }, g(), this.#a = this.#r.createWriteStream(this.#e, A), !(!this.#a || !t?.body)) if (typeof t.body.values == `function`) { - let n = t.body.values(), r = () => { - for (let t of n) { - let n = this.#a.write(t) === !1; - if (this.#i.onResponseData?.(e, t), n) break; - } - }; - this.#a.on(`error`, function() { - _.#a = void 0, _.#r.delete(_.#e); - }).on(`drain`, () => { - r(); - }).on(`close`, function() { - _.#a === this && (_.#a = void 0); - }), r(); - } else typeof t.body.on == `function` && (t.body.on(`data`, (t) => { - this.#a.write(t), this.#i.onResponseData?.(e, t); - }).on(`end`, () => { - this.#a.end(); - }).on(`error`, () => { - this.#a = void 0, this.#r.delete(this.#e); - }), this.#a.on(`error`, function() { - _.#a = void 0, _.#r.delete(_.#e); - }).on(`close`, function() { - _.#a === this && (_.#a = void 0); - })); - }, n = this.#r.get(this.#e); - n && typeof n.then == `function` ? n.then(t) : t(n); - } else { - if (typeof l.etag == `string` && a(l.etag) && (A.etag = l.etag), this.#a = this.#r.createWriteStream(this.#e, A), !this.#a) return g(); - this.#a.on(`drain`, () => e.resume()).on(`error`, function() { - _.#a = void 0, _.#r.delete(_.#e); - }).on(`close`, function() { - _.#a === this && (_.#a = void 0), e.resume(); - }), g(); - } - } - onResponseData(e, t) { - this.#a?.write(t) === !1 && e.pause(), this.#i.onResponseData?.(e, t); - } - onResponseEnd(e, t) { - this.#a?.end(), this.#i.onResponseEnd?.(e, t); - } - onResponseError(e, t) { - this.#a?.destroy(t), this.#a = void 0, this.#i.onResponseError?.(e, t); - } - }; - function d(e, t, n, r, i) { - return !(t < 200 || l.includes(t) || !c.includes(t) && !n.expires && !r.public && r[`max-age`] === void 0 && !(r.private && e === `private`) && !(r[`s-maxage`] !== void 0 && e === `shared`) || r[`no-store`] || e === `shared` && r.private === !0 || n.vary?.includes(`*`) || i?.authorization && (!r.public && !r[`s-maxage`] && !r[`must-revalidate`] || typeof i.authorization != `string` || Array.isArray(r[`no-cache`]) && r[`no-cache`].includes(`authorization`) || Array.isArray(r.private) && r.private.includes(`authorization`))); - } - function f(e) { - let t = parseInt(Array.isArray(e) ? e[0] : e); - return isNaN(t) ? void 0 : t * 1e3; - } - function p(e, t, n, r, i, a) { - if (e === `shared`) { - let e = a[`s-maxage`]; - if (e !== void 0) return e > 0 ? e * 1e3 : void 0; - } - let s = a[`max-age`]; - if (s !== void 0) return s > 0 ? s * 1e3 : void 0; - if (typeof r.expires == `string`) { - let e = o(r.expires); - if (e) return t >= e.getTime() || i && (i >= e || n !== void 0 && n > e - i) ? void 0 : e.getTime() - t; - } - if (typeof r[`last-modified`] == `string`) { - let e = new Date(r[`last-modified`]); - if (g(e)) return e.getTime() >= t ? void 0 : (t - e.getTime()) * .1; - } - if (a.immutable) return 31536e3; - } - function m(e, t, n) { - let r = -Infinity, i = -Infinity, a = -Infinity; - return t[`stale-while-revalidate`] && (r = n + t[`stale-while-revalidate`] * 1e3), t[`stale-if-error`] && (i = n + t[`stale-if-error`] * 1e3), t.immutable && r === -Infinity && i === -Infinity && (a = e + 31536e6), r === -Infinity && i === -Infinity && a === -Infinity ? n + (n - e) : Math.max(n, r, i, a); - } - function h(e, t) { - let n = [ - `connection`, - `proxy-authenticate`, - `proxy-authentication-info`, - `proxy-authorization`, - `proxy-connection`, - `te`, - `transfer-encoding`, - `upgrade`, - `age` - ]; - e.connection && (Array.isArray(e.connection) ? n.push(...e.connection.map((e) => e.trim())) : n.push(...e.connection.split(`,`).map((e) => e.trim()))), Array.isArray(t[`no-cache`]) && n.push(...t[`no-cache`]), Array.isArray(t.private) && n.push(...t.private); - let r; - for (let t of n) e[t] && (r ??= { ...e }, delete r[t]); - return r ?? e; - } - function g(e) { - return e instanceof Date && Number.isFinite(e.valueOf()); - } - t.exports = u; -})); -var Po$1 = c$12(((e, n) => { - let { Writable: r } = f$11(`node:stream`), { EventEmitter: i } = f$11(`node:events`), { assertCacheKey: a, assertCacheValue: o } = jo$1(); - var s = class extends i { - #e = 1024; - #t = 104857600; - #n = 5242880; - #r = 0; - #i = 0; - #a = /* @__PURE__ */ new Map(); - #o = !1; - constructor(e) { - if (super(), e) { - if (typeof e != `object`) throw TypeError(`MemoryCacheStore options must be an object`); - if (e.maxCount !== void 0) { - if (typeof e.maxCount != `number` || !Number.isInteger(e.maxCount) || e.maxCount < 0) throw TypeError(`MemoryCacheStore options.maxCount must be a non-negative integer`); - this.#e = e.maxCount; - } - if (e.maxSize !== void 0) { - if (typeof e.maxSize != `number` || !Number.isInteger(e.maxSize) || e.maxSize < 0) throw TypeError(`MemoryCacheStore options.maxSize must be a non-negative integer`); - this.#t = e.maxSize; - } - if (e.maxEntrySize !== void 0) { - if (typeof e.maxEntrySize != `number` || !Number.isInteger(e.maxEntrySize) || e.maxEntrySize < 0) throw TypeError(`MemoryCacheStore options.maxEntrySize must be a non-negative integer`); - this.#n = e.maxEntrySize; - } - } - } - get size() { - return this.#r; - } - isFull() { - return this.#r >= this.#t || this.#i >= this.#e; - } - get(e) { - a(e); - let t = `${e.origin}:${e.path}`, n = Date.now(), r = this.#a.get(t), i = r ? c(e, r, n) : null; - return i == null ? void 0 : { - statusMessage: i.statusMessage, - statusCode: i.statusCode, - headers: i.headers, - body: i.body, - vary: i.vary ? i.vary : void 0, - etag: i.etag, - cacheControlDirectives: i.cacheControlDirectives, - cachedAt: i.cachedAt, - staleAt: i.staleAt, - deleteAt: i.deleteAt - }; - } - createWriteStream(e, t) { - a(e), o(t); - let n = `${e.origin}:${e.path}`, i = this, s = { - ...e, - ...t, - body: [], - size: 0 - }; - return new r({ - write(e, t, n) { - typeof e == `string` && (e = Buffer.from(e, t)), s.size += e.byteLength, s.size >= i.#n ? this.destroy() : s.body.push(e), n(null); - }, - final(t) { - let r = i.#a.get(n); - r || (r = [], i.#a.set(n, r)); - let a = c(e, r, Date.now()); - if (a) { - let e = r.indexOf(a); - r.splice(e, 1, s), i.#r -= a.size; - } else r.push(s), i.#i += 1; - if (i.#r += s.size, i.#r > i.#t || i.#i > i.#e) { - i.#o ||= (i.emit(`maxSizeExceeded`, { - size: i.#r, - maxSize: i.#t, - count: i.#i, - maxCount: i.#e - }), !0); - for (let [e, t] of i.#a) { - for (let e of t.splice(0, t.length / 2)) i.#r -= e.size, --i.#i; - t.length === 0 && i.#a.delete(e); - } - i.#r < i.#t && i.#i < i.#e && (i.#o = !1); - } - t(null); - } - }); - } - delete(e) { - if (typeof e != `object`) throw TypeError(`expected key to be object, got ${typeof e}`); - let t = `${e.origin}:${e.path}`; - for (let e of this.#a.get(t) ?? []) this.#r -= e.size, --this.#i; - this.#a.delete(t); - } - }; - function c(e, t, n) { - return t.find((t) => t.deleteAt > n && t.method === e.method && (t.vary == null || Object.keys(t.vary).every((n) => t.vary[n] === null ? e.headers[n] === void 0 : t.vary[n] === e.headers[n]))); - } - n.exports = s; -})); -var Fo$1 = c$12(((e, n) => { - let r = f$11(`node:assert`); - n.exports = class { - #e = !1; - #t; - #n; - #r; - #i; - constructor(e, t, n) { - if (typeof e != `function`) throw TypeError(`callback must be a function`); - this.#t = e, this.#n = t, this.#i = n; - } - onRequestStart(e, t) { - this.#e = !1, this.#r = t; - } - onRequestUpgrade(e, t, n, r) { - this.#n.onRequestUpgrade?.(e, t, n, r); - } - onResponseStart(e, t, n, i) { - if (r(this.#t != null), this.#e = t === 304 || this.#i && t >= 500 && t <= 504, this.#t(this.#e, this.#r), this.#t = null, this.#e) return !0; - this.#n.onRequestStart?.(e, this.#r), this.#n.onResponseStart?.(e, t, n, i); - } - onResponseData(e, t) { - if (!this.#e) return this.#n.onResponseData?.(e, t); - } - onResponseEnd(e, t) { - this.#e || this.#n.onResponseEnd?.(e, t); - } - onResponseError(e, t) { - if (!this.#e) if (this.#t &&= (this.#t(!1), null), typeof this.#n.onResponseError == `function`) this.#n.onResponseError(e, t); - else throw t; - } - }; -})); -var Io$1 = c$12(((e, n) => { - let r = f$11(`node:assert`), { Readable: i } = f$11(`node:stream`), a = q$6(), o = No$1(), s = Po$1(), c = Fo$1(), { assertCacheStore: l, assertCacheMethods: u, makeCacheKey: d, normalizeHeaders: f, parseCacheControlHeader: p } = jo$1(), { AbortError: m } = K$6(); - function h(e, t) { - if (e !== void 0) { - if (!Array.isArray(e)) throw TypeError(`expected ${t} to be an array or undefined, got ${typeof e}`); - for (let n = 0; n < e.length; n++) { - let r = e[n]; - if (typeof r != `string` && !(r instanceof RegExp)) throw TypeError(`expected ${t}[${n}] to be a string or RegExp, got ${typeof r}`); - } - } - } - let g = () => {}; - function _(e, t, { headers: n = {} }) { - return !!(t?.[`no-cache`] || e.cacheControlDirectives?.[`no-cache`] && !Array.isArray(e.cacheControlDirectives[`no-cache`]) || n[`if-modified-since`] || n[`if-none-match`]); - } - function v(e, t) { - let n = Date.now(); - return n > e.staleAt ? t?.[`max-stale`] ? n > e.staleAt + t[`max-stale`] * 1e3 : !0 : t?.[`min-fresh`] ? e.staleAt - n <= t[`min-fresh`] * 1e3 : !1; - } - function y(e) { - let t = e.cacheControlDirectives?.[`stale-while-revalidate`]; - return t ? Date.now() <= e.staleAt + t * 1e3 : !1; - } - function b(e, t, n, r, i, a) { - if (a?.[`only-if-cached`]) { - let e = !1; - try { - if (typeof r.onConnect == `function` && (r.onConnect(() => { - e = !0; - }), e) || typeof r.onHeaders == `function` && (r.onHeaders(504, [], g, `Gateway Timeout`), e)) return; - typeof r.onComplete == `function` && r.onComplete([]); - } catch (e) { - typeof r.onError == `function` && r.onError(e); - } - return !0; - } - return e(i, new o(t, n, r)); - } - function x(e, t, n, o, s, c) { - let l = a.isStream(n.body) ? n.body : i.from(n.body ?? []); - r(!l.destroyed, `stream should not be destroyed`), r(!l.readableDidRead, `stream should not be readableDidRead`); - let u = { - resume() { - l.resume(); - }, - pause() { - l.pause(); - }, - get paused() { - return l.isPaused(); - }, - get aborted() { - return l.destroyed; - }, - get reason() { - return l.errored; - }, - abort(e) { - l.destroy(e ?? new m()); - } - }; - if (l.on(`error`, function(t) { - if (!this.readableEnded) if (typeof e.onResponseError == `function`) e.onResponseError(u, t); - else throw t; - }).on(`close`, function() { - this.errored || e.onResponseEnd?.(u, {}); - }), e.onRequestStart?.(u, s), l.destroyed) return; - let d = { - ...n.headers, - age: String(o) - }; - c && (d.warning = `110 - "response is stale"`), e.onResponseStart?.(u, n.statusCode, d, n.statusMessage), t.method === `HEAD` ? l.destroy() : l.on(`data`, function(t) { - e.onResponseData?.(u, t); - }); - } - function S(e, t, n, r, i, s, l) { - if (!l) return b(e, t, n, r, i, s); - let u = Date.now(); - if (u > l.deleteAt) return e(i, new o(t, n, r)); - let d = Math.round((u - l.cachedAt) / 1e3); - if (s?.[`max-age`] && d >= s[`max-age`]) return e(i, r); - let f = v(l, s), p = _(l, s, i); - if (f || p) { - if (a.isStream(i.body) && a.bodyLength(i.body) !== 0) return e(i, new o(t, n, r)); - if (!p && y(l)) return x(r, i, l, d, null, !0), queueMicrotask(() => { - let r = { - ...i.headers, - "if-modified-since": new Date(l.cachedAt).toUTCString() - }; - if (l.etag && (r[`if-none-match`] = l.etag), l.vary) for (let e in l.vary) l.vary[e] != null && (r[e] = l.vary[e]); - e({ - ...i, - headers: r - }, new o(t, n, { - onRequestStart() {}, - onRequestUpgrade() {}, - onResponseStart() {}, - onResponseData() {}, - onResponseEnd() {}, - onResponseError() {} - })); - }), !0; - let m = !1, h = l.cacheControlDirectives[`stale-if-error`] ?? s?.[`stale-if-error`]; - h && (m = u < l.staleAt + h * 1e3); - let _ = { - ...i.headers, - "if-modified-since": new Date(l.cachedAt).toUTCString() - }; - if (l.etag && (_[`if-none-match`] = l.etag), l.vary) for (let e in l.vary) l.vary[e] != null && (_[e] = l.vary[e]); - return e({ - ...i, - headers: _ - }, new c((e, t) => { - e ? x(r, i, l, d, t, f) : a.isStream(l.body) && l.body.on(`error`, g).destroy(); - }, new o(t, n, r), m)); - } - a.isStream(i.body) && i.body.on(`error`, g).destroy(), x(r, i, l, d, null, !1); - } - n.exports = (e = {}) => { - let { store: t = new s(), methods: n = [`GET`], cacheByDefault: r = void 0, type: i = `shared`, origins: o = void 0 } = e; - if (typeof e != `object` || !e) throw TypeError(`expected type of opts to be an Object, got ${e === null ? `null` : typeof e}`); - if (l(t, `opts.store`), u(n, `opts.methods`), h(o, `opts.origins`), r !== void 0 && typeof r != `number`) throw TypeError(`expected opts.cacheByDefault to be number or undefined, got ${typeof r}`); - if (i !== void 0 && i !== `shared` && i !== `private`) throw TypeError(`expected opts.type to be shared, private, or undefined, got ${typeof i}`); - let c = { - store: t, - methods: n, - cacheByDefault: r, - type: i - }, m = a.safeHTTPMethods.filter((e) => n.includes(e) === !1); - return (e) => (n, r) => { - if (!n.origin || m.includes(n.method)) return e(n, r); - if (o !== void 0) { - let t = n.origin.toString().toLowerCase(), i = !1; - for (let e = 0; e < o.length; e++) { - let n = o[e]; - if (typeof n == `string`) { - if (n.toLowerCase() === t) { - i = !0; - break; - } - } else if (n.test(t)) { - i = !0; - break; - } - } - if (!i) return e(n, r); - } - n = { - ...n, - headers: f(n) - }; - let i = n.headers?.[`cache-control`] ? p(n.headers[`cache-control`]) : void 0; - if (i?.[`no-store`]) return e(n, r); - let a = d(n), s = t.get(a); - return s && typeof s.then == `function` ? s.then((t) => S(e, c, a, r, n, i, t)) : S(e, c, a, r, n, i, s); - }; - }; -})); -var Lo$1 = c$12(((e, n) => { - let { createInflate: r, createGunzip: i, createBrotliDecompress: a, createZstdDecompress: o } = f$11(`node:zlib`), { pipeline: s } = f$11(`node:stream`), c = wo$1(), { runtimeFeatures: l } = Ma$3(), u = { - gzip: i, - "x-gzip": i, - br: a, - deflate: r, - compress: r, - "x-compress": r, - ...l.has(`zstd`) ? { zstd: o } : {} - }, d = [204, 304], f = !1; - var p = class extends c { - #e = []; - #t; - #n; - constructor(e, { skipStatusCodes: t = d, skipErrorResponses: n = !0 } = {}) { - super(e), this.#t = t, this.#n = n; - } - #r(e, t) { - return !!(!e || t < 200 || this.#t.includes(t) || this.#n && t >= 400); - } - #i(e) { - let t = e.split(`,`); - if (t.length > 5) throw Error(`too many content-encodings in response: ${t.length}, maximum allowed is 5`); - let n = []; - for (let e = t.length - 1; e >= 0; e--) { - let r = t[e].trim(); - if (r) { - if (!u[r]) return n.length = 0, n; - n.push(u[r]()); - } - } - return n; - } - #a(e, t) { - e.on(`readable`, () => { - let n; - for (; (n = e.read()) !== null && super.onResponseData(t, n) !== !1;); - }), e.on(`error`, (e) => { - super.onResponseError(t, e); - }); - } - #o(e) { - let t = this.#e[0]; - this.#a(t, e), t.on(`end`, () => { - super.onResponseEnd(e, {}); - }); - } - #s(e) { - let t = this.#e[this.#e.length - 1]; - this.#a(t, e), s(this.#e, (t) => { - if (t) { - super.onResponseError(e, t); - return; - } - super.onResponseEnd(e, {}); - }); - } - #c() { - this.#e.length = 0; - } - onResponseStart(e, t, n, r) { - let i = n[`content-encoding`]; - if (this.#r(i, t)) return super.onResponseStart(e, t, n, r); - let a = this.#i(i.toLowerCase()); - if (a.length === 0) return this.#c(), super.onResponseStart(e, t, n, r); - this.#e = a; - let { "content-encoding": o, "content-length": s, ...c } = n; - return this.#e.length === 1 ? this.#o(e) : this.#s(e), super.onResponseStart(e, t, c, r); - } - onResponseData(e, t) { - if (this.#e.length > 0) { - this.#e[0].write(t); - return; - } - super.onResponseData(e, t); - } - onResponseEnd(e, t) { - if (this.#e.length > 0) { - this.#e[0].end(), this.#c(); - return; - } - super.onResponseEnd(e, t); - } - onResponseError(e, t) { - if (this.#e.length > 0) { - for (let e of this.#e) e.destroy(t); - this.#c(); - } - super.onResponseError(e, t); - } - }; - function m(e = {}) { - return f ||= (process.emitWarning(`DecompressInterceptor is experimental and subject to change`, `ExperimentalWarning`), !0), (t) => (n, r) => t(n, new p(r, e)); - } - n.exports = m; -})); -var Ro$1 = c$12(((e, t) => { - let { RequestAbortedError: n } = K$6(), r = 5 * 1024 * 1024; - t.exports = class { - #e; - #t = []; - #n = r; - #r = 0; - #i = {}; - #a = ``; - #o = !1; - #s = !1; - #c = !1; - #l = !1; - #u = null; - #d = null; - constructor(e, t, n = r) { - this.#e = e, this.#d = t, this.#n = n; - } - addWaitingHandler(e) { - if (this.#l || this.#c) return !1; - let t = this.#f(e), n = t.controller; - try { - if (e.onRequestStart?.(n, null), n.aborted) return t.done = !0, !0; - this.#s && e.onResponseStart?.(n, this.#r, this.#i, this.#a); - } catch { - return t.done = !0, !0; - } - return n.aborted || this.#t.push(t), !0; - } - onRequestStart(e, t) { - this.#u = e, this.#e.onRequestStart?.(e, t); - } - onRequestUpgrade(e, t, n, r) { - this.#e.onRequestUpgrade?.(e, t, n, r); - } - onResponseStart(e, t, n, r) { - this.#s = !0, this.#r = t, this.#i = n, this.#a = r, this.#e.onResponseStart?.(e, t, n, r); - for (let e of this.#t) { - let { handler: i, controller: a } = e; - if (e.done || a.aborted) { - e.done = !0; - continue; - } - try { - i.onResponseStart?.(a, t, n, r); - } catch {} - a.aborted && (e.done = !0); - } - this.#g(); - } - onResponseData(e, t) { - if (!(this.#o || this.#l)) { - this.#c = !0, this.#e.onResponseData?.(e, t); - for (let e of this.#t) { - let { handler: n, controller: r } = e; - if (e.done || r.aborted) { - e.done = !0; - continue; - } - if (r.paused) { - this.#p(e, t); - continue; - } - try { - n.onResponseData?.(r, t); - } catch {} - r.aborted && (e.done = !0, e.bufferedChunks = [], e.bufferedBytes = 0); - } - this.#g(); - } - } - onResponseEnd(e, t) { - if (!(this.#o || this.#l)) { - this.#l = !0, this.#e.onResponseEnd?.(e, t); - for (let e of this.#t) { - if (e.done || e.controller.aborted) { - e.done = !0; - continue; - } - if (this.#m(e), e.done || e.controller.aborted) { - e.done = !0; - continue; - } - if (e.controller.paused && e.bufferedChunks.length > 0) { - e.pendingTrailers = t; - continue; - } - try { - e.handler.onResponseEnd?.(e.controller, t); - } catch {} - e.done = !0; - } - this.#g(), this.#d?.(); - } - } - onResponseError(e, t) { - if (!this.#l) { - this.#o = !0, this.#l = !0, this.#e.onResponseError?.(e, t); - for (let e of this.#t) this.#h(e, t); - this.#t = [], this.#d?.(); - } - } - #f(e) { - let t = { - handler: e, - controller: null, - bufferedChunks: [], - bufferedBytes: 0, - pendingTrailers: null, - done: !1 - }, n = { - aborted: !1, - paused: !1, - reason: null - }; - return t.controller = { - resume: () => { - if (!n.aborted) { - if (n.paused = !1, this.#m(t), this.#l && t.pendingTrailers && t.bufferedChunks.length === 0 && !n.paused && !n.aborted) { - try { - t.handler.onResponseEnd?.(t.controller, t.pendingTrailers); - } catch {} - t.pendingTrailers = null, t.done = !0; - } - this.#g(); - } - }, - pause: () => { - n.aborted || (n.paused = !0); - }, - get paused() { - return n.paused; - }, - get aborted() { - return n.aborted; - }, - get reason() { - return n.reason; - }, - abort: (e) => { - n.aborted = !0, n.reason = e ?? null, t.done = !0, t.pendingTrailers = null, t.bufferedChunks = [], t.bufferedBytes = 0; - } - }, t; - } - #p(e, t) { - if (e.done || e.controller.aborted) { - e.done = !0, e.bufferedChunks = [], e.bufferedBytes = 0; - return; - } - let r = Buffer.from(t); - if (e.bufferedChunks.push(r), e.bufferedBytes += r.length, e.bufferedBytes > this.#n) { - let t = new n(`Deduplicated waiting handler exceeded maxBufferSize (${this.#n} bytes) while paused`); - this.#h(e, t); - } - } - #m(e) { - let { handler: t, controller: n } = e; - for (; !e.done && !n.aborted && !n.paused && e.bufferedChunks.length > 0;) { - let r = e.bufferedChunks.shift(); - e.bufferedBytes -= r.length; - try { - t.onResponseData?.(n, r); - } catch {} - if (n.aborted) { - e.done = !0, e.pendingTrailers = null, e.bufferedChunks = [], e.bufferedBytes = 0; - break; - } - } - } - #h(e, t) { - if (!e.done) { - e.done = !0, e.pendingTrailers = null, e.bufferedChunks = [], e.bufferedBytes = 0; - try { - e.controller.abort(t), e.handler.onResponseError?.(e.controller, t); - } catch {} - } - } - #g() { - this.#t = this.#t.filter((e) => e.done === !1); - } - }; -})); -var zo$1 = c$12(((e, n) => { - let r = f$11(`node:diagnostics_channel`), i = q$6(), a = Ro$1(), { normalizeHeaders: o, makeCacheKey: s, makeDeduplicationKey: c } = jo$1(), l = r.channel(`undici:request:pending-requests`); - n.exports = (e = {}) => { - let { methods: t = [`GET`], skipHeaderNames: n = [], excludeHeaderNames: r = [], maxBufferSize: u = 5 * 1024 * 1024 } = e; - if (typeof e != `object` || !e) throw TypeError(`expected type of opts to be an Object, got ${e === null ? `null` : typeof e}`); - if (!Array.isArray(t)) throw TypeError(`expected opts.methods to be an array, got ${typeof t}`); - for (let e of t) if (!i.safeHTTPMethods.includes(e)) throw TypeError(`expected opts.methods to only contain safe HTTP methods, got ${e}`); - if (!Array.isArray(n)) throw TypeError(`expected opts.skipHeaderNames to be an array, got ${typeof n}`); - if (!Array.isArray(r)) throw TypeError(`expected opts.excludeHeaderNames to be an array, got ${typeof r}`); - if (!Number.isFinite(u) || u <= 0) throw TypeError(`expected opts.maxBufferSize to be a positive finite number, got ${u}`); - let d = new Set(n.map((e) => e.toLowerCase())), f = new Set(r.map((e) => e.toLowerCase())), p = /* @__PURE__ */ new Map(); - return (e) => (n, r) => { - if (!n.origin || t.includes(n.method) === !1) return e(n, r); - if (n = { - ...n, - headers: o(n) - }, d.size > 0) { - for (let t of Object.keys(n.headers)) if (d.has(t.toLowerCase())) return e(n, r); - } - let i = c(s(n), f), m = p.get(i); - if (m) return m.addWaitingHandler(r) ? !0 : e(n, r); - let h = new a(r, () => { - p.delete(i), l.hasSubscribers && l.publish({ - size: p.size, - key: i, - type: `removed` - }); - }, u); - return p.set(i, h), l.hasSubscribers && l.publish({ - size: p.size, - key: i, - type: `added` - }), e(n, h); - }; - }; -})); -var Bo$1 = c$12(((e, n) => { - let { Writable: r } = f$11(`node:stream`), { assertCacheKey: i, assertCacheValue: a } = jo$1(), o, s = 2 * 1e3 * 1e3 * 1e3; - n.exports = class { - #e = s; - #t = Infinity; - #n; - #r; - #i; - #a; - #o; - #s; - #c; - #l; - constructor(e) { - if (e) { - if (typeof e != `object`) throw TypeError(`SqliteCacheStore options must be an object`); - if (e.maxEntrySize !== void 0) { - if (typeof e.maxEntrySize != `number` || !Number.isInteger(e.maxEntrySize) || e.maxEntrySize < 0) throw TypeError(`SqliteCacheStore options.maxEntrySize must be a non-negative integer`); - if (e.maxEntrySize > s) throw TypeError(`SqliteCacheStore options.maxEntrySize must be less than 2gb`); - this.#e = e.maxEntrySize; - } - if (e.maxCount !== void 0) { - if (typeof e.maxCount != `number` || !Number.isInteger(e.maxCount) || e.maxCount < 0) throw TypeError(`SqliteCacheStore options.maxCount must be a non-negative integer`); - this.#t = e.maxCount; - } - } - o ||= f$11(`node:sqlite`).DatabaseSync, this.#n = new o(e?.location ?? `:memory:`), this.#n.exec(` - PRAGMA journal_mode = WAL; - PRAGMA synchronous = NORMAL; - PRAGMA temp_store = memory; - PRAGMA optimize; - - CREATE TABLE IF NOT EXISTS cacheInterceptorV3 ( - -- Data specific to us - id INTEGER PRIMARY KEY AUTOINCREMENT, - url TEXT NOT NULL, - method TEXT NOT NULL, - - -- Data returned to the interceptor - body BUF NULL, - deleteAt INTEGER NOT NULL, - statusCode INTEGER NOT NULL, - statusMessage TEXT NOT NULL, - headers TEXT NULL, - cacheControlDirectives TEXT NULL, - etag TEXT NULL, - vary TEXT NULL, - cachedAt INTEGER NOT NULL, - staleAt INTEGER NOT NULL - ); - - CREATE INDEX IF NOT EXISTS idx_cacheInterceptorV3_getValuesQuery ON cacheInterceptorV3(url, method, deleteAt); - CREATE INDEX IF NOT EXISTS idx_cacheInterceptorV3_deleteByUrlQuery ON cacheInterceptorV3(deleteAt); - `), this.#r = this.#n.prepare(` - SELECT - id, - body, - deleteAt, - statusCode, - statusMessage, - headers, - etag, - cacheControlDirectives, - vary, - cachedAt, - staleAt - FROM cacheInterceptorV3 - WHERE - url = ? - AND method = ? - ORDER BY - deleteAt ASC - `), this.#i = this.#n.prepare(` - UPDATE cacheInterceptorV3 SET - body = ?, - deleteAt = ?, - statusCode = ?, - statusMessage = ?, - headers = ?, - etag = ?, - cacheControlDirectives = ?, - cachedAt = ?, - staleAt = ? - WHERE - id = ? - `), this.#a = this.#n.prepare(` - INSERT INTO cacheInterceptorV3 ( - url, - method, - body, - deleteAt, - statusCode, - statusMessage, - headers, - etag, - cacheControlDirectives, - vary, - cachedAt, - staleAt - ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) - `), this.#s = this.#n.prepare(`DELETE FROM cacheInterceptorV3 WHERE url = ?`), this.#c = this.#n.prepare(`SELECT COUNT(*) AS total FROM cacheInterceptorV3`), this.#o = this.#n.prepare(`DELETE FROM cacheInterceptorV3 WHERE deleteAt <= ?`), this.#l = this.#t === Infinity ? null : this.#n.prepare(` - DELETE FROM cacheInterceptorV3 - WHERE id IN ( - SELECT - id - FROM cacheInterceptorV3 - ORDER BY cachedAt ASC - LIMIT ? - ) - `); - } - close() { - this.#n.close(); - } - get(e) { - i(e); - let t = this.#f(e); - return t ? { - body: t.body ? Buffer.from(t.body.buffer, t.body.byteOffset, t.body.byteLength) : void 0, - statusCode: t.statusCode, - statusMessage: t.statusMessage, - headers: t.headers ? JSON.parse(t.headers) : void 0, - etag: t.etag ? t.etag : void 0, - vary: t.vary ? JSON.parse(t.vary) : void 0, - cacheControlDirectives: t.cacheControlDirectives ? JSON.parse(t.cacheControlDirectives) : void 0, - cachedAt: t.cachedAt, - staleAt: t.staleAt, - deleteAt: t.deleteAt - } : void 0; - } - set(e, t) { - i(e); - let n = this.#d(e), r = Array.isArray(t.body) ? Buffer.concat(t.body) : t.body, a = r?.byteLength; - if (a && a > this.#e) return; - let o = this.#f(e, !0); - o ? this.#i.run(r, t.deleteAt, t.statusCode, t.statusMessage, t.headers ? JSON.stringify(t.headers) : null, t.etag ? t.etag : null, t.cacheControlDirectives ? JSON.stringify(t.cacheControlDirectives) : null, t.cachedAt, t.staleAt, o.id) : (this.#a.run(n, e.method, r, t.deleteAt, t.statusCode, t.statusMessage, t.headers ? JSON.stringify(t.headers) : null, t.etag ? t.etag : null, t.cacheControlDirectives ? JSON.stringify(t.cacheControlDirectives) : null, t.vary ? JSON.stringify(t.vary) : null, t.cachedAt, t.staleAt), this.#u()); - } - createWriteStream(e, t) { - i(e), a(t); - let n = 0, o = [], s = this; - return new r({ - decodeStrings: !0, - write(e, t, r) { - n += e.byteLength, n < s.#e ? o.push(e) : this.destroy(), r(); - }, - final(n) { - s.set(e, { - ...t, - body: o - }), n(); - } - }); - } - delete(e) { - if (typeof e != `object`) throw TypeError(`expected key to be object, got ${typeof e}`); - this.#s.run(this.#d(e)); - } - #u() { - if (Number.isFinite(this.#t) && this.size <= this.#t) return 0; - { - let e = this.#o.run(Date.now()).changes; - if (e) return e; - } - { - let e = this.#l?.run(Math.max(Math.floor(this.#t * .1), 1)).changes; - if (e) return e; - } - return 0; - } - get size() { - let { total: e } = this.#c.get(); - return e; - } - #d(e) { - return `${e.origin}/${e.path}`; - } - #f(e, t = !1) { - let n = this.#d(e), { headers: r, method: i } = e, a = this.#r.all(n, i); - if (a.length === 0) return; - let o = Date.now(); - for (let e of a) { - if (o >= e.deleteAt && !t) continue; - let n = !0; - if (e.vary) { - let t = JSON.parse(e.vary); - for (let e in t) if (!c(r[e], t[e])) { - n = !1; - break; - } - } - if (n) return e; - } - } - }; - function c(e, t) { - return e == null && t == null ? !0 : e == null && t != null || e != null && t == null ? !1 : Array.isArray(e) && Array.isArray(t) ? e.length === t.length ? e.every((e, n) => e === t[n]) : !1 : e === t; - } -})); -var Vo$1 = c$12(((e, n) => { - let { kConstruct: r } = da$3(), { kEnumerableProperty: i } = q$6(), { iteratorMixin: a, isValidHeaderName: o, isValidHeaderValue: s } = Pa$3(), { webidl: c } = Na$3(), l = f$11(`node:assert`), u = f$11(`node:util`); - function d(e) { - return e === 10 || e === 13 || e === 9 || e === 32; - } - function f(e) { - let t = 0, n = e.length; - for (; n > t && d(e.charCodeAt(n - 1));) --n; - for (; n > t && d(e.charCodeAt(t));) ++t; - return t === 0 && n === e.length ? e : e.substring(t, n); - } - function p(e, t) { - if (Array.isArray(t)) for (let n = 0; n < t.length; ++n) { - let r = t[n]; - if (r.length !== 2) throw c.errors.exception({ - header: `Headers constructor`, - message: `expected name/value pair to be length 2, found ${r.length}.` - }); - m(e, r[0], r[1]); - } - else if (typeof t == `object` && t) { - let n = Object.keys(t); - for (let r = 0; r < n.length; ++r) m(e, n[r], t[n[r]]); - } else throw c.errors.conversionFailed({ - prefix: `Headers constructor`, - argument: `Argument 1`, - types: [`sequence>`, `record`] - }); - } - function m(e, t, n) { - if (n = f(n), !o(t)) throw c.errors.invalidArgument({ - prefix: `Headers.append`, - value: t, - type: `header name` - }); - if (!s(n)) throw c.errors.invalidArgument({ - prefix: `Headers.append`, - value: n, - type: `header value` - }); - if (y(e) === `immutable`) throw TypeError(`immutable`); - return x(e).append(t, n, !1); - } - function h(e) { - let t = x(e); - if (!t) return []; - if (t.sortedMap) return t.sortedMap; - let n = [], r = t.toSortedArray(), i = t.cookies; - if (i === null || i.length === 1) return t.sortedMap = r; - for (let e = 0; e < r.length; ++e) { - let { 0: t, 1: a } = r[e]; - if (t === `set-cookie`) for (let e = 0; e < i.length; ++e) n.push([t, i[e]]); - else n.push([t, a]); - } - return t.sortedMap = n; - } - function g(e, t) { - return e[0] < t[0] ? -1 : 1; - } - var _ = class e { - cookies = null; - sortedMap; - headersMap; - constructor(t) { - t instanceof e ? (this.headersMap = new Map(t.headersMap), this.sortedMap = t.sortedMap, this.cookies = t.cookies === null ? null : [...t.cookies]) : (this.headersMap = new Map(t), this.sortedMap = null); - } - contains(e, t) { - return this.headersMap.has(t ? e : e.toLowerCase()); - } - clear() { - this.headersMap.clear(), this.sortedMap = null, this.cookies = null; - } - append(e, t, n) { - this.sortedMap = null; - let r = n ? e : e.toLowerCase(), i = this.headersMap.get(r); - if (i) { - let e = r === `cookie` ? `; ` : `, `; - this.headersMap.set(r, { - name: i.name, - value: `${i.value}${e}${t}` - }); - } else this.headersMap.set(r, { - name: e, - value: t - }); - r === `set-cookie` && (this.cookies ??= []).push(t); - } - set(e, t, n) { - this.sortedMap = null; - let r = n ? e : e.toLowerCase(); - r === `set-cookie` && (this.cookies = [t]), this.headersMap.set(r, { - name: e, - value: t - }); - } - delete(e, t) { - this.sortedMap = null, t || (e = e.toLowerCase()), e === `set-cookie` && (this.cookies = null), this.headersMap.delete(e); - } - get(e, t) { - return this.headersMap.get(t ? e : e.toLowerCase())?.value ?? null; - } - *[Symbol.iterator]() { - for (let { 0: e, 1: { value: t } } of this.headersMap) yield [e, t]; - } - get entries() { - let e = {}; - if (this.headersMap.size !== 0) for (let { name: t, value: n } of this.headersMap.values()) e[t] = n; - return e; - } - rawValues() { - return this.headersMap.values(); - } - get entriesList() { - let e = []; - if (this.headersMap.size !== 0) for (let { 0: t, 1: { name: n, value: r } } of this.headersMap) if (t === `set-cookie`) for (let t of this.cookies) e.push([n, t]); - else e.push([n, r]); - return e; - } - toSortedArray() { - let e = this.headersMap.size, t = Array(e); - if (e <= 32) { - if (e === 0) return t; - let n = this.headersMap[Symbol.iterator](), r = n.next().value; - t[0] = [r[0], r[1].value], l(r[1].value !== null); - for (let r = 1, i = 0, a = 0, o = 0, s = 0, c, u; r < e; ++r) { - for (u = n.next().value, c = t[r] = [u[0], u[1].value], l(c[1] !== null), o = 0, a = r; o < a;) s = o + (a - o >> 1), t[s][0] <= c[0] ? o = s + 1 : a = s; - if (r !== s) { - for (i = r; i > o;) t[i] = t[--i]; - t[o] = c; - } - } - if (!n.next().done) throw TypeError(`Unreachable`); - return t; - } else { - let e = 0; - for (let { 0: n, 1: { value: r } } of this.headersMap) t[e++] = [n, r], l(r !== null); - return t.sort(g); - } - } - }, v = class e { - #e; - #t; - constructor(e = void 0) { - c.util.markAsUncloneable(this), e !== r && (this.#t = new _(), this.#e = `none`, e !== void 0 && (e = c.converters.HeadersInit(e, `Headers constructor`, `init`), p(this, e))); - } - append(t, n) { - c.brandCheck(this, e), c.argumentLengthCheck(arguments, 2, `Headers.append`); - let r = `Headers.append`; - return t = c.converters.ByteString(t, r, `name`), n = c.converters.ByteString(n, r, `value`), m(this, t, n); - } - delete(t) { - if (c.brandCheck(this, e), c.argumentLengthCheck(arguments, 1, `Headers.delete`), t = c.converters.ByteString(t, `Headers.delete`, `name`), !o(t)) throw c.errors.invalidArgument({ - prefix: `Headers.delete`, - value: t, - type: `header name` - }); - if (this.#e === `immutable`) throw TypeError(`immutable`); - this.#t.contains(t, !1) && this.#t.delete(t, !1); - } - get(t) { - c.brandCheck(this, e), c.argumentLengthCheck(arguments, 1, `Headers.get`); - let n = `Headers.get`; - if (t = c.converters.ByteString(t, n, `name`), !o(t)) throw c.errors.invalidArgument({ - prefix: n, - value: t, - type: `header name` - }); - return this.#t.get(t, !1); - } - has(t) { - c.brandCheck(this, e), c.argumentLengthCheck(arguments, 1, `Headers.has`); - let n = `Headers.has`; - if (t = c.converters.ByteString(t, n, `name`), !o(t)) throw c.errors.invalidArgument({ - prefix: n, - value: t, - type: `header name` - }); - return this.#t.contains(t, !1); - } - set(t, n) { - c.brandCheck(this, e), c.argumentLengthCheck(arguments, 2, `Headers.set`); - let r = `Headers.set`; - if (t = c.converters.ByteString(t, r, `name`), n = c.converters.ByteString(n, r, `value`), n = f(n), !o(t)) throw c.errors.invalidArgument({ - prefix: r, - value: t, - type: `header name` - }); - if (!s(n)) throw c.errors.invalidArgument({ - prefix: r, - value: n, - type: `header value` - }); - if (this.#e === `immutable`) throw TypeError(`immutable`); - this.#t.set(t, n, !1); - } - getSetCookie() { - c.brandCheck(this, e); - let t = this.#t.cookies; - return t ? [...t] : []; - } - [u.inspect.custom](e, t) { - return t.depth ??= e, `Headers ${u.formatWithOptions(t, this.#t.entries)}`; - } - static getHeadersGuard(e) { - return e.#e; - } - static setHeadersGuard(e, t) { - e.#e = t; - } - static getHeadersList(e) { - return e.#t; - } - static setHeadersList(e, t) { - e.#t = t; - } - }; - let { getHeadersGuard: y, setHeadersGuard: b, getHeadersList: x, setHeadersList: S } = v; - Reflect.deleteProperty(v, `getHeadersGuard`), Reflect.deleteProperty(v, `setHeadersGuard`), Reflect.deleteProperty(v, `getHeadersList`), Reflect.deleteProperty(v, `setHeadersList`), a(`Headers`, v, h, 0, 1), Object.defineProperties(v.prototype, { - append: i, - delete: i, - get: i, - has: i, - set: i, - getSetCookie: i, - [Symbol.toStringTag]: { - value: `Headers`, - configurable: !0 - }, - [u.inspect.custom]: { enumerable: !1 } - }), c.converters.HeadersInit = function(e, t, n) { - if (c.util.Type(e) === c.util.Types.OBJECT) { - let r = Reflect.get(e, Symbol.iterator); - if (!u.types.isProxy(e) && r === v.prototype.entries) try { - return x(e).entriesList; - } catch {} - return typeof r == `function` ? c.converters[`sequence>`](e, t, n, r.bind(e)) : c.converters[`record`](e, t, n); - } - throw c.errors.conversionFailed({ - prefix: `Headers constructor`, - argument: `Argument 1`, - types: [`sequence>`, `record`] - }); - }, n.exports = { - fill: p, - compareHeaderName: g, - Headers: v, - HeadersList: _, - getHeadersGuard: y, - setHeadersGuard: b, - setHeadersList: S, - getHeadersList: x - }; -})); -var Ho$1 = c$12(((e, n) => { - let { Headers: r, HeadersList: i, fill: a, getHeadersGuard: o, setHeadersGuard: s, setHeadersList: c } = Vo$1(), { extractBody: l, cloneBody: u, mixinBody: d, streamRegistry: f, bodyUnusable: p } = Ra$3(), m = q$6(), h = f$11(`node:util`), { kEnumerableProperty: g } = m, { isValidReasonPhrase: _, isCancelled: v, isAborted: y, isErrorLike: b, environmentSettingsObject: x } = Pa$3(), { redirectStatusSet: S, nullBodyStatus: C } = Da$3(), { webidl: w } = Na$3(), { URLSerializer: T } = ja$3(), { kConstruct: E } = da$3(), D = f$11(`node:assert`), { isomorphicEncode: O, serializeJavascriptValueToJSONString: k } = Aa$3(), A = new TextEncoder(`utf-8`); - var j = class e { - #e; - #t; - static error() { - return ie(L(), `immutable`); - } - static json(e, t = void 0) { - w.argumentLengthCheck(arguments, 1, `Response.json`), t !== null && (t = w.converters.ResponseInit(t)); - let n = l(A.encode(k(e))), r = ie(ee({}), `response`); - return z(r, t, { - body: n[0], - type: `application/json` - }), r; - } - static redirect(e, t = 302) { - w.argumentLengthCheck(arguments, 1, `Response.redirect`), e = w.converters.USVString(e), t = w.converters[`unsigned short`](t); - let n; - try { - n = new URL(e, x.settingsObject.baseUrl); - } catch (t) { - throw TypeError(`Failed to parse URL from ${e}`, { cause: t }); - } - if (!S.has(t)) throw RangeError(`Invalid status code ${t}`); - let r = ie(ee({}), `immutable`); - r.#t.status = t; - let i = O(T(n)); - return r.#t.headersList.append(`location`, i, !0), r; - } - constructor(e = null, t = void 0) { - if (w.util.markAsUncloneable(this), e === E) return; - e !== null && (e = w.converters.BodyInit(e, `Response`, `body`)), t = w.converters.ResponseInit(t), this.#t = ee({}), this.#e = new r(E), s(this.#e, `response`), c(this.#e, this.#t.headersList); - let n = null; - if (e != null) { - let [t, r] = l(e); - n = { - body: t, - type: r - }; - } - z(this, t, n); - } - get type() { - return w.brandCheck(this, e), this.#t.type; - } - get url() { - w.brandCheck(this, e); - let t = this.#t.urlList, n = t[t.length - 1] ?? null; - return n === null ? `` : T(n, !0); - } - get redirected() { - return w.brandCheck(this, e), this.#t.urlList.length > 1; - } - get status() { - return w.brandCheck(this, e), this.#t.status; - } - get ok() { - return w.brandCheck(this, e), this.#t.status >= 200 && this.#t.status <= 299; - } - get statusText() { - return w.brandCheck(this, e), this.#t.statusText; - } - get headers() { - return w.brandCheck(this, e), this.#e; - } - get body() { - return w.brandCheck(this, e), this.#t.body ? this.#t.body.stream : null; - } - get bodyUsed() { - return w.brandCheck(this, e), !!this.#t.body && m.isDisturbed(this.#t.body.stream); - } - clone() { - if (w.brandCheck(this, e), p(this.#t)) throw w.errors.exception({ - header: `Response.clone`, - message: `Body has already been consumed.` - }); - let t = I(this.#t); - return this.#t.urlList.length !== 0 && this.#t.body?.stream && f.register(this, new WeakRef(this.#t.body.stream)), ie(t, o(this.#e)); - } - [h.inspect.custom](e, t) { - t.depth === null && (t.depth = 2), t.colors ??= !0; - let n = { - status: this.status, - statusText: this.statusText, - headers: this.headers, - body: this.body, - bodyUsed: this.bodyUsed, - ok: this.ok, - redirected: this.redirected, - type: this.type, - url: this.url - }; - return `Response ${h.formatWithOptions(t, n)}`; - } - static getResponseHeaders(e) { - return e.#e; - } - static setResponseHeaders(e, t) { - e.#e = t; - } - static getResponseState(e) { - return e.#t; - } - static setResponseState(e, t) { - e.#t = t; - } - }; - let { getResponseHeaders: M, setResponseHeaders: N, getResponseState: P, setResponseState: F } = j; - Reflect.deleteProperty(j, `getResponseHeaders`), Reflect.deleteProperty(j, `setResponseHeaders`), Reflect.deleteProperty(j, `getResponseState`), Reflect.deleteProperty(j, `setResponseState`), d(j, P), Object.defineProperties(j.prototype, { - type: g, - url: g, - status: g, - ok: g, - redirected: g, - statusText: g, - headers: g, - clone: g, - body: g, - bodyUsed: g, - [Symbol.toStringTag]: { - value: `Response`, - configurable: !0 - } - }), Object.defineProperties(j, { - json: g, - redirect: g, - error: g - }); - function I(e) { - if (e.internalResponse) return ne(I(e.internalResponse), e.type); - let t = ee({ - ...e, - body: null - }); - return e.body != null && (t.body = u(e.body)), t; - } - function ee(e) { - return { - aborted: !1, - rangeRequested: !1, - timingAllowPassed: !1, - requestIncludesCredentials: !1, - type: `default`, - status: 200, - timingInfo: null, - cacheState: ``, - statusText: ``, - ...e, - headersList: e?.headersList ? new i(e?.headersList) : new i(), - urlList: e?.urlList ? [...e.urlList] : [] - }; - } - function L(e) { - return ee({ - type: `error`, - status: 0, - error: b(e) ? e : Error(e && String(e)), - aborted: e && e.name === `AbortError` - }); - } - function te(e) { - return e.type === `error` && e.status === 0; - } - function R(e, t) { - return t = { - internalResponse: e, - ...t - }, new Proxy(e, { - get(e, n) { - return n in t ? t[n] : e[n]; - }, - set(e, n, r) { - return D(!(n in t)), e[n] = r, !0; - } - }); - } - function ne(e, t) { - if (t === `basic`) return R(e, { - type: `basic`, - headersList: e.headersList - }); - if (t === `cors`) return R(e, { - type: `cors`, - headersList: e.headersList - }); - if (t === `opaque`) return R(e, { - type: `opaque`, - urlList: [], - status: 0, - statusText: ``, - body: null - }); - if (t === `opaqueredirect`) return R(e, { - type: `opaqueredirect`, - status: 0, - statusText: ``, - headersList: [], - body: null - }); - D(!1); - } - function re(e, t = null) { - return D(v(e)), y(e) ? L(Object.assign(new DOMException(`The operation was aborted.`, `AbortError`), { cause: t })) : L(Object.assign(new DOMException(`Request was cancelled.`), { cause: t })); - } - function z(e, t, n) { - if (t.status !== null && (t.status < 200 || t.status > 599)) throw RangeError(`init["status"] must be in the range of 200 to 599, inclusive.`); - if (`statusText` in t && t.statusText != null && !_(String(t.statusText))) throw TypeError(`Invalid statusText`); - if (`status` in t && t.status != null && (P(e).status = t.status), `statusText` in t && t.statusText != null && (P(e).statusText = t.statusText), `headers` in t && t.headers != null && a(M(e), t.headers), n) { - if (C.includes(e.status)) throw w.errors.exception({ - header: `Response constructor`, - message: `Invalid response status code ${e.status}` - }); - P(e).body = n.body, n.type != null && !P(e).headersList.contains(`content-type`, !0) && P(e).headersList.append(`content-type`, n.type, !0); - } - } - function ie(e, t) { - let n = new j(E); - F(n, e); - let i = new r(E); - return N(n, i), c(i, e.headersList), s(i, t), e.urlList.length !== 0 && e.body?.stream && f.register(n, new WeakRef(e.body.stream)), n; - } - w.converters.XMLHttpRequestBodyInit = function(e, t, n) { - return typeof e == `string` ? w.converters.USVString(e, t, n) : w.is.Blob(e) || w.is.BufferSource(e) || w.is.FormData(e) || w.is.URLSearchParams(e) ? e : w.converters.DOMString(e, t, n); - }, w.converters.BodyInit = function(e, t, n) { - return w.is.ReadableStream(e) || e?.[Symbol.asyncIterator] ? e : w.converters.XMLHttpRequestBodyInit(e, t, n); - }, w.converters.ResponseInit = w.dictionaryConverter([ - { - key: `status`, - converter: w.converters[`unsigned short`], - defaultValue: () => 200 - }, - { - key: `statusText`, - converter: w.converters.ByteString, - defaultValue: () => `` - }, - { - key: `headers`, - converter: w.converters.HeadersInit - } - ]), w.is.Response = w.util.MakeTypeAssertion(j), n.exports = { - isNetworkError: te, - makeNetworkError: L, - makeResponse: ee, - makeAppropriateNetworkError: re, - filterResponse: ne, - Response: j, - cloneResponse: I, - fromInnerResponse: ie, - getResponseState: P - }; -})); -var Uo$1 = c$12(((e, n) => { - let { extractBody: r, mixinBody: i, cloneBody: a, bodyUnusable: o } = Ra$3(), { Headers: s, fill: c, HeadersList: l, setHeadersGuard: u, getHeadersGuard: d, setHeadersList: f, getHeadersList: p } = Vo$1(), m = q$6(), h = f$11(`node:util`), { isValidHTTPToken: g, sameOrigin: _, environmentSettingsObject: v } = Pa$3(), { forbiddenMethodsSet: y, corsSafeListedMethodsSet: b, referrerPolicy: x, requestRedirect: S, requestMode: C, requestCredentials: w, requestCache: T, requestDuplex: E } = Da$3(), { kEnumerableProperty: D, normalizedMethodRecordsBase: O, normalizedMethodRecords: k } = m, { webidl: A } = Na$3(), { URLSerializer: j } = ja$3(), { kConstruct: M } = da$3(), N = f$11(`node:assert`), { getMaxListeners: P, setMaxListeners: F, defaultMaxListeners: I } = f$11(`node:events`), ee = Symbol(`abortController`), L = new FinalizationRegistry(({ signal: e, abort: t }) => { - e.removeEventListener(`abort`, t); - }), te = /* @__PURE__ */ new WeakMap(), R; - try { - R = P(new AbortController().signal) > 0; - } catch { - R = !1; - } - function ne(e) { - return t; - function t() { - let n = e.deref(); - if (n !== void 0) { - L.unregister(t), this.removeEventListener(`abort`, t), n.abort(this.reason); - let e = te.get(n.signal); - if (e !== void 0) { - if (e.size !== 0) { - for (let t of e) { - let e = t.deref(); - e !== void 0 && e.abort(this.reason); - } - e.clear(); - } - te.delete(n.signal); - } - } - } - } - let re = !1; - var z = class e { - #e; - #t; - #n; - #r; - constructor(e, t = void 0) { - if (A.util.markAsUncloneable(this), e === M) return; - A.argumentLengthCheck(arguments, 1, `Request constructor`), e = A.converters.RequestInfo(e), t = A.converters.RequestInit(t); - let n = null, i = null, a = v.settingsObject.baseUrl, d = null; - if (typeof e == `string`) { - this.#t = t.dispatcher; - let r; - try { - r = new URL(e, a); - } catch (t) { - throw TypeError(`Failed to parse URL from ` + e, { cause: t }); - } - if (r.username || r.password) throw TypeError(`Request cannot be constructed from a URL that includes credentials: ` + e); - n = B({ urlList: [r] }), i = `cors`; - } else N(A.is.Request(e)), n = e.#r, d = e.#e, this.#t = t.dispatcher || e.#t; - let h = v.settingsObject.origin, x = `client`; - if (n.window?.constructor?.name === `EnvironmentSettingsObject` && _(n.window, h) && (x = n.window), t.window != null) throw TypeError(`'window' option '${x}' must be null`); - `window` in t && (x = `no-window`), n = B({ - method: n.method, - headersList: n.headersList, - unsafeRequest: n.unsafeRequest, - client: v.settingsObject, - window: x, - priority: n.priority, - origin: n.origin, - referrer: n.referrer, - referrerPolicy: n.referrerPolicy, - mode: n.mode, - credentials: n.credentials, - cache: n.cache, - redirect: n.redirect, - integrity: n.integrity, - keepalive: n.keepalive, - reloadNavigation: n.reloadNavigation, - historyNavigation: n.historyNavigation, - urlList: [...n.urlList] - }); - let S = Object.keys(t).length !== 0; - if (S && (n.mode === `navigate` && (n.mode = `same-origin`), n.reloadNavigation = !1, n.historyNavigation = !1, n.origin = `client`, n.referrer = `client`, n.referrerPolicy = ``, n.url = n.urlList[n.urlList.length - 1], n.urlList = [n.url]), t.referrer !== void 0) { - let e = t.referrer; - if (e === ``) n.referrer = `no-referrer`; - else { - let t; - try { - t = new URL(e, a); - } catch (t) { - throw TypeError(`Referrer "${e}" is not a valid URL.`, { cause: t }); - } - t.protocol === `about:` && t.hostname === `client` || h && !_(t, v.settingsObject.baseUrl) ? n.referrer = `client` : n.referrer = t; - } - } - t.referrerPolicy !== void 0 && (n.referrerPolicy = t.referrerPolicy); - let C; - if (C = t.mode === void 0 ? i : t.mode, C === `navigate`) throw A.errors.exception({ - header: `Request constructor`, - message: `invalid request mode navigate.` - }); - if (C != null && (n.mode = C), t.credentials !== void 0 && (n.credentials = t.credentials), t.cache !== void 0 && (n.cache = t.cache), n.cache === `only-if-cached` && n.mode !== `same-origin`) throw TypeError(`'only-if-cached' can be set only with 'same-origin' mode`); - if (t.redirect !== void 0 && (n.redirect = t.redirect), t.integrity != null && (n.integrity = String(t.integrity)), t.keepalive !== void 0 && (n.keepalive = !!t.keepalive), t.method !== void 0) { - let e = t.method, r = k[e]; - if (r !== void 0) n.method = r; - else { - if (!g(e)) throw TypeError(`'${e}' is not a valid HTTP method.`); - let t = e.toUpperCase(); - if (y.has(t)) throw TypeError(`'${e}' HTTP method is unsupported.`); - e = O[t] ?? e, n.method = e; - } - !re && n.method === `patch` && (process.emitWarning("Using `patch` is highly likely to result in a `405 Method Not Allowed`. `PATCH` is much more likely to succeed.", { code: `UNDICI-FETCH-patch` }), re = !0); - } - t.signal !== void 0 && (d = t.signal), this.#r = n; - let w = new AbortController(); - if (this.#e = w.signal, d != null) if (d.aborted) w.abort(d.reason); - else { - this[ee] = w; - let e = ne(new WeakRef(w)); - R && P(d) === I && F(1500, d), m.addAbortListener(d, e), L.register(w, { - signal: d, - abort: e - }, e); - } - if (this.#n = new s(M), f(this.#n, n.headersList), u(this.#n, `request`), C === `no-cors`) { - if (!b.has(n.method)) throw TypeError(`'${n.method} is unsupported in no-cors mode.`); - u(this.#n, `request-no-cors`); - } - if (S) { - let e = p(this.#n), n = t.headers === void 0 ? new l(e) : t.headers; - if (e.clear(), n instanceof l) { - for (let { name: t, value: r } of n.rawValues()) e.append(t, r, !1); - e.cookies = n.cookies; - } else c(this.#n, n); - } - let T = A.is.Request(e) ? e.#r.body : null; - if ((t.body != null || T != null) && (n.method === `GET` || n.method === `HEAD`)) throw TypeError(`Request with GET/HEAD method cannot have body.`); - let E = null; - if (t.body != null) { - let [e, i] = r(t.body, n.keepalive); - E = e, i && !p(this.#n).contains(`content-type`, !0) && this.#n.append(`content-type`, i, !0); - } - let D = E ?? T; - if (D != null && D.source == null) { - if (E != null && t.duplex == null) throw TypeError(`RequestInit: duplex option is required when sending a body.`); - if (n.mode !== `same-origin` && n.mode !== `cors`) throw TypeError(`If request is made from ReadableStream, mode should be "same-origin" or "cors"`); - n.useCORSPreflightFlag = !0; - } - let j = D; - if (E == null && T != null) { - if (o(e.#r)) throw TypeError(`Cannot construct a Request with a Request object that has already been used.`); - let t = new TransformStream(); - T.stream.pipeThrough(t), j = { - source: T.source, - length: T.length, - stream: t.readable - }; - } - this.#r.body = j; - } - get method() { - return A.brandCheck(this, e), this.#r.method; - } - get url() { - return A.brandCheck(this, e), j(this.#r.url); - } - get headers() { - return A.brandCheck(this, e), this.#n; - } - get destination() { - return A.brandCheck(this, e), this.#r.destination; - } - get referrer() { - return A.brandCheck(this, e), this.#r.referrer === `no-referrer` ? `` : this.#r.referrer === `client` ? `about:client` : this.#r.referrer.toString(); - } - get referrerPolicy() { - return A.brandCheck(this, e), this.#r.referrerPolicy; - } - get mode() { - return A.brandCheck(this, e), this.#r.mode; - } - get credentials() { - return A.brandCheck(this, e), this.#r.credentials; - } - get cache() { - return A.brandCheck(this, e), this.#r.cache; - } - get redirect() { - return A.brandCheck(this, e), this.#r.redirect; - } - get integrity() { - return A.brandCheck(this, e), this.#r.integrity; - } - get keepalive() { - return A.brandCheck(this, e), this.#r.keepalive; - } - get isReloadNavigation() { - return A.brandCheck(this, e), this.#r.reloadNavigation; - } - get isHistoryNavigation() { - return A.brandCheck(this, e), this.#r.historyNavigation; - } - get signal() { - return A.brandCheck(this, e), this.#e; - } - get body() { - return A.brandCheck(this, e), this.#r.body ? this.#r.body.stream : null; - } - get bodyUsed() { - return A.brandCheck(this, e), !!this.#r.body && m.isDisturbed(this.#r.body.stream); - } - get duplex() { - return A.brandCheck(this, e), `half`; - } - clone() { - if (A.brandCheck(this, e), o(this.#r)) throw TypeError(`unusable`); - let t = ue(this.#r), n = new AbortController(); - if (this.signal.aborted) n.abort(this.signal.reason); - else { - let e = te.get(this.signal); - e === void 0 && (e = /* @__PURE__ */ new Set(), te.set(this.signal, e)); - let t = new WeakRef(n); - e.add(t), m.addAbortListener(n.signal, ne(t)); - } - return de(t, this.#t, n.signal, d(this.#n)); - } - [h.inspect.custom](e, t) { - t.depth === null && (t.depth = 2), t.colors ??= !0; - let n = { - method: this.method, - url: this.url, - headers: this.headers, - destination: this.destination, - referrer: this.referrer, - referrerPolicy: this.referrerPolicy, - mode: this.mode, - credentials: this.credentials, - cache: this.cache, - redirect: this.redirect, - integrity: this.integrity, - keepalive: this.keepalive, - isReloadNavigation: this.isReloadNavigation, - isHistoryNavigation: this.isHistoryNavigation, - signal: this.signal - }; - return `Request ${h.formatWithOptions(t, n)}`; - } - static setRequestSignal(e, t) { - return e.#e = t, e; - } - static getRequestDispatcher(e) { - return e.#t; - } - static setRequestDispatcher(e, t) { - e.#t = t; - } - static setRequestHeaders(e, t) { - e.#n = t; - } - static getRequestState(e) { - return e.#r; - } - static setRequestState(e, t) { - e.#r = t; - } - }; - let { setRequestSignal: ie, getRequestDispatcher: ae, setRequestDispatcher: oe, setRequestHeaders: se, getRequestState: ce, setRequestState: le } = z; - Reflect.deleteProperty(z, `setRequestSignal`), Reflect.deleteProperty(z, `getRequestDispatcher`), Reflect.deleteProperty(z, `setRequestDispatcher`), Reflect.deleteProperty(z, `setRequestHeaders`), Reflect.deleteProperty(z, `getRequestState`), Reflect.deleteProperty(z, `setRequestState`), i(z, ce); - function B(e) { - return { - method: e.method ?? `GET`, - localURLsOnly: e.localURLsOnly ?? !1, - unsafeRequest: e.unsafeRequest ?? !1, - body: e.body ?? null, - client: e.client ?? null, - reservedClient: e.reservedClient ?? null, - replacesClientId: e.replacesClientId ?? ``, - window: e.window ?? `client`, - keepalive: e.keepalive ?? !1, - serviceWorkers: e.serviceWorkers ?? `all`, - initiator: e.initiator ?? ``, - destination: e.destination ?? ``, - priority: e.priority ?? null, - origin: e.origin ?? `client`, - policyContainer: e.policyContainer ?? `client`, - referrer: e.referrer ?? `client`, - referrerPolicy: e.referrerPolicy ?? ``, - mode: e.mode ?? `no-cors`, - useCORSPreflightFlag: e.useCORSPreflightFlag ?? !1, - credentials: e.credentials ?? `same-origin`, - useCredentials: e.useCredentials ?? !1, - cache: e.cache ?? `default`, - redirect: e.redirect ?? `follow`, - integrity: e.integrity ?? ``, - cryptoGraphicsNonceMetadata: e.cryptoGraphicsNonceMetadata ?? ``, - parserMetadata: e.parserMetadata ?? ``, - reloadNavigation: e.reloadNavigation ?? !1, - historyNavigation: e.historyNavigation ?? !1, - userActivation: e.userActivation ?? !1, - taintedOrigin: e.taintedOrigin ?? !1, - redirectCount: e.redirectCount ?? 0, - responseTainting: e.responseTainting ?? `basic`, - preventNoCacheCacheControlHeaderModification: e.preventNoCacheCacheControlHeaderModification ?? !1, - done: e.done ?? !1, - timingAllowFailed: e.timingAllowFailed ?? !1, - useURLCredentials: e.useURLCredentials ?? void 0, - traversableForUserPrompts: e.traversableForUserPrompts ?? `client`, - urlList: e.urlList, - url: e.urlList[0], - headersList: e.headersList ? new l(e.headersList) : new l() - }; - } - function ue(e) { - let t = B({ - ...e, - body: null - }); - return e.body != null && (t.body = a(e.body)), t; - } - function de(e, t, n, r) { - let i = new z(M); - le(i, e), oe(i, t), ie(i, n); - let a = new s(M); - return se(i, a), f(a, e.headersList), u(a, r), i; - } - Object.defineProperties(z.prototype, { - method: D, - url: D, - headers: D, - redirect: D, - clone: D, - signal: D, - duplex: D, - destination: D, - body: D, - bodyUsed: D, - isHistoryNavigation: D, - isReloadNavigation: D, - keepalive: D, - integrity: D, - cache: D, - credentials: D, - attribute: D, - referrerPolicy: D, - referrer: D, - mode: D, - [Symbol.toStringTag]: { - value: `Request`, - configurable: !0 - } - }), A.is.Request = A.util.MakeTypeAssertion(z), A.converters.RequestInfo = function(e) { - return typeof e == `string` ? A.converters.USVString(e) : A.is.Request(e) ? e : A.converters.USVString(e); - }, A.converters.RequestInit = A.dictionaryConverter([ - { - key: `method`, - converter: A.converters.ByteString - }, - { - key: `headers`, - converter: A.converters.HeadersInit - }, - { - key: `body`, - converter: A.nullableConverter(A.converters.BodyInit) - }, - { - key: `referrer`, - converter: A.converters.USVString - }, - { - key: `referrerPolicy`, - converter: A.converters.DOMString, - allowedValues: x - }, - { - key: `mode`, - converter: A.converters.DOMString, - allowedValues: C - }, - { - key: `credentials`, - converter: A.converters.DOMString, - allowedValues: w - }, - { - key: `cache`, - converter: A.converters.DOMString, - allowedValues: T - }, - { - key: `redirect`, - converter: A.converters.DOMString, - allowedValues: S - }, - { - key: `integrity`, - converter: A.converters.DOMString - }, - { - key: `keepalive`, - converter: A.converters.boolean - }, - { - key: `signal`, - converter: A.nullableConverter((e) => A.converters.AbortSignal(e, `RequestInit`, `signal`)) - }, - { - key: `window`, - converter: A.converters.any - }, - { - key: `duplex`, - converter: A.converters.DOMString, - allowedValues: E - }, - { - key: `dispatcher`, - converter: A.converters.any - }, - { - key: `priority`, - converter: A.converters.DOMString, - allowedValues: [ - `high`, - `low`, - `auto` - ], - defaultValue: () => `auto` - } - ]), n.exports = { - Request: z, - makeRequest: B, - fromInnerRequest: de, - cloneRequest: ue, - getRequestDispatcher: ae, - getRequestState: ce - }; -})); -var Wo$1 = c$12(((e, n) => { - let r = f$11(`node:assert`), { runtimeFeatures: i } = Ma$3(), a = /* @__PURE__ */ new Map([ - [`sha256`, 0], - [`sha384`, 1], - [`sha512`, 2] - ]), o; - if (i.has(`crypto`)) { - o = f$11(`node:crypto`); - let e = o.getHashes(); - e.length === 0 && a.clear(); - for (let t of a.keys()) e.includes(t) === !1 && a.delete(t); - } else a.clear(); - let s = Map.prototype.get.bind(a), c = Map.prototype.has.bind(a), l = i.has(`crypto`) === !1 || a.size === 0 ? () => !0 : (e, t) => { - let n = d(t); - if (n.length === 0) return !0; - let r = u(n); - for (let t of r) { - let n = t.alg, r = t.val; - if (p(f(n, e), r)) return !0; - } - return !1; - }; - function u(e) { - let t = [], n = null; - for (let i of e) { - if (r(c(i.alg), `Invalid SRI hash algorithm token`), t.length === 0) { - t.push(i), n = i; - continue; - } - let e = n.alg, a = s(e), o = i.alg, l = s(o); - l < a || (l > a ? (n = i, t[0] = i, t.length = 1) : t.push(i)); - } - return t; - } - function d(e) { - let t = []; - for (let n of e.split(` `)) { - let e = n.split(`?`, 1)[0], r = ``, i = [e.slice(0, 6), e.slice(7)], a = i[0]; - if (!c(a)) continue; - i[1] && (r = i[1]); - let o = { - alg: a, - val: r - }; - t.push(o); - } - return t; - } - let f = (e, t) => o.hash(e, t, `base64`); - function p(e, t) { - let n = e.length; - n !== 0 && e[n - 1] === `=` && --n, n !== 0 && e[n - 1] === `=` && --n; - let r = t.length; - if (r !== 0 && t[r - 1] === `=` && --r, r !== 0 && t[r - 1] === `=` && --r, n !== r) return !1; - for (let r = 0; r < n; ++r) if (!(e[r] === t[r] || e[r] === `+` && t[r] === `-` || e[r] === `/` && t[r] === `_`)) return !1; - return !0; - } - n.exports = { - applyAlgorithmToBytes: f, - bytesMatch: l, - caseSensitiveMatch: p, - isValidSRIHashAlgorithm: c, - getStrongestMetadata: u, - parseMetadata: d - }; -})); -var Go$1 = c$12(((e, n) => { - let { makeNetworkError: r, makeAppropriateNetworkError: i, filterResponse: a, makeResponse: o, fromInnerResponse: s, getResponseState: c } = Ho$1(), { HeadersList: l } = Vo$1(), { Request: u, cloneRequest: d, getRequestDispatcher: f, getRequestState: p } = Uo$1(), m = f$11(`node:zlib`), { makePolicyContainer: h, clonePolicyContainer: g, requestBadPort: _, TAOCheck: v, appendRequestOriginHeader: y, responseLocationURL: b, requestCurrentURL: x, setRequestReferrerPolicyOnRedirect: S, tryUpgradeRequestToAPotentiallyTrustworthyURL: C, createOpaqueTimingInfo: w, appendFetchMetadata: T, corsCheck: E, crossOriginResourcePolicyCheck: D, determineRequestsReferrer: O, coarsenedSharedCurrentTime: k, sameOrigin: A, isCancelled: j, isAborted: M, isErrorLike: N, fullyReadBody: P, readableStreamClose: F, urlIsLocal: I, urlIsHttpHttpsScheme: ee, urlHasHttpsScheme: L, clampAndCoarsenConnectionTimingInfo: te, simpleRangeHeaderValue: R, buildContentRange: ne, createInflate: re, extractMimeType: z, hasAuthenticationEntry: ie, includesCredentials: ae, isTraversableNavigable: oe } = Pa$3(), se = f$11(`node:assert`), { safelyExtractBody: ce, extractBody: le } = Ra$3(), { redirectStatusSet: B, nullBodyStatus: ue, safeMethodsSet: de, requestBodyHeader: fe, subresourceSet: V } = Da$3(), pe = f$11(`node:events`), { Readable: me, pipeline: he, finished: ge, isErrored: H, isReadable: _e } = f$11(`node:stream`), { addAbortListener: ve, bufferToLowerCasedHeaderName: ye } = q$6(), { dataURLProcessor: be, serializeAMimeType: xe, minimizeSupportedMimeType: Se } = ja$3(), { getGlobalDispatcher: Ce } = Co$1(), { webidl: we } = Na$3(), { STATUS_CODES: Te } = f$11(`node:http`), { bytesMatch: Ee } = Wo$1(), { createDeferredPromise: U } = La$3(), { isomorphicEncode: De } = Aa$3(), { runtimeFeatures: Oe } = Ma$3(), ke = Oe.has(`zstd`), Ae = [`GET`, `HEAD`], je = typeof __UNDICI_IS_NODE__ < `u` || typeof esbuildDetection < `u` ? `node` : `undici`, Me; - var Ne = class extends pe { - constructor(e) { - super(), this.dispatcher = e, this.connection = null, this.dump = !1, this.state = `ongoing`; - } - terminate(e) { - this.state === `ongoing` && (this.state = `terminated`, this.connection?.destroy(e), this.emit(`terminated`, e)); - } - abort(e) { - this.state === `ongoing` && (this.state = `aborted`, e ||= new DOMException(`The operation was aborted.`, `AbortError`), this.serializedAbortReason = e, this.connection?.destroy(e), this.emit(`terminated`, e)); - } - }; - function Pe(e) { - Ie(e, `fetch`); - } - function Fe(e, t = void 0) { - we.argumentLengthCheck(arguments, 1, `globalThis.fetch`); - let n = U(), r; - try { - r = new u(e, t); - } catch (e) { - return n.reject(e), n.promise; - } - let i = p(r); - if (r.signal.aborted) return Re(n, i, null, r.signal.reason, null), n.promise; - i.client.globalObject?.constructor?.name === `ServiceWorkerGlobalScope` && (i.serviceWorkers = `none`); - let a = null, o = !1, c = null; - return ve(r.signal, () => { - o = !0, se(c != null), c.abort(r.signal.reason); - let e = a?.deref(); - Re(n, i, e, r.signal.reason, c.controller); - }), c = ze({ - request: i, - processResponseEndOfBody: Pe, - processResponse: (e) => { - if (!o) { - if (e.aborted) { - Re(n, i, a, c.serializedAbortReason, c.controller); - return; - } - if (e.type === `error`) { - n.reject(TypeError(`fetch failed`, { cause: e.error })); - return; - } - a = new WeakRef(s(e, `immutable`)), n.resolve(a.deref()), n = null; - } - }, - dispatcher: f(r), - requestObject: r - }), n.promise; - } - function Ie(e, t = `other`) { - if (e.type === `error` && e.aborted || !e.urlList?.length) return; - let n = e.urlList[0], r = e.timingInfo, i = e.cacheState; - ee(n) && r !== null && (e.timingAllowPassed || (r = w({ startTime: r.startTime }), i = ``), r.endTime = k(), e.timingInfo = r, Le(r, n.href, t, globalThis, i, ``, e.status)); - } - let Le = performance.markResourceTiming; - function Re(e, t, n, r, i) { - if (e && e.reject(r), t.body?.stream != null && _e(t.body.stream) && t.body.stream.cancel(r).catch((e) => { - if (e.code !== `ERR_INVALID_STATE`) throw e; - }), n == null) return; - let a = c(n); - a.body?.stream != null && _e(a.body.stream) && i.error(r); - } - function ze({ request: e, processRequestBodyChunkLength: t, processRequestEndOfBody: n, processResponse: r, processResponseEndOfBody: i, processResponseConsumeBody: a, useParallelQueue: o = !1, dispatcher: s = Ce(), requestObject: c = null }) { - se(s); - let l = null, u = !1; - e.client != null && (l = e.client.globalObject, u = e.client.crossOriginIsolatedCapability); - let d = w({ startTime: k(u) }), f = { - controller: new Ne(s), - request: e, - timingInfo: d, - processRequestBodyChunkLength: t, - processRequestEndOfBody: n, - processResponse: r, - processResponseConsumeBody: a, - processResponseEndOfBody: i, - taskDestination: l, - crossOriginIsolatedCapability: u, - requestObject: c - }; - return se(!e.body || e.body.stream), e.window === `client` && (e.window = e.client?.globalObject?.constructor?.name === `Window` ? e.client : `no-window`), e.origin === `client` && (e.origin = e.client.origin), e.policyContainer === `client` && (e.client == null ? e.policyContainer = h() : e.policyContainer = g(e.client.policyContainer)), e.headersList.contains(`accept`, !0) || e.headersList.append(`accept`, `*/*`, !0), e.headersList.contains(`accept-language`, !0) || e.headersList.append(`accept-language`, `*`, !0), e.priority, V.has(e.destination), Be(f, !1), f.controller; - } - async function Be(e, t) { - try { - let n = e.request, i = null; - if (n.localURLsOnly && !I(x(n)) && (i = r(`local URLs only`)), C(n), _(n) === `blocked` && (i = r(`bad port`)), n.referrerPolicy === `` && (n.referrerPolicy = n.policyContainer.referrerPolicy), n.referrer !== `no-referrer` && (n.referrer = O(n)), i === null) { - let t = x(n); - A(t, n.url) && n.responseTainting === `basic` || t.protocol === `data:` || n.mode === `navigate` || n.mode === `websocket` ? (n.responseTainting = `basic`, i = await Ve(e)) : n.mode === `same-origin` ? i = r(`request mode cannot be "same-origin"`) : n.mode === `no-cors` ? n.redirect === `follow` ? (n.responseTainting = `opaque`, i = await Ve(e)) : i = r(`redirect mode cannot be "follow" for "no-cors" request`) : ee(x(n)) ? (n.responseTainting = `cors`, i = await We(e)) : i = r(`URL scheme must be a HTTP(S) scheme`); - } - if (t) return i; - i.status !== 0 && !i.internalResponse && (n.responseTainting, n.responseTainting === `basic` ? i = a(i, `basic`) : n.responseTainting === `cors` ? i = a(i, `cors`) : n.responseTainting === `opaque` ? i = a(i, `opaque`) : se(!1)); - let o = i.status === 0 ? i : i.internalResponse; - if (o.urlList.length === 0 && o.urlList.push(...n.urlList), n.timingAllowFailed || (i.timingAllowPassed = !0), i.type === `opaque` && o.status === 206 && o.rangeRequested && !n.headers.contains(`range`, !0) && (i = o = r()), i.status !== 0 && (n.method === `HEAD` || n.method === `CONNECT` || ue.includes(o.status)) && (o.body = null, e.controller.dump = !0), n.integrity) { - let t = (t) => Ue(e, r(t)); - if (n.responseTainting === `opaque` || i.body == null) { - t(i.error); - return; - } - P(i.body, (r) => { - if (!Ee(r, n.integrity)) { - t(`integrity mismatch`); - return; - } - i.body = ce(r)[0], Ue(e, i); - }, t); - } else Ue(e, i); - } catch (t) { - e.controller.terminate(t); - } - } - function Ve(e) { - if (j(e) && e.request.redirectCount === 0) return Promise.resolve(i(e)); - let { request: n } = e, { protocol: a } = x(n); - switch (a) { - case `about:`: return Promise.resolve(r(`about scheme is not supported`)); - case `blob:`: { - Me ||= f$11(`node:buffer`).resolveObjectURL; - let e = x(n); - if (e.search.length !== 0) return Promise.resolve(r(`NetworkError when attempting to fetch resource.`)); - let i = Me(e.toString()); - if (n.method !== `GET` || !we.is.Blob(i)) return Promise.resolve(r(`invalid method`)); - let a = o(), s = i.size, c = De(`${s}`), l = i.type; - if (n.headersList.contains(`range`, !0)) { - a.rangeRequested = !0; - let e = R(n.headersList.get(`range`, !0), !0); - if (e === `failure`) return Promise.resolve(r(`failed to fetch the data URL`)); - let { rangeStartValue: t, rangeEndValue: o } = e; - if (t === null) t = s - o, o = t + o - 1; - else { - if (t >= s) return Promise.resolve(r(`Range start is greater than the blob's size.`)); - (o === null || o >= s) && (o = s - 1); - } - let c = i.slice(t, o + 1, l); - a.body = le(c)[0]; - let u = De(`${c.size}`), d = ne(t, o, s); - a.status = 206, a.statusText = `Partial Content`, a.headersList.set(`content-length`, u, !0), a.headersList.set(`content-type`, l, !0), a.headersList.set(`content-range`, d, !0); - } else { - let e = le(i); - a.statusText = `OK`, a.body = e[0], a.headersList.set(`content-length`, c, !0), a.headersList.set(`content-type`, l, !0); - } - return Promise.resolve(a); - } - case `data:`: { - let e = be(x(n)); - if (e === `failure`) return Promise.resolve(r(`failed to fetch the data URL`)); - let t = xe(e.mimeType); - return Promise.resolve(o({ - statusText: `OK`, - headersList: [[`content-type`, { - name: `Content-Type`, - value: t - }]], - body: ce(e.body)[0] - })); - } - case `file:`: return Promise.resolve(r(`not implemented... yet...`)); - case `http:`: - case `https:`: return We(e).catch((e) => r(e)); - default: return Promise.resolve(r(`unknown scheme`)); - } - } - function He(e, t) { - e.request.done = !0, e.processResponseDone != null && queueMicrotask(() => e.processResponseDone(t)); - } - function Ue(e, t) { - let n = e.timingInfo, r = () => { - let r = Date.now(); - e.request.destination === `document` && (e.controller.fullTimingInfo = n), e.controller.reportTimingSteps = () => { - if (!ee(e.request.url)) return; - n.endTime = r; - let i = t.cacheState, a = t.bodyInfo; - t.timingAllowPassed || (n = w(n), i = ``); - let o = 0; - if (e.request.mode !== `navigate` || !t.hasCrossOriginRedirects) { - o = t.status; - let e = z(t.headersList); - e !== `failure` && (a.contentType = Se(e)); - } - e.request.initiatorType != null && Le(n, e.request.url.href, e.request.initiatorType, globalThis, i, a, o); - }; - let i = () => { - e.request.done = !0, e.processResponseEndOfBody != null && queueMicrotask(() => e.processResponseEndOfBody(t)), e.request.initiatorType != null && e.controller.reportTimingSteps(); - }; - queueMicrotask(() => i()); - }; - e.processResponse != null && queueMicrotask(() => { - e.processResponse(t), e.processResponse = null; - }); - let i = t.type === `error` ? t : t.internalResponse ?? t; - i.body == null ? r() : ge(i.body.stream, () => { - r(); - }); - } - async function We(e) { - let t = e.request, n = null, i = null, a = e.timingInfo; - if (t.serviceWorkers, n === null) { - if (t.redirect === `follow` && (t.serviceWorkers = `none`), i = n = await Ke(e), t.responseTainting === `cors` && E(t, n) === `failure`) return r(`cors failure`); - v(t, n) === `failure` && (t.timingAllowFailed = !0); - } - return (t.responseTainting === `opaque` || n.type === `opaque`) && D(t.origin, t.client, t.destination, i) === `blocked` ? r(`blocked`) : (B.has(i.status) && (t.redirect !== `manual` && e.controller.connection.destroy(void 0, !1), t.redirect === `error` ? n = r(`unexpected redirect`) : t.redirect === `manual` ? n = i : t.redirect === `follow` ? n = await Ge(e, n) : se(!1)), n.timingInfo = a, n); - } - function Ge(e, t) { - let n = e.request, i = t.internalResponse ? t.internalResponse : t, a; - try { - if (a = b(i, x(n).hash), a == null) return t; - } catch (e) { - return Promise.resolve(r(e)); - } - if (!ee(a)) return Promise.resolve(r(`URL scheme must be a HTTP(S) scheme`)); - if (n.redirectCount === 20) return Promise.resolve(r(`redirect count exceeded`)); - if (n.redirectCount += 1, n.mode === `cors` && (a.username || a.password) && !A(n, a)) return Promise.resolve(r(`cross origin not allowed for request mode "cors"`)); - if (n.responseTainting === `cors` && (a.username || a.password)) return Promise.resolve(r(`URL cannot contain credentials for request mode "cors"`)); - if (i.status !== 303 && n.body != null && n.body.source == null) return Promise.resolve(r()); - if ([301, 302].includes(i.status) && n.method === `POST` || i.status === 303 && !Ae.includes(n.method)) { - n.method = `GET`, n.body = null; - for (let e of fe) n.headersList.delete(e); - } - A(x(n), a) || (n.headersList.delete(`authorization`, !0), n.headersList.delete(`proxy-authorization`, !0), n.headersList.delete(`cookie`, !0), n.headersList.delete(`host`, !0)), n.body != null && (se(n.body.source != null), n.body = ce(n.body.source)[0]); - let o = e.timingInfo; - return o.redirectEndTime = o.postRedirectStartTime = k(e.crossOriginIsolatedCapability), o.redirectStartTime === 0 && (o.redirectStartTime = o.startTime), n.urlList.push(a), S(n, i), Be(e, !0); - } - async function Ke(e, t = !1, n = !1) { - let a = e.request, o = null, s = null, c = null; - a.window === `no-window` && a.redirect === `error` ? (o = e, s = a) : (s = d(a), o = { ...e }, o.request = s); - let l = a.credentials === `include` || a.credentials === `same-origin` && a.responseTainting === `basic`, u = s.body ? s.body.length : null, f = null; - if (s.body == null && [`POST`, `PUT`].includes(s.method) && (f = `0`), u != null && (f = De(`${u}`)), f != null && !s.headersList.contains(`content-length`, !0) && s.headersList.append(`content-length`, f, !0), u != null && s.keepalive, we.is.URL(s.referrer) && s.headersList.append(`referer`, De(s.referrer.href), !0), y(s), T(s), s.headersList.contains(`user-agent`, !0) || s.headersList.append(`user-agent`, je, !0), s.cache === "default" && (s.headersList.contains(`if-modified-since`, !0) || s.headersList.contains(`if-none-match`, !0) || s.headersList.contains(`if-unmodified-since`, !0) || s.headersList.contains(`if-match`, !0) || s.headersList.contains(`if-range`, !0)) && (s.cache = `no-store`), s.cache === `no-cache` && !s.preventNoCacheCacheControlHeaderModification && !s.headersList.contains(`cache-control`, !0) && s.headersList.append(`cache-control`, `max-age=0`, !0), (s.cache === `no-store` || s.cache === `reload`) && (s.headersList.contains(`pragma`, !0) || s.headersList.append(`pragma`, `no-cache`, !0), s.headersList.contains(`cache-control`, !0) || s.headersList.append(`cache-control`, `no-cache`, !0)), s.headersList.contains(`range`, !0) && s.headersList.append(`accept-encoding`, `identity`, !0), s.headersList.contains(`accept-encoding`, !0) || (L(x(s)) ? s.headersList.append(`accept-encoding`, `br, gzip, deflate`, !0) : s.headersList.append(`accept-encoding`, `gzip, deflate`, !0)), s.headersList.delete(`host`, !0), l && !s.headersList.contains(`authorization`, !0)) { - let e = null; - if (!(ie(s) && (s.useURLCredentials === void 0 || !ae(x(s)))) && ae(x(s)) && t) { - let { username: t, password: n } = x(s); - e = `Basic ${Buffer.from(`${t}:${n}`).toString(`base64`)}`; - } - e !== null && s.headersList.append(`Authorization`, e, !1); - } - if (s.cache = `no-store`, s.cache !== `no-store` && s.cache, c == null) { - if (s.cache === `only-if-cached`) return r(`only if cached`); - let e = await qe(o, l, n); - !de.has(s.method) && e.status >= 200 && e.status, c ??= e; - } - if (c.urlList = [...s.urlList], s.headersList.contains(`range`, !0) && (c.rangeRequested = !0), c.requestIncludesCredentials = l, c.status === 401 && s.responseTainting !== `cors` && l && (a.useURLCredentials !== void 0 || oe(a.traversableForUserPrompts))) { - if (a.body != null) { - if (a.body.source == null) return c; - a.body = ce(a.body.source)[0]; - } - if (a.useURLCredentials === void 0 || t) return j(e) ? i(e) : c; - e.controller.connection.destroy(), c = await Ke(e, !0); - } - if (c.status === 407) return a.window === `no-window` ? r() : j(e) ? i(e) : r(`proxy authentication required`); - if (c.status === 421 && !n && (a.body == null || a.body.source != null)) { - if (j(e)) return i(e); - e.controller.connection.destroy(), c = await Ke(e, t, !0); - } - return c; - } - async function qe(e, t = !1, n = !1) { - se(!e.controller.connection || e.controller.connection.destroyed), e.controller.connection = { - abort: null, - destroyed: !1, - destroy(e, t = !0) { - this.destroyed || (this.destroyed = !0, t && this.abort?.(e ?? new DOMException(`The operation was aborted.`, `AbortError`))); - } - }; - let a = e.request, s = null, c = e.timingInfo; - a.cache = `no-store`, a.mode; - let u = null; - if (a.body == null && e.processRequestEndOfBody) queueMicrotask(() => e.processRequestEndOfBody()); - else if (a.body != null) { - let t = async function* (t) { - j(e) || (yield t, e.processRequestBodyChunkLength?.(t.byteLength)); - }, n = () => { - j(e) || e.processRequestEndOfBody && e.processRequestEndOfBody(); - }, r = (t) => { - j(e) || (t.name === `AbortError` ? e.controller.abort() : e.controller.terminate(t)); - }; - u = (async function* () { - try { - for await (let e of a.body.stream) yield* t(e); - n(); - } catch (e) { - r(e); - } - })(); - } - try { - let { body: t, status: n, statusText: r, headersList: i, socket: a } = await p({ body: u }); - if (a) s = o({ - status: n, - statusText: r, - headersList: i, - socket: a - }); - else { - let a = t[Symbol.asyncIterator](); - e.controller.next = () => a.next(), s = o({ - status: n, - statusText: r, - headersList: i - }); - } - } catch (t) { - return t.name === `AbortError` ? (e.controller.connection.destroy(), i(e, t)) : r(t); - } - let d = new ReadableStream({ - start(t) { - e.controller.controller = t; - }, - pull: () => e.controller.resume(), - cancel: (t) => { - j(e) || e.controller.abort(t); - }, - type: `bytes` - }); - s.body = { - stream: d, - source: null, - length: null - }, e.controller.resume || e.controller.on(`terminated`, f), e.controller.resume = async () => { - for (;;) { - let t, n; - try { - let { done: n, value: r } = await e.controller.next(); - if (M(e)) break; - t = n ? void 0 : r; - } catch (r) { - e.controller.ended && !c.encodedBodySize ? t = void 0 : (t = r, n = !0); - } - if (t === void 0) { - F(e.controller.controller), He(e, s); - return; - } - if (c.decodedBodySize += t?.byteLength ?? 0, n) { - e.controller.terminate(t); - return; - } - let r = new Uint8Array(t); - if (r.byteLength && e.controller.controller.enqueue(r), H(d)) { - e.controller.terminate(); - return; - } - if (e.controller.controller.desiredSize <= 0) return; - } - }; - function f(t) { - M(e) ? (s.aborted = !0, _e(d) && e.controller.controller.error(e.controller.serializedAbortReason)) : _e(d) && e.controller.controller.error(TypeError(`terminated`, { cause: N(t) ? t : void 0 })), e.controller.connection.destroy(); - } - return s; - function p({ body: t }) { - let n = x(a), r = e.controller.dispatcher, i = n.pathname + n.search, o = n.search.length === 0 && n.href[n.href.length - n.hash.length - 1] === `?`; - return new Promise((s, u) => r.dispatch({ - path: o ? `${i}?` : i, - origin: n.origin, - method: a.method, - body: r.isMockActive ? a.body && (a.body.source || a.body.stream) : t, - headers: a.headersList.entries, - maxRedirections: 0, - upgrade: a.mode === `websocket` ? `websocket` : void 0 - }, { - body: null, - abort: null, - onConnect(t) { - let { connection: n } = e.controller; - c.finalConnectionTimingInfo = te(void 0, c.postRedirectStartTime, e.crossOriginIsolatedCapability), n.destroyed ? t(new DOMException(`The operation was aborted.`, `AbortError`)) : (e.controller.on(`terminated`, t), this.abort = n.abort = t), c.finalNetworkRequestStartTime = k(e.crossOriginIsolatedCapability); - }, - onResponseStarted() { - c.finalNetworkResponseStartTime = k(e.crossOriginIsolatedCapability); - }, - onHeaders(e, t, n, r) { - if (e < 200) return !1; - let i = new l(); - for (let e = 0; e < t.length; e += 2) { - let n = ye(t[e]), r = t[e + 1]; - if (Array.isArray(r) && !Buffer.isBuffer(t[e + 1])) for (let e of r) i.append(n, e.toString(`latin1`), !0); - else i.append(n, r.toString(`latin1`), !0); - } - let o = i.get(`location`, !0); - this.body = new me({ read: n }); - let c = o && a.redirect === `follow` && B.has(e), d = []; - if (a.method !== `HEAD` && a.method !== `CONNECT` && !ue.includes(e) && !c) { - let e = i.get(`content-encoding`, !0), t = e ? e.toLowerCase().split(`,`) : []; - if (t.length > 5) return u(Error(`too many content-encodings in response: ${t.length}, maximum allowed is 5`)), !0; - for (let e = t.length - 1; e >= 0; --e) { - let n = t[e].trim(); - if (n === `x-gzip` || n === `gzip`) d.push(m.createGunzip({ - flush: m.constants.Z_SYNC_FLUSH, - finishFlush: m.constants.Z_SYNC_FLUSH - })); - else if (n === `deflate`) d.push(re({ - flush: m.constants.Z_SYNC_FLUSH, - finishFlush: m.constants.Z_SYNC_FLUSH - })); - else if (n === `br`) d.push(m.createBrotliDecompress({ - flush: m.constants.BROTLI_OPERATION_FLUSH, - finishFlush: m.constants.BROTLI_OPERATION_FLUSH - })); - else if (n === `zstd` && ke) d.push(m.createZstdDecompress({ - flush: m.constants.ZSTD_e_continue, - finishFlush: m.constants.ZSTD_e_end - })); - else { - d.length = 0; - break; - } - } - } - let f = this.onError.bind(this); - return s({ - status: e, - statusText: r, - headersList: i, - body: d.length ? he(this.body, ...d, (e) => { - e && this.onError(e); - }).on(`error`, f) : this.body.on(`error`, f) - }), !0; - }, - onData(t) { - if (e.controller.dump) return; - let n = t; - return c.encodedBodySize += n.byteLength, this.body.push(n); - }, - onComplete() { - this.abort && e.controller.off(`terminated`, this.abort), e.controller.ended = !0, this.body.push(null); - }, - onError(t) { - this.abort && e.controller.off(`terminated`, this.abort), this.body?.destroy(t), e.controller.terminate(t), u(t); - }, - onRequestUpgrade(e, t, n, r) { - if (r.session != null && t !== 200 || r.session == null && t !== 101) return !1; - let i = new l(); - for (let [e, t] of Object.entries(n)) { - if (t == null) continue; - let n = e.toLowerCase(); - if (Array.isArray(t)) for (let e of t) i.append(n, String(e), !0); - else i.append(n, String(t), !0); - } - return s({ - status: t, - statusText: Te[t], - headersList: i, - socket: r - }), !0; - }, - onUpgrade(e, t, n) { - if (n.session != null && e !== 200 || n.session == null && e !== 101) return !1; - let r = new l(); - for (let e = 0; e < t.length; e += 2) { - let n = ye(t[e]), i = t[e + 1]; - if (Array.isArray(i) && !Buffer.isBuffer(t[e + 1])) for (let e of i) r.append(n, e.toString(`latin1`), !0); - else r.append(n, i.toString(`latin1`), !0); - } - return s({ - status: e, - statusText: Te[e], - headersList: r, - socket: n - }), !0; - } - })); - } - } - n.exports = { - fetch: Fe, - Fetch: Ne, - fetching: ze, - finalizeAndReportTiming: Ie - }; -})); -var Ko$1 = c$12(((e, n) => { - let r = f$11(`node:assert`), { URLSerializer: i } = ja$3(), { isValidHeaderName: a } = Pa$3(); - function o(e, t, n = !1) { - return i(e, n) === i(t, n); - } - function s(e) { - r(e !== null); - let t = []; - for (let n of e.split(`,`)) n = n.trim(), a(n) && t.push(n); - return t; - } - n.exports = { - urlEquals: o, - getFieldValues: s - }; -})); -var qo$1 = c$12(((e, n) => { - let r = f$11(`node:assert`), { kConstruct: i } = da$3(), { urlEquals: a, getFieldValues: o } = Ko$1(), { kEnumerableProperty: s, isDisturbed: c } = q$6(), { webidl: l } = Na$3(), { cloneResponse: u, fromInnerResponse: d, getResponseState: f } = Ho$1(), { Request: p, fromInnerRequest: m, getRequestState: h } = Uo$1(), { fetching: g } = Go$1(), { urlIsHttpHttpsScheme: _, readAllBytes: v } = Pa$3(), { createDeferredPromise: y } = La$3(); - var b = class e { - #e; - constructor() { - arguments[0] !== i && l.illegalConstructor(), l.util.markAsUncloneable(this), this.#e = arguments[1]; - } - async match(t, n = {}) { - l.brandCheck(this, e); - let r = `Cache.match`; - l.argumentLengthCheck(arguments, 1, r), t = l.converters.RequestInfo(t), n = l.converters.CacheQueryOptions(n, r, `options`); - let i = this.#i(t, n, 1); - if (i.length !== 0) return i[0]; - } - async matchAll(t = void 0, n = {}) { - return l.brandCheck(this, e), t !== void 0 && (t = l.converters.RequestInfo(t)), n = l.converters.CacheQueryOptions(n, `Cache.matchAll`, `options`), this.#i(t, n); - } - async add(t) { - l.brandCheck(this, e), l.argumentLengthCheck(arguments, 1, `Cache.add`), t = l.converters.RequestInfo(t); - let n = [t]; - return await this.addAll(n); - } - async addAll(t) { - l.brandCheck(this, e); - let n = `Cache.addAll`; - l.argumentLengthCheck(arguments, 1, n); - let r = [], i = []; - for (let e of t) { - if (e === void 0) throw l.errors.conversionFailed({ - prefix: n, - argument: `Argument 1`, - types: [`undefined is not allowed`] - }); - if (e = l.converters.RequestInfo(e), typeof e == `string`) continue; - let t = h(e); - if (!_(t.url) || t.method !== `GET`) throw l.errors.exception({ - header: n, - message: `Expected http/s scheme when method is not GET.` - }); - } - let a = []; - for (let e of t) { - let t = h(new p(e)); - if (!_(t.url)) throw l.errors.exception({ - header: n, - message: `Expected http/s scheme.` - }); - t.initiator = `fetch`, t.destination = `subresource`, i.push(t); - let s = y(); - a.push(g({ - request: t, - processResponse(e) { - if (e.type === `error` || e.status === 206 || e.status < 200 || e.status > 299) s.reject(l.errors.exception({ - header: `Cache.addAll`, - message: `Received an invalid status code or the request failed.` - })); - else if (e.headersList.contains(`vary`)) { - let t = o(e.headersList.get(`vary`)); - for (let e of t) if (e === `*`) { - s.reject(l.errors.exception({ - header: `Cache.addAll`, - message: `invalid vary field value` - })); - for (let e of a) e.abort(); - return; - } - } - }, - processResponseEndOfBody(e) { - if (e.aborted) { - s.reject(new DOMException(`aborted`, `AbortError`)); - return; - } - s.resolve(e); - } - })), r.push(s.promise); - } - let s = await Promise.all(r), c = [], u = 0; - for (let e of s) { - let t = { - type: `put`, - request: i[u], - response: e - }; - c.push(t), u++; - } - let d = y(), f = null; - try { - this.#t(c); - } catch (e) { - f = e; - } - return queueMicrotask(() => { - f === null ? d.resolve(void 0) : d.reject(f); - }), d.promise; - } - async put(t, n) { - l.brandCheck(this, e); - let r = `Cache.put`; - l.argumentLengthCheck(arguments, 2, r), t = l.converters.RequestInfo(t), n = l.converters.Response(n, r, `response`); - let i = null; - if (i = l.is.Request(t) ? h(t) : h(new p(t)), !_(i.url) || i.method !== `GET`) throw l.errors.exception({ - header: r, - message: `Expected an http/s scheme when method is not GET` - }); - let a = f(n); - if (a.status === 206) throw l.errors.exception({ - header: r, - message: `Got 206 status` - }); - if (a.headersList.contains(`vary`)) { - let e = o(a.headersList.get(`vary`)); - for (let t of e) if (t === `*`) throw l.errors.exception({ - header: r, - message: `Got * vary field value` - }); - } - if (a.body && (c(a.body.stream) || a.body.stream.locked)) throw l.errors.exception({ - header: r, - message: `Response body is locked or disturbed` - }); - let s = u(a), d = y(); - a.body == null ? d.resolve(void 0) : v(a.body.stream.getReader(), d.resolve, d.reject); - let m = [], g = { - type: `put`, - request: i, - response: s - }; - m.push(g); - let b = await d.promise; - s.body != null && (s.body.source = b); - let x = y(), S = null; - try { - this.#t(m); - } catch (e) { - S = e; - } - return queueMicrotask(() => { - S === null ? x.resolve() : x.reject(S); - }), x.promise; - } - async delete(t, n = {}) { - l.brandCheck(this, e); - let i = `Cache.delete`; - l.argumentLengthCheck(arguments, 1, i), t = l.converters.RequestInfo(t), n = l.converters.CacheQueryOptions(n, i, `options`); - let a = null; - if (l.is.Request(t)) { - if (a = h(t), a.method !== `GET` && !n.ignoreMethod) return !1; - } else r(typeof t == `string`), a = h(new p(t)); - let o = [], s = { - type: `delete`, - request: a, - options: n - }; - o.push(s); - let c = y(), u = null, d; - try { - d = this.#t(o); - } catch (e) { - u = e; - } - return queueMicrotask(() => { - u === null ? c.resolve(!!d?.length) : c.reject(u); - }), c.promise; - } - async keys(t = void 0, n = {}) { - l.brandCheck(this, e), t !== void 0 && (t = l.converters.RequestInfo(t)), n = l.converters.CacheQueryOptions(n, `Cache.keys`, `options`); - let r = null; - if (t !== void 0) if (l.is.Request(t)) { - if (r = h(t), r.method !== `GET` && !n.ignoreMethod) return []; - } else typeof t == `string` && (r = h(new p(t))); - let i = y(), a = []; - if (t === void 0) for (let e of this.#e) a.push(e[0]); - else { - let e = this.#n(r, n); - for (let t of e) a.push(t[0]); - } - return queueMicrotask(() => { - let e = []; - for (let t of a) { - let n = m(t, void 0, new AbortController().signal, `immutable`); - e.push(n); - } - i.resolve(Object.freeze(e)); - }), i.promise; - } - #t(e) { - let t = this.#e, n = [...t], i = [], a = []; - try { - for (let n of e) { - if (n.type !== `delete` && n.type !== `put`) throw l.errors.exception({ - header: `Cache.#batchCacheOperations`, - message: `operation type does not match "delete" or "put"` - }); - if (n.type === `delete` && n.response != null) throw l.errors.exception({ - header: `Cache.#batchCacheOperations`, - message: `delete operation should not have an associated response` - }); - if (this.#n(n.request, n.options, i).length) throw new DOMException(`???`, `InvalidStateError`); - let e; - if (n.type === `delete`) { - if (e = this.#n(n.request, n.options), e.length === 0) return []; - for (let n of e) { - let e = t.indexOf(n); - r(e !== -1), t.splice(e, 1); - } - } else if (n.type === `put`) { - if (n.response == null) throw l.errors.exception({ - header: `Cache.#batchCacheOperations`, - message: `put operation should have an associated response` - }); - let a = n.request; - if (!_(a.url)) throw l.errors.exception({ - header: `Cache.#batchCacheOperations`, - message: `expected http or https scheme` - }); - if (a.method !== `GET`) throw l.errors.exception({ - header: `Cache.#batchCacheOperations`, - message: `not get method` - }); - if (n.options != null) throw l.errors.exception({ - header: `Cache.#batchCacheOperations`, - message: `options must not be defined` - }); - e = this.#n(n.request); - for (let n of e) { - let e = t.indexOf(n); - r(e !== -1), t.splice(e, 1); - } - t.push([n.request, n.response]), i.push([n.request, n.response]); - } - a.push([n.request, n.response]); - } - return a; - } catch (e) { - throw this.#e.length = 0, this.#e = n, e; - } - } - #n(e, t, n) { - let r = [], i = n ?? this.#e; - for (let n of i) { - let [i, a] = n; - this.#r(e, i, a, t) && r.push(n); - } - return r; - } - #r(e, t, n = null, r) { - let i = new URL(e.url), s = new URL(t.url); - if (r?.ignoreSearch && (s.search = ``, i.search = ``), !a(i, s, !0)) return !1; - if (n == null || r?.ignoreVary || !n.headersList.contains(`vary`)) return !0; - let c = o(n.headersList.get(`vary`)); - for (let n of c) if (n === `*` || t.headersList.get(n) !== e.headersList.get(n)) return !1; - return !0; - } - #i(e, t, n = Infinity) { - let r = null; - if (e !== void 0) if (l.is.Request(e)) { - if (r = h(e), r.method !== `GET` && !t.ignoreMethod) return []; - } else typeof e == `string` && (r = h(new p(e))); - let i = []; - if (e === void 0) for (let e of this.#e) i.push(e[1]); - else { - let e = this.#n(r, t); - for (let t of e) i.push(t[1]); - } - let a = []; - for (let e of i) { - let t = d(u(e), `immutable`); - if (a.push(t), a.length >= n) break; - } - return Object.freeze(a); - } - }; - Object.defineProperties(b.prototype, { - [Symbol.toStringTag]: { - value: `Cache`, - configurable: !0 - }, - match: s, - matchAll: s, - add: s, - addAll: s, - put: s, - delete: s, - keys: s - }); - let x = [ - { - key: `ignoreSearch`, - converter: l.converters.boolean, - defaultValue: () => !1 - }, - { - key: `ignoreMethod`, - converter: l.converters.boolean, - defaultValue: () => !1 - }, - { - key: `ignoreVary`, - converter: l.converters.boolean, - defaultValue: () => !1 - } - ]; - l.converters.CacheQueryOptions = l.dictionaryConverter(x), l.converters.MultiCacheQueryOptions = l.dictionaryConverter([...x, { - key: `cacheName`, - converter: l.converters.DOMString - }]), l.converters.Response = l.interfaceConverter(l.is.Response, `Response`), l.converters[`sequence`] = l.sequenceConverter(l.converters.RequestInfo), n.exports = { Cache: b }; -})); -var Jo$1 = c$12(((e, t) => { - let { Cache: n } = qo$1(), { webidl: r } = Na$3(), { kEnumerableProperty: i } = q$6(), { kConstruct: a } = da$3(); - var o = class e { - #e = /* @__PURE__ */ new Map(); - constructor() { - arguments[0] !== a && r.illegalConstructor(), r.util.markAsUncloneable(this); - } - async match(t, i = {}) { - if (r.brandCheck(this, e), r.argumentLengthCheck(arguments, 1, `CacheStorage.match`), t = r.converters.RequestInfo(t), i = r.converters.MultiCacheQueryOptions(i), i.cacheName != null) { - if (this.#e.has(i.cacheName)) return await new n(a, this.#e.get(i.cacheName)).match(t, i); - } else for (let e of this.#e.values()) { - let r = await new n(a, e).match(t, i); - if (r !== void 0) return r; - } - } - async has(t) { - r.brandCheck(this, e); - let n = `CacheStorage.has`; - return r.argumentLengthCheck(arguments, 1, n), t = r.converters.DOMString(t, n, `cacheName`), this.#e.has(t); - } - async open(t) { - r.brandCheck(this, e); - let i = `CacheStorage.open`; - if (r.argumentLengthCheck(arguments, 1, i), t = r.converters.DOMString(t, i, `cacheName`), this.#e.has(t)) return new n(a, this.#e.get(t)); - let o = []; - return this.#e.set(t, o), new n(a, o); - } - async delete(t) { - r.brandCheck(this, e); - let n = `CacheStorage.delete`; - return r.argumentLengthCheck(arguments, 1, n), t = r.converters.DOMString(t, n, `cacheName`), this.#e.delete(t); - } - async keys() { - return r.brandCheck(this, e), [...this.#e.keys()]; - } - }; - Object.defineProperties(o.prototype, { - [Symbol.toStringTag]: { - value: `CacheStorage`, - configurable: !0 - }, - match: i, - has: i, - open: i, - delete: i, - keys: i - }), t.exports = { CacheStorage: o }; -})); -var Yo$1 = c$12(((e, t) => { - t.exports = { - maxAttributeValueSize: 1024, - maxNameValuePairSize: 4096 - }; -})); -var Xo$1 = c$12(((e, t) => { - function n(e) { - for (let t = 0; t < e.length; ++t) { - let n = e.charCodeAt(t); - if (n >= 0 && n <= 8 || n >= 10 && n <= 31 || n === 127) return !0; - } - return !1; - } - function r(e) { - for (let t = 0; t < e.length; ++t) { - let n = e.charCodeAt(t); - if (n < 33 || n > 126 || n === 34 || n === 40 || n === 41 || n === 60 || n === 62 || n === 64 || n === 44 || n === 59 || n === 58 || n === 92 || n === 47 || n === 91 || n === 93 || n === 63 || n === 61 || n === 123 || n === 125) throw Error(`Invalid cookie name`); - } - } - function i(e) { - let t = e.length, n = 0; - if (e[0] === `"`) { - if (t === 1 || e[t - 1] !== `"`) throw Error(`Invalid cookie value`); - --t, ++n; - } - for (; n < t;) { - let t = e.charCodeAt(n++); - if (t < 33 || t > 126 || t === 34 || t === 44 || t === 59 || t === 92) throw Error(`Invalid cookie value`); - } - } - function a(e) { - for (let t = 0; t < e.length; ++t) { - let n = e.charCodeAt(t); - if (n < 32 || n === 127 || n === 59) throw Error(`Invalid cookie path`); - } - } - function o(e) { - if (e.startsWith(`-`) || e.endsWith(`.`) || e.endsWith(`-`)) throw Error(`Invalid cookie domain`); - } - let s = [ - `Sun`, - `Mon`, - `Tue`, - `Wed`, - `Thu`, - `Fri`, - `Sat` - ], c = [ - `Jan`, - `Feb`, - `Mar`, - `Apr`, - `May`, - `Jun`, - `Jul`, - `Aug`, - `Sep`, - `Oct`, - `Nov`, - `Dec` - ], l = Array(61).fill(0).map((e, t) => t.toString().padStart(2, `0`)); - function u(e) { - return typeof e == `number` && (e = new Date(e)), `${s[e.getUTCDay()]}, ${l[e.getUTCDate()]} ${c[e.getUTCMonth()]} ${e.getUTCFullYear()} ${l[e.getUTCHours()]}:${l[e.getUTCMinutes()]}:${l[e.getUTCSeconds()]} GMT`; - } - function d(e) { - if (e < 0) throw Error(`Invalid cookie max-age`); - } - function f(e) { - if (e.name.length === 0) return null; - r(e.name), i(e.value); - let t = [`${e.name}=${e.value}`]; - e.name.startsWith(`__Secure-`) && (e.secure = !0), e.name.startsWith(`__Host-`) && (e.secure = !0, e.domain = null, e.path = `/`), e.secure && t.push(`Secure`), e.httpOnly && t.push(`HttpOnly`), typeof e.maxAge == `number` && (d(e.maxAge), t.push(`Max-Age=${e.maxAge}`)), e.domain && (o(e.domain), t.push(`Domain=${e.domain}`)), e.path && (a(e.path), t.push(`Path=${e.path}`)), e.expires && e.expires.toString() !== `Invalid Date` && t.push(`Expires=${u(e.expires)}`), e.sameSite && t.push(`SameSite=${e.sameSite}`); - for (let n of e.unparsed) { - if (!n.includes(`=`)) throw Error(`Invalid unparsed`); - let [e, ...r] = n.split(`=`); - t.push(`${e.trim()}=${r.join(`=`)}`); - } - return t.join(`; `); - } - t.exports = { - isCTLExcludingHtab: n, - validateCookieName: r, - validateCookiePath: a, - validateCookieValue: i, - toIMFDate: u, - stringify: f - }; -})); -var Zo$1 = c$12(((e, n) => { - let { collectASequenceOfCodePointsFast: r } = Aa$3(), { maxNameValuePairSize: i, maxAttributeValueSize: a } = Yo$1(), { isCTLExcludingHtab: o } = Xo$1(), s = f$11(`node:assert`); - function c(e) { - if (o(e)) return null; - let t = ``, n = ``, a = ``, s = ``; - if (e.includes(`;`)) { - let i = { position: 0 }; - t = r(`;`, e, i), n = e.slice(i.position); - } else t = e; - if (!t.includes(`=`)) s = t; - else { - let e = { position: 0 }; - a = r(`=`, t, e), s = t.slice(e.position + 1); - } - return a = a.trim(), s = s.trim(), a.length + s.length > i ? null : { - name: a, - value: s, - ...l(n) - }; - } - function l(e, t = {}) { - if (e.length === 0) return t; - s(e[0] === `;`), e = e.slice(1); - let n = ``; - e.includes(`;`) ? (n = r(`;`, e, { position: 0 }), e = e.slice(n.length)) : (n = e, e = ``); - let i = ``, o = ``; - if (n.includes(`=`)) { - let e = { position: 0 }; - i = r(`=`, n, e), o = n.slice(e.position + 1); - } else i = n; - if (i = i.trim(), o = o.trim(), o.length > a) return l(e, t); - let c = i.toLowerCase(); - if (c === `expires`) t.expires = new Date(o); - else if (c === `max-age`) { - let n = o.charCodeAt(0); - if ((n < 48 || n > 57) && o[0] !== `-` || !/^\d+$/.test(o)) return l(e, t); - t.maxAge = Number(o); - } else if (c === `domain`) { - let e = o; - e[0] === `.` && (e = e.slice(1)), e = e.toLowerCase(), t.domain = e; - } else if (c === `path`) { - let e = ``; - e = o.length === 0 || o[0] !== `/` ? `/` : o, t.path = e; - } else if (c === `secure`) t.secure = !0; - else if (c === `httponly`) t.httpOnly = !0; - else if (c === `samesite`) { - let e = o.toLowerCase(); - e === `none` ? t.sameSite = `None` : e === `strict` ? t.sameSite = `Strict` : e === `lax` && (t.sameSite = `Lax`); - } else t.unparsed ??= [], t.unparsed.push(`${i}=${o}`); - return l(e, t); - } - n.exports = { - parseSetCookie: c, - parseUnparsedAttributes: l - }; -})); -var Qo$1 = c$12(((e, t) => { - let { parseSetCookie: n } = Zo$1(), { stringify: r } = Xo$1(), { webidl: i } = Na$3(), { Headers: a } = Vo$1(), o = i.brandCheckMultiple([a, globalThis.Headers].filter(Boolean)); - function s(e) { - i.argumentLengthCheck(arguments, 1, `getCookies`), o(e); - let t = e.get(`cookie`), n = {}; - if (!t) return n; - for (let e of t.split(`;`)) { - let [t, ...r] = e.split(`=`); - n[t.trim()] = r.join(`=`); - } - return n; - } - function c(e, t, n) { - o(e); - let r = `deleteCookie`; - i.argumentLengthCheck(arguments, 2, r), t = i.converters.DOMString(t, r, `name`), n = i.converters.DeleteCookieAttributes(n), d(e, { - name: t, - value: ``, - expires: /* @__PURE__ */ new Date(0), - ...n - }); - } - function l(e) { - i.argumentLengthCheck(arguments, 1, `getSetCookies`), o(e); - let t = e.getSetCookie(); - return t ? t.map((e) => n(e)) : []; - } - function u(e) { - return e = i.converters.DOMString(e), n(e); - } - function d(e, t) { - i.argumentLengthCheck(arguments, 2, `setCookie`), o(e), t = i.converters.Cookie(t); - let n = r(t); - n && e.append(`set-cookie`, n, !0); - } - i.converters.DeleteCookieAttributes = i.dictionaryConverter([{ - converter: i.nullableConverter(i.converters.DOMString), - key: `path`, - defaultValue: () => null - }, { - converter: i.nullableConverter(i.converters.DOMString), - key: `domain`, - defaultValue: () => null - }]), i.converters.Cookie = i.dictionaryConverter([ - { - converter: i.converters.DOMString, - key: `name` - }, - { - converter: i.converters.DOMString, - key: `value` - }, - { - converter: i.nullableConverter((e) => typeof e == `number` ? i.converters[`unsigned long long`](e) : new Date(e)), - key: `expires`, - defaultValue: () => null - }, - { - converter: i.nullableConverter(i.converters[`long long`]), - key: `maxAge`, - defaultValue: () => null - }, - { - converter: i.nullableConverter(i.converters.DOMString), - key: `domain`, - defaultValue: () => null - }, - { - converter: i.nullableConverter(i.converters.DOMString), - key: `path`, - defaultValue: () => null - }, - { - converter: i.nullableConverter(i.converters.boolean), - key: `secure`, - defaultValue: () => null - }, - { - converter: i.nullableConverter(i.converters.boolean), - key: `httpOnly`, - defaultValue: () => null - }, - { - converter: i.converters.USVString, - key: `sameSite`, - allowedValues: [ - `Strict`, - `Lax`, - `None` - ] - }, - { - converter: i.sequenceConverter(i.converters.DOMString), - key: `unparsed`, - defaultValue: () => [] - } - ]), t.exports = { - getCookies: s, - deleteCookie: c, - getSetCookies: l, - setCookie: d, - parseCookie: u - }; -})); -var $o$1 = c$12(((e, t) => { - let { webidl: n } = Na$3(), { kEnumerableProperty: r } = q$6(), { kConstruct: i } = da$3(); - var a = class e extends Event { - #e; - constructor(e, t = {}) { - if (e === i) { - super(arguments[1], arguments[2]), n.util.markAsUncloneable(this); - return; - } - let r = `MessageEvent constructor`; - n.argumentLengthCheck(arguments, 1, r), e = n.converters.DOMString(e, r, `type`), t = n.converters.MessageEventInit(t, r, `eventInitDict`), super(e, t), this.#e = t, n.util.markAsUncloneable(this); - } - get data() { - return n.brandCheck(this, e), this.#e.data; - } - get origin() { - return n.brandCheck(this, e), this.#e.origin; - } - get lastEventId() { - return n.brandCheck(this, e), this.#e.lastEventId; - } - get source() { - return n.brandCheck(this, e), this.#e.source; - } - get ports() { - return n.brandCheck(this, e), Object.isFrozen(this.#e.ports) || Object.freeze(this.#e.ports), this.#e.ports; - } - initMessageEvent(t, r = !1, i = !1, a = null, o = ``, s = ``, c = null, l = []) { - return n.brandCheck(this, e), n.argumentLengthCheck(arguments, 1, `MessageEvent.initMessageEvent`), new e(t, { - bubbles: r, - cancelable: i, - data: a, - origin: o, - lastEventId: s, - source: c, - ports: l - }); - } - static createFastMessageEvent(t, n) { - let r = new e(i, t, n); - return r.#e = n, r.#e.data ??= null, r.#e.origin ??= ``, r.#e.lastEventId ??= ``, r.#e.source ??= null, r.#e.ports ??= [], r; - } - }; - let { createFastMessageEvent: o } = a; - delete a.createFastMessageEvent; - var s = class e extends Event { - #e; - constructor(e, t = {}) { - let r = `CloseEvent constructor`; - n.argumentLengthCheck(arguments, 1, r), e = n.converters.DOMString(e, r, `type`), t = n.converters.CloseEventInit(t), super(e, t), this.#e = t, n.util.markAsUncloneable(this); - } - get wasClean() { - return n.brandCheck(this, e), this.#e.wasClean; - } - get code() { - return n.brandCheck(this, e), this.#e.code; - } - get reason() { - return n.brandCheck(this, e), this.#e.reason; - } - }, c = class e extends Event { - #e; - constructor(e, t) { - let r = `ErrorEvent constructor`; - n.argumentLengthCheck(arguments, 1, r), super(e, t), n.util.markAsUncloneable(this), e = n.converters.DOMString(e, r, `type`), t = n.converters.ErrorEventInit(t ?? {}), this.#e = t; - } - get message() { - return n.brandCheck(this, e), this.#e.message; - } - get filename() { - return n.brandCheck(this, e), this.#e.filename; - } - get lineno() { - return n.brandCheck(this, e), this.#e.lineno; - } - get colno() { - return n.brandCheck(this, e), this.#e.colno; - } - get error() { - return n.brandCheck(this, e), this.#e.error; - } - }; - Object.defineProperties(a.prototype, { - [Symbol.toStringTag]: { - value: `MessageEvent`, - configurable: !0 - }, - data: r, - origin: r, - lastEventId: r, - source: r, - ports: r, - initMessageEvent: r - }), Object.defineProperties(s.prototype, { - [Symbol.toStringTag]: { - value: `CloseEvent`, - configurable: !0 - }, - reason: r, - code: r, - wasClean: r - }), Object.defineProperties(c.prototype, { - [Symbol.toStringTag]: { - value: `ErrorEvent`, - configurable: !0 - }, - message: r, - filename: r, - lineno: r, - colno: r, - error: r - }), n.converters.MessagePort = n.interfaceConverter(n.is.MessagePort, `MessagePort`), n.converters[`sequence`] = n.sequenceConverter(n.converters.MessagePort); - let l = [ - { - key: `bubbles`, - converter: n.converters.boolean, - defaultValue: () => !1 - }, - { - key: `cancelable`, - converter: n.converters.boolean, - defaultValue: () => !1 - }, - { - key: `composed`, - converter: n.converters.boolean, - defaultValue: () => !1 - } - ]; - n.converters.MessageEventInit = n.dictionaryConverter([ - ...l, - { - key: `data`, - converter: n.converters.any, - defaultValue: () => null - }, - { - key: `origin`, - converter: n.converters.USVString, - defaultValue: () => `` - }, - { - key: `lastEventId`, - converter: n.converters.DOMString, - defaultValue: () => `` - }, - { - key: `source`, - converter: n.nullableConverter(n.converters.MessagePort), - defaultValue: () => null - }, - { - key: `ports`, - converter: n.converters[`sequence`], - defaultValue: () => [] - } - ]), n.converters.CloseEventInit = n.dictionaryConverter([ - ...l, - { - key: `wasClean`, - converter: n.converters.boolean, - defaultValue: () => !1 - }, - { - key: `code`, - converter: n.converters[`unsigned short`], - defaultValue: () => 0 - }, - { - key: `reason`, - converter: n.converters.USVString, - defaultValue: () => `` - } - ]), n.converters.ErrorEventInit = n.dictionaryConverter([ - ...l, - { - key: `message`, - converter: n.converters.DOMString, - defaultValue: () => `` - }, - { - key: `filename`, - converter: n.converters.USVString, - defaultValue: () => `` - }, - { - key: `lineno`, - converter: n.converters[`unsigned long`], - defaultValue: () => 0 - }, - { - key: `colno`, - converter: n.converters[`unsigned long`], - defaultValue: () => 0 - }, - { - key: `error`, - converter: n.converters.any - } - ]), t.exports = { - MessageEvent: a, - CloseEvent: s, - ErrorEvent: c, - createFastMessageEvent: o - }; -})); -var es$1 = c$12(((e, t) => { - t.exports = { - uid: `258EAFA5-E914-47DA-95CA-C5AB0DC85B11`, - sentCloseFrameState: { - SENT: 1, - RECEIVED: 2 - }, - staticPropertyDescriptors: { - enumerable: !0, - writable: !1, - configurable: !1 - }, - states: { - CONNECTING: 0, - OPEN: 1, - CLOSING: 2, - CLOSED: 3 - }, - opcodes: { - CONTINUATION: 0, - TEXT: 1, - BINARY: 2, - CLOSE: 8, - PING: 9, - PONG: 10 - }, - maxUnsigned16Bit: 65535, - parserStates: { - INFO: 0, - PAYLOADLENGTH_16: 2, - PAYLOADLENGTH_64: 3, - READ_DATA: 4 - }, - emptyBuffer: Buffer.allocUnsafe(0), - sendHints: { - text: 1, - typedArray: 2, - arrayBuffer: 3, - blob: 4 - } - }; -})); -var ts$1 = c$12(((e, n) => { - let { states: r, opcodes: i } = es$1(), { isUtf8: a } = f$11(`node:buffer`), { removeHTTPWhitespace: o } = ja$3(), { collectASequenceOfCodePointsFast: s } = Aa$3(); - function c(e) { - return e === r.CONNECTING; - } - function l(e) { - return e === r.OPEN; - } - function u(e) { - return e === r.CLOSING; - } - function d(e) { - return e === r.CLOSED; - } - function f(e, t, n = (e, t) => new Event(e, t), r = {}) { - let i = n(e, r); - t.dispatchEvent(i); - } - function p(e, t, n) { - e.onMessage(t, n); - } - function m(e) { - return e.byteLength === e.buffer.byteLength ? e.buffer : new Uint8Array(e).buffer; - } - function h(e) { - if (e.length === 0) return !1; - for (let t = 0; t < e.length; ++t) { - let n = e.charCodeAt(t); - if (n < 33 || n > 126 || n === 34 || n === 40 || n === 41 || n === 44 || n === 47 || n === 58 || n === 59 || n === 60 || n === 61 || n === 62 || n === 63 || n === 64 || n === 91 || n === 92 || n === 93 || n === 123 || n === 125) return !1; - } - return !0; - } - function g(e) { - return e >= 1e3 && e < 1015 ? e !== 1004 && e !== 1005 && e !== 1006 : e >= 3e3 && e <= 4999; - } - function _(e) { - return e === i.CLOSE || e === i.PING || e === i.PONG; - } - function v(e) { - return e === i.CONTINUATION; - } - function y(e) { - return e === i.TEXT || e === i.BINARY; - } - function b(e) { - return y(e) || v(e) || _(e); - } - function x(e) { - let t = { position: 0 }, n = /* @__PURE__ */ new Map(); - for (; t.position < e.length;) { - let [r, i = ``] = s(`;`, e, t).split(`=`, 2); - n.set(o(r, !0, !1), o(i, !1, !0)), t.position++; - } - return n; - } - function S(e) { - if (e.length === 0) return !1; - for (let t = 0; t < e.length; t++) { - let n = e.charCodeAt(t); - if (n < 48 || n > 57) return !1; - } - let t = Number.parseInt(e, 10); - return t >= 8 && t <= 15; - } - function C(e, t) { - let n; - try { - n = new URL(e, t); - } catch (e) { - throw new DOMException(e, `SyntaxError`); - } - if (n.protocol === `http:` ? n.protocol = `ws:` : n.protocol === `https:` && (n.protocol = `wss:`), n.protocol !== `ws:` && n.protocol !== `wss:`) throw new DOMException(`expected a ws: or wss: url`, `SyntaxError`); - if (n.hash.length || n.href.endsWith(`#`)) throw new DOMException(`hash`, `SyntaxError`); - return n; - } - function w(e, t) { - if (e !== null && e !== 1e3 && (e < 3e3 || e > 4999)) throw new DOMException(`invalid code`, `InvalidAccessError`); - if (t !== null) { - let e = Buffer.byteLength(t); - if (e > 123) throw new DOMException(`Reason must be less than 123 bytes; received ${e}`, `SyntaxError`); - } - } - n.exports = { - isConnecting: c, - isEstablished: l, - isClosing: u, - isClosed: d, - fireEvent: f, - isValidSubprotocol: h, - isValidStatusCode: g, - websocketMessageReceived: p, - utf8Decode: (() => { - if (typeof process.versions.icu == `string`) { - let e = new TextDecoder(`utf-8`, { fatal: !0 }); - return e.decode.bind(e); - } - return function(e) { - if (a(e)) return e.toString(`utf-8`); - throw TypeError(`Invalid utf-8 received.`); - }; - })(), - isControlFrame: _, - isContinuationFrame: v, - isTextBinaryFrame: y, - isValidOpcode: b, - parseExtensions: x, - isValidClientWindowBits: S, - toArrayBuffer: m, - getURLRecord: C, - validateCloseCodeAndReason: w - }; -})); -var ns$1 = c$12(((e, n) => { - let { runtimeFeatures: r } = Ma$3(), { maxUnsigned16Bit: i, opcodes: a } = es$1(), o = 8 * 1024, s = null, c = o, l = r.has(`crypto`) ? f$11(`node:crypto`).randomFillSync : function(e, t, n) { - for (let t = 0; t < e.length; ++t) e[t] = Math.random() * 255 | 0; - return e; - }; - function u() { - return c === o && (c = 0, l(s ??= Buffer.allocUnsafeSlow(o), 0, o)), [ - s[c++], - s[c++], - s[c++], - s[c++] - ]; - } - n.exports = { - WebsocketFrameSend: class { - constructor(e) { - this.frameData = e; - } - createFrame(e) { - let t = this.frameData, n = u(), r = t?.byteLength ?? 0, a = r, o = 6; - r > i ? (o += 8, a = 127) : r > 125 && (o += 2, a = 126); - let s = Buffer.allocUnsafe(r + o); - s[0] = s[1] = 0, s[0] |= 128, s[0] = (s[0] & 240) + e, s[o - 4] = n[0], s[o - 3] = n[1], s[o - 2] = n[2], s[o - 1] = n[3], s[1] = a, a === 126 ? s.writeUInt16BE(r, 2) : a === 127 && (s[2] = s[3] = 0, s.writeUIntBE(r, 4, 6)), s[1] |= 128; - for (let e = 0; e < r; ++e) s[o + e] = t[e] ^ n[e & 3]; - return s; - } - static createFastTextFrame(e) { - let t = u(), n = e.length; - for (let r = 0; r < n; ++r) e[r] ^= t[r & 3]; - let r = n, o = 6; - n > i ? (o += 8, r = 127) : n > 125 && (o += 2, r = 126); - let s = Buffer.allocUnsafeSlow(o); - return s[0] = 128 | a.TEXT, s[1] = r | 128, s[o - 4] = t[0], s[o - 3] = t[1], s[o - 2] = t[2], s[o - 1] = t[3], r === 126 ? s.writeUInt16BE(n, 2) : r === 127 && (s[2] = s[3] = 0, s.writeUIntBE(n, 4, 6)), [s, e]; - } - }, - generateMask: u - }; -})); -var rs$1 = c$12(((e, n) => { - let { uid: r, states: i, sentCloseFrameState: a, emptyBuffer: o, opcodes: s } = es$1(), { parseExtensions: c, isClosed: l, isClosing: u, isEstablished: d, isConnecting: f, validateCloseCodeAndReason: p } = ts$1(), { makeRequest: m } = Uo$1(), { fetching: h } = Go$1(), { Headers: g, getHeadersList: _ } = Vo$1(), { getDecodeSplit: v } = Pa$3(), { WebsocketFrameSend: y } = ns$1(), b = f$11(`node:assert`), { runtimeFeatures: x } = Ma$3(), S = x.has(`crypto`) ? f$11(`node:crypto`) : null, C = !1; - function w(e, t, n, i, a) { - let o = e; - o.protocol = e.protocol === `ws:` ? `http:` : `https:`; - let s = m({ - urlList: [o], - client: n, - serviceWorkers: `none`, - referrer: `no-referrer`, - mode: `websocket`, - credentials: `include`, - cache: `no-store`, - redirect: `error`, - useURLCredentials: !0 - }); - a.headers && (s.headersList = _(new g(a.headers))); - let l = S.randomBytes(16).toString(`base64`); - s.headersList.append(`sec-websocket-key`, l, !0), s.headersList.append(`sec-websocket-version`, `13`, !0); - for (let e of t) s.headersList.append(`sec-websocket-protocol`, e, !0); - return s.headersList.append(`sec-websocket-extensions`, `permessage-deflate; client_max_window_bits`, !0), h({ - request: s, - useParallelQueue: !0, - dispatcher: a.dispatcher, - processResponse(e) { - if (e.type === `error` || e.status !== 101) { - if (e.socket?.session == null) { - E(i, 1002, `Received network error or non-101 status code.`, e.error); - return; - } - if (e.status !== 200) { - E(i, 1002, `Received network error or non-200 status code.`, e.error); - return; - } - } - if (C === !1 && e.socket?.session != null && (process.emitWarning(`WebSocket over HTTP2 is experimental, and subject to change.`, `ExperimentalWarning`), C = !0), t.length !== 0 && !e.headersList.get(`Sec-WebSocket-Protocol`)) { - E(i, 1002, `Server did not respond with sent protocols.`); - return; - } - if (e.socket.session == null && e.headersList.get(`Upgrade`)?.toLowerCase() !== `websocket`) { - E(i, 1002, `Server did not set Upgrade header to "websocket".`); - return; - } - if (e.socket.session == null && e.headersList.get(`Connection`)?.toLowerCase() !== `upgrade`) { - E(i, 1002, `Server did not set Connection header to "upgrade".`); - return; - } - if (e.headersList.get(`Sec-WebSocket-Accept`) !== S.hash(`sha1`, l + r, `base64`)) { - E(i, 1002, `Incorrect hash received in Sec-WebSocket-Accept header.`); - return; - } - let n = e.headersList.get(`Sec-WebSocket-Extensions`), a; - if (n !== null && (a = c(n), !a.has(`permessage-deflate`))) { - E(i, 1002, `Sec-WebSocket-Extensions header does not match.`); - return; - } - let o = e.headersList.get(`Sec-WebSocket-Protocol`); - if (o !== null && !v(`sec-websocket-protocol`, s.headersList).includes(o)) { - E(i, 1002, `Protocol was not set in the opening handshake.`); - return; - } - e.socket.on(`data`, i.onSocketData), e.socket.on(`close`, i.onSocketClose), e.socket.on(`error`, i.onSocketError), i.wasEverConnected = !0, i.onConnectionEstablished(e, a); - } - }); - } - function T(e, t, n, r = !1) { - if (t ??= null, n ??= ``, r && p(t, n), !(l(e.readyState) || u(e.readyState))) if (!d(e.readyState)) E(e), e.readyState = i.CLOSING; - else if (!e.closeState.has(a.SENT) && !e.closeState.has(a.RECEIVED)) { - let r = new y(); - n.length !== 0 && t === null && (t = 1e3), b(t === null || Number.isInteger(t)), t === null && n.length === 0 ? r.frameData = o : t !== null && n === null ? (r.frameData = Buffer.allocUnsafe(2), r.frameData.writeUInt16BE(t, 0)) : t !== null && n !== null ? (r.frameData = Buffer.allocUnsafe(2 + Buffer.byteLength(n)), r.frameData.writeUInt16BE(t, 0), r.frameData.write(n, 2, `utf-8`)) : r.frameData = o, e.socket.write(r.createFrame(s.CLOSE)), e.closeState.add(a.SENT), e.readyState = i.CLOSING; - } else e.readyState = i.CLOSING; - } - function E(e, t, n, r) { - d(e.readyState) && T(e, t, n, !1), e.controller.abort(), f(e.readyState) ? e.onSocketClose() : e.socket?.destroyed === !1 && e.socket.destroy(); - } - n.exports = { - establishWebSocketConnection: w, - failWebsocketConnection: E, - closeWebSocketConnection: T - }; -})); -var is$1 = c$12(((e, n) => { - let { createInflateRaw: r, Z_DEFAULT_WINDOWBITS: i } = f$11(`node:zlib`), { isValidClientWindowBits: a } = ts$1(), { MessageSizeExceededError: o } = K$6(), s = Buffer.from([ - 0, - 0, - 255, - 255 - ]), c = Symbol(`kBuffer`), l = Symbol(`kLength`); - n.exports = { PerMessageDeflate: class { - #e; - #t = {}; - #n = 0; - constructor(e, t) { - this.#t.serverNoContextTakeover = e.has(`server_no_context_takeover`), this.#t.serverMaxWindowBits = e.get(`server_max_window_bits`), this.#n = t.maxPayloadSize; - } - decompress(e, t, n) { - if (!this.#e) { - let e = i; - if (this.#t.serverMaxWindowBits) { - if (!a(this.#t.serverMaxWindowBits)) { - n(Error(`Invalid server_max_window_bits`)); - return; - } - e = Number.parseInt(this.#t.serverMaxWindowBits); - } - try { - this.#e = r({ windowBits: e }); - } catch (e) { - n(e); - return; - } - this.#e[c] = [], this.#e[l] = 0, this.#e.on(`data`, (e) => { - if (this.#e[l] += e.length, this.#n > 0 && this.#e[l] > this.#n) { - n(new o()), this.#e.removeAllListeners(), this.#e = null; - return; - } - this.#e[c].push(e); - }), this.#e.on(`error`, (e) => { - this.#e = null, n(e); - }); - } - this.#e.write(e), t && this.#e.write(s), this.#e.flush(() => { - if (!this.#e) return; - let e = Buffer.concat(this.#e[c], this.#e[l]); - this.#e[c].length = 0, this.#e[l] = 0, n(null, e); - }); - } - } }; -})); -var as$1 = c$12(((e, n) => { - let { Writable: r } = f$11(`node:stream`), i = f$11(`node:assert`), { parserStates: a, opcodes: o, states: s, emptyBuffer: c, sentCloseFrameState: l } = es$1(), { isValidStatusCode: u, isValidOpcode: d, websocketMessageReceived: f, utf8Decode: p, isControlFrame: m, isTextBinaryFrame: h, isContinuationFrame: g } = ts$1(), { failWebsocketConnection: _ } = rs$1(), { WebsocketFrameSend: v } = ns$1(), { PerMessageDeflate: y } = is$1(), { MessageSizeExceededError: b } = K$6(); - n.exports = { ByteParser: class extends r { - #e = []; - #t = 0; - #n = 0; - #r = !1; - #i = a.INFO; - #a = {}; - #o = []; - #s; - #c; - #l; - #u; - constructor(e, t, n = {}) { - super(), this.#c = e, this.#s = t ?? /* @__PURE__ */ new Map(), this.#l = n.maxFragments ?? 0, this.#u = n.maxPayloadSize ?? 0, this.#s.has(`permessage-deflate`) && this.#s.set(`permessage-deflate`, new y(t, n)); - } - _write(e, t, n) { - this.#e.push(e), this.#n += e.length, this.#r = !0, this.run(n); - } - #d() { - return this.#u > 0 && !m(this.#a.opcode) && this.#a.payloadLength + this.#t > this.#u ? (_(this.#c, 1009, `Payload size exceeds maximum allowed size`), !1) : !0; - } - run(e) { - for (; this.#r;) if (this.#i === a.INFO) { - if (this.#n < 2) return e(); - let t = this.consume(2), n = (t[0] & 128) != 0, r = t[0] & 15, i = (t[1] & 128) == 128, s = !n && r !== o.CONTINUATION, c = t[1] & 127, l = t[0] & 64, u = t[0] & 32, f = t[0] & 16; - if (!d(r)) return _(this.#c, 1002, `Invalid opcode received`), e(); - if (i) return _(this.#c, 1002, `Frame cannot be masked`), e(); - if (l !== 0 && !this.#s.has(`permessage-deflate`)) { - _(this.#c, 1002, `Expected RSV1 to be clear.`); - return; - } - if (u !== 0 || f !== 0) { - _(this.#c, 1002, `RSV1, RSV2, RSV3 must be clear`); - return; - } - if (s && !h(r)) { - _(this.#c, 1002, `Invalid frame type was fragmented.`); - return; - } - if (h(r) && this.#o.length > 0) { - _(this.#c, 1002, `Expected continuation frame`); - return; - } - if (this.#a.fragmented && s) { - _(this.#c, 1002, `Fragmented frame exceeded 125 bytes.`); - return; - } - if ((c > 125 || s) && m(r)) { - _(this.#c, 1002, `Control frame either too large or fragmented`); - return; - } - if (g(r) && this.#o.length === 0 && !this.#a.compressed) { - _(this.#c, 1002, `Unexpected continuation frame`); - return; - } - if (c <= 125) { - if (this.#a.payloadLength = c, this.#i = a.READ_DATA, !this.#d()) return; - } else c === 126 ? this.#i = a.PAYLOADLENGTH_16 : c === 127 && (this.#i = a.PAYLOADLENGTH_64); - h(r) && (this.#a.binaryType = r, this.#a.compressed = l !== 0), this.#a.opcode = r, this.#a.masked = i, this.#a.fin = n, this.#a.fragmented = s; - } else if (this.#i === a.PAYLOADLENGTH_16) { - if (this.#n < 2) return e(); - let t = this.consume(2); - if (this.#a.payloadLength = t.readUInt16BE(0), this.#i = a.READ_DATA, !this.#d()) return; - } else if (this.#i === a.PAYLOADLENGTH_64) { - if (this.#n < 8) return e(); - let t = this.consume(8), n = t.readUInt32BE(0), r = t.readUInt32BE(4); - if (n !== 0 || r > 2 ** 31 - 1) { - _(this.#c, 1009, `Received payload length > 2^31 bytes.`); - return; - } - if (this.#a.payloadLength = r, this.#i = a.READ_DATA, !this.#d()) return; - } else if (this.#i === a.READ_DATA) { - if (this.#n < this.#a.payloadLength) return e(); - let t = this.consume(this.#a.payloadLength); - if (m(this.#a.opcode)) this.#r = this.parseControlFrame(t), this.#i = a.INFO; - else if (this.#a.compressed) { - this.#s.get(`permessage-deflate`).decompress(t, this.#a.fin, (t, n) => { - if (t) { - let e = t instanceof b ? 1009 : 1007; - _(this.#c, e, t.message); - return; - } - if (this.writeFragments(n)) { - if (this.#u > 0 && this.#t > this.#u) { - _(this.#c, 1009, new b().message); - return; - } - if (!this.#a.fin) { - this.#i = a.INFO, this.#r = !0, this.run(e); - return; - } - f(this.#c, this.#a.binaryType, this.consumeFragments()), this.#r = !0, this.#i = a.INFO, this.run(e); - } - }, this.#t), this.#r = !1; - break; - } else { - if (!this.writeFragments(t)) return; - !this.#a.fragmented && this.#a.fin && f(this.#c, this.#a.binaryType, this.consumeFragments()), this.#i = a.INFO; - } - } - } - consume(e) { - if (e > this.#n) throw Error(`Called consume() before buffers satiated.`); - if (e === 0) return c; - this.#n -= e; - let t = this.#e[0]; - if (t.length > e) return this.#e[0] = t.subarray(e, t.length), t.subarray(0, e); - if (t.length === e) return this.#e.shift(); - { - let t = 0, n = Buffer.allocUnsafeSlow(e); - for (; t !== e;) { - let r = this.#e[0], i = r.length; - if (i + t === e) { - n.set(this.#e.shift(), t); - break; - } else if (i + t > e) { - n.set(r.subarray(0, e - t), t), this.#e[0] = r.subarray(e - t); - break; - } else n.set(this.#e.shift(), t), t += i; - } - return n; - } - } - writeFragments(e) { - return this.#l > 0 && this.#o.length === this.#l ? (_(this.#c, 1008, `Too many message fragments`), !1) : (this.#t += e.length, this.#o.push(e), !0); - } - consumeFragments() { - let e = this.#o; - if (e.length === 1) return this.#t = 0, e.shift(); - let t = 0, n = Buffer.allocUnsafeSlow(this.#t); - for (let r = 0; r < e.length; ++r) { - let i = e[r]; - n.set(i, t), t += i.length; - } - return this.#o = [], this.#t = 0, n; - } - parseCloseBody(e) { - i(e.length !== 1); - let t; - if (e.length >= 2 && (t = e.readUInt16BE(0)), t !== void 0 && !u(t)) return { - code: 1002, - reason: `Invalid status code`, - error: !0 - }; - let n = e.subarray(2); - n[0] === 239 && n[1] === 187 && n[2] === 191 && (n = n.subarray(3)); - try { - n = p(n); - } catch { - return { - code: 1007, - reason: `Invalid UTF-8`, - error: !0 - }; - } - return { - code: t, - reason: n, - error: !1 - }; - } - parseControlFrame(e) { - let { opcode: t, payloadLength: n } = this.#a; - if (t === o.CLOSE) { - if (n === 1) return _(this.#c, 1002, `Received close frame with a 1-byte body.`), !1; - if (this.#a.closeInfo = this.parseCloseBody(e), this.#a.closeInfo.error) { - let { code: e, reason: t } = this.#a.closeInfo; - return _(this.#c, e, t), !1; - } - if (!this.#c.closeState.has(l.SENT) && !this.#c.closeState.has(l.RECEIVED)) { - let e = c; - this.#a.closeInfo.code && (e = Buffer.allocUnsafe(2), e.writeUInt16BE(this.#a.closeInfo.code, 0)); - let t = new v(e); - this.#c.socket.write(t.createFrame(o.CLOSE)), this.#c.closeState.add(l.SENT); - } - return this.#c.readyState = s.CLOSING, this.#c.closeState.add(l.RECEIVED), !1; - } else if (t === o.PING) { - if (!this.#c.closeState.has(l.RECEIVED)) { - let t = new v(e); - this.#c.socket.write(t.createFrame(o.PONG)), this.#c.onPing(e); - } - } else t === o.PONG && this.#c.onPong(e); - return !0; - } - get closingInfo() { - return this.#a.closeInfo; - } - } }; -})); -var os$1 = c$12(((e, t) => { - let { WebsocketFrameSend: n } = ns$1(), { opcodes: r, sendHints: i } = es$1(), a = Ha$3(); - var o = class { - #e = new a(); - #t = !1; - #n; - constructor(e) { - this.#n = e; - } - add(e, t, r) { - if (r !== i.blob) { - if (this.#t) { - let n = { - promise: null, - callback: t, - frame: s(e, r) - }; - this.#e.push(n); - } else if (r === i.text) { - let { 0: r, 1: i } = n.createFastTextFrame(e); - this.#n.cork(), this.#n.write(r), this.#n.write(i, t), this.#n.uncork(); - } else this.#n.write(s(e, r), t); - return; - } - let a = { - promise: e.arrayBuffer().then((e) => { - a.promise = null, a.frame = s(e, r); - }), - callback: t, - frame: null - }; - this.#e.push(a), this.#t || this.#r(); - } - async #r() { - this.#t = !0; - let e = this.#e; - for (; !e.isEmpty();) { - let t = e.shift(); - t.promise !== null && await t.promise, this.#n.write(t.frame, t.callback), t.callback = t.frame = null; - } - this.#t = !1; - } - }; - function s(e, t) { - return new n(c(e, t)).createFrame(t === i.text ? r.TEXT : r.BINARY); - } - function c(e, t) { - switch (t) { - case i.text: - case i.typedArray: return new Uint8Array(e.buffer, e.byteOffset, e.byteLength); - case i.arrayBuffer: - case i.blob: return new Uint8Array(e); - } - } - t.exports = { SendQueue: o }; -})); -var ss$1 = c$12(((e, n) => { - let { isArrayBuffer: r } = f$11(`node:util/types`), { webidl: i } = Na$3(), { URLSerializer: a } = ja$3(), { environmentSettingsObject: o } = Pa$3(), { staticPropertyDescriptors: s, states: c, sentCloseFrameState: l, sendHints: u, opcodes: d } = es$1(), { isConnecting: f, isEstablished: p, isClosing: m, isClosed: h, isValidSubprotocol: g, fireEvent: _, utf8Decode: v, toArrayBuffer: y, getURLRecord: b } = ts$1(), { establishWebSocketConnection: x, closeWebSocketConnection: S, failWebsocketConnection: C } = rs$1(), { ByteParser: w } = as$1(), { kEnumerableProperty: T } = q$6(), { getGlobalDispatcher: E } = Co$1(), { ErrorEvent: D, CloseEvent: O, createFastMessageEvent: k } = $o$1(), { SendQueue: A } = os$1(), { WebsocketFrameSend: j } = ns$1(), { channels: M } = ga$3(); - function N(e) { - return typeof e?.address == `function` ? e.address() : typeof e?.session?.socket?.address == `function` ? e.session.socket.address() : null; - } - var P = class e extends EventTarget { - #e = { - open: null, - error: null, - close: null, - message: null - }; - #t = 0; - #n = ``; - #r = ``; - #i; - #a = { - onConnectionEstablished: (e, t) => this.#l(e, t), - onMessage: (e, t) => this.#u(e, t), - onParserError: (e) => C(this.#a, null, e.message), - onParserDrain: () => this.#d(), - onSocketData: (e) => { - this.#c.write(e) || this.#a.socket.pause(); - }, - onSocketError: (e) => { - this.#a.readyState = c.CLOSING, M.socketError.hasSubscribers && M.socketError.publish(e), this.#a.socket.destroy(); - }, - onSocketClose: () => this.#f(), - onPing: (e) => { - M.ping.hasSubscribers && M.ping.publish({ - payload: e, - websocket: this - }); - }, - onPong: (e) => { - M.pong.hasSubscribers && M.pong.publish({ - payload: e, - websocket: this - }); - }, - readyState: c.CONNECTING, - socket: null, - closeState: /* @__PURE__ */ new Set(), - controller: null, - wasEverConnected: !1 - }; - #o; - #s; - #c; - constructor(t, n = []) { - super(), i.util.markAsUncloneable(this); - let r = `WebSocket constructor`; - i.argumentLengthCheck(arguments, 1, r); - let a = i.converters[`DOMString or sequence or WebSocketInit`](n, r, `options`); - t = i.converters.USVString(t), n = a.protocols; - let s = o.settingsObject.baseUrl, c = b(t, s); - if (typeof n == `string` && (n = [n]), n.length !== new Set(n.map((e) => e.toLowerCase())).size || n.length > 0 && !n.every((e) => g(e))) throw new DOMException(`Invalid Sec-WebSocket-Protocol value`, `SyntaxError`); - this.#o = new URL(c.href); - let l = o.settingsObject; - this.#a.controller = x(c, n, l, this.#a, a), this.#a.readyState = e.CONNECTING, this.#s = `blob`; - } - close(t = void 0, n = void 0) { - i.brandCheck(this, e), t !== void 0 && (t = i.converters[`unsigned short`](t, `WebSocket.close`, `code`, i.attributes.Clamp)), n !== void 0 && (n = i.converters.USVString(n)), t ??= null, n ??= ``, S(this.#a, t, n, !0); - } - send(t) { - i.brandCheck(this, e); - let n = `WebSocket.send`; - if (i.argumentLengthCheck(arguments, 1, n), t = i.converters.WebSocketSendData(t, n, `data`), f(this.#a.readyState)) throw new DOMException(`Sent before connected.`, `InvalidStateError`); - if (!(!p(this.#a.readyState) || m(this.#a.readyState))) if (typeof t == `string`) { - let e = Buffer.from(t); - this.#t += e.byteLength, this.#i.add(e, () => { - this.#t -= e.byteLength; - }, u.text); - } else r(t) ? (this.#t += t.byteLength, this.#i.add(t, () => { - this.#t -= t.byteLength; - }, u.arrayBuffer)) : ArrayBuffer.isView(t) ? (this.#t += t.byteLength, this.#i.add(t, () => { - this.#t -= t.byteLength; - }, u.typedArray)) : i.is.Blob(t) && (this.#t += t.size, this.#i.add(t, () => { - this.#t -= t.size; - }, u.blob)); - } - get readyState() { - return i.brandCheck(this, e), this.#a.readyState; - } - get bufferedAmount() { - return i.brandCheck(this, e), this.#t; - } - get url() { - return i.brandCheck(this, e), a(this.#o); - } - get extensions() { - return i.brandCheck(this, e), this.#r; - } - get protocol() { - return i.brandCheck(this, e), this.#n; - } - get onopen() { - return i.brandCheck(this, e), this.#e.open; - } - set onopen(t) { - i.brandCheck(this, e), this.#e.open && this.removeEventListener(`open`, this.#e.open); - let n = i.converters.EventHandlerNonNull(t); - n === null ? this.#e.open = null : (this.addEventListener(`open`, n), this.#e.open = t); - } - get onerror() { - return i.brandCheck(this, e), this.#e.error; - } - set onerror(t) { - i.brandCheck(this, e), this.#e.error && this.removeEventListener(`error`, this.#e.error); - let n = i.converters.EventHandlerNonNull(t); - n === null ? this.#e.error = null : (this.addEventListener(`error`, n), this.#e.error = t); - } - get onclose() { - return i.brandCheck(this, e), this.#e.close; - } - set onclose(t) { - i.brandCheck(this, e), this.#e.close && this.removeEventListener(`close`, this.#e.close); - let n = i.converters.EventHandlerNonNull(t); - n === null ? this.#e.close = null : (this.addEventListener(`close`, n), this.#e.close = t); - } - get onmessage() { - return i.brandCheck(this, e), this.#e.message; - } - set onmessage(t) { - i.brandCheck(this, e), this.#e.message && this.removeEventListener(`message`, this.#e.message); - let n = i.converters.EventHandlerNonNull(t); - n === null ? this.#e.message = null : (this.addEventListener(`message`, n), this.#e.message = t); - } - get binaryType() { - return i.brandCheck(this, e), this.#s; - } - set binaryType(t) { - i.brandCheck(this, e), t !== `blob` && t !== `arraybuffer` ? this.#s = `blob` : this.#s = t; - } - #l(e, t) { - this.#a.socket = e.socket; - let n = this.#a.controller.dispatcher?.webSocketOptions, r = n?.maxFragments, i = n?.maxPayloadSize, a = new w(this.#a, t, { - maxFragments: r, - maxPayloadSize: i - }); - a.on(`drain`, () => this.#a.onParserDrain()), a.on(`error`, (e) => this.#a.onParserError(e)), this.#c = a, this.#i = new A(e.socket), this.#a.readyState = c.OPEN; - let o = e.headersList.get(`sec-websocket-extensions`); - o !== null && (this.#r = o); - let s = e.headersList.get(`sec-websocket-protocol`); - if (s !== null && (this.#n = s), _(`open`, this), M.open.hasSubscribers) { - let t = e.headersList.entries; - M.open.publish({ - address: N(e.socket), - protocol: this.#n, - extensions: this.#r, - websocket: this, - handshakeResponse: { - status: e.status, - statusText: e.statusText, - headers: t - } - }); - } - } - #u(e, t) { - if (this.#a.readyState !== c.OPEN) return; - let n; - if (e === d.TEXT) try { - n = v(t); - } catch { - C(this.#a, 1007, `Received invalid UTF-8 in text frame.`); - return; - } - else e === d.BINARY && (n = this.#s === `blob` ? new Blob([t]) : y(t)); - _(`message`, this, k, { - origin: this.#o.origin, - data: n - }); - } - #d() { - this.#a.socket.resume(); - } - #f() { - let e = this.#a.closeState.has(l.SENT) && this.#a.closeState.has(l.RECEIVED), t = 1005, n = ``, r = this.#c?.closingInfo; - r && !r.error && (t = r.code ?? 1005, n = r.reason), this.#a.readyState = c.CLOSED, this.#a.closeState.has(l.RECEIVED) || (t = 1006, _(`error`, this, (e, t) => new D(e, t), { error: TypeError(n) })), _(`close`, this, (e, t) => new O(e, t), { - wasClean: e, - code: t, - reason: n - }), M.close.hasSubscribers && M.close.publish({ - websocket: this, - code: t, - reason: n - }); - } - static ping(e, t) { - if (Buffer.isBuffer(t)) { - if (t.length > 125) throw TypeError(`A PING frame cannot have a body larger than 125 bytes.`); - } else if (t !== void 0) throw TypeError(`Expected buffer payload`); - let n = e.#a.readyState; - if (p(n) && !m(n) && !h(n)) { - let n = new j(t); - e.#a.socket.write(n.createFrame(d.PING)); - } - } - }; - let { ping: F } = P; - Reflect.deleteProperty(P, `ping`), P.CONNECTING = P.prototype.CONNECTING = c.CONNECTING, P.OPEN = P.prototype.OPEN = c.OPEN, P.CLOSING = P.prototype.CLOSING = c.CLOSING, P.CLOSED = P.prototype.CLOSED = c.CLOSED, Object.defineProperties(P.prototype, { - CONNECTING: s, - OPEN: s, - CLOSING: s, - CLOSED: s, - url: T, - readyState: T, - bufferedAmount: T, - onopen: T, - onerror: T, - onclose: T, - close: T, - onmessage: T, - binaryType: T, - send: T, - extensions: T, - protocol: T, - [Symbol.toStringTag]: { - value: `WebSocket`, - writable: !1, - enumerable: !1, - configurable: !0 - } - }), Object.defineProperties(P, { - CONNECTING: s, - OPEN: s, - CLOSING: s, - CLOSED: s - }), i.converters[`sequence`] = i.sequenceConverter(i.converters.DOMString), i.converters[`DOMString or sequence`] = function(e, t, n) { - return i.util.Type(e) === i.util.Types.OBJECT && Symbol.iterator in e ? i.converters[`sequence`](e) : i.converters.DOMString(e, t, n); - }, i.converters.WebSocketInit = i.dictionaryConverter([ - { - key: `protocols`, - converter: i.converters[`DOMString or sequence`], - defaultValue: () => [] - }, - { - key: `dispatcher`, - converter: i.converters.any, - defaultValue: () => E() - }, - { - key: `headers`, - converter: i.nullableConverter(i.converters.HeadersInit) - } - ]), i.converters[`DOMString or sequence or WebSocketInit`] = function(e) { - return i.util.Type(e) === i.util.Types.OBJECT && !(Symbol.iterator in e) ? i.converters.WebSocketInit(e) : { protocols: i.converters[`DOMString or sequence`](e) }; - }, i.converters.WebSocketSendData = function(e) { - return i.util.Type(e) === i.util.Types.OBJECT && (i.is.Blob(e) || i.is.BufferSource(e)) ? e : i.converters.USVString(e); - }, n.exports = { - WebSocket: P, - ping: F - }; -})); -var cs$1 = c$12(((e, t) => { - let { webidl: n } = Na$3(), { validateCloseCodeAndReason: r } = ts$1(), { kConstruct: i } = da$3(), { kEnumerableProperty: a } = q$6(); - function o() { - class e extends DOMException { - get reason() { - return ``; - } - } - return new e().reason === void 0 ? new Proxy(DOMException, { construct(e, t, n) { - let r = Reflect.construct(e, t, e); - return Object.setPrototypeOf(r, n.prototype), r; - } }) : DOMException; - } - var s = class e extends o() { - #e; - #t; - constructor(e = ``, t = void 0) { - if (e = n.converters.DOMString(e, `WebSocketError`, `message`), super(e, `WebSocketError`), t === i) return; - t !== null && (t = n.converters.WebSocketCloseInfo(t)); - let a = t.closeCode ?? null, o = t.reason ?? ``; - r(a, o), o.length !== 0 && a === null && (a = 1e3), this.#e = a, this.#t = o; - } - get closeCode() { - return this.#e; - } - get reason() { - return this.#t; - } - static createUnvalidatedWebSocketError(t, n, r) { - let a = new e(t, i); - return a.#e = n, a.#t = r, a; - } - }; - let { createUnvalidatedWebSocketError: c } = s; - delete s.createUnvalidatedWebSocketError, Object.defineProperties(s.prototype, { - closeCode: a, - reason: a, - [Symbol.toStringTag]: { - value: `WebSocketError`, - writable: !1, - enumerable: !1, - configurable: !0 - } - }), n.is.WebSocketError = n.util.MakeTypeAssertion(s), t.exports = { - WebSocketError: s, - createUnvalidatedWebSocketError: c - }; -})); -var ls$1 = c$12(((e, t) => { - let { createDeferredPromise: n } = La$3(), { environmentSettingsObject: r } = Pa$3(), { states: i, opcodes: a, sentCloseFrameState: o } = es$1(), { webidl: s } = Na$3(), { getURLRecord: c, isValidSubprotocol: l, isEstablished: u, utf8Decode: d } = ts$1(), { establishWebSocketConnection: f, failWebsocketConnection: p, closeWebSocketConnection: m } = rs$1(), { channels: h } = ga$3(), { WebsocketFrameSend: g } = ns$1(), { ByteParser: _ } = as$1(), { WebSocketError: v, createUnvalidatedWebSocketError: y } = cs$1(), { kEnumerableProperty: b } = q$6(), { utf8DecodeBytes: x } = ka$3(), S = !1; - var C = class { - #e; - #t; - #n; - #r; - #i; - #a; - #o = !1; - #s = { - onConnectionEstablished: (e, t) => this.#u(e, t), - onMessage: (e, t) => this.#d(e, t), - onParserError: (e) => p(this.#s, null, e.message), - onParserDrain: () => this.#s.socket.resume(), - onSocketData: (e) => { - this.#c.write(e) || this.#s.socket.pause(); - }, - onSocketError: (e) => { - this.#s.readyState = i.CLOSING, h.socketError.hasSubscribers && h.socketError.publish(e), this.#s.socket.destroy(); - }, - onSocketClose: () => this.#f(), - onPing: () => {}, - onPong: () => {}, - readyState: i.CONNECTING, - socket: null, - closeState: /* @__PURE__ */ new Set(), - controller: null, - wasEverConnected: !1 - }; - #c; - constructor(e, t = void 0) { - S ||= (process.emitWarning(`WebSocketStream is experimental! Expect it to change at any time.`, { code: `UNDICI-WSS` }), !0), s.argumentLengthCheck(arguments, 1, `WebSocket`), e = s.converters.USVString(e), t !== null && (t = s.converters.WebSocketStreamOptions(t)); - let a = r.settingsObject.baseUrl, o = c(e, a), d = t.protocols; - if (d.length !== new Set(d.map((e) => e.toLowerCase())).size || d.length > 0 && !d.every((e) => l(e))) throw new DOMException(`Invalid Sec-WebSocket-Protocol value`, `SyntaxError`); - if (this.#e = o.toString(), this.#t = n(), this.#n = n(), t.signal != null) { - let e = t.signal; - if (e.aborted) { - this.#t.reject(e.reason), this.#n.reject(e.reason); - return; - } - e.addEventListener(`abort`, () => { - u(this.#s.readyState) || (p(this.#s), this.#s.readyState = i.CLOSING, this.#t.reject(e.reason), this.#n.reject(e.reason), this.#o = !0); - }, { once: !0 }); - } - let m = r.settingsObject; - this.#s.controller = f(o, d, m, this.#s, t); - } - get url() { - return this.#e.toString(); - } - get opened() { - return this.#t.promise; - } - get closed() { - return this.#n.promise; - } - close(e = void 0) { - e !== null && (e = s.converters.WebSocketCloseInfo(e)); - let t = e.closeCode ?? null, n = e.reason; - m(this.#s, t, n, !0); - } - #l(e) { - e = s.converters.WebSocketStreamWrite(e); - let t = n(), r = null, i = null; - if (s.is.BufferSource(e)) r = new Uint8Array(ArrayBuffer.isView(e) ? new Uint8Array(e.buffer, e.byteOffset, e.byteLength) : e.slice()), i = a.BINARY; - else { - let n; - try { - n = s.converters.DOMString(e); - } catch (e) { - return t.reject(e), t.promise; - } - r = new TextEncoder().encode(n), i = a.TEXT; - } - if (!this.#s.closeState.has(o.SENT) && !this.#s.closeState.has(o.RECEIVED)) { - let e = new g(r); - this.#s.socket.write(e.createFrame(i), () => { - t.resolve(void 0); - }); - } - return t.promise; - } - #u(e, t) { - this.#s.socket = e.socket; - let n = this.#s.controller.dispatcher?.webSocketOptions?.maxFragments, r = this.#s.controller.dispatcher?.webSocketOptions?.maxPayloadSize, a = new _(this.#s, t, { - maxFragments: n, - maxPayloadSize: r - }); - a.on(`drain`, () => this.#s.onParserDrain()), a.on(`error`, (e) => this.#s.onParserError(e)), this.#c = a, this.#s.readyState = i.OPEN; - let o = t ?? ``, s = e.headersList.get(`sec-websocket-protocol`) ?? ``, c = new ReadableStream({ - start: (e) => { - this.#i = e; - }, - cancel: (e) => this.#m(e) - }), l = new WritableStream({ - write: (e) => this.#l(e), - close: () => m(this.#s, null, null), - abort: (e) => this.#p(e) - }); - this.#r = c, this.#a = l, this.#t.resolve({ - extensions: o, - protocol: s, - readable: c, - writable: l - }); - } - #d(e, t) { - if (this.#s.readyState !== i.OPEN) return; - let n; - if (e === a.TEXT) try { - n = d(t); - } catch { - p(this.#s, 1007, `Received invalid UTF-8 in text frame.`); - return; - } - else e === a.BINARY && (n = new Uint8Array(t.buffer, t.byteOffset, t.byteLength)); - this.#i.enqueue(n); - } - #f() { - let e = this.#s.closeState.has(o.SENT) && this.#s.closeState.has(o.RECEIVED); - if (this.#s.readyState = i.CLOSED, this.#o) return; - this.#s.wasEverConnected || this.#t.reject(new v(`Socket never opened`)); - let t = this.#c?.closingInfo, n = t?.code ?? 1005; - !this.#s.closeState.has(o.SENT) && !this.#s.closeState.has(o.RECEIVED) && (n = 1006); - let r = t?.reason == null ? `` : x(Buffer.from(t.reason)); - if (e) this.#i.close(), this.#a.locked || this.#a.abort(new DOMException(`A closed WebSocketStream cannot be written to`, `InvalidStateError`)), this.#n.resolve({ - closeCode: n, - reason: r - }); - else { - let e = y(`unclean close`, n, r); - this.#i?.error(e), this.#a?.abort(e), this.#n.reject(e); - } - } - #p(e) { - let t = null, n = ``; - s.is.WebSocketError(e) && (t = e.closeCode, n = e.reason), m(this.#s, t, n); - } - #m(e) { - this.#p(e); - } - }; - Object.defineProperties(C.prototype, { - url: b, - opened: b, - closed: b, - close: b, - [Symbol.toStringTag]: { - value: `WebSocketStream`, - writable: !1, - enumerable: !1, - configurable: !0 - } - }), s.converters.WebSocketStreamOptions = s.dictionaryConverter([{ - key: `protocols`, - converter: s.sequenceConverter(s.converters.USVString), - defaultValue: () => [] - }, { - key: `signal`, - converter: s.nullableConverter(s.converters.AbortSignal), - defaultValue: () => null - }]), s.converters.WebSocketCloseInfo = s.dictionaryConverter([{ - key: `closeCode`, - converter: (e) => s.converters[`unsigned short`](e, s.attributes.EnforceRange) - }, { - key: `reason`, - converter: s.converters.USVString, - defaultValue: () => `` - }]), s.converters.WebSocketStreamWrite = function(e) { - return typeof e == `string` ? s.converters.USVString(e) : s.converters.BufferSource(e); - }, t.exports = { WebSocketStream: C }; -})); -var us$1 = c$12(((e, t) => { - function n(e) { - return e.indexOf(`\0`) === -1; - } - function r(e) { - if (e.length === 0) return !1; - for (let t = 0; t < e.length; t++) if (e.charCodeAt(t) < 48 || e.charCodeAt(t) > 57) return !1; - return !0; - } - t.exports = { - isValidLastEventId: n, - isASCIINumber: r - }; -})); -var ds$1 = c$12(((e, n) => { - let { Transform: r } = f$11(`node:stream`), { isASCIINumber: i, isValidLastEventId: a } = us$1(), o = [ - 239, - 187, - 191 - ]; - n.exports = { EventSourceStream: class extends r { - state; - checkBOM = !0; - crlfCheck = !1; - eventEndCheck = !1; - buffer = null; - pos = 0; - event = { - data: void 0, - event: void 0, - id: void 0, - retry: void 0 - }; - constructor(e = {}) { - e.readableObjectMode = !0, super(e), this.state = e.eventSourceSettings || {}, e.push && (this.push = e.push); - } - _transform(e, t, n) { - if (e.length === 0) { - n(); - return; - } - if (this.buffer ? this.buffer = Buffer.concat([this.buffer, e]) : this.buffer = e, this.checkBOM) switch (this.buffer.length) { - case 1: - if (this.buffer[0] === o[0]) { - n(); - return; - } - this.checkBOM = !1, n(); - return; - case 2: - if (this.buffer[0] === o[0] && this.buffer[1] === o[1]) { - n(); - return; - } - this.checkBOM = !1; - break; - case 3: - if (this.buffer[0] === o[0] && this.buffer[1] === o[1] && this.buffer[2] === o[2]) { - this.buffer = Buffer.alloc(0), this.checkBOM = !1, n(); - return; - } - this.checkBOM = !1; - break; - default: - this.buffer[0] === o[0] && this.buffer[1] === o[1] && this.buffer[2] === o[2] && (this.buffer = this.buffer.subarray(3)), this.checkBOM = !1; - break; - } - for (; this.pos < this.buffer.length;) { - if (this.eventEndCheck) { - if (this.crlfCheck) { - if (this.buffer[this.pos] === 10) { - this.buffer = this.buffer.subarray(this.pos + 1), this.pos = 0, this.crlfCheck = !1; - continue; - } - this.crlfCheck = !1; - } - if (this.buffer[this.pos] === 10 || this.buffer[this.pos] === 13) { - this.buffer[this.pos] === 13 && (this.crlfCheck = !0), this.buffer = this.buffer.subarray(this.pos + 1), this.pos = 0, (this.event.data !== void 0 || this.event.event || this.event.id !== void 0 || this.event.retry) && this.processEvent(this.event), this.clearEvent(); - continue; - } - this.eventEndCheck = !1; - continue; - } - if (this.buffer[this.pos] === 10 || this.buffer[this.pos] === 13) { - this.buffer[this.pos] === 13 && (this.crlfCheck = !0), this.parseLine(this.buffer.subarray(0, this.pos), this.event), this.buffer = this.buffer.subarray(this.pos + 1), this.pos = 0, this.eventEndCheck = !0; - continue; - } - this.pos++; - } - n(); - } - parseLine(e, t) { - if (e.length === 0) return; - let n = e.indexOf(58); - if (n === 0) return; - let r = ``, o = ``; - if (n !== -1) { - r = e.subarray(0, n).toString(`utf8`); - let t = n + 1; - e[t] === 32 && ++t, o = e.subarray(t).toString(`utf8`); - } else r = e.toString(`utf8`), o = ``; - switch (r) { - case `data`: - t[r] === void 0 ? t[r] = o : t[r] += `\n${o}`; - break; - case `retry`: - i(o) && (t[r] = o); - break; - case `id`: - a(o) && (t[r] = o); - break; - case `event`: - o.length > 0 && (t[r] = o); - break; - } - } - processEvent(e) { - e.retry && i(e.retry) && (this.state.reconnectionTime = parseInt(e.retry, 10)), e.id !== void 0 && a(e.id) && (this.state.lastEventId = e.id), e.data !== void 0 && this.push({ - type: e.event || `message`, - options: { - data: e.data, - lastEventId: this.state.lastEventId, - origin: this.state.origin - } - }); - } - clearEvent() { - this.event = { - data: void 0, - event: void 0, - id: void 0, - retry: void 0 - }; - } - } }; -})); -var fs$1 = c$12(((e, n) => { - let { pipeline: r } = f$11(`node:stream`), { fetching: i } = Go$1(), { makeRequest: a } = Uo$1(), { webidl: o } = Na$3(), { EventSourceStream: s } = ds$1(), { parseMIMEType: c } = ja$3(), { createFastMessageEvent: l } = $o$1(), { isNetworkError: u } = Ho$1(), { kEnumerableProperty: d } = q$6(), { environmentSettingsObject: f } = Pa$3(), p = !1, m = 3e3; - var h = class e extends EventTarget { - #e = { - open: null, - error: null, - message: null - }; - #t; - #n = !1; - #r = 0; - #i = null; - #a = null; - #o; - #s; - constructor(e, t = {}) { - super(), o.util.markAsUncloneable(this); - let n = `EventSource constructor`; - o.argumentLengthCheck(arguments, 1, n), p || (p = !0, process.emitWarning(`EventSource is experimental, expect them to change at any time.`, { code: `UNDICI-ES` })), e = o.converters.USVString(e), t = o.converters.EventSourceInitDict(t, n, `eventSourceInitDict`), this.#o = t.node.dispatcher || t.dispatcher, this.#s = { - lastEventId: ``, - reconnectionTime: t.node.reconnectionTime - }; - let r = f, i; - try { - i = new URL(e, r.settingsObject.baseUrl), this.#s.origin = i.origin; - } catch (e) { - throw new DOMException(e, `SyntaxError`); - } - this.#t = i.href; - let s = `anonymous`; - t.withCredentials === !0 && (s = `use-credentials`, this.#n = !0); - let c = { - redirect: `follow`, - keepalive: !0, - mode: `cors`, - credentials: s === `anonymous` ? `same-origin` : `omit`, - referrer: `no-referrer` - }; - c.client = f.settingsObject, c.headersList = [[`accept`, { - name: `accept`, - value: `text/event-stream` - }]], c.cache = `no-store`, c.initiator = `other`, c.urlList = [new URL(this.#t)], this.#i = a(c), this.#c(); - } - get readyState() { - return this.#r; - } - get url() { - return this.#t; - } - get withCredentials() { - return this.#n; - } - #c() { - if (this.#r === 2) return; - this.#r = 0; - let e = { - request: this.#i, - dispatcher: this.#o - }; - e.processResponseEndOfBody = (e) => { - if (!u(e)) return this.#l(); - }, e.processResponse = (e) => { - if (u(e)) if (e.aborted) { - this.close(), this.dispatchEvent(new Event(`error`)); - return; - } else { - this.#l(); - return; - } - let t = e.headersList.get(`content-type`, !0), n = t === null ? `failure` : c(t), i = n !== `failure` && n.essence === `text/event-stream`; - if (e.status !== 200 || i === !1) { - this.close(), this.dispatchEvent(new Event(`error`)); - return; - } - this.#r = 1, this.dispatchEvent(new Event(`open`)), this.#s.origin = e.urlList[e.urlList.length - 1].origin; - let a = new s({ - eventSourceSettings: this.#s, - push: (e) => { - this.dispatchEvent(l(e.type, e.options)); - } - }); - r(e.body.stream, a, (e) => { - e?.aborted === !1 && (this.close(), this.dispatchEvent(new Event(`error`))); - }); - }, this.#a = i(e); - } - #l() { - this.#r !== 2 && (this.#r = 0, this.dispatchEvent(new Event(`error`)), setTimeout(() => { - this.#r === 0 && (this.#s.lastEventId.length && this.#i.headersList.set(`last-event-id`, this.#s.lastEventId, !0), this.#c()); - }, this.#s.reconnectionTime)?.unref()); - } - close() { - o.brandCheck(this, e), this.#r !== 2 && (this.#r = 2, this.#a.abort(), this.#i = null); - } - get onopen() { - return this.#e.open; - } - set onopen(e) { - this.#e.open && this.removeEventListener(`open`, this.#e.open); - let t = o.converters.EventHandlerNonNull(e); - t === null ? this.#e.open = null : (this.addEventListener(`open`, t), this.#e.open = e); - } - get onmessage() { - return this.#e.message; - } - set onmessage(e) { - this.#e.message && this.removeEventListener(`message`, this.#e.message); - let t = o.converters.EventHandlerNonNull(e); - t === null ? this.#e.message = null : (this.addEventListener(`message`, t), this.#e.message = e); - } - get onerror() { - return this.#e.error; - } - set onerror(e) { - this.#e.error && this.removeEventListener(`error`, this.#e.error); - let t = o.converters.EventHandlerNonNull(e); - t === null ? this.#e.error = null : (this.addEventListener(`error`, t), this.#e.error = e); - } - }; - let g = { - CONNECTING: { - __proto__: null, - configurable: !1, - enumerable: !0, - value: 0, - writable: !1 - }, - OPEN: { - __proto__: null, - configurable: !1, - enumerable: !0, - value: 1, - writable: !1 - }, - CLOSED: { - __proto__: null, - configurable: !1, - enumerable: !0, - value: 2, - writable: !1 - } - }; - Object.defineProperties(h, g), Object.defineProperties(h.prototype, g), Object.defineProperties(h.prototype, { - close: d, - onerror: d, - onmessage: d, - onopen: d, - readyState: d, - url: d, - withCredentials: d - }), o.converters.EventSourceInitDict = o.dictionaryConverter([ - { - key: `withCredentials`, - converter: o.converters.boolean, - defaultValue: () => !1 - }, - { - key: `dispatcher`, - converter: o.converters.any - }, - { - key: `node`, - converter: o.dictionaryConverter([{ - key: `reconnectionTime`, - converter: o.converters[`unsigned long`], - defaultValue: () => m - }, { - key: `dispatcher`, - converter: o.converters.any - }]), - defaultValue: () => ({}) - } - ]), n.exports = { - EventSource: h, - defaultReconnectionTime: m - }; -})); -var ps$1 = c$12(((e, t) => { - let n = Va$3(), r = ya$3(), i = Wa$3(), a = Ga$3(), o = Ka$3(), s = qa$3(), c = Za$2(), l = Xa$2(), u = Qa$2(), d = eo$2(), f = to$2(), p = K$6(), m = q$6(), { InvalidArgumentError: h } = p, g = lo$1(), _ = Sa$3(), v = ho$1(), { MockCallHistory: y, MockCallHistoryLog: b } = go$1(), x = yo$1(), S = _o$1(), C = So$1(), w = uo$1(), T = $a$2(), { getGlobalDispatcher: E, setGlobalDispatcher: D } = Co$1(), O = wo$1(), k = To$1(); - Object.assign(r.prototype, g), t.exports.Dispatcher = r, t.exports.Client = n, t.exports.Pool = i, t.exports.BalancedPool = a, t.exports.RoundRobinPool = o, t.exports.Agent = s, t.exports.ProxyAgent = c, t.exports.Socks5ProxyAgent = l, t.exports.EnvHttpProxyAgent = u, t.exports.RetryAgent = d, t.exports.H2CClient = f, t.exports.RetryHandler = T, t.exports.DecoratorHandler = O, t.exports.RedirectHandler = k, t.exports.interceptors = { - redirect: Eo$1(), - responseError: Do$1(), - retry: Oo$1(), - dump: ko$1(), - dns: Ao$1(), - cache: Io$1(), - decompress: Lo$1(), - deduplicate: zo$1() - }, t.exports.cacheStores = { MemoryCacheStore: Po$1() }; - let A = Bo$1(); - t.exports.cacheStores.SqliteCacheStore = A, t.exports.buildConnector = _, t.exports.errors = p, t.exports.util = { - parseHeaders: m.parseHeaders, - headerNameToString: m.headerNameToString - }; - function j(e) { - return (t, n, r) => { - if (typeof n == `function` && (r = n, n = null), !t || typeof t != `string` && typeof t != `object` && !(t instanceof URL)) throw new h(`invalid url`); - if (n != null && typeof n != `object`) throw new h(`invalid opts`); - if (n && n.path != null) { - if (typeof n.path != `string`) throw new h(`invalid opts.path`); - let e = n.path; - n.path.startsWith(`/`) || (e = `/${e}`), t = new URL(m.parseOrigin(t).origin + e); - } else n ||= typeof t == `object` ? t : {}, t = m.parseURL(t); - let { agent: i, dispatcher: a = E() } = n; - if (i) throw new h(`unsupported opts.agent. Did you mean opts.client?`); - return e.call(a, { - ...n, - origin: t.origin, - path: t.search ? `${t.pathname}${t.search}` : t.pathname, - method: n.method || (n.body ? `PUT` : `GET`) - }, r); - }; - } - t.exports.setGlobalDispatcher = D, t.exports.getGlobalDispatcher = E; - let M = Go$1().fetch, N = typeof __filename < `u` ? __filename : void 0; - function P(e, t) { - if (!e || typeof e != `object`) return; - let n = typeof e.stack == `string` ? e.stack : ``, r = t.replace(/\\/g, `/`); - if (n && (n.includes(t) || n.includes(r))) return; - let i = {}; - if (Error.captureStackTrace(i, P), !i.stack) return; - let a = i.stack.split(` -`).slice(1).join(` -`); - e.stack = n ? `${n}\n${a}` : i.stack; - } - t.exports.fetch = function(e, n = void 0) { - return M(e, n).catch((e) => { - throw N ? P(e, N) : e && typeof e == `object` && Error.captureStackTrace(e, t.exports.fetch), e; - }); - }, t.exports.Headers = Vo$1().Headers, t.exports.Response = Ho$1().Response, t.exports.Request = Uo$1().Request, t.exports.FormData = Fa$3().FormData; - let { setGlobalOrigin: F, getGlobalOrigin: I } = Oa$3(); - t.exports.setGlobalOrigin = F, t.exports.getGlobalOrigin = I; - let { CacheStorage: ee } = Jo$1(), { kConstruct: L } = da$3(); - t.exports.caches = new ee(L); - let { deleteCookie: te, getCookies: R, getSetCookies: ne, setCookie: re, parseCookie: z } = Qo$1(); - t.exports.deleteCookie = te, t.exports.getCookies = R, t.exports.getSetCookies = ne, t.exports.setCookie = re, t.exports.parseCookie = z; - let { parseMIMEType: ie, serializeAMimeType: ae } = ja$3(); - t.exports.parseMIMEType = ie, t.exports.serializeAMimeType = ae; - let { CloseEvent: oe, ErrorEvent: se, MessageEvent: ce } = $o$1(), { WebSocket: le, ping: B } = ss$1(); - t.exports.WebSocket = le, t.exports.CloseEvent = oe, t.exports.ErrorEvent = se, t.exports.MessageEvent = ce, t.exports.ping = B, t.exports.WebSocketStream = ls$1().WebSocketStream, t.exports.WebSocketError = cs$1().WebSocketError, t.exports.request = j(g.request), t.exports.stream = j(g.stream), t.exports.pipeline = j(g.pipeline), t.exports.connect = j(g.connect), t.exports.upgrade = j(g.upgrade), t.exports.MockClient = v, t.exports.MockCallHistory = y, t.exports.MockCallHistoryLog = b, t.exports.MockPool = S, t.exports.MockAgent = x, t.exports.SnapshotAgent = C, t.exports.mockErrors = w; - let { EventSource: ue } = fs$1(); - t.exports.EventSource = ue; - function de() { - globalThis.fetch = t.exports.fetch, globalThis.Headers = t.exports.Headers, globalThis.Response = t.exports.Response, globalThis.Request = t.exports.Request, globalThis.FormData = t.exports.FormData, globalThis.WebSocket = t.exports.WebSocket, globalThis.CloseEvent = t.exports.CloseEvent, globalThis.ErrorEvent = t.exports.ErrorEvent, globalThis.MessageEvent = t.exports.MessageEvent, globalThis.EventSource = t.exports.EventSource; - } - t.exports.install = de; -})); -var ms$1 = ua$3(); -var hs$1 = ps$1(); -var gs$1 = class { - contentType = `application/json`; - serialize(e) { - return Buffer.from(JSON.stringify(e, fi$3)); - } - async deserialize(e) { - let t = [], n = e.getReader(); - for (;;) { - let { done: e, value: r } = await n.read(); - if (e) break; - r && t.push(r); - } - let r = Buffer.concat(t).toString(); - return JSON.parse(r, pi$3); - } -}; -const _s$1 = parseInt(process.env.WORKFLOW_LOCAL_QUEUE_MAX_VISIBILITY ?? `0`, 10) || Infinity; -const vs$1 = 2147483647; -const ys$1 = parseInt(process.env.WORKFLOW_LOCAL_QUEUE_CONCURRENCY ?? `0`, 10) || 1e3; -const bs$1 = `Cannot perform ArrayBuffer.prototype.slice on a detached ArrayBuffer`; -function xs$1(e) { - let t = e, n = /* @__PURE__ */ new Set(); - for (; t && typeof t == `object` && !n.has(t);) { - if (n.add(t), `message` in t && typeof t.message == `string` && t.message.includes(bs$1)) return !0; - t = `cause` in t ? t.cause : void 0; - } - return !1; -} -function Ss$1(e) { - let { kind: t, prefix: n } = oh$1(e); - return { - pathname: t === `workflow` ? `flow` : `step`, - prefix: n - }; -} -function Cs$1(e) { - let t = new hs$1.Agent({ - headersTimeout: 0, - connections: 1e3, - keepAliveTimeout: 3e4 - }), n = new gs$1(), r = Ih$1(), i = new ms$1.Sema(ys$1), a = new AbortController(), o = a.signal, s = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), l = async (a, l, u) => { - let d = []; - if (u?.idempotencyKey) { - let e = s.get(u.idempotencyKey); - if (e) return { messageId: e }; - } - let f = n.serialize(l), { pathname: p, prefix: m } = Ss$1(a), h = sh$1.parse(`msg_${r()}`), g = l, _ = g.runId ?? g.workflowRunId ?? void 0, v = g.stepId ?? void 0; - if (u?.idempotencyKey) { - let e = u.idempotencyKey; - s.set(e, h), d.push(() => { - s.delete(e); - }); - } - return (async () => { - u?.delaySeconds && u.delaySeconds > 0 && await setTimeout$1(Math.min(u.delaySeconds * 1e3, vs$1), void 0, { signal: o }), i.tryAcquire() || (console.warn(`[world-local]: concurrency limit (${ys$1}) reached, waiting for queue to free up`), await i.acquire()); - try { - for (let n = 0; n < 256; n++) { - let r = { - ...u?.headers, - "content-type": `application/json`, - "x-vqs-queue-name": a, - "x-vqs-message-id": h, - "x-vqs-message-attempt": String(n + 1) - }, i = c.get(m), s; - if (i) s = await i(new Request(`http://localhost/.well-known/workflow/v1/${p}`, { - method: `POST`, - headers: r, - body: f - })); - else { - let n = await Jr$3(e); - s = await fetch(`${n}/.well-known/workflow/v1/${p}`, { - method: `POST`, - duplex: `half`, - dispatcher: t, - headers: r, - body: f - }); - } - let l = await s.text(); - if (s.ok) { - try { - let e = Number(JSON.parse(l).timeoutSeconds); - if (Number.isFinite(e) && e >= 0) { - e > 0 && await setTimeout$1(Math.min(e * 1e3, vs$1), void 0, { signal: o }); - continue; - } - } catch {} - return; - } - console.error(`[world-local] Queue message failed (attempt ${n + 1}, HTTP ${s.status})`, { - queueName: a, - messageId: h, - ..._ && { runId: _ }, - ...v && { stepId: v }, - handlerError: l - }), await setTimeout$1(5e3, void 0, { signal: o }); - } - console.error(`[world-local] Queue message exhausted safety limit (256 attempts)`, { - queueName: a, - messageId: h, - ..._ && { runId: _ }, - ...v && { stepId: v } - }); - } finally { - i.release(); - } - })().catch((e) => { - e?.name === `AbortError` || e?.name === `ResponseAborted` || (xs$1(e) ? console.error(`[local world] Queue operation failed: detected "${bs$1}". This usually means a Next.js proxy/middleware consumed Workflow's internal request before the executor could read it. Exclude \`/.well-known/workflow/*\` from your matcher. See https://workflow-sdk.dev/docs/getting-started/next#configure-proxy-handler`, { - queueName: a, - messageId: h, - ..._ && { runId: _ }, - ...v && { stepId: v }, - originalError: e - }) : console.error(`[local world] Queue operation failed:`, e)); - }).finally(() => { - for (let e of d) e(); - }), { messageId: h }; - }, u = V$8({ - "x-vqs-queue-name": nh$1, - "x-vqs-message-id": sh$1, - "x-vqs-message-attempt": bm$1() - }); - return { - queue: l, - createQueueHandler: (e, t) => async (n) => { - let r = u.safeParse(Object.fromEntries(n.headers)); - if (!r.success || !n.body) return Response.json({ error: n.body ? `Missing required headers` : `Missing request body` }, { status: 400 }); - let i = r.data[`x-vqs-queue-name`], a = r.data[`x-vqs-message-id`], o = r.data[`x-vqs-message-attempt`]; - if (!i.startsWith(e)) return Response.json({ error: `Unhandled queue` }, { status: 400 }); - let s = await new gs$1().deserialize(n.body); - try { - let e = await t(s, { - attempt: o, - queueName: i, - messageId: a - }), n = null; - return typeof e?.timeoutSeconds == `number` && (n = Math.min(e.timeoutSeconds, _s$1)), n == null ? Response.json({ ok: !0 }) : Response.json({ timeoutSeconds: n }); - } catch (e) { - return Response.json(String(e), { status: 500 }); - } - }, - getDeploymentId: async () => `dpl_local@${(await Oi$3()).version}`, - registerHandler(e, t) { - c.set(e, t); - }, - async close() { - o.aborted || (a.abort(), await t.close()); - } - }; -} -function ws$1(e) { - return createHash(`sha256`).update(e).digest(`hex`); -} -function Ts$1(e, t, n, r) { - let i = createHash(`sha256`).update(`${t}\x00${n}\x00${r}`).digest(`hex`); - return G.join(e, `hooks`, `tokens`, `${i}.recovery.json`); -} -const Es$1 = Ih$1(() => Math.random()); -const Ds$1 = (e) => (t) => { - let n = ai$3(t.replace(/\.json$/, ``)) + `.json`, r = RegExp(`^${e}_`, `g`), i = n.indexOf(`-`); - return i === -1 ? Bh$1(n.replace(/\.json$/, ``).replace(r, ``)) : e === `step` ? null : Bh$1(n.substring(i + 1).replace(/\.json$/, ``).replace(r, ``)); -}; -function Os$1(e, t) { - return t === `none` ? { - ...e, - input: void 0, - output: void 0 - } : e; -} -function ks$1(e, t) { - return t === `none` ? { - ...e, - input: void 0, - output: void 0 - } : e; -} -function As$1(e, t) { - if (t === `none`) { - let { metadata: t, ...n } = e; - return n; - } - return e; -} -function js$1(e, t) { - async function n(t) { - let n = G.join(e, `hooks`), r = await xi$3(n); - for (let e of r) { - let r = await gi$3(G.join(n, `${e}.json`), eh$1); - if (r && r.token === t) return { - ...r, - isWebhook: r.isWebhook ?? !0 - }; - } - return null; - } - async function r(n, r) { - Qr$3(`hookId`, n); - let i = await ci$3(e, `hooks`, n, eh$1, t); - if (!i) throw new b$9(n); - let a = r?.resolveData || `all`; - return As$1({ - ...i, - isWebhook: i.isWebhook ?? !0 - }, a); - } - async function i(e) { - let t = await n(e); - if (!t) throw new b$9(e); - return t; - } - async function a(t) { - let n = G.join(e, `hooks`), r = t.resolveData || `all`, i = await Ti$3({ - directory: n, - schema: eh$1, - sortOrder: t.pagination?.sortOrder ?? `asc`, - limit: t.pagination?.limit, - cursor: t.pagination?.cursor, - filePrefix: void 0, - filter: (e) => !(t.runId && e.runId !== t.runId), - getCreatedAt: () => null, - getId: (e) => e.hookId - }); - return { - ...i, - data: i.data.map((e) => As$1(e, r)) - }; - } - return { - get: r, - getByToken: i, - list: a - }; -} -async function Ms$1(e, t) { - let n = G.join(e, `hooks`), r = await xi$3(n); - for (let i of r) { - let r = G.join(n, `${i}.json`), a = await gi$3(r, eh$1); - a && a.runId === t && (await yi$3(G.join(n, `tokens`, `${ws$1(a.token)}.json`)), await yi$3(Ts$1(e, a.token, a.runId, a.hookId)), await yi$3(r)); - } -} -async function Ns$1(e, t, n, r, i) { - Qr$3(`runId`, t); - let a = i?.resolveData ?? `all`; - switch (n.eventType) { - case `run_cancelled`: { - let n = /* @__PURE__ */ new Date(), i = { - runId: r.runId, - deploymentId: r.deploymentId, - workflowName: r.workflowName, - specVersion: r.specVersion, - executionContext: r.executionContext, - input: r.input, - createdAt: r.createdAt, - expiredAt: r.expiredAt, - startedAt: r.startedAt, - status: `cancelled`, - output: void 0, - error: void 0, - completedAt: n, - updatedAt: n, - attributes: r.attributes - }; - return await mi$3($r$3(e, `runs`, `${t}.json`), i, { overwrite: !0 }), await Ms$1(e, t), { - event: void 0, - run: Os$1(i, a) - }; - } - case `wait_completed`: - case `hook_received`: { - let r = `evnt_${Es$1()}`, i = /* @__PURE__ */ new Date(), o = { - ...n, - runId: t, - eventId: r, - createdAt: i, - specVersion: 5 - }; - return await mi$3($r$3(e, `events`, `${`${t}-${r}`}.json`), o), { event: Nm$1(o, a) }; - } - default: throw Error(`Event type '${n.eventType}' not supported for legacy runs (specVersion: ${r.specVersion || `undefined`}). Please upgrade 'workflow' package.`); - } -} -const Ps$1 = /* @__PURE__ */ new Map(); -function Fs$1(e, t) { - let n = Ps$1.get(e), r = {}, i = (async () => { - n && await n.catch(() => void 0); - try { - return await t(); - } finally { - Ps$1.get(e) === r.task && Ps$1.delete(e); - } - })(); - return r.task = i, Ps$1.set(e, i), i; -} -function Is$1(e, t) { - return { - get: (async (n, r) => { - Qr$3(`runId`, n); - let i = await ci$3(e, `runs`, n, _h$1, t); - if (!i) throw new v$8(n); - return Os$1(i, r?.resolveData ?? `all`); - }), - list: (async (t) => { - let n = t?.resolveData ?? `all`, r = await Ti$3({ - directory: G.join(e, `runs`), - schema: _h$1, - fileIdFilter: t?.fileIdFilter, - filter: (e) => !(t?.workflowName && e.workflowName !== t.workflowName || t?.status && e.status !== t.status), - sortOrder: t?.pagination?.sortOrder ?? `desc`, - limit: t?.pagination?.limit, - cursor: t?.pagination?.cursor, - getCreatedAt: Ds$1(`wrun`), - getId: (e) => e.runId - }); - return n === `none` ? { - ...r, - data: r.data.map((e) => ({ - ...e, - input: void 0, - output: void 0 - })) - } : r; - }), - experimentalSetAttributes: async (n, r, i) => (Qr$3(`runId`, n), Fs$1(n, async () => { - let a = await ci$3(e, `runs`, n, _h$1, t); - if (!a) throw new v$8(n); - try { - Am$1(r, { - existingKeys: Object.keys(a.attributes ?? {}), - allowReservedAttributes: i?.allowReservedAttributes - }); - } catch (e) { - throw e instanceof Em$1, e; - } - let o = jm$1(a.attributes, r), s = { - ...a, - attributes: o, - updatedAt: /* @__PURE__ */ new Date() - }; - return await mi$3(si$3(e, `runs`, n, t), s, { overwrite: !0 }), { attributes: o }; - })) - }; -} -const Ls$1 = V$8({ - hookId: R$8().optional(), - runId: R$8(), - eventId: R$8().optional() -}); -const Rs$1 = V$8({ eventId: R$8() }); -async function zs$1(e) { - try { - return await gi$3(e, Ls$1); - } catch (e) { - if (e instanceof SyntaxError || e instanceof ed$2) return null; - throw e; - } -} -async function Bs$1(e) { - try { - return await gi$3(e, Rs$1); - } catch (e) { - if (e instanceof SyntaxError || e instanceof ed$2) return null; - throw e; - } -} -async function Vs$1(e, t, n) { - return (await Ti$3({ - directory: G.join(e, `events`), - schema: $m$1, - filePrefix: `${t}-`, - filter: (e) => e.eventType === `hook_created` && e.correlationId === n, - limit: 1, - getCreatedAt: Ds$1(`evnt`), - getId: (e) => e.eventId - })).data[0]?.eventId ?? null; -} -async function Hs$1(e, t, n, r, i) { - let a = await ci$3(e, `events`, `${t}-${r}`, $m$1, i); - if (!a || a.eventType !== `hook_created` || a.correlationId !== n || await ci$3(e, `hooks`, n, eh$1, i)) return; - let o = a.eventData ?? {}; - if (typeof o.token != `string`) return; - let s = { - runId: t, - hookId: n, - token: o.token, - metadata: o.metadata, - ownerId: `local-owner`, - projectId: `local-project`, - environment: `local`, - createdAt: a.createdAt, - specVersion: a.specVersion, - isWebhook: o.isWebhook ?? !1, - isSystem: o.isSystem ?? !1 - }; - await bi$3(si$3(e, `hooks`, n, i), JSON.stringify(s, fi$3, 2)); -} -async function Us$1(e, t, n, r, i) { - let a = Ts$1(e, t, n, r); - return await bi$3(a, JSON.stringify({ eventId: i })) ? i : (await Bs$1(a))?.eventId ?? null; -} -function Ws$1(e, t, n) { - let r = e.get(t), i = {}, a = (async () => { - r && await r.catch(() => void 0); - try { - return await n(); - } finally { - e.get(t) === i.task && e.delete(t); - } - })(); - return i.task = a, e.set(t, a), a; -} -async function Gs$1(e, t) { - let n = G.join(e, `waits`), r = await xi$3(n); - for (let e of r) e.startsWith(`${t}-`) && await yi$3(G.join(n, `${e}.json`)); -} -async function Ks$1(e, t, n, r) { - return Fs$1(t, async () => { - let i = await gi$3(si$3(e, `runs`, t, n), _h$1), a = { - ...r, - attributes: i?.attributes ?? r.attributes - }; - return await mi$3(si$3(e, `runs`, t, n), a, { overwrite: !0 }), a; - }); -} -function qs$1(e, t) { - let n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(); - return { - async create(i, a, o) { - if (i != null && i !== `` && Qr$3(`runId`, i), `correlationId` in a && typeof a.correlationId == `string` && Qr$3(`correlationId`, a.correlationId), (a.eventType === `step_created` || a.eventType === `step_started` || a.eventType === `step_completed` || a.eventType === `step_failed` || a.eventType === `step_retrying`) && i && a.correlationId) return Ws$1(n, t ? `${i}-${a.correlationId}.${t}` : `${i}-${a.correlationId}`, () => s()); - if (a.eventType === `hook_created` && i && a.correlationId) return Ws$1(r, t ? `${i}-${a.correlationId}.hook.${t}` : `${i}-${a.correlationId}.hook`, () => s()); - return s(); - async function s() { - let n = `evnt_${Es$1()}`, r = /* @__PURE__ */ new Date(), s; - if (a.eventType === `run_created` && (!i || i === ``)) s = `wrun_${Es$1()}`; - else if (i) s = i; - else throw Error(`runId is required for non-run_created events`); - if (a.eventType === `run_created` && i && i !== ``) { - let e = Vh$1(s, `wrun_`); - if (e) throw new s$8(e); - } - let c = a.specVersion ?? 5, l = (e) => [ - `completed`, - `failed`, - `cancelled` - ].includes(e), u = (e) => [ - `completed`, - `failed`, - `cancelled` - ].includes(e), f = null; - if (a.eventType !== `run_created` && ![`step_completed`, `step_retrying`].includes(a.eventType) && (f = await ci$3(e, `runs`, s, _h$1, t), a.eventType === `run_started` && !f && `eventData` in a && a.eventData)) { - let n = a.eventData; - if (n.deploymentId && n.workflowName && n.input !== void 0) { - Am$1(Object.entries(n.attributes ?? {}).map(([e, t]) => ({ - key: e, - value: t - })), { allowReservedAttributes: n.allowReservedAttributes === !0 }); - let i = { - runId: s, - deploymentId: n.deploymentId, - status: `pending`, - workflowName: n.workflowName, - specVersion: c, - executionContext: n.executionContext, - input: n.input, - output: void 0, - error: void 0, - startedAt: void 0, - completedAt: void 0, - attributes: n.attributes ?? {}, - createdAt: r, - updatedAt: r - }; - if (await bi$3(si$3(e, `runs`, s, t), JSON.stringify(i, fi$3))) { - let a = `evnt_${Es$1()}`, o = { - eventType: `run_created`, - runId: s, - eventId: a, - createdAt: r, - specVersion: c, - eventData: { - deploymentId: n.deploymentId, - workflowName: n.workflowName, - input: n.input, - executionContext: n.executionContext, - attributes: n.attributes, - allowReservedAttributes: n.allowReservedAttributes - } - }; - await mi$3(si$3(e, `events`, `${s}-${a}`, t), o), f = i; - } else f = await ci$3(e, `runs`, s, _h$1, t); - } - } - if (a.eventType === `run_failed` && !f || a.eventType === `attr_set` && !f) throw new v$8(s); - if (f) { - if (xh$1(f.specVersion)) throw new E$11(f.specVersion, 5); - if (bh$1(f.specVersion)) return Ns$1(e, s, a, f, o); - } - let m = a.eventType === `step_started` && `eventData` in a && !!a.eventData && typeof a.eventData.stepName == `string` && a.eventData.input !== void 0; - if (f && l(f.status)) { - let i = [ - `run_started`, - `run_completed`, - `run_failed` - ]; - if (a.eventType === `run_cancelled` && f.status === `cancelled`) { - let i = { - ...a, - runId: s, - eventId: n, - createdAt: r, - specVersion: c - }; - return await mi$3(si$3(e, `events`, `${s}-${n}`, t), i), { - event: Nm$1(i, o?.resolveData ?? `all`), - run: f - }; - } - if (a.eventType === `run_started`) throw new S$10(`Workflow run "${s}" is already in terminal state "${f.status}"`); - if (i.includes(a.eventType) || a.eventType === `run_cancelled`) throw new x$9(`Cannot transition run from terminal state "${f.status}"`); - if (a.eventType === `step_created` || a.eventType === `hook_created` || a.eventType === `wait_created` || m) throw new x$9(`Cannot create new entities on run in terminal state "${f.status}"`); - if (a.eventType === `attr_set`) throw new x$9(`Cannot set attributes on run in terminal state "${f.status}"`); - } - let h = null; - if ([ - `step_started`, - `step_completed`, - `step_failed`, - `step_retrying` - ].includes(a.eventType) && a.correlationId) { - if (h = await ci$3(e, `steps`, `${s}-${a.correlationId}`, Ch$1, t), !h && !m) throw new s$8(`Step "${a.correlationId}" not found`); - if (m && h) throw new x$9(`Step "${a.correlationId}" already created`); - if (h) { - if (u(h.status)) throw new x$9(`Cannot modify step in terminal state "${h.status}"`); - if (f && l(f.status) && h.status !== `running`) throw new S$10(`Cannot modify non-running step on run in terminal state "${f.status}"`); - } - } - if ([`hook_disposed`, `hook_received`].includes(a.eventType) && a.correlationId && !await ci$3(e, `hooks`, a.correlationId, eh$1, t)) throw new b$9(a.correlationId); - let g = { - ...a, - runId: s, - eventId: n, - createdAt: r, - specVersion: c - }; - if (a.eventType === `run_started` && `eventData` in g && delete g.eventData, m && `eventData` in g && g.eventData) { - let { input: e, ...t } = g.eventData; - g.eventData = t; - } - let _, y, x, S, w = !1, E; - if (a.eventType === `run_created` && `eventData` in a) { - let n = a.eventData; - if (Am$1(Object.entries(n.attributes ?? {}).map(([e, t]) => ({ - key: e, - value: t - })), { allowReservedAttributes: n.allowReservedAttributes === !0 }), _ = { - runId: s, - deploymentId: n.deploymentId, - status: `pending`, - workflowName: n.workflowName, - specVersion: c, - executionContext: n.executionContext, - input: n.input, - output: void 0, - error: void 0, - startedAt: void 0, - completedAt: void 0, - attributes: n.attributes ?? {}, - createdAt: r, - updatedAt: r - }, !await bi$3(si$3(e, `runs`, s, t), JSON.stringify(_, fi$3, 2))) throw new x$9(`Workflow run "${s}" already exists`); - } else if (a.eventType === `run_started`) { - if (f) { - if (f.status === `running`) return { run: f }; - _ = await Ks$1(e, s, t, { - runId: f.runId, - deploymentId: f.deploymentId, - workflowName: f.workflowName, - specVersion: f.specVersion, - executionContext: f.executionContext, - input: f.input, - createdAt: f.createdAt, - expiredAt: f.expiredAt, - status: `running`, - output: void 0, - error: void 0, - completedAt: void 0, - startedAt: f.startedAt ?? r, - updatedAt: r, - attributes: f.attributes - }); - } - } else if (a.eventType === `run_completed` && `eventData` in a) { - let n = a.eventData; - f && (_ = await Ks$1(e, s, t, { - runId: f.runId, - deploymentId: f.deploymentId, - workflowName: f.workflowName, - specVersion: f.specVersion, - executionContext: f.executionContext, - input: f.input, - createdAt: f.createdAt, - expiredAt: f.expiredAt, - startedAt: f.startedAt, - status: `completed`, - output: n.output, - error: void 0, - completedAt: r, - updatedAt: r, - attributes: f.attributes - }), await Promise.all([Ms$1(e, s), Gs$1(e, s)])); - } else if (a.eventType === `run_failed` && `eventData` in a) { - let n = a.eventData; - f && (_ = await Ks$1(e, s, t, { - runId: f.runId, - deploymentId: f.deploymentId, - workflowName: f.workflowName, - specVersion: f.specVersion, - executionContext: f.executionContext, - input: f.input, - createdAt: f.createdAt, - expiredAt: f.expiredAt, - startedAt: f.startedAt, - status: `failed`, - output: void 0, - error: n.error, - errorCode: n.errorCode, - completedAt: r, - updatedAt: r, - attributes: f.attributes - }), await Promise.all([Ms$1(e, s), Gs$1(e, s)])); - } else if (a.eventType === `run_cancelled`) f && (_ = await Ks$1(e, s, t, { - runId: f.runId, - deploymentId: f.deploymentId, - workflowName: f.workflowName, - specVersion: f.specVersion, - executionContext: f.executionContext, - input: f.input, - createdAt: f.createdAt, - expiredAt: f.expiredAt, - startedAt: f.startedAt, - status: `cancelled`, - output: void 0, - error: void 0, - completedAt: r, - updatedAt: r, - attributes: f.attributes - }), await Promise.all([Ms$1(e, s), Gs$1(e, s)])); - else if (a.eventType === `attr_set` && f) _ = await Fs$1(s, async () => { - let n = await gi$3(si$3(e, `runs`, s, t), _h$1); - if (!n) throw new v$8(s); - if (Am$1(a.eventData.changes, { - existingKeys: Object.keys(n.attributes), - allowReservedAttributes: a.eventData.allowReservedAttributes === !0 - }), a.correlationId && a.eventData.writer.type === `workflow` && !await bi$3($r$3(e, `.locks`, `attributes`, t ? `${s}-${a.correlationId}.created.${t}` : `${s}-${a.correlationId}.created`), ``)) throw new x$9(`Attribute event "${a.correlationId}" already exists`); - let i = { - ...n, - attributes: jm$1(n.attributes, a.eventData.changes), - updatedAt: r - }; - return await mi$3(si$3(e, `runs`, s, t), i, { overwrite: !0 }), i; - }); - else if (a.eventType === `step_created` && `eventData` in a) { - if (!await bi$3($r$3(e, `.locks`, `steps`, t ? `${s}-${a.correlationId}.created.${t}` : `${s}-${a.correlationId}.created`), ``)) throw new x$9(`Step "${a.correlationId}" already created`); - let n = a.eventData; - y = { - runId: s, - stepId: a.correlationId, - stepName: n.stepName, - status: `pending`, - input: n.input, - output: void 0, - error: void 0, - attempt: 0, - startedAt: void 0, - completedAt: void 0, - createdAt: r, - updatedAt: r, - specVersion: c - }, await mi$3(si$3(e, `steps`, `${s}-${a.correlationId}`, t), y); - } else if (a.eventType === `step_started`) { - if (!h && m) { - let n = a.eventData; - if (await bi$3($r$3(e, `.locks`, `steps`, t ? `${s}-${a.correlationId}.created.${t}` : `${s}-${a.correlationId}.created`), ``)) { - let i = { - runId: s, - stepId: a.correlationId, - stepName: n.stepName, - status: `pending`, - input: n.input, - output: void 0, - error: void 0, - attempt: 0, - startedAt: void 0, - completedAt: void 0, - createdAt: r, - updatedAt: r, - specVersion: c - }; - await mi$3(si$3(e, `steps`, `${s}-${a.correlationId}`, t), i); - let o = `evnt_${Es$1()}`, l = { - eventType: `step_created`, - runId: s, - eventId: o, - createdAt: r, - specVersion: c, - correlationId: a.correlationId, - eventData: { - stepName: n.stepName, - input: n.input - } - }; - await mi$3(si$3(e, `events`, `${s}-${o}`, t), l), h = i, w = !0; - } else throw new x$9(`Step "${a.correlationId}" already created`); - } - if (h) { - if (h.retryAfter && h.retryAfter.getTime() > Date.now()) throw new C$11(`Cannot start step "${a.correlationId}": retryAfter timestamp has not been reached yet`, { retryAfter: Math.ceil((h.retryAfter.getTime() - Date.now()) / 1e3) }); - let n = `${s}-${a.correlationId}`, i = await ci$3(e, `steps`, n, Ch$1, t); - if (i && u(i.status)) throw new x$9(`Cannot modify step in terminal state "${i.status}"`); - y = { - ...h, - status: `running`, - startedAt: h.startedAt ?? r, - attempt: h.attempt + 1, - retryAfter: void 0, - updatedAt: r - }, await mi$3(si$3(e, `steps`, n, t), y, { overwrite: !0 }); - } - } else if (a.eventType === `step_completed` && `eventData` in a) { - let n = a.eventData; - if (h) { - let i = `${s}-${a.correlationId}`; - if (!await bi$3($r$3(e, `.locks`, `steps`, t ? `${i}.terminal.${t}` : `${i}.terminal`), ``)) throw new x$9(`Cannot modify step in terminal state`); - y = { - ...h, - status: `completed`, - output: n.result, - completedAt: r, - updatedAt: r - }, await mi$3(si$3(e, `steps`, i, t), y, { overwrite: !0 }); - } - } else if (a.eventType === `step_failed` && `eventData` in a) { - let n = a.eventData; - if (h) { - let i = `${s}-${a.correlationId}`; - if (!await bi$3($r$3(e, `.locks`, `steps`, t ? `${i}.terminal.${t}` : `${i}.terminal`), ``)) throw new x$9(`Cannot modify step in terminal state`); - y = { - ...h, - status: `failed`, - error: n.error, - completedAt: r, - updatedAt: r - }, await mi$3(si$3(e, `steps`, i, t), y, { overwrite: !0 }); - } - } else if (a.eventType === `step_retrying` && `eventData` in a) { - let n = a.eventData; - if (h) { - let i = `${s}-${a.correlationId}`; - y = { - ...h, - status: `pending`, - error: n.error, - retryAfter: n.retryAfter, - updatedAt: r - }, await mi$3(si$3(e, `steps`, i, t), y, { overwrite: !0 }); - } - } else if (a.eventType === `hook_created` && `eventData` in a) { - let i = a.eventData, l = G.join(e, `hooks`, `tokens`, `${ws$1(i.token)}.json`), u = await bi$3(l, JSON.stringify({ - token: i.token, - hookId: a.correlationId, - runId: s, - eventId: n - })), d = !1; - if (!u) { - let u = await zs$1(l); - if (u?.runId === s && u.hookId === a.correlationId) { - let o; - if (u.eventId) o = u.eventId; - else { - let r = await Vs$1(e, s, a.correlationId); - if (r !== null) throw await Hs$1(e, s, a.correlationId, r, t), new x$9(`Hook "${a.correlationId}" already created`); - let c = await Us$1(e, i.token, s, a.correlationId, n); - if (c === null) throw new x$9(`Hook "${a.correlationId}" already created`); - o = c; - } - n = o; - let l = Bh$1(n.replace(/^evnt_/, ``)) ?? r; - g = { - ...a, - runId: s, - eventId: n, - createdAt: l, - specVersion: c - }, d = !0; - } else { - let l = { - eventType: `hook_conflict`, - correlationId: a.correlationId, - eventData: { - token: i.token, - ...u ? { conflictingRunId: u.runId } : {} - }, - runId: s, - eventId: n, - createdAt: r, - specVersion: c - }; - return await mi$3(si$3(e, `events`, `${s}-${n}`, t), l), { - event: Nm$1(l, o?.resolveData ?? `all`), - run: _, - step: y, - hook: void 0 - }; - } - } - x = { - runId: s, - hookId: a.correlationId, - token: i.token, - metadata: i.metadata, - ownerId: `local-owner`, - projectId: `local-project`, - environment: `local`, - createdAt: g.createdAt, - specVersion: c, - isWebhook: i.isWebhook ?? !1, - isSystem: i.isSystem ?? !1 - }, E = d ? { overwrite: !0 } : void 0; - } else if (a.eventType === `hook_disposed`) { - if (!await bi$3($r$3(e, `.locks`, `hooks`, t ? `${a.correlationId}.disposed.${t}` : `${a.correlationId}.disposed`), ``)) throw new x$9(`Hook "${a.correlationId}" already disposed`); - let n = si$3(e, `hooks`, a.correlationId, t), r = await ci$3(e, `hooks`, a.correlationId, eh$1, t); - r && (await yi$3(G.join(e, `hooks`, `tokens`, `${ws$1(r.token)}.json`)), await yi$3(Ts$1(e, r.token, r.runId, r.hookId))), await yi$3(n); - } else if (a.eventType === `wait_created` && `eventData` in a) { - let n = `${s}-${a.correlationId}`; - if (!await bi$3($r$3(e, `.locks`, `waits`, t ? `${n}.created.${t}` : `${n}.created`), ``)) throw new x$9(`Wait "${a.correlationId}" already exists`); - let i = a.eventData; - S = { - waitId: n, - runId: s, - status: `waiting`, - resumeAt: i.resumeAt, - completedAt: void 0, - createdAt: r, - updatedAt: r, - specVersion: c - }, await mi$3(si$3(e, `waits`, n, t), S); - } else if (a.eventType === `wait_completed`) { - let n = `${s}-${a.correlationId}`, i = $r$3(e, `.locks`, `waits`, t ? `${n}.completed.${t}` : `${n}.completed`); - if (!await bi$3(i, ``)) throw new x$9(`Wait "${a.correlationId}" already completed`); - let o = await ci$3(e, `waits`, n, Uh$1, t); - if (!o) throw await Xn.unlink(i).catch(() => {}), new s$8(`Wait "${a.correlationId}" not found`); - S = { - ...o, - status: `completed`, - completedAt: r, - updatedAt: r - }, await mi$3(si$3(e, `waits`, n, t), S, { overwrite: !0 }); - } - if (!await bi$3(si$3(e, `events`, `${s}-${n}`, t), JSON.stringify(g, fi$3, 2))) throw a.eventType === `hook_created` && a.correlationId && await Hs$1(e, s, a.correlationId, n, t), new x$9(`Event "${n}" already exists for run "${s}"`); - x && a.eventType === `hook_created` && await mi$3(si$3(e, `hooks`, x.hookId, t), x, E); - let D = o?.resolveData ?? `all`, k = Nm$1(g, D), A, j, M; - if (a.eventType === `run_started` && _) { - let t = await Ti$3({ - directory: G.join(e, `events`), - schema: $m$1, - filePrefix: `${s}-`, - sortOrder: `asc`, - limit: 1e3, - getCreatedAt: Ds$1(`evnt`), - getId: (e) => e.eventId - }); - A = t.data, j = t.cursor, M = t.hasMore; - } - if ((a.eventType === `step_completed` || a.eventType === `step_failed`) && typeof o?.sinceCursor == `string`) { - let t = await Ti$3({ - directory: G.join(e, `events`), - schema: $m$1, - filePrefix: `${s}-`, - sortOrder: `asc`, - cursor: o.sinceCursor, - getCreatedAt: Ds$1(`evnt`), - getId: (e) => e.eventId - }); - A = D === `none` ? t.data.map((e) => Nm$1(e, D)) : t.data, j = t.cursor, M = t.hasMore; - } - return { - event: k, - run: _, - step: y, - hook: x, - wait: S, - events: A, - cursor: j, - hasMore: M, - ...w ? { stepCreated: !0 } : {} - }; - } - }, - async get(n, r, i) { - Qr$3(`runId`, n), Qr$3(`eventId`, r); - let a = await ci$3(e, `events`, `${n}-${r}`, $m$1, t); - if (!a) throw Error(`Event ${r} in run ${n} not found`); - return Nm$1(a, i?.resolveData ?? `all`); - }, - async list(t) { - let { runId: n } = t; - Qr$3(`runId`, n); - let r = t.resolveData ?? `all`, i = await Ti$3({ - directory: G.join(e, `events`), - schema: $m$1, - filePrefix: `${n}-`, - sortOrder: t.pagination?.sortOrder ?? `asc`, - limit: t.pagination?.limit, - cursor: t.pagination?.cursor, - getCreatedAt: Ds$1(`evnt`), - getId: (e) => e.eventId - }); - return r === `none` ? { - ...i, - data: i.data.map((e) => Nm$1(e, r)) - } : i; - }, - async listByCorrelationId(t) { - let n = t.correlationId; - Qr$3(`correlationId`, n); - let r = t.resolveData ?? `all`, i = await Ti$3({ - directory: G.join(e, `events`), - schema: $m$1, - filter: (e) => e.correlationId === n, - sortOrder: t.pagination?.sortOrder ?? `asc`, - limit: t.pagination?.limit, - cursor: t.pagination?.cursor, - getCreatedAt: Ds$1(`evnt`), - getId: (e) => e.eventId - }); - return r === `none` ? { - ...i, - data: i.data.map((e) => Nm$1(e, r)) - } : i; - } - }; -} -function Js$1(e, t) { - return { - get: (async (n, r, i) => { - Qr$3(`runId`, n), Qr$3(`stepId`, r); - let a = await ci$3(e, `steps`, `${n}-${r}`, Ch$1, t); - if (!a) throw Error(`Step ${r} in run ${n} not found`); - return ks$1(a, i?.resolveData ?? `all`); - }), - list: (async (t) => { - Qr$3(`runId`, t.runId); - let n = t.resolveData ?? `all`, r = await Ti$3({ - directory: G.join(e, `steps`), - schema: Ch$1, - filePrefix: `${t.runId}-`, - sortOrder: t.pagination?.sortOrder ?? `desc`, - limit: t.pagination?.limit, - cursor: t.pagination?.cursor, - getCreatedAt: Ds$1(`step`), - getId: (e) => e.stepId - }); - return n === `none` ? { - ...r, - data: r.data.map((e) => ({ - ...e, - input: void 0, - output: void 0 - })) - } : r; - }) - }; -} -function Ys$1(e, t) { - let n = Is$1(e, t), r = Js$1(e, t), i = qs$1(e, t), a = js$1(e, t); - return { - runs: la$3(`world.runs`, n), - steps: la$3(`world.steps`, r), - events: la$3(`world.events`, i), - hooks: la$3(`world.hooks`, a) - }; -} -const Xs$1 = Ih$1(() => Math.random()); -const Zs$1 = V$8({ streams: Uf$1(R$8()) }); -function Qs$1(e) { - return e === 1; -} -function $s$1(e) { - let t = Buffer.from([+!!e.eof]); - return Buffer.concat([t, e.chunk]); -} -function ec$1(e) { - return Qs$1(e[0]); -} -function tc$1(e) { - return { - eof: ec$1(e), - chunk: Buffer.from(e.subarray(1)) - }; -} -async function nc$1(e) { - try { - return await Xn.readdir(e); - } catch (e) { - if (e.code === `ENOENT`) return []; - throw e; - } -} -function rc$1(e, t, n, r = n, i = () => !0) { - for (let a of t) { - if (!a.endsWith(n)) continue; - let t = a.slice(0, -n.length); - i(t) && e.set(t, r); - } -} -async function ic$1(e, t, n) { - Qr$3(`streamName`, t); - let r = await nc$1(e), i = /* @__PURE__ */ new Map(); - return rc$1(i, r, `.json`), rc$1(i, r, `.bin`, `.bin`, n ? (e) => !e.endsWith(`.${n}`) : void 0), n && rc$1(i, r, `.${n}.bin`), { - files: [...i.keys()].filter((e) => e.startsWith(`${t}-`)).sort(), - extMap: i - }; -} -function ac$1(e, t) { - let n = t ? `.${t}` : ``, r = new EventEmitter(), i = /* @__PURE__ */ new Set(); - async function a(n, r) { - Qr$3(`runId`, n), Qr$3(`streamName`, r); - let a = `${n}:${r}`; - if (i.has(a)) return; - let o = si$3(e, `streams/runs`, n, t), s = (await ci$3(e, `streams/runs`, n, Zs$1, t))?.streams ?? []; - s.includes(r) || (s.push(r), await mi$3(o, { streams: s }, { overwrite: !0 })), i.add(a); - } - function o(e) { - return typeof e == `string` ? Buffer.from(new TextEncoder().encode(e)) : e instanceof Buffer ? e : Buffer.from(e); - } - return { streams: { - async write(t, i, s) { - let c = `chnk_${Xs$1()}`; - await a(await t, i); - let l = o(s), u = $s$1({ - chunk: l, - eof: !1 - }); - await hi$3(G.join(e, `streams`, `chunks`, `${i}-${c}${n}.bin`), u); - let d = Uint8Array.from(l); - r.emit(`chunk:${i}`, { - streamName: i, - chunkData: d, - chunkId: c - }); - }, - async writeMulti(t, i, s) { - if (s.length === 0) return; - let c = s.map(() => `chnk_${Xs$1()}`); - await a(await t, i); - let l = s.map((e) => o(e)).map(async (t, r) => { - let a = c[r], o = $s$1({ - chunk: t, - eof: !1 - }); - return await hi$3(G.join(e, `streams`, `chunks`, `${i}-${a}${n}.bin`), o), { - chunkId: a, - chunkData: Uint8Array.from(t) - }; - }); - for (let e of l) { - let { chunkId: t, chunkData: n } = await e; - r.emit(`chunk:${i}`, { - streamName: i, - chunkData: n, - chunkId: t - }); - } - }, - async close(t, i) { - let o = `chnk_${Xs$1()}`; - await a(await t, i), await hi$3(G.join(e, `streams`, `chunks`, `${i}-${o}${n}.bin`), $s$1({ - chunk: Buffer.from([]), - eof: !0 - })), r.emit(`close:${i}`, { streamName: i }); - }, - async list(n) { - return Qr$3(`runId`, n), (await ci$3(e, `streams/runs`, n, Zs$1, t))?.streams ?? []; - }, - async getChunks(n, r, i) { - let a = i?.limit ?? 100, o = G.join(e, `streams`, `chunks`), { files: s, extMap: c } = await ic$1(o, r, t), l = 0; - if (i?.cursor) try { - l = JSON.parse(Buffer.from(i.cursor, `base64`).toString(`utf-8`)).i; - } catch { - l = 0; - } - let u = !1, d = [], f = 0; - for (let e of s) { - let t = c.get(e) ?? `.bin`, n = G.join(o, `${e}${t}`); - if (f < l) { - if (Qs$1(await vi$3(n))) { - u = !0; - break; - } - f++; - continue; - } - if (d.length >= a) { - Qs$1(await vi$3(n)) ? u = !0 : f++; - break; - } - let r = tc$1(await _i$3(n)); - if (r.eof) { - u = !0; - break; - } - d.push({ - index: f, - data: Uint8Array.from(r.chunk) - }), f++; - } - let p = !u && f > l + d.length, m = l + d.length; - return { - data: d, - cursor: p ? Buffer.from(JSON.stringify({ i: m })).toString(`base64`) : null, - hasMore: p, - done: u - }; - }, - async getInfo(n, r) { - let i = G.join(e, `streams`, `chunks`), { files: a, extMap: o } = await ic$1(i, r, t), s = !1, c = 0; - for (let e of a) { - let t = o.get(e) ?? `.bin`; - if (Qs$1(await vi$3(G.join(i, `${e}${t}`)))) { - s = !0; - break; - } - c++; - } - return { - tailIndex: c - 1, - done: s - }; - }, - async get(n, i, a = 0) { - let o = G.join(e, `streams`, `chunks`), s = () => {}, c = null; - return new ReadableStream({ - async start(e) { - let n = /* @__PURE__ */ new Set(), l = [], u = !0, d = !1, f = !1, p = (t) => { - if (t.chunkData.byteLength === 0) { - n.add(t.chunkId); - return; - } - u ? (n.add(t.chunkId), l.push({ - chunkId: t.chunkId, - chunkData: Uint8Array.from(t.chunkData) - })) : n.has(t.chunkId) || (n.add(t.chunkId), e.enqueue(Uint8Array.from(t.chunkData))); - }, m = () => { - if (u) { - d = !0; - return; - } - f = !0, r.off(`chunk:${i}`, p), r.off(`close:${i}`, m), c &&= (clearInterval(c), null); - try { - e.close(); - } catch {} - }; - s = m, r.on(`chunk:${i}`, p), r.on(`close:${i}`, m); - let { files: h, extMap: g } = await ic$1(o, i, t), _ = h.length; - if (typeof a == `number` && a < 0 && h.length > 0) { - let e = h[h.length - 1], t = g.get(e) ?? `.bin`; - Qs$1(await vi$3(G.join(o, `${e}${t}`))) && _--; - } - let v = typeof a == `number` && a < 0 ? Math.max(0, _ + a) : a, y = !1; - for (let r = v; r < h.length; r++) { - let a = h[r], s = a.substring(i.length + 1), c = t ? s.replace(`.${t}`, ``) : s; - if (n.has(c)) continue; - let l = g.get(a) ?? `.bin`, u = tc$1(await _i$3(G.join(o, `${a}${l}`))); - if (u?.eof === !0) { - y = !0; - break; - } - n.add(c), u.chunk.byteLength && e.enqueue(Uint8Array.from(u.chunk)); - } - u = !1, l.sort((e, t) => e.chunkId.localeCompare(t.chunkId)); - for (let t of l) e.enqueue(Uint8Array.from(t.chunkData)); - if (y) { - s(); - try { - e.close(); - } catch {} - return; - } - if (d) { - r.off(`chunk:${i}`, p), r.off(`close:${i}`, m); - try { - e.close(); - } catch {} - return; - } - for (let e = 0; e < v && e < h.length; e++) { - let r = h[e].substring(i.length + 1), a = t ? r.replace(`.${t}`, ``) : r; - n.add(a); - } - let b = !1; - c = setInterval(async () => { - if (!b) { - b = !0; - try { - let { files: a, extMap: s } = await ic$1(o, i, t); - for (let l of a) { - let a = l.substring(i.length + 1), u = t ? a.replace(`.${t}`, ``) : a; - if (n.has(u)) continue; - n.add(u); - let d = s.get(l) ?? `.bin`, h = tc$1(await _i$3(G.join(o, `${l}${d}`))); - if (h?.eof === !0) { - f = !0, c &&= (clearInterval(c), null), r.off(`chunk:${i}`, p), r.off(`close:${i}`, m); - try { - e.close(); - } catch {} - return; - } - if (f) return; - h.chunk.byteLength && e.enqueue(Uint8Array.from(h.chunk)); - } - } catch (e) { - e instanceof Error && `code` in e || console.error(`[world-local] Unexpected polling error:`, e); - } finally { - b = !1; - } - } - }, 100); - }, - cancel() { - s(), c &&= (clearInterval(c), null); - } - }); - } - } }; -} -function oc$1(e) { - let t = e ? Object.fromEntries(Object.entries(e).filter(([, e]) => e !== void 0)) : {}, n = { - ...qr$3.value, - ...t - }, r = n.tag, i = Cs$1(n), a = Ys$1(n.dataDir, r), o = n.recoverActiveRuns ?? !0; - return { - specVersion: 5, - ...i, - ...a, - ...la$3(`world.streams`, { - ...ac$1(n.dataDir, r), - ...n.streamFlushIntervalMs !== void 0 && { streamFlushIntervalMs: n.streamFlushIntervalMs } - }), - async start() { - await Vi$3(n.dataDir), o && await mh$1(r ? { - ...a.runs, - list: ((e) => a.runs.list({ - ...e, - fileIdFilter: (e) => oi$3(e, r) - })) - } : a.runs, i.queue, `world-local`); - }, - async close() { - await i.close(); - }, - async clear() { - if (r) { - let e = n.dataDir, t = G.join(e, `hooks`), i = await li$3(t, r), { HookSchema: a } = await Promise.resolve().then(() => attribute_changes_DUxG_Gic_exports).then((e) => e.Sn); - await Promise.all(i.map(async (n) => { - let r = await gi$3(G.join(t, n), a); - r?.token && (await yi$3(G.join(t, `tokens`, `${ws$1(r.token)}.json`)), await yi$3(Ts$1(e, r.token, r.runId, r.hookId))); - })), await Promise.all([ - `runs`, - `steps`, - `events`, - `hooks`, - `waits`, - `streams/runs` - ].map(async (t) => { - let n = G.join(e, t), i = await li$3(n, r); - await Promise.all(i.map((e) => yi$3(G.join(n, e)))); - })), await promises.rm(G.join(e, `.locks`), { - recursive: !0, - force: !0 - }).catch(() => {}); - let o = G.join(e, `streams`, `chunks`), s = await ui$3(o, r, `.bin`); - await Promise.all(s.map((e) => promises.unlink(G.join(o, e)).catch(() => {}))), ri$3(); - } else await rm(n.dataDir, { - recursive: !0, - force: !0 - }), await Vi$3(n.dataDir); - } - }; -} -var sc$1 = c$12(((e, t) => { - var n = Object.defineProperty, r = Object.getOwnPropertyDescriptor, i = Object.getOwnPropertyNames, a = Object.prototype.hasOwnProperty, o = (e, t) => { - for (var r in t) n(e, r, { - get: t[r], - enumerable: !0 - }); - }, s = (e, t, o, s) => { - if (t && typeof t == `object` || typeof t == `function`) for (let c of i(t)) !a.call(e, c) && c !== o && n(e, c, { - get: () => t[c], - enumerable: !(s = r(t, c)) || s.enumerable - }); - return e; - }, c = (e) => s(n({}, `__esModule`, { value: !0 }), e), l = {}; - o(l, { - SYMBOL_FOR_REQ_CONTEXT: () => u, - getContext: () => d - }), t.exports = c(l); - let u = Symbol.for(`@vercel/request-context`); - function d() { - return globalThis[u]?.get?.() ?? {}; - } -})); -var cc$1 = c$12(((e, t) => { - var n = Object.defineProperty, r = Object.getOwnPropertyDescriptor, i = Object.getOwnPropertyNames, a = Object.prototype.hasOwnProperty, o = (e, t) => { - for (var r in t) n(e, r, { - get: t[r], - enumerable: !0 - }); - }, s = (e, t, o, s) => { - if (t && typeof t == `object` || typeof t == `function`) for (let c of i(t)) !a.call(e, c) && c !== o && n(e, c, { - get: () => t[c], - enumerable: !(s = r(t, c)) || s.enumerable - }); - return e; - }, c = (e) => s(n({}, `__esModule`, { value: !0 }), e), l = {}; - o(l, { VercelOidcTokenError: () => u }), t.exports = c(l); - var u = class extends Error { - constructor(e, t) { - super(e), this.name = `VercelOidcTokenError`, this.cause = t; - } - toString() { - return this.cause ? `${this.name}: ${this.message}: ${this.cause}` : `${this.name}: ${this.message}`; - } - }; -})); -var lc$1 = c$12(((t, n) => { - var r = Object.defineProperty, i = Object.getOwnPropertyDescriptor, a = Object.getOwnPropertyNames, o = Object.prototype.hasOwnProperty, s = (e, t) => { - for (var n in t) r(e, n, { - get: t[n], - enumerable: !0 - }); - }, c = (e, t, n, s) => { - if (t && typeof t == `object` || typeof t == `function`) for (let c of a(t)) !o.call(e, c) && c !== n && r(e, c, { - get: () => t[c], - enumerable: !(s = i(t, c)) || s.enumerable - }); - return e; - }, l = (e) => c(r({}, `__esModule`, { value: !0 }), e), u = {}; - s(u, { - getVercelOidcToken: () => p, - getVercelOidcTokenSync: () => m - }), n.exports = l(u); - var d = sc$1(), f = cc$1(); - async function p(t) { - let n = ``, r; - try { - n = m(); - } catch (e) { - r = e; - } - try { - let [{ getTokenPayload: r, isExpired: i }, { refreshToken: a }] = await Promise.all([await Promise.resolve().then(() => d$13(mc$1())), await Promise.resolve().then(() => token_J7YP0s9a_exports).then((t) => d$13(t.default))]); - (!n || i(r(n), t?.expirationBufferMs)) && (await a(t), n = m()); - } catch (e) { - let t = r instanceof Error ? r.message : ``; - throw e instanceof Error && (t = `${t} -${e.message}`), t ? new f.VercelOidcTokenError(t) : e; - } - return n; - } - function m() { - let e = (0, d.getContext)().headers?.[`x-vercel-oidc-token`] ?? process.env.VERCEL_OIDC_TOKEN; - if (!e) throw Error(`The 'x-vercel-oidc-token' header is missing from the request. Do you have the OIDC option enabled in the Vercel project settings?`); - return e; - } -})); -var uc$1 = c$12(((e, t) => { - var n = Object.defineProperty, r = Object.getOwnPropertyDescriptor, i = Object.getOwnPropertyNames, a = Object.prototype.hasOwnProperty, o = (e, t) => { - for (var r in t) n(e, r, { - get: t[r], - enumerable: !0 - }); - }, s = (e, t, o, s) => { - if (t && typeof t == `object` || typeof t == `function`) for (let c of i(t)) !a.call(e, c) && c !== o && n(e, c, { - get: () => t[c], - enumerable: !(s = r(t, c)) || s.enumerable - }); - return e; - }, c = (e) => s(n({}, `__esModule`, { value: !0 }), e), l = {}; - o(l, { - AccessTokenMissingError: () => u, - RefreshAccessTokenFailedError: () => d - }), t.exports = c(l); - var u = class extends Error { - constructor() { - super(`No authentication found. Please log in with the Vercel CLI (vercel login).`), this.name = `AccessTokenMissingError`; - } - }, d = class extends Error { - constructor(e) { - super(`Failed to refresh authentication token.`, { cause: e }), this.name = `RefreshAccessTokenFailedError`; - } - }; -})); -var dc$1 = c$12(((e, n) => { - var r = Object.create, i = Object.defineProperty, a = Object.getOwnPropertyDescriptor, o = Object.getOwnPropertyNames, s = Object.getPrototypeOf, c = Object.prototype.hasOwnProperty, l = (e, t) => { - for (var n in t) i(e, n, { - get: t[n], - enumerable: !0 - }); - }, u = (e, t, n, r) => { - if (t && typeof t == `object` || typeof t == `function`) for (let s of o(t)) !c.call(e, s) && s !== n && i(e, s, { - get: () => t[s], - enumerable: !(r = a(t, s)) || r.enumerable - }); - return e; - }, d = (e, t, n) => (n = e == null ? {} : r(s(e)), u(t || !e || !e.__esModule ? i(n, `default`, { - value: e, - enumerable: !0 - }) : n, e)), f = (e) => u(i({}, `__esModule`, { value: !0 }), e), p = {}; - l(p, { - findRootDir: () => v, - getUserDataDir: () => y - }), n.exports = f(p); - var m = d(f$11(`path`)), h = d(f$11(`fs`)), g = d(f$11(`os`)), _ = cc$1(); - function v() { - try { - let e = process.cwd(); - for (; e !== m.default.dirname(e);) { - let t = m.default.join(e, `.vercel`); - if (h.default.existsSync(t)) return e; - e = m.default.dirname(e); - } - } catch { - throw new _.VercelOidcTokenError(`Token refresh only supported in node server environments`); - } - return null; - } - function y() { - if (process.env.XDG_DATA_HOME) return process.env.XDG_DATA_HOME; - switch (g.default.platform()) { - case `darwin`: return m.default.join(g.default.homedir(), `Library/Application Support`); - case `linux`: return m.default.join(g.default.homedir(), `.local/share`); - case `win32`: return process.env.LOCALAPPDATA ? process.env.LOCALAPPDATA : null; - default: return null; - } - } -})); -var fc$1 = c$12(((e, n) => { - var r = Object.create, i = Object.defineProperty, a = Object.getOwnPropertyDescriptor, o = Object.getOwnPropertyNames, s = Object.getPrototypeOf, c = Object.prototype.hasOwnProperty, l = (e, t) => { - for (var n in t) i(e, n, { - get: t[n], - enumerable: !0 - }); - }, u = (e, t, n, r) => { - if (t && typeof t == `object` || typeof t == `function`) for (let s of o(t)) !c.call(e, s) && s !== n && i(e, s, { - get: () => t[s], - enumerable: !(r = a(t, s)) || r.enumerable - }); - return e; - }, d = (e, t, n) => (n = e == null ? {} : r(s(e)), u(t || !e || !e.__esModule ? i(n, `default`, { - value: e, - enumerable: !0 - }) : n, e)), f = (e) => u(i({}, `__esModule`, { value: !0 }), e), p = {}; - l(p, { - isValidAccessToken: () => b, - readAuthConfig: () => v, - writeAuthConfig: () => y - }), n.exports = f(p); - var m = d(f$11(`fs`)), h = d(f$11(`path`)), g = mc$1(); - function _() { - let e = (0, g.getVercelDataDir)(); - if (!e) throw Error(`Unable to find Vercel CLI data directory. Your platform: ${process.platform}. Supported: darwin, linux, win32.`); - return h.join(e, `auth.json`); - } - function v() { - try { - let e = _(); - if (!m.existsSync(e)) return null; - let t = m.readFileSync(e, `utf8`); - return t ? JSON.parse(t) : null; - } catch { - return null; - } - } - function y(e) { - let t = _(), n = h.dirname(t); - m.existsSync(n) || m.mkdirSync(n, { - mode: 504, - recursive: !0 - }), m.writeFileSync(t, JSON.stringify(e, null, 2), { mode: 384 }); - } - function b(e, t = 0) { - if (!e.token) return !1; - if (typeof e.expiresAt != `number`) return !0; - let n = Math.floor(Date.now() / 1e3), r = t / 1e3; - return e.expiresAt >= n + r; - } -})); -var pc$1 = c$12(((e, n) => { - var r = Object.defineProperty, i = Object.getOwnPropertyDescriptor, a = Object.getOwnPropertyNames, o = Object.prototype.hasOwnProperty, s = (e, t) => { - for (var n in t) r(e, n, { - get: t[n], - enumerable: !0 - }); - }, c = (e, t, n, s) => { - if (t && typeof t == `object` || typeof t == `function`) for (let c of a(t)) !o.call(e, c) && c !== n && r(e, c, { - get: () => t[c], - enumerable: !(s = i(t, c)) || s.enumerable - }); - return e; - }, l = (e) => c(r({}, `__esModule`, { value: !0 }), e), u = {}; - s(u, { - processTokenResponse: () => g, - refreshTokenRequest: () => h - }), n.exports = l(u); - var d = f$11(`os`); - let f = `@vercel/oidc node-${process.version} ${(0, d.platform)()} (${(0, d.arch)()}) ${(0, d.hostname)()}`, p = null; - async function m() { - if (p) return p; - let e = await fetch(`https://vercel.com/.well-known/openid-configuration`, { headers: { "user-agent": f } }); - if (!e.ok) throw Error(`Failed to discover OAuth endpoints`); - let t = await e.json(); - if (!t || typeof t.token_endpoint != `string`) throw Error(`Invalid OAuth discovery response`); - let n = t.token_endpoint; - return p = n, n; - } - async function h(e) { - let t = await m(); - return await fetch(t, { - method: `POST`, - headers: { - "Content-Type": `application/x-www-form-urlencoded`, - "user-agent": f - }, - body: new URLSearchParams({ - client_id: `cl_HYyOPBNtFMfHhaUn9L4QPfTZz6TP47bp`, - grant_type: `refresh_token`, - ...e - }) - }); - } - async function g(e) { - let t = await e.json(); - if (!e.ok) { - let e = typeof t == `object` && t && `error` in t ? String(t.error) : `Token refresh failed`; - return [Error(e)]; - } - return typeof t != `object` || !t ? [Error(`Invalid token response`)] : typeof t.access_token == `string` ? t.token_type === `Bearer` ? typeof t.expires_in == `number` ? [null, t] : [Error(`Missing expires_in in response`)] : [Error(`Invalid token_type in response`)] : [Error(`Missing access_token in response`)]; - } -})); -var mc$1 = c$12(((e, n) => { - var r = Object.create, i = Object.defineProperty, a = Object.getOwnPropertyDescriptor, o = Object.getOwnPropertyNames, s = Object.getPrototypeOf, c = Object.prototype.hasOwnProperty, l = (e, t) => { - for (var n in t) i(e, n, { - get: t[n], - enumerable: !0 - }); - }, u = (e, t, n, r) => { - if (t && typeof t == `object` || typeof t == `function`) for (let s of o(t)) !c.call(e, s) && s !== n && i(e, s, { - get: () => t[s], - enumerable: !(r = a(t, s)) || r.enumerable - }); - return e; - }, d = (e, t, n) => (n = e == null ? {} : r(s(e)), u(t || !e || !e.__esModule ? i(n, `default`, { - value: e, - enumerable: !0 - }) : n, e)), f = (e) => u(i({}, `__esModule`, { value: !0 }), e), p = {}; - l(p, { - assertVercelOidcTokenResponse: () => w, - findProjectInfo: () => T, - getTokenPayload: () => O, - getVercelDataDir: () => x, - getVercelOidcToken: () => C, - getVercelToken: () => S, - isExpired: () => k, - loadToken: () => D, - saveToken: () => E - }), n.exports = f(p); - var m = d(f$11(`path`)), h = d(f$11(`fs`)), g = cc$1(), _ = dc$1(), v = fc$1(), y = pc$1(), b = uc$1(); - function x() { - let e = (0, _.getUserDataDir)(); - return e ? m.join(e, `com.vercel.cli`) : null; - } - async function S(e) { - let t = (0, v.readAuthConfig)(); - if (!t?.token) throw new b.AccessTokenMissingError(); - if ((0, v.isValidAccessToken)(t, e?.expirationBufferMs)) return t.token; - if (!t.refreshToken) throw (0, v.writeAuthConfig)({}), new b.RefreshAccessTokenFailedError(`No refresh token available`); - try { - let e = await (0, y.refreshTokenRequest)({ refresh_token: t.refreshToken }), [n, r] = await (0, y.processTokenResponse)(e); - if (n || !r) throw (0, v.writeAuthConfig)({}), new b.RefreshAccessTokenFailedError(n); - let i = { - token: r.access_token, - expiresAt: Math.floor(Date.now() / 1e3) + r.expires_in - }; - return r.refresh_token && (i.refreshToken = r.refresh_token), (0, v.writeAuthConfig)(i), i.token; - } catch (e) { - throw (0, v.writeAuthConfig)({}), e instanceof b.AccessTokenMissingError || e instanceof b.RefreshAccessTokenFailedError ? e : new b.RefreshAccessTokenFailedError(e); - } - } - async function C(e, t, n) { - let r = `https://api.vercel.com/v1/projects/${t}/token?source=vercel-oidc-refresh${n ? `&teamId=${n}` : ``}`, i = await fetch(r, { - method: `POST`, - headers: { Authorization: `Bearer ${e}` } - }); - if (!i.ok) throw new g.VercelOidcTokenError(`Failed to refresh OIDC token: ${i.statusText}`); - let a = await i.json(); - return w(a), a; - } - function w(e) { - if (!e || typeof e != `object`) throw TypeError("Vercel OIDC token is malformed. Expected an object. Please run `vc env pull` and try again"); - if (!(`token` in e) || typeof e.token != `string`) throw TypeError("Vercel OIDC token is malformed. Expected a string-valued token property. Please run `vc env pull` and try again"); - } - function T() { - let e = (0, _.findRootDir)(); - if (!e) throw new g.VercelOidcTokenError("Unable to find project root directory. Have you linked your project with `vc link?`"); - let t = m.join(e, `.vercel`, `project.json`); - if (!h.existsSync(t)) throw new g.VercelOidcTokenError("project.json not found, have you linked your project with `vc link?`"); - let n = JSON.parse(h.readFileSync(t, `utf8`)); - if (typeof n.projectId != `string` && typeof n.orgId != `string`) throw TypeError("Expected a string-valued projectId property. Try running `vc link` to re-link your project."); - return { - projectId: n.projectId, - teamId: n.orgId - }; - } - function E(e, t) { - let n = (0, _.getUserDataDir)(); - if (!n) throw new g.VercelOidcTokenError(`Unable to find user data directory. Please reach out to Vercel support.`); - let r = m.join(n, `com.vercel.token`, `${t}.json`), i = JSON.stringify(e); - h.mkdirSync(m.dirname(r), { - mode: 504, - recursive: !0 - }), h.writeFileSync(r, i), h.chmodSync(r, 432); - } - function D(e) { - let t = (0, _.getUserDataDir)(); - if (!t) throw new g.VercelOidcTokenError(`Unable to find user data directory. Please reach out to Vercel support.`); - let n = m.join(t, `com.vercel.token`, `${e}.json`); - if (!h.existsSync(n)) return null; - let r = JSON.parse(h.readFileSync(n, `utf8`)); - return w(r), r; - } - function O(e) { - let t = e.split(`.`); - if (t.length !== 3) throw new g.VercelOidcTokenError("Invalid token. Please run `vc env pull` and try again"); - let n = t[1].replace(/-/g, `+`).replace(/_/g, `/`), r = n.padEnd(n.length + (4 - n.length % 4) % 4, `=`); - return JSON.parse(Buffer.from(r, `base64`).toString(`utf8`)); - } - function k(e, t = 0) { - return e.exp * 1e3 < Date.now() + t; - } -})); -var hc$1 = c$12(((e, t) => { - var n = Object.defineProperty, r = Object.getOwnPropertyDescriptor, i = Object.getOwnPropertyNames, a = Object.prototype.hasOwnProperty, o = (e, t) => { - for (var r in t) n(e, r, { - get: t[r], - enumerable: !0 - }); - }, s = (e, t, o, s) => { - if (t && typeof t == `object` || typeof t == `function`) for (let c of i(t)) !a.call(e, c) && c !== o && n(e, c, { - get: () => t[c], - enumerable: !(s = r(t, c)) || s.enumerable - }); - return e; - }, c = (e) => s(n({}, `__esModule`, { value: !0 }), e), l = {}; - o(l, { - AccessTokenMissingError: () => f.AccessTokenMissingError, - RefreshAccessTokenFailedError: () => f.RefreshAccessTokenFailedError, - getContext: () => d.getContext, - getVercelOidcToken: () => u.getVercelOidcToken, - getVercelOidcTokenSync: () => u.getVercelOidcTokenSync, - getVercelToken: () => p.getVercelToken - }), t.exports = c(l); - var u = lc$1(), d = sc$1(), f = uc$1(), p = mc$1(); -}))(); -let gc$1; -function _c$1(e) { - return e?.dispatcher ?? vc$1(); -} -function vc$1() { - return gc$1 ||= new hs$1.RetryAgent(new hs$1.Agent({ - connections: 8, - keepAliveTimeout: 1e4, - allowH2: !1, - pipelining: 1 - }), { retryAfter: !0 }), gc$1; -} -async function yc$1(e, t, n) { - if (e.length !== 32) throw Error(`Invalid deployment key length: expected 32 bytes for AES-256, got ${e.length} bytes`); - if (!t || typeof t != `string`) throw Error(`projectId must be a non-empty string`); - let r = await webcrypto.subtle.importKey(`raw`, e, `HKDF`, !1, [`deriveBits`]), i = new TextEncoder().encode(`${t}|${n}`), a = await webcrypto.subtle.deriveBits({ - name: `HKDF`, - hash: `SHA-256`, - salt: /* @__PURE__ */ new Uint8Array(32), - info: i - }, r, 256); - return new Uint8Array(a); -} -async function bc$1(e, t, n, r) { - let i = r?.token ?? process.env.VERCEL_TOKEN ?? await (0, hc$1.getVercelOidcToken)().catch(() => null); - if (!i) throw Error(`Cannot fetch run key: no OIDC token or VERCEL_TOKEN available`); - let a = new URLSearchParams({ - projectId: t, - runId: n - }); - r?.teamId && a.set(`teamId`, r.teamId); - let o = await fetch(`https://api.vercel.com/v1/workflow/run-key/${e}?${a}`, { - method: `GET`, - headers: { Authorization: `Bearer ${i}` }, - dispatcher: _c$1({ dispatcher: r?.dispatcher }) - }); - if (!o.ok) { - let t; - try { - t = await o.text(); - } catch { - t = ``; - } - throw Error(`Failed to fetch run key for ${n} (deployment ${e}): HTTP ${o.status} ${o.statusText}${t ? ` — ${t}` : ``}`); - } - let s = await o.json(), c = V$8({ key: R$8().nullable() }).safeParse(s); - if (!c.success) throw Error(`Invalid response from Vercel API: expected { key: string | null }. Zod error: ${c.error.message}`); - if (c.data.key !== null) return Buffer.from(c.data.key, `base64`); -} -function xc$1(e, t, n, r) { - if (!e) return; - let i = process.env.VERCEL === `1`, a; - function o() { - if (a) return a; - let e = process.env.VERCEL_DEPLOYMENT_KEY; - if (e) return a = Buffer.from(e, `base64`), a; - } - return async function(a, s) { - let c = typeof a == `string` ? a : a.runId, l = typeof a == `string` ? s?.deploymentId : a.deploymentId; - if (i && (!l || l === process.env.VERCEL_DEPLOYMENT_ID)) { - let t = o(); - return t ? yc$1(t, e, c) : void 0; - } - if (l) return bc$1(l, e, c, { - token: n, - teamId: t, - dispatcher: r - }); - }; -} -let Sc$1 = null; -async function Cc$1() { - return Sc$1 ||= Promise.resolve().then(() => src_CQuMexnO_exports).then((t) => d$13(t.t(), 1)).catch(() => null), Sc$1; -} -let wc$1 = null; -async function Tc$1() { - return wc$1 ||= Cc$1().then((e) => e ? e.trace.getTracer(`workflow`) : null), wc$1; -} -async function Ec$1(e, ...t) { - let [n, r] = await Promise.all([Tc$1(), Cc$1()]), { fn: i, opts: a } = typeof t[0] == `function` ? { - fn: t[0], - opts: {} - } : { - fn: t[1], - opts: t[0] - }; - if (!i) throw Error(`Function to trace must be provided`); - return !n || !r ? await i() : n.startActiveSpan(e, a, async (e) => { - try { - let t = await i(e); - return e.setStatus({ code: r.SpanStatusCode.OK }), t; - } catch (t) { - throw e.setStatus({ - code: r.SpanStatusCode.ERROR, - message: t.message - }), t; - } finally { - e.end(); - } - }); -} -async function Dc$1(e) { - let t = await Cc$1(); - if (t) return t.SpanKind[e]; -} -async function Oc$1(e) { - let t = await Cc$1(); - if (!t) return; - let n = {}; - t.propagation.inject(t.context.active(), n); - for (let [t, r] of Object.entries(n)) e.set(t, r); -} -function kc$1(...e) { - return (t) => Object.fromEntries(e.map((e) => [e, t])); -} -const Ac$1 = kc$1(`http.request.method`); -const jc$1 = kc$1(`url.full`); -const Mc$1 = kc$1(`server.address`); -const Nc$1 = kc$1(`server.port`); -const Pc$1 = kc$1(`http.response.status_code`); -const Fc$1 = kc$1(`error.type`); -const Ic$1 = kc$1(`workflow.world.parse.format`); -const Lc$1 = kc$1(`peer.service`); -const Rc$1 = kc$1(`rpc.system`); -const zc$1 = kc$1(`rpc.service`); -const Bc$1 = kc$1(`rpc.method`); -const Vc$1 = kc$1(`workflow.run.id`); -const Hc$1 = kc$1(`step.id`); -const Uc$1 = { - peerService: `workflow-server`, - rpcSystem: `http`, - rpcService: `workflow-server` -}; -const Wc$1 = { - "world.runs.get": 0, - "world.runs.experimentalSetAttributes": 0, - "world.steps.get": 0, - "world.events.create": 0, - "world.events.get": 0 -}; -const Gc$1 = /* @__PURE__ */ new Set([ - `world.steps.list`, - `world.events.list`, - `world.hooks.list` -]); -function Kc$1(e) { - if (e.length >= 2 && typeof e[1] == `object` && e[1] !== null) { - let t = e[1]; - if (typeof t.eventType == `string`) return t.eventType; - } -} -function qc$1(e, t) { - return typeof e[t] == `string` ? e[t] : void 0; -} -function Jc$1(e) { - if (typeof e != `object` || !e) return; - let t = e.runId; - return typeof t == `string` ? t : void 0; -} -function Yc$1(e) { - if (typeof e != `object` || !e) return; - let t = e; - if (typeof t.runId == `string`) return t.runId; - for (let e of [ - `run`, - `step`, - `hook`, - `wait` - ]) { - let n = t[e]; - if (typeof n == `object` && n) { - let e = n.runId; - if (typeof e == `string`) return e; - } - } -} -function Xc$1(e, t, n) { - let r = `${e}.${t}`, i = {}, a = Wc$1[r], o = a === void 0 ? Gc$1.has(r) ? Jc$1(n[0]) : void 0 : qc$1(n, a); - if (o && Object.assign(i, Vc$1(o)), r === `world.steps.get`) { - let e = qc$1(n, 1); - e && Object.assign(i, Hc$1(e)); - } - return i; -} -function Zc$1(e, t) { - let n = {}; - for (let r of Object.keys(t)) if (typeof t[r] != `function`) n[r] = t[r]; - else { - let i = t[r], a = String(r); - n[r] = async (...t) => { - let n = `${e}.${a}`; - if (e === `world.events` && a === `create`) { - let r = Kc$1(t); - r && (n = `${e}.${a} ${r}`); - } - return Ec$1(n, { kind: await Dc$1(`CLIENT`) }, async (r) => { - r?.setAttributes({ - ...Lc$1(Uc$1.peerService), - ...Rc$1(Uc$1.rpcSystem), - ...zc$1(Uc$1.rpcService), - ...Bc$1(n), - ...Xc$1(e, a, t) - }); - let o = await i(...t), s = Yc$1(o); - return s && r?.setAttributes(Vc$1(s)), o; - }); - }; - } - return n; -} -var Qc$1 = class extends Error { - constructor(e) { - super(e), this.name = `MultipartParseError`; - } -}; -function $c$1(e) { - let t = new TextEncoder().encode(e); - return (e, n = 0) => Buffer.prototype.indexOf.call(e, t, n); -} -function el$1(e) { - let t = new TextEncoder().encode(e), n = {}; - for (let e = 0; e < t.length; ++e) { - let r = t[e]; - n[r] === void 0 && (n[r] = []), n[r].push(e); - } - return function(e) { - let r = e.length - 1; - if (e[r] in n) { - let i = n[e[r]]; - for (let n = i.length - 1; n >= 0; --n) for (let a = i[n], o = r; a >= 0 && e[o] === t[a]; --a, --o) if (a === 0) return o; - } - return -1; - }; -} -function tl$1(e) { - let t = new TextDecoder(`iso-8859-1`).decode(e).trim().split(/\r?\n/), n = []; - for (let e of t) { - let t = e.indexOf(`:`); - if (t > 0) { - let r = e.slice(0, t).trim(), i = e.slice(t + 1).trim(); - n.push([r, i]); - } - } - return new Headers(n); -} -function nl$1(e) { - let t = e.match(/boundary=(?:"([^"]+)"|([^;]+))/i); - if (!t) throw new Qc$1(`No boundary found in Content-Type header`); - return t[1] ?? t[2]; -} -var rl$1 = class { - queue = []; - waiters = []; - finished = !1; - cancelled = !1; - error = null; - enqueue(e) { - this.finished || this.cancelled || (this.waiters.length > 0 ? this.waiters.shift().resolve(e) : this.queue.push(e)); - } - finish(e) { - if (!this.finished) for (this.finished = !0, this.error = e || null; this.waiters.length > 0;) { - let t = this.waiters.shift(); - e ? t.reject(e) : t.resolve(null); - } - } - cancel() { - if (!(this.cancelled || this.finished)) for (this.cancelled = !0; this.waiters.length > 0;) this.waiters.shift().resolve(null); - } - async dequeue() { - if (this.queue.length > 0) return this.queue.shift(); - if (this.finished || this.cancelled) { - if (this.error) throw this.error; - return null; - } - return new Promise((e, t) => { - this.waiters.push({ - resolve: e, - reject: t - }); - }); - } - get isTerminal() { - return this.finished || this.cancelled; - } -}; -async function* il$1(e, t) { - if (!e.body) throw new Qc$1(`Response body is null`); - let n = e.headers.get(`content-type`); - if (!n) throw new Qc$1(`Missing Content-Type header`); - yield* new al$1(nl$1(n), t).parseStream(e.body); -} -var al$1 = class { - boundary; - findOpeningBoundary; - openingBoundaryLength; - findBoundary; - findPartialTailBoundary; - boundaryLength; - findDoubleNewline; - maxHeaderSize; - maxBoundaryBuffer; - state = 0; - buffer = null; - currentHeaders = new Headers(); - currentPayloadController = null; - constructor(e, t = {}) { - this.boundary = e, this.findOpeningBoundary = $c$1(`--${e}`), this.openingBoundaryLength = 2 + e.length, this.findBoundary = $c$1(`\r ---${e}`), this.findPartialTailBoundary = el$1(`\r ---${e}`), this.boundaryLength = 4 + e.length, this.findDoubleNewline = $c$1(`\r -\r -`), this.maxHeaderSize = t.maxHeaderSize ?? 65536, this.maxBoundaryBuffer = t.maxBoundaryBuffer ?? 8192; - } - async *parseStream(e) { - let t = e.getReader(), n = new rl$1(), r = this.startProducer(t, n); - try { - yield* this.consumeMessages(n); - } finally { - n.cancel(), this.closeCurrentPayload(); - try { - await t.cancel(); - } catch {} - await r; - } - } - async startProducer(e, t) { - try { - for (; !t.isTerminal;) { - let n; - try { - n = await e.read(); - } catch (e) { - if (e instanceof Error && (e.name === `AbortError` || e.constructor.name === `AbortError` || e.name === `TimeoutError` || e.constructor.name === `TimeoutError`)) break; - throw e; - } - let { done: r, value: i } = n; - if (r) { - if (this.buffer !== null && this.buffer.length > 0) { - let e = this.write(/* @__PURE__ */ new Uint8Array()); - for (let n of e) { - if (t.isTerminal) break; - t.enqueue(n); - } - } - if (this.state !== 4) throw this.state === 0 ? new Qc$1(`Invalid multipart stream: missing initial boundary`) : new Qc$1(`Unexpected end of stream`); - break; - } - if (!(i instanceof Uint8Array)) throw new Qc$1(`Invalid chunk type: expected Uint8Array, got ${typeof i}`); - let a = this.write(i); - for (let e of a) { - if (t.isTerminal) break; - t.enqueue(e); - } - } - t.isTerminal || t.finish(); - } catch (e) { - this.closeCurrentPayload(e), t.isTerminal || t.finish(e); - } finally { - try { - e.releaseLock(); - } catch {} - } - } - async *consumeMessages(e) { - for (;;) { - let t = await e.dequeue(); - if (t === null) break; - yield t; - } - } - write(e) { - let t = []; - if (this.state === 4) throw new Qc$1(`Unexpected data after end of stream`); - let n = 0, r = e.length; - if (this.buffer !== null) { - let t = this.buffer.length, n = t + r; - if (this.state === 2) { - if (n > this.maxHeaderSize) throw new Qc$1(`Buffer size limit exceeded: ${n} bytes > ${this.maxHeaderSize} bytes. This may indicate malformed multipart data with oversized headers.`); - } else if (t > this.maxBoundaryBuffer) throw new Qc$1(`Boundary buffer limit exceeded: ${t} bytes > ${this.maxBoundaryBuffer} bytes. This may indicate malformed multipart data with invalid boundaries.`); - let i = new Uint8Array(n); - i.set(this.buffer, 0), i.set(e, t), e = i, r = e.length, this.buffer = null; - } - if (r === 0 && this.state === 0) throw new Qc$1(`Invalid multipart stream: missing initial boundary`); - for (;;) { - if (this.state === 3) { - if (r - n < this.boundaryLength) { - let t = e.subarray(n); - if (t.length > this.maxBoundaryBuffer) throw new Qc$1(`Boundary buffer limit exceeded: ${t.length} > ${this.maxBoundaryBuffer}`); - this.buffer = t; - break; - } - let t = this.findBoundary(e, n); - if (t === -1) { - let t = this.findPartialTailBoundary(e); - if (t === -1) this.writeBody(n === 0 ? e : e.subarray(n)); - else { - this.writeBody(e.subarray(n, t)); - let r = e.subarray(t); - if (r.length > this.maxBoundaryBuffer) throw new Qc$1(`Partial boundary too large: ${r.length} > ${this.maxBoundaryBuffer}`); - this.buffer = r; - } - break; - } - this.writeBody(e.subarray(n, t)), this.finishMessage(), n = t + this.boundaryLength, this.state = 1; - } - if (this.state === 1) { - if (r - n < 2) { - let t = e.subarray(n); - if (t.length > this.maxBoundaryBuffer) throw new Qc$1(`After-boundary buffer limit exceeded: ${t.length} > ${this.maxBoundaryBuffer}`); - this.buffer = t; - break; - } - if (e[n] === 45 && e[n + 1] === 45) { - this.state = 4; - break; - } - if (e[n] === 13 && e[n + 1] === 10) n += 2; - else if (e[n] === 10) n += 1; - else throw new Qc$1(`Invalid character after boundary: expected CRLF or LF, got 0x${e[n].toString(16)}`); - this.state = 2; - } - if (this.state === 2) { - if (r - n < 4) { - let t = e.subarray(n); - if (t.length > this.maxHeaderSize) throw new Qc$1(`Header buffer limit exceeded: ${t.length} > ${this.maxHeaderSize}`); - this.buffer = t; - break; - } - let i = this.findDoubleNewline(e, n), a = 4; - if (i === -1 && (i = $c$1(` - -`)(e, n), a = 2), i === -1) { - let t = e.subarray(n); - if (t.length > this.maxHeaderSize) throw new Qc$1(`Headers too large: ${t.length} > ${this.maxHeaderSize} bytes`); - this.buffer = t; - break; - } - let o = e.subarray(n, i); - this.currentHeaders = tl$1(o); - let s = this.createStreamingMessage(); - t.push(s), n = i + a, this.state = 3; - continue; - } - if (this.state === 0) { - if (r < this.openingBoundaryLength) { - if (e.length > this.maxBoundaryBuffer) throw new Qc$1(`Initial chunk too large for boundary detection: ${e.length} > ${this.maxBoundaryBuffer}`); - this.buffer = e; - break; - } - if (this.findOpeningBoundary(e) !== 0) throw new Qc$1(`Invalid multipart stream: missing initial boundary`); - n = this.openingBoundaryLength, this.state = 1; - } - } - return t; - } - createStreamingMessage() { - let e = new Headers(this.currentHeaders), t = new ReadableStream({ start: (e) => { - this.currentPayloadController = e; - } }); - return this.currentHeaders = new Headers(), { - headers: e, - payload: t - }; - } - writeBody(e) { - this.currentPayloadController && this.currentPayloadController.enqueue(e); - } - finishMessage() { - this.currentPayloadController &&= (this.currentPayloadController.close(), null); - } - closeCurrentPayload(e) { - if (this.currentPayloadController) { - try { - e ? this.currentPayloadController.error(e) : this.currentPayloadController.close(); - } catch {} - this.currentPayloadController = null; - } - } -}; -const ol$1 = (e, t, n) => { - let r = e instanceof RegExp ? sl$1(e, n) : e, i = t instanceof RegExp ? sl$1(t, n) : t, a = r !== null && i != null && cl$1(r, i, n); - return a && { - start: a[0], - end: a[1], - pre: n.slice(0, a[0]), - body: n.slice(a[0] + r.length, a[1]), - post: n.slice(a[1] + i.length) - }; -}; -const sl$1 = (e, t) => { - let n = t.match(e); - return n ? n[0] : null; -}; -const cl$1 = (e, t, n) => { - let r, i, a, o, s, c = n.indexOf(e), l = n.indexOf(t, c + 1), u = c; - if (c >= 0 && l > 0) { - if (e === t) return [c, l]; - for (r = [], a = n.length; u >= 0 && !s;) { - if (u === c) r.push(u), c = n.indexOf(e, u + 1); - else if (r.length === 1) { - let e = r.pop(); - e !== void 0 && (s = [e, l]); - } else i = r.pop(), i !== void 0 && i < a && (a = i, o = l), l = n.indexOf(t, u + 1); - u = c < l && c >= 0 ? c : l; - } - r.length && o !== void 0 && (s = [a, o]); - } - return s; -}; -const ll$1 = `\0SLASH` + Math.random() + `\0`; -const ul$1 = `\0OPEN` + Math.random() + `\0`; -const dl$1 = `\0CLOSE` + Math.random() + `\0`; -const fl$1 = `\0COMMA` + Math.random() + `\0`; -const pl$1 = `\0PERIOD` + Math.random() + `\0`; -const ml$1 = new RegExp(ll$1, `g`); -const hl$1 = new RegExp(ul$1, `g`); -const gl$1 = new RegExp(dl$1, `g`); -const _l$1 = new RegExp(fl$1, `g`); -const vl$1 = new RegExp(pl$1, `g`); -const yl$1 = /\\\\/g; -const bl$1 = /\\{/g; -const xl$1 = /\\}/g; -const Sl$1 = /\\,/g; -const Cl$1 = /\\\./g; -function wl$1(e) { - return isNaN(e) ? e.charCodeAt(0) : parseInt(e, 10); -} -function Tl$1(e) { - return e.replace(yl$1, ll$1).replace(bl$1, ul$1).replace(xl$1, dl$1).replace(Sl$1, fl$1).replace(Cl$1, pl$1); -} -function El$1(e) { - return e.replace(ml$1, `\\`).replace(hl$1, `{`).replace(gl$1, `}`).replace(_l$1, `,`).replace(vl$1, `.`); -} -function Dl$1(e) { - if (!e) return [``]; - let t = [], n = ol$1(`{`, `}`, e); - if (!n) return e.split(`,`); - let { pre: r, body: i, post: a } = n, o = r.split(`,`); - o[o.length - 1] += `{` + i + `}`; - let s = Dl$1(a); - return a.length && (o[o.length - 1] += s.shift(), o.push.apply(o, s)), t.push.apply(t, o), t; -} -function Ol$1(e, t = {}) { - if (!e) return []; - let { max: n = 1e5 } = t; - return e.slice(0, 2) === `{}` && (e = `\\{\\}` + e.slice(2)), Nl$1(Tl$1(e), n, !0).map(El$1); -} -function kl$1(e) { - return `{` + e + `}`; -} -function Al$1(e) { - return /^-?0\d/.test(e); -} -function jl$1(e, t) { - return e <= t; -} -function Ml$1(e, t) { - return e >= t; -} -function Nl$1(e, t, n) { - let r = [], i = ol$1(`{`, `}`, e); - if (!i) return [e]; - let a = i.pre, o = i.post.length ? Nl$1(i.post, t, !1) : [``]; - if (/\$$/.test(i.pre)) for (let e = 0; e < o.length && e < t; e++) { - let t = a + `{` + i.body + `}` + o[e]; - r.push(t); - } - else { - let s = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i.body), c = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i.body), l = s || c, u = i.body.indexOf(`,`) >= 0; - if (!l && !u) return i.post.match(/,(?!,).*\}/) ? (e = i.pre + `{` + i.body + dl$1 + i.post, Nl$1(e, t, !0)) : [e]; - let d; - if (l) d = i.body.split(/\.\./); - else if (d = Dl$1(i.body), d.length === 1 && d[0] !== void 0 && (d = Nl$1(d[0], t, !1).map(kl$1), d.length === 1)) return o.map((e) => i.pre + d[0] + e); - let f; - if (l && d[0] !== void 0 && d[1] !== void 0) { - let e = wl$1(d[0]), n = wl$1(d[1]), r = Math.max(d[0].length, d[1].length), i = d.length === 3 && d[2] !== void 0 ? Math.max(Math.abs(wl$1(d[2])), 1) : 1, a = jl$1; - n < e && (i *= -1, a = Ml$1); - let o = d.some(Al$1); - f = []; - for (let s = e; a(s, n) && f.length < t; s += i) { - let e; - if (c) e = String.fromCharCode(s), e === `\\` && (e = ``); - else if (e = String(s), o) { - let t = r - e.length; - if (t > 0) { - let n = Array(t + 1).join(`0`); - e = s < 0 ? `-` + n + e.slice(1) : n + e; - } - } - f.push(e); - } - } else { - f = []; - for (let e = 0; e < d.length; e++) f.push.apply(f, Nl$1(d[e], t, !1)); - } - for (let e = 0; e < f.length; e++) for (let i = 0; i < o.length && r.length < t; i++) { - let t = a + f[e] + o[i]; - (!n || l || t) && r.push(t); - } - } - return r; -} -const Pl$1 = (e) => { - if (typeof e != `string`) throw TypeError(`invalid pattern`); - if (e.length > 65536) throw TypeError(`pattern is too long`); -}; -const Fl$1 = { - "[:alnum:]": [`\\p{L}\\p{Nl}\\p{Nd}`, !0], - "[:alpha:]": [`\\p{L}\\p{Nl}`, !0], - "[:ascii:]": [`\\x00-\\x7f`, !1], - "[:blank:]": [`\\p{Zs}\\t`, !0], - "[:cntrl:]": [`\\p{Cc}`, !0], - "[:digit:]": [`\\p{Nd}`, !0], - "[:graph:]": [ - `\\p{Z}\\p{C}`, - !0, - !0 - ], - "[:lower:]": [`\\p{Ll}`, !0], - "[:print:]": [`\\p{C}`, !0], - "[:punct:]": [`\\p{P}`, !0], - "[:space:]": [`\\p{Z}\\t\\r\\n\\v\\f`, !0], - "[:upper:]": [`\\p{Lu}`, !0], - "[:word:]": [`\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}`, !0], - "[:xdigit:]": [`A-Fa-f0-9`, !1] -}; -const Il$1 = (e) => e.replace(/[[\]\\-]/g, `\\$&`); -const Ll$1 = (e) => e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, `\\$&`); -const Rl$1 = (e) => e.join(``); -const zl$1 = (e, t) => { - let n = t; - if (e.charAt(n) !== `[`) throw Error(`not in a brace expression`); - let r = [], i = [], a = n + 1, o = !1, s = !1, c = !1, l = !1, u = n, d = ``; - WHILE: for (; a < e.length;) { - let t = e.charAt(a); - if ((t === `!` || t === `^`) && a === n + 1) { - l = !0, a++; - continue; - } - if (t === `]` && o && !c) { - u = a + 1; - break; - } - if (o = !0, t === `\\` && !c) { - c = !0, a++; - continue; - } - if (t === `[` && !c) { - for (let [t, [o, c, l]] of Object.entries(Fl$1)) if (e.startsWith(t, a)) { - if (d) return [ - `$.`, - !1, - e.length - n, - !0 - ]; - a += t.length, l ? i.push(o) : r.push(o), s ||= c; - continue WHILE; - } - } - if (c = !1, d) { - t > d ? r.push(Il$1(d) + `-` + Il$1(t)) : t === d && r.push(Il$1(t)), d = ``, a++; - continue; - } - if (e.startsWith(`-]`, a + 1)) { - r.push(Il$1(t + `-`)), a += 2; - continue; - } - if (e.startsWith(`-`, a + 1)) { - d = t, a += 2; - continue; - } - r.push(Il$1(t)), a++; - } - if (u < a) return [ - ``, - !1, - 0, - !1 - ]; - if (!r.length && !i.length) return [ - `$.`, - !1, - e.length - n, - !0 - ]; - if (i.length === 0 && r.length === 1 && /^\\?.$/.test(r[0]) && !l) return [ - Ll$1(r[0].length === 2 ? r[0].slice(-1) : r[0]), - !1, - u - n, - !1 - ]; - let f = `[` + (l ? `^` : ``) + Rl$1(r) + `]`, p = `[` + (l ? `` : `^`) + Rl$1(i) + `]`; - return [ - r.length && i.length ? `(` + f + `|` + p + `)` : r.length ? f : p, - s, - u - n, - !0 - ]; -}; -const Bl$1 = (e, { windowsPathsNoEscape: t = !1, magicalBraces: n = !0 } = {}) => n ? t ? e.replace(/\[([^/\\])\]/g, `$1`) : e.replace(/((?!\\).|^)\[([^/\\])\]/g, `$1$2`).replace(/\\([^/])/g, `$1`) : t ? e.replace(/\[([^/\\{}])\]/g, `$1`) : e.replace(/((?!\\).|^)\[([^/\\{}])\]/g, `$1$2`).replace(/\\([^/{}])/g, `$1`); -var Vl$1; -const Hl$1 = /* @__PURE__ */ new Set([ - `!`, - `?`, - `+`, - `*`, - `@` -]); -const Ul$1 = (e) => Hl$1.has(e); -const Wl$1 = (e) => Ul$1(e.type); -const Gl$1 = /* @__PURE__ */ new Map([ - [`!`, [`@`]], - [`?`, [`?`, `@`]], - [`@`, [`@`]], - [`*`, [ - `*`, - `+`, - `?`, - `@` - ]], - [`+`, [`+`, `@`]] -]); -const Kl$1 = /* @__PURE__ */ new Map([ - [`!`, [`?`]], - [`@`, [`?`]], - [`+`, [`?`, `*`]] -]); -const ql$1 = /* @__PURE__ */ new Map([ - [`!`, [`?`, `@`]], - [`?`, [`?`, `@`]], - [`@`, [`?`, `@`]], - [`*`, [ - `*`, - `+`, - `?`, - `@` - ]], - [`+`, [ - `+`, - `@`, - `?`, - `*` - ]] -]); -const Jl$1 = /* @__PURE__ */ new Map([ - [`!`, /* @__PURE__ */ new Map([[`!`, `@`]])], - [`?`, /* @__PURE__ */ new Map([[`*`, `*`], [`+`, `*`]])], - [`@`, /* @__PURE__ */ new Map([ - [`!`, `!`], - [`?`, `?`], - [`@`, `@`], - [`*`, `*`], - [`+`, `+`] - ])], - [`+`, /* @__PURE__ */ new Map([[`?`, `*`], [`*`, `*`]])] -]); -const Yl$1 = `(?!\\.)`; -const Xl$1 = /* @__PURE__ */ new Set([`[`, `.`]); -const Zl$1 = /* @__PURE__ */ new Set([`..`, `.`]); -const Ql$1 = /* @__PURE__ */ new Set(`().*{}+?[]^$\\!`); -const $l$1 = (e) => e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, `\\$&`); -const eu$1 = `[^/]+?`; -let tu$1 = 0; -var nu$1 = class { - type; - #e; - #t; - #n = !1; - #r = []; - #i; - #a; - #o; - #s = !1; - #c; - #l; - #u = !1; - id = ++tu$1; - get depth() { - return (this.#i?.depth ?? -1) + 1; - } - [Symbol.for(`nodejs.util.inspect.custom`)]() { - return { - "@@type": `AST`, - id: this.id, - type: this.type, - root: this.#e.id, - parent: this.#i?.id, - depth: this.depth, - partsLength: this.#r.length, - parts: this.#r - }; - } - constructor(e, t, n = {}) { - this.type = e, e && (this.#t = !0), this.#i = t, this.#e = this.#i ? this.#i.#e : this, this.#c = this.#e === this ? n : this.#e.#c, this.#o = this.#e === this ? [] : this.#e.#o, e === `!` && !this.#e.#s && this.#o.push(this), this.#a = this.#i ? this.#i.#r.length : 0; - } - get hasMagic() { - if (this.#t !== void 0) return this.#t; - for (let e of this.#r) if (typeof e != `string` && (e.type || e.hasMagic)) return this.#t = !0; - return this.#t; - } - toString() { - return this.#l === void 0 ? this.type ? this.#l = this.type + `(` + this.#r.map((e) => String(e)).join(`|`) + `)` : this.#l = this.#r.map((e) => String(e)).join(``) : this.#l; - } - #d() { - if (this !== this.#e) throw Error(`should only call on root`); - if (this.#s) return this; - this.toString(), this.#s = !0; - let e; - for (; e = this.#o.pop();) { - if (e.type !== `!`) continue; - let t = e, n = t.#i; - for (; n;) { - for (let r = t.#a + 1; !n.type && r < n.#r.length; r++) for (let t of e.#r) { - if (typeof t == `string`) throw Error(`string part in extglob AST??`); - t.copyIn(n.#r[r]); - } - t = n, n = t.#i; - } - } - return this; - } - push(...e) { - for (let t of e) if (t !== ``) { - if (typeof t != `string` && !(t instanceof Vl$1 && t.#i === this)) throw Error(`invalid part: ` + t); - this.#r.push(t); - } - } - toJSON() { - let e = this.type === null ? this.#r.slice().map((e) => typeof e == `string` ? e : e.toJSON()) : [this.type, ...this.#r.map((e) => e.toJSON())]; - return this.isStart() && !this.type && e.unshift([]), this.isEnd() && (this === this.#e || this.#e.#s && this.#i?.type === `!`) && e.push({}), e; - } - isStart() { - if (this.#e === this) return !0; - if (!this.#i?.isStart()) return !1; - if (this.#a === 0) return !0; - let e = this.#i; - for (let t = 0; t < this.#a; t++) { - let n = e.#r[t]; - if (!(n instanceof Vl$1 && n.type === `!`)) return !1; - } - return !0; - } - isEnd() { - if (this.#e === this || this.#i?.type === `!`) return !0; - if (!this.#i?.isEnd()) return !1; - if (!this.type) return this.#i?.isEnd(); - let e = this.#i ? this.#i.#r.length : 0; - return this.#a === e - 1; - } - copyIn(e) { - typeof e == `string` ? this.push(e) : this.push(e.clone(this)); - } - clone(e) { - let t = new Vl$1(this.type, e); - for (let e of this.#r) t.copyIn(e); - return t; - } - static #f(e, t, n, r, i) { - let a = r.maxExtglobRecursion ?? 2, o = !1, s = !1, c = -1, l = !1; - if (t.type === null) { - let u = n, d = ``; - for (; u < e.length;) { - let n = e.charAt(u++); - if (o || n === `\\`) { - o = !o, d += n; - continue; - } - if (s) { - u === c + 1 ? (n === `^` || n === `!`) && (l = !0) : n === `]` && !(u === c + 2 && l) && (s = !1), d += n; - continue; - } else if (n === `[`) { - s = !0, c = u, l = !1, d += n; - continue; - } - if (!r.noext && Ul$1(n) && e.charAt(u) === `(` && i <= a) { - t.push(d), d = ``; - let a = new Vl$1(n, t); - u = Vl$1.#f(e, a, u, r, i + 1), t.push(a); - continue; - } - d += n; - } - return t.push(d), u; - } - let u = n + 1, d = new Vl$1(null, t), f = [], p = ``; - for (; u < e.length;) { - let n = e.charAt(u++); - if (o || n === `\\`) { - o = !o, p += n; - continue; - } - if (s) { - u === c + 1 ? (n === `^` || n === `!`) && (l = !0) : n === `]` && !(u === c + 2 && l) && (s = !1), p += n; - continue; - } else if (n === `[`) { - s = !0, c = u, l = !1, p += n; - continue; - } - if (!r.noext && Ul$1(n) && e.charAt(u) === `(` && (i <= a || t && t.#h(n))) { - let a = t && t.#h(n) ? 0 : 1; - d.push(p), p = ``; - let o = new Vl$1(n, d); - d.push(o), u = Vl$1.#f(e, o, u, r, i + a); - continue; - } - if (n === `|`) { - d.push(p), p = ``, f.push(d), d = new Vl$1(null, t); - continue; - } - if (n === `)`) return p === `` && t.#r.length === 0 && (t.#u = !0), d.push(p), p = ``, t.push(...f, d), u; - p += n; - } - return t.type = null, t.#t = void 0, t.#r = [e.substring(n - 1)], u; - } - #p(e) { - return this.#m(e, Kl$1); - } - #m(e, t = Gl$1) { - if (!e || typeof e != `object` || e.type !== null || e.#r.length !== 1 || this.type === null) return !1; - let n = e.#r[0]; - return !n || typeof n != `object` || n.type === null ? !1 : this.#h(n.type, t); - } - #h(e, t = ql$1) { - return !!t.get(this.type)?.includes(e); - } - #g(e, t) { - let n = e.#r[0], r = new Vl$1(null, n, this.options); - r.#r.push(``), n.push(r), this.#_(e, t); - } - #_(e, t) { - let n = e.#r[0]; - this.#r.splice(t, 1, ...n.#r); - for (let e of n.#r) typeof e == `object` && (e.#i = this); - this.#l = void 0; - } - #v(e) { - return !!Jl$1.get(this.type)?.has(e); - } - #y(e) { - if (!e || typeof e != `object` || e.type !== null || e.#r.length !== 1 || this.type === null || this.#r.length !== 1) return !1; - let t = e.#r[0]; - return !t || typeof t != `object` || t.type === null ? !1 : this.#v(t.type); - } - #b(e) { - let t = Jl$1.get(this.type), n = e.#r[0], r = t?.get(n.type); - if (!r) return !1; - this.#r = n.#r; - for (let e of this.#r) typeof e == `object` && (e.#i = this); - this.type = r, this.#l = void 0, this.#u = !1; - } - static fromGlob(e, t = {}) { - let n = new Vl$1(null, void 0, t); - return Vl$1.#f(e, n, 0, t, 0), n; - } - toMMPattern() { - if (this !== this.#e) return this.#e.toMMPattern(); - let e = this.toString(), [t, n, r, i] = this.toRegExpSource(); - if (!(r || this.#t || this.#c.nocase && !this.#c.nocaseMagicOnly && e.toUpperCase() !== e.toLowerCase())) return n; - let a = (this.#c.nocase ? `i` : ``) + (i ? `u` : ``); - return Object.assign(RegExp(`^${t}$`, a), { - _src: t, - _glob: e - }); - } - get options() { - return this.#c; - } - toRegExpSource(e) { - let t = e ?? !!this.#c.dot; - if (this.#e === this && (this.#x(), this.#d()), !Wl$1(this)) { - let n = this.isStart() && this.isEnd() && !this.#r.some((e) => typeof e != `string`), r = this.#r.map((t) => { - let [r, i, a, o] = typeof t == `string` ? Vl$1.#C(t, this.#t, n) : t.toRegExpSource(e); - return this.#t = this.#t || a, this.#n = this.#n || o, r; - }).join(``), i = ``; - if (this.isStart() && typeof this.#r[0] == `string` && !(this.#r.length === 1 && Zl$1.has(this.#r[0]))) { - let n = Xl$1, a = t && n.has(r.charAt(0)) || r.startsWith(`\\.`) && n.has(r.charAt(2)) || r.startsWith(`\\.\\.`) && n.has(r.charAt(4)), o = !t && !e && n.has(r.charAt(0)); - i = a ? `(?!(?:^|/)\\.\\.?(?:$|/))` : o ? Yl$1 : ``; - } - let a = ``; - return this.isEnd() && this.#e.#s && this.#i?.type === `!` && (a = `(?:$|\\/)`), [ - i + r + a, - Bl$1(r), - this.#t = !!this.#t, - this.#n - ]; - } - let n = this.type === `*` || this.type === `+`, r = this.type === `!` ? `(?:(?!(?:` : `(?:`, i = this.#S(t); - if (this.isStart() && this.isEnd() && !i && this.type !== `!`) { - let e = this.toString(), t = this; - return t.#r = [e], t.type = null, t.#t = void 0, [ - e, - Bl$1(this.toString()), - !1, - !1 - ]; - } - let a = !n || e || t ? `` : this.#S(!0); - a === i && (a = ``), a && (i = `(?:${i})(?:${a})*?`); - let o = ``; - if (this.type === `!` && this.#u) o = (this.isStart() && !t ? Yl$1 : ``) + eu$1; - else { - let n = this.type === `!` ? `))` + (this.isStart() && !t && !e ? Yl$1 : ``) + `[^/]*?)` : this.type === `@` ? `)` : this.type === `?` ? `)?` : this.type === `+` && a ? `)` : this.type === `*` && a ? `)?` : `)${this.type}`; - o = r + i + n; - } - return [ - o, - Bl$1(i), - this.#t = !!this.#t, - this.#n - ]; - } - #x() { - if (Wl$1(this)) { - let e = 0, t = !1; - do { - t = !0; - for (let e = 0; e < this.#r.length; e++) { - let n = this.#r[e]; - typeof n == `object` && (n.#x(), this.#m(n) ? (t = !1, this.#_(n, e)) : this.#p(n) ? (t = !1, this.#g(n, e)) : this.#y(n) && (t = !1, this.#b(n))); - } - } while (!t && ++e < 10); - } else for (let e of this.#r) typeof e == `object` && e.#x(); - this.#l = void 0; - } - #S(e) { - return this.#r.map((t) => { - if (typeof t == `string`) throw Error(`string type in extglob ast??`); - let [n, r, i, a] = t.toRegExpSource(e); - return this.#n = this.#n || a, n; - }).filter((e) => !(this.isStart() && this.isEnd()) || !!e).join(`|`); - } - static #C(e, t, n = !1) { - let r = !1, i = ``, a = !1, o = !1; - for (let s = 0; s < e.length; s++) { - let c = e.charAt(s); - if (r) { - r = !1, i += (Ql$1.has(c) ? `\\` : ``) + c; - continue; - } - if (c === `*`) { - if (o) continue; - o = !0, i += n && /^[*]+$/.test(e) ? eu$1 : `[^/]*?`, t = !0; - continue; - } else o = !1; - if (c === `\\`) { - s === e.length - 1 ? i += `\\\\` : r = !0; - continue; - } - if (c === `[`) { - let [n, r, o, c] = zl$1(e, s); - if (o) { - i += n, a ||= r, s += o - 1, t ||= c; - continue; - } - } - if (c === `?`) { - i += `[^/]`, t = !0; - continue; - } - i += $l$1(c); - } - return [ - i, - Bl$1(e), - !!t, - a - ]; - } -}; -Vl$1 = nu$1; -const ru$1 = (e, { windowsPathsNoEscape: t = !1, magicalBraces: n = !1 } = {}) => n ? t ? e.replace(/[?*()[\]{}]/g, `[$&]`) : e.replace(/[?*()[\]\\{}]/g, `\\$&`) : t ? e.replace(/[?*()[\]]/g, `[$&]`) : e.replace(/[?*()[\]\\]/g, `\\$&`); -const iu$1 = (e, t, n = {}) => (Pl$1(t), !n.nocomment && t.charAt(0) === `#` ? !1 : new Mu$1(t, n).match(e)); -const au$1 = /^\*+([^+@!?*[(]*)$/; -const ou$1 = (e) => (t) => !t.startsWith(`.`) && t.endsWith(e); -const su$1 = (e) => (t) => t.endsWith(e); -const cu$1 = (e) => (e = e.toLowerCase(), (t) => !t.startsWith(`.`) && t.toLowerCase().endsWith(e)); -const lu$1 = (e) => (e = e.toLowerCase(), (t) => t.toLowerCase().endsWith(e)); -const uu$1 = /^\*+\.\*+$/; -const du$1 = (e) => !e.startsWith(`.`) && e.includes(`.`); -const fu$1 = (e) => e !== `.` && e !== `..` && e.includes(`.`); -const pu$1 = /^\.\*+$/; -const mu$1 = (e) => e !== `.` && e !== `..` && e.startsWith(`.`); -const hu$1 = /^\*+$/; -const gu$1 = (e) => e.length !== 0 && !e.startsWith(`.`); -const _u$1 = (e) => e.length !== 0 && e !== `.` && e !== `..`; -const vu$1 = /^\?+([^+@!?*[(]*)?$/; -const yu$1 = ([e, t = ``]) => { - let n = Cu$1([e]); - return t ? (t = t.toLowerCase(), (e) => n(e) && e.toLowerCase().endsWith(t)) : n; -}; -const bu$1 = ([e, t = ``]) => { - let n = wu$1([e]); - return t ? (t = t.toLowerCase(), (e) => n(e) && e.toLowerCase().endsWith(t)) : n; -}; -const xu$1 = ([e, t = ``]) => { - let n = wu$1([e]); - return t ? (e) => n(e) && e.endsWith(t) : n; -}; -const Su$1 = ([e, t = ``]) => { - let n = Cu$1([e]); - return t ? (e) => n(e) && e.endsWith(t) : n; -}; -const Cu$1 = ([e]) => { - let t = e.length; - return (e) => e.length === t && !e.startsWith(`.`); -}; -const wu$1 = ([e]) => { - let t = e.length; - return (e) => e.length === t && e !== `.` && e !== `..`; -}; -const Tu$1 = typeof process == `object` && process ? typeof process.env == `object` && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : `posix`; -const Eu$1 = { - win32: { sep: `\\` }, - posix: { sep: `/` } -}; -iu$1.sep = Tu$1 === `win32` ? Eu$1.win32.sep : Eu$1.posix.sep; -const Du$1 = Symbol(`globstar **`); -iu$1.GLOBSTAR = Du$1, iu$1.filter = (e, t = {}) => (n) => iu$1(n, e, t); -const Ou$1 = (e, t = {}) => Object.assign({}, e, t); -iu$1.defaults = (e) => { - if (!e || typeof e != `object` || !Object.keys(e).length) return iu$1; - let t = iu$1; - return Object.assign((n, r, i = {}) => t(n, r, Ou$1(e, i)), { - Minimatch: class extends t.Minimatch { - constructor(t, n = {}) { - super(t, Ou$1(e, n)); - } - static defaults(n) { - return t.defaults(Ou$1(e, n)).Minimatch; - } - }, - AST: class extends t.AST { - constructor(t, n, r = {}) { - super(t, n, Ou$1(e, r)); - } - static fromGlob(n, r = {}) { - return t.AST.fromGlob(n, Ou$1(e, r)); - } - }, - unescape: (n, r = {}) => t.unescape(n, Ou$1(e, r)), - escape: (n, r = {}) => t.escape(n, Ou$1(e, r)), - filter: (n, r = {}) => t.filter(n, Ou$1(e, r)), - defaults: (n) => t.defaults(Ou$1(e, n)), - makeRe: (n, r = {}) => t.makeRe(n, Ou$1(e, r)), - braceExpand: (n, r = {}) => t.braceExpand(n, Ou$1(e, r)), - match: (n, r, i = {}) => t.match(n, r, Ou$1(e, i)), - sep: t.sep, - GLOBSTAR: Du$1 - }); -}; -const ku$1 = (e, t = {}) => (Pl$1(e), t.nobrace || !/\{(?:(?!\{).)*\}/.test(e) ? [e] : Ol$1(e, { max: t.braceExpandMax })); -iu$1.braceExpand = ku$1, iu$1.makeRe = (e, t = {}) => new Mu$1(e, t).makeRe(), iu$1.match = (e, t, n = {}) => { - let r = new Mu$1(t, n); - return e = e.filter((e) => r.match(e)), r.options.nonull && !e.length && e.push(t), e; -}; -const Au$1 = /[?*]|[+@!]\(.*?\)|\[|\]/; -const ju$1 = (e) => e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, `\\$&`); -var Mu$1 = class { - options; - set; - pattern; - windowsPathsNoEscape; - nonegate; - negate; - comment; - empty; - preserveMultipleSlashes; - partial; - globSet; - globParts; - nocase; - isWindows; - platform; - windowsNoMagicRoot; - maxGlobstarRecursion; - regexp; - constructor(e, t = {}) { - Pl$1(e), t ||= {}, this.options = t, this.maxGlobstarRecursion = t.maxGlobstarRecursion ?? 200, this.pattern = e, this.platform = t.platform || Tu$1, this.isWindows = this.platform === `win32`, this.windowsPathsNoEscape = !!t.windowsPathsNoEscape || t.allowWindowsEscape === !1, this.windowsPathsNoEscape && (this.pattern = this.pattern.replace(/\\/g, `/`)), this.preserveMultipleSlashes = !!t.preserveMultipleSlashes, this.regexp = null, this.negate = !1, this.nonegate = !!t.nonegate, this.comment = !1, this.empty = !1, this.partial = !!t.partial, this.nocase = !!this.options.nocase, this.windowsNoMagicRoot = t.windowsNoMagicRoot === void 0 ? !!(this.isWindows && this.nocase) : t.windowsNoMagicRoot, this.globSet = [], this.globParts = [], this.set = [], this.make(); - } - hasMagic() { - if (this.options.magicalBraces && this.set.length > 1) return !0; - for (let e of this.set) for (let t of e) if (typeof t != `string`) return !0; - return !1; - } - debug(...e) {} - make() { - let e = this.pattern, t = this.options; - if (!t.nocomment && e.charAt(0) === `#`) { - this.comment = !0; - return; - } - if (!e) { - this.empty = !0; - return; - } - this.parseNegate(), this.globSet = [...new Set(this.braceExpand())], t.debug && (this.debug = (...e) => console.error(...e)), this.debug(this.pattern, this.globSet); - let n = this.globSet.map((e) => this.slashSplit(e)); - this.globParts = this.preprocess(n), this.debug(this.pattern, this.globParts); - let r = this.globParts.map((e, t, n) => { - if (this.isWindows && this.windowsNoMagicRoot) { - let t = e[0] === `` && e[1] === `` && (e[2] === `?` || !Au$1.test(e[2])) && !Au$1.test(e[3]), n = /^[a-z]:/i.test(e[0]); - if (t) return [...e.slice(0, 4), ...e.slice(4).map((e) => this.parse(e))]; - if (n) return [e[0], ...e.slice(1).map((e) => this.parse(e))]; - } - return e.map((e) => this.parse(e)); - }); - if (this.debug(this.pattern, r), this.set = r.filter((e) => e.indexOf(!1) === -1), this.isWindows) for (let e = 0; e < this.set.length; e++) { - let t = this.set[e]; - t[0] === `` && t[1] === `` && this.globParts[e][2] === `?` && typeof t[3] == `string` && /^[a-z]:$/i.test(t[3]) && (t[2] = `?`); - } - this.debug(this.pattern, this.set); - } - preprocess(e) { - if (this.options.noglobstar) for (let t of e) for (let e = 0; e < t.length; e++) t[e] === `**` && (t[e] = `*`); - let { optimizationLevel: t = 1 } = this.options; - return t >= 2 ? (e = this.firstPhasePreProcess(e), e = this.secondPhasePreProcess(e)) : e = t >= 1 ? this.levelOneOptimize(e) : this.adjascentGlobstarOptimize(e), e; - } - adjascentGlobstarOptimize(e) { - return e.map((e) => { - let t = -1; - for (; (t = e.indexOf(`**`, t + 1)) !== -1;) { - let n = t; - for (; e[n + 1] === `**`;) n++; - n !== t && e.splice(t, n - t); - } - return e; - }); - } - levelOneOptimize(e) { - return e.map((e) => (e = e.reduce((e, t) => { - let n = e[e.length - 1]; - return t === `**` && n === `**` ? e : t === `..` && n && n !== `..` && n !== `.` && n !== `**` ? (e.pop(), e) : (e.push(t), e); - }, []), e.length === 0 ? [``] : e)); - } - levelTwoFileOptimize(e) { - Array.isArray(e) || (e = this.slashSplit(e)); - let t = !1; - do { - if (t = !1, !this.preserveMultipleSlashes) { - for (let n = 1; n < e.length - 1; n++) { - let r = e[n]; - n === 1 && r === `` && e[0] === `` || (r === `.` || r === ``) && (t = !0, e.splice(n, 1), n--); - } - e[0] === `.` && e.length === 2 && (e[1] === `.` || e[1] === ``) && (t = !0, e.pop()); - } - let n = 0; - for (; (n = e.indexOf(`..`, n + 1)) !== -1;) { - let r = e[n - 1]; - r && r !== `.` && r !== `..` && r !== `**` && !(this.isWindows && /^[a-z]:$/i.test(r)) && (t = !0, e.splice(n - 1, 2), n -= 2); - } - } while (t); - return e.length === 0 ? [``] : e; - } - firstPhasePreProcess(e) { - let t = !1; - do { - t = !1; - for (let n of e) { - let r = -1; - for (; (r = n.indexOf(`**`, r + 1)) !== -1;) { - let i = r; - for (; n[i + 1] === `**`;) i++; - i > r && n.splice(r + 1, i - r); - let a = n[r + 1], o = n[r + 2], s = n[r + 3]; - if (a !== `..` || !o || o === `.` || o === `..` || !s || s === `.` || s === `..`) continue; - t = !0, n.splice(r, 1); - let c = n.slice(0); - c[r] = `**`, e.push(c), r--; - } - if (!this.preserveMultipleSlashes) { - for (let e = 1; e < n.length - 1; e++) { - let r = n[e]; - e === 1 && r === `` && n[0] === `` || (r === `.` || r === ``) && (t = !0, n.splice(e, 1), e--); - } - n[0] === `.` && n.length === 2 && (n[1] === `.` || n[1] === ``) && (t = !0, n.pop()); - } - let i = 0; - for (; (i = n.indexOf(`..`, i + 1)) !== -1;) { - let e = n[i - 1]; - if (e && e !== `.` && e !== `..` && e !== `**`) { - t = !0; - let e = i === 1 && n[i + 1] === `**` ? [`.`] : []; - n.splice(i - 1, 2, ...e), n.length === 0 && n.push(``), i -= 2; - } - } - } - } while (t); - return e; - } - secondPhasePreProcess(e) { - for (let t = 0; t < e.length - 1; t++) for (let n = t + 1; n < e.length; n++) { - let r = this.partsMatch(e[t], e[n], !this.preserveMultipleSlashes); - if (r) { - e[t] = [], e[n] = r; - break; - } - } - return e.filter((e) => e.length); - } - partsMatch(e, t, n = !1) { - let r = 0, i = 0, a = [], o = ``; - for (; r < e.length && i < t.length;) if (e[r] === t[i]) a.push(o === `b` ? t[i] : e[r]), r++, i++; - else if (n && e[r] === `**` && t[i] === e[r + 1]) a.push(e[r]), r++; - else if (n && t[i] === `**` && e[r] === t[i + 1]) a.push(t[i]), i++; - else if (e[r] === `*` && t[i] && (this.options.dot || !t[i].startsWith(`.`)) && t[i] !== `**`) { - if (o === `b`) return !1; - o = `a`, a.push(e[r]), r++, i++; - } else if (t[i] === `*` && e[r] && (this.options.dot || !e[r].startsWith(`.`)) && e[r] !== `**`) { - if (o === `a`) return !1; - o = `b`, a.push(t[i]), r++, i++; - } else return !1; - return e.length === t.length && a; - } - parseNegate() { - if (this.nonegate) return; - let e = this.pattern, t = !1, n = 0; - for (let r = 0; r < e.length && e.charAt(r) === `!`; r++) t = !t, n++; - n && (this.pattern = e.slice(n)), this.negate = t; - } - matchOne(e, t, n = !1) { - let r = 0, i = 0; - if (this.isWindows) { - let n = typeof e[0] == `string` && /^[a-z]:$/i.test(e[0]), a = !n && e[0] === `` && e[1] === `` && e[2] === `?` && /^[a-z]:$/i.test(e[3]), o = typeof t[0] == `string` && /^[a-z]:$/i.test(t[0]), s = !o && t[0] === `` && t[1] === `` && t[2] === `?` && typeof t[3] == `string` && /^[a-z]:$/i.test(t[3]), c = a ? 3 : n ? 0 : void 0, l = s ? 3 : o ? 0 : void 0; - if (typeof c == `number` && typeof l == `number`) { - let [n, a] = [e[c], t[l]]; - n.toLowerCase() === a.toLowerCase() && (t[l] = n, i = l, r = c); - } - } - let { optimizationLevel: a = 1 } = this.options; - return a >= 2 && (e = this.levelTwoFileOptimize(e)), t.includes(Du$1) ? this.#e(e, t, n, r, i) : this.#n(e, t, n, r, i); - } - #e(e, t, n, r, i) { - let a = t.indexOf(Du$1, i), o = t.lastIndexOf(Du$1), [s, c, l] = n ? [ - t.slice(i, a), - t.slice(a + 1), - [] - ] : [ - t.slice(i, a), - t.slice(a + 1, o), - t.slice(o + 1) - ]; - if (s.length) { - let t = e.slice(r, r + s.length); - if (!this.#n(t, s, n, 0, 0)) return !1; - r += s.length, i += s.length; - } - let u = 0; - if (l.length) { - if (l.length + r > e.length) return !1; - let t = e.length - l.length; - if (this.#n(e, l, n, t, 0)) u = l.length; - else { - if (e[e.length - 1] !== `` || r + l.length === e.length || (t--, !this.#n(e, l, n, t, 0))) return !1; - u = l.length + 1; - } - } - if (!c.length) { - let t = !!u; - for (let n = r; n < e.length - u; n++) { - let r = String(e[n]); - if (t = !0, r === `.` || r === `..` || !this.options.dot && r.startsWith(`.`)) return !1; - } - return n || t; - } - let d = [[[], 0]], f = d[0], p = 0, m = [0]; - for (let e of c) e === Du$1 ? (m.push(p), f = [[], 0], d.push(f)) : (f[0].push(e), p++); - let h = d.length - 1, g = e.length - u; - for (let e of d) e[1] = g - (m[h--] + e[0].length); - return !!this.#t(e, d, r, 0, n, 0, !!u); - } - #t(e, t, n, r, i, a, o) { - let s = t[r]; - if (!s) { - for (let t = n; t < e.length; t++) { - o = !0; - let n = e[t]; - if (n === `.` || n === `..` || !this.options.dot && n.startsWith(`.`)) return !1; - } - return o; - } - let [c, l] = s; - for (; n <= l;) { - if (this.#n(e.slice(0, n + c.length), c, i, n, 0) && a < this.maxGlobstarRecursion) { - let s = this.#t(e, t, n + c.length, r + 1, i, a + 1, o); - if (s !== !1) return s; - } - let s = e[n]; - if (s === `.` || s === `..` || !this.options.dot && s.startsWith(`.`)) return !1; - n++; - } - return i || null; - } - #n(e, t, n, r, i) { - let a, o, s, c; - for (a = r, o = i, c = e.length, s = t.length; a < c && o < s; a++, o++) { - this.debug(`matchOne loop`); - let n = t[o], r = e[a]; - if (this.debug(t, n, r), n === !1 || n === Du$1) return !1; - let i; - if (typeof n == `string` ? (i = r === n, this.debug(`string match`, n, r, i)) : (i = n.test(r), this.debug(`pattern match`, n, r, i)), !i) return !1; - } - if (a === c && o === s) return !0; - if (a === c) return n; - if (o === s) return a === c - 1 && e[a] === ``; - throw Error(`wtf?`); - } - braceExpand() { - return ku$1(this.pattern, this.options); - } - parse(e) { - Pl$1(e); - let t = this.options; - if (e === `**`) return Du$1; - if (e === ``) return ``; - let n, r = null; - (n = e.match(hu$1)) ? r = t.dot ? _u$1 : gu$1 : (n = e.match(au$1)) ? r = (t.nocase ? t.dot ? lu$1 : cu$1 : t.dot ? su$1 : ou$1)(n[1]) : (n = e.match(vu$1)) ? r = (t.nocase ? t.dot ? bu$1 : yu$1 : t.dot ? xu$1 : Su$1)(n) : (n = e.match(uu$1)) ? r = t.dot ? fu$1 : du$1 : (n = e.match(pu$1)) && (r = mu$1); - let i = nu$1.fromGlob(e, this.options).toMMPattern(); - return r && typeof i == `object` && Reflect.defineProperty(i, "test", { value: r }), i; - } - makeRe() { - if (this.regexp || this.regexp === !1) return this.regexp; - let e = this.set; - if (!e.length) return this.regexp = !1, this.regexp; - let t = this.options, n = t.noglobstar ? `[^/]*?` : t.dot ? `(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?` : `(?:(?!(?:\\/|^)\\.).)*?`, r = new Set(t.nocase ? [`i`] : []), i = e.map((e) => { - let t = e.map((e) => { - if (e instanceof RegExp) for (let t of e.flags.split(``)) r.add(t); - return typeof e == `string` ? ju$1(e) : e === Du$1 ? Du$1 : e._src; - }); - t.forEach((e, r) => { - let i = t[r + 1], a = t[r - 1]; - e !== Du$1 || a === Du$1 || (a === void 0 ? i !== void 0 && i !== Du$1 ? t[r + 1] = `(?:\\/|` + n + `\\/)?` + i : t[r] = n : i === void 0 ? t[r - 1] = a + `(?:\\/|\\/` + n + `)?` : i !== Du$1 && (t[r - 1] = a + `(?:\\/|\\/` + n + `\\/)` + i, t[r + 1] = Du$1)); - }); - let i = t.filter((e) => e !== Du$1); - if (this.partial && i.length >= 1) { - let e = []; - for (let t = 1; t <= i.length; t++) e.push(i.slice(0, t).join(`/`)); - return `(?:` + e.join(`|`) + `)`; - } - return i.join(`/`); - }).join(`|`), [a, o] = e.length > 1 ? [`(?:`, `)`] : [``, ``]; - i = `^` + a + i + o + `$`, this.partial && (i = `^(?:\\/|` + a + i.slice(1, -1) + o + `)$`), this.negate && (i = `^(?!` + i + `).+$`); - try { - this.regexp = new RegExp(i, [...r].join(``)); - } catch { - this.regexp = !1; - } - return this.regexp; - } - slashSplit(e) { - return this.preserveMultipleSlashes ? e.split(`/`) : this.isWindows && /^\/\/[^/]+/.test(e) ? [``, ...e.split(/\/+/)] : e.split(/\/+/); - } - match(e, t = this.partial) { - if (this.debug(`match`, e, this.pattern), this.comment) return !1; - if (this.empty) return e === ``; - if (e === `/` && t) return !0; - let n = this.options; - this.isWindows && (e = e.split(`\\`).join(`/`)); - let r = this.slashSplit(e); - this.debug(this.pattern, `split`, r); - let i = this.set; - this.debug(this.pattern, `set`, i); - let a = r[r.length - 1]; - if (!a) for (let e = r.length - 2; !a && e >= 0; e--) a = r[e]; - for (let e of i) { - let i = r; - if (n.matchBase && e.length === 1 && (i = [a]), this.matchOne(i, e, t)) return n.flipNegate ? !0 : !this.negate; - } - return n.flipNegate ? !1 : this.negate; - } - static defaults(e) { - return iu$1.defaults(e).Minimatch; - } -}; -iu$1.AST = nu$1, iu$1.Minimatch = Mu$1, iu$1.escape = ru$1, iu$1.unescape = Bl$1; -var Nu$1 = c$12(((e, t) => { - let n = process || {}, r = n.argv || [], i = n.env || {}, a = !(i.NO_COLOR || r.includes(`--no-color`)) && (!!i.FORCE_COLOR || r.includes(`--color`) || n.platform === `win32` || (n.stdout || {}).isTTY && i.TERM !== `dumb` || !!i.CI), o = (e, t, n = e) => (r) => { - let i = `` + r, a = i.indexOf(t, e.length); - return ~a ? e + s(i, t, n, a) + t : e + i + t; - }, s = (e, t, n, r) => { - let i = ``, a = 0; - do - i += e.substring(a, r) + n, a = r + t.length, r = e.indexOf(t, a); - while (~r); - return i + e.substring(a); - }, c = (e = a) => { - let t = e ? o : () => String; - return { - isColorSupported: e, - reset: t(`\x1B[0m`, `\x1B[0m`), - bold: t(`\x1B[1m`, `\x1B[22m`, `\x1B[22m\x1B[1m`), - dim: t(`\x1B[2m`, `\x1B[22m`, `\x1B[22m\x1B[2m`), - italic: t(`\x1B[3m`, `\x1B[23m`), - underline: t(`\x1B[4m`, `\x1B[24m`), - inverse: t(`\x1B[7m`, `\x1B[27m`), - hidden: t(`\x1B[8m`, `\x1B[28m`), - strikethrough: t(`\x1B[9m`, `\x1B[29m`), - black: t(`\x1B[30m`, `\x1B[39m`), - red: t(`\x1B[31m`, `\x1B[39m`), - green: t(`\x1B[32m`, `\x1B[39m`), - yellow: t(`\x1B[33m`, `\x1B[39m`), - blue: t(`\x1B[34m`, `\x1B[39m`), - magenta: t(`\x1B[35m`, `\x1B[39m`), - cyan: t(`\x1B[36m`, `\x1B[39m`), - white: t(`\x1B[37m`, `\x1B[39m`), - gray: t(`\x1B[90m`, `\x1B[39m`), - bgBlack: t(`\x1B[40m`, `\x1B[49m`), - bgRed: t(`\x1B[41m`, `\x1B[49m`), - bgGreen: t(`\x1B[42m`, `\x1B[49m`), - bgYellow: t(`\x1B[43m`, `\x1B[49m`), - bgBlue: t(`\x1B[44m`, `\x1B[49m`), - bgMagenta: t(`\x1B[45m`, `\x1B[49m`), - bgCyan: t(`\x1B[46m`, `\x1B[49m`), - bgWhite: t(`\x1B[47m`, `\x1B[49m`), - blackBright: t(`\x1B[90m`, `\x1B[39m`), - redBright: t(`\x1B[91m`, `\x1B[39m`), - greenBright: t(`\x1B[92m`, `\x1B[39m`), - yellowBright: t(`\x1B[93m`, `\x1B[39m`), - blueBright: t(`\x1B[94m`, `\x1B[39m`), - magentaBright: t(`\x1B[95m`, `\x1B[39m`), - cyanBright: t(`\x1B[96m`, `\x1B[39m`), - whiteBright: t(`\x1B[97m`, `\x1B[39m`), - bgBlackBright: t(`\x1B[100m`, `\x1B[49m`), - bgRedBright: t(`\x1B[101m`, `\x1B[49m`), - bgGreenBright: t(`\x1B[102m`, `\x1B[49m`), - bgYellowBright: t(`\x1B[103m`, `\x1B[49m`), - bgBlueBright: t(`\x1B[104m`, `\x1B[49m`), - bgMagentaBright: t(`\x1B[105m`, `\x1B[49m`), - bgCyanBright: t(`\x1B[106m`, `\x1B[49m`), - bgWhiteBright: t(`\x1B[107m`, `\x1B[49m`) - }; - }; - t.exports = c(), t.exports.createColors = c; -})); -var Pu$1 = c$12(((e, t) => { - var n = Object.defineProperty, r = Object.getOwnPropertyDescriptor, i = Object.getOwnPropertyNames, a = Object.prototype.hasOwnProperty, o = (e, t) => { - for (var r in t) n(e, r, { - get: t[r], - enumerable: !0 - }); - }, s = (e, t, o, s) => { - if (t && typeof t == `object` || typeof t == `function`) for (let c of i(t)) !a.call(e, c) && c !== o && n(e, c, { - get: () => t[c], - enumerable: !(s = r(t, c)) || s.enumerable - }); - return e; - }, c = (e) => s(n({}, `__esModule`, { value: !0 }), e), l = {}; - o(l, { - SYMBOL_FOR_REQ_CONTEXT: () => u, - getContext: () => d - }), t.exports = c(l); - let u = Symbol.for(`@vercel/request-context`); - function d() { - return globalThis[u]?.get?.() ?? {}; - } -})); -var Fu$1 = c$12(((e, t) => { - var n = Object.defineProperty, r = Object.getOwnPropertyDescriptor, i = Object.getOwnPropertyNames, a = Object.prototype.hasOwnProperty, o = (e, t) => { - for (var r in t) n(e, r, { - get: t[r], - enumerable: !0 - }); - }, s = (e, t, o, s) => { - if (t && typeof t == `object` || typeof t == `function`) for (let c of i(t)) !a.call(e, c) && c !== o && n(e, c, { - get: () => t[c], - enumerable: !(s = r(t, c)) || s.enumerable - }); - return e; - }, c = (e) => s(n({}, `__esModule`, { value: !0 }), e), l = {}; - o(l, { getVercelOidcTokenSync: () => d }), t.exports = c(l); - var u = Pu$1(); - function d() { - let e = (0, u.getContext)().headers?.[`x-vercel-oidc-token`] ?? process.env.VERCEL_OIDC_TOKEN; - if (!e) throw Error(`The 'x-vercel-oidc-token' header is missing from the request.`); - return e; - } -})); -var Iu$1 = c$12(((e, t) => { - var n = Object.defineProperty, r = Object.getOwnPropertyDescriptor, i = Object.getOwnPropertyNames, a = Object.prototype.hasOwnProperty, o = (e, t) => { - for (var r in t) n(e, r, { - get: t[r], - enumerable: !0 - }); - }, s = (e, t, o, s) => { - if (t && typeof t == `object` || typeof t == `function`) for (let c of i(t)) !a.call(e, c) && c !== o && n(e, c, { - get: () => t[c], - enumerable: !(s = r(t, c)) || s.enumerable - }); - return e; - }, c = (e) => s(n({}, `__esModule`, { value: !0 }), e), l = {}; - o(l, { VercelOidcTokenError: () => u }), t.exports = c(l); - var u = class extends Error { - constructor(e, t) { - super(e), this.name = `VercelOidcTokenError`, this.cause = t; - } - toString() { - return this.cause ? `${this.name}: ${this.message}: ${this.cause}` : `${this.name}: ${this.message}`; - } - }; -})); -var Lu$1 = c$12(((t, n) => { - var r = Object.defineProperty, i = Object.getOwnPropertyDescriptor, a = Object.getOwnPropertyNames, o = Object.prototype.hasOwnProperty, s = (e, t) => { - for (var n in t) r(e, n, { - get: t[n], - enumerable: !0 - }); - }, c = (e, t, n, s) => { - if (t && typeof t == `object` || typeof t == `function`) for (let c of a(t)) !o.call(e, c) && c !== n && r(e, c, { - get: () => t[c], - enumerable: !(s = i(t, c)) || s.enumerable - }); - return e; - }, l = (e) => c(r({}, `__esModule`, { value: !0 }), e), u = {}; - s(u, { getVercelOidcToken: () => p }), n.exports = l(u); - var d = Fu$1(), f = Iu$1(); - async function p(t) { - let n = ``, r; - try { - n = (0, d.getVercelOidcTokenSync)(); - } catch (e) { - r = e; - } - try { - let [{ getTokenPayload: r, isExpired: i }, { refreshToken: a }] = await Promise.all([await Promise.resolve().then(() => d$13(Hu$1())), await Promise.resolve().then(() => token_Bm_WLAUB_exports).then((t) => d$13(t.default))]); - (!n || i(r(n), t?.expirationBufferMs)) && (await a(t), n = (0, d.getVercelOidcTokenSync)()); - } catch (e) { - let t = r instanceof Error ? r.message : ``; - throw e instanceof Error && (t = `${t} -${e.message}`), t ? new f.VercelOidcTokenError(t) : e; - } - return n; - } -})); -var Ru$1 = c$12(((e, t) => { - var n = Object.defineProperty, r = Object.getOwnPropertyDescriptor, i = Object.getOwnPropertyNames, a = Object.prototype.hasOwnProperty, o = (e, t) => { - for (var r in t) n(e, r, { - get: t[r], - enumerable: !0 - }); - }, s = (e, t, o, s) => { - if (t && typeof t == `object` || typeof t == `function`) for (let c of i(t)) !a.call(e, c) && c !== o && n(e, c, { - get: () => t[c], - enumerable: !(s = r(t, c)) || s.enumerable - }); - return e; - }, c = (e) => s(n({}, `__esModule`, { value: !0 }), e), l = {}; - o(l, { - AccessTokenMissingError: () => u, - RefreshAccessTokenFailedError: () => d - }), t.exports = c(l); - var u = class extends Error { - constructor() { - super(`No authentication found. Please log in with the Vercel CLI (vercel login).`), this.name = `AccessTokenMissingError`; - } - }, d = class extends Error { - constructor(e) { - super(`Failed to refresh authentication token.`, { cause: e }), this.name = `RefreshAccessTokenFailedError`; - } - }; -})); -var zu$1 = c$12(((e, n) => { - var r = Object.create, i = Object.defineProperty, a = Object.getOwnPropertyDescriptor, o = Object.getOwnPropertyNames, s = Object.getPrototypeOf, c = Object.prototype.hasOwnProperty, l = (e, t) => { - for (var n in t) i(e, n, { - get: t[n], - enumerable: !0 - }); - }, u = (e, t, n, r) => { - if (t && typeof t == `object` || typeof t == `function`) for (let s of o(t)) !c.call(e, s) && s !== n && i(e, s, { - get: () => t[s], - enumerable: !(r = a(t, s)) || r.enumerable - }); - return e; - }, d = (e, t, n) => (n = e == null ? {} : r(s(e)), u(t || !e || !e.__esModule ? i(n, `default`, { - value: e, - enumerable: !0 - }) : n, e)), f = (e) => u(i({}, `__esModule`, { value: !0 }), e), p = {}; - l(p, { - findRootDir: () => v, - getUserDataDir: () => y - }), n.exports = f(p); - var m = d(f$11(`path`)), h = d(f$11(`fs`)), g = d(f$11(`os`)), _ = Iu$1(); - function v() { - try { - let e = process.cwd(); - for (; e !== m.default.dirname(e);) { - let t = m.default.join(e, `.vercel`); - if (h.default.existsSync(t)) return e; - e = m.default.dirname(e); - } - } catch { - throw new _.VercelOidcTokenError(`Token refresh only supported in node server environments`); - } - return null; - } - function y() { - if (process.env.XDG_DATA_HOME) return process.env.XDG_DATA_HOME; - switch (g.default.platform()) { - case `darwin`: return m.default.join(g.default.homedir(), `Library/Application Support`); - case `linux`: return m.default.join(g.default.homedir(), `.local/share`); - case `win32`: return process.env.LOCALAPPDATA ? process.env.LOCALAPPDATA : null; - default: return null; - } - } -})); -var Bu$1 = c$12(((e, n) => { - var r = Object.create, i = Object.defineProperty, a = Object.getOwnPropertyDescriptor, o = Object.getOwnPropertyNames, s = Object.getPrototypeOf, c = Object.prototype.hasOwnProperty, l = (e, t) => { - for (var n in t) i(e, n, { - get: t[n], - enumerable: !0 - }); - }, u = (e, t, n, r) => { - if (t && typeof t == `object` || typeof t == `function`) for (let s of o(t)) !c.call(e, s) && s !== n && i(e, s, { - get: () => t[s], - enumerable: !(r = a(t, s)) || r.enumerable - }); - return e; - }, d = (e, t, n) => (n = e == null ? {} : r(s(e)), u(t || !e || !e.__esModule ? i(n, `default`, { - value: e, - enumerable: !0 - }) : n, e)), f = (e) => u(i({}, `__esModule`, { value: !0 }), e), p = {}; - l(p, { - isValidAccessToken: () => b, - readAuthConfig: () => v, - writeAuthConfig: () => y - }), n.exports = f(p); - var m = d(f$11(`fs`)), h = d(f$11(`path`)), g = Hu$1(); - function _() { - let e = (0, g.getVercelDataDir)(); - if (!e) throw Error(`Unable to find Vercel CLI data directory. Your platform: ${process.platform}. Supported: darwin, linux, win32.`); - return h.join(e, `auth.json`); - } - function v() { - try { - let e = _(); - if (!m.existsSync(e)) return null; - let t = m.readFileSync(e, `utf8`); - return t ? JSON.parse(t) : null; - } catch { - return null; - } - } - function y(e) { - let t = _(), n = h.dirname(t); - m.existsSync(n) || m.mkdirSync(n, { - mode: 504, - recursive: !0 - }), m.writeFileSync(t, JSON.stringify(e, null, 2), { mode: 384 }); - } - function b(e, t = 0) { - if (!e.token) return !1; - if (typeof e.expiresAt != `number`) return !0; - let n = Math.floor(Date.now() / 1e3), r = t / 1e3; - return e.expiresAt >= n + r; - } -})); -var Vu$1 = c$12(((e, n) => { - var r = Object.defineProperty, i = Object.getOwnPropertyDescriptor, a = Object.getOwnPropertyNames, o = Object.prototype.hasOwnProperty, s = (e, t) => { - for (var n in t) r(e, n, { - get: t[n], - enumerable: !0 - }); - }, c = (e, t, n, s) => { - if (t && typeof t == `object` || typeof t == `function`) for (let c of a(t)) !o.call(e, c) && c !== n && r(e, c, { - get: () => t[c], - enumerable: !(s = i(t, c)) || s.enumerable - }); - return e; - }, l = (e) => c(r({}, `__esModule`, { value: !0 }), e), u = {}; - s(u, { - processTokenResponse: () => g, - refreshTokenRequest: () => h - }), n.exports = l(u); - var d = f$11(`os`); - let f = `@vercel/oidc node-${process.version} ${(0, d.platform)()} (${(0, d.arch)()}) ${(0, d.hostname)()}`, p = null; - async function m() { - if (p) return p; - let e = await fetch(`https://vercel.com/.well-known/openid-configuration`, { headers: { "user-agent": f } }); - if (!e.ok) throw Error(`Failed to discover OAuth endpoints`); - let t = await e.json(); - if (!t || typeof t.token_endpoint != `string`) throw Error(`Invalid OAuth discovery response`); - let n = t.token_endpoint; - return p = n, n; - } - async function h(e) { - let t = await m(); - return await fetch(t, { - method: `POST`, - headers: { - "Content-Type": `application/x-www-form-urlencoded`, - "user-agent": f - }, - body: new URLSearchParams({ - client_id: `cl_HYyOPBNtFMfHhaUn9L4QPfTZz6TP47bp`, - grant_type: `refresh_token`, - ...e - }) - }); - } - async function g(e) { - let t = await e.json(); - if (!e.ok) { - let e = typeof t == `object` && t && `error` in t ? String(t.error) : `Token refresh failed`; - return [Error(e)]; - } - return typeof t != `object` || !t ? [Error(`Invalid token response`)] : typeof t.access_token == `string` ? t.token_type === `Bearer` ? typeof t.expires_in == `number` ? [null, t] : [Error(`Missing expires_in in response`)] : [Error(`Invalid token_type in response`)] : [Error(`Missing access_token in response`)]; - } -})); -var Hu$1 = c$12(((e, n) => { - var r = Object.create, i = Object.defineProperty, a = Object.getOwnPropertyDescriptor, o = Object.getOwnPropertyNames, s = Object.getPrototypeOf, c = Object.prototype.hasOwnProperty, l = (e, t) => { - for (var n in t) i(e, n, { - get: t[n], - enumerable: !0 - }); - }, u = (e, t, n, r) => { - if (t && typeof t == `object` || typeof t == `function`) for (let s of o(t)) !c.call(e, s) && s !== n && i(e, s, { - get: () => t[s], - enumerable: !(r = a(t, s)) || r.enumerable - }); - return e; - }, d = (e, t, n) => (n = e == null ? {} : r(s(e)), u(t || !e || !e.__esModule ? i(n, `default`, { - value: e, - enumerable: !0 - }) : n, e)), f = (e) => u(i({}, `__esModule`, { value: !0 }), e), p = {}; - l(p, { - assertVercelOidcTokenResponse: () => w, - findProjectInfo: () => T, - getTokenPayload: () => O, - getVercelDataDir: () => x, - getVercelOidcToken: () => C, - getVercelToken: () => S, - isExpired: () => k, - loadToken: () => D, - saveToken: () => E - }), n.exports = f(p); - var m = d(f$11(`path`)), h = d(f$11(`fs`)), g = Iu$1(), _ = zu$1(), v = Bu$1(), y = Vu$1(), b = Ru$1(); - function x() { - let e = (0, _.getUserDataDir)(); - return e ? m.join(e, `com.vercel.cli`) : null; - } - async function S(e) { - let t = (0, v.readAuthConfig)(); - if (!t?.token) throw new b.AccessTokenMissingError(); - if ((0, v.isValidAccessToken)(t, e?.expirationBufferMs)) return t.token; - if (!t.refreshToken) throw (0, v.writeAuthConfig)({}), new b.RefreshAccessTokenFailedError(`No refresh token available`); - try { - let e = await (0, y.refreshTokenRequest)({ refresh_token: t.refreshToken }), [n, r] = await (0, y.processTokenResponse)(e); - if (n || !r) throw (0, v.writeAuthConfig)({}), new b.RefreshAccessTokenFailedError(n); - let i = { - token: r.access_token, - expiresAt: Math.floor(Date.now() / 1e3) + r.expires_in - }; - return r.refresh_token && (i.refreshToken = r.refresh_token), (0, v.writeAuthConfig)(i), i.token; - } catch (e) { - throw (0, v.writeAuthConfig)({}), e instanceof b.AccessTokenMissingError || e instanceof b.RefreshAccessTokenFailedError ? e : new b.RefreshAccessTokenFailedError(e); - } - } - async function C(e, t, n) { - let r = `https://api.vercel.com/v1/projects/${t}/token?source=vercel-oidc-refresh${n ? `&teamId=${n}` : ``}`, i = await fetch(r, { - method: `POST`, - headers: { Authorization: `Bearer ${e}` } - }); - if (!i.ok) throw new g.VercelOidcTokenError(`Failed to refresh OIDC token: ${i.statusText}`); - let a = await i.json(); - return w(a), a; - } - function w(e) { - if (!e || typeof e != `object`) throw TypeError("Vercel OIDC token is malformed. Expected an object. Please run `vc env pull` and try again"); - if (!(`token` in e) || typeof e.token != `string`) throw TypeError("Vercel OIDC token is malformed. Expected a string-valued token property. Please run `vc env pull` and try again"); - } - function T() { - let e = (0, _.findRootDir)(); - if (!e) throw new g.VercelOidcTokenError("Unable to find project root directory. Have you linked your project with `vc link?`"); - let t = m.join(e, `.vercel`, `project.json`); - if (!h.existsSync(t)) throw new g.VercelOidcTokenError("project.json not found, have you linked your project with `vc link?`"); - let n = JSON.parse(h.readFileSync(t, `utf8`)); - if (typeof n.projectId != `string` && typeof n.orgId != `string`) throw TypeError("Expected a string-valued projectId property. Try running `vc link` to re-link your project."); - return { - projectId: n.projectId, - teamId: n.orgId - }; - } - function E(e, t) { - let n = (0, _.getUserDataDir)(); - if (!n) throw new g.VercelOidcTokenError(`Unable to find user data directory. Please reach out to Vercel support.`); - let r = m.join(n, `com.vercel.token`, `${t}.json`), i = JSON.stringify(e); - h.mkdirSync(m.dirname(r), { - mode: 504, - recursive: !0 - }), h.writeFileSync(r, i), h.chmodSync(r, 432); - } - function D(e) { - let t = (0, _.getUserDataDir)(); - if (!t) throw new g.VercelOidcTokenError(`Unable to find user data directory. Please reach out to Vercel support.`); - let n = m.join(t, `com.vercel.token`, `${e}.json`); - if (!h.existsSync(n)) return null; - let r = JSON.parse(h.readFileSync(n, `utf8`)); - return w(r), r; - } - function O(e) { - let t = e.split(`.`); - if (t.length !== 3) throw new g.VercelOidcTokenError("Invalid token. Please run `vc env pull` and try again"); - let n = t[1].replace(/-/g, `+`).replace(/_/g, `/`), r = n.padEnd(n.length + (4 - n.length % 4) % 4, `=`); - return JSON.parse(Buffer.from(r, `base64`).toString(`utf8`)); - } - function k(e, t = 0) { - return e.exp * 1e3 < Date.now() + t; - } -})); -var Uu$1 = c$12(((e, t) => { - var n = Object.defineProperty, r = Object.getOwnPropertyDescriptor, i = Object.getOwnPropertyNames, a = Object.prototype.hasOwnProperty, o = (e, t) => { - for (var r in t) n(e, r, { - get: t[r], - enumerable: !0 - }); - }, s = (e, t, o, s) => { - if (t && typeof t == `object` || typeof t == `function`) for (let c of i(t)) !a.call(e, c) && c !== o && n(e, c, { - get: () => t[c], - enumerable: !(s = r(t, c)) || s.enumerable - }); - return e; - }, c = (e) => s(n({}, `__esModule`, { value: !0 }), e), l = {}; - o(l, { - AccessTokenMissingError: () => p.AccessTokenMissingError, - RefreshAccessTokenFailedError: () => p.RefreshAccessTokenFailedError, - getContext: () => f.getContext, - getVercelOidcToken: () => u.getVercelOidcToken, - getVercelOidcTokenSync: () => d.getVercelOidcTokenSync, - getVercelToken: () => m.getVercelToken - }), t.exports = c(l); - var u = Lu$1(), d = Fu$1(), f = Pu$1(), p = Ru$1(), m = Hu$1(); -})); -var Wu$1 = d$13(Nu$1(), 1); -var Gu$1 = Uu$1(); -async function Ku$1(e) { - let t = 0, n = e.getReader(), r = []; - try { - for (;;) { - let { done: e, value: i } = await n.read(); - if (e) break; - r.push(i), t += i.length; - } - } finally { - n.releaseLock(); - } - return Buffer.concat(r, t); -} -var qu$1 = class { - contentType = `application/json`; - replacer; - reviver; - constructor(e = {}) { - this.replacer = e.replacer, this.reviver = e.reviver; - } - serialize(e) { - return Buffer.from(JSON.stringify(e, this.replacer), `utf8`); - } - async deserialize(e) { - let t = await Ku$1(e); - return JSON.parse(t.toString(`utf8`), this.reviver); - } -}; -var Ju$1 = class extends Error { - constructor(e) { - super(`Message ${e} not found`), this.name = `MessageNotFoundError`; - } -}; -var Yu$1 = class extends Error { - constructor(e, t) { - super(`Message ${e} not available for processing${t ? `: ${t}` : ``}`), this.name = `MessageNotAvailableError`; - } -}; -var Xu$1 = class extends Error { - constructor(e, t) { - super(`Message ${e} is corrupted: ${t}`), this.name = `MessageCorruptedError`; - } -}; -var Zu$1 = class extends Error { - retryAfter; - constructor(e = `Too many requests`, t) { - super(e), this.name = `TooManyRequestsError`, this.retryAfter = t; - } -}; -var Qu$1 = class extends Error { - constructor(e = `Missing or invalid authentication token`) { - super(e), this.name = `UnauthorizedError`; - } -}; -var $u$1 = class extends Error { - constructor(e = `Queue environment doesn't match token environment`) { - super(e), this.name = `ForbiddenError`; - } -}; -var ed$1 = class extends Error { - constructor(e) { - super(e), this.name = `BadRequestError`; - } -}; -var td$1 = class extends Error { - constructor(e = `Unexpected server error`) { - super(e), this.name = `InternalServerError`; - } -}; -var nd$1 = class extends Error { - constructor(e, t = 1, n = 10) { - super(`Invalid limit: ${e}. Limit must be between ${t} and ${n}.`), this.name = `InvalidLimitError`; - } -}; -var rd$1 = class extends Error { - constructor(e) { - super(`Message ${e} has already been processed`), this.name = `MessageAlreadyProcessedError`; - } -}; -var id$1 = class extends Error { - idempotencyKey; - constructor(e, t) { - super(e), this.name = `DuplicateMessageError`, this.idempotencyKey = t; - } -}; -var ad$1 = class extends Error { - deploymentId; - constructor(e, t) { - super(e), this.name = `ConsumerDiscoveryError`, this.deploymentId = t; - } -}; -var od$1 = class extends Error { - constructor(e = `Consumer registry not configured`) { - super(e), this.name = `ConsumerRegistryNotConfiguredError`; - } -}; -var sd$1 = 300; -var cd$1 = 30; -var ld$1 = 60; -var ud$1 = 10; -var dd$1 = 3e3; -var fd$1 = 3; -var pd$1 = 250; -function md$1(e) { - return Math.min(ld$1, Math.max(ud$1, e / 5)); -} -var hd$1 = class { - client; - topicName; - consumerGroupName; - visibilityTimeout; - constructor(e, t, n, r = {}) { - this.client = e, this.topicName = t, this.consumerGroupName = n, this.visibilityTimeout = Math.max(cd$1, r.visibilityTimeoutSeconds ?? sd$1); - } - isClientError(e) { - return e instanceof Yu$1 || e instanceof Ju$1 || e instanceof ed$1 || e instanceof Qu$1 || e instanceof $u$1; - } - isNetworkError(e) { - return e instanceof TypeError; - } - async directiveCallWithRetries(e) { - let t; - for (let n = 1; n <= fd$1; n++) try { - return await e(); - } catch (e) { - if (t = e, n === fd$1) throw e; - if (e instanceof Zu$1) { - if (e.retryAfter === void 0) throw e; - await new Promise((t) => setTimeout(t, e.retryAfter * 1e3)); - continue; - } - if (!this.isNetworkError(e)) throw e; - let r = pd$1 * n, i = r / 2 + r / 2 * Math.random(); - await new Promise((e) => setTimeout(e, i)); - } - throw t; - } - startVisibilityExtension(e, t) { - let n = !0, r = !1, i, a = null, o = md$1(this.visibilityTimeout) * 1e3, s = o; - if (t?.visibilityDeadline) { - let e = t.visibilityDeadline.getTime() - Date.now(); - s = e > 0 ? md$1(e / 1e3) * 1e3 : 0; - } - let c = new Promise((e) => { - i = e; - }), l = () => { - r || (r = !0, i()); - }, u = async () => { - if (!n) { - l(); - return; - } - try { - await this.client.changeVisibility({ - queueName: this.topicName, - consumerGroup: this.consumerGroupName, - receiptHandle: e, - visibilityTimeoutSeconds: this.visibilityTimeout - }), n ? a = setTimeout(() => u(), o) : l(); - } catch (t) { - if (this.isClientError(t)) { - console.error(`Visibility extension failed with client error for receipt handle ${e} (stopping retries):`, t), l(); - return; - } - console.error(`Failed to extend visibility for receipt handle ${e} (will retry in ${dd$1 / 1e3}s):`, t), n ? a = setTimeout(() => u(), dd$1) : l(); - } - }; - return a = setTimeout(() => u(), s), async (e = !1) => { - n = !1, a &&= (clearTimeout(a), null), e ? await c : l(); - }; - } - async finalizePayload(e) { - let t = this.client.getTransport(); - if (t.finalize && e != null) try { - await t.finalize(e); - } catch (e) { - console.warn(`Failed to finalize message payload:`, e); - } - } - async processMessage(e, t, n) { - let r = this.startVisibilityExtension(e.receiptHandle, n), i = { - messageId: e.messageId, - deliveryCount: e.deliveryCount, - createdAt: e.createdAt, - expiresAt: e.expiresAt ?? new Date(e.createdAt.getTime() + 864e5), - topicName: this.topicName, - consumerGroup: this.consumerGroupName, - region: this.client.getRegion() - }; - try { - await t(e.payload, i), await r(), await this.client.acknowledgeMessage({ - queueName: this.topicName, - consumerGroup: this.consumerGroupName, - receiptHandle: e.receiptHandle - }); - } catch (t) { - if (await r(), n?.retry) { - let r; - try { - r = n.retry(t, i); - } catch (e) { - console.warn(`retry handler threw:`, e); - } - if (r) { - if (`acknowledge` in r && r.acknowledge) { - try { - await this.directiveCallWithRetries(() => this.client.acknowledgeMessage({ - queueName: this.topicName, - consumerGroup: this.consumerGroupName, - receiptHandle: e.receiptHandle - })); - } catch (e) { - console.warn(`Failed to acknowledge message:`, e); - } - await this.finalizePayload(e.payload); - return; - } - if (`afterSeconds` in r && typeof r.afterSeconds == `number`) { - try { - await this.directiveCallWithRetries(() => this.client.changeVisibility({ - queueName: this.topicName, - consumerGroup: this.consumerGroupName, - receiptHandle: e.receiptHandle, - visibilityTimeoutSeconds: r.afterSeconds - })); - } catch (e) { - console.warn(`Failed to reschedule message for retry:`, e); - } - await this.finalizePayload(e.payload); - return; - } - } - } - throw await this.finalizePayload(e.payload), t; - } - } - async consumeMessage(e, t, n) { - await this.processMessage(t, e, n); - } - async consume(e, t) { - let n = t?.retry; - if (t && `messageId` in t) { - let r = await this.client.receiveMessageById({ - queueName: this.topicName, - consumerGroup: this.consumerGroupName, - messageId: t.messageId, - visibilityTimeoutSeconds: this.visibilityTimeout - }); - return await this.processMessage(r.message, e, { retry: n }), 1; - } else { - let r = t && `limit` in t ? t.limit : 1, i = 0; - for await (let t of this.client.receiveMessages({ - queueName: this.topicName, - consumerGroup: this.consumerGroupName, - visibilityTimeoutSeconds: this.visibilityTimeout, - limit: r - })) i++, await this.processMessage(t, e, { retry: n }); - return i; - } - } - get name() { - return this.consumerGroupName; - } - get topic() { - return this.topicName; - } -}; -var gd$1 = class { - client; - topicName; - constructor(e, t) { - this.client = e, this.topicName = t; - } - async publish(e, t) { - let n = await this.client.sendMessage({ - queueName: this.topicName, - payload: e, - idempotencyKey: t?.idempotencyKey, - retentionSeconds: t?.retentionSeconds, - delaySeconds: t?.delaySeconds, - headers: t?.headers - }); - return n.messageId && jd() && vf(this.topicName, n.messageId, this.client.getRegion(), t?.delaySeconds, t?.retentionSeconds), { messageId: n.messageId }; - } - consumerGroup(e, t) { - return new hd$1(this.client, this.topicName, e, t); - } - get name() { - return this.topicName; - } -}; -var _d$1 = `com.vercel.queue.v1beta`; -var vd$1 = `com.vercel.queue.v2beta`; -function yd$1(e, t) { - let n = t.slice(0, -1); - return e.startsWith(n); -} -function bd$1(e) { - return typeof e == `object` && !!e; -} -function xd$1(e, t) { - if (!t || !t.includes(`application/cloudevents+json`)) throw Error(`Invalid content type: expected 'application/cloudevents+json'`); - if (!bd$1(e) || !e.type || !e.source || !e.id || !bd$1(e.data)) throw Error(`Invalid CloudEvent: missing required fields`); - if (e.type !== `com.vercel.queue.v1beta`) throw Error(`Invalid CloudEvent type: expected '${_d$1}', got '${String(e.type)}'`); - let { data: n } = e, r = []; - if (`queueName` in n || r.push(`queueName`), `consumerGroup` in n || r.push(`consumerGroup`), `messageId` in n || r.push(`messageId`), r.length > 0) throw Error(`Missing required CloudEvent data fields: ${r.join(`, `)}`); - return { - queueName: String(n.queueName), - consumerGroup: String(n.consumerGroup), - messageId: String(n.messageId) - }; -} -function Sd$1(e, t) { - if (e instanceof Headers) return e.get(t); - let n = e[t]; - return Array.isArray(n) ? n[0] ?? null : n ?? null; -} -function Cd$1(e) { - let t = Sd$1(e, `ce-type`); - if (t !== `com.vercel.queue.v2beta`) throw Error(`Invalid CloudEvent type: expected '${vd$1}', got '${t}'`); - let n = Sd$1(e, `ce-vqsqueuename`), r = Sd$1(e, `ce-vqsconsumergroup`), i = Sd$1(e, `ce-vqsmessageid`), a = []; - if (n || a.push(`ce-vqsqueuename`), r || a.push(`ce-vqsconsumergroup`), i || a.push(`ce-vqsmessageid`), a.length > 0) throw Error(`Missing required CloudEvent headers: ${a.join(`, `)}`); - let o = Sd$1(e, `ce-vqsregion`) ?? void 0; - if (o !== void 0 && !/^[a-z]{2,5}[0-9]{1,2}$/.test(o)) throw Error(`Invalid ce-vqsregion header: ${JSON.stringify(o)}. Region must match /^[a-z]{2,5}[0-9]{1,2}$/ (e.g. "iad1", "lhr1").`); - let s = { - queueName: n, - consumerGroup: r, - messageId: i, - region: o - }, c = Sd$1(e, `ce-vqsreceipthandle`); - if (!c) return s; - let l = { - ...s, - receiptHandle: c - }, u = Sd$1(e, `ce-vqsdeliverycount`); - u && (l.deliveryCount = parseInt(u, 10)); - let d = Sd$1(e, `ce-vqscreatedat`); - d && (l.createdAt = d); - let f = Sd$1(e, `ce-vqsexpiresat`); - f && (l.expiresAt = f); - let p = Sd$1(e, `content-type`); - p && (l.contentType = p); - let m = Sd$1(e, `ce-vqsvisibilitydeadline`); - return m && (l.visibilityDeadline = m), l; -} -function wd$1(e, t) { - if (Sd$1(t, `ce-type`) === `com.vercel.queue.v2beta`) { - let n = Cd$1(t); - return `receiptHandle` in n && (n.parsedPayload = e), n; - } - return xd$1(e, Sd$1(t, `content-type`)); -} -async function Td$1(e) { - if (e.headers.get(`ce-type`) === `com.vercel.queue.v2beta`) { - let t = Cd$1(e.headers); - return `receiptHandle` in t && e.body && (t.rawBody = e.body), t; - } - let t; - try { - t = await e.json(); - } catch { - throw Error(`Failed to parse CloudEvent from request body`); - } - let n = {}; - return e.headers.forEach((e, t) => { - n[t] = e; - }), wd$1(t, n); -} -async function Ed$1(e, t, n) { - let { queueName: r, consumerGroup: i, messageId: a } = t; - if (!n?.client) throw Error(`HandleCallbackOptions.client is required`); - let o = If(n.client); - t.region && (o = o.withRegion(t.region)); - let s = new gd$1(o, r).consumerGroup(i, n?.visibilityTimeoutSeconds === void 0 ? void 0 : { visibilityTimeoutSeconds: n.visibilityTimeoutSeconds }); - if (`receiptHandle` in t) { - let r = o.getTransport(), i; - if (t.rawBody) i = await r.deserialize(t.rawBody); - else if (t.parsedPayload !== void 0) i = t.parsedPayload; - else throw Error(`Binary mode callback with receipt handle is missing payload`); - let c = { - messageId: a, - payload: i, - deliveryCount: t.deliveryCount ?? 1, - createdAt: t.createdAt ? new Date(t.createdAt) : /* @__PURE__ */ new Date(), - expiresAt: t.expiresAt ? new Date(t.expiresAt) : void 0, - contentType: t.contentType ?? r.contentType, - receiptHandle: t.receiptHandle - }, l = t.visibilityDeadline ? new Date(t.visibilityDeadline) : void 0; - await s.consumeMessage(e, c, { - visibilityDeadline: l, - retry: n?.retry - }); - } else await s.consume(e, { - messageId: a, - retry: n?.retry - }); -} -var Dd = Wu$1.default.cyan(`[queue]`); -var Od = Wu$1.default.green(`✓`); -var kd = Wu$1.default.red(`✗`); -var Ad = Wu$1.default.yellow(`↻`); -function jd() { - return process.env.NODE_ENV === `development`; -} -var Md = Symbol.for(`@vercel/queue.devRouteMappings`); -function Nd(e) { - let t = ``; - for (let n of e) n === `_` ? t += `__` : n === `/` ? t += `_S` : n === `.` ? t += `_D` : /[A-Za-z0-9-]/.test(n) ? t += n : t += `_` + n.charCodeAt(0).toString(16).toUpperCase().padStart(2, `0`); - return t; -} -function Pd() { - let e = globalThis; - if (Md in e) return e[Md] ?? null; - try { - let t = lr$3.join(process.cwd(), `vercel.json`); - if (!ur$3.existsSync(t)) return e[Md] = null, null; - let n = JSON.parse(ur$3.readFileSync(t, `utf-8`)); - if (!n.functions) return e[Md] = null, null; - let r = []; - for (let [e, t] of Object.entries(n.functions)) if (t.experimentalTriggers) { - for (let n of t.experimentalTriggers) if (!(!n.type?.startsWith(`queue/`) || !n.topic)) { - if (n.type !== `queue/v2beta`) { - console.warn(`${Dd} Unsupported trigger type "${n.type}" for topic "${n.topic}" in ${e}. Use "queue/v2beta" instead.`); - continue; - } - r.push({ - filePath: e, - topic: n.topic, - consumer: Nd(e), - retryAfterSeconds: n.retryAfterSeconds - }); - } - } - return e[Md] = r.length > 0 ? r : null, e[Md]; - } catch (t) { - return console.warn(`${Dd} Failed to read vercel.json:`, t), e[Md] = null, null; - } -} -function Fd(e) { - let t = Pd(); - return t ? t.filter((t) => t.topic.includes(`*`) ? yd$1(e, t.topic) : t.topic === e) : []; -} -function Id(e, t) { - return Fd(e).find((e) => e.consumer === t)?.retryAfterSeconds; -} -function Ld(e) { - return /^src\/(app|pages|server)\//.test(e) ? e.slice(4) : null; -} -function Rd(e, t) { - return e === t || iu$1(e, t); -} -function zd(e) { - let t = Pd(); - if (!t) return []; - let n = process.cwd(), r; - try { - r = lr$3.relative(n, e); - } catch { - return []; - } - let i = r.replace(/\\/g, `/`), a = Ld(i); - return t.filter((e) => Rd(i, e.filePath) || a !== null && Rd(a, e.filePath)); -} -function Bd(e) { - let t = e.match(/\((.+?):\d+:\d+\)/); - if (t ||= e.match(/at\s+(.+?):\d+:\d+/), !t) return null; - let n = t[1].trim(); - if (n === `native` || n.startsWith(`node:`) || n.startsWith(`internal`)) return null; - if (n.startsWith(`file://`)) try { - n = new URL(n).pathname; - } catch { - return null; - } - return /^[a-zA-Z][a-zA-Z0-9+.-]*:\/\//.test(n) ? null : (n.startsWith(`./`) && (n = n.slice(2)), n); -} -var Vd; -function Hd() { - if (Vd) return Vd; - try { - let e = typeof __dirname < `u` ? __dirname : lr$3.dirname(new URL(import.meta.url).pathname); - Vd = lr$3.resolve(e, `..`); - } catch { - Vd = ``; - } - return Vd; -} -function Ud() { - let e = Error().stack; - if (!e) return null; - let t = e.split(` -`).slice(1), n = Hd(); - for (let e of t) { - let t = Bd(e); - if (!t) continue; - let r = lr$3.isAbsolute(t) ? t : lr$3.resolve(process.cwd(), t), i; - try { - i = ur$3.realpathSync(r); - } catch { - i = r; - } - if (!(n && i.startsWith(n))) return i; - } - return null; -} -var Wd = Symbol.for(`@vercel/queue.devHandlerRegistry`); -function Gd() { - let e = globalThis; - return e[Wd] || (e[Wd] = /* @__PURE__ */ new Map()), e[Wd]; -} -function Kd(e, t, n, r) { - let i = zd(lr$3.isAbsolute(e) ? e : lr$3.resolve(process.cwd(), e)); - if (i.length === 0) return !1; - let a = Gd(); - for (let e of i) { - let i = e.topic, o = a.get(i) ?? [], s = { - consumerGroup: e.consumer, - handler: t, - client: n, - options: r - }, c = o.findIndex((t) => t.consumerGroup === e.consumer); - c >= 0 ? o[c] = s : o.push(s), a.set(i, o); - } - return !0; -} -function qd(e, t, n, r) { - let i = r ?? Ud(); - if (!i) { - console.warn(`${Dd} Could not determine caller file path for handler registration.`); - return; - } - if (!Kd(i, e, t, n)) { - let e = Pd(); - if (e && e.length > 0) return; - let t = process.cwd(), n; - try { - n = lr$3.relative(t, i).replace(/\\/g, `/`); - } catch { - n = i; - } - console.warn(`${Dd} handleCallback() in ${n} has no matching experimentalTriggers in vercel.json. This handler won't receive messages. - -Add a trigger to vercel.json: - "${n}": { - "experimentalTriggers": [{ "type": "queue/v2beta", "topic": "your-topic" }] - }`); - } -} -function Jd(e) { - let t = Gd(), n = []; - for (let [r, i] of t) (r.includes(`*`) ? yd$1(e, r) : r === e) && n.push(...i); - return n; -} -var Yd = 50; -var Xd = 5e3; -var Zd = 2; -var Qd = 250; -var $d = [ - `PORT`, - `NEXT_PORT`, - `NEXTJS_PORT`, - `NUXT_PORT`, - `NITRO_PORT`, - `SVELTEKIT_PORT`, - `VITE_PORT`, - `DEV_PORT`, - `npm_config_port` -]; -var ef = [ - `__NEXT_PRIVATE_ORIGIN`, - `NUXT_PUBLIC_SITE_URL`, - `URL` -]; -function tf(e) { - return e instanceof Error ? e.message : String(e); -} -function nf(e) { - return e instanceof Ju$1 || e instanceof Error && e.name === `MessageNotFoundError`; -} -function rf(e) { - if (!e) return null; - let t = Number.parseInt(e, 10); - return !Number.isFinite(t) || t < 1 || t > 65535 ? null : t; -} -function af(e) { - if (!e) return null; - try { - let t = new URL(e).port; - return rf(t); - } catch { - return null; - } -} -function of() { - let e = [], t = /* @__PURE__ */ new Set(), n = (n) => { - n && !t.has(n) && (t.add(n), e.push(n)); - }; - for (let e of $d) n(rf(process.env[e])); - for (let e of ef) n(af(process.env[e])); - return e; -} -function sf(e) { - return new Promise((t) => { - let n = dr$3.connect({ - host: `localhost`, - port: e - }), r = !1, i = (e) => { - r || (r = !0, n.destroy(), t(e)); - }; - n.once(`connect`, () => i(!0)), n.once(`error`, () => i(!1)), n.setTimeout(Qd, () => i(!1)); - }); -} -async function cf(e, t, n) { - let r = 0, i = Yd; - for (;;) try { - await Ed$1(e, t, n); - return; - } catch (e) { - if (nf(e) && r < Xd) { - await new Promise((e) => setTimeout(e, i)), r += i, i = Math.min(i * Zd, Xd - r); - continue; - } - throw e; - } -} -function lf(e) { - let t = e.replace(/^src\/app\//, `/`).replace(/^src\/pages\//, `/`).replace(/^src\/server\//, `/`).replace(/^src\/routes\//, `/`).replace(/^app\//, `/`).replace(/^pages\//, `/`).replace(/^server\//, `/`).replace(/\/route\.(ts|mts|js|mjs|tsx|jsx)$/, ``).replace(/\/\+server\.(ts|mts|js|mjs|tsx|jsx)$/, ``).replace(/\.(ts|mts|js|mjs|tsx|jsx)$/, ``); - return t.startsWith(`/`) || (t = `/` + t), t; -} -async function uf(e, t = {}) { - let n = { - triedPorts: of(), - listeningPorts: [], - unavailablePorts: [], - importFailures: [], - primeFailures: [] - }, r = Fd(e); - if (r.length === 0) return n; - let i = t.refreshRegistered === !0; - for (let e of n.triedPorts) await sf(e) ? n.listeningPorts.push(e) : n.unavailablePorts.push(e); - for (let t of r) { - let r = ff(e, t.consumer); - if (!(r && !i)) { - if (!r) { - let r = lr$3.resolve(process.cwd(), t.filePath); - try { - await import(r); - } catch (e) { - n.importFailures.push({ - filePath: t.filePath, - reason: tf(e) - }); - } - if (ff(e, t.consumer)) continue; - } - for (let r of n.listeningPorts) { - let i = `http://localhost:${r}${lf(t.filePath)}`; - try { - let r = await fetch(i, { - method: `POST`, - headers: { - "x-vercel-queue-prime": `1`, - "x-vercel-queue-prime-file": t.filePath - } - }); - try { - await r.text(); - } catch {} - if (ff(e, t.consumer)) break; - n.primeFailures.push({ - filePath: t.filePath, - url: i, - reason: `HTTP ${r.status}${r.statusText ? ` ${r.statusText}` : ``}`.trim() - }); - } catch (e) { - n.primeFailures.push({ - filePath: t.filePath, - url: i, - reason: tf(e) - }); - } - } - } - } - return n; -} -function df(e, t, n) { - let r = t.map((e) => e.filePath), i = n.listeningPorts[0] ?? n.triedPorts[0], a = i ? t.map((e) => `http://localhost:${i}${lf(e.filePath)}`) : [], o; - if (n.triedPorts.length === 0) o = `No local dev port detected from env. Set PORT (or NEXT_PORT/NUXT_PORT/VITE_PORT).`; - else if (n.listeningPorts.length === 0) o = `Detected env ports: [${n.triedPorts.join(`, `)}], but none are listening.`; - else { - let e = n.unavailablePorts.length > 0 ? ` Not listening: [${n.unavailablePorts.join(`, `)}].` : ``; - o = `Detected env ports: [${n.triedPorts.join(`, `)}]. Listening: [${n.listeningPorts.join(`, `)}].` + e; - } - let s = n.importFailures.length > 0 ? ` -Import failures: ` + n.importFailures.slice(0, 2).map((e) => `${e.filePath} (${e.reason})`).join(`; `) : ``, c = n.primeFailures.length > 0 ? ` -Prime failures: ` + n.primeFailures.slice(0, 3).map((e) => `${e.url} (${e.reason})`).join(`; `) : ``; - return `${Dd} No registered handler for topic "${e}". vercel.json maps this topic to [${r.join(`, `)}] but auto-loading failed. -${o}${s}${c} -Ensure your dev server is running, set PORT if needed, and confirm mapped route files call handleCallback()/handleNodeCallback() at module scope. -` + (a.length > 0 ? `Try opening: ${a.join(` or `)}` : `Set PORT (or NEXT_PORT/NUXT_PORT/VITE_PORT) and try sending again.`); -} -function ff(e, t) { - return Jd(e).some((e) => e.consumerGroup === t); -} -var pf = 10; -var mf = 2; -var hf = 10; -var gf = 86400; -function _f(e, t) { - let n = Math.min(Math.max(t, 0), pf); - console.log(`${Dd} ${Ad} Scheduling re-delivery in ${n}s: topic="${e.topicName}" consumer="${e.consumerGroup}" messageId="${e.messageId}"`), setTimeout(async () => { - let t = e.deliveryCount + 1, n = new Date(e.createdAt.getTime() + e.retentionSeconds * 1e3); - if (Date.now() >= n.getTime()) { - console.log(`${Dd} Message expired, stopping retries: topic="${e.topicName}" messageId="${e.messageId}"`); - return; - } - if (t > hf) { - console.log(`${Dd} Max re-deliveries (${hf}) reached: topic="${e.topicName}" messageId="${e.messageId}"`); - return; - } - let r = { - messageId: e.messageId, - deliveryCount: t, - createdAt: e.createdAt, - expiresAt: n, - topicName: e.topicName, - consumerGroup: e.consumerGroup, - region: e.region - }; - console.log(`${Dd} Re-delivering: topic="${e.topicName}" consumer="${e.consumerGroup}" messageId="${e.messageId}" deliveryCount=${t}`); - let i = !0, a = null, o = !1; - try { - await e.handler(e.payload, r); - } catch (t) { - if (i = !1, e.retry) { - let n; - try { - n = e.retry(t, r); - } catch (e) { - console.warn(`${Dd} retry handler threw:`, e); - } - n && `afterSeconds` in n ? a = n.afterSeconds : n && `acknowledge` in n && (o = !0); - } - o || console.error(`${Dd} ${kd} Handler error on re-delivery: topic="${e.topicName}" messageId="${e.messageId}"`, t); - } - if (i) console.log(`${Dd} ${Od} Message processed on re-delivery: topic="${e.topicName}" consumer="${e.consumerGroup}" messageId="${e.messageId}"`); - else if (o) console.log(`${Dd} ${Od} Message acknowledged (will not retry): topic="${e.topicName}" consumer="${e.consumerGroup}" messageId="${e.messageId}"`); - else { - let n = a ?? e.defaultRetryDelayS; - _f({ - ...e, - deliveryCount: t - }, n); - } - }, n * 1e3); -} -function vf(e, t, n, r, i) { - if (r && r > 0) { - console.log(`${Dd} Message sent with delay: topic="${e}" messageId="${t}" delay=${r}s`), setTimeout(() => { - vf(e, t, n, void 0, i); - }, r * 1e3); - return; - } - console.log(`${Dd} Message sent: topic="${e}" messageId="${t}"`), (async () => { - let r = Jd(e), a = null; - if (r.length > 0 ? (await uf(e, { refreshRegistered: !0 }), r = Jd(e)) : (a = await uf(e), r = Jd(e)), r.length === 0) { - let t = Fd(e); - if (t.length > 0) { - let n = a ?? { - triedPorts: of(), - listeningPorts: [], - unavailablePorts: [], - importFailures: [], - primeFailures: [] - }; - console.warn(df(e, t, n)); - } else console.warn(`${Dd} No registered handler for topic "${e}". -Ensure vercel.json has a matching experimentalTriggers entry and the route file calls handleCallback().`); - return; - } - let o = r.map((e) => e.consumerGroup); - console.log(`${Dd} Invoking handlers for topic="${e}" messageId="${t}" \u2192 consumers: [${o.join(`, `)}]`); - let s = i ?? gf; - for (let i of r) { - let r, a = /* @__PURE__ */ new Date(), o = 1, c = !0, l = null, u = !1, d = async (e, t) => { - r = e, a = t.createdAt, o = t.deliveryCount; - try { - await i.handler(e, t); - } catch (e) { - throw c = !1, e; - } - }, f = i.options?.retry ? (e, t) => { - let n = i.options.retry(e, t); - return n && `afterSeconds` in n ? l = n.afterSeconds : n && `acknowledge` in n && (u = !0), n; - } : void 0, p = { - queueName: e, - consumerGroup: i.consumerGroup, - messageId: t, - region: n - }, m = { - client: i.client, - visibilityTimeoutSeconds: i.options?.visibilityTimeoutSeconds, - retry: f - }, h = Math.min(Id(e, i.consumerGroup) ?? mf, pf), g = () => ({ - handler: i.handler, - retry: i.options?.retry, - payload: r, - topicName: e, - consumerGroup: i.consumerGroup, - messageId: t, - region: n, - createdAt: a, - retentionSeconds: s, - deliveryCount: o, - defaultRetryDelayS: h - }); - try { - if (await cf(d, p, m), c) console.log(`${Dd} ${Od} Message processed: topic="${e}" consumer="${i.consumerGroup}" messageId="${t}"`); - else if (u) console.log(`${Dd} ${Od} Message acknowledged (will not retry): topic="${e}" consumer="${i.consumerGroup}" messageId="${t}"`); - else if (l !== null) { - let e = Math.min(l, pf); - _f(g(), e); - } - } catch (n) { - console.error(`${Dd} ${kd} Handler failed: topic="${e}" consumer="${i.consumerGroup}" messageId="${t}"`, n), c || _f(g(), h); - } - } - })(); -} -function yf() { - let e = globalThis; - delete e[Md], delete e[Wd]; -} -(process.env.NODE_ENV === `test` || process.env.VITEST) && (globalThis.__clearDevState = yf, globalThis.__filePathToConsumerGroup = Nd, globalThis.__filePathToUrlPath = lf, globalThis.__matchesFunctionsPattern = Rd, globalThis.__stripSrcPrefix = Ld); -function bf() { - return process.env.VERCEL_QUEUE_DEBUG === `1` || process.env.VERCEL_QUEUE_DEBUG === `true`; -} -async function xf(e) { - let t = e.getReader(); - try { - for (;;) { - let { done: e } = await t.read(); - if (e) break; - } - } finally { - t.releaseLock(); - } -} -function Sf(e) { - if (!e) return; - let t = Number(e); - if (Number.isFinite(t) && t >= 0) return t; - let n = Date.parse(e); - if (!Number.isNaN(n)) return Math.max(0, (n - Date.now()) / 1e3); -} -function Cf(e, t, n, r, i = `Invalid parameters`, a) { - throw e === 400 ? new ed$1(n || i) : e === 429 ? new Zu$1(n || `Too many requests: ${r}`, Sf(a)) : e === 401 ? new Qu$1(n || void 0) : e === 403 ? new $u$1(n || void 0) : e >= 500 ? new td$1(n || `Server error: ${e} ${t}`) : Error(`Failed to ${r}: ${e} ${t}`); -} -function wf(e) { - let t = e.get(`Vqs-Message-Id`), n = e.get(`Vqs-Delivery-Count`) || `0`, r = e.get(`Vqs-Timestamp`), i = e.get(`Content-Type`) || `application/octet-stream`, a = e.get(`Vqs-Receipt-Handle`), o = e.get(`Vqs-Expires-At`); - if (!t || !r || !a) return null; - let s = parseInt(n, 10); - return Number.isNaN(s) ? null : { - messageId: t, - deliveryCount: s, - createdAt: new Date(r), - expiresAt: o ? new Date(o) : void 0, - contentType: i, - receiptHandle: a - }; -} -var Tf = /^[a-z]{2,5}[0-9]{1,2}$/; -function Ef(e) { - if (!Tf.test(e)) throw Error(`Invalid region code: ${JSON.stringify(e)}. Region must match the pattern /^[a-z]{2,5}[0-9]{1,2}$/ (e.g. "iad1", "lhr1").`); -} -var Df = (e) => new URL(`https://${e}.vercel-queue.com`); -function Of(e, t) { - return (t ?? Df)(e); -} -var kf = `/api/v3/topic`; -var Af = class e { - baseUrl; - customHeaders; - providedToken; - resolvedDeploymentId; - pinSends; - explicitlyUnpinned; - transport; - region; - baseUrlResolver; - dispatcher; - constructor(e) { - Ef(e.region), this.region = e.region, this.baseUrlResolver = e.resolveBaseUrl, this.baseUrl = Of(this.region, this.baseUrlResolver), this.customHeaders = e.headers || {}, this.providedToken = e.token, this.transport = e.transport || new qu$1(), this.dispatcher = e.dispatcher, e.deploymentId === null ? (this.pinSends = !1, this.explicitlyUnpinned = !0) : (this.resolvedDeploymentId = e.deploymentId || process.env.VERCEL_DEPLOYMENT_ID, this.pinSends = !0, this.explicitlyUnpinned = !1); - } - withRegion(t) { - return new e({ - region: t, - resolveBaseUrl: this.baseUrlResolver, - token: this.providedToken, - headers: { ...this.customHeaders }, - deploymentId: this.explicitlyUnpinned ? null : this.resolvedDeploymentId, - transport: this.transport, - dispatcher: this.dispatcher - }); - } - getRegion() { - return this.region; - } - getTransport() { - return this.transport; - } - requireDeploymentId() { - if (!(jd() || this.explicitlyUnpinned || this.resolvedDeploymentId)) throw Error(`No deployment ID available. VERCEL_DEPLOYMENT_ID is not set. - -This usually means the code is running outside a Vercel deployment (e.g. during build or in a non-Vercel environment). - -To fix this, create a client with an explicit deploymentId: - new QueueClient({ deploymentId: "dpl_xxx" }) -Or explicitly opt out of deployment pinning: - new QueueClient({ deploymentId: null })`); - } - getSendDeploymentId() { - if (!jd()) return this.requireDeploymentId(), this.pinSends ? this.resolvedDeploymentId : void 0; - } - getConsumeDeploymentId() { - if (!jd()) return this.requireDeploymentId(), this.resolvedDeploymentId; - } - async getToken() { - if (this.providedToken) return this.providedToken; - try { - return await (0, Gu$1.getVercelOidcToken)(); - } catch (e) { - let t = e instanceof Error ? e.message : String(e); - throw Error(jd() ? `Failed to get OIDC token for local development. - -To fix this, pull your environment variables with Vercel CLI: - \`vercel env pull\` - -Cause: ${t}` : `Failed to get OIDC token. This usually means the function is running outside of a Vercel Function environment. - -To fix this, either: - - Deploy to Vercel (OIDC tokens are provisioned automatically) - - Provide a token explicitly: \`new QueueClient({ token: '...' })\` - -Cause: ${t}`); - } - } - buildUrl(e, ...t) { - let n = encodeURIComponent(e), r = t.map((e) => encodeURIComponent(e)), i = r.length > 0 ? `/` + r.join(`/`) : ``, a = this.baseUrl.pathname.replace(/\/+$/, ``); - return `${this.baseUrl.origin}${a}${kf}/${n}${i}`; - } - async fetch(e, t) { - let n = t.method || `GET`; - if (bf()) { - let r = { - method: n, - url: e, - headers: t.headers - }, i = t.body; - i != null && (i instanceof ArrayBuffer || i instanceof Uint8Array ? r.bodySize = i.byteLength : typeof i == `string` ? r.bodySize = i.length : r.bodyType = typeof i), console.debug(`[VQS Debug] Request:`, JSON.stringify(r, null, 2)); - } - t.headers.set(`User-Agent`, `@vercel/queue/0.3.1`), t.headers.set(`Vqs-Client-Ts`, (/* @__PURE__ */ new Date()).toISOString()); - let r = this.dispatcher ? { - ...t, - dispatcher: this.dispatcher - } : t, i = await fetch(e, r); - if (bf()) { - let t = { - method: n, - url: e, - status: i.status, - statusText: i.statusText, - headers: i.headers - }; - console.debug(`[VQS Debug] Response:`, JSON.stringify(t, null, 2)); - } - return i; - } - async sendMessage(e) { - let t = this.transport, { queueName: n, payload: r, idempotencyKey: i, retentionSeconds: a, delaySeconds: o, headers: s } = e, c = new Headers(); - if (this.customHeaders) for (let [e, t] of Object.entries(this.customHeaders)) c.append(e, t); - if (s) { - let e = /* @__PURE__ */ new Set([`authorization`, `content-type`]), t = (t) => { - let n = t.toLowerCase(); - return e.has(n) ? !0 : n.startsWith(`vqs-`); - }; - for (let [e, n] of Object.entries(s)) !t(e) && n !== void 0 && c.append(e, n); - } - c.set(`Authorization`, `Bearer ${await this.getToken()}`), c.set(`Content-Type`, t.contentType); - let l = this.getSendDeploymentId(); - l && c.set(`Vqs-Deployment-Id`, l), i && c.set(`Vqs-Idempotency-Key`, i), a !== void 0 && c.set(`Vqs-Retention-Seconds`, a.toString()), o !== void 0 && c.set(`Vqs-Delay-Seconds`, o.toString()); - let u = t.serialize(r), d = Buffer.isBuffer(u) ? new Uint8Array(u) : u, f = await this.fetch(this.buildUrl(n), { - method: `POST`, - body: d, - headers: c - }); - if (!f.ok) { - let e = await f.text(); - if (f.status === 409) throw new id$1(e || `Duplicate idempotency key detected`, i); - if (f.status === 502) throw new ad$1(e || `Consumer discovery failed`, l); - if (f.status === 503) throw new od$1(e || `Consumer registry not configured`); - Cf(f.status, f.statusText, e, `send message`); - } - return f.status === 202 ? (await f.text(), { messageId: null }) : await f.json(); - } - async *receiveMessages(e) { - let t = this.transport, { queueName: n, consumerGroup: r, visibilityTimeoutSeconds: i, limit: a } = e; - if (a !== void 0 && (a < 1 || a > 10)) throw new nd$1(a); - let o = new Headers({ - Authorization: `Bearer ${await this.getToken()}`, - Accept: `multipart/mixed`, - ...this.customHeaders - }); - i !== void 0 && o.set(`Vqs-Visibility-Timeout-Seconds`, i.toString()), a !== void 0 && o.set(`Vqs-Max-Messages`, a.toString()); - let s = this.getConsumeDeploymentId(); - s && o.set(`Vqs-Deployment-Id`, s); - let c = await this.fetch(this.buildUrl(n, `consumer`, r), { - method: `POST`, - headers: o - }); - if (c.status === 204) { - await c.text(); - return; - } - if (!c.ok) { - let e = await c.text(); - Cf(c.status, c.statusText, e, `receive messages`); - } - for await (let e of il$1(c)) try { - let n = wf(e.headers); - if (!n) { - console.warn(`Missing required queue headers in multipart part`), await xf(e.payload); - continue; - } - let r = await t.deserialize(e.payload); - yield { - ...n, - payload: r - }; - } catch (t) { - console.warn(`Failed to process multipart message:`, t), await xf(e.payload); - } - } - async receiveMessageById(e) { - let t = this.transport, { queueName: n, consumerGroup: r, messageId: i, visibilityTimeoutSeconds: a } = e, o = new Headers({ - Authorization: `Bearer ${await this.getToken()}`, - Accept: `multipart/mixed`, - ...this.customHeaders - }); - a !== void 0 && o.set(`Vqs-Visibility-Timeout-Seconds`, a.toString()); - let s = this.getConsumeDeploymentId(); - s && o.set(`Vqs-Deployment-Id`, s); - let c = await this.fetch(this.buildUrl(n, `consumer`, r, `id`, i), { - method: `POST`, - headers: o - }); - if (!c.ok) { - let e = await c.text(); - if (c.status === 404) throw new Ju$1(i); - if (c.status === 409) { - let t = {}; - try { - t = JSON.parse(e); - } catch {} - throw t.originalMessageId ? new Yu$1(i, `This message was a duplicate - use originalMessageId: ${t.originalMessageId}`) : new Yu$1(i); - } - if (c.status === 410) throw new rd$1(i); - Cf(c.status, c.statusText, e, `receive message by ID`); - } - for await (let e of il$1(c)) { - let n = wf(e.headers); - if (!n) throw await xf(e.payload), new Xu$1(i, `Missing required queue headers in response`); - let r = await t.deserialize(e.payload); - return { message: { - ...n, - payload: r - } }; - } - throw new Ju$1(i); - } - async acknowledgeMessage(e) { - let { queueName: t, consumerGroup: n, receiptHandle: r } = e, i = new Headers({ - Authorization: `Bearer ${await this.getToken()}`, - ...this.customHeaders - }), a = this.getConsumeDeploymentId(); - a && i.set(`Vqs-Deployment-Id`, a); - let o = await this.fetch(this.buildUrl(t, `consumer`, n, `lease`, r), { - method: `DELETE`, - headers: i - }); - if (!o.ok) { - let e = await o.text(); - if (o.status === 404) throw new Ju$1(r); - if (o.status === 409) throw new Yu$1(r, e || `Invalid receipt handle, message not in correct state, or already processed`); - Cf(o.status, o.statusText, e, `acknowledge message`, `Missing or invalid receipt handle`, o.headers?.get(`Retry-After`) ?? null); - } - return await o.text(), { acknowledged: !0 }; - } - async changeVisibility(e) { - let { queueName: t, consumerGroup: n, receiptHandle: r, visibilityTimeoutSeconds: i } = e, a = new Headers({ - Authorization: `Bearer ${await this.getToken()}`, - "Content-Type": `application/json`, - ...this.customHeaders - }), o = this.getConsumeDeploymentId(); - o && a.set(`Vqs-Deployment-Id`, o); - let s = await this.fetch(this.buildUrl(t, `consumer`, n, `lease`, r), { - method: `PATCH`, - headers: a, - body: JSON.stringify({ visibilityTimeoutSeconds: i }) - }); - if (!s.ok) { - let e = await s.text(); - if (s.status === 404) throw new Ju$1(r); - if (s.status === 409) throw new Yu$1(r, e || `Invalid receipt handle, message not in correct state, or already processed`); - Cf(s.status, s.statusText, e, `change visibility`, `Missing receipt handle or invalid visibility timeout`, s.headers?.get(`Retry-After`) ?? null); - } - return await s.text(), { success: !0 }; - } -}; -var jf = /* @__PURE__ */ new WeakMap(); -var Mf = Symbol.for(`@vercel/queue.apiClient`); -function Nf(e, t) { - jf.set(e, t), Object.defineProperty(e, Mf, { - value: t, - writable: !1, - enumerable: !1, - configurable: !1 - }); -} -function Pf(e) { - let t = jf.get(e); - if (t) return t; - let n = e[Mf]; - if (typeof n == `object` && n) { - let t = n; - return jf.set(e, t), t; - } - throw Error(`QueueClient not initialized. This may happen when multiple bundled copies of @vercel/queue are loaded in local dev.`); -} -function Ff(e) { - return `request` in e ? e.request : e; -} -function If(e) { - return Pf(e); -} -var Lf = `iad1`; -function Rf(e) { - return e || process.env.VERCEL_REGION || (jd() || console.warn(`[QueueClient] Region not detected \u2014 defaulting to "${Lf}". On Vercel this is set automatically via VERCEL_REGION. To silence this warning, pass region explicitly: new QueueClient({ region: "iad1" })`), Lf); -} -var zf = class { - constructor(e = {}) { - let t = Rf(e.region); - Nf(this, new Af({ - ...e, - region: t - })); - } - send = async (e, t, n) => { - let r = Pf(this), i = await r.sendMessage({ - queueName: e, - payload: t, - idempotencyKey: n?.idempotencyKey, - retentionSeconds: n?.retentionSeconds, - delaySeconds: n?.delaySeconds, - headers: n?.headers - }); - return i.messageId && jd() && vf(e, i.messageId, r.getRegion(), n?.delaySeconds, n?.retentionSeconds), { messageId: i.messageId }; - }; - handleCallback = (e, t) => (jd() && qd(e, this, t), async (n) => { - let r = Ff(n); - if (jd() && r.headers.get(`x-vercel-queue-prime`) === `1`) { - let n = r.headers.get(`x-vercel-queue-prime-file`); - return n && qd(e, this, t, n), Response.json({ status: `primed` }); - } - try { - return await Ed$1(e, await Td$1(r), { - client: this, - visibilityTimeoutSeconds: t?.visibilityTimeoutSeconds, - retry: t?.retry - }), Response.json({ status: `success` }); - } catch (e) { - return console.error(`Queue callback error:`, e), e instanceof Error && (e.message.includes(`Invalid content type`) || e.message.includes(`Invalid CloudEvent`) || e.message.includes(`Missing required CloudEvent`) || e.message.includes(`Failed to parse CloudEvent`) || e.message.includes(`Binary mode callback`)) ? Response.json({ error: e.message }, { status: 400 }) : Response.json({ error: `Failed to process queue message` }, { status: 500 }); - } - }); - handleNodeCallback = (e, t) => (jd() && qd(e, this, t), async (n, r) => { - if (n.method !== `POST`) { - r.status(200).end(); - return; - } - let i = n.headers[`x-vercel-queue-prime`]; - if (jd() && i === `1`) { - let i = n.headers[`x-vercel-queue-prime-file`], a = Array.isArray(i) ? i[0] : i; - a && qd(e, this, t, a), r.status(200).json({ status: `primed` }); - return; - } - try { - await Ed$1(e, wd$1(n.body, n.headers), { - client: this, - visibilityTimeoutSeconds: t?.visibilityTimeoutSeconds, - retry: t?.retry - }), r.status(200).json({ status: `success` }); - } catch (e) { - if (console.error(`Queue callback error:`, e), e instanceof Error && (e.message.includes(`Invalid content type`) || e.message.includes(`Invalid CloudEvent`) || e.message.includes(`Missing required CloudEvent`) || e.message.includes(`Failed to parse CloudEvent`) || e.message.includes(`Binary mode callback`))) { - r.status(400).json({ error: e.message }); - return; - } - r.status(500).json({ error: `Failed to process queue message` }); - } - }); -}; -let Bf; -try { - Bf = new TextDecoder(); -} catch {} -let J$6; -let Vf; -let Y$8 = 0; -const Hf = []; -const Uf = 57337; -const Wf = {}; -let Gf = 11281e4; -let Kf = 1681e4; -let qf = Hf; -let Jf = 0; -let X$8 = {}; -let Yf; -let Xf; -let Zf = 0; -let Qf = 0; -let $f; -let ep; -let tp = []; -let np = []; -let rp; -let ip; -let ap; -let op = { - useRecords: !1, - mapsAsObjects: !0 -}; -let sp = !1; -let cp$1 = 2; -try { - Function(``); -} catch { - cp$1 = Infinity; -} -var lp = class e { - constructor(e) { - if (e && ((e.keyMap || e._keyMap) && !e.useRecords && (e.useRecords = !1, e.mapsAsObjects = !0), e.useRecords === !1 && e.mapsAsObjects === void 0 && (e.mapsAsObjects = !0), e.getStructures && (e.getShared = e.getStructures), e.getShared && !e.structures && ((e.structures = []).uninitialized = !0), e.keyMap)) { - this.mapKey = /* @__PURE__ */ new Map(); - for (let [t, n] of Object.entries(e.keyMap)) this.mapKey.set(n, t); - } - Object.assign(this, e); - } - decodeKey(e) { - return this.keyMap && this.mapKey.get(e) || e; - } - encodeKey(e) { - return this.keyMap && this.keyMap.hasOwnProperty(e) ? this.keyMap[e] : e; - } - encodeKeys(e) { - if (!this._keyMap) return e; - let t = /* @__PURE__ */ new Map(); - for (let [n, r] of Object.entries(e)) t.set(this._keyMap.hasOwnProperty(n) ? this._keyMap[n] : n, r); - return t; - } - decodeKeys(e) { - if (!this._keyMap || e.constructor.name != `Map`) return e; - if (!this._mapKey) { - this._mapKey = /* @__PURE__ */ new Map(); - for (let [e, t] of Object.entries(this._keyMap)) this._mapKey.set(t, e); - } - let t = {}; - return e.forEach((e, n) => t[pp(this._mapKey.has(n) ? this._mapKey.get(n) : n)] = e), t; - } - mapDecode(e, t) { - let n = this.decode(e); - if (this._keyMap) switch (n.constructor.name) { - case `Array`: return n.map((e) => this.decodeKeys(e)); - } - return n; - } - decode(t, n) { - if (J$6) return Lp(() => (Rp(), this ? this.decode(t, n) : e.prototype.decode.call(op, t, n))); - Vf = n > -1 ? n : t.length, Y$8 = 0, Jf = 0, Qf = 0, Xf = null, qf = Hf, $f = null, J$6 = t; - try { - ip = t.dataView ||= new DataView(t.buffer, t.byteOffset, t.byteLength); - } catch (e) { - throw J$6 = null, t instanceof Uint8Array ? e : Error(`Source must be a Uint8Array or Buffer but was a ` + (t && typeof t == `object` ? t.constructor.name : typeof t)); - } - if (this instanceof e) { - if (X$8 = this, rp = this.sharedValues && (this.pack ? Array(this.maxPrivatePackedValues || 16).concat(this.sharedValues) : this.sharedValues), this.structures) return Yf = this.structures, up(); - (!Yf || Yf.length > 0) && (Yf = []); - } else X$8 = op, (!Yf || Yf.length > 0) && (Yf = []), rp = null; - return up(); - } - decodeMultiple(e, t) { - let n, r = 0; - try { - let i = e.length; - sp = !0; - let a = this ? this.decode(e, i) : Bp.decode(e, i); - if (t) { - if (t(a) === !1) return; - for (; Y$8 < i;) if (r = Y$8, t(up()) === !1) return; - } else { - for (n = [a]; Y$8 < i;) r = Y$8, n.push(up()); - return n; - } - } catch (e) { - throw e.lastPosition = r, e.values = n, e; - } finally { - sp = !1, Rp(); - } - } -}; -function up() { - try { - let e = Z$8(); - if ($f) { - if (Y$8 >= $f.postBundlePosition) { - let e = Error(`Unexpected bundle position`); - throw e.incomplete = !0, e; - } - Y$8 = $f.postBundlePosition, $f = null; - } - if (Y$8 == Vf) Yf = null, J$6 = null, ep &&= null; - else if (Y$8 > Vf) { - let e = Error(`Unexpected end of CBOR data`); - throw e.incomplete = !0, e; - } else if (!sp) throw Error(`Data read, but end of buffer not reached`); - return e; - } catch (e) { - throw Rp(), (e instanceof RangeError || e.message.startsWith(`Unexpected end of buffer`)) && (e.incomplete = !0), e; - } -} -function Z$8() { - let e = J$6[Y$8++], t = e >> 5; - if (e &= 31, e > 23) switch (e) { - case 24: - e = J$6[Y$8++]; - break; - case 25: - if (t == 7) return Cp(); - e = ip.getUint16(Y$8), Y$8 += 2; - break; - case 26: - if (t == 7) { - let e = ip.getFloat32(Y$8); - if (X$8.useFloat32 > 2) { - let t = zp[(J$6[Y$8] & 127) << 1 | J$6[Y$8 + 1] >> 7]; - return Y$8 += 4, (t * e + (e > 0 ? .5 : -.5) >> 0) / t; - } - return Y$8 += 4, e; - } - e = ip.getUint32(Y$8), Y$8 += 4; - break; - case 27: - if (t == 7) { - let e = ip.getFloat64(Y$8); - return Y$8 += 8, e; - } - if (t > 1) { - if (ip.getUint32(Y$8) > 0) throw Error(`JavaScript does not support arrays, maps, or strings with length over 4294967295`); - e = ip.getUint32(Y$8 + 4); - } else X$8.int64AsNumber ? (e = ip.getUint32(Y$8) * 4294967296, e += ip.getUint32(Y$8 + 4)) : e = ip.getBigUint64(Y$8); - Y$8 += 8; - break; - case 31: switch (t) { - case 2: - case 3: throw Error(`Indefinite length not supported for byte or text strings`); - case 4: - let e = [], n, r = 0; - for (; (n = Z$8()) != Wf;) { - if (r >= Gf) throw Error(`Array length exceeds ${Gf}`); - e[r++] = n; - } - return t == 4 ? e : t == 3 ? e.join(``) : Buffer.concat(e); - case 5: - let i; - if (X$8.mapsAsObjects) { - let e = {}, t = 0; - if (X$8.keyMap) for (; (i = Z$8()) != Wf;) { - if (t++ >= Kf) throw Error(`Property count exceeds ${Kf}`); - e[pp(X$8.decodeKey(i))] = Z$8(); - } - else for (; (i = Z$8()) != Wf;) { - if (t++ >= Kf) throw Error(`Property count exceeds ${Kf}`); - e[pp(i)] = Z$8(); - } - return e; - } else { - ap &&= (X$8.mapsAsObjects = !0, !1); - let e = /* @__PURE__ */ new Map(); - if (X$8.keyMap) { - let t = 0; - for (; (i = Z$8()) != Wf;) { - if (t++ >= Kf) throw Error(`Map size exceeds ${Kf}`); - e.set(X$8.decodeKey(i), Z$8()); - } - } else { - let t = 0; - for (; (i = Z$8()) != Wf;) { - if (t++ >= Kf) throw Error(`Map size exceeds ${Kf}`); - e.set(i, Z$8()); - } - } - return e; - } - case 7: return Wf; - default: throw Error(`Invalid major type for indefinite length ` + t); - } - default: throw Error(`Unknown token ` + e); - } - switch (t) { - case 0: return e; - case 1: return ~e; - case 2: return bp(e); - case 3: - if (Qf >= Y$8) return Xf.slice(Y$8 - Zf, (Y$8 += e) - Zf); - if (Qf == 0 && Vf < 140 && e < 32) { - let t = e < 16 ? yp(e) : vp(e); - if (t != null) return t; - } - return mp(e); - case 4: - if (e >= Gf) throw Error(`Array length exceeds ${Gf}`); - let t = Array(e); - for (let n = 0; n < e; n++) t[n] = Z$8(); - return t; - case 5: - if (e >= Kf) throw Error(`Map size exceeds ${Gf}`); - if (X$8.mapsAsObjects) { - let t = {}; - if (X$8.keyMap) for (let n = 0; n < e; n++) t[pp(X$8.decodeKey(Z$8()))] = Z$8(); - else for (let n = 0; n < e; n++) t[pp(Z$8())] = Z$8(); - return t; - } else { - ap &&= (X$8.mapsAsObjects = !0, !1); - let t = /* @__PURE__ */ new Map(); - if (X$8.keyMap) for (let n = 0; n < e; n++) t.set(X$8.decodeKey(Z$8()), Z$8()); - else for (let n = 0; n < e; n++) t.set(Z$8(), Z$8()); - return t; - } - case 6: - if (e >= Uf) { - let t = Yf[e & 8191]; - if (t) return t.read ||= fp(t), t.read(); - if (e < 65536) { - if (e == 57343) { - let e = Fp(), t = Z$8(), n = Z$8(); - Tp(t, n); - let r = {}; - if (X$8.keyMap) for (let t = 2; t < e; t++) { - let e = X$8.decodeKey(n[t - 2]); - r[pp(e)] = Z$8(); - } - else for (let t = 2; t < e; t++) { - let e = n[t - 2]; - r[pp(e)] = Z$8(); - } - return r; - } else if (e == 57342) { - let e = Fp(), t = Z$8(); - for (let n = 2; n < e; n++) Tp(t++, Z$8()); - return Z$8(); - } else if (e == Uf) return Pp(); - if (X$8.getShared && (Ip(), t = Yf[e & 8191], t)) return t.read ||= fp(t), t.read(); - } - } - let n = tp[e]; - if (n) return n.handlesRead ? n(Z$8) : n(Z$8()); - { - let t = Z$8(); - for (let n = 0; n < np.length; n++) { - let r = np[n](e, t); - if (r !== void 0) return r; - } - return new wp(t, e); - } - case 7: switch (e) { - case 20: return !1; - case 21: return !0; - case 22: return null; - case 23: return; - default: - let t = (rp || kp())[e]; - if (t !== void 0) return t; - throw Error(`Unknown token ` + e); - } - default: - if (isNaN(e)) { - let e = Error(`Unexpected end of CBOR data`); - throw e.incomplete = !0, e; - } - throw Error(`Unknown CBOR token ` + e); - } -} -const dp = /^[a-zA-Z_$][a-zA-Z\d_$]*$/; -function fp(e) { - if (!e) throw Error(`Structure is required in record definition`); - function t() { - let e = J$6[Y$8++]; - if (e &= 31, e > 23) switch (e) { - case 24: - e = J$6[Y$8++]; - break; - case 25: - e = ip.getUint16(Y$8), Y$8 += 2; - break; - case 26: - e = ip.getUint32(Y$8), Y$8 += 4; - break; - default: throw Error(`Expected array header, but got ` + J$6[Y$8 - 1]); - } - let t = this.compiledReader; - for (; t;) { - if (t.propertyCount === e) return t(Z$8); - t = t.next; - } - if (this.slowReads++ >= cp$1) { - let n = this.length == e ? this : this.slice(0, e); - return t = X$8.keyMap ? Function(`r`, `return {` + n.map((e) => X$8.decodeKey(e)).map((e) => dp.test(e) ? pp(e) + `:r()` : `[` + JSON.stringify(e) + `]:r()`).join(`,`) + `}`) : Function(`r`, `return {` + n.map((e) => dp.test(e) ? pp(e) + `:r()` : `[` + JSON.stringify(e) + `]:r()`).join(`,`) + `}`), this.compiledReader && (t.next = this.compiledReader), t.propertyCount = e, this.compiledReader = t, t(Z$8); - } - let n = {}; - if (X$8.keyMap) for (let t = 0; t < e; t++) n[pp(X$8.decodeKey(this[t]))] = Z$8(); - else for (let t = 0; t < e; t++) n[pp(this[t])] = Z$8(); - return n; - } - return e.slowReads = 0, t; -} -function pp(e) { - if (typeof e == `string`) return e === `__proto__` ? `__proto_` : e; - if (typeof e == `number` || typeof e == `boolean` || typeof e == `bigint`) return e.toString(); - if (e == null) return e + ``; - throw Error(`Invalid property name type ` + typeof e); -} -let mp = gp; -function hp(e) { - mp = t(1); - function t(t) { - return function(t) { - let n = qf[Jf++]; - if (n == null) { - if ($f) return gp(t); - let r = e(Y$8, Vf, t, J$6); - if (typeof r == `string`) n = r, qf = Hf; - else if (qf = r, Jf = 1, Qf = 1, n = qf[0], n === void 0) throw Error(`Unexpected end of buffer`); - } - let r = n.length; - return r <= t ? (Y$8 += t, n) : (Xf = n, Zf = Y$8, Qf = Y$8 + r, Y$8 += t, n.slice(0, t)); - }; - } -} -function gp(e) { - let t; - if (e < 16 && (t = yp(e))) return t; - if (e > 64 && Bf) return Bf.decode(J$6.subarray(Y$8, Y$8 += e)); - let n = Y$8 + e, r = []; - for (t = ``; Y$8 < n;) { - let e = J$6[Y$8++]; - if (!(e & 128)) r.push(e); - else if ((e & 224) == 192) { - let t = J$6[Y$8++] & 63; - r.push((e & 31) << 6 | t); - } else if ((e & 240) == 224) { - let t = J$6[Y$8++] & 63, n = J$6[Y$8++] & 63; - r.push((e & 31) << 12 | t << 6 | n); - } else if ((e & 248) == 240) { - let t = J$6[Y$8++] & 63, n = J$6[Y$8++] & 63, i = J$6[Y$8++] & 63, a = (e & 7) << 18 | t << 12 | n << 6 | i; - a > 65535 && (a -= 65536, r.push(a >>> 10 & 1023 | 55296), a = 56320 | a & 1023), r.push(a); - } else r.push(e); - r.length >= 4096 && (t += _p.apply(String, r), r.length = 0); - } - return r.length > 0 && (t += _p.apply(String, r)), t; -} -let _p = String.fromCharCode; -function vp(e) { - let t = Y$8, n = Array(e); - for (let r = 0; r < e; r++) { - let e = J$6[Y$8++]; - if ((e & 128) > 0) { - Y$8 = t; - return; - } - n[r] = e; - } - return _p.apply(String, n); -} -function yp(e) { - if (e < 4) if (e < 2) { - if (e === 0) return ``; - { - let e = J$6[Y$8++]; - if ((e & 128) > 1) { - --Y$8; - return; - } - return _p(e); - } - } else { - let t = J$6[Y$8++], n = J$6[Y$8++]; - if ((t & 128) > 0 || (n & 128) > 0) { - Y$8 -= 2; - return; - } - if (e < 3) return _p(t, n); - let r = J$6[Y$8++]; - if ((r & 128) > 0) { - Y$8 -= 3; - return; - } - return _p(t, n, r); - } - else { - let t = J$6[Y$8++], n = J$6[Y$8++], r = J$6[Y$8++], i = J$6[Y$8++]; - if ((t & 128) > 0 || (n & 128) > 0 || (r & 128) > 0 || (i & 128) > 0) { - Y$8 -= 4; - return; - } - if (e < 6) { - if (e === 4) return _p(t, n, r, i); - { - let e = J$6[Y$8++]; - if ((e & 128) > 0) { - Y$8 -= 5; - return; - } - return _p(t, n, r, i, e); - } - } else if (e < 8) { - let a = J$6[Y$8++], o = J$6[Y$8++]; - if ((a & 128) > 0 || (o & 128) > 0) { - Y$8 -= 6; - return; - } - if (e < 7) return _p(t, n, r, i, a, o); - let s = J$6[Y$8++]; - if ((s & 128) > 0) { - Y$8 -= 7; - return; - } - return _p(t, n, r, i, a, o, s); - } else { - let a = J$6[Y$8++], o = J$6[Y$8++], s = J$6[Y$8++], c = J$6[Y$8++]; - if ((a & 128) > 0 || (o & 128) > 0 || (s & 128) > 0 || (c & 128) > 0) { - Y$8 -= 8; - return; - } - if (e < 10) { - if (e === 8) return _p(t, n, r, i, a, o, s, c); - { - let e = J$6[Y$8++]; - if ((e & 128) > 0) { - Y$8 -= 9; - return; - } - return _p(t, n, r, i, a, o, s, c, e); - } - } else if (e < 12) { - let l = J$6[Y$8++], u = J$6[Y$8++]; - if ((l & 128) > 0 || (u & 128) > 0) { - Y$8 -= 10; - return; - } - if (e < 11) return _p(t, n, r, i, a, o, s, c, l, u); - let d = J$6[Y$8++]; - if ((d & 128) > 0) { - Y$8 -= 11; - return; - } - return _p(t, n, r, i, a, o, s, c, l, u, d); - } else { - let l = J$6[Y$8++], u = J$6[Y$8++], d = J$6[Y$8++], f = J$6[Y$8++]; - if ((l & 128) > 0 || (u & 128) > 0 || (d & 128) > 0 || (f & 128) > 0) { - Y$8 -= 12; - return; - } - if (e < 14) { - if (e === 12) return _p(t, n, r, i, a, o, s, c, l, u, d, f); - { - let e = J$6[Y$8++]; - if ((e & 128) > 0) { - Y$8 -= 13; - return; - } - return _p(t, n, r, i, a, o, s, c, l, u, d, f, e); - } - } else { - let p = J$6[Y$8++], m = J$6[Y$8++]; - if ((p & 128) > 0 || (m & 128) > 0) { - Y$8 -= 14; - return; - } - if (e < 15) return _p(t, n, r, i, a, o, s, c, l, u, d, f, p, m); - let h = J$6[Y$8++]; - if ((h & 128) > 0) { - Y$8 -= 15; - return; - } - return _p(t, n, r, i, a, o, s, c, l, u, d, f, p, m, h); - } - } - } - } -} -function bp(e) { - return X$8.copyBuffers ? Uint8Array.prototype.slice.call(J$6, Y$8, Y$8 += e) : J$6.subarray(Y$8, Y$8 += e); -} -let xp = /* @__PURE__ */ new Float32Array(1); -let Sp = new Uint8Array(xp.buffer, 0, 4); -function Cp() { - let e = J$6[Y$8++], t = J$6[Y$8++], n = (e & 127) >> 2; - if (n === 31) return t || e & 3 ? NaN : e & 128 ? -Infinity : Infinity; - if (n === 0) { - let n = ((e & 3) << 8 | t) / (1 << 24); - return e & 128 ? -n : n; - } - return Sp[3] = e & 128 | (n >> 1) + 56, Sp[2] = (e & 7) << 5 | t >> 3, Sp[1] = t << 5, Sp[0] = 0, xp[0]; -} -Array(4096); -var wp = class { - constructor(e, t) { - this.value = e, this.tag = t; - } -}; -tp[0] = (e) => new Date(e), tp[1] = (e) => new Date(Math.round(e * 1e3)), tp[2] = (e) => { - let t = BigInt(0); - for (let n = 0, r = e.byteLength; n < r; n++) t = BigInt(e[n]) + (t << BigInt(8)); - return t; -}, tp[3] = (e) => BigInt(-1) - tp[2](e), tp[4] = (e) => +(e[1] + `e` + e[0]), tp[5] = (e) => e[1] * Math.exp(e[0] * Math.log(2)); -const Tp = (e, t) => { - e -= 57344; - let n = Yf[e]; - n && n.isShared && ((Yf.restoreStructures ||= [])[e] = n), Yf[e] = t, t.read = fp(t); -}; -tp[105] = (e) => { - let t = e.length, n = e[1]; - Tp(e[0], n); - let r = {}; - for (let i = 2; i < t; i++) { - let t = n[i - 2]; - r[pp(t)] = e[i]; - } - return r; -}, tp[14] = (e) => $f ? $f[0].slice($f.position0, $f.position0 += e) : new wp(e, 14), tp[15] = (e) => $f ? $f[1].slice($f.position1, $f.position1 += e) : new wp(e, 15); -let Ep = { - Error, - RegExp -}; -tp[27] = (e) => (Ep[e[0]] || Error)(e[1], e[2]); -const Dp = (e) => { - if (J$6[Y$8++] != 132) { - let e = Error(`Packed values structure must be followed by a 4 element array`); - throw J$6.length < Y$8 && (e.incomplete = !0), e; - } - let t = e(); - if (!t || !t.length) { - let e = Error(`Packed values structure must be followed by a 4 element array`); - throw e.incomplete = !0, e; - } - return rp = rp ? t.concat(rp.slice(t.length)) : t, rp.prefixes = e(), rp.suffixes = e(), e(); -}; -Dp.handlesRead = !0, tp[51] = Dp, tp[6] = (e) => { - if (!rp) if (X$8.getShared) Ip(); - else return new wp(e, 6); - if (typeof e == `number`) return rp[16 + (e >= 0 ? 2 * e : -2 * e - 1)]; - let t = Error(`No support for non-integer packed references yet`); - throw e === void 0 && (t.incomplete = !0), t; -}, tp[28] = (e) => { - ep || (ep = /* @__PURE__ */ new Map(), ep.id = 0); - let t = ep.id++, n = Y$8, r = J$6[Y$8], i; - i = r >> 5 == 4 ? [] : {}; - let a = { target: i }; - ep.set(t, a); - let o = e(); - return a.used ? (Object.getPrototypeOf(i) !== Object.getPrototypeOf(o) && (Y$8 = n, i = o, ep.set(t, { target: i }), o = e()), Object.assign(i, o)) : (a.target = o, o); -}, tp[28].handlesRead = !0, tp[29] = (e) => { - let t = ep.get(e); - return t.used = !0, t.target; -}, tp[258] = (e) => new Set(e), (tp[259] = (e) => (X$8.mapsAsObjects && (X$8.mapsAsObjects = !1, ap = !0), e())).handlesRead = !0; -function Op(e, t) { - return typeof e == `string` ? e + t : e instanceof Array ? e.concat(t) : Object.assign({}, e, t); -} -function kp() { - if (!rp) if (X$8.getShared) Ip(); - else throw Error(`No packed values available`); - return rp; -} -np.push((e, t) => { - if (e >= 225 && e <= 255) return Op(kp().prefixes[e - 224], t); - if (e >= 28704 && e <= 32767) return Op(kp().prefixes[e - 28672], t); - if (e >= 1879052288 && e <= 2147483647) return Op(kp().prefixes[e - 1879048192], t); - if (e >= 216 && e <= 223) return Op(t, kp().suffixes[e - 216]); - if (e >= 27647 && e <= 28671) return Op(t, kp().suffixes[e - 27639]); - if (e >= 1811940352 && e <= 1879048191) return Op(t, kp().suffixes[e - 1811939328]); - if (e == 1399353956) return { - packedValues: rp, - structures: Yf.slice(0), - version: t - }; - if (e == 55799) return t; -}); -const Ap = new Uint8Array(new Uint16Array([1]).buffer)[0] == 1; -const jp = [ - Uint8Array, - Uint8ClampedArray, - Uint16Array, - Uint32Array, - typeof BigUint64Array > `u` ? { name: `BigUint64Array` } : BigUint64Array, - Int8Array, - Int16Array, - Int32Array, - typeof BigInt64Array > `u` ? { name: `BigInt64Array` } : BigInt64Array, - Float32Array, - Float64Array -]; -const Mp = [ - 64, - 68, - 69, - 70, - 71, - 72, - 77, - 78, - 79, - 85, - 86 -]; -for (let e = 0; e < jp.length; e++) Np(jp[e], Mp[e]); -function Np(e, t) { - let n = `get` + e.name.slice(0, -5), r; - typeof e == `function` ? r = e.BYTES_PER_ELEMENT : e = null; - for (let i = 0; i < 2; i++) { - if (!i && r == 1) continue; - let a = r == 2 ? 1 : r == 4 ? 2 : r == 8 ? 3 : 0; - tp[i ? t : t - 4] = r == 1 || i == Ap ? (n) => { - if (!e) throw Error(`Could not find typed array for code ` + t); - return !X$8.copyBuffers && (r === 1 || r === 2 && !(n.byteOffset & 1) || r === 4 && !(n.byteOffset & 3) || r === 8 && !(n.byteOffset & 7)) ? new e(n.buffer, n.byteOffset, n.byteLength >> a) : new e(Uint8Array.prototype.slice.call(n, 0).buffer); - } : (r) => { - if (!e) throw Error(`Could not find typed array for code ` + t); - let o = new DataView(r.buffer, r.byteOffset, r.byteLength), s = r.length >> a, c = new e(s), l = o[n]; - for (let e = 0; e < s; e++) c[e] = l.call(o, e << a, i); - return c; - }; - } -} -function Pp() { - let e = Fp(), t = Y$8 + Z$8(); - for (let t = 2; t < e; t++) { - let e = Fp(); - Y$8 += e; - } - let n = Y$8; - return Y$8 = t, $f = [gp(Fp()), gp(Fp())], $f.position0 = 0, $f.position1 = 0, $f.postBundlePosition = Y$8, Y$8 = n, Z$8(); -} -function Fp() { - let e = J$6[Y$8++] & 31; - if (e > 23) switch (e) { - case 24: - e = J$6[Y$8++]; - break; - case 25: - e = ip.getUint16(Y$8), Y$8 += 2; - break; - case 26: - e = ip.getUint32(Y$8), Y$8 += 4; - break; - } - return e; -} -function Ip() { - if (X$8.getShared) { - let e = Lp(() => (J$6 = null, X$8.getShared())) || {}, t = e.structures || []; - X$8.sharedVersion = e.version, rp = X$8.sharedValues = e.packedValues, Yf === !0 ? X$8.structures = Yf = t : Yf.splice.apply(Yf, [0, t.length].concat(t)); - } -} -function Lp(e) { - let t = Vf, n = Y$8, r = Jf, i = Zf, a = Qf, o = Xf, s = qf, c = ep, l = $f, u = new Uint8Array(J$6.slice(0, Vf)), d = Yf, f = X$8, p = sp, m = e(); - return Vf = t, Y$8 = n, Jf = r, Zf = i, Qf = a, Xf = o, qf = s, ep = c, $f = l, J$6 = u, sp = p, Yf = d, X$8 = f, ip = new DataView(J$6.buffer, J$6.byteOffset, J$6.byteLength), m; -} -function Rp() { - J$6 = null, ep = null, Yf = null; -} -const zp = Array(147); -for (let e = 0; e < 256; e++) zp[e] = +(`1e` + Math.floor(45.15 - e * .30103)); -let Bp = new lp({ useRecords: !1 }); -const Vp = Bp.decode; -Bp.decodeMultiple; -const Hp = { - NEVER: 0, - ALWAYS: 1, - DECIMAL_ROUND: 3, - DECIMAL_FIT: 4 -}; -let Up; -try { - Up = new TextEncoder(); -} catch {} -let Wp; -let Gp; -const Kp = typeof globalThis == `object` && globalThis.Buffer; -const qp = Kp !== void 0; -const Jp = qp ? Kp.allocUnsafeSlow : Uint8Array; -const Yp = qp ? Kp : Uint8Array; -const Xp = qp ? 4294967296 : 2144337920; -let Zp; -let Q$8; -let Qp; -let $$8 = 0; -let $p; -let em = null; -const tm = /[\u0080-\uFFFF]/; -const nm = Symbol(`record-id`); -var rm$1 = class extends lp { - constructor(e) { - super(e), this.offset = 0; - let t, n, r, i, a; - e ||= {}; - let o = Yp.prototype.utf8Write ? function(e, t, n) { - return Q$8.utf8Write(e, t, n); - } : Up && Up.encodeInto ? function(e, t) { - return Up.encodeInto(e, Q$8.subarray(t)).written; - } : !1, s = this, c = e.structures || e.saveStructures, l = e.maxSharedStructures; - if (l ??= c ? 128 : 0, l > 8190) throw Error(`Maximum maxSharedStructure is 8190`); - let u = e.sequential; - u && (l = 0), this.structures ||= [], this.saveStructures && (this.saveShared = this.saveStructures); - let d, f, p = e.sharedValues, m; - if (p) { - m = Object.create(null); - for (let e = 0, t = p.length; e < t; e++) m[p[e]] = e; - } - let h = [], g = 0, _ = 0; - this.mapEncode = function(e, t) { - if (this._keyMap && !this._mapped) switch (e.constructor.name) { - case `Array`: - e = e.map((e) => this.encodeKeys(e)); - break; - } - return this.encode(e, t); - }, this.encode = function(o, c) { - if (Q$8 || (Q$8 = new Jp(8192), Qp = new DataView(Q$8.buffer, 0, 8192), $$8 = 0), $p = Q$8.length - 10, $p - $$8 < 2048 ? (Q$8 = new Jp(Q$8.length), Qp = new DataView(Q$8.buffer, 0, Q$8.length), $p = Q$8.length - 10, $$8 = 0) : c === 512 && ($$8 = $$8 + 7 & 2147483640), t = $$8, s.useSelfDescribedHeader && (Qp.setUint32($$8, 3654940416), $$8 += 3), a = s.structuredClone ? /* @__PURE__ */ new Map() : null, s.bundleStrings && typeof o != `string` ? (em = [], em.size = Infinity) : em = null, n = s.structures, n) { - if (n.uninitialized) { - let e = s.getShared() || {}; - s.structures = n = e.structures || [], s.sharedVersion = e.version; - let t = s.sharedValues = e.packedValues; - if (t) { - m = {}; - for (let e = 0, n = t.length; e < n; e++) m[t[e]] = e; - } - } - let e = n.length; - if (e > l && !u && (e = l), !n.transitions) { - n.transitions = Object.create(null); - for (let t = 0; t < e; t++) { - let e = n[t]; - if (!e) continue; - let r, i = n.transitions; - for (let n = 0, a = e.length; n < a; n++) { - i[nm] === void 0 && (i[nm] = t); - let a = e[n]; - r = i[a], r ||= i[a] = Object.create(null), i = r; - } - i[nm] = t | 1048576; - } - } - u || (n.nextId = e); - } - if (r &&= !1, i = n || [], f = m, e.pack) { - let t = /* @__PURE__ */ new Map(); - if (t.values = [], t.encoder = s, t.maxValues = e.maxPrivatePackedValues || (m ? 16 : Infinity), t.objectMap = m || !1, t.samplingPackedValues = d, lm(o, t), t.values.length > 0) { - Q$8[$$8++] = 216, Q$8[$$8++] = 51, om(4); - let e = t.values; - v(e), om(0), om(0), f = Object.create(m || null); - for (let t = 0, n = e.length; t < n; t++) f[e[t]] = t; - } - } - Zp = c & xm; - try { - if (Zp) return; - if (v(o), em && mm(t, v), s.offset = $$8, a && a.idsToInsert) { - $$8 += a.idsToInsert.length * 2, $$8 > $p && b($$8), s.offset = $$8; - let e = pm(Q$8.subarray(t, $$8), a.idsToInsert); - return a = null, e; - } - return c & 512 ? (Q$8.start = t, Q$8.end = $$8, Q$8) : Q$8.subarray(t, $$8); - } finally { - if (n) { - if (_ < 10 && _++, n.length > l && (n.length = l), g > 1e4) n.transitions = null, _ = 0, g = 0, h.length > 0 && (h = []); - else if (h.length > 0 && !u) { - for (let e = 0, t = h.length; e < t; e++) h[e][nm] = void 0; - h = []; - } - } - if (r && s.saveShared) { - s.structures.length > l && (s.structures = s.structures.slice(0, l)); - let e = Q$8.subarray(t, $$8); - return s.updateSharedData() === !1 ? s.encode(o) : e; - } - c & 1024 && ($$8 = t); - } - }, this.findCommonStringsToPack = () => (d = /* @__PURE__ */ new Map(), m ||= Object.create(null), (e) => { - let t = e && e.threshold || 4, n = this.pack ? e.maxPrivatePackedValues || 16 : 0; - p ||= this.sharedValues = []; - for (let [e, i] of d) i.count > t && (m[e] = n++, p.push(e), r = !0); - for (; this.saveShared && this.updateSharedData() === !1;); - d = null; - }); - let v = (n) => { - $$8 > $p && (Q$8 = b($$8)); - var r = typeof n, i; - if (r === `string`) { - if (f) { - let t = f[n]; - if (t >= 0) { - t < 16 ? Q$8[$$8++] = t + 224 : (Q$8[$$8++] = 198, t & 1 ? v(15 - t >> 1) : v(t - 16 >> 1)); - return; - } else if (d && !e.pack) { - let e = d.get(n); - e ? e.count++ : d.set(n, { count: 1 }); - } - } - let r = n.length; - if (em && r >= 4 && r < 1024) { - if ((em.size += r) > 61440) { - let e, n = (em[0] ? em[0].length * 3 + em[1].length : 0) + 10; - $$8 + n > $p && (Q$8 = b($$8 + n)), Q$8[$$8++] = 217, Q$8[$$8++] = 223, Q$8[$$8++] = 249, Q$8[$$8++] = em.position ? 132 : 130, Q$8[$$8++] = 26, e = $$8 - t, $$8 += 4, em.position && mm(t, v), em = [``, ``], em.size = 0, em.position = e; - } - let e = tm.test(n); - em[+!e] += n, Q$8[$$8++] = e ? 206 : 207, v(r); - return; - } - let a; - a = r < 32 ? 1 : r < 256 ? 2 : r < 65536 ? 3 : 5; - let s = r * 3; - if ($$8 + s > $p && (Q$8 = b($$8 + s)), r < 64 || !o) { - let e, t, o, s = $$8 + a; - for (e = 0; e < r; e++) t = n.charCodeAt(e), t < 128 ? Q$8[s++] = t : t < 2048 ? (Q$8[s++] = t >> 6 | 192, Q$8[s++] = t & 63 | 128) : (t & 64512) == 55296 && ((o = n.charCodeAt(e + 1)) & 64512) == 56320 ? (t = 65536 + ((t & 1023) << 10) + (o & 1023), e++, Q$8[s++] = t >> 18 | 240, Q$8[s++] = t >> 12 & 63 | 128, Q$8[s++] = t >> 6 & 63 | 128, Q$8[s++] = t & 63 | 128) : (Q$8[s++] = t >> 12 | 224, Q$8[s++] = t >> 6 & 63 | 128, Q$8[s++] = t & 63 | 128); - i = s - $$8 - a; - } else i = o(n, $$8 + a, s); - i < 24 ? Q$8[$$8++] = 96 | i : i < 256 ? (a < 2 && Q$8.copyWithin($$8 + 2, $$8 + 1, $$8 + 1 + i), Q$8[$$8++] = 120, Q$8[$$8++] = i) : i < 65536 ? (a < 3 && Q$8.copyWithin($$8 + 3, $$8 + 2, $$8 + 2 + i), Q$8[$$8++] = 121, Q$8[$$8++] = i >> 8, Q$8[$$8++] = i & 255) : (a < 5 && Q$8.copyWithin($$8 + 5, $$8 + 3, $$8 + 3 + i), Q$8[$$8++] = 122, Qp.setUint32($$8, i), $$8 += 4), $$8 += i; - } else if (r === `number`) if (!this.alwaysUseFloat && n >>> 0 === n) n < 24 ? Q$8[$$8++] = n : n < 256 ? (Q$8[$$8++] = 24, Q$8[$$8++] = n) : n < 65536 ? (Q$8[$$8++] = 25, Q$8[$$8++] = n >> 8, Q$8[$$8++] = n & 255) : (Q$8[$$8++] = 26, Qp.setUint32($$8, n), $$8 += 4); - else if (!this.alwaysUseFloat && n >> 0 === n) n >= -24 ? Q$8[$$8++] = 31 - n : n >= -256 ? (Q$8[$$8++] = 56, Q$8[$$8++] = ~n) : n >= -65536 ? (Q$8[$$8++] = 57, Qp.setUint16($$8, ~n), $$8 += 2) : (Q$8[$$8++] = 58, Qp.setUint32($$8, ~n), $$8 += 4); - else { - let e; - if ((e = this.useFloat32) > 0 && n < 4294967296 && n >= -2147483648) { - Q$8[$$8++] = 250, Qp.setFloat32($$8, n); - let t; - if (e < 4 || (t = n * zp[(Q$8[$$8] & 127) << 1 | Q$8[$$8 + 1] >> 7]) >> 0 === t) { - $$8 += 4; - return; - } else $$8--; - } - Q$8[$$8++] = 251, Qp.setFloat64($$8, n), $$8 += 8; - } - else if (r === `object`) if (!n) Q$8[$$8++] = 246; - else { - if (a) { - let e = a.get(n); - if (e) { - if (Q$8[$$8++] = 216, Q$8[$$8++] = 29, Q$8[$$8++] = 25, !e.references) { - let t = a.idsToInsert ||= []; - e.references = [], t.push(e); - } - e.references.push($$8 - t), $$8 += 2; - return; - } else a.set(n, { offset: $$8 - t }); - } - let e = n.constructor; - if (e === Object) y(n); - else if (e === Array) { - i = n.length, i < 24 ? Q$8[$$8++] = 128 | i : om(i); - for (let e = 0; e < i; e++) v(n[e]); - } else if (e === Map) if ((this.mapsAsObjects ? this.useTag259ForMaps !== !1 : this.useTag259ForMaps) && (Q$8[$$8++] = 217, Q$8[$$8++] = 1, Q$8[$$8++] = 3), i = n.size, i < 24 ? Q$8[$$8++] = 160 | i : i < 256 ? (Q$8[$$8++] = 184, Q$8[$$8++] = i) : i < 65536 ? (Q$8[$$8++] = 185, Q$8[$$8++] = i >> 8, Q$8[$$8++] = i & 255) : (Q$8[$$8++] = 186, Qp.setUint32($$8, i), $$8 += 4), s.keyMap) for (let [e, t] of n) v(s.encodeKey(e)), v(t); - else for (let [e, t] of n) v(e), v(t); - else { - for (let e = 0, t = Wp.length; e < t; e++) { - let t = Gp[e]; - if (n instanceof t) { - let t = Wp[e], r = t.tag; - r ??= t.getTag && t.getTag.call(this, n), r < 24 ? Q$8[$$8++] = 192 | r : r < 256 ? (Q$8[$$8++] = 216, Q$8[$$8++] = r) : r < 65536 ? (Q$8[$$8++] = 217, Q$8[$$8++] = r >> 8, Q$8[$$8++] = r & 255) : r > -1 && (Q$8[$$8++] = 218, Qp.setUint32($$8, r), $$8 += 4), t.encode.call(this, n, v, b); - return; - } - } - if (n[Symbol.iterator]) { - if (Zp) { - let e = Error(`Iterable should be serialized as iterator`); - throw e.iteratorNotHandled = !0, e; - } - Q$8[$$8++] = 159; - for (let e of n) v(e); - Q$8[$$8++] = 255; - return; - } - if (n[Symbol.asyncIterator] || cm(n)) { - let e = Error(`Iterable/blob should be serialized as iterator`); - throw e.iteratorNotHandled = !0, e; - } - if (this.useToJSON && n.toJSON) { - let e = n.toJSON(); - if (e !== n) return v(e); - } - y(n); - } - } - else if (r === `boolean`) Q$8[$$8++] = n ? 245 : 244; - else if (r === `bigint`) { - if (n < BigInt(1) << BigInt(64) && n >= 0) Q$8[$$8++] = 27, Qp.setBigUint64($$8, n); - else if (n > -(BigInt(1) << BigInt(64)) && n < 0) Q$8[$$8++] = 59, Qp.setBigUint64($$8, -n - BigInt(1)); - else if (this.largeBigIntToFloat) Q$8[$$8++] = 251, Qp.setFloat64($$8, Number(n)); - else { - n >= BigInt(0) ? Q$8[$$8++] = 194 : (Q$8[$$8++] = 195, n = BigInt(-1) - n); - let e = []; - for (; n;) e.push(Number(n & BigInt(255))), n >>= BigInt(8); - fm(new Uint8Array(e.reverse()), b); - return; - } - $$8 += 8; - } else if (r === `undefined`) Q$8[$$8++] = 247; - else throw Error(`Unknown type: ` + r); - }, y = this.useRecords === !1 ? this.variableMapSize ? (e) => { - let t = Object.keys(e), n = Object.values(e), r = t.length; - if (r < 24 ? Q$8[$$8++] = 160 | r : r < 256 ? (Q$8[$$8++] = 184, Q$8[$$8++] = r) : r < 65536 ? (Q$8[$$8++] = 185, Q$8[$$8++] = r >> 8, Q$8[$$8++] = r & 255) : (Q$8[$$8++] = 186, Qp.setUint32($$8, r), $$8 += 4), s.keyMap) for (let e = 0; e < r; e++) v(s.encodeKey(t[e])), v(n[e]); - else for (let e = 0; e < r; e++) v(t[e]), v(n[e]); - } : (e) => { - Q$8[$$8++] = 185; - let n = $$8 - t; - $$8 += 2; - let r = 0; - if (s.keyMap) for (let t in e) (typeof e.hasOwnProperty != `function` || e.hasOwnProperty(t)) && (v(s.encodeKey(t)), v(e[t]), r++); - else for (let t in e) (typeof e.hasOwnProperty != `function` || e.hasOwnProperty(t)) && (v(t), v(e[t]), r++); - Q$8[n++ + t] = r >> 8, Q$8[n + t] = r & 255; - } : (e, t) => { - let n, a = i.transitions ||= Object.create(null), o = 0, s = 0, c, u; - if (this.keyMap) { - u = Object.keys(e).map((e) => this.encodeKey(e)), s = u.length; - for (let e = 0; e < s; e++) { - let t = u[e]; - n = a[t], n || (n = a[t] = Object.create(null), o++), a = n; - } - } else for (let t in e) (typeof e.hasOwnProperty != `function` || e.hasOwnProperty(t)) && (n = a[t], n || (a[nm] & 1048576 && (c = a[nm] & 65535), n = a[t] = Object.create(null), o++), a = n, s++); - let d = a[nm]; - if (d !== void 0) d &= 65535, Q$8[$$8++] = 217, Q$8[$$8++] = d >> 8 | 224, Q$8[$$8++] = d & 255; - else if (u ||= a.__keys__ ||= Object.keys(e), c === void 0 ? (d = i.nextId++, d || (d = 0, i.nextId = 1), d >= 256 && (i.nextId = (d = l) + 1)) : d = c, i[d] = u, d < l) { - Q$8[$$8++] = 217, Q$8[$$8++] = d >> 8 | 224, Q$8[$$8++] = d & 255, a = i.transitions; - for (let e = 0; e < s; e++) (a[nm] === void 0 || a[nm] & 1048576) && (a[nm] = d), a = a[u[e]]; - a[nm] = d | 1048576, r = !0; - } else { - if (a[nm] = d, Qp.setUint32($$8, 3655335680), $$8 += 3, o && (g += _ * o), h.length >= 256 - l && (h.shift()[nm] = void 0), h.push(a), om(s + 2), v(57344 + d), v(u), t) return; - for (let t in e) (typeof e.hasOwnProperty != `function` || e.hasOwnProperty(t)) && v(e[t]); - return; - } - if (s < 24 ? Q$8[$$8++] = 128 | s : om(s), !t) for (let t in e) (typeof e.hasOwnProperty != `function` || e.hasOwnProperty(t)) && v(e[t]); - }, b = (e) => { - let n; - if (e > 16777216) { - if (e - t > Xp) throw Error(`Encoded buffer would be larger than maximum buffer size`); - n = Math.min(Xp, Math.round(Math.max((e - t) * (e > 67108864 ? 1.25 : 2), 4194304) / 4096) * 4096); - } else n = (Math.max(e - t << 2, Q$8.length - 1) >> 12) + 1 << 12; - let r = new Jp(n); - return Qp = new DataView(r.buffer, 0, n), Q$8.copy ? Q$8.copy(r, 0, t, e) : r.set(Q$8.slice(t, e)), $$8 -= t, t = 0, $p = r.length - 10, Q$8 = r; - }, x = 100, S = 1e3; - this.encodeAsIterable = function(e, t) { - return E(e, t, C); - }, this.encodeAsAsyncIterable = function(e, t) { - return E(e, t, D); - }; - function* C(e, n, r) { - let i = e.constructor; - if (i === Object) { - let t = s.useRecords !== !1; - t ? y(e, !0) : im(Object.keys(e).length, 160); - for (let r in e) { - let i = e[r]; - t || v(r), i && typeof i == `object` ? n[r] ? yield* C(i, n[r]) : yield* w(i, n, r) : v(i); - } - } else if (i === Array) { - let r = e.length; - om(r); - for (let i = 0; i < r; i++) { - let r = e[i]; - r && (typeof r == `object` || $$8 - t > x) ? n.element ? yield* C(r, n.element) : yield* w(r, n, `element`) : v(r); - } - } else if (e[Symbol.iterator] && !e.buffer) { - Q$8[$$8++] = 159; - for (let r of e) r && (typeof r == `object` || $$8 - t > x) ? n.element ? yield* C(r, n.element) : yield* w(r, n, `element`) : v(r); - Q$8[$$8++] = 255; - } else cm(e) ? (im(e.size, 64), yield Q$8.subarray(t, $$8), yield e, T()) : e[Symbol.asyncIterator] ? (Q$8[$$8++] = 159, yield Q$8.subarray(t, $$8), yield e, T(), Q$8[$$8++] = 255) : v(e); - r && $$8 > t ? yield Q$8.subarray(t, $$8) : $$8 - t > x && (yield Q$8.subarray(t, $$8), T()); - } - function* w(e, n, r) { - let i = $$8 - t; - try { - v(e), $$8 - t > x && (yield Q$8.subarray(t, $$8), T()); - } catch (a) { - if (a.iteratorNotHandled) n[r] = {}, $$8 = t + i, yield* C.call(this, e, n[r]); - else throw a; - } - } - function T() { - x = S, s.encode(null, xm); - } - function E(e, t, n) { - return x = t && t.chunkThreshold ? S = t.chunkThreshold : 100, e && typeof e == `object` ? (s.encode(null, xm), n(e, s.iterateProperties ||= {}, !0)) : [s.encode(e)]; - } - async function* D(e, t) { - for (let n of C(e, t, !0)) { - let e = n.constructor; - if (e === Yp || e === Uint8Array) yield n; - else if (cm(n)) { - let e = n.stream().getReader(), t; - for (; !(t = await e.read()).done;) yield t.value; - } else if (n[Symbol.asyncIterator]) for await (let e of n) T(), e ? yield* D(e, t.async ||= {}) : yield s.encode(e); - else yield n; - } - } - } - useBuffer(e) { - Q$8 = e, Qp = new DataView(Q$8.buffer, Q$8.byteOffset, Q$8.byteLength), $$8 = 0; - } - clearSharedData() { - this.structures &&= [], this.sharedValues &&= void 0; - } - updateSharedData() { - let e = this.sharedVersion || 0; - this.sharedVersion = e + 1; - let t = this.structures.slice(0), n = new am(t, this.sharedValues, this.sharedVersion), r = this.saveShared(n, (t) => (t && t.version || 0) == e); - return r === !1 ? (n = this.getShared() || {}, this.structures = n.structures || [], this.sharedValues = n.packedValues, this.sharedVersion = n.version, this.structures.nextId = this.structures.length) : t.forEach((e, t) => this.structures[t] = e), r; - } -}; -function im(e, t) { - e < 24 ? Q$8[$$8++] = t | e : e < 256 ? (Q$8[$$8++] = t | 24, Q$8[$$8++] = e) : e < 65536 ? (Q$8[$$8++] = t | 25, Q$8[$$8++] = e >> 8, Q$8[$$8++] = e & 255) : (Q$8[$$8++] = t | 26, Qp.setUint32($$8, e), $$8 += 4); -} -var am = class { - constructor(e, t, n) { - this.structures = e, this.packedValues = t, this.version = n; - } -}; -function om(e) { - e < 24 ? Q$8[$$8++] = 128 | e : e < 256 ? (Q$8[$$8++] = 152, Q$8[$$8++] = e) : e < 65536 ? (Q$8[$$8++] = 153, Q$8[$$8++] = e >> 8, Q$8[$$8++] = e & 255) : (Q$8[$$8++] = 154, Qp.setUint32($$8, e), $$8 += 4); -} -const sm = typeof Blob > `u` ? function() {} : Blob; -function cm(e) { - if (e instanceof sm) return !0; - let t = e[Symbol.toStringTag]; - return t === `Blob` || t === `File`; -} -function lm(e, t) { - switch (typeof e) { - case `string`: - if (e.length > 3) { - if (t.objectMap[e] > -1 || t.values.length >= t.maxValues) return; - let n = t.get(e); - if (n) ++n.count == 2 && t.values.push(e); - else if (t.set(e, { count: 1 }), t.samplingPackedValues) { - let n = t.samplingPackedValues.get(e); - n ? n.count++ : t.samplingPackedValues.set(e, { count: 1 }); - } - } - break; - case `object`: - if (e) if (e instanceof Array) for (let n = 0, r = e.length; n < r; n++) lm(e[n], t); - else { - let r = !t.encoder.useRecords; - for (var n in e) e.hasOwnProperty(n) && (r && lm(n, t), lm(e[n], t)); - } - break; - case `function`: console.log(e); - } -} -const um = new Uint8Array(new Uint16Array([1]).buffer)[0] == 1; -Gp = [ - Date, - Set, - Error, - RegExp, - wp, - ArrayBuffer, - Uint8Array, - Uint8ClampedArray, - Uint16Array, - Uint32Array, - typeof BigUint64Array > `u` ? function() {} : BigUint64Array, - Int8Array, - Int16Array, - Int32Array, - typeof BigInt64Array > `u` ? function() {} : BigInt64Array, - Float32Array, - Float64Array, - am -], Wp = [ - { - tag: 1, - encode(e, t) { - let n = e.getTime() / 1e3; - (this.useTimestamp32 || e.getMilliseconds() === 0) && n >= 0 && n < 4294967296 ? (Q$8[$$8++] = 26, Qp.setUint32($$8, n), $$8 += 4) : (Q$8[$$8++] = 251, Qp.setFloat64($$8, n), $$8 += 8); - } - }, - { - tag: 258, - encode(e, t) { - t(Array.from(e)); - } - }, - { - tag: 27, - encode(e, t) { - t([e.name, e.message]); - } - }, - { - tag: 27, - encode(e, t) { - t([ - `RegExp`, - e.source, - e.flags - ]); - } - }, - { - getTag(e) { - return e.tag; - }, - encode(e, t) { - t(e.value); - } - }, - { encode(e, t, n) { - fm(e, n); - } }, - { - getTag(e) { - if (e.constructor === Uint8Array && (this.tagUint8Array || qp && this.tagUint8Array !== !1)) return 64; - }, - encode(e, t, n) { - fm(e, n); - } - }, - dm(68, 1), - dm(69, 2), - dm(70, 4), - dm(71, 8), - dm(72, 1), - dm(77, 2), - dm(78, 4), - dm(79, 8), - dm(85, 4), - dm(86, 8), - { encode(e, t) { - let n = e.packedValues || [], r = e.structures || []; - if (n.values.length > 0) { - Q$8[$$8++] = 216, Q$8[$$8++] = 51, om(4); - let e = n.values; - t(e), om(0), om(0), packedObjectMap = Object.create(sharedPackedObjectMap || null); - for (let t = 0, n = e.length; t < n; t++) packedObjectMap[e[t]] = t; - } - if (r) { - Qp.setUint32($$8, 3655335424), $$8 += 3; - let n = r.slice(0); - n.unshift(57344), n.push(new wp(e.version, 1399353956)), t(n); - } else t(new wp(e.version, 1399353956)); - } } -]; -function dm(e, t) { - return !um && t > 1 && (e -= 4), { - tag: e, - encode: function(e, t) { - let n = e.byteLength, r = e.byteOffset || 0, i = e.buffer || e; - t(qp ? Kp.from(i, r, n) : new Uint8Array(i, r, n)); - } - }; -} -function fm(e, t) { - let n = e.byteLength; - n < 24 ? Q$8[$$8++] = 64 + n : n < 256 ? (Q$8[$$8++] = 88, Q$8[$$8++] = n) : n < 65536 ? (Q$8[$$8++] = 89, Q$8[$$8++] = n >> 8, Q$8[$$8++] = n & 255) : (Q$8[$$8++] = 90, Qp.setUint32($$8, n), $$8 += 4), $$8 + n >= Q$8.length && t($$8 + n), Q$8.set(e.buffer ? e : new Uint8Array(e), $$8), $$8 += n; -} -function pm(e, t) { - let n, r = t.length * 2, i = e.length - r; - t.sort((e, t) => e.offset > t.offset ? 1 : -1); - for (let n = 0; n < t.length; n++) { - let r = t[n]; - r.id = n; - for (let t of r.references) e[t++] = n >> 8, e[t] = n & 255; - } - for (; n = t.pop();) { - let t = n.offset; - e.copyWithin(t + r, t, i), r -= 2; - let a = t + r; - e[a++] = 216, e[a++] = 28, i = t; - } - return e; -} -function mm(e, t) { - Qp.setUint32(em.position + e, $$8 - em.position - e + 1); - let n = em; - em = null, t(n[0]), t(n[1]); -} -let hm = new rm$1({ useRecords: !1 }); -const gm = hm.encode; -hm.encodeAsIterable, hm.encodeAsAsyncIterable; -const { NEVER: _m, ALWAYS: vm, DECIMAL_ROUND: ym, DECIMAL_FIT: bm } = Hp, xm = 2048; -var Sm = c$12(((e, t) => { - let n = () => process.platform === `linux`, r = null; - t.exports = { - isLinux: n, - getReport: () => { - if (!r) if (n() && process.report) { - let e = process.report.excludeNetwork; - process.report.excludeNetwork = !0, r = process.report.getReport(), process.report.excludeNetwork = e; - } else r = {}; - return r; - } - }; -})); -var Cm = c$12(((e, n) => { - let r = f$11(`fs`), i = 2048; - n.exports = { - LDD_PATH: `/usr/bin/ldd`, - SELF_PATH: `/proc/self/exe`, - readFileSync: (e) => { - let t = r.openSync(e, `r`), n = Buffer.alloc(i), a = r.readSync(t, n, 0, i, 0); - return r.close(t, () => {}), n.subarray(0, a); - }, - readFile: (e) => new Promise((t, n) => { - r.open(e, `r`, (e, a) => { - if (e) n(e); - else { - let e = Buffer.alloc(i); - r.read(a, e, 0, i, 0, (n, i) => { - t(e.subarray(0, i)), r.close(a, () => {}); - }); - } - }); - }) - }; -})); -var wm = c$12(((e, t) => { - t.exports = { interpreterPath: (e) => { - if (e.length < 64 || e.readUInt32BE(0) !== 2135247942 || e.readUInt8(4) !== 2 || e.readUInt8(5) !== 1) return null; - let t = e.readUInt32LE(32), n = e.readUInt16LE(54), r = e.readUInt16LE(56); - for (let i = 0; i < r; i++) { - let r = t + i * n; - if (e.readUInt32LE(r) === 3) { - let t = e.readUInt32LE(r + 8), n = e.readUInt32LE(r + 32); - return e.subarray(t, t + n).toString().replace(/\0.*$/g, ``); - } - } - return null; - } }; -})); -var Tm = c$12(((e, n) => { - let r = f$11(`child_process`), { isLinux: i, getReport: a } = Sm(), { LDD_PATH: o, SELF_PATH: s, readFile: c, readFileSync: l } = Cm(), { interpreterPath: u } = wm(), d, f, p, m = `getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true`, h = ``, g = () => h || new Promise((e) => { - r.exec(m, (t, n) => { - h = t ? ` ` : n, e(h); - }); - }), _ = () => { - if (!h) try { - h = r.execSync(m, { encoding: `utf8` }); - } catch { - h = ` `; - } - return h; - }, v = `glibc`, y = /LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i, b = `musl`, x = (e) => e.includes(`libc.musl-`) || e.includes(`ld-musl-`), S = () => { - let e = a(); - return e.header && e.header.glibcVersionRuntime ? v : Array.isArray(e.sharedObjects) && e.sharedObjects.some(x) ? b : null; - }, C = (e) => { - let [t, n] = e.split(/[\r\n]+/); - return t && t.includes(v) ? v : n && n.includes(b) ? b : null; - }, w = (e) => { - if (e) { - if (e.includes(`/ld-musl-`)) return b; - if (e.includes(`/ld-linux-`)) return v; - } - return null; - }, T = (e) => (e = e.toString(), e.includes(`musl`) ? b : e.includes(`GNU C Library`) ? v : null), E = async () => { - if (f !== void 0) return f; - f = null; - try { - f = T(await c(o)); - } catch {} - return f; - }, D = () => { - if (f !== void 0) return f; - f = null; - try { - f = T(l(o)); - } catch {} - return f; - }, O = async () => { - if (d !== void 0) return d; - d = null; - try { - d = w(u(await c(s))); - } catch {} - return d; - }, k = () => { - if (d !== void 0) return d; - d = null; - try { - d = w(u(l(s))); - } catch {} - return d; - }, A = async () => { - let e = null; - return i() && (e = await O(), e || (e = await E(), e ||= S(), e ||= C(await g()))), e; - }, j = () => { - let e = null; - return i() && (e = k(), e || (e = D(), e ||= S(), e ||= C(_()))), e; - }, M = async () => i() && await A() !== v, N = () => i() && j() !== v, P = async () => { - if (p !== void 0) return p; - p = null; - try { - let e = (await c(o)).match(y); - e && (p = e[1]); - } catch {} - return p; - }, F = () => { - if (p !== void 0) return p; - p = null; - try { - let e = l(o).match(y); - e && (p = e[1]); - } catch {} - return p; - }, I = () => { - let e = a(); - return e.header && e.header.glibcVersionRuntime ? e.header.glibcVersionRuntime : null; - }, ee = (e) => e.trim().split(/\s+/)[1], L = (e) => { - let [t, n, r] = e.split(/[\r\n]+/); - return t && t.includes(v) ? ee(t) : n && r && n.includes(b) ? ee(r) : null; - }; - n.exports = { - GLIBC: v, - MUSL: b, - family: A, - familySync: j, - isNonGlibcLinux: M, - isNonGlibcLinuxSync: N, - version: async () => { - let e = null; - return i() && (e = await P(), e ||= I(), e ||= L(await g())), e; - }, - versionSync: () => { - let e = null; - return i() && (e = F(), e ||= I(), e ||= L(_())), e; - } - }; -})); -var Em = c$12(((e, n) => { - var r = f$11(`fs`), i = f$11(`path`), a = f$11(`url`), o = process.config && process.config.variables || {}, s = !!process.env.PREBUILDS_ONLY, c = process.versions, l = c.modules; - (c.deno || process.isBun) && (l = `unsupported`); - var u = D() ? `electron` : `node`, d = process.arch, f = process.platform, p = process.env.LIBC || (O(f) ? `musl` : `glibc`), m = process.env.ARM_VERSION || (d === `arm64` ? `8` : o.arm_version) || ``, h = (c.uv || ``).split(`.`)[0]; - n.exports = g; - function g(e) { - return typeof __webpack_require__ == `function` ? __non_webpack_require__(g.path(e)) : f$11(g.path(e)); - } - g.path = function(e) { - e = i.resolve(e || `.`); - var n = ``; - try { - n = typeof __webpack_require__ == `function` ? __non_webpack_require__(i.join(e, `package.json`)).name : f$11(i.join(e, `package.json`)).name; - var r = n.toUpperCase().replace(/-/g, `_`) + `_PREBUILD`; - process.env[r] && (e = process.env[r]); - } catch {} - if (!s) { - var o = v(i.join(e, `build/Release`), y); - if (o) return o; - var c = v(i.join(e, `build/Debug`), y); - if (c) return c; - } - var g = k(e); - if (g) return g; - var T = k(i.dirname(process.execPath)); - if (T) return T; - var D = (n[0] == `@` ? `` : `@` + n + `/`) + n + `-` + f + `-` + d; - try { - return A(i.dirname(f$11(`module`).createRequire(a.pathToFileURL(i.join(e, `package.json`))).resolve(D))); - } catch {} - var O = [ - `platform=` + f, - `arch=` + d, - `runtime=` + u, - `abi=` + l, - `uv=` + h, - m ? `armv=` + m : ``, - `libc=` + p, - `node=` + process.versions.node, - process.versions.electron ? `electron=` + process.versions.electron : ``, - typeof __webpack_require__ == `function` ? `webpack=true` : `` - ].filter(Boolean).join(` `); - throw Error(`No native build was found for ` + O + ` - attempted loading from: ` + e + ` and package: ` + D + ` -`); - function k(e) { - var t = _(i.join(e, `prebuilds`)).map(b).filter(x(f, d)).sort(S)[0]; - if (t) return A(i.join(e, `prebuilds`, t.name)); - } - function A(e) { - var t = _(e).map(C).filter(w(u, l)).sort(E(u))[0]; - if (t) return i.join(e, t.file); - } - }; - function _(e) { - try { - return r.readdirSync(e); - } catch { - return []; - } - } - function v(e, t) { - var n = _(e).filter(t); - return n[0] && i.join(e, n[0]); - } - function y(e) { - return /\.node$/.test(e); - } - function b(e) { - var t = e.split(`-`); - if (t.length === 2) { - var n = t[0], r = t[1].split(`+`); - if (n && r.length && r.every(Boolean)) return { - name: e, - platform: n, - architectures: r - }; - } - } - function x(e, t) { - return function(n) { - return n == null || n.platform !== e ? !1 : n.architectures.includes(t); - }; - } - function S(e, t) { - return e.architectures.length - t.architectures.length; - } - function C(e) { - var t = e.split(`.`), n = t.pop(), r = { - file: e, - specificity: 0 - }; - if (n === `node`) { - for (var i = 0; i < t.length; i++) { - var a = t[i]; - if (a === `node` || a === `electron` || a === `node-webkit`) r.runtime = a; - else if (a === `napi`) r.napi = !0; - else if (a.slice(0, 3) === `abi`) r.abi = a.slice(3); - else if (a.slice(0, 2) === `uv`) r.uv = a.slice(2); - else if (a.slice(0, 4) === `armv`) r.armv = a.slice(4); - else if (a === `glibc` || a === `musl`) r.libc = a; - else continue; - r.specificity++; - } - return r; - } - } - function w(e, t) { - return function(n) { - return !(n == null || n.runtime !== e && !T(n) || n.abi !== t && !n.napi || n.uv && n.uv !== h || n.armv && n.armv !== m || n.libc && n.libc !== p); - }; - } - function T(e) { - return e.runtime === `node` && e.napi; - } - function E(e) { - return function(t, n) { - return t.runtime === n.runtime ? t.abi === n.abi ? t.specificity === n.specificity ? 0 : t.specificity > n.specificity ? -1 : 1 : t.abi ? -1 : 1 : t.runtime === e ? -1 : 1; - }; - } - function D() { - return process.versions && process.versions.electron || process.env.ELECTRON_RUN_AS_NODE ? !0 : typeof window < `u` && window.process && window.process.type === `renderer`; - } - function O(e) { - if (e !== `linux`) return !1; - let { familySync: t, MUSL: n } = Tm(); - return t() === n; - } - g.parseTags = C, g.matchTags = w, g.compareTags = E, g.parseTuple = b, g.matchTuple = x, g.compareTuples = S; -})); -var Dm = c$12(((e, t) => { - t.exports = Em()(__dirname); -})); -if (!(process.env.CBOR_NATIVE_ACCELERATION_DISABLED !== void 0 && process.env.CBOR_NATIVE_ACCELERATION_DISABLED.toLowerCase() === `true`)) { - let e; - try { - e = typeof f$11 == `function` ? Dm() : createRequire$1(import.meta.url)(`cbor-extract`), e && hp(e.extractStrings); - } catch {} -} -const Om = `5.0.0-beta.20`; -const km = typeof process < `u` && typeof process.env.DEBUG == `string` && (process.env.DEBUG.includes(`workflow:`) || process.env.DEBUG === `*`); -function Am(e, t, n, r) { - if (km) { - let i = jm(n), a = i.length > 0 ? `; ${i.join(`; `)}` : ``; - console.debug(`[workflow:world-vercel:http] ${e} ${t} -> ${n.status} (${r}ms${a})`); - } -} -function jm(e) { - return [`x-vercel-id`, `x-vercel-error`].flatMap((t) => { - let n = e.headers.get(t); - return n ? [`${t}=${n}`] : []; - }); -} -function Mm(e) { - let t = jm(e); - return t.length > 0 ? ` (${t.join(`; `)})` : ``; -} -const Nm = /* @__PURE__ */ new Set([`GET`, `HEAD`]); -const Pm = () => process.env.VERCEL_WORKFLOW_SERVER_URL || ``; -function Fm(e) { - return e; -} -const Im = () => { - let e = process.env.VERCEL_DEPLOYMENT_ID; - return e ? `@workflow/world-vercel/${Om} node-${process.version} ${pr.platform()} (${pr.arch()}) ${e}` : `@workflow/world-vercel/${Om} node-${process.version} ${pr.platform()} (${pr.arch()})`; -}; -const Lm = (e) => { - let t = e?.projectConfig, n = Pm() || `https://vercel-workflow.com`, r = process.env.WORKFLOW_VERCEL_BACKEND_URL, i = !!(t?.projectId && t?.teamId); - return { - baseUrl: i ? r || `https://api.vercel.com/v1/workflow` : `${n}/api`, - usingProxy: i - }; -}; -const Rm = (e, t) => { - let n = e?.projectConfig, r = new Headers(e?.headers); - r.set(`User-Agent`, Im()), n && (r.set(`x-vercel-environment`, n.environment || `production`), n.projectId && r.set(`x-vercel-project-id`, n.projectId), n.teamId && r.set(`x-vercel-team-id`, n.teamId)); - let i = Pm(); - return i && t.usingProxy && r.set(`x-vercel-workflow-api-url`, i), r; -}; -async function zm(e) { - let { baseUrl: t, usingProxy: n } = Lm(e), r = Rm(e, { usingProxy: n }); - if (n) { - if (!e?.token) throw Error(`world-vercel: api-workflow proxy requested (${t}) but no Vercel auth token was provided. Pass one as \`config.token\` (the SDK reads it from \`WORKFLOW_VERCEL_AUTH_TOKEN\`).`); - r.set(`Authorization`, `Bearer ${e.token}`); - } else { - let t; - try { - t = await (0, hc$1.getVercelOidcToken)(); - } catch {} - let n = e?.token ?? t; - n && r.set(`Authorization`, `Bearer ${n}`), t && r.set(`x-vercel-trusted-oidc-idp-token`, t); - } - return { - baseUrl: t, - headers: r, - usingProxy: n - }; -} -async function Bm({ endpoint: e, options: t = {}, config: n = {}, schema: r, data: i, onResponse: a }) { - let o = t.method || `GET`, { baseUrl: s, headers: c } = await zm(n), l = `${s}${e}`, u, d; - try { - let e = new URL(l); - u = e.hostname, d = e.port ? parseInt(e.port, 10) : e.protocol === `https:` ? 443 : 80; - } catch {} - return Ec$1(`http ${o}`, { kind: await Dc$1(`CLIENT`) }, async (s) => { - s?.setAttributes({ - ...Ac$1(o), - ...jc$1(l), - ...u && Mc$1(u), - ...d && Nc$1(d), - ...Lc$1(`workflow-server`), - ...Rc$1(`http`), - ...zc$1(`workflow-server`) - }), c.set(`Accept`, `application/cbor`), await Oc$1(c); - let f; - i !== void 0 && (c.set(`Content-Type`, `application/cbor`), f = gm(i)); - let m = Nm.has(o.toUpperCase()), h, g = ``; - for (let r = 0;; r++) { - c.set(`X-Request-Time`, Date.now().toString()); - let i = AbortSignal.timeout(6e4), u = t.signal ? AbortSignal.any([t.signal, i]) : i, d = new Request(l, { - ...t, - body: f, - headers: c, - signal: u - }), _ = Date.now(), y; - try { - y = await fetch(d, { dispatcher: _c$1(n) }); - } catch (t) { - let n = Date.now() - _; - if (t instanceof Error && (t.name === `TimeoutError` || t.name === `AbortError`)) { - let r = new s$8(`${o} ${e} timed out after ${n}ms`, { - url: l, - cause: t - }); - throw s?.setAttributes({ ...Fc$1(`TIMEOUT`) }), s?.recordException?.(r), r; - } - throw t; - } - let S = Date.now() - _; - if (g = Mm(y), Am(o, e, y, S), s?.setAttributes({ ...Pc$1(y.status) }), !y.ok) { - let t = await Hm(y).then((e) => e.data).catch(() => ({})); - if (process.env.DEBUG) { - let e = Array.from(c.entries()).filter(([e]) => e.toLowerCase() !== `authorization`).map(([e, t]) => `-H "${e}: ${t}"`).join(` `); - console.error(`Failed to fetch, reproduce with:\ncurl -X ${d.method} ${e} "${l}"`); - } - let n, r = y.headers.get(`Retry-After`); - if (r) { - let e = parseInt(r, 10); - Number.isNaN(e) || (n = e); - } - let i = (t.message || `${d.method} ${e} -> HTTP ${y.status}: ${y.statusText}`) + g, a = (e) => { - throw s?.setAttributes({ ...Fc$1(t.code || `HTTP ${y.status}`) }), s?.recordException?.(e), e; - }; - y.status === 409 && a(new x$9(i)), y.status === 410 && a(new S$10(i)), y.status === 425 && a(new C$11(i, { retryAfter: n })), y.status === 429 && a(new w$11(i, { retryAfter: n })), a(new s$8(i, { - url: l, - status: y.status, - code: t.code, - retryAfter: n - })); - } - a?.(y); - try { - h = await Ec$1(`world.parse`, async (e) => { - let t = await Hm(y), n = (y.headers.get(`Content-Type`) || ``).includes(`application/cbor`); - return e?.setAttributes({ ...Ic$1(n ? `cbor` : `json`) }), t; - }); - break; - } catch (t) { - if (m && r < 2) { - let n = 100 * 2 ** r; - s?.setAttributes({ ...Fc$1(`PARSE_ERROR_RETRYING`) }), km && console.debug(`[workflow:world-vercel:http] ${o} ${e} body parse failed (attempt ${r + 1}/3); retrying in ${n}ms: ${t}`), await new Promise((e) => setTimeout(e, n)); - continue; - } - let n = y.headers.get(`Content-Type`) || `unknown`; - throw new s$8(`Failed to parse response body for ${o} ${e}${g} (Content-Type: ${n}):\n\n${t}`, { - url: l, - code: `PARSE_ERROR`, - cause: t - }); - } - } - return await Ec$1(`world.validate`, async () => { - let t = r.safeParse(h.data); - if (!t.success) { - let n = t.error.issues.map((e) => ` ${e.path.length > 0 ? e.path.join(`.`) : ``}: ${e.message}`).join(` -`), r = process.env.DEBUG ? `\n\nResponse context: ${h.getDebugContext()}` : ``; - throw new s$8(`Schema validation failed for ${o} ${e}${g}:\n${n}${r}`, { - url: l, - code: `SCHEMA_VALIDATION`, - cause: t.error - }); - } - return t.data; - }); - }); -} -function Vm(e) { - let t = inspect(e, { - depth: 3, - maxArrayLength: 10, - breakLength: 120 - }); - return t.length > 500 ? `${t.slice(0, 500)}...` : t; -} -async function Hm(e) { - let t = e.headers.get(`Content-Type`) || ``; - if (t.includes(`application/cbor`)) { - let n = await e.arrayBuffer(), r = Vp(new Uint8Array(n)); - return { - data: r, - getDebugContext: () => `Content-Type: ${t}, ${n.byteLength} bytes (CBOR), preview: ${Vm(r)}` - }; - } - let n = await e.text(), r = JSON.parse(n); - return { - data: r, - getDebugContext: () => `Content-Type: ${t}, ${n.length} bytes, preview: ${Vm(r)}` - }; -} -var Um = class { - contentType = `application/cbor`; - serialize(e) { - return Buffer.from(gm(e)); - } - async deserialize(e) { - let t = [], n = e.getReader(); - for (;;) { - let { done: e, value: r } = await n.read(); - if (e) break; - r && t.push(r); - } - return Vp(Buffer.concat(t)); - } -}; -var Wm = class { - contentType = `application/json`; - serialize(e) { - return Buffer.from(JSON.stringify(e)); - } - async deserialize(e) { - let t = [], n = e.getReader(); - for (;;) { - let { done: e, value: r } = await n.read(); - if (e) break; - r && t.push(r); - } - return JSON.parse(Buffer.concat(t).toString()); - } -}; -var Gm = class { - contentType = `application/cbor`; - serialize(e) { - return Buffer.from(gm(e)); - } - async deserialize(e) { - let t = [], n = e.getReader(); - for (;;) { - let { done: e, value: r } = await n.read(); - if (e) break; - r && t.push(r); - } - let r = Buffer.concat(t); - try { - return Vp(r); - } catch { - return JSON.parse(r.toString()); - } - } -}; -const Km = new AsyncLocalStorage(); -const qm = V$8({ - payload: ph$1, - queueName: nh$1, - deploymentId: R$8().optional() -}); -const Jm = Number(process.env.VERCEL_QUEUE_MAX_DELAY_SECONDS || 82800); -function Ym(e) { - let t = Math.min(Math.max(1, 2 ** (e - 1)), 60), n = Math.floor(Math.random() * (Math.ceil(t * .25) + 1)); - return Math.max(1, t - n); -} -function Xm(e) { - let t = {}; - return `runId` in e && typeof e.runId == `string` && (t[`x-vercel-workflow-run-id`] = e.runId), `workflowRunId` in e && typeof e.workflowRunId == `string` && (t[`x-vercel-workflow-run-id`] = e.workflowRunId), `stepId` in e && typeof e.stepId == `string` && (t[`x-vercel-workflow-step-id`] = e.stepId), Object.keys(t).length > 0 ? t : void 0; -} -function Zm(e) { - let { baseUrl: t, usingProxy: n } = Lm(e), r = Rm(e, { usingProxy: n }), i = new Um(), a = new Wm(), o = new Gm(), s = { - region: `iad1`, - dispatcher: _c$1(e), - transport: o, - ...n && { - resolveBaseUrl: () => new URL(`${t}/queues-proxy`), - token: e?.token - }, - headers: Object.fromEntries(r.entries()) - }, c = async (e, t, n) => { - let r = n?.deploymentId ?? process.env.VERCEL_DEPLOYMENT_ID; - if (!r) throw Error(`No deploymentId provided and VERCEL_DEPLOYMENT_ID environment variable is not set. Queue messages require a deployment ID to route correctly. Either set VERCEL_DEPLOYMENT_ID or provide deploymentId in options.`); - let o = (n?.specVersion ?? 5) >= 3 ? i : a, c = new zf({ - ...s, - deploymentId: r, - transport: o - }), l = { - payload: t, - queueName: e, - deploymentId: n?.deploymentId - }, u = e.replace(/[^A-Za-z0-9-_]/g, `-`); - try { - let { messageId: e } = await c.send(u, l, { - idempotencyKey: n?.idempotencyKey, - delaySeconds: n?.delaySeconds, - headers: { - ...Xm(t), - ...n?.headers - } - }); - return { messageId: e ? sh$1.parse(e) : null }; - } catch (e) { - if (e instanceof id$1) return { messageId: sh$1.parse(`msg_duplicate_${e.idempotencyKey ?? n?.idempotencyKey ?? `unknown`}`) }; - throw e; - } - }; - return { - queue: c, - createQueueHandler: (e, t) => { - let n = new zf(s).handleCallback(async (e, n) => { - if (!e || !n) return; - let r = Km.getStore(), { payload: i, queueName: a, deploymentId: o } = qm.parse(e), s = await t(i, { - queueName: a, - messageId: sh$1.parse(n.messageId), - attempt: n.deliveryCount, - requestId: r - }); - typeof s?.timeoutSeconds == `number` && await c(a, i, { - deploymentId: o, - delaySeconds: s.timeoutSeconds > 0 ? Math.min(s.timeoutSeconds, Jm) : void 0 - }); - }, { retry: (e, { deliveryCount: t }) => ({ afterSeconds: Ym(t) }) }); - return async (e) => { - let t = e.headers.get(`x-vercel-id`)?.trim() || void 0; - return Km.run(t, () => n(e)); - }; - }, - getDeploymentId: async () => { - let e = process.env.VERCEL_DEPLOYMENT_ID; - if (!e) throw Error(`VERCEL_DEPLOYMENT_ID environment variable is not set`); - return e; - } - }; -} -const Qm = V$8({ id: R$8() }); -function $m(e) { - return async function() { - let t = process.env.VERCEL_DEPLOYMENT_ID; - if (!t) throw Error(`Cannot resolve latest deployment: VERCEL_DEPLOYMENT_ID environment variable is not set`); - let n = e?.token ?? process.env.VERCEL_TOKEN ?? await (0, hc$1.getVercelOidcToken)().catch(() => null); - if (!n) throw Error(`Cannot resolve latest deployment: no OIDC token or VERCEL_TOKEN available`); - let r = `https://api.vercel.com/v1/workflow/resolve-latest-deployment/${encodeURIComponent(t)}`, i = await fetch(r, { - method: `GET`, - headers: { Authorization: `Bearer ${n}` }, - dispatcher: _c$1(e) - }); - if (!i.ok) { - let e; - try { - e = await i.text(); - } catch { - e = ``; - } - throw Error(`Failed to resolve latest deployment for ${t}: HTTP ${i.status} ${i.statusText}${e ? ` — ${e}` : ``}`); - } - let a = await i.json(), o = Qm.safeParse(a); - if (!o.success) throw Error(`Invalid response from Vercel API: expected { id: string }. Zod error: ${o.error.message}`); - return o.data.id; - }; -} -const eh = `application/vnd.workflow.v4-frames`; -function th(e, t) { - let n = new Uint8Array(gm(e)), r = new Uint8Array(4 + n.byteLength + 4 + t.byteLength), i = new DataView(r.buffer); - return i.setUint32(0, n.byteLength, !1), r.set(n, 4), i.setUint32(4 + n.byteLength, t.byteLength, !1), r.set(t, 4 + n.byteLength + 4), r; -} -async function* nh(e) { - let t = Symbol.asyncIterator in e ? e[Symbol.asyncIterator]() : rh(e.getReader()), n = /* @__PURE__ */ new Uint8Array(), r = async (e) => { - for (; n.byteLength < e;) { - let { done: e, value: r } = await t.next(); - if (e) return !1; - if (!r || r.byteLength === 0) continue; - let i = new Uint8Array(n.byteLength + r.byteLength); - i.set(n, 0), i.set(r, n.byteLength), n = i; - } - return !0; - }, i = (e) => { - let t = n.subarray(0, e); - return n = n.subarray(e), t; - }; - for (;;) { - if (!await r(4)) return; - let e = new DataView(n.buffer, n.byteOffset, 4).getUint32(0, !1); - if (i(4), !await r(e)) throw Error(`decodeFrames: truncated meta block`); - let t = Vp(i(e)); - if (!await r(4)) throw Error(`decodeFrames: truncated body length`); - let a = new DataView(n.buffer, n.byteOffset, 4).getUint32(0, !1); - if (i(4), a > 0) { - if (!await r(a)) throw Error(`decodeFrames: truncated body bytes`); - yield { - meta: t, - body: n.slice(0, a) - }, i(a); - } else yield { - meta: t, - body: /* @__PURE__ */ new Uint8Array() - }; - if (t._end === 1) return; - } -} -async function* rh(e) { - for (;;) { - let { done: t, value: n } = await e.read(); - if (t) return; - n && (yield n); - } -} -async function ih(e, t, n) { - return t.headers.set(`X-Request-Time`, Date.now().toString()), await Oc$1(t.headers), fetch(e, { - method: t.method, - headers: t.headers, - body: t.body, - dispatcher: _c$1(n) - }); -} -function ah(e) { - let t = {}; - return e.forEach((e, n) => { - t[n] = e; - }), t; -} -const oh = { - eventId: `x-wf-event-id`, - runId: `x-wf-run-id`, - createdAt: `x-wf-created-at` -}; -function sh(e) { - let t = { - eventType: e.eventType, - specVersion: e.specVersion - }; - return e.correlationId !== void 0 && (t.correlationId = e.correlationId), e.vercelId !== void 0 && (t.vercelId = e.vercelId), e.occurredAt !== void 0 && (t.occurredAt = e.occurredAt), e.remoteRefBehavior !== void 0 && (t.remoteRefBehavior = e.remoteRefBehavior), e.deploymentId !== void 0 && (t.deploymentId = e.deploymentId), e.workflowName !== void 0 && (t.workflowName = e.workflowName), e.stepName !== void 0 && (t.stepName = e.stepName), e.attempt !== void 0 && (t.attempt = e.attempt), e.resumeAt !== void 0 && (t.resumeAt = e.resumeAt), e.retryAfter !== void 0 && (t.retryAfter = e.retryAfter), e.hookToken !== void 0 && (t.hookToken = e.hookToken), e.hookIsWebhook !== void 0 && (t.hookIsWebhook = e.hookIsWebhook), e.hookIsSystem !== void 0 && (t.hookIsSystem = e.hookIsSystem), e.errorCode !== void 0 && (t.errorCode = e.errorCode), e.executionContext !== void 0 && (t.executionContext = e.executionContext), e.attributes !== void 0 && (t.attributes = e.attributes), e.changes !== void 0 && (t.changes = e.changes), e.writer !== void 0 && (t.writer = e.writer), e.allowReservedAttributes !== void 0 && (t.allowReservedAttributes = e.allowReservedAttributes), e.sinceCursor !== void 0 && (t.sinceCursor = e.sinceCursor), e.skipPreload !== void 0 && (t.skipPreload = e.skipPreload), t; -} -function ch(e, t, n, r, i) { - let a = `v4 ${r} failed: HTTP ${e}`, o; - try { - let e = JSON.parse(n); - typeof e.message == `string` && (a = e.message), typeof e.code == `string` && (o = e.code); - } catch { - n && (a += ` ${n}`); - } - let s, c = uh(t, `retry-after`); - if (c) { - let e = parseInt(c, 10); - Number.isNaN(e) || (s = e); - } - throw e === 409 ? new x$9(a) : e === 410 ? new S$10(a) : e === 425 ? new C$11(a, { retryAfter: s }) : e === 429 ? new w$11(a, { retryAfter: s }) : new s$8(a, { - status: e, - code: o, - url: i, - retryAfter: s - }); -} -async function lh(e, t) { - let { baseUrl: n, headers: r } = await zm(t), i = new Headers(r); - i.set(`Content-Type`, `application/octet-stream`); - let a = th(sh(e), e.payload ?? /* @__PURE__ */ new Uint8Array()), o = `${n}/v4/runs/${encodeURIComponent(e.runId)}/events/${encodeURIComponent(e.eventType)}`, s = await ih(o, { - method: `POST`, - headers: i, - body: a - }, t); - if (!s.ok) { - let e = await s.text(); - ch(s.status, ah(s.headers), e, `createEvent`, o); - } - let c = s.headers.get(oh.eventId), l = s.headers.get(oh.runId), u = s.headers.get(oh.createdAt); - if (typeof c != `string` || typeof l != `string` || typeof u != `string`) throw Error(`v4 createEvent: response missing required x-wf-* headers`); - let d = new Uint8Array(await s.arrayBuffer()); - return { - eventId: c, - runId: l, - createdAt: u, - body: d.byteLength > 0 ? Vp(d) : {} - }; -} -function uh(e, t) { - let n = e[t]; - if (typeof n == `string`) return n; - if (Array.isArray(n) && n.length > 0) return n[0]; -} -async function dh(e, t, n) { - let { baseUrl: r, headers: i } = await zm(n), a = `${r}/v4/runs/${encodeURIComponent(e)}/events/${encodeURIComponent(t)}`, o = await ih(a, { - method: `GET`, - headers: i - }, n); - if (!o.ok) { - let e = await o.text(); - ch(o.status, ah(o.headers), e, `getEvent`, a); - } - let s = o.headers.get(`content-type`); - if (!s?.startsWith(`application/vnd.workflow.v4-frames`)) throw Error(`v4 getEvent: expected ${eh}, got ${s ?? `(none)`}`); - let c = o.body; - for await (let e of nh(c)) return { - event: e.meta, - body: e.body - }; - throw Error(`v4 getEvent: empty frame stream for ${t}`); -} -async function fh(e, t, n, r) { - let i = await ih(e, { - method: `GET`, - headers: t - }, n); - if (!i.ok) { - let t = await i.text(); - ch(i.status, ah(i.headers), t, r, e); - } - let a = i.headers.get(`content-type`); - if (!a?.startsWith(`application/vnd.workflow.v4-frames`)) throw Error(`v4 ${r}: expected ${eh}, got ${a ?? `(none)`}`); - let o = i.body, s = [], c, l, u = !1; - for await (let e of nh(o)) { - if (e.meta._end === 1) { - typeof e.meta.next == `string` && (c = e.meta.next), typeof e.meta.hasMore == `boolean` && (l = e.meta.hasMore), u = !0; - break; - } - s.push({ - event: e.meta, - body: e.body - }); - } - if (!u) throw Error(`v4 ${r}: frame stream ended without the end-of-stream sentinel (${s.length} events read) — truncated response?`); - return { - events: s, - ...c ? { next: c } : {}, - ...l === void 0 ? {} : { hasMore: l } - }; -} -function ph(e, t) { - t.cursor && e.set(`cursor`, t.cursor), t.limit !== void 0 && e.set(`limit`, String(t.limit)), t.sortOrder && e.set(`sortOrder`, t.sortOrder), t.remoteRefBehavior && e.set(`remoteRefBehavior`, t.remoteRefBehavior); -} -function mh(e) { - let t = new URLSearchParams(); - ph(t, e); - let n = t.toString(); - return n ? `?${n}` : ``; -} -async function hh(e, t = {}, n) { - let { baseUrl: r, headers: i } = await zm(n); - return fh(`${r}/v4/runs/${encodeURIComponent(e)}/events` + mh(t), i, n, `listEvents`); -} -async function gh(e, t = {}, n) { - let { baseUrl: r, headers: i } = await zm(n), a = new URLSearchParams(); - return a.set(`correlationId`, e), ph(a, t), fh(`${r}/v4/events?${a.toString()}`, i, n, `listEventsByCorrelationId`); -} -const _h = gh$1.omit({ - error: !0, - errorCode: !0 -}).extend({ - error: Yf$1([q$7, Nf$1()]).optional(), - errorCode: R$8().optional(), - blobStorageBytes: B$9().optional(), - streamStorageBytes: B$9().optional() -}); -const vh = _h; -const yh = _h.omit({ - input: !0, - output: !0 -}).extend({ - inputRef: Nf$1().optional(), - outputRef: Nf$1().optional(), - input: Yf$1([am$1(Uint8Array), Nf$1()]).optional(), - output: Yf$1([am$1(Uint8Array), Nf$1()]).optional() -}); -function bh(e, t) { - if (t === `none`) { - let { inputRef: t, outputRef: n, ...r } = e; - return { - ...Fm(r), - input: void 0, - output: void 0 - }; - } - return Fm(e); -} -async function xh(e = {}, t) { - let { workflowName: n, status: r, pagination: i, resolveData: a = `all` } = e, o = new URLSearchParams(); - n && o.set(`workflowName`, n), r && o.set(`status`, r), i?.limit && o.set(`limit`, i.limit.toString()), i?.cursor && o.set(`cursor`, i.cursor), i?.sortOrder && o.set(`sortOrder`, i.sortOrder); - let s = a === `none` ? `lazy` : `resolve`; - o.set(`remoteRefBehavior`, s); - let c = o.toString(), l = await Bm({ - endpoint: `/v2/runs${c ? `?${c}` : ``}`, - options: { method: `GET` }, - config: t, - schema: yh$1(s === `lazy` ? yh : vh) - }); - return { - ...l, - data: l.data.map((e) => bh(e, a)) - }; -} -async function Sh(e, t) { - return Fm(await Bm({ - endpoint: `/v1/runs/create`, - options: { method: `POST` }, - data: e, - config: t, - schema: vh - })); -} -async function Ch(e, t, n) { - let r = t?.resolveData ?? `all`, i = r === `none` ? `lazy` : `resolve`, a = new URLSearchParams(); - a.set(`remoteRefBehavior`, i); - let o = a.toString(), s = `/v2/runs/${encodeURIComponent(e)}${o ? `?${o}` : ``}`; - try { - return bh(await Bm({ - endpoint: s, - options: { method: `GET` }, - config: n, - schema: i === `lazy` ? yh : vh - }), r); - } catch (t) { - throw t instanceof s$8 && t.status === 404 ? new v$8(e) : t; - } -} -async function wh(e, t, n) { - let r = t?.resolveData ?? `all`, i = r === `none` ? `lazy` : `resolve`, a = new URLSearchParams(); - a.set(`remoteRefBehavior`, i); - let o = a.toString(), s = `/v1/runs/${encodeURIComponent(e)}/cancel${o ? `?${o}` : ``}`; - try { - return bh(await Bm({ - endpoint: s, - options: { method: `PUT` }, - config: n, - schema: i === `lazy` ? yh : vh - }), r); - } catch (t) { - throw t instanceof s$8 && t.status === 404 ? new v$8(e) : t; - } -} -const Th = V$8({ attributes: H$8(R$8(), R$8()) }); -async function Eh(e, t, n, r) { - try { - return { attributes: (await Bm({ - endpoint: `/v2/runs/${encodeURIComponent(e)}/attributes`, - options: { method: `POST` }, - data: n?.allowReservedAttributes ? { - changes: t, - allowReservedAttributes: !0 - } : { changes: t }, - config: r, - schema: Th - })).attributes }; - } catch (t) { - throw t instanceof s$8 && t.status === 404 ? new v$8(e) : t; - } -} -const Dh = Ch$1.omit({ error: !0 }).extend({ - error: Yf$1([q$7, Nf$1()]).optional(), - errorRef: Nf$1().optional() -}); -const Oh = Dh.omit({ - input: !0, - output: !0 -}).extend({ - inputRef: Nf$1().optional(), - outputRef: Nf$1().optional(), - input: am$1(Uint8Array).optional(), - output: am$1(Uint8Array).optional() -}); -function kh(e) { - let { error: t, errorRef: n, ...r } = e, i = { ...r }, a = t ?? n; - return a != null && (i.error = a), i; -} -function Ah(e, t) { - if (t === `none`) { - let { inputRef: t, outputRef: n, ...r } = e; - return { - ...kh(r), - input: void 0, - output: void 0 - }; - } - return kh(e); -} -async function jh(e, t) { - let { runId: n, pagination: r, resolveData: i = `all` } = e, a = new URLSearchParams(); - r?.cursor && a.set(`cursor`, r.cursor), r?.limit && a.set(`limit`, r.limit.toString()), r?.sortOrder && a.set(`sortOrder`, r.sortOrder); - let o = i === `none` ? `lazy` : `resolve`; - a.set(`remoteRefBehavior`, o); - let s = a.toString(), c = await Bm({ - endpoint: `/v2/runs/${encodeURIComponent(n)}/steps${s ? `?${s}` : ``}`, - options: { method: `GET` }, - config: t, - schema: yh$1(o === `lazy` ? Oh : Dh) - }); - return { - ...c, - data: c.data.map((e) => Ah(e, i)) - }; -} -async function Mh(e, t, n, r) { - let i = n?.resolveData ?? `all`, a = i === `none` ? `lazy` : `resolve`, o = new URLSearchParams(); - o.set(`remoteRefBehavior`, a); - let s = o.toString(); - return Ah(await Bm({ - endpoint: `/v2/runs/${encodeURIComponent(e)}/steps/${encodeURIComponent(t)}${s ? `?${s}` : ``}`, - options: { method: `GET` }, - config: r, - schema: a === `lazy` ? Oh : Dh - }), i); -} -const Nh = { - run_created: `input`, - run_started: `input`, - run_completed: `output`, - run_failed: `error`, - step_created: `input`, - step_started: `input`, - step_completed: `result`, - step_failed: `error`, - step_retrying: `error`, - hook_created: `metadata`, - hook_received: `payload` -}; -function Ph(e) { - return Nh[e]; -} -const Fh = /* @__PURE__ */ new Set([ - `run_created`, - `run_started`, - `step_started` -]); -const Ih = /* @__PURE__ */ new Set([`hook_disposed`, `hook_received`]); -function Lh(e) { - let t = e.eventData ?? {}, n = Ph(e.eventType), r = {}; - if (typeof t.deploymentId == `string` && (r.deploymentId = t.deploymentId), typeof t.workflowName == `string` && (r.workflowName = t.workflowName), typeof t.stepName == `string` && (r.stepName = t.stepName), typeof t.attempt == `number` && (r.attempt = t.attempt), t.resumeAt instanceof Date) r.resumeAt = t.resumeAt; - else if (typeof t.resumeAt == `string`) { - let e = new Date(t.resumeAt); - Number.isNaN(e.getTime()) || (r.resumeAt = e); - } - if (t.retryAfter instanceof Date) r.retryAfter = t.retryAfter; - else if (typeof t.retryAfter == `string`) { - let e = new Date(t.retryAfter); - Number.isNaN(e.getTime()) || (r.retryAfter = e); - } - typeof t.token == `string` && (r.hookToken = t.token), typeof t.isWebhook == `boolean` && (r.hookIsWebhook = t.isWebhook), typeof t.isSystem == `boolean` && (r.hookIsSystem = t.isSystem), typeof t.errorCode == `string` && (r.errorCode = t.errorCode), t.executionContext !== void 0 && t.executionContext !== null && typeof t.executionContext == `object` && (r.executionContext = t.executionContext), t.attributes !== void 0 && t.attributes !== null && typeof t.attributes == `object` && (r.attributes = t.attributes), Array.isArray(t.changes) && (r.changes = t.changes), t.writer !== void 0 && t.writer !== null && typeof t.writer == `object` && (r.writer = t.writer), typeof t.allowReservedAttributes == `boolean` && (r.allowReservedAttributes = t.allowReservedAttributes); - let i; - if (n && n in t) { - let r = t[n]; - if (r !== void 0) { - if (!(r instanceof Uint8Array)) throw TypeError(`world-vercel v4: eventData.${n} for ${e.eventType} must be a Uint8Array (the runtime's dehydrated wire form); got ${typeof r == `object` ? r === null ? `null` : r.constructor?.name ?? typeof r : typeof r}.`); - i = r; - } - } - return { - payload: i, - meta: r - }; -} -function Rh(e) { - let t = $m$1.safeParse(e); - return t.success ? t.data : (Pm$1.safeParse(e.eventType).success && console.debug(`[workflow:world-vercel] v4 event ${e.eventId} failed EventSchema parse for known eventType '${e.eventType}'; passing through unparsed: ${t.error.message}`), e); -} -function zh(e, t, n) { - let r = e.eventData ?? {}; - if (t.byteLength > 0) { - let n = Ph(e.eventType); - n && (r[n] = t); - } - let i = Rh({ - eventId: e.eventId, - runId: e.runId, - eventType: e.eventType, - createdAt: e.createdAt instanceof Date ? e.createdAt : new Date(e.createdAt), - ...e.occurredAt === void 0 ? {} : { occurredAt: e.occurredAt instanceof Date ? e.occurredAt : new Date(e.occurredAt) }, - ...e.correlationId ? { correlationId: e.correlationId } : {}, - eventData: r, - ...e.specVersion === void 0 ? {} : { specVersion: e.specVersion } - }); - return n === `none` ? Nm$1(i, `none`) : i; -} -async function Bh(e, t, n, r) { - let i = n?.resolveData ?? `all`, { event: a, body: o } = await dh(e, t, r); - return zh(a, o, i); -} -async function Vh(e, t) { - let { pagination: n, resolveData: r = `all` } = e, i = { - cursor: n?.cursor ?? void 0, - limit: n?.limit, - sortOrder: n?.sortOrder, - remoteRefBehavior: r === `none` ? `lazy` : `resolve` - }, a = await (`correlationId` in e ? gh(e.correlationId, i, t) : hh(e.runId, i, t)); - return { - data: a.events.map((e) => zh(e.event, e.body, r)), - cursor: a.next ?? null, - hasMore: typeof a.hasMore == `boolean` ? a.hasMore : !!a.next - }; -} -async function Hh(e, t, n, r) { - try { - return await Uh(e, t, n, r); - } catch (e) { - throw Ih.has(t.eventType) && s$8.is(e) && e.status === 404 && t.correlationId ? new b$9(t.correlationId) : e; - } -} -async function Uh(e, t, n, r) { - if (n?.v1Compat) { - if (t.eventType === `run_cancelled` && e) return { run: await wh(e, n, r) }; - if (t.eventType === `run_created`) return { run: await Sh(t.eventData, r) }; - if (e === null) throw new s$8(`world-vercel: v1Compat=true requires a runId for ${t.eventType}`, { status: 400 }); - return { event: await Bm({ - endpoint: `/v1/runs/${encodeURIComponent(e)}/events`, - options: { method: `POST` }, - data: t, - config: r, - schema: $m$1 - }) }; - } - if (e === null) throw new s$8(`world-vercel v4: createWorkflowRunEvent requires a client-generated runId for run_created (the runId is part of the payload storage ref key). Generate a wrun_ ULID before calling.`, { status: 400 }); - if (t.eventType === `run_created`) { - let t = Vh$1(e, `wrun_`); - if (t) throw new s$8(t, { status: 400 }); - } - let i = Fh.has(t.eventType) ? `resolve` : `lazy`, { payload: a, meta: o } = Lh(t), s = await lh({ - runId: e, - eventType: t.eventType, - specVersion: t.specVersion ?? 2, - ...t.correlationId ? { correlationId: t.correlationId } : {}, - ...n?.requestId ? { vercelId: n.requestId } : {}, - occurredAt: n?.occurredAt ?? /* @__PURE__ */ new Date(), - ...n?.sinceCursor ? { sinceCursor: n.sinceCursor } : {}, - ...n?.skipPreload ? { skipPreload: !0 } : {}, - remoteRefBehavior: i, - payload: a, - ...o - }, r), c = n?.resolveData ?? `all`, l = s.body; - return { - event: l.event ? Nm$1(Rh(l.event), c) : void 0, - run: l.run ? Fm(l.run) : void 0, - step: l.step ? kh(l.step) : void 0, - hook: l.hook, - wait: l.wait, - events: l.events ? l.events.map(Rh) : void 0, - cursor: l.cursor ?? void 0, - hasMore: l.hasMore, - ...l.stepCreated ? { stepCreated: !0 } : {} - }; -} -function Wh(e, t) { - if (t === `none`) { - let { metadataRef: t, ...n } = e; - return n; - } - return e; -} -const Gh = eh$1.omit({ metadata: !0 }).extend({ metadataRef: wm$1.any().optional() }); -async function Kh(e, t) { - let { runId: n, pagination: r, resolveData: i = `all` } = e, a = new URLSearchParams(); - r?.limit && a.set(`limit`, r.limit.toString()), r?.cursor && a.set(`cursor`, r.cursor), r?.sortOrder && a.set(`sortOrder`, r.sortOrder); - let o = i === `none` ? `lazy` : `resolve`; - a.set(`remoteRefBehavior`, o), n && a.set(`runId`, n); - let s = a.toString(), c = await Bm({ - endpoint: `/v2/hooks${s ? `?${s}` : ``}`, - options: { method: `GET` }, - config: t, - schema: yh$1(o === `lazy` ? Gh : eh$1) - }); - return { - ...c, - data: c.data.map((e) => Wh(e, i)) - }; -} -async function qh(e, t, n) { - let r = t?.resolveData || `all`; - return Wh(await Bm({ - endpoint: `/v2/hooks/${encodeURIComponent(e)}`, - options: { method: `GET` }, - config: n, - schema: eh$1 - }), r); -} -async function Jh(e, t) { - try { - return await Bm({ - endpoint: `/v2/hooks/by-token?token=${encodeURIComponent(e)}`, - options: { method: `GET` }, - config: t, - schema: eh$1 - }); - } catch (t) { - throw s$8.is(t) && t.status === 404 ? new b$9(e) : t; - } -} -function Yh(e) { - let t = { - runs: { - get: ((t, n) => Ch(t, n, e)), - list: ((t) => xh(t, e)), - experimentalSetAttributes: (t, n, r) => Eh(t, n, r, e) - }, - steps: { - get: ((t, n, r) => Mh(t, n, r, e)), - list: ((t) => jh(t, e)) - }, - events: { - create: (t, n, r) => Hh(t, n, r, e), - get: (t, n, r) => Bh(t, n, r, e), - list: (t) => Vh(t, e), - listByCorrelationId: (t) => Vh(t, e) - }, - hooks: { - get: (t, n) => qh(t, n, e), - getByToken: (t) => Jh(t, e), - list: (t) => Kh(t, e) - } - }; - return { - runs: Zc$1(`world.runs`, t.runs), - steps: Zc$1(`world.steps`, t.steps), - events: Zc$1(`world.events`, t.events), - hooks: Zc$1(`world.hooks`, t.hooks) - }; -} -const Xh = 1e3; -function Zh(e, t, n) { - return new URL(`${n.baseUrl}/v2/runs/${encodeURIComponent(t)}/stream/${encodeURIComponent(e)}`); -} -function Qh(e, t, n) { - return new URL(`${n.baseUrl}/v3/runs/${encodeURIComponent(t)}/stream/${encodeURIComponent(e)}`); -} -function $h(e, t, n, r) { - let i = [`PUT ${t.origin}${t.pathname}`]; - for (let e of [`x-vercel-id`, `x-vercel-error`]) { - let t = n.headers.get(e); - t && i.push(`${e}=${t}`); - } - return Error(`Stream ${e} failed: HTTP ${n.status} (${i.join(`; `)}): ${r}`); -} -function eg(e) { - let t = new TextEncoder(), n = [], r = 0; - for (let i of e) { - let e = typeof i == `string` ? t.encode(i) : i; - n.push(e), r += 4 + e.length; - } - let i = new Uint8Array(r), a = new DataView(i.buffer), o = 0; - for (let e of n) a.setUint32(o, e.length, !1), o += 4, i.set(e, o), o += e.length; - return i; -} -const tg = V$8({ - tailIndex: B$9(), - done: bf$1() -}); -const ng = V$8({ - data: Uf$1(V$8({ - index: B$9(), - data: am$1(Uint8Array) - })), - cursor: R$8().nullable(), - hasMore: bf$1(), - done: bf$1() -}); -function rg(e) { - return { streams: { - async write(t, n, r) { - let i = await t, a = await zm(e), o = Zh(n, i, a), s = await fetch(o, { - method: `PUT`, - body: r, - headers: a.headers - }), c = await s.text(); - if (!s.ok) throw $h(`write`, o, s, c); - }, - async writeMulti(t, n, r) { - if (r.length === 0) return; - let i = await t, a = await zm(e); - a.headers.set(`X-Stream-Multi`, `true`); - for (let e = 0; e < r.length; e += Xh) { - let t = eg(r.slice(e, e + Xh)), o = Zh(n, i, a), s = await fetch(o, { - method: `PUT`, - body: t, - headers: a.headers - }), c = await s.text(); - if (!s.ok) throw $h(`write`, o, s, c); - } - }, - async close(t, n) { - let r = await t, i = await zm(e); - i.headers.set(`X-Stream-Done`, `true`); - let a = Zh(n, r, i), o = await fetch(a, { - method: `PUT`, - headers: i.headers - }), s = await o.text(); - if (!o.ok) throw $h(`close`, a, o, s); - }, - async get(t, n, r) { - let i = await zm(e), a = Qh(n, t, i); - typeof r == `number` && a.searchParams.set(`startIndex`, String(r)); - let o = await fetch(a, { headers: i.headers }); - if (!o.ok) throw Error(`Failed to fetch stream: ${o.status}`); - if (!o.body) throw Error(`No response body for stream`); - return o.body; - }, - async getChunks(t, n, r) { - let i = new URLSearchParams(); - r?.limit != null && i.set(`limit`, String(r.limit)), r?.cursor && i.set(`cursor`, r.cursor); - let a = i.toString(); - return Bm({ - endpoint: `/v2/runs/${encodeURIComponent(t)}/streams/${encodeURIComponent(n)}/chunks${a ? `?${a}` : ``}`, - config: e, - schema: ng - }); - }, - async getInfo(t, n) { - return Bm({ - endpoint: `/v2/runs/${encodeURIComponent(t)}/streams/${encodeURIComponent(n)}/info`, - config: e, - schema: tg - }); - }, - async list(t) { - let n = await zm(e), r = new URL(`${n.baseUrl}/v2/runs/${encodeURIComponent(t)}/streams`), i = await fetch(r, { headers: n.headers }); - if (!i.ok) throw Error(`Failed to list streams: ${i.status}`); - return await i.json(); - } - } }; -} -function ig(e) { - let t = e?.projectConfig?.projectId || process.env.VERCEL_PROJECT_ID; - return { - specVersion: 5, - processExitTriggersQueueRedelivery: !0, - ...Zm(e), - ...Yh(e), - ...Zc$1(`world.streams`, rg(e)), - getEncryptionKeyForRun: xc$1(t, e?.projectConfig?.teamId, e?.token, e?.dispatcher), - resolveLatestDeploymentId: $m(e) - }; -} -function ag() { - try { - return createRequire(pathToFileURL(process.cwd() + `/package.json`).href); - } catch { - return createRequire(import.meta.url); - } -} -const og = Symbol.for(`@workflow/world//cache`); -const sg = Symbol.for(`@workflow/world//stubbedCache`); -const cg = Symbol.for(`@workflow/world//cachePromise`); -const lg = Symbol.for(`@workflow/world//stubbedCachePromise`); -const ug = globalThis; -function dg(e) { - if (e.startsWith(`file://`)) return e; - if (e.startsWith(`/`)) return pathToFileURL(e).href; - if (e.startsWith(`./`) || e.startsWith(`../`)) return pathToFileURL(process.cwd() + `/` + e).href; - try { - return pathToFileURL(ag().resolve(e)).href; - } catch { - return e; - } -} -const fg = async () => { - let e = g$9(); - if (_$8(e)) { - let e = [ - `WORKFLOW_VERCEL_PROJECT`, - `WORKFLOW_VERCEL_TEAM`, - `WORKFLOW_VERCEL_AUTH_TOKEN`, - `WORKFLOW_VERCEL_ENV` - ].filter((e) => process.env[e]); - return e.length > 0 && process.env.VERCEL === `1` && console.warn(`[workflow] Warning: ${e.join(`, `)} env var(s) are set but have no effect at runtime. These are only used by the Workflow CLI. Remove them from your Vercel project environment variables.`), ig(); - } - if (e === `local`) return oc$1({ dataDir: process.env.WORKFLOW_LOCAL_DATA_DIR }); - let t; - try { - t = ag()(e); - } catch { - t = await import(dg(e)); - } - if (typeof t == `function`) return t(); - if (typeof t.default == `function`) return t.default(); - if (typeof t.createWorld == `function`) return t.createWorld(); - throw Error(`Invalid target world module: ${e}, must export a default function or createWorld function that returns a World instance.`); -}; -const pg = async () => { - if (ug[sg]) return ug[sg]; - ug[lg] || (ug[lg] = fg().catch((e) => { - throw ug[lg] = void 0, e; - })); - let e = await ug[lg]; - return ug[sg] = e, { - createQueueHandler: e.createQueueHandler, - specVersion: e.specVersion - }; -}; -const mg = async () => ug[og] ? ug[og] : (ug[cg] || (ug[cg] = fg().catch((e) => { - throw ug[cg] = void 0, e; -})), ug[og] = await ug[cg], ug[og]); -const gg = Symbol.for(`@workflow/world//getWorldFn`); -globalThis[gg] ??= mg; -var _g = class { - limitMs; - elapsedMs = 0; - intervalStart; - constructor(e = kr$3()) { - this.limitMs = e, this.intervalStart = Date.now(); - } - get configuredLimitMs() { - return this.limitMs; - } - elapsed() { - let e = this.intervalStart === null ? 0 : Date.now() - this.intervalStart; - return this.elapsedMs + e; - } - pause() { - this.intervalStart !== null && (this.elapsedMs += Date.now() - this.intervalStart, this.intervalStart = null); - } - resume() { - this.intervalStart = Date.now(); - } - isExhausted() { - return this.elapsed() >= this.limitMs; - } -}; -async function vg(e) { - let { runId: t, workflowName: n, requestId: r, attempt: i, limitMs: a } = e, o = Ab.forRun(t, n), s = await mg(); - if (s.processExitTriggersQueueRedelivery !== !0) { - o.warn(`Workflow replay exceeded timeout; current World does not support process exit for redelivery — failing the run and returning`, { - timeoutMs: a, - attempt: i - }); - try { - let e = mS(s, t), n = new D$10(`Workflow replay exceeded maximum duration (${a / 1e3}s)`); - await s.events.create(t, { - eventType: `run_failed`, - specVersion: 5, - eventData: { - error: await Lx(n, t, await e()), - errorCode: t$9.REPLAY_TIMEOUT - } - }, { requestId: r }); - } catch (e) { - o.warn(`Unable to mark run as failed`, { - attempt: i, - errorName: e instanceof Error ? e.name : `UnknownError`, - errorMessage: e instanceof Error ? e.message : String(e) - }); - } - return; - } - i <= 3 && (o.warn(`Workflow replay exceeded timeout but will be re-attempted (attempt < maxRetries)`, { - timeoutMs: a, - attempt: i, - maxRetries: 3 - }), process.exit(1)); - let c = Cr$3(void 0, t$9.REPLAY_TIMEOUT); - o.error(`Workflow replay exceeded timeout and max retries exceeded. Failing the run`, { - timeoutMs: a, - attempt: i, - maxRetries: 3, - errorCode: c.errorCode, - errorAttribution: c.attribution - }); - try { - let e = mS(s, t), n = new D$10(`Workflow replay exceeded maximum duration (${a / 1e3}s) after ${i} attempts`); - await s.events.create(t, { - eventType: `run_failed`, - specVersion: 5, - eventData: { - error: await Lx(n, t, await e()), - errorCode: t$9.REPLAY_TIMEOUT - } - }, { requestId: r }); - } catch (e) { - o.warn(`Unable to mark run as failed. The queue will continue to retry`, { - attempt: i, - errorName: e instanceof Error ? e.name : `UnknownError`, - errorMessage: e instanceof Error ? e.message : String(e), - errorStack: e instanceof Error ? e.stack : void 0 - }); - } - process.exit(1); -} -function yg(e) { - return types.isNativeError(e) ? e.name : `Error`; -} -function bg(e) { - return types.isNativeError(e) ? e.stack ?? `` : ``; -} -function xg(e) { - return typeof e == `object` && !!e && `name` in e && e.name === `AbortError` && `message` in e && typeof e.message == `string` && (!(`stack` in e) || e.stack === void 0 || typeof e.stack == `string`); -} -function Sg(e) { - if (!xg(e) || D$10.is(e)) return e; - let t = new D$10(`Aborted: ${e.message}`); - return e.stack && (t.stack = e.stack), t; -} -function Cg(e) { - return typeof e == `object` && !!e && `then` in e && typeof e.then == `function`; -} -function wg(e) { - if (types.isNativeError(e)) return { - name: e.name, - message: e.message, - stack: e.stack ?? `` - }; - if (typeof e == `string`) return { - name: `Error`, - message: e, - stack: `` - }; - try { - return { - name: `Error`, - message: JSON.stringify(e), - stack: `` - }; - } catch { - return { - name: `Error`, - message: String(e), - stack: `` - }; - } -} -async function Tg(e) { - if (Cg(e)) try { - let t = await Tg(await e); - return { - ...t, - message: `Promise rejection: ${t.message}` - }; - } catch (e) { - let t = await Tg(e); - return { - ...t, - message: `Promise rejection: ${t.message}` - }; - } - return wg(e); -} -let Eg; -let Dg; -let Og; -async function kg() { - if (Dg !== void 0) return Dg; - if (Og) return Og; - if (!Eg) try { - let e = [`@workflow/utils`, `get-port`].join(`/`); - Eg = createRequire(pathToFileURL(process.cwd() + `/package.json`).href)(e).getPort; - } catch { - Eg = async () => void 0; - } - return Og = (Eg ?? (async () => void 0))().then((e) => (typeof e == `number` && (Dg = e), e)).finally(() => { - Og = void 0; - }), Og; -} -function Ag(e, t) { - if (t && !(!e.events || e.cursor === void 0)) return { - events: e.events, - cursor: e.cursor, - hasMore: e.hasMore ?? !1 - }; -} -async function jg(e) { - let { world: t, workflowRunId: n, workflowName: r, workflowStartedAt: i, stepId: o, stepName: s } = e, c = process.env.VERCEL_URL !== void 0, l = (e.runSpecVersion ?? 0) >= 5; - return vb(`step.execute ${l$9(s)}`, {}, async (u) => { - u?.setAttributes({ - ...my(s), - ...Kv(r), - ...Jv(n), - ...hy(o) - }); - let d = mS(t, n), f = c$8(s); - if (!f || typeof f != `function`) { - let i = `Step "${s}" is not registered in the current deployment. This usually indicates a build or bundling issue that caused the step to not be included in the deployment.`; - if (Ab.error(`Step function not registered, failing step`, { - workflowRunId: n, - stepName: s, - stepId: o - }), e.lazyStepInput !== void 0) try { - e.runReadyBarrier && await e.runReadyBarrier.catch(() => {}), await t.events.create(n, { - eventType: `step_started`, - specVersion: 5, - correlationId: o, - eventData: { - stepName: s, - workflowName: r, - input: e.lazyStepInput - } - }); - } catch (e) { - if (x$9.is(e)) return { type: `skipped` }; - if (S$10.is(e)) return { type: `gone` }; - throw e; - } - try { - await t.events.create(n, { - eventType: `step_failed`, - specVersion: 5, - correlationId: o, - eventData: { - stepName: s, - error: await Fx(new D$10(i), n, await d(), [], globalThis, l) - } - }); - } catch (e) { - if (x$9.is(e)) return { type: `skipped` }; - throw e; - } - return u?.setAttributes({ - ..._y(`failed`), - ...Ty(!0) - }), { type: `failed` }; - } - let p = f.maxRetries ?? 3; - u?.setAttributes({ ...vy(p) }); - let m = (e) => { - if (w$11.is(e)) { - let t = Math.max(1, typeof e.retryAfter == `number` ? e.retryAfter : 1); - return Ab.info(`Throttled on step_started, deferring`, { retryAfterSeconds: t }), { - type: `throttled`, - timeoutSeconds: t - }; - } - if (S$10.is(e)) return Ab.info(`Workflow run "${n}" has already completed, skipping step "${o}": ${e.message}`), { type: `gone` }; - if (x$9.is(e)) return Ab.debug(`Step in terminal state, skipping`, { - stepName: s, - stepId: o, - workflowRunId: n, - error: e instanceof Error ? e.message : String(e) - }), u?.setAttributes({ - ...yy(!0), - ...by(`completed`) - }), { type: `skipped` }; - if (C$11.is(e)) { - let t = Math.max(1, e.retryAfter ?? 1); - return Ab.debug(`Step retryAfter timestamp not yet reached`, { - stepName: s, - stepId: o, - timeoutSeconds: t - }), { - type: `retry`, - timeoutSeconds: t - }; - } - }, g = e.lazyStepInput !== void 0 && (Mr$3() || e.forceOptimisticStart === !0 && !Nr$3()), _, S, C = async () => { - if (!S) return; - let e = await S; - if (e.ok) return; - let t = m(e.err); - if (!t) throw e.err; - return t; - }; - if (g) { - S = (e.runReadyBarrier ?? Promise.resolve()).then(() => t.events.create(n, { - eventType: `step_started`, - specVersion: 5, - correlationId: o, - eventData: { - stepName: s, - workflowName: r, - input: e.lazyStepInput - } - })).then(() => ({ ok: !0 }), (e) => ({ - ok: !1, - err: e - })); - let i = /* @__PURE__ */ new Date(); - _ = { - runId: n, - stepId: o, - stepName: s, - status: `running`, - input: e.lazyStepInput, - attempt: 1, - startedAt: i, - createdAt: i, - updatedAt: i - }; - } else try { - let i = await t.events.create(n, { - eventType: `step_started`, - specVersion: 5, - correlationId: o, - eventData: e.lazyStepInput === void 0 ? { stepName: s } : { - stepName: s, - workflowName: r, - input: e.lazyStepInput - } - }); - if (!i.step) throw new u$10(`step_started event for "${o}" did not return step entity`); - _ = i.step; - } catch (e) { - let t = m(e); - if (t) return t; - throw e; - } - Ab.debug(`Step execution details`, { - stepName: s, - stepId: _.stepId, - status: _.status, - attempt: _.attempt - }), u?.setAttributes({ ..._y(_.status) }); - let w; - if (_.attempt > p + 1 && _.error) { - let e = _.attempt - 1, r = `Step "${s}" exceeded max retries (${e} ${n$11(`retry`, `retries`, e)})`; - kb.error(`Step exceeded max retries`, { - workflowRunId: n, - stepName: s, - retryCount: e - }); - let i = new D$10(r); - if (_.error != null) try { - i.cause = await Ix(_.error, n, await d()); - } catch {} - try { - await t.events.create(n, { - eventType: `step_failed`, - specVersion: 5, - correlationId: o, - eventData: { - stepName: s, - error: await Fx(i, n, await d(), [], globalThis, l) - } - }); - } catch (e) { - if (x$9.is(e)) return Ab.info(`Tried failing step, but step has already finished.`, { - workflowRunId: n, - stepId: o, - stepName: s, - message: e.message - }), { type: `skipped` }; - throw e; - } - return u?.setAttributes({ - ..._y(`failed`), - ...Ey(!0) - }), { type: `failed` }; - } - let E = []; - try { - let a = _.attempt; - if (!_.startedAt) throw new u$10(`Step "${o}" has no "startedAt" timestamp`); - let p = _.startedAt, m = [], h = e.encryptionKey ?? await d(), v = await vb(`step.hydrate`, {}, async (t) => { - let r = Date.now(), i = await Nx(_.input, n, h, m, globalThis, {}, e.workflowDeploymentId), a = Date.now() - r; - return t?.setAttributes({ - ...xy(i.args.length), - ...qy(a) - }), i; - }), y = v.args, b = v.thisVal ?? null, x = c ? void 0 : await kg(), S = Date.now(); - w = await vb(`step.execute`, {}, async () => await Vb.run({ - stepMetadata: { - stepName: s, - stepId: o, - stepStartedAt: /* @__PURE__ */ new Date(+p), - attempt: a - }, - workflowMetadata: { - workflowName: r, - workflowRunId: n, - workflowStartedAt: /* @__PURE__ */ new Date(+i), - url: c ? `https://${process.env.VERCEL_URL}` : `http://localhost:${x ?? 3e3}`, - features: { encryption: !!h } - }, - workflowDeploymentId: e.workflowDeploymentId, - ops: m, - preCompletionOps: E, - closureVars: v.closureVars, - encryptionKey: h - }, () => f.apply(b, y))); - let D = Date.now() - S; - u?.setAttributes({ ...Jy(D) }), w = await vb(`step.dehydrate`, {}, async (e) => { - let t = Date.now(), r = await Px(w, n, h, m, globalThis, !1, !1, l), i = Date.now() - t; - return e?.setAttributes({ - ...Yy(i), - ...Sy(typeof r) - }), r; - }); - let O = !0; - if (m.length > 0) { - let e = Promise.all(m); - gS(e, (e) => { - Ab.warn(`Background flush of step stream ops failed`, { - workflowRunId: n, - stepId: o, - error: e instanceof Error ? e.message : String(e) - }); - }), O = await Promise.race([e.then(() => !0, (e) => { - if (e?.name === `AbortError` || e?.name === `ResponseAborted`) return !0; - throw e; - }), new Promise((e) => setTimeout(() => e(!1), 500))]); - } - if (g) { - let e = await C(); - if (e) return e; - } - E.length > 0 && await Promise.all(E).catch(() => {}); - let A = !1, j = await t.events.create(n, { - eventType: `step_completed`, - specVersion: 5, - correlationId: o, - eventData: { - stepName: s, - workflowName: r, - result: w - } - }, e.inlineDeltaSinceCursor === void 0 ? void 0 : { sinceCursor: e.inlineDeltaSinceCursor }).catch((e) => { - if (x$9.is(e)) { - Ab.info(`Tried completing step, but step has already finished.`, { - workflowRunId: n, - stepId: o, - stepName: s, - message: e.message - }), A = !0; - return; - } - throw e; - }); - if (A) return { type: `skipped` }; - let M = j ? Ag(j, e.inlineDeltaSinceCursor !== void 0) : void 0; - return u?.setAttributes({ - ..._y(`completed`), - ...Sy(typeof w) - }), m.length > 0 && kb.debug(`Step has pending ops`, { - workflowRunId: n, - stepName: s, - opsCount: m.length - }), { - type: `completed`, - hasPendingOps: !O, - inlineDelta: M - }; - } catch (e) { - if (g) { - let e = await C(); - if (e) return e; - } - E.length > 0 && await Promise.all(E).catch(() => {}); - let r = Sg(e), i = await Tg(r), c = i.stack || bg(r) || ``; - r instanceof Error && u?.recordException?.(r); - let f = D$10.is(r); - if (u?.setAttributes({ - ...Cy(yg(r)), - ...wy(i.message), - ...Gy(yg(r)), - ...sb(f ? `fatal` : O$8.is(r) ? `retryable` : `transient`), - ...ob(!f) - }), S$10.is(e)) return kb.info(`Workflow run already completed, skipping step`, { - workflowRunId: n, - stepId: o, - message: e.message - }), { type: `gone` }; - if (f) { - kb.error(`Encountered FatalError while executing step, bubbling up to parent workflow`, { - workflowRunId: n, - stepName: s, - errorStack: c - }), types.isNativeError(r) && c && (r.stack = c); - try { - await t.events.create(n, { - eventType: `step_failed`, - specVersion: 5, - correlationId: o, - eventData: { - stepName: s, - error: await Fx(r, n, await d(), [], globalThis, l) - } - }); - } catch (e) { - if (x$9.is(e)) return Ab.info(`Tried failing step, but step has already finished.`, { - workflowRunId: n, - stepId: o, - stepName: s, - message: e.message - }), { type: `skipped` }; - throw e; - } - return u?.setAttributes({ - ..._y(`failed`), - ...Ty(!0) - }), { type: `failed` }; - } - let m = _.attempt; - if (u?.setAttributes({ - ...gy(m), - ...vy(p) - }), m >= p + 1) { - let r = _.attempt - 1; - kb.error(`Max retries reached, bubbling error to parent workflow`, { - workflowRunId: n, - stepName: s, - attempt: _.attempt, - retryCount: r, - errorStack: c - }); - let f = new D$10(`Step "${s}" failed after ${p} ${n$11(`retry`, `retries`, p)}: ${i.message}`); - f.cause = e, c && (f.stack = c); - try { - await t.events.create(n, { - eventType: `step_failed`, - specVersion: 5, - correlationId: o, - eventData: { - stepName: s, - error: await Fx(f, n, await d(), [], globalThis, l) - } - }); - } catch (e) { - if (x$9.is(e)) return Ab.info(`Tried failing step, but step has already finished.`, { - workflowRunId: n, - stepId: o, - stepName: s, - message: e.message - }), { type: `skipped` }; - throw e; - } - return u?.setAttributes({ - ..._y(`failed`), - ...Ey(!0) - }), { type: `failed` }; - } - O$8.is(e) ? kb.info(`Encountered RetryableError, step will be retried`, { - workflowRunId: n, - stepName: s, - attempt: m, - message: e.message - }) : kb.info(`Encountered Error, step will be retried`, { - workflowRunId: n, - stepName: s, - attempt: m, - errorStack: c - }), types.isNativeError(e) && c && (e.stack = c); - try { - await t.events.create(n, { - eventType: `step_retrying`, - specVersion: 5, - correlationId: o, - eventData: { - stepName: s, - error: await Fx(e, n, await d(), [], globalThis, l), - ...O$8.is(e) && { retryAfter: e.retryAfter } - } - }); - } catch (e) { - if (x$9.is(e)) return Ab.info(`Tried retrying step, but step has already finished.`, { - workflowRunId: n, - stepId: o, - stepName: s, - message: e.message - }), { type: `skipped` }; - throw e; - } - let v = Math.max(1, O$8.is(e) ? Math.ceil((+e.retryAfter.getTime() - Date.now()) / 1e3) : 1); - return u?.setAttributes({ - ...Dy(v), - ...Oy(!0) - }), { - type: `retry`, - timeoutSeconds: v - }; - } - }); -} -async function Mg({ world: e, runId: t, hookEvent: n, queueItem: r, requestId: i }) { - try { - return (await e.events.create(t, n, { requestId: i })).event?.eventType === `hook_conflict` ? { - hasHookConflict: !0, - hasAwaitedHookCreation: !1 - } : { - hasHookConflict: !1, - hasAwaitedHookCreation: r.hasConflictAwaiter === !0 - }; - } catch (e) { - if (x$9.is(e)) return Ab.info(`Hook already exists, continuing`, { - workflowRunId: t, - message: e.message - }), { - hasHookConflict: !1, - hasAwaitedHookCreation: r.hasConflictAwaiter === !0 - }; - if (S$10.is(e)) return Ab.info(`Workflow run already completed, skipping hook`, { - workflowRunId: t, - message: e.message - }), { - hasHookConflict: !1, - hasAwaitedHookCreation: !1 - }; - throw e; - } -} -async function Ng({ suspension: e, world: t, run: n, span: r, requestId: i, runReadyBarrier: a }) { - let o = n.runId, s = async () => { - if (a) try { - await a; - } catch {} - }, c = e.steps.filter((e) => e.type === `step`), l = e.steps.filter((e) => e.type === `hook`), u = e.steps.filter((e) => e.type === `wait`), d = e.steps.filter((e) => e.type === `attribute`), f = l.filter((e) => !e.hasCreatedEvent), p = l.filter((e) => e.disposed), m = await t.getEncryptionKeyForRun?.(n), h = m ? await p_$1(m) : void 0, g = (n.specVersion ?? 0) >= 5, _ = await Promise.all(f.map(async (t) => { - let n = t.metadata === void 0 ? void 0 : await Mx(t.metadata, o, h, e.globalThis, !1, g); - return { - queueItem: t, - hookEvent: { - eventType: `hook_created`, - specVersion: 5, - correlationId: t.correlationId, - eventData: { - token: t.token, - metadata: n, - isWebhook: t.isWebhook ?? !1, - ...t.isSystem && { isSystem: !0 } - } - } - }; - })), v = !1, x = !1; - if (_.length > 0) { - await s(); - let e = await Promise.all(_.map(({ hookEvent: e, queueItem: n }) => Mg({ - world: t, - runId: o, - hookEvent: e, - queueItem: n, - requestId: i - }))); - v = e.some((e) => e.hasHookConflict), x = e.some((e) => e.hasAwaitedHookCreation); - } - p.length > 0 && (await s(), await Promise.all(p.map(async (e) => { - let n = { - eventType: `hook_disposed`, - specVersion: 5, - correlationId: e.correlationId, - eventData: { token: e.token } - }; - try { - await t.events.create(o, n, { requestId: i }); - } catch (t) { - if (x$9.is(t)) Ab.info(`Hook already disposed, skipping duplicate disposal`, { - workflowRunId: o, - correlationId: e.correlationId, - message: t.message - }); - else if (S$10.is(t)) Ab.info(`Workflow run already completed, skipping hook disposal`, { - workflowRunId: o, - correlationId: e.correlationId, - message: t.message - }); - else if (b$9.is(t)) Ab.info(`Hook not found for disposal, continuing`, { - workflowRunId: o, - correlationId: e.correlationId, - message: t.message - }); - else throw t; - } - }))); - let S = l.filter((e) => e.abortRequested && !e.disposed); - S.length > 0 && (await s(), await Promise.all(S.map(async (n) => { - try { - let r = await Mx({ - aborted: !0, - reason: n.abortReason - }, o, h, e.globalThis, !1, g); - await t.events.create(o, { - eventType: `hook_received`, - specVersion: 5, - correlationId: n.correlationId, - eventData: { - token: n.token, - payload: r - } - }); - try { - let e = Gb(n.token); - await t.streams.write(o, e, r), await t.streams.close(o, e); - } catch { - Ab.debug(`Failed to write abort stream packet, hook event will provide fallback`, { - workflowRunId: o, - correlationId: n.correlationId - }); - } - } catch (e) { - if (x$9.is(e) || S$10.is(e)) Ab.info(`Workflow run already completed, skipping abort`, { - workflowRunId: o, - correlationId: n.correlationId, - message: e.message - }); - else throw e; - } - }))); - let w = new Set(c.filter((e) => !e.hasCreatedEvent).map((e) => e.correlationId)), E = /* @__PURE__ */ new Set(), D = new Set(x === !1 ? c.filter((e) => w.has(e.correlationId)).slice(0, jr$3()).map((e) => e.correlationId) : []), O = /* @__PURE__ */ new Map(), k = []; - for (let r of c) w.has(r.correlationId) && k.push((async () => { - let a = await Mx({ - args: r.args, - closureVars: r.closureVars, - thisVal: r.thisVal - }, o, h, e.globalThis, !1, g); - if (D.has(r.correlationId)) { - O.set(r.correlationId, { - correlationId: r.correlationId, - stepName: r.stepName, - dehydratedInput: a - }); - return; - } - let c = { - eventType: `step_created`, - specVersion: 5, - correlationId: r.correlationId, - eventData: { - stepName: r.stepName, - workflowName: n.workflowName, - input: a - } - }; - try { - await s(), await t.events.create(o, c, { requestId: i }), E.add(r.correlationId); - } catch (e) { - if (x$9.is(e)) Ab.info(`Step already exists, continuing`, { - workflowRunId: o, - correlationId: r.correlationId, - message: e.message - }); - else throw e; - } - })()); - for (let e of u) e.hasCreatedEvent || k.push((async () => { - let n = { - eventType: `wait_created`, - specVersion: 5, - correlationId: e.correlationId, - eventData: { resumeAt: e.resumeAt } - }; - try { - await s(), await t.events.create(o, n, { requestId: i }); - } catch (t) { - if (x$9.is(t)) Ab.info(`Wait already exists, continuing`, { - workflowRunId: o, - correlationId: e.correlationId, - message: t.message - }); - else throw t; - } - })()); - for (let e of d) k.push((async () => { - try { - await s(), await t.events.create(o, { - eventType: `attr_set`, - specVersion: 5, - correlationId: e.correlationId, - eventData: { - changes: e.changes, - writer: { type: `workflow` }, - ...e.allowReservedAttributes ? { allowReservedAttributes: !0 } : {} - } - }, { requestId: i }); - } catch (t) { - if (x$9.is(t)) Ab.info(`Workflow attribute event already exists, continuing`, { - workflowRunId: o, - correlationId: e.correlationId, - message: t.message - }); - else if (Pg(t)) { - let e = new D$10(`experimental_setAttributes failed World validation: ${t instanceof Error ? t.message : String(t)}`); - throw e.cause = t, e; - } else throw t; - } - })()); - await Promise.all(k); - let A = []; - for (let e of D) { - let t = O.get(e); - t && A.push(t); - } - let j = Date.now(), M; - for (let e of u) { - let t = e.resumeAt.getTime(), n = Math.max(1e3, t - j), r = Math.ceil(n / 1e3); - (!M || r < M.seconds) && (M = { - seconds: r, - correlationId: e.correlationId - }); - } - return r?.setAttributes({ - ...Yv(`workflow_suspended`), - ...oy(c.length), - ...sy(f.length), - ...cy(u.length) - }), { - pendingSteps: c, - createdStepCorrelationIds: E, - lazyInlineSteps: A, - waitTimeout: v ? void 0 : M, - hasHookConflict: v, - hasAwaitedHookCreation: x, - hasAttributeEvents: d.length > 0, - hasHookEvents: _.length > 0 - }; -} -function Pg(e) { - return e instanceof Em$1 || e instanceof Error && e.name === `AttributeValidationError` ? !0 : s$8.is(e) && e.status === 400; -} -const Fg = 82800; -function Ig(e, t, n = Date.now()) { - if (e <= 2) return { - delaySeconds: e, - idempotencyKey: `${t}:${Math.floor(n / 1e3)}` - }; - let r = Math.ceil(e / Fg); - return { - delaySeconds: Math.min(e, Fg), - idempotencyKey: r === 1 ? t : `${t}:hop-${r}` - }; -} -var Lg = 44; -var Rg = `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`; -var zg = /* @__PURE__ */ new Uint8Array(64); -var Bg = /* @__PURE__ */ new Uint8Array(128); -for (let e = 0; e < Rg.length; e++) { - let t = Rg.charCodeAt(e); - zg[e] = t, Bg[t] = e; -} -function Vg(e, t) { - let n = 0, r = 0, i = 0; - do - i = Bg[e.next()], n |= (i & 31) << r, r += 5; - while (i & 32); - let a = n & 1; - return n >>>= 1, a && (n = -2147483648 | -n), t + n; -} -function Hg(e, t) { - return e.pos >= t ? !1 : e.peek() !== Lg; -} -var Ug = class { - constructor(e) { - this.pos = 0, this.buffer = e; - } - next() { - return this.buffer.charCodeAt(this.pos++); - } - peek() { - return this.buffer.charCodeAt(this.pos); - } - indexOf(e) { - let { buffer: t, pos: n } = this, r = t.indexOf(e, n); - return r === -1 ? t.length : r; - } -}; -function Wg(e) { - let { length: t } = e, n = new Ug(e), r = [], i = 0, a = 0, o = 0, s = 0, c = 0; - do { - let e = n.indexOf(`;`), t = [], l = !0, u = 0; - for (i = 0; n.pos < e;) { - let r; - i = Vg(n, i), i < u && (l = !1), u = i, Hg(n, e) ? (a = Vg(n, a), o = Vg(n, o), s = Vg(n, s), Hg(n, e) ? (c = Vg(n, c), r = [ - i, - a, - o, - s, - c - ]) : r = [ - i, - a, - o, - s - ]) : r = [i], t.push(r), n.pos++; - } - l || Gg(t), r.push(t), n.pos = e + 1; - } while (n.pos <= t); - return r; -} -function Gg(e) { - e.sort(Kg); -} -function Kg(e, t) { - return e[0] - t[0]; -} -const qg = /^[\w+.-]+:\/\//; -const Jg = /^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/; -const Yg = /^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i; -function Xg(e) { - return qg.test(e); -} -function Zg(e) { - return e.startsWith(`//`); -} -function Qg(e) { - return e.startsWith(`/`); -} -function $g(e) { - return e.startsWith(`file:`); -} -function e_(e) { - return /^[.?#]/.test(e); -} -function t_(e) { - let t = Jg.exec(e); - return r_(t[1], t[2] || ``, t[3], t[4] || ``, t[5] || `/`, t[6] || ``, t[7] || ``); -} -function n_(e) { - let t = Yg.exec(e), n = t[2]; - return r_(`file:`, ``, t[1] || ``, ``, Qg(n) ? n : `/` + n, t[3] || ``, t[4] || ``); -} -function r_(e, t, n, r, i, a, o) { - return { - scheme: e, - user: t, - host: n, - port: r, - path: i, - query: a, - hash: o, - type: 7 - }; -} -function i_(e) { - if (Zg(e)) { - let t = t_(`http:` + e); - return t.scheme = ``, t.type = 6, t; - } - if (Qg(e)) { - let t = t_(`http://foo.com` + e); - return t.scheme = ``, t.host = ``, t.type = 5, t; - } - if ($g(e)) return n_(e); - if (Xg(e)) return t_(e); - let t = t_(`http://foo.com/` + e); - return t.scheme = ``, t.host = ``, t.type = e ? e.startsWith(`?`) ? 3 : e.startsWith(`#`) ? 2 : 4 : 1, t; -} -function a_(e) { - if (e.endsWith(`/..`)) return e; - let t = e.lastIndexOf(`/`); - return e.slice(0, t + 1); -} -function o_(e, t) { - s_(t, t.type), e.path === `/` ? e.path = t.path : e.path = a_(t.path) + e.path; -} -function s_(e, t) { - let n = t <= 4, r = e.path.split(`/`), i = 1, a = 0, o = !1; - for (let e = 1; e < r.length; e++) { - let t = r[e]; - if (!t) { - o = !0; - continue; - } - if (o = !1, t !== `.`) { - if (t === `..`) { - a ? (o = !0, a--, i--) : n && (r[i++] = t); - continue; - } - r[i++] = t, a++; - } - } - let s = ``; - for (let e = 1; e < i; e++) s += `/` + r[e]; - (!s || o && !s.endsWith(`/..`)) && (s += `/`), e.path = s; -} -function c_(e, t) { - if (!e && !t) return ``; - let n = i_(e), r = n.type; - if (t && r !== 7) { - let e = i_(t), i = e.type; - switch (r) { - case 1: n.hash = e.hash; - case 2: n.query = e.query; - case 3: - case 4: o_(n, e); - case 5: n.user = e.user, n.host = e.host, n.port = e.port; - case 6: n.scheme = e.scheme; - } - i > r && (r = i); - } - s_(n, r); - let i = n.query + n.hash; - switch (r) { - case 2: - case 3: return i; - case 4: { - let r = n.path.slice(1); - return r ? e_(t || e) && !e_(r) ? `./` + r + i : r + i : i || `.`; - } - case 5: return n.path + i; - default: return n.scheme + `//` + n.user + n.host + n.port + n.path + i; - } -} -function l_(e) { - if (!e) return ``; - let t = e.lastIndexOf(`/`); - return e.slice(0, t + 1); -} -function u_(e, t) { - let n = l_(e), r = t ? t + `/` : ``; - return (e) => c_(r + (e || ``), n); -} -var d_ = 0; -var f_ = 1; -var p_ = 2; -var m_ = 3; -var h_ = 4; -function g_(e, t) { - let n = __(e, 0); - if (n === e.length) return e; - t || (e = e.slice()); - for (let r = n; r < e.length; r = __(e, r + 1)) e[r] = y_(e[r], t); - return e; -} -function __(e, t) { - for (let n = t; n < e.length; n++) if (!v_(e[n])) return n; - return e.length; -} -function v_(e) { - for (let t = 1; t < e.length; t++) if (e[t][d_] < e[t - 1][d_]) return !1; - return !0; -} -function y_(e, t) { - return t || (e = e.slice()), e.sort(b_); -} -function b_(e, t) { - return e[d_] - t[d_]; -} -var x_ = !1; -function S_(e, t, n, r) { - for (; n <= r;) { - let i = n + (r - n >> 1), a = e[i][d_] - t; - if (a === 0) return x_ = !0, i; - a < 0 ? n = i + 1 : r = i - 1; - } - return x_ = !1, n - 1; -} -function C_(e, t, n) { - for (let r = n + 1; r < e.length && e[r][d_] === t; n = r++); - return n; -} -function w_(e, t, n) { - for (let r = n - 1; r >= 0 && e[r][d_] === t; n = r--); - return n; -} -function T_() { - return { - lastKey: -1, - lastNeedle: -1, - lastIndex: -1 - }; -} -function E_(e, t, n, r) { - let { lastKey: i, lastNeedle: a, lastIndex: o } = n, s = 0, c = e.length - 1; - if (r === i) { - if (t === a) return x_ = o !== -1 && e[o][d_] === t, o; - t >= a ? s = o === -1 ? 0 : o : c = o; - } - return n.lastKey = r, n.lastNeedle = t, n.lastIndex = S_(e, t, s, c); -} -function D_(e) { - return typeof e == `string` ? JSON.parse(e) : e; -} -var O_ = "`line` must be greater than 0 (lines start at line 1)"; -var k_ = "`column` must be greater than or equal to 0 (columns start at column 0)"; -var A_ = class { - constructor(e, t) { - let n = typeof e == `string`; - if (!n && e._decodedMemo) return e; - let r = D_(e), { version: i, file: a, names: o, sourceRoot: s, sources: c, sourcesContent: l } = r; - this.version = i, this.file = a, this.names = o || [], this.sourceRoot = s, this.sources = c, this.sourcesContent = l, this.ignoreList = r.ignoreList || r.x_google_ignoreList || void 0; - let u = u_(t, s); - this.resolvedSources = c.map(u); - let { mappings: d } = r; - if (typeof d == `string`) this._encoded = d, this._decoded = void 0; - else if (Array.isArray(d)) this._encoded = void 0, this._decoded = g_(d, n); - else if (r.sections) throw Error(`TraceMap passed sectioned source map, please use FlattenMap export instead`); - else throw Error(`invalid source map: ${JSON.stringify(r)}`); - this._decodedMemo = T_(), this._bySources = void 0, this._bySourceMemos = void 0; - } -}; -function j_(e) { - return e; -} -function M_(e) { - var t; - return (t = j_(e))._decoded || (t._decoded = Wg(j_(e)._encoded)); -} -function N_(e, t) { - let { line: n, column: r, bias: i } = t; - if (n--, n < 0) throw Error(O_); - if (r < 0) throw Error(k_); - let a = M_(e); - if (n >= a.length) return P_(null, null, null, null); - let o = a[n], s = F_(o, j_(e)._decodedMemo, n, r, i || 1); - if (s === -1) return P_(null, null, null, null); - let c = o[s]; - if (c.length === 1) return P_(null, null, null, null); - let { names: l, resolvedSources: u } = e; - return P_(u[c[f_]], c[p_] + 1, c[m_], c.length === 5 ? l[c[h_]] : null); -} -function P_(e, t, n, r) { - return { - source: e, - line: t, - column: n, - name: r - }; -} -function F_(e, t, n, r, i) { - let a = E_(e, r, t, n); - return x_ ? a = (i === -1 ? C_ : w_)(e, r, a) : i === -1 && a++, a === -1 || a === e.length ? -1 : a; -} -function I_(e) { - return e >= 65 && e <= 90 || e >= 97 && e <= 122 || e >= 48 && e <= 57 || e === 43 || e === 47 || e === 61; -} -function L_(e) { - let t = 0; - for (; t < e.length;) { - let n = e.indexOf(`//# sourceMappingURL=data:application/json`, t); - if (n === -1) return; - let r = e.indexOf(`;base64,`, n + 42); - if (r === -1) { - t = n + 42; - continue; - } - let i = e.indexOf(`,`, n); - if (i !== -1 && i < r) { - t = r + 8; - continue; - } - let a = r + 8, o = a; - for (; o < e.length && I_(e.charCodeAt(o));) o++; - if (o > a) return e.slice(a, o); - t = o; - } -} -const R_ = /* @__PURE__ */ new Map(); -function z_(e) { - let t = R_.get(e); - if (t !== void 0) return R_.delete(e), R_.set(e, t), t; - let n = null, r = L_(e); - if (r) try { - let e = Buffer.from(r, `base64`).toString(`utf-8`); - n = new A_(JSON.parse(e)); - } catch { - n = null; - } - for (R_.set(e, n); R_.size > 8;) { - let e = R_.keys().next().value; - if (e === void 0) break; - R_.delete(e); - } - return n; -} -function B_(e, t, n) { - if (!e.includes(t)) return e; - let r = z_(n); - if (!r) return e; - try { - return e.split(` -`).map((e) => { - let n = e.match(/^\s*at\s+(?:(.+?)\s+\()?(.+?):(\d+):(\d+)\)?$/); - if (!n) return e; - let [, i, a, o, s] = n; - if (!a.includes(t)) return e; - let c = parseInt(o, 10), l = parseInt(s, 10), u = N_(r, { - line: c, - column: l - }); - if (u.source && u.line !== null) { - let e = i || u.name || `anonymous`, t = u.column === null ? l : u.column; - return ` at ${e} (${u.source}:${u.line}:${t})`; - } - return e; - }).join(` -`); - } catch { - return e; - } -} -const V_ = 4096; -function H_(e) { - if (e === null) return !0; - let t = typeof e; - return t === `object` || t === `function` ? !1 : t === `string` ? e.length <= V_ : t === `bigint` ? e.toString().length <= V_ : !0; -} -function U_() { - return /* @__PURE__ */ new Map(); -} -async function W_(e, t, n) { - if (!e || t === void 0) return n(); - if (e.has(t)) return e.get(t); - let r = await n(); - return H_(r) && e.set(t, r), r; -} -function G_(e, t, n) { - let r = (2 << 31 - Math.clz32(e.length - 1 | 1)) - 1, i = Math.ceil(1.6 * r * t / e.length); - return (a = t) => { - if (!a) return ``; - let o = ``; - for (;;) { - let t = n(i), s = i; - for (; s--;) if (o += e[t[s] & r] || ``, o.length >= a) return o; - } - }; -} -function K_(e) { - let t = e.startsWith(`wrun_`) ? e.slice(5) : e; - try { - return Ah$1(t); - } catch { - return; - } -} -function q_(e) { - return function(t, n) { - let i = function(...i) { - let { promise: a, resolve: o, reject: s } = f$9(), c = `step_${e.generateUlid()}`, l = { - type: `step`, - correlationId: c, - stepName: t, - args: i - }; - this !== void 0 && this !== null && this !== globalThis && (l.thisVal = this); - let u = n?.(); - return u && (l.closureVars = u), e.invocationsQueue.set(c, l), kb.debug(`Step consumer setup`, { - correlationId: c, - stepName: t, - args: i - }), e.eventsConsumer.subscribe((n) => { - if (!n) return d$9(e, () => { - e.onWorkflowError(new Wv(e.invocationsQueue, e.globalThis)); - }), Kb.NotConsumed; - if (kb.debug(`Step consumer event processing`, { - correlationId: c, - stepName: t, - args: i.join(`, `), - incomingCorrelationId: n.correlationId, - isMatch: c === n.correlationId, - eventType: n.eventType - }), n.correlationId !== c) return Kb.NotConsumed; - let r = `eventData` in n && n.eventData && `stepName` in n.eventData ? n.eventData.stepName : void 0; - if (typeof r == `string` && r !== t) return e.promiseQueue = e.promiseQueue.then(() => { - e.onWorkflowError(new f$8(`Replay divergence: step event ${n.eventType} for ${c} belongs to "${r}", but the current step consumer is "${t}"`, { eventId: n.eventId })); - }), Kb.Finished; - if (n.eventType === `step_created`) { - let r = e.invocationsQueue.get(c); - return !r || r.type !== `step` ? (e.promiseQueue = e.promiseQueue.then(() => { - s(new f$8(`Replay divergence: step ${c} (${t}) created but not found in invocation queue`, { eventId: n.eventId })); - }), Kb.Finished) : (r.hasCreatedEvent = !0, Kb.Consumed); - } - if (n.eventType === `step_started` || n.eventType === `step_retrying`) return Kb.Consumed; - if (n.eventType === `step_failed`) return e.invocationsQueue.delete(n.correlationId), e.promiseQueue = e.promiseQueue.then(async () => { - try { - s(await Ix(n.eventData.error, e.runId, e.encryptionKey, e.globalThis)); - } catch (e) { - kb.error(`Failed to hydrate step_failed error`, { - correlationId: n.correlationId, - error: e instanceof Error ? e.message : String(e) - }), s(new D$10(`Failed to hydrate step error: ${e instanceof Error ? e.message : String(e)}`)); - } - }), Kb.Finished; - if (n.eventType === `step_completed`) { - e.invocationsQueue.delete(n.correlationId); - let t = n.eventId, r = n.eventData.result; - return e.pendingDeliveries++, e.promiseQueue = e.promiseQueue.then(async () => { - try { - o(await W_(e.stepHydrationCache, t, () => zx(r, e.runId, e.encryptionKey, e.globalThis))); - } catch (e) { - s(e); - } finally { - e.pendingDeliveries--; - } - }), Kb.Finished; - } - return e.promiseQueue = e.promiseQueue.then(() => { - e.onWorkflowError(new f$8(`Replay divergence: Unexpected event type for step ${c} (name: ${t}) "${n.eventType}"`, { eventId: n.eventId })); - }), Kb.Finished; - }), a; - }, a = t.split(`//`).pop(); - return Object.defineProperty(i, "name", { value: a }), Object.defineProperty(i, "stepId", { - value: t, - writable: !1, - enumerable: !1, - configurable: !1 - }), n && Object.defineProperty(i, "__closureVarsFn", { - value: n, - writable: !1, - enumerable: !1, - configurable: !1 - }), Object.defineProperty(i, "bind", { - value: function(e, ...r) { - let i = Function.prototype.bind.call(this, e, ...r); - return Object.defineProperty(i, "stepId", { - value: t, - writable: !1, - enumerable: !1, - configurable: !1 - }), n && Object.defineProperty(i, "__closureVarsFn", { - value: n, - writable: !1, - enumerable: !1, - configurable: !1 - }), Object.defineProperty(i, "__boundThis", { - value: e, - writable: !1, - enumerable: !1, - configurable: !1 - }), r.length > 0 && Object.defineProperty(i, "__boundArgs", { - value: r, - writable: !1, - enumerable: !1, - configurable: !1 - }), i; - }, - writable: !1, - enumerable: !1, - configurable: !1 - }), i; - }; -} -var J_ = c$12(((e, t) => { - (function(e, t, n) { - function r(e) { - var t = this, n = o(); - t.next = function() { - var e = 2091639 * t.s0 + t.c * 23283064365386963e-26; - return t.s0 = t.s1, t.s1 = t.s2, t.s2 = e - (t.c = e | 0); - }, t.c = 1, t.s0 = n(` `), t.s1 = n(` `), t.s2 = n(` `), t.s0 -= n(e), t.s0 < 0 && (t.s0 += 1), t.s1 -= n(e), t.s1 < 0 && (t.s1 += 1), t.s2 -= n(e), t.s2 < 0 && (t.s2 += 1), n = null; - } - function i(e, t) { - return t.c = e.c, t.s0 = e.s0, t.s1 = e.s1, t.s2 = e.s2, t; - } - function a(e, t) { - var n = new r(e), a = t && t.state, o = n.next; - return o.int32 = function() { - return n.next() * 4294967296 | 0; - }, o.double = function() { - return o() + (o() * 2097152 | 0) * 11102230246251565e-32; - }, o.quick = o, a && (typeof a == `object` && i(a, n), o.state = function() { - return i(n, {}); - }), o; - } - function o() { - var e = 4022871197; - return function(t) { - t = String(t); - for (var n = 0; n < t.length; n++) { - e += t.charCodeAt(n); - var r = .02519603282416938 * e; - e = r >>> 0, r -= e, r *= e, e = r >>> 0, r -= e, e += r * 4294967296; - } - return (e >>> 0) * 23283064365386963e-26; - }; - } - t && t.exports ? t.exports = a : n && n.amd ? n(function() { - return a; - }) : this.alea = a; - })(e, typeof t == `object` && t, typeof define == `function` && define); -})); -var Y_ = c$12(((e, t) => { - (function(e, t, n) { - function r(e) { - var t = this, n = ``; - t.x = 0, t.y = 0, t.z = 0, t.w = 0, t.next = function() { - var e = t.x ^ t.x << 11; - return t.x = t.y, t.y = t.z, t.z = t.w, t.w ^= t.w >>> 19 ^ e ^ e >>> 8; - }, e === (e | 0) ? t.x = e : n += e; - for (var r = 0; r < n.length + 64; r++) t.x ^= n.charCodeAt(r) | 0, t.next(); - } - function i(e, t) { - return t.x = e.x, t.y = e.y, t.z = e.z, t.w = e.w, t; - } - function a(e, t) { - var n = new r(e), a = t && t.state, o = function() { - return (n.next() >>> 0) / 4294967296; - }; - return o.double = function() { - do - var e = ((n.next() >>> 11) + (n.next() >>> 0) / 4294967296) / (1 << 21); - while (e === 0); - return e; - }, o.int32 = n.next, o.quick = o, a && (typeof a == `object` && i(a, n), o.state = function() { - return i(n, {}); - }), o; - } - t && t.exports ? t.exports = a : n && n.amd ? n(function() { - return a; - }) : this.xor128 = a; - })(e, typeof t == `object` && t, typeof define == `function` && define); -})); -var X_ = c$12(((e, t) => { - (function(e, t, n) { - function r(e) { - var t = this, n = ``; - t.next = function() { - var e = t.x ^ t.x >>> 2; - return t.x = t.y, t.y = t.z, t.z = t.w, t.w = t.v, (t.d = t.d + 362437 | 0) + (t.v = t.v ^ t.v << 4 ^ (e ^ e << 1)) | 0; - }, t.x = 0, t.y = 0, t.z = 0, t.w = 0, t.v = 0, e === (e | 0) ? t.x = e : n += e; - for (var r = 0; r < n.length + 64; r++) t.x ^= n.charCodeAt(r) | 0, r == n.length && (t.d = t.x << 10 ^ t.x >>> 4), t.next(); - } - function i(e, t) { - return t.x = e.x, t.y = e.y, t.z = e.z, t.w = e.w, t.v = e.v, t.d = e.d, t; - } - function a(e, t) { - var n = new r(e), a = t && t.state, o = function() { - return (n.next() >>> 0) / 4294967296; - }; - return o.double = function() { - do - var e = ((n.next() >>> 11) + (n.next() >>> 0) / 4294967296) / (1 << 21); - while (e === 0); - return e; - }, o.int32 = n.next, o.quick = o, a && (typeof a == `object` && i(a, n), o.state = function() { - return i(n, {}); - }), o; - } - t && t.exports ? t.exports = a : n && n.amd ? n(function() { - return a; - }) : this.xorwow = a; - })(e, typeof t == `object` && t, typeof define == `function` && define); -})); -var Z_ = c$12(((e, t) => { - (function(e, t, n) { - function r(e) { - var t = this; - t.next = function() { - var e = t.x, n = t.i, r = e[n], i; - return r ^= r >>> 7, i = r ^ r << 24, r = e[n + 1 & 7], i ^= r ^ r >>> 10, r = e[n + 3 & 7], i ^= r ^ r >>> 3, r = e[n + 4 & 7], i ^= r ^ r << 7, r = e[n + 7 & 7], r ^= r << 13, i ^= r ^ r << 9, e[n] = i, t.i = n + 1 & 7, i; - }; - function n(e, t) { - var n, r = []; - if (t === (t | 0)) r[0] = t; - else for (t = `` + t, n = 0; n < t.length; ++n) r[n & 7] = r[n & 7] << 15 ^ t.charCodeAt(n) + r[n + 1 & 7] << 13; - for (; r.length < 8;) r.push(0); - for (n = 0; n < 8 && r[n] === 0; ++n); - for (n == 8 ? r[7] = -1 : r[n], e.x = r, e.i = 0, n = 256; n > 0; --n) e.next(); - } - n(t, e); - } - function i(e, t) { - return t.x = e.x.slice(), t.i = e.i, t; - } - function a(e, t) { - e ??= +/* @__PURE__ */ new Date(); - var n = new r(e), a = t && t.state, o = function() { - return (n.next() >>> 0) / 4294967296; - }; - return o.double = function() { - do - var e = ((n.next() >>> 11) + (n.next() >>> 0) / 4294967296) / (1 << 21); - while (e === 0); - return e; - }, o.int32 = n.next, o.quick = o, a && (a.x && i(a, n), o.state = function() { - return i(n, {}); - }), o; - } - t && t.exports ? t.exports = a : n && n.amd ? n(function() { - return a; - }) : this.xorshift7 = a; - })(e, typeof t == `object` && t, typeof define == `function` && define); -})); -var Q_ = c$12(((e, t) => { - (function(e, t, n) { - function r(e) { - var t = this; - t.next = function() { - var e = t.w, n = t.X, r = t.i, i, a; - return t.w = e = e + 1640531527 | 0, a = n[r + 34 & 127], i = n[r = r + 1 & 127], a ^= a << 13, i ^= i << 17, a ^= a >>> 15, i ^= i >>> 12, a = n[r] = a ^ i, t.i = r, a + (e ^ e >>> 16) | 0; - }; - function n(e, t) { - var n, r, i, a, o, s = [], c = 128; - for (t === (t | 0) ? (r = t, t = null) : (t += `\0`, r = 0, c = Math.max(c, t.length)), i = 0, a = -32; a < c; ++a) t && (r ^= t.charCodeAt((a + 32) % t.length)), a === 0 && (o = r), r ^= r << 10, r ^= r >>> 15, r ^= r << 4, r ^= r >>> 13, a >= 0 && (o = o + 1640531527 | 0, n = s[a & 127] ^= r + o, i = n == 0 ? i + 1 : 0); - for (i >= 128 && (s[(t && t.length || 0) & 127] = -1), i = 127, a = 512; a > 0; --a) r = s[i + 34 & 127], n = s[i = i + 1 & 127], r ^= r << 13, n ^= n << 17, r ^= r >>> 15, n ^= n >>> 12, s[i] = r ^ n; - e.w = o, e.X = s, e.i = i; - } - n(t, e); - } - function i(e, t) { - return t.i = e.i, t.w = e.w, t.X = e.X.slice(), t; - } - function a(e, t) { - e ??= +/* @__PURE__ */ new Date(); - var n = new r(e), a = t && t.state, o = function() { - return (n.next() >>> 0) / 4294967296; - }; - return o.double = function() { - do - var e = ((n.next() >>> 11) + (n.next() >>> 0) / 4294967296) / (1 << 21); - while (e === 0); - return e; - }, o.int32 = n.next, o.quick = o, a && (a.X && i(a, n), o.state = function() { - return i(n, {}); - }), o; - } - t && t.exports ? t.exports = a : n && n.amd ? n(function() { - return a; - }) : this.xor4096 = a; - })(e, typeof t == `object` && t, typeof define == `function` && define); -})); -var $_ = c$12(((e, t) => { - (function(e, t, n) { - function r(e) { - var t = this, n = ``; - t.next = function() { - var e = t.b, n = t.c, r = t.d, i = t.a; - return e = e << 25 ^ e >>> 7 ^ n, n = n - r | 0, r = r << 24 ^ r >>> 8 ^ i, i = i - e | 0, t.b = e = e << 20 ^ e >>> 12 ^ n, t.c = n = n - r | 0, t.d = r << 16 ^ n >>> 16 ^ i, t.a = i - e | 0; - }, t.a = 0, t.b = 0, t.c = -1640531527, t.d = 1367130551, e === Math.floor(e) ? (t.a = e / 4294967296 | 0, t.b = e | 0) : n += e; - for (var r = 0; r < n.length + 20; r++) t.b ^= n.charCodeAt(r) | 0, t.next(); - } - function i(e, t) { - return t.a = e.a, t.b = e.b, t.c = e.c, t.d = e.d, t; - } - function a(e, t) { - var n = new r(e), a = t && t.state, o = function() { - return (n.next() >>> 0) / 4294967296; - }; - return o.double = function() { - do - var e = ((n.next() >>> 11) + (n.next() >>> 0) / 4294967296) / (1 << 21); - while (e === 0); - return e; - }, o.int32 = n.next, o.quick = o, a && (typeof a == `object` && i(a, n), o.state = function() { - return i(n, {}); - }), o; - } - t && t.exports ? t.exports = a : n && n.amd ? n(function() { - return a; - }) : this.tychei = a; - })(e, typeof t == `object` && t, typeof define == `function` && define); -})); -var ev = c$12(((e, n) => { - (function(e, r, i) { - var a = 256, o = 6, s = 52, c = `random`, l = i.pow(a, o), u = i.pow(2, s), d = u * 2, f = a - 1, p; - function m(e, t, n) { - var s = []; - t = t == 1 ? { entropy: !0 } : t || {}; - var f = v(_(t.entropy ? [e, b(r)] : e ?? y(), 3), s), p = new h(s), m = function() { - for (var e = p.g(o), t = l, n = 0; e < u;) e = (e + n) * a, t *= a, n = p.g(1); - for (; e >= d;) e /= 2, t /= 2, n >>>= 1; - return (e + n) / t; - }; - return m.int32 = function() { - return p.g(4) | 0; - }, m.quick = function() { - return p.g(4) / 4294967296; - }, m.double = m, v(b(p.S), r), (t.pass || n || function(e, t, n, r) { - return r && (r.S && g(r, p), e.state = function() { - return g(p, {}); - }), n ? (i[c] = e, t) : e; - })(m, f, `global` in t ? t.global : this == i, t.state); - } - function h(e) { - var t, n = e.length, r = this, i = 0, o = r.i = r.j = 0, s = r.S = []; - for (n || (e = [n++]); i < a;) s[i] = i++; - for (i = 0; i < a; i++) s[i] = s[o = f & o + e[i % n] + (t = s[i])], s[o] = t; - (r.g = function(e) { - for (var t, n = 0, i = r.i, o = r.j, s = r.S; e--;) t = s[i = f & i + 1], n = n * a + s[f & (s[i] = s[o = f & o + t]) + (s[o] = t)]; - return r.i = i, r.j = o, n; - })(a); - } - function g(e, t) { - return t.i = e.i, t.j = e.j, t.S = e.S.slice(), t; - } - function _(e, t) { - var n = [], r = typeof e, i; - if (t && r == `object`) for (i in e) try { - n.push(_(e[i], t - 1)); - } catch {} - return n.length ? n : r == `string` ? e : e + `\0`; - } - function v(e, t) { - for (var n = e + ``, r, i = 0; i < n.length;) t[f & i] = f & (r ^= t[f & i] * 19) + n.charCodeAt(i++); - return b(t); - } - function y() { - try { - var t; - return p && (t = p.randomBytes) ? t = t(a) : (t = new Uint8Array(a), (e.crypto || e.msCrypto).getRandomValues(t)), b(t); - } catch { - var n = e.navigator, i = n && n.plugins; - return [ - +/* @__PURE__ */ new Date(), - e, - i, - e.screen, - b(r) - ]; - } - } - function b(e) { - return String.fromCharCode.apply(0, e); - } - if (v(i.random(), r), typeof n == `object` && n.exports) { - n.exports = m; - try { - p = f$11(`crypto`); - } catch {} - } else typeof define == `function` && define.amd ? define(function() { - return m; - }) : i[`seed` + c] = m; - })(typeof self < `u` ? self : e, [], Math); -})); -var tv = d$13(c$12(((e, t) => { - var n = J_(), r = Y_(), i = X_(), a = Z_(), o = Q_(), s = $_(), c = ev(); - c.alea = n, c.xor128 = r, c.xorwow = i, c.xorshift7 = a, c.xor4096 = o, c.tychei = s, t.exports = c; -}))(), 1); -const nv = `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`; -const rv = (/* @__PURE__ */ new Uint8Array(128)).fill(255); -for (let e = 0; e < 64; e++) rv[nv.charCodeAt(e)] = e; -function iv(e) { - return e === 9 || e === 10 || e === 12 || e === 13 || e === 32; -} -function av(e, t) { - for (; t < e.length && iv(e.charCodeAt(t));) t++; - return t; -} -function ov(e, t) { - let n = e.length, r = e; - n === 2 ? r = e + `AA` : n === 3 && (r = e + `A`); - let i = rv[r.charCodeAt(0)], a = rv[r.charCodeAt(1)], o = rv[r.charCodeAt(2)], s = rv[r.charCodeAt(3)], c = i << 2 | a >> 4, l = (a & 15) << 4 | o >> 2, u = (o & 3) << 6 | s; - if (n === 2) { - if (t && l !== 0) throw SyntaxError(`Extra bits in base64 chunk`); - return [c]; - } - if (n === 3) { - if (t && u !== 0) throw SyntaxError(`Extra bits in base64 chunk`); - return [c, l]; - } - return [ - c, - l, - u - ]; -} -function sv(e, t, n, r) { - if (r === void 0 && (r = 2 ** 53 - 1), r === 0) return { - read: 0, - bytes: [], - error: null - }; - let i = 0, a = [], o = ``, s = 0, c = 0, l = e.length; - for (;;) { - if (c = av(e, c), c === l) { - if (s > 0) { - if (n === `stop-before-partial`) return { - read: i, - bytes: a, - error: null - }; - if (n === `loose`) { - if (s === 1) return { - read: i, - bytes: a, - error: SyntaxError(`Invalid base64: lone character in final chunk`) - }; - a.push(...ov(o, !1)); - } else return { - read: i, - bytes: a, - error: SyntaxError(`Invalid base64: incomplete chunk in strict mode`) - }; - } - return { - read: l, - bytes: a, - error: null - }; - } - let u = e[c]; - if (c++, u === `=`) { - if (s < 2) return { - read: i, - bytes: a, - error: SyntaxError(`Invalid base64: padding in unexpected place`) - }; - if (c = av(e, c), s === 2) { - if (c === l) return n === `stop-before-partial` ? { - read: i, - bytes: a, - error: null - } : { - read: i, - bytes: a, - error: SyntaxError(`Invalid base64: missing second padding character`) - }; - u = e[c], u === `=` && (c = av(e, c + 1)); - } - if (c < l) return { - read: i, - bytes: a, - error: SyntaxError(`Invalid base64: unexpected characters after padding`) - }; - let t = n === `strict`; - try { - a.push(...ov(o, t)); - } catch (e) { - return { - read: i, - bytes: a, - error: e - }; - } - return { - read: l, - bytes: a, - error: null - }; - } - if (t === `base64url`) { - if (u === `+` || u === `/`) return { - read: i, - bytes: a, - error: SyntaxError(`Invalid base64url: unexpected character '${u}'`) - }; - u === `-` ? u = `+` : u === `_` && (u = `/`); - } - let d = u.charCodeAt(0); - if (d >= 128 || rv[d] === 255) return { - read: i, - bytes: a, - error: SyntaxError(`Invalid base64: unexpected character '${e[c - 1]}'`) - }; - let f = r - a.length; - if (f === 1 && s === 2 || f === 2 && s === 3 || (o += u, s = o.length, s === 4 && (a.push(...ov(o)), o = ``, s = 0, i = c, a.length === r))) return { - read: i, - bytes: a, - error: null - }; - } -} -function cv(e, t) { - t === void 0 && (t = 2 ** 53 - 1); - let n = e.length, r = [], i = 0; - if (n % 2 != 0) return { - read: 0, - bytes: [], - error: SyntaxError(`Invalid hex: string length must be even`) - }; - for (; i < n && r.length < t;) { - let t = e.substring(i, i + 2); - if (!/^[0-9a-fA-F]{2}$/.test(t)) return { - read: i, - bytes: r, - error: SyntaxError(`Invalid hex: unexpected character at position ${i}`) - }; - i += 2, r.push(Number.parseInt(t, 16)); - } - return { - read: i, - bytes: r, - error: null - }; -} -function lv(e, t) { - let n = t?.alphabet ?? `base64`; - if (n !== `base64` && n !== `base64url`) throw TypeError(`Invalid alphabet: expected "base64" or "base64url", got "${n}"`); - let r = !!t?.omitPadding, i = ``, a = e.length; - for (let t = 0; t < a; t += 3) { - let n = e[t], o = t + 1 < a ? e[t + 1] : 0, s = t + 2 < a ? e[t + 2] : 0; - i += nv[n >> 2 & 63], i += nv[(n & 3) << 4 | o >> 4 & 15], t + 1 < a ? i += nv[(o & 15) << 2 | s >> 6 & 3] : r || (i += `=`), t + 2 < a ? i += nv[s & 63] : r || (i += `=`); - } - return n === `base64url` && (i = i.replace(/\+/g, `-`).replace(/\//g, `_`)), i; -} -function uv(e) { - let t = ``; - for (let n = 0; n < e.length; n++) t += e[n].toString(16).padStart(2, `0`); - return t; -} -function dv(e) { - let t = e.prototype, n = e; - t.toBase64 || Object.defineProperty(t, "toBase64", { - value: function(t) { - if (!(this instanceof e)) throw TypeError(`this is not a Uint8Array`); - return lv(this, t); - }, - writable: !0, - enumerable: !1, - configurable: !0 - }), t.toHex || Object.defineProperty(t, "toHex", { - value: function() { - if (!(this instanceof e)) throw TypeError(`this is not a Uint8Array`); - return uv(this); - }, - writable: !0, - enumerable: !1, - configurable: !0 - }), t.setFromBase64 || Object.defineProperty(t, "setFromBase64", { - value: function(t, n) { - if (!(this instanceof e)) throw TypeError(`this is not a Uint8Array`); - if (typeof t != `string`) throw TypeError(`expected a string`); - let r = n?.alphabet ?? `base64`; - if (r !== `base64` && r !== `base64url`) throw TypeError(`Invalid alphabet: expected "base64" or "base64url", got "${r}"`); - let i = n?.lastChunkHandling ?? `loose`; - if (i !== `loose` && i !== `strict` && i !== `stop-before-partial`) throw TypeError(`Invalid lastChunkHandling: expected "loose", "strict", or "stop-before-partial", got "${i}"`); - let a = sv(t, r, i, this.length), o = a.bytes, s = o.length; - for (let e = 0; e < s; e++) this[e] = o[e]; - if (a.error) throw a.error; - return { - read: a.read, - written: s - }; - }, - writable: !0, - enumerable: !1, - configurable: !0 - }), t.setFromHex || Object.defineProperty(t, "setFromHex", { - value: function(t) { - if (!(this instanceof e)) throw TypeError(`this is not a Uint8Array`); - if (typeof t != `string`) throw TypeError(`expected a string`); - let n = cv(t, this.length), r = n.bytes, i = r.length; - for (let e = 0; e < i; e++) this[e] = r[e]; - if (n.error) throw n.error; - return { - read: n.read, - written: i - }; - }, - writable: !0, - enumerable: !1, - configurable: !0 - }), n.fromBase64 || Object.defineProperty(e, "fromBase64", { - value: function(t, n) { - if (typeof t != `string`) throw TypeError(`expected a string`); - let r = n?.alphabet ?? `base64`; - if (r !== `base64` && r !== `base64url`) throw TypeError(`Invalid alphabet: expected "base64" or "base64url", got "${r}"`); - let i = n?.lastChunkHandling ?? `loose`; - if (i !== `loose` && i !== `strict` && i !== `stop-before-partial`) throw TypeError(`Invalid lastChunkHandling: expected "loose", "strict", or "stop-before-partial", got "${i}"`); - let a = sv(t, r, i); - if (a.error) throw a.error; - return new e(a.bytes); - }, - writable: !0, - enumerable: !1, - configurable: !0 - }), n.fromHex || Object.defineProperty(e, "fromHex", { - value: function(t) { - if (typeof t != `string`) throw TypeError(`expected a string`); - let n = cv(t); - if (n.error) throw n.error; - return new e(n.bytes); - }, - writable: !0, - enumerable: !1, - configurable: !0 - }); -} -function fv(e) { - return function() { - let t = `0123456789abcdef`, n = ``; - for (let r = 0; r < 36; r++) r === 8 || r === 13 || r === 18 || r === 23 ? n += `-` : r === 14 ? n += `4` : r === 19 ? n += t[Math.floor(e() * 4) + 8] : n += t[Math.floor(e() * 16)]; - return n; - }; -} -function pv(e) { - let { fixedTimestamp: t } = e, { seed: n } = e, r = (0, tv.default)(n), i = createContext(), a = runInContext(`globalThis`, i); - a.Math.random = r; - let o = a.Date; - a.Date = function(...e) { - return e.length === 0 ? new o(t) : new o(...e); - }, a.Date.prototype = o.prototype, Object.setPrototypeOf(a.Date, o), a.Date.now = () => t; - let s = globalThis.crypto, c = s.subtle; - function l(e) { - for (let t = 0; t < e.length; t++) e[t] = Math.floor(r() * 256); - return e; - } - let u = fv(r), d = c.digest.bind(c); - return a.crypto = new Proxy(s, { get(e, t) { - return t === `getRandomValues` ? l : t === `randomUUID` ? u : t === `subtle` ? new Proxy(c, { get(e, t) { - return t === `generateKey` ? () => { - throw new u$10("`crypto.subtle.generateKey()` is not available inside a workflow function. Move key generation to a step function where full Node.js crypto is available."); - } : t === `digest` ? d : e[t]; - } }) : e[t]; - } }), a.process = { env: Object.freeze({ ...process.env }) }, a.DOMException = globalThis.DOMException, a.Headers = globalThis.Headers, a.TextEncoder = globalThis.TextEncoder, a.TextDecoder = globalThis.TextDecoder, a.console = globalThis.console, a.URL = globalThis.URL, a.URLSearchParams = globalThis.URLSearchParams, a.structuredClone = globalThis.structuredClone, a.atob = globalThis.atob, a.btoa = globalThis.btoa, dv(a.Uint8Array), a.Symbol.dispose ??= Symbol.for(`Symbol.dispose`), a.Symbol.asyncDispose ??= Symbol.for(`Symbol.asyncDispose`), a.exports = {}, a.module = { exports: a.exports }, { - context: i, - globalThis: a, - updateTimestamp: (e) => { - t = e; - } - }; -} -const mv = /* @__PURE__ */ new Map(); -function hv(e) { - let t = mv.get(e); - if (t !== void 0) return mv.delete(e), mv.set(e, t), t; -} -function gv(e, t) { - let n = hv(e); - if (n === void 0) for (n = /* @__PURE__ */ new Map(), mv.set(e, n); mv.size > 8;) { - let e = mv.keys().next().value; - if (e === void 0) break; - mv.delete(e); - } - let r = n.get(t); - return r === void 0 && (r = new Script(e, { filename: t }), n.set(t, r)), r; -} -function _v(e, t, n) { - return gv(e, t).runInContext(n); -} -function vv(e) { - return async function(t, n = {}) { - let { promise: i, resolve: a } = f$9(), o = `attr_${e.generateUlid()}`, s = { - type: `attribute`, - correlationId: o, - changes: t, - ...n.allowReservedAttributes === !0 ? { allowReservedAttributes: !0 } : {} - }; - return e.invocationsQueue.set(o, s), e.eventsConsumer.subscribe((r) => r ? r.correlationId === o ? r.eventType !== `attr_set` || r.eventData.writer.type !== `workflow` || JSON.stringify(r.eventData.changes) !== JSON.stringify(t) || r.eventData.allowReservedAttributes === !0 != (n.allowReservedAttributes === !0) ? (e.promiseQueue = e.promiseQueue.then(() => { - e.onWorkflowError(new f$8(`Replay divergence: Unexpected attribute event for ${o}`, { eventId: r.eventId })); - }), Kb.Finished) : (e.invocationsQueue.delete(o), e.promiseQueue = e.promiseQueue.then(() => { - a(); - }), Kb.Finished) : Kb.NotConsumed : (d$9(e, () => { - e.onWorkflowError(new Wv(e.invocationsQueue, e.globalThis)); - }), Kb.NotConsumed)), i; - }; -} -function yv(e, t) { - if (typeof t != `string`) return null; - let n = q_$1(G_$1, e.globalThis), r = n?.[D_$1]; - return typeof r == `function` ? r.call(n, { runId: t }) : null; -} -function bv(e) { - return function(t = {}) { - if (t.token === ``) throw Error("`createHook()` was called with an empty string token. Pass a non-empty token, or omit the `token` option to use a randomly generated one."); - let n = `hook_${e.generateUlid()}`, i = t.token ?? e.generateNanoid(), a = t.isWebhook ?? !1; - e.invocationsQueue.set(n, { - type: `hook`, - correlationId: n, - token: i, - metadata: t.metadata, - isWebhook: a - }); - let o = [], s = [], c = [], l = !1, u = !1, d = !1, f = !1, p = null, h = null; - jb.debug(`Hook consumer setup`, { - correlationId: n, - token: i - }), e.eventsConsumer.subscribe((t) => { - if (!t) return l = !0, (s.length > 0 && o.length === 0 || c.length > 0 && !u && !f) && d$9(e, () => { - e.onWorkflowError(new Wv(e.invocationsQueue, e.globalThis)); - }), Kb.NotConsumed; - if (t.correlationId !== n) return Kb.NotConsumed; - let a = `eventData` in t && t.eventData && `token` in t.eventData ? t.eventData.token : void 0; - if (typeof a == `string` && a !== i) return e.promiseQueue = e.promiseQueue.then(() => { - e.onWorkflowError(new f$8(`Replay divergence: hook event ${t.eventType} for ${n} belongs to token "${a}", but the current hook consumer expects "${i}"`, { eventId: t.eventId })); - }), Kb.Finished; - if (t.eventType === `hook_created`) { - let t = e.invocationsQueue.get(n); - t && t.type === `hook` && (t.hasCreatedEvent = !0), u = !0; - let r = c.slice(); - return c.length = 0, e.promiseQueue = e.promiseQueue.then(() => { - for (let e of r) e.resolve(null); - }), Kb.Consumed; - } - if (t.eventType === `hook_conflict`) { - e.invocationsQueue.delete(n); - let r = t, i = new y$6(r.eventData.token, r.eventData.conflictingRunId); - f = !0, p = i, h = yv(e, r.eventData.conflictingRunId); - let a = s.slice(); - s.length = 0; - let o = c.slice(); - return c.length = 0, e.promiseQueue = e.promiseQueue.then(() => { - for (let e of a) e.reject(i); - for (let e of o) h ? e.resolve(h) : e.reject(i); - }), Kb.Consumed; - } - if (t.eventType === `hook_received`) { - let n = e.eventsConsumer.eventIndex, i = u$9(e, n, `hook`); - if (s.length > 0) { - let r = s.shift(); - if (r) { - e.pendingDeliveries++; - let a; - e.promiseQueue = e.promiseQueue.then(async () => { - try { - a = { - ok: !0, - value: await zx(t.eventData.payload, e.runId, e.encryptionKey, e.globalThis) - }; - } catch (e) { - a = { - ok: !1, - error: e - }; - } finally { - e.pendingDeliveries--; - } - l$7(e, n, [`wait`]).then(() => { - i.markDelivered(), a.ok ? r.resolve(a.value) : r.reject(a.error); - }); - }); - } - } else { - let a, s = f$9(); - e.pendingDeliveries++, e.promiseQueue = e.promiseQueue.then(async () => { - try { - a = { - ok: !0, - value: await zx(t.eventData.payload, e.runId, e.encryptionKey, e.globalThis) - }; - } catch (e) { - a = { - ok: !1, - error: e - }; - } finally { - e.pendingDeliveries--, s.resolve(); - } - }), o.push({ claim: () => s.promise.then(() => l$7(e, n, [`wait`])).then(() => { - if (i.markDelivered(), a && !a.ok) throw a.error; - return a.value; - }) }); - } - return Kb.Consumed; - } - return t.eventType === `hook_disposed` ? (e.invocationsQueue.delete(n), d = !0, Kb.Finished) : (e.promiseQueue = e.promiseQueue.then(() => { - e.onWorkflowError(new f$8(`Replay divergence: Unexpected event type for hook ${n} (token: ${i}) "${t.eventType}"`, { eventId: t.eventId })); - }), Kb.Finished); - }); - let g = !1; - function _() { - let t = f$9(); - if (f && p) return e.promiseQueue = e.promiseQueue.then(() => { - t.reject(p); - }), t.promise; - if (o.length > 0) { - let e = o.shift(); - if (e) return e.claim(); - } - return l && d$9(e, () => { - e.onWorkflowError(new Wv(e.invocationsQueue, e.globalThis)); - }), s.push(t), t.promise; - } - function v() { - let t = f$9(); - if (u) return e.promiseQueue = e.promiseQueue.then(() => { - t.resolve(null); - }), t.promise; - if (f) return e.promiseQueue = e.promiseQueue.then(() => { - h ? t.resolve(h) : t.reject(p); - }), t.promise; - let i = e.invocationsQueue.get(n); - return i && i.type === `hook` && (i.hasConflictAwaiter = !0), l && d$9(e, () => { - e.onWorkflowError(new Wv(e.invocationsQueue, e.globalThis)); - }), c.push(t), t.promise; - } - function y() { - if (g || (g = !0, d)) return; - let t = e.invocationsQueue.get(n); - t && t.type === `hook` && (t.disposed = !0), s.length > 0 && (s.length = 0, d$9(e, () => { - e.onWorkflowError(new Wv(e.invocationsQueue, e.globalThis)); - })), jb.debug(`Hook disposed`, { - correlationId: n, - token: i - }); - } - let b = { - token: i, - getConflict() { - return v(); - }, - then(e, t) { - return _().then(e, t); - }, - async *[Symbol.asyncIterator]() { - for (; !g;) yield await this; - }, - dispose: y, - [Symbol.dispose]: y - }, x = e.globalThis.Symbol.dispose; - return x && x !== Symbol.dispose && (b[x] = y), b; - }; -} -function xv(e) { - return async function(t) { - let { promise: n, resolve: i } = f$9(), a = `wait_${e.generateUlid()}`, o = h$10(t), s = { - type: `wait`, - correlationId: a, - resumeAt: o - }; - return e.invocationsQueue.set(a, s), e.eventsConsumer.subscribe((t) => { - if (!t) return d$9(e, () => { - e.onWorkflowError(new Wv(e.invocationsQueue, e.globalThis)); - }), Kb.NotConsumed; - if (t.correlationId !== a) return Kb.NotConsumed; - if (t.eventType === `wait_created`) { - let n = e.invocationsQueue.get(a); - return n && n.type === `wait` && (n.hasCreatedEvent = !0, n.resumeAt = t.eventData.resumeAt), Kb.Consumed; - } - if (t.eventType === `wait_completed`) { - let n = t.eventData?.resumeAt; - if (n !== void 0) { - let r = e.invocationsQueue.get(a), i = r && r.type === `wait` ? r.resumeAt : o, s = new Date(n), c = s.getTime(), l = i.getTime(), u = Number.isFinite(c) ? s.toISOString() : String(n); - if (c !== l) return e.promiseQueue = e.promiseQueue.then(() => { - e.onWorkflowError(new f$8(`Replay divergence: wait_completed event for ${a} has resumeAt "${u}", but the current wait consumer expects "${i.toISOString()}"`, { eventId: t.eventId })); - }), Kb.Finished; - } - e.invocationsQueue.delete(a); - let r = e.eventsConsumer.eventIndex, s = u$9(e, r, `wait`); - return e.promiseQueue.then(() => l$7(e, r, [`hook`])).then(() => { - s.markDelivered(), i(); - }), Kb.Finished; - } - return e.promiseQueue = e.promiseQueue.then(() => { - e.onWorkflowError(new f$8(`Replay divergence: Unexpected event type for wait ${a} "${t.eventType}"`, { eventId: t.eventId })); - }), Kb.Finished; - }), n; - }; -} -async function Sv(e, t, n, r, i) { - if (t.size !== 0) { - for (let e of t.values()) e.type === `hook` && e.isSystem && !e.disposed && !e.abortRequested && (e.disposed = !0); - try { - let e = await mg(); - await Ng({ - suspension: new Wv(t, n), - world: e, - run: r - }); - } catch (t) { - Ab.warn(`Failed to drain pending queue items for ${i} workflow run`, { - workflowRunId: e, - message: t instanceof Error ? t.message : String(t) - }); - } - } -} -async function Cv(e, t, n, i, a) { - return vb(`workflow.run ${t.workflowName}`, async (s) => { - s?.setAttributes({ - ...Kv(t.workflowName), - ...Jv(t.runId), - ...Yv(t.status), - ...Zv(n.length) - }); - let c = t.startedAt; - if (!c) throw new u$10(`Workflow run "${t.runId}" has no "startedAt" timestamp (should not happen)`); - let l = K_(t.runId) ?? +t.createdAt, u = process.env.VERCEL_URL !== void 0, d = u ? void 0 : await kg(), { context: f, globalThis: p, updateTimestamp: m } = pv({ - seed: `${t.runId}:${t.workflowName}:${t.deploymentId}`, - fixedTimestamp: l - }), h = f$9(), g = Ih$1(() => p.Math.random()), _ = G_(`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`, 21, (e) => new Uint8Array(e).map(() => 256 * p.Math.random())), v = { current: Promise.resolve() }, y = new qb(n, { - onConsumedEvent: (e) => { - m(+e.createdAt); - }, - onUnconsumedEvent: (e) => { - h.reject(new f$8(`Replay could not consume event: eventType=${e.eventType}, correlationId=${e.correlationId}, eventId=${e.eventId}.`, { eventId: e.eventId })); - }, - getPromiseQueue: () => v.current - }), b = { - runId: t.runId, - encryptionKey: i, - globalThis: p, - onWorkflowError: h.reject, - eventsConsumer: y, - generateUlid: () => g(l), - generateNanoid: _, - invocationsQueue: /* @__PURE__ */ new Map(), - get promiseQueue() { - return v.current; - }, - set promiseQueue(e) { - v.current = e; - }, - pendingDeliveries: 0, - pendingDeliveryBarriers: /* @__PURE__ */ new Map(), - stepHydrationCache: a - }; - b.eventsConsumer.subscribe((e) => e && (e.eventType === `run_created` || e.eventType === `run_started` || e.eventType === `attr_set` && e.eventData.writer.type === `step`) ? Kb.Consumed : Kb.NotConsumed); - let x = q_(b), C = bv(b), w = xv(b), T = vv(b); - p[O_$1] = x, p[k_$1] = T, p[A_$1] = C, p[j_$1] = w, p[M_$1] = (e) => Ub(t.runId, e); - let D = u ? `https://${process.env.VERCEL_URL}` : `http://localhost:${d ?? 3e3}`; - p[Ee$8] = { - workflowName: t.workflowName, - workflowRunId: t.runId, - workflowStartedAt: new p.Date(+c), - url: D, - features: { encryption: !!i } - }, p[N_$1] = g, p.fetch = () => { - throw new p.Error(`Global "fetch" is unavailable in workflow functions. Use the "fetch" step function from "workflow" to make HTTP requests.\n\nLearn more: https://workflow-sdk.dev/err/${a$10.FETCH_IN_WORKFLOW_FUNCTION}`); - }; - let O = `Timeout functions like "setTimeout" and "setInterval" are not supported in workflow functions. Use the "sleep" function from "workflow" for time-based delays.`; - p.setTimeout = () => { - throw new u$10(O, { slug: a$10.TIMEOUT_FUNCTIONS_IN_WORKFLOW }); - }, p.setInterval = () => { - throw new u$10(O, { slug: a$10.TIMEOUT_FUNCTIONS_IN_WORKFLOW }); - }, p.clearTimeout = () => { - throw new u$10(O, { slug: a$10.TIMEOUT_FUNCTIONS_IN_WORKFLOW }); - }, p.clearInterval = () => { - throw new u$10(O, { slug: a$10.TIMEOUT_FUNCTIONS_IN_WORKFLOW }); - }, p.setImmediate = () => { - throw new u$10(O, { slug: a$10.TIMEOUT_FUNCTIONS_IN_WORKFLOW }); - }, p.clearImmediate = () => { - throw new u$10(O, { slug: a$10.TIMEOUT_FUNCTIONS_IN_WORKFLOW }); - }, p.AbortController = Yb(b); - let j = Xb(); - p.AbortSignal = { - abort: j.abort, - any: j.any, - timeout: j.timeout - }; - class M { - cache; - credentials; - destination; - headers; - integrity; - method; - mode; - redirect; - referrer; - referrerPolicy; - url; - keepalive; - signal; - duplex; - body; - constructor(e, t) { - if (typeof e == `string` || e instanceof p.URL) { - let t = String(e); - try { - new p.URL(t), this.url = t; - } catch (e) { - throw TypeError(`Failed to parse URL from ${t}`, { cause: e }); - } - } else { - if (this.url = e.url, !t) { - this.method = e.method, this.headers = new p.Headers(e.headers), this.body = e.body, this.mode = e.mode, this.credentials = e.credentials, this.cache = e.cache, this.redirect = e.redirect, this.referrer = e.referrer, this.referrerPolicy = e.referrerPolicy, this.integrity = e.integrity, this.keepalive = e.keepalive, this.signal = e.signal, this.duplex = e.duplex, this.destination = e.destination; - return; - } - this.method = e.method, this.headers = new p.Headers(e.headers), this.body = e.body, this.mode = e.mode, this.credentials = e.credentials, this.cache = e.cache, this.redirect = e.redirect, this.referrer = e.referrer, this.referrerPolicy = e.referrerPolicy, this.integrity = e.integrity, this.keepalive = e.keepalive, this.signal = e.signal, this.duplex = e.duplex, this.destination = e.destination; - } - t?.method ? this.method = t.method.toUpperCase() : typeof this.method != `string` && (this.method = `GET`), t?.headers ? this.headers = new p.Headers(t.headers) : (typeof e == `string` || e instanceof p.URL) && (this.headers = new p.Headers()), t?.mode === void 0 ? typeof this.mode != `string` && (this.mode = `cors`) : this.mode = t.mode, t?.credentials === void 0 ? typeof this.credentials != `string` && (this.credentials = `same-origin`) : this.credentials = t.credentials, t?.cache === void 0 ? typeof this.cache != `string` && (this.cache = `default`) : this.cache = t.cache, t?.redirect === void 0 ? typeof this.redirect != `string` && (this.redirect = `follow`) : this.redirect = t.redirect, t?.referrer === void 0 ? typeof this.referrer != `string` && (this.referrer = `about:client`) : this.referrer = t.referrer, t?.referrerPolicy === void 0 ? typeof this.referrerPolicy != `string` && (this.referrerPolicy = ``) : this.referrerPolicy = t.referrerPolicy, t?.integrity === void 0 ? typeof this.integrity != `string` && (this.integrity = ``) : this.integrity = t.integrity, t?.keepalive === void 0 ? typeof this.keepalive != `boolean` && (this.keepalive = !1) : this.keepalive = t.keepalive, t?.signal === void 0 ? this.signal ||= { aborted: !1 } : this.signal = t.signal, this.duplex ||= `half`, this.destination ||= `document`; - let n = t?.body; - if (n != null && (this.method === `GET` || this.method === `HEAD`)) throw TypeError(`Request with GET/HEAD method cannot have body.`); - n == null ? this.body = null : this.body = Object.create(p.ReadableStream.prototype, { [z_$1]: { - value: n, - writable: !1 - } }); - } - clone() { - Gv(); - } - get bodyUsed() { - return !1; - } - blob; - formData; - arrayBuffer; - json; - text; - async bytes() { - return new Uint8Array(await this.arrayBuffer()); - } - } - p.Request = M, Object.defineProperties(M.prototype, { - arrayBuffer: { - value: x(`__builtin_response_array_buffer`), - writable: !0, - configurable: !0 - }, - json: { - value: x(`__builtin_response_json`), - writable: !0, - configurable: !0 - }, - text: { - value: x(`__builtin_response_text`), - writable: !0, - configurable: !0 - } - }); - class P { - type; - url; - status; - statusText; - body; - headers; - redirected; - constructor(e, t) { - if (this.status = t?.status ?? 200, this.statusText = t?.statusText ?? ``, this.headers = new p.Headers(t?.headers), this.type = `default`, this.url = ``, this.redirected = !1, e != null && (this.status === 204 || this.status === 205 || this.status === 304)) throw TypeError(`Response constructor: Invalid response status code ${this.status}`); - e == null ? this.body = null : this.body = Object.create(p.ReadableStream.prototype, { [z_$1]: { - value: e, - writable: !1 - } }); - } - clone; - blob; - formData; - get ok() { - return this.status >= 200 && this.status < 300; - } - get bodyUsed() { - return !1; - } - arrayBuffer; - json; - text; - async bytes() { - return new Uint8Array(await this.arrayBuffer()); - } - static json(e, t) { - let n = JSON.stringify(e), r = new p.Headers(t?.headers); - return r.has(`content-type`) || r.set(`content-type`, `application/json`), new P(n, { - ...t, - headers: r - }); - } - static error() { - Gv(); - } - static redirect(e, t = 302) { - if (![ - 301, - 302, - 303, - 307, - 308 - ].includes(t)) throw RangeError(`Invalid redirect status code: ${t}. Must be one of: 301, 302, 303, 307, 308`); - let n = new p.Headers(); - n.set(`Location`, String(e)); - let r = Object.create(P.prototype); - return r.status = t, r.statusText = ``, r.headers = n, r.body = null, r.type = `default`, r.url = ``, r.redirected = !1, r; - } - } - p.Response = P, Object.defineProperties(P.prototype, { - arrayBuffer: { - value: x(`__builtin_response_array_buffer`), - writable: !0, - configurable: !0 - }, - json: { - value: x(`__builtin_response_json`), - writable: !0, - configurable: !0 - }, - text: { - value: x(`__builtin_response_text`), - writable: !0, - configurable: !0 - } - }); - class I { - constructor() { - Gv(); - } - get locked() { - return !1; - } - cancel() { - Gv(); - } - getReader() { - Gv(); - } - pipeThrough() { - Gv(); - } - pipeTo() { - Gv(); - } - tee() { - Gv(); - } - values() { - Gv(); - } - static from() { - Gv(); - } - [Symbol.asyncIterator]() { - Gv(); - } - } - p.ReadableStream = I; - class ee { - constructor() { - Gv(); - } - get locked() { - return !1; - } - abort() { - Gv(); - } - close() { - Gv(); - } - getWriter() { - Gv(); - } - } - p.WritableStream = ee; - class L { - readable; - writable; - constructor() { - Gv(); - } - } - p.TransformStream = L, p.console = globalThis.console; - let te = Symbol.for(`@vercel/request-context`); - p[te] = globalThis[te]; - let R = i$12(t.workflowName)?.moduleSpecifier || t.workflowName; - _v(e, R, f); - let ne = _v(`globalThis.__private_workflows?.get(${JSON.stringify(t.workflowName)})`, R, f); - if (typeof ne != `function`) throw new _$7(t.workflowName); - let z = []; - b.promiseQueue = b.promiseQueue.then(async () => { - z = await kx(t.input, t.runId, i, p); - }), await b.promiseQueue, s?.setAttributes({ ...Qv(z.length) }); - try { - let e = await Promise.race([ne(...z), h.promise]), n = await Ax(e, t.runId, i, p, !1, (t.specVersion ?? 0) >= 5); - return s?.setAttributes({ ...$v(typeof e) }), await Sv(t.runId, b.invocationsQueue, p, t, `completed`), n; - } catch (e) { - throw Wv.is(e) || f$8.is(e) || await Sv(t.runId, b.invocationsQueue, p, t, `failed`), e; - } - }); -} -function wv(e) { - return u$10.is(e) ? t$9.RUNTIME_ERROR : yr$3(e) ? t$9.WORLD_CONTRACT_ERROR : null; -} -async function Tv({ world: e, workflowRun: t, runId: n, requestId: r, err: i, errorCode: a, logMessage: o }) { - Ab.error(o, { - workflowRunId: n, - errorCode: a, - error: i instanceof Error ? i.message : String(i) - }); - try { - let o = mS(e, t ?? n); - await e.events.create(n, { - eventType: `run_failed`, - specVersion: 5, - eventData: { - error: await Lx(i, n, await o(), globalThis, (t?.specVersion ?? 0) >= 5), - errorCode: a - } - }, { requestId: r }); - } catch (e) { - if (x$9.is(e) || S$10.is(e)) return; - if (yr$3(e)) { - Ab.error(`Fatal world contract error while recording workflow failure`, { - workflowRunId: n, - errorCode: t$9.WORLD_CONTRACT_ERROR, - error: e instanceof Error ? e.message : String(e) - }); - return; - } - throw e; - } -} -function Ev(e, t) { - let n = e.find((e) => e.runId === t && (e.eventType === `run_completed` || e.eventType === `run_failed` || e.eventType === `run_cancelled`)); - return n ? (Ab.debug(`Run reached terminal event, exiting`, { - workflowRunId: t, - eventType: n.eventType, - eventId: n.eventId - }), !0) : !1; -} -function Dv(e) { - let t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set(); - for (let r of e) r.eventType === `hook_disposed` ? t.add(r.correlationId) : r.eventType === `wait_completed` && n.add(r.correlationId); - for (let r of e) if (r.eventType === `hook_created` && !t.has(r.correlationId) || r.eventType === `wait_created` && !n.has(r.correlationId)) return !0; - return !1; -} -function Ov(e, t) { - let n = Number(process.env.WORKFLOW_V2_TIMEOUT_MS) || 12e4, r = ih$1(t?.namespace), a = ah$1(`workflow`, r), s = (t) => t.createQueueHandler(a, async (s, c) => { - let l = Qx(s); - if (l) { - await eS(l, `workflow`, t.specVersion); - return; - } - let { runId: u, traceCarrier: d, requestedAt: p, stepId: m, stepName: h, replayDivergence: g, runInput: _ } = uh$1.parse(s), v = ub(d) ? d : void 0, { requestId: x } = c, S = c.queueName.slice(a.length), C = Ab.forRun(u, S); - if (c.attempt > 48) { - let e = Cr$3(void 0, t$9.MAX_DELIVERIES_EXCEEDED); - C.error(`Workflow handler exceeded max deliveries (${c.attempt}/48)`, { - attempt: c.attempt, - errorCode: e.errorCode, - errorAttribution: e.attribution - }); - try { - let e = await mg(), t = mS(e, u), n = new D$10(`Workflow exceeded maximum queue deliveries (${c.attempt}/48)`); - await e.events.create(u, { - eventType: `run_failed`, - specVersion: 5, - eventData: { - error: await Lx(n, u, await t()), - errorCode: t$9.MAX_DELIVERIES_EXCEEDED - } - }, { requestId: x }); - } catch (e) { - if (x$9.is(e) || S$10.is(e)) return; - C.error(`Failed to mark run as failed after ${c.attempt} delivery attempts. A persistent error is preventing the run from being terminated. The run will remain in its current state until manually resolved. This is most likely due to a persistent outage of the workflow backend or a bug in the workflow runtime and should be reported to the Workflow team.`, { - attempt: c.attempt, - errorName: e instanceof Error ? e.name : `UnknownError`, - errorMessage: e instanceof Error ? e.message : String(e), - errorStack: e instanceof Error ? e.stack : void 0 - }); - } - return; - } - let w = lb(), O = () => db(w, v), A = await fb(w, v), j = new _g(), M = w === `continuous` ? v : void 0, P = await Sb(`CONSUMER`); - return await hb(M, async () => await Eb({ - workflowRunId: u, - workflowName: S - }, async () => { - let t = await vb(`workflow.route.get_world`, async () => mg()); - return vb(`workflow.execute ${c$10(S)}`, { - kind: P, - links: A - }, async (i) => { - i?.setAttributes({ - ...Kv(S), - ...qv(`execute_v2`), - ...ky(`vercel-queue`), - ...Ay(c.queueName), - ...jy(c.messageId), - ...My(`process`), - ...pS({ requestedAt: p }), - ...Jv(u), - ...ey(!!v), - ...ty(w) - }); - let a = Date.now(), s = 0, l = null, d = null, A = U_(), M = null, P, F = -1, I, ee, L = Pr$3() && _ !== void 0 && c.attempt === 1 && m === void 0 && !g; - i?.setAttributes(ny(L)); - let te, R = async () => { - if (te) try { - await te; - } catch {} - }, ne = async (e) => { - if (!L) return { timeoutSeconds: e }; - await fS(t, Yx(S, r), { - runId: u, - traceCarrier: await O(), - requestedAt: /* @__PURE__ */ new Date() - }, e > 0 ? { delaySeconds: e } : void 0); - }; - if (m && h) try { - let e = await t.runs.get(u); - if (e.status !== `running`) { - Ab.debug(`Run already finished, skipping background step`, { - workflowRunId: u, - status: e.status - }); - return; - } - let n = e.startedAt ? +e.startedAt : Date.now(); - j.pause(); - let i; - try { - i = await jg({ - world: t, - workflowRunId: u, - workflowDeploymentId: e.deploymentId, - workflowName: S, - workflowStartedAt: n, - stepId: m, - stepName: h, - runSpecVersion: e.specVersion - }); - } finally { - j.resume(); - } - if (i.type === `retry` || i.type === `throttled`) return { timeoutSeconds: i.timeoutSeconds }; - if (i.type === `completed` && i.hasPendingOps) { - await fS(t, Yx(S, r), { - runId: u, - traceCarrier: await O(), - requestedAt: /* @__PURE__ */ new Date() - }); - return; - } - if (i.type === `completed` || i.type === `failed` || i.type === `skipped`) { - let t = await lS(u); - l = t.events, d = t.cursor; - let r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(); - for (let e of l) e.eventType === `step_created` ? r.add(e.correlationId) : (e.eventType === `step_completed` || e.eventType === `step_failed`) && i.add(e.correlationId); - let a = !1; - for (let e of r) if (!i.has(e)) { - a = !0; - break; - } - if (a) { - Ab.debug(`Background step done but other steps pending, returning`, { workflowRunId: u }); - return; - } - Ab.debug(`All parallel steps done, replaying inline after background step`, { workflowRunId: u }), P = e, F = n; - } else return; - } catch (e) { - let n = wv(e); - if (!n) throw e; - await Tv({ - world: t, - workflowRun: P, - runId: u, - requestId: x, - err: e, - errorCode: n, - logMessage: `Fatal error while preparing background workflow step` - }); - return; - } - if (!P) { - let e = { - eventType: `run_started`, - specVersion: _?.specVersion ?? 5, - ..._ ? { eventData: { - input: _.input, - deploymentId: _.deploymentId, - workflowName: _.workflowName, - executionContext: _.executionContext, - attributes: _.attributes, - allowReservedAttributes: _.allowReservedAttributes - } } : {} - }, n = (e) => { - i?.addEvent(`workflow.run_started.create.start`, { "workflow.run_started.skip_preload": e }); - }; - if (L && _) { - n(!0); - let r = t.events.create(u, e, { - requestId: x, - skipPreload: !0 - }); - te = r, r.catch(() => {}), I = []; - let a = /* @__PURE__ */ new Date(); - P = { - runId: u, - status: `running`, - deploymentId: _.deploymentId, - workflowName: _.workflowName, - specVersion: _.specVersion, - executionContext: _.executionContext, - input: _.input, - attributes: _.attributes ?? {}, - startedAt: a, - createdAt: a, - updatedAt: a - }, F = +a, i?.setAttributes({ - ...Yv(`running`), - ...Xv(F) - }); - } else { - try { - n(!1); - let r = await t.events.create(u, e, { requestId: x }); - if (!r.run) throw new u$10(`Event creation for 'run_started' did not return the run entity for run "${u}"`); - if (P = r.run, r.events && r.events.length > 0 && r.hasMore !== !0 && (I = r.events, ee = r.cursor), !P.startedAt) throw new u$10(`Workflow run "${u}" has no "startedAt" timestamp`); - } catch (e) { - if (x$9.is(e) || S$10.is(e)) { - Ab.info(`Run already finished during setup, skipping`, { - workflowRunId: u, - message: e.message - }); - return; - } else { - let n = wv(e); - if (!n) throw e; - await Tv({ - world: t, - workflowRun: P, - runId: u, - requestId: x, - err: e, - errorCode: n, - logMessage: `Fatal runtime error during workflow setup` - }); - return; - } - } - if (F = +P.startedAt, i?.setAttributes({ - ...Yv(P.status), - ...Xv(F) - }), P.status !== `running`) { - Ab.info(`Workflow already completed or failed, skipping`, { - workflowRunId: u, - status: P.status - }); - return; - } - } - } - let re = await mS(t, P)(); - for (;;) { - if (s++, j.isExhausted()) { - await vg({ - runId: u, - workflowName: S, - requestId: x, - attempt: c.attempt, - limitMs: j.configuredLimitMs - }); - return; - } - if (Date.now() - a >= n) { - Ab.info(`V2 timeout reached, re-scheduling workflow`, { - workflowRunId: u, - loopIteration: s, - elapsedMs: Date.now() - a - }), await fS(t, Yx(S, r), { - runId: u, - traceCarrier: await O(), - requestedAt: /* @__PURE__ */ new Date() - }); - return; - } - let p = 0, m = null; - try { - let n; - if (M && l) { - let e = M; - if (M = null, e.events.length > 0) { - let t = new Set(l.map((e) => e.eventId)); - for (let n of e.events) t.has(n.eventId) || (t.add(n.eventId), l.push(n)); - } - d = e.cursor ?? d, n = l; - } else if (l === null) if (I) n = I, d = ee ?? null; - else { - let e = await lS(u); - n = e.events, d = e.cursor; - } - else if (d) { - let e = await lS(u, d); - if (e.events.length > 0) { - let t = new Set(l.map((e) => e.eventId)); - for (let n of e.events) t.has(n.eventId) || (t.add(n.eventId), l.push(n)); - } - d = e.cursor ?? d, n = l; - } else if (I) { - Ab.debug(`No cursor after preloaded-events first iteration; doing full reload to pick up cursor.`, { workflowRunId: u }); - let e = await lS(u); - l = e.events, d = e.cursor, n = l; - } else { - Ab.warn(`Event cursor missing after initial load — falling back to full reload. This indicates a bug in the World implementation.`, { workflowRunId: u }); - let e = await lS(u); - l = e.events, d = e.cursor, n = l; - } - if (Ev(n, u)) return; - let r = Date.now(), a = new Set(n.filter((e) => e.eventType === `wait_completed`).map((e) => e.correlationId)), o = n.filter((e) => e.eventType === `wait_created` && e.correlationId !== void 0 && !a.has(e.correlationId) && r >= e.eventData.resumeAt.getTime()).map((e) => ({ - eventType: `wait_completed`, - specVersion: 5, - correlationId: e.correlationId, - eventData: { resumeAt: e.eventData.resumeAt } - })); - for (let e of o) try { - await t.events.create(u, e, { requestId: x }); - } catch (t) { - if (x$9.is(t)) { - Ab.info(`Wait already completed, skipping`, { - workflowRunId: u, - correlationId: e.correlationId - }); - continue; - } - throw t; - } - if (o.length > 0) if (d) { - let e = await lS(u, d), t = new Set(e.events.filter((e) => e.eventType === `wait_completed`).map((e) => e.correlationId)); - if (o.every((e) => t.has(e.correlationId))) { - let t = new Set(n.map((e) => e.eventId)); - for (let r of e.events) t.has(r.eventId) || (t.add(r.eventId), n.push(r)); - d = e.cursor ?? d; - } else { - let e = await lS(u); - n = e.events, d = e.cursor; - } - } else { - let e = await lS(u); - n = e.events, d = e.cursor; - } - if (Ev(n, u)) return; - l = n, m = d, Ab.debug(`Starting workflow replay`, { - workflowRunId: u, - loopIteration: s, - eventCount: n.length - }), p = Date.now(); - let c = await Cv(e, P, n, re, A); - Ab.debug(`Workflow replay completed`, { - workflowRunId: u, - loopIteration: s, - replayMs: Date.now() - p - }); - try { - await R(), await t.events.create(u, { - eventType: `run_completed`, - specVersion: 5, - eventData: { output: c } - }, { requestId: x }); - } catch (e) { - if (x$9.is(e) || S$10.is(e)) { - Ab.info(`Tried completing workflow run, but run has already finished.`, { - workflowRunId: u, - message: e.message - }); - return; - } - throw e; - } - i?.setAttributes({ ...Yv(`completed`) }); - return; - } catch (n) { - if (Wv.is(n)) { - Ab.debug(`Workflow suspended`, { - workflowRunId: u, - loopIteration: s, - replayMs: Date.now() - p, - steps: n.stepCount, - hooks: n.hookCount, - waits: n.waitCount - }); - let e = Hb(n.stepCount, n.hookCount, n.waitCount); - e && Ab.debug(e); - let a = Date.now(), o; - try { - o = await Ng({ - suspension: n, - world: t, - run: P, - span: i, - requestId: x, - runReadyBarrier: te - }); - } catch (e) { - if (!D$10.is(e)) throw e; - let n = br$3(e); - Ab.error(`Non-retryable error while committing workflow suspension; failing run`, { - workflowRunId: u, - errorCode: n, - errorName: e.name, - errorMessage: e.message - }); - try { - await R(), await t.events.create(u, { - eventType: `run_failed`, - specVersion: 5, - eventData: { - error: await Lx(e, u, re, globalThis, (P?.specVersion ?? 0) >= 5), - errorCode: n - } - }, { requestId: x }); - } catch (e) { - if (x$9.is(e) || S$10.is(e)) { - Ab.info(`Tried failing workflow run, but run has already finished.`, { - workflowRunId: u, - message: e.message - }); - return; - } - throw e; - } - i?.setAttributes({ - ...Yv(`failed`), - ...ay(n), - ...ry(e.name), - ...iy(e.message), - ...Gy(e.name) - }); - return; - } - if (Ab.debug(`Suspension handled`, { - workflowRunId: u, - suspensionMs: Date.now() - a, - pendingSteps: o.pendingSteps.length, - timeoutSeconds: o.waitTimeout?.seconds, - hasHookConflict: o.hasHookConflict, - hasAwaitedHookCreation: o.hasAwaitedHookCreation, - hasAttributeEvents: o.hasAttributeEvents - }), o.hasHookConflict || o.hasAttributeEvents) return await ne(0); - let c = o.pendingSteps, d = o.lazyInlineSteps, f = new Set(d.map((e) => e.correlationId)), h = await O(), g = []; - for (let e of c) f.has(e.correlationId) || g.push(fS(t, Yx(S, r), { - runId: u, - stepId: e.correlationId, - stepName: e.stepName, - traceCarrier: h, - requestedAt: /* @__PURE__ */ new Date() - }, { idempotencyKey: e.correlationId })); - if (o.waitTimeout && g.push(fS(t, Yx(S, r), { - runId: u, - traceCarrier: h, - requestedAt: /* @__PURE__ */ new Date() - }, Ig(o.waitTimeout.seconds, o.waitTimeout.correlationId))), await Promise.all(g), d.length === 0) return o.hasAwaitedHookCreation ? await ne(0) : void 0; - let _ = typeof m == `string` && n.stepCount === 1 && n.hookCount === 0 && n.waitCount === 0 && c.length === 1 && d.length === 1 && !o.waitTimeout && !Dv(l ?? []), v = L && !o.waitTimeout && !o.hasHookEvents && !o.hasAttributeEvents && !o.hasAwaitedHookCreation && !Dv(l ?? []); - j.pause(); - let C; - try { - C = await Promise.all(d.map((e) => jg({ - world: t, - workflowRunId: u, - workflowDeploymentId: P.deploymentId, - workflowName: S, - workflowStartedAt: F, - stepId: e.correlationId, - stepName: e.stepName, - runSpecVersion: P.specVersion, - lazyStepInput: e.dehydratedInput, - forceOptimisticStart: v, - runReadyBarrier: te, - ..._ && m ? { inlineDeltaSinceCursor: m } : {} - }))); - } finally { - j.resume(); - } - let w = [], E = !1, D; - for (let e = 0; e < d.length; e++) { - let t = C[e], n = d[e]; - t.type === `retry` ? w.push({ - step: n, - delaySeconds: t.timeoutSeconds - }) : t.type === `throttled` ? D = Math.max(D ?? 0, t.timeoutSeconds) : t.type === `completed` && t.hasPendingOps && (E = !0); - } - if (D !== void 0) return await ne(D); - if (w.length > 0) { - let e = await O(); - await Promise.all(w.map(({ step: n, delaySeconds: i }) => fS(t, Yx(S, r), { - runId: u, - stepId: n.correlationId, - stepName: n.stepName, - traceCarrier: e, - requestedAt: /* @__PURE__ */ new Date() - }, { - delaySeconds: i, - idempotencyKey: n.correlationId - }))); - } - if (E) { - Ab.debug(`Breaking loop: inline step has pending ops`, { - workflowRunId: u, - loopIteration: s - }), await fS(t, Yx(S, r), { - runId: u, - traceCarrier: await O(), - requestedAt: /* @__PURE__ */ new Date() - }); - return; - } - if (w.length > 0) return; - if (d.length === 1) { - let e = C[0]; - e.type === `completed` && e.inlineDelta && !e.inlineDelta.hasMore && (M = { - events: e.inlineDelta.events, - cursor: e.inlineDelta.cursor - }); - } - } else { - let a = n; - if (f$8.is(n)) { - let e = (g?.count ?? 0) + 1; - if (e <= 3) { - C.warn(`Workflow replay diverged; queueing a recovery replay before declaring the event log corrupted`, { - errorCode: t$9.REPLAY_DIVERGENCE, - divergenceEventId: n.eventId, - priorDivergenceEventId: g?.eventId, - divergenceCount: e, - deliveryAttempt: c.attempt, - maxRecoveryReplays: 3, - errorMessage: n.message - }), await fS(t, Yx(S, r), { - runId: u, - traceCarrier: await O(), - requestedAt: /* @__PURE__ */ new Date(), - replayDivergence: { - eventId: n.eventId, - count: e - } - }); - return; - } - a = new d$10(`Workflow replay diverged ${e} times after 3 recovery replays; latest divergent event was ${n.eventId}. Last divergence: ${n.message}`, { cause: n }); - } - a instanceof Error && i?.recordException?.(a); - let s = await Tg(a), l = s.name || yg(a), d = s.message, p = s.stack || bg(a); - if (p) { - let t = i$12(S)?.moduleSpecifier || S; - p = B_(p, t, e); - } - let m = br$3(a); - Ab.error(`Error while running workflow`, { - workflowRunId: u, - errorCode: m, - errorName: l, - errorStack: p - }), types.isNativeError(a) && p && (a.stack = p); - try { - await R(), await t.events.create(u, { - eventType: `run_failed`, - specVersion: 5, - eventData: { - error: await Lx(a, u, re, globalThis, (P?.specVersion ?? 0) >= 5), - errorCode: m - } - }, { requestId: x }); - } catch (e) { - if (x$9.is(e) || S$10.is(e)) { - Ab.info(`Tried failing workflow run, but run has already finished.`, { - workflowRunId: u, - message: e.message - }); - return; - } - if (yr$3(e)) { - Ab.error(`Fatal world contract error while recording workflow failure`, { - workflowRunId: u, - errorCode: t$9.WORLD_CONTRACT_ERROR, - error: e instanceof Error ? e.message : String(e) - }); - return; - } - throw e; - } - i?.setAttributes({ - ...Yv(`failed`), - ...ay(m), - ...ry(l), - ...iy(d), - ...Gy(l) - }); - return; - } - } - } - }); - })); - }), c, l = 0, u = Date.now(), d = typeof t?.routeModuleBodyStartedAt == `number` ? u - t.routeModuleBodyStartedAt : void 0; - return dS(async (e) => { - l += 1; - let t = c !== void 0; - return vb(`workflow.route.flow`, { - kind: await Sb(`SERVER`), - attributes: { - ...ly(`flow`), - ...uy(t), - ...dy(l), - ...fy(Date.now() - u), - ...d === void 0 ? {} : py(d), - ...Hy(e.method), - ...Uy(`/.well-known/workflow/v1/flow`) - } - }, async (t) => { - c ||= await vb(`workflow.route.init`, async () => s(await vb(`workflow.route.get_world_handlers`, async () => pg()))); - let n = await c(e); - return n instanceof Response && t?.setAttributes(Wy(n.status)), n; - }); - }); -} -//#endregion -//#region node_modules/eve/dist/src/internal/workflow/runtime.js -process.env.WORKFLOW_TURBO = `0`; -//#endregion -//#region node_modules/eve/dist/src/runtime/connections/authorization-complete-page.js -function buildAuthorizationCompletePage() { - return new Response(` - - - - - Authorization complete - - - -
-

Authorization complete

-

You can close this tab and return to your app.

-
- -`, { - headers: { - "cache-control": `no-store`, - "content-type": `text/html; charset=utf-8` - }, - status: 200 - }); -} -//#endregion -//#region node_modules/eve/dist/src/runtime/connections/callback-route.js -const HTTP_CONNECTION_CALLBACK_CHANNEL_NAME_PREFIX = `eve/v1/connections/callback`; -const HANDLED_METHODS$1 = [`GET`, `POST`]; -function getConnectionCallbackChannelDefinitions() { - return HANDLED_METHODS$1.map((e) => buildCallbackChannelDefinition$1(e)); -} -function getConnectionCallbackChannelNames() { - return new Set(HANDLED_METHODS$1.map(channelNameForMethod$1)); -} -function buildCallbackChannelDefinition$1(t) { - let n = channelNameForMethod$1(t); - return { - name: n, - method: t, - urlPath: EVE_CONNECTION_CALLBACK_ROUTE_PATTERN, - fetch: handleConnectionCallbackRequest, - logicalPath: `framework://channels/${n}`, - sourceId: `eve:framework:connection-callback-${t.toLowerCase()}`, - sourceKind: `module` - }; -} -function channelNameForMethod$1(e) { - return `${HTTP_CONNECTION_CALLBACK_CHANNEL_NAME_PREFIX}/${e.toLowerCase()}`; -} -async function handleConnectionCallbackRequest(e, r) { - let i = r.params.name, a = r.params.token; - if (typeof i != `string` || i.length === 0) return Response.json({ - error: `Missing connection name.`, - ok: !1 - }, { status: 400 }); - if (typeof a != `string` || a.length === 0) return Response.json({ - error: `Missing callback token.`, - ok: !1 - }, { status: 400 }); - let o = await projectAuthorizationCallback(e); - try { - await E$9(a, { - kind: `deliver`, - payloads: [{ authorizationCallback: { - connectionName: i, - callback: o - } }] - }); - } catch { - return Response.json({ - error: `Connection callback not pending.`, - ok: !1 - }, { status: 404 }); - } - return buildAuthorizationCompletePage(); -} -async function projectAuthorizationCallback(e) { - let t = {}; - for (let [n, r] of new URL(e.url).searchParams) t[n] = r; - let n; - if (e.method !== `GET` && e.method !== `HEAD`) { - try { - n = await e.text(); - } catch { - n = void 0; - } - let r = e.headers.get(`content-type`) ?? ``; - if (n && r.includes(`application/x-www-form-urlencoded`)) for (let [e, r] of new URLSearchParams(n)) t[e] = r; - } - return n === void 0 ? { - params: t, - method: e.method - } : { - params: t, - method: e.method, - body: n - }; -} -//#endregion -//#region node_modules/eve/dist/src/runtime/session-callback-route.js -const HTTP_SESSION_CALLBACK_CHANNEL_NAME_PREFIX = `eve/v1/callback`; -const HANDLED_METHODS = [`POST`]; -function getSessionCallbackChannelDefinitions() { - return HANDLED_METHODS.map((e) => buildCallbackChannelDefinition(e)); -} -function getSessionCallbackChannelNames() { - return new Set(HANDLED_METHODS.map(channelNameForMethod)); -} -function buildCallbackChannelDefinition(t) { - let n = channelNameForMethod(t); - return { - name: n, - method: t, - urlPath: EVE_CALLBACK_ROUTE_PATTERN, - fetch: handleSessionCallbackRequest, - logicalPath: `framework://channels/${n}`, - sourceId: `eve:framework:session-callback-${t.toLowerCase()}`, - sourceKind: `module` - }; -} -function channelNameForMethod(e) { - return `${HTTP_SESSION_CALLBACK_CHANNEL_NAME_PREFIX}/${e.toLowerCase()}`; -} -async function handleSessionCallbackRequest(e, n) { - let r = n.params.token; - if (typeof r != `string` || r.length === 0) return Response.json({ - error: `Missing callback token.`, - ok: !1 - }, { status: 400 }); - let i; - try { - i = await e.json(); - } catch { - return Response.json({ - error: `Invalid JSON body.`, - ok: !1 - }, { status: 400 }); - } - let a = projectSessionCallbackResult(i); - if (a instanceof Response) return a; - try { - await E$9(r, { - kind: `runtime-action-result`, - results: [a] - }); - } catch { - return Response.json({ - error: `Session callback not pending.`, - ok: !1 - }, { status: 404 }); - } - return Response.json({ ok: !0 }, { status: 202 }); -} -function projectSessionCallbackResult(e) { - if (typeof e != `object` || !e) return Response.json({ - error: `Expected a JSON object.`, - ok: !1 - }, { status: 400 }); - let t = e; - return typeof t.callId != `string` || t.callId.length === 0 ? Response.json({ - error: `Missing callback callId.`, - ok: !1 - }, { status: 400 }) : typeof t.subagentName != `string` || t.subagentName.length === 0 ? Response.json({ - error: `Missing callback subagentName.`, - ok: !1 - }, { status: 400 }) : t.kind === `session.completed` ? { - callId: t.callId, - kind: `subagent-result`, - output: t.output ?? ``, - subagentName: t.subagentName - } : t.kind === `session.failed` ? { - callId: t.callId, - isError: !0, - kind: `subagent-result`, - output: t.error === void 0 ? { - code: `REMOTE_AGENT_FAILED`, - message: `Remote agent failed.` - } : t.error, - subagentName: t.subagentName - } : Response.json({ - error: `Unsupported callback kind.`, - ok: !1 - }, { status: 400 }); -} -//#endregion -//#region node_modules/eve/dist/src/runtime/framework-channels/index.js -function getFrameworkChannelDefinitions() { - let r = eveChannel({ auth: [vercelOidc(), localDev()] }), i = []; - for (let e of r.routes) isHttpRouteDefinition(e) && i.push({ - name: `eve`, - method: e.method.toUpperCase(), - urlPath: e.path, - cors: r.cors, - fetch: async (t, n) => e.handler(t, n), - handler: e.handler, - adapter: r.adapter, - logicalPath: `framework://channels/${e.path}`, - sourceId: `eve:framework:${e.method.toLowerCase()}-${e.path}`, - sourceKind: `module` - }); - return i.push(...getConnectionCallbackChannelDefinitions(), ...getSessionCallbackChannelDefinitions()), i; -} -function getAllFrameworkChannelNames() { - return /* @__PURE__ */ new Set([ - `eve`, - ...getConnectionCallbackChannelNames(), - ...getSessionCallbackChannelNames() - ]); -} -//#endregion -//#region node_modules/eve/dist/src/context/providers/connection-key.js -const ConnectionRegistryKey = new ContextKey(`eve.connectionRegistry`); -//#endregion -//#region node_modules/eve/dist/src/runtime/framework-tools/file-state.js -const ReadFileStateKey = new ContextKey(`eve.readFile`); -function normalizeModelPath(t) { - return posix.normalize(t); -} -function buildReadFileTargetKey(e) { - return e; -} -function createReadFileStamp(e) { - let n = createHash(`sha256`).update(e.content, `utf8`).digest(`hex`); - return { - byteLength: Buffer.byteLength(e.content, `utf8`), - contentHash: n, - filePath: e.filePath - }; -} -function setReadFileStamp(e, t, n) { - let r = e.ensure(ReadFileStateKey, () => ({ byTarget: {} })); - e.set(ReadFileStateKey, { byTarget: { - ...r.byTarget, - [t]: n - } }); -} -function clearReadFileState() { - loadContext().set(ReadFileStateKey, { byTarget: {} }); -} -//#endregion -//#region node_modules/eve/dist/src/runtime/framework-tools/todo.js -const TodoStateKey = new ContextKey(`eve.todo`); -function formatTodoSummary(e) { - return e.items.length === 0 ? void 0 : `[Your task list was preserved across context compaction]\n${e.items.map((e) => `- [${e.status === `completed` ? `x` : e.status === `cancelled` ? `-` : ` `}] [${e.priority}] ${e.content}`).join(` -`)}`; -} -function getTodoCompactionMessage() { - let t = loadContext().get(TodoStateKey); - if (t === void 0 || t.items.length === 0) return; - let r = formatTodoSummary(t); - if (r !== void 0) return { - content: r, - role: `user` - }; -} -function formatTodoResult(e) { - let { items: t } = e, n = { - cancelled: 0, - completed: 0, - in_progress: 0, - pending: 0, - total: t.length - }; - for (let e of t) n[e.status]++; - return { - counts: n, - todos: t - }; -} -function executeTodoTool(t) { - let r = loadContext(), { todos: i } = t ?? {}; - if (i !== void 0) { - let e = { items: [...i] }; - return r.set(TodoStateKey, e), formatTodoResult(e); - } - return formatTodoResult(r.ensure(TodoStateKey, () => ({ items: [] }))); -} -const TODO_ITEM_SCHEMA = { - additionalProperties: !1, - properties: { - content: { - description: `Brief description of the task.`, - type: `string` - }, - priority: { - description: `Priority level of the task.`, - enum: [ - `high`, - `medium`, - `low` - ], - type: `string` - }, - status: { - description: `Current status of the task.`, - enum: [ - `pending`, - `in_progress`, - `completed`, - `cancelled` - ], - type: `string` - } - }, - required: [ - `content`, - `status`, - `priority` - ], - type: `object` -}; -const TODO_OUTPUT_SCHEMA = { - additionalProperties: !1, - properties: { - counts: { - additionalProperties: !1, - properties: { - cancelled: { - minimum: 0, - type: `integer` - }, - completed: { - minimum: 0, - type: `integer` - }, - in_progress: { - minimum: 0, - type: `integer` - }, - pending: { - minimum: 0, - type: `integer` - }, - total: { - minimum: 0, - type: `integer` - } - }, - required: [ - `cancelled`, - `completed`, - `in_progress`, - `pending`, - `total` - ], - type: `object` - }, - todos: { - items: TODO_ITEM_SCHEMA, - type: `array` - } - }, - required: [`counts`, `todos`], - type: `object` -}; -const TODO_TOOL_DEFINITION = { - description: [ - `Use this tool to create and manage a structured task list for the current session.`, - `This helps you track progress, organize complex tasks, and demonstrate thoroughness.`, - ``, - `When to use:`, - `- Complex multistep tasks requiring 3 or more distinct steps`, - `- When the user provides multiple tasks or a numbered list`, - `- After receiving new instructions, to capture requirements`, - `- After completing a task, to mark it complete and add follow-ups`, - ``, - `When NOT to use:`, - `- Single, straightforward tasks that need no tracking`, - `- Purely conversational or informational requests`, - ``, - `Usage:`, - "- Call with `todos` to replace the entire list (full replacement write)", - "- Call without `todos` to read the current list", - `- Both return the full current list with status counts`, - `- Mark tasks in_progress when you start, completed when done`, - `- Only have ONE task in_progress at a time` - ].join(` -`), - execute: async (e) => executeTodoTool(e ?? {}), - inputSchema: { - additionalProperties: !1, - properties: { todos: { - description: `The updated todo list. Omit to read the current list without modifying it.`, - items: TODO_ITEM_SCHEMA, - type: `array` - } }, - type: `object` - }, - logicalPath: `eve:framework/todo`, - name: `todo`, - outputSchema: TODO_OUTPUT_SCHEMA, - sourceId: `eve:todo-tool`, - sourceKind: `module` -}; -//#endregion -//#region node_modules/eve/dist/src/runtime/framework-tools/ask-question.js -const ASK_QUESTION_TOOL_NAME = `ask_question`, askQuestionToolInputSchema = inputRequestSchema.omit({ - action: !0, - display: !0, - requestId: !0 -}), { $schema: _jsonSchemaVersion, ...askQuestionInputSchema } = Ls$3.toJSONSchema(askQuestionToolInputSchema), askQuestionToolOutputSchema = Ls$3.object({ - optionId: Ls$3.string().optional(), - status: Ls$3.enum([`answered`, `ignored`]), - text: Ls$3.string().optional() -}).strict(), { $schema: _outputJsonSchemaVersion, ...askQuestionOutputSchema } = Ls$3.toJSONSchema(askQuestionToolOutputSchema), ASK_QUESTION_INPUT_SCHEMA = askQuestionInputSchema, ASK_QUESTION_OUTPUT_SCHEMA = askQuestionOutputSchema, ASK_QUESTION_TOOL_DEFINITION = { - description: `Ask the user a question and wait for their response before continuing. Use this when you need clarification or a choice from the user.`, - inputSchema: ASK_QUESTION_INPUT_SCHEMA, - logicalPath: `eve:framework/ask-question`, - name: ASK_QUESTION_TOOL_NAME, - outputSchema: ASK_QUESTION_OUTPUT_SCHEMA, - sourceId: `eve:ask-question-tool`, - sourceKind: `module` -}; -//#endregion -//#region node_modules/eve/dist/src/runtime/framework-tools/web-search.js -const WEB_SEARCH_OPENAI_OUTPUT_SCHEMA = { - $schema: `http://json-schema.org/draft-07/schema#`, - additionalProperties: !1, - properties: { - action: { oneOf: [ - { - additionalProperties: !1, - properties: { - queries: { - items: { type: `string` }, - type: `array` - }, - query: { type: `string` }, - type: { - const: `search`, - type: `string` - } - }, - required: [`type`], - type: `object` - }, - { - additionalProperties: !1, - properties: { - type: { - const: `openPage`, - type: `string` - }, - url: { anyOf: [{ type: `string` }, { type: `null` }] } - }, - required: [`type`], - type: `object` - }, - { - additionalProperties: !1, - properties: { - pattern: { anyOf: [{ type: `string` }, { type: `null` }] }, - type: { - const: `findInPage`, - type: `string` - }, - url: { anyOf: [{ type: `string` }, { type: `null` }] } - }, - required: [`type`], - type: `object` - } - ] }, - sources: { - items: { oneOf: [{ - additionalProperties: !1, - properties: { - type: { - const: `url`, - type: `string` - }, - url: { type: `string` } - }, - required: [`type`, `url`], - type: `object` - }, { - additionalProperties: !1, - properties: { - name: { type: `string` }, - type: { - const: `api`, - type: `string` - } - }, - required: [`type`, `name`], - type: `object` - }] }, - type: `array` - } - }, - type: `object` -}; -const WEB_SEARCH_ANTHROPIC_OUTPUT_SCHEMA = { - $schema: `http://json-schema.org/draft-07/schema#`, - items: { - additionalProperties: !1, - properties: { - encryptedContent: { type: `string` }, - pageAge: { anyOf: [{ type: `string` }, { type: `null` }] }, - title: { anyOf: [{ type: `string` }, { type: `null` }] }, - type: { - const: `web_search_result`, - type: `string` - }, - url: { type: `string` } - }, - required: [ - `url`, - `title`, - `pageAge`, - `encryptedContent`, - `type` - ], - type: `object` - }, - type: `array` -}; -const WEB_SEARCH_GOOGLE_OUTPUT_SCHEMA = { - $schema: `http://json-schema.org/draft-07/schema#`, - additionalProperties: !1, - properties: {}, - type: `object` -}; -const WEB_SEARCH_PARALLEL_OUTPUT_SCHEMA = { - $schema: `http://json-schema.org/draft-07/schema#`, - anyOf: [{ - additionalProperties: !1, - properties: { - results: { - items: { - additionalProperties: !1, - properties: { - excerpt: { type: `string` }, - publishDate: { anyOf: [{ type: `string` }, { type: `null` }] }, - relevanceScore: { type: `number` }, - title: { type: `string` }, - url: { type: `string` } - }, - required: [ - `url`, - `title`, - `excerpt` - ], - type: `object` - }, - type: `array` - }, - searchId: { type: `string` } - }, - required: [`searchId`, `results`], - type: `object` - }, { - additionalProperties: !1, - properties: { - error: { - enum: [ - `api_error`, - `rate_limit`, - `timeout`, - `invalid_input`, - `configuration_error`, - `unknown` - ], - type: `string` - }, - message: { type: `string` }, - statusCode: { type: `number` } - }, - required: [`error`, `message`], - type: `object` - }] -}; -const WEB_SEARCH_TOOL_DEFINITION = { - description: `Search the web for real-time information. Use this to find up-to-date information about current events, recent developments, or topics that may have changed since the knowledge cutoff.`, - inputSchema: null, - logicalPath: `eve:framework/web-search`, - name: `web_search`, - sourceId: `eve:web-search-tool`, - sourceKind: `module` -}; -//#endregion -//#region node_modules/eve/dist/src/execution/sandbox/require-sandbox.js -async function requireSandboxSession() { - let t = loadContext().get(SandboxKey); - if (t === void 0) throw Error(`This tool requires sandbox access on the runtime context. Ensure the step is running inside a managed runtime context with sandbox support.`); - let n = await t.get(); - if (n === null) throw Error(`The sandbox is not available in the current runtime context.`); - return n; -} -function validateAbsoluteFilePath(e) { - if (!e.startsWith(`/`)) throw Error(`filePath must be an absolute path. Received: "${e}". Use an absolute path such as /workspace/foo.ts.`); -} -//#endregion -//#region node_modules/eve/dist/src/execution/sandbox/truncate-output.js -const MAX_LINE_LENGTH = 2e3; -const LINE_TRUNCATION_SUFFIX = ` [truncated]`; -function truncateHead(e) { - return truncateByDirection(e, `head`); -} -function truncateTail(e) { - return truncateByDirection(e, `tail`); -} -function truncateByDirection(e, t) { - let n = e.split(` -`), r = countLogicalLines(n), i = t === `head`, a = [], o = 0, s = i ? 0 : n.length - 1, c = i ? 1 : -1; - for (let e = s; e >= 0 && e < n.length && a.length < 2e3; e += c) { - let t = capLineLength(n[e] ?? ``), r = Buffer.byteLength(t, `utf8`) + 1; - if (o + r > 51200 && a.length > 0) break; - a.push(t), o += r; - } - return i || a.reverse(), { - output: a.join(` -`), - outputLines: a.length, - totalLines: r, - truncated: a.length < r - }; -} -function capLineLength(e) { - return e.length <= 2e3 ? e : e.slice(0, 2e3) + LINE_TRUNCATION_SUFFIX; -} -function countLogicalLines(e) { - return e.length > 0 && e[e.length - 1] === `` ? e.length - 1 : e.length; -} -//#endregion -//#region node_modules/eve/dist/src/internal/application/optional-package-install.js -const EVE_DEV_ENV_FLAG = `EVE_DEV`; -function isEveDevEnvironment() { - return process.env[EVE_DEV_ENV_FLAG] === `1`; -} -function detectProjectPackageManager(r) { - let i = r; - for (;;) { - if (existsSync(join(i, `pnpm-lock.yaml`)) || existsSync(join(i, `pnpm-workspace.yaml`))) return `pnpm`; - if (existsSync(join(i, `yarn.lock`))) return `yarn`; - if (existsSync(join(i, `bun.lock`)) || existsSync(join(i, `bun.lockb`))) return `bun`; - if (existsSync(join(i, `package-lock.json`))) return `npm`; - let r = dirname(i); - if (r === i) return `npm`; - i = r; - } -} -const INSTALL_ARGUMENTS = { - bun: [`add`, `--dev`], - npm: [`install`, `--save-dev`], - pnpm: [`add`, `-D`], - yarn: [`add`, `-D`] -}; -const OPTIONAL_PACKAGE_LOCK_TIMEOUT_MS = 600 * 1e3; -const pendingOptionalPackageInstalls = /* @__PURE__ */ new Map(); -async function installPackageIntoProject(e) { - let t = detectProjectPackageManager(e.appRoot), n = [...INSTALL_ARGUMENTS[t], e.packageName]; - console.info(`[eve:dev] installing optional dependency "${e.packageName}" via \`${t} ${n.join(` `)}\`...`); - let i = spawn(t, n, { - cwd: e.appRoot, - shell: shouldSpawnPackageManagerWithShell(), - stdio: [ - `ignore`, - `pipe`, - `pipe` - ] - }), a = []; - i.stdout?.on(`data`, (e) => a.push(e)), i.stderr?.on(`data`, (e) => a.push(e)); - let o = await new Promise((e, t) => { - i.on(`error`, t), i.on(`close`, (t) => e(t ?? 1)); - }); - if (o !== 0) { - let n = Buffer.concat(a).toString(`utf8`).trim(); - throw Error(`Failed to install "${e.packageName}" with ${t} (exit ${o}).` + (n.length > 0 ? `\n${n.slice(-2e3)}` : ``)); - } - console.info(`[eve:dev] installed "${e.packageName}".`); -} -async function loadOptionalEnginePackage(e) { - try { - return await e.importModule(); - } catch (t) { - if (!e.autoInstall || !isEveDevEnvironment()) throw Error(e.missingMessage, { cause: t }); - let n = e.importInstalledModule ?? (async () => await importInstalledEnginePackage({ - appRoot: e.appRoot, - packageName: e.packageName - })), r = e.importInstalledModule === void 0 ? async () => await isInstalledEnginePackageLoadable(e) : async () => { - try { - return await n(), !0; - } catch { - return !1; - } - }; - try { - await withOptionalPackageInstallLock(e, async () => { - await r() || await installPackageIntoProject({ - appRoot: e.appRoot, - packageName: e.packageName - }); - }); - } catch (t) { - throw Error(`${e.missingMessage} Automatic installation failed: ${toMessage(t)}`, { cause: t }); - } - try { - return await n(); - } catch (t) { - throw Error(`${e.missingMessage} Automatic installation completed, but "${e.packageName}" still could not be loaded from "${e.appRoot}". This usually means the package manager installed into a different workspace, node_modules is unavailable, or the Node/package-manager environment changed while eve dev was running. Last load error: ${toMessage(t)}`, { cause: t }); - } - } -} -async function importInstalledEnginePackage(e) { - return await import(await resolveInstalledEnginePackageEntrypointHref(e)); -} -async function isInstalledEnginePackageLoadable(e) { - try { - return await importEntrypointInWorker(await resolveInstalledEnginePackageEntrypointHref(e)), !0; - } catch { - return !1; - } -} -async function resolveInstalledEnginePackageEntrypointHref(e) { - let t = findInstalledPackageRoot(e), r = join(t, `package.json`), i = resolvePackageEntryPoint(JSON.parse(await readFile(r, `utf8`))); - if (i.startsWith(`/`)) throw Error(`Invalid absolute entrypoint for optional package "${e.packageName}".`); - return pathToFileURL(join(t, i)).href; -} -async function importEntrypointInWorker(e) { - let t = new Worker(` -const { parentPort, workerData } = require("node:worker_threads"); - -(async () => { - try { - await import(workerData.entrypointHref); - parentPort.postMessage({ ok: true }); - } catch (error) { - parentPort.postMessage({ - ok: false, - message: error instanceof Error ? error.message : String(error), - }); - } -})(); -`, { - eval: !0, - workerData: { entrypointHref: e } - }); - await new Promise((e, n) => { - let r = !1, settle = (e) => { - r || (r = !0, t.off(`error`, handleError), t.off(`exit`, handleExit), t.off(`message`, handleMessage), t.terminate().catch(() => {}), e()); - }, handleError = (e) => settle(() => n(e)), handleExit = (e) => { - e !== 0 && settle(() => n(Error(`Optional dependency worker exited before loading module (code ${e}).`))); - }, handleMessage = (t) => { - let r = t; - settle(() => { - if (r.ok === !0) { - e(); - return; - } - n(Error(typeof r.message == `string` ? r.message : `Optional dependency worker failed to load module.`)); - }); - }; - t.once(`error`, handleError), t.once(`exit`, handleExit), t.once(`message`, handleMessage); - }); -} -function findInstalledPackageRoot(r) { - let i = r.packageName.split(`/`), a = [], o = r.appRoot; - for (;;) { - let s = join(o, `node_modules`, ...i); - if (a.push(s), existsSync(join(s, `package.json`))) return s; - let c = dirname(o); - if (c === o) throw Error(`Could not find installed optional dependency "${r.packageName}". Checked: ${a.join(`, `)}`); - o = c; - } -} -function resolvePackageEntryPoint(e) { - let t = readDotExport(e.exports); - return t === void 0 ? typeof e.module == `string` && e.module.length > 0 ? e.module : typeof e.main == `string` && e.main.length > 0 ? e.main : `index.js` : t; -} -function readDotExport(e) { - if (typeof e == `string` && e.length > 0) return e; - if (typeof e != `object` || !e) return; - let t = `.` in e ? e[`.`] : e; - if (typeof t == `string` && t.length > 0) return t; - if (typeof t != `object` || !t) return; - let n = t; - if (typeof n.import == `string` && n.import.length > 0) return n.import; - if (typeof n.default == `string` && n.default.length > 0) return n.default; -} -async function withOptionalPackageInstallLock(e, t) { - let n = `${e.appRoot}:${e.packageName}`, r = pendingOptionalPackageInstalls.get(n); - if (r !== void 0) { - await r; - return; - } - let i = withOptionalPackageInstallFileLock(e, t).finally(() => { - pendingOptionalPackageInstalls.delete(n); - }); - pendingOptionalPackageInstalls.set(n, i), await i; -} -async function withOptionalPackageInstallFileLock(e, t) { - let r = join(e.appRoot, `.eve`, `optional-package-locks`, `${sanitizeLockName(e.packageName)}.lock`); - await acquireLock$1(r); - try { - await t(); - } finally { - await rm(r, { - force: !0, - recursive: !0 - }).catch(() => {}); - } -} -async function acquireLock$1(e) { - let r = Date.now(); - for (;;) { - await mkdir(dirname(e), { recursive: !0 }); - try { - await mkdir(e), await writeFile(join(e, `owner.json`), `${JSON.stringify({ - createdAt: (/* @__PURE__ */ new Date()).toISOString(), - pid: process.pid - })}\n`); - return; - } catch (t) { - if (!isFileExistsError$1(t)) throw t; - await waitForExistingLock$1(e, r); - } - } -} -async function waitForExistingLock$1(e, t) { - let n = await stat(e).catch((e) => { - if (isNotFoundError$1(e)) return null; - throw e; - }); - if (n !== null) { - if (Date.now() - n.mtimeMs > 18e5) { - await rm(e, { - force: !0, - recursive: !0 - }).catch(() => {}); - return; - } - if (Date.now() - t > OPTIONAL_PACKAGE_LOCK_TIMEOUT_MS) throw Error(`Timed out waiting for optional package install lock "${e}" after ${OPTIONAL_PACKAGE_LOCK_TIMEOUT_MS}ms.`); - await new Promise((e) => setTimeout(e, 250)); - } -} -function sanitizeLockName(e) { - return e.replaceAll(/[^a-zA-Z0-9._-]+/g, `-`); -} -function shouldSpawnPackageManagerWithShell(e = process.platform) { - return e === `win32`; -} -function isFileExistsError$1(e) { - return typeof e == `object` && !!e && `code` in e && e.code === `EEXIST`; -} -function isNotFoundError$1(e) { - return typeof e == `object` && !!e && `code` in e && e.code === `ENOENT`; -} -function toMessage(e) { - return e instanceof Error ? e.message : String(e); -} -//#endregion -//#region node_modules/eve/dist/src/execution/sandbox/bash-tool.js -async function executeBashOnSandbox(t, n) { - let r = await runWithDevelopmentSandboxProgress(t, n.command), i = truncateTail(r.stdout), a = truncateTail(r.stderr), o = i.truncated || a.truncated, s = i.output; - i.truncated && (s = `[stdout truncated: showing last ${i.outputLines} of ${i.totalLines} lines]\n` + s); - let c = a.output; - return a.truncated && (c = `[stderr truncated: showing last ${a.outputLines} of ${a.totalLines} lines]\n` + c), { - exitCode: r.exitCode, - stderr: c, - stdout: s, - truncated: o - }; -} -async function runWithDevelopmentSandboxProgress(e, n) { - if (logDevelopmentSandboxCommand(`eve: starting sandbox command: ${formatCommand$1(n)}`), !isEveDevEnvironment()) return await e.run({ command: n }); - let r = Date.now(), i = setInterval(() => { - logDevelopmentSandboxCommand(`eve: waiting for sandbox command (${Math.round((Date.now() - r) / 1e3)}s elapsed): ${formatCommand$1(n)}`); - }, 5e3); - i.unref?.(); - try { - let t = await e.run({ command: n }); - return logDevelopmentSandboxCommand(`eve: sandbox command finished (exit ${t.exitCode}): ${formatCommand$1(n)}`), t; - } catch (e) { - throw logDevelopmentSandboxCommand(`eve: sandbox command failed: ${formatCommand$1(n)}`), e; - } finally { - clearInterval(i); - } -} -function logDevelopmentSandboxCommand(e) { - isEveDevEnvironment() && console.log(e); -} -function formatCommand$1(e) { - let t = e.replaceAll(/\s+/g, ` `).trim(); - return t.length <= 240 ? t : `${t.slice(0, 239)}…`; -} -//#endregion -//#region node_modules/eve/dist/src/runtime/framework-tools/bash.js -const BASH_INPUT_SCHEMA = { - additionalProperties: !1, - properties: { command: { - description: `The shell command to execute.`, - type: `string` - } }, - required: [`command`], - type: `object` -}; -const BASH_OUTPUT_SCHEMA = { - additionalProperties: !1, - properties: { - exitCode: { type: `number` }, - stderr: { type: `string` }, - stdout: { type: `string` }, - truncated: { type: `boolean` } - }, - required: [ - `exitCode`, - `stderr`, - `stdout`, - `truncated` - ], - type: `object` -}; -async function executeBash(e) { - return executeBashOnSandbox(await requireSandboxSession(), e); -} -const BASH_TOOL_DEFINITION = { - description: `Execute a shell command in the shared workspace environment.`, - execute: executeBash, - inputSchema: BASH_INPUT_SCHEMA, - logicalPath: `eve:framework/bash`, - name: `bash`, - outputSchema: BASH_OUTPUT_SCHEMA, - sourceId: `eve:bash-tool`, - sourceKind: `module` -}; -//#endregion -//#region node_modules/eve/dist/src/execution/sandbox/shell-quote.js -function shellQuote(e) { - return `'${e.replace(/'/g, `'\\''`)}'`; -} -//#endregion -//#region node_modules/eve/dist/src/execution/sandbox/ripgrep-probe.js -const probes = /* @__PURE__ */ new Map(); -async function ripgrepIsAvailable(t) { - let n = probes.get(t.id); - if (n !== void 0) return n; - let r = runProbe(t); - probes.set(t.id, r); - try { - return await r; - } catch { - return probes.delete(t.id), !1; - } -} -async function runProbe(e) { - return (await e.run({ command: `command -v rg >/dev/null 2>&1` })).exitCode === 0; -} -//#endregion -//#region node_modules/eve/dist/src/execution/sandbox/glob-tool.js -async function executeGlobOnSandbox(n, a) { - let o = a.path ?? `/workspace`; - validateAbsoluteFilePath(o); - let s = normalizeModelPath(o), c = Math.min(Math.max(1, a.limit ?? 100), 1e3), l = await ripgrepIsAvailable(n) ? buildRipgrepCommand$1({ - normalizedPath: s, - pattern: a.pattern - }) : buildPosixFindCommand({ - normalizedPath: s, - pattern: a.pattern - }), u = await n.run({ command: l }); - if (u.exitCode !== 0 && u.exitCode !== 1) throw buildGlobExecutionError(l, u.exitCode, u.stderr); - let d = u.stdout.split(` -`).filter((e) => e.length > 0), f = d.length > c, p = f ? d.slice(0, c) : d, m = [], h = 0, g = !1; - for (let n of p) { - let r = normalizeModelPath(n), i = Buffer.byteLength(r, `utf8`) + 1; - if (h + i > 51200 && m.length > 0) { - g = !0; - break; - } - m.push(r), h += i; - } - if (m.length === 0) return { - content: `No files found`, - count: 0, - path: s, - truncated: !1 - }; - let _ = f || g, v = [...m]; - return _ && (v.push(``), v.push(`(Results truncated: showing first ${m.length} results out of more. Use a more specific path or pattern to narrow results.)`)), { - content: v.join(` -`), - count: m.length, - path: s, - truncated: _ - }; -} -function buildRipgrepCommand$1(e) { - return [ - `rg --files --hidden`, - `--glob '!.git/*'`, - `--glob ${shellQuote(e.pattern)}`, - `-- ${shellQuote(e.normalizedPath)}` - ].join(` `); -} -function buildPosixFindCommand(e) { - let t = translateGlobToFindPattern(e.pattern), r = t.includes(`/`) ? `-path ${shellQuote(`*/${t}`)}` : `-name ${shellQuote(t)}`; - return [ - `find ${shellQuote(e.normalizedPath)}`, - `-type f`, - `-not -path '*/.git/*'`, - r - ].join(` `); -} -function translateGlobToFindPattern(e) { - let t = e.replaceAll(`**`, `*`); - for (; t.startsWith(`*/`);) t = t.slice(2); - return t; -} -function buildGlobExecutionError(e, t, n) { - let r = n.trim(), i = r.length > 0 ? r : `no stderr output`; - return Error(`glob failed (exit ${t}): ${i}\nCommand: ${e}`); -} -//#endregion -//#region node_modules/eve/dist/src/runtime/framework-tools/glob.js -const GLOB_INPUT_SCHEMA = { - additionalProperties: !1, - properties: { - limit: { - description: `Maximum number of results to return. Defaults to 100.`, - maximum: 1e3, - minimum: 1, - type: `integer` - }, - path: { - description: `The directory to search in. Defaults to /workspace. Must be an absolute path. Omit to use the default.`, - type: `string` - }, - pattern: { - description: `The glob pattern to match files against (e.g. "**/*.ts", "src/**/*.js").`, - type: `string` - } - }, - required: [`pattern`], - type: `object` -}; -const GLOB_OUTPUT_SCHEMA = { - additionalProperties: !1, - properties: { - content: { type: `string` }, - count: { type: `integer` }, - path: { type: `string` }, - truncated: { type: `boolean` } - }, - required: [ - `content`, - `count`, - `path`, - `truncated` - ], - type: `object` -}; -async function executeGlob(e) { - return executeGlobOnSandbox(await requireSandboxSession(), e); -} -const GLOB_TOOL_DEFINITION = { - description: [ - `Fast file pattern matching tool that works with any codebase size.`, - ``, - `Usage:`, - `- Supports glob patterns like "**/*.js" or "src/**/*.ts".`, - `- Returns matching file paths.`, - `- Use this tool when you need to find files by name patterns.`, - `- If you are unsure of the correct file path, use the glob tool to look up filenames by glob pattern.`, - `- Use the grep tool instead if you need to search file contents.`, - `- Call this tool in parallel when you know there are multiple patterns to search for.` - ].join(` -`), - execute: executeGlob, - inputSchema: GLOB_INPUT_SCHEMA, - logicalPath: `eve:framework/glob`, - name: `glob`, - outputSchema: GLOB_OUTPUT_SCHEMA, - sourceId: `eve:glob-tool`, - sourceKind: `module` -}; -//#endregion -//#region node_modules/eve/dist/src/execution/sandbox/grep-tool.js -async function executeGrepOnSandbox(t, n) { - let r = n.path ?? `/workspace`; - validateAbsoluteFilePath(r); - let o = normalizeModelPath(r), s = Math.min(Math.max(1, n.limit ?? 100), 1e3), c = n.context !== void 0 && n.context > 0 ? n.context : 0, l = await ripgrepIsAvailable(t) ? buildRipgrepCommand({ - contextLines: c, - effectiveLimit: s, - glob: n.glob, - ignoreCase: n.ignoreCase ?? !1, - literal: n.literal ?? !1, - normalizedPath: o, - pattern: n.pattern - }) : buildPosixGrepCommand({ - contextLines: c, - effectiveLimit: s, - glob: n.glob, - ignoreCase: n.ignoreCase ?? !1, - literal: n.literal ?? !1, - normalizedPath: o, - pattern: n.pattern - }), u = await t.run({ command: l }); - if (u.exitCode !== 0 && u.exitCode !== 1) throw buildGrepExecutionError(l, u.exitCode, u.stderr); - let d = u.stdout; - return d.trim().length === 0 ? { - content: `No matches found`, - matchCount: 0, - path: o, - truncated: !1 - } : processOutput({ - effectiveLimit: s, - normalizedPath: o, - stdout: d - }); -} -function buildRipgrepCommand(e) { - let t = [ - `rg`, - `--line-number`, - `--color=never`, - `--hidden`, - `--glob '!.git/*'` - ]; - return e.ignoreCase && t.push(`--ignore-case`), e.literal && t.push(`--fixed-strings`), e.glob !== void 0 && t.push(`--glob ${shellQuote(e.glob)}`), e.contextLines > 0 && t.push(`--context ${e.contextLines}`), t.push(`--max-count ${e.effectiveLimit}`), t.push(`--`), t.push(shellQuote(e.pattern)), t.push(shellQuote(e.normalizedPath)), t.join(` `); -} -function buildPosixGrepCommand(e) { - let t = [ - `grep`, - `-r`, - `-n`, - `--color=never`, - `--exclude-dir=.git` - ]; - return e.ignoreCase && t.push(`-i`), e.literal ? t.push(`-F`) : t.push(`-E`), e.glob !== void 0 && t.push(`--include=${shellQuote(e.glob)}`), e.contextLines > 0 && t.push(`-C ${e.contextLines}`), t.push(`-m ${e.effectiveLimit}`), t.push(`--`), t.push(shellQuote(e.pattern)), t.push(shellQuote(e.normalizedPath)), t.join(` `); -} -function processOutput(e) { - let r = e.stdout.split(` -`), i = [], a = 0, o = 0, s = !1; - for (let e = 0; e < r.length; e += 1) { - let c = r[e] ?? ``; - if (c.length === 0 && e === r.length - 1) continue; - c !== `--` && c.length > 0 && /^.+:\d+:/.test(c) && o++; - let l = capLineLength(c), u = Buffer.byteLength(l, `utf8`) + 1; - if (a + u > 51200 && i.length > 0) { - s = !0; - break; - } - i.push(l), a += u; - } - let c = s || o >= e.effectiveLimit, l = i.join(` -`); - if (c) { - let t = []; - o >= e.effectiveLimit && t.push(`Match limit reached (${e.effectiveLimit}). Use a larger limit or more specific pattern.`), s && t.push(`Output truncated due to size. Use a more specific path or pattern.`), l += `\n\n[${t.join(` `)}]`; - } - return { - content: l, - matchCount: o, - path: e.normalizedPath, - truncated: c - }; -} -function buildGrepExecutionError(e, t, n) { - let r = n.trim(), i = r.length > 0 ? r : `no stderr output`; - return Error(`grep failed (exit ${t}): ${i}\nCommand: ${e}`); -} -//#endregion -//#region node_modules/eve/dist/src/runtime/framework-tools/grep.js -const GREP_INPUT_SCHEMA = { - additionalProperties: !1, - properties: { - context: { - description: `Number of surrounding context lines to include before and after each match. Defaults to 0.`, - minimum: 0, - type: `integer` - }, - glob: { - description: `Filter files by glob pattern (e.g. "*.ts", "*.{ts,tsx}").`, - type: `string` - }, - ignoreCase: { - description: `Perform case-insensitive search. Defaults to false.`, - type: `boolean` - }, - limit: { - description: `Maximum number of matches to return per file. Defaults to 100.`, - maximum: 1e3, - minimum: 1, - type: `integer` - }, - literal: { - description: `Treat the pattern as a literal string instead of a regular expression. Defaults to false.`, - type: `boolean` - }, - path: { - description: `The directory or file to search in. Defaults to /workspace. Must be an absolute path. Omit to use the default.`, - type: `string` - }, - pattern: { - description: `The regex pattern to search for in file contents (e.g. "log.*Error", "function\\s+\\w+").`, - type: `string` - } - }, - required: [`pattern`], - type: `object` -}; -const GREP_OUTPUT_SCHEMA = { - additionalProperties: !1, - properties: { - content: { type: `string` }, - matchCount: { type: `integer` }, - path: { type: `string` }, - truncated: { type: `boolean` } - }, - required: [ - `content`, - `matchCount`, - `path`, - `truncated` - ], - type: `object` -}; -async function executeGrep(e) { - return executeGrepOnSandbox(await requireSandboxSession(), e); -} -const GREP_TOOL_DEFINITION = { - description: [ - `Fast content search tool that works with any codebase size.`, - ``, - `Usage:`, - `- Searches file contents using regular expressions.`, - `- Supports full regex syntax (e.g. "log.*Error", "function\\s+\\w+").`, - `- Filter files by pattern with the glob parameter (e.g. "*.js", "*.{ts,tsx}").`, - `- Returns matching lines with file paths and line numbers.`, - `- Use this tool when you need to find files containing specific patterns.`, - `- Use the glob tool instead if you only need to find files by name.`, - `- Call this tool in parallel when you have multiple independent searches.`, - `- Any line longer than 2000 characters is truncated.` - ].join(` -`), - execute: executeGrep, - inputSchema: GREP_INPUT_SCHEMA, - logicalPath: `eve:framework/grep`, - name: `grep`, - outputSchema: GREP_OUTPUT_SCHEMA, - sourceId: `eve:grep-tool`, - sourceKind: `module` -}; -//#endregion -//#region node_modules/eve/dist/src/execution/sandbox/read-file-tool.js -async function executeReadFileOnSandbox(r, i) { - let { filePath: a, offset: o, limit: s } = i; - validateAbsoluteFilePath(a); - let c = normalizeModelPath(a), l = o ?? 1, u = s ?? 2e3; - if (l < 1) throw Error(`offset must be >= 1. Received: ${l}.`); - let d = await r.readTextFile({ path: a }); - if (d === null) throw Error(`File not found: ${a}. Verify the path exists and is accessible in the sandbox.`); - if (d.includes(`\0`)) throw Error(`File "${a}" contains NUL bytes and appears to be a binary file. read_file only supports text files.`); - let f = d.split(` -`), p = f.length > 0 && f[f.length - 1] === `` ? f.length - 1 : f.length; - if (p === 0) { - if (l > 1) throw Error(`offset ${l} is past the end of the file (0 lines). Use the default offset to read an empty file.`); - } else if (l > p) throw Error(`offset ${l} is past the end of the file (${p} lines).`); - let m = createReadFileStamp({ - content: d, - filePath: c - }), h = buildReadFileTargetKey(c); - if (setReadFileStamp(loadContext(), h, m), p === 0) return { - content: ``, - path: c, - totalLines: 0, - truncated: !1 - }; - let g = l - 1, _ = Math.min(g + u, p), v = f.slice(g, _), y = [], b = 0, x = !1; - for (let e = 0; e < v.length; e++) { - let t = `${l + e}: ${capLineLength(v[e] ?? ``)}`, n = Buffer.byteLength(t, `utf8`) + 1; - if (b + n > 51200 && y.length > 0) { - x = !0; - break; - } - y.push(t), b += n; - } - let S = y.join(` -`), C = l + y.length - 1; - return C < p || x ? { - content: S, - nextOffset: C + 1, - path: c, - totalLines: p, - truncated: !0 - } : { - content: S, - path: c, - totalLines: p, - truncated: !1 - }; -} -//#endregion -//#region node_modules/eve/dist/src/runtime/framework-tools/read-file.js -const READ_FILE_INPUT_SCHEMA = { - additionalProperties: !1, - properties: { - filePath: { - description: `The absolute path to the file to read.`, - type: `string` - }, - limit: { - description: `Maximum number of lines to return. Defaults to 2000.`, - minimum: 1, - type: `integer` - }, - offset: { - description: `1-based line number to start from. Defaults to 1.`, - minimum: 1, - type: `integer` - } - }, - required: [`filePath`], - type: `object` -}; -const READ_FILE_OUTPUT_SCHEMA = { - additionalProperties: !1, - properties: { - content: { type: `string` }, - nextOffset: { - minimum: 1, - type: `integer` - }, - path: { type: `string` }, - totalLines: { - minimum: 0, - type: `integer` - }, - truncated: { type: `boolean` } - }, - required: [ - `content`, - `path`, - `totalLines`, - `truncated` - ], - type: `object` -}; -async function executeReadFile(e) { - return executeReadFileOnSandbox(await requireSandboxSession(), e); -} -const READ_FILE_TOOL_DEFINITION = { - description: [ - `Read a file from the local filesystem. If the path does not exist, an error is returned.`, - ``, - `Usage:`, - `- The filePath parameter should be an absolute path.`, - `- By default, this tool returns up to 2000 lines from the start of the file.`, - `- The offset parameter is the line number to start from (1-indexed).`, - `- To read later sections, call this tool again with a larger offset.`, - `- Use the grep tool to find specific content in large files or files with long lines.`, - `- If you are unsure of the correct file path, use the glob tool to look up filenames by glob pattern.`, - "- Contents are returned with each line prefixed by its line number as `: `. For example, if a file has contents \"foo\\n\", you will receive \"1: foo\\n\".", - `- Any line longer than 2000 characters is truncated.`, - `- Call this tool in parallel when you know there are multiple files you want to read.`, - `- Avoid tiny repeated slices (30 line chunks). If you need more context, read a larger window.` - ].join(` -`), - execute: executeReadFile, - inputSchema: READ_FILE_INPUT_SCHEMA, - logicalPath: `eve:framework/read-file`, - name: `read_file`, - outputSchema: READ_FILE_OUTPUT_SCHEMA, - sourceId: `eve:read-file-tool`, - sourceKind: `module` -}; -//#endregion -//#region node_modules/eve/dist/src/runtime/framework-tools/skill.js -async function executeLoadSkillTool(e) { - let r = loadContext(), i = r.get(SandboxKey); - if (i === void 0) throw Error(`The load_skill tool requires sandbox access on the runtime context. Ensure the step is running inside a managed runtime context with sandbox support.`); - let { skill: a } = e, o = availableSkillNames(r); - try { - return await loadSkillFromSandbox(i, a, o); - } catch (e) { - let t = r.get(ConnectionRegistryKey)?.getConnectionNames().find((e) => e.toLowerCase() === a.toLowerCase()); - if (t === void 0 || o.includes(a)) throw e; - let n = e instanceof Error ? e.message : String(e); - throw Error(`${n} "${t}" is an installed connection, not a skill. Use connection_search with connection "${t}" to find its tools.`, { cause: e }); - } -} -function availableSkillNames(t) { - let n = Object.values(t.get(DynamicSkillManifestKey) ?? {}).flat().map((e) => e.name); - return [...new Set(n)].sort(); -} -const SKILL_OUTPUT_SCHEMA = { type: `string` }; -const SKILL_TOOL_DEFINITION = { - description: [ - `Load the full instructions for one available skill by name or id.`, - `Use this tool when the request clearly matches a listed skill description or when the user explicitly asks for that skill.`, - `This is not for MCP connections; use connection_search to access an installed connection.`, - `Loading adds the skill instructions to the current turn.`, - `Choose the "skill" value from the Available skills block.` - ].join(` `), - execute: (e) => executeLoadSkillTool(e), - inputSchema: { - additionalProperties: !1, - properties: { skill: { - description: `Available skill name or id.`, - type: `string` - } }, - required: [`skill`], - type: `object` - }, - logicalPath: `eve:framework/load-skill`, - name: `load_skill`, - outputSchema: SKILL_OUTPUT_SCHEMA, - sourceId: `eve:load-skill-tool`, - sourceKind: `module` -}; -//#endregion -//#region node_modules/eve/dist/src/compiled/turndown/index.js -var e$2 = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports); -var t$7 = e$2(((e, t) => { - t.exports = n, n.CAPTURING_PHASE = 1, n.AT_TARGET = 2, n.BUBBLING_PHASE = 3; - function n(e, t) { - if (this.type = ``, this.target = null, this.currentTarget = null, this.eventPhase = n.AT_TARGET, this.bubbles = !1, this.cancelable = !1, this.isTrusted = !1, this.defaultPrevented = !1, this.timeStamp = Date.now(), this._propagationStopped = !1, this._immediatePropagationStopped = !1, this._initialized = !0, this._dispatching = !1, e && (this.type = e), t) for (var r in t) this[r] = t[r]; - } - n.prototype = Object.create(Object.prototype, { - constructor: { value: n }, - stopPropagation: { value: function() { - this._propagationStopped = !0; - } }, - stopImmediatePropagation: { value: function() { - this._propagationStopped = !0, this._immediatePropagationStopped = !0; - } }, - preventDefault: { value: function() { - this.cancelable && (this.defaultPrevented = !0); - } }, - initEvent: { value: function(e, t, n) { - this._initialized = !0, !this._dispatching && (this._propagationStopped = !1, this._immediatePropagationStopped = !1, this.defaultPrevented = !1, this.isTrusted = !1, this.target = null, this.type = e, this.bubbles = t, this.cancelable = n); - } } - }); -})); -var n$8 = e$2(((e, n) => { - var r = t$7(); - n.exports = i; - function i() { - r.call(this), this.view = null, this.detail = 0; - } - i.prototype = Object.create(r.prototype, { - constructor: { value: i }, - initUIEvent: { value: function(e, t, n, r, i) { - this.initEvent(e, t, n), this.view = r, this.detail = i; - } } - }); -})); -var r$11 = e$2(((e, t) => { - var r = n$8(); - t.exports = i; - function i() { - r.call(this), this.screenX = this.screenY = this.clientX = this.clientY = 0, this.ctrlKey = this.altKey = this.shiftKey = this.metaKey = !1, this.button = 0, this.buttons = 1, this.relatedTarget = null; - } - i.prototype = Object.create(r.prototype, { - constructor: { value: i }, - initMouseEvent: { value: function(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m) { - switch (this.initEvent(e, t, n, r, i), this.screenX = a, this.screenY = o, this.clientX = s, this.clientY = c, this.ctrlKey = l, this.altKey = u, this.shiftKey = d, this.metaKey = f, this.button = p, p) { - case 0: - this.buttons = 1; - break; - case 1: - this.buttons = 4; - break; - case 2: - this.buttons = 2; - break; - default: - this.buttons = 0; - break; - } - this.relatedTarget = m; - } }, - getModifierState: { value: function(e) { - switch (e) { - case `Alt`: return this.altKey; - case `Control`: return this.ctrlKey; - case `Shift`: return this.shiftKey; - case `Meta`: return this.metaKey; - default: return !1; - } - } } - }); -})); -var i$9 = e$2(((e, t) => { - t.exports = E; - var n = 1, r = 3, i = 4, a = 5, o = 7, s = 8, c = 9, l = 11, u = 12, d = 13, f = 14, p = 15, m = 17, h = 18, g = 19, _ = 20, v = 21, y = 22, b = 23, x = 24, S = 25, C = [ - null, - `INDEX_SIZE_ERR`, - null, - `HIERARCHY_REQUEST_ERR`, - `WRONG_DOCUMENT_ERR`, - `INVALID_CHARACTER_ERR`, - null, - `NO_MODIFICATION_ALLOWED_ERR`, - `NOT_FOUND_ERR`, - `NOT_SUPPORTED_ERR`, - `INUSE_ATTRIBUTE_ERR`, - `INVALID_STATE_ERR`, - `SYNTAX_ERR`, - `INVALID_MODIFICATION_ERR`, - `NAMESPACE_ERR`, - `INVALID_ACCESS_ERR`, - null, - `TYPE_MISMATCH_ERR`, - `SECURITY_ERR`, - `NETWORK_ERR`, - `ABORT_ERR`, - `URL_MISMATCH_ERR`, - `QUOTA_EXCEEDED_ERR`, - `TIMEOUT_ERR`, - `INVALID_NODE_TYPE_ERR`, - `DATA_CLONE_ERR` - ], w = [ - null, - `INDEX_SIZE_ERR (1): the index is not in the allowed range`, - null, - `HIERARCHY_REQUEST_ERR (3): the operation would yield an incorrect nodes model`, - `WRONG_DOCUMENT_ERR (4): the object is in the wrong Document, a call to importNode is required`, - `INVALID_CHARACTER_ERR (5): the string contains invalid characters`, - null, - `NO_MODIFICATION_ALLOWED_ERR (7): the object can not be modified`, - `NOT_FOUND_ERR (8): the object can not be found here`, - `NOT_SUPPORTED_ERR (9): this operation is not supported`, - `INUSE_ATTRIBUTE_ERR (10): setAttributeNode called on owned Attribute`, - `INVALID_STATE_ERR (11): the object is in an invalid state`, - `SYNTAX_ERR (12): the string did not match the expected pattern`, - `INVALID_MODIFICATION_ERR (13): the object can not be modified in this way`, - `NAMESPACE_ERR (14): the operation is not allowed by Namespaces in XML`, - `INVALID_ACCESS_ERR (15): the object does not support the operation or argument`, - null, - `TYPE_MISMATCH_ERR (17): the type of the object does not match the expected type`, - `SECURITY_ERR (18): the operation is insecure`, - `NETWORK_ERR (19): a network error occurred`, - `ABORT_ERR (20): the user aborted an operation`, - `URL_MISMATCH_ERR (21): the given URL does not match another URL`, - `QUOTA_EXCEEDED_ERR (22): the quota has been exceeded`, - `TIMEOUT_ERR (23): a timeout occurred`, - `INVALID_NODE_TYPE_ERR (24): the supplied node is invalid or has an invalid ancestor for this operation`, - `DATA_CLONE_ERR (25): the object can not be cloned.` - ], T = { - INDEX_SIZE_ERR: n, - DOMSTRING_SIZE_ERR: 2, - HIERARCHY_REQUEST_ERR: r, - WRONG_DOCUMENT_ERR: i, - INVALID_CHARACTER_ERR: a, - NO_DATA_ALLOWED_ERR: 6, - NO_MODIFICATION_ALLOWED_ERR: o, - NOT_FOUND_ERR: s, - NOT_SUPPORTED_ERR: c, - INUSE_ATTRIBUTE_ERR: 10, - INVALID_STATE_ERR: l, - SYNTAX_ERR: u, - INVALID_MODIFICATION_ERR: d, - NAMESPACE_ERR: f, - INVALID_ACCESS_ERR: p, - VALIDATION_ERR: 16, - TYPE_MISMATCH_ERR: m, - SECURITY_ERR: h, - NETWORK_ERR: g, - ABORT_ERR: _, - URL_MISMATCH_ERR: v, - QUOTA_EXCEEDED_ERR: y, - TIMEOUT_ERR: b, - INVALID_NODE_TYPE_ERR: x, - DATA_CLONE_ERR: S - }; - function E(e) { - Error.call(this), Error.captureStackTrace(this, this.constructor), this.code = e, this.message = w[e], this.name = C[e]; - } - for (var D in E.prototype.__proto__ = Error.prototype, T) { - var ee = { value: T[D] }; - Object.defineProperty(E, D, ee), Object.defineProperty(E.prototype, D, ee); - } -})); -var a$8 = e$2(((e) => { - e.isApiWritable = !globalThis.__domino_frozen__; -})); -var o$8 = e$2(((e) => { - var t = i$9(), n = t, r = a$8().isApiWritable; - e.NAMESPACE = { - HTML: `http://www.w3.org/1999/xhtml`, - XML: `http://www.w3.org/XML/1998/namespace`, - XMLNS: `http://www.w3.org/2000/xmlns/`, - MATHML: `http://www.w3.org/1998/Math/MathML`, - SVG: `http://www.w3.org/2000/svg`, - XLINK: `http://www.w3.org/1999/xlink` - }, e.IndexSizeError = function() { - throw new t(n.INDEX_SIZE_ERR); - }, e.HierarchyRequestError = function() { - throw new t(n.HIERARCHY_REQUEST_ERR); - }, e.WrongDocumentError = function() { - throw new t(n.WRONG_DOCUMENT_ERR); - }, e.InvalidCharacterError = function() { - throw new t(n.INVALID_CHARACTER_ERR); - }, e.NoModificationAllowedError = function() { - throw new t(n.NO_MODIFICATION_ALLOWED_ERR); - }, e.NotFoundError = function() { - throw new t(n.NOT_FOUND_ERR); - }, e.NotSupportedError = function() { - throw new t(n.NOT_SUPPORTED_ERR); - }, e.InvalidStateError = function() { - throw new t(n.INVALID_STATE_ERR); - }, e.SyntaxError = function() { - throw new t(n.SYNTAX_ERR); - }, e.InvalidModificationError = function() { - throw new t(n.INVALID_MODIFICATION_ERR); - }, e.NamespaceError = function() { - throw new t(n.NAMESPACE_ERR); - }, e.InvalidAccessError = function() { - throw new t(n.INVALID_ACCESS_ERR); - }, e.TypeMismatchError = function() { - throw new t(n.TYPE_MISMATCH_ERR); - }, e.SecurityError = function() { - throw new t(n.SECURITY_ERR); - }, e.NetworkError = function() { - throw new t(n.NETWORK_ERR); - }, e.AbortError = function() { - throw new t(n.ABORT_ERR); - }, e.UrlMismatchError = function() { - throw new t(n.URL_MISMATCH_ERR); - }, e.QuotaExceededError = function() { - throw new t(n.QUOTA_EXCEEDED_ERR); - }, e.TimeoutError = function() { - throw new t(n.TIMEOUT_ERR); - }, e.InvalidNodeTypeError = function() { - throw new t(n.INVALID_NODE_TYPE_ERR); - }, e.DataCloneError = function() { - throw new t(n.DATA_CLONE_ERR); - }, e.nyi = function() { - throw Error(`NotYetImplemented`); - }, e.shouldOverride = function() { - throw Error(`Abstract function; should be overriding in subclass.`); - }, e.assert = function(e, t) { - if (!e) throw Error(`Assertion failed: ` + (t || ``) + ` -` + Error().stack); - }, e.expose = function(e, t) { - for (var n in e) Object.defineProperty(t.prototype, n, { - value: e[n], - writable: r - }); - }, e.merge = function(e, t) { - for (var n in t) e[n] = t[n]; - }, e.documentOrder = function(e, t) { - return 3 - (e.compareDocumentPosition(t) & 6); - }, e.toASCIILowerCase = function(e) { - return e.replace(/[A-Z]+/g, function(e) { - return e.toLowerCase(); - }); - }, e.toASCIIUpperCase = function(e) { - return e.replace(/[a-z]+/g, function(e) { - return e.toUpperCase(); - }); - }; -})); -var s$6 = e$2(((e, n) => { - var i = t$7(), a = r$11(), s = o$8(); - n.exports = c; - function c() {} - c.prototype = { - addEventListener: function(e, t, n) { - if (t) { - n === void 0 && (n = !1), this._listeners ||= Object.create(null), this._listeners[e] || (this._listeners[e] = []); - for (var r = this._listeners[e], i = 0, a = r.length; i < a; i++) { - var o = r[i]; - if (o.listener === t && o.capture === n) return; - } - var s = { - listener: t, - capture: n - }; - typeof t == `function` && (s.f = t), r.push(s); - } - }, - removeEventListener: function(e, t, n) { - if (n === void 0 && (n = !1), this._listeners) { - var r = this._listeners[e]; - if (r) for (var i = 0, a = r.length; i < a; i++) { - var o = r[i]; - if (o.listener === t && o.capture === n) { - r.length === 1 ? this._listeners[e] = void 0 : r.splice(i, 1); - return; - } - } - } - }, - dispatchEvent: function(e) { - return this._dispatchEvent(e, !1); - }, - _dispatchEvent: function(e, t) { - typeof t != `boolean` && (t = !1); - function n(e, t) { - var n = t.type, r = t.eventPhase; - if (t.currentTarget = e, r !== i.CAPTURING_PHASE && e._handlers && e._handlers[n]) { - var a = e._handlers[n], o; - if (typeof a == `function`) o = a.call(t.currentTarget, t); - else { - var s = a.handleEvent; - if (typeof s != `function`) throw TypeError(`handleEvent property of event handler object isnot a function.`); - o = s.call(a, t); - } - switch (t.type) { - case `mouseover`: - o === !0 && t.preventDefault(); - break; - default: - o === !1 && t.preventDefault(); - break; - } - } - var c = e._listeners && e._listeners[n]; - if (c) { - c = c.slice(); - for (var l = 0, u = c.length; l < u; l++) { - if (t._immediatePropagationStopped) return; - var d = c[l]; - if (!(r === i.CAPTURING_PHASE && !d.capture || r === i.BUBBLING_PHASE && d.capture)) if (d.f) d.f.call(t.currentTarget, t); - else { - var f = d.listener.handleEvent; - if (typeof f != `function`) throw TypeError(`handleEvent property of event listener object is not a function.`); - f.call(d.listener, t); - } - } - } - } - (!e._initialized || e._dispatching) && s.InvalidStateError(), e.isTrusted = t, e._dispatching = !0, e.target = this; - for (var r = [], o = this.parentNode; o; o = o.parentNode) r.push(o); - e.eventPhase = i.CAPTURING_PHASE; - for (var c = r.length - 1; c >= 0 && (n(r[c], e), !e._propagationStopped); c--); - if (e._propagationStopped || (e.eventPhase = i.AT_TARGET, n(this, e)), e.bubbles && !e._propagationStopped) { - e.eventPhase = i.BUBBLING_PHASE; - for (var l = 0, u = r.length; l < u && (n(r[l], e), !e._propagationStopped); l++); - } - if (e._dispatching = !1, e.eventPhase = i.AT_TARGET, e.currentTarget = null, t && !e.defaultPrevented && e instanceof a) switch (e.type) { - case `mousedown`: - this._armed = { - x: e.clientX, - y: e.clientY, - t: e.timeStamp - }; - break; - case `mouseout`: - case `mouseover`: - this._armed = null; - break; - case `mouseup`: - this._isClick(e) && this._doClick(e), this._armed = null; - break; - } - return !e.defaultPrevented; - }, - _isClick: function(e) { - return this._armed !== null && e.type === `mouseup` && e.isTrusted && e.button === 0 && e.timeStamp - this._armed.t < 1e3 && Math.abs(e.clientX - this._armed.x) < 10 && Math.abs(e.clientY - this._armed.Y) < 10; - }, - _doClick: function(e) { - if (!this._click_in_progress) { - this._click_in_progress = !0; - for (var t = this; t && !t._post_click_activation_steps;) t = t.parentNode; - t && t._pre_click_activation_steps && t._pre_click_activation_steps(); - var n = this.ownerDocument.createEvent(`MouseEvent`); - n.initMouseEvent(`click`, !0, !0, this.ownerDocument.defaultView, 1, e.screenX, e.screenY, e.clientX, e.clientY, e.ctrlKey, e.altKey, e.shiftKey, e.metaKey, e.button, null); - var r = this._dispatchEvent(n, !0); - t && (r ? t._post_click_activation_steps && t._post_click_activation_steps(n) : t._cancelled_activation_steps && t._cancelled_activation_steps()); - } - }, - _setEventHandler: function(e, t) { - this._handlers ||= Object.create(null), this._handlers[e] = t; - }, - _getEventHandler: function(e) { - return this._handlers && this._handlers[e] || null; - } - }; -})); -var c$7 = e$2(((e, t) => { - var n = o$8(), r = t.exports = { - valid: function(e) { - return n.assert(e, `list falsy`), n.assert(e._previousSibling, `previous falsy`), n.assert(e._nextSibling, `next falsy`), !0; - }, - insertBefore: function(e, t) { - n.assert(r.valid(e) && r.valid(t)); - var i = e, a = e._previousSibling, o = t, s = t._previousSibling; - i._previousSibling = s, a._nextSibling = o, s._nextSibling = i, o._previousSibling = a, n.assert(r.valid(e) && r.valid(t)); - }, - replace: function(e, t) { - n.assert(r.valid(e) && (t === null || r.valid(t))), t !== null && r.insertBefore(t, e), r.remove(e), n.assert(r.valid(e) && (t === null || r.valid(t))); - }, - remove: function(e) { - n.assert(r.valid(e)); - var t = e._previousSibling; - if (t !== e) { - var i = e._nextSibling; - t._nextSibling = i, i._previousSibling = t, e._previousSibling = e._nextSibling = e, n.assert(r.valid(e)); - } - } - }; -})); -var l$6 = e$2(((e, t) => { - t.exports = { - serializeOne: _, - ɵescapeMatchingClosingTag: p, - ɵescapeClosingCommentTag: h, - ɵescapeProcessingInstructionContent: g - }; - var n = o$8(), r = n.NAMESPACE, i = { - STYLE: !0, - SCRIPT: !0, - XMP: !0, - IFRAME: !0, - NOEMBED: !0, - NOFRAMES: !0, - PLAINTEXT: !0 - }, a = { - area: !0, - base: !0, - basefont: !0, - bgsound: !0, - br: !0, - col: !0, - embed: !0, - frame: !0, - hr: !0, - img: !0, - input: !0, - keygen: !0, - link: !0, - meta: !0, - param: !0, - source: !0, - track: !0, - wbr: !0 - }, s = {}; - let c = /[&<>\u00A0]/g, l = /[&"<>\u00A0]/g; - function u(e) { - return c.test(e) ? e.replace(c, (e) => { - switch (e) { - case `&`: return `&`; - case `<`: return `<`; - case `>`: return `>`; - case `\xA0`: return ` `; - } - }) : e; - } - function d(e) { - return l.test(e) ? e.replace(l, (e) => { - switch (e) { - case `<`: return `<`; - case `>`: return `>`; - case `&`: return `&`; - case `"`: return `"`; - case `\xA0`: return ` `; - } - }) : e; - } - function f(e) { - var t = e.namespaceURI; - return t ? t === r.XML ? `xml:` + e.localName : t === r.XLINK ? `xlink:` + e.localName : t === r.XMLNS ? e.localName === `xmlns` ? `xmlns` : `xmlns:` + e.localName : e.name : e.localName; - } - function p(e, t) { - let n = `/; - function h(e) { - return m.test(e) ? e.replace(/(--\!?)>/g, `$1>`) : e; - } - function g(e) { - return e.includes(`>`) ? e.replaceAll(`>`, `>`) : e; - } - function _(e, t) { - var o = ``; - switch (e.nodeType) { - case 1: - var c = e.namespaceURI, l = c === r.HTML, m = l || c === r.SVG || c === r.MATHML ? e.localName : e.tagName; - o += `<` + m; - for (var _ = 0, v = e._numattrs; _ < v; _++) { - var y = e._attr(_); - o += ` ` + f(y), y.value !== void 0 && (o += `="` + d(y.value) + `"`); - } - if (o += `>`, !(l && a[m])) { - var b = e.serialize(); - i[m.toUpperCase()] && (b = p(b, m)), l && s[m] && b.charAt(0) === ` -` && (o += ` -`), o += b, o += ``; - } - break; - case 3: - case 4: - var x = t.nodeType === 1 && t.namespaceURI === r.HTML ? t.tagName : ``; - i[x] || x === `NOSCRIPT` && t.ownerDocument._scripting_enabled ? o += e.data : o += u(e.data); - break; - case 8: - o += ``; - break; - case 7: - let S = g(e.data); - o += ``; - break; - case 10: - o += ``; - break; - default: n.InvalidStateError(); - } - return o; - } -})); -var u$8 = e$2(((e, t) => { - t.exports = u; - var n = s$6(), r = c$7(), i = l$6(), a = o$8(); - function u() { - n.call(this), this.parentNode = null, this._nextSibling = this._previousSibling = this, this._index = void 0; - } - var d = u.ELEMENT_NODE = 1, f = u.ATTRIBUTE_NODE = 2, p = u.TEXT_NODE = 3, m = u.CDATA_SECTION_NODE = 4, h = u.ENTITY_REFERENCE_NODE = 5, g = u.ENTITY_NODE = 6, _ = u.PROCESSING_INSTRUCTION_NODE = 7, v = u.COMMENT_NODE = 8, y = u.DOCUMENT_NODE = 9, b = u.DOCUMENT_TYPE_NODE = 10, x = u.DOCUMENT_FRAGMENT_NODE = 11, S = u.NOTATION_NODE = 12, C = u.DOCUMENT_POSITION_DISCONNECTED = 1, w = u.DOCUMENT_POSITION_PRECEDING = 2, T = u.DOCUMENT_POSITION_FOLLOWING = 4, E = u.DOCUMENT_POSITION_CONTAINS = 8, D = u.DOCUMENT_POSITION_CONTAINED_BY = 16, ee = u.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 32; - u.prototype = Object.create(n.prototype, { - baseURI: { get: a.nyi }, - parentElement: { get: function() { - return this.parentNode && this.parentNode.nodeType === d ? this.parentNode : null; - } }, - hasChildNodes: { value: a.shouldOverride }, - firstChild: { get: a.shouldOverride }, - lastChild: { get: a.shouldOverride }, - isConnected: { get: function() { - let e = this; - for (; e != null;) { - if (e.nodeType === u.DOCUMENT_NODE) return !0; - e = e.parentNode, e != null && e.nodeType === u.DOCUMENT_FRAGMENT_NODE && (e = e.host); - } - return !1; - } }, - previousSibling: { get: function() { - var e = this.parentNode; - return !e || this === e.firstChild ? null : this._previousSibling; - } }, - nextSibling: { get: function() { - var e = this.parentNode, t = this._nextSibling; - return !e || t === e.firstChild ? null : t; - } }, - textContent: { - get: function() { - return null; - }, - set: function(e) {} - }, - innerText: { - get: function() { - return null; - }, - set: function(e) {} - }, - _countChildrenOfType: { value: function(e) { - for (var t = 0, n = this.firstChild; n !== null; n = n.nextSibling) n.nodeType === e && t++; - return t; - } }, - _ensureInsertValid: { value: function(e, t, n) { - var r = this, i, o; - if (!e.nodeType) throw TypeError(`not a node`); - switch (r.nodeType) { - case y: - case x: - case d: break; - default: a.HierarchyRequestError(); - } - switch (e.isAncestor(r) && a.HierarchyRequestError(), (t !== null || !n) && t.parentNode !== r && a.NotFoundError(), e.nodeType) { - case x: - case b: - case d: - case p: - case _: - case v: break; - default: a.HierarchyRequestError(); - } - if (r.nodeType === y) switch (e.nodeType) { - case p: - a.HierarchyRequestError(); - break; - case x: - switch (e._countChildrenOfType(p) > 0 && a.HierarchyRequestError(), e._countChildrenOfType(d)) { - case 0: break; - case 1: - if (t !== null) for (n && t.nodeType === b && a.HierarchyRequestError(), o = t.nextSibling; o !== null; o = o.nextSibling) o.nodeType === b && a.HierarchyRequestError(); - i = r._countChildrenOfType(d), n ? i > 0 && a.HierarchyRequestError() : (i > 1 || i === 1 && t.nodeType !== d) && a.HierarchyRequestError(); - break; - default: a.HierarchyRequestError(); - } - break; - case d: - if (t !== null) for (n && t.nodeType === b && a.HierarchyRequestError(), o = t.nextSibling; o !== null; o = o.nextSibling) o.nodeType === b && a.HierarchyRequestError(); - i = r._countChildrenOfType(d), n ? i > 0 && a.HierarchyRequestError() : (i > 1 || i === 1 && t.nodeType !== d) && a.HierarchyRequestError(); - break; - case b: - if (t === null) r._countChildrenOfType(d) && a.HierarchyRequestError(); - else for (o = r.firstChild; o !== null && o !== t; o = o.nextSibling) o.nodeType === d && a.HierarchyRequestError(); - i = r._countChildrenOfType(b), n ? i > 0 && a.HierarchyRequestError() : (i > 1 || i === 1 && t.nodeType !== b) && a.HierarchyRequestError(); - break; - } - else e.nodeType === b && a.HierarchyRequestError(); - } }, - insertBefore: { value: function(e, t) { - var n = this; - n._ensureInsertValid(e, t, !0); - var r = t; - return r === e && (r = e.nextSibling), n.doc.adoptNode(e), e._insertOrReplace(n, r, !1), e; - } }, - appendChild: { value: function(e) { - return this.insertBefore(e, null); - } }, - _appendChild: { value: function(e) { - e._insertOrReplace(this, null, !1); - } }, - removeChild: { value: function(e) { - var t = this; - if (!e.nodeType) throw TypeError(`not a node`); - return e.parentNode !== t && a.NotFoundError(), e.remove(), e; - } }, - replaceChild: { value: function(e, t) { - var n = this; - return n._ensureInsertValid(e, t, !1), e.doc !== n.doc && n.doc.adoptNode(e), e._insertOrReplace(n, t, !0), t; - } }, - contains: { value: function(e) { - return e === null ? !1 : this === e ? !0 : (this.compareDocumentPosition(e) & D) !== 0; - } }, - compareDocumentPosition: { value: function(e) { - if (this === e) return 0; - if (this.doc !== e.doc || this.rooted !== e.rooted) return C + ee; - for (var t = [], n = [], r = this; r !== null; r = r.parentNode) t.push(r); - for (r = e; r !== null; r = r.parentNode) n.push(r); - if (t.reverse(), n.reverse(), t[0] !== n[0]) return C + ee; - r = Math.min(t.length, n.length); - for (var i = 1; i < r; i++) if (t[i] !== n[i]) return t[i].index < n[i].index ? T : w; - return t.length < n.length ? T + D : w + E; - } }, - isSameNode: { value: function(e) { - return this === e; - } }, - isEqualNode: { value: function(e) { - if (!e || e.nodeType !== this.nodeType || !this.isEqual(e)) return !1; - for (var t = this.firstChild, n = e.firstChild; t && n; t = t.nextSibling, n = n.nextSibling) if (!t.isEqualNode(n)) return !1; - return t === null && n === null; - } }, - cloneNode: { value: function(e) { - var t = this.clone(); - if (e) for (var n = this.firstChild; n !== null; n = n.nextSibling) t._appendChild(n.cloneNode(!0)); - return t; - } }, - lookupPrefix: { value: function(e) { - var t; - if (e === `` || e == null) return null; - switch (this.nodeType) { - case d: return this._lookupNamespacePrefix(e, this); - case y: return t = this.documentElement, t ? t.lookupPrefix(e) : null; - case g: - case S: - case x: - case b: return null; - case f: return t = this.ownerElement, t ? t.lookupPrefix(e) : null; - default: return t = this.parentElement, t ? t.lookupPrefix(e) : null; - } - } }, - lookupNamespaceURI: { value: function(e) { - (e === `` || e === void 0) && (e = null); - var t; - switch (this.nodeType) { - case d: return a.shouldOverride(); - case y: return t = this.documentElement, t ? t.lookupNamespaceURI(e) : null; - case g: - case S: - case b: - case x: return null; - case f: return t = this.ownerElement, t ? t.lookupNamespaceURI(e) : null; - default: return t = this.parentElement, t ? t.lookupNamespaceURI(e) : null; - } - } }, - isDefaultNamespace: { value: function(e) { - return (e === `` || e === void 0) && (e = null), this.lookupNamespaceURI(null) === e; - } }, - index: { get: function() { - var e = this.parentNode; - if (this === e.firstChild) return 0; - var t = e.childNodes; - if (this._index === void 0 || t[this._index] !== this) { - for (var n = 0; n < t.length; n++) t[n]._index = n; - a.assert(t[this._index] === this); - } - return this._index; - } }, - isAncestor: { value: function(e) { - if (this.doc !== e.doc || this.rooted !== e.rooted) return !1; - for (var t = e; t; t = t.parentNode) if (t === this) return !0; - return !1; - } }, - ensureSameDoc: { value: function(e) { - e.ownerDocument === null ? e.ownerDocument = this.doc : e.ownerDocument !== this.doc && a.WrongDocumentError(); - } }, - removeChildren: { value: a.shouldOverride }, - _insertOrReplace: { value: function(e, t, n) { - var i = this, o, s; - i.nodeType === x && i.rooted && a.HierarchyRequestError(), e._childNodes && (o = t === null ? e._childNodes.length : t.index, i.parentNode === e && i.index < o && o--), n && (t.rooted && t.doc.mutateRemove(t), t.parentNode = null); - var c = t; - c === null && (c = e.firstChild); - var l = i.rooted && e.rooted; - if (i.nodeType === x) { - for (var u = [0, +!!n], d, f = i.firstChild; f !== null; f = d) d = f.nextSibling, u.push(f), f.parentNode = e; - var p = u.length; - if (n ? r.replace(c, p > 2 ? u[2] : null) : p > 2 && c !== null && r.insertBefore(u[2], c), e._childNodes) for (u[0] = t === null ? e._childNodes.length : t._index, e._childNodes.splice.apply(e._childNodes, u), s = 2; s < p; s++) u[s]._index = u[0] + (s - 2); - else e._firstChild === t && (p > 2 ? e._firstChild = u[2] : n && (e._firstChild = null)); - if (i._childNodes ? i._childNodes.length = 0 : i._firstChild = null, e.rooted) for (e.modify(), s = 2; s < p; s++) e.doc.mutateInsert(u[s]); - } else { - if (t === i) return; - l ? i._remove() : i.parentNode && i.remove(), i.parentNode = e, n ? (r.replace(c, i), e._childNodes ? (i._index = o, e._childNodes[o] = i) : e._firstChild === t && (e._firstChild = i)) : (c !== null && r.insertBefore(i, c), e._childNodes ? (i._index = o, e._childNodes.splice(o, 0, i)) : e._firstChild === t && (e._firstChild = i)), l ? (e.modify(), e.doc.mutateMove(i)) : e.rooted && (e.modify(), e.doc.mutateInsert(i)); - } - } }, - lastModTime: { get: function() { - return this._lastModTime ||= this.doc.modclock, this._lastModTime; - } }, - modify: { value: function() { - if (this.doc.modclock) for (var e = ++this.doc.modclock, t = this; t; t = t.parentElement) t._lastModTime &&= e; - } }, - doc: { get: function() { - return this.ownerDocument || this; - } }, - rooted: { get: function() { - return !!this._nid; - } }, - normalize: { value: function() { - for (var e, t = this.firstChild; t !== null; t = e) if (e = t.nextSibling, t.normalize && t.normalize(), t.nodeType === u.TEXT_NODE) { - if (t.nodeValue === ``) { - this.removeChild(t); - continue; - } - var n = t.previousSibling; - n !== null && n.nodeType === u.TEXT_NODE && (n.appendData(t.nodeValue), this.removeChild(t)); - } - } }, - serialize: { value: function() { - if (this._innerHTML) return this._innerHTML; - for (var e = ``, t = this.firstChild; t !== null; t = t.nextSibling) e += i.serializeOne(t, this); - return e; - } }, - outerHTML: { - get: function() { - return i.serializeOne(this, { nodeType: 0 }); - }, - set: a.nyi - }, - ELEMENT_NODE: { value: d }, - ATTRIBUTE_NODE: { value: f }, - TEXT_NODE: { value: p }, - CDATA_SECTION_NODE: { value: m }, - ENTITY_REFERENCE_NODE: { value: h }, - ENTITY_NODE: { value: g }, - PROCESSING_INSTRUCTION_NODE: { value: _ }, - COMMENT_NODE: { value: v }, - DOCUMENT_NODE: { value: y }, - DOCUMENT_TYPE_NODE: { value: b }, - DOCUMENT_FRAGMENT_NODE: { value: x }, - NOTATION_NODE: { value: S }, - DOCUMENT_POSITION_DISCONNECTED: { value: C }, - DOCUMENT_POSITION_PRECEDING: { value: w }, - DOCUMENT_POSITION_FOLLOWING: { value: T }, - DOCUMENT_POSITION_CONTAINS: { value: E }, - DOCUMENT_POSITION_CONTAINED_BY: { value: D }, - DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: { value: ee } - }); -})); -var d$8 = e$2(((e, t) => { - t.exports = class extends Array { - constructor(e) { - if (super(e && e.length || 0), e) for (var t in e) this[t] = e[t]; - } - item(e) { - return this[e] || null; - } - }; -})); -var f$7 = e$2(((e, t) => { - function n(e) { - return this[e] || null; - } - function r(e) { - return e ||= [], e.item = n, e; - } - t.exports = r; -})); -var p$10 = e$2(((e, t) => { - var n; - try { - n = d$8(); - } catch { - n = f$7(); - } - t.exports = n; -})); -var m$7 = e$2(((e, t) => { - t.exports = i; - var n = u$8(), r = p$10(); - function i() { - n.call(this), this._firstChild = this._childNodes = null; - } - i.prototype = Object.create(n.prototype, { - hasChildNodes: { value: function() { - return this._childNodes ? this._childNodes.length > 0 : this._firstChild !== null; - } }, - childNodes: { get: function() { - return this._ensureChildNodes(), this._childNodes; - } }, - firstChild: { get: function() { - return this._childNodes ? this._childNodes.length === 0 ? null : this._childNodes[0] : this._firstChild; - } }, - lastChild: { get: function() { - var e = this._childNodes, t; - return e ? e.length === 0 ? null : e[e.length - 1] : (t = this._firstChild, t === null ? null : t._previousSibling); - } }, - _ensureChildNodes: { value: function() { - if (!this._childNodes) { - var e = this._firstChild, t = e, n = this._childNodes = new r(); - if (e) do - n.push(t), t = t._nextSibling; - while (t !== e); - this._firstChild = null; - } - } }, - removeChildren: { value: function() { - for (var e = this.rooted ? this.ownerDocument : null, t = this.firstChild, n; t !== null;) n = t, t = n.nextSibling, e && e.mutateRemove(n), n.parentNode = null; - this._childNodes ? this._childNodes.length = 0 : this._firstChild = null, this.modify(); - } } - }); -})); -var h$8 = e$2(((e) => { - e.isValidName = h, e.isValidQName = g; - var t = /^[_:A-Za-z][-.:\w]+$/, n = /^([_A-Za-z][-.\w]+|[_A-Za-z][-.\w]+:[_A-Za-z][-.\w]+)$/, r = `_A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�`, i = `-._A-Za-z0-9·À-ÖØ-öø-˿̀-ͽͿ-῿‌‍‿⁀⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�`, a = `[` + r + `][` + i + `]*`, o = r + `:`, s = i + `:`, c = RegExp(`^[` + o + `][` + s + `]*$`), l = RegExp(`^(` + a + `|` + a + `:` + a + `)$`), u = /[\uD800-\uDB7F\uDC00-\uDFFF]/, d = /[\uD800-\uDB7F\uDC00-\uDFFF]/g, f = /[\uD800-\uDB7F][\uDC00-\uDFFF]/g; - r += `\ud800-󯰀-\udfff`, i += `\ud800-󯰀-\udfff`, a = `[` + r + `][` + i + `]*`, o = r + `:`, s = i + `:`; - var p = RegExp(`^[` + o + `][` + s + `]*$`), m = RegExp(`^(` + a + `|` + a + `:` + a + `)$`); - function h(e) { - if (t.test(e) || c.test(e)) return !0; - if (!u.test(e) || !p.test(e)) return !1; - var n = e.match(d), r = e.match(f); - return r !== null && 2 * r.length === n.length; - } - function g(e) { - if (n.test(e) || l.test(e)) return !0; - if (!u.test(e) || !m.test(e)) return !1; - var t = e.match(d), r = e.match(f); - return r !== null && 2 * r.length === t.length; - } -})); -var g$7 = e$2(((e) => { - var t = o$8(); - e.property = function(e) { - if (Array.isArray(e.type)) { - var t = Object.create(null); - e.type.forEach(function(e) { - t[e.value || e] = e.alias || e; - }); - var r = e.missing; - r === void 0 && (r = null); - var i = e.invalid; - return i === void 0 && (i = r), { - get: function() { - var n = this._getattr(e.name); - return n === null ? r : (n = t[n.toLowerCase()], n === void 0 ? i === null ? n : i : n); - }, - set: function(t) { - this._setattr(e.name, t); - } - }; - } else if (e.type === Boolean) return { - get: function() { - return this.hasAttribute(e.name); - }, - set: function(t) { - t ? this._setattr(e.name, ``) : this.removeAttribute(e.name); - } - }; - else if (e.type === Number || e.type === `long` || e.type === `unsigned long` || e.type === `limited unsigned long with fallback`) return n(e); - else if (!e.type || e.type === String) return { - get: function() { - return this._getattr(e.name) || ``; - }, - set: function(t) { - e.treatNullAsEmptyString && t === null && (t = ``), this._setattr(e.name, t); - } - }; - else if (typeof e.type == `function`) return e.type(e.name, e); - throw Error(`Invalid attribute definition`); - }; - function n(e) { - var n = typeof e.default == `function` ? e.default : typeof e.default == `number` ? function() { - return e.default; - } : function() { - t.assert(!1, typeof e.default); - }, r = e.type === `unsigned long`, i = e.type === `long`, a = e.type === `limited unsigned long with fallback`, o = e.min, s = e.max, c = e.setmin; - return o === void 0 && (r && (o = 0), i && (o = -2147483648), a && (o = 1)), s === void 0 && (r || i || a) && (s = 2147483647), { - get: function() { - var t = this._getattr(e.name), c = e.float ? parseFloat(t) : parseInt(t, 10); - if (t === null || !isFinite(c) || o !== void 0 && c < o || s !== void 0 && c > s) return n.call(this); - if (r || i || a) { - if (!/^[ \t\n\f\r]*[-+]?[0-9]/.test(t)) return n.call(this); - c |= 0; - } - return c; - }, - set: function(o) { - e.float || (o = Math.floor(o)), c !== void 0 && o < c && t.IndexSizeError(e.name + ` set to ` + o), r ? o = o < 0 || o > 2147483647 ? n.call(this) : o | 0 : a ? o = o < 1 || o > 2147483647 ? n.call(this) : o | 0 : i && (o = o < -2147483648 || o > 2147483647 ? n.call(this) : o | 0), this._setattr(e.name, String(o)); - } - }; - } - e.registerChangeHandler = function(e, t, n) { - var r = e.prototype; - Object.prototype.hasOwnProperty.call(r, `_attributeChangeHandlers`) || (r._attributeChangeHandlers = Object.create(r._attributeChangeHandlers || null)), r._attributeChangeHandlers[t] = n; - }; -})); -var _$6 = e$2(((e, t) => { - t.exports = r; - var n = u$8(); - function r(e, t) { - this.root = e, this.filter = t, this.lastModTime = e.lastModTime, this.done = !1, this.cache = [], this.traverse(); - } - r.prototype = Object.create(Object.prototype, { - length: { get: function() { - return this.checkcache(), this.done || this.traverse(), this.cache.length; - } }, - item: { value: function(e) { - return this.checkcache(), !this.done && e >= this.cache.length && this.traverse(), this.cache[e]; - } }, - checkcache: { value: function() { - if (this.lastModTime !== this.root.lastModTime) { - for (var e = this.cache.length - 1; e >= 0; e--) this[e] = void 0; - this.cache.length = 0, this.done = !1, this.lastModTime = this.root.lastModTime; - } - } }, - traverse: { value: function(e) { - e !== void 0 && e++; - for (var t; (t = this.next()) !== null;) if (this[this.cache.length] = t, this.cache.push(t), e && this.cache.length === e) return; - this.done = !0; - } }, - next: { value: function() { - for (var e = this.cache.length === 0 ? this.root : this.cache[this.cache.length - 1], t = e.nodeType === n.DOCUMENT_NODE ? e.documentElement : e.nextElement(this.root); t;) { - if (this.filter(t)) return t; - t = t.nextElement(this.root); - } - return null; - } } - }); -})); -var v$7 = e$2(((e, t) => { - var n = o$8(); - t.exports = r; - function r(e, t) { - this._getString = e, this._setString = t, this._length = 0, this._lastStringValue = ``, this._update(); - } - Object.defineProperties(r.prototype, { - length: { get: function() { - return this._length; - } }, - item: { value: function(e) { - var t = c(this); - return e < 0 || e >= t.length ? null : t[e]; - } }, - contains: { value: function(e) { - return e = String(e), c(this).indexOf(e) > -1; - } }, - add: { value: function() { - for (var e = c(this), t = 0, n = arguments.length; t < n; t++) { - var r = a(arguments[t]); - e.indexOf(r) < 0 && e.push(r); - } - this._update(e); - } }, - remove: { value: function() { - for (var e = c(this), t = 0, n = arguments.length; t < n; t++) { - var r = a(arguments[t]), i = e.indexOf(r); - i > -1 && e.splice(i, 1); - } - this._update(e); - } }, - toggle: { value: function(e, t) { - return e = a(e), this.contains(e) ? t === void 0 || t === !1 ? (this.remove(e), !1) : !0 : t === void 0 || t === !0 ? (this.add(e), !0) : !1; - } }, - replace: { value: function(e, t) { - String(t) === `` && n.SyntaxError(), e = a(e), t = a(t); - var r = c(this), i = r.indexOf(e); - if (i < 0) return !1; - var o = r.indexOf(t); - return o < 0 ? r[i] = t : i < o ? (r[i] = t, r.splice(o, 1)) : r.splice(i, 1), this._update(r), !0; - } }, - toString: { value: function() { - return this._getString(); - } }, - value: { - get: function() { - return this._getString(); - }, - set: function(e) { - this._setString(e), this._update(); - } - }, - _update: { value: function(e) { - e ? (i(this, e), this._setString(e.join(` `).trim())) : i(this, c(this)), this._lastStringValue = this._getString(); - } } - }); - function i(e, t) { - var n = e._length, r; - for (e._length = t.length, r = 0; r < t.length; r++) e[r] = t[r]; - for (; r < n; r++) e[r] = void 0; - } - function a(e) { - return e = String(e), e === `` && n.SyntaxError(), /[ \t\r\n\f]/.test(e) && n.InvalidCharacterError(), e; - } - function s(e) { - for (var t = e._length, n = Array(t), r = 0; r < t; r++) n[r] = e[r]; - return n; - } - function c(e) { - var t = e._getString(); - if (t === e._lastStringValue) return s(e); - var n = t.replace(/(^[ \t\r\n\f]+)|([ \t\r\n\f]+$)/g, ``); - if (n === ``) return []; - var r = Object.create(null); - return n.split(/[ \t\r\n\f]+/g).filter(function(e) { - var t = `$` + e; - return r[t] ? !1 : (r[t] = !0, !0); - }); - } -})); -var y$5 = e$2(((e, t) => { - var n = Object.create(null, { location: { get: function() { - throw Error(`window.location is not supported.`); - } } }), r = function(e, t) { - return e.compareDocumentPosition(t); - }, i = function(e, t) { - return r(e, t) & 2 ? 1 : -1; - }, a = function(e) { - for (; (e = e.nextSibling) && e.nodeType !== 1;); - return e; - }, o = function(e) { - for (; (e = e.previousSibling) && e.nodeType !== 1;); - return e; - }, s = function(e) { - if (e = e.firstChild) for (; e.nodeType !== 1 && (e = e.nextSibling);); - return e; - }, c = function(e) { - if (e = e.lastChild) for (; e.nodeType !== 1 && (e = e.previousSibling);); - return e; - }, l = function(e) { - if (!e.parentNode) return !1; - var t = e.parentNode.nodeType; - return t === 1 || t === 9; - }, u = function(e) { - if (!e) return e; - var t = e[0]; - return t === `"` || t === `'` ? (e = e[e.length - 1] === t ? e.slice(1, -1) : e.slice(1), e.replace(x.str_escape, function(e) { - var t = /^\\(?:([0-9A-Fa-f]+)|([\r\n\f]+))/.exec(e); - if (!t) return e.slice(1); - if (t[2]) return ``; - var n = parseInt(t[1], 16); - return String.fromCodePoint ? String.fromCodePoint(n) : String.fromCharCode(n); - })) : x.ident.test(e) ? d(e) : e; - }, d = function(e) { - return e.replace(x.escape, function(e) { - var t = /^\\([0-9A-Fa-f]+)/.exec(e); - if (!t) return e[1]; - var n = parseInt(t[1], 16); - return String.fromCodePoint ? String.fromCodePoint(n) : String.fromCharCode(n); - }); - }, f = (function() { - return Array.prototype.indexOf ? Array.prototype.indexOf : function(e, t) { - for (var n = this.length; n--;) if (this[n] === t) return n; - return -1; - }; - })(), p = function(e, t) { - var n = x.inside.source.replace(//g, t); - return new RegExp(n); - }, m = function(e, t, n) { - return e = e.source, e = e.replace(t, n.source || n), new RegExp(e); - }, h = function(e, t) { - return e.replace(/^(?:\w+:\/\/|\/+)/, ``).replace(/(?:\/+|\/*#.*?)$/, ``).split(`/`, t).join(`/`); - }, g = function(e, t) { - var n = e.replace(/\s+/g, ``), r; - return n === `even` ? n = `2n+0` : n === `odd` ? n = `2n+1` : n.indexOf(`n`) === -1 && (n = `0n` + n), r = /^([+-])?(\d+)?n([+-])?(\d+)?$/.exec(n), { - group: r[1] === `-` ? -(r[2] || 1) : +(r[2] || 1), - offset: r[4] ? r[3] === `-` ? -r[4] : +r[4] : 0 - }; - }, _ = function(e, t, n) { - var r = g(e), i = r.group, u = r.offset, d = n ? c : s, f = n ? o : a; - return function(e) { - if (l(e)) for (var n = d(e.parentNode), r = 0; n;) { - if (t(n, e) && r++, n === e) return r -= u, i && r ? r % i === 0 && r < 0 == i < 0 : !r; - n = f(n); - } - }; - }, v = { - "*": (function() { - return function() { - return !0; - }; - })(), - type: function(e) { - return e = e.toLowerCase(), function(t) { - return t.nodeName.toLowerCase() === e; - }; - }, - attr: function(e, t, n, r) { - return t = y[t], function(i) { - var a; - switch (e) { - case `for`: - a = i.htmlFor; - break; - case `class`: - a = i.className, a === `` && i.getAttribute(`class`) == null && (a = null); - break; - case `href`: - case `src`: - a = i.getAttribute(e, 2); - break; - case `title`: - a = i.getAttribute(`title`) || null; - break; - case `id`: - case `lang`: - case `dir`: - case `accessKey`: - case `hidden`: - case `tabIndex`: - case `style`: if (i.getAttribute) { - a = i.getAttribute(e); - break; - } - default: - if (i.hasAttribute && !i.hasAttribute(e)) break; - a = i[e] == null ? i.getAttribute && i.getAttribute(e) : i[e]; - break; - } - if (a != null) return a += ``, r && (a = a.toLowerCase(), n = n.toLowerCase()), t(a, n); - }; - }, - ":first-child": function(e) { - return !o(e) && l(e); - }, - ":last-child": function(e) { - return !a(e) && l(e); - }, - ":only-child": function(e) { - return !o(e) && !a(e) && l(e); - }, - ":nth-child": function(e, t) { - return _(e, function() { - return !0; - }, t); - }, - ":nth-last-child": function(e) { - return v[`:nth-child`](e, !0); - }, - ":root": function(e) { - return e.ownerDocument.documentElement === e; - }, - ":empty": function(e) { - return !e.firstChild; - }, - ":not": function(e) { - var t = D(e); - return function(e) { - return !t(e); - }; - }, - ":first-of-type": function(e) { - if (l(e)) { - for (var t = e.nodeName; e = o(e);) if (e.nodeName === t) return; - return !0; - } - }, - ":last-of-type": function(e) { - if (l(e)) { - for (var t = e.nodeName; e = a(e);) if (e.nodeName === t) return; - return !0; - } - }, - ":only-of-type": function(e) { - return v[`:first-of-type`](e) && v[`:last-of-type`](e); - }, - ":nth-of-type": function(e, t) { - return _(e, function(e, t) { - return e.nodeName === t.nodeName; - }, t); - }, - ":nth-last-of-type": function(e) { - return v[`:nth-of-type`](e, !0); - }, - ":checked": function(e) { - return !!(e.checked || e.selected); - }, - ":indeterminate": function(e) { - return !v[`:checked`](e); - }, - ":enabled": function(e) { - return !e.disabled && e.type !== `hidden`; - }, - ":disabled": function(e) { - return !!e.disabled; - }, - ":target": function(e) { - return e.id === n.location.hash.substring(1); - }, - ":focus": function(e) { - return e === e.ownerDocument.activeElement; - }, - ":is": function(e) { - return D(e); - }, - ":matches": function(e) { - return v[`:is`](e); - }, - ":nth-match": function(e, t) { - var n = e.split(/\s*,\s*/); - return _(n.shift(), D(n.join(`,`)), t); - }, - ":nth-last-match": function(e) { - return v[`:nth-match`](e, !0); - }, - ":links-here": function(e) { - return e + `` == n.location + ``; - }, - ":lang": function(e) { - return function(t) { - for (; t;) { - if (t.lang) return t.lang.indexOf(e) === 0; - t = t.parentNode; - } - }; - }, - ":dir": function(e) { - return function(t) { - for (; t;) { - if (t.dir) return t.dir === e; - t = t.parentNode; - } - }; - }, - ":scope": function(e, t) { - var n = t || e.ownerDocument; - return n.nodeType === 9 ? e === n.documentElement : e === n; - }, - ":any-link": function(e) { - return typeof e.href == `string`; - }, - ":local-link": function(e) { - if (e.nodeName) return e.href && e.host === n.location.host; - var t = +e + 1; - return function(e) { - if (e.href) { - var r = n.location + ``, i = e + ``; - return h(r, t) === h(i, t); - } - }; - }, - ":default": function(e) { - return !!e.defaultSelected; - }, - ":valid": function(e) { - return e.willValidate || e.validity && e.validity.valid; - }, - ":invalid": function(e) { - return !v[`:valid`](e); - }, - ":in-range": function(e) { - return e.value > e.min && e.value <= e.max; - }, - ":out-of-range": function(e) { - return !v[`:in-range`](e); - }, - ":required": function(e) { - return !!e.required; - }, - ":optional": function(e) { - return !e.required; - }, - ":read-only": function(e) { - if (e.readOnly) return !0; - var t = e.getAttribute(`contenteditable`), n = e.contentEditable, r = e.nodeName.toLowerCase(); - return r = r !== `input` && r !== `textarea`, (r || e.disabled) && t == null && n !== `true`; - }, - ":read-write": function(e) { - return !v[`:read-only`](e); - }, - ":hover": function() { - throw Error(`:hover is not supported.`); - }, - ":active": function() { - throw Error(`:active is not supported.`); - }, - ":link": function() { - throw Error(`:link is not supported.`); - }, - ":visited": function() { - throw Error(`:visited is not supported.`); - }, - ":column": function() { - throw Error(`:column is not supported.`); - }, - ":nth-column": function() { - throw Error(`:nth-column is not supported.`); - }, - ":nth-last-column": function() { - throw Error(`:nth-last-column is not supported.`); - }, - ":current": function() { - throw Error(`:current is not supported.`); - }, - ":past": function() { - throw Error(`:past is not supported.`); - }, - ":future": function() { - throw Error(`:future is not supported.`); - }, - ":contains": function(e) { - return function(t) { - return (t.innerText || t.textContent || t.value || ``).indexOf(e) !== -1; - }; - }, - ":has": function(e) { - return function(t) { - return ee(e, t).length > 0; - }; - } - }, y = { - "-": function() { - return !0; - }, - "=": function(e, t) { - return e === t; - }, - "*=": function(e, t) { - return e.indexOf(t) !== -1; - }, - "~=": function(e, t) { - var n, r, i, a; - for (r = 0;; r = n + 1) { - if (n = e.indexOf(t, r), n === -1) return !1; - if (i = e[n - 1], a = e[n + t.length], (!i || i === ` `) && (!a || a === ` `)) return !0; - } - }, - "|=": function(e, t) { - var n = e.indexOf(t), r; - if (n === 0) return r = e[n + t.length], r === `-` || !r; - }, - "^=": function(e, t) { - return e.indexOf(t) === 0; - }, - "$=": function(e, t) { - var n = e.lastIndexOf(t); - return n !== -1 && n + t.length === e.length; - }, - "!=": function(e, t) { - return e !== t; - } - }, b = { - " ": function(e) { - return function(t) { - for (; t = t.parentNode;) if (e(t)) return t; - }; - }, - ">": function(e) { - return function(t) { - if (t = t.parentNode) return e(t) && t; - }; - }, - "+": function(e) { - return function(t) { - if (t = o(t)) return e(t) && t; - }; - }, - "~": function(e) { - return function(t) { - for (; t = o(t);) if (e(t)) return t; - }; - }, - noop: function(e) { - return function(t) { - return e(t) && t; - }; - }, - ref: function(e, t) { - var n; - function r(e) { - for (var t = e.ownerDocument.getElementsByTagName(`*`), i = t.length; i--;) if (n = t[i], r.test(e)) return n = null, !0; - n = null; - } - return r.combinator = function(r) { - if (!(!n || !n.getAttribute)) { - var i = n.getAttribute(t) || ``; - if (i[0] === `#` && (i = i.substring(1)), i === r.id && e(n)) return n; - } - }, r; - } - }, x = { - escape: /\\(?:[^0-9A-Fa-f\r\n]|[0-9A-Fa-f]{1,6}[\r\n\t ]?)/g, - str_escape: /(escape)|\\(\n|\r\n?|\f)/g, - nonascii: /[\u00A0-\uFFFF]/, - cssid: /(?:(?!-?[0-9])(?:escape|nonascii|[-_a-zA-Z0-9])+)/, - qname: /^ *(cssid|\*)/, - simple: /^(?:([.#]cssid)|pseudo|attr)/, - ref: /^ *\/(cssid)\/ */, - combinator: /^(?: +([^ \w*.#\\]) +|( )+|([^ \w*.#\\]))(?! *$)/, - attr: /^\[(cssid)(?:([^\w]?=)(inside))?\]/, - pseudo: /^(:cssid)(?:\((inside)\))?/, - inside: /(?:"(?:\\"|[^"])*"|'(?:\\'|[^'])*'|<[^"'>]*>|\\["'>]|[^"'>])*/, - ident: /^(cssid)$/ - }; - x.cssid = m(x.cssid, `nonascii`, x.nonascii), x.cssid = m(x.cssid, `escape`, x.escape), x.qname = m(x.qname, `cssid`, x.cssid), x.simple = m(x.simple, `cssid`, x.cssid), x.ref = m(x.ref, `cssid`, x.cssid), x.attr = m(x.attr, `cssid`, x.cssid), x.pseudo = m(x.pseudo, `cssid`, x.cssid), x.inside = m(x.inside, `[^"'>]*`, x.inside), x.attr = m(x.attr, `inside`, p(`\\[`, `\\]`)), x.pseudo = m(x.pseudo, `inside`, p(`\\(`, `\\)`)), x.simple = m(x.simple, `pseudo`, x.pseudo), x.simple = m(x.simple, `attr`, x.attr), x.ident = m(x.ident, `cssid`, x.cssid), x.str_escape = m(x.str_escape, `escape`, x.escape); - var S = function(e) { - for (var t = e.replace(/^\s+|\s+$/g, ``), n, r = [], i = [], a, o, s, c, l; t;) { - if (s = x.qname.exec(t)) t = t.substring(s[0].length), o = d(s[1]), i.push(C(o, !0)); - else if (s = x.simple.exec(t)) t = t.substring(s[0].length), o = `*`, i.push(C(o, !0)), i.push(C(s)); - else throw SyntaxError(`Invalid selector.`); - for (; s = x.simple.exec(t);) t = t.substring(s[0].length), i.push(C(s)); - if (t[0] === `!` && (t = t.substring(1), a = E(), a.qname = o, i.push(a.simple)), s = x.ref.exec(t)) { - t = t.substring(s[0].length), l = b.ref(w(i), d(s[1])), r.push(l.combinator), i = []; - continue; - } - if (s = x.combinator.exec(t)) { - if (t = t.substring(s[0].length), c = s[1] || s[2] || s[3], c === `,`) { - r.push(b.noop(w(i))); - break; - } - } else c = `noop`; - if (!b[c]) throw SyntaxError(`Bad combinator.`); - r.push(b[c](w(i))), i = []; - } - return n = T(r), n.qname = o, n.sel = t, a && (a.lname = n.qname, a.test = n, a.qname = a.qname, a.sel = n.sel, n = a), l && (l.test = n, l.qname = n.qname, l.sel = n.sel, n = l), n; - }, C = function(e, t) { - if (t) return e === `*` ? v[`*`] : v.type(e); - if (e[1]) return e[1][0] === `.` ? v.attr(`class`, `~=`, d(e[1].substring(1)), !1) : v.attr(`id`, `=`, d(e[1].substring(1)), !1); - if (e[2]) return e[3] ? v[d(e[2])](u(e[3])) : v[d(e[2])]; - if (e[4]) { - var n = e[6], r = /["'\s]\s*I$/i.test(n); - return r && (n = n.replace(/\s*I$/i, ``)), v.attr(d(e[4]), e[5] || `-`, u(n), r); - } - throw SyntaxError(`Unknown Selector.`); - }, w = function(e) { - var t = e.length, n; - return t < 2 ? e[0] : function(r) { - if (r) { - for (n = 0; n < t; n++) if (!e[n](r)) return; - return !0; - } - }; - }, T = function(e) { - return e.length < 2 ? function(t) { - return !!e[0](t); - } : function(t) { - for (var n = e.length; n--;) if (!(t = e[n](t))) return; - return !0; - }; - }, E = function() { - var e; - function t(n) { - for (var r = n.ownerDocument.getElementsByTagName(t.lname), i = r.length; i--;) if (t.test(r[i]) && e === n) return e = null, !0; - e = null; - } - return t.simple = function(t) { - return e = t, !0; - }, t; - }, D = function(e) { - for (var t = S(e), n = [t]; t.sel;) t = S(t.sel), n.push(t); - return n.length < 2 ? t : function(e) { - for (var t = n.length, r = 0; r < t; r++) if (n[r](e)) return !0; - }; - }, ee = function(e, t) { - for (var n = [], r = S(e), a = t.getElementsByTagName(r.qname), o = 0, s; s = a[o++];) r(s) && n.push(s); - if (r.sel) { - for (; r.sel;) for (r = S(r.sel), a = t.getElementsByTagName(r.qname), o = 0; s = a[o++];) r(s) && f.call(n, s) === -1 && n.push(s); - n.sort(i); - } - return n; - }; - t.exports = e = function(e, t) { - var n, r; - if (t.nodeType !== 11 && e.indexOf(` `) === -1) { - if (e[0] === `#` && t.rooted && /^#[A-Z_][-A-Z0-9_]*$/i.test(e) && t.doc._hasMultipleElementsWithId && (n = e.substring(1), !t.doc._hasMultipleElementsWithId(n))) return r = t.doc.getElementById(n), r ? [r] : []; - if (e[0] === `.` && /^\.\w+$/.test(e)) return t.getElementsByClassName(e.substring(1)); - if (/^\w+$/.test(e)) return t.getElementsByTagName(e); - } - return ee(e, t); - }, e.selectors = v, e.operators = y, e.combinators = b, e.matches = function(e, t) { - var n = { sel: t }; - do - if (n = S(n.sel), n(e)) return !0; - while (n.sel); - return !1; - }; -})); -var b$7 = e$2(((e, t) => { - var n = u$8(), r = c$7(), i = function(e, t) { - for (var r = e.createDocumentFragment(), i = 0; i < t.length; i++) { - var a = t[i], o = a instanceof n; - r.appendChild(o ? a : e.createTextNode(String(a))); - } - return r; - }; - t.exports = { - after: { value: function() { - var e = Array.prototype.slice.call(arguments), t = this.parentNode, n = this.nextSibling; - if (t !== null) { - for (; n && e.some(function(e) { - return e === n; - });) n = n.nextSibling; - var r = i(this.doc, e); - t.insertBefore(r, n); - } - } }, - before: { value: function() { - var e = Array.prototype.slice.call(arguments), t = this.parentNode, n = this.previousSibling; - if (t !== null) { - for (; n && e.some(function(e) { - return e === n; - });) n = n.previousSibling; - var r = i(this.doc, e), a = n ? n.nextSibling : t.firstChild; - t.insertBefore(r, a); - } - } }, - remove: { value: function() { - this.parentNode !== null && (this.doc && (this.doc._preremoveNodeIterators(this), this.rooted && this.doc.mutateRemove(this)), this._remove(), this.parentNode = null); - } }, - _remove: { value: function() { - var e = this.parentNode; - e !== null && (e._childNodes ? e._childNodes.splice(this.index, 1) : e._firstChild === this && (this._nextSibling === this ? e._firstChild = null : e._firstChild = this._nextSibling), r.remove(this), e.modify()); - } }, - replaceWith: { value: function() { - var e = Array.prototype.slice.call(arguments), t = this.parentNode, n = this.nextSibling; - if (t !== null) { - for (; n && e.some(function(e) { - return e === n; - });) n = n.nextSibling; - var r = i(this.doc, e); - this.parentNode === t ? t.replaceChild(r, this) : t.insertBefore(r, n); - } - } } - }; -})); -var x$7 = e$2(((e, t) => { - var n = u$8(); - t.exports = { - nextElementSibling: { get: function() { - if (this.parentNode) { - for (var e = this.nextSibling; e !== null; e = e.nextSibling) if (e.nodeType === n.ELEMENT_NODE) return e; - } - return null; - } }, - previousElementSibling: { get: function() { - if (this.parentNode) { - for (var e = this.previousSibling; e !== null; e = e.previousSibling) if (e.nodeType === n.ELEMENT_NODE) return e; - } - return null; - } } - }; -})); -var S$8 = e$2(((e, t) => { - t.exports = r; - var n = o$8(); - function r(e) { - this.element = e; - } - Object.defineProperties(r.prototype, { - length: { get: n.shouldOverride }, - item: { value: n.shouldOverride }, - getNamedItem: { value: function(e) { - return this.element.getAttributeNode(e); - } }, - getNamedItemNS: { value: function(e, t) { - return this.element.getAttributeNodeNS(e, t); - } }, - setNamedItem: { value: n.nyi }, - setNamedItemNS: { value: n.nyi }, - removeNamedItem: { value: function(e) { - var t = this.element.getAttributeNode(e); - if (t) return this.element.removeAttribute(e), t; - n.NotFoundError(); - } }, - removeNamedItemNS: { value: function(e, t) { - var r = this.element.getAttributeNodeNS(e, t); - if (r) return this.element.removeAttributeNS(e, t), r; - n.NotFoundError(); - } } - }); -})); -var C$8 = e$2(((e, t) => { - t.exports = O; - var n = h$8(), r = o$8(), a = r.NAMESPACE, s = g$7(), c = u$8(), d = p$10(), f = l$6(), C = _$6(), w = i$9(), T = v$7(), E = y$5(), D = m$7(), ee = b$7(), te = x$7(), ne = S$8(), re = Object.create(null); - function O(e, t, n, r) { - D.call(this), this.nodeType = c.ELEMENT_NODE, this.ownerDocument = e, this.localName = t, this.namespaceURI = n, this.prefix = r, this._tagName = void 0, this._attrsByQName = Object.create(null), this._attrsByLName = Object.create(null), this._attrKeys = []; - } - function ie(e, t) { - if (e.nodeType === c.TEXT_NODE) t.push(e._data); - else for (var n = 0, r = e.childNodes.length; n < r; n++) ie(e.childNodes[n], t); - } - O.prototype = Object.create(D.prototype, { - isHTML: { get: function() { - return this.namespaceURI === a.HTML && this.ownerDocument.isHTML; - } }, - tagName: { get: function() { - if (this._tagName === void 0) { - var e = this.prefix === null ? this.localName : this.prefix + `:` + this.localName; - if (this.isHTML) { - var t = re[e]; - t || (re[e] = t = r.toASCIIUpperCase(e)), e = t; - } - this._tagName = e; - } - return this._tagName; - } }, - nodeName: { get: function() { - return this.tagName; - } }, - nodeValue: { - get: function() { - return null; - }, - set: function() {} - }, - textContent: { - get: function() { - var e = []; - return ie(this, e), e.join(``); - }, - set: function(e) { - this.removeChildren(), e != null && e !== `` && this._appendChild(this.ownerDocument.createTextNode(e)); - } - }, - innerText: { - get: function() { - var e = []; - return ie(this, e), e.join(``).replace(/[ \t\n\f\r]+/g, ` `).trim(); - }, - set: function(e) { - this.removeChildren(), e != null && e !== `` && this._appendChild(this.ownerDocument.createTextNode(e)); - } - }, - innerHTML: { - get: function() { - return this.serialize(); - }, - set: r.nyi - }, - outerHTML: { - get: function() { - return f.serializeOne(this, { nodeType: 0 }); - }, - set: function(e) { - var t = this.ownerDocument, n = this.parentNode; - if (n !== null) { - n.nodeType === c.DOCUMENT_NODE && r.NoModificationAllowedError(), n.nodeType === c.DOCUMENT_FRAGMENT_NODE && (n = n.ownerDocument.createElement(`body`)); - var i = t.implementation.mozHTMLParser(t._address, n); - i.parse(e === null ? `` : String(e), !0), this.replaceWith(i._asDocumentFragment()); - } - } - }, - _insertAdjacent: { value: function(e, t) { - var n = !1; - switch (e) { - case `beforebegin`: n = !0; - case `afterend`: - var i = this.parentNode; - return i === null ? null : i.insertBefore(t, n ? this : this.nextSibling); - case `afterbegin`: n = !0; - case `beforeend`: return this.insertBefore(t, n ? this.firstChild : null); - default: return r.SyntaxError(); - } - } }, - insertAdjacentElement: { value: function(e, t) { - if (t.nodeType !== c.ELEMENT_NODE) throw TypeError(`not an element`); - return e = r.toASCIILowerCase(String(e)), this._insertAdjacent(e, t); - } }, - insertAdjacentText: { value: function(e, t) { - var n = this.ownerDocument.createTextNode(t); - e = r.toASCIILowerCase(String(e)), this._insertAdjacent(e, n); - } }, - insertAdjacentHTML: { value: function(e, t) { - e = r.toASCIILowerCase(String(e)), t = String(t); - var n; - switch (e) { - case `beforebegin`: - case `afterend`: - n = this.parentNode, (n === null || n.nodeType === c.DOCUMENT_NODE) && r.NoModificationAllowedError(); - break; - case `afterbegin`: - case `beforeend`: - n = this; - break; - default: r.SyntaxError(); - } - (!(n instanceof O) || n.ownerDocument.isHTML && n.localName === `html` && n.namespaceURI === a.HTML) && (n = n.ownerDocument.createElementNS(a.HTML, `body`)); - var i = this.ownerDocument.implementation.mozHTMLParser(this.ownerDocument._address, n); - i.parse(t, !0), this._insertAdjacent(e, i._asDocumentFragment()); - } }, - children: { get: function() { - return this._children ||= new se(this), this._children; - } }, - attributes: { get: function() { - return this._attributes ||= new oe(this), this._attributes; - } }, - firstElementChild: { get: function() { - for (var e = this.firstChild; e !== null; e = e.nextSibling) if (e.nodeType === c.ELEMENT_NODE) return e; - return null; - } }, - lastElementChild: { get: function() { - for (var e = this.lastChild; e !== null; e = e.previousSibling) if (e.nodeType === c.ELEMENT_NODE) return e; - return null; - } }, - childElementCount: { get: function() { - return this.children.length; - } }, - nextElement: { value: function(e) { - e ||= this.ownerDocument.documentElement; - var t = this.firstElementChild; - if (!t) { - if (this === e) return null; - t = this.nextElementSibling; - } - if (t) return t; - for (var n = this.parentElement; n && n !== e; n = n.parentElement) if (t = n.nextElementSibling, t) return t; - return null; - } }, - getElementsByTagName: { value: function(e) { - var t; - return e ? (t = e === `*` ? function() { - return !0; - } : this.isHTML ? le(e) : ce(e), new C(this, t)) : new d(); - } }, - getElementsByTagNameNS: { value: function(e, t) { - var n = e === `*` && t === `*` ? function() { - return !0; - } : e === `*` ? ce(t) : t === `*` ? k(e) : A(e, t); - return new C(this, n); - } }, - getElementsByClassName: { value: function(e) { - return e = String(e).trim(), e === `` ? new d() : (e = e.split(/[ \t\r\n\f]+/), new C(this, j(e))); - } }, - getElementsByName: { value: function(e) { - return new C(this, M(String(e))); - } }, - clone: { value: function() { - for (var e = this.namespaceURI !== a.HTML || this.prefix || !this.ownerDocument.isHTML ? this.ownerDocument.createElementNS(this.namespaceURI, this.prefix === null ? this.localName : this.prefix + `:` + this.localName) : this.ownerDocument.createElement(this.localName), t = 0, n = this._attrKeys.length; t < n; t++) { - var r = this._attrKeys[t], i = this._attrsByLName[r].cloneNode(); - i._setOwnerElement(e), e._attrsByLName[r] = i, e._addQName(i); - } - return e._attrKeys = this._attrKeys.concat(), e; - } }, - isEqual: { value: function(e) { - if (this.localName !== e.localName || this.namespaceURI !== e.namespaceURI || this.prefix !== e.prefix || this._numattrs !== e._numattrs) return !1; - for (var t = 0, n = this._numattrs; t < n; t++) { - var r = this._attr(t); - if (!e.hasAttributeNS(r.namespaceURI, r.localName) || e.getAttributeNS(r.namespaceURI, r.localName) !== r.value) return !1; - } - return !0; - } }, - _lookupNamespacePrefix: { value: function(e, t) { - if (this.namespaceURI && this.namespaceURI === e && this.prefix !== null && t.lookupNamespaceURI(this.prefix) === e) return this.prefix; - for (var n = 0, r = this._numattrs; n < r; n++) { - var i = this._attr(n); - if (i.prefix === `xmlns` && i.value === e && t.lookupNamespaceURI(i.localName) === e) return i.localName; - } - var a = this.parentElement; - return a ? a._lookupNamespacePrefix(e, t) : null; - } }, - lookupNamespaceURI: { value: function(e) { - if ((e === `` || e === void 0) && (e = null), this.namespaceURI !== null && this.prefix === e) return this.namespaceURI; - for (var t = 0, n = this._numattrs; t < n; t++) { - var r = this._attr(t); - if (r.namespaceURI === a.XMLNS && (r.prefix === `xmlns` && r.localName === e || e === null && r.prefix === null && r.localName === `xmlns`)) return r.value || null; - } - var i = this.parentElement; - return i ? i.lookupNamespaceURI(e) : null; - } }, - getAttribute: { value: function(e) { - var t = this.getAttributeNode(e); - return t ? t.value : null; - } }, - getAttributeNS: { value: function(e, t) { - var n = this.getAttributeNodeNS(e, t); - return n ? n.value : null; - } }, - getAttributeNode: { value: function(e) { - e = String(e), /[A-Z]/.test(e) && this.isHTML && (e = r.toASCIILowerCase(e)); - var t = this._attrsByQName[e]; - return t ? (Array.isArray(t) && (t = t[0]), t) : null; - } }, - getAttributeNodeNS: { value: function(e, t) { - return e = e == null ? `` : String(e), t = String(t), this._attrsByLName[e + `|` + t] || null; - } }, - hasAttribute: { value: function(e) { - return e = String(e), /[A-Z]/.test(e) && this.isHTML && (e = r.toASCIILowerCase(e)), this._attrsByQName[e] !== void 0; - } }, - hasAttributeNS: { value: function(e, t) { - e = e == null ? `` : String(e), t = String(t); - var n = e + `|` + t; - return this._attrsByLName[n] !== void 0; - } }, - hasAttributes: { value: function() { - return this._numattrs > 0; - } }, - toggleAttribute: { value: function(e, t) { - return e = String(e), n.isValidName(e) || r.InvalidCharacterError(), /[A-Z]/.test(e) && this.isHTML && (e = r.toASCIILowerCase(e)), this._attrsByQName[e] === void 0 ? t === void 0 || t === !0 ? (this._setAttribute(e, ``), !0) : !1 : t === void 0 || t === !1 ? (this.removeAttribute(e), !1) : !0; - } }, - _setAttribute: { value: function(e, t) { - var n = this._attrsByQName[e], r; - n ? Array.isArray(n) && (n = n[0]) : (n = this._newattr(e), r = !0), n.value = t, this._attributes && (this._attributes[e] = n), r && this._newattrhook && this._newattrhook(e, t); - } }, - setAttribute: { value: function(e, t) { - e = String(e), n.isValidName(e) || r.InvalidCharacterError(), /[A-Z]/.test(e) && this.isHTML && (e = r.toASCIILowerCase(e)), this._setAttribute(e, String(t)); - } }, - _setAttributeNS: { value: function(e, t, n) { - var r = t.indexOf(`:`), i, a; - r < 0 ? (i = null, a = t) : (i = t.substring(0, r), a = t.substring(r + 1)), (e === `` || e === void 0) && (e = null); - var o = (e === null ? `` : e) + `|` + a, s = this._attrsByLName[o], c; - s || (s = new ae(this, a, i, e), c = !0, this._attrsByLName[o] = s, this._attributes && (this._attributes[this._attrKeys.length] = s), this._attrKeys.push(o), this._addQName(s)), s.value = n, c && this._newattrhook && this._newattrhook(t, n); - } }, - setAttributeNS: { value: function(e, t, i) { - e = e == null || e === `` ? null : String(e), t = String(t), n.isValidQName(t) || r.InvalidCharacterError(); - var o = t.indexOf(`:`), s = o < 0 ? null : t.substring(0, o); - (s !== null && e === null || s === `xml` && e !== a.XML || (t === `xmlns` || s === `xmlns`) && e !== a.XMLNS || e === a.XMLNS && !(t === `xmlns` || s === `xmlns`)) && r.NamespaceError(), this._setAttributeNS(e, t, String(i)); - } }, - setAttributeNode: { value: function(e) { - if (e.ownerElement !== null && e.ownerElement !== this) throw new w(w.INUSE_ATTRIBUTE_ERR); - var t = null, n = this._attrsByQName[e.name]; - if (n) { - if (Array.isArray(n) || (n = [n]), n.some(function(t) { - return t === e; - })) return e; - if (e.ownerElement !== null) throw new w(w.INUSE_ATTRIBUTE_ERR); - n.forEach(function(e) { - this.removeAttributeNode(e); - }, this), t = n[0]; - } - return this.setAttributeNodeNS(e), t; - } }, - setAttributeNodeNS: { value: function(e) { - if (e.ownerElement !== null) throw new w(w.INUSE_ATTRIBUTE_ERR); - var t = e.namespaceURI, n = (t === null ? `` : t) + `|` + e.localName, r = this._attrsByLName[n]; - return r && this.removeAttributeNode(r), e._setOwnerElement(this), this._attrsByLName[n] = e, this._attributes && (this._attributes[this._attrKeys.length] = e), this._attrKeys.push(n), this._addQName(e), this._newattrhook && this._newattrhook(e.name, e.value), r || null; - } }, - removeAttribute: { value: function(e) { - e = String(e), /[A-Z]/.test(e) && this.isHTML && (e = r.toASCIILowerCase(e)); - var t = this._attrsByQName[e]; - if (t) { - Array.isArray(t) ? t.length > 2 ? t = t.shift() : (this._attrsByQName[e] = t[1], t = t[0]) : this._attrsByQName[e] = void 0; - var n = t.namespaceURI, i = (n === null ? `` : n) + `|` + t.localName; - this._attrsByLName[i] = void 0; - var a = this._attrKeys.indexOf(i); - this._attributes && (Array.prototype.splice.call(this._attributes, a, 1), this._attributes[e] = void 0), this._attrKeys.splice(a, 1); - var o = t.onchange; - t._setOwnerElement(null), o && o.call(t, this, t.localName, t.value, null), this.rooted && this.ownerDocument.mutateRemoveAttr(t); - } - } }, - removeAttributeNS: { value: function(e, t) { - e = e == null ? `` : String(e), t = String(t); - var n = e + `|` + t, r = this._attrsByLName[n]; - if (r) { - this._attrsByLName[n] = void 0; - var i = this._attrKeys.indexOf(n); - this._attributes && Array.prototype.splice.call(this._attributes, i, 1), this._attrKeys.splice(i, 1), this._removeQName(r); - var a = r.onchange; - r._setOwnerElement(null), a && a.call(r, this, r.localName, r.value, null), this.rooted && this.ownerDocument.mutateRemoveAttr(r); - } - } }, - removeAttributeNode: { value: function(e) { - var t = e.namespaceURI, n = (t === null ? `` : t) + `|` + e.localName; - return this._attrsByLName[n] !== e && r.NotFoundError(), this.removeAttributeNS(t, e.localName), e; - } }, - getAttributeNames: { value: function() { - var e = this; - return this._attrKeys.map(function(t) { - return e._attrsByLName[t].name; - }); - } }, - _getattr: { value: function(e) { - var t = this._attrsByQName[e]; - return t ? t.value : null; - } }, - _setattr: { value: function(e, t) { - var n = this._attrsByQName[e], r; - n || (n = this._newattr(e), r = !0), n.value = String(t), this._attributes && (this._attributes[e] = n), r && this._newattrhook && this._newattrhook(e, t); - } }, - _newattr: { value: function(e) { - var t = new ae(this, e, null, null), n = `|` + e; - return this._attrsByQName[e] = t, this._attrsByLName[n] = t, this._attributes && (this._attributes[this._attrKeys.length] = t), this._attrKeys.push(n), t; - } }, - _addQName: { value: function(e) { - var t = e.name, n = this._attrsByQName[t]; - n ? Array.isArray(n) ? n.push(e) : this._attrsByQName[t] = [n, e] : this._attrsByQName[t] = e, this._attributes && (this._attributes[t] = e); - } }, - _removeQName: { value: function(e) { - var t = e.name, n = this._attrsByQName[t]; - if (Array.isArray(n)) { - var i = n.indexOf(e); - r.assert(i !== -1), n.length === 2 ? (this._attrsByQName[t] = n[1 - i], this._attributes && (this._attributes[t] = this._attrsByQName[t])) : (n.splice(i, 1), this._attributes && this._attributes[t] === e && (this._attributes[t] = n[0])); - } else r.assert(n === e), this._attrsByQName[t] = void 0, this._attributes && (this._attributes[t] = void 0); - } }, - _numattrs: { get: function() { - return this._attrKeys.length; - } }, - _attr: { value: function(e) { - return this._attrsByLName[this._attrKeys[e]]; - } }, - id: s.property({ name: `id` }), - className: s.property({ name: `class` }), - classList: { - get: function() { - var e = this; - if (this._classList) return this._classList; - var t = new T(function() { - return e.className || ``; - }, function(t) { - e.className = t; - }); - return this._classList = t, t; - }, - set: function(e) { - this.className = e; - } - }, - matches: { value: function(e) { - return E.matches(this, e); - } }, - closest: { value: function(e) { - var t = this; - do { - if (t.matches && t.matches(e)) return t; - t = t.parentElement || t.parentNode; - } while (t !== null && t.nodeType === c.ELEMENT_NODE); - return null; - } }, - querySelector: { value: function(e) { - return E(e, this)[0]; - } }, - querySelectorAll: { value: function(e) { - var t = E(e, this); - return t.item ? t : new d(t); - } } - }), Object.defineProperties(O.prototype, ee), Object.defineProperties(O.prototype, te), s.registerChangeHandler(O, `id`, function(e, t, n, r) { - e.rooted && (n && e.ownerDocument.delId(n, e), r && e.ownerDocument.addId(r, e)); - }), s.registerChangeHandler(O, `class`, function(e, t, n, r) { - e._classList && e._classList._update(); - }); - function ae(e, t, n, r, i) { - this.localName = t, this.prefix = n === null || n === `` ? null : `` + n, this.namespaceURI = r === null || r === `` ? null : `` + r, this.data = i, this._setOwnerElement(e); - } - ae.prototype = Object.create(Object.prototype, { - ownerElement: { get: function() { - return this._ownerElement; - } }, - _setOwnerElement: { value: function(e) { - this._ownerElement = e, this.prefix === null && this.namespaceURI === null && e ? this.onchange = e._attributeChangeHandlers[this.localName] : this.onchange = null; - } }, - name: { get: function() { - return this.prefix ? this.prefix + `:` + this.localName : this.localName; - } }, - specified: { get: function() { - return !0; - } }, - value: { - get: function() { - return this.data; - }, - set: function(e) { - var t = this.data; - e = e === void 0 ? `` : e + ``, e !== t && (this.data = e, this.ownerElement && (this.onchange && this.onchange(this.ownerElement, this.localName, t, e), this.ownerElement.rooted && this.ownerElement.ownerDocument.mutateAttr(this, t))); - } - }, - cloneNode: { value: function(e) { - return new ae(null, this.localName, this.prefix, this.namespaceURI, this.data); - } }, - nodeType: { get: function() { - return c.ATTRIBUTE_NODE; - } }, - nodeName: { get: function() { - return this.name; - } }, - nodeValue: { - get: function() { - return this.value; - }, - set: function(e) { - this.value = e; - } - }, - textContent: { - get: function() { - return this.value; - }, - set: function(e) { - e ??= ``, this.value = e; - } - }, - innerText: { - get: function() { - return this.value; - }, - set: function(e) { - e ??= ``, this.value = e; - } - } - }), O._Attr = ae; - function oe(e) { - for (var t in ne.call(this, e), e._attrsByQName) this[t] = e._attrsByQName[t]; - for (var n = 0; n < e._attrKeys.length; n++) this[n] = e._attrsByLName[e._attrKeys[n]]; - } - oe.prototype = Object.create(ne.prototype, { - length: { - get: function() { - return this.element._attrKeys.length; - }, - set: function() {} - }, - item: { value: function(e) { - return e >>>= 0, e >= this.length ? null : this.element._attrsByLName[this.element._attrKeys[e]]; - } } - }), globalThis.Symbol?.iterator && (oe.prototype[globalThis.Symbol.iterator] = function() { - var e = 0, t = this.length, n = this; - return { next: function() { - return e < t ? { value: n.item(e++) } : { done: !0 }; - } }; - }); - function se(e) { - this.element = e, this.updateCache(); - } - se.prototype = Object.create(Object.prototype, { - length: { get: function() { - return this.updateCache(), this.childrenByNumber.length; - } }, - item: { value: function(e) { - return this.updateCache(), this.childrenByNumber[e] || null; - } }, - namedItem: { value: function(e) { - return this.updateCache(), this.childrenByName[e] || null; - } }, - namedItems: { get: function() { - return this.updateCache(), this.childrenByName; - } }, - updateCache: { value: function() { - var e = /^(a|applet|area|embed|form|frame|frameset|iframe|img|object)$/; - if (this.lastModTime !== this.element.lastModTime) { - this.lastModTime = this.element.lastModTime; - for (var t = this.childrenByNumber && this.childrenByNumber.length || 0, n = 0; n < t; n++) this[n] = void 0; - this.childrenByNumber = [], this.childrenByName = Object.create(null); - for (var r = this.element.firstChild; r !== null; r = r.nextSibling) if (r.nodeType === c.ELEMENT_NODE) { - this[this.childrenByNumber.length] = r, this.childrenByNumber.push(r); - var i = r.getAttribute(`id`); - i && !this.childrenByName[i] && (this.childrenByName[i] = r); - var o = r.getAttribute(`name`); - o && this.element.namespaceURI === a.HTML && e.test(this.element.localName) && !this.childrenByName[o] && (this.childrenByName[i] = r); - } - } - } } - }); - function ce(e) { - return function(t) { - return t.localName === e; - }; - } - function le(e) { - var t = r.toASCIILowerCase(e); - return t === e ? ce(e) : function(n) { - return n.isHTML ? n.localName === t : n.localName === e; - }; - } - function k(e) { - return function(t) { - return t.namespaceURI === e; - }; - } - function A(e, t) { - return function(n) { - return n.namespaceURI === e && n.localName === t; - }; - } - function j(e) { - return function(t) { - return e.every(function(e) { - return t.classList.contains(e); - }); - }; - } - function M(e) { - return function(t) { - return t.namespaceURI === a.HTML ? t.getAttribute(`name`) === e : !1; - }; - } -})); -var w$8 = e$2(((e, t) => { - t.exports = c; - var n = u$8(), r = p$10(), i = o$8(), a = i.HierarchyRequestError, s = i.NotFoundError; - function c() { - n.call(this); - } - c.prototype = Object.create(n.prototype, { - hasChildNodes: { value: function() { - return !1; - } }, - firstChild: { value: null }, - lastChild: { value: null }, - insertBefore: { value: function(e, t) { - if (!e.nodeType) throw TypeError(`not a node`); - a(); - } }, - replaceChild: { value: function(e, t) { - if (!e.nodeType) throw TypeError(`not a node`); - a(); - } }, - removeChild: { value: function(e) { - if (!e.nodeType) throw TypeError(`not a node`); - s(); - } }, - removeChildren: { value: function() {} }, - childNodes: { get: function() { - return this._childNodes ||= new r(), this._childNodes; - } } - }); -})); -var T$8 = e$2(((e, t) => { - t.exports = s; - var n = w$8(), r = o$8(), i = b$7(), a = x$7(); - function s() { - n.call(this); - } - s.prototype = Object.create(n.prototype, { - substringData: { value: function(e, t) { - if (arguments.length < 2) throw TypeError(`Not enough arguments`); - return e >>>= 0, t >>>= 0, (e > this.data.length || e < 0 || t < 0) && r.IndexSizeError(), this.data.substring(e, e + t); - } }, - appendData: { value: function(e) { - if (arguments.length < 1) throw TypeError(`Not enough arguments`); - this.data += String(e); - } }, - insertData: { value: function(e, t) { - return this.replaceData(e, 0, t); - } }, - deleteData: { value: function(e, t) { - return this.replaceData(e, t, ``); - } }, - replaceData: { value: function(e, t, n) { - var i = this.data, a = i.length; - e >>>= 0, t >>>= 0, n = String(n), (e > a || e < 0) && r.IndexSizeError(), e + t > a && (t = a - e); - var o = i.substring(0, e), s = i.substring(e + t); - this.data = o + n + s; - } }, - isEqual: { value: function(e) { - return this._data === e._data; - } }, - length: { get: function() { - return this.data.length; - } } - }), Object.defineProperties(s.prototype, i), Object.defineProperties(s.prototype, a); -})); -var E$8 = e$2(((e, t) => { - t.exports = a; - var n = o$8(), r = u$8(), i = T$8(); - function a(e, t) { - i.call(this), this.nodeType = r.TEXT_NODE, this.ownerDocument = e, this._data = t, this._index = void 0; - } - var s = { - get: function() { - return this._data; - }, - set: function(e) { - e = e == null ? `` : String(e), e !== this._data && (this._data = e, this.rooted && this.ownerDocument.mutateValue(this), this.parentNode && this.parentNode._textchangehook && this.parentNode._textchangehook(this)); - } - }; - a.prototype = Object.create(i.prototype, { - nodeName: { value: `#text` }, - nodeValue: s, - textContent: s, - innerText: s, - data: { - get: s.get, - set: function(e) { - s.set.call(this, e === null ? `` : String(e)); - } - }, - splitText: { value: function(e) { - (e > this._data.length || e < 0) && n.IndexSizeError(); - var t = this._data.substring(e), r = this.ownerDocument.createTextNode(t); - this.data = this.data.substring(0, e); - var i = this.parentNode; - return i !== null && i.insertBefore(r, this.nextSibling), r; - } }, - wholeText: { get: function() { - for (var e = this.textContent, t = this.nextSibling; t && t.nodeType === r.TEXT_NODE; t = t.nextSibling) e += t.textContent; - return e; - } }, - replaceWholeText: { value: n.nyi }, - clone: { value: function() { - return new a(this.ownerDocument, this._data); - } } - }); -})); -var D$7 = e$2(((e, t) => { - t.exports = i; - var n = u$8(), r = T$8(); - function i(e, t) { - r.call(this), this.nodeType = n.COMMENT_NODE, this.ownerDocument = e, this._data = t; - } - var a = { - get: function() { - return this._data; - }, - set: function(e) { - e = e == null ? `` : String(e), this._data = e, this.rooted && this.ownerDocument.mutateValue(this); - } - }; - i.prototype = Object.create(r.prototype, { - nodeName: { value: `#comment` }, - nodeValue: a, - textContent: a, - innerText: a, - data: { - get: a.get, - set: function(e) { - a.set.call(this, e === null ? `` : String(e)); - } - }, - clone: { value: function() { - return new i(this.ownerDocument, this._data); - } } - }); -})); -var ee$5 = e$2(((e, t) => { - t.exports = l; - var n = u$8(), r = p$10(), i = m$7(), a = C$8(), s = y$5(), c = o$8(); - function l(e) { - i.call(this), this.nodeType = n.DOCUMENT_FRAGMENT_NODE, this.ownerDocument = e; - } - l.prototype = Object.create(i.prototype, { - nodeName: { value: `#document-fragment` }, - nodeValue: { - get: function() { - return null; - }, - set: function() {} - }, - textContent: Object.getOwnPropertyDescriptor(a.prototype, `textContent`), - innerText: Object.getOwnPropertyDescriptor(a.prototype, `innerText`), - querySelector: { value: function(e) { - var t = this.querySelectorAll(e); - return t.length ? t[0] : null; - } }, - querySelectorAll: { value: function(e) { - var t = Object.create(this); - t.isHTML = !0, t.getElementsByTagName = a.prototype.getElementsByTagName, t.nextElement = Object.getOwnPropertyDescriptor(a.prototype, `firstElementChild`).get; - var n = s(e, t); - return n.item ? n : new r(n); - } }, - clone: { value: function() { - return new l(this.ownerDocument); - } }, - isEqual: { value: function(e) { - return !0; - } }, - innerHTML: { - get: function() { - return this.serialize(); - }, - set: c.nyi - }, - outerHTML: { - get: function() { - return this.serialize(); - }, - set: c.nyi - } - }); -})); -var te$5 = e$2(((e, t) => { - t.exports = i; - var n = u$8(), r = T$8(); - function i(e, t, i) { - r.call(this), this.nodeType = n.PROCESSING_INSTRUCTION_NODE, this.ownerDocument = e, this.target = t, this._data = i; - } - var a = { - get: function() { - return this._data; - }, - set: function(e) { - e = e == null ? `` : String(e), this._data = e, this.rooted && this.ownerDocument.mutateValue(this); - } - }; - i.prototype = Object.create(r.prototype, { - nodeName: { get: function() { - return this.target; - } }, - nodeValue: a, - textContent: a, - innerText: a, - data: { - get: a.get, - set: function(e) { - a.set.call(this, e === null ? `` : String(e)); - } - }, - clone: { value: function() { - return new i(this.ownerDocument, this.target, this._data); - } }, - isEqual: { value: function(e) { - return this.target === e.target && this._data === e._data; - } } - }); -})); -var ne$5 = e$2(((e, t) => { - var n = { - FILTER_ACCEPT: 1, - FILTER_REJECT: 2, - FILTER_SKIP: 3, - SHOW_ALL: 4294967295, - SHOW_ELEMENT: 1, - SHOW_ATTRIBUTE: 2, - SHOW_TEXT: 4, - SHOW_CDATA_SECTION: 8, - SHOW_ENTITY_REFERENCE: 16, - SHOW_ENTITY: 32, - SHOW_PROCESSING_INSTRUCTION: 64, - SHOW_COMMENT: 128, - SHOW_DOCUMENT: 256, - SHOW_DOCUMENT_TYPE: 512, - SHOW_DOCUMENT_FRAGMENT: 1024, - SHOW_NOTATION: 2048 - }; - t.exports = n.constructor = n.prototype = n; -})); -var re$5 = e$2(((e, t) => { - t.exports = { - nextSkippingChildren: n, - nextAncestorSibling: r, - next: i, - previous: o, - deepLastChild: a - }; - function n(e, t) { - return e === t ? null : e.nextSibling === null ? r(e, t) : e.nextSibling; - } - function r(e, t) { - for (e = e.parentNode; e !== null; e = e.parentNode) { - if (e === t) return null; - if (e.nextSibling !== null) return e.nextSibling; - } - return null; - } - function i(e, t) { - var n = e.firstChild; - return n === null ? e === t ? null : (n = e.nextSibling, n === null ? r(e, t) : n) : n; - } - function a(e) { - for (; e.lastChild;) e = e.lastChild; - return e; - } - function o(e, t) { - var n = e.previousSibling; - return n === null ? (n = e.parentNode, n === t ? null : n) : a(n); - } -})); -var O$6 = e$2(((e, t) => { - t.exports = f; - var n = u$8(), r = ne$5(), i = re$5(), a = o$8(), s = { - first: `firstChild`, - last: `lastChild`, - next: `firstChild`, - previous: `lastChild` - }, c = { - first: `nextSibling`, - last: `previousSibling`, - next: `nextSibling`, - previous: `previousSibling` - }; - function l(e, t) { - for (var n, i = e._currentNode[s[t]], a, o, l; i !== null;) { - if (o = e._internalFilter(i), o === r.FILTER_ACCEPT) return e._currentNode = i, i; - if (o === r.FILTER_SKIP && (n = i[s[t]], n !== null)) { - i = n; - continue; - } - for (; i !== null;) { - if (l = i[c[t]], l !== null) { - i = l; - break; - } - if (a = i.parentNode, a === null || a === e.root || a === e._currentNode) return null; - i = a; - } - } - return null; - } - function d(e, t) { - var n = e._currentNode, i, a; - if (n === e.root) return null; - for (;;) { - for (a = n[c[t]]; a !== null;) { - if (n = a, i = e._internalFilter(n), i === r.FILTER_ACCEPT) return e._currentNode = n, n; - a = n[s[t]], (i === r.FILTER_REJECT || a === null) && (a = n[c[t]]); - } - if (n = n.parentNode, n === null || n === e.root || e._internalFilter(n) === r.FILTER_ACCEPT) return null; - } - } - function f(e, t, n) { - (!e || !e.nodeType) && a.NotSupportedError(), this._root = e, this._whatToShow = Number(t) || 0, this._filter = n || null, this._active = !1, this._currentNode = e; - } - Object.defineProperties(f.prototype, { - root: { get: function() { - return this._root; - } }, - whatToShow: { get: function() { - return this._whatToShow; - } }, - filter: { get: function() { - return this._filter; - } }, - currentNode: { - get: function() { - return this._currentNode; - }, - set: function(e) { - if (!(e instanceof n)) throw TypeError(`Not a Node`); - this._currentNode = e; - } - }, - _internalFilter: { value: function(e) { - var t, n; - if (this._active && a.InvalidStateError(), !(1 << e.nodeType - 1 & this._whatToShow)) return r.FILTER_SKIP; - if (n = this._filter, n === null) t = r.FILTER_ACCEPT; - else { - this._active = !0; - try { - t = typeof n == `function` ? n(e) : n.acceptNode(e); - } finally { - this._active = !1; - } - } - return +t; - } }, - parentNode: { value: function() { - for (var e = this._currentNode; e !== this.root;) { - if (e = e.parentNode, e === null) return null; - if (this._internalFilter(e) === r.FILTER_ACCEPT) return this._currentNode = e, e; - } - return null; - } }, - firstChild: { value: function() { - return l(this, `first`); - } }, - lastChild: { value: function() { - return l(this, `last`); - } }, - previousSibling: { value: function() { - return d(this, `previous`); - } }, - nextSibling: { value: function() { - return d(this, `next`); - } }, - previousNode: { value: function() { - for (var e = this._currentNode, t, n, i; e !== this._root;) { - for (n = e.previousSibling; n; n = e.previousSibling) if (e = n, t = this._internalFilter(e), t !== r.FILTER_REJECT) { - for (i = e.lastChild; i && (e = i, t = this._internalFilter(e), t !== r.FILTER_REJECT); i = e.lastChild); - if (t === r.FILTER_ACCEPT) return this._currentNode = e, e; - } - if (e === this.root || e.parentNode === null) return null; - if (e = e.parentNode, this._internalFilter(e) === r.FILTER_ACCEPT) return this._currentNode = e, e; - } - return null; - } }, - nextNode: { value: function() { - var e = this._currentNode, t = r.FILTER_ACCEPT, n, a; - CHILDREN: for (;;) { - for (n = e.firstChild; n; n = e.firstChild) { - if (e = n, t = this._internalFilter(e), t === r.FILTER_ACCEPT) return this._currentNode = e, e; - if (t === r.FILTER_REJECT) break; - } - for (a = i.nextSkippingChildren(e, this.root); a; a = i.nextSkippingChildren(e, this.root)) { - if (e = a, t = this._internalFilter(e), t === r.FILTER_ACCEPT) return this._currentNode = e, e; - if (t === r.FILTER_SKIP) continue CHILDREN; - } - return null; - } - } }, - toString: { value: function() { - return `[object TreeWalker]`; - } } - }); -})); -var ie$5 = e$2(((e, t) => { - t.exports = l; - var n = ne$5(), r = re$5(), i = o$8(); - function a(e, t, n) { - return n ? r.next(e, t) : e === t ? null : r.previous(e, null); - } - function s(e, t) { - for (; t; t = t.parentNode) if (e === t) return !0; - return !1; - } - function c(e, t) { - for (var r = e._referenceNode, i = e._pointerBeforeReferenceNode;;) { - if (i === t) i = !i; - else if (r = a(r, e._root, t), r === null) return null; - if (e._internalFilter(r) === n.FILTER_ACCEPT) break; - } - return e._referenceNode = r, e._pointerBeforeReferenceNode = i, r; - } - function l(e, t, n) { - (!e || !e.nodeType) && i.NotSupportedError(), this._root = e, this._referenceNode = e, this._pointerBeforeReferenceNode = !0, this._whatToShow = Number(t) || 0, this._filter = n || null, this._active = !1, e.doc._attachNodeIterator(this); - } - Object.defineProperties(l.prototype, { - root: { get: function() { - return this._root; - } }, - referenceNode: { get: function() { - return this._referenceNode; - } }, - pointerBeforeReferenceNode: { get: function() { - return this._pointerBeforeReferenceNode; - } }, - whatToShow: { get: function() { - return this._whatToShow; - } }, - filter: { get: function() { - return this._filter; - } }, - _internalFilter: { value: function(e) { - var t, r; - if (this._active && i.InvalidStateError(), !(1 << e.nodeType - 1 & this._whatToShow)) return n.FILTER_SKIP; - if (r = this._filter, r === null) t = n.FILTER_ACCEPT; - else { - this._active = !0; - try { - t = typeof r == `function` ? r(e) : r.acceptNode(e); - } finally { - this._active = !1; - } - } - return +t; - } }, - _preremove: { value: function(e) { - if (!s(e, this._root) && s(e, this._referenceNode)) { - if (this._pointerBeforeReferenceNode) { - for (var t = e; t.lastChild;) t = t.lastChild; - if (t = r.next(t, this.root), t) { - this._referenceNode = t; - return; - } - this._pointerBeforeReferenceNode = !1; - } - if (e.previousSibling === null) this._referenceNode = e.parentNode; - else { - this._referenceNode = e.previousSibling; - var n; - for (n = this._referenceNode.lastChild; n; n = this._referenceNode.lastChild) this._referenceNode = n; - } - } - } }, - nextNode: { value: function() { - return c(this, !0); - } }, - previousNode: { value: function() { - return c(this, !1); - } }, - detach: { value: function() {} }, - toString: { value: function() { - return `[object NodeIterator]`; - } } - }); -})); -var ae$6 = e$2(((e, t) => { - t.exports = n; - function n(e) { - if (!e) return Object.create(n.prototype); - this.url = e.replace(/^[ \t\n\r\f]+|[ \t\n\r\f]+$/g, ``); - var t = n.pattern.exec(this.url); - if (t) { - if (t[2] && (this.scheme = t[2]), t[4]) { - var r = t[4].match(n.userinfoPattern); - if (r && (this.username = r[1], this.password = r[3], t[4] = t[4].substring(r[0].length)), t[4].match(n.portPattern)) { - var i = t[4].lastIndexOf(`:`); - this.host = t[4].substring(0, i), this.port = t[4].substring(i + 1); - } else this.host = t[4]; - } - t[5] && (this.path = t[5]), t[6] && (this.query = t[7]), t[8] && (this.fragment = t[9]); - } - } - n.pattern = /^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/, n.userinfoPattern = /^([^@:]*)(:([^@]*))?@/, n.portPattern = /:\d+$/, n.authorityPattern = /^[^:\/?#]+:\/\//, n.hierarchyPattern = /^[^:\/?#]+:\//, n.percentEncode = function(e) { - var t = e.charCodeAt(0); - if (t < 256) return `%` + t.toString(16); - throw Error(`can't percent-encode codepoints > 255 yet`); - }, n.prototype = { - constructor: n, - isAbsolute: function() { - return !!this.scheme; - }, - isAuthorityBased: function() { - return n.authorityPattern.test(this.url); - }, - isHierarchical: function() { - return n.hierarchyPattern.test(this.url); - }, - toString: function() { - var e = ``; - return this.scheme !== void 0 && (e += this.scheme + `:`), this.isAbsolute() && (e += `//`, (this.username || this.password) && (e += this.username || ``, this.password && (e += `:` + this.password), e += `@`), this.host && (e += this.host)), this.port !== void 0 && (e += `:` + this.port), this.path !== void 0 && (e += this.path), this.query !== void 0 && (e += `?` + this.query), this.fragment !== void 0 && (e += `#` + this.fragment), e; - }, - resolve: function(e) { - var t = this, r = new n(e), i = new n(); - return r.scheme === void 0 ? (i.scheme = t.scheme, r.host === void 0 ? (i.username = t.username, i.password = t.password, i.host = t.host, i.port = t.port, r.path ? (r.path.charAt(0) === `/` ? i.path = o(r.path) : (i.path = a(t.path, r.path), i.path = o(i.path)), i.query = r.query) : (i.path = t.path, r.query === void 0 ? i.query = t.query : i.query = r.query)) : (i.username = r.username, i.password = r.password, i.host = r.host, i.port = r.port, i.path = o(r.path), i.query = r.query)) : (i.scheme = r.scheme, i.username = r.username, i.password = r.password, i.host = r.host, i.port = r.port, i.path = o(r.path), i.query = r.query), i.fragment = r.fragment, i.toString(); - function a(e, n) { - if (t.host !== void 0 && !t.path) return `/` + n; - var r = e.lastIndexOf(`/`); - return r === -1 ? n : e.substring(0, r + 1) + n; - } - function o(e) { - if (!e) return e; - for (var t = ``; e.length > 0;) { - if (e === `.` || e === `..`) { - e = ``; - break; - } - var n = e.substring(0, 2), r = e.substring(0, 3), i = e.substring(0, 4); - if (r === `../`) e = e.substring(3); - else if (n === `./`) e = e.substring(2); - else if (r === `/./`) e = `/` + e.substring(3); - else if (n === `/.` && e.length === 2) e = `/`; - else if (i === `/../` || r === `/..` && e.length === 3) e = `/` + e.substring(4), t = t.replace(/\/?[^\/]*$/, ``); - else { - var a = e.match(/(\/?([^\/]*))/)[0]; - t += a, e = e.substring(a.length); - } - } - return t; - } - } - }; -})); -var oe$6 = e$2(((e, n) => { - n.exports = i; - var r = t$7(); - function i(e, t) { - r.call(this, e, t); - } - i.prototype = Object.create(r.prototype, { constructor: { value: i } }); -})); -var se$7 = e$2(((e, i) => { - i.exports = { - Event: t$7(), - UIEvent: n$8(), - MouseEvent: r$11(), - CustomEvent: oe$6() - }; -})); -var ce$7 = e$2(((e) => { - Object.defineProperty(e, "__esModule", { value: !0 }), e.hyphenate = e.parse = void 0; - function t(e) { - let t = [], r = 0, i = 0, a = 0, o = 0, s = 0, c = null; - for (; r < e.length;) switch (e.charCodeAt(r++)) { - case 40: - i++; - break; - case 41: - i--; - break; - case 39: - a === 0 ? a = 39 : a === 39 && e.charCodeAt(r - 1) !== 92 && (a = 0); - break; - case 34: - a === 0 ? a = 34 : a === 34 && e.charCodeAt(r - 1) !== 92 && (a = 0); - break; - case 58: - !c && i === 0 && a === 0 && (c = n(e.substring(s, r - 1).trim()), o = r); - break; - case 59: - if (c && o > 0 && i === 0 && a === 0) { - let n = e.substring(o, r - 1).trim(); - t.push(c, n), s = r, o = 0, c = null; - } - break; - } - if (c && o) { - let n = e.slice(o).trim(); - t.push(c, n); - } - return t; - } - e.parse = t; - function n(e) { - return e.replace(/[a-z][A-Z]/g, (e) => e.charAt(0) + `-` + e.charAt(1)).toLowerCase(); - } - e.hyphenate = n; -})); -var le$7 = e$2(((e, t) => { - let { parse: n } = ce$7(); - t.exports = function(e) { - let t = new i(e); - return new Proxy(t, { - get: function(e, t) { - return t in e ? e[t] : e.getPropertyValue(r(t)); - }, - has: function(e, t) { - return !0; - }, - set: function(e, t, n) { - return t in e ? e[t] = n : e.setProperty(r(t), n ?? void 0), !0; - } - }); - }; - function r(e) { - return e.replace(/([a-z])([A-Z])/g, `$1-$2`).toLowerCase(); - } - function i(e) { - this._element = e; - } - function a(e) { - let t = { - property: {}, - priority: {} - }; - if (!e) return t; - let r = n(e); - if (r.length < 2) return t; - for (let e = 0; e < r.length; e += 2) { - let n = r[e], i = r[e + 1]; - i.endsWith(`!important`) && (t.priority[n] = `important`, i = i.slice(0, -10).trim()), t.property[n] = i; - } - return t; - } - var o = {}; - i.prototype = Object.create(Object.prototype, { - _parsed: { get: function() { - if (!this._parsedStyles || this.cssText !== this._lastParsedText) { - var e = this.cssText; - this._parsedStyles = a(e), this._lastParsedText = e, delete this._names; - } - return this._parsedStyles; - } }, - _serialize: { value: function() { - var e = this._parsed, t = ``; - for (var n in e.property) t && (t += ` `), t += n + `: ` + e.property[n], e.priority[n] && (t += ` !` + e.priority[n]), t += `;`; - this.cssText = t, this._lastParsedText = t, delete this._names; - } }, - cssText: { - get: function() { - return this._element.getAttribute(`style`); - }, - set: function(e) { - this._element.setAttribute(`style`, e); - } - }, - length: { get: function() { - return this._names ||= Object.getOwnPropertyNames(this._parsed.property), this._names.length; - } }, - item: { value: function(e) { - return this._names ||= Object.getOwnPropertyNames(this._parsed.property), this._names[e]; - } }, - getPropertyValue: { value: function(e) { - return e = e.toLowerCase(), this._parsed.property[e] || ``; - } }, - getPropertyPriority: { value: function(e) { - return e = e.toLowerCase(), this._parsed.priority[e] || ``; - } }, - setProperty: { value: function(e, t, n) { - if (e = e.toLowerCase(), t ??= ``, n ??= ``, t !== o && (t = `` + t), t = t.trim(), t === ``) { - this.removeProperty(e); - return; - } - if (!(n !== `` && n !== o && !/^important$/i.test(n))) { - var r = this._parsed; - if (t === o) { - if (!r.property[e]) return; - n === `` ? delete r.priority[e] : r.priority[e] = `important`; - } else { - if (t.indexOf(`;`) !== -1) return; - var i = a(e + `:` + t); - if (Object.getOwnPropertyNames(i.property).length === 0 || Object.getOwnPropertyNames(i.priority).length !== 0) return; - for (var s in i.property) r.property[s] = i.property[s], n !== o && (n === `` ? r.priority[s] && delete r.priority[s] : r.priority[s] = `important`); - } - this._serialize(); - } - } }, - setPropertyValue: { value: function(e, t) { - return this.setProperty(e, t, o); - } }, - setPropertyPriority: { value: function(e, t) { - return this.setProperty(e, o, t); - } }, - removeProperty: { value: function(e) { - e = e.toLowerCase(); - var t = this._parsed; - e in t.property && (delete t.property[e], delete t.priority[e], this._serialize()); - } } - }); -})); -var k$8 = e$2(((e, t) => { - var n = ae$6(); - t.exports = r; - function r() {} - r.prototype = Object.create(Object.prototype, { - _url: { get: function() { - return new n(this.href); - } }, - protocol: { - get: function() { - var e = this._url; - return e && e.scheme ? e.scheme + `:` : `:`; - }, - set: function(e) { - var t = this.href, r = new n(t); - r.isAbsolute() && (e = e.replace(/:+$/, ``), e = e.replace(/[^-+\.a-zA-Z0-9]/g, n.percentEncode), e.length > 0 && (r.scheme = e, t = r.toString())), this.href = t; - } - }, - host: { - get: function() { - var e = this._url; - return e.isAbsolute() && e.isAuthorityBased() ? e.host + (e.port ? `:` + e.port : ``) : ``; - }, - set: function(e) { - var t = this.href, r = new n(t); - r.isAbsolute() && r.isAuthorityBased() && (e = e.replace(/[^-+\._~!$&'()*,;:=a-zA-Z0-9]/g, n.percentEncode), e.length > 0 && (r.host = e, delete r.port, t = r.toString())), this.href = t; - } - }, - hostname: { - get: function() { - var e = this._url; - return e.isAbsolute() && e.isAuthorityBased() ? e.host : ``; - }, - set: function(e) { - var t = this.href, r = new n(t); - r.isAbsolute() && r.isAuthorityBased() && (e = e.replace(/^\/+/, ``), e = e.replace(/[^-+\._~!$&'()*,;:=a-zA-Z0-9]/g, n.percentEncode), e.length > 0 && (r.host = e, t = r.toString())), this.href = t; - } - }, - port: { - get: function() { - var e = this._url; - return e.isAbsolute() && e.isAuthorityBased() && e.port !== void 0 ? e.port : ``; - }, - set: function(e) { - var t = this.href, r = new n(t); - r.isAbsolute() && r.isAuthorityBased() && (e = `` + e, e = e.replace(/[^0-9].*$/, ``), e = e.replace(/^0+/, ``), e.length === 0 && (e = `0`), parseInt(e, 10) <= 65535 && (r.port = e, t = r.toString())), this.href = t; - } - }, - pathname: { - get: function() { - var e = this._url; - return e.isAbsolute() && e.isHierarchical() ? e.path : ``; - }, - set: function(e) { - var t = this.href, r = new n(t); - r.isAbsolute() && r.isHierarchical() && (e.charAt(0) !== `/` && (e = `/` + e), e = e.replace(/[^-+\._~!$&'()*,;:=@\/a-zA-Z0-9]/g, n.percentEncode), r.path = e, t = r.toString()), this.href = t; - } - }, - search: { - get: function() { - var e = this._url; - return e.isAbsolute() && e.isHierarchical() && e.query !== void 0 ? `?` + e.query : ``; - }, - set: function(e) { - var t = this.href, r = new n(t); - r.isAbsolute() && r.isHierarchical() && (e.charAt(0) === `?` && (e = e.substring(1)), e = e.replace(/[^-+\._~!$&'()*,;:=@\/?a-zA-Z0-9]/g, n.percentEncode), r.query = e, t = r.toString()), this.href = t; - } - }, - hash: { - get: function() { - var e = this._url; - return e == null || e.fragment == null || e.fragment === `` ? `` : `#` + e.fragment; - }, - set: function(e) { - var t = this.href, r = new n(t); - e.charAt(0) === `#` && (e = e.substring(1)), e = e.replace(/[^-+\._~!$&'()*,;:=@\/?a-zA-Z0-9]/g, n.percentEncode), r.fragment = e, t = r.toString(), this.href = t; - } - }, - username: { - get: function() { - return this._url.username || ``; - }, - set: function(e) { - var t = this.href, r = new n(t); - r.isAbsolute() && (e = e.replace(/[\x00-\x1F\x7F-\uFFFF "#<>?`\/@\\:]/g, n.percentEncode), r.username = e, t = r.toString()), this.href = t; - } - }, - password: { - get: function() { - return this._url.password || ``; - }, - set: function(e) { - var t = this.href, r = new n(t); - r.isAbsolute() && (e === `` ? r.password = null : (e = e.replace(/[\x00-\x1F\x7F-\uFFFF "#<>?`\/@\\]/g, n.percentEncode), r.password = e), t = r.toString()), this.href = t; - } - }, - origin: { get: function() { - var e = this._url; - if (e == null) return ``; - var t = function(t) { - var n = [ - e.scheme, - e.host, - +e.port || t - ]; - return n[0] + `://` + n[1] + (n[2] === t ? `` : `:` + n[2]); - }; - switch (e.scheme) { - case `ftp`: return t(21); - case `gopher`: return t(70); - case `http`: - case `ws`: return t(80); - case `https`: - case `wss`: return t(443); - default: return e.scheme + `://`; - } - } } - }), r._inherit = function(e) { - Object.getOwnPropertyNames(r.prototype).forEach(function(t) { - if (!(t === `constructor` || t === `href`)) { - var n = Object.getOwnPropertyDescriptor(r.prototype, t); - Object.defineProperty(e, t, n); - } - }); - }; -})); -var A$7 = e$2(((e, t) => { - var n = g$7(), r = a$8().isApiWritable; - t.exports = function(e, t, i, a) { - var o = e.ctor; - if (o) { - var c = e.props || {}; - if (e.attributes) for (var l in e.attributes) { - var u = e.attributes[l]; - (typeof u != `object` || Array.isArray(u)) && (u = { type: u }), u.name ||= l.toLowerCase(), c[l] = n.property(u); - } - c.constructor = { - value: o, - writable: r - }, o.prototype = Object.create((e.superclass || t).prototype, c), e.events && s(o, e.events), i[e.name] = o; - } else o = t; - return (e.tags || e.tag && [e.tag] || []).forEach(function(e) { - a[e] = o; - }), o; - }; - function i(e, t, n, r) { - this.body = e, this.document = t, this.form = n, this.element = r; - } - i.prototype.build = function() { - return () => {}; - }; - function o(e, t, n, r) { - e[t] = new i(r, e.ownerDocument || Object.create(null), e.form || Object.create(null), e).build(); - } - function s(e, t) { - var r = e.prototype; - t.forEach(function(t) { - Object.defineProperty(r, `on` + t, { - get: function() { - return this._getEventHandler(t); - }, - set: function(e) { - this._setEventHandler(t, e); - } - }), n.registerChangeHandler(e, `on` + t, o); - }); - } -})); -var j$6 = e$2(((e) => { - var t = u$8(), n = C$8(), r = le$7(), i = o$8(), a = k$8(), s = A$7(), c = e.elements = {}, l = Object.create(null); - e.createElement = function(e, t, n) { - return new (l[t] || v)(e, t, n); - }; - function d(e) { - return s(e, _, c, l); - } - function f(e) { - return { - get: function() { - var t = this._getattr(e); - if (t === null) return ``; - var n = this.doc._resolve(t); - return n === null ? t : n; - }, - set: function(t) { - this._setattr(e, t); - } - }; - } - function p(e) { - return { - get: function() { - var t = this._getattr(e); - return t === null ? null : t.toLowerCase() === `use-credentials` ? `use-credentials` : `anonymous`; - }, - set: function(t) { - t == null ? this.removeAttribute(e) : this._setattr(e, t); - } - }; - } - let m = { - type: [ - ``, - `no-referrer`, - `no-referrer-when-downgrade`, - `same-origin`, - `origin`, - `strict-origin`, - `origin-when-cross-origin`, - `strict-origin-when-cross-origin`, - `unsafe-url` - ], - missing: `` - }; - var h = { - A: !0, - LINK: !0, - BUTTON: !0, - INPUT: !0, - SELECT: !0, - TEXTAREA: !0, - COMMAND: !0 - }, g = function(e, t, n) { - _.call(this, e, t, n), this._form = null; - }, _ = e.HTMLElement = d({ - superclass: n, - name: `HTMLElement`, - ctor: function(e, t, r) { - n.call(this, e, t, i.NAMESPACE.HTML, r); - }, - props: { - dangerouslySetInnerHTML: { set: function(e) { - this._innerHTML = e; - } }, - innerHTML: { - get: function() { - return this.serialize(); - }, - set: function(e) { - var t = this.ownerDocument.implementation.mozHTMLParser(this.ownerDocument._address, this); - t.parse(e === null ? `` : String(e), !0); - for (var n = this instanceof l.template ? this.content : this; n.hasChildNodes();) n.removeChild(n.firstChild); - n.appendChild(t._asDocumentFragment()); - } - }, - style: { - get: function() { - return this._style ||= new r(this), this._style; - }, - set: function(e) { - e ??= ``, this._setattr(`style`, String(e)); - } - }, - blur: { value: function() {} }, - focus: { value: function() {} }, - forceSpellCheck: { value: function() {} }, - click: { value: function() { - if (!this._click_in_progress) { - this._click_in_progress = !0; - try { - this._pre_click_activation_steps && this._pre_click_activation_steps(); - var e = this.ownerDocument.createEvent(`MouseEvent`); - e.initMouseEvent(`click`, !0, !0, this.ownerDocument.defaultView, 1, 0, 0, 0, 0, !1, !1, !1, !1, 0, null), this.dispatchEvent(e) ? this._post_click_activation_steps && this._post_click_activation_steps(e) : this._cancelled_activation_steps && this._cancelled_activation_steps(); - } finally { - this._click_in_progress = !1; - } - } - } }, - submit: { value: i.nyi } - }, - attributes: { - title: String, - lang: String, - dir: { - type: [ - `ltr`, - `rtl`, - `auto` - ], - missing: `` - }, - draggable: { - type: [`true`, `false`], - treatNullAsEmptyString: !0 - }, - spellcheck: { - type: [`true`, `false`], - missing: `` - }, - enterKeyHint: { - type: [ - `enter`, - `done`, - `go`, - `next`, - `previous`, - `search`, - `send` - ], - missing: `` - }, - autoCapitalize: { - type: [ - `off`, - `on`, - `none`, - `sentences`, - `words`, - `characters` - ], - missing: `` - }, - autoFocus: Boolean, - accessKey: String, - nonce: String, - hidden: Boolean, - translate: { - type: [`no`, `yes`], - missing: `` - }, - tabIndex: { - type: `long`, - default: function() { - return this.tagName in h || this.contentEditable ? 0 : -1; - } - } - }, - events: `abort.canplay.canplaythrough.change.click.contextmenu.cuechange.dblclick.drag.dragend.dragenter.dragleave.dragover.dragstart.drop.durationchange.emptied.ended.input.invalid.keydown.keypress.keyup.loadeddata.loadedmetadata.loadstart.mousedown.mousemove.mouseout.mouseover.mouseup.mousewheel.pause.play.playing.progress.ratechange.readystatechange.reset.seeked.seeking.select.show.stalled.submit.suspend.timeupdate.volumechange.waiting.blur.error.focus.load.scroll`.split(`.`) - }), v = d({ - name: `HTMLUnknownElement`, - ctor: function(e, t, n) { - _.call(this, e, t, n); - } - }), y = { form: { get: function() { - return this._form; - } } }; - d({ - tag: `a`, - name: `HTMLAnchorElement`, - ctor: function(e, t, n) { - _.call(this, e, t, n); - }, - props: { _post_click_activation_steps: { value: function(e) { - this.href && (this.ownerDocument.defaultView.location = this.href); - } } }, - attributes: { - href: f, - ping: String, - download: String, - target: String, - rel: String, - media: String, - hreflang: String, - type: String, - referrerPolicy: m, - coords: String, - charset: String, - name: String, - rev: String, - shape: String - } - }), a._inherit(l.a.prototype), d({ - tag: `area`, - name: `HTMLAreaElement`, - ctor: function(e, t, n) { - _.call(this, e, t, n); - }, - attributes: { - alt: String, - target: String, - download: String, - rel: String, - media: String, - href: f, - hreflang: String, - type: String, - shape: String, - coords: String, - ping: String, - referrerPolicy: m, - noHref: Boolean - } - }), a._inherit(l.area.prototype), d({ - tag: `br`, - name: `HTMLBRElement`, - ctor: function(e, t, n) { - _.call(this, e, t, n); - }, - attributes: { clear: String } - }), d({ - tag: `base`, - name: `HTMLBaseElement`, - ctor: function(e, t, n) { - _.call(this, e, t, n); - }, - attributes: { target: String } - }), d({ - tag: `body`, - name: `HTMLBodyElement`, - ctor: function(e, t, n) { - _.call(this, e, t, n); - }, - events: [ - `afterprint`, - `beforeprint`, - `beforeunload`, - `blur`, - `error`, - `focus`, - `hashchange`, - `load`, - `message`, - `offline`, - `online`, - `pagehide`, - `pageshow`, - `popstate`, - `resize`, - `scroll`, - `storage`, - `unload` - ], - attributes: { - text: { - type: String, - treatNullAsEmptyString: !0 - }, - link: { - type: String, - treatNullAsEmptyString: !0 - }, - vLink: { - type: String, - treatNullAsEmptyString: !0 - }, - aLink: { - type: String, - treatNullAsEmptyString: !0 - }, - bgColor: { - type: String, - treatNullAsEmptyString: !0 - }, - background: String - } - }), d({ - tag: `button`, - name: `HTMLButtonElement`, - ctor: function(e, t, n) { - g.call(this, e, t, n); - }, - props: y, - attributes: { - name: String, - value: String, - disabled: Boolean, - autofocus: Boolean, - type: { - type: [ - `submit`, - `reset`, - `button`, - `menu` - ], - missing: `submit` - }, - formTarget: String, - formAction: f, - formNoValidate: Boolean, - formMethod: { - type: [ - `get`, - `post`, - `dialog` - ], - invalid: `get`, - missing: `` - }, - formEnctype: { - type: [ - `application/x-www-form-urlencoded`, - `multipart/form-data`, - `text/plain` - ], - invalid: `application/x-www-form-urlencoded`, - missing: `` - } - } - }), d({ - tag: `dl`, - name: `HTMLDListElement`, - ctor: function(e, t, n) { - _.call(this, e, t, n); - }, - attributes: { compact: Boolean } - }), d({ - tag: `data`, - name: `HTMLDataElement`, - ctor: function(e, t, n) { - _.call(this, e, t, n); - }, - attributes: { value: String } - }), d({ - tag: `datalist`, - name: `HTMLDataListElement`, - ctor: function(e, t, n) { - _.call(this, e, t, n); - } - }), d({ - tag: `details`, - name: `HTMLDetailsElement`, - ctor: function(e, t, n) { - _.call(this, e, t, n); - }, - attributes: { open: Boolean } - }), d({ - tag: `div`, - name: `HTMLDivElement`, - ctor: function(e, t, n) { - _.call(this, e, t, n); - }, - attributes: { align: String } - }), d({ - tag: `embed`, - name: `HTMLEmbedElement`, - ctor: function(e, t, n) { - _.call(this, e, t, n); - }, - attributes: { - src: f, - type: String, - width: String, - height: String, - align: String, - name: String - } - }), d({ - tag: `fieldset`, - name: `HTMLFieldSetElement`, - ctor: function(e, t, n) { - g.call(this, e, t, n); - }, - props: y, - attributes: { - disabled: Boolean, - name: String - } - }), d({ - tag: `form`, - name: `HTMLFormElement`, - ctor: function(e, t, n) { - _.call(this, e, t, n); - }, - attributes: { - action: String, - autocomplete: { - type: [`on`, `off`], - missing: `on` - }, - name: String, - acceptCharset: { name: `accept-charset` }, - target: String, - noValidate: Boolean, - method: { - type: [ - `get`, - `post`, - `dialog` - ], - invalid: `get`, - missing: `get` - }, - enctype: { - type: [ - `application/x-www-form-urlencoded`, - `multipart/form-data`, - `text/plain` - ], - invalid: `application/x-www-form-urlencoded`, - missing: `application/x-www-form-urlencoded` - }, - encoding: { - name: `enctype`, - type: [ - `application/x-www-form-urlencoded`, - `multipart/form-data`, - `text/plain` - ], - invalid: `application/x-www-form-urlencoded`, - missing: `application/x-www-form-urlencoded` - } - } - }), d({ - tag: `hr`, - name: `HTMLHRElement`, - ctor: function(e, t, n) { - _.call(this, e, t, n); - }, - attributes: { - align: String, - color: String, - noShade: Boolean, - size: String, - width: String - } - }), d({ - tag: `head`, - name: `HTMLHeadElement`, - ctor: function(e, t, n) { - _.call(this, e, t, n); - } - }), d({ - tags: [ - `h1`, - `h2`, - `h3`, - `h4`, - `h5`, - `h6` - ], - name: `HTMLHeadingElement`, - ctor: function(e, t, n) { - _.call(this, e, t, n); - }, - attributes: { align: String } - }), d({ - tag: `html`, - name: `HTMLHtmlElement`, - ctor: function(e, t, n) { - _.call(this, e, t, n); - }, - attributes: { - xmlns: f, - version: String - } - }), d({ - tag: `iframe`, - name: `HTMLIFrameElement`, - ctor: function(e, t, n) { - _.call(this, e, t, n); - }, - attributes: { - src: f, - srcdoc: String, - name: String, - width: String, - height: String, - seamless: Boolean, - allow: Boolean, - allowFullscreen: Boolean, - allowUserMedia: Boolean, - allowPaymentRequest: Boolean, - referrerPolicy: m, - loading: { - type: [`eager`, `lazy`], - treatNullAsEmptyString: !0 - }, - align: String, - scrolling: String, - frameBorder: String, - longDesc: f, - marginHeight: { - type: String, - treatNullAsEmptyString: !0 - }, - marginWidth: { - type: String, - treatNullAsEmptyString: !0 - } - } - }), d({ - tag: `img`, - name: `HTMLImageElement`, - ctor: function(e, t, n) { - _.call(this, e, t, n); - }, - attributes: { - alt: String, - src: f, - srcset: String, - crossOrigin: p, - useMap: String, - isMap: Boolean, - sizes: String, - height: { - type: `unsigned long`, - default: 0 - }, - width: { - type: `unsigned long`, - default: 0 - }, - referrerPolicy: m, - loading: { - type: [`eager`, `lazy`], - missing: `` - }, - name: String, - lowsrc: f, - align: String, - hspace: { - type: `unsigned long`, - default: 0 - }, - vspace: { - type: `unsigned long`, - default: 0 - }, - longDesc: f, - border: { - type: String, - treatNullAsEmptyString: !0 - } - } - }), d({ - tag: `input`, - name: `HTMLInputElement`, - ctor: function(e, t, n) { - g.call(this, e, t, n); - }, - props: { - form: y.form, - _post_click_activation_steps: { value: function(e) { - if (this.type === `checkbox`) this.checked = !this.checked; - else if (this.type === `radio`) for (var t = this.form.getElementsByName(this.name), n = t.length - 1; n >= 0; n--) { - var r = t[n]; - r.checked = r === this; - } - } } - }, - attributes: { - name: String, - disabled: Boolean, - autofocus: Boolean, - accept: String, - alt: String, - max: String, - min: String, - pattern: String, - placeholder: String, - step: String, - dirName: String, - defaultValue: { name: `value` }, - multiple: Boolean, - required: Boolean, - readOnly: Boolean, - checked: Boolean, - value: String, - src: f, - defaultChecked: { - name: `checked`, - type: Boolean - }, - size: { - type: `unsigned long`, - default: 20, - min: 1, - setmin: 1 - }, - width: { - type: `unsigned long`, - min: 0, - setmin: 0, - default: 0 - }, - height: { - type: `unsigned long`, - min: 0, - setmin: 0, - default: 0 - }, - minLength: { - type: `unsigned long`, - min: 0, - setmin: 0, - default: -1 - }, - maxLength: { - type: `unsigned long`, - min: 0, - setmin: 0, - default: -1 - }, - autocomplete: String, - type: { - type: [ - `text`, - `hidden`, - `search`, - `tel`, - `url`, - `email`, - `password`, - `datetime`, - `date`, - `month`, - `week`, - `time`, - `datetime-local`, - `number`, - `range`, - `color`, - `checkbox`, - `radio`, - `file`, - `submit`, - `image`, - `reset`, - `button` - ], - missing: `text` - }, - formTarget: String, - formNoValidate: Boolean, - formMethod: { - type: [`get`, `post`], - invalid: `get`, - missing: `` - }, - formEnctype: { - type: [ - `application/x-www-form-urlencoded`, - `multipart/form-data`, - `text/plain` - ], - invalid: `application/x-www-form-urlencoded`, - missing: `` - }, - inputMode: { - type: [ - `verbatim`, - `latin`, - `latin-name`, - `latin-prose`, - `full-width-latin`, - `kana`, - `kana-name`, - `katakana`, - `numeric`, - `tel`, - `email`, - `url` - ], - missing: `` - }, - align: String, - useMap: String - } - }), d({ - tag: `keygen`, - name: `HTMLKeygenElement`, - ctor: function(e, t, n) { - g.call(this, e, t, n); - }, - props: y, - attributes: { - name: String, - disabled: Boolean, - autofocus: Boolean, - challenge: String, - keytype: { - type: [`rsa`], - missing: `` - } - } - }), d({ - tag: `li`, - name: `HTMLLIElement`, - ctor: function(e, t, n) { - _.call(this, e, t, n); - }, - attributes: { - value: { - type: `long`, - default: 0 - }, - type: String - } - }), d({ - tag: `label`, - name: `HTMLLabelElement`, - ctor: function(e, t, n) { - g.call(this, e, t, n); - }, - props: y, - attributes: { htmlFor: { - name: `for`, - type: String - } } - }), d({ - tag: `legend`, - name: `HTMLLegendElement`, - ctor: function(e, t, n) { - _.call(this, e, t, n); - }, - attributes: { align: String } - }), d({ - tag: `link`, - name: `HTMLLinkElement`, - ctor: function(e, t, n) { - _.call(this, e, t, n); - }, - attributes: { - href: f, - rel: String, - media: String, - hreflang: String, - type: String, - crossOrigin: p, - nonce: String, - integrity: String, - referrerPolicy: m, - imageSizes: String, - imageSrcset: String, - charset: String, - rev: String, - target: String - } - }), d({ - tag: `map`, - name: `HTMLMapElement`, - ctor: function(e, t, n) { - _.call(this, e, t, n); - }, - attributes: { name: String } - }), d({ - tag: `menu`, - name: `HTMLMenuElement`, - ctor: function(e, t, n) { - _.call(this, e, t, n); - }, - attributes: { - type: { - type: [ - `context`, - `popup`, - `toolbar` - ], - missing: `toolbar` - }, - label: String, - compact: Boolean - } - }), d({ - tag: `meta`, - name: `HTMLMetaElement`, - ctor: function(e, t, n) { - _.call(this, e, t, n); - }, - attributes: { - name: String, - content: String, - httpEquiv: { - name: `http-equiv`, - type: String - }, - scheme: String - } - }), d({ - tag: `meter`, - name: `HTMLMeterElement`, - ctor: function(e, t, n) { - g.call(this, e, t, n); - }, - props: y - }), d({ - tags: [`ins`, `del`], - name: `HTMLModElement`, - ctor: function(e, t, n) { - _.call(this, e, t, n); - }, - attributes: { - cite: f, - dateTime: String - } - }), d({ - tag: `ol`, - name: `HTMLOListElement`, - ctor: function(e, t, n) { - _.call(this, e, t, n); - }, - props: { _numitems: { get: function() { - var e = 0; - return this.childNodes.forEach(function(n) { - n.nodeType === t.ELEMENT_NODE && n.tagName === `LI` && e++; - }), e; - } } }, - attributes: { - type: String, - reversed: Boolean, - start: { - type: `long`, - default: function() { - return this.reversed ? this._numitems : 1; - } - }, - compact: Boolean - } - }), d({ - tag: `object`, - name: `HTMLObjectElement`, - ctor: function(e, t, n) { - g.call(this, e, t, n); - }, - props: y, - attributes: { - data: f, - type: String, - name: String, - useMap: String, - typeMustMatch: Boolean, - width: String, - height: String, - align: String, - archive: String, - code: String, - declare: Boolean, - hspace: { - type: `unsigned long`, - default: 0 - }, - standby: String, - vspace: { - type: `unsigned long`, - default: 0 - }, - codeBase: f, - codeType: String, - border: { - type: String, - treatNullAsEmptyString: !0 - } - } - }), d({ - tag: `optgroup`, - name: `HTMLOptGroupElement`, - ctor: function(e, t, n) { - _.call(this, e, t, n); - }, - attributes: { - disabled: Boolean, - label: String - } - }), d({ - tag: `option`, - name: `HTMLOptionElement`, - ctor: function(e, t, n) { - _.call(this, e, t, n); - }, - props: { - form: { get: function() { - for (var e = this.parentNode; e && e.nodeType === t.ELEMENT_NODE;) { - if (e.localName === `select`) return e.form; - e = e.parentNode; - } - } }, - value: { - get: function() { - return this._getattr(`value`) || this.text; - }, - set: function(e) { - this._setattr(`value`, e); - } - }, - text: { - get: function() { - return this.textContent.replace(/[ \t\n\f\r]+/g, ` `).trim(); - }, - set: function(e) { - this.textContent = e; - } - } - }, - attributes: { - disabled: Boolean, - defaultSelected: { - name: `selected`, - type: Boolean - }, - label: String - } - }), d({ - tag: `output`, - name: `HTMLOutputElement`, - ctor: function(e, t, n) { - g.call(this, e, t, n); - }, - props: y, - attributes: { name: String } - }), d({ - tag: `p`, - name: `HTMLParagraphElement`, - ctor: function(e, t, n) { - _.call(this, e, t, n); - }, - attributes: { align: String } - }), d({ - tag: `param`, - name: `HTMLParamElement`, - ctor: function(e, t, n) { - _.call(this, e, t, n); - }, - attributes: { - name: String, - value: String, - type: String, - valueType: String - } - }), d({ - tags: [ - `pre`, - `listing`, - `xmp` - ], - name: `HTMLPreElement`, - ctor: function(e, t, n) { - _.call(this, e, t, n); - }, - attributes: { width: { - type: `long`, - default: 0 - } } - }), d({ - tag: `progress`, - name: `HTMLProgressElement`, - ctor: function(e, t, n) { - g.call(this, e, t, n); - }, - props: y, - attributes: { max: { - type: Number, - float: !0, - default: 1, - min: 0 - } } - }), d({ - tags: [`q`, `blockquote`], - name: `HTMLQuoteElement`, - ctor: function(e, t, n) { - _.call(this, e, t, n); - }, - attributes: { cite: f } - }), d({ - tag: `script`, - name: `HTMLScriptElement`, - ctor: function(e, t, n) { - _.call(this, e, t, n); - }, - props: { text: { - get: function() { - for (var e = ``, n = 0, r = this.childNodes.length; n < r; n++) { - var i = this.childNodes[n]; - i.nodeType === t.TEXT_NODE && (e += i._data); - } - return e; - }, - set: function(e) { - this.removeChildren(), e !== null && e !== `` && this.appendChild(this.ownerDocument.createTextNode(e)); - } - } }, - attributes: { - src: f, - type: String, - charset: String, - referrerPolicy: m, - defer: Boolean, - async: Boolean, - nomodule: Boolean, - crossOrigin: p, - nonce: String, - integrity: String - } - }), d({ - tag: `select`, - name: `HTMLSelectElement`, - ctor: function(e, t, n) { - g.call(this, e, t, n); - }, - props: { - form: y.form, - options: { get: function() { - return this.getElementsByTagName(`option`); - } } - }, - attributes: { - autocomplete: String, - name: String, - disabled: Boolean, - autofocus: Boolean, - multiple: Boolean, - required: Boolean, - size: { - type: `unsigned long`, - default: 0 - } - } - }), d({ - tag: `span`, - name: `HTMLSpanElement`, - ctor: function(e, t, n) { - _.call(this, e, t, n); - } - }), d({ - tag: `style`, - name: `HTMLStyleElement`, - ctor: function(e, t, n) { - _.call(this, e, t, n); - }, - attributes: { - media: String, - type: String, - scoped: Boolean - } - }), d({ - tag: `caption`, - name: `HTMLTableCaptionElement`, - ctor: function(e, t, n) { - _.call(this, e, t, n); - }, - attributes: { align: String } - }), d({ - name: `HTMLTableCellElement`, - ctor: function(e, t, n) { - _.call(this, e, t, n); - }, - attributes: { - colSpan: { - type: `unsigned long`, - default: 1 - }, - rowSpan: { - type: `unsigned long`, - default: 1 - }, - scope: { - type: [ - `row`, - `col`, - `rowgroup`, - `colgroup` - ], - missing: `` - }, - abbr: String, - align: String, - axis: String, - height: String, - width: String, - ch: { - name: `char`, - type: String - }, - chOff: { - name: `charoff`, - type: String - }, - noWrap: Boolean, - vAlign: String, - bgColor: { - type: String, - treatNullAsEmptyString: !0 - } - } - }), d({ - tags: [`col`, `colgroup`], - name: `HTMLTableColElement`, - ctor: function(e, t, n) { - _.call(this, e, t, n); - }, - attributes: { - span: { - type: `limited unsigned long with fallback`, - default: 1, - min: 1 - }, - align: String, - ch: { - name: `char`, - type: String - }, - chOff: { - name: `charoff`, - type: String - }, - vAlign: String, - width: String - } - }), d({ - tag: `table`, - name: `HTMLTableElement`, - ctor: function(e, t, n) { - _.call(this, e, t, n); - }, - props: { rows: { get: function() { - return this.getElementsByTagName(`tr`); - } } }, - attributes: { - align: String, - border: String, - frame: String, - rules: String, - summary: String, - width: String, - bgColor: { - type: String, - treatNullAsEmptyString: !0 - }, - cellPadding: { - type: String, - treatNullAsEmptyString: !0 - }, - cellSpacing: { - type: String, - treatNullAsEmptyString: !0 - } - } - }), d({ - tag: `template`, - name: `HTMLTemplateElement`, - ctor: function(e, t, n) { - _.call(this, e, t, n), this._contentFragment = e._templateDoc.createDocumentFragment(); - }, - props: { - content: { get: function() { - return this._contentFragment; - } }, - serialize: { value: function() { - return this.content.serialize(); - } } - } - }), d({ - tag: `tr`, - name: `HTMLTableRowElement`, - ctor: function(e, t, n) { - _.call(this, e, t, n); - }, - props: { cells: { get: function() { - return this.querySelectorAll(`td,th`); - } } }, - attributes: { - align: String, - ch: { - name: `char`, - type: String - }, - chOff: { - name: `charoff`, - type: String - }, - vAlign: String, - bgColor: { - type: String, - treatNullAsEmptyString: !0 - } - } - }), d({ - tags: [ - `thead`, - `tfoot`, - `tbody` - ], - name: `HTMLTableSectionElement`, - ctor: function(e, t, n) { - _.call(this, e, t, n); - }, - props: { rows: { get: function() { - return this.getElementsByTagName(`tr`); - } } }, - attributes: { - align: String, - ch: { - name: `char`, - type: String - }, - chOff: { - name: `charoff`, - type: String - }, - vAlign: String - } - }), d({ - tag: `textarea`, - name: `HTMLTextAreaElement`, - ctor: function(e, t, n) { - g.call(this, e, t, n); - }, - props: { - form: y.form, - type: { get: function() { - return `textarea`; - } }, - defaultValue: { - get: function() { - return this.textContent; - }, - set: function(e) { - this.textContent = e; - } - }, - value: { - get: function() { - return this.defaultValue; - }, - set: function(e) { - this.defaultValue = e; - } - }, - textLength: { get: function() { - return this.value.length; - } } - }, - attributes: { - autocomplete: String, - name: String, - disabled: Boolean, - autofocus: Boolean, - placeholder: String, - wrap: String, - dirName: String, - required: Boolean, - readOnly: Boolean, - rows: { - type: `limited unsigned long with fallback`, - default: 2 - }, - cols: { - type: `limited unsigned long with fallback`, - default: 20 - }, - maxLength: { - type: `unsigned long`, - min: 0, - setmin: 0, - default: -1 - }, - minLength: { - type: `unsigned long`, - min: 0, - setmin: 0, - default: -1 - }, - inputMode: { - type: [ - `verbatim`, - `latin`, - `latin-name`, - `latin-prose`, - `full-width-latin`, - `kana`, - `kana-name`, - `katakana`, - `numeric`, - `tel`, - `email`, - `url` - ], - missing: `` - } - } - }), d({ - tag: `time`, - name: `HTMLTimeElement`, - ctor: function(e, t, n) { - _.call(this, e, t, n); - }, - attributes: { - dateTime: String, - pubDate: Boolean - } - }), d({ - tag: `title`, - name: `HTMLTitleElement`, - ctor: function(e, t, n) { - _.call(this, e, t, n); - }, - props: { text: { get: function() { - return this.textContent; - } } } - }), d({ - tag: `ul`, - name: `HTMLUListElement`, - ctor: function(e, t, n) { - _.call(this, e, t, n); - }, - attributes: { - type: String, - compact: Boolean - } - }), d({ - name: `HTMLMediaElement`, - ctor: function(e, t, n) { - _.call(this, e, t, n); - }, - attributes: { - src: f, - crossOrigin: p, - preload: { - type: [ - `metadata`, - `none`, - `auto`, - { - value: ``, - alias: `auto` - } - ], - missing: `auto` - }, - loop: Boolean, - autoplay: Boolean, - mediaGroup: String, - controls: Boolean, - defaultMuted: { - name: `muted`, - type: Boolean - } - } - }), d({ - name: `HTMLAudioElement`, - tag: `audio`, - superclass: c.HTMLMediaElement, - ctor: function(e, t, n) { - c.HTMLMediaElement.call(this, e, t, n); - } - }), d({ - name: `HTMLVideoElement`, - tag: `video`, - superclass: c.HTMLMediaElement, - ctor: function(e, t, n) { - c.HTMLMediaElement.call(this, e, t, n); - }, - attributes: { - poster: f, - width: { - type: `unsigned long`, - min: 0, - default: 0 - }, - height: { - type: `unsigned long`, - min: 0, - default: 0 - } - } - }), d({ - tag: `td`, - name: `HTMLTableDataCellElement`, - superclass: c.HTMLTableCellElement, - ctor: function(e, t, n) { - c.HTMLTableCellElement.call(this, e, t, n); - } - }), d({ - tag: `th`, - name: `HTMLTableHeaderCellElement`, - superclass: c.HTMLTableCellElement, - ctor: function(e, t, n) { - c.HTMLTableCellElement.call(this, e, t, n); - } - }), d({ - tag: `frameset`, - name: `HTMLFrameSetElement`, - ctor: function(e, t, n) { - _.call(this, e, t, n); - } - }), d({ - tag: `frame`, - name: `HTMLFrameElement`, - ctor: function(e, t, n) { - _.call(this, e, t, n); - } - }), d({ - tag: `canvas`, - name: `HTMLCanvasElement`, - ctor: function(e, t, n) { - _.call(this, e, t, n); - }, - props: { - getContext: { value: i.nyi }, - probablySupportsContext: { value: i.nyi }, - setContext: { value: i.nyi }, - transferControlToProxy: { value: i.nyi }, - toDataURL: { value: i.nyi }, - toBlob: { value: i.nyi } - }, - attributes: { - width: { - type: `unsigned long`, - default: 300 - }, - height: { - type: `unsigned long`, - default: 150 - } - } - }), d({ - tag: `dialog`, - name: `HTMLDialogElement`, - ctor: function(e, t, n) { - _.call(this, e, t, n); - }, - props: { - show: { value: i.nyi }, - showModal: { value: i.nyi }, - close: { value: i.nyi } - }, - attributes: { - open: Boolean, - returnValue: String - } - }), d({ - tag: `menuitem`, - name: `HTMLMenuItemElement`, - ctor: function(e, t, n) { - _.call(this, e, t, n); - }, - props: { - _label: { get: function() { - var e = this._getattr(`label`); - return e !== null && e !== `` ? e : (e = this.textContent, e.replace(/[ \t\n\f\r]+/g, ` `).trim()); - } }, - label: { - get: function() { - var e = this._getattr(`label`); - return e === null ? this._label : e; - }, - set: function(e) { - this._setattr(`label`, e); - } - } - }, - attributes: { - type: { - type: [ - `command`, - `checkbox`, - `radio` - ], - missing: `command` - }, - icon: f, - disabled: Boolean, - checked: Boolean, - radiogroup: String, - default: Boolean - } - }), d({ - tag: `source`, - name: `HTMLSourceElement`, - ctor: function(e, t, n) { - _.call(this, e, t, n); - }, - attributes: { - srcset: String, - sizes: String, - media: String, - src: f, - type: String, - width: String, - height: String - } - }), d({ - tag: `track`, - name: `HTMLTrackElement`, - ctor: function(e, t, n) { - _.call(this, e, t, n); - }, - attributes: { - src: f, - srclang: String, - label: String, - default: Boolean, - kind: { - type: [ - `subtitles`, - `captions`, - `descriptions`, - `chapters`, - `metadata` - ], - missing: `subtitles`, - invalid: `metadata` - } - }, - props: { - NONE: { get: function() { - return 0; - } }, - LOADING: { get: function() { - return 1; - } }, - LOADED: { get: function() { - return 2; - } }, - ERROR: { get: function() { - return 3; - } }, - readyState: { get: i.nyi }, - track: { get: i.nyi } - } - }), d({ - tag: `font`, - name: `HTMLFontElement`, - ctor: function(e, t, n) { - _.call(this, e, t, n); - }, - attributes: { - color: { - type: String, - treatNullAsEmptyString: !0 - }, - face: { type: String }, - size: { type: String } - } - }), d({ - tag: `dir`, - name: `HTMLDirectoryElement`, - ctor: function(e, t, n) { - _.call(this, e, t, n); - }, - attributes: { compact: Boolean } - }), d({ tags: `abbr.address.article.aside.b.bdi.bdo.cite.content.code.dd.dfn.dt.em.figcaption.figure.footer.header.hgroup.i.kbd.main.mark.nav.noscript.rb.rp.rt.rtc.ruby.s.samp.section.small.strong.sub.summary.sup.u.var.wbr.acronym.basefont.big.center.nobr.noembed.noframes.plaintext.strike.tt`.split(`.`) }); -})); -var M$7 = e$2(((e) => { - var t = C$8(), n = A$7(), r = o$8(), i = le$7(), a = e.elements = {}, s = Object.create(null); - e.createElement = function(e, t, n) { - return new (s[t] || l)(e, t, n); - }; - function c(e) { - return n(e, l, a, s); - } - var l = c({ - superclass: t, - name: `SVGElement`, - ctor: function(e, n, i) { - t.call(this, e, n, r.NAMESPACE.SVG, i); - }, - props: { style: { get: function() { - return this._style ||= new i(this), this._style; - } } } - }); - c({ - name: `SVGSVGElement`, - ctor: function(e, t, n) { - l.call(this, e, t, n); - }, - tag: `svg`, - props: { createSVGRect: { value: function() { - return e.createElement(this.ownerDocument, `rect`, null); - } } } - }), c({ tags: `a.altGlyph.altGlyphDef.altGlyphItem.animate.animateColor.animateMotion.animateTransform.circle.clipPath.color-profile.cursor.defs.desc.ellipse.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.filter.font.font-face.font-face-format.font-face-name.font-face-src.font-face-uri.foreignObject.g.glyph.glyphRef.hkern.image.line.linearGradient.marker.mask.metadata.missing-glyph.mpath.path.pattern.polygon.polyline.radialGradient.rect.script.set.stop.style.switch.symbol.text.textPath.title.tref.tspan.use.view.vkern`.split(`.`) }); -})); -var ue$7 = e$2(((e, t) => { - t.exports = { - VALUE: 1, - ATTR: 2, - REMOVE_ATTR: 3, - REMOVE: 4, - MOVE: 5, - INSERT: 6 - }; -})); -var de$7 = e$2(((e, n) => { - n.exports = fe; - var r = u$8(), i = p$10(), s = m$7(), c = C$8(), l = E$8(), d = D$7(), f = t$7(), g = ee$5(), _ = te$5(), v = pe$7(), b = O$6(), x = ie$5(), S = ne$5(), w = ae$6(), T = y$5(), re = se$7(), oe = h$8(), ce = j$6(), le = M$7(), k = o$8(), A = ue$7(), de = k.NAMESPACE, N = a$8().isApiWritable; - function fe(e, t) { - s.call(this), this.nodeType = r.DOCUMENT_NODE, this.isHTML = e, this._address = t || `about:blank`, this.readyState = `loading`, this.implementation = new v(this), this.ownerDocument = null, this._contentType = e ? `text/html` : `application/xml`, this.doctype = null, this.documentElement = null, this._templateDocCache = null, this._nodeIterators = null, this._nid = 1, this._nextnid = 2, this._nodes = [null, this], this.byId = Object.create(null), this.modclock = 0; - } - var me = { - event: `Event`, - customevent: `CustomEvent`, - uievent: `UIEvent`, - mouseevent: `MouseEvent` - }, he = { - events: `event`, - htmlevents: `event`, - mouseevents: `mouseevent`, - mutationevents: `mutationevent`, - uievents: `uievent` - }, ge = function(e, t, n) { - return { - get: function() { - var r = e.call(this); - return r ? r[t] : n; - }, - set: function(n) { - var r = e.call(this); - r && (r[t] = n); - } - }; - }; - function _e(e, t) { - var n, r, i; - return e === `` && (e = null), oe.isValidQName(t) || k.InvalidCharacterError(), n = null, r = t, i = t.indexOf(`:`), i >= 0 && (n = t.substring(0, i), r = t.substring(i + 1)), n !== null && e === null && k.NamespaceError(), n === `xml` && e !== de.XML && k.NamespaceError(), (n === `xmlns` || t === `xmlns`) && e !== de.XMLNS && k.NamespaceError(), e === de.XMLNS && !(n === `xmlns` || t === `xmlns`) && k.NamespaceError(), { - namespace: e, - prefix: n, - localName: r - }; - } - fe.prototype = Object.create(s.prototype, { - _setMutationHandler: { value: function(e) { - this.mutationHandler = e; - } }, - _dispatchRendererEvent: { value: function(e, t, n) { - var r = this._nodes[e]; - r && r._dispatchEvent(new f(t, n), !0); - } }, - nodeName: { value: `#document` }, - nodeValue: { - get: function() { - return null; - }, - set: function() {} - }, - documentURI: { - get: function() { - return this._address; - }, - set: k.nyi - }, - compatMode: { get: function() { - return this._quirks ? `BackCompat` : `CSS1Compat`; - } }, - createTextNode: { value: function(e) { - return new l(this, String(e)); - } }, - createComment: { value: function(e) { - return new d(this, e); - } }, - createDocumentFragment: { value: function() { - return new g(this); - } }, - createProcessingInstruction: { value: function(e, t) { - return (!oe.isValidName(e) || t.indexOf(`?>`) !== -1) && k.InvalidCharacterError(), new _(this, e, t); - } }, - createAttribute: { value: function(e) { - return e = String(e), oe.isValidName(e) || k.InvalidCharacterError(), this.isHTML && (e = k.toASCIILowerCase(e)), new c._Attr(null, e, null, null, ``); - } }, - createAttributeNS: { value: function(e, t) { - e = e == null || e === `` ? null : String(e), t = String(t); - var n = _e(e, t); - return new c._Attr(null, n.localName, n.prefix, n.namespace, ``); - } }, - createElement: { - value: function(e) { - return e = String(e), oe.isValidName(e) || k.InvalidCharacterError(), this.isHTML ? (/[A-Z]/.test(e) && (e = k.toASCIILowerCase(e)), ce.createElement(this, e, null)) : this.contentType === `application/xhtml+xml` ? ce.createElement(this, e, null) : new c(this, e, null, null); - }, - writable: N - }, - createElementNS: { - value: function(e, t) { - e = e == null || e === `` ? null : String(e), t = String(t); - var n = _e(e, t); - return this._createElementNS(n.localName, n.namespace, n.prefix); - }, - writable: N - }, - _createElementNS: { value: function(e, t, n) { - return t === de.HTML ? ce.createElement(this, e, n) : t === de.SVG ? le.createElement(this, e, n) : new c(this, e, t, n); - } }, - createEvent: { value: function(e) { - e = e.toLowerCase(); - var t = re[me[he[e] || e]]; - if (t) { - var n = new t(); - return n._initialized = !1, n; - } else k.NotSupportedError(); - } }, - createTreeWalker: { value: function(e, t, n) { - if (!e) throw TypeError(`root argument is required`); - if (!(e instanceof r)) throw TypeError(`root not a node`); - return t = t === void 0 ? S.SHOW_ALL : +t, n = n === void 0 ? null : n, new b(e, t, n); - } }, - createNodeIterator: { value: function(e, t, n) { - if (!e) throw TypeError(`root argument is required`); - if (!(e instanceof r)) throw TypeError(`root not a node`); - return t = t === void 0 ? S.SHOW_ALL : +t, n = n === void 0 ? null : n, new x(e, t, n); - } }, - _attachNodeIterator: { value: function(e) { - this._nodeIterators ||= [], this._nodeIterators.push(e); - } }, - _detachNodeIterator: { value: function(e) { - var t = this._nodeIterators.indexOf(e); - this._nodeIterators.splice(t, 1); - } }, - _preremoveNodeIterators: { value: function(e) { - this._nodeIterators && this._nodeIterators.forEach(function(t) { - t._preremove(e); - }); - } }, - _updateDocTypeElement: { value: function() { - this.doctype = this.documentElement = null; - for (var e = this.firstChild; e !== null; e = e.nextSibling) e.nodeType === r.DOCUMENT_TYPE_NODE ? this.doctype = e : e.nodeType === r.ELEMENT_NODE && (this.documentElement = e); - } }, - insertBefore: { value: function(e, t) { - return r.prototype.insertBefore.call(this, e, t), this._updateDocTypeElement(), e; - } }, - replaceChild: { value: function(e, t) { - return r.prototype.replaceChild.call(this, e, t), this._updateDocTypeElement(), t; - } }, - removeChild: { value: function(e) { - return r.prototype.removeChild.call(this, e), this._updateDocTypeElement(), e; - } }, - getElementById: { value: function(e) { - var t = this.byId[e]; - return t ? t instanceof we ? t.getFirst() : t : null; - } }, - _hasMultipleElementsWithId: { value: function(e) { - return this.byId[e] instanceof we; - } }, - getElementsByName: { value: c.prototype.getElementsByName }, - getElementsByTagName: { value: c.prototype.getElementsByTagName }, - getElementsByTagNameNS: { value: c.prototype.getElementsByTagNameNS }, - getElementsByClassName: { value: c.prototype.getElementsByClassName }, - adoptNode: { value: function(e) { - return e.nodeType === r.DOCUMENT_NODE && k.NotSupportedError(), e.nodeType === r.ATTRIBUTE_NODE ? e : (e.parentNode && e.parentNode.removeChild(e), e.ownerDocument !== this && Ce(e, this), e); - } }, - importNode: { - value: function(e, t) { - return this.adoptNode(e.cloneNode(t)); - }, - writable: N - }, - origin: { get: function() { - return null; - } }, - characterSet: { get: function() { - return `UTF-8`; - } }, - contentType: { get: function() { - return this._contentType; - } }, - URL: { get: function() { - return this._address; - } }, - domain: { - get: k.nyi, - set: k.nyi - }, - referrer: { get: k.nyi }, - cookie: { - get: k.nyi, - set: k.nyi - }, - lastModified: { get: k.nyi }, - location: { - get: function() { - return this.defaultView ? this.defaultView.location : null; - }, - set: k.nyi - }, - _titleElement: { get: function() { - return this.getElementsByTagName(`title`).item(0) || null; - } }, - title: { - get: function() { - var e = this._titleElement; - return (e ? e.textContent : ``).replace(/[ \t\n\r\f]+/g, ` `).replace(/(^ )|( $)/g, ``); - }, - set: function(e) { - var t = this._titleElement, n = this.head; - !t && !n || (t || (t = this.createElement(`title`), n.appendChild(t)), t.textContent = e); - } - }, - dir: ge(function() { - var e = this.documentElement; - if (e && e.tagName === `HTML`) return e; - }, `dir`, ``), - fgColor: ge(function() { - return this.body; - }, `text`, ``), - linkColor: ge(function() { - return this.body; - }, `link`, ``), - vlinkColor: ge(function() { - return this.body; - }, `vLink`, ``), - alinkColor: ge(function() { - return this.body; - }, `aLink`, ``), - bgColor: ge(function() { - return this.body; - }, `bgColor`, ``), - charset: { get: function() { - return this.characterSet; - } }, - inputEncoding: { get: function() { - return this.characterSet; - } }, - scrollingElement: { get: function() { - return this._quirks ? this.body : this.documentElement; - } }, - body: { - get: function() { - return ve(this.documentElement, `body`); - }, - set: k.nyi - }, - head: { get: function() { - return ve(this.documentElement, `head`); - } }, - images: { get: k.nyi }, - embeds: { get: k.nyi }, - plugins: { get: k.nyi }, - links: { get: k.nyi }, - forms: { get: k.nyi }, - scripts: { get: k.nyi }, - applets: { get: function() { - return []; - } }, - activeElement: { get: function() { - return null; - } }, - innerHTML: { - get: function() { - return this.serialize(); - }, - set: k.nyi - }, - outerHTML: { - get: function() { - return this.serialize(); - }, - set: k.nyi - }, - write: { value: function(e) { - if (this.isHTML || k.InvalidStateError(), this._parser) { - this._parser; - var t = arguments.join(``); - this._parser.parse(t); - } - } }, - writeln: { value: function(e) { - this.write(Array.prototype.join.call(arguments, ``) + ` -`); - } }, - open: { value: function() { - this.documentElement = null; - } }, - close: { value: function() { - this.readyState = `interactive`, this._dispatchEvent(new f(`readystatechange`), !0), this._dispatchEvent(new f(`DOMContentLoaded`), !0), this.readyState = `complete`, this._dispatchEvent(new f(`readystatechange`), !0), this.defaultView && this.defaultView._dispatchEvent(new f(`load`), !0); - } }, - clone: { value: function() { - var e = new fe(this.isHTML, this._address); - return e._quirks = this._quirks, e._contentType = this._contentType, e; - } }, - cloneNode: { value: function(e) { - var t = r.prototype.cloneNode.call(this, !1); - if (e) for (var n = this.firstChild; n !== null; n = n.nextSibling) t._appendChild(t.importNode(n, !0)); - return t._updateDocTypeElement(), t; - } }, - isEqual: { value: function(e) { - return !0; - } }, - mutateValue: { value: function(e) { - this.mutationHandler && this.mutationHandler({ - type: A.VALUE, - target: e, - data: e.data - }); - } }, - mutateAttr: { value: function(e, t) { - this.mutationHandler && this.mutationHandler({ - type: A.ATTR, - target: e.ownerElement, - attr: e - }); - } }, - mutateRemoveAttr: { value: function(e) { - this.mutationHandler && this.mutationHandler({ - type: A.REMOVE_ATTR, - target: e.ownerElement, - attr: e - }); - } }, - mutateRemove: { value: function(e) { - this.mutationHandler && this.mutationHandler({ - type: A.REMOVE, - target: e.parentNode, - node: e - }), Se(e); - } }, - mutateInsert: { value: function(e) { - xe(e), this.mutationHandler && this.mutationHandler({ - type: A.INSERT, - target: e.parentNode, - node: e - }); - } }, - mutateMove: { value: function(e) { - this.mutationHandler && this.mutationHandler({ - type: A.MOVE, - target: e - }); - } }, - addId: { value: function(e, t) { - var n = this.byId[e]; - n ? (n instanceof we || (n = new we(n), this.byId[e] = n), n.add(t)) : this.byId[e] = t; - } }, - delId: { value: function(e, t) { - var n = this.byId[e]; - k.assert(n), n instanceof we ? (n.del(t), n.length === 1 && (this.byId[e] = n.downgrade())) : this.byId[e] = void 0; - } }, - _resolve: { value: function(e) { - return new w(this._documentBaseURL).resolve(e); - } }, - _documentBaseURL: { get: function() { - var e = this._address; - e === `about:blank` && (e = `/`); - var t = this.querySelector(`base[href]`); - return t ? new w(e).resolve(t.getAttribute(`href`)) : e; - } }, - _templateDoc: { get: function() { - if (!this._templateDocCache) { - var e = new fe(this.isHTML, this._address); - this._templateDocCache = e._templateDocCache = e; - } - return this._templateDocCache; - } }, - querySelector: { value: function(e) { - return T(e, this)[0]; - } }, - querySelectorAll: { value: function(e) { - var t = T(e, this); - return t.item ? t : new i(t); - } } - }), `abort.canplay.canplaythrough.change.click.contextmenu.cuechange.dblclick.drag.dragend.dragenter.dragleave.dragover.dragstart.drop.durationchange.emptied.ended.input.invalid.keydown.keypress.keyup.loadeddata.loadedmetadata.loadstart.mousedown.mousemove.mouseout.mouseover.mouseup.mousewheel.pause.play.playing.progress.ratechange.readystatechange.reset.seeked.seeking.select.show.stalled.submit.suspend.timeupdate.volumechange.waiting.blur.error.focus.load.scroll`.split(`.`).forEach(function(e) { - Object.defineProperty(fe.prototype, `on` + e, { - get: function() { - return this._getEventHandler(e); - }, - set: function(t) { - this._setEventHandler(e, t); - } - }); - }); - function ve(e, t) { - if (e && e.isHTML) { - for (var n = e.firstChild; n !== null; n = n.nextSibling) if (n.nodeType === r.ELEMENT_NODE && n.localName === t && n.namespaceURI === de.HTML) return n; - } - return null; - } - function ye(e) { - if (e._nid = e.ownerDocument._nextnid++, e.ownerDocument._nodes[e._nid] = e, e.nodeType === r.ELEMENT_NODE) { - var t = e.getAttribute(`id`); - t && e.ownerDocument.addId(t, e), e._roothook && e._roothook(); - } - } - function be(e) { - if (e.nodeType === r.ELEMENT_NODE) { - var t = e.getAttribute(`id`); - t && e.ownerDocument.delId(t, e); - } - e.ownerDocument._nodes[e._nid] = void 0, e._nid = void 0; - } - function xe(e) { - if (ye(e), e.nodeType === r.ELEMENT_NODE) for (var t = e.firstChild; t !== null; t = t.nextSibling) xe(t); - } - function Se(e) { - be(e); - for (var t = e.firstChild; t !== null; t = t.nextSibling) Se(t); - } - function Ce(e, t) { - e.ownerDocument = t, e._lastModTime = void 0, Object.prototype.hasOwnProperty.call(e, `_tagName`) && (e._tagName = void 0); - for (var n = e.firstChild; n !== null; n = n.nextSibling) Ce(n, t); - } - function we(e) { - this.nodes = Object.create(null), this.nodes[e._nid] = e, this.length = 1, this.firstNode = void 0; - } - we.prototype.add = function(e) { - this.nodes[e._nid] || (this.nodes[e._nid] = e, this.length++, this.firstNode = void 0); - }, we.prototype.del = function(e) { - this.nodes[e._nid] && (delete this.nodes[e._nid], this.length--, this.firstNode = void 0); - }, we.prototype.getFirst = function() { - if (!this.firstNode) for (var e in this.nodes) (this.firstNode === void 0 || this.firstNode.compareDocumentPosition(this.nodes[e]) & r.DOCUMENT_POSITION_PRECEDING) && (this.firstNode = this.nodes[e]); - return this.firstNode; - }, we.prototype.downgrade = function() { - if (this.length === 1) for (var e in this.nodes) return this.nodes[e]; - return this; - }; -})); -var N$6 = e$2(((e, t) => { - t.exports = a; - var n = u$8(), r = w$8(), i = b$7(); - function a(e, t, i, a) { - r.call(this), this.nodeType = n.DOCUMENT_TYPE_NODE, this.ownerDocument = e || null, this.name = t, this.publicId = i || ``, this.systemId = a || ``; - } - a.prototype = Object.create(r.prototype, { - nodeName: { get: function() { - return this.name; - } }, - nodeValue: { - get: function() { - return null; - }, - set: function() {} - }, - clone: { value: function() { - return new a(this.ownerDocument, this.name, this.publicId, this.systemId); - } }, - isEqual: { value: function(e) { - return this.name === e.name && this.publicId === e.publicId && this.systemId === e.systemId; - } } - }), Object.defineProperties(a.prototype, i); -})); -var fe$7 = e$2(((e, t) => { - t.exports = L; - var n = de$7(), r = N$6(), i = u$8(), a = o$8().NAMESPACE, s = j$6(), c = s.elements, l = Function.prototype.apply.bind(Array.prototype.push), d = -1, f = 1, p = 2, m = 3, h = 4, g = 5, _ = [], v = /^HTML$|^-\/\/W3O\/\/DTD W3 HTML Strict 3\.0\/\/EN\/\/$|^-\/W3C\/DTD HTML 4\.0 Transitional\/EN$|^\+\/\/Silmaril\/\/dtd html Pro v0r11 19970101\/\/|^-\/\/AdvaSoft Ltd\/\/DTD HTML 3\.0 asWedit \+ extensions\/\/|^-\/\/AS\/\/DTD HTML 3\.0 asWedit \+ extensions\/\/|^-\/\/IETF\/\/DTD HTML 2\.0 Level 1\/\/|^-\/\/IETF\/\/DTD HTML 2\.0 Level 2\/\/|^-\/\/IETF\/\/DTD HTML 2\.0 Strict Level 1\/\/|^-\/\/IETF\/\/DTD HTML 2\.0 Strict Level 2\/\/|^-\/\/IETF\/\/DTD HTML 2\.0 Strict\/\/|^-\/\/IETF\/\/DTD HTML 2\.0\/\/|^-\/\/IETF\/\/DTD HTML 2\.1E\/\/|^-\/\/IETF\/\/DTD HTML 3\.0\/\/|^-\/\/IETF\/\/DTD HTML 3\.2 Final\/\/|^-\/\/IETF\/\/DTD HTML 3\.2\/\/|^-\/\/IETF\/\/DTD HTML 3\/\/|^-\/\/IETF\/\/DTD HTML Level 0\/\/|^-\/\/IETF\/\/DTD HTML Level 1\/\/|^-\/\/IETF\/\/DTD HTML Level 2\/\/|^-\/\/IETF\/\/DTD HTML Level 3\/\/|^-\/\/IETF\/\/DTD HTML Strict Level 0\/\/|^-\/\/IETF\/\/DTD HTML Strict Level 1\/\/|^-\/\/IETF\/\/DTD HTML Strict Level 2\/\/|^-\/\/IETF\/\/DTD HTML Strict Level 3\/\/|^-\/\/IETF\/\/DTD HTML Strict\/\/|^-\/\/IETF\/\/DTD HTML\/\/|^-\/\/Metrius\/\/DTD Metrius Presentational\/\/|^-\/\/Microsoft\/\/DTD Internet Explorer 2\.0 HTML Strict\/\/|^-\/\/Microsoft\/\/DTD Internet Explorer 2\.0 HTML\/\/|^-\/\/Microsoft\/\/DTD Internet Explorer 2\.0 Tables\/\/|^-\/\/Microsoft\/\/DTD Internet Explorer 3\.0 HTML Strict\/\/|^-\/\/Microsoft\/\/DTD Internet Explorer 3\.0 HTML\/\/|^-\/\/Microsoft\/\/DTD Internet Explorer 3\.0 Tables\/\/|^-\/\/Netscape Comm\. Corp\.\/\/DTD HTML\/\/|^-\/\/Netscape Comm\. Corp\.\/\/DTD Strict HTML\/\/|^-\/\/O'Reilly and Associates\/\/DTD HTML 2\.0\/\/|^-\/\/O'Reilly and Associates\/\/DTD HTML Extended 1\.0\/\/|^-\/\/O'Reilly and Associates\/\/DTD HTML Extended Relaxed 1\.0\/\/|^-\/\/SoftQuad Software\/\/DTD HoTMetaL PRO 6\.0::19990601::extensions to HTML 4\.0\/\/|^-\/\/SoftQuad\/\/DTD HoTMetaL PRO 4\.0::19971010::extensions to HTML 4\.0\/\/|^-\/\/Spyglass\/\/DTD HTML 2\.0 Extended\/\/|^-\/\/SQ\/\/DTD HTML 2\.0 HoTMetaL \+ extensions\/\/|^-\/\/Sun Microsystems Corp\.\/\/DTD HotJava HTML\/\/|^-\/\/Sun Microsystems Corp\.\/\/DTD HotJava Strict HTML\/\/|^-\/\/W3C\/\/DTD HTML 3 1995-03-24\/\/|^-\/\/W3C\/\/DTD HTML 3\.2 Draft\/\/|^-\/\/W3C\/\/DTD HTML 3\.2 Final\/\/|^-\/\/W3C\/\/DTD HTML 3\.2\/\/|^-\/\/W3C\/\/DTD HTML 3\.2S Draft\/\/|^-\/\/W3C\/\/DTD HTML 4\.0 Frameset\/\/|^-\/\/W3C\/\/DTD HTML 4\.0 Transitional\/\/|^-\/\/W3C\/\/DTD HTML Experimental 19960712\/\/|^-\/\/W3C\/\/DTD HTML Experimental 970421\/\/|^-\/\/W3C\/\/DTD W3 HTML\/\/|^-\/\/W3O\/\/DTD W3 HTML 3\.0\/\/|^-\/\/WebTechs\/\/DTD Mozilla HTML 2\.0\/\/|^-\/\/WebTechs\/\/DTD Mozilla HTML\/\//i, y = `http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd`, b = /^-\/\/W3C\/\/DTD HTML 4\.01 Frameset\/\/|^-\/\/W3C\/\/DTD HTML 4\.01 Transitional\/\//i, x = /^-\/\/W3C\/\/DTD XHTML 1\.0 Frameset\/\/|^-\/\/W3C\/\/DTD XHTML 1\.0 Transitional\/\//i, S = Object.create(null); - S[a.HTML] = { - __proto__: null, - address: !0, - applet: !0, - area: !0, - article: !0, - aside: !0, - base: !0, - basefont: !0, - bgsound: !0, - blockquote: !0, - body: !0, - br: !0, - button: !0, - caption: !0, - center: !0, - col: !0, - colgroup: !0, - dd: !0, - details: !0, - dir: !0, - div: !0, - dl: !0, - dt: !0, - embed: !0, - fieldset: !0, - figcaption: !0, - figure: !0, - footer: !0, - form: !0, - frame: !0, - frameset: !0, - h1: !0, - h2: !0, - h3: !0, - h4: !0, - h5: !0, - h6: !0, - head: !0, - header: !0, - hgroup: !0, - hr: !0, - html: !0, - iframe: !0, - img: !0, - input: !0, - li: !0, - link: !0, - listing: !0, - main: !0, - marquee: !0, - menu: !0, - meta: !0, - nav: !0, - noembed: !0, - noframes: !0, - noscript: !0, - object: !0, - ol: !0, - p: !0, - param: !0, - plaintext: !0, - pre: !0, - script: !0, - section: !0, - select: !0, - source: !0, - style: !0, - summary: !0, - table: !0, - tbody: !0, - td: !0, - template: !0, - textarea: !0, - tfoot: !0, - th: !0, - thead: !0, - title: !0, - tr: !0, - track: !0, - ul: !0, - wbr: !0, - xmp: !0 - }, S[a.SVG] = { - __proto__: null, - foreignObject: !0, - desc: !0, - title: !0 - }, S[a.MATHML] = { - __proto__: null, - mi: !0, - mo: !0, - mn: !0, - ms: !0, - mtext: !0, - "annotation-xml": !0 - }; - var C = Object.create(null); - C[a.HTML] = { - __proto__: null, - address: !0, - div: !0, - p: !0 - }; - var w = Object.create(null); - w[a.HTML] = { - __proto__: null, - dd: !0, - dt: !0 - }; - var T = Object.create(null); - T[a.HTML] = { - __proto__: null, - table: !0, - thead: !0, - tbody: !0, - tfoot: !0, - tr: !0 - }; - var E = Object.create(null); - E[a.HTML] = { - __proto__: null, - dd: !0, - dt: !0, - li: !0, - menuitem: !0, - optgroup: !0, - option: !0, - p: !0, - rb: !0, - rp: !0, - rt: !0, - rtc: !0 - }; - var D = Object.create(null); - D[a.HTML] = { - __proto__: null, - caption: !0, - colgroup: !0, - dd: !0, - dt: !0, - li: !0, - optgroup: !0, - option: !0, - p: !0, - rb: !0, - rp: !0, - rt: !0, - rtc: !0, - tbody: !0, - td: !0, - tfoot: !0, - th: !0, - thead: !0, - tr: !0 - }; - var ee = Object.create(null); - ee[a.HTML] = { - __proto__: null, - table: !0, - template: !0, - html: !0 - }; - var te = Object.create(null); - te[a.HTML] = { - __proto__: null, - tbody: !0, - tfoot: !0, - thead: !0, - template: !0, - html: !0 - }; - var ne = Object.create(null); - ne[a.HTML] = { - __proto__: null, - tr: !0, - template: !0, - html: !0 - }; - var re = Object.create(null); - re[a.HTML] = { - __proto__: null, - button: !0, - fieldset: !0, - input: !0, - keygen: !0, - object: !0, - output: !0, - select: !0, - textarea: !0, - img: !0 - }; - var O = Object.create(null); - O[a.HTML] = { - __proto__: null, - applet: !0, - caption: !0, - html: !0, - table: !0, - td: !0, - th: !0, - marquee: !0, - object: !0, - template: !0 - }, O[a.MATHML] = { - __proto__: null, - mi: !0, - mo: !0, - mn: !0, - ms: !0, - mtext: !0, - "annotation-xml": !0 - }, O[a.SVG] = { - __proto__: null, - foreignObject: !0, - desc: !0, - title: !0 - }; - var ie = Object.create(O); - ie[a.HTML] = Object.create(O[a.HTML]), ie[a.HTML].ol = !0, ie[a.HTML].ul = !0; - var ae = Object.create(O); - ae[a.HTML] = Object.create(O[a.HTML]), ae[a.HTML].button = !0; - var oe = Object.create(null); - oe[a.HTML] = { - __proto__: null, - html: !0, - table: !0, - template: !0 - }; - var se = Object.create(null); - se[a.HTML] = { - __proto__: null, - optgroup: !0, - option: !0 - }; - var ce = Object.create(null); - ce[a.MATHML] = { - __proto__: null, - mi: !0, - mo: !0, - mn: !0, - ms: !0, - mtext: !0 - }; - var le = Object.create(null); - le[a.SVG] = { - __proto__: null, - foreignObject: !0, - desc: !0, - title: !0 - }; - var k = { - __proto__: null, - "xlink:actuate": a.XLINK, - "xlink:arcrole": a.XLINK, - "xlink:href": a.XLINK, - "xlink:role": a.XLINK, - "xlink:show": a.XLINK, - "xlink:title": a.XLINK, - "xlink:type": a.XLINK, - "xml:base": a.XML, - "xml:lang": a.XML, - "xml:space": a.XML, - xmlns: a.XMLNS, - "xmlns:xlink": a.XMLNS - }, A = { - __proto__: null, - attributename: `attributeName`, - attributetype: `attributeType`, - basefrequency: `baseFrequency`, - baseprofile: `baseProfile`, - calcmode: `calcMode`, - clippathunits: `clipPathUnits`, - diffuseconstant: `diffuseConstant`, - edgemode: `edgeMode`, - filterunits: `filterUnits`, - glyphref: `glyphRef`, - gradienttransform: `gradientTransform`, - gradientunits: `gradientUnits`, - kernelmatrix: `kernelMatrix`, - kernelunitlength: `kernelUnitLength`, - keypoints: `keyPoints`, - keysplines: `keySplines`, - keytimes: `keyTimes`, - lengthadjust: `lengthAdjust`, - limitingconeangle: `limitingConeAngle`, - markerheight: `markerHeight`, - markerunits: `markerUnits`, - markerwidth: `markerWidth`, - maskcontentunits: `maskContentUnits`, - maskunits: `maskUnits`, - numoctaves: `numOctaves`, - pathlength: `pathLength`, - patterncontentunits: `patternContentUnits`, - patterntransform: `patternTransform`, - patternunits: `patternUnits`, - pointsatx: `pointsAtX`, - pointsaty: `pointsAtY`, - pointsatz: `pointsAtZ`, - preservealpha: `preserveAlpha`, - preserveaspectratio: `preserveAspectRatio`, - primitiveunits: `primitiveUnits`, - refx: `refX`, - refy: `refY`, - repeatcount: `repeatCount`, - repeatdur: `repeatDur`, - requiredextensions: `requiredExtensions`, - requiredfeatures: `requiredFeatures`, - specularconstant: `specularConstant`, - specularexponent: `specularExponent`, - spreadmethod: `spreadMethod`, - startoffset: `startOffset`, - stddeviation: `stdDeviation`, - stitchtiles: `stitchTiles`, - surfacescale: `surfaceScale`, - systemlanguage: `systemLanguage`, - tablevalues: `tableValues`, - targetx: `targetX`, - targety: `targetY`, - textlength: `textLength`, - viewbox: `viewBox`, - viewtarget: `viewTarget`, - xchannelselector: `xChannelSelector`, - ychannelselector: `yChannelSelector`, - zoomandpan: `zoomAndPan` - }, M = { - __proto__: null, - altglyph: `altGlyph`, - altglyphdef: `altGlyphDef`, - altglyphitem: `altGlyphItem`, - animatecolor: `animateColor`, - animatemotion: `animateMotion`, - animatetransform: `animateTransform`, - clippath: `clipPath`, - feblend: `feBlend`, - fecolormatrix: `feColorMatrix`, - fecomponenttransfer: `feComponentTransfer`, - fecomposite: `feComposite`, - feconvolvematrix: `feConvolveMatrix`, - fediffuselighting: `feDiffuseLighting`, - fedisplacementmap: `feDisplacementMap`, - fedistantlight: `feDistantLight`, - feflood: `feFlood`, - fefunca: `feFuncA`, - fefuncb: `feFuncB`, - fefuncg: `feFuncG`, - fefuncr: `feFuncR`, - fegaussianblur: `feGaussianBlur`, - feimage: `feImage`, - femerge: `feMerge`, - femergenode: `feMergeNode`, - femorphology: `feMorphology`, - feoffset: `feOffset`, - fepointlight: `fePointLight`, - fespecularlighting: `feSpecularLighting`, - fespotlight: `feSpotLight`, - fetile: `feTile`, - feturbulence: `feTurbulence`, - foreignobject: `foreignObject`, - glyphref: `glyphRef`, - lineargradient: `linearGradient`, - radialgradient: `radialGradient`, - textpath: `textPath` - }, ue = { - __proto__: null, - 0: 65533, - 128: 8364, - 130: 8218, - 131: 402, - 132: 8222, - 133: 8230, - 134: 8224, - 135: 8225, - 136: 710, - 137: 8240, - 138: 352, - 139: 8249, - 140: 338, - 142: 381, - 145: 8216, - 146: 8217, - 147: 8220, - 148: 8221, - 149: 8226, - 150: 8211, - 151: 8212, - 152: 732, - 153: 8482, - 154: 353, - 155: 8250, - 156: 339, - 158: 382, - 159: 376 - }, fe = { - __proto__: null, - AElig: 198, - "AElig;": 198, - AMP: 38, - "AMP;": 38, - Aacute: 193, - "Aacute;": 193, - "Abreve;": 258, - Acirc: 194, - "Acirc;": 194, - "Acy;": 1040, - "Afr;": [55349, 56580], - Agrave: 192, - "Agrave;": 192, - "Alpha;": 913, - "Amacr;": 256, - "And;": 10835, - "Aogon;": 260, - "Aopf;": [55349, 56632], - "ApplyFunction;": 8289, - Aring: 197, - "Aring;": 197, - "Ascr;": [55349, 56476], - "Assign;": 8788, - Atilde: 195, - "Atilde;": 195, - Auml: 196, - "Auml;": 196, - "Backslash;": 8726, - "Barv;": 10983, - "Barwed;": 8966, - "Bcy;": 1041, - "Because;": 8757, - "Bernoullis;": 8492, - "Beta;": 914, - "Bfr;": [55349, 56581], - "Bopf;": [55349, 56633], - "Breve;": 728, - "Bscr;": 8492, - "Bumpeq;": 8782, - "CHcy;": 1063, - COPY: 169, - "COPY;": 169, - "Cacute;": 262, - "Cap;": 8914, - "CapitalDifferentialD;": 8517, - "Cayleys;": 8493, - "Ccaron;": 268, - Ccedil: 199, - "Ccedil;": 199, - "Ccirc;": 264, - "Cconint;": 8752, - "Cdot;": 266, - "Cedilla;": 184, - "CenterDot;": 183, - "Cfr;": 8493, - "Chi;": 935, - "CircleDot;": 8857, - "CircleMinus;": 8854, - "CirclePlus;": 8853, - "CircleTimes;": 8855, - "ClockwiseContourIntegral;": 8754, - "CloseCurlyDoubleQuote;": 8221, - "CloseCurlyQuote;": 8217, - "Colon;": 8759, - "Colone;": 10868, - "Congruent;": 8801, - "Conint;": 8751, - "ContourIntegral;": 8750, - "Copf;": 8450, - "Coproduct;": 8720, - "CounterClockwiseContourIntegral;": 8755, - "Cross;": 10799, - "Cscr;": [55349, 56478], - "Cup;": 8915, - "CupCap;": 8781, - "DD;": 8517, - "DDotrahd;": 10513, - "DJcy;": 1026, - "DScy;": 1029, - "DZcy;": 1039, - "Dagger;": 8225, - "Darr;": 8609, - "Dashv;": 10980, - "Dcaron;": 270, - "Dcy;": 1044, - "Del;": 8711, - "Delta;": 916, - "Dfr;": [55349, 56583], - "DiacriticalAcute;": 180, - "DiacriticalDot;": 729, - "DiacriticalDoubleAcute;": 733, - "DiacriticalGrave;": 96, - "DiacriticalTilde;": 732, - "Diamond;": 8900, - "DifferentialD;": 8518, - "Dopf;": [55349, 56635], - "Dot;": 168, - "DotDot;": 8412, - "DotEqual;": 8784, - "DoubleContourIntegral;": 8751, - "DoubleDot;": 168, - "DoubleDownArrow;": 8659, - "DoubleLeftArrow;": 8656, - "DoubleLeftRightArrow;": 8660, - "DoubleLeftTee;": 10980, - "DoubleLongLeftArrow;": 10232, - "DoubleLongLeftRightArrow;": 10234, - "DoubleLongRightArrow;": 10233, - "DoubleRightArrow;": 8658, - "DoubleRightTee;": 8872, - "DoubleUpArrow;": 8657, - "DoubleUpDownArrow;": 8661, - "DoubleVerticalBar;": 8741, - "DownArrow;": 8595, - "DownArrowBar;": 10515, - "DownArrowUpArrow;": 8693, - "DownBreve;": 785, - "DownLeftRightVector;": 10576, - "DownLeftTeeVector;": 10590, - "DownLeftVector;": 8637, - "DownLeftVectorBar;": 10582, - "DownRightTeeVector;": 10591, - "DownRightVector;": 8641, - "DownRightVectorBar;": 10583, - "DownTee;": 8868, - "DownTeeArrow;": 8615, - "Downarrow;": 8659, - "Dscr;": [55349, 56479], - "Dstrok;": 272, - "ENG;": 330, - ETH: 208, - "ETH;": 208, - Eacute: 201, - "Eacute;": 201, - "Ecaron;": 282, - Ecirc: 202, - "Ecirc;": 202, - "Ecy;": 1069, - "Edot;": 278, - "Efr;": [55349, 56584], - Egrave: 200, - "Egrave;": 200, - "Element;": 8712, - "Emacr;": 274, - "EmptySmallSquare;": 9723, - "EmptyVerySmallSquare;": 9643, - "Eogon;": 280, - "Eopf;": [55349, 56636], - "Epsilon;": 917, - "Equal;": 10869, - "EqualTilde;": 8770, - "Equilibrium;": 8652, - "Escr;": 8496, - "Esim;": 10867, - "Eta;": 919, - Euml: 203, - "Euml;": 203, - "Exists;": 8707, - "ExponentialE;": 8519, - "Fcy;": 1060, - "Ffr;": [55349, 56585], - "FilledSmallSquare;": 9724, - "FilledVerySmallSquare;": 9642, - "Fopf;": [55349, 56637], - "ForAll;": 8704, - "Fouriertrf;": 8497, - "Fscr;": 8497, - "GJcy;": 1027, - GT: 62, - "GT;": 62, - "Gamma;": 915, - "Gammad;": 988, - "Gbreve;": 286, - "Gcedil;": 290, - "Gcirc;": 284, - "Gcy;": 1043, - "Gdot;": 288, - "Gfr;": [55349, 56586], - "Gg;": 8921, - "Gopf;": [55349, 56638], - "GreaterEqual;": 8805, - "GreaterEqualLess;": 8923, - "GreaterFullEqual;": 8807, - "GreaterGreater;": 10914, - "GreaterLess;": 8823, - "GreaterSlantEqual;": 10878, - "GreaterTilde;": 8819, - "Gscr;": [55349, 56482], - "Gt;": 8811, - "HARDcy;": 1066, - "Hacek;": 711, - "Hat;": 94, - "Hcirc;": 292, - "Hfr;": 8460, - "HilbertSpace;": 8459, - "Hopf;": 8461, - "HorizontalLine;": 9472, - "Hscr;": 8459, - "Hstrok;": 294, - "HumpDownHump;": 8782, - "HumpEqual;": 8783, - "IEcy;": 1045, - "IJlig;": 306, - "IOcy;": 1025, - Iacute: 205, - "Iacute;": 205, - Icirc: 206, - "Icirc;": 206, - "Icy;": 1048, - "Idot;": 304, - "Ifr;": 8465, - Igrave: 204, - "Igrave;": 204, - "Im;": 8465, - "Imacr;": 298, - "ImaginaryI;": 8520, - "Implies;": 8658, - "Int;": 8748, - "Integral;": 8747, - "Intersection;": 8898, - "InvisibleComma;": 8291, - "InvisibleTimes;": 8290, - "Iogon;": 302, - "Iopf;": [55349, 56640], - "Iota;": 921, - "Iscr;": 8464, - "Itilde;": 296, - "Iukcy;": 1030, - Iuml: 207, - "Iuml;": 207, - "Jcirc;": 308, - "Jcy;": 1049, - "Jfr;": [55349, 56589], - "Jopf;": [55349, 56641], - "Jscr;": [55349, 56485], - "Jsercy;": 1032, - "Jukcy;": 1028, - "KHcy;": 1061, - "KJcy;": 1036, - "Kappa;": 922, - "Kcedil;": 310, - "Kcy;": 1050, - "Kfr;": [55349, 56590], - "Kopf;": [55349, 56642], - "Kscr;": [55349, 56486], - "LJcy;": 1033, - LT: 60, - "LT;": 60, - "Lacute;": 313, - "Lambda;": 923, - "Lang;": 10218, - "Laplacetrf;": 8466, - "Larr;": 8606, - "Lcaron;": 317, - "Lcedil;": 315, - "Lcy;": 1051, - "LeftAngleBracket;": 10216, - "LeftArrow;": 8592, - "LeftArrowBar;": 8676, - "LeftArrowRightArrow;": 8646, - "LeftCeiling;": 8968, - "LeftDoubleBracket;": 10214, - "LeftDownTeeVector;": 10593, - "LeftDownVector;": 8643, - "LeftDownVectorBar;": 10585, - "LeftFloor;": 8970, - "LeftRightArrow;": 8596, - "LeftRightVector;": 10574, - "LeftTee;": 8867, - "LeftTeeArrow;": 8612, - "LeftTeeVector;": 10586, - "LeftTriangle;": 8882, - "LeftTriangleBar;": 10703, - "LeftTriangleEqual;": 8884, - "LeftUpDownVector;": 10577, - "LeftUpTeeVector;": 10592, - "LeftUpVector;": 8639, - "LeftUpVectorBar;": 10584, - "LeftVector;": 8636, - "LeftVectorBar;": 10578, - "Leftarrow;": 8656, - "Leftrightarrow;": 8660, - "LessEqualGreater;": 8922, - "LessFullEqual;": 8806, - "LessGreater;": 8822, - "LessLess;": 10913, - "LessSlantEqual;": 10877, - "LessTilde;": 8818, - "Lfr;": [55349, 56591], - "Ll;": 8920, - "Lleftarrow;": 8666, - "Lmidot;": 319, - "LongLeftArrow;": 10229, - "LongLeftRightArrow;": 10231, - "LongRightArrow;": 10230, - "Longleftarrow;": 10232, - "Longleftrightarrow;": 10234, - "Longrightarrow;": 10233, - "Lopf;": [55349, 56643], - "LowerLeftArrow;": 8601, - "LowerRightArrow;": 8600, - "Lscr;": 8466, - "Lsh;": 8624, - "Lstrok;": 321, - "Lt;": 8810, - "Map;": 10501, - "Mcy;": 1052, - "MediumSpace;": 8287, - "Mellintrf;": 8499, - "Mfr;": [55349, 56592], - "MinusPlus;": 8723, - "Mopf;": [55349, 56644], - "Mscr;": 8499, - "Mu;": 924, - "NJcy;": 1034, - "Nacute;": 323, - "Ncaron;": 327, - "Ncedil;": 325, - "Ncy;": 1053, - "NegativeMediumSpace;": 8203, - "NegativeThickSpace;": 8203, - "NegativeThinSpace;": 8203, - "NegativeVeryThinSpace;": 8203, - "NestedGreaterGreater;": 8811, - "NestedLessLess;": 8810, - "NewLine;": 10, - "Nfr;": [55349, 56593], - "NoBreak;": 8288, - "NonBreakingSpace;": 160, - "Nopf;": 8469, - "Not;": 10988, - "NotCongruent;": 8802, - "NotCupCap;": 8813, - "NotDoubleVerticalBar;": 8742, - "NotElement;": 8713, - "NotEqual;": 8800, - "NotEqualTilde;": [8770, 824], - "NotExists;": 8708, - "NotGreater;": 8815, - "NotGreaterEqual;": 8817, - "NotGreaterFullEqual;": [8807, 824], - "NotGreaterGreater;": [8811, 824], - "NotGreaterLess;": 8825, - "NotGreaterSlantEqual;": [10878, 824], - "NotGreaterTilde;": 8821, - "NotHumpDownHump;": [8782, 824], - "NotHumpEqual;": [8783, 824], - "NotLeftTriangle;": 8938, - "NotLeftTriangleBar;": [10703, 824], - "NotLeftTriangleEqual;": 8940, - "NotLess;": 8814, - "NotLessEqual;": 8816, - "NotLessGreater;": 8824, - "NotLessLess;": [8810, 824], - "NotLessSlantEqual;": [10877, 824], - "NotLessTilde;": 8820, - "NotNestedGreaterGreater;": [10914, 824], - "NotNestedLessLess;": [10913, 824], - "NotPrecedes;": 8832, - "NotPrecedesEqual;": [10927, 824], - "NotPrecedesSlantEqual;": 8928, - "NotReverseElement;": 8716, - "NotRightTriangle;": 8939, - "NotRightTriangleBar;": [10704, 824], - "NotRightTriangleEqual;": 8941, - "NotSquareSubset;": [8847, 824], - "NotSquareSubsetEqual;": 8930, - "NotSquareSuperset;": [8848, 824], - "NotSquareSupersetEqual;": 8931, - "NotSubset;": [8834, 8402], - "NotSubsetEqual;": 8840, - "NotSucceeds;": 8833, - "NotSucceedsEqual;": [10928, 824], - "NotSucceedsSlantEqual;": 8929, - "NotSucceedsTilde;": [8831, 824], - "NotSuperset;": [8835, 8402], - "NotSupersetEqual;": 8841, - "NotTilde;": 8769, - "NotTildeEqual;": 8772, - "NotTildeFullEqual;": 8775, - "NotTildeTilde;": 8777, - "NotVerticalBar;": 8740, - "Nscr;": [55349, 56489], - Ntilde: 209, - "Ntilde;": 209, - "Nu;": 925, - "OElig;": 338, - Oacute: 211, - "Oacute;": 211, - Ocirc: 212, - "Ocirc;": 212, - "Ocy;": 1054, - "Odblac;": 336, - "Ofr;": [55349, 56594], - Ograve: 210, - "Ograve;": 210, - "Omacr;": 332, - "Omega;": 937, - "Omicron;": 927, - "Oopf;": [55349, 56646], - "OpenCurlyDoubleQuote;": 8220, - "OpenCurlyQuote;": 8216, - "Or;": 10836, - "Oscr;": [55349, 56490], - Oslash: 216, - "Oslash;": 216, - Otilde: 213, - "Otilde;": 213, - "Otimes;": 10807, - Ouml: 214, - "Ouml;": 214, - "OverBar;": 8254, - "OverBrace;": 9182, - "OverBracket;": 9140, - "OverParenthesis;": 9180, - "PartialD;": 8706, - "Pcy;": 1055, - "Pfr;": [55349, 56595], - "Phi;": 934, - "Pi;": 928, - "PlusMinus;": 177, - "Poincareplane;": 8460, - "Popf;": 8473, - "Pr;": 10939, - "Precedes;": 8826, - "PrecedesEqual;": 10927, - "PrecedesSlantEqual;": 8828, - "PrecedesTilde;": 8830, - "Prime;": 8243, - "Product;": 8719, - "Proportion;": 8759, - "Proportional;": 8733, - "Pscr;": [55349, 56491], - "Psi;": 936, - QUOT: 34, - "QUOT;": 34, - "Qfr;": [55349, 56596], - "Qopf;": 8474, - "Qscr;": [55349, 56492], - "RBarr;": 10512, - REG: 174, - "REG;": 174, - "Racute;": 340, - "Rang;": 10219, - "Rarr;": 8608, - "Rarrtl;": 10518, - "Rcaron;": 344, - "Rcedil;": 342, - "Rcy;": 1056, - "Re;": 8476, - "ReverseElement;": 8715, - "ReverseEquilibrium;": 8651, - "ReverseUpEquilibrium;": 10607, - "Rfr;": 8476, - "Rho;": 929, - "RightAngleBracket;": 10217, - "RightArrow;": 8594, - "RightArrowBar;": 8677, - "RightArrowLeftArrow;": 8644, - "RightCeiling;": 8969, - "RightDoubleBracket;": 10215, - "RightDownTeeVector;": 10589, - "RightDownVector;": 8642, - "RightDownVectorBar;": 10581, - "RightFloor;": 8971, - "RightTee;": 8866, - "RightTeeArrow;": 8614, - "RightTeeVector;": 10587, - "RightTriangle;": 8883, - "RightTriangleBar;": 10704, - "RightTriangleEqual;": 8885, - "RightUpDownVector;": 10575, - "RightUpTeeVector;": 10588, - "RightUpVector;": 8638, - "RightUpVectorBar;": 10580, - "RightVector;": 8640, - "RightVectorBar;": 10579, - "Rightarrow;": 8658, - "Ropf;": 8477, - "RoundImplies;": 10608, - "Rrightarrow;": 8667, - "Rscr;": 8475, - "Rsh;": 8625, - "RuleDelayed;": 10740, - "SHCHcy;": 1065, - "SHcy;": 1064, - "SOFTcy;": 1068, - "Sacute;": 346, - "Sc;": 10940, - "Scaron;": 352, - "Scedil;": 350, - "Scirc;": 348, - "Scy;": 1057, - "Sfr;": [55349, 56598], - "ShortDownArrow;": 8595, - "ShortLeftArrow;": 8592, - "ShortRightArrow;": 8594, - "ShortUpArrow;": 8593, - "Sigma;": 931, - "SmallCircle;": 8728, - "Sopf;": [55349, 56650], - "Sqrt;": 8730, - "Square;": 9633, - "SquareIntersection;": 8851, - "SquareSubset;": 8847, - "SquareSubsetEqual;": 8849, - "SquareSuperset;": 8848, - "SquareSupersetEqual;": 8850, - "SquareUnion;": 8852, - "Sscr;": [55349, 56494], - "Star;": 8902, - "Sub;": 8912, - "Subset;": 8912, - "SubsetEqual;": 8838, - "Succeeds;": 8827, - "SucceedsEqual;": 10928, - "SucceedsSlantEqual;": 8829, - "SucceedsTilde;": 8831, - "SuchThat;": 8715, - "Sum;": 8721, - "Sup;": 8913, - "Superset;": 8835, - "SupersetEqual;": 8839, - "Supset;": 8913, - THORN: 222, - "THORN;": 222, - "TRADE;": 8482, - "TSHcy;": 1035, - "TScy;": 1062, - "Tab;": 9, - "Tau;": 932, - "Tcaron;": 356, - "Tcedil;": 354, - "Tcy;": 1058, - "Tfr;": [55349, 56599], - "Therefore;": 8756, - "Theta;": 920, - "ThickSpace;": [8287, 8202], - "ThinSpace;": 8201, - "Tilde;": 8764, - "TildeEqual;": 8771, - "TildeFullEqual;": 8773, - "TildeTilde;": 8776, - "Topf;": [55349, 56651], - "TripleDot;": 8411, - "Tscr;": [55349, 56495], - "Tstrok;": 358, - Uacute: 218, - "Uacute;": 218, - "Uarr;": 8607, - "Uarrocir;": 10569, - "Ubrcy;": 1038, - "Ubreve;": 364, - Ucirc: 219, - "Ucirc;": 219, - "Ucy;": 1059, - "Udblac;": 368, - "Ufr;": [55349, 56600], - Ugrave: 217, - "Ugrave;": 217, - "Umacr;": 362, - "UnderBar;": 95, - "UnderBrace;": 9183, - "UnderBracket;": 9141, - "UnderParenthesis;": 9181, - "Union;": 8899, - "UnionPlus;": 8846, - "Uogon;": 370, - "Uopf;": [55349, 56652], - "UpArrow;": 8593, - "UpArrowBar;": 10514, - "UpArrowDownArrow;": 8645, - "UpDownArrow;": 8597, - "UpEquilibrium;": 10606, - "UpTee;": 8869, - "UpTeeArrow;": 8613, - "Uparrow;": 8657, - "Updownarrow;": 8661, - "UpperLeftArrow;": 8598, - "UpperRightArrow;": 8599, - "Upsi;": 978, - "Upsilon;": 933, - "Uring;": 366, - "Uscr;": [55349, 56496], - "Utilde;": 360, - Uuml: 220, - "Uuml;": 220, - "VDash;": 8875, - "Vbar;": 10987, - "Vcy;": 1042, - "Vdash;": 8873, - "Vdashl;": 10982, - "Vee;": 8897, - "Verbar;": 8214, - "Vert;": 8214, - "VerticalBar;": 8739, - "VerticalLine;": 124, - "VerticalSeparator;": 10072, - "VerticalTilde;": 8768, - "VeryThinSpace;": 8202, - "Vfr;": [55349, 56601], - "Vopf;": [55349, 56653], - "Vscr;": [55349, 56497], - "Vvdash;": 8874, - "Wcirc;": 372, - "Wedge;": 8896, - "Wfr;": [55349, 56602], - "Wopf;": [55349, 56654], - "Wscr;": [55349, 56498], - "Xfr;": [55349, 56603], - "Xi;": 926, - "Xopf;": [55349, 56655], - "Xscr;": [55349, 56499], - "YAcy;": 1071, - "YIcy;": 1031, - "YUcy;": 1070, - Yacute: 221, - "Yacute;": 221, - "Ycirc;": 374, - "Ycy;": 1067, - "Yfr;": [55349, 56604], - "Yopf;": [55349, 56656], - "Yscr;": [55349, 56500], - "Yuml;": 376, - "ZHcy;": 1046, - "Zacute;": 377, - "Zcaron;": 381, - "Zcy;": 1047, - "Zdot;": 379, - "ZeroWidthSpace;": 8203, - "Zeta;": 918, - "Zfr;": 8488, - "Zopf;": 8484, - "Zscr;": [55349, 56501], - aacute: 225, - "aacute;": 225, - "abreve;": 259, - "ac;": 8766, - "acE;": [8766, 819], - "acd;": 8767, - acirc: 226, - "acirc;": 226, - acute: 180, - "acute;": 180, - "acy;": 1072, - aelig: 230, - "aelig;": 230, - "af;": 8289, - "afr;": [55349, 56606], - agrave: 224, - "agrave;": 224, - "alefsym;": 8501, - "aleph;": 8501, - "alpha;": 945, - "amacr;": 257, - "amalg;": 10815, - amp: 38, - "amp;": 38, - "and;": 8743, - "andand;": 10837, - "andd;": 10844, - "andslope;": 10840, - "andv;": 10842, - "ang;": 8736, - "ange;": 10660, - "angle;": 8736, - "angmsd;": 8737, - "angmsdaa;": 10664, - "angmsdab;": 10665, - "angmsdac;": 10666, - "angmsdad;": 10667, - "angmsdae;": 10668, - "angmsdaf;": 10669, - "angmsdag;": 10670, - "angmsdah;": 10671, - "angrt;": 8735, - "angrtvb;": 8894, - "angrtvbd;": 10653, - "angsph;": 8738, - "angst;": 197, - "angzarr;": 9084, - "aogon;": 261, - "aopf;": [55349, 56658], - "ap;": 8776, - "apE;": 10864, - "apacir;": 10863, - "ape;": 8778, - "apid;": 8779, - "apos;": 39, - "approx;": 8776, - "approxeq;": 8778, - aring: 229, - "aring;": 229, - "ascr;": [55349, 56502], - "ast;": 42, - "asymp;": 8776, - "asympeq;": 8781, - atilde: 227, - "atilde;": 227, - auml: 228, - "auml;": 228, - "awconint;": 8755, - "awint;": 10769, - "bNot;": 10989, - "backcong;": 8780, - "backepsilon;": 1014, - "backprime;": 8245, - "backsim;": 8765, - "backsimeq;": 8909, - "barvee;": 8893, - "barwed;": 8965, - "barwedge;": 8965, - "bbrk;": 9141, - "bbrktbrk;": 9142, - "bcong;": 8780, - "bcy;": 1073, - "bdquo;": 8222, - "becaus;": 8757, - "because;": 8757, - "bemptyv;": 10672, - "bepsi;": 1014, - "bernou;": 8492, - "beta;": 946, - "beth;": 8502, - "between;": 8812, - "bfr;": [55349, 56607], - "bigcap;": 8898, - "bigcirc;": 9711, - "bigcup;": 8899, - "bigodot;": 10752, - "bigoplus;": 10753, - "bigotimes;": 10754, - "bigsqcup;": 10758, - "bigstar;": 9733, - "bigtriangledown;": 9661, - "bigtriangleup;": 9651, - "biguplus;": 10756, - "bigvee;": 8897, - "bigwedge;": 8896, - "bkarow;": 10509, - "blacklozenge;": 10731, - "blacksquare;": 9642, - "blacktriangle;": 9652, - "blacktriangledown;": 9662, - "blacktriangleleft;": 9666, - "blacktriangleright;": 9656, - "blank;": 9251, - "blk12;": 9618, - "blk14;": 9617, - "blk34;": 9619, - "block;": 9608, - "bne;": [61, 8421], - "bnequiv;": [8801, 8421], - "bnot;": 8976, - "bopf;": [55349, 56659], - "bot;": 8869, - "bottom;": 8869, - "bowtie;": 8904, - "boxDL;": 9559, - "boxDR;": 9556, - "boxDl;": 9558, - "boxDr;": 9555, - "boxH;": 9552, - "boxHD;": 9574, - "boxHU;": 9577, - "boxHd;": 9572, - "boxHu;": 9575, - "boxUL;": 9565, - "boxUR;": 9562, - "boxUl;": 9564, - "boxUr;": 9561, - "boxV;": 9553, - "boxVH;": 9580, - "boxVL;": 9571, - "boxVR;": 9568, - "boxVh;": 9579, - "boxVl;": 9570, - "boxVr;": 9567, - "boxbox;": 10697, - "boxdL;": 9557, - "boxdR;": 9554, - "boxdl;": 9488, - "boxdr;": 9484, - "boxh;": 9472, - "boxhD;": 9573, - "boxhU;": 9576, - "boxhd;": 9516, - "boxhu;": 9524, - "boxminus;": 8863, - "boxplus;": 8862, - "boxtimes;": 8864, - "boxuL;": 9563, - "boxuR;": 9560, - "boxul;": 9496, - "boxur;": 9492, - "boxv;": 9474, - "boxvH;": 9578, - "boxvL;": 9569, - "boxvR;": 9566, - "boxvh;": 9532, - "boxvl;": 9508, - "boxvr;": 9500, - "bprime;": 8245, - "breve;": 728, - brvbar: 166, - "brvbar;": 166, - "bscr;": [55349, 56503], - "bsemi;": 8271, - "bsim;": 8765, - "bsime;": 8909, - "bsol;": 92, - "bsolb;": 10693, - "bsolhsub;": 10184, - "bull;": 8226, - "bullet;": 8226, - "bump;": 8782, - "bumpE;": 10926, - "bumpe;": 8783, - "bumpeq;": 8783, - "cacute;": 263, - "cap;": 8745, - "capand;": 10820, - "capbrcup;": 10825, - "capcap;": 10827, - "capcup;": 10823, - "capdot;": 10816, - "caps;": [8745, 65024], - "caret;": 8257, - "caron;": 711, - "ccaps;": 10829, - "ccaron;": 269, - ccedil: 231, - "ccedil;": 231, - "ccirc;": 265, - "ccups;": 10828, - "ccupssm;": 10832, - "cdot;": 267, - cedil: 184, - "cedil;": 184, - "cemptyv;": 10674, - cent: 162, - "cent;": 162, - "centerdot;": 183, - "cfr;": [55349, 56608], - "chcy;": 1095, - "check;": 10003, - "checkmark;": 10003, - "chi;": 967, - "cir;": 9675, - "cirE;": 10691, - "circ;": 710, - "circeq;": 8791, - "circlearrowleft;": 8634, - "circlearrowright;": 8635, - "circledR;": 174, - "circledS;": 9416, - "circledast;": 8859, - "circledcirc;": 8858, - "circleddash;": 8861, - "cire;": 8791, - "cirfnint;": 10768, - "cirmid;": 10991, - "cirscir;": 10690, - "clubs;": 9827, - "clubsuit;": 9827, - "colon;": 58, - "colone;": 8788, - "coloneq;": 8788, - "comma;": 44, - "commat;": 64, - "comp;": 8705, - "compfn;": 8728, - "complement;": 8705, - "complexes;": 8450, - "cong;": 8773, - "congdot;": 10861, - "conint;": 8750, - "copf;": [55349, 56660], - "coprod;": 8720, - copy: 169, - "copy;": 169, - "copysr;": 8471, - "crarr;": 8629, - "cross;": 10007, - "cscr;": [55349, 56504], - "csub;": 10959, - "csube;": 10961, - "csup;": 10960, - "csupe;": 10962, - "ctdot;": 8943, - "cudarrl;": 10552, - "cudarrr;": 10549, - "cuepr;": 8926, - "cuesc;": 8927, - "cularr;": 8630, - "cularrp;": 10557, - "cup;": 8746, - "cupbrcap;": 10824, - "cupcap;": 10822, - "cupcup;": 10826, - "cupdot;": 8845, - "cupor;": 10821, - "cups;": [8746, 65024], - "curarr;": 8631, - "curarrm;": 10556, - "curlyeqprec;": 8926, - "curlyeqsucc;": 8927, - "curlyvee;": 8910, - "curlywedge;": 8911, - curren: 164, - "curren;": 164, - "curvearrowleft;": 8630, - "curvearrowright;": 8631, - "cuvee;": 8910, - "cuwed;": 8911, - "cwconint;": 8754, - "cwint;": 8753, - "cylcty;": 9005, - "dArr;": 8659, - "dHar;": 10597, - "dagger;": 8224, - "daleth;": 8504, - "darr;": 8595, - "dash;": 8208, - "dashv;": 8867, - "dbkarow;": 10511, - "dblac;": 733, - "dcaron;": 271, - "dcy;": 1076, - "dd;": 8518, - "ddagger;": 8225, - "ddarr;": 8650, - "ddotseq;": 10871, - deg: 176, - "deg;": 176, - "delta;": 948, - "demptyv;": 10673, - "dfisht;": 10623, - "dfr;": [55349, 56609], - "dharl;": 8643, - "dharr;": 8642, - "diam;": 8900, - "diamond;": 8900, - "diamondsuit;": 9830, - "diams;": 9830, - "die;": 168, - "digamma;": 989, - "disin;": 8946, - "div;": 247, - divide: 247, - "divide;": 247, - "divideontimes;": 8903, - "divonx;": 8903, - "djcy;": 1106, - "dlcorn;": 8990, - "dlcrop;": 8973, - "dollar;": 36, - "dopf;": [55349, 56661], - "dot;": 729, - "doteq;": 8784, - "doteqdot;": 8785, - "dotminus;": 8760, - "dotplus;": 8724, - "dotsquare;": 8865, - "doublebarwedge;": 8966, - "downarrow;": 8595, - "downdownarrows;": 8650, - "downharpoonleft;": 8643, - "downharpoonright;": 8642, - "drbkarow;": 10512, - "drcorn;": 8991, - "drcrop;": 8972, - "dscr;": [55349, 56505], - "dscy;": 1109, - "dsol;": 10742, - "dstrok;": 273, - "dtdot;": 8945, - "dtri;": 9663, - "dtrif;": 9662, - "duarr;": 8693, - "duhar;": 10607, - "dwangle;": 10662, - "dzcy;": 1119, - "dzigrarr;": 10239, - "eDDot;": 10871, - "eDot;": 8785, - eacute: 233, - "eacute;": 233, - "easter;": 10862, - "ecaron;": 283, - "ecir;": 8790, - ecirc: 234, - "ecirc;": 234, - "ecolon;": 8789, - "ecy;": 1101, - "edot;": 279, - "ee;": 8519, - "efDot;": 8786, - "efr;": [55349, 56610], - "eg;": 10906, - egrave: 232, - "egrave;": 232, - "egs;": 10902, - "egsdot;": 10904, - "el;": 10905, - "elinters;": 9191, - "ell;": 8467, - "els;": 10901, - "elsdot;": 10903, - "emacr;": 275, - "empty;": 8709, - "emptyset;": 8709, - "emptyv;": 8709, - "emsp13;": 8196, - "emsp14;": 8197, - "emsp;": 8195, - "eng;": 331, - "ensp;": 8194, - "eogon;": 281, - "eopf;": [55349, 56662], - "epar;": 8917, - "eparsl;": 10723, - "eplus;": 10865, - "epsi;": 949, - "epsilon;": 949, - "epsiv;": 1013, - "eqcirc;": 8790, - "eqcolon;": 8789, - "eqsim;": 8770, - "eqslantgtr;": 10902, - "eqslantless;": 10901, - "equals;": 61, - "equest;": 8799, - "equiv;": 8801, - "equivDD;": 10872, - "eqvparsl;": 10725, - "erDot;": 8787, - "erarr;": 10609, - "escr;": 8495, - "esdot;": 8784, - "esim;": 8770, - "eta;": 951, - eth: 240, - "eth;": 240, - euml: 235, - "euml;": 235, - "euro;": 8364, - "excl;": 33, - "exist;": 8707, - "expectation;": 8496, - "exponentiale;": 8519, - "fallingdotseq;": 8786, - "fcy;": 1092, - "female;": 9792, - "ffilig;": 64259, - "fflig;": 64256, - "ffllig;": 64260, - "ffr;": [55349, 56611], - "filig;": 64257, - "fjlig;": [102, 106], - "flat;": 9837, - "fllig;": 64258, - "fltns;": 9649, - "fnof;": 402, - "fopf;": [55349, 56663], - "forall;": 8704, - "fork;": 8916, - "forkv;": 10969, - "fpartint;": 10765, - frac12: 189, - "frac12;": 189, - "frac13;": 8531, - frac14: 188, - "frac14;": 188, - "frac15;": 8533, - "frac16;": 8537, - "frac18;": 8539, - "frac23;": 8532, - "frac25;": 8534, - frac34: 190, - "frac34;": 190, - "frac35;": 8535, - "frac38;": 8540, - "frac45;": 8536, - "frac56;": 8538, - "frac58;": 8541, - "frac78;": 8542, - "frasl;": 8260, - "frown;": 8994, - "fscr;": [55349, 56507], - "gE;": 8807, - "gEl;": 10892, - "gacute;": 501, - "gamma;": 947, - "gammad;": 989, - "gap;": 10886, - "gbreve;": 287, - "gcirc;": 285, - "gcy;": 1075, - "gdot;": 289, - "ge;": 8805, - "gel;": 8923, - "geq;": 8805, - "geqq;": 8807, - "geqslant;": 10878, - "ges;": 10878, - "gescc;": 10921, - "gesdot;": 10880, - "gesdoto;": 10882, - "gesdotol;": 10884, - "gesl;": [8923, 65024], - "gesles;": 10900, - "gfr;": [55349, 56612], - "gg;": 8811, - "ggg;": 8921, - "gimel;": 8503, - "gjcy;": 1107, - "gl;": 8823, - "glE;": 10898, - "gla;": 10917, - "glj;": 10916, - "gnE;": 8809, - "gnap;": 10890, - "gnapprox;": 10890, - "gne;": 10888, - "gneq;": 10888, - "gneqq;": 8809, - "gnsim;": 8935, - "gopf;": [55349, 56664], - "grave;": 96, - "gscr;": 8458, - "gsim;": 8819, - "gsime;": 10894, - "gsiml;": 10896, - gt: 62, - "gt;": 62, - "gtcc;": 10919, - "gtcir;": 10874, - "gtdot;": 8919, - "gtlPar;": 10645, - "gtquest;": 10876, - "gtrapprox;": 10886, - "gtrarr;": 10616, - "gtrdot;": 8919, - "gtreqless;": 8923, - "gtreqqless;": 10892, - "gtrless;": 8823, - "gtrsim;": 8819, - "gvertneqq;": [8809, 65024], - "gvnE;": [8809, 65024], - "hArr;": 8660, - "hairsp;": 8202, - "half;": 189, - "hamilt;": 8459, - "hardcy;": 1098, - "harr;": 8596, - "harrcir;": 10568, - "harrw;": 8621, - "hbar;": 8463, - "hcirc;": 293, - "hearts;": 9829, - "heartsuit;": 9829, - "hellip;": 8230, - "hercon;": 8889, - "hfr;": [55349, 56613], - "hksearow;": 10533, - "hkswarow;": 10534, - "hoarr;": 8703, - "homtht;": 8763, - "hookleftarrow;": 8617, - "hookrightarrow;": 8618, - "hopf;": [55349, 56665], - "horbar;": 8213, - "hscr;": [55349, 56509], - "hslash;": 8463, - "hstrok;": 295, - "hybull;": 8259, - "hyphen;": 8208, - iacute: 237, - "iacute;": 237, - "ic;": 8291, - icirc: 238, - "icirc;": 238, - "icy;": 1080, - "iecy;": 1077, - iexcl: 161, - "iexcl;": 161, - "iff;": 8660, - "ifr;": [55349, 56614], - igrave: 236, - "igrave;": 236, - "ii;": 8520, - "iiiint;": 10764, - "iiint;": 8749, - "iinfin;": 10716, - "iiota;": 8489, - "ijlig;": 307, - "imacr;": 299, - "image;": 8465, - "imagline;": 8464, - "imagpart;": 8465, - "imath;": 305, - "imof;": 8887, - "imped;": 437, - "in;": 8712, - "incare;": 8453, - "infin;": 8734, - "infintie;": 10717, - "inodot;": 305, - "int;": 8747, - "intcal;": 8890, - "integers;": 8484, - "intercal;": 8890, - "intlarhk;": 10775, - "intprod;": 10812, - "iocy;": 1105, - "iogon;": 303, - "iopf;": [55349, 56666], - "iota;": 953, - "iprod;": 10812, - iquest: 191, - "iquest;": 191, - "iscr;": [55349, 56510], - "isin;": 8712, - "isinE;": 8953, - "isindot;": 8949, - "isins;": 8948, - "isinsv;": 8947, - "isinv;": 8712, - "it;": 8290, - "itilde;": 297, - "iukcy;": 1110, - iuml: 239, - "iuml;": 239, - "jcirc;": 309, - "jcy;": 1081, - "jfr;": [55349, 56615], - "jmath;": 567, - "jopf;": [55349, 56667], - "jscr;": [55349, 56511], - "jsercy;": 1112, - "jukcy;": 1108, - "kappa;": 954, - "kappav;": 1008, - "kcedil;": 311, - "kcy;": 1082, - "kfr;": [55349, 56616], - "kgreen;": 312, - "khcy;": 1093, - "kjcy;": 1116, - "kopf;": [55349, 56668], - "kscr;": [55349, 56512], - "lAarr;": 8666, - "lArr;": 8656, - "lAtail;": 10523, - "lBarr;": 10510, - "lE;": 8806, - "lEg;": 10891, - "lHar;": 10594, - "lacute;": 314, - "laemptyv;": 10676, - "lagran;": 8466, - "lambda;": 955, - "lang;": 10216, - "langd;": 10641, - "langle;": 10216, - "lap;": 10885, - laquo: 171, - "laquo;": 171, - "larr;": 8592, - "larrb;": 8676, - "larrbfs;": 10527, - "larrfs;": 10525, - "larrhk;": 8617, - "larrlp;": 8619, - "larrpl;": 10553, - "larrsim;": 10611, - "larrtl;": 8610, - "lat;": 10923, - "latail;": 10521, - "late;": 10925, - "lates;": [10925, 65024], - "lbarr;": 10508, - "lbbrk;": 10098, - "lbrace;": 123, - "lbrack;": 91, - "lbrke;": 10635, - "lbrksld;": 10639, - "lbrkslu;": 10637, - "lcaron;": 318, - "lcedil;": 316, - "lceil;": 8968, - "lcub;": 123, - "lcy;": 1083, - "ldca;": 10550, - "ldquo;": 8220, - "ldquor;": 8222, - "ldrdhar;": 10599, - "ldrushar;": 10571, - "ldsh;": 8626, - "le;": 8804, - "leftarrow;": 8592, - "leftarrowtail;": 8610, - "leftharpoondown;": 8637, - "leftharpoonup;": 8636, - "leftleftarrows;": 8647, - "leftrightarrow;": 8596, - "leftrightarrows;": 8646, - "leftrightharpoons;": 8651, - "leftrightsquigarrow;": 8621, - "leftthreetimes;": 8907, - "leg;": 8922, - "leq;": 8804, - "leqq;": 8806, - "leqslant;": 10877, - "les;": 10877, - "lescc;": 10920, - "lesdot;": 10879, - "lesdoto;": 10881, - "lesdotor;": 10883, - "lesg;": [8922, 65024], - "lesges;": 10899, - "lessapprox;": 10885, - "lessdot;": 8918, - "lesseqgtr;": 8922, - "lesseqqgtr;": 10891, - "lessgtr;": 8822, - "lesssim;": 8818, - "lfisht;": 10620, - "lfloor;": 8970, - "lfr;": [55349, 56617], - "lg;": 8822, - "lgE;": 10897, - "lhard;": 8637, - "lharu;": 8636, - "lharul;": 10602, - "lhblk;": 9604, - "ljcy;": 1113, - "ll;": 8810, - "llarr;": 8647, - "llcorner;": 8990, - "llhard;": 10603, - "lltri;": 9722, - "lmidot;": 320, - "lmoust;": 9136, - "lmoustache;": 9136, - "lnE;": 8808, - "lnap;": 10889, - "lnapprox;": 10889, - "lne;": 10887, - "lneq;": 10887, - "lneqq;": 8808, - "lnsim;": 8934, - "loang;": 10220, - "loarr;": 8701, - "lobrk;": 10214, - "longleftarrow;": 10229, - "longleftrightarrow;": 10231, - "longmapsto;": 10236, - "longrightarrow;": 10230, - "looparrowleft;": 8619, - "looparrowright;": 8620, - "lopar;": 10629, - "lopf;": [55349, 56669], - "loplus;": 10797, - "lotimes;": 10804, - "lowast;": 8727, - "lowbar;": 95, - "loz;": 9674, - "lozenge;": 9674, - "lozf;": 10731, - "lpar;": 40, - "lparlt;": 10643, - "lrarr;": 8646, - "lrcorner;": 8991, - "lrhar;": 8651, - "lrhard;": 10605, - "lrm;": 8206, - "lrtri;": 8895, - "lsaquo;": 8249, - "lscr;": [55349, 56513], - "lsh;": 8624, - "lsim;": 8818, - "lsime;": 10893, - "lsimg;": 10895, - "lsqb;": 91, - "lsquo;": 8216, - "lsquor;": 8218, - "lstrok;": 322, - lt: 60, - "lt;": 60, - "ltcc;": 10918, - "ltcir;": 10873, - "ltdot;": 8918, - "lthree;": 8907, - "ltimes;": 8905, - "ltlarr;": 10614, - "ltquest;": 10875, - "ltrPar;": 10646, - "ltri;": 9667, - "ltrie;": 8884, - "ltrif;": 9666, - "lurdshar;": 10570, - "luruhar;": 10598, - "lvertneqq;": [8808, 65024], - "lvnE;": [8808, 65024], - "mDDot;": 8762, - macr: 175, - "macr;": 175, - "male;": 9794, - "malt;": 10016, - "maltese;": 10016, - "map;": 8614, - "mapsto;": 8614, - "mapstodown;": 8615, - "mapstoleft;": 8612, - "mapstoup;": 8613, - "marker;": 9646, - "mcomma;": 10793, - "mcy;": 1084, - "mdash;": 8212, - "measuredangle;": 8737, - "mfr;": [55349, 56618], - "mho;": 8487, - micro: 181, - "micro;": 181, - "mid;": 8739, - "midast;": 42, - "midcir;": 10992, - middot: 183, - "middot;": 183, - "minus;": 8722, - "minusb;": 8863, - "minusd;": 8760, - "minusdu;": 10794, - "mlcp;": 10971, - "mldr;": 8230, - "mnplus;": 8723, - "models;": 8871, - "mopf;": [55349, 56670], - "mp;": 8723, - "mscr;": [55349, 56514], - "mstpos;": 8766, - "mu;": 956, - "multimap;": 8888, - "mumap;": 8888, - "nGg;": [8921, 824], - "nGt;": [8811, 8402], - "nGtv;": [8811, 824], - "nLeftarrow;": 8653, - "nLeftrightarrow;": 8654, - "nLl;": [8920, 824], - "nLt;": [8810, 8402], - "nLtv;": [8810, 824], - "nRightarrow;": 8655, - "nVDash;": 8879, - "nVdash;": 8878, - "nabla;": 8711, - "nacute;": 324, - "nang;": [8736, 8402], - "nap;": 8777, - "napE;": [10864, 824], - "napid;": [8779, 824], - "napos;": 329, - "napprox;": 8777, - "natur;": 9838, - "natural;": 9838, - "naturals;": 8469, - nbsp: 160, - "nbsp;": 160, - "nbump;": [8782, 824], - "nbumpe;": [8783, 824], - "ncap;": 10819, - "ncaron;": 328, - "ncedil;": 326, - "ncong;": 8775, - "ncongdot;": [10861, 824], - "ncup;": 10818, - "ncy;": 1085, - "ndash;": 8211, - "ne;": 8800, - "neArr;": 8663, - "nearhk;": 10532, - "nearr;": 8599, - "nearrow;": 8599, - "nedot;": [8784, 824], - "nequiv;": 8802, - "nesear;": 10536, - "nesim;": [8770, 824], - "nexist;": 8708, - "nexists;": 8708, - "nfr;": [55349, 56619], - "ngE;": [8807, 824], - "nge;": 8817, - "ngeq;": 8817, - "ngeqq;": [8807, 824], - "ngeqslant;": [10878, 824], - "nges;": [10878, 824], - "ngsim;": 8821, - "ngt;": 8815, - "ngtr;": 8815, - "nhArr;": 8654, - "nharr;": 8622, - "nhpar;": 10994, - "ni;": 8715, - "nis;": 8956, - "nisd;": 8954, - "niv;": 8715, - "njcy;": 1114, - "nlArr;": 8653, - "nlE;": [8806, 824], - "nlarr;": 8602, - "nldr;": 8229, - "nle;": 8816, - "nleftarrow;": 8602, - "nleftrightarrow;": 8622, - "nleq;": 8816, - "nleqq;": [8806, 824], - "nleqslant;": [10877, 824], - "nles;": [10877, 824], - "nless;": 8814, - "nlsim;": 8820, - "nlt;": 8814, - "nltri;": 8938, - "nltrie;": 8940, - "nmid;": 8740, - "nopf;": [55349, 56671], - not: 172, - "not;": 172, - "notin;": 8713, - "notinE;": [8953, 824], - "notindot;": [8949, 824], - "notinva;": 8713, - "notinvb;": 8951, - "notinvc;": 8950, - "notni;": 8716, - "notniva;": 8716, - "notnivb;": 8958, - "notnivc;": 8957, - "npar;": 8742, - "nparallel;": 8742, - "nparsl;": [11005, 8421], - "npart;": [8706, 824], - "npolint;": 10772, - "npr;": 8832, - "nprcue;": 8928, - "npre;": [10927, 824], - "nprec;": 8832, - "npreceq;": [10927, 824], - "nrArr;": 8655, - "nrarr;": 8603, - "nrarrc;": [10547, 824], - "nrarrw;": [8605, 824], - "nrightarrow;": 8603, - "nrtri;": 8939, - "nrtrie;": 8941, - "nsc;": 8833, - "nsccue;": 8929, - "nsce;": [10928, 824], - "nscr;": [55349, 56515], - "nshortmid;": 8740, - "nshortparallel;": 8742, - "nsim;": 8769, - "nsime;": 8772, - "nsimeq;": 8772, - "nsmid;": 8740, - "nspar;": 8742, - "nsqsube;": 8930, - "nsqsupe;": 8931, - "nsub;": 8836, - "nsubE;": [10949, 824], - "nsube;": 8840, - "nsubset;": [8834, 8402], - "nsubseteq;": 8840, - "nsubseteqq;": [10949, 824], - "nsucc;": 8833, - "nsucceq;": [10928, 824], - "nsup;": 8837, - "nsupE;": [10950, 824], - "nsupe;": 8841, - "nsupset;": [8835, 8402], - "nsupseteq;": 8841, - "nsupseteqq;": [10950, 824], - "ntgl;": 8825, - ntilde: 241, - "ntilde;": 241, - "ntlg;": 8824, - "ntriangleleft;": 8938, - "ntrianglelefteq;": 8940, - "ntriangleright;": 8939, - "ntrianglerighteq;": 8941, - "nu;": 957, - "num;": 35, - "numero;": 8470, - "numsp;": 8199, - "nvDash;": 8877, - "nvHarr;": 10500, - "nvap;": [8781, 8402], - "nvdash;": 8876, - "nvge;": [8805, 8402], - "nvgt;": [62, 8402], - "nvinfin;": 10718, - "nvlArr;": 10498, - "nvle;": [8804, 8402], - "nvlt;": [60, 8402], - "nvltrie;": [8884, 8402], - "nvrArr;": 10499, - "nvrtrie;": [8885, 8402], - "nvsim;": [8764, 8402], - "nwArr;": 8662, - "nwarhk;": 10531, - "nwarr;": 8598, - "nwarrow;": 8598, - "nwnear;": 10535, - "oS;": 9416, - oacute: 243, - "oacute;": 243, - "oast;": 8859, - "ocir;": 8858, - ocirc: 244, - "ocirc;": 244, - "ocy;": 1086, - "odash;": 8861, - "odblac;": 337, - "odiv;": 10808, - "odot;": 8857, - "odsold;": 10684, - "oelig;": 339, - "ofcir;": 10687, - "ofr;": [55349, 56620], - "ogon;": 731, - ograve: 242, - "ograve;": 242, - "ogt;": 10689, - "ohbar;": 10677, - "ohm;": 937, - "oint;": 8750, - "olarr;": 8634, - "olcir;": 10686, - "olcross;": 10683, - "oline;": 8254, - "olt;": 10688, - "omacr;": 333, - "omega;": 969, - "omicron;": 959, - "omid;": 10678, - "ominus;": 8854, - "oopf;": [55349, 56672], - "opar;": 10679, - "operp;": 10681, - "oplus;": 8853, - "or;": 8744, - "orarr;": 8635, - "ord;": 10845, - "order;": 8500, - "orderof;": 8500, - ordf: 170, - "ordf;": 170, - ordm: 186, - "ordm;": 186, - "origof;": 8886, - "oror;": 10838, - "orslope;": 10839, - "orv;": 10843, - "oscr;": 8500, - oslash: 248, - "oslash;": 248, - "osol;": 8856, - otilde: 245, - "otilde;": 245, - "otimes;": 8855, - "otimesas;": 10806, - ouml: 246, - "ouml;": 246, - "ovbar;": 9021, - "par;": 8741, - para: 182, - "para;": 182, - "parallel;": 8741, - "parsim;": 10995, - "parsl;": 11005, - "part;": 8706, - "pcy;": 1087, - "percnt;": 37, - "period;": 46, - "permil;": 8240, - "perp;": 8869, - "pertenk;": 8241, - "pfr;": [55349, 56621], - "phi;": 966, - "phiv;": 981, - "phmmat;": 8499, - "phone;": 9742, - "pi;": 960, - "pitchfork;": 8916, - "piv;": 982, - "planck;": 8463, - "planckh;": 8462, - "plankv;": 8463, - "plus;": 43, - "plusacir;": 10787, - "plusb;": 8862, - "pluscir;": 10786, - "plusdo;": 8724, - "plusdu;": 10789, - "pluse;": 10866, - plusmn: 177, - "plusmn;": 177, - "plussim;": 10790, - "plustwo;": 10791, - "pm;": 177, - "pointint;": 10773, - "popf;": [55349, 56673], - pound: 163, - "pound;": 163, - "pr;": 8826, - "prE;": 10931, - "prap;": 10935, - "prcue;": 8828, - "pre;": 10927, - "prec;": 8826, - "precapprox;": 10935, - "preccurlyeq;": 8828, - "preceq;": 10927, - "precnapprox;": 10937, - "precneqq;": 10933, - "precnsim;": 8936, - "precsim;": 8830, - "prime;": 8242, - "primes;": 8473, - "prnE;": 10933, - "prnap;": 10937, - "prnsim;": 8936, - "prod;": 8719, - "profalar;": 9006, - "profline;": 8978, - "profsurf;": 8979, - "prop;": 8733, - "propto;": 8733, - "prsim;": 8830, - "prurel;": 8880, - "pscr;": [55349, 56517], - "psi;": 968, - "puncsp;": 8200, - "qfr;": [55349, 56622], - "qint;": 10764, - "qopf;": [55349, 56674], - "qprime;": 8279, - "qscr;": [55349, 56518], - "quaternions;": 8461, - "quatint;": 10774, - "quest;": 63, - "questeq;": 8799, - quot: 34, - "quot;": 34, - "rAarr;": 8667, - "rArr;": 8658, - "rAtail;": 10524, - "rBarr;": 10511, - "rHar;": 10596, - "race;": [8765, 817], - "racute;": 341, - "radic;": 8730, - "raemptyv;": 10675, - "rang;": 10217, - "rangd;": 10642, - "range;": 10661, - "rangle;": 10217, - raquo: 187, - "raquo;": 187, - "rarr;": 8594, - "rarrap;": 10613, - "rarrb;": 8677, - "rarrbfs;": 10528, - "rarrc;": 10547, - "rarrfs;": 10526, - "rarrhk;": 8618, - "rarrlp;": 8620, - "rarrpl;": 10565, - "rarrsim;": 10612, - "rarrtl;": 8611, - "rarrw;": 8605, - "ratail;": 10522, - "ratio;": 8758, - "rationals;": 8474, - "rbarr;": 10509, - "rbbrk;": 10099, - "rbrace;": 125, - "rbrack;": 93, - "rbrke;": 10636, - "rbrksld;": 10638, - "rbrkslu;": 10640, - "rcaron;": 345, - "rcedil;": 343, - "rceil;": 8969, - "rcub;": 125, - "rcy;": 1088, - "rdca;": 10551, - "rdldhar;": 10601, - "rdquo;": 8221, - "rdquor;": 8221, - "rdsh;": 8627, - "real;": 8476, - "realine;": 8475, - "realpart;": 8476, - "reals;": 8477, - "rect;": 9645, - reg: 174, - "reg;": 174, - "rfisht;": 10621, - "rfloor;": 8971, - "rfr;": [55349, 56623], - "rhard;": 8641, - "rharu;": 8640, - "rharul;": 10604, - "rho;": 961, - "rhov;": 1009, - "rightarrow;": 8594, - "rightarrowtail;": 8611, - "rightharpoondown;": 8641, - "rightharpoonup;": 8640, - "rightleftarrows;": 8644, - "rightleftharpoons;": 8652, - "rightrightarrows;": 8649, - "rightsquigarrow;": 8605, - "rightthreetimes;": 8908, - "ring;": 730, - "risingdotseq;": 8787, - "rlarr;": 8644, - "rlhar;": 8652, - "rlm;": 8207, - "rmoust;": 9137, - "rmoustache;": 9137, - "rnmid;": 10990, - "roang;": 10221, - "roarr;": 8702, - "robrk;": 10215, - "ropar;": 10630, - "ropf;": [55349, 56675], - "roplus;": 10798, - "rotimes;": 10805, - "rpar;": 41, - "rpargt;": 10644, - "rppolint;": 10770, - "rrarr;": 8649, - "rsaquo;": 8250, - "rscr;": [55349, 56519], - "rsh;": 8625, - "rsqb;": 93, - "rsquo;": 8217, - "rsquor;": 8217, - "rthree;": 8908, - "rtimes;": 8906, - "rtri;": 9657, - "rtrie;": 8885, - "rtrif;": 9656, - "rtriltri;": 10702, - "ruluhar;": 10600, - "rx;": 8478, - "sacute;": 347, - "sbquo;": 8218, - "sc;": 8827, - "scE;": 10932, - "scap;": 10936, - "scaron;": 353, - "sccue;": 8829, - "sce;": 10928, - "scedil;": 351, - "scirc;": 349, - "scnE;": 10934, - "scnap;": 10938, - "scnsim;": 8937, - "scpolint;": 10771, - "scsim;": 8831, - "scy;": 1089, - "sdot;": 8901, - "sdotb;": 8865, - "sdote;": 10854, - "seArr;": 8664, - "searhk;": 10533, - "searr;": 8600, - "searrow;": 8600, - sect: 167, - "sect;": 167, - "semi;": 59, - "seswar;": 10537, - "setminus;": 8726, - "setmn;": 8726, - "sext;": 10038, - "sfr;": [55349, 56624], - "sfrown;": 8994, - "sharp;": 9839, - "shchcy;": 1097, - "shcy;": 1096, - "shortmid;": 8739, - "shortparallel;": 8741, - shy: 173, - "shy;": 173, - "sigma;": 963, - "sigmaf;": 962, - "sigmav;": 962, - "sim;": 8764, - "simdot;": 10858, - "sime;": 8771, - "simeq;": 8771, - "simg;": 10910, - "simgE;": 10912, - "siml;": 10909, - "simlE;": 10911, - "simne;": 8774, - "simplus;": 10788, - "simrarr;": 10610, - "slarr;": 8592, - "smallsetminus;": 8726, - "smashp;": 10803, - "smeparsl;": 10724, - "smid;": 8739, - "smile;": 8995, - "smt;": 10922, - "smte;": 10924, - "smtes;": [10924, 65024], - "softcy;": 1100, - "sol;": 47, - "solb;": 10692, - "solbar;": 9023, - "sopf;": [55349, 56676], - "spades;": 9824, - "spadesuit;": 9824, - "spar;": 8741, - "sqcap;": 8851, - "sqcaps;": [8851, 65024], - "sqcup;": 8852, - "sqcups;": [8852, 65024], - "sqsub;": 8847, - "sqsube;": 8849, - "sqsubset;": 8847, - "sqsubseteq;": 8849, - "sqsup;": 8848, - "sqsupe;": 8850, - "sqsupset;": 8848, - "sqsupseteq;": 8850, - "squ;": 9633, - "square;": 9633, - "squarf;": 9642, - "squf;": 9642, - "srarr;": 8594, - "sscr;": [55349, 56520], - "ssetmn;": 8726, - "ssmile;": 8995, - "sstarf;": 8902, - "star;": 9734, - "starf;": 9733, - "straightepsilon;": 1013, - "straightphi;": 981, - "strns;": 175, - "sub;": 8834, - "subE;": 10949, - "subdot;": 10941, - "sube;": 8838, - "subedot;": 10947, - "submult;": 10945, - "subnE;": 10955, - "subne;": 8842, - "subplus;": 10943, - "subrarr;": 10617, - "subset;": 8834, - "subseteq;": 8838, - "subseteqq;": 10949, - "subsetneq;": 8842, - "subsetneqq;": 10955, - "subsim;": 10951, - "subsub;": 10965, - "subsup;": 10963, - "succ;": 8827, - "succapprox;": 10936, - "succcurlyeq;": 8829, - "succeq;": 10928, - "succnapprox;": 10938, - "succneqq;": 10934, - "succnsim;": 8937, - "succsim;": 8831, - "sum;": 8721, - "sung;": 9834, - sup1: 185, - "sup1;": 185, - sup2: 178, - "sup2;": 178, - sup3: 179, - "sup3;": 179, - "sup;": 8835, - "supE;": 10950, - "supdot;": 10942, - "supdsub;": 10968, - "supe;": 8839, - "supedot;": 10948, - "suphsol;": 10185, - "suphsub;": 10967, - "suplarr;": 10619, - "supmult;": 10946, - "supnE;": 10956, - "supne;": 8843, - "supplus;": 10944, - "supset;": 8835, - "supseteq;": 8839, - "supseteqq;": 10950, - "supsetneq;": 8843, - "supsetneqq;": 10956, - "supsim;": 10952, - "supsub;": 10964, - "supsup;": 10966, - "swArr;": 8665, - "swarhk;": 10534, - "swarr;": 8601, - "swarrow;": 8601, - "swnwar;": 10538, - szlig: 223, - "szlig;": 223, - "target;": 8982, - "tau;": 964, - "tbrk;": 9140, - "tcaron;": 357, - "tcedil;": 355, - "tcy;": 1090, - "tdot;": 8411, - "telrec;": 8981, - "tfr;": [55349, 56625], - "there4;": 8756, - "therefore;": 8756, - "theta;": 952, - "thetasym;": 977, - "thetav;": 977, - "thickapprox;": 8776, - "thicksim;": 8764, - "thinsp;": 8201, - "thkap;": 8776, - "thksim;": 8764, - thorn: 254, - "thorn;": 254, - "tilde;": 732, - times: 215, - "times;": 215, - "timesb;": 8864, - "timesbar;": 10801, - "timesd;": 10800, - "tint;": 8749, - "toea;": 10536, - "top;": 8868, - "topbot;": 9014, - "topcir;": 10993, - "topf;": [55349, 56677], - "topfork;": 10970, - "tosa;": 10537, - "tprime;": 8244, - "trade;": 8482, - "triangle;": 9653, - "triangledown;": 9663, - "triangleleft;": 9667, - "trianglelefteq;": 8884, - "triangleq;": 8796, - "triangleright;": 9657, - "trianglerighteq;": 8885, - "tridot;": 9708, - "trie;": 8796, - "triminus;": 10810, - "triplus;": 10809, - "trisb;": 10701, - "tritime;": 10811, - "trpezium;": 9186, - "tscr;": [55349, 56521], - "tscy;": 1094, - "tshcy;": 1115, - "tstrok;": 359, - "twixt;": 8812, - "twoheadleftarrow;": 8606, - "twoheadrightarrow;": 8608, - "uArr;": 8657, - "uHar;": 10595, - uacute: 250, - "uacute;": 250, - "uarr;": 8593, - "ubrcy;": 1118, - "ubreve;": 365, - ucirc: 251, - "ucirc;": 251, - "ucy;": 1091, - "udarr;": 8645, - "udblac;": 369, - "udhar;": 10606, - "ufisht;": 10622, - "ufr;": [55349, 56626], - ugrave: 249, - "ugrave;": 249, - "uharl;": 8639, - "uharr;": 8638, - "uhblk;": 9600, - "ulcorn;": 8988, - "ulcorner;": 8988, - "ulcrop;": 8975, - "ultri;": 9720, - "umacr;": 363, - uml: 168, - "uml;": 168, - "uogon;": 371, - "uopf;": [55349, 56678], - "uparrow;": 8593, - "updownarrow;": 8597, - "upharpoonleft;": 8639, - "upharpoonright;": 8638, - "uplus;": 8846, - "upsi;": 965, - "upsih;": 978, - "upsilon;": 965, - "upuparrows;": 8648, - "urcorn;": 8989, - "urcorner;": 8989, - "urcrop;": 8974, - "uring;": 367, - "urtri;": 9721, - "uscr;": [55349, 56522], - "utdot;": 8944, - "utilde;": 361, - "utri;": 9653, - "utrif;": 9652, - "uuarr;": 8648, - uuml: 252, - "uuml;": 252, - "uwangle;": 10663, - "vArr;": 8661, - "vBar;": 10984, - "vBarv;": 10985, - "vDash;": 8872, - "vangrt;": 10652, - "varepsilon;": 1013, - "varkappa;": 1008, - "varnothing;": 8709, - "varphi;": 981, - "varpi;": 982, - "varpropto;": 8733, - "varr;": 8597, - "varrho;": 1009, - "varsigma;": 962, - "varsubsetneq;": [8842, 65024], - "varsubsetneqq;": [10955, 65024], - "varsupsetneq;": [8843, 65024], - "varsupsetneqq;": [10956, 65024], - "vartheta;": 977, - "vartriangleleft;": 8882, - "vartriangleright;": 8883, - "vcy;": 1074, - "vdash;": 8866, - "vee;": 8744, - "veebar;": 8891, - "veeeq;": 8794, - "vellip;": 8942, - "verbar;": 124, - "vert;": 124, - "vfr;": [55349, 56627], - "vltri;": 8882, - "vnsub;": [8834, 8402], - "vnsup;": [8835, 8402], - "vopf;": [55349, 56679], - "vprop;": 8733, - "vrtri;": 8883, - "vscr;": [55349, 56523], - "vsubnE;": [10955, 65024], - "vsubne;": [8842, 65024], - "vsupnE;": [10956, 65024], - "vsupne;": [8843, 65024], - "vzigzag;": 10650, - "wcirc;": 373, - "wedbar;": 10847, - "wedge;": 8743, - "wedgeq;": 8793, - "weierp;": 8472, - "wfr;": [55349, 56628], - "wopf;": [55349, 56680], - "wp;": 8472, - "wr;": 8768, - "wreath;": 8768, - "wscr;": [55349, 56524], - "xcap;": 8898, - "xcirc;": 9711, - "xcup;": 8899, - "xdtri;": 9661, - "xfr;": [55349, 56629], - "xhArr;": 10234, - "xharr;": 10231, - "xi;": 958, - "xlArr;": 10232, - "xlarr;": 10229, - "xmap;": 10236, - "xnis;": 8955, - "xodot;": 10752, - "xopf;": [55349, 56681], - "xoplus;": 10753, - "xotime;": 10754, - "xrArr;": 10233, - "xrarr;": 10230, - "xscr;": [55349, 56525], - "xsqcup;": 10758, - "xuplus;": 10756, - "xutri;": 9651, - "xvee;": 8897, - "xwedge;": 8896, - yacute: 253, - "yacute;": 253, - "yacy;": 1103, - "ycirc;": 375, - "ycy;": 1099, - yen: 165, - "yen;": 165, - "yfr;": [55349, 56630], - "yicy;": 1111, - "yopf;": [55349, 56682], - "yscr;": [55349, 56526], - "yucy;": 1102, - yuml: 255, - "yuml;": 255, - "zacute;": 378, - "zcaron;": 382, - "zcy;": 1079, - "zdot;": 380, - "zeetrf;": 8488, - "zeta;": 950, - "zfr;": [55349, 56631], - "zhcy;": 1078, - "zigrarr;": 8669, - "zopf;": [55349, 56683], - "zscr;": [55349, 56527], - "zwj;": 8205, - "zwnj;": 8204 - }, pe = /(A(?:Elig;?|MP;?|acute;?|breve;|c(?:irc;?|y;)|fr;|grave;?|lpha;|macr;|nd;|o(?:gon;|pf;)|pplyFunction;|ring;?|s(?:cr;|sign;)|tilde;?|uml;?)|B(?:a(?:ckslash;|r(?:v;|wed;))|cy;|e(?:cause;|rnoullis;|ta;)|fr;|opf;|reve;|scr;|umpeq;)|C(?:Hcy;|OPY;?|a(?:cute;|p(?:;|italDifferentialD;)|yleys;)|c(?:aron;|edil;?|irc;|onint;)|dot;|e(?:dilla;|nterDot;)|fr;|hi;|ircle(?:Dot;|Minus;|Plus;|Times;)|lo(?:ckwiseContourIntegral;|seCurly(?:DoubleQuote;|Quote;))|o(?:lon(?:;|e;)|n(?:gruent;|int;|tourIntegral;)|p(?:f;|roduct;)|unterClockwiseContourIntegral;)|ross;|scr;|up(?:;|Cap;))|D(?:D(?:;|otrahd;)|Jcy;|Scy;|Zcy;|a(?:gger;|rr;|shv;)|c(?:aron;|y;)|el(?:;|ta;)|fr;|i(?:a(?:critical(?:Acute;|Do(?:t;|ubleAcute;)|Grave;|Tilde;)|mond;)|fferentialD;)|o(?:pf;|t(?:;|Dot;|Equal;)|uble(?:ContourIntegral;|Do(?:t;|wnArrow;)|L(?:eft(?:Arrow;|RightArrow;|Tee;)|ong(?:Left(?:Arrow;|RightArrow;)|RightArrow;))|Right(?:Arrow;|Tee;)|Up(?:Arrow;|DownArrow;)|VerticalBar;)|wn(?:Arrow(?:;|Bar;|UpArrow;)|Breve;|Left(?:RightVector;|TeeVector;|Vector(?:;|Bar;))|Right(?:TeeVector;|Vector(?:;|Bar;))|Tee(?:;|Arrow;)|arrow;))|s(?:cr;|trok;))|E(?:NG;|TH;?|acute;?|c(?:aron;|irc;?|y;)|dot;|fr;|grave;?|lement;|m(?:acr;|pty(?:SmallSquare;|VerySmallSquare;))|o(?:gon;|pf;)|psilon;|qu(?:al(?:;|Tilde;)|ilibrium;)|s(?:cr;|im;)|ta;|uml;?|x(?:ists;|ponentialE;))|F(?:cy;|fr;|illed(?:SmallSquare;|VerySmallSquare;)|o(?:pf;|rAll;|uriertrf;)|scr;)|G(?:Jcy;|T;?|amma(?:;|d;)|breve;|c(?:edil;|irc;|y;)|dot;|fr;|g;|opf;|reater(?:Equal(?:;|Less;)|FullEqual;|Greater;|Less;|SlantEqual;|Tilde;)|scr;|t;)|H(?:ARDcy;|a(?:cek;|t;)|circ;|fr;|ilbertSpace;|o(?:pf;|rizontalLine;)|s(?:cr;|trok;)|ump(?:DownHump;|Equal;))|I(?:Ecy;|Jlig;|Ocy;|acute;?|c(?:irc;?|y;)|dot;|fr;|grave;?|m(?:;|a(?:cr;|ginaryI;)|plies;)|n(?:t(?:;|e(?:gral;|rsection;))|visible(?:Comma;|Times;))|o(?:gon;|pf;|ta;)|scr;|tilde;|u(?:kcy;|ml;?))|J(?:c(?:irc;|y;)|fr;|opf;|s(?:cr;|ercy;)|ukcy;)|K(?:Hcy;|Jcy;|appa;|c(?:edil;|y;)|fr;|opf;|scr;)|L(?:Jcy;|T;?|a(?:cute;|mbda;|ng;|placetrf;|rr;)|c(?:aron;|edil;|y;)|e(?:ft(?:A(?:ngleBracket;|rrow(?:;|Bar;|RightArrow;))|Ceiling;|Do(?:ubleBracket;|wn(?:TeeVector;|Vector(?:;|Bar;)))|Floor;|Right(?:Arrow;|Vector;)|T(?:ee(?:;|Arrow;|Vector;)|riangle(?:;|Bar;|Equal;))|Up(?:DownVector;|TeeVector;|Vector(?:;|Bar;))|Vector(?:;|Bar;)|arrow;|rightarrow;)|ss(?:EqualGreater;|FullEqual;|Greater;|Less;|SlantEqual;|Tilde;))|fr;|l(?:;|eftarrow;)|midot;|o(?:ng(?:Left(?:Arrow;|RightArrow;)|RightArrow;|left(?:arrow;|rightarrow;)|rightarrow;)|pf;|wer(?:LeftArrow;|RightArrow;))|s(?:cr;|h;|trok;)|t;)|M(?:ap;|cy;|e(?:diumSpace;|llintrf;)|fr;|inusPlus;|opf;|scr;|u;)|N(?:Jcy;|acute;|c(?:aron;|edil;|y;)|e(?:gative(?:MediumSpace;|Thi(?:ckSpace;|nSpace;)|VeryThinSpace;)|sted(?:GreaterGreater;|LessLess;)|wLine;)|fr;|o(?:Break;|nBreakingSpace;|pf;|t(?:;|C(?:ongruent;|upCap;)|DoubleVerticalBar;|E(?:lement;|qual(?:;|Tilde;)|xists;)|Greater(?:;|Equal;|FullEqual;|Greater;|Less;|SlantEqual;|Tilde;)|Hump(?:DownHump;|Equal;)|Le(?:ftTriangle(?:;|Bar;|Equal;)|ss(?:;|Equal;|Greater;|Less;|SlantEqual;|Tilde;))|Nested(?:GreaterGreater;|LessLess;)|Precedes(?:;|Equal;|SlantEqual;)|R(?:everseElement;|ightTriangle(?:;|Bar;|Equal;))|S(?:quareSu(?:bset(?:;|Equal;)|perset(?:;|Equal;))|u(?:bset(?:;|Equal;)|cceeds(?:;|Equal;|SlantEqual;|Tilde;)|perset(?:;|Equal;)))|Tilde(?:;|Equal;|FullEqual;|Tilde;)|VerticalBar;))|scr;|tilde;?|u;)|O(?:Elig;|acute;?|c(?:irc;?|y;)|dblac;|fr;|grave;?|m(?:acr;|ega;|icron;)|opf;|penCurly(?:DoubleQuote;|Quote;)|r;|s(?:cr;|lash;?)|ti(?:lde;?|mes;)|uml;?|ver(?:B(?:ar;|rac(?:e;|ket;))|Parenthesis;))|P(?:artialD;|cy;|fr;|hi;|i;|lusMinus;|o(?:incareplane;|pf;)|r(?:;|ecedes(?:;|Equal;|SlantEqual;|Tilde;)|ime;|o(?:duct;|portion(?:;|al;)))|s(?:cr;|i;))|Q(?:UOT;?|fr;|opf;|scr;)|R(?:Barr;|EG;?|a(?:cute;|ng;|rr(?:;|tl;))|c(?:aron;|edil;|y;)|e(?:;|verse(?:E(?:lement;|quilibrium;)|UpEquilibrium;))|fr;|ho;|ight(?:A(?:ngleBracket;|rrow(?:;|Bar;|LeftArrow;))|Ceiling;|Do(?:ubleBracket;|wn(?:TeeVector;|Vector(?:;|Bar;)))|Floor;|T(?:ee(?:;|Arrow;|Vector;)|riangle(?:;|Bar;|Equal;))|Up(?:DownVector;|TeeVector;|Vector(?:;|Bar;))|Vector(?:;|Bar;)|arrow;)|o(?:pf;|undImplies;)|rightarrow;|s(?:cr;|h;)|uleDelayed;)|S(?:H(?:CHcy;|cy;)|OFTcy;|acute;|c(?:;|aron;|edil;|irc;|y;)|fr;|hort(?:DownArrow;|LeftArrow;|RightArrow;|UpArrow;)|igma;|mallCircle;|opf;|q(?:rt;|uare(?:;|Intersection;|Su(?:bset(?:;|Equal;)|perset(?:;|Equal;))|Union;))|scr;|tar;|u(?:b(?:;|set(?:;|Equal;))|c(?:ceeds(?:;|Equal;|SlantEqual;|Tilde;)|hThat;)|m;|p(?:;|erset(?:;|Equal;)|set;)))|T(?:HORN;?|RADE;|S(?:Hcy;|cy;)|a(?:b;|u;)|c(?:aron;|edil;|y;)|fr;|h(?:e(?:refore;|ta;)|i(?:ckSpace;|nSpace;))|ilde(?:;|Equal;|FullEqual;|Tilde;)|opf;|ripleDot;|s(?:cr;|trok;))|U(?:a(?:cute;?|rr(?:;|ocir;))|br(?:cy;|eve;)|c(?:irc;?|y;)|dblac;|fr;|grave;?|macr;|n(?:der(?:B(?:ar;|rac(?:e;|ket;))|Parenthesis;)|ion(?:;|Plus;))|o(?:gon;|pf;)|p(?:Arrow(?:;|Bar;|DownArrow;)|DownArrow;|Equilibrium;|Tee(?:;|Arrow;)|arrow;|downarrow;|per(?:LeftArrow;|RightArrow;)|si(?:;|lon;))|ring;|scr;|tilde;|uml;?)|V(?:Dash;|bar;|cy;|dash(?:;|l;)|e(?:e;|r(?:bar;|t(?:;|ical(?:Bar;|Line;|Separator;|Tilde;))|yThinSpace;))|fr;|opf;|scr;|vdash;)|W(?:circ;|edge;|fr;|opf;|scr;)|X(?:fr;|i;|opf;|scr;)|Y(?:Acy;|Icy;|Ucy;|acute;?|c(?:irc;|y;)|fr;|opf;|scr;|uml;)|Z(?:Hcy;|acute;|c(?:aron;|y;)|dot;|e(?:roWidthSpace;|ta;)|fr;|opf;|scr;)|a(?:acute;?|breve;|c(?:;|E;|d;|irc;?|ute;?|y;)|elig;?|f(?:;|r;)|grave;?|l(?:e(?:fsym;|ph;)|pha;)|m(?:a(?:cr;|lg;)|p;?)|n(?:d(?:;|and;|d;|slope;|v;)|g(?:;|e;|le;|msd(?:;|a(?:a;|b;|c;|d;|e;|f;|g;|h;))|rt(?:;|vb(?:;|d;))|s(?:ph;|t;)|zarr;))|o(?:gon;|pf;)|p(?:;|E;|acir;|e;|id;|os;|prox(?:;|eq;))|ring;?|s(?:cr;|t;|ymp(?:;|eq;))|tilde;?|uml;?|w(?:conint;|int;))|b(?:Not;|a(?:ck(?:cong;|epsilon;|prime;|sim(?:;|eq;))|r(?:vee;|wed(?:;|ge;)))|brk(?:;|tbrk;)|c(?:ong;|y;)|dquo;|e(?:caus(?:;|e;)|mptyv;|psi;|rnou;|t(?:a;|h;|ween;))|fr;|ig(?:c(?:ap;|irc;|up;)|o(?:dot;|plus;|times;)|s(?:qcup;|tar;)|triangle(?:down;|up;)|uplus;|vee;|wedge;)|karow;|l(?:a(?:ck(?:lozenge;|square;|triangle(?:;|down;|left;|right;))|nk;)|k(?:1(?:2;|4;)|34;)|ock;)|n(?:e(?:;|quiv;)|ot;)|o(?:pf;|t(?:;|tom;)|wtie;|x(?:D(?:L;|R;|l;|r;)|H(?:;|D;|U;|d;|u;)|U(?:L;|R;|l;|r;)|V(?:;|H;|L;|R;|h;|l;|r;)|box;|d(?:L;|R;|l;|r;)|h(?:;|D;|U;|d;|u;)|minus;|plus;|times;|u(?:L;|R;|l;|r;)|v(?:;|H;|L;|R;|h;|l;|r;)))|prime;|r(?:eve;|vbar;?)|s(?:cr;|emi;|im(?:;|e;)|ol(?:;|b;|hsub;))|u(?:ll(?:;|et;)|mp(?:;|E;|e(?:;|q;))))|c(?:a(?:cute;|p(?:;|and;|brcup;|c(?:ap;|up;)|dot;|s;)|r(?:et;|on;))|c(?:a(?:ps;|ron;)|edil;?|irc;|ups(?:;|sm;))|dot;|e(?:dil;?|mptyv;|nt(?:;|erdot;|))|fr;|h(?:cy;|eck(?:;|mark;)|i;)|ir(?:;|E;|c(?:;|eq;|le(?:arrow(?:left;|right;)|d(?:R;|S;|ast;|circ;|dash;)))|e;|fnint;|mid;|scir;)|lubs(?:;|uit;)|o(?:lon(?:;|e(?:;|q;))|m(?:ma(?:;|t;)|p(?:;|fn;|le(?:ment;|xes;)))|n(?:g(?:;|dot;)|int;)|p(?:f;|rod;|y(?:;|sr;|)))|r(?:arr;|oss;)|s(?:cr;|u(?:b(?:;|e;)|p(?:;|e;)))|tdot;|u(?:darr(?:l;|r;)|e(?:pr;|sc;)|larr(?:;|p;)|p(?:;|brcap;|c(?:ap;|up;)|dot;|or;|s;)|r(?:arr(?:;|m;)|ly(?:eq(?:prec;|succ;)|vee;|wedge;)|ren;?|vearrow(?:left;|right;))|vee;|wed;)|w(?:conint;|int;)|ylcty;)|d(?:Arr;|Har;|a(?:gger;|leth;|rr;|sh(?:;|v;))|b(?:karow;|lac;)|c(?:aron;|y;)|d(?:;|a(?:gger;|rr;)|otseq;)|e(?:g;?|lta;|mptyv;)|f(?:isht;|r;)|har(?:l;|r;)|i(?:am(?:;|ond(?:;|suit;)|s;)|e;|gamma;|sin;|v(?:;|ide(?:;|ontimes;|)|onx;))|jcy;|lc(?:orn;|rop;)|o(?:llar;|pf;|t(?:;|eq(?:;|dot;)|minus;|plus;|square;)|ublebarwedge;|wn(?:arrow;|downarrows;|harpoon(?:left;|right;)))|r(?:bkarow;|c(?:orn;|rop;))|s(?:c(?:r;|y;)|ol;|trok;)|t(?:dot;|ri(?:;|f;))|u(?:arr;|har;)|wangle;|z(?:cy;|igrarr;))|e(?:D(?:Dot;|ot;)|a(?:cute;?|ster;)|c(?:aron;|ir(?:;|c;?)|olon;|y;)|dot;|e;|f(?:Dot;|r;)|g(?:;|rave;?|s(?:;|dot;))|l(?:;|inters;|l;|s(?:;|dot;))|m(?:acr;|pty(?:;|set;|v;)|sp(?:1(?:3;|4;)|;))|n(?:g;|sp;)|o(?:gon;|pf;)|p(?:ar(?:;|sl;)|lus;|si(?:;|lon;|v;))|q(?:c(?:irc;|olon;)|s(?:im;|lant(?:gtr;|less;))|u(?:als;|est;|iv(?:;|DD;))|vparsl;)|r(?:Dot;|arr;)|s(?:cr;|dot;|im;)|t(?:a;|h;?)|u(?:ml;?|ro;)|x(?:cl;|ist;|p(?:ectation;|onentiale;)))|f(?:allingdotseq;|cy;|emale;|f(?:ilig;|l(?:ig;|lig;)|r;)|ilig;|jlig;|l(?:at;|lig;|tns;)|nof;|o(?:pf;|r(?:all;|k(?:;|v;)))|partint;|r(?:a(?:c(?:1(?:2;?|3;|4;?|5;|6;|8;)|2(?:3;|5;)|3(?:4;?|5;|8;)|45;|5(?:6;|8;)|78;)|sl;)|own;)|scr;)|g(?:E(?:;|l;)|a(?:cute;|mma(?:;|d;)|p;)|breve;|c(?:irc;|y;)|dot;|e(?:;|l;|q(?:;|q;|slant;)|s(?:;|cc;|dot(?:;|o(?:;|l;))|l(?:;|es;)))|fr;|g(?:;|g;)|imel;|jcy;|l(?:;|E;|a;|j;)|n(?:E;|ap(?:;|prox;)|e(?:;|q(?:;|q;))|sim;)|opf;|rave;|s(?:cr;|im(?:;|e;|l;))|t(?:;|c(?:c;|ir;)|dot;|lPar;|quest;|r(?:a(?:pprox;|rr;)|dot;|eq(?:less;|qless;)|less;|sim;)|)|v(?:ertneqq;|nE;))|h(?:Arr;|a(?:irsp;|lf;|milt;|r(?:dcy;|r(?:;|cir;|w;)))|bar;|circ;|e(?:arts(?:;|uit;)|llip;|rcon;)|fr;|ks(?:earow;|warow;)|o(?:arr;|mtht;|ok(?:leftarrow;|rightarrow;)|pf;|rbar;)|s(?:cr;|lash;|trok;)|y(?:bull;|phen;))|i(?:acute;?|c(?:;|irc;?|y;)|e(?:cy;|xcl;?)|f(?:f;|r;)|grave;?|i(?:;|i(?:int;|nt;)|nfin;|ota;)|jlig;|m(?:a(?:cr;|g(?:e;|line;|part;)|th;)|of;|ped;)|n(?:;|care;|fin(?:;|tie;)|odot;|t(?:;|cal;|e(?:gers;|rcal;)|larhk;|prod;))|o(?:cy;|gon;|pf;|ta;)|prod;|quest;?|s(?:cr;|in(?:;|E;|dot;|s(?:;|v;)|v;))|t(?:;|ilde;)|u(?:kcy;|ml;?))|j(?:c(?:irc;|y;)|fr;|math;|opf;|s(?:cr;|ercy;)|ukcy;)|k(?:appa(?:;|v;)|c(?:edil;|y;)|fr;|green;|hcy;|jcy;|opf;|scr;)|l(?:A(?:arr;|rr;|tail;)|Barr;|E(?:;|g;)|Har;|a(?:cute;|emptyv;|gran;|mbda;|ng(?:;|d;|le;)|p;|quo;?|rr(?:;|b(?:;|fs;)|fs;|hk;|lp;|pl;|sim;|tl;)|t(?:;|ail;|e(?:;|s;)))|b(?:arr;|brk;|r(?:ac(?:e;|k;)|k(?:e;|sl(?:d;|u;))))|c(?:aron;|e(?:dil;|il;)|ub;|y;)|d(?:ca;|quo(?:;|r;)|r(?:dhar;|ushar;)|sh;)|e(?:;|ft(?:arrow(?:;|tail;)|harpoon(?:down;|up;)|leftarrows;|right(?:arrow(?:;|s;)|harpoons;|squigarrow;)|threetimes;)|g;|q(?:;|q;|slant;)|s(?:;|cc;|dot(?:;|o(?:;|r;))|g(?:;|es;)|s(?:approx;|dot;|eq(?:gtr;|qgtr;)|gtr;|sim;)))|f(?:isht;|loor;|r;)|g(?:;|E;)|h(?:ar(?:d;|u(?:;|l;))|blk;)|jcy;|l(?:;|arr;|corner;|hard;|tri;)|m(?:idot;|oust(?:;|ache;))|n(?:E;|ap(?:;|prox;)|e(?:;|q(?:;|q;))|sim;)|o(?:a(?:ng;|rr;)|brk;|ng(?:left(?:arrow;|rightarrow;)|mapsto;|rightarrow;)|oparrow(?:left;|right;)|p(?:ar;|f;|lus;)|times;|w(?:ast;|bar;)|z(?:;|enge;|f;))|par(?:;|lt;)|r(?:arr;|corner;|har(?:;|d;)|m;|tri;)|s(?:aquo;|cr;|h;|im(?:;|e;|g;)|q(?:b;|uo(?:;|r;))|trok;)|t(?:;|c(?:c;|ir;)|dot;|hree;|imes;|larr;|quest;|r(?:Par;|i(?:;|e;|f;))|)|ur(?:dshar;|uhar;)|v(?:ertneqq;|nE;))|m(?:DDot;|a(?:cr;?|l(?:e;|t(?:;|ese;))|p(?:;|sto(?:;|down;|left;|up;))|rker;)|c(?:omma;|y;)|dash;|easuredangle;|fr;|ho;|i(?:cro;?|d(?:;|ast;|cir;|dot;?)|nus(?:;|b;|d(?:;|u;)))|l(?:cp;|dr;)|nplus;|o(?:dels;|pf;)|p;|s(?:cr;|tpos;)|u(?:;|ltimap;|map;))|n(?:G(?:g;|t(?:;|v;))|L(?:eft(?:arrow;|rightarrow;)|l;|t(?:;|v;))|Rightarrow;|V(?:Dash;|dash;)|a(?:bla;|cute;|ng;|p(?:;|E;|id;|os;|prox;)|tur(?:;|al(?:;|s;)))|b(?:sp;?|ump(?:;|e;))|c(?:a(?:p;|ron;)|edil;|ong(?:;|dot;)|up;|y;)|dash;|e(?:;|Arr;|ar(?:hk;|r(?:;|ow;))|dot;|quiv;|s(?:ear;|im;)|xist(?:;|s;))|fr;|g(?:E;|e(?:;|q(?:;|q;|slant;)|s;)|sim;|t(?:;|r;))|h(?:Arr;|arr;|par;)|i(?:;|s(?:;|d;)|v;)|jcy;|l(?:Arr;|E;|arr;|dr;|e(?:;|ft(?:arrow;|rightarrow;)|q(?:;|q;|slant;)|s(?:;|s;))|sim;|t(?:;|ri(?:;|e;)))|mid;|o(?:pf;|t(?:;|in(?:;|E;|dot;|v(?:a;|b;|c;))|ni(?:;|v(?:a;|b;|c;))|))|p(?:ar(?:;|allel;|sl;|t;)|olint;|r(?:;|cue;|e(?:;|c(?:;|eq;))))|r(?:Arr;|arr(?:;|c;|w;)|ightarrow;|tri(?:;|e;))|s(?:c(?:;|cue;|e;|r;)|hort(?:mid;|parallel;)|im(?:;|e(?:;|q;))|mid;|par;|qsu(?:be;|pe;)|u(?:b(?:;|E;|e;|set(?:;|eq(?:;|q;)))|cc(?:;|eq;)|p(?:;|E;|e;|set(?:;|eq(?:;|q;)))))|t(?:gl;|ilde;?|lg;|riangle(?:left(?:;|eq;)|right(?:;|eq;)))|u(?:;|m(?:;|ero;|sp;))|v(?:Dash;|Harr;|ap;|dash;|g(?:e;|t;)|infin;|l(?:Arr;|e;|t(?:;|rie;))|r(?:Arr;|trie;)|sim;)|w(?:Arr;|ar(?:hk;|r(?:;|ow;))|near;))|o(?:S;|a(?:cute;?|st;)|c(?:ir(?:;|c;?)|y;)|d(?:ash;|blac;|iv;|ot;|sold;)|elig;|f(?:cir;|r;)|g(?:on;|rave;?|t;)|h(?:bar;|m;)|int;|l(?:arr;|c(?:ir;|ross;)|ine;|t;)|m(?:acr;|ega;|i(?:cron;|d;|nus;))|opf;|p(?:ar;|erp;|lus;)|r(?:;|arr;|d(?:;|er(?:;|of;)|f;?|m;?)|igof;|or;|slope;|v;)|s(?:cr;|lash;?|ol;)|ti(?:lde;?|mes(?:;|as;))|uml;?|vbar;)|p(?:ar(?:;|a(?:;|llel;|)|s(?:im;|l;)|t;)|cy;|er(?:cnt;|iod;|mil;|p;|tenk;)|fr;|h(?:i(?:;|v;)|mmat;|one;)|i(?:;|tchfork;|v;)|l(?:an(?:ck(?:;|h;)|kv;)|us(?:;|acir;|b;|cir;|d(?:o;|u;)|e;|mn;?|sim;|two;))|m;|o(?:intint;|pf;|und;?)|r(?:;|E;|ap;|cue;|e(?:;|c(?:;|approx;|curlyeq;|eq;|n(?:approx;|eqq;|sim;)|sim;))|ime(?:;|s;)|n(?:E;|ap;|sim;)|o(?:d;|f(?:alar;|line;|surf;)|p(?:;|to;))|sim;|urel;)|s(?:cr;|i;)|uncsp;)|q(?:fr;|int;|opf;|prime;|scr;|u(?:at(?:ernions;|int;)|est(?:;|eq;)|ot;?))|r(?:A(?:arr;|rr;|tail;)|Barr;|Har;|a(?:c(?:e;|ute;)|dic;|emptyv;|ng(?:;|d;|e;|le;)|quo;?|rr(?:;|ap;|b(?:;|fs;)|c;|fs;|hk;|lp;|pl;|sim;|tl;|w;)|t(?:ail;|io(?:;|nals;)))|b(?:arr;|brk;|r(?:ac(?:e;|k;)|k(?:e;|sl(?:d;|u;))))|c(?:aron;|e(?:dil;|il;)|ub;|y;)|d(?:ca;|ldhar;|quo(?:;|r;)|sh;)|e(?:al(?:;|ine;|part;|s;)|ct;|g;?)|f(?:isht;|loor;|r;)|h(?:ar(?:d;|u(?:;|l;))|o(?:;|v;))|i(?:ght(?:arrow(?:;|tail;)|harpoon(?:down;|up;)|left(?:arrows;|harpoons;)|rightarrows;|squigarrow;|threetimes;)|ng;|singdotseq;)|l(?:arr;|har;|m;)|moust(?:;|ache;)|nmid;|o(?:a(?:ng;|rr;)|brk;|p(?:ar;|f;|lus;)|times;)|p(?:ar(?:;|gt;)|polint;)|rarr;|s(?:aquo;|cr;|h;|q(?:b;|uo(?:;|r;)))|t(?:hree;|imes;|ri(?:;|e;|f;|ltri;))|uluhar;|x;)|s(?:acute;|bquo;|c(?:;|E;|a(?:p;|ron;)|cue;|e(?:;|dil;)|irc;|n(?:E;|ap;|sim;)|polint;|sim;|y;)|dot(?:;|b;|e;)|e(?:Arr;|ar(?:hk;|r(?:;|ow;))|ct;?|mi;|swar;|tm(?:inus;|n;)|xt;)|fr(?:;|own;)|h(?:arp;|c(?:hcy;|y;)|ort(?:mid;|parallel;)|y;?)|i(?:gma(?:;|f;|v;)|m(?:;|dot;|e(?:;|q;)|g(?:;|E;)|l(?:;|E;)|ne;|plus;|rarr;))|larr;|m(?:a(?:llsetminus;|shp;)|eparsl;|i(?:d;|le;)|t(?:;|e(?:;|s;)))|o(?:ftcy;|l(?:;|b(?:;|ar;))|pf;)|pa(?:des(?:;|uit;)|r;)|q(?:c(?:ap(?:;|s;)|up(?:;|s;))|su(?:b(?:;|e;|set(?:;|eq;))|p(?:;|e;|set(?:;|eq;)))|u(?:;|ar(?:e;|f;)|f;))|rarr;|s(?:cr;|etmn;|mile;|tarf;)|t(?:ar(?:;|f;)|r(?:aight(?:epsilon;|phi;)|ns;))|u(?:b(?:;|E;|dot;|e(?:;|dot;)|mult;|n(?:E;|e;)|plus;|rarr;|s(?:et(?:;|eq(?:;|q;)|neq(?:;|q;))|im;|u(?:b;|p;)))|cc(?:;|approx;|curlyeq;|eq;|n(?:approx;|eqq;|sim;)|sim;)|m;|ng;|p(?:1;?|2;?|3;?|;|E;|d(?:ot;|sub;)|e(?:;|dot;)|hs(?:ol;|ub;)|larr;|mult;|n(?:E;|e;)|plus;|s(?:et(?:;|eq(?:;|q;)|neq(?:;|q;))|im;|u(?:b;|p;))))|w(?:Arr;|ar(?:hk;|r(?:;|ow;))|nwar;)|zlig;?)|t(?:a(?:rget;|u;)|brk;|c(?:aron;|edil;|y;)|dot;|elrec;|fr;|h(?:e(?:re(?:4;|fore;)|ta(?:;|sym;|v;))|i(?:ck(?:approx;|sim;)|nsp;)|k(?:ap;|sim;)|orn;?)|i(?:lde;|mes(?:;|b(?:;|ar;)|d;|)|nt;)|o(?:ea;|p(?:;|bot;|cir;|f(?:;|ork;))|sa;)|prime;|r(?:ade;|i(?:angle(?:;|down;|left(?:;|eq;)|q;|right(?:;|eq;))|dot;|e;|minus;|plus;|sb;|time;)|pezium;)|s(?:c(?:r;|y;)|hcy;|trok;)|w(?:ixt;|ohead(?:leftarrow;|rightarrow;)))|u(?:Arr;|Har;|a(?:cute;?|rr;)|br(?:cy;|eve;)|c(?:irc;?|y;)|d(?:arr;|blac;|har;)|f(?:isht;|r;)|grave;?|h(?:ar(?:l;|r;)|blk;)|l(?:c(?:orn(?:;|er;)|rop;)|tri;)|m(?:acr;|l;?)|o(?:gon;|pf;)|p(?:arrow;|downarrow;|harpoon(?:left;|right;)|lus;|si(?:;|h;|lon;)|uparrows;)|r(?:c(?:orn(?:;|er;)|rop;)|ing;|tri;)|scr;|t(?:dot;|ilde;|ri(?:;|f;))|u(?:arr;|ml;?)|wangle;)|v(?:Arr;|Bar(?:;|v;)|Dash;|a(?:ngrt;|r(?:epsilon;|kappa;|nothing;|p(?:hi;|i;|ropto;)|r(?:;|ho;)|s(?:igma;|u(?:bsetneq(?:;|q;)|psetneq(?:;|q;)))|t(?:heta;|riangle(?:left;|right;))))|cy;|dash;|e(?:e(?:;|bar;|eq;)|llip;|r(?:bar;|t;))|fr;|ltri;|nsu(?:b;|p;)|opf;|prop;|rtri;|s(?:cr;|u(?:bn(?:E;|e;)|pn(?:E;|e;)))|zigzag;)|w(?:circ;|e(?:d(?:bar;|ge(?:;|q;))|ierp;)|fr;|opf;|p;|r(?:;|eath;)|scr;)|x(?:c(?:ap;|irc;|up;)|dtri;|fr;|h(?:Arr;|arr;)|i;|l(?:Arr;|arr;)|map;|nis;|o(?:dot;|p(?:f;|lus;)|time;)|r(?:Arr;|arr;)|s(?:cr;|qcup;)|u(?:plus;|tri;)|vee;|wedge;)|y(?:ac(?:ute;?|y;)|c(?:irc;|y;)|en;?|fr;|icy;|opf;|scr;|u(?:cy;|ml;?))|z(?:acute;|c(?:aron;|y;)|dot;|e(?:etrf;|ta;)|fr;|hcy;|igrarr;|opf;|scr;|w(?:j;|nj;)))|[\s\S]/g, me = 32, he = /[^\r"&\u0000]+/g, ge = /[^\r'&\u0000]+/g, _e = /[^\r\t\n\f &>\u0000]+/g, ve = /[^\r\t\n\f \/>A-Z\u0000]+/g, ye = /[^\r\t\n\f \/=>A-Z\u0000]+/g, be = /[^\]\r\u0000\uffff]*/g, xe = /[^&<\r\u0000\uffff]*/g, Se = /[^<\r\u0000\uffff]*/g, Ce = /[^\r\u0000\uffff]*/g, we = /(?:(\/)?([a-z]+)>)|[\s\S]/g, Te = /(?:([-a-z]+)[ \t\n\f]*=[ \t\n\f]*('[^'&\r\u0000]*'|"[^"&\r\u0000]*"|[^\t\n\r\f "&'\u0000>][^&> \t\n\r\f\u0000]*[ \t\n\f]))|[\s\S]/g, Ee = /[^\x09\x0A\x0C\x0D\x20]/, De = /[^\x09\x0A\x0C\x0D\x20]/g, Oe = /[^\x00\x09\x0A\x0C\x0D\x20]/, ke = /^[\x09\x0A\x0C\x0D\x20]+/, Ae = /\x00/g; - function P(e) { - var t = 16384; - if (e.length < t) return String.fromCharCode.apply(String, e); - for (var n = ``, r = 0; r < e.length; r += t) n += String.fromCharCode.apply(String, e.slice(r, r + t)); - return n; - } - function je(e) { - for (var t = [], n = 0; n < e.length; n++) t[n] = e.charCodeAt(n); - return t; - } - function F(e, t) { - if (typeof t == `string`) return e.namespaceURI === a.HTML && e.localName === t; - var n = t[e.namespaceURI]; - return n && n[e.localName]; - } - function Me(e) { - return F(e, ce); - } - function Ne(e) { - if (F(e, le)) return !0; - if (e.namespaceURI === a.MATHML && e.localName === `annotation-xml`) { - var t = e.getAttribute(`encoding`); - if (t &&= t.toLowerCase(), t === `text/html` || t === `application/xhtml+xml`) return !0; - } - return !1; - } - function Pe(e) { - return e in M ? M[e] : e; - } - function I(e) { - for (var t = 0, n = e.length; t < n; t++) e[t][0] in A && (e[t][0] = A[e[t][0]]); - } - function Fe(e) { - for (var t = 0, n = e.length; t < n; t++) if (e[t][0] === `definitionurl`) { - e[t][0] = `definitionURL`; - break; - } - } - function Ie(e) { - for (var t = 0, n = e.length; t < n; t++) e[t][0] in k && e[t].push(k[e[t][0]]); - } - function Le(e, t) { - for (var n = 0, r = e.length; n < r; n++) { - var i = e[n][0], a = e[n][1]; - t.hasAttribute(i) || t._setAttribute(i, a); - } - } - L.ElementStack = function() { - this.elements = [], this.top = null; - }, L.ElementStack.prototype.push = function(e) { - this.elements.push(e), this.top = e; - }, L.ElementStack.prototype.pop = function(e) { - this.elements.pop(), this.top = this.elements[this.elements.length - 1]; - }, L.ElementStack.prototype.popTag = function(e) { - for (var t = this.elements.length - 1; t > 0; t--) { - var n = this.elements[t]; - if (F(n, e)) break; - } - this.elements.length = t, this.top = this.elements[t - 1]; - }, L.ElementStack.prototype.popElementType = function(e) { - for (var t = this.elements.length - 1; t > 0 && !(this.elements[t] instanceof e); t--); - this.elements.length = t, this.top = this.elements[t - 1]; - }, L.ElementStack.prototype.popElement = function(e) { - for (var t = this.elements.length - 1; t > 0 && this.elements[t] !== e; t--); - this.elements.length = t, this.top = this.elements[t - 1]; - }, L.ElementStack.prototype.removeElement = function(e) { - if (this.top === e) this.pop(); - else { - var t = this.elements.lastIndexOf(e); - t !== -1 && this.elements.splice(t, 1); - } - }, L.ElementStack.prototype.clearToContext = function(e) { - for (var t = this.elements.length - 1; t > 0 && !F(this.elements[t], e); t--); - this.elements.length = t + 1, this.top = this.elements[t]; - }, L.ElementStack.prototype.contains = function(e) { - return this.inSpecificScope(e, Object.create(null)); - }, L.ElementStack.prototype.inSpecificScope = function(e, t) { - for (var n = this.elements.length - 1; n >= 0; n--) { - var r = this.elements[n]; - if (F(r, e)) return !0; - if (F(r, t)) return !1; - } - return !1; - }, L.ElementStack.prototype.elementInSpecificScope = function(e, t) { - for (var n = this.elements.length - 1; n >= 0; n--) { - var r = this.elements[n]; - if (r === e) return !0; - if (F(r, t)) return !1; - } - return !1; - }, L.ElementStack.prototype.elementTypeInSpecificScope = function(e, t) { - for (var n = this.elements.length - 1; n >= 0; n--) { - var r = this.elements[n]; - if (r instanceof e) return !0; - if (F(r, t)) return !1; - } - return !1; - }, L.ElementStack.prototype.inScope = function(e) { - return this.inSpecificScope(e, O); - }, L.ElementStack.prototype.elementInScope = function(e) { - return this.elementInSpecificScope(e, O); - }, L.ElementStack.prototype.elementTypeInScope = function(e) { - return this.elementTypeInSpecificScope(e, O); - }, L.ElementStack.prototype.inButtonScope = function(e) { - return this.inSpecificScope(e, ae); - }, L.ElementStack.prototype.inListItemScope = function(e) { - return this.inSpecificScope(e, ie); - }, L.ElementStack.prototype.inTableScope = function(e) { - return this.inSpecificScope(e, oe); - }, L.ElementStack.prototype.inSelectScope = function(e) { - for (var t = this.elements.length - 1; t >= 0; t--) { - var n = this.elements[t]; - if (n.namespaceURI !== a.HTML) return !1; - var r = n.localName; - if (r === e) return !0; - if (r !== `optgroup` && r !== `option`) return !1; - } - return !1; - }, L.ElementStack.prototype.generateImpliedEndTags = function(e, t) { - for (var n = t ? D : E, r = this.elements.length - 1; r >= 0; r--) { - var i = this.elements[r]; - if (e && F(i, e) || !F(this.elements[r], n)) break; - } - this.elements.length = r + 1, this.top = this.elements[r]; - }, L.ActiveFormattingElements = function() { - this.list = [], this.attrs = []; - }, L.ActiveFormattingElements.prototype.MARKER = { localName: `|` }, L.ActiveFormattingElements.prototype.insertMarker = function() { - this.list.push(this.MARKER), this.attrs.push(this.MARKER); - }, L.ActiveFormattingElements.prototype.push = function(e, t) { - for (var n = 0, r = this.list.length - 1; r >= 0 && this.list[r] !== this.MARKER; r--) if (o(e, this.list[r], this.attrs[r]) && (n++, n === 3)) { - this.list.splice(r, 1), this.attrs.splice(r, 1); - break; - } - this.list.push(e); - for (var i = [], a = 0; a < t.length; a++) i[a] = t[a]; - this.attrs.push(i); - function o(e, t, n) { - if (e.localName !== t.localName || e._numattrs !== n.length) return !1; - for (var r = 0, i = n.length; r < i; r++) { - var a = n[r][0], o = n[r][1]; - if (!e.hasAttribute(a) || e.getAttribute(a) !== o) return !1; - } - return !0; - } - }, L.ActiveFormattingElements.prototype.clearToMarker = function() { - for (var e = this.list.length - 1; e >= 0 && this.list[e] !== this.MARKER; e--); - e < 0 && (e = 0), this.list.length = e, this.attrs.length = e; - }, L.ActiveFormattingElements.prototype.findElementByTag = function(e) { - for (var t = this.list.length - 1; t >= 0; t--) { - var n = this.list[t]; - if (n === this.MARKER) break; - if (n.localName === e) return n; - } - return null; - }, L.ActiveFormattingElements.prototype.indexOf = function(e) { - return this.list.lastIndexOf(e); - }, L.ActiveFormattingElements.prototype.remove = function(e) { - var t = this.list.lastIndexOf(e); - t !== -1 && (this.list.splice(t, 1), this.attrs.splice(t, 1)); - }, L.ActiveFormattingElements.prototype.replace = function(e, t, n) { - var r = this.list.lastIndexOf(e); - r !== -1 && (this.list[r] = t, this.attrs[r] = n); - }, L.ActiveFormattingElements.prototype.insertAfter = function(e, t) { - var n = this.list.lastIndexOf(e); - n !== -1 && (this.list.splice(n, 0, t), this.attrs.splice(n, 0, t)); - }; - function L(e, t, o) { - var u = null, E = 0, D = 0, O = !1, ie = !1, ae = 0, oe = [], se = ``, ce = !0, le = 0, k = Z, A, j, M = ``, de = ``, N = [], Re = ``, ze = ``, R = [], Be = [], Ve = [], He = [], Ue = [], We = !1, z = hr, Ge = null, Ke = [], B = new L.ElementStack(), V = new L.ActiveFormattingElements(), qe = t !== void 0, Je = null, Ye = null, Xe = !0; - t && (Xe = t.ownerDocument._scripting_enabled), o && o.scripting_enabled === !1 && (Xe = !1); - var H = !0, Ze = !1, Qe, $e, U = [], et = !1, tt = !1, nt = { - document: function() { - return W; - }, - _asDocumentFragment: function() { - for (var e = W.createDocumentFragment(), t = W.firstChild; t.hasChildNodes();) e.appendChild(t.firstChild); - return e; - }, - pause: function() { - le++; - }, - resume: function() { - le--, this.parse(``); - }, - parse: function(e, t, n) { - var r; - return le > 0 ? (se += e, !0) : (ae === 0 ? (se &&= (e = se + e, ``), t && (e += `￿`, O = !0), u = e, E = e.length, D = 0, ce && (ce = !1, u.charCodeAt(0) === 65279 && (D = 1)), ae++, r = at(n), se = u.substring(D, E), ae--) : (ae++, oe.push(u, E, D), u = e, E = e.length, D = 0, at(), r = !1, se = u.substring(D, E), D = oe.pop(), E = oe.pop(), u = oe.pop(), se &&= (u = se + u.substring(D), E = u.length, D = 0, ``), ae--), r); - } - }, W = new n(!0, e); - if (W._parser = nt, W._scripting_enabled = Xe, t) { - if (t.ownerDocument._quirks && (W._quirks = !0), t.ownerDocument._limitedQuirks && (W._limitedQuirks = !0), t.namespaceURI === a.HTML) switch (t.localName) { - case `title`: - case `textarea`: - k = Ut; - break; - case `style`: - case `xmp`: - case `iframe`: - case `noembed`: - case `noframes`: - case `script`: - case `plaintext`: - k = Kt; - break; - } - var rt = W.createElement(`html`); - W._appendChild(rt), B.push(rt), t instanceof c.HTMLTemplateElement && Ke.push(Ar), Pt(); - for (var it = t; it !== null; it = it.parentElement) if (it instanceof c.HTMLFormElement) { - Ye = it; - break; - } - } - function at(e) { - for (var t, n, r, i; D < E;) { - if (le > 0 || e && e()) return !0; - switch (typeof k.lookahead) { - case `undefined`: - if (t = u.charCodeAt(D++), ie && (ie = !1, t === 10)) { - D++; - continue; - } - switch (t) { - case 13: - D < E ? u.charCodeAt(D) === 10 && D++ : ie = !0, k(10); - break; - case 65535: if (O && D === E) { - k(d); - break; - } - default: - k(t); - break; - } - break; - case `number`: - t = u.charCodeAt(D); - var a = k.lookahead, o = !0; - if (a < 0 && (o = !1, a = -a), a < E - D) n = o ? u.substring(D, D + a) : null, i = !1; - else if (O) n = o ? u.substring(D, E) : null, i = !0, t === 65535 && D === E - 1 && (t = d); - else return !0; - k(t, n, i); - break; - case `string`: - t = u.charCodeAt(D), r = k.lookahead; - var s = u.indexOf(r, D); - if (s !== -1) n = u.substring(D, s + r.length), i = !1; - else { - if (!O) return !0; - n = u.substring(D, E), t === 65535 && D === E - 1 && (t = d), i = !0; - } - k(t, n, i); - break; - } - } - return !1; - } - function ot(e, t) { - for (var n = 0; n < Ue.length; n++) if (Ue[n][0] === e) return; - t === void 0 ? Ue.push([e]) : Ue.push([e, t]); - } - function st() { - Te.lastIndex = D - 1; - var e = Te.exec(u); - if (!e) throw Error(`should never happen`); - var t = e[1]; - if (!t) return !1; - var n = e[2], r = n.length; - switch (n[0]) { - case `"`: - case `'`: - n = n.substring(1, r - 1), D += e[0].length - 1, k = Dn; - break; - default: - k = bn, D += e[0].length - 1, n = n.substring(0, r - 1); - break; - } - for (var i = 0; i < Ue.length; i++) if (Ue[i][0] === t) return !0; - return Ue.push([t, n]), !0; - } - function ct() { - We = !1, M = ``, Ue.length = 0; - } - function lt() { - We = !0, M = ``, Ue.length = 0; - } - function ut() { - N.length = 0; - } - function dt() { - Re = ``; - } - function ft() { - ze = ``; - } - function pt() { - R.length = 0; - } - function mt() { - Be.length = 0, Ve = null, He = null; - } - function ht() { - Ve = []; - } - function gt() { - He = []; - } - function G() { - Ze = !0; - } - function _t() { - return B.top && B.top.namespaceURI !== `http://www.w3.org/1999/xhtml`; - } - function vt(e) { - return de === e; - } - function yt() { - if (U.length > 0) { - var e = P(U); - if (U.length = 0, tt && (tt = !1, e[0] === ` -` && (e = e.substring(1)), e.length === 0)) return; - J(f, e), et = !1; - } - tt = !1; - } - function bt(e) { - e.lastIndex = D - 1; - var t = e.exec(u); - if (t && t.index === D - 1) return t = t[0], D += t.length - 1, O && D === E && (t = t.slice(0, -1), D--), t; - throw Error(`should never happen`); - } - function xt(e) { - e.lastIndex = D - 1; - var t = e.exec(u)[0]; - return t ? (St(t), D += t.length - 1, !0) : !1; - } - function St(e) { - U.length > 0 && yt(), !(tt && (tt = !1, e[0] === ` -` && (e = e.substring(1)), e.length === 0)) && J(f, e); - } - function Ct() { - if (We) J(m, M); - else { - var e = M; - M = ``, de = e, J(p, e, Ue); - } - } - function wt() { - if (D === E) return !1; - we.lastIndex = D; - var e = we.exec(u); - if (!e) throw Error(`should never happen`); - var t = e[2]; - return t ? (e[1] ? (D += t.length + 2, J(m, t)) : (D += t.length + 1, de = t, J(p, t, _)), !0) : !1; - } - function Tt() { - We ? J(m, M, null, !0) : J(p, M, Ue, !0); - } - function K() { - J(g, P(Be), Ve ? P(Ve) : void 0, He ? P(He) : void 0); - } - function q() { - yt(), z(d), W.modclock = 1; - } - var J = nt.insertToken = function(e, t, n, r) { - yt(); - var i = B.top; - !i || i.namespaceURI === a.HTML ? z(e, t, n, r) : e !== p && e !== f ? Ir(e, t, n, r) : Me(i) && (e === f || e === p && t !== `mglyph` && t !== `malignmark`) || e === p && t === `svg` && i.namespaceURI === a.MATHML && i.localName === `annotation-xml` || Ne(i) ? ($e = !0, z(e, t, n, r), $e = !1) : Ir(e, t, n, r); - }; - function Et(e) { - var t = B.top; - kt && F(t, T) ? Nt(function(t) { - return t.createComment(e); - }) : (t instanceof c.HTMLTemplateElement && (t = t.content), t._appendChild(t.ownerDocument.createComment(e))); - } - function Dt(e) { - var t = B.top; - if (kt && F(t, T)) Nt(function(t) { - return t.createTextNode(e); - }); - else { - t instanceof c.HTMLTemplateElement && (t = t.content); - var n = t.lastChild; - n && n.nodeType === i.TEXT_NODE ? n.appendData(e) : t._appendChild(t.ownerDocument.createTextNode(e)); - } - } - function Ot(e, t, n) { - var r = s.createElement(e, t, null); - if (n) for (var i = 0, a = n.length; i < a; i++) r._setAttribute(n[i][0], n[i][1]); - return r; - } - var kt = !1; - function Y(e, t) { - var n = At(function(n) { - return Ot(n, e, t); - }); - return F(n, re) && (n._form = Ye), n; - } - function At(e) { - var t; - return kt && F(B.top, T) ? t = Nt(e) : B.top instanceof c.HTMLTemplateElement ? (t = e(B.top.content.ownerDocument), B.top.content._appendChild(t)) : (t = e(B.top.ownerDocument), B.top._appendChild(t)), B.push(t), t; - } - function jt(e, t, n) { - return At(function(r) { - var i = r._createElementNS(e, n, null); - if (t) for (var a = 0, o = t.length; a < o; a++) { - var s = t[a]; - s.length === 2 ? i._setAttribute(s[0], s[1]) : i._setAttributeNS(s[2], s[0], s[1]); - } - return i; - }); - } - function Mt(e) { - for (var t = B.elements.length - 1; t >= 0; t--) if (B.elements[t] instanceof e) return t; - return -1; - } - function Nt(e) { - var t, n, r = -1, a = -1, o; - if (r = Mt(c.HTMLTableElement), a = Mt(c.HTMLTemplateElement), a >= 0 && (r < 0 || a > r) ? t = B.elements[a] : r >= 0 && (t = B.elements[r].parentNode, t ? n = B.elements[r] : t = B.elements[r - 1]), t ||= B.elements[0], t instanceof c.HTMLTemplateElement && (t = t.content), o = e(t.ownerDocument), o.nodeType === i.TEXT_NODE) { - var s = n ? n.previousSibling : t.lastChild; - if (s && s.nodeType === i.TEXT_NODE) return s.appendData(o.data), o; - } - return n ? t.insertBefore(o, n) : t._appendChild(o), o; - } - function Pt() { - for (var e = !1, n = B.elements.length - 1; n >= 0; n--) { - var r = B.elements[n]; - if (n === 0 && (e = !0, qe && (r = t)), r.namespaceURI === a.HTML) { - var i = r.localName; - switch (i) { - case `select`: - for (var o = n; o > 0;) { - var s = B.elements[--o]; - if (s instanceof c.HTMLTemplateElement) break; - if (s instanceof c.HTMLTableElement) { - z = kr; - return; - } - } - z = Or; - return; - case `tr`: - z = Er; - return; - case `tbody`: - case `tfoot`: - case `thead`: - z = Tr; - return; - case `caption`: - z = Cr; - return; - case `colgroup`: - z = wr; - return; - case `table`: - z = xr; - return; - case `template`: - z = Ke[Ke.length - 1]; - return; - case `body`: - z = $; - return; - case `frameset`: - z = Mr; - return; - case `html`: - z = Je === null ? _r : yr; - return; - default: if (!e) { - if (i === `head`) { - z = Q; - return; - } - if (i === `td` || i === `th`) { - z = Dr; - return; - } - } - } - } - if (e) { - z = $; - return; - } - } - } - function Ft(e, t) { - Y(e, t), k = Wt, Ge = z, z = br; - } - function It(e, t) { - Y(e, t), k = Ut, Ge = z, z = br; - } - function Lt(e, t) { - return { - elt: Ot(e, V.list[t].localName, V.attrs[t]), - attrs: V.attrs[t] - }; - } - function Rt() { - if (V.list.length !== 0) { - var e = V.list[V.list.length - 1]; - if (e !== V.MARKER && B.elements.lastIndexOf(e) === -1) { - for (var t = V.list.length - 2; t >= 0 && (e = V.list[t], !(e === V.MARKER || B.elements.lastIndexOf(e) !== -1)); t--); - for (t += 1; t < V.list.length; t++) { - var n = At(function(e) { - return Lt(e, t).elt; - }); - V.list[t] = n; - } - } - } - } - var zt = { localName: `BM` }; - function Bt(e) { - if (F(B.top, e) && V.indexOf(B.top) === -1) return B.pop(), !0; - for (var t = 0; t < 8;) { - t++; - var n = V.findElementByTag(e); - if (!n) return !1; - var r = B.elements.lastIndexOf(n); - if (r === -1) return V.remove(n), !0; - if (!B.elementInScope(n)) return !0; - for (var i = null, a, o = r + 1; o < B.elements.length; o++) if (F(B.elements[o], S)) { - i = B.elements[o], a = o; - break; - } - if (i) { - var s = B.elements[r - 1]; - V.insertAfter(n, zt); - for (var l = i, u = i, d = a, f, p = 0; p++, l = B.elements[--d], l !== n;) { - if (f = V.indexOf(l), p > 3 && f !== -1 && (V.remove(l), f = -1), f === -1) { - B.removeElement(l); - continue; - } - var m = Lt(s.ownerDocument, f); - V.replace(l, m.elt, m.attrs), B.elements[d] = m.elt, l = m.elt, u === i && (V.remove(zt), V.insertAfter(m.elt, zt)), l._appendChild(u), u = l; - } - kt && F(s, T) ? Nt(function() { - return u; - }) : s instanceof c.HTMLTemplateElement ? s.content._appendChild(u) : s._appendChild(u); - for (var h = Lt(i.ownerDocument, V.indexOf(n)); i.hasChildNodes();) h.elt._appendChild(i.firstChild); - i._appendChild(h.elt), V.remove(n), V.replace(zt, h.elt, h.attrs), B.removeElement(n); - var g = B.elements.lastIndexOf(i); - B.elements.splice(g + 1, 0, h.elt); - } else return B.popElement(n), V.remove(n), !0; - } - return !0; - } - function Vt() { - B.pop(), z = Ge; - } - function Ht() { - delete W._parser, B.elements.length = 0, W.defaultView && W.defaultView.dispatchEvent(new c.Event(`load`, {})); - } - function X(e, t) { - k = t, D--; - } - function Z(e) { - switch (e) { - case 38: - A = Z, k = or; - break; - case 60: - if (wt()) break; - k = qt; - break; - case 0: - U.push(e), et = !0; - break; - case -1: - q(); - break; - default: - xt(xe) || U.push(e); - break; - } - } - function Ut(e) { - switch (e) { - case 38: - A = Ut, k = or; - break; - case 60: - k = Xt; - break; - case 0: - U.push(65533), et = !0; - break; - case -1: - q(); - break; - default: - U.push(e); - break; - } - } - function Wt(e) { - switch (e) { - case 60: - k = $t; - break; - case 0: - U.push(65533); - break; - case -1: - q(); - break; - default: - xt(Se) || U.push(e); - break; - } - } - function Gt(e) { - switch (e) { - case 60: - k = nn; - break; - case 0: - U.push(65533); - break; - case -1: - q(); - break; - default: - xt(Se) || U.push(e); - break; - } - } - function Kt(e) { - switch (e) { - case 0: - U.push(65533); - break; - case -1: - q(); - break; - default: - xt(Ce) || U.push(e); - break; - } - } - function qt(e) { - switch (e) { - case 33: - k = An; - break; - case 47: - k = Jt; - break; - case 65: - case 66: - case 67: - case 68: - case 69: - case 70: - case 71: - case 72: - case 73: - case 74: - case 75: - case 76: - case 77: - case 78: - case 79: - case 80: - case 81: - case 82: - case 83: - case 84: - case 85: - case 86: - case 87: - case 88: - case 89: - case 90: - case 97: - case 98: - case 99: - case 100: - case 101: - case 102: - case 103: - case 104: - case 105: - case 106: - case 107: - case 108: - case 109: - case 110: - case 111: - case 112: - case 113: - case 114: - case 115: - case 116: - case 117: - case 118: - case 119: - case 120: - case 121: - case 122: - ct(), X(e, Yt); - break; - case 63: - X(e, kn); - break; - default: - U.push(60), X(e, Z); - break; - } - } - function Jt(e) { - switch (e) { - case 65: - case 66: - case 67: - case 68: - case 69: - case 70: - case 71: - case 72: - case 73: - case 74: - case 75: - case 76: - case 77: - case 78: - case 79: - case 80: - case 81: - case 82: - case 83: - case 84: - case 85: - case 86: - case 87: - case 88: - case 89: - case 90: - case 97: - case 98: - case 99: - case 100: - case 101: - case 102: - case 103: - case 104: - case 105: - case 106: - case 107: - case 108: - case 109: - case 110: - case 111: - case 112: - case 113: - case 114: - case 115: - case 116: - case 117: - case 118: - case 119: - case 120: - case 121: - case 122: - lt(), X(e, Yt); - break; - case 62: - k = Z; - break; - case -1: - U.push(60), U.push(47), q(); - break; - default: - X(e, kn); - break; - } - } - function Yt(e) { - switch (e) { - case 9: - case 10: - case 12: - case 32: - k = bn; - break; - case 47: - k = On; - break; - case 62: - k = Z, Ct(); - break; - case 65: - case 66: - case 67: - case 68: - case 69: - case 70: - case 71: - case 72: - case 73: - case 74: - case 75: - case 76: - case 77: - case 78: - case 79: - case 80: - case 81: - case 82: - case 83: - case 84: - case 85: - case 86: - case 87: - case 88: - case 89: - case 90: - M += String.fromCharCode(e + 32); - break; - case 0: - M += `�`; - break; - case -1: - q(); - break; - default: - M += bt(ve); - break; - } - } - function Xt(e) { - e === 47 ? (ut(), k = Zt) : (U.push(60), X(e, Ut)); - } - function Zt(e) { - switch (e) { - case 65: - case 66: - case 67: - case 68: - case 69: - case 70: - case 71: - case 72: - case 73: - case 74: - case 75: - case 76: - case 77: - case 78: - case 79: - case 80: - case 81: - case 82: - case 83: - case 84: - case 85: - case 86: - case 87: - case 88: - case 89: - case 90: - case 97: - case 98: - case 99: - case 100: - case 101: - case 102: - case 103: - case 104: - case 105: - case 106: - case 107: - case 108: - case 109: - case 110: - case 111: - case 112: - case 113: - case 114: - case 115: - case 116: - case 117: - case 118: - case 119: - case 120: - case 121: - case 122: - lt(), X(e, Qt); - break; - default: - U.push(60), U.push(47), X(e, Ut); - break; - } - } - function Qt(e) { - switch (e) { - case 9: - case 10: - case 12: - case 32: - if (vt(M)) { - k = bn; - return; - } - break; - case 47: - if (vt(M)) { - k = On; - return; - } - break; - case 62: - if (vt(M)) { - k = Z, Ct(); - return; - } - break; - case 65: - case 66: - case 67: - case 68: - case 69: - case 70: - case 71: - case 72: - case 73: - case 74: - case 75: - case 76: - case 77: - case 78: - case 79: - case 80: - case 81: - case 82: - case 83: - case 84: - case 85: - case 86: - case 87: - case 88: - case 89: - case 90: - M += String.fromCharCode(e + 32), N.push(e); - return; - case 97: - case 98: - case 99: - case 100: - case 101: - case 102: - case 103: - case 104: - case 105: - case 106: - case 107: - case 108: - case 109: - case 110: - case 111: - case 112: - case 113: - case 114: - case 115: - case 116: - case 117: - case 118: - case 119: - case 120: - case 121: - case 122: - M += String.fromCharCode(e), N.push(e); - return; - default: break; - } - U.push(60), U.push(47), l(U, N), X(e, Ut); - } - function $t(e) { - e === 47 ? (ut(), k = en) : (U.push(60), X(e, Wt)); - } - function en(e) { - switch (e) { - case 65: - case 66: - case 67: - case 68: - case 69: - case 70: - case 71: - case 72: - case 73: - case 74: - case 75: - case 76: - case 77: - case 78: - case 79: - case 80: - case 81: - case 82: - case 83: - case 84: - case 85: - case 86: - case 87: - case 88: - case 89: - case 90: - case 97: - case 98: - case 99: - case 100: - case 101: - case 102: - case 103: - case 104: - case 105: - case 106: - case 107: - case 108: - case 109: - case 110: - case 111: - case 112: - case 113: - case 114: - case 115: - case 116: - case 117: - case 118: - case 119: - case 120: - case 121: - case 122: - lt(), X(e, tn); - break; - default: - U.push(60), U.push(47), X(e, Wt); - break; - } - } - function tn(e) { - switch (e) { - case 9: - case 10: - case 12: - case 32: - if (vt(M)) { - k = bn; - return; - } - break; - case 47: - if (vt(M)) { - k = On; - return; - } - break; - case 62: - if (vt(M)) { - k = Z, Ct(); - return; - } - break; - case 65: - case 66: - case 67: - case 68: - case 69: - case 70: - case 71: - case 72: - case 73: - case 74: - case 75: - case 76: - case 77: - case 78: - case 79: - case 80: - case 81: - case 82: - case 83: - case 84: - case 85: - case 86: - case 87: - case 88: - case 89: - case 90: - M += String.fromCharCode(e + 32), N.push(e); - return; - case 97: - case 98: - case 99: - case 100: - case 101: - case 102: - case 103: - case 104: - case 105: - case 106: - case 107: - case 108: - case 109: - case 110: - case 111: - case 112: - case 113: - case 114: - case 115: - case 116: - case 117: - case 118: - case 119: - case 120: - case 121: - case 122: - M += String.fromCharCode(e), N.push(e); - return; - default: break; - } - U.push(60), U.push(47), l(U, N), X(e, Wt); - } - function nn(e) { - switch (e) { - case 47: - ut(), k = rn; - break; - case 33: - k = on, U.push(60), U.push(33); - break; - default: - U.push(60), X(e, Gt); - break; - } - } - function rn(e) { - switch (e) { - case 65: - case 66: - case 67: - case 68: - case 69: - case 70: - case 71: - case 72: - case 73: - case 74: - case 75: - case 76: - case 77: - case 78: - case 79: - case 80: - case 81: - case 82: - case 83: - case 84: - case 85: - case 86: - case 87: - case 88: - case 89: - case 90: - case 97: - case 98: - case 99: - case 100: - case 101: - case 102: - case 103: - case 104: - case 105: - case 106: - case 107: - case 108: - case 109: - case 110: - case 111: - case 112: - case 113: - case 114: - case 115: - case 116: - case 117: - case 118: - case 119: - case 120: - case 121: - case 122: - lt(), X(e, an); - break; - default: - U.push(60), U.push(47), X(e, Gt); - break; - } - } - function an(e) { - switch (e) { - case 9: - case 10: - case 12: - case 32: - if (vt(M)) { - k = bn; - return; - } - break; - case 47: - if (vt(M)) { - k = On; - return; - } - break; - case 62: - if (vt(M)) { - k = Z, Ct(); - return; - } - break; - case 65: - case 66: - case 67: - case 68: - case 69: - case 70: - case 71: - case 72: - case 73: - case 74: - case 75: - case 76: - case 77: - case 78: - case 79: - case 80: - case 81: - case 82: - case 83: - case 84: - case 85: - case 86: - case 87: - case 88: - case 89: - case 90: - M += String.fromCharCode(e + 32), N.push(e); - return; - case 97: - case 98: - case 99: - case 100: - case 101: - case 102: - case 103: - case 104: - case 105: - case 106: - case 107: - case 108: - case 109: - case 110: - case 111: - case 112: - case 113: - case 114: - case 115: - case 116: - case 117: - case 118: - case 119: - case 120: - case 121: - case 122: - M += String.fromCharCode(e), N.push(e); - return; - default: break; - } - U.push(60), U.push(47), l(U, N), X(e, Gt); - } - function on(e) { - e === 45 ? (k = sn, U.push(45)) : X(e, Gt); - } - function sn(e) { - e === 45 ? (k = un, U.push(45)) : X(e, Gt); - } - function cn(e) { - switch (e) { - case 45: - k = ln, U.push(45); - break; - case 60: - k = dn; - break; - case 0: - U.push(65533); - break; - case -1: - q(); - break; - default: - U.push(e); - break; - } - } - function ln(e) { - switch (e) { - case 45: - k = un, U.push(45); - break; - case 60: - k = dn; - break; - case 0: - k = cn, U.push(65533); - break; - case -1: - q(); - break; - default: - k = cn, U.push(e); - break; - } - } - function un(e) { - switch (e) { - case 45: - U.push(45); - break; - case 60: - k = dn; - break; - case 62: - k = Gt, U.push(62); - break; - case 0: - k = cn, U.push(65533); - break; - case -1: - q(); - break; - default: - k = cn, U.push(e); - break; - } - } - function dn(e) { - switch (e) { - case 47: - ut(), k = fn; - break; - case 65: - case 66: - case 67: - case 68: - case 69: - case 70: - case 71: - case 72: - case 73: - case 74: - case 75: - case 76: - case 77: - case 78: - case 79: - case 80: - case 81: - case 82: - case 83: - case 84: - case 85: - case 86: - case 87: - case 88: - case 89: - case 90: - case 97: - case 98: - case 99: - case 100: - case 101: - case 102: - case 103: - case 104: - case 105: - case 106: - case 107: - case 108: - case 109: - case 110: - case 111: - case 112: - case 113: - case 114: - case 115: - case 116: - case 117: - case 118: - case 119: - case 120: - case 121: - case 122: - ut(), U.push(60), X(e, mn); - break; - default: - U.push(60), X(e, cn); - break; - } - } - function fn(e) { - switch (e) { - case 65: - case 66: - case 67: - case 68: - case 69: - case 70: - case 71: - case 72: - case 73: - case 74: - case 75: - case 76: - case 77: - case 78: - case 79: - case 80: - case 81: - case 82: - case 83: - case 84: - case 85: - case 86: - case 87: - case 88: - case 89: - case 90: - case 97: - case 98: - case 99: - case 100: - case 101: - case 102: - case 103: - case 104: - case 105: - case 106: - case 107: - case 108: - case 109: - case 110: - case 111: - case 112: - case 113: - case 114: - case 115: - case 116: - case 117: - case 118: - case 119: - case 120: - case 121: - case 122: - lt(), X(e, pn); - break; - default: - U.push(60), U.push(47), X(e, cn); - break; - } - } - function pn(e) { - switch (e) { - case 9: - case 10: - case 12: - case 32: - if (vt(M)) { - k = bn; - return; - } - break; - case 47: - if (vt(M)) { - k = On; - return; - } - break; - case 62: - if (vt(M)) { - k = Z, Ct(); - return; - } - break; - case 65: - case 66: - case 67: - case 68: - case 69: - case 70: - case 71: - case 72: - case 73: - case 74: - case 75: - case 76: - case 77: - case 78: - case 79: - case 80: - case 81: - case 82: - case 83: - case 84: - case 85: - case 86: - case 87: - case 88: - case 89: - case 90: - M += String.fromCharCode(e + 32), N.push(e); - return; - case 97: - case 98: - case 99: - case 100: - case 101: - case 102: - case 103: - case 104: - case 105: - case 106: - case 107: - case 108: - case 109: - case 110: - case 111: - case 112: - case 113: - case 114: - case 115: - case 116: - case 117: - case 118: - case 119: - case 120: - case 121: - case 122: - M += String.fromCharCode(e), N.push(e); - return; - default: break; - } - U.push(60), U.push(47), l(U, N), X(e, cn); - } - function mn(e) { - switch (e) { - case 9: - case 10: - case 12: - case 32: - case 47: - case 62: - k = P(N) === `script` ? hn : cn, U.push(e); - break; - case 65: - case 66: - case 67: - case 68: - case 69: - case 70: - case 71: - case 72: - case 73: - case 74: - case 75: - case 76: - case 77: - case 78: - case 79: - case 80: - case 81: - case 82: - case 83: - case 84: - case 85: - case 86: - case 87: - case 88: - case 89: - case 90: - N.push(e + 32), U.push(e); - break; - case 97: - case 98: - case 99: - case 100: - case 101: - case 102: - case 103: - case 104: - case 105: - case 106: - case 107: - case 108: - case 109: - case 110: - case 111: - case 112: - case 113: - case 114: - case 115: - case 116: - case 117: - case 118: - case 119: - case 120: - case 121: - case 122: - N.push(e), U.push(e); - break; - default: - X(e, cn); - break; - } - } - function hn(e) { - switch (e) { - case 45: - k = gn, U.push(45); - break; - case 60: - k = vn, U.push(60); - break; - case 0: - U.push(65533); - break; - case -1: - q(); - break; - default: - U.push(e); - break; - } - } - function gn(e) { - switch (e) { - case 45: - k = _n, U.push(45); - break; - case 60: - k = vn, U.push(60); - break; - case 0: - k = hn, U.push(65533); - break; - case -1: - q(); - break; - default: - k = hn, U.push(e); - break; - } - } - function _n(e) { - switch (e) { - case 45: - U.push(45); - break; - case 60: - k = vn, U.push(60); - break; - case 62: - k = Gt, U.push(62); - break; - case 0: - k = hn, U.push(65533); - break; - case -1: - q(); - break; - default: - k = hn, U.push(e); - break; - } - } - function vn(e) { - e === 47 ? (ut(), k = yn, U.push(47)) : X(e, hn); - } - function yn(e) { - switch (e) { - case 9: - case 10: - case 12: - case 32: - case 47: - case 62: - k = P(N) === `script` ? cn : hn, U.push(e); - break; - case 65: - case 66: - case 67: - case 68: - case 69: - case 70: - case 71: - case 72: - case 73: - case 74: - case 75: - case 76: - case 77: - case 78: - case 79: - case 80: - case 81: - case 82: - case 83: - case 84: - case 85: - case 86: - case 87: - case 88: - case 89: - case 90: - N.push(e + 32), U.push(e); - break; - case 97: - case 98: - case 99: - case 100: - case 101: - case 102: - case 103: - case 104: - case 105: - case 106: - case 107: - case 108: - case 109: - case 110: - case 111: - case 112: - case 113: - case 114: - case 115: - case 116: - case 117: - case 118: - case 119: - case 120: - case 121: - case 122: - N.push(e), U.push(e); - break; - default: - X(e, hn); - break; - } - } - function bn(e) { - switch (e) { - case 9: - case 10: - case 12: - case 32: break; - case 47: - k = On; - break; - case 62: - k = Z, Ct(); - break; - case -1: - q(); - break; - case 61: - dt(), Re += String.fromCharCode(e), k = xn; - break; - default: - if (st()) break; - dt(), X(e, xn); - break; - } - } - function xn(e) { - switch (e) { - case 9: - case 10: - case 12: - case 32: - case 47: - case 62: - case -1: - X(e, Sn); - break; - case 61: - k = Cn; - break; - case 65: - case 66: - case 67: - case 68: - case 69: - case 70: - case 71: - case 72: - case 73: - case 74: - case 75: - case 76: - case 77: - case 78: - case 79: - case 80: - case 81: - case 82: - case 83: - case 84: - case 85: - case 86: - case 87: - case 88: - case 89: - case 90: - Re += String.fromCharCode(e + 32); - break; - case 0: - Re += `�`; - break; - default: - Re += bt(ye); - break; - } - } - function Sn(e) { - switch (e) { - case 9: - case 10: - case 12: - case 32: break; - case 47: - ot(Re), k = On; - break; - case 61: - k = Cn; - break; - case 62: - k = Z, ot(Re), Ct(); - break; - case -1: - ot(Re), q(); - break; - default: - ot(Re), dt(), X(e, xn); - break; - } - } - function Cn(e) { - switch (e) { - case 9: - case 10: - case 12: - case 32: break; - case 34: - ft(), k = wn; - break; - case 39: - ft(), k = Tn; - break; - default: - ft(), X(e, En); - break; - } - } - function wn(e) { - switch (e) { - case 34: - ot(Re, ze), k = Dn; - break; - case 38: - A = wn, k = or; - break; - case 0: - ze += `�`; - break; - case -1: - q(); - break; - case 10: - ze += String.fromCharCode(e); - break; - default: - ze += bt(he); - break; - } - } - function Tn(e) { - switch (e) { - case 39: - ot(Re, ze), k = Dn; - break; - case 38: - A = Tn, k = or; - break; - case 0: - ze += `�`; - break; - case -1: - q(); - break; - case 10: - ze += String.fromCharCode(e); - break; - default: - ze += bt(ge); - break; - } - } - function En(e) { - switch (e) { - case 9: - case 10: - case 12: - case 32: - ot(Re, ze), k = bn; - break; - case 38: - A = En, k = or; - break; - case 62: - ot(Re, ze), k = Z, Ct(); - break; - case 0: - ze += `�`; - break; - case -1: - D--, k = Z; - break; - default: - ze += bt(_e); - break; - } - } - function Dn(e) { - switch (e) { - case 9: - case 10: - case 12: - case 32: - k = bn; - break; - case 47: - k = On; - break; - case 62: - k = Z, Ct(); - break; - case -1: - q(); - break; - default: - X(e, bn); - break; - } - } - function On(e) { - switch (e) { - case 62: - k = Z, Tt(!0); - break; - case -1: - q(); - break; - default: - X(e, bn); - break; - } - } - function kn(e, t, n) { - var r = t.length; - n ? D += r - 1 : D += r; - var i = t.substring(0, r - 1); - i = i.replace(/\u0000/g, `�`), i = i.replace(/\u000D\u000A/g, ` -`), i = i.replace(/\u000D/g, ` -`), J(h, i), k = Z; - } - kn.lookahead = `>`; - function An(e, t, n) { - if (t[0] === `-` && t[1] === `-`) { - D += 2, pt(), k = jn; - return; - } - t.toUpperCase() === `DOCTYPE` ? (D += 7, k = Vn) : t === `[CDATA[` && _t() ? (D += 7, k = rr) : k = kn; - } - An.lookahead = 7; - function jn(e) { - switch (pt(), e) { - case 45: - k = Mn; - break; - case 62: - k = Z, J(h, P(R)); - break; - default: - X(e, Nn); - break; - } - } - function Mn(e) { - switch (e) { - case 45: - k = zn; - break; - case 62: - k = Z, J(h, P(R)); - break; - case -1: - J(h, P(R)), q(); - break; - default: - R.push(45), X(e, Nn); - break; - } - } - function Nn(e) { - switch (e) { - case 60: - R.push(e), k = Pn; - break; - case 45: - k = Rn; - break; - case 0: - R.push(65533); - break; - case -1: - J(h, P(R)), q(); - break; - default: - R.push(e); - break; - } - } - function Pn(e) { - switch (e) { - case 33: - R.push(e), k = Fn; - break; - case 60: - R.push(e); - break; - default: - X(e, Nn); - break; - } - } - function Fn(e) { - switch (e) { - case 45: - k = In; - break; - default: - X(e, Nn); - break; - } - } - function In(e) { - switch (e) { - case 45: - k = Ln; - break; - default: - X(e, Rn); - break; - } - } - function Ln(e) { - switch (e) { - case 62: - case -1: - X(e, zn); - break; - default: - X(e, zn); - break; - } - } - function Rn(e) { - switch (e) { - case 45: - k = zn; - break; - case -1: - J(h, P(R)), q(); - break; - default: - R.push(45), X(e, Nn); - break; - } - } - function zn(e) { - switch (e) { - case 62: - k = Z, J(h, P(R)); - break; - case 33: - k = Bn; - break; - case 45: - R.push(45); - break; - case -1: - J(h, P(R)), q(); - break; - default: - R.push(45), R.push(45), X(e, Nn); - break; - } - } - function Bn(e) { - switch (e) { - case 45: - R.push(45), R.push(45), R.push(33), k = Rn; - break; - case 62: - k = Z, J(h, P(R)); - break; - case -1: - J(h, P(R)), q(); - break; - default: - R.push(45), R.push(45), R.push(33), X(e, Nn); - break; - } - } - function Vn(e) { - switch (e) { - case 9: - case 10: - case 12: - case 32: - k = Hn; - break; - case -1: - mt(), G(), K(), q(); - break; - default: - X(e, Hn); - break; - } - } - function Hn(e) { - switch (e) { - case 9: - case 10: - case 12: - case 32: break; - case 65: - case 66: - case 67: - case 68: - case 69: - case 70: - case 71: - case 72: - case 73: - case 74: - case 75: - case 76: - case 77: - case 78: - case 79: - case 80: - case 81: - case 82: - case 83: - case 84: - case 85: - case 86: - case 87: - case 88: - case 89: - case 90: - mt(), Be.push(e + 32), k = Un; - break; - case 0: - mt(), Be.push(65533), k = Un; - break; - case 62: - mt(), G(), k = Z, K(); - break; - case -1: - mt(), G(), K(), q(); - break; - default: - mt(), Be.push(e), k = Un; - break; - } - } - function Un(e) { - switch (e) { - case 9: - case 10: - case 12: - case 32: - k = Wn; - break; - case 62: - k = Z, K(); - break; - case 65: - case 66: - case 67: - case 68: - case 69: - case 70: - case 71: - case 72: - case 73: - case 74: - case 75: - case 76: - case 77: - case 78: - case 79: - case 80: - case 81: - case 82: - case 83: - case 84: - case 85: - case 86: - case 87: - case 88: - case 89: - case 90: - Be.push(e + 32); - break; - case 0: - Be.push(65533); - break; - case -1: - G(), K(), q(); - break; - default: - Be.push(e); - break; - } - } - function Wn(e, t, n) { - switch (e) { - case 9: - case 10: - case 12: - case 32: - D += 1; - break; - case 62: - k = Z, D += 1, K(); - break; - case -1: - G(), K(), q(); - break; - default: - t = t.toUpperCase(), t === `PUBLIC` ? (D += 6, k = Gn) : t === `SYSTEM` ? (D += 6, k = Zn) : (G(), k = nr); - break; - } - } - Wn.lookahead = 6; - function Gn(e) { - switch (e) { - case 9: - case 10: - case 12: - case 32: - k = Kn; - break; - case 34: - ht(), k = qn; - break; - case 39: - ht(), k = Jn; - break; - case 62: - G(), k = Z, K(); - break; - case -1: - G(), K(), q(); - break; - default: - G(), k = nr; - break; - } - } - function Kn(e) { - switch (e) { - case 9: - case 10: - case 12: - case 32: break; - case 34: - ht(), k = qn; - break; - case 39: - ht(), k = Jn; - break; - case 62: - G(), k = Z, K(); - break; - case -1: - G(), K(), q(); - break; - default: - G(), k = nr; - break; - } - } - function qn(e) { - switch (e) { - case 34: - k = Yn; - break; - case 0: - Ve.push(65533); - break; - case 62: - G(), k = Z, K(); - break; - case -1: - G(), K(), q(); - break; - default: - Ve.push(e); - break; - } - } - function Jn(e) { - switch (e) { - case 39: - k = Yn; - break; - case 0: - Ve.push(65533); - break; - case 62: - G(), k = Z, K(); - break; - case -1: - G(), K(), q(); - break; - default: - Ve.push(e); - break; - } - } - function Yn(e) { - switch (e) { - case 9: - case 10: - case 12: - case 32: - k = Xn; - break; - case 62: - k = Z, K(); - break; - case 34: - gt(), k = $n; - break; - case 39: - gt(), k = er; - break; - case -1: - G(), K(), q(); - break; - default: - G(), k = nr; - break; - } - } - function Xn(e) { - switch (e) { - case 9: - case 10: - case 12: - case 32: break; - case 62: - k = Z, K(); - break; - case 34: - gt(), k = $n; - break; - case 39: - gt(), k = er; - break; - case -1: - G(), K(), q(); - break; - default: - G(), k = nr; - break; - } - } - function Zn(e) { - switch (e) { - case 9: - case 10: - case 12: - case 32: - k = Qn; - break; - case 34: - gt(), k = $n; - break; - case 39: - gt(), k = er; - break; - case 62: - G(), k = Z, K(); - break; - case -1: - G(), K(), q(); - break; - default: - G(), k = nr; - break; - } - } - function Qn(e) { - switch (e) { - case 9: - case 10: - case 12: - case 32: break; - case 34: - gt(), k = $n; - break; - case 39: - gt(), k = er; - break; - case 62: - G(), k = Z, K(); - break; - case -1: - G(), K(), q(); - break; - default: - G(), k = nr; - break; - } - } - function $n(e) { - switch (e) { - case 34: - k = tr; - break; - case 0: - He.push(65533); - break; - case 62: - G(), k = Z, K(); - break; - case -1: - G(), K(), q(); - break; - default: - He.push(e); - break; - } - } - function er(e) { - switch (e) { - case 39: - k = tr; - break; - case 0: - He.push(65533); - break; - case 62: - G(), k = Z, K(); - break; - case -1: - G(), K(), q(); - break; - default: - He.push(e); - break; - } - } - function tr(e) { - switch (e) { - case 9: - case 10: - case 12: - case 32: break; - case 62: - k = Z, K(); - break; - case -1: - G(), K(), q(); - break; - default: - k = nr; - break; - } - } - function nr(e) { - switch (e) { - case 62: - k = Z, K(); - break; - case -1: - K(), q(); - break; - default: break; - } - } - function rr(e) { - switch (e) { - case 93: - k = ir; - break; - case -1: - q(); - break; - case 0: et = !0; - default: - xt(be) || U.push(e); - break; - } - } - function ir(e) { - switch (e) { - case 93: - k = ar; - break; - default: - U.push(93), X(e, rr); - break; - } - } - function ar(e) { - switch (e) { - case 93: - U.push(93); - break; - case 62: - yt(), k = Z; - break; - default: - U.push(93), U.push(93), X(e, rr); - break; - } - } - function or(e) { - switch (ut(), N.push(38), e) { - case 9: - case 10: - case 12: - case 32: - case 60: - case 38: - case -1: - X(e, mr); - break; - case 35: - N.push(e), k = cr; - break; - default: - X(e, sr); - break; - } - } - function sr(e) { - pe.lastIndex = D; - var t = pe.exec(u); - if (!t) throw Error(`should never happen`); - var n = t[1]; - if (!n) { - k = mr; - return; - } - switch (D += n.length, l(N, je(n)), A) { - case wn: - case Tn: - case En: - if (n[n.length - 1] !== `;` && /[=A-Za-z0-9]/.test(u[D])) { - k = mr; - return; - } - break; - default: break; - } - ut(); - var r = fe[n]; - typeof r == `number` ? N.push(r) : l(N, r), k = mr; - } - sr.lookahead = -me; - function cr(e) { - switch (j = 0, e) { - case 120: - case 88: - N.push(e), k = lr; - break; - default: - X(e, ur); - break; - } - } - function lr(e) { - switch (e) { - case 48: - case 49: - case 50: - case 51: - case 52: - case 53: - case 54: - case 55: - case 56: - case 57: - case 65: - case 66: - case 67: - case 68: - case 69: - case 70: - case 97: - case 98: - case 99: - case 100: - case 101: - case 102: - X(e, dr); - break; - default: - X(e, mr); - break; - } - } - function ur(e) { - switch (e) { - case 48: - case 49: - case 50: - case 51: - case 52: - case 53: - case 54: - case 55: - case 56: - case 57: - X(e, fr); - break; - default: - X(e, mr); - break; - } - } - function dr(e) { - switch (e) { - case 65: - case 66: - case 67: - case 68: - case 69: - case 70: - j *= 16, j += e - 55; - break; - case 97: - case 98: - case 99: - case 100: - case 101: - case 102: - j *= 16, j += e - 87; - break; - case 48: - case 49: - case 50: - case 51: - case 52: - case 53: - case 54: - case 55: - case 56: - case 57: - j *= 16, j += e - 48; - break; - case 59: - k = pr; - break; - default: - X(e, pr); - break; - } - } - function fr(e) { - switch (e) { - case 48: - case 49: - case 50: - case 51: - case 52: - case 53: - case 54: - case 55: - case 56: - case 57: - j *= 10, j += e - 48; - break; - case 59: - k = pr; - break; - default: - X(e, pr); - break; - } - } - function pr(e) { - j in ue ? j = ue[j] : (j > 1114111 || j >= 55296 && j < 57344) && (j = 65533), ut(), j <= 65535 ? N.push(j) : (j -= 65536, N.push(55296 + (j >> 10)), N.push(56320 + (j & 1023))), X(e, mr); - } - function mr(e) { - switch (A) { - case wn: - case Tn: - case En: - ze += P(N); - break; - default: - l(U, N); - break; - } - X(e, A); - } - function hr(e, t, n, i) { - switch (e) { - case 1: - if (t = t.replace(ke, ``), t.length === 0) return; - break; - case 4: - W._appendChild(W.createComment(t)); - return; - case 5: - var a = t, o = n, s = i; - W.appendChild(new r(W, a, o, s)), Ze || a.toLowerCase() !== `html` || v.test(o) || s && s.toLowerCase() === y || s === void 0 && b.test(o) ? W._quirks = !0 : (x.test(o) || s !== void 0 && b.test(o)) && (W._limitedQuirks = !0), z = gr; - return; - } - W._quirks = !0, z = gr, z(e, t, n, i); - } - function gr(e, t, n, r) { - var i; - switch (e) { - case 1: - if (t = t.replace(ke, ``), t.length === 0) return; - break; - case 5: return; - case 4: - W._appendChild(W.createComment(t)); - return; - case 2: - if (t === `html`) { - i = Ot(W, t, n), B.push(i), W.appendChild(i), z = _r; - return; - } - break; - case 3: switch (t) { - case `html`: - case `head`: - case `body`: - case `br`: break; - default: return; - } - } - i = Ot(W, `html`, null), B.push(i), W.appendChild(i), z = _r, z(e, t, n, r); - } - function _r(e, t, n, r) { - switch (e) { - case 1: - if (t = t.replace(ke, ``), t.length === 0) return; - break; - case 5: return; - case 4: - Et(t); - return; - case 2: - switch (t) { - case `html`: - $(e, t, n, r); - return; - case `head`: - Je = Y(t, n), z = Q; - return; - } - break; - case 3: switch (t) { - case `html`: - case `head`: - case `body`: - case `br`: break; - default: return; - } - } - _r(p, `head`, null), z(e, t, n, r); - } - function Q(e, t, n, r) { - switch (e) { - case 1: - var i = t.match(ke); - if (i && (Dt(i[0]), t = t.substring(i[0].length)), t.length === 0) return; - break; - case 4: - Et(t); - return; - case 5: return; - case 2: - switch (t) { - case `html`: - $(e, t, n, r); - return; - case `meta`: - case `base`: - case `basefont`: - case `bgsound`: - case `link`: - Y(t, n), B.pop(); - return; - case `title`: - It(t, n); - return; - case `noscript`: if (!Xe) { - Y(t, n), z = vr; - return; - } - case `noframes`: - case `style`: - Ft(t, n); - return; - case `script`: - At(function(e) { - var r = Ot(e, t, n); - return r._parser_inserted = !0, r._force_async = !1, qe && (r._already_started = !0), yt(), r; - }), k = Gt, Ge = z, z = br; - return; - case `template`: - Y(t, n), V.insertMarker(), H = !1, z = Ar, Ke.push(z); - return; - case `head`: return; - } - break; - case 3: - switch (t) { - case `head`: - B.pop(), z = yr; - return; - case `body`: - case `html`: - case `br`: break; - case `template`: - if (!B.contains(`template`)) return; - B.generateImpliedEndTags(null, `thorough`), B.popTag(`template`), V.clearToMarker(), Ke.pop(), Pt(); - return; - default: return; - } - break; - } - Q(m, `head`, null), z(e, t, n, r); - } - function vr(e, t, n, r) { - switch (e) { - case 5: return; - case 4: - Q(e, t); - return; - case 1: - var i = t.match(ke); - if (i && (Q(e, i[0]), t = t.substring(i[0].length)), t.length === 0) return; - break; - case 2: - switch (t) { - case `html`: - $(e, t, n, r); - return; - case `basefont`: - case `bgsound`: - case `link`: - case `meta`: - case `noframes`: - case `style`: - Q(e, t, n); - return; - case `head`: - case `noscript`: return; - } - break; - case 3: - switch (t) { - case `noscript`: - B.pop(), z = Q; - return; - case `br`: break; - default: return; - } - break; - } - vr(m, `noscript`, null), z(e, t, n, r); - } - function yr(e, t, n, r) { - switch (e) { - case 1: - var i = t.match(ke); - if (i && (Dt(i[0]), t = t.substring(i[0].length)), t.length === 0) return; - break; - case 4: - Et(t); - return; - case 5: return; - case 2: - switch (t) { - case `html`: - $(e, t, n, r); - return; - case `body`: - Y(t, n), H = !1, z = $; - return; - case `frameset`: - Y(t, n), z = Mr; - return; - case `base`: - case `basefont`: - case `bgsound`: - case `link`: - case `meta`: - case `noframes`: - case `script`: - case `style`: - case `template`: - case `title`: - B.push(Je), Q(p, t, n), B.removeElement(Je); - return; - case `head`: return; - } - break; - case 3: - switch (t) { - case `template`: return Q(e, t, n, r); - case `body`: - case `html`: - case `br`: break; - default: return; - } - break; - } - yr(p, `body`, null), H = !0, z(e, t, n, r); - } - function $(e, t, n, r) { - var i, o, s, l; - switch (e) { - case 1: - if (et && (t = t.replace(Ae, ``), t.length === 0)) return; - H && Ee.test(t) && (H = !1), Rt(), Dt(t); - return; - case 5: return; - case 4: - Et(t); - return; - case -1: - if (Ke.length) return Ar(e); - Ht(); - return; - case 2: - switch (t) { - case `html`: - if (B.contains(`template`)) return; - Le(n, B.elements[0]); - return; - case `base`: - case `basefont`: - case `bgsound`: - case `link`: - case `meta`: - case `noframes`: - case `script`: - case `style`: - case `template`: - case `title`: - Q(p, t, n); - return; - case `body`: - if (i = B.elements[1], !i || !(i instanceof c.HTMLBodyElement) || B.contains(`template`)) return; - H = !1, Le(n, i); - return; - case `frameset`: - if (!H || (i = B.elements[1], !i || !(i instanceof c.HTMLBodyElement))) return; - for (i.parentNode && i.parentNode.removeChild(i); !(B.top instanceof c.HTMLHtmlElement);) B.pop(); - Y(t, n), z = Mr; - return; - case `address`: - case `article`: - case `aside`: - case `blockquote`: - case `center`: - case `details`: - case `dialog`: - case `dir`: - case `div`: - case `dl`: - case `fieldset`: - case `figcaption`: - case `figure`: - case `footer`: - case `header`: - case `hgroup`: - case `main`: - case `nav`: - case `ol`: - case `p`: - case `section`: - case `summary`: - case `ul`: - B.inButtonScope(`p`) && $(m, `p`), Y(t, n); - return; - case `menu`: - B.inButtonScope(`p`) && $(m, `p`), F(B.top, `menuitem`) && B.pop(), Y(t, n); - return; - case `h1`: - case `h2`: - case `h3`: - case `h4`: - case `h5`: - case `h6`: - B.inButtonScope(`p`) && $(m, `p`), B.top instanceof c.HTMLHeadingElement && B.pop(), Y(t, n); - return; - case `pre`: - case `listing`: - B.inButtonScope(`p`) && $(m, `p`), Y(t, n), tt = !0, H = !1; - return; - case `form`: - if (Ye && !B.contains(`template`)) return; - B.inButtonScope(`p`) && $(m, `p`), l = Y(t, n), B.contains(`template`) || (Ye = l); - return; - case `li`: - for (H = !1, o = B.elements.length - 1; o >= 0; o--) { - if (s = B.elements[o], s instanceof c.HTMLLIElement) { - $(m, `li`); - break; - } - if (F(s, S) && !F(s, C)) break; - } - B.inButtonScope(`p`) && $(m, `p`), Y(t, n); - return; - case `dd`: - case `dt`: - for (H = !1, o = B.elements.length - 1; o >= 0; o--) { - if (s = B.elements[o], F(s, w)) { - $(m, s.localName); - break; - } - if (F(s, S) && !F(s, C)) break; - } - B.inButtonScope(`p`) && $(m, `p`), Y(t, n); - return; - case `plaintext`: - B.inButtonScope(`p`) && $(m, `p`), Y(t, n), k = Kt; - return; - case `button`: - B.inScope(`button`) ? ($(m, `button`), z(e, t, n, r)) : (Rt(), Y(t, n), H = !1); - return; - case `a`: - var u = V.findElementByTag(`a`); - u && ($(m, t), V.remove(u), B.removeElement(u)); - case `b`: - case `big`: - case `code`: - case `em`: - case `font`: - case `i`: - case `s`: - case `small`: - case `strike`: - case `strong`: - case `tt`: - case `u`: - Rt(), V.push(Y(t, n), n); - return; - case `nobr`: - Rt(), B.inScope(t) && ($(m, t), Rt()), V.push(Y(t, n), n); - return; - case `applet`: - case `marquee`: - case `object`: - Rt(), Y(t, n), V.insertMarker(), H = !1; - return; - case `table`: - !W._quirks && B.inButtonScope(`p`) && $(m, `p`), Y(t, n), H = !1, z = xr; - return; - case `area`: - case `br`: - case `embed`: - case `img`: - case `keygen`: - case `wbr`: - Rt(), Y(t, n), B.pop(), H = !1; - return; - case `input`: - Rt(), l = Y(t, n), B.pop(); - var d = l.getAttribute(`type`); - (!d || d.toLowerCase() !== `hidden`) && (H = !1); - return; - case `param`: - case `source`: - case `track`: - Y(t, n), B.pop(); - return; - case `hr`: - B.inButtonScope(`p`) && $(m, `p`), F(B.top, `menuitem`) && B.pop(), Y(t, n), B.pop(), H = !1; - return; - case `image`: - $(p, `img`, n, r); - return; - case `textarea`: - Y(t, n), tt = !0, H = !1, k = Ut, Ge = z, z = br; - return; - case `xmp`: - B.inButtonScope(`p`) && $(m, `p`), Rt(), H = !1, Ft(t, n); - return; - case `iframe`: - H = !1, Ft(t, n); - return; - case `noembed`: - Ft(t, n); - return; - case `select`: - Rt(), Y(t, n), H = !1, z = z === xr || z === Cr || z === Tr || z === Er || z === Dr ? kr : Or; - return; - case `optgroup`: - case `option`: - B.top instanceof c.HTMLOptionElement && $(m, `option`), Rt(), Y(t, n); - return; - case `menuitem`: - F(B.top, `menuitem`) && B.pop(), Rt(), Y(t, n); - return; - case `rb`: - case `rtc`: - B.inScope(`ruby`) && B.generateImpliedEndTags(), Y(t, n); - return; - case `rp`: - case `rt`: - B.inScope(`ruby`) && B.generateImpliedEndTags(`rtc`), Y(t, n); - return; - case `math`: - Rt(), Fe(n), Ie(n), jt(t, n, a.MATHML), r && B.pop(); - return; - case `svg`: - Rt(), I(n), Ie(n), jt(t, n, a.SVG), r && B.pop(); - return; - case `caption`: - case `col`: - case `colgroup`: - case `frame`: - case `head`: - case `tbody`: - case `td`: - case `tfoot`: - case `th`: - case `thead`: - case `tr`: return; - } - Rt(), Y(t, n); - return; - case 3: - switch (t) { - case `template`: - Q(m, t, n); - return; - case `body`: - if (!B.inScope(`body`)) return; - z = jr; - return; - case `html`: - if (!B.inScope(`body`)) return; - z = jr, z(e, t, n); - return; - case `address`: - case `article`: - case `aside`: - case `blockquote`: - case `button`: - case `center`: - case `details`: - case `dialog`: - case `dir`: - case `div`: - case `dl`: - case `fieldset`: - case `figcaption`: - case `figure`: - case `footer`: - case `header`: - case `hgroup`: - case `listing`: - case `main`: - case `menu`: - case `nav`: - case `ol`: - case `pre`: - case `section`: - case `summary`: - case `ul`: - if (!B.inScope(t)) return; - B.generateImpliedEndTags(), B.popTag(t); - return; - case `form`: - if (B.contains(`template`)) { - if (!B.inScope(`form`)) return; - B.generateImpliedEndTags(), B.popTag(`form`); - } else { - var f = Ye; - if (Ye = null, !f || !B.elementInScope(f)) return; - B.generateImpliedEndTags(), B.removeElement(f); - } - return; - case `p`: - B.inButtonScope(t) ? (B.generateImpliedEndTags(t), B.popTag(t)) : ($(p, t, null), z(e, t, n, r)); - return; - case `li`: - if (!B.inListItemScope(t)) return; - B.generateImpliedEndTags(t), B.popTag(t); - return; - case `dd`: - case `dt`: - if (!B.inScope(t)) return; - B.generateImpliedEndTags(t), B.popTag(t); - return; - case `h1`: - case `h2`: - case `h3`: - case `h4`: - case `h5`: - case `h6`: - if (!B.elementTypeInScope(c.HTMLHeadingElement)) return; - B.generateImpliedEndTags(), B.popElementType(c.HTMLHeadingElement); - return; - case `sarcasm`: break; - case `a`: - case `b`: - case `big`: - case `code`: - case `em`: - case `font`: - case `i`: - case `nobr`: - case `s`: - case `small`: - case `strike`: - case `strong`: - case `tt`: - case `u`: - if (Bt(t)) return; - break; - case `applet`: - case `marquee`: - case `object`: - if (!B.inScope(t)) return; - B.generateImpliedEndTags(), B.popTag(t), V.clearToMarker(); - return; - case `br`: - $(p, t, null); - return; - } - for (o = B.elements.length - 1; o >= 0; o--) if (s = B.elements[o], F(s, t)) { - B.generateImpliedEndTags(t), B.popElement(s); - break; - } else if (F(s, S)) return; - return; - } - } - function br(e, t, n, r) { - switch (e) { - case 1: - Dt(t); - return; - case -1: - B.top instanceof c.HTMLScriptElement && (B.top._already_started = !0), B.pop(), z = Ge, z(e); - return; - case 3: - t === `script` ? Vt() : (B.pop(), z = Ge); - return; - default: return; - } - } - function xr(e, t, n, r) { - function i(e) { - for (var t = 0, n = e.length; t < n; t++) if (e[t][0] === `type`) return e[t][1].toLowerCase(); - return null; - } - switch (e) { - case 1: - if ($e) { - $(e, t, n, r); - return; - } else if (F(B.top, T)) { - Qe = [], Ge = z, z = Sr, z(e, t, n, r); - return; - } - break; - case 4: - Et(t); - return; - case 5: return; - case 2: - switch (t) { - case `caption`: - B.clearToContext(ee), V.insertMarker(), Y(t, n), z = Cr; - return; - case `colgroup`: - B.clearToContext(ee), Y(t, n), z = wr; - return; - case `col`: - xr(p, `colgroup`, null), z(e, t, n, r); - return; - case `tbody`: - case `tfoot`: - case `thead`: - B.clearToContext(ee), Y(t, n), z = Tr; - return; - case `td`: - case `th`: - case `tr`: - xr(p, `tbody`, null), z(e, t, n, r); - return; - case `table`: - if (!B.inTableScope(t)) return; - xr(m, t), z(e, t, n, r); - return; - case `style`: - case `script`: - case `template`: - Q(e, t, n, r); - return; - case `input`: - if (i(n) !== `hidden`) break; - Y(t, n), B.pop(); - return; - case `form`: - if (Ye || B.contains(`template`)) return; - Ye = Y(t, n), B.popElement(Ye); - return; - } - break; - case 3: - switch (t) { - case `table`: - if (!B.inTableScope(t)) return; - B.popTag(t), Pt(); - return; - case `body`: - case `caption`: - case `col`: - case `colgroup`: - case `html`: - case `tbody`: - case `td`: - case `tfoot`: - case `th`: - case `thead`: - case `tr`: return; - case `template`: - Q(e, t, n, r); - return; - } - break; - case -1: - $(e, t, n, r); - return; - } - kt = !0, $(e, t, n, r), kt = !1; - } - function Sr(e, t, n, r) { - if (e === f) { - if (et && (t = t.replace(Ae, ``), t.length === 0)) return; - Qe.push(t); - } else { - var i = Qe.join(``); - Qe.length = 0, Ee.test(i) ? (kt = !0, $(f, i), kt = !1) : Dt(i), z = Ge, z(e, t, n, r); - } - } - function Cr(e, t, n, r) { - function i() { - return B.inTableScope(`caption`) ? (B.generateImpliedEndTags(), B.popTag(`caption`), V.clearToMarker(), z = xr, !0) : !1; - } - switch (e) { - case 2: - switch (t) { - case `caption`: - case `col`: - case `colgroup`: - case `tbody`: - case `td`: - case `tfoot`: - case `th`: - case `thead`: - case `tr`: - i() && z(e, t, n, r); - return; - } - break; - case 3: - switch (t) { - case `caption`: - i(); - return; - case `table`: - i() && z(e, t, n, r); - return; - case `body`: - case `col`: - case `colgroup`: - case `html`: - case `tbody`: - case `td`: - case `tfoot`: - case `th`: - case `thead`: - case `tr`: return; - } - break; - } - $(e, t, n, r); - } - function wr(e, t, n, r) { - switch (e) { - case 1: - var i = t.match(ke); - if (i && (Dt(i[0]), t = t.substring(i[0].length)), t.length === 0) return; - break; - case 4: - Et(t); - return; - case 5: return; - case 2: - switch (t) { - case `html`: - $(e, t, n, r); - return; - case `col`: - Y(t, n), B.pop(); - return; - case `template`: - Q(e, t, n, r); - return; - } - break; - case 3: - switch (t) { - case `colgroup`: - if (!F(B.top, `colgroup`)) return; - B.pop(), z = xr; - return; - case `col`: return; - case `template`: - Q(e, t, n, r); - return; - } - break; - case -1: - $(e, t, n, r); - return; - } - F(B.top, `colgroup`) && (wr(m, `colgroup`), z(e, t, n, r)); - } - function Tr(e, t, n, r) { - function i() { - !B.inTableScope(`tbody`) && !B.inTableScope(`thead`) && !B.inTableScope(`tfoot`) || (B.clearToContext(te), Tr(m, B.top.localName, null), z(e, t, n, r)); - } - switch (e) { - case 2: - switch (t) { - case `tr`: - B.clearToContext(te), Y(t, n), z = Er; - return; - case `th`: - case `td`: - Tr(p, `tr`, null), z(e, t, n, r); - return; - case `caption`: - case `col`: - case `colgroup`: - case `tbody`: - case `tfoot`: - case `thead`: - i(); - return; - } - break; - case 3: - switch (t) { - case `table`: - i(); - return; - case `tbody`: - case `tfoot`: - case `thead`: - B.inTableScope(t) && (B.clearToContext(te), B.pop(), z = xr); - return; - case `body`: - case `caption`: - case `col`: - case `colgroup`: - case `html`: - case `td`: - case `th`: - case `tr`: return; - } - break; - } - xr(e, t, n, r); - } - function Er(e, t, n, r) { - function i() { - return B.inTableScope(`tr`) ? (B.clearToContext(ne), B.pop(), z = Tr, !0) : !1; - } - switch (e) { - case 2: - switch (t) { - case `th`: - case `td`: - B.clearToContext(ne), Y(t, n), z = Dr, V.insertMarker(); - return; - case `caption`: - case `col`: - case `colgroup`: - case `tbody`: - case `tfoot`: - case `thead`: - case `tr`: - i() && z(e, t, n, r); - return; - } - break; - case 3: - switch (t) { - case `tr`: - i(); - return; - case `table`: - i() && z(e, t, n, r); - return; - case `tbody`: - case `tfoot`: - case `thead`: - B.inTableScope(t) && i() && z(e, t, n, r); - return; - case `body`: - case `caption`: - case `col`: - case `colgroup`: - case `html`: - case `td`: - case `th`: return; - } - break; - } - xr(e, t, n, r); - } - function Dr(e, t, n, r) { - switch (e) { - case 2: - switch (t) { - case `caption`: - case `col`: - case `colgroup`: - case `tbody`: - case `td`: - case `tfoot`: - case `th`: - case `thead`: - case `tr`: - B.inTableScope(`td`) ? (Dr(m, `td`), z(e, t, n, r)) : B.inTableScope(`th`) && (Dr(m, `th`), z(e, t, n, r)); - return; - } - break; - case 3: - switch (t) { - case `td`: - case `th`: - if (!B.inTableScope(t)) return; - B.generateImpliedEndTags(), B.popTag(t), V.clearToMarker(), z = Er; - return; - case `body`: - case `caption`: - case `col`: - case `colgroup`: - case `html`: return; - case `table`: - case `tbody`: - case `tfoot`: - case `thead`: - case `tr`: - if (!B.inTableScope(t)) return; - Dr(m, B.inTableScope(`td`) ? `td` : `th`), z(e, t, n, r); - return; - } - break; - } - $(e, t, n, r); - } - function Or(e, t, n, r) { - switch (e) { - case 1: - if (et && (t = t.replace(Ae, ``), t.length === 0)) return; - Dt(t); - return; - case 4: - Et(t); - return; - case 5: return; - case -1: - $(e, t, n, r); - return; - case 2: - switch (t) { - case `html`: - $(e, t, n, r); - return; - case `option`: - B.top instanceof c.HTMLOptionElement && Or(m, t), Y(t, n); - return; - case `optgroup`: - B.top instanceof c.HTMLOptionElement && Or(m, `option`), B.top instanceof c.HTMLOptGroupElement && Or(m, t), Y(t, n); - return; - case `select`: - Or(m, t); - return; - case `input`: - case `keygen`: - case `textarea`: - if (!B.inSelectScope(`select`)) return; - Or(m, `select`), z(e, t, n, r); - return; - case `script`: - case `template`: - Q(e, t, n, r); - return; - } - break; - case 3: - switch (t) { - case `optgroup`: - B.top instanceof c.HTMLOptionElement && B.elements[B.elements.length - 2] instanceof c.HTMLOptGroupElement && Or(m, `option`), B.top instanceof c.HTMLOptGroupElement && B.pop(); - return; - case `option`: - B.top instanceof c.HTMLOptionElement && B.pop(); - return; - case `select`: - if (!B.inSelectScope(t)) return; - B.popTag(t), Pt(); - return; - case `template`: - Q(e, t, n, r); - return; - } - break; - } - } - function kr(e, t, n, r) { - switch (t) { - case `caption`: - case `table`: - case `tbody`: - case `tfoot`: - case `thead`: - case `tr`: - case `td`: - case `th`: switch (e) { - case 2: - kr(m, `select`), z(e, t, n, r); - return; - case 3: - B.inTableScope(t) && (kr(m, `select`), z(e, t, n, r)); - return; - } - } - Or(e, t, n, r); - } - function Ar(e, t, n, r) { - function i(i) { - z = i, Ke[Ke.length - 1] = z, z(e, t, n, r); - } - switch (e) { - case 1: - case 4: - case 5: - $(e, t, n, r); - return; - case -1: - B.contains(`template`) ? (B.popTag(`template`), V.clearToMarker(), Ke.pop(), Pt(), z(e, t, n, r)) : Ht(); - return; - case 2: - switch (t) { - case `base`: - case `basefont`: - case `bgsound`: - case `link`: - case `meta`: - case `noframes`: - case `script`: - case `style`: - case `template`: - case `title`: - Q(e, t, n, r); - return; - case `caption`: - case `colgroup`: - case `tbody`: - case `tfoot`: - case `thead`: - i(xr); - return; - case `col`: - i(wr); - return; - case `tr`: - i(Tr); - return; - case `td`: - case `th`: - i(Er); - return; - } - i($); - return; - case 3: switch (t) { - case `template`: - Q(e, t, n, r); - return; - default: return; - } - } - } - function jr(e, t, n, r) { - switch (e) { - case 1: - if (Ee.test(t)) break; - $(e, t); - return; - case 4: - B.elements[0]._appendChild(W.createComment(t)); - return; - case 5: return; - case -1: - Ht(); - return; - case 2: - if (t === `html`) { - $(e, t, n, r); - return; - } - break; - case 3: - if (t === `html`) { - if (qe) return; - z = Pr; - return; - } - break; - } - z = $, z(e, t, n, r); - } - function Mr(e, t, n, r) { - switch (e) { - case 1: - t = t.replace(De, ``), t.length > 0 && Dt(t); - return; - case 4: - Et(t); - return; - case 5: return; - case -1: - Ht(); - return; - case 2: - switch (t) { - case `html`: - $(e, t, n, r); - return; - case `frameset`: - Y(t, n); - return; - case `frame`: - Y(t, n), B.pop(); - return; - case `noframes`: - Q(e, t, n, r); - return; - } - break; - case 3: - if (t === `frameset`) { - if (qe && B.top instanceof c.HTMLHtmlElement) return; - B.pop(), !qe && !(B.top instanceof c.HTMLFrameSetElement) && (z = Nr); - return; - } - break; - } - } - function Nr(e, t, n, r) { - switch (e) { - case 1: - t = t.replace(De, ``), t.length > 0 && Dt(t); - return; - case 4: - Et(t); - return; - case 5: return; - case -1: - Ht(); - return; - case 2: - switch (t) { - case `html`: - $(e, t, n, r); - return; - case `noframes`: - Q(e, t, n, r); - return; - } - break; - case 3: - if (t === `html`) { - z = Fr; - return; - } - break; - } - } - function Pr(e, t, n, r) { - switch (e) { - case 1: - if (Ee.test(t)) break; - $(e, t, n, r); - return; - case 4: - W._appendChild(W.createComment(t)); - return; - case 5: - $(e, t, n, r); - return; - case -1: - Ht(); - return; - case 2: - if (t === `html`) { - $(e, t, n, r); - return; - } - break; - } - z = $, z(e, t, n, r); - } - function Fr(e, t, n, r) { - switch (e) { - case 1: - t = t.replace(De, ``), t.length > 0 && $(e, t, n, r); - return; - case 4: - W._appendChild(W.createComment(t)); - return; - case 5: - $(e, t, n, r); - return; - case -1: - Ht(); - return; - case 2: - switch (t) { - case `html`: - $(e, t, n, r); - return; - case `noframes`: - Q(e, t, n, r); - return; - } - break; - } - } - function Ir(e, n, r, i) { - function o(e) { - for (var t = 0, n = e.length; t < n; t++) switch (e[t][0]) { - case `color`: - case `face`: - case `size`: return !0; - } - return !1; - } - var s; - switch (e) { - case 1: - H && Oe.test(n) && (H = !1), et && (n = n.replace(Ae, `�`)), Dt(n); - return; - case 4: - Et(n); - return; - case 5: return; - case 2: - switch (n) { - case `font`: if (!o(r)) break; - case `b`: - case `big`: - case `blockquote`: - case `body`: - case `br`: - case `center`: - case `code`: - case `dd`: - case `div`: - case `dl`: - case `dt`: - case `em`: - case `embed`: - case `h1`: - case `h2`: - case `h3`: - case `h4`: - case `h5`: - case `h6`: - case `head`: - case `hr`: - case `i`: - case `img`: - case `li`: - case `listing`: - case `menu`: - case `meta`: - case `nobr`: - case `ol`: - case `p`: - case `pre`: - case `ruby`: - case `s`: - case `small`: - case `span`: - case `strong`: - case `strike`: - case `sub`: - case `sup`: - case `table`: - case `tt`: - case `u`: - case `ul`: - case `var`: - if (qe) break; - do - B.pop(), s = B.top; - while (s.namespaceURI !== a.HTML && !Me(s) && !Ne(s)); - J(e, n, r, i); - return; - } - s = B.elements.length === 1 && qe ? t : B.top, s.namespaceURI === a.MATHML ? Fe(r) : s.namespaceURI === a.SVG && (n = Pe(n), I(r)), Ie(r), jt(n, r, s.namespaceURI), i && (n === `script` && (s.namespaceURI, a.SVG), B.pop()); - return; - case 3: - if (s = B.top, n === `script` && s.namespaceURI === a.SVG && s.localName === `script`) B.pop(); - else for (var c = B.elements.length - 1, l = B.elements[c];;) { - if (l.localName.toLowerCase() === n) { - B.popElement(l); - break; - } - if (l = B.elements[--c], l.namespaceURI === a.HTML) { - z(e, n, r, i); - break; - } - } - return; - } - } - return nt.testTokenizer = function(e, t, n, r) { - var i = []; - switch (t) { - case `PCDATA state`: - k = Z; - break; - case `RCDATA state`: - k = Ut; - break; - case `RAWTEXT state`: - k = Wt; - break; - case `PLAINTEXT state`: - k = Kt; - break; - } - if (n && (de = n), J = function(e, t, n, r) { - switch (yt(), e) { - case 1: - i.length > 0 && i[i.length - 1][0] === `Character` ? i[i.length - 1][1] += t : i.push([`Character`, t]); - break; - case 4: - i.push([`Comment`, t]); - break; - case 5: - i.push([ - `DOCTYPE`, - t, - n === void 0 ? null : n, - r === void 0 ? null : r, - !Ze - ]); - break; - case 2: - for (var a = Object.create(null), o = 0; o < n.length; o++) { - var s = n[o]; - s.length === 1 ? a[s[0]] = `` : a[s[0]] = s[1]; - } - var c = [ - `StartTag`, - t, - a - ]; - r && c.push(!0), i.push(c); - break; - case 3: - i.push([`EndTag`, t]); - break; - case -1: break; - } - }, !r) this.parse(e, !0); - else { - for (var a = 0; a < e.length; a++) this.parse(e[a]); - this.parse(``, !0); - } - return i; - }, nt; - } -})); -var pe$7 = e$2(((e, t) => { - t.exports = c; - var n = de$7(), r = N$6(), i = fe$7(), a = o$8(), s = h$8(); - function c(e) { - this.contextObject = e; - } - var l = { - xml: { - "": !0, - "1.0": !0, - "2.0": !0 - }, - core: { - "": !0, - "2.0": !0 - }, - html: { - "": !0, - "1.0": !0, - "2.0": !0 - }, - xhtml: { - "": !0, - "1.0": !0, - "2.0": !0 - } - }; - c.prototype = { - hasFeature: function(e, t) { - var n = l[(e || ``).toLowerCase()]; - return n && n[t || ``] || !1; - }, - createDocumentType: function(e, t, n) { - return s.isValidQName(e) || a.InvalidCharacterError(), new r(this.contextObject, e, t, n); - }, - createDocument: function(e, t, r) { - var i = new n(!1, null), o = t ? i.createElementNS(e, t) : null; - return r && i.appendChild(r), o && i.appendChild(o), e === a.NAMESPACE.HTML ? i._contentType = `application/xhtml+xml` : e === a.NAMESPACE.SVG ? i._contentType = `image/svg+xml` : i._contentType = `application/xml`, i; - }, - createHTMLDocument: function(e) { - var t = new n(!0, null); - t.appendChild(new r(t, `html`)); - var i = t.createElement(`html`); - t.appendChild(i); - var a = t.createElement(`head`); - if (i.appendChild(a), e !== void 0) { - var o = t.createElement(`title`); - a.appendChild(o), o.appendChild(t.createTextNode(e)); - } - return i.appendChild(t.createElement(`body`)), t.modclock = 1, t; - }, - mozSetOutputMutationHandler: function(e, t) { - e.mutationHandler = t; - }, - mozGetInputMutationHandler: function(e) { - a.nyi(); - }, - mozHTMLParser: i - }; -})); -var me$7 = e$2(((e, t) => { - var n = ae$6(), r = k$8(); - t.exports = i; - function i(e, t) { - this._window = e, this._href = t; - } - i.prototype = Object.create(r.prototype, { - constructor: { value: i }, - href: { - get: function() { - return this._href; - }, - set: function(e) { - this.assign(e); - } - }, - assign: { value: function(e) { - var t = new n(this._href).resolve(e); - this._href = t; - } }, - replace: { value: function(e) { - this.assign(e); - } }, - reload: { value: function() { - this.assign(this.href); - } }, - toString: { value: function() { - return this.href; - } } - }); -})); -var he$7 = e$2(((e, t) => { - t.exports = Object.create(null, { - appCodeName: { value: `Mozilla` }, - appName: { value: `Netscape` }, - appVersion: { value: `4.0` }, - platform: { value: `` }, - product: { value: `Gecko` }, - productSub: { value: `20100101` }, - userAgent: { value: `` }, - vendor: { value: `` }, - vendorSub: { value: `` }, - taintEnabled: { value: function() { - return !1; - } } - }); -})); -var ge$7 = e$2(((e, t) => { - t.exports = { - setTimeout, - clearTimeout, - setInterval, - clearInterval - }; -})); -var _e$7 = e$2(((e, t) => { - var n = o$8(); - e = t.exports = { - CSSStyleDeclaration: le$7(), - CharacterData: T$8(), - Comment: D$7(), - DOMException: i$9(), - DOMImplementation: pe$7(), - DOMTokenList: v$7(), - Document: de$7(), - DocumentFragment: ee$5(), - DocumentType: N$6(), - Element: C$8(), - HTMLParser: fe$7(), - NamedNodeMap: S$8(), - Node: u$8(), - NodeList: p$10(), - NodeFilter: ne$5(), - ProcessingInstruction: te$5(), - Text: E$8(), - Window: ve$7() - }, n.merge(e, se$7()), n.merge(e, j$6().elements), n.merge(e, M$7().elements); -})); -var ve$7 = e$2(((e, t) => { - var n = pe$7(), r = s$6(), i = me$7(), a = o$8(); - t.exports = c; - function c(e) { - this.document = e || new n(null).createHTMLDocument(``), this.document._scripting_enabled = !0, this.document.defaultView = this, this.location = new i(this, this.document._address || `about:blank`); - } - c.prototype = Object.create(r.prototype, { - console: { value: console }, - history: { value: { - back: a.nyi, - forward: a.nyi, - go: a.nyi - } }, - navigator: { value: he$7() }, - window: { get: function() { - return this; - } }, - self: { get: function() { - return this; - } }, - frames: { get: function() { - return this; - } }, - parent: { get: function() { - return this; - } }, - top: { get: function() { - return this; - } }, - length: { value: 0 }, - frameElement: { value: null }, - opener: { value: null }, - onload: { - get: function() { - return this._getEventHandler(`load`); - }, - set: function(e) { - this._setEventHandler(`load`, e); - } - }, - getComputedStyle: { value: function(e) { - return e.style; - } } - }), a.expose(ge$7(), c), a.expose(_e$7(), c); -})); -var ye$7 = e$2(((e) => { - var t = pe$7(), n = fe$7(); - ve$7(); - var r = _e$7(); - e.createDOMImplementation = function() { - return new t(null); - }, e.createDocument = function(e, r) { - if (e || r) { - var i = new n(); - return i.parse(e || ``, !0), i.document(); - } - return new t(null).createHTMLDocument(``); - }, e.createIncrementalHTMLParser = function() { - var e = new n(); - return { - write: function(t) { - t.length > 0 && e.parse(t, !1, function() { - return !0; - }); - }, - end: function(t) { - e.parse(t || ``, !0, function() { - return !0; - }); - }, - process: function(t) { - return e.parse(``, !1, t); - }, - document: function() { - return e.document(); - } - }; - }, e.createWindow = function(t, n) { - var i = e.createDocument(t); - return n !== void 0 && (i._address = n), new r.Window(i); - }, e.impl = r; -})); -function be$7(e) { - for (var t = 1; t < arguments.length; t++) { - var n = arguments[t]; - for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]); - } - return e; -} -function xe$7(e, t) { - return Array(t + 1).join(e); -} -function Se$7(e) { - return e.replace(/^\n*/, ``); -} -function Ce$7(e) { - for (var t = e.length; t > 0 && e[t - 1] === ` -`;) t--; - return e.substring(0, t); -} -function we$7(e) { - return Ce$7(Se$7(e)); -} -var Te$7 = `ADDRESS.ARTICLE.ASIDE.AUDIO.BLOCKQUOTE.BODY.CANVAS.CENTER.DD.DIR.DIV.DL.DT.FIELDSET.FIGCAPTION.FIGURE.FOOTER.FORM.FRAMESET.H1.H2.H3.H4.H5.H6.HEADER.HGROUP.HR.HTML.ISINDEX.LI.MAIN.MENU.NAV.NOFRAMES.NOSCRIPT.OL.OUTPUT.P.PRE.SECTION.TABLE.TBODY.TD.TFOOT.TH.THEAD.TR.UL`.split(`.`); -function Ee$7(e) { - return F$6(e, Te$7); -} -var De$7 = [ - `AREA`, - `BASE`, - `BR`, - `COL`, - `COMMAND`, - `EMBED`, - `HR`, - `IMG`, - `INPUT`, - `KEYGEN`, - `LINK`, - `META`, - `PARAM`, - `SOURCE`, - `TRACK`, - `WBR` -]; -function Oe$7(e) { - return F$6(e, De$7); -} -function ke$7(e) { - return Me$7(e, De$7); -} -var Ae$7 = [ - `A`, - `TABLE`, - `THEAD`, - `TBODY`, - `TFOOT`, - `TH`, - `TD`, - `IFRAME`, - `SCRIPT`, - `AUDIO`, - `VIDEO` -]; -function P$6(e) { - return F$6(e, Ae$7); -} -function je$7(e) { - return Me$7(e, Ae$7); -} -function F$6(e, t) { - return t.indexOf(e.nodeName) >= 0; -} -function Me$7(e, t) { - return e.getElementsByTagName && t.some(function(t) { - return e.getElementsByTagName(t).length; - }); -} -var Ne$7 = [ - [/\\/g, `\\\\`], - [/\*/g, `\\*`], - [/^-/g, `\\-`], - [/^\+ /g, `\\+ `], - [/^(=+)/g, `\\$1`], - [/^(#{1,6}) /g, `\\$1 `], - [/`/g, "\\`"], - [/^~~~/g, `\\~~~`], - [/\[/g, `\\[`], - [/\]/g, `\\]`], - [/^>/g, `\\>`], - [/_/g, `\\_`], - [/^(\d+)\. /g, `$1\\. `] -]; -function Pe$7(e) { - return Ne$7.reduce(function(e, t) { - return e.replace(t[0], t[1]); - }, e); -} -var I$6 = {}; -I$6.paragraph = { - filter: `p`, - replacement: function(e) { - return ` - -` + e + ` - -`; - } -}, I$6.lineBreak = { - filter: `br`, - replacement: function(e, t, n) { - return n.br + ` -`; - } -}, I$6.heading = { - filter: [ - `h1`, - `h2`, - `h3`, - `h4`, - `h5`, - `h6` - ], - replacement: function(e, t, n) { - var r = Number(t.nodeName.charAt(1)); - if (n.headingStyle === `setext` && r < 3) { - var i = xe$7(r === 1 ? `=` : `-`, e.length); - return ` - -` + e + ` -` + i + ` - -`; - } else return ` - -` + xe$7(`#`, r) + ` ` + e + ` - -`; - } -}, I$6.blockquote = { - filter: `blockquote`, - replacement: function(e) { - return e = we$7(e).replace(/^/gm, `> `), ` - -` + e + ` - -`; - } -}, I$6.list = { - filter: [`ul`, `ol`], - replacement: function(e, t) { - var n = t.parentNode; - return n.nodeName === `LI` && n.lastElementChild === t ? ` -` + e : ` - -` + e + ` - -`; - } -}, I$6.listItem = { - filter: `li`, - replacement: function(e, t, n) { - var r = n.bulletListMarker + ` `, i = t.parentNode; - if (i.nodeName === `OL`) { - var a = i.getAttribute(`start`), o = Array.prototype.indexOf.call(i.children, t); - r = (a ? Number(a) + o : o + 1) + `. `; - } - var s = /\n$/.test(e); - return e = we$7(e) + (s ? ` -` : ``), e = e.replace(/\n/gm, ` -` + ` `.repeat(r.length)), r + e + (t.nextSibling ? ` -` : ``); - } -}, I$6.indentedCodeBlock = { - filter: function(e, t) { - return t.codeBlockStyle === `indented` && e.nodeName === `PRE` && e.firstChild && e.firstChild.nodeName === `CODE`; - }, - replacement: function(e, t, n) { - return ` - - ` + t.firstChild.textContent.replace(/\n/g, ` - `) + ` - -`; - } -}, I$6.fencedCodeBlock = { - filter: function(e, t) { - return t.codeBlockStyle === `fenced` && e.nodeName === `PRE` && e.firstChild && e.firstChild.nodeName === `CODE`; - }, - replacement: function(e, t, n) { - for (var r = ((t.firstChild.getAttribute(`class`) || ``).match(/language-(\S+)/) || [null, ``])[1], i = t.firstChild.textContent, a = n.fence.charAt(0), o = 3, s = RegExp(`^` + a + `{3,}`, `gm`), c; c = s.exec(i);) c[0].length >= o && (o = c[0].length + 1); - var l = xe$7(a, o); - return ` - -` + l + r + ` -` + i.replace(/\n$/, ``) + ` -` + l + ` - -`; - } -}, I$6.horizontalRule = { - filter: `hr`, - replacement: function(e, t, n) { - return ` - -` + n.hr + ` - -`; - } -}, I$6.inlineLink = { - filter: function(e, t) { - return t.linkStyle === `inlined` && e.nodeName === `A` && e.getAttribute(`href`); - }, - replacement: function(e, t) { - var n = Ie$7(t.getAttribute(`href`)), r = Le$7(Fe$7(t.getAttribute(`title`))), i = r ? ` "` + r + `"` : ``; - return `[` + e + `](` + n + i + `)`; - } -}, I$6.referenceLink = { - filter: function(e, t) { - return t.linkStyle === `referenced` && e.nodeName === `A` && e.getAttribute(`href`); - }, - replacement: function(e, t, n) { - var r = Ie$7(t.getAttribute(`href`)), i = Fe$7(t.getAttribute(`title`)); - i &&= ` "` + Le$7(i) + `"`; - var a, o; - switch (n.linkReferenceStyle) { - case `collapsed`: - a = `[` + e + `][]`, o = `[` + e + `]: ` + r + i; - break; - case `shortcut`: - a = `[` + e + `]`, o = `[` + e + `]: ` + r + i; - break; - default: - var s = this.references.length + 1; - a = `[` + e + `][` + s + `]`, o = `[` + s + `]: ` + r + i; - } - return this.references.push(o), a; - }, - references: [], - append: function(e) { - var t = ``; - return this.references.length && (t = ` - -` + this.references.join(` -`) + ` - -`, this.references = []), t; - } -}, I$6.emphasis = { - filter: [`em`, `i`], - replacement: function(e, t, n) { - return e.trim() ? n.emDelimiter + e + n.emDelimiter : ``; - } -}, I$6.strong = { - filter: [`strong`, `b`], - replacement: function(e, t, n) { - return e.trim() ? n.strongDelimiter + e + n.strongDelimiter : ``; - } -}, I$6.code = { - filter: function(e) { - var t = e.previousSibling || e.nextSibling, n = e.parentNode.nodeName === `PRE` && !t; - return e.nodeName === `CODE` && !n; - }, - replacement: function(e) { - if (!e) return ``; - e = e.replace(/\r?\n|\r/g, ` `); - for (var t = /^`|^ .*?[^ ].* $|`$/.test(e) ? ` ` : ``, n = "`", r = e.match(/`+/gm) || []; r.indexOf(n) !== -1;) n += "`"; - return n + t + e + t + n; - } -}, I$6.image = { - filter: `img`, - replacement: function(e, t) { - var n = Pe$7(Fe$7(t.getAttribute(`alt`))), r = Ie$7(t.getAttribute(`src`) || ``), i = Fe$7(t.getAttribute(`title`)), a = i ? ` "` + Le$7(i) + `"` : ``; - return r ? `![` + n + `](` + r + a + `)` : ``; - } -}; -function Fe$7(e) { - return e ? e.replace(/(\n+\s*)+/g, ` -`) : ``; -} -function Ie$7(e) { - var t = e.replace(/([<>()])/g, `\\$1`); - return t.indexOf(` `) >= 0 ? `<` + t + `>` : t; -} -function Le$7(e) { - return e.replace(/"/g, `\\"`); -} -function L$6(e) { - for (var t in this.options = e, this._keep = [], this._remove = [], this.blankRule = { replacement: e.blankReplacement }, this.keepReplacement = e.keepReplacement, this.defaultRule = { replacement: e.defaultReplacement }, this.array = [], e.rules) this.array.push(e.rules[t]); -} -L$6.prototype = { - add: function(e, t) { - this.array.unshift(t); - }, - keep: function(e) { - this._keep.unshift({ - filter: e, - replacement: this.keepReplacement - }); - }, - remove: function(e) { - this._remove.unshift({ - filter: e, - replacement: function() { - return ``; - } - }); - }, - forNode: function(e) { - if (e.isBlank) return this.blankRule; - var t; - return (t = Re$7(this.array, e, this.options)) || (t = Re$7(this._keep, e, this.options)) || (t = Re$7(this._remove, e, this.options)) ? t : this.defaultRule; - }, - forEach: function(e) { - for (var t = 0; t < this.array.length; t++) e(this.array[t], t); - } -}; -function Re$7(e, t, n) { - for (var r = 0; r < e.length; r++) { - var i = e[r]; - if (ze$7(i, t, n)) return i; - } -} -function ze$7(e, t, n) { - var r = e.filter; - if (typeof r == `string`) { - if (r === t.nodeName.toLowerCase()) return !0; - } else if (Array.isArray(r)) { - if (r.indexOf(t.nodeName.toLowerCase()) > -1) return !0; - } else if (typeof r == `function`) { - if (r.call(e, t, n)) return !0; - } else throw TypeError("`filter` needs to be a string, array, or function"); -} -function R$6(e) { - var t = e.element, n = e.isBlock, r = e.isVoid, i = e.isPre || function(e) { - return e.nodeName === `PRE`; - }; - if (!(!t.firstChild || i(t))) { - for (var a = null, o = !1, s = null, c = Ve$7(s, t, i); c !== t;) { - if (c.nodeType === 3 || c.nodeType === 4) { - var l = c.data.replace(/[ \r\n\t]+/g, ` `); - if ((!a || / $/.test(a.data)) && !o && l[0] === ` ` && (l = l.substr(1)), !l) { - c = Be$7(c); - continue; - } - c.data = l, a = c; - } else if (c.nodeType === 1) n(c) || c.nodeName === `BR` ? (a && (a.data = a.data.replace(/ $/, ``)), a = null, o = !1) : r(c) || i(c) ? (a = null, o = !0) : a && (o = !1); - else { - c = Be$7(c); - continue; - } - var u = Ve$7(s, c, i); - s = c, c = u; - } - a && (a.data = a.data.replace(/ $/, ``), a.data || Be$7(a)); - } -} -function Be$7(e) { - var t = e.nextSibling || e.parentNode; - return e.parentNode.removeChild(e), t; -} -function Ve$7(e, t, n) { - return e && e.parentNode === t || n(t) ? t.nextSibling || t.parentNode : t.firstChild || t.nextSibling || t.parentNode; -} -var He$7 = typeof window < `u` ? window : {}; -function Ue$7() { - var e = He$7.DOMParser, t = !1; - try { - new e().parseFromString(``, `text/html`) && (t = !0); - } catch {} - return t; -} -function We$7() { - var e = function() {}, t = ye$7(); - return e.prototype.parseFromString = function(e) { - return t.createDocument(e); - }, e; -} -var z$6 = Ue$7() ? He$7.DOMParser : We$7(); -function Ge$7(e, t) { - var n = typeof e == `string` ? B$7().parseFromString(`` + e + ``, `text/html`).getElementById(`turndown-root`) : e.cloneNode(!0); - return R$6({ - element: n, - isBlock: Ee$7, - isVoid: Oe$7, - isPre: t.preformattedCode ? V$6 : null - }), n; -} -var Ke$7; -function B$7() { - return Ke$7 ||= new z$6(), Ke$7; -} -function V$6(e) { - return e.nodeName === `PRE` || e.nodeName === `CODE`; -} -function qe$7(e, t) { - return e.isBlock = Ee$7(e), e.isCode = e.nodeName === `CODE` || e.parentNode.isCode, e.isBlank = Je$7(e), e.flankingWhitespace = Ye$7(e, t), e; -} -function Je$7(e) { - return !Oe$7(e) && !P$6(e) && /^\s*$/i.test(e.textContent) && !ke$7(e) && !je$7(e); -} -function Ye$7(e, t) { - if (e.isBlock || t.preformattedCode && e.isCode) return { - leading: ``, - trailing: `` - }; - var n = Xe$7(e.textContent); - return n.leadingAscii && H$7(`left`, e, t) && (n.leading = n.leadingNonAscii), n.trailingAscii && H$7(`right`, e, t) && (n.trailing = n.trailingNonAscii), { - leading: n.leading, - trailing: n.trailing - }; -} -function Xe$7(e) { - var t = e.match(/^(([ \t\r\n]*)(\s*))(?:(?=\S)[\s\S]*\S)?((\s*?)([ \t\r\n]*))$/); - return { - leading: t[1], - leadingAscii: t[2], - leadingNonAscii: t[3], - trailing: t[4], - trailingNonAscii: t[5], - trailingAscii: t[6] - }; -} -function H$7(e, t, n) { - var r, i, a; - return e === `left` ? (r = t.previousSibling, i = / $/) : (r = t.nextSibling, i = /^ /), r && (r.nodeType === 3 ? a = i.test(r.nodeValue) : n.preformattedCode && r.nodeName === `CODE` ? a = !1 : r.nodeType === 1 && !Ee$7(r) && (a = i.test(r.textContent))), a; -} -var Ze$7 = Array.prototype.reduce; -function Qe$7(e) { - if (!(this instanceof Qe$7)) return new Qe$7(e); - var t = { - rules: I$6, - headingStyle: `setext`, - hr: `* * *`, - bulletListMarker: `*`, - codeBlockStyle: `indented`, - fence: "```", - emDelimiter: `_`, - strongDelimiter: `**`, - linkStyle: `inlined`, - linkReferenceStyle: `full`, - br: ` `, - preformattedCode: !1, - blankReplacement: function(e, t) { - return t.isBlock ? ` - -` : ``; - }, - keepReplacement: function(e, t) { - return t.isBlock ? ` - -` + t.outerHTML + ` - -` : t.outerHTML; - }, - defaultReplacement: function(e, t) { - return t.isBlock ? ` - -` + e + ` - -` : e; - } - }; - this.options = be$7({}, t, e), this.rules = new L$6(this.options); -} -Qe$7.prototype = { - turndown: function(e) { - if (!nt$7(e)) throw TypeError(e + ` is not a string, or an element/document/fragment node.`); - if (e === ``) return ``; - var t = $e$7.call(this, new Ge$7(e, this.options)); - return U$7.call(this, t); - }, - use: function(e) { - if (Array.isArray(e)) for (var t = 0; t < e.length; t++) this.use(e[t]); - else if (typeof e == `function`) e(this); - else throw TypeError(`plugin must be a Function or an Array of Functions`); - return this; - }, - addRule: function(e, t) { - return this.rules.add(e, t), this; - }, - keep: function(e) { - return this.rules.keep(e), this; - }, - remove: function(e) { - return this.rules.remove(e), this; - }, - escape: function(e) { - return Pe$7(e); - } -}; -function $e$7(e) { - var t = this; - return Ze$7.call(e.childNodes, function(e, n) { - n = new qe$7(n, t.options); - var r = ``; - return n.nodeType === 3 ? r = n.isCode ? n.nodeValue : t.escape(n.nodeValue) : n.nodeType === 1 && (r = et$7.call(t, n)), tt$7(e, r); - }, ``); -} -function U$7(e) { - var t = this; - return this.rules.forEach(function(n) { - typeof n.append == `function` && (e = tt$7(e, n.append(t.options))); - }), e.replace(/^[\t\r\n]+/, ``).replace(/[\t\r\n\s]+$/, ``); -} -function et$7(e) { - var t = this.rules.forNode(e), n = $e$7.call(this, e), r = e.flankingWhitespace; - return (r.leading || r.trailing) && (n = n.trim()), r.leading + t.replacement(n, e, this.options) + r.trailing; -} -function tt$7(e, t) { - var n = Ce$7(e), r = Se$7(t), i = Math.max(e.length - n.length, t.length - r.length); - return n + ` - -`.substring(0, i) + r; -} -function nt$7(e) { - return e != null && (typeof e == `string` || e.nodeType && (e.nodeType === 1 || e.nodeType === 9 || e.nodeType === 11)); -} -//#endregion -//#region node_modules/eve/dist/src/execution/web-fetch/html.js -function convertHtmlToMarkdown(t) { - let n = new Qe$7({ - bulletListMarker: `-`, - codeBlockStyle: `fenced`, - emDelimiter: `*`, - headingStyle: `atx`, - hr: `---` - }); - return n.remove([ - `script`, - `style`, - `meta`, - `link` - ]), n.turndown(t); -} -function extractTextFromHtml(e) { - let t = e; - return t = t.replace(/<(script|style|noscript)\b[^>]*>[\s\S]*?<\/\1>/gi, ``), t = t.replace(/<\/(p|div|br|h[1-6]|li|tr|blockquote|pre|section|article|header|footer|nav|aside|main|figure|figcaption|details|summary)>/gi, ` -`), t = t.replace(//gi, ` -`), t = t.replace(/<[^>]+>/g, ``), t = decodeHtmlEntities(t), t = t.split(` -`).map((e) => e.replace(/[ \t]+/g, ` `).trim()).join(` -`).replace(/\n{3,}/g, ` - -`).trim(), t; -} -const ENTITY_MAP = { - "&": `&`, - ">": `>`, - "<": `<`, - " ": ` `, - """: `"`, - "'": `'`, - "'": `'`, - "/": `/` -}; -const ENTITY_PATTERN = new RegExp(Object.keys(ENTITY_MAP).join(`|`), `gi`); -function decodeHtmlEntities(e) { - return e.replace(ENTITY_PATTERN, (e) => ENTITY_MAP[e.toLowerCase()] ?? e); -} -//#endregion -//#region node_modules/eve/dist/src/execution/web-fetch/tool.js -const MAX_RESPONSE_SIZE = 5 * 1024 * 1024; -async function executeWebFetchTool(n) { - let { url: r, format: i = `markdown`, timeout: a } = n; - if (!r.startsWith(`http://`) && !r.startsWith(`https://`)) throw Error(`URL must start with http:// or https://`); - let o = Math.min(a === void 0 ? 3e4 : a * 1e3, 12e4), s = AbortSignal.timeout(o), c = buildHeaders(i), l = await fetch(r, { - headers: c, - signal: s - }), u = l.status === 403 && l.headers.get(`cf-mitigated`) === `challenge` ? await fetch(r, { - headers: { - ...c, - "User-Agent": EVE_PACKAGE_NAME - }, - signal: s - }) : l; - if (!u.ok) throw Error(`Request failed with status code: ${u.status}`); - let d = u.headers.get(`content-length`); - if (d !== null && parseInt(d, 10) > MAX_RESPONSE_SIZE) throw Error(`Response too large (exceeds 5 MB limit).`); - let f = await u.arrayBuffer(); - if (f.byteLength > MAX_RESPONSE_SIZE) throw Error(`Response too large (exceeds 5 MB limit).`); - let p = u.headers.get(`content-type`) ?? ``, m = p.includes(`text/html`), h = new TextDecoder().decode(f), g; - g = i === `markdown` && m ? convertHtmlToMarkdown(h) : i === `text` && m ? extractTextFromHtml(h) : h; - let { output: _, truncated: v } = truncateHead(g); - return { - content: _, - contentType: p, - truncated: v, - url: r - }; -} -function buildHeaders(e) { - let t; - return t = e === `markdown` ? `text/markdown;q=1.0, text/x-markdown;q=0.9, text/plain;q=0.8, text/html;q=0.7, */*;q=0.1` : e === `text` ? `text/plain;q=1.0, text/markdown;q=0.9, text/html;q=0.8, */*;q=0.1` : `text/html;q=1.0, application/xhtml+xml;q=0.9, text/plain;q=0.8, text/markdown;q=0.7, */*;q=0.1`, { - Accept: t, - "Accept-Language": `en-US,en;q=0.9`, - "User-Agent": `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36` - }; -} -//#endregion -//#region node_modules/eve/dist/src/runtime/framework-tools/web-fetch.js -async function executeWebFetch(e) { - return executeWebFetchTool(e); -} -const WEB_FETCH_INPUT_SCHEMA = { - additionalProperties: !1, - properties: { - format: { - description: `The format to return the content in (text, markdown, or html). HTML responses are automatically converted to the requested format. Defaults to "markdown".`, - enum: [ - `markdown`, - `text`, - `html` - ], - type: `string` - }, - timeout: { - description: `Optional timeout in seconds. Defaults to 30, max 120.`, - type: `number` - }, - url: { - description: `The fully-formed URL to fetch content from. Must start with http:// or https://.`, - type: `string` - } - }, - required: [`url`], - type: `object` -}; -const WEB_FETCH_OUTPUT_SCHEMA = { - additionalProperties: !1, - properties: { - content: { type: `string` }, - contentType: { type: `string` }, - truncated: { type: `boolean` }, - url: { type: `string` } - }, - required: [ - `content`, - `contentType`, - `url`, - `truncated` - ], - type: `object` -}; -const WEB_FETCH_TOOL_DEFINITION = { - description: [ - `Fetch a webpage and return its content in the requested format. Use this to retrieve and analyze content from URLs.`, - ``, - `Usage notes:`, - `- The URL must be a fully-formed valid URL starting with http:// or https://`, - `- HTML responses are automatically converted to markdown or plain text based on the requested format`, - `- Format options: "markdown" (default), "text", or "html"`, - `- Default timeout is 30 seconds (max 120 seconds)`, - `- Maximum response size is 5 MB; content is further capped at the shared tool-output budget (50 KB / 2000 lines)`, - `- This tool is read-only and does not modify any files` - ].join(` -`), - execute: executeWebFetch, - inputSchema: WEB_FETCH_INPUT_SCHEMA, - logicalPath: `eve:framework/web-fetch`, - name: `web_fetch`, - outputSchema: WEB_FETCH_OUTPUT_SCHEMA, - sourceId: `eve:web-fetch-tool`, - sourceKind: `module` -}; -//#endregion -//#region node_modules/eve/dist/src/execution/sandbox/write-file-tool.js -async function executeWriteFileOnSandbox(e, t) { - let { filePath: n, content: r } = t; - validateAbsoluteFilePath(n); - let i = loadContext(), a = normalizeModelPath(n), o = buildReadFileTargetKey(a), s = await e.readTextFile({ path: n }); - if (s === null) return await e.writeTextFile({ - content: r, - path: n - }), setReadFileStamp(i, o, createReadFileStamp({ - content: r, - filePath: a - })), { - existed: !1, - path: a - }; - let c = i.ensure(ReadFileStateKey, () => ({ byTarget: {} })).byTarget[o]; - if (c === void 0) throw Error(`You must read file ${n} before overwriting it. Use the read_file tool first.`); - let l = createReadFileStamp({ - content: s, - filePath: a - }); - if (l.contentHash !== c.contentHash || l.byteLength !== c.byteLength) throw Error(`File ${n} has been modified since it was last read. Please read the file again before modifying it.`); - return await e.writeTextFile({ - content: r, - path: n - }), setReadFileStamp(i, o, createReadFileStamp({ - content: r, - filePath: a - })), { - existed: !0, - path: a - }; -} -//#endregion -//#region node_modules/eve/dist/src/runtime/framework-tools/write-file.js -const WRITE_FILE_INPUT_SCHEMA = { - additionalProperties: !1, - properties: { - content: { - description: `Complete replacement file contents.`, - type: `string` - }, - filePath: { - description: `The absolute path to the file to write (must be absolute, not relative).`, - type: `string` - } - }, - required: [`filePath`, `content`], - type: `object` -}; -const WRITE_FILE_OUTPUT_SCHEMA = { - additionalProperties: !1, - properties: { - existed: { type: `boolean` }, - path: { type: `string` } - }, - required: [`existed`, `path`], - type: `object` -}; -async function executeWriteFile(e) { - return executeWriteFileOnSandbox(await requireSandboxSession(), e); -} -const WRITE_FILE_TOOL_DEFINITION = { - description: [ - `Writes a file to the local filesystem.`, - ``, - `Usage:`, - `- This tool will overwrite the existing file if there is one at the provided path.`, - `- If this is an existing file, you MUST use the read_file tool first to read the file's contents. This tool will fail if you did not read the file first.`, - `- ALWAYS prefer editing existing files in the codebase. NEVER write new files unless explicitly required.`, - `- NEVER proactively create documentation files (*.md) or README files. Only create documentation files if explicitly requested by the User.`, - `- Only use emojis if the user explicitly requests it. Avoid writing emojis to files unless asked.` - ].join(` -`), - execute: executeWriteFile, - inputSchema: WRITE_FILE_INPUT_SCHEMA, - logicalPath: `eve:framework/write-file`, - name: `write_file`, - outputSchema: WRITE_FILE_OUTPUT_SCHEMA, - sourceId: `eve:write-file-tool`, - sourceKind: `module` -}; -//#endregion -//#region node_modules/eve/dist/src/runtime/framework-tools/index.js -const ALL_FRAMEWORK_TOOLS = [ - ASK_QUESTION_TOOL_DEFINITION, - BASH_TOOL_DEFINITION, - GLOB_TOOL_DEFINITION, - GREP_TOOL_DEFINITION, - READ_FILE_TOOL_DEFINITION, - WRITE_FILE_TOOL_DEFINITION, - TODO_TOOL_DEFINITION, - WEB_FETCH_TOOL_DEFINITION, - WEB_SEARCH_TOOL_DEFINITION, - SKILL_TOOL_DEFINITION -]; -function getFrameworkToolDefinitions(e) { - return ALL_FRAMEWORK_TOOLS; -} -function getAllFrameworkToolNames() { - return new Set(ALL_FRAMEWORK_TOOLS.map((e) => e.name)); -} -//#endregion -//#region node_modules/eve/dist/src/public/connections/errors.js -var ConnectionAuthorizationRequiredError = class extends Error { - connectionName; - constructor(e, t) { - super(t?.message ?? `Connection "${e}" requires authorization.`), this.name = `ConnectionAuthorizationRequiredError`, this.connectionName = e; - } -}; -var ConnectionAuthorizationFailedError = class extends Error { - connectionName; - reason; - retryable; - constructor(e, t) { - super(t?.message ?? `Connection "${e}" authorization failed.`), this.name = `ConnectionAuthorizationFailedError`, this.connectionName = e, this.reason = t?.reason, this.retryable = t?.retryable ?? !0; - } -}; -function isConnectionAuthorizationRequiredError(e) { - return e instanceof Error && e.name === `ConnectionAuthorizationRequiredError`; -} -function isConnectionAuthorizationFailedError(e) { - return e instanceof Error && e.name === `ConnectionAuthorizationFailedError`; -} -//#endregion -//#region node_modules/eve/dist/src/harness/authorization.js -const AUTHORIZATION_BRAND = `__eveAuthorization`; -const AUTHORIZATION_PENDING_BRAND = `__eveAuthorizationPending`; -function requestAuthorization(e) { - return { - [AUTHORIZATION_BRAND]: !0, - challenges: e - }; -} -function getAuthorizationResult(e) { - let t = loadContext().get(PendingAuthorizationResultKey); - if (!(!t || t.length === 0)) return e === void 0 ? t[0] : t.find((t) => t.name === e); -} -function getHookUrl(r) { - let i = loadContext(), a = i.get(SessionIdKey), o = i.get(CallbackBaseUrlKey); - return !a || !o ? void 0 : `${o}${createEveConnectionCallbackRoutePath(r, authHookToken(a))}`; -} -function isAuthorizationSignal(e) { - return typeof e != `object` || !e ? !1 : e[AUTHORIZATION_BRAND] === !0; -} -function isAuthorizationPendingModelOutput(e) { - return typeof e != `object` || !e ? !1 : e[AUTHORIZATION_PENDING_BRAND] === !0; -} -function authorizationPendingAsJsonObject(e) { - return { - [AUTHORIZATION_PENDING_BRAND]: !0, - connections: [...e.connections] - }; -} -function modelFacingAuthorizationOutput(e) { - return authorizationPendingAsJsonObject({ connections: e.challenges.map((e) => e.name) }); -} -function authorizationPendingModelText(e) { - return e.length === 0 ? `Authorization required. Waiting for the user to sign in.` : e.length === 1 ? `Authorization required for ${e[0]}. Waiting for the user to sign in.` : `Authorization required for ${e.join(`, `)}. Waiting for the user to sign in.`; -} -function isPendingAuthorizationToolOutput(e) { - return isAuthorizationPendingModelOutput(e) || isAuthorizationSignal(e); -} -function authHookToken(e) { - return `${e}:auth`; -} -const PendingAuthorizationResultKey = new ContextKey(`eve.pendingAuthorizationResult`); -const CallbackBaseUrlKey = new ContextKey(`eve.callbackBaseUrl`); -const PENDING_AUTHORIZATION_KEY = `eve.runtime.pendingAuthorization`; -function setPendingAuthorization(e, t) { - return { - ...e, - [PENDING_AUTHORIZATION_KEY]: t - }; -} -function clearPendingAuthorization(e, t) { - if (e === void 0 || e[PENDING_AUTHORIZATION_KEY] === void 0) return e; - if (t !== void 0) { - if (t.length === 0) return e; - let n = getPendingAuthorization(e); - if (n !== void 0) { - let r = new Set(t), i = n.challenges.filter((e) => !r.has(e.name)); - if (i.length > 0) return { - ...e, - [PENDING_AUTHORIZATION_KEY]: { challenges: i } - }; - } - } - let n = { ...e }; - return delete n[PENDING_AUTHORIZATION_KEY], Object.keys(n).length > 0 ? n : void 0; -} -function getPendingAuthorization(e) { - if (!e) return; - let t = e[PENDING_AUTHORIZATION_KEY]; - if (!(typeof t != `object` || !t)) return t; -} -//#endregion -//#region node_modules/eve/dist/src/runtime/connections/types.js -function supportsInteractiveAuthorization(e) { - return e?.startAuthorization !== void 0; -} -//#endregion -//#region node_modules/eve/dist/src/runtime/connections/authorization-tokens.js -const ConnectionAuthorizationTokensKey = new ContextKey(`eve.connectionAuthorizationTokens`); -function readCachedToken(e, t, n) { - let r = e.get(ConnectionAuthorizationTokensKey)?.[t]?.[n]; - if (r !== void 0 && !(r.expiresAt !== void 0 && r.expiresAt <= Date.now())) return r; -} -function writeCachedToken(e, t, n, r) { - let i = e.get(ConnectionAuthorizationTokensKey) ?? {}, a = i[t] ?? {}; - asContainer$1(e).setVirtualContext(ConnectionAuthorizationTokensKey, { - ...i, - [t]: { - ...a, - [n]: r - } - }); -} -function evictCachedToken(e, t, n) { - let r = e.get(ConnectionAuthorizationTokensKey), i = r?.[t]; - if (r === void 0 || i === void 0 || i[n] === void 0) return; - let { [n]: a, ...o } = i; - asContainer$1(e).setVirtualContext(ConnectionAuthorizationTokensKey, { - ...r, - [t]: o - }); -} -function asContainer$1(e) { - return e; -} -//#endregion -//#region node_modules/eve/dist/src/runtime/connections/principal.js -function principalKey(e) { - return e.type === `app` ? `app` : e.issuer === void 0 ? `user:${e.id}` : `user:${e.issuer}:${e.id}`; -} -function resolveConnectionPrincipal(r, i, a = contextStorage.getStore()) { - if (i.principalType === `app`) return { type: `app` }; - let o = a?.get(AuthKey); - if (o == null || o.principalType !== `user`) throw new ConnectionAuthorizationFailedError(r, { - message: buildUserPrincipalRequiredMessage(r, i, a, o), - reason: `principal_required`, - retryable: !1 - }); - return i.vercelConnect !== void 0 && isVercelDevelopmentUser(o) ? { - attributes: o.attributes, - id: o.subject ?? o.principalId, - type: `user` - } : { - attributes: o.attributes, - id: o.principalId, - issuer: o.issuer ?? o.authenticator, - type: `user` - }; -} -function isVercelDevelopmentUser(e) { - return e.authenticator === `oidc` && e.issuer?.startsWith(`https://oidc.vercel.com/`) === !0 && e.attributes.environment === `development` && e.subject === e.attributes.user_id; -} -function buildUserPrincipalRequiredMessage(e, t, n, r) { - let i; - return i = n === void 0 ? `it was invoked outside an eve context, so no authenticated user can be resolved.` : r == null ? `the active session has no authenticated user.` : t.vercelConnect !== void 0 && r.authenticator === `local-dev` ? `the local request fell back to local development access instead of authenticating a Vercel user. Ensure this directory is linked and the Vercel CLI can mint a Vercel OIDC token, then retry.` : `the active session is scoped to "${r.principalType}", not an authenticated user.`, `Connection "${e}" is user-scoped, but ${i} User-scoped connections require route auth that resolves an authenticated user. If this connection should use credentials shared by the agent instead, configure it as an app-scoped connection.`; -} -//#endregion -//#region node_modules/eve/dist/src/runtime/connections/scoped-authorization.js -const LOCAL_HTTP_VERCEL_CONNECT_HOSTNAMES = /* @__PURE__ */ new Set([`127.0.0.1`, `[::1]`]); -async function resolveScopedToken(t) { - let { scope: n, authorization: r, connection: i } = t, a = contextStorage.getStore(), o = resolveConnectionPrincipal(n, r, a); - if (a === void 0) return await r.getToken({ - connection: i, - principal: o - }); - let u = principalKey(o), d = readCachedToken(a, n, u); - if (d !== void 0) return d; - let f = await r.getToken({ - connection: i, - principal: o - }); - return writeCachedToken(a, n, u, f), f; -} -async function evictScopedToken(t) { - let { scope: n, authorization: r, connection: i } = t, a = contextStorage.getStore(); - if (a === void 0) return; - let s; - try { - s = resolveConnectionPrincipal(n, r, a), evictCachedToken(a, n, principalKey(s)); - } catch { - return; - } - try { - await r.evict?.({ - connection: i, - principal: s - }); - } catch {} -} -async function completeScopedAuthorization(e) { - let { scope: r, authorization: i, connection: o } = e; - if (!supportsInteractiveAuthorization(i)) return !1; - let s = getAuthorizationResult(r); - if (s === void 0) return !1; - let u = i, d = loadContext(), f = resolveConnectionPrincipal(r, u, d), p = await u.completeAuthorization({ - callbackUrl: s.hookUrl, - connection: o, - principal: f, - resume: s.resume, - callback: s.callback - }); - return writeCachedToken(d, r, principalKey(f), p), !0; -} -async function startScopedAuthorization(e) { - let { scope: t, authorization: n, connection: o } = e; - if (!supportsInteractiveAuthorization(n)) return; - let s = getHookUrl(t); - if (s === void 0) return; - let c = n, l = resolveConnectionPrincipal(t, c), u = resolveAuthorizationCallbackUrl({ - authorization: n, - callbackUrl: s - }), { challenge: d, resume: f } = await c.startAuthorization({ - callbackUrl: u, - connection: o, - principal: l - }); - return requestAuthorization([{ - challenge: stampChallengeDisplayName(d, n), - hookUrl: u, - name: t, - resume: f - }]); -} -function resolveAuthorizationCallbackUrl(e) { - if (e.authorization.vercelConnect === void 0) return e.callbackUrl; - let t; - try { - t = new URL(e.callbackUrl); - } catch { - return e.callbackUrl; - } - return t.protocol !== `http:` || !LOCAL_HTTP_VERCEL_CONNECT_HOSTNAMES.has(t.hostname) ? e.callbackUrl : (t.hostname = `localhost`, t.toString()); -} -function stampChallengeDisplayName(e, t) { - let n = t.displayName ?? e.displayName; - return n === e.displayName ? e : { - ...e, - displayName: n - }; -} -//#endregion -//#region node_modules/eve/dist/src/runtime/connections/validate-authorization.js -function validateAuthorizationSpec(e, t = `auth`) { - if (typeof e != `object` || !e) return `The "${t}" field must be an object with a "getToken" method.`; - let n = e; - if (typeof n.getToken != `function`) return `The "${t}.getToken" field must be a function returning Promise<{ token }>.`; - let r = n.startAuthorization !== void 0, i = n.completeAuthorization !== void 0; - if (!r && !i && n.principalType !== void 0 && n.principalType !== `app` && n.principalType !== `user`) return `The "${t}.principalType" field must be "app" or "user".`; - if (r !== i) return `The "${t}" field must provide either both "startAuthorization" and "completeAuthorization" (interactive OAuth) or neither (getToken-only). Got only "${r ? `startAuthorization` : `completeAuthorization`}".`; - if (r && typeof n.startAuthorization != `function`) return `The "${t}.startAuthorization" field must be a function when provided.`; - if (i && typeof n.completeAuthorization != `function`) return `The "${t}.completeAuthorization" field must be a function when provided.`; - if (r && n.principalType !== `user`) return `Interactive authorization (startAuthorization + completeAuthorization) is restricted to "principalType": "user" in v1. App-level credentials must use a getToken-only definition.`; - if (n.displayName !== void 0 && (typeof n.displayName != `string` || n.displayName.length === 0)) return `The "${t}.displayName" field must be a non-empty string when provided.`; -} -function normalizeAuthorizationSpec(e, t, n = `auth`) { - let r = validateAuthorizationSpec(e, n); - if (r !== void 0) throw Error(`${t} ${r}`); - let i = e, a = extractVercelConnectMarker(i.vercelConnect), o = i.displayName, s = typeof i.evict == `function` ? i.evict : void 0; - if (i.startAuthorization !== void 0 && i.completeAuthorization !== void 0) { - let e = { - completeAuthorization: i.completeAuthorization, - getToken: i.getToken, - principalType: `user`, - startAuthorization: i.startAuthorization - }; - return a !== void 0 && (e = { - ...e, - vercelConnect: a - }), o !== void 0 && (e = { - ...e, - displayName: o - }), s !== void 0 && (e = { - ...e, - evict: s - }), e; - } - let c = { - getToken: i.getToken, - principalType: i.principalType ?? `app` - }; - return a !== void 0 && (c = { - ...c, - vercelConnect: a - }), o !== void 0 && (c = { - ...c, - displayName: o - }), s !== void 0 && (c = { - ...c, - evict: s - }), c; -} -function extractVercelConnectMarker(e) { - if (typeof e != `object` || !e) return; - let t = e.connector; - if (!(typeof t != `string` || t.length === 0)) return { connector: t }; -} -//#endregion -//#region node_modules/eve/dist/src/runtime/connections/resolve-authorization.js -const ConnectionAuthorizationResolversKey = new ContextKey(`eve.connectionAuthorizationResolvers`); -async function resolveConnectionAuthorization(t, n) { - let r = t.authorization; - if (r === void 0 || typeof r != `function`) return r; - let i = contextStorage.getStore(); - if (i === void 0) return await resolveDynamicAuthorization(t, n); - let a = getResolverCache(i), o = a.get(t); - return o === void 0 && (o = resolveDynamicAuthorization(t, n), a.set(t, o)), await o; -} -async function resolveDynamicAuthorization(e, n) { - let i = e.authorization; - return typeof i == `function` ? normalizeAuthorizationSpec(await i(n ?? buildCallbackContext()), `Connection "${e.connectionName}" auth resolver:`) : i; -} -function getResolverCache(e) { - let t = e.get(ConnectionAuthorizationResolversKey); - if (t !== void 0) return t; - let n = /* @__PURE__ */ new Map(); - return e.setVirtualContext(ConnectionAuthorizationResolversKey, n), n; -} -//#endregion -//#region node_modules/eve/dist/src/runtime/framework-tools/connection-search-dynamic.js -const logger = createLogger(`framework.connection-search-dynamic`); -const CONNECTION_SEARCH_OUTPUT_SCHEMA = { - items: { - additionalProperties: !1, - properties: { - connection: { type: `string` }, - description: { type: `string` }, - error: { type: `string` }, - inputSchema: { type: `object` }, - needsAuthorization: { type: `boolean` }, - outputSchema: { type: `object` }, - qualifiedName: { type: `string` }, - tool: { type: `string` } - }, - required: [`connection`, `description`], - type: `object` - }, - type: `array` -}; -const ConnectionSearchResultsKey = new ContextKey(`eve.connectionSearchResults`); -function qualifiedConnectionToolName(e, t) { - return `${e}__${t}`; -} -function tokenize(e) { - return e.toLowerCase().split(/[\s_\-./]+/).filter((e) => e.length > 1); -} -function scoreMatch(e, t) { - let n = tokenize(t.name), r = tokenize(t.description), i = 0; - for (let t of e) { - for (let e of n) (e.includes(t) || t.includes(e)) && (i += 3); - for (let e of r) (e.includes(t) || t.includes(e)) && (i += 1); - } - return i; -} -async function resolveInteractiveAuth(e, t) { - let n = e.getConnections().find((e) => e.connectionName === t); - if (n === void 0) return; - let r = await resolveConnectionAuthorization(n); - if (supportsInteractiveAuthorization(r)) return r; -} -async function completePendingAuthorizations(e) { - let n = loadContext(), r = /* @__PURE__ */ new Set(); - for (let t of e.getConnections()) { - let i = getAuthorizationResult(t.connectionName); - if (!i) continue; - let a = await resolveInteractiveAuth(e, t.connectionName); - if (!a) continue; - let o = resolveConnectionPrincipal(t.connectionName, a), c = await a.completeAuthorization({ - callbackUrl: i.hookUrl, - connection: { url: t.url ?? `` }, - principal: o, - resume: i.resume, - callback: i.callback - }); - writeCachedToken(n, t.connectionName, principalKey(o), c), r.add(t.connectionName); - } - return r; -} -async function executeConnectionSearch(e) { - let n = loadContext(), i = n.get(ConnectionRegistryKey); - if (i === void 0) return []; - let s = await completePendingAuthorizations(i), l = e.limit ?? 10, u = tokenize(e.keywords), d = [], f = [], m = e.connection !== void 0 && e.connection !== `` ? i.getConnections().filter((t) => t.connectionName === e.connection) : i.getConnections(), h = []; - for (let e of m) { - let t; - try { - t = await i.getClient(e.connectionName).getToolMetadata(); - } catch (t) { - if (isConnectionAuthorizationRequiredError(t)) { - if (s.has(e.connectionName)) { - logger.warn(`connection still unauthorized after authorization`, { connection: e.connectionName }), f.push({ - connection: e.connectionName, - description: e.description, - error: `Authorization for "${e.connectionName}" did not take effect; the token was rejected after sign-in.` - }); - continue; - } - let t = await resolveInteractiveAuth(i, e.connectionName); - if (t) { - let n = getHookUrl(e.connectionName); - if (n) { - let r = resolveConnectionPrincipal(e.connectionName, t), i = resolveAuthorizationCallbackUrl({ - authorization: t, - callbackUrl: n - }); - try { - let { challenge: n, resume: a } = await t.startAuthorization({ - callbackUrl: i, - connection: { url: e.url ?? `` }, - principal: r - }); - h.push({ - name: e.connectionName, - challenge: stampChallengeDisplayName(n, t), - hookUrl: i, - resume: a - }); - } catch (t) { - logger.warn(`startAuthorization failed`, { - connection: e.connectionName, - error: t instanceof Error ? t : Error(String(t)) - }); - } - } - } - f.push({ - connection: e.connectionName, - description: e.description, - needsAuthorization: !0 - }); - continue; - } - if (isConnectionAuthorizationFailedError(t)) { - logger.warn(`connection authorization failed`, { - connection: e.connectionName, - reason: t.reason, - retryable: t.retryable, - error: t - }), f.push({ - connection: e.connectionName, - description: e.description, - error: `Authorization failed for ${e.connectionName}: ${t.message}` - }); - continue; - } - let n = t instanceof Error ? t.message : `unknown error`; - logger.warn(`failed to load connection tools`, { - connection: e.connectionName, - error: t instanceof Error ? t : Error(n) - }), f.push({ - connection: e.connectionName, - description: e.description, - error: `Failed to load tools for "${e.connectionName}": ${n}` - }); - continue; - } - for (let n of t) { - let t = scoreMatch(u, n); - t > 0 && d.push({ - item: { - connection: e.connectionName, - description: n.description, - inputSchema: n.inputSchema, - outputSchema: n.outputSchema, - qualifiedName: qualifiedConnectionToolName(e.connectionName, n.name), - tool: n.name - }, - score: t - }); - } - } - if (h.length > 0) return requestAuthorization(h); - d.sort((e, t) => t.score - e.score); - let g = d.slice(0, l).map((e) => e.item); - if (g.length > 0) { - let e = [...g, ...f], t = n.get(ConnectionSearchResultsKey) ?? [], r = new Map(t.map((e) => [e.qualifiedName, e])); - for (let e of g) e.qualifiedName && r.set(e.qualifiedName, e); - return n.set(ConnectionSearchResultsKey, [...r.values()]), e; - } - return m.map((e) => f.find((t) => t.connection === e.connectionName) || { - connection: e.connectionName, - description: e.description - }); -} -function extractDiscoveredTools(e) { - let t = /* @__PURE__ */ new Map(); - for (let n of e) { - if (n.role !== `tool`) continue; - let e = n.content; - for (let n of e) { - if (n.type !== `tool-result` || n.toolName !== `connection_search`) continue; - let e = n.output; - if (e == null) continue; - let r = typeof e == `object` && `type` in e && `value` in e ? e.value : e; - if (Array.isArray(r)) for (let e of r) e.tool && e.qualifiedName && t.set(e.qualifiedName, e); - } - } - return [...t.values()]; -} -function createConnectionSearchEvents() { - return { "step.started": async (e, n) => { - let a = loadContext().get(ConnectionRegistryKey); - if (!a || a.getConnections().length === 0) return null; - let l = a.getConnections().map((e) => e.connectionName), u = extractDiscoveredTools(n.messages), p = loadContext().get(ConnectionSearchResultsKey) ?? [], h = /* @__PURE__ */ new Map(); - for (let e of p) e.qualifiedName && h.set(e.qualifiedName, e); - for (let e of u) e.qualifiedName && h.set(e.qualifiedName, e); - let g = [...h.values()], _ = {}; - _.connection_search = { - description: `Search for tools across your connections. Discovered tools become directly callable by their qualified name (e.g. \`linear__list_issues\`) in your next response. Available connections: ${l.join(`, `)}.`, - inputSchema: { - type: `object`, - additionalProperties: !1, - properties: { - keywords: { - description: `Search keywords and expanded aliases. Distill intent into keywords; avoid stop words like 'a', 'the', 'in'.`, - type: `string` - }, - connection: { - description: `Optional: limit search to a specific connection name.`, - type: `string` - }, - limit: { - description: `Max results to return. Default 10.`, - type: `number` - } - }, - required: [`keywords`] - }, - async execute(e) { - return executeConnectionSearch(e); - }, - outputSchema: CONNECTION_SEARCH_OUTPUT_SCHEMA - }; - for (let e of g) { - let n = e.connection, l = e.tool, u = a.getConnectionApproval(n); - _[qualifiedConnectionToolName(n, l)] = { - description: e.description, - inputSchema: e.inputSchema ?? { type: `object` }, - approval: u, - outputSchema: e.outputSchema, - async execute(e) { - let a = loadContext().get(ConnectionRegistryKey), u = a.getConnections().find((e) => e.connectionName === n), p = await resolveInteractiveAuth(a, n), m = !1; - if (p) { - let e = getAuthorizationResult(n); - if (e) { - m = !0; - let r = loadContext(), i = resolveConnectionPrincipal(n, p), a = await p.completeAuthorization({ - callbackUrl: e.hookUrl, - connection: { url: u?.url ?? `` }, - principal: i, - resume: e.resume, - callback: e.callback - }); - writeCachedToken(r, n, principalKey(i), a); - } - } - try { - return await a.getClient(n).executeTool(l, e); - } catch (e) { - if (!isConnectionAuthorizationRequiredError(e) || !p) throw e; - if (m) throw new ConnectionAuthorizationFailedError(n, { - retryable: !1, - reason: `token_rejected_after_authorization`, - message: `Connection "${n}" rejected the token immediately after authorization.` - }); - let t = getHookUrl(n); - if (!t) throw e; - let r = resolveConnectionPrincipal(n, p), a = resolveAuthorizationCallbackUrl({ - authorization: p, - callbackUrl: t - }), { challenge: s, resume: l } = await p.startAuthorization({ - callbackUrl: a, - connection: { url: u?.url ?? `` }, - principal: r - }); - return requestAuthorization([{ - name: n, - challenge: stampChallengeDisplayName(s, p), - hookUrl: a, - resume: l - }]); - } - } - }; - } - return _; - } }; -} -function createConnectionSearchResolver() { - let e = createConnectionSearchEvents(); - return { - slug: `connection`, - eventNames: Object.keys(e), - events: e, - sourceId: `eve:connection-search-dynamic`, - sourceKind: `module`, - logicalPath: `eve:framework/connection-search-dynamic` - }; -} -//#endregion -//#region node_modules/eve/dist/src/runtime/resolve-helpers.js -var ResolveAgentError = class extends Error { - logicalPath; - sourceId; - constructor(e, t = {}) { - super(e), this.name = `ResolveAgentError`, t.logicalPath !== void 0 && (this.logicalPath = t.logicalPath), t.sourceId !== void 0 && (this.sourceId = t.sourceId); - } -}; -function createResolvedModuleSourceRef(e) { - return { - exportName: e.exportName, - logicalPath: e.logicalPath, - sourceId: e.sourceId, - sourceKind: `module` - }; -} -async function loadResolvedModuleExport(n) { - let r = n.nodeId ?? ROOT_COMPILED_AGENT_NODE_ID, i = n.moduleMap.nodes[r]?.modules[n.definition.sourceId]; - if (i === void 0) throw new ResolveAgentError(`Missing compiled module namespace for ${n.kindLabel} source "${n.definition.sourceId}" in node "${r}".`, { - logicalPath: n.definition.logicalPath, - sourceId: n.definition.sourceId - }); - return await materializeAuthoredModuleExport(getAuthoredModuleExport(expectObjectRecord(i, `Missing compiled module namespace for ${n.kindLabel} source "${n.definition.sourceId}" in node "${r}".`), { - exportName: n.definition.exportName, - logicalPath: n.definition.logicalPath - })); -} -//#endregion -//#region node_modules/eve/dist/src/internal/authored-definition/channel.js -function normalizeChannelDefinition(e, t) { - if (!isCompiledChannel(e)) throw Error(`${t} Use \`defineChannel({ routes, ... })\` (or a wrapper like \`slackChannel\` / \`eveChannel\`) — bare \`{ fetch, receive? }\` channel objects are no longer supported.`); - return e; -} -//#endregion -//#region node_modules/eve/dist/src/runtime/resolve-channel.js -async function resolveChannelDefinition(r, i, a) { - try { - let t = normalizeChannelDefinition(await loadResolvedModuleExport({ - definition: r, - kindLabel: `channel`, - moduleMap: i, - nodeId: a - }), `Expected the channel export "${r.exportName ?? `default`}" from "${r.logicalPath}" to match the public eve shape.`), n = createResolvedModuleSourceRef({ - exportName: r.exportName, - logicalPath: r.logicalPath, - sourceId: r.sourceId - }), o = t.routes.find((e) => e.method.toUpperCase() === r.method.toUpperCase() && e.path === r.urlPath), s = `channel:${r.name}`; - setChannelInstrumentationKind(t, s); - let c = t.adapter; - c && c.kind !== HTTP_ADAPTER_KIND && (c.kind = s); - let l = resolveHttpRoute(r, o), u = resolveWebSocketRoute(r, o); - return { - name: r.name, - method: r.method, - urlPath: r.urlPath, - cors: r.cors, - fetch: async (e, t) => l ? l.handler(e, t) : Response.json({ - error: `No matching route handler.`, - ok: !1 - }, { status: 404 }), - handler: l?.handler, - websocket: u?.handler, - receive: t.receive, - definition: t, - adapter: c, - ...n - }; - } catch (e) { - throw e instanceof ResolveAgentError ? e : new ResolveAgentError(`Failed to attach the channel definition from "${r.logicalPath}": ${toErrorMessage(e)}`, { - logicalPath: r.logicalPath, - sourceId: r.sourceId - }); - } -} -function resolveHttpRoute(e, t) { - if (!(t === void 0 || e.method === `WEBSOCKET` || !isHttpRouteDefinition(t))) return t; -} -function resolveWebSocketRoute(e, t) { - if (!(t === void 0 || e.method !== `WEBSOCKET` || !isWebSocketRouteDefinition(t))) return t; -} -//#endregion -//#region node_modules/eve/dist/src/public/tool-result-narrowing.js -const DEFINITION_KEY = Symbol.for(`eve.definition-source-key`); -const REGISTRY_SYMBOL = Symbol.for(`eve.definition-source-registry`); -const registryContainer = globalThis; -registryContainer[REGISTRY_SYMBOL] === void 0 && (registryContainer[REGISTRY_SYMBOL] = /* @__PURE__ */ new Map()); -const definitionSourceRegistry = registryContainer[REGISTRY_SYMBOL]; -function stampDefinitionKey(t, n) { - Object.defineProperty(t, DEFINITION_KEY, { - configurable: !0, - value: n - }); -} -function registerDefinitionSource(e, t) { - let n = definitionSourceRegistry.get(e); - if (n !== void 0 && !sameDefinitionSourceEntry(n, t)) { - n.kind !== `ambiguous` && console.warn([ - `eve could not assign a unique toolResultFrom identity for ${JSON.stringify(e)}.`, - `Conflicting definitions: ${formatDefinitionSourceForWarning(n)} and ${formatDefinitionSourceForWarning(t)}.`, - `Multiple authored definitions share that fallback identity, so toolResultFrom will not match through it.`, - `Use the original definition object loaded by eve so source-derived identity can be used instead.` - ].join(` `)), definitionSourceRegistry.set(e, { kind: `ambiguous` }); - return; - } - definitionSourceRegistry.set(e, t); -} -function sameDefinitionSourceEntry(e, t) { - return e.kind === t.kind ? e.name === t.name : !1; -} -function formatDefinitionSourceForWarning(e) { - return e.logicalPath === void 0 ? `${e.kind} "${e.name}"` : `${e.kind} "${e.name}" from "${e.logicalPath}"`; -} -//#endregion -//#region node_modules/eve/dist/src/runtime/resolve-connection.js -async function resolveConnectionDefinition(t, n, r) { - try { - let i = expectObjectRecord(await loadResolvedModuleExport({ - definition: t, - kindLabel: `connection`, - moduleMap: n, - nodeId: r - }), `Expected the connection export "${t.exportName ?? `default`}" from "${t.logicalPath}" to return an object.`), a = { - kind: `connection`, - logicalPath: t.logicalPath, - name: t.connectionName - }, o = `connection-source:${t.sourceId}`; - stampDefinitionKey(i, o), registerDefinitionSource(o, a), registerDefinitionSource(`connection:${t.url}`, a); - let s = i.auth !== void 0, c = i.headers !== void 0, l = t.protocol === `openapi` ? i.operations : i.tools, u = { - connectionName: t.connectionName, - description: t.description, - exportName: t.exportName, - logicalPath: t.logicalPath, - protocol: t.protocol, - sourceId: t.sourceId, - sourceKind: `module`, - url: t.url - }; - if (s) if (typeof i.auth == `function`) u.authorization = i.auth; - else try { - u.authorization = normalizeAuthorizationSpec(i.auth, `Connection "${t.connectionName}" at "${t.logicalPath}":`); - } catch (e) { - throw new ResolveAgentError(toErrorMessage(e), { - logicalPath: t.logicalPath, - sourceId: t.sourceId - }); - } - return c && (u.headers = i.headers), l !== void 0 && (u.tools = l), t.protocol === `openapi` && i.spec !== void 0 && (u.spec = i.spec), typeof i.approval == `function` && (u.approval = i.approval), u; - } catch (e) { - throw e instanceof ResolveAgentError ? e : new ResolveAgentError(`Failed to resolve connection "${t.connectionName}" from "${t.logicalPath}": ${toErrorMessage(e)}`, { - logicalPath: t.logicalPath, - sourceId: t.sourceId - }); - } -} -//#endregion -//#region node_modules/eve/dist/src/runtime/resolve-hook.js -async function resolveHookDefinition(a, o, s) { - try { - let n = expectObjectRecord(await loadResolvedModuleExport({ - definition: a, - kindLabel: `hook`, - moduleMap: o, - nodeId: s - }), describe$4(a, `to return an object`)), i = {}, c = n.events; - if (c !== void 0) { - let n = expectObjectRecord(c, describe$4(a, "to expose `events` as an object")); - for (let [t, r] of Object.entries(n)) r !== void 0 && (i[t] = expectFunction(r, describe$4(a, `to provide a function for "events.${t}"`))); - } - return { - events: i, - exportName: a.exportName, - logicalPath: a.logicalPath, - slug: a.slug, - sourceId: a.sourceId, - sourceKind: `module` - }; - } catch (e) { - throw e instanceof ResolveAgentError ? e : new ResolveAgentError(`Failed to attach hook handlers from "${a.logicalPath}": ${toErrorMessage(e)}`, { - logicalPath: a.logicalPath, - sourceId: a.sourceId - }); - } -} -function describe$4(e, t) { - return `Expected the hook export "${e.exportName ?? `default`}" from "${e.logicalPath}" ${t}.`; -} -//#endregion -//#region node_modules/eve/dist/src/execution/sandbox/lazy-backend.js -function lazyBackend(e) { - let t; - function resolve() { - return t === void 0 && (t = e()), t; - } - return { - get name() { - return resolve().name; - }, - create(e) { - return resolve().create(e); - }, - prewarm(e) { - return resolve().prewarm(e); - } - }; -} -//#endregion -//#region node_modules/eve/dist/src/execution/sandbox/bindings/docker-cli.js -var DockerUnavailableError = class extends Error { - constructor(e) { - super("The Docker sandbox backend requires Docker, but the `docker` CLI was not found. Install and start Docker Desktop, OrbStack, Colima, or another runtime exposing a Docker-compatible `docker` CLI (or point EVE_DOCKER_PATH at one, e.g. Podman). Alternatively use microsandbox(), the dependency-free justbash(), vercel(), or defaultSandbox() to pick by availability.", { cause: e }), this.name = `DockerUnavailableError`; - } -}; -var DockerDaemonUnavailableError = class extends Error { - constructor(e) { - super(`The Docker sandbox backend requires a running Docker daemon, but it is not reachable. Start Docker Desktop (or your Docker-compatible runtime) and retry. Alternatively use microsandbox(), the dependency-free justbash() (installed automatically by \`eve dev\`, or \`pnpm add -D just-bash\`), vercel(), or defaultSandbox() to pick by availability. Docker reported: ${e}`), this.name = `DockerDaemonUnavailableError`; - } -}; -async function assertDockerDaemonAvailable(e) { - let t = await e.run([ - `version`, - `--format`, - `{{.Server.Version}}` - ]); - if (t.exitCode !== 0) throw new DockerDaemonUnavailableError(firstLine(t.stderr) || `exit ${t.exitCode}`); -} -function resolveDockerExecutable() { - let e = process.env.EVE_DOCKER_PATH?.trim(); - return e !== void 0 && e.length > 0 ? e : `docker`; -} -let cachedDockerAvailability; -function isDockerDaemonAvailableSync() { - return cachedDockerAvailability ??= probeDockerDaemonSync(), cachedDockerAvailability; -} -function probeDockerDaemonSync() { - try { - return spawnSync(resolveDockerExecutable(), [ - `version`, - `--format`, - `{{.Server.Version}}` - ], { - stdio: `ignore`, - timeout: 5e3 - }).status === 0; - } catch { - return !1; - } -} -function createDockerCli() { - return { - async run(t, n = {}) { - throwIfAborted(n.signal); - let r = spawn(resolveDockerExecutable(), t, { - signal: n.signal, - stdio: [ - n.stdin === void 0 ? `ignore` : `pipe`, - `pipe`, - `pipe` - ] - }), i = [], a = []; - r.stdout?.on(`data`, (e) => i.push(e)), r.stderr?.on(`data`, (e) => a.push(e)), n.stdin !== void 0 && r.stdin?.end(n.stdin); - let o = await new Promise((e, t) => { - r.on(`error`, (e) => t(adaptSpawnError(e))), r.on(`close`, (t) => e(t ?? 1)); - }), s = Buffer.concat(i); - return { - exitCode: o, - stderr: Buffer.concat(a).toString(`utf8`), - stdout: s.toString(`utf8`), - stdoutBytes: s - }; - }, - stream(t, r = {}) { - throwIfAborted(r.signal); - let i = spawn(resolveDockerExecutable(), t, { - signal: r.signal, - stdio: [ - `ignore`, - `pipe`, - `pipe` - ] - }), a = new Promise((e, t) => { - i.on(`error`, (e) => t(adaptSpawnError(e))), i.on(`close`, (t) => e(t ?? 1)); - }); - return a.catch(() => {}), { - stdout: Readable.toWeb(i.stdout), - stderr: Readable.toWeb(i.stderr), - async wait() { - return { exitCode: await a }; - }, - async kill() { - i.kill(`SIGKILL`), await a.catch(() => {}); - } - }; - } - }; -} -function adaptSpawnError(e) { - return e.code === `ENOENT` ? new DockerUnavailableError(e) : e.code === `ABORT_ERR` ? new DOMException(`The operation was aborted.`, `AbortError`) : e; -} -function throwIfAborted(e) { - if (e?.aborted) throw new DOMException(`The operation was aborted.`, `AbortError`); -} -function firstLine(e) { - return e.split(` -`, 1)[0]?.trim() ?? ``; -} -//#endregion -//#region node_modules/eve/dist/src/execution/sandbox/bindings/docker-utils.js -function expectDockerSuccess(e, t) { - if (e.exitCode !== 0) { - let n = e.stderr.trim() || e.stdout.trim() || `exit code ${e.exitCode}`; - throw Error(`Failed to ${t}: ${n}`); - } -} -//#endregion -//#region node_modules/eve/dist/src/execution/sandbox/development-run.js -const EVE_DEVELOPMENT_SANDBOX_RUN_ID_ENV = `EVE_DEVELOPMENT_SANDBOX_RUN_ID`; -const EVE_DEVELOPMENT_SANDBOX_METADATA_PATH_TAG = `eve.metadataPath`; -const EVE_DEVELOPMENT_SANDBOX_RUN_ID_TAG = `devRunId`; -const initializedBackendsByRunId = /* @__PURE__ */ new Map(); -function getDevelopmentSandboxRunId() { - let e = process.env[EVE_DEVELOPMENT_SANDBOX_RUN_ID_ENV]; - return e === void 0 || e.trim() === `` ? void 0 : e; -} -function withDevelopmentSandboxTags(e) { - let t = getDevelopmentSandboxRunId(); - return t === void 0 ? e : { - ...e, - [EVE_DEVELOPMENT_SANDBOX_RUN_ID_TAG]: t - }; -} -function withDevelopmentSandboxMetadataPathTag(e, t) { - return getDevelopmentSandboxRunId() === void 0 ? e : { - ...e, - [EVE_DEVELOPMENT_SANDBOX_METADATA_PATH_TAG]: t - }; -} -function markDevelopmentSandboxBackendInitialized(e) { - let t = getDevelopmentSandboxRunId(); - if (t === void 0) return; - let n = initializedBackendsByRunId.get(t); - n === void 0 && (n = /* @__PURE__ */ new Set(), initializedBackendsByRunId.set(t, n)), n.add(e); -} -//#endregion -//#region node_modules/eve/dist/src/execution/sandbox/stream-utils.js -async function streamToBuffer(e) { - let t = []; - for await (let n of e) t.push(n); - return Buffer.concat(t); -} -function bufferToStream(e) { - return new ReadableStream({ start(t) { - t.enqueue(e), t.close(); - } }); -} -//#endregion -//#region node_modules/eve/dist/src/execution/sandbox/bindings/local-backend-utils.js -function createFileBackedInternalSandboxSession(e) { - return { - id: e.id, - resolvePath: resolveWorkspacePath, - async spawn(t) { - return await e.sandbox.spawn(t); - }, - async readFile(t) { - let n = await e.sandbox.readFileBytes(t.path); - return n === null ? null : bufferToStream(n); - }, - async removePath(t) { - await e.sandbox.removePath(t); - }, - async writeFile(t) { - let n = await streamToBuffer(t.content); - await e.sandbox.writeFiles([{ - content: n, - path: t.path - }]); - } - }; -} -function resolveWorkspacePath(e) { - return e.startsWith(`/`) ? e : `${WORKSPACE_ROOT$1}/${e}`; -} -async function pathExists$1(e) { - try { - return await access(e), !0; - } catch { - return !1; - } -} -async function copyDirectoryAtomically(t, n) { - let i = `${n}.${randomUUID()}.tmp`; - await rm(i, { - force: !0, - recursive: !0 - }), await mkdir(dirname(n), { recursive: !0 }); - try { - await cp(t, i, { recursive: !0 }), await rename(i, n); - } catch (e) { - if (await rm(i, { - force: !0, - recursive: !0 - }).catch(() => {}), await pathExists$1(n)) return; - throw e; - } -} -async function touchDirectory(e) { - let t = /* @__PURE__ */ new Date(); - await utimes(e, t, t); -} -function resolveLocalBackendTemplateRootPath(e, n, r) { - return join(resolveLocalBackendTemplatesDirectory(e, n), r); -} -function resolveLocalBackendTemplatesDirectory(e, n) { - return join(e, n, `templates`); -} -function resolveLocalBackendSessionRootPath(e, n, r) { - return join(e, n, `sessions`, r); -} -async function writeSandboxSeedFiles(e, t) { - for (let n of t) typeof n.content == `string` ? await e.writeTextFile({ - content: n.content, - path: n.path - }) : await e.writeBinaryFile({ - content: n.content, - path: n.path - }); -} -//#endregion -//#region node_modules/eve/dist/src/execution/sandbox/bindings/docker-base-setup.js -function buildDockerBaseSetupScript() { - return [ - `set -e`, - `mkdir -p ${WORKSPACE_ROOT$1}`, - `command -v bash >/dev/null 2>&1 || { echo "the sandbox image must provide bash" >&2; exit 70; }` - ].join(` -`); -} -//#endregion -//#region node_modules/eve/dist/src/execution/sandbox/bindings/docker-container.js -const DOCKER_SANDBOX_LABEL = `eve.sandbox`; -const DOCKER_KEEPALIVE_ARGS = [`-c`, `sleep 2147483647`]; -async function startDockerContainer(t) { - let i = [ - `run`, - `-d`, - `--name`, - t.containerName, - `--label`, - `${DOCKER_SANDBOX_LABEL}=1`, - `--label`, - `${DOCKER_SANDBOX_LABEL}.role=${t.role}` - ]; - for (let [e, n] of Object.entries(withDevelopmentSandboxTags(t.tags) ?? {})) i.push(`--label`, `${DOCKER_SANDBOX_LABEL}.tag.${e}=${n}`); - for (let [e, n] of Object.entries(t.options.env)) i.push(`-e`, `${e}=${n}`); - t.initialNetworkPolicy === `deny-all` && i.push(`--network`, `none`), i.push(`--workdir`, WORKSPACE_ROOT$1, `--entrypoint`, `/bin/sh`, t.image, ...DOCKER_KEEPALIVE_ARGS), expectDockerSuccess(await t.cli.run(i), `start sandbox container "${t.containerName}" from "${t.image}"`); -} -async function runDockerBaseSetup(e, r) { - expectDockerSuccess(await e.run([ - `exec`, - `--user`, - `root`, - r, - `/bin/sh`, - `-c`, - buildDockerBaseSetupScript() - ]), `prepare base runtime in sandbox container "${r}"`); -} -//#endregion -//#region node_modules/eve/dist/src/execution/sandbox/bindings/docker-network.js -async function setDockerNetworkPolicy(e, t, n) { - if (n !== `allow-all` && n !== `deny-all`) throw Error(`The local Docker sandbox backend supports only the "allow-all" and "deny-all" network policies. Domain-level allow-lists and credential brokering require the Vercel backend (vercel()) or microsandbox().`); - let r = await e.run([ - `container`, - `inspect`, - `--format`, - `{{json .NetworkSettings.Networks}}`, - t - ]); - expectDockerSuccess(r, `inspect networks of sandbox container "${t}"`); - let i = Object.keys(JSON.parse(r.stdout.trim() === `` ? `{}` : r.stdout)); - if (n === `deny-all`) { - for (let n of i) expectDockerSuccess(await e.run([ - `network`, - `disconnect`, - `--force`, - n, - t - ]), `disconnect sandbox container "${t}" from network "${n}"`); - return; - } - i.includes(`bridge`) || (i.includes(`none`) && expectDockerSuccess(await e.run([ - `network`, - `disconnect`, - `--force`, - `none`, - t - ]), `detach sandbox container "${t}" from the none network`), expectDockerSuccess(await e.run([ - `network`, - `connect`, - `bridge`, - t - ]), `connect sandbox container "${t}" to the bridge network`)); -} -//#endregion -//#region node_modules/eve/dist/src/execution/sandbox/bindings/docker-options.js -function resolveDockerSandboxOptions(e = {}) { - return { - env: e.env ?? {}, - image: e.image ?? `ghcr.io/vercel/eve:latest`, - networkPolicy: e.networkPolicy ?? `allow-all`, - pullPolicy: e.pullPolicy ?? `if-not-present` - }; -} -function createDockerSandboxOptionsHash(t) { - return createHash(`sha256`).update(JSON.stringify(dockerOptionsForHash(t))).digest(`hex`).slice(0, 20); -} -function dockerOptionsForHash(e) { - return { - env: sortStringRecord(e.env), - image: e.image, - networkPolicy: e.networkPolicy, - pullPolicy: e.pullPolicy - }; -} -function sortStringRecord(e) { - return Object.fromEntries(Object.entries(e).sort(([e], [t]) => e.localeCompare(t))); -} -//#endregion -//#region node_modules/eve/dist/src/execution/sandbox/bindings/docker-session.js -const DOCKER_KILL_TREE_SCRIPT = [ - `pid_file="$1"`, - `target="$(cat "$pid_file" 2>/dev/null)" || exit 0`, - `[ -n "$target" ] || exit 0`, - `kill_tree() {`, - ` local parent="$1" dir child ppid line`, - ` for dir in /proc/[0-9]*; do`, - " child=\"${dir#/proc/}\"", - ` ppid=""`, - ` while IFS= read -r line; do`, - ` case "$line" in`, - " PPid:*) ppid=\"${line#PPid:}\"; ppid=\"${ppid//[^0-9]/}\"; break ;;", - ` esac`, - ` done < "$dir/status" 2>/dev/null`, - ` [ "$ppid" = "$parent" ] && kill_tree "$child"`, - ` done`, - ` kill -9 "$parent" 2>/dev/null`, - `}`, - `kill_tree "$target"`, - `rm -f "$pid_file"`, - `exit 0` -].join(` -`); -function createDockerInternalSession(s) { - let { cli: c, containerName: l } = s; - async function killSpawnTree(e) { - await c.run([ - `exec`, - l, - `bash`, - `-c`, - DOCKER_KILL_TREE_SCRIPT, - `eve-kill-tree`, - e - ]).catch(() => {}); - } - return { - id: s.id, - resolvePath: resolveWorkspacePath, - async spawn(n) { - let r = [ - `exec`, - `-w`, - resolveWorkspacePath(n.workingDirectory ?? WORKSPACE_ROOT$1) - ]; - for (let [e, t] of Object.entries(n.env ?? {})) r.push(`-e`, `${e}=${t}`); - let i = `/tmp/.eve-sbx-spawn-${randomUUID()}.pid`, a = `echo "$$" > ${shellQuote(i)}; bash -lc ${shellQuote(n.command)}; status=$?; rm -f ${shellQuote(i)}; exit $status`; - r.push(l, `bash`, `-c`, a); - let o = c.stream(r, { signal: n.abortSignal }); - return n.abortSignal?.addEventListener(`abort`, () => void killSpawnTree(i), { once: !0 }), { - stdout: o.stdout, - stderr: o.stderr, - async wait() { - return await o.wait(); - }, - async kill() { - await killSpawnTree(i), await o.kill(); - } - }; - }, - async readFile(e) { - let t = shellQuote(e.path), r = await c.run([ - `exec`, - l, - `bash`, - `-lc`, - `if [ -e ${t} ]; then exec cat ${t}; else exit 43; fi` - ], { signal: e.abortSignal }); - return r.exitCode === 43 ? null : (expectDockerSuccess(r, `read "${e.path}" from sandbox container`), bufferToStream(r.stdoutBytes)); - }, - async removePath(e) { - let t = `${e.recursive === !0 ? `r` : ``}${e.force === !0 ? `f` : ``}`, r = [ - `exec`, - l, - `rm`, - ...t.length > 0 ? [`-${t}`] : [], - `--`, - e.path - ]; - expectDockerSuccess(await c.run(r, { signal: e.abortSignal }), `remove "${e.path}" from sandbox container`); - }, - async writeFile(e) { - let t = await streamToBuffer(e.content); - expectDockerSuccess(await c.run([ - `exec`, - `-i`, - l, - `bash`, - `-lc`, - `mkdir -p ${shellQuote(dirname$2(e.path))} && cat > ${shellQuote(e.path)}` - ], { - signal: e.abortSignal, - stdin: t - }), `write "${e.path}" into sandbox container`); - } - }; -} -//#endregion -//#region node_modules/eve/dist/src/internal/application/paths.js -function resolveSandboxCacheDirectory(e) { - return join(e, `.eve`, `sandbox-cache`); -} -//#endregion -//#region node_modules/eve/dist/src/execution/sandbox/bindings/docker-templates.js -const DOCKER_TEMPLATE_IMAGE_REPOSITORY = `eve-sandbox-template`; -function dockerTemplateImageReference(e) { - return dockerTemplateImageReferenceFromTag(dockerTemplateImageTag(e)); -} -function dockerTemplateImageReferenceFromTag(e) { - return `${DOCKER_TEMPLATE_IMAGE_REPOSITORY}:${e}`; -} -function dockerTemplateImageTag(e) { - return `${e.templateKey.toLowerCase()}-${e.optionsHash}`; -} -function resolveDockerTemplateMarkerPath(e, n) { - return join(resolveDockerTemplateMarkersDirectory(e), dockerTemplateImageTag(n)); -} -async function touchDockerTemplateMarker(t, r) { - await mkdir(dirname(t), { recursive: !0 }); - try { - let e = /* @__PURE__ */ new Date(); - await utimes(t, e, e); - } catch { - await writeFile(t, `${r}\n`); - } -} -async function dockerImageExists(e, t) { - return (await e.run([ - `image`, - `inspect`, - `--format`, - `{{.Id}}`, - t - ])).exitCode === 0; -} -async function ensureDockerBaseImage(e, t) { - if (t.pullPolicy === `always`) { - expectDockerSuccess(await e.run([`pull`, t.image]), `pull base image "${t.image}"`); - return; - } - if (!await dockerImageExists(e, t.image)) { - if (t.pullPolicy === `never`) throw Error(`The local sandbox base image "${t.image}" is not present locally and pullPolicy is "never". Pull the image manually or relax the pull policy.`); - expectDockerSuccess(await e.run([`pull`, t.image]), `pull base image "${t.image}"`); - } -} -function resolveDockerTemplateMarkersDirectory(e) { - return join(resolveSandboxCacheDirectory(e), `docker`, `templates`); -} -//#endregion -//#region node_modules/eve/dist/src/execution/sandbox/logging-session.js -function createLoggingSandboxSession(e) { - let { log: t, session: n } = e; - return { - ...n, - async run(e) { - t?.(`bootstrap run: ${formatCommand(e.command)}`); - let r = await n.run(e); - if (r.exitCode === 1) throw Error(formatBootstrapRunFailure(e.command, r)); - return r; - }, - async spawn(e) { - return t?.(`bootstrap spawn: ${formatCommand(e.command)}`), await n.spawn(e); - }, - async setNetworkPolicy(e) { - return t?.(`bootstrap set network policy: ${formatNetworkPolicy(e)}`), await n.setNetworkPolicy(e); - }, - async writeFile(e) { - return t?.(`bootstrap write file: ${e.path}`), await n.writeFile(e); - }, - async writeBinaryFile(e) { - return t?.(`bootstrap write binary file: ${e.path} (${e.content.byteLength} bytes)`), await n.writeBinaryFile(e); - }, - async writeTextFile(e) { - return t?.(`bootstrap write text file: ${e.path} (${e.content.length} chars)`), await n.writeTextFile(e); - }, - async removePath(e) { - return t?.(`bootstrap remove path: ${e.path}`), await n.removePath(e); - } - }; -} -function formatBootstrapRunFailure(e, t) { - return [ - `Sandbox bootstrap failed because sandbox.run command exited with code 1:`, - e, - ``, - `stdout:`, - formatCapturedOutput(`stdout`, t.stdout), - ``, - `stderr:`, - formatCapturedOutput(`stderr`, t.stderr) - ].join(` -`); -} -function formatCapturedOutput(t, n) { - let r = truncateTail(n); - return r.truncated ? `[${t} truncated: showing last ${r.outputLines} of ${r.totalLines} lines]\n${r.output}` : r.output; -} -function formatCommand(e) { - return truncateOneLine(e); -} -function formatNetworkPolicy(e) { - return truncateOneLine(typeof e == `string` ? e : JSON.stringify(e)); -} -function truncateOneLine(e) { - let t = e.replaceAll(/\s+/g, ` `).trim(); - return t.length <= 240 ? t : `${t.slice(0, 239)}…`; -} -//#endregion -//#region node_modules/eve/dist/src/execution/sandbox/session.js -function buildSandboxSession(n, r = async () => {}) { - async function run(e) { - let t = await n.spawn(e), [r, i, { exitCode: a }] = await Promise.all([ - collectStreamToString(t.stdout), - collectStreamToString(t.stderr), - t.wait() - ]); - return { - exitCode: a, - stderr: i, - stdout: r - }; - } - return { - id: n.id, - resolvePath(e) { - return n.resolvePath(e); - }, - run, - async spawn(e) { - return await n.spawn(e); - }, - async readFile(e) { - return await n.readFile({ - abortSignal: e.abortSignal, - path: n.resolvePath(e.path) - }); - }, - async readBinaryFile(e) { - let r = await n.readFile({ - abortSignal: e.abortSignal, - path: n.resolvePath(e.path) - }); - return r === null ? null : await streamToBuffer(r); - }, - async readTextFile(e) { - validateReadTextFileOptions(e); - let r = await n.readFile({ - abortSignal: e.abortSignal, - path: n.resolvePath(e.path) - }); - return r === null ? null : applyLineRange(decodeBytes(await streamToBuffer(r), e.encoding ?? `utf-8`), e); - }, - async writeFile(e) { - await n.writeFile({ - abortSignal: e.abortSignal, - content: e.content, - path: n.resolvePath(e.path) - }); - }, - async writeBinaryFile(t) { - await n.writeFile({ - abortSignal: t.abortSignal, - content: bufferToStream(t.content), - path: n.resolvePath(t.path) - }); - }, - async writeTextFile(t) { - let r = encodeString(t.content, t.encoding ?? `utf-8`); - await n.writeFile({ - abortSignal: t.abortSignal, - content: bufferToStream(r), - path: n.resolvePath(t.path) - }); - }, - async removePath(e) { - await n.removePath({ - abortSignal: e.abortSignal, - force: e.force, - path: n.resolvePath(e.path), - recursive: e.recursive - }); - }, - setNetworkPolicy: r - }; -} -async function collectStreamToString(e) { - let n = await streamToBuffer(e); - return new TextDecoder().decode(n); -} -function validateReadTextFileOptions(e) { - let { startLine: t, endLine: n } = e; - if (t !== void 0 && (!Number.isInteger(t) || t < 1)) throw Error(`startLine must be a positive integer (1-based).`); - if (n !== void 0 && (!Number.isInteger(n) || n < 1)) throw Error(`endLine must be a positive integer (1-based).`); - if (t !== void 0 && n !== void 0 && t > n) throw Error(`startLine must not be greater than endLine.`); -} -function splitLinesPreservingEndings(e) { - let t = [], n = 0; - for (let r = 0; r < e.length; r++) e[r] === `\r` ? r + 1 < e.length && e[r + 1] === ` -` ? (t.push(e.slice(n, r + 2)), n = r + 2, r++) : (t.push(e.slice(n, r + 1)), n = r + 1) : e[r] === ` -` && (t.push(e.slice(n, r + 1)), n = r + 1); - return n < e.length && t.push(e.slice(n)), t; -} -function applyLineRange(e, t) { - if (t.startLine === void 0 && t.endLine === void 0) return e; - let n = splitLinesPreservingEndings(e), r = n.length, i = t.startLine ?? 1, a = Math.min(t.endLine ?? r, r); - return i > r ? `` : n.slice(i - 1, a).join(``); -} -function decodeBytes(e, t) { - return t === `utf-8` || t === `utf8` ? new TextDecoder(`utf-8`, { fatal: !0 }).decode(e) : Buffer.from(e.buffer, e.byteOffset, e.byteLength).toString(t); -} -function encodeString(e, t) { - return t === `utf-8` || t === `utf8` ? new TextEncoder().encode(e) : Buffer.from(e, t); -} -//#endregion -//#region node_modules/eve/dist/src/public/definitions/sandbox-backend.js -var SandboxTemplateNotProvisionedError = class SandboxTemplateNotProvisionedError extends Error { - backendName; - templateKey; - constructor(e) { - super(`Sandbox template "${e.templateKey}" is not provisioned for backend "${e.backendName}". Run \`eve build\` or invoke \`prewarmAppSandboxes()\` before serving traffic.`), this.name = `SandboxTemplateNotProvisionedError`, this.backendName = e.backendName, this.templateKey = e.templateKey; - } - static is(e) { - return e instanceof SandboxTemplateNotProvisionedError || typeof e == `object` && !!e && e.name === `SandboxTemplateNotProvisionedError` && typeof e.backendName == `string` && typeof e.templateKey == `string`; - } -}; -//#endregion -//#region node_modules/eve/dist/src/execution/sandbox/bindings/docker.js -const DOCKER_BACKEND_NAME = `docker`; -function createDockerSandboxBackend(c = {}) { - let l = c.dockerCli ?? createDockerCli(), u = resolveDockerSandboxOptions(c.createOptions), d = createDockerSandboxOptionsHash(u), f; - function ensureDaemon() { - return f ??= assertDockerDaemonAvailable(l).catch((e) => { - throw f = void 0, e; - }), f; - } - return { - name: DOCKER_BACKEND_NAME, - async prewarm(n) { - n.log?.(`checking Docker daemon`), await ensureDaemon(); - let i = { - optionsHash: d, - templateKey: n.templateKey - }, a = dockerTemplateImageReference(i), o = resolveDockerTemplateMarkerPath(n.runtimeContext.appRoot, i); - if (n.log?.(`checking cached template image "${a}"`), await dockerImageExists(l, a)) return n.log?.(`reusing cached template image`), await touchDockerTemplateMarker(o, a), { reused: !0 }; - n.log?.(`checking base image "${u.image}"`), await ensureDockerBaseImage(l, u); - let s = `${n.templateKey}-build-${randomUUID().slice(0, 8)}`; - n.log?.(`starting template build container`), await startDockerContainer({ - cli: l, - containerName: s, - image: u.image, - initialNetworkPolicy: `allow-all`, - options: u, - role: `template-build` - }); - try { - n.log?.(`preparing base runtime inside container`), await runDockerBaseSetup(l, s), u.networkPolicy !== `allow-all` && (n.log?.(`applying network policy`), await setDockerNetworkPolicy(l, s, u.networkPolicy)); - let e = buildSandboxSession(createDockerInternalSession({ - cli: l, - containerName: s, - id: n.templateKey - }), (e) => setDockerNetworkPolicy(l, s, e)); - n.bootstrap !== void 0 && (n.log?.(`running sandbox bootstrap`), await n.bootstrap({ use: async () => createLoggingSandboxSession({ - log: n.log, - session: e - }) })), n.seedFiles.length > 0 && n.log?.(`writing ${n.seedFiles.length} seed file(s)`), await writeSandboxSeedFiles(e, n.seedFiles), n.log?.(`stopping template build container`), expectDockerSuccess(await l.run([ - `stop`, - `-t`, - `0`, - s - ]), `stop template build container "${s}"`), n.log?.(`committing template image "${a}"`), expectDockerSuccess(await l.run([ - `commit`, - `--change`, - `LABEL ${DOCKER_SANDBOX_LABEL}=1`, - `--change`, - `LABEL ${DOCKER_SANDBOX_LABEL}.role=template`, - `--change`, - `LABEL ${DOCKER_SANDBOX_LABEL}.template-key=${n.templateKey}`, - s, - a - ]), `commit sandbox template image "${a}"`), await touchDockerTemplateMarker(o, a); - } finally { - await l.run([ - `rm`, - `-f`, - s - ]).catch(() => {}); - } - return { reused: !1 }; - }, - async create(e) { - await ensureDaemon(), markDevelopmentSandboxBackendInitialized(DOCKER_BACKEND_NAME); - let r = getDockerContainerName(e.existingMetadata) ?? e.sessionKey, i = await l.run([ - `container`, - `inspect`, - `--format`, - `{{.State.Running}}`, - r - ]); - if (i.exitCode === 0) i.stdout.trim() !== `true` && expectDockerSuccess(await l.run([`start`, r]), `restart sandbox session container "${r}"`); - else { - let t; - if (e.templateKey === null) await ensureDockerBaseImage(l, u), t = u.image; - else { - let n = { - optionsHash: d, - templateKey: e.templateKey - }; - if (t = dockerTemplateImageReference(n), !await dockerImageExists(l, t)) throw new SandboxTemplateNotProvisionedError({ - backendName: DOCKER_BACKEND_NAME, - templateKey: e.templateKey - }); - await touchDockerTemplateMarker(resolveDockerTemplateMarkerPath(e.runtimeContext.appRoot, n), t); - } - try { - await startDockerContainer({ - cli: l, - containerName: r, - image: t, - initialNetworkPolicy: e.templateKey === null ? `allow-all` : u.networkPolicy, - options: u, - role: `session`, - tags: e.tags - }); - } catch (t) { - throw e.templateKey === null ? t : new SandboxTemplateNotProvisionedError({ - backendName: DOCKER_BACKEND_NAME, - templateKey: e.templateKey - }); - } - e.templateKey === null && (await runDockerBaseSetup(l, r), u.networkPolicy !== `allow-all` && await setDockerNetworkPolicy(l, r, u.networkPolicy)); - } - let a = buildSandboxSession(createDockerInternalSession({ - cli: l, - containerName: r, - id: e.sessionKey - }), (e) => setDockerNetworkPolicy(l, r, e)); - return { - session: a, - useSessionFn: async () => a, - async captureState() { - return { - backendName: DOCKER_BACKEND_NAME, - metadata: { containerName: r }, - sessionKey: e.sessionKey - }; - }, - async dispose() {} - }; - } - }; -} -function getDockerContainerName(e) { - let t = e?.containerName; - return typeof t == `string` ? t : void 0; -} -//#endregion -//#region node_modules/eve/dist/src/execution/sandbox/multiplexed-command.js -function createOutputChannel() { - let e = !1, t; - return { - stream: new ReadableStream({ - cancel() { - e = !0; - }, - start(e) { - t = e; - } - }), - close() { - e || t.close(); - }, - enqueue(n) { - e || t.enqueue(n); - }, - error(n) { - e || t.error(n); - } - }; -} -function adaptMultiplexedCommandToSandboxProcess(e) { - let t = new TextEncoder(), n = createOutputChannel(), r = createOutputChannel(), i = { - stderr: r, - stdout: n - }, a = (async () => { - try { - for await (let n of e.command.logs()) i[e.getOutput(n)].enqueue(t.encode(n.data)); - n.close(), r.close(); - } catch (e) { - throw n.error(e), r.error(e), e; - } - })(); - a.catch(() => void 0); - let o, s; - return { - stderr: r.stream, - stdout: n.stream, - wait() { - return o ??= Promise.resolve().then(async () => { - let t = await e.command.wait(); - return await a, { exitCode: t.exitCode }; - }); - }, - kill() { - return s ??= Promise.resolve().then(() => e.command.kill()); - } - }; -} -//#endregion -//#region node_modules/eve/dist/src/execution/sandbox/bindings/just-bash-runtime.js -let justBashModulePromise; -async function loadJustBashModule(e) { - return justBashModulePromise ??= loadOptionalEnginePackage({ - appRoot: e.appRoot, - autoInstall: e.autoInstall, - importModule: async () => await import(`just-bash`), - missingMessage: "The just-bash sandbox backend requires the `just-bash` package, which is not bundled with eve. Install it in your application (for example `pnpm add -D just-bash`), or use docker() / defaultSandbox() instead.", - packageName: `just-bash` - }).catch((e) => { - throw justBashModulePromise = void 0, e; - }), await justBashModulePromise; -} -async function createBashSandbox(n) { - let { ReadWriteFs: r, Sandbox: i } = await loadJustBashModule({ - appRoot: n.appRoot, - autoInstall: n.autoInstall - }), a = resolveLocalSandboxFilesystemRootPath(n.rootPath), o = resolveLocalSandboxMetadataPath(n.rootPath), s = await readLocalMetadata(o); - await mkdir(a, { recursive: !0 }); - let c = new r({ - allowSymlinks: !0, - maxFileReadSize: 2 ** 53 - 1, - root: a - }); - await ensureLocalSandboxDirectories(c); - let l = await i.create({ - cwd: WORKSPACE_ROOT$1, - env: s?.env, - fs: c, - network: { dangerouslyAllowFullInternetAccess: !0 } - }); - return { - async captureState() { - return await writeLocalMetadata(o, { - env: { ...l.bashEnvInstance.getEnv() }, - version: 1 - }), { rootPath: n.rootPath }; - }, - async dispose() { - await l.stop(); - }, - async readFileBytes(e) { - let t; - try { - t = await c.readFileBuffer(e); - } catch { - return null; - } - return Buffer.from(t); - }, - async removePath(e) { - await c.rm(e.path, { - force: e.force, - recursive: e.recursive - }); - }, - rootPath: n.rootPath, - sessionKey: n.sessionKey, - async spawn(e) { - if (e.abortSignal?.aborted) throw new DOMException(`The operation was aborted.`, `AbortError`); - let t = e.workingDirectory === void 0 ? e.command : `( cd ${shellQuote(e.workingDirectory)} && ${e.command} )`; - return adaptMultiplexedCommandToSandboxProcess({ - command: await l.runCommand({ - args: [t], - cmd: `eval`, - detached: !0, - env: e.env, - signal: e.abortSignal - }), - getOutput: (e) => e.type - }); - }, - async writeFiles(t) { - for (let n of t) { - let t = dirname(n.path); - await c.mkdir(t, { recursive: !0 }), await c.writeFile(n.path, n.content); - } - } - }; -} -async function justBashSetNetworkPolicyUnsupported() { - throw Error(`setNetworkPolicy() is not supported on the just-bash sandbox backend. just-bash applies its network policy only at sandbox creation (no run-time update) and does not run git or other binaries. Use docker() for coarse egress control or vercel() / microsandbox() for credential brokering.`); -} -function createJustBashHandle(e, t) { - let n = buildSandboxSession(createFileBackedInternalSandboxSession({ - id: e.sessionKey, - sandbox: e - }), justBashSetNetworkPolicyUnsupported); - return { - session: n, - useSessionFn: async () => n, - async captureState() { - return { - backendName: t, - metadata: await e.captureState() ?? {}, - sessionKey: e.sessionKey - }; - }, - async dispose() { - await e.dispose(); - } - }; -} -function resolveLocalSandboxFilesystemRootPath(e) { - return `${e}/fs`; -} -function resolveLocalSandboxMetadataPath(e) { - return `${e}/metadata.json`; -} -async function ensureLocalSandboxDirectories(e) { - await e.mkdir(WORKSPACE_ROOT$1, { recursive: !0 }); -} -async function readLocalMetadata(e) { - if (!await pathExists$1(e)) return null; - let t = JSON.parse(await readFile(e, `utf8`)); - return t.version !== 1 || !isStringRecord(t.env) ? null : { - env: t.env, - version: 1 - }; -} -async function writeLocalMetadata(n, i) { - await mkdir(dirname(n), { recursive: !0 }), await writeFile(n, `${JSON.stringify(i, null, 2)}\n`); -} -function isStringRecord(e) { - return typeof e == `object` && !!e && !Array.isArray(e) && Object.values(e).every((e) => typeof e == `string`); -} -//#endregion -//#region node_modules/eve/dist/src/execution/sandbox/bindings/just-bash.js -const JUST_BASH_CACHE_DIRECTORY_NAME = `just-bash`; -const JUST_BASH_BACKEND_NAME = `just-bash`; -function createJustBashSandboxBackend(t = {}) { - let r = t.createOptions?.autoInstall ?? !0; - return { - name: JUST_BASH_BACKEND_NAME, - async prewarm(t) { - let a = resolveTemplateRootPath(resolveSandboxCacheDirectory(t.runtimeContext.appRoot), t.templateKey); - if (await pathExists$1(a)) return await touchDirectory(a), { reused: !0 }; - let s = `${a}.${randomUUID()}.tmp`, u = !1, d = await createBashSandbox({ - appRoot: t.runtimeContext.appRoot, - autoInstall: r, - rootPath: s, - sessionKey: t.templateKey - }), f = buildSandboxSession(createFileBackedInternalSandboxSession({ - id: d.sessionKey, - sandbox: d - }), justBashSetNetworkPolicyUnsupported); - try { - if (t.bootstrap !== void 0 && (t.log?.(`running sandbox bootstrap`), await t.bootstrap({ use: async () => createLoggingSandboxSession({ - log: t.log, - session: f - }) })), await writeSandboxSeedFiles(f, t.seedFiles), await d.captureState() === null) throw Error(`Failed to capture local sandbox template state for "${t.templateKey}".`); - await mkdir(dirname(a), { recursive: !0 }); - try { - await rename(s, a), u = !0; - } catch (e) { - if (await pathExists$1(a)) return { reused: !0 }; - throw e; - } - } finally { - await d.dispose(), u || await rm(s, { - force: !0, - recursive: !0 - }).catch(() => {}); - } - return { reused: !1 }; - }, - async create(e) { - let t = resolveSandboxCacheDirectory(e.runtimeContext.appRoot), i = getLocalRootPath(e.existingMetadata) ?? resolveSessionRootPath(t, e.sessionKey); - if (!await pathExists$1(i)) if (e.templateKey === null) await mkdir(i, { recursive: !0 }); - else { - let n = resolveTemplateRootPath(t, e.templateKey); - if (!await pathExists$1(n)) throw new SandboxTemplateNotProvisionedError({ - backendName: JUST_BASH_BACKEND_NAME, - templateKey: e.templateKey - }); - await copyDirectoryAtomically(n, i); - } - return createJustBashHandle(await createBashSandbox({ - appRoot: e.runtimeContext.appRoot, - autoInstall: r, - rootPath: i, - sessionKey: e.sessionKey - }), JUST_BASH_BACKEND_NAME); - } - }; -} -function resolveTemplateRootPath(e, t) { - return resolveLocalBackendTemplateRootPath(e, JUST_BASH_CACHE_DIRECTORY_NAME, t); -} -function resolveSessionRootPath(e, t) { - return resolveLocalBackendSessionRootPath(e, JUST_BASH_CACHE_DIRECTORY_NAME, t); -} -function getLocalRootPath(e) { - let t = e?.rootPath; - return typeof t == `string` ? t : void 0; -} -//#endregion -//#region node_modules/eve/dist/src/execution/sandbox/bindings/microsandbox-options.js -const MICROSANDBOX_USER = `vercel-sandbox`; -function resolveMicrosandboxOptions(e) { - return { - cpus: e?.cpus ?? 1, - env: e?.env ?? {}, - image: e?.image ?? `ghcr.io/vercel/eve:latest`, - memoryMiB: e?.memoryMiB ?? 1024, - networkPolicy: e?.networkPolicy, - pullPolicy: e?.pullPolicy ?? `if-missing`, - setup: { - autoInstall: e?.setup?.autoInstall ?? !0, - skipVerify: e?.setup?.skipVerify ?? !1 - } - }; -} -function microsandboxOptionsForHash(e) { - return { - cpus: e.cpus, - env: e.env, - image: e.image, - memoryMiB: e.memoryMiB, - pullPolicy: e.pullPolicy - }; -} -//#endregion -//#region node_modules/eve/dist/src/execution/sandbox/bindings/microsandbox-platform.js -function isMicrosandboxPlatformSupported() { - return process.platform === `darwin` && process.arch === `arm64` ? !0 : process.platform === `linux` && (process.arch === `x64` || process.arch === `arm64`) && isGlibcLinux() ? process.env.MSB_PATH !== void 0 || existsSync(`/dev/kvm`) : !1; -} -function isGlibcLinux() { - try { - return typeof (process.report?.getReport())?.header?.glibcVersionRuntime == `string`; - } catch { - return !1; - } -} -async function assertMicrosandboxPlatformCandidate() { - if (!(process.platform === `darwin` && process.arch === `arm64`)) { - if (process.platform === `linux` && (process.arch === `x64` || process.arch === `arm64`)) { - if (!isGlibcLinux()) throw Error(`The microsandbox sandbox backend requires a glibc-based Linux distribution; musl hosts are not supported. Use docker() or vercel() instead.`); - if (process.env.MSB_PATH !== void 0 || await doesPathExist$1(`/dev/kvm`)) return; - throw Error("The microsandbox sandbox backend requires Linux with KVM enabled. `/dev/kvm` is not available on this host. Enable KVM, set MSB_PATH for a custom runtime, or use docker() / vercel()."); - } - throw Error(`The microsandbox sandbox backend supports Linux with KVM or macOS on Apple Silicon. Current host is ${process.platform}/${process.arch}. Use docker() or vercel() on this host.`); - } -} -async function doesPathExist$1(e) { - try { - return await access(e), !0; - } catch { - return !1; - } -} -async function ensureMicrosandboxBaseRuntime(e, t = {}) { - let n = await collectMicrosandboxBaseRuntimeOutput(await e.execStreamWith(`bash`, (e) => e.args([`-lc`, MICROSANDBOX_BASE_SETUP_SCRIPT]).cwd(`/`).user(`root`)), t.log); - if (n.exitCode !== 0) throw Error(`Failed to initialize the microsandbox base runtime. ${n.stderr || n.stdout}`.trim()); -} -async function collectMicrosandboxBaseRuntimeOutput(e, t) { - let n = new TextDecoder(), r = new TextDecoder(), i = ``, a = ``, o = ``, s = ``, c; - for await (let l of e) if (l.kind === `stdout`) { - let e = n.decode(l.data, { stream: !0 }); - i = appendOutput(i, e), o = emitMicrosandboxBaseRuntimeLogs(o + e, t); - } else if (l.kind === `stderr`) { - let e = r.decode(l.data, { stream: !0 }); - a = appendOutput(a, e), s = emitMicrosandboxBaseRuntimeLogs(s + e, t); - } else if (l.kind === `exited`) { - c = l.code; - break; - } - let l = n.decode(), u = r.decode(); - if (l.length > 0 && (i = appendOutput(i, l), o = emitMicrosandboxBaseRuntimeLogs(o + l, t)), u.length > 0 && (a = appendOutput(a, u), s = emitMicrosandboxBaseRuntimeLogs(s + u, t)), emitMicrosandboxBaseRuntimeLogLine(o, t), emitMicrosandboxBaseRuntimeLogLine(s, t), c === void 0) throw Error(`Microsandbox base runtime setup ended without an exit event.`); - return { - exitCode: c, - stderr: a, - stdout: i - }; -} -function emitMicrosandboxBaseRuntimeLogs(e, t) { - let n = e.split(/\r?\n/u), r = n.pop() ?? ``; - for (let e of n) emitMicrosandboxBaseRuntimeLogLine(e, t); - return r; -} -function emitMicrosandboxBaseRuntimeLogLine(e, t) { - let n = e.match(/^eve-base-runtime: ?(.*)$/u)?.[1]; - n !== void 0 && n.length > 0 && t?.(n); -} -function appendOutput(e, t) { - let n = e + t; - return n.length > 2e4 ? n.slice(-2e4) : n; -} -const MICROSANDBOX_BASE_SETUP_SCRIPT = ` -set -euo pipefail - -log_step() { - printf 'eve-base-runtime: %s\\n' "$*" >&2 -} - -log_step "checking bash" -command -v bash >/dev/null 2>&1 - -log_step "checking sandbox user" -if ! id -u ${MICROSANDBOX_USER} >/dev/null 2>&1; then - command -v useradd >/dev/null 2>&1 - log_step "create sandbox user: ${MICROSANDBOX_USER}" - useradd -m -s /bin/bash ${MICROSANDBOX_USER} -fi - -log_step "prepare workspace directory: ${WORKSPACE_ROOT$1}" -mkdir -p ${WORKSPACE_ROOT$1} -chown ${MICROSANDBOX_USER}:${MICROSANDBOX_USER} ${WORKSPACE_ROOT$1} -`; -//#endregion -//#region node_modules/eve/dist/src/execution/sandbox/bindings/microsandbox-metadata.js -const MICROSANDBOX_METADATA_FILE_NAME = `metadata.json`; -function resolveMicrosandboxMetadataPath(e) { - return join(e, MICROSANDBOX_METADATA_FILE_NAME); -} -async function readTemplateMetadata(e) { - let t = await readJsonFile(e); - return t?.version !== 2 || typeof t.optionsHash != `string` || typeof t.snapshotName != `string` ? null : { - optionsHash: t.optionsHash, - snapshotName: t.snapshotName, - version: 2 - }; -} -async function writeTemplateMetadata(e, t) { - await writeJsonFileAtomically(e, t); -} -async function readSessionMetadata(e) { - return readSessionMetadataRecord(await readJsonFile(e)); -} -function readSessionMetadataRecord(e) { - return !isRecord$5(e) || e.version !== 2 || typeof e.optionsHash != `string` || typeof e.sandboxName != `string` ? null : { - networkPolicy: e.networkPolicy, - optionsHash: e.optionsHash, - sandboxName: e.sandboxName, - stateSnapshotName: typeof e.stateSnapshotName == `string` ? e.stateSnapshotName : void 0, - version: 2 - }; -} -async function writeSessionMetadata(e, t) { - await writeJsonFileAtomically(e, t); -} -async function readJsonFile(e) { - try { - let t = JSON.parse(await readFile(e, `utf8`)); - return isRecord$5(t) ? t : null; - } catch (e) { - if (e instanceof Error && `code` in e && e.code === `ENOENT`) return null; - throw e; - } -} -async function writeJsonFileAtomically(t, n) { - let r = `${t}.${randomUUID()}.tmp`; - await mkdir(dirname(t), { recursive: !0 }), await writeFile(r, `${JSON.stringify(n, null, 2)}\n`), await rename(r, t); -} -function isRecord$5(e) { - return typeof e == `object` && !!e && !Array.isArray(e); -} -//#endregion -//#region node_modules/eve/dist/src/execution/sandbox/bindings/microsandbox-create.js -async function createMicrosandboxWithProgress(e) { - let t = { phase: `resolving the image` }; - try { - let n = await e.builder.createWithPullProgress(), r = reportMicrosandboxCreateProgress(n, t, e.log); - try { - return await withHeartbeat(t, e.log, async () => await n.awaitSandbox()); - } finally { - await r.catch(() => {}); - } - } catch (n) { - throw enrichMicrosandboxError({ - context: `Failed to create microsandbox VM from ${e.source} while ${t.phase}`, - error: n, - errorType: e.errorType - }); - } -} -function enrichMicrosandboxError(t) { - if (t.error instanceof MicrosandboxDiagnosticError) return t.error; - let n = readMicrosandboxErrorCode(t.error, t.errorType), r = n === void 0 ? `` : ` [${n}]`, i = toErrorMessage(t.error), a = /[.!?]$/u.test(i) ? i : `${i}.`, o = microsandboxErrorHint(n), s = o === void 0 ? `` : ` ${o}`; - return new MicrosandboxDiagnosticError(`${t.context}${r}: ${a}${s}`, { cause: t.error }); -} -var MicrosandboxDiagnosticError = class extends Error {}; -async function reportMicrosandboxCreateProgress(e, t, n) { - for await (let r of e) { - let e = microsandboxCreatePhase(r, t.phase); - e !== t.phase && (t.phase = e, n?.(e)); - } -} -function microsandboxCreatePhase(e, t) { - switch (e.kind) { - case `resolving`: - case `resolved`: return `resolving the image`; - case `layerDownloadProgress`: - case `layerDownloadComplete`: - case `layerDownloadVerifying`: - case `layerMaterializeStarted`: - case `layerMaterializeProgress`: - case `layerMaterializeWriting`: - case `layerMaterializeComplete`: return `downloading and materializing image layers`; - case `stitchMergingTrees`: - case `stitchWritingFsmeta`: - case `stitchWritingVmdk`: - case `stitchComplete`: return `assembling the image filesystem`; - case `complete`: return `image ready; booting microsandbox VM`; - default: return t; - } -} -async function withHeartbeat(e, t, n) { - if (t?.(e.phase), t === void 0) return await n(); - let r = Date.now(), i = setInterval(() => { - let n = Math.round((Date.now() - r) / 1e3); - t(`${e.phase} (${n}s elapsed)`); - }, 1e4); - i.unref?.(); - try { - return await n(); - } finally { - clearInterval(i); - } -} -const MICROSANDBOX_ERROR_HINTS = { - database: `Check that the microsandbox npm package and installed VM runtime use the same version. If versions changed, use a clean MSB_HOME or migrate the existing database.`, - imageNotFound: `Check that the image exists and that the registry credentials can pull it.`, - libkrunfwNotFound: "Run `npx microsandbox install` and verify that MSB_PATH points to the installed runtime." -}; -function readMicrosandboxErrorCode(e, n) { - if (n !== void 0 && e instanceof n || e instanceof Error && `code` in e && typeof e.code == `string` && Object.hasOwn(MICROSANDBOX_ERROR_HINTS, e.code)) return e.code; -} -function microsandboxErrorHint(e) { - return e === void 0 ? void 0 : MICROSANDBOX_ERROR_HINTS[e]; -} -//#endregion -//#region node_modules/eve/dist/src/execution/sandbox/bindings/microsandbox-network.js -function applyMicrosandboxNetwork(e, t) { - let n = createMicrosandboxNetworkPlan(t); - return n.disabled ? e.disableNetwork() : n.policy === null && n.transformHeaderRules.length === 0 ? e : e.network((e) => { - let t = e.enabled(!0); - if (n.policy !== null && (t = t.policyJson(serializeMicrosandboxNetworkPolicyJson(n.policy))), n.transformHeaderRules.length === 0) return t; - t = t.trustHostCAs(!0); - for (let e of n.transformHeaderRules) for (let [n, r] of Object.entries(e.headers)) { - let i = e.placeholderHeaders[n]; - if (i === void 0) continue; - let a = createSecretEnvName(e.domain, n, r); - t = t.secret((t) => { - let n = t.env(a).value(r).placeholder(i).injectHeaders(!0).injectBasicAuth(!0).injectQuery(!1).injectBody(!1).requireTlsIdentity(!0); - return n = e.domain === `*` ? n.allowAnyHostDangerous(!0) : e.domain.startsWith(`*.`) ? n.allowHostPattern(e.domain) : n.allowHost(e.domain), n; - }); - } - return t; - }); -} -function serializeMicrosandboxNetworkPolicyJson(e) { - let t = { - default_egress: e.defaultEgress, - default_ingress: e.defaultIngress, - rules: e.rules.map((e) => ({ - action: e.action, - destination: serializeMicrosandboxNetworkDestination(e.destination), - direction: e.direction, - ports: e.ports, - protocols: e.protocols - })) - }; - return JSON.stringify(t); -} -function createMicrosandboxNetworkPlan(e) { - if (e === void 0 || e === `allow-all`) return { - disabled: !1, - policy: { - defaultEgress: `allow`, - defaultIngress: `deny`, - rules: [] - }, - transformHeaderRules: [] - }; - if (e === `deny-all`) return { - disabled: !0, - policy: null, - transformHeaderRules: [] - }; - let t = [], n = [], r = normalizeAllowEntries(e.allow), i = r.some((e) => e.domain === `*`), a = i ? `allow` : `deny`; - for (let n of e.subnets?.deny ?? []) t.push({ - action: `deny`, - destination: { - cidr: n, - kind: `cidr` - }, - direction: `egress`, - ports: [], - protocols: [] - }); - for (let n of e.subnets?.allow ?? []) t.push({ - action: `allow`, - destination: { - cidr: n, - kind: `cidr` - }, - direction: `egress`, - ports: [], - protocols: [] - }); - i || t.push({ - action: `allow`, - destination: { kind: `any` }, - direction: `egress`, - ports: [{ - start: 53, - end: 53 - }], - protocols: [`udp`, `tcp`] - }); - for (let e of r) if (e.domain !== `*`) { - t.push({ - action: `allow`, - destination: domainToDestination(e.domain), - direction: `egress`, - ports: [], - protocols: [] - }); - for (let t of e.rules) for (let r of normalizeTransforms(t.transform)) Object.keys(r.headers).length !== 0 && n.push({ - domain: e.domain, - headers: r.headers, - match: t.match, - placeholderHeaders: createPlaceholderHeaders(e.domain, r.headers) - }); - } - return { - disabled: !1, - policy: { - defaultEgress: a, - defaultIngress: `deny`, - rules: t - }, - transformHeaderRules: n - }; -} -function createTransformBrokerEnvironment(e) { - if (e.transformHeaderRules.length === 0) return {}; - let t = e.transformHeaderRules.flatMap((e) => Object.entries(e.placeholderHeaders).filter(([e]) => e.toLowerCase() === `authorization`).flatMap(([t, n]) => e.domain === `*` || e.domain.startsWith(`*.`) ? [] : [{ - key: `http.https://${e.domain}/.extraheader`, - value: `${t}: ${n}` - }])), n = {}; - return t.length > 0 && (n.GIT_CONFIG_COUNT = String(t.length), t.forEach((e, t) => { - n[`GIT_CONFIG_KEY_${t}`] = e.key, n[`GIT_CONFIG_VALUE_${t}`] = e.value; - })), { - EVE_MICROSANDBOX_NETWORK_TRANSFORMS: Buffer.from(JSON.stringify(e.transformHeaderRules)).toString(`base64`), - ...n - }; -} -function normalizeAllowEntries(e) { - return e === void 0 ? [] : Array.isArray(e) ? e.map((e) => ({ - domain: e, - rules: [] - })) : Object.entries(e).map(([e, t]) => ({ - domain: e, - rules: Array.isArray(t) ? t : [] - })); -} -function normalizeTransforms(e) { - return e === void 0 ? [] : e.map((e) => ({ headers: e.headers ?? {} })); -} -function domainToDestination(e) { - return e.startsWith(`*.`) ? { - kind: `domainSuffix`, - suffix: e.slice(2) - } : { - domain: e, - kind: `domain` - }; -} -function serializeMicrosandboxNetworkDestination(e) { - switch (e.kind) { - case `any`: return `any`; - case `cidr`: return { cidr: e.cidr ?? `` }; - case `domain`: return { domain: e.domain ?? `` }; - case `domainSuffix`: return { domain_suffix: e.suffix ?? `` }; - case `group`: return { group: e.group ?? `` }; - default: throw Error(`Unsupported microsandbox network destination kind.`); - } -} -function createPlaceholderHeaders(e, t) { - let n = {}; - for (let [r, i] of Object.entries(t)) n[r] = `__EVE_MSB_SECRET_${createStableHash$2(`${e}:${r}:${i}`).slice(0, 24)}__`; - return n; -} -function createSecretEnvName(e, t, n) { - return `EVE_MSB_SECRET_${createStableHash$2(`${e}:${t}:${n}`).slice(0, 24).toUpperCase()}`; -} -function createStableHash$2(t) { - return createHash(`sha256`).update(t).digest(`hex`); -} -//#endregion -//#region node_modules/eve/dist/src/execution/sandbox/bindings/microsandbox-process.js -function adaptMicrosandboxExecToSandboxProcess(e) { - let t, n, r, i, a, o = new Promise((e, t) => { - i = e, a = t; - }), s = new ReadableStream({ start(e) { - t = e; - } }), c = new ReadableStream({ start(e) { - n = e; - } }); - return (async () => { - let o = e[Symbol.asyncIterator](); - try { - for (;;) { - let e = r === void 0 ? await o.next() : await nextWithTimeout(o, 100); - if (e === `timeout` || e.done === !0) break; - let i = e.value; - i.kind === `stdout` ? t?.enqueue(i.data) : i.kind === `stderr` ? n?.enqueue(i.data) : i.kind === `exited` && (r = i.code); - } - } catch (e) { - t?.error(e), n?.error(e), a?.(e); - } finally { - if (o.return?.().catch(() => {}), r === void 0) { - let e = Error(`Microsandbox command ended without an exit event.`); - t?.error(e), n?.error(e), a?.(e); - } else t?.close(), n?.close(), i?.(); - } - })(), { - stdout: s, - stderr: c, - async wait() { - return await o, { exitCode: r ?? 0 }; - }, - async kill() { - await e.kill(); - } - }; -} -async function nextWithTimeout(e, t) { - let n; - try { - return await Promise.race([e.next(), new Promise((e) => { - n = setTimeout(() => e(`timeout`), t); - })]); - } finally { - n !== void 0 && clearTimeout(n); - } -} -//#endregion -//#region node_modules/eve/dist/src/execution/sandbox/bindings/microsandbox-runtime.js -const MICROSANDBOX_STOP_TIMEOUT_MS = 1e4; -var MicrosandboxVm = class { - #e; - #t; - #n; - #r; - #i; - #a; - #o; - constructor(e, t, n, r, i, a, o) { - this.#e = e, this.#i = t, this.#a = n, this.#n = r, this.#t = i, this.#r = a, this.#o = o; - } - get id() { - return this.#e.sessionKey; - } - async captureState(e) { - if (this.#r = e, isEveDevEnvironment()) return this.#t !== void 0 && await this.writeMetadata(this.#t, e), { - networkPolicy: this.#n, - optionsHash: e, - sandboxName: this.#a, - stateSnapshotName: this.#o, - version: 2 - }; - let t = this.#o, n = createProviderName(`eve-sbx-state`, `${this.#e.sessionKey}:${randomUUID()}`); - return await this.stopAndSnapshot(n), this.#o = n, this.#t !== void 0 && await this.writeMetadata(this.#t, e), t !== void 0 && await removeSnapshotIfExists(this.#e.module, t), { - networkPolicy: this.#n, - optionsHash: e, - sandboxName: this.#a, - stateSnapshotName: n, - version: 2 - }; - } - async detach() { - await this.#i.detach().catch(() => {}); - } - async readFileBytes(e) { - try { - let t = this.#i.fs(); - return await t.exists(e) ? Buffer.from(await t.read(e)) : null; - } catch { - return null; - } - } - async removePath(e) { - let t = `${e.force === !0 ? `f` : ``}${e.recursive === !0 ? `r` : ``}`, n = `${t.length > 0 ? `rm -${t}` : `rm`} -- ${shellQuote(e.path)}`; - await this.runInternalCommand({ - abortSignal: e.abortSignal, - command: n, - user: MICROSANDBOX_USER - }); - } - async removePersisted() { - await removeSandboxIfExists(this.#e.module, this.#a), this.#o !== void 0 && await removeSnapshotIfExists(this.#e.module, this.#o); - } - async setNetworkPolicy(e) { - let t = this.#o, n = createProviderName(`eve-sbx-state`, `${this.#e.sessionKey}:${randomUUID()}`), i = this.#a; - await this.stopAndSnapshot(n), await removeSandboxIfExists(this.#e.module, i); - let a = createProviderName(`eve-sbx-ses`, `${this.#e.sessionKey}:${randomUUID()}`); - this.#i = await createMicrosandbox({ - fromSnapshot: n, - module: this.#e.module, - name: a, - networkPolicy: e, - options: this.#e.options, - tags: this.#e.tags, - user: MICROSANDBOX_USER, - workdir: WORKSPACE_ROOT$1 - }), this.#a = a, this.#n = e, this.#o = void 0, this.#t !== void 0 && this.#r !== void 0 && await this.writeMetadata(this.#t, this.#r), await removeSnapshotIfExists(this.#e.module, n), t !== void 0 && await removeSnapshotIfExists(this.#e.module, t); - } - async spawn(e) { - if (e.abortSignal?.aborted) throw new DOMException(`The operation was aborted.`, `AbortError`); - let t = { - ...this.#e.options.env, - ...createTransformBrokerEnvironment(createMicrosandboxNetworkPlan(this.#n)), - ...e.env - }, n = await this.#i.execStreamWith(`bash`, (n) => n.args([`-lc`, e.command]).cwd(e.workingDirectory ?? WORKSPACE_ROOT$1).envs(t).user(MICROSANDBOX_USER)); - return e.abortSignal !== void 0 && e.abortSignal.addEventListener(`abort`, () => { - n.kill().catch(() => {}); - }, { once: !0 }), adaptMicrosandboxExecToSandboxProcess(n); - } - async stopAndSnapshot(e) { - await this.#i.stop().catch(() => {}), await stopAndSnapshotMicrosandboxSandbox(this.#e.module, this.#a, e); - } - async writeFiles(t) { - let n = this.#i.fs(); - for (let r of t) { - let t = posix.dirname(r.path); - await this.runInternalCommand({ - command: `mkdir -p ${shellQuote(t)}`, - user: MICROSANDBOX_USER - }), await n.write(r.path, r.content), await this.runInternalCommand({ - command: `chown ${MICROSANDBOX_USER}:${MICROSANDBOX_USER} ${shellQuote(r.path)}`, - user: `root` - }); - } - } - async writeMetadata(e, t) { - this.#t = e, this.#r = t, await writeSessionMetadata(e, { - networkPolicy: this.#n, - optionsHash: t, - sandboxName: this.#a, - stateSnapshotName: this.#o, - version: 2 - }); - } - async runInternalCommand(e) { - if (e.abortSignal?.aborted) throw new DOMException(`The operation was aborted.`, `AbortError`); - let t = await this.#i.execWith(`bash`, (t) => t.args([`-lc`, e.command]).cwd(WORKSPACE_ROOT$1).user(e.user)); - if (t.code !== 0) { - let n = e.failureMessage ?? `Microsandbox command failed.`; - throw Error(`${n} ${t.stderr()}`.trim()); - } - } -}; -async function createPreparedMicrosandbox(e) { - let t = e.setupBaseRuntime ? `allow-all` : e.networkPolicy, n = await createMicrosandbox({ - fromSnapshot: e.fromSnapshot, - log: e.log, - module: e.module, - name: e.name, - networkPolicy: t, - options: e.options, - tags: e.tags, - user: e.setupBaseRuntime ? void 0 : MICROSANDBOX_USER, - workdir: e.setupBaseRuntime ? `/` : WORKSPACE_ROOT$1 - }), r = new MicrosandboxVm({ - module: e.module, - options: e.options, - sessionKey: e.sessionKey, - tags: e.tags - }, n, e.name, t); - return e.setupBaseRuntime && (await withProgressHeartbeat$1(`preparing base runtime inside VM`, e.log, async () => { - await ensureMicrosandboxBaseRuntime(n, { log: e.log }); - }), e.networkPolicy !== void 0 && e.networkPolicy !== `allow-all` && (e.log?.(`applying network policy`), await r.setNetworkPolicy(e.networkPolicy))), r; -} -async function connectMicrosandbox(e) { - let t; - try { - t = await e.module.Sandbox.get(e.metadata.sandboxName); - } catch (t) { - if (!isMicrosandboxNotFoundError(t)) throw t; - return e.metadata.stateSnapshotName === void 0 ? null : await restoreMicrosandboxSessionSnapshot(e); - } - if (t.status !== `running` && t.status !== `draining` && e.metadata.stateSnapshotName !== void 0) return await restoreMicrosandboxSessionSnapshot(e); - let n = t.status === `running` || t.status === `draining` ? await t.connectWithTimeout(1e4) : await t.startDetached(); - return new MicrosandboxVm({ - module: e.module, - options: e.options, - sessionKey: e.sessionKey, - tags: e.tags - }, n, e.metadata.sandboxName, e.metadata.networkPolicy, e.metadataPath, e.metadata.optionsHash, e.metadata.stateSnapshotName); -} -async function restoreMicrosandboxSessionSnapshot(e) { - if (e.metadata.stateSnapshotName === void 0 || !await snapshotExists(e.module, e.metadata.stateSnapshotName)) return null; - let t = createProviderName(`eve-sbx-ses`, `${e.sessionKey}:${randomUUID()}`), n = await createMicrosandbox({ - fromSnapshot: e.metadata.stateSnapshotName, - module: e.module, - name: t, - networkPolicy: e.metadata.networkPolicy, - options: e.options, - tags: e.tags, - user: MICROSANDBOX_USER, - workdir: WORKSPACE_ROOT$1 - }); - await removeSandboxIfExists(e.module, e.metadata.sandboxName); - let i = new MicrosandboxVm({ - module: e.module, - options: e.options, - sessionKey: e.sessionKey, - tags: e.tags - }, n, t, e.metadata.networkPolicy, e.metadataPath, e.metadata.optionsHash, e.metadata.stateSnapshotName); - return await i.writeMetadata(e.metadataPath, e.metadata.optionsHash), i; -} -async function loadMicrosandboxModule(e) { - e.log?.(`checking microsandbox platform support`), await assertMicrosandboxPlatformCandidate(); - let t = await withProgressHeartbeat$1(`loading microsandbox npm package`, e.log, () => loadOptionalEnginePackage({ - appRoot: e.appRoot, - autoInstall: e.options.setup.autoInstall, - importModule: async () => await import(`microsandbox`), - missingMessage: "The microsandbox sandbox backend requires the `microsandbox` package, which is not bundled with eve. Install it in your application (for example `pnpm add -D microsandbox`), or use docker() / vercel() instead.", - packageName: `microsandbox` - })); - if (e.log?.(`checking microsandbox VM runtime`), !t.isInstalled()) { - if (!e.options.setup.autoInstall || !isEveDevEnvironment()) throw Error("The microsandbox VM runtime is not installed. Run `npx microsandbox install`, set MSB_PATH for a custom install, or let `eve dev` install it automatically with microsandbox({ setup: { autoInstall: true } })."); - await withProgressHeartbeat$1(`installing microsandbox VM runtime`, e.log, async () => { - await t.setup().skipVerify(e.options.setup.skipVerify).install(); - }); - } - return e.log?.(`microsandbox runtime ready`), t; -} -async function withProgressHeartbeat$1(e, t, n) { - if (t?.(e), t === void 0) return await n(); - let r = Date.now(), i = setInterval(() => { - t(`${e} (${Math.round((Date.now() - r) / 1e3)}s elapsed)`); - }, 1e4); - i.unref?.(); - try { - return await n(); - } finally { - clearInterval(i); - } -} -async function stopAndSnapshotMicrosandboxSandbox(e, t, n) { - for (let r = 0; r < 3; r += 1) { - let i = await e.Sandbox.get(t); - await i.stopWithTimeout(r === 0 ? MICROSANDBOX_STOP_TIMEOUT_MS : 0).catch(() => {}); - try { - await i.snapshot(n); - return; - } catch (e) { - if (!isMicrosandboxSnapshotSourceRunningError(e) || r === 2) throw e; - await i.kill().catch(() => {}), await new Promise((e) => setTimeout(e, 250)); - } - } -} -async function snapshotExists(e, t) { - try { - return await e.Snapshot.get(t), !0; - } catch { - return !1; - } -} -async function sandboxExists(e, t) { - try { - return await e.Sandbox.get(t), !0; - } catch (e) { - if (isMicrosandboxNotFoundError(e)) return !1; - throw e; - } -} -async function removeSnapshotIfExists(e, t) { - try { - await e.Snapshot.remove(t, { force: !0 }); - } catch (e) { - if (!isMicrosandboxNotFoundError(e)) throw e; - } -} -function createProviderName(e, t, n = ``) { - return `${e}-${createStableHash$1(`${t}:${n}`).slice(0, 32)}`; -} -function createStableHash$1(e) { - return createHash(`sha256`).update(e).digest(`hex`); -} -async function doesPathExist(e) { - try { - return await access(e), !0; - } catch { - return !1; - } -} -async function createMicrosandbox(e) { - let t = e.module.Sandbox.builder(e.name).cpus(e.options.cpus).detached(!0).envs(e.options.env).labels(resolveMicrosandboxLabels(e.tags)).memory(e.options.memoryMiB).pullPolicy(e.options.pullPolicy).replace().workdir(e.workdir); - t = e.fromSnapshot === void 0 ? t.image(e.options.image) : t.fromSnapshot(e.fromSnapshot), e.user !== void 0 && (t = t.user(e.user)); - let n = e.fromSnapshot === void 0 ? `image "${e.options.image}"` : `snapshot "${e.fromSnapshot}"`; - return await createMicrosandboxWithProgress({ - builder: applyMicrosandboxNetwork(t, e.networkPolicy), - errorType: e.module.MicrosandboxError, - log: e.log, - source: n - }); -} -async function removeSandboxIfExists(e, t) { - for (let n = 0; n < 3; n += 1) try { - let r = await e.Sandbox.get(t); - await r.stopWithTimeout(n === 0 ? MICROSANDBOX_STOP_TIMEOUT_MS : 0).catch(() => {}), await r.remove(); - return; - } catch (r) { - if (isMicrosandboxNotFoundError(r)) return; - if (isMicrosandboxStillRunningError(r) && n < 2) { - await (await e.Sandbox.get(t).catch(() => null))?.kill().catch(() => {}), await new Promise((e) => setTimeout(e, 250)); - continue; - } - throw r; - } -} -function isMicrosandboxNotFoundError(e) { - return e instanceof Error ? /not found|not exist|no such/i.test(e.message) : !1; -} -function isMicrosandboxStillRunningError(e) { - return e instanceof Error ? /still running/i.test(e.message) : !1; -} -function isMicrosandboxSnapshotSourceRunningError(e) { - return e instanceof Error ? /snapshot source sandbox .*not stopped|SnapshotSandboxRunning/i.test(e.message) : !1; -} -function resolveMicrosandboxLabels(e) { - return { - "eve.backend": `microsandbox`, - ...withDevelopmentSandboxTags(e) - }; -} -//#endregion -//#region node_modules/eve/dist/src/execution/sandbox/bindings/microsandbox-templates.js -const MICROSANDBOX_CACHE_DIRECTORY_NAME = `microsandbox`; -function resolveMicrosandboxTemplateRootPath(e, t) { - return resolveLocalBackendTemplateRootPath(e, MICROSANDBOX_CACHE_DIRECTORY_NAME, t); -} -function resolveMicrosandboxSessionRootPath(e, t) { - return resolveLocalBackendSessionRootPath(e, MICROSANDBOX_CACHE_DIRECTORY_NAME, t); -} -//#endregion -//#region node_modules/eve/dist/src/execution/sandbox/bindings/microsandbox-lifecycle.js -const activeMicrosandboxSessionHandles = /* @__PURE__ */ new Map(); -async function prewarmMicrosandboxTemplate(i) { - i.prewarmInput.log?.(`loading microsandbox runtime`); - let a = await loadMicrosandboxModule({ - appRoot: i.prewarmInput.runtimeContext.appRoot, - log: i.prewarmInput.log, - options: i.options - }), u = resolveMicrosandboxTemplateRootPath(resolveSandboxCacheDirectory(i.prewarmInput.runtimeContext.appRoot), i.prewarmInput.templateKey), f = resolveMicrosandboxMetadataPath(u); - i.prewarmInput.log?.(`checking cached snapshot`); - let p = await readTemplateMetadata(f); - if (p?.optionsHash === i.optionsHash && await snapshotExists(a, p.snapshotName)) return i.prewarmInput.log?.(`reusing cached snapshot`), await touchDirectory(u), { reused: !0 }; - let h = createProviderName(`eve-sbx-tpl`, i.prewarmInput.templateKey, i.optionsHash), _ = `${u}.${randomUUID()}.tmp`, v = createProviderName(`eve-sbx-tpl-tmp`, `${i.prewarmInput.templateKey}:${randomUUID()}`); - await removeSnapshotIfExists(a, h), await rm(_, { - force: !0, - recursive: !0 - }), await mkdir(_, { recursive: !0 }), i.prewarmInput.log?.(`creating template VM from image "${i.options.image}"`); - let y = await createPreparedMicrosandbox({ - log: i.prewarmInput.log, - module: a, - name: v, - networkPolicy: i.options.networkPolicy, - options: i.options, - sessionKey: i.prewarmInput.templateKey, - setupBaseRuntime: !0, - tags: void 0 - }), b = buildSandboxSession(createMicrosandboxInternalSession(y), async (e) => { - await y.setNetworkPolicy(e); - }); - try { - i.prewarmInput.bootstrap !== void 0 && (i.prewarmInput.log?.(`running sandbox bootstrap`), await i.prewarmInput.bootstrap({ use: async (e) => (e?.networkPolicy !== void 0 && await y.setNetworkPolicy(e.networkPolicy), createLoggingSandboxSession({ - log: i.prewarmInput.log, - session: b - })) })), i.prewarmInput.seedFiles.length > 0 && i.prewarmInput.log?.(`writing ${i.prewarmInput.seedFiles.length} seed file(s)`), await writeSandboxSeedFiles(b, i.prewarmInput.seedFiles), i.prewarmInput.log?.(`snapshotting template VM`), await y.stopAndSnapshot(h), await writeTemplateMetadata(resolveMicrosandboxMetadataPath(_), { - optionsHash: i.optionsHash, - snapshotName: h, - version: 2 - }), await mkdir(dirname(u), { recursive: !0 }), await rm(u, { - force: !0, - recursive: !0 - }); - try { - await rename(_, u); - } catch (e) { - if (await doesPathExist(u)) return { reused: !0 }; - throw e; - } - } finally { - await y.removePersisted(), await rm(_, { - force: !0, - recursive: !0 - }).catch(() => {}); - } - return { reused: !1 }; -} -async function createMicrosandboxHandle(e) { - let t = await loadMicrosandboxModule({ - appRoot: e.createInput.runtimeContext.appRoot, - options: e.options - }), n = resolveSandboxCacheDirectory(e.createInput.runtimeContext.appRoot), r = resolveMicrosandboxSessionRootPath(n, e.createInput.sessionKey), a = createActiveMicrosandboxSessionKey(r, e.optionsHash), o = activeMicrosandboxSessionHandles.get(a); - if (o !== void 0) return o; - let s = resolveMicrosandboxMetadataPath(r), c = readSessionMetadataRecord(e.createInput.existingMetadata) ?? await readSessionMetadata(s), l = withDevelopmentSandboxMetadataPathTag(e.createInput.tags, s); - if (c?.optionsHash === e.optionsHash && (await sandboxExists(t, c.sandboxName) || c.stateSnapshotName !== void 0 && await snapshotExists(t, c.stateSnapshotName))) { - let n = await connectMicrosandbox({ - metadata: c, - metadataPath: s, - module: t, - options: e.options, - sessionKey: e.createInput.sessionKey, - tags: l - }); - if (n !== null) return cacheHandle(a, createHandle$1(n, e.backendName, e.optionsHash, () => { - activeMicrosandboxSessionHandles.delete(a); - })); - } - let d = null; - if (e.createInput.templateKey !== null) { - let r = await readTemplateMetadata(resolveMicrosandboxMetadataPath(resolveMicrosandboxTemplateRootPath(n, e.createInput.templateKey))); - if (r === null || r.optionsHash !== e.optionsHash || !await snapshotExists(t, r.snapshotName)) throw new SandboxTemplateNotProvisionedError({ - backendName: e.backendName, - templateKey: e.createInput.templateKey - }); - d = r.snapshotName; - } - let m = createProviderName(`eve-sbx-ses`, `${e.createInput.sessionKey}:${randomUUID()}`), g; - try { - g = await createPreparedMicrosandbox({ - fromSnapshot: d ?? void 0, - module: t, - name: m, - networkPolicy: e.options.networkPolicy, - options: e.options, - sessionKey: e.createInput.sessionKey, - setupBaseRuntime: d === null, - tags: l - }); - } catch (t) { - throw d !== null && e.createInput.templateKey !== null && isMicrosandboxNotFoundError(t) ? new SandboxTemplateNotProvisionedError({ - backendName: e.backendName, - templateKey: e.createInput.templateKey - }) : t; - } - return await g.writeMetadata(s, e.optionsHash), cacheHandle(a, createHandle$1(g, e.backendName, e.optionsHash, () => { - activeMicrosandboxSessionHandles.delete(a); - })); -} -function createHandle$1(e, t, n, r) { - return { - session: buildSandboxSession(createMicrosandboxInternalSession(e), async (t) => { - await e.setNetworkPolicy(t); - }), - useSessionFn: async (t) => (t?.networkPolicy !== void 0 && await e.setNetworkPolicy(t.networkPolicy), buildSandboxSession(createMicrosandboxInternalSession(e), async (t) => { - await e.setNetworkPolicy(t); - })), - async captureState() { - return { - backendName: t, - metadata: { ...await e.captureState(n) }, - sessionKey: e.id - }; - }, - async dispose() { - r?.(), await e.detach(); - } - }; -} -function createMicrosandboxInternalSession(e) { - return createFileBackedInternalSandboxSession({ - id: e.id, - sandbox: e - }); -} -function createActiveMicrosandboxSessionKey(e, t) { - return `${e}\0${t}`; -} -function cacheHandle(e, t) { - return activeMicrosandboxSessionHandles.set(e, t), t; -} -//#endregion -//#region node_modules/eve/dist/src/execution/sandbox/bindings/microsandbox.js -const MICROSANDBOX_BACKEND_NAME = `microsandbox`; -function createMicrosandboxSandboxBackend(t = {}) { - let n = resolveMicrosandboxOptions(t.createOptions), r = createStableHash$1(JSON.stringify(microsandboxOptionsForHash(n))).slice(0, 20); - return { - name: MICROSANDBOX_BACKEND_NAME, - async prewarm(e) { - try { - return await prewarmMicrosandboxTemplate({ - backendName: MICROSANDBOX_BACKEND_NAME, - options: n, - optionsHash: r, - prewarmInput: e - }); - } catch (t) { - throw enrichMicrosandboxError({ - context: `Failed to prewarm microsandbox template "${e.templateKey}"`, - error: t - }); - } - }, - async create(e) { - return await createMicrosandboxHandle({ - backendName: MICROSANDBOX_BACKEND_NAME, - createInput: e, - options: n, - optionsHash: r - }); - } - }; -} -//#endregion -//#region node_modules/eve/dist/src/public/sandbox/backends/docker.js -function docker(e) { - return createDockerSandboxBackend({ createOptions: e }); -} -//#endregion -//#region node_modules/eve/dist/src/public/sandbox/backends/just-bash.js -function justbash(e) { - return createJustBashSandboxBackend({ createOptions: e }); -} -//#endregion -//#region node_modules/eve/dist/src/public/sandbox/backends/microsandbox.js -function microsandbox(e) { - return createMicrosandboxSandboxBackend({ createOptions: e }); -} -//#endregion -//#region node_modules/eve/dist/src/execution/sandbox/bindings/vercel-base-runtime.js -async function ensureVercelSandboxBaseRuntime(t) { - await runSandboxBootstrapStep(t, { - failureMessage: `Failed to initialize Vercel sandbox base runtime.`, - script: buildDockerBaseSetupScript() - }); -} -async function applyInitialVercelNetworkPolicy(e, t) { - t !== void 0 && await e.update({ networkPolicy: t }); -} -async function runSandboxBootstrapStep(e, t) { - let n = await runBootstrapCommand(e, t.script); - if (n === null) return; - let r = await runBootstrapCommandWithSudo(e, t.script); - if (r === null) return; - let i = [n, r].filter(Boolean).join(` -`); - throw Error(`${t.failureMessage}${i ? `\n${i}` : ``}`); -} -async function runBootstrapCommand(e, t) { - return await readBootstrapFailure(await e.runCommand({ - args: [`-lc`, t], - cmd: `bash` - })); -} -async function runBootstrapCommandWithSudo(e, t) { - return await readBootstrapFailure(await e.runCommand({ - args: [ - `-n`, - `bash`, - `-lc`, - t - ], - cmd: `sudo` - })); -} -async function readBootstrapFailure(e) { - if (e.exitCode === 0) return null; - let t = await e.stdout(), n = await e.stderr(); - return [t.trim(), n.trim()].filter(Boolean).join(` -`); -} -//#endregion -//#region node_modules/eve/dist/src/execution/sandbox/bindings/vercel-create-sdk.js -async function createVercelEveImageSandbox(e) { - let t = { - ...e.createOptions, - __image: VERCEL_EVE_SANDBOX_IMAGE - }; - return await e.sandboxModule.Sandbox.create(t); -} -const VERCEL_EVE_SANDBOX_IMAGE = `vercel/eve:latest`; -//#endregion -//#region node_modules/eve/dist/src/execution/sandbox/bindings/vercel-errors.js -function isVercelSnapshotUnavailableError(e) { - for (let t of walkErrorChain$1(e)) if ((t.response?.status ?? t.status ?? t.statusCode) === 410) return !0; - return !1; -} -function isVercelSandboxMissingError(e) { - for (let t of walkErrorChain$1(e)) if ((t.response?.status ?? t.status ?? t.statusCode) === 404) return !0; - return !1; -} -function* walkErrorChain$1(e) { - let t = e, n = /* @__PURE__ */ new Set(); - for (; t != null && !n.has(t);) n.add(t), yield t, t = t.cause; -} -//#endregion -//#region node_modules/eve/dist/src/compiled/@vercel/oidc/index.js -var t$6 = Object.create; -var n$7 = Object.defineProperty; -var r$10 = Object.getOwnPropertyDescriptor; -var i$8 = Object.getOwnPropertyNames; -var a$7 = Object.getPrototypeOf; -var o$7 = Object.prototype.hasOwnProperty; -var s$5 = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports); -var c$6 = (e, t, a, s) => { - if (t && typeof t == `object` || typeof t == `function`) for (var c = i$8(t), l = 0, u = c.length, d; l < u; l++) d = c[l], !o$7.call(e, d) && d !== a && n$7(e, d, { - get: ((e) => t[e]).bind(null, d), - enumerable: !(s = r$10(t, d)) || s.enumerable - }); - return e; -}; -var l$5 = (e, r, i) => (i = e == null ? {} : t$6(a$7(e)), c$6(r || !e || !e.__esModule ? n$7(i, `default`, { - value: e, - enumerable: !0 -}) : i, e)); -var u$7 = createRequire(import.meta.url); -var d$7 = s$5(((e, t) => { - var n = Object.defineProperty, r = Object.getOwnPropertyDescriptor, i = Object.getOwnPropertyNames, a = Object.prototype.hasOwnProperty, o = (e, t) => { - for (var r in t) n(e, r, { - get: t[r], - enumerable: !0 - }); - }, s = (e, t, o, s) => { - if (t && typeof t == `object` || typeof t == `function`) for (let c of i(t)) !a.call(e, c) && c !== o && n(e, c, { - get: () => t[c], - enumerable: !(s = r(t, c)) || s.enumerable - }); - return e; - }, c = (e) => s(n({}, `__esModule`, { value: !0 }), e), l = {}; - o(l, { - SYMBOL_FOR_REQ_CONTEXT: () => u, - getContext: () => d - }), t.exports = c(l); - let u = Symbol.for(`@vercel/request-context`); - function d() { - return globalThis[u]?.get?.() ?? {}; - } -})); -var f$6 = s$5(((e, t) => { - var n = Object.defineProperty, r = Object.getOwnPropertyDescriptor, i = Object.getOwnPropertyNames, a = Object.prototype.hasOwnProperty, o = (e, t) => { - for (var r in t) n(e, r, { - get: t[r], - enumerable: !0 - }); - }, s = (e, t, o, s) => { - if (t && typeof t == `object` || typeof t == `function`) for (let c of i(t)) !a.call(e, c) && c !== o && n(e, c, { - get: () => t[c], - enumerable: !(s = r(t, c)) || s.enumerable - }); - return e; - }, c = (e) => s(n({}, `__esModule`, { value: !0 }), e), l = {}; - o(l, { getVercelOidcTokenSync: () => f }), t.exports = c(l); - var u = d$7(); - function f() { - let e = (0, u.getContext)().headers?.[`x-vercel-oidc-token`] ?? process.env.VERCEL_OIDC_TOKEN; - if (!e) throw Error(`The 'x-vercel-oidc-token' header is missing from the request.`); - return e; - } -})); -var p$9 = s$5(((e, t) => { - var n = Object.defineProperty, r = Object.getOwnPropertyDescriptor, i = Object.getOwnPropertyNames, a = Object.prototype.hasOwnProperty, o = (e, t) => { - for (var r in t) n(e, r, { - get: t[r], - enumerable: !0 - }); - }, s = (e, t, o, s) => { - if (t && typeof t == `object` || typeof t == `function`) for (let c of i(t)) !a.call(e, c) && c !== o && n(e, c, { - get: () => t[c], - enumerable: !(s = r(t, c)) || s.enumerable - }); - return e; - }, c = (e) => s(n({}, `__esModule`, { value: !0 }), e), l = {}; - o(l, { VercelOidcTokenError: () => u }), t.exports = c(l); - var u = class extends Error { - constructor(e, t) { - super(e), this.name = `VercelOidcTokenError`, this.cause = t; - } - toString() { - return this.cause ? `${this.name}: ${this.message}: ${this.cause}` : `${this.name}: ${this.message}`; - } - }; -})); -var m$6 = s$5(((e, t) => { - var n = Object.create, r = Object.defineProperty, i = Object.getOwnPropertyDescriptor, a = Object.getOwnPropertyNames, o = Object.getPrototypeOf, s = Object.prototype.hasOwnProperty, c = (e, t) => { - for (var n in t) r(e, n, { - get: t[n], - enumerable: !0 - }); - }, l = (e, t, n, o) => { - if (t && typeof t == `object` || typeof t == `function`) for (let c of a(t)) !s.call(e, c) && c !== n && r(e, c, { - get: () => t[c], - enumerable: !(o = i(t, c)) || o.enumerable - }); - return e; - }, d = (e, t, i) => (i = e == null ? {} : n(o(e)), l(t || !e || !e.__esModule ? r(i, `default`, { - value: e, - enumerable: !0 - }) : i, e)), f = (e) => l(r({}, `__esModule`, { value: !0 }), e), m = {}; - c(m, { - findRootDir: () => y, - getUserDataDir: () => b - }), t.exports = f(m); - var h = d(u$7(`path`)), g = d(u$7(`fs`)), _ = d(u$7(`os`)), v = p$9(); - function y() { - try { - let e = process.cwd(); - for (; e !== h.default.dirname(e);) { - let t = h.default.join(e, `.vercel`); - if (g.default.existsSync(t)) return e; - e = h.default.dirname(e); - } - } catch { - throw new v.VercelOidcTokenError(`Token refresh only supported in node server environments`); - } - return null; - } - function b() { - if (process.env.XDG_DATA_HOME) return process.env.XDG_DATA_HOME; - switch (_.default.platform()) { - case `darwin`: return h.default.join(_.default.homedir(), `Library/Application Support`); - case `linux`: return h.default.join(_.default.homedir(), `.local/share`); - case `win32`: return process.env.LOCALAPPDATA ? process.env.LOCALAPPDATA : null; - default: return null; - } - } -})); -var h$7 = s$5(((e, t) => { - var n = Object.create, r = Object.defineProperty, i = Object.getOwnPropertyDescriptor, a = Object.getOwnPropertyNames, o = Object.getPrototypeOf, s = Object.prototype.hasOwnProperty, c = (e, t) => { - for (var n in t) r(e, n, { - get: t[n], - enumerable: !0 - }); - }, l = (e, t, n, o) => { - if (t && typeof t == `object` || typeof t == `function`) for (let c of a(t)) !s.call(e, c) && c !== n && r(e, c, { - get: () => t[c], - enumerable: !(o = i(t, c)) || o.enumerable - }); - return e; - }, d = (e, t, i) => (i = e == null ? {} : n(o(e)), l(t || !e || !e.__esModule ? r(i, `default`, { - value: e, - enumerable: !0 - }) : i, e)), f = (e) => l(r({}, `__esModule`, { value: !0 }), e), p = {}; - c(p, { - isValidAccessToken: () => x, - readAuthConfig: () => y, - writeAuthConfig: () => b - }), t.exports = f(p); - var m = d(u$7(`fs`)), h = d(u$7(`path`)), g = v$6(); - function _() { - let e = (0, g.getVercelDataDir)(); - if (!e) throw Error(`Unable to find Vercel CLI data directory. Your platform: ${process.platform}. Supported: darwin, linux, win32.`); - return h.join(e, `auth.json`); - } - function y() { - try { - let e = _(); - if (!m.existsSync(e)) return null; - let t = m.readFileSync(e, `utf8`); - return t ? JSON.parse(t) : null; - } catch { - return null; - } - } - function b(e) { - let t = _(), n = h.dirname(t); - m.existsSync(n) || m.mkdirSync(n, { - mode: 504, - recursive: !0 - }), m.writeFileSync(t, JSON.stringify(e, null, 2), { mode: 384 }); - } - function x(e, t = 0) { - if (!e.token) return !1; - if (typeof e.expiresAt != `number`) return !0; - let n = Math.floor(Date.now() / 1e3), r = t / 1e3; - return e.expiresAt >= n + r; - } -})); -var g$6 = s$5(((e, t) => { - var n = Object.defineProperty, r = Object.getOwnPropertyDescriptor, i = Object.getOwnPropertyNames, a = Object.prototype.hasOwnProperty, o = (e, t) => { - for (var r in t) n(e, r, { - get: t[r], - enumerable: !0 - }); - }, s = (e, t, o, s) => { - if (t && typeof t == `object` || typeof t == `function`) for (let c of i(t)) !a.call(e, c) && c !== o && n(e, c, { - get: () => t[c], - enumerable: !(s = r(t, c)) || s.enumerable - }); - return e; - }, c = (e) => s(n({}, `__esModule`, { value: !0 }), e), l = {}; - o(l, { - processTokenResponse: () => g, - refreshTokenRequest: () => h - }), t.exports = c(l); - var d = u$7(`os`); - let f = `@vercel/oidc node-${process.version} ${(0, d.platform)()} (${(0, d.arch)()}) ${(0, d.hostname)()}`, p = null; - async function m() { - if (p) return p; - let e = await fetch(`https://vercel.com/.well-known/openid-configuration`, { headers: { "user-agent": f } }); - if (!e.ok) throw Error(`Failed to discover OAuth endpoints`); - let t = await e.json(); - if (!t || typeof t.token_endpoint != `string`) throw Error(`Invalid OAuth discovery response`); - let n = t.token_endpoint; - return p = n, n; - } - async function h(e) { - let t = await m(); - return await fetch(t, { - method: `POST`, - headers: { - "Content-Type": `application/x-www-form-urlencoded`, - "user-agent": f - }, - body: new URLSearchParams({ - client_id: `cl_HYyOPBNtFMfHhaUn9L4QPfTZz6TP47bp`, - grant_type: `refresh_token`, - ...e - }) - }); - } - async function g(e) { - let t = await e.json(); - if (!e.ok) { - let e = typeof t == `object` && t && `error` in t ? String(t.error) : `Token refresh failed`; - return [Error(e)]; - } - return typeof t != `object` || !t ? [Error(`Invalid token response`)] : typeof t.access_token == `string` ? t.token_type === `Bearer` ? typeof t.expires_in == `number` ? [null, t] : [Error(`Missing expires_in in response`)] : [Error(`Invalid token_type in response`)] : [Error(`Missing access_token in response`)]; - } -})); -var _$5 = s$5(((e, t) => { - var n = Object.defineProperty, r = Object.getOwnPropertyDescriptor, i = Object.getOwnPropertyNames, a = Object.prototype.hasOwnProperty, o = (e, t) => { - for (var r in t) n(e, r, { - get: t[r], - enumerable: !0 - }); - }, s = (e, t, o, s) => { - if (t && typeof t == `object` || typeof t == `function`) for (let c of i(t)) !a.call(e, c) && c !== o && n(e, c, { - get: () => t[c], - enumerable: !(s = r(t, c)) || s.enumerable - }); - return e; - }, c = (e) => s(n({}, `__esModule`, { value: !0 }), e), l = {}; - o(l, { - AccessTokenMissingError: () => u, - RefreshAccessTokenFailedError: () => d - }), t.exports = c(l); - var u = class extends Error { - constructor() { - super(`No authentication found. Please log in with the Vercel CLI (vercel login).`), this.name = `AccessTokenMissingError`; - } - }, d = class extends Error { - constructor(e) { - super(`Failed to refresh authentication token.`, { cause: e }), this.name = `RefreshAccessTokenFailedError`; - } - }; -})); -var v$6 = s$5(((e, t) => { - var n = Object.create, r = Object.defineProperty, i = Object.getOwnPropertyDescriptor, a = Object.getOwnPropertyNames, o = Object.getPrototypeOf, s = Object.prototype.hasOwnProperty, c = (e, t) => { - for (var n in t) r(e, n, { - get: t[n], - enumerable: !0 - }); - }, l = (e, t, n, o) => { - if (t && typeof t == `object` || typeof t == `function`) for (let c of a(t)) !s.call(e, c) && c !== n && r(e, c, { - get: () => t[c], - enumerable: !(o = i(t, c)) || o.enumerable - }); - return e; - }, d = (e, t, i) => (i = e == null ? {} : n(o(e)), l(t || !e || !e.__esModule ? r(i, `default`, { - value: e, - enumerable: !0 - }) : i, e)), f = (e) => l(r({}, `__esModule`, { value: !0 }), e), v = {}; - c(v, { - assertVercelOidcTokenResponse: () => k, - findProjectInfo: () => A, - getTokenPayload: () => N, - getVercelDataDir: () => E, - getVercelOidcToken: () => O, - getVercelToken: () => D, - isExpired: () => P, - loadToken: () => M, - saveToken: () => j - }), t.exports = f(v); - var y = d(u$7(`path`)), b = d(u$7(`fs`)), x = p$9(), S = m$6(), C = h$7(), w = g$6(), T = _$5(); - function E() { - let e = (0, S.getUserDataDir)(); - return e ? y.join(e, `com.vercel.cli`) : null; - } - async function D(e) { - let t = (0, C.readAuthConfig)(); - if (!t?.token) throw new T.AccessTokenMissingError(); - if ((0, C.isValidAccessToken)(t, e?.expirationBufferMs)) return t.token; - if (!t.refreshToken) throw (0, C.writeAuthConfig)({}), new T.RefreshAccessTokenFailedError(`No refresh token available`); - try { - let e = await (0, w.refreshTokenRequest)({ refresh_token: t.refreshToken }), [n, r] = await (0, w.processTokenResponse)(e); - if (n || !r) throw (0, C.writeAuthConfig)({}), new T.RefreshAccessTokenFailedError(n); - let i = { - token: r.access_token, - expiresAt: Math.floor(Date.now() / 1e3) + r.expires_in - }; - return r.refresh_token && (i.refreshToken = r.refresh_token), (0, C.writeAuthConfig)(i), i.token; - } catch (e) { - throw (0, C.writeAuthConfig)({}), e instanceof T.AccessTokenMissingError || e instanceof T.RefreshAccessTokenFailedError ? e : new T.RefreshAccessTokenFailedError(e); - } - } - async function O(e, t, n) { - let r = `https://api.vercel.com/v1/projects/${t}/token?source=vercel-oidc-refresh${n ? `&teamId=${n}` : ``}`, i = await fetch(r, { - method: `POST`, - headers: { Authorization: `Bearer ${e}` } - }); - if (!i.ok) throw new x.VercelOidcTokenError(`Failed to refresh OIDC token: ${i.statusText}`); - let a = await i.json(); - return k(a), a; - } - function k(e) { - if (!e || typeof e != `object`) throw TypeError("Vercel OIDC token is malformed. Expected an object. Please run `vc env pull` and try again"); - if (!(`token` in e) || typeof e.token != `string`) throw TypeError("Vercel OIDC token is malformed. Expected a string-valued token property. Please run `vc env pull` and try again"); - } - function A() { - let e = (0, S.findRootDir)(); - if (!e) throw new x.VercelOidcTokenError("Unable to find project root directory. Have you linked your project with `vc link?`"); - let t = y.join(e, `.vercel`, `project.json`); - if (!b.existsSync(t)) throw new x.VercelOidcTokenError("project.json not found, have you linked your project with `vc link?`"); - let n = JSON.parse(b.readFileSync(t, `utf8`)); - if (typeof n.projectId != `string` && typeof n.orgId != `string`) throw TypeError("Expected a string-valued projectId property. Try running `vc link` to re-link your project."); - return { - projectId: n.projectId, - teamId: n.orgId - }; - } - function j(e, t) { - let n = (0, S.getUserDataDir)(); - if (!n) throw new x.VercelOidcTokenError(`Unable to find user data directory. Please reach out to Vercel support.`); - let r = y.join(n, `com.vercel.token`, `${t}.json`), i = JSON.stringify(e); - b.mkdirSync(y.dirname(r), { - mode: 504, - recursive: !0 - }), b.writeFileSync(r, i), b.chmodSync(r, 432); - } - function M(e) { - let t = (0, S.getUserDataDir)(); - if (!t) throw new x.VercelOidcTokenError(`Unable to find user data directory. Please reach out to Vercel support.`); - let n = y.join(t, `com.vercel.token`, `${e}.json`); - if (!b.existsSync(n)) return null; - let r = JSON.parse(b.readFileSync(n, `utf8`)); - return k(r), r; - } - function N(e) { - let t = e.split(`.`); - if (t.length !== 3) throw new x.VercelOidcTokenError("Invalid token. Please run `vc env pull` and try again"); - let n = t[1].replace(/-/g, `+`).replace(/_/g, `/`), r = n.padEnd(n.length + (4 - n.length % 4) % 4, `=`); - return JSON.parse(Buffer.from(r, `base64`).toString(`utf8`)); - } - function P(e, t = 0) { - return e.exp * 1e3 < Date.now() + t; - } -})); -var y$4 = s$5(((e, t) => { - var n = Object.defineProperty, r = Object.getOwnPropertyDescriptor, i = Object.getOwnPropertyNames, a = Object.prototype.hasOwnProperty, o = (e, t) => { - for (var r in t) n(e, r, { - get: t[r], - enumerable: !0 - }); - }, s = (e, t, o, s) => { - if (t && typeof t == `object` || typeof t == `function`) for (let c of i(t)) !a.call(e, c) && c !== o && n(e, c, { - get: () => t[c], - enumerable: !(s = r(t, c)) || s.enumerable - }); - return e; - }, c = (e) => s(n({}, `__esModule`, { value: !0 }), e), l = {}; - o(l, { refreshToken: () => f }), t.exports = c(l); - var u = p$9(), d = v$6(); - async function f(e) { - let t = e?.project, n = e?.team; - if (!t && !n) { - let e = (0, d.findProjectInfo)(); - t = e.projectId, n = e.teamId; - } else if (!t || !n) { - let e = (0, d.findProjectInfo)(); - t ??= e.projectId, n ??= e.teamId; - } - if (!t) throw new u.VercelOidcTokenError("Failed to refresh OIDC token: No project specified. Try re-linking your project with `vc link`"); - let r = (0, d.loadToken)(t); - if (!r || (0, d.isExpired)((0, d.getTokenPayload)(r.token), e?.expirationBufferMs)) { - let i = await (0, d.getVercelToken)({ expirationBufferMs: e?.expirationBufferMs }); - if (r = await (0, d.getVercelOidcToken)(i, t, n), !r) throw new u.VercelOidcTokenError(`Failed to refresh OIDC token`); - (0, d.saveToken)(r, t); - } - process.env.VERCEL_OIDC_TOKEN = r.token; - } -})); -var b$6 = s$5(((e, t) => { - var n = Object.defineProperty, r = Object.getOwnPropertyDescriptor, i = Object.getOwnPropertyNames, a = Object.prototype.hasOwnProperty, o = (e, t) => { - for (var r in t) n(e, r, { - get: t[r], - enumerable: !0 - }); - }, s = (e, t, o, s) => { - if (t && typeof t == `object` || typeof t == `function`) for (let c of i(t)) !a.call(e, c) && c !== o && n(e, c, { - get: () => t[c], - enumerable: !(s = r(t, c)) || s.enumerable - }); - return e; - }, c = (e) => s(n({}, `__esModule`, { value: !0 }), e), u = {}; - o(u, { getVercelOidcToken: () => h }), t.exports = c(u); - var d = f$6(), m = p$9(); - async function h(e) { - let t = ``, n; - try { - t = (0, d.getVercelOidcTokenSync)(); - } catch (e) { - n = e; - } - try { - let [{ getTokenPayload: n, isExpired: r }, { refreshToken: i }] = await Promise.all([await Promise.resolve().then(() => l$5(v$6())), await Promise.resolve().then(() => l$5(y$4()))]); - (!t || r(n(t), e?.expirationBufferMs)) && (await i(e), t = (0, d.getVercelOidcTokenSync)()); - } catch (e) { - let t = n instanceof Error ? n.message : ``; - throw e instanceof Error && (t = `${t} -${e.message}`), t ? new m.VercelOidcTokenError(t) : e; - } - return t; - } -})); -var x$6 = s$5(((e, t) => { - var n = Object.defineProperty, r = Object.getOwnPropertyDescriptor, i = Object.getOwnPropertyNames, a = Object.prototype.hasOwnProperty, o = (e, t) => { - for (var r in t) n(e, r, { - get: t[r], - enumerable: !0 - }); - }, s = (e, t, o, s) => { - if (t && typeof t == `object` || typeof t == `function`) for (let c of i(t)) !a.call(e, c) && c !== o && n(e, c, { - get: () => t[c], - enumerable: !(s = r(t, c)) || s.enumerable - }); - return e; - }, c = (e) => s(n({}, `__esModule`, { value: !0 }), e), l = {}; - o(l, { - AccessTokenMissingError: () => h.AccessTokenMissingError, - RefreshAccessTokenFailedError: () => h.RefreshAccessTokenFailedError, - getContext: () => m.getContext, - getVercelOidcToken: () => u.getVercelOidcToken, - getVercelOidcTokenSync: () => p.getVercelOidcTokenSync, - getVercelToken: () => g.getVercelToken - }), t.exports = c(l); - var u = b$6(), p = f$6(), m = d$7(), h = _$5(), g = v$6(); -}))(); -var S$7 = x$6.AccessTokenMissingError; -var C$7 = x$6.RefreshAccessTokenFailedError; -var w$7 = x$6.getContext; -var T$7 = x$6.getVercelOidcToken; -var E$7 = x$6.getVercelOidcTokenSync; -var D$6 = x$6.getVercelToken; -//#endregion -//#region node_modules/eve/dist/src/execution/sandbox/bindings/vercel-credentials.js -function getVercelSandboxFetch(e) { - return e.fetch ?? globalThis.fetch; -} -async function getVercelSandboxCredentials(t) { - let n = readNonEmptyString(t, `teamId`) ?? readNonEmptyEnvironmentVariable(`VERCEL_TEAM_ID`) ?? readNonEmptyEnvironmentVariable(`VERCEL_ORG_ID`), r = readNonEmptyString(t, `projectId`) ?? readNonEmptyEnvironmentVariable(`VERCEL_PROJECT_ID`), i = readNonEmptyString(t, `token`) ?? readNonEmptyEnvironmentVariable(`VERCEL_OIDC_TOKEN`) ?? readNonEmptyEnvironmentVariable(`VERCEL_TOKEN`); - return i && n && r ? { - projectId: r, - teamId: n, - token: i - } : getVercelSandboxCredentialsFromOidcToken(await T$7({ - project: r, - team: n - })); -} -function readNonEmptyString(e, t) { - let n = e[t]; - return typeof n == `string` && n.trim().length > 0 ? n.trim() : void 0; -} -function readNonEmptyEnvironmentVariable(e) { - let t = process.env[e]; - return typeof t == `string` && t.trim().length > 0 ? t.trim() : void 0; -} -function getVercelSandboxCredentialsFromOidcToken(e) { - let t = e.split(`.`)[1]; - if (t === void 0) throw Error(`Invalid Vercel OIDC token: missing payload.`); - let n = JSON.parse(Buffer.from(base64UrlToBase64(t), `base64`).toString(`utf8`)), r = typeof n.owner_id == `string` ? n.owner_id : void 0, i = typeof n.project_id == `string` ? n.project_id : void 0; - if (r === void 0 || i === void 0) throw Error(`Invalid Vercel OIDC token: missing owner_id or project_id.`); - return { - projectId: i, - teamId: r, - token: e - }; -} -function base64UrlToBase64(e) { - let t = e.replace(/-/g, `+`).replace(/_/g, `/`); - return t.padEnd(Math.ceil(t.length / 4) * 4, `=`); -} -//#endregion -//#region node_modules/eve/dist/src/execution/sandbox/bindings/vercel-lookup.js -async function getNamedVercelSandbox(e) { - try { - return await e.sandboxModule.Sandbox.get(await getVercelSandboxGetOptions(e)); - } catch (t) { - if (isSandboxMissingError(t)) return null; - throw Error(`Failed to look up Vercel sandbox "${e.sandboxName}": ${errorMessage$1(t)}`, { cause: t }); - } -} -async function getVercelSandboxGetOptions(n) { - let r = { - name: n.sandboxName, - resume: !1 - }; - try { - let i = await getVercelSandboxCredentials(n.createOptions); - return { - ...r, - ...i, - fetch: getVercelSandboxFetch(n.createOptions), - signal: n.createOptions.signal - }; - } catch { - return r; - } -} -function isSandboxMissingError(e) { - return e instanceof Error ? (e.response?.status ?? e.cause?.response?.status) === 404 : !1; -} -function errorMessage$1(e) { - if (e instanceof Error) { - let t = e.json, n = e.text, r = typeof n == `string` && n.length > 0 ? n : t === void 0 ? void 0 : JSON.stringify(t); - return r === void 0 ? e.message : `${e.message}: ${r}`; - } - return String(e); -} -//#endregion -//#region node_modules/eve/dist/src/execution/sandbox/bindings/vercel-read-stream.js -function normalizeVercelReadStream(t) { - if (t === null || isWebReadableStream(t)) return t; - if (t instanceof Readable) return Readable.toWeb(t); - throw TypeError(`Vercel Sandbox returned an unsupported file stream.`); -} -function isWebReadableStream(e) { - return `getReader` in e && typeof e.getReader == `function`; -} -//#endregion -//#region node_modules/eve/dist/src/execution/sandbox/bindings/vercel.js -function createVercelSandbox(e = {}) { - let t = e.loadSandboxModule ?? (async () => await Promise.resolve().then(() => sandbox_exports)), n = { - timeout: DEFAULT_SANDBOX_TIMEOUT_MS, - ...e.createOptions - }, r = e.createSandbox ?? createVercelEveImageSandbox, a = /* @__PURE__ */ new Map(); - return { - name: `vercel`, - async create(e) { - let o = resolveVercelSandboxTags(n.tags, e.tags), l = e.templateKey === null ? null : await readTemplateForCreate({ - createOptions: n, - loadSandboxModule: t, - prewarmedTemplates: a, - templateKey: e.templateKey - }), u = await t(), d; - try { - d = await ensureSession({ - createOptions: n, - createSandbox: r, - existingMetadata: e.existingMetadata, - sandboxModule: u, - sessionKey: e.sessionKey, - snapshotId: l?.snapshotId, - tags: o - }); - } catch (t) { - throw l !== null && (isVercelSnapshotUnavailableError(t) || isVercelSandboxMissingError(t)) ? (a.delete(l.templateKey), await (await getNamedVercelSandbox({ - createOptions: n, - sandboxModule: u, - sandboxName: l.sandboxName - }))?.delete(), new SandboxTemplateNotProvisionedError({ - backendName: `vercel`, - templateKey: l.templateKey - })) : Error(`Failed to create sandbox session "${e.sessionKey}": ${errorMessage(t)}`, { cause: t }); - } - return l === null && d.created && (await ensureVercelSandboxBaseRuntime(d.sandbox), await applyInitialVercelNetworkPolicy(d.sandbox, n.networkPolicy)), createHandle(d.sandbox, e.sessionKey); - }, - async prewarm(e) { - let i; - try { - i = await ensureTemplateWithUnavailableRetry({ - bootstrap: e.bootstrap, - createOptions: n, - createSandbox: r, - loadSandboxModule: t, - log: e.log, - seedFiles: e.seedFiles, - templateKey: e.templateKey - }); - } catch (t) { - throw Error(`Failed to prewarm Vercel sandbox template "${e.templateKey}": ${errorMessage(t)}`, { cause: t }); - } - return a.set(e.templateKey, i.template), { reused: i.reused }; - } - }; -} -async function ensureTemplateWithUnavailableRetry(e) { - try { - return await ensureTemplate(e); - } catch (t) { - if (!isVercelSnapshotUnavailableError(t) && !isVercelSandboxMissingError(t)) throw t; - return e.log?.(`cached template disappeared; rebuilding sandbox template`), await ensureTemplate(e); - } -} -async function readTemplate(e) { - let t = e.prewarmedTemplates.get(e.templateKey); - if (t !== void 0) return t; - let n = await e.loadSandboxModule(), r = await getNamedVercelSandbox({ - createOptions: e.createOptions, - sandboxModule: n, - sandboxName: e.templateKey - }); - if (r === null || typeof r.currentSnapshotId != `string`) throw new SandboxTemplateNotProvisionedError({ - backendName: `vercel`, - templateKey: e.templateKey - }); - return { - sandboxName: r.name, - snapshotId: r.currentSnapshotId, - templateKey: e.templateKey - }; -} -async function readTemplateForCreate(e) { - try { - return await readTemplate(e); - } catch (t) { - throw SandboxTemplateNotProvisionedError.is(t) ? t : Error(`Failed to read sandbox template "${e.templateKey}": ${errorMessage(t)}`, { cause: t }); - } -} -async function ensureTemplate(e) { - let t = await e.loadSandboxModule(), i = await getNamedVercelSandbox({ - createOptions: e.createOptions, - sandboxModule: t, - sandboxName: e.templateKey - }), a = resolveVercelSandboxTags(e.createOptions.tags, e.tags), o = extractAuthorSnapshotId(e.createOptions); - if (i !== null && isUnprovisionedTerminalTemplateSandbox(i, o) && (await i.delete(), i = null), i === null ? i = await e.createSandbox({ - sandboxModule: t, - createOptions: withBaseSetupNetworkPolicy({ - ...e.createOptions, - name: e.templateKey, - persistent: !1, - tags: a - }) - }) : await ensureVercelSandboxTags(i, a), typeof i.currentSnapshotId == `string` && i.currentSnapshotId.length > 0 && i.currentSnapshotId !== o) return { - reused: !0, - template: { - sandboxName: i.name, - snapshotId: i.currentSnapshotId, - templateKey: e.templateKey - } - }; - e.log?.(`preparing base runtime inside sandbox`), await ensureVercelSandboxBaseRuntime(i), await applyInitialVercelNetworkPolicy(i, e.createOptions.networkPolicy); - let s = buildSandboxSession(createVercelInternalSandboxSession(i, e.templateKey), createVercelNetworkPolicySetter(i)); - e.bootstrap !== void 0 && (e.log?.(`running sandbox bootstrap`), await e.bootstrap({ use: async (t) => (t !== void 0 && await i.update(t), createLoggingSandboxSession({ - log: e.log, - session: s - })) })); - for (let t of e.seedFiles) typeof t.content == `string` ? await s.writeTextFile({ - content: t.content, - path: t.path - }) : await s.writeBinaryFile({ - content: t.content, - path: t.path - }); - let c = await i.snapshot(); - return { - reused: !1, - template: { - sandboxName: i.name, - snapshotId: c.snapshotId, - templateKey: e.templateKey - } - }; -} -async function ensureSession(e) { - let t = getVercelSandboxName(e.existingMetadata) ?? e.sessionKey, n = await getNamedVercelSandbox({ - createOptions: e.createOptions, - sandboxModule: e.sandboxModule, - sandboxName: t - }); - if (n !== null) return await ensureVercelSandboxTags(n, e.tags), { - created: !1, - sandbox: n - }; - let r = createSessionCreateParams(e, t); - return e.tags !== void 0 && (r.tags = e.tags), { - created: !0, - sandbox: await e.createSandbox({ - createOptions: r, - sandboxModule: e.sandboxModule - }) - }; -} -function createSessionCreateParams(e, t) { - if (e.snapshotId === void 0) return withBaseSetupNetworkPolicy({ - ...e.createOptions, - name: t, - persistent: !0 - }); - let { runtime: n, source: r, ...i } = e.createOptions; - return { - ...i, - name: t, - persistent: !0, - source: { - snapshotId: e.snapshotId, - type: `snapshot` - } - }; -} -function withBaseSetupNetworkPolicy(e) { - return { - ...e, - networkPolicy: `allow-all` - }; -} -function createHandle(e, t) { - return { - session: buildSandboxSession(createVercelInternalSandboxSession(e, t), createVercelNetworkPolicySetter(e)), - useSessionFn: async (n) => (n !== void 0 && await e.update(n), buildSandboxSession(createVercelInternalSandboxSession(e, t), createVercelNetworkPolicySetter(e))), - async captureState() { - return { - backendName: `vercel`, - metadata: { sandboxName: e.name }, - sessionKey: t - }; - }, - async dispose() {} - }; -} -function createVercelNetworkPolicySetter(e) { - return async (t) => { - await e.update({ networkPolicy: t }); - }; -} -function createVercelInternalSandboxSession(n, r) { - return { - id: r, - resolvePath: resolveVercelSandboxPath, - async spawn(t) { - return adaptMultiplexedCommandToSandboxProcess({ - command: await n.runCommand({ - args: [`-lc`, t.command], - cmd: `bash`, - cwd: t.workingDirectory ?? WORKSPACE_ROOT$1, - detached: !0, - env: t.env, - signal: t.abortSignal - }), - getOutput: (e) => e.stream - }); - }, - async readFile(e) { - return normalizeVercelReadStream(await n.readFile({ path: e.path })); - }, - async writeFile(e) { - let r = await streamToBuffer(e.content); - await n.writeFiles([{ - content: r, - path: e.path - }]); - }, - async removePath(e) { - await n.fs.rm(e.path, { - force: e.force, - recursive: e.recursive, - signal: e.abortSignal - }); - } - }; -} -function resolveVercelSandboxPath(t) { - return t.startsWith(`/`) ? t : `${WORKSPACE_ROOT$1}/${t}`; -} -function isUnprovisionedTerminalTemplateSandbox(e, t) { - let n = e.currentSnapshotId; - return typeof n == `string` && n.length > 0 && n !== t ? !1 : e.status === `aborted` || e.status === `failed` || e.status === `stopped`; -} -function extractAuthorSnapshotId(e) { - let t = e.source; - if (t?.type === `snapshot` && typeof t.snapshotId == `string`) return t.snapshotId; -} -function getVercelSandboxName(e) { - let t = e?.sandboxName; - return typeof t == `string` ? t : void 0; -} -function resolveVercelSandboxTags(e, t) { - let n = {}; - if (e !== void 0) for (let [t, r] of Object.entries(e)) n[t] = r; - if (t !== void 0) for (let [e, r] of Object.entries(t)) n[e] = r; - let r = Object.keys(n).length; - if (r !== 0) { - if (r > VERCEL_SANDBOX_TAG_LIMIT) throw Error(`Vercel Sandbox supports at most ${VERCEL_SANDBOX_TAG_LIMIT} tags. eve reserves "agent", "channel", and "sessionId"; remove or consolidate custom tags passed to vercel().`); - return n; - } -} -async function ensureVercelSandboxTags(e, t) { - t === void 0 || areVercelSandboxTagsEqual(e.tags, t) || await e.update({ tags: t }); -} -function areVercelSandboxTagsEqual(e, t) { - let n = e ?? {}, r = Object.entries(n), i = Object.entries(t); - return r.length === i.length ? i.every(([e, t]) => n[e] === t) : !1; -} -function errorMessage(e) { - if (e instanceof Error) { - let t = e.json, n = e.text, r = typeof n == `string` && n.length > 0 ? n : t === void 0 ? void 0 : JSON.stringify(t); - return r === void 0 ? e.message : `${e.message}: ${r}`; - } - return String(e); -} -const DEFAULT_SANDBOX_TIMEOUT_MS = 1800 * 1e3; -const VERCEL_SANDBOX_TAG_LIMIT = 5; -//#endregion -//#region node_modules/eve/dist/src/public/sandbox/backends/vercel.js -function vercel(e) { - return createVercelSandbox({ createOptions: e }); -} -//#endregion -//#region node_modules/eve/dist/src/public/sandbox/backends/default.js -const PRODUCTION_PROBES = { - isDeployedOnVercel: () => !!process.env.VERCEL, - isDockerAvailable: () => isDockerDaemonAvailableSync(), - isMicrosandboxSupported: () => isMicrosandboxPlatformSupported() -}; -function defaultSandbox(t) { - return lazyBackend(() => selectDefaultSandbox(t, PRODUCTION_PROBES)); -} -function selectDefaultSandbox(e, t) { - return t.isDeployedOnVercel() ? vercel(e?.vercel) : t.isDockerAvailable() ? docker(e?.docker) : t.isMicrosandboxSupported() ? microsandbox(e?.microsandbox) : justbash(e?.justBash); -} -//#endregion -//#region node_modules/eve/dist/src/runtime/resolve-sandbox.js -async function resolveSandboxDefinition(n, i, a) { - try { - let t = expectObjectRecord(await loadResolvedModuleExport({ - definition: n, - kindLabel: `sandbox`, - moduleMap: i, - nodeId: a - }), `Expected the sandbox export "${n.exportName ?? `default`}" from "${n.logicalPath}" to return an object.`); - return { - backend: resolveBackend(t.backend, n.logicalPath), - bootstrap: t.bootstrap, - description: n.description, - exportName: n.exportName, - logicalPath: n.logicalPath, - onSession: t.onSession, - revalidationKey: n.revalidationKey, - sourceHash: n.sourceHash, - sourceId: n.sourceId, - sourceKind: `module` - }; - } catch (e) { - throw e instanceof ResolveAgentError ? e : new ResolveAgentError(`Failed to attach the sandbox lifecycle handlers from "${n.logicalPath}": ${toErrorMessage(e)}`, { - logicalPath: n.logicalPath, - sourceId: n.sourceId - }); - } -} -function resolveBackend(e, t) { - if (e === void 0) return defaultSandbox(); - if (typeof e == `function`) return lazyBackend(e); - if (typeof e != `object` || !e) throw new ResolveAgentError(`Sandbox "${t}" exposed a non-object "backend" field. Use docker(), vercel(), another factory that returns a SandboxBackend value, or a zero-arg callback returning one.`, { logicalPath: t }); - let r = e; - if (typeof r.name != `string` || r.name.length === 0) throw new ResolveAgentError(`Sandbox "${t}" backend is missing a non-empty string "name" identifier.`, { logicalPath: t }); - if (typeof r.create != `function`) throw new ResolveAgentError(`Sandbox "${t}" backend is missing a "create" function.`, { logicalPath: t }); - return r; -} -//#endregion -//#region node_modules/eve/dist/src/runtime/resolve-dynamic-instructions.js -async function resolveDynamicInstructionsDefinition(i, a, o) { - try { - let n = expectObjectRecord(expectObjectRecord(await loadResolvedModuleExport({ - definition: i, - kindLabel: `dynamic-instructions`, - moduleMap: a, - nodeId: o - }), describe$3(i, `to return an object`)).events, describe$3(i, `to provide an events object`)), r = {}; - for (let t of i.eventNames) r[t] = expectFunction(n[t], describe$3(i, `to provide a handler for event "${t}"`)); - return { - eventNames: [...i.eventNames], - events: r, - exportName: i.exportName, - logicalPath: i.logicalPath, - slug: i.slug, - sourceId: i.sourceId, - sourceKind: `module` - }; - } catch (e) { - throw e instanceof ResolveAgentError ? e : new ResolveAgentError(`Failed to resolve dynamic instructions from "${i.logicalPath}": ${toErrorMessage(e)}`, { - logicalPath: i.logicalPath, - sourceId: i.sourceId - }); - } -} -function describe$3(e, t) { - return `Expected the dynamic instructions export "${e.exportName ?? `default`}" from "${e.logicalPath}" ${t}.`; -} -//#endregion -//#region node_modules/eve/dist/src/runtime/resolve-dynamic-skill.js -async function resolveDynamicSkillDefinition(i, a, o) { - try { - let n = expectObjectRecord(expectObjectRecord(await loadResolvedModuleExport({ - definition: i, - kindLabel: `dynamic-skill`, - moduleMap: a, - nodeId: o - }), describe$2(i, `to return an object`)).events, describe$2(i, `to provide an events object`)), r = {}; - for (let t of i.eventNames) r[t] = expectFunction(n[t], describe$2(i, `to provide a handler for event "${t}"`)); - return { - eventNames: [...i.eventNames], - events: r, - exportName: i.exportName, - logicalPath: i.logicalPath, - slug: i.slug, - sourceId: i.sourceId, - sourceKind: `module` - }; - } catch (e) { - throw e instanceof ResolveAgentError ? e : new ResolveAgentError(`Failed to resolve dynamic skill from "${i.logicalPath}": ${toErrorMessage(e)}`, { - logicalPath: i.logicalPath, - sourceId: i.sourceId - }); - } -} -function describe$2(e, t) { - return `Expected the dynamic skill export "${e.exportName ?? `default`}" from "${e.logicalPath}" ${t}.`; -} -//#endregion -//#region node_modules/eve/dist/src/runtime/resolve-dynamic-tool.js -async function resolveDynamicToolDefinition(i, a, o) { - try { - let n = expectObjectRecord(await loadResolvedModuleExport({ - definition: i, - kindLabel: `dynamic-tool`, - moduleMap: a, - nodeId: o - }), describe$1(i, `to return an object`)), r = expectObjectRecord(n.events, describe$1(i, `to provide an events object`)), s = {}; - for (let t of i.eventNames) s[t] = expectFunction(r[t], describe$1(i, `to provide a handler for event "${t}"`)); - let c = `dynamic-tool-source:${i.sourceId}`; - return stampDefinitionKey(n, c), registerDefinitionSource(c, { - kind: `tool`, - logicalPath: i.logicalPath, - name: i.slug - }), { - eventNames: [...i.eventNames], - events: s, - exportName: i.exportName, - logicalPath: i.logicalPath, - slug: i.slug, - sourceId: i.sourceId, - sourceKind: `module` - }; - } catch (e) { - throw e instanceof ResolveAgentError ? e : new ResolveAgentError(`Failed to resolve dynamic tool from "${i.logicalPath}": ${toErrorMessage(e)}`, { - logicalPath: i.logicalPath, - sourceId: i.sourceId - }); - } -} -function describe$1(e, t) { - return `Expected the dynamic tool export "${e.exportName ?? `default`}" from "${e.logicalPath}" ${t}.`; -} -//#endregion -//#region node_modules/eve/dist/src/runtime/resolve-tool.js -async function resolveToolDefinition(i, a, o) { - try { - let n = expectObjectRecord(await loadResolvedModuleExport({ - definition: i, - kindLabel: `tool`, - moduleMap: a, - nodeId: o - }), describe(i, `to return an object`)), r = { - kind: `tool`, - logicalPath: i.logicalPath, - name: i.name - }, s = `tool-source:${i.sourceId}`; - stampDefinitionKey(n, s), registerDefinitionSource(s, r), registerDefinitionSource(`tool:${n.description}`, r); - let c = expectFunction(n.execute, describe(i, `to provide an execute function`)); - return { - description: i.description, - execute: c, - exportName: i.exportName, - inputSchema: i.inputSchema, - logicalPath: i.logicalPath, - name: i.name, - outputSchema: i.outputSchema, - sourceId: i.sourceId, - sourceKind: `module`, - ...extractOptionalHooks(n, i) - }; - } catch (e) { - throw e instanceof ResolveAgentError ? e : new ResolveAgentError(`Failed to attach the tool execute function from "${i.logicalPath}": ${toErrorMessage(e)}`, { - logicalPath: i.logicalPath, - sourceId: i.sourceId - }); - } -} -function extractOptionalHooks(t, n) { - let r = {}; - return t.approval !== void 0 && (r.approval = expectFunction(t.approval, describe(n, `to provide an approval function`))), t.toModelOutput !== void 0 && (r.toModelOutput = expectFunction(t.toModelOutput, describe(n, `to provide a toModelOutput function`))), t.inputSchema !== void 0 && isFlexibleSchema(t.inputSchema) && (r.inputStandardSchema = t.inputSchema), t.outputSchema !== void 0 && isFlexibleSchema(t.outputSchema) && (r.outputStandardSchema = t.outputSchema), r; -} -function describe(e, t) { - return `Expected the tool export "${e.exportName ?? `default`}" from "${e.logicalPath}" ${t}.`; -} -function isFlexibleSchema(e) { - return typeof e == `object` && !!e && `~standard` in e && typeof e[`~standard`] == `object`; -} -//#endregion -//#region node_modules/eve/dist/src/runtime/resolve-agent.js -async function resolveAgent(e) { - let t = e.manifest.skills.map((e) => ({ - ...e, - metadata: e.metadata === void 0 ? void 0 : { ...e.metadata } - })), r = [], i = []; - for (let t of e.manifest.channels) { - if (t.kind === `disabled`) { - i.push(t.name); - continue; - } - r.push(await resolveChannelDefinition(t, e.moduleMap, e.nodeId)); - } - let a = await Promise.all(e.manifest.tools.map((t) => resolveToolDefinition(t, e.moduleMap, e.nodeId))), o = await Promise.all((e.manifest.dynamicInstructions ?? []).map((t) => resolveDynamicInstructionsDefinition(t, e.moduleMap, e.nodeId))), s = await Promise.all((e.manifest.dynamicSkills ?? []).map((t) => resolveDynamicSkillDefinition(t, e.moduleMap, e.nodeId))), c = await Promise.all(e.manifest.dynamicTools.map((t) => resolveDynamicToolDefinition(t, e.moduleMap, e.nodeId))), l = await Promise.all(e.manifest.hooks.map((t) => resolveHookDefinition(t, e.moduleMap, e.nodeId))), u = await Promise.all(e.manifest.connections.map((t) => resolveConnectionDefinition(t, e.moduleMap, e.nodeId))), d = e.manifest.sandbox === null ? null : await resolveSandboxDefinition(e.manifest.sandbox, e.moduleMap, e.nodeId), f = createResolvedInstructions(e.manifest.instructions), p = e.manifest.workspaceResourceRoot, m = { - channels: r, - config: createResolvedAgentConfig(e.manifest), - connections: u, - disabledFrameworkChannels: i, - disabledFrameworkTools: [...e.manifest.disabledFrameworkTools], - workflowEnabled: e.manifest.workflowEnabled, - dynamicInstructionsResolvers: o, - dynamicSkillResolvers: s, - dynamicToolResolvers: c, - hooks: l, - metadata: { - agentRoot: e.manifest.agentRoot, - appRoot: e.manifest.appRoot, - diagnosticsSummary: e.manifest.diagnosticsSummary - }, - sandbox: d, - workspaceResourceRoot: p, - skills: t, - tools: a, - workspaceSpec: { rootEntries: [...p.rootEntries] } - }; - return f === void 0 ? m : { - ...m, - instructions: f - }; -} -function createResolvedInstructions(e) { - if (e !== void 0) return { - name: e.name, - logicalPath: e.logicalPath, - markdown: e.markdown, - sourceId: e.sourceId, - sourceKind: e.sourceKind - }; -} -function createResolvedAgentConfig(e) { - let n = { - model: e.config.model.source === void 0 ? { - id: e.config.model.id, - contextWindowTokens: e.config.model.contextWindowTokens, - providerOptions: e.config.model.providerOptions - } : { - contextWindowTokens: e.config.model.contextWindowTokens, - id: e.config.model.id, - providerOptions: e.config.model.providerOptions, - source: { - exportName: e.config.model.source.exportName, - sourceKind: `module`, - logicalPath: e.config.model.source.logicalPath, - sourceId: e.config.model.source.sourceId - } - }, - name: e.config.name - }; - if (e.config.compaction !== void 0) { - let t = {}; - e.config.compaction.model !== void 0 && (t.model = e.config.compaction.model.source === void 0 ? { - contextWindowTokens: e.config.compaction.model.contextWindowTokens, - id: e.config.compaction.model.id, - providerOptions: e.config.compaction.model.providerOptions - } : { - contextWindowTokens: e.config.compaction.model.contextWindowTokens, - id: e.config.compaction.model.id, - providerOptions: e.config.compaction.model.providerOptions, - source: { - exportName: e.config.compaction.model.source.exportName, - sourceKind: `module`, - logicalPath: e.config.compaction.model.source.logicalPath, - sourceId: e.config.compaction.model.source.sourceId - } - }), e.config.compaction.thresholdPercent !== void 0 && (t.thresholdPercent = e.config.compaction.thresholdPercent), n.compaction = t; - } - return e.config.experimental !== void 0 && (n.experimental = { workflow: e.config.experimental.workflow === void 0 ? void 0 : { world: e.config.experimental.workflow.world } }), e.config.outputSchema !== void 0 && (n.outputSchema = e.config.outputSchema), e.config.reasoning !== void 0 && (n.reasoning = e.config.reasoning), e.config.source !== void 0 && (n.source = createResolvedModuleSourceRef(e.config.source)), n; -} -//#endregion -//#region node_modules/eve/dist/src/execution/skills/instructions.js -function formatAvailableSkillsSection(e) { - return e.length === 0 ? null : [ - `Available skills`, - `Listed skills are available in this run. Do not claim a listed skill is inaccessible unless activation or workspace inspection actually fails.`, - `If the user names a skill or the request clearly matches one of the descriptions below, call load_skill before proceeding.`, - `If multiple skills match, activate the minimal set that covers the task. After activation, follow the returned instructions instead of improvising around them.`, - `If activation fails, say so briefly and continue with the best fallback. Packaged sibling files under a skill path can be inspected with bash or read_file when needed.`, - ...e.map((e) => formatAvailableSkillLine(e)) - ].join(` -`); -} -function formatAvailableSkillLine(t) { - return `- ${t.name}: ${t.description} (path: ${WORKSPACE_ROOT$1}/skills/${t.name}/SKILL.md)`; -} -//#endregion -//#region node_modules/eve/dist/src/runtime/workspace/spec.js -function createWorkspacePromptSection(t) { - return t.rootEntries.length === 0 ? void 0 : [ - `Workspace`, - `- You have access to authored files mounted at the workspace root for this run.`, - `- The live workspace root visible to \`bash\` in this run is \`${WORKSPACE_ROOT$1}\`.`, - `- Root entries under ${WORKSPACE_ROOT$1}/:`, - ...t.rootEntries.map((e) => ` - ${e}`), - `- Treat \`${WORKSPACE_ROOT$1}\` as the workspace root for this run unless a \`bash\` call shows otherwise.`, - "- For questions about workspace paths or file availability, verify with `bash` first using commands like `pwd`, `ls`, and `find`.", - "- If the required `bash` verification fails, report that failure directly instead of answering from this overview.", - "- Use the `bash` tool with `ls`, `find`, and `rg` to inspect deeper contents when needed.", - `- Do not claim these files are unavailable unless a workspace or tool call actually fails.` - ].join(` -`); -} -//#endregion -//#region node_modules/eve/dist/src/runtime/prompt/connections.js -function formatConnectionsSection(e) { - return [ - `## Connections`, - ``, - `You have direct access to the following external services through connected MCP servers and OpenAPI HTTP APIs.`, - `When the user's request relates to any of these services, use them instead of web search or general knowledge.`, - ``, - `Available connections:`, - ...e.map((e) => `- ${e.connectionName}: ${e.description}`), - ``, - `Use connection_search to discover specific tools within a connection. Discovered tools become directly callable by their qualified name (e.g. linear__list_issues) in your next response.` - ].join(` -`); -} -//#endregion -//#region node_modules/eve/dist/src/runtime/prompt/compose.js -function composeRuntimeBasePrompt(e) { - return [ - ...createInstructionsPromptBlocks(e.instructions), - ...createWorkspacePromptBlocks(e.workspaceSpec), - ...e.toolsAvailable ? [`Tool execution -A single tool or subagent call runs as one serial action. If you call multiple independent tools or subagents in one response, eve treats that batch as parallel work. Only batch work that is independent and does not rely on another call in the same response.`] : [], - ...createConnectionsPromptBlocks(e.connections), - ...createSkillsPromptBlocks(e.skills) - ]; -} -function createInstructionsPromptBlocks(e) { - if (e === void 0) return []; - let t = e.markdown.trim(); - return t.length === 0 ? [] : [`Instructions (${e.name})\n${t}`]; -} -function createWorkspacePromptBlocks(e) { - if (e === void 0) return []; - let n = createWorkspacePromptSection(e); - return n === void 0 ? [] : [n]; -} -function createConnectionsPromptBlocks(e) { - return !e || e.length === 0 ? [] : [formatConnectionsSection(e)]; -} -function createSkillsPromptBlocks(t) { - if (!t || t.length === 0) return []; - let n = formatAvailableSkillsSection(t); - return n === null ? [] : [n]; -} -//#endregion -//#region node_modules/eve/dist/src/runtime/agent/bootstrap.js -const BOOTSTRAP_RUNTIME_MODEL_ID = `eve-bootstrap-model`; -const BOOTSTRAP_RUNTIME_SYSTEM_PROMPT = `You are the eve bootstrap agent. Be concise, stay grounded in the current conversation, and do not assume tools are available unless the runtime provides them.`; -function createResolvedRuntimeTurnAgent(e) { - let t = e.agent; - return { - id: t.config.name, - instructions: composeRuntimeBasePrompt({ - connections: t.connections, - instructions: t.instructions, - skills: t.skills, - toolsAvailable: e.tools.length > 0, - workspaceSpec: t.workspaceSpec - }), - compactionModel: t.config.compaction?.model, - model: t.config.model, - nodeId: e.nodeId, - outputSchema: t.config.outputSchema, - reasoning: t.config.reasoning, - tools: [...e.tools], - workspaceSpec: t.workspaceSpec - }; -} -//#endregion -//#region node_modules/eve/dist/src/runtime/hooks/registry.js -function createRuntimeHookRegistry(e) { - let t = /* @__PURE__ */ new Map(), n = []; - for (let r of e) for (let [e, i] of Object.entries(r.events)) { - let a = { - slug: r.slug, - handler: i, - eventType: e - }; - if (e === `*`) n.push(a); - else { - let n = t.get(e) ?? []; - n.push(a), t.set(e, n); - } - } - return { - streamEventsByType: t, - streamEventsWildcard: n - }; -} -//#endregion -//#region node_modules/eve/dist/src/runtime/sandbox/registry.js -const DEFAULT_SANDBOX_SOURCE_ID = `eve:default-sandbox`; -function createRuntimeSandboxRegistry(e) { - return { sandbox: { - definition: e.authoredSandbox ?? createFrameworkSandboxDefinition(), - workspaceResourceRoot: e.workspaceResourceRoot - } }; -} -function createFrameworkSandboxDefinition() { - return { - backend: defaultSandbox(), - logicalPath: `eve:framework/default-sandbox`, - sourceId: DEFAULT_SANDBOX_SOURCE_ID, - sourceKind: `module` - }; -} -//#endregion -//#region node_modules/eve/dist/src/runtime/resolve-agent-graph.js -var ResolveRuntimeAgentGraphError = class extends Error { - logicalPath; - nodeId; - sourceId; - constructor(e, t = {}) { - super(e), this.name = `ResolveRuntimeAgentGraphError`, t.logicalPath !== void 0 && (this.logicalPath = t.logicalPath), t.nodeId !== void 0 && (this.nodeId = t.nodeId), t.sourceId !== void 0 && (this.sourceId = t.sourceId); - } -}; -async function resolveRuntimeAgentGraph(e) { - let n = /* @__PURE__ */ new Map(), r = createChildNodeIdsByParentNodeId(e.manifest), i = new Map(e.manifest.subagents.map((e) => [e.nodeId, e])); - return { - nodesByNodeId: n, - root: await resolveRuntimeAgentNode({ - childNodeIdsByParentNodeId: r, - manifest: e.manifest, - moduleMap: e.moduleMap, - nodeId: ROOT_COMPILED_AGENT_NODE_ID, - nodesByNodeId: n, - subagentNodesById: i - }) - }; -} -async function resolveRuntimeAgentNode(e) { - let t = toRuntimeNodeId(e.nodeId); - if (e.nodesByNodeId.has(t)) throw new ResolveRuntimeAgentGraphError(`Found multiple runtime agent nodes for node id "${t}".`, { - nodeId: t, - sourceId: e.sourceId - }); - let a = await resolveAgent({ - manifest: e.manifest, - moduleMap: e.moduleMap, - nodeId: e.nodeId - }), o = a.connections.length > 0, s = getFrameworkToolDefinitions({ hasConnections: o }), c = new Set(s.map((e) => e.name)), l = getAllFrameworkToolNames(), u = new Set(a.tools.map((e) => e.name)); - for (let n of a.disabledFrameworkTools) if (!l.has(n)) throw new ResolveRuntimeAgentGraphError(`agent/tools/${n}.ts exports disableTool() but "${n}" is not a framework tool. Rename the file to one of: ${[...l].sort().join(`, `)}.`, { - nodeId: t, - sourceId: e.sourceId - }); - let d = new Set(a.disabledFrameworkTools), f = await createRuntimeToolRegistry({ tools: [...s.filter((e) => !u.has(e.name) && !d.has(e.name)), ...a.tools] }, { reservedToolNames: [WORKFLOW_TOOL_NAME, ...c.has(LOAD_SKILL_TOOL_NAME) || u.has(LOAD_SKILL_TOOL_NAME) ? [] : [LOAD_SKILL_TOOL_NAME]] }), p = new Set(a.channels.map((e) => e.name)), m = getAllFrameworkChannelNames(); - for (let n of a.disabledFrameworkChannels) if (!m.has(n)) throw new ResolveRuntimeAgentGraphError(`agent/channels/${n}.ts exports disableRoute() but "${n}" is not a framework channel. Rename the file to one of: ${[...m].sort().join(`, `)}.`, { - nodeId: t, - sourceId: e.sourceId - }); - let h = new Set(a.disabledFrameworkChannels), g = [...getFrameworkChannelDefinitions().filter((e) => !p.has(e.name) && !h.has(e.name)), ...a.channels], _ = createRuntimeSandboxRegistry({ - authoredSandbox: a.sandbox, - workspaceResourceRoot: a.workspaceResourceRoot - }), v = createRuntimeSubagentRegistry({ - reservedToolNames: [LOAD_SKILL_TOOL_NAME, ...f.preparedTools.map((e) => e.name)], - subagents: await resolveRuntimeSubagents({ - childNodeIdsByParentNodeId: e.childNodeIdsByParentNodeId, - manifest: e.manifest, - moduleMap: e.moduleMap, - nodesByNodeId: e.nodesByNodeId, - parentNodeId: e.nodeId, - subagentNodesById: e.subagentNodesById - }) - }), y = o ? { - ...a, - dynamicToolResolvers: [...a.dynamicToolResolvers, createConnectionSearchResolver()] - } : a, b = { - agent: y, - channels: g, - hookRegistry: createRuntimeHookRegistry(y.hooks), - nodeId: t, - sandboxRegistry: _, - sourceId: e.sourceId, - subagentRegistry: v, - toolRegistry: f, - turnAgent: createResolvedRuntimeTurnAgent({ - agent: y, - nodeId: t, - tools: [...f.preparedTools, ...v.preparedTools] - }) - }; - return e.nodesByNodeId.set(t, b), b; -} -async function resolveRuntimeSubagents(e) { - let t = [], n = e.childNodeIdsByParentNodeId.get(e.parentNodeId) ?? []; - for (let r of n) { - let n = e.subagentNodesById.get(r); - if (n === void 0) throw new ResolveRuntimeAgentGraphError(`Missing compiled subagent node "${r}" while resolving runtime subagents.`, { - nodeId: toRuntimeNodeId(e.parentNodeId), - sourceId: r - }); - t.push(await resolveRuntimeSubagent({ - childNodeIdsByParentNodeId: e.childNodeIdsByParentNodeId, - moduleMap: e.moduleMap, - nodesByNodeId: e.nodesByNodeId, - sourceRef: n, - subagentNodesById: e.subagentNodesById - })); - } - for (let n of e.manifest.remoteAgents) t.push(await resolveRuntimeRemoteAgent({ - moduleMap: e.moduleMap, - nodeScopeId: e.parentNodeId, - sourceRef: n - })); - return t; -} -async function resolveRuntimeSubagent(e) { - let t = { - description: e.sourceRef.description, - kind: `subagent`, - logicalPath: e.sourceRef.logicalPath, - name: e.sourceRef.name, - nodeId: toRuntimeNodeId(e.sourceRef.nodeId), - sourceId: e.sourceRef.sourceId, - sourceKind: `module` - }; - return await resolveRuntimeAgentNode({ - childNodeIdsByParentNodeId: e.childNodeIdsByParentNodeId, - manifest: e.sourceRef.agent, - moduleMap: e.moduleMap, - nodeId: e.sourceRef.nodeId, - nodesByNodeId: e.nodesByNodeId, - sourceId: e.sourceRef.sourceId, - subagentNodesById: e.subagentNodesById - }), t; -} -async function resolveRuntimeRemoteAgent(t) { - let n = expectObjectRecord(await loadResolvedModuleExport({ - definition: t.sourceRef, - kindLabel: `remote agent`, - moduleMap: t.moduleMap, - nodeId: t.nodeScopeId - }), `Expected remote agent source "${t.sourceRef.logicalPath}" to export an object.`), r = { - description: t.sourceRef.description, - kind: `remote`, - logicalPath: t.sourceRef.logicalPath, - name: t.sourceRef.name, - nodeId: toRuntimeNodeId(t.sourceRef.nodeId), - outputSchema: t.sourceRef.outputSchema, - path: t.sourceRef.path, - sourceId: t.sourceRef.sourceId, - sourceKind: `module`, - url: t.sourceRef.url - }; - typeof n.auth == `function` && (r.auth = n.auth); - let i = resolveRemoteAgentHeaders(n.headers); - return i !== void 0 && (r.headers = i), r; -} -function resolveRemoteAgentHeaders(e) { - if (e === void 0) return; - if (typeof e == `function`) return e; - if (typeof e != `object` || !e || Array.isArray(e)) return; - let t = {}; - for (let [n, r] of Object.entries(e)) typeof r == `string` && (t[n] = r); - return t; -} -function createChildNodeIdsByParentNodeId(e) { - let t = /* @__PURE__ */ new Map(); - for (let n of e.subagentEdges) { - let e = t.get(n.parentNodeId); - if (e === void 0) { - t.set(n.parentNodeId, [n.childNodeId]); - continue; - } - e.push(n.childNodeId); - } - return t; -} -function toRuntimeNodeId(e) { - return e === ROOT_COMPILED_AGENT_NODE_ID ? ROOT_RUNTIME_AGENT_NODE_ID : e; -} -//#endregion -//#region node_modules/eve/dist/src/compiler/module-map.js -const compiledModuleNodeScopeSchema = Ls$3.object({ modules: Ls$3.record(Ls$3.string(), Ls$3.object({}).passthrough()) }).strict(); -const compiledModuleMapSchema = Ls$3.object({ nodes: Ls$3.record(Ls$3.string(), compiledModuleNodeScopeSchema) }).strict(); -function collectModuleRefsForManifest(e) { - let t = /* @__PURE__ */ new Map(); - e.config.source !== void 0 && t.set(e.config.source.sourceId, e.config.source), e.config.model.source !== void 0 && t.set(e.config.model.source.sourceId, e.config.model.source); - for (let n of e.channels) n.kind !== `disabled` && t.set(n.sourceId, { - exportName: n.exportName, - sourceKind: `module`, - logicalPath: n.logicalPath, - sourceId: n.sourceId - }); - for (let n of e.connections) t.set(n.sourceId, { - exportName: n.exportName, - sourceKind: `module`, - logicalPath: n.logicalPath, - sourceId: n.sourceId - }); - for (let n of e.tools) t.set(n.sourceId, { - exportName: n.exportName, - sourceKind: `module`, - logicalPath: n.logicalPath, - sourceId: n.sourceId - }); - for (let n of e.dynamicInstructions) t.set(n.sourceId, { - exportName: n.exportName, - sourceKind: `module`, - logicalPath: n.logicalPath, - sourceId: n.sourceId - }); - for (let n of e.dynamicSkills) t.set(n.sourceId, { - exportName: n.exportName, - sourceKind: `module`, - logicalPath: n.logicalPath, - sourceId: n.sourceId - }); - for (let n of e.dynamicTools) t.set(n.sourceId, { - exportName: n.exportName, - sourceKind: `module`, - logicalPath: n.logicalPath, - sourceId: n.sourceId - }); - for (let n of e.remoteAgents) t.set(n.sourceId, { - exportName: n.exportName, - sourceKind: `module`, - logicalPath: n.logicalPath, - sourceId: n.sourceId - }); - for (let n of e.hooks) t.set(n.sourceId, { - exportName: n.exportName, - sourceKind: `module`, - logicalPath: n.logicalPath, - sourceId: n.sourceId - }); - for (let n of e.schedules) n.sourceKind !== `module` || !n.hasRun || t.set(n.sourceId, { - sourceKind: `module`, - logicalPath: n.logicalPath, - sourceId: n.sourceId - }); - return e.sandbox !== null && t.set(e.sandbox.sourceId, { - exportName: e.sandbox.exportName, - sourceKind: `module`, - logicalPath: e.sandbox.logicalPath, - sourceId: e.sandbox.sourceId - }), [...t.values()]; -} -//#endregion -//#region node_modules/eve/dist/src/runtime/loaders/module-map.js -const BUNDLED_MODULE_MAP_SOURCE = `bundled compiled module map`; -var LoadCompiledModuleMapError = class extends Error { - moduleMapPath; - constructor(e, t) { - super(e), this.name = `LoadCompiledModuleMapError`, t !== void 0 && (this.moduleMapPath = t); - } -}; -async function loadCompiledModuleMap(e) { - let r = e.compiledArtifactsSource.kind === `disk` ? resolveRuntimeCompilerArtifactPaths(e.compiledArtifactsSource.appRoot).moduleMapPath : void 0; - if (r !== void 0) { - let e = createFileImportSpecifier$1(r); - try { - let t = await import(e); - return parseCompiledModuleMap(t.moduleMap ?? t.default, r); - } catch (e) { - throw new LoadCompiledModuleMapError(formatLoadErrorMessage$1(e), r); - } - } - let a = readBundledCompiledArtifacts(); - if (a !== null) return parseCompiledModuleMap(a.moduleMap, BUNDLED_MODULE_MAP_SOURCE); - throw new LoadCompiledModuleMapError(`Compiled module map is unavailable without an app root or bundled compiled artifacts.`, BUNDLED_MODULE_MAP_SOURCE); -} -function parseCompiledModuleMap(t, n) { - let i = compiledModuleMapSchema.safeParse(t); - if (!i.success) throw new LoadCompiledModuleMapError(`Expected "${n}" to export a valid compiled eve module map. ${formatValidationError(i.error)}`, n); - return i.data; -} -function formatLoadErrorMessage$1(e) { - return e instanceof Error ? e.message : `Unknown module-map load failure.`; -} -function createFileImportSpecifier$1(e) { - let t = e.replaceAll(`\\`, `/`); - return /^[A-Za-z]:\//.test(t) ? `file:///${encodeURI(t)}` : t.startsWith(`/`) ? `file://${encodeURI(t)}` : t; -} -//#endregion -//#region node_modules/eve/dist/src/discover/filesystem.js -const PROJECT_MARKER_FILE_NAMES = [`package.json`, `vercel.json`]; -const PROJECT_MARKER_FILE_NAME_SET = new Set(PROJECT_MARKER_FILE_NAMES); -//#endregion -//#region node_modules/eve/dist/src/internal/authored-asset-import-plugin.js -const AUTHORED_ASSET_CODE_EXTENSIONS = [ - `.ts`, - `.tsx`, - `.mts`, - `.cts`, - `.js`, - `.jsx`, - `.mjs`, - `.cjs`, - `.json` -]; -function createAuthoredAssetImportPlugin() { - return { - name: `eve-authored-asset-import`, - resolveId(t, i) { - if (!isPotentialAuthoredAssetImport(t) || i === void 0) return; - let { path: a, suffix: o } = splitImportSuffix(t); - return `${isAbsolute(a) ? a : resolve(dirname(i), a)}${o}`; - }, - async load(e) { - let { path: t, suffix: n } = splitImportSuffix(e); - if (!isPotentialAuthoredAssetImport(t)) return; - if (n === `?raw`) { - let e = await readAssetText(t); - return e === void 0 ? void 0 : { - code: `export default ${JSON.stringify(e)};`, - moduleType: `js` - }; - } - let r = await readAssetDataUrl(t); - if (r !== void 0) return { - code: `export default ${JSON.stringify(r)};`, - moduleType: `js` - }; - } - }; -} -async function readAssetText(e) { - try { - return await readFile(e, `utf8`); - } catch (e) { - if (isPathNotFoundError$1(e)) return; - throw e; - } -} -function isPotentialAuthoredAssetImport(e) { - if (e.startsWith(`\0`) || e.startsWith(`node:`) || e.startsWith(`data:`) || e.startsWith(`file:`)) return !1; - let { path: n } = splitImportSuffix(e); - if (!n.startsWith(`.`) && !n.startsWith(`/`) && !/^[A-Za-z]:[\\/]/.test(n)) return !1; - let r = extname(n); - return r.length > 0 && r !== `.node` && !AUTHORED_ASSET_CODE_EXTENSIONS.includes(r); -} -function splitImportSuffix(e) { - let t = e.indexOf(`?`), n = e.indexOf(`#`), r = t === -1 ? n : n === -1 ? t : Math.min(t, n); - return r === -1 ? { - path: e, - suffix: `` - } : { - path: e.slice(0, r), - suffix: e.slice(r) - }; -} -async function readAssetDataUrl(e) { - try { - let t = await readFile(e); - return `data:${getAssetMimeType(e)};base64,${t.toString(`base64`)}`; - } catch (e) { - if (isPathNotFoundError$1(e)) return; - throw e; - } -} -function isPathNotFoundError$1(e) { - return typeof e == `object` && !!e && `code` in e && (e.code === `ENOENT` || e.code === `ENOTDIR`); -} -function getAssetMimeType(e) { - switch (extname(e).toLowerCase()) { - case `.css`: return `text/css`; - case `.csv`: return `text/csv`; - case `.gif`: return `image/gif`; - case `.html`: return `text/html`; - case `.jpg`: - case `.jpeg`: return `image/jpeg`; - case `.png`: return `image/png`; - case `.svg`: return `image/svg+xml`; - case `.txt`: return `text/plain`; - case `.wasm`: return `application/wasm`; - case `.webp`: return `image/webp`; - default: return `application/octet-stream`; - } -} -//#endregion -//#region node_modules/eve/dist/src/internal/authored-module-bundle.js -function createAuthoredModuleBundleError(e, t) { - let n = t instanceof Error ? t.message : String(t), r = []; - return (/\.node(?:\b|["'?])/i.test(n) || /native addon|native module|invalid utf-?8|Could not load .*\.node/i.test(n)) && r.push(`If this comes from a native Node package, keep that package external with agent build.externalDependencies so Vercel/Nitro traces it instead of bundling it.`), /Unexpected character|No loader is configured|Could not load|Unknown file extension/i.test(n) && r.push(`If this comes from an asset import, eve only supports assets that Rolldown can emit for a Node ESM bundle; otherwise load the file through fs/import.meta.url or externalize the package.`), Error([ - `Failed to bundle authored module "${e}".`, - n, - ...r.map((e) => `Hint: ${e}`) - ].join(` -`)); -} -//#endregion -//#region node_modules/eve/dist/src/compiled/jsonc-parser/index.js -function e$1(e, i = !1) { - let a = e.length, o = 0, s = ``, c = 0, l = 16, u = 0, d = 0, f = 0, p = 0, m = 0; - function h(t, n) { - let r = 0, i = 0; - for (; r < t || !n;) { - let t = e.charCodeAt(o); - if (t >= 48 && t <= 57) i = i * 16 + t - 48; - else if (t >= 65 && t <= 70) i = i * 16 + t - 65 + 10; - else if (t >= 97 && t <= 102) i = i * 16 + t - 97 + 10; - else break; - o++, r++; - } - return r < t && (i = -1), i; - } - function g(e) { - o = e, s = ``, c = 0, l = 16, m = 0; - } - function _() { - let t = o; - if (e.charCodeAt(o) === 48) o++; - else for (o++; o < e.length && r$9(e.charCodeAt(o));) o++; - if (o < e.length && e.charCodeAt(o) === 46) if (o++, o < e.length && r$9(e.charCodeAt(o))) for (o++; o < e.length && r$9(e.charCodeAt(o));) o++; - else return m = 3, e.substring(t, o); - let n = o; - if (o < e.length && (e.charCodeAt(o) === 69 || e.charCodeAt(o) === 101)) if (o++, (o < e.length && e.charCodeAt(o) === 43 || e.charCodeAt(o) === 45) && o++, o < e.length && r$9(e.charCodeAt(o))) { - for (o++; o < e.length && r$9(e.charCodeAt(o));) o++; - n = o; - } else m = 3; - return e.substring(t, n); - } - function v() { - let t = ``, r = o; - for (;;) { - if (o >= a) { - t += e.substring(r, o), m = 2; - break; - } - let i = e.charCodeAt(o); - if (i === 34) { - t += e.substring(r, o), o++; - break; - } - if (i === 92) { - if (t += e.substring(r, o), o++, o >= a) { - m = 2; - break; - } - switch (e.charCodeAt(o++)) { - case 34: - t += `"`; - break; - case 92: - t += `\\`; - break; - case 47: - t += `/`; - break; - case 98: - t += `\b`; - break; - case 102: - t += `\f`; - break; - case 110: - t += ` -`; - break; - case 114: - t += `\r`; - break; - case 116: - t += ` `; - break; - case 117: - let e = h(4, !0); - e >= 0 ? t += String.fromCharCode(e) : m = 4; - break; - default: m = 5; - } - r = o; - continue; - } - if (i >= 0 && i <= 31) if (n$6(i)) { - t += e.substring(r, o), m = 2; - break; - } else m = 6; - o++; - } - return t; - } - function y() { - if (s = ``, m = 0, c = o, d = u, p = f, o >= a) return c = a, l = 17; - let i = e.charCodeAt(o); - if (t$5(i)) { - do - o++, s += String.fromCharCode(i), i = e.charCodeAt(o); - while (t$5(i)); - return l = 15; - } - if (n$6(i)) return o++, s += String.fromCharCode(i), i === 13 && e.charCodeAt(o) === 10 && (o++, s += ` -`), u++, f = o, l = 14; - switch (i) { - case 123: return o++, l = 1; - case 125: return o++, l = 2; - case 91: return o++, l = 3; - case 93: return o++, l = 4; - case 58: return o++, l = 6; - case 44: return o++, l = 5; - case 34: return o++, s = v(), l = 10; - case 47: - let t = o - 1; - if (e.charCodeAt(o + 1) === 47) { - for (o += 2; o < a && !n$6(e.charCodeAt(o));) o++; - return s = e.substring(t, o), l = 12; - } - if (e.charCodeAt(o + 1) === 42) { - o += 2; - let r = a - 1, i = !1; - for (; o < r;) { - let t = e.charCodeAt(o); - if (t === 42 && e.charCodeAt(o + 1) === 47) { - o += 2, i = !0; - break; - } - o++, n$6(t) && (t === 13 && e.charCodeAt(o) === 10 && o++, u++, f = o); - } - return i || (o++, m = 1), s = e.substring(t, o), l = 13; - } - return s += String.fromCharCode(i), o++, l = 16; - case 45: if (s += String.fromCharCode(i), o++, o === a || !r$9(e.charCodeAt(o))) return l = 16; - case 48: - case 49: - case 50: - case 51: - case 52: - case 53: - case 54: - case 55: - case 56: - case 57: return s += _(), l = 11; - default: - for (; o < a && b(i);) o++, i = e.charCodeAt(o); - if (c !== o) { - switch (s = e.substring(c, o), s) { - case `true`: return l = 8; - case `false`: return l = 9; - case `null`: return l = 7; - } - return l = 16; - } - return s += String.fromCharCode(i), o++, l = 16; - } - } - function b(e) { - if (t$5(e) || n$6(e)) return !1; - switch (e) { - case 125: - case 93: - case 123: - case 91: - case 34: - case 58: - case 44: - case 47: return !1; - } - return !0; - } - function x() { - let e; - do - e = y(); - while (e >= 12 && e <= 15); - return e; - } - return { - setPosition: g, - getPosition: () => o, - scan: i ? x : y, - getToken: () => l, - getTokenValue: () => s, - getTokenOffset: () => c, - getTokenLength: () => o - c, - getTokenStartLine: () => d, - getTokenStartCharacter: () => c - p, - getTokenError: () => m - }; -} -function t$5(e) { - return e === 32 || e === 9; -} -function n$6(e) { - return e === 10 || e === 13; -} -function r$9(e) { - return e >= 48 && e <= 57; -} -var i$7; -(function(e) { - e[e.lineFeed = 10] = `lineFeed`, e[e.carriageReturn = 13] = `carriageReturn`, e[e.space = 32] = `space`, e[e._0 = 48] = `_0`, e[e._1 = 49] = `_1`, e[e._2 = 50] = `_2`, e[e._3 = 51] = `_3`, e[e._4 = 52] = `_4`, e[e._5 = 53] = `_5`, e[e._6 = 54] = `_6`, e[e._7 = 55] = `_7`, e[e._8 = 56] = `_8`, e[e._9 = 57] = `_9`, e[e.a = 97] = `a`, e[e.b = 98] = `b`, e[e.c = 99] = `c`, e[e.d = 100] = `d`, e[e.e = 101] = `e`, e[e.f = 102] = `f`, e[e.g = 103] = `g`, e[e.h = 104] = `h`, e[e.i = 105] = `i`, e[e.j = 106] = `j`, e[e.k = 107] = `k`, e[e.l = 108] = `l`, e[e.m = 109] = `m`, e[e.n = 110] = `n`, e[e.o = 111] = `o`, e[e.p = 112] = `p`, e[e.q = 113] = `q`, e[e.r = 114] = `r`, e[e.s = 115] = `s`, e[e.t = 116] = `t`, e[e.u = 117] = `u`, e[e.v = 118] = `v`, e[e.w = 119] = `w`, e[e.x = 120] = `x`, e[e.y = 121] = `y`, e[e.z = 122] = `z`, e[e.A = 65] = `A`, e[e.B = 66] = `B`, e[e.C = 67] = `C`, e[e.D = 68] = `D`, e[e.E = 69] = `E`, e[e.F = 70] = `F`, e[e.G = 71] = `G`, e[e.H = 72] = `H`, e[e.I = 73] = `I`, e[e.J = 74] = `J`, e[e.K = 75] = `K`, e[e.L = 76] = `L`, e[e.M = 77] = `M`, e[e.N = 78] = `N`, e[e.O = 79] = `O`, e[e.P = 80] = `P`, e[e.Q = 81] = `Q`, e[e.R = 82] = `R`, e[e.S = 83] = `S`, e[e.T = 84] = `T`, e[e.U = 85] = `U`, e[e.V = 86] = `V`, e[e.W = 87] = `W`, e[e.X = 88] = `X`, e[e.Y = 89] = `Y`, e[e.Z = 90] = `Z`, e[e.asterisk = 42] = `asterisk`, e[e.backslash = 92] = `backslash`, e[e.closeBrace = 125] = `closeBrace`, e[e.closeBracket = 93] = `closeBracket`, e[e.colon = 58] = `colon`, e[e.comma = 44] = `comma`, e[e.dot = 46] = `dot`, e[e.doubleQuote = 34] = `doubleQuote`, e[e.minus = 45] = `minus`, e[e.openBrace = 123] = `openBrace`, e[e.openBracket = 91] = `openBracket`, e[e.plus = 43] = `plus`, e[e.slash = 47] = `slash`, e[e.formFeed = 12] = `formFeed`, e[e.tab = 9] = `tab`; -})(i$7 ||= {}); -const a$6 = Array(20).fill(0).map((e, t) => ` `.repeat(t)); -const o$6 = { - " ": { - "\n": Array(200).fill(0).map((e, t) => ` -` + ` `.repeat(t)), - "\r": Array(200).fill(0).map((e, t) => `\r` + ` `.repeat(t)), - "\r\n": Array(200).fill(0).map((e, t) => `\r -` + ` `.repeat(t)) - }, - " ": { - "\n": Array(200).fill(0).map((e, t) => ` -` + ` `.repeat(t)), - "\r": Array(200).fill(0).map((e, t) => `\r` + ` `.repeat(t)), - "\r\n": Array(200).fill(0).map((e, t) => `\r -` + ` `.repeat(t)) - } -}; -var p$8; -(function(e) { - e.DEFAULT = { allowTrailingComma: !1 }; -})(p$8 ||= {}); -function h$6(e, t = [], n = p$8.DEFAULT) { - let r = null, i = [], a = []; - function o(e) { - Array.isArray(i) ? i.push(e) : r !== null && (i[r] = e); - } - return S$6(e, { - onObjectBegin: () => { - let e = {}; - o(e), a.push(i), i = e, r = null; - }, - onObjectProperty: (e) => { - r = e; - }, - onObjectEnd: () => { - i = a.pop(); - }, - onArrayBegin: () => { - let e = []; - o(e), a.push(i), i = e, r = null; - }, - onArrayEnd: () => { - i = a.pop(); - }, - onLiteralValue: o, - onError: (e, n, r) => { - t.push({ - error: e, - offset: n, - length: r - }); - } - }, n), i[0]; -} -function S$6(t, n, r = p$8.DEFAULT) { - let i = e$1(t, !1), a = [], o = 0; - function s(e) { - return e ? () => o === 0 && e(i.getTokenOffset(), i.getTokenLength(), i.getTokenStartLine(), i.getTokenStartCharacter()) : () => !0; - } - function c(e) { - return e ? (t) => o === 0 && e(t, i.getTokenOffset(), i.getTokenLength(), i.getTokenStartLine(), i.getTokenStartCharacter()) : () => !0; - } - function l(e) { - return e ? (t) => o === 0 && e(t, i.getTokenOffset(), i.getTokenLength(), i.getTokenStartLine(), i.getTokenStartCharacter(), () => a.slice()) : () => !0; - } - function u(e) { - return e ? () => { - o > 0 ? o++ : e(i.getTokenOffset(), i.getTokenLength(), i.getTokenStartLine(), i.getTokenStartCharacter(), () => a.slice()) === !1 && (o = 1); - } : () => !0; - } - function d(e) { - return e ? () => { - o > 0 && o--, o === 0 && e(i.getTokenOffset(), i.getTokenLength(), i.getTokenStartLine(), i.getTokenStartCharacter()); - } : () => !0; - } - let f = u(n.onObjectBegin), m = l(n.onObjectProperty), h = d(n.onObjectEnd), g = u(n.onArrayBegin), _ = d(n.onArrayEnd), v = l(n.onLiteralValue), y = c(n.onSeparator), b = s(n.onComment), x = c(n.onError), S = r && r.disallowComments, C = r && r.allowTrailingComma; - function w() { - for (;;) { - let e = i.scan(); - switch (i.getTokenError()) { - case 4: - T(14); - break; - case 5: - T(15); - break; - case 3: - T(13); - break; - case 1: - S || T(11); - break; - case 2: - T(12); - break; - case 6: - T(16); - break; - } - switch (e) { - case 12: - case 13: - S ? T(10) : b(); - break; - case 16: - T(1); - break; - case 15: - case 14: break; - default: return e; - } - } - } - function T(e, t = [], n = []) { - if (x(e), t.length + n.length > 0) { - let e = i.getToken(); - for (; e !== 17;) { - if (t.indexOf(e) !== -1) { - w(); - break; - } else if (n.indexOf(e) !== -1) break; - e = w(); - } - } - } - function E(e) { - let t = i.getTokenValue(); - return e ? v(t) : (m(t), a.push(t)), w(), !0; - } - function D() { - switch (i.getToken()) { - case 11: - let e = i.getTokenValue(), t = Number(e); - isNaN(t) && (T(2), t = 0), v(t); - break; - case 7: - v(null); - break; - case 8: - v(!0); - break; - case 9: - v(!1); - break; - default: return !1; - } - return w(), !0; - } - function O() { - return i.getToken() === 10 ? (E(!1), i.getToken() === 6 ? (y(`:`), w(), j() || T(4, [], [2, 5])) : T(5, [], [2, 5]), a.pop(), !0) : (T(3, [], [2, 5]), !1); - } - function k() { - f(), w(); - let e = !1; - for (; i.getToken() !== 2 && i.getToken() !== 17;) { - if (i.getToken() === 5) { - if (e || T(4, [], []), y(`,`), w(), i.getToken() === 2 && C) break; - } else e && T(6, [], []); - O() || T(4, [], [2, 5]), e = !0; - } - return h(), i.getToken() === 2 ? w() : T(7, [2], []), !0; - } - function A() { - g(), w(); - let e = !0, t = !1; - for (; i.getToken() !== 4 && i.getToken() !== 17;) { - if (i.getToken() === 5) { - if (t || T(4, [], []), y(`,`), w(), i.getToken() === 4 && C) break; - } else t && T(6, [], []); - e ? (a.push(0), e = !1) : a[a.length - 1]++, j() || T(4, [], [4, 5]), t = !0; - } - return _(), e || a.pop(), i.getToken() === 4 ? w() : T(8, [4], []), !0; - } - function j() { - switch (i.getToken()) { - case 3: return A(); - case 1: return k(); - case 10: return E(!0); - default: return D(); - } - } - return w(), i.getToken() === 17 ? r.allowEmptyContent ? !0 : (T(4, [], []), !1) : j() ? (i.getToken() !== 17 && T(9, [], []), !0) : (T(4, [], []), !1); -} -var k$7; -(function(e) { - e[e.None = 0] = `None`, e[e.UnexpectedEndOfComment = 1] = `UnexpectedEndOfComment`, e[e.UnexpectedEndOfString = 2] = `UnexpectedEndOfString`, e[e.UnexpectedEndOfNumber = 3] = `UnexpectedEndOfNumber`, e[e.InvalidUnicode = 4] = `InvalidUnicode`, e[e.InvalidEscapeCharacter = 5] = `InvalidEscapeCharacter`, e[e.InvalidCharacter = 6] = `InvalidCharacter`; -})(k$7 ||= {}); -var A$6; -(function(e) { - e[e.OpenBraceToken = 1] = `OpenBraceToken`, e[e.CloseBraceToken = 2] = `CloseBraceToken`, e[e.OpenBracketToken = 3] = `OpenBracketToken`, e[e.CloseBracketToken = 4] = `CloseBracketToken`, e[e.CommaToken = 5] = `CommaToken`, e[e.ColonToken = 6] = `ColonToken`, e[e.NullKeyword = 7] = `NullKeyword`, e[e.TrueKeyword = 8] = `TrueKeyword`, e[e.FalseKeyword = 9] = `FalseKeyword`, e[e.StringLiteral = 10] = `StringLiteral`, e[e.NumericLiteral = 11] = `NumericLiteral`, e[e.LineCommentTrivia = 12] = `LineCommentTrivia`, e[e.BlockCommentTrivia = 13] = `BlockCommentTrivia`, e[e.LineBreakTrivia = 14] = `LineBreakTrivia`, e[e.Trivia = 15] = `Trivia`, e[e.Unknown = 16] = `Unknown`, e[e.EOF = 17] = `EOF`; -})(A$6 ||= {}); -const M$6 = h$6; -var B$6; -(function(e) { - e[e.InvalidSymbol = 1] = `InvalidSymbol`, e[e.InvalidNumberFormat = 2] = `InvalidNumberFormat`, e[e.PropertyNameExpected = 3] = `PropertyNameExpected`, e[e.ValueExpected = 4] = `ValueExpected`, e[e.ColonExpected = 5] = `ColonExpected`, e[e.CommaExpected = 6] = `CommaExpected`, e[e.CloseBraceExpected = 7] = `CloseBraceExpected`, e[e.CloseBracketExpected = 8] = `CloseBracketExpected`, e[e.EndOfFileExpected = 9] = `EndOfFileExpected`, e[e.InvalidCommentToken = 10] = `InvalidCommentToken`, e[e.UnexpectedEndOfComment = 11] = `UnexpectedEndOfComment`, e[e.UnexpectedEndOfString = 12] = `UnexpectedEndOfString`, e[e.UnexpectedEndOfNumber = 13] = `UnexpectedEndOfNumber`, e[e.InvalidUnicode = 14] = `InvalidUnicode`, e[e.InvalidEscapeCharacter = 15] = `InvalidEscapeCharacter`, e[e.InvalidCharacter = 16] = `InvalidCharacter`; -})(B$6 ||= {}); -//#endregion -//#region node_modules/eve/dist/src/internal/authored-package-tsconfig-paths.js -const packageTsConfigPathsCache = /* @__PURE__ */ new Map(); -const nearestPackageRootCache = /* @__PURE__ */ new Map(); -function createAuthoredPackageTsConfigPathsPlugin(e) { - return { - name: `eve-package-tsconfig-paths`, - async resolveId(t, r, i) { - if (r === void 0 || !isPackageImport$1(t)) return; - let a = resolve(r); - if (isPathInsideOrEqual$1(a, e.appPackageRoot)) return; - let o = await resolveNearestPackageRoot(a); - if (o === void 0 || isPathInsideOrEqual$1(o, e.appPackageRoot)) return; - let s = await loadPackageTsConfigPaths(o); - if (s !== void 0) for (let n of createTsConfigPathCandidates(t, s)) { - let t = await this.resolve(n, r, { - kind: i.kind, - skipSelf: !0 - }); - if (t !== null) return t; - let a = await resolveExistingPath(n, e.extensions); - if (a !== void 0) return { id: a }; - } - } - }; -} -function loadPackageTsConfigPaths(e) { - let t = packageTsConfigPathsCache.get(e); - if (t !== void 0) return t; - let n = readPackageTsConfigPaths(e); - return packageTsConfigPathsCache.set(e, n), n; -} -async function readPackageTsConfigPaths(t) { - let r = await readPackageConfig(t); - if (r === void 0) return; - let i = [], a = M$6(r.source, i, { allowTrailingComma: !0 }); - if (i.length > 0 || !isObjectRecord(a)) return; - let s = a.compilerOptions; - if (!isObjectRecord(s) || !isObjectRecord(s.paths)) return; - let c = dirname(r.path), l = typeof s.baseUrl == `string` ? resolve(c, s.baseUrl) : c, u = Object.entries(s.paths).flatMap(([e, t]) => !Array.isArray(t) || !t.every((e) => typeof e == `string`) ? [] : [{ - pattern: e, - targets: t - }]).sort((e, t) => t.pattern.length - e.pattern.length); - if (u.length !== 0) return { - baseDirectory: l, - entries: u - }; -} -async function readPackageConfig(e) { - for (let n of [`tsconfig.json`, `jsconfig.json`]) { - let r = join(e, n); - try { - return { - path: r, - source: await readFile(r, `utf8`) - }; - } catch (e) { - if (!isPathNotFoundError(e)) throw e; - } - } -} -function createTsConfigPathCandidates(e, t) { - let r = []; - for (let i of t.entries) { - let a = matchTsConfigPathPattern(e, i.pattern); - if (a !== void 0) for (let e of i.targets) { - let i = e.includes(`*`) ? e.replaceAll(`*`, a) : e; - r.push(resolve(t.baseDirectory, i)); - } - } - return r; -} -function matchTsConfigPathPattern(e, t) { - let n = t.indexOf(`*`); - if (n === -1) return e === t ? `` : void 0; - let r = t.slice(0, n), i = t.slice(n + 1); - if (!(!e.startsWith(r) || !e.endsWith(i))) return e.slice(r.length, e.length - i.length); -} -async function resolveExistingPath(e, n) { - if (await existsAsFile(e)) return e; - for (let t of n) { - let n = `${e}${t}`; - if (await existsAsFile(n)) return n; - } - for (let r of n) { - let n = join(e, `index${r}`); - if (await existsAsFile(n)) return n; - } -} -async function existsAsFile(e) { - try { - return (await stat(e)).isFile(); - } catch { - return !1; - } -} -function resolveNearestPackageRoot(t) { - let n = dirname(t), r = nearestPackageRootCache.get(n); - if (r !== void 0) return r; - let i = findNearestPackageRoot(n); - return nearestPackageRootCache.set(n, i), i; -} -async function findNearestPackageRoot(n) { - let r = n; - for (;;) { - if (await pathExists(join(r, `package.json`))) return r; - let n = dirname(r); - if (n === r) return; - r = n; - } -} -async function pathExists(e) { - try { - return await stat(e), !0; - } catch { - return !1; - } -} -function isPathNotFoundError(e) { - return typeof e == `object` && !!e && `code` in e && (e.code === `ENOENT` || e.code === `ENOTDIR`); -} -function isPackageImport$1(e) { - return e.startsWith(`.`) || e.startsWith(`/`) || /^[A-Za-z]:[\\/]/.test(e) ? !1 : !/^(?:node|data|file):/.test(e); -} -function isObjectRecord(e) { - return typeof e == `object` && !!e && !Array.isArray(e); -} -function isPathInsideOrEqual$1(e, t) { - let i = resolve(e), a = resolve(t); - return i === a || i.startsWith(`${a}${sep}`); -} -//#endregion -//#region node_modules/eve/dist/src/internal/bundler/nitro-rolldown.js -let rolldownPromise; -function loadNitroRolldown() { - return rolldownPromise ??= (async () => await import(pathToFileURL(createRequire(createRequire(import.meta.url).resolve(`nitro/package.json`)).resolve(`rolldown`)).href))(), rolldownPromise; -} -async function buildWithNitroRolldown(e) { - let { build: t } = await loadNitroRolldown(); - return await t(e); -} -function getSingleRolldownChunk(e, t) { - let n = e.output.filter((e) => e.type === `chunk`), r = n[0]; - if (r === void 0 || n.length !== 1) throw Error(`Expected one bundled ${t}.`); - return r; -} -//#endregion -//#region node_modules/eve/dist/src/internal/nitro/host/server-external-packages.js -const SERVER_EXTERNAL_PACKAGES = `@alinea/generated.@appsignal/nodejs.@aws-sdk/client-kms.@aws-sdk/client-s3.@aws-sdk/client-sso.@aws-sdk/s3-presigned-post.@blockfrost/blockfrost-js.@datadog/flagging-core.@highlight-run/node.@huggingface/transformers.@jpg-store/lucid-cardano.@libsql/client.@mikro-orm/core.@mikro-orm/knex.@node-rs/argon2.@node-rs/bcrypt.@prisma/client.@react-pdf/renderer.@sentry/profiling-node.@smithy/util-stream.@sparticuz/chromium.@sparticuz/chromium-min.@statsig/statsig-node-core.@swc/core.@xenova/transformers.@zenstackhq/runtime.argon2.autoprefixer.aws-crt.bcrypt.better-sqlite3.canvas.chromadb-default-embed.config.cpu-features.cypress.dd-trace.eslint.express.firebase-admin.htmlrewriter.import-in-the-middle.isolated-vm.jest.jsdom.keyv.libsql.mdx-bundler.mongodb.mongoose.newrelic.next-mdx-remote.next-seo.node-cron.node-pty.node-web-audio-api.onnxruntime-node.oslo.pg.pino.pino-pretty.pino-roll.playwright.playwright-core.postcss.prettier.prisma.puppeteer.puppeteer-core.ravendb.require-in-the-middle.rimraf.sharp.shiki.sqlite3.thread-stream.ts-morph.ts-node.typescript.vscode-oniguruma.webpack.websocket.zeromq`.split(`.`); -//#endregion -//#region node_modules/eve/dist/src/internal/node-esm-compat-banner.js -const BANNER_LINES = [{ - importLine: `import { fileURLToPath as __eveFileURLToPath } from "node:url";`, - declarationLine: `const __filename = __eveFileURLToPath(import.meta.url);`, - bindingPattern: /^(?:const|let|var)\s+__filename\b/m -}, { - importLine: `import { dirname as __eveDirname } from "node:path";`, - declarationLine: `const __dirname = __eveDirname(__filename);`, - bindingPattern: /^(?:const|let|var)\s+__dirname\b/m -}]; -const REQUIRE_LINE = { - importLine: `import { createRequire as __eveCreateRequire } from "node:module";`, - declarationLine: `const require = __eveCreateRequire(import.meta.url);`, - bindingPattern: /^(?:const|let|var)\s+require\b/m -}; -function buildNodeEsmCompatBanner(n, r = {}) { - let i = [...BANNER_LINES]; - r.includeRequire === !0 && i.push(REQUIRE_LINE); - let a = [], o = []; - for (let e of i) e.bindingPattern.test(n) || (a.push(e.importLine), o.push(e.declarationLine)); - return o.length === 0 ? `` : [...a, ...o].join(` -`); -} -function createNodeEsmCompatBannerPlugin(e = {}) { - return { - name: `eve-node-esm-compat-banner`, - renderChunk(t, n) { - let r = buildNodeEsmCompatBanner(t, e); - return r === `` ? null : { - code: `${r}\n${t}`, - map: createPrependedLineSourceMap({ - insertedLineCount: r.split(` -`).length, - source: n?.fileName ?? `eve-node-esm-compat-banner-input`, - sourceContent: t - }) - }; - } - }; -} -function createPrependedLineSourceMap({ insertedLineCount: e, source: t, sourceContent: n }) { - let r = n.split(` -`).length, i = Array.from({ length: r }, (e, t) => encodeVlqFields(t === 0 ? [ - 0, - 0, - 0, - 0 - ] : [ - 0, - 0, - 1, - 0 - ])); - return { - version: 3, - sources: [t], - sourcesContent: [n], - names: [], - mappings: `${`;`.repeat(e)}${i.join(`;`)}` - }; -} -function encodeVlqFields(e) { - return e.map((e) => encodeVlqInteger(e)).join(``); -} -function encodeVlqInteger(e) { - let t = e < 0 ? (-e << 1) + 1 : e << 1, n = ``; - do { - let e = t & 31; - t >>>= 5, t > 0 && (e |= 32), n += `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`[e]; - } while (t > 0); - return n; -} -//#endregion -//#region node_modules/eve/dist/src/internal/authored-module-loader.js -const AUTHORED_BUNDLED_MODULE_EXTENSION = /\.[cm]?[jt]sx?$/; -const AUTHORED_MODULE_BUNDLE_DIRECTORY_PATH = join(`node_modules`, `.cache`, `eve`, `authored-modules`); -const RESOLVE_EXTENSIONS = [ - `.ts`, - `.tsx`, - `.mts`, - `.cts`, - `.js`, - `.jsx`, - `.mjs`, - `.cjs`, - `.json` -]; -const CHANNEL_MODULE_CACHE_KEY = `__eveChannelModuleCache__`; -const CACHED_CHANNEL_PREFIX = `eve-cached-channel:`; -function getChannelModuleCache() { - return globalThis[CHANNEL_MODULE_CACHE_KEY]; -} -const inFlightModuleLoads = /* @__PURE__ */ new Map(); -function loadAuthoredModuleNamespace(e, t = {}) { - let n = createInFlightModuleLoadKey(resolve(e), t), r = inFlightModuleLoads.get(n); - if (r !== void 0) return r; - let i = (async () => { - try { - return await doLoadAuthoredModuleNamespace(e, t); - } finally { - inFlightModuleLoads.delete(n); - } - })(); - return inFlightModuleLoads.set(n, i), i; -} -async function doLoadAuthoredModuleNamespace(e, n) { - return expectObjectRecord(AUTHORED_BUNDLED_MODULE_EXTENSION.test(e) ? await loadBundledAuthoredModule(e, n) : await import(createFileImportSpecifier(e)), `Expected "${e}" to export a module namespace object.`); -} -function createFileImportSpecifier(e) { - let t = e.replaceAll(`\\`, `/`); - return /^[A-Za-z]:\//.test(t) ? `file:///${encodeURI(t)}` : t.startsWith(`/`) ? `file://${encodeURI(t)}` : t; -} -async function loadBundledAuthoredModule(e, t) { - let i = getChannelModuleCache(), a = resolveAuthoredPackageRoot(e), s = resolveAuthoredTsConfigPath(a), c = normalizeExternalDependencies(t.externalDependencies), l = [ - i && i.size > 0 ? { - name: `eve-channel-identity`, - async resolveId(e, t, n) { - if (!/channels[/\\]/.test(e) || n.kind !== `import-statement`) return; - let r = await this.resolve(e, t, { - kind: n.kind, - skipSelf: !0 - }); - if (r === null || typeof r.id != `string`) return; - let a = resolve(r.id); - if (i.has(a)) return { id: `${CACHED_CHANNEL_PREFIX}${a}` }; - }, - load(e) { - if (!e.startsWith(CACHED_CHANNEL_PREFIX)) return; - let t = e.slice(19); - return { - code: [`const cache = globalThis["${CHANNEL_MODULE_CACHE_KEY}"];`, `export default cache.get(${JSON.stringify(t)});`].join(` -`), - moduleType: `js` - }; - } - } : null, - createAuthoredRelativeExtensionResolverPlugin({ extensions: RESOLVE_EXTENSIONS }), - createAuthoredAssetImportPlugin(), - createAuthoredPackageTsConfigPathsPlugin({ - appPackageRoot: a, - extensions: RESOLVE_EXTENSIONS - }), - createNodeEsmCompatBannerPlugin({ includeRequire: !0 }), - createPackageBoundaryPlugin(a, c) - ].filter((e) => e !== null), u; - try { - u = getSingleRolldownChunk(await buildWithNitroRolldown({ - cwd: a, - input: e, - platform: `node`, - plugins: l, - resolve: { extensions: [...RESOLVE_EXTENSIONS] }, - tsconfig: s, - write: !1, - output: { - comments: !1, - format: `esm`, - sourcemap: `inline` - } - }), `authored module for "${e}"`); - } catch (t) { - throw createAuthoredModuleBundleError(e, t); - } - let d = createHash(`sha1`).update(e).update(`\0`).update(c.join(`\0`)).update(`\0`).update(u.code).digest(`hex`), f = join(a, AUTHORED_MODULE_BUNDLE_DIRECTORY_PATH), p = join(f, `${d}.mjs`); - return existsSync(p) || (mkdirSync(f, { recursive: !0 }), writeFileSync(p, u.code)), await import(`${createFileImportSpecifier(p)}?v=${d}`); -} -function createAuthoredRelativeExtensionResolverPlugin(e) { - return { - name: `eve-authored-relative-extension-resolver`, - resolveId(t, n) { - if (n === void 0 || n.startsWith(`\0`) || n.startsWith(CACHED_CHANNEL_PREFIX) || !isPathImport(t)) return; - let r = resolveExistingImportPath(isAbsolute(t) ? t : resolve(dirname(n), t), e.extensions); - if (r !== void 0) return { id: r }; - } - }; -} -function createPackageBoundaryPlugin(e, t) { - let n = toCanonicalPath(e); - return { - name: `eve-package-boundary`, - async resolveId(r, i, a) { - if (!isPackageImport(r)) return; - if (isEveFrameworkImport(r)) return { - external: !0, - id: r - }; - let o = resolveConfiguredExternalDependency(r, t); - if (o !== void 0) { - if (r !== o) { - let t = await this.resolve(r, i, { - kind: a.kind, - skipSelf: !0 - }); - if (t !== null && typeof t.id == `string`) return { - external: !0, - id: resolveExternalFilePath({ - importer: i, - packageRoot: e, - resolvedId: t.id, - source: r - }) - }; - let n = resolveExternalFilePath({ - importer: i, - packageRoot: e, - source: r - }); - if (n !== void 0) return { - external: !0, - id: n - }; - } - return { - external: !0, - id: r - }; - } - let s = i === void 0 || i.startsWith(`\0`) || i.startsWith(CACHED_CHANNEL_PREFIX) ? void 0 : resolve(i); - if (s !== void 0 && isPathInsideOrEqual(toCanonicalPath(s), n)) { - let e = await this.resolve(r, i, { - kind: a.kind, - skipSelf: !0 - }); - if (e === null || typeof e.id != `string`) throw Error(`Cannot resolve package "${r}" imported from "${s}". Install it with your package manager (e.g. \`pnpm install\`); a running \`eve dev\` retries on the next rebuild.`); - if (isNodeModulesPath(e.id)) return { - external: !0, - id: r - }; - } - } - }; -} -function createInFlightModuleLoadKey(e, t) { - return `${e}\0${normalizeExternalDependencies(t.externalDependencies).join(`\0`)}`; -} -function normalizeExternalDependencies(e = []) { - return [.../* @__PURE__ */ new Set([...SERVER_EXTERNAL_PACKAGES, ...e])].sort(); -} -function resolveConfiguredExternalDependency(e, t) { - return t.find((t) => e === t || e.startsWith(`${t}/`)); -} -function resolveExternalFilePath(t) { - if (t.resolvedId !== void 0) { - let e = resolveExistingExternalFilePath(t.resolvedId); - if (e !== void 0) return e; - } - let n = normalizeImporterPath(t.importer); - if (n !== void 0) try { - return createRequire(n).resolve(t.source); - } catch {} - try { - return createRequire(join(t.packageRoot, `package.json`)).resolve(t.source); - } catch { - return t.resolvedId; - } -} -function resolveExistingExternalFilePath(e) { - if (existsSync(e)) return e; - for (let t of RESOLVE_EXTENSIONS) { - let r = `${e}${t}`; - if (existsSync(r)) return r; - } -} -function resolveExistingImportPath(e, t) { - if (isFile(e)) return e; - for (let n of t) { - let t = `${e}${n}`; - if (isFile(t)) return t; - } - for (let n of t) { - let t = join(e, `index${n}`); - if (isFile(t)) return t; - } -} -function isFile(e) { - try { - return statSync(e).isFile(); - } catch { - return !1; - } -} -function normalizeImporterPath(e) { - if (!(e === void 0 || e.startsWith(`\0`) || e.startsWith(CACHED_CHANNEL_PREFIX))) return resolve(e); -} -function isPackageImport(e) { - return isPathImport(e) || /^(?:node|data|file):/.test(e) || e.startsWith(`@/`) ? !1 : !e.startsWith(CACHED_CHANNEL_PREFIX); -} -function isPathImport(e) { - return e.startsWith(`.`) || e.startsWith(`/`) || /^[A-Za-z]:[\\/]/.test(e); -} -function isEveFrameworkImport(e) { - return e === `eve` || e.startsWith(`eve/`); -} -function isNodeModulesPath(e) { - return e.replaceAll(`\\`, `/`).includes(`/node_modules/`); -} -function toCanonicalPath(e) { - try { - return realpathSync(e); - } catch { - return resolve(e); - } -} -function isPathInsideOrEqual(e, t) { - let n = resolve(e), r = resolve(t); - return n === r || n.startsWith(`${r}${sep}`); -} -function resolveAuthoredTsConfigPath(e) { - for (let t of [`tsconfig.json`, `jsconfig.json`]) { - let r = join(e, t); - if (existsSync(r)) return r; - } - return !1; -} -function resolveAuthoredPackageRoot(e) { - let t = dirname(e); - for (;;) { - if (existsSync(join(t, `package.json`))) return t; - let r = dirname(t); - if (r === t) throw Error(`Failed to resolve the authored package root for "${e}".`); - t = r; - } -} -//#endregion -//#region node_modules/eve/dist/src/compiler/model-catalog.js -const COMPILED_RUNTIME_MODEL_CATALOG_CACHE_KIND = `eve-model-catalog-cache`; -const catalogModelProviderSchema = Ls$3.object({ - provider: Ls$3.string().min(1), - providerModelId: Ls$3.string().min(1), - contextWindowTokens: Ls$3.number().int().nonnegative().optional(), - maxOutputTokens: Ls$3.number().int().nonnegative().optional() -}).passthrough(); -const catalogModelSchema = Ls$3.object({ - slug: Ls$3.string().min(1), - providers: Ls$3.array(catalogModelProviderSchema).min(1) -}).passthrough(); -const modelCatalogResponseSchema = Ls$3.object({ - models: Ls$3.array(catalogModelSchema), - providerAliases: Ls$3.record(Ls$3.string(), Ls$3.string()) -}).passthrough(); -Ls$3.object({ - contextWindowTokens: Ls$3.number().int().positive(), - maxOutputTokens: Ls$3.number().int().positive().optional() -}).strict(); -const compiledRuntimeModelCatalogCacheSchema = Ls$3.object({ - fetchedAt: Ls$3.string(), - kind: Ls$3.literal(COMPILED_RUNTIME_MODEL_CATALOG_CACHE_KIND), - models: Ls$3.array(catalogModelSchema), - providerAliases: Ls$3.record(Ls$3.string(), Ls$3.string()), - version: Ls$3.literal(2) -}).strict(); -//#endregion -//#region node_modules/eve/dist/src/shared/json-schema.js -function normalizeJsonSchemaDefinition(t, n = `input`) { - return isStandardSchema(t) ? parseJsonObject(t[`~standard`].jsonSchema[n]({ target: `draft-07` })) : parseJsonObject(t); -} -function isStandardSchema(e) { - return typeof e == `object` && !!e && `~standard` in e; -} -//#endregion -//#region node_modules/eve/dist/src/internal/authored-definition/core.js -function normalizeAgentDefinition(e, r) { - let a = expectObjectRecord(e, r); - if (expectOnlyKnownKeys(a, [ - `build`, - `compaction`, - `description`, - `experimental`, - `model`, - `modelContextWindowTokens`, - `modelOptions`, - `outputSchema`, - `reasoning` - ], r), a.model === void 0) throw Error(`${r} The "model" field is required.`); - let o = { model: a.model }; - return a.description !== void 0 && (o.description = expectString(a.description, r)), a.compaction !== void 0 && (o.compaction = normalizeAgentCompactionDefinition(a.compaction, r)), a.build !== void 0 && (o.build = normalizeAgentBuildDefinition(a.build, r)), a.experimental !== void 0 && (o.experimental = normalizeAgentExperimentalDefinition(a.experimental, r)), a.modelOptions !== void 0 && (o.modelOptions = normalizeAgentModelOptions(a.modelOptions, r)), a.modelContextWindowTokens !== void 0 && (o.modelContextWindowTokens = expectPositiveInteger(a.modelContextWindowTokens, r)), a.outputSchema !== void 0 && (o.outputSchema = a.outputSchema), a.reasoning !== void 0 && (o.reasoning = normalizeAgentReasoningDefinition(a.reasoning, r)), o; -} -function normalizeAgentReasoningDefinition(e, t) { - let n = expectString(e, t); - switch (n) { - case `provider-default`: - case `none`: - case `minimal`: - case `low`: - case `medium`: - case `high`: - case `xhigh`: return n; - default: throw Error(t); - } -} -function expectPositiveInteger(e, t) { - if (typeof e != `number` || !Number.isInteger(e) || e <= 0) throw Error(t); - return e; -} -function normalizeAgentBuildDefinition(e, r) { - let a = expectObjectRecord(e, r); - expectOnlyKnownKeys(a, [`externalDependencies`], r); - let o = {}; - if (a.externalDependencies !== void 0) { - if (!Array.isArray(a.externalDependencies)) throw Error(r); - o.externalDependencies = Object.freeze(a.externalDependencies.map((e) => expectString(e, r))); - } - return o; -} -function normalizeAgentWorkflowDefinition(e, r) { - let i = expectObjectRecord(e, r); - expectOnlyKnownKeys(i, [`world`], r); - let a = {}; - return i.world !== void 0 && (a.world = normalizeAgentWorkflowWorldDefinition(i.world, r)), a; -} -function normalizeAgentWorkflowWorldDefinition(e, t) { - let n = expectString(e, t); - if (n.trim() === ``) throw Error(`${t} "experimental.workflow.world" must be a non-empty package name.`); - return n; -} -function normalizeAgentExperimentalDefinition(e, r) { - let i = expectObjectRecord(e, r); - expectOnlyKnownKeys(i, [`workflow`], r); - let a = {}; - return i.workflow !== void 0 && (a.workflow = normalizeAgentWorkflowDefinition(i.workflow, r)), a; -} -function normalizeAgentModelOptions(e, i) { - let a = expectObjectRecord(e, i); - expectOnlyKnownKeys(a, [`providerOptions`], i); - let o = a.providerOptions; - return o === void 0 ? {} : { providerOptions: expectProviderOptions(o, i) }; -} -function normalizeAgentCompactionDefinition(e, r) { - let i = expectObjectRecord(e, r); - expectOnlyKnownKeys(i, [ - `model`, - `modelContextWindowTokens`, - `thresholdPercent` - ], r); - let a = {}; - if (i.model !== void 0 && (a.model = i.model), i.modelContextWindowTokens !== void 0 && (a.modelContextWindowTokens = expectPositiveInteger(i.modelContextWindowTokens, r)), i.thresholdPercent !== void 0) { - let e = i.thresholdPercent; - if (typeof e != `number` || !Number.isFinite(e) || e < 0 || e > 1) throw Error(r); - a.thresholdPercent = e; - } - return a; -} -//#endregion -//#region node_modules/eve/dist/src/internal/runtime-model.js -function formatLanguageModelGatewayId(e) { - return typeof e == `string` ? e : `${e.provider.split(`.`)[0]}/${e.modelId.replace(/^(claude-[a-z]+-\d+)-(\d+)$/, `$1.$2`)}`; -} -//#endregion -//#region node_modules/eve/dist/src/public/definitions/connections/protocol.js -const PROTOCOL_KEY = Symbol.for(`eve.connection-protocol`); -function stampConnectionProtocol(e, t) { - Object.defineProperty(e, PROTOCOL_KEY, { - configurable: !0, - value: t - }); -} -//#endregion -//#region node_modules/eve/dist/src/shared/dynamic-tool-definition.js -const ALLOWED_DYNAMIC_TOOL_EVENTS = /* @__PURE__ */ new Set([ - `session.started`, - `turn.started`, - `step.started` -]); -const ALLOWED_DYNAMIC_INSTRUCTION_EVENTS = /* @__PURE__ */ new Set([`session.started`, `turn.started`]); -const ALLOWED_DYNAMIC_SKILL_EVENTS = /* @__PURE__ */ new Set([`session.started`, `turn.started`]); -const TOOL_BRAND = Symbol.for(`eve:tool-brand`); -function isBrandedToolEntry(e) { - return typeof e == `object` && !!e && e[TOOL_BRAND] === !0; -} -const INSTRUCTIONS_BRAND = Symbol.for(`eve:instructions-brand`); -function isBrandedInstructionsEntry(e) { - return typeof e == `object` && !!e && e[INSTRUCTIONS_BRAND] === !0; -} -const SKILL_BRAND = Symbol.for(`eve:skill-brand`); -function isBrandedSkillEntry(e) { - return typeof e == `object` && !!e && e[SKILL_BRAND] === !0; -} -//#endregion -//#region node_modules/eve/dist/src/public/definitions/tool.js -function defineTool(e) { - if (e.auth !== void 0) throw Error(`defineTool: The "auth" field is no longer supported. Pass auth providers inline to ctx.getToken(provider) or ctx.requireAuth(provider).`); - return Object.assign(e, { [TOOL_BRAND]: !0 }), stampDefinitionKey(e, `tool:${e.description}`), e; -} -const ENABLE_WORKFLOW_TOOL_SENTINEL_KIND = `eve:enable-workflow-tool`; -const ExperimentalWorkflow = Object.freeze({ kind: ENABLE_WORKFLOW_TOOL_SENTINEL_KIND }); -//#endregion -//#region node_modules/eve/dist/src/shared/skill-package.js -const WORKSPACE_ROOT = `/workspace`; -function normalizeSkillPackage(e) { - assertSafeSkillPackageName(e.name); - let t = [{ - content: Buffer$1.from(e.markdown, `utf8`), - relativePath: `SKILL.md` - }]; - for (let [n, r] of Object.entries(e.files ?? {})) assertSafeSkillPackageFilePath(n), t.push({ - content: contentToBuffer(r), - relativePath: n - }); - return t.sort((e, t) => comparePaths(e.relativePath, t.relativePath)), { - description: e.description, - files: t, - license: e.license, - markdown: e.markdown, - metadata: e.metadata === void 0 ? void 0 : { ...e.metadata }, - name: e.name - }; -} -async function writeSkillPackageToSandbox(e) { - for (let t of e.skill.files) await e.sandbox.writeBinaryFile({ - content: t.content, - path: `${WORKSPACE_ROOT}/skills/${e.skill.name}/${t.relativePath}` - }); -} -function assertSafeSkillPackageName(e) { - if (e.length === 0 || e.startsWith(`.`) || e.includes(`/`) || e.includes(`\\`) || e.includes(`..`) || !/^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(e) || /^[A-Za-z]:/.test(e)) throw Error(`Expected skill name to be a non-empty shell-safe path segment starting with an alphanumeric character and containing only alphanumerics, ".", "_", or "-".`); -} -function assertSafeSkillPackageFilePath(e) { - if (e === `SKILL.md`) throw Error(`Skill package files must not include "SKILL.md"; eve generates it.`); - if (e.length === 0 || e.startsWith(`/`) || e.includes(`\\`) || /^[A-Za-z]:/.test(e) || e.split(`/`).some((e) => e.length === 0 || e === `.` || e === `..`)) throw Error(`Expected skill package file paths to be relative POSIX paths.`); -} -function contentToBuffer(e) { - return typeof e == `string` ? Buffer$1.from(e, `utf8`) : Buffer$1.from(e); -} -function comparePaths(e, t) { - return e < t ? -1 : +(e > t); -} -//#endregion -//#region node_modules/eve/dist/src/compiler/artifacts.js -const COMPILE_METADATA_KIND = `eve-compile-metadata`; -//#endregion -//#region node_modules/eve/dist/src/runtime/loaders/compile-metadata.js -const compileArtifactDigestSchema = Ls$3.object({ - path: Ls$3.string(), - sha256: Ls$3.string() -}).strict(); -const compileMetadataSchema = Ls$3.object({ - compile: Ls$3.object({ moduleMap: compileArtifactDigestSchema }).strict(), - discovery: Ls$3.object({ - diagnostics: compileArtifactDigestSchema, - manifest: compileArtifactDigestSchema, - sourceGraphHash: Ls$3.string(), - summary: Ls$3.object({ - errors: Ls$3.number().finite(), - warnings: Ls$3.number().finite() - }).strict() - }).strict(), - generator: Ls$3.object({ - name: Ls$3.string(), - version: Ls$3.string() - }).strict(), - kind: Ls$3.literal(COMPILE_METADATA_KIND), - status: Ls$3.union([Ls$3.literal(`failed`), Ls$3.literal(`ready`)]), - version: Ls$3.literal(5) -}).strict(); -var LoadCompileMetadataError = class extends Error { - metadataPath; - constructor(e, t) { - super(e), this.name = `LoadCompileMetadataError`, t !== void 0 && (this.metadataPath = t); - } -}; -async function loadCompileMetadata(e) { - let t = e.compiledArtifactsSource.kind === `disk` ? resolveRuntimeCompilerArtifactPaths(e.compiledArtifactsSource.appRoot).compileMetadataPath : void 0; - if (t !== void 0) { - let { readFile: e } = await import(`node:fs/promises`), n; - try { - n = JSON.parse(await e(t, `utf8`)); - } catch (e) { - throw new LoadCompileMetadataError(formatLoadErrorMessage(e), t); - } - return parseCompileMetadata(n, t); - } - let n = readBundledCompiledArtifacts()?.metadata; - return n === void 0 ? null : parseCompileMetadata(n, `bundled compile metadata`); -} -function parseCompileMetadata(e, t) { - let n = compileMetadataSchema.safeParse(e); - if (!n.success) throw new LoadCompileMetadataError(`Expected "${t}" to contain valid eve compile metadata. ${formatValidationError(n.error)}`, t); - return n.data; -} -function formatLoadErrorMessage(e) { - return e instanceof Error ? e.message : `Unknown compile metadata load failure.`; -} -//#endregion -//#region node_modules/eve/dist/src/runtime/cache-key.js -async function resolveRuntimeCompiledArtifactsVersionedCacheKey(n) { - let r = getRuntimeCompiledArtifactsCacheKey(n), i = await resolveCompileMetadataMtimeMs(n); - try { - let e = (await loadCompileMetadata({ compiledArtifactsSource: n }))?.discovery.sourceGraphHash; - return e === void 0 || e.length === 0 ? i === void 0 ? r : `${r}:mtime-${formatMtimeMsForCacheKey(i)}` : i === void 0 ? `${r}:${e}` : `${r}:${e}:mtime-${formatMtimeMsForCacheKey(i)}`; - } catch { - return i === void 0 ? r : `${r}:mtime-${formatMtimeMsForCacheKey(i)}`; - } -} -async function resolveCompileMetadataMtimeMs(e) { - if (e.kind !== `disk`) return; - let { stat: t } = await import(`node:fs/promises`), { compileMetadataPath: r } = resolveRuntimeCompilerArtifactPaths(e.appRoot); - try { - return (await t(r)).mtimeMs; - } catch { - return; - } -} -function formatMtimeMsForCacheKey(e) { - return Math.floor(e).toString(36); -} -//#endregion -//#region node_modules/eve/dist/src/execution/subagent-adapter.js -const log$18 = createLogger(`execution.subagent-adapter`); -const SUBAGENT_ADAPTER_KIND$1 = `subagent`; -function isSubagentAdapterState$1(e) { - if (typeof e != `object` || !e) return !1; - let t = e; - return typeof t.callId == `string` && t.callId.length > 0 && typeof t.parentContinuationToken == `string` && t.parentContinuationToken.length > 0 && typeof t.parentSessionId == `string` && typeof t.subagentName == `string` && t.subagentName.length > 0; -} -const SUBAGENT_ADAPTER$1 = { - kind: SUBAGENT_ADAPTER_KIND$1, - async "input.requested"(e, t) { - let i = t.state; - isSubagentAdapterState$1(i) && await forwardSubagentInputRequestStep$1({ - hookPayload: { - callId: i.callId, - childContinuationToken: t.ctx.require(ContinuationTokenKey), - childSessionId: t.ctx.require(SessionIdKey), - event: { - requests: e.requests, - sequence: e.sequence, - stepIndex: e.stepIndex, - turnId: e.turnId - }, - kind: `subagent-input-request`, - subagentName: i.subagentName - }, - parentContinuationToken: i.parentContinuationToken - }); - } -}; -async function forwardSubagentInputRequestStep$1(t) { - try { - await E$9(t.parentContinuationToken, t.hookPayload); - } catch (n) { - let r = createErrorId(); - throw log$18.warn(`failed to forward proxied HITL batch to parent`, { - callId: t.hookPayload.callId, - childContinuationToken: t.hookPayload.childContinuationToken, - childSessionId: t.hookPayload.childSessionId, - errorId: r, - parentContinuationToken: t.parentContinuationToken, - subagentName: t.hookPayload.subagentName, - error: n - }), n; - } -} -s$7("step//eve@0.16.2//forwardSubagentInputRequestStep", forwardSubagentInputRequestStep$1); -//#endregion -//#region node_modules/eve/dist/src/channel/session.js -function createSession$1(e, t, n) { - return { - id: e, - continuationToken: t, - async getEventStream(t) { - return n.getEventStream(e, t); - } - }; -} -function createGetSessionFn(e) { - return (t) => createSession$1(t, ``, e); -} -function buildSessionHandle(i) { - return { - get id() { - return i.get(SessionIdKey) ?? ``; - }, - get continuationToken() { - return i.get(ContinuationTokenKey) ?? ``; - }, - get auth() { - return { - current: i.get(AuthKey) ?? null, - initiator: i.get(InitiatorAuthKey) ?? null - }; - }, - setContinuationToken(e) { - let n = i.get(ContinuationTokenKey) ?? ``, r = namespaceContinuationToken(n, e); - n !== r && i.set(ContinuationTokenKey, r); - } - }; -} -function namespaceContinuationToken(e, t) { - let n = e.indexOf(`:`); - if (n <= 0) throw Error(`Cannot set session continuation token without an existing namespaced continuation token. Start the session with a placeholder continuationToken.`); - return `${e.slice(0, n + 1)}${t}`; -} -//#endregion -//#region node_modules/eve/dist/src/channel/schedule-auth.js -const SCHEDULE_APP_AUTH = { - attributes: {}, - authenticator: `app`, - principalId: `eve:app`, - principalType: `runtime` -}; -function isScheduleAppAuth(e) { - return e?.authenticator === SCHEDULE_APP_AUTH.authenticator && e.principalId === SCHEDULE_APP_AUTH.principalId && e.principalType === SCHEDULE_APP_AUTH.principalType; -} -//#endregion -//#region node_modules/eve/dist/src/channel/send.js -const log$17 = createLogger(`channel.send`); -function createSendFn(t, r, i, a = {}) { - return async (o, s) => { - let c = s.auth, l = s.callback, u = s.mode ?? `conversation`, d = s.state, f = s.title, p = s.continuationToken, m = `${i}:${p}`, { message: h, inputResponses: g, context: _, outputSchema: v } = normalizeSendInput(o), y = serializeUrlFilePartsInMessage(h); - try { - let n = { - auth: c, - continuationToken: m, - requestId: a.requestId, - payload: { - inputResponses: g, - message: y, - context: _, - outputSchema: v - } - }, { sessionId: r } = await t.deliver(n); - return createSession$1(r, p, t); - } catch (e) { - isRuntimeNoActiveSessionError(e) || log$17.warn(`deliver failed, falling back to starting a new session`, { continuationToken: m }); - } - if (g && g.length > 0) throw Error(`Cannot deliver inputResponses — the target session was not found via continuation token.`); - let b = { - adapter: d ? { - ...r, - state: { - ...r.state, - ...d - } - } : r, - auth: c, - capabilities: u === `conversation` ? { requestInput: !0 } : void 0, - channelName: i, - callback: l, - continuationToken: m, - input: { - message: y ?? ``, - context: _, - outputSchema: v - }, - mode: u, - requestId: a.requestId, - title: f - }; - return createSession$1((await t.run(b)).sessionId, p, t); - }; -} -function serializeUrlFilePartsInMessage(e) { - if (e === void 0 || typeof e == `string`) return e; - let t = !1, n = e.map((e) => e.type === `file` && e.data instanceof URL && e.data.protocol !== `data:` ? (t = !0, { - ...e, - data: serializeUrlFilePart(e.data) - }) : e); - return t ? n : e; -} -function normalizeSendInput(e) { - return typeof e == `string` || Array.isArray(e) ? { message: e } : e; -} -//#endregion -//#region node_modules/eve/dist/src/channel/cross-channel-receive.js -function toCrossChannelTargets(e) { - return e.flatMap((e) => e.definition === void 0 ? [] : [{ - name: e.name, - definition: e.definition, - receive: e.receive, - adapter: e.adapter - }]); -} -function createCrossChannelReceiveFn(e, t) { - return async (n, r) => { - let i = resolveTargetByReference(n, t); - return await invokeChannelReceive({ - runtime: e, - target: i, - input: { - message: r.message, - target: r.target, - auth: r.auth - }, - describeMissingReceive: () => `args.receive(): channel "${i.name}" does not implement receive(). Declare a receive hook on the channel to accept cross-channel sessions.`, - describeMissingAdapter: () => `args.receive(): channel "${i.name}" has no adapter — cannot build send().` - }); - }; -} -async function invokeChannelReceive(e) { - if (!e.target.receive) throw Error(e.describeMissingReceive()); - if (!e.target.adapter) throw Error(e.describeMissingAdapter()); - let n = createSendFn(e.runtime, e.target.adapter, e.target.name); - return await e.target.receive(e.input, { send: n }); -} -function resolveTargetByReference(e, t) { - for (let n of t) if (n.definition === e) return n; - let n = resolveTargetByRouteFingerprint(e, t); - if (n !== null) return n; - throw Error(`args.receive(): the channel passed as the first argument is not registered in this agent's channels/. Import the channel module's default export from agent/channels/.ts and pass that value.`); -} -function resolveTargetByRouteFingerprint(t, n) { - if (!isCompiledChannel(t)) return null; - let r = createRouteFingerprint(t); - if (r === null) return null; - let i = /* @__PURE__ */ new Map(); - for (let e of n) createRouteFingerprint(e.definition) === r && i.set(e.name, e); - if (i.size === 1) return [...i.values()][0]; - if (i.size > 1) throw Error(`args.receive(): the channel passed as the first argument matches multiple registered channels by route shape. Import a channel with a unique route set from agent/channels/.ts before passing it to args.receive().`); - return null; -} -function createRouteFingerprint(e) { - return e.routes.length === 0 ? null : e.routes.map((e) => `${e.method.toUpperCase()} ${e.path}`).sort().join(` -`); -} -//#endregion -//#region node_modules/eve/dist/src/channel/schedule.js -const SCHEDULE_ADAPTER_KIND = `schedule`; -const SCHEDULE_ADAPTER = { kind: SCHEDULE_ADAPTER_KIND }; -var ScheduleDispatcher = class { - runtime; - channels; - constructor(e) { - this.runtime = e.runtime, this.channels = e.channels; - } - async trigger(e) { - let t = [], i = [], a = createCrossChannelReceiveFn(this.runtime, toCrossChannelTargets(this.channels)), o = { - appAuth: SCHEDULE_APP_AUTH, - receive: async (e, n) => { - let r = await a(e, n); - return t.push(r), r; - }, - waitUntil(e) { - i.push(e); - } - }; - if (e.run) await e.run(o); - else if (e.markdown !== void 0) { - let n = await this.runMarkdown(e.markdown); - t.push(n); - } else throw Error(`Schedule "${e.scheduleId}" has neither "run" nor "markdown" — at least one must be set.`); - return { - sessions: t, - waitUntilTasks: i - }; - } - async runMarkdown(t) { - let r = await this.runtime.run({ - adapter: SCHEDULE_ADAPTER, - auth: SCHEDULE_APP_AUTH, - input: { message: t }, - mode: `task` - }); - return createSession$1(r.sessionId, r.continuationToken, this.runtime); - } -}; -function expectScheduleRun(e, t, n) { - let r = e; - if (typeof r != `object` || !r) throw Error(`Schedule export "${n ?? `default`}" from "${t}" must be an object.`); - return expectFunction(r.run, `Expected the schedule export "${n ?? `default`}" from "${t}" to export a \`run\` handler function.`); -} -//#endregion -//#region node_modules/eve/dist/src/runtime/channels/registry.js -const FRAMEWORK_ADAPTERS = [ - HTTP_ADAPTER, - SUBAGENT_ADAPTER$1, - SCHEDULE_ADAPTER -]; -const ADAPTER_NON_EVENT_FIELDS = /* @__PURE__ */ new Set([ - `kind`, - `state`, - `deliver`, - `createAdapterContext`, - `fetchFile`, - `instrumentation` -]); -function createRuntimeAdapterRegistry(e) { - let t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Set(); - for (let e of FRAMEWORK_ADAPTERS) { - let r = requireAdapterKind(e); - n.add(r), t.set(r, e); - } - for (let r of e.channels) { - if (r.adapter === void 0) continue; - let e = { - logicalPath: r.logicalPath, - sourceId: r.sourceId - }, i = r.adapter, a = requireAdapterKind(i, e); - if (n.has(a)) { - if (carriesAdapterBehavior(i)) throw new RuntimeRegistryError(`adapter`, `Channel adapter kind "${a}" is reserved by the framework. A route-declared adapter may share a framework kind only as a pass-through with no \`deliver\` hook, event handlers, \`attachments\` resolver, or \`createAdapterContext\` factory. Use a custom \`kind\` to add channel-specific behavior.`, { - ...e, - entryName: a - }); - continue; - } - t.set(a, i); - } - return { adaptersByKind: t }; -} -function deserializeRuntimeAdapter(e, t) { - let n = t, r = e.adaptersByKind.get(n.kind); - if (r === void 0) throw Error(`Unknown adapter kind: "${n.kind}". Declare the adapter on the route that starts this session so the runtime can rehydrate it.`); - return { - ...r, - state: n.state - }; -} -function requireAdapterKind(t, n) { - let r = getAdapterKind(t); - if (typeof r != `string` || r.length === 0) throw new RuntimeRegistryError(`adapter`, "Adapters must declare a non-empty `kind` field.", { - entryName: `unknown`, - logicalPath: n?.logicalPath, - sourceId: n?.sourceId - }); - return r; -} -function carriesAdapterBehavior(e) { - if (e.deliver !== void 0 || e.fetchFile !== void 0 || e.createAdapterContext !== void 0) return !0; - for (let [t, n] of Object.entries(e)) if (!ADAPTER_NON_EVENT_FIELDS.has(t) && typeof n == `function`) return !0; - return !1; -} -//#endregion -//#region node_modules/eve/dist/src/runtime/sessions/compiled-agent-cache.js -const isCacheDisabled = process.env.EVE_DISABLE_AGENT_CACHE === `1`; -function isDevelopmentRuntimeSnapshotRoot(e) { - return e.replaceAll(`\\`, `/`).includes(`/.eve/dev-runtime/snapshots/`); -} -function normalizeCompiledArtifactsSource(t) { - return t.kind !== `disk` || t.moduleMapLoaderPath !== void 0 || !isDevelopmentRuntimeSnapshotRoot(t.appRoot) ? t : { - ...t, - moduleMapLoaderPath: resolvePackageSourceFilePath(`src/internal/authored-module-map-loader.ts`) - }; -} -async function loadFullBundle(e) { - let t = normalizeCompiledArtifactsSource(e), [n, a] = await Promise.all([loadCompiledManifest({ compiledArtifactsSource: t }), loadRuntimeCompiledModuleMap(t)]), o = await resolveRuntimeAgentGraph({ - manifest: n, - moduleMap: a - }), s = o.root; - return { - adapterRegistry: createRuntimeAdapterRegistry({ channels: collectResolvedChannels(o) }), - compiledArtifactsSource: t, - graph: o, - hookRegistry: s.hookRegistry, - moduleMap: a, - resolvedAgent: s.agent, - subagentRegistry: s.subagentRegistry, - toolRegistry: s.toolRegistry, - turnAgent: s.turnAgent - }; -} -async function loadRuntimeCompiledModuleMap(e) { - return e.kind === `disk` && e.moduleMapLoaderPath !== void 0 ? await loadAuthoredSourceCompiledModuleMap(e) : await loadCompiledModuleMap({ compiledArtifactsSource: e }); -} -async function loadAuthoredSourceCompiledModuleMap(e) { - if (e.moduleMapLoaderPath === void 0) throw Error(`Authored-source module map loading requires "moduleMapLoaderPath" in the compiled artifacts source.`); - return await (await import(pathToFileURL(e.moduleMapLoaderPath).href)).loadCompiledModuleMapFromAuthoredSource({ compiledArtifactsSource: e }); -} -async function getOrLoadFullBundle(e) { - let n = normalizeCompiledArtifactsSource(e); - if (isCacheDisabled) return loadFullBundle(n); - let r = getActiveRuntimeSession(), i = getRuntimeCompiledArtifactsCacheKey(n), a = await resolveRuntimeCompiledArtifactsVersionedCacheKey(n), o = r.bundleCacheKeyBySourceKey.get(i); - o !== void 0 && o !== a && r.bundleCache.delete(o), r.bundleCacheKeyBySourceKey.set(i, a); - let c = r.bundleCache.get(a); - if (c !== void 0) return c; - let l = loadFullBundle(n).catch((e) => { - throw r.bundleCache.delete(a), r.bundleCacheKeyBySourceKey.get(i) === a && r.bundleCacheKeyBySourceKey.delete(i), e; - }); - return r.bundleCache.set(a, l), l; -} -async function getCompiledRuntimeAgentBundle(e) { - let t = await getOrLoadFullBundle(e.compiledArtifactsSource); - if (e.nodeId === void 0) return t; - let r = getResolvedRuntimeAgentNode(t.graph, e.nodeId); - return { - adapterRegistry: t.adapterRegistry, - compiledArtifactsSource: t.compiledArtifactsSource, - graph: { - nodesByNodeId: t.graph.nodesByNodeId, - root: r - }, - hookRegistry: r.hookRegistry, - moduleMap: t.moduleMap, - nodeId: e.nodeId, - resolvedAgent: r.agent, - subagentRegistry: r.subagentRegistry, - toolRegistry: r.toolRegistry, - turnAgent: r.turnAgent - }; -} -function collectResolvedChannels(e) { - let t = /* @__PURE__ */ new Map(); - for (let n of e.nodesByNodeId.values()) for (let e of n.channels) t.set(`${e.sourceId}:${e.name}`, e); - return [...t.values()]; -} -//#endregion -//#region node_modules/eve/dist/src/runtime/sessions/runtime-context-keys.js -const ChannelKey = new ContextKey(`eve.channel`, { codec: { - serialize(t) { - return { - kind: getAdapterKind(t), - state: t.state ? { ...t.state } : {} - }; - }, - deserialize(e, t) { - let n = t.get(BundleKey); - if (n === void 0) throw Error(`Cannot deserialize "eve.channel" before "eve.bundle". The runtime bundle must be present in context.`); - return deserializeRuntimeAdapter(n.adapterRegistry, e); - } -} }); -const BundleKey = new ContextKey(`eve.bundle`, { codec: { - serialize: (e) => ({ - nodeId: e.nodeId, - source: e.compiledArtifactsSource - }), - deserialize: (e) => { - let { source: t, nodeId: r } = e; - return getCompiledRuntimeAgentBundle({ - compiledArtifactsSource: t, - nodeId: r - }); - } -} }); -//#endregion -//#region node_modules/eve/dist/src/context/serialize.js -const log$16 = createLogger(`context.serialize`); -function serializeContext(e) { - let t = {}; - for (let [n, r] of e.entries()) try { - t[n.name] = n.codec ? n.codec.serialize(r) : r; - } catch (e) { - throw logError(log$16, `failed to serialize context key`, e, { key: n.name }), e; - } - return t; -} -async function deserializeContext(e) { - let i = new ContextContainer(), a = e[BundleKey.name]; - if (a !== void 0) { - let e = BundleKey.codec; - if (e === void 0) throw Error(`Context key "eve.bundle" is missing a codec.`); - i.set(BundleKey, await e.deserialize(a, i)); - } - for (let [t, a] of Object.entries(e)) { - if (a === void 0 || t === BundleKey.name) continue; - let e = resolveKey(t); - if (e === void 0) { - log$16.warn(`dropping unknown context key during deserialization`, { key: t }); - continue; - } - try { - i.set(e, e.codec ? await e.codec.deserialize(a, i) : a); - } catch (e) { - throw logError(log$16, `failed to deserialize context key`, e, { key: t }), e; - } - } - return i; -} -//#endregion -//#region node_modules/eve/dist/src/execution/eve-workflow-attributes.js -function readChannelKind(e) { - let n = e[`eve.channel`]?.kind; - return isNonEmptyString(n) ? n : void 0; -} -function readParentLineage(e) { - let n = e[`eve.parentSession`], r = n?.callId, i = n?.rootSessionId, a = n?.sessionId, o = n?.turn?.id; - return { - callId: isNonEmptyString(r) ? r : void 0, - rootSessionId: isNonEmptyString(i) ? i : void 0, - sessionId: isNonEmptyString(a) ? a : void 0, - turnId: isNonEmptyString(o) ? o : void 0 - }; -} -function readRootSessionId(e) { - return readParentLineage(e).rootSessionId; -} -function readChannelRequestId(n) { - let r = n[ChannelRequestIdKey.name]; - return isNonEmptyString(r) ? r : void 0; -} -function deriveSessionTitle(e) { - let t = collectMessageText(e); - if (t === void 0 || t.length === 0) return; - let n = t.replace(/\s+/gu, ` `).trim(); - if (n.length === 0) return; - let r = Array.from(n); - return r.length <= 125 ? n : `${r.slice(0, 124).join(``)}…`; -} -function collectMessageText(e) { - if (typeof e == `string`) return e; - if (!Array.isArray(e)) return; - let t = []; - for (let n of e) n && typeof n == `object` && n.type === `text` && typeof n.text == `string` && t.push(n.text); - return t.length > 0 ? t.join(` `) : void 0; -} -function buildSessionAttributes(e) { - return { - "$eve.channel_request_id": readChannelRequestId(e.serializedContext), - "$eve.type": `session`, - "$eve.trigger": readChannelKind(e.serializedContext), - "$eve.title": deriveSessionTitle(e.inputMessage) - }; -} -function buildSubagentRootAttributes(e) { - return { - "$eve.channel_request_id": readChannelRequestId(e.serializedContext), - "$eve.type": `subagent`, - "$eve.parent": e.parentSessionId, - "$eve.parent_call": e.parentCallId, - "$eve.parent_turn": e.parentTurnId, - "$eve.root": e.rootSessionId, - "$eve.subagent": e.identity.nodeId, - "$eve.trigger": readChannelKind(e.serializedContext) - }; -} -function buildTurnAttributes(e) { - return { - "$eve.channel_request_id": e.requestId, - "$eve.type": `turn`, - "$eve.parent": e.parentSessionId, - "$eve.root": e.rootSessionId - }; -} -//#endregion -//#region node_modules/eve/dist/src/runtime/attributes/normalize.js -function truncateForTag(e, t = 256) { - if (t <= 0) return ``; - let n = new TextEncoder(); - if (n.encode(e).length <= t) return e; - let r = e.length; - for (; r > 0;) { - let i = e.charCodeAt(r - 1); - if (i >= 55296 && i <= 56319) { - --r; - continue; - } - let a = e.slice(0, r); - if (n.encode(a).length <= t) return a; - --r; - } - return ``; -} -function normalizeEveAttributes(e) { - let t = {}; - for (let [n, r] of Object.entries(e)) r !== void 0 && (t[n] = truncateForTag(typeof r == `number` ? String(r) : r)); - return t; -} -//#endregion -//#region node_modules/eve/dist/src/internal/instrumentation.js -const FRAMEWORK_CHANNEL_KINDS = /* @__PURE__ */ new Set([ - `http`, - `schedule`, - `subagent` -]); -function isInstrumentationChannelKind(e) { - return e.startsWith(`channel:`) || FRAMEWORK_CHANNEL_KINDS.has(e); -} -function normalizeInstrumentationChannelKind(e) { - return e !== void 0 && isInstrumentationChannelKind(e) ? e : `unknown`; -} -function resolveInstrumentationProjection(n) { - let { invoke: r, log: i, source: a } = n, o; - try { - o = r(); - } catch (t) { - i.warn(`ignoring instrumentation projection after projector failure`, { - error: formatError(t), - source: a - }); - return; - } - if (isThenable(o)) { - i.warn(`ignoring instrumentation projection because it returned a Promise`, { source: a }), Promise.resolve(o).catch((t) => { - i.warn(`ignored instrumentation projection Promise rejected`, { - error: formatError(t), - source: a - }); - }); - return; - } - if (o !== void 0) { - if (!isPlainRecord(o)) { - i.warn(`ignoring instrumentation projection because it is not a record`, { source: a }); - return; - } - try { - return parseJsonObject(o); - } catch (t) { - i.warn(`ignoring instrumentation projection because it is outside the JSON contract`, { - error: formatError(t), - source: a - }); - return; - } - } -} -//#endregion -//#region node_modules/eve/dist/src/channel/instrumentation.js -const log$15 = createLogger(`channel.instrumentation`); -function buildChannelInstrumentationProjection(e) { - let { adapter: t, channelName: n, existingKind: r } = e; - return { - kind: resolveKind({ - adapter: t, - channelName: n, - existingKind: r - }), - metadata: resolveMetadata(t) - }; -} -function resolveKind(e) { - let { adapter: r, channelName: i, existingKind: a } = e; - if (a !== void 0) return a; - if (i !== void 0 && i.length > 0) return `channel:${i}`; - let o = getAdapterKind(r); - return isInstrumentationChannelKind(o) ? o : `channel:${o}`; -} -function resolveMetadata(e) { - let n = e.instrumentation?.metadata; - return n === void 0 ? {} : resolveInstrumentationProjection({ - invoke: () => n(e.state), - log: log$15, - source: getAdapterKind(e) - }) ?? {}; -} -//#endregion -//#region node_modules/eve/dist/src/execution/channel-context.js -function setChannelContext(e, t, n = {}) { - e.set(ChannelKey, t), e.set(ChannelInstrumentationKey, buildChannelInstrumentationProjection({ - adapter: t, - channelName: n.channelName, - existingKind: e.get(ChannelInstrumentationKey)?.kind - })); -} -//#endregion -//#region node_modules/eve/dist/src/execution/runtime-context.js -function buildRunContext(t) { - let { bundle: n, run: r } = t, i = new ContextContainer(), a = r.auth; - if (i.set(BundleKey, n), setChannelContext(i, r.adapter, { channelName: r.channelName }), r.channelMetadata !== void 0) { - let e = i.get(ChannelInstrumentationKey); - i.set(ChannelInstrumentationKey, { - kind: e?.kind ?? r.channelMetadata.kind, - metadata: r.channelMetadata.metadata - }); - } - return i.set(ContinuationTokenKey, r.continuationToken ?? ``), i.set(ModeKey, r.mode), i.set(AuthKey, a), i.set(InitiatorAuthKey, r.initiatorAuth ?? a), r.capabilities !== void 0 && i.set(CapabilitiesKey, r.capabilities), r.requestId !== void 0 && i.set(ChannelRequestIdKey, r.requestId), r.callback !== void 0 && i.set(SessionCallbackKey, r.callback), r.parent !== void 0 && i.set(ParentSessionKey, r.parent), i; -} -//#endregion -//#region node_modules/eve/dist/src/execution/ndjson-stream.js -function parseNdjsonStream(e) { - let t = new TextDecoder(), n = ``, r, i = !1; - return new ReadableStream({ - async start(a) { - r = e().getReader(); - try { - for (;;) { - let { value: e, done: i } = await r.read(); - if (i) break; - n += t.decode(e, { stream: !0 }); - for (let e = n.indexOf(` -`); e !== -1; e = n.indexOf(` -`)) { - let t = n.slice(0, e).trim(); - n = n.slice(e + 1), t.length > 0 && a.enqueue(JSON.parse(t)); - } - } - if (i) return; - n += t.decode(); - let e = n.trim(); - e.length > 0 && a.enqueue(JSON.parse(e)), a.close(); - } catch (e) { - i || a.error(e); - } finally { - r.releaseLock(); - } - }, - async cancel(e) { - i = !0, await r?.cancel(e); - } - }); -} -//#endregion -//#region node_modules/eve/dist/src/execution/workflow-runtime.js -const WORKFLOW_ENTRY_NAME = `workflowEntry`; -const TURN_WORKFLOW_NAME = `turnWorkflow`; -const EVE_PACKAGE_INFO = resolveInstalledPackageInfo(); -const STABLE_ID_BASE = EVE_PACKAGE_INFO.name; -const log$14 = createLogger(`execution.workflow-runtime`); -const workflowEntryReference = { workflowId: `workflow//${STABLE_ID_BASE}//${WORKFLOW_ENTRY_NAME}` }; -const turnWorkflowReference = { workflowId: `workflow//${STABLE_ID_BASE}//${TURN_WORKFLOW_NAME}` }; -function createWorkflowRuntime(e) { - return { - async run(n) { - let r = await getCompiledRuntimeAgentBundle({ - compiledArtifactsSource: e.compiledArtifactsSource, - nodeId: e.nodeId - }), i = serializeContext(buildRunContext({ - bundle: r, - run: n - })), a = readParentLineage(i), o = a.sessionId === void 0 ? buildSessionAttributes({ - inputMessage: n.title ?? n.input.message, - serializedContext: i - }) : buildSubagentRootAttributes({ - identity: { nodeId: r.nodeId ?? ROOT_RUNTIME_AGENT_NODE_ID }, - parentCallId: a.callId, - parentSessionId: a.sessionId, - parentTurnId: a.turnId, - rootSessionId: a.rootSessionId ?? a.sessionId, - serializedContext: i - }), s; - try { - s = await startWorkflowPreferLatest(workflowEntryReference, [{ - input: n.input, - serializedContext: i - }], { - allowReservedAttributes: !0, - attributes: normalizeEveAttributes(o) - }); - } catch (e) { - throw logError(log$14, `failed to start workflow run`, e, { continuationToken: n.continuationToken }), e; - } - let c, getEvents = () => (c ??= parseNdjsonStream(() => X$9(s.runId).getReadable()), c); - return { - continuationToken: n.continuationToken ?? s.runId, - get events() { - return getEvents(); - }, - sessionId: s.runId - }; - }, - async deliver(e) { - let r = { - auth: e.auth, - kind: `deliver`, - payloads: [e.payload], - requestId: e.requestId - }; - try { - return { sessionId: normalizeWorkflowHook(await E$9(e.continuationToken, r)).runId }; - } catch (r) { - throw b$9.is(r) ? new RuntimeNoActiveSessionError(e.continuationToken) : (logError(log$14, `failed to deliver to active session`, r, { continuationToken: e.continuationToken }), r); - } - }, - async getEventStream(e, t) { - return parseNdjsonStream(() => X$9(e).getReadable({ startIndex: t?.startIndex })); - } - }; -} -async function startWorkflowPreferLatest(e, t, n) { - if (!shouldRouteToLatestDeployment()) return n === void 0 ? await B$8(e, t) : await B$8(e, t, n); - try { - return await B$8(e, t, { - ...n, - deploymentId: `latest` - }); - } catch (r) { - if (!isLatestDeploymentUnsupportedError(r)) throw r; - return n === void 0 ? await B$8(e, t) : await B$8(e, t, n); - } -} -function shouldRouteToLatestDeployment() { - return process.env.VERCEL_ENV === `production`; -} -function isLatestDeploymentUnsupportedError(e) { - return e instanceof Error && e.message.includes(`deploymentId 'latest' requires a World that implements resolveLatestDeploymentId()`); -} -function normalizeWorkflowHook(e) { - if (typeof e != `object` || !e || !(`runId` in e)) throw Error(`Workflow hook did not include a run id.`); - let t = e.runId; - if (typeof t != `string` || t.length === 0) throw Error(`Workflow hook did not include a run id.`); - return { runId: t }; -} -//#endregion -//#region node_modules/eve/dist/src/internal/nitro/routes/health.js -var health_default = async (e) => Response.json({ - ok: !0, - status: `ready`, - workflowId: workflowEntryReference.workflowId -}); -//#endregion -//#region node_modules/eve/dist/src/internal/nitro/routes/agent-info/build-agent-info-response.js -function renderChannel(e, t) { - return { - ...toSource(e), - adapterKind: e.adapter?.kind, - method: e.method, - name: e.name, - origin: t.origin, - urlPath: e.urlPath - }; -} -function renderTool(e, t) { - return { - ...toSource(e), - description: e.description, - hasAuth: !1, - hasExecute: e.execute !== void 0, - hasModelOutputProjection: e.toModelOutput !== void 0, - hasOutputSchema: e.outputSchema !== void 0 && e.outputSchema !== null, - inputSchema: e.inputSchema, - name: e.name, - origin: t.origin, - outputSchema: e.outputSchema, - replacesFrameworkTool: t.replacesFrameworkTool, - requiresApproval: e.approval !== void 0 - }; -} -function renderSchedule(e) { - return { - ...toSource(e), - cron: e.cron, - hasRun: e.hasRun, - markdown: e.markdown, - name: e.name - }; -} -function renderSubagent(e) { - return { - ...toSource(e), - description: e.description, - entryPath: e.entryPath, - name: e.name, - nodeId: e.nodeId, - rootPath: e.rootPath, - summary: { - channels: e.agent.channels.length, - connections: e.agent.connections.length, - hooks: e.agent.hooks.length, - instructions: e.agent.instructions !== void 0, - schedules: e.agent.schedules.length, - skills: e.agent.skills.length, - tools: e.agent.tools.length - } - }; -} -function renderDynamicResolver(e, t) { - return { - ...toSource(e), - eventNames: [...e.eventNames], - origin: t.origin, - slug: e.slug - }; -} -function toSource(e) { - return { - exportName: e.exportName, - logicalPath: e.logicalPath, - sourceId: e.sourceId, - sourceKind: e.sourceKind - }; -} -//#endregion -//#region node_modules/eve/dist/src/internal/resolve-model-endpoint-status.js -function resolveModelEndpointStatus(e, t) { - return e.kind === `external` ? { - kind: `external`, - provider: e.provider - } : t.apiKey ? { - kind: `gateway`, - connected: !0, - credential: `api-key` - } : t.oidc ? { - kind: `gateway`, - connected: !0, - credential: `oidc` - } : { - kind: `gateway`, - connected: !1 - }; -} -//#endregion -//#region node_modules/eve/dist/src/internal/nitro/routes/agent-info/build-agent-info-response-from-manifest.js -function buildAgentInfoResponseFromManifest(i, a) { - let o = i.manifest, s = o.channels.filter((e) => e.kind === `channel`), c = o.channels.filter((e) => e.kind === `disabled`).map((e) => e.name), l = new Set(o.tools.map((e) => e.name)), u = new Set(o.disabledFrameworkTools), d = getAllFrameworkToolNames(), f = getAllFrameworkChannelNames(), p = getFrameworkToolDefinitions({ hasConnections: o.connections.length > 0 }), m = getFrameworkChannelDefinitions(), h = p.filter((e) => !l.has(e.name) && !u.has(e.name)), g = o.tools.map((e) => ({ - ...toSource(e), - description: e.description, - hasAuth: !1, - hasCompactionHook: !1, - hasExecute: !0, - hasModelOutputProjection: !1, - hasOutputSchema: e.outputSchema !== void 0 && e.outputSchema !== null, - inputSchema: e.inputSchema, - name: e.name, - origin: `authored`, - outputSchema: e.outputSchema ?? null, - replacesFrameworkTool: d.has(e.name), - requiresApproval: !1 - })), _ = new Set(s.map((e) => e.name)), v = new Set(c), y = m.filter((e) => !_.has(e.name) && !v.has(e.name)), b = s.map((e) => ({ - ...toSource(e), - adapterKind: e.adapterKind, - method: e.method, - name: e.name, - origin: `authored`, - urlPath: e.urlPath - })); - return { - agent: { - agentRoot: o.agentRoot, - appRoot: o.appRoot, - configSource: o.config.source ? toSource(o.config.source) : void 0, - description: o.config.description, - model: { - contextWindowTokens: o.config.model.contextWindowTokens, - id: o.config.model.id, - providerOptions: o.config.model.providerOptions, - source: o.config.model.source ? toSource(o.config.model.source) : void 0, - routing: o.config.model.routing, - endpoint: resolveModelEndpointStatus(o.config.model.routing, a.gatewayCredentials) - }, - name: o.config.name, - outputSchema: o.config.outputSchema - }, - capabilities: { devRoutes: a.mode === `development` }, - channels: { - authored: b, - available: [...y.map((e) => renderChannel(e, { origin: `framework` })), ...b], - disabledFramework: c, - framework: m.filter((e) => f.has(e.name)).map((e) => { - let t = _.has(e.name), n = v.has(e.name), r = n ? `disabled` : t ? `replaced` : `active`; - return { - ...renderChannel(e, { origin: `framework` }), - disabledByAuthor: n, - replacedByAuthoredChannel: t, - status: r - }; - }) - }, - connections: o.connections.map((e) => ({ - ...toSource(e), - connectionName: e.connectionName, - description: e.description, - hasApproval: !1, - hasAuthorization: e.vercelConnect !== void 0, - hasHeaders: !1, - protocol: e.protocol, - url: e.url - })), - diagnostics: { - discoveryErrors: o.diagnosticsSummary.errors, - discoveryWarnings: o.diagnosticsSummary.warnings - }, - hooks: o.hooks.map((e) => ({ - ...toSource(e), - eventNames: [], - slug: e.slug - })), - instructions: { - dynamic: o.dynamicInstructions.map((e) => renderDynamicResolver(e, { origin: `authored` })), - static: o.instructions === void 0 ? null : { - ...toSource(o.instructions), - markdown: o.instructions.markdown, - name: o.instructions.name - } - }, - kind: `eve-agent-info`, - mode: a.mode, - sandbox: o.sandbox === null ? null : { - ...toSource(o.sandbox), - description: o.sandbox.description, - hasBootstrap: !1, - hasOnSession: !1, - revalidationKey: o.sandbox.revalidationKey, - sourceHash: o.sandbox.sourceHash - }, - schedules: i.schedules.map(renderSchedule), - skills: { - static: o.skills.map((e) => ({ - ...toSource(e), - description: e.description, - license: e.license, - markdown: e.markdown, - metadata: e.metadata, - name: e.name - })), - dynamic: o.dynamicSkills.map((e) => renderDynamicResolver(e, { origin: `authored` })) - }, - subagents: { - local: o.subagents.map(renderSubagent), - total: o.subagents.length - }, - tools: { - available: [...h.map((e) => renderTool(e, { - origin: `framework`, - replacesFrameworkTool: !1 - })), ...g], - authored: g, - disabledFramework: [...o.disabledFrameworkTools], - dynamic: [...o.connections.length > 0 ? [renderDynamicResolver(createConnectionSearchResolver(), { origin: `framework` })] : [], ...o.dynamicTools.map((e) => renderDynamicResolver(e, { origin: `authored` }))], - framework: p.map((e) => { - let t = l.has(e.name), n = u.has(e.name), r = n ? `disabled` : t ? `replaced` : `active`; - return { - ...renderTool(e, { - origin: `framework`, - replacesFrameworkTool: !1 - }), - disabledByAuthor: n, - replacedByAuthoredTool: t, - status: r - }; - }), - reserved: [WORKFLOW_TOOL_NAME, LOAD_SKILL_TOOL_NAME] - }, - version: 1, - workflow: { - enabled: o.workflowEnabled, - toolName: WORKFLOW_TOOL_NAME - }, - workspace: { - resourceRoot: o.workspaceResourceRoot, - rootEntries: [...o.workspaceResourceRoot.rootEntries] - } - }; -} -//#endregion -//#region node_modules/eve/dist/src/internal/nitro/dev-runtime-artifacts.js -function readDevelopmentRuntimeArtifactsSnapshotRoot(e) { - let t = readDevelopmentRuntimeArtifactsPointer(e); - if (t !== void 0) return t.version === 1 ? t.appRoot : t.runtimeAppRoot; -} -function readDevelopmentRuntimeArtifactsPointer(n) { - if (!(n === void 0 || !existsSync(n))) try { - let e = JSON.parse(readFileSync(n, `utf8`)); - return e.kind !== `eve-dev-runtime-artifacts-pointer` || typeof e.version != `number` ? void 0 : e.version === 1 && typeof e.appRoot == `string` && e.appRoot.length > 0 ? { - appRoot: e.appRoot, - kind: `eve-dev-runtime-artifacts-pointer`, - version: 1 - } : e.version === 2 && typeof e.appRoot == `string` && typeof e.runtimeAppRoot == `string` && e.runtimeAppRoot.length > 0 && typeof e.snapshotRoot == `string` && e.snapshotRoot.length > 0 ? { - appRoot: e.appRoot, - kind: `eve-dev-runtime-artifacts-pointer`, - runtimeAppRoot: e.runtimeAppRoot, - snapshotRoot: e.snapshotRoot, - version: 2 - } : void 0; - } catch { - return; - } -} -//#endregion -//#region node_modules/eve/dist/src/runtime/schedules/register.js -const EVE_SCHEDULE_TASK_NAME_PREFIX = `eve.schedule.`; -var ScheduleRegistrationError = class extends Error { - scheduleId; - sourceId; - taskName; - constructor(e, t = {}) { - super(e), this.name = `ScheduleRegistrationError`, t.scheduleId !== void 0 && (this.scheduleId = t.scheduleId), t.sourceId !== void 0 && (this.sourceId = t.sourceId), t.taskName !== void 0 && (this.taskName = t.taskName); - } -}; -function createScheduleRegistrations(e) { - let t = e.map((e) => ({ - cron: e.cron, - description: `Run eve schedule "${e.name}" from "${e.logicalPath}".`, - logicalPath: e.logicalPath, - scheduleId: e.name, - sourceId: e.sourceId, - taskName: createScheduleTaskName(e.sourceId) - })).sort((e, t) => e.sourceId.localeCompare(t.sourceId)); - return assertUniqueScheduleIds(t), t; -} -function assertUniqueScheduleIds(e) { - let t = /* @__PURE__ */ new Map(); - for (let n of e) { - let e = t.get(n.scheduleId); - if (e === void 0) { - t.set(n.scheduleId, n); - continue; - } - throw new ScheduleRegistrationError(`Duplicate authored schedule id "${n.scheduleId}" found in "${e.logicalPath}" and "${n.logicalPath}".`, { - scheduleId: n.scheduleId, - sourceId: n.sourceId, - taskName: n.taskName - }); - } -} -function createScheduleTaskName(t) { - return `${EVE_SCHEDULE_TASK_NAME_PREFIX}${Buffer.from(t, `utf8`).toString(`base64url`)}`; -} -//#endregion -//#region node_modules/eve/dist/src/runtime/schedules/resolve-schedule.js -var ResolveScheduleError = class extends Error { - taskName; - constructor(e, t = {}) { - super(e), this.name = `ResolveScheduleError`, t.taskName !== void 0 && (this.taskName = t.taskName); - } -}; -async function resolveSchedules(e) { - return [...e.manifest.schedules].map((e) => { - let t = { - cron: e.cron, - hasRun: e.hasRun, - logicalPath: e.logicalPath, - name: e.name, - sourceId: e.sourceId, - sourceKind: e.sourceKind - }; - return e.markdown === void 0 ? t : { - ...t, - markdown: e.markdown - }; - }); -} -async function loadResolvedCompiledSchedules(t) { - return await resolveSchedules({ manifest: await loadCompiledManifest({ compiledArtifactsSource: t.compiledArtifactsSource }) }); -} -async function loadResolvedCompiledScheduleByTaskName(e, n) { - let r = await loadResolvedCompiledSchedules(n), i = new Map(r.map((e) => [e.sourceId, e])); - for (let n of createScheduleRegistrations(r)) if (n.taskName === e) { - let e = i.get(n.sourceId); - if (e !== void 0) return e; - } - throw new ResolveScheduleError(`No compiled authored schedule is registered for Nitro task "${e}".`, { taskName: e }); -} -//#endregion -//#region node_modules/eve/dist/src/internal/nitro/routes/agent-info/load-agent-info-data.js -async function loadAgentInfoManifestData(e) { - let t = await loadCompiledManifest({ compiledArtifactsSource: e.compiledArtifactsSource }); - return { - manifest: t, - schedules: await resolveSchedules({ manifest: t }) - }; -} -function resolveAgentInfoCompiledArtifactsSource(r = {}) { - if (r.dev === !0 && r.appRoot !== void 0) return createDiskRuntimeCompiledArtifactsSource(readDevelopmentRuntimeArtifactsSnapshotRoot(r.devRuntimeArtifactsPointerPath) ?? r.appRoot); - if (readBundledCompiledArtifacts() !== null) return createBundledRuntimeCompiledArtifactsSource(); - if (r.appRoot !== void 0) return createDiskRuntimeCompiledArtifactsSource(r.appRoot); - throw Error(`eve agent info runtime data requires bundled artifacts or an app root.`); -} -//#endregion -//#region node_modules/eve/dist/src/internal/nitro/routes/info.js -async function createAgentInfoPayload(e) { - let r = await loadAgentInfoManifestData({ compiledArtifactsSource: resolveAgentInfoCompiledArtifactsSource(e) }); - return buildAgentInfoResponseFromManifest(r, { - mode: e.mode ?? `development`, - gatewayCredentials: await resolveGatewayCredentialPresence(r.manifest.config.model.routing) - }); -} -function hasEnvValue(e) { - return e !== void 0 && e.trim() !== ``; -} -async function resolveGatewayCredentialPresence(t) { - let n = hasEnvValue(process.env.AI_GATEWAY_API_KEY); - if (t.kind === `external` || n) return { - apiKey: n, - oidc: !1 - }; - try { - return await T$7(), { - apiKey: !1, - oidc: !0 - }; - } catch { - return { - apiKey: !1, - oidc: !1 - }; - } -} -async function handleAgentInfoRequest(e, t) { - let n = await routeAuth(t, [vercelOidc(), localDev()]); - return n instanceof Response ? n : new Response(JSON.stringify(await createAgentInfoPayload(e)), { headers: { - "cache-control": `no-store`, - "content-type": `application/json; charset=utf-8` - } }); -} -//#endregion -//#region node_modules/eve/dist/src/internal/vercel/project-link.js -const VercelProjectLinkSchema = Ls$3.object({ - projectId: Ls$3.string().min(1), - orgId: Ls$3.string().min(1), - projectName: Ls$3.string().min(1).optional() -}); -async function readVercelProjectLink(e) { - try { - let t = await readFile(join(e, `.vercel`, `project.json`), `utf8`), n = VercelProjectLinkSchema.safeParse(JSON.parse(t)); - return n.success ? n.data : void 0; - } catch { - return; - } -} -//#endregion -//#region node_modules/eve/dist/src/internal/nitro/routes/runtime-artifacts.js -function resolveNitroCompiledArtifactsSource(e) { - let { appRoot: t, dev: n } = e; - if (n && t !== void 0) { - if (e.moduleMapLoaderPath === void 0) throw Error(`eve Nitro development routes require "moduleMapLoaderPath" in the artifacts config.`); - return createDiskRuntimeCompiledArtifactsSource(readDevelopmentRuntimeArtifactsSnapshotRoot(e.devRuntimeArtifactsPointerPath) ?? t, { - moduleMapLoaderPath: e.moduleMapLoaderPath, - sandboxAppRoot: t - }); - } - if (readBundledCompiledArtifacts() !== null) return createBundledRuntimeCompiledArtifactsSource(); - if (t !== void 0) return createDiskRuntimeCompiledArtifactsSource(t); - throw Error(`eve Nitro route requires bundled artifacts or an eve Nitro runtime configuration app root.`); -} -//#endregion -//#region node_modules/eve/dist/src/internal/nitro/routes/runtime-stack.js -async function resolveNitroChannelRuntimeBundle(e) { - let t = resolveNitroCompiledArtifactsSource(e), n = await getCompiledRuntimeAgentBundle({ compiledArtifactsSource: t }), r = createWorkflowRuntime({ compiledArtifactsSource: t }); - return { - channels: n.graph.root.channels, - runtime: r - }; -} -//#endregion -//#region node_modules/eve/dist/src/internal/nitro/routes/channel-dispatch.js -const log$13 = createLogger(`channel.dispatch`); -async function dispatchChannelRequest(e, t, r) { - let i = await resolveNitroChannelRuntimeBundle(r), a = i.channels.find((e) => `${e.method.toUpperCase()} ${e.urlPath}` === t); - if (a === void 0) return Response.json({ - error: `No matching channel for this request.`, - ok: !1 - }, { status: 404 }); - let o = buildRouteArgs(e, i, a.name), c; - try { - c = await withDevelopmentVercelOidcContext(r, e.req, async () => { - if (a.handler) return await a.handler(e.req, o.args); - let t = { - agent: o.agent, - waitUntil: o.args.waitUntil, - params: o.args.params, - requestIp: o.args.requestIp - }; - return await a.fetch(e.req, t); - }); - } catch (r) { - let i = logError(log$13, `channel handler threw`, r, { - routeKey: t, - channel: a.name - }); - return flushBackgroundTasks(e, o.backgroundTasks, t, a.name), Response.json({ - error: `Channel handler failed.`, - errorId: i, - ok: !1 - }, { status: 500 }); - } - return flushBackgroundTasks(e, o.backgroundTasks, t, a.name), c; -} -async function withDevelopmentVercelOidcContext(e, t, n) { - let r = e.appRoot; - return e.dev !== !0 || r === void 0 ? await n() : await withVercelOidcProjectResolver({ - request: t, - resolveCurrentProject: async () => { - let e = await readVercelProjectLink(r); - return e === void 0 ? void 0 : { - environment: `development`, - projectId: e.projectId - }; - } - }, n); -} -function buildRouteArgs(t, n, o) { - let s = readVercelRequestId(t.req.headers), c = extractSocketIp(t), l = [], u = t.context.params ?? {}, d = {}; - for (let [e, t] of Object.entries(u)) d[e] = decodeURIComponent(t); - let waitUntil = (e) => { - l.push(e); - }, f = n.channels.find((e) => e.name === o)?.adapter ?? { kind: `channel` }; - return { - agent: createRouteAgent(n.runtime, s), - args: { - send: createSendFn(n.runtime, f, o, { requestId: s }), - getSession: createGetSessionFn(n.runtime), - receive: createCrossChannelReceiveFn(n.runtime, toCrossChannelTargets(n.channels)), - params: d, - waitUntil, - requestIp: c - }, - backgroundTasks: l - }; -} -function createRouteAgent(e, t) { - return { - async deliver(n) { - let r = { - ...n, - requestId: t - }; - return await e.deliver(r); - }, - async getEventStream(t, n) { - return await e.getEventStream(t, n); - }, - async run(n) { - let r = { - ...n, - requestId: t - }; - return await e.run(r); - } - }; -} -function readVercelRequestId(e) { - let t = e.get(`x-vercel-id`)?.trim(); - return t === `` ? void 0 : t; -} -function flushBackgroundTasks(e, t, r, i) { - t.length !== 0 && e.waitUntil(Promise.allSettled(t).then((e) => { - for (let t of e) t.status === `rejected` && logError(log$13, `channel background task failed`, t.reason, { - routeKey: r, - channel: i - }); - })); -} -function extractSocketIp(e) { - let t = e.req.ip; - return typeof t == `string` && t.length > 0 ? t : null; -} -//#endregion -//#region node_modules/eve/dist/src/internal/workflow/builtins.js -async function __builtin_response_array_buffer$1() { - return await this.arrayBuffer(); -} -async function __builtin_response_json$1() { - return await this.json(); -} -async function __builtin_response_text$1() { - return await this.text(); -} -const EVE_UNSUPPORTED_WORLD_WARNED$1 = Symbol.for(`@workflow/setAttributes//unsupportedWorldWarned`); -function formatUnknownError$1(e) { - return e instanceof Error ? e.stack ?? `${e.name}: ${e.message}` : String(e); -} -async function __builtin_set_attributes$1(t, n) { - if (t.length === 0) return; - let r = globalThis, i = r[Symbol.for(`WORKFLOW_STEP_CONTEXT_STORAGE`)]?.getStore?.(), a = typeof i?.stepMetadata?.attempt == `number` ? i.stepMetadata.attempt : 3, o = r[Symbol.for(`@workflow/world//cache`)]; - if (typeof o?.runs?.experimentalSetAttributes != `function`) { - if (r[EVE_UNSUPPORTED_WORLD_WARNED$1] !== !0) { - r[EVE_UNSUPPORTED_WORLD_WARNED$1] = !0; - let t = o?.name === void 0 ? `` : ` (${o.name})`; - console.warn(`[eve] setAttributes: the current world implementation${t} does not implement experimentalSetAttributes; this call (and any subsequent setAttributes calls in this process) is a no-op. Attributes will become available once the world adapter adds support.`); - } - return; - } - try { - let e = i?.workflowMetadata?.workflowRunId; - if (e === void 0) throw Error(`__builtin_set_attributes: no workflow run id available in step context`); - await o.runs.experimentalSetAttributes(e, t, n); - } catch (e) { - if (a < 3) throw e; - console.error(`[eve] setAttributes: failed to post tags after 3 attempts; dropping the internal attribute write. ${formatUnknownError$1(e)}`); - } -} -__builtin_set_attributes$1.maxRetries = 2; -s$7("__builtin_response_array_buffer", __builtin_response_array_buffer$1); -s$7("__builtin_response_json", __builtin_response_json$1); -s$7("__builtin_response_text", __builtin_response_text$1); -s$7("__builtin_set_attributes", __builtin_set_attributes$1); -//#endregion -//#region node_modules/eve/dist/src/internal/workflow/queue-namespace.js -const WORKFLOW_QUEUE_NAMESPACE_ENV = `WORKFLOW_QUEUE_NAMESPACE`; -function deriveEveWorkflowQueueNamespace(e) { - return `eve${Array.from(new TextEncoder().encode(e), (e) => e.toString(16).padStart(2, `0`)).join(``)}`; -} -function installEveWorkflowQueueNamespace(t) { - let n = deriveEveWorkflowQueueNamespace(t); - return process.env[WORKFLOW_QUEUE_NAMESPACE_ENV] = n, n; -} -//#endregion -//#region node_modules/eve/dist/src/public/definitions/connections/mcp.js -function defineMcpClientConnection(e) { - return e.auth !== void 0 && typeof e.auth != `function` && (e.auth = normalizeAuthorizationSpec(e.auth, `defineMcpClientConnection:`)), stampDefinitionKey(e, `connection:${e.url}`), stampConnectionProtocol(e, `mcp`), e; -} -//#endregion -//#region agent/connections/dataforseo.ts -var dataforseo_exports = /* @__PURE__ */ __exportAll({ default: () => dataforseo_default }); -var dataforseo_default = defineMcpClientConnection({ - url: "https://mcp.dataforseo.com/mcp", - description: "DataForSEO rankings data: live SERP results by keyword/location, the domain's ranked keywords with position and search volume, keyword gaps against competitors, and search volume lookups.", - headers: { Authorization: `Basic ${Buffer.from(`${process.env.DATAFORSEO_LOGIN ?? ""}:${process.env.DATAFORSEO_PASSWORD ?? ""}`).toString("base64")}` }, - tools: { allow: [ - "serp_organic_live_advanced", - "dataforseo_labs_google_ranked_keywords", - "dataforseo_labs_google_domain_intersection", - "keywords_data_google_ads_search_volume" - ] } -}); -//#endregion -//#region node_modules/eve/dist/src/public/definitions/sandbox.js -function defineSandbox(e) { - return e; -} -//#endregion -//#region agent/sandbox/sandbox.ts -var sandbox_exports$1 = /* @__PURE__ */ __exportAll({ default: () => sandbox_default }); -var sandbox_default = defineSandbox({ - backend: defaultSandbox({ - vercel: { networkPolicy: "allow-all" }, - docker: { networkPolicy: "allow-all" } - }), - revalidationKey: () => "seo-improver-agent-browser-gh-v1", - async bootstrap({ use }) { - const sandbox = await use(); - await sandbox.run({ command: "bash setup-agent-browser.sh" }); - await sandbox.run({ command: "bash setup-gh.sh seo-improver" }); - } -}); -//#endregion -//#region agent/lib/search-console.ts -const TOKEN_URL = "https://oauth2.googleapis.com/token"; -const SCOPE = "https://www.googleapis.com/auth/webmasters.readonly"; -const API_BASE = "https://searchconsole.googleapis.com/webmasters/v3"; -async function serviceAccountToken() { - const raw = process.env.GSC_CREDENTIALS_JSON; - if (!raw) throw new Error("GSC_CREDENTIALS_JSON is not set"); - const { client_email, private_key } = JSON.parse(raw); - const now = Math.floor(Date.now() / 1e3); - const signingInput = `${Buffer.from(JSON.stringify({ - alg: "RS256", - typ: "JWT" - })).toString("base64url")}.${Buffer.from(JSON.stringify({ - iss: client_email, - scope: SCOPE, - aud: TOKEN_URL, - iat: now, - exp: now + 3600 - })).toString("base64url")}`; - const assertion = `${signingInput}.${createSign("RSA-SHA256").update(signingInput).sign(private_key, "base64url")}`; - const res = await fetch(TOKEN_URL, { - method: "POST", - headers: { "Content-Type": "application/x-www-form-urlencoded" }, - body: new URLSearchParams({ - grant_type: "urn:ietf:params:oauth:grant-type:jwt-bearer", - assertion - }) - }); - if (!res.ok) throw new Error(`Search Console token exchange failed: ${res.status} ${await res.text()}`); - const data = await res.json(); - if (!data.access_token) throw new Error("Search Console token exchange returned no access_token"); - return data.access_token; -} -async function apiRequest(path, init) { - const token = await serviceAccountToken(); - const res = await fetch(`${API_BASE}${path}`, { - ...init, - headers: { - authorization: `Bearer ${token}`, - "content-type": "application/json", - ...init?.headers - } - }); - if (!res.ok) throw new Error(`Search Console request failed: ${res.status} ${await res.text()}`); - return res.json(); -} -const searchAnalyticsQueryInputSchema = { - type: "object", - additionalProperties: false, - required: [ - "siteUrl", - "startDate", - "endDate" - ], - properties: { - siteUrl: { - type: "string", - description: "The property, e.g. `sc-domain:example.com` or `https://www.example.com/`." - }, - startDate: { - type: "string", - description: "YYYY-MM-DD (inclusive)." - }, - endDate: { - type: "string", - description: "YYYY-MM-DD (inclusive)." - }, - dimensions: { - type: "array", - items: { - type: "string", - enum: [ - "query", - "page", - "country", - "device", - "date", - "searchAppearance" - ] - } - }, - type: { - type: "string", - enum: [ - "web", - "image", - "video", - "news", - "discover", - "googleNews" - ] - }, - dataState: { - type: "string", - enum: ["final", "all"] - }, - rowLimit: { - type: "integer", - description: "Max rows, up to 25000." - }, - startRow: { - type: "integer", - description: "Zero-based row offset for paging." - }, - dimensionFilterGroups: { - type: "array", - items: { - type: "object", - additionalProperties: true - } - } - } -}; -async function querySearchAnalytics(input) { - const { siteUrl, ...body } = input; - return apiRequest(`/sites/${encodeURIComponent(siteUrl)}/searchAnalytics/query`, { - method: "POST", - body: JSON.stringify(body) - }); -} -async function listSites() { - return apiRequest("/sites"); -} -//#endregion -//#region agent/tools/list_search_console_sites.ts -var list_search_console_sites_exports = /* @__PURE__ */ __exportAll({ default: () => list_search_console_sites_default }); -var list_search_console_sites_default = defineTool({ - description: "List the Search Console properties the configured service account can access. Useful to confirm access and the exact property name before querying.", - inputSchema: { - type: "object", - additionalProperties: false, - properties: {} - }, - async execute() { - return listSites(); - } -}); -//#endregion -//#region agent/tools/query_search_analytics.ts -var query_search_analytics_exports = /* @__PURE__ */ __exportAll({ default: () => query_search_analytics_default }); -var query_search_analytics_default = defineTool({ - description: "Query Google Search Console Search Analytics for the property: the site's own real clicks, impressions, CTR, and average position by query, page, country, device, and date. First-party ground truth for striking-distance, low-CTR, cannibalization, and decay analysis.", - inputSchema: searchAnalyticsQueryInputSchema, - async execute(input) { - return querySearchAnalytics(input); - } -}); -//#endregion -//#region .eve/compile/compiled-artifacts-bootstrap.mjs -installEveWorkflowQueueNamespace("qr-master"); -const moduleMap = Object.freeze({ "nodes": Object.freeze({ "__root__": Object.freeze({ "modules": Object.freeze({ - "connections/dataforseo.ts": dataforseo_exports, - "sandbox/sandbox.ts": sandbox_exports$1, - "tools/list_search_console_sites.ts": list_search_console_sites_exports, - "tools/query_search_analytics.ts": query_search_analytics_exports -}) }) }) }); -const metadata = { - "compile": { "moduleMap": { - "path": ".eve/compile/module-map.mjs", - "sha256": "c76cab7c1a37dca6eb591740264f371cca3e74760abc1f9fc4652f959f1e0353" - } }, - "discovery": { - "diagnostics": { - "path": ".eve/discovery/diagnostics.json", - "sha256": "b26fc8e66ee943f962b1bab4a790f6a611ce7e6738aa29f83ea53b73cc362c63" - }, - "manifest": { - "path": ".eve/discovery/agent-discovery-manifest.json", - "sha256": "305c68e3493f0a1ba53702641dbf8675e60374b68a24b73f13b69ac6246dbcaa" - }, - "sourceGraphHash": "3370c163e654fd12b5b4097da0747ee823445d615e0713c04b38ac808c739532", - "summary": { - "errors": 0, - "warnings": 0 - } - }, - "generator": { - "name": "eve", - "version": "0.16.2" - }, - "kind": "eve-compile-metadata", - "status": "ready", - "version": 5 -}; -const manifest = { - "agentRoot": "C:\\Users\\timo\\Documents\\qrmaster\\QR-master\\agent", - "appRoot": "C:\\Users\\timo\\Documents\\qrmaster\\QR-master", - "channels": [], - "connections": [{ - "connectionName": "dataforseo", - "logicalPath": "connections/dataforseo.ts", - "sourceId": "connections/dataforseo.ts", - "sourceKind": "module", - "description": "DataForSEO rankings data: live SERP results by keyword/location, the domain's ranked keywords with position and search volume, keyword gaps against competitors, and search volume lookups.", - "protocol": "mcp", - "url": "https://mcp.dataforseo.com/mcp" - }], - "config": { - "compaction": {}, - "model": { - "id": "anthropic/claude-sonnet-4.6", - "routing": { - "kind": "gateway", - "target": "anthropic" - }, - "contextWindowTokens": 1e6 - }, - "name": "qr-master" - }, - "diagnosticsSummary": { - "errors": 0, - "warnings": 0 - }, - "disabledFrameworkTools": [], - "workflowEnabled": false, - "dynamicInstructions": [], - "dynamicSkills": [], - "dynamicTools": [], - "hooks": [], - "remoteAgents": [], - "sandbox": { - "backendName": "just-bash", - "logicalPath": "sandbox/sandbox.ts", - "revalidationKey": "seo-improver-agent-browser-gh-v1", - "sourceHash": "838127a7092961bbfd47e3b91a0e14b19afb7d655167d4d079c474abd40f570e", - "sourceId": "sandbox/sandbox.ts", - "sourceKind": "module" - }, - "sandboxWorkspaces": [{ - "logicalPath": "sandbox/workspace", - "rootEntries": ["setup-agent-browser.sh", "setup-gh.sh"], - "sourceId": "sandbox/workspace", - "sourcePath": "C:\\Users\\timo\\Documents\\qrmaster\\QR-master\\agent\\sandbox\\workspace" - }], - "schedules": [{ - "cron": "0 9 * * 1", - "hasRun": false, - "logicalPath": "schedules/weekly.ts", - "name": "weekly", - "sourceId": "schedules/weekly.ts", - "sourceKind": "module", - "markdown": "Run the weekly SEO improver loop for the configured property and tracked keywords." - }], - "skills": [], - "tools": [{ - "description": "List the Search Console properties the configured service account can access. Useful to confirm access and the exact property name before querying.", - "inputSchema": { - "type": "object", - "additionalProperties": false, - "properties": {} - }, - "logicalPath": "tools/list_search_console_sites.ts", - "name": "list_search_console_sites", - "sourceId": "tools/list_search_console_sites.ts", - "sourceKind": "module" - }, { - "description": "Query Google Search Console Search Analytics for the property: the site's own real clicks, impressions, CTR, and average position by query, page, country, device, and date. First-party ground truth for striking-distance, low-CTR, cannibalization, and decay analysis.", - "inputSchema": { - "type": "object", - "additionalProperties": false, - "required": [ - "siteUrl", - "startDate", - "endDate" - ], - "properties": { - "siteUrl": { - "type": "string", - "description": "The property, e.g. `sc-domain:example.com` or `https://www.example.com/`." - }, - "startDate": { - "type": "string", - "description": "YYYY-MM-DD (inclusive)." - }, - "endDate": { - "type": "string", - "description": "YYYY-MM-DD (inclusive)." - }, - "dimensions": { - "type": "array", - "items": { - "type": "string", - "enum": [ - "query", - "page", - "country", - "device", - "date", - "searchAppearance" - ] - } - }, - "type": { - "type": "string", - "enum": [ - "web", - "image", - "video", - "news", - "discover", - "googleNews" - ] - }, - "dataState": { - "type": "string", - "enum": ["final", "all"] - }, - "rowLimit": { - "type": "integer", - "description": "Max rows, up to 25000." - }, - "startRow": { - "type": "integer", - "description": "Zero-based row offset for paging." - }, - "dimensionFilterGroups": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true - } - } - } - }, - "logicalPath": "tools/query_search_analytics.ts", - "name": "query_search_analytics", - "sourceId": "tools/query_search_analytics.ts", - "sourceKind": "module" - }], - "workspaceResourceRoot": { - "contentHash": "9f97e6abb4302039c6c4e2b3d4de3cf5c149de805a90c3e20c3f21da697afb92", - "logicalPath": "workspace-resources/__root__", - "rootEntries": ["setup-agent-browser.sh", "setup-gh.sh"] - }, - "instructions": { - "name": "instructions", - "logicalPath": "instructions.md", - "markdown": "\r\nSearch Console property: https://www.qrmaster.net/\r\nProject domain: qrmaster.net\r\nTracked keywords: not set (derive from the domain's own ranked keywords)\r\nBlog repo and content path: not set (report-only)\r\n\r\n\r\nYou are an SEO improver agent. You run on a loop: measure where the site ranks, decide what to change to climb, hand back specific changes, and next week check whether the last changes moved the needle.\r\n\r\nYou do three things every run: **track rankings**, **prioritize a small set of high-leverage improvements**, and **report movement since the previous run**. You do not guess at rankings; you read them from data. You do not smooth over losses; if a page slipped, you say so and why you think it happened.\r\n\r\nYour project configuration is the `project-config` block at the top of this file. Do not assume values from examples. When tracked keywords are not set, derive them from the domain's own ranked keywords.\r\n\r\n## Data sources\r\n\r\nYou use two sources, and each answers a different question. **Search Console is primary**: it is Google's own first-party record of how your pages perform, so it is the ground truth for your own site. **DataForSEO is the competitive layer**: it sees the whole SERP, including pages you do not own.\r\n\r\nUse the `query_search_analytics` tool for your site's real performance: clicks, impressions, CTR, and average position by query and page, for the configured property. Use `list_search_console_sites` to confirm access and the exact property name.\r\n\r\nUse the `dataforseo` connection for what Search Console cannot see: the live SERP for a keyword, who ranks above you and what their pages do, search volume, and keyword gaps you do not yet rank for. It exposes only the tools for those four jobs. This is how you answer \"who is beating me and why\" and size the opportunity.\r\n\r\nIf either source is unauthorized or errors, stop and report that blocker instead of fabricating data. Do not silently fall back to a single source.\r\n\r\nUse native sandbox command execution for lightweight checks such as `curl`, `node`, CSV/JSON writing, HTTP status, titles, and parsing. Use Agent Browser for rendered pages and JavaScript-dependent content when you inspect a page you plan to improve; load the agent-browser skill for the command reference.\r\n\r\nKeep the run read-only against the target site. Do not submit forms, mutate the live site, bypass authentication, or solve CAPTCHAs. Respect robots and obvious rate limits. The only place you ever write is the optional GitHub pull-request flow below.\r\n\r\n## State and the loop\r\n\r\nPersist each run under `reports/seo-improver//`. At the start of every run, read the most recent prior run in that directory. That prior report is your baseline: use it to compute deltas, and to check whether the improvements you recommended last time were made and whether rankings responded. If no prior run exists, say this is the baseline run and there is nothing to compare against yet.\r\n\r\n## Each run\r\n\r\n1. Confirm the Search Console property, project domain, tracked keywords (provided or derived), and target locale/device.\r\n2. Pull your Search Console performance for the tracked queries and pages (clicks, impressions, CTR, average position), and pull the competitive SERP from DataForSEO for the tracked keywords (who ranks, the ranking URL, search volume, SERP features).\r\n3. Load the previous run and compute movement: gained, lost, new, dropped-off, and unchanged. Flag anything that fell out of the top 100.\r\n4. Identify the highest-leverage opportunities, ranked by realistic upside, not just raw volume:\r\n - **Striking distance**: queries at ~4-20 where a focused improvement can win a page-1 or top-3 slot; confirm the competition against the live SERP.\r\n - **High impressions, low CTR**: pages that earn impressions but lose the click; rewrite title/meta to win it without new rankings.\r\n - **Cannibalization**: several of your pages competing for one query; recommend which to consolidate.\r\n - **Decay**: pages whose clicks or position fell since a prior run; diagnose likely cause (content staleness, lost links, SERP change, intent shift) and check DataForSEO for what moved above you.\r\n5. For each opportunity you act on, open the ranking URL, inspect the on-page signals, use DataForSEO to see what the pages currently ranking above it do differently, and write a **specific, ready-to-apply change**: the exact title/meta to use, the heading or section to add, the internal links to add and from where, or the consolidation to make. Tie every recommendation to the ranking evidence that motivates it.\r\n6. Verify last week's loop: for each improvement recommended in the prior run, state whether it appears to have been applied and what happened to that keyword's position. Keep what worked, drop or revise what did not.\r\n\r\n## Output\r\n\r\nWrite two artifacts under `reports/seo-improver//`:\r\n\r\n- `rankings.csv` — the tracked-keyword snapshot for week-over-week diffing.\r\n\r\n ```csv\r\n keyword,location,device,position,previous_position,delta,ranking_url,search_volume,serp_features,status\r\n ```\r\n\r\n `status` is one of `gained`, `lost`, `new`, `dropped`, or `flat`. `delta` is positive when position improved (moved toward #1). Leave `previous_position` blank on the baseline run.\r\n\r\n- `report.md` — a concise Markdown report:\r\n 1. Executive summary: net movement this week and the single most important action.\r\n 2. Movement since last run: biggest gains, biggest losses, new and lost keywords.\r\n 3. Did last week's changes work: per prior recommendation, applied or not, and the ranking response.\r\n 4. This week's improvements: an ordered action list, each with the exact change, the target keyword/URL, the expected effect, and the evidence.\r\n 5. Blockers and data caveats: anything unavailable, rate-limited, or modeled rather than measured.\r\n\r\nUse stable IDs such as `SEO-STRIKE-001`, `SEO-CTR-002`, `SEO-DECAY-003` so recommendations are easy to reference across runs and you can report next week on the same ID.\r\n\r\nKeep the action list short and high-conviction. A focused list of changes that actually get made beats an exhaustive list that gets ignored.\r\n\r\n## Applying changes to a GitHub blog (optional)\r\n\r\nBy default you only report. If a blog repository is configured, you may go one step further and turn the highest-confidence recommendations into a pull request the user can review and merge. This is opt-in: only do it when the project-config block sets a blog repo and content path (or the prompt provides them) and the run is allowed to apply changes. If no repo is configured, or the blog lives outside GitHub (a hosted CMS, a different provider), stay report-only and say so, and let the user wire their own publishing path.\r\n\r\nUse the sandbox `bash` tool to run the GitHub CLI (`gh`), targeting the configured repo with `-R owner/repo`. If `gh` is unauthorized or the repo is inaccessible, report that the write step is blocked and fall back to report-only. Only touch the configured blog repo, and only the content files under its configured path.\r\n\r\nWhen you apply changes:\r\n\r\n1. Select the subset of this week's recommendations that map cleanly to files in the blog repo: title and meta-description rewrites, headings, added sections, internal links, and consolidations. Skip anything you cannot ground in a specific source file.\r\n2. Clone or fetch the repo, create a new branch named like `seo-improver/-`, and edit the source files (Markdown, MDX, or frontmatter). Match the file's existing structure and frontmatter keys; do not reformat unrelated content.\r\n3. Open a pull request with `gh pr create`. Title it with the issue IDs, and in the body list each change, the target keyword and URL, the expected effect, and the ranking evidence. Never push to the default branch, never merge, never force-push.\r\n4. Record every PR URL in `report.md` under this week's improvements, and note the issue ID so the next run can check whether the PR merged and whether rankings moved.\r\n\r\nOne branch and pull request per run unless the user asks otherwise. Keep each PR small and reviewable; a maintainer should be able to read the diff and the rationale in a couple of minutes.\r\n", - "sourceId": "instructions.md", - "sourceKind": "markdown" - }, - "kind": "eve-agent-compiled-manifest", - "subagentEdges": [], - "subagents": [], - "version": 31 -}; -function installCompiledArtifactsBootstrap() { - installBundledCompiledArtifacts({ - manifest, - metadata, - moduleMap - }); -} -installCompiledArtifactsBootstrap(); -function installCompiledArtifactsPlugin() {} -async function __eveInstallCompiledArtifactsStep() { - return null; -} -s$7("step//./.eve/compile/compiled-artifacts-bootstrap//__eveInstallCompiledArtifactsStep", __eveInstallCompiledArtifactsStep); -//#endregion -//#region node_modules/eve/dist/src/harness/proxy-input-requests.js -const PROXY_INPUT_REQUESTS_KEY = `eve.runtime.proxyInputRequests`; -function getProxyInputRequests(e) { - return new Map(Object.entries(readMap(e))); -} -function hasProxyInputRequests(e) { - for (let t of Object.keys(readMap(e))) return !0; - return !1; -} -function upsertProxyInputRequests(e) { - let t = {}; - for (let [n, r] of Object.entries(readMap(e.session.state))) r !== e.forChildContinuationToken && (t[n] = r); - for (let [n, r] of e.entries) t[n] = r; - return writeMap(e.session, t); -} -function clearProxyInputRequestsForChild(e, t) { - let n = readMap(e.state), r = {}, i = !1; - for (let [e, a] of Object.entries(n)) { - if (a === t) { - i = !0; - continue; - } - r[e] = a; - } - return i ? writeMap(e, r) : e; -} -function toProxyInputRequestEntries(e) { - return e.event.requests.map((t) => [t.requestId, e.childContinuationToken]); -} -function readMap(t) { - let n = t?.[PROXY_INPUT_REQUESTS_KEY]; - if (typeof n != `object` || !n || Array.isArray(n)) return {}; - let r = {}; - for (let [e, t] of Object.entries(n)) typeof t == `string` && (r[e] = t); - return r; -} -function writeMap(t, n) { - let r = { ...t.state }; - return Object.keys(n).length === 0 ? (delete r[PROXY_INPUT_REQUESTS_KEY], { - ...t, - state: Object.keys(r).length > 0 ? r : void 0 - }) : (r[PROXY_INPUT_REQUESTS_KEY] = n, { - ...t, - state: r - }); -} -//#endregion -//#region node_modules/eve/dist/src/runtime/actions/keys.js -function getRuntimeActionRequestKey(e) { - switch (e.kind) { - case `load-skill`: return `runtime-action:${e.kind}:${e.callId}`; - case `remote-agent-call`: return `subagent-call:${e.remoteAgentName}:${e.callId}`; - case `subagent-call`: return `subagent-call:${e.subagentName}:${e.callId}`; - case `tool-call`: return `tool-call:${e.toolName}:${e.callId}`; - } -} -function getRuntimeActionResultKey(e) { - switch (e.kind) { - case `load-skill-result`: return `runtime-action:load-skill:${e.callId}`; - case `subagent-result`: return `subagent-call:${e.subagentName}:${e.callId}`; - case `tool-result`: return `tool-call:${e.toolName}:${e.callId}`; - } -} -//#endregion -//#region node_modules/eve/dist/src/harness/runtime-actions.js -const PENDING_RUNTIME_ACTION_BATCH_KEY = `eve.runtime.pendingActionBatch`; -function getPendingRuntimeActionBatch(e) { - let t = e?.[PENDING_RUNTIME_ACTION_BATCH_KEY]; - if (typeof t != `object` || !t) return; - let n = t; - if (!(!Array.isArray(n.actions) || !Array.isArray(n.responseMessages) || typeof n.event != `object` || n.event === null)) return n; -} -function setPendingRuntimeActionBatch(e) { - let t = { ...e.session.state }; - return t[PENDING_RUNTIME_ACTION_BATCH_KEY] = { - actions: [...e.actions], - event: e.event, - responseMessages: [...e.responseMessages] - }, { - ...e.session, - state: t - }; -} -function recordPendingSubagentChildToken(e) { - let t = getPendingRuntimeActionBatch(e.session.state); - if (t === void 0) return e.session; - let n = { ...e.session.state }; - return n[PENDING_RUNTIME_ACTION_BATCH_KEY] = { - ...t, - childContinuationTokens: { - ...t.childContinuationTokens, - [e.callId]: e.childContinuationToken - } - }, { - ...e.session, - state: n - }; -} -function resolveReadyRuntimeActionResults(e) { - let t = getPendingRuntimeActionBatch(e.session.state); - if (t !== void 0) return resolveRuntimeActionResultsForBatch({ - batch: t, - results: e.results - }); -} -function resolveRuntimeActionResultsForBatch(e) { - return resolveRuntimeActionResultsForKeys({ - pendingKeys: e.batch.actions.map((e) => getRuntimeActionRequestKey(e)), - results: e.results - }); -} -function resolveRuntimeActionResultsForKeys(e) { - let t = new Set(e.pendingKeys), n = /* @__PURE__ */ new Map(); - for (let r of e.results) { - let e = getRuntimeActionResultKey(r); - t.has(e) && n.set(e, r); - } - let r = []; - for (let t of e.pendingKeys) { - let e = n.get(t); - if (e === void 0) return; - r.push(e); - } - return r; -} -async function resolvePendingRuntimeActions(t) { - let r = getPendingRuntimeActionBatch(t.session.state); - if (r === void 0) return { - messages: [...t.session.history], - outcome: `continue`, - session: t.session - }; - let i = resolveReadyRuntimeActionResults({ - results: t.stepInput?.runtimeActionResults ?? [], - session: t.session - }); - if (i === void 0) return { - messages: [...t.session.history], - outcome: `unresolved`, - session: t.session - }; - if (t.emit !== void 0) for (let n of i) n.kind === `subagent-result` && n.isError !== !0 && await t.emit({ - data: { - callId: n.callId, - output: typeof n.output == `string` ? n.output : JSON.stringify(n.output), - subagentName: n.subagentName - }, - type: `subagent.completed` - }), await t.emit(createActionResultEvent({ - result: n, - sequence: r.event.sequence, - stepIndex: r.event.stepIndex, - turnId: r.event.turnId - })); - let a = { ...t.session.state }; - delete a[PENDING_RUNTIME_ACTION_BATCH_KEY]; - let o = { - ...t.session, - state: Object.keys(a).length > 0 ? a : void 0 - }, s = r.childContinuationTokens; - if (s !== void 0) for (let e of i) { - if (e.kind !== `subagent-result`) continue; - let t = s[e.callId]; - t !== void 0 && (o = clearProxyInputRequestsForChild(o, t)); - } - let c = i.map((e) => { - switch (e.kind) { - case `load-skill-result`: return { - output: toToolResultOutput(e), - toolCallId: e.callId, - toolName: `load_skill`, - type: `tool-result` - }; - case `subagent-result`: return { - output: toToolResultOutput(e), - toolCallId: e.callId, - toolName: e.subagentName, - type: `tool-result` - }; - case `tool-result`: return { - output: toToolResultOutput(e), - toolCallId: e.callId, - toolName: e.toolName, - type: `tool-result` - }; - } - throw Error(`Unsupported runtime action result kind "${String(e)}".`); - }), l = [...o.history, ...r.responseMessages]; - return c.length > 0 && l.push({ - content: c, - role: `tool` - }), { - messages: l, - outcome: `resolved`, - session: o - }; -} -function createRuntimeActionRequestFromToolCall(e) { - let t = e.tools.get(e.toolCall.toolName); - return t?.runtimeAction?.kind === `subagent-call` ? { - callId: e.toolCall.toolCallId, - description: t.description, - input: resolveToolCallInputObject$1(e.toolCall.input, { - callId: e.toolCall.toolCallId, - toolName: e.toolCall.toolName - }), - kind: `subagent-call`, - name: t.name, - nodeId: t.runtimeAction.nodeId, - subagentName: t.runtimeAction.subagentName - } : t?.runtimeAction?.kind === `remote-agent-call` ? { - callId: e.toolCall.toolCallId, - description: t.description, - input: resolveToolCallInputObject$1(e.toolCall.input, { - callId: e.toolCall.toolCallId, - toolName: e.toolCall.toolName - }), - kind: `remote-agent-call`, - name: t.name, - nodeId: t.runtimeAction.nodeId, - remoteAgentName: t.runtimeAction.remoteAgentName ?? t.name - } : { - callId: e.toolCall.toolCallId, - input: resolveToolCallInputObject$1(e.toolCall.input, { - callId: e.toolCall.toolCallId, - toolName: e.toolCall.toolName - }), - kind: `tool-call`, - toolName: e.toolCall.toolName - }; -} -function resolveToolCallInputObject$1(e, n) { - if (e == null) return {}; - try { - return parseJsonObject(e); - } catch (e) { - let t = e instanceof Error ? e.message : String(e); - throw TypeError(`Failed to parse tool-call arguments for "${n.toolName}" (${n.callId}): ${t}`, { cause: e }); - } -} -function toToolResultOutput(e) { - return typeof e.output == `string` ? e.isError === !0 ? { - type: `error-text`, - value: e.output - } : { - type: `text`, - value: e.output - } : e.isError === !0 ? { - type: `error-json`, - value: toMutableJsonValue(e.output) - } : { - type: `json`, - value: toMutableJsonValue(e.output) - }; -} -function toMutableJsonValue(e) { - if (e === null || typeof e == `string` || typeof e == `number` || typeof e == `boolean`) return e; - if (Array.isArray(e)) return e.map((e) => toMutableJsonValue(e)); - let t = {}; - for (let [n, r] of Object.entries(e)) t[n] = toMutableJsonValue(r); - return t; -} -//#endregion -//#region node_modules/eve/dist/src/shared/empty-delivery.js -const EMPTY_DELIVERY_SENTINEL = ``; -const CONDITIONAL_DELIVERY_INSTRUCTION = `Conditional delivery\nOnly when the current task explicitly makes delivery conditional and there is nothing to report, reply with exactly ${EMPTY_DELIVERY_SENTINEL} and no other text. Do not use this marker for ordinary conversations, after input or approval responses, or merely because you have no additional commentary. Never return an empty response; use the marker to intentionally deliver nothing.`; -function hasEmptyDeliverySentinel(e) { - return e?.includes(``) ?? !1; -} -//#endregion -//#region node_modules/eve/dist/src/harness/tool-output-serialization.js -var ToolOutputSerializationError = class extends TypeError { - toolCallId; - toolName; - constructor(e) { - super(formatToolOutputSerializationMessage(e)), this.name = `ToolOutputSerializationError`, this.toolCallId = e.toolCallId, this.toolName = e.toolName, e.cause !== void 0 && (this.cause = e.cause); - } -}; -function formatToolOutputSerializationMessage(e) { - return `${e.toolCallId === void 0 ? `Tool "${e.toolName}"` : `Tool "${e.toolName}" call "${e.toolCallId}"`} ${e.boundary === `execute` ? `returned a non-JSON-serializable result` : e.boundary === `toModelOutput` ? `returned a non-JSON-serializable model output` : `produced a non-JSON-serializable action result`}.${e.cause instanceof Error && e.cause.message.length > 0 ? ` ${e.cause.message}` : ``}`; -} -function withToolOutputSerializationError(e, t) { - try { - return t(); - } catch (t) { - throw t instanceof ToolOutputSerializationError ? t : new ToolOutputSerializationError({ - boundary: e.boundary, - cause: t, - toolCallId: e.toolCallId, - toolName: e.toolName - }); - } -} -//#endregion -//#region node_modules/eve/dist/src/harness/action-result-helpers.js -function toJsonValue(n) { - return isAuthorizationSignal(n) ? parseJsonValue(authorizationPendingAsJsonObject({ connections: n.challenges.map((e) => e.name) })) : isAuthorizationPendingModelOutput(n) ? parseJsonValue(authorizationPendingAsJsonObject(n)) : parseJsonValue(n === void 0 ? null : n); -} -function createRuntimeToolResultFromValue(e) { - let t = { - callId: e.callId, - kind: `tool-result`, - output: toolResultOutputToJsonValue({ - output: { - type: e.isError === !0 ? `error-json` : `json`, - value: e.isError === !0 && e.output instanceof Error ? e.output.message : e.output - }, - toolCallId: e.callId, - toolName: e.toolName - }), - toolName: e.toolName - }; - return e.isError === !0 ? { - ...t, - isError: !0 - } : t; -} -function createRuntimeToolResultFromStepResult(e) { - return createRuntimeToolResultFromValue({ - callId: e.toolCallId, - output: e.output, - toolName: e.toolName - }); -} -function createRuntimeToolResultFromMessagePart(e) { - return createRuntimeToolResultFromValue({ - callId: e.toolCallId, - output: toolResultOutputToJsonValue({ - output: e.output, - toolCallId: e.toolCallId, - toolName: e.toolName - }), - toolName: e.toolName, - isError: isToolResultError(e.output) - }); -} -function toolResultOutputToJsonValue(e) { - return withToolOutputSerializationError({ - boundary: `action.result`, - toolCallId: e.toolCallId, - toolName: e.toolName - }, () => { - switch (e.output.type) { - case `text`: - case `error-text`: return e.output.value; - case `json`: - case `error-json`: return toJsonValue(e.output.value); - case `execution-denied`: return { - code: `TOOL_EXECUTION_DENIED`, - message: e.output.reason ?? `Tool execution was denied.` - }; - case `content`: return toJsonValue(e.output.value); - } - }); -} -function isToolResultError(e) { - return e.type === `error-json` || e.type === `error-text` || e.type === `execution-denied`; -} -//#endregion -//#region node_modules/eve/dist/src/harness/tool-interrupts.js -const PendingToolInterruptsKey = new ContextKey(`eve.pendingToolInterrupts`); -function stashToolInterrupt(e, t, n) { - let r = e.get(PendingToolInterruptsKey) ?? {}; - asContainer(e).setVirtualContext(PendingToolInterruptsKey, { - ...r, - [t]: n - }); -} -function readToolInterrupt(e, t) { - return e.get(PendingToolInterruptsKey)?.[t]; -} -function asContainer(e) { - return e; -} -//#endregion -//#region node_modules/eve/dist/src/harness/stream-actions.js -function createProviderStreamActionBatch(t) { - let n = /* @__PURE__ */ new Map(), r = Promise.resolve(), i, a, o, emitPendingActions = async () => { - if (n.size === 0) return; - let r = [...n.values()]; - n.clear(), await t.emitFn(createActionsRequestedEvent({ - actions: r, - sequence: t.state.sequence, - stepIndex: t.state.stepIndex, - turnId: t.state.turnId - })); - }, scheduleFlush = () => { - if (a !== void 0) return; - let e, t = new Promise((t) => { - e = t; - }); - o = e, a = setTimeout(() => { - a = void 0, o = void 0, e?.(); - }, 0), r = r.then(() => t).then(emitPendingActions).catch((e) => { - i ??= e; - }); - }; - return { - observe(e) { - n.set(e.callId, e), scheduleFlush(); - }, - async flush() { - if (a !== void 0) { - clearTimeout(a), a = void 0; - let e = o; - o = void 0, e?.(); - } - if (await r, i !== void 0) throw i; - await emitPendingActions(); - } - }; -} -//#endregion -//#region node_modules/eve/dist/src/harness/emission.js -const HARNESS_EMISSION_STATE_KEY = `eve.harness.emission`; -const DEFAULT_EMISSION_STATE = { - sessionStarted: !1, - sequence: 0, - stepIndex: 0, - turnId: `` -}; -function getHarnessEmissionState(e) { - return e?.[HARNESS_EMISSION_STATE_KEY] ?? DEFAULT_EMISSION_STATE; -} -function setHarnessEmissionState(e, t) { - return { - ...e, - state: { - ...e.state, - [HARNESS_EMISSION_STATE_KEY]: t - } - }; -} -async function emitTurnPreamble(e, t, n, r) { - let i = `turn_${n.sequence}`; - return n.sessionStarted || await e(createSessionStartedEvent({ runtime: r })), await e(createTurnStartedEvent({ - sequence: n.sequence, - turnId: i - })), t.message !== void 0 && await e(createMessageReceivedEvent({ - message: t.message, - sequence: n.sequence, - turnId: i - })), { - sessionStarted: !0, - sequence: n.sequence, - stepIndex: 0, - turnId: i - }; -} -async function emitStepStarted(e, t, n) { - await e(createStepStartedEvent({ - sequence: t.sequence, - stepIndex: t.stepIndex, - turnId: t.turnId - }), n); -} -async function emitStepAndTurnFailed(e, t, n) { - await e(createStepFailedEvent({ - ...n, - sequence: t.sequence, - stepIndex: t.stepIndex, - turnId: t.turnId - })), await e(createTurnFailedEvent({ - ...n, - sequence: t.sequence, - turnId: t.turnId - })); -} -async function emitFailedStep(e, t, n) { - await emitStepAndTurnFailed(e, t, n), await e(createSessionFailedEvent(n)); -} -async function emitRecoverableFailedTurn(e, t, n) { - return await emitStepAndTurnFailed(e, t, n), await e(createSessionWaitingEvent()), { - sessionStarted: t.sessionStarted, - sequence: t.sequence + 1, - stepIndex: 0, - turnId: `` - }; -} -function advanceStep(e) { - return { - ...e, - stepIndex: e.stepIndex + 1 - }; -} -async function emitTurnEpilogue(e, t, n) { - return await e(createTurnCompletedEvent({ - sequence: t.sequence, - turnId: t.turnId - })), n === `conversation` ? await e(createSessionWaitingEvent()) : await e(createSessionCompletedEvent()), { - sessionStarted: t.sessionStarted, - sequence: t.sequence + 1, - stepIndex: 0, - turnId: `` - }; -} -function normalizeAssistantStepFinishReason(e) { - switch (e) { - case `content-filter`: - case `error`: - case `length`: - case `stop`: - case `tool-calls`: return e; - default: return `other`; - } -} -async function emitStreamContent(a, o, s, c) { - let l = ``, u = ``, d = `stop`, f, p = /* @__PURE__ */ new Set(), m = /* @__PURE__ */ new Set(), h = /* @__PURE__ */ new Set(), g = /* @__PURE__ */ new Set(), _ = createProviderStreamActionBatch({ - emitFn: a, - state: o - }), v = /* @__PURE__ */ new Set(), y = [], b = [], flushCurrentMessage = async () => { - u.length !== 0 && (await a(createMessageCompletedEvent({ - finishReason: `tool-calls`, - message: u, - sequence: o.sequence, - stepIndex: o.stepIndex, - turnId: o.turnId - })), u = ``); - }, emitActionRequest = async (e) => { - m.has(e.callId) || (u.trim().length > 0 && await flushCurrentMessage(), m.add(e.callId), await a(createActionsRequestedEvent({ - actions: [e], - sequence: o.sequence, - stepIndex: o.stepIndex, - turnId: o.turnId - }))); - }, collectProviderToolCall = async (e) => { - g.has(e.toolCallId) || (g.add(e.toolCallId), !m.has(e.toolCallId) && (m.add(e.toolCallId), u.trim().length > 0 && await flushCurrentMessage(), _.observe({ - callId: e.toolCallId, - input: resolveToolCallInputObject$1(e.input, { - callId: e.toolCallId, - toolName: e.toolName - }), - kind: `tool-call`, - toolName: e.toolName - }))); - }, emitActionResult = async (e) => { - h.has(e.callId) || (h.add(e.callId), await a(createActionResultEvent({ - result: e, - sequence: o.sequence, - stepIndex: o.stepIndex, - turnId: o.turnId - }))); - }, emitToolCall = async (e) => { - if (!(c === void 0 || e.invalid === !0 || c.excludedActionToolNames.has(e.toolName))) try { - await emitActionRequest(createRuntimeActionRequestFromToolCall({ - toolCall: e, - tools: c.tools - })); - } catch (e) { - if (e instanceof TypeError) return; - throw e; - } - }; - for await (let t of s) if (f === void 0) switch (t.type) { - case `reasoning-delta`: - await _.flush(), l += t.text, await a(createReasoningAppendedEvent({ - reasoningDelta: t.text, - reasoningSoFar: l, - sequence: o.sequence, - stepIndex: o.stepIndex, - turnId: o.turnId - })); - break; - case `text-delta`: - await _.flush(), l.trim().length > 0 && (await a(createReasoningCompletedEvent({ - reasoning: l, - sequence: o.sequence, - stepIndex: o.stepIndex, - turnId: o.turnId - })), l = ``), u += t.text, await a(createMessageAppendedEvent({ - messageDelta: t.text, - messageSoFar: u, - sequence: o.sequence, - stepIndex: o.stepIndex, - turnId: o.turnId - })); - break; - case `tool-call`: { - let e = t; - p.add(e.toolCallId), e.providerExecuted === !0 ? await collectProviderToolCall(e) : (await _.flush(), await emitToolCall(e)); - break; - } - case `tool-result`: { - let e = t; - if (e.preliminary === !0) break; - if (e.providerExecuted === !0) { - await collectProviderToolCall({ - input: `input` in e ? e.input : void 0, - toolCallId: e.toolCallId, - toolName: e.toolName - }), await _.flush(), await emitActionResult(createRuntimeToolResultFromStepResult(e)); - break; - } - if (p.has(t.toolCallId)) { - if (isInlineAuthorizationToolResult(e)) break; - m.has(t.toolCallId) && (await emitActionResult(createRuntimeToolResultFromStepResult(e)), v.add(t.toolCallId)); - break; - } - if (await _.flush(), await flushCurrentMessage(), isInlineAuthorizationToolResult(e)) { - v.add(t.toolCallId), y.push(e); - break; - } - await emitActionResult(createRuntimeToolResultFromStepResult(e)), v.add(t.toolCallId); - let n = e.output; - b.push({ - type: `tool-result`, - toolCallId: e.toolCallId, - toolName: e.toolName, - output: typeof n == `string` ? { - type: `text`, - value: n - } : { - type: `json`, - value: n ?? null - } - }); - break; - } - case `tool-error`: { - let n = t; - n.providerExecuted === !0 ? (await collectProviderToolCall(n), await _.flush(), await emitActionResult(createRuntimeToolResultFromValue({ - callId: n.toolCallId, - isError: !0, - output: toError(n.error), - toolName: n.toolName - }))) : m.has(n.toolCallId) && (await emitActionResult(createRuntimeToolResultFromValue({ - callId: n.toolCallId, - isError: !0, - output: toError(n.error), - toolName: n.toolName - })), v.add(n.toolCallId)); - break; - } - case `finish-step`: - d = normalizeAssistantStepFinishReason(t.finishReason), await _.flush(); - break; - case `error`: - f = toError(t.error); - break; - default: break; - } - if (await _.flush(), f !== void 0) throw f; - return l.trim().length > 0 && await a(createReasoningCompletedEvent({ - reasoning: l, - sequence: o.sequence, - stepIndex: o.stepIndex, - turnId: o.turnId - })), d !== `tool-calls` && hasEmptyDeliverySentinel(u) ? await a(createMessageCompletedEvent({ - finishReason: d, - message: null, - sequence: o.sequence, - stepIndex: o.stepIndex, - turnId: o.turnId - })) : u.trim().length > 0 && await a(createMessageCompletedEvent({ - finishReason: d, - message: u, - sequence: o.sequence, - stepIndex: o.stepIndex, - turnId: o.turnId - })), { - emittedActionCallIds: m, - handledInlineToolResultCallIds: v, - inlineAuthorizationResults: y, - inlineToolResultParts: b - }; -} -function isInlineAuthorizationToolResult(e) { - if (isPendingAuthorizationToolOutput(e.output)) return !0; - let t = contextStorage.getStore(); - if (t === void 0) return !1; - let n = readToolInterrupt(t, e.toolCallId); - return n !== void 0 && isAuthorizationSignal(n); -} -//#endregion -//#region node_modules/eve/dist/src/execution/session.js -function createCompactionConfig(e = {}) { - let t = e.thresholdPercent ?? .9, n = { - recentWindowSize: 10, - threshold: e.contextWindowTokens === void 0 ? 1e5 : Math.max(1, Math.floor(e.contextWindowTokens * t)) - }; - return e.lastKnownInputTokens === void 0 ? n : { - ...n, - lastKnownInputTokens: e.lastKnownInputTokens, - lastKnownPromptMessageCount: e.lastKnownPromptMessageCount - }; -} -function createSession(e) { - let { turnAgent: t } = e, n = createSessionToolDefinitions(t), r = { - agent: { - compactionModelReference: t.compactionModel, - modelReference: t.model, - reasoning: t.reasoning, - system: t.instructions.join(` - -`), - tools: n - }, - compaction: createCompactionConfig({ - contextWindowTokens: t.model.contextWindowTokens, - thresholdPercent: e.compactionOverrides?.thresholdPercent - }), - continuationToken: e.continuationToken, - history: [], - sessionId: e.sessionId - }; - return e.rootSessionId !== void 0 && (r.rootSessionId = e.rootSessionId), e.outputSchema !== void 0 && (r.outputSchema = e.outputSchema), r; -} -function refreshSessionFromTurnAgent(e) { - return { - ...e.session, - agent: { - compactionModelReference: e.turnAgent.compactionModel, - modelReference: e.turnAgent.model, - reasoning: e.turnAgent.reasoning, - system: e.turnAgent.instructions.join(` - -`), - tools: createSessionToolDefinitions(e.turnAgent) - }, - compaction: createCompactionConfig({ - contextWindowTokens: e.turnAgent.model.contextWindowTokens, - lastKnownInputTokens: e.session.compaction.lastKnownInputTokens, - lastKnownPromptMessageCount: e.session.compaction.lastKnownPromptMessageCount, - thresholdPercent: e.compactionOverrides?.thresholdPercent - }) - }; -} -function mintSubagentContinuationToken(e) { - return `subagent:${e ?? crypto.randomUUID()}`; -} -function projectToDurableSession(e) { - let t = { - agent: { system: e.agent.system }, - continuationToken: e.continuationToken, - history: e.history, - sessionId: e.sessionId - }; - return (e.compaction.lastKnownInputTokens !== void 0 || e.compaction.lastKnownPromptMessageCount !== void 0) && (t.compaction = { - lastKnownInputTokens: e.compaction.lastKnownInputTokens, - lastKnownPromptMessageCount: e.compaction.lastKnownPromptMessageCount - }), e.rootSessionId !== void 0 && (t.rootSessionId = e.rootSessionId), e.outputSchema !== void 0 && (t.outputSchema = e.outputSchema), e.sandboxState !== void 0 && (t.sandboxState = e.sandboxState), e.state !== void 0 && (t.state = e.state), t; -} -function hydrateDurableSession(e) { - let { durable: t, turnAgent: n } = e, r = createSessionToolDefinitions(n), i = { - agent: { - compactionModelReference: n.compactionModel, - modelReference: n.model, - reasoning: n.reasoning, - system: t.agent.system, - tools: r - }, - compaction: createCompactionConfig({ - contextWindowTokens: n.model.contextWindowTokens, - lastKnownInputTokens: t.compaction?.lastKnownInputTokens, - lastKnownPromptMessageCount: t.compaction?.lastKnownPromptMessageCount, - thresholdPercent: e.compactionOverrides?.thresholdPercent - }), - continuationToken: t.continuationToken, - history: t.history, - sessionId: t.sessionId - }; - return t.rootSessionId !== void 0 && (i.rootSessionId = t.rootSessionId), t.outputSchema !== void 0 && (i.outputSchema = t.outputSchema), t.sandboxState !== void 0 && (i.sandboxState = t.sandboxState), t.state !== void 0 && (i.state = t.state), i; -} -function createSessionToolDefinitions(e) { - return e.tools.map((e) => ({ - description: e.description ?? ``, - inputSchema: e.inputSchema, - name: e.name, - outputSchema: e.outputSchema - })); -} -//#endregion -//#region node_modules/eve/dist/src/execution/durable-session-migrations/chain.js -function runMigrationChain(e) { - if (typeof e.value != `object` || e.value === null) throw Error(`${e.label}: value has no numeric "version" field.`); - let t = e.value.version, n; - if (typeof t == `number`) n = e.value; - else if (!(`version` in e.value) && e.initialVersion !== void 0) n = { - ...e.value, - version: e.initialVersion - }; - else throw Error(`${e.label}: value has no numeric "version" field.`); - let r = e.initialVersion ?? 1; - if (!Number.isInteger(n.version) || n.version < r) throw Error(`${e.label}: version ${n.version} is not a positive integer.`); - if (n.version > e.targetVersion) throw Error(`${e.label}: encountered version ${n.version}, which is newer than the supported version ${e.targetVersion}. This usually indicates the wire was written by a newer eve deployment than the one reading it.`); - for (; n.version < e.targetVersion;) { - let t = e.migrations.find((e) => e.from === n.version); - if (!t) throw Error(`${e.label}: no migration registered for version ${n.version} → ${n.version + 1}.`); - if (t.to !== t.from + 1) throw Error(`${e.label}: migration ${t.from} → ${t.to} must step exactly one version at a time.`); - let r = t.migrate(n); - if (r.version !== t.to) throw Error(`${e.label}: migration ${t.from} → ${t.to} produced a value with version ${r.version}.`); - n = r; - } - return n; -} -//#endregion -//#region node_modules/eve/dist/src/execution/durable-session-migrations/snapshot.js -const snapshotMigrations = []; -function migrateDurableSessionSnapshot(e) { - return runMigrationChain({ - label: `durable session snapshot`, - migrations: snapshotMigrations, - targetVersion: 1, - value: e - }); -} -//#endregion -//#region node_modules/eve/dist/src/execution/durable-session-store.js -const EVE_SESSION_STREAM_NAMESPACE = `eve.session`; -const DURABLE_SESSION_READ_TIMEOUT_MS = 1e4; -function projectSessionState(t) { - return { - continuationToken: t.session.continuationToken, - emissionState: getHarnessEmissionState(t.session.state), - hasProxyInputRequests: hasProxyInputRequests(t.session.state), - sessionId: t.session.sessionId, - version: 1 - }; -} -async function readDurableSession(e) { - if (e.snapshot !== void 0) return migrateDurableSessionSnapshot(e.snapshot).session; - let t = X$9(e.sessionId).getReadable({ - namespace: EVE_SESSION_STREAM_NAMESPACE, - startIndex: -1 - }).getReader(), r = `eve durable session tail read failed`, i; - try { - let n = await Promise.race([t.read().then((e) => ({ - kind: `read`, - read: e - })), new Promise((e) => { - i = setTimeout(() => e({ kind: `timeout` }), DURABLE_SESSION_READ_TIMEOUT_MS); - })]); - if (n.kind === `timeout`) throw r = `eve durable session tail read timed out after ${DURABLE_SESSION_READ_TIMEOUT_MS}ms`, new DurableSessionReadTimeoutError(e); - if (n.read.done || n.read.value === void 0) throw r = `eve durable session tail read returned no snapshot`, Error(`No durable session snapshot found in stream "${EVE_SESSION_STREAM_NAMESPACE}" for run ${e.sessionId}.`); - return r = `eve durable session tail read complete`, migrateDurableSessionSnapshot(n.read.value).session; - } finally { - i !== void 0 && clearTimeout(i), await t.cancel(r).catch(() => {}), t.releaseLock(); - } -} -var DurableSessionReadTimeoutError = class extends Error { - constructor(e) { - super(`Timed out reading durable session snapshot from stream "${EVE_SESSION_STREAM_NAMESPACE}" for run ${e.sessionId} after ${DURABLE_SESSION_READ_TIMEOUT_MS}ms.`), this.name = `DurableSessionReadTimeoutError`; - } -}; -function createDurableSessionState(e) { - let n = { - session: projectToDurableSession(e.session), - version: 1 - }; - return { - ...projectSessionState({ session: e.session }), - snapshot: n - }; -} -//#endregion -//#region node_modules/eve/dist/src/execution/create-session-step.js -async function createSessionStep(e) { - let t = await getCompiledRuntimeAgentBundle({ - compiledArtifactsSource: e.compiledArtifactsSource, - nodeId: e.nodeId - }); - return { state: createDurableSessionState({ session: createSession({ - compactionOverrides: { thresholdPercent: t.resolvedAgent.config.compaction?.thresholdPercent }, - continuationToken: e.continuationToken, - outputSchema: e.outputSchema, - rootSessionId: e.rootSessionId, - sessionId: e.sessionId, - turnAgent: t.turnAgent - }) }) }; -} -s$7("step//eve@0.16.2//createSessionStep", createSessionStep); -//#endregion -//#region node_modules/eve/dist/src/execution/delegated-parent-notification.js -async function notifyDelegatedParentStep(e) { - if (e.result === void 0) return; - let t = (await deserializeContext(e.serializedContext)).get(ChannelKey); - if (t?.kind !== SUBAGENT_ADAPTER_KIND$1) return; - let n = String(t.state?.parentContinuationToken ?? ``); - n !== `` && await E$9(n, { - kind: `runtime-action-result`, - results: [e.result] - }); -} -s$7("step//eve@0.16.2//notifyDelegatedParentStep", notifyDelegatedParentStep); -//#endregion -//#region node_modules/eve/dist/src/channel/adapter-context.js -function buildAdapterContext(e, t) { - let n = { - ctx: t, - state: e.state ?? {}, - session: buildSessionHandle(t) - }; - return e.createAdapterContext ? e.createAdapterContext(n) : n; -} -//#endregion -//#region node_modules/eve/dist/src/execution/workflow-callback-url.js -function resolveVercelProductionCallbackBaseUrl() { - return process.env.VERCEL_ENV === `production` && process.env.VERCEL_PROJECT_PRODUCTION_URL ? `https://${process.env.VERCEL_PROJECT_PRODUCTION_URL}` : null; -} -function resolveWorkflowCallbackBaseUrl(e) { - let t = process.env.WORKFLOW_LOCAL_BASE_URL?.trim() || void 0; - return (resolveVercelProductionCallbackBaseUrl() ?? t ?? e).replace(/\/$/, ``); -} -function createWorkflowCallbackUrl(e, t) { - let n = new URL(t, e), r = process.env.VERCEL_AUTOMATION_BYPASS_SECRET?.trim(); - return r && n.searchParams.set(`x-vercel-protection-bypass`, r), n.toString(); -} -//#endregion -//#region node_modules/eve/dist/src/execution/subagent-invocation.js -function formatSubagentInvocation(e) { - return { message: [ - `You are the subagent "${e.name}".`, - `Description: ${e.description}`, - ``, - `The caller delegated the following task to you. Complete it and return the final result directly.`, - ``, - `Caller message:`, - e.message - ].join(` -`) }; -} -//#endregion -//#region node_modules/eve/dist/src/execution/remote-agent-dispatch.js -async function startRemoteAgentSession(n) { - let r = n.callbackToken ?? n.session.continuationToken; - if (!r) throw Error(`Cannot dispatch remote agent without a parent continuation token.`); - if (!n.callbackBaseUrl) throw Error(`Cannot dispatch remote agent without a callback base URL.`); - let i = await resolveRemoteAgentRequestHeaders(n.remote), a = await fetch(createRemoteAgentSessionUrl(n.remote), { - body: JSON.stringify({ - callback: { - callId: n.action.callId, - subagentName: n.action.remoteAgentName, - token: r, - url: createWorkflowCallbackUrl(n.callbackBaseUrl, createEveCallbackRoutePath(r)) - }, - message: formatRemoteAgentCallInputMessage(n.action), - mode: `task`, - outputSchema: n.action.input.outputSchema ?? n.remote.outputSchema - }), - headers: { - "content-type": `application/json`, - ...i - }, - method: `POST` - }); - if (!a.ok) throw Error(`Remote agent "${n.action.remoteAgentName}" create-session request failed with HTTP ${a.status}.`); - let o = a.headers.get(EVE_SESSION_ID_HEADER); - if (o !== null && o.length > 0) return o; - try { - let e = await a.json(); - if (typeof e.sessionId == `string` && e.sessionId.length > 0) return e.sessionId; - } catch {} - throw Error(`Remote agent "${n.action.remoteAgentName}" create-session response did not include a session id.`); -} -function resolveRemoteAgentForAction(e) { - let t = e.registry.get(e.nodeId)?.definition; - if (t?.kind !== `remote`) throw Error(`Missing remote agent "${e.remoteAgentName}" in runtime registry.`); - return t; -} -function createRemoteAgentSessionUrl(e) { - return new URL(e.path, `${trimTrailingSlash(e.url)}/`).toString(); -} -async function resolveRemoteAgentRequestHeaders(e) { - let t = {}; - return e.headers !== void 0 && Object.assign(t, typeof e.headers == `function` ? await e.headers() : e.headers), e.auth !== void 0 && Object.assign(t, (await e.auth()).headers), t; -} -function formatRemoteAgentCallInputMessage(e) { - let t = typeof e.input.message == `string` ? e.input.message : ``; - return formatSubagentInvocation({ - description: e.description, - message: t, - name: e.remoteAgentName - }).message; -} -function trimTrailingSlash(e) { - return e.endsWith(`/`) ? e.slice(0, -1) : e; -} -//#endregion -//#region node_modules/eve/dist/src/execution/subagent-tool.js -function buildSubagentRunInput(n) { - let { action: r, auth: i, batchEvent: a, capabilities: o, channelMetadata: s, initiatorAuth: c, session: l } = n, u = mintSubagentContinuationToken(`${l.sessionId}:${r.callId}`), d = l.rootSessionId ?? l.sessionId; - return { - childContinuationToken: u, - runInput: { - adapter: { - kind: SUBAGENT_ADAPTER_KIND$1, - state: { - callId: r.callId, - parentContinuationToken: n.parentContinuationToken ?? l.continuationToken, - parentSessionId: l.sessionId, - subagentName: r.subagentName, - ...r.subagentName === `agent` && l.sandboxState ? { - parentSandboxState: l.sandboxState, - sandboxSessionId: l.sessionId - } : {} - } - }, - auth: i, - capabilities: o, - channelMetadata: s, - continuationToken: u, - initiatorAuth: c, - input: { - message: formatSubagentCallInputMessage(r), - outputSchema: r.input.outputSchema - }, - mode: `task`, - parent: { - callId: r.callId, - rootSessionId: d, - sessionId: l.sessionId, - turn: { - id: a.turnId, - sequence: a.sequence - } - } - } - }; -} -function formatSubagentCallInputMessage(e) { - let { message: t } = e.input; - return formatSubagentInvocation({ - description: e.description, - message: t, - name: e.subagentName - }).message; -} -//#endregion -//#region node_modules/eve/dist/src/execution/dispatch-runtime-actions-step.js -const log$12 = createLogger(`execution.dispatch-runtime-actions`); -async function dispatchRuntimeActionsStep$1(e) { - let s = await readDurableSession(e.sessionState), u = getPendingRuntimeActionBatch(s.state); - if (u === void 0 || u.actions.length === 0) return { - results: [], - sessionState: e.sessionState - }; - let d = await deserializeContext(e.serializedContext), f = d.require(BundleKey), p = hydrateDurableSession({ - compactionOverrides: { thresholdPercent: f.resolvedAgent.config.compaction?.thresholdPercent }, - durable: s, - turnAgent: f.turnAgent - }), m = d.require(ChannelKey), h = d.get(AuthKey) ?? null, g = d.get(CapabilitiesKey), _ = d.get(ChannelInstrumentationKey), v = d.get(InitiatorAuthKey) ?? null, y = e.parentWritable.getWriter(), b = buildAdapterContext(m, d), x = p, S = []; - try { - for (let r of u.actions) { - let i, a, o, s; - switch (r.kind) { - case `subagent-call`: { - let t = createWorkflowRuntime({ - compiledArtifactsSource: f.compiledArtifactsSource, - nodeId: r.nodeId - }), { childContinuationToken: n, runInput: o } = buildSubagentRunInput({ - action: r, - auth: h, - batchEvent: u.event, - capabilities: g, - channelMetadata: _, - initiatorAuth: v, - parentContinuationToken: e.parentContinuationToken, - session: p - }), c = await t.run(o); - x = recordPendingSubagentChildToken({ - callId: r.callId, - childContinuationToken: n, - session: x - }), i = c.sessionId, a = r.name, s = r.subagentName; - break; - } - case `remote-agent-call`: { - let n; - try { - n = resolveRemoteAgentForAction({ - nodeId: r.nodeId, - remoteAgentName: r.remoteAgentName, - registry: f.subagentRegistry.subagentsByNodeId - }), i = await startRemoteAgentSession({ - action: r, - callbackBaseUrl: e.callbackBaseUrl, - callbackToken: e.parentContinuationToken, - remote: n, - session: p - }); - } catch (e) { - logError(log$12, `remote agent start failed`, e, { - remoteAgentName: r.remoteAgentName, - nodeId: r.nodeId, - callId: r.callId - }), S.push(createRemoteAgentStartFailureResult$1({ - action: r, - error: e - })); - continue; - } - a = r.name, o = { url: n.url }, s = r.remoteAgentName; - break; - } - default: throw Error(`Unsupported runtime action kind "${r.kind}" in workflow runtime.`); - } - let l = await callAdapterEventHandler(m, createSubagentCalledEvent({ - callId: r.callId, - childSessionId: i, - name: a, - remote: o, - sequence: u.event.sequence, - sessionId: p.sessionId, - toolName: s, - turnId: u.event.turnId, - workflowId: workflowEntryReference.workflowId - }), b); - await y.write(encodeMessageStreamEvent(timestampHandleMessageStreamEvent(l))); - } - } finally { - y.releaseLock(); - } - return { - results: S, - sessionState: x === p ? e.sessionState : createDurableSessionState({ session: x }) - }; -} -function createRemoteAgentStartFailureResult$1(e) { - return { - callId: e.action.callId, - isError: !0, - kind: `subagent-result`, - output: { - code: `REMOTE_AGENT_START_FAILED`, - message: toErrorMessage(e.error) - }, - subagentName: e.action.remoteAgentName - }; -} -s$7("step//eve@0.16.2//dispatchRuntimeActionsStep", dispatchRuntimeActionsStep$1); -//#endregion -//#region node_modules/eve/dist/src/execution/dispatch-runtime-actions-step.js -const log$11 = createLogger(`execution.dispatch-runtime-actions`); -async function dispatchRuntimeActionsStep(e) { - let s = await readDurableSession(e.sessionState), u = getPendingRuntimeActionBatch(s.state); - if (u === void 0 || u.actions.length === 0) return { - results: [], - sessionState: e.sessionState - }; - let d = await deserializeContext(e.serializedContext), f = d.require(BundleKey), p = hydrateDurableSession({ - compactionOverrides: { thresholdPercent: f.resolvedAgent.config.compaction?.thresholdPercent }, - durable: s, - turnAgent: f.turnAgent - }), m = d.require(ChannelKey), h = d.get(AuthKey) ?? null, g = d.get(CapabilitiesKey), _ = d.get(ChannelInstrumentationKey), v = d.get(InitiatorAuthKey) ?? null, y = e.parentWritable.getWriter(), b = buildAdapterContext(m, d), x = p, S = []; - try { - for (let r of u.actions) { - let i, a, o, s; - switch (r.kind) { - case `subagent-call`: { - let t = createWorkflowRuntime({ - compiledArtifactsSource: f.compiledArtifactsSource, - nodeId: r.nodeId - }), { childContinuationToken: n, runInput: o } = buildSubagentRunInput({ - action: r, - auth: h, - batchEvent: u.event, - capabilities: g, - channelMetadata: _, - initiatorAuth: v, - parentContinuationToken: e.parentContinuationToken, - session: p - }), c = await t.run(o); - x = recordPendingSubagentChildToken({ - callId: r.callId, - childContinuationToken: n, - session: x - }), i = c.sessionId, a = r.name, s = r.subagentName; - break; - } - case `remote-agent-call`: { - let n; - try { - n = resolveRemoteAgentForAction({ - nodeId: r.nodeId, - remoteAgentName: r.remoteAgentName, - registry: f.subagentRegistry.subagentsByNodeId - }), i = await startRemoteAgentSession({ - action: r, - callbackBaseUrl: e.callbackBaseUrl, - callbackToken: e.parentContinuationToken, - remote: n, - session: p - }); - } catch (e) { - logError(log$11, `remote agent start failed`, e, { - remoteAgentName: r.remoteAgentName, - nodeId: r.nodeId, - callId: r.callId - }), S.push(createRemoteAgentStartFailureResult({ - action: r, - error: e - })); - continue; - } - a = r.name, o = { url: n.url }, s = r.remoteAgentName; - break; - } - default: throw Error(`Unsupported runtime action kind "${r.kind}" in workflow runtime.`); - } - let l = await callAdapterEventHandler(m, createSubagentCalledEvent({ - callId: r.callId, - childSessionId: i, - name: a, - remote: o, - sequence: u.event.sequence, - sessionId: p.sessionId, - toolName: s, - turnId: u.event.turnId, - workflowId: workflowEntryReference.workflowId - }), b); - await y.write(encodeMessageStreamEvent(timestampHandleMessageStreamEvent(l))); - } - } finally { - y.releaseLock(); - } - return { - results: S, - sessionState: x === p ? e.sessionState : createDurableSessionState({ session: x }) - }; -} -function createRemoteAgentStartFailureResult(e) { - return { - callId: e.action.callId, - isError: !0, - kind: `subagent-result`, - output: { - code: `REMOTE_AGENT_START_FAILED`, - message: toErrorMessage(e.error) - }, - subagentName: e.action.remoteAgentName - }; -} -s$7("step//eve@0.16.2//dispatchRuntimeActionsStep", dispatchRuntimeActionsStep); -//#endregion -//#region node_modules/eve/dist/src/harness/workflow-runtime-action-state.js -const WORKFLOW_RUNTIME_ACTION_INTERRUPT_KIND = `eve.workflow-runtime-action`; -function isWorkflowRuntimeActionInterrupt(e) { - return isRecord$4(e) && isRecord$4(e.payload) && e.payload.kind === `eve.workflow-runtime-action`; -} -function buildRuntimeActionFromWorkflowInterrupt(e) { - let t = e.payload, n = t.runtimeAction, r = t.toolInput, i = t.toolName, a = sanitizeCallId(`${i}_${`interruptId` in e ? String(e.interruptId) : ``}`); - return n.kind === `remote-agent-call` ? { - callId: a, - description: ``, - input: r, - kind: `remote-agent-call`, - name: i, - nodeId: n.nodeId, - remoteAgentName: n.remoteAgentName ?? i - } : { - callId: a, - description: ``, - input: r, - kind: `subagent-call`, - name: i, - nodeId: n.nodeId, - subagentName: n.subagentName - }; -} -function getWorkflowRuntimeActionInterrupts(e) { - return e.continuation.ledger.flatMap((t) => t.kind !== `tool` || t.status !== `interrupted` || t.interruptPayload.kind !== `eve.workflow-runtime-action` ? [] : [{ - continuation: e.continuation, - input: t.inputJson === `` ? void 0 : JSON.parse(t.inputJson), - interruptId: t.interruptId, - outerToolCallId: e.continuation.outerToolCallId, - payload: t.interruptPayload, - toolCallId: t.toolCallId, - toolName: t.name, - type: `code-mode-interrupt` - }]); -} -function buildRuntimeActionsFromWorkflowInterrupt(e) { - return getWorkflowRuntimeActionInterrupts(e).map((e) => buildRuntimeActionFromWorkflowInterrupt(e)); -} -function getRuntimeActionKeysFromWorkflowInterrupt(t) { - return buildRuntimeActionsFromWorkflowInterrupt(t).map(getRuntimeActionRequestKey); -} -function sanitizeCallId(e) { - return e.replace(/[^a-zA-Z0-9_-]/g, `_`); -} -function isRecord$4(e) { - return typeof e == `object` && !!e && !Array.isArray(e); -} -//#endregion -//#region node_modules/eve/dist/src/harness/workflow-interrupt-state.js -const PENDING_KEY = `eve.harness.pendingWorkflowInterrupt`; -function getPendingWorkflowInterrupt(e) { - let n = e?.[PENDING_KEY]; - if (isRecord$3(n) && !(!isWorkflowInterruptShape(n.interrupt) || !Array.isArray(n.responseMessages))) return { - interrupt: n.interrupt, - responseMessages: n.responseMessages - }; -} -function setPendingWorkflowInterrupt(e) { - return { - ...e.session, - state: { - ...e.session.state, - [PENDING_KEY]: { - interrupt: e.interrupt, - responseMessages: e.responseMessages - } - } - }; -} -function clearPendingWorkflowInterrupt(e) { - if (e.state?.[PENDING_KEY] === void 0) return e; - let n = { ...e.state }; - return delete n[PENDING_KEY], { - ...e, - state: Object.keys(n).length > 0 ? n : void 0 - }; -} -function isWorkflowInterruptShape(t) { - return isRecord$3(t) && t.type === `code-mode-interrupt` && typeof t.interruptId == `string` && typeof t.outerToolCallId == `string` && isRecord$3(t.payload) && t.payload.kind === WORKFLOW_RUNTIME_ACTION_INTERRUPT_KIND && isRecord$3(t.continuation) && typeof t.continuation.outerToolCallId == `string`; -} -function isRecord$3(e) { - return typeof e == `object` && !!e && !Array.isArray(e); -} -//#endregion -//#region node_modules/eve/dist/src/execution/dispatch-workflow-runtime-actions-step.js -async function dispatchWorkflowRuntimeActionsStep(e) { - let t = await readDurableSession(e.sessionState), n = getPendingWorkflowInterrupt(t.state); - if (n === void 0) return { - results: [], - sessionState: e.sessionState - }; - let r = buildRuntimeActionsFromWorkflowInterrupt(n.interrupt); - if (r.length === 0) return { - results: [], - sessionState: e.sessionState - }; - let i = (await deserializeContext(e.serializedContext)).require(BundleKey), a = setPendingRuntimeActionBatch({ - actions: r, - event: { - sequence: 0, - stepIndex: 0, - turnId: `workflow-dispatch` - }, - responseMessages: [], - session: hydrateDurableSession({ - compactionOverrides: { thresholdPercent: i.resolvedAgent.config.compaction?.thresholdPercent }, - durable: t, - turnAgent: i.turnAgent - }) - }); - return dispatchRuntimeActionsStep({ - callbackBaseUrl: e.callbackBaseUrl, - parentContinuationToken: e.parentContinuationToken, - parentWritable: e.parentWritable, - serializedContext: e.serializedContext, - sessionState: createDurableSessionState({ session: a }) - }); -} -s$7("step//eve@0.16.2//dispatchWorkflowRuntimeActionsStep", dispatchWorkflowRuntimeActionsStep); -//#endregion -//#region node_modules/eve/dist/src/execution/forward-turn-delivery-step.js -async function forwardTurnDeliveryStep(e) { - await E$9(e.inboxToken, e.payload); -} -s$7("step//eve@0.16.2//forwardTurnDeliveryStep", forwardTurnDeliveryStep); -//#endregion -//#region node_modules/eve/dist/src/execution/session-callback-step.js -const log$10 = createLogger(`execution.session-callback`); -async function fireSessionCallbackStep(e) { - let n = e.serializedContext[`eve.sessionId`] ?? ``, i = e.serializedContext[SessionCallbackKey.name]; - if (i !== void 0) try { - let t = parseSerializedSessionCallback(i), r = e.status === `completed` ? { - callId: t.callId, - kind: `session.completed`, - output: e.output ?? ``, - sessionId: n, - subagentName: t.subagentName - } : { - callId: t.callId, - error: { - code: `SESSION_FAILED`, - message: toErrorMessage(e.error) - }, - kind: `session.failed`, - sessionId: n, - subagentName: t.subagentName - }, a = await fetch(t.url, { - body: JSON.stringify(r), - headers: { "content-type": `application/json` }, - method: `POST`, - redirect: `error`, - signal: AbortSignal.timeout(3e4) - }); - if (!a.ok) throw Error(`Session callback failed with HTTP ${a.status}.`); - } catch (e) { - throw log$10.error(`failed to post session callback`, { - error: e, - sessionId: n - }), e; - } -} -function parseSerializedSessionCallback(e) { - let t = parseSessionCallback(e); - if (!t.ok) throw Error(`Serialized session callback is invalid.`, { cause: t.cause }); - return t.callback; -} -s$7("step//eve@0.16.2//fireSessionCallbackStep", fireSessionCallbackStep); -//#endregion -//#region node_modules/eve/dist/src/execution/subagent-adapter.js -const log$9 = createLogger(`execution.subagent-adapter`); -const SUBAGENT_ADAPTER_KIND = `subagent`; -function isSubagentAdapterState(e) { - if (typeof e != `object` || !e) return !1; - let t = e; - return typeof t.callId == `string` && t.callId.length > 0 && typeof t.parentContinuationToken == `string` && t.parentContinuationToken.length > 0 && typeof t.parentSessionId == `string` && typeof t.subagentName == `string` && t.subagentName.length > 0; -} -const SUBAGENT_ADAPTER = { - kind: SUBAGENT_ADAPTER_KIND, - async "input.requested"(e, t) { - let i = t.state; - isSubagentAdapterState(i) && await forwardSubagentInputRequestStep({ - hookPayload: { - callId: i.callId, - childContinuationToken: t.ctx.require(ContinuationTokenKey), - childSessionId: t.ctx.require(SessionIdKey), - event: { - requests: e.requests, - sequence: e.sequence, - stepIndex: e.stepIndex, - turnId: e.turnId - }, - kind: `subagent-input-request`, - subagentName: i.subagentName - }, - parentContinuationToken: i.parentContinuationToken - }); - } -}; -async function forwardSubagentInputRequestStep(t) { - try { - await E$9(t.parentContinuationToken, t.hookPayload); - } catch (n) { - let r = createErrorId(); - throw log$9.warn(`failed to forward proxied HITL batch to parent`, { - callId: t.hookPayload.callId, - childContinuationToken: t.hookPayload.childContinuationToken, - childSessionId: t.hookPayload.childSessionId, - errorId: r, - parentContinuationToken: t.parentContinuationToken, - subagentName: t.hookPayload.subagentName, - error: n - }), n; - } -} -s$7("step//eve@0.16.2//forwardSubagentInputRequestStep", forwardSubagentInputRequestStep); -//#endregion -//#region node_modules/eve/dist/src/execution/turn-control-protocol.js -async function sendTurnControlStep(e) { - await E$9(e.controlToken, e.payload); -} -s$7("step//eve@0.16.2//sendTurnControlStep", sendTurnControlStep); -//#endregion -//#region node_modules/eve/dist/src/execution/durable-session-migrations/turn-workflow.js -function createTurnWorkflowInput(e) { - return { - capabilities: e.capabilities, - completionToken: e.completionToken, - driverCapabilities: { turnInbox: !0 }, - mode: e.mode, - stepInput: { - input: e.delivery, - parentWritable: e.parentWritable, - serializedContext: e.serializedContext, - sessionState: e.sessionState - }, - version: 1 - }; -} -//#endregion -//#region node_modules/eve/dist/src/harness/messages.js -function coalesceTurnInputs(e, t) { - let n = coalesceInputResponses({ - a: e.inputResponses, - b: t.inputResponses - }), r = coalesceMessage({ - a: e.message, - b: t.message - }), i = coalesceContext({ - a: e.context, - b: t.context - }), a = t.outputSchema ?? e.outputSchema, o = {}; - return n !== void 0 && (o.inputResponses = n), r !== void 0 && (o.message = r), i !== void 0 && (o.context = i), a !== void 0 && (o.outputSchema = a), o; -} -function resolveAssistantStepText(e, t) { - for (let t = e.length - 1; t >= 0; --t) { - let n = e[t]; - if (n?.role !== `assistant`) continue; - let r = extractMessageText(n); - if (r.trim().length > 0) return r; - } - return t !== void 0 && t.trim().length > 0 ? t : null; -} -function extractMessageText(e) { - return typeof e.content == `string` ? e.content : Array.isArray(e.content) ? e.content.flatMap((e) => typeof e == `string` ? [e] : `type` in e && e.type === `text` && typeof e.text == `string` ? [e.text] : []).join(``) : ``; -} -function coalesceInputResponses(e) { - let t = e.a ?? [], n = e.b ?? []; - if (!(t.length === 0 && n.length === 0)) return [...t, ...n]; -} -function coalesceContext(e) { - let t = e.a ?? [], n = e.b ?? []; - if (!(t.length === 0 && n.length === 0)) return [...t, ...n]; -} -function coalesceMessage(e) { - return e.a === void 0 ? e.b : e.b === void 0 ? e.a : typeof e.a == `string` && typeof e.b == `string` ? `${e.a}\n\n${e.b}` : [...toUserContentArray(e.a), ...toUserContentArray(e.b)]; -} -function toUserContentArray(e) { - return typeof e == `string` ? e.length > 0 ? [{ - type: `text`, - text: e - }] : [] : Array.isArray(e) ? [...e] : []; -} -//#endregion -//#region node_modules/eve/dist/src/context/hook-lifecycle.js -async function dispatchStreamEventHooks(e) { - let t = e.registry.streamEventsByType.get(e.event.type) ?? [], n = e.registry.streamEventsWildcard; - if (t.length === 0 && n.length === 0) return; - let r = buildHookContext(e.ctx); - for (let n of t) await n.handler(e.event, r); - for (let t of n) await t.handler(e.event, r); -} -function buildHookContext(i) { - let a = i.require(BundleKey), o = i.get(ChannelKey), s = i.get(ContinuationTokenKey), c = o === void 0 ? void 0 : getAdapterKind(o); - return { - ...buildCallbackContext(), - agent: { - name: a.resolvedAgent.config.name ?? `agent`, - nodeId: a.nodeId - }, - channel: { - kind: c, - continuationToken: s - } - }; -} -//#endregion -//#region node_modules/eve/dist/src/context/dynamic-resolve-context.js -function buildResolveContext(e, t) { - let n = e.get(SessionIdKey) ?? ``, r = e.get(AuthKey) ?? null, i = e.get(InitiatorAuthKey) ?? null, a = e.get(ChannelKey), o = e.get(ContinuationTokenKey), s = e.get(ChannelInstrumentationKey); - return { - session: { - id: n, - auth: { - current: r, - initiator: i - } - }, - channel: { - kind: a === void 0 ? void 0 : getAdapterKind(a), - continuationToken: o, - metadata: s?.metadata - }, - messages: t - }; -} -//#endregion -//#region node_modules/eve/dist/src/context/dynamic-instruction-lifecycle.js -const log$8 = createLogger(`dynamic-instructions`); -function lowerToSystemMessage(e) { - let t = e.markdown.trim(); - if (t.length !== 0) return { - role: `system`, - content: t - }; -} -function durableKeyForEvent$1(e) { - switch (e) { - case `session.started`: return SessionDynamicInstructionsKey; - case `turn.started`: return TurnDynamicInstructionsKey; - default: return; - } -} -function buildDynamicInstructionMessages(e) { - let r = e.get(SessionDynamicInstructionsKey) ?? {}, i = e.get(TurnDynamicInstructionsKey) ?? {}; - return [...Object.values(r).flat(), ...Object.values(i).flat()]; -} -async function dispatchDynamicInstructionEvent(e) { - let { ctx: t, resolvers: n, event: a, messages: o } = e; - if (!ALLOWED_DYNAMIC_INSTRUCTION_EVENTS.has(a.type)) return; - let s = n.filter((e) => e.eventNames.includes(a.type)); - if (s.length === 0) return; - let c = durableKeyForEvent$1(a.type); - if (c === void 0) return; - let l = buildResolveContext(t, o), u = await Promise.allSettled(s.map(async (e) => { - let t = e.events[a.type]; - if (t === void 0) return null; - let n = await t(a, l); - return n == null ? { - resolver: e, - message: void 0 - } : isBrandedInstructionsEntry(n) ? { - resolver: e, - message: lowerToSystemMessage(n) - } : (log$8.error(`Dynamic instructions resolver "${e.slug}" returned an unbranded value — wrap with defineInstructions().`), null); - })), d = { ...t.get(c) }; - for (let e of u) { - if (e.status === `rejected`) { - log$8.error(`Dynamic instructions resolver (${a.type}) threw — skipping.`, { error: toErrorMessage(e.reason) }); - continue; - } - if (e.value === null) continue; - let { resolver: t, message: n } = e.value; - n === void 0 ? delete d[t.slug] : d[t.slug] = [n]; - } - t.set(c, d); -} -//#endregion -//#region node_modules/eve/dist/src/context/dynamic-skill-lifecycle.js -const log$7 = createLogger(`dynamic-skills`); -function qualifyDynamicSkillNames(e, t, n) { - let r = Object.keys(n), i = []; - if (r.length === 0) return i; - if (t) return i.push({ - name: e, - entryKey: r[0], - entry: n[r[0]] - }), i; - for (let e of r) i.push({ - name: e, - entryKey: e, - entry: n[e] - }); - return i; -} -function formatDynamicSkillAnnouncement(e) { - return formatAvailableSkillsSection(Object.values(e).flat()) ?? ``; -} -const PendingSkillAnnouncementKey = new ContextKey(`eve.pendingSkillAnnouncement`); -async function dispatchDynamicSkillEvent(e) { - let { ctx: a, resolvers: o, event: s, messages: c } = e; - if (a.get(PendingSkillAnnouncementKey) === void 0) { - let e = a.get(DynamicSkillManifestKey); - e !== void 0 && Object.keys(e).length > 0 && a.setVirtualContext(PendingSkillAnnouncementKey, formatDynamicSkillAnnouncement(e)); - } - if (!ALLOWED_DYNAMIC_SKILL_EVENTS.has(s.type)) return; - let l = o.filter((e) => e.eventNames.includes(s.type)); - if (l.length === 0) return; - let u = buildResolveContext(a, c), d = a.get(DynamicSkillManifestKey) ?? {}, f = [], p = await Promise.allSettled(l.map(async (e) => { - let t = e.events[s.type]; - if (t === void 0) return null; - let n = await t(s, u); - if (n == null) return { - resolver: e, - named: [] - }; - let r, i; - return isBrandedSkillEntry(n) ? (r = { _single: n }, i = !0) : (r = n, i = !1), { - resolver: e, - named: qualifyDynamicSkillNames(e.slug, i, r) - }; - })); - for (let e of p) { - if (e.status === `rejected`) { - log$7.error(`Dynamic skill resolver (${s.type}) threw — skipping.`, { error: toErrorMessage(e.reason) }); - continue; - } - e.value !== null && f.push({ - resolver: e.value.resolver, - skills: e.value.named.map(({ name: e, entry: t }) => normalizeSkillPackage({ - ...t, - name: e - })) - }); - } - if (f.length === 0) return; - let m = { ...d }; - for (let { resolver: e, skills: t } of f) t.length === 0 ? delete m[e.slug] : m[e.slug] = t.map((e) => ({ - description: e.description, - name: e.name - })); - let h = /* @__PURE__ */ new Map(); - for (let [e, t] of Object.entries(m)) for (let { name: n } of t) { - let t = h.get(n); - if (t !== void 0) throw Error(`Dynamic skill "${n}" from resolver "${e}" collides with dynamic resolver "${t}". Namespace the map key manually, e.g. "${e}__${n}".`); - h.set(n, e); - } - let g = await a.require(SandboxKey).get(); - if (g !== null) for (let { skills: e } of f) for (let t of e) await writeSkillPackageToSandbox({ - sandbox: g, - skill: t - }); - a.set(DynamicSkillManifestKey, m), a.setVirtualContext(PendingSkillAnnouncementKey, formatDynamicSkillAnnouncement(m)); -} -//#endregion -//#region node_modules/eve/dist/src/context/dynamic-tool-lifecycle.js -const log$6 = createLogger(`dynamic-tools`); -function toHarnessToolDefinition(e, t) { - return { - description: t.description, - execute: (e) => t.execute(e, buildCallbackContext()), - inputSchema: convertInputSchema(t.inputSchema), - name: e, - approval: t.approval, - outputSchema: convertOptionalOutputSchema(t.outputSchema), - ...t.toModelOutput === void 0 ? {} : { toModelOutput: t.toModelOutput } - }; -} -function convertInputSchema(e) { - return typeof e == `object` && e && `~standard` in e ? zodSchema(e) : jsonSchema(e); -} -function convertOptionalOutputSchema(e) { - if (e !== void 0) return typeof e == `object` && e && `~standard` in e ? zodSchema(e) : jsonSchema(e); -} -function qualifyDynamicToolNames(e, t, n) { - let r = Object.keys(n), i = []; - if (r.length === 0) return i; - if (t) return i.push({ - name: e, - entryKey: r[0], - entry: n[r[0]] - }), i; - for (let e of r) i.push({ - name: e, - entryKey: e, - entry: n[e] - }); - return i; -} -function getStepRegistry() { - let e = Symbol.for(`@workflow/core//registeredSteps`), t = globalThis, n = t[e]; - return n === void 0 && (n = /* @__PURE__ */ new Map(), t[e] = n), n; -} -function registerStepFunction(e, t) { - getStepRegistry().set(e, t); -} -function safeSerialize(e) { - try { - return JSON.parse(JSON.stringify(e)); - } catch { - return {}; - } -} -function durableKeyForEvent(e) { - switch (e) { - case `session.started`: return SessionDynamicToolMetadataKey; - case `turn.started`: return TurnDynamicToolMetadataKey; - default: return; - } -} -async function resolveToolsFromEvent(e, t, n, r) { - let a = await Promise.allSettled(t.map(async (t) => { - let i = t.events[n.type]; - if (i === void 0) return null; - let a = await i(n, buildResolveContext(e, r)); - if (a == null) return null; - let s, c; - return isBrandedToolEntry(a) ? (s = { _single: a }, c = !0) : (s = a, c = !1), { - resolver: t, - entries: s, - isSingle: c - }; - })), s = [], c = [], l = /* @__PURE__ */ new Map(); - for (let e of a) { - if (e.status === `rejected`) { - log$6.error(`Dynamic tool resolver (${n.type}) threw — skipping.`, { error: toErrorMessage(e.reason) }); - continue; - } - if (e.value === null) continue; - let { resolver: t, entries: r, isSingle: a } = e.value, o = qualifyDynamicToolNames(t.slug, a, r); - for (let { name: e, entryKey: r, entry: i } of o) { - let a = l.get(e); - if (a !== void 0 && a !== t.slug) throw Error(`Dynamic tool "${e}" from resolver "${t.slug}" collides with dynamic resolver "${a}". Namespace the map key manually, e.g. "${t.slug}__${e}".`); - if (l.set(e, t.slug), c.push(toHarnessToolDefinition(e, i)), n.type === `step.started`) continue; - let o = `__executeStepFn` in i ? i.__executeStepFn : void 0, u = `__closureVars` in i ? i.__closureVars : void 0, f = o?.stepId, p = u === void 0 ? void 0 : safeSerialize(u); - if (f === void 0) { - let e = `eve:framework-dynamic:${t.slug}:${r}`, n = i.execute.bind(i); - registerStepFunction(e, (e, t, r) => n(t, r)), f = e, p = {}; - } - let m; - if (i.approval !== void 0) { - m = `eve:dynamic-tool-approval:${t.slug}:${r}`; - let e = i.approval.bind(i); - registerStepFunction(m, (t, n) => e(n)); - } - s.push({ - name: e, - description: i.description, - inputSchema: normalizeJsonSchemaDefinition(i.inputSchema), - outputSchema: i.outputSchema === void 0 ? void 0 : normalizeJsonSchemaDefinition(i.outputSchema, `output`), - resolverSlug: t.slug, - entryKey: r, - executeStepFnName: f, - approvalStepFnName: m, - closureVars: p - }); - } - } - return { - metadata: s, - liveTools: c - }; -} -async function dispatchDynamicToolEvent(e) { - let { ctx: n, resolvers: r, event: i, messages: o } = e; - if (!ALLOWED_DYNAMIC_TOOL_EVENTS.has(i.type)) return; - let s = r.filter((e) => e.eventNames.includes(i.type)); - if (s.length === 0) return; - let { metadata: c, liveTools: l } = await resolveToolsFromEvent(n, s, i, o); - if (i.type === `step.started`) { - n.setVirtualContext(LiveStepToolsKey, l); - return; - } - let u = durableKeyForEvent(i.type); - if (u === void 0) return; - let d = new Set(s.map((e) => e.slug)), f = (n.get(u) ?? []).filter((e) => !d.has(e.resolverSlug)); - n.set(u, [...f, ...c]); -} -//#endregion -//#region node_modules/eve/dist/src/compiled/_chunks/workflow/dist-D7CzPkf8.js -var u$6; -const d$6 = Object.freeze({ status: `aborted` }); -function f$5(e, t, n) { - function r(n, r) { - if (n._zod || Object.defineProperty(n, "_zod", { - value: { - def: r, - constr: o, - traits: /* @__PURE__ */ new Set() - }, - enumerable: !1 - }), n._zod.traits.has(e)) return; - n._zod.traits.add(e), t(n, r); - let i = o.prototype, a = Object.keys(i); - for (let e = 0; e < a.length; e++) { - let t = a[e]; - t in n || (n[t] = i[t].bind(n)); - } - } - let i = n?.Parent ?? Object; - class a extends i {} - Object.defineProperty(a, "name", { value: e }); - function o(e) { - var t; - let i = n?.Parent ? new a() : this; - r(i, e), (t = i._zod).deferred ?? (t.deferred = []); - for (let e of i._zod.deferred) e(); - return i; - } - return Object.defineProperty(o, "init", { value: r }), Object.defineProperty(o, Symbol.hasInstance, { value: (t) => n?.Parent && t instanceof n.Parent ? !0 : t?._zod?.traits?.has(e) }), Object.defineProperty(o, "name", { value: e }), o; -} -var p$7 = class extends Error { - constructor() { - super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`); - } -}; -var ee$4 = class extends Error { - constructor(e) { - super(`Encountered unidirectional transform during encode: ${e}`), this.name = `ZodEncodeError`; - } -}; -(u$6 = globalThis).__zod_globalConfig ?? (u$6.__zod_globalConfig = {}); -const te$4 = globalThis.__zod_globalConfig; -function m$5(e) { - return e && Object.assign(te$4, e), te$4; -} -function ne$4(e) { - let t = Object.values(e).filter((e) => typeof e == `number`); - return Object.entries(e).filter(([e, n]) => t.indexOf(+e) === -1).map(([e, t]) => t); -} -function re$4(e, t) { - return typeof t == `bigint` ? t.toString() : t; -} -function ie$4(e) { - return { get value() { - { - let t = e(); - return Object.defineProperty(this, "value", { value: t }), t; - } - } }; -} -function ae$5(e) { - return e == null; -} -function oe$5(e) { - let t = +!!e.startsWith(`^`), n = e.endsWith(`$`) ? e.length - 1 : e.length; - return e.slice(t, n); -} -function se$6(e, t) { - let n = e / t, r = Math.round(n), i = 2 ** -52 * Math.max(Math.abs(n), 1); - return Math.abs(n - r) < i ? 0 : n - r; -} -const ce$6 = Symbol(`evaluating`); -function h$5(e, t, n) { - let r; - Object.defineProperty(e, t, { - get() { - if (r !== ce$6) return r === void 0 && (r = ce$6, r = n()), r; - }, - set(n) { - Object.defineProperty(e, t, { value: n }); - }, - configurable: !0 - }); -} -function le$6(e, t, n) { - Object.defineProperty(e, t, { - value: n, - writable: !0, - enumerable: !0, - configurable: !0 - }); -} -function g$5(...e) { - let t = {}; - for (let n of e) Object.assign(t, Object.getOwnPropertyDescriptors(n)); - return Object.defineProperties({}, t); -} -function ue$6(e) { - return JSON.stringify(e); -} -function de$6(e) { - return e.toLowerCase().trim().replace(/[^\w\s-]/g, ``).replace(/[\s_-]+/g, `-`).replace(/^-+|-+$/g, ``); -} -const fe$6 = `captureStackTrace` in Error ? Error.captureStackTrace : (...e) => {}; -function pe$6(e) { - return typeof e == `object` && !!e && !Array.isArray(e); -} -const me$6 = ie$4(() => { - if (te$4.jitless || typeof navigator < `u` && navigator?.userAgent?.includes(`Cloudflare`)) return !1; - try { - return Function(``), !0; - } catch { - return !1; - } -}); -function he$6(e) { - if (pe$6(e) === !1) return !1; - let t = e.constructor; - if (t === void 0 || typeof t != `function`) return !0; - let n = t.prototype; - return !(pe$6(n) === !1 || Object.prototype.hasOwnProperty.call(n, `isPrototypeOf`) === !1); -} -function ge$6(e) { - return he$6(e) ? { ...e } : Array.isArray(e) ? [...e] : e instanceof Map ? new Map(e) : e instanceof Set ? new Set(e) : e; -} -const _e$6 = /* @__PURE__ */ new Set([ - `string`, - `number`, - `symbol` -]); -function ve$6(e) { - return e.replace(/[.*+?^${}()|[\]\\]/g, `\\$&`); -} -function _$4(e, t, n) { - let r = new e._zod.constr(t ?? e._zod.def); - return (!t || n?.parent) && (r._zod.parent = e), r; -} -function v$5(e) { - let t = e; - if (!t) return {}; - if (typeof t == `string`) return { error: () => t }; - if (t?.message !== void 0) { - if (t?.error !== void 0) throw Error("Cannot specify both `message` and `error` params"); - t.error = t.message; - } - return delete t.message, typeof t.error == `string` ? { - ...t, - error: () => t.error - } : t; -} -function ye$6(e) { - return Object.keys(e).filter((t) => e[t]._zod.optin === `optional` && e[t]._zod.optout === `optional`); -} -const be$6 = { - safeint: [-(2 ** 53 - 1), 2 ** 53 - 1], - int32: [-2147483648, 2147483647], - uint32: [0, 4294967295], - float32: [-34028234663852886e22, 34028234663852886e22], - float64: [-Number.MAX_VALUE, Number.MAX_VALUE] -}; -function xe$6(e, t) { - let n = e._zod.def, r = n.checks; - if (r && r.length > 0) throw Error(`.pick() cannot be used on object schemas containing refinements`); - return _$4(e, g$5(e._zod.def, { - get shape() { - let e = {}; - for (let r in t) { - if (!(r in n.shape)) throw Error(`Unrecognized key: "${r}"`); - t[r] && (e[r] = n.shape[r]); - } - return le$6(this, `shape`, e), e; - }, - checks: [] - })); -} -function Se$6(e, t) { - let n = e._zod.def, r = n.checks; - if (r && r.length > 0) throw Error(`.omit() cannot be used on object schemas containing refinements`); - return _$4(e, g$5(e._zod.def, { - get shape() { - let r = { ...e._zod.def.shape }; - for (let e in t) { - if (!(e in n.shape)) throw Error(`Unrecognized key: "${e}"`); - t[e] && delete r[e]; - } - return le$6(this, `shape`, r), r; - }, - checks: [] - })); -} -function Ce$6(e, t) { - if (!he$6(t)) throw Error(`Invalid input to extend: expected a plain object`); - let n = e._zod.def.checks; - if (n && n.length > 0) { - let n = e._zod.def.shape; - for (let e in t) if (Object.getOwnPropertyDescriptor(n, e) !== void 0) throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead."); - } - return _$4(e, g$5(e._zod.def, { get shape() { - let n = { - ...e._zod.def.shape, - ...t - }; - return le$6(this, `shape`, n), n; - } })); -} -function we$6(e, t) { - if (!he$6(t)) throw Error(`Invalid input to safeExtend: expected a plain object`); - return _$4(e, g$5(e._zod.def, { get shape() { - let n = { - ...e._zod.def.shape, - ...t - }; - return le$6(this, `shape`, n), n; - } })); -} -function Te$6(e, t) { - if (e._zod.def.checks?.length) throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`); - return _$4(e, g$5(e._zod.def, { - get shape() { - let n = { - ...e._zod.def.shape, - ...t._zod.def.shape - }; - return le$6(this, `shape`, n), n; - }, - get catchall() { - return t._zod.def.catchall; - }, - checks: t._zod.def.checks ?? [] - })); -} -function Ee$6(e, t, n) { - let r = t._zod.def.checks; - if (r && r.length > 0) throw Error(`.partial() cannot be used on object schemas containing refinements`); - return _$4(t, g$5(t._zod.def, { - get shape() { - let r = t._zod.def.shape, i = { ...r }; - if (n) for (let t in n) { - if (!(t in r)) throw Error(`Unrecognized key: "${t}"`); - n[t] && (i[t] = e ? new e({ - type: `optional`, - innerType: r[t] - }) : r[t]); - } - else for (let t in r) i[t] = e ? new e({ - type: `optional`, - innerType: r[t] - }) : r[t]; - return le$6(this, `shape`, i), i; - }, - checks: [] - })); -} -function De$6(e, t, n) { - return _$4(t, g$5(t._zod.def, { get shape() { - let r = t._zod.def.shape, i = { ...r }; - if (n) for (let t in n) { - if (!(t in i)) throw Error(`Unrecognized key: "${t}"`); - n[t] && (i[t] = new e({ - type: `nonoptional`, - innerType: r[t] - })); - } - else for (let t in r) i[t] = new e({ - type: `nonoptional`, - innerType: r[t] - }); - return le$6(this, `shape`, i), i; - } })); -} -function Oe$6(e, t = 0) { - if (e.aborted === !0) return !0; - for (let n = t; n < e.issues.length; n++) if (e.issues[n]?.continue !== !0) return !0; - return !1; -} -function ke$6(e, t = 0) { - if (e.aborted === !0) return !0; - for (let n = t; n < e.issues.length; n++) if (e.issues[n]?.continue === !1) return !0; - return !1; -} -function y$3(e, t) { - return t.map((t) => { - var n; - return (n = t).path ?? (n.path = []), t.path.unshift(e), t; - }); -} -function Ae$6(e) { - return typeof e == `string` ? e : e?.message; -} -function b$5(e, t, n) { - let r = e.message ? e.message : Ae$6(e.inst?._zod.def?.error?.(e)) ?? Ae$6(t?.error?.(e)) ?? Ae$6(n.customError?.(e)) ?? Ae$6(n.localeError?.(e)) ?? `Invalid input`, { inst: i, continue: a, input: o, ...s } = e; - return s.path ??= [], s.message = r, t?.reportInput && (s.input = o), s; -} -function je$6(e) { - return Array.isArray(e) ? `array` : typeof e == `string` ? `string` : `unknown`; -} -function Me$6(...e) { - let [t, n, r] = e; - return typeof t == `string` ? { - message: t, - code: `custom`, - input: n, - inst: r - } : { ...t }; -} -const Ne$6 = (e, t) => { - e.name = `$ZodError`, Object.defineProperty(e, "_zod", { - value: e._zod, - enumerable: !1 - }), Object.defineProperty(e, "issues", { - value: t, - enumerable: !1 - }), e.message = JSON.stringify(t, re$4, 2), Object.defineProperty(e, "toString", { - value: () => e.message, - enumerable: !1 - }); -}; -const Pe$6 = f$5(`$ZodError`, Ne$6); -const Fe$6 = f$5(`$ZodError`, Ne$6, { Parent: Error }); -function Ie$6(e, t = (e) => e.message) { - let n = {}, r = []; - for (let i of e.issues) i.path.length > 0 ? (n[i.path[0]] = n[i.path[0]] || [], n[i.path[0]].push(t(i))) : r.push(t(i)); - return { - formErrors: r, - fieldErrors: n - }; -} -function Le$6(e, t = (e) => e.message) { - let n = { _errors: [] }, r = (e, i = []) => { - for (let a of e.issues) if (a.code === `invalid_union` && a.errors.length) a.errors.map((e) => r({ issues: e }, [...i, ...a.path])); - else if (a.code === `invalid_key`) r({ issues: a.issues }, [...i, ...a.path]); - else if (a.code === `invalid_element`) r({ issues: a.issues }, [...i, ...a.path]); - else { - let e = [...i, ...a.path]; - if (e.length === 0) n._errors.push(t(a)); - else { - let r = n, i = 0; - for (; i < e.length;) { - let n = e[i]; - i === e.length - 1 ? (r[n] = r[n] || { _errors: [] }, r[n]._errors.push(t(a))) : r[n] = r[n] || { _errors: [] }, r = r[n], i++; - } - } - } - }; - return r(e), n; -} -const Re$6 = (e) => (t, n, r, i) => { - let a = r ? { - ...r, - async: !1 - } : { async: !1 }, o = t._zod.run({ - value: n, - issues: [] - }, a); - if (o instanceof Promise) throw new p$7(); - if (o.issues.length) { - let t = new ((i?.Err) ?? e)(o.issues.map((e) => b$5(e, a, m$5()))); - throw fe$6(t, i?.callee), t; - } - return o.value; -}; -const ze$6 = (e) => async (t, n, r, i) => { - let a = r ? { - ...r, - async: !0 - } : { async: !0 }, o = t._zod.run({ - value: n, - issues: [] - }, a); - if (o instanceof Promise && (o = await o), o.issues.length) { - let t = new ((i?.Err) ?? e)(o.issues.map((e) => b$5(e, a, m$5()))); - throw fe$6(t, i?.callee), t; - } - return o.value; -}; -const Be$6 = (e) => (t, n, r) => { - let i = r ? { - ...r, - async: !1 - } : { async: !1 }, a = t._zod.run({ - value: n, - issues: [] - }, i); - if (a instanceof Promise) throw new p$7(); - return a.issues.length ? { - success: !1, - error: new (e ?? Pe$6)(a.issues.map((e) => b$5(e, i, m$5()))) - } : { - success: !0, - data: a.value - }; -}; -const Ve$6 = Be$6(Fe$6); -const He$6 = (e) => async (t, n, r) => { - let i = r ? { - ...r, - async: !0 - } : { async: !0 }, a = t._zod.run({ - value: n, - issues: [] - }, i); - return a instanceof Promise && (a = await a), a.issues.length ? { - success: !1, - error: new e(a.issues.map((e) => b$5(e, i, m$5()))) - } : { - success: !0, - data: a.value - }; -}; -const Ue$6 = He$6(Fe$6); -const We$6 = (e) => (t, n, r) => { - let i = r ? { - ...r, - direction: `backward` - } : { direction: `backward` }; - return Re$6(e)(t, n, i); -}; -const Ge$6 = (e) => (t, n, r) => Re$6(e)(t, n, r); -const Ke$6 = (e) => async (t, n, r) => { - let i = r ? { - ...r, - direction: `backward` - } : { direction: `backward` }; - return ze$6(e)(t, n, i); -}; -const qe$6 = (e) => async (t, n, r) => ze$6(e)(t, n, r); -const Je$6 = (e) => (t, n, r) => { - let i = r ? { - ...r, - direction: `backward` - } : { direction: `backward` }; - return Be$6(e)(t, n, i); -}; -const Ye$6 = (e) => (t, n, r) => Be$6(e)(t, n, r); -const Xe$6 = (e) => async (t, n, r) => { - let i = r ? { - ...r, - direction: `backward` - } : { direction: `backward` }; - return He$6(e)(t, n, i); -}; -const Ze$6 = (e) => async (t, n, r) => He$6(e)(t, n, r); -const Qe$6 = /^[cC][0-9a-z]{6,}$/; -const $e$6 = /^[0-9a-z]+$/; -const et$6 = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/; -const tt$6 = /^[0-9a-vA-V]{20}$/; -const nt$6 = /^[A-Za-z0-9]{27}$/; -const rt$6 = /^[a-zA-Z0-9_-]{21}$/; -const it$6 = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/; -const at$6 = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/; -const ot$6 = (e) => e ? RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`) : /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/; -const st$6 = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/; -function ct$6() { - return RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`, `u`); -} -const lt$6 = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/; -const ut$6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/; -const dt$6 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/; -const ft$6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/; -const pt$6 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/; -const mt$6 = /^[A-Za-z0-9_-]*$/; -const ht$6 = /^https?$/; -const gt$6 = /^\+[1-9]\d{6,14}$/; -const _t$6 = `(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`; -const vt$6 = RegExp(`^${_t$6}$`); -function yt$6(e) { - let t = `(?:[01]\\d|2[0-3]):[0-5]\\d`; - return typeof e.precision == `number` ? e.precision === -1 ? `${t}` : e.precision === 0 ? `${t}:[0-5]\\d` : `${t}:[0-5]\\d\\.\\d{${e.precision}}` : `${t}(?::[0-5]\\d(?:\\.\\d+)?)?`; -} -function bt$6(e) { - return RegExp(`^${yt$6(e)}$`); -} -function xt$6(e) { - let t = yt$6({ precision: e.precision }), n = [`Z`]; - e.local && n.push(``), e.offset && n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`); - let r = `${t}(?:${n.join(`|`)})`; - return RegExp(`^${_t$6}T(?:${r})$`); -} -const St$6 = (e) => { - let t = e ? `[\\s\\S]{${e?.minimum ?? 0},${e?.maximum ?? ``}}` : `[\\s\\S]*`; - return RegExp(`^${t}$`); -}; -const Ct$6 = /^-?\d+$/; -const wt$6 = /^-?\d+(?:\.\d+)?$/; -const Tt$6 = /^(?:true|false)$/i; -const Et$6 = /^null$/i; -const Dt$6 = /^[^A-Z]*$/; -const Ot$6 = /^[^a-z]*$/; -const x$5 = f$5(`$ZodCheck`, (e, t) => { - var n; - e._zod ??= {}, e._zod.def = t, (n = e._zod).onattach ?? (n.onattach = []); -}); -const kt$6 = { - number: `number`, - bigint: `bigint`, - object: `date` -}; -const At$6 = f$5(`$ZodCheckLessThan`, (e, t) => { - x$5.init(e, t); - let n = kt$6[typeof t.value]; - e._zod.onattach.push((e) => { - let n = e._zod.bag, r = (t.inclusive ? n.maximum : n.exclusiveMaximum) ?? Infinity; - t.value < r && (t.inclusive ? n.maximum = t.value : n.exclusiveMaximum = t.value); - }), e._zod.check = (r) => { - (t.inclusive ? r.value <= t.value : r.value < t.value) || r.issues.push({ - origin: n, - code: `too_big`, - maximum: typeof t.value == `object` ? t.value.getTime() : t.value, - input: r.value, - inclusive: t.inclusive, - inst: e, - continue: !t.abort - }); - }; -}); -const jt$6 = f$5(`$ZodCheckGreaterThan`, (e, t) => { - x$5.init(e, t); - let n = kt$6[typeof t.value]; - e._zod.onattach.push((e) => { - let n = e._zod.bag, r = (t.inclusive ? n.minimum : n.exclusiveMinimum) ?? -Infinity; - t.value > r && (t.inclusive ? n.minimum = t.value : n.exclusiveMinimum = t.value); - }), e._zod.check = (r) => { - (t.inclusive ? r.value >= t.value : r.value > t.value) || r.issues.push({ - origin: n, - code: `too_small`, - minimum: typeof t.value == `object` ? t.value.getTime() : t.value, - input: r.value, - inclusive: t.inclusive, - inst: e, - continue: !t.abort - }); - }; -}); -const Mt$6 = f$5(`$ZodCheckMultipleOf`, (e, t) => { - x$5.init(e, t), e._zod.onattach.push((e) => { - var n; - (n = e._zod.bag).multipleOf ?? (n.multipleOf = t.value); - }), e._zod.check = (n) => { - if (typeof n.value != typeof t.value) throw Error(`Cannot mix number and bigint in multiple_of check.`); - (typeof n.value == `bigint` ? n.value % t.value === BigInt(0) : se$6(n.value, t.value) === 0) || n.issues.push({ - origin: typeof n.value, - code: `not_multiple_of`, - divisor: t.value, - input: n.value, - inst: e, - continue: !t.abort - }); - }; -}); -const Nt$5 = f$5(`$ZodCheckNumberFormat`, (e, t) => { - x$5.init(e, t), t.format = t.format || `float64`; - let n = t.format?.includes(`int`), r = n ? `int` : `number`, [i, a] = be$6[t.format]; - e._zod.onattach.push((e) => { - let r = e._zod.bag; - r.format = t.format, r.minimum = i, r.maximum = a, n && (r.pattern = Ct$6); - }), e._zod.check = (o) => { - let s = o.value; - if (n) { - if (!Number.isInteger(s)) { - o.issues.push({ - expected: r, - format: t.format, - code: `invalid_type`, - continue: !1, - input: s, - inst: e - }); - return; - } - if (!Number.isSafeInteger(s)) { - s > 0 ? o.issues.push({ - input: s, - code: `too_big`, - maximum: 2 ** 53 - 1, - note: `Integers must be within the safe integer range.`, - inst: e, - origin: r, - inclusive: !0, - continue: !t.abort - }) : o.issues.push({ - input: s, - code: `too_small`, - minimum: -(2 ** 53 - 1), - note: `Integers must be within the safe integer range.`, - inst: e, - origin: r, - inclusive: !0, - continue: !t.abort - }); - return; - } - } - s < i && o.issues.push({ - origin: `number`, - input: s, - code: `too_small`, - minimum: i, - inclusive: !0, - inst: e, - continue: !t.abort - }), s > a && o.issues.push({ - origin: `number`, - input: s, - code: `too_big`, - maximum: a, - inclusive: !0, - inst: e, - continue: !t.abort - }); - }; -}); -const Pt$5 = f$5(`$ZodCheckMaxLength`, (e, t) => { - var n; - x$5.init(e, t), (n = e._zod.def).when ?? (n.when = (e) => { - let t = e.value; - return !ae$5(t) && t.length !== void 0; - }), e._zod.onattach.push((e) => { - let n = e._zod.bag.maximum ?? Infinity; - t.maximum < n && (e._zod.bag.maximum = t.maximum); - }), e._zod.check = (n) => { - let r = n.value; - if (r.length <= t.maximum) return; - let i = je$6(r); - n.issues.push({ - origin: i, - code: `too_big`, - maximum: t.maximum, - inclusive: !0, - input: r, - inst: e, - continue: !t.abort - }); - }; -}); -const Ft$5 = f$5(`$ZodCheckMinLength`, (e, t) => { - var n; - x$5.init(e, t), (n = e._zod.def).when ?? (n.when = (e) => { - let t = e.value; - return !ae$5(t) && t.length !== void 0; - }), e._zod.onattach.push((e) => { - let n = e._zod.bag.minimum ?? -Infinity; - t.minimum > n && (e._zod.bag.minimum = t.minimum); - }), e._zod.check = (n) => { - let r = n.value; - if (r.length >= t.minimum) return; - let i = je$6(r); - n.issues.push({ - origin: i, - code: `too_small`, - minimum: t.minimum, - inclusive: !0, - input: r, - inst: e, - continue: !t.abort - }); - }; -}); -const It$4 = f$5(`$ZodCheckLengthEquals`, (e, t) => { - var n; - x$5.init(e, t), (n = e._zod.def).when ?? (n.when = (e) => { - let t = e.value; - return !ae$5(t) && t.length !== void 0; - }), e._zod.onattach.push((e) => { - let n = e._zod.bag; - n.minimum = t.length, n.maximum = t.length, n.length = t.length; - }), e._zod.check = (n) => { - let r = n.value, i = r.length; - if (i === t.length) return; - let a = je$6(r), o = i > t.length; - n.issues.push({ - origin: a, - ...o ? { - code: `too_big`, - maximum: t.length - } : { - code: `too_small`, - minimum: t.length - }, - inclusive: !0, - exact: !0, - input: n.value, - inst: e, - continue: !t.abort - }); - }; -}); -const Lt$5 = f$5(`$ZodCheckStringFormat`, (e, t) => { - var n, r; - x$5.init(e, t), e._zod.onattach.push((e) => { - let n = e._zod.bag; - n.format = t.format, t.pattern && (n.patterns ??= /* @__PURE__ */ new Set(), n.patterns.add(t.pattern)); - }), t.pattern ? (n = e._zod).check ?? (n.check = (n) => { - t.pattern.lastIndex = 0, !t.pattern.test(n.value) && n.issues.push({ - origin: `string`, - code: `invalid_format`, - format: t.format, - input: n.value, - ...t.pattern ? { pattern: t.pattern.toString() } : {}, - inst: e, - continue: !t.abort - }); - }) : (r = e._zod).check ?? (r.check = () => {}); -}); -const Rt$4 = f$5(`$ZodCheckRegex`, (e, t) => { - Lt$5.init(e, t), e._zod.check = (n) => { - t.pattern.lastIndex = 0, !t.pattern.test(n.value) && n.issues.push({ - origin: `string`, - code: `invalid_format`, - format: `regex`, - input: n.value, - pattern: t.pattern.toString(), - inst: e, - continue: !t.abort - }); - }; -}); -const zt$5 = f$5(`$ZodCheckLowerCase`, (e, t) => { - t.pattern ??= Dt$6, Lt$5.init(e, t); -}); -const Bt$4 = f$5(`$ZodCheckUpperCase`, (e, t) => { - t.pattern ??= Ot$6, Lt$5.init(e, t); -}); -const Vt$5 = f$5(`$ZodCheckIncludes`, (e, t) => { - x$5.init(e, t); - let n = ve$6(t.includes), r = new RegExp(typeof t.position == `number` ? `^.{${t.position}}${n}` : n); - t.pattern = r, e._zod.onattach.push((e) => { - let t = e._zod.bag; - t.patterns ??= /* @__PURE__ */ new Set(), t.patterns.add(r); - }), e._zod.check = (n) => { - n.value.includes(t.includes, t.position) || n.issues.push({ - origin: `string`, - code: `invalid_format`, - format: `includes`, - includes: t.includes, - input: n.value, - inst: e, - continue: !t.abort - }); - }; -}); -const Ht$5 = f$5(`$ZodCheckStartsWith`, (e, t) => { - x$5.init(e, t); - let n = RegExp(`^${ve$6(t.prefix)}.*`); - t.pattern ??= n, e._zod.onattach.push((e) => { - let t = e._zod.bag; - t.patterns ??= /* @__PURE__ */ new Set(), t.patterns.add(n); - }), e._zod.check = (n) => { - n.value.startsWith(t.prefix) || n.issues.push({ - origin: `string`, - code: `invalid_format`, - format: `starts_with`, - prefix: t.prefix, - input: n.value, - inst: e, - continue: !t.abort - }); - }; -}); -const Ut$4 = f$5(`$ZodCheckEndsWith`, (e, t) => { - x$5.init(e, t); - let n = RegExp(`.*${ve$6(t.suffix)}$`); - t.pattern ??= n, e._zod.onattach.push((e) => { - let t = e._zod.bag; - t.patterns ??= /* @__PURE__ */ new Set(), t.patterns.add(n); - }), e._zod.check = (n) => { - n.value.endsWith(t.suffix) || n.issues.push({ - origin: `string`, - code: `invalid_format`, - format: `ends_with`, - suffix: t.suffix, - input: n.value, - inst: e, - continue: !t.abort - }); - }; -}); -const Wt$4 = f$5(`$ZodCheckOverwrite`, (e, t) => { - x$5.init(e, t), e._zod.check = (e) => { - e.value = t.tx(e.value); - }; -}); -var Gt$4 = class { - constructor(e = []) { - this.content = [], this.indent = 0, this && (this.args = e); - } - indented(e) { - this.indent += 1, e(this), --this.indent; - } - write(e) { - if (typeof e == `function`) { - e(this, { execution: `sync` }), e(this, { execution: `async` }); - return; - } - let t = e.split(` -`).filter((e) => e), n = Math.min(...t.map((e) => e.length - e.trimStart().length)), r = t.map((e) => e.slice(n)).map((e) => ` `.repeat(this.indent * 2) + e); - for (let e of r) this.content.push(e); - } - compile() { - let e = Function, t = this?.args, n = [...(this?.content ?? [``]).map((e) => ` ${e}`)]; - return new e(...t, n.join(` -`)); - } -}; -const Kt$5 = { - major: 4, - minor: 4, - patch: 3 -}; -const S$5 = f$5(`$ZodType`, (e, t) => { - var n; - e ??= {}, e._zod.def = t, e._zod.bag = e._zod.bag || {}, e._zod.version = Kt$5; - let r = [...e._zod.def.checks ?? []]; - e._zod.traits.has(`$ZodCheck`) && r.unshift(e); - for (let t of r) for (let n of t._zod.onattach) n(e); - if (r.length === 0) (n = e._zod).deferred ?? (n.deferred = []), e._zod.deferred?.push(() => { - e._zod.run = e._zod.parse; - }); - else { - let t = (e, t, n) => { - let r = Oe$6(e), i; - for (let a of t) { - if (a._zod.def.when) { - if (ke$6(e) || !a._zod.def.when(e)) continue; - } else if (r) continue; - let t = e.issues.length, o = a._zod.check(e); - if (o instanceof Promise && n?.async === !1) throw new p$7(); - if (i || o instanceof Promise) i = (i ?? Promise.resolve()).then(async () => { - await o, e.issues.length !== t && (r ||= Oe$6(e, t)); - }); - else { - if (e.issues.length === t) continue; - r ||= Oe$6(e, t); - } - } - return i ? i.then(() => e) : e; - }, n = (n, i, a) => { - if (Oe$6(n)) return n.aborted = !0, n; - let o = t(i, r, a); - if (o instanceof Promise) { - if (a.async === !1) throw new p$7(); - return o.then((t) => e._zod.parse(t, a)); - } - return e._zod.parse(o, a); - }; - e._zod.run = (i, a) => { - if (a.skipChecks) return e._zod.parse(i, a); - if (a.direction === `backward`) { - let t = e._zod.parse({ - value: i.value, - issues: [] - }, { - ...a, - skipChecks: !0 - }); - return t instanceof Promise ? t.then((e) => n(e, i, a)) : n(t, i, a); - } - let o = e._zod.parse(i, a); - if (o instanceof Promise) { - if (a.async === !1) throw new p$7(); - return o.then((e) => t(e, r, a)); - } - return t(o, r, a); - }; - } - h$5(e, `~standard`, () => ({ - validate: (t) => { - try { - let n = Ve$6(e, t); - return n.success ? { value: n.data } : { issues: n.error?.issues }; - } catch { - return Ue$6(e, t).then((e) => e.success ? { value: e.data } : { issues: e.error?.issues }); - } - }, - vendor: `zod`, - version: 1 - })); -}); -const qt$5 = f$5(`$ZodString`, (e, t) => { - S$5.init(e, t), e._zod.pattern = [...e?._zod.bag?.patterns ?? []].pop() ?? St$6(e._zod.bag), e._zod.parse = (n, r) => { - if (t.coerce) try { - n.value = String(n.value); - } catch {} - return typeof n.value == `string` || n.issues.push({ - expected: `string`, - code: `invalid_type`, - input: n.value, - inst: e - }), n; - }; -}); -const C$6 = f$5(`$ZodStringFormat`, (e, t) => { - Lt$5.init(e, t), qt$5.init(e, t); -}); -const Jt$5 = f$5(`$ZodGUID`, (e, t) => { - t.pattern ??= at$6, C$6.init(e, t); -}); -const Yt$4 = f$5(`$ZodUUID`, (e, t) => { - if (t.version) { - let e = { - v1: 1, - v2: 2, - v3: 3, - v4: 4, - v5: 5, - v6: 6, - v7: 7, - v8: 8 - }[t.version]; - if (e === void 0) throw Error(`Invalid UUID version: "${t.version}"`); - t.pattern ??= ot$6(e); - } else t.pattern ??= ot$6(); - C$6.init(e, t); -}); -const Xt$4 = f$5(`$ZodEmail`, (e, t) => { - t.pattern ??= st$6, C$6.init(e, t); -}); -const Zt$4 = f$5(`$ZodURL`, (e, t) => { - C$6.init(e, t), e._zod.check = (n) => { - try { - let r = n.value.trim(); - if (!t.normalize && t.protocol?.source === ht$6.source && !/^https?:\/\//i.test(r)) { - n.issues.push({ - code: `invalid_format`, - format: `url`, - note: `Invalid URL format`, - input: n.value, - inst: e, - continue: !t.abort - }); - return; - } - let i = new URL(r); - t.hostname && (t.hostname.lastIndex = 0, t.hostname.test(i.hostname) || n.issues.push({ - code: `invalid_format`, - format: `url`, - note: `Invalid hostname`, - pattern: t.hostname.source, - input: n.value, - inst: e, - continue: !t.abort - })), t.protocol && (t.protocol.lastIndex = 0, t.protocol.test(i.protocol.endsWith(`:`) ? i.protocol.slice(0, -1) : i.protocol) || n.issues.push({ - code: `invalid_format`, - format: `url`, - note: `Invalid protocol`, - pattern: t.protocol.source, - input: n.value, - inst: e, - continue: !t.abort - })), t.normalize ? n.value = i.href : n.value = r; - return; - } catch { - n.issues.push({ - code: `invalid_format`, - format: `url`, - input: n.value, - inst: e, - continue: !t.abort - }); - } - }; -}); -const Qt$4 = f$5(`$ZodEmoji`, (e, t) => { - t.pattern ??= ct$6(), C$6.init(e, t); -}); -const $t$4 = f$5(`$ZodNanoID`, (e, t) => { - t.pattern ??= rt$6, C$6.init(e, t); -}); -const en$4 = f$5(`$ZodCUID`, (e, t) => { - t.pattern ??= Qe$6, C$6.init(e, t); -}); -const tn$4 = f$5(`$ZodCUID2`, (e, t) => { - t.pattern ??= $e$6, C$6.init(e, t); -}); -const nn$4 = f$5(`$ZodULID`, (e, t) => { - t.pattern ??= et$6, C$6.init(e, t); -}); -const rn$4 = f$5(`$ZodXID`, (e, t) => { - t.pattern ??= tt$6, C$6.init(e, t); -}); -const an$4 = f$5(`$ZodKSUID`, (e, t) => { - t.pattern ??= nt$6, C$6.init(e, t); -}); -const on$4 = f$5(`$ZodISODateTime`, (e, t) => { - t.pattern ??= xt$6(t), C$6.init(e, t); -}); -const sn$4 = f$5(`$ZodISODate`, (e, t) => { - t.pattern ??= vt$6, C$6.init(e, t); -}); -const cn$4 = f$5(`$ZodISOTime`, (e, t) => { - t.pattern ??= bt$6(t), C$6.init(e, t); -}); -const ln$4 = f$5(`$ZodISODuration`, (e, t) => { - t.pattern ??= it$6, C$6.init(e, t); -}); -const un$4 = f$5(`$ZodIPv4`, (e, t) => { - t.pattern ??= lt$6, C$6.init(e, t), e._zod.bag.format = `ipv4`; -}); -const dn$4 = f$5(`$ZodIPv6`, (e, t) => { - t.pattern ??= ut$6, C$6.init(e, t), e._zod.bag.format = `ipv6`, e._zod.check = (n) => { - try { - new URL(`http://[${n.value}]`); - } catch { - n.issues.push({ - code: `invalid_format`, - format: `ipv6`, - input: n.value, - inst: e, - continue: !t.abort - }); - } - }; -}); -const fn$4 = f$5(`$ZodCIDRv4`, (e, t) => { - t.pattern ??= dt$6, C$6.init(e, t); -}); -const pn$4 = f$5(`$ZodCIDRv6`, (e, t) => { - t.pattern ??= ft$6, C$6.init(e, t), e._zod.check = (n) => { - let r = n.value.split(`/`); - try { - if (r.length !== 2) throw Error(); - let [e, t] = r; - if (!t) throw Error(); - let n = Number(t); - if (`${n}` !== t || n < 0 || n > 128) throw Error(); - new URL(`http://[${e}]`); - } catch { - n.issues.push({ - code: `invalid_format`, - format: `cidrv6`, - input: n.value, - inst: e, - continue: !t.abort - }); - } - }; -}); -function mn$4(e) { - if (e === ``) return !0; - if (/\s/.test(e) || e.length % 4 != 0) return !1; - try { - return atob(e), !0; - } catch { - return !1; - } -} -const hn$4 = f$5(`$ZodBase64`, (e, t) => { - t.pattern ??= pt$6, C$6.init(e, t), e._zod.bag.contentEncoding = `base64`, e._zod.check = (n) => { - mn$4(n.value) || n.issues.push({ - code: `invalid_format`, - format: `base64`, - input: n.value, - inst: e, - continue: !t.abort - }); - }; -}); -function gn$4(e) { - if (!mt$6.test(e)) return !1; - let t = e.replace(/[-_]/g, (e) => e === `-` ? `+` : `/`); - return mn$4(t.padEnd(Math.ceil(t.length / 4) * 4, `=`)); -} -const _n$4 = f$5(`$ZodBase64URL`, (e, t) => { - t.pattern ??= mt$6, C$6.init(e, t), e._zod.bag.contentEncoding = `base64url`, e._zod.check = (n) => { - gn$4(n.value) || n.issues.push({ - code: `invalid_format`, - format: `base64url`, - input: n.value, - inst: e, - continue: !t.abort - }); - }; -}); -const vn$4 = f$5(`$ZodE164`, (e, t) => { - t.pattern ??= gt$6, C$6.init(e, t); -}); -function yn$4(e, t = null) { - try { - let n = e.split(`.`); - if (n.length !== 3) return !1; - let [r] = n; - if (!r) return !1; - let i = JSON.parse(atob(r)); - return !(`typ` in i && i?.typ !== `JWT` || !i.alg || t && (!(`alg` in i) || i.alg !== t)); - } catch { - return !1; - } -} -const bn$4 = f$5(`$ZodJWT`, (e, t) => { - C$6.init(e, t), e._zod.check = (n) => { - yn$4(n.value, t.alg) || n.issues.push({ - code: `invalid_format`, - format: `jwt`, - input: n.value, - inst: e, - continue: !t.abort - }); - }; -}); -const xn$3 = f$5(`$ZodNumber`, (e, t) => { - S$5.init(e, t), e._zod.pattern = e._zod.bag.pattern ?? wt$6, e._zod.parse = (n, r) => { - if (t.coerce) try { - n.value = Number(n.value); - } catch {} - let i = n.value; - if (typeof i == `number` && !Number.isNaN(i) && Number.isFinite(i)) return n; - let a = typeof i == `number` ? Number.isNaN(i) ? `NaN` : Number.isFinite(i) ? void 0 : `Infinity` : void 0; - return n.issues.push({ - expected: `number`, - code: `invalid_type`, - input: i, - inst: e, - ...a ? { received: a } : {} - }), n; - }; -}); -const Sn$3 = f$5(`$ZodNumberFormat`, (e, t) => { - Nt$5.init(e, t), xn$3.init(e, t); -}); -const Cn$3 = f$5(`$ZodBoolean`, (e, t) => { - S$5.init(e, t), e._zod.pattern = Tt$6, e._zod.parse = (n, r) => { - if (t.coerce) try { - n.value = !!n.value; - } catch {} - let i = n.value; - return typeof i == `boolean` || n.issues.push({ - expected: `boolean`, - code: `invalid_type`, - input: i, - inst: e - }), n; - }; -}); -const wn$3 = f$5(`$ZodNull`, (e, t) => { - S$5.init(e, t), e._zod.pattern = Et$6, e._zod.values = /* @__PURE__ */ new Set([null]), e._zod.parse = (t, n) => { - let r = t.value; - return r === null || t.issues.push({ - expected: `null`, - code: `invalid_type`, - input: r, - inst: e - }), t; - }; -}); -const Tn$3 = f$5(`$ZodAny`, (e, t) => { - S$5.init(e, t), e._zod.parse = (e) => e; -}); -const En$3 = f$5(`$ZodUnknown`, (e, t) => { - S$5.init(e, t), e._zod.parse = (e) => e; -}); -const Dn$3 = f$5(`$ZodNever`, (e, t) => { - S$5.init(e, t), e._zod.parse = (t, n) => (t.issues.push({ - expected: `never`, - code: `invalid_type`, - input: t.value, - inst: e - }), t); -}); -function On$3(e, t, n) { - e.issues.length && t.issues.push(...y$3(n, e.issues)), t.value[n] = e.value; -} -const kn$3 = f$5(`$ZodArray`, (e, t) => { - S$5.init(e, t), e._zod.parse = (n, r) => { - let i = n.value; - if (!Array.isArray(i)) return n.issues.push({ - expected: `array`, - code: `invalid_type`, - input: i, - inst: e - }), n; - n.value = Array(i.length); - let a = []; - for (let e = 0; e < i.length; e++) { - let o = i[e], s = t.element._zod.run({ - value: o, - issues: [] - }, r); - s instanceof Promise ? a.push(s.then((t) => On$3(t, n, e))) : On$3(s, n, e); - } - return a.length ? Promise.all(a).then(() => n) : n; - }; -}); -function An$3(e, t, n, r, i, a) { - let o = n in r; - if (e.issues.length) { - if (i && a && !o) return; - t.issues.push(...y$3(n, e.issues)); - } - if (!o && !i) { - e.issues.length || t.issues.push({ - code: `invalid_type`, - expected: `nonoptional`, - input: void 0, - path: [n] - }); - return; - } - e.value === void 0 ? o && (t.value[n] = void 0) : t.value[n] = e.value; -} -function jn$3(e) { - let t = Object.keys(e.shape); - for (let n of t) if (!e.shape?.[n]?._zod?.traits?.has(`$ZodType`)) throw Error(`Invalid element at key "${n}": expected a Zod schema`); - let n = ye$6(e.shape); - return { - ...e, - keys: t, - keySet: new Set(t), - numKeys: t.length, - optionalKeys: new Set(n) - }; -} -function Mn$3(e, t, n, r, i, a) { - let o = [], s = i.keySet, c = i.catchall._zod, l = c.def.type, u = c.optin === `optional`, d = c.optout === `optional`; - for (let i in t) { - if (i === `__proto__` || s.has(i)) continue; - if (l === `never`) { - o.push(i); - continue; - } - let a = c.run({ - value: t[i], - issues: [] - }, r); - a instanceof Promise ? e.push(a.then((e) => An$3(e, n, i, t, u, d))) : An$3(a, n, i, t, u, d); - } - return o.length && n.issues.push({ - code: `unrecognized_keys`, - keys: o, - input: t, - inst: a - }), e.length ? Promise.all(e).then(() => n) : n; -} -const Nn$3 = f$5(`$ZodObject`, (e, t) => { - if (S$5.init(e, t), !Object.getOwnPropertyDescriptor(t, `shape`)?.get) { - let e = t.shape; - Object.defineProperty(t, "shape", { get: () => { - let n = { ...e }; - return Object.defineProperty(t, "shape", { value: n }), n; - } }); - } - let n = ie$4(() => jn$3(t)); - h$5(e._zod, `propValues`, () => { - let e = t.shape, n = {}; - for (let t in e) { - let r = e[t]._zod; - if (r.values) { - n[t] ?? (n[t] = /* @__PURE__ */ new Set()); - for (let e of r.values) n[t].add(e); - } - } - return n; - }); - let r = pe$6, i = t.catchall, a; - e._zod.parse = (t, o) => { - a ??= n.value; - let s = t.value; - if (!r(s)) return t.issues.push({ - expected: `object`, - code: `invalid_type`, - input: s, - inst: e - }), t; - t.value = {}; - let c = [], l = a.shape; - for (let e of a.keys) { - let n = l[e], r = n._zod.optin === `optional`, i = n._zod.optout === `optional`, a = n._zod.run({ - value: s[e], - issues: [] - }, o); - a instanceof Promise ? c.push(a.then((n) => An$3(n, t, e, s, r, i))) : An$3(a, t, e, s, r, i); - } - return i ? Mn$3(c, s, t, o, n.value, e) : c.length ? Promise.all(c).then(() => t) : t; - }; -}); -const Pn$3 = f$5(`$ZodObjectJIT`, (e, t) => { - Nn$3.init(e, t); - let n = e._zod.parse, r = ie$4(() => jn$3(t)), i = (e) => { - let t = new Gt$4([ - `shape`, - `payload`, - `ctx` - ]), n = r.value, i = (e) => { - let t = ue$6(e); - return `shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`; - }; - t.write(`const input = payload.value;`); - let a = Object.create(null), o = 0; - for (let e of n.keys) a[e] = `key_${o++}`; - t.write(`const newResult = {};`); - for (let r of n.keys) { - let n = a[r], o = ue$6(r), s = e[r], c = s?._zod?.optin === `optional`, l = s?._zod?.optout === `optional`; - t.write(`const ${n} = ${i(r)};`), c && l ? t.write(` - if (${n}.issues.length) { - if (${o} in input) { - payload.issues = payload.issues.concat(${n}.issues.map(iss => ({ - ...iss, - path: iss.path ? [${o}, ...iss.path] : [${o}] - }))); - } - } - - if (${n}.value === undefined) { - if (${o} in input) { - newResult[${o}] = undefined; - } - } else { - newResult[${o}] = ${n}.value; - } - - `) : c ? t.write(` - if (${n}.issues.length) { - payload.issues = payload.issues.concat(${n}.issues.map(iss => ({ - ...iss, - path: iss.path ? [${o}, ...iss.path] : [${o}] - }))); - } - - if (${n}.value === undefined) { - if (${o} in input) { - newResult[${o}] = undefined; - } - } else { - newResult[${o}] = ${n}.value; - } - - `) : t.write(` - const ${n}_present = ${o} in input; - if (${n}.issues.length) { - payload.issues = payload.issues.concat(${n}.issues.map(iss => ({ - ...iss, - path: iss.path ? [${o}, ...iss.path] : [${o}] - }))); - } - if (!${n}_present && !${n}.issues.length) { - payload.issues.push({ - code: "invalid_type", - expected: "nonoptional", - input: undefined, - path: [${o}] - }); - } - - if (${n}_present) { - if (${n}.value === undefined) { - newResult[${o}] = undefined; - } else { - newResult[${o}] = ${n}.value; - } - } - - `); - } - t.write(`payload.value = newResult;`), t.write(`return payload;`); - let s = t.compile(); - return (t, n) => s(e, t, n); - }, a, o = pe$6, s = !te$4.jitless, c = s && me$6.value, l = t.catchall, u; - e._zod.parse = (d, f) => { - u ??= r.value; - let p = d.value; - return o(p) ? s && c && f?.async === !1 && f.jitless !== !0 ? (a ||= i(t.shape), d = a(d, f), l ? Mn$3([], p, d, f, u, e) : d) : n(d, f) : (d.issues.push({ - expected: `object`, - code: `invalid_type`, - input: p, - inst: e - }), d); - }; -}); -function Fn$2(e, t, n, r) { - for (let n of e) if (n.issues.length === 0) return t.value = n.value, t; - let i = e.filter((e) => !Oe$6(e)); - return i.length === 1 ? (t.value = i[0].value, i[0]) : (t.issues.push({ - code: `invalid_union`, - input: t.value, - inst: n, - errors: e.map((e) => e.issues.map((e) => b$5(e, r, m$5()))) - }), t); -} -const In$2 = f$5(`$ZodUnion`, (e, t) => { - S$5.init(e, t), h$5(e._zod, `optin`, () => t.options.some((e) => e._zod.optin === `optional`) ? `optional` : void 0), h$5(e._zod, `optout`, () => t.options.some((e) => e._zod.optout === `optional`) ? `optional` : void 0), h$5(e._zod, `values`, () => { - if (t.options.every((e) => e._zod.values)) return new Set(t.options.flatMap((e) => Array.from(e._zod.values))); - }), h$5(e._zod, `pattern`, () => { - if (t.options.every((e) => e._zod.pattern)) { - let e = t.options.map((e) => e._zod.pattern); - return RegExp(`^(${e.map((e) => oe$5(e.source)).join(`|`)})$`); - } - }); - let n = t.options.length === 1 ? t.options[0]._zod.run : null; - e._zod.parse = (r, i) => { - if (n) return n(r, i); - let a = !1, o = []; - for (let e of t.options) { - let t = e._zod.run({ - value: r.value, - issues: [] - }, i); - if (t instanceof Promise) o.push(t), a = !0; - else { - if (t.issues.length === 0) return t; - o.push(t); - } - } - return a ? Promise.all(o).then((t) => Fn$2(t, r, e, i)) : Fn$2(o, r, e, i); - }; -}); -const Ln$2 = f$5(`$ZodDiscriminatedUnion`, (e, t) => { - t.inclusive = !1, In$2.init(e, t); - let n = e._zod.parse; - h$5(e._zod, `propValues`, () => { - let e = {}; - for (let n of t.options) { - let r = n._zod.propValues; - if (!r || Object.keys(r).length === 0) throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`); - for (let [t, n] of Object.entries(r)) { - e[t] || (e[t] = /* @__PURE__ */ new Set()); - for (let r of n) e[t].add(r); - } - } - return e; - }); - let r = ie$4(() => { - let e = t.options, n = /* @__PURE__ */ new Map(); - for (let r of e) { - let e = r._zod.propValues?.[t.discriminator]; - if (!e || e.size === 0) throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`); - for (let t of e) { - if (n.has(t)) throw Error(`Duplicate discriminator value "${String(t)}"`); - n.set(t, r); - } - } - return n; - }); - e._zod.parse = (i, a) => { - let o = i.value; - if (!pe$6(o)) return i.issues.push({ - code: `invalid_type`, - expected: `object`, - input: o, - inst: e - }), i; - let s = r.value.get(o?.[t.discriminator]); - return s ? s._zod.run(i, a) : t.unionFallback || a.direction === `backward` ? n(i, a) : (i.issues.push({ - code: `invalid_union`, - errors: [], - note: `No matching discriminator`, - discriminator: t.discriminator, - options: Array.from(r.value.keys()), - input: o, - path: [t.discriminator], - inst: e - }), i); - }; -}); -const Rn$2 = f$5(`$ZodIntersection`, (e, t) => { - S$5.init(e, t), e._zod.parse = (e, n) => { - let r = e.value, i = t.left._zod.run({ - value: r, - issues: [] - }, n), a = t.right._zod.run({ - value: r, - issues: [] - }, n); - return i instanceof Promise || a instanceof Promise ? Promise.all([i, a]).then(([t, n]) => Bn$2(e, t, n)) : Bn$2(e, i, a); - }; -}); -function zn$2(e, t) { - if (e === t || e instanceof Date && t instanceof Date && +e == +t) return { - valid: !0, - data: e - }; - if (he$6(e) && he$6(t)) { - let n = Object.keys(t), r = Object.keys(e).filter((e) => n.indexOf(e) !== -1), i = { - ...e, - ...t - }; - for (let n of r) { - let r = zn$2(e[n], t[n]); - if (!r.valid) return { - valid: !1, - mergeErrorPath: [n, ...r.mergeErrorPath] - }; - i[n] = r.data; - } - return { - valid: !0, - data: i - }; - } - if (Array.isArray(e) && Array.isArray(t)) { - if (e.length !== t.length) return { - valid: !1, - mergeErrorPath: [] - }; - let n = []; - for (let r = 0; r < e.length; r++) { - let i = e[r], a = t[r], o = zn$2(i, a); - if (!o.valid) return { - valid: !1, - mergeErrorPath: [r, ...o.mergeErrorPath] - }; - n.push(o.data); - } - return { - valid: !0, - data: n - }; - } - return { - valid: !1, - mergeErrorPath: [] - }; -} -function Bn$2(e, t, n) { - let r = /* @__PURE__ */ new Map(), i; - for (let n of t.issues) if (n.code === `unrecognized_keys`) { - i ??= n; - for (let e of n.keys) r.has(e) || r.set(e, {}), r.get(e).l = !0; - } else e.issues.push(n); - for (let t of n.issues) if (t.code === `unrecognized_keys`) for (let e of t.keys) r.has(e) || r.set(e, {}), r.get(e).r = !0; - else e.issues.push(t); - let a = [...r].filter(([, e]) => e.l && e.r).map(([e]) => e); - if (a.length && i && e.issues.push({ - ...i, - keys: a - }), Oe$6(e)) return e; - let o = zn$2(t.value, n.value); - if (!o.valid) throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`); - return e.value = o.data, e; -} -const Vn$2 = f$5(`$ZodTuple`, (e, t) => { - S$5.init(e, t); - let n = t.items; - e._zod.parse = (r, i) => { - let a = r.value; - if (!Array.isArray(a)) return r.issues.push({ - input: a, - inst: e, - expected: `tuple`, - code: `invalid_type` - }), r; - r.value = []; - let o = [], s = Hn$2(n, `optin`), c = Hn$2(n, `optout`); - if (!t.rest) { - if (a.length < s) return r.issues.push({ - code: `too_small`, - minimum: s, - inclusive: !0, - input: a, - inst: e, - origin: `array` - }), r; - a.length > n.length && r.issues.push({ - code: `too_big`, - maximum: n.length, - inclusive: !0, - input: a, - inst: e, - origin: `array` - }); - } - let l = Array(n.length); - for (let e = 0; e < n.length; e++) { - let t = n[e]._zod.run({ - value: a[e], - issues: [] - }, i); - t instanceof Promise ? o.push(t.then((t) => { - l[e] = t; - })) : l[e] = t; - } - if (t.rest) { - let e = n.length - 1, s = a.slice(n.length); - for (let n of s) { - e++; - let a = t.rest._zod.run({ - value: n, - issues: [] - }, i); - a instanceof Promise ? o.push(a.then((t) => Un$2(t, r, e))) : Un$2(a, r, e); - } - } - return o.length ? Promise.all(o).then(() => Wn$2(l, r, n, a, c)) : Wn$2(l, r, n, a, c); - }; -}); -function Hn$2(e, t) { - for (let n = e.length - 1; n >= 0; n--) if (e[n]._zod[t] !== `optional`) return n + 1; - return 0; -} -function Un$2(e, t, n) { - e.issues.length && t.issues.push(...y$3(n, e.issues)), t.value[n] = e.value; -} -function Wn$2(e, t, n, r, i) { - for (let a = 0; a < n.length; a++) { - let n = e[a], o = a < r.length; - if (n.issues.length) { - if (!o && a >= i) { - t.value.length = a; - break; - } - t.issues.push(...y$3(a, n.issues)); - } - t.value[a] = n.value; - } - for (let e = t.value.length - 1; e >= r.length && n[e]._zod.optout === `optional` && t.value[e] === void 0; e--) t.value.length = e; - return t; -} -const Gn$2 = f$5(`$ZodRecord`, (e, t) => { - S$5.init(e, t), e._zod.parse = (n, r) => { - let i = n.value; - if (!he$6(i)) return n.issues.push({ - expected: `record`, - code: `invalid_type`, - input: i, - inst: e - }), n; - let a = [], o = t.keyType._zod.values; - if (o) { - n.value = {}; - let s = /* @__PURE__ */ new Set(); - for (let c of o) if (typeof c == `string` || typeof c == `number` || typeof c == `symbol`) { - s.add(typeof c == `number` ? c.toString() : c); - let o = t.keyType._zod.run({ - value: c, - issues: [] - }, r); - if (o instanceof Promise) throw Error(`Async schemas not supported in object keys currently`); - if (o.issues.length) { - n.issues.push({ - code: `invalid_key`, - origin: `record`, - issues: o.issues.map((e) => b$5(e, r, m$5())), - input: c, - path: [c], - inst: e - }); - continue; - } - let l = o.value, u = t.valueType._zod.run({ - value: i[c], - issues: [] - }, r); - u instanceof Promise ? a.push(u.then((e) => { - e.issues.length && n.issues.push(...y$3(c, e.issues)), n.value[l] = e.value; - })) : (u.issues.length && n.issues.push(...y$3(c, u.issues)), n.value[l] = u.value); - } - let c; - for (let e in i) s.has(e) || (c ??= [], c.push(e)); - c && c.length > 0 && n.issues.push({ - code: `unrecognized_keys`, - input: i, - inst: e, - keys: c - }); - } else { - n.value = {}; - for (let o of Reflect.ownKeys(i)) { - if (o === `__proto__` || !Object.prototype.propertyIsEnumerable.call(i, o)) continue; - let s = t.keyType._zod.run({ - value: o, - issues: [] - }, r); - if (s instanceof Promise) throw Error(`Async schemas not supported in object keys currently`); - if (typeof o == `string` && wt$6.test(o) && s.issues.length) { - let e = t.keyType._zod.run({ - value: Number(o), - issues: [] - }, r); - if (e instanceof Promise) throw Error(`Async schemas not supported in object keys currently`); - e.issues.length === 0 && (s = e); - } - if (s.issues.length) { - t.mode === `loose` ? n.value[o] = i[o] : n.issues.push({ - code: `invalid_key`, - origin: `record`, - issues: s.issues.map((e) => b$5(e, r, m$5())), - input: o, - path: [o], - inst: e - }); - continue; - } - let c = t.valueType._zod.run({ - value: i[o], - issues: [] - }, r); - c instanceof Promise ? a.push(c.then((e) => { - e.issues.length && n.issues.push(...y$3(o, e.issues)), n.value[s.value] = e.value; - })) : (c.issues.length && n.issues.push(...y$3(o, c.issues)), n.value[s.value] = c.value); - } - } - return a.length ? Promise.all(a).then(() => n) : n; - }; -}); -const Kn$2 = f$5(`$ZodEnum`, (e, t) => { - S$5.init(e, t); - let n = ne$4(t.entries), r = new Set(n); - e._zod.values = r, e._zod.pattern = RegExp(`^(${n.filter((e) => _e$6.has(typeof e)).map((e) => typeof e == `string` ? ve$6(e) : e.toString()).join(`|`)})$`), e._zod.parse = (t, i) => { - let a = t.value; - return r.has(a) || t.issues.push({ - code: `invalid_value`, - values: n, - input: a, - inst: e - }), t; - }; -}); -const qn$2 = f$5(`$ZodLiteral`, (e, t) => { - if (S$5.init(e, t), t.values.length === 0) throw Error(`Cannot create literal schema with no valid values`); - let n = new Set(t.values); - e._zod.values = n, e._zod.pattern = RegExp(`^(${t.values.map((e) => typeof e == `string` ? ve$6(e) : e ? ve$6(e.toString()) : String(e)).join(`|`)})$`), e._zod.parse = (r, i) => { - let a = r.value; - return n.has(a) || r.issues.push({ - code: `invalid_value`, - values: t.values, - input: a, - inst: e - }), r; - }; -}); -const Jn$2 = f$5(`$ZodTransform`, (e, t) => { - S$5.init(e, t), e._zod.optin = `optional`, e._zod.parse = (n, r) => { - if (r.direction === `backward`) throw new ee$4(e.constructor.name); - let i = t.transform(n.value, n); - if (r.async) return (i instanceof Promise ? i : Promise.resolve(i)).then((e) => (n.value = e, n.fallback = !0, n)); - if (i instanceof Promise) throw new p$7(); - return n.value = i, n.fallback = !0, n; - }; -}); -function Yn$2(e, t) { - return t === void 0 && (e.issues.length || e.fallback) ? { - issues: [], - value: void 0 - } : e; -} -const Xn$3 = f$5(`$ZodOptional`, (e, t) => { - S$5.init(e, t), e._zod.optin = `optional`, e._zod.optout = `optional`, h$5(e._zod, `values`, () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, void 0]) : void 0), h$5(e._zod, `pattern`, () => { - let e = t.innerType._zod.pattern; - return e ? RegExp(`^(${oe$5(e.source)})?$`) : void 0; - }), e._zod.parse = (e, n) => { - if (t.innerType._zod.optin === `optional`) { - let r = e.value, i = t.innerType._zod.run(e, n); - return i instanceof Promise ? i.then((e) => Yn$2(e, r)) : Yn$2(i, r); - } - return e.value === void 0 ? e : t.innerType._zod.run(e, n); - }; -}); -const Zn$2 = f$5(`$ZodExactOptional`, (e, t) => { - Xn$3.init(e, t), h$5(e._zod, `values`, () => t.innerType._zod.values), h$5(e._zod, `pattern`, () => t.innerType._zod.pattern), e._zod.parse = (e, n) => t.innerType._zod.run(e, n); -}); -const Qn$2 = f$5(`$ZodNullable`, (e, t) => { - S$5.init(e, t), h$5(e._zod, `optin`, () => t.innerType._zod.optin), h$5(e._zod, `optout`, () => t.innerType._zod.optout), h$5(e._zod, `pattern`, () => { - let e = t.innerType._zod.pattern; - return e ? RegExp(`^(${oe$5(e.source)}|null)$`) : void 0; - }), h$5(e._zod, `values`, () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, null]) : void 0), e._zod.parse = (e, n) => e.value === null ? e : t.innerType._zod.run(e, n); -}); -const $n$2 = f$5(`$ZodDefault`, (e, t) => { - S$5.init(e, t), e._zod.optin = `optional`, h$5(e._zod, `values`, () => t.innerType._zod.values), e._zod.parse = (e, n) => { - if (n.direction === `backward`) return t.innerType._zod.run(e, n); - if (e.value === void 0) return e.value = t.defaultValue, e; - let r = t.innerType._zod.run(e, n); - return r instanceof Promise ? r.then((e) => er$2(e, t)) : er$2(r, t); - }; -}); -function er$2(e, t) { - return e.value === void 0 && (e.value = t.defaultValue), e; -} -const tr$2 = f$5(`$ZodPrefault`, (e, t) => { - S$5.init(e, t), e._zod.optin = `optional`, h$5(e._zod, `values`, () => t.innerType._zod.values), e._zod.parse = (e, n) => (n.direction === `backward` || e.value === void 0 && (e.value = t.defaultValue), t.innerType._zod.run(e, n)); -}); -const nr$2 = f$5(`$ZodNonOptional`, (e, t) => { - S$5.init(e, t), h$5(e._zod, `values`, () => { - let e = t.innerType._zod.values; - return e ? new Set([...e].filter((e) => e !== void 0)) : void 0; - }), e._zod.parse = (n, r) => { - let i = t.innerType._zod.run(n, r); - return i instanceof Promise ? i.then((t) => rr$2(t, e)) : rr$2(i, e); - }; -}); -function rr$2(e, t) { - return !e.issues.length && e.value === void 0 && e.issues.push({ - code: `invalid_type`, - expected: `nonoptional`, - input: e.value, - inst: t - }), e; -} -const ir$2 = f$5(`$ZodCatch`, (e, t) => { - S$5.init(e, t), e._zod.optin = `optional`, h$5(e._zod, `optout`, () => t.innerType._zod.optout), h$5(e._zod, `values`, () => t.innerType._zod.values), e._zod.parse = (e, n) => { - if (n.direction === `backward`) return t.innerType._zod.run(e, n); - let r = t.innerType._zod.run(e, n); - return r instanceof Promise ? r.then((r) => (e.value = r.value, r.issues.length && (e.value = t.catchValue({ - ...e, - error: { issues: r.issues.map((e) => b$5(e, n, m$5())) }, - input: e.value - }), e.issues = [], e.fallback = !0), e)) : (e.value = r.value, r.issues.length && (e.value = t.catchValue({ - ...e, - error: { issues: r.issues.map((e) => b$5(e, n, m$5())) }, - input: e.value - }), e.issues = [], e.fallback = !0), e); - }; -}); -const ar$2 = f$5(`$ZodPipe`, (e, t) => { - S$5.init(e, t), h$5(e._zod, `values`, () => t.in._zod.values), h$5(e._zod, `optin`, () => t.in._zod.optin), h$5(e._zod, `optout`, () => t.out._zod.optout), h$5(e._zod, `propValues`, () => t.in._zod.propValues), e._zod.parse = (e, n) => { - if (n.direction === `backward`) { - let r = t.out._zod.run(e, n); - return r instanceof Promise ? r.then((e) => or$2(e, t.in, n)) : or$2(r, t.in, n); - } - let r = t.in._zod.run(e, n); - return r instanceof Promise ? r.then((e) => or$2(e, t.out, n)) : or$2(r, t.out, n); - }; -}); -function or$2(e, t, n) { - return e.issues.length ? (e.aborted = !0, e) : t._zod.run({ - value: e.value, - issues: e.issues, - fallback: e.fallback - }, n); -} -const sr$2 = f$5(`$ZodReadonly`, (e, t) => { - S$5.init(e, t), h$5(e._zod, `propValues`, () => t.innerType._zod.propValues), h$5(e._zod, `values`, () => t.innerType._zod.values), h$5(e._zod, `optin`, () => t.innerType?._zod?.optin), h$5(e._zod, `optout`, () => t.innerType?._zod?.optout), e._zod.parse = (e, n) => { - if (n.direction === `backward`) return t.innerType._zod.run(e, n); - let r = t.innerType._zod.run(e, n); - return r instanceof Promise ? r.then(cr$2) : cr$2(r); - }; -}); -function cr$2(e) { - return e.value = Object.freeze(e.value), e; -} -const lr$2 = f$5(`$ZodLazy`, (e, t) => { - S$5.init(e, t), h$5(e._zod, `innerType`, () => { - let e = t; - return e._cachedInner ||= t.getter(), e._cachedInner; - }), h$5(e._zod, `pattern`, () => e._zod.innerType?._zod?.pattern), h$5(e._zod, `propValues`, () => e._zod.innerType?._zod?.propValues), h$5(e._zod, `optin`, () => e._zod.innerType?._zod?.optin ?? void 0), h$5(e._zod, `optout`, () => e._zod.innerType?._zod?.optout ?? void 0), e._zod.parse = (t, n) => e._zod.innerType._zod.run(t, n); -}); -const ur$2 = f$5(`$ZodCustom`, (e, t) => { - x$5.init(e, t), S$5.init(e, t), e._zod.parse = (e, t) => e, e._zod.check = (n) => { - let r = n.value, i = t.fn(r); - if (i instanceof Promise) return i.then((t) => dr$2(t, n, r, e)); - dr$2(i, n, r, e); - }; -}); -function dr$2(e, t, n, r) { - if (!e) { - let e = { - code: `custom`, - input: n, - inst: r, - path: [...r._zod.def.path ?? []], - continue: !r._zod.def.abort - }; - r._zod.def.params && (e.params = r._zod.def.params), t.issues.push(Me$6(e)); - } -} -var fr$2; -var pr$3 = class { - constructor() { - this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map(); - } - add(e, ...t) { - let n = t[0]; - return this._map.set(e, n), n && typeof n == `object` && `id` in n && this._idmap.set(n.id, e), this; - } - clear() { - return this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map(), this; - } - remove(e) { - let t = this._map.get(e); - return t && typeof t == `object` && `id` in t && this._idmap.delete(t.id), this._map.delete(e), this; - } - get(e) { - let t = e._zod.parent; - if (t) { - let n = { ...this.get(t) ?? {} }; - delete n.id; - let r = { - ...n, - ...this._map.get(e) - }; - return Object.keys(r).length ? r : void 0; - } - return this._map.get(e); - } - has(e) { - return this._map.has(e); - } -}; -function mr$2() { - return new pr$3(); -} -(fr$2 = globalThis).__zod_globalRegistry ?? (fr$2.__zod_globalRegistry = mr$2()); -const hr$2 = globalThis.__zod_globalRegistry; -function gr$2(e, t) { - return new e({ - type: `string`, - ...v$5(t) - }); -} -function _r$2(e, t) { - return new e({ - type: `string`, - format: `email`, - check: `string_format`, - abort: !1, - ...v$5(t) - }); -} -function vr$2(e, t) { - return new e({ - type: `string`, - format: `guid`, - check: `string_format`, - abort: !1, - ...v$5(t) - }); -} -function yr$2(e, t) { - return new e({ - type: `string`, - format: `uuid`, - check: `string_format`, - abort: !1, - ...v$5(t) - }); -} -function br$2(e, t) { - return new e({ - type: `string`, - format: `uuid`, - check: `string_format`, - abort: !1, - version: `v4`, - ...v$5(t) - }); -} -function xr$2(e, t) { - return new e({ - type: `string`, - format: `uuid`, - check: `string_format`, - abort: !1, - version: `v6`, - ...v$5(t) - }); -} -function Sr$2(e, t) { - return new e({ - type: `string`, - format: `uuid`, - check: `string_format`, - abort: !1, - version: `v7`, - ...v$5(t) - }); -} -function Cr$2(e, t) { - return new e({ - type: `string`, - format: `url`, - check: `string_format`, - abort: !1, - ...v$5(t) - }); -} -function wr$2(e, t) { - return new e({ - type: `string`, - format: `emoji`, - check: `string_format`, - abort: !1, - ...v$5(t) - }); -} -function Tr$2(e, t) { - return new e({ - type: `string`, - format: `nanoid`, - check: `string_format`, - abort: !1, - ...v$5(t) - }); -} -function Er$2(e, t) { - return new e({ - type: `string`, - format: `cuid`, - check: `string_format`, - abort: !1, - ...v$5(t) - }); -} -function Dr$2(e, t) { - return new e({ - type: `string`, - format: `cuid2`, - check: `string_format`, - abort: !1, - ...v$5(t) - }); -} -function Or$2(e, t) { - return new e({ - type: `string`, - format: `ulid`, - check: `string_format`, - abort: !1, - ...v$5(t) - }); -} -function kr$2(e, t) { - return new e({ - type: `string`, - format: `xid`, - check: `string_format`, - abort: !1, - ...v$5(t) - }); -} -function Ar$2(e, t) { - return new e({ - type: `string`, - format: `ksuid`, - check: `string_format`, - abort: !1, - ...v$5(t) - }); -} -function jr$2(e, t) { - return new e({ - type: `string`, - format: `ipv4`, - check: `string_format`, - abort: !1, - ...v$5(t) - }); -} -function Mr$2(e, t) { - return new e({ - type: `string`, - format: `ipv6`, - check: `string_format`, - abort: !1, - ...v$5(t) - }); -} -function Nr$2(e, t) { - return new e({ - type: `string`, - format: `cidrv4`, - check: `string_format`, - abort: !1, - ...v$5(t) - }); -} -function Pr$2(e, t) { - return new e({ - type: `string`, - format: `cidrv6`, - check: `string_format`, - abort: !1, - ...v$5(t) - }); -} -function Fr$2(e, t) { - return new e({ - type: `string`, - format: `base64`, - check: `string_format`, - abort: !1, - ...v$5(t) - }); -} -function Ir$2(e, t) { - return new e({ - type: `string`, - format: `base64url`, - check: `string_format`, - abort: !1, - ...v$5(t) - }); -} -function Lr$2(e, t) { - return new e({ - type: `string`, - format: `e164`, - check: `string_format`, - abort: !1, - ...v$5(t) - }); -} -function Rr$2(e, t) { - return new e({ - type: `string`, - format: `jwt`, - check: `string_format`, - abort: !1, - ...v$5(t) - }); -} -function zr$2(e, t) { - return new e({ - type: `string`, - format: `datetime`, - check: `string_format`, - offset: !1, - local: !1, - precision: null, - ...v$5(t) - }); -} -function Br$2(e, t) { - return new e({ - type: `string`, - format: `date`, - check: `string_format`, - ...v$5(t) - }); -} -function Vr$2(e, t) { - return new e({ - type: `string`, - format: `time`, - check: `string_format`, - precision: null, - ...v$5(t) - }); -} -function Hr$2(e, t) { - return new e({ - type: `string`, - format: `duration`, - check: `string_format`, - ...v$5(t) - }); -} -function Ur$2(e, t) { - return new e({ - type: `number`, - checks: [], - ...v$5(t) - }); -} -function Wr$2(e, t) { - return new e({ - type: `number`, - coerce: !0, - checks: [], - ...v$5(t) - }); -} -function Gr$2(e, t) { - return new e({ - type: `number`, - check: `number_format`, - abort: !1, - format: `safeint`, - ...v$5(t) - }); -} -function Kr$2(e, t) { - return new e({ - type: `boolean`, - ...v$5(t) - }); -} -function qr$2(e, t) { - return new e({ - type: `null`, - ...v$5(t) - }); -} -function Jr$2(e) { - return new e({ type: `any` }); -} -function Yr$2(e) { - return new e({ type: `unknown` }); -} -function Xr$2(e, t) { - return new e({ - type: `never`, - ...v$5(t) - }); -} -function Zr$2(e, t) { - return new At$6({ - check: `less_than`, - ...v$5(t), - value: e, - inclusive: !1 - }); -} -function Qr$2(e, t) { - return new At$6({ - check: `less_than`, - ...v$5(t), - value: e, - inclusive: !0 - }); -} -function $r$2(e, t) { - return new jt$6({ - check: `greater_than`, - ...v$5(t), - value: e, - inclusive: !1 - }); -} -function ei$2(e, t) { - return new jt$6({ - check: `greater_than`, - ...v$5(t), - value: e, - inclusive: !0 - }); -} -function ti$2(e, t) { - return new Mt$6({ - check: `multiple_of`, - ...v$5(t), - value: e - }); -} -function ni$2(e, t) { - return new Pt$5({ - check: `max_length`, - ...v$5(t), - maximum: e - }); -} -function ri$2(e, t) { - return new Ft$5({ - check: `min_length`, - ...v$5(t), - minimum: e - }); -} -function ii$2(e, t) { - return new It$4({ - check: `length_equals`, - ...v$5(t), - length: e - }); -} -function ai$2(e, t) { - return new Rt$4({ - check: `string_format`, - format: `regex`, - ...v$5(t), - pattern: e - }); -} -function oi$2(e) { - return new zt$5({ - check: `string_format`, - format: `lowercase`, - ...v$5(e) - }); -} -function si$2(e) { - return new Bt$4({ - check: `string_format`, - format: `uppercase`, - ...v$5(e) - }); -} -function ci$2(e, t) { - return new Vt$5({ - check: `string_format`, - format: `includes`, - ...v$5(t), - includes: e - }); -} -function li$2(e, t) { - return new Ht$5({ - check: `string_format`, - format: `starts_with`, - ...v$5(t), - prefix: e - }); -} -function ui$2(e, t) { - return new Ut$4({ - check: `string_format`, - format: `ends_with`, - ...v$5(t), - suffix: e - }); -} -function di$2(e) { - return new Wt$4({ - check: `overwrite`, - tx: e - }); -} -function fi$2(e) { - return di$2((t) => t.normalize(e)); -} -function pi$2() { - return di$2((e) => e.trim()); -} -function mi$2() { - return di$2((e) => e.toLowerCase()); -} -function hi$2() { - return di$2((e) => e.toUpperCase()); -} -function gi$2() { - return di$2((e) => de$6(e)); -} -function _i$2(e, t, n) { - return new e({ - type: `array`, - element: t, - ...v$5(n) - }); -} -function vi$2(e, t, n) { - return new e({ - type: `custom`, - check: `custom`, - fn: t, - ...v$5(n) - }); -} -function yi$2(e, t) { - let n = bi$2((t) => (t.addIssue = (e) => { - if (typeof e == `string`) t.issues.push(Me$6(e, t.value, n._zod.def)); - else { - let r = e; - r.fatal && (r.continue = !1), r.code ??= `custom`, r.input ??= t.value, r.inst ??= n, r.continue ??= !n._zod.def.abort, t.issues.push(Me$6(r)); - } - }, e(t.value, t)), t); - return n; -} -function bi$2(e, t) { - let n = new x$5({ - check: `custom`, - ...v$5(t) - }); - return n._zod.check = e, n; -} -function xi$2(e) { - let t = e?.target ?? `draft-2020-12`; - return t === `draft-4` && (t = `draft-04`), t === `draft-7` && (t = `draft-07`), { - processors: e.processors ?? {}, - metadataRegistry: e?.metadata ?? hr$2, - target: t, - unrepresentable: e?.unrepresentable ?? `throw`, - override: e?.override ?? (() => {}), - io: e?.io ?? `output`, - counter: 0, - seen: /* @__PURE__ */ new Map(), - cycles: e?.cycles ?? `ref`, - reused: e?.reused ?? `inline`, - external: e?.external ?? void 0 - }; -} -function w$6(e, t, n = { - path: [], - schemaPath: [] -}) { - var r; - let i = e._zod.def, a = t.seen.get(e); - if (a) return a.count++, n.schemaPath.includes(e) && (a.cycle = n.path), a.schema; - let o = { - schema: {}, - count: 1, - cycle: void 0, - path: n.path - }; - t.seen.set(e, o); - let s = e._zod.toJSONSchema?.(); - if (s) o.schema = s; - else { - let r = { - ...n, - schemaPath: [...n.schemaPath, e], - path: n.path - }; - if (e._zod.processJSONSchema) e._zod.processJSONSchema(t, o.schema, r); - else { - let n = o.schema, a = t.processors[i.type]; - if (!a) throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`); - a(e, t, n, r); - } - let a = e._zod.parent; - a && (o.ref ||= a, w$6(a, t, r), t.seen.get(a).isParent = !0); - } - let c = t.metadataRegistry.get(e); - return c && Object.assign(o.schema, c), t.io === `input` && T$6(e) && (delete o.schema.examples, delete o.schema.default), t.io === `input` && `_prefault` in o.schema && ((r = o.schema).default ?? (r.default = o.schema._prefault)), delete o.schema._prefault, t.seen.get(e).schema; -} -function Si$2(e, t) { - let n = e.seen.get(t); - if (!n) throw Error(`Unprocessed schema. This is a bug in Zod.`); - let r = /* @__PURE__ */ new Map(); - for (let t of e.seen.entries()) { - let n = e.metadataRegistry.get(t[0])?.id; - if (n) { - let e = r.get(n); - if (e && e !== t[0]) throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`); - r.set(n, t[0]); - } - } - let i = (t) => { - let r = e.target === `draft-2020-12` ? `$defs` : `definitions`; - if (e.external) { - let n = e.external.registry.get(t[0])?.id, i = e.external.uri ?? ((e) => e); - if (n) return { ref: i(n) }; - let a = t[1].defId ?? t[1].schema.id ?? `schema${e.counter++}`; - return t[1].defId = a, { - defId: a, - ref: `${i(`__shared`)}#/${r}/${a}` - }; - } - if (t[1] === n) return { ref: `#` }; - let i = `#/${r}/`, a = t[1].schema.id ?? `__schema${e.counter++}`; - return { - defId: a, - ref: i + a - }; - }, a = (e) => { - if (e[1].schema.$ref) return; - let t = e[1], { ref: n, defId: r } = i(e); - t.def = { ...t.schema }, r && (t.defId = r); - let a = t.schema; - for (let e in a) delete a[e]; - a.$ref = n; - }; - if (e.cycles === `throw`) for (let t of e.seen.entries()) { - let e = t[1]; - if (e.cycle) throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/ - -Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`); - } - for (let n of e.seen.entries()) { - let r = n[1]; - if (t === n[0]) { - a(n); - continue; - } - if (e.external) { - let r = e.external.registry.get(n[0])?.id; - if (t !== n[0] && r) { - a(n); - continue; - } - } - if (e.metadataRegistry.get(n[0])?.id) { - a(n); - continue; - } - if (r.cycle) { - a(n); - continue; - } - if (r.count > 1 && e.reused === `ref`) { - a(n); - continue; - } - } -} -function Ci$2(e, t) { - let n = e.seen.get(t); - if (!n) throw Error(`Unprocessed schema. This is a bug in Zod.`); - let r = (t) => { - let n = e.seen.get(t); - if (n.ref === null) return; - let i = n.def ?? n.schema, a = { ...i }, o = n.ref; - if (n.ref = null, o) { - r(o); - let n = e.seen.get(o), s = n.schema; - if (s.$ref && (e.target === `draft-07` || e.target === `draft-04` || e.target === `openapi-3.0`) ? (i.allOf = i.allOf ?? [], i.allOf.push(s)) : Object.assign(i, s), Object.assign(i, a), t._zod.parent === o) for (let e in i) e === `$ref` || e === `allOf` || e in a || delete i[e]; - if (s.$ref && n.def) for (let e in i) e === `$ref` || e === `allOf` || e in n.def && JSON.stringify(i[e]) === JSON.stringify(n.def[e]) && delete i[e]; - } - let s = t._zod.parent; - if (s && s !== o) { - r(s); - let t = e.seen.get(s); - if (t?.schema.$ref && (i.$ref = t.schema.$ref, t.def)) for (let e in i) e === `$ref` || e === `allOf` || e in t.def && JSON.stringify(i[e]) === JSON.stringify(t.def[e]) && delete i[e]; - } - e.override({ - zodSchema: t, - jsonSchema: i, - path: n.path ?? [] - }); - }; - for (let t of [...e.seen.entries()].reverse()) r(t[0]); - let i = {}; - if (e.target === `draft-2020-12` ? i.$schema = `https://json-schema.org/draft/2020-12/schema` : e.target === `draft-07` ? i.$schema = `http://json-schema.org/draft-07/schema#` : e.target === `draft-04` ? i.$schema = `http://json-schema.org/draft-04/schema#` : e.target, e.external?.uri) { - let n = e.external.registry.get(t)?.id; - if (!n) throw Error("Schema is missing an `id` property"); - i.$id = e.external.uri(n); - } - Object.assign(i, n.def ?? n.schema); - let a = e.metadataRegistry.get(t)?.id; - a !== void 0 && i.id === a && delete i.id; - let o = e.external?.defs ?? {}; - for (let t of e.seen.entries()) { - let e = t[1]; - e.def && e.defId && (e.def.id === e.defId && delete e.def.id, o[e.defId] = e.def); - } - e.external || Object.keys(o).length > 0 && (e.target === `draft-2020-12` ? i.$defs = o : i.definitions = o); - try { - let n = JSON.parse(JSON.stringify(i)); - return Object.defineProperty(n, "~standard", { - value: { - ...t[`~standard`], - jsonSchema: { - input: Ti$2(t, `input`, e.processors), - output: Ti$2(t, `output`, e.processors) - } - }, - enumerable: !1, - writable: !1 - }), n; - } catch { - throw Error(`Error converting schema to JSON.`); - } -} -function T$6(e, t) { - let n = t ?? { seen: /* @__PURE__ */ new Set() }; - if (n.seen.has(e)) return !1; - n.seen.add(e); - let r = e._zod.def; - if (r.type === `transform`) return !0; - if (r.type === `array`) return T$6(r.element, n); - if (r.type === `set`) return T$6(r.valueType, n); - if (r.type === `lazy`) return T$6(r.getter(), n); - if (r.type === `promise` || r.type === `optional` || r.type === `nonoptional` || r.type === `nullable` || r.type === `readonly` || r.type === "default" || r.type === `prefault`) return T$6(r.innerType, n); - if (r.type === `intersection`) return T$6(r.left, n) || T$6(r.right, n); - if (r.type === `record` || r.type === `map`) return T$6(r.keyType, n) || T$6(r.valueType, n); - if (r.type === `pipe`) return e._zod.traits.has(`$ZodCodec`) ? !0 : T$6(r.in, n) || T$6(r.out, n); - if (r.type === `object`) { - for (let e in r.shape) if (T$6(r.shape[e], n)) return !0; - return !1; - } - if (r.type === `union`) { - for (let e of r.options) if (T$6(e, n)) return !0; - return !1; - } - if (r.type === `tuple`) { - for (let e of r.items) if (T$6(e, n)) return !0; - return !!(r.rest && T$6(r.rest, n)); - } - return !1; -} -const wi$2 = (e, t = {}) => (n) => { - let r = xi$2({ - ...n, - processors: t - }); - return w$6(e, r), Si$2(r, e), Ci$2(r, e); -}; -const Ti$2 = (e, t, n = {}) => (r) => { - let { libraryOptions: i, target: a } = r ?? {}, o = xi$2({ - ...i ?? {}, - target: a, - io: t, - processors: n - }); - return w$6(e, o), Si$2(o, e), Ci$2(o, e); -}; -const Ei$2 = { - guid: `uuid`, - url: `uri`, - datetime: `date-time`, - json_string: `json-string`, - regex: `` -}; -const Di$2 = (e, t, n, r) => { - let i = n; - i.type = `string`; - let { minimum: a, maximum: o, format: s, patterns: c, contentEncoding: l } = e._zod.bag; - if (typeof a == `number` && (i.minLength = a), typeof o == `number` && (i.maxLength = o), s && (i.format = Ei$2[s] ?? s, i.format === `` && delete i.format, s === `time` && delete i.format), l && (i.contentEncoding = l), c && c.size > 0) { - let e = [...c]; - e.length === 1 ? i.pattern = e[0].source : e.length > 1 && (i.allOf = [...e.map((e) => ({ - ...t.target === `draft-07` || t.target === `draft-04` || t.target === `openapi-3.0` ? { type: `string` } : {}, - pattern: e.source - }))]); - } -}; -const Oi$2 = (e, t, n, r) => { - let i = n, { minimum: a, maximum: o, format: s, multipleOf: c, exclusiveMaximum: l, exclusiveMinimum: u } = e._zod.bag; - typeof s == `string` && s.includes(`int`) ? i.type = `integer` : i.type = `number`; - let d = typeof u == `number` && u >= (a ?? -Infinity), f = typeof l == `number` && l <= (o ?? Infinity), p = t.target === `draft-04` || t.target === `openapi-3.0`; - d ? p ? (i.minimum = u, i.exclusiveMinimum = !0) : i.exclusiveMinimum = u : typeof a == `number` && (i.minimum = a), f ? p ? (i.maximum = l, i.exclusiveMaximum = !0) : i.exclusiveMaximum = l : typeof o == `number` && (i.maximum = o), typeof c == `number` && (i.multipleOf = c); -}; -const ki$2 = (e, t, n, r) => { - n.type = `boolean`; -}; -const Ai$2 = (e, t, n, r) => { - if (t.unrepresentable === `throw`) throw Error(`BigInt cannot be represented in JSON Schema`); -}; -const ji$2 = (e, t, n, r) => { - if (t.unrepresentable === `throw`) throw Error(`Symbols cannot be represented in JSON Schema`); -}; -const Mi$2 = (e, t, n, r) => { - t.target === `openapi-3.0` ? (n.type = `string`, n.nullable = !0, n.enum = [null]) : n.type = `null`; -}; -const Ni$2 = (e, t, n, r) => { - if (t.unrepresentable === `throw`) throw Error(`Undefined cannot be represented in JSON Schema`); -}; -const Pi$2 = (e, t, n, r) => { - if (t.unrepresentable === `throw`) throw Error(`Void cannot be represented in JSON Schema`); -}; -const Fi$2 = (e, t, n, r) => { - n.not = {}; -}; -const Ii$2 = (e, t, n, r) => {}; -const Li$2 = (e, t, n, r) => {}; -const Ri$2 = (e, t, n, r) => { - if (t.unrepresentable === `throw`) throw Error(`Date cannot be represented in JSON Schema`); -}; -const zi$2 = (e, t, n, r) => { - let i = e._zod.def, a = ne$4(i.entries); - a.every((e) => typeof e == `number`) && (n.type = `number`), a.every((e) => typeof e == `string`) && (n.type = `string`), n.enum = a; -}; -const Bi$2 = (e, t, n, r) => { - let i = e._zod.def, a = []; - for (let e of i.values) if (e === void 0) { - if (t.unrepresentable === `throw`) throw Error("Literal `undefined` cannot be represented in JSON Schema"); - } else if (typeof e == `bigint`) { - if (t.unrepresentable === `throw`) throw Error(`BigInt literals cannot be represented in JSON Schema`); - a.push(Number(e)); - } else a.push(e); - if (a.length !== 0) if (a.length === 1) { - let e = a[0]; - n.type = e === null ? `null` : typeof e, t.target === `draft-04` || t.target === `openapi-3.0` ? n.enum = [e] : n.const = e; - } else a.every((e) => typeof e == `number`) && (n.type = `number`), a.every((e) => typeof e == `string`) && (n.type = `string`), a.every((e) => typeof e == `boolean`) && (n.type = `boolean`), a.every((e) => e === null) && (n.type = `null`), n.enum = a; -}; -const Vi$2 = (e, t, n, r) => { - if (t.unrepresentable === `throw`) throw Error(`NaN cannot be represented in JSON Schema`); -}; -const Hi$2 = (e, t, n, r) => { - let i = n, a = e._zod.pattern; - if (!a) throw Error(`Pattern not found in template literal`); - i.type = `string`, i.pattern = a.source; -}; -const Ui$2 = (e, t, n, r) => { - let i = n, a = { - type: `string`, - format: `binary`, - contentEncoding: `binary` - }, { minimum: o, maximum: s, mime: c } = e._zod.bag; - o !== void 0 && (a.minLength = o), s !== void 0 && (a.maxLength = s), c ? c.length === 1 ? (a.contentMediaType = c[0], Object.assign(i, a)) : (Object.assign(i, a), i.anyOf = c.map((e) => ({ contentMediaType: e }))) : Object.assign(i, a); -}; -const Wi$2 = (e, t, n, r) => { - n.type = `boolean`; -}; -const Gi$2 = (e, t, n, r) => { - if (t.unrepresentable === `throw`) throw Error(`Custom types cannot be represented in JSON Schema`); -}; -const Ki$2 = (e, t, n, r) => { - if (t.unrepresentable === `throw`) throw Error(`Function types cannot be represented in JSON Schema`); -}; -const qi$2 = (e, t, n, r) => { - if (t.unrepresentable === `throw`) throw Error(`Transforms cannot be represented in JSON Schema`); -}; -const Ji$2 = (e, t, n, r) => { - if (t.unrepresentable === `throw`) throw Error(`Map cannot be represented in JSON Schema`); -}; -const Yi$2 = (e, t, n, r) => { - if (t.unrepresentable === `throw`) throw Error(`Set cannot be represented in JSON Schema`); -}; -const Xi$2 = (e, t, n, r) => { - let i = n, a = e._zod.def, { minimum: o, maximum: s } = e._zod.bag; - typeof o == `number` && (i.minItems = o), typeof s == `number` && (i.maxItems = s), i.type = `array`, i.items = w$6(a.element, t, { - ...r, - path: [...r.path, `items`] - }); -}; -const Zi$2 = (e, t, n, r) => { - let i = n, a = e._zod.def; - i.type = `object`, i.properties = {}; - let o = a.shape; - for (let e in o) i.properties[e] = w$6(o[e], t, { - ...r, - path: [ - ...r.path, - `properties`, - e - ] - }); - let s = new Set(Object.keys(o)), c = new Set([...s].filter((e) => { - let n = a.shape[e]._zod; - return t.io === `input` ? n.optin === void 0 : n.optout === void 0; - })); - c.size > 0 && (i.required = Array.from(c)), a.catchall?._zod.def.type === `never` ? i.additionalProperties = !1 : a.catchall ? a.catchall && (i.additionalProperties = w$6(a.catchall, t, { - ...r, - path: [...r.path, `additionalProperties`] - })) : t.io === `output` && (i.additionalProperties = !1); -}; -const Qi$2 = (e, t, n, r) => { - let i = e._zod.def, a = i.inclusive === !1, o = i.options.map((e, n) => w$6(e, t, { - ...r, - path: [ - ...r.path, - a ? `oneOf` : `anyOf`, - n - ] - })); - a ? n.oneOf = o : n.anyOf = o; -}; -const $i$2 = (e, t, n, r) => { - let i = e._zod.def, a = w$6(i.left, t, { - ...r, - path: [ - ...r.path, - `allOf`, - 0 - ] - }), o = w$6(i.right, t, { - ...r, - path: [ - ...r.path, - `allOf`, - 1 - ] - }), s = (e) => `allOf` in e && Object.keys(e).length === 1; - n.allOf = [...s(a) ? a.allOf : [a], ...s(o) ? o.allOf : [o]]; -}; -const ea$2 = (e, t, n, r) => { - let i = n, a = e._zod.def; - i.type = `array`; - let o = t.target === `draft-2020-12` ? `prefixItems` : `items`, s = t.target === `draft-2020-12` || t.target === `openapi-3.0` ? `items` : `additionalItems`, c = a.items.map((e, n) => w$6(e, t, { - ...r, - path: [ - ...r.path, - o, - n - ] - })), l = a.rest ? w$6(a.rest, t, { - ...r, - path: [ - ...r.path, - s, - ...t.target === `openapi-3.0` ? [a.items.length] : [] - ] - }) : null; - t.target === `draft-2020-12` ? (i.prefixItems = c, l && (i.items = l)) : t.target === `openapi-3.0` ? (i.items = { anyOf: c }, l && i.items.anyOf.push(l), i.minItems = c.length, l || (i.maxItems = c.length)) : (i.items = c, l && (i.additionalItems = l)); - let { minimum: u, maximum: d } = e._zod.bag; - typeof u == `number` && (i.minItems = u), typeof d == `number` && (i.maxItems = d); -}; -const ta$2 = (e, t, n, r) => { - let i = n, a = e._zod.def; - i.type = `object`; - let o = a.keyType, s = o._zod.bag?.patterns; - if (a.mode === `loose` && s && s.size > 0) { - let e = w$6(a.valueType, t, { - ...r, - path: [ - ...r.path, - `patternProperties`, - `*` - ] - }); - i.patternProperties = {}; - for (let t of s) i.patternProperties[t.source] = e; - } else (t.target === `draft-07` || t.target === `draft-2020-12`) && (i.propertyNames = w$6(a.keyType, t, { - ...r, - path: [...r.path, `propertyNames`] - })), i.additionalProperties = w$6(a.valueType, t, { - ...r, - path: [...r.path, `additionalProperties`] - }); - let c = o._zod.values; - if (c) { - let e = [...c].filter((e) => typeof e == `string` || typeof e == `number`); - e.length > 0 && (i.required = e); - } -}; -const na$2 = (e, t, n, r) => { - let i = e._zod.def, a = w$6(i.innerType, t, r), o = t.seen.get(e); - t.target === `openapi-3.0` ? (o.ref = i.innerType, n.nullable = !0) : n.anyOf = [a, { type: `null` }]; -}; -const ra$2 = (e, t, n, r) => { - let i = e._zod.def; - w$6(i.innerType, t, r); - let a = t.seen.get(e); - a.ref = i.innerType; -}; -const ia$2 = (e, t, n, r) => { - let i = e._zod.def; - w$6(i.innerType, t, r); - let a = t.seen.get(e); - a.ref = i.innerType, n.default = JSON.parse(JSON.stringify(i.defaultValue)); -}; -const aa$2 = (e, t, n, r) => { - let i = e._zod.def; - w$6(i.innerType, t, r); - let a = t.seen.get(e); - a.ref = i.innerType, t.io === `input` && (n._prefault = JSON.parse(JSON.stringify(i.defaultValue))); -}; -const oa$2 = (e, t, n, r) => { - let i = e._zod.def; - w$6(i.innerType, t, r); - let a = t.seen.get(e); - a.ref = i.innerType; - let o; - try { - o = i.catchValue(void 0); - } catch { - throw Error(`Dynamic catch values are not supported in JSON Schema`); - } - n.default = o; -}; -const sa$2 = (e, t, n, r) => { - let i = e._zod.def, a = i.in._zod.traits.has(`$ZodTransform`), o = t.io === `input` ? a ? i.out : i.in : i.out; - w$6(o, t, r); - let s = t.seen.get(e); - s.ref = o; -}; -const ca$2 = (e, t, n, r) => { - let i = e._zod.def; - w$6(i.innerType, t, r); - let a = t.seen.get(e); - a.ref = i.innerType, n.readOnly = !0; -}; -const la$2 = (e, t, n, r) => { - let i = e._zod.def; - w$6(i.innerType, t, r); - let a = t.seen.get(e); - a.ref = i.innerType; -}; -const ua$2 = (e, t, n, r) => { - let i = e._zod.def; - w$6(i.innerType, t, r); - let a = t.seen.get(e); - a.ref = i.innerType; -}; -const da$2 = (e, t, n, r) => { - let i = e._zod.innerType; - w$6(i, t, r); - let a = t.seen.get(e); - a.ref = i; -}; -const fa$2 = { - string: Di$2, - number: Oi$2, - boolean: ki$2, - bigint: Ai$2, - symbol: ji$2, - null: Mi$2, - undefined: Ni$2, - void: Pi$2, - never: Fi$2, - any: Ii$2, - unknown: Li$2, - date: Ri$2, - enum: zi$2, - literal: Bi$2, - nan: Vi$2, - template_literal: Hi$2, - file: Ui$2, - success: Wi$2, - custom: Gi$2, - function: Ki$2, - transform: qi$2, - map: Ji$2, - set: Yi$2, - array: Xi$2, - object: Zi$2, - union: Qi$2, - intersection: $i$2, - tuple: ea$2, - record: ta$2, - nullable: na$2, - nonoptional: ra$2, - default: ia$2, - prefault: aa$2, - catch: oa$2, - pipe: sa$2, - readonly: ca$2, - promise: la$2, - optional: ua$2, - lazy: da$2 -}; -function pa$2(e, t) { - if (`_idmap` in e) { - let n = e, r = xi$2({ - ...t, - processors: fa$2 - }), i = {}; - for (let e of n._idmap.entries()) { - let [t, n] = e; - w$6(n, r); - } - let a = {}; - r.external = { - registry: n, - uri: t?.uri, - defs: i - }; - for (let e of n._idmap.entries()) { - let [t, n] = e; - Si$2(r, n), a[t] = Ci$2(r, n); - } - return Object.keys(i).length > 0 && (a.__shared = { [r.target === `draft-2020-12` ? `$defs` : `definitions`]: i }), { schemas: a }; - } - let n = xi$2({ - ...t, - processors: fa$2 - }); - return w$6(e, n), Si$2(n, e), Ci$2(n, e); -} -const ma$2 = f$5(`ZodISODateTime`, (e, t) => { - on$4.init(e, t), O$5.init(e, t); -}); -function ha$2(e) { - return zr$2(ma$2, e); -} -const ga$2 = f$5(`ZodISODate`, (e, t) => { - sn$4.init(e, t), O$5.init(e, t); -}); -function _a$2(e) { - return Br$2(ga$2, e); -} -const va$2 = f$5(`ZodISOTime`, (e, t) => { - cn$4.init(e, t), O$5.init(e, t); -}); -function ya$2(e) { - return Vr$2(va$2, e); -} -const ba$2 = f$5(`ZodISODuration`, (e, t) => { - ln$4.init(e, t), O$5.init(e, t); -}); -function xa$2(e) { - return Hr$2(ba$2, e); -} -const E$6 = f$5(`ZodError`, (e, t) => { - Pe$6.init(e, t), e.name = `ZodError`, Object.defineProperties(e, { - format: { value: (t) => Le$6(e, t) }, - flatten: { value: (t) => Ie$6(e, t) }, - addIssue: { value: (t) => { - e.issues.push(t), e.message = JSON.stringify(e.issues, re$4, 2); - } }, - addIssues: { value: (t) => { - e.issues.push(...t), e.message = JSON.stringify(e.issues, re$4, 2); - } }, - isEmpty: { get() { - return e.issues.length === 0; - } } - }); -}, { Parent: Error }); -const Sa$2 = Re$6(E$6); -const Ca$2 = ze$6(E$6); -const wa$2 = Be$6(E$6); -const Ta$2 = He$6(E$6); -const Ea$2 = We$6(E$6); -const Da$2 = Ge$6(E$6); -const Oa$2 = Ke$6(E$6); -const ka$2 = qe$6(E$6); -const Aa$2 = Je$6(E$6); -const ja$2 = Ye$6(E$6); -const Ma$2 = Xe$6(E$6); -const Na$2 = Ze$6(E$6); -const Pa$2 = /* @__PURE__ */ new WeakMap(); -function Fa$2(e, t, n) { - let r = Object.getPrototypeOf(e), i = Pa$2.get(r); - if (i || (i = /* @__PURE__ */ new Set(), Pa$2.set(r, i)), !i.has(t)) { - i.add(t); - for (let e in n) { - let t = n[e]; - Object.defineProperty(r, e, { - configurable: !0, - enumerable: !1, - get() { - let n = t.bind(this); - return Object.defineProperty(this, e, { - configurable: !0, - writable: !0, - enumerable: !0, - value: n - }), n; - }, - set(t) { - Object.defineProperty(this, e, { - configurable: !0, - writable: !0, - enumerable: !0, - value: t - }); - } - }); - } - } -} -const D$5 = f$5(`ZodType`, (e, t) => (S$5.init(e, t), Object.assign(e[`~standard`], { jsonSchema: { - input: Ti$2(e, `input`), - output: Ti$2(e, `output`) -} }), e.toJSONSchema = wi$2(e, {}), e.def = t, e.type = t.type, Object.defineProperty(e, "_def", { value: t }), e.parse = (t, n) => Sa$2(e, t, n, { callee: e.parse }), e.safeParse = (t, n) => wa$2(e, t, n), e.parseAsync = async (t, n) => Ca$2(e, t, n, { callee: e.parseAsync }), e.safeParseAsync = async (t, n) => Ta$2(e, t, n), e.spa = e.safeParseAsync, e.encode = (t, n) => Ea$2(e, t, n), e.decode = (t, n) => Da$2(e, t, n), e.encodeAsync = async (t, n) => Oa$2(e, t, n), e.decodeAsync = async (t, n) => ka$2(e, t, n), e.safeEncode = (t, n) => Aa$2(e, t, n), e.safeDecode = (t, n) => ja$2(e, t, n), e.safeEncodeAsync = async (t, n) => Ma$2(e, t, n), e.safeDecodeAsync = async (t, n) => Na$2(e, t, n), Fa$2(e, `ZodType`, { - check(...e) { - let t = this.def; - return this.clone(g$5(t, { checks: [...t.checks ?? [], ...e.map((e) => typeof e == `function` ? { _zod: { - check: e, - def: { check: `custom` }, - onattach: [] - } } : e)] }), { parent: !0 }); - }, - with(...e) { - return this.check(...e); - }, - clone(e, t) { - return _$4(this, e, t); - }, - brand() { - return this; - }, - register(e, t) { - return e.add(this, t), this; - }, - refine(e, t) { - return this.check(cs(e, t)); - }, - superRefine(e, t) { - return this.check(ls(e, t)); - }, - overwrite(e) { - return this.check(di$2(e)); - }, - optional() { - return Ho(this); - }, - exactOptional() { - return Wo(this); - }, - nullable() { - return Ko(this); - }, - nullish() { - return Ho(Ko(this)); - }, - nonoptional(e) { - return Qo(this, e); - }, - array() { - return xo(this); - }, - or(e) { - return Eo([this, e]); - }, - and(e) { - return Ao(this, e); - }, - transform(e) { - return ns(this, Bo(e)); - }, - default(e) { - return Jo(this, e); - }, - prefault(e) { - return Xo(this, e); - }, - catch(e) { - return es(this, e); - }, - pipe(e) { - return ns(this, e); - }, - readonly() { - return is(this); - }, - describe(e) { - let t = this.clone(); - return hr$2.add(t, { description: e }), t; - }, - meta(...e) { - if (e.length === 0) return hr$2.get(this); - let t = this.clone(); - return hr$2.add(t, e[0]), t; - }, - isOptional() { - return this.safeParse(void 0).success; - }, - isNullable() { - return this.safeParse(null).success; - }, - apply(e) { - return e(this); - } -}), Object.defineProperty(e, "description", { - get() { - return hr$2.get(e)?.description; - }, - configurable: !0 -}), e)); -const Ia$2 = f$5(`_ZodString`, (e, t) => { - qt$5.init(e, t), D$5.init(e, t), e._zod.processJSONSchema = (t, n, r) => Di$2(e, t, n, r); - let n = e._zod.bag; - e.format = n.format ?? null, e.minLength = n.minimum ?? null, e.maxLength = n.maximum ?? null, Fa$2(e, `_ZodString`, { - regex(...e) { - return this.check(ai$2(...e)); - }, - includes(...e) { - return this.check(ci$2(...e)); - }, - startsWith(...e) { - return this.check(li$2(...e)); - }, - endsWith(...e) { - return this.check(ui$2(...e)); - }, - min(...e) { - return this.check(ri$2(...e)); - }, - max(...e) { - return this.check(ni$2(...e)); - }, - length(...e) { - return this.check(ii$2(...e)); - }, - nonempty(...e) { - return this.check(ri$2(1, ...e)); - }, - lowercase(e) { - return this.check(oi$2(e)); - }, - uppercase(e) { - return this.check(si$2(e)); - }, - trim() { - return this.check(pi$2()); - }, - normalize(...e) { - return this.check(fi$2(...e)); - }, - toLowerCase() { - return this.check(mi$2()); - }, - toUpperCase() { - return this.check(hi$2()); - }, - slugify() { - return this.check(gi$2()); - } - }); -}); -const La$2 = f$5(`ZodString`, (e, t) => { - qt$5.init(e, t), Ia$2.init(e, t), e.email = (t) => e.check(_r$2(za$2, t)), e.url = (t) => e.check(Cr$2(Ha$2, t)), e.jwt = (t) => e.check(Rr$2(io, t)), e.emoji = (t) => e.check(wr$2(Ua$2, t)), e.guid = (t) => e.check(vr$2(Ba$2, t)), e.uuid = (t) => e.check(yr$2(Va$2, t)), e.uuidv4 = (t) => e.check(br$2(Va$2, t)), e.uuidv6 = (t) => e.check(xr$2(Va$2, t)), e.uuidv7 = (t) => e.check(Sr$2(Va$2, t)), e.nanoid = (t) => e.check(Tr$2(Wa$2, t)), e.guid = (t) => e.check(vr$2(Ba$2, t)), e.cuid = (t) => e.check(Er$2(Ga$2, t)), e.cuid2 = (t) => e.check(Dr$2(Ka$2, t)), e.ulid = (t) => e.check(Or$2(qa$2, t)), e.base64 = (t) => e.check(Fr$2(eo$1, t)), e.base64url = (t) => e.check(Ir$2(no, t)), e.xid = (t) => e.check(kr$2(Ja$1, t)), e.ksuid = (t) => e.check(Ar$2(Ya$1, t)), e.ipv4 = (t) => e.check(jr$2(Xa$1, t)), e.ipv6 = (t) => e.check(Mr$2(Za$1, t)), e.cidrv4 = (t) => e.check(Nr$2(Qa$1, t)), e.cidrv6 = (t) => e.check(Pr$2($a$1, t)), e.e164 = (t) => e.check(Lr$2(ro, t)), e.datetime = (t) => e.check(ha$2(t)), e.date = (t) => e.check(_a$2(t)), e.time = (t) => e.check(ya$2(t)), e.duration = (t) => e.check(xa$2(t)); -}); -function Ra$2(e) { - return gr$2(La$2, e); -} -const O$5 = f$5(`ZodStringFormat`, (e, t) => { - C$6.init(e, t), Ia$2.init(e, t); -}); -const za$2 = f$5(`ZodEmail`, (e, t) => { - Xt$4.init(e, t), O$5.init(e, t); -}); -const Ba$2 = f$5(`ZodGUID`, (e, t) => { - Jt$5.init(e, t), O$5.init(e, t); -}); -const Va$2 = f$5(`ZodUUID`, (e, t) => { - Yt$4.init(e, t), O$5.init(e, t); -}); -const Ha$2 = f$5(`ZodURL`, (e, t) => { - Zt$4.init(e, t), O$5.init(e, t); -}); -const Ua$2 = f$5(`ZodEmoji`, (e, t) => { - Qt$4.init(e, t), O$5.init(e, t); -}); -const Wa$2 = f$5(`ZodNanoID`, (e, t) => { - $t$4.init(e, t), O$5.init(e, t); -}); -const Ga$2 = f$5(`ZodCUID`, (e, t) => { - en$4.init(e, t), O$5.init(e, t); -}); -const Ka$2 = f$5(`ZodCUID2`, (e, t) => { - tn$4.init(e, t), O$5.init(e, t); -}); -const qa$2 = f$5(`ZodULID`, (e, t) => { - nn$4.init(e, t), O$5.init(e, t); -}); -const Ja$1 = f$5(`ZodXID`, (e, t) => { - rn$4.init(e, t), O$5.init(e, t); -}); -const Ya$1 = f$5(`ZodKSUID`, (e, t) => { - an$4.init(e, t), O$5.init(e, t); -}); -const Xa$1 = f$5(`ZodIPv4`, (e, t) => { - un$4.init(e, t), O$5.init(e, t); -}); -const Za$1 = f$5(`ZodIPv6`, (e, t) => { - dn$4.init(e, t), O$5.init(e, t); -}); -const Qa$1 = f$5(`ZodCIDRv4`, (e, t) => { - fn$4.init(e, t), O$5.init(e, t); -}); -const $a$1 = f$5(`ZodCIDRv6`, (e, t) => { - pn$4.init(e, t), O$5.init(e, t); -}); -const eo$1 = f$5(`ZodBase64`, (e, t) => { - hn$4.init(e, t), O$5.init(e, t); -}); -function to$1(e) { - return Fr$2(eo$1, e); -} -const no = f$5(`ZodBase64URL`, (e, t) => { - _n$4.init(e, t), O$5.init(e, t); -}); -const ro = f$5(`ZodE164`, (e, t) => { - vn$4.init(e, t), O$5.init(e, t); -}); -const io = f$5(`ZodJWT`, (e, t) => { - bn$4.init(e, t), O$5.init(e, t); -}); -const ao = f$5(`ZodNumber`, (e, t) => { - xn$3.init(e, t), D$5.init(e, t), e._zod.processJSONSchema = (t, n, r) => Oi$2(e, t, n, r), Fa$2(e, `ZodNumber`, { - gt(e, t) { - return this.check($r$2(e, t)); - }, - gte(e, t) { - return this.check(ei$2(e, t)); - }, - min(e, t) { - return this.check(ei$2(e, t)); - }, - lt(e, t) { - return this.check(Zr$2(e, t)); - }, - lte(e, t) { - return this.check(Qr$2(e, t)); - }, - max(e, t) { - return this.check(Qr$2(e, t)); - }, - int(e) { - return this.check(co(e)); - }, - safe(e) { - return this.check(co(e)); - }, - positive(e) { - return this.check($r$2(0, e)); - }, - nonnegative(e) { - return this.check(ei$2(0, e)); - }, - negative(e) { - return this.check(Zr$2(0, e)); - }, - nonpositive(e) { - return this.check(Qr$2(0, e)); - }, - multipleOf(e, t) { - return this.check(ti$2(e, t)); - }, - step(e, t) { - return this.check(ti$2(e, t)); - }, - finite() { - return this; - } - }); - let n = e._zod.bag; - e.minValue = Math.max(n.minimum ?? -Infinity, n.exclusiveMinimum ?? -Infinity) ?? null, e.maxValue = Math.min(n.maximum ?? Infinity, n.exclusiveMaximum ?? Infinity) ?? null, e.isInt = (n.format ?? ``).includes(`int`) || Number.isSafeInteger(n.multipleOf ?? .5), e.isFinite = !0, e.format = n.format ?? null; -}); -function oo(e) { - return Ur$2(ao, e); -} -const so = f$5(`ZodNumberFormat`, (e, t) => { - Sn$3.init(e, t), ao.init(e, t); -}); -function co(e) { - return Gr$2(so, e); -} -const lo = f$5(`ZodBoolean`, (e, t) => { - Cn$3.init(e, t), D$5.init(e, t), e._zod.processJSONSchema = (t, n, r) => ki$2(e, t, n, r); -}); -function uo(e) { - return Kr$2(lo, e); -} -const fo = f$5(`ZodNull`, (e, t) => { - wn$3.init(e, t), D$5.init(e, t), e._zod.processJSONSchema = (t, n, r) => Mi$2(e, t, n, r); -}); -function po(e) { - return qr$2(fo, e); -} -const mo = f$5(`ZodAny`, (e, t) => { - Tn$3.init(e, t), D$5.init(e, t), e._zod.processJSONSchema = (e, t, n) => void 0; -}); -function ho() { - return Jr$2(mo); -} -const go = f$5(`ZodUnknown`, (e, t) => { - En$3.init(e, t), D$5.init(e, t), e._zod.processJSONSchema = (e, t, n) => void 0; -}); -function _o() { - return Yr$2(go); -} -const vo = f$5(`ZodNever`, (e, t) => { - Dn$3.init(e, t), D$5.init(e, t), e._zod.processJSONSchema = (t, n, r) => Fi$2(e, t, n, r); -}); -function yo(e) { - return Xr$2(vo, e); -} -const bo = f$5(`ZodArray`, (e, t) => { - kn$3.init(e, t), D$5.init(e, t), e._zod.processJSONSchema = (t, n, r) => Xi$2(e, t, n, r), e.element = t.element, Fa$2(e, `ZodArray`, { - min(e, t) { - return this.check(ri$2(e, t)); - }, - nonempty(e) { - return this.check(ri$2(1, e)); - }, - max(e, t) { - return this.check(ni$2(e, t)); - }, - length(e, t) { - return this.check(ii$2(e, t)); - }, - unwrap() { - return this.element; - } - }); -}); -function xo(e, t) { - return _i$2(bo, e, t); -} -const So = f$5(`ZodObject`, (e, t) => { - Pn$3.init(e, t), D$5.init(e, t), e._zod.processJSONSchema = (t, n, r) => Zi$2(e, t, n, r), h$5(e, `shape`, () => t.shape), Fa$2(e, `ZodObject`, { - keyof() { - return Io(Object.keys(this._zod.def.shape)); - }, - catchall(e) { - return this.clone({ - ...this._zod.def, - catchall: e - }); - }, - passthrough() { - return this.clone({ - ...this._zod.def, - catchall: _o() - }); - }, - loose() { - return this.clone({ - ...this._zod.def, - catchall: _o() - }); - }, - strict() { - return this.clone({ - ...this._zod.def, - catchall: yo() - }); - }, - strip() { - return this.clone({ - ...this._zod.def, - catchall: void 0 - }); - }, - extend(e) { - return Ce$6(this, e); - }, - safeExtend(e) { - return we$6(this, e); - }, - merge(e) { - return Te$6(this, e); - }, - pick(e) { - return xe$6(this, e); - }, - omit(e) { - return Se$6(this, e); - }, - partial(...e) { - return Ee$6(Vo, this, e[0]); - }, - required(...e) { - return De$6(Zo, this, e[0]); - } - }); -}); -function Co(e, t) { - return new So({ - type: `object`, - shape: e ?? {}, - ...v$5(t) - }); -} -function wo(e, t) { - return new So({ - type: `object`, - shape: e, - catchall: _o(), - ...v$5(t) - }); -} -const To = f$5(`ZodUnion`, (e, t) => { - In$2.init(e, t), D$5.init(e, t), e._zod.processJSONSchema = (t, n, r) => Qi$2(e, t, n, r), e.options = t.options; -}); -function Eo(e, t) { - return new To({ - type: `union`, - options: e, - ...v$5(t) - }); -} -const Do = f$5(`ZodDiscriminatedUnion`, (e, t) => { - To.init(e, t), Ln$2.init(e, t); -}); -function Oo(e, t, n) { - return new Do({ - type: `union`, - options: t, - discriminator: e, - ...v$5(n) - }); -} -const ko = f$5(`ZodIntersection`, (e, t) => { - Rn$2.init(e, t), D$5.init(e, t), e._zod.processJSONSchema = (t, n, r) => $i$2(e, t, n, r); -}); -function Ao(e, t) { - return new ko({ - type: `intersection`, - left: e, - right: t - }); -} -const jo = f$5(`ZodTuple`, (e, t) => { - Vn$2.init(e, t), D$5.init(e, t), e._zod.processJSONSchema = (t, n, r) => ea$2(e, t, n, r), e.rest = (t) => e.clone({ - ...e._zod.def, - rest: t - }); -}); -function Mo(e, t, n) { - let r = t instanceof S$5; - return new jo({ - type: `tuple`, - items: e, - rest: r ? t : null, - ...v$5(r ? n : t) - }); -} -const No = f$5(`ZodRecord`, (e, t) => { - Gn$2.init(e, t), D$5.init(e, t), e._zod.processJSONSchema = (t, n, r) => ta$2(e, t, n, r), e.keyType = t.keyType, e.valueType = t.valueType; -}); -function Po(e, t, n) { - return !t || !t._zod ? new No({ - type: `record`, - keyType: Ra$2(), - valueType: e, - ...v$5(t) - }) : new No({ - type: `record`, - keyType: e, - valueType: t, - ...v$5(n) - }); -} -const Fo = f$5(`ZodEnum`, (e, t) => { - Kn$2.init(e, t), D$5.init(e, t), e._zod.processJSONSchema = (t, n, r) => zi$2(e, t, n, r), e.enum = t.entries, e.options = Object.values(t.entries); - let n = new Set(Object.keys(t.entries)); - e.extract = (e, r) => { - let i = {}; - for (let r of e) if (n.has(r)) i[r] = t.entries[r]; - else throw Error(`Key ${r} not found in enum`); - return new Fo({ - ...t, - checks: [], - ...v$5(r), - entries: i - }); - }, e.exclude = (e, r) => { - let i = { ...t.entries }; - for (let t of e) if (n.has(t)) delete i[t]; - else throw Error(`Key ${t} not found in enum`); - return new Fo({ - ...t, - checks: [], - ...v$5(r), - entries: i - }); - }; -}); -function Io(e, t) { - return new Fo({ - type: `enum`, - entries: Array.isArray(e) ? Object.fromEntries(e.map((e) => [e, e])) : e, - ...v$5(t) - }); -} -const Lo = f$5(`ZodLiteral`, (e, t) => { - qn$2.init(e, t), D$5.init(e, t), e._zod.processJSONSchema = (t, n, r) => Bi$2(e, t, n, r), e.values = new Set(t.values), Object.defineProperty(e, "value", { get() { - if (t.values.length > 1) throw Error("This schema contains multiple valid literal values. Use `.values` instead."); - return t.values[0]; - } }); -}); -function Ro(e, t) { - return new Lo({ - type: `literal`, - values: Array.isArray(e) ? e : [e], - ...v$5(t) - }); -} -const zo = f$5(`ZodTransform`, (e, t) => { - Jn$2.init(e, t), D$5.init(e, t), e._zod.processJSONSchema = (t, n, r) => qi$2(e, t, n, r), e._zod.parse = (n, r) => { - if (r.direction === `backward`) throw new ee$4(e.constructor.name); - n.addIssue = (r) => { - if (typeof r == `string`) n.issues.push(Me$6(r, n.value, t)); - else { - let t = r; - t.fatal && (t.continue = !1), t.code ??= `custom`, t.input ??= n.value, t.inst ??= e, n.issues.push(Me$6(t)); - } - }; - let i = t.transform(n.value, n); - return i instanceof Promise ? i.then((e) => (n.value = e, n.fallback = !0, n)) : (n.value = i, n.fallback = !0, n); - }; -}); -function Bo(e) { - return new zo({ - type: `transform`, - transform: e - }); -} -const Vo = f$5(`ZodOptional`, (e, t) => { - Xn$3.init(e, t), D$5.init(e, t), e._zod.processJSONSchema = (t, n, r) => ua$2(e, t, n, r), e.unwrap = () => e._zod.def.innerType; -}); -function Ho(e) { - return new Vo({ - type: `optional`, - innerType: e - }); -} -const Uo = f$5(`ZodExactOptional`, (e, t) => { - Zn$2.init(e, t), D$5.init(e, t), e._zod.processJSONSchema = (t, n, r) => ua$2(e, t, n, r), e.unwrap = () => e._zod.def.innerType; -}); -function Wo(e) { - return new Uo({ - type: `optional`, - innerType: e - }); -} -const Go = f$5(`ZodNullable`, (e, t) => { - Qn$2.init(e, t), D$5.init(e, t), e._zod.processJSONSchema = (t, n, r) => na$2(e, t, n, r), e.unwrap = () => e._zod.def.innerType; -}); -function Ko(e) { - return new Go({ - type: `nullable`, - innerType: e - }); -} -const qo = f$5(`ZodDefault`, (e, t) => { - $n$2.init(e, t), D$5.init(e, t), e._zod.processJSONSchema = (t, n, r) => ia$2(e, t, n, r), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap; -}); -function Jo(e, t) { - return new qo({ - type: `default`, - innerType: e, - get defaultValue() { - return typeof t == `function` ? t() : ge$6(t); - } - }); -} -const Yo = f$5(`ZodPrefault`, (e, t) => { - tr$2.init(e, t), D$5.init(e, t), e._zod.processJSONSchema = (t, n, r) => aa$2(e, t, n, r), e.unwrap = () => e._zod.def.innerType; -}); -function Xo(e, t) { - return new Yo({ - type: `prefault`, - innerType: e, - get defaultValue() { - return typeof t == `function` ? t() : ge$6(t); - } - }); -} -const Zo = f$5(`ZodNonOptional`, (e, t) => { - nr$2.init(e, t), D$5.init(e, t), e._zod.processJSONSchema = (t, n, r) => ra$2(e, t, n, r), e.unwrap = () => e._zod.def.innerType; -}); -function Qo(e, t) { - return new Zo({ - type: `nonoptional`, - innerType: e, - ...v$5(t) - }); -} -const $o = f$5(`ZodCatch`, (e, t) => { - ir$2.init(e, t), D$5.init(e, t), e._zod.processJSONSchema = (t, n, r) => oa$2(e, t, n, r), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap; -}); -function es(e, t) { - return new $o({ - type: `catch`, - innerType: e, - catchValue: typeof t == `function` ? t : () => t - }); -} -const ts = f$5(`ZodPipe`, (e, t) => { - ar$2.init(e, t), D$5.init(e, t), e._zod.processJSONSchema = (t, n, r) => sa$2(e, t, n, r), e.in = t.in, e.out = t.out; -}); -function ns(e, t) { - return new ts({ - type: `pipe`, - in: e, - out: t - }); -} -const rs = f$5(`ZodReadonly`, (e, t) => { - sr$2.init(e, t), D$5.init(e, t), e._zod.processJSONSchema = (t, n, r) => ca$2(e, t, n, r), e.unwrap = () => e._zod.def.innerType; -}); -function is(e) { - return new rs({ - type: `readonly`, - innerType: e - }); -} -const as = f$5(`ZodLazy`, (e, t) => { - lr$2.init(e, t), D$5.init(e, t), e._zod.processJSONSchema = (t, n, r) => da$2(e, t, n, r), e.unwrap = () => e._zod.def.getter(); -}); -function os(e) { - return new as({ - type: `lazy`, - getter: e - }); -} -const ss = f$5(`ZodCustom`, (e, t) => { - ur$2.init(e, t), D$5.init(e, t), e._zod.processJSONSchema = (t, n, r) => Gi$2(e, t, n, r); -}); -function cs(e, t = {}) { - return vi$2(ss, e, t); -} -function ls(e, t) { - return yi$2(e, t); -} -var k$6; -(function(e) { - e.assertEqual = (e) => {}; - function t(e) {} - e.assertIs = t; - function n(e) { - throw Error(); - } - e.assertNever = n, e.arrayToEnum = (e) => { - let t = {}; - for (let n of e) t[n] = n; - return t; - }, e.getValidEnumValues = (t) => { - let n = e.objectKeys(t).filter((e) => typeof t[t[e]] != `number`), r = {}; - for (let e of n) r[e] = t[e]; - return e.objectValues(r); - }, e.objectValues = (t) => e.objectKeys(t).map(function(e) { - return t[e]; - }), e.objectKeys = typeof Object.keys == `function` ? (e) => Object.keys(e) : (e) => { - let t = []; - for (let n in e) Object.prototype.hasOwnProperty.call(e, n) && t.push(n); - return t; - }, e.find = (e, t) => { - for (let n of e) if (t(n)) return n; - }, e.isInteger = typeof Number.isInteger == `function` ? (e) => Number.isInteger(e) : (e) => typeof e == `number` && Number.isFinite(e) && Math.floor(e) === e; - function r(e, t = ` | `) { - return e.map((e) => typeof e == `string` ? `'${e}'` : e).join(t); - } - e.joinValues = r, e.jsonStringifyReplacer = (e, t) => typeof t == `bigint` ? t.toString() : t; -})(k$6 ||= {}); -var us; -(function(e) { - e.mergeShapes = (e, t) => ({ - ...e, - ...t - }); -})(us ||= {}); -const A$5 = k$6.arrayToEnum([ - `string`, - `nan`, - `number`, - `integer`, - `float`, - `boolean`, - `date`, - `bigint`, - `symbol`, - `function`, - `undefined`, - `null`, - `array`, - `object`, - `unknown`, - `promise`, - `void`, - `never`, - `map`, - `set` -]); -const j$5 = (e) => { - switch (typeof e) { - case `undefined`: return A$5.undefined; - case `string`: return A$5.string; - case `number`: return Number.isNaN(e) ? A$5.nan : A$5.number; - case `boolean`: return A$5.boolean; - case `function`: return A$5.function; - case `bigint`: return A$5.bigint; - case `symbol`: return A$5.symbol; - case `object`: return Array.isArray(e) ? A$5.array : e === null ? A$5.null : e.then && typeof e.then == `function` && e.catch && typeof e.catch == `function` ? A$5.promise : typeof Map < `u` && e instanceof Map ? A$5.map : typeof Set < `u` && e instanceof Set ? A$5.set : typeof Date < `u` && e instanceof Date ? A$5.date : A$5.object; - default: return A$5.unknown; - } -}; -const M$5 = k$6.arrayToEnum([ - `invalid_type`, - `invalid_literal`, - `custom`, - `invalid_union`, - `invalid_union_discriminator`, - `invalid_enum_value`, - `unrecognized_keys`, - `invalid_arguments`, - `invalid_return_type`, - `invalid_date`, - `invalid_string`, - `too_small`, - `too_big`, - `invalid_intersection_types`, - `not_multiple_of`, - `not_finite` -]); -var N$5 = class e extends Error { - get errors() { - return this.issues; - } - constructor(e) { - super(), this.issues = [], this.addIssue = (e) => { - this.issues = [...this.issues, e]; - }, this.addIssues = (e = []) => { - this.issues = [...this.issues, ...e]; - }; - let t = new.target.prototype; - Object.setPrototypeOf ? Object.setPrototypeOf(this, t) : this.__proto__ = t, this.name = `ZodError`, this.issues = e; - } - format(e) { - let t = e || function(e) { - return e.message; - }, n = { _errors: [] }, r = (e) => { - for (let i of e.issues) if (i.code === `invalid_union`) i.unionErrors.map(r); - else if (i.code === `invalid_return_type`) r(i.returnTypeError); - else if (i.code === `invalid_arguments`) r(i.argumentsError); - else if (i.path.length === 0) n._errors.push(t(i)); - else { - let e = n, r = 0; - for (; r < i.path.length;) { - let n = i.path[r]; - r === i.path.length - 1 ? (e[n] = e[n] || { _errors: [] }, e[n]._errors.push(t(i))) : e[n] = e[n] || { _errors: [] }, e = e[n], r++; - } - } - }; - return r(this), n; - } - static assert(t) { - if (!(t instanceof e)) throw Error(`Not a ZodError: ${t}`); - } - toString() { - return this.message; - } - get message() { - return JSON.stringify(this.issues, k$6.jsonStringifyReplacer, 2); - } - get isEmpty() { - return this.issues.length === 0; - } - flatten(e = (e) => e.message) { - let t = Object.create(null), n = []; - for (let r of this.issues) if (r.path.length > 0) { - let n = r.path[0]; - t[n] = t[n] || [], t[n].push(e(r)); - } else n.push(e(r)); - return { - formErrors: n, - fieldErrors: t - }; - } - get formErrors() { - return this.flatten(); - } -}; -N$5.create = (e) => new N$5(e); -const ds = (e, t) => { - let n; - switch (e.code) { - case M$5.invalid_type: - n = e.received === A$5.undefined ? `Required` : `Expected ${e.expected}, received ${e.received}`; - break; - case M$5.invalid_literal: - n = `Invalid literal value, expected ${JSON.stringify(e.expected, k$6.jsonStringifyReplacer)}`; - break; - case M$5.unrecognized_keys: - n = `Unrecognized key(s) in object: ${k$6.joinValues(e.keys, `, `)}`; - break; - case M$5.invalid_union: - n = `Invalid input`; - break; - case M$5.invalid_union_discriminator: - n = `Invalid discriminator value. Expected ${k$6.joinValues(e.options)}`; - break; - case M$5.invalid_enum_value: - n = `Invalid enum value. Expected ${k$6.joinValues(e.options)}, received '${e.received}'`; - break; - case M$5.invalid_arguments: - n = `Invalid function arguments`; - break; - case M$5.invalid_return_type: - n = `Invalid function return type`; - break; - case M$5.invalid_date: - n = `Invalid date`; - break; - case M$5.invalid_string: - typeof e.validation == `object` ? `includes` in e.validation ? (n = `Invalid input: must include "${e.validation.includes}"`, typeof e.validation.position == `number` && (n = `${n} at one or more positions greater than or equal to ${e.validation.position}`)) : `startsWith` in e.validation ? n = `Invalid input: must start with "${e.validation.startsWith}"` : `endsWith` in e.validation ? n = `Invalid input: must end with "${e.validation.endsWith}"` : k$6.assertNever(e.validation) : n = e.validation === `regex` ? `Invalid` : `Invalid ${e.validation}`; - break; - case M$5.too_small: - n = e.type === `array` ? `Array must contain ${e.exact ? `exactly` : e.inclusive ? `at least` : `more than`} ${e.minimum} element(s)` : e.type === `string` ? `String must contain ${e.exact ? `exactly` : e.inclusive ? `at least` : `over`} ${e.minimum} character(s)` : e.type === `number` || e.type === `bigint` ? `Number must be ${e.exact ? `exactly equal to ` : e.inclusive ? `greater than or equal to ` : `greater than `}${e.minimum}` : e.type === `date` ? `Date must be ${e.exact ? `exactly equal to ` : e.inclusive ? `greater than or equal to ` : `greater than `}${new Date(Number(e.minimum))}` : `Invalid input`; - break; - case M$5.too_big: - n = e.type === `array` ? `Array must contain ${e.exact ? `exactly` : e.inclusive ? `at most` : `less than`} ${e.maximum} element(s)` : e.type === `string` ? `String must contain ${e.exact ? `exactly` : e.inclusive ? `at most` : `under`} ${e.maximum} character(s)` : e.type === `number` ? `Number must be ${e.exact ? `exactly` : e.inclusive ? `less than or equal to` : `less than`} ${e.maximum}` : e.type === `bigint` ? `BigInt must be ${e.exact ? `exactly` : e.inclusive ? `less than or equal to` : `less than`} ${e.maximum}` : e.type === `date` ? `Date must be ${e.exact ? `exactly` : e.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(Number(e.maximum))}` : `Invalid input`; - break; - case M$5.custom: - n = `Invalid input`; - break; - case M$5.invalid_intersection_types: - n = `Intersection results could not be merged`; - break; - case M$5.not_multiple_of: - n = `Number must be a multiple of ${e.multipleOf}`; - break; - case M$5.not_finite: - n = `Number must be finite`; - break; - default: n = t.defaultError, k$6.assertNever(e); - } - return { message: n }; -}; -let fs = ds; -function ps() { - return fs; -} -const ms = (e) => { - let { data: t, path: n, errorMaps: r, issueData: i } = e, a = [...n, ...i.path || []], o = { - ...i, - path: a - }; - if (i.message !== void 0) return { - ...i, - path: a, - message: i.message - }; - let s = ``, c = r.filter((e) => !!e).slice().reverse(); - for (let e of c) s = e(o, { - data: t, - defaultError: s - }).message; - return { - ...i, - path: a, - message: s - }; -}; -function P$5(e, t) { - let n = ps(), r = ms({ - issueData: t, - data: e.data, - path: e.path, - errorMaps: [ - e.common.contextualErrorMap, - e.schemaErrorMap, - n, - n === ds ? void 0 : ds - ].filter((e) => !!e) - }); - e.common.issues.push(r); -} -var F$5 = class e { - constructor() { - this.value = `valid`; - } - dirty() { - this.value === `valid` && (this.value = `dirty`); - } - abort() { - this.value !== `aborted` && (this.value = `aborted`); - } - static mergeArray(e, t) { - let n = []; - for (let r of t) { - if (r.status === `aborted`) return I$5; - r.status === `dirty` && e.dirty(), n.push(r.value); - } - return { - status: e.value, - value: n - }; - } - static async mergeObjectAsync(t, n) { - let r = []; - for (let e of n) { - let t = await e.key, n = await e.value; - r.push({ - key: t, - value: n - }); - } - return e.mergeObjectSync(t, r); - } - static mergeObjectSync(e, t) { - let n = {}; - for (let r of t) { - let { key: t, value: i } = r; - if (t.status === `aborted` || i.status === `aborted`) return I$5; - t.status === `dirty` && e.dirty(), i.status === `dirty` && e.dirty(), t.value !== `__proto__` && (i.value !== void 0 || r.alwaysSet) && (n[t.value] = i.value); - } - return { - status: e.value, - value: n - }; - } -}; -const I$5 = Object.freeze({ status: `aborted` }); -const hs = (e) => ({ - status: `dirty`, - value: e -}); -const L$5 = (e) => ({ - status: `valid`, - value: e -}); -const gs = (e) => e.status === `aborted`; -const _s = (e) => e.status === `dirty`; -const vs = (e) => e.status === `valid`; -const ys = (e) => typeof Promise < `u` && e instanceof Promise; -var R$5; -(function(e) { - e.errToObj = (e) => typeof e == `string` ? { message: e } : e || {}, e.toString = (e) => typeof e == `string` ? e : e?.message; -})(R$5 ||= {}); -var z$5 = class { - constructor(e, t, n, r) { - this._cachedPath = [], this.parent = e, this.data = t, this._path = n, this._key = r; - } - get path() { - return this._cachedPath.length || (Array.isArray(this._key) ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath; - } -}; -const bs = (e, t) => { - if (vs(t)) return { - success: !0, - data: t.value - }; - if (!e.common.issues.length) throw Error(`Validation failed but no issues detected.`); - return { - success: !1, - get error() { - if (this._error) return this._error; - let t = new N$5(e.common.issues); - return this._error = t, this._error; - } - }; -}; -function B$5(e) { - if (!e) return {}; - let { errorMap: t, invalid_type_error: n, required_error: r, description: i } = e; - if (t && (n || r)) throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`); - return t ? { - errorMap: t, - description: i - } : { - errorMap: (t, i) => { - let { message: a } = e; - return t.code === `invalid_enum_value` ? { message: a ?? i.defaultError } : i.data === void 0 ? { message: a ?? r ?? i.defaultError } : t.code === `invalid_type` ? { message: a ?? n ?? i.defaultError } : { message: i.defaultError }; - }, - description: i - }; -} -var V$5 = class { - get description() { - return this._def.description; - } - _getType(e) { - return j$5(e.data); - } - _getOrReturnCtx(e, t) { - return t || { - common: e.parent.common, - data: e.data, - parsedType: j$5(e.data), - schemaErrorMap: this._def.errorMap, - path: e.path, - parent: e.parent - }; - } - _processInputParams(e) { - return { - status: new F$5(), - ctx: { - common: e.parent.common, - data: e.data, - parsedType: j$5(e.data), - schemaErrorMap: this._def.errorMap, - path: e.path, - parent: e.parent - } - }; - } - _parseSync(e) { - let t = this._parse(e); - if (ys(t)) throw Error(`Synchronous parse encountered promise.`); - return t; - } - _parseAsync(e) { - let t = this._parse(e); - return Promise.resolve(t); - } - parse(e, t) { - let n = this.safeParse(e, t); - if (n.success) return n.data; - throw n.error; - } - safeParse(e, t) { - let n = { - common: { - issues: [], - async: t?.async ?? !1, - contextualErrorMap: t?.errorMap - }, - path: t?.path || [], - schemaErrorMap: this._def.errorMap, - parent: null, - data: e, - parsedType: j$5(e) - }; - return bs(n, this._parseSync({ - data: e, - path: n.path, - parent: n - })); - } - "~validate"(e) { - let t = { - common: { - issues: [], - async: !!this[`~standard`].async - }, - path: [], - schemaErrorMap: this._def.errorMap, - parent: null, - data: e, - parsedType: j$5(e) - }; - if (!this[`~standard`].async) try { - let n = this._parseSync({ - data: e, - path: [], - parent: t - }); - return vs(n) ? { value: n.value } : { issues: t.common.issues }; - } catch (e) { - e?.message?.toLowerCase()?.includes(`encountered`) && (this[`~standard`].async = !0), t.common = { - issues: [], - async: !0 - }; - } - return this._parseAsync({ - data: e, - path: [], - parent: t - }).then((e) => vs(e) ? { value: e.value } : { issues: t.common.issues }); - } - async parseAsync(e, t) { - let n = await this.safeParseAsync(e, t); - if (n.success) return n.data; - throw n.error; - } - async safeParseAsync(e, t) { - let n = { - common: { - issues: [], - contextualErrorMap: t?.errorMap, - async: !0 - }, - path: t?.path || [], - schemaErrorMap: this._def.errorMap, - parent: null, - data: e, - parsedType: j$5(e) - }, r = this._parse({ - data: e, - path: n.path, - parent: n - }); - return bs(n, await (ys(r) ? r : Promise.resolve(r))); - } - refine(e, t) { - let n = (e) => typeof t == `string` || t === void 0 ? { message: t } : typeof t == `function` ? t(e) : t; - return this._refinement((t, r) => { - let i = e(t), a = () => r.addIssue({ - code: M$5.custom, - ...n(t) - }); - return typeof Promise < `u` && i instanceof Promise ? i.then((e) => e ? !0 : (a(), !1)) : i ? !0 : (a(), !1); - }); - } - refinement(e, t) { - return this._refinement((n, r) => e(n) ? !0 : (r.addIssue(typeof t == `function` ? t(n, r) : t), !1)); - } - _refinement(e) { - return new G$6({ - schema: this, - typeName: q$5.ZodEffects, - effect: { - type: `refinement`, - refinement: e - } - }); - } - superRefine(e) { - return this._refinement(e); - } - constructor(e) { - this.spa = this.safeParseAsync, this._def = e, this.parse = this.parse.bind(this), this.safeParse = this.safeParse.bind(this), this.parseAsync = this.parseAsync.bind(this), this.safeParseAsync = this.safeParseAsync.bind(this), this.spa = this.spa.bind(this), this.refine = this.refine.bind(this), this.refinement = this.refinement.bind(this), this.superRefine = this.superRefine.bind(this), this.optional = this.optional.bind(this), this.nullable = this.nullable.bind(this), this.nullish = this.nullish.bind(this), this.array = this.array.bind(this), this.promise = this.promise.bind(this), this.or = this.or.bind(this), this.and = this.and.bind(this), this.transform = this.transform.bind(this), this.brand = this.brand.bind(this), this.default = this.default.bind(this), this.catch = this.catch.bind(this), this.describe = this.describe.bind(this), this.pipe = this.pipe.bind(this), this.readonly = this.readonly.bind(this), this.isNullable = this.isNullable.bind(this), this.isOptional = this.isOptional.bind(this), this[`~standard`] = { - version: 1, - vendor: `zod`, - validate: (e) => this[`~validate`](e) - }; - } - optional() { - return K$5.create(this, this._def); - } - nullable() { - return yc.create(this, this._def); - } - nullish() { - return this.nullable().optional(); - } - array() { - return nc.create(this); - } - promise() { - return vc.create(this, this._def); - } - or(e) { - return ic.create([this, e], this._def); - } - and(e) { - return sc.create(this, e, this._def); - } - transform(e) { - return new G$6({ - ...B$5(this._def), - schema: this, - typeName: q$5.ZodEffects, - effect: { - type: `transform`, - transform: e - } - }); - } - default(e) { - let t = typeof e == `function` ? e : () => e; - return new bc({ - ...B$5(this._def), - innerType: this, - defaultValue: t, - typeName: q$5.ZodDefault - }); - } - brand() { - return new Cc({ - typeName: q$5.ZodBranded, - type: this, - ...B$5(this._def) - }); - } - catch(e) { - let t = typeof e == `function` ? e : () => e; - return new xc({ - ...B$5(this._def), - innerType: this, - catchValue: t, - typeName: q$5.ZodCatch - }); - } - describe(e) { - let t = this.constructor; - return new t({ - ...this._def, - description: e - }); - } - pipe(e) { - return wc.create(this, e); - } - readonly() { - return Tc.create(this); - } - isOptional() { - return this.safeParse(void 0).success; - } - isNullable() { - return this.safeParse(null).success; - } -}; -const xs = /^c[^\s-]{8,}$/i; -const Ss = /^[0-9a-z]+$/; -const Cs = /^[0-9A-HJKMNP-TV-Z]{26}$/i; -const ws = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i; -const Ts = /^[a-z0-9_-]{21}$/i; -const Es = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/; -const Ds = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/; -const Os = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i; -let ks; -const As = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/; -const js = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/; -const Ms = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/; -const Ns = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/; -const Ps = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/; -const Fs = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/; -const Is = `((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`; -const Ls = RegExp(`^${Is}$`); -function Rs(e) { - let t = `[0-5]\\d`; - e.precision ? t = `${t}\\.\\d{${e.precision}}` : e.precision ?? (t = `${t}(\\.\\d+)?`); - let n = e.precision ? `+` : `?`; - return `([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`; -} -function zs(e) { - return RegExp(`^${Rs(e)}$`); -} -function Bs(e) { - let t = `${Is}T${Rs(e)}`, n = []; - return n.push(e.local ? `Z?` : `Z`), e.offset && n.push(`([+-]\\d{2}:?\\d{2})`), t = `${t}(${n.join(`|`)})`, RegExp(`^${t}$`); -} -function Vs(e, t) { - return !!((t === `v4` || !t) && As.test(e) || (t === `v6` || !t) && Ms.test(e)); -} -function Hs(e, t) { - if (!Es.test(e)) return !1; - try { - let [n] = e.split(`.`); - if (!n) return !1; - let r = n.replace(/-/g, `+`).replace(/_/g, `/`).padEnd(n.length + (4 - n.length % 4) % 4, `=`), i = JSON.parse(atob(r)); - return !(typeof i != `object` || !i || `typ` in i && i?.typ !== `JWT` || !i.alg || t && i.alg !== t); - } catch { - return !1; - } -} -function Us(e, t) { - return !!((t === `v4` || !t) && js.test(e) || (t === `v6` || !t) && Ns.test(e)); -} -var Ws = class e extends V$5 { - _parse(e) { - if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== A$5.string) { - let t = this._getOrReturnCtx(e); - return P$5(t, { - code: M$5.invalid_type, - expected: A$5.string, - received: t.parsedType - }), I$5; - } - let t = new F$5(), n; - for (let r of this._def.checks) if (r.kind === `min`) e.data.length < r.value && (n = this._getOrReturnCtx(e, n), P$5(n, { - code: M$5.too_small, - minimum: r.value, - type: `string`, - inclusive: !0, - exact: !1, - message: r.message - }), t.dirty()); - else if (r.kind === `max`) e.data.length > r.value && (n = this._getOrReturnCtx(e, n), P$5(n, { - code: M$5.too_big, - maximum: r.value, - type: `string`, - inclusive: !0, - exact: !1, - message: r.message - }), t.dirty()); - else if (r.kind === `length`) { - let i = e.data.length > r.value, a = e.data.length < r.value; - (i || a) && (n = this._getOrReturnCtx(e, n), i ? P$5(n, { - code: M$5.too_big, - maximum: r.value, - type: `string`, - inclusive: !0, - exact: !0, - message: r.message - }) : a && P$5(n, { - code: M$5.too_small, - minimum: r.value, - type: `string`, - inclusive: !0, - exact: !0, - message: r.message - }), t.dirty()); - } else if (r.kind === `email`) Os.test(e.data) || (n = this._getOrReturnCtx(e, n), P$5(n, { - validation: `email`, - code: M$5.invalid_string, - message: r.message - }), t.dirty()); - else if (r.kind === `emoji`) ks ||= RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`, `u`), ks.test(e.data) || (n = this._getOrReturnCtx(e, n), P$5(n, { - validation: `emoji`, - code: M$5.invalid_string, - message: r.message - }), t.dirty()); - else if (r.kind === `uuid`) ws.test(e.data) || (n = this._getOrReturnCtx(e, n), P$5(n, { - validation: `uuid`, - code: M$5.invalid_string, - message: r.message - }), t.dirty()); - else if (r.kind === `nanoid`) Ts.test(e.data) || (n = this._getOrReturnCtx(e, n), P$5(n, { - validation: `nanoid`, - code: M$5.invalid_string, - message: r.message - }), t.dirty()); - else if (r.kind === `cuid`) xs.test(e.data) || (n = this._getOrReturnCtx(e, n), P$5(n, { - validation: `cuid`, - code: M$5.invalid_string, - message: r.message - }), t.dirty()); - else if (r.kind === `cuid2`) Ss.test(e.data) || (n = this._getOrReturnCtx(e, n), P$5(n, { - validation: `cuid2`, - code: M$5.invalid_string, - message: r.message - }), t.dirty()); - else if (r.kind === `ulid`) Cs.test(e.data) || (n = this._getOrReturnCtx(e, n), P$5(n, { - validation: `ulid`, - code: M$5.invalid_string, - message: r.message - }), t.dirty()); - else if (r.kind === `url`) try { - new URL(e.data); - } catch { - n = this._getOrReturnCtx(e, n), P$5(n, { - validation: `url`, - code: M$5.invalid_string, - message: r.message - }), t.dirty(); - } - else r.kind === `regex` ? (r.regex.lastIndex = 0, r.regex.test(e.data) || (n = this._getOrReturnCtx(e, n), P$5(n, { - validation: `regex`, - code: M$5.invalid_string, - message: r.message - }), t.dirty())) : r.kind === `trim` ? e.data = e.data.trim() : r.kind === `includes` ? e.data.includes(r.value, r.position) || (n = this._getOrReturnCtx(e, n), P$5(n, { - code: M$5.invalid_string, - validation: { - includes: r.value, - position: r.position - }, - message: r.message - }), t.dirty()) : r.kind === `toLowerCase` ? e.data = e.data.toLowerCase() : r.kind === `toUpperCase` ? e.data = e.data.toUpperCase() : r.kind === `startsWith` ? e.data.startsWith(r.value) || (n = this._getOrReturnCtx(e, n), P$5(n, { - code: M$5.invalid_string, - validation: { startsWith: r.value }, - message: r.message - }), t.dirty()) : r.kind === `endsWith` ? e.data.endsWith(r.value) || (n = this._getOrReturnCtx(e, n), P$5(n, { - code: M$5.invalid_string, - validation: { endsWith: r.value }, - message: r.message - }), t.dirty()) : r.kind === `datetime` ? Bs(r).test(e.data) || (n = this._getOrReturnCtx(e, n), P$5(n, { - code: M$5.invalid_string, - validation: `datetime`, - message: r.message - }), t.dirty()) : r.kind === `date` ? Ls.test(e.data) || (n = this._getOrReturnCtx(e, n), P$5(n, { - code: M$5.invalid_string, - validation: `date`, - message: r.message - }), t.dirty()) : r.kind === `time` ? zs(r).test(e.data) || (n = this._getOrReturnCtx(e, n), P$5(n, { - code: M$5.invalid_string, - validation: `time`, - message: r.message - }), t.dirty()) : r.kind === `duration` ? Ds.test(e.data) || (n = this._getOrReturnCtx(e, n), P$5(n, { - validation: `duration`, - code: M$5.invalid_string, - message: r.message - }), t.dirty()) : r.kind === `ip` ? Vs(e.data, r.version) || (n = this._getOrReturnCtx(e, n), P$5(n, { - validation: `ip`, - code: M$5.invalid_string, - message: r.message - }), t.dirty()) : r.kind === `jwt` ? Hs(e.data, r.alg) || (n = this._getOrReturnCtx(e, n), P$5(n, { - validation: `jwt`, - code: M$5.invalid_string, - message: r.message - }), t.dirty()) : r.kind === `cidr` ? Us(e.data, r.version) || (n = this._getOrReturnCtx(e, n), P$5(n, { - validation: `cidr`, - code: M$5.invalid_string, - message: r.message - }), t.dirty()) : r.kind === `base64` ? Ps.test(e.data) || (n = this._getOrReturnCtx(e, n), P$5(n, { - validation: `base64`, - code: M$5.invalid_string, - message: r.message - }), t.dirty()) : r.kind === `base64url` ? Fs.test(e.data) || (n = this._getOrReturnCtx(e, n), P$5(n, { - validation: `base64url`, - code: M$5.invalid_string, - message: r.message - }), t.dirty()) : k$6.assertNever(r); - return { - status: t.value, - value: e.data - }; - } - _regex(e, t, n) { - return this.refinement((t) => e.test(t), { - validation: t, - code: M$5.invalid_string, - ...R$5.errToObj(n) - }); - } - _addCheck(t) { - return new e({ - ...this._def, - checks: [...this._def.checks, t] - }); - } - email(e) { - return this._addCheck({ - kind: `email`, - ...R$5.errToObj(e) - }); - } - url(e) { - return this._addCheck({ - kind: `url`, - ...R$5.errToObj(e) - }); - } - emoji(e) { - return this._addCheck({ - kind: `emoji`, - ...R$5.errToObj(e) - }); - } - uuid(e) { - return this._addCheck({ - kind: `uuid`, - ...R$5.errToObj(e) - }); - } - nanoid(e) { - return this._addCheck({ - kind: `nanoid`, - ...R$5.errToObj(e) - }); - } - cuid(e) { - return this._addCheck({ - kind: `cuid`, - ...R$5.errToObj(e) - }); - } - cuid2(e) { - return this._addCheck({ - kind: `cuid2`, - ...R$5.errToObj(e) - }); - } - ulid(e) { - return this._addCheck({ - kind: `ulid`, - ...R$5.errToObj(e) - }); - } - base64(e) { - return this._addCheck({ - kind: `base64`, - ...R$5.errToObj(e) - }); - } - base64url(e) { - return this._addCheck({ - kind: `base64url`, - ...R$5.errToObj(e) - }); - } - jwt(e) { - return this._addCheck({ - kind: `jwt`, - ...R$5.errToObj(e) - }); - } - ip(e) { - return this._addCheck({ - kind: `ip`, - ...R$5.errToObj(e) - }); - } - cidr(e) { - return this._addCheck({ - kind: `cidr`, - ...R$5.errToObj(e) - }); - } - datetime(e) { - return typeof e == `string` ? this._addCheck({ - kind: `datetime`, - precision: null, - offset: !1, - local: !1, - message: e - }) : this._addCheck({ - kind: `datetime`, - precision: e?.precision === void 0 ? null : e?.precision, - offset: e?.offset ?? !1, - local: e?.local ?? !1, - ...R$5.errToObj(e?.message) - }); - } - date(e) { - return this._addCheck({ - kind: `date`, - message: e - }); - } - time(e) { - return typeof e == `string` ? this._addCheck({ - kind: `time`, - precision: null, - message: e - }) : this._addCheck({ - kind: `time`, - precision: e?.precision === void 0 ? null : e?.precision, - ...R$5.errToObj(e?.message) - }); - } - duration(e) { - return this._addCheck({ - kind: `duration`, - ...R$5.errToObj(e) - }); - } - regex(e, t) { - return this._addCheck({ - kind: `regex`, - regex: e, - ...R$5.errToObj(t) - }); - } - includes(e, t) { - return this._addCheck({ - kind: `includes`, - value: e, - position: t?.position, - ...R$5.errToObj(t?.message) - }); - } - startsWith(e, t) { - return this._addCheck({ - kind: `startsWith`, - value: e, - ...R$5.errToObj(t) - }); - } - endsWith(e, t) { - return this._addCheck({ - kind: `endsWith`, - value: e, - ...R$5.errToObj(t) - }); - } - min(e, t) { - return this._addCheck({ - kind: `min`, - value: e, - ...R$5.errToObj(t) - }); - } - max(e, t) { - return this._addCheck({ - kind: `max`, - value: e, - ...R$5.errToObj(t) - }); - } - length(e, t) { - return this._addCheck({ - kind: `length`, - value: e, - ...R$5.errToObj(t) - }); - } - nonempty(e) { - return this.min(1, R$5.errToObj(e)); - } - trim() { - return new e({ - ...this._def, - checks: [...this._def.checks, { kind: `trim` }] - }); - } - toLowerCase() { - return new e({ - ...this._def, - checks: [...this._def.checks, { kind: `toLowerCase` }] - }); - } - toUpperCase() { - return new e({ - ...this._def, - checks: [...this._def.checks, { kind: `toUpperCase` }] - }); - } - get isDatetime() { - return !!this._def.checks.find((e) => e.kind === `datetime`); - } - get isDate() { - return !!this._def.checks.find((e) => e.kind === `date`); - } - get isTime() { - return !!this._def.checks.find((e) => e.kind === `time`); - } - get isDuration() { - return !!this._def.checks.find((e) => e.kind === `duration`); - } - get isEmail() { - return !!this._def.checks.find((e) => e.kind === `email`); - } - get isURL() { - return !!this._def.checks.find((e) => e.kind === `url`); - } - get isEmoji() { - return !!this._def.checks.find((e) => e.kind === `emoji`); - } - get isUUID() { - return !!this._def.checks.find((e) => e.kind === `uuid`); - } - get isNANOID() { - return !!this._def.checks.find((e) => e.kind === `nanoid`); - } - get isCUID() { - return !!this._def.checks.find((e) => e.kind === `cuid`); - } - get isCUID2() { - return !!this._def.checks.find((e) => e.kind === `cuid2`); - } - get isULID() { - return !!this._def.checks.find((e) => e.kind === `ulid`); - } - get isIP() { - return !!this._def.checks.find((e) => e.kind === `ip`); - } - get isCIDR() { - return !!this._def.checks.find((e) => e.kind === `cidr`); - } - get isBase64() { - return !!this._def.checks.find((e) => e.kind === `base64`); - } - get isBase64url() { - return !!this._def.checks.find((e) => e.kind === `base64url`); - } - get minLength() { - let e = null; - for (let t of this._def.checks) t.kind === `min` && (e === null || t.value > e) && (e = t.value); - return e; - } - get maxLength() { - let e = null; - for (let t of this._def.checks) t.kind === `max` && (e === null || t.value < e) && (e = t.value); - return e; - } -}; -Ws.create = (e) => new Ws({ - checks: [], - typeName: q$5.ZodString, - coerce: e?.coerce ?? !1, - ...B$5(e) -}); -function Gs(e, t) { - let n = (e.toString().split(`.`)[1] || ``).length, r = (t.toString().split(`.`)[1] || ``).length, i = n > r ? n : r; - return Number.parseInt(e.toFixed(i).replace(`.`, ``)) % Number.parseInt(t.toFixed(i).replace(`.`, ``)) / 10 ** i; -} -var Ks = class e extends V$5 { - constructor() { - super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf; - } - _parse(e) { - if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !== A$5.number) { - let t = this._getOrReturnCtx(e); - return P$5(t, { - code: M$5.invalid_type, - expected: A$5.number, - received: t.parsedType - }), I$5; - } - let t, n = new F$5(); - for (let r of this._def.checks) r.kind === `int` ? k$6.isInteger(e.data) || (t = this._getOrReturnCtx(e, t), P$5(t, { - code: M$5.invalid_type, - expected: `integer`, - received: `float`, - message: r.message - }), n.dirty()) : r.kind === `min` ? (r.inclusive ? e.data < r.value : e.data <= r.value) && (t = this._getOrReturnCtx(e, t), P$5(t, { - code: M$5.too_small, - minimum: r.value, - type: `number`, - inclusive: r.inclusive, - exact: !1, - message: r.message - }), n.dirty()) : r.kind === `max` ? (r.inclusive ? e.data > r.value : e.data >= r.value) && (t = this._getOrReturnCtx(e, t), P$5(t, { - code: M$5.too_big, - maximum: r.value, - type: `number`, - inclusive: r.inclusive, - exact: !1, - message: r.message - }), n.dirty()) : r.kind === `multipleOf` ? Gs(e.data, r.value) !== 0 && (t = this._getOrReturnCtx(e, t), P$5(t, { - code: M$5.not_multiple_of, - multipleOf: r.value, - message: r.message - }), n.dirty()) : r.kind === `finite` ? Number.isFinite(e.data) || (t = this._getOrReturnCtx(e, t), P$5(t, { - code: M$5.not_finite, - message: r.message - }), n.dirty()) : k$6.assertNever(r); - return { - status: n.value, - value: e.data - }; - } - gte(e, t) { - return this.setLimit(`min`, e, !0, R$5.toString(t)); - } - gt(e, t) { - return this.setLimit(`min`, e, !1, R$5.toString(t)); - } - lte(e, t) { - return this.setLimit(`max`, e, !0, R$5.toString(t)); - } - lt(e, t) { - return this.setLimit(`max`, e, !1, R$5.toString(t)); - } - setLimit(t, n, r, i) { - return new e({ - ...this._def, - checks: [...this._def.checks, { - kind: t, - value: n, - inclusive: r, - message: R$5.toString(i) - }] - }); - } - _addCheck(t) { - return new e({ - ...this._def, - checks: [...this._def.checks, t] - }); - } - int(e) { - return this._addCheck({ - kind: `int`, - message: R$5.toString(e) - }); - } - positive(e) { - return this._addCheck({ - kind: `min`, - value: 0, - inclusive: !1, - message: R$5.toString(e) - }); - } - negative(e) { - return this._addCheck({ - kind: `max`, - value: 0, - inclusive: !1, - message: R$5.toString(e) - }); - } - nonpositive(e) { - return this._addCheck({ - kind: `max`, - value: 0, - inclusive: !0, - message: R$5.toString(e) - }); - } - nonnegative(e) { - return this._addCheck({ - kind: `min`, - value: 0, - inclusive: !0, - message: R$5.toString(e) - }); - } - multipleOf(e, t) { - return this._addCheck({ - kind: `multipleOf`, - value: e, - message: R$5.toString(t) - }); - } - finite(e) { - return this._addCheck({ - kind: `finite`, - message: R$5.toString(e) - }); - } - safe(e) { - return this._addCheck({ - kind: `min`, - inclusive: !0, - value: -(2 ** 53 - 1), - message: R$5.toString(e) - })._addCheck({ - kind: `max`, - inclusive: !0, - value: 2 ** 53 - 1, - message: R$5.toString(e) - }); - } - get minValue() { - let e = null; - for (let t of this._def.checks) t.kind === `min` && (e === null || t.value > e) && (e = t.value); - return e; - } - get maxValue() { - let e = null; - for (let t of this._def.checks) t.kind === `max` && (e === null || t.value < e) && (e = t.value); - return e; - } - get isInt() { - return !!this._def.checks.find((e) => e.kind === `int` || e.kind === `multipleOf` && k$6.isInteger(e.value)); - } - get isFinite() { - let e = null, t = null; - for (let n of this._def.checks) if (n.kind === `finite` || n.kind === `int` || n.kind === `multipleOf`) return !0; - else n.kind === `min` ? (t === null || n.value > t) && (t = n.value) : n.kind === `max` && (e === null || n.value < e) && (e = n.value); - return Number.isFinite(t) && Number.isFinite(e); - } -}; -Ks.create = (e) => new Ks({ - checks: [], - typeName: q$5.ZodNumber, - coerce: e?.coerce || !1, - ...B$5(e) -}); -var qs = class e extends V$5 { - constructor() { - super(...arguments), this.min = this.gte, this.max = this.lte; - } - _parse(e) { - if (this._def.coerce) try { - e.data = BigInt(e.data); - } catch { - return this._getInvalidInput(e); - } - if (this._getType(e) !== A$5.bigint) return this._getInvalidInput(e); - let t, n = new F$5(); - for (let r of this._def.checks) r.kind === `min` ? (r.inclusive ? e.data < r.value : e.data <= r.value) && (t = this._getOrReturnCtx(e, t), P$5(t, { - code: M$5.too_small, - type: `bigint`, - minimum: r.value, - inclusive: r.inclusive, - message: r.message - }), n.dirty()) : r.kind === `max` ? (r.inclusive ? e.data > r.value : e.data >= r.value) && (t = this._getOrReturnCtx(e, t), P$5(t, { - code: M$5.too_big, - type: `bigint`, - maximum: r.value, - inclusive: r.inclusive, - message: r.message - }), n.dirty()) : r.kind === `multipleOf` ? e.data % r.value !== BigInt(0) && (t = this._getOrReturnCtx(e, t), P$5(t, { - code: M$5.not_multiple_of, - multipleOf: r.value, - message: r.message - }), n.dirty()) : k$6.assertNever(r); - return { - status: n.value, - value: e.data - }; - } - _getInvalidInput(e) { - let t = this._getOrReturnCtx(e); - return P$5(t, { - code: M$5.invalid_type, - expected: A$5.bigint, - received: t.parsedType - }), I$5; - } - gte(e, t) { - return this.setLimit(`min`, e, !0, R$5.toString(t)); - } - gt(e, t) { - return this.setLimit(`min`, e, !1, R$5.toString(t)); - } - lte(e, t) { - return this.setLimit(`max`, e, !0, R$5.toString(t)); - } - lt(e, t) { - return this.setLimit(`max`, e, !1, R$5.toString(t)); - } - setLimit(t, n, r, i) { - return new e({ - ...this._def, - checks: [...this._def.checks, { - kind: t, - value: n, - inclusive: r, - message: R$5.toString(i) - }] - }); - } - _addCheck(t) { - return new e({ - ...this._def, - checks: [...this._def.checks, t] - }); - } - positive(e) { - return this._addCheck({ - kind: `min`, - value: BigInt(0), - inclusive: !1, - message: R$5.toString(e) - }); - } - negative(e) { - return this._addCheck({ - kind: `max`, - value: BigInt(0), - inclusive: !1, - message: R$5.toString(e) - }); - } - nonpositive(e) { - return this._addCheck({ - kind: `max`, - value: BigInt(0), - inclusive: !0, - message: R$5.toString(e) - }); - } - nonnegative(e) { - return this._addCheck({ - kind: `min`, - value: BigInt(0), - inclusive: !0, - message: R$5.toString(e) - }); - } - multipleOf(e, t) { - return this._addCheck({ - kind: `multipleOf`, - value: e, - message: R$5.toString(t) - }); - } - get minValue() { - let e = null; - for (let t of this._def.checks) t.kind === `min` && (e === null || t.value > e) && (e = t.value); - return e; - } - get maxValue() { - let e = null; - for (let t of this._def.checks) t.kind === `max` && (e === null || t.value < e) && (e = t.value); - return e; - } -}; -qs.create = (e) => new qs({ - checks: [], - typeName: q$5.ZodBigInt, - coerce: e?.coerce ?? !1, - ...B$5(e) -}); -var Js = class extends V$5 { - _parse(e) { - if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== A$5.boolean) { - let t = this._getOrReturnCtx(e); - return P$5(t, { - code: M$5.invalid_type, - expected: A$5.boolean, - received: t.parsedType - }), I$5; - } - return L$5(e.data); - } -}; -Js.create = (e) => new Js({ - typeName: q$5.ZodBoolean, - coerce: e?.coerce || !1, - ...B$5(e) -}); -var Ys = class e extends V$5 { - _parse(e) { - if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== A$5.date) { - let t = this._getOrReturnCtx(e); - return P$5(t, { - code: M$5.invalid_type, - expected: A$5.date, - received: t.parsedType - }), I$5; - } - if (Number.isNaN(e.data.getTime())) return P$5(this._getOrReturnCtx(e), { code: M$5.invalid_date }), I$5; - let t = new F$5(), n; - for (let r of this._def.checks) r.kind === `min` ? e.data.getTime() < r.value && (n = this._getOrReturnCtx(e, n), P$5(n, { - code: M$5.too_small, - message: r.message, - inclusive: !0, - exact: !1, - minimum: r.value, - type: `date` - }), t.dirty()) : r.kind === `max` ? e.data.getTime() > r.value && (n = this._getOrReturnCtx(e, n), P$5(n, { - code: M$5.too_big, - message: r.message, - inclusive: !0, - exact: !1, - maximum: r.value, - type: `date` - }), t.dirty()) : k$6.assertNever(r); - return { - status: t.value, - value: new Date(e.data.getTime()) - }; - } - _addCheck(t) { - return new e({ - ...this._def, - checks: [...this._def.checks, t] - }); - } - min(e, t) { - return this._addCheck({ - kind: `min`, - value: e.getTime(), - message: R$5.toString(t) - }); - } - max(e, t) { - return this._addCheck({ - kind: `max`, - value: e.getTime(), - message: R$5.toString(t) - }); - } - get minDate() { - let e = null; - for (let t of this._def.checks) t.kind === `min` && (e === null || t.value > e) && (e = t.value); - return e == null ? null : new Date(e); - } - get maxDate() { - let e = null; - for (let t of this._def.checks) t.kind === `max` && (e === null || t.value < e) && (e = t.value); - return e == null ? null : new Date(e); - } -}; -Ys.create = (e) => new Ys({ - checks: [], - coerce: e?.coerce || !1, - typeName: q$5.ZodDate, - ...B$5(e) -}); -var Xs = class extends V$5 { - _parse(e) { - if (this._getType(e) !== A$5.symbol) { - let t = this._getOrReturnCtx(e); - return P$5(t, { - code: M$5.invalid_type, - expected: A$5.symbol, - received: t.parsedType - }), I$5; - } - return L$5(e.data); - } -}; -Xs.create = (e) => new Xs({ - typeName: q$5.ZodSymbol, - ...B$5(e) -}); -var Zs = class extends V$5 { - _parse(e) { - if (this._getType(e) !== A$5.undefined) { - let t = this._getOrReturnCtx(e); - return P$5(t, { - code: M$5.invalid_type, - expected: A$5.undefined, - received: t.parsedType - }), I$5; - } - return L$5(e.data); - } -}; -Zs.create = (e) => new Zs({ - typeName: q$5.ZodUndefined, - ...B$5(e) -}); -var Qs = class extends V$5 { - _parse(e) { - if (this._getType(e) !== A$5.null) { - let t = this._getOrReturnCtx(e); - return P$5(t, { - code: M$5.invalid_type, - expected: A$5.null, - received: t.parsedType - }), I$5; - } - return L$5(e.data); - } -}; -Qs.create = (e) => new Qs({ - typeName: q$5.ZodNull, - ...B$5(e) -}); -var $s = class extends V$5 { - constructor() { - super(...arguments), this._any = !0; - } - _parse(e) { - return L$5(e.data); - } -}; -$s.create = (e) => new $s({ - typeName: q$5.ZodAny, - ...B$5(e) -}); -var ec = class extends V$5 { - constructor() { - super(...arguments), this._unknown = !0; - } - _parse(e) { - return L$5(e.data); - } -}; -ec.create = (e) => new ec({ - typeName: q$5.ZodUnknown, - ...B$5(e) -}); -var H$6 = class extends V$5 { - _parse(e) { - let t = this._getOrReturnCtx(e); - return P$5(t, { - code: M$5.invalid_type, - expected: A$5.never, - received: t.parsedType - }), I$5; - } -}; -H$6.create = (e) => new H$6({ - typeName: q$5.ZodNever, - ...B$5(e) -}); -var tc = class extends V$5 { - _parse(e) { - if (this._getType(e) !== A$5.undefined) { - let t = this._getOrReturnCtx(e); - return P$5(t, { - code: M$5.invalid_type, - expected: A$5.void, - received: t.parsedType - }), I$5; - } - return L$5(e.data); - } -}; -tc.create = (e) => new tc({ - typeName: q$5.ZodVoid, - ...B$5(e) -}); -var nc = class e extends V$5 { - _parse(e) { - let { ctx: t, status: n } = this._processInputParams(e), r = this._def; - if (t.parsedType !== A$5.array) return P$5(t, { - code: M$5.invalid_type, - expected: A$5.array, - received: t.parsedType - }), I$5; - if (r.exactLength !== null) { - let e = t.data.length > r.exactLength.value, i = t.data.length < r.exactLength.value; - (e || i) && (P$5(t, { - code: e ? M$5.too_big : M$5.too_small, - minimum: i ? r.exactLength.value : void 0, - maximum: e ? r.exactLength.value : void 0, - type: `array`, - inclusive: !0, - exact: !0, - message: r.exactLength.message - }), n.dirty()); - } - if (r.minLength !== null && t.data.length < r.minLength.value && (P$5(t, { - code: M$5.too_small, - minimum: r.minLength.value, - type: `array`, - inclusive: !0, - exact: !1, - message: r.minLength.message - }), n.dirty()), r.maxLength !== null && t.data.length > r.maxLength.value && (P$5(t, { - code: M$5.too_big, - maximum: r.maxLength.value, - type: `array`, - inclusive: !0, - exact: !1, - message: r.maxLength.message - }), n.dirty()), t.common.async) return Promise.all([...t.data].map((e, n) => r.type._parseAsync(new z$5(t, e, t.path, n)))).then((e) => F$5.mergeArray(n, e)); - let i = [...t.data].map((e, n) => r.type._parseSync(new z$5(t, e, t.path, n))); - return F$5.mergeArray(n, i); - } - get element() { - return this._def.type; - } - min(t, n) { - return new e({ - ...this._def, - minLength: { - value: t, - message: R$5.toString(n) - } - }); - } - max(t, n) { - return new e({ - ...this._def, - maxLength: { - value: t, - message: R$5.toString(n) - } - }); - } - length(t, n) { - return new e({ - ...this._def, - exactLength: { - value: t, - message: R$5.toString(n) - } - }); - } - nonempty(e) { - return this.min(1, e); - } -}; -nc.create = (e, t) => new nc({ - type: e, - minLength: null, - maxLength: null, - exactLength: null, - typeName: q$5.ZodArray, - ...B$5(t) -}); -function rc(e) { - if (e instanceof U$6) { - let t = {}; - for (let n in e.shape) { - let r = e.shape[n]; - t[n] = K$5.create(rc(r)); - } - return new U$6({ - ...e._def, - shape: () => t - }); - } else if (e instanceof nc) return new nc({ - ...e._def, - type: rc(e.element) - }); - else if (e instanceof K$5) return K$5.create(rc(e.unwrap())); - else if (e instanceof yc) return yc.create(rc(e.unwrap())); - else if (e instanceof cc) return cc.create(e.items.map((e) => rc(e))); - else return e; -} -var U$6 = class e extends V$5 { - constructor() { - super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend; - } - _getCached() { - if (this._cached !== null) return this._cached; - let e = this._def.shape(), t = k$6.objectKeys(e); - return this._cached = { - shape: e, - keys: t - }, this._cached; - } - _parse(e) { - if (this._getType(e) !== A$5.object) { - let t = this._getOrReturnCtx(e); - return P$5(t, { - code: M$5.invalid_type, - expected: A$5.object, - received: t.parsedType - }), I$5; - } - let { status: t, ctx: n } = this._processInputParams(e), { shape: r, keys: i } = this._getCached(), a = []; - if (!(this._def.catchall instanceof H$6 && this._def.unknownKeys === `strip`)) for (let e in n.data) i.includes(e) || a.push(e); - let o = []; - for (let e of i) { - let t = r[e], i = n.data[e]; - o.push({ - key: { - status: `valid`, - value: e - }, - value: t._parse(new z$5(n, i, n.path, e)), - alwaysSet: e in n.data - }); - } - if (this._def.catchall instanceof H$6) { - let e = this._def.unknownKeys; - if (e === `passthrough`) for (let e of a) o.push({ - key: { - status: `valid`, - value: e - }, - value: { - status: `valid`, - value: n.data[e] - } - }); - else if (e === `strict`) a.length > 0 && (P$5(n, { - code: M$5.unrecognized_keys, - keys: a - }), t.dirty()); - else if (e !== `strip`) throw Error(`Internal ZodObject error: invalid unknownKeys value.`); - } else { - let e = this._def.catchall; - for (let t of a) { - let r = n.data[t]; - o.push({ - key: { - status: `valid`, - value: t - }, - value: e._parse(new z$5(n, r, n.path, t)), - alwaysSet: t in n.data - }); - } - } - return n.common.async ? Promise.resolve().then(async () => { - let e = []; - for (let t of o) { - let n = await t.key, r = await t.value; - e.push({ - key: n, - value: r, - alwaysSet: t.alwaysSet - }); - } - return e; - }).then((e) => F$5.mergeObjectSync(t, e)) : F$5.mergeObjectSync(t, o); - } - get shape() { - return this._def.shape(); - } - strict(t) { - return R$5.errToObj, new e({ - ...this._def, - unknownKeys: `strict`, - ...t === void 0 ? {} : { errorMap: (e, n) => { - let r = this._def.errorMap?.(e, n).message ?? n.defaultError; - return e.code === `unrecognized_keys` ? { message: R$5.errToObj(t).message ?? r } : { message: r }; - } } - }); - } - strip() { - return new e({ - ...this._def, - unknownKeys: `strip` - }); - } - passthrough() { - return new e({ - ...this._def, - unknownKeys: `passthrough` - }); - } - extend(t) { - return new e({ - ...this._def, - shape: () => ({ - ...this._def.shape(), - ...t - }) - }); - } - merge(t) { - return new e({ - unknownKeys: t._def.unknownKeys, - catchall: t._def.catchall, - shape: () => ({ - ...this._def.shape(), - ...t._def.shape() - }), - typeName: q$5.ZodObject - }); - } - setKey(e, t) { - return this.augment({ [e]: t }); - } - catchall(t) { - return new e({ - ...this._def, - catchall: t - }); - } - pick(t) { - let n = {}; - for (let e of k$6.objectKeys(t)) t[e] && this.shape[e] && (n[e] = this.shape[e]); - return new e({ - ...this._def, - shape: () => n - }); - } - omit(t) { - let n = {}; - for (let e of k$6.objectKeys(this.shape)) t[e] || (n[e] = this.shape[e]); - return new e({ - ...this._def, - shape: () => n - }); - } - deepPartial() { - return rc(this); - } - partial(t) { - let n = {}; - for (let e of k$6.objectKeys(this.shape)) { - let r = this.shape[e]; - t && !t[e] ? n[e] = r : n[e] = r.optional(); - } - return new e({ - ...this._def, - shape: () => n - }); - } - required(t) { - let n = {}; - for (let e of k$6.objectKeys(this.shape)) if (t && !t[e]) n[e] = this.shape[e]; - else { - let t = this.shape[e]; - for (; t instanceof K$5;) t = t._def.innerType; - n[e] = t; - } - return new e({ - ...this._def, - shape: () => n - }); - } - keyof() { - return hc(k$6.objectKeys(this.shape)); - } -}; -U$6.create = (e, t) => new U$6({ - shape: () => e, - unknownKeys: `strip`, - catchall: H$6.create(), - typeName: q$5.ZodObject, - ...B$5(t) -}), U$6.strictCreate = (e, t) => new U$6({ - shape: () => e, - unknownKeys: `strict`, - catchall: H$6.create(), - typeName: q$5.ZodObject, - ...B$5(t) -}), U$6.lazycreate = (e, t) => new U$6({ - shape: e, - unknownKeys: `strip`, - catchall: H$6.create(), - typeName: q$5.ZodObject, - ...B$5(t) -}); -var ic = class extends V$5 { - _parse(e) { - let { ctx: t } = this._processInputParams(e), n = this._def.options; - function r(e) { - for (let t of e) if (t.result.status === `valid`) return t.result; - for (let n of e) if (n.result.status === `dirty`) return t.common.issues.push(...n.ctx.common.issues), n.result; - let n = e.map((e) => new N$5(e.ctx.common.issues)); - return P$5(t, { - code: M$5.invalid_union, - unionErrors: n - }), I$5; - } - if (t.common.async) return Promise.all(n.map(async (e) => { - let n = { - ...t, - common: { - ...t.common, - issues: [] - }, - parent: null - }; - return { - result: await e._parseAsync({ - data: t.data, - path: t.path, - parent: n - }), - ctx: n - }; - })).then(r); - { - let e, r = []; - for (let i of n) { - let n = { - ...t, - common: { - ...t.common, - issues: [] - }, - parent: null - }, a = i._parseSync({ - data: t.data, - path: t.path, - parent: n - }); - if (a.status === `valid`) return a; - a.status === `dirty` && !e && (e = { - result: a, - ctx: n - }), n.common.issues.length && r.push(n.common.issues); - } - if (e) return t.common.issues.push(...e.ctx.common.issues), e.result; - let i = r.map((e) => new N$5(e)); - return P$5(t, { - code: M$5.invalid_union, - unionErrors: i - }), I$5; - } - } - get options() { - return this._def.options; - } -}; -ic.create = (e, t) => new ic({ - options: e, - typeName: q$5.ZodUnion, - ...B$5(t) -}); -const W$6 = (e) => e instanceof pc ? W$6(e.schema) : e instanceof G$6 ? W$6(e.innerType()) : e instanceof mc ? [e.value] : e instanceof gc ? e.options : e instanceof _c ? k$6.objectValues(e.enum) : e instanceof bc ? W$6(e._def.innerType) : e instanceof Zs ? [void 0] : e instanceof Qs ? [null] : e instanceof K$5 ? [void 0, ...W$6(e.unwrap())] : e instanceof yc ? [null, ...W$6(e.unwrap())] : e instanceof Cc || e instanceof Tc ? W$6(e.unwrap()) : e instanceof xc ? W$6(e._def.innerType) : []; -var ac = class e extends V$5 { - _parse(e) { - let { ctx: t } = this._processInputParams(e); - if (t.parsedType !== A$5.object) return P$5(t, { - code: M$5.invalid_type, - expected: A$5.object, - received: t.parsedType - }), I$5; - let n = this.discriminator, r = t.data[n], i = this.optionsMap.get(r); - return i ? t.common.async ? i._parseAsync({ - data: t.data, - path: t.path, - parent: t - }) : i._parseSync({ - data: t.data, - path: t.path, - parent: t - }) : (P$5(t, { - code: M$5.invalid_union_discriminator, - options: Array.from(this.optionsMap.keys()), - path: [n] - }), I$5); - } - get discriminator() { - return this._def.discriminator; - } - get options() { - return this._def.options; - } - get optionsMap() { - return this._def.optionsMap; - } - static create(t, n, r) { - let i = /* @__PURE__ */ new Map(); - for (let e of n) { - let n = W$6(e.shape[t]); - if (!n.length) throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`); - for (let r of n) { - if (i.has(r)) throw Error(`Discriminator property ${String(t)} has duplicate value ${String(r)}`); - i.set(r, e); - } - } - return new e({ - typeName: q$5.ZodDiscriminatedUnion, - discriminator: t, - options: n, - optionsMap: i, - ...B$5(r) - }); - } -}; -function oc(e, t) { - let n = j$5(e), r = j$5(t); - if (e === t) return { - valid: !0, - data: e - }; - if (n === A$5.object && r === A$5.object) { - let n = k$6.objectKeys(t), r = k$6.objectKeys(e).filter((e) => n.indexOf(e) !== -1), i = { - ...e, - ...t - }; - for (let n of r) { - let r = oc(e[n], t[n]); - if (!r.valid) return { valid: !1 }; - i[n] = r.data; - } - return { - valid: !0, - data: i - }; - } else if (n === A$5.array && r === A$5.array) { - if (e.length !== t.length) return { valid: !1 }; - let n = []; - for (let r = 0; r < e.length; r++) { - let i = e[r], a = t[r], o = oc(i, a); - if (!o.valid) return { valid: !1 }; - n.push(o.data); - } - return { - valid: !0, - data: n - }; - } else if (n === A$5.date && r === A$5.date && +e == +t) return { - valid: !0, - data: e - }; - else return { valid: !1 }; -} -var sc = class extends V$5 { - _parse(e) { - let { status: t, ctx: n } = this._processInputParams(e), r = (e, r) => { - if (gs(e) || gs(r)) return I$5; - let i = oc(e.value, r.value); - return i.valid ? ((_s(e) || _s(r)) && t.dirty(), { - status: t.value, - value: i.data - }) : (P$5(n, { code: M$5.invalid_intersection_types }), I$5); - }; - return n.common.async ? Promise.all([this._def.left._parseAsync({ - data: n.data, - path: n.path, - parent: n - }), this._def.right._parseAsync({ - data: n.data, - path: n.path, - parent: n - })]).then(([e, t]) => r(e, t)) : r(this._def.left._parseSync({ - data: n.data, - path: n.path, - parent: n - }), this._def.right._parseSync({ - data: n.data, - path: n.path, - parent: n - })); - } -}; -sc.create = (e, t, n) => new sc({ - left: e, - right: t, - typeName: q$5.ZodIntersection, - ...B$5(n) -}); -var cc = class e extends V$5 { - _parse(e) { - let { status: t, ctx: n } = this._processInputParams(e); - if (n.parsedType !== A$5.array) return P$5(n, { - code: M$5.invalid_type, - expected: A$5.array, - received: n.parsedType - }), I$5; - if (n.data.length < this._def.items.length) return P$5(n, { - code: M$5.too_small, - minimum: this._def.items.length, - inclusive: !0, - exact: !1, - type: `array` - }), I$5; - !this._def.rest && n.data.length > this._def.items.length && (P$5(n, { - code: M$5.too_big, - maximum: this._def.items.length, - inclusive: !0, - exact: !1, - type: `array` - }), t.dirty()); - let r = [...n.data].map((e, t) => { - let r = this._def.items[t] || this._def.rest; - return r ? r._parse(new z$5(n, e, n.path, t)) : null; - }).filter((e) => !!e); - return n.common.async ? Promise.all(r).then((e) => F$5.mergeArray(t, e)) : F$5.mergeArray(t, r); - } - get items() { - return this._def.items; - } - rest(t) { - return new e({ - ...this._def, - rest: t - }); - } -}; -cc.create = (e, t) => { - if (!Array.isArray(e)) throw Error(`You must pass an array of schemas to z.tuple([ ... ])`); - return new cc({ - items: e, - typeName: q$5.ZodTuple, - rest: null, - ...B$5(t) - }); -}; -var lc = class e extends V$5 { - get keySchema() { - return this._def.keyType; - } - get valueSchema() { - return this._def.valueType; - } - _parse(e) { - let { status: t, ctx: n } = this._processInputParams(e); - if (n.parsedType !== A$5.object) return P$5(n, { - code: M$5.invalid_type, - expected: A$5.object, - received: n.parsedType - }), I$5; - let r = [], i = this._def.keyType, a = this._def.valueType; - for (let e in n.data) r.push({ - key: i._parse(new z$5(n, e, n.path, e)), - value: a._parse(new z$5(n, n.data[e], n.path, e)), - alwaysSet: e in n.data - }); - return n.common.async ? F$5.mergeObjectAsync(t, r) : F$5.mergeObjectSync(t, r); - } - get element() { - return this._def.valueType; - } - static create(t, n, r) { - return n instanceof V$5 ? new e({ - keyType: t, - valueType: n, - typeName: q$5.ZodRecord, - ...B$5(r) - }) : new e({ - keyType: Ws.create(), - valueType: t, - typeName: q$5.ZodRecord, - ...B$5(n) - }); - } -}; -var uc = class extends V$5 { - get keySchema() { - return this._def.keyType; - } - get valueSchema() { - return this._def.valueType; - } - _parse(e) { - let { status: t, ctx: n } = this._processInputParams(e); - if (n.parsedType !== A$5.map) return P$5(n, { - code: M$5.invalid_type, - expected: A$5.map, - received: n.parsedType - }), I$5; - let r = this._def.keyType, i = this._def.valueType, a = [...n.data.entries()].map(([e, t], a) => ({ - key: r._parse(new z$5(n, e, n.path, [a, `key`])), - value: i._parse(new z$5(n, t, n.path, [a, `value`])) - })); - if (n.common.async) { - let e = /* @__PURE__ */ new Map(); - return Promise.resolve().then(async () => { - for (let n of a) { - let r = await n.key, i = await n.value; - if (r.status === `aborted` || i.status === `aborted`) return I$5; - (r.status === `dirty` || i.status === `dirty`) && t.dirty(), e.set(r.value, i.value); - } - return { - status: t.value, - value: e - }; - }); - } else { - let e = /* @__PURE__ */ new Map(); - for (let n of a) { - let r = n.key, i = n.value; - if (r.status === `aborted` || i.status === `aborted`) return I$5; - (r.status === `dirty` || i.status === `dirty`) && t.dirty(), e.set(r.value, i.value); - } - return { - status: t.value, - value: e - }; - } - } -}; -uc.create = (e, t, n) => new uc({ - valueType: t, - keyType: e, - typeName: q$5.ZodMap, - ...B$5(n) -}); -var dc = class e extends V$5 { - _parse(e) { - let { status: t, ctx: n } = this._processInputParams(e); - if (n.parsedType !== A$5.set) return P$5(n, { - code: M$5.invalid_type, - expected: A$5.set, - received: n.parsedType - }), I$5; - let r = this._def; - r.minSize !== null && n.data.size < r.minSize.value && (P$5(n, { - code: M$5.too_small, - minimum: r.minSize.value, - type: `set`, - inclusive: !0, - exact: !1, - message: r.minSize.message - }), t.dirty()), r.maxSize !== null && n.data.size > r.maxSize.value && (P$5(n, { - code: M$5.too_big, - maximum: r.maxSize.value, - type: `set`, - inclusive: !0, - exact: !1, - message: r.maxSize.message - }), t.dirty()); - let i = this._def.valueType; - function a(e) { - let n = /* @__PURE__ */ new Set(); - for (let r of e) { - if (r.status === `aborted`) return I$5; - r.status === `dirty` && t.dirty(), n.add(r.value); - } - return { - status: t.value, - value: n - }; - } - let o = [...n.data.values()].map((e, t) => i._parse(new z$5(n, e, n.path, t))); - return n.common.async ? Promise.all(o).then((e) => a(e)) : a(o); - } - min(t, n) { - return new e({ - ...this._def, - minSize: { - value: t, - message: R$5.toString(n) - } - }); - } - max(t, n) { - return new e({ - ...this._def, - maxSize: { - value: t, - message: R$5.toString(n) - } - }); - } - size(e, t) { - return this.min(e, t).max(e, t); - } - nonempty(e) { - return this.min(1, e); - } -}; -dc.create = (e, t) => new dc({ - valueType: e, - minSize: null, - maxSize: null, - typeName: q$5.ZodSet, - ...B$5(t) -}); -var fc = class e extends V$5 { - constructor() { - super(...arguments), this.validate = this.implement; - } - _parse(e) { - let { ctx: t } = this._processInputParams(e); - if (t.parsedType !== A$5.function) return P$5(t, { - code: M$5.invalid_type, - expected: A$5.function, - received: t.parsedType - }), I$5; - function n(e, n) { - return ms({ - data: e, - path: t.path, - errorMaps: [ - t.common.contextualErrorMap, - t.schemaErrorMap, - ps(), - ds - ].filter((e) => !!e), - issueData: { - code: M$5.invalid_arguments, - argumentsError: n - } - }); - } - function r(e, n) { - return ms({ - data: e, - path: t.path, - errorMaps: [ - t.common.contextualErrorMap, - t.schemaErrorMap, - ps(), - ds - ].filter((e) => !!e), - issueData: { - code: M$5.invalid_return_type, - returnTypeError: n - } - }); - } - let i = { errorMap: t.common.contextualErrorMap }, a = t.data; - if (this._def.returns instanceof vc) { - let e = this; - return L$5(async function(...t) { - let o = new N$5([]), s = await e._def.args.parseAsync(t, i).catch((e) => { - throw o.addIssue(n(t, e)), o; - }), c = await Reflect.apply(a, this, s); - return await e._def.returns._def.type.parseAsync(c, i).catch((e) => { - throw o.addIssue(r(c, e)), o; - }); - }); - } else { - let e = this; - return L$5(function(...t) { - let o = e._def.args.safeParse(t, i); - if (!o.success) throw new N$5([n(t, o.error)]); - let s = Reflect.apply(a, this, o.data), c = e._def.returns.safeParse(s, i); - if (!c.success) throw new N$5([r(s, c.error)]); - return c.data; - }); - } - } - parameters() { - return this._def.args; - } - returnType() { - return this._def.returns; - } - args(...t) { - return new e({ - ...this._def, - args: cc.create(t).rest(ec.create()) - }); - } - returns(t) { - return new e({ - ...this._def, - returns: t - }); - } - implement(e) { - return this.parse(e); - } - strictImplement(e) { - return this.parse(e); - } - static create(t, n, r) { - return new e({ - args: t || cc.create([]).rest(ec.create()), - returns: n || ec.create(), - typeName: q$5.ZodFunction, - ...B$5(r) - }); - } -}; -var pc = class extends V$5 { - get schema() { - return this._def.getter(); - } - _parse(e) { - let { ctx: t } = this._processInputParams(e); - return this._def.getter()._parse({ - data: t.data, - path: t.path, - parent: t - }); - } -}; -pc.create = (e, t) => new pc({ - getter: e, - typeName: q$5.ZodLazy, - ...B$5(t) -}); -var mc = class extends V$5 { - _parse(e) { - if (e.data !== this._def.value) { - let t = this._getOrReturnCtx(e); - return P$5(t, { - received: t.data, - code: M$5.invalid_literal, - expected: this._def.value - }), I$5; - } - return { - status: `valid`, - value: e.data - }; - } - get value() { - return this._def.value; - } -}; -mc.create = (e, t) => new mc({ - value: e, - typeName: q$5.ZodLiteral, - ...B$5(t) -}); -function hc(e, t) { - return new gc({ - values: e, - typeName: q$5.ZodEnum, - ...B$5(t) - }); -} -var gc = class e extends V$5 { - _parse(e) { - if (typeof e.data != `string`) { - let t = this._getOrReturnCtx(e), n = this._def.values; - return P$5(t, { - expected: k$6.joinValues(n), - received: t.parsedType, - code: M$5.invalid_type - }), I$5; - } - if (this._cache ||= new Set(this._def.values), !this._cache.has(e.data)) { - let t = this._getOrReturnCtx(e), n = this._def.values; - return P$5(t, { - received: t.data, - code: M$5.invalid_enum_value, - options: n - }), I$5; - } - return L$5(e.data); - } - get options() { - return this._def.values; - } - get enum() { - let e = {}; - for (let t of this._def.values) e[t] = t; - return e; - } - get Values() { - let e = {}; - for (let t of this._def.values) e[t] = t; - return e; - } - get Enum() { - let e = {}; - for (let t of this._def.values) e[t] = t; - return e; - } - extract(t, n = this._def) { - return e.create(t, { - ...this._def, - ...n - }); - } - exclude(t, n = this._def) { - return e.create(this.options.filter((e) => !t.includes(e)), { - ...this._def, - ...n - }); - } -}; -gc.create = hc; -var _c = class extends V$5 { - _parse(e) { - let t = k$6.getValidEnumValues(this._def.values), n = this._getOrReturnCtx(e); - if (n.parsedType !== A$5.string && n.parsedType !== A$5.number) { - let e = k$6.objectValues(t); - return P$5(n, { - expected: k$6.joinValues(e), - received: n.parsedType, - code: M$5.invalid_type - }), I$5; - } - if (this._cache ||= new Set(k$6.getValidEnumValues(this._def.values)), !this._cache.has(e.data)) { - let e = k$6.objectValues(t); - return P$5(n, { - received: n.data, - code: M$5.invalid_enum_value, - options: e - }), I$5; - } - return L$5(e.data); - } - get enum() { - return this._def.values; - } -}; -_c.create = (e, t) => new _c({ - values: e, - typeName: q$5.ZodNativeEnum, - ...B$5(t) -}); -var vc = class extends V$5 { - unwrap() { - return this._def.type; - } - _parse(e) { - let { ctx: t } = this._processInputParams(e); - return t.parsedType !== A$5.promise && t.common.async === !1 ? (P$5(t, { - code: M$5.invalid_type, - expected: A$5.promise, - received: t.parsedType - }), I$5) : L$5((t.parsedType === A$5.promise ? t.data : Promise.resolve(t.data)).then((e) => this._def.type.parseAsync(e, { - path: t.path, - errorMap: t.common.contextualErrorMap - }))); - } -}; -vc.create = (e, t) => new vc({ - type: e, - typeName: q$5.ZodPromise, - ...B$5(t) -}); -var G$6 = class extends V$5 { - innerType() { - return this._def.schema; - } - sourceType() { - return this._def.schema._def.typeName === q$5.ZodEffects ? this._def.schema.sourceType() : this._def.schema; - } - _parse(e) { - let { status: t, ctx: n } = this._processInputParams(e), r = this._def.effect || null, i = { - addIssue: (e) => { - P$5(n, e), e.fatal ? t.abort() : t.dirty(); - }, - get path() { - return n.path; - } - }; - if (i.addIssue = i.addIssue.bind(i), r.type === `preprocess`) { - let e = r.transform(n.data, i); - if (n.common.async) return Promise.resolve(e).then(async (e) => { - if (t.value === `aborted`) return I$5; - let r = await this._def.schema._parseAsync({ - data: e, - path: n.path, - parent: n - }); - return r.status === `aborted` ? I$5 : r.status === `dirty` || t.value === `dirty` ? hs(r.value) : r; - }); - { - if (t.value === `aborted`) return I$5; - let r = this._def.schema._parseSync({ - data: e, - path: n.path, - parent: n - }); - return r.status === `aborted` ? I$5 : r.status === `dirty` || t.value === `dirty` ? hs(r.value) : r; - } - } - if (r.type === `refinement`) { - let e = (e) => { - let t = r.refinement(e, i); - if (n.common.async) return Promise.resolve(t); - if (t instanceof Promise) throw Error(`Async refinement encountered during synchronous parse operation. Use .parseAsync instead.`); - return e; - }; - if (n.common.async === !1) { - let r = this._def.schema._parseSync({ - data: n.data, - path: n.path, - parent: n - }); - return r.status === `aborted` ? I$5 : (r.status === `dirty` && t.dirty(), e(r.value), { - status: t.value, - value: r.value - }); - } else return this._def.schema._parseAsync({ - data: n.data, - path: n.path, - parent: n - }).then((n) => n.status === `aborted` ? I$5 : (n.status === `dirty` && t.dirty(), e(n.value).then(() => ({ - status: t.value, - value: n.value - })))); - } - if (r.type === `transform`) if (n.common.async === !1) { - let e = this._def.schema._parseSync({ - data: n.data, - path: n.path, - parent: n - }); - if (!vs(e)) return I$5; - let a = r.transform(e.value, i); - if (a instanceof Promise) throw Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`); - return { - status: t.value, - value: a - }; - } else return this._def.schema._parseAsync({ - data: n.data, - path: n.path, - parent: n - }).then((e) => vs(e) ? Promise.resolve(r.transform(e.value, i)).then((e) => ({ - status: t.value, - value: e - })) : I$5); - k$6.assertNever(r); - } -}; -G$6.create = (e, t, n) => new G$6({ - schema: e, - typeName: q$5.ZodEffects, - effect: t, - ...B$5(n) -}), G$6.createWithPreprocess = (e, t, n) => new G$6({ - schema: t, - effect: { - type: `preprocess`, - transform: e - }, - typeName: q$5.ZodEffects, - ...B$5(n) -}); -var K$5 = class extends V$5 { - _parse(e) { - return this._getType(e) === A$5.undefined ? L$5(void 0) : this._def.innerType._parse(e); - } - unwrap() { - return this._def.innerType; - } -}; -K$5.create = (e, t) => new K$5({ - innerType: e, - typeName: q$5.ZodOptional, - ...B$5(t) -}); -var yc = class extends V$5 { - _parse(e) { - return this._getType(e) === A$5.null ? L$5(null) : this._def.innerType._parse(e); - } - unwrap() { - return this._def.innerType; - } -}; -yc.create = (e, t) => new yc({ - innerType: e, - typeName: q$5.ZodNullable, - ...B$5(t) -}); -var bc = class extends V$5 { - _parse(e) { - let { ctx: t } = this._processInputParams(e), n = t.data; - return t.parsedType === A$5.undefined && (n = this._def.defaultValue()), this._def.innerType._parse({ - data: n, - path: t.path, - parent: t - }); - } - removeDefault() { - return this._def.innerType; - } -}; -bc.create = (e, t) => new bc({ - innerType: e, - typeName: q$5.ZodDefault, - defaultValue: typeof t.default == `function` ? t.default : () => t.default, - ...B$5(t) -}); -var xc = class extends V$5 { - _parse(e) { - let { ctx: t } = this._processInputParams(e), n = { - ...t, - common: { - ...t.common, - issues: [] - } - }, r = this._def.innerType._parse({ - data: n.data, - path: n.path, - parent: { ...n } - }); - return ys(r) ? r.then((e) => ({ - status: `valid`, - value: e.status === `valid` ? e.value : this._def.catchValue({ - get error() { - return new N$5(n.common.issues); - }, - input: n.data - }) - })) : { - status: `valid`, - value: r.status === `valid` ? r.value : this._def.catchValue({ - get error() { - return new N$5(n.common.issues); - }, - input: n.data - }) - }; - } - removeCatch() { - return this._def.innerType; - } -}; -xc.create = (e, t) => new xc({ - innerType: e, - typeName: q$5.ZodCatch, - catchValue: typeof t.catch == `function` ? t.catch : () => t.catch, - ...B$5(t) -}); -var Sc = class extends V$5 { - _parse(e) { - if (this._getType(e) !== A$5.nan) { - let t = this._getOrReturnCtx(e); - return P$5(t, { - code: M$5.invalid_type, - expected: A$5.nan, - received: t.parsedType - }), I$5; - } - return { - status: `valid`, - value: e.data - }; - } -}; -Sc.create = (e) => new Sc({ - typeName: q$5.ZodNaN, - ...B$5(e) -}); -var Cc = class extends V$5 { - _parse(e) { - let { ctx: t } = this._processInputParams(e), n = t.data; - return this._def.type._parse({ - data: n, - path: t.path, - parent: t - }); - } - unwrap() { - return this._def.type; - } -}; -var wc = class e extends V$5 { - _parse(e) { - let { status: t, ctx: n } = this._processInputParams(e); - if (n.common.async) return (async () => { - let e = await this._def.in._parseAsync({ - data: n.data, - path: n.path, - parent: n - }); - return e.status === `aborted` ? I$5 : e.status === `dirty` ? (t.dirty(), hs(e.value)) : this._def.out._parseAsync({ - data: e.value, - path: n.path, - parent: n - }); - })(); - { - let e = this._def.in._parseSync({ - data: n.data, - path: n.path, - parent: n - }); - return e.status === `aborted` ? I$5 : e.status === `dirty` ? (t.dirty(), { - status: `dirty`, - value: e.value - }) : this._def.out._parseSync({ - data: e.value, - path: n.path, - parent: n - }); - } - } - static create(t, n) { - return new e({ - in: t, - out: n, - typeName: q$5.ZodPipeline - }); - } -}; -var Tc = class extends V$5 { - _parse(e) { - let t = this._def.innerType._parse(e), n = (e) => (vs(e) && (e.value = Object.freeze(e.value)), e); - return ys(t) ? t.then((e) => n(e)) : n(t); - } - unwrap() { - return this._def.innerType; - } -}; -Tc.create = (e, t) => new Tc({ - innerType: e, - typeName: q$5.ZodReadonly, - ...B$5(t) -}), U$6.lazycreate; -var q$5; -(function(e) { - e.ZodString = `ZodString`, e.ZodNumber = `ZodNumber`, e.ZodNaN = `ZodNaN`, e.ZodBigInt = `ZodBigInt`, e.ZodBoolean = `ZodBoolean`, e.ZodDate = `ZodDate`, e.ZodSymbol = `ZodSymbol`, e.ZodUndefined = `ZodUndefined`, e.ZodNull = `ZodNull`, e.ZodAny = `ZodAny`, e.ZodUnknown = `ZodUnknown`, e.ZodNever = `ZodNever`, e.ZodVoid = `ZodVoid`, e.ZodArray = `ZodArray`, e.ZodObject = `ZodObject`, e.ZodUnion = `ZodUnion`, e.ZodDiscriminatedUnion = `ZodDiscriminatedUnion`, e.ZodIntersection = `ZodIntersection`, e.ZodTuple = `ZodTuple`, e.ZodRecord = `ZodRecord`, e.ZodMap = `ZodMap`, e.ZodSet = `ZodSet`, e.ZodFunction = `ZodFunction`, e.ZodLazy = `ZodLazy`, e.ZodLiteral = `ZodLiteral`, e.ZodEnum = `ZodEnum`, e.ZodEffects = `ZodEffects`, e.ZodNativeEnum = `ZodNativeEnum`, e.ZodOptional = `ZodOptional`, e.ZodNullable = `ZodNullable`, e.ZodDefault = `ZodDefault`, e.ZodCatch = `ZodCatch`, e.ZodPromise = `ZodPromise`, e.ZodBranded = `ZodBranded`, e.ZodPipeline = `ZodPipeline`, e.ZodReadonly = `ZodReadonly`; -})(q$5 ||= {}), Ws.create, Ks.create, Sc.create, qs.create, Js.create, Ys.create, Xs.create, Zs.create, Qs.create, $s.create, ec.create, H$6.create, tc.create, nc.create, U$6.create, U$6.strictCreate, ic.create, ac.create, sc.create, cc.create, lc.create, uc.create, dc.create, fc.create, pc.create, mc.create, gc.create, _c.create, vc.create, G$6.create, K$5.create, yc.create, G$6.createWithPreprocess, wc.create; -var Ec = class extends Error { - constructor(e, t) { - super(e), this.name = `ParseError`, this.type = t.type, this.field = t.field, this.value = t.value, this.line = t.line; - } -}; -function Dc(e) {} -function Oc(e) { - if (typeof e == `function`) throw TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?"); - let { onEvent: t = Dc, onError: n = Dc, onRetry: r = Dc, onComment: i } = e, a = [], o = !0, s, c = ``, l = 0, u; - function d(e) { - if (o && (o = !1, e.charCodeAt(0) === 239 && e.charCodeAt(1) === 187 && e.charCodeAt(2) === 191 && (e = e.slice(3))), a.length === 0) { - let t = f(e); - t !== `` && a.push(t); - return; - } - if (e.indexOf(` -`) === -1 && e.indexOf(`\r`) === -1) { - a.push(e); - return; - } - a.push(e); - let t = a.join(``); - a.length = 0; - let n = f(t); - n !== `` && a.push(n); - } - function f(e) { - let n = 0; - if (e.indexOf(`\r`) === -1) { - let r = e.indexOf(` -`, n); - for (; r !== -1;) { - if (n === r) { - l > 0 && t({ - id: s, - event: u, - data: c - }), s = void 0, c = ``, l = 0, u = void 0, n = r + 1, r = e.indexOf(` -`, n); - continue; - } - let i = e.charCodeAt(n); - if (kc(e, n, i)) { - let i = e.charCodeAt(n + 5) === 32 ? n + 6 : n + 5, a = e.slice(i, r); - if (l === 0 && e.charCodeAt(r + 1) === 10) { - t({ - id: s, - event: u, - data: a - }), s = void 0, c = ``, u = void 0, n = r + 2, r = e.indexOf(` -`, n); - continue; - } - c = l === 0 ? a : `${c} -${a}`, l++; - } else Ac(e, n, i) ? u = e.slice(e.charCodeAt(n + 6) === 32 ? n + 7 : n + 6, r) || void 0 : p(e, n, r); - n = r + 1, r = e.indexOf(` -`, n); - } - return e.slice(n); - } - for (; n < e.length;) { - let t = e.indexOf(`\r`, n), r = e.indexOf(` -`, n), i = -1; - if (t !== -1 && r !== -1 ? i = t < r ? t : r : t === -1 ? r !== -1 && (i = r) : i = t === e.length - 1 ? -1 : t, i === -1) break; - p(e, n, i), n = i + 1, e.charCodeAt(n - 1) === 13 && e.charCodeAt(n) === 10 && n++; - } - return e.slice(n); - } - function p(e, t, n) { - if (t === n) { - te(); - return; - } - let r = e.charCodeAt(t); - if (kc(e, t, r)) { - let r = e.charCodeAt(t + 5) === 32 ? t + 6 : t + 5, i = e.slice(r, n); - c = l === 0 ? i : `${c} -${i}`, l++; - return; - } - if (Ac(e, t, r)) { - u = e.slice(e.charCodeAt(t + 6) === 32 ? t + 7 : t + 6, n) || void 0; - return; - } - if (r === 105 && e.charCodeAt(t + 1) === 100 && e.charCodeAt(t + 2) === 58) { - let r = e.slice(e.charCodeAt(t + 3) === 32 ? t + 4 : t + 3, n); - s = r.includes(`\0`) ? void 0 : r; - return; - } - if (r === 58) { - i && i(e.slice(t, n).slice(e.charCodeAt(t + 1) === 32 ? 2 : 1)); - return; - } - let a = e.slice(t, n), o = a.indexOf(`:`); - if (o === -1) { - ee(a, ``, a); - return; - } - let d = a.slice(0, o), f = a.charCodeAt(o + 1) === 32 ? 2 : 1; - ee(d, a.slice(o + f), a); - } - function ee(e, t, i) { - switch (e) { - case `event`: - u = t || void 0; - break; - case `data`: - c = l === 0 ? t : `${c} -${t}`, l++; - break; - case `id`: - s = t.includes(`\0`) ? void 0 : t; - break; - case `retry`: - /^\d+$/.test(t) ? r(parseInt(t, 10)) : n(new Ec(`Invalid \`retry\` value: "${t}"`, { - type: `invalid-retry`, - value: t, - line: i - })); - break; - default: - n(new Ec(`Unknown field "${e.length > 20 ? `${e.slice(0, 20)}\u2026` : e}"`, { - type: `unknown-field`, - field: e, - value: t, - line: i - })); - break; - } - } - function te() { - l > 0 && t({ - id: s, - event: u, - data: c - }), s = void 0, c = ``, l = 0, u = void 0; - } - function m(e = {}) { - if (e.consume && a.length > 0) { - let e = a.join(``); - p(e, 0, e.length); - } - o = !0, s = void 0, c = ``, l = 0, u = void 0, a.length = 0; - } - return { - feed: d, - reset: m - }; -} -function kc(e, t, n) { - return n === 100 && e.charCodeAt(t + 1) === 97 && e.charCodeAt(t + 2) === 116 && e.charCodeAt(t + 3) === 97 && e.charCodeAt(t + 4) === 58; -} -function Ac(e, t, n) { - return n === 101 && e.charCodeAt(t + 1) === 118 && e.charCodeAt(t + 2) === 101 && e.charCodeAt(t + 3) === 110 && e.charCodeAt(t + 4) === 116 && e.charCodeAt(t + 5) === 58; -} -var jc = class extends TransformStream { - constructor({ onError: e, onRetry: t, onComment: n } = {}) { - let r; - super({ - start(i) { - r = Oc({ - onEvent: (e) => { - i.enqueue(e); - }, - onError(t) { - e === `terminate` ? i.error(t) : typeof e == `function` && e(t); - }, - onRetry: t, - onComment: n - }); - }, - transform(e) { - r.feed(e); - } - }); - } -}; -const Mc = Symbol.for(`workflow-serialize`); -const Nc = Symbol.for(`workflow-deserialize`); -function Pc(...e) { - return e.reduce((e, t) => ({ - ...e, - ...t ?? {} - }), {}); -} -var { btoa: Fc, atob: Ic } = globalThis; -function Lc(e) { - let t = Ic(e.replace(/-/g, `+`).replace(/_/g, `/`)); - return Uint8Array.from(t, (e) => e.codePointAt(0)); -} -function Rc(e) { - let t = ``; - for (let n = 0; n < e.length; n++) t += String.fromCodePoint(e[n]); - return Fc(t); -} -function zc(e) { - return e instanceof Uint8Array ? Rc(e) : e; -} -function Bc(e) { - return e.type === `text` ? new TextEncoder().encode(e.text) : e.data instanceof Uint8Array ? e.data : e.data instanceof ArrayBuffer ? new Uint8Array(e.data) : Lc(e.data); -} -function Vc(e, t = {}) { - let { useArrayBrackets: n = !0 } = t, r = new FormData(); - for (let [t, i] of Object.entries(e)) if (i != null) { - if (Array.isArray(i)) { - if (i.length === 1) { - r.append(t, i[0]); - continue; - } - let e = n ? `${t}[]` : t; - for (let t of i) r.append(e, t); - continue; - } - r.append(t, i); - } - return r; -} -function Hc({ tools: e = [], providerToolNames: t }) { - let n = {}, r = {}; - for (let i of e) if (i.type === `provider` && i.id in t) { - let e = t[i.id]; - n[i.name] = e, r[e] = i.name; - } - return { - toProviderToolName: (e) => n[e] ?? e, - toCustomToolName: (e) => r[e] ?? e - }; -} -async function Uc(e, t) { - if (e == null) return Promise.resolve(); - let n = t?.abortSignal; - return new Promise((t, r) => { - if (n?.aborted) { - r(Wc()); - return; - } - let i = setTimeout(() => { - a(), t(); - }, e), a = () => { - clearTimeout(i), n?.removeEventListener(`abort`, o); - }, o = () => { - a(), r(Wc()); - }; - n?.addEventListener(`abort`, o); - }); -} -function Wc() { - return new DOMException(`Delay was aborted`, `AbortError`); -} -var Gc = [ - { - mediaType: `image/gif`, - bytesPrefix: [ - 71, - 73, - 70 - ] - }, - { - mediaType: `image/png`, - bytesPrefix: [ - 137, - 80, - 78, - 71 - ] - }, - { - mediaType: `image/jpeg`, - bytesPrefix: [255, 216] - }, - { - mediaType: `image/webp`, - bytesPrefix: [ - 82, - 73, - 70, - 70, - null, - null, - null, - null, - 87, - 69, - 66, - 80 - ] - }, - { - mediaType: `image/bmp`, - bytesPrefix: [66, 77] - }, - { - mediaType: `image/tiff`, - bytesPrefix: [ - 73, - 73, - 42, - 0 - ] - }, - { - mediaType: `image/tiff`, - bytesPrefix: [ - 77, - 77, - 0, - 42 - ] - }, - { - mediaType: `image/avif`, - bytesPrefix: [ - 0, - 0, - 0, - 32, - 102, - 116, - 121, - 112, - 97, - 118, - 105, - 102 - ] - }, - { - mediaType: `image/heic`, - bytesPrefix: [ - 0, - 0, - 0, - 32, - 102, - 116, - 121, - 112, - 104, - 101, - 105, - 99 - ] - } -]; -var Kc = [{ - mediaType: `application/pdf`, - bytesPrefix: [ - 37, - 80, - 68, - 70 - ] -}]; -var qc = [ - { - mediaType: `audio/mpeg`, - bytesPrefix: [255, 251] - }, - { - mediaType: `audio/mpeg`, - bytesPrefix: [255, 250] - }, - { - mediaType: `audio/mpeg`, - bytesPrefix: [255, 243] - }, - { - mediaType: `audio/mpeg`, - bytesPrefix: [255, 242] - }, - { - mediaType: `audio/mpeg`, - bytesPrefix: [255, 227] - }, - { - mediaType: `audio/mpeg`, - bytesPrefix: [255, 226] - }, - { - mediaType: `audio/wav`, - bytesPrefix: [ - 82, - 73, - 70, - 70, - null, - null, - null, - null, - 87, - 65, - 86, - 69 - ] - }, - { - mediaType: `audio/ogg`, - bytesPrefix: [ - 79, - 103, - 103, - 83 - ] - }, - { - mediaType: `audio/flac`, - bytesPrefix: [ - 102, - 76, - 97, - 67 - ] - }, - { - mediaType: `audio/aac`, - bytesPrefix: [ - 64, - 21, - 0, - 0 - ] - }, - { - mediaType: `audio/mp4`, - bytesPrefix: [ - 102, - 116, - 121, - 112 - ] - }, - { - mediaType: `audio/webm`, - bytesPrefix: [ - 26, - 69, - 223, - 163 - ] - } -]; -var Jc = [ - { - mediaType: `video/mp4`, - bytesPrefix: [ - 0, - 0, - 0, - null, - 102, - 116, - 121, - 112 - ] - }, - { - mediaType: `video/webm`, - bytesPrefix: [ - 26, - 69, - 223, - 163 - ] - }, - { - mediaType: `video/quicktime`, - bytesPrefix: [ - 0, - 0, - 0, - 20, - 102, - 116, - 121, - 112, - 113, - 116 - ] - }, - { - mediaType: `video/x-msvideo`, - bytesPrefix: [ - 82, - 73, - 70, - 70 - ] - } -]; -var Yc = (e) => { - let t = typeof e == `string` ? Lc(e) : e, n = (t[6] & 127) << 21 | (t[7] & 127) << 14 | (t[8] & 127) << 7 | t[9] & 127; - return t.slice(n + 10); -}; -function Xc(e) { - return typeof e == `string` && e.startsWith(`SUQz`) || typeof e != `string` && e.length > 10 && e[0] === 73 && e[1] === 68 && e[2] === 51 ? Yc(e) : e; -} -function Zc({ data: e, signatures: t }) { - let n = Xc(e), r = typeof n == `string` ? Lc(n.substring(0, Math.min(n.length, 24))) : n; - for (let e of t) if (r.length >= e.bytesPrefix.length && e.bytesPrefix.every((e, t) => e === null || r[t] === e)) return e.mediaType; -} -var Qc = { - image: Gc, - audio: qc, - video: Jc, - application: Kc -}; -function $c({ data: e, topLevelType: t }) { - if (t === void 0) return Zc({ - data: e, - signatures: [ - ...Gc, - ...Kc, - ...qc, - ...Jc - ] - }); - let n = Qc[t]; - if (n !== void 0) return Zc({ - data: e, - signatures: n - }); -} -function el(e) { - let t = e.indexOf(`/`); - return t === -1 ? e : e.substring(0, t); -} -function tl(e) { - let t = e.indexOf(`/`); - if (t === -1) return !1; - let n = e.substring(t + 1); - return n.length > 0 && n !== `*`; -} -async function nl(e) { - try { - await e.body?.cancel(); - } catch {} -} -var rl = `AI_DownloadError`; -var il = `vercel.ai.error.${rl}`; -var al = Symbol.for(il); -var ol; -var sl; -var J$5 = class extends (sl = i$17, ol = al, sl) { - constructor({ url: e, statusCode: t, statusText: n, cause: r, message: i = r == null ? `Failed to download ${e}: ${t} ${n}` : `Failed to download ${e}: ${r}` }) { - super({ - name: rl, - message: i, - cause: r - }), this[ol] = !0, this.url = e, this.statusCode = t, this.statusText = n; - } - static isInstance(t) { - return i$17.hasMarker(t, il); - } -}; -function cl(e = globalThis) { - return e.window != null; -} -function ll(e) { - let t; - try { - t = new URL(e); - } catch { - throw new J$5({ - url: e, - message: `Invalid URL: ${e}` - }); - } - if (t.protocol === `data:`) return; - if (t.protocol !== `http:` && t.protocol !== `https:`) throw new J$5({ - url: e, - message: `URL scheme must be http, https, or data, got ${t.protocol}` - }); - let n = t.hostname.toLowerCase().replace(/\.+$/, ``); - if (!n) throw new J$5({ - url: e, - message: `URL must have a hostname` - }); - if (n === `localhost` || n.endsWith(`.local`) || n.endsWith(`.localhost`)) throw new J$5({ - url: e, - message: `URL with hostname ${n} is not allowed` - }); - if (n.startsWith(`[`) && n.endsWith(`]`)) { - if (pl(n.slice(1, -1))) throw new J$5({ - url: e, - message: `URL with IPv6 address ${n} is not allowed` - }); - return; - } - if (ul(n)) { - if (dl(n)) throw new J$5({ - url: e, - message: `URL with IP address ${n} is not allowed` - }); - return; - } -} -function ul(e) { - let t = e.split(`.`); - return t.length === 4 ? t.every((e) => { - let t = Number(e); - return Number.isInteger(t) && t >= 0 && t <= 255 && String(t) === e; - }) : !1; -} -function dl(e) { - let [t, n, r] = e.split(`.`).map(Number); - return t === 0 || t === 10 || t === 100 && n >= 64 && n <= 127 || t === 127 || t === 169 && n === 254 || t === 172 && n >= 16 && n <= 31 || t === 192 && n === 0 && r === 0 || t === 192 && n === 168 || t === 198 && (n === 18 || n === 19) || t >= 240; -} -function fl(e) { - let t = e.toLowerCase(), n = t.indexOf(`%`); - n !== -1 && (t = t.slice(0, n)); - let r = t.split(`::`); - if (r.length > 2) return null; - let i = (e) => { - if (e === ``) return []; - let t = [], n = e.split(`:`); - for (let e = 0; e < n.length; e++) { - let r = n[e]; - if (r.includes(`.`)) { - if (e !== n.length - 1 || !ul(r)) return null; - let [i, a, o, s] = r.split(`.`).map(Number); - t.push(i << 8 | a, o << 8 | s); - continue; - } - if (!/^[0-9a-f]{1,4}$/.test(r)) return null; - t.push(parseInt(r, 16)); - } - return t; - }, a = i(r[0]); - if (a === null) return null; - if (r.length === 2) { - let e = i(r[1]); - if (e === null) return null; - let t = 8 - a.length - e.length; - return t < 0 ? null : [ - ...a, - ...Array(t).fill(0), - ...e - ]; - } - return a.length === 8 ? a : null; -} -function pl(e) { - let t = fl(e); - if (t === null) return !0; - let n = (e) => t.slice(0, e).every((e) => e === 0); - return n(7) && (t[7] === 0 || t[7] === 1) || (t[0] & 65024) == 64512 || (t[0] & 65472) == 65152 || (t[0] & 65472) == 65216 || (t[0] & 65280) == 65280 ? !0 : n(6) || n(5) && t[5] === 65535 || n(4) && t[4] === 65535 && t[5] === 0 || t[0] === 100 && t[1] === 65435 && t[2] === 0 && t[3] === 0 && t[4] === 0 && t[5] === 0 || t[0] === 100 && t[1] === 65435 && t[2] === 1 ? dl(`${t[6] >> 8 & 255}.${t[6] & 255}.${t[7] >> 8 & 255}.${t[7] & 255}`) : !1; -} -var ml = 10; -async function hl({ url: e, headers: t, abortSignal: n, maxRedirects: r = ml }) { - let i = { signal: n }; - t !== void 0 && (i.headers = t); - let a = e; - for (let t = 0; t <= r; t++) { - ll(a); - let t = await fetch(a, { - ...i, - redirect: `manual` - }); - if (t.type === `opaqueredirect`) { - if (!cl()) throw new J$5({ - url: e, - message: `Redirect from ${a} could not be validated and was blocked` - }); - return await fetch(a, { - ...i, - redirect: `follow` - }); - } - let n = t.headers.get(`location`); - if (t.status >= 300 && t.status < 400 && n) { - await nl(t), a = new URL(n, a).toString(); - continue; - } - return t; - } - throw new J$5({ - url: e, - message: `Too many redirects (max ${r})` - }); -} -var gl = 2 * 1024 * 1024 * 1024; -async function _l({ response: e, url: t, maxBytes: n = gl }) { - let r = e.headers.get(`content-length`); - if (r != null) { - let i = parseInt(r, 10); - if (!isNaN(i) && i > n) throw await nl(e), new J$5({ - url: t, - message: `Download of ${t} exceeded maximum size of ${n} bytes (Content-Length: ${i}).` - }); - } - let i = e.body; - if (i == null) return /* @__PURE__ */ new Uint8Array(); - let a = i.getReader(), o = [], s = 0; - try { - for (;;) { - let { done: e, value: r } = await a.read(); - if (e) break; - if (s += r.length, s > n) throw new J$5({ - url: t, - message: `Download of ${t} exceeded maximum size of ${n} bytes.` - }); - o.push(r); - } - } finally { - try { - await a.cancel(); - } finally { - a.releaseLock(); - } - } - let c = new Uint8Array(s), l = 0; - for (let e of o) c.set(e, l), l += e.length; - return c; -} -async function vl(e, t) { - try { - let n = await hl({ - url: e, - abortSignal: t?.abortSignal - }); - if (!n.ok) throw await nl(n), new J$5({ - url: e, - statusCode: n.status, - statusText: n.statusText - }); - let r = await _l({ - response: n, - url: e, - maxBytes: t?.maxBytes ?? gl - }), i = n.headers.get(`content-type`) ?? void 0; - return new Blob([r], i ? { type: i } : void 0); - } catch (t) { - throw J$5.isInstance(t) ? t : new J$5({ - url: e, - cause: t - }); - } -} -function yl(e) { - return Object.fromEntries([...e.headers]); -} -var bl = (({ prefix: e, size: t = 16, alphabet: n = `0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`, separator: i = `-` } = {}) => { - let a = () => { - let e = n.length, r = Array(t); - for (let i = 0; i < t; i++) r[i] = n[Math.random() * e | 0]; - return r.join(``); - }; - if (e == null) return a; - if (n.includes(i)) throw new ae$10({ - argument: `separator`, - message: `The separator "${i}" must not be part of the alphabet "${n}".` - }); - return () => `${e}${i}${a()}`; -})(); -function xl(e) { - return (e instanceof Error || e instanceof DOMException) && (e.name === `AbortError` || e.name === `ResponseAborted` || e.name === `TimeoutError`); -} -var Sl = [`fetch failed`, `failed to fetch`]; -var Cl = [ - `ConnectionRefused`, - `ConnectionClosed`, - `FailedToOpenSocket`, - `ECONNRESET`, - `ECONNREFUSED`, - `ETIMEDOUT`, - `EPIPE` -]; -function wl(e) { - if (!(e instanceof Error)) return !1; - let t = e.code; - return !!(typeof t == `string` && Cl.includes(t)); -} -function Tl({ error: e, url: n, requestBodyValues: r }) { - if (xl(e)) return e; - if (e instanceof TypeError && Sl.includes(e.message.toLowerCase())) { - let i = e.cause; - if (i != null) return new c$14({ - message: `Cannot connect to API: ${i.message}`, - cause: i, - url: n, - requestBodyValues: r, - isRetryable: !0 - }); - } - return wl(e) ? new c$14({ - message: `Cannot connect to API: ${e.message}`, - cause: e, - url: n, - requestBodyValues: r, - isRetryable: !0 - }) : e; -} -function El(e = globalThis) { - return e.window ? `runtime/browser` : e.navigator?.userAgent ? `runtime/${e.navigator.userAgent.toLowerCase()}` : e.process?.versions?.node ? `runtime/node.js/${e.process.version.substring(0)}` : e.EdgeRuntime ? `runtime/vercel-edge` : `runtime/unknown`; -} -function Dl(e) { - if (e == null) return {}; - let t = {}; - if (e instanceof Headers) e.forEach((e, n) => { - t[n.toLowerCase()] = e; - }); - else { - Array.isArray(e) || (e = Object.entries(e)); - for (let [n, r] of e) r != null && (t[n.toLowerCase()] = r); - } - return t; -} -function Ol(e, ...t) { - let n = new Headers(Dl(e)), r = n.get(`user-agent`) || ``; - return n.set(`user-agent`, [r, ...t].filter(Boolean).join(` `)), Object.fromEntries(n.entries()); -} -var kl = `5.0.0`; -var Al = () => globalThis.fetch; -var jl = async ({ url: e, headers: n = {}, successfulResponseHandler: r, failedResponseHandler: i, abortSignal: a, fetch: o = Al() }) => { - try { - let s = await o(e, { - method: `GET`, - headers: Ol(n, `ai-sdk/provider-utils/${kl}`, El()), - signal: a - }), c = yl(s); - if (!s.ok) { - let n; - try { - n = await i({ - response: s, - url: e, - requestBodyValues: {} - }); - } catch (n) { - throw xl(n) || c$14.isInstance(n) ? n : new c$14({ - message: `Failed to process error response`, - cause: n, - statusCode: s.status, - url: e, - responseHeaders: c, - requestBodyValues: {} - }); - } - throw n.value; - } - try { - return await r({ - response: s, - url: e, - requestBodyValues: {} - }); - } catch (n) { - throw n instanceof Error && (xl(n) || c$14.isInstance(n)) ? n : new c$14({ - message: `Failed to process successful response`, - cause: n, - statusCode: s.status, - url: e, - responseHeaders: c, - requestBodyValues: {} - }); - } - } catch (t) { - throw Tl({ - error: t, - url: e, - requestBodyValues: {} - }); - } -}; -function Ml(e, t) { - try { - return new URL(e).origin === new URL(t).origin; - } catch { - return !1; - } -} -function Nl(e) { - return e != null; -} -function Pl({ apiKey: e, environmentVariableName: t, apiKeyParameterName: n = `apiKey`, description: r }) { - if (typeof e == `string`) return e; - if (e != null) throw new pe$10({ message: `${r} API key must be a string.` }); - if (typeof process > `u`) throw new pe$10({ message: `${r} API key is missing. Pass it using the '${n}' parameter. Environment variables are not supported in this environment.` }); - if (e = process.env[t], e == null) throw new pe$10({ message: `${r} API key is missing. Pass it using the '${n}' parameter or the ${t} environment variable.` }); - if (typeof e != `string`) throw new pe$10({ message: `${r} API key must be a string. The value of the ${t} environment variable is not a string.` }); - return e; -} -function Fl({ settingValue: e, environmentVariableName: t }) { - if (typeof e == `string` || !(e != null || typeof process > `u`) && (e = process.env[t], !(e == null || typeof e != `string`))) return e; -} -function Il(e) { - return e !== void 0 && e !== `provider-default`; -} -function Ll({ reasoning: e, effortMap: t, warnings: n }) { - let r = t[e]; - if (r == null) { - n.push({ - type: `unsupported`, - feature: `reasoning`, - details: `reasoning "${e}" is not supported by this model.` - }); - return; - } - return r !== e && n.push({ - type: `compatibility`, - feature: `reasoning`, - details: `reasoning "${e}" is not directly supported by this model. mapped to effort "${r}".` - }), r; -} -var Rl = { - minimal: .02, - low: .1, - medium: .3, - high: .6, - xhigh: .9 -}; -function zl({ reasoning: e, maxOutputTokens: t, maxReasoningBudget: n, minReasoningBudget: r = 1024, budgetPercentages: i = Rl, warnings: a }) { - let o = i[e]; - if (o == null) { - a.push({ - type: `unsupported`, - feature: `reasoning`, - details: `reasoning "${e}" is not supported by this model.` - }); - return; - } - return Math.min(n, Math.max(r, Math.round(t * o))); -} -function Bl(e) { - let [t, n = ``] = e.toLowerCase().split(`/`); - return { - mpeg: `mp3`, - "x-wav": `wav`, - opus: `ogg`, - mp4: `m4a`, - "x-m4a": `m4a` - }[n] ?? n; -} -var Vl = /"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/; -var Hl = /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/; -function Ul(e) { - let t = JSON.parse(e); - return typeof t != `object` || !t || Vl.test(e) === !1 && Hl.test(e) === !1 ? t : Wl(t); -} -function Wl(e) { - let t = [e]; - for (; t.length;) { - let e = t; - t = []; - for (let n of e) { - if (Object.prototype.hasOwnProperty.call(n, `__proto__`) || Object.prototype.hasOwnProperty.call(n, `constructor`) && n.constructor !== null && typeof n.constructor == `object` && Object.prototype.hasOwnProperty.call(n.constructor, `prototype`)) throw SyntaxError(`Object contains forbidden prototype property`); - for (let e in n) { - let r = n[e]; - r && typeof r == `object` && t.push(r); - } - } - } - return e; -} -function Gl(e) { - let { stackTraceLimit: t } = Error; - try { - Error.stackTraceLimit = 0; - } catch { - return Ul(e); - } - try { - return Ul(e); - } finally { - Error.stackTraceLimit = t; - } -} -function Kl(e) { - if (e.type === `object` || Array.isArray(e.type) && e.type.includes(`object`)) { - e.additionalProperties = !1; - let { properties: t } = e; - if (t != null) for (let e of Object.keys(t)) t[e] = ql(t[e]); - } - e.items != null && (e.items = Array.isArray(e.items) ? e.items.map(ql) : ql(e.items)), e.anyOf != null && (e.anyOf = e.anyOf.map(ql)), e.allOf != null && (e.allOf = e.allOf.map(ql)), e.oneOf != null && (e.oneOf = e.oneOf.map(ql)); - let { definitions: t } = e; - if (t != null) for (let e of Object.keys(t)) t[e] = ql(t[e]); - return e; -} -function ql(e) { - return typeof e == `boolean` ? e : Kl(e); -} -var Jl = Symbol(`Let zodToJsonSchema decide on which parser to use`); -var Yl = { - name: void 0, - $refStrategy: `root`, - basePath: [`#`], - effectStrategy: `input`, - pipeStrategy: `all`, - dateStrategy: `format:date-time`, - mapStrategy: `entries`, - removeAdditionalStrategy: `passthrough`, - allowedAdditionalProperties: !0, - rejectedAdditionalProperties: !1, - definitionPath: `definitions`, - strictUnions: !1, - definitions: {}, - errorMessages: !1, - patternStrategy: `escape`, - applyRegexFlags: !1, - emailStrategy: `format:email`, - base64Strategy: `contentEncoding:base64`, - nameStrategy: `ref` -}; -var Xl = (e) => typeof e == `string` ? { - ...Yl, - name: e -} : { - ...Yl, - ...e -}; -function Y$7() { - return {}; -} -function Zl(e, t) { - let n = { type: `array` }; - return e.type?._def && e.type?._def?.typeName !== q$5.ZodAny && (n.items = $$7(e.type._def, { - ...t, - currentPath: [...t.currentPath, `items`] - })), e.minLength && (n.minItems = e.minLength.value), e.maxLength && (n.maxItems = e.maxLength.value), e.exactLength && (n.minItems = e.exactLength.value, n.maxItems = e.exactLength.value), n; -} -function Ql(e) { - let t = { - type: `integer`, - format: `int64` - }; - if (!e.checks) return t; - for (let n of e.checks) switch (n.kind) { - case `min`: - n.inclusive ? t.minimum = n.value : t.exclusiveMinimum = n.value; - break; - case `max`: - n.inclusive ? t.maximum = n.value : t.exclusiveMaximum = n.value; - break; - case `multipleOf`: - t.multipleOf = n.value; - break; - } - return t; -} -function $l() { - return { type: `boolean` }; -} -function eu(e, t) { - return $$7(e.type._def, t); -} -var tu = (e, t) => $$7(e.innerType._def, t); -function nu(e, t, n) { - let r = n ?? t.dateStrategy; - if (Array.isArray(r)) return { anyOf: r.map((n) => nu(e, t, n)) }; - switch (r) { - case `string`: - case `format:date-time`: return { - type: `string`, - format: `date-time` - }; - case `format:date`: return { - type: `string`, - format: `date` - }; - case `integer`: return ru(e); - } -} -var ru = (e) => { - let t = { - type: `integer`, - format: `unix-time` - }; - for (let n of e.checks) switch (n.kind) { - case `min`: - t.minimum = n.value; - break; - case `max`: - t.maximum = n.value; - break; - } - return t; -}; -function iu(e, t) { - return { - ...$$7(e.innerType._def, t), - default: e.defaultValue() - }; -} -function au(e, t) { - return t.effectStrategy === `input` ? $$7(e.schema._def, t) : Y$7(); -} -function ou(e) { - return { - type: `string`, - enum: Array.from(e.values) - }; -} -var su = (e) => `type` in e && e.type === `string` ? !1 : `allOf` in e; -function cu(e, t) { - let n = [$$7(e.left._def, { - ...t, - currentPath: [ - ...t.currentPath, - `allOf`, - `0` - ] - }), $$7(e.right._def, { - ...t, - currentPath: [ - ...t.currentPath, - `allOf`, - `1` - ] - })].filter((e) => !!e), r = []; - return n.forEach((e) => { - if (su(e)) r.push(...e.allOf); - else { - let t = e; - if (`additionalProperties` in e && e.additionalProperties === !1) { - let { additionalProperties: n, ...r } = e; - t = r; - } - r.push(t); - } - }), r.length ? { allOf: r } : void 0; -} -function lu(e) { - let t = typeof e.value; - return t !== `bigint` && t !== `number` && t !== `boolean` && t !== `string` ? { type: Array.isArray(e.value) ? `array` : `object` } : { - type: t === `bigint` ? `integer` : t, - const: e.value - }; -} -var uu = void 0; -var X$7 = { - cuid: /^[cC][^\s-]{8,}$/, - cuid2: /^[0-9a-z]+$/, - ulid: /^[0-9A-HJKMNP-TV-Z]{26}$/, - email: /^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/, - emoji: () => (uu === void 0 && (uu = RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`, `u`)), uu), - uuid: /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/, - ipv4: /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, - ipv4Cidr: /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, - ipv6: /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/, - ipv6Cidr: /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, - base64: /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, - base64url: /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, - nanoid: /^[a-zA-Z0-9_-]{21}$/, - jwt: /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/ -}; -function du(e, t) { - let n = { type: `string` }; - if (e.checks) for (let r of e.checks) switch (r.kind) { - case `min`: - n.minLength = typeof n.minLength == `number` ? Math.max(n.minLength, r.value) : r.value; - break; - case `max`: - n.maxLength = typeof n.maxLength == `number` ? Math.min(n.maxLength, r.value) : r.value; - break; - case `email`: - switch (t.emailStrategy) { - case `format:email`: - Z$7(n, `email`, r.message, t); - break; - case `format:idn-email`: - Z$7(n, `idn-email`, r.message, t); - break; - case `pattern:zod`: - Q$7(n, X$7.email, r.message, t); - break; - } - break; - case `url`: - Z$7(n, `uri`, r.message, t); - break; - case `uuid`: - Z$7(n, `uuid`, r.message, t); - break; - case `regex`: - Q$7(n, r.regex, r.message, t); - break; - case `cuid`: - Q$7(n, X$7.cuid, r.message, t); - break; - case `cuid2`: - Q$7(n, X$7.cuid2, r.message, t); - break; - case `startsWith`: - Q$7(n, RegExp(`^${fu(r.value, t)}`), r.message, t); - break; - case `endsWith`: - Q$7(n, RegExp(`${fu(r.value, t)}$`), r.message, t); - break; - case `datetime`: - Z$7(n, `date-time`, r.message, t); - break; - case `date`: - Z$7(n, `date`, r.message, t); - break; - case `time`: - Z$7(n, `time`, r.message, t); - break; - case `duration`: - Z$7(n, `duration`, r.message, t); - break; - case `length`: - n.minLength = typeof n.minLength == `number` ? Math.max(n.minLength, r.value) : r.value, n.maxLength = typeof n.maxLength == `number` ? Math.min(n.maxLength, r.value) : r.value; - break; - case `includes`: - Q$7(n, RegExp(fu(r.value, t)), r.message, t); - break; - case `ip`: - r.version !== `v6` && Z$7(n, `ipv4`, r.message, t), r.version !== `v4` && Z$7(n, `ipv6`, r.message, t); - break; - case `base64url`: - Q$7(n, X$7.base64url, r.message, t); - break; - case `jwt`: - Q$7(n, X$7.jwt, r.message, t); - break; - case `cidr`: - r.version !== `v6` && Q$7(n, X$7.ipv4Cidr, r.message, t), r.version !== `v4` && Q$7(n, X$7.ipv6Cidr, r.message, t); - break; - case `emoji`: - Q$7(n, X$7.emoji(), r.message, t); - break; - case `ulid`: - Q$7(n, X$7.ulid, r.message, t); - break; - case `base64`: - switch (t.base64Strategy) { - case `format:binary`: - Z$7(n, `binary`, r.message, t); - break; - case `contentEncoding:base64`: - n.contentEncoding = `base64`; - break; - case `pattern:zod`: - Q$7(n, X$7.base64, r.message, t); - break; - } - break; - case `nanoid`: Q$7(n, X$7.nanoid, r.message, t); - case `toLowerCase`: - case `toUpperCase`: - case `trim`: break; - default: - } - return n; -} -function fu(e, t) { - return t.patternStrategy === `escape` ? mu(e) : e; -} -var pu = /* @__PURE__ */ new Set(`ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789`); -function mu(e) { - let t = ``; - for (let n = 0; n < e.length; n++) pu.has(e[n]) || (t += `\\`), t += e[n]; - return t; -} -function Z$7(e, t, n, r) { - e.format || e.anyOf?.some((e) => e.format) ? (e.anyOf ||= [], e.format && (e.anyOf.push({ format: e.format }), delete e.format), e.anyOf.push({ - format: t, - ...n && r.errorMessages && { errorMessage: { format: n } } - })) : e.format = t; -} -function Q$7(e, t, n, r) { - e.pattern || e.allOf?.some((e) => e.pattern) ? (e.allOf ||= [], e.pattern && (e.allOf.push({ pattern: e.pattern }), delete e.pattern), e.allOf.push({ - pattern: hu(t, r), - ...n && r.errorMessages && { errorMessage: { pattern: n } } - })) : e.pattern = hu(t, r); -} -function hu(e, t) { - if (!t.applyRegexFlags || !e.flags) return e.source; - let n = { - i: e.flags.includes(`i`), - m: e.flags.includes(`m`), - s: e.flags.includes(`s`) - }, r = n.i ? e.source.toLowerCase() : e.source, i = ``, a = !1, o = !1, s = !1; - for (let e = 0; e < r.length; e++) { - if (a) { - i += r[e], a = !1; - continue; - } - if (n.i) { - if (o) { - if (r[e].match(/[a-z]/)) { - s ? (i += r[e], i += `${r[e - 2]}-${r[e]}`.toUpperCase(), s = !1) : r[e + 1] === `-` && r[e + 2]?.match(/[a-z]/) ? (i += r[e], s = !0) : i += `${r[e]}${r[e].toUpperCase()}`; - continue; - } - } else if (r[e].match(/[a-z]/)) { - i += `[${r[e]}${r[e].toUpperCase()}]`; - continue; - } - } - if (n.m) { - if (r[e] === `^`) { - i += `(^|(?<=[\r -]))`; - continue; - } else if (r[e] === `$`) { - i += `($|(?=[\r -]))`; - continue; - } - } - if (n.s && r[e] === `.`) { - i += o ? `${r[e]}\r -` : `[${r[e]}\r -]`; - continue; - } - i += r[e], r[e] === `\\` ? a = !0 : o && r[e] === `]` ? o = !1 : !o && r[e] === `[` && (o = !0); - } - try { - new RegExp(i); - } catch { - return console.warn(`Could not convert regex pattern at ${t.currentPath.join(`/`)} to a flag-independent form! Falling back to the flag-ignorant source`), e.source; - } - return i; -} -function gu(e, t) { - let n = { - type: `object`, - additionalProperties: $$7(e.valueType._def, { - ...t, - currentPath: [...t.currentPath, `additionalProperties`] - }) ?? t.allowedAdditionalProperties - }; - if (e.keyType?._def.typeName === q$5.ZodString && e.keyType._def.checks?.length) { - let { type: r, ...i } = du(e.keyType._def, t); - return { - ...n, - propertyNames: i - }; - } else if (e.keyType?._def.typeName === q$5.ZodEnum) return { - ...n, - propertyNames: { enum: e.keyType._def.values } - }; - else if (e.keyType?._def.typeName === q$5.ZodBranded && e.keyType._def.type._def.typeName === q$5.ZodString && e.keyType._def.type._def.checks?.length) { - let { type: r, ...i } = eu(e.keyType._def, t); - return { - ...n, - propertyNames: i - }; - } - return n; -} -function _u(e, t) { - return t.mapStrategy === `record` ? gu(e, t) : { - type: `array`, - maxItems: 125, - items: { - type: `array`, - items: [$$7(e.keyType._def, { - ...t, - currentPath: [ - ...t.currentPath, - `items`, - `items`, - `0` - ] - }) || Y$7(), $$7(e.valueType._def, { - ...t, - currentPath: [ - ...t.currentPath, - `items`, - `items`, - `1` - ] - }) || Y$7()], - minItems: 2, - maxItems: 2 - } - }; -} -function vu(e) { - let t = e.values, n = Object.keys(e.values).filter((e) => typeof t[t[e]] != `number`).map((e) => t[e]), r = Array.from(new Set(n.map((e) => typeof e))); - return { - type: r.length === 1 ? r[0] === `string` ? `string` : `number` : [`string`, `number`], - enum: n - }; -} -function yu() { - return { not: Y$7() }; -} -function bu() { - return { type: `null` }; -} -var xu = { - ZodString: `string`, - ZodNumber: `number`, - ZodBigInt: `integer`, - ZodBoolean: `boolean`, - ZodNull: `null` -}; -function Su(e, t) { - let n = e.options instanceof Map ? Array.from(e.options.values()) : e.options; - if (n.every((e) => e._def.typeName in xu && (!e._def.checks || !e._def.checks.length))) { - let e = n.reduce((e, t) => { - let n = xu[t._def.typeName]; - return n && !e.includes(n) ? [...e, n] : e; - }, []); - return { type: e.length > 1 ? e : e[0] }; - } else if (n.every((e) => e._def.typeName === `ZodLiteral` && !e.description)) { - let e = n.reduce((e, t) => { - let n = typeof t._def.value; - switch (n) { - case `string`: - case `number`: - case `boolean`: return [...e, n]; - case `bigint`: return [...e, `integer`]; - case `object`: if (t._def.value === null) return [...e, `null`]; - default: return e; - } - }, []); - if (e.length === n.length) { - let t = e.filter((e, t, n) => n.indexOf(e) === t); - return { - type: t.length > 1 ? t : t[0], - enum: n.reduce((e, t) => e.includes(t._def.value) ? e : [...e, t._def.value], []) - }; - } - } else if (n.every((e) => e._def.typeName === `ZodEnum`)) return { - type: `string`, - enum: n.reduce((e, t) => [...e, ...t._def.values.filter((t) => !e.includes(t))], []) - }; - return Cu(e, t); -} -var Cu = (e, t) => { - let n = (e.options instanceof Map ? Array.from(e.options.values()) : e.options).map((e, n) => $$7(e._def, { - ...t, - currentPath: [ - ...t.currentPath, - `anyOf`, - `${n}` - ] - })).filter((e) => !!e && (!t.strictUnions || typeof e == `object` && Object.keys(e).length > 0)); - return n.length ? { anyOf: n } : void 0; -}; -function wu(e, t) { - if ([ - `ZodString`, - `ZodNumber`, - `ZodBigInt`, - `ZodBoolean`, - `ZodNull` - ].includes(e.innerType._def.typeName) && (!e.innerType._def.checks || !e.innerType._def.checks.length)) return { type: [xu[e.innerType._def.typeName], `null`] }; - let n = $$7(e.innerType._def, { - ...t, - currentPath: [ - ...t.currentPath, - `anyOf`, - `0` - ] - }); - return n && { anyOf: [n, { type: `null` }] }; -} -function Tu(e) { - let t = { type: `number` }; - if (!e.checks) return t; - for (let n of e.checks) switch (n.kind) { - case `int`: - t.type = `integer`; - break; - case `min`: - n.inclusive ? t.minimum = n.value : t.exclusiveMinimum = n.value; - break; - case `max`: - n.inclusive ? t.maximum = n.value : t.exclusiveMaximum = n.value; - break; - case `multipleOf`: - t.multipleOf = n.value; - break; - } - return t; -} -function Eu(e, t) { - let n = { - type: `object`, - properties: {} - }, r = [], i = e.shape(); - for (let e in i) { - let a = i[e]; - if (a === void 0 || a._def === void 0) continue; - let o = Ou(a), s = $$7(a._def, { - ...t, - currentPath: [ - ...t.currentPath, - `properties`, - e - ], - propertyPath: [ - ...t.currentPath, - `properties`, - e - ] - }); - s !== void 0 && (n.properties[e] = s, o || r.push(e)); - } - r.length && (n.required = r); - let a = Du(e, t); - return a !== void 0 && (n.additionalProperties = a), n; -} -function Du(e, t) { - if (e.catchall._def.typeName !== `ZodNever`) return $$7(e.catchall._def, { - ...t, - currentPath: [...t.currentPath, `additionalProperties`] - }); - switch (e.unknownKeys) { - case `passthrough`: return t.allowedAdditionalProperties; - case `strict`: return t.rejectedAdditionalProperties; - case `strip`: return t.removeAdditionalStrategy === `strict` ? t.allowedAdditionalProperties : t.rejectedAdditionalProperties; - } -} -function Ou(e) { - try { - return e.isOptional(); - } catch { - return !0; - } -} -var ku = (e, t) => { - if (t.currentPath.toString() === t.propertyPath?.toString()) return $$7(e.innerType._def, t); - let n = $$7(e.innerType._def, { - ...t, - currentPath: [ - ...t.currentPath, - `anyOf`, - `1` - ] - }); - return n ? { anyOf: [{ not: Y$7() }, n] } : Y$7(); -}; -var Au = (e, t) => { - if (t.pipeStrategy === `input`) return $$7(e.in._def, t); - if (t.pipeStrategy === `output`) return $$7(e.out._def, t); - let n = $$7(e.in._def, { - ...t, - currentPath: [ - ...t.currentPath, - `allOf`, - `0` - ] - }); - return { allOf: [n, $$7(e.out._def, { - ...t, - currentPath: [ - ...t.currentPath, - `allOf`, - n ? `1` : `0` - ] - })].filter((e) => e !== void 0) }; -}; -function ju(e, t) { - return $$7(e.type._def, t); -} -function Mu(e, t) { - let n = { - type: `array`, - uniqueItems: !0, - items: $$7(e.valueType._def, { - ...t, - currentPath: [...t.currentPath, `items`] - }) - }; - return e.minSize && (n.minItems = e.minSize.value), e.maxSize && (n.maxItems = e.maxSize.value), n; -} -function Nu(e, t) { - return e.rest ? { - type: `array`, - minItems: e.items.length, - items: e.items.map((e, n) => $$7(e._def, { - ...t, - currentPath: [ - ...t.currentPath, - `items`, - `${n}` - ] - })).reduce((e, t) => t === void 0 ? e : [...e, t], []), - additionalItems: $$7(e.rest._def, { - ...t, - currentPath: [...t.currentPath, `additionalItems`] - }) - } : { - type: `array`, - minItems: e.items.length, - maxItems: e.items.length, - items: e.items.map((e, n) => $$7(e._def, { - ...t, - currentPath: [ - ...t.currentPath, - `items`, - `${n}` - ] - })).reduce((e, t) => t === void 0 ? e : [...e, t], []) - }; -} -function Pu() { - return { not: Y$7() }; -} -function Fu() { - return Y$7(); -} -var Iu = (e, t) => $$7(e.innerType._def, t); -var Lu = (e, t, n) => { - switch (t) { - case q$5.ZodString: return du(e, n); - case q$5.ZodNumber: return Tu(e); - case q$5.ZodObject: return Eu(e, n); - case q$5.ZodBigInt: return Ql(e); - case q$5.ZodBoolean: return $l(); - case q$5.ZodDate: return nu(e, n); - case q$5.ZodUndefined: return Pu(); - case q$5.ZodNull: return bu(); - case q$5.ZodArray: return Zl(e, n); - case q$5.ZodUnion: - case q$5.ZodDiscriminatedUnion: return Su(e, n); - case q$5.ZodIntersection: return cu(e, n); - case q$5.ZodTuple: return Nu(e, n); - case q$5.ZodRecord: return gu(e, n); - case q$5.ZodLiteral: return lu(e); - case q$5.ZodEnum: return ou(e); - case q$5.ZodNativeEnum: return vu(e); - case q$5.ZodNullable: return wu(e, n); - case q$5.ZodOptional: return ku(e, n); - case q$5.ZodMap: return _u(e, n); - case q$5.ZodSet: return Mu(e, n); - case q$5.ZodLazy: return () => e.getter()._def; - case q$5.ZodPromise: return ju(e, n); - case q$5.ZodNaN: - case q$5.ZodNever: return yu(); - case q$5.ZodEffects: return au(e, n); - case q$5.ZodAny: return Y$7(); - case q$5.ZodUnknown: return Fu(); - case q$5.ZodDefault: return iu(e, n); - case q$5.ZodBranded: return eu(e, n); - case q$5.ZodReadonly: return Iu(e, n); - case q$5.ZodCatch: return tu(e, n); - case q$5.ZodPipeline: return Au(e, n); - case q$5.ZodFunction: - case q$5.ZodVoid: - case q$5.ZodSymbol: return; - default: return ((e) => void 0)(t); - } -}; -var Ru = (e, t) => { - let n = 0; - for (; n < e.length && n < t.length && e[n] === t[n]; n++); - return [(e.length - n).toString(), ...t.slice(n)].join(`/`); -}; -function $$7(e, t, n = !1) { - let r = t.seen.get(e); - if (t.override) { - let i = t.override?.call(t, e, t, r, n); - if (i !== Jl) return i; - } - if (r && !n) { - let e = zu(r, t); - if (e !== void 0) return e; - } - let i = { - def: e, - path: t.currentPath, - jsonSchema: void 0 - }; - t.seen.set(e, i); - let a = Lu(e, e.typeName, t), o = typeof a == `function` ? $$7(a(), t) : a; - if (o && Bu(e, t, o), t.postProcess) { - let n = t.postProcess(o, e, t); - return i.jsonSchema = o, n; - } - return i.jsonSchema = o, o; -} -var zu = (e, t) => { - switch (t.$refStrategy) { - case `root`: return { $ref: e.path.join(`/`) }; - case `relative`: return { $ref: Ru(t.currentPath, e.path) }; - case `none`: - case `seen`: return e.path.length < t.currentPath.length && e.path.every((e, n) => t.currentPath[n] === e) ? (console.warn(`Recursive reference detected at ${t.currentPath.join(`/`)}! Defaulting to any`), Y$7()) : t.$refStrategy === `seen` ? Y$7() : void 0; - } -}; -var Bu = (e, t, n) => (e.description && (n.description = e.description), n); -var Vu = (e) => { - let t = Xl(e), n = t.name === void 0 ? t.basePath : [ - ...t.basePath, - t.definitionPath, - t.name - ]; - return { - ...t, - currentPath: n, - propertyPath: void 0, - seen: new Map(Object.entries(t.definitions).map(([e, n]) => [n._def, { - def: n._def, - path: [ - ...t.basePath, - t.definitionPath, - e - ], - jsonSchema: void 0 - }])) - }; -}; -var Hu = (e, t) => { - let n = Vu(t), r = typeof t == `object` && t.definitions ? Object.entries(t.definitions).reduce((e, [t, r]) => ({ - ...e, - [t]: $$7(r._def, { - ...n, - currentPath: [ - ...n.basePath, - n.definitionPath, - t - ] - }, !0) ?? Y$7() - }), {}) : void 0, i = typeof t == `string` ? t : t?.nameStrategy === `title` ? void 0 : t?.name, a = $$7(e._def, i === void 0 ? n : { - ...n, - currentPath: [ - ...n.basePath, - n.definitionPath, - i - ] - }, !1) ?? Y$7(), o = typeof t == `object` && t.name !== void 0 && t.nameStrategy === `title` ? t.name : void 0; - o !== void 0 && (a.title = o); - let s = i === void 0 ? r ? { - ...a, - [n.definitionPath]: r - } : a : { - $ref: [ - ...n.$refStrategy === `relative` ? [] : n.basePath, - n.definitionPath, - i - ].join(`/`), - [n.definitionPath]: { - ...r, - [i]: a - } - }; - return s.$schema = `http://json-schema.org/draft-07/schema#`, s; -}; -var Uu = Symbol.for(`vercel.ai.schema`); -function Wu(e) { - let t; - return () => (t ??= e(), t); -} -function Gu(e, { validate: t } = {}) { - return { - [Uu]: !0, - _type: void 0, - get jsonSchema() { - return typeof e == `function` && (e = e()), e; - }, - validate: t - }; -} -function Ku(e) { - return typeof e == `object` && !!e && Uu in e && e[Uu] === !0 && `jsonSchema` in e && `validate` in e; -} -function qu(e) { - return e == null ? Gu({ - type: `object`, - properties: {}, - additionalProperties: !1 - }) : Ku(e) ? e : `~standard` in e ? e[`~standard`].vendor === `zod` ? Qu(e) : Ju(e) : e(); -} -function Ju(e) { - return Gu(() => Kl(e[`~standard`].jsonSchema.input({ target: `draft-07` })), { validate: async (t) => { - let n = await e[`~standard`].validate(t); - return `value` in n ? { - success: !0, - value: n.value - } : { - success: !1, - error: new Ae$10({ - value: t, - cause: n.issues - }) - }; - } }); -} -function Yu(e, t) { - let n = t?.useReferences ?? !1; - return Gu(() => Hu(e, { $refStrategy: n ? `root` : `none` }), { validate: async (t) => { - let n = await e.safeParseAsync(t); - return n.success ? { - success: !0, - value: n.data - } : { - success: !1, - error: n.error - }; - } }); -} -function Xu(e, t) { - let n = t?.useReferences ?? !1; - return Gu(() => Kl(pa$2(e, { - target: `draft-7`, - io: `input`, - reused: n ? `ref` : `inline` - })), { validate: async (t) => { - let n = await Ta$2(e, t); - return n.success ? { - success: !0, - value: n.data - } : { - success: !1, - error: n.error - }; - } }); -} -function Zu(e) { - return `_zod` in e; -} -function Qu(e, t) { - return Zu(e) ? Xu(e, t) : Yu(e, t); -} -async function $u({ value: e, schema: t, context: n }) { - let r = await ed({ - value: e, - schema: t, - context: n - }); - if (!r.success) throw Ae$10.wrap({ - value: e, - cause: r.error, - context: n - }); - return r.value; -} -async function ed({ value: e, schema: t, context: n }) { - let r = qu(t); - try { - if (r.validate == null) return { - success: !0, - value: e, - rawValue: e - }; - let t = await r.validate(e); - return t.success ? { - success: !0, - value: t.value, - rawValue: e - } : { - success: !1, - error: Ae$10.wrap({ - value: e, - cause: t.error, - context: n - }), - rawValue: e - }; - } catch (t) { - return { - success: !1, - error: Ae$10.wrap({ - value: e, - cause: t, - context: n - }), - rawValue: e - }; - } -} -async function td({ text: e, schema: t }) { - try { - let n = Gl(e); - return t == null ? n : await $u({ - value: n, - schema: t - }); - } catch (t) { - throw de$11.isInstance(t) || Ae$10.isInstance(t) ? t : new de$11({ - text: e, - cause: t - }); - } -} -async function nd({ text: e, schema: t }) { - try { - let n = Gl(e); - return t == null ? { - success: !0, - value: n, - rawValue: n - } : await ed({ - value: n, - schema: t - }); - } catch (t) { - return { - success: !1, - error: de$11.isInstance(t) ? t : new de$11({ - text: e, - cause: t - }), - rawValue: void 0 - }; - } -} -function rd(e) { - try { - return Gl(e), !0; - } catch { - return !1; - } -} -function id({ stream: e, schema: t }) { - return e.pipeThrough(new TextDecoderStream()).pipeThrough(new jc()).pipeThrough(new TransformStream({ async transform({ data: e }, n) { - e !== `[DONE]` && n.enqueue(await nd({ - text: e, - schema: t - })); - } })); -} -async function ad({ provider: e, providerOptions: t, schema: n }) { - if (t?.[e] == null) return; - let i = await ed({ - value: t[e], - schema: n - }); - if (!i.success) throw new ae$10({ - argument: `providerOptions`, - message: `invalid ${e} provider options`, - cause: i.error - }); - return i.value; -} -var od = () => globalThis.fetch; -var sd = async ({ url: e, headers: t, body: n, failedResponseHandler: r, successfulResponseHandler: i, abortSignal: a, fetch: o }) => await ld({ - url: e, - headers: { - "Content-Type": `application/json`, - ...t - }, - body: { - content: JSON.stringify(n), - values: n - }, - failedResponseHandler: r, - successfulResponseHandler: i, - abortSignal: a, - fetch: o -}); -var cd = async ({ url: e, headers: t, formData: n, failedResponseHandler: r, successfulResponseHandler: i, abortSignal: a, fetch: o }) => await ld({ - url: e, - headers: t, - body: { - content: n, - values: Object.fromEntries(n.entries()) - }, - failedResponseHandler: r, - successfulResponseHandler: i, - abortSignal: a, - fetch: o -}); -var ld = async ({ url: e, headers: n = {}, body: r, successfulResponseHandler: i, failedResponseHandler: a, abortSignal: o, fetch: s = od() }) => { - try { - let c = await s(e, { - method: `POST`, - headers: Ol(n, `ai-sdk/provider-utils/${kl}`, El()), - body: r.content, - signal: o - }), l = yl(c); - if (!c.ok) { - let n; - try { - n = await a({ - response: c, - url: e, - requestBodyValues: r.values - }); - } catch (n) { - throw xl(n) || c$14.isInstance(n) ? n : new c$14({ - message: `Failed to process error response`, - cause: n, - statusCode: c.status, - url: e, - responseHeaders: l, - requestBodyValues: r.values - }); - } - throw n.value; - } - try { - return await i({ - response: c, - url: e, - requestBodyValues: r.values - }); - } catch (n) { - throw n instanceof Error && (xl(n) || c$14.isInstance(n)) ? n : new c$14({ - message: `Failed to process successful response`, - cause: n, - statusCode: c.status, - url: e, - responseHeaders: l, - requestBodyValues: r.values - }); - } - } catch (t) { - throw Tl({ - error: t, - url: e, - requestBodyValues: r.values - }); - } -}; -function ud(e) { - return e; -} -function dd(e) { - return { - ...e, - type: `dynamic` - }; -} -function fd({ id: e, inputSchema: t }) { - return ({ execute: n, outputSchema: r, needsApproval: i, toModelOutput: a, onInputStart: o, onInputDelta: s, onInputAvailable: c, ...l }) => ud({ - type: `provider`, - isProviderExecuted: !1, - id: e, - args: l, - inputSchema: t, - outputSchema: r, - execute: n, - needsApproval: i, - toModelOutput: a, - onInputStart: o, - onInputDelta: s, - onInputAvailable: c - }); -} -function pd({ id: e, inputSchema: t, outputSchema: n }) { - return ({ execute: r, needsApproval: i, toModelOutput: a, onInputStart: o, onInputDelta: s, onInputAvailable: c, ...l }) => ud({ - type: `provider`, - isProviderExecuted: !1, - id: e, - args: l, - inputSchema: t, - outputSchema: n, - execute: r, - needsApproval: i, - toModelOutput: a, - onInputStart: o, - onInputDelta: s, - onInputAvailable: c - }); -} -function md({ id: e, inputSchema: t, outputSchema: n, supportsDeferredResults: r }) { - return ({ onInputStart: i, onInputDelta: a, onInputAvailable: o, ...s }) => ud({ - type: `provider`, - isProviderExecuted: !0, - id: e, - args: s, - inputSchema: t, - outputSchema: n, - onInputStart: i, - onInputDelta: a, - onInputAvailable: o, - supportsDeferredResults: r - }); -} -async function hd(e) { - return typeof e == `function` && (e = e()), Promise.resolve(e); -} -function gd({ part: e }) { - if (tl(e.mediaType)) return e.mediaType; - if (e.data.type === `data`) { - let t = $c({ - data: e.data.data, - topLevelType: el(e.mediaType) - }); - if (t) return t; - throw new Ie$10({ functionality: `file of media type "${e.mediaType}" must specify subtype since it could not be auto-detected` }); - } - throw new Ie$10({ functionality: `file of media type "${e.mediaType}" must specify subtype since it is not passed as inline bytes` }); -} -function _d({ reference: e, provider: t }) { - let n = e[t]; - if (n != null) return n; - throw new Se$10({ - provider: t, - reference: e - }); -} -var vd = ({ errorSchema: e, errorToMessage: n, isRetryable: r }) => async ({ response: i, url: a, requestBodyValues: o }) => { - let s = await i.text(), c = yl(i); - if (s.trim() === ``) return { - responseHeaders: c, - value: new c$14({ - message: i.statusText, - url: a, - requestBodyValues: o, - statusCode: i.status, - responseHeaders: c, - responseBody: s, - isRetryable: r?.(i) - }) - }; - try { - let l = await td({ - text: s, - schema: e - }); - return { - responseHeaders: c, - value: new c$14({ - message: n(l), - url: a, - requestBodyValues: o, - statusCode: i.status, - responseHeaders: c, - responseBody: s, - data: l, - isRetryable: r?.(i, l) - }) - }; - } catch { - return { - responseHeaders: c, - value: new c$14({ - message: i.statusText, - url: a, - requestBodyValues: o, - statusCode: i.status, - responseHeaders: c, - responseBody: s, - isRetryable: r?.(i) - }) - }; - } -}; -var yd = (e) => async ({ response: t }) => { - let r = yl(t); - if (t.body == null) throw new re$9({}); - return { - responseHeaders: r, - value: id({ - stream: t.body, - schema: e - }) - }; -}; -var bd = (e) => async ({ response: n, url: r, requestBodyValues: i }) => { - let a = await n.text(), o = await nd({ - text: a, - schema: e - }), s = yl(n); - if (!o.success) throw new c$14({ - message: `Invalid JSON response`, - cause: o.error, - statusCode: n.status, - responseHeaders: s, - responseBody: a, - url: r, - requestBodyValues: i - }); - return { - responseHeaders: s, - value: o.value, - rawValue: o.rawValue - }; -}; -var xd = () => async ({ response: e, url: n, requestBodyValues: r }) => { - let i = yl(e); - if (!e.body) throw new c$14({ - message: `Response body is empty`, - url: n, - requestBodyValues: r, - statusCode: e.status, - responseHeaders: i, - responseBody: void 0 - }); - try { - let t = await e.arrayBuffer(); - return { - responseHeaders: i, - value: new Uint8Array(t) - }; - } catch (a) { - throw new c$14({ - message: `Failed to read response as array buffer`, - url: n, - requestBodyValues: r, - statusCode: e.status, - responseHeaders: i, - responseBody: void 0, - cause: a - }); - } -}; -function Sd(e) { - if (e == null) return !0; - let t = typeof e; - return t === `string` || t === `number` || t === `boolean` ? !0 : t === `function` || t === `symbol` || t === `bigint` ? !1 : Array.isArray(e) ? e.every(Sd) : Object.getPrototypeOf(e) === Object.prototype ? Object.values(e).every(Sd) : !1; -} -function Cd(e) { - let t = {}; - for (let [n, r] of Object.entries(e.config)) if (n === `headers`) { - let e = wd(r); - Sd(e) && (t[n] = e); - } else Sd(r) && (t[n] = r); - return { - modelId: e.modelId, - config: t - }; -} -function wd(e) { - let t = e; - if (typeof e == `function` && (t = e()), t instanceof Promise) throw Error(`Promise returned from resolveSync`); - return t; -} -var Td = class { - constructor(e, t = {}) { - this.toolCalls = [], this.controller = e, this._generateId = t.generateId ?? bl, this.typeValidation = t.typeValidation ?? `none`, this.extractMetadata = t.extractMetadata, this.buildToolCallProviderMetadata = t.buildToolCallProviderMetadata; - } - processDelta(e) { - let t = e.index ?? this.toolCalls.length; - this.toolCalls[t] == null ? this.processNewToolCall(t, e) : this.processExistingToolCall(t, e); - } - flush() { - for (let e of this.toolCalls) e.hasFinished || this.finishToolCall(e); - } - processNewToolCall(e, t) { - if (this.typeValidation === `required`) { - if (t.type !== `function`) throw new le$11({ - data: t, - message: `Expected 'function' type.` - }); - } else if (this.typeValidation === `if-present` && t.type != null && t.type !== `function`) throw new le$11({ - data: t, - message: `Expected 'function' type.` - }); - if (t.id == null) throw new le$11({ - data: t, - message: `Expected 'id' to be a string.` - }); - if (t.function?.name == null) throw new le$11({ - data: t, - message: `Expected 'function.name' to be a string.` - }); - this.controller.enqueue({ - type: `tool-input-start`, - id: t.id, - toolName: t.function.name - }); - let n = this.extractMetadata?.call(this, t); - this.toolCalls[e] = { - id: t.id, - type: `function`, - function: { - name: t.function.name, - arguments: t.function.arguments ?? `` - }, - hasFinished: !1, - metadata: n - }; - let r = this.toolCalls[e]; - r.function.arguments.length > 0 && this.controller.enqueue({ - type: `tool-input-delta`, - id: r.id, - delta: r.function.arguments - }), rd(r.function.arguments) && this.finishToolCall(r); - } - processExistingToolCall(e, t) { - let n = this.toolCalls[e]; - n.hasFinished || (t.function?.arguments != null && (n.function.arguments += t.function.arguments, this.controller.enqueue({ - type: `tool-input-delta`, - id: n.id, - delta: t.function.arguments - })), rd(n.function.arguments) && this.finishToolCall(n)); - } - finishToolCall(e) { - this.controller.enqueue({ - type: `tool-input-end`, - id: e.id - }); - let t = this.buildToolCallProviderMetadata?.call(this, e.metadata); - this.controller.enqueue({ - type: `tool-call`, - toolCallId: e.id ?? this._generateId(), - toolName: e.function.name, - input: e.function.arguments, - ...t ? { providerMetadata: t } : {} - }), e.hasFinished = !0; - } -}; -function Ed(e) { - return e?.replace(/\/$/, ``); -} -//#endregion -//#region node_modules/eve/dist/src/compiled/@ai-sdk/mcp/index.js -const oe$4 = { - invalid_type: `invalid_type`, - too_big: `too_big`, - too_small: `too_small`, - invalid_format: `invalid_format`, - not_multiple_of: `not_multiple_of`, - unrecognized_keys: `unrecognized_keys`, - invalid_union: `invalid_union`, - invalid_key: `invalid_key`, - invalid_element: `invalid_element`, - invalid_value: `invalid_value`, - custom: `custom` -}; -var se$5; -se$5 ||= {}; -let x$4; -x$4 = globalThis.crypto?.webcrypto ?? globalThis.crypto ?? import(`node:crypto`).then((e) => e.webcrypto); -async function ce$5(e) { - return (await x$4).getRandomValues(new Uint8Array(e)); -} -async function le$5(e) { - let t = ``; - for (; t.length < e;) { - let n = await ce$5(e - t.length); - for (let e of n) e < 198 && (t += `abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~`[e % 66]); - } - return t; -} -async function ue$5(e) { - return await le$5(e); -} -async function de$5(e) { - let t = await (await x$4).subtle.digest(`SHA-256`, new TextEncoder().encode(e)); - return btoa(String.fromCharCode(...new Uint8Array(t))).replace(/\//g, `_`).replace(/\+/g, `-`).replace(/=/g, ``); -} -async function fe$5(e) { - if (e ||= 43, e < 43 || e > 128) throw `Expected a length between 43 and 128. Received ${e}.`; - let t = await ue$5(e); - return { - code_verifier: t, - code_challenge: await de$5(t) - }; -} -var pe$5 = `vercel.ai.error.AI_MCPClientError`; -var me$5 = Symbol.for(pe$5); -var he$5; -var ge$5; -var S$4 = class extends (ge$5 = i$17, he$5 = me$5, ge$5) { - constructor({ name: e = `MCPClientError`, message: t, cause: n, data: r, code: i, statusCode: a, url: o, responseBody: s }) { - super({ - name: e, - message: t, - cause: n - }), this[he$5] = !0, this.data = r, this.code = i, this.statusCode = a, this.url = o, this.responseBody = s; - } - static isInstance(t) { - return i$17.hasMarker(t, pe$5); - } -}; -var C$5 = `2025-11-25`; -var _e$5 = [ - C$5, - `2025-06-18`, - `2025-03-26`, - `2024-11-05` -]; -var ve$5 = Ho(Po(Ra$2(), _o())); -var ye$5 = wo({ - name: Ra$2(), - version: Ra$2(), - title: Ho(Ra$2()) -}); -var w$5 = wo({ _meta: Ho(Co({}).loose()) }); -var T$5 = w$5; -var be$5 = Co({ - method: Ra$2(), - params: Ho(w$5) -}); -var xe$5 = Co({ applyDefaults: Ho(uo()) }).loose(); -var Se$5 = wo({ - experimental: Ho(Co({}).loose()), - logging: Ho(Co({}).loose()), - prompts: Ho(wo({ listChanged: Ho(uo()) })), - resources: Ho(wo({ - subscribe: Ho(uo()), - listChanged: Ho(uo()) - })), - tools: Ho(wo({ listChanged: Ho(uo()) })), - elicitation: Ho(xe$5) -}); -Co({ elicitation: Ho(xe$5) }).loose(); -var E$5 = T$5.extend({ - protocolVersion: Ra$2(), - capabilities: Se$5, - serverInfo: ye$5, - instructions: Ho(Ra$2()) -}); -var D$4 = T$5.extend({ nextCursor: Ho(Ra$2()) }); -var Ce$5 = Co({ - name: Ra$2(), - title: Ho(Ra$2()), - description: Ho(Ra$2()), - inputSchema: Co({ - type: Ro(`object`), - properties: Ho(Co({}).loose()) - }).loose(), - outputSchema: Ho(Co({}).loose()), - annotations: Ho(Co({ title: Ho(Ra$2()) }).loose()), - _meta: ve$5 -}).loose(); -var we$5 = D$4.extend({ tools: xo(Ce$5) }); -var O$4 = Co({ - type: Ro(`text`), - text: Ra$2() -}).loose(); -var k$5 = Co({ - type: Ro(`image`), - data: to$1(), - mimeType: Ra$2() -}).loose(); -var Te$5 = Co({ - uri: Ra$2(), - name: Ra$2(), - title: Ho(Ra$2()), - description: Ho(Ra$2()), - mimeType: Ho(Ra$2()), - size: Ho(oo()) -}).loose(); -var Ee$5 = D$4.extend({ resources: xo(Te$5) }); -var A$4 = Co({ - uri: Ra$2(), - name: Ho(Ra$2()), - title: Ho(Ra$2()), - mimeType: Ho(Ra$2()) -}).loose(); -var j$4 = A$4.extend({ text: Ra$2() }); -var M$4 = A$4.extend({ blob: to$1() }); -var De$5 = Co({ - type: Ro(`resource`), - resource: Eo([j$4, M$4]) -}).loose(); -var Oe$5 = Co({ - type: Ro(`resource_link`), - uri: Ra$2(), - name: Ra$2(), - description: Ho(Ra$2()), - mimeType: Ho(Ra$2()) -}).loose(); -var ke$5 = T$5.extend({ - content: xo(Eo([ - O$4, - k$5, - De$5, - Oe$5 - ])), - structuredContent: Ho(_o()), - isError: uo().default(!1).optional() -}).or(T$5.extend({ toolResult: _o() })); -var Ae$5 = Co({ - uriTemplate: Ra$2(), - name: Ra$2(), - title: Ho(Ra$2()), - description: Ho(Ra$2()), - mimeType: Ho(Ra$2()) -}).loose(); -var je$5 = T$5.extend({ resourceTemplates: xo(Ae$5) }); -var Me$5 = T$5.extend({ contents: xo(Eo([j$4, M$4])) }); -var Ne$5 = Co({ - name: Ra$2(), - description: Ho(Ra$2()), - required: Ho(uo()) -}).loose(); -var Pe$5 = Co({ - name: Ra$2(), - title: Ho(Ra$2()), - description: Ho(Ra$2()), - arguments: Ho(xo(Ne$5)) -}).loose(); -var Fe$5 = D$4.extend({ prompts: xo(Pe$5) }); -var Ie$5 = Co({ - role: Eo([Ro(`user`), Ro(`assistant`)]), - content: Eo([ - O$4, - k$5, - De$5, - Oe$5 - ]) -}).loose(); -var Le$5 = T$5.extend({ - description: Ho(Ra$2()), - messages: xo(Ie$5) -}); -var Re$5 = w$5.extend({ - message: Ra$2(), - requestedSchema: _o() -}); -var N$4 = be$5.extend({ - method: Ro(`elicitation/create`), - params: Re$5 -}); -var ze$5 = T$5.extend({ - action: Eo([ - Ro(`accept`), - Ro(`decline`), - Ro(`cancel`) - ]), - content: Ho(Po(Ra$2(), _o())) -}); -var P$4 = `2.0`; -var Be$5 = Co({ - jsonrpc: Ro(P$4), - id: Eo([Ra$2(), oo().int()]) -}).merge(be$5).strict(); -var Ve$5 = Co({ - jsonrpc: Ro(P$4), - id: Eo([Ra$2(), oo().int()]), - result: T$5 -}).strict(); -var He$5 = Co({ - jsonrpc: Ro(P$4), - id: Eo([Ra$2(), oo().int()]), - error: Co({ - code: oo().int(), - message: Ra$2(), - data: Ho(_o()) - }) -}).strict(); -var F$4 = Eo([ - Be$5, - Co({ jsonrpc: Ro(P$4) }).merge(Co({ - method: Ra$2(), - params: Ho(w$5) - })).strict(), - Ve$5, - He$5 -]); -async function I$4(e) { - return F$4.parse(await td({ text: e })); -} -var Ue$5 = typeof __PACKAGE_VERSION__ < `u` ? __PACKAGE_VERSION__ : `0.0.0-test`; -var L$4 = Ra$2().url().superRefine((e, t) => { - if (!URL.canParse(e)) return t.addIssue({ - code: oe$4.custom, - message: `URL must be parseable`, - fatal: !0 - }), d$6; -}).refine((e) => { - let t = new URL(e); - return t.protocol !== `javascript:` && t.protocol !== `data:` && t.protocol !== `vbscript:`; -}, { message: `URL cannot use javascript:, data:, or vbscript: scheme` }); -var We$5 = Co({ - access_token: Ra$2(), - id_token: Ra$2().optional(), - token_type: Ra$2(), - expires_in: oo().optional(), - scope: Ra$2().optional(), - refresh_token: Ra$2().optional(), - authorization_server: L$4.optional(), - token_endpoint: L$4.optional() -}).strip(); -var Ge$5 = Co({ - resource: Ra$2().url(), - authorization_servers: xo(L$4).optional(), - jwks_uri: Ra$2().url().optional(), - scopes_supported: xo(Ra$2()).optional(), - bearer_methods_supported: xo(Ra$2()).optional(), - resource_signing_alg_values_supported: xo(Ra$2()).optional(), - resource_name: Ra$2().optional(), - resource_documentation: Ra$2().optional(), - resource_policy_uri: Ra$2().url().optional(), - resource_tos_uri: Ra$2().url().optional(), - tls_client_certificate_bound_access_tokens: uo().optional(), - authorization_details_types_supported: xo(Ra$2()).optional(), - dpop_signing_alg_values_supported: xo(Ra$2()).optional(), - dpop_bound_access_tokens_required: uo().optional() -}).passthrough(); -var R$4 = Co({ - issuer: Ra$2(), - authorization_endpoint: L$4, - token_endpoint: L$4, - registration_endpoint: L$4.optional(), - scopes_supported: xo(Ra$2()).optional(), - response_types_supported: xo(Ra$2()), - grant_types_supported: xo(Ra$2()).optional(), - code_challenge_methods_supported: xo(Ra$2()), - token_endpoint_auth_methods_supported: xo(Ra$2()).optional(), - token_endpoint_auth_signing_alg_values_supported: xo(Ra$2()).optional() -}).passthrough(); -var Ke$5 = Co({ - issuer: Ra$2(), - authorization_endpoint: L$4, - token_endpoint: L$4, - userinfo_endpoint: L$4.optional(), - jwks_uri: L$4, - registration_endpoint: L$4.optional(), - scopes_supported: xo(Ra$2()).optional(), - response_types_supported: xo(Ra$2()), - grant_types_supported: xo(Ra$2()).optional(), - subject_types_supported: xo(Ra$2()), - id_token_signing_alg_values_supported: xo(Ra$2()), - claims_supported: xo(Ra$2()).optional(), - token_endpoint_auth_methods_supported: xo(Ra$2()).optional() -}).passthrough().merge(R$4.pick({ code_challenge_methods_supported: !0 })); -var qe$5 = Co({ - client_id: Ra$2(), - client_secret: Ra$2().optional(), - client_id_issued_at: oo().optional(), - client_secret_expires_at: oo().optional(), - authorization_server: L$4.optional(), - token_endpoint: L$4.optional() -}).strip(); -var Je$5 = Co({ - redirect_uris: xo(L$4), - token_endpoint_auth_method: Ra$2().optional(), - grant_types: xo(Ra$2()).optional(), - response_types: xo(Ra$2()).optional(), - client_name: Ra$2().optional(), - client_uri: L$4.optional(), - logo_uri: L$4.optional(), - scope: Ra$2().optional(), - contacts: xo(Ra$2()).optional(), - tos_uri: L$4.optional(), - policy_uri: Ra$2().optional(), - jwks_uri: L$4.optional(), - jwks: ho().optional(), - software_id: Ra$2().optional(), - software_version: Ra$2().optional(), - software_statement: Ra$2().optional() -}).strip(); -var Ye$5 = Co({ - error: Ra$2(), - error_description: Ra$2().optional(), - error_uri: Ra$2().optional() -}); -var Xe$5 = Je$5.merge(qe$5); -var Ze$5 = `vercel.ai.error.AI_MCPClientOAuthError`; -var Qe$5 = Symbol.for(Ze$5); -var $e$5; -var et$5; -var z$4 = class extends (et$5 = i$17, $e$5 = Qe$5, et$5) { - constructor({ name: e = `MCPClientOAuthError`, message: t, cause: n }) { - super({ - name: e, - message: t, - cause: n - }), this[$e$5] = !0; - } - static isInstance(t) { - return i$17.hasMarker(t, Ze$5); - } -}; -var B$4 = class extends z$4 {}; -B$4.errorCode = `server_error`; -var V$4 = class extends z$4 {}; -V$4.errorCode = `invalid_client`; -var H$5 = class extends z$4 {}; -H$5.errorCode = `invalid_grant`; -var U$5 = class extends z$4 {}; -U$5.errorCode = `unauthorized_client`; -var tt$5 = { - [B$4.errorCode]: B$4, - [V$4.errorCode]: V$4, - [H$5.errorCode]: H$5, - [U$5.errorCode]: U$5 -}; -function nt$5(e) { - let t = typeof e == `string` ? new URL(e) : new URL(e.href); - return t.hash = ``, t; -} -function W$5(e) { - let t = e.href; - return e.pathname === `/` && t.endsWith(`/`) ? t.slice(0, -1) : t; -} -function rt$5({ requestedResource: e, configuredResource: t }) { - let n = typeof e == `string` ? new URL(e) : new URL(e.href), r = typeof t == `string` ? new URL(t) : new URL(t.href); - if (n.origin !== r.origin || n.pathname.length < r.pathname.length) return !1; - let i = n.pathname.endsWith(`/`) ? n.pathname : n.pathname + `/`, a = r.pathname.endsWith(`/`) ? r.pathname : r.pathname + `/`; - return i.startsWith(a); -} -var G$5 = class extends Error { - constructor(e = `Unauthorized`) { - super(e), this.name = `UnauthorizedError`; - } -}; -function K$4(e) { - return new URL(e).href; -} -function it$5(e, t) { - return { - authorizationServerUrl: K$4(e), - tokenEndpoint: K$4(t?.token_endpoint ? new URL(t.token_endpoint) : new URL(`/token`, e)) - }; -} -function at$5(e, t) { - return { - ...e, - authorization_server: t.authorizationServerUrl, - token_endpoint: t.tokenEndpoint - }; -} -function ot$5(e, t) { - return { - ...e, - authorization_server: t.authorizationServerUrl, - token_endpoint: t.tokenEndpoint - }; -} -function st$5(e) { - if (!(!e?.authorization_server || !e.token_endpoint)) return { - authorizationServerUrl: K$4(e.authorization_server), - tokenEndpoint: K$4(e.token_endpoint) - }; -} -async function ct$5({ provider: e, clientInformation: t, tokens: n }) { - let r = st$5(n); - if (r) return r; - let i = await e.authorizationServerInformation?.call(e); - return i ? { - authorizationServerUrl: K$4(i.authorizationServerUrl), - tokenEndpoint: K$4(i.tokenEndpoint) - } : st$5(t); -} -async function lt$5({ provider: e, clientInformation: t, authorizationServerInformation: n }) { - return e.saveAuthorizationServerInformation ? (await e.saveAuthorizationServerInformation(n), !0) : e.saveClientInformation ? (await e.saveClientInformation(ot$5(t, n)), !0) : !1; -} -function ut$5(e, t) { - if (!t) return; - let n = new URL(e).origin; - if (t.origin !== n) throw new z$4({ message: `OAuth protected resource metadata URL ${t.href} must have the same origin as the MCP server URL ${n}` }); -} -function dt$5({ storedAuthorizationServerInformation: e, currentAuthorizationServerInformation: t }) { - if (e.authorizationServerUrl !== t.authorizationServerUrl || e.tokenEndpoint !== t.tokenEndpoint) throw new z$4({ message: `OAuth authorization server metadata does not match the metadata that issued the stored credentials` }); -} -function q$4(e) { - let t = e.headers.get(`www-authenticate`) ?? e.headers.get(`WWW-Authenticate`); - if (!t) return; - let [n, r] = t.split(` `); - if (n.toLowerCase() !== `bearer` || !r) return; - let i = t.match(/resource_metadata="([^"]*)"/); - if (i) try { - return new URL(i[1]); - } catch { - return; - } -} -function ft$5(e, t = ``, n = {}) { - return t.endsWith(`/`) && (t = t.slice(0, -1)), n.prependPathname ? `${t}/.well-known/${e}` : `/.well-known/${e}${t}`; -} -async function J$4(e, t, n = fetch) { - try { - return await n(e, { headers: t }); - } catch (r) { - if (r instanceof TypeError) return t ? J$4(e, void 0, n) : void 0; - throw r; - } -} -async function pt$5(e, t, n = fetch) { - return await J$4(e, { "MCP-Protocol-Version": t }, n); -} -function mt$5(e, t) { - return !e || e.status >= 400 && e.status < 500 && t !== `/`; -} -async function ht$5(e, t, n, r) { - let i = new URL(e), a = r?.protocolVersion ?? C$5, o; - if (r?.metadataUrl) o = new URL(r.metadataUrl); - else { - let e = ft$5(t, i.pathname); - o = new URL(e, r?.metadataServerUrl ?? i), o.search = i.search; - } - let s = await pt$5(o, a, n); - return !r?.metadataUrl && mt$5(s, i.pathname) && (s = await pt$5(new URL(`/.well-known/${t}`, i), a, n)), s; -} -async function gt$5(e, t, n = fetch) { - let r = await ht$5(e, `oauth-protected-resource`, n, { - protocolVersion: t?.protocolVersion, - metadataUrl: t?.resourceMetadataUrl - }); - if (!r || r.status === 404) throw Error(`Resource server does not implement OAuth 2.0 Protected Resource Metadata.`); - if (!r.ok) throw Error(`HTTP ${r.status} trying to load well-known OAuth protected resource metadata.`); - return Ge$5.parse(await r.json()); -} -function _t$5(e) { - let t = typeof e == `string` ? new URL(e) : e, n = t.pathname !== `/`, r = t.origin, i = []; - if (!n) return i.push({ - url: new URL(`/.well-known/oauth-authorization-server`, t.origin), - type: `oauth`, - expectedIssuer: r - }), i.push({ - url: new URL(`/.well-known/openid-configuration`, t.origin), - type: `oidc`, - expectedIssuer: r - }), i; - let a = t.pathname; - a.endsWith(`/`) && (a = a.slice(0, -1)); - let o = `${t.origin}${a}`; - return i.push({ - url: new URL(`/.well-known/oauth-authorization-server${a}`, t.origin), - type: `oauth`, - expectedIssuer: o - }), i.push({ - url: new URL(`/.well-known/oauth-authorization-server`, t.origin), - type: `oauth`, - expectedIssuer: r - }), i.push({ - url: new URL(`/.well-known/openid-configuration${a}`, t.origin), - type: `oidc`, - expectedIssuer: o - }), i.push({ - url: new URL(`${a}/.well-known/openid-configuration`, t.origin), - type: `oidc`, - expectedIssuer: o - }), i; -} -function vt$5(e, t) { - if (e.issuer !== t) throw new z$4({ message: `OAuth authorization server metadata issuer ${e.issuer} does not match expected issuer ${t}` }); -} -async function yt$5(e, { fetchFn: t = fetch, protocolVersion: n = C$5 } = {}) { - let r = { "MCP-Protocol-Version": n }, i = _t$5(e); - for (let { url: e, type: n, expectedIssuer: a } of i) { - let i = await J$4(e, r, t); - if (i) { - if (!i.ok) { - if (i.status >= 400 && i.status < 500) continue; - throw Error(`HTTP ${i.status} trying to load ${n === `oauth` ? `OAuth` : `OpenID provider`} metadata from ${e}`); - } - if (n === `oauth`) { - let e = R$4.parse(await i.json()); - return vt$5(e, a), e; - } else { - let t = Ke$5.parse(await i.json()); - if (vt$5(t, a), !t.code_challenge_methods_supported?.includes(`S256`)) throw Error(`Incompatible OIDC provider at ${e}: does not support S256 code challenge method required by MCP specification`); - return t; - } - } - } -} -async function bt$5(e, { metadata: t, clientInformation: n, redirectUrl: r, scope: i, state: a, resource: o }) { - let s = `code`, c = `S256`, l; - if (t) { - if (l = new URL(t.authorization_endpoint), !t.response_types_supported.includes(s)) throw Error(`Incompatible auth server: does not support response type ${s}`); - if (!t.code_challenge_methods_supported || !t.code_challenge_methods_supported.includes(c)) throw Error(`Incompatible auth server: does not support code challenge method ${c}`); - } else l = new URL(`/authorize`, e); - let u = await fe$5(), d = u.code_verifier, f = u.code_challenge; - return l.searchParams.set(`response_type`, s), l.searchParams.set(`client_id`, n.client_id), l.searchParams.set(`code_challenge`, f), l.searchParams.set(`code_challenge_method`, c), l.searchParams.set(`redirect_uri`, String(r)), a && l.searchParams.set(`state`, a), i && l.searchParams.set(`scope`, i), i?.includes(`offline_access`) && l.searchParams.append(`prompt`, `consent`), o && l.searchParams.set(`resource`, W$5(o)), { - authorizationUrl: l, - codeVerifier: d - }; -} -function xt$5(e, t) { - let n = e.client_secret !== void 0; - return t.length === 0 ? n ? `client_secret_post` : `none` : n && t.includes(`client_secret_basic`) ? `client_secret_basic` : n && t.includes(`client_secret_post`) ? `client_secret_post` : t.includes(`none`) ? `none` : n ? `client_secret_post` : `none`; -} -function St$5(e, t, n, r) { - let { client_id: i, client_secret: a } = t; - switch (e) { - case `client_secret_basic`: - Ct$5(i, a, n); - return; - case `client_secret_post`: - wt$5(i, a, r); - return; - case `none`: - Tt$5(i, r); - return; - default: throw Error(`Unsupported client authentication method: ${e}`); - } -} -function Ct$5(e, t, n) { - if (!t) throw Error(`client_secret_basic authentication requires a client_secret`); - let r = btoa(`${e}:${t}`); - n.set(`Authorization`, `Basic ${r}`); -} -function wt$5(e, t, n) { - n.set(`client_id`, e), t && n.set(`client_secret`, t); -} -function Tt$5(e, t) { - t.set(`client_id`, e); -} -async function Y$6(e) { - let t = e instanceof Response ? e.status : void 0, n = e instanceof Response ? await e.text() : e; - try { - let { error: e, error_description: t, error_uri: i } = Ye$5.parse(await td({ text: n })); - return new (tt$5[e] || B$4)({ - message: t || ``, - cause: i - }); - } catch (e) { - return new B$4({ message: `${t ? `HTTP ${t}: ` : ``}Invalid OAuth error response: ${e}. Raw body: ${n}` }); - } -} -async function Et$5(e, { metadata: t, clientInformation: n, authorizationCode: r, codeVerifier: i, redirectUri: a, resource: o, addClientAuthentication: s, fetchFn: c }) { - let l = `authorization_code`, u = t?.token_endpoint ? new URL(t.token_endpoint) : new URL(`/token`, e); - if (t?.grant_types_supported && !t.grant_types_supported.includes(l)) throw Error(`Incompatible auth server: does not support grant type ${l}`); - let d = new Headers({ - "Content-Type": `application/x-www-form-urlencoded`, - Accept: `application/json` - }), f = new URLSearchParams({ - grant_type: l, - code: r, - code_verifier: i, - redirect_uri: String(a) - }); - s ? await s(d, f, e, t) : St$5(xt$5(n, t?.token_endpoint_auth_methods_supported ?? []), n, d, f), o && f.set(`resource`, W$5(o)); - let p = await (c ?? fetch)(u, { - method: `POST`, - headers: d, - body: f - }); - if (!p.ok) throw await Y$6(p); - return We$5.parse(await p.json()); -} -async function Dt$5(e, { metadata: t, clientInformation: n, refreshToken: r, resource: i, addClientAuthentication: a, fetchFn: o }) { - let s = `refresh_token`, c; - if (t) { - if (c = new URL(t.token_endpoint), t.grant_types_supported && !t.grant_types_supported.includes(s)) throw Error(`Incompatible auth server: does not support grant type ${s}`); - } else c = new URL(`/token`, e); - let l = new Headers({ - "Content-Type": `application/x-www-form-urlencoded`, - Accept: `application/json` - }), u = new URLSearchParams({ - grant_type: s, - refresh_token: r - }); - a ? await a(l, u, e, t) : St$5(xt$5(n, t?.token_endpoint_auth_methods_supported ?? []), n, l, u), i && u.set(`resource`, W$5(i)); - let d = await (o ?? fetch)(c, { - method: `POST`, - headers: l, - body: u - }); - if (!d.ok) throw await Y$6(d); - return We$5.parse({ - refresh_token: r, - ...await d.json() - }); -} -async function Ot$5(e, { metadata: t, clientMetadata: n, fetchFn: r }) { - let i; - if (t) { - if (!t.registration_endpoint) throw Error(`Incompatible auth server: does not support dynamic client registration`); - i = new URL(t.registration_endpoint); - } else i = new URL(`/register`, e); - let a = await (r ?? fetch)(i, { - method: `POST`, - headers: { "Content-Type": `application/json` }, - body: JSON.stringify(n) - }); - if (!a.ok) throw await Y$6(a); - return Xe$5.parse(await a.json()); -} -async function X$6(e, t) { - try { - return await Z$6(e, t); - } catch (n) { - if (n instanceof V$4 || n instanceof U$5) return await e.invalidateCredentials?.call(e, `all`), await Z$6(e, t); - if (n instanceof H$5) return await e.invalidateCredentials?.call(e, `tokens`), await Z$6(e, t); - throw n; - } -} -async function kt$5(e, t, n) { - let r = nt$5(e); - if (t.validateResourceURL) return await t.validateResourceURL(r, n?.resource); - if (n) { - if (!rt$5({ - requestedResource: r, - configuredResource: n.resource - })) throw Error(`Protected resource ${n.resource} does not match expected ${r} (or origin)`); - return new URL(n.resource); - } -} -async function Z$6(e, { serverUrl: t, authorizationCode: n, callbackState: r, scope: i, resourceMetadataUrl: a, fetchFn: o }) { - let s, c; - ut$5(t, a); - try { - s = await gt$5(t, { resourceMetadataUrl: a }, o), s.authorization_servers && s.authorization_servers.length > 0 && (c = s.authorization_servers[0]); - } catch {} - c ||= t; - let l = await kt$5(t, e, s); - await e.validateAuthorizationServerURL?.call(e, t, c); - let u = await yt$5(c, { fetchFn: o }), d = it$5(c, u), f = await Promise.resolve(e.clientInformation()); - if (!f) { - if (n !== void 0) throw Error(`Existing OAuth client information is required when exchanging an authorization code`); - if (!e.saveClientInformation) throw Error(`OAuth client information must be saveable for dynamic registration`); - f = ot$5(await Ot$5(c, { - metadata: u, - clientMetadata: e.clientMetadata, - fetchFn: o - }), d), await e.saveClientInformation(f); - } - if (n !== void 0) { - if (e.storedState) { - let t = await e.storedState(); - if (t !== void 0 && t !== r) throw Error(`OAuth state parameter mismatch - possible CSRF attack`); - } - let t = await ct$5({ - provider: e, - clientInformation: f - }); - if (!t) throw new z$4({ message: `Stored OAuth authorization server metadata is required when exchanging an authorization code` }); - dt$5({ - storedAuthorizationServerInformation: t, - currentAuthorizationServerInformation: d - }); - let i = await e.codeVerifier(), a = await Et$5(c, { - metadata: u, - clientInformation: f, - authorizationCode: n, - codeVerifier: i, - redirectUri: e.redirectUrl, - resource: l, - addClientAuthentication: e.addClientAuthentication, - fetchFn: o - }); - return await e.saveTokens(at$5(a, d)), `AUTHORIZED`; - } - let p = await e.tokens(); - if (p?.refresh_token) { - let t = await ct$5({ - provider: e, - clientInformation: f, - tokens: p - }); - t ? dt$5({ - storedAuthorizationServerInformation: t, - currentAuthorizationServerInformation: d - }) : await e.invalidateCredentials?.call(e, `tokens`); - try { - if (t) { - let t = await Dt$5(c, { - metadata: u, - clientInformation: f, - refreshToken: p.refresh_token, - resource: l, - addClientAuthentication: e.addClientAuthentication, - fetchFn: o - }); - return await e.saveTokens(at$5(t, d)), `AUTHORIZED`; - } - } catch (e) { - if (!(!(e instanceof z$4) || e instanceof B$4)) throw e; - } - } - let m = e.state ? await e.state() : void 0; - m && e.saveState && await e.saveState(m); - let { authorizationUrl: ee, codeVerifier: h } = await bt$5(c, { - metadata: u, - clientInformation: f, - state: m, - redirectUrl: e.redirectUrl, - scope: i || e.clientMetadata.scope, - resource: l - }); - if (!await lt$5({ - provider: e, - clientInformation: f, - authorizationServerInformation: d - })) throw new z$4({ message: `OAuth authorization server metadata must be saveable before starting authorization` }); - return await e.saveCodeVerifier(h), await e.redirectToAuthorization(ee), `REDIRECT`; -} -function At$5(e) { - return e === void 0 || e === `message`; -} -var jt$5 = class { - constructor({ url: e, headers: t, authProvider: n, redirect: r = `error`, fetch: i }) { - this.connected = !1, this.url = new URL(e), this.headers = t, this.authProvider = n, this.redirectMode = r, this.fetchFn = i ?? globalThis.fetch; - } - setProtocolVersion(e) { - this.protocolVersion = e; - } - async commonHeaders(e) { - let t = { - ...this.headers, - ...e, - "mcp-protocol-version": this.protocolVersion ?? C$5 - }; - if (this.authProvider) { - let e = await this.authProvider.tokens(); - e?.access_token && (t.Authorization = `Bearer ${e.access_token}`); - } - return Ol(t, `ai-sdk/${Ue$5}`, El()); - } - async start() { - return new Promise((e, t) => { - if (this.connected) return e(); - this.abortController = new AbortController(); - let r = async (i = !1) => { - var a, o, s, c; - try { - let c = await this.commonHeaders({ Accept: `text/event-stream` }), l = await this.fetchFn(this.url.href, { - headers: c, - signal: this.abortController?.signal, - redirect: this.redirectMode - }); - if (l.status === 401 && this.authProvider && !i) { - this.resourceMetadataUrl = q$4(l); - try { - if (await X$6(this.authProvider, { - serverUrl: this.url, - resourceMetadataUrl: this.resourceMetadataUrl, - fetchFn: this.fetchFn - }) !== `AUTHORIZED`) { - let e = new G$5(); - return (a = this.onerror) == null || a.call(this, e), t(e); - } - } catch (e) { - return (o = this.onerror) == null || o.call(this, e), t(e); - } - return r(!0); - } - if (!l.ok || !l.body) { - let e = `MCP SSE Transport Error: ${l.status} ${l.statusText}`; - l.status === 405 && (e += ". This server does not support SSE transport. Try using `http` transport instead"); - let n = new S$4({ message: e }); - return (s = this.onerror) == null || s.call(this, n), t(n); - } - let u = l.body.pipeThrough(new TextDecoderStream()).pipeThrough(new jc()).getReader(), d = async () => { - var n, r, i, a, o; - try { - for (;;) { - let { done: t, value: o } = await u.read(); - if (t) { - if (this.connected) throw this.connected = !1, new S$4({ message: `MCP SSE Transport Error: Connection closed unexpectedly` }); - return; - } - let { event: s, data: c } = o; - if (s === `endpoint`) { - if (this.endpoint) continue; - let t = new URL(c, this.url); - if (t.origin !== this.url.origin) throw this.connected = !1, this.endpoint = void 0, (n = this.sseConnection) == null || n.close(), (r = this.abortController) == null || r.abort(), new S$4({ message: `MCP SSE Transport Error: Endpoint origin does not match connection origin: ${t.origin}` }); - this.endpoint = t, this.connected = !0, e(); - } else if (At$5(s)) try { - let e = await I$4(c); - (i = this.onmessage) == null || i.call(this, e); - } catch (e) { - let t = new S$4({ - message: `MCP SSE Transport Error: Failed to parse message`, - cause: e - }); - (a = this.onerror) == null || a.call(this, t); - } - } - } catch (e) { - if (e instanceof Error && e.name === `AbortError`) return; - (o = this.onerror) == null || o.call(this, e), t(e); - } - }; - this.sseConnection = { close: () => u.cancel() }, d(); - } catch (e) { - if (e instanceof Error && e.name === `AbortError`) return; - (c = this.onerror) == null || c.call(this, e), t(e); - } - }; - r(); - }); - } - async close() { - var e, t, n; - this.connected = !1, this.endpoint = void 0, (e = this.sseConnection) == null || e.close(), (t = this.abortController) == null || t.abort(), (n = this.onclose) == null || n.call(this); - } - async send(e) { - if (!this.endpoint || !this.connected) throw new S$4({ message: `MCP SSE Transport Error: Not connected` }); - let t = this.endpoint, n = async (r = !1) => { - var i, a, o, s; - try { - let s = { - method: `POST`, - headers: await this.commonHeaders({ "Content-Type": `application/json` }), - body: JSON.stringify(e), - signal: this.abortController?.signal, - redirect: this.redirectMode - }, c = await this.fetchFn(t.href, s); - if (c.status === 401 && this.authProvider && !r) { - this.resourceMetadataUrl = q$4(c); - try { - if (await X$6(this.authProvider, { - serverUrl: this.url, - resourceMetadataUrl: this.resourceMetadataUrl, - fetchFn: this.fetchFn - }) !== `AUTHORIZED`) { - let e = new G$5(); - (i = this.onerror) == null || i.call(this, e); - return; - } - } catch (e) { - (a = this.onerror) == null || a.call(this, e); - return; - } - return n(!0); - } - if (!c.ok) { - let e = await c.text().catch(() => null), t = new S$4({ message: `MCP SSE Transport Error: POSTing to endpoint (HTTP ${c.status}): ${e}` }); - (o = this.onerror) == null || o.call(this, t); - return; - } - } catch (e) { - (s = this.onerror) == null || s.call(this, e); - return; - } - }; - await n(); - } -}; -function Mt$5(e) { - return e === void 0 || e === `message`; -} -var Nt$4 = class { - constructor({ url: e, headers: t, authProvider: n, redirect: r = `error`, initialSessionId: i, initialProtocolVersion: a, onSessionIdChange: o, onSessionExpired: s, terminateSessionOnClose: c = !0, fetch: l }) { - this.inboundReconnectAttempts = 0, this.reconnectionOptions = { - initialReconnectionDelay: 1e3, - maxReconnectionDelay: 3e4, - reconnectionDelayGrowFactor: 1.5, - maxRetries: 2 - }, this.url = new URL(e), this.headers = t, this.authProvider = n, this.redirectMode = r, this.sessionId = i, this.protocolVersion = a, this.onSessionIdChange = o, this.onSessionExpired = s, this.terminateSessionOnClose = c, this.fetchFn = l ?? globalThis.fetch; - } - setProtocolVersion(e) { - this.protocolVersion = e; - } - async commonHeaders({ base: e, includeSessionId: t = !0 }) { - let n = { - ...this.headers, - ...e, - "mcp-protocol-version": this.protocolVersion ?? C$5 - }; - if (t && this.sessionId && (n[`mcp-session-id`] = this.sessionId), this.authProvider) { - let e = await this.authProvider.tokens(); - e?.access_token && (n.Authorization = `Bearer ${e.access_token}`); - } - return Ol(n, `ai-sdk/${Ue$5}`, El()); - } - setSessionId(e) { - var t; - this.sessionId !== e && (this.sessionId = e, (t = this.onSessionIdChange) == null || t.call(this, e)); - } - applySessionIdFromResponse(e) { - let t = e.headers.get(`mcp-session-id`); - t && this.setSessionId(t); - } - expireSessionId(e) { - var t; - this.sessionId === e && this.setSessionId(void 0), (t = this.onSessionExpired) == null || t.call(this, e); - } - authorizeOnce(e) { - return this.authProvider ? (this.authPromise ||= X$6(this.authProvider, { - serverUrl: this.url, - resourceMetadataUrl: e, - fetchFn: this.fetchFn - }).finally(() => { - this.authPromise = void 0; - }), this.authPromise) : Promise.resolve(`REDIRECT`); - } - async start() { - if (this.abortController) throw new S$4({ message: `MCP HTTP Transport Error: Transport already started. Note: client.connect() calls start() automatically.` }); - this.abortController = new AbortController(), this.openInboundSse(); - } - async close() { - var e, t, n; - (e = this.inboundSseConnection) == null || e.close(); - try { - if (this.sessionId && this.terminateSessionOnClose && this.abortController && !this.abortController.signal.aborted) { - let e = await this.commonHeaders({ base: {} }); - await this.fetchFn(this.url.href, { - method: `DELETE`, - headers: e, - signal: this.abortController.signal, - redirect: this.redirectMode - }).catch(() => void 0); - } - } catch {} - (t = this.abortController) == null || t.abort(), (n = this.onclose) == null || n.call(this); - } - async send(e) { - let t = async (r = !1) => { - var i, a, o, s, c, l; - try { - let l = `method` in e && e.method === `initialize`, u = l ? void 0 : this.sessionId, d = { - method: `POST`, - headers: await this.commonHeaders({ - base: { - "Content-Type": `application/json`, - Accept: `application/json, text/event-stream` - }, - includeSessionId: !l - }), - body: JSON.stringify(e), - signal: this.abortController?.signal, - redirect: this.redirectMode - }, f = await this.fetchFn(this.url.href, d); - if (this.applySessionIdFromResponse(f), f.status === 401 && this.authProvider && !r) { - this.resourceMetadataUrl = q$4(f); - try { - if (await this.authorizeOnce(this.resourceMetadataUrl) !== `AUTHORIZED`) throw new G$5(); - } catch (e) { - throw (i = this.onerror) == null || i.call(this, e), e; - } - return t(!0); - } - if (f.status === 202) { - this.inboundSseConnection || this.openInboundSse(); - return; - } - if (!f.ok) { - let e = await f.text().catch(() => null), t = `MCP HTTP Transport Error: POSTing to endpoint (HTTP ${f.status}): ${e}`; - f.status === 404 && (u ? (this.expireSessionId(u), t += ". The MCP session expired. Create a new client without `initialSessionId` to start a fresh session") : t += ". This server does not support HTTP transport. Try using `sse` transport instead"); - let n = new S$4({ - message: t, - statusCode: f.status, - url: this.url.href, - responseBody: e ?? void 0 - }); - throw (a = this.onerror) == null || a.call(this, n), n; - } - if (!(`id` in e)) return; - let p = f.headers.get(`content-type`) || ``; - if (p.includes(`application/json`)) { - let e = await f.json(), t = Array.isArray(e) ? e.map((e) => F$4.parse(e)) : [F$4.parse(e)]; - for (let e of t) (o = this.onmessage) == null || o.call(this, e); - return; - } - if (p.includes(`text/event-stream`)) { - if (!f.body) { - let e = new S$4({ - message: `MCP HTTP Transport Error: text/event-stream response without body`, - statusCode: f.status, - url: this.url.href - }); - throw (s = this.onerror) == null || s.call(this, e), e; - } - let e = f.body.pipeThrough(new TextDecoderStream()).pipeThrough(new jc()).getReader(); - (async () => { - var t, n, r; - try { - for (;;) { - let { done: r, value: i } = await e.read(); - if (r) return; - let { event: a, data: o } = i; - if (Mt$5(a)) try { - let e = await I$4(o); - (t = this.onmessage) == null || t.call(this, e); - } catch (e) { - let t = new S$4({ - message: `MCP HTTP Transport Error: Failed to parse message`, - cause: e - }); - (n = this.onerror) == null || n.call(this, t); - } - } - } catch (e) { - if (e instanceof Error && e.name === `AbortError`) return; - (r = this.onerror) == null || r.call(this, e); - } - })(); - return; - } - let m = new S$4({ - message: `MCP HTTP Transport Error: Unexpected content type: ${p}`, - statusCode: f.status, - url: this.url.href - }); - throw (c = this.onerror) == null || c.call(this, m), m; - } catch (e) { - throw (l = this.onerror) == null || l.call(this, e), e; - } - }; - await t(); - } - getNextReconnectionDelay(e) { - let { initialReconnectionDelay: t, reconnectionDelayGrowFactor: n, maxReconnectionDelay: r } = this.reconnectionOptions; - return Math.min(t * n ** +e, r); - } - scheduleInboundSseReconnection() { - var e; - let { maxRetries: t } = this.reconnectionOptions; - if (t > 0 && this.inboundReconnectAttempts >= t) { - (e = this.onerror) == null || e.call(this, new S$4({ message: `MCP HTTP Transport Error: Maximum reconnection attempts (${t}) exceeded.` })); - return; - } - let n = this.getNextReconnectionDelay(this.inboundReconnectAttempts); - this.inboundReconnectAttempts += 1, setTimeout(async () => { - this.abortController?.signal.aborted || await this.openInboundSse(!1, this.lastInboundEventId); - }, n); - } - async openInboundSse(e = !1, t) { - var r, i, a, o; - try { - let o = this.sessionId, s = await this.commonHeaders({ base: { Accept: `text/event-stream` } }); - t && (s[`last-event-id`] = t); - let c = await this.fetchFn(this.url.href, { - method: `GET`, - headers: s, - signal: this.abortController?.signal, - redirect: this.redirectMode - }); - if (this.applySessionIdFromResponse(c), c.status === 401 && this.authProvider && !e) { - this.resourceMetadataUrl = q$4(c); - try { - if (await this.authorizeOnce(this.resourceMetadataUrl) !== `AUTHORIZED`) { - let e = new G$5(); - (r = this.onerror) == null || r.call(this, e); - return; - } - } catch (e) { - (i = this.onerror) == null || i.call(this, e); - return; - } - return this.openInboundSse(!0, t); - } - if (c.status === 405) return; - if (!c.ok || !c.body) { - c.status === 404 && o && this.expireSessionId(o); - let e = new S$4({ - message: `MCP HTTP Transport Error: GET SSE failed: ${c.status} ${c.statusText}`, - statusCode: c.status, - url: this.url.href - }); - (a = this.onerror) == null || a.call(this, e); - return; - } - let l = c.body.pipeThrough(new TextDecoderStream()).pipeThrough(new jc()).getReader(), u = async () => { - var e, t, n; - try { - for (;;) { - let { done: n, value: r } = await l.read(); - if (n) return; - let { event: i, data: a, id: o } = r; - if (o && (this.lastInboundEventId = o), Mt$5(i)) try { - let t = await I$4(a); - (e = this.onmessage) == null || e.call(this, t); - } catch (e) { - let n = new S$4({ - message: `MCP HTTP Transport Error: Failed to parse message`, - cause: e - }); - (t = this.onerror) == null || t.call(this, n); - } - } - } catch (e) { - if (e instanceof Error && e.name === `AbortError`) return; - (n = this.onerror) == null || n.call(this, e), this.abortController?.signal.aborted || this.scheduleInboundSseReconnection(); - } - }; - this.inboundSseConnection = { close: () => l.cancel() }, this.inboundReconnectAttempts = 0, u(); - } catch (e) { - if (e instanceof Error && e.name === `AbortError`) return; - (o = this.onerror) == null || o.call(this, e), this.abortController?.signal.aborted || this.scheduleInboundSseReconnection(); - } - } -}; -function Pt$4(e) { - switch (e.type) { - case `sse`: return new jt$5(e); - case `http`: return new Nt$4(e); - default: throw new S$4({ message: `Unsupported or invalid transport configuration. If you are using a custom transport, make sure it implements the MCPTransport interface.` }); - } -} -function Ft$4(e) { - return `start` in e && typeof e.start == `function` && `send` in e && typeof e.send == `function` && `close` in e && typeof e.close == `function`; -} -var Q$6 = `text/html;profile=mcp-app`; -var Lt$4 = `ui/resourceUri`; -function zt$4(e) { - let n = e?.ui; - return Re$10(n) ? n : void 0; -} -function Vt$4(e) { - return Array.isArray(e) ? e.filter((e) => e === `model` || e === `app`) : void 0; -} -function Ht$4(e) { - let t = zt$4(e._meta), n = t?.resourceUri ?? e._meta?.[Lt$4], r = Vt$4(t?.visibility); - if (n !== void 0) { - if (typeof n != `string` || !n.startsWith(`ui://`)) throw Error(`Invalid MCP App resource URI: ${JSON.stringify(n)}`); - } else if (t == null) return; - return { - ...t, - ...n == null ? {} : { resourceUri: n }, - ...r == null ? {} : { visibility: r } - }; -} -var Kt$4 = `1.0.0`; -function qt$4({ output: e }) { - let t = e; - return !(`content` in t) || !Array.isArray(t.content) ? { - type: `json`, - value: t - } : { - type: `content`, - value: t.content.map((e) => e.type === `text` && `text` in e ? { - type: `text`, - text: e.text - } : e.type === `image` && `data` in e && `mimeType` in e ? { - type: `file`, - mediaType: e.mimeType, - data: { - type: `data`, - data: e.data - } - } : { - type: `text`, - text: JSON.stringify(e) - }) - }; -} -async function $$6(e) { - let t = new Jt$4(e); - return await t.init(), t; -} -var Jt$4 = class { - constructor({ transport: e, name: t, clientName: n = t ?? `ai-sdk-mcp-client`, version: r = Kt$4, onUncaughtError: i, capabilities: a, initialInitializeResult: o }) { - this.requestMessageId = 0, this.responseHandlers = /* @__PURE__ */ new Map(), this.serverCapabilities = {}, this._serverInfo = { - name: ``, - version: `` - }, this._initializeResult = { - protocolVersion: C$5, - capabilities: {}, - serverInfo: this._serverInfo - }, this.isClosed = !0, this.onUncaughtError = i, this.clientCapabilities = a ?? {}, this.initialInitializeResult = o, Ft$4(e) ? this.transport = e : this.transport = Pt$4(e), this.transport.onclose = () => this.onClose(), this.transport.onerror = (e) => this.onError(e), this.transport.onmessage = (e) => { - if (`method` in e) { - `id` in e ? this.onRequestMessage(e) : this.onError(new S$4({ message: `Unsupported message type` })); - return; - } - this.onResponse(e); - }, this.clientInfo = { - name: n, - version: r - }; - } - get serverInfo() { - return this._serverInfo; - } - get initializeResult() { - return this._initializeResult; - } - get instructions() { - return this._serverInstructions; - } - async init() { - try { - if (await this.transport.start(), this.isClosed = !1, this.initialInitializeResult) { - let e = E$5.parse(this.initialInitializeResult); - return this.applyInitializeResult(e), this; - } - let e = await this.request({ - request: { - method: `initialize`, - params: { - protocolVersion: C$5, - capabilities: this.clientCapabilities, - clientInfo: this.clientInfo - } - }, - resultSchema: E$5 - }); - if (e === void 0) throw new S$4({ message: `Server sent invalid initialize result` }); - return this.applyInitializeResult(e), await this.notification({ method: `notifications/initialized` }), this; - } catch (e) { - throw await this.close(), e; - } - } - applyInitializeResult(e) { - if (!_e$5.includes(e.protocolVersion)) throw new S$4({ message: `Server's protocol version is not supported: ${e.protocolVersion}` }); - this.serverCapabilities = e.capabilities, this._serverInfo = e.serverInfo, this._initializeResult = e, this.transport.setProtocolVersion ? this.transport.setProtocolVersion(e.protocolVersion) : this.transport.protocolVersion = e.protocolVersion, this._serverInstructions = e.instructions; - } - async close() { - this.isClosed || (await this.transport?.close(), this.onClose()); - } - assertCapability(e) { - switch (e) { - case `initialize`: break; - case `tools/list`: - case `tools/call`: - if (!this.serverCapabilities.tools) throw new S$4({ message: `Server does not support tools` }); - break; - case `resources/list`: - case `resources/read`: - case `resources/templates/list`: - if (!this.serverCapabilities.resources) throw new S$4({ message: `Server does not support resources` }); - break; - case `prompts/list`: - case `prompts/get`: - if (!this.serverCapabilities.prompts) throw new S$4({ message: `Server does not support prompts` }); - break; - default: throw new S$4({ message: `Unsupported method: ${e}` }); - } - } - async request({ request: e, resultSchema: t, options: n }) { - return new Promise((r, i) => { - if (this.isClosed) return i(new S$4({ message: `Attempted to send a request from a closed client` })); - this.assertCapability(e.method); - let a = n?.signal; - a?.throwIfAborted(); - let o = this.requestMessageId++, s = { - ...e, - jsonrpc: `2.0`, - id: o - }, c = () => { - this.responseHandlers.delete(o); - }; - this.responseHandlers.set(o, (e) => { - if (a?.aborted) return i(new S$4({ - message: `Request was aborted`, - cause: a.reason - })); - if (e instanceof Error) return i(e); - try { - r(t.parse(e.result)); - } catch (e) { - i(new S$4({ - message: `Failed to parse server response`, - cause: e - })); - } - }), this.transport.send(s).catch((e) => { - c(), i(e); - }); - }); - } - async listTools({ params: e, options: t } = {}) { - return this.request({ - request: { - method: `tools/list`, - params: e - }, - resultSchema: we$5, - options: t - }); - } - async callTool({ name: e, arguments: t = {}, options: n }) { - try { - return this.request({ - request: { - method: `tools/call`, - params: { - name: e, - arguments: t - } - }, - resultSchema: ke$5, - options: n - }); - } catch (e) { - throw e; - } - } - async listResourcesInternal({ params: e, options: t } = {}) { - try { - return this.request({ - request: { - method: `resources/list`, - params: e - }, - resultSchema: Ee$5, - options: t - }); - } catch (e) { - throw e; - } - } - async readResourceInternal({ uri: e, options: t }) { - try { - return this.request({ - request: { - method: `resources/read`, - params: { uri: e } - }, - resultSchema: Me$5, - options: t - }); - } catch (e) { - throw e; - } - } - async listResourceTemplatesInternal({ options: e } = {}) { - try { - return this.request({ - request: { method: `resources/templates/list` }, - resultSchema: je$5, - options: e - }); - } catch (e) { - throw e; - } - } - async listPromptsInternal({ params: e, options: t } = {}) { - try { - return this.request({ - request: { - method: `prompts/list`, - params: e - }, - resultSchema: Fe$5, - options: t - }); - } catch (e) { - throw e; - } - } - async getPromptInternal({ name: e, args: t, options: n }) { - try { - return this.request({ - request: { - method: `prompts/get`, - params: { - name: e, - arguments: t - } - }, - resultSchema: Le$5, - options: n - }); - } catch (e) { - throw e; - } - } - async notification(e) { - let t = { - ...e, - jsonrpc: `2.0` - }; - await this.transport.send(t); - } - async tools({ schemas: e = `automatic` } = {}) { - let t = await this.listTools(); - return this.toolsFromDefinitions(t, { schemas: e }); - } - toolsFromDefinitions(e, { schemas: t = `automatic` } = {}) { - let n = {}; - for (let { name: r, title: i, description: o, inputSchema: s, annotations: c, _meta: l } of e.tools) { - let e = i ?? c?.title; - if (t !== `automatic` && !Object.prototype.hasOwnProperty.call(t, r)) continue; - let u = this, d = t === `automatic` ? void 0 : t[r]?.outputSchema, f = Ht$4({ _meta: l }), p = { - clientName: this.clientInfo.name, - toolName: r, - ...e == null ? {} : { title: e }, - ...f?.resourceUri == null ? {} : { app: { - ...f, - mimeType: Q$6 - } } - }, m = async (e, t) => { - var n; - (n = t?.abortSignal) == null || n.throwIfAborted(); - let i = await u.callTool({ - name: r, - arguments: e, - options: { signal: t?.abortSignal } - }); - return i.isError || d == null ? i : u.extractStructuredContent(i, d, r); - }; - n[r] = { - ...t === `automatic` ? dd({ - description: o, - title: e, - metadata: p, - inputSchema: Gu({ - ...s, - properties: s.properties ?? {}, - additionalProperties: !1 - }), - execute: m, - toModelOutput: qt$4 - }) : ud({ - description: o, - title: e, - metadata: p, - inputSchema: t[r].inputSchema, - ...d == null ? {} : { outputSchema: d }, - execute: m, - toModelOutput: qt$4 - }), - _meta: l - }; - } - return n; - } - async extractStructuredContent(e, t, n) { - if (`structuredContent` in e && e.structuredContent != null) { - let r = await ed({ - value: e.structuredContent, - schema: qu(t) - }); - if (!r.success) throw new S$4({ - message: `Tool "${n}" returned structuredContent that does not match the expected outputSchema`, - cause: r.error - }); - return r.value; - } - if (`content` in e && Array.isArray(e.content)) { - let r = e.content.find((e) => e.type === `text`); - if (r && `text` in r) { - let e = await nd({ - text: r.text, - schema: t - }); - if (!e.success) throw new S$4({ - message: `Tool "${n}" returned content that does not match the expected outputSchema`, - cause: e.error - }); - return e.value; - } - } - throw new S$4({ message: `Tool "${n}" did not return structuredContent or parseable text content` }); - } - listResources({ params: e, options: t } = {}) { - return this.listResourcesInternal({ - params: e, - options: t - }); - } - readResource({ uri: e, options: t }) { - return this.readResourceInternal({ - uri: e, - options: t - }); - } - listResourceTemplates({ options: e } = {}) { - return this.listResourceTemplatesInternal({ options: e }); - } - experimental_listPrompts({ params: e, options: t } = {}) { - return this.listPromptsInternal({ - params: e, - options: t - }); - } - experimental_getPrompt({ name: e, arguments: t, options: n }) { - return this.getPromptInternal({ - name: e, - args: t, - options: n - }); - } - onElicitationRequest(e, t) { - if (e !== N$4) throw new S$4({ message: `Unsupported request schema. Only ElicitationRequestSchema is supported.` }); - this.elicitationRequestHandler = t; - } - async onRequestMessage(e) { - try { - if (e.method === `ping`) { - await this.transport.send({ - jsonrpc: `2.0`, - id: e.id, - result: {} - }); - return; - } - if (e.method !== `elicitation/create`) { - await this.transport.send({ - jsonrpc: `2.0`, - id: e.id, - error: { - code: -32601, - message: `Unsupported request method: ${e.method}` - } - }); - return; - } - if (!this.elicitationRequestHandler) { - await this.transport.send({ - jsonrpc: `2.0`, - id: e.id, - error: { - code: -32601, - message: `No elicitation handler registered on client` - } - }); - return; - } - let t = N$4.safeParse({ - method: e.method, - params: e.params - }); - if (!t.success) { - await this.transport.send({ - jsonrpc: `2.0`, - id: e.id, - error: { - code: -32602, - message: `Invalid elicitation request: ${t.error.message}`, - data: t.error.issues - } - }); - return; - } - try { - let n = await this.elicitationRequestHandler(t.data), r = ze$5.parse(n); - await this.transport.send({ - jsonrpc: `2.0`, - id: e.id, - result: r - }); - } catch (t) { - await this.transport.send({ - jsonrpc: `2.0`, - id: e.id, - error: { - code: -32603, - message: t instanceof Error ? t.message : `Failed to handle elicitation request` - } - }), this.onError(t); - } - } catch (e) { - this.onError(e); - } - } - onClose() { - if (this.isClosed) return; - this.isClosed = !0; - let e = new S$4({ message: `Connection closed` }); - for (let t of this.responseHandlers.values()) t(e); - this.responseHandlers.clear(); - } - onError(e) { - this.onUncaughtError && this.onUncaughtError(e); - } - onResponse(e) { - let t = Number(e.id), n = this.responseHandlers.get(t); - if (n === void 0) throw new S$4({ message: `Protocol error: Received a response for an unknown message ID: ${JSON.stringify(e)}` }); - this.responseHandlers.delete(t), n(`result` in e ? e : new S$4({ - message: e.error.message, - code: e.error.code, - data: e.error.data, - cause: e.error - })); - } -}; -//#endregion -//#region node_modules/eve/dist/src/runtime/connections/mcp-client.js -var McpConnectionClient = class { - #e; - #t; - #n; - #r; - #i; - constructor(e) { - this.#i = e; - } - async connect() { - if (this.#t !== void 0) return this.#t; - if (this.#e !== void 0) return this.#e; - this.#e = this.#a(); - try { - return this.#t = await this.#e, this.#t; - } catch (e) { - throw this.#e = void 0, e; - } - } - async #a() { - let e = await resolveHeaders(this.#i), t = this.#i.url; - try { - return await $$6({ transport: { - type: `http`, - url: t, - headers: e - } }); - } catch (n) { - if (!isMcpHttpFallbackRetryableError(n)) throw n; - return await $$6({ transport: { - type: `sse`, - url: t, - headers: e - } }); - } - } - async getToolMetadata() { - return (await this.#o()).metadata; - } - async getTools() { - return (await this.#o()).tools; - } - async executeTool(e, t) { - try { - let { tools: n } = await this.#o(), r = n[e]; - if (r?.execute === void 0) throw Error(`Tool "${e}" not found in connection "${this.#i.connectionName}".`); - return await r.execute(t, {}); - } catch (e) { - return await this.#l(e); - } - } - async #o() { - if (this.#r !== void 0) return this.#r; - if (this.#n !== void 0) return this.#n; - this.#n = this.#s(); - try { - return this.#r = await this.#n, this.#r; - } catch (e) { - throw this.#n = void 0, e; - } - } - async #s() { - try { - return await this.#c(); - } catch (e) { - return await this.#l(e); - } - } - async #c() { - let e = await this.connect(), t = await e.listTools(), n = this.#i.tools, r = n === void 0 ? t.tools : t.tools.filter((e) => passesToolFilter(e.name, n)), i = e.toolsFromDefinitions({ tools: r }); - return { - metadata: r.map((e) => ({ - annotations: e.annotations, - description: e.description ?? ``, - inputSchema: e.inputSchema ?? {}, - name: e.name, - outputSchema: `outputSchema` in e && e.outputSchema !== void 0 ? e.outputSchema : void 0 - })), - tools: i - }; - } - async close() { - this.#t !== void 0 && (await this.#t.close(), this.#t = void 0), this.#e = void 0, this.#n = void 0, this.#r = void 0; - } - async #l(e) { - throw isMcpAuthRequiredError(e) ? (await this.#u(), await this.close(), new ConnectionAuthorizationRequiredError(this.#i.connectionName, { message: `Connection "${this.#i.connectionName}" requires authorization (the server rejected the token).` })) : e; - } - async #u() { - let e = await resolveConnectionAuthorization(this.#i); - e !== void 0 && await evictScopedToken({ - authorization: e, - connection: { url: this.#i.url }, - scope: this.#i.connectionName - }); - } -}; -function isMcpAuthRequiredError(e) { - return readHttpStatus(e) === 401; -} -function isMcpHttpFallbackRetryableError(e) { - let t = readHttpStatus(e); - return t === 400 || t === 404 || t === 405; -} -function readHttpStatus(t) { - for (let n of walkErrorChain(t)) { - if (!isObject(n)) continue; - let t = readStatusField(n); - if (t !== void 0) return t; - let r = n.response; - if (isObject(r)) { - let e = readStatusField(r); - if (e !== void 0) return e; - } - if (typeof n.message == `string`) { - let e = /\bHTTP\s+(\d{3})\b/u.exec(n.message); - if (e?.[1] !== void 0) return Number(e[1]); - } - } -} -function readStatusField(e) { - if (typeof e.status == `number`) return e.status; - if (typeof e.statusCode == `number`) return e.statusCode; -} -function* walkErrorChain(t) { - let n = t, r = /* @__PURE__ */ new Set(); - for (; n != null && !r.has(n);) { - if (r.add(n), yield n, !isObject(n) || !(`cause` in n)) return; - n = n.cause; - } -} -function passesToolFilter(e, t) { - return t === void 0 ? !0 : `allow` in t ? t.allow.includes(e) : !t.block.includes(e); -} -async function resolveHeaders(e) { - let n = {}, r, getCallbackContext = () => r ??= buildCallbackContext(), i = await resolveConnectionAuthorization(e, typeof e.authorization == `function` ? getCallbackContext() : void 0); - if (i !== void 0 && (n.Authorization = `Bearer ${(await resolveToken(e, i)).token}`), e.headers !== void 0) { - let t = await resolveHeadersDefinition(e.headers, getCallbackContext); - for (let [r, a] of Object.entries(t)) { - if (i !== void 0 && r.toLowerCase() === `authorization`) throw Error(`Connection "${e.connectionName}" headers must not include an "Authorization" key when "authorization" is also provided.`); - n[r] = a; - } - } - return n; -} -async function resolveToken(e, t) { - return await resolveScopedToken({ - authorization: t, - connection: { url: e.url }, - scope: e.connectionName - }); -} -async function resolveHeadersDefinition(e, t) { - if (typeof e == `function`) return { ...await e(t()) }; - let n = {}, r = Object.entries(e); - for (let [e, i] of r) n[e] = await resolveHeaderValue(i, t); - return n; -} -async function resolveHeaderValue(e, t) { - return typeof e == `function` ? await e(t()) : await e; -} -//#endregion -//#region node_modules/eve/dist/src/runtime/connections/openapi-operations.js -const HTTP_METHODS = [ - `get`, - `put`, - `post`, - `delete`, - `patch`, - `head`, - `options` -]; -function operationName(e, t, n) { - if (typeof e.operationId == `string` && e.operationId.length > 0) { - let t = sanitizeToolName(e.operationId); - if (t.length > 0) return t; - } - return sanitizeToolName(`${t}_${n.replace(/[{}]/g, ``).replace(/[^a-zA-Z0-9]+/g, `_`).replace(/^_+|_+$/g, ``)}`); -} -function sanitizeToolName(e) { - return e.replace(/[^a-zA-Z0-9_-]+/g, `_`).replace(/^[_-]+|[_-]+$/g, ``).slice(0, 64); -} -function uniqueName(e, t) { - let n = e, r = 2; - for (; t.has(n);) n = `${e}_${r}`, r += 1; - return t.add(n), n; -} -function operationDescription(e) { - return typeof e.summary == `string` && e.summary.length > 0 ? e.summary : typeof e.description == `string` ? e.description : ``; -} -//#endregion -//#region node_modules/eve/dist/src/runtime/connections/openapi-schema.js -function buildInputSchema(e, t) { - let n = {}, r = []; - for (let t of e) n[t.name] = t.description === void 0 ? t.schema : { - ...t.schema, - description: t.description - }, t.required && r.push(t.name); - t !== void 0 && (n.body = t.schema, t.required && r.push(`body`)); - let i = { - type: `object`, - properties: n - }; - return r.length > 0 && (i.required = r), i; -} -function deref(e, t) { - return typeof t.$ref == `string` ? resolveRef(e, t.$ref) ?? {} : t; -} -function derefSchema(t, n, r = 0, i = /* @__PURE__ */ new Set()) { - if (isArray(n)) return n.map((e) => derefSchema(t, e, r + 1, i)); - if (!isObject(n)) return n; - if (r > 12) return {}; - if (typeof n.$ref == `string`) { - if (i.has(n.$ref)) return {}; - let e = resolveRef(t, n.$ref); - return e === void 0 ? {} : derefSchema(t, e, r + 1, /* @__PURE__ */ new Set([...i, n.$ref])); - } - let a = {}; - for (let [e, o] of Object.entries(n)) a[e] = derefSchema(t, o, r + 1, i); - return normalizeSchemaType(a), normalizeNullable(a), a; -} -const VALID_JSON_SCHEMA_TYPES = /* @__PURE__ */ new Set([ - `string`, - `number`, - `integer`, - `boolean`, - `object`, - `array`, - `null` -]); -function normalizeSchemaType(e) { - let n = e.type; - if (typeof n == `string` && !VALID_JSON_SCHEMA_TYPES.has(n)) delete e.type; - else if (isArray(n)) { - let r = n.filter((e) => typeof e == `string` && VALID_JSON_SCHEMA_TYPES.has(e)); - r.length === 0 ? delete e.type : e.type = r; - } -} -function normalizeNullable(e) { - if (!(`nullable` in e)) return; - let t = e.nullable === !0; - if (delete e.nullable, !t) return; - let n = e.type; - typeof n == `string` ? n !== `null` && (e.type = [n, `null`]) : isArray(n) ? n.includes(`null`) || (e.type = [...n, `null`]) : isArray(e.enum) && !e.enum.includes(null) && (e.enum = [...e.enum, null]); -} -function resolveRef(t, n) { - if (!n.startsWith(`#/`)) return; - let r = n.slice(2).split(`/`).map((e) => e.replace(/~1/g, `/`).replace(/~0/g, `~`)), i = t; - for (let t of r) { - if (!isObject(i)) return; - i = i[t]; - } - return i; -} -function isArray(e) { - return Array.isArray(e); -} -//#endregion -//#region node_modules/eve/dist/src/runtime/connections/openapi-security.js -function resolveSecurity(r, i) { - let a = isArray(i.security) ? i.security : isArray(r.security) ? r.security : void 0; - if (a === void 0 || a.length === 0) return; - let o = getSecuritySchemes(r); - if (o !== void 0) for (let n of a) { - if (!isObject(n)) continue; - let i = Object.keys(n)[0]; - if (i === void 0) continue; - let a = o[i], s = isObject(a) ? deref(r, a) : void 0; - if (!isObject(s)) continue; - let c = mapSecurityScheme(s); - if (c !== void 0) return c; - } -} -function getSecuritySchemes(t) { - let n = isObject(t.components) ? t.components : void 0; - return n !== void 0 && isObject(n.securitySchemes) ? n.securitySchemes : isObject(t.securityDefinitions) ? t.securityDefinitions : void 0; -} -function mapSecurityScheme(e) { - if (e.type === `apiKey`) { - let t = e.in; - return (t === `header` || t === `query` || t === `cookie`) && typeof e.name == `string` && e.name.length > 0 ? { - kind: `apiKey`, - in: t, - name: e.name - } : void 0; - } - if (e.type === `http`) return (typeof e.scheme == `string` ? e.scheme.toLowerCase() : ``) === `basic` ? { kind: `basic` } : { kind: `bearer` }; - if (e.type === `basic`) return { kind: `basic` }; - if (e.type === `oauth2` || e.type === `openIdConnect`) return { kind: `bearer` }; -} -function applySecurity(e, t, n, r, i) { - if (e === void 0 || t.authorization === void 0) return; - let a = extractBearerToken(n); - if (a !== void 0 && e.kind !== `bearer`) { - if (e.kind === `basic`) { - n.Authorization = `Basic ${a}`; - return; - } - delete n.Authorization, e.in === `header` ? n[e.name] = a : e.in === `query` ? r.set(e.name, a) : i.push(`${e.name}=${a}`); - } -} -function extractBearerToken(e) { - let t = e.Authorization ?? e.authorization; - return typeof t == `string` ? /^Bearer\s+(.+)$/i.exec(t)?.[1] : void 0; -} -//#endregion -//#region node_modules/eve/dist/src/compiled/gray-matter/index.js -var __commonJSMin = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports); -var __require = createRequire(import.meta.url); -var require_kind_of = __commonJSMin(((e, t) => { - var n = Object.prototype.toString; - t.exports = function(e) { - if (e === void 0) return `undefined`; - if (e === null) return `null`; - var t = typeof e; - if (t === `boolean`) return `boolean`; - if (t === `string`) return `string`; - if (t === `number`) return `number`; - if (t === `symbol`) return `symbol`; - if (t === `function`) return c(e) ? `generatorfunction` : `function`; - if (i(e)) return `array`; - if (d(e)) return `buffer`; - if (u(e)) return `arguments`; - if (o(e)) return `date`; - if (a(e)) return `error`; - if (s(e)) return `regexp`; - switch (r(e)) { - case `Symbol`: return `symbol`; - case `Promise`: return `promise`; - case `WeakMap`: return `weakmap`; - case `WeakSet`: return `weakset`; - case `Map`: return `map`; - case `Set`: return `set`; - case `Int8Array`: return `int8array`; - case `Uint8Array`: return `uint8array`; - case `Uint8ClampedArray`: return `uint8clampedarray`; - case `Int16Array`: return `int16array`; - case `Uint16Array`: return `uint16array`; - case `Int32Array`: return `int32array`; - case `Uint32Array`: return `uint32array`; - case `Float32Array`: return `float32array`; - case `Float64Array`: return `float64array`; - } - if (l(e)) return `generator`; - switch (t = n.call(e), t) { - case `[object Object]`: return `object`; - case `[object Map Iterator]`: return `mapiterator`; - case `[object Set Iterator]`: return `setiterator`; - case `[object String Iterator]`: return `stringiterator`; - case `[object Array Iterator]`: return `arrayiterator`; - } - return t.slice(8, -1).toLowerCase().replace(/\s/g, ``); - }; - function r(e) { - return typeof e.constructor == `function` ? e.constructor.name : null; - } - function i(e) { - return Array.isArray ? Array.isArray(e) : e instanceof Array; - } - function a(e) { - return e instanceof Error || typeof e.message == `string` && e.constructor && typeof e.constructor.stackTraceLimit == `number`; - } - function o(e) { - return e instanceof Date ? !0 : typeof e.toDateString == `function` && typeof e.getDate == `function` && typeof e.setDate == `function`; - } - function s(e) { - return e instanceof RegExp ? !0 : typeof e.flags == `string` && typeof e.ignoreCase == `boolean` && typeof e.multiline == `boolean` && typeof e.global == `boolean`; - } - function c(e, t) { - return r(e) === `GeneratorFunction`; - } - function l(e) { - return typeof e.throw == `function` && typeof e.return == `function` && typeof e.next == `function`; - } - function u(e) { - try { - if (typeof e.length == `number` && typeof e.callee == `function`) return !0; - } catch (e) { - if (e.message.indexOf(`callee`) !== -1) return !0; - } - return !1; - } - function d(e) { - return e.constructor && typeof e.constructor.isBuffer == `function` ? e.constructor.isBuffer(e) : !1; - } -})); -var require_is_extendable = __commonJSMin(((e, t) => { - t.exports = function(e) { - return e != null && (typeof e == `object` || typeof e == `function`); - }; -})); -var require_extend_shallow = __commonJSMin(((e, t) => { - var n = require_is_extendable(); - t.exports = function(e) { - n(e) || (e = {}); - for (var t = arguments.length, i = 1; i < t; i++) { - var a = arguments[i]; - n(a) && r(e, a); - } - return e; - }; - function r(e, t) { - for (var n in t) i(t, n) && (e[n] = t[n]); - } - function i(e, t) { - return Object.prototype.hasOwnProperty.call(e, t); - } -})); -var require_section_matter = __commonJSMin(((e, t) => { - var n = require_kind_of(), r = require_extend_shallow(); - t.exports = function(e, t) { - typeof t == `function` && (t = { parse: t }); - var n = a(e), l = r({}, { - section_delimiter: `---`, - parse: c - }, t), u = l.section_delimiter, d = n.content.split(/\r?\n/), f = null, p = s(), m = [], h = []; - function g(e) { - n.content = e, f = [], m = []; - } - function _(e) { - h.length && (p.key = o(h[0], u), p.content = e, l.parse(p, f), f.push(p), p = s(), m = [], h = []); - } - for (var v = 0; v < d.length; v++) { - var y = d[v], b = h.length, x = y.trim(); - if (i(x, u)) { - if (x.length === 3 && v !== 0) { - if (b === 0 || b === 2) { - m.push(y); - continue; - } - h.push(x), p.data = m.join(` -`), m = []; - continue; - } - f === null && g(m.join(` -`)), b === 2 && _(m.join(` -`)), h.push(x); - continue; - } - m.push(y); - } - return f === null ? g(m.join(` -`)) : _(m.join(` -`)), n.sections = f, n; - }; - function i(e, t) { - return !(e.slice(0, t.length) !== t || e.charAt(t.length + 1) === t.slice(-1)); - } - function a(e) { - if (n(e) !== `object` && (e = { content: e }), typeof e.content != `string` && !l(e.content)) throw TypeError(`expected a buffer or string`); - return e.content = e.content.toString(), e.sections = [], e; - } - function o(e, t) { - return e ? e.slice(t.length).trim() : ``; - } - function s() { - return { - key: ``, - data: ``, - content: `` - }; - } - function c(e) { - return e; - } - function l(e) { - return e && e.constructor && typeof e.constructor.isBuffer == `function` ? e.constructor.isBuffer(e) : !1; - } -})); -var require_common = __commonJSMin(((e, t) => { - function n(e) { - return e == null; - } - function r(e) { - return typeof e == `object` && !!e; - } - function i(e) { - return Array.isArray(e) ? e : n(e) ? [] : [e]; - } - function a(e, t) { - var n, r, i, a; - if (t) for (a = Object.keys(t), n = 0, r = a.length; n < r; n += 1) i = a[n], e[i] = t[i]; - return e; - } - function o(e, t) { - var n = ``, r; - for (r = 0; r < t; r += 1) n += e; - return n; - } - function s(e) { - return e === 0 && 1 / e == -Infinity; - } - t.exports.isNothing = n, t.exports.isObject = r, t.exports.toArray = i, t.exports.repeat = o, t.exports.isNegativeZero = s, t.exports.extend = a; -})); -var require_exception = __commonJSMin(((e, t) => { - function n(e, t) { - Error.call(this), this.name = `YAMLException`, this.reason = e, this.mark = t, this.message = (this.reason || `(unknown reason)`) + (this.mark ? ` ` + this.mark.toString() : ``), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = Error().stack || ``; - } - n.prototype = Object.create(Error.prototype), n.prototype.constructor = n, n.prototype.toString = function(e) { - var t = this.name + `: `; - return t += this.reason || `(unknown reason)`, !e && this.mark && (t += ` ` + this.mark.toString()), t; - }, t.exports = n; -})); -var require_mark = __commonJSMin(((e, t) => { - var n = require_common(); - function r(e, t, n, r, i) { - this.name = e, this.buffer = t, this.position = n, this.line = r, this.column = i; - } - r.prototype.getSnippet = function(e, t) { - var r, i, a, o, s; - if (!this.buffer) return null; - for (e ||= 4, t ||= 75, r = ``, i = this.position; i > 0 && `\0\r -…\u2028\u2029`.indexOf(this.buffer.charAt(i - 1)) === -1;) if (--i, this.position - i > t / 2 - 1) { - r = ` ... `, i += 5; - break; - } - for (a = ``, o = this.position; o < this.buffer.length && `\0\r -…\u2028\u2029`.indexOf(this.buffer.charAt(o)) === -1;) if (o += 1, o - this.position > t / 2 - 1) { - a = ` ... `, o -= 5; - break; - } - return s = this.buffer.slice(i, o), n.repeat(` `, e) + r + s + a + ` -` + n.repeat(` `, e + this.position - i + r.length) + `^`; - }, r.prototype.toString = function(e) { - var t, n = ``; - return this.name && (n += `in "` + this.name + `" `), n += `at line ` + (this.line + 1) + `, column ` + (this.column + 1), e || (t = this.getSnippet(), t && (n += `: -` + t)), n; - }, t.exports = r; -})); -var require_type = __commonJSMin(((e, t) => { - var n = require_exception(), r = [ - `kind`, - `resolve`, - `construct`, - `instanceOf`, - `predicate`, - `represent`, - `defaultStyle`, - `styleAliases` - ], i = [ - `scalar`, - `sequence`, - `mapping` - ]; - function a(e) { - var t = {}; - return e !== null && Object.keys(e).forEach(function(n) { - e[n].forEach(function(e) { - t[String(e)] = n; - }); - }), t; - } - function o(e, t) { - if (t ||= {}, Object.keys(t).forEach(function(t) { - if (r.indexOf(t) === -1) throw new n(`Unknown option "` + t + `" is met in definition of "` + e + `" YAML type.`); - }), this.tag = e, this.kind = t.kind || null, this.resolve = t.resolve || function() { - return !0; - }, this.construct = t.construct || function(e) { - return e; - }, this.instanceOf = t.instanceOf || null, this.predicate = t.predicate || null, this.represent = t.represent || null, this.defaultStyle = t.defaultStyle || null, this.styleAliases = a(t.styleAliases || null), i.indexOf(this.kind) === -1) throw new n(`Unknown kind "` + this.kind + `" is specified for "` + e + `" YAML type.`); - } - t.exports = o; -})); -var require_schema = __commonJSMin(((e, t) => { - var n = require_common(), r = require_exception(), i = require_type(); - function a(e, t, n) { - var r = []; - return e.include.forEach(function(e) { - n = a(e, t, n); - }), e[t].forEach(function(e) { - n.forEach(function(t, n) { - t.tag === e.tag && t.kind === e.kind && r.push(n); - }), n.push(e); - }), n.filter(function(e, t) { - return r.indexOf(t) === -1; - }); - } - function o() { - var e = { - scalar: {}, - sequence: {}, - mapping: {}, - fallback: {} - }, t, n; - function r(t) { - e[t.kind][t.tag] = e.fallback[t.tag] = t; - } - for (t = 0, n = arguments.length; t < n; t += 1) arguments[t].forEach(r); - return e; - } - function s(e) { - this.include = e.include || [], this.implicit = e.implicit || [], this.explicit = e.explicit || [], this.implicit.forEach(function(e) { - if (e.loadKind && e.loadKind !== `scalar`) throw new r(`There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.`); - }), this.compiledImplicit = a(this, `implicit`, []), this.compiledExplicit = a(this, `explicit`, []), this.compiledTypeMap = o(this.compiledImplicit, this.compiledExplicit); - } - s.DEFAULT = null, s.create = function() { - var e, t; - switch (arguments.length) { - case 1: - e = s.DEFAULT, t = arguments[0]; - break; - case 2: - e = arguments[0], t = arguments[1]; - break; - default: throw new r(`Wrong number of arguments for Schema.create function`); - } - if (e = n.toArray(e), t = n.toArray(t), !e.every(function(e) { - return e instanceof s; - })) throw new r(`Specified list of super schemas (or a single Schema object) contains a non-Schema object.`); - if (!t.every(function(e) { - return e instanceof i; - })) throw new r(`Specified list of YAML types (or a single Type object) contains a non-Type object.`); - return new s({ - include: e, - explicit: t - }); - }, t.exports = s; -})); -var require_str = __commonJSMin(((e, t) => { - t.exports = new (require_type())(`tag:yaml.org,2002:str`, { - kind: `scalar`, - construct: function(e) { - return e === null ? `` : e; - } - }); -})); -var require_seq = __commonJSMin(((e, t) => { - t.exports = new (require_type())(`tag:yaml.org,2002:seq`, { - kind: `sequence`, - construct: function(e) { - return e === null ? [] : e; - } - }); -})); -var require_map = __commonJSMin(((e, t) => { - t.exports = new (require_type())(`tag:yaml.org,2002:map`, { - kind: `mapping`, - construct: function(e) { - return e === null ? {} : e; - } - }); -})); -var require_failsafe = __commonJSMin(((e, t) => { - t.exports = new (require_schema())({ explicit: [ - require_str(), - require_seq(), - require_map() - ] }); -})); -var require_null = __commonJSMin(((e, t) => { - var n = require_type(); - function r(e) { - if (e === null) return !0; - var t = e.length; - return t === 1 && e === `~` || t === 4 && (e === `null` || e === `Null` || e === `NULL`); - } - function i() { - return null; - } - function a(e) { - return e === null; - } - t.exports = new n(`tag:yaml.org,2002:null`, { - kind: `scalar`, - resolve: r, - construct: i, - predicate: a, - represent: { - canonical: function() { - return `~`; - }, - lowercase: function() { - return `null`; - }, - uppercase: function() { - return `NULL`; - }, - camelcase: function() { - return `Null`; - } - }, - defaultStyle: `lowercase` - }); -})); -var require_bool = __commonJSMin(((e, t) => { - var n = require_type(); - function r(e) { - if (e === null) return !1; - var t = e.length; - return t === 4 && (e === `true` || e === `True` || e === `TRUE`) || t === 5 && (e === `false` || e === `False` || e === `FALSE`); - } - function i(e) { - return e === `true` || e === `True` || e === `TRUE`; - } - function a(e) { - return Object.prototype.toString.call(e) === `[object Boolean]`; - } - t.exports = new n(`tag:yaml.org,2002:bool`, { - kind: `scalar`, - resolve: r, - construct: i, - predicate: a, - represent: { - lowercase: function(e) { - return e ? `true` : `false`; - }, - uppercase: function(e) { - return e ? `TRUE` : `FALSE`; - }, - camelcase: function(e) { - return e ? `True` : `False`; - } - }, - defaultStyle: `lowercase` - }); -})); -var require_int = __commonJSMin(((e, t) => { - var n = require_common(), r = require_type(); - function i(e) { - return 48 <= e && e <= 57 || 65 <= e && e <= 70 || 97 <= e && e <= 102; - } - function a(e) { - return 48 <= e && e <= 55; - } - function o(e) { - return 48 <= e && e <= 57; - } - function s(e) { - if (e === null) return !1; - var t = e.length, n = 0, r = !1, s; - if (!t) return !1; - if (s = e[n], (s === `-` || s === `+`) && (s = e[++n]), s === `0`) { - if (n + 1 === t) return !0; - if (s = e[++n], s === `b`) { - for (n++; n < t; n++) if (s = e[n], s !== `_`) { - if (s !== `0` && s !== `1`) return !1; - r = !0; - } - return r && s !== `_`; - } - if (s === `x`) { - for (n++; n < t; n++) if (s = e[n], s !== `_`) { - if (!i(e.charCodeAt(n))) return !1; - r = !0; - } - return r && s !== `_`; - } - for (; n < t; n++) if (s = e[n], s !== `_`) { - if (!a(e.charCodeAt(n))) return !1; - r = !0; - } - return r && s !== `_`; - } - if (s === `_`) return !1; - for (; n < t; n++) if (s = e[n], s !== `_`) { - if (s === `:`) break; - if (!o(e.charCodeAt(n))) return !1; - r = !0; - } - return !r || s === `_` ? !1 : s === `:` ? /^(:[0-5]?[0-9])+$/.test(e.slice(n)) : !0; - } - function c(e) { - var t = e, n = 1, r, i, a = []; - return t.indexOf(`_`) !== -1 && (t = t.replace(/_/g, ``)), r = t[0], (r === `-` || r === `+`) && (r === `-` && (n = -1), t = t.slice(1), r = t[0]), t === `0` ? 0 : r === `0` ? t[1] === `b` ? n * parseInt(t.slice(2), 2) : t[1] === `x` ? n * parseInt(t, 16) : n * parseInt(t, 8) : t.indexOf(`:`) === -1 ? n * parseInt(t, 10) : (t.split(`:`).forEach(function(e) { - a.unshift(parseInt(e, 10)); - }), t = 0, i = 1, a.forEach(function(e) { - t += e * i, i *= 60; - }), n * t); - } - function l(e) { - return Object.prototype.toString.call(e) === `[object Number]` && e % 1 == 0 && !n.isNegativeZero(e); - } - t.exports = new r(`tag:yaml.org,2002:int`, { - kind: `scalar`, - resolve: s, - construct: c, - predicate: l, - represent: { - binary: function(e) { - return e >= 0 ? `0b` + e.toString(2) : `-0b` + e.toString(2).slice(1); - }, - octal: function(e) { - return e >= 0 ? `0` + e.toString(8) : `-0` + e.toString(8).slice(1); - }, - decimal: function(e) { - return e.toString(10); - }, - hexadecimal: function(e) { - return e >= 0 ? `0x` + e.toString(16).toUpperCase() : `-0x` + e.toString(16).toUpperCase().slice(1); - } - }, - defaultStyle: `decimal`, - styleAliases: { - binary: [2, `bin`], - octal: [8, `oct`], - decimal: [10, `dec`], - hexadecimal: [16, `hex`] - } - }); -})); -var require_float = __commonJSMin(((e, t) => { - var n = require_common(), r = require_type(), i = RegExp(`^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$`); - function a(e) { - return !(e === null || !i.test(e) || e[e.length - 1] === `_`); - } - function o(e) { - var t = e.replace(/_/g, ``).toLowerCase(), n = t[0] === `-` ? -1 : 1, r, i = []; - return `+-`.indexOf(t[0]) >= 0 && (t = t.slice(1)), t === `.inf` ? n === 1 ? Infinity : -Infinity : t === `.nan` ? NaN : t.indexOf(`:`) >= 0 ? (t.split(`:`).forEach(function(e) { - i.unshift(parseFloat(e, 10)); - }), t = 0, r = 1, i.forEach(function(e) { - t += e * r, r *= 60; - }), n * t) : n * parseFloat(t, 10); - } - var s = /^[-+]?[0-9]+e/; - function c(e, t) { - var r; - if (isNaN(e)) switch (t) { - case `lowercase`: return `.nan`; - case `uppercase`: return `.NAN`; - case `camelcase`: return `.NaN`; - } - else if (e === Infinity) switch (t) { - case `lowercase`: return `.inf`; - case `uppercase`: return `.INF`; - case `camelcase`: return `.Inf`; - } - else if (e === -Infinity) switch (t) { - case `lowercase`: return `-.inf`; - case `uppercase`: return `-.INF`; - case `camelcase`: return `-.Inf`; - } - else if (n.isNegativeZero(e)) return `-0.0`; - return r = e.toString(10), s.test(r) ? r.replace(`e`, `.e`) : r; - } - function l(e) { - return Object.prototype.toString.call(e) === `[object Number]` && (e % 1 != 0 || n.isNegativeZero(e)); - } - t.exports = new r(`tag:yaml.org,2002:float`, { - kind: `scalar`, - resolve: a, - construct: o, - predicate: l, - represent: c, - defaultStyle: `lowercase` - }); -})); -var require_json = __commonJSMin(((e, t) => { - t.exports = new (require_schema())({ - include: [require_failsafe()], - implicit: [ - require_null(), - require_bool(), - require_int(), - require_float() - ] - }); -})); -var require_core = __commonJSMin(((e, t) => { - t.exports = new (require_schema())({ include: [require_json()] }); -})); -var require_timestamp = __commonJSMin(((e, t) => { - var n = require_type(), r = RegExp(`^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$`), i = RegExp(`^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$`); - function a(e) { - return e === null ? !1 : r.exec(e) !== null || i.exec(e) !== null; - } - function o(e) { - var t, n, a, o, s, c, l, u = 0, d = null, f, p, m; - if (t = r.exec(e), t === null && (t = i.exec(e)), t === null) throw Error(`Date resolve error`); - if (n = +t[1], a = t[2] - 1, o = +t[3], !t[4]) return new Date(Date.UTC(n, a, o)); - if (s = +t[4], c = +t[5], l = +t[6], t[7]) { - for (u = t[7].slice(0, 3); u.length < 3;) u += `0`; - u = +u; - } - return t[9] && (f = +t[10], p = +(t[11] || 0), d = (f * 60 + p) * 6e4, t[9] === `-` && (d = -d)), m = new Date(Date.UTC(n, a, o, s, c, l, u)), d && m.setTime(m.getTime() - d), m; - } - function s(e) { - return e.toISOString(); - } - t.exports = new n(`tag:yaml.org,2002:timestamp`, { - kind: `scalar`, - resolve: a, - construct: o, - instanceOf: Date, - represent: s - }); -})); -var require_merge = __commonJSMin(((e, t) => { - var n = require_type(); - function r(e) { - return e === `<<` || e === null; - } - t.exports = new n(`tag:yaml.org,2002:merge`, { - kind: `scalar`, - resolve: r - }); -})); -var require_binary = __commonJSMin(((e, t) => { - var n; - try { - n = __require(`buffer`).Buffer; - } catch {} - var r = require_type(), i = `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= -\r`; - function a(e) { - if (e === null) return !1; - var t, n, r = 0, a = e.length, o = i; - for (n = 0; n < a; n++) if (t = o.indexOf(e.charAt(n)), !(t > 64)) { - if (t < 0) return !1; - r += 6; - } - return r % 8 == 0; - } - function o(e) { - var t, r, a = e.replace(/[\r\n=]/g, ``), o = a.length, s = i, c = 0, l = []; - for (t = 0; t < o; t++) t % 4 == 0 && t && (l.push(c >> 16 & 255), l.push(c >> 8 & 255), l.push(c & 255)), c = c << 6 | s.indexOf(a.charAt(t)); - return r = o % 4 * 6, r === 0 ? (l.push(c >> 16 & 255), l.push(c >> 8 & 255), l.push(c & 255)) : r === 18 ? (l.push(c >> 10 & 255), l.push(c >> 2 & 255)) : r === 12 && l.push(c >> 4 & 255), n ? n.from ? n.from(l) : new n(l) : l; - } - function s(e) { - var t = ``, n = 0, r, a, o = e.length, s = i; - for (r = 0; r < o; r++) r % 3 == 0 && r && (t += s[n >> 18 & 63], t += s[n >> 12 & 63], t += s[n >> 6 & 63], t += s[n & 63]), n = (n << 8) + e[r]; - return a = o % 3, a === 0 ? (t += s[n >> 18 & 63], t += s[n >> 12 & 63], t += s[n >> 6 & 63], t += s[n & 63]) : a === 2 ? (t += s[n >> 10 & 63], t += s[n >> 4 & 63], t += s[n << 2 & 63], t += s[64]) : a === 1 && (t += s[n >> 2 & 63], t += s[n << 4 & 63], t += s[64], t += s[64]), t; - } - function c(e) { - return n && n.isBuffer(e); - } - t.exports = new r(`tag:yaml.org,2002:binary`, { - kind: `scalar`, - resolve: a, - construct: o, - predicate: c, - represent: s - }); -})); -var require_omap = __commonJSMin(((e, t) => { - var n = require_type(), r = Object.prototype.hasOwnProperty, i = Object.prototype.toString; - function a(e) { - if (e === null) return !0; - var t = [], n, a, o, s, c, l = e; - for (n = 0, a = l.length; n < a; n += 1) { - if (o = l[n], c = !1, i.call(o) !== `[object Object]`) return !1; - for (s in o) if (r.call(o, s)) if (!c) c = !0; - else return !1; - if (!c) return !1; - if (t.indexOf(s) === -1) t.push(s); - else return !1; - } - return !0; - } - function o(e) { - return e === null ? [] : e; - } - t.exports = new n(`tag:yaml.org,2002:omap`, { - kind: `sequence`, - resolve: a, - construct: o - }); -})); -var require_pairs = __commonJSMin(((e, t) => { - var n = require_type(), r = Object.prototype.toString; - function i(e) { - if (e === null) return !0; - var t, n, i, a, o, s = e; - for (o = Array(s.length), t = 0, n = s.length; t < n; t += 1) { - if (i = s[t], r.call(i) !== `[object Object]` || (a = Object.keys(i), a.length !== 1)) return !1; - o[t] = [a[0], i[a[0]]]; - } - return !0; - } - function a(e) { - if (e === null) return []; - var t, n, r, i, a, o = e; - for (a = Array(o.length), t = 0, n = o.length; t < n; t += 1) r = o[t], i = Object.keys(r), a[t] = [i[0], r[i[0]]]; - return a; - } - t.exports = new n(`tag:yaml.org,2002:pairs`, { - kind: `sequence`, - resolve: i, - construct: a - }); -})); -var require_set = __commonJSMin(((e, t) => { - var n = require_type(), r = Object.prototype.hasOwnProperty; - function i(e) { - if (e === null) return !0; - var t, n = e; - for (t in n) if (r.call(n, t) && n[t] !== null) return !1; - return !0; - } - function a(e) { - return e === null ? {} : e; - } - t.exports = new n(`tag:yaml.org,2002:set`, { - kind: `mapping`, - resolve: i, - construct: a - }); -})); -var require_default_safe = __commonJSMin(((e, t) => { - t.exports = new (require_schema())({ - include: [require_core()], - implicit: [require_timestamp(), require_merge()], - explicit: [ - require_binary(), - require_omap(), - require_pairs(), - require_set() - ] - }); -})); -var require_undefined = __commonJSMin(((e, t) => { - var n = require_type(); - function r() { - return !0; - } - function i() {} - function a() { - return ``; - } - function o(e) { - return e === void 0; - } - t.exports = new n(`tag:yaml.org,2002:js/undefined`, { - kind: `scalar`, - resolve: r, - construct: i, - predicate: o, - represent: a - }); -})); -var require_regexp = __commonJSMin(((e, t) => { - var n = require_type(); - function r(e) { - if (e === null || e.length === 0) return !1; - var t = e, n = /\/([gim]*)$/.exec(e), r = ``; - return !(t[0] === `/` && (n && (r = n[1]), r.length > 3 || t[t.length - r.length - 1] !== `/`)); - } - function i(e) { - var t = e, n = /\/([gim]*)$/.exec(e), r = ``; - return t[0] === `/` && (n && (r = n[1]), t = t.slice(1, t.length - r.length - 1)), new RegExp(t, r); - } - function a(e) { - var t = `/` + e.source + `/`; - return e.global && (t += `g`), e.multiline && (t += `m`), e.ignoreCase && (t += `i`), t; - } - function o(e) { - return Object.prototype.toString.call(e) === `[object RegExp]`; - } - t.exports = new n(`tag:yaml.org,2002:js/regexp`, { - kind: `scalar`, - resolve: r, - construct: i, - predicate: o, - represent: a - }); -})); -var require_esprima = __commonJSMin(((e, t) => { - (function(n, r) { - typeof e == `object` && typeof t == `object` ? t.exports = r() : typeof define == `function` && define.amd ? define([], r) : typeof e == `object` ? e.esprima = r() : n.esprima = r(); - })(e, function() { - return (function(e) { - var t = {}; - function n(r) { - if (t[r]) return t[r].exports; - var i = t[r] = { - exports: {}, - id: r, - loaded: !1 - }; - return e[r].call(i.exports, i, i.exports, n), i.loaded = !0, i.exports; - } - return n.m = e, n.c = t, n.p = ``, n(0); - })([ - function(e, t, n) { - Object.defineProperty(t, "__esModule", { value: !0 }); - var r = n(1), i = n(3), a = n(8), o = n(15); - function s(e, t, n) { - var o = null, s = function(e, t) { - n && n(e, t), o && o.visit(e, t); - }, c = typeof n == `function` ? s : null, l = !1; - if (t) { - l = typeof t.comment == `boolean` && t.comment; - var u = typeof t.attachComment == `boolean` && t.attachComment; - (l || u) && (o = new r.CommentHandler(), o.attach = u, t.comment = !0, c = s); - } - var d = !1; - t && typeof t.sourceType == `string` && (d = t.sourceType === `module`); - var f = t && typeof t.jsx == `boolean` && t.jsx ? new i.JSXParser(e, t, c) : new a.Parser(e, t, c), p = d ? f.parseModule() : f.parseScript(); - return l && o && (p.comments = o.comments), f.config.tokens && (p.tokens = f.tokens), f.config.tolerant && (p.errors = f.errorHandler.errors), p; - } - t.parse = s; - function c(e, t, n) { - var r = t || {}; - return r.sourceType = `module`, s(e, r, n); - } - t.parseModule = c; - function l(e, t, n) { - var r = t || {}; - return r.sourceType = `script`, s(e, r, n); - } - t.parseScript = l; - function u(e, t, n) { - var r = new o.Tokenizer(e, t), i = []; - try { - for (;;) { - var a = r.getNextToken(); - if (!a) break; - n && (a = n(a)), i.push(a); - } - } catch (e) { - r.errorHandler.tolerate(e); - } - return r.errorHandler.tolerant && (i.errors = r.errors()), i; - } - t.tokenize = u, t.Syntax = n(2).Syntax, t.version = `4.0.1`; - }, - function(e, t, n) { - Object.defineProperty(t, "__esModule", { value: !0 }); - var r = n(2); - t.CommentHandler = function() { - function e() { - this.attach = !1, this.comments = [], this.stack = [], this.leading = [], this.trailing = []; - } - return e.prototype.insertInnerComments = function(e, t) { - if (e.type === r.Syntax.BlockStatement && e.body.length === 0) { - for (var n = [], i = this.leading.length - 1; i >= 0; --i) { - var a = this.leading[i]; - t.end.offset >= a.start && (n.unshift(a.comment), this.leading.splice(i, 1), this.trailing.splice(i, 1)); - } - n.length && (e.innerComments = n); - } - }, e.prototype.findTrailingComments = function(e) { - var t = []; - if (this.trailing.length > 0) { - for (var n = this.trailing.length - 1; n >= 0; --n) { - var r = this.trailing[n]; - r.start >= e.end.offset && t.unshift(r.comment); - } - return this.trailing.length = 0, t; - } - var i = this.stack[this.stack.length - 1]; - if (i && i.node.trailingComments) { - var a = i.node.trailingComments[0]; - a && a.range[0] >= e.end.offset && (t = i.node.trailingComments, delete i.node.trailingComments); - } - return t; - }, e.prototype.findLeadingComments = function(e) { - for (var t = [], n; this.stack.length > 0;) { - var r = this.stack[this.stack.length - 1]; - if (r && r.start >= e.start.offset) n = r.node, this.stack.pop(); - else break; - } - if (n) { - for (var i = (n.leadingComments ? n.leadingComments.length : 0) - 1; i >= 0; --i) { - var a = n.leadingComments[i]; - a.range[1] <= e.start.offset && (t.unshift(a), n.leadingComments.splice(i, 1)); - } - return n.leadingComments && n.leadingComments.length === 0 && delete n.leadingComments, t; - } - for (var i = this.leading.length - 1; i >= 0; --i) { - var r = this.leading[i]; - r.start <= e.start.offset && (t.unshift(r.comment), this.leading.splice(i, 1)); - } - return t; - }, e.prototype.visitNode = function(e, t) { - if (!(e.type === r.Syntax.Program && e.body.length > 0)) { - this.insertInnerComments(e, t); - var n = this.findTrailingComments(t), i = this.findLeadingComments(t); - i.length > 0 && (e.leadingComments = i), n.length > 0 && (e.trailingComments = n), this.stack.push({ - node: e, - start: t.start.offset - }); - } - }, e.prototype.visitComment = function(e, t) { - var n = e.type[0] === `L` ? `Line` : `Block`, r = { - type: n, - value: e.value - }; - if (e.range && (r.range = e.range), e.loc && (r.loc = e.loc), this.comments.push(r), this.attach) { - var i = { - comment: { - type: n, - value: e.value, - range: [t.start.offset, t.end.offset] - }, - start: t.start.offset - }; - e.loc && (i.comment.loc = e.loc), e.type = n, this.leading.push(i), this.trailing.push(i); - } - }, e.prototype.visit = function(e, t) { - e.type === `LineComment` || e.type === `BlockComment` ? this.visitComment(e, t) : this.attach && this.visitNode(e, t); - }, e; - }(); - }, - function(e, t) { - Object.defineProperty(t, "__esModule", { value: !0 }), t.Syntax = { - AssignmentExpression: `AssignmentExpression`, - AssignmentPattern: `AssignmentPattern`, - ArrayExpression: `ArrayExpression`, - ArrayPattern: `ArrayPattern`, - ArrowFunctionExpression: `ArrowFunctionExpression`, - AwaitExpression: `AwaitExpression`, - BlockStatement: `BlockStatement`, - BinaryExpression: `BinaryExpression`, - BreakStatement: `BreakStatement`, - CallExpression: `CallExpression`, - CatchClause: `CatchClause`, - ClassBody: `ClassBody`, - ClassDeclaration: `ClassDeclaration`, - ClassExpression: `ClassExpression`, - ConditionalExpression: `ConditionalExpression`, - ContinueStatement: `ContinueStatement`, - DoWhileStatement: `DoWhileStatement`, - DebuggerStatement: `DebuggerStatement`, - EmptyStatement: `EmptyStatement`, - ExportAllDeclaration: `ExportAllDeclaration`, - ExportDefaultDeclaration: `ExportDefaultDeclaration`, - ExportNamedDeclaration: `ExportNamedDeclaration`, - ExportSpecifier: `ExportSpecifier`, - ExpressionStatement: `ExpressionStatement`, - ForStatement: `ForStatement`, - ForOfStatement: `ForOfStatement`, - ForInStatement: `ForInStatement`, - FunctionDeclaration: `FunctionDeclaration`, - FunctionExpression: `FunctionExpression`, - Identifier: `Identifier`, - IfStatement: `IfStatement`, - ImportDeclaration: `ImportDeclaration`, - ImportDefaultSpecifier: `ImportDefaultSpecifier`, - ImportNamespaceSpecifier: `ImportNamespaceSpecifier`, - ImportSpecifier: `ImportSpecifier`, - Literal: `Literal`, - LabeledStatement: `LabeledStatement`, - LogicalExpression: `LogicalExpression`, - MemberExpression: `MemberExpression`, - MetaProperty: `MetaProperty`, - MethodDefinition: `MethodDefinition`, - NewExpression: `NewExpression`, - ObjectExpression: `ObjectExpression`, - ObjectPattern: `ObjectPattern`, - Program: `Program`, - Property: `Property`, - RestElement: `RestElement`, - ReturnStatement: `ReturnStatement`, - SequenceExpression: `SequenceExpression`, - SpreadElement: `SpreadElement`, - Super: `Super`, - SwitchCase: `SwitchCase`, - SwitchStatement: `SwitchStatement`, - TaggedTemplateExpression: `TaggedTemplateExpression`, - TemplateElement: `TemplateElement`, - TemplateLiteral: `TemplateLiteral`, - ThisExpression: `ThisExpression`, - ThrowStatement: `ThrowStatement`, - TryStatement: `TryStatement`, - UnaryExpression: `UnaryExpression`, - UpdateExpression: `UpdateExpression`, - VariableDeclaration: `VariableDeclaration`, - VariableDeclarator: `VariableDeclarator`, - WhileStatement: `WhileStatement`, - WithStatement: `WithStatement`, - YieldExpression: `YieldExpression` - }; - }, - function(e, t, n) { - var r = this && this.__extends || (function() { - var e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, t) { - e.__proto__ = t; - } || function(e, t) { - for (var n in t) t.hasOwnProperty(n) && (e[n] = t[n]); - }; - return function(t, n) { - e(t, n); - function r() { - this.constructor = t; - } - t.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype, new r()); - }; - })(); - Object.defineProperty(t, "__esModule", { value: !0 }); - var i = n(4), a = n(5), o = n(6), s = n(7), c = n(8), l = n(13), u = n(14); - l.TokenName[100] = `JSXIdentifier`, l.TokenName[101] = `JSXText`; - function d(e) { - var t; - switch (e.type) { - case o.JSXSyntax.JSXIdentifier: - t = e.name; - break; - case o.JSXSyntax.JSXNamespacedName: - var n = e; - t = d(n.namespace) + `:` + d(n.name); - break; - case o.JSXSyntax.JSXMemberExpression: - var r = e; - t = d(r.object) + `.` + d(r.property); - break; - default: break; - } - return t; - } - t.JSXParser = function(e) { - r(t, e); - function t(t, n, r) { - return e.call(this, t, n, r) || this; - } - return t.prototype.parsePrimaryExpression = function() { - return this.match(`<`) ? this.parseJSXRoot() : e.prototype.parsePrimaryExpression.call(this); - }, t.prototype.startJSX = function() { - this.scanner.index = this.startMarker.index, this.scanner.lineNumber = this.startMarker.line, this.scanner.lineStart = this.startMarker.index - this.startMarker.column; - }, t.prototype.finishJSX = function() { - this.nextToken(); - }, t.prototype.reenterJSX = function() { - this.startJSX(), this.expectJSX(`}`), this.config.tokens && this.tokens.pop(); - }, t.prototype.createJSXNode = function() { - return this.collectComments(), { - index: this.scanner.index, - line: this.scanner.lineNumber, - column: this.scanner.index - this.scanner.lineStart - }; - }, t.prototype.createJSXChildNode = function() { - return { - index: this.scanner.index, - line: this.scanner.lineNumber, - column: this.scanner.index - this.scanner.lineStart - }; - }, t.prototype.scanXHTMLEntity = function(e) { - for (var t = `&`, n = !0, r = !1, a = !1, o = !1; !this.scanner.eof() && n && !r;) { - var s = this.scanner.source[this.scanner.index]; - if (s === e) break; - if (r = s === `;`, t += s, ++this.scanner.index, !r) switch (t.length) { - case 2: - a = s === `#`; - break; - case 3: - a && (o = s === `x`, n = o || i.Character.isDecimalDigit(s.charCodeAt(0)), a &&= !o); - break; - default: - n &&= !(a && !i.Character.isDecimalDigit(s.charCodeAt(0))), n &&= !(o && !i.Character.isHexDigit(s.charCodeAt(0))); - break; - } - } - if (n && r && t.length > 2) { - var c = t.substr(1, t.length - 2); - a && c.length > 1 ? t = String.fromCharCode(parseInt(c.substr(1), 10)) : o && c.length > 2 ? t = String.fromCharCode(parseInt(`0` + c.substr(1), 16)) : !a && !o && u.XHTMLEntities[c] && (t = u.XHTMLEntities[c]); - } - return t; - }, t.prototype.lexJSX = function() { - var e = this.scanner.source.charCodeAt(this.scanner.index); - if (e === 60 || e === 62 || e === 47 || e === 58 || e === 61 || e === 123 || e === 125) { - var t = this.scanner.source[this.scanner.index++]; - return { - type: 7, - value: t, - lineNumber: this.scanner.lineNumber, - lineStart: this.scanner.lineStart, - start: this.scanner.index - 1, - end: this.scanner.index - }; - } - if (e === 34 || e === 39) { - for (var n = this.scanner.index, r = this.scanner.source[this.scanner.index++], a = ``; !this.scanner.eof();) { - var o = this.scanner.source[this.scanner.index++]; - if (o === r) break; - o === `&` ? a += this.scanXHTMLEntity(r) : a += o; - } - return { - type: 8, - value: a, - lineNumber: this.scanner.lineNumber, - lineStart: this.scanner.lineStart, - start: n, - end: this.scanner.index - }; - } - if (e === 46) { - var s = this.scanner.source.charCodeAt(this.scanner.index + 1), c = this.scanner.source.charCodeAt(this.scanner.index + 2), t = s === 46 && c === 46 ? `...` : `.`, n = this.scanner.index; - return this.scanner.index += t.length, { - type: 7, - value: t, - lineNumber: this.scanner.lineNumber, - lineStart: this.scanner.lineStart, - start: n, - end: this.scanner.index - }; - } - if (e === 96) return { - type: 10, - value: ``, - lineNumber: this.scanner.lineNumber, - lineStart: this.scanner.lineStart, - start: this.scanner.index, - end: this.scanner.index - }; - if (i.Character.isIdentifierStart(e) && e !== 92) { - var n = this.scanner.index; - for (++this.scanner.index; !this.scanner.eof();) { - var o = this.scanner.source.charCodeAt(this.scanner.index); - if (i.Character.isIdentifierPart(o) && o !== 92) ++this.scanner.index; - else if (o === 45) ++this.scanner.index; - else break; - } - return { - type: 100, - value: this.scanner.source.slice(n, this.scanner.index), - lineNumber: this.scanner.lineNumber, - lineStart: this.scanner.lineStart, - start: n, - end: this.scanner.index - }; - } - return this.scanner.lex(); - }, t.prototype.nextJSXToken = function() { - this.collectComments(), this.startMarker.index = this.scanner.index, this.startMarker.line = this.scanner.lineNumber, this.startMarker.column = this.scanner.index - this.scanner.lineStart; - var e = this.lexJSX(); - return this.lastMarker.index = this.scanner.index, this.lastMarker.line = this.scanner.lineNumber, this.lastMarker.column = this.scanner.index - this.scanner.lineStart, this.config.tokens && this.tokens.push(this.convertToken(e)), e; - }, t.prototype.nextJSXText = function() { - this.startMarker.index = this.scanner.index, this.startMarker.line = this.scanner.lineNumber, this.startMarker.column = this.scanner.index - this.scanner.lineStart; - for (var e = this.scanner.index, t = ``; !this.scanner.eof();) { - var n = this.scanner.source[this.scanner.index]; - if (n === `{` || n === `<`) break; - ++this.scanner.index, t += n, i.Character.isLineTerminator(n.charCodeAt(0)) && (++this.scanner.lineNumber, n === `\r` && this.scanner.source[this.scanner.index] === ` -` && ++this.scanner.index, this.scanner.lineStart = this.scanner.index); - } - this.lastMarker.index = this.scanner.index, this.lastMarker.line = this.scanner.lineNumber, this.lastMarker.column = this.scanner.index - this.scanner.lineStart; - var r = { - type: 101, - value: t, - lineNumber: this.scanner.lineNumber, - lineStart: this.scanner.lineStart, - start: e, - end: this.scanner.index - }; - return t.length > 0 && this.config.tokens && this.tokens.push(this.convertToken(r)), r; - }, t.prototype.peekJSXToken = function() { - var e = this.scanner.saveState(); - this.scanner.scanComments(); - var t = this.lexJSX(); - return this.scanner.restoreState(e), t; - }, t.prototype.expectJSX = function(e) { - var t = this.nextJSXToken(); - (t.type !== 7 || t.value !== e) && this.throwUnexpectedToken(t); - }, t.prototype.matchJSX = function(e) { - var t = this.peekJSXToken(); - return t.type === 7 && t.value === e; - }, t.prototype.parseJSXIdentifier = function() { - var e = this.createJSXNode(), t = this.nextJSXToken(); - return t.type !== 100 && this.throwUnexpectedToken(t), this.finalize(e, new a.JSXIdentifier(t.value)); - }, t.prototype.parseJSXElementName = function() { - var e = this.createJSXNode(), t = this.parseJSXIdentifier(); - if (this.matchJSX(`:`)) { - var n = t; - this.expectJSX(`:`); - var r = this.parseJSXIdentifier(); - t = this.finalize(e, new a.JSXNamespacedName(n, r)); - } else if (this.matchJSX(`.`)) for (; this.matchJSX(`.`);) { - var i = t; - this.expectJSX(`.`); - var o = this.parseJSXIdentifier(); - t = this.finalize(e, new a.JSXMemberExpression(i, o)); - } - return t; - }, t.prototype.parseJSXAttributeName = function() { - var e = this.createJSXNode(), t, n = this.parseJSXIdentifier(); - if (this.matchJSX(`:`)) { - var r = n; - this.expectJSX(`:`); - var i = this.parseJSXIdentifier(); - t = this.finalize(e, new a.JSXNamespacedName(r, i)); - } else t = n; - return t; - }, t.prototype.parseJSXStringLiteralAttribute = function() { - var e = this.createJSXNode(), t = this.nextJSXToken(); - t.type !== 8 && this.throwUnexpectedToken(t); - var n = this.getTokenRaw(t); - return this.finalize(e, new s.Literal(t.value, n)); - }, t.prototype.parseJSXExpressionAttribute = function() { - var e = this.createJSXNode(); - this.expectJSX(`{`), this.finishJSX(), this.match(`}`) && this.tolerateError(`JSX attributes must only be assigned a non-empty expression`); - var t = this.parseAssignmentExpression(); - return this.reenterJSX(), this.finalize(e, new a.JSXExpressionContainer(t)); - }, t.prototype.parseJSXAttributeValue = function() { - return this.matchJSX(`{`) ? this.parseJSXExpressionAttribute() : this.matchJSX(`<`) ? this.parseJSXElement() : this.parseJSXStringLiteralAttribute(); - }, t.prototype.parseJSXNameValueAttribute = function() { - var e = this.createJSXNode(), t = this.parseJSXAttributeName(), n = null; - return this.matchJSX(`=`) && (this.expectJSX(`=`), n = this.parseJSXAttributeValue()), this.finalize(e, new a.JSXAttribute(t, n)); - }, t.prototype.parseJSXSpreadAttribute = function() { - var e = this.createJSXNode(); - this.expectJSX(`{`), this.expectJSX(`...`), this.finishJSX(); - var t = this.parseAssignmentExpression(); - return this.reenterJSX(), this.finalize(e, new a.JSXSpreadAttribute(t)); - }, t.prototype.parseJSXAttributes = function() { - for (var e = []; !this.matchJSX(`/`) && !this.matchJSX(`>`);) { - var t = this.matchJSX(`{`) ? this.parseJSXSpreadAttribute() : this.parseJSXNameValueAttribute(); - e.push(t); - } - return e; - }, t.prototype.parseJSXOpeningElement = function() { - var e = this.createJSXNode(); - this.expectJSX(`<`); - var t = this.parseJSXElementName(), n = this.parseJSXAttributes(), r = this.matchJSX(`/`); - return r && this.expectJSX(`/`), this.expectJSX(`>`), this.finalize(e, new a.JSXOpeningElement(t, r, n)); - }, t.prototype.parseJSXBoundaryElement = function() { - var e = this.createJSXNode(); - if (this.expectJSX(`<`), this.matchJSX(`/`)) { - this.expectJSX(`/`); - var t = this.parseJSXElementName(); - return this.expectJSX(`>`), this.finalize(e, new a.JSXClosingElement(t)); - } - var n = this.parseJSXElementName(), r = this.parseJSXAttributes(), i = this.matchJSX(`/`); - return i && this.expectJSX(`/`), this.expectJSX(`>`), this.finalize(e, new a.JSXOpeningElement(n, i, r)); - }, t.prototype.parseJSXEmptyExpression = function() { - var e = this.createJSXChildNode(); - return this.collectComments(), this.lastMarker.index = this.scanner.index, this.lastMarker.line = this.scanner.lineNumber, this.lastMarker.column = this.scanner.index - this.scanner.lineStart, this.finalize(e, new a.JSXEmptyExpression()); - }, t.prototype.parseJSXExpressionContainer = function() { - var e = this.createJSXNode(); - this.expectJSX(`{`); - var t; - return this.matchJSX(`}`) ? (t = this.parseJSXEmptyExpression(), this.expectJSX(`}`)) : (this.finishJSX(), t = this.parseAssignmentExpression(), this.reenterJSX()), this.finalize(e, new a.JSXExpressionContainer(t)); - }, t.prototype.parseJSXChildren = function() { - for (var e = []; !this.scanner.eof();) { - var t = this.createJSXChildNode(), n = this.nextJSXText(); - if (n.start < n.end) { - var r = this.getTokenRaw(n), i = this.finalize(t, new a.JSXText(n.value, r)); - e.push(i); - } - if (this.scanner.source[this.scanner.index] === `{`) { - var o = this.parseJSXExpressionContainer(); - e.push(o); - } else break; - } - return e; - }, t.prototype.parseComplexJSXElement = function(e) { - for (var t = []; !this.scanner.eof();) { - e.children = e.children.concat(this.parseJSXChildren()); - var n = this.createJSXChildNode(), r = this.parseJSXBoundaryElement(); - if (r.type === o.JSXSyntax.JSXOpeningElement) { - var i = r; - if (i.selfClosing) { - var s = this.finalize(n, new a.JSXElement(i, [], null)); - e.children.push(s); - } else t.push(e), e = { - node: n, - opening: i, - closing: null, - children: [] - }; - } - if (r.type === o.JSXSyntax.JSXClosingElement) { - e.closing = r; - var c = d(e.opening.name); - if (c !== d(e.closing.name) && this.tolerateError(`Expected corresponding JSX closing tag for %0`, c), t.length > 0) { - var s = this.finalize(e.node, new a.JSXElement(e.opening, e.children, e.closing)); - e = t[t.length - 1], e.children.push(s), t.pop(); - } else break; - } - } - return e; - }, t.prototype.parseJSXElement = function() { - var e = this.createJSXNode(), t = this.parseJSXOpeningElement(), n = [], r = null; - if (!t.selfClosing) { - var i = this.parseComplexJSXElement({ - node: e, - opening: t, - closing: r, - children: n - }); - n = i.children, r = i.closing; - } - return this.finalize(e, new a.JSXElement(t, n, r)); - }, t.prototype.parseJSXRoot = function() { - this.config.tokens && this.tokens.pop(), this.startJSX(); - var e = this.parseJSXElement(); - return this.finishJSX(), e; - }, t.prototype.isStartOfExpression = function() { - return e.prototype.isStartOfExpression.call(this) || this.match(`<`); - }, t; - }(c.Parser); - }, - function(e, t) { - Object.defineProperty(t, "__esModule", { value: !0 }); - var n = { - NonAsciiIdentifierStart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/, - NonAsciiIdentifierPart: /[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/ - }; - t.Character = { - fromCodePoint: function(e) { - return e < 65536 ? String.fromCharCode(e) : String.fromCharCode(55296 + (e - 65536 >> 10)) + String.fromCharCode(56320 + (e - 65536 & 1023)); - }, - isWhiteSpace: function(e) { - return e === 32 || e === 9 || e === 11 || e === 12 || e === 160 || e >= 5760 && [ - 5760, - 8192, - 8193, - 8194, - 8195, - 8196, - 8197, - 8198, - 8199, - 8200, - 8201, - 8202, - 8239, - 8287, - 12288, - 65279 - ].indexOf(e) >= 0; - }, - isLineTerminator: function(e) { - return e === 10 || e === 13 || e === 8232 || e === 8233; - }, - isIdentifierStart: function(e) { - return e === 36 || e === 95 || e >= 65 && e <= 90 || e >= 97 && e <= 122 || e === 92 || e >= 128 && n.NonAsciiIdentifierStart.test(t.Character.fromCodePoint(e)); - }, - isIdentifierPart: function(e) { - return e === 36 || e === 95 || e >= 65 && e <= 90 || e >= 97 && e <= 122 || e >= 48 && e <= 57 || e === 92 || e >= 128 && n.NonAsciiIdentifierPart.test(t.Character.fromCodePoint(e)); - }, - isDecimalDigit: function(e) { - return e >= 48 && e <= 57; - }, - isHexDigit: function(e) { - return e >= 48 && e <= 57 || e >= 65 && e <= 70 || e >= 97 && e <= 102; - }, - isOctalDigit: function(e) { - return e >= 48 && e <= 55; - } - }; - }, - function(e, t, n) { - Object.defineProperty(t, "__esModule", { value: !0 }); - var r = n(6); - t.JSXClosingElement = function() { - function e(e) { - this.type = r.JSXSyntax.JSXClosingElement, this.name = e; - } - return e; - }(), t.JSXElement = function() { - function e(e, t, n) { - this.type = r.JSXSyntax.JSXElement, this.openingElement = e, this.children = t, this.closingElement = n; - } - return e; - }(), t.JSXEmptyExpression = function() { - function e() { - this.type = r.JSXSyntax.JSXEmptyExpression; - } - return e; - }(), t.JSXExpressionContainer = function() { - function e(e) { - this.type = r.JSXSyntax.JSXExpressionContainer, this.expression = e; - } - return e; - }(), t.JSXIdentifier = function() { - function e(e) { - this.type = r.JSXSyntax.JSXIdentifier, this.name = e; - } - return e; - }(), t.JSXMemberExpression = function() { - function e(e, t) { - this.type = r.JSXSyntax.JSXMemberExpression, this.object = e, this.property = t; - } - return e; - }(), t.JSXAttribute = function() { - function e(e, t) { - this.type = r.JSXSyntax.JSXAttribute, this.name = e, this.value = t; - } - return e; - }(), t.JSXNamespacedName = function() { - function e(e, t) { - this.type = r.JSXSyntax.JSXNamespacedName, this.namespace = e, this.name = t; - } - return e; - }(), t.JSXOpeningElement = function() { - function e(e, t, n) { - this.type = r.JSXSyntax.JSXOpeningElement, this.name = e, this.selfClosing = t, this.attributes = n; - } - return e; - }(), t.JSXSpreadAttribute = function() { - function e(e) { - this.type = r.JSXSyntax.JSXSpreadAttribute, this.argument = e; - } - return e; - }(), t.JSXText = function() { - function e(e, t) { - this.type = r.JSXSyntax.JSXText, this.value = e, this.raw = t; - } - return e; - }(); - }, - function(e, t) { - Object.defineProperty(t, "__esModule", { value: !0 }), t.JSXSyntax = { - JSXAttribute: `JSXAttribute`, - JSXClosingElement: `JSXClosingElement`, - JSXElement: `JSXElement`, - JSXEmptyExpression: `JSXEmptyExpression`, - JSXExpressionContainer: `JSXExpressionContainer`, - JSXIdentifier: `JSXIdentifier`, - JSXMemberExpression: `JSXMemberExpression`, - JSXNamespacedName: `JSXNamespacedName`, - JSXOpeningElement: `JSXOpeningElement`, - JSXSpreadAttribute: `JSXSpreadAttribute`, - JSXText: `JSXText` - }; - }, - function(e, t, n) { - Object.defineProperty(t, "__esModule", { value: !0 }); - var r = n(2); - t.ArrayExpression = function() { - function e(e) { - this.type = r.Syntax.ArrayExpression, this.elements = e; - } - return e; - }(), t.ArrayPattern = function() { - function e(e) { - this.type = r.Syntax.ArrayPattern, this.elements = e; - } - return e; - }(), t.ArrowFunctionExpression = function() { - function e(e, t, n) { - this.type = r.Syntax.ArrowFunctionExpression, this.id = null, this.params = e, this.body = t, this.generator = !1, this.expression = n, this.async = !1; - } - return e; - }(), t.AssignmentExpression = function() { - function e(e, t, n) { - this.type = r.Syntax.AssignmentExpression, this.operator = e, this.left = t, this.right = n; - } - return e; - }(), t.AssignmentPattern = function() { - function e(e, t) { - this.type = r.Syntax.AssignmentPattern, this.left = e, this.right = t; - } - return e; - }(), t.AsyncArrowFunctionExpression = function() { - function e(e, t, n) { - this.type = r.Syntax.ArrowFunctionExpression, this.id = null, this.params = e, this.body = t, this.generator = !1, this.expression = n, this.async = !0; - } - return e; - }(), t.AsyncFunctionDeclaration = function() { - function e(e, t, n) { - this.type = r.Syntax.FunctionDeclaration, this.id = e, this.params = t, this.body = n, this.generator = !1, this.expression = !1, this.async = !0; - } - return e; - }(), t.AsyncFunctionExpression = function() { - function e(e, t, n) { - this.type = r.Syntax.FunctionExpression, this.id = e, this.params = t, this.body = n, this.generator = !1, this.expression = !1, this.async = !0; - } - return e; - }(), t.AwaitExpression = function() { - function e(e) { - this.type = r.Syntax.AwaitExpression, this.argument = e; - } - return e; - }(), t.BinaryExpression = function() { - function e(e, t, n) { - var i = e === `||` || e === `&&`; - this.type = i ? r.Syntax.LogicalExpression : r.Syntax.BinaryExpression, this.operator = e, this.left = t, this.right = n; - } - return e; - }(), t.BlockStatement = function() { - function e(e) { - this.type = r.Syntax.BlockStatement, this.body = e; - } - return e; - }(), t.BreakStatement = function() { - function e(e) { - this.type = r.Syntax.BreakStatement, this.label = e; - } - return e; - }(), t.CallExpression = function() { - function e(e, t) { - this.type = r.Syntax.CallExpression, this.callee = e, this.arguments = t; - } - return e; - }(), t.CatchClause = function() { - function e(e, t) { - this.type = r.Syntax.CatchClause, this.param = e, this.body = t; - } - return e; - }(), t.ClassBody = function() { - function e(e) { - this.type = r.Syntax.ClassBody, this.body = e; - } - return e; - }(), t.ClassDeclaration = function() { - function e(e, t, n) { - this.type = r.Syntax.ClassDeclaration, this.id = e, this.superClass = t, this.body = n; - } - return e; - }(), t.ClassExpression = function() { - function e(e, t, n) { - this.type = r.Syntax.ClassExpression, this.id = e, this.superClass = t, this.body = n; - } - return e; - }(), t.ComputedMemberExpression = function() { - function e(e, t) { - this.type = r.Syntax.MemberExpression, this.computed = !0, this.object = e, this.property = t; - } - return e; - }(), t.ConditionalExpression = function() { - function e(e, t, n) { - this.type = r.Syntax.ConditionalExpression, this.test = e, this.consequent = t, this.alternate = n; - } - return e; - }(), t.ContinueStatement = function() { - function e(e) { - this.type = r.Syntax.ContinueStatement, this.label = e; - } - return e; - }(), t.DebuggerStatement = function() { - function e() { - this.type = r.Syntax.DebuggerStatement; - } - return e; - }(), t.Directive = function() { - function e(e, t) { - this.type = r.Syntax.ExpressionStatement, this.expression = e, this.directive = t; - } - return e; - }(), t.DoWhileStatement = function() { - function e(e, t) { - this.type = r.Syntax.DoWhileStatement, this.body = e, this.test = t; - } - return e; - }(), t.EmptyStatement = function() { - function e() { - this.type = r.Syntax.EmptyStatement; - } - return e; - }(), t.ExportAllDeclaration = function() { - function e(e) { - this.type = r.Syntax.ExportAllDeclaration, this.source = e; - } - return e; - }(), t.ExportDefaultDeclaration = function() { - function e(e) { - this.type = r.Syntax.ExportDefaultDeclaration, this.declaration = e; - } - return e; - }(), t.ExportNamedDeclaration = function() { - function e(e, t, n) { - this.type = r.Syntax.ExportNamedDeclaration, this.declaration = e, this.specifiers = t, this.source = n; - } - return e; - }(), t.ExportSpecifier = function() { - function e(e, t) { - this.type = r.Syntax.ExportSpecifier, this.exported = t, this.local = e; - } - return e; - }(), t.ExpressionStatement = function() { - function e(e) { - this.type = r.Syntax.ExpressionStatement, this.expression = e; - } - return e; - }(), t.ForInStatement = function() { - function e(e, t, n) { - this.type = r.Syntax.ForInStatement, this.left = e, this.right = t, this.body = n, this.each = !1; - } - return e; - }(), t.ForOfStatement = function() { - function e(e, t, n) { - this.type = r.Syntax.ForOfStatement, this.left = e, this.right = t, this.body = n; - } - return e; - }(), t.ForStatement = function() { - function e(e, t, n, i) { - this.type = r.Syntax.ForStatement, this.init = e, this.test = t, this.update = n, this.body = i; - } - return e; - }(), t.FunctionDeclaration = function() { - function e(e, t, n, i) { - this.type = r.Syntax.FunctionDeclaration, this.id = e, this.params = t, this.body = n, this.generator = i, this.expression = !1, this.async = !1; - } - return e; - }(), t.FunctionExpression = function() { - function e(e, t, n, i) { - this.type = r.Syntax.FunctionExpression, this.id = e, this.params = t, this.body = n, this.generator = i, this.expression = !1, this.async = !1; - } - return e; - }(), t.Identifier = function() { - function e(e) { - this.type = r.Syntax.Identifier, this.name = e; - } - return e; - }(), t.IfStatement = function() { - function e(e, t, n) { - this.type = r.Syntax.IfStatement, this.test = e, this.consequent = t, this.alternate = n; - } - return e; - }(), t.ImportDeclaration = function() { - function e(e, t) { - this.type = r.Syntax.ImportDeclaration, this.specifiers = e, this.source = t; - } - return e; - }(), t.ImportDefaultSpecifier = function() { - function e(e) { - this.type = r.Syntax.ImportDefaultSpecifier, this.local = e; - } - return e; - }(), t.ImportNamespaceSpecifier = function() { - function e(e) { - this.type = r.Syntax.ImportNamespaceSpecifier, this.local = e; - } - return e; - }(), t.ImportSpecifier = function() { - function e(e, t) { - this.type = r.Syntax.ImportSpecifier, this.local = e, this.imported = t; - } - return e; - }(), t.LabeledStatement = function() { - function e(e, t) { - this.type = r.Syntax.LabeledStatement, this.label = e, this.body = t; - } - return e; - }(), t.Literal = function() { - function e(e, t) { - this.type = r.Syntax.Literal, this.value = e, this.raw = t; - } - return e; - }(), t.MetaProperty = function() { - function e(e, t) { - this.type = r.Syntax.MetaProperty, this.meta = e, this.property = t; - } - return e; - }(), t.MethodDefinition = function() { - function e(e, t, n, i, a) { - this.type = r.Syntax.MethodDefinition, this.key = e, this.computed = t, this.value = n, this.kind = i, this.static = a; - } - return e; - }(), t.Module = function() { - function e(e) { - this.type = r.Syntax.Program, this.body = e, this.sourceType = `module`; - } - return e; - }(), t.NewExpression = function() { - function e(e, t) { - this.type = r.Syntax.NewExpression, this.callee = e, this.arguments = t; - } - return e; - }(), t.ObjectExpression = function() { - function e(e) { - this.type = r.Syntax.ObjectExpression, this.properties = e; - } - return e; - }(), t.ObjectPattern = function() { - function e(e) { - this.type = r.Syntax.ObjectPattern, this.properties = e; - } - return e; - }(), t.Property = function() { - function e(e, t, n, i, a, o) { - this.type = r.Syntax.Property, this.key = t, this.computed = n, this.value = i, this.kind = e, this.method = a, this.shorthand = o; - } - return e; - }(), t.RegexLiteral = function() { - function e(e, t, n, i) { - this.type = r.Syntax.Literal, this.value = e, this.raw = t, this.regex = { - pattern: n, - flags: i - }; - } - return e; - }(), t.RestElement = function() { - function e(e) { - this.type = r.Syntax.RestElement, this.argument = e; - } - return e; - }(), t.ReturnStatement = function() { - function e(e) { - this.type = r.Syntax.ReturnStatement, this.argument = e; - } - return e; - }(), t.Script = function() { - function e(e) { - this.type = r.Syntax.Program, this.body = e, this.sourceType = `script`; - } - return e; - }(), t.SequenceExpression = function() { - function e(e) { - this.type = r.Syntax.SequenceExpression, this.expressions = e; - } - return e; - }(), t.SpreadElement = function() { - function e(e) { - this.type = r.Syntax.SpreadElement, this.argument = e; - } - return e; - }(), t.StaticMemberExpression = function() { - function e(e, t) { - this.type = r.Syntax.MemberExpression, this.computed = !1, this.object = e, this.property = t; - } - return e; - }(), t.Super = function() { - function e() { - this.type = r.Syntax.Super; - } - return e; - }(), t.SwitchCase = function() { - function e(e, t) { - this.type = r.Syntax.SwitchCase, this.test = e, this.consequent = t; - } - return e; - }(), t.SwitchStatement = function() { - function e(e, t) { - this.type = r.Syntax.SwitchStatement, this.discriminant = e, this.cases = t; - } - return e; - }(), t.TaggedTemplateExpression = function() { - function e(e, t) { - this.type = r.Syntax.TaggedTemplateExpression, this.tag = e, this.quasi = t; - } - return e; - }(), t.TemplateElement = function() { - function e(e, t) { - this.type = r.Syntax.TemplateElement, this.value = e, this.tail = t; - } - return e; - }(), t.TemplateLiteral = function() { - function e(e, t) { - this.type = r.Syntax.TemplateLiteral, this.quasis = e, this.expressions = t; - } - return e; - }(), t.ThisExpression = function() { - function e() { - this.type = r.Syntax.ThisExpression; - } - return e; - }(), t.ThrowStatement = function() { - function e(e) { - this.type = r.Syntax.ThrowStatement, this.argument = e; - } - return e; - }(), t.TryStatement = function() { - function e(e, t, n) { - this.type = r.Syntax.TryStatement, this.block = e, this.handler = t, this.finalizer = n; - } - return e; - }(), t.UnaryExpression = function() { - function e(e, t) { - this.type = r.Syntax.UnaryExpression, this.operator = e, this.argument = t, this.prefix = !0; - } - return e; - }(), t.UpdateExpression = function() { - function e(e, t, n) { - this.type = r.Syntax.UpdateExpression, this.operator = e, this.argument = t, this.prefix = n; - } - return e; - }(), t.VariableDeclaration = function() { - function e(e, t) { - this.type = r.Syntax.VariableDeclaration, this.declarations = e, this.kind = t; - } - return e; - }(), t.VariableDeclarator = function() { - function e(e, t) { - this.type = r.Syntax.VariableDeclarator, this.id = e, this.init = t; - } - return e; - }(), t.WhileStatement = function() { - function e(e, t) { - this.type = r.Syntax.WhileStatement, this.test = e, this.body = t; - } - return e; - }(), t.WithStatement = function() { - function e(e, t) { - this.type = r.Syntax.WithStatement, this.object = e, this.body = t; - } - return e; - }(), t.YieldExpression = function() { - function e(e, t) { - this.type = r.Syntax.YieldExpression, this.argument = e, this.delegate = t; - } - return e; - }(); - }, - function(e, t, n) { - Object.defineProperty(t, "__esModule", { value: !0 }); - var r = n(9), i = n(10), a = n(11), o = n(7), s = n(12), c = n(2), l = n(13), u = `ArrowParameterPlaceHolder`; - t.Parser = function() { - function e(e, t, n) { - t === void 0 && (t = {}), this.config = { - range: typeof t.range == `boolean` && t.range, - loc: typeof t.loc == `boolean` && t.loc, - source: null, - tokens: typeof t.tokens == `boolean` && t.tokens, - comment: typeof t.comment == `boolean` && t.comment, - tolerant: typeof t.tolerant == `boolean` && t.tolerant - }, this.config.loc && t.source && t.source !== null && (this.config.source = String(t.source)), this.delegate = n, this.errorHandler = new i.ErrorHandler(), this.errorHandler.tolerant = this.config.tolerant, this.scanner = new s.Scanner(e, this.errorHandler), this.scanner.trackComment = this.config.comment, this.operatorPrecedence = { - ")": 0, - ";": 0, - ",": 0, - "=": 0, - "]": 0, - "||": 1, - "&&": 2, - "|": 3, - "^": 4, - "&": 5, - "==": 6, - "!=": 6, - "===": 6, - "!==": 6, - "<": 7, - ">": 7, - "<=": 7, - ">=": 7, - "<<": 8, - ">>": 8, - ">>>": 8, - "+": 9, - "-": 9, - "*": 11, - "/": 11, - "%": 11 - }, this.lookahead = { - type: 2, - value: ``, - lineNumber: this.scanner.lineNumber, - lineStart: 0, - start: 0, - end: 0 - }, this.hasLineTerminator = !1, this.context = { - isModule: !1, - await: !1, - allowIn: !0, - allowStrictDirective: !0, - allowYield: !0, - firstCoverInitializedNameError: null, - isAssignmentTarget: !1, - isBindingElement: !1, - inFunctionBody: !1, - inIteration: !1, - inSwitch: !1, - labelSet: {}, - strict: !1 - }, this.tokens = [], this.startMarker = { - index: 0, - line: this.scanner.lineNumber, - column: 0 - }, this.lastMarker = { - index: 0, - line: this.scanner.lineNumber, - column: 0 - }, this.nextToken(), this.lastMarker = { - index: this.scanner.index, - line: this.scanner.lineNumber, - column: this.scanner.index - this.scanner.lineStart - }; - } - return e.prototype.throwError = function(e) { - var t = Array.prototype.slice.call(arguments, 1), n = e.replace(/%(\d)/g, function(e, n) { - return r.assert(n < t.length, `Message reference must be in range`), t[n]; - }), i = this.lastMarker.index, a = this.lastMarker.line, o = this.lastMarker.column + 1; - throw this.errorHandler.createError(i, a, o, n); - }, e.prototype.tolerateError = function(e) { - var t = Array.prototype.slice.call(arguments, 1), n = e.replace(/%(\d)/g, function(e, n) { - return r.assert(n < t.length, `Message reference must be in range`), t[n]; - }), i = this.lastMarker.index, a = this.scanner.lineNumber, o = this.lastMarker.column + 1; - this.errorHandler.tolerateError(i, a, o, n); - }, e.prototype.unexpectedTokenError = function(e, t) { - var n = t || a.Messages.UnexpectedToken, r; - if (e ? (t || (n = e.type === 2 ? a.Messages.UnexpectedEOS : e.type === 3 ? a.Messages.UnexpectedIdentifier : e.type === 6 ? a.Messages.UnexpectedNumber : e.type === 8 ? a.Messages.UnexpectedString : e.type === 10 ? a.Messages.UnexpectedTemplate : a.Messages.UnexpectedToken, e.type === 4 && (this.scanner.isFutureReservedWord(e.value) ? n = a.Messages.UnexpectedReserved : this.context.strict && this.scanner.isStrictModeReservedWord(e.value) && (n = a.Messages.StrictReservedWord))), r = e.value) : r = `ILLEGAL`, n = n.replace(`%0`, r), e && typeof e.lineNumber == `number`) { - var i = e.start, o = e.lineNumber, s = this.lastMarker.index - this.lastMarker.column, c = e.start - s + 1; - return this.errorHandler.createError(i, o, c, n); - } else { - var i = this.lastMarker.index, o = this.lastMarker.line, c = this.lastMarker.column + 1; - return this.errorHandler.createError(i, o, c, n); - } - }, e.prototype.throwUnexpectedToken = function(e, t) { - throw this.unexpectedTokenError(e, t); - }, e.prototype.tolerateUnexpectedToken = function(e, t) { - this.errorHandler.tolerate(this.unexpectedTokenError(e, t)); - }, e.prototype.collectComments = function() { - if (!this.config.comment) this.scanner.scanComments(); - else { - var e = this.scanner.scanComments(); - if (e.length > 0 && this.delegate) for (var t = 0; t < e.length; ++t) { - var n = e[t], r = void 0; - r = { - type: n.multiLine ? `BlockComment` : `LineComment`, - value: this.scanner.source.slice(n.slice[0], n.slice[1]) - }, this.config.range && (r.range = n.range), this.config.loc && (r.loc = n.loc); - var i = { - start: { - line: n.loc.start.line, - column: n.loc.start.column, - offset: n.range[0] - }, - end: { - line: n.loc.end.line, - column: n.loc.end.column, - offset: n.range[1] - } - }; - this.delegate(r, i); - } - } - }, e.prototype.getTokenRaw = function(e) { - return this.scanner.source.slice(e.start, e.end); - }, e.prototype.convertToken = function(e) { - var t = { - type: l.TokenName[e.type], - value: this.getTokenRaw(e) - }; - return this.config.range && (t.range = [e.start, e.end]), this.config.loc && (t.loc = { - start: { - line: this.startMarker.line, - column: this.startMarker.column - }, - end: { - line: this.scanner.lineNumber, - column: this.scanner.index - this.scanner.lineStart - } - }), e.type === 9 && (t.regex = { - pattern: e.pattern, - flags: e.flags - }), t; - }, e.prototype.nextToken = function() { - var e = this.lookahead; - this.lastMarker.index = this.scanner.index, this.lastMarker.line = this.scanner.lineNumber, this.lastMarker.column = this.scanner.index - this.scanner.lineStart, this.collectComments(), this.scanner.index !== this.startMarker.index && (this.startMarker.index = this.scanner.index, this.startMarker.line = this.scanner.lineNumber, this.startMarker.column = this.scanner.index - this.scanner.lineStart); - var t = this.scanner.lex(); - return this.hasLineTerminator = e.lineNumber !== t.lineNumber, t && this.context.strict && t.type === 3 && this.scanner.isStrictModeReservedWord(t.value) && (t.type = 4), this.lookahead = t, this.config.tokens && t.type !== 2 && this.tokens.push(this.convertToken(t)), e; - }, e.prototype.nextRegexToken = function() { - this.collectComments(); - var e = this.scanner.scanRegExp(); - return this.config.tokens && (this.tokens.pop(), this.tokens.push(this.convertToken(e))), this.lookahead = e, this.nextToken(), e; - }, e.prototype.createNode = function() { - return { - index: this.startMarker.index, - line: this.startMarker.line, - column: this.startMarker.column - }; - }, e.prototype.startNode = function(e, t) { - t === void 0 && (t = 0); - var n = e.start - e.lineStart, r = e.lineNumber; - return n < 0 && (n += t, r--), { - index: e.start, - line: r, - column: n - }; - }, e.prototype.finalize = function(e, t) { - if (this.config.range && (t.range = [e.index, this.lastMarker.index]), this.config.loc && (t.loc = { - start: { - line: e.line, - column: e.column - }, - end: { - line: this.lastMarker.line, - column: this.lastMarker.column - } - }, this.config.source && (t.loc.source = this.config.source)), this.delegate) { - var n = { - start: { - line: e.line, - column: e.column, - offset: e.index - }, - end: { - line: this.lastMarker.line, - column: this.lastMarker.column, - offset: this.lastMarker.index - } - }; - this.delegate(t, n); - } - return t; - }, e.prototype.expect = function(e) { - var t = this.nextToken(); - (t.type !== 7 || t.value !== e) && this.throwUnexpectedToken(t); - }, e.prototype.expectCommaSeparator = function() { - if (this.config.tolerant) { - var e = this.lookahead; - e.type === 7 && e.value === `,` ? this.nextToken() : e.type === 7 && e.value === `;` ? (this.nextToken(), this.tolerateUnexpectedToken(e)) : this.tolerateUnexpectedToken(e, a.Messages.UnexpectedToken); - } else this.expect(`,`); - }, e.prototype.expectKeyword = function(e) { - var t = this.nextToken(); - (t.type !== 4 || t.value !== e) && this.throwUnexpectedToken(t); - }, e.prototype.match = function(e) { - return this.lookahead.type === 7 && this.lookahead.value === e; - }, e.prototype.matchKeyword = function(e) { - return this.lookahead.type === 4 && this.lookahead.value === e; - }, e.prototype.matchContextualKeyword = function(e) { - return this.lookahead.type === 3 && this.lookahead.value === e; - }, e.prototype.matchAssign = function() { - if (this.lookahead.type !== 7) return !1; - var e = this.lookahead.value; - return e === `=` || e === `*=` || e === `**=` || e === `/=` || e === `%=` || e === `+=` || e === `-=` || e === `<<=` || e === `>>=` || e === `>>>=` || e === `&=` || e === `^=` || e === `|=`; - }, e.prototype.isolateCoverGrammar = function(e) { - var t = this.context.isBindingElement, n = this.context.isAssignmentTarget, r = this.context.firstCoverInitializedNameError; - this.context.isBindingElement = !0, this.context.isAssignmentTarget = !0, this.context.firstCoverInitializedNameError = null; - var i = e.call(this); - return this.context.firstCoverInitializedNameError !== null && this.throwUnexpectedToken(this.context.firstCoverInitializedNameError), this.context.isBindingElement = t, this.context.isAssignmentTarget = n, this.context.firstCoverInitializedNameError = r, i; - }, e.prototype.inheritCoverGrammar = function(e) { - var t = this.context.isBindingElement, n = this.context.isAssignmentTarget, r = this.context.firstCoverInitializedNameError; - this.context.isBindingElement = !0, this.context.isAssignmentTarget = !0, this.context.firstCoverInitializedNameError = null; - var i = e.call(this); - return this.context.isBindingElement = this.context.isBindingElement && t, this.context.isAssignmentTarget = this.context.isAssignmentTarget && n, this.context.firstCoverInitializedNameError = r || this.context.firstCoverInitializedNameError, i; - }, e.prototype.consumeSemicolon = function() { - this.match(`;`) ? this.nextToken() : this.hasLineTerminator || (this.lookahead.type !== 2 && !this.match(`}`) && this.throwUnexpectedToken(this.lookahead), this.lastMarker.index = this.startMarker.index, this.lastMarker.line = this.startMarker.line, this.lastMarker.column = this.startMarker.column); - }, e.prototype.parsePrimaryExpression = function() { - var e = this.createNode(), t, n, r; - switch (this.lookahead.type) { - case 3: - (this.context.isModule || this.context.await) && this.lookahead.value === `await` && this.tolerateUnexpectedToken(this.lookahead), t = this.matchAsyncFunction() ? this.parseFunctionExpression() : this.finalize(e, new o.Identifier(this.nextToken().value)); - break; - case 6: - case 8: - this.context.strict && this.lookahead.octal && this.tolerateUnexpectedToken(this.lookahead, a.Messages.StrictOctalLiteral), this.context.isAssignmentTarget = !1, this.context.isBindingElement = !1, n = this.nextToken(), r = this.getTokenRaw(n), t = this.finalize(e, new o.Literal(n.value, r)); - break; - case 1: - this.context.isAssignmentTarget = !1, this.context.isBindingElement = !1, n = this.nextToken(), r = this.getTokenRaw(n), t = this.finalize(e, new o.Literal(n.value === `true`, r)); - break; - case 5: - this.context.isAssignmentTarget = !1, this.context.isBindingElement = !1, n = this.nextToken(), r = this.getTokenRaw(n), t = this.finalize(e, new o.Literal(null, r)); - break; - case 10: - t = this.parseTemplateLiteral(); - break; - case 7: - switch (this.lookahead.value) { - case `(`: - this.context.isBindingElement = !1, t = this.inheritCoverGrammar(this.parseGroupExpression); - break; - case `[`: - t = this.inheritCoverGrammar(this.parseArrayInitializer); - break; - case `{`: - t = this.inheritCoverGrammar(this.parseObjectInitializer); - break; - case `/`: - case `/=`: - this.context.isAssignmentTarget = !1, this.context.isBindingElement = !1, this.scanner.index = this.startMarker.index, n = this.nextRegexToken(), r = this.getTokenRaw(n), t = this.finalize(e, new o.RegexLiteral(n.regex, r, n.pattern, n.flags)); - break; - default: t = this.throwUnexpectedToken(this.nextToken()); - } - break; - case 4: - !this.context.strict && this.context.allowYield && this.matchKeyword(`yield`) ? t = this.parseIdentifierName() : !this.context.strict && this.matchKeyword(`let`) ? t = this.finalize(e, new o.Identifier(this.nextToken().value)) : (this.context.isAssignmentTarget = !1, this.context.isBindingElement = !1, this.matchKeyword(`function`) ? t = this.parseFunctionExpression() : this.matchKeyword(`this`) ? (this.nextToken(), t = this.finalize(e, new o.ThisExpression())) : t = this.matchKeyword(`class`) ? this.parseClassExpression() : this.throwUnexpectedToken(this.nextToken())); - break; - default: t = this.throwUnexpectedToken(this.nextToken()); - } - return t; - }, e.prototype.parseSpreadElement = function() { - var e = this.createNode(); - this.expect(`...`); - var t = this.inheritCoverGrammar(this.parseAssignmentExpression); - return this.finalize(e, new o.SpreadElement(t)); - }, e.prototype.parseArrayInitializer = function() { - var e = this.createNode(), t = []; - for (this.expect(`[`); !this.match(`]`);) if (this.match(`,`)) this.nextToken(), t.push(null); - else if (this.match(`...`)) { - var n = this.parseSpreadElement(); - this.match(`]`) || (this.context.isAssignmentTarget = !1, this.context.isBindingElement = !1, this.expect(`,`)), t.push(n); - } else t.push(this.inheritCoverGrammar(this.parseAssignmentExpression)), this.match(`]`) || this.expect(`,`); - return this.expect(`]`), this.finalize(e, new o.ArrayExpression(t)); - }, e.prototype.parsePropertyMethod = function(e) { - this.context.isAssignmentTarget = !1, this.context.isBindingElement = !1; - var t = this.context.strict, n = this.context.allowStrictDirective; - this.context.allowStrictDirective = e.simple; - var r = this.isolateCoverGrammar(this.parseFunctionSourceElements); - return this.context.strict && e.firstRestricted && this.tolerateUnexpectedToken(e.firstRestricted, e.message), this.context.strict && e.stricted && this.tolerateUnexpectedToken(e.stricted, e.message), this.context.strict = t, this.context.allowStrictDirective = n, r; - }, e.prototype.parsePropertyMethodFunction = function() { - var e = !1, t = this.createNode(), n = this.context.allowYield; - this.context.allowYield = !0; - var r = this.parseFormalParameters(), i = this.parsePropertyMethod(r); - return this.context.allowYield = n, this.finalize(t, new o.FunctionExpression(null, r.params, i, e)); - }, e.prototype.parsePropertyMethodAsyncFunction = function() { - var e = this.createNode(), t = this.context.allowYield, n = this.context.await; - this.context.allowYield = !1, this.context.await = !0; - var r = this.parseFormalParameters(), i = this.parsePropertyMethod(r); - return this.context.allowYield = t, this.context.await = n, this.finalize(e, new o.AsyncFunctionExpression(null, r.params, i)); - }, e.prototype.parseObjectPropertyKey = function() { - var e = this.createNode(), t = this.nextToken(), n; - switch (t.type) { - case 8: - case 6: - this.context.strict && t.octal && this.tolerateUnexpectedToken(t, a.Messages.StrictOctalLiteral); - var r = this.getTokenRaw(t); - n = this.finalize(e, new o.Literal(t.value, r)); - break; - case 3: - case 1: - case 5: - case 4: - n = this.finalize(e, new o.Identifier(t.value)); - break; - case 7: - t.value === `[` ? (n = this.isolateCoverGrammar(this.parseAssignmentExpression), this.expect(`]`)) : n = this.throwUnexpectedToken(t); - break; - default: n = this.throwUnexpectedToken(t); - } - return n; - }, e.prototype.isPropertyKey = function(e, t) { - return e.type === c.Syntax.Identifier && e.name === t || e.type === c.Syntax.Literal && e.value === t; - }, e.prototype.parseObjectProperty = function(e) { - var t = this.createNode(), n = this.lookahead, r, i = null, s = null, c = !1, l = !1, u = !1, d = !1; - if (n.type === 3) { - var f = n.value; - this.nextToken(), c = this.match(`[`), d = !this.hasLineTerminator && f === `async` && !this.match(`:`) && !this.match(`(`) && !this.match(`*`) && !this.match(`,`), i = d ? this.parseObjectPropertyKey() : this.finalize(t, new o.Identifier(f)); - } else this.match(`*`) ? this.nextToken() : (c = this.match(`[`), i = this.parseObjectPropertyKey()); - var p = this.qualifiedPropertyName(this.lookahead); - if (n.type === 3 && !d && n.value === `get` && p) r = `get`, c = this.match(`[`), i = this.parseObjectPropertyKey(), this.context.allowYield = !1, s = this.parseGetterMethod(); - else if (n.type === 3 && !d && n.value === `set` && p) r = `set`, c = this.match(`[`), i = this.parseObjectPropertyKey(), s = this.parseSetterMethod(); - else if (n.type === 7 && n.value === `*` && p) r = `init`, c = this.match(`[`), i = this.parseObjectPropertyKey(), s = this.parseGeneratorMethod(), l = !0; - else if (i || this.throwUnexpectedToken(this.lookahead), r = `init`, this.match(`:`) && !d) !c && this.isPropertyKey(i, `__proto__`) && (e.value && this.tolerateError(a.Messages.DuplicateProtoProperty), e.value = !0), this.nextToken(), s = this.inheritCoverGrammar(this.parseAssignmentExpression); - else if (this.match(`(`)) s = d ? this.parsePropertyMethodAsyncFunction() : this.parsePropertyMethodFunction(), l = !0; - else if (n.type === 3) { - var f = this.finalize(t, new o.Identifier(n.value)); - if (this.match(`=`)) { - this.context.firstCoverInitializedNameError = this.lookahead, this.nextToken(), u = !0; - var m = this.isolateCoverGrammar(this.parseAssignmentExpression); - s = this.finalize(t, new o.AssignmentPattern(f, m)); - } else u = !0, s = f; - } else this.throwUnexpectedToken(this.nextToken()); - return this.finalize(t, new o.Property(r, i, c, s, l, u)); - }, e.prototype.parseObjectInitializer = function() { - var e = this.createNode(); - this.expect(`{`); - for (var t = [], n = { value: !1 }; !this.match(`}`);) t.push(this.parseObjectProperty(n)), this.match(`}`) || this.expectCommaSeparator(); - return this.expect(`}`), this.finalize(e, new o.ObjectExpression(t)); - }, e.prototype.parseTemplateHead = function() { - r.assert(this.lookahead.head, `Template literal must start with a template head`); - var e = this.createNode(), t = this.nextToken(), n = t.value, i = t.cooked; - return this.finalize(e, new o.TemplateElement({ - raw: n, - cooked: i - }, t.tail)); - }, e.prototype.parseTemplateElement = function() { - this.lookahead.type !== 10 && this.throwUnexpectedToken(); - var e = this.createNode(), t = this.nextToken(), n = t.value, r = t.cooked; - return this.finalize(e, new o.TemplateElement({ - raw: n, - cooked: r - }, t.tail)); - }, e.prototype.parseTemplateLiteral = function() { - var e = this.createNode(), t = [], n = [], r = this.parseTemplateHead(); - for (n.push(r); !r.tail;) t.push(this.parseExpression()), r = this.parseTemplateElement(), n.push(r); - return this.finalize(e, new o.TemplateLiteral(n, t)); - }, e.prototype.reinterpretExpressionAsPattern = function(e) { - switch (e.type) { - case c.Syntax.Identifier: - case c.Syntax.MemberExpression: - case c.Syntax.RestElement: - case c.Syntax.AssignmentPattern: break; - case c.Syntax.SpreadElement: - e.type = c.Syntax.RestElement, this.reinterpretExpressionAsPattern(e.argument); - break; - case c.Syntax.ArrayExpression: - e.type = c.Syntax.ArrayPattern; - for (var t = 0; t < e.elements.length; t++) e.elements[t] !== null && this.reinterpretExpressionAsPattern(e.elements[t]); - break; - case c.Syntax.ObjectExpression: - e.type = c.Syntax.ObjectPattern; - for (var t = 0; t < e.properties.length; t++) this.reinterpretExpressionAsPattern(e.properties[t].value); - break; - case c.Syntax.AssignmentExpression: - e.type = c.Syntax.AssignmentPattern, delete e.operator, this.reinterpretExpressionAsPattern(e.left); - break; - default: break; - } - }, e.prototype.parseGroupExpression = function() { - var e; - if (this.expect(`(`), this.match(`)`)) this.nextToken(), this.match(`=>`) || this.expect(`=>`), e = { - type: u, - params: [], - async: !1 - }; - else { - var t = this.lookahead, n = []; - if (this.match(`...`)) e = this.parseRestElement(n), this.expect(`)`), this.match(`=>`) || this.expect(`=>`), e = { - type: u, - params: [e], - async: !1 - }; - else { - var r = !1; - if (this.context.isBindingElement = !0, e = this.inheritCoverGrammar(this.parseAssignmentExpression), this.match(`,`)) { - var i = []; - for (this.context.isAssignmentTarget = !1, i.push(e); this.lookahead.type !== 2 && this.match(`,`);) { - if (this.nextToken(), this.match(`)`)) { - this.nextToken(); - for (var a = 0; a < i.length; a++) this.reinterpretExpressionAsPattern(i[a]); - r = !0, e = { - type: u, - params: i, - async: !1 - }; - } else if (this.match(`...`)) { - this.context.isBindingElement || this.throwUnexpectedToken(this.lookahead), i.push(this.parseRestElement(n)), this.expect(`)`), this.match(`=>`) || this.expect(`=>`), this.context.isBindingElement = !1; - for (var a = 0; a < i.length; a++) this.reinterpretExpressionAsPattern(i[a]); - r = !0, e = { - type: u, - params: i, - async: !1 - }; - } else i.push(this.inheritCoverGrammar(this.parseAssignmentExpression)); - if (r) break; - } - r || (e = this.finalize(this.startNode(t), new o.SequenceExpression(i))); - } - if (!r) { - if (this.expect(`)`), this.match(`=>`) && (e.type === c.Syntax.Identifier && e.name === `yield` && (r = !0, e = { - type: u, - params: [e], - async: !1 - }), !r)) { - if (this.context.isBindingElement || this.throwUnexpectedToken(this.lookahead), e.type === c.Syntax.SequenceExpression) for (var a = 0; a < e.expressions.length; a++) this.reinterpretExpressionAsPattern(e.expressions[a]); - else this.reinterpretExpressionAsPattern(e); - e = { - type: u, - params: e.type === c.Syntax.SequenceExpression ? e.expressions : [e], - async: !1 - }; - } - this.context.isBindingElement = !1; - } - } - } - return e; - }, e.prototype.parseArguments = function() { - this.expect(`(`); - var e = []; - if (!this.match(`)`)) for (;;) { - var t = this.match(`...`) ? this.parseSpreadElement() : this.isolateCoverGrammar(this.parseAssignmentExpression); - if (e.push(t), this.match(`)`) || (this.expectCommaSeparator(), this.match(`)`))) break; - } - return this.expect(`)`), e; - }, e.prototype.isIdentifierName = function(e) { - return e.type === 3 || e.type === 4 || e.type === 1 || e.type === 5; - }, e.prototype.parseIdentifierName = function() { - var e = this.createNode(), t = this.nextToken(); - return this.isIdentifierName(t) || this.throwUnexpectedToken(t), this.finalize(e, new o.Identifier(t.value)); - }, e.prototype.parseNewExpression = function() { - var e = this.createNode(), t = this.parseIdentifierName(); - r.assert(t.name === `new`, "New expression must start with `new`"); - var n; - if (this.match(`.`)) if (this.nextToken(), this.lookahead.type === 3 && this.context.inFunctionBody && this.lookahead.value === `target`) { - var i = this.parseIdentifierName(); - n = new o.MetaProperty(t, i); - } else this.throwUnexpectedToken(this.lookahead); - else { - var a = this.isolateCoverGrammar(this.parseLeftHandSideExpression), s = this.match(`(`) ? this.parseArguments() : []; - n = new o.NewExpression(a, s), this.context.isAssignmentTarget = !1, this.context.isBindingElement = !1; - } - return this.finalize(e, n); - }, e.prototype.parseAsyncArgument = function() { - var e = this.parseAssignmentExpression(); - return this.context.firstCoverInitializedNameError = null, e; - }, e.prototype.parseAsyncArguments = function() { - this.expect(`(`); - var e = []; - if (!this.match(`)`)) for (;;) { - var t = this.match(`...`) ? this.parseSpreadElement() : this.isolateCoverGrammar(this.parseAsyncArgument); - if (e.push(t), this.match(`)`) || (this.expectCommaSeparator(), this.match(`)`))) break; - } - return this.expect(`)`), e; - }, e.prototype.parseLeftHandSideExpressionAllowCall = function() { - var e = this.lookahead, t = this.matchContextualKeyword(`async`), n = this.context.allowIn; - this.context.allowIn = !0; - var r; - for (this.matchKeyword(`super`) && this.context.inFunctionBody ? (r = this.createNode(), this.nextToken(), r = this.finalize(r, new o.Super()), !this.match(`(`) && !this.match(`.`) && !this.match(`[`) && this.throwUnexpectedToken(this.lookahead)) : r = this.inheritCoverGrammar(this.matchKeyword(`new`) ? this.parseNewExpression : this.parsePrimaryExpression);;) if (this.match(`.`)) { - this.context.isBindingElement = !1, this.context.isAssignmentTarget = !0, this.expect(`.`); - var i = this.parseIdentifierName(); - r = this.finalize(this.startNode(e), new o.StaticMemberExpression(r, i)); - } else if (this.match(`(`)) { - var a = t && e.lineNumber === this.lookahead.lineNumber; - this.context.isBindingElement = !1, this.context.isAssignmentTarget = !1; - var s = a ? this.parseAsyncArguments() : this.parseArguments(); - if (r = this.finalize(this.startNode(e), new o.CallExpression(r, s)), a && this.match(`=>`)) { - for (var c = 0; c < s.length; ++c) this.reinterpretExpressionAsPattern(s[c]); - r = { - type: u, - params: s, - async: !0 - }; - } - } else if (this.match(`[`)) { - this.context.isBindingElement = !1, this.context.isAssignmentTarget = !0, this.expect(`[`); - var i = this.isolateCoverGrammar(this.parseExpression); - this.expect(`]`), r = this.finalize(this.startNode(e), new o.ComputedMemberExpression(r, i)); - } else if (this.lookahead.type === 10 && this.lookahead.head) { - var l = this.parseTemplateLiteral(); - r = this.finalize(this.startNode(e), new o.TaggedTemplateExpression(r, l)); - } else break; - return this.context.allowIn = n, r; - }, e.prototype.parseSuper = function() { - var e = this.createNode(); - return this.expectKeyword(`super`), !this.match(`[`) && !this.match(`.`) && this.throwUnexpectedToken(this.lookahead), this.finalize(e, new o.Super()); - }, e.prototype.parseLeftHandSideExpression = function() { - r.assert(this.context.allowIn, `callee of new expression always allow in keyword.`); - for (var e = this.startNode(this.lookahead), t = this.matchKeyword(`super`) && this.context.inFunctionBody ? this.parseSuper() : this.inheritCoverGrammar(this.matchKeyword(`new`) ? this.parseNewExpression : this.parsePrimaryExpression);;) if (this.match(`[`)) { - this.context.isBindingElement = !1, this.context.isAssignmentTarget = !0, this.expect(`[`); - var n = this.isolateCoverGrammar(this.parseExpression); - this.expect(`]`), t = this.finalize(e, new o.ComputedMemberExpression(t, n)); - } else if (this.match(`.`)) { - this.context.isBindingElement = !1, this.context.isAssignmentTarget = !0, this.expect(`.`); - var n = this.parseIdentifierName(); - t = this.finalize(e, new o.StaticMemberExpression(t, n)); - } else if (this.lookahead.type === 10 && this.lookahead.head) { - var i = this.parseTemplateLiteral(); - t = this.finalize(e, new o.TaggedTemplateExpression(t, i)); - } else break; - return t; - }, e.prototype.parseUpdateExpression = function() { - var e, t = this.lookahead; - if (this.match(`++`) || this.match(`--`)) { - var n = this.startNode(t), r = this.nextToken(); - e = this.inheritCoverGrammar(this.parseUnaryExpression), this.context.strict && e.type === c.Syntax.Identifier && this.scanner.isRestrictedWord(e.name) && this.tolerateError(a.Messages.StrictLHSPrefix), this.context.isAssignmentTarget || this.tolerateError(a.Messages.InvalidLHSInAssignment); - var i = !0; - e = this.finalize(n, new o.UpdateExpression(r.value, e, i)), this.context.isAssignmentTarget = !1, this.context.isBindingElement = !1; - } else if (e = this.inheritCoverGrammar(this.parseLeftHandSideExpressionAllowCall), !this.hasLineTerminator && this.lookahead.type === 7 && (this.match(`++`) || this.match(`--`))) { - this.context.strict && e.type === c.Syntax.Identifier && this.scanner.isRestrictedWord(e.name) && this.tolerateError(a.Messages.StrictLHSPostfix), this.context.isAssignmentTarget || this.tolerateError(a.Messages.InvalidLHSInAssignment), this.context.isAssignmentTarget = !1, this.context.isBindingElement = !1; - var s = this.nextToken().value, i = !1; - e = this.finalize(this.startNode(t), new o.UpdateExpression(s, e, i)); - } - return e; - }, e.prototype.parseAwaitExpression = function() { - var e = this.createNode(); - this.nextToken(); - var t = this.parseUnaryExpression(); - return this.finalize(e, new o.AwaitExpression(t)); - }, e.prototype.parseUnaryExpression = function() { - var e; - if (this.match(`+`) || this.match(`-`) || this.match(`~`) || this.match(`!`) || this.matchKeyword(`delete`) || this.matchKeyword(`void`) || this.matchKeyword(`typeof`)) { - var t = this.startNode(this.lookahead), n = this.nextToken(); - e = this.inheritCoverGrammar(this.parseUnaryExpression), e = this.finalize(t, new o.UnaryExpression(n.value, e)), this.context.strict && e.operator === `delete` && e.argument.type === c.Syntax.Identifier && this.tolerateError(a.Messages.StrictDelete), this.context.isAssignmentTarget = !1, this.context.isBindingElement = !1; - } else e = this.context.await && this.matchContextualKeyword(`await`) ? this.parseAwaitExpression() : this.parseUpdateExpression(); - return e; - }, e.prototype.parseExponentiationExpression = function() { - var e = this.lookahead, t = this.inheritCoverGrammar(this.parseUnaryExpression); - if (t.type !== c.Syntax.UnaryExpression && this.match(`**`)) { - this.nextToken(), this.context.isAssignmentTarget = !1, this.context.isBindingElement = !1; - var n = t, r = this.isolateCoverGrammar(this.parseExponentiationExpression); - t = this.finalize(this.startNode(e), new o.BinaryExpression(`**`, n, r)); - } - return t; - }, e.prototype.binaryPrecedence = function(e) { - var t = e.value; - return e.type === 7 ? this.operatorPrecedence[t] || 0 : e.type === 4 && (t === `instanceof` || this.context.allowIn && t === `in`) ? 7 : 0; - }, e.prototype.parseBinaryExpression = function() { - var e = this.lookahead, t = this.inheritCoverGrammar(this.parseExponentiationExpression), n = this.lookahead, r = this.binaryPrecedence(n); - if (r > 0) { - this.nextToken(), this.context.isAssignmentTarget = !1, this.context.isBindingElement = !1; - for (var i = [e, this.lookahead], a = t, s = this.isolateCoverGrammar(this.parseExponentiationExpression), c = [ - a, - n.value, - s - ], l = [r]; r = this.binaryPrecedence(this.lookahead), !(r <= 0);) { - for (; c.length > 2 && r <= l[l.length - 1];) { - s = c.pop(); - var u = c.pop(); - l.pop(), a = c.pop(), i.pop(); - var d = this.startNode(i[i.length - 1]); - c.push(this.finalize(d, new o.BinaryExpression(u, a, s))); - } - c.push(this.nextToken().value), l.push(r), i.push(this.lookahead), c.push(this.isolateCoverGrammar(this.parseExponentiationExpression)); - } - var f = c.length - 1; - t = c[f]; - for (var p = i.pop(); f > 1;) { - var m = i.pop(), h = p && p.lineStart, d = this.startNode(m, h), u = c[f - 1]; - t = this.finalize(d, new o.BinaryExpression(u, c[f - 2], t)), f -= 2, p = m; - } - } - return t; - }, e.prototype.parseConditionalExpression = function() { - var e = this.lookahead, t = this.inheritCoverGrammar(this.parseBinaryExpression); - if (this.match(`?`)) { - this.nextToken(); - var n = this.context.allowIn; - this.context.allowIn = !0; - var r = this.isolateCoverGrammar(this.parseAssignmentExpression); - this.context.allowIn = n, this.expect(`:`); - var i = this.isolateCoverGrammar(this.parseAssignmentExpression); - t = this.finalize(this.startNode(e), new o.ConditionalExpression(t, r, i)), this.context.isAssignmentTarget = !1, this.context.isBindingElement = !1; - } - return t; - }, e.prototype.checkPatternParam = function(e, t) { - switch (t.type) { - case c.Syntax.Identifier: - this.validateParam(e, t, t.name); - break; - case c.Syntax.RestElement: - this.checkPatternParam(e, t.argument); - break; - case c.Syntax.AssignmentPattern: - this.checkPatternParam(e, t.left); - break; - case c.Syntax.ArrayPattern: - for (var n = 0; n < t.elements.length; n++) t.elements[n] !== null && this.checkPatternParam(e, t.elements[n]); - break; - case c.Syntax.ObjectPattern: - for (var n = 0; n < t.properties.length; n++) this.checkPatternParam(e, t.properties[n].value); - break; - default: break; - } - e.simple = e.simple && t instanceof o.Identifier; - }, e.prototype.reinterpretAsCoverFormalsList = function(e) { - var t = [e], n, r = !1; - switch (e.type) { - case c.Syntax.Identifier: break; - case u: - t = e.params, r = e.async; - break; - default: return null; - } - n = { - simple: !0, - paramSet: {} - }; - for (var i = 0; i < t.length; ++i) { - var o = t[i]; - o.type === c.Syntax.AssignmentPattern ? o.right.type === c.Syntax.YieldExpression && (o.right.argument && this.throwUnexpectedToken(this.lookahead), o.right.type = c.Syntax.Identifier, o.right.name = `yield`, delete o.right.argument, delete o.right.delegate) : r && o.type === c.Syntax.Identifier && o.name === `await` && this.throwUnexpectedToken(this.lookahead), this.checkPatternParam(n, o), t[i] = o; - } - if (this.context.strict || !this.context.allowYield) for (var i = 0; i < t.length; ++i) { - var o = t[i]; - o.type === c.Syntax.YieldExpression && this.throwUnexpectedToken(this.lookahead); - } - if (n.message === a.Messages.StrictParamDupe) { - var s = this.context.strict ? n.stricted : n.firstRestricted; - this.throwUnexpectedToken(s, n.message); - } - return { - simple: n.simple, - params: t, - stricted: n.stricted, - firstRestricted: n.firstRestricted, - message: n.message - }; - }, e.prototype.parseAssignmentExpression = function() { - var e; - if (!this.context.allowYield && this.matchKeyword(`yield`)) e = this.parseYieldExpression(); - else { - var t = this.lookahead, n = t; - if (e = this.parseConditionalExpression(), n.type === 3 && n.lineNumber === this.lookahead.lineNumber && n.value === `async` && (this.lookahead.type === 3 || this.matchKeyword(`yield`))) { - var r = this.parsePrimaryExpression(); - this.reinterpretExpressionAsPattern(r), e = { - type: u, - params: [r], - async: !0 - }; - } - if (e.type === u || this.match(`=>`)) { - this.context.isAssignmentTarget = !1, this.context.isBindingElement = !1; - var i = e.async, s = this.reinterpretAsCoverFormalsList(e); - if (s) { - this.hasLineTerminator && this.tolerateUnexpectedToken(this.lookahead), this.context.firstCoverInitializedNameError = null; - var l = this.context.strict, d = this.context.allowStrictDirective; - this.context.allowStrictDirective = s.simple; - var f = this.context.allowYield, p = this.context.await; - this.context.allowYield = !0, this.context.await = i; - var m = this.startNode(t); - this.expect(`=>`); - var h = void 0; - if (this.match(`{`)) { - var g = this.context.allowIn; - this.context.allowIn = !0, h = this.parseFunctionSourceElements(), this.context.allowIn = g; - } else h = this.isolateCoverGrammar(this.parseAssignmentExpression); - var _ = h.type !== c.Syntax.BlockStatement; - this.context.strict && s.firstRestricted && this.throwUnexpectedToken(s.firstRestricted, s.message), this.context.strict && s.stricted && this.tolerateUnexpectedToken(s.stricted, s.message), e = i ? this.finalize(m, new o.AsyncArrowFunctionExpression(s.params, h, _)) : this.finalize(m, new o.ArrowFunctionExpression(s.params, h, _)), this.context.strict = l, this.context.allowStrictDirective = d, this.context.allowYield = f, this.context.await = p; - } - } else if (this.matchAssign()) { - if (this.context.isAssignmentTarget || this.tolerateError(a.Messages.InvalidLHSInAssignment), this.context.strict && e.type === c.Syntax.Identifier) { - var v = e; - this.scanner.isRestrictedWord(v.name) && this.tolerateUnexpectedToken(n, a.Messages.StrictLHSAssignment), this.scanner.isStrictModeReservedWord(v.name) && this.tolerateUnexpectedToken(n, a.Messages.StrictReservedWord); - } - this.match(`=`) ? this.reinterpretExpressionAsPattern(e) : (this.context.isAssignmentTarget = !1, this.context.isBindingElement = !1), n = this.nextToken(); - var y = n.value, b = this.isolateCoverGrammar(this.parseAssignmentExpression); - e = this.finalize(this.startNode(t), new o.AssignmentExpression(y, e, b)), this.context.firstCoverInitializedNameError = null; - } - } - return e; - }, e.prototype.parseExpression = function() { - var e = this.lookahead, t = this.isolateCoverGrammar(this.parseAssignmentExpression); - if (this.match(`,`)) { - var n = []; - for (n.push(t); this.lookahead.type !== 2 && this.match(`,`);) this.nextToken(), n.push(this.isolateCoverGrammar(this.parseAssignmentExpression)); - t = this.finalize(this.startNode(e), new o.SequenceExpression(n)); - } - return t; - }, e.prototype.parseStatementListItem = function() { - var e; - if (this.context.isAssignmentTarget = !0, this.context.isBindingElement = !0, this.lookahead.type === 4) switch (this.lookahead.value) { - case `export`: - this.context.isModule || this.tolerateUnexpectedToken(this.lookahead, a.Messages.IllegalExportDeclaration), e = this.parseExportDeclaration(); - break; - case `import`: - this.context.isModule || this.tolerateUnexpectedToken(this.lookahead, a.Messages.IllegalImportDeclaration), e = this.parseImportDeclaration(); - break; - case `const`: - e = this.parseLexicalDeclaration({ inFor: !1 }); - break; - case `function`: - e = this.parseFunctionDeclaration(); - break; - case `class`: - e = this.parseClassDeclaration(); - break; - case `let`: - e = this.isLexicalDeclaration() ? this.parseLexicalDeclaration({ inFor: !1 }) : this.parseStatement(); - break; - default: - e = this.parseStatement(); - break; - } - else e = this.parseStatement(); - return e; - }, e.prototype.parseBlock = function() { - var e = this.createNode(); - this.expect(`{`); - for (var t = []; !this.match(`}`);) t.push(this.parseStatementListItem()); - return this.expect(`}`), this.finalize(e, new o.BlockStatement(t)); - }, e.prototype.parseLexicalBinding = function(e, t) { - var n = this.createNode(), r = this.parsePattern([], e); - this.context.strict && r.type === c.Syntax.Identifier && this.scanner.isRestrictedWord(r.name) && this.tolerateError(a.Messages.StrictVarName); - var i = null; - return e === `const` ? !this.matchKeyword(`in`) && !this.matchContextualKeyword(`of`) && (this.match(`=`) ? (this.nextToken(), i = this.isolateCoverGrammar(this.parseAssignmentExpression)) : this.throwError(a.Messages.DeclarationMissingInitializer, `const`)) : (!t.inFor && r.type !== c.Syntax.Identifier || this.match(`=`)) && (this.expect(`=`), i = this.isolateCoverGrammar(this.parseAssignmentExpression)), this.finalize(n, new o.VariableDeclarator(r, i)); - }, e.prototype.parseBindingList = function(e, t) { - for (var n = [this.parseLexicalBinding(e, t)]; this.match(`,`);) this.nextToken(), n.push(this.parseLexicalBinding(e, t)); - return n; - }, e.prototype.isLexicalDeclaration = function() { - var e = this.scanner.saveState(); - this.scanner.scanComments(); - var t = this.scanner.lex(); - return this.scanner.restoreState(e), t.type === 3 || t.type === 7 && t.value === `[` || t.type === 7 && t.value === `{` || t.type === 4 && t.value === `let` || t.type === 4 && t.value === `yield`; - }, e.prototype.parseLexicalDeclaration = function(e) { - var t = this.createNode(), n = this.nextToken().value; - r.assert(n === `let` || n === `const`, `Lexical declaration must be either let or const`); - var i = this.parseBindingList(n, e); - return this.consumeSemicolon(), this.finalize(t, new o.VariableDeclaration(i, n)); - }, e.prototype.parseBindingRestElement = function(e, t) { - var n = this.createNode(); - this.expect(`...`); - var r = this.parsePattern(e, t); - return this.finalize(n, new o.RestElement(r)); - }, e.prototype.parseArrayPattern = function(e, t) { - var n = this.createNode(); - this.expect(`[`); - for (var r = []; !this.match(`]`);) if (this.match(`,`)) this.nextToken(), r.push(null); - else { - if (this.match(`...`)) { - r.push(this.parseBindingRestElement(e, t)); - break; - } else r.push(this.parsePatternWithDefault(e, t)); - this.match(`]`) || this.expect(`,`); - } - return this.expect(`]`), this.finalize(n, new o.ArrayPattern(r)); - }, e.prototype.parsePropertyPattern = function(e, t) { - var n = this.createNode(), r = !1, i = !1, a = !1, s, c; - if (this.lookahead.type === 3) { - var l = this.lookahead; - s = this.parseVariableIdentifier(); - var u = this.finalize(n, new o.Identifier(l.value)); - if (this.match(`=`)) { - e.push(l), i = !0, this.nextToken(); - var d = this.parseAssignmentExpression(); - c = this.finalize(this.startNode(l), new o.AssignmentPattern(u, d)); - } else this.match(`:`) ? (this.expect(`:`), c = this.parsePatternWithDefault(e, t)) : (e.push(l), i = !0, c = u); - } else r = this.match(`[`), s = this.parseObjectPropertyKey(), this.expect(`:`), c = this.parsePatternWithDefault(e, t); - return this.finalize(n, new o.Property(`init`, s, r, c, a, i)); - }, e.prototype.parseObjectPattern = function(e, t) { - var n = this.createNode(), r = []; - for (this.expect(`{`); !this.match(`}`);) r.push(this.parsePropertyPattern(e, t)), this.match(`}`) || this.expect(`,`); - return this.expect(`}`), this.finalize(n, new o.ObjectPattern(r)); - }, e.prototype.parsePattern = function(e, t) { - var n; - return this.match(`[`) ? n = this.parseArrayPattern(e, t) : this.match(`{`) ? n = this.parseObjectPattern(e, t) : (this.matchKeyword(`let`) && (t === `const` || t === `let`) && this.tolerateUnexpectedToken(this.lookahead, a.Messages.LetInLexicalBinding), e.push(this.lookahead), n = this.parseVariableIdentifier(t)), n; - }, e.prototype.parsePatternWithDefault = function(e, t) { - var n = this.lookahead, r = this.parsePattern(e, t); - if (this.match(`=`)) { - this.nextToken(); - var i = this.context.allowYield; - this.context.allowYield = !0; - var a = this.isolateCoverGrammar(this.parseAssignmentExpression); - this.context.allowYield = i, r = this.finalize(this.startNode(n), new o.AssignmentPattern(r, a)); - } - return r; - }, e.prototype.parseVariableIdentifier = function(e) { - var t = this.createNode(), n = this.nextToken(); - return n.type === 4 && n.value === `yield` ? this.context.strict ? this.tolerateUnexpectedToken(n, a.Messages.StrictReservedWord) : this.context.allowYield || this.throwUnexpectedToken(n) : n.type === 3 ? (this.context.isModule || this.context.await) && n.type === 3 && n.value === `await` && this.tolerateUnexpectedToken(n) : this.context.strict && n.type === 4 && this.scanner.isStrictModeReservedWord(n.value) ? this.tolerateUnexpectedToken(n, a.Messages.StrictReservedWord) : (this.context.strict || n.value !== `let` || e !== `var`) && this.throwUnexpectedToken(n), this.finalize(t, new o.Identifier(n.value)); - }, e.prototype.parseVariableDeclaration = function(e) { - var t = this.createNode(), n = this.parsePattern([], `var`); - this.context.strict && n.type === c.Syntax.Identifier && this.scanner.isRestrictedWord(n.name) && this.tolerateError(a.Messages.StrictVarName); - var r = null; - return this.match(`=`) ? (this.nextToken(), r = this.isolateCoverGrammar(this.parseAssignmentExpression)) : n.type !== c.Syntax.Identifier && !e.inFor && this.expect(`=`), this.finalize(t, new o.VariableDeclarator(n, r)); - }, e.prototype.parseVariableDeclarationList = function(e) { - var t = { inFor: e.inFor }, n = []; - for (n.push(this.parseVariableDeclaration(t)); this.match(`,`);) this.nextToken(), n.push(this.parseVariableDeclaration(t)); - return n; - }, e.prototype.parseVariableStatement = function() { - var e = this.createNode(); - this.expectKeyword(`var`); - var t = this.parseVariableDeclarationList({ inFor: !1 }); - return this.consumeSemicolon(), this.finalize(e, new o.VariableDeclaration(t, `var`)); - }, e.prototype.parseEmptyStatement = function() { - var e = this.createNode(); - return this.expect(`;`), this.finalize(e, new o.EmptyStatement()); - }, e.prototype.parseExpressionStatement = function() { - var e = this.createNode(), t = this.parseExpression(); - return this.consumeSemicolon(), this.finalize(e, new o.ExpressionStatement(t)); - }, e.prototype.parseIfClause = function() { - return this.context.strict && this.matchKeyword(`function`) && this.tolerateError(a.Messages.StrictFunction), this.parseStatement(); - }, e.prototype.parseIfStatement = function() { - var e = this.createNode(), t, n = null; - this.expectKeyword(`if`), this.expect(`(`); - var r = this.parseExpression(); - return !this.match(`)`) && this.config.tolerant ? (this.tolerateUnexpectedToken(this.nextToken()), t = this.finalize(this.createNode(), new o.EmptyStatement())) : (this.expect(`)`), t = this.parseIfClause(), this.matchKeyword(`else`) && (this.nextToken(), n = this.parseIfClause())), this.finalize(e, new o.IfStatement(r, t, n)); - }, e.prototype.parseDoWhileStatement = function() { - var e = this.createNode(); - this.expectKeyword(`do`); - var t = this.context.inIteration; - this.context.inIteration = !0; - var n = this.parseStatement(); - this.context.inIteration = t, this.expectKeyword(`while`), this.expect(`(`); - var r = this.parseExpression(); - return !this.match(`)`) && this.config.tolerant ? this.tolerateUnexpectedToken(this.nextToken()) : (this.expect(`)`), this.match(`;`) && this.nextToken()), this.finalize(e, new o.DoWhileStatement(n, r)); - }, e.prototype.parseWhileStatement = function() { - var e = this.createNode(), t; - this.expectKeyword(`while`), this.expect(`(`); - var n = this.parseExpression(); - if (!this.match(`)`) && this.config.tolerant) this.tolerateUnexpectedToken(this.nextToken()), t = this.finalize(this.createNode(), new o.EmptyStatement()); - else { - this.expect(`)`); - var r = this.context.inIteration; - this.context.inIteration = !0, t = this.parseStatement(), this.context.inIteration = r; - } - return this.finalize(e, new o.WhileStatement(n, t)); - }, e.prototype.parseForStatement = function() { - var e = null, t = null, n = null, r = !0, i, s, l = this.createNode(); - if (this.expectKeyword(`for`), this.expect(`(`), this.match(`;`)) this.nextToken(); - else if (this.matchKeyword(`var`)) { - e = this.createNode(), this.nextToken(); - var u = this.context.allowIn; - this.context.allowIn = !1; - var d = this.parseVariableDeclarationList({ inFor: !0 }); - if (this.context.allowIn = u, d.length === 1 && this.matchKeyword(`in`)) { - var f = d[0]; - f.init && (f.id.type === c.Syntax.ArrayPattern || f.id.type === c.Syntax.ObjectPattern || this.context.strict) && this.tolerateError(a.Messages.ForInOfLoopInitializer, `for-in`), e = this.finalize(e, new o.VariableDeclaration(d, `var`)), this.nextToken(), i = e, s = this.parseExpression(), e = null; - } else d.length === 1 && d[0].init === null && this.matchContextualKeyword(`of`) ? (e = this.finalize(e, new o.VariableDeclaration(d, `var`)), this.nextToken(), i = e, s = this.parseAssignmentExpression(), e = null, r = !1) : (e = this.finalize(e, new o.VariableDeclaration(d, `var`)), this.expect(`;`)); - } else if (this.matchKeyword(`const`) || this.matchKeyword(`let`)) { - e = this.createNode(); - var p = this.nextToken().value; - if (!this.context.strict && this.lookahead.value === `in`) e = this.finalize(e, new o.Identifier(p)), this.nextToken(), i = e, s = this.parseExpression(), e = null; - else { - var u = this.context.allowIn; - this.context.allowIn = !1; - var d = this.parseBindingList(p, { inFor: !0 }); - this.context.allowIn = u, d.length === 1 && d[0].init === null && this.matchKeyword(`in`) ? (e = this.finalize(e, new o.VariableDeclaration(d, p)), this.nextToken(), i = e, s = this.parseExpression(), e = null) : d.length === 1 && d[0].init === null && this.matchContextualKeyword(`of`) ? (e = this.finalize(e, new o.VariableDeclaration(d, p)), this.nextToken(), i = e, s = this.parseAssignmentExpression(), e = null, r = !1) : (this.consumeSemicolon(), e = this.finalize(e, new o.VariableDeclaration(d, p))); - } - } else { - var m = this.lookahead, u = this.context.allowIn; - if (this.context.allowIn = !1, e = this.inheritCoverGrammar(this.parseAssignmentExpression), this.context.allowIn = u, this.matchKeyword(`in`)) (!this.context.isAssignmentTarget || e.type === c.Syntax.AssignmentExpression) && this.tolerateError(a.Messages.InvalidLHSInForIn), this.nextToken(), this.reinterpretExpressionAsPattern(e), i = e, s = this.parseExpression(), e = null; - else if (this.matchContextualKeyword(`of`)) (!this.context.isAssignmentTarget || e.type === c.Syntax.AssignmentExpression) && this.tolerateError(a.Messages.InvalidLHSInForLoop), this.nextToken(), this.reinterpretExpressionAsPattern(e), i = e, s = this.parseAssignmentExpression(), e = null, r = !1; - else { - if (this.match(`,`)) { - for (var h = [e]; this.match(`,`);) this.nextToken(), h.push(this.isolateCoverGrammar(this.parseAssignmentExpression)); - e = this.finalize(this.startNode(m), new o.SequenceExpression(h)); - } - this.expect(`;`); - } - } - i === void 0 && (this.match(`;`) || (t = this.parseExpression()), this.expect(`;`), this.match(`)`) || (n = this.parseExpression())); - var g; - if (!this.match(`)`) && this.config.tolerant) this.tolerateUnexpectedToken(this.nextToken()), g = this.finalize(this.createNode(), new o.EmptyStatement()); - else { - this.expect(`)`); - var _ = this.context.inIteration; - this.context.inIteration = !0, g = this.isolateCoverGrammar(this.parseStatement), this.context.inIteration = _; - } - return i === void 0 ? this.finalize(l, new o.ForStatement(e, t, n, g)) : r ? this.finalize(l, new o.ForInStatement(i, s, g)) : this.finalize(l, new o.ForOfStatement(i, s, g)); - }, e.prototype.parseContinueStatement = function() { - var e = this.createNode(); - this.expectKeyword(`continue`); - var t = null; - if (this.lookahead.type === 3 && !this.hasLineTerminator) { - var n = this.parseVariableIdentifier(); - t = n; - var r = `$` + n.name; - Object.prototype.hasOwnProperty.call(this.context.labelSet, r) || this.throwError(a.Messages.UnknownLabel, n.name); - } - return this.consumeSemicolon(), t === null && !this.context.inIteration && this.throwError(a.Messages.IllegalContinue), this.finalize(e, new o.ContinueStatement(t)); - }, e.prototype.parseBreakStatement = function() { - var e = this.createNode(); - this.expectKeyword(`break`); - var t = null; - if (this.lookahead.type === 3 && !this.hasLineTerminator) { - var n = this.parseVariableIdentifier(), r = `$` + n.name; - Object.prototype.hasOwnProperty.call(this.context.labelSet, r) || this.throwError(a.Messages.UnknownLabel, n.name), t = n; - } - return this.consumeSemicolon(), t === null && !this.context.inIteration && !this.context.inSwitch && this.throwError(a.Messages.IllegalBreak), this.finalize(e, new o.BreakStatement(t)); - }, e.prototype.parseReturnStatement = function() { - this.context.inFunctionBody || this.tolerateError(a.Messages.IllegalReturn); - var e = this.createNode(); - this.expectKeyword(`return`); - var t = !this.match(`;`) && !this.match(`}`) && !this.hasLineTerminator && this.lookahead.type !== 2 || this.lookahead.type === 8 || this.lookahead.type === 10 ? this.parseExpression() : null; - return this.consumeSemicolon(), this.finalize(e, new o.ReturnStatement(t)); - }, e.prototype.parseWithStatement = function() { - this.context.strict && this.tolerateError(a.Messages.StrictModeWith); - var e = this.createNode(), t; - this.expectKeyword(`with`), this.expect(`(`); - var n = this.parseExpression(); - return !this.match(`)`) && this.config.tolerant ? (this.tolerateUnexpectedToken(this.nextToken()), t = this.finalize(this.createNode(), new o.EmptyStatement())) : (this.expect(`)`), t = this.parseStatement()), this.finalize(e, new o.WithStatement(n, t)); - }, e.prototype.parseSwitchCase = function() { - var e = this.createNode(), t; - this.matchKeyword(`default`) ? (this.nextToken(), t = null) : (this.expectKeyword(`case`), t = this.parseExpression()), this.expect(`:`); - for (var n = []; !(this.match(`}`) || this.matchKeyword(`default`) || this.matchKeyword(`case`));) n.push(this.parseStatementListItem()); - return this.finalize(e, new o.SwitchCase(t, n)); - }, e.prototype.parseSwitchStatement = function() { - var e = this.createNode(); - this.expectKeyword(`switch`), this.expect(`(`); - var t = this.parseExpression(); - this.expect(`)`); - var n = this.context.inSwitch; - this.context.inSwitch = !0; - var r = [], i = !1; - for (this.expect(`{`); !this.match(`}`);) { - var s = this.parseSwitchCase(); - s.test === null && (i && this.throwError(a.Messages.MultipleDefaultsInSwitch), i = !0), r.push(s); - } - return this.expect(`}`), this.context.inSwitch = n, this.finalize(e, new o.SwitchStatement(t, r)); - }, e.prototype.parseLabelledStatement = function() { - var e = this.createNode(), t = this.parseExpression(), n; - if (t.type === c.Syntax.Identifier && this.match(`:`)) { - this.nextToken(); - var r = t, i = `$` + r.name; - Object.prototype.hasOwnProperty.call(this.context.labelSet, i) && this.throwError(a.Messages.Redeclaration, `Label`, r.name), this.context.labelSet[i] = !0; - var s = void 0; - if (this.matchKeyword(`class`)) this.tolerateUnexpectedToken(this.lookahead), s = this.parseClassDeclaration(); - else if (this.matchKeyword(`function`)) { - var l = this.lookahead, u = this.parseFunctionDeclaration(); - this.context.strict ? this.tolerateUnexpectedToken(l, a.Messages.StrictFunction) : u.generator && this.tolerateUnexpectedToken(l, a.Messages.GeneratorInLegacyContext), s = u; - } else s = this.parseStatement(); - delete this.context.labelSet[i], n = new o.LabeledStatement(r, s); - } else this.consumeSemicolon(), n = new o.ExpressionStatement(t); - return this.finalize(e, n); - }, e.prototype.parseThrowStatement = function() { - var e = this.createNode(); - this.expectKeyword(`throw`), this.hasLineTerminator && this.throwError(a.Messages.NewlineAfterThrow); - var t = this.parseExpression(); - return this.consumeSemicolon(), this.finalize(e, new o.ThrowStatement(t)); - }, e.prototype.parseCatchClause = function() { - var e = this.createNode(); - this.expectKeyword(`catch`), this.expect(`(`), this.match(`)`) && this.throwUnexpectedToken(this.lookahead); - for (var t = [], n = this.parsePattern(t), r = {}, i = 0; i < t.length; i++) { - var s = `$` + t[i].value; - Object.prototype.hasOwnProperty.call(r, s) && this.tolerateError(a.Messages.DuplicateBinding, t[i].value), r[s] = !0; - } - this.context.strict && n.type === c.Syntax.Identifier && this.scanner.isRestrictedWord(n.name) && this.tolerateError(a.Messages.StrictCatchVariable), this.expect(`)`); - var l = this.parseBlock(); - return this.finalize(e, new o.CatchClause(n, l)); - }, e.prototype.parseFinallyClause = function() { - return this.expectKeyword(`finally`), this.parseBlock(); - }, e.prototype.parseTryStatement = function() { - var e = this.createNode(); - this.expectKeyword(`try`); - var t = this.parseBlock(), n = this.matchKeyword(`catch`) ? this.parseCatchClause() : null, r = this.matchKeyword(`finally`) ? this.parseFinallyClause() : null; - return !n && !r && this.throwError(a.Messages.NoCatchOrFinally), this.finalize(e, new o.TryStatement(t, n, r)); - }, e.prototype.parseDebuggerStatement = function() { - var e = this.createNode(); - return this.expectKeyword(`debugger`), this.consumeSemicolon(), this.finalize(e, new o.DebuggerStatement()); - }, e.prototype.parseStatement = function() { - var e; - switch (this.lookahead.type) { - case 1: - case 5: - case 6: - case 8: - case 10: - case 9: - e = this.parseExpressionStatement(); - break; - case 7: - var t = this.lookahead.value; - e = t === `{` ? this.parseBlock() : t === `(` ? this.parseExpressionStatement() : t === `;` ? this.parseEmptyStatement() : this.parseExpressionStatement(); - break; - case 3: - e = this.matchAsyncFunction() ? this.parseFunctionDeclaration() : this.parseLabelledStatement(); - break; - case 4: - switch (this.lookahead.value) { - case `break`: - e = this.parseBreakStatement(); - break; - case `continue`: - e = this.parseContinueStatement(); - break; - case `debugger`: - e = this.parseDebuggerStatement(); - break; - case `do`: - e = this.parseDoWhileStatement(); - break; - case `for`: - e = this.parseForStatement(); - break; - case `function`: - e = this.parseFunctionDeclaration(); - break; - case `if`: - e = this.parseIfStatement(); - break; - case `return`: - e = this.parseReturnStatement(); - break; - case `switch`: - e = this.parseSwitchStatement(); - break; - case `throw`: - e = this.parseThrowStatement(); - break; - case `try`: - e = this.parseTryStatement(); - break; - case `var`: - e = this.parseVariableStatement(); - break; - case `while`: - e = this.parseWhileStatement(); - break; - case `with`: - e = this.parseWithStatement(); - break; - default: - e = this.parseExpressionStatement(); - break; - } - break; - default: e = this.throwUnexpectedToken(this.lookahead); - } - return e; - }, e.prototype.parseFunctionSourceElements = function() { - var e = this.createNode(); - this.expect(`{`); - var t = this.parseDirectivePrologues(), n = this.context.labelSet, r = this.context.inIteration, i = this.context.inSwitch, a = this.context.inFunctionBody; - for (this.context.labelSet = {}, this.context.inIteration = !1, this.context.inSwitch = !1, this.context.inFunctionBody = !0; this.lookahead.type !== 2 && !this.match(`}`);) t.push(this.parseStatementListItem()); - return this.expect(`}`), this.context.labelSet = n, this.context.inIteration = r, this.context.inSwitch = i, this.context.inFunctionBody = a, this.finalize(e, new o.BlockStatement(t)); - }, e.prototype.validateParam = function(e, t, n) { - var r = `$` + n; - this.context.strict ? (this.scanner.isRestrictedWord(n) && (e.stricted = t, e.message = a.Messages.StrictParamName), Object.prototype.hasOwnProperty.call(e.paramSet, r) && (e.stricted = t, e.message = a.Messages.StrictParamDupe)) : e.firstRestricted || (this.scanner.isRestrictedWord(n) ? (e.firstRestricted = t, e.message = a.Messages.StrictParamName) : this.scanner.isStrictModeReservedWord(n) ? (e.firstRestricted = t, e.message = a.Messages.StrictReservedWord) : Object.prototype.hasOwnProperty.call(e.paramSet, r) && (e.stricted = t, e.message = a.Messages.StrictParamDupe)), typeof Object.defineProperty == `function` ? Object.defineProperty(e.paramSet, r, { - value: !0, - enumerable: !0, - writable: !0, - configurable: !0 - }) : e.paramSet[r] = !0; - }, e.prototype.parseRestElement = function(e) { - var t = this.createNode(); - this.expect(`...`); - var n = this.parsePattern(e); - return this.match(`=`) && this.throwError(a.Messages.DefaultRestParameter), this.match(`)`) || this.throwError(a.Messages.ParameterAfterRestParameter), this.finalize(t, new o.RestElement(n)); - }, e.prototype.parseFormalParameter = function(e) { - for (var t = [], n = this.match(`...`) ? this.parseRestElement(t) : this.parsePatternWithDefault(t), r = 0; r < t.length; r++) this.validateParam(e, t[r], t[r].value); - e.simple = e.simple && n instanceof o.Identifier, e.params.push(n); - }, e.prototype.parseFormalParameters = function(e) { - var t = { - simple: !0, - params: [], - firstRestricted: e - }; - if (this.expect(`(`), !this.match(`)`)) for (t.paramSet = {}; this.lookahead.type !== 2 && (this.parseFormalParameter(t), !(this.match(`)`) || (this.expect(`,`), this.match(`)`))));); - return this.expect(`)`), { - simple: t.simple, - params: t.params, - stricted: t.stricted, - firstRestricted: t.firstRestricted, - message: t.message - }; - }, e.prototype.matchAsyncFunction = function() { - var e = this.matchContextualKeyword(`async`); - if (e) { - var t = this.scanner.saveState(); - this.scanner.scanComments(); - var n = this.scanner.lex(); - this.scanner.restoreState(t), e = t.lineNumber === n.lineNumber && n.type === 4 && n.value === `function`; - } - return e; - }, e.prototype.parseFunctionDeclaration = function(e) { - var t = this.createNode(), n = this.matchContextualKeyword(`async`); - n && this.nextToken(), this.expectKeyword(`function`); - var r = n ? !1 : this.match(`*`); - r && this.nextToken(); - var i, s = null, c = null; - if (!e || !this.match(`(`)) { - var l = this.lookahead; - s = this.parseVariableIdentifier(), this.context.strict ? this.scanner.isRestrictedWord(l.value) && this.tolerateUnexpectedToken(l, a.Messages.StrictFunctionName) : this.scanner.isRestrictedWord(l.value) ? (c = l, i = a.Messages.StrictFunctionName) : this.scanner.isStrictModeReservedWord(l.value) && (c = l, i = a.Messages.StrictReservedWord); - } - var u = this.context.await, d = this.context.allowYield; - this.context.await = n, this.context.allowYield = !r; - var f = this.parseFormalParameters(c), p = f.params, m = f.stricted; - c = f.firstRestricted, f.message && (i = f.message); - var h = this.context.strict, g = this.context.allowStrictDirective; - this.context.allowStrictDirective = f.simple; - var _ = this.parseFunctionSourceElements(); - return this.context.strict && c && this.throwUnexpectedToken(c, i), this.context.strict && m && this.tolerateUnexpectedToken(m, i), this.context.strict = h, this.context.allowStrictDirective = g, this.context.await = u, this.context.allowYield = d, n ? this.finalize(t, new o.AsyncFunctionDeclaration(s, p, _)) : this.finalize(t, new o.FunctionDeclaration(s, p, _, r)); - }, e.prototype.parseFunctionExpression = function() { - var e = this.createNode(), t = this.matchContextualKeyword(`async`); - t && this.nextToken(), this.expectKeyword(`function`); - var n = t ? !1 : this.match(`*`); - n && this.nextToken(); - var r, i = null, s, c = this.context.await, l = this.context.allowYield; - if (this.context.await = t, this.context.allowYield = !n, !this.match(`(`)) { - var u = this.lookahead; - i = !this.context.strict && !n && this.matchKeyword(`yield`) ? this.parseIdentifierName() : this.parseVariableIdentifier(), this.context.strict ? this.scanner.isRestrictedWord(u.value) && this.tolerateUnexpectedToken(u, a.Messages.StrictFunctionName) : this.scanner.isRestrictedWord(u.value) ? (s = u, r = a.Messages.StrictFunctionName) : this.scanner.isStrictModeReservedWord(u.value) && (s = u, r = a.Messages.StrictReservedWord); - } - var d = this.parseFormalParameters(s), f = d.params, p = d.stricted; - s = d.firstRestricted, d.message && (r = d.message); - var m = this.context.strict, h = this.context.allowStrictDirective; - this.context.allowStrictDirective = d.simple; - var g = this.parseFunctionSourceElements(); - return this.context.strict && s && this.throwUnexpectedToken(s, r), this.context.strict && p && this.tolerateUnexpectedToken(p, r), this.context.strict = m, this.context.allowStrictDirective = h, this.context.await = c, this.context.allowYield = l, t ? this.finalize(e, new o.AsyncFunctionExpression(i, f, g)) : this.finalize(e, new o.FunctionExpression(i, f, g, n)); - }, e.prototype.parseDirective = function() { - var e = this.lookahead, t = this.createNode(), n = this.parseExpression(), r = n.type === c.Syntax.Literal ? this.getTokenRaw(e).slice(1, -1) : null; - return this.consumeSemicolon(), this.finalize(t, r ? new o.Directive(n, r) : new o.ExpressionStatement(n)); - }, e.prototype.parseDirectivePrologues = function() { - for (var e = null, t = [];;) { - var n = this.lookahead; - if (n.type !== 8) break; - var r = this.parseDirective(); - t.push(r); - var i = r.directive; - if (typeof i != `string`) break; - i === `use strict` ? (this.context.strict = !0, e && this.tolerateUnexpectedToken(e, a.Messages.StrictOctalLiteral), this.context.allowStrictDirective || this.tolerateUnexpectedToken(n, a.Messages.IllegalLanguageModeDirective)) : !e && n.octal && (e = n); - } - return t; - }, e.prototype.qualifiedPropertyName = function(e) { - switch (e.type) { - case 3: - case 8: - case 1: - case 5: - case 6: - case 4: return !0; - case 7: return e.value === `[`; - default: break; - } - return !1; - }, e.prototype.parseGetterMethod = function() { - var e = this.createNode(), t = !1, n = this.context.allowYield; - this.context.allowYield = !t; - var r = this.parseFormalParameters(); - r.params.length > 0 && this.tolerateError(a.Messages.BadGetterArity); - var i = this.parsePropertyMethod(r); - return this.context.allowYield = n, this.finalize(e, new o.FunctionExpression(null, r.params, i, t)); - }, e.prototype.parseSetterMethod = function() { - var e = this.createNode(), t = !1, n = this.context.allowYield; - this.context.allowYield = !t; - var r = this.parseFormalParameters(); - r.params.length === 1 ? r.params[0] instanceof o.RestElement && this.tolerateError(a.Messages.BadSetterRestParameter) : this.tolerateError(a.Messages.BadSetterArity); - var i = this.parsePropertyMethod(r); - return this.context.allowYield = n, this.finalize(e, new o.FunctionExpression(null, r.params, i, t)); - }, e.prototype.parseGeneratorMethod = function() { - var e = this.createNode(), t = !0, n = this.context.allowYield; - this.context.allowYield = !0; - var r = this.parseFormalParameters(); - this.context.allowYield = !1; - var i = this.parsePropertyMethod(r); - return this.context.allowYield = n, this.finalize(e, new o.FunctionExpression(null, r.params, i, t)); - }, e.prototype.isStartOfExpression = function() { - var e = !0, t = this.lookahead.value; - switch (this.lookahead.type) { - case 7: - e = t === `[` || t === `(` || t === `{` || t === `+` || t === `-` || t === `!` || t === `~` || t === `++` || t === `--` || t === `/` || t === `/=`; - break; - case 4: - e = t === `class` || t === `delete` || t === `function` || t === `let` || t === `new` || t === `super` || t === `this` || t === `typeof` || t === `void` || t === `yield`; - break; - default: break; - } - return e; - }, e.prototype.parseYieldExpression = function() { - var e = this.createNode(); - this.expectKeyword(`yield`); - var t = null, n = !1; - if (!this.hasLineTerminator) { - var r = this.context.allowYield; - this.context.allowYield = !1, n = this.match(`*`), n ? (this.nextToken(), t = this.parseAssignmentExpression()) : this.isStartOfExpression() && (t = this.parseAssignmentExpression()), this.context.allowYield = r; - } - return this.finalize(e, new o.YieldExpression(t, n)); - }, e.prototype.parseClassElement = function(e) { - var t = this.lookahead, n = this.createNode(), r = ``, i = null, s = null, c = !1, l = !1, u = !1, d = !1; - if (this.match(`*`)) this.nextToken(); - else if (c = this.match(`[`), i = this.parseObjectPropertyKey(), i.name === `static` && (this.qualifiedPropertyName(this.lookahead) || this.match(`*`)) && (t = this.lookahead, u = !0, c = this.match(`[`), this.match(`*`) ? this.nextToken() : i = this.parseObjectPropertyKey()), t.type === 3 && !this.hasLineTerminator && t.value === `async`) { - var f = this.lookahead.value; - f !== `:` && f !== `(` && f !== `*` && (d = !0, t = this.lookahead, i = this.parseObjectPropertyKey(), t.type === 3 && t.value === `constructor` && this.tolerateUnexpectedToken(t, a.Messages.ConstructorIsAsync)); - } - var p = this.qualifiedPropertyName(this.lookahead); - return t.type === 3 ? t.value === `get` && p ? (r = `get`, c = this.match(`[`), i = this.parseObjectPropertyKey(), this.context.allowYield = !1, s = this.parseGetterMethod()) : t.value === `set` && p && (r = `set`, c = this.match(`[`), i = this.parseObjectPropertyKey(), s = this.parseSetterMethod()) : t.type === 7 && t.value === `*` && p && (r = `init`, c = this.match(`[`), i = this.parseObjectPropertyKey(), s = this.parseGeneratorMethod(), l = !0), !r && i && this.match(`(`) && (r = `init`, s = d ? this.parsePropertyMethodAsyncFunction() : this.parsePropertyMethodFunction(), l = !0), r || this.throwUnexpectedToken(this.lookahead), r === `init` && (r = `method`), c || (u && this.isPropertyKey(i, `prototype`) && this.throwUnexpectedToken(t, a.Messages.StaticPrototype), !u && this.isPropertyKey(i, `constructor`) && ((r !== `method` || !l || s && s.generator) && this.throwUnexpectedToken(t, a.Messages.ConstructorSpecialMethod), e.value ? this.throwUnexpectedToken(t, a.Messages.DuplicateConstructor) : e.value = !0, r = `constructor`)), this.finalize(n, new o.MethodDefinition(i, c, s, r, u)); - }, e.prototype.parseClassElementList = function() { - var e = [], t = { value: !1 }; - for (this.expect(`{`); !this.match(`}`);) this.match(`;`) ? this.nextToken() : e.push(this.parseClassElement(t)); - return this.expect(`}`), e; - }, e.prototype.parseClassBody = function() { - var e = this.createNode(), t = this.parseClassElementList(); - return this.finalize(e, new o.ClassBody(t)); - }, e.prototype.parseClassDeclaration = function(e) { - var t = this.createNode(), n = this.context.strict; - this.context.strict = !0, this.expectKeyword(`class`); - var r = e && this.lookahead.type !== 3 ? null : this.parseVariableIdentifier(), i = null; - this.matchKeyword(`extends`) && (this.nextToken(), i = this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall)); - var a = this.parseClassBody(); - return this.context.strict = n, this.finalize(t, new o.ClassDeclaration(r, i, a)); - }, e.prototype.parseClassExpression = function() { - var e = this.createNode(), t = this.context.strict; - this.context.strict = !0, this.expectKeyword(`class`); - var n = this.lookahead.type === 3 ? this.parseVariableIdentifier() : null, r = null; - this.matchKeyword(`extends`) && (this.nextToken(), r = this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall)); - var i = this.parseClassBody(); - return this.context.strict = t, this.finalize(e, new o.ClassExpression(n, r, i)); - }, e.prototype.parseModule = function() { - this.context.strict = !0, this.context.isModule = !0, this.scanner.isModule = !0; - for (var e = this.createNode(), t = this.parseDirectivePrologues(); this.lookahead.type !== 2;) t.push(this.parseStatementListItem()); - return this.finalize(e, new o.Module(t)); - }, e.prototype.parseScript = function() { - for (var e = this.createNode(), t = this.parseDirectivePrologues(); this.lookahead.type !== 2;) t.push(this.parseStatementListItem()); - return this.finalize(e, new o.Script(t)); - }, e.prototype.parseModuleSpecifier = function() { - var e = this.createNode(); - this.lookahead.type !== 8 && this.throwError(a.Messages.InvalidModuleSpecifier); - var t = this.nextToken(), n = this.getTokenRaw(t); - return this.finalize(e, new o.Literal(t.value, n)); - }, e.prototype.parseImportSpecifier = function() { - var e = this.createNode(), t, n; - return this.lookahead.type === 3 ? (t = this.parseVariableIdentifier(), n = t, this.matchContextualKeyword(`as`) && (this.nextToken(), n = this.parseVariableIdentifier())) : (t = this.parseIdentifierName(), n = t, this.matchContextualKeyword(`as`) ? (this.nextToken(), n = this.parseVariableIdentifier()) : this.throwUnexpectedToken(this.nextToken())), this.finalize(e, new o.ImportSpecifier(n, t)); - }, e.prototype.parseNamedImports = function() { - this.expect(`{`); - for (var e = []; !this.match(`}`);) e.push(this.parseImportSpecifier()), this.match(`}`) || this.expect(`,`); - return this.expect(`}`), e; - }, e.prototype.parseImportDefaultSpecifier = function() { - var e = this.createNode(), t = this.parseIdentifierName(); - return this.finalize(e, new o.ImportDefaultSpecifier(t)); - }, e.prototype.parseImportNamespaceSpecifier = function() { - var e = this.createNode(); - this.expect(`*`), this.matchContextualKeyword(`as`) || this.throwError(a.Messages.NoAsAfterImportNamespace), this.nextToken(); - var t = this.parseIdentifierName(); - return this.finalize(e, new o.ImportNamespaceSpecifier(t)); - }, e.prototype.parseImportDeclaration = function() { - this.context.inFunctionBody && this.throwError(a.Messages.IllegalImportDeclaration); - var e = this.createNode(); - this.expectKeyword(`import`); - var t, n = []; - if (this.lookahead.type === 8) t = this.parseModuleSpecifier(); - else { - if (this.match(`{`) ? n = n.concat(this.parseNamedImports()) : this.match(`*`) ? n.push(this.parseImportNamespaceSpecifier()) : this.isIdentifierName(this.lookahead) && !this.matchKeyword(`default`) ? (n.push(this.parseImportDefaultSpecifier()), this.match(`,`) && (this.nextToken(), this.match(`*`) ? n.push(this.parseImportNamespaceSpecifier()) : this.match(`{`) ? n = n.concat(this.parseNamedImports()) : this.throwUnexpectedToken(this.lookahead))) : this.throwUnexpectedToken(this.nextToken()), !this.matchContextualKeyword(`from`)) { - var r = this.lookahead.value ? a.Messages.UnexpectedToken : a.Messages.MissingFromClause; - this.throwError(r, this.lookahead.value); - } - this.nextToken(), t = this.parseModuleSpecifier(); - } - return this.consumeSemicolon(), this.finalize(e, new o.ImportDeclaration(n, t)); - }, e.prototype.parseExportSpecifier = function() { - var e = this.createNode(), t = this.parseIdentifierName(), n = t; - return this.matchContextualKeyword(`as`) && (this.nextToken(), n = this.parseIdentifierName()), this.finalize(e, new o.ExportSpecifier(t, n)); - }, e.prototype.parseExportDeclaration = function() { - this.context.inFunctionBody && this.throwError(a.Messages.IllegalExportDeclaration); - var e = this.createNode(); - this.expectKeyword(`export`); - var t; - if (this.matchKeyword(`default`)) if (this.nextToken(), this.matchKeyword(`function`)) { - var n = this.parseFunctionDeclaration(!0); - t = this.finalize(e, new o.ExportDefaultDeclaration(n)); - } else if (this.matchKeyword(`class`)) { - var n = this.parseClassDeclaration(!0); - t = this.finalize(e, new o.ExportDefaultDeclaration(n)); - } else if (this.matchContextualKeyword(`async`)) { - var n = this.matchAsyncFunction() ? this.parseFunctionDeclaration(!0) : this.parseAssignmentExpression(); - t = this.finalize(e, new o.ExportDefaultDeclaration(n)); - } else { - this.matchContextualKeyword(`from`) && this.throwError(a.Messages.UnexpectedToken, this.lookahead.value); - var n = this.match(`{`) ? this.parseObjectInitializer() : this.match(`[`) ? this.parseArrayInitializer() : this.parseAssignmentExpression(); - this.consumeSemicolon(), t = this.finalize(e, new o.ExportDefaultDeclaration(n)); - } - else if (this.match(`*`)) { - if (this.nextToken(), !this.matchContextualKeyword(`from`)) { - var r = this.lookahead.value ? a.Messages.UnexpectedToken : a.Messages.MissingFromClause; - this.throwError(r, this.lookahead.value); - } - this.nextToken(); - var i = this.parseModuleSpecifier(); - this.consumeSemicolon(), t = this.finalize(e, new o.ExportAllDeclaration(i)); - } else if (this.lookahead.type === 4) { - var n = void 0; - switch (this.lookahead.value) { - case `let`: - case `const`: - n = this.parseLexicalDeclaration({ inFor: !1 }); - break; - case `var`: - case `class`: - case `function`: - n = this.parseStatementListItem(); - break; - default: this.throwUnexpectedToken(this.lookahead); - } - t = this.finalize(e, new o.ExportNamedDeclaration(n, [], null)); - } else if (this.matchAsyncFunction()) { - var n = this.parseFunctionDeclaration(); - t = this.finalize(e, new o.ExportNamedDeclaration(n, [], null)); - } else { - var s = [], c = null, l = !1; - for (this.expect(`{`); !this.match(`}`);) l ||= this.matchKeyword(`default`), s.push(this.parseExportSpecifier()), this.match(`}`) || this.expect(`,`); - if (this.expect(`}`), this.matchContextualKeyword(`from`)) this.nextToken(), c = this.parseModuleSpecifier(), this.consumeSemicolon(); - else if (l) { - var r = this.lookahead.value ? a.Messages.UnexpectedToken : a.Messages.MissingFromClause; - this.throwError(r, this.lookahead.value); - } else this.consumeSemicolon(); - t = this.finalize(e, new o.ExportNamedDeclaration(null, s, c)); - } - return t; - }, e; - }(); - }, - function(e, t) { - Object.defineProperty(t, "__esModule", { value: !0 }); - function n(e, t) { - if (!e) throw Error(`ASSERT: ` + t); - } - t.assert = n; - }, - function(e, t) { - Object.defineProperty(t, "__esModule", { value: !0 }), t.ErrorHandler = function() { - function e() { - this.errors = [], this.tolerant = !1; - } - return e.prototype.recordError = function(e) { - this.errors.push(e); - }, e.prototype.tolerate = function(e) { - if (this.tolerant) this.recordError(e); - else throw e; - }, e.prototype.constructError = function(e, t) { - var n = Error(e); - try { - throw n; - } catch (e) { - Object.create && Object.defineProperty && (n = Object.create(e), Object.defineProperty(n, "column", { value: t })); - } - return n; - }, e.prototype.createError = function(e, t, n, r) { - var i = `Line ` + t + `: ` + r, a = this.constructError(i, n); - return a.index = e, a.lineNumber = t, a.description = r, a; - }, e.prototype.throwError = function(e, t, n, r) { - throw this.createError(e, t, n, r); - }, e.prototype.tolerateError = function(e, t, n, r) { - var i = this.createError(e, t, n, r); - if (this.tolerant) this.recordError(i); - else throw i; - }, e; - }(); - }, - function(e, t) { - Object.defineProperty(t, "__esModule", { value: !0 }), t.Messages = { - BadGetterArity: `Getter must not have any formal parameters`, - BadSetterArity: `Setter must have exactly one formal parameter`, - BadSetterRestParameter: `Setter function argument must not be a rest parameter`, - ConstructorIsAsync: `Class constructor may not be an async method`, - ConstructorSpecialMethod: `Class constructor may not be an accessor`, - DeclarationMissingInitializer: `Missing initializer in %0 declaration`, - DefaultRestParameter: `Unexpected token =`, - DuplicateBinding: `Duplicate binding %0`, - DuplicateConstructor: `A class may only have one constructor`, - DuplicateProtoProperty: `Duplicate __proto__ fields are not allowed in object literals`, - ForInOfLoopInitializer: `%0 loop variable declaration may not have an initializer`, - GeneratorInLegacyContext: `Generator declarations are not allowed in legacy contexts`, - IllegalBreak: `Illegal break statement`, - IllegalContinue: `Illegal continue statement`, - IllegalExportDeclaration: `Unexpected token`, - IllegalImportDeclaration: `Unexpected token`, - IllegalLanguageModeDirective: `Illegal 'use strict' directive in function with non-simple parameter list`, - IllegalReturn: `Illegal return statement`, - InvalidEscapedReservedWord: `Keyword must not contain escaped characters`, - InvalidHexEscapeSequence: `Invalid hexadecimal escape sequence`, - InvalidLHSInAssignment: `Invalid left-hand side in assignment`, - InvalidLHSInForIn: `Invalid left-hand side in for-in`, - InvalidLHSInForLoop: `Invalid left-hand side in for-loop`, - InvalidModuleSpecifier: `Unexpected token`, - InvalidRegExp: `Invalid regular expression`, - LetInLexicalBinding: `let is disallowed as a lexically bound name`, - MissingFromClause: `Unexpected token`, - MultipleDefaultsInSwitch: `More than one default clause in switch statement`, - NewlineAfterThrow: `Illegal newline after throw`, - NoAsAfterImportNamespace: `Unexpected token`, - NoCatchOrFinally: `Missing catch or finally after try`, - ParameterAfterRestParameter: `Rest parameter must be last formal parameter`, - Redeclaration: `%0 '%1' has already been declared`, - StaticPrototype: `Classes may not have static property named prototype`, - StrictCatchVariable: `Catch variable may not be eval or arguments in strict mode`, - StrictDelete: `Delete of an unqualified identifier in strict mode.`, - StrictFunction: `In strict mode code, functions can only be declared at top level or inside a block`, - StrictFunctionName: `Function name may not be eval or arguments in strict mode`, - StrictLHSAssignment: `Assignment to eval or arguments is not allowed in strict mode`, - StrictLHSPostfix: `Postfix increment/decrement may not have eval or arguments operand in strict mode`, - StrictLHSPrefix: `Prefix increment/decrement may not have eval or arguments operand in strict mode`, - StrictModeWith: `Strict mode code may not include a with statement`, - StrictOctalLiteral: `Octal literals are not allowed in strict mode.`, - StrictParamDupe: `Strict mode function may not have duplicate parameter names`, - StrictParamName: `Parameter name eval or arguments is not allowed in strict mode`, - StrictReservedWord: `Use of future reserved word in strict mode`, - StrictVarName: `Variable name may not be eval or arguments in strict mode`, - TemplateOctalLiteral: `Octal literals are not allowed in template strings.`, - UnexpectedEOS: `Unexpected end of input`, - UnexpectedIdentifier: `Unexpected identifier`, - UnexpectedNumber: `Unexpected number`, - UnexpectedReserved: `Unexpected reserved word`, - UnexpectedString: `Unexpected string`, - UnexpectedTemplate: `Unexpected quasi %0`, - UnexpectedToken: `Unexpected token %0`, - UnexpectedTokenIllegal: `Unexpected token ILLEGAL`, - UnknownLabel: `Undefined label '%0'`, - UnterminatedRegExp: `Invalid regular expression: missing /` - }; - }, - function(e, t, n) { - Object.defineProperty(t, "__esModule", { value: !0 }); - var r = n(9), i = n(4), a = n(11); - function o(e) { - return `0123456789abcdef`.indexOf(e.toLowerCase()); - } - function s(e) { - return `01234567`.indexOf(e); - } - t.Scanner = function() { - function e(e, t) { - this.source = e, this.errorHandler = t, this.trackComment = !1, this.isModule = !1, this.length = e.length, this.index = 0, this.lineNumber = +(e.length > 0), this.lineStart = 0, this.curlyStack = []; - } - return e.prototype.saveState = function() { - return { - index: this.index, - lineNumber: this.lineNumber, - lineStart: this.lineStart - }; - }, e.prototype.restoreState = function(e) { - this.index = e.index, this.lineNumber = e.lineNumber, this.lineStart = e.lineStart; - }, e.prototype.eof = function() { - return this.index >= this.length; - }, e.prototype.throwUnexpectedToken = function(e) { - return e === void 0 && (e = a.Messages.UnexpectedTokenIllegal), this.errorHandler.throwError(this.index, this.lineNumber, this.index - this.lineStart + 1, e); - }, e.prototype.tolerateUnexpectedToken = function(e) { - e === void 0 && (e = a.Messages.UnexpectedTokenIllegal), this.errorHandler.tolerateError(this.index, this.lineNumber, this.index - this.lineStart + 1, e); - }, e.prototype.skipSingleLineComment = function(e) { - var t = [], n, r; - for (this.trackComment && (t = [], n = this.index - e, r = { - start: { - line: this.lineNumber, - column: this.index - this.lineStart - e - }, - end: {} - }); !this.eof();) { - var a = this.source.charCodeAt(this.index); - if (++this.index, i.Character.isLineTerminator(a)) { - if (this.trackComment) { - r.end = { - line: this.lineNumber, - column: this.index - this.lineStart - 1 - }; - var o = { - multiLine: !1, - slice: [n + e, this.index - 1], - range: [n, this.index - 1], - loc: r - }; - t.push(o); - } - return a === 13 && this.source.charCodeAt(this.index) === 10 && ++this.index, ++this.lineNumber, this.lineStart = this.index, t; - } - } - if (this.trackComment) { - r.end = { - line: this.lineNumber, - column: this.index - this.lineStart - }; - var o = { - multiLine: !1, - slice: [n + e, this.index], - range: [n, this.index], - loc: r - }; - t.push(o); - } - return t; - }, e.prototype.skipMultiLineComment = function() { - var e = [], t, n; - for (this.trackComment && (e = [], t = this.index - 2, n = { - start: { - line: this.lineNumber, - column: this.index - this.lineStart - 2 - }, - end: {} - }); !this.eof();) { - var r = this.source.charCodeAt(this.index); - if (i.Character.isLineTerminator(r)) r === 13 && this.source.charCodeAt(this.index + 1) === 10 && ++this.index, ++this.lineNumber, ++this.index, this.lineStart = this.index; - else if (r === 42) { - if (this.source.charCodeAt(this.index + 1) === 47) { - if (this.index += 2, this.trackComment) { - n.end = { - line: this.lineNumber, - column: this.index - this.lineStart - }; - var a = { - multiLine: !0, - slice: [t + 2, this.index - 2], - range: [t, this.index], - loc: n - }; - e.push(a); - } - return e; - } - ++this.index; - } else ++this.index; - } - if (this.trackComment) { - n.end = { - line: this.lineNumber, - column: this.index - this.lineStart - }; - var a = { - multiLine: !0, - slice: [t + 2, this.index], - range: [t, this.index], - loc: n - }; - e.push(a); - } - return this.tolerateUnexpectedToken(), e; - }, e.prototype.scanComments = function() { - var e; - this.trackComment && (e = []); - for (var t = this.index === 0; !this.eof();) { - var n = this.source.charCodeAt(this.index); - if (i.Character.isWhiteSpace(n)) ++this.index; - else if (i.Character.isLineTerminator(n)) ++this.index, n === 13 && this.source.charCodeAt(this.index) === 10 && ++this.index, ++this.lineNumber, this.lineStart = this.index, t = !0; - else if (n === 47) if (n = this.source.charCodeAt(this.index + 1), n === 47) { - this.index += 2; - var r = this.skipSingleLineComment(2); - this.trackComment && (e = e.concat(r)), t = !0; - } else if (n === 42) { - this.index += 2; - var r = this.skipMultiLineComment(); - this.trackComment && (e = e.concat(r)); - } else break; - else if (t && n === 45) if (this.source.charCodeAt(this.index + 1) === 45 && this.source.charCodeAt(this.index + 2) === 62) { - this.index += 3; - var r = this.skipSingleLineComment(3); - this.trackComment && (e = e.concat(r)); - } else break; - else if (n === 60 && !this.isModule) if (this.source.slice(this.index + 1, this.index + 4) === `!--`) { - this.index += 4; - var r = this.skipSingleLineComment(4); - this.trackComment && (e = e.concat(r)); - } else break; - else break; - } - return e; - }, e.prototype.isFutureReservedWord = function(e) { - switch (e) { - case `enum`: - case `export`: - case `import`: - case `super`: return !0; - default: return !1; - } - }, e.prototype.isStrictModeReservedWord = function(e) { - switch (e) { - case `implements`: - case `interface`: - case `package`: - case `private`: - case `protected`: - case `public`: - case `static`: - case `yield`: - case `let`: return !0; - default: return !1; - } - }, e.prototype.isRestrictedWord = function(e) { - return e === `eval` || e === `arguments`; - }, e.prototype.isKeyword = function(e) { - switch (e.length) { - case 2: return e === `if` || e === `in` || e === `do`; - case 3: return e === `var` || e === `for` || e === `new` || e === `try` || e === `let`; - case 4: return e === `this` || e === `else` || e === `case` || e === `void` || e === `with` || e === `enum`; - case 5: return e === `while` || e === `break` || e === `catch` || e === `throw` || e === `const` || e === `yield` || e === `class` || e === `super`; - case 6: return e === `return` || e === `typeof` || e === `delete` || e === `switch` || e === `export` || e === `import`; - case 7: return e === "default" || e === `finally` || e === `extends`; - case 8: return e === `function` || e === `continue` || e === `debugger`; - case 10: return e === `instanceof`; - default: return !1; - } - }, e.prototype.codePointAt = function(e) { - var t = this.source.charCodeAt(e); - if (t >= 55296 && t <= 56319) { - var n = this.source.charCodeAt(e + 1); - n >= 56320 && n <= 57343 && (t = (t - 55296) * 1024 + n - 56320 + 65536); - } - return t; - }, e.prototype.scanHexEscape = function(e) { - for (var t = e === `u` ? 4 : 2, n = 0, r = 0; r < t; ++r) if (!this.eof() && i.Character.isHexDigit(this.source.charCodeAt(this.index))) n = n * 16 + o(this.source[this.index++]); - else return null; - return String.fromCharCode(n); - }, e.prototype.scanUnicodeCodePointEscape = function() { - var e = this.source[this.index], t = 0; - for (e === `}` && this.throwUnexpectedToken(); !this.eof() && (e = this.source[this.index++], i.Character.isHexDigit(e.charCodeAt(0)));) t = t * 16 + o(e); - return (t > 1114111 || e !== `}`) && this.throwUnexpectedToken(), i.Character.fromCodePoint(t); - }, e.prototype.getIdentifier = function() { - for (var e = this.index++; !this.eof();) { - var t = this.source.charCodeAt(this.index); - if (t === 92 || t >= 55296 && t < 57343) return this.index = e, this.getComplexIdentifier(); - if (i.Character.isIdentifierPart(t)) ++this.index; - else break; - } - return this.source.slice(e, this.index); - }, e.prototype.getComplexIdentifier = function() { - var e = this.codePointAt(this.index), t = i.Character.fromCodePoint(e); - this.index += t.length; - var n; - for (e === 92 && (this.source.charCodeAt(this.index) !== 117 && this.throwUnexpectedToken(), ++this.index, this.source[this.index] === `{` ? (++this.index, n = this.scanUnicodeCodePointEscape()) : (n = this.scanHexEscape(`u`), (n === null || n === `\\` || !i.Character.isIdentifierStart(n.charCodeAt(0))) && this.throwUnexpectedToken()), t = n); !this.eof() && (e = this.codePointAt(this.index), i.Character.isIdentifierPart(e));) n = i.Character.fromCodePoint(e), t += n, this.index += n.length, e === 92 && (t = t.substr(0, t.length - 1), this.source.charCodeAt(this.index) !== 117 && this.throwUnexpectedToken(), ++this.index, this.source[this.index] === `{` ? (++this.index, n = this.scanUnicodeCodePointEscape()) : (n = this.scanHexEscape(`u`), (n === null || n === `\\` || !i.Character.isIdentifierPart(n.charCodeAt(0))) && this.throwUnexpectedToken()), t += n); - return t; - }, e.prototype.octalToDecimal = function(e) { - var t = e !== `0`, n = s(e); - return !this.eof() && i.Character.isOctalDigit(this.source.charCodeAt(this.index)) && (t = !0, n = n * 8 + s(this.source[this.index++]), `0123`.indexOf(e) >= 0 && !this.eof() && i.Character.isOctalDigit(this.source.charCodeAt(this.index)) && (n = n * 8 + s(this.source[this.index++]))), { - code: n, - octal: t - }; - }, e.prototype.scanIdentifier = function() { - var e, t = this.index, n = this.source.charCodeAt(t) === 92 ? this.getComplexIdentifier() : this.getIdentifier(); - if (e = n.length === 1 ? 3 : this.isKeyword(n) ? 4 : n === `null` ? 5 : n === `true` || n === `false` ? 1 : 3, e !== 3 && t + n.length !== this.index) { - var r = this.index; - this.index = t, this.tolerateUnexpectedToken(a.Messages.InvalidEscapedReservedWord), this.index = r; - } - return { - type: e, - value: n, - lineNumber: this.lineNumber, - lineStart: this.lineStart, - start: t, - end: this.index - }; - }, e.prototype.scanPunctuator = function() { - var e = this.index, t = this.source[this.index]; - switch (t) { - case `(`: - case `{`: - t === `{` && this.curlyStack.push(`{`), ++this.index; - break; - case `.`: - ++this.index, this.source[this.index] === `.` && this.source[this.index + 1] === `.` && (this.index += 2, t = `...`); - break; - case `}`: - ++this.index, this.curlyStack.pop(); - break; - case `)`: - case `;`: - case `,`: - case `[`: - case `]`: - case `:`: - case `?`: - case `~`: - ++this.index; - break; - default: t = this.source.substr(this.index, 4), t === `>>>=` ? this.index += 4 : (t = t.substr(0, 3), t === `===` || t === `!==` || t === `>>>` || t === `<<=` || t === `>>=` || t === `**=` ? this.index += 3 : (t = t.substr(0, 2), t === `&&` || t === `||` || t === `==` || t === `!=` || t === `+=` || t === `-=` || t === `*=` || t === `/=` || t === `++` || t === `--` || t === `<<` || t === `>>` || t === `&=` || t === `|=` || t === `^=` || t === `%=` || t === `<=` || t === `>=` || t === `=>` || t === `**` ? this.index += 2 : (t = this.source[this.index], `<>=!+-*%&|^/`.indexOf(t) >= 0 && ++this.index))); - } - return this.index === e && this.throwUnexpectedToken(), { - type: 7, - value: t, - lineNumber: this.lineNumber, - lineStart: this.lineStart, - start: e, - end: this.index - }; - }, e.prototype.scanHexLiteral = function(e) { - for (var t = ``; !this.eof() && i.Character.isHexDigit(this.source.charCodeAt(this.index));) t += this.source[this.index++]; - return t.length === 0 && this.throwUnexpectedToken(), i.Character.isIdentifierStart(this.source.charCodeAt(this.index)) && this.throwUnexpectedToken(), { - type: 6, - value: parseInt(`0x` + t, 16), - lineNumber: this.lineNumber, - lineStart: this.lineStart, - start: e, - end: this.index - }; - }, e.prototype.scanBinaryLiteral = function(e) { - for (var t = ``, n; !this.eof() && (n = this.source[this.index], !(n !== `0` && n !== `1`));) t += this.source[this.index++]; - return t.length === 0 && this.throwUnexpectedToken(), this.eof() || (n = this.source.charCodeAt(this.index), (i.Character.isIdentifierStart(n) || i.Character.isDecimalDigit(n)) && this.throwUnexpectedToken()), { - type: 6, - value: parseInt(t, 2), - lineNumber: this.lineNumber, - lineStart: this.lineStart, - start: e, - end: this.index - }; - }, e.prototype.scanOctalLiteral = function(e, t) { - var n = ``, r = !1; - for (i.Character.isOctalDigit(e.charCodeAt(0)) ? (r = !0, n = `0` + this.source[this.index++]) : ++this.index; !this.eof() && i.Character.isOctalDigit(this.source.charCodeAt(this.index));) n += this.source[this.index++]; - return !r && n.length === 0 && this.throwUnexpectedToken(), (i.Character.isIdentifierStart(this.source.charCodeAt(this.index)) || i.Character.isDecimalDigit(this.source.charCodeAt(this.index))) && this.throwUnexpectedToken(), { - type: 6, - value: parseInt(n, 8), - octal: r, - lineNumber: this.lineNumber, - lineStart: this.lineStart, - start: t, - end: this.index - }; - }, e.prototype.isImplicitOctalLiteral = function() { - for (var e = this.index + 1; e < this.length; ++e) { - var t = this.source[e]; - if (t === `8` || t === `9`) return !1; - if (!i.Character.isOctalDigit(t.charCodeAt(0))) return !0; - } - return !0; - }, e.prototype.scanNumericLiteral = function() { - var e = this.index, t = this.source[e]; - r.assert(i.Character.isDecimalDigit(t.charCodeAt(0)) || t === `.`, `Numeric literal must start with a decimal digit or a decimal point`); - var n = ``; - if (t !== `.`) { - if (n = this.source[this.index++], t = this.source[this.index], n === `0`) { - if (t === `x` || t === `X`) return ++this.index, this.scanHexLiteral(e); - if (t === `b` || t === `B`) return ++this.index, this.scanBinaryLiteral(e); - if (t === `o` || t === `O` || t && i.Character.isOctalDigit(t.charCodeAt(0)) && this.isImplicitOctalLiteral()) return this.scanOctalLiteral(t, e); - } - for (; i.Character.isDecimalDigit(this.source.charCodeAt(this.index));) n += this.source[this.index++]; - t = this.source[this.index]; - } - if (t === `.`) { - for (n += this.source[this.index++]; i.Character.isDecimalDigit(this.source.charCodeAt(this.index));) n += this.source[this.index++]; - t = this.source[this.index]; - } - if (t === `e` || t === `E`) if (n += this.source[this.index++], t = this.source[this.index], (t === `+` || t === `-`) && (n += this.source[this.index++]), i.Character.isDecimalDigit(this.source.charCodeAt(this.index))) for (; i.Character.isDecimalDigit(this.source.charCodeAt(this.index));) n += this.source[this.index++]; - else this.throwUnexpectedToken(); - return i.Character.isIdentifierStart(this.source.charCodeAt(this.index)) && this.throwUnexpectedToken(), { - type: 6, - value: parseFloat(n), - lineNumber: this.lineNumber, - lineStart: this.lineStart, - start: e, - end: this.index - }; - }, e.prototype.scanStringLiteral = function() { - var e = this.index, t = this.source[e]; - r.assert(t === `'` || t === `"`, `String literal must starts with a quote`), ++this.index; - for (var n = !1, o = ``; !this.eof();) { - var s = this.source[this.index++]; - if (s === t) { - t = ``; - break; - } else if (s === `\\`) if (s = this.source[this.index++], !s || !i.Character.isLineTerminator(s.charCodeAt(0))) switch (s) { - case `u`: - if (this.source[this.index] === `{`) ++this.index, o += this.scanUnicodeCodePointEscape(); - else { - var c = this.scanHexEscape(s); - c === null && this.throwUnexpectedToken(), o += c; - } - break; - case `x`: - var l = this.scanHexEscape(s); - l === null && this.throwUnexpectedToken(a.Messages.InvalidHexEscapeSequence), o += l; - break; - case `n`: - o += ` -`; - break; - case `r`: - o += `\r`; - break; - case `t`: - o += ` `; - break; - case `b`: - o += `\b`; - break; - case `f`: - o += `\f`; - break; - case `v`: - o += `\v`; - break; - case `8`: - case `9`: - o += s, this.tolerateUnexpectedToken(); - break; - default: - if (s && i.Character.isOctalDigit(s.charCodeAt(0))) { - var u = this.octalToDecimal(s); - n = u.octal || n, o += String.fromCharCode(u.code); - } else o += s; - break; - } - else ++this.lineNumber, s === `\r` && this.source[this.index] === ` -` && ++this.index, this.lineStart = this.index; - else if (i.Character.isLineTerminator(s.charCodeAt(0))) break; - else o += s; - } - return t !== `` && (this.index = e, this.throwUnexpectedToken()), { - type: 8, - value: o, - octal: n, - lineNumber: this.lineNumber, - lineStart: this.lineStart, - start: e, - end: this.index - }; - }, e.prototype.scanTemplate = function() { - var e = ``, t = !1, n = this.index, r = this.source[n] === "`", o = !1, s = 2; - for (++this.index; !this.eof();) { - var c = this.source[this.index++]; - if (c === "`") { - s = 1, o = !0, t = !0; - break; - } else if (c === `$`) { - if (this.source[this.index] === `{`) { - this.curlyStack.push("${"), ++this.index, t = !0; - break; - } - e += c; - } else if (c === `\\`) if (c = this.source[this.index++], i.Character.isLineTerminator(c.charCodeAt(0))) ++this.lineNumber, c === `\r` && this.source[this.index] === ` -` && ++this.index, this.lineStart = this.index; - else switch (c) { - case `n`: - e += ` -`; - break; - case `r`: - e += `\r`; - break; - case `t`: - e += ` `; - break; - case `u`: - if (this.source[this.index] === `{`) ++this.index, e += this.scanUnicodeCodePointEscape(); - else { - var l = this.index, u = this.scanHexEscape(c); - u === null ? (this.index = l, e += c) : e += u; - } - break; - case `x`: - var d = this.scanHexEscape(c); - d === null && this.throwUnexpectedToken(a.Messages.InvalidHexEscapeSequence), e += d; - break; - case `b`: - e += `\b`; - break; - case `f`: - e += `\f`; - break; - case `v`: - e += `\v`; - break; - default: - c === `0` ? (i.Character.isDecimalDigit(this.source.charCodeAt(this.index)) && this.throwUnexpectedToken(a.Messages.TemplateOctalLiteral), e += `\0`) : i.Character.isOctalDigit(c.charCodeAt(0)) ? this.throwUnexpectedToken(a.Messages.TemplateOctalLiteral) : e += c; - break; - } - else i.Character.isLineTerminator(c.charCodeAt(0)) ? (++this.lineNumber, c === `\r` && this.source[this.index] === ` -` && ++this.index, this.lineStart = this.index, e += ` -`) : e += c; - } - return t || this.throwUnexpectedToken(), r || this.curlyStack.pop(), { - type: 10, - value: this.source.slice(n + 1, this.index - s), - cooked: e, - head: r, - tail: o, - lineNumber: this.lineNumber, - lineStart: this.lineStart, - start: n, - end: this.index - }; - }, e.prototype.testRegExp = function(e, t) { - var n = `￿`, r = e, i = this; - t.indexOf(`u`) >= 0 && (r = r.replace(/\\u\{([0-9a-fA-F]+)\}|\\u([a-fA-F0-9]{4})/g, function(e, t, r) { - var o = parseInt(t || r, 16); - return o > 1114111 && i.throwUnexpectedToken(a.Messages.InvalidRegExp), o <= 65535 ? String.fromCharCode(o) : n; - }).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, n)); - try { - RegExp(r); - } catch { - this.throwUnexpectedToken(a.Messages.InvalidRegExp); - } - try { - return new RegExp(e, t); - } catch { - return null; - } - }, e.prototype.scanRegExpBody = function() { - var e = this.source[this.index]; - r.assert(e === `/`, `Regular expression literal must start with a slash`); - for (var t = this.source[this.index++], n = !1, o = !1; !this.eof();) if (e = this.source[this.index++], t += e, e === `\\`) e = this.source[this.index++], i.Character.isLineTerminator(e.charCodeAt(0)) && this.throwUnexpectedToken(a.Messages.UnterminatedRegExp), t += e; - else if (i.Character.isLineTerminator(e.charCodeAt(0))) this.throwUnexpectedToken(a.Messages.UnterminatedRegExp); - else if (n) e === `]` && (n = !1); - else if (e === `/`) { - o = !0; - break; - } else e === `[` && (n = !0); - return o || this.throwUnexpectedToken(a.Messages.UnterminatedRegExp), t.substr(1, t.length - 2); - }, e.prototype.scanRegExpFlags = function() { - for (var e = ``, t = ``; !this.eof();) { - var n = this.source[this.index]; - if (!i.Character.isIdentifierPart(n.charCodeAt(0))) break; - if (++this.index, n === `\\` && !this.eof()) if (n = this.source[this.index], n === `u`) { - ++this.index; - var r = this.index, a = this.scanHexEscape(`u`); - if (a !== null) for (t += a, e += `\\u`; r < this.index; ++r) e += this.source[r]; - else this.index = r, t += `u`, e += `\\u`; - this.tolerateUnexpectedToken(); - } else e += `\\`, this.tolerateUnexpectedToken(); - else t += n, e += n; - } - return t; - }, e.prototype.scanRegExp = function() { - var e = this.index, t = this.scanRegExpBody(), n = this.scanRegExpFlags(); - return { - type: 9, - value: ``, - pattern: t, - flags: n, - regex: this.testRegExp(t, n), - lineNumber: this.lineNumber, - lineStart: this.lineStart, - start: e, - end: this.index - }; - }, e.prototype.lex = function() { - if (this.eof()) return { - type: 2, - value: ``, - lineNumber: this.lineNumber, - lineStart: this.lineStart, - start: this.index, - end: this.index - }; - var e = this.source.charCodeAt(this.index); - return i.Character.isIdentifierStart(e) ? this.scanIdentifier() : e === 40 || e === 41 || e === 59 ? this.scanPunctuator() : e === 39 || e === 34 ? this.scanStringLiteral() : e === 46 ? i.Character.isDecimalDigit(this.source.charCodeAt(this.index + 1)) ? this.scanNumericLiteral() : this.scanPunctuator() : i.Character.isDecimalDigit(e) ? this.scanNumericLiteral() : e === 96 || e === 125 && this.curlyStack[this.curlyStack.length - 1] === "${" ? this.scanTemplate() : e >= 55296 && e < 57343 && i.Character.isIdentifierStart(this.codePointAt(this.index)) ? this.scanIdentifier() : this.scanPunctuator(); - }, e; - }(); - }, - function(e, t) { - Object.defineProperty(t, "__esModule", { value: !0 }), t.TokenName = {}, t.TokenName[1] = `Boolean`, t.TokenName[2] = ``, t.TokenName[3] = `Identifier`, t.TokenName[4] = `Keyword`, t.TokenName[5] = `Null`, t.TokenName[6] = `Numeric`, t.TokenName[7] = `Punctuator`, t.TokenName[8] = `String`, t.TokenName[9] = `RegularExpression`, t.TokenName[10] = `Template`; - }, - function(e, t) { - Object.defineProperty(t, "__esModule", { value: !0 }), t.XHTMLEntities = { - quot: `"`, - amp: `&`, - apos: `'`, - gt: `>`, - nbsp: `\xA0`, - iexcl: `¡`, - cent: `¢`, - pound: `£`, - curren: `¤`, - yen: `¥`, - brvbar: `¦`, - sect: `§`, - uml: `¨`, - copy: `©`, - ordf: `ª`, - laquo: `«`, - not: `¬`, - shy: `­`, - reg: `®`, - macr: `¯`, - deg: `°`, - plusmn: `±`, - sup2: `²`, - sup3: `³`, - acute: `´`, - micro: `µ`, - para: `¶`, - middot: `·`, - cedil: `¸`, - sup1: `¹`, - ordm: `º`, - raquo: `»`, - frac14: `¼`, - frac12: `½`, - frac34: `¾`, - iquest: `¿`, - Agrave: `À`, - Aacute: `Á`, - Acirc: `Â`, - Atilde: `Ã`, - Auml: `Ä`, - Aring: `Å`, - AElig: `Æ`, - Ccedil: `Ç`, - Egrave: `È`, - Eacute: `É`, - Ecirc: `Ê`, - Euml: `Ë`, - Igrave: `Ì`, - Iacute: `Í`, - Icirc: `Î`, - Iuml: `Ï`, - ETH: `Ð`, - Ntilde: `Ñ`, - Ograve: `Ò`, - Oacute: `Ó`, - Ocirc: `Ô`, - Otilde: `Õ`, - Ouml: `Ö`, - times: `×`, - Oslash: `Ø`, - Ugrave: `Ù`, - Uacute: `Ú`, - Ucirc: `Û`, - Uuml: `Ü`, - Yacute: `Ý`, - THORN: `Þ`, - szlig: `ß`, - agrave: `à`, - aacute: `á`, - acirc: `â`, - atilde: `ã`, - auml: `ä`, - aring: `å`, - aelig: `æ`, - ccedil: `ç`, - egrave: `è`, - eacute: `é`, - ecirc: `ê`, - euml: `ë`, - igrave: `ì`, - iacute: `í`, - icirc: `î`, - iuml: `ï`, - eth: `ð`, - ntilde: `ñ`, - ograve: `ò`, - oacute: `ó`, - ocirc: `ô`, - otilde: `õ`, - ouml: `ö`, - divide: `÷`, - oslash: `ø`, - ugrave: `ù`, - uacute: `ú`, - ucirc: `û`, - uuml: `ü`, - yacute: `ý`, - thorn: `þ`, - yuml: `ÿ`, - OElig: `Œ`, - oelig: `œ`, - Scaron: `Š`, - scaron: `š`, - Yuml: `Ÿ`, - fnof: `ƒ`, - circ: `ˆ`, - tilde: `˜`, - Alpha: `Α`, - Beta: `Β`, - Gamma: `Γ`, - Delta: `Δ`, - Epsilon: `Ε`, - Zeta: `Ζ`, - Eta: `Η`, - Theta: `Θ`, - Iota: `Ι`, - Kappa: `Κ`, - Lambda: `Λ`, - Mu: `Μ`, - Nu: `Ν`, - Xi: `Ξ`, - Omicron: `Ο`, - Pi: `Π`, - Rho: `Ρ`, - Sigma: `Σ`, - Tau: `Τ`, - Upsilon: `Υ`, - Phi: `Φ`, - Chi: `Χ`, - Psi: `Ψ`, - Omega: `Ω`, - alpha: `α`, - beta: `β`, - gamma: `γ`, - delta: `δ`, - epsilon: `ε`, - zeta: `ζ`, - eta: `η`, - theta: `θ`, - iota: `ι`, - kappa: `κ`, - lambda: `λ`, - mu: `μ`, - nu: `ν`, - xi: `ξ`, - omicron: `ο`, - pi: `π`, - rho: `ρ`, - sigmaf: `ς`, - sigma: `σ`, - tau: `τ`, - upsilon: `υ`, - phi: `φ`, - chi: `χ`, - psi: `ψ`, - omega: `ω`, - thetasym: `ϑ`, - upsih: `ϒ`, - piv: `ϖ`, - ensp: ` `, - emsp: ` `, - thinsp: ` `, - zwnj: `‌`, - zwj: `‍`, - lrm: `‎`, - rlm: `‏`, - ndash: `–`, - mdash: `—`, - lsquo: `‘`, - rsquo: `’`, - sbquo: `‚`, - ldquo: `“`, - rdquo: `”`, - bdquo: `„`, - dagger: `†`, - Dagger: `‡`, - bull: `•`, - hellip: `…`, - permil: `‰`, - prime: `′`, - Prime: `″`, - lsaquo: `‹`, - rsaquo: `›`, - oline: `‾`, - frasl: `⁄`, - euro: `€`, - image: `ℑ`, - weierp: `℘`, - real: `ℜ`, - trade: `™`, - alefsym: `ℵ`, - larr: `←`, - uarr: `↑`, - rarr: `→`, - darr: `↓`, - harr: `↔`, - crarr: `↵`, - lArr: `⇐`, - uArr: `⇑`, - rArr: `⇒`, - dArr: `⇓`, - hArr: `⇔`, - forall: `∀`, - part: `∂`, - exist: `∃`, - empty: `∅`, - nabla: `∇`, - isin: `∈`, - notin: `∉`, - ni: `∋`, - prod: `∏`, - sum: `∑`, - minus: `−`, - lowast: `∗`, - radic: `√`, - prop: `∝`, - infin: `∞`, - ang: `∠`, - and: `∧`, - or: `∨`, - cap: `∩`, - cup: `∪`, - int: `∫`, - there4: `∴`, - sim: `∼`, - cong: `≅`, - asymp: `≈`, - ne: `≠`, - equiv: `≡`, - le: `≤`, - ge: `≥`, - sub: `⊂`, - sup: `⊃`, - nsub: `⊄`, - sube: `⊆`, - supe: `⊇`, - oplus: `⊕`, - otimes: `⊗`, - perp: `⊥`, - sdot: `⋅`, - lceil: `⌈`, - rceil: `⌉`, - lfloor: `⌊`, - rfloor: `⌋`, - loz: `◊`, - spades: `♠`, - clubs: `♣`, - hearts: `♥`, - diams: `♦`, - lang: `⟨`, - rang: `⟩` - }; - }, - function(e, t, n) { - Object.defineProperty(t, "__esModule", { value: !0 }); - var r = n(10), i = n(12), a = n(13), o = function() { - function e() { - this.values = [], this.curly = this.paren = -1; - } - return e.prototype.beforeFunctionExpression = function(e) { - return `(.{.[.in.typeof.instanceof.new.return.case.delete.throw.void.=.+=.-=.*=.**=./=.%=.<<=.>>=.>>>=.&=.|=.^=.,.+.-.*.**./.%.++.--.<<.>>.>>>.&.|.^.!.~.&&.||.?.:.===.==.>=.<=.<.>.!=.!==`.split(`.`).indexOf(e) >= 0; - }, e.prototype.isRegexStart = function() { - var e = this.values[this.values.length - 1], t = e !== null; - switch (e) { - case `this`: - case `]`: - t = !1; - break; - case `)`: - var n = this.values[this.paren - 1]; - t = n === `if` || n === `while` || n === `for` || n === `with`; - break; - case `}`: - if (t = !1, this.values[this.curly - 3] === `function`) { - var r = this.values[this.curly - 4]; - t = r ? !this.beforeFunctionExpression(r) : !1; - } else if (this.values[this.curly - 4] === `function`) { - var r = this.values[this.curly - 5]; - t = r ? !this.beforeFunctionExpression(r) : !0; - } - break; - default: break; - } - return t; - }, e.prototype.push = function(e) { - e.type === 7 || e.type === 4 ? (e.value === `{` ? this.curly = this.values.length : e.value === `(` && (this.paren = this.values.length), this.values.push(e.value)) : this.values.push(null); - }, e; - }(); - t.Tokenizer = function() { - function e(e, t) { - this.errorHandler = new r.ErrorHandler(), this.errorHandler.tolerant = t ? typeof t.tolerant == `boolean` && t.tolerant : !1, this.scanner = new i.Scanner(e, this.errorHandler), this.scanner.trackComment = t ? typeof t.comment == `boolean` && t.comment : !1, this.trackRange = t ? typeof t.range == `boolean` && t.range : !1, this.trackLoc = t ? typeof t.loc == `boolean` && t.loc : !1, this.buffer = [], this.reader = new o(); - } - return e.prototype.errors = function() { - return this.errorHandler.errors; - }, e.prototype.getNextToken = function() { - if (this.buffer.length === 0) { - var e = this.scanner.scanComments(); - if (this.scanner.trackComment) for (var t = 0; t < e.length; ++t) { - var n = e[t], r = this.scanner.source.slice(n.slice[0], n.slice[1]), i = { - type: n.multiLine ? `BlockComment` : `LineComment`, - value: r - }; - this.trackRange && (i.range = n.range), this.trackLoc && (i.loc = n.loc), this.buffer.push(i); - } - if (!this.scanner.eof()) { - var o = void 0; - this.trackLoc && (o = { - start: { - line: this.scanner.lineNumber, - column: this.scanner.index - this.scanner.lineStart - }, - end: {} - }); - var s = this.scanner.source[this.scanner.index] === `/` && this.reader.isRegexStart() ? this.scanner.scanRegExp() : this.scanner.lex(); - this.reader.push(s); - var c = { - type: a.TokenName[s.type], - value: this.scanner.source.slice(s.start, s.end) - }; - this.trackRange && (c.range = [s.start, s.end]), this.trackLoc && (o.end = { - line: this.scanner.lineNumber, - column: this.scanner.index - this.scanner.lineStart - }, c.loc = o), s.type === 9 && (c.regex = { - pattern: s.pattern, - flags: s.flags - }), this.buffer.push(c); - } - } - return this.buffer.shift(); - }, e; - }(); - } - ]); - }); -})); -var require_function = __commonJSMin(((e, t) => { - var n; - try { - n = require_esprima(); - } catch { - typeof window < `u` && (n = window.esprima); - } - var r = require_type(); - function i(e) { - if (e === null) return !1; - try { - var t = `(` + e + `)`, r = n.parse(t, { range: !0 }); - return !(r.type !== `Program` || r.body.length !== 1 || r.body[0].type !== `ExpressionStatement` || r.body[0].expression.type !== `ArrowFunctionExpression` && r.body[0].expression.type !== `FunctionExpression`); - } catch { - return !1; - } - } - function a(e) { - var t = `(` + e + `)`, r = n.parse(t, { range: !0 }), i = [], a; - if (r.type !== `Program` || r.body.length !== 1 || r.body[0].type !== `ExpressionStatement` || r.body[0].expression.type !== `ArrowFunctionExpression` && r.body[0].expression.type !== `FunctionExpression`) throw Error(`Failed to resolve function`); - return r.body[0].expression.params.forEach(function(e) { - i.push(e.name); - }), a = r.body[0].expression.body.range, r.body[0].expression.body.type === `BlockStatement` ? Function(i, t.slice(a[0] + 1, a[1] - 1)) : Function(i, `return ` + t.slice(a[0], a[1])); - } - function o(e) { - return e.toString(); - } - function s(e) { - return Object.prototype.toString.call(e) === `[object Function]`; - } - t.exports = new r(`tag:yaml.org,2002:js/function`, { - kind: `scalar`, - resolve: i, - construct: a, - predicate: s, - represent: o - }); -})); -var require_default_full = __commonJSMin(((e, t) => { - var n = require_schema(); - t.exports = n.DEFAULT = new n({ - include: [require_default_safe()], - explicit: [ - require_undefined(), - require_regexp(), - require_function() - ] - }); -})); -var require_loader = __commonJSMin(((e, t) => { - var n = require_common(), r = require_exception(), i = require_mark(), a = require_default_safe(), o = require_default_full(), s = Object.prototype.hasOwnProperty, c = 1, l = 2, u = 3, d = 4, f = 1, p = 2, m = 3, h = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/, g = /[\x85\u2028\u2029]/, _ = /[,\[\]\{\}]/, v = /^(?:!|!!|![a-z\-]+!)$/i, y = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i; - function b(e) { - return Object.prototype.toString.call(e); - } - function x(e) { - return e === 10 || e === 13; - } - function S(e) { - return e === 9 || e === 32; - } - function C(e) { - return e === 9 || e === 32 || e === 10 || e === 13; - } - function w(e) { - return e === 44 || e === 91 || e === 93 || e === 123 || e === 125; - } - function ee(e) { - var t; - return 48 <= e && e <= 57 ? e - 48 : (t = e | 32, 97 <= t && t <= 102 ? t - 97 + 10 : -1); - } - function T(e) { - return e === 120 ? 2 : e === 117 ? 4 : e === 85 ? 8 : 0; - } - function E(e) { - return 48 <= e && e <= 57 ? e - 48 : -1; - } - function D(e) { - return e === 48 ? `\0` : e === 97 ? `\x07` : e === 98 ? `\b` : e === 116 || e === 9 ? ` ` : e === 110 ? ` -` : e === 118 ? `\v` : e === 102 ? `\f` : e === 114 ? `\r` : e === 101 ? `\x1B` : e === 32 ? ` ` : e === 34 ? `"` : e === 47 ? `/` : e === 92 ? `\\` : e === 78 ? `…` : e === 95 ? `\xA0` : e === 76 ? `\u2028` : e === 80 ? `\u2029` : ``; - } - function O(e) { - return e <= 65535 ? String.fromCharCode(e) : String.fromCharCode((e - 65536 >> 10) + 55296, (e - 65536 & 1023) + 56320); - } - function te(e, t, n) { - t === `__proto__` ? Object.defineProperty(e, t, { - configurable: !0, - enumerable: !0, - writable: !0, - value: n - }) : e[t] = n; - } - for (var k = Array(256), A = Array(256), j = 0; j < 256; j++) k[j] = +!!D(j), A[j] = D(j); - function ne(e, t) { - this.input = e, this.filename = t.filename || null, this.schema = t.schema || o, this.onWarning = t.onWarning || null, this.legacy = t.legacy || !1, this.json = t.json || !1, this.listener = t.listener || null, this.implicitTypes = this.schema.compiledImplicit, this.typeMap = this.schema.compiledTypeMap, this.length = e.length, this.position = 0, this.line = 0, this.lineStart = 0, this.lineIndent = 0, this.documents = []; - } - function M(e, t) { - return new r(t, new i(e.filename, e.input, e.position, e.line, e.position - e.lineStart)); - } - function N(e, t) { - throw M(e, t); - } - function P(e, t) { - e.onWarning && e.onWarning.call(null, M(e, t)); - } - var F = { - YAML: function(e, t, n) { - var r, i, a; - e.version !== null && N(e, `duplication of %YAML directive`), n.length !== 1 && N(e, `YAML directive accepts exactly one argument`), r = /^([0-9]+)\.([0-9]+)$/.exec(n[0]), r === null && N(e, `ill-formed argument of the YAML directive`), i = parseInt(r[1], 10), a = parseInt(r[2], 10), i !== 1 && N(e, `unacceptable YAML version of the document`), e.version = n[0], e.checkLineBreaks = a < 2, a !== 1 && a !== 2 && P(e, `unsupported YAML version of the document`); - }, - TAG: function(e, t, n) { - var r, i; - n.length !== 2 && N(e, `TAG directive accepts exactly two arguments`), r = n[0], i = n[1], v.test(r) || N(e, `ill-formed tag handle (first argument) of the TAG directive`), s.call(e.tagMap, r) && N(e, `there is a previously declared suffix for "` + r + `" tag handle`), y.test(i) || N(e, `ill-formed tag prefix (second argument) of the TAG directive`), e.tagMap[r] = i; - } - }; - function I(e, t, n, r) { - var i, a, o, s; - if (t < n) { - if (s = e.input.slice(t, n), r) for (i = 0, a = s.length; i < a; i += 1) o = s.charCodeAt(i), o === 9 || 32 <= o && o <= 1114111 || N(e, `expected valid JSON character`); - else h.test(s) && N(e, `the stream contains non-printable characters`); - e.result += s; - } - } - function L(e, t, r, i) { - var a, o, c, l; - for (n.isObject(r) || N(e, `cannot merge mappings; the provided source object is unacceptable`), a = Object.keys(r), c = 0, l = a.length; c < l; c += 1) o = a[c], s.call(t, o) || (te(t, o, r[o]), i[o] = !0); - } - function R(e, t, n, r, i, a, o, c) { - var l, u; - if (Array.isArray(i)) for (i = Array.prototype.slice.call(i), l = 0, u = i.length; l < u; l += 1) Array.isArray(i[l]) && N(e, `nested arrays are not supported inside keys`), typeof i == `object` && b(i[l]) === `[object Object]` && (i[l] = `[object Object]`); - if (typeof i == `object` && b(i) === `[object Object]` && (i = `[object Object]`), i = String(i), t === null && (t = {}), r === `tag:yaml.org,2002:merge`) if (Array.isArray(a)) for (l = 0, u = a.length; l < u; l += 1) L(e, t, a[l], n); - else L(e, t, a, n); - else !e.json && !s.call(n, i) && s.call(t, i) && (e.line = o || e.line, e.position = c || e.position, N(e, `duplicated mapping key`)), te(t, i, a), delete n[i]; - return t; - } - function z(e) { - var t = e.input.charCodeAt(e.position); - t === 10 ? e.position++ : t === 13 ? (e.position++, e.input.charCodeAt(e.position) === 10 && e.position++) : N(e, `a line break is expected`), e.line += 1, e.lineStart = e.position; - } - function B(e, t, n) { - for (var r = 0, i = e.input.charCodeAt(e.position); i !== 0;) { - for (; S(i);) i = e.input.charCodeAt(++e.position); - if (t && i === 35) do - i = e.input.charCodeAt(++e.position); - while (i !== 10 && i !== 13 && i !== 0); - if (x(i)) for (z(e), i = e.input.charCodeAt(e.position), r++, e.lineIndent = 0; i === 32;) e.lineIndent++, i = e.input.charCodeAt(++e.position); - else break; - } - return n !== -1 && r !== 0 && e.lineIndent < n && P(e, `deficient indentation`), r; - } - function V(e) { - var t = e.position, n = e.input.charCodeAt(t); - return !!((n === 45 || n === 46) && n === e.input.charCodeAt(t + 1) && n === e.input.charCodeAt(t + 2) && (t += 3, n = e.input.charCodeAt(t), n === 0 || C(n))); - } - function H(e, t) { - t === 1 ? e.result += ` ` : t > 1 && (e.result += n.repeat(` -`, t - 1)); - } - function U(e, t, n) { - var r, i, a, o, s, c, l, u, d = e.kind, f = e.result, p = e.input.charCodeAt(e.position); - if (C(p) || w(p) || p === 35 || p === 38 || p === 42 || p === 33 || p === 124 || p === 62 || p === 39 || p === 34 || p === 37 || p === 64 || p === 96 || (p === 63 || p === 45) && (i = e.input.charCodeAt(e.position + 1), C(i) || n && w(i))) return !1; - for (e.kind = `scalar`, e.result = ``, a = o = e.position, s = !1; p !== 0;) { - if (p === 58) { - if (i = e.input.charCodeAt(e.position + 1), C(i) || n && w(i)) break; - } else if (p === 35) { - if (r = e.input.charCodeAt(e.position - 1), C(r)) break; - } else if (e.position === e.lineStart && V(e) || n && w(p)) break; - else if (x(p)) if (c = e.line, l = e.lineStart, u = e.lineIndent, B(e, !1, -1), e.lineIndent >= t) { - s = !0, p = e.input.charCodeAt(e.position); - continue; - } else { - e.position = o, e.line = c, e.lineStart = l, e.lineIndent = u; - break; - } - s &&= (I(e, a, o, !1), H(e, e.line - c), a = o = e.position, !1), S(p) || (o = e.position + 1), p = e.input.charCodeAt(++e.position); - } - return I(e, a, o, !1), e.result ? !0 : (e.kind = d, e.result = f, !1); - } - function W(e, t) { - var n = e.input.charCodeAt(e.position), r, i; - if (n !== 39) return !1; - for (e.kind = `scalar`, e.result = ``, e.position++, r = i = e.position; (n = e.input.charCodeAt(e.position)) !== 0;) if (n === 39) if (I(e, r, e.position, !0), n = e.input.charCodeAt(++e.position), n === 39) r = e.position, e.position++, i = e.position; - else return !0; - else x(n) ? (I(e, r, i, !0), H(e, B(e, !1, t)), r = i = e.position) : e.position === e.lineStart && V(e) ? N(e, `unexpected end of the document within a single quoted scalar`) : (e.position++, i = e.position); - N(e, `unexpected end of the stream within a single quoted scalar`); - } - function G(e, t) { - var n, r, i, a, o, s = e.input.charCodeAt(e.position); - if (s !== 34) return !1; - for (e.kind = `scalar`, e.result = ``, e.position++, n = r = e.position; (s = e.input.charCodeAt(e.position)) !== 0;) if (s === 34) return I(e, n, e.position, !0), e.position++, !0; - else if (s === 92) { - if (I(e, n, e.position, !0), s = e.input.charCodeAt(++e.position), x(s)) B(e, !1, t); - else if (s < 256 && k[s]) e.result += A[s], e.position++; - else if ((o = T(s)) > 0) { - for (i = o, a = 0; i > 0; i--) s = e.input.charCodeAt(++e.position), (o = ee(s)) >= 0 ? a = (a << 4) + o : N(e, `expected hexadecimal character`); - e.result += O(a), e.position++; - } else N(e, `unknown escape sequence`); - n = r = e.position; - } else x(s) ? (I(e, n, r, !0), H(e, B(e, !1, t)), n = r = e.position) : e.position === e.lineStart && V(e) ? N(e, `unexpected end of the document within a double quoted scalar`) : (e.position++, r = e.position); - N(e, `unexpected end of the stream within a double quoted scalar`); - } - function K(e, t) { - var n = !0, r, i = e.tag, a, o = e.anchor, s, l, u, d, f, p = {}, m, h, g, _ = e.input.charCodeAt(e.position); - if (_ === 91) l = 93, f = !1, a = []; - else if (_ === 123) l = 125, f = !0, a = {}; - else return !1; - for (e.anchor !== null && (e.anchorMap[e.anchor] = a), _ = e.input.charCodeAt(++e.position); _ !== 0;) { - if (B(e, !0, t), _ = e.input.charCodeAt(e.position), _ === l) return e.position++, e.tag = i, e.anchor = o, e.kind = f ? `mapping` : `sequence`, e.result = a, !0; - n || N(e, `missed comma between flow collection entries`), h = m = g = null, u = d = !1, _ === 63 && (s = e.input.charCodeAt(e.position + 1), C(s) && (u = d = !0, e.position++, B(e, !0, t))), r = e.line, Z(e, t, c, !1, !0), h = e.tag, m = e.result, B(e, !0, t), _ = e.input.charCodeAt(e.position), (d || e.line === r) && _ === 58 && (u = !0, _ = e.input.charCodeAt(++e.position), B(e, !0, t), Z(e, t, c, !1, !0), g = e.result), f ? R(e, a, p, h, m, g) : u ? a.push(R(e, null, p, h, m, g)) : a.push(m), B(e, !0, t), _ = e.input.charCodeAt(e.position), _ === 44 ? (n = !0, _ = e.input.charCodeAt(++e.position)) : n = !1; - } - N(e, `unexpected end of the stream within a flow collection`); - } - function q(e, t) { - var r, i, a = f, o = !1, s = !1, c = t, l = 0, u = !1, d, h = e.input.charCodeAt(e.position); - if (h === 124) i = !1; - else if (h === 62) i = !0; - else return !1; - for (e.kind = `scalar`, e.result = ``; h !== 0;) if (h = e.input.charCodeAt(++e.position), h === 43 || h === 45) f === a ? a = h === 43 ? m : p : N(e, `repeat of a chomping mode identifier`); - else if ((d = E(h)) >= 0) d === 0 ? N(e, `bad explicit indentation width of a block scalar; it cannot be less than one`) : s ? N(e, `repeat of an indentation width identifier`) : (c = t + d - 1, s = !0); - else break; - if (S(h)) { - do - h = e.input.charCodeAt(++e.position); - while (S(h)); - if (h === 35) do - h = e.input.charCodeAt(++e.position); - while (!x(h) && h !== 0); - } - for (; h !== 0;) { - for (z(e), e.lineIndent = 0, h = e.input.charCodeAt(e.position); (!s || e.lineIndent < c) && h === 32;) e.lineIndent++, h = e.input.charCodeAt(++e.position); - if (!s && e.lineIndent > c && (c = e.lineIndent), x(h)) { - l++; - continue; - } - if (e.lineIndent < c) { - a === m ? e.result += n.repeat(` -`, o ? 1 + l : l) : a === f && o && (e.result += ` -`); - break; - } - for (i ? S(h) ? (u = !0, e.result += n.repeat(` -`, o ? 1 + l : l)) : u ? (u = !1, e.result += n.repeat(` -`, l + 1)) : l === 0 ? o && (e.result += ` `) : e.result += n.repeat(` -`, l) : e.result += n.repeat(` -`, o ? 1 + l : l), o = !0, s = !0, l = 0, r = e.position; !x(h) && h !== 0;) h = e.input.charCodeAt(++e.position); - I(e, r, e.position, !1); - } - return !0; - } - function J(e, t) { - var n, r = e.tag, i = e.anchor, a = [], o, s = !1, c; - for (e.anchor !== null && (e.anchorMap[e.anchor] = a), c = e.input.charCodeAt(e.position); c !== 0 && !(c !== 45 || (o = e.input.charCodeAt(e.position + 1), !C(o)));) { - if (s = !0, e.position++, B(e, !0, -1) && e.lineIndent <= t) { - a.push(null), c = e.input.charCodeAt(e.position); - continue; - } - if (n = e.line, Z(e, t, u, !1, !0), a.push(e.result), B(e, !0, -1), c = e.input.charCodeAt(e.position), (e.line === n || e.lineIndent > t) && c !== 0) N(e, `bad indentation of a sequence entry`); - else if (e.lineIndent < t) break; - } - return s ? (e.tag = r, e.anchor = i, e.kind = `sequence`, e.result = a, !0) : !1; - } - function re(e, t, n) { - var r, i, a, o, s = e.tag, c = e.anchor, u = {}, f = {}, p = null, m = null, h = null, g = !1, _ = !1, v; - for (e.anchor !== null && (e.anchorMap[e.anchor] = u), v = e.input.charCodeAt(e.position); v !== 0;) { - if (r = e.input.charCodeAt(e.position + 1), a = e.line, o = e.position, (v === 63 || v === 58) && C(r)) v === 63 ? (g && (R(e, u, f, p, m, null), p = m = h = null), _ = !0, g = !0, i = !0) : g ? (g = !1, i = !0) : N(e, `incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line`), e.position += 1, v = r; - else if (Z(e, n, l, !1, !0)) if (e.line === a) { - for (v = e.input.charCodeAt(e.position); S(v);) v = e.input.charCodeAt(++e.position); - if (v === 58) v = e.input.charCodeAt(++e.position), C(v) || N(e, `a whitespace character is expected after the key-value separator within a block mapping`), g && (R(e, u, f, p, m, null), p = m = h = null), _ = !0, g = !1, i = !1, p = e.tag, m = e.result; - else if (_) N(e, `can not read an implicit mapping pair; a colon is missed`); - else return e.tag = s, e.anchor = c, !0; - } else if (_) N(e, `can not read a block mapping entry; a multiline key may not be an implicit key`); - else return e.tag = s, e.anchor = c, !0; - else break; - if ((e.line === a || e.lineIndent > t) && (Z(e, t, d, !0, i) && (g ? m = e.result : h = e.result), g || (R(e, u, f, p, m, h, a, o), p = m = h = null), B(e, !0, -1), v = e.input.charCodeAt(e.position)), e.lineIndent > t && v !== 0) N(e, `bad indentation of a mapping entry`); - else if (e.lineIndent < t) break; - } - return g && R(e, u, f, p, m, null), _ && (e.tag = s, e.anchor = c, e.kind = `mapping`, e.result = u), _; - } - function Y(e) { - var t, n = !1, r = !1, i, a, o = e.input.charCodeAt(e.position); - if (o !== 33) return !1; - if (e.tag !== null && N(e, `duplication of a tag property`), o = e.input.charCodeAt(++e.position), o === 60 ? (n = !0, o = e.input.charCodeAt(++e.position)) : o === 33 ? (r = !0, i = `!!`, o = e.input.charCodeAt(++e.position)) : i = `!`, t = e.position, n) { - do - o = e.input.charCodeAt(++e.position); - while (o !== 0 && o !== 62); - e.position < e.length ? (a = e.input.slice(t, e.position), o = e.input.charCodeAt(++e.position)) : N(e, `unexpected end of the stream within a verbatim tag`); - } else { - for (; o !== 0 && !C(o);) o === 33 && (r ? N(e, `tag suffix cannot contain exclamation marks`) : (i = e.input.slice(t - 1, e.position + 1), v.test(i) || N(e, `named tag handle cannot contain such characters`), r = !0, t = e.position + 1)), o = e.input.charCodeAt(++e.position); - a = e.input.slice(t, e.position), _.test(a) && N(e, `tag suffix cannot contain flow indicator characters`); - } - return a && !y.test(a) && N(e, `tag name cannot contain such characters: ` + a), n ? e.tag = a : s.call(e.tagMap, i) ? e.tag = e.tagMap[i] + a : i === `!` ? e.tag = `!` + a : i === `!!` ? e.tag = `tag:yaml.org,2002:` + a : N(e, `undeclared tag handle "` + i + `"`), !0; - } - function X(e) { - var t, n = e.input.charCodeAt(e.position); - if (n !== 38) return !1; - for (e.anchor !== null && N(e, `duplication of an anchor property`), n = e.input.charCodeAt(++e.position), t = e.position; n !== 0 && !C(n) && !w(n);) n = e.input.charCodeAt(++e.position); - return e.position === t && N(e, `name of an anchor node must contain at least one character`), e.anchor = e.input.slice(t, e.position), !0; - } - function ie(e) { - var t, n, r = e.input.charCodeAt(e.position); - if (r !== 42) return !1; - for (r = e.input.charCodeAt(++e.position), t = e.position; r !== 0 && !C(r) && !w(r);) r = e.input.charCodeAt(++e.position); - return e.position === t && N(e, `name of an alias node must contain at least one character`), n = e.input.slice(t, e.position), s.call(e.anchorMap, n) || N(e, `unidentified alias "` + n + `"`), e.result = e.anchorMap[n], B(e, !0, -1), !0; - } - function Z(e, t, n, r, i) { - var a, o, f, p = 1, m = !1, h = !1, g, _, v, y, b; - if (e.listener !== null && e.listener(`open`, e), e.tag = null, e.anchor = null, e.kind = null, e.result = null, a = o = f = d === n || u === n, r && B(e, !0, -1) && (m = !0, e.lineIndent > t ? p = 1 : e.lineIndent === t ? p = 0 : e.lineIndent < t && (p = -1)), p === 1) for (; Y(e) || X(e);) B(e, !0, -1) ? (m = !0, f = a, e.lineIndent > t ? p = 1 : e.lineIndent === t ? p = 0 : e.lineIndent < t && (p = -1)) : f = !1; - if (f &&= m || i, (p === 1 || d === n) && (y = c === n || l === n ? t : t + 1, b = e.position - e.lineStart, p === 1 ? f && (J(e, b) || re(e, b, y)) || K(e, y) ? h = !0 : (o && q(e, y) || W(e, y) || G(e, y) ? h = !0 : ie(e) ? (h = !0, (e.tag !== null || e.anchor !== null) && N(e, `alias node should not have any properties`)) : U(e, y, c === n) && (h = !0, e.tag === null && (e.tag = `?`)), e.anchor !== null && (e.anchorMap[e.anchor] = e.result)) : p === 0 && (h = f && J(e, b))), e.tag !== null && e.tag !== `!`) if (e.tag === `?`) { - for (e.result !== null && e.kind !== `scalar` && N(e, `unacceptable node kind for ! tag; it should be "scalar", not "` + e.kind + `"`), g = 0, _ = e.implicitTypes.length; g < _; g += 1) if (v = e.implicitTypes[g], v.resolve(e.result)) { - e.result = v.construct(e.result), e.tag = v.tag, e.anchor !== null && (e.anchorMap[e.anchor] = e.result); - break; - } - } else s.call(e.typeMap[e.kind || `fallback`], e.tag) ? (v = e.typeMap[e.kind || `fallback`][e.tag], e.result !== null && v.kind !== e.kind && N(e, `unacceptable node kind for !<` + e.tag + `> tag; it should be "` + v.kind + `", not "` + e.kind + `"`), v.resolve(e.result) ? (e.result = v.construct(e.result), e.anchor !== null && (e.anchorMap[e.anchor] = e.result)) : N(e, `cannot resolve a node with !<` + e.tag + `> explicit tag`)) : N(e, `unknown tag !<` + e.tag + `>`); - return e.listener !== null && e.listener(`close`, e), e.tag !== null || e.anchor !== null || h; - } - function ae(e) { - var t = e.position, n, r, i, a = !1, o; - for (e.version = null, e.checkLineBreaks = e.legacy, e.tagMap = {}, e.anchorMap = {}; (o = e.input.charCodeAt(e.position)) !== 0 && (B(e, !0, -1), o = e.input.charCodeAt(e.position), !(e.lineIndent > 0 || o !== 37));) { - for (a = !0, o = e.input.charCodeAt(++e.position), n = e.position; o !== 0 && !C(o);) o = e.input.charCodeAt(++e.position); - for (r = e.input.slice(n, e.position), i = [], r.length < 1 && N(e, `directive name must not be less than one character in length`); o !== 0;) { - for (; S(o);) o = e.input.charCodeAt(++e.position); - if (o === 35) { - do - o = e.input.charCodeAt(++e.position); - while (o !== 0 && !x(o)); - break; - } - if (x(o)) break; - for (n = e.position; o !== 0 && !C(o);) o = e.input.charCodeAt(++e.position); - i.push(e.input.slice(n, e.position)); - } - o !== 0 && z(e), s.call(F, r) ? F[r](e, r, i) : P(e, `unknown document directive "` + r + `"`); - } - if (B(e, !0, -1), e.lineIndent === 0 && e.input.charCodeAt(e.position) === 45 && e.input.charCodeAt(e.position + 1) === 45 && e.input.charCodeAt(e.position + 2) === 45 ? (e.position += 3, B(e, !0, -1)) : a && N(e, `directives end mark is expected`), Z(e, e.lineIndent - 1, d, !1, !0), B(e, !0, -1), e.checkLineBreaks && g.test(e.input.slice(t, e.position)) && P(e, `non-ASCII line breaks are interpreted as content`), e.documents.push(e.result), e.position === e.lineStart && V(e)) { - e.input.charCodeAt(e.position) === 46 && (e.position += 3, B(e, !0, -1)); - return; - } - if (e.position < e.length - 1) N(e, `end of the stream or a document separator is expected`); - else return; - } - function Q(e, t) { - e = String(e), t ||= {}, e.length !== 0 && (e.charCodeAt(e.length - 1) !== 10 && e.charCodeAt(e.length - 1) !== 13 && (e += ` -`), e.charCodeAt(0) === 65279 && (e = e.slice(1))); - var n = new ne(e, t), r = e.indexOf(`\0`); - for (r !== -1 && (n.position = r, N(n, `null byte is not allowed in input`)), n.input += `\0`; n.input.charCodeAt(n.position) === 32;) n.lineIndent += 1, n.position += 1; - for (; n.position < n.length - 1;) ae(n); - return n.documents; - } - function oe(e, t, n) { - typeof t == `object` && t && n === void 0 && (n = t, t = null); - var r = Q(e, n); - if (typeof t != `function`) return r; - for (var i = 0, a = r.length; i < a; i += 1) t(r[i]); - } - function se(e, t) { - var n = Q(e, t); - if (n.length !== 0) { - if (n.length === 1) return n[0]; - throw new r(`expected a single document in the stream, but found more`); - } - } - function ce(e, t, r) { - return typeof t == `object` && t && r === void 0 && (r = t, t = null), oe(e, t, n.extend({ schema: a }, r)); - } - function le(e, t) { - return se(e, n.extend({ schema: a }, t)); - } - t.exports.loadAll = oe, t.exports.load = se, t.exports.safeLoadAll = ce, t.exports.safeLoad = le; -})); -var require_dumper = __commonJSMin(((e, t) => { - var n = require_common(), r = require_exception(), i = require_default_full(), a = require_default_safe(), o = Object.prototype.toString, s = Object.prototype.hasOwnProperty, c = 9, l = 10, u = 13, d = 32, f = 33, p = 34, m = 35, h = 37, g = 38, _ = 39, v = 42, y = 44, b = 45, x = 58, S = 61, C = 62, w = 63, ee = 64, T = 91, E = 93, D = 96, O = 123, te = 124, k = 125, A = {}; - A[0] = `\\0`, A[7] = `\\a`, A[8] = `\\b`, A[9] = `\\t`, A[10] = `\\n`, A[11] = `\\v`, A[12] = `\\f`, A[13] = `\\r`, A[27] = `\\e`, A[34] = `\\"`, A[92] = `\\\\`, A[133] = `\\N`, A[160] = `\\_`, A[8232] = `\\L`, A[8233] = `\\P`; - var j = [ - `y`, - `Y`, - `yes`, - `Yes`, - `YES`, - `on`, - `On`, - `ON`, - `n`, - `N`, - `no`, - `No`, - `NO`, - `off`, - `Off`, - `OFF` - ]; - function ne(e, t) { - var n, r, i, a, o, c, l; - if (t === null) return {}; - for (n = {}, r = Object.keys(t), i = 0, a = r.length; i < a; i += 1) o = r[i], c = String(t[o]), o.slice(0, 2) === `!!` && (o = `tag:yaml.org,2002:` + o.slice(2)), l = e.compiledTypeMap.fallback[o], l && s.call(l.styleAliases, c) && (c = l.styleAliases[c]), n[o] = c; - return n; - } - function M(e) { - var t = e.toString(16).toUpperCase(), i, a; - if (e <= 255) i = `x`, a = 2; - else if (e <= 65535) i = `u`, a = 4; - else if (e <= 4294967295) i = `U`, a = 8; - else throw new r(`code point within a string may not be greater than 0xFFFFFFFF`); - return `\\` + i + n.repeat(`0`, a - t.length) + t; - } - function N(e) { - this.schema = e.schema || i, this.indent = Math.max(1, e.indent || 2), this.noArrayIndent = e.noArrayIndent || !1, this.skipInvalid = e.skipInvalid || !1, this.flowLevel = n.isNothing(e.flowLevel) ? -1 : e.flowLevel, this.styleMap = ne(this.schema, e.styles || null), this.sortKeys = e.sortKeys || !1, this.lineWidth = e.lineWidth || 80, this.noRefs = e.noRefs || !1, this.noCompatMode = e.noCompatMode || !1, this.condenseFlow = e.condenseFlow || !1, this.implicitTypes = this.schema.compiledImplicit, this.explicitTypes = this.schema.compiledExplicit, this.tag = null, this.result = ``, this.duplicates = [], this.usedDuplicates = null; - } - function P(e, t) { - for (var r = n.repeat(` `, t), i = 0, a = -1, o = ``, s, c = e.length; i < c;) a = e.indexOf(` -`, i), a === -1 ? (s = e.slice(i), i = c) : (s = e.slice(i, a + 1), i = a + 1), s.length && s !== ` -` && (o += r), o += s; - return o; - } - function F(e, t) { - return ` -` + n.repeat(` `, e.indent * t); - } - function I(e, t) { - var n, r, i; - for (n = 0, r = e.implicitTypes.length; n < r; n += 1) if (i = e.implicitTypes[n], i.resolve(t)) return !0; - return !1; - } - function L(e) { - return e === d || e === c; - } - function R(e) { - return 32 <= e && e <= 126 || 161 <= e && e <= 55295 && e !== 8232 && e !== 8233 || 57344 <= e && e <= 65533 && e !== 65279 || 65536 <= e && e <= 1114111; - } - function z(e) { - return R(e) && !L(e) && e !== 65279 && e !== u && e !== l; - } - function B(e, t) { - return R(e) && e !== 65279 && e !== y && e !== T && e !== E && e !== O && e !== k && e !== x && (e !== m || t && z(t)); - } - function V(e) { - return R(e) && e !== 65279 && !L(e) && e !== b && e !== w && e !== x && e !== y && e !== T && e !== E && e !== O && e !== k && e !== m && e !== g && e !== v && e !== f && e !== te && e !== S && e !== C && e !== _ && e !== p && e !== h && e !== ee && e !== D; - } - function H(e) { - return /^\n* /.test(e); - } - var U = 1, W = 2, G = 3, K = 4, q = 5; - function J(e, t, n, r, i) { - var a, o, s, c = !1, u = !1, d = r !== -1, f = -1, p = V(e.charCodeAt(0)) && !L(e.charCodeAt(e.length - 1)); - if (t) for (a = 0; a < e.length; a++) { - if (o = e.charCodeAt(a), !R(o)) return q; - s = a > 0 ? e.charCodeAt(a - 1) : null, p &&= B(o, s); - } - else { - for (a = 0; a < e.length; a++) { - if (o = e.charCodeAt(a), o === l) c = !0, d && (u ||= a - f - 1 > r && e[f + 1] !== ` `, f = a); - else if (!R(o)) return q; - s = a > 0 ? e.charCodeAt(a - 1) : null, p &&= B(o, s); - } - u ||= d && a - f - 1 > r && e[f + 1] !== ` `; - } - return !c && !u ? p && !i(e) ? U : W : n > 9 && H(e) ? q : u ? K : G; - } - function re(e, t, n, i) { - e.dump = function() { - if (t.length === 0) return `''`; - if (!e.noCompatMode && j.indexOf(t) !== -1) return `'` + t + `'`; - var a = e.indent * Math.max(1, n), o = e.lineWidth === -1 ? -1 : Math.max(Math.min(e.lineWidth, 40), e.lineWidth - a), s = i || e.flowLevel > -1 && n >= e.flowLevel; - function c(t) { - return I(e, t); - } - switch (J(t, s, e.indent, o, c)) { - case U: return t; - case W: return `'` + t.replace(/'/g, `''`) + `'`; - case G: return `|` + Y(t, e.indent) + X(P(t, a)); - case K: return `>` + Y(t, e.indent) + X(P(ie(t, o), a)); - case q: return `"` + ae(t, o) + `"`; - default: throw new r(`impossible error: invalid scalar style`); - } - }(); - } - function Y(e, t) { - var n = H(e) ? String(t) : ``, r = e[e.length - 1] === ` -`; - return n + (r && (e[e.length - 2] === ` -` || e === ` -`) ? `+` : r ? `` : `-`) + ` -`; - } - function X(e) { - return e[e.length - 1] === ` -` ? e.slice(0, -1) : e; - } - function ie(e, t) { - for (var n = /(\n+)([^\n]*)/g, r = function() { - var r = e.indexOf(` -`); - return r = r === -1 ? e.length : r, n.lastIndex = r, Z(e.slice(0, r), t); - }(), i = e[0] === ` -` || e[0] === ` `, a, o; o = n.exec(e);) { - var s = o[1], c = o[2]; - a = c[0] === ` `, r += s + (!i && !a && c !== `` ? ` -` : ``) + Z(c, t), i = a; - } - return r; - } - function Z(e, t) { - if (e === `` || e[0] === ` `) return e; - for (var n = / [^ ]/g, r, i = 0, a, o = 0, s = 0, c = ``; r = n.exec(e);) s = r.index, s - i > t && (a = o > i ? o : s, c += ` -` + e.slice(i, a), i = a + 1), o = s; - return c += ` -`, e.length - i > t && o > i ? c += e.slice(i, o) + ` -` + e.slice(o + 1) : c += e.slice(i), c.slice(1); - } - function ae(e) { - for (var t = ``, n, r, i, a = 0; a < e.length; a++) { - if (n = e.charCodeAt(a), n >= 55296 && n <= 56319 && (r = e.charCodeAt(a + 1), r >= 56320 && r <= 57343)) { - t += M((n - 55296) * 1024 + r - 56320 + 65536), a++; - continue; - } - i = A[n], t += !i && R(n) ? e[a] : i || M(n); - } - return t; - } - function Q(e, t, n) { - var r = ``, i = e.tag, a, o; - for (a = 0, o = n.length; a < o; a += 1) $(e, t, n[a], !1, !1) && (a !== 0 && (r += `,` + (e.condenseFlow ? `` : ` `)), r += e.dump); - e.tag = i, e.dump = `[` + r + `]`; - } - function oe(e, t, n, r) { - var i = ``, a = e.tag, o, s; - for (o = 0, s = n.length; o < s; o += 1) $(e, t + 1, n[o], !0, !0) && ((!r || o !== 0) && (i += F(e, t)), e.dump && l === e.dump.charCodeAt(0) ? i += `-` : i += `- `, i += e.dump); - e.tag = a, e.dump = i || `[]`; - } - function se(e, t, n) { - var r = ``, i = e.tag, a = Object.keys(n), o, s, c, l, u; - for (o = 0, s = a.length; o < s; o += 1) u = ``, o !== 0 && (u += `, `), e.condenseFlow && (u += `"`), c = a[o], l = n[c], $(e, t, c, !1, !1) && (e.dump.length > 1024 && (u += `? `), u += e.dump + (e.condenseFlow ? `"` : ``) + `:` + (e.condenseFlow ? `` : ` `), $(e, t, l, !1, !1) && (u += e.dump, r += u)); - e.tag = i, e.dump = `{` + r + `}`; - } - function ce(e, t, n, i) { - var a = ``, o = e.tag, s = Object.keys(n), c, u, d, f, p, m; - if (e.sortKeys === !0) s.sort(); - else if (typeof e.sortKeys == `function`) s.sort(e.sortKeys); - else if (e.sortKeys) throw new r(`sortKeys must be a boolean or a function`); - for (c = 0, u = s.length; c < u; c += 1) m = ``, (!i || c !== 0) && (m += F(e, t)), d = s[c], f = n[d], $(e, t + 1, d, !0, !0, !0) && (p = e.tag !== null && e.tag !== `?` || e.dump && e.dump.length > 1024, p && (e.dump && l === e.dump.charCodeAt(0) ? m += `?` : m += `? `), m += e.dump, p && (m += F(e, t)), $(e, t + 1, f, !0, p) && (e.dump && l === e.dump.charCodeAt(0) ? m += `:` : m += `: `, m += e.dump, a += m)); - e.tag = o, e.dump = a || `{}`; - } - function le(e, t, n) { - var i, a = n ? e.explicitTypes : e.implicitTypes, c, l, u, d; - for (c = 0, l = a.length; c < l; c += 1) if (u = a[c], (u.instanceOf || u.predicate) && (!u.instanceOf || typeof t == `object` && t instanceof u.instanceOf) && (!u.predicate || u.predicate(t))) { - if (e.tag = n ? u.tag : `?`, u.represent) { - if (d = e.styleMap[u.tag] || u.defaultStyle, o.call(u.represent) === `[object Function]`) i = u.represent(t, d); - else if (s.call(u.represent, d)) i = u.represent[d](t, d); - else throw new r(`!<` + u.tag + `> tag resolver accepts not "` + d + `" style`); - e.dump = i; - } - return !0; - } - return !1; - } - function $(e, t, n, i, a, s) { - e.tag = null, e.dump = n, le(e, n, !1) || le(e, n, !0); - var c = o.call(e.dump); - i &&= e.flowLevel < 0 || e.flowLevel > t; - var l = c === `[object Object]` || c === `[object Array]`, u, d; - if (l && (u = e.duplicates.indexOf(n), d = u !== -1), (e.tag !== null && e.tag !== `?` || d || e.indent !== 2 && t > 0) && (a = !1), d && e.usedDuplicates[u]) e.dump = `*ref_` + u; - else { - if (l && d && !e.usedDuplicates[u] && (e.usedDuplicates[u] = !0), c === `[object Object]`) i && Object.keys(e.dump).length !== 0 ? (ce(e, t, e.dump, a), d && (e.dump = `&ref_` + u + e.dump)) : (se(e, t, e.dump), d && (e.dump = `&ref_` + u + ` ` + e.dump)); - else if (c === `[object Array]`) { - var f = e.noArrayIndent && t > 0 ? t - 1 : t; - i && e.dump.length !== 0 ? (oe(e, f, e.dump, a), d && (e.dump = `&ref_` + u + e.dump)) : (Q(e, f, e.dump), d && (e.dump = `&ref_` + u + ` ` + e.dump)); - } else if (c === `[object String]`) e.tag !== `?` && re(e, e.dump, t, s); - else { - if (e.skipInvalid) return !1; - throw new r(`unacceptable kind of an object to dump ` + c); - } - e.tag !== null && e.tag !== `?` && (e.dump = `!<` + e.tag + `> ` + e.dump); - } - return !0; - } - function ue(e, t) { - var n = [], r = [], i, a; - for (de(e, n, r), i = 0, a = r.length; i < a; i += 1) t.duplicates.push(n[r[i]]); - t.usedDuplicates = Array(a); - } - function de(e, t, n) { - var r, i, a; - if (typeof e == `object` && e) if (i = t.indexOf(e), i !== -1) n.indexOf(i) === -1 && n.push(i); - else if (t.push(e), Array.isArray(e)) for (i = 0, a = e.length; i < a; i += 1) de(e[i], t, n); - else for (r = Object.keys(e), i = 0, a = r.length; i < a; i += 1) de(e[r[i]], t, n); - } - function fe(e, t) { - t ||= {}; - var n = new N(t); - return n.noRefs || ue(e, n), $(n, 0, e, !0, !0) ? n.dump + ` -` : ``; - } - function pe(e, t) { - return fe(e, n.extend({ schema: a }, t)); - } - t.exports.dump = fe, t.exports.safeDump = pe; -})); -var require_js_yaml$1 = __commonJSMin(((e, t) => { - var n = require_loader(), r = require_dumper(); - function i(e) { - return function() { - throw Error(`Function ` + e + ` is deprecated and cannot be used.`); - }; - } - t.exports.Type = require_type(), t.exports.Schema = require_schema(), t.exports.FAILSAFE_SCHEMA = require_failsafe(), t.exports.JSON_SCHEMA = require_json(), t.exports.CORE_SCHEMA = require_core(), t.exports.DEFAULT_SAFE_SCHEMA = require_default_safe(), t.exports.DEFAULT_FULL_SCHEMA = require_default_full(), t.exports.load = n.load, t.exports.loadAll = n.loadAll, t.exports.safeLoad = n.safeLoad, t.exports.safeLoadAll = n.safeLoadAll, t.exports.dump = r.dump, t.exports.safeDump = r.safeDump, t.exports.YAMLException = require_exception(), t.exports.MINIMAL_SCHEMA = require_failsafe(), t.exports.SAFE_SCHEMA = require_default_safe(), t.exports.DEFAULT_SCHEMA = require_default_full(), t.exports.scan = i(`scan`), t.exports.parse = i(`parse`), t.exports.compose = i(`compose`), t.exports.addConstructor = i(`addConstructor`); -})); -var require_js_yaml = __commonJSMin(((e, t) => { - t.exports = require_js_yaml$1(); -})); -var require_engines = __commonJSMin(((exports, module) => { - const yaml = require_js_yaml(), engines = exports = module.exports; - engines.yaml = { - parse: yaml.safeLoad.bind(yaml), - stringify: yaml.safeDump.bind(yaml) - }, engines.json = { - parse: JSON.parse.bind(JSON), - stringify: function(e, t) { - let n = Object.assign({ - replacer: null, - space: 2 - }, t); - return JSON.stringify(e, n.replacer, n.space); - } - }, engines.javascript = { - parse: function parse(str, options, wrap) { - try { - return wrap !== !1 && (str = `(function() { -return ` + str.trim() + `; -}());`), eval(str) || {}; - } catch (e) { - if (wrap !== !1 && /(unexpected|identifier)/i.test(e.message)) return parse(str, options, !1); - throw SyntaxError(e); - } - }, - stringify: function() { - throw Error(`stringifying JavaScript is not supported`); - } - }; -})); -var require_strip_bom_string = __commonJSMin(((e, t) => { - t.exports = function(e) { - return typeof e == `string` && e.charAt(0) === `` ? e.slice(1) : e; - }; -})); -var require_utils = __commonJSMin(((e) => { - let t = require_strip_bom_string(), n = require_kind_of(); - e.define = function(e, t, n) { - Reflect.defineProperty(e, t, { - enumerable: !1, - configurable: !0, - writable: !0, - value: n - }); - }, e.isBuffer = function(e) { - return n(e) === `buffer`; - }, e.isObject = function(e) { - return n(e) === `object`; - }, e.toBuffer = function(e) { - return typeof e == `string` ? Buffer.from(e) : e; - }, e.toString = function(n) { - if (e.isBuffer(n)) return t(String(n)); - if (typeof n != `string`) throw TypeError(`expected input to be a string or buffer`); - return t(n); - }, e.arrayify = function(e) { - return e ? Array.isArray(e) ? e : [e] : []; - }, e.startsWith = function(e, t, n) { - return typeof n != `number` && (n = t.length), e.slice(0, n) === t; - }; -})); -var require_defaults = __commonJSMin(((e, t) => { - let n = require_engines(), r = require_utils(); - t.exports = function(e) { - let t = Object.assign({}, e); - return t.delimiters = r.arrayify(t.delims || t.delimiters || `---`), t.delimiters.length === 1 && t.delimiters.push(t.delimiters[0]), t.language = (t.language || t.lang || `yaml`).toLowerCase(), t.engines = Object.assign({}, n, t.parsers, t.engines), t; - }; -})); -var require_engine = __commonJSMin(((e, t) => { - t.exports = function(e, t) { - let r = t.engines[e] || t.engines[n(e)]; - if (r === void 0) throw Error(`gray-matter engine "` + e + `" is not registered`); - return typeof r == `function` && (r = { parse: r }), r; - }; - function n(e) { - switch (e.toLowerCase()) { - case `js`: - case `javascript`: return `javascript`; - case `coffee`: - case `coffeescript`: - case `cson`: return `coffee`; - case `yaml`: - case `yml`: return `yaml`; - default: return e; - } - } -})); -var require_stringify = __commonJSMin(((e, t) => { - let n = require_kind_of(), r = require_engine(), i = require_defaults(); - t.exports = function(e, t, o) { - if (t == null && o == null) switch (n(e)) { - case `object`: - t = e.data, o = {}; - break; - case `string`: return e; - default: throw TypeError(`expected file to be a string or object`); - } - let s = e.content, c = i(o); - if (t == null) { - if (!c.data) return e; - t = c.data; - } - let l = e.language || c.language, u = r(l, c); - if (typeof u.stringify != `function`) throw TypeError(`expected "` + l + `.stringify" to be a function`); - t = Object.assign({}, e.data, t); - let d = c.delimiters[0], f = c.delimiters[1], p = u.stringify(t, o).trim(), m = ``; - return p !== `{}` && (m = a(d) + a(p) + a(f)), typeof e.excerpt == `string` && e.excerpt !== `` && s.indexOf(e.excerpt.trim()) === -1 && (m += a(e.excerpt) + a(f)), m + a(s); - }; - function a(e) { - return e.slice(-1) === ` -` ? e : e + ` -`; - } -})); -var require_excerpt = __commonJSMin(((e, t) => { - let n = require_defaults(); - t.exports = function(e, t) { - let r = n(t); - if (e.data ??= {}, typeof r.excerpt == `function`) return r.excerpt(e, r); - let i = e.data.excerpt_separator || r.excerpt_separator; - if (i == null && (r.excerpt === !1 || r.excerpt == null)) return e; - let a = typeof r.excerpt == `string` ? r.excerpt : i || r.delimiters[0], o = e.content.indexOf(a); - return o !== -1 && (e.excerpt = e.content.slice(0, o)), e; - }; -})); -var require_to_file = __commonJSMin(((e, t) => { - let n = require_kind_of(), r = require_stringify(), i = require_utils(); - t.exports = function(e) { - return n(e) !== `object` && (e = { content: e }), n(e.data) !== `object` && (e.data = {}), e.contents && e.content == null && (e.content = e.contents), i.define(e, `orig`, i.toBuffer(e.content)), i.define(e, `language`, e.language || ``), i.define(e, `matter`, e.matter || ``), i.define(e, `stringify`, function(t, n) { - return n && n.language && (e.language = n.language), r(e, t, n); - }), e.content = i.toString(e.content), e.isEmpty = !1, e.excerpt = ``, e; - }; -})); -var require_parse = __commonJSMin(((e, t) => { - let n = require_engine(), r = require_defaults(); - t.exports = function(e, t, i) { - let a = r(i), o = n(e, a); - if (typeof o.parse != `function`) throw TypeError(`expected "` + e + `.parse" to be a function`); - return o.parse(t, a); - }; -})); -var require_gray_matter = __commonJSMin(((e, t) => { - let n = __require(`fs`), r = require_section_matter(), i = require_defaults(), a = require_stringify(), o = require_excerpt(), s = require_engines(), c = require_to_file(), l = require_parse(), u = require_utils(); - function d(e, t) { - if (e === ``) return { - data: {}, - content: e, - excerpt: ``, - orig: e - }; - let n = c(e), r = d.cache[n.content]; - if (!t) { - if (r) return n = Object.assign({}, r), n.orig = r.orig, n; - d.cache[n.content] = n; - } - return f(n, t); - } - function f(e, t) { - let n = i(t), a = n.delimiters[0], s = ` -` + n.delimiters[1], c = e.content; - n.language && (e.language = n.language); - let f = a.length; - if (!u.startsWith(c, a, f)) return o(e, n), e; - if (c.charAt(f) === a.slice(-1)) return e; - c = c.slice(f); - let p = c.length, m = d.language(c, n); - m.name && (e.language = m.name, c = c.slice(m.raw.length)); - let h = c.indexOf(s); - return h === -1 && (h = p), e.matter = c.slice(0, h), e.matter.replace(/^\s*#[^\n]+/gm, ``).trim() === `` ? (e.isEmpty = !0, e.empty = e.content, e.data = {}) : e.data = l(e.language, e.matter, n), h === p ? e.content = `` : (e.content = c.slice(h + s.length), e.content[0] === `\r` && (e.content = e.content.slice(1)), e.content[0] === ` -` && (e.content = e.content.slice(1))), o(e, n), (n.sections === !0 || typeof n.section == `function`) && r(e, n.section), e; - } - d.engines = s, d.stringify = function(e, t, n) { - return typeof e == `string` && (e = d(e, n)), a(e, t, n); - }, d.read = function(e, t) { - let r = d(n.readFileSync(e, `utf8`), t); - return r.path = e, r; - }, d.test = function(e, t) { - return u.startsWith(e, i(t).delimiters[0]); - }, d.language = function(e, t) { - let n = i(t).delimiters[0]; - d.test(e) && (e = e.slice(n.length)); - let r = e.slice(0, e.search(/\r?\n/)); - return { - raw: r, - name: r ? r.trim() : `` - }; - }, d.cache = {}, d.clearCache = function() { - d.cache = {}; - }, t.exports = d; -})); -var gray_matter_default = require_gray_matter(); -//#endregion -//#region node_modules/eve/dist/src/runtime/connections/openapi-spec.js -function parseSpecDocument(e) { - try { - return JSON.parse(e); - } catch {} - let n = e.replace(/^\uFEFF/, ``); - return gray_matter_default(n.trimStart().startsWith(`---`) ? n : `---\n${n}\n---`).data ?? {}; -} -function extractServerUrl(e, t) { - let n = extractOpenApiServerUrl(e, t); - return n === void 0 ? extractSwaggerBaseUrl(e, t) : n; -} -function extractOpenApiServerUrl(t, r) { - let i = t.servers; - if (isArray(i)) for (let t of i) { - if (!isObject(t) || typeof t.url != `string` || t.url.length === 0) continue; - let n = isObject(t.variables) ? substituteServerVariables(t.url, t.variables) : t.url; - if (n.startsWith(`http://`) || n.startsWith(`https://`)) return n; - if (typeof r == `string` && URL.canParse(r)) try { - return new URL(n, r).toString(); - } catch {} - } -} -function extractSwaggerBaseUrl(e, t) { - let n = typeof e.basePath == `string` ? e.basePath : ``, r = typeof e.host == `string` && e.host.length > 0 ? e.host : ``, i = typeof t == `string` && URL.canParse(t) ? new URL(t) : void 0, a = extractSwaggerScheme(e) ?? i?.protocol.replace(/:$/, ``) ?? `https`; - if (r.length > 0) return `${a}://${r}${normalizeBasePath(n)}`; - if (i !== void 0) { - let e = new URL(normalizeBasePath(n) || `/`, i.origin).toString(); - return e.endsWith(`/`) && normalizeBasePath(n).length === 0 ? e.slice(0, -1) : e; - } -} -function extractSwaggerScheme(e) { - let t = e.schemes; - if (isArray(t)) { - for (let e of t) if (e === `https` || e === `http`) return e; - } -} -function normalizeBasePath(e) { - let t = e.trim(); - return t.length === 0 || t === `/` ? `` : t.startsWith(`/`) ? t : `/${t}`; -} -function substituteServerVariables(t, n) { - return t.replace(/\{([^}]+)\}/g, (t, r) => { - let i = n[r]; - return isObject(i) && typeof i.default == `string` ? i.default : t; - }); -} -//#endregion -//#region node_modules/eve/dist/src/runtime/connections/openapi-client.js -const SWAGGER_PARAMETER_SCHEMA_KEYS = [ - `default`, - `enum`, - `exclusiveMaximum`, - `exclusiveMinimum`, - `format`, - `items`, - `maximum`, - `maxItems`, - `maxLength`, - `minimum`, - `minItems`, - `minLength`, - `multipleOf`, - `pattern`, - `type`, - `uniqueItems` -]; -var OpenApiConnectionClient = class { - #e; - #t; - #n; - constructor(e) { - this.#n = e; - } - async connect() { - return this.#r(); - } - async getToolMetadata() { - return (await this.#r()).metadata; - } - async getTools() { - return (await this.#r()).tools; - } - async executeTool(t, n) { - let r = await this.#r(), i = r.operations.get(t); - if (i === void 0) throw Error(`Tool "${t}" not found in connection "${this.#n.connectionName}".`); - return this.#f(i, r.baseUrl, isObject(n) ? n : {}); - } - async close() { - this.#e = void 0, this.#t = void 0; - } - async #r() { - if (this.#t !== void 0) return this.#t; - if (this.#e !== void 0) return this.#e; - this.#e = this.#i(); - try { - return this.#t = await this.#e, this.#t; - } catch (e) { - throw this.#e = void 0, e; - } - } - async #i() { - let i = await this.#o(), a = this.#a(i), o = this.#s(i), s = this.#n.tools, c = s === void 0 ? o : o.filter((e) => passesToolFilter(e.toolName, s)), l = [], u = /* @__PURE__ */ new Map(), d = {}; - for (let r of c) u.set(r.toolName, r), l.push({ - description: r.description, - inputSchema: r.inputSchema, - name: r.toolName - }), d[r.toolName] = tool({ - description: r.description, - inputSchema: jsonSchema(r.inputSchema), - execute: async (t) => this.#f(r, a, isObject(t) ? t : {}) - }); - return { - metadata: l, - operations: u, - tools: d, - baseUrl: a - }; - } - #a(e) { - let t = this.#n.url; - if (typeof t == `string` && t.trim().length > 0) return t; - let n = extractServerUrl(e, this.#n.spec); - if (n !== void 0) return n; - throw Error(`OpenAPI connection "${this.#n.connectionName}" has no base URL: set "baseUrl" or ensure the document declares an absolute "servers" entry or Swagger "host".`); - } - async #o() { - let t = this.#n.spec; - if (t === void 0) throw Error(`OpenAPI connection "${this.#n.connectionName}" is missing its "spec" source.`); - if (typeof t != `string`) return t; - let n; - try { - n = await fetch(t, { headers: { accept: `application/json, application/yaml, text/yaml, */*` } }); - } catch (e) { - throw Error(`OpenAPI connection "${this.#n.connectionName}" failed to fetch its spec from "${t}": ${String(e)}`); - } - if (!n.ok) throw Error(`OpenAPI connection "${this.#n.connectionName}" failed to fetch its spec from "${t}": HTTP ${n.status}.`); - let r = await n.text(), i; - try { - i = parseSpecDocument(r); - } catch (e) { - throw Error(`OpenAPI connection "${this.#n.connectionName}" spec at "${t}" could not be parsed as JSON or YAML: ${String(e)}`); - } - if (!isObject(i)) throw Error(`OpenAPI connection "${this.#n.connectionName}" spec at "${t}" is not an OpenAPI document object.`); - return i; - } - #s(t) { - let n = t.paths; - if (!isObject(n)) return []; - let r = [], i = /* @__PURE__ */ new Set(); - for (let [u, d] of Object.entries(n)) { - if (!isObject(d)) continue; - let n = isArray(d.parameters) ? d.parameters : []; - for (let f of HTTP_METHODS) { - let a = d[f]; - if (!isObject(a)) continue; - let p = uniqueName(operationName(a, f, u), i), m = isArray(a.parameters) ? a.parameters : [], h = [...n, ...m], g = this.#c(t, h), _ = this.#l(t, a.requestBody, h); - r.push({ - toolName: p, - method: f, - pathTemplate: u, - description: operationDescription(a), - parameters: g, - requestBody: _, - inputSchema: buildInputSchema(g, _), - security: resolveSecurity(t, a) - }); - } - } - return r; - } - #c(t, n) { - let r = []; - for (let i of n) { - let n = isObject(i) ? deref(t, i) : i; - if (!isObject(n)) continue; - let a = n.in; - if (a !== `path` && a !== `query` && a !== `header` && a !== `cookie` || typeof n.name != `string`) continue; - let o = this.#u(t, n); - r.push({ - name: n.name, - location: a, - required: n.required === !0 || a === `path`, - schema: o, - description: typeof n.description == `string` ? n.description : void 0 - }); - } - return r; - } - #l(t, n, r = []) { - if (isObject(n)) { - let r = deref(t, n); - if (isObject(r) && isObject(r.content)) { - let n = r.content, i = `application/json` in n ? `application/json` : Object.keys(n)[0]; - if (i !== void 0) { - let a = n[i], o = isObject(a) && isObject(a.schema) ? derefSchema(t, a.schema) : {}; - return { - required: r.required === !0, - contentType: i, - schema: o - }; - } - } - } - return this.#d(t, r); - } - #u(t, n) { - if (isObject(n.schema)) return derefSchema(t, n.schema); - let r = {}; - for (let e of SWAGGER_PARAMETER_SCHEMA_KEYS) n[e] !== void 0 && (r[e] = n[e]); - return derefSchema(t, r); - } - #d(t, n) { - for (let r of n) { - let n = isObject(r) ? deref(t, r) : r; - if (!isObject(n) || n.in !== `body`) continue; - let i = isObject(n.schema) ? derefSchema(t, n.schema) : {}; - return { - required: n.required === !0, - contentType: `application/json`, - schema: i - }; - } - } - async #f(e, t, n) { - let r = await resolveHeaders(this.#n), a = e.pathTemplate, o = new URLSearchParams(), s = []; - for (let t of e.parameters) { - let e = n[t.name]; - e != null && (t.location === `path` ? a = a.replace(`{${t.name}}`, encodeURIComponent(String(e))) : t.location === `query` ? appendQuery(o, t.name, e) : t.location === `cookie` ? s.push(`${t.name}=${encodeURIComponent(String(e))}`) : r[t.name] = String(e)); - } - if (applySecurity(e.security, this.#n, r, o, s), s.length > 0) { - let e = r.cookie ?? r.Cookie; - delete r.Cookie, r.cookie = [e, ...s].filter((e) => !!e).join(`; `); - } - let c = new URL(joinPath(t, a)); - c.search = o.toString(); - let l; - e.requestBody !== void 0 && n.body !== void 0 && (l = JSON.stringify(n.body), r[`content-type`] = e.requestBody.contentType); - let u = await fetch(c, { - method: e.method.toUpperCase(), - headers: r, - body: l - }); - return { - status: u.status, - statusText: u.statusText, - body: await readResponseBody(u) - }; - } -}; -function appendQuery(e, t, n) { - if (isArray(n)) { - for (let r of n) e.append(t, String(r)); - return; - } - e.append(t, String(n)); -} -function joinPath(e, t) { - return `${e.endsWith(`/`) ? e.slice(0, -1) : e}${t.startsWith(`/`) ? t : `/${t}`}`; -} -async function readResponseBody(e) { - let t = await e.text(); - if (t.length === 0) return null; - if ((e.headers.get(`content-type`) ?? ``).includes(`application/json`)) try { - return JSON.parse(t); - } catch { - return t; - } - return t; -} -//#endregion -//#region node_modules/eve/dist/src/runtime/connections/registry.js -var ConnectionRegistryImpl = class { - #e = /* @__PURE__ */ new Map(); - #t; - constructor(e) { - this.#t = e; - } - getClient(n) { - let r = this.#e.get(n); - if (r !== void 0) return r; - let i = this.#t.find((e) => e.connectionName === n); - if (i === void 0) throw Error(`Connection "${n}" is not registered.`); - let a = i.protocol === `openapi` ? new OpenApiConnectionClient(i) : new McpConnectionClient(i); - return this.#e.set(n, a), a; - } - getConnectionApproval(e) { - return this.#t.find((t) => t.connectionName === e)?.approval; - } - getConnectionNames() { - return this.#t.map((e) => e.connectionName); - } - getConnections() { - return this.#t; - } - async dispose() { - let e = [...this.#e.values()].map((e) => e.close()); - await Promise.allSettled(e), this.#e.clear(); - } -}; -//#endregion -//#region node_modules/eve/dist/src/context/node.js -function getActiveRuntimeNode(e) { - return e.require(BundleKey).graph.root; -} -//#endregion -//#region node_modules/eve/dist/src/context/providers/connection.js -const connectionProvider = { - key: ConnectionRegistryKey, - create(e, t) { - if (e.get(BundleKey) === void 0) return; - let n = getActiveRuntimeNode(e).agent?.connections; - if (!(!n || n.length === 0)) return { value: new ConnectionRegistryImpl(n) }; - } -}; -//#endregion -//#region node_modules/eve/dist/src/execution/sandbox/template-prewarm-lock.js -const LOCK_TIMEOUT_MS = 900 * 1e3; -async function waitForSandboxTemplatePrewarmLock(e) { - await waitForLockRelease(resolveSandboxTemplatePrewarmLockPath(e), e.log); -} -async function withSandboxTemplatePrewarmLock(e, t) { - let n = resolveSandboxTemplatePrewarmLockPath(e); - await acquireLock(n); - try { - return await t(); - } finally { - await rm(n, { - force: !0, - recursive: !0 - }).catch(() => {}); - } -} -function resolveSandboxTemplatePrewarmLockPath(e) { - return join(resolveSandboxCacheDirectory(e.appRoot), `template-locks`, e.backendName, `${e.templateKey}.lock`); -} -async function acquireLock(r) { - let i = Date.now(); - for (;;) { - await mkdir(dirname(r), { recursive: !0 }); - try { - await mkdir(r), await writeFile(join(r, `owner.json`), `${JSON.stringify({ - createdAt: (/* @__PURE__ */ new Date()).toISOString(), - pid: process.pid - })}\n`); - return; - } catch (e) { - if (!isFileExistsError(e)) throw e; - await waitForExistingLock(r, i, void 0); - } - } -} -async function waitForLockRelease(e, t) { - let n = Date.now(), r = n + 1e4; - for (;;) { - try { - await stat(e); - } catch (e) { - if (isNotFoundError(e)) return; - throw e; - } - let a = Date.now(); - if (t !== void 0 && a >= r) { - let e = Math.round((a - n) / 1e3); - t(e === 0 ? `waiting for sandbox template prewarm to finish` : `waiting for sandbox template prewarm to finish (${e}s elapsed)`), r = a + 1e4; - } - await waitForExistingLock(e, n, t); - } -} -async function waitForExistingLock(e, t, n) { - let a = await stat(e).catch((e) => { - if (isNotFoundError(e)) return null; - throw e; - }); - if (a !== null) { - if (Date.now() - a.mtimeMs > 18e5) { - n?.(`removing stale sandbox template prewarm lock`), await rm(e, { - force: !0, - recursive: !0 - }).catch(() => {}); - return; - } - if (Date.now() - t > LOCK_TIMEOUT_MS) throw Error(`Timed out waiting for sandbox template prewarm lock "${e}" after ${LOCK_TIMEOUT_MS}ms.`); - await new Promise((e) => setTimeout(e, 250)); - } -} -function isFileExistsError(e) { - return typeof e == `object` && !!e && `code` in e && e.code === `EEXIST`; -} -function isNotFoundError(e) { - return typeof e == `object` && !!e && `code` in e && e.code === `ENOENT`; -} -//#endregion -//#region node_modules/eve/dist/src/internal/authored-module-map-loader.js -async function loadCompiledModuleMapFromAuthoredSource(e) { - return await hydrateCompiledModuleMapFromManifest(await loadCompiledManifest({ compiledArtifactsSource: e.compiledArtifactsSource })); -} -async function hydrateCompiledModuleMapFromManifest(e) { - let t = {}, r = [{ - agentRoot: e.agentRoot, - manifest: e, - nodeId: ROOT_COMPILED_AGENT_NODE_ID - }, ...[...e.subagents].sort((e, t) => e.nodeId.localeCompare(t.nodeId)).map((e) => ({ - agentRoot: e.agent.agentRoot, - manifest: e.agent, - nodeId: e.nodeId - }))]; - for (let e of r) t[e.nodeId] = { modules: await hydrateCompiledNodeScope({ - agentRoot: e.agentRoot, - manifest: e.manifest - }) }; - return { nodes: t }; -} -async function hydrateCompiledNodeScope(n) { - let i = collectModuleRefsForManifest(n.manifest).sort((e, t) => e.sourceId.localeCompare(t.sourceId)), a = n.manifest.config.build?.externalDependencies ?? [], o = {}; - for (let t of i) { - let i = join(n.agentRoot, t.logicalPath); - o[t.sourceId] = await loadAuthoredModuleNamespace(i, { externalDependencies: a }); - } - return o; -} -//#endregion -//#region node_modules/eve/dist/src/internal/application/runtime-compiled-artifacts-source.js -function createAuthoredSourceRuntimeCompiledArtifactsSource(e) { - return createDiskRuntimeCompiledArtifactsSource(e, { moduleMapLoaderPath: resolvePackageSourceFilePath(`src/internal/authored-module-map-loader.ts`) }); -} -//#endregion -//#region node_modules/eve/dist/src/runtime/sandbox/keys.js -async function createRuntimeSandboxKeys(e) { - return { - sessionKey: await createRuntimeSandboxSessionKey(e), - templateKey: await createRuntimeSandboxTemplateKey(e) - }; -} -async function createRuntimeSandboxTemplateKey(e) { - if (e.templatePlan.kind === `none`) return null; - let t = await loadCompileMetadataForKeys(e.compiledArtifactsSource), n = await resolveRuntimeSandboxScope({ - backendName: e.backendName, - compiledArtifactsSource: e.compiledArtifactsSource, - scopeKind: e.templatePlan.kind === `source-graph` ? `deployment` : `stable` - }), r = resolveRuntimeSandboxVersionHash({ - compiledArtifactsSource: e.compiledArtifactsSource, - metadata: t, - nodeId: e.nodeId, - sourceId: e.sourceId, - templatePlan: e.templatePlan - }), i = createStableHash(`${resolvePackageVersionForTemplateKey(t)}:6:${r}`).slice(0, 20); - return sanitizeRuntimeSandboxKey(`eve-sbx-tpl-${e.backendName}-${n}-${i}`); -} -function resolvePackageVersionForTemplateKey(t) { - return t?.generator.version ?? resolveInstalledPackageInfo().version; -} -async function loadCompileMetadataForKeys(e) { - try { - return await loadCompileMetadata({ compiledArtifactsSource: e }); - } catch { - return null; - } -} -async function createRuntimeSandboxSessionKey(e) { - let t = await resolveRuntimeSandboxScope({ - backendName: e.backendName, - compiledArtifactsSource: e.compiledArtifactsSource, - scopeKind: `deployment` - }), n = sanitizeRuntimeSandboxKey(e.nodeId); - return sanitizeRuntimeSandboxKey(`eve-sbx-ses-${e.backendName}-${t}-${e.sessionId}-${n}`); -} -async function resolveRuntimeSandboxScope(e) { - if (e.backendName === `vercel`) { - if (e.scopeKind === `stable`) { - let e = resolveVercelProjectScope(); - if (e !== void 0) return createStableHash(e).slice(0, 16); - } - let t = process.env.VERCEL_DEPLOYMENT_ID?.trim(); - if (t !== void 0 && t.length > 0) return createStableHash(t).slice(0, 16); - } - let n = getRuntimeCompiledArtifactsSandboxAppRoot(e.compiledArtifactsSource); - return n === void 0 ? createStableHash(getRuntimeCompiledArtifactsCacheKey(e.compiledArtifactsSource)).slice(0, 16) : createStableHash(await realpath(n)).slice(0, 16); -} -function resolveRuntimeSandboxVersionHash(e) { - if (e.templatePlan.kind === `bootstrap`) { - let t = e.templatePlan.contentHash ?? resolveSourceGraphHash(e.metadata, e.compiledArtifactsSource); - return createStableHash(`bootstrap:${e.templatePlan.revalidationKey ?? ``}:${e.templatePlan.sourceHash}:${t}:${e.nodeId}:${e.sourceId}`); - } - return e.templatePlan.kind === `workspace-content` ? createStableHash(`workspace-content:${e.templatePlan.contentHash ?? resolveSourceGraphHash(e.metadata, e.compiledArtifactsSource)}:${e.nodeId}:${e.sourceId}`) : createStableHash(`source-graph:${resolveSourceGraphHash(e.metadata, e.compiledArtifactsSource)}:${e.nodeId}:${e.sourceId}`); -} -function resolveSourceGraphHash(e, t) { - return e?.discovery.sourceGraphHash ?? getRuntimeCompiledArtifactsCacheKey(t); -} -function resolveVercelProjectScope() { - let e = process.env.VERCEL_PROJECT_ID?.trim(); - if (!(e === void 0 || e.length === 0)) return `vercel-project:${e}`; -} -function createStableHash(e) { - return createHash(`sha256`).update(e).digest(`hex`); -} -function sanitizeRuntimeSandboxKey(e) { - return e.replaceAll(/[^a-zA-Z0-9._-]+/g, `-`).slice(0, 120); -} -//#endregion -//#region node_modules/eve/dist/src/runtime/sandbox/template-plan.js -function createRuntimeSandboxTemplatePlan(e) { - if (e.definition.bootstrap !== void 0) { - if (e.definition.sourceHash === void 0) throw Error(`Sandbox "${e.definition.logicalPath}" defines bootstrap() but has no compiled sourceHash.`); - return { - contentHash: e.workspaceResourceRoot.contentHash, - kind: `bootstrap`, - revalidationKey: e.definition.revalidationKey, - sourceHash: e.definition.sourceHash - }; - } - return e.workspaceResourceRoot.rootEntries.length === 0 ? { kind: `none` } : { - contentHash: e.workspaceResourceRoot.contentHash, - kind: `workspace-content` - }; -} -//#endregion -//#region node_modules/eve/dist/src/runtime/workspace/seed-files.js -async function materializeWorkspaceDirectory(e) { - let t = []; - return await addMaterializedDirectoryFiles({ - files: t, - logicalDirectoryPath: `.`, - sourceDirectoryPath: e - }), t.sort((e, t) => e.path.localeCompare(t.path)), t; -} -async function addMaterializedDirectoryFiles(r) { - let i = await readdir(r.sourceDirectoryPath, { withFileTypes: !0 }); - for (let n of i) { - if (!n.isDirectory() && !n.isFile()) continue; - let i = join(r.sourceDirectoryPath, n.name), a = posix.join(r.logicalDirectoryPath, n.name); - if (n.isDirectory()) { - await addMaterializedDirectoryFiles({ - files: r.files, - logicalDirectoryPath: a, - sourceDirectoryPath: i - }); - continue; - } - r.files.push({ - content: await readFile(i), - path: posix.join(WORKSPACE_ROOT$1, a) - }); - } -} -//#endregion -//#region node_modules/eve/dist/src/execution/sandbox/prewarm.js -async function prewarmSandboxes(n) { - let r = await collectPrewarmTargets(n); - if (r.length === 0) return; - let i = createPrewarmSignature(r); - if (n.shouldPrewarmSignature?.(i) === !1) return; - let a = n.dispatch ?? (async ({ backend: e, input: t }) => await e.prewarm(t)); - n.log?.(`eve: initializing ${formatSandboxTemplateCount(r.length)}...`); - let o = (await Promise.all(r.map(async ({ backend: r, label: i, input: o }) => { - let logBackendProgress = (e) => { - shouldLogSandboxPrewarmProgress(e) && n.log?.(`eve: sandbox template "${i}" (${r.name}): ${e}`); - }, s; - try { - s = await withSandboxTemplatePrewarmLock({ - appRoot: o.runtimeContext.appRoot, - backendName: r.name, - templateKey: o.templateKey - }, async () => await a({ - backend: r, - input: { - ...o, - log: n.log === void 0 ? void 0 : logBackendProgress - } - })); - } catch (e) { - let a = formatPrewarmFailureForEnvironment({ - backendName: r.name, - error: e - }); - throw n.log?.(`eve: failed to initialize sandbox template "${i}" on backend "${r.name}": ${toErrorMessage(a)}`), a; - } - return s; - }))).filter((e) => e.reused).length; - n.log?.(`eve: initialized ${formatSandboxTemplateCount(r.length)} (${o} reused, ${r.length - o} built).`), n.onPrewarmSignature?.(i); -} -async function prewarmAppSandboxes(e) { - let t = e.compiledArtifactsSource ?? createAuthoredSourceRuntimeCompiledArtifactsSource(e.appRoot); - if (t.kind !== `disk`) throw Error(`prewarmAppSandboxes requires disk-backed compiled artifacts.`); - let n = await (e.loadAgentGraph ?? loadGraphFromArtifacts)({ compiledArtifactsSource: t }); - await prewarmSandboxes({ - appRoot: getRuntimeCompiledArtifactsSandboxAppRoot(t) ?? e.appRoot, - compiledArtifactsSource: t, - dispatch: e.dispatch, - graph: n, - log: e.log, - onPrewarmSignature: e.onPrewarmSignature, - shouldPrewarmSignature: e.shouldPrewarmSignature - }); -} -async function collectPrewarmTargets(e) { - let t = resolveRuntimeCompilerArtifactPaths(e.appRoot).compileDirectoryPath, n = { appRoot: e.appRoot }, r = []; - return await Promise.all(collectNodeSandboxes(e.graph).map(async ({ definition: i, nodeId: a, workspaceResourceRoot: o }) => { - let s = createRuntimeSandboxTemplatePlan({ - definition: i, - workspaceResourceRoot: o - }), c = await createRuntimeSandboxTemplateKey({ - backendName: i.backend.name, - compiledArtifactsSource: e.compiledArtifactsSource, - nodeId: a, - sourceId: i.sourceId, - templatePlan: s - }); - c !== null && r.push({ - backend: i.backend, - label: formatLabel(a), - input: { - bootstrap: i.bootstrap, - seedFiles: await loadResourceRootSeedFiles({ - compileDirectoryPath: t, - workspaceResourceRoot: o - }), - runtimeContext: n, - templateKey: c - }, - signature: `${i.backend.name}:${a}:${c}` - }); - })), r.sort((e, t) => e.label.localeCompare(t.label)); -} -async function loadResourceRootSeedFiles(e) { - return e.workspaceResourceRoot.rootEntries.length === 0 ? [] : (await materializeWorkspaceDirectory(`${e.compileDirectoryPath}/${e.workspaceResourceRoot.logicalPath}`)).map((e) => ({ - content: e.content, - path: e.path - })); -} -async function loadGraphFromArtifacts(e) { - let [t, n] = await Promise.all([loadCompiledManifest({ compiledArtifactsSource: e.compiledArtifactsSource }), loadCompiledModuleMapFromAuthoredSource({ compiledArtifactsSource: e.compiledArtifactsSource })]); - return await resolveRuntimeAgentGraph({ - manifest: t, - moduleMap: n - }); -} -function collectNodeSandboxes(e) { - return [...e.nodesByNodeId.entries()].flatMap(([e, t]) => { - let n = t.sandboxRegistry.sandbox; - return n === null ? [] : [{ - ...n, - nodeId: e - }]; - }); -} -function formatLabel(e) { - return e === ROOT_RUNTIME_AGENT_NODE_ID ? `root` : e; -} -function createPrewarmSignature(e) { - return e.map((e) => e.signature).sort().join(` -`); -} -function formatSandboxTemplateCount(e) { - return `${e} sandbox ${e === 1 ? `template` : `templates`}`; -} -function shouldLogSandboxPrewarmProgress(e) { - return !e.startsWith(`checking `) && !e.startsWith(`reusing `) && e !== `loading microsandbox runtime` && e !== `microsandbox runtime ready`; -} -function formatPrewarmFailureForEnvironment(e) { - return !isVercelEnvironment() || !isLocalSandboxBackend(e.backendName) ? e.error : Error(`The ${e.backendName} sandbox backend is not available when deploying on Vercel. Vercel build containers cannot run local Docker containers or microsandbox VMs. Use defaultBackend() so eve selects Vercel Sandbox on Vercel, or configure a Vercel-compatible backend explicitly, such as vercel(). Original ${e.backendName} error: ${toErrorMessage(e.error)}`, { cause: e.error }); -} -function isVercelEnvironment() { - return !!process.env.VERCEL?.trim(); -} -function isLocalSandboxBackend(e) { - return e === `docker` || e === `microsandbox`; -} -//#endregion -//#region node_modules/eve/dist/src/execution/sandbox/development-prewarm.js -const pendingDevelopmentPrewarms = /* @__PURE__ */ new Map(); -async function waitForDevelopmentSandboxPrewarm(e) { - let t = findPendingPrewarm(resolvePrewarmKeys(e)); - if (t === void 0) return; - let unsubscribe; - if (e.log !== void 0) { - for (let n of t.logs) e.log(n); - let subscriber = (t) => e.log?.(t); - t.subscribers.add(subscriber), unsubscribe = () => t.subscribers.delete(subscriber); - } - try { - await withProgressHeartbeat(`waiting for background sandbox template prewarm`, e.log, () => t.promise); - } finally { - unsubscribe?.(); - } -} -function resolvePrewarmKeys(e) { - let t = /* @__PURE__ */ new Set([e.appRoot]), i = getRuntimeCompiledArtifactsAppRoot(e.compiledArtifactsSource); - i !== void 0 && t.add(i); - let a = getRuntimeCompiledArtifactsSandboxAppRoot(e.compiledArtifactsSource); - return a !== void 0 && t.add(a), [...t]; -} -function findPendingPrewarm(e) { - for (let t of e) { - let e = pendingDevelopmentPrewarms.get(t); - if (e !== void 0) return e; - } -} -async function withProgressHeartbeat(e, t, n) { - if (t === void 0) return await n(); - let r = Date.now(), i = setInterval(() => { - t(`${e} (${Math.round((Date.now() - r) / 1e3)}s elapsed)`); - }, 1e4); - i.unref?.(); - try { - return await n(); - } finally { - clearInterval(i); - } -} -//#endregion -//#region node_modules/eve/dist/src/execution/sandbox/ensure.js -async function ensureSandboxAccess(n) { - let i = n.state?.initialized ?? !1, o = n.state?.session ?? null, s = getRuntimeCompiledArtifactsSandboxAppRoot(n.compiledArtifactsSource) ?? process.cwd(), c = n.registry.sandbox, l; - function getHandle() { - return l === void 0 && (l = createHandle().catch((e) => { - throw l = void 0, e; - })), l; - } - async function createHandle() { - if (c === null) return null; - let a = c.definition, l = a.backend, u = createRuntimeSandboxTemplatePlan({ - definition: a, - workspaceResourceRoot: c.workspaceResourceRoot - }), d = await createRuntimeSandboxKeys({ - backendName: l.name, - compiledArtifactsSource: n.compiledArtifactsSource, - nodeId: n.nodeId, - sessionId: n.sessionId, - sourceId: a.sourceId, - templatePlan: u - }); - d.templateKey !== null && (await waitForDevelopmentSandboxPrewarm({ - appRoot: s, - compiledArtifactsSource: n.compiledArtifactsSource, - log: (e) => logDevelopmentSandbox(`eve: sandbox template "${formatNodeLabel(n.nodeId)}" (${l.name}): ${e}`) - }), await waitForSandboxTemplatePrewarmLock({ - appRoot: s, - backendName: l.name, - log: (e) => logDevelopmentSandbox(`eve: sandbox template "${formatNodeLabel(n.nodeId)}" (${l.name}): ${e}`), - templateKey: d.templateKey - })); - let f = { - existingMetadata: o?.backendName === l.name && o.sessionKey === d.sessionKey ? o.metadata : void 0, - runtimeContext: { appRoot: s }, - sessionKey: d.sessionKey, - tags: n.tags, - templateKey: d.templateKey - }, p = await withDevelopmentSandboxProgress(`eve: opening sandbox session "${formatNodeLabel(n.nodeId)}" on backend "${l.name}"...`, `eve: opening sandbox session "${formatNodeLabel(n.nodeId)}" on backend "${l.name}"`, async () => await createBackendHandleWithPrewarmRetry({ - appRoot: s, - backend: l, - compiledArtifactsSource: n.compiledArtifactsSource, - createInput: f - })); - return markDevelopmentSandboxBackendInitialized(l.name), i ||= (await runOnSession(async () => { - await a.onSession?.({ - ctx: buildCallbackContext(), - use: p.useSessionFn - }); - }), !0), p; - } - async function runOnSession(e) { - if (n.runOnSession !== void 0) { - await n.runOnSession(e); - return; - } - await e(); - } - return { - async captureState() { - if (l !== void 0) { - let e = await l; - e !== null && (o = await e.captureState()); - } - return { - initialized: i, - session: o - }; - }, - async dispose() { - l !== void 0 && await (await l)?.dispose(); - }, - async get() { - return (await getHandle())?.session ?? null; - } - }; -} -async function createBackendHandleWithPrewarmRetry(e) { - try { - return await e.backend.create(e.createInput); - } catch (t) { - if (e.createInput.templateKey === null || e.compiledArtifactsSource.kind !== `disk` || !SandboxTemplateNotProvisionedError.is(t)) throw t; - return await prewarmAppSandboxes({ - appRoot: e.appRoot, - compiledArtifactsSource: e.compiledArtifactsSource, - log: (e) => logDevelopmentSandbox(e) - }), await waitForSandboxTemplatePrewarmLock({ - appRoot: e.appRoot, - backendName: e.backend.name, - log: (e) => logDevelopmentSandbox(`eve: ${e}`), - templateKey: e.createInput.templateKey - }), logDevelopmentSandbox(`eve: sandbox template is ready; retrying sandbox creation...`), await e.backend.create(e.createInput); - } -} -function logDevelopmentSandbox(e) { - isEveDevEnvironment() && console.log(e); -} -async function withDevelopmentSandboxProgress(e, t, r) { - if (logDevelopmentSandbox(e), !isEveDevEnvironment()) return await r(); - let i = Date.now(), a = setInterval(() => { - logDevelopmentSandbox(`${t} (${Math.round((Date.now() - i) / 1e3)}s elapsed)...`); - }, 5e3); - a.unref?.(); - try { - return await r(); - } finally { - clearInterval(a); - } -} -function formatNodeLabel(e) { - return e === `__root__` ? `root` : e; -} -//#endregion -//#region node_modules/eve/dist/src/context/providers/sandbox.js -const sandboxProvider = { - key: SandboxKey, - async create(e, t) { - let r = e.get(BundleKey); - if (r === void 0) return; - let i = getActiveRuntimeNode(e), a = i.sandboxRegistry, o = e.require(SessionIdKey), s = e.get(ChannelKey), c = s?.state, l = c?.sandboxSessionId ?? o, u = c?.parentSandboxState; - return { value: await ensureSandboxAccess({ - compiledArtifactsSource: r.compiledArtifactsSource, - nodeId: i.nodeId, - registry: a, - runOnSession: async (t) => await contextStorage.run(e, t), - sessionId: l, - state: t.sandboxState ?? u ?? null, - tags: { - agent: resolveTagAgentName({ - bundle: r, - node: i - }), - channel: resolveTagChannelKind(s), - sessionId: o - } - }) }; - }, - async commit(e, t) { - let n = await e.captureState(); - return { - ...t, - sandboxState: n - }; - } -}; -function resolveTagAgentName(e) { - let t = e.node, n = e.bundle; - return t.agent?.config?.name ?? n.resolvedAgent?.config?.name ?? t.nodeId ?? `unknown`; -} -function resolveTagChannelKind(t) { - return t === void 0 ? `unknown` : getAdapterKind(t); -} -//#endregion -//#region node_modules/eve/dist/src/context/providers/session.js -const sessionProvider = { - key: SessionKey, - create(e, t) { - let n = e.require(AuthKey), r = getHarnessEmissionState(t.state), i = r.turnId.length > 0 ? r.turnId : `turn_${r.sequence}`; - return { value: Object.freeze({ - auth: { - current: n, - initiator: e.get(InitiatorAuthKey) ?? n - }, - parent: e.get(ParentSessionKey), - sessionId: e.require(SessionIdKey), - turn: { - id: i, - sequence: r.sequence - } - }) }; - } -}; -//#endregion -//#region node_modules/eve/dist/src/context/run-step.js -const frameworkProviders = [ - sessionProvider, - connectionProvider, - sandboxProvider -]; -async function withContextScope(t, n, r) { - let a = n; - t.clearVirtualContext(); - for (let e of frameworkProviders) { - let n = await e.create(t, a); - n !== void 0 && (t.setVirtualContext(e.key, n.value), n.session !== void 0 && (a = n.session)); - } - let o = await contextStorage.run(t, () => r(a)), s = o.session; - for (let e of frameworkProviders) e.commit && t.has(e.key) && (s = await e.commit(t.require(e.key), s)); - return s === o.session ? o : { - result: o.result, - session: s - }; -} -async function runStep(e, t, n) { - let { result: r, session: i } = await withContextScope(e, t, async (e) => { - let t = await n(e); - return { - result: t.next, - session: t.session - }; - }); - return { - next: r, - session: i - }; -} -//#endregion -//#region node_modules/eve/dist/src/channel/resolve-text.js -function resolveTextToResponse(e, t) { - let n = e.trim(); - if (n.length === 0) return; - let r = n.toLowerCase(); - if (t.options !== void 0 && t.options.length > 0) { - let e = matchOption(r, t.options); - if (e !== void 0) return { - requestId: t.requestId, - optionId: e.id - }; - } - if ((t.allowFreeform === !0 || t.options === void 0 || t.options.length === 0) && n.length > 0) return { - requestId: t.requestId, - text: n - }; -} -function resolveTextToResponses(e, t) { - let n = []; - for (let r of t) { - let t = resolveTextToResponse(e, r); - t !== void 0 && n.push(t); - } - return n; -} -function matchOption(e, t) { - let n = t.find((t) => t.id.toLowerCase() === e); - if (n !== void 0) return n; - let r = t.find((t) => t.label.toLowerCase() === e); - if (r !== void 0) return r; - let i = Number(e); - if (Number.isInteger(i) && i > 0 && i <= t.length) return t[i - 1]; -} -//#endregion -//#region node_modules/eve/dist/src/harness/input-requests.js -const PENDING_INPUT_BATCH_KEY = `eve.runtime.pendingInputBatch`; -const APPROVED_TOOLS_KEY = `eve.runtime.hitl.approvedTools`; -const DEFERRED_STEP_INPUT_KEY = `eve.runtime.deferredStepInput`; -const TOOL_EXECUTION_DENIED_MESSAGE = `Tool execution was denied.`; -function hasStepInput(e) { - return e === void 0 ? !1 : e.message !== void 0 || (e.inputResponses?.length ?? 0) > 0; -} -function consumeDeferredStepInput(e) { - let t = getDeferredStepInput(e.session); - if (t === void 0) return e; - let r = clearDeferredStepInput(e.session); - return e.input === void 0 ? { - input: t, - session: r - } : { - input: coalesceTurnInputs(t, e.input), - session: r - }; -} -function hasDeferredStepInput(e) { - return getDeferredStepInput(e) !== void 0; -} -function resolvePendingInput(e) { - let { stepInput: t } = e, n = e.session, r = [...e.history ?? n.history], i = getPendingInputBatch(n.state); - if (i === void 0) return { - outcome: `continue`, - messages: r, - session: n - }; - let a = resolveTextMessageInput(i, t), o = a?.inputResponses ?? []; - if (o.length === 0 && a?.message === void 0) return { - outcome: `unresolved`, - messages: r, - session: n - }; - if (i.requests.some((e) => isApprovalRequest(e)) && hasUnansweredApproval({ - pendingBatch: i, - responses: o - })) return n = queueDeferredStepInput(n, compactStepInput(a)), { - deferredMessage: !0, - outcome: `unresolved`, - messages: r, - session: n - }; - if (o.length === 0 && a?.message !== void 0) { - let e = buildToolResponseParts(i, []), t = [...r, ...i.responseMessages]; - e.length > 0 && t.push({ - content: e, - role: `tool` - }); - let o = buildRejectedActionBatch(i, []); - return n = clearPendingInputBatch(n), { - consumedMessage: a?.messageConsumed, - outcome: `resolved`, - messages: t, - rejectedActions: o, - session: n - }; - } - n = recordApprovedTools({ - pendingBatch: i, - resolveApprovalKey: e.resolveApprovalKey, - responses: o, - session: n - }); - let s = buildToolResponseParts(i, o), c = [...r, ...i.responseMessages]; - s.length > 0 && c.push({ - content: s, - role: `tool` - }); - let l = buildRejectedActionBatch(i, o); - return n = clearPendingInputBatch(n), a?.message !== void 0 && i.requests.some((e) => isApprovalRequest(e)) ? (n = queueDeferredStepInput(n, { message: a.message }), { - consumedMessage: a?.messageConsumed, - deferredMessage: !0, - outcome: `resolved`, - messages: c, - rejectedActions: l, - session: n - }) : { - consumedMessage: a?.messageConsumed, - outcome: `resolved`, - messages: c, - rejectedActions: l, - session: n - }; -} -function resolveTextMessageInput(t, n) { - if (typeof n?.message != `string` || (n.inputResponses?.length ?? 0) > 0) return n; - let r = resolveTextToResponses(n.message, t.requests); - return r.length === 0 ? n : compactStepInput({ - ...n, - inputResponses: r, - messageConsumed: !0, - message: void 0 - }); -} -function compactStepInput(e) { - if (e === void 0) return {}; - let t = {}; - return (e.context?.length ?? 0) > 0 && (t.context = e.context), (e.inputResponses?.length ?? 0) > 0 && (t.inputResponses = e.inputResponses), e.message !== void 0 && (t.message = e.message), e.messageConsumed === !0 && (t.messageConsumed = !0), e.outputSchema !== void 0 && (t.outputSchema = e.outputSchema), t; -} -function hasUnansweredApproval(e) { - let t = new Set(e.responses.map((e) => e.requestId)); - return e.pendingBatch.requests.some((e) => isApprovalRequest(e) && !t.has(e.requestId)); -} -function hasPendingInputBatch(e) { - return getPendingInputBatch(e) !== void 0; -} -function getPendingInputBatch(e) { - let t = e?.[PENDING_INPUT_BATCH_KEY]; - if (typeof t != `object` || !t) return; - let n = t; - if (!(!Array.isArray(n.requests) || !Array.isArray(n.responseMessages))) return n; -} -function setPendingInputBatch(e) { - let t = { ...e.session.state }; - return t[PENDING_INPUT_BATCH_KEY] = { - event: e.event, - requests: [...e.requests], - responseMessages: [...e.responseMessages] - }, { - ...e.session, - state: t - }; -} -function clearPendingInputBatch(e) { - if (e.state?.[PENDING_INPUT_BATCH_KEY] === void 0) return e; - let t = { ...e.state }; - return delete t[PENDING_INPUT_BATCH_KEY], { - ...e, - state: Object.keys(t).length > 0 ? t : void 0 - }; -} -function getDeferredStepInput(e) { - return e.state?.[DEFERRED_STEP_INPUT_KEY]; -} -function queueDeferredStepInput(e, t) { - let r = getDeferredStepInput(e), i = r === void 0 ? t : coalesceTurnInputs(r, t), o = { ...e.state }; - return o[DEFERRED_STEP_INPUT_KEY] = i, { - ...e, - state: o - }; -} -function clearDeferredStepInput(e) { - if (e.state?.[DEFERRED_STEP_INPUT_KEY] === void 0) return e; - let t = { ...e.state }; - return delete t[DEFERRED_STEP_INPUT_KEY], { - ...e, - state: Object.keys(t).length > 0 ? t : void 0 - }; -} -function getApprovedTools(e) { - let t = e.state?.[APPROVED_TOOLS_KEY]; - return Array.isArray(t) ? new Set(t) : /* @__PURE__ */ new Set(); -} -function recordApprovedTools(e) { - let t = new Set(e.responses.filter((e) => e.optionId === `approve`).map((e) => e.requestId)), n = e.pendingBatch.requests.filter((e) => t.has(e.requestId)).map((t) => e.resolveApprovalKey?.(t) ?? t.action.toolName); - if (n.length === 0) return e.session; - let r = getApprovedTools(e.session), a = [.../* @__PURE__ */ new Set([...r, ...n])], o = { ...e.session.state }; - return o[APPROVED_TOOLS_KEY] = a, { - ...e.session, - state: o - }; -} -function resolveApprovalOutcome(e) { - return e === void 0 ? { - approved: !1, - reason: `Ignored because the user continued without responding.`, - status: `ignored` - } : e.optionId === `approve` ? { - approved: !0, - reason: void 0, - status: `approved` - } : e.optionId === `deny` ? { - approved: !1, - reason: TOOL_EXECUTION_DENIED_MESSAGE, - status: `denied` - } : { - approved: !1, - reason: `Invalid approval response.`, - status: `invalid` - }; -} -function buildRejectedActionBatch(e, t) { - if (e.event === void 0) return; - let n = new Map(t.map((e) => [e.requestId, e])), r = []; - for (let t of e.requests) { - if (!isApprovalRequest(t)) continue; - let { approved: e, reason: i, status: a } = resolveApprovalOutcome(n.get(t.requestId)); - e || r.push({ - callId: t.action.callId, - isError: !0, - kind: `tool-result`, - output: { - approval: { - requestId: t.requestId, - status: a - }, - code: `TOOL_EXECUTION_DENIED`, - message: i ?? TOOL_EXECUTION_DENIED_MESSAGE, - tool: { result: `not_run` } - }, - toolName: t.action.toolName - }); - } - return r.length > 0 ? { - event: e.event, - results: r - } : void 0; -} -function buildToolResponseParts(e, t) { - let n = new Map(t.map((e) => [e.requestId, e])), r = []; - for (let t of e.requests) r.push(...buildToolResponsePartsForRequest(t, n.get(t.requestId))); - return r; -} -function buildToolResponsePartsForRequest(e, t) { - if (isApprovalRequest(e)) { - let { approved: n, reason: r } = resolveApprovalOutcome(t), i = [{ - approvalId: e.requestId, - approved: n, - reason: r, - type: `tool-approval-response` - }]; - return n || i.push({ - output: { - type: `execution-denied`, - reason: r - }, - toolCallId: e.action.callId, - toolName: e.action.toolName, - type: `tool-result` - }), i; - } - return [{ - output: { - type: `json`, - value: t === void 0 ? { status: `ignored` } : { - optionId: t.optionId, - text: t.text, - status: `answered` - } - }, - toolCallId: e.action.callId, - toolName: e.action.toolName, - type: `tool-result` - }]; -} -function isApprovalRequest(e) { - return e.options?.length === 2 && e.options[0]?.id === `approve` && e.options[1]?.id === `deny`; -} -function createRuntimeToolCallActionFromToolCall(e) { - return { - callId: e.toolCall.toolCallId, - input: resolveToolCallInputObject(e.toolCall.input), - kind: `tool-call`, - toolName: e.toolCall.toolName - }; -} -function resolveToolCallInputObject(e) { - return e == null ? {} : parseJsonObject(e); -} -//#endregion -//#region node_modules/eve/dist/src/harness/model-call-error.js -const GATEWAY_AUTH_FAILURE_SUMMARY_NAME = `AI Gateway authentication failed`; -const UNSUPPORTED_TOOL_TYPE_REGEX = /tool type ['"]([\w.-]+)['"] is not supported/i; -function summarizeKnownModelCallConfigError(e) { - let t = readErrorName(e), r = readErrorMessage(e); - return t === `GatewayAuthenticationError` || /AI Gateway authentication/i.test(r) ? /Invalid API key/i.test(r) ? { - name: GATEWAY_AUTH_FAILURE_SUMMARY_NAME, - message: "AI Gateway rejected the provided API key. Update or unset `AI_GATEWAY_API_KEY` (check your shell profile if you did not set it for this project) — manage keys at https://vercel.com/dashboard/ai/api-keys. Unsetting it falls back to OIDC via `eve link`." - } : /Invalid OIDC token/i.test(r) ? { - name: GATEWAY_AUTH_FAILURE_SUMMARY_NAME, - message: "AI Gateway rejected the OIDC token. Run `eve link` to refresh `VERCEL_OIDC_TOKEN` in `.env.local`, or set `AI_GATEWAY_API_KEY` — create a key at https://vercel.com/dashboard/ai/api-keys." - } : { - name: GATEWAY_AUTH_FAILURE_SUMMARY_NAME, - message: "AI Gateway received no credentials. Run `eve link` to populate `VERCEL_OIDC_TOKEN`, or set `AI_GATEWAY_API_KEY` — create a key at https://vercel.com/dashboard/ai/api-keys." - } : t === `LoadAPIKeyError` || /API key is missing/i.test(r) ? { - name: `Model provider API key missing`, - message: "The model provider could not load an API key. Export the provider's API key environment variable (for example `AI_GATEWAY_API_KEY` or `OPENAI_API_KEY`) and try again." - } : null; -} -function summarizeKnownModelCallRequestError(e) { - if (e instanceof EmptyModelResponseError) return { - name: `Empty model response`, - message: e.message - }; - let t = readModelCallErrorSignals(e); - return t.statusCode === 400 && isGatewayErrorSignal(t) ? { - name: `AI Gateway model request rejected`, - message: `AI Gateway rejected the model request before the agent produced a response.` - } : null; -} -function extractUnsupportedProviderToolTypes(e) { - let t = /* @__PURE__ */ new Set(); - for (let n of walkCauseChain(e)) { - collectUnsupportedToolTypesFromValue(readObjectField(n, `data`), t); - let e = readStringField(n, `responseBody`); - if (e !== void 0) try { - collectUnsupportedToolTypesFromValue(JSON.parse(e), t); - } catch { - let n = UNSUPPORTED_TOOL_TYPE_REGEX.exec(e); - n?.[1] !== void 0 && t.add(n[1]); - } - } - return [...t]; -} -function collectUnsupportedToolTypesFromValue(t, n) { - if (t != null) { - if (typeof t == `string`) { - let e = UNSUPPORTED_TOOL_TYPE_REGEX.exec(t); - e?.[1] !== void 0 && n.add(e[1]); - return; - } - if (Array.isArray(t)) { - for (let e of t) collectUnsupportedToolTypesFromValue(e, n); - return; - } - if (isObject(t)) for (let e of Object.values(t)) collectUnsupportedToolTypesFromValue(e, n); - } -} -function extractModelCallErrorDetails(e) { - let t = readModelCallErrorSignals(e), n = {}; - return appendJsonField(n, `gatewayName`, t.gatewayName), appendJsonField(n, `gatewayType`, t.gatewayType), appendJsonField(n, `statusCode`, t.statusCode), appendJsonField(n, `generationId`, t.generationId), appendJsonField(n, `upstreamStatusCode`, t.upstreamStatusCode), appendJsonField(n, `upstreamType`, t.upstreamType), appendJsonField(n, `upstreamMessage`, t.upstreamMessage), appendJsonField(n, `responseBodySnippet`, t.responseBodySnippet), n; -} -function readErrorName(t) { - if (t instanceof Error || isObject(t) && typeof t.name == `string`) return t.name; -} -function readErrorMessage(t) { - return t instanceof Error || isObject(t) && typeof t.message == `string` ? t.message : ``; -} -var EmptyModelResponseError = class extends Error { - constructor(e) { - super(`The model did not return a response. Please try again.`, e), this.name = `EmptyModelResponseError`; - } -}; -function isNoOutputGeneratedError(e) { - for (let t of walkCauseChain(e)) if (readErrorName(t) === `AI_NoOutputGeneratedError`) return !0; - return !1; -} -function classifyModelCallError(e) { - if (e instanceof EmptyModelResponseError) return `recoverable`; - if (hasRetryableFlag(e)) return `retry`; - if (summarizeKnownModelCallConfigError(e) !== null) return `terminal`; - let t = readModelCallErrorSignals(e); - if (isRetryableGatewayType(t.gatewayType) || isRetryableGatewayType(t.upstreamType)) return `retry`; - if (isTerminalGatewayType(t.gatewayType) || isTerminalGatewayType(t.upstreamType) || t.gatewayName === `GatewayInvalidRequestError`) return `terminal`; - let n = t.statusCode; - if (n !== void 0) { - if (n === 408 || n === 409 || n === 429 || n >= 500) return `retry`; - if (isAmbiguousGatewayInternalBadRequest(t)) return `recoverable`; - if (n >= 400 && n < 500) return `terminal`; - } - return isLikelyNetworkError(e) ? `retry` : `recoverable`; -} -function hasRetryableFlag(t) { - for (let n of walkCauseChain(t)) if (isObject(n) && n.isRetryable === !0) return !0; - return !1; -} -function isLikelyNetworkError(e) { - if (!(e instanceof Error)) return !1; - let t = e.message.toLowerCase(); - return t.includes(`econnreset`) || t.includes(`etimedout`) || t.includes(`eai_again`) || t.includes(`socket hang up`) || t.includes(`network`) || t.includes(`fetch failed`) ? !0 : e.cause !== void 0 && e.cause !== e ? isLikelyNetworkError(e.cause) : !1; -} -function readModelCallErrorSignals(e) { - let t = findGatewayError(e), n = findUpstreamApiCallError(e), r = readStringField(n, `responseBody`), i = readGatewayErrorBody(n); - return { - gatewayName: readErrorName(t), - gatewayType: readStringField(t, `type`), - generationId: readStringField(t, `generationId`) ?? i?.generationId, - responseBodySnippet: r === void 0 ? void 0 : truncateSnippet(r, 1e3), - statusCode: readStatusCode(t) ?? readStatusCode(n) ?? findStatusCode(e), - upstreamMessage: i?.message, - upstreamStatusCode: readStatusCode(n), - upstreamType: i?.type - }; -} -function findGatewayError(e) { - for (let t of walkCauseChain(e)) { - let e = readErrorName(t), n = readStringField(t, `type`); - if (e?.startsWith(`Gateway`) || n?.endsWith(`_error`) || n === `rate_limit_exceeded`) return t; - } -} -function findUpstreamApiCallError(e) { - for (let t of walkCauseChain(e)) if (readErrorName(t) === `AI_APICallError` || readStringField(t, `responseBody`) !== void 0 || readObjectField(t, `data`) !== void 0 || readObjectField(t, `requestBodyValues`) !== void 0) return t; -} -function readGatewayErrorBody(e) { - let t = readGatewayErrorBodyFromValue(readObjectField(e, `data`)); - if (t !== void 0) return t; - let n = readStringField(e, `responseBody`); - if (n !== void 0) try { - return readGatewayErrorBodyFromValue(JSON.parse(n)); - } catch { - return; - } -} -function readGatewayErrorBodyFromValue(t) { - if (!isObject(t)) return; - let n = readObjectField(t, `error`); - if (n === void 0) return; - let r = readStringField(t, `generationId`), i = readStringField(n, `message`), a = readStringField(n, `type`); - return i === void 0 && a === void 0 && r === void 0 ? void 0 : { - generationId: r, - message: i, - type: a - }; -} -function readStatusCode(t) { - if (isObject(t)) return typeof t.statusCode == `number` ? t.statusCode : void 0; -} -function findStatusCode(e) { - for (let t of walkCauseChain(e)) { - let e = readStatusCode(t); - if (e !== void 0) return e; - } -} -function readStringField(t, n) { - if (!isObject(t)) return; - let r = t[n]; - return typeof r == `string` && r.length > 0 ? r : void 0; -} -function readObjectField(t, n) { - if (!isObject(t)) return; - let r = t[n]; - return isObject(r) ? r : void 0; -} -function isRetryableGatewayType(e) { - return e === `rate_limit_exceeded` || e === `timeout_error`; -} -function isTerminalGatewayType(e) { - return e === `authentication_error` || e === `invalid_request_error` || e === `model_not_found`; -} -function isGatewayErrorSignal(e) { - return e.gatewayName !== void 0 || e.gatewayType !== void 0; -} -function isAmbiguousGatewayInternalBadRequest(e) { - return e.statusCode === 400 && (e.gatewayName === `GatewayInternalServerError` || e.gatewayType === `internal_server_error`) && (e.upstreamType === void 0 || e.upstreamType === `internal_server_error`); -} -function* walkCauseChain(t) { - let n = /* @__PURE__ */ new Set(), r = t; - for (; isObject(r) && !n.has(r);) n.add(r), yield r, r = r.cause; -} -function appendJsonField(e, t, n) { - if (typeof n == `string` && n.length > 0) { - e[t] = n; - return; - } - typeof n == `number` && Number.isFinite(n) && (e[t] = n); -} -function truncateSnippet(e, t) { - return e.length <= t ? e : `${e.slice(0, t)}...`; -} -//#endregion -//#region node_modules/eve/dist/src/harness/input-extraction.js -function extractQuestionInputRequests(n) { - let r = []; - for (let i of n.toolCalls) { - if (i.toolName !== ASK_QUESTION_TOOL_NAME || n.excludedCallIds.has(i.toolCallId)) continue; - let a = createRuntimeToolCallActionFromToolCall({ toolCall: i }), o = a.input, s = { - action: a, - display: `text`, - prompt: String(o.prompt), - requestId: a.callId - }; - o.allowFreeform !== void 0 && (s.allowFreeform = o.allowFreeform), o.options !== void 0 && (s.options = o.options, s.display = `select`), r.push(s); - } - return r; -} -function extractToolApprovalInputRequests(t) { - let n = [], r = /* @__PURE__ */ new Map(); - for (let e of t.content) e.type === `tool-call` && r.set(e.toolCallId, e); - for (let i of t.content) { - if (i.type !== `tool-approval-request`) continue; - let t = i; - if (t.isAutomatic === !0) continue; - let a = t.toolCall ?? (t.toolCallId === void 0 ? void 0 : r.get(t.toolCallId)); - if (a === void 0) continue; - let o = createRuntimeToolCallActionFromToolCall({ toolCall: a }); - n.push({ - action: o, - allowFreeform: !1, - display: `confirmation`, - options: [{ - id: `approve`, - label: `Yes` - }, { - id: `deny`, - label: `No` - }], - prompt: `Approve tool call: ${a.toolName}`, - requestId: t.approvalId - }); - } - return n; -} -//#endregion -//#region node_modules/eve/dist/src/harness/prompt-cache.js -const ANTHROPIC_CACHE_MARKER = Object.freeze({ anthropic: Object.freeze({ cacheControl: Object.freeze({ type: `ephemeral` }) }) }); -function detectPromptCachePath(e) { - return typeof e == `string` ? { kind: `gateway-auto` } : (typeof e.provider == `string` ? e.provider.toLowerCase() : ``).includes(`anthropic`) ? { kind: `anthropic-direct` } : { kind: `none` }; -} -function getAnthropicCacheMarker() { - return ANTHROPIC_CACHE_MARKER; -} -function mergeGatewayAutoCaching(e) { - let t = e?.gateway !== void 0 && typeof e.gateway == `object` && e.gateway !== null ? e.gateway : void 0, n = { - ...t, - caching: t?.caching ?? `auto` - }; - return { - ...e, - gateway: n - }; -} -function applyLastToolCacheBreakpoint(e, t) { - let n = Object.entries(e); - if (n.length === 0) return e; - let r = {}; - for (let e = 0; e < n.length; e++) { - let [i, a] = n[e]; - if (e === n.length - 1) { - let e = a.providerOptions !== void 0 && typeof a.providerOptions == `object` ? a.providerOptions : void 0; - r[i] = { - ...a, - providerOptions: { - ...e, - ...t - } - }; - } else r[i] = a; - } - return r; -} -function applySystemCacheBreakpoint(e, t) { - if (e.length === 0) return [...e]; - let n = [...e], r = n[n.length - 1]; - return n[n.length - 1] = { - ...r, - providerOptions: { - ...r.providerOptions, - ...t - } - }, n; -} -function applyConversationCacheControl(e, t) { - if (e.length === 0) return [...e]; - let n = [...e], r = !1, i = !1; - for (let e = n.length - 1; e >= 0 && (!r || !i); e--) { - let a = n[e]; - a !== void 0 && (!r && a.role === `assistant` ? (n[e] = { - ...a, - providerOptions: { - ...a.providerOptions, - ...t - } - }, r = !0) : !i && a.role === `user` && (n[e] = { - ...a, - providerOptions: { - ...a.providerOptions, - ...t - } - }, i = !0)); - } - return n; -} -//#endregion -//#region node_modules/eve/dist/src/context/build-dynamic-tools.js -const log$5 = createLogger(`dynamic-tools`); -function lookupStepFunction(e) { - try { - let t = globalThis[Symbol.for(`@workflow/core//registeredSteps`)]; - return t === void 0 ? null : t.get(e) || null; - } catch { - return null; - } -} -function replayTools(e) { - let t = []; - for (let n of e) { - if (!n.executeStepFnName || !n.closureVars) { - log$5.warn(`Dynamic tool "${n.name}" has no registered step function — skipping on this step. The bundler transform may not have processed this tool file.`); - continue; - } - let e = lookupStepFunction(n.executeStepFnName); - if (!e) { - log$5.warn(`Dynamic tool "${n.name}" references step function "${n.executeStepFnName}" which is not registered — skipping on this step.`); - continue; - } - t.push({ - description: n.description, - execute: (t) => e(n.closureVars, t, buildCallbackContext()), - inputSchema: jsonSchema(n.inputSchema), - name: n.name, - approval: buildReplayedApproval(n), - outputSchema: n.outputSchema === void 0 ? void 0 : jsonSchema(n.outputSchema) - }); - } - return t; -} -function buildReplayedApproval(e) { - if (e.approvalStepFnName === void 0) return; - let t = lookupStepFunction(e.approvalStepFnName); - return t === null ? (log$5.warn(`Dynamic tool "${e.name}" references approval function "${e.approvalStepFnName}" which is not registered — requiring approval by default.`), () => `user-approval`) : async (n) => await t(e.closureVars ?? {}, n); -} -function buildDynamicTools(e) { - let r = e.get(LiveStepToolsKey) ?? [], i = replayTools(e.get(TurnDynamicToolMetadataKey) ?? []), a = replayTools(e.get(SessionDynamicToolMetadataKey) ?? []); - return [ - ...r, - ...i, - ...a - ]; -} -//#endregion -//#region node_modules/eve/dist/src/internal/attachments/errors.js -var EveAttachmentError = class extends Error { - kind; - adapterKind; - cause; - constructor(e) { - super(e.message), this.name = `EveAttachmentError`, this.kind = e.kind, e.adapterKind !== void 0 && (this.adapterKind = e.adapterKind), e.cause !== void 0 && (this.cause = e.cause); - } -}; -//#endregion -//#region node_modules/eve/dist/src/harness/attachment-staging.js -const ATTACHMENTS_ROOT = `/workspace/attachments`; -const UNSAFE_FILENAME_CHARS = /[^\w.-]+/g; -async function stageAttachmentsForAdapter(e, t, n) { - if (typeof e == `string`) return e; - let r = reconstitueFilePartUrls(e); - return Promise.all(r.map(async (e) => e.type === `file` ? stageFilePart(e, t, n) : e)); -} -async function stageAttachmentsToSandbox(t) { - if (typeof t == `string` || !Array.isArray(t) || !hasFileParts(t)) return t; - let n = loadContext(), r = n.get(SandboxKey); - if (r === void 0) return t; - let a = await r.get(); - if (a === null) return t; - let o = n.get(ChannelKey); - return stageAttachmentsForAdapter(t, a, o ? buildAdapterContext(o, n) : { - ctx: n, - state: {}, - session: buildSessionHandle(n) - }); -} -async function hydrateSandboxAttachments(e) { - if (!messagesContainSandboxRef(e)) return e; - let t = loadContext().get(SandboxKey); - if (t === void 0) throw Error(`Cannot hydrate sandbox-ref FilePart: no SandboxKey is bound on the active eve context. Hydration must run inside a step scope with the framework sandbox provider installed.`); - let n = await t.get(); - if (n === null) throw Error(`Cannot hydrate sandbox-ref FilePart: SandboxKey is bound but no active sandbox session is available.`); - return Promise.all(e.map(async (e) => { - if (!messageContainsSandboxRef(e)) return e; - let t = await hydrateMessageContent(e.content, n); - return { - ...e, - content: t - }; - })); -} -function hasFileParts(e) { - for (let t of e) if (t.type === `file`) return !0; - return !1; -} -function messagesContainSandboxRef(e) { - for (let t of e) if (messageContainsSandboxRef(t)) return !0; - return !1; -} -function messageContainsSandboxRef(e) { - let t = e.content; - if (!Array.isArray(t)) return !1; - for (let e of t) if (isSandboxRefFilePart(e)) return !0; - return !1; -} -function isSandboxRefFilePart(e) { - return typeof e == `object` && !!e && e.type === `file` && isSandboxRefUrl(e.data); -} -async function hydrateMessageContent(e, t) { - return Array.isArray(e) ? Promise.all(e.map(async (e) => { - if (!isSandboxRefFilePart(e)) return e; - let n = e, r = decodeSandboxRef(n.data); - if (!shouldInlineSandboxRefAsBytes(r)) return renderSandboxRefAsTextPart(r); - let i = await t.readBinaryFile({ path: r.path }); - if (i === null) throw Error(`Sandbox-ref FilePart references missing file: "${r.path}". The staging pipeline invariant (every eve-sandbox: ref has bytes on disk) was violated.`); - return { - ...n, - data: i, - mediaType: r.mediaType - }; - })) : e; -} -function shouldInlineSandboxRefAsBytes(e) { - return e.mediaType.startsWith(`image/`) ? e.size <= 3145728 : e.mediaType === `application/pdf` ? e.size <= 20971520 : !1; -} -function renderSandboxRefAsTextPart(e) { - return { - text: `Attached file ${e.path} (${e.mediaType})`, - type: `text` - }; -} -async function stageFilePart(e, t, n) { - if (isSandboxRefUrl(e.data)) return e; - if (e.data instanceof URL && e.data.protocol !== `data:`) { - let r = await tryFetchFile(e.data.href, n); - return r === null ? e : stageResolvedBytes(e, r, t); - } - let r = await fileDataToBytes(e.data); - return r === null ? e : stageResolvedBytes(e, { bytes: r }, t); -} -async function stageResolvedBytes(e, t, n) { - let r = t.bytes, i = sha256Prefix(r), a = t.mediaType ?? e.mediaType ?? `application/octet-stream`, o = `${ATTACHMENTS_ROOT}/${i}/${safeFilename(t.filename ?? e.filename, i)}`; - await n.writeBinaryFile({ - content: r, - path: o - }); - let s = n.resolvePath(o); - return { - ...e, - data: encodeSandboxRef({ - mediaType: a, - path: s, - size: r.byteLength - }), - filename: s, - mediaType: a - }; -} -async function tryFetchFile(e, n) { - let r = n.ctx.get(ChannelKey); - if (r?.fetchFile === void 0) return null; - let i = getAdapterKind(r); - try { - let t = await r.fetchFile(e); - return t === null ? null : Buffer.isBuffer(t) ? { bytes: t } : t; - } catch (e) { - throw e instanceof EveAttachmentError ? e : new EveAttachmentError({ - adapterKind: i, - cause: e, - kind: `resolver-threw`, - message: `fetchFile for adapter kind="${i}" threw: ${toErrorMessage(e)}` - }); - } -} -function reconstitueFilePartUrls(e) { - let t = !1, i = e.map((e) => e.type === `file` && isSerializedUrlFilePart(e.data) ? (t = !0, { - ...e, - data: deserializeUrlFilePart(e.data) - }) : e); - return t ? i : e; -} -function sha256Prefix(e) { - return createHash(`sha256`).update(e).digest(`hex`).slice(0, 16); -} -function safeFilename(e, t) { - if (e === void 0) return `file-${t}`; - let n = basename(e).replace(UNSAFE_FILENAME_CHARS, `_`); - return n.length > 0 ? n : `file-${t}`; -} -//#endregion -//#region node_modules/eve/dist/src/harness/workflow-tool-description.js -function workflowToolDescription(e) { - let t = e.length > 0 ? e : [`agent`], n = t.map((e) => `\`${e}\``).join(`, `), r = t.filter((e) => e !== `agent`); - return `Use \`Workflow\` when a task needs JavaScript to coordinate multiple child-agent calls as one durable step. It is an orchestration tool, not a general-purpose tool runner. - -Use \`Workflow\` for: -- fan-out or map-reduce over a list, especially when the number of calls comes from runtime data; -- dependent pipelines where one agent's result becomes another agent's input; -- conditional branches or follow-up calls chosen from earlier results; -- deterministic filtering, sorting, or aggregation of several agent results before returning one value. - -Do not use \`Workflow\` when: -- one delegation, or a small fixed set of unrelated delegations, can be called directly; -- no child-agent call is needed; -- the task needs files, network, shell, connections, skills, or ordinary tools — none are available inside Workflow; -- JavaScript would only wrap work the parent agent can express more clearly with direct calls. - -Workflow earns its overhead when code materially controls call count, concurrency, ordering, data flow, or aggregation. Put the complete orchestration in one JavaScript program and return the final JSON-serializable value. - -The only callable operations are these agents — no filesystem, network, shell, or other tools: ${n}. Call them only through the \`tools\` object, using the exact member syntax in the API reference below. Each call is async and resolves to the child's result, or a typed object when you pass an \`outputSchema\`. Sequence with \`await\`, run agents concurrently with \`Promise.all([...])\`, and use \`map\`/\`filter\`/\`flatMap\` to build calls and combine results. The program's return value becomes the tool result. - -Example — fan out across areas with \`agent\`, then pipe the results into a synthesis step: -\`\`\`js -const areas = ["correctness", "security", "performance"]; -const reviews = await Promise.all( - areas.map((area) => - tools.agent({ - message: \`Review the change for \${area}.\`, - outputSchema: { type: "object", properties: { findings: { type: "array", items: { type: "string" } } } }, - }), - ), -); -const verdict = await tools.agent({ - message: \`Summarize these findings into a verdict: \${JSON.stringify(reviews)}\`, - outputSchema: { type: "object", properties: { verdict: { type: "string" }, blocking: { type: "boolean" } } }, -}); -return verdict; -\`\`\`${r.length > 0 ? `\n\nDeclared subagents use the same API — e.g. \`const note = await ${agentAccess(r[0])}({ message: "..." });\`.` : ``}`; -} -function agentAccess(e) { - return /^[A-Za-z_$][A-Za-z0-9_$]*$/u.test(e) ? `tools.${e}` : `tools[${JSON.stringify(e)}]`; -} -//#endregion -//#region node_modules/eve/dist/src/harness/workflow-sandbox.js -async function applyWorkflowTool(t) { - let i = createWorkflowHostTools(t.harnessTools, Object.keys(t.tools)); - if (Object.keys(i).length === 0) return { - hostTools: i, - modelTools: t.tools - }; - let a = await createWorkflowSandboxTool({ - continuationSecurity: t.continuationSecurity, - hostTools: i, - lifecycle: t.lifecycle - }), s = typeof a.description == `string` ? a.description : ``, c = workflowToolDescription(Object.keys(i)), l = workflowApiReference(s), u = { ...t.tools }; - return u[WORKFLOW_TOOL_NAME] = { - ...a, - description: l.length > 0 ? `${c}\n\n${l}` : c, - inputSchema: jsonSchema({ - type: `object`, - properties: { js: { - type: `string`, - description: `Complete JavaScript orchestration program. Call only the agents listed in the Workflow description and return one JSON-serializable result.` - } }, - required: [`js`], - additionalProperties: !1 - }) - }, { - hostTools: i, - modelTools: u - }; -} -function workflowApiReference(e) { - let t = e.indexOf(`Tools: -`); - return t < 0 ? e : `Available agent API:\n${e.slice(t + 7)}`; -} -function buildWorkflowHostTools(e) { - return createWorkflowHostTools(e.tools, e.tools.keys()); -} -function createWorkflowHostTools(e, t) { - let n = {}; - for (let r of t) { - let t = e.get(r); - t?.runtimeAction !== void 0 && (n[r] = createWorkflowRuntimeActionHostTool(t)); - } - return n; -} -function createWorkflowRuntimeActionHostTool(e) { - return { - description: e.description, - inputSchema: e.inputSchema, - execute: async (n, r) => { - let o = readWorkflowSandboxResolution(r); - return o === void 0 ? requestWorkflowSandboxInterrupt({ - kind: WORKFLOW_RUNTIME_ACTION_INTERRUPT_KIND, - runtimeAction: e.runtimeAction, - toolInput: n, - toolName: e.name - }) : o; - } - }; -} -//#endregion -//#region node_modules/eve/dist/src/harness/workflow-continuation-security.js -const WORKFLOW_CONTINUATION_SECURITY_KEY = `eve.harness.workflowContinuationSecurity`; -function ensureWorkflowContinuationSecurity(t) { - return t.state?.[WORKFLOW_CONTINUATION_SECURITY_KEY] === void 0 ? { - ...t, - state: { - ...t.state, - [WORKFLOW_CONTINUATION_SECURITY_KEY]: { - signingKey: randomBytes(32).toString(`base64url`), - version: 1 - } - } - } : (getWorkflowContinuationSecurity(t), t); -} -function getWorkflowContinuationSecurity(e) { - let t = e.state?.[WORKFLOW_CONTINUATION_SECURITY_KEY]; - if (typeof t != `object` || !t || t.version !== 1 || typeof t.signingKey != `string` || !/^[A-Za-z0-9_-]{43}$/.test(t.signingKey)) throw Error(`Workflow continuation security state is missing or invalid.`); - return { - signingKey: t.signingKey, - maxAgeMs: 31536e6 - }; -} -//#endregion -//#region node_modules/eve/dist/src/harness/workflow-lifecycle.js -const log$4 = createLogger(`harness.workflow-lifecycle`); -function createWorkflowLifecycle(e) { - return { - onHookError(e, t) { - log$4.warn(`workflow lifecycle hook failed`, { - error: e, - hook: t.hook - }); - }, - async onNestedToolCall(t) { - if (e.skipReplayed === !0 && t.replayed) return; - let n = { - input: t.input, - toolCallId: t.toolCallId, - toolName: t.toolName, - type: `tool-call` - }; - await e.emit(createActionsRequestedEvent({ - actions: [createRuntimeActionRequestFromToolCall({ - toolCall: n, - tools: e.tools - })], - sequence: e.emissionState.sequence, - stepIndex: e.emissionState.stepIndex, - turnId: e.emissionState.turnId - })); - }, - async onNestedToolResult(r) { - if (e.skipReplayed === !0 && r.replayed || r.status === `interrupted`) return; - let i = createRuntimeToolResultFromValue({ - callId: r.toolCallId, - output: r.status === `rejected` ? toErrorMessage(r.error) : r.output, - toolName: r.toolName, - isError: r.status === `rejected` - }); - await e.emit(createActionResultEvent({ - result: i, - sequence: e.emissionState.sequence, - stepIndex: e.emissionState.stepIndex, - turnId: e.emissionState.turnId - })); - } - }; -} -//#endregion -//#region node_modules/eve/dist/src/harness/compaction.js -const COMPACTION_SYSTEM_PROMPT = [ - `You are a conversation summarizer.`, - `Write a concise but useful summary for continuing the work.`, - `Preserve the goal, important instructions, technical decisions, discoveries, open work, and relevant tool results.`, - `Use the same language as the conversation.`, - `Prefer short labeled sections such as Goal, Instructions, Discoveries, Accomplished, and Next steps when helpful.`, - `Do not answer questions or invent facts.` -].join(` `); -function estimateTokens(e) { - return JSON.stringify(e).length / 4; -} -function getInputTokenCount(e, t) { - let n = t.lastKnownInputTokens, r = t.lastKnownPromptMessageCount; - return n === void 0 || r === void 0 || !Number.isInteger(r) || r < 0 || r > e.length ? estimateTokens(e) : n + estimateTokens(e.slice(r)); -} -function shouldCompact(e, t) { - return getInputTokenCount(e, t) > t.threshold; -} -async function resolveCompactionModel(e) { - let t = e.compactionModelReference ?? e.modelReference; - return { - model: t === e.modelReference ? e.model : await e.resolveModel(t), - providerOptions: t.providerOptions - }; -} -async function compactMessages(n, r, i, a, o, s) { - let c = selectRecentWindowSize(n, i); - for (;;) { - let { older: l, recent: u } = splitMessagesForCompaction(n, c); - if (l.length === 0) return keepNonToolResultMessages(u); - let d = await generateText({ - headers: s, - model: r, - prompt: formatCompactionPrompt(l.map((e) => ({ - content: summarizeCompactionMessageContent(e), - role: e.role - }))), - providerOptions: a, - system: COMPACTION_SYSTEM_PROMPT, - telemetry: o ? { - ...o, - functionId: `eve.compaction` - } : void 0, - temperature: 0 - }), f = keepNonToolResultMessages(u), p = f.at(-1)?.role, m = p === void 0 || p === `assistant` ? [{ - role: `user`, - content: `Continue.` - }] : [], h = [ - { - content: `Summary of our conversation so far:`, - role: `user` - }, - { - content: d.text, - role: `assistant` - }, - ...f, - ...m - ]; - if (estimateTokens(h) <= i.threshold || c === 0) return h; - --c; - } -} -function keepNonToolResultMessages(e) { - let t = []; - for (let n of e) if (n.role !== `tool`) { - if (n.role === `assistant`) { - let e = assistantMessageText(n); - e.length > 0 && t.push({ - content: e, - role: `assistant` - }); - continue; - } - t.push(n); - } - return t; -} -function assistantMessageText(e) { - return typeof e.content == `string` ? e.content.trim() : e.content.filter((e) => e.type === `text`).map((e) => e.text).join(``).trim(); -} -function selectRecentWindowSize(e, t) { - let n = Math.min(t.recentWindowSize, Math.max(e.length - 1, 0)), r = resolveCompactionSummaryReserve(t), i = 0, a = 0; - for (let o = e.length - 1; o >= 0 && i < n; --o) { - let n = e[o]; - if (n === void 0) continue; - let s = estimateTokens([n]); - if (a + s + r > t.threshold) break; - a += s, i += 1; - } - return i; -} -function resolveCompactionSummaryReserve(e) { - return Math.min(2048, Math.max(64, Math.floor(e.threshold / 4))); -} -function splitMessagesForCompaction(e, t) { - return t <= 0 ? { - older: [...e], - recent: [] - } : { - older: e.slice(0, -t), - recent: e.slice(-t) - }; -} -function formatCompactionPrompt(e) { - let t = e.filter((e) => e.content.trim().length > 0).map((e) => `### ${e.role}\n${e.content.trim()}`); - return t.length === 0 ? `Summarize the conversation so far.` : [`Conversation transcript:`, ...t].join(` - -`); -} -function summarizeCompactionMessageContent(e) { - return typeof e.content == `string` ? summarizeText(e.content) : e.content.map((e) => summarizeCompactionContentPart(e)).filter((e) => e.length > 0).join(` -`).trim(); -} -function summarizeCompactionContentPart(e) { - switch (e.type) { - case `text`: return summarizeText(e.text); - case `reasoning`: return ``; - case `file`: return e.filename ? `Attached file ${e.filename} (${e.mediaType})` : `Attached file attachment (${e.mediaType})`; - case `tool-call`: return summarizeToolCallPart(e); - case `tool-result`: return summarizeToolResultPart(e); - default: return ``; - } -} -function summarizeToolCallPart(e) { - let t = e.input === void 0 ? `` : summarizeCompactValue(e.input); - return t ? `Called ${e.toolName} with ${t}` : `Called ${e.toolName}`; -} -function summarizeToolResultPart(e) { - let t = e.output === void 0 ? `` : summarizeCompactValue(e.output), n = e.isError ? `errored` : `returned`; - return t ? `Tool ${e.toolName} ${n} ${t}` : `Tool ${e.toolName} ${n}`; -} -function summarizeCompactValue(e, t = 0) { - if (e === null) return `null`; - if (e === void 0) return ``; - if (typeof e == `string`) return summarizeText(e); - if (typeof e == `number` || typeof e == `boolean` || typeof e == `bigint`) return String(e); - if (Array.isArray(e)) { - if (e.length === 0) return `array(0)`; - if (t >= 2) return `array(${e.length})`; - let n = e.slice(0, 3).map((e) => summarizeCompactValue(e, t + 1)), r = e.length > 3 ? `, …` : ``; - return `array(${e.length}: ${n.join(`, `)}${r})`; - } - if (typeof e == `object`) { - let n = Object.entries(e); - if (n.length === 0) return `object(0)`; - if (t >= 2) return `object(${n.length} keys)`; - let r = n.slice(0, 3).map(([e, n]) => `${e}=${summarizeCompactValue(n, t + 1)}`), i = n.length > 3 ? `, …` : ``; - return `object(${r.join(`, `)}${i})`; - } - return ``; -} -function summarizeText(e) { - let t = e.replace(/\s+/g, ` `).trim(); - return t.length <= 280 ? t : `${t.slice(0, 280).trimEnd()}…`; -} -//#endregion -//#region node_modules/eve/dist/src/harness/turn-tag-state.js -const HARNESS_TURN_USAGE_STATE_KEY = `eve.harness.turnUsage`; -const ZERO_USAGE = { - cacheReadTokens: 0, - cacheWriteTokens: 0, - inputTokens: 0, - outputTokens: 0 -}; -function getTurnUsageState(t) { - return t?.[HARNESS_TURN_USAGE_STATE_KEY]; -} -function setTurnUsageState(t, n) { - return { - ...t, - state: { - ...t.state, - [HARNESS_TURN_USAGE_STATE_KEY]: n - } - }; -} -function accumulateTurnUsage(e) { - let n = e.previous !== void 0 && e.previous.turnId === e.turnId ? e.previous : { - ...ZERO_USAGE, - turnId: e.turnId - }; - return { - turnId: e.turnId, - cacheReadTokens: n.cacheReadTokens + (e.usage.cachedInputTokens ?? 0), - cacheWriteTokens: n.cacheWriteTokens + (e.usage.inputTokenDetails?.cacheWriteTokens ?? 0), - inputTokens: n.inputTokens + (e.usage.inputTokens ?? 0), - outputTokens: n.outputTokens + (e.usage.outputTokens ?? 0) - }; -} -//#endregion -//#region node_modules/eve/dist/src/internal/workflow/builtins.js -async function __builtin_response_array_buffer() { - return await this.arrayBuffer(); -} -async function __builtin_response_json() { - return await this.json(); -} -async function __builtin_response_text() { - return await this.text(); -} -const EVE_UNSUPPORTED_WORLD_WARNED = Symbol.for(`@workflow/setAttributes//unsupportedWorldWarned`); -function formatUnknownError(e) { - return e instanceof Error ? e.stack ?? `${e.name}: ${e.message}` : String(e); -} -async function __builtin_set_attributes(t, n) { - if (t.length === 0) return; - let r = globalThis, i = r[Symbol.for(`WORKFLOW_STEP_CONTEXT_STORAGE`)]?.getStore?.(), a = typeof i?.stepMetadata?.attempt == `number` ? i.stepMetadata.attempt : 3, o = r[Symbol.for(`@workflow/world//cache`)]; - if (typeof o?.runs?.experimentalSetAttributes != `function`) { - if (r[EVE_UNSUPPORTED_WORLD_WARNED] !== !0) { - r[EVE_UNSUPPORTED_WORLD_WARNED] = !0; - let t = o?.name === void 0 ? `` : ` (${o.name})`; - console.warn(`[eve] setAttributes: the current world implementation${t} does not implement experimentalSetAttributes; this call (and any subsequent setAttributes calls in this process) is a no-op. Attributes will become available once the world adapter adds support.`); - } - return; - } - try { - let e = i?.workflowMetadata?.workflowRunId; - if (e === void 0) throw Error(`__builtin_set_attributes: no workflow run id available in step context`); - await o.runs.experimentalSetAttributes(e, t, n); - } catch (e) { - if (a < 3) throw e; - console.error(`[eve] setAttributes: failed to post tags after 3 attempts; dropping the internal attribute write. ${formatUnknownError(e)}`); - } -} -__builtin_set_attributes.maxRetries = 2; -s$7("__builtin_response_array_buffer", __builtin_response_array_buffer); -s$7("__builtin_response_json", __builtin_response_json); -s$7("__builtin_response_text", __builtin_response_text); -s$7("__builtin_set_attributes", __builtin_set_attributes); -//#endregion -//#region node_modules/eve/dist/src/runtime/attributes/emit.js -let WARNED_ABOUT_TAG_FAILURE = !1; -async function setEveAttributes(e) { - let t = normalizeEveAttributes(e); - if (Object.keys(t).length !== 0) try { - let { experimental_setAttributes: e } = await Promise.resolve().then(() => core_exports); - await e(t, { allowReservedAttributes: !0 }); - } catch (e) { - WARNED_ABOUT_TAG_FAILURE || (WARNED_ABOUT_TAG_FAILURE = !0, console.warn(`[eve] setEveAttributes failed; suppressing further warnings this process.`, { - keys: Object.keys(t), - error: e.message - })); - } -} -//#endregion -//#region node_modules/eve/dist/src/harness/instrumentation-runtime-context.js -const log$3 = createLogger(`harness.instrumentation-runtime-context`); -function buildTelemetryRuntimeContext(e) { - if (e.authored === void 0) return; - let t = resolveStepStartedRuntimeContext(e), r = contextStorage.getStore()?.get(ChannelInstrumentationKey); - return { - ...t, - "eve.channel.kind": normalizeInstrumentationChannelKind(r?.kind), - "eve.environment": e.environment, - "eve.session.id": e.session.sessionId, - "eve.step.index": String(e.emissionState.stepIndex), - "eve.turn.id": e.emissionState.turnId, - "eve.turn.sequence": String(e.emissionState.sequence), - "eve.version": e.eveVersion - }; -} -function buildInstrumentationStepStartedInput(e) { - let t = contextStorage.getStore(), r = t?.get(ChannelInstrumentationKey); - return { - channel: { - kind: normalizeInstrumentationChannelKind(r?.kind), - metadata: snapshotForInstrumentation(r?.metadata, `channel.metadata`) ?? {} - }, - modelInput: snapshotForInstrumentation(e.modelInput, `modelInput`) ?? { - instructions: void 0, - messages: [] - }, - session: { - auth: projectSessionAuth(t), - id: e.session.sessionId, - parent: snapshotForInstrumentation(t?.get(ParentSessionKey), `session.parent`) - }, - step: { index: e.emissionState.stepIndex }, - turn: { - id: e.emissionState.turnId, - sequence: e.emissionState.sequence - } - }; -} -function filterAuthoredRuntimeContext(e, t) { - let n = {}; - for (let [r, i] of Object.entries(e)) { - if (r.startsWith(`eve.`)) { - log$3.warn(`ignoring reserved instrumentation runtime context key`, { - key: r, - source: t - }); - continue; - } - n[r] = i; - } - return Object.keys(n).length > 0 ? n : void 0; -} -function resolveStepStartedRuntimeContext(e) { - let n = e.authored?.events?.[`step.started`]; - if (n === void 0) return; - let i = `events["step.started"]`, a = resolveInstrumentationProjection({ - invoke: () => n(buildInstrumentationStepStartedInput(e)), - log: log$3, - source: i - }); - if (a === void 0) return; - if (!(`runtimeContext` in a)) { - log$3.warn(`ignoring instrumentation event result because runtimeContext is missing`, { source: i }); - return; - } - let o; - try { - o = parseJsonObject(a.runtimeContext); - } catch (e) { - log$3.warn(`ignoring instrumentation event result because runtimeContext is invalid`, { - error: formatError(e), - source: i - }); - return; - } - return filterAuthoredRuntimeContext(o, i); -} -function projectSessionAuth(e) { - let t = e?.get(AuthKey) ?? null, n = e?.get(InitiatorAuthKey) ?? t; - return { - current: snapshotForInstrumentation(t, `session.auth.current`) ?? null, - initiator: snapshotForInstrumentation(n, `session.auth.initiator`) ?? null - }; -} -function snapshotForInstrumentation(e, n) { - if (e !== void 0) try { - return parseJsonValue(e); - } catch (e) { - log$3.warn(`dropping non-serializable instrumentation snapshot`, { - error: formatError(e), - source: n - }); - return; - } -} -//#endregion -//#region node_modules/eve/dist/src/harness/instrumentation-config.js -const INSTRUMENTATION_CONFIG_GLOBAL_KEY = Symbol.for(`eve.harness-instrumentation-config`); -const globalContainer = globalThis; -function getInstrumentationConfig() { - return globalContainer[INSTRUMENTATION_CONFIG_GLOBAL_KEY]; -} -//#endregion -//#region node_modules/eve/dist/src/harness/provider-tool-history.js -function normalizeProviderToolHistory(e) { - let t = findUnmarkedProviderToolCalls(e); - if (e.providerExecutedOutcomeIds.size === 0) return { - messages: [...e.messages], - outcomeEndsResponse: !1 - }; - let n = [], r = -1, i = -1, a = 0; - for (let o of e.messages) { - if (o.role !== `assistant` || !Array.isArray(o.content)) { - n.push(o), o.role === `assistant` && typeof o.content == `string` && o.content.trim().length > 0 && (i = a), a += 1; - continue; - } - let s = [], c = [], flushAssistant = () => { - s.length !== 0 && (n.push({ - ...o, - content: s - }), s = []); - }, flushTool = () => { - c.length !== 0 && (n.push({ - role: `tool`, - content: c - }), c = []); - }; - for (let n of o.content) n.type === `tool-result` && t.has(n.toolCallId) ? (flushAssistant(), c.push(n)) : (flushTool(), s.push(n.type === `tool-call` && t.has(n.toolCallId) ? { - ...n, - providerExecuted: !1 - } : n)), n.type === `tool-result` && e.providerExecutedOutcomeIds.has(n.toolCallId) ? r = a : n.type === `text` && n.text.trim().length > 0 && (i = a), a += 1; - flushAssistant(), flushTool(); - } - return { - messages: n, - outcomeEndsResponse: r >= 0 && r > i - }; -} -function findUnmarkedProviderToolCalls(e) { - let t = /* @__PURE__ */ new Set(); - for (let n of e.messages) if (!(n.role !== `assistant` || !Array.isArray(n.content))) for (let r of n.content) r.type === `tool-call` && r.providerExecuted !== !0 && e.providerExecutedOutcomeIds.has(r.toolCallId) && t.add(r.toolCallId); - return t; -} -//#endregion -//#region node_modules/eve/dist/src/harness/workflow-stream-error.js -const WORKFLOW_STREAM_WRITE_ERROR_PATTERN = /^Stream (write|close) failed: HTTP (\d+)(?: \(([^)]*)\))?/; -function extractWorkflowStreamWriteErrorDetails(e) { - for (let t of causeChainMessages(e)) { - let e = parseStreamErrorMessage(t); - if (e !== null) return e; - } - return null; -} -function parseStreamErrorMessage(e) { - let n = WORKFLOW_STREAM_WRITE_ERROR_PATTERN.exec(e); - if (n === null) return null; - let r = Number(n[2]), i = { operation: n[1] ?? `` }; - Number.isFinite(r) && (i.statusCode = r); - for (let e of (n[3] ?? ``).split(`; `)) e.startsWith(`PUT `) ? i.url = e.slice(4) : e.startsWith(`x-vercel-id=`) ? i.vercelId = e.slice(12) : e.startsWith(`x-vercel-error=`) && (i.vercelError = e.slice(15)); - return i; -} -function* causeChainMessages(t) { - let n = /* @__PURE__ */ new Set(), r = t; - for (; r != null && !n.has(r);) { - if (n.add(r), r instanceof Error) { - yield r.message, r = r.cause; - continue; - } - if (isObject(r) && typeof r.message == `string`) { - yield r.message, r = r.cause; - continue; - } - return; - } -} -//#endregion -//#region node_modules/eve/dist/src/compiled/_chunks/workflow/src-CQuMexnO.js -var src_CQuMexnO_exports = /* @__PURE__ */ __exportAll({ t: () => W$4 }); -var t$4 = c$12(((e) => { - Object.defineProperty(e, "__esModule", { value: !0 }), e.VERSION = void 0, e.VERSION = `1.9.1`; -})); -var n$5 = c$12(((e) => { - Object.defineProperty(e, "__esModule", { value: !0 }), e.isCompatible = e._makeCompatibilityCheck = void 0; - let n = t$4(), r = /^(\d+)\.(\d+)\.(\d+)(-(.+))?$/; - function i(e) { - let t = /* @__PURE__ */ new Set([e]), n = /* @__PURE__ */ new Set(), i = e.match(r); - if (!i) return () => !1; - let a = { - major: +i[1], - minor: +i[2], - patch: +i[3], - prerelease: i[4] - }; - if (a.prerelease != null) return function(t) { - return t === e; - }; - function o(e) { - return n.add(e), !1; - } - function s(e) { - return t.add(e), !0; - } - return function(e) { - if (t.has(e)) return !0; - if (n.has(e)) return !1; - let i = e.match(r); - if (!i) return o(e); - let c = { - major: +i[1], - minor: +i[2], - patch: +i[3], - prerelease: i[4] - }; - return c.prerelease != null || a.major !== c.major ? o(e) : a.major === 0 ? a.minor === c.minor && a.patch <= c.patch ? s(e) : o(e) : a.minor <= c.minor ? s(e) : o(e); - }; - } - e._makeCompatibilityCheck = i, e.isCompatible = i(n.VERSION); -})); -var r$8 = c$12(((e) => { - Object.defineProperty(e, "__esModule", { value: !0 }), e.unregisterGlobal = e.getGlobal = e.registerGlobal = void 0; - let r = t$4(), i = n$5(), a = r.VERSION.split(`.`)[0], o = Symbol.for(`opentelemetry.js.api.${a}`), s = typeof globalThis == `object` ? globalThis : typeof self == `object` ? self : typeof window == `object` ? window : typeof global == `object` ? global : {}; - function c(e, t, n, i = !1) { - let a = s[o] = s[o] ?? { version: r.VERSION }; - if (!i && a[e]) { - let t = Error(`@opentelemetry/api: Attempted duplicate registration of API: ${e}`); - return n.error(t.stack || t.message), !1; - } - if (a.version !== r.VERSION) { - let t = Error(`@opentelemetry/api: Registration of version v${a.version} for ${e} does not match previously registered API v${r.VERSION}`); - return n.error(t.stack || t.message), !1; - } - return a[e] = t, n.debug(`@opentelemetry/api: Registered a global for ${e} v${r.VERSION}.`), !0; - } - e.registerGlobal = c; - function l(e) { - let t = s[o]?.version; - if (!(!t || !(0, i.isCompatible)(t))) return s[o]?.[e]; - } - e.getGlobal = l; - function u(e, t) { - t.debug(`@opentelemetry/api: Unregistering a global for ${e} v${r.VERSION}.`); - let n = s[o]; - n && delete n[e]; - } - e.unregisterGlobal = u; -})); -var i$6 = c$12(((e) => { - Object.defineProperty(e, "__esModule", { value: !0 }), e.DiagComponentLogger = void 0; - let t = r$8(); - e.DiagComponentLogger = class { - constructor(e) { - this._namespace = e.namespace || `DiagComponentLogger`; - } - debug(...e) { - return n(`debug`, this._namespace, e); - } - error(...e) { - return n(`error`, this._namespace, e); - } - info(...e) { - return n(`info`, this._namespace, e); - } - warn(...e) { - return n(`warn`, this._namespace, e); - } - verbose(...e) { - return n(`verbose`, this._namespace, e); - } - }; - function n(e, n, r) { - let i = (0, t.getGlobal)(`diag`); - if (i) return i[e](n, ...r); - } -})); -var a$5 = c$12(((e) => { - Object.defineProperty(e, "__esModule", { value: !0 }), e.DiagLogLevel = void 0, (function(e) { - e[e.NONE = 0] = `NONE`, e[e.ERROR = 30] = `ERROR`, e[e.WARN = 50] = `WARN`, e[e.INFO = 60] = `INFO`, e[e.DEBUG = 70] = `DEBUG`, e[e.VERBOSE = 80] = `VERBOSE`, e[e.ALL = 9999] = `ALL`; - })(e.DiagLogLevel ||= {}); -})); -var o$5 = c$12(((e) => { - Object.defineProperty(e, "__esModule", { value: !0 }), e.createLogLevelDiagLogger = void 0; - let t = a$5(); - function n(e, n) { - e < t.DiagLogLevel.NONE ? e = t.DiagLogLevel.NONE : e > t.DiagLogLevel.ALL && (e = t.DiagLogLevel.ALL), n ||= {}; - function r(t, r) { - let i = n[t]; - return typeof i == `function` && e >= r ? i.bind(n) : function() {}; - } - return { - error: r(`error`, t.DiagLogLevel.ERROR), - warn: r(`warn`, t.DiagLogLevel.WARN), - info: r(`info`, t.DiagLogLevel.INFO), - debug: r(`debug`, t.DiagLogLevel.DEBUG), - verbose: r(`verbose`, t.DiagLogLevel.VERBOSE) - }; - } - e.createLogLevelDiagLogger = n; -})); -var s$4 = c$12(((e) => { - Object.defineProperty(e, "__esModule", { value: !0 }), e.DiagAPI = void 0; - let t = i$6(), n = o$5(), s = a$5(), c = r$8(); - e.DiagAPI = class e { - static instance() { - return this._instance ||= new e(), this._instance; - } - constructor() { - function e(e) { - return function(...t) { - let n = (0, c.getGlobal)(`diag`); - if (n) return n[e](...t); - }; - } - let r = this; - r.setLogger = (e, t = { logLevel: s.DiagLogLevel.INFO }) => { - if (e === r) { - let e = Error(`Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation`); - return r.error(e.stack ?? e.message), !1; - } - typeof t == `number` && (t = { logLevel: t }); - let i = (0, c.getGlobal)(`diag`), a = (0, n.createLogLevelDiagLogger)(t.logLevel ?? s.DiagLogLevel.INFO, e); - if (i && !t.suppressOverrideMessage) { - let e = Error().stack ?? ``; - i.warn(`Current logger will be overwritten from ${e}`), a.warn(`Current logger will overwrite one already registered from ${e}`); - } - return (0, c.registerGlobal)(`diag`, a, r, !0); - }, r.disable = () => { - (0, c.unregisterGlobal)(`diag`, r); - }, r.createComponentLogger = (e) => new t.DiagComponentLogger(e), r.verbose = e(`verbose`), r.debug = e(`debug`), r.info = e(`info`), r.warn = e(`warn`), r.error = e(`error`); - } - }; -})); -var c$5 = c$12(((e) => { - Object.defineProperty(e, "__esModule", { value: !0 }), e.BaggageImpl = void 0, e.BaggageImpl = class e { - constructor(e) { - this._entries = e ? new Map(e) : /* @__PURE__ */ new Map(); - } - getEntry(e) { - let t = this._entries.get(e); - if (t) return Object.assign({}, t); - } - getAllEntries() { - return Array.from(this._entries.entries()); - } - setEntry(t, n) { - let r = new e(this._entries); - return r._entries.set(t, n), r; - } - removeEntry(t) { - let n = new e(this._entries); - return n._entries.delete(t), n; - } - removeEntries(...t) { - let n = new e(this._entries); - for (let e of t) n._entries.delete(e); - return n; - } - clear() { - return new e(); - } - }; -})); -var l$4 = c$12(((e) => { - Object.defineProperty(e, "__esModule", { value: !0 }), e.baggageEntryMetadataSymbol = void 0, e.baggageEntryMetadataSymbol = Symbol(`BaggageEntryMetadata`); -})); -var u$5 = c$12(((e) => { - Object.defineProperty(e, "__esModule", { value: !0 }), e.baggageEntryMetadataFromString = e.createBaggage = void 0; - let t = s$4(), n = c$5(), r = l$4(), i = t.DiagAPI.instance(); - function a(e = {}) { - return new n.BaggageImpl(new Map(Object.entries(e))); - } - e.createBaggage = a; - function o(e) { - return typeof e != `string` && (i.error(`Cannot create baggage metadata from unknown type: ${typeof e}`), e = ``), { - __TYPE__: r.baggageEntryMetadataSymbol, - toString() { - return e; - } - }; - } - e.baggageEntryMetadataFromString = o; -})); -var d$5 = c$12(((e) => { - Object.defineProperty(e, "__esModule", { value: !0 }), e.ROOT_CONTEXT = e.createContextKey = void 0; - function t(e) { - return Symbol.for(e); - } - e.createContextKey = t, e.ROOT_CONTEXT = new class e { - constructor(t) { - let n = this; - n._currentContext = t ? new Map(t) : /* @__PURE__ */ new Map(), n.getValue = (e) => n._currentContext.get(e), n.setValue = (t, r) => { - let i = new e(n._currentContext); - return i._currentContext.set(t, r), i; - }, n.deleteValue = (t) => { - let r = new e(n._currentContext); - return r._currentContext.delete(t), r; - }; - } - }(); -})); -var f$4 = c$12(((e) => { - Object.defineProperty(e, "__esModule", { value: !0 }), e.DiagConsoleLogger = e._originalConsoleMethods = void 0; - let t = [ - { - n: `error`, - c: `error` - }, - { - n: `warn`, - c: `warn` - }, - { - n: `info`, - c: `info` - }, - { - n: `debug`, - c: `debug` - }, - { - n: `verbose`, - c: `trace` - } - ]; - if (e._originalConsoleMethods = {}, typeof console < `u`) for (let t of [ - `error`, - `warn`, - `info`, - `debug`, - `trace`, - `log` - ]) typeof console[t] == `function` && (e._originalConsoleMethods[t] = console[t]); - e.DiagConsoleLogger = class { - constructor() { - function n(t) { - return function(...n) { - let r = e._originalConsoleMethods[t]; - if (typeof r != `function` && (r = e._originalConsoleMethods.log), typeof r != `function` && console && (r = console[t], typeof r != `function` && (r = console.log)), typeof r == `function`) return r.apply(console, n); - }; - } - for (let e = 0; e < t.length; e++) this[t[e].n] = n(t[e].c); - } - }; -})); -var p$6 = c$12(((e) => { - Object.defineProperty(e, "__esModule", { value: !0 }), e.createNoopMeter = e.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC = e.NOOP_OBSERVABLE_GAUGE_METRIC = e.NOOP_OBSERVABLE_COUNTER_METRIC = e.NOOP_UP_DOWN_COUNTER_METRIC = e.NOOP_HISTOGRAM_METRIC = e.NOOP_GAUGE_METRIC = e.NOOP_COUNTER_METRIC = e.NOOP_METER = e.NoopObservableUpDownCounterMetric = e.NoopObservableGaugeMetric = e.NoopObservableCounterMetric = e.NoopObservableMetric = e.NoopHistogramMetric = e.NoopGaugeMetric = e.NoopUpDownCounterMetric = e.NoopCounterMetric = e.NoopMetric = e.NoopMeter = void 0; - var t = class { - constructor() {} - createGauge(t, n) { - return e.NOOP_GAUGE_METRIC; - } - createHistogram(t, n) { - return e.NOOP_HISTOGRAM_METRIC; - } - createCounter(t, n) { - return e.NOOP_COUNTER_METRIC; - } - createUpDownCounter(t, n) { - return e.NOOP_UP_DOWN_COUNTER_METRIC; - } - createObservableGauge(t, n) { - return e.NOOP_OBSERVABLE_GAUGE_METRIC; - } - createObservableCounter(t, n) { - return e.NOOP_OBSERVABLE_COUNTER_METRIC; - } - createObservableUpDownCounter(t, n) { - return e.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC; - } - addBatchObservableCallback(e, t) {} - removeBatchObservableCallback(e) {} - }; - e.NoopMeter = t; - var n = class {}; - e.NoopMetric = n; - var r = class extends n { - add(e, t) {} - }; - e.NoopCounterMetric = r; - var i = class extends n { - add(e, t) {} - }; - e.NoopUpDownCounterMetric = i; - var a = class extends n { - record(e, t) {} - }; - e.NoopGaugeMetric = a; - var o = class extends n { - record(e, t) {} - }; - e.NoopHistogramMetric = o; - var s = class { - addCallback(e) {} - removeCallback(e) {} - }; - e.NoopObservableMetric = s; - var c = class extends s {}; - e.NoopObservableCounterMetric = c; - var l = class extends s {}; - e.NoopObservableGaugeMetric = l; - var u = class extends s {}; - e.NoopObservableUpDownCounterMetric = u, e.NOOP_METER = new t(), e.NOOP_COUNTER_METRIC = new r(), e.NOOP_GAUGE_METRIC = new a(), e.NOOP_HISTOGRAM_METRIC = new o(), e.NOOP_UP_DOWN_COUNTER_METRIC = new i(), e.NOOP_OBSERVABLE_COUNTER_METRIC = new c(), e.NOOP_OBSERVABLE_GAUGE_METRIC = new l(), e.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC = new u(); - function d() { - return e.NOOP_METER; - } - e.createNoopMeter = d; -})); -var m$4 = c$12(((e) => { - Object.defineProperty(e, "__esModule", { value: !0 }), e.ValueType = void 0, (function(e) { - e[e.INT = 0] = `INT`, e[e.DOUBLE = 1] = `DOUBLE`; - })(e.ValueType ||= {}); -})); -var h$4 = c$12(((e) => { - Object.defineProperty(e, "__esModule", { value: !0 }), e.defaultTextMapSetter = e.defaultTextMapGetter = void 0, e.defaultTextMapGetter = { - get(e, t) { - if (e != null) return e[t]; - }, - keys(e) { - return e == null ? [] : Object.keys(e); - } - }, e.defaultTextMapSetter = { set(e, t, n) { - e != null && (e[t] = n); - } }; -})); -var g$4 = c$12(((e) => { - Object.defineProperty(e, "__esModule", { value: !0 }), e.NoopContextManager = void 0; - let t = d$5(); - e.NoopContextManager = class { - active() { - return t.ROOT_CONTEXT; - } - with(e, t, n, ...r) { - return t.call(n, ...r); - } - bind(e, t) { - return t; - } - enable() { - return this; - } - disable() { - return this; - } - }; -})); -var _$3 = c$12(((e) => { - Object.defineProperty(e, "__esModule", { value: !0 }), e.ContextAPI = void 0; - let t = g$4(), n = r$8(), i = s$4(), a = `context`, o = new t.NoopContextManager(); - e.ContextAPI = class e { - constructor() {} - static getInstance() { - return this._instance ||= new e(), this._instance; - } - setGlobalContextManager(e) { - return (0, n.registerGlobal)(a, e, i.DiagAPI.instance()); - } - active() { - return this._getContextManager().active(); - } - with(e, t, n, ...r) { - return this._getContextManager().with(e, t, n, ...r); - } - bind(e, t) { - return this._getContextManager().bind(e, t); - } - _getContextManager() { - return (0, n.getGlobal)(a) || o; - } - disable() { - this._getContextManager().disable(), (0, n.unregisterGlobal)(a, i.DiagAPI.instance()); - } - }; -})); -var v$4 = c$12(((e) => { - Object.defineProperty(e, "__esModule", { value: !0 }), e.TraceFlags = void 0, (function(e) { - e[e.NONE = 0] = `NONE`, e[e.SAMPLED = 1] = `SAMPLED`; - })(e.TraceFlags ||= {}); -})); -var y$2 = c$12(((e) => { - Object.defineProperty(e, "__esModule", { value: !0 }), e.INVALID_SPAN_CONTEXT = e.INVALID_TRACEID = e.INVALID_SPANID = void 0; - let t = v$4(); - e.INVALID_SPANID = `0000000000000000`, e.INVALID_TRACEID = `00000000000000000000000000000000`, e.INVALID_SPAN_CONTEXT = { - traceId: e.INVALID_TRACEID, - spanId: e.INVALID_SPANID, - traceFlags: t.TraceFlags.NONE - }; -})); -var b$4 = c$12(((e) => { - Object.defineProperty(e, "__esModule", { value: !0 }), e.NonRecordingSpan = void 0; - let t = y$2(); - e.NonRecordingSpan = class { - constructor(e = t.INVALID_SPAN_CONTEXT) { - this._spanContext = e; - } - spanContext() { - return this._spanContext; - } - setAttribute(e, t) { - return this; - } - setAttributes(e) { - return this; - } - addEvent(e, t) { - return this; - } - addLink(e) { - return this; - } - addLinks(e) { - return this; - } - setStatus(e) { - return this; - } - updateName(e) { - return this; - } - end(e) {} - isRecording() { - return !1; - } - recordException(e, t) {} - }; -})); -var x$3 = c$12(((e) => { - Object.defineProperty(e, "__esModule", { value: !0 }), e.getSpanContext = e.setSpanContext = e.deleteSpan = e.setSpan = e.getActiveSpan = e.getSpan = void 0; - let t = d$5(), n = b$4(), r = _$3(), i = (0, t.createContextKey)(`OpenTelemetry Context Key SPAN`); - function a(e) { - return e.getValue(i) || void 0; - } - e.getSpan = a; - function o() { - return a(r.ContextAPI.getInstance().active()); - } - e.getActiveSpan = o; - function s(e, t) { - return e.setValue(i, t); - } - e.setSpan = s; - function c(e) { - return e.deleteValue(i); - } - e.deleteSpan = c; - function l(e, t) { - return s(e, new n.NonRecordingSpan(t)); - } - e.setSpanContext = l; - function u(e) { - return a(e)?.spanContext(); - } - e.getSpanContext = u; -})); -var S$3 = c$12(((e) => { - Object.defineProperty(e, "__esModule", { value: !0 }), e.wrapSpanContext = e.isSpanContextValid = e.isValidSpanId = e.isValidTraceId = void 0; - let t = y$2(), n = b$4(), r = new Uint8Array([ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1 - ]); - function i(e, t) { - if (typeof e != `string` || e.length !== t) return !1; - let n = 0; - for (let t = 0; t < e.length; t += 4) n += (r[e.charCodeAt(t)] | 0) + (r[e.charCodeAt(t + 1)] | 0) + (r[e.charCodeAt(t + 2)] | 0) + (r[e.charCodeAt(t + 3)] | 0); - return n === t; - } - function a(e) { - return i(e, 32) && e !== t.INVALID_TRACEID; - } - e.isValidTraceId = a; - function o(e) { - return i(e, 16) && e !== t.INVALID_SPANID; - } - e.isValidSpanId = o; - function s(e) { - return a(e.traceId) && o(e.spanId); - } - e.isSpanContextValid = s; - function c(e) { - return new n.NonRecordingSpan(e); - } - e.wrapSpanContext = c; -})); -var C$4 = c$12(((e) => { - Object.defineProperty(e, "__esModule", { value: !0 }), e.NoopTracer = void 0; - let t = _$3(), n = x$3(), r = b$4(), i = S$3(), a = t.ContextAPI.getInstance(); - e.NoopTracer = class { - startSpan(e, t, s = a.active()) { - if (t?.root) return new r.NonRecordingSpan(); - let c = s && (0, n.getSpanContext)(s); - return o(c) && (0, i.isSpanContextValid)(c) ? new r.NonRecordingSpan(c) : new r.NonRecordingSpan(); - } - startActiveSpan(e, t, r, i) { - let o, s, c; - if (arguments.length < 2) return; - arguments.length === 2 ? c = t : arguments.length === 3 ? (o = t, c = r) : (o = t, s = r, c = i); - let l = s ?? a.active(), u = this.startSpan(e, o, l), d = (0, n.setSpan)(l, u); - return a.with(d, c, void 0, u); - } - }; - function o(e) { - return typeof e == `object` && !!e && `spanId` in e && typeof e.spanId == `string` && `traceId` in e && typeof e.traceId == `string` && `traceFlags` in e && typeof e.traceFlags == `number`; - } -})); -var w$4 = c$12(((e) => { - Object.defineProperty(e, "__esModule", { value: !0 }), e.ProxyTracer = void 0; - let t = new (C$4()).NoopTracer(); - e.ProxyTracer = class { - constructor(e, t, n, r) { - this._provider = e, this.name = t, this.version = n, this.options = r; - } - startSpan(e, t, n) { - return this._getTracer().startSpan(e, t, n); - } - startActiveSpan(e, t, n, r) { - let i = this._getTracer(); - return Reflect.apply(i.startActiveSpan, i, arguments); - } - _getTracer() { - if (this._delegate) return this._delegate; - let e = this._provider.getDelegateTracer(this.name, this.version, this.options); - return e ? (this._delegate = e, this._delegate) : t; - } - }; -})); -var T$4 = c$12(((e) => { - Object.defineProperty(e, "__esModule", { value: !0 }), e.NoopTracerProvider = void 0; - let t = C$4(); - e.NoopTracerProvider = class { - getTracer(e, n, r) { - return new t.NoopTracer(); - } - }; -})); -var E$4 = c$12(((e) => { - Object.defineProperty(e, "__esModule", { value: !0 }), e.ProxyTracerProvider = void 0; - let t = w$4(), n = new (T$4()).NoopTracerProvider(); - e.ProxyTracerProvider = class { - getTracer(e, n, r) { - return this.getDelegateTracer(e, n, r) ?? new t.ProxyTracer(this, e, n, r); - } - getDelegate() { - return this._delegate ?? n; - } - setDelegate(e) { - this._delegate = e; - } - getDelegateTracer(e, t, n) { - return this._delegate?.getTracer(e, t, n); - } - }; -})); -var D$3 = c$12(((e) => { - Object.defineProperty(e, "__esModule", { value: !0 }), e.SamplingDecision = void 0, (function(e) { - e[e.NOT_RECORD = 0] = `NOT_RECORD`, e[e.RECORD = 1] = `RECORD`, e[e.RECORD_AND_SAMPLED = 2] = `RECORD_AND_SAMPLED`; - })(e.SamplingDecision ||= {}); -})); -var O$3 = c$12(((e) => { - Object.defineProperty(e, "__esModule", { value: !0 }), e.SpanKind = void 0, (function(e) { - e[e.INTERNAL = 0] = `INTERNAL`, e[e.SERVER = 1] = `SERVER`, e[e.CLIENT = 2] = `CLIENT`, e[e.PRODUCER = 3] = `PRODUCER`, e[e.CONSUMER = 4] = `CONSUMER`; - })(e.SpanKind ||= {}); -})); -var k$4 = c$12(((e) => { - Object.defineProperty(e, "__esModule", { value: !0 }), e.SpanStatusCode = void 0, (function(e) { - e[e.UNSET = 0] = `UNSET`, e[e.OK = 1] = `OK`, e[e.ERROR = 2] = `ERROR`; - })(e.SpanStatusCode ||= {}); -})); -var A$3 = c$12(((e) => { - Object.defineProperty(e, "__esModule", { value: !0 }), e.validateValue = e.validateKey = void 0; - let t = `[_0-9a-z-*/]`, n = RegExp(`^(?:${`[a-z]${t}{0,255}`}|${`[a-z0-9]${t}{0,240}@[a-z]${t}{0,13}`})$`), r = /^[ -~]{0,255}[!-~]$/, i = /,|=/; - function a(e) { - return n.test(e); - } - e.validateKey = a; - function o(e) { - return r.test(e) && !i.test(e); - } - e.validateValue = o; -})); -var j$3 = c$12(((e) => { - Object.defineProperty(e, "__esModule", { value: !0 }), e.TraceStateImpl = void 0; - let t = A$3(); - e.TraceStateImpl = class e { - constructor(e) { - this._internalState = /* @__PURE__ */ new Map(), e && this._parse(e); - } - set(e, t) { - let n = this._clone(); - return n._internalState.has(e) && n._internalState.delete(e), n._internalState.set(e, t), n; - } - unset(e) { - let t = this._clone(); - return t._internalState.delete(e), t; - } - get(e) { - return this._internalState.get(e); - } - serialize() { - return Array.from(this._internalState.keys()).reduceRight((e, t) => (e.push(t + `=` + this.get(t)), e), []).join(`,`); - } - _parse(e) { - e.length > 512 || (this._internalState = e.split(`,`).reduceRight((e, n) => { - let r = n.trim(), i = r.indexOf(`=`); - if (i !== -1) { - let a = r.slice(0, i), o = r.slice(i + 1, n.length); - (0, t.validateKey)(a) && (0, t.validateValue)(o) && e.set(a, o); - } - return e; - }, /* @__PURE__ */ new Map()), this._internalState.size > 32 && (this._internalState = new Map(Array.from(this._internalState.entries()).reverse().slice(0, 32)))); - } - _keys() { - return Array.from(this._internalState.keys()).reverse(); - } - _clone() { - let t = new e(); - return t._internalState = new Map(this._internalState), t; - } - }; -})); -var M$3 = c$12(((e) => { - Object.defineProperty(e, "__esModule", { value: !0 }), e.createTraceState = void 0; - let t = j$3(); - function n(e) { - return new t.TraceStateImpl(e); - } - e.createTraceState = n; -})); -var N$3 = c$12(((e) => { - Object.defineProperty(e, "__esModule", { value: !0 }), e.context = void 0, e.context = _$3().ContextAPI.getInstance(); -})); -var P$3 = c$12(((e) => { - Object.defineProperty(e, "__esModule", { value: !0 }), e.diag = void 0, e.diag = s$4().DiagAPI.instance(); -})); -var F$3 = c$12(((e) => { - Object.defineProperty(e, "__esModule", { value: !0 }), e.NOOP_METER_PROVIDER = e.NoopMeterProvider = void 0; - let t = p$6(); - var n = class { - getMeter(e, n, r) { - return t.NOOP_METER; - } - }; - e.NoopMeterProvider = n, e.NOOP_METER_PROVIDER = new n(); -})); -var I$3 = c$12(((e) => { - Object.defineProperty(e, "__esModule", { value: !0 }), e.MetricsAPI = void 0; - let t = F$3(), n = r$8(), i = s$4(), a = `metrics`; - e.MetricsAPI = class e { - constructor() {} - static getInstance() { - return this._instance ||= new e(), this._instance; - } - setGlobalMeterProvider(e) { - return (0, n.registerGlobal)(a, e, i.DiagAPI.instance()); - } - getMeterProvider() { - return (0, n.getGlobal)(a) || t.NOOP_METER_PROVIDER; - } - getMeter(e, t, n) { - return this.getMeterProvider().getMeter(e, t, n); - } - disable() { - (0, n.unregisterGlobal)(a, i.DiagAPI.instance()); - } - }; -})); -var L$3 = c$12(((e) => { - Object.defineProperty(e, "__esModule", { value: !0 }), e.metrics = void 0, e.metrics = I$3().MetricsAPI.getInstance(); -})); -var R$3 = c$12(((e) => { - Object.defineProperty(e, "__esModule", { value: !0 }), e.NoopTextMapPropagator = void 0, e.NoopTextMapPropagator = class { - inject(e, t) {} - extract(e, t) { - return e; - } - fields() { - return []; - } - }; -})); -var z$3 = c$12(((e) => { - Object.defineProperty(e, "__esModule", { value: !0 }), e.deleteBaggage = e.setBaggage = e.getActiveBaggage = e.getBaggage = void 0; - let t = _$3(), n = (0, d$5().createContextKey)(`OpenTelemetry Baggage Key`); - function r(e) { - return e.getValue(n) || void 0; - } - e.getBaggage = r; - function i() { - return r(t.ContextAPI.getInstance().active()); - } - e.getActiveBaggage = i; - function a(e, t) { - return e.setValue(n, t); - } - e.setBaggage = a; - function o(e) { - return e.deleteValue(n); - } - e.deleteBaggage = o; -})); -var B$3 = c$12(((e) => { - Object.defineProperty(e, "__esModule", { value: !0 }), e.PropagationAPI = void 0; - let t = r$8(), n = R$3(), i = h$4(), a = z$3(), o = u$5(), c = s$4(), l = `propagation`, d = new n.NoopTextMapPropagator(); - e.PropagationAPI = class e { - constructor() { - this.createBaggage = o.createBaggage, this.getBaggage = a.getBaggage, this.getActiveBaggage = a.getActiveBaggage, this.setBaggage = a.setBaggage, this.deleteBaggage = a.deleteBaggage; - } - static getInstance() { - return this._instance ||= new e(), this._instance; - } - setGlobalPropagator(e) { - return (0, t.registerGlobal)(l, e, c.DiagAPI.instance()); - } - inject(e, t, n = i.defaultTextMapSetter) { - return this._getGlobalPropagator().inject(e, t, n); - } - extract(e, t, n = i.defaultTextMapGetter) { - return this._getGlobalPropagator().extract(e, t, n); - } - fields() { - return this._getGlobalPropagator().fields(); - } - disable() { - (0, t.unregisterGlobal)(l, c.DiagAPI.instance()); - } - _getGlobalPropagator() { - return (0, t.getGlobal)(l) || d; - } - }; -})); -var V$3 = c$12(((e) => { - Object.defineProperty(e, "__esModule", { value: !0 }), e.propagation = void 0, e.propagation = B$3().PropagationAPI.getInstance(); -})); -var H$4 = c$12(((e) => { - Object.defineProperty(e, "__esModule", { value: !0 }), e.TraceAPI = void 0; - let t = r$8(), n = E$4(), i = S$3(), a = x$3(), o = s$4(), c = `trace`; - e.TraceAPI = class e { - constructor() { - this._proxyTracerProvider = new n.ProxyTracerProvider(), this.wrapSpanContext = i.wrapSpanContext, this.isSpanContextValid = i.isSpanContextValid, this.deleteSpan = a.deleteSpan, this.getSpan = a.getSpan, this.getActiveSpan = a.getActiveSpan, this.getSpanContext = a.getSpanContext, this.setSpan = a.setSpan, this.setSpanContext = a.setSpanContext; - } - static getInstance() { - return this._instance ||= new e(), this._instance; - } - setGlobalTracerProvider(e) { - let n = (0, t.registerGlobal)(c, this._proxyTracerProvider, o.DiagAPI.instance()); - return n && this._proxyTracerProvider.setDelegate(e), n; - } - getTracerProvider() { - return (0, t.getGlobal)(c) || this._proxyTracerProvider; - } - getTracer(e, t) { - return this.getTracerProvider().getTracer(e, t); - } - disable() { - (0, t.unregisterGlobal)(c, o.DiagAPI.instance()), this._proxyTracerProvider = new n.ProxyTracerProvider(); - } - }; -})); -var U$4 = c$12(((e) => { - Object.defineProperty(e, "__esModule", { value: !0 }), e.trace = void 0, e.trace = H$4().TraceAPI.getInstance(); -})); -var W$4 = c$12(((e) => { - Object.defineProperty(e, "__esModule", { value: !0 }), e.trace = e.propagation = e.metrics = e.diag = e.context = e.INVALID_SPAN_CONTEXT = e.INVALID_TRACEID = e.INVALID_SPANID = e.isValidSpanId = e.isValidTraceId = e.isSpanContextValid = e.createTraceState = e.TraceFlags = e.SpanStatusCode = e.SpanKind = e.SamplingDecision = e.ProxyTracerProvider = e.ProxyTracer = e.defaultTextMapSetter = e.defaultTextMapGetter = e.ValueType = e.createNoopMeter = e.DiagLogLevel = e.DiagConsoleLogger = e.ROOT_CONTEXT = e.createContextKey = e.baggageEntryMetadataFromString = void 0; - var t = u$5(); - Object.defineProperty(e, "baggageEntryMetadataFromString", { - enumerable: !0, - get: function() { - return t.baggageEntryMetadataFromString; - } - }); - var n = d$5(); - Object.defineProperty(e, "createContextKey", { - enumerable: !0, - get: function() { - return n.createContextKey; - } - }), Object.defineProperty(e, "ROOT_CONTEXT", { - enumerable: !0, - get: function() { - return n.ROOT_CONTEXT; - } - }); - var r = f$4(); - Object.defineProperty(e, "DiagConsoleLogger", { - enumerable: !0, - get: function() { - return r.DiagConsoleLogger; - } - }); - var i = a$5(); - Object.defineProperty(e, "DiagLogLevel", { - enumerable: !0, - get: function() { - return i.DiagLogLevel; - } - }); - var o = p$6(); - Object.defineProperty(e, "createNoopMeter", { - enumerable: !0, - get: function() { - return o.createNoopMeter; - } - }); - var s = m$4(); - Object.defineProperty(e, "ValueType", { - enumerable: !0, - get: function() { - return s.ValueType; - } - }); - var c = h$4(); - Object.defineProperty(e, "defaultTextMapGetter", { - enumerable: !0, - get: function() { - return c.defaultTextMapGetter; - } - }), Object.defineProperty(e, "defaultTextMapSetter", { - enumerable: !0, - get: function() { - return c.defaultTextMapSetter; - } - }); - var l = w$4(); - Object.defineProperty(e, "ProxyTracer", { - enumerable: !0, - get: function() { - return l.ProxyTracer; - } - }); - var g = E$4(); - Object.defineProperty(e, "ProxyTracerProvider", { - enumerable: !0, - get: function() { - return g.ProxyTracerProvider; - } - }); - var _ = D$3(); - Object.defineProperty(e, "SamplingDecision", { - enumerable: !0, - get: function() { - return _.SamplingDecision; - } - }); - var b = O$3(); - Object.defineProperty(e, "SpanKind", { - enumerable: !0, - get: function() { - return b.SpanKind; - } - }); - var x = k$4(); - Object.defineProperty(e, "SpanStatusCode", { - enumerable: !0, - get: function() { - return x.SpanStatusCode; - } - }); - var C = v$4(); - Object.defineProperty(e, "TraceFlags", { - enumerable: !0, - get: function() { - return C.TraceFlags; - } - }); - var T = M$3(); - Object.defineProperty(e, "createTraceState", { - enumerable: !0, - get: function() { - return T.createTraceState; - } - }); - var A = S$3(); - Object.defineProperty(e, "isSpanContextValid", { - enumerable: !0, - get: function() { - return A.isSpanContextValid; - } - }), Object.defineProperty(e, "isValidTraceId", { - enumerable: !0, - get: function() { - return A.isValidTraceId; - } - }), Object.defineProperty(e, "isValidSpanId", { - enumerable: !0, - get: function() { - return A.isValidSpanId; - } - }); - var j = y$2(); - Object.defineProperty(e, "INVALID_SPANID", { - enumerable: !0, - get: function() { - return j.INVALID_SPANID; - } - }), Object.defineProperty(e, "INVALID_TRACEID", { - enumerable: !0, - get: function() { - return j.INVALID_TRACEID; - } - }), Object.defineProperty(e, "INVALID_SPAN_CONTEXT", { - enumerable: !0, - get: function() { - return j.INVALID_SPAN_CONTEXT; - } - }); - let F = N$3(); - Object.defineProperty(e, "context", { - enumerable: !0, - get: function() { - return F.context; - } - }); - let I = P$3(); - Object.defineProperty(e, "diag", { - enumerable: !0, - get: function() { - return I.diag; - } - }); - let R = L$3(); - Object.defineProperty(e, "metrics", { - enumerable: !0, - get: function() { - return R.metrics; - } - }); - let z = V$3(); - Object.defineProperty(e, "propagation", { - enumerable: !0, - get: function() { - return z.propagation; - } - }); - let B = U$4(); - Object.defineProperty(e, "trace", { - enumerable: !0, - get: function() { - return B.trace; - } - }), e.default = { - context: F.context, - diag: I.diag, - metrics: R.metrics, - propagation: z.propagation, - trace: B.trace - }; -})); -//#endregion -//#region node_modules/eve/dist/src/compiled/@ai-sdk/otel/index.js -var n$4 = W$4(); -function r$7(e) { - let t = e.toLowerCase(); - for (let [e, n] of [ - [`google.vertex`, `gcp.vertex_ai`], - [`google.generative-ai`, `gcp.gemini`], - [`google-vertex`, `gcp.vertex_ai`], - [`amazon-bedrock`, `aws.bedrock`], - [`azure-openai`, `azure.ai.openai`], - [`anthropic`, `anthropic`], - [`openai`, `openai`], - [`azure`, `azure.ai.inference`], - [`google`, `gcp.gemini`], - [`mistral`, `mistral_ai`], - [`cohere`, `cohere`], - [`bedrock`, `aws.bedrock`], - [`groq`, `groq`], - [`deepseek`, `deepseek`], - [`perplexity`, `perplexity`], - [`xai`, `x_ai`] - ]) if (t === e || t.startsWith(e + `.`) || t.startsWith(e + `-`)) return n; - return e; -} -function i$5(e) { - return { - "ai.generateText": `invoke_agent`, - "ai.streamText": `invoke_agent`, - "ai.generateObject": `invoke_agent`, - "ai.streamObject": `invoke_agent`, - "ai.embed": `embeddings`, - "ai.embedMany": `embeddings`, - "ai.rerank": `rerank` - }[e] ?? e; -} -function a$4(e) { - return typeof e == `string` ? [{ - type: `text`, - content: e - }] : Array.isArray(e) ? e.map((e) => ({ - type: `text`, - content: e.content - })) : [{ - type: `text`, - content: e.content - }]; -} -function o$4(e) { - switch (e.type) { - case `text`: return { - type: `text`, - content: e.text - }; - case `reasoning`: return { - type: `reasoning`, - content: e.text - }; - case `tool-call`: return { - type: `tool_call`, - id: e.toolCallId ?? null, - name: e.toolName, - arguments: e.input - }; - case `tool-result`: { - let t = e.output, n; - return t && (n = t.type === `text` || t.type === `error-text` || t.type === `json` || t.type === `error-json` ? t.value : t.type === `execution-denied` ? { - denied: !0, - reason: t.reason - } : t), { - type: `tool_call_response`, - id: e.toolCallId ?? null, - response: n - }; - } - case `file`: { - let n = e.data, r = (() => { - if (typeof n == `object` && n && !(n instanceof URL) && !(n instanceof Uint8Array) && !(n instanceof ArrayBuffer) && `type` in n) switch (n.type) { - case `data`: return n.data; - case `url`: return n.url; - case `text`: return n.text; - default: return ``; - } - return n; - })(), i; - if (r instanceof Uint8Array) i = convertDataContentToBase64String(r); - else if (typeof r == `string`) { - if (r.startsWith(`http://`) || r.startsWith(`https://`)) return { - type: `uri`, - modality: s$3(e.mediaType), - mime_type: e.mediaType ?? null, - uri: r - }; - i = r; - } else if (r instanceof URL) return { - type: `uri`, - modality: s$3(e.mediaType), - mime_type: e.mediaType ?? null, - uri: r.toString() - }; - else i = String(r); - return { - type: `blob`, - modality: s$3(e.mediaType), - mime_type: e.mediaType ?? null, - content: i - }; - } - case `tool-approval-response`: return { - type: `tool_approval_response`, - approval_id: e.approvalId, - approved: e.approved, - reason: e.reason - }; - case `custom`: return { - type: `custom`, - kind: e.kind - }; - case `reasoning-file`: return { type: String(e.type) }; - default: return { type: String(e.type) }; - } -} -function s$3(e) { - return !e || e.startsWith(`image/`) ? `image` : e.startsWith(`video/`) ? `video` : e.startsWith(`audio/`) ? `audio` : `image`; -} -function c$4(e) { - return e.filter((e) => e.role !== `system`).map((e) => { - if (e.role === `system`) return { - role: `system`, - parts: [{ - type: `text`, - content: e.content - }] - }; - let t = e.content.map(o$4); - return { - role: e.role, - parts: t - }; - }); -} -function l$3({ prompt: e, messages: t }) { - let n = []; - if (typeof e == `string`) n.push({ - role: `user`, - parts: [{ - type: `text`, - content: e - }] - }); - else if (Array.isArray(e)) for (let t of e) { - let e = u$4(t); - e && n.push(e); - } - if (t) for (let e of t) { - let t = u$4(e); - t && n.push(t); - } - return n; -} -function u$4(e) { - if (e.role !== `system`) { - if (e.role === `user`) return typeof e.content == `string` ? { - role: `user`, - parts: [{ - type: `text`, - content: e.content - }] - } : { - role: `user`, - parts: e.content.map((e) => { - switch (e.type) { - case `text`: return { - type: `text`, - content: e.text - }; - case `image`: { - let n = e.image; - return n instanceof URL ? { - type: `uri`, - modality: `image`, - mime_type: e.mediaType ?? null, - uri: n.toString() - } : typeof n == `string` ? n.startsWith(`http://`) || n.startsWith(`https://`) ? { - type: `uri`, - modality: `image`, - mime_type: e.mediaType ?? null, - uri: n - } : { - type: `blob`, - modality: `image`, - mime_type: e.mediaType ?? null, - content: n - } : { - type: `blob`, - modality: `image`, - mime_type: e.mediaType ?? null, - content: convertDataContentToBase64String(n) - }; - } - case `file`: { - let n = e.data, r = (() => { - if (typeof n == `object` && n && !(n instanceof URL) && !(n instanceof Uint8Array) && !(n instanceof ArrayBuffer) && `type` in n) switch (n.type) { - case `data`: return n.data; - case `url`: return n.url; - case `text`: return n.text; - default: return ``; - } - return n; - })(); - return r instanceof URL ? { - type: `uri`, - modality: s$3(e.mediaType), - mime_type: e.mediaType ?? null, - uri: r.toString() - } : typeof r == `string` ? r.startsWith(`http://`) || r.startsWith(`https://`) ? { - type: `uri`, - modality: s$3(e.mediaType), - mime_type: e.mediaType ?? null, - uri: r - } : { - type: `blob`, - modality: s$3(e.mediaType), - mime_type: e.mediaType ?? null, - content: r - } : { - type: `blob`, - modality: s$3(e.mediaType), - mime_type: e.mediaType ?? null, - content: convertDataContentToBase64String(r) - }; - } - default: return { type: String(e.type) }; - } - }) - }; - if (e.role === `assistant`) return typeof e.content == `string` ? { - role: `assistant`, - parts: [{ - type: `text`, - content: e.content - }] - } : { - role: `assistant`, - parts: e.content.map((e) => { - switch (e.type) { - case `text`: return { - type: `text`, - content: e.text - }; - case `reasoning`: return { - type: `reasoning`, - content: e.text - }; - case `tool-call`: return { - type: `tool_call`, - id: e.toolCallId ?? null, - name: e.toolName, - arguments: e.input - }; - case `tool-result`: { - let t = e.output, n; - return t && (n = t.type === `text` || t.type === `error-text` || t.type === `json` || t.type === `error-json` ? t.value : t.type === `execution-denied` ? { - denied: !0, - reason: t.reason - } : t), { - type: `tool_call_response`, - id: e.toolCallId ?? null, - response: n - }; - } - default: return { type: String(e.type) }; - } - }) - }; - if (e.role === `tool`) return { - role: `tool`, - parts: e.content.map((e) => { - if (e.type === `tool-result`) { - let t = e.output, n; - return t && (n = t.type === `text` || t.type === `error-text` || t.type === `json` || t.type === `error-json` ? t.value : t.type === `execution-denied` ? { - denied: !0, - reason: t.reason - } : t), { - type: `tool_call_response`, - id: e.toolCallId ?? null, - response: n - }; - } - return { type: String(e.type) }; - }) - }; - } -} -function d$4({ text: e, reasoning: t, toolCalls: n, files: r, finishReason: i }) { - let a = []; - if (t) for (let e of t) `text` in e && e.text && a.push({ - type: `reasoning`, - content: e.text - }); - if (e != null && e.length > 0 && a.push({ - type: `text`, - content: e - }), n) for (let e of n) a.push({ - type: `tool_call`, - id: e.toolCallId, - name: e.toolName, - arguments: e.input - }); - if (r) for (let e of r) a.push({ - type: `blob`, - modality: s$3(e.mediaType), - mime_type: e.mediaType, - content: e.base64 - }); - return [{ - role: `assistant`, - parts: a, - finish_reason: p$5(i) - }]; -} -function f$3({ objectText: e, finishReason: t }) { - return [{ - role: `assistant`, - parts: [{ - type: `text`, - content: e - }], - finish_reason: p$5(t) - }]; -} -function p$5(e) { - return { - stop: `stop`, - length: `length`, - "content-filter": `content_filter`, - "tool-calls": `tool_call`, - error: `error`, - other: `stop`, - unknown: `stop` - }[e] ?? e; -} -function m$3(e, t) { - t instanceof Error ? (e.recordException({ - name: t.name, - message: t.message, - stack: t.stack - }), e.setStatus({ - code: n$4.SpanStatusCode.ERROR, - message: t.message - })) : e.setStatus({ code: n$4.SpanStatusCode.ERROR }); -} -function h$3(e) { - return typeof e == `string` || typeof e == `number` || typeof e == `boolean`; -} -function g$3(e) { - if (!Array.isArray(e)) return e; - let t = new Set(e.filter(h$3).map((e) => typeof e)); - if (t.size !== 1) return; - let [n] = t; - return n === `string` ? e.filter((e) => typeof e == `string`) : n === `number` ? e.filter((e) => typeof e == `number`) : e.filter((e) => typeof e == `boolean`); -} -function _$2(e) { - let t = {}; - for (let [n, r] of Object.entries(e ?? {})) { - if (r == null) continue; - let e = g$3(r); - e != null && (t[n] = e); - } - return t; -} -function v$3(e) { - return e?.isEnabled !== !1; -} -function y$1(e, t) { - if (!v$3(e)) return {}; - let n = {}; - for (let [r, i] of Object.entries(t)) { - if (i == null) continue; - if (typeof i == `object` && `input` in i && typeof i.input == `function`) { - if (e?.recordInputs === !1) continue; - let t = i.input(); - if (t != null) { - let e = g$3(t); - e != null && (n[r] = e); - } - continue; - } - if (typeof i == `object` && `output` in i && typeof i.output == `function`) { - if (e?.recordOutputs === !1) continue; - let t = i.output(); - if (t != null) { - let e = g$3(t); - e != null && (n[r] = e); - } - continue; - } - let t = g$3(i); - t != null && (n[r] = t); - } - return n; -} -var b$3 = { - usage: !1, - providerMetadata: !1, - embedding: !1, - reranking: !1, - runtimeContext: !1, - headers: !1, - toolChoice: !1, - schema: !1 -}; -function x$2(e) { - return { - ...b$3, - usage: e.usage ?? !1, - providerMetadata: e.providerMetadata ?? !1, - embedding: e.embedding ?? !1, - reranking: e.reranking ?? !1, - runtimeContext: e.runtimeContext ?? !1, - headers: e.headers ?? !1, - toolChoice: e.toolChoice ?? !1, - schema: e.schema ?? !1 - }; -} -function S$2(e) { - let t = {}; - for (let [n, r] of Object.entries(e ?? {})) C$3(t, `ai.settings.context.${n}`, r); - return t; -} -function C$3(e, t, n) { - if (n != null) { - if (Array.isArray(n) || typeof n != `object`) { - e[t] = n; - return; - } - for (let [r, i] of Object.entries(n)) C$3(e, `${t}.${r}`, i); - } -} -function w$3(e) { - return Object.fromEntries(Object.entries(e ?? {}).filter(([, e]) => e != null).map(([e, t]) => [`ai.request.headers.${e}`, t])); -} -function T$3(e) { - return { - "ai.usage.inputTokenDetails.noCacheTokens": e.inputTokenDetails?.noCacheTokens, - "ai.usage.outputTokenDetails.textTokens": e.outputTokenDetails?.textTokens, - "ai.usage.outputTokenDetails.reasoningTokens": e.outputTokenDetails?.reasoningTokens - }; -} -function E$3(e, t, n) { - let r = {}; - for (let [i, a] of Object.entries(n)) !t[i] || a == null || Object.assign(r, y$1(e, a)); - return r; -} -function D$2(e) { - return e == null ? void 0 : e / 1e3; -} -function O$2(e) { - return { - "gen_ai.client.operation.duration": D$2(e.responseTimeMs), - "gen_ai.client.operation.time_to_first_chunk": D$2(e.timeToFirstOutputMs), - "gen_ai.client.operation.time_per_output_chunk": D$2(e.timeBetweenOutputChunksMs?.avg) - }; -} -var k$3 = class { - constructor(e = {}) { - this.callStates = /* @__PURE__ */ new Map(), this.tracer = e.tracer ?? n$4.trace.getTracer(`gen_ai`), this.supplementalAttributes = x$2(e), this.enrichSpan = e.enrichSpan; - } - getCallState(e) { - return this.callStates.get(e); - } - cleanupCallState(e) { - this.callStates.delete(e); - } - getSpanAttributes({ attributes: e, spanType: t, operationId: n, callId: r, runtimeContext: i }) { - let a; - try { - a = this.enrichSpan?.call(this, { - spanType: t, - operationId: n, - callId: r, - runtimeContext: i - }); - } catch { - a = void 0; - } - return { - ..._$2(a), - ...e - }; - } - executeTool({ callId: e, toolCallId: t, execute: r }) { - let i = this.getCallState(e)?.toolSpans.get(t); - return i == null ? r() : n$4.context.with(i.context, r); - } - executeLanguageModelCall({ callId: e, execute: t }) { - let r = this.getCallState(e), i = r?.inferenceContext ?? r?.stepContext; - return i == null ? t() : n$4.context.with(i, t); - } - onStart(e) { - if (e.operationId === `ai.embed` || e.operationId === `ai.embedMany`) { - this.onEmbedOperationStart(e); - return; - } - if (e.operationId === `ai.rerank`) { - this.onRerankOperationStart(e); - return; - } - if (e.operationId === `ai.generateObject` || e.operationId === `ai.streamObject`) { - this.onObjectOperationStart(e); - return; - } - this.onGenerateStart(e); - } - onGenerateStart(e) { - let t = { - recordInputs: e.recordInputs, - recordOutputs: e.recordOutputs, - functionId: e.functionId - }, o = { - maxOutputTokens: e.maxOutputTokens, - temperature: e.temperature, - topP: e.topP, - topK: e.topK, - presencePenalty: e.presencePenalty, - frequencyPenalty: e.frequencyPenalty, - stopSequences: e.stopSequences, - seed: e.seed, - maxRetries: e.maxRetries - }, s = r$7(e.provider), c = i$5(e.operationId), u = e.runtimeContext, d = E$3(t, this.supplementalAttributes, { - runtimeContext: S$2(u), - headers: w$3(e.headers) - }), f = y$1(t, { - "gen_ai.operation.name": c, - "gen_ai.provider.name": s, - "gen_ai.request.model": e.modelId, - "gen_ai.agent.name": t.functionId, - "gen_ai.request.frequency_penalty": e.frequencyPenalty, - "gen_ai.request.max_tokens": e.maxOutputTokens, - "gen_ai.request.presence_penalty": e.presencePenalty, - "gen_ai.request.temperature": e.temperature ?? void 0, - "gen_ai.request.top_k": e.topK, - "gen_ai.request.top_p": e.topP, - "gen_ai.request.stop_sequences": e.stopSequences, - "gen_ai.request.seed": e.seed, - "gen_ai.system_instructions": e.instructions ? { input: () => JSON.stringify(a$4(e.instructions)) } : void 0, - "gen_ai.input.messages": { input: () => JSON.stringify(l$3({ - prompt: void 0, - messages: e.messages - })) }, - ...d - }), p = `${c} ${e.modelId}`, m = this.tracer.startSpan(p, { - attributes: this.getSpanAttributes({ - attributes: f, - spanType: `operation`, - operationId: e.operationId, - callId: e.callId, - runtimeContext: u - }), - kind: n$4.SpanKind.INTERNAL - }), h = n$4.trace.setSpan(n$4.context.active(), m); - this.callStates.set(e.callId, { - operationId: e.operationId, - telemetry: t, - rootSpan: m, - rootContext: h, - stepSpan: void 0, - stepContext: void 0, - inferenceSpan: void 0, - inferenceContext: void 0, - embedSpans: /* @__PURE__ */ new Map(), - rerankSpan: void 0, - toolSpans: /* @__PURE__ */ new Map(), - settings: o, - provider: e.provider, - modelId: e.modelId, - runtimeContext: u, - baseSupplementalAttributes: d - }); - } - onObjectOperationStart(e) { - let t = { - recordInputs: e.recordInputs, - recordOutputs: e.recordOutputs, - functionId: e.functionId - }, o = { - maxOutputTokens: e.maxOutputTokens, - temperature: e.temperature, - topP: e.topP, - topK: e.topK, - presencePenalty: e.presencePenalty, - frequencyPenalty: e.frequencyPenalty, - seed: e.seed, - maxRetries: e.maxRetries - }, s = r$7(e.provider), c = i$5(e.operationId), u = E$3(t, this.supplementalAttributes, { headers: w$3(e.headers) }), d = y$1(t, { - "gen_ai.operation.name": c, - "gen_ai.provider.name": s, - "gen_ai.request.model": e.modelId, - "gen_ai.agent.name": t.functionId, - "gen_ai.output.type": `json`, - "gen_ai.request.frequency_penalty": e.frequencyPenalty, - "gen_ai.request.max_tokens": e.maxOutputTokens, - "gen_ai.request.presence_penalty": e.presencePenalty, - "gen_ai.request.temperature": e.temperature ?? void 0, - "gen_ai.request.top_k": e.topK, - "gen_ai.request.top_p": e.topP, - "gen_ai.request.seed": e.seed, - "gen_ai.system_instructions": e.system ? { input: () => JSON.stringify(a$4(e.system)) } : void 0, - "gen_ai.input.messages": { input: () => JSON.stringify(l$3({ - prompt: e.prompt, - messages: e.messages - })) }, - ...u, - ...E$3(t, this.supplementalAttributes, { schema: { - "ai.schema": e.schema ? { input: () => JSON.stringify(e.schema) } : void 0, - "ai.schema.name": e.schemaName, - "ai.schema.description": e.schemaDescription, - "ai.settings.output": e.output - } }) - }), f = `${c} ${e.modelId}`, p = this.tracer.startSpan(f, { - attributes: this.getSpanAttributes({ - attributes: d, - spanType: `operation`, - operationId: e.operationId, - callId: e.callId, - runtimeContext: void 0 - }), - kind: n$4.SpanKind.INTERNAL - }), m = n$4.trace.setSpan(n$4.context.active(), p); - this.callStates.set(e.callId, { - operationId: e.operationId, - telemetry: t, - rootSpan: p, - rootContext: m, - stepSpan: void 0, - stepContext: void 0, - inferenceSpan: void 0, - inferenceContext: void 0, - embedSpans: /* @__PURE__ */ new Map(), - rerankSpan: void 0, - toolSpans: /* @__PURE__ */ new Map(), - settings: o, - provider: e.provider, - modelId: e.modelId, - runtimeContext: void 0, - baseSupplementalAttributes: u - }); - } - onObjectStepStart(e) { - let t = this.getCallState(e.callId); - if (!t?.rootSpan || !t.rootContext) return; - let { telemetry: i } = t, a = y$1(i, { - "gen_ai.operation.name": `chat`, - "gen_ai.provider.name": r$7(e.provider), - "gen_ai.request.model": e.modelId, - "gen_ai.output.type": `json`, - "gen_ai.request.frequency_penalty": t.settings.frequencyPenalty, - "gen_ai.request.max_tokens": t.settings.maxOutputTokens, - "gen_ai.request.presence_penalty": t.settings.presencePenalty, - "gen_ai.request.temperature": t.settings.temperature ?? void 0, - "gen_ai.request.top_k": t.settings.topK, - "gen_ai.request.top_p": t.settings.topP, - "gen_ai.input.messages": { input: () => e.promptMessages ? JSON.stringify(c$4(e.promptMessages)) : void 0 }, - ...t.baseSupplementalAttributes - }), o = `chat ${e.modelId}`; - t.inferenceSpan = this.tracer.startSpan(o, { - attributes: this.getSpanAttributes({ - attributes: a, - spanType: `languageModel`, - operationId: t.operationId, - callId: e.callId, - runtimeContext: t.runtimeContext - }), - kind: n$4.SpanKind.CLIENT - }, t.rootContext), t.inferenceContext = n$4.trace.setSpan(t.rootContext, t.inferenceSpan); - } - onObjectStepEnd(e) { - let t = this.getCallState(e.callId); - if (!t?.inferenceSpan) return; - let { telemetry: n } = t; - t.inferenceSpan.setAttributes(y$1(n, { - "gen_ai.response.finish_reasons": [e.finishReason], - "gen_ai.response.id": e.response.id, - "gen_ai.response.model": e.response.modelId, - "gen_ai.usage.input_tokens": e.usage.inputTokens, - "gen_ai.usage.output_tokens": e.usage.outputTokens, - "gen_ai.usage.cache_read.input_tokens": e.usage.inputTokenDetails?.cacheReadTokens, - "gen_ai.output.messages": { output: () => { - try { - return JSON.stringify(f$3({ - objectText: e.objectText, - finishReason: e.finishReason - })); - } catch { - return e.objectText; - } - } }, - ...E$3(n, this.supplementalAttributes, { - providerMetadata: { "ai.response.providerMetadata": e.providerMetadata ? JSON.stringify(e.providerMetadata) : void 0 }, - usage: T$3(e.usage) - }) - })), t.inferenceSpan.end(), t.inferenceSpan = void 0, t.inferenceContext = void 0; - } - onEmbedOperationStart(e) { - let t = { - recordInputs: e.recordInputs, - recordOutputs: e.recordOutputs, - functionId: e.functionId - }, i = r$7(e.provider), a = E$3(t, this.supplementalAttributes, { headers: w$3(e.headers) }), o = e.value, s = e.operationId === `ai.embedMany`, c = y$1(t, { - "gen_ai.operation.name": `embeddings`, - "gen_ai.provider.name": i, - "gen_ai.request.model": e.modelId, - ...a, - ...E$3(t, this.supplementalAttributes, { embedding: s ? { "ai.values": { input: () => o.map((e) => JSON.stringify(e)) } } : { "ai.value": { input: () => JSON.stringify(o) } } }) - }), l = `embeddings ${e.modelId}`, u = this.tracer.startSpan(l, { - attributes: this.getSpanAttributes({ - attributes: c, - spanType: `operation`, - operationId: e.operationId, - callId: e.callId, - runtimeContext: void 0 - }), - kind: n$4.SpanKind.CLIENT - }), d = n$4.trace.setSpan(n$4.context.active(), u); - this.callStates.set(e.callId, { - operationId: e.operationId, - telemetry: t, - rootSpan: u, - rootContext: d, - stepSpan: void 0, - stepContext: void 0, - inferenceSpan: void 0, - inferenceContext: void 0, - embedSpans: /* @__PURE__ */ new Map(), - rerankSpan: void 0, - toolSpans: /* @__PURE__ */ new Map(), - settings: { maxRetries: e.maxRetries }, - provider: e.provider, - modelId: e.modelId, - runtimeContext: void 0, - baseSupplementalAttributes: a - }); - } - onStepStart(e) { - let t = this.getCallState(e.callId); - if (!t?.rootSpan || !t.rootContext) return; - let { telemetry: r } = t; - t.runtimeContext = e.runtimeContext; - let i = y$1(r, { - "gen_ai.operation.name": `agent_step`, - ...t.baseSupplementalAttributes, - ...E$3(r, this.supplementalAttributes, { toolChoice: { "ai.prompt.toolChoice": { input: () => e.stepToolChoice == null ? void 0 : JSON.stringify(e.stepToolChoice) } } }) - }); - t.stepSpan = this.tracer.startSpan(`step ${e.steps.length + 1}`, { - attributes: this.getSpanAttributes({ - attributes: i, - spanType: `step`, - operationId: t.operationId, - callId: e.callId, - runtimeContext: t.runtimeContext - }), - kind: n$4.SpanKind.INTERNAL - }, t.rootContext), t.stepContext = n$4.trace.setSpan(t.rootContext, t.stepSpan); - } - onLanguageModelCallStart(e) { - let t = this.getCallState(e.callId); - if (!t?.stepContext) return; - let { telemetry: i } = t, a = y$1(i, { - "gen_ai.operation.name": `chat`, - "gen_ai.provider.name": r$7(e.provider), - "gen_ai.request.model": e.modelId, - "gen_ai.request.frequency_penalty": t.settings.frequencyPenalty, - "gen_ai.request.max_tokens": t.settings.maxOutputTokens, - "gen_ai.request.presence_penalty": t.settings.presencePenalty, - "gen_ai.request.stop_sequences": t.settings.stopSequences, - "gen_ai.request.temperature": t.settings.temperature ?? void 0, - "gen_ai.request.top_k": t.settings.topK, - "gen_ai.request.top_p": t.settings.topP, - "gen_ai.input.messages": { input: () => { - let t = l$3({ - prompt: void 0, - messages: e.messages - }); - return t.length > 0 ? JSON.stringify(t) : void 0; - } }, - "gen_ai.tool.definitions": { input: () => e.tools ? JSON.stringify(e.tools) : void 0 } - }); - t.inferenceSpan = this.tracer.startSpan(`chat ${e.modelId}`, { - attributes: this.getSpanAttributes({ - attributes: a, - spanType: `languageModel`, - operationId: t.operationId, - callId: e.callId, - runtimeContext: t.runtimeContext - }), - kind: n$4.SpanKind.CLIENT - }, t.stepContext), t.inferenceContext = n$4.trace.setSpan(t.stepContext, t.inferenceSpan); - } - onLanguageModelCallEnd(e) { - let t = this.getCallState(e.callId); - if (!t?.inferenceSpan) return; - let { telemetry: n } = t; - t.inferenceSpan.setAttributes(y$1(n, { - ...O$2(e.performance), - "gen_ai.response.finish_reasons": [e.finishReason], - "gen_ai.response.id": e.responseId, - "gen_ai.usage.input_tokens": e.usage.inputTokens, - "gen_ai.usage.output_tokens": e.usage.outputTokens, - "gen_ai.usage.cache_read.input_tokens": e.usage.inputTokenDetails?.cacheReadTokens, - "gen_ai.usage.cache_creation.input_tokens": e.usage.inputTokenDetails?.cacheWriteTokens, - "gen_ai.output.messages": { output: () => JSON.stringify(d$4({ - text: e.content.filter((e) => e.type === `text`).map((e) => e.text).join(``) || void 0, - reasoning: e.content.filter((e) => e.type === `reasoning`), - toolCalls: e.content.filter((e) => e.type === `tool-call`), - files: e.content.filter((e) => e.type === `file`).map((e) => e.file), - finishReason: e.finishReason - })) }, - ...E$3(n, this.supplementalAttributes, { usage: T$3(e.usage) }) - })), t.inferenceSpan.end(), t.inferenceSpan = void 0, t.inferenceContext = void 0; - } - onToolExecutionStart(e) { - let t = this.getCallState(e.callId); - if (!t?.stepContext) return; - let { telemetry: r } = t, { toolCall: i } = e, a = y$1(r, { - "gen_ai.operation.name": `execute_tool`, - "gen_ai.tool.name": i.toolName, - "gen_ai.tool.call.id": i.toolCallId, - "gen_ai.tool.type": `function`, - "gen_ai.tool.call.arguments": { input: () => JSON.stringify(i.input) } - }), o = `execute_tool ${i.toolName}`, s = this.tracer.startSpan(o, { - attributes: this.getSpanAttributes({ - attributes: a, - spanType: `tool`, - operationId: t.operationId, - callId: e.callId, - runtimeContext: t.runtimeContext - }), - kind: n$4.SpanKind.INTERNAL - }, t.stepContext), c = n$4.trace.setSpan(t.stepContext, s); - t.toolSpans.set(i.toolCallId, { - span: s, - context: c - }); - } - onToolExecutionEnd(e) { - let t = this.getCallState(e.callId); - if (!t) return; - let n = t.toolSpans.get(e.toolCall.toolCallId); - if (!n) return; - let { span: r } = n, { telemetry: i } = t, { toolOutput: a } = e; - if (r.setAttributes(y$1(i, { "gen_ai.execute_tool.duration": D$2(e.toolExecutionMs) })), a.type === `tool-result`) try { - r.setAttributes(y$1(i, { "gen_ai.tool.call.result": { output: () => JSON.stringify(a.output) } })); - } catch {} - else m$3(r, a.error); - r.end(), t.toolSpans.delete(e.toolCall.toolCallId); - } - onStepEnd(e) { - let t = this.getCallState(e.callId); - if (!t?.stepSpan) return; - let { telemetry: n } = t; - t.stepSpan.setAttributes(E$3(n, this.supplementalAttributes, { - providerMetadata: { "ai.response.providerMetadata": e.providerMetadata ? JSON.stringify(e.providerMetadata) : void 0 }, - usage: T$3(e.usage) - })), t.stepSpan.end(), t.stepSpan = void 0, t.stepContext = void 0; - } - onStepFinish(e) { - this.onStepEnd(e); - } - onEnd(e) { - let t = this.getCallState(e.callId); - if (t?.rootSpan) { - if (t.operationId === `ai.embed` || t.operationId === `ai.embedMany`) { - this.onEmbedOperationEnd(e); - return; - } - if (t.operationId === `ai.rerank`) { - this.onRerankOperationEnd(e); - return; - } - if (t.operationId === `ai.generateObject` || t.operationId === `ai.streamObject`) { - this.onObjectOperationEnd(e); - return; - } - this.onGenerateEnd(e); - } - } - onGenerateEnd(e) { - let t = this.getCallState(e.callId); - if (!t?.rootSpan) return; - let { telemetry: n } = t; - t.rootSpan.setAttributes(y$1(n, { - "gen_ai.response.finish_reasons": [e.finishReason], - "gen_ai.usage.input_tokens": e.usage.inputTokens, - "gen_ai.usage.output_tokens": e.usage.outputTokens, - "gen_ai.usage.cache_read.input_tokens": e.usage.inputTokenDetails?.cacheReadTokens, - "gen_ai.usage.cache_creation.input_tokens": e.usage.inputTokenDetails?.cacheWriteTokens, - "gen_ai.output.messages": { output: () => JSON.stringify(d$4({ - text: e.text ?? void 0, - reasoning: e.finalStep.reasoning, - toolCalls: e.toolCalls, - files: e.files, - finishReason: e.finishReason - })) }, - ...E$3(n, this.supplementalAttributes, { - providerMetadata: { "ai.response.providerMetadata": e.finalStep.providerMetadata ? JSON.stringify(e.finalStep.providerMetadata) : void 0 }, - usage: T$3(e.usage) - }) - })), t.rootSpan.end(), this.cleanupCallState(e.callId); - } - onObjectOperationEnd(e) { - let t = this.getCallState(e.callId); - if (!t?.rootSpan) return; - let { telemetry: n } = t; - t.rootSpan.setAttributes(y$1(n, { - "gen_ai.response.finish_reasons": [e.finishReason], - "gen_ai.usage.input_tokens": e.usage.inputTokens, - "gen_ai.usage.output_tokens": e.usage.outputTokens, - "gen_ai.usage.cache_read.input_tokens": e.usage.inputTokenDetails?.cacheReadTokens, - "gen_ai.output.messages": { output: () => e.object == null ? void 0 : JSON.stringify(f$3({ - objectText: JSON.stringify(e.object), - finishReason: e.finishReason - })) }, - ...E$3(n, this.supplementalAttributes, { - providerMetadata: { "ai.response.providerMetadata": e.providerMetadata ? JSON.stringify(e.providerMetadata) : void 0 }, - usage: T$3(e.usage) - }) - })), t.rootSpan.end(), this.cleanupCallState(e.callId); - } - onEmbedOperationEnd(e) { - let t = this.getCallState(e.callId); - if (!t?.rootSpan) return; - let { telemetry: n } = t, r = t.operationId === `ai.embedMany`; - t.rootSpan.setAttributes(y$1(n, { - "gen_ai.usage.input_tokens": e.usage.tokens, - ...E$3(n, this.supplementalAttributes, { embedding: r ? { "ai.embeddings": { output: () => e.embedding.map((e) => JSON.stringify(e)) } } : { "ai.embedding": { output: () => JSON.stringify(e.embedding) } } }) - })), t.rootSpan.end(), this.cleanupCallState(e.callId); - } - onEmbedStart(e) { - let t = this.getCallState(e.callId); - if (!t?.rootSpan || !t.rootContext) return; - let { telemetry: i } = t, a = y$1(i, { - "gen_ai.operation.name": `embeddings`, - "gen_ai.provider.name": r$7(t.provider), - "gen_ai.request.model": t.modelId, - ...t.baseSupplementalAttributes, - ...E$3(i, this.supplementalAttributes, { embedding: { "ai.values": { input: () => e.values.map((e) => JSON.stringify(e)) } } }) - }), o = `embeddings ${t.modelId}`, s = this.tracer.startSpan(o, { - attributes: this.getSpanAttributes({ - attributes: a, - spanType: `embedding`, - operationId: t.operationId, - callId: e.callId, - runtimeContext: t.runtimeContext - }), - kind: n$4.SpanKind.CLIENT - }, t.rootContext), c = n$4.trace.setSpan(t.rootContext, s); - t.embedSpans.set(e.embedCallId, { - span: s, - context: c - }); - } - onEmbedEnd(e) { - let t = this.getCallState(e.callId); - if (!t) return; - let n = t.embedSpans.get(e.embedCallId); - if (!n) return; - let { span: r } = n, { telemetry: i } = t; - r.setAttributes(y$1(i, { - "gen_ai.usage.input_tokens": e.usage.tokens, - ...E$3(i, this.supplementalAttributes, { embedding: { "ai.embeddings": { output: () => e.embeddings.map((e) => JSON.stringify(e)) } } }) - })), r.end(), t.embedSpans.delete(e.embedCallId); - } - onRerankOperationStart(e) { - let t = { - recordInputs: e.recordInputs, - recordOutputs: e.recordOutputs, - functionId: e.functionId - }, i = r$7(e.provider), a = E$3(t, this.supplementalAttributes, { headers: w$3(e.headers) }), o = y$1(t, { - "gen_ai.operation.name": `rerank`, - "gen_ai.provider.name": i, - "gen_ai.request.model": e.modelId, - ...a, - ...E$3(t, this.supplementalAttributes, { reranking: { "ai.documents": { input: () => e.documents.map((e) => JSON.stringify(e)) } } }) - }), s = `rerank ${e.modelId}`, c = this.tracer.startSpan(s, { - attributes: this.getSpanAttributes({ - attributes: o, - spanType: `operation`, - operationId: e.operationId, - callId: e.callId, - runtimeContext: void 0 - }), - kind: n$4.SpanKind.CLIENT - }), l = n$4.trace.setSpan(n$4.context.active(), c); - this.callStates.set(e.callId, { - operationId: e.operationId, - telemetry: t, - rootSpan: c, - rootContext: l, - stepSpan: void 0, - stepContext: void 0, - inferenceSpan: void 0, - inferenceContext: void 0, - embedSpans: /* @__PURE__ */ new Map(), - rerankSpan: void 0, - toolSpans: /* @__PURE__ */ new Map(), - settings: { maxRetries: e.maxRetries }, - provider: e.provider, - modelId: e.modelId, - runtimeContext: void 0, - baseSupplementalAttributes: a - }); - } - onRerankOperationEnd(e) { - let t = this.getCallState(e.callId); - t?.rootSpan && (t.rootSpan.end(), this.cleanupCallState(e.callId)); - } - onRerankStart(e) { - let t = this.getCallState(e.callId); - if (!t?.rootSpan || !t.rootContext) return; - let { telemetry: i } = t, a = y$1(i, { - "gen_ai.operation.name": `rerank`, - "gen_ai.provider.name": r$7(t.provider), - "gen_ai.request.model": t.modelId, - ...t.baseSupplementalAttributes, - ...E$3(i, this.supplementalAttributes, { reranking: { "ai.documents": { input: () => e.documents.map((e) => JSON.stringify(e)) } } }) - }), o = `rerank ${t.modelId}`, s = this.tracer.startSpan(o, { - attributes: this.getSpanAttributes({ - attributes: a, - spanType: `reranking`, - operationId: t.operationId, - callId: e.callId, - runtimeContext: t.runtimeContext - }), - kind: n$4.SpanKind.CLIENT - }, t.rootContext); - t.rerankSpan = { - span: s, - context: n$4.trace.setSpan(t.rootContext, s) - }; - } - onRerankEnd(e) { - let t = this.getCallState(e.callId); - if (!t?.rerankSpan) return; - let { span: n } = t.rerankSpan, { telemetry: r } = t; - n.setAttributes(E$3(r, this.supplementalAttributes, { reranking: { - "ai.ranking.type": e.documentsType, - "ai.ranking": { output: () => e.ranking.map((e) => JSON.stringify(e)) } - } })), n.end(), t.rerankSpan = void 0; - } - onAbort(e) { - let t = this.getCallState(e.callId); - if (t?.rootSpan) { - for (let { span: e } of t.toolSpans.values()) e.end(); - t.toolSpans.clear(), t.inferenceSpan && (t.inferenceSpan.end(), t.inferenceSpan = void 0, t.inferenceContext = void 0), t.stepSpan && (t.stepSpan.end(), t.stepSpan = void 0, t.stepContext = void 0); - for (let { span: e } of t.embedSpans.values()) e.end(); - t.embedSpans.clear(), t.rerankSpan &&= (t.rerankSpan.span.end(), void 0), t.rootSpan.end(), this.cleanupCallState(e.callId); - } - } - onError(e) { - let t = e; - if (!t?.callId) return; - let n = this.getCallState(t.callId); - if (!n?.rootSpan) return; - let r = t.error ?? e; - for (let { span: e } of n.toolSpans.values()) m$3(e, r), e.end(); - n.toolSpans.clear(), n.inferenceSpan && (m$3(n.inferenceSpan, r), n.inferenceSpan.end(), n.inferenceSpan = void 0, n.inferenceContext = void 0), n.stepSpan && (m$3(n.stepSpan, r), n.stepSpan.end(), n.stepSpan = void 0, n.stepContext = void 0); - for (let { span: e } of n.embedSpans.values()) m$3(e, r), e.end(); - n.embedSpans.clear(), n.rerankSpan &&= (m$3(n.rerankSpan.span, r), n.rerankSpan.span.end(), void 0), m$3(n.rootSpan, r), n.rootSpan.end(), this.cleanupCallState(t.callId); - } -}; -//#endregion -//#region node_modules/eve/dist/src/harness/otel-integration.js -let registered = !1; -function ensureOtelIntegration() { - registered || (registered = !0, registerTelemetry(new k$3({ runtimeContext: !0 }))); -} -//#endregion -//#region node_modules/eve/dist/src/harness/provider-tools.js -const UPSTREAM_TOOL_TYPE_TO_FRAMEWORK_NAME = { web_search_20250305: WEB_SEARCH_TOOL_DEFINITION.name }; -function resolveFrameworkToolFromUpstreamType(e) { - return UPSTREAM_TOOL_TYPE_TO_FRAMEWORK_NAME[e] ?? null; -} -function resolveWebSearchOutputSchema(e) { - switch (e) { - case `anthropic`: return WEB_SEARCH_ANTHROPIC_OUTPUT_SCHEMA; - case `google`: return WEB_SEARCH_GOOGLE_OUTPUT_SCHEMA; - case `openai`: return WEB_SEARCH_OPENAI_OUTPUT_SCHEMA; - case `parallel`: return WEB_SEARCH_PARALLEL_OUTPUT_SCHEMA; - } -} -function resolveWebSearchBackend(e) { - if (e.source === void 0) return `parallel`; - let t = e.id.split(`/`)[0] ?? ``; - return t === `openai` || t.startsWith(`openai.`) ? `openai` : t === `anthropic` || t.startsWith(`anthropic.`) ? `anthropic` : t.startsWith(`google.`) ? `google` : null; -} -async function resolveWebSearchProviderTool(e) { - switch (e) { - case `openai`: { - let { openai: t } = await Promise.resolve().then(() => openai_exports); - return attachWebSearchOutputSchema(t.tools.webSearch({}), e); - } - case `anthropic`: { - let { anthropic: t } = await Promise.resolve().then(() => anthropic_exports); - return attachWebSearchOutputSchema(t.tools.webSearch_20250305(), e); - } - case `google`: { - let { google: t } = await Promise.resolve().then(() => google_exports); - return attachWebSearchOutputSchema(t.tools.googleSearch({}), e); - } - case `parallel`: { - let { gateway: t } = await import("./ai.mjs").then((n) => n.i); - return attachWebSearchOutputSchema(t.tools.parallelSearch(), e); - } - } -} -function attachWebSearchOutputSchema(t, n) { - return { - ...t, - outputSchema: jsonSchema(resolveWebSearchOutputSchema(n)) - }; -} -//#endregion -//#region node_modules/eve/dist/src/harness/step-hooks.js -function buildStepHooks(e) { - let t = e.session, n = e.emit, r; - return { - onStepFinish: async (e) => { - r(e); - }, - prepareStep: async ({ messages: r }) => { - let a = r; - n && e.emitStepStarted !== !1 && await emitStepStarted(n, e.emissionState, r), e.cachePath.kind === `anthropic-direct` && e.marker && (a = applyConversationCacheControl([...r], e.marker)); - let o = { messages: a }; - return e.cachePath.kind === `gateway-auto` && (o.providerOptions = mergeGatewayAutoCaching(t.agent.modelReference.providerOptions)), o; - }, - stepResult: new Promise((e) => { - r = e; - }) - }; -} -async function emitStepActions(r, i, s, c) { - let l = new Set(s.toolCalls.filter(isProviderExecutedToolCall).map((e) => e.toolCallId)), u = /* @__PURE__ */ new Set([ - ...l, - ...extractToolApprovalInputRequests({ content: s.content ?? [] }).map((e) => e.action.callId), - ...s.toolCalls.filter(isInvalidToolCall).map((e) => e.toolCallId) - ]), isExcluded = (e, t) => u.has(e) || c.excludedActionToolNames.has(t), d = s.toolCalls.filter((e) => !isExcluded(e.toolCallId, e.toolName) && !c.emittedActionCallIds?.has(e.toolCallId)).map((e) => createRuntimeActionRequestFromToolCall({ - toolCall: e, - tools: c.tools - })); - d.length > 0 && await r(createActionsRequestedEvent({ - actions: d, - sequence: i.sequence, - stepIndex: i.stepIndex, - turnId: i.turnId - })); - let f = c.handledInlineToolResultCallIds, p = new Map(s.toolResults.map((e) => [e.toolCallId, e.output])); - for (let t of reconcileToolResults(s)) { - if (isExcluded(t.callId, t.toolName) || f?.has(t.callId)) continue; - let n = p.get(t.callId); - shouldSkipAuthorizationActionResult(t.callId, n) || await r(createActionResultEvent({ - result: t, - sequence: i.sequence, - stepIndex: i.stepIndex, - turnId: i.turnId - })); - } - await r(createStepCompletedEvent({ - finishReason: normalizeAssistantStepFinishReason(s.finishReason), - sequence: i.sequence, - stepIndex: i.stepIndex, - turnId: i.turnId, - usage: extractStepUsage(s.usage) - })); -} -function isInvalidToolCall(e) { - return e.invalid === !0; -} -function isProviderExecutedToolCall(e) { - return e.providerExecuted === !0; -} -function reconcileToolResults(e) { - let t = /* @__PURE__ */ new Map(); - for (let n of e.toolResults) n.providerExecuted !== !0 && t.set(n.toolCallId, createRuntimeToolResultFromStepResult(n)); - for (let n of extractToolResultParts(e.response.messages)) n.providerExecuted !== !0 && (t.has(n.toolCallId) || t.set(n.toolCallId, createRuntimeToolResultFromMessagePart(n))); - return [...t.values()]; -} -function shouldSkipAuthorizationActionResult(e, t) { - if (t !== void 0 && isPendingAuthorizationToolOutput(t)) return !0; - let n = contextStorage.getStore(); - if (n === void 0) return !1; - let i = readToolInterrupt(n, e); - return i !== void 0 && isAuthorizationSignal(i); -} -function extractToolResultParts(e) { - let t = []; - for (let n of e) if (!(n.role !== `tool` || !Array.isArray(n.content))) for (let e of n.content) e.type === `tool-result` && t.push(e); - return t; -} -function extractStepUsage(e) { - if (e === void 0) return; - let t = {}; - return e.inputTokens !== void 0 && (t.inputTokens = e.inputTokens), e.outputTokens !== void 0 && (t.outputTokens = e.outputTokens), e.inputTokenDetails?.cacheReadTokens !== void 0 && (t.cacheReadTokens = e.inputTokenDetails.cacheReadTokens), e.inputTokenDetails?.cacheWriteTokens !== void 0 && (t.cacheWriteTokens = e.inputTokenDetails.cacheWriteTokens), Object.keys(t).length > 0 ? t : void 0; -} -//#endregion -//#region node_modules/eve/dist/src/harness/tools.js -const toolApprovals = /* @__PURE__ */ new WeakMap(); -function buildToolSet(e) { - let t = {}, n = e.capabilities?.requestInput === !0, i = e.disabledProviderTools; - for (let s of e.tools.values()) { - if (s.name === ASK_QUESTION_TOOL_NAME && !n || i?.has(s.name)) continue; - let c = s.toModelOutput, l = buildApprovalFn(s, e), u = tool({ - description: s.description, - execute: wrapToolExecute(s), - inputSchema: s.inputSchema, - outputSchema: s.outputSchema, - ...s.execute === void 0 ? c === void 0 ? {} : { toModelOutput: async ({ output: e, toolCallId: t }) => normalizeToolModelOutput({ - output: await c(e), - toolCallId: t, - toolName: s.name - }) } : { toModelOutput: async ({ output: e, toolCallId: t }) => isAuthorizationPendingModelOutput(e) ? { - type: `text`, - value: authorizationPendingModelText(e.connections) - } : c === void 0 ? typeof e == `string` ? { - type: `text`, - value: e - } : normalizeToolModelOutput({ - output: { - type: `json`, - value: e ?? null - }, - toolCallId: t, - toolName: s.name - }) : normalizeToolModelOutput({ - output: await c(e), - toolCallId: t, - toolName: s.name - }) } - }); - t[s.name] = u, s.approval !== void 0 && toolApprovals.set(u, l); - } - return t; -} -function buildToolSetFromDefinitions(e) { - let t = /* @__PURE__ */ new Map(); - for (let n of e.tools) t.has(n.name) || t.set(n.name, n); - return buildToolSet({ - approvedTools: e.approvedTools, - capabilities: e.capabilities, - disabledProviderTools: e.disabledProviderTools, - tools: t - }); -} -function wrapToolExecute(e) { - let t = e.execute; - if (t !== void 0) return async (r, i) => { - let a = await t(r); - return isAuthorizationSignal(a) ? (stashToolInterrupt(loadContext(), i.toolCallId, a), modelFacingAuthorizationOutput(a)) : normalizeToolJsonOutput({ - boundary: `execute`, - output: a, - toolCallId: i.toolCallId, - toolName: e.name - }); - }; -} -function normalizeToolJsonOutput(e) { - let n = e.output === void 0 ? null : e.output; - return withToolOutputSerializationError(e, () => (parseJsonValue(n), n)); -} -function normalizeToolModelOutput(e) { - return withToolOutputSerializationError({ - boundary: `toModelOutput`, - toolCallId: e.toolCallId, - toolName: e.toolName - }, () => { - if (e.output === null || typeof e.output != `object`) throw TypeError(`Expected a tool model output object.`); - let t = e.output; - if (t.type === `text`) { - if (typeof t.value != `string`) throw TypeError(`Expected text model output to include a string "value".`); - return { - type: `text`, - value: t.value - }; - } - if (t.type === `json`) return { - type: `json`, - value: normalizeToolJsonOutput({ - boundary: `toModelOutput`, - output: t.value, - toolCallId: e.toolCallId, - toolName: e.toolName - }) - }; - throw TypeError(`Expected tool model output type to be "text" or "json".`); - }); -} -async function buildToolSetWithProviderTools(e) { - let t = e.disabledProviderTools, n = { ...buildToolSet({ - approvedTools: e.approvedTools, - capabilities: e.capabilities, - disabledProviderTools: t, - tools: e.tools - }) }; - if (!t?.has(WEB_SEARCH_TOOL_DEFINITION.name)) { - let t = e.tools.get(WEB_SEARCH_TOOL_DEFINITION.name); - if (t !== void 0 && t.execute === void 0) { - let t = resolveWebSearchBackend(e.modelReference); - t === null ? delete n[WEB_SEARCH_TOOL_DEFINITION.name] : n[WEB_SEARCH_TOOL_DEFINITION.name] = await resolveWebSearchProviderTool(t); - } - } - return n; -} -function buildApprovalFn(t, n) { - return async (r) => { - if (t.approval === void 0) return; - let a = isObject(r) ? r : void 0, o = await t.approval({ - ...buildCallbackContext(), - approvedTools: n.approvedTools ?? /* @__PURE__ */ new Set(), - toolInput: a, - toolName: t.name - }); - return typeof o == `boolean` ? o ? `user-approval` : `not-applicable` : o; - }; -} -function buildToolApproval(e) { - return async ({ toolCall: t }) => { - let n = e[t.toolName]; - return n === void 0 ? void 0 : await toolApprovals.get(n)?.(t.input); - }; -} -//#endregion -//#region node_modules/eve/dist/src/runtime/framework-tools/final-output.js -const FINAL_OUTPUT_TOOL_NAME = `final_output`; -function buildFinalOutputTool(e) { - return { - description: `Deliver your final answer in the required structure by calling this tool. Call it exactly once, when you are done; do not answer in prose.`, - inputSchema: jsonSchema(e), - outputSchema: jsonSchema(e) - }; -} -//#endregion -//#region node_modules/eve/dist/src/harness/tool-loop.js -const environment = process.env.NODE_ENV ?? `unknown`; -const eveVersion = resolveInstalledPackageInfo().version; -const log$2 = createLogger(`harness.tool-loop`); -function logToolExecutionError(e) { - e.toolOutput.type === `tool-error` && logError(log$2, `tool execution failed`, e.toolOutput.error, { - toolName: e.toolCall.toolName, - toolCallId: e.toolCall.toolCallId - }); -} -function enrichTelemetry(e, t, n) { - if (e === void 0) return; - let r = {}; - for (let e of Object.keys(n ?? {})) r[e] = !0; - return { - functionId: e.functionId ?? t, - includeRuntimeContext: r, - isEnabled: !0, - recordInputs: e.recordInputs ?? !0, - recordOutputs: e.recordOutputs ?? !0 - }; -} -function buildGatewayAttributionHeaders(e, t) { - if (typeof e != `string`) return; - let n = t?.agentName ?? t?.agentId, r = process.env.VERCEL_PROJECT_PRODUCTION_URL || process.env.VERCEL_URL, i = r ? `https://${r}` : void 0; - if (!n && !i) return; - let a = {}; - return n && (a[`x-title`] = n), i && (a[`http-referer`] = i), a; -} -const TURN_TRACE_STATE_KEY = `eve.harness.turnTrace`; -function getTurnTraceState(e) { - return e.state?.[TURN_TRACE_STATE_KEY]; -} -function setTurnTraceState(e, t) { - let n = { - traceId: t.traceId, - spanId: t.spanId, - traceFlags: t.traceFlags - }; - return { - ...e, - state: { - ...e.state, - [TURN_TRACE_STATE_KEY]: n - } - }; -} -function resolveStepOtelContext(e, t, n) { - if (t) return $$13.setSpan(G$11.active(), t); - if (e) { - let e = getTurnTraceState(n); - if (e) { - let t = $$13.wrapSpanContext({ - traceId: e.traceId, - spanId: e.spanId, - traceFlags: e.traceFlags - }); - return $$13.setSpan(G$11.active(), t); - } - } -} -function createToolLoopHarness(t) { - let n = t.handleEvent, c = getInstrumentationConfig(); - c !== void 0 && ensureOtelIntegration(); - let f = c === void 0 ? void 0 : $$13.getTracer(`eve`), p = t.runtimeIdentity?.agentName; - async function runStep(e, t) { - let n; - if (f && hasStepInput(t)) { - let t = c?.functionId ?? p, r = { - "eve.version": eveVersion, - "eve.environment": environment, - "eve.session.id": e.sessionId - }; - t && (r[`ai.telemetry.functionId`] = t), n = f.startSpan(`ai.eve.turn`, { attributes: r }); - } - let r = resolveStepOtelContext(f, n, e), executeStep = () => executeStepBody(e, t, n); - try { - return r ? await G$11.with(r, executeStep) : await executeStep(); - } finally { - n?.end(); - } - } - async function executeStepBody(f, v, y) { - let b = f; - y && (b = setTurnTraceState(b, y.spanContext())); - let x = getHarnessEmissionState(b.state), S = consumeDeferredStepInput({ - input: v, - session: b - }); - b = S.session; - let D = await resolvePendingRuntimeActions({ - emit: n, - session: b, - stepInput: S.input - }); - if (D.outcome === `unresolved`) return { - next: null, - session: D.session - }; - b = D.session; - let O = resolvePendingInput({ - history: D.messages, - resolveApprovalKey: resolveApprovalKeyFromTools(t.tools), - session: b, - stepInput: S.input - }); - if (O.outcome === `unresolved`) return n && O.deferredMessage === !0 && hasStepInput(v) ? (x = await emitTurnPreamble(n, v ?? {}, x, t.runtimeIdentity), x = await emitTurnEpilogue(n, x, t.mode), { - next: null, - session: setHarnessEmissionState(O.session, x) - }) : { - next: null, - session: O.session - }; - if (n && O.rejectedActions) for (let e of O.rejectedActions.results) await n(createActionResultEvent({ - rejected: !0, - result: e, - sequence: O.rejectedActions.event.sequence, - stepIndex: O.rejectedActions.event.stepIndex, - turnId: O.rejectedActions.event.turnId - })); - n && hasStepInput(v) && (x = await emitTurnPreamble(n, v ?? {}, x, t.runtimeIdentity), b = setHarnessEmissionState(b, x), y && y.setAttribute(`eve.turn.id`, x.turnId)), b = O.session, t.workflow === !0 && (b = ensureWorkflowContinuationSecurity(b)); - let k = O.messages; - if (S.input?.context !== void 0) for (let e of S.input.context) k.push({ - content: e, - role: `user` - }); - if (S.input?.message !== void 0 && !O.deferredMessage && !O.consumedMessage) { - let e = await stageAttachmentsToSandbox(S.input.message); - k.push({ - content: e, - role: `user` - }); - } - let A = await t.resolveModel(b.agent.modelReference), j = detectPromptCachePath(A), M = j.kind === `anthropic-direct` ? getAnthropicCacheMarker() : void 0, N = buildGatewayAttributionHeaders(A, t.runtimeIdentity); - ({messages: k, session: b} = await maybeCompact({ - emit: n, - emissionState: x, - headers: N, - messages: k, - model: A, - onCompaction: t.onCompaction, - resolveModel: t.resolveModel, - session: b, - telemetry: enrichTelemetry(c, p) ?? void 0 - })); - let P = getApprovedTools(b), F = contextStorage.getStore(), I = b.outputSchema === void 0 && F !== void 0 && isScheduleAppAuth(F.get(AuthKey)) && F.get(ParentSessionKey) === void 0, L = await hydrateSandboxAttachments(k), R = [], z = []; - for (let e of L) e.role === `system` ? R.push(e) : z.push(e); - if (F !== void 0) { - R.push(...buildDynamicInstructionMessages(F)); - let e = F.get(PendingSkillAnnouncementKey); - e !== void 0 && e.length > 0 && R.push({ - role: `system`, - content: e - }); - } - I && R.push({ - role: `system`, - content: CONDITIONAL_DELIVERY_INSTRUCTION - }); - let B = z, prepareModelCallInput = (e) => { - let t = e ? [{ - role: `system`, - content: e - }] : [], n = b.agent.system ? [{ - role: `system`, - content: b.agent.system - }] : [], r = R.length > 0 || t.length > 0 ? [ - ...t, - ...n, - ...R - ] : void 0, i = r !== void 0 && M ? applySystemCacheBreakpoint(r, M) : r ?? b.agent.system ?? void 0; - return { - instructions: i, - telemetryRuntimeContext: buildTelemetryRuntimeContext({ - eveVersion, - authored: c, - emissionState: x, - environment, - modelInput: { - instructions: i, - messages: B - }, - session: b - }) - }; - }, runOneModelCall = async (e) => { - let { instructions: i, telemetryRuntimeContext: a = {} } = e.preparedInput ?? prepareModelCallInput(e.extraSystemNote); - e.retryReason && (a[`eve.retry.reason`] = e.retryReason); - let o = e.trailingUserNote ? [...B, { - role: `user`, - content: e.trailingUserNote - }] : B, s = await buildToolSetWithProviderTools({ - approvedTools: P, - capabilities: t.capabilities, - disabledProviderTools: e.disabledProviderTools, - modelReference: b.agent.modelReference, - tools: t.tools - }); - if (F !== void 0) { - let n = buildDynamicTools(F), r = buildToolSetFromDefinitions({ - approvedTools: P, - capabilities: t.capabilities, - disabledProviderTools: e.disabledProviderTools, - tools: n - }); - for (let [e, t] of Object.entries(r)) s[e] = t; - } - b.outputSchema !== void 0 && (s[FINAL_OUTPUT_TOOL_NAME] = buildFinalOutputTool(b.outputSchema)); - let u = t.workflow === !0 ? (await applyWorkflowTool({ - continuationSecurity: getWorkflowContinuationSecurity(b), - harnessTools: t.tools, - lifecycle: n === void 0 ? void 0 : createWorkflowLifecycle({ - emit: n, - emissionState: x, - tools: t.tools - }), - tools: s - })).modelTools : s, d = M ? applyLastToolCacheBreakpoint(u, M) : u, f = buildStepHooks({ - cachePath: j, - emit: n, - emissionState: x, - emitStepStarted: e.suppressStepStartedEmission !== !0, - marker: M, - session: b - }), h = new ToolLoopAgent({ - headers: N, - instructions: i, - model: A, - onToolExecutionEnd: logToolExecutionError, - onError(e) { - summarizeKnownModelCallConfigError(e.error) === null && logError(log$2, `tool-loop stream error`, e.error); - }, - onStepFinish: f.onStepFinish, - prepareStep: f.prepareStep, - reasoning: b.agent.reasoning, - runtimeContext: a, - stopWhen: isStepCount(1), - telemetry: enrichTelemetry(c, p, a), - toolApproval: buildToolApproval(u), - tools: d - }), executeModelCall = async () => { - if (n) { - let e = /* @__PURE__ */ new Set([ASK_QUESTION_TOOL_NAME, FINAL_OUTPUT_TOOL_NAME]), r = await h.stream({ messages: o }), { emittedActionCallIds: i, handledInlineToolResultCallIds: a, inlineAuthorizationResults: s, inlineToolResultParts: c } = await emitStreamContent(n, x, r.fullStream, { - excludedActionToolNames: e, - tools: t.tools - }), u = await f.stepResult; - if (isEmptyModelResponse(u) && c.length === 0 && s.length === 0) throw new EmptyModelResponseError(); - if (await emitStepActions(n, x, u, { - emittedActionCallIds: i, - excludedActionToolNames: e, - handledInlineToolResultCallIds: a, - tools: t.tools - }), c.length > 0 || s.length > 0) { - let e = u.toolResults, t = new Map(e.map((e) => [e.toolCallId, e])); - for (let e of s) t.set(e.toolCallId, e); - return { - content: u.content, - finishReason: u.finishReason, - response: { - ...u.response, - ...c.length > 0 ? { messages: [{ - role: `tool`, - content: [...c] - }, ...u.response.messages] } : {} - }, - text: u.text, - toolCalls: u.toolCalls, - toolResults: [...t.values()], - usage: u.usage - }; - } - return u; - } - await h.generate({ messages: o }); - let e = await f.stepResult; - if (isEmptyModelResponse(e)) throw new EmptyModelResponseError(); - return e; - }; - return runModelCallWithRetries(() => executeModelCall().catch(rethrowNoOutputAsEmptyResponse), { - sessionId: b.sessionId, - turnId: x.turnId - }); - }, V = prepareModelCallInput(); - n && await emitStepStarted(n, x, k); - let H = await continuePendingWorkflowInterrupt({ - childResults: S.input?.runtimeActionResults, - config: t, - emit: n, - emissionState: x, - runStep, - session: b - }); - if (H !== null) return H; - let U; - try { - U = await runOneModelCall({ - preparedInput: V, - suppressStepStartedEmission: !0 - }); - } catch (r) { - let a = await runModelCallRecoveryPipeline({ - error: r, - stages: [(e) => attemptUnsupportedProviderToolRecovery({ - error: e.error, - runOneModelCall, - sessionId: b.sessionId, - turnId: x.turnId - }), (e) => attemptEmptyResponseRecovery({ - emptyDeliveryEnabled: I, - error: e.error, - retryCallOptions: e.retryCallOptions, - runOneModelCall, - sessionId: b.sessionId, - turnId: x.turnId - })] - }); - if (a.outcome === `recovered`) U = a.result; - else { - let r = a.error; - if (y && recordErrorOnSpan(y, r), !n) throw r; - let o = extractWorkflowStreamWriteErrorDetails(r); - if (o !== null) { - let t = createErrorId(); - return log$2.error(`workflow stream write failed — parking session for retry by the user`, { - ...o, - errorId: t, - error: r, - sessionId: b.sessionId, - turnId: x.turnId - }), x = await emitRecoverableFailedTurn(n, x, { - code: `WORKFLOW_STREAM_WRITE_FAILED`, - details: { - ...o, - errorId: t - }, - message: toErrorMessage(r) - }), { - next: null, - session: setHarnessEmissionState(b, x) - }; - } - let s = classifyModelCallError(r), c = createErrorId(), l = s === `terminal` ? summarizeKnownModelCallConfigError(r) : null, f = l === null ? summarizeKnownModelCallRequestError(r) : null, p = l?.message ?? f?.message ?? toErrorMessage(r), _ = extractModelCallErrorDetails(r), v = buildModelCallFailureDetails({ - configSummary: l, - error: r, - errorId: c, - modelCallDetails: _, - requestSummary: f - }), S = buildModelCallFailureLogFields({ - error: r, - errorId: c, - modelCallDetails: _, - requestSummary: f, - sessionId: b.sessionId, - turnId: x.turnId - }); - return s === `terminal` ? (l === null ? log$2.error(f?.message ?? `model call failed terminally`, S) : log$2.error(`${l.name}: ${l.message}`, { - errorId: c, - sessionId: b.sessionId, - turnId: x.turnId - }), await emitFailedStep(n, x, { - code: `MODEL_CALL_FAILED`, - details: v, - message: p, - sessionId: b.sessionId - }), { - next: { - done: !0, - output: `` - }, - session: b - }) : t.mode === `task` ? (log$2.error(f?.message ?? `model call failed; failing the task run`, S), await emitFailedStep(n, x, { - code: `MODEL_CALL_FAILED`, - details: v, - message: p, - sessionId: b.sessionId - }), { - next: { - done: !0, - isError: !0, - output: p - }, - session: b - }) : (log$2.error(f?.message ?? `model call failed — parking session for retry by the user`, S), x = await emitRecoverableFailedTurn(n, x, { - code: `MODEL_CALL_FAILED`, - details: v, - message: p - }), { - next: null, - session: setHarnessEmissionState(b, x) - }); - } - } - let W = accumulateTurnUsage({ - previous: getTurnUsageState(b.state), - turnId: x.turnId, - usage: U.usage ?? {} - }); - b = setTurnUsageState(b, W); - let G; - try { - G = formatLanguageModelGatewayId(A); - } catch { - G = void 0; - } - return await setEveAttributes({ - "$eve.model": G, - "$eve.input_tokens": W.inputTokens, - "$eve.output_tokens": W.outputTokens, - "$eve.cache_read_tokens": W.cacheReadTokens, - "$eve.cache_write_tokens": W.cacheWriteTokens, - "$eve.tool_count": t.tools.size - }), handleStepResult({ - config: t, - emit: n, - emissionState: x, - promptMessages: k, - result: U, - runStep, - session: b - }); - } - return runStep; -} -function buildModelCallFailureDetails(e) { - let { configSummary: t, error: r, errorId: i, modelCallDetails: a, requestSummary: o } = e; - return t === null ? o === null ? { - ...formatError(r, i), - ...a - } : { - errorId: i, - message: toErrorMessage(r), - name: o.name, - ...a - } : { - errorId: i, - message: t.message, - name: t.name, - ...a - }; -} -function buildModelCallFailureLogFields(e) { - let t = { - errorId: e.errorId, - sessionId: e.sessionId, - turnId: e.turnId - }; - return e.requestSummary === null ? { - ...t, - error: e.error - } : { - ...t, - details: e.modelCallDetails - }; -} -async function runModelCallRecoveryPipeline(e) { - let t = e.error, n; - for (let r of e.stages) { - let e = await r({ - error: t, - retryCallOptions: n - }); - if (e.outcome === `recovered`) return e; - e.outcome === `failed` && (t = e.error, n = e.retryCallOptions); - } - return { - outcome: `failed`, - error: t - }; -} -async function attemptUnsupportedProviderToolRecovery(e) { - let t = extractUnsupportedProviderToolTypes(e.error); - if (t.length === 0) return { outcome: `skipped` }; - let n = []; - for (let e of t) { - let t = resolveFrameworkToolFromUpstreamType(e); - t !== null && !n.includes(t) && n.push(t); - } - if (n.length === 0) return { outcome: `skipped` }; - log$2.warn(`disabling unsupported provider tool(s); retrying step once`, { - disabled: n, - sessionId: e.sessionId, - turnId: e.turnId, - upstreamTypes: t - }); - let r = { - disabledProviderTools: new Set(n), - extraSystemNote: buildDisabledToolNote(n) - }; - try { - return { - outcome: `recovered`, - result: await e.runOneModelCall({ - ...r, - suppressStepStartedEmission: !0 - }) - }; - } catch (e) { - return { - outcome: `failed`, - error: e, - retryCallOptions: r - }; - } -} -function buildDisabledToolNote(e) { - let t = e.join(`, `); - return `The following ${e.length === 1 ? `tool is` : `tools are`} not available with the current model and has been removed: ${t}. Proceed using the remaining tools or your training knowledge.`; -} -function isEmptyModelResponse(e) { - return e.toolCalls.length === 0 && e.toolResults.length === 0 && resolveAssistantStepText(e.response.messages, e.text) === null; -} -function rethrowNoOutputAsEmptyResponse(e) { - throw isNoOutputGeneratedError(e) ? new EmptyModelResponseError({ cause: e }) : e; -} -const EMPTY_RESPONSE_NUDGE = `Your previous reply was empty and was not delivered. Answer now from the tool results above; do not re-run tools or mention this notice.`; -function buildEmptyResponseNudge(e) { - return e ? `${EMPTY_RESPONSE_NUDGE} If the current task explicitly requires conditional delivery and there is nothing to report, reply with exactly ${EMPTY_DELIVERY_SENTINEL}.` : EMPTY_RESPONSE_NUDGE; -} -async function attemptEmptyResponseRecovery(e) { - if (!(e.error instanceof EmptyModelResponseError)) return { outcome: `skipped` }; - log$2.warn(`empty model response; reissuing the model call once`, { - sessionId: e.sessionId, - turnId: e.turnId - }); - try { - return { - outcome: `recovered`, - result: await e.runOneModelCall({ - ...e.retryCallOptions, - retryReason: `empty-response`, - suppressStepStartedEmission: !0, - trailingUserNote: buildEmptyResponseNudge(e.emptyDeliveryEnabled) - }) - }; - } catch (t) { - return { - outcome: `failed`, - error: t, - retryCallOptions: e.retryCallOptions - }; - } -} -async function handleStepResult(e) { - let { config: t, emit: n, promptMessages: r, result: i, runStep: a } = e, { emissionState: o, session: s } = e, c = resolveAssistantStepText(i.response.messages, i.text), l = i.finishReason !== `tool-calls` && i.toolCalls.length === 0 && hasEmptyDeliverySentinel(c), u = l ? [] : i.response.messages, d = l ? null : c, f = /* @__PURE__ */ new Set(); - for (let e of [...i.content ?? [], ...i.toolResults ?? []]) (e.type === `tool-result` || e.type === `tool-error`) && e.providerExecuted === !0 && f.add(e.toolCallId); - let p = normalizeProviderToolHistory({ - messages: u, - providerExecutedOutcomeIds: f - }), m = p.messages, h = { - ...s, - compaction: createNextCompactionConfig(s.compaction, r, i) - }; - if (t.workflow === !0) { - let e = await getWorkflowSandboxInterrupt(i, getWorkflowContinuationSecurity(h)); - if (e !== void 0) { - if (!isWorkflowRuntimeActionInterrupt(e)) throw Error(`Unsupported Workflow interrupt kind "${e.payload.kind}".`); - return parkOnWorkflowInterrupt({ - baseSession: h, - emissionState: o, - interrupt: e, - promptMessages: r, - responseMessages: m - }); - } - } - let g = extractToolApprovalInputRequests({ content: i.content ?? [] }), _ = new Set(g.map((e) => e.action.callId)), y = extractQuestionInputRequests({ - toolCalls: i.toolCalls, - excludedCallIds: _ - }), b = [...g, ...y], S = (i.toolCalls ?? []).filter((e) => !isInvalidToolCall(e)).filter((e) => t.tools.get(e.toolName)?.runtimeAction !== void 0).map((e) => createRuntimeActionRequestFromToolCall({ - toolCall: e, - tools: t.tools - })); - if (S.length > 0) return { - next: null, - session: setHarnessEmissionState(setPendingRuntimeActionBatch({ - actions: S, - event: { - sequence: o.sequence, - stepIndex: o.stepIndex, - turnId: o.turnId - }, - responseMessages: m, - session: { - ...h, - history: [...r] - } - }), o) - }; - if (b.length > 0) { - let e = setPendingInputBatch({ - event: { - sequence: o.sequence, - stepIndex: o.stepIndex, - turnId: o.turnId - }, - requests: b, - responseMessages: m, - session: { - ...h, - history: [...r] - } - }); - return n && (await n(createInputRequestedEvent({ - requests: b, - sequence: o.sequence, - stepIndex: o.stepIndex, - turnId: o.turnId - })), t.mode === `conversation` && (o = await emitTurnEpilogue(n, o, t.mode), e = setHarnessEmissionState(e, o))), { - next: null, - session: e - }; - } - let C = findAuthorizationSignalFromToolResults(i.toolResults); - if (C) { - let { challenges: e } = C; - if (n) for (let t of e) await n(createAuthorizationRequiredEvent({ - authorization: t.challenge, - name: t.name, - description: t.challenge.instructions ?? `Authorization required for ${t.name}`, - webhookUrl: t.hookUrl, - sequence: o.sequence, - stepIndex: o.stepIndex, - turnId: o.turnId - })); - return { - next: null, - session: setHarnessEmissionState({ - ...h, - history: [...r], - state: setPendingAuthorization(h.state, { challenges: e }) - }, o) - }; - } - let w = m, T = [...r, ...w], E = { - ...h, - history: T - }; - return !(E.outputSchema !== void 0 && extractFinalOutput(i) !== void 0) && (w.at(-1)?.role === `tool` || p.outcomeEndsResponse || hasDeferredStepInput(E)) ? (n && (o = advanceStep(o), E = setHarnessEmissionState(E, o)), { - next: a, - session: E - }) : t.mode === `task` ? finishTaskTurn({ - emissionState: o, - emit: n, - history: r, - result: i, - schema: E.outputSchema, - session: E, - stepOutput: d - }) : finishConversationTurn({ - emissionState: o, - emit: n, - history: r, - result: i, - schema: E.outputSchema, - session: E - }); -} -const OUTPUT_SCHEMA_NOT_FULFILLED = { - code: `OUTPUT_SCHEMA_NOT_FULFILLED`, - message: `The agent could not produce a result matching the requested schema.` -}; -function extractFinalOutput(e) { - return (e.toolCalls ?? []).find((e) => e.toolName === FINAL_OUTPUT_TOOL_NAME)?.input; -} -function persistStructuredAssistantTurn(e, t, n) { - return { - ...e, - history: [...t, { - content: JSON.stringify(n), - role: `assistant` - }], - outputSchema: void 0 - }; -} -async function emitStructuredResult(e, t, n, r) { - return await e(createResultCompletedEvent({ - result: n, - sequence: t.sequence, - stepIndex: t.stepIndex, - turnId: t.turnId - })), emitTurnEpilogue(e, t, r); -} -async function finishTaskTurn(e) { - let { emit: t, history: n, result: r, schema: i, stepOutput: a } = e, { emissionState: o, session: s } = e; - if (i === void 0) return t && (o = await emitTurnEpilogue(t, o, `task`), s = setHarnessEmissionState(s, o)), { - next: { - done: !0, - output: a ?? `` - }, - session: s - }; - let c = extractFinalOutput(r); - return c === void 0 ? (t && await emitFailedStep(t, o, { - ...OUTPUT_SCHEMA_NOT_FULFILLED, - sessionId: s.sessionId - }), { - next: { - done: !0, - isError: !0, - output: OUTPUT_SCHEMA_NOT_FULFILLED.message - }, - session: s - }) : (s = persistStructuredAssistantTurn(s, n, c), t && (o = await emitStructuredResult(t, o, c, `task`), s = setHarnessEmissionState(s, o)), { - next: { - done: !0, - output: c - }, - session: s - }); -} -async function finishConversationTurn(e) { - let { emit: t, history: n, result: r, schema: i } = e, { emissionState: a, session: o } = e; - if (i === void 0) return t && (a = await emitTurnEpilogue(t, a, `conversation`), o = setHarnessEmissionState(o, a)), { - next: null, - session: o - }; - let s = extractFinalOutput(r); - return s === void 0 ? (t && (a = await emitRecoverableFailedTurn(t, a, OUTPUT_SCHEMA_NOT_FULFILLED), o = setHarnessEmissionState(o, a)), { - next: null, - session: o - }) : (o = persistStructuredAssistantTurn(o, n, s), t && (a = await emitStructuredResult(t, a, s, `conversation`), o = setHarnessEmissionState(o, a)), { - next: null, - session: o - }); -} -async function continuePendingWorkflowInterrupt(e) { - let t = getPendingWorkflowInterrupt(e.session.state); - if (t === void 0) return null; - let n = t.interrupt; - if (!isWorkflowRuntimeActionInterrupt(n)) throw Error(`Unsupported Workflow interrupt kind "${n.payload.kind}".`); - let i = e.emit === void 0 ? void 0 : createWorkflowLifecycle({ - emit: e.emit, - emissionState: e.emissionState, - skipReplayed: !0, - tools: e.config.tools - }), a = getWorkflowContinuationSecurity(e.session), o; - try { - let t = buildWorkflowHostTools({ tools: e.config.tools }), r = e.childResults ?? [], s = n, c = 0; - for (;;) { - o = await continueWorkflowSandboxInterrupt({ - continuationSecurity: a, - interrupt: s, - lifecycle: i, - resolution: r[c]?.output, - tools: t - }); - let e = await unwrapWorkflowSandboxResult(o, a); - if (e.status !== `interrupted` || !isWorkflowRuntimeActionInterrupt(e.interrupt) || c + 1 >= r.length) break; - let n = getWorkflowRuntimeActionInterrupts(e.interrupt)[0]; - if (n === void 0) throw Error(`Workflow continuation contains no pending runtime-action interrupt.`); - c++, s = n; - } - } catch (e) { - logError(log$2, `Workflow interrupt continuation failed`, e), o = { - error: `workflow_continuation_failed`, - message: toErrorMessage(e), - retryable: !1 - }; - } - let s = await unwrapWorkflowSandboxResult(o, a), c = s.status === `interrupted` ? s.interrupt : s.output, l = replaceWorkflowToolResult([...e.session.history, ...t.responseMessages], n.outerToolCallId, c), u = clearPendingWorkflowInterrupt({ - ...e.session, - history: l - }); - if (s.status === `interrupted`) { - if (!isWorkflowRuntimeActionInterrupt(s.interrupt)) throw Error(`Unsupported Workflow interrupt kind "${s.interrupt.payload.kind}".`); - let t = e.session.history.length, n = l.slice(0, t), r = l.slice(t); - return u = { - ...u, - history: n - }, parkOnWorkflowInterrupt({ - baseSession: u, - emissionState: e.emissionState, - interrupt: s.interrupt, - promptMessages: n, - responseMessages: r - }); - } - return { - next: e.runStep, - session: u - }; -} -function replaceWorkflowToolResult(e, t, n) { - if (t === void 0) return [...e]; - let r = typeof n == `string` ? { - type: `text`, - value: n - } : { - type: `json`, - value: n - }; - return e.map((e) => { - if (e.role !== `tool`) return e; - let n = e.content.map((e) => e.type !== `tool-result` || e.toolCallId !== t ? e : { - ...e, - output: r - }); - return { - ...e, - content: n - }; - }); -} -function parkOnWorkflowInterrupt(e) { - let t = getWorkflowRuntimeActionInterrupts(e.interrupt)[0]; - if (t === void 0) throw Error(`Workflow continuation contains no pending runtime-action interrupt.`); - let n = { - ...e.baseSession, - history: [...e.promptMessages] - }; - return { - next: null, - session: setHarnessEmissionState(setPendingWorkflowInterrupt({ - interrupt: t, - responseMessages: e.responseMessages, - session: n - }), e.emissionState) - }; -} -function createNextCompactionConfig(e, t, n) { - let r = { - recentWindowSize: e.recentWindowSize, - threshold: e.threshold - }; - return n.usage?.inputTokens !== void 0 && (r.lastKnownInputTokens = n.usage.inputTokens, r.lastKnownPromptMessageCount = t.length), r; -} -async function maybeCompact(e) { - let { emit: t, emissionState: n } = e, r = e.messages, i = e.session; - if (!shouldCompact(r, i.compaction)) return { - messages: r, - session: i - }; - let a = await resolveCompactionModel({ - compactionModelReference: i.agent.compactionModelReference, - model: e.model, - modelReference: i.agent.modelReference, - resolveModel: e.resolveModel - }); - if (t && await t(createCompactionRequestedEvent({ - modelId: formatLanguageModelGatewayId(a.model), - sequence: n.sequence, - sessionId: i.sessionId, - turnId: n.turnId, - usageInputTokens: getInputTokenCount(r, i.compaction) - })), r = await compactMessages(r, a.model, i.compaction, a.providerOptions, e.telemetry, e.headers), e.onCompaction) for (let t of e.onCompaction()) r.push(t); - return t && await t(createCompactionCompletedEvent({ - modelId: formatLanguageModelGatewayId(a.model), - sequence: n.sequence, - sessionId: i.sessionId, - turnId: n.turnId - })), { - messages: r, - session: i - }; -} -function resolveApprovalKeyFromTools(e) { - return (t) => { - let n = e.get(t.action.toolName); - if (n?.approvalKey !== void 0) return n.approvalKey(t.action.input); - }; -} -async function runModelCallWithRetries(e, t) { - for (let n = 1;; n++) try { - return await e(); - } catch (e) { - if (n === 3 || classifyModelCallError(e) !== `retry`) throw e; - let r = 500 * 2 ** (n - 1) + Math.floor(Math.random() * 250); - log$2.warn(`model call failed transiently — retrying`, { - attempt: n, - delayMs: r, - sessionId: t.sessionId, - turnId: t.turnId, - error: e - }), await new Promise((e) => setTimeout(e, r)); - } -} -function findAuthorizationSignalFromToolResults(e) { - let t = contextStorage.getStore(); - if (t !== void 0) for (let n of e ?? []) { - let e = readToolInterrupt(t, n.toolCallId); - if (e !== void 0 && isAuthorizationSignal(e)) return e; - } - for (let t of e ?? []) if (isAuthorizationSignal(t.output)) return t.output; -} -//#endregion -//#region node_modules/eve/dist/src/runtime/agent/bootstrap-model-utils.js -const BOOTSTRAP_RESPONSE_TIMESTAMP = /* @__PURE__ */ new Date(`2026-03-16T00:00:00.000Z`); -function createBootstrapGenerateResult(t) { - return { - content: [{ - text: t.text, - type: `text` - }], - finishReason: { - raw: void 0, - unified: `stop` - }, - response: { - id: `bootstrap-response`, - modelId: t.modelId, - timestamp: BOOTSTRAP_RESPONSE_TIMESTAMP - }, - usage: { - inputTokens: { - cacheRead: 0, - cacheWrite: 0, - noCache: t.inputTokens, - total: t.inputTokens - }, - outputTokens: { - reasoning: 0, - text: t.outputTokens, - total: t.outputTokens - } - }, - warnings: [] - }; -} -function createBootstrapStreamResult(e) { - let t = [{ - type: `stream-start`, - warnings: e.warnings - }]; - e.response !== void 0 && t.push({ - ...e.response, - type: `response-metadata` - }); - let n = 0; - for (let r of e.content) switch (r.type) { - case `text`: { - let e = `text_${n}`; - n += 1, t.push({ - id: e, - type: `text-start` - }), r.text.length > 0 && t.push({ - delta: r.text, - id: e, - type: `text-delta` - }), t.push({ - id: e, - type: `text-end` - }); - break; - } - case `tool-call`: - t.push(r); - break; - default: break; - } - return t.push({ - finishReason: e.finishReason, - type: `finish`, - usage: e.usage - }), { stream: new ReadableStream({ start(e) { - for (let n of t) e.enqueue(n); - e.close(); - } }) }; -} -function estimateTokenCount(e) { - return Math.max(1, Math.ceil(e.trim().length / 4)); -} -function getPromptContentText(e) { - return typeof e == `string` ? e : e.flatMap((e) => { - if (typeof e == `string`) return [e]; - switch (e.type) { - case `text`: return [e.text]; - default: return []; - } - }).join(``); -} -function getLastUserPromptText(e) { - for (let t of [...e].reverse()) { - if (t.role !== `user`) continue; - let e = getPromptContentText(t.content).trim(); - if (e.length > 0) return e; - } - return null; -} -function getPromptText(e) { - return e.map((e) => getPromptContentText(e.content)).join(` `); -} -//#endregion -//#region node_modules/eve/dist/src/runtime/agent/bootstrap-model.js -const bootstrapRuntimeModels = /* @__PURE__ */ new Map(); -function resolveBootstrapRuntimeModel(n) { - if (n.id !== BOOTSTRAP_RUNTIME_MODEL_ID) return null; - let i = bootstrapRuntimeModels.get(n.id); - if (i !== void 0) return i; - let a = new MockLanguageModelV3({ - doGenerate: async (e) => createBootstrapModelResult(e.prompt, n.id), - doStream: async (e) => createBootstrapStreamResult(createBootstrapModelResult(e.prompt, n.id)), - modelId: n.id, - provider: `eve-bootstrap` - }); - return bootstrapRuntimeModels.set(n.id, a), a; -} -function createBootstrapModelResult(e, t) { - let r = `Bootstrap reply: ${getLastUserPromptText(e) ?? `Hello from eve`}`; - return createBootstrapGenerateResult({ - inputTokens: estimateTokenCount(getPromptText(e)), - modelId: t, - outputTokens: estimateTokenCount(r), - text: r - }); -} -//#endregion -//#region node_modules/eve/dist/src/runtime/agent/mock-model-fixtures.js -function createMockAuthoredToolInput(e, t, n) { - let r = getToolInputPropertyNames(e.inputSchema); - if (e.name === `ask_question` || hasProperties(r, [`prompt`, `options`])) return createAskQuestionInput(t); - if (r.includes(`command`)) return { command: resolveShellCommand(t) }; - if (r.includes(`topic`) || /\btopic\b/u.test(normalizeText$2(t))) return { topic: resolveLookupTopic(t) }; - let i = extractAnchoredInputs(r, t); - return Object.keys(i).length > 0 ? i : r.length === 1 && r[0] === `message` ? { message: t } : { city: n }; -} -function extractAnchoredInputs(e, t) { - let n = {}; - for (let r of e) { - let e = RegExp(`\\b${escapeRegExp(r)}\\b\\s*(?:to|=|:)?\\s*(?:\`([^\`]+)\`|"([^"]+)"|'([^']+)')`, `iu`).exec(t), i = e?.[1] ?? e?.[2] ?? e?.[3]; - i !== void 0 && (n[r] = i.trim()); - } - return n; -} -function escapeRegExp(e) { - return e.replace(/[$()*+.?[\\\]^{|}]/gu, String.raw`\$&`); -} -function resolveMockFixtureToken(e) { - let n = e.filter((e) => e.role === `system`).map((e) => getPromptContentText(e.content)).join(` -`), r = [ - ...getLoadedSkillResultTexts(e), - n, - getTrailingUserText(e) - ]; - for (let e of r) { - let t = resolveExactFixtureReply(e); - if (t !== null) return t; - } - return null; -} -function resolveWeatherCity(e) { - let t = /"city"\s*:\s*"([^"]+)"/u.exec(e); - return t?.[1] ? t[1].trim() : (/\b(?:in|for)\s+([A-Za-z][A-Za-z\s.-]*?)(?:[?.!,]|$)/u.exec(e) ?? /\b([A-Z][a-z]+(?:\s+[A-Z][a-z]+)*)\b/u.exec(e))?.[1]?.trim() || `Brooklyn`; -} -function formatToolOutput(e) { - if (typeof e == `string`) return e; - try { - return JSON.stringify(e); - } catch { - return String(e); - } -} -function getTrailingUserText(e) { - let n = []; - for (let r of [...e].reverse()) if (r.role !== `system`) { - if (r.role !== `user`) break; - n.unshift(getPromptContentText(r.content)); - } - return n.join(` -`); -} -function getLoadedSkillResultTexts(t) { - return t.flatMap((t) => t.role !== `tool` && t.role !== `assistant` ? [] : (typeof t.content == `string` ? [t.content] : t.content).flatMap((t) => typeof t == `string` || t.type !== `tool-result` || t.toolName !== LOAD_SKILL_TOOL_NAME || t.output.type === `execution-denied` ? [] : [formatToolOutput(t.output.value)])); -} -function resolveExactFixtureReply(e) { - let t = matchExactValue(/\breply\s+with\s+the\s+exact\s+string\s+(`([^`]+)`|"([^"]+)"|'([^']+)'|([^\s.]+))\s+and\s+nothing\s+else\b/iu, e); - if (t !== null) return t; - let n = e.split(/\r?\n/u); - for (let e = 0; e < n.length; e += 1) { - let t = n[e]?.trim() ?? ``, r = /\breply\s+with\s+exactly(?:\s+the\s+following\s+text\s+and\s+nothing\s+else)?:\s*(.+)$/iu.exec(t); - if (r?.[1]) return cleanExactValue(r[1]); - if (/\breply\s+with\s+exactly\s+the\s+following\s+text\s+and\s+nothing\s+else:\s*$/iu.test(t) || /\breply\s+with\s+exactly:\s*$/iu.test(t)) { - let t = n.slice(e + 1).map((e) => e.trim()).find((e) => e.length > 0); - if (t !== void 0) return cleanExactValue(t); - } - } - return matchExactValue(/\binclude\s+the\s+exact\s+token\s+(`([^`]+)`|"([^"]+)"|'([^']+)'|([^\s.]+))\s+verbatim\b/iu, e); -} -function matchExactValue(e, t) { - let n = e.exec(t); - return n === null ? null : cleanExactValue(n[2] ?? n[3] ?? n[4] ?? n[5] ?? n[1] ?? ``); -} -function cleanExactValue(e) { - return e.trim(); -} -function getToolInputPropertyNames(e) { - return !isRecord$2(e) || !isRecord$2(e.properties) ? [] : Object.keys(e.properties); -} -function hasProperties(e, t) { - return t.every((t) => e.includes(t)); -} -function createAskQuestionInput(e) { - let t = parseInputOptions(e), n = { prompt: resolveQuestionPrompt(e) }; - return t.length > 0 && (n.options = t), /\ballow\s*freeform\s+(?:to\s+)?true\b|\ballowfreeform\s+(?:to\s+)?true\b/iu.test(e) && (n.allowFreeform = !0), n; -} -function parseInputOptions(e) { - return [...e.matchAll(/\bid\b\s*:?\s*"([^"]+)"\s*,\s*label\b\s*:?\s*"([^"]+)"/giu)].map((e) => ({ - id: e[1] ?? ``, - label: e[2] ?? `` - })); -} -function resolveQuestionPrompt(e) { - let t = /\b(?:set\s+)?prompt\s+to:\s*'([^']+)'/iu.exec(e) ?? /\b(?:set\s+)?prompt\s+to:\s*"([^"]+)"/iu.exec(e); - return t?.[1] ? t[1].trim() : /\bask(?:\s+me)?\s+(?:to\s+)?(.+?)(?:\.|$)/iu.exec(e)?.[1]?.trim() || `Please choose an option.`; -} -function resolveShellCommand(e) { - let t = /`([^`]+)`/u.exec(e); - return t?.[1] ? t[1].trim() : (/\b(?:run|command)\s+["']([^"']+)["']/iu.exec(e) ?? /\bcommand\s+(.+?)(?:\.|$)/iu.exec(e))?.[1]?.trim() || `pwd`; -} -function resolveLookupTopic(e) { - return /\btopic\s+['"]?([A-Za-z0-9_.-]+)['"]?/u.exec(e)?.[1] ?? `demo`; -} -function normalizeText$2(e) { - return e.toLowerCase().replace(/[^a-z0-9]+/gu, ` `).trim(); -} -function isRecord$2(e) { - return typeof e == `object` && !!e && !Array.isArray(e); -} -//#endregion -//#region node_modules/eve/dist/src/runtime/agent/mock-model-skill-selection.js -function getAvailableSkills(t) { - let n = /* @__PURE__ */ new Map(); - for (let r of t) { - if (r.role !== `system`) continue; - let t = getPromptContentText(r.content).split(` -`), i = t.findIndex((e) => e.trim() === `Available skills`); - if (!(i < 0)) for (let e of t.slice(i + 1)) { - if (e.trim().length === 0) break; - let t = parseAvailableSkill(e); - t !== null && n.set(t.name, t); - } - } - return [...n.values()]; -} -function findRelevantSkill(e, t) { - let n = normalizeText$1(t); - for (let t of e) if (n.includes(normalizeText$1(t.name))) return t; - return /\b(forecast|temperature|weather|wind|rain|snow)\b/u.test(n) ? e.find((e) => /\b(forecast|temperature|weather|wind|rain|snow)\b/u.test(normalizeText$1(`${e.name} ${e.description}`))) ?? null : null; -} -function getActivatedSkillIds(t) { - return [...t.filter((e) => e.role === `system`).flatMap((t) => getPromptContentText(t.content).split(` -`).map((e) => e.trim()).flatMap((e) => { - let t = /^Skill \((.+)\)$/.exec(e); - return t?.[1] === void 0 ? [] : [t[1]]; - })), ...getLoadedSkillIdsFromHistory(t)]; -} -function getLoadedSkillIdsFromHistory(e) { - let t = []; - for (let n of e) if (!(n.role !== `assistant` || typeof n.content == `string`)) for (let e of n.content) { - if (typeof e == `string` || e.type !== `tool-call` || e.toolName !== `load_skill`) continue; - let n = readSkillFromToolInput(e.input); - n !== void 0 && t.push(n); - } - return t; -} -function readSkillFromToolInput(e) { - let t = typeof e == `string` ? safeJsonParse(e) : e; - if (typeof t == `object` && t && `skill` in t && typeof t.skill == `string`) return t.skill; -} -function safeJsonParse(e) { - try { - return JSON.parse(e); - } catch { - return; - } -} -function parseAvailableSkill(e) { - let t = /^- (.+?): (.+?)(?: \(path: (.+)\))?$/.exec(e.trim()); - return t?.[1] && t[2] ? { - description: t[2], - name: t[1] - } : null; -} -function normalizeText$1(e) { - return e.toLowerCase().replace(/[^a-z0-9]+/gu, ` `).trim(); -} -//#endregion -//#region node_modules/eve/dist/src/runtime/agent/mock-structured-output.js -function createJsonSchemaSample(e) { - if (!isRecord$1(e)) return {}; - if (`const` in e) return e.const; - if (Array.isArray(e.enum) && e.enum.length > 0) return e.enum[0]; - let t = getFirstSchema(e.oneOf) ?? getFirstSchema(e.anyOf); - if (t !== void 0) return createJsonSchemaSample(t); - switch (getJsonSchemaType(e)) { - case `array`: return [createJsonSchemaSample(getFirstSchema(e.items) ?? e.items)]; - case `boolean`: return !0; - case `integer`: - case `number`: return 1; - case `null`: return null; - case `object`: return createJsonSchemaObjectSample(e); - case `string`: return createJsonSchemaStringSample(e); - default: return isRecord$1(e.properties) ? createJsonSchemaObjectSample(e) : e.items === void 0 ? {} : [createJsonSchemaSample(getFirstSchema(e.items) ?? e.items)]; - } -} -function createJsonSchemaObjectSample(e) { - let t = isRecord$1(e.properties) ? e.properties : {}, n = Array.isArray(e.required) ? e.required.filter((e) => typeof e == `string`) : [], r = /* @__PURE__ */ new Set([...n, ...Object.keys(t)]), i = {}; - for (let e of r) i[e] = createJsonSchemaSample(t[e]); - return i; -} -function createJsonSchemaStringSample(e) { - switch (e.format) { - case `date`: return `2026-01-01`; - case `date-time`: return `2026-01-01T00:00:00.000Z`; - case `email`: return `eve@example.com`; - case `uri`: return `https://example.com`; - default: return `structured-output`; - } -} -function getJsonSchemaType(e) { - if (typeof e.type == `string`) return e.type; - if (Array.isArray(e.type)) return e.type.find((e) => typeof e == `string` && e !== `null`); -} -function getFirstSchema(e) { - return Array.isArray(e) ? e[0] : e; -} -function isRecord$1(e) { - return typeof e == `object` && !!e && !Array.isArray(e); -} -//#endregion -//#region node_modules/eve/dist/src/runtime/agent/mock-model-adapter.js -const authoredRuntimeModelMocks = /* @__PURE__ */ new Map(); -const bootstrapWeatherPayloadSchema = Ls$3.object({ - city: Ls$3.string(), - condition: Ls$3.string(), - summary: Ls$3.string(), - temperatureF: Ls$3.number().finite() -}).strict(); -function shouldMockAuthoredRuntimeModels() { - return process.env.NODE_ENV === `test` || process.env.EVE_MOCK_AUTHORED_MODELS === `1`; -} -function createMockAuthoredRuntimeModel(e) { - let t = authoredRuntimeModelMocks.get(e.id); - if (t !== void 0) return t; - let r = new MockLanguageModelV3({ - modelId: e.id, - provider: `eve-runtime-mock`, - doGenerate: async (t) => createMockModelResult(t, e.id), - doStream: async (t) => createBootstrapStreamResult(createMockModelResult(t, e.id)) - }); - return authoredRuntimeModelMocks.set(e.id, r), r; -} -function createMockModelResult(e, t) { - let n = getLastAuthoredToolResult(e.prompt); - if (n !== null) { - let r = createFollowUpToolCallResult({ - modelId: t, - options: e, - result: n - }); - if (r !== null) return r; - } else { - let n = createSkillLoadResult(e.prompt, t) ?? createAuthoredToolCallResult(e, t); - if (n !== null) return n; - } - let r = createFinalOutputResult(e, t); - if (r !== null) return r; - let i = n === null ? createAssistantMessage(e.prompt) : formatToolResultReply(n, e.prompt); - return createBootstrapGenerateResult({ - inputTokens: estimateTokenCount(getPromptText(e.prompt)), - modelId: t, - outputTokens: estimateTokenCount(i), - text: i - }); -} -function createFinalOutputResult(e, t) { - let n = getAvailableTools(e).find((e) => e.name === FINAL_OUTPUT_TOOL_NAME); - if (n === void 0) return null; - let i = createJsonSchemaSample(n.inputSchema); - return createToolCallGenerateResult({ - input: i, - inputTokens: estimateTokenCount(getPromptText(e.prompt)), - modelId: t, - outputTokens: estimateTokenCount(JSON.stringify(i)), - toolCallId: createToolCallId(FINAL_OUTPUT_TOOL_NAME), - toolName: FINAL_OUTPUT_TOOL_NAME - }); -} -function resolveMockAuthoredRuntimeModel(e) { - return !shouldMockAuthoredRuntimeModels() || e.id === BOOTSTRAP_RUNTIME_MODEL_ID ? null : createMockAuthoredRuntimeModel(e); -} -function createSkillLoadResult(e, n) { - let r = getLastUserPromptText(e); - if (r === null || getActivatedSkillIds(e).length > 0) return null; - let i = findRelevantSkill(getAvailableSkills(e), r); - return i === null ? null : createToolCallGenerateResult({ - input: { skill: i.name }, - inputTokens: estimateTokenCount(getPromptText(e)), - modelId: n, - outputTokens: estimateTokenCount(i.name), - toolCallId: `call_load_skill`, - toolName: LOAD_SKILL_TOOL_NAME - }); -} -function createAuthoredToolCallResult(e, t) { - let n = getLastUserPromptText(e.prompt); - if (n === null) return null; - let r = findRelevantTool(getAvailableTools(e), n); - if (r === null) return null; - let i = createMockAuthoredToolInput(r, n, resolveWeatherCity(n)); - return createToolCallGenerateResult({ - input: i, - inputTokens: estimateTokenCount(getPromptText(e.prompt)), - modelId: t, - outputTokens: estimateTokenCount(Object.values(i).join(` `)), - toolCallId: createToolCallId(r.name), - toolName: r.name - }); -} -function createFollowUpToolCallResult(e) { - let t = findNextExplicitToolAfterResult({ - previousToolName: e.result.toolName, - prompt: e.options.prompt, - tools: getAvailableTools(e.options) - }); - if (t === null) return null; - let n = createFollowUpToolInput(e.result.output); - return n === null ? null : createToolCallGenerateResult({ - input: n, - inputTokens: estimateTokenCount(getPromptText(e.options.prompt)), - modelId: e.modelId, - outputTokens: estimateTokenCount(Object.values(n).join(` `)), - toolCallId: createToolCallId(t.name), - toolName: t.name - }); -} -function createAssistantMessage(e) { - let t = getLastUserPromptText(e) ?? `Hello from eve`, n = getSystemPromptLabels(e), r = resolveSystemProbe(e), i = resolveMockFixtureToken(e); - return i === null ? n.length > 0 ? r === null ? `Bootstrap reply [${n.join(`, `)}]: ${t}` : `Bootstrap reply [${n.join(`, `)}; probe=${r}]: ${t}` : r === null ? `Bootstrap reply: ${t}` : `Bootstrap reply [probe=${r}]: ${t}` : i; -} -function formatToolResultReply(e, t) { - if (e.isError) return `Local weather tool failed: ${formatToolOutput(e.output)}`; - if (isWeatherPayload(e.output)) return `Used local weather tool for ${e.output.city}: ${e.output.condition}, ${e.output.temperatureF}F. ${e.output.summary}`; - let n = getLastUserPromptText(t) ?? `Hello from eve`; - return `Used ${e.toolName} for "${n}": ${formatToolOutput(e.output)}`; -} -function createToolCallGenerateResult(e) { - return { - content: [{ - input: JSON.stringify(e.input), - toolCallId: e.toolCallId, - toolName: e.toolName, - type: `tool-call` - }], - finishReason: { - raw: void 0, - unified: `tool-calls` - }, - response: { - id: `bootstrap-response`, - modelId: e.modelId, - timestamp: /* @__PURE__ */ new Date(`2026-03-16T00:00:00.000Z`) - }, - usage: { - inputTokens: { - cacheRead: 0, - cacheWrite: 0, - noCache: e.inputTokens, - total: e.inputTokens - }, - outputTokens: { - reasoning: 0, - text: e.outputTokens, - total: e.outputTokens - } - }, - warnings: [] - }; -} -function getAvailableTools(e) { - return (e.tools ?? []).flatMap((e) => e.type === `function` ? [{ - description: e.description, - inputSchema: `inputSchema` in e ? e.inputSchema : void 0, - name: e.name, - outputSchema: `outputSchema` in e ? e.outputSchema : void 0 - }] : []); -} -function getLastAuthoredToolResult(e) { - for (let n of [...e].reverse()) { - if (n.role === `user`) return null; - if (!(n.role !== `tool` && n.role !== `assistant`)) { - for (let e of [...n.content].reverse()) if (!(typeof e == `string` || e.type !== `tool-result`) && e.toolName !== LOAD_SKILL_TOOL_NAME) return { - isError: e.output.type === `error-json` || e.output.type === `error-text` || e.output.type === `execution-denied`, - output: e.output.type === `execution-denied` ? { - reason: e.output.reason ?? null, - type: e.output.type - } : e.output.value, - toolCallId: e.toolCallId, - toolName: e.toolName - }; - } - } - return null; -} -function findNextExplicitToolAfterResult(e) { - let t = getLastUserPromptText(e.prompt); - if (t === null) return null; - let n = normalizeText(t), r = n.indexOf(normalizeText(e.previousToolName)); - return r < 0 ? null : e.tools.filter((t) => t.name !== e.previousToolName).flatMap((e) => { - let t = n.indexOf(normalizeText(e.name), r + 1); - return t < 0 ? [] : [{ - index: t, - tool: e - }]; - }).sort((e, t) => e.index - t.index)[0]?.tool ?? null; -} -function createFollowUpToolInput(e) { - return isRecord(e) && typeof e.stepKey == `string` ? { stepKey: e.stepKey } : null; -} -function getSystemPromptLabels(e) { - let t = e.filter((e) => e.role === `system`); - if (t.length === 0) return []; - let n = t.flatMap((e) => { - let t = getPromptContentText(e.content); - if (t.startsWith(`Available skills -`)) return []; - let n = t.split(` -`).map((e) => e.trim()).filter((e) => e.length > 0), r = []; - for (let e of n) { - if (e === BOOTSTRAP_RUNTIME_SYSTEM_PROMPT || e === `Available skills`) continue; - let t = /^System \((.+)\)$/.exec(e); - if (t?.[1]) { - r.push(t[1]); - continue; - } - let n = /^Skill \((.+)\)$/.exec(e); - n?.[1] && r.push(n[1]); - } - if (r.length > 0) return r; - let i = n.find((e) => e !== BOOTSTRAP_RUNTIME_SYSTEM_PROMPT && e !== `Available skills`); - return i === void 0 ? [] : [i]; - }); - return [...new Set(n)]; -} -function findRelevantTool(e, n) { - let r = normalizeText(n), i = e.find((e) => e.name !== `agent` && e.name !== LOAD_SKILL_TOOL_NAME && r.includes(normalizeText(e.name))); - return i === void 0 ? /\b(forecast|temperature|weather|wind|rain|snow)\b/u.test(r) ? e.find((e) => /\b(forecast|temperature|weather|wind|rain|snow)\b/u.test(normalizeText(`${e.name} ${e.description ?? ``}`))) ?? null : null : i; -} -function normalizeText(e) { - return e.toLowerCase().replace(/[^a-z0-9]+/gu, ` `).trim(); -} -function createToolCallId(e) { - return `call_${e.toLowerCase().replace(/[^a-z0-9]+/gu, `_`).replace(/^_+|_+$/gu, ``) || `tool`}`; -} -function resolveSystemProbe(e) { - let t = e.filter((e) => e.role === `system`).map((e) => getPromptContentText(e.content)).join(` -`); - return /hmr-probe:\s*([^\n]+)/iu.exec(t)?.[1]?.trim() || null; -} -function isWeatherPayload(e) { - return bootstrapWeatherPayloadSchema.safeParse(e).success; -} -function isRecord(e) { - return typeof e == `object` && !!e && !Array.isArray(e); -} -//#endregion -//#region node_modules/eve/dist/src/runtime/agent/resolve-model.js -async function resolveRuntimeModelReference(e, t) { - let i = resolveBootstrapRuntimeModel(e); - if (i !== null) return i; - let a = resolveMockAuthoredRuntimeModel(e); - return a === null ? isSourceBackedRuntimeModelReference(e) ? await loadSourceBackedRuntimeModelReference(e, t) : e.id : a; -} -async function loadSourceBackedRuntimeModelReference(n, r) { - if (r === void 0) throw Error(`Expected a compiled module-map scope to resolve the authored runtime model "${n.id}".`); - let i = normalizeAgentDefinition(await loadResolvedModuleExport({ - definition: n.source, - kindLabel: `runtime model "${n.id}"`, - moduleMap: r.moduleMap, - nodeId: r.nodeId - }), `Expected the authored agent config export "${n.source.exportName ?? `default`}" from "${n.source.logicalPath}" to match the public eve shape.`).model; - if (i === void 0) throw Error(`Expected the authored agent config export "${n.source.exportName ?? `default`}" from "${n.source.logicalPath}" to provide a runtime model.`); - return i; -} -function isSourceBackedRuntimeModelReference(e) { - return e.source !== void 0; -} -//#endregion -//#region node_modules/eve/dist/src/execution/compaction.js -function preserveFrameworkStateOnCompaction() { - clearReadFileState(); - let e = getTodoCompactionMessage(); - return e === void 0 ? [] : [e]; -} -//#endregion -//#region node_modules/eve/dist/src/execution/tool-auth.js -function createToolExecuteWithAuth(e) { - let { scope: t, execute: n } = e; - return async (e) => { - let r = /* @__PURE__ */ new Set(); - try { - return await n(e, buildToolContext({ - inlineAuthState: {}, - justAuthorizedScopes: r, - scope: t - })); - } catch (e) { - if (isToolAuthorizationRequiredError(e)) return await handleAuthorizationRequests(e.requests); - throw e; - } - }; -} -function buildToolContext(t) { - let { scope: n, justAuthorizedScopes: r, inlineAuthState: i } = t; - return { - ...buildCallbackContext(), - async getToken(e, t) { - if (e === void 0) throw missingProviderError(`ctx.getToken`); - return await resolveInlineToken({ - inlineAuthState: i, - justAuthorizedScopes: r, - options: t, - provider: e, - toolScope: n - }); - }, - requireAuth(e, t) { - if (e === void 0) throw missingProviderError(`ctx.requireAuth`); - let a = buildInlineScopedAuthorization({ - inlineAuthState: i, - options: t, - provider: e, - toolScope: n - }); - throw new ToolAuthorizationRequiredError([{ - justAuthorized: r.has(a.scope), - scoped: a - }]); - } - }; -} -async function resolveInlineToken(e) { - let { justAuthorizedScopes: t } = e, n = buildInlineScopedAuthorization(e); - !t.has(n.scope) && await completeScopedAuthorization(n) && t.add(n.scope); - try { - return await resolveScopedToken(n); - } catch (e) { - throw isConnectionAuthorizationRequiredError(e) ? new ToolAuthorizationRequiredError([{ - cause: e, - justAuthorized: t.has(n.scope), - scoped: n - }]) : e; - } -} -async function handleAuthorizationRequests(e) { - let r = [], o; - for (let i of e) { - let { scoped: e } = i; - if (i.justAuthorized) throw new ConnectionAuthorizationFailedError(e.scope, { - message: `Tool "${e.scope}" rejected the token immediately after authorization.`, - reason: `token_rejected_after_authorization`, - retryable: !1 - }); - await evictScopedToken(e); - let s = await startScopedAuthorization(e); - if (s !== void 0) { - r.push(...s.challenges); - continue; - } - if (supportsInteractiveAuthorization(e.authorization)) throw new ConnectionAuthorizationFailedError(e.scope, { - message: `Tool "${e.scope}" requires sign-in, but no authorization callback URL could be minted for this run (missing session context).`, - reason: `authorization_callback_unavailable`, - retryable: !1 - }); - o ??= i.cause instanceof Error ? i.cause : new ConnectionAuthorizationRequiredError(e.scope); - } - if (r.length > 0) return requestAuthorization(r); - throw o ?? Error(`Tool authorization is required.`); -} -function buildInlineScopedAuthorization(e) { - let t = normalizeInlineProvider(e.provider, e.options); - return { - authorization: t, - connection: e.options?.connection ?? { url: `` }, - scope: e.options?.authKey === void 0 ? deriveInlineScope({ - authorization: t, - inlineAuthState: e.inlineAuthState, - provider: e.provider, - toolScope: e.toolScope - }) : validateInlineAuthKey(e.options.authKey) - }; -} -function normalizeInlineProvider(e, t) { - let n = normalizeAuthorizationSpec(e, `ctx.getToken:`, `provider`); - if (t?.displayName === void 0) return n; - if (t.displayName.length === 0) throw Error(`ctx.getToken: The "options.displayName" field must be a non-empty string.`); - return { - ...n, - displayName: t.displayName - }; -} -function deriveInlineScope(e) { - let t = e.authorization.vercelConnect?.connector; - if (t !== void 0) return `${e.toolScope}__${sanitizeScopeSegment(t)}`; - if (e.inlineAuthState.anonymousProvider === void 0) e.inlineAuthState.anonymousProvider = e.provider; - else if (e.inlineAuthState.anonymousProvider !== e.provider) throw Error(`ctx.getToken: Multiple inline auth providers without provider metadata need explicit auth keys. Pass options.authKey for each provider, for example ctx.getToken(auth, { authKey: "github" }).`); - return `${e.toolScope}__inline_auth`; -} -function validateInlineAuthKey(e) { - if (!/^[A-Za-z0-9_.:-]+$/u.test(e)) throw Error(`ctx.getToken: The "options.authKey" field must contain only letters, digits, "_", "-", ".", or ":".`); - return e; -} -function sanitizeScopeSegment(e) { - let t = e.replace(/[^A-Za-z0-9_.:-]+/gu, `_`).replace(/^_+|_+$/gu, ``); - return t.length > 0 ? t : `provider`; -} -var ToolAuthorizationRequiredError = class extends Error { - requests; - constructor(e) { - super(`Tool authorization required.`), this.name = `ToolAuthorizationRequiredError`, this.requests = e; - } -}; -function isToolAuthorizationRequiredError(e) { - return e instanceof Error && e.name === `ToolAuthorizationRequiredError`; -} -function missingProviderError(e) { - return Error(`${e}: Pass an auth provider, for example ${e}(connect("github/myagent")).`); -} -//#endregion -//#region node_modules/eve/dist/src/execution/node-step.js -const log$1 = createLogger(`execution.node-step`); -const BUILT_IN_AGENT_TOOL_DESCRIPTION = [ - `Delegate a focused subtask to a fresh copy of yourself.`, - `Use it to isolate complex work or split a large task into independent pieces.`, - "Issue multiple `agent` calls in one response to run a small fixed set in parallel.", - "Each child has fresh history and state but shares your tools and sandbox, so include essential context in `message` and give parallel writers non-overlapping scopes." -].join(` `); -function createExecutionNodeStep(e) { - let t = createRuntimeModelResolver(e.modelResolutionScope), n = createNodeHarnessTools({ node: e.node }); - return createToolLoopHarness({ - capabilities: e.capabilities, - workflow: e.node.agent.workflowEnabled === !0, - handleEvent: e.handleEvent, - mode: e.mode, - onCompaction: preserveFrameworkStateOnCompaction, - resolveModel: t, - runtimeIdentity: buildRuntimeIdentity(e.node), - tools: n - }); -} -function buildRuntimeIdentity(e) { - let n = resolveInstalledPackageInfo(), r = { - agentId: e.turnAgent.id, - agentName: e.agent.config?.name, - eveVersion: n.version, - modelId: e.turnAgent.model.id - }, i = process.env.VERCEL_GIT_COMMIT_SHA?.trim(), a = process.env.VERCEL_GIT_COMMIT_REF?.trim(), o = process.env.VERCEL_DEPLOYMENT_CREATED_AT?.trim(); - return i || a || o ? { - ...r, - build: { - deployedAt: o || void 0, - gitBranch: a || void 0, - gitSha: i || void 0 - } - } : r; -} -function createRuntimeModelResolver(e) { - return (t) => resolveRuntimeModelReference(t, e); -} -function createNodeHarnessTools(e) { - let t = /* @__PURE__ */ new Map(); - for (let n of e.node.turnAgent.tools) { - let r = resolveHarnessToolDefinition({ - node: e.node, - tool: n - }); - r !== null && t.set(n.name, r); - } - return t.has(`agent`) || t.set(`agent`, { - description: BUILT_IN_AGENT_TOOL_DESCRIPTION, - inputSchema: jsonSchema(SUBAGENT_TOOL_INPUT_SCHEMA), - name: `agent`, - runtimeAction: { - kind: `subagent-call`, - nodeId: e.node.nodeId, - subagentName: `agent` - } - }), t; -} -function resolveHarnessToolDefinition(e) { - if (e.tool.kind === `subagent`) return { - description: e.tool.description ?? ``, - inputSchema: jsonSchema(e.tool.inputSchema ?? {}), - name: e.tool.name, - outputSchema: e.tool.outputSchema === void 0 ? void 0 : jsonSchema(e.tool.outputSchema), - runtimeAction: { - kind: `subagent-call`, - nodeId: e.tool.nodeId, - subagentName: e.tool.name - } - }; - if (e.tool.kind === `remote`) return { - description: e.tool.description ?? ``, - inputSchema: jsonSchema(e.tool.inputSchema ?? {}), - name: e.tool.name, - outputSchema: e.tool.outputSchema === void 0 ? void 0 : jsonSchema(e.tool.outputSchema), - runtimeAction: { - kind: `remote-agent-call`, - nodeId: e.tool.nodeId, - remoteAgentName: e.tool.name, - subagentName: e.tool.name - } - }; - let t = findRegisteredRuntimeTool(e.node.toolRegistry, e.tool.name); - if (t === null) return log$1.warn(`declared tool is not registered — omitting from toolset`, { - toolName: e.tool.name, - nodeId: e.node.nodeId - }), null; - let r = t.definition, i = r.sourceId.startsWith(`eve:`), o = r.execute; - return { - approvalKey: r.approvalKey, - description: r.description, - execute: resolveAuthoredExecute({ - isFrameworkTool: i, - rawExecute: o, - scope: r.name - }), - inputSchema: r.inputStandardSchema ?? jsonSchema(r.inputSchema ?? {}), - name: r.name, - approval: r.approval, - outputSchema: r.outputStandardSchema ?? maybeJsonSchema(r.outputSchema), - toModelOutput: r.toModelOutput - }; -} -function resolveAuthoredExecute(e) { - let { isFrameworkTool: t, rawExecute: n, scope: r } = e; - return n === void 0 ? void 0 : t ? n : createToolExecuteWithAuth({ - execute: n, - scope: r - }); -} -function maybeJsonSchema(e) { - return e === void 0 ? void 0 : jsonSchema(e); -} -//#endregion -//#region node_modules/eve/dist/src/execution/subagent-hitl-proxy.js -async function emitProxiedInputRequest(i) { - await i.emit(createInputRequestedEvent({ - requests: i.hookPayload.event.requests, - sequence: i.hookPayload.event.sequence, - stepIndex: i.hookPayload.event.stepIndex, - turnId: i.hookPayload.event.turnId - })); - let o = i.session; - if (i.mode === `conversation`) { - let e = getHarnessEmissionState(i.session.state), a = await emitTurnEpilogue(i.emit, e, i.mode); - o = setHarnessEmissionState(i.session, a); - } - return { - entries: toProxyInputRequestEntries(i.hookPayload), - session: o - }; -} -function routeDeliverPayload(e) { - let t = getProxyInputRequests(e.state), n = e.payload.inputResponses ?? [], r = /* @__PURE__ */ new Map(), a = []; - for (let e of n) { - let n = t.get(e.requestId); - if (n === void 0) { - a.push(e); - continue; - } - let i = r.get(n); - i === void 0 ? r.set(n, [e]) : i.push(e); - } - let o = [...r.entries()].map(([e, t]) => ({ - childContinuationToken: e, - payload: { inputResponses: t } - })), s = {}; - for (let [t, n] of Object.entries(e.payload)) t === `inputResponses` || n === void 0 || (s[t] = n); - return a.length > 0 && (s.inputResponses = a), { - forChildren: o, - forSelf: Object.keys(s).length > 0 ? s : void 0 - }; -} -//#endregion -//#region node_modules/eve/dist/src/execution/workflow-steps.js -async function turnStep(e) { - let t = e, o = await readDurableSession(t.sessionState), l = await deserializeContext(t.serializedContext), f = l.require(ChannelKey), p = l.require(BundleKey); - try { - let { getWorkflowMetadata: e } = await Promise.resolve().then(() => core_exports), t = e(); - typeof t.url == `string` && l.set(CallbackBaseUrlKey, resolveWorkflowCallbackBaseUrl(t.url)); - } catch {} - let m = getPendingAuthorization(o.state), h; - if (m && t.input?.kind === `deliver`) { - let e = [], n = [], r = []; - for (let i of t.input.payloads) { - let t = i.authorizationCallback; - if (t) { - let r = m.challenges.find((e) => e.name === t.connectionName); - r && (e.push({ - name: r.name, - resume: r.resume, - callback: t.callback, - hookUrl: r.hookUrl - }), n.push({ - name: r.name, - authorization: r.challenge - })); - } else r.push(i); - } - e.length > 0 && (l.set(PendingAuthorizationResultKey, e), o = { - ...o, - state: clearPendingAuthorization(o.state, e.map((e) => e.name)) - }, h = n, t = r.length > 0 ? { - ...t, - input: { - ...t.input, - payloads: r - } - } : { - ...t, - input: void 0 - }); - } - t.input?.kind === `deliver` && t.input.auth !== void 0 && l.set(AuthKey, t.input.auth ?? null); - let g = hydrateDurableSession({ - compactionOverrides: { thresholdPercent: p.resolvedAgent.config.compaction?.thresholdPercent }, - durable: o, - turnAgent: p.turnAgent - }), _ = buildAdapterContext(f, l), v; - if (t.input?.kind === `deliver`) { - let e = []; - for (let n of t.input.payloads) { - let t = f.deliver ? await f.deliver(n, _) : defaultDeliverResult(n); - t != null && e.push(t); - } - v = e.length === 0 ? void 0 : e.reduce(coalesceTurnInputs); - } else t.input?.kind === `runtime-action-result` && (v = { runtimeActionResults: t.input.results }); - if (t.input?.kind === `deliver` && setChannelContext(l, { - ...f, - state: { ..._.state } - }), t.input?.kind === `deliver` && v === void 0) { - let e = reconcileSessionContinuationToken(l, g), n = serializeContext(l), r = e === g ? t.sessionState : createDurableSessionState({ session: e }); - return { - action: `park`, - ...derivePendingState(e), - serializedContext: n, - sessionState: r - }; - } - let y = t.parentWritable.getWriter(), b = p.hookRegistry, x = p.resolvedAgent.dynamicInstructionsResolvers ?? [], S = p.resolvedAgent.dynamicSkillResolvers ?? [], C = p.resolvedAgent.dynamicToolResolvers ?? [], emit = async (e) => { - let t = await callAdapterEventHandler(f, e, _); - return setChannelContext(l, { - ...f, - state: { ..._.state } - }), await y.write(encodeMessageStreamEvent(timestampHandleMessageStreamEvent(t))), t; - }, handleEvent = async (e, t) => { - let n = await emit(e); - await dispatchStreamEventHooks({ - ctx: l, - registry: b, - event: n - }), await dispatchDynamicToolEvent({ - ctx: l, - resolvers: C, - event: n, - messages: t ?? [] - }), await dispatchDynamicSkillEvent({ - ctx: l, - resolvers: S, - event: n, - messages: t ?? [] - }), await dispatchDynamicInstructionEvent({ - ctx: l, - resolvers: x, - event: n, - messages: t ?? [] - }); - }, w = l.require(ModeKey), T = await runStep(l, g, async (e) => { - let t = resolveEffectiveOutputSchema({ - agentOutputSchema: p.turnAgent.outputSchema, - input: v, - mode: w, - session: e - }); - if (h) { - let e = getHarnessEmissionState(t.state); - for (let { name: t, authorization: n } of h) await handleEvent(createAuthorizationCompletedEvent({ - authorization: n, - name: t, - outcome: `authorized`, - sequence: e.sequence, - stepIndex: e.stepIndex, - turnId: e.turnId - })); - } - let n = l.get(CapabilitiesKey); - return (async (e, t) => { - let r = refreshSessionFromTurnAgent({ - compactionOverrides: { thresholdPercent: p.resolvedAgent.config.compaction?.thresholdPercent }, - session: e, - turnAgent: p.turnAgent - }); - return createExecutionNodeStep({ - capabilities: n, - createRuntime: createWorkflowRuntime, - handleEvent, - mode: w, - modelResolutionScope: { - moduleMap: p.moduleMap, - nodeId: p.nodeId - }, - node: p.graph.root - })(r, t); - })(t, v); - }), E = reconcileSessionContinuationToken(l, T.session), D = serializeContext(l); - T = { - ...T, - session: E - }; - let O = createDurableSessionState({ session: T.session }); - if (T.next !== null && typeof T.next == `object` && `done` in T.next) return await y.close(), { - action: `done`, - output: T.next.output, - isError: T.next.isError, - serializedContext: D, - sessionState: O - }; - if (T.next === null) { - y.releaseLock(); - let e = getPendingWorkflowInterrupt(T.session.state); - return e !== void 0 && isWorkflowRuntimeActionInterrupt(e.interrupt) ? { - action: `dispatch-workflow-runtime-actions`, - pendingRuntimeActionKeys: getRuntimeActionKeysFromWorkflowInterrupt(e.interrupt), - serializedContext: D, - sessionState: O - } : { - action: `park`, - ...derivePendingState(T.session), - serializedContext: D, - sessionState: O - }; - } - return y.releaseLock(), { - action: `continue`, - serializedContext: D, - sessionState: O - }; -} -function derivePendingState(e) { - let t = getPendingRuntimeActionBatch(e.state), n = getPendingAuthorization(e.state), r = { - authorizationNames: n?.challenges.map((e) => e.name), - hasPendingAuthorization: n !== void 0, - hasPendingInputBatch: hasPendingInputBatch(e.state) - }; - return t === void 0 ? r : { - ...r, - pendingRuntimeActionKeys: t.actions.map((e) => getRuntimeActionRequestKey(e)) - }; -} -function reconcileSessionContinuationToken(e, t) { - let n = e.get(ContinuationTokenKey); - return n === void 0 || n === t.continuationToken ? t : { - ...t, - continuationToken: n - }; -} -function resolveEffectiveOutputSchema(e) { - let { agentOutputSchema: t, input: n, mode: r, session: i } = e; - return n?.outputSchema === void 0 ? r === `task` && i.outputSchema === void 0 && t !== void 0 ? { - ...i, - outputSchema: t - } : i : { - ...i, - outputSchema: n.outputSchema - }; -} -const log = createLogger(`execution.workflow-entry`); -async function emitTerminalSessionFailureStep(e) { - let r = formatError(e.error), i = typeof r.name == `string` ? r.name : `WORKFLOW_EXECUTION_FAILED`, a = typeof r.message == `string` ? r.message : String(e.error), o = e.serializedContext[`eve.sessionId`] ?? ``; - log.error(`workflow loop threw — emitting terminal session.failed`, { - sessionId: o, - errorId: typeof r.errorId == `string` ? r.errorId : void 0, - code: i, - message: a, - detail: typeof r.detail == `string` ? r.detail : void 0 - }); - let s = createSessionFailedEvent({ - code: i, - details: r, - message: a, - sessionId: o - }); - try { - let t = await deserializeContext(e.serializedContext), r = t.get(ChannelKey); - r !== void 0 && await callAdapterEventHandler(r, s, buildAdapterContext(r, t)); - } catch (e) { - log.error(`adapter failed to handle terminal session.failed event`, { - errorId: typeof r.errorId == `string` ? r.errorId : void 0, - sessionId: o, - error: e - }); - } - try { - let t = e.parentWritable.getWriter(); - try { - await t.write(encodeMessageStreamEvent(timestampHandleMessageStreamEvent(s))); - } finally { - t.releaseLock(); - } - } catch (e) { - log.error(`failed to write terminal session.failed event to durable stream`, { - errorId: typeof r.errorId == `string` ? r.errorId : void 0, - sessionId: o, - error: e - }); - } -} -async function runProxyInputRequestStep(e) { - let t = await readDurableSession(e.sessionState), r = await deserializeContext(e.serializedContext), i = r.require(ChannelKey), a = buildAdapterContext(i, r), o = r.require(ModeKey), c = r.require(BundleKey), l = hydrateDurableSession({ - compactionOverrides: { thresholdPercent: c.resolvedAgent.config.compaction?.thresholdPercent }, - durable: t, - turnAgent: c.turnAgent - }), u = e.parentWritable.getWriter(), d; - try { - let emit = async (e) => { - let t = await callAdapterEventHandler(i, e, a); - await u.write(encodeMessageStreamEvent(timestampHandleMessageStreamEvent(t))); - }; - d = await withContextScope(r, l, async (t) => { - let n = await emitProxiedInputRequest({ - emit, - hookPayload: e.hookPayload, - mode: o, - session: t - }); - return { - result: n.entries, - session: n.session - }; - }); - } finally { - u.releaseLock(); - } - return setChannelContext(r, { - ...i, - state: { ...a.state } - }), { - serializedContext: serializeContext(r), - sessionState: createDurableSessionState({ session: reconcileSessionContinuationToken(r, upsertProxyInputRequests({ - entries: d.result, - forChildContinuationToken: e.hookPayload.childContinuationToken, - session: d.session - })) }) - }; -} -async function routeProxiedDeliverStep(e) { - let t = await readDurableSession(e.sessionState), n = routeDeliverPayload({ - payload: e.payload, - state: t.state - }); - for (let t of n.forChildren) await E$9(t.childContinuationToken, { - auth: e.auth, - kind: `deliver`, - payloads: [t.payload] - }); - return { remainder: n.forSelf }; -} -async function dispatchTurnStep(e) { - return { runId: (await startWorkflowPreferLatest(turnWorkflowReference, [createTurnWorkflowInput(e)], { - allowReservedAttributes: !0, - attributes: normalizeEveAttributes(buildTurnAttributes({ - parentSessionId: e.sessionState.sessionId, - requestId: e.delivery.kind === `deliver` ? e.delivery.requestId : void 0, - rootSessionId: readRootSessionId(e.serializedContext) ?? e.sessionState.sessionId - })) - })).runId }; -} -s$7("step//eve@0.16.2//turnStep", turnStep); -s$7("step//eve@0.16.2//emitTerminalSessionFailureStep", emitTerminalSessionFailureStep); -s$7("step//eve@0.16.2//runProxyInputRequestStep", runProxyInputRequestStep); -s$7("step//eve@0.16.2//routeProxiedDeliverStep", routeProxiedDeliverStep); -s$7("step//eve@0.16.2//dispatchTurnStep", dispatchTurnStep); -//#endregion -//#region node_modules/eve/.eve/workflow-cache/97d43a998b3c/steps.mjs -const __steps_registered = true; -//#endregion -//#region node_modules/eve/.eve/workflow-cache/97d43a998b3c/workflows.mjs -const workflowCode = Buffer.from([ - "Z2xvYmFsVGhpcy5fX3ByaXZhdGVfd29ya2Zsb3dzID0gbmV3IE1hcCgpOwpuZXcgVGV4dEVuY29kZXIoKTsKLy8jZW5kcmVnaW9uCi8vI3JlZ2lvbiBkaXN0L3NyYy9ydW50aW1lL2FjdGlvbnMva2V5cy5qcwpmdW5jdGlvbiBnZXRSdW50aW1lQWN0aW9uUmVzdWx0S2V5KGUpIHsKCXN3aXRjaCAoZS5raW5kKSB7CgkJY2FzZSBgbG9hZC1za2lsbC1yZXN1bHRgOiByZXR1cm4gYHJ1bnRpbWUtYWN0aW9uOmxvYWQtc2tpbGw6JHtlLmNhbGxJZH1gOwoJCWNhc2UgYHN1YmFnZW50LXJlc3VsdGA6IHJldHVybiBgc3ViYWdlbnQtY2FsbDoke2Uuc3ViYWdlbnROYW1lfToke2UuY2FsbElkfWA7CgkJY2FzZSBgdG9vbC1yZXN1bHRgOiByZXR1cm4gYHRvb2wtY2FsbDoke2UudG9vbE5hbWV9OiR7ZS5jYWxsSWR9YDsKCX0KfQovLyNlbmRyZWdpb24KLy8jcmVnaW9uIGRpc3Qvc3JjL2hhcm5lc3MvcnVudGltZS1hY3Rpb25zLmpzCmZ1bmN0aW9uIHJlc29sdmVSdW50aW1lQWN0aW9uUmVzdWx0c0ZvcktleXMoZSkgewoJbGV0IHQgPSBuZXcgU2V0KGUucGVuZGluZ0tleXMpLCBuID0gbmV3IE1hcCgpOwoJZm9yIChsZXQgciBvZiBlLnJlc3VsdHMpIHsKCQlsZXQgZSA9IGdldFJ1bnRpbWVBY3Rpb25SZXN1bHRLZXkocik7CgkJdC5oYXMoZSkgJiYgbi5zZXQoZSwgcik7Cgl9CglsZXQgciA9IFtdOwoJZm9yIChsZXQgdCBvZiBlLnBlbmRpbmdLZXlzKSB7CgkJbGV0IGUgPSBuLmdldCh0KTsKCQlpZiAoZSA9PT0gdm9pZCAwKSByZXR1cm47CgkJci5wdXNoKGUpOwoJfQoJcmV0dXJuIHI7Cn0KLy8jZW5kcmVnaW9uCi8vI3JlZ2lvbiBkaXN0L3NyYy9leGVjdXRpb24vZGlzcGF0Y2gtcnVudGltZS1hY3Rpb25zLXN0ZXAuanMKdmFyIGRpc3BhdGNoUnVudGltZUFjdGlvbnNTdGVwID0gZ2xvYmFsVGhpc1tTeW1ib2wuZm9yKCJXT1JLRkxPV19VU0VfU1RFUCIpXSgic3RlcC8vZXZlQDAuMTYuMi8vZGlzcGF0Y2hSdW50aW1lQWN0aW9uc1N0ZXAiKTsKLy8jZW5kcmVnaW9uCi8vI3JlZ2lvbiBkaXN0L3NyYy9leGVjdXRpb24vd29ya2Zsb3ctY2FsbGJhY2stdXJsLmpzCmZ1bmN0aW9uIHJlc29sdmVWZXJjZWxQcm9kdWN0aW9uQ2FsbGJhY2tCYXNlVXJsKCkgewoJcmV0dXJuIHByb2Nlc3MuZW52LlZFUkNFTF9FTlYgPT09IGBwcm9kdWN0aW9uYCAmJiBwcm9jZXNzLmVudi5WRVJDRUxfUFJPSkVDVF9QUk9EVUNUSU9OX1VSTCA/IGBodHRwczovLyR7cHJvY2Vzcy5lbnYuVkVSQ0VMX1BST0pFQ1RfUFJPRFVDVElPTl9VUkx9YCA6IG51bGw7Cn0KZnVuY3Rpb24gcmVzb2x2ZVdvcmtmbG93Q2FsbGJhY2tCYXNlVXJsKGUpIHsKCWxldCB0ID0gcHJvY2Vzcy5lbnYuV09SS0ZMT1dfTE9DQUxfQkFTRV9VUkw/LnRyaW0oKSB8fCB2b2lkIDA7CglyZXR1cm4gKHJlc29sdmVWZXJjZWxQcm9kdWN0aW9uQ2FsbGJhY2tCYXNlVXJsKCkgPz8gdCA/PyBlKS5yZXBsYWNlKC9cLyQvLCBgYCk7Cn0KLy8jZW5kcmVnaW9uCi8vI3JlZ2lvbiBkaXN0L3NyYy9leGVjdXRpb24vd29ya2Zsb3ctc3RlcHMuanMKdmFyIHR1cm5TdGVwID0gZ2xvYmFsVGhpc1tTeW1ib2wuZm9yKCJXT1JLRkxPV19VU0VfU1RFUCIpXSgic3RlcC8vZXZlQDAuMTYuMi8vdHVyblN0ZXAiKTsKdmFyIGVtaXRUZXJtaW5hbFNlc3Npb25GYWlsdXJlU3RlcCA9IGdsb2JhbFRoaXNbU3ltYm9sLmZvcigiV09SS0ZMT1dfVVNFX1NURVAiKV0oInN0ZXAvL2V2ZUAwLjE2LjIvL2VtaXRUZXJtaW5hbFNlc3Npb25GYWlsdXJlU3RlcCIpOwp2YXIgcnVuUHJveHlJbnB1dFJlcXVlc3RTdGVwID0gZ2xvYmFsVGhpc1tTeW1ib2wuZm9yKCJXT1JLRkxPV19VU0VfU1RFUCIpXSgic3RlcC8vZXZlQDAuMTYuMi8vcnVuUHJveHlJbnB1dFJlcXVlc3RTdGVwIik7CnZhciByb3V0ZVByb3hpZWREZWxpdmVyU3RlcCA9IGdsb2JhbFRoaXNbU3ltYm9sLmZvcigiV09SS0ZMT1dfVVNFX1NURVAiKV0oInN0ZXAvL2V2ZUAwLjE2LjIvL3JvdXRlUHJveGllZERlbGl2ZXJTdGVwIik7CnZhciBkaXNwYXRjaFR1cm5TdGVwID0gZ2xvYmFsVGhpc1tTeW1ib2wuZm9yKCJXT1JLRkxPV19VU0VfU1RFUCIpXSgic3RlcC8vZXZlQDAuMTYuMi8vZGlzcGF0Y2hUdXJuU3RlcCIpOwovLyNlbmRyZWdpb24KLy8jcmVnaW9uIGRpc3Qvc3JjL2ludGVybmFsL3dvcmtmbG93LWJ1bmRsZS93b3JrZmxvdy1jb3JlLXNoaW0uanMKY29uc3QgV09SS0ZMT1dfQ09OVEVYVF9TWU1CT0wgPSBTeW1ib2wuZm9yKGBXT1JLRkxPV19DT05URVhUYCk7CmNvbnN0IFdPUktGTE9XX0NSRUFURV9IT09LID0gU3ltYm9sLmZvcihgV09SS0ZMT1dfQ1JFQVRFX0hPT0tgKTsKY29uc3QgV09SS0ZMT1dfR0VUX1NUUkVBTV9JRCA9IFN5bWJvbC5mb3IoYFdPUktGTE9XX0dFVF9TVFJFQU1fSURgKTsKY29uc3QgU1RSRUFNX05BTUVfU1lNQk9MID0gU3ltYm9sLmZvcihgV09SS0ZMT1dfU1RSRUFNX05BTUVgKTsKY29uc3Qgd29ya2Zsb3dHbG9iYWwgPSBnbG9iYWxUaGlzOwpmdW5jdGlvbiBjcmVhdGVIb29rKGUpIHsKCWxldCBuID0gd29ya2Zsb3dHbG9iYWxbV09SS0ZMT1dfQ1JFQVRFX0hPT0tdOwoJaWYgKG4gPT09IHZvaWQgMCkgdGhyb3cgRXJyb3IoImBjcmVhdGVIb29rKClgIGNhbiBvbmx5IGJlIGNhbGxlZCBpbnNpZGUgYSB3b3JrZmxvdyBmdW5jdGlvbiIpOwoJcmV0dXJuIG4oZSk7Cn0KZnVuY3Rpb24gZ2V0V29ya2Zsb3dNZXRhZGF0YSgpIHsKCWxldCB0ID0gd29ya2Zsb3dHbG9iYWxbV09SS0ZMT1dfQ09OVEVYVF9TWU1CT0xdOwoJaWYgKHQgPT09IHZvaWQgMCkgdGhyb3cgRXJyb3IoImBnZXRXb3JrZmxvd01ldGFkYXRhKClgIGNhbiBvbmx5IGJlIGNhbGxlZCBpbnNpZGUgYSB3b3JrZmxvdyBvciBzdGVwIGZ1bmN0aW9uIik7CglyZXR1cm4gdDsKfQpmdW5jdGlvbiBnZXRXcml0YWJsZShlID0ge30pIHsKCWxldCB0ID0gd29ya2Zsb3dHbG9iYWxbV09SS0ZMT1dfR0VUX1NUUkVBTV9JRF07CglpZiAodCA9PT0gdm9pZCAwKSB0aHJvdyBFcnJvcigiYGdldFdyaXRhYmxlKClgIGNhbiBvbmx5IGJlIGNhbGxlZCBpbnNpZGUgYSB3b3JrZmxvdyBmdW5jdGlvbiIpOwoJbGV0IHIgPSB0KGUubmFtZXNwYWNlKTsKCXJldHVybiBPYmplY3QuY3JlYXRlKGdsb2JhbFRoaXMuV3JpdGFibGVTdHJlYW0ucHJvdG90eXBlLCB7IFtTVFJFQU1fTkFNRV9TWU1CT0xdOiB7CgkJdmFsdWU6IHIsCgkJd3JpdGFibGU6ICExCgl9IH0pOwp9Ci8vI2VuZHJlZ2lvbgovLyNyZWdpb24gZGlzdC9zcmMvZXhlY3V0aW9uL2hvb2stb3duZXJzaGlwLmpzCmFzeW5jIGZ1bmN0aW9uIGNsYWltSG9va093bmVyc2hpcChlKSB7CglsZXQgdDsKCXRyeSB7CgkJdCA9IGF3YWl0IGUuZ2V0Q29uZmxpY3QoKTsKCX0gY2F0Y2ggKHQpIHsKCQlyZXR1cm4gYXdhaXQgZGlzcG9zZUFuZFRocm93KGUsIG5vcm1hbGl6ZUhvb2tDbGFpbUVycm9yKHQsIGUudG9rZW4pKTsKCX0KCWlmICh0ICE9PSBudWxsKSByZXR1cm4gYXdhaXQgZGlzcG9zZUFuZFRocm93KGUsIGNyZWF0ZUhvb2tDb25mbGljdEVycm9yKGUudG9rZW4sIHQucnVuSWQpKTsKfQphc3luYyBmdW5jdGlvbiBjbG9zZUhvb2tJdGVyYXRvcihlKSB7Cgl0eXBlb2YgZS5yZXR1cm4gPT0gYGZ1bmN0aW9uYCAmJiBhd2FpdCBlLnJldHVybih2b2lkIDApOwp9CmFzeW5jIGZ1bmN0aW9uIGRpc3Bvc2VIb29rKGUpIHsKCWxldCB0ID0gZS5kaXNwb3NlOwoJaWYgKHR5cGVvZiB0ID09IGBmdW5jdGlvbmApIHsKCQlhd2FpdCB0LmNhbGwoZSk7CgkJcmV0dXJuOwoJfQoJbGV0IG4gPSBlW1N5bWJvbC5kaXNwb3NlXTsKCXR5cGVvZiBuID09IGBmdW5jdGlvbmAgJiYgYXdhaXQgbi5jYWxsKGUpOwp9CmFzeW5jIGZ1bmN0aW9uIGRpc3Bvc2VBbmRUaHJvdyhlLCB0KSB7Cgl0cnkgewoJCWF3YWl0IGRpc3Bvc2VIb29rKGUpOwoJfSBjYXRjaCB7fQoJdGhyb3cgdDsKfQpmdW5jdGlvbiBub3JtYWxpemVIb29rQ2xhaW1FcnJvcihlLCB0KSB7CglyZXR1cm4gaXNIb29rQ29uZmxpY3RFcnJvcihlKSA/IGNyZWF0ZUhvb2tDb25mbGljdEVycm9yKHR5cGVvZiBlLnRva2VuID09IGBzdHJpbmdgID8gZS50b2tlbiA6IHQsIHR5cGVvZiBlLmNvbmZsaWN0aW5nUnVuSWQgPT0gYHN0cmluZ2AgPyBlLmNvbmZsaWN0aW5nUnVuSWQgOiB2b2lkIDApIDogZTsKfQpmdW5jdGlvbiBpc0hvb2tDb25mbGljdEVycm9yKGUpIHsKCXJldHVybiB0eXBlb2YgZSA9PSBgb2JqZWN0YCAmJiAhIWUgJiYgYG5hbWVgIGluIGUgJiYgZS5uYW1lID09PSBgSG9va0NvbmZsaWN0RXJyb3JgOwp9CmZ1bmN0aW9uIGNyZWF0ZUhvb2tDb25mbGljdEVycm9yKGUsIHQpIHsKCWxldCBuID0gdCA9PT0gdm9pZCAwID8gYGAgOiBgIChydW4gIiR7dH0iKWA7CglyZXR1cm4gT2JqZWN0LmFzc2lnbihFcnJvcihgSG9vayB0b2tlbiAiJHtlfSIgaXMgYWxyZWFkeSBpbiB1c2Uke259YCksIHsKCQljb25mbGljdGluZ1J1bklkOiB0LAoJCW5hbWU6IGBIb29rQ29uZmxpY3RFcnJvcmAsCgkJdG9rZW46IGUKCX0pOwp9Ci8vI2VuZHJlZ2lvbgovLyNyZWdpb24gZGlzdC9zcmMvZXhlY3V0aW9uL3dvcmtmbG93LWVycm9ycy5qcwpmdW5jdGlvbiBub3JtYWxpemVTZXJpYWxpemFibGVFcnJvcihlKSB7CglyZXR1cm4gZSBpbnN0YW5jZW9mIEVycm9yID8gewoJCS4uLk9iamVjdC5mcm9tRW50cmllcyhPYmplY3QuZW50cmllcyhlKSksCgkJY2F1c2U6IGUuY2F1c2UgPT09IHZvaWQgMCA/IHZvaWQgMCA6IG5vcm1hbGl6ZVNlcmlhbGl6YWJsZUVycm9yKGUuY2F1c2UpLAoJCW1lc3NhZ2U6IGUubWVzc2FnZSwKCQluYW1lOiBlLm5hbWUsCgkJc3RhY2s6IGUuc3RhY2sKCX0gOiBlOwp9CmZ1bmN0aW9uIHJlYnVpbGRTZXJpYWxpemFibGVFcnJvcihlKSB7CglpZiAoIWlzUmVjb3JkKGUpKSByZXR1cm4gRXJyb3IoU3RyaW5nKGUpKTsKCWxldCB0ID0gdHlwZW9mIGUubWVzc2FnZSA9PSBgc3RyaW5nYCA/IGUubWVzc2FnZSA6IFN0cmluZyhlKSwgbiA9IEVycm9yKHQpOwoJdHlwZW9mIGUubmFtZSA9PSBgc3RyaW5nYCAmJiAobi5uYW1lID0gZS5uYW1lKSwgdHlwZW9mIGUuc3RhY2sgPT0gYHN0cmluZ2AgJiYgKG4uc3RhY2sgPSBlLnN0YWNrKSwgYGNhdXNlYCBpbiBlICYmIChuLmNhdXNlID0gaXNSZWNvcmQoZS5jYXVzZSkgPyByZWJ1aWxkU2VyaWFsaXphYmxlRXJyb3IoZS5jYXVzZSkgOiBlLmNhdXNlKTsKCWxldCByID0gbjsKCWZvciAobGV0IFt0LCBuXSBvZiBPYmplY3QuZW50cmllcyhlKSkgdCA9PT0gYG1lc3NhZ2VgIHx8IHQgPT09IGBuYW1lYCB8fCB0ID09PSBgc3RhY2tgIHx8IHQgPT09IGBjYXVzZWAgfHwgKHJbdF0gPSBuKTsKCXJldHVybiBuOwp9CmZ1bmN0aW9uIGlzUmVjb3JkKGUpIHsKCXJldHVybiB0eXBlb2YgZSA9PSBgb2JqZWN0YCAmJiAhIWU7Cn0KLy8jZW5kcmVnaW9uCi8vI3JlZ2lvbiBkaXN0L3NyYy9leGVjdXRpb24vdHVybi1jb250cm9sLXByb3RvY29sLmpzCnZhciBzZW5kVHVybkNvbnRyb2xTdGVwID0gZ2xvYmFsVGhpc1tTeW1ib2wuZm9yKCJXT1JLRkxPV19VU0VfU1RFUCIpXSgic3RlcC8vZXZlQDAuMTYuMi8vc2VuZFR1cm5Db250cm9sU3RlcCIpOwovLyNlbmRyZWdpb24KLy8jcmVnaW9uIGRpc3Qvc3JjL2V4ZWN1dGlvbi9kaXNwYXRjaC13b3JrZmxvdy1ydW50aW1lLWFjdGlvbnMtc3RlcC5qcwp2YXIgZGlzcGF0Y2hXb3JrZmxvd1J1bnRpbWVBY3Rpb25zU3RlcCA9IGdsb2JhbFRoaXNbU3ltYm9sLmZvcigiV09SS0ZMT1dfVVNFX1NURVAiKV0oInN0ZXAvL2V2ZUAwLjE2LjIvL2Rpc3BhdGNoV29ya2Zsb3dSdW50aW1lQWN0aW9uc1N0ZXAiKTsKLy8jZW5kcmVnaW9uCi8vI3JlZ2lvbiBkaXN0L3NyYy9leGVjdXRpb24vZHVyYWJsZS1zZXNzaW9uLW1pZ3JhdGlvbnMvY2hhaW4uanMKZnVuY3Rpb24gcnVuTWlncmF0aW9uQ2hhaW4oZSkgewoJaWYgKHR5cGVvZiBlLnZhbHVlICE9IGBvYmplY3RgIHx8IGUudmFsdWUgPT09IG51bGwpIHRocm93IEVycm9yKGAke2UubGFiZWx9OiB2YWx1ZSBoYXMgbm8gbnVtZXJpYyAidmVyc2lvbiIgZmllbGQuYCk7CglsZXQgdCA9IGUudmFsdWUudmVyc2lvbiwgbjsKCWlmICh0eXBlb2YgdCA9PSBgbnVtYmVyYCkgbiA9IGUudmFsdWU7CgllbHNlIGlmICghKGB2ZXJzaW9uYCBpbiBlLnZhbHVlKSAmJiBlLmluaXRpYWxWZXJzaW9uICE9PSB2b2lkIDApIG4gPSB7CgkJLi4uZS52YWx1ZSwKCQl2ZXJzaW9uOiBlLmluaXRpYWxWZXJzaW9uCgl9OwoJZWxzZSB0aHJvdyBFcnJvcihgJHtlLmxhYmVsfTogdmFsdWUgaGFzIG5vIG51bWVyaWMgInZlcnNpb24iIGZpZWxkLmApOwoJbGV0IHIgPSBlLmluaXRpYWxWZXJzaW9uID8/IDE7CglpZiAoIU51bWJlci5pc0ludGVnZXIobi52ZXJzaW9uKSB8fCBuLnZlcnNpb24gPCByKSB0aHJvdyBFcnJvcihgJHtlLmxhYmVsfTogdmVyc2lvbiAke24udmVyc2lvbn0gaXMgbm90IGEgcG9zaXRpdmUgaW50ZWdlci5gKTsKCWlmIChuLnZlcnNpb24gPiBlLnRhcmdldFZlcnNpb24pIHRocm93IEVycm9yKGAke2UubGFiZWx9OiBlbmNvdW50ZXJlZCB2ZXJzaW9uICR7bi52ZXJzaW9ufSwgd2hpY2ggaXMgbmV3ZXIgdGhhbiB0aGUgc3VwcG9ydGVkIHZlcnNpb24gJHtlLnRhcmdldFZlcnNpb259LiBUaGlzIHVzdWFsbHkgaW5kaWNhdGVzIHRoZSB3aXJlIHdhcyB3cml0dGVuIGJ5IGEgbmV3ZXIgZXZlIGRlcGxveW1lbnQgdGhhbiB0aGUgb25lIHJlYWRpbmcgaXQuYCk7Cglmb3IgKDsgbi52ZXJzaW9uIDwgZS50YXJnZXRWZXJzaW9uOykgewoJCWxldCB0ID0gZS5taWdyYXRpb25zLmZpbmQoKGUpID0+IGUuZnJvbSA9PT0gbi52ZXJzaW9uKTsKCQlpZiAoIXQpIHRocm93IEVycm9yKGAke2UubGFiZWx9OiBubyBtaWdyYXRpb24gcmVnaXN0ZXJlZCBmb3IgdmVyc2lvbiAke24udmVyc2lvbn0g4oaSICR7bi52ZXJzaW9uICsgMX0uYCk7CgkJaWYgKHQudG8gIT09IHQuZnJvbSArIDEpIHRocm93IEVycm9yKGAke2UubGFiZWx9OiBtaWdyYXRpb24gJHt0LmZyb219IOKGkiAke3QudG99IG11c3Qgc3RlcCBleGFjdGx5IG9uZSB2ZXJzaW9uIGF0IGEgdGltZS5gKTsKCQlsZXQgciA9IHQubWlncmF0ZShuKTsKCQlpZiAoci52ZXJzaW9uICE9PSB0LnRvKSB0aHJvdyBFcnJvcihgJHtlLmxhYmVsfTogbWlncmF0aW9uICR7dC5mcm9tfSDihpIgJHt0LnRvfSBwcm9kdWNlZCBhIHZhbHVlIHdpdGggdmVyc2lvbiAke3IudmVyc2lvbn0uYCk7CgkJbiA9IHI7Cgl9CglyZXR1cm4gbjsKfQovLyNlbmRyZWdpb24KLy8jcmVnaW9uIGRpc3Qvc3JjL2V4ZWN1dGlvbi9kdXJhYmxlLXNlc3Npb24tbWlncmF0aW9ucy90dXJuLXdvcmtmbG93LXYwLXRvLXYxLmpzCmNvbnN0IHR1cm5Xb3JrZmxvd0lucHV0VjBUb1YxID0gewoJZnJvbTogMCwKCW1pZ3JhdGUoZSkgewoJCWlmICghaXNQcmVWZXJzaW9uVHVybldvcmtmbG93SW5wdXQoZSkpIHRocm93IEVycm9yKGB0dXJuIHdvcmtmbG93IGlucHV0OiB2ZXJzaW9uIDAgdmFsdWUgaXMgbm90IGEgcmVjb2duaXplZCBwcmUtdmVyc2lvbiBzaGFwZS5gKTsKCQlyZXR1cm4gewoJCQljYXBhYmlsaXRpZXM6IGUuY2FwYWJpbGl0aWVzLAoJCQljb21wbGV0aW9uVG9rZW46IGUuY29tcGxldGlvblRva2VuLAoJCQltb2RlOiBlLm1vZGUsCgkJCXN0ZXBJbnB1dDogewoJCQkJaW5wdXQ6IGUuZGVsaXZlcnksCgkJCQlwYXJlbnRXcml0YWJsZTogZS5wYXJlbnRXcml0YWJsZSwKCQkJCXNlcmlhbGl6ZWRDb250ZXh0OiBlLnNlcmlhbGl6ZWRDb250ZXh0LAoJCQkJc2Vzc2lvblN0YXRlOiBlLnNlc3Npb25TdGF0ZQoJCQl9LAoJCQl2ZXJzaW9uOiAxCgkJfTsKCX0sCgl0bzogMQp9OwpmdW5jdGlvbiBpc1ByZVZlcnNpb25UdXJuV29ya2Zsb3dJbnB1dChlKSB7CglyZXR1cm4gdHlwZW9mIGUgPT0gYG9iamVjdGAgJiYgISFlICYmIGBkZWxpdmVyeWAgaW4gZTsKfQovLyNlbmRyZWdpb24KLy8jcmVnaW9uIGRpc3Qvc3JjL2V4ZWN1dGlvbi9kdXJhYmxlLXNlc3Npb24tbWlncmF0aW9ucy90dXJuLXdvcmtmbG93LmpzCmNvbnN0IHR1cm5Xb3JrZmxvd0lucHV0TWlncmF0aW9ucyA9IFt0dXJuV29ya2Zsb3dJbnB1dFYwVG9WMV07CmZ1bmN0aW9uIG1pZ3JhdGVUdXJuV29ya2Zsb3dJbnB1dCh0KSB7CglyZXR1cm4gcnVuTWlncmF0aW9uQ2hhaW4oewoJCWluaXRpYWxWZXJzaW9uOiAwLAoJCWxhYmVsOiBgdHVybiB3b3JrZmxvdyBpbnB1dGAsCgkJbWlncmF0aW9uczogdHVybldvcmtmbG93SW5wdXRNaWdyYXRpb25zLAoJCXRhcmdldFZlcnNpb246IDEsCgkJdmFsdWU6IHQKCX0pOwp9Ci8vI2VuZHJlZ2lvbgovLyNyZWdpb24gZGlzdC9zcmMvZXhlY3V0aW9uL2RlbGl2ZXItcGF5bG9hZHMuanMKZnVuY3Rpb24gY29hbGVzY2VEZWxpdmVyUGF5bG9hZHMoZSkgewoJaWYgKGUubGVuZ3RoID09PSAwKSByZXR1cm4ge307CglpZiAoZS5sZW5ndGggPT09IDEpIHJldHVybiBlWzBdID8/IHt9OwoJbGV0IHQgPSB7fSwgbiA9IFtdOwoJZm9yIChsZXQgciBvZiBlKSB7CgkJZm9yIChsZXQgW2UsIG5dIG9mIE9iamVjdC5lbnRyaWVzKHIpKSBlICE9PSBgaW5wdXRSZXNwb25zZXNgICYmIG4gIT09IHZvaWQgMCAmJiAodFtlXSA9IG4pOwoJCXIuaW5wdXRSZXNwb25zZXMgIT09IHZvaWQgMCAmJiBuLnB1c2goLi4uci5pbnB1dFJlc3BvbnNlcyk7Cgl9CglyZXR1cm4gbi5sZW5ndGggPiAwICYmICh0LmlucHV0UmVzcG9uc2VzID0gbiksIHQ7Cn0KLy8jZW5kcmVnaW9uCi8vI3JlZ2lvbiBkaXN0L3NyYy9leGVjdXRpb24vcm91dGUtY2hpbGQtZGVsaXZlcnkuanMKYXN5bmMgZnVuY3Rpb24gcm91dGVEZWxpdmVyVG9DaGlsZHJlbihlKSB7CglsZXQgdCA9IGNvYWxlc2NlRGVsaXZlclBheWxvYWRzKGUucGF5bG9hZHMpOwoJcmV0dXJuIGUuc2Vzc2lvblN0YXRlLmhhc1Byb3h5SW5wdXRSZXF1ZXN0cyA/IChhd2FpdCByb3V0ZVByb3hpZWREZWxpdmVyU3RlcCh7CgkJYXV0aDogZS5hdXRoLAoJCXBhcmVudFdyaXRhYmxlOiBlLnBhcmVudFdyaXRhYmxlLAoJCXBheWxvYWQ6IHQsCgkJc2Vzc2lvblN0YXRlOiBlLnNlc3Npb25TdGF0ZQoJfSkpLnJlbWFpbmRlciA6IHQ7Cn0KLy8jZW5kcmVnaW9uCi8vI3JlZ2lvbiBkaXN0L3NyYy9leGVjdXRpb24vdHVybi1leGVjdXRpb24tY3Vyc29yLmpzCnZhciBUdXJuRXhlY3V0aW9uQ3Vyc29yID0gY2xhc3MgewoJY29udHJvbFRva2VuOwoJcGFyZW50V3JpdGFibGU7CgljdXJyZW50U2VyaWFsaXplZENvbnRleHQ7CgljdXJyZW50U2Vzc2lvblN0YXRlOwoJbGFzdFJlcG9ydGVkQ29udGludWF0aW9uVG9rZW47Cgljb25zdHJ1Y3RvcihlKSB7CgkJdGhpcy5jb250cm9sVG9rZW4gPSBlLmNvbnRyb2xUb2tlbiwgdGhpcy5jdXJyZW50U2VyaWFsaXplZENvbnRleHQgPSBlLnNlcmlhbGl6ZWRDb250ZXh0LCB0aGlzLmN1cnJlbnRTZXNzaW9uU3RhdGUgPSBlLnNlc3Npb25TdGF0ZSwgdGhpcy5sYXN0UmVwb3J0ZWRDb250aW51YXRpb25Ub2tlbiA9IGUuc2Vzc2lvblN0YXRlLmNvbnRpbnVhdGlvblRva2VuLCB0aGlzLnBhcmVudFdyaXRhYmxlID0gZS5wYXJlbnRXcml0YWJsZTsKCX0KCWdldCBzZXJpYWxpemVkQ29udGV4dCgpIHsKCQlyZXR1cm4gdGhpcy5jdXJyZW50U2VyaWFsaXplZENvbnRleHQ7Cgl9CglnZXQgc2Vzc2lvblN0YXRlKCkgewoJCXJldHVybiB0aGlzLmN1cnJlbnRTZXNzaW9uU3RhdGU7Cgl9Cglhc3luYyBhZG9wdChlKSB7CgkJdGhpcy5zZXRTdGF0ZShlKTsKCQlsZXQgdCA9IGUuc2Vzc2lvblN0YXRlLmNvbnRpbnVhdGlvblRva2VuOwoJCXQgPT09IGBgIHx8IHQgPT09IHRoaXMubGFzdFJlcG9ydGVkQ29udGludWF0aW9uVG9rZW4gfHwgKHRoaXMubGFzdFJlcG9ydGVkQ29udGludWF0aW9uVG9rZW4gPSB0LCBhd2FpdCB0aGlzLnNlbmQoewoJCQljb250aW51YXRpb25Ub2tlbjogdCwKCQkJa2luZDogYHR1cm4tY29udGludWF0aW9uLXRva2VuYAoJCX0pKTsKCX0KCWNyZWF0ZVN0ZXBJbnB1dChlKSB7CgkJcmV0dXJuIHsKCQkJaW5wdXQ6IGUsCgkJCXBhcmVudFdyaXRhYmxlOiB0aGlzLnBhcmVudFdyaXRhYmxlLAoJCQlzZXJpYWxpemVkQ29udGV4dDogdGhpcy5jdXJyZW50U2VyaWFsaXplZENvbnRleHQsCgkJCXNlc3Npb25TdGF0ZTogdGhpcy5jdXJyZW50U2Vzc2lvblN0YXRlCgkJfTsKCX0KCWFzeW5jIGZpbmlzaChlLCB0LCBuKSB7CgkJdGhpcy5zZXRTdGF0ZShlKSwgYXdhaXQgdGhpcy5zZW5kKHsKCQkJYWN0aW9uOiB7CgkJCQkuLi50LAoJCQkJc2VyaWFsaXplZENvbnRleHQ6IHRoaXMuY3VycmVudFNlcmlhbGl6ZWRDb250ZXh0LAoJCQkJc2Vzc2lvblN0YXRlOiB0aGlzLmN1cnJlbnRTZXNzaW9uU3RhdGUKCQkJfSwKCQkJYnVmZmVyZWREZWxpdmVyaWVzOiBuLmxlbmd0aCA9PT0gMCA/IHZvaWQgMCA6IFsuLi5uXSwKCQkJa2luZDogYHR1cm4tcmVzdWx0YAoJCX0pOwoJfQoJYXN5bmMgc2VuZCh0KSB7CgkJYXdhaXQgc2VuZFR1cm5Db250cm9sU3RlcCh7CgkJCWNvbnRyb2xUb2tlbjogdGhpcy5jb250cm9sVG9rZW4sCgkJCXBheWxvYWQ6IHQKCQl9KTsKCX0KCXNldFN0YXRlKGUpIHsKCQl0aGlzLmN1cnJlbnRTZXJpYWxpemVkQ29udGV4dCA9IGUuc2VyaWFsaXplZENvbnRleHQgPz8gdGhpcy5jdXJyZW50U2VyaWFsaXplZENvbnRleHQsIHRoaXMuY3VycmVudFNlc3Npb25TdGF0ZSA9IGUuc2Vzc2lvblN0YXRlOwoJfQp9OwovLyNlbmRyZWdpb24KLy8jcmVnaW9uIGRpc3Qvc3JjL2V4ZWN1dGlvbi90dXJuLXdvcmtmbG93LmpzCmNvbnN0IFRBU0tfTU9ERV9XQUlUX0VSUk9SX01FU1NBR0UgPSAiVGFzayBtb2RlIGNhbm5vdCB3YWl0IGZvciBmb2xsb3ctdXAgaW5wdXQgKGBuZXh0OiBudWxsYCkuIjsKYXN5bmMgZnVuY3Rpb24gdHVybldvcmtmbG93KGUpIHsKCWxldCB0ID0gbWlncmF0ZVR1cm5Xb3JrZmxvd0lucHV0KGUpOwoJcmV0dXJuIHQuZHJpdmVyQ2FwYWJpbGl0aWVzPy50dXJuSW5ib3ggPT09ICEwID8gcnVuVHVybk93bmVkV29ya2Zsb3codCkgOiBydW5MZWdhY3lUdXJuV29ya2Zsb3codCk7Cn0KYXN5bmMgZnVuY3Rpb24gcnVuVHVybk93bmVkV29ya2Zsb3coZSkgewoJbGV0IHIgPSBjcmVhdGVIb29rKHsgdG9rZW46IGAke2UuY29tcGxldGlvblRva2VufTppbmJveGAgfSksIGMgPSByW1N5bWJvbC5hc3luY0l0ZXJhdG9yXSgpLCBsID0gbmV3IFR1cm5FeGVjdXRpb25DdXJzb3IoewoJCWNvbnRyb2xUb2tlbjogZS5jb21wbGV0aW9uVG9rZW4sCgkJcGFyZW50V3JpdGFibGU6IGUuc3RlcElucHV0LnBhcmVudFdyaXRhYmxlLAoJCXNlcmlhbGl6ZWRDb250ZXh0OiBlLnN0ZXBJbnB1dC5zZXJpYWxpemVkQ29udGV4dCwKCQlzZXNzaW9uU3RhdGU6IGUuc3RlcElucHV0LnNlc3Npb25TdGF0ZQoJfSksIHUgPSAwLCBuZXh0RGVsaXZlcnlSZXF1ZXN0SWQgPSAoKSA9PiBgJHtyLnRva2VufTpkZWxpdmVyeToke1N0cmluZyh1KyspfWAsIGQgPSBbXSwgZiA9IGUuc3RlcElucHV0LmlucHV0LCBwID0gITE7Cgl0cnkgewoJCXRyeSB7CgkJCWF3YWl0IGNsYWltSG9va093bmVyc2hpcChyKSwgcCA9ICEwOwoJCX0gY2F0Y2ggKGUpIHsKCQkJaWYgKGlzSG9va0NvbmZsaWN0RXJyb3IoZSkpIHJldHVybjsKCQkJdGhyb3cgZTsKCQl9CgkJZm9yICg7OykgewoJCQlsZXQgYSA9IGF3YWl0IHR1cm5TdGVwKGwuY3JlYXRlU3RlcElucHV0KGYpKTsKCQkJaWYgKGEuYWN0aW9uID09PSBgZG9uZWApIHsKCQkJCWF3YWl0IGwuZmluaXNoKGEsIHsKCQkJCQlraW5kOiBgZG9uZWAsCgkJCQkJb3V0cHV0OiBhLm91dHB1dCA/PyBgYCwKCQkJCQlpc0Vycm9yOiBhLmlzRXJyb3IKCQkJCX0sIGQpOwoJCQkJcmV0dXJuOwoJCQl9CgkJCWxldCBzID0gYS5hY3Rpb24gPT09IGBkaXNwYXRjaC13b3JrZmxvdy1ydW50aW1lLWFjdGlvbnNgIHx8IGEuYWN0aW9uID09PSBgcGFya2AgPyBhLnBlbmRpbmdSdW50aW1lQWN0aW9uS2V5cyA6IHZvaWQgMDsKCQkJaWYgKHMgIT09IHZvaWQgMCkgewoJCQkJYXdhaXQgbC5hZG9wdChhKTsKCQkJCWxldCBlID0gYXdhaXQgKGEuYWN0aW9uID09PSBgZGlzcGF0Y2gtd29ya2Zsb3ctcnVudGltZS1hY3Rpb25zYCA/IGRpc3BhdGNoV29ya2Zsb3dSdW50aW1lQWN0aW9uc1N0ZXAgOiBkaXNwYXRjaFJ1bnRpbWVBY3Rpb25zU3RlcCkoewoJCQkJCWNhbGxiYWNrQmFzZVVybDogcmVzb2x2ZVdvcmtmbG93Q2FsbGJhY2tCYXNlVXJsKGdldFdvcmtmbG93TWV0YWRhdGEoKS51cmwpLAoJCQkJCXBhcmVudENvbnRpbnVhdGlvblRva2VuOiByLnRva2VuLAoJCQkJCXBhcmVudFdyaXRhYmxlOiBsLnBhcmVudFdyaXRhYmxlLAoJCQkJCXNlcmlhbGl6ZWRDb250ZXh0OiBsLnNlcmlhbGl6ZWRDb250ZXh0LAoJCQkJCXNlc3Npb25TdGF0ZTogbC5zZXNzaW9uU3RhdGUKCQkJCX0pOwoJCQkJYXdhaXQgbC5hZG9wdChlKSwgZiA9IHsKCQkJCQlraW5kOiBg", - "cnVudGltZS1hY3Rpb24tcmVzdWx0YCwKCQkJCQlyZXN1bHRzOiBhd2FpdCB3YWl0Rm9yUnVudGltZUFjdGlvblJlc3VsdHMoewoJCQkJCQlidWZmZXJlZERlbGl2ZXJpZXM6IGQsCgkJCQkJCWN1cnNvcjogbCwKCQkJCQkJaW5ib3hUb2tlbjogci50b2tlbiwKCQkJCQkJaW5pdGlhbFJlc3VsdHM6IGUucmVzdWx0cywKCQkJCQkJaXRlcmF0b3I6IGMsCgkJCQkJCW5leHREZWxpdmVyeVJlcXVlc3RJZCwKCQkJCQkJcGVuZGluZ0FjdGlvbktleXM6IHMKCQkJCQl9KQoJCQkJfTsKCQkJCWNvbnRpbnVlOwoJCQl9CgkJCWlmIChhLmFjdGlvbiA9PT0gYHBhcmtgKSB7CgkJCQlpZiAoIShhLmhhc1BlbmRpbmdBdXRob3JpemF0aW9uIHx8IGEuaGFzUGVuZGluZ0lucHV0QmF0Y2ggJiYgZS5jYXBhYmlsaXRpZXM/LnJlcXVlc3RJbnB1dCA9PT0gITAgfHwgZS5tb2RlID09PSBgY29udmVyc2F0aW9uYCkpIHRocm93IEVycm9yKFRBU0tfTU9ERV9XQUlUX0VSUk9SX01FU1NBR0UpOwoJCQkJYXdhaXQgbC5maW5pc2goYSwgewoJCQkJCWF1dGhvcml6YXRpb25OYW1lczogYS5hdXRob3JpemF0aW9uTmFtZXMsCgkJCQkJa2luZDogYHBhcmtgCgkJCQl9LCBkKTsKCQkJCXJldHVybjsKCQkJfQoJCQlhd2FpdCBsLmFkb3B0KGEpLCBmID0gdm9pZCAwOwoJCX0KCX0gY2F0Y2ggKGUpIHsKCQl0aHJvdyBhd2FpdCBsLnNlbmQoewoJCQllcnJvcjogbm9ybWFsaXplU2VyaWFsaXphYmxlRXJyb3IoZSksCgkJCWtpbmQ6IGB0dXJuLWVycm9yYAoJCX0pLCBlOwoJfSBmaW5hbGx5IHsKCQlhd2FpdCBjbG9zZUhvb2tJdGVyYXRvcihjKSwgcCAmJiBhd2FpdCBkaXNwb3NlSG9vayhyKTsKCX0KfQphc3luYyBmdW5jdGlvbiB3YWl0Rm9yUnVudGltZUFjdGlvblJlc3VsdHModCkgewoJbGV0IG4sIGkgPSBbLi4udC5pbml0aWFsUmVzdWx0c107Cglmb3IgKDs7KSB7CgkJbGV0IGEgPSByZXNvbHZlUnVudGltZUFjdGlvblJlc3VsdHNGb3JLZXlzKHsKCQkJcGVuZGluZ0tleXM6IHQucGVuZGluZ0FjdGlvbktleXMsCgkJCXJlc3VsdHM6IGkKCQl9KTsKCQlpZiAoYSAhPT0gdm9pZCAwKSByZXR1cm4gbiAhPT0gdm9pZCAwICYmIGF3YWl0IHQuY3Vyc29yLnNlbmQoewoJCQlraW5kOiBgdHVybi1kZWxpdmVyeS1jYW5jZWxsZWRgLAoJCQlyZXF1ZXN0SWQ6IG4KCQl9KSwgYTsKCQl0LmN1cnNvci5zZXNzaW9uU3RhdGUuaGFzUHJveHlJbnB1dFJlcXVlc3RzICYmIG4gPT09IHZvaWQgMCAmJiAobiA9IHQubmV4dERlbGl2ZXJ5UmVxdWVzdElkKCksIGF3YWl0IHQuY3Vyc29yLnNlbmQoewoJCQljb250aW51YXRpb25Ub2tlbjogdC5jdXJzb3Iuc2Vzc2lvblN0YXRlLmNvbnRpbnVhdGlvblRva2VuLAoJCQlpbmJveFRva2VuOiB0LmluYm94VG9rZW4sCgkJCWtpbmQ6IGB0dXJuLWRlbGl2ZXJ5LXJlcXVlc3RgLAoJCQlyZXF1ZXN0SWQ6IG4KCQl9KSk7CgkJbGV0IG8gPSBhd2FpdCB0Lml0ZXJhdG9yLm5leHQoKTsKCQlpZiAoby5kb25lKSB0aHJvdyBFcnJvcihgVHVybiBpbmJveCBjbG9zZWQgYmVmb3JlIHJ1bnRpbWUgYWN0aW9ucyBjb21wbGV0ZWQuYCk7CgkJbGV0IHMgPSBvLnZhbHVlOwoJCWlmIChzLmtpbmQgPT09IGBydW50aW1lLWFjdGlvbi1yZXN1bHRgKSB7CgkJCWkucHVzaCguLi5zLnJlc3VsdHMpOwoJCQljb250aW51ZTsKCQl9CgkJaWYgKHMua2luZCA9PT0gYHN1YmFnZW50LWlucHV0LXJlcXVlc3RgKSB7CgkJCWxldCBlID0gYXdhaXQgcnVuUHJveHlJbnB1dFJlcXVlc3RTdGVwKHsKCQkJCWhvb2tQYXlsb2FkOiBzLAoJCQkJcGFyZW50V3JpdGFibGU6IHQuY3Vyc29yLnBhcmVudFdyaXRhYmxlLAoJCQkJc2VyaWFsaXplZENvbnRleHQ6IHQuY3Vyc29yLnNlcmlhbGl6ZWRDb250ZXh0LAoJCQkJc2Vzc2lvblN0YXRlOiB0LmN1cnNvci5zZXNzaW9uU3RhdGUKCQkJfSk7CgkJCWF3YWl0IHQuY3Vyc29yLmFkb3B0KGUpOwoJCQljb250aW51ZTsKCQl9CgkJaWYgKHMua2luZCA9PT0gYGRyaXZlci1kZWxpdmVyeWAgJiYgcy5yZXF1ZXN0SWQgPT09IG4pIHsKCQkJYXdhaXQgdC5jdXJzb3Iuc2VuZCh7CgkJCQlraW5kOiBgdHVybi1kZWxpdmVyeS1hY2NlcHRlZGAsCgkJCQlyZXF1ZXN0SWQ6IHMucmVxdWVzdElkCgkJCX0pLCBuID0gdm9pZCAwOwoJCQlsZXQgZSA9IGF3YWl0IHJvdXRlRGVsaXZlclRvQ2hpbGRyZW4oewoJCQkJYXV0aDogcy5kZWxpdmVyeS5hdXRoLAoJCQkJcGFyZW50V3JpdGFibGU6IHQuY3Vyc29yLnBhcmVudFdyaXRhYmxlLAoJCQkJcGF5bG9hZHM6IHMuZGVsaXZlcnkucGF5bG9hZHMsCgkJCQlzZXNzaW9uU3RhdGU6IHQuY3Vyc29yLnNlc3Npb25TdGF0ZQoJCQl9KTsKCQkJZSAhPT0gdm9pZCAwICYmIHQuYnVmZmVyZWREZWxpdmVyaWVzLnB1c2goewoJCQkJLi4ucy5kZWxpdmVyeSwKCQkJCXBheWxvYWRzOiBbZV0KCQkJfSk7CgkJfQoJfQp9CmFzeW5jIGZ1bmN0aW9uIHJ1bkxlZ2FjeVR1cm5Xb3JrZmxvdyhlKSB7CglsZXQgdCA9IGUuc3RlcElucHV0OwoJdHJ5IHsKCQlmb3IgKDs7KSB7CgkJCWxldCBuID0gYXdhaXQgdHVyblN0ZXAodCk7CgkJCWlmIChuLmFjdGlvbiA9PT0gYGRvbmVgKSB7CgkJCQlhd2FpdCBzZW5kVHVybkNvbnRyb2xTdGVwKHsKCQkJCQljb250cm9sVG9rZW46IGUuY29tcGxldGlvblRva2VuLAoJCQkJCXBheWxvYWQ6IHsKCQkJCQkJYWN0aW9uOiB7CgkJCQkJCQlraW5kOiBgZG9uZWAsCgkJCQkJCQlvdXRwdXQ6IG4ub3V0cHV0ID8/IGBgLAoJCQkJCQkJaXNFcnJvcjogbi5pc0Vycm9yLAoJCQkJCQkJc2VyaWFsaXplZENvbnRleHQ6IG4uc2VyaWFsaXplZENvbnRleHQsCgkJCQkJCQlzZXNzaW9uU3RhdGU6IG4uc2Vzc2lvblN0YXRlCgkJCQkJCX0sCgkJCQkJCWtpbmQ6IGB0dXJuLXJlc3VsdGAKCQkJCQl9CgkJCQl9KTsKCQkJCXJldHVybjsKCQkJfQoJCQlpZiAobi5hY3Rpb24gPT09IGBkaXNwYXRjaC13b3JrZmxvdy1ydW50aW1lLWFjdGlvbnNgKSB7CgkJCQlhd2FpdCBzZW5kVHVybkNvbnRyb2xTdGVwKHsKCQkJCQljb250cm9sVG9rZW46IGUuY29tcGxldGlvblRva2VuLAoJCQkJCXBheWxvYWQ6IHsKCQkJCQkJYWN0aW9uOiB7CgkJCQkJCQlraW5kOiBgZGlzcGF0Y2gtd29ya2Zsb3ctcnVudGltZS1hY3Rpb25zYCwKCQkJCQkJCXBlbmRpbmdBY3Rpb25LZXlzOiBuLnBlbmRpbmdSdW50aW1lQWN0aW9uS2V5cywKCQkJCQkJCXNlcmlhbGl6ZWRDb250ZXh0OiBuLnNlcmlhbGl6ZWRDb250ZXh0LAoJCQkJCQkJc2Vzc2lvblN0YXRlOiBuLnNlc3Npb25TdGF0ZQoJCQkJCQl9LAoJCQkJCQlraW5kOiBgdHVybi1yZXN1bHRgCgkJCQkJfQoJCQkJfSk7CgkJCQlyZXR1cm47CgkJCX0KCQkJaWYgKG4uYWN0aW9uID09PSBgcGFya2ApIHsKCQkJCWxldCB0ID0gbi5wZW5kaW5nUnVudGltZUFjdGlvbktleXM7CgkJCQlpZiAoISh0ICE9PSB2b2lkIDAgfHwgbi5oYXNQZW5kaW5nQXV0aG9yaXphdGlvbiB8fCBuLmhhc1BlbmRpbmdJbnB1dEJhdGNoICYmIGUuY2FwYWJpbGl0aWVzPy5yZXF1ZXN0SW5wdXQgPT09ICEwIHx8IGUubW9kZSA9PT0gYGNvbnZlcnNhdGlvbmApKSB0aHJvdyBFcnJvcihUQVNLX01PREVfV0FJVF9FUlJPUl9NRVNTQUdFKTsKCQkJCWxldCByID0gdCA9PT0gdm9pZCAwID8gewoJCQkJCWtpbmQ6IGBwYXJrYCwKCQkJCQlzZXJpYWxpemVkQ29udGV4dDogbi5zZXJpYWxpemVkQ29udGV4dCwKCQkJCQlzZXNzaW9uU3RhdGU6IG4uc2Vzc2lvblN0YXRlLAoJCQkJCWF1dGhvcml6YXRpb25OYW1lczogbi5hdXRob3JpemF0aW9uTmFtZXMKCQkJCX0gOiB7CgkJCQkJa2luZDogYGRpc3BhdGNoLXJ1bnRpbWUtYWN0aW9uc2AsCgkJCQkJcGVuZGluZ0FjdGlvbktleXM6IHQsCgkJCQkJc2VyaWFsaXplZENvbnRleHQ6IG4uc2VyaWFsaXplZENvbnRleHQsCgkJCQkJc2Vzc2lvblN0YXRlOiBuLnNlc3Npb25TdGF0ZQoJCQkJfTsKCQkJCWF3YWl0IHNlbmRUdXJuQ29udHJvbFN0ZXAoewoJCQkJCWNvbnRyb2xUb2tlbjogZS5jb21wbGV0aW9uVG9rZW4sCgkJCQkJcGF5bG9hZDogewoJCQkJCQlhY3Rpb246IHIsCgkJCQkJCWtpbmQ6IGB0dXJuLXJlc3VsdGAKCQkJCQl9CgkJCQl9KTsKCQkJCXJldHVybjsKCQkJfQoJCQl0ID0gewoJCQkJaW5wdXQ6IHZvaWQgMCwKCQkJCXBhcmVudFdyaXRhYmxlOiB0LnBhcmVudFdyaXRhYmxlLAoJCQkJc2VyaWFsaXplZENvbnRleHQ6IG4uc2VyaWFsaXplZENvbnRleHQsCgkJCQlzZXNzaW9uU3RhdGU6IG4uc2Vzc2lvblN0YXRlCgkJCX07CgkJfQoJfSBjYXRjaCAodCkgewoJCXRocm93IGF3YWl0IHNlbmRUdXJuQ29udHJvbFN0ZXAoewoJCQljb250cm9sVG9rZW46IGUuY29tcGxldGlvblRva2VuLAoJCQlwYXlsb2FkOiB7CgkJCQllcnJvcjogbm9ybWFsaXplU2VyaWFsaXphYmxlRXJyb3IodCksCgkJCQlraW5kOiBgdHVybi1lcnJvcmAKCQkJfQoJCX0pLCB0OwoJfQp9CnR1cm5Xb3JrZmxvdy53b3JrZmxvd0lkID0gIndvcmtmbG93Ly9ldmUvL3R1cm5Xb3JrZmxvdyI7Cmdsb2JhbFRoaXMuX19wcml2YXRlX3dvcmtmbG93cy5zZXQoIndvcmtmbG93Ly9ldmUvL3R1cm5Xb3JrZmxvdyIsIHR1cm5Xb3JrZmxvdyk7Ci8vI2VuZHJlZ2lvbgovLyNyZWdpb24gZGlzdC9zcmMvaGFybmVzcy9tZXNzYWdlcy5qcwpmdW5jdGlvbiBjb2FsZXNjZURlbGl2ZXJpZXMoZSkgewoJbGV0IFt0LCAuLi5uXSA9IGU7CglpZiAodCA9PT0gdm9pZCAwKSB0aHJvdyBFcnJvcihgQ2Fubm90IGNvYWxlc2NlIGFuIGVtcHR5IGRlbGl2ZXJ5IGJhdGNoLmApOwoJbGV0IHIgPSB0LmF1dGgsIGkgPSBbLi4udC5wYXlsb2Fkc107Cglmb3IgKGxldCBlIG9mIG4pIGUuYXV0aCAhPT0gdm9pZCAwICYmIChyID0gZS5hdXRoKSwgaS5wdXNoKC4uLmUucGF5bG9hZHMpOwoJcmV0dXJuIHsKCQkuLi50LAoJCWF1dGg6IHIsCgkJcGF5bG9hZHM6IGkKCX07Cn0KLy8jZW5kcmVnaW9uCi8vI3JlZ2lvbiBkaXN0L3NyYy9jb250ZXh0L2tleS5qcwpjb25zdCBLRVlfUkVHSVNUUllfR0xPQkFMX0tFWSA9IFN5bWJvbC5mb3IoYGV2ZS5jb250ZXh0LWtleS1yZWdpc3RyeWApOwpjb25zdCBnbG9iYWxLZXlSZWdpc3RyeUNvbnRhaW5lciA9IGdsb2JhbFRoaXM7Cmdsb2JhbEtleVJlZ2lzdHJ5Q29udGFpbmVyW0tFWV9SRUdJU1RSWV9HTE9CQUxfS0VZXSA9PT0gdm9pZCAwICYmIChnbG9iYWxLZXlSZWdpc3RyeUNvbnRhaW5lcltLRVlfUkVHSVNUUllfR0xPQkFMX0tFWV0gPSBuZXcgTWFwKCkpOwpjb25zdCBrZXlSZWdpc3RyeSA9IGdsb2JhbEtleVJlZ2lzdHJ5Q29udGFpbmVyW0tFWV9SRUdJU1RSWV9HTE9CQUxfS0VZXTsKdmFyIENvbnRleHRLZXkgPSBjbGFzcyB7CgluYW1lOwoJY29kZWM7Cgljb25zdHJ1Y3RvcihlLCB0ID0ge30pIHsKCQl0aGlzLm5hbWUgPSBlLCB0aGlzLmNvZGVjID0gdC5jb2RlYzsKCQlsZXQgbiA9IGtleVJlZ2lzdHJ5LmdldChlKTsKCQlpZiAobiAhPT0gdm9pZCAwICYmIG4uY29kZWMgPT09IHZvaWQgMCAhPSAodGhpcy5jb2RlYyA9PT0gdm9pZCAwKSkgdGhyb3cgRXJyb3IoYENvbnRleHRLZXkgbmFtZSBjb2xsaXNpb246ICIke2V9IiBpcyBhbHJlYWR5IHJlZ2lzdGVyZWQgJHtuLmNvZGVjID8gYHdpdGhgIDogYHdpdGhvdXRgfSBhIGNvZGVjLCBidXQgYSBrZXkgJHt0aGlzLmNvZGVjID8gYHdpdGhgIDogYHdpdGhvdXRgfSBhIGNvZGVjIGlzIGJlaW5nIHJlZ2lzdGVyZWQgdW5kZXIgdGhlIHNhbWUgbmFtZS4gVGhpcyBzaWxlbnRseSBicmVha3MgY29udGV4dCBzZXJpYWxpemF0aW9uIOKAlCB1c2UgYSBkaXN0aW5jdCBuYW1lLmApOwoJCWtleVJlZ2lzdHJ5LnNldChlLCB0aGlzKTsKCX0KfTsKbmV3IENvbnRleHRLZXkoYGV2ZS5hdXRoYCk7Cm5ldyBDb250ZXh0S2V5KGBldmUuaW5pdGlhdG9yQXV0aGApOwpuZXcgQ29udGV4dEtleShgZXZlLnNlc3Npb25JZGApOwpuZXcgQ29udGV4dEtleShgZXZlLmNvbnRpbnVhdGlvblRva2VuYCk7CmNvbnN0IENoYW5uZWxSZXF1ZXN0SWRLZXkgPSBuZXcgQ29udGV4dEtleShgZXZlLmNoYW5uZWxSZXF1ZXN0SWRgKTsKbmV3IENvbnRleHRLZXkoYGV2ZS5jaGFubmVsSW5zdHJ1bWVudGF0aW9uYCk7Cm5ldyBDb250ZXh0S2V5KGBldmUubW9kZWApOwpuZXcgQ29udGV4dEtleShgZXZlLnBhcmVudFNlc3Npb25gKTsKbmV3IENvbnRleHRLZXkoYGV2ZS5jYXBhYmlsaXRpZXNgKTsKbmV3IENvbnRleHRLZXkoYGV2ZS5zZXNzaW9uQ2FsbGJhY2tgKTsKbmV3IENvbnRleHRLZXkoYGV2ZS5zZXNzaW9uYCk7Cm5ldyBDb250ZXh0S2V5KGBldmUuc2FuZGJveGApOwpuZXcgQ29udGV4dEtleShgZXZlLnNlc3Npb25EeW5hbWljVG9vbE1ldGFkYXRhYCk7Cm5ldyBDb250ZXh0S2V5KGBldmUudHVybkR5bmFtaWNUb29sTWV0YWRhdGFgKTsKbmV3IENvbnRleHRLZXkoYGV2ZS5saXZlU3RlcFRvb2xzYCk7Cm5ldyBDb250ZXh0S2V5KGBldmUuZHluYW1pY1NraWxsTWFuaWZlc3RgKTsKbmV3IENvbnRleHRLZXkoYGV2ZS5zZXNzaW9uRHluYW1pY0luc3RydWN0aW9uc2ApOwpuZXcgQ29udGV4dEtleShgZXZlLnR1cm5EeW5hbWljSW5zdHJ1Y3Rpb25zYCk7Ci8vI2VuZHJlZ2lvbgovLyNyZWdpb24gZGlzdC9zcmMvc2hhcmVkL2d1YXJkcy5qcwpmdW5jdGlvbiBpc09iamVjdChlKSB7CglyZXR1cm4gdHlwZW9mIGUgPT0gYG9iamVjdGAgJiYgISFlICYmICFBcnJheS5pc0FycmF5KGUpOwp9CmZ1bmN0aW9uIGlzTm9uRW1wdHlTdHJpbmcoZSkgewoJcmV0dXJuIHR5cGVvZiBlID09IGBzdHJpbmdgICYmIGUubGVuZ3RoID4gMDsKfQovLyNlbmRyZWdpb24KLy8jcmVnaW9uIGRpc3Qvc3JjL2V4ZWN1dGlvbi9ldmUtd29ya2Zsb3ctYXR0cmlidXRlcy5qcwpmdW5jdGlvbiByZWFkUGFyZW50TGluZWFnZShlKSB7CglsZXQgbiA9IGVbYGV2ZS5wYXJlbnRTZXNzaW9uYF0sIHIgPSBuPy5jYWxsSWQsIGkgPSBuPy5yb290U2Vzc2lvbklkLCBhID0gbj8uc2Vzc2lvbklkLCBvID0gbj8udHVybj8uaWQ7CglyZXR1cm4gewoJCWNhbGxJZDogaXNOb25FbXB0eVN0cmluZyhyKSA/IHIgOiB2b2lkIDAsCgkJcm9vdFNlc3Npb25JZDogaXNOb25FbXB0eVN0cmluZyhpKSA/IGkgOiB2b2lkIDAsCgkJc2Vzc2lvbklkOiBpc05vbkVtcHR5U3RyaW5nKGEpID8gYSA6IHZvaWQgMCwKCQl0dXJuSWQ6IGlzTm9uRW1wdHlTdHJpbmcobykgPyBvIDogdm9pZCAwCgl9Owp9CmZ1bmN0aW9uIHJlYWRSb290U2Vzc2lvbklkKGUpIHsKCXJldHVybiByZWFkUGFyZW50TGluZWFnZShlKS5yb290U2Vzc2lvbklkOwp9CmZ1bmN0aW9uIHJlYWRDaGFubmVsUmVxdWVzdElkKG4pIHsKCWxldCByID0gbltDaGFubmVsUmVxdWVzdElkS2V5Lm5hbWVdOwoJcmV0dXJuIGlzTm9uRW1wdHlTdHJpbmcocikgPyByIDogdm9pZCAwOwp9Ci8vI2VuZHJlZ2lvbgovLyNyZWdpb24gZGlzdC9zcmMvZXhlY3V0aW9uL2RlbGVnYXRlZC1wYXJlbnQtbm90aWZpY2F0aW9uLmpzCnZhciBub3RpZnlEZWxlZ2F0ZWRQYXJlbnRTdGVwID0gZ2xvYmFsVGhpc1tTeW1ib2wuZm9yKCJXT1JLRkxPV19VU0VfU1RFUCIpXSgic3RlcC8vZXZlQDAuMTYuMi8vbm90aWZ5RGVsZWdhdGVkUGFyZW50U3RlcCIpOwovLyNlbmRyZWdpb24KLy8jcmVnaW9uIGRpc3Qvc3JjL3NoYXJlZC9lcnJvcnMuanMKZnVuY3Rpb24gdG9FcnJvck1lc3NhZ2UodCkgewoJcmV0dXJuIHQgaW5zdGFuY2VvZiBFcnJvciA/IHQubWVzc2FnZSA6IHR5cGVvZiB0ID09IGBzdHJpbmdgID8gdCA6IHQgPT0gbnVsbCA/IFN0cmluZyh0KSA6IGlzT2JqZWN0KHQpID8gdHlwZW9mIHQubWVzc2FnZSA9PSBgc3RyaW5nYCAmJiB0Lm1lc3NhZ2UubGVuZ3RoID4gMCA/IHQubWVzc2FnZSA6IHNhZmVKc29uU3RyaW5naWZ5KHQpIDogU3RyaW5nKHQpOwp9CmZ1bmN0aW9uIHNhZmVKc29uU3RyaW5naWZ5KGUpIHsKCXRyeSB7CgkJcmV0dXJuIEpTT04uc3RyaW5naWZ5KGUpID8/IFN0cmluZyhlKTsKCX0gY2F0Y2ggewoJCXJldHVybiBTdHJpbmcoZSk7Cgl9Cn0KLy8jZW5kcmVnaW9uCi8vI3JlZ2lvbiBkaXN0L3NyYy9leGVjdXRpb24vc3ViYWdlbnQtYWRhcHRlci5qcwpjb25zdCBTVUJBR0VOVF9BREFQVEVSX0tJTkQgPSBgc3ViYWdlbnRgOwpnbG9iYWxUaGlzW1N5bWJvbC5mb3IoIldPUktGTE9XX1VTRV9TVEVQIildKCJzdGVwLy9ldmVAMC4xNi4yLy9mb3J3YXJkU3ViYWdlbnRJbnB1dFJlcXVlc3RTdGVwIik7Ci8vI2VuZHJlZ2lvbgovLyNyZWdpb24gZGlzdC9zcmMvZXhlY3V0aW9uL2RlbGVnYXRlZC1wYXJlbnQtcmVzdWx0LmpzCmZ1bmN0aW9uIGNyZWF0ZURlbGVnYXRlZFN1YmFnZW50U3VjY2Vzc1Jlc3VsdChlLCBuKSB7CglsZXQgciA9IGVbYGV2ZS5jaGFubmVsYF07CglpZiAocj8ua2luZCA9PT0gU1VCQUdFTlRfQURBUFRFUl9LSU5EKSByZXR1cm4gewoJCWNhbGxJZDogU3RyaW5nKHIuc3RhdGU/LmNhbGxJZCA/PyBgYCksCgkJa2luZDogYHN1YmFnZW50LXJlc3VsdGAsCgkJb3V0cHV0OiBuLAoJCXN1YmFnZW50TmFtZTogU3RyaW5nKHIuc3RhdGU/LnN1YmFnZW50TmFtZSA/PyBgYCkKCX07Cn0KZnVuY3Rpb24gY3JlYXRlRGVsZWdhdGVkU3ViYWdlbnRFcnJvclJlc3VsdCh0LCBuKSB7CglsZXQgciA9IGNyZWF0ZURlbGVnYXRlZFN1YmFnZW50U3VjY2Vzc1Jlc3VsdCh0LCBgYCk7CglpZiAociAhPT0gdm9pZCAwKSByZXR1cm4gewoJCS4uLnIsCgkJaXNFcnJvcjogITAsCgkJb3V0cHV0OiB7CgkJCWNvZGU6IGBTVUJBR0VOVF9FWEVDVVRJT05fRkFJTEVEYCwKCQkJbWVzc2FnZTogdG9FcnJvck1lc3NhZ2UobikKCQl9Cgl9Owp9Ci8vI2VuZHJlZ2lvbgovLyNyZWdpb24gZGlzdC9zcmMvZXhlY3V0aW9uL2ZvcndhcmQtdHVybi1kZWxpdmVyeS1zdGVwLmpzCnZhciBmb3J3YXJkVHVybkRlbGl2ZXJ5U3RlcCA9IGdsb2JhbFRoaXNbU3ltYm9sLmZvcigiV09SS0ZMT1dfVVNFX1NURVAiKV0oInN0ZXAvL2V2ZUAwLjE2LjIvL2ZvcndhcmRUdXJuRGVsaXZlcnlTdGVwIik7Ci8vI2VuZHJlZ2lvbgovLyNyZWdpb24gZGlzdC9zcmMvZXhlY3V0aW9uL3R1cm4tY29udHJvbC1yZWNlaXZlci5qcwp2YXIgVHVybkNvbnRyb2xSZWNlaXZlciA9IGNsYXNzIHsKCWJ1ZmZlcmVkRGVsaXZlcmllczsKCWNvbnRyb2w7Cgljb250cm9sSXRlcmF0b3I7CglkZWxpdmVyeUhvb2s7CglwZW5kaW5nQ29udHJvbCA9IG51bGw7Cgljb25zdHJ1Y3Rvcih0KSB7CgkJdGhpcy5idWZmZXJlZERlbGl2ZXJpZXMgPSB0LmJ1ZmZlcmVkRGVsaXZlcmllcywgdGhpcy5jb250cm9sID0gY3JlYXRlSG9vayh7IHRva2VuOiB0LnRva2VuIH0pLCB0aGlzLmNvbnRyb2xJdGVyYXRvciA9IHRoaXMuY29udHJvbFtTeW1ib2wuYXN5bmNJdGVyYXRvcl0oKSwgdGhpcy5kZWxpdmVyeUhvb2sgPSB0LmRlbGl2ZXJ5SG9vazsKCX0KCWdldCB0b2tlbigpIHsKCQlyZXR1cm4gdGhpcy5jb250cm9sLnRva2VuOwoJfQoJYXN5bmMgZGlzcG9zZSgpIHsKCQlhd2FpdCBjbG9zZUhvb2tJdGVyYXRvcih0aGlzLmNvbnRyb2xJdGVyYXRvciksIGF3YWl0IGRpc3Bvc2VIb29rKHRoaXMuY29udHJvbCk7Cgl9Cglhc3luYyB3YWl0Rm9yQWN0aW9uKCkgewoJCWZvciAoOzspIHsKCQkJbGV0IGUgPSBhd2FpdCB0aGlzLm5leHRDb250cm9sKGBUdXJuIGNvbnRyb2wgaG9vayBjbG9zZWQgYmVmb3JlIGRlbGl2ZXJpbmcgYSByZXN1bHQuYCksIHQgPSB0aGlzLnJlYWRUZXJtaW5hbENvbnRyb2woZSk7CgkJCWlmICh0ICE9PSB2b2lkIDApIHJldHVybiB0OwoJCQlpZiAoZS5raW5kID09PSBgdHVybi1kZWxpdmVyeS1yZXF1ZXN0YCkgewoJCQkJbGV0IHQgPSBhd2FpdCB0aGlzLnNlcnZpY2VEZWxpdmVyeVJlcXVlc3QoZSk7CgkJCQlpZiAodCAhPT0gdm9pZCAwKSByZXR1cm4gdDsKCQkJfQoJCX0KCX0KCWJ1ZmZlclR1cm5EZWxpdmVyaWVzKGUpIHsKCQllLmJ1ZmZlcmVkRGVsaXZlcmllcyAhPT0gdm9pZCAwICYmIHRoaXMuYnVmZmVyZWREZWxpdmVyaWVzLnVuc2hpZnQoLi4uZS5idWZmZXJlZERlbGl2ZXJpZXMpOwoJfQoJY29uc3VtZUNvbnRyb2woKSB7CgkJdGhpcy5wZW5kaW5nQ29udHJvbCA9IG51bGw7Cgl9CglnZXRDb250cm9sUHJvbWlzZSgpIHsKCQlyZXR1cm4gdGhpcy5wZW5kaW5nQ29udHJvbCA/Pz0gdGhpcy5jb250cm9sSXRlcmF0b3IubmV4dCgpLCB0aGlzLnBlbmRpbmdDb250cm9sOwoJfQoJYXN5bmMgbmV4dENvbnRyb2woZSkgewoJCWZvciAoOzspIHsKCQkJbGV0IHQgPSBhd2FpdCB0aGlzLmdldENvbnRyb2xQcm9taXNlKCk7CgkJCWlmICh0aGlzLmNvbnN1bWVDb250cm9sKCksIHQuZG9uZSkgdGhyb3cgRXJyb3IoZSk7CgkJCWxldCBuID0gdC52YWx1ZTsKCQkJaWYgKG4ua2luZCA9PT0gYHR1cm4tZXJyb3JgKSB0aHJvdyByZWJ1aWxkU2VyaWFsaXphYmxlRXJyb3Iobi5lcnJvcik7CgkJCWlmIChuLmtpbmQgPT09IGB0dXJuLWNvbnRpbnVhdGlvbi10b2tlbmApIHsKCQkJCWF3YWl0IHRoaXMuZGVsaXZlcnlIb29rLnJla2V5KG4uY29udGludWF0aW9uVG9rZW4pOwoJCQkJY29udGludWU7CgkJCX0KCQkJcmV0dXJuIG47CgkJfQoJfQoJcmVhZFRlcm1pbmFsQ29udHJvbChlKSB7CgkJaWYgKGUua2luZCA9PT0gYHR1cm4tZXJyb3JgKSB0aHJvdyByZWJ1aWxkU2VyaWFsaXphYmxlRXJyb3IoZS5lcnJvcik7CgkJaWYgKGUua2luZCA9PT0gYHR1cm4tcmVzdWx0YCkgcmV0dXJuIHRoaXMuYnVmZmVyVHVybkRlbGl2ZXJpZXMoZSksIGUuYWN0aW9uOwoJfQoJYXN5bmMgc2VydmljZURlbGl2ZXJ5UmVxdWVzdChlKSB7CgkJYXdhaXQgdGhpcy5kZWxpdmVyeUhvb2sucmVrZXkoZS5jb250aW51YXRpb25Ub2tlbik7CgkJbGV0IHQgPSB0aGlzLmJ1ZmZlcmVkRGVsaXZlcmllcy5zaGlmdCgpOwoJCWZvciAoOyB0ID09PSB2b2lkIDA7KSB7CgkJCWxldCBuID0gYXdhaXQgUHJvbWlzZS5yYWNlKFt0aGlzLmdldENvbnRyb2xQcm9taXNlKCkudGhlbigoZSkgPT4gKHsKCQkJCWtpbmQ6IGBjb250cm9sYCwKCQkJCXZhbHVlOiBlCgkJCX0pKSwgdGhpcy5kZWxpdmVyeUhvb2submV4dCgpLnRoZW4oKGUpID0+ICh7CgkJCQlraW5kOiBgZGVsaXZlcnlgLAoJCQkJdmFsdWU6IGUKCQkJfSkpXSk7CgkJCWlmIChuLmtpbmQgPT09IGBjb250cm9sYCkgewoJCQkJaWYgKHRoaXMuY29uc3VtZUNvbnRyb2woKSwgbi52YWx1ZS5kb25lKSB0aHJvdyBFcnJvcihgVHVybiBjb250cm9sIGhvb2sgY2xvc2VkIGR1cmluZyBhIGRlbGl2ZXJ5IHJlcXVlc3QuYCk7CgkJCQlpZiAobi52YWx1ZS52YWx1ZS5raW5kID09PSBgdHVybi1jb250aW51YXRpb24tdG9rZW5gKSB7CgkJCQkJYXdhaXQgdGhpcy5kZWxpdmVyeUhvb2sucmVrZXkobi52YWx1ZS52YWx1ZS5jb250aW51YXRpb25Ub2tlbik7CgkJCQkJY29udGludWU7CgkJCQl9CgkJCQlsZXQgdCA9IHRoaXMucmVhZFRlcm1pbmFsQ29udHJvbChuLnZhbHVlLnZhbHVlKTsKCQkJCWlmICh0ICE9PSB2b2lkIDApIHJldHVybiB0OwoJCQkJaWYgKG4udmFsdWUudmFsdWUua2luZCA9PT0gYHR1cm4tZGVsaXZlcnktY2FuY2VsbGVkYCAmJiBuLnZhbHVlLnZhbHVlLnJlcXVlc3RJZCA9PT0gZS5yZXF1ZXN0SWQpIHJldHVybjsKCQkJCWNvbnRpbnVlOwoJCQl9CgkJCWlmIChuLnZhbHVlLmRvbmUpIHRocm93IEVycm9yKGBTZXNzaW9uIGRlbGl2ZXJ5IGhvb2sgY2xvc2VkIGR1cmluZyBhIHR1cm4gZGVsaXZlcnkgcmVxdWVzdC5gKTsKCQkJdGhpcy5kZWxpdmVyeUhvb2suY29uc3VtZU5leHQoKSwgbi52YWx1ZS52YWx1ZS5raW5kID09PSBgZGVsaXZlcmAgJiYgKHQgPSBuLnZhbHVlLnZhbHVlKTsKCQl9CgkJdHJ5IHsKCQkJYXdhaXQgZm9yd2FyZFR1cm5EZWxpdmVyeVN0ZXAoewoJCQkJaW5ib3hUb2tlbjogZS5pbmJveFRva2VuLAoJCQkJcGF5bG9hZDogewoJCQkJCWRlbGl2ZXJ5OiB0LAoJCQkJCWtpbmQ6IGBkcml2ZXItZGVsaXZlcnlgLAoJCQkJCXJlcXVlc3RJZDogZS5yZXF1ZXN0SWQKCQkJCX0KCQkJfSk7CgkJfSBjYXRjaCAoZSkgewoJCQlpZiAoIShlIGluc3RhbmNlb2YgRXJyb3IgJiYgZS5uYW1lID09PSBgSG9va05vdEZvdW5kRXJyb3JgKSkgdGhyb3cgZTsKCQl9CgkJcmV0dXJuIGF3YWl0IHRoaXMuYXdhaXRGb3J3YXJkZWREZWxpdmVyeShlLnJlcXVlc3RJZCwgdCk7Cgl9Cglhc3luYyBhd2FpdEZvcndhcmRlZERlbGl2ZXJ5KGUsIHQpIHsKCQlmb3IgKDs7KSB7CgkJCWxldCBuID0gYXdhaXQgdGhpcy5uZXh0Q29udHJvbChgVHVybiBjb250cm9sIGhvb2sgY2xvc2VkIGJlZm9yZSByZXNvbHZpbmcgYSBmb3J3YXJkZWQgZGVsaXZlcnkuYCk7CgkJCWlmIChuLmtpbmQgPT09IGB0dXJuLWRlbGl2ZXJ5LWFjY2VwdGVkYCkgewoJCQkJaWYgKG4ucmVxdWVzdElkID09PSBlKSByZXR1cm47CgkJCQljb250aW51ZTsKCQkJfQoJCQlpZiAobi5raW5kID09PSBgdHVybi1kZWxpdmVyeS1jYW5j", - "ZWxsZWRgICYmIG4ucmVxdWVzdElkID09PSBlKSB7CgkJCQl0aGlzLmJ1ZmZlcmVkRGVsaXZlcmllcy51bnNoaWZ0KHQpOwoJCQkJcmV0dXJuOwoJCQl9CgkJCW4ua2luZCA9PT0gYHR1cm4tcmVzdWx0YCAmJiB0aGlzLmJ1ZmZlcmVkRGVsaXZlcmllcy51bnNoaWZ0KHQpOwoJCQlsZXQgciA9IHRoaXMucmVhZFRlcm1pbmFsQ29udHJvbChuKTsKCQkJaWYgKHIgIT09IHZvaWQgMCkgcmV0dXJuIHI7CgkJfQoJfQp9OwovLyNlbmRyZWdpb24KLy8jcmVnaW9uIGRpc3Qvc3JjL2V4ZWN1dGlvbi90dXJuLWRpc3BhdGNoLmpzCmFzeW5jIGZ1bmN0aW9uIGRpc3BhdGNoQW5kQXdhaXRUdXJuKGUpIHsKCWxldCB0ID0gbmV3IFR1cm5Db250cm9sUmVjZWl2ZXIoewoJCWJ1ZmZlcmVkRGVsaXZlcmllczogZS5idWZmZXJlZERlbGl2ZXJpZXMsCgkJZGVsaXZlcnlIb29rOiBlLmRlbGl2ZXJ5SG9vaywKCQl0b2tlbjogZS5jb250cm9sVG9rZW4KCX0pOwoJdHJ5IHsKCQlyZXR1cm4gYXdhaXQgZGlzcGF0Y2hUdXJuU3RlcCh7CgkJCWNhcGFiaWxpdGllczogZS5jYXBhYmlsaXRpZXMsCgkJCWNvbXBsZXRpb25Ub2tlbjogdC50b2tlbiwKCQkJZGVsaXZlcnk6IGUuZGVsaXZlcnksCgkJCW1vZGU6IGUubW9kZSwKCQkJcGFyZW50V3JpdGFibGU6IGUucGFyZW50V3JpdGFibGUsCgkJCXNlcmlhbGl6ZWRDb250ZXh0OiBlLnNlcmlhbGl6ZWRDb250ZXh0LAoJCQlzZXNzaW9uU3RhdGU6IGUuc2Vzc2lvblN0YXRlCgkJfSksIGF3YWl0IHQud2FpdEZvckFjdGlvbigpOwoJfSBmaW5hbGx5IHsKCQlhd2FpdCB0LmRpc3Bvc2UoKTsKCX0KfQovLyNlbmRyZWdpb24KLy8jcmVnaW9uIGRpc3Qvc3JjL2V4ZWN1dGlvbi9jcmVhdGUtc2Vzc2lvbi1zdGVwLmpzCnZhciBjcmVhdGVTZXNzaW9uU3RlcCA9IGdsb2JhbFRoaXNbU3ltYm9sLmZvcigiV09SS0ZMT1dfVVNFX1NURVAiKV0oInN0ZXAvL2V2ZUAwLjE2LjIvL2NyZWF0ZVNlc3Npb25TdGVwIik7Ci8vI2VuZHJlZ2lvbgovLyNyZWdpb24gZGlzdC9zcmMvZXhlY3V0aW9uL3Nlc3Npb24tY2FsbGJhY2stc3RlcC5qcwp2YXIgZmlyZVNlc3Npb25DYWxsYmFja1N0ZXAgPSBnbG9iYWxUaGlzW1N5bWJvbC5mb3IoIldPUktGTE9XX1VTRV9TVEVQIildKCJzdGVwLy9ldmVAMC4xNi4yLy9maXJlU2Vzc2lvbkNhbGxiYWNrU3RlcCIpOwovLyNlbmRyZWdpb24KLy8jcmVnaW9uIGRpc3Qvc3JjL2V4ZWN1dGlvbi9zZXNzaW9uLWRlbGl2ZXJ5LWhvb2suanMKZnVuY3Rpb24gY3JlYXRlU2Vzc2lvbkRlbGl2ZXJ5SG9vayhyKSB7CglsZXQgaSwgYSA9IFtdLCBvID0gW10sIHMgPSAwLCBjID0gbnVsbCwgbCwgdSwgZW5xdWV1ZSA9IChlKSA9PiB7CgkJby5wdXNoKGUpLCBvLnNvcnQoKGUsIHQpID0+IGUub3JkZXIgLSB0Lm9yZGVyKSwgdT8uKCksIHUgPSB2b2lkIDA7Cgl9LCBhcm0gPSAoZSkgPT4gewoJCWUuY2xvc2VkIHx8IGUucGVuZGluZyB8fCAoZS5wZW5kaW5nID0gITAsIGUucmVzb2x2ZWQgPSB2b2lkIDAsIChlLnJldGlyZWQgPyBQcm9taXNlLnJlc29sdmUoZS5ob29rKS50aGVuKChlKSA9PiAoewoJCQlkb25lOiAhMSwKCQkJdmFsdWU6IGUKCQl9KSkgOiBlLml0ZXJhdG9yLm5leHQoKSkudGhlbigodCkgPT4gewoJCQlsZXQgbiA9IHsKCQkJCW9yZGVyOiBzKyssCgkJCQlyZXN1bHQ6IHQsCgkJCQlzdGF0ZTogZQoJCQl9OwoJCQllLnJlc29sdmVkID0gbiwgZS5lbmFibGVkICYmIGVucXVldWUobik7CgkJfSwgKCkgPT4ge30pKTsKCX0sIGVuYWJsZSA9IChlKSA9PiB7CgkJZS5lbmFibGVkID0gITAsIGUucmVzb2x2ZWQgIT09IHZvaWQgMCAmJiBlbnF1ZXVlKGUucmVzb2x2ZWQpOwoJfSwgZHJhaW5SZWFkeSA9IGFzeW5jICgpID0+IHsKCQlpZiAoYyA9PT0gbnVsbCkgZm9yIChhd2FpdCBQcm9taXNlLnJlc29sdmUoKTsgby5sZW5ndGggPiAwOykgewoJCQlsZXQgZSA9IG8uc2hpZnQoKTsKCQkJZS5zdGF0ZS5wZW5kaW5nID0gITEsIGUuc3RhdGUucmVzb2x2ZWQgPSB2b2lkIDAsIGUucmVzdWx0LmRvbmUgPyBlLnN0YXRlLmNsb3NlZCA9ICEwIDogZS5yZXN1bHQudmFsdWUua2luZCA9PT0gYGRlbGl2ZXJgICYmIHIucHVzaChlLnJlc3VsdC52YWx1ZSksIGFybShlLnN0YXRlKSwgYXdhaXQgUHJvbWlzZS5yZXNvbHZlKCk7CgkJfQoJfTsKCXJldHVybiB7CgkJY29uc3VtZU5leHQoKSB7CgkJCWlmIChsID09PSB2b2lkIDApIHRocm93IEVycm9yKGBDYW5ub3QgY29uc3VtZSBhIHB1YmxpYyBkZWxpdmVyeSBiZWZvcmUgaXQgcmVzb2x2ZXMuYCk7CgkJCWwuc3RhdGUucGVuZGluZyA9ICExLCBsLnN0YXRlLnJlc29sdmVkID0gdm9pZCAwLCBsLnJlc3VsdC5kb25lICYmIChsLnN0YXRlLmNsb3NlZCA9ICEwKSwgbCA9IHZvaWQgMCwgYyA9IG51bGw7CgkJfSwKCQlhc3luYyBkaXNwb3NlKCkgewoJCQlpICE9PSB2b2lkIDAgJiYgKGF3YWl0IGRpc3Bvc2VIb29rKGkuaG9vayksIGkgPSB2b2lkIDApOwoJCX0sCgkJbmV4dCgpIHsKCQkJaWYgKGkgPT09IHZvaWQgMCkgdGhyb3cgRXJyb3IoYENhbm5vdCB3YWl0IGZvciBkZWxpdmVyaWVzIGJlZm9yZSBhIGNvbnRpbnVhdGlvbiB0b2tlbiBpcyBhdmFpbGFibGUuYCk7CgkJCWlmIChjICE9PSBudWxsKSByZXR1cm4gYzsKCQkJYXJtKGkpOwoJCQlmb3IgKGxldCBlIG9mIGEpIGFybShlKTsKCQkJcmV0dXJuIGkuY2xvc2VkICYmIGEuZXZlcnkoKGUpID0+IGUuY2xvc2VkKSA/IChsID0gewoJCQkJb3JkZXI6IHMrKywKCQkJCXJlc3VsdDogewoJCQkJCWRvbmU6ICEwLAoJCQkJCXZhbHVlOiB2b2lkIDAKCQkJCX0sCgkJCQlzdGF0ZTogaQoJCQl9LCBjID0gUHJvbWlzZS5yZXNvbHZlKGwucmVzdWx0KSwgYykgOiAoYyA9IChhc3luYyAoKSA9PiB7CgkJCQlmb3IgKDsgby5sZW5ndGggPT09IDA7KSBhd2FpdCBuZXcgUHJvbWlzZSgoZSkgPT4gewoJCQkJCXUgPSBlOwoJCQkJfSk7CgkJCQlsZXQgZSA9IG8uc2hpZnQoKTsKCQkJCXJldHVybiBsID0gZSwgZS5yZXN1bHQ7CgkJCX0pKCksIGMpOwoJCX0sCgkJYXN5bmMgcmVrZXkocikgewoJCQlpZiAoIXIgfHwgaT8uaG9vay50b2tlbiA9PT0gcikgcmV0dXJuOwoJCQlsZXQgbyA9IGNyZWF0ZUhvb2soeyB0b2tlbjogciB9KSwgcyA9IHsKCQkJCWNsb3NlZDogITEsCgkJCQllbmFibGVkOiAhMSwKCQkJCWhvb2s6IG8sCgkJCQlpdGVyYXRvcjogb1tTeW1ib2wuYXN5bmNJdGVyYXRvcl0oKSwKCQkJCXBlbmRpbmc6ICExLAoJCQkJcmV0aXJlZDogITEKCQkJfTsKCQkJaWYgKGkgPT09IHZvaWQgMCkgewoJCQkJYXdhaXQgY2xhaW1Ib29rT3duZXJzaGlwKHMuaG9vayksIGVuYWJsZShzKSwgaSA9IHM7CgkJCQlyZXR1cm47CgkJCX0KCQkJbGV0IGMgPSBpOwoJCQlhcm0oYyksIGFybShzKSwgYXdhaXQgY2xhaW1Ib29rT3duZXJzaGlwKHMuaG9vayksIGVuYWJsZShzKSwgYXdhaXQgZHJhaW5SZWFkeSgpOwoJCQl0cnkgewoJCQkJYXdhaXQgZGlzcG9zZUhvb2soYy5ob29rKTsKCQkJfSBjYXRjaCAoZSkgewoJCQkJaSA9IHZvaWQgMDsKCQkJCXRyeSB7CgkJCQkJYXdhaXQgZGlzcG9zZUhvb2socy5ob29rKTsKCQkJCX0gY2F0Y2gge30KCQkJCXRocm93IGU7CgkJCX0KCQkJYy5yZXRpcmVkID0gITAsIGEucHVzaChjKSwgaSA9IHMsIGF3YWl0IGRyYWluUmVhZHkoKTsKCQl9Cgl9Owp9Ci8vI2VuZHJlZ2lvbgovLyNyZWdpb24gZGlzdC9zcmMvZXhlY3V0aW9uL3dvcmtmbG93LWVudHJ5LmpzCmFzeW5jIGZ1bmN0aW9uIHdvcmtmbG93RW50cnkodCkgewoJbGV0IHsgd29ya2Zsb3dSdW5JZDogaSB9ID0gZ2V0V29ya2Zsb3dNZXRhZGF0YSgpLCBhID0gdC5zZXJpYWxpemVkQ29udGV4dFtgZXZlLmNvbnRpbnVhdGlvblRva2VuYF0gfHwgYGAsIHMgPSB0LnNlcmlhbGl6ZWRDb250ZXh0W2BldmUubW9kZWBdLCBjID0gdC5zZXJpYWxpemVkQ29udGV4dFtgZXZlLmNhcGFiaWxpdGllc2BdLCB1ID0gdC5zZXJpYWxpemVkQ29udGV4dFtgZXZlLmJ1bmRsZWBdOwoJdC5zZXJpYWxpemVkQ29udGV4dFtgZXZlLnNlc3Npb25JZGBdID0gaTsKCWxldCBkID0gZ2V0V3JpdGFibGUoKTsKCXRyeSB7CgkJbGV0IGUgPSByZWFkUm9vdFNlc3Npb25JZCh0LnNlcmlhbGl6ZWRDb250ZXh0KSwgeyBzdGF0ZTogbiB9ID0gYXdhaXQgY3JlYXRlU2Vzc2lvblN0ZXAoewoJCQljb21waWxlZEFydGlmYWN0c1NvdXJjZTogdS5zb3VyY2UsCgkJCWNvbnRpbnVhdGlvblRva2VuOiBhLAoJCQlub2RlSWQ6IHUubm9kZUlkLAoJCQlvdXRwdXRTY2hlbWE6IHQuaW5wdXQub3V0cHV0U2NoZW1hLAoJCQlyb290U2Vzc2lvbklkOiBlLAoJCQlzZXNzaW9uSWQ6IGkKCQl9KTsKCQlyZXR1cm4gYXdhaXQgcnVuRHJpdmVyTG9vcCh7CgkJCWNhcGFiaWxpdGllczogYywKCQkJZHJpdmVyV3JpdGFibGU6IGQsCgkJCWluaXRpYWxJbnB1dDogewoJCQkJa2luZDogYGRlbGl2ZXJgLAoJCQkJcGF5bG9hZHM6IFt7CgkJCQkJbWVzc2FnZTogdC5pbnB1dC5tZXNzYWdlLAoJCQkJCWNvbnRleHQ6IHQuaW5wdXQuY29udGV4dCwKCQkJCQlvdXRwdXRTY2hlbWE6IHQuaW5wdXQub3V0cHV0U2NoZW1hCgkJCQl9XSwKCQkJCXJlcXVlc3RJZDogcmVhZENoYW5uZWxSZXF1ZXN0SWQodC5zZXJpYWxpemVkQ29udGV4dCkKCQkJfSwKCQkJbW9kZTogcywKCQkJc2VyaWFsaXplZENvbnRleHQ6IHQuc2VyaWFsaXplZENvbnRleHQsCgkJCXNlc3Npb25TdGF0ZTogbgoJCX0pOwoJfSBjYXRjaCAobikgewoJCXRocm93IGF3YWl0IGVtaXRUZXJtaW5hbFNlc3Npb25GYWlsdXJlU3RlcCh7CgkJCWVycm9yOiBub3JtYWxpemVTZXJpYWxpemFibGVFcnJvcihuKSwKCQkJcGFyZW50V3JpdGFibGU6IGQsCgkJCXNlcmlhbGl6ZWRDb250ZXh0OiB0LnNlcmlhbGl6ZWRDb250ZXh0CgkJfSksIGF3YWl0IGZpcmVTZXNzaW9uQ2FsbGJhY2tTdGVwKHsKCQkJZXJyb3I6IG5vcm1hbGl6ZVNlcmlhbGl6YWJsZUVycm9yKG4pLAoJCQlzZXJpYWxpemVkQ29udGV4dDogdC5zZXJpYWxpemVkQ29udGV4dCwKCQkJc3RhdHVzOiBgZmFpbGVkYAoJCX0pLCBhd2FpdCBub3RpZnlEZWxlZ2F0ZWRQYXJlbnRTdGVwKHsKCQkJcmVzdWx0OiBjcmVhdGVEZWxlZ2F0ZWRTdWJhZ2VudEVycm9yUmVzdWx0KHQuc2VyaWFsaXplZENvbnRleHQsIG4pLAoJCQlzZXJpYWxpemVkQ29udGV4dDogdC5zZXJpYWxpemVkQ29udGV4dAoJCX0pLCBuOwoJfQp9CmFzeW5jIGZ1bmN0aW9uIHJ1bkRyaXZlckxvb3AoZSkgewoJbGV0IG4gPSBjcmVhdGVIb29rKHsgdG9rZW46IGAke2Uuc2Vzc2lvblN0YXRlLnNlc3Npb25JZH06YXV0aGAgfSksIHIgPSBuW1N5bWJvbC5hc3luY0l0ZXJhdG9yXSgpLCBvID0gMCwgbmV4dFR1cm5Db250cm9sVG9rZW4gPSAoKSA9PiBgJHtlLnNlc3Npb25TdGF0ZS5zZXNzaW9uSWR9OnR1cm4tY29udHJvbDoke1N0cmluZyhvKyspfWAsIGMgPSBbXSwgbCA9IGNyZWF0ZVNlc3Npb25EZWxpdmVyeUhvb2soYyk7Cgl0cnkgewoJCWUuc2Vzc2lvblN0YXRlLmNvbnRpbnVhdGlvblRva2VuICYmIGF3YWl0IGwucmVrZXkoZS5zZXNzaW9uU3RhdGUuY29udGludWF0aW9uVG9rZW4pOwoJCWxldCB0ID0gYXdhaXQgZGlzcGF0Y2hBbmRBd2FpdFR1cm4oewoJCQlidWZmZXJlZERlbGl2ZXJpZXM6IGMsCgkJCWNhcGFiaWxpdGllczogZS5jYXBhYmlsaXRpZXMsCgkJCWNvbnRyb2xUb2tlbjogbmV4dFR1cm5Db250cm9sVG9rZW4oKSwKCQkJZGVsaXZlcnk6IGUuaW5pdGlhbElucHV0LAoJCQlkZWxpdmVyeUhvb2s6IGwsCgkJCW1vZGU6IGUubW9kZSwKCQkJcGFyZW50V3JpdGFibGU6IGUuZHJpdmVyV3JpdGFibGUsCgkJCXNlcmlhbGl6ZWRDb250ZXh0OiBlLnNlcmlhbGl6ZWRDb250ZXh0LAoJCQlzZXNzaW9uU3RhdGU6IGUuc2Vzc2lvblN0YXRlCgkJfSk7CgkJZm9yICg7OykgewoJCQlpZiAodC5raW5kID09PSBgZG9uZWApIHJldHVybiBhd2FpdCBmaW5hbGl6ZURvbmUoewoJCQkJYWN0aW9uOiB0LAoJCQkJZHJpdmVyV3JpdGFibGU6IGUuZHJpdmVyV3JpdGFibGUKCQkJfSk7CgkJCWlmICh0LmtpbmQgIT09IGBwYXJrYCkgdGhyb3cgRXJyb3IoYERyaXZlciByZWNlaXZlZCB1bmV4cGVjdGVkIHR1cm4gYWN0aW9uICIke3Qua2luZH0iLmApOwoJCQlpZiAoIXQuc2Vzc2lvblN0YXRlLmNvbnRpbnVhdGlvblRva2VuKSB0aHJvdyBFcnJvcigiQ2Fubm90IHBhcms6IG5vIGNvbnRpbnVhdGlvbiB0b2tlbiBhdmFpbGFibGUuIFRoZSBjaGFubmVsIG11c3QgcG9zdCB0aGUgZmlyc3QgbWVzc2FnZSBkdXJpbmcgdGhlIGluaXRpYWwgdHVybiAoYW5jaG9yaW5nIHRoZSBzZXNzaW9uKSBvciBgc2VuZCgpYCBtdXN0IGJlIGNhbGxlZCB3aXRoIGFuIGV4cGxpY2l0IGNvbnRpbnVhdGlvblRva2VuLiIpOwoJCQlpZiAoYXdhaXQgbC5yZWtleSh0LnNlc3Npb25TdGF0ZS5jb250aW51YXRpb25Ub2tlbiksIHQuYXV0aG9yaXphdGlvbk5hbWVzICYmIHQuYXV0aG9yaXphdGlvbk5hbWVzLmxlbmd0aCA+IDApIHsKCQkJCWxldCBuID0gdC5hdXRob3JpemF0aW9uTmFtZXMubGVuZ3RoLCBpID0gW107CgkJCQlmb3IgKDsgaS5sZW5ndGggPCBuOykgewoJCQkJCWxldCBlID0gYXdhaXQgci5uZXh0KCk7CgkJCQkJaWYgKGUuZG9uZSkgYnJlYWs7CgkJCQkJZS52YWx1ZS5raW5kID09PSBgZGVsaXZlcmAgJiYgaS5wdXNoKC4uLmUudmFsdWUucGF5bG9hZHMpOwoJCQkJfQoJCQkJdCA9IGF3YWl0IGRpc3BhdGNoQW5kQXdhaXRUdXJuKHsKCQkJCQlidWZmZXJlZERlbGl2ZXJpZXM6IGMsCgkJCQkJY2FwYWJpbGl0aWVzOiBlLmNhcGFiaWxpdGllcywKCQkJCQljb250cm9sVG9rZW46IG5leHRUdXJuQ29udHJvbFRva2VuKCksCgkJCQkJZGVsaXZlcnk6IHsKCQkJCQkJa2luZDogYGRlbGl2ZXJgLAoJCQkJCQlwYXlsb2FkczogaQoJCQkJCX0sCgkJCQkJZGVsaXZlcnlIb29rOiBsLAoJCQkJCW1vZGU6IGUubW9kZSwKCQkJCQlwYXJlbnRXcml0YWJsZTogZS5kcml2ZXJXcml0YWJsZSwKCQkJCQlzZXJpYWxpemVkQ29udGV4dDogdC5zZXJpYWxpemVkQ29udGV4dCwKCQkJCQlzZXNzaW9uU3RhdGU6IHQuc2Vzc2lvblN0YXRlCgkJCQl9KTsKCQkJCWNvbnRpbnVlOwoJCQl9CgkJCWxldCBuID0gYXdhaXQgd2FpdEZvck5leHREZWxpdmVyKHsKCQkJCWJ1ZmZlcmVkRGVsaXZlcmllczogYywKCQkJCWRlbGl2ZXJ5SG9vazogbAoJCQl9KTsKCQkJaWYgKG4gPT09IG51bGwpIHJldHVybiB7IG91dHB1dDogYGAgfTsKCQkJbGV0IGkgPSBhd2FpdCByb3V0ZURlbGl2ZXJUb0NoaWxkcmVuKHsKCQkJCWF1dGg6IG4uYXV0aCwKCQkJCXBhcmVudFdyaXRhYmxlOiBlLmRyaXZlcldyaXRhYmxlLAoJCQkJcGF5bG9hZHM6IG4ucGF5bG9hZHMsCgkJCQlzZXNzaW9uU3RhdGU6IHQuc2Vzc2lvblN0YXRlCgkJCX0pOwoJCQlpICE9PSB2b2lkIDAgJiYgKHQgPSBhd2FpdCBkaXNwYXRjaEFuZEF3YWl0VHVybih7CgkJCQlidWZmZXJlZERlbGl2ZXJpZXM6IGMsCgkJCQljYXBhYmlsaXRpZXM6IGUuY2FwYWJpbGl0aWVzLAoJCQkJY29udHJvbFRva2VuOiBuZXh0VHVybkNvbnRyb2xUb2tlbigpLAoJCQkJZGVsaXZlcnk6IHsKCQkJCQlhdXRoOiBuLmF1dGgsCgkJCQkJa2luZDogYGRlbGl2ZXJgLAoJCQkJCXBheWxvYWRzOiBbaV0sCgkJCQkJcmVxdWVzdElkOiBuLnJlcXVlc3RJZAoJCQkJfSwKCQkJCWRlbGl2ZXJ5SG9vazogbCwKCQkJCW1vZGU6IGUubW9kZSwKCQkJCXBhcmVudFdyaXRhYmxlOiBlLmRyaXZlcldyaXRhYmxlLAoJCQkJc2VyaWFsaXplZENvbnRleHQ6IHQuc2VyaWFsaXplZENvbnRleHQsCgkJCQlzZXNzaW9uU3RhdGU6IHQuc2Vzc2lvblN0YXRlCgkJCX0pKTsKCQl9Cgl9IGZpbmFsbHkgewoJCWF3YWl0IGwuZGlzcG9zZSgpLCBhd2FpdCBjbG9zZUhvb2tJdGVyYXRvcihyKSwgYXdhaXQgZGlzcG9zZUhvb2sobik7Cgl9Cn0KYXN5bmMgZnVuY3Rpb24gZmluYWxpemVEb25lKGUpIHsKCWxldCB7IG91dHB1dDogdCwgc2VyaWFsaXplZENvbnRleHQ6IG4gfSA9IGUuYWN0aW9uLCByID0gZS5hY3Rpb24uaXNFcnJvciA9PT0gITA7CglyZXR1cm4gYXdhaXQgZmlyZVNlc3Npb25DYWxsYmFja1N0ZXAoewoJCWVycm9yOiByID8gdCA6IHZvaWQgMCwKCQlvdXRwdXQ6IHIgPyB2b2lkIDAgOiB0LAoJCXNlcmlhbGl6ZWRDb250ZXh0OiBuLAoJCXN0YXR1czogciA/IGBmYWlsZWRgIDogYGNvbXBsZXRlZGAKCX0pLCBhd2FpdCBub3RpZnlEZWxlZ2F0ZWRQYXJlbnRTdGVwKHsKCQlyZXN1bHQ6IHIgPyBjcmVhdGVEZWxlZ2F0ZWRTdWJhZ2VudEVycm9yUmVzdWx0KG4sIHQpIDogY3JlYXRlRGVsZWdhdGVkU3ViYWdlbnRTdWNjZXNzUmVzdWx0KG4sIHQpLAoJCXNlcmlhbGl6ZWRDb250ZXh0OiBuCgl9KSwgeyBvdXRwdXQ6IHQgfTsKfQphc3luYyBmdW5jdGlvbiB3YWl0Rm9yTmV4dERlbGl2ZXIoZSkgewoJaWYgKGUuYnVmZmVyZWREZWxpdmVyaWVzLmxlbmd0aCA+IDApIHJldHVybiBjb2FsZXNjZURlbGl2ZXJpZXMoZS5idWZmZXJlZERlbGl2ZXJpZXMuc3BsaWNlKDApKTsKCWZvciAoOzspIHsKCQlsZXQgdCA9IGF3YWl0IGUuZGVsaXZlcnlIb29rLm5leHQoKTsKCQlpZiAoZS5kZWxpdmVyeUhvb2suY29uc3VtZU5leHQoKSwgdC5kb25lKSByZXR1cm4gbnVsbDsKCQlpZiAodC52YWx1ZS5raW5kICE9PSBgZGVsaXZlcmApIGNvbnRpbnVlOwoJCWxldCBuID0gdC52YWx1ZTsKCQlmb3IgKDs7KSB7CgkJCWxldCB0ID0gYXdhaXQgdGFrZVJlYWR5UGF5bG9hZChlLmRlbGl2ZXJ5SG9vay5uZXh0KCkpOwoJCQlpZiAodCA9PT0gTk9fUkVBRFlfTUVTU0FHRSB8fCAoZS5kZWxpdmVyeUhvb2suY29uc3VtZU5leHQoKSwgdC5kb25lKSkgYnJlYWs7CgkJCXQudmFsdWUua2luZCA9PT0gYGRlbGl2ZXJgICYmIChuID0gY29hbGVzY2VEZWxpdmVyaWVzKFtuLCB0LnZhbHVlXSkpOwoJCX0KCQlyZXR1cm4gbjsKCX0KfQpjb25zdCBOT19SRUFEWV9NRVNTQUdFID0gU3ltYm9sKGBuby1yZWFkeS1tZXNzYWdlYCk7CmFzeW5jIGZ1bmN0aW9uIHRha2VSZWFkeVBheWxvYWQoZSkgewoJcmV0dXJuIGF3YWl0IFByb21pc2UucmVzb2x2ZSgpLCBhd2FpdCBQcm9taXNlLnJhY2UoW2UsIFByb21pc2UucmVzb2x2ZShOT19SRUFEWV9NRVNTQUdFKV0pOwp9CndvcmtmbG93RW50cnkud29ya2Zsb3dJZCA9ICJ3b3JrZmxvdy8vZXZlLy93b3JrZmxvd0VudHJ5IjsKZ2xvYmFsVGhpcy5fX3ByaXZhdGVfd29ya2Zsb3dzLnNldCgid29ya2Zsb3cvL2V2ZS8vd29ya2Zsb3dFbnRyeSIsIHdvcmtmbG93RW50cnkpOwovLyNlbmRyZWdpb24KCi8vIyBzb3VyY2VNYXBwaW5nVVJMPWRhdGE6YXBwbGljYXRpb24vanNvbjtjaGFyc2V0PXV0Zi04O2Jhc2U2NCxleUoyWlhKemFXOXVJam96TENKbWFXeGxJam9pWDJWMlpTMTNiM0pyWm14dmR5MWxiblJ5ZVM1cWN5SXNJbTVoYldWeklqcGJYU3dpYzI5MWNtTmxjeUk2V3lKemNtTXZjSEp2ZEc5amIyd3ZiV1Z6YzJGblpTNXFjeUlzSW5OeVl5OXlkVzUwYVcxbEwyRmpkR2x2Ym5NdmEyVjVjeTVxY3lJc0luTnlZeTlvWVhKdVpYTnpMM0oxYm5ScGJXVXRZV04wYVc5dWN5NXFjeUlzSW5OeVl5OWxlR1ZqZFhScGIyNHZaR2x6Y0dGMFkyZ3RjblZ1ZEdsdFpTMWhZM1JwYjI1ekxYTjBaWEF1YW5NaUxDSnpjbU12WlhobFkzVjBhVzl1TDNkdmNtdG1iRzkzTFdOaGJHeGlZV05yTFhWeWJDNXFjeUlzSW5OeVl5OWxlR1ZqZFhScGIyNHZkMjl5YTJac2IzY3RjM1JsY0hNdWFuTWlMQ0p6Y21NdmFXNTBaWEp1WVd3dmQyOXlhMlpzYjNjdFluVnVaR3hsTDNkdmNtdG1iRzkzTFdOdmNtVXRjMmhwYlM1cWN5SXNJbk55WXk5bGVHVmpkWFJwYjI0dmFHOXZheTF2ZDI1bGNuTm9hWEF1YW5NaUxDSnpjbU12WlhobFkzVjBhVzl1TDNkdmNtdG1iRzkzTFdWeWNtOXljeTVxY3lJc0luTnlZeTlsZUdWamRYUnBiMjR2ZEhWeWJpMWpiMjUwY205c0xYQnliM1J2WTI5c0xtcHpJaXdpYzNKakwyVjRaV04xZEdsdmJpOWthWE53WVhSamFDMTNiM0pyWm14dmR5MXlkVzUwYVcxbExXRmpkR2x2Ym5NdGMzUmxjQzVxY3lJc0luTnlZeTlsZUdWamRYUnBiMjR2WkhWeVlXSnNaUzF6WlhOemFXOXVMVzFwWjNKaGRHbHZibk12WTJoaGFXNHVhbk1pTENKemNtTXZaWGhsWTNWMGFXOXVMMlIxY21GaWJHVXRjMlZ6YzJsdmJpMXRhV2R5WVhScGIyNXpMM1IxY200dGQyOXlhMlpzYjNjdGRqQXRkRzh0ZGpFdWFuTWlMQ0p6Y21NdlpYaGxZM1YwYVc5dUwyUjFjbUZpYkdVdGMyVnpjMmx2YmkxdGFXZHlZWFJwYjI1ekwzUjFjbTR0ZDI5eWEyWnNiM2N1YW5NaUxDSnpjbU12WlhobFkzVjBhVzl1TDJSbGJHbDJaWEl0Y0dGNWJHOWhaSE11YW5NaUxDSnpjbU12WlhobFkzVjBhVzl1TDNKdmRYUmxMV05vYVd4a0xXUmxiR2wyWlhKNUxtcHpJaXdpYzNKakwyVjRaV04xZEdsdmJpOTBkWEp1TFdWNFpXTjFkR2x2YmkxamRYSnpiM0l1YW5NaUxDSnpjbU12WlhobFkzVjBhVzl1TDNSMWNtNHRkMjl5YTJac2IzY3Vhbk1pTENKemNtTXZhR0Z5Ym1WemN5OXRaWE56WVdkbGN5NXFjeUlzSW5OeVl5OWpiMjUwWlhoMEwydGxlUzVxY3lJc0luTnlZeTlqYjI1MFpYaDBMMnRsZVhNdWFuTWlMQ0p6Y21NdmMyaGhjbVZrTDJkMVlYSmtjeTVxY3lJc0luTnlZeTlsZUdWamRYUnBiMjR2WlhabExYZHZjbXRtYkc5M0xXRjBkSEpwWW5WMFpYTXVhbk1pTENKemNtTXZaWGhsWTNWMGFXOXVMMlJsYkdWbllYUmxaQzF3WVhKbGJuUXRibTkwYVdacFkyRjBhVzl1TG1weklpd2ljM0pqTDNOb1lYSmxaQzlsY25KdmNuTXVhbk1pTENKemNtTXZaWGhsWTNWMGFXOXVMM04xWW1GblpXNTBMV0ZrWVhCMFpYSXVhbk1pTENKemNtTXZaWGhsWTNWMGFXOXVMMlJsYkdWbllYUmxaQzF3WVhKbGJuUXRjbVZ6ZFd4MExtcHpJaXdpYzNKakwyVjRaV04xZEdsdmJpOW1iM0ozWVhKa0xYUjFjbTR0WkdWc2FYWmxjbmt0YzNSbGNDNXFjeUlzSW5OeVl5OWxlR1ZqZFhScGIyNHZkSFZ5YmkxamIyNTBjbTlzTFhKbFkyVnBkbVZ5TG1weklpd2ljM0pqTDJWNFpXTjFkR2x2Ymk5MGRYSnVMV1JwYzNCaGRHTm9MbXB6SWl3aWMzSmpMMlY0WldOMWRHbHZiaTlqY21WaGRHVXRjMlZ6YzJsdmJpMXpkR1Z3TG1weklpd2ljM0pqTDJWNFpXTjFkR2x2Ymk5elpYTnphVzl1TFdOaGJHeGlZV05yTFhOMFpYQXVhbk1pTENKemNtTXZaWGhsWTNWMGFXOXVMM05sYzNOcGIyNHRaR1ZzYVhabGNua3RhRzl2YXk1cWN5SXNJbk55WXk5bGVHVmpkWFJwYjI0dmQyOXlhMlpzYjNjdFpXNTBjbmt1YW5NaVhTd2ljMjkxY21ObGMwTnZiblJsYm5RaU9sc2lZMjl1YzNRZ1JWWkZYMU5GVTFOSlQwNWZTVVJmU0VWQlJFVlNQV0I0TFdWMlpTMXpaWE56YVc5dUxXbGtZQ3hGVmtWZlUxUlNSVUZOWDBaUFVrMUJWRjlJUlVGRVJWSTlZSGd0WlhabExYTjBjbVZoYlMxbWIzSnRZWFJnTEVWV1JWOVRWRkpGUVUxZlZrVlNVMGxQVGw5SVJVRkVSVkk5WUhndFpYWmxMWE4wY21WaGJTMTJaWEp6YVc5dVlDeEZWa1ZmVFVWVFUwRkhSVjlUVkZKRlFVMWZRMDlPVkVWT1ZGOVVXVkJGUFdCaGNIQnNhV05oZEdsdmJpOTRMVzVrYW5OdmJqc2dZMmhoY25ObGREMTFkR1l0T0dBc1JWWkZYMDFGVTFOQlIwVmZVMVJTUlVGTlgwWlBVazFCVkQxZ2JtUnFjMjl1WUN4RlZrVmZUVVZUVTBGSFJWOVRWRkpGUVUxZlZrVlNVMGxQVGoxZ01UWmdMSFJsZUhSRmJtTnZaR1Z5UFc1bGR5QlVaWGgwUlc1amIyUmxjanRtZFc1amRHbHZiaUJwYzBOMWNuSmxiblJVZFhKdVFtOTFibVJoY25sRmRtVnVkQ2hsS1h0eVpYUjFjbTRnWlM1MGVYQmxQVDA5WUhObGMzTnBiMjR1WTI5dGNHeGxkR1ZrWUh4OFpTNTBlWEJsUFQwOVlITmxjM05wYjI0dVptRnBiR1ZrWUh4OFpTNTBlWEJsUFQwOVlITmxjM05wYjI0dWQyRnBkR2x1WjJCOVpuVnVZM1JwYjI0Z2FYTlVkWEp1Um1GcGJIVnlaVVYyWlc1MEtHVXBlM0psZEhWeWJpQmxMblI1Y0dVOVBUMWdjMlZ6YzJsdmJpNW1ZV2xzWldSZ2ZIeGxMblI1Y0dVOVBUMWdjM1JsY0M1bVlXbHNaV1JnZkh4bExuUjVjR1U5UFQxZ2RIVnliaTVtWVdsc1pXUmdmV1oxYm1OMGFXOXVJR055WldGMFpWTmxjM05wYjI1VGRHRnlkR1ZrUlhabGJuUW9aU2w3YkdWMElIUTllMzA3Y21WMGRYSnVJR1UvTG1sdWRtOWpZWFJwYjI0aFBUMTJiMmxrSURBbUppaDBMbWx1ZG05allYUnBiMjQ5WlM1cGJuWnZZMkYwYVc5dUtTeGxQeTV5ZFc1MGFXMWxJVDA5ZG05cFpDQXdKaVlvZEM1eWRXNTBhVzFsUFdVdWNuVnVkR2x0WlNrc2UyUmhkR0U2ZEN4MGVYQmxPbUJ6WlhOemFXOXVMbk4wWVhKMFpXUmdmWDFtZFc1amRHbHZiaUJqY21WaGRHVlVkWEp1VTNSaGNuUmxaRVYyWlc1MEtHVXBlM0psZEhWeWJudGtZWFJoT250elpYRjFaVzVqWlRwbExuTmxjWFZsYm1ObExIUjFjbTVKWkRwbExuUjFjbTVKWkgwc2RIbHdaVHBnZEhWeWJpNXpkR0Z5ZEdWa1lIMTlablZ1WTNScGIyNGdZM0psWVhSbFRXVnpjMkZuWlZKbFkyVnBkbVZrUlhabGJuUW9a", - "U2w3Y21WMGRYSnVlMlJoZEdFNmUyMWxjM05oWjJVNmMzVnRiV0Z5YVhwbFZYTmxja052Ym5SbGJuUW9aUzV0WlhOellXZGxLU3h6WlhGMVpXNWpaVHBsTG5ObGNYVmxibU5sTEhSMWNtNUpaRHBsTG5SMWNtNUpaSDBzZEhsd1pUcGdiV1Z6YzJGblpTNXlaV05sYVhabFpHQjlmV1oxYm1OMGFXOXVJSE4xYlcxaGNtbDZaVlZ6WlhKRGIyNTBaVzUwS0dVcGUybG1LSFI1Y0dWdlppQmxQVDFnYzNSeWFXNW5ZQ2x5WlhSMWNtNGdaVHRzWlhRZ2REMWJYVHRtYjNJb2JHVjBJRzRnYjJZZ1pTbHBaaWh1TG5SNWNHVTlQVDFnZEdWNGRHQXBkQzV3ZFhOb0tHNHVkR1Y0ZENrN1pXeHpaU0JwWmlodUxuUjVjR1U5UFQxZ1ptbHNaV0FwZTJ4bGRDQmxQVzR1Wm1sc1pXNWhiV1UvUDI0dWJXVmthV0ZVZVhCbE8zUXVjSFZ6YUNoZ1cyWnBiR1U2SUNSN1pYMGdLQ1I3Ymk1dFpXUnBZVlI1Y0dWOUtWMWdLWDFsYkhObElHNHVkSGx3WlQwOVBXQnBiV0ZuWldBbUpuUXVjSFZ6YUNoZ1cybHRZV2RsT2lBa2UyNHViV1ZrYVdGVWVYQmxQejlnYVcxaFoyVmdmVjFnS1R0eVpYUjFjbTRnZEM1cWIybHVLR0JjYm1BcGZXWjFibU4wYVc5dUlHTnlaV0YwWlVGamRHbHZibk5TWlhGMVpYTjBaV1JGZG1WdWRDaGxLWHR5WlhSMWNtNTdaR0YwWVRwN1lXTjBhVzl1Y3pwbExtRmpkR2x2Ym5Nc2MyVnhkV1Z1WTJVNlpTNXpaWEYxWlc1alpTeHpkR1Z3U1c1a1pYZzZaUzV6ZEdWd1NXNWtaWGdzZEhWeWJrbGtPbVV1ZEhWeWJrbGtmU3gwZVhCbE9tQmhZM1JwYjI1ekxuSmxjWFZsYzNSbFpHQjlmV1oxYm1OMGFXOXVJR055WldGMFpVRjFkR2h2Y21sNllYUnBiMjVTWlhGMWFYSmxaRVYyWlc1MEtHVXBlMnhsZENCMFBYdGtaWE5qY21sd2RHbHZianBsTG1SbGMyTnlhWEIwYVc5dUxHNWhiV1U2WlM1dVlXMWxMSE5sY1hWbGJtTmxPbVV1YzJWeGRXVnVZMlVzYzNSbGNFbHVaR1Y0T21VdWMzUmxjRWx1WkdWNExIUjFjbTVKWkRwbExuUjFjbTVKWkgwN2NtVjBkWEp1SUdVdVlYVjBhRzl5YVhwaGRHbHZiaUU5UFhadmFXUWdNQ1ltS0hRdVlYVjBhRzl5YVhwaGRHbHZiajFsTG1GMWRHaHZjbWw2WVhScGIyNHBMR1V1ZDJWaWFHOXZhMVZ5YkNFOVBYWnZhV1FnTUNZbUtIUXVkMlZpYUc5dmExVnliRDFsTG5kbFltaHZiMnRWY213cExIdGtZWFJoT25Rc2RIbHdaVHBnWVhWMGFHOXlhWHBoZEdsdmJpNXlaWEYxYVhKbFpHQjlmV1oxYm1OMGFXOXVJR055WldGMFpVRjFkR2h2Y21sNllYUnBiMjVEYjIxd2JHVjBaV1JGZG1WdWRDaGxLWHRzWlhRZ2REMTdibUZ0WlRwbExtNWhiV1VzYjNWMFkyOXRaVHBsTG05MWRHTnZiV1VzYzJWeGRXVnVZMlU2WlM1elpYRjFaVzVqWlN4emRHVndTVzVrWlhnNlpTNXpkR1Z3U1c1a1pYZ3NkSFZ5Ymtsa09tVXVkSFZ5Ymtsa2ZUdHlaWFIxY200Z1pTNWhkWFJvYjNKcGVtRjBhVzl1SVQwOWRtOXBaQ0F3SmlZb2RDNWhkWFJvYjNKcGVtRjBhVzl1UFdVdVlYVjBhRzl5YVhwaGRHbHZiaWtzWlM1eVpXRnpiMjRoUFQxMmIybGtJREFtSmloMExuSmxZWE52YmoxbExuSmxZWE52Ymlrc2UyUmhkR0U2ZEN4MGVYQmxPbUJoZFhSb2IzSnBlbUYwYVc5dUxtTnZiWEJzWlhSbFpHQjlmV1oxYm1OMGFXOXVJR055WldGMFpVbHVjSFYwVW1WeGRXVnpkR1ZrUlhabGJuUW9aU2w3Y21WMGRYSnVlMlJoZEdFNmUzSmxjWFZsYzNSek9tVXVjbVZ4ZFdWemRITXNjMlZ4ZFdWdVkyVTZaUzV6WlhGMVpXNWpaU3h6ZEdWd1NXNWtaWGc2WlM1emRHVndTVzVrWlhnc2RIVnlia2xrT21VdWRIVnlia2xrZlN4MGVYQmxPbUJwYm5CMWRDNXlaWEYxWlhOMFpXUmdmWDFtZFc1amRHbHZiaUJqY21WaGRHVkJZM1JwYjI1U1pYTjFiSFJGZG1WdWRDaGxLWHRzWlhRZ2REMWxMbkpsYW1WamRHVmtQVDA5SVRBL2UyVnljbTl5T21KMWFXeGtRV04wYVc5dVVtVnpkV3gwUlhKeWIzSW9aUzV5WlhOMWJIUXBMSE4wWVhSMWN6cGdjbVZxWldOMFpXUmdmVHB1YjNKdFlXeHBlbVZCWTNScGIyNVNaWE4xYkhSUGRYUmpiMjFsS0dVdWNtVnpkV3gwS1R0eVpYUjFjbTU3WkdGMFlUcDdaWEp5YjNJNmRDNWxjbkp2Y2l4eVpYTjFiSFE2WlM1eVpYTjFiSFFzYzJWeGRXVnVZMlU2WlM1elpYRjFaVzVqWlN4emRHVndTVzVrWlhnNlpTNXpkR1Z3U1c1a1pYZ3NjM1JoZEhWek9uUXVjM1JoZEhWekxIUjFjbTVKWkRwbExuUjFjbTVKWkgwc2RIbHdaVHBnWVdOMGFXOXVMbkpsYzNWc2RHQjlmV1oxYm1OMGFXOXVJR055WldGMFpWTjFZbUZuWlc1MFEyRnNiR1ZrUlhabGJuUW9aU2w3Y21WMGRYSnVlMlJoZEdFNmUyTmhiR3hKWkRwbExtTmhiR3hKWkN4amFHbHNaRk5sYzNOcGIyNUpaRHBsTG1Ob2FXeGtVMlZ6YzJsdmJrbGtMSE5sYzNOcGIyNUpaRHBsTG5ObGMzTnBiMjVKWkN4elpYRjFaVzVqWlRwbExuTmxjWFZsYm1ObExHNWhiV1U2WlM1dVlXMWxMSEpsYlc5MFpUcGxMbkpsYlc5MFpTeDBiMjlzVG1GdFpUcGxMblJ2YjJ4T1lXMWxMSFIxY201SlpEcGxMblIxY201SlpDeDNiM0pyWm14dmQwbGtPbVV1ZDI5eWEyWnNiM2RKWkgwc2RIbHdaVHBnYzNWaVlXZGxiblF1WTJGc2JHVmtZSDE5Wm5WdVkzUnBiMjRnWTNKbFlYUmxUV1Z6YzJGblpVRndjR1Z1WkdWa1JYWmxiblFvWlNsN2NtVjBkWEp1ZTJSaGRHRTZlMjFsYzNOaFoyVkVaV3gwWVRwbExtMWxjM05oWjJWRVpXeDBZU3h0WlhOellXZGxVMjlHWVhJNlpTNXRaWE56WVdkbFUyOUdZWElzYzJWeGRXVnVZMlU2WlM1elpYRjFaVzVqWlN4emRHVndTVzVrWlhnNlpTNXpkR1Z3U1c1a1pYZ3NkSFZ5Ymtsa09tVXVkSFZ5Ymtsa2ZTeDBlWEJsT21CdFpYTnpZV2RsTG1Gd2NHVnVaR1ZrWUgxOVpuVnVZM1JwYjI0Z1kzSmxZWFJsVW1WaGMyOXVhVzVuUVhCd1pXNWtaV1JGZG1WdWRDaGxLWHR5WlhSMWNtNTdaR0YwWVRwN2NtVmhjMjl1YVc1blJHVnNkR0U2WlM1eVpXRnpiMjVwYm1kRVpXeDBZU3h5WldGemIyNXBibWRUYjBaaGNqcGxMbkpsWVhOdmJtbHVaMU52Um1GeUxITmxjWFZsYm1ObE9tVXVjMlZ4ZFdWdVkyVXNjM1JsY0VsdVpHVjRPbVV1YzNSbGNFbHVaR1Y0TEhSMWNtNUpaRHBsTG5SMWNtNUpaSDBzZEhsd1pUcGdjbVZoYzI5dWFXNW5MbUZ3Y0dWdVpHVmtZSDE5Wm5WdVkzUnBiMjRnWTNKbFlYUmxUV1Z6YzJGblpVTnZiWEJzWlhSbFpFVjJaVzUwS0dVcGUzSmxkSFZ5Ym50a1lYUmhPbnRtYVc1cGMyaFNaV0Z6YjI0NlpTNW1hVzVwYzJoU1pXRnpiMjQvUDJCemRHOXdZQ3h0WlhOellXZGxPbVV1YldWemMyRm5aU3h6WlhGMVpXNWpaVHBsTG5ObGNYVmxibU5sTEhOMFpYQkpibVJsZURwbExuTjBaWEJKYm1SbGVDeDBkWEp1U1dRNlpTNTBkWEp1U1dSOUxIUjVjR1U2WUcxbGMzTmhaMlV1WTI5dGNHeGxkR1ZrWUgxOVpuVnVZM1JwYjI0Z1kzSmxZWFJsVW1WaGMyOXVhVzVuUTI5dGNHeGxkR1ZrUlhabGJuUW9aU2w3Y21WMGRYSnVlMlJoZEdFNmUzSmxZWE52Ym1sdVp6cGxMbkpsWVhOdmJtbHVaeXh6WlhGMVpXNWpaVHBsTG5ObGNYVmxibU5sTEhOMFpYQkpibVJsZURwbExuTjBaWEJKYm1SbGVDeDBkWEp1U1dRNlpTNTBkWEp1U1dSOUxIUjVjR1U2WUhKbFlYTnZibWx1Wnk1amIyMXdiR1YwWldSZ2ZYMW1kVzVqZEdsdmJpQmpjbVZoZEdWU1pYTjFiSFJEYjIxd2JHVjBaV1JGZG1WdWRDaGxLWHR5WlhSMWNtNTdaR0YwWVRwN2NtVnpkV3gwT21VdWNtVnpkV3gwTEhObGNYVmxibU5sT21VdWMyVnhkV1Z1WTJVc2MzUmxjRWx1WkdWNE9tVXVjM1JsY0VsdVpHVjRMSFIxY201SlpEcGxMblIxY201SlpIMHNkSGx3WlRwZ2NtVnpkV3gwTG1OdmJYQnNaWFJsWkdCOWZXWjFibU4wYVc5dUlHTnlaV0YwWlZOMFpYQlRkR0Z5ZEdWa1JYWmxiblFvWlNsN2NtVjBkWEp1ZTJSaGRHRTZlM05sY1hWbGJtTmxPbVV1YzJWeGRXVnVZMlVzYzNSbGNFbHVaR1Y0T21VdWMzUmxjRWx1WkdWNExIUjFjbTVKWkRwbExuUjFjbTVKWkgwc2RIbHdaVHBnYzNSbGNDNXpkR0Z5ZEdWa1lIMTlablZ1WTNScGIyNGdZM0psWVhSbFUzUmxjRU52YlhCc1pYUmxaRVYyWlc1MEtHVXBlMnhsZENCMFBYdG1hVzVwYzJoU1pXRnpiMjQ2WlM1bWFXNXBjMmhTWldGemIyNHNjMlZ4ZFdWdVkyVTZaUzV6WlhGMVpXNWpaU3h6ZEdWd1NXNWtaWGc2WlM1emRHVndTVzVrWlhnc2RIVnlia2xrT21VdWRIVnlia2xrZlR0eVpYUjFjbTRnWlM1MWMyRm5aU0U5UFhadmFXUWdNQ1ltS0hRdWRYTmhaMlU5WlM1MWMyRm5aU2tzZTJSaGRHRTZkQ3gwZVhCbE9tQnpkR1Z3TG1OdmJYQnNaWFJsWkdCOWZXWjFibU4wYVc5dUlHTnlaV0YwWlZOMFpYQkdZV2xzWldSRmRtVnVkQ2hsS1h0eVpYUjFjbTU3WkdGMFlUcDdZMjlrWlRwbExtTnZaR1VzWkdWMFlXbHNjenBsTG1SbGRHRnBiSE1zYldWemMyRm5aVHBsTG0xbGMzTmhaMlVzYzJWeGRXVnVZMlU2WlM1elpYRjFaVzVqWlN4emRHVndTVzVrWlhnNlpTNXpkR1Z3U1c1a1pYZ3NkSFZ5Ymtsa09tVXVkSFZ5Ymtsa2ZTeDBlWEJsT21CemRHVndMbVpoYVd4bFpHQjlmV1oxYm1OMGFXOXVJR055WldGMFpWUjFjbTVEYjIxd2JHVjBaV1JGZG1WdWRDaGxLWHR5WlhSMWNtNTdaR0YwWVRwN2MyVnhkV1Z1WTJVNlpTNXpaWEYxWlc1alpTeDBkWEp1U1dRNlpTNTBkWEp1U1dSOUxIUjVjR1U2WUhSMWNtNHVZMjl0Y0d4bGRHVmtZSDE5Wm5WdVkzUnBiMjRnWTNKbFlYUmxWSFZ5YmtaaGFXeGxaRVYyWlc1MEtHVXBlM0psZEhWeWJudGtZWFJoT250amIyUmxPbVV1WTI5a1pTeGtaWFJoYVd4ek9tVXVaR1YwWVdsc2N5eHRaWE56WVdkbE9tVXViV1Z6YzJGblpTeHpaWEYxWlc1alpUcGxMbk5sY1hWbGJtTmxMSFIxY201SlpEcGxMblIxY201SlpIMHNkSGx3WlRwZ2RIVnliaTVtWVdsc1pXUmdmWDFtZFc1amRHbHZiaUJqY21WaGRHVkRiMjF3WVdOMGFXOXVVbVZ4ZFdWemRHVmtSWFpsYm5Rb1pTbDdjbVYwZFhKdWUyUmhkR0U2ZTIxdlpHVnNTV1E2WlM1dGIyUmxiRWxrTEhObGNYVmxibU5sT21VdWMyVnhkV1Z1WTJVc2MyVnpjMmx2Ymtsa09tVXVjMlZ6YzJsdmJrbGtMSFIxY201SlpEcGxMblIxY201SlpDeDFjMkZuWlVsdWNIVjBWRzlyWlc1ek9tVXVkWE5oWjJWSmJuQjFkRlJ2YTJWdWN6OC9iblZzYkgwc2RIbHdaVHBnWTI5dGNHRmpkR2x2Ymk1eVpYRjFaWE4wWldSZ2ZYMW1kVzVqZEdsdmJpQmpjbVZoZEdWRGIyMXdZV04wYVc5dVEyOXRjR3hsZEdWa1JYWmxiblFvWlNsN2NtVjBkWEp1ZTJSaGRHRTZlMjF2WkdWc1NXUTZaUzV0YjJSbGJFbGtMSE5sY1hWbGJtTmxPbVV1YzJWeGRXVnVZMlVzYzJWemMybHZia2xrT21VdWMyVnpjMmx2Ymtsa0xIUjFjbTVKWkRwbExuUjFjbTVKWkgwc2RIbHdaVHBnWTI5dGNHRmpkR2x2Ymk1amIyMXdiR1YwWldSZ2ZYMW1kVzVqZEdsdmJpQmpjbVZoZEdWVFpYTnphVzl1VjJGcGRHbHVaMFYyWlc1MEtDbDdjbVYwZFhKdWUyUmhkR0U2ZTNkaGFYUTZZRzVsZUhRdGRYTmxjaTF0WlhOellXZGxZSDBzZEhsd1pUcGdjMlZ6YzJsdmJpNTNZV2wwYVc1bllIMTlablZ1WTNScGIyNGdZM0psWVhSbFUyVnpjMmx2YmtaaGFXeGxaRVYyWlc1MEtHVXBlM0psZEhWeWJudGtZWFJoT250amIyUmxPbVV1WTI5a1pTeGtaWFJoYVd4ek9tVXVaR1YwWVdsc2N5eHRaWE56WVdkbE9tVXViV1Z6YzJGblpTeHpaWE56YVc5dVNXUTZaUzV6WlhOemFXOXVTV1I5TEhSNWNHVTZZSE5sYzNOcGIyNHVabUZwYkdWa1lIMTlablZ1WTNScGIyNGdZM0psWVhSbFUyVnpjMmx2YmtOdmJYQnNaWFJsWkVWMlpXNTBLQ2w3Y21WMGRYSnVlM1I1Y0dVNllITmxjM05wYjI0dVkyOXRjR3hsZEdWa1lIMTlablZ1WTNScGIyNGdkR2x0WlhOMFlXMXdTR0Z1Wkd4bFRXVnpjMkZuWlZOMGNtVmhiVVYyWlc1MEtHVXNkRDF1WlhjZ1JHRjBaU2dwTG5SdlNWTlBVM1J5YVc1bktDa3BlM0psZEhWeWJuc3VMaTVsTEcxbGRHRTZlMkYwT25SOWZYMW1kVzVqZEdsdmJpQmxibU52WkdWTlpYTnpZV2RsVTNSeVpXRnRSWFpsYm5Rb1pTbDdjbVYwZFhKdUlIUmxlSFJGYm1OdlpHVnlMbVZ1WTI5a1pTaGdKSHRLVTA5T0xuTjBjbWx1WjJsbWVTaGxLWDFjWEc1Z0tYMW1kVzVqZEdsdmJpQnViM0p0WVd4cGVtVkJZM1JwYjI1U1pYTjFiSFJQZFhSamIyMWxLR1VwZTJsbUtHVXVhWE5GY25KdmNqMDlQU0V3S1hKbGRIVnlibnRsY25KdmNqcGlkV2xzWkVGamRHbHZibEpsYzNWc2RFVnljbTl5S0dVcExITjBZWFIxY3pwZ1ptRnBiR1ZrWUgwN2JHVjBJSFE5Y21WaFpFRmpkR2x2YmxKbGMzVnNkRTkxZEhCMWRFVnljbTl5S0dVdWIzVjBjSFYwS1R0eVpYUjFjbTRnZEQwOVBYWnZhV1FnTUQ5N2MzUmhkSFZ6T21CamIyMXdiR1YwWldSZ2ZUcDdaWEp5YjNJNmRDeHpkR0YwZFhNNllHWmhhV3hsWkdCOWZXWjFibU4wYVc5dUlHSjFhV3hrUVdOMGFXOXVVbVZ6ZFd4MFJYSnliM0lvWlNsN2JHVjBJSFE5Y21WaFpFRmpkR2x2YmxKbGMzVnNkRTkxZEhCMWRFVnljbTl5S0dVdWIzVjBjSFYwS1R0eVpYUjFjbTRnZEQwOVBYWnZhV1FnTUQ5N1kyOWtaVHBnUVVOVVNVOU9YMUpGVTFWTVZGOUdRVWxNUlVSZ0xHMWxjM05oWjJVNlptOXliV0YwUVdOMGFXOXVVbVZ6ZFd4MFQzVjBjSFYwS0dVdWIzVjBjSFYwS1gwNmRIMW1kVzVqZEdsdmJpQnlaV0ZrUVdOMGFXOXVVbVZ6ZFd4MFQzVjBjSFYwUlhKeWIzSW9aU2w3YkdWMElIUTljR0Z5YzJWQlkzUnBiMjVTWlhOMWJIUlBkWFJ3ZFhSU1pXTnZjbVFvWlNrN2FXWW9kRDA5UFhadmFXUWdNQ2x5WlhSMWNtNDdiR1YwSUc0OWRIbHdaVzltSUhRdVkyOWtaVDA5WUhOMGNtbHVaMkFtSm5RdVkyOWtaUzVzWlc1bmRHZytNRDkwTG1OdlpHVTZkbTlwWkNBd0xISTlkSGx3Wlc5bUlIUXViV1Z6YzJGblpUMDlZSE4wY21sdVoyQW1KblF1YldWemMyRm5aUzVzWlc1bmRHZytNRDkwTG0xbGMzTmhaMlU2ZG05cFpDQXdPMmxtS0NFb2JqMDlQWFp2YVdRZ01IeDhjajA5UFhadmFXUWdNQ2twY21WMGRYSnVlMk52WkdVNmJpeHRaWE56WVdkbE9uSjlmV1oxYm1OMGFXOXVJSEJoY25ObFFXTjBhVzl1VW1WemRXeDBUM1YwY0hWMFVtVmpiM0prS0dVcGUybG1LSFI1Y0dWdlppQmxQVDFnYjJKcVpXTjBZQ1ltWlNseVpYUjFjbTRnWlR0cFppaDBlWEJsYjJZZ1pTRTlZSE4wY21sdVoyQXBjbVYwZFhKdU8yeGxkQ0IwUFdVdWRISnBiU2dwTzJsbUtIUXViR1Z1WjNSb0lUMDlNQ2wwY25sN2JHVjBJR1U5U2xOUFRpNXdZWEp6WlNoMEtUdHBaaWgwZVhCbGIyWWdaVDA5WUc5aWFtVmpkR0FtSm1VcGNtVjBkWEp1SUdWOVkyRjBZMmg3Y21WMGRYSnVmWDFtZFc1amRHbHZiaUJtYjNKdFlYUkJZM1JwYjI1U1pYTjFiSFJQZFhSd2RYUW9aU2w3YVdZb2RIbHdaVzltSUdVOVBXQnpkSEpwYm1kZ0tYSmxkSFZ5YmlCbE8yeGxkQ0IwUFVwVFQwNHVjM1J5YVc1bmFXWjVLR1VwTzNKbGRIVnliaUIwZVhCbGIyWWdkRDA5WUhOMGNtbHVaMkFtSm5RdWJHVnVaM1JvUGpBL2REcGdRV04wYVc5dUlHWmhhV3hsWkM1Z2ZXVjRjRzl5ZEh0RlZrVmZUVVZUVTBGSFJWOVRWRkpGUVUxZlEwOU9WRVZPVkY5VVdWQkZMRVZXUlY5TlJWTlRRVWRGWDFOVVVrVkJUVjlHVDFKTlFWUXNSVlpGWDAxRlUxTkJSMFZmVTFSU1JVRk5YMVpGVWxOSlQwNHNSVlpGWDFORlUxTkpUMDVmU1VSZlNFVkJSRVZTTEVWV1JWOVRWRkpGUVUxZlJrOVNUVUZVWDBoRlFVUkZVaXhGVmtWZlUxUlNSVUZOWDFaRlVsTkpUMDVmU0VWQlJFVlNMR055WldGMFpVRmpkR2x2YmxKbGMzVnNkRVYyWlc1MExHTnlaV0YwWlVGamRHbHZibk5TWlhGMVpYTjBaV1JGZG1WdWRDeGpjbVZoZEdWQmRYUm9iM0pwZW1GMGFXOXVRMjl0Y0d4bGRHVmtSWFpsYm5Rc1kzSmxZWFJsUVhWMGFHOXlhWHBoZEdsdmJsSmxjWFZwY21Wa1JYWmxiblFzWTNKbFlYUmxRMjl0Y0dGamRHbHZia052YlhCc1pYUmxaRVYyWlc1MExHTnlaV0YwWlVOdmJYQmhZM1JwYjI1U1pYRjFaWE4wWldSRmRtVnVkQ3hqY21WaGRHVkpibkIxZEZKbGNYVmxjM1JsWkVWMlpXNTBMR055WldGMFpVMWxjM05oWjJWQmNIQmxibVJsWkVWMlpXNTBMR055WldGMFpVMWxjM05oWjJWRGIyMXdiR1YwWldSRmRtVnVkQ3hqY21WaGRHVk5aWE56WVdkbFVtVmpaV2wyWldSRmRtVnVkQ3hqY21WaGRHVlNaV0Z6YjI1cGJtZEJjSEJsYm1SbFpFVjJaVzUwTEdOeVpXRjBaVkpsWVhOdmJtbHVaME52YlhCc1pYUmxaRVYyWlc1MExHTnlaV0YwWlZKbGMzVnNkRU52YlhCc1pYUmxaRVYyWlc1MExHTnlaV0YwWlZObGMzTnBiMjVEYjIxd2JHVjBaV1JGZG1WdWRDeGpjbVZoZEdWVFpYTnphVzl1Um1GcGJHVmtSWFpsYm5Rc1kzSmxZWFJsVTJWemMybHZibE4wWVhKMFpXUkZkbVZ1ZEN4amNtVmhkR1ZUWlhOemFXOXVWMkZwZEdsdVowVjJaVzUwTEdOeVpXRjBaVk4wWlhCRGIyMXdiR1YwWldSRmRtVnVkQ3hqY21WaGRHVlRkR1Z3Um1GcGJHVmtSWFpsYm5Rc1kzSmxZWFJsVTNSbGNGTjBZWEowWldSRmRtVnVkQ3hqY21WaGRHVlRkV0poWjJWdWRFTmhiR3hsWkVWMlpXNTBMR055WldGMFpWUjFjbTVEYjIxd2JHVjBaV1JGZG1WdWRDeGpjbVZoZEdWVWRYSnVSbUZwYkdWa1JYWmxiblFzWTNKbFlYUmxWSFZ5YmxOMFlYSjBaV1JGZG1WdWRDeGxibU52WkdWTlpYTnpZV2RsVTNSeVpXRnRSWFpsYm5Rc2FYTkRkWEp5Wlc1MFZIVnlia0p2ZFc1a1lYSjVSWFpsYm5Rc2FYTlVkWEp1Um1GcGJIVnlaVVYyWlc1MExIUnBiV1Z6ZEdGdGNFaGhibVJzWlUxbGMzTmhaMlZUZEhKbFlXMUZkbVZ1ZEgwN0lpd2lablZ1WTNScGIyNGdaMlYwVW5WdWRHbHRaVUZqZEdsdmJsSmxjWFZsYzNSTFpYa29aU2w3YzNkcGRHTm9LR1V1YTJsdVpDbDdZMkZ6WldCc2IyRmtMWE5yYVd4c1lEcHlaWFIxY201Z2NuVnVkR2x0WlMxaFkzUnBiMjQ2Skh0bExtdHBibVI5T2lSN1pTNWpZV3hzU1dSOVlEdGpZWE5sWUhKbGJXOTBaUzFoWjJWdWRDMWpZV3hzWURweVpYUjFjbTVnYzNWaVlXZGxiblF0WTJGc2JEb2tlMlV1Y21WdGIzUmxRV2RsYm5ST1lXMWxmVG9rZTJVdVkyRnNiRWxrZldBN1kyRnpaV0J6ZFdKaFoyVnVkQzFqWVd4c1lEcHlaWFIxY201Z2MzVmlZV2RsYm5RdFkyRnNiRG9rZTJVdWMzVmlZV2RsYm5ST1lXMWxmVG9rZTJVdVkyRnNiRWxrZldBN1kyRnpaV0IwYjI5c0xXTmhiR3hnT25KbGRIVnlibUIwYjI5c0xXTmhiR3c2Skh0bExuUnZiMnhPWVcxbGZUb2tlMlV1WTJGc2JFbGtmV0I5ZldaMWJtTjBhVzl1SUdkbGRGSjFiblJwYldWQlkzUnBiMjVTWlhOMWJIUkxaWGtvWlNsN2MzZHBkR05vS0dVdWEybHVaQ2w3WTJGelpXQnNiMkZrTFhOcmFXeHNMWEpsYzNWc2RHQTZjbVYwZFhKdVlISjFiblJwYldVdFlXTjBhVzl1T214dllXUXRjMnRwYkd3NkpIdGxMbU5oYkd4SlpIMWdPMk5oYzJWZ2MzVmlZV2RsYm5RdGNtVnpkV3gwWURweVpYUjFjbTVnYzNWaVlXZGxiblF0WTJGc2JEb2tlMlV1YzNWaVlXZGxiblJPWVcxbGZUb2tlMlV1WTJGc2JFbGtmV0E3WTJGelpXQjBiMjlzTFhKbGMzVnNkR0E2Y21WMGRYSnVZSFJ2YjJ3dFkyRnNiRG9rZTJVdWRHOXZiRTVoYldWOU9pUjdaUzVqWVd4c1NXUjlZSDE5Wlhod2IzSjBlMmRsZEZKMWJuUnBiV1ZCWTNScGIyNVNaWEYxWlhOMFMyVjVMR2RsZEZKMWJuUnBiV1ZCWTNScGIyNVNaWE4xYkhSTFpYbDlPeUlzSW1sdGNHOXlkSHRqY21WaGRHVkJZM1JwYjI1U1pYTjFiSFJGZG1WdWRIMW1jbTl0WENJamNISnZkRzlqYjJ3dmJXVnpjMkZuWlM1cWMxd2lPMmx0Y0c5eWRIdHdZWEp6WlVwemIyNVBZbXBsWTNSOVpuSnZiVndpSTNOb1lYSmxaQzlxYzI5dUxtcHpYQ0k3YVcxd2IzSjBlMk5zWldGeVVISnZlSGxKYm5CMWRGSmxjWFZsYzNSelJtOXlRMmhwYkdSOVpuSnZiVndpSTJoaGNtNWxjM012Y0hKdmVIa3RhVzV3ZFhRdGNtVnhkV1Z6ZEhNdWFuTmNJanRwYlhCdmNuUjdaMlYwVW5WdWRHbHRaVUZqZEdsdmJsSmxjWFZsYzNSTFpYa3NaMlYwVW5WdWRHbHRaVUZqZEdsdmJsSmxjM1ZzZEV0bGVYMW1jbTl0WENJamNuVnVkR2x0WlM5aFkzUnBiMjV6TDJ0bGVYTXVhbk5jSWp0amIyNXpkQ0JRUlU1RVNVNUhYMUpWVGxSSlRVVmZRVU5VU1U5T1gwSkJWRU5JWDB0RldUMWdaWFpsTG5KMWJuUnBiV1V1Y0dWdVpHbHVaMEZqZEdsdmJrSmhkR05vWUR0bWRXNWpkR2x2YmlCblpYUlFaVzVrYVc1blVuVnVkR2x0WlVGamRHbHZia0poZEdOb0tHVXBlMnhsZENCMFBXVS9MbHRRUlU1RVNVNUhYMUpWVGxSSlRVVmZRVU5VU1U5T1gwSkJWRU5JWDB0RldWMDdhV1lvZEhsd1pXOW1JSFFoUFdCdlltcGxZM1JnZkh3aGRDbHlaWFIxY200N2JHVjBJRzQ5ZER0cFppZ2hLQ0ZCY25KaGVTNXBjMEZ5Y21GNUtHNHVZV04wYVc5dWN5bDhmQ0ZCY25KaGVTNXBjMEZ5Y21GNUtHNHVjbVZ6Y0c5dWMyVk5aWE56WVdkbGN5bDhmSFI1Y0dWdlppQnVMbVYyWlc1MElUMWdiMkpxWldOMFlIeDhiaTVsZG1WdWREMDlQVzUxYkd3cEtYSmxkSFZ5YmlCdWZXWjFibU4wYVc5dUlHaGhjMUJsYm1ScGJtZFNkVzUwYVcxbFFXTjBhVzl1UW1GMFkyZ29aU2w3Y21WMGRYSnVJR2RsZEZCbGJtUnBibWRTZFc1MGFXMWxRV04wYVc5dVFtRjBZMmdvWlNraFBUMTJiMmxrSURCOVpuVnVZM1JwYjI0Z1kyeGxZWEpRWlc1a2FXNW5VblZ1ZEdsdFpVRmpkR2x2YmtKaGRHTm9LR1VwZTJsbUtHVXVjM1JoZEdVL0xsdFFSVTVFU1U1SFgxSlZUbFJKVFVWZlFVTlVTVTlPWDBKQlZFTklYMHRGV1YwOVBUMTJiMmxrSURBcGNtVjBkWEp1SUdVN2JHVjBJSFE5ZXk0dUxtVXVjM1JoZEdWOU8zSmxkSFZ5YmlCa1pXeGxkR1VnZEZ0UVJVNUVTVTVIWDFKVlRsUkpUVVZmUVVOVVNVOU9YMEpCVkVOSVgwdEZXVjBzZXk0dUxtVXNjM1JoZEdVNlQySnFaV04wTG10bGVYTW9kQ2t1YkdWdVozUm9QakEvZERwMmIybGtJREI5ZldaMWJtTjBhVzl1SUhObGRGQmxibVJwYm1kU2RXNTBhVzFsUVdOMGFXOXVRbUYwWTJnb1pTbDdiR1YwSUhROWV5NHVMbVV1YzJWemMybHZiaTV6ZEdGMFpYMDdjbVYwZFhKdUlIUmJVRVZPUkVsT1IxOVNWVTVVU1UxRlgwRkRWRWxQVGw5Q1FWUkRTRjlMUlZsZFBYdGhZM1JwYjI1ek9sc3VMaTVsTG1GamRHbHZibk5kTEdWMlpXNTBPbVV1WlhabGJuUXNjbVZ6Y0c5dWMyVk5aWE56WVdkbGN6cGJMaTR1WlM1eVpYTndiMjV6WlUxbGMzTmhaMlZ6WFgwc2V5NHVMbVV1YzJWemMybHZiaXh6ZEdGMFpUcDBmWDFtZFc1amRHbHZiaUJ5WldOdmNtUlFaVzVrYVc1blUzVmlZV2RsYm5SRGFHbHNaRlJ2YTJWdUtHVXBlMnhsZENCMFBXZGxkRkJsYm1ScGJtZFNkVzUwYVcxbFFXTjBhVzl1UW1GMFkyZ29aUzV6WlhOemFXOXVMbk4wWVhSbEtUdHBaaWgwUFQwOWRtOXBaQ0F3S1hKbGRIVnliaUJsTG5ObGMzTnBiMjQ3YkdWMElHNDlleTR1TG1VdWMyVnpjMmx2Ymk1emRHRjBaWDA3Y21WMGRYSnVJRzViVUVWT1JFbE9SMTlTVlU1VVNVMUZYMEZEVkVsUFRsOUNRVlJEU0Y5TFJWbGRQWHN1TGk1MExHTm9hV3hrUTI5dWRHbHVkV0YwYVc5dVZHOXJaVzV6T25zdUxpNTBMbU5vYVd4a1EyOXVkR2x1ZFdGMGFXOXVWRzlyWlc1ekxGdGxMbU5oYkd4SlpGMDZaUzVqYUdsc1pFTnZiblJwYm5WaGRHbHZibFJ2YTJWdWZYMHNleTR1TG1VdWMyVnpjMmx2Yml4emRHRjBaVHB1ZlgxbWRXNWpkR2x2YmlCeVpYTnZiSFpsVW1WaFpIbFNkVzUwYVcxbFFXTjBhVzl1VW1WemRXeDBjeWhsS1h0c1pYUWdkRDFuWlhSUVpXNWthVzVuVW5WdWRHbHRaVUZqZEdsdmJrSmhkR05vS0dVdWMyVnpjMmx2Ymk1emRHRjBaU2s3YVdZb2RDRTlQWFp2YVdRZ01DbHlaWFIxY200Z2NtVnpiMngyWlZKMWJuUnBiV1ZCWTNScGIyNVNaWE4xYkhSelJtOXlRbUYwWTJnb2UySmhkR05vT25Rc2NtVnpkV3gwY3pwbExuSmxjM1ZzZEhOOUtYMW1kVzVqZEdsdmJpQnlaWE52YkhabFVuVnVkR2x0WlVGamRHbHZibEpsYzNWc2RITkdiM0pDWVhSamFDaGxLWHR5WlhSMWNtNGdjbVZ6YjJ4MlpWSjFiblJwYldWQlkzUnBiMjVTWlhOMWJIUnpSbTl5UzJWNWN5aDdjR1Z1WkdsdVowdGxlWE02WlM1aVlYUmphQzVoWTNScGIyNXpMbTFoY0NobFBUNW5aWFJTZFc1MGFXMWxRV04wYVc5dVVtVnhkV1Z6ZEV0bGVTaGxLU2tzY21WemRXeDBjenBsTG5KbGMzVnNkSE45S1gxbWRXNWpkR2x2YmlCeVpYTnZiSFpsVW5WdWRHbHRaVUZqZEdsdmJsSmxjM1ZzZEhOR2IzSkxaWGx6S0dVcGUyeGxkQ0IwUFc1bGR5QlRaWFFvWlM1d1pXNWthVzVuUzJWNWN5a3NiajF1WlhjZ1RXRndPMlp2Y2loc1pYUWdjaUJ2WmlCbExuSmxjM1ZzZEhNcGUyeGxkQ0JsUFdkbGRGSjFiblJwYldWQlkzUnBiMjVTWlhOMWJIUkxaWGtvY2lrN2RDNW9ZWE1vWlNrbUptNHVjMlYwS0dVc2NpbDliR1YwSUhJOVcxMDdabTl5S0d4bGRDQjBJRzltSUdVdWNHVnVaR2x1WjB0bGVYTXBlMnhsZENCbFBXNHVaMlYwS0hRcE8ybG1LR1U5UFQxMmIybGtJREFwY21WMGRYSnVPM0l1Y0hWemFDaGxLWDF5WlhSMWNtNGdjbjFoYzNsdVl5Qm1kVzVqZEdsdmJpQnlaWE52YkhabFVHVnVaR2x1WjFKMWJuUnBiV1ZCWTNScGIyNXpLSFFwZTJ4bGRDQnlQV2RsZEZCbGJtUnBibWRTZFc1MGFXMWxRV04wYVc5dVFtRjBZMmdvZEM1elpYTnphVzl1TG5OMFlYUmxLVHRwWmloeVBUMDlkbTlwWkNBd0tYSmxkSFZ5Ym50dFpYTnpZV2RsY3pwYkxpNHVk", - "QzV6WlhOemFXOXVMbWhwYzNSdmNubGRMRzkxZEdOdmJXVTZZR052Ym5ScGJuVmxZQ3h6WlhOemFXOXVPblF1YzJWemMybHZibjA3YkdWMElHazljbVZ6YjJ4MlpWSmxZV1I1VW5WdWRHbHRaVUZqZEdsdmJsSmxjM1ZzZEhNb2UzSmxjM1ZzZEhNNmRDNXpkR1Z3U1c1d2RYUS9MbkoxYm5ScGJXVkJZM1JwYjI1U1pYTjFiSFJ6UHo5YlhTeHpaWE56YVc5dU9uUXVjMlZ6YzJsdmJuMHBPMmxtS0drOVBUMTJiMmxrSURBcGNtVjBkWEp1ZTIxbGMzTmhaMlZ6T2xzdUxpNTBMbk5sYzNOcGIyNHVhR2x6ZEc5eWVWMHNiM1YwWTI5dFpUcGdkVzV5WlhOdmJIWmxaR0FzYzJWemMybHZianAwTG5ObGMzTnBiMjU5TzJsbUtIUXVaVzFwZENFOVBYWnZhV1FnTUNsbWIzSW9iR1YwSUc0Z2IyWWdhU2x1TG10cGJtUTlQVDFnYzNWaVlXZGxiblF0Y21WemRXeDBZQ1ltYmk1cGMwVnljbTl5SVQwOUlUQW1KbUYzWVdsMElIUXVaVzFwZENoN1pHRjBZVHA3WTJGc2JFbGtPbTR1WTJGc2JFbGtMRzkxZEhCMWREcDBlWEJsYjJZZ2JpNXZkWFJ3ZFhROVBXQnpkSEpwYm1kZ1AyNHViM1YwY0hWME9rcFRUMDR1YzNSeWFXNW5hV1o1S0c0dWIzVjBjSFYwS1N4emRXSmhaMlZ1ZEU1aGJXVTZiaTV6ZFdKaFoyVnVkRTVoYldWOUxIUjVjR1U2WUhOMVltRm5aVzUwTG1OdmJYQnNaWFJsWkdCOUtTeGhkMkZwZENCMExtVnRhWFFvWTNKbFlYUmxRV04wYVc5dVVtVnpkV3gwUlhabGJuUW9lM0psYzNWc2REcHVMSE5sY1hWbGJtTmxPbkl1WlhabGJuUXVjMlZ4ZFdWdVkyVXNjM1JsY0VsdVpHVjRPbkl1WlhabGJuUXVjM1JsY0VsdVpHVjRMSFIxY201SlpEcHlMbVYyWlc1MExuUjFjbTVKWkgwcEtUdHNaWFFnWVQxN0xpNHVkQzV6WlhOemFXOXVMbk4wWVhSbGZUdGtaV3hsZEdVZ1lWdFFSVTVFU1U1SFgxSlZUbFJKVFVWZlFVTlVTVTlPWDBKQlZFTklYMHRGV1YwN2JHVjBJRzg5ZXk0dUxuUXVjMlZ6YzJsdmJpeHpkR0YwWlRwUFltcGxZM1F1YTJWNWN5aGhLUzVzWlc1bmRHZytNRDloT25admFXUWdNSDBzY3oxeUxtTm9hV3hrUTI5dWRHbHVkV0YwYVc5dVZHOXJaVzV6TzJsbUtITWhQVDEyYjJsa0lEQXBabTl5S0d4bGRDQmxJRzltSUdrcGUybG1LR1V1YTJsdVpDRTlQV0J6ZFdKaFoyVnVkQzF5WlhOMWJIUmdLV052Ym5ScGJuVmxPMnhsZENCMFBYTmJaUzVqWVd4c1NXUmRPM1FoUFQxMmIybGtJREFtSmlodlBXTnNaV0Z5VUhKdmVIbEpibkIxZEZKbGNYVmxjM1J6Um05eVEyaHBiR1FvYnl4MEtTbDliR1YwSUdNOWFTNXRZWEFvWlQwK2UzTjNhWFJqYUNobExtdHBibVFwZTJOaGMyVmdiRzloWkMxemEybHNiQzF5WlhOMWJIUmdPbkpsZEhWeWJudHZkWFJ3ZFhRNmRHOVViMjlzVW1WemRXeDBUM1YwY0hWMEtHVXBMSFJ2YjJ4RFlXeHNTV1E2WlM1allXeHNTV1FzZEc5dmJFNWhiV1U2WUd4dllXUmZjMnRwYkd4Z0xIUjVjR1U2WUhSdmIyd3RjbVZ6ZFd4MFlIMDdZMkZ6WldCemRXSmhaMlZ1ZEMxeVpYTjFiSFJnT25KbGRIVnlibnR2ZFhSd2RYUTZkRzlVYjI5c1VtVnpkV3gwVDNWMGNIVjBLR1VwTEhSdmIyeERZV3hzU1dRNlpTNWpZV3hzU1dRc2RHOXZiRTVoYldVNlpTNXpkV0poWjJWdWRFNWhiV1VzZEhsd1pUcGdkRzl2YkMxeVpYTjFiSFJnZlR0allYTmxZSFJ2YjJ3dGNtVnpkV3gwWURweVpYUjFjbTU3YjNWMGNIVjBPblJ2Vkc5dmJGSmxjM1ZzZEU5MWRIQjFkQ2hsS1N4MGIyOXNRMkZzYkVsa09tVXVZMkZzYkVsa0xIUnZiMnhPWVcxbE9tVXVkRzl2YkU1aGJXVXNkSGx3WlRwZ2RHOXZiQzF5WlhOMWJIUmdmWDEwYUhKdmR5QkZjbkp2Y2loZ1ZXNXpkWEJ3YjNKMFpXUWdjblZ1ZEdsdFpTQmhZM1JwYjI0Z2NtVnpkV3gwSUd0cGJtUWdYQ0lrZTFOMGNtbHVaeWhsS1gxY0lpNWdLWDBwTEd3OVd5NHVMbTh1YUdsemRHOXllU3d1TGk1eUxuSmxjM0J2Ym5ObFRXVnpjMkZuWlhOZE8zSmxkSFZ5YmlCakxteGxibWQwYUQ0d0ppWnNMbkIxYzJnb2UyTnZiblJsYm5RNll5eHliMnhsT21CMGIyOXNZSDBwTEh0dFpYTnpZV2RsY3pwc0xHOTFkR052YldVNllISmxjMjlzZG1Wa1lDeHpaWE56YVc5dU9tOTlmV1oxYm1OMGFXOXVJR055WldGMFpWSjFiblJwYldWQlkzUnBiMjVTWlhGMVpYTjBSbkp2YlZSdmIyeERZV3hzS0dVcGUyeGxkQ0IwUFdVdWRHOXZiSE11WjJWMEtHVXVkRzl2YkVOaGJHd3VkRzl2YkU1aGJXVXBPM0psZEhWeWJpQjBQeTV5ZFc1MGFXMWxRV04wYVc5dVB5NXJhVzVrUFQwOVlITjFZbUZuWlc1MExXTmhiR3hnUDN0allXeHNTV1E2WlM1MGIyOXNRMkZzYkM1MGIyOXNRMkZzYkVsa0xHUmxjMk55YVhCMGFXOXVPblF1WkdWelkzSnBjSFJwYjI0c2FXNXdkWFE2Y21WemIyeDJaVlJ2YjJ4RFlXeHNTVzV3ZFhSUFltcGxZM1FvWlM1MGIyOXNRMkZzYkM1cGJuQjFkQ3g3WTJGc2JFbGtPbVV1ZEc5dmJFTmhiR3d1ZEc5dmJFTmhiR3hKWkN4MGIyOXNUbUZ0WlRwbExuUnZiMnhEWVd4c0xuUnZiMnhPWVcxbGZTa3NhMmx1WkRwZ2MzVmlZV2RsYm5RdFkyRnNiR0FzYm1GdFpUcDBMbTVoYldVc2JtOWtaVWxrT25RdWNuVnVkR2x0WlVGamRHbHZiaTV1YjJSbFNXUXNjM1ZpWVdkbGJuUk9ZVzFsT25RdWNuVnVkR2x0WlVGamRHbHZiaTV6ZFdKaFoyVnVkRTVoYldWOU9uUS9MbkoxYm5ScGJXVkJZM1JwYjI0L0xtdHBibVE5UFQxZ2NtVnRiM1JsTFdGblpXNTBMV05oYkd4Z1AzdGpZV3hzU1dRNlpTNTBiMjlzUTJGc2JDNTBiMjlzUTJGc2JFbGtMR1JsYzJOeWFYQjBhVzl1T25RdVpHVnpZM0pwY0hScGIyNHNhVzV3ZFhRNmNtVnpiMngyWlZSdmIyeERZV3hzU1c1d2RYUlBZbXBsWTNRb1pTNTBiMjlzUTJGc2JDNXBibkIxZEN4N1kyRnNiRWxrT21VdWRHOXZiRU5oYkd3dWRHOXZiRU5oYkd4SlpDeDBiMjlzVG1GdFpUcGxMblJ2YjJ4RFlXeHNMblJ2YjJ4T1lXMWxmU2tzYTJsdVpEcGdjbVZ0YjNSbExXRm5aVzUwTFdOaGJHeGdMRzVoYldVNmRDNXVZVzFsTEc1dlpHVkpaRHAwTG5KMWJuUnBiV1ZCWTNScGIyNHVibTlrWlVsa0xISmxiVzkwWlVGblpXNTBUbUZ0WlRwMExuSjFiblJwYldWQlkzUnBiMjR1Y21WdGIzUmxRV2RsYm5ST1lXMWxQejkwTG01aGJXVjlPbnRqWVd4c1NXUTZaUzUwYjI5c1EyRnNiQzUwYjI5c1EyRnNiRWxrTEdsdWNIVjBPbkpsYzI5c2RtVlViMjlzUTJGc2JFbHVjSFYwVDJKcVpXTjBLR1V1ZEc5dmJFTmhiR3d1YVc1d2RYUXNlMk5oYkd4SlpEcGxMblJ2YjJ4RFlXeHNMblJ2YjJ4RFlXeHNTV1FzZEc5dmJFNWhiV1U2WlM1MGIyOXNRMkZzYkM1MGIyOXNUbUZ0WlgwcExHdHBibVE2WUhSdmIyd3RZMkZzYkdBc2RHOXZiRTVoYldVNlpTNTBiMjlzUTJGc2JDNTBiMjlzVG1GdFpYMTlablZ1WTNScGIyNGdjbVZ6YjJ4MlpWUnZiMnhEWVd4c1NXNXdkWFJQWW1wbFkzUW9aU3h1S1h0cFppaGxQVDF1ZFd4c0tYSmxkSFZ5Ym50OU8zUnllWHR5WlhSMWNtNGdjR0Z5YzJWS2MyOXVUMkpxWldOMEtHVXBmV05oZEdOb0tHVXBlMnhsZENCMFBXVWdhVzV6ZEdGdVkyVnZaaUJGY25KdmNqOWxMbTFsYzNOaFoyVTZVM1J5YVc1bktHVXBPM1JvY205M0lGUjVjR1ZGY25KdmNpaGdSbUZwYkdWa0lIUnZJSEJoY25ObElIUnZiMnd0WTJGc2JDQmhjbWQxYldWdWRITWdabTl5SUZ3aUpIdHVMblJ2YjJ4T1lXMWxmVndpSUNna2UyNHVZMkZzYkVsa2ZTazZJQ1I3ZEgxZ0xIdGpZWFZ6WlRwbGZTbDlmV1oxYm1OMGFXOXVJSFJ2Vkc5dmJGSmxjM1ZzZEU5MWRIQjFkQ2hsS1h0eVpYUjFjbTRnZEhsd1pXOW1JR1V1YjNWMGNIVjBQVDFnYzNSeWFXNW5ZRDlsTG1selJYSnliM0k5UFQwaE1EOTdkSGx3WlRwZ1pYSnliM0l0ZEdWNGRHQXNkbUZzZFdVNlpTNXZkWFJ3ZFhSOU9udDBlWEJsT21CMFpYaDBZQ3gyWVd4MVpUcGxMbTkxZEhCMWRIMDZaUzVwYzBWeWNtOXlQVDA5SVRBL2UzUjVjR1U2WUdWeWNtOXlMV3B6YjI1Z0xIWmhiSFZsT25SdlRYVjBZV0pzWlVwemIyNVdZV3gxWlNobExtOTFkSEIxZENsOU9udDBlWEJsT21CcWMyOXVZQ3gyWVd4MVpUcDBiMDExZEdGaWJHVktjMjl1Vm1Gc2RXVW9aUzV2ZFhSd2RYUXBmWDFtZFc1amRHbHZiaUIwYjAxMWRHRmliR1ZLYzI5dVZtRnNkV1VvWlNsN2FXWW9aVDA5UFc1MWJHeDhmSFI1Y0dWdlppQmxQVDFnYzNSeWFXNW5ZSHg4ZEhsd1pXOW1JR1U5UFdCdWRXMWlaWEpnZkh4MGVYQmxiMllnWlQwOVlHSnZiMnhsWVc1Z0tYSmxkSFZ5YmlCbE8ybG1LRUZ5Y21GNUxtbHpRWEp5WVhrb1pTa3BjbVYwZFhKdUlHVXViV0Z3S0dVOVBuUnZUWFYwWVdKc1pVcHpiMjVXWVd4MVpTaGxLU2s3YkdWMElIUTllMzA3Wm05eUtHeGxkRnR1TEhKZGIyWWdUMkpxWldOMExtVnVkSEpwWlhNb1pTa3BkRnR1WFQxMGIwMTFkR0ZpYkdWS2MyOXVWbUZzZFdVb2NpazdjbVYwZFhKdUlIUjlaWGh3YjNKMGUyTnNaV0Z5VUdWdVpHbHVaMUoxYm5ScGJXVkJZM1JwYjI1Q1lYUmphQ3hqY21WaGRHVlNkVzUwYVcxbFFXTjBhVzl1VW1WeGRXVnpkRVp5YjIxVWIyOXNRMkZzYkN4blpYUlFaVzVrYVc1blVuVnVkR2x0WlVGamRHbHZia0poZEdOb0xHaGhjMUJsYm1ScGJtZFNkVzUwYVcxbFFXTjBhVzl1UW1GMFkyZ3NjbVZqYjNKa1VHVnVaR2x1WjFOMVltRm5aVzUwUTJocGJHUlViMnRsYml4eVpYTnZiSFpsVUdWdVpHbHVaMUoxYm5ScGJXVkJZM1JwYjI1ekxISmxjMjlzZG1WU2RXNTBhVzFsUVdOMGFXOXVVbVZ6ZFd4MGMwWnZja3RsZVhNc2NtVnpiMngyWlZSdmIyeERZV3hzU1c1d2RYUlBZbXBsWTNRc2MyVjBVR1Z1WkdsdVoxSjFiblJwYldWQlkzUnBiMjVDWVhSamFIMDdJaXdpTHlvcVgxOXBiblJsY201aGJGOTNiM0pyWm14dmQzTjdYQ0p6ZEdWd2Mxd2lPbnRjSW1ScGMzUXZjM0pqTDJWNFpXTjFkR2x2Ymk5a2FYTndZWFJqYUMxeWRXNTBhVzFsTFdGamRHbHZibk10YzNSbGNDNXFjMXdpT250Y0ltUnBjM0JoZEdOb1VuVnVkR2x0WlVGamRHbHZibk5UZEdWd1hDSTZlMXdpYzNSbGNFbGtYQ0k2WENKemRHVndMeTlsZG1WQU1DNHhOaTR5THk5a2FYTndZWFJqYUZKMWJuUnBiV1ZCWTNScGIyNXpVM1JsY0Z3aWZYMTlmU292TzF4dVpYaHdiM0owSUhaaGNpQmthWE53WVhSamFGSjFiblJwYldWQlkzUnBiMjV6VTNSbGNDQTlJR2RzYjJKaGJGUm9hWE5iVTNsdFltOXNMbVp2Y2loY0lsZFBVa3RHVEU5WFgxVlRSVjlUVkVWUVhDSXBYU2hjSW5OMFpYQXZMMlYyWlVBd0xqRTJMakl2TDJScGMzQmhkR05vVW5WdWRHbHRaVUZqZEdsdmJuTlRkR1Z3WENJcE8xeHVJaXdpWm5WdVkzUnBiMjRnY21WemIyeDJaVlpsY21ObGJGQnliMlIxWTNScGIyNURZV3hzWW1GamEwSmhjMlZWY213b0tYdHlaWFIxY200Z2NISnZZMlZ6Y3k1bGJuWXVWa1ZTUTBWTVgwVk9WajA5UFdCd2NtOWtkV04wYVc5dVlDWW1jSEp2WTJWemN5NWxibll1VmtWU1EwVk1YMUJTVDBwRlExUmZVRkpQUkZWRFZFbFBUbDlWVWt3L1lHaDBkSEJ6T2k4dkpIdHdjbTlqWlhOekxtVnVkaTVXUlZKRFJVeGZVRkpQU2tWRFZGOVFVazlFVlVOVVNVOU9YMVZTVEgxZ09tNTFiR3g5Wm5WdVkzUnBiMjRnY21WemIyeDJaVmR2Y210bWJHOTNRMkZzYkdKaFkydENZWE5sVlhKc0tHVXBlMnhsZENCMFBYQnliMk5sYzNNdVpXNTJMbGRQVWt0R1RFOVhYMHhQUTBGTVgwSkJVMFZmVlZKTVB5NTBjbWx0S0NsOGZIWnZhV1FnTUR0eVpYUjFjbTRvY21WemIyeDJaVlpsY21ObGJGQnliMlIxWTNScGIyNURZV3hzWW1GamEwSmhjMlZWY213b0tUOC9kRDgvWlNrdWNtVndiR0ZqWlNndlhGd3ZKQzhzWUdBcGZXWjFibU4wYVc5dUlHTnlaV0YwWlZkdmNtdG1iRzkzUTJGc2JHSmhZMnRWY213b1pTeDBLWHRzWlhRZ2JqMXVaWGNnVlZKTUtIUXNaU2tzY2oxd2NtOWpaWE56TG1WdWRpNVdSVkpEUlV4ZlFWVlVUMDFCVkVsUFRsOUNXVkJCVTFOZlUwVkRVa1ZVUHk1MGNtbHRLQ2s3Y21WMGRYSnVJSEltSm00dWMyVmhjbU5vVUdGeVlXMXpMbk5sZENoZ2VDMTJaWEpqWld3dGNISnZkR1ZqZEdsdmJpMWllWEJoYzNOZ0xISXBMRzR1ZEc5VGRISnBibWNvS1gxbGVIQnZjblI3WTNKbFlYUmxWMjl5YTJac2IzZERZV3hzWW1GamExVnliQ3h5WlhOdmJIWmxWbVZ5WTJWc1VISnZaSFZqZEdsdmJrTmhiR3hpWVdOclFtRnpaVlZ5YkN4eVpYTnZiSFpsVjI5eWEyWnNiM2REWVd4c1ltRmphMEpoYzJWVmNteDlPeUlzSWk4cUtsOWZhVzUwWlhKdVlXeGZkMjl5YTJac2IzZHplMXdpYzNSbGNITmNJanA3WENKa2FYTjBMM055WXk5bGVHVmpkWFJwYjI0dmQyOXlhMlpzYjNjdGMzUmxjSE11YW5OY0lqcDdYQ0owZFhKdVUzUmxjRndpT250Y0luTjBaWEJKWkZ3aU9sd2ljM1JsY0M4dlpYWmxRREF1TVRZdU1pOHZkSFZ5YmxOMFpYQmNJbjBzWENKbGJXbDBWR1Z5YldsdVlXeFRaWE56YVc5dVJtRnBiSFZ5WlZOMFpYQmNJanA3WENKemRHVndTV1JjSWpwY0luTjBaWEF2TDJWMlpVQXdMakUyTGpJdkwyVnRhWFJVWlhKdGFXNWhiRk5sYzNOcGIyNUdZV2xzZFhKbFUzUmxjRndpZlN4Y0luSjFibEJ5YjNoNVNXNXdkWFJTWlhGMVpYTjBVM1JsY0Z3aU9udGNJbk4wWlhCSlpGd2lPbHdpYzNSbGNDOHZaWFpsUURBdU1UWXVNaTh2Y25WdVVISnZlSGxKYm5CMWRGSmxjWFZsYzNSVGRHVndYQ0o5TEZ3aWNtOTFkR1ZRY205NGFXVmtSR1ZzYVhabGNsTjBaWEJjSWpwN1hDSnpkR1Z3U1dSY0lqcGNJbk4wWlhBdkwyVjJaVUF3TGpFMkxqSXZMM0p2ZFhSbFVISnZlR2xsWkVSbGJHbDJaWEpUZEdWd1hDSjlMRndpWkdsemNHRjBZMmhVZFhKdVUzUmxjRndpT250Y0luTjBaWEJKWkZ3aU9sd2ljM1JsY0M4dlpYWmxRREF1TVRZdU1pOHZaR2x6Y0dGMFkyaFVkWEp1VTNSbGNGd2lmWDE5ZlNvdk8xeHVaWGh3YjNKMElIWmhjaUIwZFhKdVUzUmxjQ0E5SUdkc2IySmhiRlJvYVhOYlUzbHRZbTlzTG1admNpaGNJbGRQVWt0R1RFOVhYMVZUUlY5VFZFVlFYQ0lwWFNoY0luTjBaWEF2TDJWMlpVQXdMakUyTGpJdkwzUjFjbTVUZEdWd1hDSXBPMXh1Wlhod2IzSjBJSFpoY2lCbGJXbDBWR1Z5YldsdVlXeFRaWE56YVc5dVJtRnBiSFZ5WlZOMFpYQWdQU0JuYkc5aVlXeFVhR2x6VzFONWJXSnZiQzVtYjNJb1hDSlhUMUpMUmt4UFYxOVZVMFZmVTFSRlVGd2lLVjBvWENKemRHVndMeTlsZG1WQU1DNHhOaTR5THk5bGJXbDBWR1Z5YldsdVlXeFRaWE56YVc5dVJtRnBiSFZ5WlZOMFpYQmNJaWs3WEc1bGVIQnZjblFnZG1GeUlISjFibEJ5YjNoNVNXNXdkWFJTWlhGMVpYTjBVM1JsY0NBOUlHZHNiMkpoYkZSb2FYTmJVM2x0WW05c0xtWnZjaWhjSWxkUFVrdEdURTlYWDFWVFJWOVRWRVZRWENJcFhTaGNJbk4wWlhBdkwyVjJaVUF3TGpFMkxqSXZMM0oxYmxCeWIzaDVTVzV3ZFhSU1pYRjFaWE4wVTNSbGNGd2lLVHRjYm1WNGNHOXlkQ0IyWVhJZ2NtOTFkR1ZRY205NGFXVmtSR1ZzYVhabGNsTjBaWEFnUFNCbmJHOWlZV3hVYUdselcxTjViV0p2YkM1bWIzSW9YQ0pYVDFKTFJreFBWMTlWVTBWZlUxUkZVRndpS1Ywb1hDSnpkR1Z3THk5bGRtVkFNQzR4Tmk0eUx5OXliM1YwWlZCeWIzaHBaV1JFWld4cGRtVnlVM1JsY0Z3aUtUdGNibVY0Y0c5eWRDQjJZWElnWkdsemNHRjBZMmhVZFhKdVUzUmxjQ0E5SUdkc2IySmhiRlJvYVhOYlUzbHRZbTlzTG1admNpaGNJbGRQVWt0R1RFOVhYMVZUUlY5VFZFVlFYQ0lwWFNoY0luTjBaWEF2TDJWMlpVQXdMakUyTGpJdkwyUnBjM0JoZEdOb1ZIVnlibE4wWlhCY0lpazdYRzRpTENKamIyNXpkQ0JYVDFKTFJreFBWMTlEVDA1VVJWaFVYMU5aVFVKUFREMVRlVzFpYjJ3dVptOXlLR0JYVDFKTFJreFBWMTlEVDA1VVJWaFVZQ2tzVjA5U1MwWk1UMWRmUTFKRlFWUkZYMGhQVDBzOVUzbHRZbTlzTG1admNpaGdWMDlTUzBaTVQxZGZRMUpGUVZSRlgwaFBUMHRnS1N4WFQxSkxSa3hQVjE5SFJWUmZVMVJTUlVGTlgwbEVQVk41YldKdmJDNW1iM0lvWUZkUFVrdEdURTlYWDBkRlZGOVRWRkpGUVUxZlNVUmdLU3hYVDFKTFJreFBWMTlWVTBWZlUxUkZVRDFUZVcxaWIyd3VabTl5S0dCWFQxSkxSa3hQVjE5VlUwVmZVMVJGVUdBcExGTlVVa1ZCVFY5T1FVMUZYMU5aVFVKUFREMVRlVzFpYjJ3dVptOXlLR0JYVDFKTFJreFBWMTlUVkZKRlFVMWZUa0ZOUldBcExIZHZjbXRtYkc5M1IyeHZZbUZzUFdkc2IySmhiRlJvYVhNN2RtRnlJRkpsZEhKNVlXSnNaVVZ5Y205eVBXTnNZWE56SUdWNGRHVnVaSE1nUlhKeWIzSjdmU3hHWVhSaGJFVnljbTl5UFdOc1lYTnpJR1Y0ZEdWdVpITWdSWEp5YjNKN2ZUdG1kVzVqZEdsdmJpQmpjbVZoZEdWSWIyOXJLR1VwZTJ4bGRDQnVQWGR2Y210bWJHOTNSMnh2WW1Gc1cxZFBVa3RHVEU5WFgwTlNSVUZVUlY5SVQwOUxYVHRwWmlodVBUMDlkbTlwWkNBd0tYUm9jbTkzSUVWeWNtOXlLRndpWUdOeVpXRjBaVWh2YjJzb0tXQWdZMkZ1SUc5dWJIa2dZbVVnWTJGc2JHVmtJR2x1YzJsa1pTQmhJSGR2Y210bWJHOTNJR1oxYm1OMGFXOXVYQ0lwTzNKbGRIVnliaUJ1S0dVcGZXWjFibU4wYVc5dUlHZGxkRmR2Y210bWJHOTNUV1YwWVdSaGRHRW9LWHRzWlhRZ2REMTNiM0pyWm14dmQwZHNiMkpoYkZ0WFQxSkxSa3hQVjE5RFQwNVVSVmhVWDFOWlRVSlBURjA3YVdZb2REMDlQWFp2YVdRZ01DbDBhSEp2ZHlCRmNuSnZjaWhjSW1CblpYUlhiM0pyWm14dmQwMWxkR0ZrWVhSaEtDbGdJR05oYmlCdmJteDVJR0psSUdOaGJHeGxaQ0JwYm5OcFpHVWdZU0IzYjNKclpteHZkeUJ2Y2lCemRHVndJR1oxYm1OMGFXOXVYQ0lwTzNKbGRIVnliaUIwZldaMWJtTjBhVzl1SUdkbGRGZHlhWFJoWW14bEtHVTllMzBwZTJ4bGRDQjBQWGR2Y210bWJHOTNSMnh2WW1Gc1cxZFBVa3RHVEU5WFgwZEZWRjlUVkZKRlFVMWZTVVJkTzJsbUtIUTlQVDEyYjJsa0lEQXBkR2h5YjNjZ1JYSnliM0lvWENKZ1oyVjBWM0pwZEdGaWJHVW9LV0FnWTJGdUlHOXViSGtnWW1VZ1kyRnNiR1ZrSUdsdWMybGtaU0JoSUhkdmNtdG1iRzkzSUdaMWJtTjBhVzl1WENJcE8yeGxkQ0J5UFhRb1pTNXVZVzFsYzNCaFkyVXBPM0psZEhWeWJpQlBZbXBsWTNRdVkzSmxZWFJsS0dkc2IySmhiRlJvYVhNdVYzSnBkR0ZpYkdWVGRISmxZVzB1Y0hKdmRHOTBlWEJsTEh0YlUxUlNSVUZOWDA1QlRVVmZVMWxOUWs5TVhUcDdkbUZzZFdVNmNpeDNjbWwwWVdKc1pUb2hNWDE5S1gxbWRXNWpkR2x2YmlCamNtVmhkR1ZYWldKb2IyOXJLR1VwZTJ4bGRDQjBQV055WldGMFpVaHZiMnNvWlNrc2JqMW5aWFJYYjNKclpteHZkMDFsZEdGa1lYUmhLQ2s3Y21WMGRYSnVJSFF1ZFhKc1BXQWtlM1I1Y0dWdlppQnVMblZ5YkQwOVlITjBjbWx1WjJBL2JpNTFjbXc2WUdCOUx5NTNaV3hzTFd0dWIzZHVMM2R2Y210bWJHOTNMM1l4TDNkbFltaHZiMnN2Skh0bGJtTnZaR1ZWVWtsRGIyMXdiMjVsYm5Rb2RDNTBiMnRsYmlsOVlDeDBmV1oxYm1OMGFXOXVJR1JsWm1sdVpVaHZiMnNvS1h0eVpYUjFjbTU3WTNKbFlYUmxPbU55WldGMFpVaHZiMnNzY21WemRXMWxLQ2w3ZEdoeWIzY2dSWEp5YjNJb1hDSmdaR1ZtYVc1bFNHOXZheWdwTG5KbGMzVnRaU2dwWUNCallXNGdiMjVzZVNCaVpTQmpZV3hzWldRZ1puSnZiU0JsZUhSbGNtNWhiQ0JqYjI1MFpYaDBjeTVjSWlsOWZYMW1kVzVqZEdsdmJpQnpiR1ZsY0NncGUzUm9jbTkzSUVWeWNtOXlLRndpWUhOc1pXVndLQ2xnSUdseklHNXZkQ0JoZG1GcGJHRmliR1VnYVc0Z1pYWmxJSGR2Y210bWJHOTNJR0p2WkhrZ1luVnVaR3hsYzF3aUtYMW1kVzVqZEdsdmJpQnlaWE4xYldWSWIyOXJLQ2w3ZEdoeWIzY2dSWEp5YjNJb1hDSmdjbVZ6ZFcxbFNHOXZheWdwWUNCallXNGdiMjVzZVNCaVpTQmpZV3hzWldRZ1puSnZiU0J2ZFhSemFXUmxJR0VnZDI5eWEyWnNiM2NnWm5WdVkzUnBiMjVjSWlsOVpuVnVZM1JwYjI0Z1oyVjBVM1JsY0UxbGRHRmtZWFJoS0NsN2RHaHliM2NnUlhKeWIzSW9YQ0pnWjJWMFUzUmxjRTFsZEdGa1lYUmhLQ2xnSUdOaGJpQnZibXg1SUdKbElHTmhiR3hsWkNCcGJuTnBaR1VnWVNCemRHVndJR1oxYm1OMGFXOXVYQ0lwZldGemVXNWpJR1oxYm1OMGFXOXVJR1Y0Y0dWeWFXMWxiblJoYkY5elpYUkJkSFJ5YVdKMWRHVnpLR1VzZEQxN2ZTbDdiR1YwSUc0OVQySnFaV04wTG1WdWRISnBaWE1vWlNrN2FXWW9iaTVzWlc1bmRHZzlQVDB3S1hKbGRIVnlianRzWlhRZ2FUMTNiM0pyWm14dmQwZHNiMkpoYkZ0WFQxSkxSa3hQVjE5VlUwVmZVMVJGVUYwN2FXWW9hVDA5UFhadmFXUWdNQ2wwYUhKdmR5QkZjbkp2Y2loY0ltQmxlSEJsY21sdFpXNTBZV3hmYzJWMFFYUjBjbWxpZFhSbGN5Z3BZQ0JqWVc0Z2IyNXNlU0JpWlNCallXeHNaV1FnYVc1emFXUmxJR0VnZDI5eWEyWnNiM2NnY25WdWRHbHRaU0JqYjI1MFpYaDBYQ0lwTzJ4bGRDQmhQVzR1YldGd0tDaGJaU3gwWFNrOVBpaDdhMlY1T21Vc2RtRnNkV1U2ZEQwOVBYWnZhV1FnTUQ5dWRXeHNPblI5S1Nrc2J6MTBMbUZzYkc5M1VtVnpaWEoyWldSQmRIUnlhV0oxZEdWelBUMDlJVEEvZTJGc2JHOTNVbVZ6WlhKMlpXUkJkSFJ5YVdKMWRHVnpPaUV3ZlRwN2ZUdGhkMkZwZENCcEtHQmZYMkoxYVd4MGFXNWZjMlYwWDJGMGRISnBZblYwWlhOZ0tTaGhMRzhwZldWNGNHOXlkSHRHWVhSaGJFVnljbTl5TEZKbGRISjVZV0pzWlVWeWNtOXlMR055WldGMFpVaHZiMnNzWTNKbFlYUmxWMlZpYUc5dmF5eGtaV1pwYm1WSWIyOXJMR1Y0Y0dWeWFXMWxiblJoYkY5elpYUkJkSFJ5YVdKMWRHVnpMR2RsZEZOMFpYQk5aWFJoWkdGMFlTeG5aWFJYYjNKclpteHZkMDFsZEdGa1lYUmhMR2RsZEZkeWFYUmhZbXhsTEhKbGMzVnRaVWh2YjJzc2MyeGxaWEI5T3lJc0ltRnplVzVqSUdaMWJtTjBhVzl1SUdOc1lXbHRTRzl2YTA5M2JtVnljMmhwY0NobEtYdHNaWFFnZER0MGNubDdkRDFoZDJGcGRDQmxMbWRsZEVOdmJtWnNhV04wS0NsOVkyRjBZMmdvZENsN2NtVjBkWEp1SUdGM1lXbDBJR1JwYzNCdmMyVkJibVJVYUhKdmR5aGxMRzV2Y20xaGJHbDZaVWh2YjJ0RGJHRnBiVVZ5Y205eUtIUXNaUzUwYjJ0bGJpa3BmV2xtS0hRaFBUMXVkV3hzS1hKbGRIVnliaUJoZDJGcGRDQmthWE53YjNObFFXNWtWR2h5YjNjb1pTeGpjbVZoZEdWSWIyOXJRMjl1Wm14cFkzUkZjbkp2Y2lobExuUnZhMlZ1TEhRdWNuVnVTV1FwS1gxaGMzbHVZeUJtZFc1amRHbHZiaUJqYkc5elpVaHZiMnRKZEdWeVlYUnZjaWhsS1h0MGVYQmxiMllnWlM1eVpYUjFjbTQ5UFdCbWRXNWpkR2x2Ym1BbUptRjNZV2wwSUdVdWNtVjBkWEp1S0hadmFXUWdNQ2w5WVhONWJtTWdablZ1WTNScGIyNGdaR2x6Y0c5elpVaHZiMnNvWlNsN2JHVjBJSFE5WlM1a2FYTndiM05sTzJsbUtIUjVjR1Z2WmlCMFBUMWdablZ1WTNScGIyNWdLWHRoZDJGcGRDQjBMbU5oYkd3b1pTazdjbVYwZFhKdWZXeGxkQ0J1UFdWYlUzbHRZbTlzTG1ScGMzQnZjMlZkTzNSNWNHVnZaaUJ1UFQxZ1puVnVZM1JwYjI1Z0ppWmhkMkZwZENCdUxtTmhiR3dvWlNsOVlYTjVibU1nWm5WdVkzUnBiMjRnWkdsemNHOXpaVUZ1WkZSb2NtOTNLR1VzZENsN2RISjVlMkYzWVdsMElHUnBjM0J2YzJWSWIyOXJLR1VwZldOaGRHTm9lMzEwYUhKdmR5QjBmV1oxYm1OMGFXOXVJRzV2Y20xaGJHbDZaVWh2YjJ0RGJHRnBiVVZ5Y205eUtHVXNkQ2w3Y21WMGRYSnVJR2x6U0c5dmEwTnZibVpzYVdOMFJYSnliM0lvWlNrL1kzSmxZWFJsU0c5dmEwTnZibVpzYVdOMFJYSnliM0lvZEhsd1pXOW1JR1V1ZEc5clpXNDlQV0J6ZEhKcGJtZGdQMlV1ZEc5clpXNDZkQ3gwZVhCbGIyWWdaUzVqYjI1bWJHbGpkR2x1WjFKMWJrbGtQVDFnYzNSeWFXNW5ZRDlsTG1OdmJtWnNhV04wYVc1blVuVnVTV1E2ZG05cFpDQXdLVHBsZldaMWJtTjBhVzl1SUdselNHOXZhME52Ym1ac2FXTjBSWEp5YjNJb1pTbDdjbVYwZFhKdUlIUjVjR1Z2WmlCbFBUMWdiMkpxWldOMFlDWW1JU0ZsSmlaZ2JtRnRaV0JwYmlCbEppWmxMbTVoYldVOVBUMWdTRzl2YTBOdmJtWnNhV04wUlhKeWIzSmdmV1oxYm1OMGFXOXVJR055WldGMFpVaHZiMnREYjI1bWJHbGpkRVZ5Y205eUtHVXNkQ2w3YkdWMElHNDlkRDA5UFhadmFXUWdNRDlnWURwZ0lDaHlkVzRnWENJa2UzUjlYQ0lwWUR0eVpYUjFjbTRnVDJKcVpXTjBMbUZ6YzJsbmJpaEZjbkp2Y2loZ1NHOXZheUIwYjJ0bGJpQmNJaVI3WlgxY0lpQnBjeUJoYkhKbFlXUjVJR2x1SUhWelpTUjdibjFnS1N4N1kyOXVabXhwWTNScGJtZFNkVzVKWkRwMExHNWhiV1U2WUVodmIydERiMjVtYkdsamRFVnljbTl5WUN4MGIydGxianBsZlNsOVpYaHdiM0owZTJOc1lXbHRTRzl2YTA5M2JtVnljMmhwY0N4amJHOXpaVWh2YjJ0SmRHVnlZWFJ2Y2l4a2FYTndiM05sU0c5dmF5eHBjMGh2YjJ0RGIyNW1iR2xqZEVWeWNtOXlmVHNpTENKbWRXNWpkR2x2YmlCdWIzSnRZV3hwZW1WVFpYSnBZV3hwZW1GaWJHVkZjbkp2Y2lobEtYdHlaWFIxY200Z1pTQnBibk4wWVc1alpXOW1JRVZ5Y205eVAzc3VMaTVQWW1wbFkzUXVabkp2YlVWdWRISnBaWE1vVDJKcVpXTjBMbVZ1ZEhKcFpYTW9aU2twTEdOaGRYTmxPbVV1WTJGMWMyVTlQVDEyYjJsa0lEQS9kbTlwWkNBd09tNXZjbTFoYkdsNlpWTmxjbWxoYkdsNllXSnNaVVZ5Y205eUtHVXVZMkYxYzJVcExHMWxjM05oWjJVNlpTNXRaWE56WVdkbExHNWhiV1U2WlM1dVlXMWxMSE4wWVdOck9tVXVj", - "M1JoWTJ0OU9tVjlablZ1WTNScGIyNGdjbVZpZFdsc1pGTmxjbWxoYkdsNllXSnNaVVZ5Y205eUtHVXBlMmxtS0NGcGMxSmxZMjl5WkNobEtTbHlaWFIxY200Z1JYSnliM0lvVTNSeWFXNW5LR1VwS1R0c1pYUWdkRDEwZVhCbGIyWWdaUzV0WlhOellXZGxQVDFnYzNSeWFXNW5ZRDlsTG0xbGMzTmhaMlU2VTNSeWFXNW5LR1VwTEc0OVJYSnliM0lvZENrN2RIbHdaVzltSUdVdWJtRnRaVDA5WUhOMGNtbHVaMkFtSmlodUxtNWhiV1U5WlM1dVlXMWxLU3gwZVhCbGIyWWdaUzV6ZEdGamF6MDlZSE4wY21sdVoyQW1KaWh1TG5OMFlXTnJQV1V1YzNSaFkyc3BMR0JqWVhWelpXQnBiaUJsSmlZb2JpNWpZWFZ6WlQxcGMxSmxZMjl5WkNobExtTmhkWE5sS1Q5eVpXSjFhV3hrVTJWeWFXRnNhWHBoWW14bFJYSnliM0lvWlM1allYVnpaU2s2WlM1allYVnpaU2s3YkdWMElISTlianRtYjNJb2JHVjBXM1FzYmwxdlppQlBZbXBsWTNRdVpXNTBjbWxsY3lobEtTbDBQVDA5WUcxbGMzTmhaMlZnZkh4MFBUMDlZRzVoYldWZ2ZIeDBQVDA5WUhOMFlXTnJZSHg4ZEQwOVBXQmpZWFZ6WldCOGZDaHlXM1JkUFc0cE8zSmxkSFZ5YmlCdWZXWjFibU4wYVc5dUlHbHpVbVZqYjNKa0tHVXBlM0psZEhWeWJpQjBlWEJsYjJZZ1pUMDlZRzlpYW1WamRHQW1KaUVoWlgxbGVIQnZjblI3Ym05eWJXRnNhWHBsVTJWeWFXRnNhWHBoWW14bFJYSnliM0lzY21WaWRXbHNaRk5sY21saGJHbDZZV0pzWlVWeWNtOXlmVHNpTENJdktpcGZYMmx1ZEdWeWJtRnNYM2R2Y210bWJHOTNjM3RjSW5OMFpYQnpYQ0k2ZTF3aVpHbHpkQzl6Y21NdlpYaGxZM1YwYVc5dUwzUjFjbTR0WTI5dWRISnZiQzF3Y205MGIyTnZiQzVxYzF3aU9udGNJbk5sYm1SVWRYSnVRMjl1ZEhKdmJGTjBaWEJjSWpwN1hDSnpkR1Z3U1dSY0lqcGNJbk4wWlhBdkwyVjJaVUF3TGpFMkxqSXZMM05sYm1SVWRYSnVRMjl1ZEhKdmJGTjBaWEJjSW4xOWZYMHFMenRjYm1WNGNHOXlkQ0IyWVhJZ2MyVnVaRlIxY201RGIyNTBjbTlzVTNSbGNDQTlJR2RzYjJKaGJGUm9hWE5iVTNsdFltOXNMbVp2Y2loY0lsZFBVa3RHVEU5WFgxVlRSVjlUVkVWUVhDSXBYU2hjSW5OMFpYQXZMMlYyWlVBd0xqRTJMakl2TDNObGJtUlVkWEp1UTI5dWRISnZiRk4wWlhCY0lpazdYRzRpTENJdktpcGZYMmx1ZEdWeWJtRnNYM2R2Y210bWJHOTNjM3RjSW5OMFpYQnpYQ0k2ZTF3aVpHbHpkQzl6Y21NdlpYaGxZM1YwYVc5dUwyUnBjM0JoZEdOb0xYZHZjbXRtYkc5M0xYSjFiblJwYldVdFlXTjBhVzl1Y3kxemRHVndMbXB6WENJNmUxd2laR2x6Y0dGMFkyaFhiM0pyWm14dmQxSjFiblJwYldWQlkzUnBiMjV6VTNSbGNGd2lPbnRjSW5OMFpYQkpaRndpT2x3aWMzUmxjQzh2WlhabFFEQXVNVFl1TWk4dlpHbHpjR0YwWTJoWGIzSnJabXh2ZDFKMWJuUnBiV1ZCWTNScGIyNXpVM1JsY0Z3aWZYMTlmU292TzF4dVpYaHdiM0owSUhaaGNpQmthWE53WVhSamFGZHZjbXRtYkc5M1VuVnVkR2x0WlVGamRHbHZibk5UZEdWd0lEMGdaMnh2WW1Gc1ZHaHBjMXRUZVcxaWIyd3VabTl5S0Z3aVYwOVNTMFpNVDFkZlZWTkZYMU5VUlZCY0lpbGRLRndpYzNSbGNDOHZaWFpsUURBdU1UWXVNaTh2WkdsemNHRjBZMmhYYjNKclpteHZkMUoxYm5ScGJXVkJZM1JwYjI1elUzUmxjRndpS1R0Y2JpSXNJbVoxYm1OMGFXOXVJSEoxYmsxcFozSmhkR2x2YmtOb1lXbHVLR1VwZTJsbUtIUjVjR1Z2WmlCbExuWmhiSFZsSVQxZ2IySnFaV04wWUh4OFpTNTJZV3gxWlQwOVBXNTFiR3dwZEdoeWIzY2dSWEp5YjNJb1lDUjdaUzVzWVdKbGJIMDZJSFpoYkhWbElHaGhjeUJ1YnlCdWRXMWxjbWxqSUZ3aWRtVnljMmx2Ymx3aUlHWnBaV3hrTG1BcE8yeGxkQ0IwUFdVdWRtRnNkV1V1ZG1WeWMybHZiaXh1TzJsbUtIUjVjR1Z2WmlCMFBUMWdiblZ0WW1WeVlDbHVQV1V1ZG1Gc2RXVTdaV3h6WlNCcFppZ2hLR0IyWlhKemFXOXVZR2x1SUdVdWRtRnNkV1VwSmlabExtbHVhWFJwWVd4V1pYSnphVzl1SVQwOWRtOXBaQ0F3S1c0OWV5NHVMbVV1ZG1Gc2RXVXNkbVZ5YzJsdmJqcGxMbWx1YVhScFlXeFdaWEp6YVc5dWZUdGxiSE5sSUhSb2NtOTNJRVZ5Y205eUtHQWtlMlV1YkdGaVpXeDlPaUIyWVd4MVpTQm9ZWE1nYm04Z2JuVnRaWEpwWXlCY0luWmxjbk5wYjI1Y0lpQm1hV1ZzWkM1Z0tUdHNaWFFnY2oxbExtbHVhWFJwWVd4V1pYSnphVzl1UHo4eE8ybG1LQ0ZPZFcxaVpYSXVhWE5KYm5SbFoyVnlLRzR1ZG1WeWMybHZiaWw4Zkc0dWRtVnljMmx2Ymp4eUtYUm9jbTkzSUVWeWNtOXlLR0FrZTJVdWJHRmlaV3g5T2lCMlpYSnphVzl1SUNSN2JpNTJaWEp6YVc5dWZTQnBjeUJ1YjNRZ1lTQndiM05wZEdsMlpTQnBiblJsWjJWeUxtQXBPMmxtS0c0dWRtVnljMmx2Ymo1bExuUmhjbWRsZEZabGNuTnBiMjRwZEdoeWIzY2dSWEp5YjNJb1lDUjdaUzVzWVdKbGJIMDZJR1Z1WTI5MWJuUmxjbVZrSUhabGNuTnBiMjRnSkh0dUxuWmxjbk5wYjI1OUxDQjNhR2xqYUNCcGN5QnVaWGRsY2lCMGFHRnVJSFJvWlNCemRYQndiM0owWldRZ2RtVnljMmx2YmlBa2UyVXVkR0Z5WjJWMFZtVnljMmx2Ym4wdUlGUm9hWE1nZFhOMVlXeHNlU0JwYm1ScFkyRjBaWE1nZEdobElIZHBjbVVnZDJGeklIZHlhWFIwWlc0Z1lua2dZU0J1WlhkbGNpQmxkbVVnWkdWd2JHOTViV1Z1ZENCMGFHRnVJSFJvWlNCdmJtVWdjbVZoWkdsdVp5QnBkQzVnS1R0bWIzSW9PMjR1ZG1WeWMybHZianhsTG5SaGNtZGxkRlpsY25OcGIyNDdLWHRzWlhRZ2REMWxMbTFwWjNKaGRHbHZibk11Wm1sdVpDaGxQVDVsTG1aeWIyMDlQVDF1TG5abGNuTnBiMjRwTzJsbUtDRjBLWFJvY205M0lFVnljbTl5S0dBa2UyVXViR0ZpWld4OU9pQnVieUJ0YVdkeVlYUnBiMjRnY21WbmFYTjBaWEpsWkNCbWIzSWdkbVZ5YzJsdmJpQWtlMjR1ZG1WeWMybHZibjBnNG9hU0lDUjdiaTUyWlhKemFXOXVLekY5TG1BcE8ybG1LSFF1ZEc4aFBUMTBMbVp5YjIwck1TbDBhSEp2ZHlCRmNuSnZjaWhnSkh0bExteGhZbVZzZlRvZ2JXbG5jbUYwYVc5dUlDUjdkQzVtY205dGZTRGlocElnSkh0MExuUnZmU0J0ZFhOMElITjBaWEFnWlhoaFkzUnNlU0J2Ym1VZ2RtVnljMmx2YmlCaGRDQmhJSFJwYldVdVlDazdiR1YwSUhJOWRDNXRhV2R5WVhSbEtHNHBPMmxtS0hJdWRtVnljMmx2YmlFOVBYUXVkRzhwZEdoeWIzY2dSWEp5YjNJb1lDUjdaUzVzWVdKbGJIMDZJRzFwWjNKaGRHbHZiaUFrZTNRdVpuSnZiWDBnNG9hU0lDUjdkQzUwYjMwZ2NISnZaSFZqWldRZ1lTQjJZV3gxWlNCM2FYUm9JSFpsY25OcGIyNGdKSHR5TG5abGNuTnBiMjU5TG1BcE8yNDljbjF5WlhSMWNtNGdibjFsZUhCdmNuUjdjblZ1VFdsbmNtRjBhVzl1UTJoaGFXNTlPeUlzSW1OdmJuTjBJSFIxY201WGIzSnJabXh2ZDBsdWNIVjBWakJVYjFZeFBYdG1jbTl0T2pBc2JXbG5jbUYwWlNobEtYdHBaaWdoYVhOUWNtVldaWEp6YVc5dVZIVnlibGR2Y210bWJHOTNTVzV3ZFhRb1pTa3BkR2h5YjNjZ1JYSnliM0lvWUhSMWNtNGdkMjl5YTJac2IzY2dhVzV3ZFhRNklIWmxjbk5wYjI0Z01DQjJZV3gxWlNCcGN5QnViM1FnWVNCeVpXTnZaMjVwZW1Wa0lIQnlaUzEyWlhKemFXOXVJSE5vWVhCbExtQXBPM0psZEhWeWJudGpZWEJoWW1sc2FYUnBaWE02WlM1allYQmhZbWxzYVhScFpYTXNZMjl0Y0d4bGRHbHZibFJ2YTJWdU9tVXVZMjl0Y0d4bGRHbHZibFJ2YTJWdUxHMXZaR1U2WlM1dGIyUmxMSE4wWlhCSmJuQjFkRHA3YVc1d2RYUTZaUzVrWld4cGRtVnllU3h3WVhKbGJuUlhjbWwwWVdKc1pUcGxMbkJoY21WdWRGZHlhWFJoWW14bExITmxjbWxoYkdsNlpXUkRiMjUwWlhoME9tVXVjMlZ5YVdGc2FYcGxaRU52Ym5SbGVIUXNjMlZ6YzJsdmJsTjBZWFJsT21VdWMyVnpjMmx2YmxOMFlYUmxmU3gyWlhKemFXOXVPakY5ZlN4MGJ6b3hmVHRtZFc1amRHbHZiaUJwYzFCeVpWWmxjbk5wYjI1VWRYSnVWMjl5YTJac2IzZEpibkIxZENobEtYdHlaWFIxY200Z2RIbHdaVzltSUdVOVBXQnZZbXBsWTNSZ0ppWWhJV1VtSm1Ca1pXeHBkbVZ5ZVdCcGJpQmxmV1Y0Y0c5eWRIdDBkWEp1VjI5eWEyWnNiM2RKYm5CMWRGWXdWRzlXTVgwN0lpd2lhVzF3YjNKMGUzSjFiazFwWjNKaGRHbHZia05vWVdsdWZXWnliMjFjSWk0dlkyaGhhVzR1YW5OY0lqdHBiWEJ2Y25SN2RIVnlibGR2Y210bWJHOTNTVzV3ZFhSV01GUnZWakY5Wm5KdmJWd2lMaTkwZFhKdUxYZHZjbXRtYkc5M0xYWXdMWFJ2TFhZeExtcHpYQ0k3WTI5dWMzUWdWRlZTVGw5WFQxSkxSa3hQVjE5SlRsQlZWRjlXUlZKVFNVOU9QVEVzZEhWeWJsZHZjbXRtYkc5M1NXNXdkWFJOYVdkeVlYUnBiMjV6UFZ0MGRYSnVWMjl5YTJac2IzZEpibkIxZEZZd1ZHOVdNVjA3Wm5WdVkzUnBiMjRnWTNKbFlYUmxWSFZ5YmxkdmNtdG1iRzkzU1c1d2RYUW9aU2w3Y21WMGRYSnVlMk5oY0dGaWFXeHBkR2xsY3pwbExtTmhjR0ZpYVd4cGRHbGxjeXhqYjIxd2JHVjBhVzl1Vkc5clpXNDZaUzVqYjIxd2JHVjBhVzl1Vkc5clpXNHNaSEpwZG1WeVEyRndZV0pwYkdsMGFXVnpPbnQwZFhKdVNXNWliM2c2SVRCOUxHMXZaR1U2WlM1dGIyUmxMSE4wWlhCSmJuQjFkRHA3YVc1d2RYUTZaUzVrWld4cGRtVnllU3h3WVhKbGJuUlhjbWwwWVdKc1pUcGxMbkJoY21WdWRGZHlhWFJoWW14bExITmxjbWxoYkdsNlpXUkRiMjUwWlhoME9tVXVjMlZ5YVdGc2FYcGxaRU52Ym5SbGVIUXNjMlZ6YzJsdmJsTjBZWFJsT21VdWMyVnpjMmx2YmxOMFlYUmxmU3gyWlhKemFXOXVPakY5ZldaMWJtTjBhVzl1SUcxcFozSmhkR1ZVZFhKdVYyOXlhMlpzYjNkSmJuQjFkQ2gwS1h0eVpYUjFjbTRnY25WdVRXbG5jbUYwYVc5dVEyaGhhVzRvZTJsdWFYUnBZV3hXWlhKemFXOXVPakFzYkdGaVpXdzZZSFIxY200Z2QyOXlhMlpzYjNjZ2FXNXdkWFJnTEcxcFozSmhkR2x2Ym5NNmRIVnlibGR2Y210bWJHOTNTVzV3ZFhSTmFXZHlZWFJwYjI1ekxIUmhjbWRsZEZabGNuTnBiMjQ2TVN4MllXeDFaVHAwZlNsOVpYaHdiM0owZTFSVlVrNWZWMDlTUzBaTVQxZGZTVTVRVlZSZlZrVlNVMGxQVGl4amNtVmhkR1ZVZFhKdVYyOXlhMlpzYjNkSmJuQjFkQ3h0YVdkeVlYUmxWSFZ5YmxkdmNtdG1iRzkzU1c1d2RYUjlPeUlzSW1aMWJtTjBhVzl1SUdOdllXeGxjMk5sUkdWc2FYWmxjbEJoZVd4dllXUnpLR1VwZTJsbUtHVXViR1Z1WjNSb1BUMDlNQ2x5WlhSMWNtNTdmVHRwWmlobExteGxibWQwYUQwOVBURXBjbVYwZFhKdUlHVmJNRjAvUDN0OU8yeGxkQ0IwUFh0OUxHNDlXMTA3Wm05eUtHeGxkQ0J5SUc5bUlHVXBlMlp2Y2loc1pYUmJaU3h1WFc5bUlFOWlhbVZqZEM1bGJuUnlhV1Z6S0hJcEtXVWhQVDFnYVc1d2RYUlNaWE53YjI1elpYTmdKaVp1SVQwOWRtOXBaQ0F3SmlZb2RGdGxYVDF1S1R0eUxtbHVjSFYwVW1WemNHOXVjMlZ6SVQwOWRtOXBaQ0F3SmladUxuQjFjMmdvTGk0dWNpNXBibkIxZEZKbGMzQnZibk5sY3lsOWNtVjBkWEp1SUc0dWJHVnVaM1JvUGpBbUppaDBMbWx1Y0hWMFVtVnpjRzl1YzJWelBXNHBMSFI5Wlhod2IzSjBlMk52WVd4bGMyTmxSR1ZzYVhabGNsQmhlV3h2WVdSemZUc2lMQ0pwYlhCdmNuUjdZMjloYkdWelkyVkVaV3hwZG1WeVVHRjViRzloWkhOOVpuSnZiVndpSTJWNFpXTjFkR2x2Ymk5a1pXeHBkbVZ5TFhCaGVXeHZZV1J6TG1welhDSTdhVzF3YjNKMGUzSnZkWFJsVUhKdmVHbGxaRVJsYkdsMlpYSlRkR1Z3ZldaeWIyMWNJaU5sZUdWamRYUnBiMjR2ZDI5eWEyWnNiM2N0YzNSbGNITXVhbk5jSWp0aGMzbHVZeUJtZFc1amRHbHZiaUJ5YjNWMFpVUmxiR2wyWlhKVWIwTm9hV3hrY21WdUtHVXBlMnhsZENCMFBXTnZZV3hsYzJObFJHVnNhWFpsY2xCaGVXeHZZV1J6S0dVdWNHRjViRzloWkhNcE8zSmxkSFZ5YmlCbExuTmxjM05wYjI1VGRHRjBaUzVvWVhOUWNtOTRlVWx1Y0hWMFVtVnhkV1Z6ZEhNL0tHRjNZV2wwSUhKdmRYUmxVSEp2ZUdsbFpFUmxiR2wyWlhKVGRHVndLSHRoZFhSb09tVXVZWFYwYUN4d1lYSmxiblJYY21sMFlXSnNaVHBsTG5CaGNtVnVkRmR5YVhSaFlteGxMSEJoZVd4dllXUTZkQ3h6WlhOemFXOXVVM1JoZEdVNlpTNXpaWE56YVc5dVUzUmhkR1Y5S1NrdWNtVnRZV2x1WkdWeU9uUjlaWGh3YjNKMGUzSnZkWFJsUkdWc2FYWmxjbFJ2UTJocGJHUnlaVzU5T3lJc0ltbHRjRzl5ZEh0elpXNWtWSFZ5YmtOdmJuUnliMnhUZEdWd2ZXWnliMjFjSWlObGVHVmpkWFJwYjI0dmRIVnliaTFqYjI1MGNtOXNMWEJ5YjNSdlkyOXNMbXB6WENJN2RtRnlJRlIxY201RmVHVmpkWFJwYjI1RGRYSnpiM0k5WTJ4aGMzTjdZMjl1ZEhKdmJGUnZhMlZ1TzNCaGNtVnVkRmR5YVhSaFlteGxPMk4xY25KbGJuUlRaWEpwWVd4cGVtVmtRMjl1ZEdWNGREdGpkWEp5Wlc1MFUyVnpjMmx2YmxOMFlYUmxPMnhoYzNSU1pYQnZjblJsWkVOdmJuUnBiblZoZEdsdmJsUnZhMlZ1TzJOdmJuTjBjblZqZEc5eUtHVXBlM1JvYVhNdVkyOXVkSEp2YkZSdmEyVnVQV1V1WTI5dWRISnZiRlJ2YTJWdUxIUm9hWE11WTNWeWNtVnVkRk5sY21saGJHbDZaV1JEYjI1MFpYaDBQV1V1YzJWeWFXRnNhWHBsWkVOdmJuUmxlSFFzZEdocGN5NWpkWEp5Wlc1MFUyVnpjMmx2YmxOMFlYUmxQV1V1YzJWemMybHZibE4wWVhSbExIUm9hWE11YkdGemRGSmxjRzl5ZEdWa1EyOXVkR2x1ZFdGMGFXOXVWRzlyWlc0OVpTNXpaWE56YVc5dVUzUmhkR1V1WTI5dWRHbHVkV0YwYVc5dVZHOXJaVzRzZEdocGN5NXdZWEpsYm5SWGNtbDBZV0pzWlQxbExuQmhjbVZ1ZEZkeWFYUmhZbXhsZldkbGRDQnpaWEpwWVd4cGVtVmtRMjl1ZEdWNGRDZ3BlM0psZEhWeWJpQjBhR2x6TG1OMWNuSmxiblJUWlhKcFlXeHBlbVZrUTI5dWRHVjRkSDFuWlhRZ2MyVnpjMmx2YmxOMFlYUmxLQ2w3Y21WMGRYSnVJSFJvYVhNdVkzVnljbVZ1ZEZObGMzTnBiMjVUZEdGMFpYMWhjM2x1WXlCaFpHOXdkQ2hsS1h0MGFHbHpMbk5sZEZOMFlYUmxLR1VwTzJ4bGRDQjBQV1V1YzJWemMybHZibE4wWVhSbExtTnZiblJwYm5WaGRHbHZibFJ2YTJWdU8zUTlQVDFnWUh4OGREMDlQWFJvYVhNdWJHRnpkRkpsY0c5eWRHVmtRMjl1ZEdsdWRXRjBhVzl1Vkc5clpXNThmQ2gwYUdsekxteGhjM1JTWlhCdmNuUmxaRU52Ym5ScGJuVmhkR2x2YmxSdmEyVnVQWFFzWVhkaGFYUWdkR2hwY3k1elpXNWtLSHRqYjI1MGFXNTFZWFJwYjI1VWIydGxianAwTEd0cGJtUTZZSFIxY200dFkyOXVkR2x1ZFdGMGFXOXVMWFJ2YTJWdVlIMHBLWDFqY21WaGRHVlRkR1Z3U1c1d2RYUW9aU2w3Y21WMGRYSnVlMmx1Y0hWME9tVXNjR0Z5Wlc1MFYzSnBkR0ZpYkdVNmRHaHBjeTV3WVhKbGJuUlhjbWwwWVdKc1pTeHpaWEpwWVd4cGVtVmtRMjl1ZEdWNGREcDBhR2x6TG1OMWNuSmxiblJUWlhKcFlXeHBlbVZrUTI5dWRHVjRkQ3h6WlhOemFXOXVVM1JoZEdVNmRHaHBjeTVqZFhKeVpXNTBVMlZ6YzJsdmJsTjBZWFJsZlgxaGMzbHVZeUJtYVc1cGMyZ29aU3gwTEc0cGUzUm9hWE11YzJWMFUzUmhkR1VvWlNrc1lYZGhhWFFnZEdocGN5NXpaVzVrS0h0aFkzUnBiMjQ2ZXk0dUxuUXNjMlZ5YVdGc2FYcGxaRU52Ym5SbGVIUTZkR2hwY3k1amRYSnlaVzUwVTJWeWFXRnNhWHBsWkVOdmJuUmxlSFFzYzJWemMybHZibE4wWVhSbE9uUm9hWE11WTNWeWNtVnVkRk5sYzNOcGIyNVRkR0YwWlgwc1luVm1abVZ5WldSRVpXeHBkbVZ5YVdWek9tNHViR1Z1WjNSb1BUMDlNRDkyYjJsa0lEQTZXeTR1TG01ZExHdHBibVE2WUhSMWNtNHRjbVZ6ZFd4MFlIMHBmV0Z6ZVc1aklITmxibVFvZENsN1lYZGhhWFFnYzJWdVpGUjFjbTVEYjI1MGNtOXNVM1JsY0NoN1kyOXVkSEp2YkZSdmEyVnVPblJvYVhNdVkyOXVkSEp2YkZSdmEyVnVMSEJoZVd4dllXUTZkSDBwZlhObGRGTjBZWFJsS0dVcGUzUm9hWE11WTNWeWNtVnVkRk5sY21saGJHbDZaV1JEYjI1MFpYaDBQV1V1YzJWeWFXRnNhWHBsWkVOdmJuUmxlSFEvUDNSb2FYTXVZM1Z5Y21WdWRGTmxjbWxoYkdsNlpXUkRiMjUwWlhoMExIUm9hWE11WTNWeWNtVnVkRk5sYzNOcGIyNVRkR0YwWlQxbExuTmxjM05wYjI1VGRHRjBaWDE5TzJWNGNHOXlkSHRVZFhKdVJYaGxZM1YwYVc5dVEzVnljMjl5ZlRzaUxDSXZLaXBmWDJsdWRHVnlibUZzWDNkdmNtdG1iRzkzYzN0Y0luZHZjbXRtYkc5M2Mxd2lPbnRjSW1ScGMzUXZjM0pqTDJWNFpXTjFkR2x2Ymk5MGRYSnVMWGR2Y210bWJHOTNMbXB6WENJNmUxd2lkSFZ5YmxkdmNtdG1iRzkzWENJNmUxd2lkMjl5YTJac2IzZEpaRndpT2x3aWQyOXlhMlpzYjNjdkwyVjJaUzh2ZEhWeWJsZHZjbXRtYkc5M1hDSjlmWDE5S2k4N1hHNXBiWEJ2Y25SN2NtVnpiMngyWlZKMWJuUnBiV1ZCWTNScGIyNVNaWE4xYkhSelJtOXlTMlY1YzMxbWNtOXRYQ0lqYUdGeWJtVnpjeTl5ZFc1MGFXMWxMV0ZqZEdsdmJuTXVhbk5jSWp0cGJYQnZjblI3WkdsemNHRjBZMmhTZFc1MGFXMWxRV04wYVc5dWMxTjBaWEI5Wm5KdmJWd2lJMlY0WldOMWRHbHZiaTlrYVhOd1lYUmphQzF5ZFc1MGFXMWxMV0ZqZEdsdmJuTXRjM1JsY0M1cWMxd2lPMmx0Y0c5eWRIdHlaWE52YkhabFYyOXlhMlpzYjNkRFlXeHNZbUZqYTBKaGMyVlZjbXg5Wm5KdmJWd2lJMlY0WldOMWRHbHZiaTkzYjNKclpteHZkeTFqWVd4c1ltRmpheTExY213dWFuTmNJanRwYlhCdmNuUjdjblZ1VUhKdmVIbEpibkIxZEZKbGNYVmxjM1JUZEdWd0xIUjFjbTVUZEdWd2ZXWnliMjFjSWlObGVHVmpkWFJwYjI0dmQyOXlhMlpzYjNjdGMzUmxjSE11YW5OY0lqdHBiWEJ2Y25SN1kzSmxZWFJsU0c5dmF5eG5aWFJYYjNKclpteHZkMDFsZEdGa1lYUmhmV1p5YjIxY0lpTmpiMjF3YVd4bFpDOUFkMjl5YTJac2IzY3ZZMjl5WlM5cGJtUmxlQzVxYzF3aU8ybHRjRzl5ZEh0amJHRnBiVWh2YjJ0UGQyNWxjbk5vYVhBc1kyeHZjMlZJYjI5clNYUmxjbUYwYjNJc1pHbHpjRzl6WlVodmIyc3NhWE5JYjI5clEyOXVabXhwWTNSRmNuSnZjbjFtY205dFhDSWpaWGhsWTNWMGFXOXVMMmh2YjJzdGIzZHVaWEp6YUdsd0xtcHpYQ0k3YVcxd2IzSjBlMjV2Y20xaGJHbDZaVk5sY21saGJHbDZZV0pzWlVWeWNtOXlmV1p5YjIxY0lpTmxlR1ZqZFhScGIyNHZkMjl5YTJac2IzY3RaWEp5YjNKekxtcHpYQ0k3YVcxd2IzSjBlM05sYm1SVWRYSnVRMjl1ZEhKdmJGTjBaWEI5Wm5KdmJWd2lJMlY0WldOMWRHbHZiaTkwZFhKdUxXTnZiblJ5YjJ3dGNISnZkRzlqYjJ3dWFuTmNJanRwYlhCdmNuUjdaR2x6Y0dGMFkyaFhiM0pyWm14dmQxSjFiblJwYldWQlkzUnBiMjV6VTNSbGNIMW1jbTl0WENJalpYaGxZM1YwYVc5dUwyUnBjM0JoZEdOb0xYZHZjbXRtYkc5M0xYSjFiblJwYldVdFlXTjBhVzl1Y3kxemRHVndMbXB6WENJN2FXMXdiM0owZTIxcFozSmhkR1ZVZFhKdVYyOXlhMlpzYjNkSmJuQjFkSDFtY205dFhDSWpaWGhsWTNWMGFXOXVMMlIxY21GaWJHVXRjMlZ6YzJsdmJpMXRhV2R5WVhScGIyNXpMM1IxY200dGQyOXlhMlpzYjNjdWFuTmNJanRwYlhCdmNuUjdjbTkxZEdWRVpXeHBkbVZ5Vkc5RGFHbHNaSEpsYm4xbWNtOXRYQ0lqWlhobFkzVjBhVzl1TDNKdmRYUmxMV05vYVd4a0xXUmxiR2wyWlhKNUxtcHpYQ0k3YVcxd2IzSjBlMVIxY201RmVHVmpkWFJwYjI1RGRYSnpiM0o5Wm5KdmJWd2lJMlY0WldOMWRHbHZiaTkwZFhKdUxXVjRaV04xZEdsdmJpMWpkWEp6YjNJdWFuTmNJanRqYjI1emRDQlVRVk5MWDAxUFJFVmZWMEZKVkY5RlVsSlBVbDlOUlZOVFFVZEZQVndpVkdGemF5QnRiMlJsSUdOaGJtNXZkQ0IzWVdsMElHWnZjaUJtYjJ4c2IzY3RkWEFnYVc1d2RYUWdLR0J1WlhoME9pQnVkV3hzWUNrdVhDSTdZWE41Ym1NZ1puVnVZM1JwYjI0Z2RIVnlibGR2Y210bWJHOTNLR1VwZTJ4bGRDQjBQVzFwWjNKaGRHVlVkWEp1VjI5eWEyWnNiM2RKYm5CMWRDaGxLVHR5WlhSMWNtNGdkQzVrY21sMlpYSkRZWEJoWW1sc2FYUnBaWE0vTG5SMWNtNUpibUp2ZUQwOVBTRXdQM0oxYmxSMWNtNVBkMjVsWkZkdmNtdG1iRzkzS0hRcE9uSjFia3hsWjJGamVWUjFjbTVYYjNKclpteHZkeWgwS1gxaGMzbHVZeUJtZFc1amRHbHZiaUJ5ZFc1VWRYSnVUM2R1WldSWGIzSnJabXh2ZHlobEtYdHNaWFFnY2oxamNtVmhkR1ZJYjI5cktIdDBiMnRsYmpwZ0pIdGxMbU52YlhCc1pYUnBiMjVVYjJ0bGJuMDZhVzVpYjNoZ2ZTa3NZejF5VzFONWJXSnZiQzVoYzNsdVkwbDBaWEpoZEc5eVhTZ3BMR3c5Ym1WM0lGUjFjbTVGZUdWamRYUnBiMjVEZFhKemIzSW9lMk52Ym5SeWIyeFViMnRsYmpwbExtTnZiWEJzWlhScGIyNVViMnRsYml4d1lYSmxiblJYY21sMFlXSnNaVHBsTG5OMFpYQkpibkIxZEM1d1lYSmxiblJYY21sMFlXSnNaU3h6WlhKcFlXeHBlbVZrUTI5dWRHVjRkRHBsTG5OMFpYQkpibkIxZEM1elpYSnBZV3hwZW1Wa1EyOXVkR1Y0ZEN4elpYTnphVzl1VTNSaGRHVTZaUzV6ZEdWd1NXNXdkWFF1YzJWemMybHZibE4wWVhSbGZTa3NkVDB3TEc1bGVIUkVaV3hwZG1WeWVWSmxjWFZsYzNSSlpEMG9LVDArWUNSN2NpNTBiMnRsYm4wNlpHVnNhWFpsY25rNkpIdFRkSEpwYm1jb2RTc3JLWDFnTEdROVcxMHNaajFsTG5OMFpYQkpibkIxZEM1cGJuQjFkQ3h3UFNFeE8zUnllWHQwY25sN1lYZGhhWFFnWTJ4aGFXMUliMjlyVDNkdVpYSnphR2x3S0hJcExIQTlJVEI5WTJGMFkyZ29aU2w3YVdZb2FYTkliMjlyUTI5dVpteHBZM1JGY25KdmNpaGxLU2x5WlhSMWNtNDdkR2h5YjNjZ1pYMW1iM0lvT3pzcGUyeGxkQ0JoUFdGM1lXbDBJSFIxY201VGRHVndLR3d1WTNKbFlYUmxVM1JsY0VsdWNIVjBLR1lwS1R0cFppaGhMbUZqZEdsdmJqMDlQV0JrYjI1bFlDbDdZWGRoYVhRZ2JDNW1hVzVwYzJnb1lTeDdhMmx1WkRwZ1pHOXVaV0FzYjNWMGNIVjBPbUV1YjNWMGNIVjBQejlnWUN4cGMwVnljbTl5T21FdWFYTkZjbkp2Y24wc1pDazdjbVYwZFhKdWZXeGxkQ0J6UFdFdVlXTjBhVzl1UFQwOVlHUnBjM0JoZEdOb0xYZHZjbXRtYkc5M0xYSjFiblJwYldVdFlXTjBhVzl1YzJCOGZHRXVZV04wYVc5dVBUMDlZSEJoY210Z1AyRXVjR1Z1WkdsdVoxSjFiblJwYldWQlkzUnBiMjVMWlhsek9uWnZhV1FnTUR0cFppaHpJVDA5ZG05cFpDQXdLWHRoZDJGcGRDQnNMbUZrYjNCMEtHRXBPMnhsZENCbFBXRjNZV2wwS0dFdVlXTjBhVzl1UFQwOVlHUnBjM0JoZEdOb0xYZHZjbXRtYkc5M0xYSjFiblJwYldVdFlXTjBhVzl1YzJBL1pHbHpjR0YwWTJoWGIzSnJabXh2ZDFKMWJuUnBiV1ZCWTNScGIyNXpVM1JsY0Rwa2FYTndZWFJqYUZKMWJuUnBiV1ZCWTNScGIyNXpVM1JsY0Nrb2UyTmhiR3hpWVdOclFtRnpaVlZ5YkRweVpYTnZiSFpsVjI5eWEyWnNiM2REWVd4c1ltRmphMEpoYzJWVmNtd29aMlYwVjI5eWEyWnNiM2ROWlhSaFpHRjBZU2dwTG5WeWJDa3NjR0Z5Wlc1MFEyOXVkR2x1ZFdGMGFXOXVWRzlyWlc0NmNpNTBiMnRsYml4d1lYSmxiblJYY21sMFlXSnNaVHBzTG5CaGNtVnVkRmR5YVhSaFlteGxMSE5sY21saGJHbDZaV1JEYjI1MFpYaDBPbXd1YzJWeWFXRnNhWHBsWkVOdmJuUmxlSFFzYzJWemMybHZibE4wWVhSbE9td3VjMlZ6YzJsdmJsTjBZWFJsZlNrN1lYZGhhWFFnYkM1aFpHOXdkQ2hsS1N4bVBYdHJhVzVrT21CeWRXNTBhVzFsTFdGamRHbHZiaTF5WlhOMWJIUmdMSEpsYzNWc2RITTZZWGRoYVhRZ2QyRnBkRVp2Y2xKMWJuUnBiV1ZCWTNScGIyNVNaWE4xYkhSektIdGlkV1ptWlhKbFpFUmxiR2wyWlhKcFpYTTZaQ3hqZFhKemIzSTZiQ3hwYm1KdmVGUnZhMlZ1T25JdWRHOXJaVzRzYVc1cGRHbGhiRkpsYzNWc2RITTZaUzV5WlhOMWJIUnpMR2wwWlhKaGRHOXlPbU1zYm1WNGRFUmxiR2wyWlhKNVVtVnhkV1Z6ZEVsa0xIQmxibVJwYm1kQlkzUnBiMjVMWlhsek9uTjlLWDA3WTI5dWRHbHVkV1Y5YVdZb1lTNWhZM1JwYjI0OVBUMWdjR0Z5YTJBcGUybG1LQ0VvWVM1b1lYTlFaVzVrYVc1blFYVjBhRzl5YVhwaGRHbHZibng4WVM1b1lYTlFaVzVrYVc1blNXNXdkWFJDWVhSamFDWW1aUzVqWVhCaFltbHNhWFJwWlhNL0xuSmxjWFZsYzNSSmJuQjFkRDA5UFNFd2ZIeGxMbTF2WkdVOVBUMWdZMjl1ZG1WeWMyRjBhVzl1WUNrcGRHaHliM2NnUlhKeWIzSW9WRUZUUzE5TlQwUkZYMWRCU1ZSZlJWSlNUMUpmVFVWVFUwRkhSU2s3WVhkaGFYUWdiQzVtYVc1cGMyZ29ZU3g3WVhWMGFHOXlhWHBoZEdsdmJrNWhiV1Z6T21FdVlYVjBhRzl5YVhwaGRHbHZiazVoYldWekxHdHBibVE2WUhCaGNtdGdmU3hrS1R0eVpYUjFjbTU5WVhkaGFYUWdiQzVoWkc5d2RDaGhLU3htUFhadmFXUWdNSDE5WTJGMFkyZ29aU2w3ZEdoeWIzY2dZWGRoYVhRZ2JDNXpaVzVrS0h0bGNuSnZjanB1YjNKdFlXeHBlbVZUWlhKcFlXeHBlbUZpYkdWRmNuSnZjaWhsS1N4cmFXNWtPbUIwZFhKdUxXVnljbTl5WUgwcExHVjlabWx1WVd4c2VYdGhkMkZwZENCamJHOXpaVWh2YjJ0SmRHVnlZWFJ2Y2loaktTeHdKaVpoZDJGcGRDQmthWE53YjNObFNHOXZheWh5S1gxOVlYTjVibU1nWm5WdVkzUnBiMjRnZDJGcGRFWnZjbEoxYm5ScGJXVkJZM1JwYjI1U1pYTjFiSFJ6S0hRcGUyeGxkQ0J1TEdrOVd5NHVMblF1YVc1cGRHbGhiRkpsYzNWc2RITmRPMlp2Y2lnN095bDdiR1YwSUdFOWNtVnpiMngyWlZKMWJuUnBiV1ZCWTNScGIyNVNa", - "WE4xYkhSelJtOXlTMlY1Y3loN2NHVnVaR2x1WjB0bGVYTTZkQzV3Wlc1a2FXNW5RV04wYVc5dVMyVjVjeXh5WlhOMWJIUnpPbWw5S1R0cFppaGhJVDA5ZG05cFpDQXdLWEpsZEhWeWJpQnVJVDA5ZG05cFpDQXdKaVpoZDJGcGRDQjBMbU4xY25OdmNpNXpaVzVrS0h0cmFXNWtPbUIwZFhKdUxXUmxiR2wyWlhKNUxXTmhibU5sYkd4bFpHQXNjbVZ4ZFdWemRFbGtPbTU5S1N4aE8zUXVZM1Z5YzI5eUxuTmxjM05wYjI1VGRHRjBaUzVvWVhOUWNtOTRlVWx1Y0hWMFVtVnhkV1Z6ZEhNbUptNDlQVDEyYjJsa0lEQW1KaWh1UFhRdWJtVjRkRVJsYkdsMlpYSjVVbVZ4ZFdWemRFbGtLQ2tzWVhkaGFYUWdkQzVqZFhKemIzSXVjMlZ1WkNoN1kyOXVkR2x1ZFdGMGFXOXVWRzlyWlc0NmRDNWpkWEp6YjNJdWMyVnpjMmx2YmxOMFlYUmxMbU52Ym5ScGJuVmhkR2x2YmxSdmEyVnVMR2x1WW05NFZHOXJaVzQ2ZEM1cGJtSnZlRlJ2YTJWdUxHdHBibVE2WUhSMWNtNHRaR1ZzYVhabGNua3RjbVZ4ZFdWemRHQXNjbVZ4ZFdWemRFbGtPbTU5S1NrN2JHVjBJRzg5WVhkaGFYUWdkQzVwZEdWeVlYUnZjaTV1WlhoMEtDazdhV1lvYnk1a2IyNWxLWFJvY205M0lFVnljbTl5S0dCVWRYSnVJR2x1WW05NElHTnNiM05sWkNCaVpXWnZjbVVnY25WdWRHbHRaU0JoWTNScGIyNXpJR052YlhCc1pYUmxaQzVnS1R0c1pYUWdjejF2TG5aaGJIVmxPMmxtS0hNdWEybHVaRDA5UFdCeWRXNTBhVzFsTFdGamRHbHZiaTF5WlhOMWJIUmdLWHRwTG5CMWMyZ29MaTR1Y3k1eVpYTjFiSFJ6S1R0amIyNTBhVzUxWlgxcFppaHpMbXRwYm1ROVBUMWdjM1ZpWVdkbGJuUXRhVzV3ZFhRdGNtVnhkV1Z6ZEdBcGUyeGxkQ0JsUFdGM1lXbDBJSEoxYmxCeWIzaDVTVzV3ZFhSU1pYRjFaWE4wVTNSbGNDaDdhRzl2YTFCaGVXeHZZV1E2Y3l4d1lYSmxiblJYY21sMFlXSnNaVHAwTG1OMWNuTnZjaTV3WVhKbGJuUlhjbWwwWVdKc1pTeHpaWEpwWVd4cGVtVmtRMjl1ZEdWNGREcDBMbU4xY25OdmNpNXpaWEpwWVd4cGVtVmtRMjl1ZEdWNGRDeHpaWE56YVc5dVUzUmhkR1U2ZEM1amRYSnpiM0l1YzJWemMybHZibE4wWVhSbGZTazdZWGRoYVhRZ2RDNWpkWEp6YjNJdVlXUnZjSFFvWlNrN1kyOXVkR2x1ZFdWOWFXWW9jeTVyYVc1a1BUMDlZR1J5YVhabGNpMWtaV3hwZG1WeWVXQW1Kbk11Y21WeGRXVnpkRWxrUFQwOWJpbDdZWGRoYVhRZ2RDNWpkWEp6YjNJdWMyVnVaQ2g3YTJsdVpEcGdkSFZ5Ymkxa1pXeHBkbVZ5ZVMxaFkyTmxjSFJsWkdBc2NtVnhkV1Z6ZEVsa09uTXVjbVZ4ZFdWemRFbGtmU2tzYmoxMmIybGtJREE3YkdWMElHVTlZWGRoYVhRZ2NtOTFkR1ZFWld4cGRtVnlWRzlEYUdsc1pISmxiaWg3WVhWMGFEcHpMbVJsYkdsMlpYSjVMbUYxZEdnc2NHRnlaVzUwVjNKcGRHRmliR1U2ZEM1amRYSnpiM0l1Y0dGeVpXNTBWM0pwZEdGaWJHVXNjR0Y1Ykc5aFpITTZjeTVrWld4cGRtVnllUzV3WVhsc2IyRmtjeXh6WlhOemFXOXVVM1JoZEdVNmRDNWpkWEp6YjNJdWMyVnpjMmx2YmxOMFlYUmxmU2s3WlNFOVBYWnZhV1FnTUNZbWRDNWlkV1ptWlhKbFpFUmxiR2wyWlhKcFpYTXVjSFZ6YUNoN0xpNHVjeTVrWld4cGRtVnllU3h3WVhsc2IyRmtjenBiWlYxOUtYMTlmV0Z6ZVc1aklHWjFibU4wYVc5dUlISjFia3hsWjJGamVWUjFjbTVYYjNKclpteHZkeWhsS1h0c1pYUWdkRDFsTG5OMFpYQkpibkIxZER0MGNubDdabTl5S0RzN0tYdHNaWFFnYmoxaGQyRnBkQ0IwZFhKdVUzUmxjQ2gwS1R0cFppaHVMbUZqZEdsdmJqMDlQV0JrYjI1bFlDbDdZWGRoYVhRZ2MyVnVaRlIxY201RGIyNTBjbTlzVTNSbGNDaDdZMjl1ZEhKdmJGUnZhMlZ1T21VdVkyOXRjR3hsZEdsdmJsUnZhMlZ1TEhCaGVXeHZZV1E2ZTJGamRHbHZianA3YTJsdVpEcGdaRzl1WldBc2IzVjBjSFYwT200dWIzVjBjSFYwUHo5Z1lDeHBjMFZ5Y205eU9tNHVhWE5GY25KdmNpeHpaWEpwWVd4cGVtVmtRMjl1ZEdWNGREcHVMbk5sY21saGJHbDZaV1JEYjI1MFpYaDBMSE5sYzNOcGIyNVRkR0YwWlRwdUxuTmxjM05wYjI1VGRHRjBaWDBzYTJsdVpEcGdkSFZ5YmkxeVpYTjFiSFJnZlgwcE8zSmxkSFZ5Ym4xcFppaHVMbUZqZEdsdmJqMDlQV0JrYVhOd1lYUmphQzEzYjNKclpteHZkeTF5ZFc1MGFXMWxMV0ZqZEdsdmJuTmdLWHRoZDJGcGRDQnpaVzVrVkhWeWJrTnZiblJ5YjJ4VGRHVndLSHRqYjI1MGNtOXNWRzlyWlc0NlpTNWpiMjF3YkdWMGFXOXVWRzlyWlc0c2NHRjViRzloWkRwN1lXTjBhVzl1T250cmFXNWtPbUJrYVhOd1lYUmphQzEzYjNKclpteHZkeTF5ZFc1MGFXMWxMV0ZqZEdsdmJuTmdMSEJsYm1ScGJtZEJZM1JwYjI1TFpYbHpPbTR1Y0dWdVpHbHVaMUoxYm5ScGJXVkJZM1JwYjI1TFpYbHpMSE5sY21saGJHbDZaV1JEYjI1MFpYaDBPbTR1YzJWeWFXRnNhWHBsWkVOdmJuUmxlSFFzYzJWemMybHZibE4wWVhSbE9tNHVjMlZ6YzJsdmJsTjBZWFJsZlN4cmFXNWtPbUIwZFhKdUxYSmxjM1ZzZEdCOWZTazdjbVYwZFhKdWZXbG1LRzR1WVdOMGFXOXVQVDA5WUhCaGNtdGdLWHRzWlhRZ2REMXVMbkJsYm1ScGJtZFNkVzUwYVcxbFFXTjBhVzl1UzJWNWN6dHBaaWdoS0hRaFBUMTJiMmxrSURCOGZHNHVhR0Z6VUdWdVpHbHVaMEYxZEdodmNtbDZZWFJwYjI1OGZHNHVhR0Z6VUdWdVpHbHVaMGx1Y0hWMFFtRjBZMmdtSm1VdVkyRndZV0pwYkdsMGFXVnpQeTV5WlhGMVpYTjBTVzV3ZFhROVBUMGhNSHg4WlM1dGIyUmxQVDA5WUdOdmJuWmxjbk5oZEdsdmJtQXBLWFJvY205M0lFVnljbTl5S0ZSQlUwdGZUVTlFUlY5WFFVbFVYMFZTVWs5U1gwMUZVMU5CUjBVcE8yeGxkQ0J5UFhROVBUMTJiMmxrSURBL2UydHBibVE2WUhCaGNtdGdMSE5sY21saGJHbDZaV1JEYjI1MFpYaDBPbTR1YzJWeWFXRnNhWHBsWkVOdmJuUmxlSFFzYzJWemMybHZibE4wWVhSbE9tNHVjMlZ6YzJsdmJsTjBZWFJsTEdGMWRHaHZjbWw2WVhScGIyNU9ZVzFsY3pwdUxtRjFkR2h2Y21sNllYUnBiMjVPWVcxbGMzMDZlMnRwYm1RNllHUnBjM0JoZEdOb0xYSjFiblJwYldVdFlXTjBhVzl1YzJBc2NHVnVaR2x1WjBGamRHbHZia3RsZVhNNmRDeHpaWEpwWVd4cGVtVmtRMjl1ZEdWNGREcHVMbk5sY21saGJHbDZaV1JEYjI1MFpYaDBMSE5sYzNOcGIyNVRkR0YwWlRwdUxuTmxjM05wYjI1VGRHRjBaWDA3WVhkaGFYUWdjMlZ1WkZSMWNtNURiMjUwY205c1UzUmxjQ2g3WTI5dWRISnZiRlJ2YTJWdU9tVXVZMjl0Y0d4bGRHbHZibFJ2YTJWdUxIQmhlV3h2WVdRNmUyRmpkR2x2YmpweUxHdHBibVE2WUhSMWNtNHRjbVZ6ZFd4MFlIMTlLVHR5WlhSMWNtNTlkRDE3YVc1d2RYUTZkbTlwWkNBd0xIQmhjbVZ1ZEZkeWFYUmhZbXhsT25RdWNHRnlaVzUwVjNKcGRHRmliR1VzYzJWeWFXRnNhWHBsWkVOdmJuUmxlSFE2Ymk1elpYSnBZV3hwZW1Wa1EyOXVkR1Y0ZEN4elpYTnphVzl1VTNSaGRHVTZiaTV6WlhOemFXOXVVM1JoZEdWOWZYMWpZWFJqYUNoMEtYdDBhSEp2ZHlCaGQyRnBkQ0J6Wlc1a1ZIVnlia052Ym5SeWIyeFRkR1Z3S0h0amIyNTBjbTlzVkc5clpXNDZaUzVqYjIxd2JHVjBhVzl1Vkc5clpXNHNjR0Y1Ykc5aFpEcDdaWEp5YjNJNmJtOXliV0ZzYVhwbFUyVnlhV0ZzYVhwaFlteGxSWEp5YjNJb2RDa3NhMmx1WkRwZ2RIVnliaTFsY25KdmNtQjlmU2tzZEgxOVpYaHdiM0owZTNSMWNtNVhiM0pyWm14dmQzMDdYRzUwZFhKdVYyOXlhMlpzYjNjdWQyOXlhMlpzYjNkSlpDQTlJRndpZDI5eWEyWnNiM2N2TDJWMlpTOHZkSFZ5YmxkdmNtdG1iRzkzWENJN1hHNW5iRzlpWVd4VWFHbHpMbDlmY0hKcGRtRjBaVjkzYjNKclpteHZkM011YzJWMEtGd2lkMjl5YTJac2IzY3ZMMlYyWlM4dmRIVnlibGR2Y210bWJHOTNYQ0lzSUhSMWNtNVhiM0pyWm14dmR5azdYRzRpTENKbWRXNWpkR2x2YmlCamIyRnNaWE5qWlZSMWNtNUpibkIxZEhNb1pTeDBLWHRzWlhRZ2JqMWpiMkZzWlhOalpVbHVjSFYwVW1WemNHOXVjMlZ6S0h0aE9tVXVhVzV3ZFhSU1pYTndiMjV6WlhNc1lqcDBMbWx1Y0hWMFVtVnpjRzl1YzJWemZTa3NjajFqYjJGc1pYTmpaVTFsYzNOaFoyVW9lMkU2WlM1dFpYTnpZV2RsTEdJNmRDNXRaWE56WVdkbGZTa3NhVDFqYjJGc1pYTmpaVU52Ym5SbGVIUW9lMkU2WlM1amIyNTBaWGgwTEdJNmRDNWpiMjUwWlhoMGZTa3NZVDEwTG05MWRIQjFkRk5qYUdWdFlUOC9aUzV2ZFhSd2RYUlRZMmhsYldFc2J6MTdmVHR5WlhSMWNtNGdiaUU5UFhadmFXUWdNQ1ltS0c4dWFXNXdkWFJTWlhOd2IyNXpaWE05Ymlrc2NpRTlQWFp2YVdRZ01DWW1LRzh1YldWemMyRm5aVDF5S1N4cElUMDlkbTlwWkNBd0ppWW9ieTVqYjI1MFpYaDBQV2twTEdFaFBUMTJiMmxrSURBbUppaHZMbTkxZEhCMWRGTmphR1Z0WVQxaEtTeHZmV1oxYm1OMGFXOXVJSEpsYzI5c2RtVkJjM05wYzNSaGJuUlRkR1Z3VkdWNGRDaGxMSFFwZTJadmNpaHNaWFFnZEQxbExteGxibWQwYUMweE8zUStQVEE3TFMxMEtYdHNaWFFnYmoxbFczUmRPMmxtS0c0L0xuSnZiR1VoUFQxZ1lYTnphWE4wWVc1MFlDbGpiMjUwYVc1MVpUdHNaWFFnY2oxbGVIUnlZV04wVFdWemMyRm5aVlJsZUhRb2JpazdhV1lvY2k1MGNtbHRLQ2t1YkdWdVozUm9QakFwY21WMGRYSnVJSEo5Y21WMGRYSnVJSFFoUFQxMmIybGtJREFtSm5RdWRISnBiU2dwTG14bGJtZDBhRDR3UDNRNmJuVnNiSDFtZFc1amRHbHZiaUJsZUhSeVlXTjBUV1Z6YzJGblpWUmxlSFFvWlNsN2NtVjBkWEp1SUhSNWNHVnZaaUJsTG1OdmJuUmxiblE5UFdCemRISnBibWRnUDJVdVkyOXVkR1Z1ZERwQmNuSmhlUzVwYzBGeWNtRjVLR1V1WTI5dWRHVnVkQ2svWlM1amIyNTBaVzUwTG1ac1lYUk5ZWEFvWlQwK2RIbHdaVzltSUdVOVBXQnpkSEpwYm1kZ1AxdGxYVHBnZEhsd1pXQnBiaUJsSmlabExuUjVjR1U5UFQxZ2RHVjRkR0FtSm5SNWNHVnZaaUJsTG5SbGVIUTlQV0J6ZEhKcGJtZGdQMXRsTG5SbGVIUmRPbHRkS1M1cWIybHVLR0JnS1RwZ1lIMW1kVzVqZEdsdmJpQmpiMkZzWlhOalpVbHVjSFYwVW1WemNHOXVjMlZ6S0dVcGUyeGxkQ0IwUFdVdVlUOC9XMTBzYmoxbExtSS9QMXRkTzJsbUtDRW9kQzVzWlc1bmRHZzlQVDB3SmladUxteGxibWQwYUQwOVBUQXBLWEpsZEhWeWJsc3VMaTUwTEM0dUxtNWRmV1oxYm1OMGFXOXVJR052WVd4bGMyTmxRMjl1ZEdWNGRDaGxLWHRzWlhRZ2REMWxMbUUvUDF0ZExHNDlaUzVpUHo5YlhUdHBaaWdoS0hRdWJHVnVaM1JvUFQwOU1DWW1iaTVzWlc1bmRHZzlQVDB3S1NseVpYUjFjbTViTGk0dWRDd3VMaTV1WFgxbWRXNWpkR2x2YmlCamIyRnNaWE5qWlUxbGMzTmhaMlVvWlNsN2NtVjBkWEp1SUdVdVlUMDlQWFp2YVdRZ01EOWxMbUk2WlM1aVBUMDlkbTlwWkNBd1AyVXVZVHAwZVhCbGIyWWdaUzVoUFQxZ2MzUnlhVzVuWUNZbWRIbHdaVzltSUdVdVlqMDlZSE4wY21sdVoyQS9ZQ1I3WlM1aGZWeGNibHhjYmlSN1pTNWlmV0E2V3k0dUxuUnZWWE5sY2tOdmJuUmxiblJCY25KaGVTaGxMbUVwTEM0dUxuUnZWWE5sY2tOdmJuUmxiblJCY25KaGVTaGxMbUlwWFgxbWRXNWpkR2x2YmlCMGIxVnpaWEpEYjI1MFpXNTBRWEp5WVhrb1pTbDdjbVYwZFhKdUlIUjVjR1Z2WmlCbFBUMWdjM1J5YVc1bllEOWxMbXhsYm1kMGFENHdQMXQ3ZEhsd1pUcGdkR1Y0ZEdBc2RHVjRkRHBsZlYwNlcxMDZRWEp5WVhrdWFYTkJjbkpoZVNobEtUOWJMaTR1WlYwNlcxMTlablZ1WTNScGIyNGdZMjloYkdWelkyVkVaV3hwZG1WeWFXVnpLR1VwZTJ4bGRGdDBMQzR1TG01ZFBXVTdhV1lvZEQwOVBYWnZhV1FnTUNsMGFISnZkeUJGY25KdmNpaGdRMkZ1Ym05MElHTnZZV3hsYzJObElHRnVJR1Z0Y0hSNUlHUmxiR2wyWlhKNUlHSmhkR05vTG1BcE8yeGxkQ0J5UFhRdVlYVjBhQ3hwUFZzdUxpNTBMbkJoZVd4dllXUnpYVHRtYjNJb2JHVjBJR1VnYjJZZ2JpbGxMbUYxZEdnaFBUMTJiMmxrSURBbUppaHlQV1V1WVhWMGFDa3NhUzV3ZFhOb0tDNHVMbVV1Y0dGNWJHOWhaSE1wTzNKbGRIVnlibnN1TGk1MExHRjFkR2c2Y2l4d1lYbHNiMkZrY3pwcGZYMWxlSEJ2Y25SN1kyOWhiR1Z6WTJWRVpXeHBkbVZ5YVdWekxHTnZZV3hsYzJObFZIVnlia2x1Y0hWMGN5eHlaWE52YkhabFFYTnphWE4wWVc1MFUzUmxjRlJsZUhSOU95SXNJbU52Ym5OMElFdEZXVjlTUlVkSlUxUlNXVjlIVEU5Q1FVeGZTMFZaUFZONWJXSnZiQzVtYjNJb1lHVjJaUzVqYjI1MFpYaDBMV3RsZVMxeVpXZHBjM1J5ZVdBcExHZHNiMkpoYkV0bGVWSmxaMmx6ZEhKNVEyOXVkR0ZwYm1WeVBXZHNiMkpoYkZSb2FYTTdaMnh2WW1Gc1MyVjVVbVZuYVhOMGNubERiMjUwWVdsdVpYSmJTMFZaWDFKRlIwbFRWRkpaWDBkTVQwSkJURjlMUlZsZFBUMDlkbTlwWkNBd0ppWW9aMnh2WW1Gc1MyVjVVbVZuYVhOMGNubERiMjUwWVdsdVpYSmJTMFZaWDFKRlIwbFRWRkpaWDBkTVQwSkJURjlMUlZsZFBXNWxkeUJOWVhBcE8yTnZibk4wSUd0bGVWSmxaMmx6ZEhKNVBXZHNiMkpoYkV0bGVWSmxaMmx6ZEhKNVEyOXVkR0ZwYm1WeVcwdEZXVjlTUlVkSlUxUlNXVjlIVEU5Q1FVeGZTMFZaWFR0MllYSWdRMjl1ZEdWNGRFdGxlVDFqYkdGemMzdHVZVzFsTzJOdlpHVmpPMk52Ym5OMGNuVmpkRzl5S0dVc2REMTdmU2w3ZEdocGN5NXVZVzFsUFdVc2RHaHBjeTVqYjJSbFl6MTBMbU52WkdWak8yeGxkQ0J1UFd0bGVWSmxaMmx6ZEhKNUxtZGxkQ2hsS1R0cFppaHVJVDA5ZG05cFpDQXdKaVp1TG1OdlpHVmpQVDA5ZG05cFpDQXdJVDBvZEdocGN5NWpiMlJsWXowOVBYWnZhV1FnTUNrcGRHaHliM2NnUlhKeWIzSW9ZRU52Ym5SbGVIUkxaWGtnYm1GdFpTQmpiMnhzYVhOcGIyNDZJRndpSkh0bGZWd2lJR2x6SUdGc2NtVmhaSGtnY21WbmFYTjBaWEpsWkNBa2UyNHVZMjlrWldNL1lIZHBkR2hnT21CM2FYUm9iM1YwWUgwZ1lTQmpiMlJsWXl3Z1luVjBJR0VnYTJWNUlDUjdkR2hwY3k1amIyUmxZejlnZDJsMGFHQTZZSGRwZEdodmRYUmdmU0JoSUdOdlpHVmpJR2x6SUdKbGFXNW5JSEpsWjJsemRHVnlaV1FnZFc1a1pYSWdkR2hsSUhOaGJXVWdibUZ0WlM0Z1ZHaHBjeUJ6YVd4bGJuUnNlU0JpY21WaGEzTWdZMjl1ZEdWNGRDQnpaWEpwWVd4cGVtRjBhVzl1SU9LQWxDQjFjMlVnWVNCa2FYTjBhVzVqZENCdVlXMWxMbUFwTzJ0bGVWSmxaMmx6ZEhKNUxuTmxkQ2hsTEhSb2FYTXBmWDA3Wm5WdVkzUnBiMjRnY21WemIyeDJaVXRsZVNobEtYdHlaWFIxY200Z2EyVjVVbVZuYVhOMGNua3VaMlYwS0dVcGZXVjRjRzl5ZEh0RGIyNTBaWGgwUzJWNUxISmxjMjlzZG1WTFpYbDlPeUlzSW1sdGNHOXlkSHREYjI1MFpYaDBTMlY1ZldaeWIyMWNJaU5qYjI1MFpYaDBMMnRsZVM1cWMxd2lPMk52Ym5OMElFRjFkR2hMWlhrOWJtVjNJRU52Ym5SbGVIUkxaWGtvWUdWMlpTNWhkWFJvWUNrc1NXNXBkR2xoZEc5eVFYVjBhRXRsZVQxdVpYY2dRMjl1ZEdWNGRFdGxlU2hnWlhabExtbHVhWFJwWVhSdmNrRjFkR2hnS1N4VFpYTnphVzl1U1dSTFpYazlibVYzSUVOdmJuUmxlSFJMWlhrb1lHVjJaUzV6WlhOemFXOXVTV1JnS1N4RGIyNTBhVzUxWVhScGIyNVViMnRsYmt0bGVUMXVaWGNnUTI5dWRHVjRkRXRsZVNoZ1pYWmxMbU52Ym5ScGJuVmhkR2x2YmxSdmEyVnVZQ2tzUTJoaGJtNWxiRkpsY1hWbGMzUkpaRXRsZVQxdVpYY2dRMjl1ZEdWNGRFdGxlU2hnWlhabExtTm9ZVzV1Wld4U1pYRjFaWE4wU1dSZ0tTeERhR0Z1Ym1Wc1NXNXpkSEoxYldWdWRHRjBhVzl1UzJWNVBXNWxkeUJEYjI1MFpYaDBTMlY1S0dCbGRtVXVZMmhoYm01bGJFbHVjM1J5ZFcxbGJuUmhkR2x2Ym1BcExFMXZaR1ZMWlhrOWJtVjNJRU52Ym5SbGVIUkxaWGtvWUdWMlpTNXRiMlJsWUNrc1VHRnlaVzUwVTJWemMybHZia3RsZVQxdVpYY2dRMjl1ZEdWNGRFdGxlU2hnWlhabExuQmhjbVZ1ZEZObGMzTnBiMjVnS1N4RFlYQmhZbWxzYVhScFpYTkxaWGs5Ym1WM0lFTnZiblJsZUhSTFpYa29ZR1YyWlM1allYQmhZbWxzYVhScFpYTmdLU3hUWlhOemFXOXVRMkZzYkdKaFkydExaWGs5Ym1WM0lFTnZiblJsZUhSTFpYa29ZR1YyWlM1elpYTnphVzl1UTJGc2JHSmhZMnRnS1N4VFpYTnphVzl1UzJWNVBXNWxkeUJEYjI1MFpYaDBTMlY1S0dCbGRtVXVjMlZ6YzJsdmJtQXBMRk5oYm1SaWIzaExaWGs5Ym1WM0lFTnZiblJsZUhSTFpYa29ZR1YyWlM1ellXNWtZbTk0WUNrc1UyVnpjMmx2YmtSNWJtRnRhV05VYjI5c1RXVjBZV1JoZEdGTFpYazlibVYzSUVOdmJuUmxlSFJMWlhrb1lHVjJaUzV6WlhOemFXOXVSSGx1WVcxcFkxUnZiMnhOWlhSaFpHRjBZV0FwTEZSMWNtNUVlVzVoYldsalZHOXZiRTFsZEdGa1lYUmhTMlY1UFc1bGR5QkRiMjUwWlhoMFMyVjVLR0JsZG1VdWRIVnlia1I1Ym1GdGFXTlViMjlzVFdWMFlXUmhkR0ZnS1N4TWFYWmxVM1JsY0ZSdmIyeHpTMlY1UFc1bGR5QkRiMjUwWlhoMFMyVjVLR0JsZG1VdWJHbDJaVk4wWlhCVWIyOXNjMkFwTEVSNWJtRnRhV05UYTJsc2JFMWhibWxtWlhOMFMyVjVQVzVsZHlCRGIyNTBaWGgwUzJWNUtHQmxkbVV1WkhsdVlXMXBZMU5yYVd4c1RXRnVhV1psYzNSZ0tTeFRaWE56YVc5dVJIbHVZVzFwWTBsdWMzUnlkV04wYVc5dWMwdGxlVDF1WlhjZ1EyOXVkR1Y0ZEV0bGVTaGdaWFpsTG5ObGMzTnBiMjVFZVc1aGJXbGpTVzV6ZEhKMVkzUnBiMjV6WUNrc1ZIVnlia1I1Ym1GdGFXTkpibk4wY25WamRHbHZibk5MWlhrOWJtVjNJRU52Ym5SbGVIUkxaWGtvWUdWMlpTNTBkWEp1UkhsdVlXMXBZMGx1YzNSeWRXTjBhVzl1YzJBcE8yVjRjRzl5ZEh0QmRYUm9TMlY1TEVOaGNHRmlhV3hwZEdsbGMwdGxlU3hEYUdGdWJtVnNTVzV6ZEhKMWJXVnVkR0YwYVc5dVMyVjVMRU5vWVc1dVpXeFNaWEYxWlhOMFNXUkxaWGtzUTI5dWRHbHVkV0YwYVc5dVZHOXJaVzVMWlhrc1JIbHVZVzFwWTFOcmFXeHNUV0Z1YVdabGMzUkxaWGtzU1c1cGRHbGhkRzl5UVhWMGFFdGxlU3hNYVhabFUzUmxjRlJ2YjJ4elMyVjVMRTF2WkdWTFpYa3NVR0Z5Wlc1MFUyVnpjMmx2Ymt0bGVTeFRZVzVrWW05NFMyVjVMRk5sYzNOcGIyNURZV3hzWW1GamEwdGxlU3hUWlhOemFXOXVSSGx1WVcxcFkwbHVjM1J5ZFdOMGFXOXVjMHRsZVN4VFpYTnphVzl1UkhsdVlXMXBZMVJ2YjJ4TlpYUmhaR0YwWVV0bGVTeFRaWE56YVc5dVNXUkxaWGtzVTJWemMybHZia3RsZVN4VWRYSnVSSGx1WVcxcFkwbHVjM1J5ZFdOMGFXOXVjMHRsZVN4VWRYSnVSSGx1WVcxcFkxUnZiMnhOWlhSaFpHRjBZVXRsZVgwN0lpd2lablZ1WTNScGIyNGdhWE5QWW1wbFkzUW9aU2w3Y21WMGRYSnVJSFI1Y0dWdlppQmxQVDFnYjJKcVpXTjBZQ1ltSVNGbEppWWhRWEp5WVhrdWFYTkJjbkpoZVNobEtYMW1kVzVqZEdsdmJpQnBjMDV2YmtWdGNIUjVVM1J5YVc1bktHVXBlM0psZEhWeWJpQjBlWEJsYjJZZ1pUMDlZSE4wY21sdVoyQW1KbVV1YkdWdVozUm9QakI5Wm5WdVkzUnBiMjRnYVhOVWFHVnVZV0pzWlNobEtYdHlaWFIxY200Z2FYTlBZbXBsWTNRb1pTa21KblI1Y0dWdlppQmxMblJvWlc0OVBXQm1kVzVqZEdsdmJtQjlablZ1WTNScGIyNGdhWE5RYkdGcGJsSmxZMjl5WkNobEtYdHBaaWdoYVhOUFltcGxZM1FvWlNrcGNtVjBkWEp1SVRFN2JHVjBJSFE5VDJKcVpXTjBMbWRsZEZCeWIzUnZkSGx3WlU5bUtHVXBPM0psZEhWeWJpQjBQVDA5VDJKcVpXTjBMbkJ5YjNSdmRIbHdaWHg4ZEQwOVBXNTFiR3g5Wlhod2IzSjBlMmx6VG05dVJXMXdkSGxUZEhKcGJtY3NhWE5QWW1wbFkzUXNhWE5RYkdGcGJsSmxZMjl5WkN4cGMxUm9aVzVoWW14bGZUc2lMQ0pwYlhCdmNuUjdRMmhoYm01bGJGSmxjWFZsYzNSSlpFdGxlWDFtY205dFhDSWpZMjl1ZEdWNGRDOXJaWGx6TG1welhDSTdhVzF3YjNKMGUybHpUbTl1Ulcxd2RIbFRkSEpwYm1kOVpuSnZiVndpSTNOb1lYSmxaQzluZFdGeVpITXVhbk5jSWp0bWRXNWpkR2x2YmlCeVpXRmtRMmhoYm01bGJFdHBibVFvWlNsN2JHVjBJRzQ5WlZ0Z1pYWmxMbU5vWVc1dVpXeGdYVDh1YTJsdVpEdHlaWFIxY200Z2FYTk9iMjVGYlhCMGVWTjBjbWx1WnlodUtUOXVPblp2YVdRZ01IMW1kVzVqZEdsdmJpQnlaV0ZrVUdGeVpXNTBUR2x1WldGblpTaGxLWHRzWlhRZ2JqMWxXMkJsZG1VdWNHRnlaVzUwVTJWemMybHZibUJkTEhJOWJqOHVZMkZzYkVsa0xHazliajh1Y205dmRGTmxjM05wYjI1SlpDeGhQVzQvTG5ObGMzTnBiMjVKWkN4dlBXNC9MblIxY200L0xtbGtPM0psZEhWeWJudGpZV3hzU1dRNmFYTk9iMjVGYlhCMGVWTjBjbWx1WnloeUtUOXlPblp2YVdRZ01DeHliMjkwVTJWemMybHZia2xrT21selRtOXVSVzF3ZEhsVGRISnBibWNvYVNrL2FUcDJiMmxrSURBc2MyVnpjMmx2Ymtsa09tbHpUbTl1Ulcxd2RIbFRkSEpwYm1jb1lTay9ZVHAyYjJsa0lEQXNkSFZ5Ymtsa09tbHpUbTl1Ulcxd2RIbFRkSEpwYm1jb2J5ay9ienAyYjJsa0lEQjlmV1oxYm1OMGFXOXVJSEpsWVdSUVlYSmxiblJUWlhOemFXOXVTV1FvWlNsN2NtVjBkWEp1SUhKbFlXUlFZWEpsYm5STWFXNWxZV2RsS0dVcExuTmxjM05wYjI1SlpIMW1kVzVqZEdsdmJpQnlaV0ZrVW05dmRGTmxjM05wYjI1SlpDaGxLWHR5WlhSMWNtNGdjbVZoWkZCaGNtVnVkRXhwYm1WaFoyVW9aU2t1Y205dmRGTmxjM05wYjI1SlpIMW1kVzVqZEdsdmJpQnlaV0ZrUTJoaGJtNWxiRkpsY1hWbGMzUkpaQ2h1S1h0c1pYUWdjajF1VzBOb1lXNXVaV3hTWlhGMVpYTjBTV1JMWlhrdWJtRnRaVjA3Y21WMGRYSnVJR2x6VG05dVJXMXdkSGxUZEhKcGJtY29jaWsvY2pwMmIybGtJREI5WTI5dWMzUWdSVlpGWDFORlUxTkpUMDVmVkVsVVRFVmZUVUZZWDBOSVFWSlRQVEV5TlR0bWRXNWpkR2x2YmlCa1pYSnBkbVZUWlhOemFXOXVWR2wwYkdVb1pTbDdiR1YwSUhROVkyOXNiR1ZqZEUxbGMzTmhaMlZVWlhoMEtHVXBPMmxtS0hROVBUMTJiMmxrSURCOGZIUXViR1Z1WjNSb1BUMDlNQ2x5WlhSMWNtNDdiR1YwSUc0OWRDNXlaWEJzWVdObEtDOWNYSE1yTDJkMUxHQWdZQ2t1ZEhKcGJTZ3BPMmxtS0c0dWJHVnVaM1JvUFQwOU1DbHlaWFIxY200N2JHVjBJSEk5UVhKeVlYa3Vabkp2YlNodUtUdHlaWFIxY200Z2NpNXNaVzVuZEdnOFBURXlOVDl1T21Ba2UzSXVjMnhwWTJVb01Dd3hNalFwTG1wdmFXNG9ZR0FwZmVLQXBtQjlablZ1WTNScGIyNGdZMjlzYkdWamRFMWxjM05oWjJWVVpYaDBLR1VwZTJsbUtIUjVjR1Z2WmlCbFBUMWdjM1J5YVc1bllDbHlaWFIxY200Z1pUdHBaaWdoUVhKeVlYa3VhWE5CY25KaGVTaGxLU2x5WlhSMWNtNDdiR1YwSUhROVcxMDdabTl5S0d4bGRDQnVJRzltSUdVcGJpWW1kSGx3Wlc5bUlHNDlQV0J2WW1wbFkzUmdKaVp1TG5SNWNHVTlQVDFnZEdWNGRHQW1KblI1Y0dWdlppQnVMblJsZUhROVBXQnpkSEpwYm1kZ0ppWjBMbkIxYzJnb2JpNTBaWGgwS1R0eVpYUjFjbTRnZEM1c1pXNW5kR2crTUQ5MExtcHZhVzRvWUNCZ0tUcDJiMmxrSURCOVpuVnVZM1JwYjI0Z1luVnBiR1JUWlhOemFXOXVRWFIwY21saWRYUmxjeWhsS1h0eVpYUjFjbTU3WENJa1pYWmxMbU5vWVc1dVpXeGZjbVZ4ZFdWemRGOXBaRndpT25KbFlXUkRhR0Z1Ym1Wc1VtVnhkV1Z6ZEVsa0tHVXVjMlZ5YVdGc2FYcGxaRU52Ym5SbGVIUXBMRndpSkdWMlpTNTBlWEJsWENJNllITmxjM05wYjI1Z0xGd2lKR1YyWlM1MGNtbG5aMlZ5WENJNmNtVmhaRU5vWVc1dVpXeExhVzVrS0dVdWMyVnlhV0ZzYVhwbFpFTnZiblJsZUhRcExGd2lKR1YyWlM1MGFYUnNaVndpT21SbGNtbDJaVk5sYzNOcGIyNVVhWFJzWlNobExtbHVjSFYwVFdWemMyRm5aU2w5ZldaMWJtTjBhVzl1SUdKMWFXeGtVM1ZpWVdkbGJuUlNiMjkwUVhSMGNtbGlkWFJsY3lobEtYdHlaWFIxY201N1hDSWtaWFpsTG1Ob1lXNXVaV3hmY21WeGRXVnpkRjlwWkZ3aU9uSmxZV1JEYUdGdWJtVnNVbVZ4ZFdWemRFbGtLR1V1YzJWeWFXRnNhWHBsWkVOdmJuUmxlSFFwTEZ3aUpHVjJaUzUwZVhCbFhDSTZZSE4xWW1GblpXNTBZQ3hjSWlSbGRtVXVjR0Z5Wlc1MFhDSTZaUzV3WVhKbGJuUlRaWE56YVc5dVNXUXNYQ0lrWlhabExuQmhjbVZ1ZEY5allXeHNYQ0k2WlM1d1lYSmxiblJEWVd4c1NXUXNYQ0lrWlhabExuQmhjbVZ1ZEY5MGRYSnVYQ0k2WlM1d1lYSmxiblJVZFhKdVNXUXNYQ0lrWlhabExuSnZiM1JjSWpwbExuSnZiM1JUWlhOemFXOXVTV1FzWENJa1pYWmxMbk4xWW1GblpXNTBYQ0k2WlM1cFpHVnVkR2wwZVM1dWIyUmxTV1FzWENJa1pYWmxMblJ5YVdkblpYSmNJanB5WldGa1EyaGhibTVsYkV0cGJtUW9aUzV6WlhKcFlXeHBlbVZrUTI5dWRHVjRkQ2w5ZldaMWJtTjBhVzl1SUdKMWFXeGtWSFZ5YmtGMGRISnBZblYwWlhNb1pTbDdjbVYwZFhKdWUxd2lKR1YyWlM1amFHRnVibVZzWDNKbGNYVmxjM1JmYVdSY0lqcGxMbkpsY1hWbGMzUkpaQ3hjSWlSbGRtVXVkSGx3WlZ3aU9tQjBkWEp1WUN4Y0lpUmxkbVV1Y0dGeVpXNTBYQ0k2WlM1d1lYSmxiblJUWlhOemFXOXVTV1FzWENJa1pYWmxMbkp2YjNSY0lqcGxMbkp2YjNSVFpYTnphVzl1U1dSOWZXVjRjRzl5ZEh0RlZrVmZVMFZUVTBsUFRsOVVTVlJNUlY5TlFWaGZRMGhCVWxNc1luVnBiR1JUWlhOemFXOXVRWFIwY21saWRYUmxjeXhpZFdsc1pGTjFZbUZuWlc1MFVtOXZkRUYwZEhKcFluVjBa", - "WE1zWW5WcGJHUlVkWEp1UVhSMGNtbGlkWFJsY3l4a1pYSnBkbVZUWlhOemFXOXVWR2wwYkdVc2NtVmhaRU5vWVc1dVpXeExhVzVrTEhKbFlXUkRhR0Z1Ym1Wc1VtVnhkV1Z6ZEVsa0xISmxZV1JRWVhKbGJuUk1hVzVsWVdkbExISmxZV1JRWVhKbGJuUlRaWE56YVc5dVNXUXNjbVZoWkZKdmIzUlRaWE56YVc5dVNXUjlPeUlzSWk4cUtsOWZhVzUwWlhKdVlXeGZkMjl5YTJac2IzZHplMXdpYzNSbGNITmNJanA3WENKa2FYTjBMM055WXk5bGVHVmpkWFJwYjI0dlpHVnNaV2RoZEdWa0xYQmhjbVZ1ZEMxdWIzUnBabWxqWVhScGIyNHVhbk5jSWpwN1hDSnViM1JwWm5sRVpXeGxaMkYwWldSUVlYSmxiblJUZEdWd1hDSTZlMXdpYzNSbGNFbGtYQ0k2WENKemRHVndMeTlsZG1WQU1DNHhOaTR5THk5dWIzUnBabmxFWld4bFoyRjBaV1JRWVhKbGJuUlRkR1Z3WENKOWZYMTlLaTg3WEc1bGVIQnZjblFnZG1GeUlHNXZkR2xtZVVSbGJHVm5ZWFJsWkZCaGNtVnVkRk4wWlhBZ1BTQm5iRzlpWVd4VWFHbHpXMU41YldKdmJDNW1iM0lvWENKWFQxSkxSa3hQVjE5VlUwVmZVMVJGVUZ3aUtWMG9YQ0p6ZEdWd0x5OWxkbVZBTUM0eE5pNHlMeTl1YjNScFpubEVaV3hsWjJGMFpXUlFZWEpsYm5SVGRHVndYQ0lwTzF4dUlpd2lhVzF3YjNKMGUybHpUMkpxWldOMGZXWnliMjFjSWlOemFHRnlaV1F2WjNWaGNtUnpMbXB6WENJN1puVnVZM1JwYjI0Z2RHOUZjbkp2Y2sxbGMzTmhaMlVvZENsN2NtVjBkWEp1SUhRZ2FXNXpkR0Z1WTJWdlppQkZjbkp2Y2o5MExtMWxjM05oWjJVNmRIbHdaVzltSUhROVBXQnpkSEpwYm1kZ1AzUTZkRDA5Ym5Wc2JEOVRkSEpwYm1jb2RDazZhWE5QWW1wbFkzUW9kQ2svZEhsd1pXOW1JSFF1YldWemMyRm5aVDA5WUhOMGNtbHVaMkFtSm5RdWJXVnpjMkZuWlM1c1pXNW5kR2crTUQ5MExtMWxjM05oWjJVNmMyRm1aVXB6YjI1VGRISnBibWRwWm5rb2RDazZVM1J5YVc1bktIUXBmV1oxYm1OMGFXOXVJSFJ2UlhKeWIzSW9kQ2w3YVdZb2RDQnBibk4wWVc1alpXOW1JRVZ5Y205eUtYSmxkSFZ5YmlCME8yeGxkQ0J1UFVWeWNtOXlLSFJ2UlhKeWIzSk5aWE56WVdkbEtIUXBLVHR5WlhSMWNtNGdhWE5QWW1wbFkzUW9kQ2svS0hSNWNHVnZaaUIwTG01aGJXVTlQV0J6ZEhKcGJtZGdKaVowTG01aGJXVXViR1Z1WjNSb1BqQW1KaWh1TG01aGJXVTlkQzV1WVcxbEtTeDBlWEJsYjJZZ2RDNXpkR0ZqYXowOVlITjBjbWx1WjJBbUpuUXVjM1JoWTJzdWJHVnVaM1JvUGpBbUppaHVMbk4wWVdOclBYUXVjM1JoWTJzcExHQmpZWFZ6WldCcGJpQjBKaVowTG1OaGRYTmxJVDA5ZG05cFpDQXdKaVowTG1OaGRYTmxJVDA5ZENZbUtHNHVZMkYxYzJVOWRDNWpZWFZ6WlNrc2JpazZibjFtZFc1amRHbHZiaUJ6WVdabFNuTnZibE4wY21sdVoybG1lU2hsS1h0MGNubDdjbVYwZFhKdUlFcFRUMDR1YzNSeWFXNW5hV1o1S0dVcFB6OVRkSEpwYm1jb1pTbDlZMkYwWTJoN2NtVjBkWEp1SUZOMGNtbHVaeWhsS1gxOVpYaHdiM0owZTNSdlJYSnliM0lzZEc5RmNuSnZjazFsYzNOaFoyVjlPeUlzSWk4cUtsOWZhVzUwWlhKdVlXeGZkMjl5YTJac2IzZHplMXdpYzNSbGNITmNJanA3WENKa2FYTjBMM055WXk5bGVHVmpkWFJwYjI0dmMzVmlZV2RsYm5RdFlXUmhjSFJsY2k1cWMxd2lPbnRjSW1admNuZGhjbVJUZFdKaFoyVnVkRWx1Y0hWMFVtVnhkV1Z6ZEZOMFpYQmNJanA3WENKemRHVndTV1JjSWpwY0luTjBaWEF2TDJWMlpVQXdMakUyTGpJdkwyWnZjbmRoY21SVGRXSmhaMlZ1ZEVsdWNIVjBVbVZ4ZFdWemRGTjBaWEJjSW4xOWZYMHFMenRjYm1OdmJuTjBJRk5WUWtGSFJVNVVYMEZFUVZCVVJWSmZTMGxPUkQxZ2MzVmlZV2RsYm5SZ08xeHVaWGh3YjNKMElIc2dVMVZDUVVkRlRsUmZRVVJCVUZSRlVsOUxTVTVFSUgwN1hHNTJZWElnWm05eWQyRnlaRk4xWW1GblpXNTBTVzV3ZFhSU1pYRjFaWE4wVTNSbGNDQTlJR2RzYjJKaGJGUm9hWE5iVTNsdFltOXNMbVp2Y2loY0lsZFBVa3RHVEU5WFgxVlRSVjlUVkVWUVhDSXBYU2hjSW5OMFpYQXZMMlYyWlVBd0xqRTJMakl2TDJadmNuZGhjbVJUZFdKaFoyVnVkRWx1Y0hWMFVtVnhkV1Z6ZEZOMFpYQmNJaWs3WEc0aUxDSnBiWEJ2Y25SN2RHOUZjbkp2Y2sxbGMzTmhaMlY5Wm5KdmJWd2lJM05vWVhKbFpDOWxjbkp2Y25NdWFuTmNJanRwYlhCdmNuUjdVMVZDUVVkRlRsUmZRVVJCVUZSRlVsOUxTVTVFZldaeWIyMWNJaU5sZUdWamRYUnBiMjR2YzNWaVlXZGxiblF0WVdSaGNIUmxjaTVxYzF3aU8yWjFibU4wYVc5dUlHTnlaV0YwWlVSbGJHVm5ZWFJsWkZOMVltRm5aVzUwVTNWalkyVnpjMUpsYzNWc2RDaGxMRzRwZTJ4bGRDQnlQV1ZiWUdWMlpTNWphR0Z1Ym1Wc1lGMDdhV1lvY2o4dWEybHVaRDA5UFZOVlFrRkhSVTVVWDBGRVFWQlVSVkpmUzBsT1JDbHlaWFIxY201N1kyRnNiRWxrT2xOMGNtbHVaeWh5TG5OMFlYUmxQeTVqWVd4c1NXUS9QMkJnS1N4cmFXNWtPbUJ6ZFdKaFoyVnVkQzF5WlhOMWJIUmdMRzkxZEhCMWREcHVMSE4xWW1GblpXNTBUbUZ0WlRwVGRISnBibWNvY2k1emRHRjBaVDh1YzNWaVlXZGxiblJPWVcxbFB6OWdZQ2w5ZldaMWJtTjBhVzl1SUdOeVpXRjBaVVJsYkdWbllYUmxaRk4xWW1GblpXNTBSWEp5YjNKU1pYTjFiSFFvZEN4dUtYdHNaWFFnY2oxamNtVmhkR1ZFWld4bFoyRjBaV1JUZFdKaFoyVnVkRk4xWTJObGMzTlNaWE4xYkhRb2RDeGdZQ2s3YVdZb2NpRTlQWFp2YVdRZ01DbHlaWFIxY201N0xpNHVjaXhwYzBWeWNtOXlPaUV3TEc5MWRIQjFkRHA3WTI5a1pUcGdVMVZDUVVkRlRsUmZSVmhGUTFWVVNVOU9YMFpCU1V4RlJHQXNiV1Z6YzJGblpUcDBiMFZ5Y205eVRXVnpjMkZuWlNodUtYMTlmV1Y0Y0c5eWRIdGpjbVZoZEdWRVpXeGxaMkYwWldSVGRXSmhaMlZ1ZEVWeWNtOXlVbVZ6ZFd4MExHTnlaV0YwWlVSbGJHVm5ZWFJsWkZOMVltRm5aVzUwVTNWalkyVnpjMUpsYzNWc2RIMDdJaXdpTHlvcVgxOXBiblJsY201aGJGOTNiM0pyWm14dmQzTjdYQ0p6ZEdWd2Mxd2lPbnRjSW1ScGMzUXZjM0pqTDJWNFpXTjFkR2x2Ymk5bWIzSjNZWEprTFhSMWNtNHRaR1ZzYVhabGNua3RjM1JsY0M1cWMxd2lPbnRjSW1admNuZGhjbVJVZFhKdVJHVnNhWFpsY25sVGRHVndYQ0k2ZTF3aWMzUmxjRWxrWENJNlhDSnpkR1Z3THk5bGRtVkFNQzR4Tmk0eUx5OW1iM0ozWVhKa1ZIVnlia1JsYkdsMlpYSjVVM1JsY0Z3aWZYMTlmU292TzF4dVpYaHdiM0owSUhaaGNpQm1iM0ozWVhKa1ZIVnlia1JsYkdsMlpYSjVVM1JsY0NBOUlHZHNiMkpoYkZSb2FYTmJVM2x0WW05c0xtWnZjaWhjSWxkUFVrdEdURTlYWDFWVFJWOVRWRVZRWENJcFhTaGNJbk4wWlhBdkwyVjJaVUF3TGpFMkxqSXZMMlp2Y25kaGNtUlVkWEp1UkdWc2FYWmxjbmxUZEdWd1hDSXBPMXh1SWl3aWFXMXdiM0owZTJOeVpXRjBaVWh2YjJ0OVpuSnZiVndpSTJOdmJYQnBiR1ZrTDBCM2IzSnJabXh2ZHk5amIzSmxMMmx1WkdWNExtcHpYQ0k3YVcxd2IzSjBlMk5zYjNObFNHOXZhMGwwWlhKaGRHOXlMR1JwYzNCdmMyVkliMjlyZldaeWIyMWNJaU5sZUdWamRYUnBiMjR2YUc5dmF5MXZkMjVsY25Ob2FYQXVhbk5jSWp0cGJYQnZjblI3Wm05eWQyRnlaRlIxY201RVpXeHBkbVZ5ZVZOMFpYQjlabkp2YlZ3aUkyVjRaV04xZEdsdmJpOW1iM0ozWVhKa0xYUjFjbTR0WkdWc2FYWmxjbmt0YzNSbGNDNXFjMXdpTzJsdGNHOXlkSHR5WldKMWFXeGtVMlZ5YVdGc2FYcGhZbXhsUlhKeWIzSjlabkp2YlZ3aUkyVjRaV04xZEdsdmJpOTNiM0pyWm14dmR5MWxjbkp2Y25NdWFuTmNJanQyWVhJZ1ZIVnlia052Ym5SeWIyeFNaV05sYVhabGNqMWpiR0Z6YzN0aWRXWm1aWEpsWkVSbGJHbDJaWEpwWlhNN1kyOXVkSEp2YkR0amIyNTBjbTlzU1hSbGNtRjBiM0k3WkdWc2FYWmxjbmxJYjI5ck8zQmxibVJwYm1kRGIyNTBjbTlzUFc1MWJHdzdZMjl1YzNSeWRXTjBiM0lvZENsN2RHaHBjeTVpZFdabVpYSmxaRVJsYkdsMlpYSnBaWE05ZEM1aWRXWm1aWEpsWkVSbGJHbDJaWEpwWlhNc2RHaHBjeTVqYjI1MGNtOXNQV055WldGMFpVaHZiMnNvZTNSdmEyVnVPblF1ZEc5clpXNTlLU3gwYUdsekxtTnZiblJ5YjJ4SmRHVnlZWFJ2Y2oxMGFHbHpMbU52Ym5SeWIyeGJVM2x0WW05c0xtRnplVzVqU1hSbGNtRjBiM0pkS0Nrc2RHaHBjeTVrWld4cGRtVnllVWh2YjJzOWRDNWtaV3hwZG1WeWVVaHZiMnQ5WjJWMElIUnZhMlZ1S0NsN2NtVjBkWEp1SUhSb2FYTXVZMjl1ZEhKdmJDNTBiMnRsYm4xaGMzbHVZeUJrYVhOd2IzTmxLQ2w3WVhkaGFYUWdZMnh2YzJWSWIyOXJTWFJsY21GMGIzSW9kR2hwY3k1amIyNTBjbTlzU1hSbGNtRjBiM0lwTEdGM1lXbDBJR1JwYzNCdmMyVkliMjlyS0hSb2FYTXVZMjl1ZEhKdmJDbDlZWE41Ym1NZ2QyRnBkRVp2Y2tGamRHbHZiaWdwZTJadmNpZzdPeWw3YkdWMElHVTlZWGRoYVhRZ2RHaHBjeTV1WlhoMFEyOXVkSEp2YkNoZ1ZIVnliaUJqYjI1MGNtOXNJR2h2YjJzZ1kyeHZjMlZrSUdKbFptOXlaU0JrWld4cGRtVnlhVzVuSUdFZ2NtVnpkV3gwTG1BcExIUTlkR2hwY3k1eVpXRmtWR1Z5YldsdVlXeERiMjUwY205c0tHVXBPMmxtS0hRaFBUMTJiMmxrSURBcGNtVjBkWEp1SUhRN2FXWW9aUzVyYVc1a1BUMDlZSFIxY200dFpHVnNhWFpsY25rdGNtVnhkV1Z6ZEdBcGUyeGxkQ0IwUFdGM1lXbDBJSFJvYVhNdWMyVnlkbWxqWlVSbGJHbDJaWEo1VW1WeGRXVnpkQ2hsS1R0cFppaDBJVDA5ZG05cFpDQXdLWEpsZEhWeWJpQjBmWDE5WW5WbVptVnlWSFZ5YmtSbGJHbDJaWEpwWlhNb1pTbDdaUzVpZFdabVpYSmxaRVJsYkdsMlpYSnBaWE1oUFQxMmIybGtJREFtSm5Sb2FYTXVZblZtWm1WeVpXUkVaV3hwZG1WeWFXVnpMblZ1YzJocFpuUW9MaTR1WlM1aWRXWm1aWEpsWkVSbGJHbDJaWEpwWlhNcGZXTnZibk4xYldWRGIyNTBjbTlzS0NsN2RHaHBjeTV3Wlc1a2FXNW5RMjl1ZEhKdmJEMXVkV3hzZldkbGRFTnZiblJ5YjJ4UWNtOXRhWE5sS0NsN2NtVjBkWEp1SUhSb2FYTXVjR1Z1WkdsdVowTnZiblJ5YjJ3L1B6MTBhR2x6TG1OdmJuUnliMnhKZEdWeVlYUnZjaTV1WlhoMEtDa3NkR2hwY3k1d1pXNWthVzVuUTI5dWRISnZiSDFoYzNsdVl5QnVaWGgwUTI5dWRISnZiQ2hsS1h0bWIzSW9PenNwZTJ4bGRDQjBQV0YzWVdsMElIUm9hWE11WjJWMFEyOXVkSEp2YkZCeWIyMXBjMlVvS1R0cFppaDBhR2x6TG1OdmJuTjFiV1ZEYjI1MGNtOXNLQ2tzZEM1a2IyNWxLWFJvY205M0lFVnljbTl5S0dVcE8yeGxkQ0J1UFhRdWRtRnNkV1U3YVdZb2JpNXJhVzVrUFQwOVlIUjFjbTR0WlhKeWIzSmdLWFJvY205M0lISmxZblZwYkdSVFpYSnBZV3hwZW1GaWJHVkZjbkp2Y2lodUxtVnljbTl5S1R0cFppaHVMbXRwYm1ROVBUMWdkSFZ5YmkxamIyNTBhVzUxWVhScGIyNHRkRzlyWlc1Z0tYdGhkMkZwZENCMGFHbHpMbVJsYkdsMlpYSjVTRzl2YXk1eVpXdGxlU2h1TG1OdmJuUnBiblZoZEdsdmJsUnZhMlZ1S1R0amIyNTBhVzUxWlgxeVpYUjFjbTRnYm4xOWNtVmhaRlJsY20xcGJtRnNRMjl1ZEhKdmJDaGxLWHRwWmlobExtdHBibVE5UFQxZ2RIVnliaTFsY25KdmNtQXBkR2h5YjNjZ2NtVmlkV2xzWkZObGNtbGhiR2w2WVdKc1pVVnljbTl5S0dVdVpYSnliM0lwTzJsbUtHVXVhMmx1WkQwOVBXQjBkWEp1TFhKbGMzVnNkR0FwY21WMGRYSnVJSFJvYVhNdVluVm1abVZ5VkhWeWJrUmxiR2wyWlhKcFpYTW9aU2tzWlM1aFkzUnBiMjU5WVhONWJtTWdjMlZ5ZG1salpVUmxiR2wyWlhKNVVtVnhkV1Z6ZENobEtYdGhkMkZwZENCMGFHbHpMbVJsYkdsMlpYSjVTRzl2YXk1eVpXdGxlU2hsTG1OdmJuUnBiblZoZEdsdmJsUnZhMlZ1S1R0c1pYUWdkRDEwYUdsekxtSjFabVpsY21Wa1JHVnNhWFpsY21sbGN5NXphR2xtZENncE8yWnZjaWc3ZEQwOVBYWnZhV1FnTURzcGUyeGxkQ0J1UFdGM1lXbDBJRkJ5YjIxcGMyVXVjbUZqWlNoYmRHaHBjeTVuWlhSRGIyNTBjbTlzVUhKdmJXbHpaU2dwTG5Sb1pXNG9aVDArS0h0cmFXNWtPbUJqYjI1MGNtOXNZQ3gyWVd4MVpUcGxmU2twTEhSb2FYTXVaR1ZzYVhabGNubEliMjlyTG01bGVIUW9LUzUwYUdWdUtHVTlQaWg3YTJsdVpEcGdaR1ZzYVhabGNubGdMSFpoYkhWbE9tVjlLU2xkS1R0cFppaHVMbXRwYm1ROVBUMWdZMjl1ZEhKdmJHQXBlMmxtS0hSb2FYTXVZMjl1YzNWdFpVTnZiblJ5YjJ3b0tTeHVMblpoYkhWbExtUnZibVVwZEdoeWIzY2dSWEp5YjNJb1lGUjFjbTRnWTI5dWRISnZiQ0JvYjI5cklHTnNiM05sWkNCa2RYSnBibWNnWVNCa1pXeHBkbVZ5ZVNCeVpYRjFaWE4wTG1BcE8ybG1LRzR1ZG1Gc2RXVXVkbUZzZFdVdWEybHVaRDA5UFdCMGRYSnVMV052Ym5ScGJuVmhkR2x2YmkxMGIydGxibUFwZTJGM1lXbDBJSFJvYVhNdVpHVnNhWFpsY25sSWIyOXJMbkpsYTJWNUtHNHVkbUZzZFdVdWRtRnNkV1V1WTI5dWRHbHVkV0YwYVc5dVZHOXJaVzRwTzJOdmJuUnBiblZsZld4bGRDQjBQWFJvYVhNdWNtVmhaRlJsY20xcGJtRnNRMjl1ZEhKdmJDaHVMblpoYkhWbExuWmhiSFZsS1R0cFppaDBJVDA5ZG05cFpDQXdLWEpsZEhWeWJpQjBPMmxtS0c0dWRtRnNkV1V1ZG1Gc2RXVXVhMmx1WkQwOVBXQjBkWEp1TFdSbGJHbDJaWEo1TFdOaGJtTmxiR3hsWkdBbUptNHVkbUZzZFdVdWRtRnNkV1V1Y21WeGRXVnpkRWxrUFQwOVpTNXlaWEYxWlhOMFNXUXBjbVYwZFhKdU8yTnZiblJwYm5WbGZXbG1LRzR1ZG1Gc2RXVXVaRzl1WlNsMGFISnZkeUJGY25KdmNpaGdVMlZ6YzJsdmJpQmtaV3hwZG1WeWVTQm9iMjlySUdOc2IzTmxaQ0JrZFhKcGJtY2dZU0IwZFhKdUlHUmxiR2wyWlhKNUlISmxjWFZsYzNRdVlDazdkR2hwY3k1a1pXeHBkbVZ5ZVVodmIyc3VZMjl1YzNWdFpVNWxlSFFvS1N4dUxuWmhiSFZsTG5aaGJIVmxMbXRwYm1ROVBUMWdaR1ZzYVhabGNtQW1KaWgwUFc0dWRtRnNkV1V1ZG1Gc2RXVXBmWFJ5ZVh0aGQyRnBkQ0JtYjNKM1lYSmtWSFZ5YmtSbGJHbDJaWEo1VTNSbGNDaDdhVzVpYjNoVWIydGxianBsTG1sdVltOTRWRzlyWlc0c2NHRjViRzloWkRwN1pHVnNhWFpsY25rNmRDeHJhVzVrT21Ca2NtbDJaWEl0WkdWc2FYWmxjbmxnTEhKbGNYVmxjM1JKWkRwbExuSmxjWFZsYzNSSlpIMTlLWDFqWVhSamFDaGxLWHRwWmlnaEtHVWdhVzV6ZEdGdVkyVnZaaUJGY25KdmNpWW1aUzV1WVcxbFBUMDlZRWh2YjJ0T2IzUkdiM1Z1WkVWeWNtOXlZQ2twZEdoeWIzY2daWDF5WlhSMWNtNGdZWGRoYVhRZ2RHaHBjeTVoZDJGcGRFWnZjbmRoY21SbFpFUmxiR2wyWlhKNUtHVXVjbVZ4ZFdWemRFbGtMSFFwZldGemVXNWpJR0YzWVdsMFJtOXlkMkZ5WkdWa1JHVnNhWFpsY25rb1pTeDBLWHRtYjNJb096c3BlMnhsZENCdVBXRjNZV2wwSUhSb2FYTXVibVY0ZEVOdmJuUnliMndvWUZSMWNtNGdZMjl1ZEhKdmJDQm9iMjlySUdOc2IzTmxaQ0JpWldadmNtVWdjbVZ6YjJ4MmFXNW5JR0VnWm05eWQyRnlaR1ZrSUdSbGJHbDJaWEo1TG1BcE8ybG1LRzR1YTJsdVpEMDlQV0IwZFhKdUxXUmxiR2wyWlhKNUxXRmpZMlZ3ZEdWa1lDbDdhV1lvYmk1eVpYRjFaWE4wU1dROVBUMWxLWEpsZEhWeWJqdGpiMjUwYVc1MVpYMXBaaWh1TG10cGJtUTlQVDFnZEhWeWJpMWtaV3hwZG1WeWVTMWpZVzVqWld4c1pXUmdKaVp1TG5KbGNYVmxjM1JKWkQwOVBXVXBlM1JvYVhNdVluVm1abVZ5WldSRVpXeHBkbVZ5YVdWekxuVnVjMmhwWm5Rb2RDazdjbVYwZFhKdWZXNHVhMmx1WkQwOVBXQjBkWEp1TFhKbGMzVnNkR0FtSm5Sb2FYTXVZblZtWm1WeVpXUkVaV3hwZG1WeWFXVnpMblZ1YzJocFpuUW9kQ2s3YkdWMElISTlkR2hwY3k1eVpXRmtWR1Z5YldsdVlXeERiMjUwY205c0tHNHBPMmxtS0hJaFBUMTJiMmxrSURBcGNtVjBkWEp1SUhKOWZYMDdaWGh3YjNKMGUxUjFjbTVEYjI1MGNtOXNVbVZqWldsMlpYSjlPeUlzSW1sdGNHOXlkSHRrYVhOd1lYUmphRlIxY201VGRHVndmV1p5YjIxY0lpTmxlR1ZqZFhScGIyNHZkMjl5YTJac2IzY3RjM1JsY0hNdWFuTmNJanRwYlhCdmNuUjdWSFZ5YmtOdmJuUnliMnhTWldObGFYWmxjbjFtY205dFhDSWpaWGhsWTNWMGFXOXVMM1IxY200dFkyOXVkSEp2YkMxeVpXTmxhWFpsY2k1cWMxd2lPMkZ6ZVc1aklHWjFibU4wYVc5dUlHUnBjM0JoZEdOb1FXNWtRWGRoYVhSVWRYSnVLR1VwZTJ4bGRDQjBQVzVsZHlCVWRYSnVRMjl1ZEhKdmJGSmxZMlZwZG1WeUtIdGlkV1ptWlhKbFpFUmxiR2wyWlhKcFpYTTZaUzVpZFdabVpYSmxaRVJsYkdsMlpYSnBaWE1zWkdWc2FYWmxjbmxJYjI5ck9tVXVaR1ZzYVhabGNubEliMjlyTEhSdmEyVnVPbVV1WTI5dWRISnZiRlJ2YTJWdWZTazdkSEo1ZTNKbGRIVnliaUJoZDJGcGRDQmthWE53WVhSamFGUjFjbTVUZEdWd0tIdGpZWEJoWW1sc2FYUnBaWE02WlM1allYQmhZbWxzYVhScFpYTXNZMjl0Y0d4bGRHbHZibFJ2YTJWdU9uUXVkRzlyWlc0c1pHVnNhWFpsY25rNlpTNWtaV3hwZG1WeWVTeHRiMlJsT21VdWJXOWtaU3h3WVhKbGJuUlhjbWwwWVdKc1pUcGxMbkJoY21WdWRGZHlhWFJoWW14bExITmxjbWxoYkdsNlpXUkRiMjUwWlhoME9tVXVjMlZ5YVdGc2FYcGxaRU52Ym5SbGVIUXNjMlZ6YzJsdmJsTjBZWFJsT21VdWMyVnpjMmx2YmxOMFlYUmxmU2tzWVhkaGFYUWdkQzUzWVdsMFJtOXlRV04wYVc5dUtDbDlabWx1WVd4c2VYdGhkMkZwZENCMExtUnBjM0J2YzJVb0tYMTlaWGh3YjNKMGUyUnBjM0JoZEdOb1FXNWtRWGRoYVhSVWRYSnVmVHNpTENJdktpcGZYMmx1ZEdWeWJtRnNYM2R2Y210bWJHOTNjM3RjSW5OMFpYQnpYQ0k2ZTF3aVpHbHpkQzl6Y21NdlpYaGxZM1YwYVc5dUwyTnlaV0YwWlMxelpYTnphVzl1TFhOMFpYQXVhbk5jSWpwN1hDSmpjbVZoZEdWVFpYTnphVzl1VTNSbGNGd2lPbnRjSW5OMFpYQkpaRndpT2x3aWMzUmxjQzh2WlhabFFEQXVNVFl1TWk4dlkzSmxZWFJsVTJWemMybHZibE4wWlhCY0luMTlmWDBxTHp0Y2JtVjRjRzl5ZENCMllYSWdZM0psWVhSbFUyVnpjMmx2YmxOMFpYQWdQU0JuYkc5aVlXeFVhR2x6VzFONWJXSnZiQzVtYjNJb1hDSlhUMUpMUmt4UFYxOVZVMFZmVTFSRlVGd2lLVjBvWENKemRHVndMeTlsZG1WQU1DNHhOaTR5THk5amNtVmhkR1ZUWlhOemFXOXVVM1JsY0Z3aUtUdGNiaUlzSWk4cUtsOWZhVzUwWlhKdVlXeGZkMjl5YTJac2IzZHplMXdpYzNSbGNITmNJanA3WENKa2FYTjBMM055WXk5bGVHVmpkWFJwYjI0dmMyVnpjMmx2YmkxallXeHNZbUZqYXkxemRHVndMbXB6WENJNmUxd2labWx5WlZObGMzTnBiMjVEWVd4c1ltRmphMU4wWlhCY0lqcDdYQ0p6ZEdWd1NXUmNJanBjSW5OMFpYQXZMMlYyWlVBd0xqRTJMakl2TDJacGNtVlRaWE56YVc5dVEyRnNiR0poWTJ0VGRHVndYQ0o5ZlgxOUtpODdYRzVsZUhCdmNuUWdkbUZ5SUdacGNtVlRaWE56YVc5dVEyRnNiR0poWTJ0VGRHVndJRDBnWjJ4dlltRnNWR2hwYzF0VGVXMWliMnd1Wm05eUtGd2lWMDlTUzBaTVQxZGZWVk5GWDFOVVJWQmNJaWxkS0Z3aWMzUmxjQzh2WlhabFFEQXVNVFl1TWk4dlptbHlaVk5sYzNOcGIyNURZV3hzWW1GamExTjBaWEJjSWlrN1hHNGlMQ0pwYlhCdmNuUjdZM0psWVhSbFNHOXZhMzFtY205dFhDSWpZMjl0Y0dsc1pXUXZRSGR2Y210bWJHOTNMMk52Y21VdmFXNWtaWGd1YW5OY0lqdHBiWEJ2Y25SN1kyeGhhVzFJYjI5clQzZHVaWEp6YUdsd0xHUnBjM0J2YzJWSWIyOXJmV1p5YjIxY0lpTmxlR1ZqZFhScGIyNHZhRzl2YXkxdmQyNWxjbk5vYVhBdWFuTmNJanRtZFc1amRHbHZiaUJqY21WaGRHVlRaWE56YVc5dVJHVnNhWFpsY25sSWIyOXJLSElwZTJ4bGRDQnBMR0U5VzEwc2J6MWJYU3h6UFRBc1l6MXVkV3hzTEd3c2RTeGxibkYxWlhWbFBXVTlQbnR2TG5CMWMyZ29aU2tzYnk1emIzSjBLQ2hsTEhRcFBUNWxMbTl5WkdWeUxYUXViM0prWlhJcExIVS9MaWdwTEhVOWRtOXBaQ0F3ZlN4aGNtMDlaVDArZTJVdVkyeHZjMlZrZkh4bExuQmxibVJwYm1kOGZDaGxMbkJsYm1ScGJtYzlJVEFzWlM1eVpYTnZiSFpsWkQxMmIybGtJREFzS0dVdWNtVjBhWEpsWkQ5UWNtOXRhWE5sTG5KbGMyOXNkbVVvWlM1b2IyOXJLUzUwYUdWdUtHVTlQaWg3Wkc5dVpUb2hNU3gyWVd4MVpUcGxmU2twT21VdWFYUmxjbUYwYjNJdWJtVjRkQ2dwS1M1MGFHVnVLSFE5UG50c1pYUWdiajE3YjNKa1pYSTZjeXNyTEhKbGMzVnNkRHAwTEhOMFlYUmxPbVY5TzJVdWNtVnpiMngyWldROWJpeGxMbVZ1WVdKc1pXUW1KbVZ1Y1hWbGRXVW9iaWw5TENncFBUNTdmU2twZlN4bGJtRmliR1U5WlQwK2UyVXVaVzVoWW14bFpEMGhNQ3hsTG5KbGMyOXNkbVZrSVQwOWRtOXBaQ0F3SmlabGJuRjFaWFZsS0dVdWNtVnpiMngyWldRcGZTeGtjbUZwYmxKbFlXUjVQV0Z6ZVc1aktDazlQbnRwWmloalBUMDliblZzYkNsbWIzSW9ZWGRoYVhRZ1VISnZiV2x6WlM1eVpYTnZiSFpsS0NrN2J5NXNaVzVuZEdnK01Ec3BlMnhsZENCbFBXOHVjMmhwWm5Rb0tUdGxMbk4wWVhSbExuQmxibVJwYm1jOUlURXNaUzV6ZEdGMFpTNXlaWE52YkhabFpEMTJiMmxrSURBc1pTNXlaWE4xYkhRdVpHOXVaVDlsTG5OMFlYUmxMbU5zYjNObFpEMGhNRHBsTG5KbGMzVnNkQzUyWVd4MVpTNXJhVzVrUFQwOVlHUmxiR2wyWlhKZ0ppWnlMbkIxYzJnb1pTNXlaWE4xYkhRdWRtRnNkV1VwTEdGeWJTaGxMbk4wWVhSbEtTeGhkMkZwZENCUWNtOXRhWE5sTG5KbGMyOXNkbVVvS1gxOU8zSmxkSFZ5Ym50amIyNXpkVzFsVG1WNGRDZ3BlMmxtS0d3OVBUMTJiMmxrSURBcGRHaHliM2NnUlhKeWIzSW9ZRU5oYm01dmRDQmpiMjV6ZFcxbElHRWdjSFZpYkdsaklHUmxiR2wyWlhKNUlHSmxabTl5WlNCcGRDQnlaWE52YkhabGN5NWdLVHRzTG5OMFlYUmxMbkJsYm1ScGJtYzlJVEVzYkM1emRHRjBaUzV5WlhOdmJIWmxaRDEyYjJsa0lEQXNiQzV5WlhOMWJIUXVaRzl1WlNZbUtHd3VjM1JoZEdVdVkyeHZjMlZrUFNFd0tTeHNQWFp2YVdRZ01DeGpQVzUxYkd4OUxHRnplVzVqSUdScGMzQnZjMlVvS1h0cElUMDlkbTlwWkNBd0ppWW9ZWGRoYVhRZ1pHbHpjRzl6WlVodmIyc29hUzVvYjI5cktTeHBQWFp2YVdRZ01DbDlMRzVsZUhRb0tYdHBaaWhwUFQwOWRtOXBaQ0F3S1hSb2NtOTNJRVZ5Y205eUtHQkRZVzV1YjNRZ2QyRnBkQ0JtYjNJZ1pHVnNhWFpsY21sbGN5QmlaV1p2Y21VZ1lTQmpiMjUwYVc1MVlYUnBiMjRnZEc5clpXNGdhWE1nWVhaaGFXeGhZbXhsTG1BcE8ybG1LR01oUFQxdWRXeHNLWEpsZEhWeWJpQmpPMkZ5YlNocEtUdG1iM0lvYkdWMElHVWdiMllnWVNsaGNtMG9aU2s3Y21WMGRYSnVJR2t1WTJ4dmMyVmtKaVpoTG1WMlpYSjVLR1U5UG1VdVkyeHZjMlZrS1Q4b2JEMTdiM0prWlhJNmN5c3JMSEpsYzNWc2REcDdaRzl1WlRvaE1DeDJZV3gxWlRwMmIybGtJREI5TEhOMFlYUmxPbWw5TEdNOVVISnZiV2x6WlM1eVpYTnZiSFpsS0d3dWNtVnpkV3gwS1N4aktUb29ZejBvWVhONWJtTW9LVDArZTJadmNpZzdieTVzWlc1bmRHZzlQVDB3T3lsaGQyRnBkQ0J1WlhjZ1VISnZiV2x6WlNobFBUNTdkVDFsZlNrN2JHVjBJR1U5Ynk1emFHbG1kQ2dwTzNKbGRIVnliaUJzUFdVc1pTNXlaWE4xYkhSOUtTZ3BMR01wZlN4aGMzbHVZeUJ5Wld0bGVTaHlLWHRwWmlnaGNueDhhVDh1YUc5dmF5NTBiMnRsYmowOVBYSXBjbVYwZFhKdU8yeGxkQ0J2UFdOeVpXRjBaVWh2YjJzb2UzUnZhMlZ1T25KOUtTeHpQWHRqYkc5elpXUTZJVEVzWlc1aFlteGxaRG9oTVN4b2IyOXJPbThzYVhSbGNtRjBiM0k2YjF0VGVXMWliMnd1WVhONWJtTkpkR1Z5WVhSdmNsMG9LU3h3Wlc1a2FXNW5PaUV4TEhKbGRHbHlaV1E2SVRGOU8ybG1LR2s5UFQxMmIybGtJREFwZTJGM1lXbDBJR05zWVdsdFNHOXZhMDkzYm1WeWMyaHBjQ2h6TG1odmIyc3BMR1Z1WVdKc1pTaHpLU3hwUFhNN2NtVjBkWEp1Zld4bGRDQmpQV2s3WVhKdEtHTXBMR0Z5YlNoektTeGhkMkZwZENCamJHRnBiVWh2YjJ0UGQyNWxjbk5vYVhBb2N5NW9iMjlyS1N4bGJtRmliR1VvY3lrc1lYZGhhWFFnWkhKaGFXNVNaV0ZrZVNncE8zUnllWHRoZDJGcGRDQmthWE53YjNObFNHOXZheWhqTG1odmIyc3BmV05oZEdOb0tHVXBlMms5ZG05cFpDQXdPM1J5ZVh0aGQyRnBkQ0JrYVhOd2IzTmxTRzl2YXloekxtaHZiMnNwZldOaGRHTm9lMzEwYUhKdmR5QmxmV011Y21WMGFYSmxaRDBoTUN4aExuQjFjMmdvWXlrc2FUMXpMR0YzWVdsMElHUnlZV2x1VW1WaFpIa29LWDE5ZldWNGNHOXlkSHRqY21WaGRHVlRaWE56YVc5dVJHVnNhWFpsY25sSWIyOXJmVHNpTENJdktpcGZYMmx1ZEdWeWJtRnNYM2R2Y210bWJHOTNjM3RjSW5kdmNtdG1iRzkzYzF3aU9udGNJbVJwYzNRdmMzSmpMMlY0WldOMWRHbHZiaTkzYjNKclpteHZkeTFsYm5SeWVTNXFjMXdpT250Y0luZHZjbXRtYkc5M1JXNTBjbmxjSWpwN1hDSjNiM0pyWm14dmQwbGtYQ0k2WENKM2IzSnJabXh2ZHk4dlpYWmxMeTkzYjNKclpteHZkMFZ1ZEhKNVhDSjlmWDE5S2k4N1hHNXBiWEJ2Y25SN1pXMXBkRlJsY20xcGJtRnNVMlZ6YzJsdmJrWmhhV3gxY21WVGRHVndmV1p5YjIxY0lpTmxlR1ZqZFhScGIyNHZkMjl5YTJac2IzY3RjM1JsY0hNdWFuTmNJanRwYlhCdmNuUjdZM0psWVhSbFNHOXZheXhuWlhSWGIzSnJa", - "bXh2ZDAxbGRHRmtZWFJoTEdkbGRGZHlhWFJoWW14bGZXWnliMjFjSWlOamIyMXdhV3hsWkM5QWQyOXlhMlpzYjNjdlkyOXlaUzlwYm1SbGVDNXFjMXdpTzJsdGNHOXlkSHRqYkc5elpVaHZiMnRKZEdWeVlYUnZjaXhrYVhOd2IzTmxTRzl2YTMxbWNtOXRYQ0lqWlhobFkzVjBhVzl1TDJodmIyc3RiM2R1WlhKemFHbHdMbXB6WENJN2FXMXdiM0owZTI1dmNtMWhiR2w2WlZObGNtbGhiR2w2WVdKc1pVVnljbTl5ZldaeWIyMWNJaU5sZUdWamRYUnBiMjR2ZDI5eWEyWnNiM2N0WlhKeWIzSnpMbXB6WENJN2FXMXdiM0owZTNKdmRYUmxSR1ZzYVhabGNsUnZRMmhwYkdSeVpXNTlabkp2YlZ3aUkyVjRaV04xZEdsdmJpOXliM1YwWlMxamFHbHNaQzFrWld4cGRtVnllUzVxYzF3aU8ybHRjRzl5ZEh0amIyRnNaWE5qWlVSbGJHbDJaWEpwWlhOOVpuSnZiVndpSTJoaGNtNWxjM012YldWemMyRm5aWE11YW5OY0lqdHBiWEJ2Y25SN2NtVmhaRU5vWVc1dVpXeFNaWEYxWlhOMFNXUXNjbVZoWkZKdmIzUlRaWE56YVc5dVNXUjlabkp2YlZ3aUkyVjRaV04xZEdsdmJpOWxkbVV0ZDI5eWEyWnNiM2N0WVhSMGNtbGlkWFJsY3k1cWMxd2lPMmx0Y0c5eWRIdHViM1JwWm5sRVpXeGxaMkYwWldSUVlYSmxiblJUZEdWd2ZXWnliMjFjSWlObGVHVmpkWFJwYjI0dlpHVnNaV2RoZEdWa0xYQmhjbVZ1ZEMxdWIzUnBabWxqWVhScGIyNHVhbk5jSWp0cGJYQnZjblI3WTNKbFlYUmxSR1ZzWldkaGRHVmtVM1ZpWVdkbGJuUkZjbkp2Y2xKbGMzVnNkQ3hqY21WaGRHVkVaV3hsWjJGMFpXUlRkV0poWjJWdWRGTjFZMk5sYzNOU1pYTjFiSFI5Wm5KdmJWd2lJMlY0WldOMWRHbHZiaTlrWld4bFoyRjBaV1F0Y0dGeVpXNTBMWEpsYzNWc2RDNXFjMXdpTzJsdGNHOXlkSHRrYVhOd1lYUmphRUZ1WkVGM1lXbDBWSFZ5Ym4xbWNtOXRYQ0lqWlhobFkzVjBhVzl1TDNSMWNtNHRaR2x6Y0dGMFkyZ3Vhbk5jSWp0cGJYQnZjblI3WTNKbFlYUmxVMlZ6YzJsdmJsTjBaWEI5Wm5KdmJWd2lJMlY0WldOMWRHbHZiaTlqY21WaGRHVXRjMlZ6YzJsdmJpMXpkR1Z3TG1welhDSTdhVzF3YjNKMGUyWnBjbVZUWlhOemFXOXVRMkZzYkdKaFkydFRkR1Z3ZldaeWIyMWNJaU5sZUdWamRYUnBiMjR2YzJWemMybHZiaTFqWVd4c1ltRmpheTF6ZEdWd0xtcHpYQ0k3YVcxd2IzSjBlMk55WldGMFpWTmxjM05wYjI1RVpXeHBkbVZ5ZVVodmIydDlabkp2YlZ3aUkyVjRaV04xZEdsdmJpOXpaWE56YVc5dUxXUmxiR2wyWlhKNUxXaHZiMnN1YW5OY0lqdGhjM2x1WXlCbWRXNWpkR2x2YmlCM2IzSnJabXh2ZDBWdWRISjVLSFFwZTJ4bGRIdDNiM0pyWm14dmQxSjFia2xrT21sOVBXZGxkRmR2Y210bWJHOTNUV1YwWVdSaGRHRW9LU3hoUFhRdWMyVnlhV0ZzYVhwbFpFTnZiblJsZUhSYllHVjJaUzVqYjI1MGFXNTFZWFJwYjI1VWIydGxibUJkZkh4Z1lDeHpQWFF1YzJWeWFXRnNhWHBsWkVOdmJuUmxlSFJiWUdWMlpTNXRiMlJsWUYwc1l6MTBMbk5sY21saGJHbDZaV1JEYjI1MFpYaDBXMkJsZG1VdVkyRndZV0pwYkdsMGFXVnpZRjBzZFQxMExuTmxjbWxoYkdsNlpXUkRiMjUwWlhoMFcyQmxkbVV1WW5WdVpHeGxZRjA3ZEM1elpYSnBZV3hwZW1Wa1EyOXVkR1Y0ZEZ0Z1pYWmxMbk5sYzNOcGIyNUpaR0JkUFdrN2JHVjBJR1E5WjJWMFYzSnBkR0ZpYkdVb0tUdDBjbmw3YkdWMElHVTljbVZoWkZKdmIzUlRaWE56YVc5dVNXUW9kQzV6WlhKcFlXeHBlbVZrUTI5dWRHVjRkQ2tzZTNOMFlYUmxPbTU5UFdGM1lXbDBJR055WldGMFpWTmxjM05wYjI1VGRHVndLSHRqYjIxd2FXeGxaRUZ5ZEdsbVlXTjBjMU52ZFhKalpUcDFMbk52ZFhKalpTeGpiMjUwYVc1MVlYUnBiMjVVYjJ0bGJqcGhMRzV2WkdWSlpEcDFMbTV2WkdWSlpDeHZkWFJ3ZFhSVFkyaGxiV0U2ZEM1cGJuQjFkQzV2ZFhSd2RYUlRZMmhsYldFc2NtOXZkRk5sYzNOcGIyNUpaRHBsTEhObGMzTnBiMjVKWkRwcGZTazdjbVYwZFhKdUlHRjNZV2wwSUhKMWJrUnlhWFpsY2t4dmIzQW9lMk5oY0dGaWFXeHBkR2xsY3pwakxHUnlhWFpsY2xkeWFYUmhZbXhsT21Rc2FXNXBkR2xoYkVsdWNIVjBPbnRyYVc1a09tQmtaV3hwZG1WeVlDeHdZWGxzYjJGa2N6cGJlMjFsYzNOaFoyVTZkQzVwYm5CMWRDNXRaWE56WVdkbExHTnZiblJsZUhRNmRDNXBibkIxZEM1amIyNTBaWGgwTEc5MWRIQjFkRk5qYUdWdFlUcDBMbWx1Y0hWMExtOTFkSEIxZEZOamFHVnRZWDFkTEhKbGNYVmxjM1JKWkRweVpXRmtRMmhoYm01bGJGSmxjWFZsYzNSSlpDaDBMbk5sY21saGJHbDZaV1JEYjI1MFpYaDBLWDBzYlc5a1pUcHpMSE5sY21saGJHbDZaV1JEYjI1MFpYaDBPblF1YzJWeWFXRnNhWHBsWkVOdmJuUmxlSFFzYzJWemMybHZibE4wWVhSbE9tNTlLWDFqWVhSamFDaHVLWHQwYUhKdmR5QmhkMkZwZENCbGJXbDBWR1Z5YldsdVlXeFRaWE56YVc5dVJtRnBiSFZ5WlZOMFpYQW9lMlZ5Y205eU9tNXZjbTFoYkdsNlpWTmxjbWxoYkdsNllXSnNaVVZ5Y205eUtHNHBMSEJoY21WdWRGZHlhWFJoWW14bE9tUXNjMlZ5YVdGc2FYcGxaRU52Ym5SbGVIUTZkQzV6WlhKcFlXeHBlbVZrUTI5dWRHVjRkSDBwTEdGM1lXbDBJR1pwY21WVFpYTnphVzl1UTJGc2JHSmhZMnRUZEdWd0tIdGxjbkp2Y2pwdWIzSnRZV3hwZW1WVFpYSnBZV3hwZW1GaWJHVkZjbkp2Y2lodUtTeHpaWEpwWVd4cGVtVmtRMjl1ZEdWNGREcDBMbk5sY21saGJHbDZaV1JEYjI1MFpYaDBMSE4wWVhSMWN6cGdabUZwYkdWa1lIMHBMR0YzWVdsMElHNXZkR2xtZVVSbGJHVm5ZWFJsWkZCaGNtVnVkRk4wWlhBb2UzSmxjM1ZzZERwamNtVmhkR1ZFWld4bFoyRjBaV1JUZFdKaFoyVnVkRVZ5Y205eVVtVnpkV3gwS0hRdWMyVnlhV0ZzYVhwbFpFTnZiblJsZUhRc2Jpa3NjMlZ5YVdGc2FYcGxaRU52Ym5SbGVIUTZkQzV6WlhKcFlXeHBlbVZrUTI5dWRHVjRkSDBwTEc1OWZXRnplVzVqSUdaMWJtTjBhVzl1SUhKMWJrUnlhWFpsY2t4dmIzQW9aU2w3YkdWMElHNDlZM0psWVhSbFNHOXZheWg3ZEc5clpXNDZZQ1I3WlM1elpYTnphVzl1VTNSaGRHVXVjMlZ6YzJsdmJrbGtmVHBoZFhSb1lIMHBMSEk5Ymx0VGVXMWliMnd1WVhONWJtTkpkR1Z5WVhSdmNsMG9LU3h2UFRBc2JtVjRkRlIxY201RGIyNTBjbTlzVkc5clpXNDlLQ2s5UG1Ba2UyVXVjMlZ6YzJsdmJsTjBZWFJsTG5ObGMzTnBiMjVKWkgwNmRIVnliaTFqYjI1MGNtOXNPaVI3VTNSeWFXNW5LRzhyS3lsOVlDeGpQVnRkTEd3OVkzSmxZWFJsVTJWemMybHZia1JsYkdsMlpYSjVTRzl2YXloaktUdDBjbmw3WlM1elpYTnphVzl1VTNSaGRHVXVZMjl1ZEdsdWRXRjBhVzl1Vkc5clpXNG1KbUYzWVdsMElHd3VjbVZyWlhrb1pTNXpaWE56YVc5dVUzUmhkR1V1WTI5dWRHbHVkV0YwYVc5dVZHOXJaVzRwTzJ4bGRDQjBQV0YzWVdsMElHUnBjM0JoZEdOb1FXNWtRWGRoYVhSVWRYSnVLSHRpZFdabVpYSmxaRVJsYkdsMlpYSnBaWE02WXl4allYQmhZbWxzYVhScFpYTTZaUzVqWVhCaFltbHNhWFJwWlhNc1kyOXVkSEp2YkZSdmEyVnVPbTVsZUhSVWRYSnVRMjl1ZEhKdmJGUnZhMlZ1S0Nrc1pHVnNhWFpsY25rNlpTNXBibWwwYVdGc1NXNXdkWFFzWkdWc2FYWmxjbmxJYjI5ck9td3NiVzlrWlRwbExtMXZaR1VzY0dGeVpXNTBWM0pwZEdGaWJHVTZaUzVrY21sMlpYSlhjbWwwWVdKc1pTeHpaWEpwWVd4cGVtVmtRMjl1ZEdWNGREcGxMbk5sY21saGJHbDZaV1JEYjI1MFpYaDBMSE5sYzNOcGIyNVRkR0YwWlRwbExuTmxjM05wYjI1VGRHRjBaWDBwTzJadmNpZzdPeWw3YVdZb2RDNXJhVzVrUFQwOVlHUnZibVZnS1hKbGRIVnliaUJoZDJGcGRDQm1hVzVoYkdsNlpVUnZibVVvZTJGamRHbHZianAwTEdSeWFYWmxjbGR5YVhSaFlteGxPbVV1WkhKcGRtVnlWM0pwZEdGaWJHVjlLVHRwWmloMExtdHBibVFoUFQxZ2NHRnlhMkFwZEdoeWIzY2dSWEp5YjNJb1lFUnlhWFpsY2lCeVpXTmxhWFpsWkNCMWJtVjRjR1ZqZEdWa0lIUjFjbTRnWVdOMGFXOXVJRndpSkh0MExtdHBibVI5WENJdVlDazdhV1lvSVhRdWMyVnpjMmx2YmxOMFlYUmxMbU52Ym5ScGJuVmhkR2x2YmxSdmEyVnVLWFJvY205M0lFVnljbTl5S0Z3aVEyRnVibTkwSUhCaGNtczZJRzV2SUdOdmJuUnBiblZoZEdsdmJpQjBiMnRsYmlCaGRtRnBiR0ZpYkdVdUlGUm9aU0JqYUdGdWJtVnNJRzExYzNRZ2NHOXpkQ0IwYUdVZ1ptbHljM1FnYldWemMyRm5aU0JrZFhKcGJtY2dkR2hsSUdsdWFYUnBZV3dnZEhWeWJpQW9ZVzVqYUc5eWFXNW5JSFJvWlNCelpYTnphVzl1S1NCdmNpQmdjMlZ1WkNncFlDQnRkWE4wSUdKbElHTmhiR3hsWkNCM2FYUm9JR0Z1SUdWNGNHeHBZMmwwSUdOdmJuUnBiblZoZEdsdmJsUnZhMlZ1TGx3aUtUdHBaaWhoZDJGcGRDQnNMbkpsYTJWNUtIUXVjMlZ6YzJsdmJsTjBZWFJsTG1OdmJuUnBiblZoZEdsdmJsUnZhMlZ1S1N4MExtRjFkR2h2Y21sNllYUnBiMjVPWVcxbGN5WW1kQzVoZFhSb2IzSnBlbUYwYVc5dVRtRnRaWE11YkdWdVozUm9QakFwZTJ4bGRDQnVQWFF1WVhWMGFHOXlhWHBoZEdsdmJrNWhiV1Z6TG14bGJtZDBhQ3hwUFZ0ZE8yWnZjaWc3YVM1c1pXNW5kR2c4YmpzcGUyeGxkQ0JsUFdGM1lXbDBJSEl1Ym1WNGRDZ3BPMmxtS0dVdVpHOXVaU2xpY21WaGF6dGxMblpoYkhWbExtdHBibVE5UFQxZ1pHVnNhWFpsY21BbUpta3VjSFZ6YUNndUxpNWxMblpoYkhWbExuQmhlV3h2WVdSektYMTBQV0YzWVdsMElHUnBjM0JoZEdOb1FXNWtRWGRoYVhSVWRYSnVLSHRpZFdabVpYSmxaRVJsYkdsMlpYSnBaWE02WXl4allYQmhZbWxzYVhScFpYTTZaUzVqWVhCaFltbHNhWFJwWlhNc1kyOXVkSEp2YkZSdmEyVnVPbTVsZUhSVWRYSnVRMjl1ZEhKdmJGUnZhMlZ1S0Nrc1pHVnNhWFpsY25rNmUydHBibVE2WUdSbGJHbDJaWEpnTEhCaGVXeHZZV1J6T21sOUxHUmxiR2wyWlhKNVNHOXZhenBzTEcxdlpHVTZaUzV0YjJSbExIQmhjbVZ1ZEZkeWFYUmhZbXhsT21VdVpISnBkbVZ5VjNKcGRHRmliR1VzYzJWeWFXRnNhWHBsWkVOdmJuUmxlSFE2ZEM1elpYSnBZV3hwZW1Wa1EyOXVkR1Y0ZEN4elpYTnphVzl1VTNSaGRHVTZkQzV6WlhOemFXOXVVM1JoZEdWOUtUdGpiMjUwYVc1MVpYMXNaWFFnYmoxaGQyRnBkQ0IzWVdsMFJtOXlUbVY0ZEVSbGJHbDJaWElvZTJKMVptWmxjbVZrUkdWc2FYWmxjbWxsY3pwakxHUmxiR2wyWlhKNVNHOXZhenBzZlNrN2FXWW9iajA5UFc1MWJHd3BjbVYwZFhKdWUyOTFkSEIxZERwZ1lIMDdiR1YwSUdrOVlYZGhhWFFnY205MWRHVkVaV3hwZG1WeVZHOURhR2xzWkhKbGJpaDdZWFYwYURwdUxtRjFkR2dzY0dGeVpXNTBWM0pwZEdGaWJHVTZaUzVrY21sMlpYSlhjbWwwWVdKc1pTeHdZWGxzYjJGa2N6cHVMbkJoZVd4dllXUnpMSE5sYzNOcGIyNVRkR0YwWlRwMExuTmxjM05wYjI1VGRHRjBaWDBwTzJraFBUMTJiMmxrSURBbUppaDBQV0YzWVdsMElHUnBjM0JoZEdOb1FXNWtRWGRoYVhSVWRYSnVLSHRpZFdabVpYSmxaRVJsYkdsMlpYSnBaWE02WXl4allYQmhZbWxzYVhScFpYTTZaUzVqWVhCaFltbHNhWFJwWlhNc1kyOXVkSEp2YkZSdmEyVnVPbTVsZUhSVWRYSnVRMjl1ZEhKdmJGUnZhMlZ1S0Nrc1pHVnNhWFpsY25rNmUyRjFkR2c2Ymk1aGRYUm9MR3RwYm1RNllHUmxiR2wyWlhKZ0xIQmhlV3h2WVdSek9sdHBYU3h5WlhGMVpYTjBTV1E2Ymk1eVpYRjFaWE4wU1dSOUxHUmxiR2wyWlhKNVNHOXZhenBzTEcxdlpHVTZaUzV0YjJSbExIQmhjbVZ1ZEZkeWFYUmhZbXhsT21VdVpISnBkbVZ5VjNKcGRHRmliR1VzYzJWeWFXRnNhWHBsWkVOdmJuUmxlSFE2ZEM1elpYSnBZV3hwZW1Wa1EyOXVkR1Y0ZEN4elpYTnphVzl1VTNSaGRHVTZkQzV6WlhOemFXOXVVM1JoZEdWOUtTbDlmV1pwYm1Gc2JIbDdZWGRoYVhRZ2JDNWthWE53YjNObEtDa3NZWGRoYVhRZ1kyeHZjMlZJYjI5clNYUmxjbUYwYjNJb2Npa3NZWGRoYVhRZ1pHbHpjRzl6WlVodmIyc29iaWw5ZldGemVXNWpJR1oxYm1OMGFXOXVJR1pwYm1Gc2FYcGxSRzl1WlNobEtYdHNaWFI3YjNWMGNIVjBPblFzYzJWeWFXRnNhWHBsWkVOdmJuUmxlSFE2Ym4wOVpTNWhZM1JwYjI0c2NqMWxMbUZqZEdsdmJpNXBjMFZ5Y205eVBUMDlJVEE3Y21WMGRYSnVJR0YzWVdsMElHWnBjbVZUWlhOemFXOXVRMkZzYkdKaFkydFRkR1Z3S0h0bGNuSnZjanB5UDNRNmRtOXBaQ0F3TEc5MWRIQjFkRHB5UDNadmFXUWdNRHAwTEhObGNtbGhiR2w2WldSRGIyNTBaWGgwT200c2MzUmhkSFZ6T25JL1lHWmhhV3hsWkdBNllHTnZiWEJzWlhSbFpHQjlLU3hoZDJGcGRDQnViM1JwWm5sRVpXeGxaMkYwWldSUVlYSmxiblJUZEdWd0tIdHlaWE4xYkhRNmNqOWpjbVZoZEdWRVpXeGxaMkYwWldSVGRXSmhaMlZ1ZEVWeWNtOXlVbVZ6ZFd4MEtHNHNkQ2s2WTNKbFlYUmxSR1ZzWldkaGRHVmtVM1ZpWVdkbGJuUlRkV05qWlhOelVtVnpkV3gwS0c0c2RDa3NjMlZ5YVdGc2FYcGxaRU52Ym5SbGVIUTZibjBwTEh0dmRYUndkWFE2ZEgxOVlYTjVibU1nWm5WdVkzUnBiMjRnZDJGcGRFWnZjazVsZUhSRVpXeHBkbVZ5S0dVcGUybG1LR1V1WW5WbVptVnlaV1JFWld4cGRtVnlhV1Z6TG14bGJtZDBhRDR3S1hKbGRIVnliaUJqYjJGc1pYTmpaVVJsYkdsMlpYSnBaWE1vWlM1aWRXWm1aWEpsWkVSbGJHbDJaWEpwWlhNdWMzQnNhV05sS0RBcEtUdG1iM0lvT3pzcGUyeGxkQ0IwUFdGM1lXbDBJR1V1WkdWc2FYWmxjbmxJYjI5ckxtNWxlSFFvS1R0cFppaGxMbVJsYkdsMlpYSjVTRzl2YXk1amIyNXpkVzFsVG1WNGRDZ3BMSFF1Wkc5dVpTbHlaWFIxY200Z2JuVnNiRHRwWmloMExuWmhiSFZsTG10cGJtUWhQVDFnWkdWc2FYWmxjbUFwWTI5dWRHbHVkV1U3YkdWMElHNDlkQzUyWVd4MVpUdG1iM0lvT3pzcGUyeGxkQ0IwUFdGM1lXbDBJSFJoYTJWU1pXRmtlVkJoZVd4dllXUW9aUzVrWld4cGRtVnllVWh2YjJzdWJtVjRkQ2dwS1R0cFppaDBQVDA5VGs5ZlVrVkJSRmxmVFVWVFUwRkhSWHg4S0dVdVpHVnNhWFpsY25sSWIyOXJMbU52Ym5OMWJXVk9aWGgwS0Nrc2RDNWtiMjVsS1NsaWNtVmhhenQwTG5aaGJIVmxMbXRwYm1ROVBUMWdaR1ZzYVhabGNtQW1KaWh1UFdOdllXeGxjMk5sUkdWc2FYWmxjbWxsY3loYmJpeDBMblpoYkhWbFhTa3BmWEpsZEhWeWJpQnVmWDFqYjI1emRDQk9UMTlTUlVGRVdWOU5SVk5UUVVkRlBWTjViV0p2YkNoZ2JtOHRjbVZoWkhrdGJXVnpjMkZuWldBcE8yRnplVzVqSUdaMWJtTjBhVzl1SUhSaGEyVlNaV0ZrZVZCaGVXeHZZV1FvWlNsN2NtVjBkWEp1SUdGM1lXbDBJRkJ5YjIxcGMyVXVjbVZ6YjJ4MlpTZ3BMR0YzWVdsMElGQnliMjFwYzJVdWNtRmpaU2hiWlN4UWNtOXRhWE5sTG5KbGMyOXNkbVVvVGs5ZlVrVkJSRmxmVFVWVFUwRkhSU2xkS1gxbGVIQnZjblI3ZDI5eWEyWnNiM2RGYm5SeWVYMDdYRzUzYjNKclpteHZkMFZ1ZEhKNUxuZHZjbXRtYkc5M1NXUWdQU0JjSW5kdmNtdG1iRzkzTHk5bGRtVXZMM2R2Y210bWJHOTNSVzUwY25sY0lqdGNibWRzYjJKaGJGUm9hWE11WDE5d2NtbDJZWFJsWDNkdmNtdG1iRzkzY3k1elpYUW9YQ0ozYjNKclpteHZkeTh2WlhabEx5OTNiM0pyWm14dmQwVnVkSEo1WENJc0lIZHZjbXRtYkc5M1JXNTBjbmtwTzF4dUlsMHNJbTFoY0hCcGJtZHpJam9pTzBGQlFXOVRMRWxCUVVrc1dVRkJWVHM3TzBGRFFYTkNMRk5CUVZNc01FSkJRVEJDTEVkQlFVVTdRMEZCUXl4UlFVRlBMRVZCUVVVc1RVRkJWRHRGUVVGbExFdEJRVWtzY1VKQlFXOUNMRTlCUVUwc05rSkJRVFpDTEVWQlFVVTdSVUZCVXl4TFFVRkpMRzFDUVVGclFpeFBRVUZOTEdsQ1FVRnBRaXhGUVVGRkxHRkJRV0VzUjBGQlJ5eEZRVUZGTzBWQlFWTXNTMEZCU1N4bFFVRmpMRTlCUVUwc1lVRkJZU3hGUVVGRkxGTkJRVk1zUjBGQlJ5eEZRVUZGTzBOQlFWRTdRVUZCUXpzN08wRkRRWE55UXl4VFFVRlRMRzFEUVVGdFF5eEhRVUZGTzBOQlFVTXNTVUZCU1N4SlFVRkZMRWxCUVVrc1NVRkJTU3hGUVVGRkxGZEJRVmNzUjBGQlJTeEpRVUZGTEVsQlFVa3NTVUZCUlR0RFFVRkZMRXRCUVVrc1NVRkJTU3hMUVVGTExFVkJRVVVzVTBGQlVUdEZRVUZETEVsQlFVa3NTVUZCUlN3d1FrRkJNRUlzUTBGQlF6dEZRVUZGTEVWQlFVVXNTVUZCU1N4RFFVRkRMRXRCUVVjc1JVRkJSU3hKUVVGSkxFZEJRVVVzUTBGQlF6dERRVUZETzBOQlFVTXNTVUZCU1N4SlFVRkZMRU5CUVVNN1EwRkJSU3hMUVVGSkxFbEJRVWtzUzBGQlN5eEZRVUZGTEdGQlFWazdSVUZCUXl4SlFVRkpMRWxCUVVVc1JVRkJSU3hKUVVGSkxFTkJRVU03UlVGQlJTeEpRVUZITEUxQlFVa3NTMEZCU3l4SFFVRkZPMFZCUVU4c1JVRkJSU3hMUVVGTExFTkJRVU03UTBGQlF6dERRVUZETEU5QlFVODdRVUZCUXpzN08wRkRRMnhuUlN4SlFVRlhMRFpDUVVFMlFpeFhRVUZYTEU5QlFVOHNTVUZCU1N4dFFrRkJiVUlzUlVGQlJTeERRVUZETERoRFFVRTRRenM3TzBGRFJHeEpMRk5CUVZNc2VVTkJRWGRETzBOQlFVTXNUMEZCVHl4UlFVRlJMRWxCUVVrc1pVRkJZU3huUWtGQll5eFJRVUZSTEVsQlFVa3NaME5CUVRoQ0xGZEJRVmNzVVVGQlVTeEpRVUZKTEd0RFFVRm5RenRCUVVGSk8wRkJRVU1zVTBGQlV5d3JRa0ZCSzBJc1IwRkJSVHREUVVGRExFbEJRVWtzU1VGQlJTeFJRVUZSTEVsQlFVa3NlVUpCUVhsQ0xFdEJRVXNzUzBGQlJ5eExRVUZMTzBOQlFVVXNVVUZCVHl4MVEwRkJkVU1zUzBGQlJ5eExRVUZITEVWQlFVRXNRMEZCUnl4UlFVRlJMRTlCUVUwc1JVRkJSVHRCUVVGRE96czdRVU5EYmxnc1NVRkJWeXhYUVVGWExGZEJRVmNzVDBGQlR5eEpRVUZKTEcxQ1FVRnRRaXhGUVVGRkxFTkJRVU1zTkVKQlFUUkNPMEZCUXpsR0xFbEJRVmNzYVVOQlFXbERMRmRCUVZjc1QwRkJUeXhKUVVGSkxHMUNRVUZ0UWl4RlFVRkZMRU5CUVVNc2EwUkJRV3RFTzBGQlF6RkpMRWxCUVZjc01rSkJRVEpDTEZkQlFWY3NUMEZCVHl4SlFVRkpMRzFDUVVGdFFpeEZRVUZGTEVOQlFVTXNORU5CUVRSRE8wRkJRemxJTEVsQlFWY3NNRUpCUVRCQ0xGZEJRVmNzVDBGQlR5eEpRVUZKTEcxQ1FVRnRRaXhGUVVGRkxFTkJRVU1zTWtOQlFUSkRPMEZCUXpWSUxFbEJRVmNzYlVKQlFXMUNMRmRCUVZjc1QwRkJUeXhKUVVGSkxHMUNRVUZ0UWl4RlFVRkZMRU5CUVVNc2IwTkJRVzlET3pzN1FVTk1PVWNzVFVGQlRTd3dRa0ZCZDBJc1QwRkJUeXhKUVVGSkxHdENRVUZyUWp0QlFVRkZMRTFCUVVFc2RVSkJRWEZDTEU5QlFVOHNTVUZCU1N4elFrRkJjMEk3UVVGQlJTeE5RVUZCTEhsQ1FVRjFRaXhQUVVGUExFbEJRVWtzZDBKQlFYZENPMEZCUVc5RUxFMUJRVUVzY1VKQlFXMUNMRTlCUVU4c1NVRkJTU3h6UWtGQmMwSTdRVUZCUlN4TlFVRkJMR2xDUVVGbE8wRkJRWEZHTEZOQlFWTXNWMEZCVnl4SFFVRkZPME5CUVVNc1NVRkJTU3hKUVVGRkxHVkJRV1U3UTBGQmMwSXNTVUZCUnl4TlFVRkpMRXRCUVVzc1IwRkJSU3hOUVVGTkxFMUJRVTBzT0VSQlFUaEVPME5CUVVVc1QwRkJUeXhGUVVGRkxFTkJRVU03UVVGQlF6dEJRVUZETEZOQlFWTXNjMEpCUVhGQ08wTkJRVU1zU1VGQlNTeEpRVUZGTEdWQlFXVTdRMEZCZVVJc1NVRkJSeXhOUVVGSkxFdEJRVXNzUjBGQlJTeE5RVUZOTEUxQlFVMHNLMFZCUVN0Rk8wTkJRVVVzVDBGQlR6dEJRVUZETzBGQlFVTXNVMEZCVXl4WlFVRlpMRWxCUVVVc1EwRkJReXhIUVVGRk8wTkJRVU1zU1VGQlNTeEpRVUZGTEdWQlFXVTdRMEZCZDBJc1NVRkJSeXhOUVVGSkxFdEJRVXNzUjBGQlJTeE5RVUZOTEUxQlFVMHNLMFJCUVN0RU8wTkJRVVVzU1VGQlNTeEpRVUZGTEVWQlFVVXNSVUZCUlN4VFFVRlRPME5CUVVVc1QwRkJUeXhQUVVGUExFOUJRVThzVjBGQlZ5eGxRVUZsTEZkQlFWVXNSMEZCUlN4eFFrRkJiMEk3UlVGQlF5eFBRVUZOTzBWQlFVVXNWVUZCVXl4RFFVRkRPME5CUVVNc1JVRkJReXhEUVVGRE8wRkJRVU03T3p0QlEwRndaME1zWlVGQlpTeHRRa0ZCYlVJc1IwRkJSVHREUVVGRExFbEJRVWs3UTBGQlJTeEpRVUZITzBWQlFVTXNTVUZCUlN4TlFVRk5MRVZCUVVVc1dVRkJXVHREUVVGRExGTkJRVThzUjBGQlJUdEZRVUZETEU5QlFVOHNUVUZCVFN4blFrRkJaMElzUjBGQlJTeDNRa0ZCZDBJc1IwRkJSU3hGUVVGRkxFdEJRVXNzUTBGQlF6dERRVUZETzBOQlFVTXNTVUZCUnl4TlFVRkpMRTFCUVVzc1QwRkJUeXhOUVVGTkxHZENRVUZuUWl4SFFVRkZMSGRDUVVGM1FpeEZRVUZGTEU5QlFVMHNSVUZCUlN4TFFVRkxMRU5CUVVNN1FVRkJRenRCUVVGRExHVkJRV1VzYTBKQlFXdENMRWRCUVVVN1EwRkJReXhQUVVGUExFVkJRVVVzVlVGQlVTeGpRVUZaTEUxQlFVMHNSVUZCUlN4UFFVRlBMRXRCUVVzc1EwRkJRenRCUVVGRE8wRkJRVU1zWlVGQlpTeFpRVUZaTEVkQlFVVTdRMEZCUXl4SlFVRkpMRWxCUVVVc1JVRkJSVHREUVVGUkxFbEJRVWNzVDBGQlR5eExRVUZITEZsQlFWYzdSVUZCUXl4TlFVRk5MRVZCUVVVc1MwRkJTeXhEUVVGRE8wVkJRVVU3UTBGQlRUdERRVUZETEVsQlFVa3NTVUZCUlN4RlFVRkZMRTlCUVU4N1EwRkJVeXhQUVVGUExFdEJRVWNzWTBGQldTeE5RVUZOTEVWQlFVVXNTMEZCU3l4RFFVRkRPMEZCUVVNN1FVRkJReXhsUVVGbExHZENRVUZuUWl4SFFVRkZMRWRCUVVVN1EwRkJReXhKUVVGSE8wVkJRVU1zVFVGQlRTeFpRVUZaTEVOQlFVTTdRMEZCUXl4UlFVRk5MRU5CUVVNN1EwRkJReXhOUVVGTk8wRkJRVU03UVVGQlF5eFRRVUZUTEhkQ1FVRjNRaXhIUVVGRkxFZEJRVVU3UTBGQlF5eFBRVUZQTEc5Q1FVRnZRaXhEUVVGRExFbEJRVVVzZDBKQlFYZENMRTlCUVU4c1JVRkJSU3hUUVVGUExGZEJRVk1zUlVGQlJTeFJRVUZOTEVkQlFVVXNUMEZCVHl4RlFVRkZMRzlDUVVGclFpeFhRVUZUTEVWQlFVVXNiVUpCUVdsQ0xFdEJRVXNzUTBGQlF5eEpRVUZGTzBGQlFVTTdRVUZCUXl4VFFVRlRMRzlDUVVGdlFpeEhRVUZGTzBOQlFVTXNUMEZCVHl4UFFVRlBMRXRCUVVjc1dVRkJWU3hEUVVGRExFTkJRVU1zUzBGQlJ5eFZRVUZUTEV0QlFVY3NSVUZCUlN4VFFVRlBPMEZCUVcxQ08wRkJRVU1zVTBGQlV5eDNRa0ZCZDBJc1IwRkJSU3hIUVVGRk8wTkJRVU1zU1VGQlNTeEpRVUZGTEUxQlFVa3NTMEZCU3l4SlFVRkZMRXRCUVVjc1ZVRkJWU3hGUVVGRk8wTkJRVWtzVDBGQlR5eFBRVUZQTEU5QlFVOHNUVUZCVFN4bFFVRmxMRVZCUVVVc2NVSkJRWEZDTEVkQlFVY3NSMEZCUlR0RlFVRkRMR3RDUVVGcFFqdEZRVUZGTEUxQlFVczdSVUZCYjBJc1QwRkJUVHREUVVGRExFTkJRVU03UVVGQlF6czdPMEZEUVhab1F5eFRRVUZUTERKQ1FVRXlRaXhIUVVGRk8wTkJRVU1zVDBGQlR5eGhRVUZoTEZGQlFVMDdSVUZCUXl4SFFVRkhMRTlCUVU4c1dVRkJXU3hQUVVGUExGRkJRVkVzUTBGQlF5eERRVUZETzBWQlFVVXNUMEZCVFN4RlFVRkZMRlZCUVZFc1MwRkJTeXhKUVVGRkxFdEJRVXNzU1VGQlJTd3lRa0ZCTWtJc1JVRkJSU3hMUVVGTE8wVkJRVVVzVTBGQlVTeEZRVUZGTzBWQlFWRXNUVUZCU3l4RlFVRkZPMFZCUVVzc1QwRkJUU3hGUVVGRk8wTkJRVXNzU1VGQlJUdEJRVUZETzBGQlFVTXNVMEZCVXl4NVFrRkJlVUlzUjBGQlJUdERRVUZETEVsQlFVY3NRMEZCUXl4VFFVRlRMRU5CUVVNc1IwRkJSU3hQUVVGUExFMUJRVTBzVDBGQlR5eERRVUZETEVOQlFVTTdRMEZCUlN4SlFVRkpMRWxCUVVVc1QwRkJUeXhGUVVGRkxGZEJRVk1zVjBGQlV5eEZRVUZGTEZWQlFWRXNUMEZCVHl4RFFVRkRMRWRCUVVVc1NVRkJSU3hOUVVGTkxFTkJRVU03UTBGQlJTeFBRVUZQTEVWQlFVVXNVVUZCVFN4aFFVRlhMRVZCUVVVc1QwRkJTeXhGUVVGRkxFOUJRVTBzVDBGQlR5eEZRVUZGTEZOQlFVOHNZVUZCVnl4RlFVRkZMRkZCUVUwc1JVRkJSU3hSUVVGUExGZEJRVlVzVFVGQlNTeEZRVUZGTEZGQlFVMHNVMEZCVXl4RlFVRkZMRXRCUVVzc1NVRkJSU3g1UWtGQmVVSXNSVUZCUlN4TFFVRkxMRWxCUVVVc1JVRkJSVHREUVVGUExFbEJRVWtzU1VGQlJUdERRVUZGTEV0QlFVa3NTVUZCUnl4RFFVRkRMRWRCUVVVc1RVRkJTeXhQUVVGUExGRkJRVkVzUTBGQlF5eEhRVUZGTEUxQlFVa3NZVUZCVnl4TlFVRkpMRlZCUVZFc1RVRkJTU3hYUVVGVExFMUJRVWtzV1VGQlZTeEZRVUZGTEV0QlFVYzdRMEZCUnl4UFFVRlBPMEZCUVVNN1FVRkJReXhUUVVGVExGTkJRVk1zUjBGQlJUdERRVUZETEU5QlFVOHNUMEZCVHl4TFFVRkhMRmxCUVZVc1EwRkJReXhEUVVGRE8wRkJRVU03T3p0QlEwTndja0lzU1VGQlZ5eHpRa0ZCYzBJc1YwRkJWeXhQUVVGUExFbEJRVWtzYlVKQlFXMUNMRVZCUVVVc1EwRkJReXgxUTBGQmRVTTdPenRCUTBGd1NDeEpRVUZYTEhGRFFVRnhReXhYUVVGWExFOUJRVThzU1VGQlNTeHRRa0ZCYlVJc1JVRkJSU3hEUVVGRExITkVRVUZ6UkRzN08wRkRSR3hLTEZOQlFWTXNhMEpCUVd0Q0xFZEJRVVU3UTBGQlF5eEpRVUZITEU5QlFVOHNSVUZCUlN4VFFVRlBMRmxCUVZVc1JVRkJSU3hWUVVGUkxFMUJRVXNzVFVGQlRTeE5RVUZOTEVkQlFVY3NSVUZCUlN4TlFVRk5MSGREUVVGM1F6dERRVUZGTEVsQlFVa3NTVUZCUlN4RlFVRkZMRTFCUVUwc1UwRkJVVHREUVVGRkxFbEJRVWNzVDBGQlR5eExRVUZITEZWQlFWTXNTVUZCUlN4RlFVRkZPMDFCUVZjc1NVRkJSeXhGUVVGRkxHRkJR", - "VmtzUlVGQlJTeFZRVUZSTEVWQlFVVXNiVUpCUVdsQ0xFdEJRVXNzUjBGQlJTeEpRVUZGTzBWQlFVTXNSMEZCUnl4RlFVRkZPMFZCUVUwc1UwRkJVU3hGUVVGRk8wTkJRV003VFVGQlR5eE5RVUZOTEUxQlFVMHNSMEZCUnl4RlFVRkZMRTFCUVUwc2QwTkJRWGRETzBOQlFVVXNTVUZCU1N4SlFVRkZMRVZCUVVVc2EwSkJRV2RDTzBOQlFVVXNTVUZCUnl4RFFVRkRMRTlCUVU4c1ZVRkJWU3hGUVVGRkxFOUJRVThzUzBGQlJ5eEZRVUZGTEZWQlFWRXNSMEZCUlN4TlFVRk5MRTFCUVUwc1IwRkJSeXhGUVVGRkxFMUJRVTBzV1VGQldTeEZRVUZGTEZGQlFWRXNORUpCUVRSQ08wTkJRVVVzU1VGQlJ5eEZRVUZGTEZWQlFWRXNSVUZCUlN4bFFVRmpMRTFCUVUwc1RVRkJUU3hIUVVGSExFVkJRVVVzVFVGQlRTeDNRa0ZCZDBJc1JVRkJSU3hSUVVGUkxEaERRVUU0UXl4RlFVRkZMR05CUVdNc2FVZEJRV2xITzBOQlFVVXNUMEZCU3l4RlFVRkZMRlZCUVZFc1JVRkJSU3huUWtGQlpUdEZRVUZETEVsQlFVa3NTVUZCUlN4RlFVRkZMRmRCUVZjc1RVRkJTeXhOUVVGSExFVkJRVVVzVTBGQlR5eEZRVUZGTEU5QlFVODdSVUZCUlN4SlFVRkhMRU5CUVVNc1IwRkJSU3hOUVVGTkxFMUJRVTBzUjBGQlJ5eEZRVUZGTEUxQlFVMHNkME5CUVhkRExFVkJRVVVzVVVGQlVTeExRVUZMTEVWQlFVVXNWVUZCVVN4RlFVRkZMRVZCUVVVN1JVRkJSU3hKUVVGSExFVkJRVVVzVDBGQlN5eEZRVUZGTEU5QlFVc3NSMEZCUlN4TlFVRk5MRTFCUVUwc1IwRkJSeXhGUVVGRkxFMUJRVTBzWTBGQll5eEZRVUZGTEV0QlFVc3NTMEZCU3l4RlFVRkZMRWRCUVVjc01FTkJRVEJETzBWQlFVVXNTVUZCU1N4SlFVRkZMRVZCUVVVc1VVRkJVU3hEUVVGRE8wVkJRVVVzU1VGQlJ5eEZRVUZGTEZsQlFWVXNSVUZCUlN4SlFVRkhMRTFCUVUwc1RVRkJUU3hIUVVGSExFVkJRVVVzVFVGQlRTeGpRVUZqTEVWQlFVVXNTMEZCU3l4TFFVRkxMRVZCUVVVc1IwRkJSeXhwUTBGQmFVTXNSVUZCUlN4UlFVRlJMRVZCUVVVN1JVRkJSU3hKUVVGRk8wTkJRVU03UTBGQlF5eFBRVUZQTzBGQlFVTTdPenRCUTBGeWNrTXNUVUZCVFN3d1FrRkJkMEk3UTBGQlF5eE5RVUZMTzBOQlFVVXNVVUZCVVN4SFFVRkZPMFZCUVVNc1NVRkJSeXhEUVVGRExEaENRVUU0UWl4RFFVRkRMRWRCUVVVc1RVRkJUU3hOUVVGTkxEWkZRVUUyUlR0RlFVRkZMRTlCUVUwN1IwRkJReXhqUVVGaExFVkJRVVU3UjBGQllTeHBRa0ZCWjBJc1JVRkJSVHRIUVVGblFpeE5RVUZMTEVWQlFVVTdSMEZCU3l4WFFVRlZPMGxCUVVNc1QwRkJUU3hGUVVGRk8wbEJRVk1zWjBKQlFXVXNSVUZCUlR0SlFVRmxMRzFDUVVGclFpeEZRVUZGTzBsQlFXdENMR05CUVdFc1JVRkJSVHRIUVVGWk8wZEJRVVVzVTBGQlVUdEZRVUZETzBOQlFVTTdRMEZCUlN4SlFVRkhPMEZCUVVNN1FVRkJSU3hUUVVGVExEaENRVUU0UWl4SFFVRkZPME5CUVVNc1QwRkJUeXhQUVVGUExFdEJRVWNzV1VGQlZTeERRVUZETEVOQlFVTXNTMEZCUnl4alFVRmhPMEZCUVVNN096dEJRMEUxVml4TlFVRkJMRGhDUVVFMFFpeERRVUZETEhWQ1FVRjFRanRCUVVGdFV5eFRRVUZUTEhsQ1FVRjVRaXhIUVVGRk8wTkJRVU1zVDBGQlR5eHJRa0ZCYTBJN1JVRkJReXhuUWtGQlpUdEZRVUZGTEU5QlFVMDdSVUZCYzBJc1dVRkJWenRGUVVFMFFpeGxRVUZqTzBWQlFVVXNUMEZCVFR0RFFVRkRMRU5CUVVNN1FVRkJRenM3TzBGRFFXeHdRaXhUUVVGVExIZENRVUYzUWl4SFFVRkZPME5CUVVNc1NVRkJSeXhGUVVGRkxGZEJRVk1zUjBGQlJTeFBRVUZOTEVOQlFVTTdRMEZCUlN4SlFVRkhMRVZCUVVVc1YwRkJVeXhIUVVGRkxFOUJRVThzUlVGQlJTeE5RVUZKTEVOQlFVTTdRMEZCUlN4SlFVRkpMRWxCUVVVc1EwRkJReXhIUVVGRkxFbEJRVVVzUTBGQlF6dERRVUZGTEV0QlFVa3NTVUZCU1N4TFFVRkxMRWRCUVVVN1JVRkJReXhMUVVGSkxFbEJRVWNzUTBGQlF5eEhRVUZGTEUxQlFVc3NUMEZCVHl4UlFVRlJMRU5CUVVNc1IwRkJSU3hOUVVGSkxHOUNRVUZyUWl4TlFVRkpMRXRCUVVzc1RVRkJTU3hGUVVGRkxFdEJRVWM3UlVGQlJ5eEZRVUZGTEcxQ1FVRnBRaXhMUVVGTExFdEJRVWNzUlVGQlJTeExRVUZMTEVkQlFVY3NSVUZCUlN4alFVRmpPME5CUVVNN1EwRkJReXhQUVVGUExFVkJRVVVzVTBGQlR5eE5RVUZKTEVWQlFVVXNhVUpCUVdVc1NVRkJSenRCUVVGRE96czdRVU5CYWtzc1pVRkJaU3gxUWtGQmRVSXNSMEZCUlR0RFFVRkRMRWxCUVVrc1NVRkJSU3gzUWtGQmQwSXNSVUZCUlN4UlFVRlJPME5CUVVVc1QwRkJUeXhGUVVGRkxHRkJRV0VzZVVKQlFYVkNMRTFCUVUwc2QwSkJRWGRDTzBWQlFVTXNUVUZCU3l4RlFVRkZPMFZCUVVzc1owSkJRV1VzUlVGQlJUdEZRVUZsTEZOQlFWRTdSVUZCUlN4alFVRmhMRVZCUVVVN1EwRkJXU3hEUVVGRExFVkJRVUVzUTBGQlJ5eFpRVUZWTzBGQlFVTTdPenRCUTBGb1ZTeEpRVUZKTEhOQ1FVRnZRaXhOUVVGTE8wTkJRVU03UTBGQllUdERRVUZsTzBOQlFYbENPME5CUVc5Q08wTkJRVGhDTEZsQlFWa3NSMEZCUlR0RlFVRkRMRXRCUVVzc1pVRkJZU3hGUVVGRkxHTkJRV0VzUzBGQlN5d3lRa0ZCZVVJc1JVRkJSU3h0UWtGQmEwSXNTMEZCU3l4elFrRkJiMElzUlVGQlJTeGpRVUZoTEV0QlFVc3NaME5CUVRoQ0xFVkJRVVVzWVVGQllTeHRRa0ZCYTBJc1MwRkJTeXhwUWtGQlpTeEZRVUZGTzBOQlFXTTdRMEZCUXl4SlFVRkpMRzlDUVVGdFFqdEZRVUZETEU5QlFVOHNTMEZCU3p0RFFVRjNRanREUVVGRExFbEJRVWtzWlVGQll6dEZRVUZETEU5QlFVOHNTMEZCU3p0RFFVRnRRanREUVVGRExFMUJRVTBzVFVGQlRTeEhRVUZGTzBWQlFVTXNTMEZCU3l4VFFVRlRMRU5CUVVNN1JVRkJSU3hKUVVGSkxFbEJRVVVzUlVGQlJTeGhRVUZoTzBWQlFXdENMRTFCUVVrc1RVRkJTU3hOUVVGSkxFdEJRVXNzYTBOQlFXZERMRXRCUVVzc1owTkJRVGhDTEVkQlFVVXNUVUZCVFN4TFFVRkxMRXRCUVVzN1IwRkJReXh0UWtGQmEwSTdSMEZCUlN4TlFVRkxPMFZCUVhsQ0xFTkJRVU03UTBGQlJUdERRVUZETEdkQ1FVRm5RaXhIUVVGRk8wVkJRVU1zVDBGQlRUdEhRVUZETEU5QlFVMDdSMEZCUlN4blFrRkJaU3hMUVVGTE8wZEJRV1VzYlVKQlFXdENMRXRCUVVzN1IwRkJlVUlzWTBGQllTeExRVUZMTzBWQlFXMUNPME5CUVVNN1EwRkJReXhOUVVGTkxFOUJRVThzUjBGQlJTeEhRVUZGTEVkQlFVVTdSVUZCUXl4TFFVRkxMRk5CUVZNc1EwRkJReXhIUVVGRkxFMUJRVTBzUzBGQlN5eExRVUZMTzBkQlFVTXNVVUZCVHp0SlFVRkRMRWRCUVVjN1NVRkJSU3h0UWtGQmEwSXNTMEZCU3p0SlFVRjVRaXhqUVVGaExFdEJRVXM3UjBGQmJVSTdSMEZCUlN4dlFrRkJiVUlzUlVGQlJTeFhRVUZUTEVsQlFVVXNTMEZCU3l4SlFVRkZMRU5CUVVNc1IwRkJSeXhEUVVGRE8wZEJRVVVzVFVGQlN6dEZRVUZoTEVOQlFVTTdRMEZCUXp0RFFVRkRMRTFCUVUwc1MwRkJTeXhIUVVGRk8wVkJRVU1zVFVGQlRTeHZRa0ZCYjBJN1IwRkJReXhqUVVGaExFdEJRVXM3UjBGQllTeFRRVUZSTzBWQlFVTXNRMEZCUXp0RFFVRkRPME5CUVVNc1UwRkJVeXhIUVVGRk8wVkJRVU1zUzBGQlN5d3lRa0ZCZVVJc1JVRkJSU3h4UWtGQmJVSXNTMEZCU3l3d1FrRkJlVUlzUzBGQlN5eHpRa0ZCYjBJc1JVRkJSVHREUVVGWk8wRkJRVU03T3p0QlEwTnFXaXhOUVVGTkxDdENRVUUyUWp0QlFVRTBSQ3hsUVVGbExHRkJRV0VzUjBGQlJUdERRVUZETEVsQlFVa3NTVUZCUlN4NVFrRkJlVUlzUTBGQlF6dERRVUZGTEU5QlFVOHNSVUZCUlN4dlFrRkJiMElzWTBGQldTeERRVUZETEVsQlFVVXNjVUpCUVhGQ0xFTkJRVU1zU1VGQlJTeHpRa0ZCYzBJc1EwRkJRenRCUVVGRE8wRkJRVU1zWlVGQlpTeHhRa0ZCY1VJc1IwRkJSVHREUVVGRExFbEJRVWtzU1VGQlJTeFhRVUZYTEVWQlFVTXNUMEZCVFN4SFFVRkhMRVZCUVVVc1owSkJRV2RDTEZGQlFVOHNRMEZCUXl4SFFVRkZMRWxCUVVVc1JVRkJSU3hQUVVGUExHTkJRV01zUTBGQlF5eEhRVUZGTEVsQlFVVXNTVUZCU1N4dlFrRkJiMEk3UlVGQlF5eGpRVUZoTEVWQlFVVTdSVUZCWjBJc1owSkJRV1VzUlVGQlJTeFZRVUZWTzBWQlFXVXNiVUpCUVd0Q0xFVkJRVVVzVlVGQlZUdEZRVUZyUWl4alFVRmhMRVZCUVVVc1ZVRkJWVHREUVVGWkxFTkJRVU1zUjBGQlJTeEpRVUZGTEVkQlFVVXNPRUpCUVRCQ0xFZEJRVWNzUlVGQlJTeE5RVUZOTEZsQlFWa3NUMEZCVHl4SFFVRkhMRXRCUVVrc1NVRkJSU3hEUVVGRExFZEJRVVVzU1VGQlJTeEZRVUZGTEZWQlFWVXNUMEZCVFN4SlFVRkZMRU5CUVVNN1EwRkJSU3hKUVVGSE8wVkJRVU1zU1VGQlJ6dEhRVUZETEUxQlFVMHNiVUpCUVcxQ0xFTkJRVU1zUjBGQlJTeEpRVUZGTEVOQlFVTTdSVUZCUXl4VFFVRlBMRWRCUVVVN1IwRkJReXhKUVVGSExHOUNRVUZ2UWl4RFFVRkRMRWRCUVVVN1IwRkJUeXhOUVVGTk8wVkJRVU03UlVGQlF5eFRRVUZQTzBkQlFVTXNTVUZCU1N4SlFVRkZMRTFCUVUwc1UwRkJVeXhGUVVGRkxHZENRVUZuUWl4RFFVRkRMRU5CUVVNN1IwRkJSU3hKUVVGSExFVkJRVVVzVjBGQlV5eFJRVUZQTzBsQlFVTXNUVUZCVFN4RlFVRkZMRTlCUVU4c1IwRkJSVHRMUVVGRExFMUJRVXM3UzBGQlR5eFJRVUZQTEVWQlFVVXNWVUZCVVR0TFFVRkhMRk5CUVZFc1JVRkJSVHRKUVVGUExFZEJRVVVzUTBGQlF6dEpRVUZGTzBkQlFVMDdSMEZCUXl4SlFVRkpMRWxCUVVVc1JVRkJSU3hYUVVGVExIVkRRVUZ4UXl4RlFVRkZMRmRCUVZNc1UwRkJUeXhGUVVGRkxESkNRVUY1UWl4TFFVRkxPMGRCUVVVc1NVRkJSeXhOUVVGSkxFdEJRVXNzUjBGQlJUdEpRVUZETEUxQlFVMHNSVUZCUlN4TlFVRk5MRU5CUVVNN1NVRkJSU3hKUVVGSkxFbEJRVVVzVDBGQlRTeEZRVUZGTEZkQlFWTXNjME5CUVc5RExIRkRRVUZ0UXl3eVFrRkJRU3hEUVVFMFFqdExRVUZETEdsQ1FVRm5RaXdyUWtGQkswSXNiMEpCUVc5Q0xFTkJRVU1zUTBGQlF5eEhRVUZITzB0QlFVVXNlVUpCUVhkQ0xFVkJRVVU3UzBGQlRTeG5Ra0ZCWlN4RlFVRkZPMHRCUVdVc2JVSkJRV3RDTEVWQlFVVTdTMEZCYTBJc1kwRkJZU3hGUVVGRk8wbEJRVmtzUTBGQlF6dEpRVUZGTEUxQlFVMHNSVUZCUlN4TlFVRk5MRU5CUVVNc1IwRkJSU3hKUVVGRk8wdEJRVU1zVFVGQlN6dExRVUYzUWl4VFFVRlJMRTFCUVUwc05FSkJRVFJDTzAxQlFVTXNiMEpCUVcxQ08wMUJRVVVzVVVGQlR6dE5RVUZGTEZsQlFWY3NSVUZCUlR0TlFVRk5MR2RDUVVGbExFVkJRVVU3VFVGQlVTeFZRVUZUTzAxQlFVVTdUVUZCYzBJc2JVSkJRV3RDTzB0QlFVTXNRMEZCUXp0SlFVRkRPMGxCUVVVN1IwRkJVVHRIUVVGRExFbEJRVWNzUlVGQlJTeFhRVUZUTEZGQlFVODdTVUZCUXl4SlFVRkhMRVZCUVVVc1JVRkJSU3d5UWtGQmVVSXNSVUZCUlN4M1FrRkJjMElzUlVGQlJTeGpRVUZqTEdsQ1FVRmxMRU5CUVVNc1MwRkJSeXhGUVVGRkxGTkJRVThzYVVKQlFXZENMRTFCUVUwc1RVRkJUU3cwUWtGQk5FSTdTVUZCUlN4TlFVRk5MRVZCUVVVc1QwRkJUeXhIUVVGRk8wdEJRVU1zYjBKQlFXMUNMRVZCUVVVN1MwRkJiVUlzVFVGQlN6dEpRVUZOTEVkQlFVVXNRMEZCUXp0SlFVRkZPMGRCUVUwN1IwRkJReXhOUVVGTkxFVkJRVVVzVFVGQlRTeERRVUZETEVkQlFVVXNTVUZCUlN4TFFVRkxPMFZCUVVNN1EwRkJReXhUUVVGUExFZEJRVVU3UlVGQlF5eE5RVUZOTEUxQlFVMHNSVUZCUlN4TFFVRkxPMGRCUVVNc1QwRkJUU3d5UWtGQk1rSXNRMEZCUXp0SFFVRkZMRTFCUVVzN1JVRkJXU3hEUVVGRExFZEJRVVU3UTBGQlF5eFZRVUZSTzBWQlFVTXNUVUZCVFN4clFrRkJhMElzUTBGQlF5eEhRVUZGTEV0QlFVY3NUVUZCVFN4WlFVRlpMRU5CUVVNN1EwRkJRenRCUVVGRE8wRkJRVU1zWlVGQlpTdzBRa0ZCTkVJc1IwRkJSVHREUVVGRExFbEJRVWtzUjBGQlJTeEpRVUZGTEVOQlFVTXNSMEZCUnl4RlFVRkZMR05CUVdNN1EwRkJSU3hUUVVGUE8wVkJRVU1zU1VGQlNTeEpRVUZGTEcxRFFVRnRRenRIUVVGRExHRkJRVmtzUlVGQlJUdEhRVUZyUWl4VFFVRlJPMFZCUVVNc1EwRkJRenRGUVVGRkxFbEJRVWNzVFVGQlNTeExRVUZMTEVkQlFVVXNUMEZCVHl4TlFVRkpMRXRCUVVzc1MwRkJSeXhOUVVGTkxFVkJRVVVzVDBGQlR5eExRVUZMTzBkQlFVTXNUVUZCU3p0SFFVRXdRaXhYUVVGVk8wVkJRVU1zUTBGQlF5eEhRVUZGTzBWQlFVVXNSVUZCUlN4UFFVRlBMR0ZCUVdFc2VVSkJRWFZDTEUxQlFVa3NTMEZCU3l4TlFVRkpMRWxCUVVVc1JVRkJSU3h6UWtGQmMwSXNSMEZCUlN4TlFVRk5MRVZCUVVVc1QwRkJUeXhMUVVGTE8wZEJRVU1zYlVKQlFXdENMRVZCUVVVc1QwRkJUeXhoUVVGaE8wZEJRV3RDTEZsQlFWY3NSVUZCUlR0SFFVRlhMRTFCUVVzN1IwRkJkMElzVjBGQlZUdEZRVUZETEVOQlFVTTdSVUZCUnl4SlFVRkpMRWxCUVVVc1RVRkJUU3hGUVVGRkxGTkJRVk1zUzBGQlN6dEZRVUZGTEVsQlFVY3NSVUZCUlN4TlFVRkxMRTFCUVUwc1RVRkJUU3h4UkVGQmNVUTdSVUZCUlN4SlFVRkpMRWxCUVVVc1JVRkJSVHRGUVVGTkxFbEJRVWNzUlVGQlJTeFRRVUZQTEhsQ1FVRjNRanRIUVVGRExFVkJRVVVzUzBGQlN5eEhRVUZITEVWQlFVVXNUMEZCVHp0SFFVRkZPMFZCUVZFN1JVRkJReXhKUVVGSExFVkJRVVVzVTBGQlR5d3dRa0ZCZVVJN1IwRkJReXhKUVVGSkxFbEJRVVVzVFVGQlRTeDVRa0ZCZVVJN1NVRkJReXhoUVVGWk8wbEJRVVVzWjBKQlFXVXNSVUZCUlN4UFFVRlBPMGxCUVdVc2JVSkJRV3RDTEVWQlFVVXNUMEZCVHp0SlFVRnJRaXhqUVVGaExFVkJRVVVzVDBGQlR6dEhRVUZaTEVOQlFVTTdSMEZCUlN4TlFVRk5MRVZCUVVVc1QwRkJUeXhOUVVGTkxFTkJRVU03UjBGQlJUdEZRVUZSTzBWQlFVTXNTVUZCUnl4RlFVRkZMRk5CUVU4c2NVSkJRVzFDTEVWQlFVVXNZMEZCV1N4SFFVRkZPMGRCUVVNc1RVRkJUU3hGUVVGRkxFOUJRVThzUzBGQlN6dEpRVUZETEUxQlFVczdTVUZCZVVJc1YwRkJWU3hGUVVGRk8wZEJRVk1zUTBGQlF5eEhRVUZGTEVsQlFVVXNTMEZCU3p0SFFVRkZMRWxCUVVrc1NVRkJSU3hOUVVGTkxIVkNRVUYxUWp0SlFVRkRMRTFCUVVzc1JVRkJSU3hUUVVGVE8wbEJRVXNzWjBKQlFXVXNSVUZCUlN4UFFVRlBPMGxCUVdVc1ZVRkJVeXhGUVVGRkxGTkJRVk03U1VGQlV5eGpRVUZoTEVWQlFVVXNUMEZCVHp0SFFVRlpMRU5CUVVNN1IwRkJSU3hOUVVGSkxFdEJRVXNzUzBGQlJ5eEZRVUZGTEcxQ1FVRnRRaXhMUVVGTE8wbEJRVU1zUjBGQlJ5eEZRVUZGTzBsQlFWTXNWVUZCVXl4RFFVRkRMRU5CUVVNN1IwRkJReXhEUVVGRE8wVkJRVU03UTBGQlF6dEJRVUZETzBGQlFVTXNaVUZCWlN4elFrRkJjMElzUjBGQlJUdERRVUZETEVsQlFVa3NTVUZCUlN4RlFVRkZPME5CUVZVc1NVRkJSenRGUVVGRExGTkJRVTg3UjBGQlF5eEpRVUZKTEVsQlFVVXNUVUZCVFN4VFFVRlRMRU5CUVVNN1IwRkJSU3hKUVVGSExFVkJRVVVzVjBGQlV5eFJRVUZQTzBsQlFVTXNUVUZCVFN4dlFrRkJiMEk3UzBGQlF5eGpRVUZoTEVWQlFVVTdTMEZCWjBJc1UwRkJVVHROUVVGRExGRkJRVTg3VDBGQlF5eE5RVUZMTzA5QlFVOHNVVUZCVHl4RlFVRkZMRlZCUVZFN1QwRkJSeXhUUVVGUkxFVkJRVVU3VDBGQlVTeHRRa0ZCYTBJc1JVRkJSVHRQUVVGclFpeGpRVUZoTEVWQlFVVTdUVUZCV1R0TlFVRkZMRTFCUVVzN1MwRkJZVHRKUVVGRExFTkJRVU03U1VGQlJUdEhRVUZOTzBkQlFVTXNTVUZCUnl4RlFVRkZMRmRCUVZNc2NVTkJRVzlETzBsQlFVTXNUVUZCVFN4dlFrRkJiMEk3UzBGQlF5eGpRVUZoTEVWQlFVVTdTMEZCWjBJc1UwRkJVVHROUVVGRExGRkJRVTg3VDBGQlF5eE5RVUZMTzA5QlFXOURMRzFDUVVGclFpeEZRVUZGTzA5QlFYbENMRzFDUVVGclFpeEZRVUZGTzA5QlFXdENMR05CUVdFc1JVRkJSVHROUVVGWk8wMUJRVVVzVFVGQlN6dExRVUZoTzBsQlFVTXNRMEZCUXp0SlFVRkZPMGRCUVUwN1IwRkJReXhKUVVGSExFVkJRVVVzVjBGQlV5eFJRVUZQTzBsQlFVTXNTVUZCU1N4SlFVRkZMRVZCUVVVN1NVRkJlVUlzU1VGQlJ5eEZRVUZGTEUxQlFVa3NTMEZCU3l4TFFVRkhMRVZCUVVVc01rSkJRWGxDTEVWQlFVVXNkMEpCUVhOQ0xFVkJRVVVzWTBGQll5eHBRa0ZCWlN4RFFVRkRMRXRCUVVjc1JVRkJSU3hUUVVGUExHbENRVUZuUWl4TlFVRk5MRTFCUVUwc05FSkJRVFJDTzBsQlFVVXNTVUZCU1N4SlFVRkZMRTFCUVVrc1MwRkJTeXhKUVVGRk8wdEJRVU1zVFVGQlN6dExRVUZQTEcxQ1FVRnJRaXhGUVVGRk8wdEJRV3RDTEdOQlFXRXNSVUZCUlR0TFFVRmhMRzlDUVVGdFFpeEZRVUZGTzBsQlFXdENMRWxCUVVVN1MwRkJReXhOUVVGTE8wdEJRVEpDTEcxQ1FVRnJRanRMUVVGRkxHMUNRVUZyUWl4RlFVRkZPMHRCUVd0Q0xHTkJRV0VzUlVGQlJUdEpRVUZaTzBsQlFVVXNUVUZCVFN4dlFrRkJiMEk3UzBGQlF5eGpRVUZoTEVWQlFVVTdTMEZCWjBJc1UwRkJVVHROUVVGRExGRkJRVTg3VFVGQlJTeE5RVUZMTzB0QlFXRTdTVUZCUXl4RFFVRkRPMGxCUVVVN1IwRkJUVHRIUVVGRExFbEJRVVU3U1VGQlF5eFBRVUZOTEV0QlFVczdTVUZCUlN4blFrRkJaU3hGUVVGRk8wbEJRV1VzYlVKQlFXdENMRVZCUVVVN1NVRkJhMElzWTBGQllTeEZRVUZGTzBkQlFWazdSVUZCUXp0RFFVRkRMRk5CUVU4c1IwRkJSVHRGUVVGRExFMUJRVTBzVFVGQlRTeHZRa0ZCYjBJN1IwRkJReXhqUVVGaExFVkJRVVU3UjBGQlowSXNVMEZCVVR0SlFVRkRMRTlCUVUwc01rSkJRVEpDTEVOQlFVTTdTVUZCUlN4TlFVRkxPMGRCUVZrN1JVRkJReXhEUVVGRExFZEJRVVU3UTBGQlF6dEJRVUZETzBGQlF6TnhUQ3hoUVVGaExHRkJRV0U3UVVGRE1VSXNWMEZCVnl4dlFrRkJiMElzU1VGQlNTd3JRa0ZCSzBJc1dVRkJXVHM3TzBGRFNITjBReXhUUVVGVExHMUNRVUZ0UWl4SFFVRkZPME5CUVVNc1NVRkJSeXhEUVVGRExFZEJRVVVzUjBGQlJ5eExRVUZITzBOQlFVVXNTVUZCUnl4TlFVRkpMRXRCUVVzc1IwRkJSU3hOUVVGTkxFMUJRVTBzTUVOQlFUQkRPME5CUVVVc1NVRkJTU3hKUVVGRkxFVkJRVVVzVFVGQlN5eEpRVUZGTEVOQlFVTXNSMEZCUnl4RlFVRkZMRkZCUVZFN1EwRkJSU3hMUVVGSkxFbEJRVWtzUzBGQlN5eEhRVUZGTEVWQlFVVXNVMEZCVHl4TFFVRkxMRTFCUVVrc1NVRkJSU3hGUVVGRkxFOUJRVTBzUlVGQlJTeExRVUZMTEVkQlFVY3NSVUZCUlN4UlFVRlJPME5CUVVVc1QwRkJUVHRGUVVGRExFZEJRVWM3UlVGQlJTeE5RVUZMTzBWQlFVVXNWVUZCVXp0RFFVRkRPMEZCUVVNN096dEJRMEZ5YUVRc1RVRkJUU3d3UWtGQmQwSXNUMEZCVHl4SlFVRkpMREJDUVVFd1FqdEJRVUZGTEUxQlFVRXNOa0pCUVRKQ08wRkJRVmNzTWtKQlFUSkNMRFpDUVVFeVFpeExRVUZMTEUxQlFVa3NNa0pCUVRKQ0xESkNRVUY1UWl4SlFVRkpMRWxCUVVVN1FVRkJSeXhOUVVGTkxHTkJRVmtzTWtKQlFUSkNPMEZCUVhsQ0xFbEJRVWtzWVVGQlZ5eE5RVUZMTzBOQlFVTTdRMEZCU3p0RFFVRk5MRmxCUVZrc1IwRkJSU3hKUVVGRkxFTkJRVU1zUjBGQlJUdEZRVUZETEV0QlFVc3NUMEZCU3l4SFFVRkZMRXRCUVVzc1VVRkJUU3hGUVVGRk8wVkJRVTBzU1VGQlNTeEpRVUZGTEZsQlFWa3NTVUZCU1N4RFFVRkRPMFZCUVVVc1NVRkJSeXhOUVVGSkxFdEJRVXNzUzBGQlJ5eEZRVUZGTEZWQlFWRXNTMEZCU3l4TlFVRkpMRXRCUVVzc1ZVRkJVU3hMUVVGTExFbEJRVWNzVFVGQlRTeE5RVUZOTEN0Q1FVRXJRaXhGUVVGRkxEQkNRVUV3UWl4RlFVRkZMRkZCUVUwc1UwRkJUeXhWUVVGVkxITkNRVUZ6UWl4TFFVRkxMRkZCUVUwc1UwRkJUeXhWUVVGVkxHOUlRVUZ2U0R0RlFVRkZMRmxCUVZrc1NVRkJTU3hIUVVGRkxFbEJRVWs3UTBGQlF6dEJRVUZETzBGRFFURnlRaXhKUVVGSkxGZEJRVmNzVlVGQlZUdEJRVUZ0UWl4SlFVRkpMRmRCUVZjc2JVSkJRVzFDTzBGQlFXVXNTVUZCU1N4WFFVRlhMR1ZCUVdVN1FVRkJkVUlzU1VGQlNTeFhRVUZYTEhWQ1FVRjFRanRCUVVGRkxFMUJRVUVzYzBKQlFXOUNMRWxCUVVrc1YwRkJWeXh6UWtGQmMwSTdRVUZCTkVJc1NVRkJTU3hYUVVGWExEUkNRVUUwUWp0QlFVRlZMRWxCUVVrc1YwRkJWeXhWUVVGVk8wRkJRVzFDTEVsQlFVa3NWMEZCVnl4dFFrRkJiVUk3UVVGQmEwSXNTVUZCU1N4WFFVRlhMR3RDUVVGclFqdEJRVUZ4UWl4SlFVRkpMRmRCUVZjc2NVSkJRWEZDTzBGQlFXRXNTVUZCU1N4WFFVRlhMR0ZCUVdFN1FVRkJZU3hKUVVGSkxGZEJRVmNzWVVGQllUdEJRVUZuUXl4SlFVRkpMRmRCUVZjc1owTkJRV2RETzBGQlFUWkNMRWxCUVVrc1YwRkJWeXcyUWtGQk5rSTdRVUZCYlVJc1NVRkJTU3hYUVVGWExHMUNRVUZ0UWp0QlFVRXdRaXhKUVVGSkxGZEJRVmNzTUVKQlFUQkNPMEZCUVdkRExFbEJRVWtzVjBGQlZ5eG5RMEZCWjBNN1FVRkJOa0lzU1VGQlNTeFhRVUZYTERaQ1FVRTJRanM3TzBGRFFUbHBReXhUUVVGVExGTkJRVk1zUjBGQlJUdERRVUZETEU5QlFVOHNUMEZCVHl4TFFVRkhMRmxCUVZVc1EwRkJReXhEUVVGRExFdEJRVWNzUTBGQlF5eE5RVUZOTEZGQlFWRXNRMEZCUXp0QlFVRkRPMEZCUVVNc1UwRkJVeXhwUWtGQmFVSXNSMEZCUlR0RFFVRkRMRTlCUVU4c1QwRkJUeXhMUVVGSExGbEJRVlVzUlVGQlJTeFRRVUZQTzBGQlFVTTdPenRCUTBGelJDeFRRVUZUTEd0Q1FVRnJRaXhIUVVGRk8wTkJRVU1zU1VGQlNTeEpRVUZGTEVWQlFVVXNjMEpCUVhGQ0xFbEJRVVVzUjBGQlJ5eFJRVUZQTEVsQlFVVXNSMEZCUnl4bFFVRmpMRWxCUVVVc1IwRkJSeXhYUVVGVkxFbEJRVVVzUjBGQlJ5eE5RVUZOTzBOQlFVY3NUMEZCVFR0RlFVRkRMRkZCUVU4c2FVSkJRV2xDTEVOQlFVTXNTVUZCUlN4SlFVRkZMRXRCUVVzN1JVRkJSU3hsUVVGakxHbENRVUZwUWl4RFFVRkRMRWxCUVVVc1NVRkJSU3hMUVVGTE8wVkJRVVVzVjBGQlZTeHBRa0ZCYVVJc1EwRkJReXhKUVVGRkxFbEJRVVVzUzBGQlN6dEZRVUZGTEZGQlFVOHNhVUpCUVdsQ0xFTkJRVU1zU1VGQlJTeEpRVUZGTEV0QlFVczdRMEZCUXp0QlFVRkRPMEZCUVhWRkxGTkJRVk1zYTBKQlFXdENMRWRCUVVVN1EwRkJReXhQUVVGUExHdENRVUZyUWl4RFFVRkRMRU5CUVVNc1EwRkJRenRCUVVGaE8wRkJRVU1zVTBGQlV5eHhRa0ZCY1VJc1IwRkJSVHREUVVGRExFbEJRVWtzU1VGQlJTeEZRVUZGTEc5Q1FVRnZRanREUVVGTkxFOUJRVThzYVVKQlFXbENMRU5CUVVNc1NVRkJSU3hKUVVGRkxFdEJRVXM3UVVGQlF6czdPMEZEUXpWelFpeEpRVUZYTERSQ1FVRTBRaXhYUVVGWExFOUJRVThzU1VGQlNTeHRRa0ZCYlVJc1JVRkJSU3hEUVVGRExEWkRRVUUyUXpzN08wRkRSSGhHTEZOQlFWTXNaVUZCWlN4SFFVRkZPME5CUVVNc1QwRkJUeXhoUVVGaExGRkJRVTBzUlVGQlJTeFZRVUZSTEU5QlFVOHNTMEZCUnl4WFFVRlRMRWxCUVVVc1MwRkJSeXhQUVVGTExFOUJRVThzUTBGQlF5eEpRVUZGTEZOQlFWTXNRMEZCUXl4SlFVRkZMRTlCUVU4c1JVRkJSU3hYUVVGVExGbEJRVlVzUlVGQlJTeFJRVUZSTEZOQlFVOHNTVUZCUlN4RlFVRkZMRlZCUVZFc2EwSkJRV3RDTEVOQlFVTXNTVUZCUlN4UFFVRlBMRU5CUVVNN1FVRkJRenRCUVVGclV5eFRRVUZUTEd0Q1FVRnJRaXhIUVVGRk8wTkJRVU1zU1VGQlJ6dEZRVUZETEU5QlFVOHNTMEZCU3l4VlFVRlZMRU5CUVVNc1MwRkJSeXhQUVVGUExFTkJRVU03UTBGQlF5eFJRVUZOTzBWQlFVTXNUMEZCVHl4UFFVRlBMRU5CUVVNN1EwRkJRenRCUVVGRE96czdRVU5EYUc1Q0xFMUJRVTBzZDBKQlFYTkNPMEZCUlZVc1YwRkJWeXhQUVVGUExFbEJRVWtzYlVKQlFXMUNMRVZCUVVVc1EwRkJReXh0UkVGQmJVUTdPenRCUTBoeVFpeFRRVUZUTEhGRFFVRnhReXhIUVVGRkxFZEJRVVU3UTBGQlF5eEpRVUZKTEVsQlFVVXNSVUZCUlR0RFFVRmxMRWxCUVVjc1IwRkJSeXhUUVVGUExIVkNRVUZ6UWl4UFFVRk5PMFZCUVVNc1VVRkJUeXhQUVVGUExFVkJRVVVzVDBGQlR5eFZRVUZSTEVWQlFVVTdSVUZCUlN4TlFVRkxPMFZCUVd0Q0xGRkJRVTg3UlVGQlJTeGpRVUZoTEU5QlFVOHNSVUZCUlN4UFFVRlBMR2RDUVVGakxFVkJRVVU3UTBGQlF6dEJRVUZETzBGQlFVTXNVMEZCVXl4dFEwRkJiVU1zUjBGQlJTeEhRVUZGTzBOQlFVTXNTVUZCU1N4SlFVRkZMSEZEUVVGeFF5eEhRVUZGTEVWQlFVVTdRMEZCUlN4SlFVRkhMRTFCUVVrc1MwRkJTeXhIUVVGRkxFOUJRVTA3UlVGQlF5eEhRVUZITzBWQlFVVXNVMEZCVVN4RFFVRkRPMFZCUVVVc1VVRkJUenRIUVVGRExFMUJRVXM3UjBGQk5FSXNVMEZCVVN4bFFVRmxMRU5CUVVNN1JVRkJRenREUVVGRE8wRkJRVU03T3p0QlEwTnNhVUlzU1VGQlZ5d3dRa0ZCTUVJc1YwRkJWeXhQUVVGUExFbEJRVWtzYlVKQlFXMUNMRVZCUVVVc1EwRkJReXd5UTBGQk1rTTdPenRCUTBSM1NpeEpRVUZKTEhOQ1FVRnZRaXhOUVVGTE8wTkJRVU03UTBGQmJVSTdRMEZCVVR0RFFVRm5RanREUVVGaExHbENRVUZsTzBOQlFVc3NXVUZCV1N4SFFVRkZPMFZCUVVNc1MwRkJTeXh4UWtGQmJVSXNSVUZCUlN4dlFrRkJiVUlzUzBGQlN5eFZRVUZSTEZkQlFWY3NSVUZCUXl4UFFVRk5MRVZCUVVVc1RVRkJTeXhEUVVGRExFZEJRVVVzUzBGQlN5eHJR", - "a0ZCWjBJc1MwRkJTeXhSUVVGUkxFOUJRVThzWTBGQll5eERRVUZETEVkQlFVVXNTMEZCU3l4bFFVRmhMRVZCUVVVN1EwRkJXVHREUVVGRExFbEJRVWtzVVVGQlR6dEZRVUZETEU5QlFVOHNTMEZCU3l4UlFVRlJPME5CUVVzN1EwRkJReXhOUVVGTkxGVkJRVk03UlVGQlF5eE5RVUZOTEd0Q1FVRnJRaXhMUVVGTExHVkJRV1VzUjBGQlJTeE5RVUZOTEZsQlFWa3NTMEZCU3l4UFFVRlBPME5CUVVNN1EwRkJReXhOUVVGTkxHZENRVUZsTzBWQlFVTXNVMEZCVHp0SFFVRkRMRWxCUVVrc1NVRkJSU3hOUVVGTkxFdEJRVXNzV1VGQldTeHpSRUZCYzBRc1IwRkJSU3hKUVVGRkxFdEJRVXNzYjBKQlFXOUNMRU5CUVVNN1IwRkJSU3hKUVVGSExFMUJRVWtzUzBGQlN5eEhRVUZGTEU5QlFVODdSMEZCUlN4SlFVRkhMRVZCUVVVc1UwRkJUeXg1UWtGQmQwSTdTVUZCUXl4SlFVRkpMRWxCUVVVc1RVRkJUU3hMUVVGTExIVkNRVUYxUWl4RFFVRkRPMGxCUVVVc1NVRkJSeXhOUVVGSkxFdEJRVXNzUjBGQlJTeFBRVUZQTzBkQlFVTTdSVUZCUXp0RFFVRkRPME5CUVVNc2NVSkJRWEZDTEVkQlFVVTdSVUZCUXl4RlFVRkZMSFZDUVVGeFFpeExRVUZMTEV0QlFVY3NTMEZCU3l4dFFrRkJiVUlzVVVGQlVTeEhRVUZITEVWQlFVVXNhMEpCUVd0Q08wTkJRVU03UTBGQlF5eHBRa0ZCWjBJN1JVRkJReXhMUVVGTExHbENRVUZsTzBOQlFVazdRMEZCUXl4dlFrRkJiVUk3UlVGQlF5eFBRVUZQTEV0QlFVc3NiVUpCUVdsQ0xFdEJRVXNzWjBKQlFXZENMRXRCUVVzc1IwRkJSU3hMUVVGTE8wTkJRV003UTBGQlF5eE5RVUZOTEZsQlFWa3NSMEZCUlR0RlFVRkRMRk5CUVU4N1IwRkJReXhKUVVGSkxFbEJRVVVzVFVGQlRTeExRVUZMTEd0Q1FVRnJRanRIUVVGRkxFbEJRVWNzUzBGQlN5eGxRVUZsTEVkQlFVVXNSVUZCUlN4TlFVRkxMRTFCUVUwc1RVRkJUU3hEUVVGRE8wZEJRVVVzU1VGQlNTeEpRVUZGTEVWQlFVVTdSMEZCVFN4SlFVRkhMRVZCUVVVc1UwRkJUeXhqUVVGaExFMUJRVTBzZVVKQlFYbENMRVZCUVVVc1MwRkJTenRIUVVGRkxFbEJRVWNzUlVGQlJTeFRRVUZQTERKQ1FVRXdRanRKUVVGRExFMUJRVTBzUzBGQlN5eGhRVUZoTEUxQlFVMHNSVUZCUlN4cFFrRkJhVUk3U1VGQlJUdEhRVUZSTzBkQlFVTXNUMEZCVHp0RlFVRkRPME5CUVVNN1EwRkJReXh2UWtGQmIwSXNSMEZCUlR0RlFVRkRMRWxCUVVjc1JVRkJSU3hUUVVGUExHTkJRV0VzVFVGQlRTeDVRa0ZCZVVJc1JVRkJSU3hMUVVGTE8wVkJRVVVzU1VGQlJ5eEZRVUZGTEZOQlFVOHNaVUZCWXl4UFFVRlBMRXRCUVVzc2NVSkJRWEZDTEVOQlFVTXNSMEZCUlN4RlFVRkZPME5CUVUwN1EwRkJReXhOUVVGTkxIVkNRVUYxUWl4SFFVRkZPMFZCUVVNc1RVRkJUU3hMUVVGTExHRkJRV0VzVFVGQlRTeEZRVUZGTEdsQ1FVRnBRanRGUVVGRkxFbEJRVWtzU1VGQlJTeExRVUZMTEcxQ1FVRnRRaXhOUVVGTk8wVkJRVVVzVDBGQlN5eE5RVUZKTEV0QlFVc3NTVUZCUnp0SFFVRkRMRWxCUVVrc1NVRkJSU3hOUVVGTkxGRkJRVkVzUzBGQlN5eERRVUZETEV0QlFVc3NhMEpCUVd0Q0xFTkJRVU1zUTBGQlF5eE5RVUZMTEU5QlFVazdTVUZCUXl4TlFVRkxPMGxCUVZVc1QwRkJUVHRIUVVGRExFVkJRVVVzUjBGQlJTeExRVUZMTEdGQlFXRXNTMEZCU3l4RFFVRkRMRU5CUVVNc1RVRkJTeXhQUVVGSk8wbEJRVU1zVFVGQlN6dEpRVUZYTEU5QlFVMDdSMEZCUXl4RlFVRkZMRU5CUVVNc1EwRkJRenRIUVVGRkxFbEJRVWNzUlVGQlJTeFRRVUZQTEZkQlFWVTdTVUZCUXl4SlFVRkhMRXRCUVVzc1pVRkJaU3hIUVVGRkxFVkJRVVVzVFVGQlRTeE5RVUZMTEUxQlFVMHNUVUZCVFN4eFJFRkJjVVE3U1VGQlJTeEpRVUZITEVWQlFVVXNUVUZCVFN4TlFVRk5MRk5CUVU4c01rSkJRVEJDTzB0QlFVTXNUVUZCVFN4TFFVRkxMR0ZCUVdFc1RVRkJUU3hGUVVGRkxFMUJRVTBzVFVGQlRTeHBRa0ZCYVVJN1MwRkJSVHRKUVVGUk8wbEJRVU1zU1VGQlNTeEpRVUZGTEV0QlFVc3NiMEpCUVc5Q0xFVkJRVVVzVFVGQlRTeExRVUZMTzBsQlFVVXNTVUZCUnl4TlFVRkpMRXRCUVVzc1IwRkJSU3hQUVVGUE8wbEJRVVVzU1VGQlJ5eEZRVUZGTEUxQlFVMHNUVUZCVFN4VFFVRlBMRFpDUVVFeVFpeEZRVUZGTEUxQlFVMHNUVUZCVFN4alFVRlpMRVZCUVVVc1YwRkJWVHRKUVVGUE8wZEJRVkU3UjBGQlF5eEpRVUZITEVWQlFVVXNUVUZCVFN4TlFVRkxMRTFCUVUwc1RVRkJUU3c0UkVGQk9FUTdSMEZCUlN4TFFVRkxMR0ZCUVdFc1dVRkJXU3hIUVVGRkxFVkJRVVVzVFVGQlRTeE5RVUZOTEZOQlFVOHNZMEZCV1N4SlFVRkZMRVZCUVVVc1RVRkJUVHRGUVVGTk8wVkJRVU1zU1VGQlJ6dEhRVUZETEUxQlFVMHNkMEpCUVhkQ08wbEJRVU1zV1VGQlZ5eEZRVUZGTzBsQlFWY3NVMEZCVVR0TFFVRkRMRlZCUVZNN1MwRkJSU3hOUVVGTE8wdEJRV3RDTEZkQlFWVXNSVUZCUlR0SlFVRlRPMGRCUVVNc1EwRkJRenRGUVVGRExGTkJRVThzUjBGQlJUdEhRVUZETEVsQlFVY3NSVUZCUlN4aFFVRmhMRk5CUVU4c1JVRkJSU3hUUVVGUExITkNRVUZ4UWl4TlFVRk5PMFZCUVVNN1JVRkJReXhQUVVGUExFMUJRVTBzUzBGQlN5eDFRa0ZCZFVJc1JVRkJSU3hYUVVGVkxFTkJRVU03UTBGQlF6dERRVUZETEUxQlFVMHNkVUpCUVhWQ0xFZEJRVVVzUjBGQlJUdEZRVUZETEZOQlFVODdSMEZCUXl4SlFVRkpMRWxCUVVVc1RVRkJUU3hMUVVGTExGbEJRVmtzYVVWQlFXbEZPMGRCUVVVc1NVRkJSeXhGUVVGRkxGTkJRVThzTUVKQlFYbENPMGxCUVVNc1NVRkJSeXhGUVVGRkxHTkJRVmtzUjBGQlJUdEpRVUZQTzBkQlFWRTdSMEZCUXl4SlFVRkhMRVZCUVVVc1UwRkJUeXcyUWtGQk1rSXNSVUZCUlN4alFVRlpMRWRCUVVVN1NVRkJReXhMUVVGTExHMUNRVUZ0UWl4UlFVRlJMRU5CUVVNN1NVRkJSVHRIUVVGTk8wZEJRVU1zUlVGQlJTeFRRVUZQTEdsQ1FVRmxMRXRCUVVzc2JVSkJRVzFDTEZGQlFWRXNRMEZCUXp0SFFVRkZMRWxCUVVrc1NVRkJSU3hMUVVGTExHOUNRVUZ2UWl4RFFVRkRPMGRCUVVVc1NVRkJSeXhOUVVGSkxFdEJRVXNzUjBGQlJTeFBRVUZQTzBWQlFVTTdRMEZCUXp0QlFVRkRPenM3UVVOQk5XcEhMR1ZCUVdVc2NVSkJRWEZDTEVkQlFVVTdRMEZCUXl4SlFVRkpMRWxCUVVVc1NVRkJTU3h2UWtGQmIwSTdSVUZCUXl4dlFrRkJiVUlzUlVGQlJUdEZRVUZ0UWl4alFVRmhMRVZCUVVVN1JVRkJZU3hQUVVGTkxFVkJRVVU3UTBGQldTeERRVUZETzBOQlFVVXNTVUZCUnp0RlFVRkRMRTlCUVU4c1RVRkJUU3hwUWtGQmFVSTdSMEZCUXl4alFVRmhMRVZCUVVVN1IwRkJZU3hwUWtGQlowSXNSVUZCUlR0SFFVRk5MRlZCUVZNc1JVRkJSVHRIUVVGVExFMUJRVXNzUlVGQlJUdEhRVUZMTEdkQ1FVRmxMRVZCUVVVN1IwRkJaU3h0UWtGQmEwSXNSVUZCUlR0SFFVRnJRaXhqUVVGaExFVkJRVVU3UlVGQldTeERRVUZETEVkQlFVVXNUVUZCVFN4RlFVRkZMR05CUVdNN1EwRkJReXhWUVVGUk8wVkJRVU1zVFVGQlRTeEZRVUZGTEZGQlFWRTdRMEZCUXp0QlFVRkRPenM3UVVORE9XbENMRWxCUVZjc2IwSkJRVzlDTEZkQlFWY3NUMEZCVHl4SlFVRkpMRzFDUVVGdFFpeEZRVUZGTEVOQlFVTXNjVU5CUVhGRE96czdRVU5CYUVnc1NVRkJWeXd3UWtGQk1FSXNWMEZCVnl4UFFVRlBMRWxCUVVrc2JVSkJRVzFDTEVWQlFVVXNRMEZCUXl3eVEwRkJNa003T3p0QlEwUlBMRk5CUVZNc01FSkJRVEJDTEVkQlFVVTdRMEZCUXl4SlFVRkpMRWRCUVVVc1NVRkJSU3hEUVVGRExFZEJRVVVzU1VGQlJTeERRVUZETEVkQlFVVXNTVUZCUlN4SFFVRkZMRWxCUVVVc1RVRkJTeXhIUVVGRkxFZEJRVVVzVjBGQlVTeE5RVUZITzBWQlFVTXNSVUZCUlN4TFFVRkxMRU5CUVVNc1IwRkJSU3hGUVVGRkxFMUJRVTBzUjBGQlJTeE5RVUZKTEVWQlFVVXNVVUZCVFN4RlFVRkZMRXRCUVVzc1IwRkJSU3hKUVVGSkxFZEJRVVVzU1VGQlJTeExRVUZMTzBOQlFVTXNSMEZCUlN4UFFVRkpMRTFCUVVjN1JVRkJReXhGUVVGRkxGVkJRVkVzUlVGQlJTeFpRVUZWTEVWQlFVVXNWVUZCVVN4RFFVRkRMRWRCUVVVc1JVRkJSU3hYUVVGVExFdEJRVXNzU1VGQlJ5eEZRVUZGTEZWQlFWRXNVVUZCVVN4UlFVRlJMRVZCUVVVc1NVRkJTU3hEUVVGRExFTkJRVU1zVFVGQlN5eFBRVUZKTzBkQlFVTXNUVUZCU3l4RFFVRkRPMGRCUVVVc1QwRkJUVHRGUVVGRExFVkJRVVVzU1VGQlJTeEZRVUZGTEZOQlFWTXNTMEZCU3l4RlFVRkJMRU5CUVVjc1RVRkJTeXhOUVVGSE8wZEJRVU1zU1VGQlNTeEpRVUZGTzBsQlFVTXNUMEZCVFR0SlFVRkpMRkZCUVU4N1NVRkJSU3hQUVVGTk8wZEJRVU03UjBGQlJTeEZRVUZGTEZkQlFWTXNSMEZCUlN4RlFVRkZMRmRCUVZNc1VVRkJVU3hEUVVGRE8wVkJRVU1zVTBGQlRTeERRVUZETEVOQlFVTTdRMEZCUlN4SFFVRkZMRlZCUVU4c1RVRkJSenRGUVVGRExFVkJRVVVzVlVGQlVTeERRVUZETEVkQlFVVXNSVUZCUlN4aFFVRlhMRXRCUVVzc1MwRkJSeXhSUVVGUkxFVkJRVVVzVVVGQlVUdERRVUZETEVkQlFVVXNZVUZCVnl4WlFVRlRPMFZCUVVNc1NVRkJSeXhOUVVGSkxFMUJRVXNzUzBGQlNTeE5RVUZOTEZGQlFWRXNVVUZCVVN4SFFVRkZMRVZCUVVVc1UwRkJUeXhKUVVGSE8wZEJRVU1zU1VGQlNTeEpRVUZGTEVWQlFVVXNUVUZCVFR0SFFVRkZMRVZCUVVVc1RVRkJUU3hWUVVGUkxFTkJRVU1zUjBGQlJTeEZRVUZGTEUxQlFVMHNWMEZCVXl4TFFVRkxMRWRCUVVVc1JVRkJSU3hQUVVGUExFOUJRVXNzUlVGQlJTeE5RVUZOTEZOQlFVOHNRMEZCUXl4SlFVRkZMRVZCUVVVc1QwRkJUeXhOUVVGTkxGTkJRVThzWVVGQlZ5eEZRVUZGTEV0QlFVc3NSVUZCUlN4UFFVRlBMRXRCUVVzc1IwRkJSU3hKUVVGSkxFVkJRVVVzUzBGQlN5eEhRVUZGTEUxQlFVMHNVVUZCVVN4UlFVRlJPMFZCUVVNN1EwRkJRenREUVVGRkxFOUJRVTA3UlVGQlF5eGpRVUZoTzBkQlFVTXNTVUZCUnl4TlFVRkpMRXRCUVVzc1IwRkJSU3hOUVVGTkxFMUJRVTBzYzBSQlFYTkVPMGRCUVVVc1JVRkJSU3hOUVVGTkxGVkJRVkVzUTBGQlF5eEhRVUZGTEVWQlFVVXNUVUZCVFN4WFFVRlRMRXRCUVVzc1IwRkJSU3hGUVVGRkxFOUJRVThzVTBGQlR5eEZRVUZGTEUxQlFVMHNVMEZCVHl4RFFVRkRMRWxCUVVjc1NVRkJSU3hMUVVGTExFZEJRVVVzU1VGQlJUdEZRVUZKTzBWQlFVVXNUVUZCVFN4VlFVRlRPMGRCUVVNc1RVRkJTU3hMUVVGTExFMUJRVWtzVFVGQlRTeFpRVUZaTEVWQlFVVXNTVUZCU1N4SFFVRkZMRWxCUVVVc1MwRkJTenRGUVVGRk8wVkJRVVVzVDBGQlRUdEhRVUZETEVsQlFVY3NUVUZCU1N4TFFVRkxMRWRCUVVVc1RVRkJUU3hOUVVGTkxITkZRVUZ6UlR0SFFVRkZMRWxCUVVjc1RVRkJTU3hOUVVGTExFOUJRVTg3UjBGQlJTeEpRVUZKTEVOQlFVTTdSMEZCUlN4TFFVRkpMRWxCUVVrc1MwRkJTeXhIUVVGRkxFbEJRVWtzUTBGQlF6dEhRVUZGTEU5QlFVOHNSVUZCUlN4VlFVRlJMRVZCUVVVc1QwRkJUU3hOUVVGSExFVkJRVVVzVFVGQlRTeExRVUZITEVsQlFVVTdTVUZCUXl4UFFVRk5PMGxCUVVrc1VVRkJUenRMUVVGRExFMUJRVXNzUTBGQlF6dExRVUZGTEU5QlFVMHNTMEZCU3p0SlFVRkRPMGxCUVVVc1QwRkJUVHRIUVVGRExFZEJRVVVzU1VGQlJTeFJRVUZSTEZGQlFWRXNSVUZCUlN4TlFVRk5MRWRCUVVVc1RVRkJTU3hMUVVGSExGbEJRVk03U1VGQlF5eFBRVUZMTEVWQlFVVXNWMEZCVXl4SlFVRkhMRTFCUVUwc1NVRkJTU3hUUVVGUkxFMUJRVWM3UzBGQlF5eEpRVUZGTzBsQlFVTXNRMEZCUXp0SlFVRkZMRWxCUVVrc1NVRkJSU3hGUVVGRkxFMUJRVTA3U1VGQlJTeFBRVUZQTEVsQlFVVXNSMEZCUlN4RlFVRkZPMGRCUVUwc1JVRkJRU3hEUVVGSExFZEJRVVU3UlVGQlJUdEZRVUZGTEUxQlFVMHNUVUZCVFN4SFFVRkZPMGRCUVVNc1NVRkJSeXhEUVVGRExFdEJRVWNzUjBGQlJ5eExRVUZMTEZWQlFWRXNSMEZCUlR0SFFVRlBMRWxCUVVrc1NVRkJSU3hYUVVGWExFVkJRVU1zVDBGQlRTeEZRVUZETEVOQlFVTXNSMEZCUlN4SlFVRkZPMGxCUVVNc1VVRkJUeXhEUVVGRE8wbEJRVVVzVTBGQlVTeERRVUZETzBsQlFVVXNUVUZCU3p0SlFVRkZMRlZCUVZNc1JVRkJSU3hQUVVGUExHTkJRV01zUTBGQlF6dEpRVUZGTEZOQlFWRXNRMEZCUXp0SlFVRkZMRk5CUVZFc1EwRkJRenRIUVVGRE8wZEJRVVVzU1VGQlJ5eE5RVUZKTEV0QlFVc3NSMEZCUlR0SlFVRkRMRTFCUVUwc2JVSkJRVzFDTEVWQlFVVXNTVUZCU1N4SFFVRkZMRTlCUVU4c1EwRkJReXhIUVVGRkxFbEJRVVU3U1VGQlJUdEhRVUZOTzBkQlFVTXNTVUZCU1N4SlFVRkZPMGRCUVVVc1NVRkJTU3hEUVVGRExFZEJRVVVzU1VGQlNTeERRVUZETEVkQlFVVXNUVUZCVFN4dFFrRkJiVUlzUlVGQlJTeEpRVUZKTEVkQlFVVXNUMEZCVHl4RFFVRkRMRWRCUVVVc1RVRkJUU3hYUVVGWE8wZEJRVVVzU1VGQlJ6dEpRVUZETEUxQlFVMHNXVUZCV1N4RlFVRkZMRWxCUVVrN1IwRkJReXhUUVVGUExFZEJRVVU3U1VGQlF5eEpRVUZGTEV0QlFVczdTVUZCUlN4SlFVRkhPMHRCUVVNc1RVRkJUU3haUVVGWkxFVkJRVVVzU1VGQlNUdEpRVUZETEZGQlFVMHNRMEZCUXp0SlFVRkRMRTFCUVUwN1IwRkJRenRIUVVGRExFVkJRVVVzVlVGQlVTeERRVUZETEVkQlFVVXNSVUZCUlN4TFFVRkxMRU5CUVVNc1IwRkJSU3hKUVVGRkxFZEJRVVVzVFVGQlRTeFhRVUZYTzBWQlFVTTdRMEZCUXp0QlFVRkRPenM3UVVORGNEWkNMR1ZCUVdVc1kwRkJZeXhIUVVGRk8wTkJRVU1zU1VGQlJ5eEZRVUZETEdWQlFXTXNUVUZCUnl4dlFrRkJiMElzUjBGQlJTeEpRVUZGTEVWQlFVVXNhMEpCUVd0Q0xEUkNRVUV3UWl4SlFVRkhMRWxCUVVVc1JVRkJSU3hyUWtGQmEwSXNZVUZCV1N4SlFVRkZMRVZCUVVVc2EwSkJRV3RDTEhGQ1FVRnZRaXhKUVVGRkxFVkJRVVVzYTBKQlFXdENPME5CUVdNc1JVRkJSU3hyUWtGQmEwSXNiVUpCUVdsQ08wTkJRVVVzU1VGQlNTeEpRVUZGTEZsQlFWazdRMEZCUlN4SlFVRkhPMFZCUVVNc1NVRkJTU3hKUVVGRkxHdENRVUZyUWl4RlFVRkZMR2xDUVVGcFFpeEhRVUZGTEVWQlFVTXNUMEZCVFN4TlFVRkhMRTFCUVUwc2EwSkJRV3RDTzBkQlFVTXNlVUpCUVhkQ0xFVkJRVVU3UjBGQlR5eHRRa0ZCYTBJN1IwRkJSU3hSUVVGUExFVkJRVVU3UjBGQlR5eGpRVUZoTEVWQlFVVXNUVUZCVFR0SFFVRmhMR1ZCUVdNN1IwRkJSU3hYUVVGVk8wVkJRVU1zUTBGQlF6dEZRVUZGTEU5QlFVOHNUVUZCVFN4alFVRmpPMGRCUVVNc1kwRkJZVHRIUVVGRkxHZENRVUZsTzBkQlFVVXNZMEZCWVR0SlFVRkRMRTFCUVVzN1NVRkJWU3hWUVVGVExFTkJRVU03UzBGQlF5eFRRVUZSTEVWQlFVVXNUVUZCVFR0TFFVRlJMRk5CUVZFc1JVRkJSU3hOUVVGTk8wdEJRVkVzWTBGQllTeEZRVUZGTEUxQlFVMDdTVUZCV1N4RFFVRkRPMGxCUVVVc1YwRkJWU3h4UWtGQmNVSXNSVUZCUlN4cFFrRkJhVUk3UjBGQlF6dEhRVUZGTEUxQlFVczdSMEZCUlN4dFFrRkJhMElzUlVGQlJUdEhRVUZyUWl4alFVRmhPMFZCUVVNc1EwRkJRenREUVVGRExGTkJRVThzUjBGQlJUdEZRVUZETEUxQlFVMHNUVUZCVFN3clFrRkJLMEk3UjBGQlF5eFBRVUZOTERKQ1FVRXlRaXhEUVVGRE8wZEJRVVVzWjBKQlFXVTdSMEZCUlN4dFFrRkJhMElzUlVGQlJUdEZRVUZwUWl4RFFVRkRMRWRCUVVVc1RVRkJUU3gzUWtGQmQwSTdSMEZCUXl4UFFVRk5MREpDUVVFeVFpeERRVUZETzBkQlFVVXNiVUpCUVd0Q0xFVkJRVVU3UjBGQmEwSXNVVUZCVHp0RlFVRlJMRU5CUVVNc1IwRkJSU3hOUVVGTkxEQkNRVUV3UWp0SFFVRkRMRkZCUVU4c2JVTkJRVzFETEVWQlFVVXNiVUpCUVd0Q0xFTkJRVU03UjBGQlJTeHRRa0ZCYTBJc1JVRkJSVHRGUVVGcFFpeERRVUZETEVkQlFVVTdRMEZCUXp0QlFVRkRPMEZCUVVNc1pVRkJaU3hqUVVGakxFZEJRVVU3UTBGQlF5eEpRVUZKTEVsQlFVVXNWMEZCVnl4RlFVRkRMRTlCUVUwc1IwRkJSeXhGUVVGRkxHRkJRV0VzVlVGQlZTeFBRVUZOTEVOQlFVTXNSMEZCUlN4SlFVRkZMRVZCUVVVc1QwRkJUeXhqUVVGakxFTkJRVU1zUjBGQlJTeEpRVUZGTEVkQlFVVXNOa0pCUVhsQ0xFZEJRVWNzUlVGQlJTeGhRVUZoTEZWQlFWVXNaMEpCUVdkQ0xFOUJRVThzUjBGQlJ5eExRVUZKTEVsQlFVVXNRMEZCUXl4SFFVRkZMRWxCUVVVc01FSkJRVEJDTEVOQlFVTTdRMEZCUlN4SlFVRkhPMFZCUVVNc1JVRkJSU3hoUVVGaExIRkNRVUZ0UWl4TlFVRk5MRVZCUVVVc1RVRkJUU3hGUVVGRkxHRkJRV0VzYVVKQlFXbENPMFZCUVVVc1NVRkJTU3hKUVVGRkxFMUJRVTBzY1VKQlFYRkNPMGRCUVVNc2IwSkJRVzFDTzBkQlFVVXNZMEZCWVN4RlFVRkZPMGRCUVdFc1kwRkJZU3h4UWtGQmNVSTdSMEZCUlN4VlFVRlRMRVZCUVVVN1IwRkJZU3hqUVVGaE8wZEJRVVVzVFVGQlN5eEZRVUZGTzBkQlFVc3NaMEpCUVdVc1JVRkJSVHRIUVVGbExHMUNRVUZyUWl4RlFVRkZPMGRCUVd0Q0xHTkJRV0VzUlVGQlJUdEZRVUZaTEVOQlFVTTdSVUZCUlN4VFFVRlBPMGRCUVVNc1NVRkJSeXhGUVVGRkxGTkJRVThzVVVGQlR5eFBRVUZQTEUxQlFVMHNZVUZCWVR0SlFVRkRMRkZCUVU4N1NVRkJSU3huUWtGQlpTeEZRVUZGTzBkQlFXTXNRMEZCUXp0SFFVRkZMRWxCUVVjc1JVRkJSU3hUUVVGUExGRkJRVThzVFVGQlRTeE5RVUZOTERKRFFVRXlReXhGUVVGRkxFdEJRVXNzUjBGQlJ6dEhRVUZGTEVsQlFVY3NRMEZCUXl4RlFVRkZMR0ZCUVdFc2JVSkJRV3RDTEUxQlFVMHNUVUZCVFN4elRVRkJjMDA3UjBGQlJTeEpRVUZITEUxQlFVMHNSVUZCUlN4TlFVRk5MRVZCUVVVc1lVRkJZU3hwUWtGQmFVSXNSMEZCUlN4RlFVRkZMSE5DUVVGdlFpeEZRVUZGTEcxQ1FVRnRRaXhUUVVGUExFZEJRVVU3U1VGQlF5eEpRVUZKTEVsQlFVVXNSVUZCUlN4dFFrRkJiVUlzVVVGQlR5eEpRVUZGTEVOQlFVTTdTVUZCUlN4UFFVRkxMRVZCUVVVc1UwRkJUeXhKUVVGSE8wdEJRVU1zU1VGQlNTeEpRVUZGTEUxQlFVMHNSVUZCUlN4TFFVRkxPMHRCUVVVc1NVRkJSeXhGUVVGRkxFMUJRVXM3UzBGQlRTeEZRVUZGTEUxQlFVMHNVMEZCVHl4aFFVRlhMRVZCUVVVc1MwRkJTeXhIUVVGSExFVkJRVVVzVFVGQlRTeFJRVUZSTzBsQlFVTTdTVUZCUXl4SlFVRkZMRTFCUVUwc2NVSkJRWEZDTzB0QlFVTXNiMEpCUVcxQ08wdEJRVVVzWTBGQllTeEZRVUZGTzB0QlFXRXNZMEZCWVN4eFFrRkJjVUk3UzBGQlJTeFZRVUZUTzAxQlFVTXNUVUZCU3p0TlFVRlZMRlZCUVZNN1MwRkJRenRMUVVGRkxHTkJRV0U3UzBGQlJTeE5RVUZMTEVWQlFVVTdTMEZCU3l4blFrRkJaU3hGUVVGRk8wdEJRV1VzYlVKQlFXdENMRVZCUVVVN1MwRkJhMElzWTBGQllTeEZRVUZGTzBsQlFWa3NRMEZCUXp0SlFVRkZPMGRCUVZFN1IwRkJReXhKUVVGSkxFbEJRVVVzVFVGQlRTeHRRa0ZCYlVJN1NVRkJReXh2UWtGQmJVSTdTVUZCUlN4alFVRmhPMGRCUVVNc1EwRkJRenRIUVVGRkxFbEJRVWNzVFVGQlNTeE5RVUZMTEU5QlFVMHNSVUZCUXl4UlFVRlBMRWRCUVVVN1IwRkJSU3hKUVVGSkxFbEJRVVVzVFVGQlRTeDFRa0ZCZFVJN1NVRkJReXhOUVVGTExFVkJRVVU3U1VGQlN5eG5Ra0ZCWlN4RlFVRkZPMGxCUVdVc1ZVRkJVeXhGUVVGRk8wbEJRVk1zWTBGQllTeEZRVUZGTzBkQlFWa3NRMEZCUXp0SFFVRkZMRTFCUVVrc1MwRkJTeXhOUVVGSkxFbEJRVVVzVFVGQlRTeHhRa0ZCY1VJN1NVRkJReXh2UWtGQmJVSTdTVUZCUlN4alFVRmhMRVZCUVVVN1NVRkJZU3hqUVVGaExIRkNRVUZ4UWp0SlFVRkZMRlZCUVZNN1MwRkJReXhOUVVGTExFVkJRVVU3UzBGQlN5eE5RVUZMTzB0QlFWVXNWVUZCVXl4RFFVRkRMRU5CUVVNN1MwRkJSU3hYUVVGVkxFVkJRVVU3U1VGQlV6dEpRVUZGTEdOQlFXRTdTVUZCUlN4TlFVRkxMRVZCUVVVN1NVRkJTeXhuUWtGQlpTeEZRVUZGTzBsQlFXVXNiVUpCUVd0Q0xFVkJRVVU3U1VGQmEwSXNZMEZCWVN4RlFVRkZPMGRCUVZrc1EwRkJRenRGUVVGRk8wTkJRVU1zVlVGQlVUdEZRVUZETEUxQlFVMHNSVUZCUlN4UlFVRlJMRWRCUVVVc1RVRkJUU3hyUWtGQmEwSXNRMEZCUXl4SFFVRkZMRTFCUVUwc1dVRkJXU3hEUVVGRE8wTkJRVU03UVVGQlF6dEJRVUZETEdWQlFXVXNZVUZCWVN4SFFVRkZPME5CUVVNc1NVRkJSeXhGUVVGRExGRkJRVThzUjBGQlJTeHRRa0ZCYTBJc1RVRkJSeXhGUVVGRkxGRkJRVThzU1VGQlJTeEZRVUZGTEU5QlFVOHNXVUZCVlN4RFFVRkRPME5CUVVVc1QwRkJUeXhOUVVGTkxIZENRVUYzUWp0RlFVRkRMRTlCUVUwc1NVRkJSU3hKUVVGRkxFdEJRVXM3UlVGQlJTeFJRVUZQTEVsQlFVVXNTMEZCU3l4SlFVRkZPMFZCUVVVc2JVSkJRV3RDTzBWQlFVVXNVVUZCVHl4SlFVRkZMRmRCUVZNN1EwRkJWeXhEUVVGRExFZEJRVVVzVFVGQlRTd3dRa0ZCTUVJN1JVRkJReXhSUVVGUExFbEJRVVVzYlVOQlFXMURMRWRCUVVVc1EwRkJReXhKUVVGRkxIRkRRVUZ4UXl4SFFVRkZMRU5CUVVNN1JVRkJSU3h0UWtGQmEwSTdRMEZCUXl4RFFVRkRMRWRCUVVVc1JVRkJReXhSUVVGUExFVkJRVU03UVVGQlF6dEJRVUZETEdWQlFXVXNiVUpCUVcxQ0xFZEJRVVU3UTBGQlF5eEpRVUZITEVWQlFVVXNiVUpCUVcxQ0xGTkJRVThzUjBGQlJTeFBRVUZQTEcxQ1FVRnRRaXhGUVVGRkxHMUNRVUZ0UWl4UFFVRlBMRU5CUVVNc1EwRkJRenREUVVGRkxGTkJRVTg3UlVGQlF5eEpRVUZKTEVsQlFVVXNUVUZCVFN4RlFVRkZMR0ZCUVdFc1MwRkJTenRGUVVGRkxFbEJRVWNzUlVGQlJTeGhRVUZoTEZsQlFWa3NSMEZCUlN4RlFVRkZMRTFCUVVzc1QwRkJUenRGUVVGTExFbEJRVWNzUlVGQlJTeE5RVUZOTEZOQlFVOHNWMEZCVlR0RlFVRlRMRWxCUVVrc1NVRkJSU3hGUVVGRk8wVkJRVTBzVTBGQlR6dEhRVUZETEVsQlFVa3NTVUZCUlN4TlFVRk5MR2xDUVVGcFFpeEZRVUZGTEdGQlFXRXNTMEZCU3l4RFFVRkRPMGRCUVVVc1NVRkJSeXhOUVVGSkxIRkNRVUZ0UWl4RlFVRkZMR0ZCUVdFc1dVRkJXU3hIUVVGRkxFVkJRVVVzVDBGQlRUdEhRVUZOTEVWQlFVVXNUVUZCVFN4VFFVRlBMR05CUVZrc1NVRkJSU3h0UWtGQmJVSXNRMEZCUXl4SFFVRkZMRVZCUVVVc1MwRkJTeXhEUVVGRE8wVkJRVVU3UlVGQlF5eFBRVUZQTzBOQlFVTTdRVUZCUXp0QlFVRkRMRTFCUVUwc2JVSkJRV2xDTEU5QlFVOHNhMEpCUVd0Q08wRkJRVVVzWlVGQlpTeHBRa0ZCYVVJc1IwRkJSVHREUVVGRExFOUJRVThzVFVGQlRTeFJRVUZSTEZGQlFWRXNSMEZCUlN4TlFVRk5MRkZCUVZFc1MwRkJTeXhEUVVGRExFZEJRVVVzVVVGQlVTeFJRVUZSTEdkQ1FVRm5RaXhEUVVGRExFTkJRVU03UVVGQlF6dEJRVU5vTVVzc1kwRkJZeXhoUVVGaE8wRkJRek5DTEZkQlFWY3NiMEpCUVc5Q0xFbEJRVWtzWjBOQlFXZERMR0ZCUVdFaWZRPT0K" -].join(""), "base64").toString("utf8"); -const POST = Ov(workflowCode, { namespace: "eve71722d6d6173746572" }); -//#endregion -//#region node_modules/eve/dist/src/internal/nitro/routes/schedule-task.js -async function dispatchScheduleTask(r, i) { - let a = resolveNitroCompiledArtifactsSource(i), o = await loadResolvedCompiledScheduleByTaskName(r, { compiledArtifactsSource: a }), s = await getCompiledRuntimeAgentBundle({ compiledArtifactsSource: a }), c = new ScheduleDispatcher({ - runtime: createWorkflowRuntime({ compiledArtifactsSource: a }), - channels: s.graph.root.channels - }), l = { scheduleId: o.name }; - o.hasRun && (l.run = await loadScheduleRun(o, s.moduleMap)), o.markdown !== void 0 && (l.markdown = o.markdown); - let u = await c.trigger(l); - return u.waitUntilTasks.length > 0 && await Promise.allSettled(u.waitUntilTasks), { - scheduleId: o.name, - sessionIds: u.sessions.map((e) => e.id) - }; -} -async function loadScheduleRun(e, t) { - if (e.sourceKind !== `module`) throw Error(`Schedule "${e.name}" claims hasRun but is not a module-backed schedule.`); - let n = e; - return expectScheduleRun(await loadResolvedModuleExport({ - definition: { - exportName: n.exportName, - logicalPath: n.logicalPath, - sourceId: n.sourceId - }, - kindLabel: `schedule`, - moduleMap: t, - nodeId: void 0 - }), n.logicalPath, n.exportName); -} -//#endregion -//#region node_modules/eve/dist/src/compiled/@ai-sdk/anthropic/index.js -var anthropic_exports = /* @__PURE__ */ __exportAll({ - VERSION: () => At$4, - anthropic: () => Mt$4, - createAnthropic: () => jt$4 -}); -var Y$5 = vd({ - errorSchema: Wu(() => Qu(Co({ - type: Ro(`error`), - error: Co({ - type: Ra$2(), - message: Ra$2() - }) - }))), - errorToMessage: (e) => e.error.message -}); -var te$3 = Wu(() => Qu(Co({ - id: Ra$2(), - type: Ro(`file`), - filename: Ra$2(), - mime_type: Ra$2(), - size_bytes: oo(), - created_at: Ra$2(), - downloadable: uo().nullish() -}))); -var ne$3 = class { - constructor(e) { - this.config = e, this.specificationVersion = `v4`; - } - get provider() { - return this.config.provider; - } - async uploadFile({ data: e, mediaType: t, filename: n }) { - let r = Bc(e), i = new Blob([r], { type: t }), a = new FormData(); - n == null ? a.append(`file`, i) : a.append(`file`, i, n); - let { value: o } = await cd({ - url: `${this.config.baseURL}/files`, - headers: Pc(this.config.headers(), { "anthropic-beta": `files-api-2025-04-14` }), - formData: a, - failedResponseHandler: Y$5, - successfulResponseHandler: bd(te$3), - fetch: this.config.fetch - }); - return { - warnings: [], - providerReference: { anthropic: o.id }, - mediaType: o.mime_type ?? t, - filename: o.filename ?? n, - providerMetadata: { anthropic: { - filename: o.filename, - mimeType: o.mime_type, - sizeBytes: o.size_bytes, - createdAt: o.created_at, - ...o.downloadable == null ? {} : { downloadable: o.downloadable } - } } - }; - } -}; -var X$5 = Co({ - type: Ra$2(), - category: Ra$2().nullish(), - explanation: Ra$2().nullish(), - recommended_model: Ra$2().nullish() -}); -var re$3 = Wu(() => Qu(Co({ - type: Ro(`message`), - id: Ra$2().nullish(), - model: Ra$2().nullish(), - content: xo(Oo(`type`, [ - Co({ - type: Ro(`text`), - text: Ra$2(), - citations: xo(Oo(`type`, [ - Co({ - type: Ro(`web_search_result_location`), - cited_text: Ra$2(), - url: Ra$2(), - title: Ra$2(), - encrypted_index: Ra$2() - }), - Co({ - type: Ro(`page_location`), - cited_text: Ra$2(), - document_index: oo(), - document_title: Ra$2().nullable(), - start_page_number: oo(), - end_page_number: oo() - }), - Co({ - type: Ro(`char_location`), - cited_text: Ra$2(), - document_index: oo(), - document_title: Ra$2().nullable(), - start_char_index: oo(), - end_char_index: oo() - }) - ])).optional() - }), - Co({ - type: Ro(`thinking`), - thinking: Ra$2(), - signature: Ra$2() - }), - Co({ - type: Ro(`redacted_thinking`), - data: Ra$2() - }), - Co({ - type: Ro(`compaction`), - content: Ra$2() - }), - Co({ - type: Ro(`tool_use`), - id: Ra$2(), - name: Ra$2(), - input: _o(), - caller: Eo([ - Co({ - type: Ro(`code_execution_20250825`), - tool_id: Ra$2() - }), - Co({ - type: Ro(`code_execution_20260120`), - tool_id: Ra$2() - }), - Co({ type: Ro(`direct`) }) - ]).optional() - }), - Co({ - type: Ro(`server_tool_use`), - id: Ra$2(), - name: Ra$2(), - input: Po(Ra$2(), _o()).nullish(), - caller: Eo([Co({ - type: Ro(`code_execution_20260120`), - tool_id: Ra$2() - }), Co({ type: Ro(`direct`) })]).optional() - }), - Co({ - type: Ro(`mcp_tool_use`), - id: Ra$2(), - name: Ra$2(), - input: _o(), - server_name: Ra$2() - }), - Co({ - type: Ro(`mcp_tool_result`), - tool_use_id: Ra$2(), - is_error: uo(), - content: xo(Eo([Ra$2(), Co({ - type: Ro(`text`), - text: Ra$2() - })])) - }), - Co({ - type: Ro(`web_fetch_tool_result`), - tool_use_id: Ra$2(), - content: Eo([Co({ - type: Ro(`web_fetch_result`), - url: Ra$2(), - retrieved_at: Ra$2(), - content: Co({ - type: Ro(`document`), - title: Ra$2().nullable(), - citations: Co({ enabled: uo() }).optional(), - source: Eo([Co({ - type: Ro(`base64`), - media_type: Ro(`application/pdf`), - data: Ra$2() - }), Co({ - type: Ro(`text`), - media_type: Ro(`text/plain`), - data: Ra$2() - })]) - }) - }), Co({ - type: Ro(`web_fetch_tool_result_error`), - error_code: Ra$2() - })]) - }), - Co({ - type: Ro(`web_search_tool_result`), - tool_use_id: Ra$2(), - content: Eo([xo(Co({ - type: Ro(`web_search_result`), - url: Ra$2(), - title: Ra$2(), - encrypted_content: Ra$2(), - page_age: Ra$2().nullish() - })), Co({ - type: Ro(`web_search_tool_result_error`), - error_code: Ra$2() - })]) - }), - Co({ - type: Ro(`code_execution_tool_result`), - tool_use_id: Ra$2(), - content: Eo([ - Co({ - type: Ro(`code_execution_result`), - stdout: Ra$2(), - stderr: Ra$2(), - return_code: oo(), - content: xo(Co({ - type: Ro(`code_execution_output`), - file_id: Ra$2() - })).optional().default([]) - }), - Co({ - type: Ro(`encrypted_code_execution_result`), - encrypted_stdout: Ra$2(), - stderr: Ra$2(), - return_code: oo(), - content: xo(Co({ - type: Ro(`code_execution_output`), - file_id: Ra$2() - })).optional().default([]) - }), - Co({ - type: Ro(`code_execution_tool_result_error`), - error_code: Ra$2() - }) - ]) - }), - Co({ - type: Ro(`bash_code_execution_tool_result`), - tool_use_id: Ra$2(), - content: Oo(`type`, [Co({ - type: Ro(`bash_code_execution_result`), - content: xo(Co({ - type: Ro(`bash_code_execution_output`), - file_id: Ra$2() - })), - stdout: Ra$2(), - stderr: Ra$2(), - return_code: oo() - }), Co({ - type: Ro(`bash_code_execution_tool_result_error`), - error_code: Ra$2() - })]) - }), - Co({ - type: Ro(`text_editor_code_execution_tool_result`), - tool_use_id: Ra$2(), - content: Oo(`type`, [ - Co({ - type: Ro(`text_editor_code_execution_tool_result_error`), - error_code: Ra$2() - }), - Co({ - type: Ro(`text_editor_code_execution_view_result`), - content: Ra$2(), - file_type: Ra$2(), - num_lines: oo().nullable(), - start_line: oo().nullable(), - total_lines: oo().nullable() - }), - Co({ - type: Ro(`text_editor_code_execution_create_result`), - is_file_update: uo() - }), - Co({ - type: Ro(`text_editor_code_execution_str_replace_result`), - lines: xo(Ra$2()).nullable(), - new_lines: oo().nullable(), - new_start: oo().nullable(), - old_lines: oo().nullable(), - old_start: oo().nullable() - }) - ]) - }), - Co({ - type: Ro(`tool_search_tool_result`), - tool_use_id: Ra$2(), - content: Eo([Co({ - type: Ro(`tool_search_tool_search_result`), - tool_references: xo(Co({ - type: Ro(`tool_reference`), - tool_name: Ra$2() - })) - }), Co({ - type: Ro(`tool_search_tool_result_error`), - error_code: Ra$2() - })]) - }), - Co({ - type: Ro(`advisor_tool_result`), - tool_use_id: Ra$2(), - content: Oo(`type`, [ - Co({ - type: Ro(`advisor_result`), - text: Ra$2() - }), - Co({ - type: Ro(`advisor_redacted_result`), - encrypted_content: Ra$2() - }), - Co({ - type: Ro(`advisor_tool_result_error`), - error_code: Ra$2() - }) - ]) - }), - Co({ type: Ro(`fallback`) }) - ])), - stop_reason: Ra$2().nullish(), - stop_sequence: Ra$2().nullish(), - stop_details: X$5.nullish(), - usage: wo({ - input_tokens: oo(), - output_tokens: oo(), - cache_creation_input_tokens: oo().nullish(), - cache_read_input_tokens: oo().nullish(), - iterations: xo(Co({ - type: Eo([ - Ro(`compaction`), - Ro(`message`), - Ro(`advisor_message`), - Ro(`fallback_message`) - ]), - model: Ra$2().nullish(), - input_tokens: oo(), - output_tokens: oo(), - cache_creation_input_tokens: oo().nullish(), - cache_read_input_tokens: oo().nullish() - })).nullish() - }), - container: Co({ - expires_at: Ra$2(), - id: Ra$2(), - skills: xo(Co({ - type: Eo([Ro(`anthropic`), Ro(`custom`)]), - skill_id: Ra$2(), - version: Ra$2() - })).nullish() - }).nullish(), - context_management: Co({ applied_edits: xo(Eo([ - Co({ - type: Ro(`clear_tool_uses_20250919`), - cleared_tool_uses: oo(), - cleared_input_tokens: oo() - }), - Co({ - type: Ro(`clear_thinking_20251015`), - cleared_thinking_turns: oo(), - cleared_input_tokens: oo() - }), - Co({ type: Ro(`compact_20260112`) }) - ])) }).nullish() -}))); -var ie$3 = Wu(() => Qu(Oo(`type`, [ - Co({ - type: Ro(`message_start`), - message: Co({ - id: Ra$2().nullish(), - model: Ra$2().nullish(), - role: Ra$2().nullish(), - usage: wo({ - input_tokens: oo(), - cache_creation_input_tokens: oo().nullish(), - cache_read_input_tokens: oo().nullish() - }), - content: xo(Oo(`type`, [Co({ - type: Ro(`tool_use`), - id: Ra$2(), - name: Ra$2(), - input: _o(), - caller: Eo([ - Co({ - type: Ro(`code_execution_20250825`), - tool_id: Ra$2() - }), - Co({ - type: Ro(`code_execution_20260120`), - tool_id: Ra$2() - }), - Co({ type: Ro(`direct`) }) - ]).optional() - })])).nullish(), - stop_reason: Ra$2().nullish(), - container: Co({ - expires_at: Ra$2(), - id: Ra$2() - }).nullish() - }) - }), - Co({ - type: Ro(`content_block_start`), - index: oo(), - content_block: Oo(`type`, [ - Co({ - type: Ro(`text`), - text: Ra$2() - }), - Co({ - type: Ro(`thinking`), - thinking: Ra$2() - }), - Co({ - type: Ro(`tool_use`), - id: Ra$2(), - name: Ra$2(), - input: Po(Ra$2(), _o()).optional(), - caller: Eo([ - Co({ - type: Ro(`code_execution_20250825`), - tool_id: Ra$2() - }), - Co({ - type: Ro(`code_execution_20260120`), - tool_id: Ra$2() - }), - Co({ type: Ro(`direct`) }) - ]).optional() - }), - Co({ - type: Ro(`redacted_thinking`), - data: Ra$2() - }), - Co({ - type: Ro(`compaction`), - content: Ra$2().nullish() - }), - Co({ - type: Ro(`server_tool_use`), - id: Ra$2(), - name: Ra$2(), - input: Po(Ra$2(), _o()).nullish(), - caller: Eo([Co({ - type: Ro(`code_execution_20260120`), - tool_id: Ra$2() - }), Co({ type: Ro(`direct`) })]).optional() - }), - Co({ - type: Ro(`mcp_tool_use`), - id: Ra$2(), - name: Ra$2(), - input: _o(), - server_name: Ra$2() - }), - Co({ - type: Ro(`mcp_tool_result`), - tool_use_id: Ra$2(), - is_error: uo(), - content: xo(Eo([Ra$2(), Co({ - type: Ro(`text`), - text: Ra$2() - })])) - }), - Co({ - type: Ro(`web_fetch_tool_result`), - tool_use_id: Ra$2(), - content: Eo([Co({ - type: Ro(`web_fetch_result`), - url: Ra$2(), - retrieved_at: Ra$2(), - content: Co({ - type: Ro(`document`), - title: Ra$2().nullable(), - citations: Co({ enabled: uo() }).optional(), - source: Eo([Co({ - type: Ro(`base64`), - media_type: Ro(`application/pdf`), - data: Ra$2() - }), Co({ - type: Ro(`text`), - media_type: Ro(`text/plain`), - data: Ra$2() - })]) - }) - }), Co({ - type: Ro(`web_fetch_tool_result_error`), - error_code: Ra$2() - })]) - }), - Co({ - type: Ro(`web_search_tool_result`), - tool_use_id: Ra$2(), - content: Eo([xo(Co({ - type: Ro(`web_search_result`), - url: Ra$2(), - title: Ra$2(), - encrypted_content: Ra$2(), - page_age: Ra$2().nullish() - })), Co({ - type: Ro(`web_search_tool_result_error`), - error_code: Ra$2() - })]) - }), - Co({ - type: Ro(`code_execution_tool_result`), - tool_use_id: Ra$2(), - content: Eo([ - Co({ - type: Ro(`code_execution_result`), - stdout: Ra$2(), - stderr: Ra$2(), - return_code: oo(), - content: xo(Co({ - type: Ro(`code_execution_output`), - file_id: Ra$2() - })).optional().default([]) - }), - Co({ - type: Ro(`encrypted_code_execution_result`), - encrypted_stdout: Ra$2(), - stderr: Ra$2(), - return_code: oo(), - content: xo(Co({ - type: Ro(`code_execution_output`), - file_id: Ra$2() - })).optional().default([]) - }), - Co({ - type: Ro(`code_execution_tool_result_error`), - error_code: Ra$2() - }) - ]) - }), - Co({ - type: Ro(`bash_code_execution_tool_result`), - tool_use_id: Ra$2(), - content: Oo(`type`, [Co({ - type: Ro(`bash_code_execution_result`), - content: xo(Co({ - type: Ro(`bash_code_execution_output`), - file_id: Ra$2() - })), - stdout: Ra$2(), - stderr: Ra$2(), - return_code: oo() - }), Co({ - type: Ro(`bash_code_execution_tool_result_error`), - error_code: Ra$2() - })]) - }), - Co({ - type: Ro(`text_editor_code_execution_tool_result`), - tool_use_id: Ra$2(), - content: Oo(`type`, [ - Co({ - type: Ro(`text_editor_code_execution_tool_result_error`), - error_code: Ra$2() - }), - Co({ - type: Ro(`text_editor_code_execution_view_result`), - content: Ra$2(), - file_type: Ra$2(), - num_lines: oo().nullable(), - start_line: oo().nullable(), - total_lines: oo().nullable() - }), - Co({ - type: Ro(`text_editor_code_execution_create_result`), - is_file_update: uo() - }), - Co({ - type: Ro(`text_editor_code_execution_str_replace_result`), - lines: xo(Ra$2()).nullable(), - new_lines: oo().nullable(), - new_start: oo().nullable(), - old_lines: oo().nullable(), - old_start: oo().nullable() - }) - ]) - }), - Co({ - type: Ro(`tool_search_tool_result`), - tool_use_id: Ra$2(), - content: Eo([Co({ - type: Ro(`tool_search_tool_search_result`), - tool_references: xo(Co({ - type: Ro(`tool_reference`), - tool_name: Ra$2() - })) - }), Co({ - type: Ro(`tool_search_tool_result_error`), - error_code: Ra$2() - })]) - }), - Co({ - type: Ro(`advisor_tool_result`), - tool_use_id: Ra$2(), - content: Oo(`type`, [ - Co({ - type: Ro(`advisor_result`), - text: Ra$2() - }), - Co({ - type: Ro(`advisor_redacted_result`), - encrypted_content: Ra$2() - }), - Co({ - type: Ro(`advisor_tool_result_error`), - error_code: Ra$2() - }) - ]) - }), - Co({ type: Ro(`fallback`) }) - ]) - }), - Co({ - type: Ro(`content_block_delta`), - index: oo(), - delta: Oo(`type`, [ - Co({ - type: Ro(`input_json_delta`), - partial_json: Ra$2() - }), - Co({ - type: Ro(`text_delta`), - text: Ra$2() - }), - Co({ - type: Ro(`thinking_delta`), - thinking: Ra$2() - }), - Co({ - type: Ro(`signature_delta`), - signature: Ra$2() - }), - Co({ - type: Ro(`compaction_delta`), - content: Ra$2().nullish() - }), - Co({ - type: Ro(`citations_delta`), - citation: Oo(`type`, [ - Co({ - type: Ro(`web_search_result_location`), - cited_text: Ra$2(), - url: Ra$2(), - title: Ra$2(), - encrypted_index: Ra$2() - }), - Co({ - type: Ro(`page_location`), - cited_text: Ra$2(), - document_index: oo(), - document_title: Ra$2().nullable(), - start_page_number: oo(), - end_page_number: oo() - }), - Co({ - type: Ro(`char_location`), - cited_text: Ra$2(), - document_index: oo(), - document_title: Ra$2().nullable(), - start_char_index: oo(), - end_char_index: oo() - }) - ]) - }) - ]) - }), - Co({ - type: Ro(`content_block_stop`), - index: oo() - }), - Co({ - type: Ro(`error`), - error: Co({ - type: Ra$2(), - message: Ra$2() - }) - }), - Co({ - type: Ro(`message_delta`), - delta: Co({ - stop_reason: Ra$2().nullish(), - stop_sequence: Ra$2().nullish(), - stop_details: X$5.nullish(), - container: Co({ - expires_at: Ra$2(), - id: Ra$2(), - skills: xo(Co({ - type: Eo([Ro(`anthropic`), Ro(`custom`)]), - skill_id: Ra$2(), - version: Ra$2() - })).nullish() - }).nullish() - }), - usage: wo({ - input_tokens: oo().nullish(), - output_tokens: oo(), - cache_creation_input_tokens: oo().nullish(), - cache_read_input_tokens: oo().nullish(), - iterations: xo(Co({ - type: Eo([ - Ro(`compaction`), - Ro(`message`), - Ro(`advisor_message`), - Ro(`fallback_message`) - ]), - model: Ra$2().nullish(), - input_tokens: oo(), - output_tokens: oo(), - cache_creation_input_tokens: oo().nullish(), - cache_read_input_tokens: oo().nullish() - })).nullish() - }), - context_management: Co({ applied_edits: xo(Eo([ - Co({ - type: Ro(`clear_tool_uses_20250919`), - cleared_tool_uses: oo(), - cleared_input_tokens: oo() - }), - Co({ - type: Ro(`clear_thinking_20251015`), - cleared_thinking_turns: oo(), - cleared_input_tokens: oo() - }), - Co({ type: Ro(`compact_20260112`) }) - ])) }).nullish() - }), - Co({ type: Ro(`message_stop`) }), - Co({ type: Ro(`ping`) }) -]))); -var ae$4 = Wu(() => Qu(Co({ - signature: Ra$2().optional(), - redactedData: Ra$2().optional() -}))); -var Z$5 = Co({ - containerUpload: uo().optional(), - citations: Co({ enabled: uo() }).optional(), - title: Ra$2().optional(), - context: Ra$2().optional() -}); -var oe$3 = Co({ - sendReasoning: uo().optional(), - structuredOutputMode: Io([ - `outputFormat`, - `jsonTool`, - `auto` - ]).optional(), - thinking: Oo(`type`, [ - Co({ - type: Ro(`adaptive`), - display: Io([`omitted`, `summarized`]).optional() - }), - Co({ - type: Ro(`enabled`), - budgetTokens: oo().optional() - }), - Co({ type: Ro(`disabled`) }) - ]).optional(), - disableParallelToolUse: uo().optional(), - cacheControl: Co({ - type: Ro(`ephemeral`), - ttl: Eo([Ro(`5m`), Ro(`1h`)]).optional() - }).optional(), - metadata: Co({ userId: Ra$2().optional() }).optional(), - mcpServers: xo(Co({ - type: Ro(`url`), - name: Ra$2(), - url: Ra$2(), - authorizationToken: Ra$2().nullish(), - toolConfiguration: Co({ - enabled: uo().nullish(), - allowedTools: xo(Ra$2()).nullish() - }).nullish() - })).optional(), - container: Co({ - id: Ra$2().optional(), - skills: xo(Oo(`type`, [Co({ - type: Ro(`anthropic`), - skillId: Ra$2(), - version: Ra$2().optional() - }), Co({ - type: Ro(`custom`), - providerReference: Po(Ra$2(), Ra$2()), - version: Ra$2().optional() - })])).optional() - }).optional(), - toolStreaming: uo().optional(), - effort: Io([ - `low`, - `medium`, - `high`, - `xhigh`, - `max` - ]).optional(), - taskBudget: Co({ - type: Ro(`tokens`), - total: oo().int().min(2e4), - remaining: oo().int().min(0).optional() - }).optional(), - speed: Io([`fast`, `standard`]).optional(), - inferenceGeo: Io([`us`, `global`]).optional(), - fallbacks: xo(Co({ - model: Ra$2(), - max_tokens: oo().int().optional(), - thinking: Po(Ra$2(), _o()).optional(), - output_config: Po(Ra$2(), _o()).optional(), - speed: Io([`fast`, `standard`]).optional() - })).optional(), - anthropicBeta: xo(Ra$2()).optional(), - contextManagement: Co({ edits: xo(Oo(`type`, [ - Co({ - type: Ro(`clear_tool_uses_20250919`), - trigger: Oo(`type`, [Co({ - type: Ro(`input_tokens`), - value: oo() - }), Co({ - type: Ro(`tool_uses`), - value: oo() - })]).optional(), - keep: Co({ - type: Ro(`tool_uses`), - value: oo() - }).optional(), - clearAtLeast: Co({ - type: Ro(`input_tokens`), - value: oo() - }).optional(), - clearToolInputs: uo().optional(), - excludeTools: xo(Ra$2()).optional() - }), - Co({ - type: Ro(`clear_thinking_20251015`), - keep: Eo([Ro(`all`), Co({ - type: Ro(`thinking_turns`), - value: oo() - })]).optional() - }), - Co({ - type: Ro(`compact_20260112`), - trigger: Co({ - type: Ro(`input_tokens`), - value: oo() - }).optional(), - pauseAfterCompaction: uo().optional(), - instructions: Ra$2().optional() - }) - ])) }).optional() -}); -var se$4 = 4; -function ce$4(e) { - let t = e?.anthropic; - return t?.cacheControl ?? t?.cache_control; -} -var Q$5 = class { - constructor() { - this.breakpointCount = 0, this.warnings = []; - } - getCacheControl(e, t) { - let n = ce$4(e); - if (n) { - if (!t.canCache) { - this.warnings.push({ - type: `unsupported`, - feature: `cache_control on non-cacheable context`, - details: `cache_control cannot be set on ${t.type}. It will be ignored.` - }); - return; - } - if (this.breakpointCount++, this.breakpointCount > se$4) { - this.warnings.push({ - type: `unsupported`, - feature: `cacheControl breakpoint limit`, - details: `Maximum ${se$4} cache breakpoints exceeded (found ${this.breakpointCount}). This breakpoint will be ignored.` - }); - return; - } - return n; - } - } - getWarnings() { - return this.warnings; - } -}; -var le$4 = Wu(() => Qu(Co({ - model: Ra$2(), - maxUses: oo().optional(), - caching: Co({ - type: Ro(`ephemeral`), - ttl: Eo([Ro(`5m`), Ro(`1h`)]) - }).optional() -}))); -var ue$4 = Wu(() => Qu(Oo(`type`, [ - Co({ - type: Ro(`advisor_result`), - text: Ra$2() - }), - Co({ - type: Ro(`advisor_redacted_result`), - encryptedContent: Ra$2() - }), - Co({ - type: Ro(`advisor_tool_result_error`), - errorCode: Ra$2() - }) -]))); -var de$4 = md({ - id: `anthropic.advisor_20260301`, - inputSchema: Wu(() => Qu(Co({}).strict())), - outputSchema: ue$4, - supportsDeferredResults: !0 -}); -var fe$4 = (e) => de$4(e); -var pe$4 = Wu(() => Qu(Co({ maxCharacters: oo().optional() }))); -var me$4 = fd({ - id: `anthropic.text_editor_20250728`, - inputSchema: Wu(() => Qu(Co({ - command: Io([ - `view`, - `create`, - `str_replace`, - `insert` - ]), - path: Ra$2(), - file_text: Ra$2().optional(), - insert_line: oo().int().optional(), - new_str: Ra$2().optional(), - insert_text: Ra$2().optional(), - old_str: Ra$2().optional(), - view_range: xo(oo().int()).optional() - }))) -}); -var he$4 = (e = {}) => me$4(e); -var ge$4 = Wu(() => Qu(Co({ - maxUses: oo().optional(), - allowedDomains: xo(Ra$2()).optional(), - blockedDomains: xo(Ra$2()).optional(), - userLocation: Co({ - type: Ro(`approximate`), - city: Ra$2().optional(), - region: Ra$2().optional(), - country: Ra$2().optional(), - timezone: Ra$2().optional() - }).optional() -}))); -var _e$4 = Wu(() => Qu(xo(Co({ - url: Ra$2(), - title: Ra$2().nullable(), - pageAge: Ra$2().nullable(), - encryptedContent: Ra$2(), - type: Ro(`web_search_result`) -})))); -var ve$4 = md({ - id: `anthropic.web_search_20260209`, - inputSchema: Wu(() => Qu(Co({ query: Ra$2() }))), - outputSchema: _e$4, - supportsDeferredResults: !0 -}); -var ye$4 = (e = {}) => ve$4(e); -var be$4 = Wu(() => Qu(Co({ - maxUses: oo().optional(), - allowedDomains: xo(Ra$2()).optional(), - blockedDomains: xo(Ra$2()).optional(), - userLocation: Co({ - type: Ro(`approximate`), - city: Ra$2().optional(), - region: Ra$2().optional(), - country: Ra$2().optional(), - timezone: Ra$2().optional() - }).optional() -}))); -var xe$4 = Wu(() => Qu(xo(Co({ - url: Ra$2(), - title: Ra$2().nullable(), - pageAge: Ra$2().nullable(), - encryptedContent: Ra$2(), - type: Ro(`web_search_result`) -})))); -var Se$4 = md({ - id: `anthropic.web_search_20250305`, - inputSchema: Wu(() => Qu(Co({ query: Ra$2() }))), - outputSchema: xe$4, - supportsDeferredResults: !0 -}); -var Ce$4 = (e = {}) => Se$4(e); -var we$4 = Wu(() => Qu(Co({ - maxUses: oo().optional(), - allowedDomains: xo(Ra$2()).optional(), - blockedDomains: xo(Ra$2()).optional(), - citations: Co({ enabled: uo() }).optional(), - maxContentTokens: oo().optional() -}))); -var Te$4 = Wu(() => Qu(Co({ - type: Ro(`web_fetch_result`), - url: Ra$2(), - content: Co({ - type: Ro(`document`), - title: Ra$2().nullable(), - citations: Co({ enabled: uo() }).optional(), - source: Eo([Co({ - type: Ro(`base64`), - mediaType: Ro(`application/pdf`), - data: Ra$2() - }), Co({ - type: Ro(`text`), - mediaType: Ro(`text/plain`), - data: Ra$2() - })]) - }), - retrievedAt: Ra$2().nullable() -}))); -var Ee$4 = md({ - id: `anthropic.web_fetch_20260209`, - inputSchema: Wu(() => Qu(Co({ url: Ra$2() }))), - outputSchema: Te$4, - supportsDeferredResults: !0 -}); -var De$4 = (e = {}) => Ee$4(e); -var Oe$4 = Wu(() => Qu(Co({ - maxUses: oo().optional(), - allowedDomains: xo(Ra$2()).optional(), - blockedDomains: xo(Ra$2()).optional(), - citations: Co({ enabled: uo() }).optional(), - maxContentTokens: oo().optional() -}))); -var ke$4 = Wu(() => Qu(Co({ - type: Ro(`web_fetch_result`), - url: Ra$2(), - content: Co({ - type: Ro(`document`), - title: Ra$2().nullable(), - citations: Co({ enabled: uo() }).optional(), - source: Eo([Co({ - type: Ro(`base64`), - mediaType: Ro(`application/pdf`), - data: Ra$2() - }), Co({ - type: Ro(`text`), - mediaType: Ro(`text/plain`), - data: Ra$2() - })]) - }), - retrievedAt: Ra$2().nullable() -}))); -var Ae$4 = md({ - id: `anthropic.web_fetch_20250910`, - inputSchema: Wu(() => Qu(Co({ url: Ra$2() }))), - outputSchema: ke$4, - supportsDeferredResults: !0 -}); -var je$4 = (e = {}) => Ae$4(e); -async function Me$4({ tools: e, toolChoice: t, disableParallelToolUse: n, cacheControlValidator: i, supportsStructuredOutput: a, supportsStrictTools: o, defaultEagerInputStreaming: s = !1 }) { - e = e?.length ? e : void 0; - let c = [], l = /* @__PURE__ */ new Set(), u = i || new Q$5(); - if (e == null) return { - tools: void 0, - toolChoice: void 0, - toolWarnings: c, - betas: l - }; - let d = []; - for (let t of e) switch (t.type) { - case `function`: { - let e = u.getCacheControl(t.providerOptions, { - type: `tool definition`, - canCache: !0 - }), n = t.providerOptions?.anthropic, r = n?.eagerInputStreaming ?? s, i = n?.deferLoading, f = n?.allowedCallers; - !o && t.strict != null && c.push({ - type: `unsupported`, - feature: `strict`, - details: `Tool '${t.name}' has strict: ${t.strict}, but strict mode is not supported by this provider. The strict property will be ignored.` - }), d.push({ - name: t.name, - description: t.description, - input_schema: t.inputSchema, - cache_control: e, - ...r ? { eager_input_streaming: !0 } : {}, - ...o === !0 && t.strict != null ? { strict: t.strict } : {}, - ...i == null ? {} : { defer_loading: i }, - ...f == null ? {} : { allowed_callers: f }, - ...t.inputExamples == null ? {} : { input_examples: t.inputExamples.map((e) => e.input) } - }), a === !0 && l.add(`structured-outputs-2025-11-13`), (t.inputExamples != null || f != null) && l.add(`advanced-tool-use-2025-11-20`); - break; - } - case `provider`: - switch (t.id) { - case `anthropic.code_execution_20250522`: - l.add(`code-execution-2025-05-22`), d.push({ - type: `code_execution_20250522`, - name: `code_execution`, - cache_control: void 0 - }); - break; - case `anthropic.code_execution_20250825`: - l.add(`code-execution-2025-08-25`), d.push({ - type: `code_execution_20250825`, - name: `code_execution` - }); - break; - case `anthropic.code_execution_20260120`: - d.push({ - type: `code_execution_20260120`, - name: `code_execution` - }); - break; - case `anthropic.computer_20250124`: - l.add(`computer-use-2025-01-24`), d.push({ - name: `computer`, - type: `computer_20250124`, - display_width_px: t.args.displayWidthPx, - display_height_px: t.args.displayHeightPx, - display_number: t.args.displayNumber, - cache_control: void 0 - }); - break; - case `anthropic.computer_20251124`: - l.add(`computer-use-2025-11-24`), d.push({ - name: `computer`, - type: `computer_20251124`, - display_width_px: t.args.displayWidthPx, - display_height_px: t.args.displayHeightPx, - display_number: t.args.displayNumber, - enable_zoom: t.args.enableZoom, - cache_control: void 0 - }); - break; - case `anthropic.computer_20241022`: - l.add(`computer-use-2024-10-22`), d.push({ - name: `computer`, - type: `computer_20241022`, - display_width_px: t.args.displayWidthPx, - display_height_px: t.args.displayHeightPx, - display_number: t.args.displayNumber, - cache_control: void 0 - }); - break; - case `anthropic.text_editor_20250124`: - l.add(`computer-use-2025-01-24`), d.push({ - name: `str_replace_editor`, - type: `text_editor_20250124`, - cache_control: void 0 - }); - break; - case `anthropic.text_editor_20241022`: - l.add(`computer-use-2024-10-22`), d.push({ - name: `str_replace_editor`, - type: `text_editor_20241022`, - cache_control: void 0 - }); - break; - case `anthropic.text_editor_20250429`: - l.add(`computer-use-2025-01-24`), d.push({ - name: `str_replace_based_edit_tool`, - type: `text_editor_20250429`, - cache_control: void 0 - }); - break; - case `anthropic.text_editor_20250728`: { - let e = await $u({ - value: t.args, - schema: pe$4 - }); - d.push({ - name: `str_replace_based_edit_tool`, - type: `text_editor_20250728`, - max_characters: e.maxCharacters, - cache_control: void 0 - }); - break; - } - case `anthropic.bash_20250124`: - l.add(`computer-use-2025-01-24`), d.push({ - name: `bash`, - type: `bash_20250124`, - cache_control: void 0 - }); - break; - case `anthropic.bash_20241022`: - l.add(`computer-use-2024-10-22`), d.push({ - name: `bash`, - type: `bash_20241022`, - cache_control: void 0 - }); - break; - case `anthropic.memory_20250818`: - l.add(`context-management-2025-06-27`), d.push({ - name: `memory`, - type: `memory_20250818` - }); - break; - case `anthropic.web_fetch_20250910`: { - l.add(`web-fetch-2025-09-10`); - let e = await $u({ - value: t.args, - schema: Oe$4 - }); - d.push({ - type: `web_fetch_20250910`, - name: `web_fetch`, - max_uses: e.maxUses, - allowed_domains: e.allowedDomains, - blocked_domains: e.blockedDomains, - citations: e.citations, - max_content_tokens: e.maxContentTokens, - cache_control: void 0 - }); - break; - } - case `anthropic.web_fetch_20260209`: { - l.add(`code-execution-web-tools-2026-02-09`); - let e = await $u({ - value: t.args, - schema: we$4 - }); - d.push({ - type: `web_fetch_20260209`, - name: `web_fetch`, - max_uses: e.maxUses, - allowed_domains: e.allowedDomains, - blocked_domains: e.blockedDomains, - citations: e.citations, - max_content_tokens: e.maxContentTokens, - cache_control: void 0 - }); - break; - } - case `anthropic.web_search_20250305`: { - let e = await $u({ - value: t.args, - schema: be$4 - }); - d.push({ - type: `web_search_20250305`, - name: `web_search`, - max_uses: e.maxUses, - allowed_domains: e.allowedDomains, - blocked_domains: e.blockedDomains, - user_location: e.userLocation, - cache_control: void 0 - }); - break; - } - case `anthropic.web_search_20260209`: { - l.add(`code-execution-web-tools-2026-02-09`); - let e = await $u({ - value: t.args, - schema: ge$4 - }); - d.push({ - type: `web_search_20260209`, - name: `web_search`, - max_uses: e.maxUses, - allowed_domains: e.allowedDomains, - blocked_domains: e.blockedDomains, - user_location: e.userLocation, - cache_control: void 0 - }); - break; - } - case `anthropic.tool_search_regex_20251119`: - d.push({ - type: `tool_search_tool_regex_20251119`, - name: `tool_search_tool_regex` - }); - break; - case `anthropic.tool_search_bm25_20251119`: - d.push({ - type: `tool_search_tool_bm25_20251119`, - name: `tool_search_tool_bm25` - }); - break; - case `anthropic.advisor_20260301`: { - l.add(`advisor-tool-2026-03-01`); - let e = await $u({ - value: t.args, - schema: le$4 - }); - d.push({ - type: `advisor_20260301`, - name: `advisor`, - model: e.model, - ...e.maxUses !== void 0 && { max_uses: e.maxUses }, - ...e.caching !== void 0 && { caching: e.caching } - }); - break; - } - default: - c.push({ - type: `unsupported`, - feature: `provider-defined tool ${t.id}` - }); - break; - } - break; - default: - c.push({ - type: `unsupported`, - feature: `tool ${t}` - }); - break; - } - if (t == null) return { - tools: d, - toolChoice: n ? { - type: `auto`, - disable_parallel_tool_use: n - } : void 0, - toolWarnings: c, - betas: l - }; - let f = t.type; - switch (f) { - case `auto`: return { - tools: d, - toolChoice: { - type: `auto`, - disable_parallel_tool_use: n - }, - toolWarnings: c, - betas: l - }; - case `required`: return { - tools: d, - toolChoice: { - type: `any`, - disable_parallel_tool_use: n - }, - toolWarnings: c, - betas: l - }; - case `none`: return { - tools: void 0, - toolChoice: void 0, - toolWarnings: c, - betas: l - }; - case `tool`: return { - tools: d, - toolChoice: { - type: `tool`, - name: t.toolName, - disable_parallel_tool_use: n - }, - toolWarnings: c, - betas: l - }; - default: throw new Ie$10({ functionality: `tool choice type: ${f}` }); - } -} -function Ne$4({ usage: e, rawUsage: t }) { - let n = e.cache_creation_input_tokens ?? 0, r = e.cache_read_input_tokens ?? 0, i, a, o = e.iterations?.some((e) => e.type === `fallback_message`); - if (e.iterations && e.iterations.length > 0 && !o) { - let t = e.iterations.filter((e) => e.type === `compaction` || e.type === `message`); - if (t.length > 0) { - let e = t.reduce((e, t) => ({ - input: e.input + t.input_tokens, - output: e.output + t.output_tokens - }), { - input: 0, - output: 0 - }); - i = e.input, a = e.output; - } else i = e.input_tokens, a = e.output_tokens; - } else i = e.input_tokens, a = e.output_tokens; - return { - inputTokens: { - total: i + n + r, - noCache: i, - cacheRead: r, - cacheWrite: n - }, - outputTokens: { - total: a, - text: void 0, - reasoning: void 0 - }, - raw: t ?? e - }; -} -var Pe$4 = Wu(() => Qu(Co({ - type: Ro(`code_execution_result`), - stdout: Ra$2(), - stderr: Ra$2(), - return_code: oo(), - content: xo(Co({ - type: Ro(`code_execution_output`), - file_id: Ra$2() - })).optional().default([]) -}))); -var Fe$4 = md({ - id: `anthropic.code_execution_20250522`, - inputSchema: Wu(() => Qu(Co({ code: Ra$2() }))), - outputSchema: Pe$4 -}); -var Ie$4 = (e = {}) => Fe$4(e); -var Le$4 = Wu(() => Qu(Oo(`type`, [ - Co({ - type: Ro(`code_execution_result`), - stdout: Ra$2(), - stderr: Ra$2(), - return_code: oo(), - content: xo(Co({ - type: Ro(`code_execution_output`), - file_id: Ra$2() - })).optional().default([]) - }), - Co({ - type: Ro(`bash_code_execution_result`), - content: xo(Co({ - type: Ro(`bash_code_execution_output`), - file_id: Ra$2() - })), - stdout: Ra$2(), - stderr: Ra$2(), - return_code: oo() - }), - Co({ - type: Ro(`bash_code_execution_tool_result_error`), - error_code: Ra$2() - }), - Co({ - type: Ro(`text_editor_code_execution_tool_result_error`), - error_code: Ra$2() - }), - Co({ - type: Ro(`text_editor_code_execution_view_result`), - content: Ra$2(), - file_type: Ra$2(), - num_lines: oo().nullable(), - start_line: oo().nullable(), - total_lines: oo().nullable() - }), - Co({ - type: Ro(`text_editor_code_execution_create_result`), - is_file_update: uo() - }), - Co({ - type: Ro(`text_editor_code_execution_str_replace_result`), - lines: xo(Ra$2()).nullable(), - new_lines: oo().nullable(), - new_start: oo().nullable(), - old_lines: oo().nullable(), - old_start: oo().nullable() - }) -]))); -var Re$4 = md({ - id: `anthropic.code_execution_20250825`, - inputSchema: Wu(() => Qu(Oo(`type`, [ - Co({ - type: Ro(`programmatic-tool-call`), - code: Ra$2() - }), - Co({ - type: Ro(`bash_code_execution`), - command: Ra$2() - }), - Oo(`command`, [ - Co({ - type: Ro(`text_editor_code_execution`), - command: Ro(`view`), - path: Ra$2() - }), - Co({ - type: Ro(`text_editor_code_execution`), - command: Ro(`create`), - path: Ra$2(), - file_text: Ra$2().nullish() - }), - Co({ - type: Ro(`text_editor_code_execution`), - command: Ro(`str_replace`), - path: Ra$2(), - old_str: Ra$2(), - new_str: Ra$2() - }) - ]) - ]))), - outputSchema: Le$4, - supportsDeferredResults: !0 -}); -var ze$4 = (e = {}) => Re$4(e); -var Be$4 = Wu(() => Qu(Oo(`type`, [ - Co({ - type: Ro(`code_execution_result`), - stdout: Ra$2(), - stderr: Ra$2(), - return_code: oo(), - content: xo(Co({ - type: Ro(`code_execution_output`), - file_id: Ra$2() - })).optional().default([]) - }), - Co({ - type: Ro(`encrypted_code_execution_result`), - encrypted_stdout: Ra$2(), - stderr: Ra$2(), - return_code: oo(), - content: xo(Co({ - type: Ro(`code_execution_output`), - file_id: Ra$2() - })).optional().default([]) - }), - Co({ - type: Ro(`bash_code_execution_result`), - content: xo(Co({ - type: Ro(`bash_code_execution_output`), - file_id: Ra$2() - })), - stdout: Ra$2(), - stderr: Ra$2(), - return_code: oo() - }), - Co({ - type: Ro(`bash_code_execution_tool_result_error`), - error_code: Ra$2() - }), - Co({ - type: Ro(`text_editor_code_execution_tool_result_error`), - error_code: Ra$2() - }), - Co({ - type: Ro(`text_editor_code_execution_view_result`), - content: Ra$2(), - file_type: Ra$2(), - num_lines: oo().nullable(), - start_line: oo().nullable(), - total_lines: oo().nullable() - }), - Co({ - type: Ro(`text_editor_code_execution_create_result`), - is_file_update: uo() - }), - Co({ - type: Ro(`text_editor_code_execution_str_replace_result`), - lines: xo(Ra$2()).nullable(), - new_lines: oo().nullable(), - new_start: oo().nullable(), - old_lines: oo().nullable(), - old_start: oo().nullable() - }) -]))); -var Ve$4 = md({ - id: `anthropic.code_execution_20260120`, - inputSchema: Wu(() => Qu(Oo(`type`, [ - Co({ - type: Ro(`programmatic-tool-call`), - code: Ra$2() - }), - Co({ - type: Ro(`bash_code_execution`), - command: Ra$2() - }), - Oo(`command`, [ - Co({ - type: Ro(`text_editor_code_execution`), - command: Ro(`view`), - path: Ra$2() - }), - Co({ - type: Ro(`text_editor_code_execution`), - command: Ro(`create`), - path: Ra$2(), - file_text: Ra$2().nullish() - }), - Co({ - type: Ro(`text_editor_code_execution`), - command: Ro(`str_replace`), - path: Ra$2(), - old_str: Ra$2(), - new_str: Ra$2() - }) - ]) - ]))), - outputSchema: Be$4, - supportsDeferredResults: !0 -}); -var He$4 = (e = {}) => Ve$4(e); -var Ue$4 = Wu(() => Qu(xo(Co({ - type: Ro(`tool_reference`), - toolName: Ra$2() -})))); -var We$4 = md({ - id: `anthropic.tool_search_regex_20251119`, - inputSchema: Wu(() => Qu(Co({ - pattern: Ra$2(), - limit: oo().optional() - }))), - outputSchema: Ue$4, - supportsDeferredResults: !0 -}); -var Ge$4 = (e = {}) => We$4(e); -function Ke$4(e) { - return typeof e == `string` ? new TextDecoder().decode(Lc(e)) : new TextDecoder().decode(e); -} -function qe$4(e) { - try { - if (typeof e == `string`) return JSON.parse(e); - if (typeof e == `object` && e) return e; - } catch { - let t = e?.errorCode; - return { errorCode: typeof t == `string` ? t : `unavailable` }; - } - return {}; -} -async function Je$4({ prompt: e, sendReasoning: t, warnings: n, cacheControlValidator: i, toolNameMapping: a }) { - let c = /* @__PURE__ */ new Set(), u = Ye$4(e), f = i || new Q$5(), p, m = []; - async function h(e) { - return (await ad({ - provider: `anthropic`, - providerOptions: e, - schema: Z$5 - }))?.citations?.enabled ?? !1; - } - async function g(e) { - return (await ad({ - provider: `anthropic`, - providerOptions: e, - schema: Z$5 - }))?.containerUpload ?? !1; - } - async function _(e) { - let t = await ad({ - provider: `anthropic`, - providerOptions: e, - schema: Z$5 - }); - return { - title: t?.title, - context: t?.context - }; - } - for (let e = 0; e < u.length; e++) { - let i = u[e], y = e === u.length - 1, b = i.type; - switch (b) { - case `system`: { - let e = i.messages.map(({ content: e, providerOptions: t }) => ({ - type: `text`, - text: e, - cache_control: f.getCacheControl(t, { - type: `system message`, - canCache: !0 - }) - })); - p == null ? p = e : (m.push({ - role: `system`, - content: e - }), c.add(`mid-conversation-system-2026-04-07`)); - break; - } - case `user`: { - let e = []; - for (let t of i.messages) { - let { role: i, content: a } = t; - switch (i) { - case `user`: - for (let n = 0; n < a.length; n++) { - let i = a[n], s = n === a.length - 1, u = f.getCacheControl(i.providerOptions, { - type: `user message part`, - canCache: !0 - }) ?? (s ? f.getCacheControl(t.providerOptions, { - type: `user message`, - canCache: !0 - }) : void 0); - switch (i.type) { - case `text`: - e.push({ - type: `text`, - text: i.text, - cache_control: u - }); - break; - case `file`: - switch (i.data.type) { - case `reference`: { - let t = _d({ - reference: i.data.reference, - provider: `anthropic` - }); - c.add(`files-api-2025-04-14`), await g(i.providerOptions) ? e.push({ - type: `container_upload`, - file_id: t - }) : el(i.mediaType) === `image` ? e.push({ - type: `image`, - source: { - type: `file`, - file_id: t - }, - cache_control: u - }) : e.push({ - type: `document`, - source: { - type: `file`, - file_id: t - }, - cache_control: u - }); - break; - } - case `text`: { - let t = await h(i.providerOptions), n = await _(i.providerOptions); - e.push({ - type: `document`, - source: { - type: `text`, - media_type: `text/plain`, - data: i.data.text - }, - title: n.title ?? i.filename, - ...n.context && { context: n.context }, - ...t && { citations: { enabled: !0 } }, - cache_control: u - }); - break; - } - case `url`: - case `data`: { - let t = el(i.mediaType); - if (t === `image`) e.push({ - type: `image`, - source: i.data.type === `url` ? { - type: `url`, - url: i.data.url.toString() - } : { - type: `base64`, - media_type: gd({ part: i }), - data: zc(i.data.data) - }, - cache_control: u - }); - else if (t === `application` && (i.data.type === `url` ? i.mediaType === `application/pdf` : gd({ part: i }) === `application/pdf`)) { - c.add(`pdfs-2024-09-25`); - let t = await h(i.providerOptions), n = await _(i.providerOptions); - e.push({ - type: `document`, - source: i.data.type === `url` ? { - type: `url`, - url: i.data.url.toString() - } : { - type: `base64`, - media_type: `application/pdf`, - data: zc(i.data.data) - }, - title: n.title ?? i.filename, - ...n.context && { context: n.context }, - ...t && { citations: { enabled: !0 } }, - cache_control: u - }); - } else if (i.mediaType === `text/plain`) { - let t = await h(i.providerOptions), n = await _(i.providerOptions); - e.push({ - type: `document`, - source: i.data.type === `url` ? { - type: `url`, - url: i.data.url.toString() - } : { - type: `text`, - media_type: `text/plain`, - data: Ke$4(i.data.data) - }, - title: n.title ?? i.filename, - ...n.context && { context: n.context }, - ...t && { citations: { enabled: !0 } }, - cache_control: u - }); - } else throw new Ie$10({ functionality: `media type: ${i.mediaType}` }); - break; - } - } - break; - } - } - break; - case `tool`: - for (let r = 0; r < a.length; r++) { - let i = a[r]; - if (i.type === `tool-approval-response`) continue; - let l = i.output, u = `providerOptions` in l ? l.providerOptions : l.type === `content` ? l.value.find((e) => e.providerOptions != null)?.providerOptions : void 0, d = r === a.length - 1, p = f.getCacheControl(i.providerOptions, { - type: `tool result part`, - canCache: !0 - }) ?? f.getCacheControl(u, { - type: `tool result output`, - canCache: !0 - }) ?? (d ? f.getCacheControl(t.providerOptions, { - type: `tool result message`, - canCache: !0 - }) : void 0), m; - switch (l.type) { - case `content`: - m = l.value.map((e) => { - switch (e.type) { - case `text`: return { - type: `text`, - text: e.text - }; - case `file`: { - let t = el(e.mediaType); - if (e.data.type === `url`) return t === `image` ? { - type: `image`, - source: { - type: `url`, - url: e.data.url.toString() - } - } : { - type: `document`, - source: { - type: `url`, - url: e.data.url.toString() - } - }; - if (e.data.type === `data`) { - if (t === `image`) return { - type: `image`, - source: { - type: `base64`, - media_type: gd({ part: e }), - data: zc(e.data.data) - } - }; - if (gd({ part: e }) === `application/pdf`) return c.add(`pdfs-2024-09-25`), { - type: `document`, - source: { - type: `base64`, - media_type: `application/pdf`, - data: zc(e.data.data) - } - }; - n.push({ - type: `other`, - message: `unsupported tool content part type: ${e.type} with media type: ${e.mediaType}` - }); - return; - } - n.push({ - type: `other`, - message: `unsupported tool content part type: ${e.type} with data type: ${e.data.type}` - }); - return; - } - case `custom`: { - let t = e.providerOptions?.anthropic; - if (t?.type === `tool-reference`) return { - type: `tool_reference`, - tool_name: t.toolName - }; - n.push({ - type: `other`, - message: `unsupported custom tool content part` - }); - return; - } - default: - n.push({ - type: `other`, - message: `unsupported tool content part type: ${e.type}` - }); - return; - } - }).filter(Nl); - break; - case `text`: - case `error-text`: - m = l.value; - break; - case `execution-denied`: - m = l.reason ?? `Tool call execution denied.`; - break; - default: - m = JSON.stringify(l.value); - break; - } - e.push({ - type: `tool_result`, - tool_use_id: i.toolCallId, - content: m, - is_error: l.type === `error-text` || l.type === `error-json` ? !0 : void 0, - cache_control: p - }); - } - break; - default: throw Error(`Unsupported role: ${i}`); - } - } - m.push({ - role: `user`, - content: e - }); - break; - } - case `assistant`: { - let e = [], r = /* @__PURE__ */ new Set(); - for (let o = 0; o < i.messages.length; o++) { - let s = i.messages[o], c = o === i.messages.length - 1, { content: l } = s; - for (let i = 0; i < l.length; i++) { - let o = l[i], u = i === l.length - 1, p = f.getCacheControl(o.providerOptions, { - type: `assistant message part`, - canCache: !0 - }) ?? (u ? f.getCacheControl(s.providerOptions, { - type: `assistant message`, - canCache: !0 - }) : void 0); - switch (o.type) { - case `text`: - o.providerOptions?.anthropic?.type === `compaction` ? e.push({ - type: `compaction`, - content: o.text, - cache_control: p - }) : e.push({ - type: `text`, - text: y && c && u ? o.text.trim() : o.text, - cache_control: p - }); - break; - case `reasoning`: - if (t) { - let t = await ad({ - provider: `anthropic`, - providerOptions: o.providerOptions, - schema: ae$4 - }); - t == null ? n.push({ - type: `other`, - message: `unsupported reasoning metadata` - }) : t.signature == null ? t.redactedData == null ? n.push({ - type: `other`, - message: `unsupported reasoning metadata` - }) : (f.getCacheControl(o.providerOptions, { - type: `redacted thinking block`, - canCache: !1 - }), e.push({ - type: `redacted_thinking`, - data: t.redactedData - })) : (f.getCacheControl(o.providerOptions, { - type: `thinking block`, - canCache: !1 - }), e.push({ - type: `thinking`, - thinking: o.text, - signature: t.signature - })); - } else n.push({ - type: `other`, - message: `sending reasoning content is disabled for this model` - }); - break; - case `tool-call`: { - if (o.providerExecuted) { - let t = a.toProviderToolName(o.toolName); - if (o.providerOptions?.anthropic?.type === `mcp-tool-use`) { - r.add(o.toolCallId); - let t = o.providerOptions?.anthropic?.serverName; - if (t == null || typeof t != `string`) { - n.push({ - type: `other`, - message: `mcp tool use server name is required and must be a string` - }); - break; - } - e.push({ - type: `mcp_tool_use`, - id: o.toolCallId, - name: o.toolName, - input: o.input, - server_name: t, - cache_control: p - }); - } else if (t === `code_execution` && o.input != null && typeof o.input == `object` && `type` in o.input && typeof o.input.type == `string` && (o.input.type === `bash_code_execution` || o.input.type === `text_editor_code_execution`)) e.push({ - type: `server_tool_use`, - id: o.toolCallId, - name: o.input.type, - input: o.input, - cache_control: p - }); - else if (t === `code_execution` && o.input != null && typeof o.input == `object` && `type` in o.input && o.input.type === `programmatic-tool-call`) { - let { type: t, ...n } = o.input; - e.push({ - type: `server_tool_use`, - id: o.toolCallId, - name: `code_execution`, - input: n, - cache_control: p - }); - } else t === `code_execution` || t === `web_fetch` || t === `web_search` || t === `tool_search_tool_regex` || t === `tool_search_tool_bm25` ? e.push({ - type: `server_tool_use`, - id: o.toolCallId, - name: t, - input: o.input, - cache_control: p - }) : t === `advisor` ? e.push({ - type: `server_tool_use`, - id: o.toolCallId, - name: `advisor`, - input: {}, - cache_control: p - }) : n.push({ - type: `other`, - message: `provider executed tool call for tool ${o.toolName} is not supported` - }); - break; - } - let t = o.providerOptions?.anthropic, i = t?.caller ? (t.caller.type === `code_execution_20250825` || t.caller.type === `code_execution_20260120`) && t.caller.toolId ? { - type: t.caller.type, - tool_id: t.caller.toolId - } : t.caller.type === `direct` ? { type: `direct` } : void 0 : void 0; - e.push({ - type: `tool_use`, - id: o.toolCallId, - name: o.toolName, - input: o.input, - ...i && { caller: i }, - cache_control: p - }); - break; - } - case `tool-result`: { - let t = a.toProviderToolName(o.toolName); - if (r.has(o.toolCallId)) { - let t = o.output; - if (t.type !== `json` && t.type !== `error-json`) { - n.push({ - type: `other`, - message: `provider executed tool result output type ${t.type} for tool ${o.toolName} is not supported` - }); - break; - } - e.push({ - type: `mcp_tool_result`, - tool_use_id: o.toolCallId, - is_error: t.type === `error-json`, - content: t.value, - cache_control: p - }); - } else if (t === `code_execution`) { - let t = o.output; - if (t.type === `error-text` || t.type === `error-json`) { - let n = {}; - try { - typeof t.value == `string` ? n = JSON.parse(t.value) : typeof t.value == `object` && t.value !== null && (n = t.value); - } catch {} - n.type === `code_execution_tool_result_error` ? e.push({ - type: `code_execution_tool_result`, - tool_use_id: o.toolCallId, - content: { - type: `code_execution_tool_result_error`, - error_code: n.errorCode ?? `unknown` - }, - cache_control: p - }) : e.push({ - type: `bash_code_execution_tool_result`, - tool_use_id: o.toolCallId, - cache_control: p, - content: { - type: `bash_code_execution_tool_result_error`, - error_code: n.errorCode ?? `unknown` - } - }); - break; - } - if (t.type !== `json`) { - n.push({ - type: `other`, - message: `provider executed tool result output type ${t.type} for tool ${o.toolName} is not supported` - }); - break; - } - if (t.value == null || typeof t.value != `object` || !(`type` in t.value) || typeof t.value.type != `string`) { - n.push({ - type: `other`, - message: `provider executed tool result output value is not a valid code execution result for tool ${o.toolName}` - }); - break; - } - if (t.value.type === `code_execution_result`) { - let n = await $u({ - value: t.value, - schema: Pe$4 - }); - e.push({ - type: `code_execution_tool_result`, - tool_use_id: o.toolCallId, - content: { - type: n.type, - stdout: n.stdout, - stderr: n.stderr, - return_code: n.return_code, - content: n.content ?? [] - }, - cache_control: p - }); - } else if (t.value.type === `encrypted_code_execution_result`) { - let n = await $u({ - value: t.value, - schema: Be$4 - }); - n.type === `encrypted_code_execution_result` && e.push({ - type: `code_execution_tool_result`, - tool_use_id: o.toolCallId, - content: { - type: n.type, - encrypted_stdout: n.encrypted_stdout, - stderr: n.stderr, - return_code: n.return_code, - content: n.content ?? [] - }, - cache_control: p - }); - } else { - let n = await $u({ - value: t.value, - schema: Le$4 - }); - n.type === `code_execution_result` ? e.push({ - type: `code_execution_tool_result`, - tool_use_id: o.toolCallId, - content: { - type: n.type, - stdout: n.stdout, - stderr: n.stderr, - return_code: n.return_code, - content: n.content ?? [] - }, - cache_control: p - }) : n.type === `bash_code_execution_result` || n.type === `bash_code_execution_tool_result_error` ? e.push({ - type: `bash_code_execution_tool_result`, - tool_use_id: o.toolCallId, - cache_control: p, - content: n - }) : e.push({ - type: `text_editor_code_execution_tool_result`, - tool_use_id: o.toolCallId, - cache_control: p, - content: n - }); - } - break; - } - if (t === `web_fetch`) { - let t = o.output; - if (t.type === `error-json`) { - e.push({ - type: `web_fetch_tool_result`, - tool_use_id: o.toolCallId, - content: { - type: `web_fetch_tool_result_error`, - error_code: qe$4(t.value).errorCode ?? `unavailable` - }, - cache_control: p - }); - break; - } - if (t.type !== `json`) { - n.push({ - type: `other`, - message: `provider executed tool result output type ${t.type} for tool ${o.toolName} is not supported` - }); - break; - } - let r = await $u({ - value: t.value, - schema: ke$4 - }); - e.push({ - type: `web_fetch_tool_result`, - tool_use_id: o.toolCallId, - content: { - type: `web_fetch_result`, - url: r.url, - retrieved_at: r.retrievedAt, - content: { - type: `document`, - title: r.content.title, - citations: r.content.citations, - source: { - type: r.content.source.type, - media_type: r.content.source.mediaType, - data: r.content.source.data - } - } - }, - cache_control: p - }); - break; - } - if (t === `web_search`) { - let t = o.output; - if (t.type === `error-json`) { - e.push({ - type: `web_search_tool_result`, - tool_use_id: o.toolCallId, - content: { - type: `web_search_tool_result_error`, - error_code: qe$4(t.value).errorCode ?? `unavailable` - }, - cache_control: p - }); - break; - } - if (t.type !== `json`) { - n.push({ - type: `other`, - message: `provider executed tool result output type ${t.type} for tool ${o.toolName} is not supported` - }); - break; - } - let r = await $u({ - value: t.value, - schema: xe$4 - }); - e.push({ - type: `web_search_tool_result`, - tool_use_id: o.toolCallId, - content: r.map((e) => ({ - url: e.url, - title: e.title, - page_age: e.pageAge, - encrypted_content: e.encryptedContent, - type: e.type - })), - cache_control: p - }); - break; - } - if (t === `tool_search_tool_regex` || t === `tool_search_tool_bm25`) { - let t = o.output; - if (t.type !== `json`) { - n.push({ - type: `other`, - message: `provider executed tool result output type ${t.type} for tool ${o.toolName} is not supported` - }); - break; - } - let r = (await $u({ - value: t.value, - schema: Ue$4 - })).map((e) => ({ - type: `tool_reference`, - tool_name: e.toolName - })); - e.push({ - type: `tool_search_tool_result`, - tool_use_id: o.toolCallId, - content: { - type: `tool_search_tool_search_result`, - tool_references: r - }, - cache_control: p - }); - break; - } - if (t === `advisor`) { - let t = o.output; - if (t.type !== `json` && t.type !== `error-json`) { - n.push({ - type: `other`, - message: `provider executed tool result output type ${t.type} for tool ${o.toolName} is not supported` - }); - break; - } - let r = await $u({ - value: t.value, - schema: ue$4 - }); - r.type === `advisor_result` ? e.push({ - type: `advisor_tool_result`, - tool_use_id: o.toolCallId, - content: { - type: `advisor_result`, - text: r.text - }, - cache_control: p - }) : r.type === `advisor_redacted_result` ? e.push({ - type: `advisor_tool_result`, - tool_use_id: o.toolCallId, - content: { - type: `advisor_redacted_result`, - encrypted_content: r.encryptedContent - }, - cache_control: p - }) : e.push({ - type: `advisor_tool_result`, - tool_use_id: o.toolCallId, - content: { - type: `advisor_tool_result_error`, - error_code: r.errorCode - }, - cache_control: p - }); - break; - } - n.push({ - type: `other`, - message: `provider executed tool result for tool ${o.toolName} is not supported` - }); - break; - } - } - } - } - m.push({ - role: `assistant`, - content: Xe$4(e) - }); - break; - } - default: throw Error(`content type: ${b}`); - } - } - return { - prompt: { - system: p, - messages: m - }, - betas: c - }; -} -function Ye$4(e) { - let t = [], n; - for (let r of e) { - let { role: e } = r; - switch (e) { - case `system`: - n?.type !== `system` && (n = { - type: `system`, - messages: [] - }, t.push(n)), n.messages.push(r); - break; - case `assistant`: - n?.type !== `assistant` && (n = { - type: `assistant`, - messages: [] - }, t.push(n)), n.messages.push(r); - break; - case `user`: - n?.type !== `user` && (n = { - type: `user`, - messages: [] - }, t.push(n)), n.messages.push(r); - break; - case `tool`: - n?.type !== `user` && (n = { - type: `user`, - messages: [] - }, t.push(n)), n.messages.push(r); - break; - default: throw Error(`Unsupported role: ${e}`); - } - } - return t; -} -function Xe$4(e) { - let t = [], n = []; - function r() { - t.push(...n.filter((e) => e.type !== `tool_use`), ...n.filter((e) => e.type === `tool_use`)), n = []; - } - for (let i of e) i.type === `thinking` || i.type === `redacted_thinking` ? (r(), t.push(i)) : n.push(i); - return r(), t; -} -function Ze$4({ finishReason: e, isJsonResponseFromTool: t }) { - switch (e) { - case `pause_turn`: - case `end_turn`: - case `stop_sequence`: return `stop`; - case `refusal`: return `content-filter`; - case `tool_use`: return t ? `stop` : `tool-calls`; - case `max_tokens`: - case `model_context_window_exceeded`: return `length`; - case `compaction`: return `other`; - default: return `other`; - } -} -var Qe$4 = /* @__PURE__ */ new Set([ - `date-time`, - `time`, - `date`, - `duration`, - `email`, - `hostname`, - `uri`, - `ipv4`, - `ipv6`, - `uuid` -]); -var $e$4 = [ - `minimum`, - `maximum`, - `exclusiveMinimum`, - `exclusiveMaximum`, - `multipleOf`, - `minLength`, - `maxLength`, - `pattern`, - `minItems`, - `maxItems`, - `uniqueItems`, - `minProperties`, - `maxProperties`, - `not` -]; -function et$4(e) { - return tt$4(e); -} -function $$5(e) { - return typeof e == `boolean` || !at$4(e) ? e : tt$4(e); -} -function tt$4(e) { - let t = {}, n = e; - if (e.$ref != null) return { $ref: e.$ref }; - if (e.$schema != null && (t.$schema = e.$schema), e.$id != null && (t.$id = e.$id), e.title != null && (t.title = e.title), e.description != null && (t.description = e.description), e.default !== void 0 && (t.default = e.default), e.const !== void 0 && (t.const = e.const), e.enum != null && (t.enum = e.enum), e.type != null && (t.type = e.type), e.anyOf == null ? e.oneOf != null && (t.anyOf = e.oneOf.map($$5)) : t.anyOf = e.anyOf.map($$5), e.allOf != null && (t.allOf = e.allOf.map($$5)), e.definitions != null && (t.definitions = Object.fromEntries(Object.entries(e.definitions).map(([e, t]) => [e, $$5(t)]))), n.$defs != null) { - let e = t; - e.$defs = Object.fromEntries(Object.entries(n.$defs).map(([e, t]) => [e, $$5(t)])); - } - (e.type === `object` || e.properties != null) && (e.properties != null && (t.properties = Object.fromEntries(Object.entries(e.properties).map(([e, t]) => [e, $$5(t)]))), t.additionalProperties = !1, e.required != null && (t.required = e.required)), e.items != null && (t.items = Array.isArray(e.items) ? e.items.map($$5) : $$5(e.items)), typeof e.format == `string` && Qe$4.has(e.format) && (t.format = e.format); - let r = nt$4(e); - return r != null && (t.description = t.description == null ? r : `${t.description} -${r}`), t; -} -function nt$4(e) { - let t = $e$4.flatMap((t) => { - let n = e[t]; - return n == null || n === !1 ? [] : `${rt$4(t)}: ${it$4(n)}`; - }); - return typeof e.format == `string` && !Qe$4.has(e.format) && t.push(`format: ${e.format}`), t.length === 0 ? void 0 : `${t.join(`; `)}.`; -} -function rt$4(e) { - return e.replace(/[A-Z]/g, (e) => ` ${e.toLowerCase()}`); -} -function it$4(e) { - return typeof e == `string` ? e : JSON.stringify(e); -} -function at$4(e) { - return typeof e == `object` && !!e && !Array.isArray(e); -} -function ot$4(e, t, n) { - if (e.type === `web_search_result_location`) return { - type: `source`, - sourceType: `url`, - id: n(), - url: e.url, - title: e.title, - providerMetadata: { anthropic: { - citedText: e.cited_text, - encryptedIndex: e.encrypted_index - } } - }; - if (e.type !== `page_location` && e.type !== `char_location`) return; - let r = t[e.document_index]; - if (r) return { - type: `source`, - sourceType: `document`, - id: n(), - mediaType: r.mediaType, - title: e.document_title ?? r.title, - filename: r.filename, - providerMetadata: { anthropic: e.type === `page_location` ? { - citedText: e.cited_text, - startPageNumber: e.start_page_number, - endPageNumber: e.end_page_number - } : { - citedText: e.cited_text, - startCharIndex: e.start_char_index, - endCharIndex: e.end_char_index - } } - }; -} -var st$4 = class t { - constructor(e, t) { - this.specificationVersion = `v4`, this.modelId = e, this.config = t, this.generateId = t.generateId ?? bl; - } - static [Mc](e) { - return Cd({ - modelId: e.modelId, - config: e.config - }); - } - static [Nc](e) { - return new t(e.modelId, e.config); - } - supportsUrl(e) { - return e.protocol === `https:`; - } - get provider() { - return this.config.provider; - } - get providerOptionsName() { - let e = this.config.provider, t = e.indexOf(`.`); - return t === -1 ? e : e.substring(0, t); - } - get supportedUrls() { - var e; - return (e = this.config).supportedUrls?.call(e) ?? {}; - } - async getArgs({ userSuppliedBetas: e, prompt: t, maxOutputTokens: n, temperature: r, topP: i, topK: a, frequencyPenalty: o, presencePenalty: s, stopSequences: c, responseFormat: u, seed: f, tools: p, toolChoice: m, reasoning: h, providerOptions: g, stream: v }) { - let y = []; - o != null && y.push({ - type: `unsupported`, - feature: `frequencyPenalty` - }), s != null && y.push({ - type: `unsupported`, - feature: `presencePenalty` - }), f != null && y.push({ - type: `unsupported`, - feature: `seed` - }), r != null && r > 1 ? (y.push({ - type: `unsupported`, - feature: `temperature`, - details: `${r} exceeds anthropic maximum of 1.0. clamped to 1.0` - }), r = 1) : r != null && r < 0 && (y.push({ - type: `unsupported`, - feature: `temperature`, - details: `${r} is below anthropic minimum of 0. clamped to 0` - }), r = 0), u?.type === `json` && (u.schema ?? y.push({ - type: `unsupported`, - feature: `responseFormat`, - details: `JSON response format requires a schema. The response format is ignored.` - })); - let b = this.providerOptionsName, x = await ad({ - provider: `anthropic`, - providerOptions: g, - schema: oe$3 - }), S = b === `anthropic` ? null : await ad({ - provider: b, - providerOptions: g, - schema: oe$3 - }), C = S != null, w = Object.assign({}, x ?? {}, S ?? {}), { maxOutputTokens: T, supportsStructuredOutput: E, supportsAdaptiveThinking: D, rejectsSamplingParameters: O, supportsXhighEffort: A, isKnownModel: j } = ct$4(this.modelId); - O && (r != null && (y.push({ - type: `unsupported`, - feature: `temperature`, - details: `temperature is not supported by ${this.modelId} and will be ignored` - }), r = void 0), a != null && (y.push({ - type: `unsupported`, - feature: `topK`, - details: `topK is not supported by ${this.modelId} and will be ignored` - }), a = void 0), i != null && (y.push({ - type: `unsupported`, - feature: `topP`, - details: `topP is not supported by ${this.modelId} and will be ignored` - }), i = void 0)); - let M = j || this.modelId.startsWith(`claude-`), ee = (this.config.supportsNativeStructuredOutput ?? !0) && E, N = (this.config.supportsStrictTools ?? !0) && E, P = w?.structuredOutputMode ?? `auto`, F = P === `outputFormat` || P === `auto` && ee, I = u?.type === `json` && u.schema != null && !F ? { - type: `function`, - name: `json`, - description: `Respond with a JSON object.`, - inputSchema: u.schema - } : void 0, L = w?.contextManagement, R = new Q$5(), z = Hc({ - tools: p, - providerToolNames: { - "anthropic.code_execution_20250522": `code_execution`, - "anthropic.code_execution_20250825": `code_execution`, - "anthropic.code_execution_20260120": `code_execution`, - "anthropic.computer_20241022": `computer`, - "anthropic.computer_20250124": `computer`, - "anthropic.text_editor_20241022": `str_replace_editor`, - "anthropic.text_editor_20250124": `str_replace_editor`, - "anthropic.text_editor_20250429": `str_replace_based_edit_tool`, - "anthropic.text_editor_20250728": `str_replace_based_edit_tool`, - "anthropic.bash_20241022": `bash`, - "anthropic.bash_20250124": `bash`, - "anthropic.memory_20250818": `memory`, - "anthropic.web_search_20250305": `web_search`, - "anthropic.web_search_20260209": `web_search`, - "anthropic.web_fetch_20250910": `web_fetch`, - "anthropic.web_fetch_20260209": `web_fetch`, - "anthropic.tool_search_regex_20251119": `tool_search_tool_regex`, - "anthropic.tool_search_bm25_20251119": `tool_search_tool_bm25`, - "anthropic.advisor_20260301": `advisor` - } - }), { prompt: B, betas: V } = await Je$4({ - prompt: t, - sendReasoning: w?.sendReasoning ?? !0, - warnings: y, - cacheControlValidator: R, - toolNameMapping: z - }); - if (Il(h) && w?.effort == null) { - let e = ut$4({ - reasoning: h, - supportsAdaptiveThinking: D, - supportsXhighEffort: A, - maxOutputTokensForModel: T, - warnings: y - }); - e != null && (w.thinking ??= e.thinking, e.effort != null && w.thinking?.type !== `disabled` && (w.effort = e.effort)); - } - let H = w?.thinking?.type, U = H === `enabled` || H === `adaptive`, W = H === `enabled` ? w?.thinking?.budgetTokens : void 0, G = H === `adaptive` ? w?.thinking?.display : void 0, K = n ?? T, q = { - model: this.modelId, - max_tokens: K, - temperature: r, - top_k: a, - top_p: i, - stop_sequences: c, - ...U && { thinking: { - type: H, - ...W != null && { budget_tokens: W }, - ...G != null && { display: G } - } }, - ...(w?.effort || w?.taskBudget || F && u?.type === `json` && u.schema != null) && { output_config: { - ...w?.effort && { effort: w.effort }, - ...w?.taskBudget && { task_budget: { - type: w.taskBudget.type, - total: w.taskBudget.total, - ...w.taskBudget.remaining != null && { remaining: w.taskBudget.remaining } - } }, - ...F && u?.type === `json` && u.schema != null && { format: { - type: `json_schema`, - schema: et$4(u.schema) - } } - } }, - ...w?.speed && { speed: w.speed }, - ...w?.inferenceGeo && { inference_geo: w.inferenceGeo }, - ...w?.fallbacks && w.fallbacks.length > 0 && { fallbacks: w.fallbacks }, - ...w?.cacheControl && { cache_control: w.cacheControl }, - ...w?.metadata?.userId != null && { metadata: { user_id: w.metadata.userId } }, - ...w?.mcpServers && w.mcpServers.length > 0 && { mcp_servers: w.mcpServers.map((e) => ({ - type: e.type, - name: e.name, - url: e.url, - authorization_token: e.authorizationToken, - tool_configuration: e.toolConfiguration ? { - allowed_tools: e.toolConfiguration.allowedTools, - enabled: e.toolConfiguration.enabled - } : void 0 - })) }, - ...w?.container && { container: w.container.skills && w.container.skills.length > 0 ? { - id: w.container.id, - skills: w.container.skills.map((e) => ({ - type: e.type, - skill_id: e.type === `custom` ? _d({ - reference: e.providerReference, - provider: `anthropic` - }) : e.skillId, - version: e.version - })) - } : w.container.id }, - system: B.system, - messages: B.messages, - ...L && { context_management: { edits: L.edits.map((e) => { - let t = e.type; - switch (t) { - case `clear_tool_uses_20250919`: return { - type: e.type, - ...e.trigger !== void 0 && { trigger: e.trigger }, - ...e.keep !== void 0 && { keep: e.keep }, - ...e.clearAtLeast !== void 0 && { clear_at_least: e.clearAtLeast }, - ...e.clearToolInputs !== void 0 && { clear_tool_inputs: e.clearToolInputs }, - ...e.excludeTools !== void 0 && { exclude_tools: e.excludeTools } - }; - case `clear_thinking_20251015`: return { - type: e.type, - ...e.keep !== void 0 && { keep: e.keep } - }; - case `compact_20260112`: return { - type: e.type, - ...e.trigger !== void 0 && { trigger: e.trigger }, - ...e.pauseAfterCompaction !== void 0 && { pause_after_compaction: e.pauseAfterCompaction }, - ...e.instructions !== void 0 && { instructions: e.instructions } - }; - default: - y.push({ - type: `other`, - message: `Unknown context management strategy: ${t}` - }); - return; - } - }).filter((e) => e !== void 0) } } - }; - U ? (H === `enabled` && W == null && (y.push({ - type: `compatibility`, - feature: `extended thinking`, - details: `thinking budget is required when thinking is enabled. using default budget of 1024 tokens.` - }), q.thinking = { - type: `enabled`, - budget_tokens: 1024 - }, W = 1024), q.temperature != null && (q.temperature = void 0, y.push({ - type: `unsupported`, - feature: `temperature`, - details: `temperature is not supported when thinking is enabled` - })), a != null && (q.top_k = void 0, y.push({ - type: `unsupported`, - feature: `topK`, - details: `topK is not supported when thinking is enabled` - })), i != null && (q.top_p = void 0, y.push({ - type: `unsupported`, - feature: `topP`, - details: `topP is not supported when thinking is enabled` - })), q.max_tokens = K + (W ?? 0)) : M && i != null && r != null && (y.push({ - type: `unsupported`, - feature: `topP`, - details: `topP is not supported when temperature is set. topP is ignored.` - }), q.top_p = void 0), j && q.max_tokens > T && (n != null && y.push({ - type: `unsupported`, - feature: `maxOutputTokens`, - details: `${q.max_tokens} (maxOutputTokens + thinkingBudget) is greater than ${this.modelId} ${T} max output tokens. The max output tokens have been limited to ${T}.` - }), q.max_tokens = T), w?.mcpServers && w.mcpServers.length > 0 && V.add(`mcp-client-2025-04-04`), L && (V.add(`context-management-2025-06-27`), L.edits.some((e) => e.type === `compact_20260112`) && V.add(`compact-2026-01-12`)), w?.container && w.container.skills && w.container.skills.length > 0 && (V.add(`code-execution-2025-08-25`), V.add(`skills-2025-10-02`), V.add(`files-api-2025-04-14`), p?.some((e) => e.type === `provider` && (e.id === `anthropic.code_execution_20250825` || e.id === `anthropic.code_execution_20260120`)) || y.push({ - type: `other`, - message: `code execution tool is required when using skills` - })), w?.taskBudget && V.add(`task-budgets-2026-03-13`), w?.speed === `fast` && V.add(`fast-mode-2026-02-01`), w?.fallbacks && w.fallbacks.length > 0 && V.add(`server-side-fallback-2026-06-01`); - let J = v && (w?.toolStreaming ?? !0), { tools: Y, toolChoice: te, toolWarnings: ne, betas: X } = await Me$4(I == null ? { - tools: p ?? [], - toolChoice: m, - disableParallelToolUse: w?.disableParallelToolUse, - cacheControlValidator: R, - supportsStructuredOutput: ee, - supportsStrictTools: N, - defaultEagerInputStreaming: J - } : { - tools: [...p ?? [], I], - toolChoice: { type: `required` }, - disableParallelToolUse: !0, - cacheControlValidator: R, - supportsStructuredOutput: !1, - supportsStrictTools: N, - defaultEagerInputStreaming: J - }), re = R.getWarnings(); - return { - args: { - ...q, - tools: Y, - tool_choice: te, - stream: v === !0 ? !0 : void 0 - }, - warnings: [ - ...y, - ...ne, - ...re - ], - betas: /* @__PURE__ */ new Set([ - ...V, - ...X, - ...e, - ...w?.anthropicBeta ?? [] - ]), - usesJsonResponseTool: I != null, - toolNameMapping: z, - providerOptionsName: b, - usedCustomProviderKey: C - }; - } - async getHeaders({ betas: e, headers: t }) { - return Pc(this.config.headers ? await hd(this.config.headers) : void 0, t, e.size > 0 ? { "anthropic-beta": Array.from(e).join(`,`) } : {}); - } - async getBetasFromHeaders(e) { - let t = (this.config.headers ? await hd(this.config.headers) : void 0)?.[`anthropic-beta`] ?? ``, n = e?.[`anthropic-beta`] ?? ``; - return new Set([...t.toLowerCase().split(`,`), ...n.toLowerCase().split(`,`)].map((e) => e.trim()).filter((e) => e !== ``)); - } - buildRequestUrl(e) { - var t; - return (t = this.config).buildRequestUrl?.call(t, this.config.baseURL, e) ?? `${this.config.baseURL}/messages`; - } - transformRequestBody(e, t) { - var n; - return (n = this.config).transformRequestBody?.call(n, e, t) ?? e; - } - extractCitationDocuments(e) { - return e.filter((e) => e.role === `user`).flatMap((e) => e.content).filter((e) => e.type !== `file` || e.mediaType !== `application/pdf` && e.mediaType !== `text/plain` ? !1 : e.providerOptions?.anthropic?.citations?.enabled ?? !1).map((e) => { - let t = e; - return { - title: t.filename ?? `Untitled Document`, - filename: t.filename, - mediaType: t.mediaType - }; - }); - } - async doGenerate(e) { - let { args: t, warnings: n, betas: r, usesJsonResponseTool: i, toolNameMapping: a, providerOptionsName: o, usedCustomProviderKey: s } = await this.getArgs({ - ...e, - stream: !1, - userSuppliedBetas: await this.getBetasFromHeaders(e.headers) - }), c = [...this.extractCitationDocuments(e.prompt)], l = lt$4(t.tools), { responseHeaders: u, value: d, rawValue: f } = await sd({ - url: this.buildRequestUrl(!1), - headers: await this.getHeaders({ - betas: r, - headers: e.headers - }), - body: this.transformRequestBody(t, r), - failedResponseHandler: Y$5, - successfulResponseHandler: bd(re$3), - abortSignal: e.abortSignal, - fetch: this.config.fetch - }), p = [], m = {}, h = {}, g = !1; - for (let e of d.content) switch (e.type) { - case `text`: - if (!i && (p.push({ - type: `text`, - text: e.text - }), e.citations)) for (let t of e.citations) { - let e = ot$4(t, c, this.generateId); - e && p.push(e); - } - break; - case `thinking`: - p.push({ - type: `reasoning`, - text: e.thinking, - providerMetadata: { anthropic: { signature: e.signature } } - }); - break; - case `redacted_thinking`: - p.push({ - type: `reasoning`, - text: ``, - providerMetadata: { anthropic: { redactedData: e.data } } - }); - break; - case `compaction`: - p.push({ - type: `text`, - text: e.content, - providerMetadata: { anthropic: { type: `compaction` } } - }); - break; - case `tool_use`: - if (i && e.name === `json`) g = !0, p.push({ - type: `text`, - text: JSON.stringify(e.input) - }); - else { - let t = e.caller, n = t ? { - type: t.type, - toolId: `tool_id` in t ? t.tool_id : void 0 - } : void 0; - p.push({ - type: `tool-call`, - toolCallId: e.id, - toolName: e.name, - input: JSON.stringify(e.input), - ...n && { providerMetadata: { anthropic: { caller: n } } } - }); - } - break; - case `server_tool_use`: - if (e.name === `text_editor_code_execution` || e.name === `bash_code_execution`) p.push({ - type: `tool-call`, - toolCallId: e.id, - toolName: a.toCustomToolName(`code_execution`), - input: JSON.stringify({ - type: e.name, - ...e.input - }), - providerExecuted: !0, - ...l ? { dynamic: !0 } : {} - }); - else if (e.name === `web_search` || e.name === `code_execution` || e.name === `web_fetch`) { - let t = e.name === `code_execution` && e.input != null && typeof e.input == `object` && `code` in e.input && !(`type` in e.input) ? { - type: `programmatic-tool-call`, - ...e.input - } : e.input; - p.push({ - type: `tool-call`, - toolCallId: e.id, - toolName: a.toCustomToolName(e.name), - input: JSON.stringify(t), - providerExecuted: !0, - ...l && e.name === `code_execution` ? { dynamic: !0 } : {} - }); - } else e.name === `tool_search_tool_regex` || e.name === `tool_search_tool_bm25` ? (h[e.id] = e.name, p.push({ - type: `tool-call`, - toolCallId: e.id, - toolName: a.toCustomToolName(e.name), - input: JSON.stringify(e.input), - providerExecuted: !0 - })) : e.name === `advisor` && p.push({ - type: `tool-call`, - toolCallId: e.id, - toolName: a.toCustomToolName(`advisor`), - input: JSON.stringify(e.input), - providerExecuted: !0 - }); - break; - case `mcp_tool_use`: - m[e.id] = { - type: `tool-call`, - toolCallId: e.id, - toolName: e.name, - input: JSON.stringify(e.input), - providerExecuted: !0, - dynamic: !0, - providerMetadata: { anthropic: { - type: `mcp-tool-use`, - serverName: e.server_name - } } - }, p.push(m[e.id]); - break; - case `mcp_tool_result`: - p.push({ - type: `tool-result`, - toolCallId: e.tool_use_id, - toolName: m[e.tool_use_id].toolName, - isError: e.is_error, - result: e.content, - dynamic: !0, - providerMetadata: m[e.tool_use_id].providerMetadata - }); - break; - case `web_fetch_tool_result`: - e.content.type === `web_fetch_result` ? (c.push({ - title: e.content.content.title ?? e.content.url, - mediaType: e.content.content.source.media_type - }), p.push({ - type: `tool-result`, - toolCallId: e.tool_use_id, - toolName: a.toCustomToolName(`web_fetch`), - result: { - type: `web_fetch_result`, - url: e.content.url, - retrievedAt: e.content.retrieved_at, - content: { - type: e.content.content.type, - title: e.content.content.title, - citations: e.content.content.citations, - source: { - type: e.content.content.source.type, - mediaType: e.content.content.source.media_type, - data: e.content.content.source.data - } - } - } - })) : e.content.type === `web_fetch_tool_result_error` && p.push({ - type: `tool-result`, - toolCallId: e.tool_use_id, - toolName: a.toCustomToolName(`web_fetch`), - isError: !0, - result: { - type: `web_fetch_tool_result_error`, - errorCode: e.content.error_code - } - }); - break; - case `web_search_tool_result`: - if (Array.isArray(e.content)) { - p.push({ - type: `tool-result`, - toolCallId: e.tool_use_id, - toolName: a.toCustomToolName(`web_search`), - result: e.content.map((e) => ({ - url: e.url, - title: e.title, - pageAge: e.page_age ?? null, - encryptedContent: e.encrypted_content, - type: e.type - })) - }); - for (let t of e.content) p.push({ - type: `source`, - sourceType: `url`, - id: this.generateId(), - url: t.url, - title: t.title, - providerMetadata: { anthropic: { pageAge: t.page_age ?? null } } - }); - } else p.push({ - type: `tool-result`, - toolCallId: e.tool_use_id, - toolName: a.toCustomToolName(`web_search`), - isError: !0, - result: { - type: `web_search_tool_result_error`, - errorCode: e.content.error_code - } - }); - break; - case `code_execution_tool_result`: - e.content.type === `code_execution_result` ? p.push({ - type: `tool-result`, - toolCallId: e.tool_use_id, - toolName: a.toCustomToolName(`code_execution`), - result: { - type: e.content.type, - stdout: e.content.stdout, - stderr: e.content.stderr, - return_code: e.content.return_code, - content: e.content.content ?? [] - } - }) : e.content.type === `encrypted_code_execution_result` ? p.push({ - type: `tool-result`, - toolCallId: e.tool_use_id, - toolName: a.toCustomToolName(`code_execution`), - result: { - type: e.content.type, - encrypted_stdout: e.content.encrypted_stdout, - stderr: e.content.stderr, - return_code: e.content.return_code, - content: e.content.content ?? [] - } - }) : e.content.type === `code_execution_tool_result_error` && p.push({ - type: `tool-result`, - toolCallId: e.tool_use_id, - toolName: a.toCustomToolName(`code_execution`), - isError: !0, - result: { - type: `code_execution_tool_result_error`, - errorCode: e.content.error_code - } - }); - break; - case `bash_code_execution_tool_result`: - case `text_editor_code_execution_tool_result`: - p.push({ - type: `tool-result`, - toolCallId: e.tool_use_id, - toolName: a.toCustomToolName(`code_execution`), - result: e.content - }); - break; - case `tool_search_tool_result`: { - let t = h[e.tool_use_id]; - if (t == null) { - let e = a.toCustomToolName(`tool_search_tool_bm25`); - a.toCustomToolName(`tool_search_tool_regex`), t = e === `tool_search_tool_bm25` ? `tool_search_tool_regex` : `tool_search_tool_bm25`; - } - e.content.type === `tool_search_tool_search_result` ? p.push({ - type: `tool-result`, - toolCallId: e.tool_use_id, - toolName: a.toCustomToolName(t), - result: e.content.tool_references.map((e) => ({ - type: e.type, - toolName: e.tool_name - })) - }) : p.push({ - type: `tool-result`, - toolCallId: e.tool_use_id, - toolName: a.toCustomToolName(t), - isError: !0, - result: { - type: `tool_search_tool_result_error`, - errorCode: e.content.error_code - } - }); - break; - } - case `advisor_tool_result`: { - let t = a.toCustomToolName(`advisor`); - e.content.type === `advisor_result` ? p.push({ - type: `tool-result`, - toolCallId: e.tool_use_id, - toolName: t, - result: { - type: `advisor_result`, - text: e.content.text - } - }) : e.content.type === `advisor_redacted_result` ? p.push({ - type: `tool-result`, - toolCallId: e.tool_use_id, - toolName: t, - result: { - type: `advisor_redacted_result`, - encryptedContent: e.content.encrypted_content - } - }) : p.push({ - type: `tool-result`, - toolCallId: e.tool_use_id, - toolName: t, - isError: !0, - result: { - type: `advisor_tool_result_error`, - errorCode: e.content.error_code - } - }); - break; - } - case `fallback`: break; - } - return { - content: p, - finishReason: { - unified: Ze$4({ - finishReason: d.stop_reason, - isJsonResponseFromTool: g - }), - raw: d.stop_reason ?? void 0 - }, - usage: Ne$4({ usage: d.usage }), - request: { body: t }, - response: { - id: d.id ?? void 0, - modelId: d.model ?? void 0, - headers: u, - body: f - }, - warnings: n, - providerMetadata: (() => { - let e = ft$4(d.stop_details), t = { - usage: d.usage, - stopSequence: d.stop_sequence ?? null, - ...e == null ? {} : { stopDetails: e }, - iterations: d.usage.iterations ? d.usage.iterations.map((e) => ({ - type: e.type, - ...e.model == null ? {} : { model: e.model }, - inputTokens: e.input_tokens, - outputTokens: e.output_tokens, - ...e.cache_creation_input_tokens ? { cacheCreationInputTokens: e.cache_creation_input_tokens } : {}, - ...e.cache_read_input_tokens ? { cacheReadInputTokens: e.cache_read_input_tokens } : {} - })) : null, - container: d.container ? { - expiresAt: d.container.expires_at, - id: d.container.id, - skills: d.container.skills?.map((e) => ({ - type: e.type, - skillId: e.skill_id, - version: e.version - })) ?? null - } : null, - contextManagement: dt$4(d.context_management) ?? null - }, n = { anthropic: t }; - return s && o !== `anthropic` && (n[o] = t), n; - })() - }; - } - async doStream(t) { - "use step"; - let { args: n, warnings: r, betas: i, usesJsonResponseTool: a, toolNameMapping: o, providerOptionsName: s, usedCustomProviderKey: c } = await this.getArgs({ - ...t, - stream: !0, - userSuppliedBetas: await this.getBetasFromHeaders(t.headers) - }), l = [...this.extractCitationDocuments(t.prompt)], u = lt$4(n.tools), d = this.buildRequestUrl(!0), { responseHeaders: f, value: p } = await sd({ - url: d, - headers: await this.getHeaders({ - betas: i, - headers: t.headers - }), - body: this.transformRequestBody(n, i), - failedResponseHandler: Y$5, - successfulResponseHandler: yd(ie$3), - abortSignal: t.abortSignal, - fetch: this.config.fetch - }), m = { - unified: `other`, - raw: void 0 - }, h = { - input_tokens: 0, - output_tokens: 0, - cache_creation_input_tokens: 0, - cache_read_input_tokens: 0, - iterations: null - }, g = {}, _ = {}, v = {}, y = null, b, x = null, S, C = null, w = !1, T, E = this.generateId, [D, O] = p.pipeThrough(new TransformStream({ - start(e) { - e.enqueue({ - type: `stream-start`, - warnings: r - }); - }, - transform(e, n) { - if (t.includeRawChunks && n.enqueue({ - type: `raw`, - rawValue: e.rawValue - }), !e.success) { - n.enqueue({ - type: `error`, - error: e.error - }); - return; - } - let r = e.value; - switch (r.type) { - case `ping`: return; - case `content_block_start`: { - let e = r.content_block, t = e.type; - if (t === `fallback`) return; - switch (T = t, t) { - case `text`: - if (a) return; - g[r.index] = { type: `text` }, n.enqueue({ - type: `text-start`, - id: String(r.index) - }); - return; - case `thinking`: - g[r.index] = { type: `reasoning` }, n.enqueue({ - type: `reasoning-start`, - id: String(r.index) - }); - return; - case `redacted_thinking`: - g[r.index] = { type: `reasoning` }, n.enqueue({ - type: `reasoning-start`, - id: String(r.index), - providerMetadata: { anthropic: { redactedData: e.data } } - }); - return; - case `compaction`: - g[r.index] = { type: `text` }, n.enqueue({ - type: `text-start`, - id: String(r.index), - providerMetadata: { anthropic: { type: `compaction` } } - }); - return; - case `tool_use`: - if (a && e.name === `json`) w = !0, g[r.index] = { type: `text` }, n.enqueue({ - type: `text-start`, - id: String(r.index) - }); - else { - let t = e.caller, i = t ? { - type: t.type, - toolId: `tool_id` in t ? t.tool_id : void 0 - } : void 0, a = e.input && Object.keys(e.input).length > 0 ? JSON.stringify(e.input) : ``; - g[r.index] = { - type: `tool-call`, - toolCallId: e.id, - toolName: e.name, - input: a, - firstDelta: a.length === 0, - ...i && { caller: i } - }, n.enqueue({ - type: `tool-input-start`, - id: e.id, - toolName: e.name - }); - } - return; - case `server_tool_use`: - if ([ - `web_fetch`, - `web_search`, - `code_execution`, - `text_editor_code_execution`, - `bash_code_execution` - ].includes(e.name)) { - let t = e.name === `text_editor_code_execution` || e.name === `bash_code_execution` ? `code_execution` : e.name, i = o.toCustomToolName(t), a = e.input != null && typeof e.input == `object` && Object.keys(e.input).length > 0 ? JSON.stringify(e.input) : ``; - g[r.index] = { - type: `tool-call`, - toolCallId: e.id, - toolName: i, - input: a, - providerExecuted: !0, - ...u && t === `code_execution` ? { dynamic: !0 } : {}, - firstDelta: !0, - providerToolName: t - }, n.enqueue({ - type: `tool-input-start`, - id: e.id, - toolName: i, - providerExecuted: !0, - ...u && t === `code_execution` ? { dynamic: !0 } : {} - }); - } else if (e.name === `tool_search_tool_regex` || e.name === `tool_search_tool_bm25`) { - v[e.id] = e.name; - let t = o.toCustomToolName(e.name); - g[r.index] = { - type: `tool-call`, - toolCallId: e.id, - toolName: t, - input: ``, - providerExecuted: !0, - firstDelta: !0, - providerToolName: e.name - }, n.enqueue({ - type: `tool-input-start`, - id: e.id, - toolName: t, - providerExecuted: !0 - }); - } else if (e.name === `advisor`) { - let t = o.toCustomToolName(`advisor`); - g[r.index] = { - type: `tool-call`, - toolCallId: e.id, - toolName: t, - input: `{}`, - providerExecuted: !0, - firstDelta: !0, - providerToolName: e.name - }, n.enqueue({ - type: `tool-input-start`, - id: e.id, - toolName: t, - providerExecuted: !0 - }); - } - return; - case `web_fetch_tool_result`: - e.content.type === `web_fetch_result` ? (l.push({ - title: e.content.content.title ?? e.content.url, - mediaType: e.content.content.source.media_type - }), n.enqueue({ - type: `tool-result`, - toolCallId: e.tool_use_id, - toolName: o.toCustomToolName(`web_fetch`), - result: { - type: `web_fetch_result`, - url: e.content.url, - retrievedAt: e.content.retrieved_at, - content: { - type: e.content.content.type, - title: e.content.content.title, - citations: e.content.content.citations, - source: { - type: e.content.content.source.type, - mediaType: e.content.content.source.media_type, - data: e.content.content.source.data - } - } - } - })) : e.content.type === `web_fetch_tool_result_error` && n.enqueue({ - type: `tool-result`, - toolCallId: e.tool_use_id, - toolName: o.toCustomToolName(`web_fetch`), - isError: !0, - result: { - type: `web_fetch_tool_result_error`, - errorCode: e.content.error_code - } - }); - return; - case `web_search_tool_result`: - if (Array.isArray(e.content)) { - n.enqueue({ - type: `tool-result`, - toolCallId: e.tool_use_id, - toolName: o.toCustomToolName(`web_search`), - result: e.content.map((e) => ({ - url: e.url, - title: e.title, - pageAge: e.page_age ?? null, - encryptedContent: e.encrypted_content, - type: e.type - })) - }); - for (let t of e.content) n.enqueue({ - type: `source`, - sourceType: `url`, - id: E(), - url: t.url, - title: t.title, - providerMetadata: { anthropic: { pageAge: t.page_age ?? null } } - }); - } else n.enqueue({ - type: `tool-result`, - toolCallId: e.tool_use_id, - toolName: o.toCustomToolName(`web_search`), - isError: !0, - result: { - type: `web_search_tool_result_error`, - errorCode: e.content.error_code - } - }); - return; - case `code_execution_tool_result`: - e.content.type === `code_execution_result` ? n.enqueue({ - type: `tool-result`, - toolCallId: e.tool_use_id, - toolName: o.toCustomToolName(`code_execution`), - result: { - type: e.content.type, - stdout: e.content.stdout, - stderr: e.content.stderr, - return_code: e.content.return_code, - content: e.content.content ?? [] - } - }) : e.content.type === `encrypted_code_execution_result` ? n.enqueue({ - type: `tool-result`, - toolCallId: e.tool_use_id, - toolName: o.toCustomToolName(`code_execution`), - result: { - type: e.content.type, - encrypted_stdout: e.content.encrypted_stdout, - stderr: e.content.stderr, - return_code: e.content.return_code, - content: e.content.content ?? [] - } - }) : e.content.type === `code_execution_tool_result_error` && n.enqueue({ - type: `tool-result`, - toolCallId: e.tool_use_id, - toolName: o.toCustomToolName(`code_execution`), - isError: !0, - result: { - type: `code_execution_tool_result_error`, - errorCode: e.content.error_code - } - }); - return; - case `bash_code_execution_tool_result`: - case `text_editor_code_execution_tool_result`: - n.enqueue({ - type: `tool-result`, - toolCallId: e.tool_use_id, - toolName: o.toCustomToolName(`code_execution`), - result: e.content - }); - return; - case `tool_search_tool_result`: { - let t = v[e.tool_use_id]; - if (t == null) { - let e = o.toCustomToolName(`tool_search_tool_bm25`); - o.toCustomToolName(`tool_search_tool_regex`), t = e === `tool_search_tool_bm25` ? `tool_search_tool_regex` : `tool_search_tool_bm25`; - } - e.content.type === `tool_search_tool_search_result` ? n.enqueue({ - type: `tool-result`, - toolCallId: e.tool_use_id, - toolName: o.toCustomToolName(t), - result: e.content.tool_references.map((e) => ({ - type: e.type, - toolName: e.tool_name - })) - }) : n.enqueue({ - type: `tool-result`, - toolCallId: e.tool_use_id, - toolName: o.toCustomToolName(t), - isError: !0, - result: { - type: `tool_search_tool_result_error`, - errorCode: e.content.error_code - } - }); - return; - } - case `advisor_tool_result`: { - let t = o.toCustomToolName(`advisor`); - e.content.type === `advisor_result` ? n.enqueue({ - type: `tool-result`, - toolCallId: e.tool_use_id, - toolName: t, - result: { - type: `advisor_result`, - text: e.content.text - } - }) : e.content.type === `advisor_redacted_result` ? n.enqueue({ - type: `tool-result`, - toolCallId: e.tool_use_id, - toolName: t, - result: { - type: `advisor_redacted_result`, - encryptedContent: e.content.encrypted_content - } - }) : n.enqueue({ - type: `tool-result`, - toolCallId: e.tool_use_id, - toolName: t, - isError: !0, - result: { - type: `advisor_tool_result_error`, - errorCode: e.content.error_code - } - }); - return; - } - case `mcp_tool_use`: - _[e.id] = { - type: `tool-call`, - toolCallId: e.id, - toolName: e.name, - input: JSON.stringify(e.input), - providerExecuted: !0, - dynamic: !0, - providerMetadata: { anthropic: { - type: `mcp-tool-use`, - serverName: e.server_name - } } - }, n.enqueue(_[e.id]); - return; - case `mcp_tool_result`: - n.enqueue({ - type: `tool-result`, - toolCallId: e.tool_use_id, - toolName: _[e.tool_use_id].toolName, - isError: e.is_error, - result: e.content, - dynamic: !0, - providerMetadata: _[e.tool_use_id].providerMetadata - }); - return; - default: throw Error(`Unsupported content block type: ${t}`); - } - } - case `content_block_stop`: - if (g[r.index] != null) { - let e = g[r.index]; - switch (e.type) { - case `text`: - n.enqueue({ - type: `text-end`, - id: String(r.index) - }); - break; - case `reasoning`: - n.enqueue({ - type: `reasoning-end`, - id: String(r.index) - }); - break; - case `tool-call`: - if (!(a && e.toolName === `json`)) { - n.enqueue({ - type: `tool-input-end`, - id: e.toolCallId - }); - let t = e.input === `` ? `{}` : e.input; - if (e.providerToolName === `code_execution`) try { - let e = JSON.parse(t); - typeof e == `object` && e && `code` in e && !(`type` in e) && (t = JSON.stringify({ - type: `programmatic-tool-call`, - ...e - })); - } catch {} - n.enqueue({ - type: `tool-call`, - toolCallId: e.toolCallId, - toolName: e.toolName, - input: t, - providerExecuted: e.providerExecuted, - ...u && e.providerToolName === `code_execution` ? { dynamic: !0 } : {}, - ...e.caller && { providerMetadata: { anthropic: { caller: e.caller } } } - }); - } - break; - } - delete g[r.index]; - } - T = void 0; - return; - case `content_block_delta`: { - let e = r.delta.type; - switch (e) { - case `text_delta`: - if (a) return; - n.enqueue({ - type: `text-delta`, - id: String(r.index), - delta: r.delta.text - }); - return; - case `thinking_delta`: - n.enqueue({ - type: `reasoning-delta`, - id: String(r.index), - delta: r.delta.thinking - }); - return; - case `signature_delta`: - T === `thinking` && n.enqueue({ - type: `reasoning-delta`, - id: String(r.index), - delta: ``, - providerMetadata: { anthropic: { signature: r.delta.signature } } - }); - return; - case `compaction_delta`: - r.delta.content != null && n.enqueue({ - type: `text-delta`, - id: String(r.index), - delta: r.delta.content - }); - return; - case `input_json_delta`: { - let e = g[r.index], t = r.delta.partial_json; - if (t.length === 0) return; - if (w) { - if (e?.type !== `text`) return; - n.enqueue({ - type: `text-delta`, - id: String(r.index), - delta: t - }); - } else { - if (e?.type !== `tool-call`) return; - e.firstDelta && e.providerToolName === `code_execution` && (t = `{"type": "programmatic-tool-call",${t.substring(1)}`), n.enqueue({ - type: `tool-input-delta`, - id: e.toolCallId, - delta: t - }), e.input += t, e.firstDelta = !1; - } - return; - } - case `citations_delta`: { - let e = r.delta.citation, t = ot$4(e, l, E); - t && n.enqueue(t); - return; - } - default: throw Error(`Unsupported delta type: ${e}`); - } - } - case `message_start`: - if (h.input_tokens = r.message.usage.input_tokens, h.cache_read_input_tokens = r.message.usage.cache_read_input_tokens ?? 0, h.cache_creation_input_tokens = r.message.usage.cache_creation_input_tokens ?? 0, b = { ...r.message.usage }, r.message.container != null && (C = { - expiresAt: r.message.container.expires_at, - id: r.message.container.id, - skills: null - }), r.message.stop_reason != null && (m = { - unified: Ze$4({ - finishReason: r.message.stop_reason, - isJsonResponseFromTool: w - }), - raw: r.message.stop_reason - }), n.enqueue({ - type: `response-metadata`, - id: r.message.id ?? void 0, - modelId: r.message.model ?? void 0 - }), r.message.content != null) for (let e = 0; e < r.message.content.length; e++) { - let t = r.message.content[e]; - if (t.type === `tool_use`) { - let e = t.caller, r = e ? { - type: e.type, - toolId: `tool_id` in e ? e.tool_id : void 0 - } : void 0; - n.enqueue({ - type: `tool-input-start`, - id: t.id, - toolName: t.name - }); - let i = JSON.stringify(t.input ?? {}); - n.enqueue({ - type: `tool-input-delta`, - id: t.id, - delta: i - }), n.enqueue({ - type: `tool-input-end`, - id: t.id - }), n.enqueue({ - type: `tool-call`, - toolCallId: t.id, - toolName: t.name, - input: i, - ...r && { providerMetadata: { anthropic: { caller: r } } } - }); - } - } - return; - case `message_delta`: - r.usage.input_tokens != null && h.input_tokens !== r.usage.input_tokens && (h.input_tokens = r.usage.input_tokens), h.output_tokens = r.usage.output_tokens, r.usage.cache_read_input_tokens != null && (h.cache_read_input_tokens = r.usage.cache_read_input_tokens), r.usage.cache_creation_input_tokens != null && (h.cache_creation_input_tokens = r.usage.cache_creation_input_tokens), r.usage.iterations != null && (h.iterations = r.usage.iterations), m = { - unified: Ze$4({ - finishReason: r.delta.stop_reason, - isJsonResponseFromTool: w - }), - raw: r.delta.stop_reason ?? void 0 - }, x = r.delta.stop_sequence ?? null, S = ft$4(r.delta.stop_details), C = r.delta.container == null ? null : { - expiresAt: r.delta.container.expires_at, - id: r.delta.container.id, - skills: r.delta.container.skills?.map((e) => ({ - type: e.type, - skillId: e.skill_id, - version: e.version - })) ?? null - }, r.context_management && (y = dt$4(r.context_management)), b = { - ...b, - ...r.usage - }; - return; - case `message_stop`: { - let e = { - usage: b ?? null, - stopSequence: x, - ...S == null ? {} : { stopDetails: S }, - iterations: h.iterations ? h.iterations.map((e) => ({ - type: e.type, - ...e.model == null ? {} : { model: e.model }, - inputTokens: e.input_tokens, - outputTokens: e.output_tokens, - ...e.cache_creation_input_tokens ? { cacheCreationInputTokens: e.cache_creation_input_tokens } : {}, - ...e.cache_read_input_tokens ? { cacheReadInputTokens: e.cache_read_input_tokens } : {} - })) : null, - container: C, - contextManagement: y - }, t = { anthropic: e }; - c && s !== `anthropic` && (t[s] = e), n.enqueue({ - type: `finish`, - finishReason: m, - usage: Ne$4({ - usage: h, - rawUsage: b - }), - providerMetadata: t - }); - return; - } - case `error`: - n.enqueue({ - type: `error`, - error: r.error - }); - return; - default: throw Error(`Unsupported chunk type: ${r}`); - } - } - })).tee(), k = D.getReader(); - try { - await k.read(); - let t = await k.read(); - if (t.value?.type === `raw` && (t = await k.read()), t.value?.type === `error`) { - let r = t.value.error; - throw new c$14({ - message: r.message, - url: d, - requestBodyValues: n, - statusCode: r.type === `overloaded_error` ? 529 : 500, - responseHeaders: f, - responseBody: JSON.stringify(r), - isRetryable: r.type === `overloaded_error` - }); - } - } finally { - k.cancel().catch(() => {}), k.releaseLock(); - } - return { - stream: O, - request: { body: n }, - response: { headers: f } - }; - } -}; -function ct$4(e) { - return e.includes(`claude-opus-4-8`) || e.includes(`claude-opus-4-7`) || e.includes(`claude-fable-5`) ? { - maxOutputTokens: 128e3, - supportsStructuredOutput: !0, - supportsAdaptiveThinking: !0, - rejectsSamplingParameters: !0, - supportsXhighEffort: !0, - isKnownModel: !0 - } : e.includes(`claude-sonnet-4-6`) || e.includes(`claude-opus-4-6`) ? { - maxOutputTokens: 128e3, - supportsStructuredOutput: !0, - supportsAdaptiveThinking: !0, - rejectsSamplingParameters: !1, - supportsXhighEffort: !1, - isKnownModel: !0 - } : e.includes(`claude-sonnet-4-5`) || e.includes(`claude-opus-4-5`) || e.includes(`claude-haiku-4-5`) ? { - maxOutputTokens: 64e3, - supportsStructuredOutput: !0, - supportsAdaptiveThinking: !1, - rejectsSamplingParameters: !1, - supportsXhighEffort: !1, - isKnownModel: !0 - } : e.includes(`claude-opus-4-1`) ? { - maxOutputTokens: 32e3, - supportsStructuredOutput: !0, - supportsAdaptiveThinking: !1, - rejectsSamplingParameters: !1, - supportsXhighEffort: !1, - isKnownModel: !0 - } : e.includes(`claude-sonnet-4-`) ? { - maxOutputTokens: 64e3, - supportsStructuredOutput: !1, - supportsAdaptiveThinking: !1, - rejectsSamplingParameters: !1, - supportsXhighEffort: !1, - isKnownModel: !0 - } : e.includes(`claude-opus-4-`) ? { - maxOutputTokens: 32e3, - supportsStructuredOutput: !1, - supportsAdaptiveThinking: !1, - rejectsSamplingParameters: !1, - supportsXhighEffort: !1, - isKnownModel: !0 - } : e.includes(`claude-3-haiku`) ? { - maxOutputTokens: 4096, - supportsStructuredOutput: !1, - supportsAdaptiveThinking: !1, - rejectsSamplingParameters: !1, - supportsXhighEffort: !1, - isKnownModel: !0 - } : { - maxOutputTokens: 4096, - supportsStructuredOutput: !1, - supportsAdaptiveThinking: !1, - rejectsSamplingParameters: !1, - supportsXhighEffort: !1, - isKnownModel: !1 - }; -} -function lt$4(e) { - if (!e) return !1; - let t = !1, n = !1; - for (let r of e) { - if (`type` in r && (r.type === `web_fetch_20260209` || r.type === `web_search_20260209`)) { - t = !0; - continue; - } - if (r.name === `code_execution`) { - n = !0; - break; - } - } - return t && !n; -} -function ut$4({ reasoning: e, supportsAdaptiveThinking: t, supportsXhighEffort: n, maxOutputTokensForModel: r, warnings: i }) { - if (!Il(e)) return; - if (e === `none`) return { thinking: { type: `disabled` } }; - if (t) return { - thinking: { type: `adaptive` }, - effort: Ll({ - reasoning: e, - effortMap: { - minimal: `low`, - low: `low`, - medium: `medium`, - high: `high`, - xhigh: n ? `xhigh` : `max` - }, - warnings: i - }) - }; - let a = zl({ - reasoning: e, - maxOutputTokens: r, - maxReasoningBudget: r, - warnings: i - }); - if (a != null) return { thinking: { - type: `enabled`, - budgetTokens: a - } }; -} -function dt$4(e) { - return e ? { appliedEdits: e.applied_edits.map((e) => { - switch (e.type) { - case `clear_tool_uses_20250919`: return { - type: e.type, - clearedToolUses: e.cleared_tool_uses, - clearedInputTokens: e.cleared_input_tokens - }; - case `clear_thinking_20251015`: return { - type: e.type, - clearedThinkingTurns: e.cleared_thinking_turns, - clearedInputTokens: e.cleared_input_tokens - }; - case `compact_20260112`: return { type: e.type }; - } - }).filter((e) => e !== void 0) } : null; -} -function ft$4(e) { - if (e != null) return { - type: e.type, - ...e.category == null ? {} : { category: e.category }, - ...e.explanation == null ? {} : { explanation: e.explanation }, - ...e.recommended_model == null ? {} : { recommendedModel: e.recommended_model } - }; -} -var pt$4 = fd({ - id: `anthropic.bash_20241022`, - inputSchema: Wu(() => Qu(Co({ - command: Ra$2(), - restart: uo().optional() - }))) -}); -function mt$4(e = {}) { - let { execute: t, ...n } = e; - return pt$4(t === void 0 ? { - ...n, - execute: async ({ command: e }, { abortSignal: t, experimental_sandbox: n }) => { - if (!n) throw Error(`Sandbox session is not available`); - return await n.run({ - command: e, - abortSignal: t - }); - } - } : { - ...n, - ...t === null ? {} : { execute: t } - }); -} -var ht$4 = fd({ - id: `anthropic.bash_20250124`, - inputSchema: Wu(() => Qu(Co({ - command: Ra$2(), - restart: uo().optional() - }))) -}); -function gt$4(e = {}) { - let { execute: t, ...n } = e; - return ht$4(t === void 0 ? { - ...n, - execute: async ({ command: e }, { abortSignal: t, experimental_sandbox: n }) => { - if (!n) throw Error(`Sandbox session is not available`); - return await n.run({ - command: e, - abortSignal: t - }); - } - } : { - ...n, - ...t === null ? {} : { execute: t } - }); -} -var _t$4 = fd({ - id: `anthropic.computer_20241022`, - inputSchema: Wu(() => Qu(Co({ - action: Io([ - `key`, - `type`, - `mouse_move`, - `left_click`, - `left_click_drag`, - `right_click`, - `middle_click`, - `double_click`, - `screenshot`, - `cursor_position` - ]), - coordinate: xo(oo().int()).optional(), - text: Ra$2().optional() - }))) -}); -var vt$4 = fd({ - id: `anthropic.computer_20250124`, - inputSchema: Wu(() => Qu(Co({ - action: Io([ - `key`, - `hold_key`, - `type`, - `cursor_position`, - `mouse_move`, - `left_mouse_down`, - `left_mouse_up`, - `left_click`, - `left_click_drag`, - `right_click`, - `middle_click`, - `double_click`, - `triple_click`, - `scroll`, - `wait`, - `screenshot` - ]), - coordinate: Mo([oo().int(), oo().int()]).optional(), - duration: oo().optional(), - scroll_amount: oo().optional(), - scroll_direction: Io([ - `up`, - `down`, - `left`, - `right` - ]).optional(), - start_coordinate: Mo([oo().int(), oo().int()]).optional(), - text: Ra$2().optional() - }))) -}); -var yt$4 = fd({ - id: `anthropic.computer_20251124`, - inputSchema: Wu(() => Qu(Co({ - action: Io([ - `key`, - `hold_key`, - `type`, - `cursor_position`, - `mouse_move`, - `left_mouse_down`, - `left_mouse_up`, - `left_click`, - `left_click_drag`, - `right_click`, - `middle_click`, - `double_click`, - `triple_click`, - `scroll`, - `wait`, - `screenshot`, - `zoom` - ]), - coordinate: Mo([oo().int(), oo().int()]).optional(), - duration: oo().optional(), - region: Mo([ - oo().int(), - oo().int(), - oo().int(), - oo().int() - ]).optional(), - scroll_amount: oo().optional(), - scroll_direction: Io([ - `up`, - `down`, - `left`, - `right` - ]).optional(), - start_coordinate: Mo([oo().int(), oo().int()]).optional(), - text: Ra$2().optional() - }))) -}); -var bt$4 = fd({ - id: `anthropic.memory_20250818`, - inputSchema: Wu(() => Qu(Oo(`command`, [ - Co({ - command: Ro(`view`), - path: Ra$2(), - view_range: Mo([oo(), oo()]).optional() - }), - Co({ - command: Ro(`create`), - path: Ra$2(), - file_text: Ra$2() - }), - Co({ - command: Ro(`str_replace`), - path: Ra$2(), - old_str: Ra$2(), - new_str: Ra$2() - }), - Co({ - command: Ro(`insert`), - path: Ra$2(), - insert_line: oo(), - insert_text: Ra$2() - }), - Co({ - command: Ro(`delete`), - path: Ra$2() - }), - Co({ - command: Ro(`rename`), - old_path: Ra$2(), - new_path: Ra$2() - }) - ]))) -}); -var xt$4 = fd({ - id: `anthropic.text_editor_20241022`, - inputSchema: Wu(() => Qu(Co({ - command: Io([ - `view`, - `create`, - `str_replace`, - `insert`, - `undo_edit` - ]), - path: Ra$2(), - file_text: Ra$2().optional(), - insert_line: oo().int().optional(), - new_str: Ra$2().optional(), - insert_text: Ra$2().optional(), - old_str: Ra$2().optional(), - view_range: xo(oo().int()).optional() - }))) -}); -var St$4 = fd({ - id: `anthropic.text_editor_20250124`, - inputSchema: Wu(() => Qu(Co({ - command: Io([ - `view`, - `create`, - `str_replace`, - `insert`, - `undo_edit` - ]), - path: Ra$2(), - file_text: Ra$2().optional(), - insert_line: oo().int().optional(), - new_str: Ra$2().optional(), - insert_text: Ra$2().optional(), - old_str: Ra$2().optional(), - view_range: xo(oo().int()).optional() - }))) -}); -var Ct$4 = fd({ - id: `anthropic.text_editor_20250429`, - inputSchema: Wu(() => Qu(Co({ - command: Io([ - `view`, - `create`, - `str_replace`, - `insert` - ]), - path: Ra$2(), - file_text: Ra$2().optional(), - insert_line: oo().int().optional(), - new_str: Ra$2().optional(), - insert_text: Ra$2().optional(), - old_str: Ra$2().optional(), - view_range: xo(oo().int()).optional() - }))) -}); -var wt$4 = Wu(() => Qu(xo(Co({ - type: Ro(`tool_reference`), - toolName: Ra$2() -})))); -var Tt$4 = md({ - id: `anthropic.tool_search_bm25_20251119`, - inputSchema: Wu(() => Qu(Co({ - query: Ra$2(), - limit: oo().optional() - }))), - outputSchema: wt$4, - supportsDeferredResults: !0 -}); -var Et$4 = { - advisor_20260301: fe$4, - bash_20241022: mt$4, - bash_20250124: gt$4, - codeExecution_20250522: Ie$4, - codeExecution_20250825: ze$4, - codeExecution_20260120: He$4, - computer_20241022: _t$4, - computer_20250124: vt$4, - computer_20251124: yt$4, - memory_20250818: bt$4, - textEditor_20241022: xt$4, - textEditor_20250124: St$4, - textEditor_20250429: Ct$4, - textEditor_20250728: he$4, - webFetch_20250910: je$4, - webFetch_20260209: De$4, - webSearch_20250305: Ce$4, - webSearch_20260209: ye$4, - toolSearchRegex_20251119: Ge$4, - toolSearchBm25_20251119: (e = {}) => Tt$4(e) -}; -var Dt$4 = Wu(() => Qu(Co({ - id: Ra$2(), - display_title: Ra$2().nullish(), - name: Ra$2().nullish(), - description: Ra$2().nullish(), - latest_version: Ra$2().nullish(), - source: Ra$2(), - created_at: Ra$2(), - updated_at: Ra$2() -}))); -var Ot$4 = Wu(() => Qu(Co({ - type: Ra$2(), - skill_id: Ra$2(), - name: Ra$2().nullish(), - description: Ra$2().nullish() -}))); -var kt$4 = class { - constructor(e) { - this.config = e, this.specificationVersion = `v4`; - } - get provider() { - return this.config.provider; - } - async getHeaders() { - return Pc(await hd(this.config.headers), { "anthropic-beta": `skills-2025-10-02` }); - } - async fetchVersionMetadata({ skillId: e, version: t, headers: n }) { - let { value: r } = await jl({ - url: `${this.config.baseURL}/skills/${e}/versions/${t}`, - headers: n, - failedResponseHandler: Y$5, - successfulResponseHandler: bd(Ot$4), - fetch: this.config.fetch - }); - return { - ...r.name == null ? {} : { name: r.name }, - ...r.description == null ? {} : { description: r.description } - }; - } - async uploadSkill(e) { - let t = [], n = new FormData(); - e.displayTitle != null && n.append(`display_title`, e.displayTitle); - for (let t of e.files) { - let e = Bc(t.data); - n.append(`files[]`, new Blob([e]), t.path); - } - let r = await this.getHeaders(), { value: i } = await cd({ - url: `${this.config.baseURL}/skills`, - headers: r, - formData: n, - failedResponseHandler: Y$5, - successfulResponseHandler: bd(Dt$4), - fetch: this.config.fetch - }), a = i.latest_version == null ? {} : await this.fetchVersionMetadata({ - skillId: i.id, - version: i.latest_version, - headers: r - }), o = a.name ?? i.name, s = a.description ?? i.description; - return { - providerReference: { anthropic: i.id }, - ...i.display_title == null ? {} : { displayTitle: i.display_title }, - ...o == null ? {} : { name: o }, - ...s == null ? {} : { description: s }, - ...i.latest_version == null ? {} : { latestVersion: i.latest_version }, - providerMetadata: { anthropic: { - ...i.source == null ? {} : { source: i.source }, - ...i.created_at == null ? {} : { createdAt: i.created_at }, - ...i.updated_at == null ? {} : { updatedAt: i.updated_at } - } }, - warnings: t - }; - } -}; -var At$4 = `4.0.0`; -function jt$4(e = {}) { - let r = Ed(Fl({ - settingValue: e.baseURL, - environmentVariableName: `ANTHROPIC_BASE_URL` - })) ?? `https://api.anthropic.com/v1`, i = e.name ?? `anthropic.messages`; - if (e.apiKey && e.authToken) throw new ae$10({ - argument: `apiKey/authToken`, - message: `Both apiKey and authToken were provided. Please use only one authentication method.` - }); - let a = () => Ol({ - "anthropic-version": `2023-06-01`, - ...e.authToken ? { Authorization: `Bearer ${e.authToken}` } : { "x-api-key": Pl({ - apiKey: e.apiKey, - environmentVariableName: `ANTHROPIC_API_KEY`, - description: `Anthropic` - }) }, - ...e.headers - }, `ai-sdk/anthropic/${At$4}`), o = (t) => new st$4(t, { - provider: i, - baseURL: r, - headers: a, - fetch: e.fetch, - generateId: e.generateId ?? bl, - supportedUrls: () => ({ - "image/*": [/^https?:\/\/.*$/], - "application/pdf": [/^https?:\/\/.*$/] - }) - }), s = () => new kt$4({ - provider: `${i.replace(`.messages`, ``)}.skills`, - baseURL: r, - headers: a, - fetch: e.fetch - }), c = function(e) { - if (new.target) throw Error(`The Anthropic model function cannot be called with the new keyword.`); - return o(e); - }; - return c.specificationVersion = `v4`, c.languageModel = o, c.chat = o, c.messages = o, c.embeddingModel = (e) => { - throw new be$10({ - modelId: e, - modelType: `embeddingModel` - }); - }, c.textEmbeddingModel = c.embeddingModel, c.imageModel = (e) => { - throw new be$10({ - modelId: e, - modelType: `imageModel` - }); - }, c.files = () => new ne$3({ - provider: i, - baseURL: r, - headers: a, - fetch: e.fetch - }), c.skills = s, c.tools = Et$4, c; -} -var Mt$4 = jt$4(); -//#endregion -//#region node_modules/eve/dist/src/compiled/@ai-sdk/google/index.js -var google_exports = /* @__PURE__ */ __exportAll({ - Experimental_GoogleRealtimeModel: () => yn$3, - VERSION: () => ae$3, - createGoogle: () => $$4, - createGoogleGenerativeAI: () => $$4, - google: () => bn$3 -}); -var ae$3 = `4.0.0`; -var H$3 = vd({ - errorSchema: Wu(() => Qu(Co({ error: Co({ - code: oo().nullable(), - message: Ra$2(), - status: Ra$2() - }) }))), - errorToMessage: (e) => e.error.message -}); -var oe$2 = Eo([ - Co({ text: Ra$2() }), - Co({ inlineData: Co({ - mimeType: Ra$2(), - data: Ra$2() - }) }), - Co({ fileData: Co({ - fileUri: Ra$2(), - mimeType: Ra$2() - }) }) -]); -var se$3 = Wu(() => Qu(Co({ - outputDimensionality: oo().optional(), - taskType: Io([ - `SEMANTIC_SIMILARITY`, - `CLASSIFICATION`, - `CLUSTERING`, - `RETRIEVAL_DOCUMENT`, - `RETRIEVAL_QUERY`, - `QUESTION_ANSWERING`, - `FACT_VERIFICATION`, - `CODE_RETRIEVAL_QUERY` - ]).optional(), - content: xo(xo(oe$2).min(1).nullable()).optional() -}))); -var ce$3 = class e { - constructor(e, t) { - this.specificationVersion = `v4`, this.maxEmbeddingsPerCall = 2048, this.supportsParallelCalls = !0, this.modelId = e, this.config = t; - } - static [Mc](e) { - return Cd({ - modelId: e.modelId, - config: e.config - }); - } - static [Nc](t) { - return new e(t.modelId, t.config); - } - get provider() { - return this.config.provider; - } - async doEmbed({ values: e, headers: n, abortSignal: r, providerOptions: a }) { - let o = await ad({ - provider: `google`, - providerOptions: a, - schema: se$3 - }); - if (e.length > this.maxEmbeddingsPerCall) throw new Te$10({ - provider: this.provider, - modelId: this.modelId, - maxEmbeddingsPerCall: this.maxEmbeddingsPerCall, - values: e - }); - let s = Pc(this.config.headers ? await hd(this.config.headers) : void 0, n), c = o?.content; - if (c != null && c.length !== e.length) throw Error(`The number of multimodal content entries (${c.length}) must match the number of values (${e.length}).`); - if (e.length === 1) { - let t = c?.[0], n = e[0] ? [{ text: e[0] }] : [], i = t == null ? [{ text: e[0] }] : [...n, ...t], { responseHeaders: a, value: l, rawValue: u } = await sd({ - url: `${this.config.baseURL}/models/${this.modelId}:embedContent`, - headers: s, - body: { - model: `models/${this.modelId}`, - content: { parts: i }, - outputDimensionality: o?.outputDimensionality, - taskType: o?.taskType - }, - failedResponseHandler: H$3, - successfulResponseHandler: bd(ue$3), - abortSignal: r, - fetch: this.config.fetch - }); - return { - warnings: [], - embeddings: [l.embedding.values], - usage: void 0, - response: { - headers: a, - body: u - } - }; - } - let { responseHeaders: l, value: d, rawValue: f } = await sd({ - url: `${this.config.baseURL}/models/${this.modelId}:batchEmbedContents`, - headers: s, - body: { requests: e.map((e, t) => { - let n = c?.[t], r = e ? [{ text: e }] : []; - return { - model: `models/${this.modelId}`, - content: { - role: `user`, - parts: n == null ? [{ text: e }] : [...r, ...n] - }, - outputDimensionality: o?.outputDimensionality, - taskType: o?.taskType - }; - }) }, - failedResponseHandler: H$3, - successfulResponseHandler: bd(le$3), - abortSignal: r, - fetch: this.config.fetch - }); - return { - warnings: [], - embeddings: d.embeddings.map((e) => e.values), - usage: void 0, - response: { - headers: l, - body: f - } - }; - } -}; -var le$3 = Wu(() => Qu(Co({ embeddings: xo(Co({ values: xo(oo()) })) }))); -var ue$3 = Wu(() => Qu(Co({ embedding: Co({ values: xo(oo()) }) }))); -function de$3(e) { - if (e == null) return { - inputTokens: { - total: void 0, - noCache: void 0, - cacheRead: void 0, - cacheWrite: void 0 - }, - outputTokens: { - total: void 0, - text: void 0, - reasoning: void 0 - }, - raw: void 0 - }; - let t = e.promptTokenCount ?? 0, n = e.candidatesTokenCount ?? 0, r = e.cachedContentTokenCount ?? 0, i = e.thoughtsTokenCount ?? 0; - return { - inputTokens: { - total: t, - noCache: t - r, - cacheRead: r, - cacheWrite: void 0 - }, - outputTokens: { - total: n + i, - text: n, - reasoning: i - }, - raw: e - }; -} -function U$3(e, t = !0) { - if (e == null) return; - if (fe$3(e)) return t ? void 0 : typeof e == `object` && e.description ? { - type: `object`, - description: e.description - } : { type: `object` }; - if (typeof e == `boolean`) return { - type: `boolean`, - properties: {} - }; - let { type: n, description: r, required: i, properties: a, items: o, allOf: s, anyOf: c, oneOf: l, format: u, const: d, minLength: f, enum: p } = e, m = {}; - if (r && (m.description = r), i && (m.required = i), u && (m.format = u), d !== void 0 && (m.enum = [d]), n) if (Array.isArray(n)) { - let e = n.includes(`null`), t = n.filter((e) => e !== `null`); - t.length === 0 ? m.type = `null` : (m.anyOf = t.map((e) => ({ type: e })), e && (m.nullable = !0)); - } else m.type = n; - if (p !== void 0 && (m.enum = p), a != null && (m.properties = Object.entries(a).reduce((e, [t, n]) => (e[t] = U$3(n, !1), e), {})), o && (m.items = Array.isArray(o) ? o.map((e) => U$3(e, !1)) : U$3(o, !1)), s && (m.allOf = s.map((e) => U$3(e, !1))), c) if (c.some((e) => typeof e == `object` && e?.type === `null`)) { - let e = c.filter((e) => !(typeof e == `object` && e?.type === `null`)); - if (e.length === 1) { - let t = U$3(e[0], !1); - typeof t == `object` && (m.nullable = !0, Object.assign(m, t)); - } else m.anyOf = e.map((e) => U$3(e, !1)), m.nullable = !0; - } else m.anyOf = c.map((e) => U$3(e, !1)); - return l && (m.oneOf = l.map((e) => U$3(e, !1))), f !== void 0 && (m.minLength = f), m; -} -function fe$3(e) { - return typeof e == `object` && !!e && e.type === `object` && (e.properties == null || Object.keys(e.properties).length === 0) && !e.additionalProperties; -} -var pe$3 = `skip_thought_signature_validator`; -var me$3 = /^data:([^;,]+);base64,(.+)$/s; -function he$3(e) { - let t = me$3.exec(e); - if (t != null) return { - mediaType: t[1], - data: t[2] - }; -} -function ge$3(e) { - let t = he$3(e); - if (t != null) return { inlineData: { - mimeType: t.mediaType, - data: t.data - } }; -} -function _e$3(e, t, n, r) { - let i = [], a = []; - for (let e of n) switch (e.type) { - case `text`: - a.push(e.text); - break; - case `file`: - if (e.data.type === `data`) i.push({ inlineData: { - mimeType: gd({ part: e }), - data: zc(e.data.data) - } }); - else if (e.data.type === `url`) { - let t = ge$3(e.data.url.toString()); - t == null ? a.push(JSON.stringify(e)) : i.push(t); - } else a.push(JSON.stringify(e)); - break; - default: - a.push(JSON.stringify(e)); - break; - } - e.push({ functionResponse: { - ...r == null ? {} : { id: r }, - name: t, - response: { - name: t, - content: a.length > 0 ? a.join(` -`) : `Tool executed successfully.` - }, - ...i.length > 0 ? { parts: i } : {} - } }); -} -function ve$3(e, t, n, r) { - for (let i of n) switch (i.type) { - case `text`: - e.push({ functionResponse: { - ...r == null ? {} : { id: r }, - name: t, - response: { - name: t, - content: i.text - } - } }); - break; - case `file`: - i.data.type === `data` && el(i.mediaType) === `image` ? e.push({ inlineData: { - mimeType: gd({ part: i }), - data: zc(i.data.data) - } }, { text: `Tool executed successfully and returned this image as a response` }) : e.push({ text: JSON.stringify(i) }); - break; - default: - e.push({ text: JSON.stringify(i) }); - break; - } -} -function ye$3(e, t) { - let r = [], i = [], a = !0, s = t?.isGemmaModel ?? !1, l = t?.isGemini3Model ?? !1, u = t?.onWarning, d = t?.providerOptionsNames ?? [`google`], f = !d.includes(`google`), p = t?.supportsFunctionResponseParts ?? !0, m = !1, h = [], g = (e) => (h.push(e), m = !0, pe$3), _ = (e) => { - for (let t of d) { - let n = e.providerOptions?.[t]; - if (n != null) return n; - } - return f ? e.providerOptions?.google : e.providerOptions?.googleVertex ?? e.providerOptions?.vertex; - }; - for (let { role: t, content: s } of e) switch (t) { - case `system`: - if (!a) throw new Ie$10({ functionality: `system messages are only supported at the beginning of the conversation` }); - r.push({ text: s }); - break; - case `user`: { - a = !1; - let e = []; - for (let t of s) switch (t.type) { - case `text`: - e.push({ text: t.text }); - break; - case `file`: - switch (t.data.type) { - case `url`: - e.push({ fileData: { - mimeType: gd({ part: t }), - fileUri: t.data.url.toString() - } }); - break; - case `reference`: - if (f) throw new Ie$10({ functionality: `file parts with provider references` }); - e.push({ fileData: { - mimeType: gd({ part: t }), - fileUri: _d({ - reference: t.data.reference, - provider: `google` - }) - } }); - break; - case `text`: - e.push({ inlineData: { - mimeType: tl(t.mediaType) ? t.mediaType : `text/plain`, - data: zc(new TextEncoder().encode(t.data.text)) - } }); - break; - case `data`: - e.push({ inlineData: { - mimeType: gd({ part: t }), - data: zc(t.data.data) - } }); - break; - } - break; - } - i.push({ - role: `user`, - parts: e - }); - break; - } - case `assistant`: - a = !1, i.push({ - role: `model`, - parts: s.map((e) => { - let t = _(e), r = t?.thoughtSignature == null ? void 0 : String(t.thoughtSignature); - switch (e.type) { - case `text`: return e.text.length === 0 ? void 0 : { - text: e.text, - thoughtSignature: r - }; - case `reasoning`: return e.text.length === 0 ? void 0 : { - text: e.text, - thought: !0, - thoughtSignature: r - }; - case `reasoning-file`: - switch (e.data.type) { - case `url`: throw new Ie$10({ functionality: `File data URLs in assistant messages are not supported` }); - case `data`: return { - inlineData: { - mimeType: e.mediaType, - data: zc(e.data.data) - }, - thought: !0, - thoughtSignature: r - }; - } - break; - case `file`: - switch (e.data.type) { - case `url`: throw new Ie$10({ functionality: `File data URLs in assistant messages are not supported` }); - case `reference`: - if (f) throw new Ie$10({ functionality: `file parts with provider references` }); - return { - fileData: { - mimeType: e.mediaType, - fileUri: _d({ - reference: e.data.reference, - provider: `google` - }) - }, - ...t?.thought === !0 ? { thought: !0 } : {}, - thoughtSignature: r - }; - case `text`: return { - inlineData: { - mimeType: tl(e.mediaType) ? e.mediaType : `text/plain`, - data: zc(new TextEncoder().encode(e.data.text)) - }, - ...t?.thought === !0 ? { thought: !0 } : {}, - thoughtSignature: r - }; - case `data`: return { - inlineData: { - mimeType: e.mediaType, - data: zc(e.data.data) - }, - ...t?.thought === !0 ? { thought: !0 } : {}, - thoughtSignature: r - }; - } - break; - case `tool-call`: { - let n = t?.serverToolCallId == null ? void 0 : String(t.serverToolCallId), i = t?.serverToolType == null ? void 0 : String(t.serverToolType), a = r ?? (l ? g(e.toolName) : void 0); - return n && i ? { - toolCall: { - toolType: i, - args: typeof e.input == `string` ? JSON.parse(e.input) : e.input, - id: n - }, - thoughtSignature: a - } : { - functionCall: { - ...e.toolCallId == null ? {} : { id: e.toolCallId }, - name: e.toolName, - args: e.input - }, - thoughtSignature: a - }; - } - case `tool-result`: { - let n = t?.serverToolCallId == null ? void 0 : String(t.serverToolCallId), i = t?.serverToolType == null ? void 0 : String(t.serverToolType); - return n && i ? { - toolResponse: { - toolType: i, - response: e.output.type === `json` ? e.output.value : {}, - id: n - }, - thoughtSignature: r - } : void 0; - } - } - }).filter((e) => e !== void 0) - }); - break; - case `tool`: { - a = !1; - let e = []; - for (let t of s) { - if (t.type === `tool-approval-response`) continue; - let n = _(t), r = n?.serverToolCallId == null ? void 0 : String(n.serverToolCallId), a = n?.serverToolType == null ? void 0 : String(n.serverToolType); - if (r && a) { - let e = n?.thoughtSignature == null ? void 0 : String(n.thoughtSignature); - if (i.length > 0) { - let n = i[i.length - 1]; - if (n.role === `model`) { - n.parts.push({ - toolResponse: { - toolType: a, - response: t.output.type === `json` ? t.output.value : {}, - id: r - }, - thoughtSignature: e - }); - continue; - } - } - } - let o = t.output; - o.type === `content` ? p ? _e$3(e, t.toolName, o.value, t.toolCallId) : ve$3(e, t.toolName, o.value, t.toolCallId) : e.push({ functionResponse: { - ...t.toolCallId == null ? {} : { id: t.toolCallId }, - name: t.toolName, - response: { - name: t.toolName, - content: o.type === `execution-denied` ? o.reason ?? `Tool call execution denied.` : o.value - } - } }); - } - i.push({ - role: `user`, - parts: e - }); - break; - } - } - if (s && r.length > 0 && i.length > 0 && i[0].role === `user`) { - let e = r.map((e) => e.text).join(` - -`); - i[0].parts.unshift({ text: e + ` - -` }); - } - if (m && u != null) { - let e = Array.from(new Set(h)); - u({ - type: `other`, - message: `Replayed ${h.length} \`functionCall\` part(s) for a Gemini 3 model without a \`thoughtSignature\` (tools: ${e.map((e) => `\`${e}\``).join(`, `)}). Injected the documented \`skip_thought_signature_validator\` sentinel to keep the request from failing with HTTP 400. The likely cause is application code that drops \`providerOptions.google.thoughtSignature\` when persisting or serializing assistant tool-call messages. See https://ai.google.dev/gemini-api/docs/thought-signatures.` - }); - } - return { - systemInstruction: r.length > 0 && !s ? { parts: r } : void 0, - contents: i - }; -} -function be$3(e) { - return e.includes(`/`) ? e : `models/${e}`; -} -var xe$3 = Wu(() => Qu(Co({ - responseModalities: xo(Io([`TEXT`, `IMAGE`])).optional(), - thinkingConfig: Co({ - thinkingBudget: oo().optional(), - includeThoughts: uo().optional(), - thinkingLevel: Io([ - `minimal`, - `low`, - `medium`, - `high` - ]).optional() - }).optional(), - cachedContent: Ra$2().optional(), - structuredOutputs: uo().optional(), - safetySettings: xo(Co({ - category: Io([ - `HARM_CATEGORY_UNSPECIFIED`, - `HARM_CATEGORY_HATE_SPEECH`, - `HARM_CATEGORY_DANGEROUS_CONTENT`, - `HARM_CATEGORY_HARASSMENT`, - `HARM_CATEGORY_SEXUALLY_EXPLICIT`, - `HARM_CATEGORY_CIVIC_INTEGRITY` - ]), - threshold: Io([ - `HARM_BLOCK_THRESHOLD_UNSPECIFIED`, - `BLOCK_LOW_AND_ABOVE`, - `BLOCK_MEDIUM_AND_ABOVE`, - `BLOCK_ONLY_HIGH`, - `BLOCK_NONE`, - `OFF` - ]) - })).optional(), - threshold: Io([ - `HARM_BLOCK_THRESHOLD_UNSPECIFIED`, - `BLOCK_LOW_AND_ABOVE`, - `BLOCK_MEDIUM_AND_ABOVE`, - `BLOCK_ONLY_HIGH`, - `BLOCK_NONE`, - `OFF` - ]).optional(), - audioTimestamp: uo().optional(), - labels: Po(Ra$2(), Ra$2()).optional(), - mediaResolution: Io([ - `MEDIA_RESOLUTION_UNSPECIFIED`, - `MEDIA_RESOLUTION_LOW`, - `MEDIA_RESOLUTION_MEDIUM`, - `MEDIA_RESOLUTION_HIGH` - ]).optional(), - imageConfig: Co({ - aspectRatio: Io([ - `1:1`, - `2:3`, - `3:2`, - `3:4`, - `4:3`, - `4:5`, - `5:4`, - `9:16`, - `16:9`, - `21:9`, - `1:8`, - `8:1`, - `1:4`, - `4:1` - ]).optional(), - imageSize: Io([ - `1K`, - `2K`, - `4K`, - `512` - ]).optional() - }).optional(), - retrievalConfig: Co({ latLng: Co({ - latitude: oo(), - longitude: oo() - }).optional() }).optional(), - streamFunctionCallArguments: uo().optional(), - serviceTier: Io([ - `standard`, - `flex`, - `priority` - ]).optional(), - sharedRequestType: Io([ - `priority`, - `flex`, - `standard` - ]).optional(), - requestType: Io([`shared`]).optional() -}))); -function Se$3({ tools: e, toolChoice: t, modelId: r, isVertexProvider: i = !1 }) { - e = e?.length ? e : void 0; - let a = [], o = [ - `gemini-flash-latest`, - `gemini-flash-lite-latest`, - `gemini-pro-latest` - ].some((e) => e === r), s = r.includes(`gemini-2`) || r.includes(`gemini-3`) || r.includes(`nano-banana`) || o, c = r.includes(`gemini-3`), l = r.includes(`gemini-2.5`) || r.includes(`gemini-3`); - if (e == null) return { - tools: void 0, - toolConfig: void 0, - toolWarnings: a - }; - let u = e.some((e) => e.type === `function`), d = e.some((e) => e.type === `provider`); - if (u && d && !c && a.push({ - type: `unsupported`, - feature: `combination of function and provider-defined tools` - }), d) { - let n = []; - if (e.filter((e) => e.type === `provider`).forEach((e) => { - switch (e.id) { - case `google.google_search`: - s ? n.push({ googleSearch: { ...e.args } }) : a.push({ - type: `unsupported`, - feature: `provider-defined tool ${e.id}`, - details: `Google Search requires Gemini 2.0 or newer.` - }); - break; - case `google.enterprise_web_search`: - s ? n.push({ enterpriseWebSearch: {} }) : a.push({ - type: `unsupported`, - feature: `provider-defined tool ${e.id}`, - details: `Enterprise Web Search requires Gemini 2.0 or newer.` - }); - break; - case `google.url_context`: - s ? n.push({ urlContext: {} }) : a.push({ - type: `unsupported`, - feature: `provider-defined tool ${e.id}`, - details: `The URL context tool is not supported with other Gemini models than Gemini 2.` - }); - break; - case `google.code_execution`: - s ? n.push({ codeExecution: {} }) : a.push({ - type: `unsupported`, - feature: `provider-defined tool ${e.id}`, - details: `The code execution tool is not supported with other Gemini models than Gemini 2.` - }); - break; - case `google.file_search`: - l ? n.push({ fileSearch: { ...e.args } }) : a.push({ - type: `unsupported`, - feature: `provider-defined tool ${e.id}`, - details: `The file search tool is only supported with Gemini 2.5 models and Gemini 3 models.` - }); - break; - case `google.vertex_rag_store`: - s ? n.push({ retrieval: { vertex_rag_store: { - rag_resources: { rag_corpus: e.args.ragCorpus }, - similarity_top_k: e.args.topK - } } }) : a.push({ - type: `unsupported`, - feature: `provider-defined tool ${e.id}`, - details: `The RAG store tool is not supported with other Gemini models than Gemini 2.` - }); - break; - case `google.google_maps`: - s ? n.push({ googleMaps: {} }) : a.push({ - type: `unsupported`, - feature: `provider-defined tool ${e.id}`, - details: `The Google Maps grounding tool is not supported with Gemini models other than Gemini 2 or newer.` - }); - break; - default: - a.push({ - type: `unsupported`, - feature: `provider-defined tool ${e.id}` - }); - break; - } - }), u && c && n.length > 0) { - let r = []; - for (let t of e) t.type === `function` && r.push({ - name: t.name, - description: t.description ?? ``, - parameters: U$3(t.inputSchema) - }); - let o = { - functionCallingConfig: { mode: `VALIDATED` }, - ...!i && { includeServerSideToolInvocations: !0 } - }; - if (t != null) switch (t.type) { - case `auto`: break; - case `none`: - o.functionCallingConfig = { mode: `NONE` }; - break; - case `required`: - o.functionCallingConfig = { mode: `ANY` }; - break; - case `tool`: - o.functionCallingConfig = { - mode: `ANY`, - allowedFunctionNames: [t.toolName] - }; - break; - } - return { - tools: [...n, { functionDeclarations: r }], - toolConfig: o, - toolWarnings: a - }; - } - return { - tools: n.length > 0 ? n : void 0, - toolConfig: void 0, - toolWarnings: a - }; - } - let f = [], p = !1; - for (let t of e) switch (t.type) { - case `function`: - f.push({ - name: t.name, - description: t.description ?? ``, - parameters: U$3(t.inputSchema) - }), t.strict === !0 && (p = !0); - break; - default: - a.push({ - type: `unsupported`, - feature: `function tool ${t.name}` - }); - break; - } - if (t == null) return { - tools: [{ functionDeclarations: f }], - toolConfig: p ? { functionCallingConfig: { mode: `VALIDATED` } } : void 0, - toolWarnings: a - }; - let m = t.type; - switch (m) { - case `auto`: return { - tools: [{ functionDeclarations: f }], - toolConfig: { functionCallingConfig: { mode: p ? `VALIDATED` : `AUTO` } }, - toolWarnings: a - }; - case `none`: return { - tools: [{ functionDeclarations: f }], - toolConfig: { functionCallingConfig: { mode: `NONE` } }, - toolWarnings: a - }; - case `required`: return { - tools: [{ functionDeclarations: f }], - toolConfig: { functionCallingConfig: { mode: p ? `VALIDATED` : `ANY` } }, - toolWarnings: a - }; - case `tool`: return { - tools: [{ functionDeclarations: f }], - toolConfig: { functionCallingConfig: { - mode: p ? `VALIDATED` : `ANY`, - allowedFunctionNames: [t.toolName] - } }, - toolWarnings: a - }; - default: throw new Ie$10({ functionality: `tool choice type: ${m}` }); - } -} -var Ce$3 = class { - constructor() { - this.accumulatedArgs = {}, this.jsonText = ``, this.pathStack = [], this.stringOpen = !1; - } - processPartialArgs(e) { - let t = ``; - for (let n of e) { - let e = n.jsonPath.replace(/^\$\./, ``); - if (!e) continue; - let r = we$3(e), i = Oe$3(this.accumulatedArgs, r); - if (n.stringValue != null && i !== void 0) { - let e = JSON.stringify(n.stringValue).slice(1, -1); - ke$3(this.accumulatedArgs, r, i + n.stringValue), t += e; - continue; - } - let a = Ae$3(n); - a != null && (ke$3(this.accumulatedArgs, r, a.value), t += this.emitNavigationTo(r, n, a.json)); - } - return this.jsonText += t, { - currentJSON: this.accumulatedArgs, - textDelta: t - }; - } - finalize() { - let e = JSON.stringify(this.accumulatedArgs); - return { - finalJSON: e, - closingDelta: e.slice(this.jsonText.length) - }; - } - ensureRoot() { - return this.pathStack.length === 0 ? (this.pathStack.push({ - segment: ``, - isArray: !1, - childCount: 0 - }), `{`) : ``; - } - emitNavigationTo(e, t, n) { - let r = ``; - this.stringOpen &&= (r += `"`, !1), r += this.ensureRoot(); - let i = e.slice(0, -1), a = e[e.length - 1], o = this.findCommonStackDepth(i); - return r += this.closeDownTo(o), r += this.openDownTo(i, a), r += this.emitLeaf(a, t, n), r; - } - findCommonStackDepth(e) { - let t = Math.min(this.pathStack.length - 1, e.length), n = 0; - for (let r = 0; r < t && this.pathStack[r + 1].segment === e[r]; r++) n++; - return n + 1; - } - closeDownTo(e) { - let t = ``; - for (; this.pathStack.length > e;) { - let e = this.pathStack.pop(); - t += e.isArray ? `]` : `}`; - } - return t; - } - openDownTo(e, t) { - let n = ``, r = this.pathStack.length - 1; - for (let i = r; i < e.length; i++) { - let r = e[i], a = this.pathStack[this.pathStack.length - 1]; - a.childCount > 0 && (n += `,`), a.childCount++, typeof r == `string` && (n += `${JSON.stringify(r)}:`); - let o = typeof (i + 1 < e.length ? e[i + 1] : t) == `number`; - n += o ? `[` : `{`, this.pathStack.push({ - segment: r, - isArray: o, - childCount: 0 - }); - } - return n; - } - emitLeaf(e, t, n) { - let r = ``, i = this.pathStack[this.pathStack.length - 1]; - return i.childCount > 0 && (r += `,`), i.childCount++, typeof e == `string` && (r += `${JSON.stringify(e)}:`), t.stringValue != null && t.willContinue ? (r += n.slice(0, -1), this.stringOpen = !0) : r += n, r; - } -}; -function we$3(e) { - let t = []; - for (let n of e.split(`.`)) { - let e = n.indexOf(`[`); - if (e === -1) t.push(n); - else { - e > 0 && t.push(n.slice(0, e)); - for (let e of n.matchAll(/\[(\d+)\]/g)) t.push(parseInt(e[1], 10)); - } - } - return t; -} -var Te$3 = Object.prototype.hasOwnProperty; -function Ee$3(e, t) { - return Te$3.call(e, t); -} -function De$3(e, t, n) { - Object.defineProperty(e, t, { - value: n, - enumerable: !0, - configurable: !0, - writable: !0 - }); -} -function Oe$3(e, t) { - let n = e; - for (let e of t) { - if (typeof n != `object` || !n) return; - let t = n; - if (!Ee$3(t, e)) return; - n = t[e]; - } - return n; -} -function ke$3(e, t, n) { - let r = e; - for (let e = 0; e < t.length - 1; e++) { - let n = t[e], i = t[e + 1]; - (!Ee$3(r, n) || r[n] == null) && De$3(r, n, typeof i == `number` ? [] : {}), r = r[n]; - } - De$3(r, t[t.length - 1], n); -} -function Ae$3(e) { - let t = e.stringValue ?? e.numberValue ?? e.boolValue; - if (t != null) return { - value: t, - json: JSON.stringify(t) - }; - if (`nullValue` in e) return { - value: null, - json: `null` - }; -} -function je$3({ finishReason: e, hasToolCalls: t }) { - switch (e) { - case `STOP`: return t ? `tool-calls` : `stop`; - case `MAX_TOKENS`: return `length`; - case `IMAGE_SAFETY`: - case `RECITATION`: - case `SAFETY`: - case `BLOCKLIST`: - case `PROHIBITED_CONTENT`: - case `SPII`: return `content-filter`; - case `MALFORMED_FUNCTION_CALL`: return `error`; - default: return `other`; - } -} -var Me$3 = class e { - constructor(e, t) { - this.specificationVersion = `v4`, this.modelId = e, this.config = t, this.generateId = t.generateId ?? bl; - } - static [Mc](e) { - return Cd({ - modelId: e.modelId, - config: e.config - }); - } - static [Nc](t) { - return new e(t.modelId, t.config); - } - get provider() { - return this.config.provider; - } - get supportedUrls() { - var e; - return (e = this.config).supportedUrls?.call(e) ?? {}; - } - async getArgs({ prompt: e, maxOutputTokens: t, temperature: n, topP: r, topK: i, frequencyPenalty: a, presencePenalty: o, stopSequences: s, responseFormat: c, seed: l, tools: d, toolChoice: f, reasoning: p, providerOptions: m }, { isStreaming: h = !1 } = {}) { - let g = [], _ = this.config.provider.includes(`vertex`) ? [`googleVertex`, `vertex`] : [`google`], v; - for (let e of _) if (v = await ad({ - provider: e, - providerOptions: m, - schema: xe$3 - }), v != null) break; - v == null && !_.includes(`google`) && (v = await ad({ - provider: `google`, - providerOptions: m, - schema: xe$3 - })); - let y = this.config.provider.startsWith(`google.vertex.`); - d?.some((e) => e.type === `provider` && e.id === `google.vertex_rag_store`) && !y && g.push({ - type: `other`, - message: `The 'vertex_rag_store' tool is only supported with the Google Vertex provider and might not be supported or could behave unexpectedly with the current Google provider (${this.config.provider}).` - }), v?.streamFunctionCallArguments && !y && g.push({ - type: `other`, - message: `'streamFunctionCallArguments' is only supported on the Vertex AI API and will be ignored with the current Google provider (${this.config.provider}). See https://docs.cloud.google.com/vertex-ai/generative-ai/docs/multimodal/function-calling#streaming-fc` - }), v?.serviceTier && y && g.push({ - type: `other`, - message: `'serviceTier' is a Gemini API option and is not supported on Vertex AI. Use 'sharedRequestType' (and optionally 'requestType') instead. See https://docs.cloud.google.com/vertex-ai/generative-ai/docs/priority-paygo` - }), (v?.sharedRequestType || v?.requestType) && !y && g.push({ - type: `other`, - message: `'sharedRequestType' and 'requestType' are Vertex AI options and are ignored with the current Google provider (${this.config.provider}).` - }); - let b = y && (v?.sharedRequestType || v?.requestType) ? { - ...v.sharedRequestType && { "X-Vertex-AI-LLM-Shared-Request-Type": v.sharedRequestType }, - ...v.requestType && { "X-Vertex-AI-LLM-Request-Type": v.requestType } - } : void 0, x = y ? void 0 : v?.serviceTier, S = this.modelId.toLowerCase().startsWith(`gemma-`), C = /^gemini-3[.-]/.test(this.modelId), { contents: w, systemInstruction: T } = ye$3(e, { - isGemmaModel: S, - isGemini3Model: C, - onWarning: (e) => g.push(e), - providerOptionsNames: _, - supportsFunctionResponseParts: C - }), { tools: ee, toolConfig: E, toolWarnings: D } = Se$3({ - tools: d, - toolChoice: f, - modelId: this.modelId, - isVertexProvider: y - }), O = Ie$3({ - reasoning: p, - modelId: this.modelId, - warnings: g - }), k = v?.thinkingConfig || O ? { - ...O, - ...v?.thinkingConfig - } : void 0, A = h && y ? v?.streamFunctionCallArguments ?? !1 : void 0, j = E || A || v?.retrievalConfig ? { - ...E, - ...A && { functionCallingConfig: { - ...E?.functionCallingConfig, - streamFunctionCallArguments: !0 - } }, - ...v?.retrievalConfig && { retrievalConfig: v.retrievalConfig } - } : void 0; - return { - args: { - generationConfig: { - maxOutputTokens: t, - temperature: n, - topK: i, - topP: r, - frequencyPenalty: a, - presencePenalty: o, - stopSequences: s, - seed: l, - responseMimeType: c?.type === `json` ? `application/json` : void 0, - responseSchema: c?.type === `json` && c.schema != null && (v?.structuredOutputs ?? !0) ? U$3(c.schema) : void 0, - ...v?.audioTimestamp && { audioTimestamp: v.audioTimestamp }, - responseModalities: v?.responseModalities, - thinkingConfig: k, - ...v?.mediaResolution && { mediaResolution: v.mediaResolution }, - ...v?.imageConfig && { imageConfig: v.imageConfig } - }, - contents: w, - systemInstruction: S ? void 0 : T, - safetySettings: v?.safetySettings, - tools: ee, - toolConfig: j, - cachedContent: v?.cachedContent, - labels: v?.labels, - serviceTier: x - }, - warnings: [...g, ...D], - providerOptionsNames: _, - extraHeaders: b - }; - } - async doGenerate(e) { - let { args: t, warnings: n, providerOptionsNames: r, extraHeaders: a } = await this.getArgs(e), o = (e) => Object.fromEntries(r.map((t) => [t, e])), s = Pc(this.config.headers ? await hd(this.config.headers) : void 0, e.headers, a), { responseHeaders: c, value: l, rawValue: u } = await sd({ - url: `${this.config.baseURL}/${be$3(this.modelId)}:generateContent`, - headers: s, - body: t, - failedResponseHandler: H$3, - successfulResponseHandler: bd(Ke$3), - abortSignal: e.abortSignal, - fetch: this.config.fetch - }), d = l.candidates[0], f = [], p = d.content?.parts ?? [], m = l.usageMetadata, h, g; - for (let e of p) if (`executableCode` in e && e.executableCode?.code) { - let t = this.config.generateId(); - h = t, f.push({ - type: `tool-call`, - toolCallId: t, - toolName: `code_execution`, - input: JSON.stringify(e.executableCode), - providerExecuted: !0 - }); - } else if (`codeExecutionResult` in e && e.codeExecutionResult) f.push({ - type: `tool-result`, - toolCallId: h, - toolName: `code_execution`, - result: { - outcome: e.codeExecutionResult.outcome, - output: e.codeExecutionResult.output ?? `` - } - }), h = void 0; - else if (`text` in e && e.text != null) { - let t = e.thoughtSignature ? o({ thoughtSignature: e.thoughtSignature }) : void 0; - if (e.text.length === 0) { - if (t != null && f.length > 0) { - let e = f[f.length - 1]; - e.providerMetadata = t; - } - } else f.push({ - type: e.thought === !0 ? `reasoning` : `text`, - text: e.text, - providerMetadata: t - }); - } else if (`functionCall` in e && e.functionCall.name != null) f.push({ - type: `tool-call`, - toolCallId: e.functionCall.id ?? this.config.generateId(), - toolName: e.functionCall.name, - input: JSON.stringify(e.functionCall.args ?? {}), - providerMetadata: e.thoughtSignature ? o({ thoughtSignature: e.thoughtSignature }) : void 0 - }); - else if (`inlineData` in e) { - let t = e.thought === !0, n = !!e.thoughtSignature; - f.push({ - type: t ? `reasoning-file` : `file`, - data: { - type: `data`, - data: e.inlineData.data - }, - mediaType: e.inlineData.mimeType, - providerMetadata: n ? o({ thoughtSignature: e.thoughtSignature }) : void 0 - }); - } else if (`toolCall` in e && e.toolCall) { - let t = e.toolCall.id ?? this.config.generateId(); - g = t, f.push({ - type: `tool-call`, - toolCallId: t, - toolName: `server:${e.toolCall.toolType}`, - input: JSON.stringify(e.toolCall.args ?? {}), - providerExecuted: !0, - dynamic: !0, - providerMetadata: e.thoughtSignature ? o({ - thoughtSignature: e.thoughtSignature, - serverToolCallId: t, - serverToolType: e.toolCall.toolType - }) : o({ - serverToolCallId: t, - serverToolType: e.toolCall.toolType - }) - }); - } else if (`toolResponse` in e && e.toolResponse) { - let t = g ?? e.toolResponse.id ?? this.config.generateId(); - f.push({ - type: `tool-result`, - toolCallId: t, - toolName: `server:${e.toolResponse.toolType}`, - result: e.toolResponse.response ?? {}, - providerMetadata: e.thoughtSignature ? o({ - thoughtSignature: e.thoughtSignature, - serverToolCallId: t, - serverToolType: e.toolResponse.toolType - }) : o({ - serverToolCallId: t, - serverToolType: e.toolResponse.toolType - }) - }), g = void 0; - } - let _ = ze$3({ - groundingMetadata: d.groundingMetadata, - generateId: this.config.generateId - }) ?? []; - for (let e of _) f.push(e); - return { - content: f, - finishReason: { - unified: je$3({ - finishReason: d.finishReason, - hasToolCalls: f.some((e) => e.type === `tool-call` && !e.providerExecuted) - }), - raw: d.finishReason ?? void 0 - }, - usage: de$3(m), - warnings: n, - providerMetadata: o({ - promptFeedback: l.promptFeedback ?? null, - groundingMetadata: d.groundingMetadata ?? null, - urlContextMetadata: d.urlContextMetadata ?? null, - safetyRatings: d.safetyRatings ?? null, - usageMetadata: m ?? null, - finishMessage: d.finishMessage ?? null, - serviceTier: m?.serviceTier ?? null - }), - request: { body: t }, - response: { - headers: c, - body: u - } - }; - } - async doStream(e) { - let { args: t, warnings: n, providerOptionsNames: r, extraHeaders: a } = await this.getArgs(e, { isStreaming: !0 }), o = (e) => Object.fromEntries(r.map((t) => [t, e])), s = Pc(this.config.headers ? await hd(this.config.headers) : void 0, e.headers, a), { responseHeaders: c, value: l } = await sd({ - url: `${this.config.baseURL}/${be$3(this.modelId)}:streamGenerateContent?alt=sse`, - headers: s, - body: t, - failedResponseHandler: H$3, - successfulResponseHandler: yd(qe$3), - abortSignal: e.abortSignal, - fetch: this.config.fetch - }), u = { - unified: `other`, - raw: void 0 - }, d, f, p = null, m = null, h = this.config.generateId, g = !1, _ = null, v = null, y = 0, b = /* @__PURE__ */ new Set(), x, S, C = [], w = (e) => { - let t = C.pop(); - if (t == null) return; - let { finalJSON: n, closingDelta: r } = t.accumulator.finalize(); - r.length > 0 && e.enqueue({ - type: `tool-input-delta`, - id: t.toolCallId, - delta: r, - providerMetadata: t.providerMetadata - }), e.enqueue({ - type: `tool-input-end`, - id: t.toolCallId, - providerMetadata: t.providerMetadata - }), e.enqueue({ - type: `tool-call`, - toolCallId: t.toolCallId, - toolName: t.toolName, - input: n, - providerMetadata: t.providerMetadata - }), g = !0; - }; - return { - stream: l.pipeThrough(new TransformStream({ - start(e) { - e.enqueue({ - type: `stream-start`, - warnings: n - }); - }, - transform(t, n) { - if (e.includeRawChunks && n.enqueue({ - type: `raw`, - rawValue: t.rawValue - }), !t.success) { - n.enqueue({ - type: `error`, - error: t.error - }); - return; - } - let r = t.value, i = r.usageMetadata; - i != null && (d = i); - let a = r.candidates?.[0]; - if (a == null) return; - let s = a.content; - a.groundingMetadata != null && (p = a.groundingMetadata), a.urlContextMetadata != null && (m = a.urlContextMetadata); - let c = ze$3({ - groundingMetadata: a.groundingMetadata, - generateId: h - }); - if (c != null) for (let e of c) e.sourceType === `url` && !b.has(e.url) && (b.add(e.url), n.enqueue(e)); - if (s != null) { - let e = s.parts ?? []; - for (let t of e) if (`executableCode` in t && t.executableCode?.code) { - let e = h(); - x = e, n.enqueue({ - type: `tool-call`, - toolCallId: e, - toolName: `code_execution`, - input: JSON.stringify(t.executableCode), - providerExecuted: !0 - }); - } else if (`codeExecutionResult` in t && t.codeExecutionResult) { - let e = x; - e && (n.enqueue({ - type: `tool-result`, - toolCallId: e, - toolName: `code_execution`, - result: { - outcome: t.codeExecutionResult.outcome, - output: t.codeExecutionResult.output ?? `` - } - }), x = void 0); - } else if (`text` in t && t.text != null) { - let e = t.thoughtSignature ? o({ thoughtSignature: t.thoughtSignature }) : void 0; - t.text.length === 0 ? e != null && _ !== null && n.enqueue({ - type: `text-delta`, - id: _, - delta: ``, - providerMetadata: e - }) : t.thought === !0 ? (_ !== null && (n.enqueue({ - type: `text-end`, - id: _ - }), _ = null), v === null && (v = String(y++), n.enqueue({ - type: `reasoning-start`, - id: v, - providerMetadata: e - })), n.enqueue({ - type: `reasoning-delta`, - id: v, - delta: t.text, - providerMetadata: e - })) : (v !== null && (n.enqueue({ - type: `reasoning-end`, - id: v - }), v = null), _ === null && (_ = String(y++), n.enqueue({ - type: `text-start`, - id: _, - providerMetadata: e - })), n.enqueue({ - type: `text-delta`, - id: _, - delta: t.text, - providerMetadata: e - })); - } else if (`inlineData` in t) { - _ !== null && (n.enqueue({ - type: `text-end`, - id: _ - }), _ = null), v !== null && (n.enqueue({ - type: `reasoning-end`, - id: v - }), v = null); - let e = t.thought === !0, r = t.thoughtSignature ? o({ thoughtSignature: t.thoughtSignature }) : void 0; - n.enqueue({ - type: e ? `reasoning-file` : `file`, - mediaType: t.inlineData.mimeType, - data: { - type: `data`, - data: t.inlineData.data - }, - providerMetadata: r - }); - } else if (`toolCall` in t && t.toolCall) { - let e = t.toolCall.id ?? h(); - S = e; - let r = o({ - ...t.thoughtSignature ? { thoughtSignature: t.thoughtSignature } : {}, - serverToolCallId: e, - serverToolType: t.toolCall.toolType - }); - n.enqueue({ - type: `tool-call`, - toolCallId: e, - toolName: `server:${t.toolCall.toolType}`, - input: JSON.stringify(t.toolCall.args ?? {}), - providerExecuted: !0, - dynamic: !0, - providerMetadata: r - }); - } else if (`toolResponse` in t && t.toolResponse) { - let e = S ?? t.toolResponse.id ?? h(), r = o({ - ...t.thoughtSignature ? { thoughtSignature: t.thoughtSignature } : {}, - serverToolCallId: e, - serverToolType: t.toolResponse.toolType - }); - n.enqueue({ - type: `tool-result`, - toolCallId: e, - toolName: `server:${t.toolResponse.toolType}`, - result: t.toolResponse.response ?? {}, - providerMetadata: r - }), S = void 0; - } - for (let t of e) { - if (!(`functionCall` in t)) continue; - let e = t.thoughtSignature ? o({ thoughtSignature: t.thoughtSignature }) : void 0, r = t.functionCall.partialArgs != null || t.functionCall.name != null && t.functionCall.willContinue === !0, i = t.functionCall.name == null && t.functionCall.args == null && t.functionCall.partialArgs == null && t.functionCall.willContinue == null, a = t.functionCall.name != null && t.functionCall.args != null && t.functionCall.partialArgs == null, s = t.functionCall.name != null && t.functionCall.args == null && t.functionCall.partialArgs == null && t.functionCall.willContinue !== !0; - if (r) { - if (t.functionCall.name != null) { - let r = t.functionCall.id ?? h(), i = new Ce$3(); - if (C.push({ - toolCallId: r, - toolName: t.functionCall.name, - accumulator: i, - providerMetadata: e - }), n.enqueue({ - type: `tool-input-start`, - id: r, - toolName: t.functionCall.name, - providerMetadata: e - }), t.functionCall.partialArgs != null) { - let a = t.functionCall.partialArgs, { textDelta: o } = i.processPartialArgs(a); - o.length > 0 && n.enqueue({ - type: `tool-input-delta`, - id: r, - delta: o, - providerMetadata: e - }), t.functionCall.willContinue !== !0 && a.every((e) => e.willContinue !== !0) && w(n); - } - } else if (t.functionCall.partialArgs != null && C.length > 0) { - let r = C[C.length - 1], i = t.functionCall.partialArgs, { textDelta: a } = r.accumulator.processPartialArgs(i); - a.length > 0 && n.enqueue({ - type: `tool-input-delta`, - id: r.toolCallId, - delta: a, - providerMetadata: e - }), t.functionCall.willContinue !== !0 && i.every((e) => e.willContinue !== !0) && w(n); - } - } else if (i && C.length > 0) w(n); - else if (a) { - let r = t.functionCall.id ?? h(), i = t.functionCall.name, a = typeof t.functionCall.args == `string` ? t.functionCall.args : JSON.stringify(t.functionCall.args ?? {}); - n.enqueue({ - type: `tool-input-start`, - id: r, - toolName: i, - providerMetadata: e - }), n.enqueue({ - type: `tool-input-delta`, - id: r, - delta: a, - providerMetadata: e - }), n.enqueue({ - type: `tool-input-end`, - id: r, - providerMetadata: e - }), n.enqueue({ - type: `tool-call`, - toolCallId: r, - toolName: i, - input: a, - providerMetadata: e - }), g = !0; - } else if (s) { - let r = t.functionCall.id ?? h(), i = t.functionCall.name; - n.enqueue({ - type: `tool-input-start`, - id: r, - toolName: i, - providerMetadata: e - }), n.enqueue({ - type: `tool-input-end`, - id: r, - providerMetadata: e - }), n.enqueue({ - type: `tool-call`, - toolCallId: r, - toolName: i, - input: `{}`, - providerMetadata: e - }), g = !0; - } - } - } - a.finishReason != null && (u = { - unified: je$3({ - finishReason: a.finishReason, - hasToolCalls: g - }), - raw: a.finishReason - }, f = o({ - promptFeedback: r.promptFeedback ?? null, - groundingMetadata: p, - urlContextMetadata: m, - safetyRatings: a.safetyRatings ?? null, - usageMetadata: i ?? null, - finishMessage: a.finishMessage ?? null, - serviceTier: d?.serviceTier ?? null - })); - }, - flush(e) { - _ !== null && e.enqueue({ - type: `text-end`, - id: _ - }), v !== null && e.enqueue({ - type: `reasoning-end`, - id: v - }), e.enqueue({ - type: `finish`, - finishReason: u, - usage: de$3(d), - providerMetadata: f - }); - } - })), - response: { headers: c }, - request: { body: t } - }; - } -}; -function Ne$3(e) { - return /gemini-3[\.\-]/i.test(e) || /gemini-3$/i.test(e); -} -function Pe$3() { - return 65536; -} -function Fe$3(e) { - let t = e.toLowerCase(); - return t.includes(`2.5-pro`) || t.includes(`gemini-3-pro-image`) ? 32768 : 24576; -} -function Ie$3({ reasoning: e, modelId: t, warnings: n }) { - if (Il(e)) return Ne$3(t) && !t.includes(`gemini-3-pro-image`) ? Le$3({ - reasoning: e, - warnings: n - }) : Re$3({ - reasoning: e, - modelId: t, - warnings: n - }); -} -function Le$3({ reasoning: e, warnings: t }) { - if (e === `none`) return { thinkingLevel: `minimal` }; - let n = Ll({ - reasoning: e, - effortMap: { - minimal: `minimal`, - low: `low`, - medium: `medium`, - high: `high`, - xhigh: `high` - }, - warnings: t - }); - if (n != null) return { thinkingLevel: n }; -} -function Re$3({ reasoning: e, modelId: t, warnings: n }) { - if (e === `none`) return { thinkingBudget: 0 }; - let r = zl({ - reasoning: e, - maxOutputTokens: Pe$3(), - maxReasoningBudget: Fe$3(t), - minReasoningBudget: 0, - warnings: n - }); - if (r != null) return { thinkingBudget: r }; -} -function ze$3({ groundingMetadata: e, generateId: t }) { - if (!e?.groundingChunks) return; - let n = []; - for (let r of e.groundingChunks) if (r.web != null) n.push({ - type: `source`, - sourceType: `url`, - id: t(), - url: r.web.uri, - title: r.web.title ?? void 0 - }); - else if (r.image != null) n.push({ - type: `source`, - sourceType: `url`, - id: t(), - url: r.image.sourceUri, - title: r.image.title ?? void 0 - }); - else if (r.retrievedContext != null) { - let e = r.retrievedContext.uri, i = r.retrievedContext.fileSearchStore; - if (e && (e.startsWith(`http://`) || e.startsWith(`https://`))) n.push({ - type: `source`, - sourceType: `url`, - id: t(), - url: e, - title: r.retrievedContext.title ?? void 0 - }); - else if (e) { - let i = r.retrievedContext.title ?? `Unknown Document`, a = `application/octet-stream`, o; - e.endsWith(`.pdf`) ? (a = `application/pdf`, o = e.split(`/`).pop()) : e.endsWith(`.txt`) ? (a = `text/plain`, o = e.split(`/`).pop()) : e.endsWith(`.docx`) ? (a = `application/vnd.openxmlformats-officedocument.wordprocessingml.document`, o = e.split(`/`).pop()) : e.endsWith(`.doc`) ? (a = `application/msword`, o = e.split(`/`).pop()) : (e.match(/\.(md|markdown)$/) && (a = `text/markdown`), o = e.split(`/`).pop()), n.push({ - type: `source`, - sourceType: `document`, - id: t(), - mediaType: a, - title: i, - filename: o - }); - } else if (i) { - let e = r.retrievedContext.title ?? `Unknown Document`; - n.push({ - type: `source`, - sourceType: `document`, - id: t(), - mediaType: `application/octet-stream`, - title: e, - filename: i.split(`/`).pop() - }); - } - } else r.maps != null && r.maps.uri && n.push({ - type: `source`, - sourceType: `url`, - id: t(), - url: r.maps.uri, - title: r.maps.title ?? void 0 - }); - return n.length > 0 ? n : void 0; -} -var Be$3 = () => Co({ - webSearchQueries: xo(Ra$2()).nullish(), - imageSearchQueries: xo(Ra$2()).nullish(), - retrievalQueries: xo(Ra$2()).nullish(), - searchEntryPoint: Co({ renderedContent: Ra$2() }).nullish(), - groundingChunks: xo(Co({ - web: Co({ - uri: Ra$2(), - title: Ra$2().nullish() - }).nullish(), - image: Co({ - sourceUri: Ra$2(), - imageUri: Ra$2(), - title: Ra$2().nullish(), - domain: Ra$2().nullish() - }).nullish(), - retrievedContext: Co({ - uri: Ra$2().nullish(), - title: Ra$2().nullish(), - text: Ra$2().nullish(), - fileSearchStore: Ra$2().nullish() - }).nullish(), - maps: Co({ - uri: Ra$2().nullish(), - title: Ra$2().nullish(), - text: Ra$2().nullish(), - placeId: Ra$2().nullish() - }).nullish() - })).nullish(), - groundingSupports: xo(Co({ - segment: Co({ - startIndex: oo().nullish(), - endIndex: oo().nullish(), - text: Ra$2().nullish() - }).nullish(), - segment_text: Ra$2().nullish(), - groundingChunkIndices: xo(oo()).nullish(), - supportChunkIndices: xo(oo()).nullish(), - confidenceScores: xo(oo()).nullish(), - confidenceScore: xo(oo()).nullish() - })).nullish(), - retrievalMetadata: Eo([Co({ webDynamicRetrievalScore: oo() }), Co({})]).nullish() -}); -var Ve$3 = Co({ - jsonPath: Ra$2(), - stringValue: Ra$2().nullish(), - numberValue: oo().nullish(), - boolValue: uo().nullish(), - nullValue: _o().nullish(), - willContinue: uo().nullish() -}); -var He$3 = () => Co({ parts: xo(Eo([ - Co({ - functionCall: Co({ - id: Ra$2().nullish(), - name: Ra$2().nullish(), - args: _o().nullish(), - partialArgs: xo(Ve$3).nullish(), - willContinue: uo().nullish() - }), - thoughtSignature: Ra$2().nullish() - }), - Co({ - inlineData: Co({ - mimeType: Ra$2(), - data: Ra$2() - }), - thought: uo().nullish(), - thoughtSignature: Ra$2().nullish() - }), - Co({ - toolCall: Co({ - toolType: Ra$2(), - args: _o().nullish(), - id: Ra$2() - }), - thoughtSignature: Ra$2().nullish() - }), - Co({ - toolResponse: Co({ - toolType: Ra$2(), - response: _o().nullish(), - id: Ra$2() - }), - thoughtSignature: Ra$2().nullish() - }), - Co({ - executableCode: Co({ - language: Ra$2(), - code: Ra$2() - }).nullish(), - codeExecutionResult: Co({ - outcome: Ra$2(), - output: Ra$2().nullish() - }).nullish(), - text: Ra$2().nullish(), - thought: uo().nullish(), - thoughtSignature: Ra$2().nullish() - }) -])).nullish() }); -var W$3 = () => Co({ - category: Ra$2().nullish(), - probability: Ra$2().nullish(), - probabilityScore: oo().nullish(), - severity: Ra$2().nullish(), - severityScore: oo().nullish(), - blocked: uo().nullish() -}); -var Ue$3 = xo(Co({ - modality: Ra$2(), - tokenCount: oo() -})).nullish(); -var We$3 = Co({ - cachedContentTokenCount: oo().nullish(), - thoughtsTokenCount: oo().nullish(), - promptTokenCount: oo().nullish(), - candidatesTokenCount: oo().nullish(), - totalTokenCount: oo().nullish(), - trafficType: Ra$2().nullish(), - serviceTier: Ra$2().nullish(), - promptTokensDetails: Ue$3, - candidatesTokensDetails: Ue$3 -}); -var Ge$3 = () => Co({ urlMetadata: xo(Co({ - retrievedUrl: Ra$2(), - urlRetrievalStatus: Ra$2() -})).nullish() }); -var Ke$3 = Wu(() => Qu(Co({ - candidates: xo(Co({ - content: He$3().nullish().or(Co({}).strict()), - finishReason: Ra$2().nullish(), - finishMessage: Ra$2().nullish(), - safetyRatings: xo(W$3()).nullish(), - groundingMetadata: Be$3().nullish(), - urlContextMetadata: Ge$3().nullish() - })), - usageMetadata: We$3.nullish(), - promptFeedback: Co({ - blockReason: Ra$2().nullish(), - safetyRatings: xo(W$3()).nullish() - }).nullish() -}))); -var qe$3 = Wu(() => Qu(Co({ - candidates: xo(Co({ - content: He$3().nullish(), - finishReason: Ra$2().nullish(), - finishMessage: Ra$2().nullish(), - safetyRatings: xo(W$3()).nullish(), - groundingMetadata: Be$3().nullish(), - urlContextMetadata: Ge$3().nullish() - })).nullish(), - usageMetadata: We$3.nullish(), - promptFeedback: Co({ - blockReason: Ra$2().nullish(), - safetyRatings: xo(W$3()).nullish() - }).nullish() -}))); -var Je$3 = md({ - id: `google.code_execution`, - inputSchema: Co({ - language: Ra$2().describe(`The programming language of the code.`), - code: Ra$2().describe(`The code to be executed.`) - }), - outputSchema: Co({ - outcome: Ra$2().describe(`The outcome of the execution (e.g., "OUTCOME_OK").`), - output: Ra$2().describe(`The output from the code execution.`) - }) -}); -var Ye$3 = md({ - id: `google.enterprise_web_search`, - inputSchema: Wu(() => Qu(Co({}))), - outputSchema: Wu(() => Qu(Co({}))) -}); -Co({ - fileSearchStoreNames: xo(Ra$2()).describe("The names of the file_search_stores to retrieve from. Example: `fileSearchStores/my-file-search-store-123`"), - topK: oo().int().positive().describe(`The number of file search retrieval chunks to retrieve.`).optional(), - metadataFilter: Ra$2().describe(`Metadata filter to apply to the file search retrieval documents. See https://google.aip.dev/160 for the syntax of the filter expression.`).optional() -}).passthrough(); -var Xe$3 = md({ - id: `google.file_search`, - inputSchema: Wu(() => Qu(Co({}))), - outputSchema: Wu(() => Qu(Co({}))) -}); -var Ze$3 = md({ - id: `google.google_maps`, - inputSchema: Wu(() => Qu(Co({}))), - outputSchema: Wu(() => Qu(Co({}))) -}); -var Qe$3 = Co({ - searchTypes: Co({ - webSearch: Co({}).optional(), - imageSearch: Co({}).optional() - }).optional(), - timeRangeFilter: Co({ - startTime: Ra$2(), - endTime: Ra$2() - }).optional() -}).passthrough(); -var $e$3 = { - googleSearch: md({ - id: `google.google_search`, - inputSchema: Wu(() => Qu(Co({}))), - outputSchema: Wu(() => Qu(Co({}))) - }), - enterpriseWebSearch: Ye$3, - googleMaps: Ze$3, - urlContext: md({ - id: `google.url_context`, - inputSchema: Wu(() => Qu(Co({}))), - outputSchema: Wu(() => Qu(Co({}))) - }), - fileSearch: Xe$3, - codeExecution: Je$3, - vertexRagStore: md({ - id: `google.vertex_rag_store`, - inputSchema: Wu(() => Qu(Co({}))), - outputSchema: Wu(() => Qu(Co({}))) - }) -}; -var et$3 = Wu(() => Qu(Co({ - personGeneration: Io([ - `dont_allow`, - `allow_adult`, - `allow_all` - ]).nullish(), - aspectRatio: Io([ - `1:1`, - `3:4`, - `4:3`, - `9:16`, - `16:9` - ]).nullish(), - googleSearch: Qe$3.optional() -}))); -var tt$3 = class e { - constructor(e, t, n) { - this.modelId = e, this.settings = t, this.config = n, this.specificationVersion = `v4`; - } - static [Mc](e) { - return Cd({ - modelId: e.modelId, - config: e.config - }); - } - static [Nc](t) { - return new e(t.modelId, {}, t.config); - } - get maxImagesPerCall() { - return this.settings.maxImagesPerCall == null ? nt$3(this.modelId) ? 10 : 4 : this.settings.maxImagesPerCall; - } - get provider() { - return this.config.provider; - } - async doGenerate(e) { - return nt$3(this.modelId) ? this.doGenerateGemini(e) : this.doGenerateImagen(e); - } - async doGenerateImagen(e) { - var t; - let { prompt: n, n: r = 1, size: a, aspectRatio: o = `1:1`, seed: s, providerOptions: c, headers: l, abortSignal: d, files: f, mask: p } = e, m = []; - if (f != null && f.length > 0) throw Error(`Google Gemini API does not support image editing with Imagen models. Use Google Vertex AI (@ai-sdk/google-vertex) for image editing capabilities.`); - if (p != null) throw Error(`Google Gemini API does not support image editing with masks. Use Google Vertex AI (@ai-sdk/google-vertex) for image editing capabilities.`); - a != null && m.push({ - type: `unsupported`, - feature: `size`, - details: "This model does not support the `size` option. Use `aspectRatio` instead." - }), s != null && m.push({ - type: `unsupported`, - feature: `seed`, - details: "This model does not support the `seed` option through this provider." - }); - let h = await ad({ - provider: `google`, - providerOptions: c, - schema: et$3 - }), g = ((t = this.config._internal)?.currentDate)?.call(t) ?? /* @__PURE__ */ new Date(), _ = { sampleCount: r }; - if (o != null && (_.aspectRatio = o), h) { - let { googleSearch: e, ...t } = h; - e != null && m.push({ - type: `unsupported`, - feature: `googleSearch`, - details: `Google Search grounding is only supported on Gemini image models.` - }), Object.assign(_, t); - } - let v = { - instances: [{ prompt: n }], - parameters: _ - }, { responseHeaders: y, value: b } = await sd({ - url: `${this.config.baseURL}/models/${this.modelId}:predict`, - headers: Pc(this.config.headers ? await hd(this.config.headers) : void 0, l), - body: v, - failedResponseHandler: H$3, - successfulResponseHandler: bd(rt$3), - abortSignal: d, - fetch: this.config.fetch - }); - return { - images: b.predictions.map((e) => e.bytesBase64Encoded), - warnings: m, - providerMetadata: { google: { images: b.predictions.map(() => ({})) } }, - response: { - timestamp: g, - modelId: this.modelId, - headers: y - } - }; - } - async doGenerateGemini(e) { - var t; - let { prompt: n, n: r, size: i, aspectRatio: a, seed: o, providerOptions: s, headers: c, abortSignal: l, files: d, mask: f } = e, p = []; - if (f != null) throw Error(`Gemini image models do not support mask-based image editing.`); - if (r != null && r > 1) throw Error(`Gemini image models do not support generating a set number of images per call. Use n=1 or omit the n parameter.`); - i != null && p.push({ - type: `unsupported`, - feature: `size`, - details: "This model does not support the `size` option. Use `aspectRatio` instead." - }); - let m = []; - if (n != null && m.push({ - type: `text`, - text: n - }), d != null && d.length > 0) for (let e of d) e.type === `url` ? m.push({ - type: `file`, - data: { - type: `url`, - url: new URL(e.url) - }, - mediaType: `image/*` - }) : m.push({ - type: `file`, - data: { - type: `data`, - data: typeof e.data == `string` ? e.data : new Uint8Array(e.data) - }, - mediaType: e.mediaType - }); - let h = [{ - role: `user`, - content: m - }], g = await ad({ - provider: `google`, - providerOptions: s, - schema: et$3 - }), { googleSearch: _, ...v } = s?.google ?? {}, y = await new Me$3(this.modelId, { - provider: this.config.provider, - baseURL: this.config.baseURL, - headers: this.config.headers ?? {}, - fetch: this.config.fetch, - generateId: this.config.generateId ?? bl - }).doGenerate({ - prompt: h, - seed: o, - providerOptions: { google: { - responseModalities: [`IMAGE`], - imageConfig: a ? { aspectRatio: a } : void 0, - ...v - } }, - tools: g?.googleSearch == null ? void 0 : [{ - type: `provider`, - id: `google.google_search`, - name: `google_search`, - args: g.googleSearch - }], - headers: c, - abortSignal: l - }), b = ((t = this.config._internal)?.currentDate)?.call(t) ?? /* @__PURE__ */ new Date(), x = []; - for (let e of y.content) e.type === `file` && e.mediaType.startsWith(`image/`) && e.data.type === `data` && x.push(zc(e.data.data)); - return { - images: x, - warnings: p, - providerMetadata: { google: { - ...y.providerMetadata?.google ?? {}, - images: x.map(() => ({})) - } }, - response: { - timestamp: b, - modelId: this.modelId, - headers: y.response?.headers - }, - usage: y.usage ? { - inputTokens: y.usage.inputTokens.total, - outputTokens: y.usage.outputTokens.total, - totalTokens: (y.usage.inputTokens.total ?? 0) + (y.usage.outputTokens.total ?? 0) - } : void 0 - }; - } -}; -function nt$3(e) { - return e.startsWith(`gemini-`); -} -var rt$3 = Wu(() => Qu(Co({ predictions: xo(Co({ bytesBase64Encoded: Ra$2() })).default([]) }))); -var it$3 = class { - constructor(e) { - this.config = e, this.specificationVersion = `v4`; - } - get provider() { - return this.config.provider; - } - async uploadFile(t) { - let n = await ad({ - provider: `google`, - providerOptions: t.providerOptions, - schema: ot$3 - }), r = this.config.headers(), i = this.config.fetch ?? globalThis.fetch, a = []; - t.filename != null && a.push({ - type: `unsupported`, - feature: `filename` - }); - let o = Bc(t.data), s = t.mediaType, c = n?.displayName, l = await i(`${this.config.baseURL.replace(/\/v1beta$/, ``)}/upload/v1beta/files`, { - method: `POST`, - headers: { - ...r, - "X-Goog-Upload-Protocol": `resumable`, - "X-Goog-Upload-Command": `start`, - "X-Goog-Upload-Header-Content-Length": String(o.length), - "X-Goog-Upload-Header-Content-Type": s, - "Content-Type": `application/json` - }, - body: JSON.stringify({ file: { ...c == null ? {} : { display_name: c } } }) - }); - if (!l.ok) { - let t = await l.text(); - throw new i$17({ - name: `GOOGLE_FILES_UPLOAD_ERROR`, - message: `Failed to initiate resumable upload: ${l.status} ${t}` - }); - } - let d = l.headers.get(`x-goog-upload-url`); - if (!d) throw new i$17({ - name: `GOOGLE_FILES_UPLOAD_ERROR`, - message: `No upload URL returned from initiation request` - }); - let f = await i(d, { - method: `POST`, - headers: { - "Content-Length": String(o.length), - "X-Goog-Upload-Offset": `0`, - "X-Goog-Upload-Command": `upload, finalize` - }, - body: o - }); - if (!f.ok) { - let t = await f.text(); - throw new i$17({ - name: `GOOGLE_FILES_UPLOAD_ERROR`, - message: `Failed to upload file data: ${f.status} ${t}` - }); - } - let p = (await f.json()).file, m = n?.pollIntervalMs ?? 2e3, h = n?.pollTimeoutMs ?? 3e5, g = Date.now(); - for (; p.state === `PROCESSING`;) { - if (Date.now() - g > h) throw new i$17({ - name: `GOOGLE_FILES_UPLOAD_TIMEOUT`, - message: `File processing timed out after ${h}ms` - }); - await Uc(m); - let { value: t } = await jl({ - url: `${this.config.baseURL}/${p.name}`, - headers: Pc(r), - successfulResponseHandler: bd(at$3), - failedResponseHandler: H$3, - fetch: this.config.fetch - }); - p = t; - } - if (p.state === `FAILED`) throw new i$17({ - name: `GOOGLE_FILES_UPLOAD_FAILED`, - message: `File processing failed for ${p.name}` - }); - return { - warnings: a, - providerReference: { google: p.uri }, - mediaType: p.mimeType ?? t.mediaType, - providerMetadata: { google: { - name: p.name, - displayName: p.displayName, - mimeType: p.mimeType, - sizeBytes: p.sizeBytes, - state: p.state, - uri: p.uri, - ...p.createTime == null ? {} : { createTime: p.createTime }, - ...p.updateTime == null ? {} : { updateTime: p.updateTime }, - ...p.expirationTime == null ? {} : { expirationTime: p.expirationTime }, - ...p.sha256Hash == null ? {} : { sha256Hash: p.sha256Hash } - } } - }; - } -}; -var at$3 = Wu(() => Qu(Co({ - name: Ra$2(), - displayName: Ra$2().nullish(), - mimeType: Ra$2(), - sizeBytes: Ra$2().nullish(), - createTime: Ra$2().nullish(), - updateTime: Ra$2().nullish(), - expirationTime: Ra$2().nullish(), - sha256Hash: Ra$2().nullish(), - uri: Ra$2(), - state: Ra$2() -}))); -var ot$3 = Wu(() => Qu(Co({ - displayName: Ra$2().nullish(), - pollIntervalMs: oo().positive().nullish(), - pollTimeoutMs: oo().positive().nullish() -}).passthrough())); -var st$3 = Wu(() => Qu(Co({ - pollIntervalMs: oo().positive().nullish(), - pollTimeoutMs: oo().positive().nullish(), - personGeneration: Io([ - `dont_allow`, - `allow_adult`, - `allow_all` - ]).nullish(), - negativePrompt: Ra$2().nullish(), - referenceImages: xo(Co({ - bytesBase64Encoded: Ra$2().nullish(), - gcsUri: Ra$2().nullish() - })).nullish() -}).passthrough())); -var ct$3 = class { - constructor(e, t) { - this.modelId = e, this.config = t, this.specificationVersion = `v4`; - } - get provider() { - return this.config.provider; - } - get maxVideosPerCall() { - return 4; - } - async doGenerate(t) { - var n; - let r = ((n = this.config._internal)?.currentDate)?.call(n) ?? /* @__PURE__ */ new Date(), a = [], o = await ad({ - provider: `google`, - providerOptions: t.providerOptions, - schema: st$3 - }), s = [{}], c = s[0]; - if (t.prompt != null && (c.prompt = t.prompt), t.image != null) if (t.image.type === `url`) a.push({ - type: `unsupported`, - feature: `URL-based image input`, - details: `Google Generative AI video models require base64-encoded images. URL will be ignored.` - }); - else { - let e = typeof t.image.data == `string` ? t.image.data : Rc(t.image.data); - c.image = { inlineData: { - mimeType: t.image.mediaType || `image/png`, - data: e - } }; - } - o?.referenceImages != null && (c.referenceImages = o.referenceImages.map((e) => e.bytesBase64Encoded ? { inlineData: { - mimeType: `image/png`, - data: e.bytesBase64Encoded - } } : e.gcsUri ? { gcsUri: e.gcsUri } : e)); - let l = { sampleCount: t.n }; - if (t.aspectRatio && (l.aspectRatio = t.aspectRatio), t.resolution && (l.resolution = { - "1280x720": `720p`, - "1920x1080": `1080p`, - "3840x2160": `4k` - }[t.resolution] || t.resolution), t.duration && (l.durationSeconds = t.duration), t.seed && (l.seed = t.seed), o != null) { - let e = o; - e.personGeneration !== void 0 && e.personGeneration !== null && (l.personGeneration = e.personGeneration), e.negativePrompt !== void 0 && e.negativePrompt !== null && (l.negativePrompt = e.negativePrompt); - for (let [t, n] of Object.entries(e)) [ - `pollIntervalMs`, - `pollTimeoutMs`, - `personGeneration`, - `negativePrompt`, - `referenceImages` - ].includes(t) || (l[t] = n); - } - let { value: d } = await sd({ - url: `${this.config.baseURL}/models/${this.modelId}:predictLongRunning`, - headers: Pc(await hd(this.config.headers), t.headers), - body: { - instances: s, - parameters: l - }, - successfulResponseHandler: bd(lt$3), - failedResponseHandler: H$3, - abortSignal: t.abortSignal, - fetch: this.config.fetch - }), p = d.name; - if (!p) throw new i$17({ - name: `GOOGLE_VIDEO_GENERATION_ERROR`, - message: `No operation name returned from API` - }); - let m = o?.pollIntervalMs ?? 1e4, h = o?.pollTimeoutMs ?? 6e5, g = Date.now(), _ = d, v; - for (; !_.done;) { - if (Date.now() - g > h) throw new i$17({ - name: `GOOGLE_VIDEO_GENERATION_TIMEOUT`, - message: `Video generation timed out after ${h}ms` - }); - if (await Uc(m), t.abortSignal?.aborted) throw new i$17({ - name: `GOOGLE_VIDEO_GENERATION_ABORTED`, - message: `Video generation request was aborted` - }); - let { value: n, responseHeaders: r } = await jl({ - url: `${this.config.baseURL}/${p}`, - headers: Pc(await hd(this.config.headers), t.headers), - successfulResponseHandler: bd(lt$3), - failedResponseHandler: H$3, - abortSignal: t.abortSignal, - fetch: this.config.fetch - }); - _ = n, v = r; - } - if (_.error) throw new i$17({ - name: `GOOGLE_VIDEO_GENERATION_FAILED`, - message: `Video generation failed: ${_.error.message}` - }); - let y = _.response; - if (!y?.generateVideoResponse?.generatedSamples || y.generateVideoResponse.generatedSamples.length === 0) throw new i$17({ - name: `GOOGLE_VIDEO_GENERATION_ERROR`, - message: `No videos in response. Response: ${JSON.stringify(_)}` - }); - let b = [], x = [], C = (await hd(this.config.headers))?.[`x-goog-api-key`]; - for (let e of y.generateVideoResponse.generatedSamples) if (e.video?.uri) { - let t = C && Ml(e.video.uri, this.config.baseURL) ? `${e.video.uri}${e.video.uri.includes(`?`) ? `&` : `?`}key=${C}` : e.video.uri; - b.push({ - type: `url`, - url: t, - mediaType: `video/mp4` - }), x.push({ uri: e.video.uri }); - } - if (b.length === 0) throw new i$17({ - name: `GOOGLE_VIDEO_GENERATION_ERROR`, - message: `No valid videos in response` - }); - return { - videos: b, - warnings: a, - response: { - timestamp: r, - modelId: this.modelId, - headers: v - }, - providerMetadata: { google: { videos: x } } - }; - } -}; -var lt$3 = Co({ - name: Ra$2().nullish(), - done: uo().nullish(), - error: Co({ - code: oo().nullish(), - message: Ra$2(), - status: Ra$2().nullish() - }).nullish(), - response: Co({ generateVideoResponse: Co({ generatedSamples: xo(Co({ video: Co({ uri: Ra$2().nullish() }).nullish() })).nullish() }).nullish() }).nullish() -}); -var ut$3 = Wu(() => Qu(Co({ candidates: xo(Co({ content: Co({ parts: xo(Co({ inlineData: Co({ - mimeType: Ra$2().nullish(), - data: Ra$2().nullish() -}).nullish() })).nullish() }).nullish() })).nullish() }))); -var dt$3 = Co({ prebuiltVoiceConfig: Co({ voiceName: Ra$2() }) }); -var ft$3 = Wu(() => Qu(Co({ multiSpeakerVoiceConfig: Co({ speakerVoiceConfigs: xo(Co({ - speaker: Ra$2(), - voiceConfig: dt$3 -})) }).optional() }))); -var pt$3 = `Kore`; -var mt$3 = 24e3; -var ht$3 = class e { - constructor(e, t) { - this.modelId = e, this.config = t, this.specificationVersion = `v4`; - } - static [Mc](e) { - return Cd({ - modelId: e.modelId, - config: e.config - }); - } - static [Nc](t) { - return new e(t.modelId, t.config); - } - get provider() { - return this.config.provider; - } - async getArgs({ text: e, voice: t = pt$3, outputFormat: n, instructions: r, speed: i, language: a, providerOptions: o }) { - let s = [], c = this.config.provider.includes(`vertex`) ? [`googleVertex`, `vertex`] : [`google`], l; - for (let e of c) if (l = await ad({ - provider: e, - providerOptions: o, - schema: ft$3 - }), l != null) break; - l == null && !c.includes(`google`) && (l = await ad({ - provider: `google`, - providerOptions: o, - schema: ft$3 - })); - let d = l?.multiSpeakerVoiceConfig, f = d ? { multiSpeakerVoiceConfig: d } : { voiceConfig: { prebuiltVoiceConfig: { voiceName: t } } }, p = e; - r != null && (d ? s.push({ - type: `unsupported`, - feature: `instructions`, - details: "Google Gemini TTS ignores `instructions` when `multiSpeakerVoiceConfig` is set, because prepending them would break multi-speaker transcript parsing." - }) : p = `${r}: ${e}`), i != null && s.push({ - type: `unsupported`, - feature: `speed`, - details: "Google Gemini TTS models do not support the `speed` option. It was ignored." - }), a != null && s.push({ - type: `unsupported`, - feature: `language`, - details: "Google Gemini TTS models do not support the `language` option. Language is detected automatically from the input text." - }); - let m = `wav`; - return n === `pcm` ? m = `pcm` : n != null && n !== `wav` && s.push({ - type: `unsupported`, - feature: `outputFormat`, - details: `Unsupported output format: ${n}. Using wav instead.` - }), { - requestBody: { - contents: [{ - role: `user`, - parts: [{ text: p }] - }], - generationConfig: { - responseModalities: [`AUDIO`], - speechConfig: f - } - }, - warnings: s, - outputFormat: m - }; - } - async doGenerate(e) { - var t; - let n = ((t = this.config._internal)?.currentDate)?.call(t) ?? /* @__PURE__ */ new Date(), { requestBody: r, warnings: a, outputFormat: o } = await this.getArgs(e), { value: s, responseHeaders: c, rawValue: l } = await sd({ - url: `${this.config.baseURL}/models/${this.modelId}:generateContent`, - headers: Pc(this.config.headers ? await hd(this.config.headers) : void 0, e.headers), - body: r, - failedResponseHandler: H$3, - successfulResponseHandler: bd(ut$3), - abortSignal: e.abortSignal, - fetch: this.config.fetch - }), u, d; - for (let e of s.candidates ?? []) { - for (let t of e.content?.parts ?? []) if (t.inlineData?.data) { - u = t.inlineData.data, d = t.inlineData.mimeType ?? void 0; - break; - } - if (u != null) break; - } - let f = gt$3(d) ?? mt$3, p = u == null ? /* @__PURE__ */ new Uint8Array() : Lc(u), m = o === `pcm` || p.length === 0 ? p : _t$3(p, f); - return o === `pcm` && p.length > 0 && a.push({ - type: `unsupported`, - feature: `outputFormat`, - details: `Returning raw PCM audio (signed 16-bit little-endian, mono, ${f} Hz). These bytes have no container header and are not directly playable; see providerMetadata.google for the sample rate and mime type.` - }), { - audio: m, - warnings: a, - request: { body: JSON.stringify(r) }, - response: { - timestamp: n, - modelId: this.modelId, - headers: c, - body: l - }, - providerMetadata: { google: { - sampleRate: f, - mimeType: d ?? null - } } - }; - } -}; -function gt$3(e) { - if (e == null) return; - let t = /rate=(\d+)/.exec(e); - return t ? Number.parseInt(t[1], 10) : void 0; -} -function _t$3(e, t) { - let n = t * 2, r = e.length, i = new ArrayBuffer(44 + r), a = new DataView(i); - G$4(a, 0, `RIFF`), a.setUint32(4, 36 + r, !0), G$4(a, 8, `WAVE`), G$4(a, 12, `fmt `), a.setUint32(16, 16, !0), a.setUint16(20, 1, !0), a.setUint16(22, 1, !0), a.setUint32(24, t, !0), a.setUint32(28, n, !0), a.setUint16(32, 2, !0), a.setUint16(34, 16, !0), G$4(a, 36, `data`), a.setUint32(40, r, !0); - let o = new Uint8Array(i); - return o.set(e, 44), o; -} -function G$4(e, t, n) { - for (let r = 0; r < n.length; r++) e.setUint8(t + r, n.charCodeAt(r)); -} -function K$3(e) { - if (e == null) return { - inputTokens: { - total: void 0, - noCache: void 0, - cacheRead: void 0, - cacheWrite: void 0 - }, - outputTokens: { - total: void 0, - text: void 0, - reasoning: void 0 - }, - raw: void 0 - }; - let t = e.total_input_tokens ?? 0, n = e.total_output_tokens ?? 0, r = e.total_thought_tokens ?? 0, i = e.total_cached_tokens ?? 0; - return { - inputTokens: { - total: e.total_input_tokens ?? void 0, - noCache: e.total_input_tokens == null ? void 0 : t - i, - cacheRead: e.total_cached_tokens ?? void 0, - cacheWrite: void 0 - }, - outputTokens: { - total: e.total_output_tokens == null && e.total_thought_tokens == null ? void 0 : n + r, - text: e.total_output_tokens ?? void 0, - reasoning: e.total_thought_tokens ?? void 0 - }, - raw: e - }; -} -var vt$3 = { - pdf: `application/pdf`, - txt: `text/plain`, - md: `text/markdown`, - markdown: `text/markdown`, - doc: `application/msword`, - docx: `application/vnd.openxmlformats-officedocument.wordprocessingml.document` -}; -function yt$3(e) { - let t = e.toLowerCase(); - for (let [e, n] of Object.entries(vt$3)) if (t.endsWith(`.${e}`)) return n; - return `application/octet-stream`; -} -function bt$3(e) { - let t = e.split(`/`), n = t[t.length - 1]; - return n && n.length > 0 ? n : void 0; -} -function xt$3({ annotation: e, generateId: t }) { - switch (e.type) { - case `url_citation`: { - let n = e; - return n.url == null || n.url.length === 0 ? void 0 : { - type: `source`, - sourceType: `url`, - id: t(), - url: n.url, - ...n.title == null ? {} : { title: n.title } - }; - } - case `file_citation`: { - let n = e, r = n.url ?? n.document_uri ?? n.file_name; - if (r == null || r.length === 0) return; - if (r.startsWith(`http://`) || r.startsWith(`https://`)) return { - type: `source`, - sourceType: `url`, - id: t(), - url: r, - ...n.file_name == null ? {} : { title: n.file_name } - }; - let i = n.file_name ?? bt$3(r), a = yt$3(r); - return { - type: `source`, - sourceType: `document`, - id: t(), - mediaType: a, - title: n.file_name ?? i ?? r, - ...i == null ? {} : { filename: i } - }; - } - case `place_citation`: { - let n = e; - return n.url == null || n.url.length === 0 ? void 0 : { - type: `source`, - sourceType: `url`, - id: t(), - url: n.url, - ...n.name == null ? {} : { title: n.name } - }; - } - default: return; - } -} -function St$3({ block: e, generateId: t }) { - let n = []; - switch (e.type) { - case `url_context_result`: { - let r = e.result ?? []; - for (let e of r) e?.url == null || e.url.length === 0 || e.status != null && e.status !== `success` || n.push({ - type: `source`, - sourceType: `url`, - id: t(), - url: e.url - }); - break; - } - case `google_search_result`: { - let r = e.result ?? []; - for (let e of r) { - let r = e?.url; - r == null || r.length === 0 || n.push({ - type: `source`, - sourceType: `url`, - id: t(), - url: r, - ...e.title == null ? {} : { title: e.title } - }); - } - break; - } - case `google_maps_result`: { - let r = e.result ?? []; - for (let e of r) for (let r of e.places ?? []) r.url == null || r.url.length === 0 || n.push({ - type: `source`, - sourceType: `url`, - id: t(), - url: r.url, - ...r.name == null ? {} : { title: r.name } - }); - break; - } - case `file_search_result`: { - let r = e.result ?? []; - for (let e of r) { - if (typeof e != `object` || !e) continue; - let r = e, i = r.url ?? r.document_uri ?? r.file_name; - if (i == null || i.length === 0) continue; - if (i.startsWith(`http://`) || i.startsWith(`https://`)) { - n.push({ - type: `source`, - sourceType: `url`, - id: t(), - url: i, - ...r.title == null ? {} : { title: r.title } - }); - continue; - } - let a = r.file_name ?? bt$3(i), o = yt$3(i); - n.push({ - type: `source`, - sourceType: `document`, - id: t(), - mediaType: o, - title: r.title ?? r.file_name ?? a ?? i, - ...a == null ? {} : { filename: a } - }); - } - break; - } - default: break; - } - return n; -} -function q$3({ annotations: e, generateId: t }) { - if (e == null) return []; - let n = /* @__PURE__ */ new Set(), r = []; - for (let i of e) { - let e = xt$3({ - annotation: i, - generateId: t - }); - if (e == null) continue; - let a = e.sourceType === `url` ? `url:${e.url}` : `doc:${e.filename ?? e.title}`; - n.has(a) || (n.add(a), r.push(e)); - } - return r; -} -function J$3({ status: e, hasFunctionCall: t }) { - switch (e) { - case `completed`: return t ? `tool-calls` : `stop`; - case `requires_action`: return `tool-calls`; - case `failed`: return `error`; - case `incomplete`: return `length`; - case `cancelled`: return `other`; - default: return `other`; - } -} -var Ct$3 = /* @__PURE__ */ new Set([ - `google_search_call`, - `code_execution_call`, - `url_context_call`, - `file_search_call`, - `google_maps_call`, - `mcp_server_tool_call` -]); -var wt$3 = /* @__PURE__ */ new Set([ - `google_search_result`, - `code_execution_result`, - `url_context_result`, - `file_search_result`, - `google_maps_result`, - `mcp_server_tool_result` -]); -function Tt$3(e) { - return e.replace(/_call$/, ``); -} -function Et$3(e) { - return e.replace(/_result$/, ``); -} -function Dt$3({ warnings: e, generateId: t, includeRawChunks: n, serviceTier: r }) { - let i, a, o = r, s, c = !1, l = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Set(); - function d(e) { - return e.sourceType === `url` ? `url:${e.url}` : `doc:${e.filename ?? e.title}`; - } - return new TransformStream({ - start(t) { - t.enqueue({ - type: `stream-start`, - warnings: e - }); - }, - transform(e, r) { - if (n && r.enqueue({ - type: `raw`, - rawValue: e.rawValue - }), !e.success) { - s = `failed`, r.enqueue({ - type: `error`, - error: e.error - }); - return; - } - let f = e.value, p = f.event_type; - switch (p) { - case `interaction.created`: { - let e = f.interaction; - i = e?.id != null && e.id.length > 0 ? e.id : void 0; - let t = e?.created, n; - if (typeof t == `string`) { - let e = new Date(t); - Number.isNaN(e.getTime()) || (n = e); - } - r.enqueue({ - type: `response-metadata`, - ...i == null ? {} : { id: i }, - modelId: e?.model, - ...n ? { timestamp: n } : {} - }); - break; - } - case `step.start`: { - let e = f, n = e.step, a = e.index, o = `${i ?? `interaction`}:${a}`, s = n?.type; - if (s === `model_output`) { - let e = n?.content?.[0]; - if (e?.type === `text`) { - l.set(a, { - kind: `text`, - id: o, - emittedSourceKeys: /* @__PURE__ */ new Set() - }), r.enqueue({ - type: `text-start`, - id: o - }); - let n = q$3({ - annotations: e.annotations, - generateId: t - }); - for (let e of n) { - let t = d(e); - u.has(t) || (u.add(t), r.enqueue(e)); - } - } else e?.type === `image` ? l.set(a, { - kind: `image`, - id: o, - ...e.data == null ? {} : { data: e.data }, - ...e.mime_type == null ? {} : { mimeType: e.mime_type }, - ...e.uri == null ? {} : { uri: e.uri } - }) : l.set(a, { - kind: `pending_model_output`, - id: o - }); - } else if (s === `thought`) { - let e = n?.signature; - if (l.set(a, { - kind: `reasoning`, - id: o, - ...e == null ? {} : { signature: e } - }), r.enqueue({ - type: `reasoning-start`, - id: o - }), Array.isArray(n?.summary)) for (let e of n.summary) e?.type === `text` && typeof e.text == `string` && r.enqueue({ - type: `reasoning-delta`, - id: o, - delta: e.text - }); - } else if (s === `function_call`) { - let e = n?.id ?? o, t = n?.name ?? `unknown`; - c = !0; - let i = { - kind: `function_call`, - id: o, - toolCallId: e, - toolName: t, - argumentsAccum: ``, - ...n?.signature == null ? {} : { signature: n.signature } - }; - l.set(a, i), r.enqueue({ - type: `tool-input-start`, - id: e, - toolName: t - }); - } else if (s != null && Ct$3.has(s)) { - let e = s === `mcp_server_tool_call` ? n?.name ?? `mcp_server_tool` : Tt$3(s), t = { - kind: `builtin_tool_call`, - id: o, - blockType: s, - toolCallId: n?.id ?? o, - toolName: e, - arguments: n?.arguments ?? {}, - callEmitted: !1 - }; - l.set(a, t); - } else if (s != null && wt$3.has(s)) { - let e = s === `mcp_server_tool_result` ? n?.name ?? `mcp_server_tool` : Et$3(s), t = { - kind: `builtin_tool_result`, - id: o, - blockType: s, - callId: n?.call_id ?? o, - toolName: e, - result: n?.result ?? null, - ...n?.is_error == null ? {} : { isError: n.is_error }, - resultEmitted: !1 - }; - l.set(a, t); - } else l.set(a, { - kind: `unknown`, - id: o - }); - break; - } - case `step.delta`: { - let e = f, n = l.get(e.index); - if (n == null) break; - let a = e.delta?.type; - if (n.kind === `pending_model_output` && (a === `text` || a === `text_annotation` || a === `text_annotation_delta`)) { - let t = { - kind: `text`, - id: n.id, - emittedSourceKeys: /* @__PURE__ */ new Set() - }; - l.set(e.index, t), n = t, r.enqueue({ - type: `text-start`, - id: t.id - }); - } - if (a === `image` && (n.kind === `pending_model_output` || n.kind === `text` || n.kind === `image`)) { - let t = e.delta, a = {}; - i != null && (a.interactionId = i); - let o = Object.keys(a).length > 0 ? { google: a } : void 0; - t?.data != null && t.data.length > 0 ? r.enqueue({ - type: `file`, - mediaType: t.mime_type ?? `image/png`, - data: { - type: `data`, - data: t.data - }, - ...o ? { providerMetadata: o } : {} - }) : t?.uri != null && t.uri.length > 0 && r.enqueue({ - type: `file`, - mediaType: t.mime_type ?? `image/png`, - data: { - type: `url`, - url: new URL(t.uri) - }, - ...o ? { providerMetadata: o } : {} - }), n.kind === `image` && (n.data = void 0, n.uri = void 0); - break; - } - let o = e.delta; - if (n.kind === `text` && o?.type === `text`) { - let e = o.text ?? ``; - e.length > 0 && r.enqueue({ - type: `text-delta`, - id: n.id, - delta: e - }); - } else if (n.kind === `text` && (o?.type === `text_annotation` || o?.type === `text_annotation_delta`)) { - let e = q$3({ - annotations: o.annotations, - generateId: t - }); - for (let t of e) { - let e = d(t); - u.has(e) || (u.add(e), n.emittedSourceKeys.add(e), r.enqueue(t)); - } - } else if (n.kind === `image` && o?.type === `image`) o.data != null && (n.data = o.data), o.mime_type != null && (n.mimeType = o.mime_type), o.uri != null && (n.uri = o.uri); - else if (n.kind === `reasoning`) { - if (o?.type === `thought_summary`) { - let e = o.content; - e?.type === `text` && typeof e.text == `string` && r.enqueue({ - type: `reasoning-delta`, - id: n.id, - delta: e.text - }); - } else if (o?.type === `thought_signature`) { - let e = o.signature; - e != null && (n.signature = e); - } - } else if (n.kind === `function_call` && o?.type === `arguments_delta`) { - let e = typeof o.arguments == `string` ? o.arguments : ``; - e.length > 0 && (n.argumentsAccum += e, r.enqueue({ - type: `tool-input-delta`, - id: n.toolCallId, - delta: e - })), o.id != null && (n.toolCallId = o.id), o.signature != null && (n.signature = o.signature), c = !0; - } else n.kind === `builtin_tool_call` && o?.type === n.blockType ? (o.id != null && (n.toolCallId = o.id), o.arguments != null && typeof o.arguments == `object` && (n.arguments = o.arguments), o.name != null && n.blockType === `mcp_server_tool_call` && (n.toolName = o.name)) : n.kind === `builtin_tool_result` && o?.type === n.blockType && (o.call_id != null && (n.callId = o.call_id), o.result !== void 0 && (n.result = o.result), o.is_error != null && (n.isError = o.is_error), o.name != null && n.blockType === `mcp_server_tool_result` && (n.toolName = o.name)); - break; - } - case `step.stop`: { - let e = f, n = l.get(e.index); - if (n == null) break; - if (n.kind === `text`) { - let e = i == null ? void 0 : { google: { interactionId: i } }; - r.enqueue({ - type: `text-end`, - id: n.id, - ...e ? { providerMetadata: e } : {} - }); - } else if (n.kind === `reasoning`) { - let e = {}; - n.signature != null && (e.signature = n.signature), i != null && (e.interactionId = i); - let t = Object.keys(e).length > 0 ? { google: e } : void 0; - r.enqueue({ - type: `reasoning-end`, - id: n.id, - ...t ? { providerMetadata: t } : {} - }); - } else if (n.kind === `image`) { - let e = {}; - i != null && (e.interactionId = i); - let t = Object.keys(e).length > 0 ? { google: e } : void 0; - n.data != null && n.data.length > 0 ? r.enqueue({ - type: `file`, - mediaType: n.mimeType ?? `image/png`, - data: { - type: `data`, - data: n.data - }, - ...t ? { providerMetadata: t } : {} - }) : n.uri != null && n.uri.length > 0 && r.enqueue({ - type: `file`, - mediaType: n.mimeType ?? `image/png`, - data: { - type: `url`, - url: new URL(n.uri) - }, - ...t ? { providerMetadata: t } : {} - }); - } else if (n.kind === `function_call`) { - let e = n.argumentsAccum.length > 0 ? n.argumentsAccum : `{}`; - r.enqueue({ - type: `tool-input-end`, - id: n.toolCallId - }); - let t = {}; - n.signature != null && (t.signature = n.signature), i != null && (t.interactionId = i); - let a = Object.keys(t).length > 0 ? { google: t } : void 0; - r.enqueue({ - type: `tool-call`, - toolCallId: n.toolCallId, - toolName: n.toolName, - input: e, - ...a ? { providerMetadata: a } : {} - }); - } else if (n.kind === `builtin_tool_call` && !n.callEmitted) r.enqueue({ - type: `tool-call`, - toolCallId: n.toolCallId, - toolName: n.toolName, - input: JSON.stringify(n.arguments ?? {}), - providerExecuted: !0 - }), n.callEmitted = !0; - else if (n.kind === `builtin_tool_result` && !n.resultEmitted) { - r.enqueue({ - type: `tool-result`, - toolCallId: n.callId, - toolName: n.toolName, - result: n.result ?? null - }), n.resultEmitted = !0; - let e = St$3({ - block: { - type: n.blockType, - call_id: n.callId, - result: n.result - }, - generateId: t - }); - for (let t of e) { - let e = d(t); - u.has(e) || (u.add(e), r.enqueue(t)); - } - } - l.delete(e.index); - break; - } - case `interaction.status_update`: - case `interaction.in_progress`: - case `interaction.requires_action`: { - let e = f; - s = e.status == null ? p === `interaction.requires_action` ? `requires_action` : `in_progress` : e.status; - break; - } - case `interaction.completed`: { - let e = f.interaction; - e?.id != null && e.id.length > 0 && (i = e.id), e?.status != null && (s = e.status), e?.usage != null && (a = e.usage), e?.service_tier != null && (o = e.service_tier); - break; - } - case `error`: { - let e = f; - s = `failed`; - let t = e.error ?? { message: `Unknown interaction error` }; - r.enqueue({ - type: `error`, - error: t - }); - break; - } - default: break; - } - }, - flush(e) { - let t = { - unified: J$3({ - status: s, - hasFunctionCall: c - }), - raw: s - }, n = { google: { - ...i == null ? {} : { interactionId: i }, - ...o == null ? {} : { serviceTier: o } - } }; - e.enqueue({ - type: `finish`, - finishReason: t, - usage: K$3(a), - providerMetadata: n - }); - } - }); -} -function Ot$3({ prompt: e, previousInteractionId: t, store: n, mediaResolution: r }) { - let i = [], a = t != null && n === !1, o = t != null && n !== !1; - a && i.push({ - type: `other`, - message: `google.interactions: providerOptions.google.previousInteractionId was set together with store: false. These are incoherent (the prior interaction cannot be referenced when nothing was stored on the server); the full history will be sent and previous_interaction_id will still be emitted.` - }); - let s = o ? At$3({ - prompt: e, - previousInteractionId: t - }) : e, c = [], l = []; - for (let e of s) switch (e.role) { - case `system`: - c.push(e.content); - break; - case `user`: { - let t = []; - for (let n of e.content) if (n.type === `text`) t.push({ - type: `text`, - text: n.text - }); - else if (n.type === `file`) { - let e = kt$3({ - part: n, - warnings: i, - mediaResolution: r - }); - e != null && t.push(e); - } - let n = Pt$3(t); - n.length > 0 && l.push({ - type: `user_input`, - content: n - }); - break; - } - case `assistant`: { - let t = [], n = () => { - t.length > 0 && (l.push({ - type: `model_output`, - content: t - }), t = []); - }; - for (let a of e.content) if (a.type === `text`) t.push({ - type: `text`, - text: a.text - }); - else if (a.type === `reasoning`) { - n(); - let e = a.providerOptions?.google?.signature; - l.push({ - type: `thought`, - ...e == null ? {} : { signature: e }, - summary: a.text.length > 0 ? [{ - type: `text`, - text: a.text - }] : void 0 - }); - } else if (a.type === `file`) { - let e = kt$3({ - part: a, - warnings: i, - mediaResolution: r - }); - e != null && t.push(e); - } else if (a.type === `tool-call`) { - n(); - let e = a.providerOptions?.google?.signature, t = typeof a.input == `string` ? jt$3(a.input) : a.input ?? {}; - l.push({ - type: `function_call`, - id: a.toolCallId, - name: a.toolName, - arguments: t, - ...e == null ? {} : { signature: e } - }); - } else i.push({ - type: `other`, - message: `google.interactions: unsupported assistant content part type "${a.type}"; part dropped.` - }); - n(); - break; - } - case `tool`: { - let t = []; - for (let n of e.content) { - if (n.type !== `tool-result`) { - i.push({ - type: `other`, - message: `google.interactions: unsupported tool message part type "${n.type}"; part dropped.` - }); - continue; - } - let e = Mt$3({ - toolCallId: n.toolCallId, - toolName: n.toolName, - output: n.output, - signature: n.providerOptions?.google?.signature, - warnings: i - }); - t.push(e); - } - t.length > 0 && l.push({ - type: `user_input`, - content: t - }); - break; - } - } - return { - input: l, - systemInstruction: c.length > 0 ? c.join(` - -`) : void 0, - warnings: i - }; -} -function kt$3({ part: e, warnings: t, mediaResolution: n }) { - if (e.data.type === `text`) return { - type: `text`, - text: e.data.text - }; - let r = el(e.mediaType), i; - switch (r) { - case `image`: - i = `image`; - break; - case `audio`: - i = `audio`; - break; - case `video`: - i = `video`; - break; - case `application`: - i = `document`; - break; - default: i = void 0; - } - if (i == null) { - t.push({ - type: `other`, - message: `google.interactions: unsupported file media type "${e.mediaType}"; part dropped.` - }); - return; - } - let s = n != null && (i === `image` || i === `video`) ? { resolution: n } : {}; - switch (e.data.type) { - case `data`: { - let t = gd({ part: e }); - return { - type: i, - data: zc(e.data.data), - mime_type: t, - ...s - }; - } - case `url`: return { - type: i, - uri: e.data.url.toString(), - ...tl(e.mediaType) ? { mime_type: e.mediaType } : {}, - ...s - }; - case `reference`: { - let t = _d({ - reference: e.data.reference, - provider: `google` - }); - return { - type: i, - uri: t, - ...tl(e.mediaType) ? { mime_type: e.mediaType } : {}, - ...s - }; - } - } -} -function At$3({ prompt: e, previousInteractionId: t }) { - let n = [], r = /* @__PURE__ */ new Set(); - for (let i of e) { - if (i.role === `assistant`) { - if (i.content.some((e) => e.providerOptions?.google?.interactionId === t)) { - for (let e of i.content) e.type === `tool-call` && r.add(e.toolCallId); - continue; - } - n.push(i); - continue; - } - if (i.role === `tool`) { - let e = i.content.filter((e) => e.type === `tool-result` ? !r.has(e.toolCallId) : !0); - if (e.length === 0) continue; - n.push({ - ...i, - content: e - }); - continue; - } - n.push(i); - } - return n; -} -function jt$3(e) { - try { - let t = JSON.parse(e); - return typeof t == `object` && t && !Array.isArray(t) ? t : { value: t }; - } catch { - return { value: e }; - } -} -function Mt$3({ toolCallId: e, toolName: t, output: n, signature: r, warnings: i }) { - let o = { - type: `function_result`, - call_id: e, - name: t, - ...r == null ? {} : { signature: r } - }; - switch (n.type) { - case `text`: return { - ...o, - result: n.value - }; - case `json`: return { - ...o, - result: JSON.stringify(n.value) - }; - case `error-text`: return { - ...o, - is_error: !0, - result: n.value - }; - case `error-json`: return { - ...o, - is_error: !0, - result: JSON.stringify(n.value) - }; - case `execution-denied`: return { - ...o, - is_error: !0, - result: n.reason ?? `Tool execution denied by user.` - }; - case `content`: { - let e = []; - for (let t of n.value) if (t.type === `text`) e.push({ - type: `text`, - text: t.text - }); - else if (t.type === `file`) { - if (el(t.mediaType) !== `image`) { - i.push({ - type: `other`, - message: `google.interactions: tool-result file with mediaType "${t.mediaType}" is not supported (Interactions \`function_result.result\` accepts only text and image content); part dropped.` - }); - continue; - } - let n = Nt$3({ - part: t, - warnings: i - }); - n != null && e.push(n); - } else i.push({ - type: `other`, - message: `google.interactions: tool-result content part type "${t.type}" is not supported; part dropped.` - }); - return { - ...o, - result: e - }; - } - } -} -function Nt$3({ part: e, warnings: t }) { - switch (e.data.type) { - case `data`: { - let t = tl(e.mediaType) ? e.mediaType : gd({ part: { - type: `file`, - mediaType: e.mediaType, - data: e.data - } }); - return { - type: `image`, - data: zc(e.data.data), - mime_type: t - }; - } - case `url`: return { - type: `image`, - uri: e.data.url.toString(), - ...tl(e.mediaType) ? { mime_type: e.mediaType } : {} - }; - case `reference`: return { - type: `image`, - uri: _d({ - reference: e.data.reference, - provider: `google` - }), - ...tl(e.mediaType) ? { mime_type: e.mediaType } : {} - }; - case `text`: - t.push({ - type: `other`, - message: "google.interactions: tool-result image part with `data.type === \"text\"` is not representable as an image; part dropped." - }); - return; - } -} -function Pt$3(e) { - if (e.length < 2) return e; - let t = []; - for (let n of e) { - let e = t[t.length - 1]; - if (n.type === `text` && e != null && e.type === `text` && e.annotations == null && n.annotations == null) { - let r = { - type: `text`, - text: `${e.text} - -${n.text}` - }; - t[t.length - 1] = r; - continue; - } - t.push(n); - } - return t; -} -var Y$4 = () => Co({ - modality: Ra$2().nullish(), - tokens: oo().nullish() -}).loose(); -var Ft$3 = () => Co({ - total_input_tokens: oo().nullish(), - total_output_tokens: oo().nullish(), - total_thought_tokens: oo().nullish(), - total_cached_tokens: oo().nullish(), - total_tool_use_tokens: oo().nullish(), - total_tokens: oo().nullish(), - input_tokens_by_modality: xo(Y$4()).nullish(), - output_tokens_by_modality: xo(Y$4()).nullish(), - cached_tokens_by_modality: xo(Y$4()).nullish(), - tool_use_tokens_by_modality: xo(Y$4()).nullish(), - grounding_tool_count: xo(Co({ - type: Ra$2().nullish(), - count: oo().nullish() - }).loose()).nullish() -}).loose(); -var It$3 = () => Io([ - `in_progress`, - `requires_action`, - `completed`, - `failed`, - `cancelled`, - `incomplete` -]); -var Lt$3 = () => Eo([ - Co({ - type: Ro(`url_citation`), - url: Ra$2().nullish(), - title: Ra$2().nullish(), - start_index: oo().nullish(), - end_index: oo().nullish() - }).loose(), - Co({ - type: Ro(`file_citation`), - file_name: Ra$2().nullish(), - document_uri: Ra$2().nullish(), - url: Ra$2().nullish(), - page_number: oo().nullish(), - media_id: Ra$2().nullish(), - start_index: oo().nullish(), - end_index: oo().nullish(), - custom_metadata: Po(Ra$2(), _o()).nullish() - }).loose(), - Co({ - type: Ro(`place_citation`), - name: Ra$2().nullish(), - url: Ra$2().nullish(), - place_id: Ra$2().nullish(), - start_index: oo().nullish(), - end_index: oo().nullish() - }).loose(), - Co({ type: Ra$2() }).loose() -]); -var Rt$3 = () => Co({ - type: Ra$2(), - text: Ra$2().nullish(), - data: Ra$2().nullish(), - mime_type: Ra$2().nullish() -}).loose(); -var zt$3 = () => Eo([ - Co({ - type: Ro(`text`), - text: Ra$2(), - annotations: xo(Lt$3()).nullish() - }).loose(), - Co({ - type: Ro(`image`), - data: Ra$2().nullish(), - mime_type: Ra$2().nullish(), - resolution: Io([ - `low`, - `medium`, - `high`, - `ultra_high` - ]).nullish(), - uri: Ra$2().nullish() - }).loose(), - Co({ type: Ra$2() }).loose() -]); -var Bt$3 = [ - `google_search_call`, - `code_execution_call`, - `url_context_call`, - `file_search_call`, - `google_maps_call`, - `mcp_server_tool_call` -]; -var Vt$3 = [ - `google_search_result`, - `code_execution_result`, - `url_context_result`, - `file_search_result`, - `google_maps_result`, - `mcp_server_tool_result` -]; -var Ht$3 = () => Eo([ - Co({ - type: Ro(`user_input`), - content: xo(zt$3()).nullish() - }).loose(), - Co({ - type: Ro(`model_output`), - content: xo(zt$3()).nullish() - }).loose(), - Co({ - type: Ro(`function_call`), - id: Ra$2(), - name: Ra$2(), - arguments: Po(Ra$2(), _o()).nullish(), - signature: Ra$2().nullish() - }).loose(), - Co({ - type: Ro(`thought`), - signature: Ra$2().nullish(), - summary: xo(Rt$3()).nullish() - }).loose(), - Co({ - type: Io(Bt$3), - id: Ra$2(), - arguments: Po(Ra$2(), _o()).nullish(), - name: Ra$2().nullish(), - server_name: Ra$2().nullish(), - search_type: Ra$2().nullish(), - signature: Ra$2().nullish() - }).loose(), - Co({ - type: Io(Vt$3), - call_id: Ra$2(), - result: _o().nullish(), - is_error: uo().nullish(), - name: Ra$2().nullish(), - server_name: Ra$2().nullish(), - signature: Ra$2().nullish() - }).loose(), - Co({ type: Ra$2() }).loose() -]); -var X$4 = Wu(() => Qu(Co({ - id: Ra$2().nullish(), - created: Ra$2().nullish(), - updated: Ra$2().nullish(), - status: It$3(), - model: Ra$2().nullish(), - agent: Ra$2().nullish(), - steps: xo(Ht$3()).nullish(), - usage: Ft$3().nullish(), - service_tier: Ra$2().nullish(), - previous_interaction_id: Ra$2().nullish(), - response_modalities: xo(Ra$2()).nullish() -}).loose())); -var Ut$3 = Wu(() => Qu((() => { - let e = It$3(), t = Lt$3(), n = Rt$3(), r = Co({ - event_type: Ro(`interaction.created`), - event_id: Ra$2().nullish(), - interaction: Co({ - id: Ra$2().nullish(), - created: Ra$2().nullish(), - model: Ra$2().nullish(), - agent: Ra$2().nullish(), - status: e.nullish() - }).loose() - }).loose(), i = Co({ - event_type: Ro(`step.start`), - event_id: Ra$2().nullish(), - index: oo(), - step: Ht$3() - }).loose(), a = Co({ - type: Ro(`text`), - text: Ra$2() - }).loose(), o = Co({ - type: Ro(`thought_summary`), - content: n.nullish() - }).loose(), s = Co({ - type: Ro(`thought_signature`), - signature: Ra$2().nullish() - }).loose(), c = Co({ - type: Ro(`arguments_delta`), - arguments: Ra$2().nullish(), - id: Ra$2().nullish(), - signature: Ra$2().nullish() - }).loose(), l = Co({ - type: Io([`text_annotation_delta`, `text_annotation`]), - annotations: xo(t).nullish() - }).loose(), u = Eo([ - a, - Co({ - type: Ro(`image`), - data: Ra$2().nullish(), - mime_type: Ra$2().nullish(), - resolution: Io([ - `low`, - `medium`, - `high`, - `ultra_high` - ]).nullish(), - uri: Ra$2().nullish() - }).loose(), - o, - s, - c, - l, - Co({ - type: Io(Bt$3), - id: Ra$2().nullish(), - arguments: Po(Ra$2(), _o()).nullish(), - name: Ra$2().nullish(), - server_name: Ra$2().nullish(), - search_type: Ra$2().nullish(), - signature: Ra$2().nullish() - }).loose(), - Co({ - type: Io(Vt$3), - call_id: Ra$2().nullish(), - result: _o().nullish(), - is_error: uo().nullish(), - name: Ra$2().nullish(), - server_name: Ra$2().nullish(), - signature: Ra$2().nullish() - }).loose(), - Co({ type: Ra$2() }).loose() - ]); - return Eo([ - r, - i, - Co({ - event_type: Ro(`step.delta`), - event_id: Ra$2().nullish(), - index: oo(), - delta: u - }).loose(), - Co({ - event_type: Ro(`step.stop`), - event_id: Ra$2().nullish(), - index: oo() - }).loose(), - Co({ - event_type: Ro(`interaction.status_update`), - event_id: Ra$2().nullish(), - interaction_id: Ra$2().nullish(), - status: e.nullish() - }).loose(), - Co({ - event_type: Ro(`interaction.in_progress`), - event_id: Ra$2().nullish(), - interaction_id: Ra$2().nullish(), - status: e.nullish() - }).loose(), - Co({ - event_type: Ro(`interaction.requires_action`), - event_id: Ra$2().nullish(), - interaction_id: Ra$2().nullish(), - status: e.nullish() - }).loose(), - Co({ - event_type: Ro(`interaction.completed`), - event_id: Ra$2().nullish(), - interaction: Co({ - id: Ra$2().nullish(), - status: e.nullish(), - usage: Ft$3().nullish(), - service_tier: Ra$2().nullish() - }).loose() - }).loose(), - Co({ - event_type: Ro(`error`), - event_id: Ra$2().nullish(), - error: Co({ - code: Ra$2().nullish(), - message: Ra$2().nullish() - }).loose().nullish() - }).loose(), - Co({ event_type: Ra$2() }).loose() - ]); -})())); -var Wt$3 = Wu(() => Qu(Co({ - previousInteractionId: Ra$2().nullish(), - store: uo().nullish(), - agent: Ra$2().nullish(), - agentConfig: Eo([Co({ type: Ro(`dynamic`) }).loose(), Co({ - type: Ro(`deep-research`), - thinkingSummaries: Io([`auto`, `none`]).nullish(), - visualization: Io([`off`, `auto`]).nullish(), - collaborativePlanning: uo().nullish() - })]).nullish(), - thinkingLevel: Io([ - `minimal`, - `low`, - `medium`, - `high` - ]).nullish(), - thinkingSummaries: Io([`auto`, `none`]).nullish(), - responseFormat: xo(Eo([ - Co({ - type: Ro(`text`), - mimeType: Ra$2().nullish(), - schema: _o().nullish() - }).loose(), - Co({ - type: Ro(`image`), - mimeType: Ra$2().nullish(), - aspectRatio: Io([ - `1:1`, - `2:3`, - `3:2`, - `3:4`, - `4:3`, - `4:5`, - `5:4`, - `9:16`, - `16:9`, - `21:9`, - `1:8`, - `8:1`, - `1:4`, - `4:1` - ]).nullish(), - imageSize: Io([ - `1K`, - `2K`, - `4K`, - `512` - ]).nullish() - }).loose(), - Co({ - type: Ro(`audio`), - mimeType: Ra$2().nullish() - }).loose() - ])).nullish(), - imageConfig: Co({ - aspectRatio: Io([ - `1:1`, - `2:3`, - `3:2`, - `3:4`, - `4:3`, - `4:5`, - `5:4`, - `9:16`, - `16:9`, - `21:9`, - `1:8`, - `8:1`, - `1:4`, - `4:1` - ]).nullish(), - imageSize: Io([ - `1K`, - `2K`, - `4K`, - `512` - ]).nullish() - }).nullish(), - mediaResolution: Io([ - `low`, - `medium`, - `high`, - `ultra_high` - ]).nullish(), - responseModalities: xo(Io([ - `text`, - `image`, - `audio`, - `video`, - `document` - ])).nullish(), - serviceTier: Io([ - `flex`, - `standard`, - `priority` - ]).nullish(), - systemInstruction: Ra$2().nullish(), - signature: Ra$2().nullish(), - interactionId: Ra$2().nullish(), - pollingTimeoutMs: oo().int().positive().nullish(), - background: uo().nullish(), - environment: Eo([Ra$2(), Co({ - type: Ro(`remote`), - sources: xo(Eo([ - Co({ - type: Ro(`gcs`), - source: Ra$2(), - target: Ra$2().nullish() - }), - Co({ - type: Ro(`repository`), - source: Ra$2(), - target: Ra$2().nullish() - }), - Co({ - type: Ro(`inline`), - content: Ra$2(), - target: Ra$2() - }) - ])).nullish(), - network: Eo([Ro(`disabled`), Co({ allowlist: xo(Co({ - domain: Ra$2(), - transform: xo(Po(Ra$2(), Ra$2())).nullish() - })) })]).nullish() - })]).nullish() -}))); -function Z$4({ signature: e, interactionId: t }) { - let n = {}; - return e != null && (n.signature = e), t != null && (n.interactionId = t), Object.keys(n).length > 0 ? { providerMetadata: { google: n } } : {}; -} -var Gt$3 = /* @__PURE__ */ new Set([ - `google_search_call`, - `code_execution_call`, - `url_context_call`, - `file_search_call`, - `google_maps_call`, - `mcp_server_tool_call` -]); -var Kt$3 = /* @__PURE__ */ new Set([ - `google_search_result`, - `code_execution_result`, - `url_context_result`, - `file_search_result`, - `google_maps_result`, - `mcp_server_tool_result` -]); -function qt$3(e) { - return e.replace(/_call$/, ``); -} -function Jt$3(e) { - return e.replace(/_result$/, ``); -} -function Yt$3({ steps: e, generateId: t, interactionId: n }) { - let r = [], i = !1; - if (e == null) return { - content: r, - hasFunctionCall: i - }; - for (let a of e) { - if (typeof a != `object` || !a) continue; - let e = a.type; - if (typeof e == `string`) switch (e) { - case `user_input`: break; - case `model_output`: { - let e = a.content ?? []; - for (let i of e) { - if (typeof i != `object` || !i) continue; - let e = i.type; - if (e === `text`) { - let e = i.text ?? ``, a = i.annotations; - r.push({ - type: `text`, - text: e, - ...Z$4({ interactionId: n }) - }); - let o = q$3({ - annotations: a, - generateId: t - }); - for (let e of o) r.push(e); - } else if (e === `image`) { - let e = i; - e.data != null && e.data.length > 0 ? r.push({ - type: `file`, - mediaType: e.mime_type ?? `image/png`, - data: { - type: `data`, - data: e.data - }, - ...Z$4({ interactionId: n }) - }) : e.uri != null && e.uri.length > 0 && r.push({ - type: `file`, - mediaType: e.mime_type ?? `image/png`, - data: { - type: `url`, - url: new URL(e.uri) - }, - ...Z$4({ interactionId: n }) - }); - } - } - break; - } - case `thought`: { - let e = a, t = (Array.isArray(e.summary) ? e.summary : []).filter((e) => e?.type === `text` && typeof e.text == `string`).map((e) => e.text).join(` -`); - r.push({ - type: `reasoning`, - text: t, - ...Z$4({ - signature: e.signature, - interactionId: n - }) - }); - break; - } - case `function_call`: { - i = !0; - let e = a; - r.push({ - type: `tool-call`, - toolCallId: e.id, - toolName: e.name, - input: JSON.stringify(e.arguments ?? {}), - ...Z$4({ - signature: e.signature, - interactionId: n - }) - }); - break; - } - default: - if (Gt$3.has(e)) { - let n = a, i = e === `mcp_server_tool_call` ? n.name ?? `mcp_server_tool` : qt$3(e), o = JSON.stringify(n.arguments ?? {}); - r.push({ - type: `tool-call`, - toolCallId: n.id ?? t(), - toolName: i, - input: o, - providerExecuted: !0 - }); - } else if (Kt$3.has(e)) { - let n = a, i = e === `mcp_server_tool_result` ? n.name ?? `mcp_server_tool` : Jt$3(e); - r.push({ - type: `tool-result`, - toolCallId: n.call_id ?? t(), - toolName: i, - result: n.result ?? null - }); - let o = St$3({ - block: a, - generateId: t - }); - for (let e of o) r.push(e); - } - break; - } - } - return { - content: r, - hasFunctionCall: i - }; -} -var Xt$3 = () => globalThis.fetch; -async function Zt$3({ baseURL: e, interactionId: t, headers: n, fetch: r = Xt$3() }) { - if (t == null || t.length === 0) return; - let i = `${e}/interactions/${encodeURIComponent(t)}/cancel`; - try { - let e = await r(i, { - method: `POST`, - headers: Ol(Pc({ "Content-Type": `application/json` }, n), El()), - body: `{}` - }); - try { - await e.text(); - } catch {} - } catch {} -} -var Qt$3 = /* @__PURE__ */ new Set([ - `completed`, - `failed`, - `cancelled`, - `incomplete` -]); -function $t$3(e) { - return e != null && Qt$3.has(e); -} -var en$3 = 1e3; -var tn$3 = 1e4; -var nn$3 = 1800 * 1e3; -async function rn$3({ baseURL: e, interactionId: t, headers: n, fetch: r, abortSignal: i, initialDelayMs: a = en$3, maxDelayMs: o = tn$3, timeoutMs: s = nn$3 }) { - if (t == null || t.length === 0) throw Error(`google.interactions: cannot poll a background interaction without an id. The POST response did not include an interaction id.`); - let c = Date.now(), l = a, u = `${e}/interactions/${encodeURIComponent(t)}`, d = () => Zt$3({ - baseURL: e, - interactionId: t, - headers: n, - fetch: r - }); - try { - for (;;) { - if (i?.aborted) throw await d(), new DOMException(`Polling was aborted`, `AbortError`); - if (Date.now() - c > s) throw Error(`google.interactions: timed out polling interaction ${t} after ${s}ms.`); - await Uc(l, { abortSignal: i }); - let { value: e, rawValue: a, responseHeaders: f } = await jl({ - url: u, - headers: n, - failedResponseHandler: H$3, - successfulResponseHandler: bd(X$4), - abortSignal: i, - fetch: r - }); - if ($t$3(e.status)) return { - response: e, - rawResponse: a, - responseHeaders: f - }; - l = Math.min(l * 2, o); - } - } catch (e) { - throw xl(e) && await d(), e; - } -} -function an$3({ tools: e, toolChoice: t }) { - let n = [], r = e?.length ? e : void 0; - if (r == null) return { - tools: void 0, - toolChoice: void 0, - toolWarnings: n - }; - let i = []; - for (let e of r) { - if (e.type === `function`) { - i.push({ - type: `function`, - name: e.name, - description: e.description ?? ``, - parameters: e.inputSchema - }); - continue; - } - if (e.type === `provider`) { - let t = e.args ?? {}; - switch (e.id) { - case `google.google_search`: { - let e = t.searchTypes, n; - if (typeof e == `object` && e) { - let t = []; - e.webSearch != null && t.push(`web_search`), e.imageSearch != null && t.push(`image_search`), t.length > 0 && (n = t); - } - i.push({ - type: `google_search`, - ...n == null ? {} : { search_types: n } - }); - break; - } - case `google.code_execution`: - i.push({ type: `code_execution` }); - break; - case `google.url_context`: - i.push({ type: `url_context` }); - break; - case `google.file_search`: - i.push({ - type: `file_search`, - ...t.fileSearchStoreNames == null ? {} : { file_search_store_names: t.fileSearchStoreNames }, - ...t.topK == null ? {} : { top_k: t.topK }, - ...t.metadataFilter == null ? {} : { metadata_filter: t.metadataFilter } - }); - break; - case `google.google_maps`: - i.push({ - type: `google_maps`, - ...t.latitude == null ? {} : { latitude: t.latitude }, - ...t.longitude == null ? {} : { longitude: t.longitude }, - ...t.enableWidget == null ? {} : { enable_widget: t.enableWidget } - }); - break; - case `google.computer_use`: - i.push({ - type: `computer_use`, - environment: t.environment ?? `browser`, - ...t.excludedPredefinedFunctions == null ? {} : { excludedPredefinedFunctions: t.excludedPredefinedFunctions } - }); - break; - case `google.mcp_server`: - i.push({ - type: `mcp_server`, - ...t.name == null ? {} : { name: t.name }, - ...t.url == null ? {} : { url: t.url }, - ...t.headers == null ? {} : { headers: t.headers }, - ...t.allowedTools == null ? {} : { allowed_tools: t.allowedTools } - }); - break; - case `google.retrieval`: { - let e = t.vertexAiSearchConfig ?? void 0; - i.push({ - type: `retrieval`, - ...t.retrievalTypes == null ? { retrieval_types: [`vertex_ai_search`] } : { retrieval_types: t.retrievalTypes }, - ...e == null ? {} : { vertex_ai_search_config: e } - }); - break; - } - default: - n.push({ - type: `unsupported`, - feature: `provider-defined tool ${e.id}`, - details: `provider-defined tool ${e.id} is not supported by google.interactions; tool dropped.` - }); - break; - } - continue; - } - n.push({ - type: `unsupported`, - feature: `tool of type ${e.type}`, - details: `Only function tools and google.* provider-defined tools are supported by google.interactions; tool dropped.` - }); - } - let a = i.some((e) => e.type === `function`), o; - if (t != null && a) switch (t.type) { - case `auto`: - o = `auto`; - break; - case `required`: - o = `any`; - break; - case `none`: - o = `none`; - break; - case `tool`: - o = { allowed_tools: { - mode: `validated`, - tools: [t.toolName] - } }; - break; - } - return { - tools: i.length > 0 ? i : void 0, - toolChoice: o, - toolWarnings: n - }; -} -var on$3 = 3; -var sn$3 = 500; -function cn$3({ baseURL: e, interactionId: t, headers: n, fetch: r, abortSignal: i, maxRetries: a = on$3, retryDelayMs: o = sn$3 }) { - if (t.length === 0) throw Error(`google.interactions: cannot stream a background interaction without an id.`); - let s = { - ...n, - accept: `text/event-stream` - }, c, l = !1, u = 0, d = !1, f, p = new AbortController(), m = () => p.abort(); - i != null && (i.aborted ? p.abort() : i.addEventListener(`abort`, m, { once: !0 })); - let h = p.signal; - function g() { - let n = `${e}/interactions/${encodeURIComponent(t)}`, r = new URLSearchParams({ stream: `true` }); - return c != null && r.set(`last_event_id`, c), `${n}?${r.toString()}`; - } - async function _() { - let { value: e } = await jl({ - url: g(), - headers: s, - failedResponseHandler: H$3, - successfulResponseHandler: yd(Ut$3), - abortSignal: h, - fetch: r - }); - return e.getReader(); - } - return new ReadableStream({ - async start(s) { - try { - for (; !l && !h.aborted;) { - if (f == null) try { - f = await _(), d = !1; - } catch (e) { - if (xl(e) || h.aborted) { - s.error(e); - return; - } - if (u++, u >= a) { - s.error(e); - return; - } - await Uc(o * u, { abortSignal: h }); - continue; - } - try { - let { done: e, value: t } = await f.read(); - if (e) { - if (f = void 0, l) break; - if (d) u = 0; - else { - if (u++, u >= a) { - s.error(Error(`google.interactions: SSE stream closed without producing any events.`)); - return; - } - await Uc(o * u, { abortSignal: h }); - } - continue; - } - if (d = !0, t.success) { - let e = t.value; - typeof e.event_id == `string` && e.event_id.length > 0 && (c = e.event_id), (e.event_type === `interaction.completed` || e.event_type === `error`) && (l = !0); - } - s.enqueue(t); - } catch (e) { - if (xl(e) || h.aborted) { - s.error(e); - return; - } - if (f = void 0, u++, u >= a) { - s.error(e); - return; - } - await Uc(o * u, { abortSignal: h }); - } - } - s.close(); - } catch (e) { - s.error(e); - } finally { - i?.removeEventListener(`abort`, m), f?.cancel().catch(() => {}), f = void 0, h.aborted && !l && await Zt$3({ - baseURL: e, - interactionId: t, - headers: n, - fetch: r - }); - } - }, - cancel() { - p.abort(), f?.cancel().catch(() => {}), f = void 0; - } - }); -} -function ln$3({ response: e, warnings: t, generateId: n, includeRawChunks: r, headerServiceTier: i }) { - return new ReadableStream({ start(a) { - a.enqueue({ - type: `stream-start`, - warnings: t - }); - let o = typeof e.id == `string` && e.id.length > 0 ? e.id : void 0, s, c = e.created; - if (typeof c == `string`) { - let e = new Date(c); - Number.isNaN(e.getTime()) || (s = e); - } - a.enqueue({ - type: `response-metadata`, - ...o == null ? {} : { id: o }, - modelId: e.model ?? void 0, - ...s ? { timestamp: s } : {} - }), r && a.enqueue({ - type: `raw`, - rawValue: e - }); - let { content: l, hasFunctionCall: u } = Yt$3({ - steps: e.steps ?? null, - generateId: n, - interactionId: o - }), d = 0, f = () => `${o ?? `agent`}:${d++}`; - for (let e of l) switch (e.type) { - case `text`: { - let t = f(), n = e.providerMetadata; - a.enqueue({ - type: `text-start`, - id: t - }), e.text.length > 0 && a.enqueue({ - type: `text-delta`, - id: t, - delta: e.text - }), a.enqueue({ - type: `text-end`, - id: t, - ...n ? { providerMetadata: n } : {} - }); - break; - } - case `reasoning`: { - let t = f(), n = e.providerMetadata; - a.enqueue({ - type: `reasoning-start`, - id: t - }), e.text.length > 0 && a.enqueue({ - type: `reasoning-delta`, - id: t, - delta: e.text - }), a.enqueue({ - type: `reasoning-end`, - id: t, - ...n ? { providerMetadata: n } : {} - }); - break; - } - case `tool-call`: { - let t = e.providerMetadata; - a.enqueue({ - type: `tool-input-start`, - id: e.toolCallId, - toolName: e.toolName, - ...e.providerExecuted ? { providerExecuted: e.providerExecuted } : {} - }), a.enqueue({ - type: `tool-input-delta`, - id: e.toolCallId, - delta: e.input - }), a.enqueue({ - type: `tool-input-end`, - id: e.toolCallId - }), a.enqueue({ - type: `tool-call`, - toolCallId: e.toolCallId, - toolName: e.toolName, - input: e.input, - ...e.providerExecuted ? { providerExecuted: e.providerExecuted } : {}, - ...t ? { providerMetadata: t } : {} - }); - break; - } - case `tool-result`: - a.enqueue({ - type: `tool-result`, - toolCallId: e.toolCallId, - toolName: e.toolName, - result: e.result - }); - break; - case `source`: - case `file`: - a.enqueue(e); - break; - default: break; - } - let p = e.service_tier ?? i, m = { - unified: J$3({ - status: e.status, - hasFunctionCall: u - }), - raw: e.status - }, h = { google: { - ...o == null ? {} : { interactionId: o }, - ...p == null ? {} : { serviceTier: p } - } }; - a.enqueue({ - type: `finish`, - finishReason: m, - usage: K$3(e.usage), - providerMetadata: h - }), a.close(); - } }); -} -var un$3 = class e { - constructor(e, t) { - this.specificationVersion = `v4`, typeof e == `string` ? (this.modelId = e, this.agent = void 0) : `managedAgent` in e ? (this.modelId = e.managedAgent, this.agent = e.managedAgent) : (this.modelId = e.agent, this.agent = e.agent), this.config = t; - } - static [Mc](e) { - return { - ...Cd({ - modelId: e.modelId, - config: e.config - }), - agent: e.agent - }; - } - static [Nc](t) { - return new e(t.agent == null ? t.modelId : { agent: t.agent }, t.config); - } - get provider() { - return this.config.provider; - } - get supportedUrls() { - return this.config.supportedUrls ? this.config.supportedUrls() : { - "image/*": [/^https?:\/\/.+/], - "application/pdf": [/^https?:\/\/.+/], - "audio/*": [/^https?:\/\/.+/], - "video/*": [ - /^https?:\/\/(www\.)?youtube\.com\/watch\?v=.+/, - /^https?:\/\/youtu\.be\/.+/, - /^gs:\/\/.+/ - ] - }; - } - async getArgs(e) { - let t = [], n = await ad({ - provider: `google`, - providerOptions: e.providerOptions, - schema: Wt$3 - }), r = this.agent != null, i = e.tools != null && e.tools.length > 0, a, o; - if (i && r) t.push({ - type: `other`, - message: `google.interactions: tools are not supported when an agent is set; tools will be omitted from the request body.` - }); - else if (i) { - let n = an$3({ - tools: e.tools, - toolChoice: e.toolChoice - }); - a = n.tools, o = n.toolChoice, t.push(...n.toolWarnings); - } - let s = []; - if (e.responseFormat?.type === `json`) if (r) t.push({ - type: `other`, - message: `google.interactions: structured output (responseFormat) is not supported when an agent is set; responseFormat will be ignored.` - }); - else { - let t = { - type: `text`, - mime_type: `application/json`, - ...e.responseFormat.schema == null ? {} : { schema: e.responseFormat.schema } - }; - s.push(t); - } - if (n?.responseFormat != null) for (let e of n.responseFormat) e.type === `text` ? s.push(Q$4({ - type: `text`, - mime_type: e.mimeType ?? void 0, - schema: e.schema ?? void 0 - })) : e.type === `image` ? s.push(Q$4({ - type: `image`, - mime_type: e.mimeType ?? void 0, - aspect_ratio: e.aspectRatio ?? void 0, - image_size: e.imageSize ?? void 0 - })) : e.type === `audio` && s.push(Q$4({ - type: `audio`, - mime_type: e.mimeType ?? void 0 - })); - let { input: c, systemInstruction: l, warnings: d } = Ot$3({ - prompt: e.prompt, - previousInteractionId: n?.previousInteractionId ?? void 0, - store: n?.store ?? void 0, - mediaResolution: n?.mediaResolution ?? void 0 - }); - t.push(...d); - let f = l, p = n?.systemInstruction ?? void 0; - f != null && p != null ? t.push({ - type: `other`, - message: `google.interactions: both AI SDK system message and providerOptions.google.systemInstruction were set; using the AI SDK system message.` - }) : f == null && p != null && (f = p); - let m; - if (r) { - let r = []; - e.temperature != null && r.push(`temperature`), e.topP != null && r.push(`topP`), e.seed != null && r.push(`seed`), e.stopSequences != null && e.stopSequences.length > 0 && r.push(`stopSequences`), e.maxOutputTokens != null && r.push(`maxOutputTokens`), n?.thinkingLevel != null && r.push(`thinkingLevel`), n?.thinkingSummaries != null && r.push(`thinkingSummaries`), n?.imageConfig != null && r.push(`imageConfig`), r.length > 0 && t.push({ - type: `other`, - message: `google.interactions: ${r.join(`, `)} ${r.length === 1 ? `is` : `are`} not supported when an agent is set; use providerOptions.google.agentConfig instead. Dropped from the request body.` - }), m = void 0; - } else if (m = Q$4({ - temperature: e.temperature ?? void 0, - top_p: e.topP ?? void 0, - seed: e.seed ?? void 0, - stop_sequences: e.stopSequences != null && e.stopSequences.length > 0 ? e.stopSequences : void 0, - max_output_tokens: e.maxOutputTokens ?? void 0, - thinking_level: n?.thinkingLevel ?? void 0, - thinking_summaries: n?.thinkingSummaries ?? void 0, - tool_choice: o - }), n?.imageConfig != null) { - let e = s.some((e) => e.type === `image`); - t.push({ - type: `other`, - message: e ? `google.interactions: providerOptions.google.imageConfig is deprecated and was ignored because providerOptions.google.responseFormat already supplies an image entry. Use responseFormat exclusively.` : `google.interactions: providerOptions.google.imageConfig is deprecated. Use providerOptions.google.responseFormat with a { type: "image", ... } entry instead.` - }), e || s.push({ - type: `image`, - mime_type: `image/png`, - ...n.imageConfig.aspectRatio == null ? {} : { aspect_ratio: n.imageConfig.aspectRatio }, - ...n.imageConfig.imageSize == null ? {} : { image_size: n.imageConfig.imageSize } - }); - } - let h; - if (r && n?.agentConfig != null) { - let e = n.agentConfig; - e.type === `deep-research` ? h = Q$4({ - type: `deep-research`, - thinking_summaries: e.thinkingSummaries ?? void 0, - visualization: e.visualization ?? void 0, - collaborative_planning: e.collaborativePlanning ?? void 0 - }) : e.type === `dynamic` && (h = { type: `dynamic` }); - } - let g; - if (n?.environment != null) if (!r) t.push({ - type: `other`, - message: `google.interactions: environment is only supported when an agent is set; environment will be omitted from the request body.` - }); - else if (typeof n.environment == `string`) g = n.environment; - else { - let e = n.environment, t = e.sources?.map((e) => e.type === `inline` ? { - type: `inline`, - content: e.content, - target: e.target - } : Q$4({ - type: e.type, - source: e.source, - target: e.target ?? void 0 - })), r; - e.network === `disabled` ? r = `disabled` : e.network != null && (r = { allowlist: e.network.allowlist.map((e) => Q$4({ - domain: e.domain, - transform: e.transform ?? void 0 - })) }), g = Q$4({ - type: `remote`, - sources: t != null && t.length > 0 ? t : void 0, - network: r - }); - } - return { - args: Q$4({ - ...r ? { agent: this.agent } : { model: this.modelId }, - input: c, - system_instruction: f, - tools: a, - response_format: s.length > 0 ? s : void 0, - response_modalities: n?.responseModalities == null ? void 0 : n.responseModalities, - previous_interaction_id: n?.previousInteractionId ?? void 0, - service_tier: n?.serviceTier ?? void 0, - store: n?.store ?? void 0, - generation_config: m != null && Object.keys(m).length > 0 ? m : void 0, - agent_config: h, - environment: g, - background: n?.background ?? void 0 - }), - warnings: t, - isAgent: r, - isBackground: n?.background === !0, - pollingTimeoutMs: n?.pollingTimeoutMs ?? void 0 - }; - } - async doGenerate(e) { - let { args: t, warnings: n, isAgent: r, pollingTimeoutMs: a } = await this.getArgs(e), o = `${this.config.baseURL}/interactions`, s = Pc(this.config.headers ? await hd(this.config.headers) : void 0, e.headers), { responseHeaders: c, value: l, rawValue: u } = await sd({ - url: o, - headers: s, - body: t, - failedResponseHandler: H$3, - successfulResponseHandler: bd(X$4), - abortSignal: e.abortSignal, - fetch: this.config.fetch - }); - if (r && !$t$3(l.status)) { - let t = await rn$3({ - baseURL: this.config.baseURL, - interactionId: l.id, - headers: s, - fetch: this.config.fetch, - abortSignal: e.abortSignal, - timeoutMs: a - }); - l = t.response, u = t.rawResponse, c = t.responseHeaders ?? c; - } - let d = typeof l.id == `string` && l.id.length > 0 ? l.id : void 0, { content: f, hasFunctionCall: p } = Yt$3({ - steps: l.steps ?? null, - generateId: this.config.generateId ?? bl, - interactionId: d - }), m = { - unified: J$3({ - status: l.status, - hasFunctionCall: p - }), - raw: l.status - }, h = l.service_tier ?? c?.[`x-gemini-service-tier`] ?? void 0, g = { google: { - ...d == null ? {} : { interactionId: d }, - ...h == null ? {} : { serviceTier: h } - } }, _; - if (typeof l.created == `string`) { - let e = new Date(l.created); - Number.isNaN(e.getTime()) || (_ = e); - } - return { - content: f, - finishReason: m, - usage: K$3(l.usage), - warnings: n, - providerMetadata: g, - request: { body: t }, - response: { - headers: c, - body: u, - ...d == null ? {} : { id: d }, - ..._ ? { timestamp: _ } : {}, - modelId: l.model ?? void 0 - } - }; - } - async doStream(e) { - let { args: t, warnings: n, isBackground: r, pollingTimeoutMs: a } = await this.getArgs(e), o = `${this.config.baseURL}/interactions`, s = Pc(this.config.headers ? await hd(this.config.headers) : void 0, e.headers); - if (r) return this.doStreamBackground({ - args: t, - warnings: n, - url: o, - mergedHeaders: s, - options: e, - pollingTimeoutMs: a - }); - let c = { - ...t, - stream: !0 - }, { responseHeaders: l, value: u } = await sd({ - url: o, - headers: s, - body: c, - failedResponseHandler: H$3, - successfulResponseHandler: yd(Ut$3), - abortSignal: e.abortSignal, - fetch: this.config.fetch - }), d = l?.[`x-gemini-service-tier`], f = Dt$3({ - warnings: n, - generateId: this.config.generateId ?? bl, - includeRawChunks: e.includeRawChunks, - serviceTier: d - }); - return { - stream: u.pipeThrough(f), - request: { body: c }, - response: { headers: l } - }; - } - async doStreamBackground({ args: e, warnings: t, url: n, mergedHeaders: r, options: i, pollingTimeoutMs: a }) { - let { responseHeaders: o, value: s } = await sd({ - url: n, - headers: r, - body: e, - failedResponseHandler: H$3, - successfulResponseHandler: bd(X$4), - abortSignal: i.abortSignal, - fetch: this.config.fetch - }), c = s.id; - if (c == null || c.length === 0) throw Error(`google.interactions: background POST response did not include an interaction id; cannot stream the result.`); - let l = o?.[`x-gemini-service-tier`]; - if ($t$3(s.status)) return { - stream: ln$3({ - response: s, - warnings: t, - generateId: this.config.generateId ?? bl, - includeRawChunks: i.includeRawChunks, - headerServiceTier: l - }), - request: { body: e }, - response: { headers: o } - }; - let u = cn$3({ - baseURL: this.config.baseURL, - interactionId: c, - headers: r, - fetch: this.config.fetch, - abortSignal: i.abortSignal - }), d = Dt$3({ - warnings: t, - generateId: this.config.generateId ?? bl, - includeRawChunks: i.includeRawChunks, - serviceTier: l - }); - return { - stream: u.pipeThrough(d), - request: { body: e }, - response: { headers: o } - }; - } -}; -function Q$4(e) { - let t = {}; - for (let [n, r] of Object.entries(e)) r !== void 0 && (t[n] = r); - return t; -} -function dn$3(e) { - return typeof e == `object` && !!e && !Array.isArray(e); -} -var fn$3 = class { - constructor() { - this.turnCounter = 0, this.hasAudio = !1, this.hasText = !1, this.hasTranscript = !1, this.turnClosed = !1, this.inputAudioRate = 16e3; - } - get responseId() { - return `google-resp-${this.turnCounter}`; - } - get itemId() { - return `google-item-${this.turnCounter}`; - } - beginTurnIfClosed() { - this.turnClosed &&= (this.turnCounter++, this.hasAudio = !1, this.hasText = !1, this.hasTranscript = !1, !1); - } - parseServerEvent(e) { - let t = e; - return t.setupComplete == null ? t.toolCall == null ? t.toolCallCancellation == null ? t.serverContent == null ? t.inputTranscription?.text == null ? { - type: `custom`, - rawType: String(Object.keys(t)[0]), - raw: e - } : { - type: `input-transcription-completed`, - itemId: `google-input-${this.turnCounter}`, - transcript: t.inputTranscription.text, - raw: e - } : this.parseServerContent(t.serverContent, e) : { - type: `custom`, - rawType: `toolCallCancellation`, - raw: e - } : (this.beginTurnIfClosed(), (t.toolCall.functionCalls ?? []).flatMap((t) => { - let n = JSON.stringify(t.args ?? {}); - return [{ - type: `function-call-arguments-delta`, - responseId: this.responseId, - itemId: this.itemId, - callId: t.id, - delta: n, - raw: e - }, { - type: `function-call-arguments-done`, - responseId: this.responseId, - itemId: this.itemId, - callId: t.id, - name: t.name, - arguments: n, - raw: e - }]; - })) : { - type: `session-created`, - raw: e - }; - } - parseServerContent(e, t) { - let n = []; - if (e.interrupted && n.push({ - type: `speech-started`, - raw: t - }), e.modelTurn?.parts) { - this.beginTurnIfClosed(); - for (let r of e.modelTurn.parts) r.inlineData?.data && (this.hasAudio = !0, n.push({ - type: `audio-delta`, - responseId: this.responseId, - itemId: this.itemId, - delta: r.inlineData.data, - raw: t - })), r.text && (this.hasText = !0, n.push({ - type: `text-delta`, - responseId: this.responseId, - itemId: this.itemId, - delta: r.text, - raw: t - })); - } - return e.outputTranscription?.text && (this.hasTranscript = !0, n.push({ - type: `audio-transcript-delta`, - responseId: this.responseId, - itemId: this.itemId, - delta: e.outputTranscription.text, - raw: t - })), e.inputTranscription?.text && n.push({ - type: `input-transcription-completed`, - itemId: `google-input-${this.turnCounter}`, - transcript: e.inputTranscription.text, - raw: t - }), e.turnComplete && (this.hasAudio && n.push({ - type: `audio-done`, - responseId: this.responseId, - itemId: this.itemId, - raw: t - }), this.hasText && n.push({ - type: `text-done`, - responseId: this.responseId, - itemId: this.itemId, - raw: t - }), this.hasTranscript && n.push({ - type: `audio-transcript-done`, - responseId: this.responseId, - itemId: this.itemId, - raw: t - }), n.push({ - type: `response-done`, - responseId: this.responseId, - status: `completed`, - raw: t - }), this.turnClosed = !0), n.length === 0 ? { - type: `custom`, - rawType: `serverContent`, - raw: t - } : n.length === 1 ? n[0] : n; - } - serializeClientEvent(e, t) { - switch (e.type) { - case `session-update`: return e.config.inputAudioFormat?.rate != null && (this.inputAudioRate = e.config.inputAudioFormat.rate), { setup: mn$3(e.config, t) }; - case `input-audio-append`: return { realtimeInput: { audio: { - data: e.audio, - mimeType: `audio/pcm;rate=${this.inputAudioRate}` - } } }; - case `input-audio-commit`: return { realtimeInput: { audioStreamEnd: !0 } }; - case `input-audio-clear`: - case `response-create`: - case `response-cancel`: - case `conversation-item-truncate`: return null; - case `conversation-item-create`: { - let t = e.item; - switch (t.type) { - case `text-message`: return { realtimeInput: { text: t.text } }; - case `function-call-output`: return pn$3(t); - case `audio-message`: return null; - } - break; - } - } - return null; - } -}; -async function pn$3(e) { - let t = await nd({ text: e.output }), n = t.success ? t.value : {}; - return { toolResponse: { functionResponses: [{ - id: e.callId, - name: e.name, - response: n - }] } }; -} -function mn$3(e, t) { - let n = { model: be$3(t) }, r = {}; - if (e?.outputModalities == null ? r.responseModalities = [`AUDIO`] : r.responseModalities = e.outputModalities.map((e) => e.toUpperCase()), e?.voice != null && (r.speechConfig = { voiceConfig: { prebuiltVoiceConfig: { voiceName: e.voice } } }), n.generationConfig = r, e?.instructions != null && (n.systemInstruction = { parts: [{ text: e.instructions }] }), e?.tools != null && e.tools.length > 0 && (n.tools = [{ functionDeclarations: e.tools.map((e) => ({ - name: e.name, - description: e.description, - parameters: U$3(e.parameters) - })) }]), e?.inputAudioTranscription != null && (n.inputAudioTranscription = {}), e?.outputAudioTranscription != null && (n.outputAudioTranscription = {}), e?.providerOptions == null) return n; - let { google: i, ...a } = e.providerOptions; - Object.assign(n, a); - let o = dn$3(i) ? i : void 0; - return o?.translationConfig != null && (n.generationConfig = { - ...dn$3(n.generationConfig) ? n.generationConfig : r, - translationConfig: o.translationConfig - }), n; -} -var hn$3 = `google.ai.generativelanguage.v1alpha.GenerativeService.BidiGenerateContentConstrained`; -function gn$3(e) { - let t = new URL(e), n = t.pathname.split(`/`), r = n.at(-1); - return (r === `v1beta` || r === `v1alpha`) && (n.pop(), t.pathname = n.join(`/`) || `/`), t; -} -function _n$3(e) { - let t = gn$3(e); - return t.pathname = `${t.pathname.replace(/\/$/, ``)}/v1alpha/auth_tokens`, t.toString(); -} -function vn$3(e) { - let t = gn$3(e); - return t.protocol = t.protocol === `https:` ? `wss:` : `ws:`, t.pathname = `${t.pathname.replace(/\/$/, ``)}/ws/${hn$3}`, t.toString(); -} -var yn$3 = class { - constructor(e, t) { - this.specificationVersion = `v4`, this.mapper = new fn$3(), this.modelId = e, this.provider = t.provider, this.config = t; - } - async doCreateClientSecret(e) { - let t = this.config.fetch ?? fetch, n = this.config.headers()[`x-goog-api-key`]; - if (!n) throw Error(`Google Generative AI API key is required for realtime token creation.`); - let r = Date.now(), i = (e.expiresAfterSeconds ?? 60) * 1e3, a = new Date(r + i).toISOString(), o = new Date(r + i + 1800 * 1e3).toISOString(), s = mn$3(e.sessionConfig, this.modelId), c = await t(`${_n$3(this.config.baseURL)}?key=${encodeURIComponent(n)}`, { - method: `POST`, - headers: { "Content-Type": `application/json` }, - body: JSON.stringify({ - uses: 0, - expireTime: o, - newSessionExpireTime: a, - bidiGenerateContentSetup: s - }) - }); - if (!c.ok) { - let e = await c.text(); - throw Error(`Google realtime auth token request failed: ${c.status} ${e}`); - } - let l = await c.json(); - return { - token: l.name, - url: vn$3(this.config.baseURL), - expiresAt: l.expireTime ? Math.floor(new Date(l.expireTime).getTime() / 1e3) : void 0 - }; - } - getWebSocketConfig(e) { - return { url: `${e.url}?access_token=${encodeURIComponent(e.token)}` }; - } - parseServerEvent(e) { - return this.mapper.parseServerEvent(e); - } - serializeClientEvent(e) { - return this.mapper.serializeClientEvent(e, this.modelId); - } - buildSessionConfig(e) { - return mn$3(e, this.modelId); - } -}; -function $$4(e = {}) { - let t = Ed(e.baseURL) ?? `https://generativelanguage.googleapis.com/v1beta`, n = e.name ?? `google.generative-ai`, r = () => Ol({ - "x-goog-api-key": Pl({ - apiKey: e.apiKey, - environmentVariableName: `GOOGLE_GENERATIVE_AI_API_KEY`, - description: `Google Generative AI` - }), - ...e.headers - }, `ai-sdk/google/${ae$3}`), i = (i) => new Me$3(i, { - provider: n, - baseURL: t, - headers: r, - generateId: e.generateId ?? bl, - supportedUrls: () => ({ "*": [ - RegExp(`^${t}/files/.*$`), - RegExp(`^https://(?:www\\.)?youtube\\.com/watch\\?v=[\\w-]+(?:&[\\w=&.-]*)?$`), - RegExp(`^https://youtu\\.be/[\\w-]+(?:\\?[\\w=&.-]*)?$`) - ] }), - fetch: e.fetch - }), a = (i) => new ce$3(i, { - provider: n, - baseURL: t, - headers: r, - fetch: e.fetch - }), o = (i, a = {}) => new tt$3(i, a, { - provider: n, - baseURL: t, - headers: r, - fetch: e.fetch - }), s = () => new it$3({ - provider: n, - baseURL: t, - headers: r, - fetch: e.fetch - }), c = (i) => new ct$3(i, { - provider: n, - baseURL: t, - headers: r, - fetch: e.fetch, - generateId: e.generateId ?? bl - }), u = (i) => new yn$3(i, { - provider: `${n}.realtime`, - baseURL: t, - headers: r, - fetch: e.fetch - }), d = (i) => new ht$3(i, { - provider: `${n}.speech`, - baseURL: t, - headers: r, - fetch: e.fetch - }), f = Object.assign((e) => u(e), { getToken: async (e) => { - let t = await u(e.model).doCreateClientSecret({ - sessionConfig: e.sessionConfig, - expiresAfterSeconds: e.expiresAfterSeconds - }); - return { - token: t.token, - url: t.url, - expiresAt: t.expiresAt - }; - } }), p = (i) => new un$3(i, { - provider: `${n}.interactions`, - baseURL: t, - headers: r, - generateId: e.generateId ?? bl, - fetch: e.fetch - }), m = function(e) { - if (new.target) throw Error(`The Google Generative AI model function cannot be called with the new keyword.`); - return i(e); - }; - return m.specificationVersion = `v4`, m.languageModel = i, m.chat = i, m.generativeAI = i, m.embedding = a, m.embeddingModel = a, m.textEmbedding = a, m.textEmbeddingModel = a, m.image = o, m.imageModel = o, m.video = c, m.videoModel = c, m.experimental_realtime = f, m.files = s, m.speech = d, m.speechModel = d, m.interactions = p, m.tools = $e$3, m; -} -var bn$3 = $$4(); -//#endregion -//#region node_modules/eve/dist/src/compiled/@ai-sdk/openai/index.js -var openai_exports = /* @__PURE__ */ __exportAll({ - Experimental_OpenAIRealtimeModel: () => Vt$2, - VERSION: () => Mn$2, - createOpenAI: () => Nn$2, - openai: () => Pn$2 -}); -function se$2(e) { - return Wr$2(ao, e); -} -var Y$3 = Co({ error: Co({ - message: Ra$2(), - type: Ra$2().nullish(), - param: ho().nullish(), - code: Eo([Ra$2(), oo()]).nullish() -}) }); -var X$3 = vd({ - errorSchema: Y$3, - errorToMessage: (e) => e.error.message -}); -function ce$2(e) { - let t = e.startsWith(`o3`) || e.startsWith(`o4-mini`) || e.startsWith(`gpt-5`) && !e.startsWith(`gpt-5-chat`), n = e.startsWith(`gpt-4`) || e.startsWith(`gpt-5`) && !e.startsWith(`gpt-5-nano`) && !e.startsWith(`gpt-5-chat`) && !e.startsWith(`gpt-5.4-nano`) || e.startsWith(`o3`) || e.startsWith(`o4-mini`), r = e.startsWith(`o1`) || e.startsWith(`o3`) || e.startsWith(`o4-mini`) || e.startsWith(`gpt-5`) && !e.startsWith(`gpt-5-chat`), i = e.startsWith(`gpt-5.1`) || e.startsWith(`gpt-5.2`) || e.startsWith(`gpt-5.3`) || e.startsWith(`gpt-5.4`) || e.startsWith(`gpt-5.5`); - return { - supportsFlexProcessing: t, - supportsPriorityProcessing: n, - isReasoningModel: r, - systemMessageMode: r ? `developer` : `system`, - supportsNonReasoningParameters: i - }; -} -async function le$2({ stream: e, getError: t, isOutputChunk: n, url: r, requestBodyValues: i, responseHeaders: a }) { - let [o, s] = e.tee(), c = o.getReader(); - try { - for (;;) { - let e = await c.read(); - if (e.done) return s; - let o = e.value; - if (!o.success) return s; - let l = t(o.value); - if (l != null) throw s.cancel().catch(() => {}), ue$2({ - frame: l, - url: r, - requestBodyValues: i, - responseHeaders: a - }); - if (n(o.value)) return s; - } - } finally { - c.cancel().catch(() => {}), c.releaseLock(); - } -} -function ue$2({ frame: t, url: n, requestBodyValues: r, responseHeaders: i }) { - let a = de$2(t); - return new c$14({ - message: a?.message ?? `OpenAI stream failed before any output was generated`, - url: n, - requestBodyValues: r, - statusCode: a == null ? 500 : fe$2(a), - responseHeaders: i, - responseBody: JSON.stringify(t), - data: t - }); -} -function de$2(e) { - let t = Z$3(e); - if (t == null) return; - if (t.type === `response.failed`) { - let n = Z$3(Z$3(t.response)?.error); - return typeof n?.message == `string` ? { - message: n.message, - code: pe$2(n.code), - type: `response.failed`, - frame: e - } : void 0; - } - let n = Z$3(t.error) ?? t; - return typeof n.message == `string` && (Z$3(t.error) != null || typeof n.type == `string` || `code` in n || `param` in n) ? { - message: n.message, - code: pe$2(n.code), - type: typeof n.type == `string` ? n.type : void 0, - frame: e - } : void 0; -} -function fe$2(e) { - if (typeof e.code == `number` && me$2(e.code)) return e.code; - if (typeof e.code == `string` && /^\d{3}$/.test(e.code)) { - let t = Number(e.code); - if (me$2(t)) return t; - } - let t = [e.code, e.type].filter((e) => typeof e == `string` || typeof e == `number`).join(` `).toLowerCase(); - return [`insufficient_quota`, `rate_limit`].some((e) => t.includes(e)) ? 429 : t.includes(`authentication`) ? 401 : t.includes(`permission`) ? 403 : t.includes(`not_found`) ? 404 : [ - `invalid`, - `bad_request`, - `context_length` - ].some((e) => t.includes(e)) ? 400 : t.includes(`overload`) ? 503 : t.includes(`timeout`) ? 504 : 500; -} -function Z$3(e) { - return typeof e == `object` && e ? e : void 0; -} -function pe$2(e) { - return typeof e == `string` || typeof e == `number` ? e : void 0; -} -function me$2(e) { - return Number.isInteger(e) && e >= 400 && e <= 599; -} -function he$2(e) { - if (e == null) return { - inputTokens: { - total: void 0, - noCache: void 0, - cacheRead: void 0, - cacheWrite: void 0 - }, - outputTokens: { - total: void 0, - text: void 0, - reasoning: void 0 - }, - raw: void 0 - }; - let t = e.prompt_tokens ?? 0, n = e.completion_tokens ?? 0, r = e.prompt_tokens_details?.cached_tokens ?? 0, i = e.completion_tokens_details?.reasoning_tokens ?? 0; - return { - inputTokens: { - total: t, - noCache: t - r, - cacheRead: r, - cacheWrite: void 0 - }, - outputTokens: { - total: n, - text: n - i, - reasoning: i - }, - raw: e - }; -} -function ge$2(e) { - return JSON.stringify(e === void 0 ? {} : e); -} -function _e$2({ prompt: e, systemMessageMode: t = `system` }) { - let n = [], i = []; - for (let { role: o, content: s } of e) switch (o) { - case `system`: - switch (t) { - case `system`: - n.push({ - role: `system`, - content: s - }); - break; - case `developer`: - n.push({ - role: `developer`, - content: s - }); - break; - case `remove`: - i.push({ - type: `other`, - message: `system messages are removed for this model` - }); - break; - default: throw Error(`Unsupported system message mode: ${t}`); - } - break; - case `user`: - if (s.length === 1 && s[0].type === `text`) { - n.push({ - role: `user`, - content: s[0].text - }); - break; - } - n.push({ - role: `user`, - content: s.map((e, t) => { - switch (e.type) { - case `text`: return { - type: `text`, - text: e.text - }; - case `file`: switch (e.data.type) { - case `reference`: return { - type: `file`, - file: { file_id: _d({ - reference: e.data.reference, - provider: `openai` - }) } - }; - case `text`: throw new Ie$10({ functionality: `text file parts` }); - case `url`: - case `data`: { - let n = el(e.mediaType); - if (n === `image`) return { - type: `image_url`, - image_url: { - url: e.data.type === `url` ? e.data.url.toString() : zc(e.data.data), - detail: e.providerOptions?.openai?.imageDetail - } - }; - if (n === `audio`) { - if (e.data.type === `url`) throw new Ie$10({ functionality: `audio file parts with URLs` }); - let t = gd({ part: e }); - switch (t) { - case `audio/wav`: return { - type: `input_audio`, - input_audio: { - data: zc(e.data.data), - format: `wav` - } - }; - case `audio/mp3`: - case `audio/mpeg`: return { - type: `input_audio`, - input_audio: { - data: zc(e.data.data), - format: `mp3` - } - }; - default: throw new Ie$10({ functionality: `audio content parts with media type ${t}` }); - } - } - { - let n = gd({ part: e }); - if (n !== `application/pdf`) throw new Ie$10({ functionality: `file part media type ${n}` }); - if (e.data.type === `url`) throw new Ie$10({ functionality: `PDF file parts with URLs` }); - return { - type: `file`, - file: { - filename: e.filename ?? `part-${t}.pdf`, - file_data: `data:application/pdf;base64,${zc(e.data.data)}` - } - }; - } - } - } - } - }) - }); - break; - case `assistant`: { - let e = ``, t = []; - for (let n of s) switch (n.type) { - case `text`: - e += n.text; - break; - case `tool-call`: - t.push({ - id: n.toolCallId, - type: `function`, - function: { - name: n.toolName, - arguments: ge$2(n.input) - } - }); - break; - } - n.push({ - role: `assistant`, - content: t.length > 0 ? e || null : e, - tool_calls: t.length > 0 ? t : void 0 - }); - break; - } - case `tool`: - for (let e of s) { - if (e.type === `tool-approval-response`) continue; - let t = e.output, r; - switch (t.type) { - case `text`: - case `error-text`: - r = t.value; - break; - case `execution-denied`: - r = t.reason ?? `Tool call execution denied.`; - break; - case `content`: - case `json`: - case `error-json`: - r = JSON.stringify(t.value); - break; - } - n.push({ - role: `tool`, - tool_call_id: e.toolCallId, - content: r - }); - } - break; - default: throw Error(`Unsupported role: ${o}`); - } - return { - messages: n, - warnings: i - }; -} -function ve$2({ id: e, model: t, created: n }) { - return { - id: e ?? void 0, - modelId: t ?? void 0, - timestamp: n ? /* @__PURE__ */ new Date(n * 1e3) : void 0 - }; -} -function ye$2(e) { - switch (e) { - case `stop`: return `stop`; - case `length`: return `length`; - case `content_filter`: return `content-filter`; - case `function_call`: - case `tool_calls`: return `tool-calls`; - default: return `other`; - } -} -var be$2 = Wu(() => Qu(Co({ - id: Ra$2().nullish(), - created: oo().nullish(), - model: Ra$2().nullish(), - choices: xo(Co({ - message: Co({ - role: Ro(`assistant`).nullish(), - content: Ra$2().nullish(), - tool_calls: xo(Co({ - id: Ra$2().nullish(), - type: Ro(`function`), - function: Co({ - name: Ra$2(), - arguments: Ra$2() - }) - })).nullish(), - annotations: xo(Co({ - type: Ro(`url_citation`), - url_citation: Co({ - start_index: oo(), - end_index: oo(), - url: Ra$2(), - title: Ra$2() - }) - })).nullish() - }), - index: oo(), - logprobs: Co({ content: xo(Co({ - token: Ra$2(), - logprob: oo(), - top_logprobs: xo(Co({ - token: Ra$2(), - logprob: oo() - })) - })).nullish() }).nullish(), - finish_reason: Ra$2().nullish() - })), - usage: Co({ - prompt_tokens: oo().nullish(), - completion_tokens: oo().nullish(), - total_tokens: oo().nullish(), - prompt_tokens_details: Co({ cached_tokens: oo().nullish() }).nullish(), - completion_tokens_details: Co({ - reasoning_tokens: oo().nullish(), - accepted_prediction_tokens: oo().nullish(), - rejected_prediction_tokens: oo().nullish() - }).nullish() - }).nullish() -}))); -var xe$2 = Wu(() => Qu(Eo([Co({ - id: Ra$2().nullish(), - created: oo().nullish(), - model: Ra$2().nullish(), - choices: xo(Co({ - delta: Co({ - role: Io([`assistant`]).nullish(), - content: Ra$2().nullish(), - tool_calls: xo(Co({ - index: oo(), - id: Ra$2().nullish(), - type: Ro(`function`).nullish(), - function: Co({ - name: Ra$2().nullish(), - arguments: Ra$2().nullish() - }) - })).nullish(), - annotations: xo(Co({ - type: Ro(`url_citation`), - url_citation: Co({ - start_index: oo(), - end_index: oo(), - url: Ra$2(), - title: Ra$2() - }) - })).nullish() - }).nullish(), - logprobs: Co({ content: xo(Co({ - token: Ra$2(), - logprob: oo(), - top_logprobs: xo(Co({ - token: Ra$2(), - logprob: oo() - })) - })).nullish() }).nullish(), - finish_reason: Ra$2().nullish(), - index: oo() - })), - usage: Co({ - prompt_tokens: oo().nullish(), - completion_tokens: oo().nullish(), - total_tokens: oo().nullish(), - prompt_tokens_details: Co({ cached_tokens: oo().nullish() }).nullish(), - completion_tokens_details: Co({ - reasoning_tokens: oo().nullish(), - accepted_prediction_tokens: oo().nullish(), - rejected_prediction_tokens: oo().nullish() - }).nullish() - }).nullish() -}), Y$3]))); -var Se$2 = Wu(() => Qu(Co({ - logitBias: Po(se$2(), oo()).optional(), - logprobs: Eo([uo(), oo()]).optional(), - parallelToolCalls: uo().optional(), - user: Ra$2().optional(), - reasoningEffort: Io([ - `none`, - `minimal`, - `low`, - `medium`, - `high`, - `xhigh` - ]).optional(), - maxCompletionTokens: oo().optional(), - store: uo().optional(), - metadata: Po(Ra$2().max(64), Ra$2().max(512)).optional(), - prediction: Po(Ra$2(), ho()).optional(), - serviceTier: Io([ - `auto`, - `flex`, - `priority`, - `default` - ]).optional(), - strictJsonSchema: uo().optional(), - textVerbosity: Io([ - `low`, - `medium`, - `high` - ]).optional(), - promptCacheKey: Ra$2().optional(), - promptCacheRetention: Io([`in_memory`, `24h`]).optional(), - safetyIdentifier: Ra$2().optional(), - systemMessageMode: Io([ - `system`, - `developer`, - `remove` - ]).optional(), - forceReasoning: uo().optional() -}))); -function Ce$2({ tools: e, toolChoice: t }) { - e = e?.length ? e : void 0; - let n = []; - if (e == null) return { - tools: void 0, - toolChoice: void 0, - toolWarnings: n - }; - let i = []; - for (let t of e) switch (t.type) { - case `function`: - i.push({ - type: `function`, - function: { - name: t.name, - description: t.description, - parameters: t.inputSchema, - ...t.strict == null ? {} : { strict: t.strict } - } - }); - break; - default: - n.push({ - type: `unsupported`, - feature: `tool type: ${t.type}` - }); - break; - } - if (t == null) return { - tools: i, - toolChoice: void 0, - toolWarnings: n - }; - let a = t.type; - switch (a) { - case `auto`: - case `none`: - case `required`: return { - tools: i, - toolChoice: a, - toolWarnings: n - }; - case `tool`: return { - tools: i, - toolChoice: { - type: `function`, - function: { name: t.toolName } - }, - toolWarnings: n - }; - default: throw new Ie$10({ functionality: `tool choice type: ${a}` }); - } -} -var we$2 = class e { - constructor(e, t) { - this.specificationVersion = `v4`, this.supportedUrls = { "image/*": [/^https?:\/\/.*$/] }, this.modelId = e, this.config = t; - } - static [Mc](e) { - return Cd({ - modelId: e.modelId, - config: e.config - }); - } - static [Nc](t) { - return new e(t.modelId, t.config); - } - get provider() { - return this.config.provider; - } - async getArgs({ prompt: e, maxOutputTokens: t, temperature: n, topP: r, topK: i, frequencyPenalty: a, presencePenalty: o, stopSequences: s, responseFormat: c, seed: l, tools: u, toolChoice: d, reasoning: p, providerOptions: m }) { - let h = [], _ = await ad({ - provider: `openai`, - providerOptions: m, - schema: Se$2 - }) ?? {}, v = ce$2(this.modelId), y = _.reasoningEffort ?? (Il(p) ? p : void 0), b = _.forceReasoning ?? v.isReasoningModel; - i != null && h.push({ - type: `unsupported`, - feature: `topK` - }); - let { messages: x, warnings: S } = _e$2({ - prompt: e, - systemMessageMode: _.systemMessageMode ?? (b ? `developer` : v.systemMessageMode) - }); - h.push(...S); - let C = _.strictJsonSchema ?? !0, w = { - model: this.modelId, - logit_bias: _.logitBias, - logprobs: _.logprobs === !0 || typeof _.logprobs == `number` ? !0 : void 0, - top_logprobs: typeof _.logprobs == `number` ? _.logprobs : typeof _.logprobs == `boolean` && _.logprobs ? 0 : void 0, - user: _.user, - parallel_tool_calls: _.parallelToolCalls, - max_tokens: t, - temperature: n, - top_p: r, - frequency_penalty: a, - presence_penalty: o, - response_format: c?.type === `json` ? c.schema == null ? { type: `json_object` } : { - type: `json_schema`, - json_schema: { - schema: c.schema, - strict: C, - name: c.name ?? `response`, - description: c.description - } - } : void 0, - stop: s, - seed: l, - verbosity: _.textVerbosity, - max_completion_tokens: _.maxCompletionTokens, - store: _.store, - metadata: _.metadata, - prediction: _.prediction, - reasoning_effort: y, - service_tier: _.serviceTier, - prompt_cache_key: _.promptCacheKey, - prompt_cache_retention: _.promptCacheRetention, - safety_identifier: _.safetyIdentifier, - messages: x - }; - b ? ((y !== `none` || !v.supportsNonReasoningParameters) && (w.temperature != null && (w.temperature = void 0, h.push({ - type: `unsupported`, - feature: `temperature`, - details: `temperature is not supported for reasoning models` - })), w.top_p != null && (w.top_p = void 0, h.push({ - type: `unsupported`, - feature: `topP`, - details: `topP is not supported for reasoning models` - })), w.logprobs != null && (w.logprobs = void 0, h.push({ - type: `other`, - message: `logprobs is not supported for reasoning models` - }))), w.frequency_penalty != null && (w.frequency_penalty = void 0, h.push({ - type: `unsupported`, - feature: `frequencyPenalty`, - details: `frequencyPenalty is not supported for reasoning models` - })), w.presence_penalty != null && (w.presence_penalty = void 0, h.push({ - type: `unsupported`, - feature: `presencePenalty`, - details: `presencePenalty is not supported for reasoning models` - })), w.logit_bias != null && (w.logit_bias = void 0, h.push({ - type: `other`, - message: `logitBias is not supported for reasoning models` - })), w.top_logprobs != null && (w.top_logprobs = void 0, h.push({ - type: `other`, - message: `topLogprobs is not supported for reasoning models` - })), w.max_tokens != null && (w.max_completion_tokens ??= w.max_tokens, w.max_tokens = void 0)) : (this.modelId.startsWith(`gpt-4o-search-preview`) || this.modelId.startsWith(`gpt-4o-mini-search-preview`)) && w.temperature != null && (w.temperature = void 0, h.push({ - type: `unsupported`, - feature: `temperature`, - details: `temperature is not supported for the search preview models and has been removed.` - })), _.serviceTier === `flex` && !v.supportsFlexProcessing && (h.push({ - type: `unsupported`, - feature: `serviceTier`, - details: `flex processing is only available for o3, o4-mini, and gpt-5 models` - }), w.service_tier = void 0), _.serviceTier === `priority` && !v.supportsPriorityProcessing && (h.push({ - type: `unsupported`, - feature: `serviceTier`, - details: `priority processing is only available for supported models (gpt-4, gpt-5, gpt-5-mini, o3, o4-mini) and requires Enterprise access. gpt-5-nano is not supported` - }), w.service_tier = void 0); - let { tools: T, toolChoice: E, toolWarnings: D } = Ce$2({ - tools: u, - toolChoice: d - }); - return { - args: { - ...w, - tools: T, - tool_choice: E - }, - warnings: [...h, ...D] - }; - } - async doGenerate(e) { - var t; - let { args: n, warnings: r } = await this.getArgs(e), { responseHeaders: i, value: a, rawValue: o } = await sd({ - url: this.config.url({ - path: `/chat/completions`, - modelId: this.modelId - }), - headers: Pc((t = this.config).headers?.call(t), e.headers), - body: n, - failedResponseHandler: X$3, - successfulResponseHandler: bd(be$2), - abortSignal: e.abortSignal, - fetch: this.config.fetch - }), s = a.choices[0], c = [], l = s.message.content; - l != null && l.length > 0 && c.push({ - type: `text`, - text: l - }); - for (let e of s.message.tool_calls ?? []) c.push({ - type: `tool-call`, - toolCallId: e.id ?? bl(), - toolName: e.function.name, - input: e.function.arguments - }); - for (let e of s.message.annotations ?? []) c.push({ - type: `source`, - sourceType: `url`, - id: bl(), - url: e.url_citation.url, - title: e.url_citation.title - }); - let u = a.usage?.completion_tokens_details, d = { openai: {} }; - return u?.accepted_prediction_tokens != null && (d.openai.acceptedPredictionTokens = u?.accepted_prediction_tokens), u?.rejected_prediction_tokens != null && (d.openai.rejectedPredictionTokens = u?.rejected_prediction_tokens), s.logprobs?.content != null && (d.openai.logprobs = s.logprobs.content), { - content: c, - finishReason: { - unified: ye$2(s.finish_reason), - raw: s.finish_reason ?? void 0 - }, - usage: he$2(a.usage), - request: { body: n }, - response: { - ...ve$2(a), - headers: i, - body: o - }, - warnings: r, - providerMetadata: d - }; - } - async doStream(e) { - var t; - let { args: n, warnings: r } = await this.getArgs(e), i = { - ...n, - stream: !0, - stream_options: { include_usage: !0 } - }, a = this.config.url({ - path: `/chat/completions`, - modelId: this.modelId - }), { responseHeaders: o, value: s } = await sd({ - url: a, - headers: Pc((t = this.config).headers?.call(t), e.headers), - body: i, - failedResponseHandler: X$3, - successfulResponseHandler: yd(xe$2), - abortSignal: e.abortSignal, - fetch: this.config.fetch - }), c = await le$2({ - stream: s, - getError: (e) => `error` in e ? e.error : void 0, - isOutputChunk: Te$2, - url: a, - requestBodyValues: i, - responseHeaders: o - }), l, u = { - unified: `other`, - raw: void 0 - }, d, f = !1, p = !1, m = { openai: {} }; - return { - stream: c.pipeThrough(new TransformStream({ - start(e) { - l = new Td(e, { - generateId: bl, - typeValidation: `if-present` - }), e.enqueue({ - type: `stream-start`, - warnings: r - }); - }, - transform(t, n) { - if (e.includeRawChunks && n.enqueue({ - type: `raw`, - rawValue: t.rawValue - }), !t.success) { - u = { - unified: `error`, - raw: void 0 - }, n.enqueue({ - type: `error`, - error: t.error - }); - return; - } - let r = t.value; - if (`error` in r) { - u = { - unified: `error`, - raw: void 0 - }, n.enqueue({ - type: `error`, - error: r.error - }); - return; - } - if (!f) { - let e = ve$2(r); - Object.values(e).some(Boolean) && (f = !0, n.enqueue({ - type: `response-metadata`, - ...ve$2(r) - })); - } - r.usage != null && (d = r.usage, r.usage.completion_tokens_details?.accepted_prediction_tokens != null && (m.openai.acceptedPredictionTokens = r.usage.completion_tokens_details?.accepted_prediction_tokens), r.usage.completion_tokens_details?.rejected_prediction_tokens != null && (m.openai.rejectedPredictionTokens = r.usage.completion_tokens_details?.rejected_prediction_tokens)); - let i = r.choices[0]; - if (i?.finish_reason != null && (u = { - unified: ye$2(i.finish_reason), - raw: i.finish_reason - }), i?.logprobs?.content != null && (m.openai.logprobs = i.logprobs.content), i?.delta == null) return; - let a = i.delta; - if (a.content != null && (p ||= (n.enqueue({ - type: `text-start`, - id: `0` - }), !0), n.enqueue({ - type: `text-delta`, - id: `0`, - delta: a.content - })), a.tool_calls != null) for (let e of a.tool_calls) l.processDelta(e); - if (a.annotations != null) for (let e of a.annotations) n.enqueue({ - type: `source`, - sourceType: `url`, - id: bl(), - url: e.url_citation.url, - title: e.url_citation.title - }); - }, - flush(e) { - p && e.enqueue({ - type: `text-end`, - id: `0` - }), l.flush(), e.enqueue({ - type: `finish`, - finishReason: u, - usage: he$2(d), - ...m == null ? {} : { providerMetadata: m } - }); - } - })), - request: { body: i }, - response: { headers: o } - }; - } -}; -function Te$2(e) { - return `error` in e ? !1 : e.choices.some((e) => { - let t = e.delta; - return t?.content != null && t.content.length > 0 || t?.tool_calls != null && t.tool_calls.length > 0 || t?.annotations != null && t.annotations.length > 0; - }); -} -function Ee$2(e) { - if (e == null) return { - inputTokens: { - total: void 0, - noCache: void 0, - cacheRead: void 0, - cacheWrite: void 0 - }, - outputTokens: { - total: void 0, - text: void 0, - reasoning: void 0 - }, - raw: void 0 - }; - let t = e.prompt_tokens ?? 0, n = e.completion_tokens ?? 0; - return { - inputTokens: { - total: e.prompt_tokens ?? void 0, - noCache: t, - cacheRead: void 0, - cacheWrite: void 0 - }, - outputTokens: { - total: e.completion_tokens ?? void 0, - text: n, - reasoning: void 0 - }, - raw: e - }; -} -function De$2({ prompt: e, user: n = `user`, assistant: i = `assistant` }) { - let a = ``; - e[0].role === `system` && (a += `${e[0].content} - -`, e = e.slice(1)); - for (let { role: o, content: s } of e) switch (o) { - case `system`: throw new se$11({ - message: "Unexpected system message in prompt: ${content}", - prompt: e - }); - case `user`: { - let e = s.map((e) => { - switch (e.type) { - case `text`: return e.text; - } - }).filter(Boolean).join(``); - a += `${n}: -${e} - -`; - break; - } - case `assistant`: { - let e = s.map((e) => { - switch (e.type) { - case `text`: return e.text; - case `tool-call`: throw new Ie$10({ functionality: `tool-call messages` }); - } - }).join(``); - a += `${i}: -${e} - -`; - break; - } - case `tool`: throw new Ie$10({ functionality: `tool messages` }); - default: throw Error(`Unsupported role: ${o}`); - } - return a += `${i}: -`, { - prompt: a, - stopSequences: [` -${n}:`] - }; -} -function Oe$2({ id: e, model: t, created: n }) { - return { - id: e ?? void 0, - modelId: t ?? void 0, - timestamp: n == null ? void 0 : /* @__PURE__ */ new Date(n * 1e3) - }; -} -function ke$2(e) { - switch (e) { - case `stop`: return `stop`; - case `length`: return `length`; - case `content_filter`: return `content-filter`; - case `function_call`: - case `tool_calls`: return `tool-calls`; - default: return `other`; - } -} -var Ae$2 = Wu(() => Qu(Co({ - id: Ra$2().nullish(), - created: oo().nullish(), - model: Ra$2().nullish(), - choices: xo(Co({ - text: Ra$2(), - finish_reason: Ra$2(), - logprobs: Co({ - tokens: xo(Ra$2()), - token_logprobs: xo(oo()), - top_logprobs: xo(Po(Ra$2(), oo())).nullish() - }).nullish() - })), - usage: Co({ - prompt_tokens: oo(), - completion_tokens: oo(), - total_tokens: oo() - }).nullish() -}))); -var je$2 = Wu(() => Qu(Eo([Co({ - id: Ra$2().nullish(), - created: oo().nullish(), - model: Ra$2().nullish(), - choices: xo(Co({ - text: Ra$2(), - finish_reason: Ra$2().nullish(), - index: oo(), - logprobs: Co({ - tokens: xo(Ra$2()), - token_logprobs: xo(oo()), - top_logprobs: xo(Po(Ra$2(), oo())).nullish() - }).nullish() - })), - usage: Co({ - prompt_tokens: oo(), - completion_tokens: oo(), - total_tokens: oo() - }).nullish() -}), Y$3]))); -var Me$2 = Wu(() => Qu(Co({ - echo: uo().optional(), - logitBias: Po(Ra$2(), oo()).optional(), - suffix: Ra$2().optional(), - user: Ra$2().optional(), - logprobs: Eo([uo(), oo()]).optional() -}))); -var Ne$2 = class e { - constructor(e, t) { - this.specificationVersion = `v4`, this.supportedUrls = {}, this.modelId = e, this.config = t; - } - get providerOptionsName() { - return this.config.provider.split(`.`)[0].trim(); - } - static [Mc](e) { - return Cd({ - modelId: e.modelId, - config: e.config - }); - } - static [Nc](t) { - return new e(t.modelId, t.config); - } - get provider() { - return this.config.provider; - } - async getArgs({ prompt: e, maxOutputTokens: t, temperature: n, topP: r, topK: i, frequencyPenalty: a, presencePenalty: o, stopSequences: s, responseFormat: c, tools: l, toolChoice: u, seed: d, providerOptions: p }) { - let m = [], h = { - ...await ad({ - provider: `openai`, - providerOptions: p, - schema: Me$2 - }), - ...await ad({ - provider: this.providerOptionsName, - providerOptions: p, - schema: Me$2 - }) - }; - i != null && m.push({ - type: `unsupported`, - feature: `topK` - }), l?.length && m.push({ - type: `unsupported`, - feature: `tools` - }), u != null && m.push({ - type: `unsupported`, - feature: `toolChoice` - }), c != null && c.type !== `text` && m.push({ - type: `unsupported`, - feature: `responseFormat`, - details: `JSON response format is not supported.` - }); - let { prompt: g, stopSequences: _ } = De$2({ prompt: e }), v = [..._ ?? [], ...s ?? []]; - return { - args: { - model: this.modelId, - echo: h.echo, - logit_bias: h.logitBias, - logprobs: h?.logprobs === !0 ? 0 : h?.logprobs === !1 ? void 0 : h?.logprobs, - suffix: h.suffix, - user: h.user, - max_tokens: t, - temperature: n, - top_p: r, - frequency_penalty: a, - presence_penalty: o, - seed: d, - prompt: g, - stop: v.length > 0 ? v : void 0 - }, - warnings: m - }; - } - async doGenerate(e) { - var t; - let { args: n, warnings: r } = await this.getArgs(e), { responseHeaders: i, value: a, rawValue: o } = await sd({ - url: this.config.url({ - path: `/completions`, - modelId: this.modelId - }), - headers: Pc((t = this.config).headers?.call(t), e.headers), - body: n, - failedResponseHandler: X$3, - successfulResponseHandler: bd(Ae$2), - abortSignal: e.abortSignal, - fetch: this.config.fetch - }), s = a.choices[0], c = { openai: {} }; - return s.logprobs != null && (c.openai.logprobs = s.logprobs), { - content: [{ - type: `text`, - text: s.text - }], - usage: Ee$2(a.usage), - finishReason: { - unified: ke$2(s.finish_reason), - raw: s.finish_reason ?? void 0 - }, - request: { body: n }, - response: { - ...Oe$2(a), - headers: i, - body: o - }, - providerMetadata: c, - warnings: r - }; - } - async doStream(e) { - var t; - let { args: n, warnings: r } = await this.getArgs(e), i = { - ...n, - stream: !0, - stream_options: { include_usage: !0 } - }, a = this.config.url({ - path: `/completions`, - modelId: this.modelId - }), { responseHeaders: o, value: s } = await sd({ - url: a, - headers: Pc((t = this.config).headers?.call(t), e.headers), - body: i, - failedResponseHandler: X$3, - successfulResponseHandler: yd(je$2), - abortSignal: e.abortSignal, - fetch: this.config.fetch - }), c = await le$2({ - stream: s, - getError: (e) => `error` in e ? e.error : void 0, - isOutputChunk: Pe$2, - url: a, - requestBodyValues: i, - responseHeaders: o - }), l = { - unified: `other`, - raw: void 0 - }, u = { openai: {} }, d, f = !0; - return { - stream: c.pipeThrough(new TransformStream({ - start(e) { - e.enqueue({ - type: `stream-start`, - warnings: r - }); - }, - transform(t, n) { - if (e.includeRawChunks && n.enqueue({ - type: `raw`, - rawValue: t.rawValue - }), !t.success) { - l = { - unified: `error`, - raw: void 0 - }, n.enqueue({ - type: `error`, - error: t.error - }); - return; - } - let r = t.value; - if (`error` in r) { - l = { - unified: `error`, - raw: void 0 - }, n.enqueue({ - type: `error`, - error: r.error - }); - return; - } - f && (f = !1, n.enqueue({ - type: `response-metadata`, - ...Oe$2(r) - }), n.enqueue({ - type: `text-start`, - id: `0` - })), r.usage != null && (d = r.usage); - let i = r.choices[0]; - i?.finish_reason != null && (l = { - unified: ke$2(i.finish_reason), - raw: i.finish_reason - }), i?.logprobs != null && (u.openai.logprobs = i.logprobs), i?.text != null && i.text.length > 0 && n.enqueue({ - type: `text-delta`, - id: `0`, - delta: i.text - }); - }, - flush(e) { - f || e.enqueue({ - type: `text-end`, - id: `0` - }), e.enqueue({ - type: `finish`, - finishReason: l, - providerMetadata: u, - usage: Ee$2(d) - }); - } - })), - request: { body: i }, - response: { headers: o } - }; - } -}; -function Pe$2(e) { - return !(`error` in e) && e.choices.some((e) => e.text.length > 0); -} -var Fe$2 = Wu(() => Qu(Co({ - dimensions: oo().optional(), - user: Ra$2().optional() -}))); -var Ie$2 = Wu(() => Qu(Co({ - data: xo(Co({ embedding: xo(oo()) })), - usage: Co({ prompt_tokens: oo() }).nullish() -}))); -var Le$2 = class e { - constructor(e, t) { - this.specificationVersion = `v4`, this.maxEmbeddingsPerCall = 2048, this.supportsParallelCalls = !0, this.modelId = e, this.config = t; - } - static [Mc](e) { - return Cd({ - modelId: e.modelId, - config: e.config - }); - } - static [Nc](t) { - return new e(t.modelId, t.config); - } - get provider() { - return this.config.provider; - } - async doEmbed({ values: e, headers: t, abortSignal: r, providerOptions: i }) { - var a; - if (e.length > this.maxEmbeddingsPerCall) throw new Te$10({ - provider: this.provider, - modelId: this.modelId, - maxEmbeddingsPerCall: this.maxEmbeddingsPerCall, - values: e - }); - let o = await ad({ - provider: `openai`, - providerOptions: i, - schema: Fe$2 - }) ?? {}, { responseHeaders: s, value: c, rawValue: l } = await sd({ - url: this.config.url({ - path: `/embeddings`, - modelId: this.modelId - }), - headers: Pc((a = this.config).headers?.call(a), t), - body: { - model: this.modelId, - input: e, - encoding_format: `float`, - dimensions: o.dimensions, - user: o.user - }, - failedResponseHandler: X$3, - successfulResponseHandler: bd(Ie$2), - abortSignal: r, - fetch: this.config.fetch - }); - return { - warnings: [], - embeddings: c.data.map((e) => e.embedding), - usage: c.usage ? { tokens: c.usage.prompt_tokens } : void 0, - response: { - headers: s, - body: l - } - }; - } -}; -var Re$2 = Wu(() => Qu(Co({ - id: Ra$2(), - object: Ra$2().nullish(), - bytes: oo().nullish(), - created_at: oo().nullish(), - filename: Ra$2().nullish(), - purpose: Ra$2().nullish(), - status: Ra$2().nullish(), - expires_at: oo().nullish() -}))); -var ze$2 = Wu(() => Qu(Co({ - purpose: Ra$2().optional(), - expiresAfter: oo().optional() -}))); -var Be$2 = class { - constructor(e) { - this.config = e, this.specificationVersion = `v4`; - } - get provider() { - return this.config.provider; - } - async uploadFile({ data: e, mediaType: t, filename: n, providerOptions: r }) { - let i = await ad({ - provider: `openai`, - providerOptions: r, - schema: ze$2 - }), a = Bc(e), o = new Blob([a], { type: t }), s = new FormData(); - n == null ? s.append(`file`, o) : s.append(`file`, o, n), s.append(`purpose`, i?.purpose ?? `assistants`), i?.expiresAfter != null && s.append(`expires_after`, String(i.expiresAfter)); - let { value: c } = await cd({ - url: `${this.config.baseURL}/files`, - headers: Pc(this.config.headers()), - formData: s, - failedResponseHandler: X$3, - successfulResponseHandler: bd(Re$2), - fetch: this.config.fetch - }); - return { - warnings: [], - providerReference: { openai: c.id }, - ...c.filename ?? n ? { filename: c.filename ?? n } : {}, - ...t == null ? {} : { mediaType: t }, - providerMetadata: { openai: { - ...c.filename == null ? {} : { filename: c.filename }, - ...c.purpose == null ? {} : { purpose: c.purpose }, - ...c.bytes == null ? {} : { bytes: c.bytes }, - ...c.created_at == null ? {} : { createdAt: c.created_at }, - ...c.status == null ? {} : { status: c.status }, - ...c.expires_at == null ? {} : { expiresAt: c.expires_at } - } } - }; - } -}; -var Ve$2 = Wu(() => Qu(Co({ - created: oo().nullish(), - data: xo(Co({ - b64_json: Ra$2(), - revised_prompt: Ra$2().nullish() - })), - background: Ra$2().nullish(), - output_format: Ra$2().nullish(), - size: Ra$2().nullish(), - quality: Ra$2().nullish(), - usage: Co({ - input_tokens: oo().nullish(), - output_tokens: oo().nullish(), - total_tokens: oo().nullish(), - input_tokens_details: Co({ - image_tokens: oo().nullish(), - text_tokens: oo().nullish() - }).nullish() - }).nullish() -}))); -var He$2 = { - "dall-e-3": 1, - "dall-e-2": 10, - "gpt-image-1": 10, - "gpt-image-1-mini": 10, - "gpt-image-1.5": 10, - "gpt-image-2": 10, - "chatgpt-image-latest": 10 -}; -var Ue$2 = [ - `chatgpt-image-`, - `gpt-image-1-mini`, - `gpt-image-1.5`, - `gpt-image-1`, - `gpt-image-2` -]; -function We$2(e) { - return Ue$2.some((t) => e.startsWith(t)); -} -var Ge$2 = Co({ - quality: Io([ - `standard`, - `hd`, - `low`, - `medium`, - `high`, - `auto` - ]).optional(), - background: Io([ - `transparent`, - `opaque`, - `auto` - ]).optional(), - outputFormat: Io([ - `png`, - `jpeg`, - `webp` - ]).optional(), - outputCompression: oo().int().min(0).max(100).optional(), - user: Ra$2().optional() -}); -var Ke$2 = Wu(() => Qu(Ge$2.extend({ - style: Io([`vivid`, `natural`]).optional(), - moderation: Io([`auto`, `low`]).optional() -}))); -var qe$2 = Wu(() => Qu(Ge$2.extend({ inputFidelity: Io([`high`, `low`]).optional() }))); -var Je$2 = class e { - constructor(e, t) { - this.modelId = e, this.config = t, this.specificationVersion = `v4`; - } - static [Mc](e) { - return Cd({ - modelId: e.modelId, - config: e.config - }); - } - static [Nc](t) { - return new e(t.modelId, t.config); - } - get maxImagesPerCall() { - return He$2[this.modelId] ?? 1; - } - get provider() { - return this.config.provider; - } - async doGenerate({ prompt: e, files: t, mask: n, n: r, size: i, aspectRatio: a, seed: o, providerOptions: s, headers: c, abortSignal: l }) { - var u, d, p; - let m = []; - a != null && m.push({ - type: `unsupported`, - feature: `aspectRatio`, - details: "This model does not support aspect ratio. Use `size` instead." - }), o != null && m.push({ - type: `unsupported`, - feature: `seed` - }); - let g = ((u = this.config._internal)?.currentDate)?.call(u) ?? /* @__PURE__ */ new Date(); - if (t != null) { - let a = await ad({ - provider: `openai`, - providerOptions: s, - schema: qe$2 - }) ?? {}, { value: o, responseHeaders: u } = await cd({ - url: this.config.url({ - path: `/images/edits`, - modelId: this.modelId - }), - headers: Pc((d = this.config).headers?.call(d), c), - formData: Vc({ - model: this.modelId, - prompt: e, - image: await Promise.all(t.map((e) => e.type === `file` ? new Blob([e.data instanceof Uint8Array ? new Blob([e.data], { type: e.mediaType }) : new Blob([Lc(e.data)], { type: e.mediaType })], { type: e.mediaType }) : vl(e.url))), - mask: n == null ? void 0 : await Xe$2(n), - n: r, - size: i, - quality: a.quality, - background: a.background, - output_format: a.outputFormat, - output_compression: a.outputCompression, - input_fidelity: a.inputFidelity, - user: a.user - }), - failedResponseHandler: X$3, - successfulResponseHandler: bd(Ve$2), - abortSignal: l, - fetch: this.config.fetch - }); - return { - images: o.data.map((e) => e.b64_json), - warnings: m, - usage: o.usage == null ? void 0 : { - inputTokens: o.usage.input_tokens ?? void 0, - outputTokens: o.usage.output_tokens ?? void 0, - totalTokens: o.usage.total_tokens ?? void 0 - }, - response: { - timestamp: g, - modelId: this.modelId, - headers: u - }, - providerMetadata: { openai: { images: o.data.map((e, t) => ({ - ...e.revised_prompt ? { revisedPrompt: e.revised_prompt } : {}, - created: o.created ?? void 0, - size: o.size ?? void 0, - quality: o.quality ?? void 0, - background: o.background ?? void 0, - outputFormat: o.output_format ?? void 0, - ...Ye$2(o.usage?.input_tokens_details, t, o.data.length) - })) } } - }; - } - let _ = await ad({ - provider: `openai`, - providerOptions: s, - schema: Ke$2 - }) ?? {}, { value: v, responseHeaders: y } = await sd({ - url: this.config.url({ - path: `/images/generations`, - modelId: this.modelId - }), - headers: Pc((p = this.config).headers?.call(p), c), - body: { - model: this.modelId, - prompt: e, - n: r, - size: i, - quality: _.quality, - style: _.style, - background: _.background, - moderation: _.moderation, - output_format: _.outputFormat, - output_compression: _.outputCompression, - user: _.user, - ...We$2(this.modelId) ? {} : { response_format: `b64_json` } - }, - failedResponseHandler: X$3, - successfulResponseHandler: bd(Ve$2), - abortSignal: l, - fetch: this.config.fetch - }); - return { - images: v.data.map((e) => e.b64_json), - warnings: m, - usage: v.usage == null ? void 0 : { - inputTokens: v.usage.input_tokens ?? void 0, - outputTokens: v.usage.output_tokens ?? void 0, - totalTokens: v.usage.total_tokens ?? void 0 - }, - response: { - timestamp: g, - modelId: this.modelId, - headers: y - }, - providerMetadata: { openai: { images: v.data.map((e, t) => ({ - ...e.revised_prompt ? { revisedPrompt: e.revised_prompt } : {}, - created: v.created ?? void 0, - size: v.size ?? void 0, - quality: v.quality ?? void 0, - background: v.background ?? void 0, - outputFormat: v.output_format ?? void 0, - ...Ye$2(v.usage?.input_tokens_details, t, v.data.length) - })) } } - }; - } -}; -function Ye$2(e, t, n) { - if (e == null) return {}; - let r = {}; - if (e.image_tokens != null) { - let i = Math.floor(e.image_tokens / n), a = e.image_tokens - i * (n - 1); - r.imageTokens = t === n - 1 ? a : i; - } - if (e.text_tokens != null) { - let i = Math.floor(e.text_tokens / n), a = e.text_tokens - i * (n - 1); - r.textTokens = t === n - 1 ? a : i; - } - return r; -} -async function Xe$2(e) { - if (!e) return; - if (e.type === `url`) return vl(e.url); - let t = e.data instanceof Uint8Array ? e.data : Lc(e.data); - return new Blob([t], { type: e.mediaType }); -} -var Ze$2 = Wu(() => Qu(Co({ - callId: Ra$2(), - operation: Oo(`type`, [ - Co({ - type: Ro(`create_file`), - path: Ra$2(), - diff: Ra$2() - }), - Co({ - type: Ro(`delete_file`), - path: Ra$2() - }), - Co({ - type: Ro(`update_file`), - path: Ra$2(), - diff: Ra$2() - }) - ]) -}))); -var Qe$2 = Wu(() => Qu(Co({ - status: Io([`completed`, `failed`]), - output: Ra$2().optional() -}))); -var $e$2 = pd({ - id: `openai.apply_patch`, - inputSchema: Ze$2, - outputSchema: Qe$2 -}); -var et$2 = Wu(() => Qu(Co({ - code: Ra$2().nullish(), - containerId: Ra$2() -}))); -var tt$2 = Wu(() => Qu(Co({ outputs: xo(Oo(`type`, [Co({ - type: Ro(`logs`), - logs: Ra$2() -}), Co({ - type: Ro(`image`), - url: Ra$2() -})])).nullish() }))); -var nt$2 = Wu(() => Qu(Co({ container: Eo([Ra$2(), Co({ fileIds: xo(Ra$2()).optional() })]).optional() }))); -var rt$2 = md({ - id: `openai.code_interpreter`, - inputSchema: et$2, - outputSchema: tt$2 -}); -var it$2 = (e = {}) => rt$2(e); -var at$2 = Wu(() => Qu(Co({ - description: Ra$2().optional(), - format: Eo([Co({ - type: Ro(`grammar`), - syntax: Io([`regex`, `lark`]), - definition: Ra$2() - }), Co({ type: Ro(`text`) })]).optional() -}))); -var ot$2 = fd({ - id: `openai.custom`, - inputSchema: Wu(() => Qu(Ra$2())) -}); -var st$2 = (e) => ot$2(e); -var ct$2 = Co({ - key: Ra$2(), - type: Io([ - `eq`, - `ne`, - `gt`, - `gte`, - `lt`, - `lte`, - `in`, - `nin` - ]), - value: Eo([ - Ra$2(), - oo(), - uo(), - xo(Ra$2()) - ]) -}); -var lt$2 = Co({ - type: Io([`and`, `or`]), - filters: xo(Eo([ct$2, os(() => lt$2)])) -}); -var ut$2 = Wu(() => Qu(Co({ - vectorStoreIds: xo(Ra$2()), - maxNumResults: oo().optional(), - ranking: Co({ - ranker: Ra$2().optional(), - scoreThreshold: oo().optional() - }).optional(), - filters: Eo([ct$2, lt$2]).optional() -}))); -var dt$2 = Wu(() => Qu(Co({ - queries: xo(Ra$2()), - results: xo(Co({ - attributes: Po(Ra$2(), _o()), - fileId: Ra$2(), - filename: Ra$2(), - score: oo(), - text: Ra$2() - })).nullable() -}))); -var ft$2 = md({ - id: `openai.file_search`, - inputSchema: Co({}), - outputSchema: dt$2 -}); -var pt$2 = Wu(() => Qu(Co({ - background: Io([ - `auto`, - `opaque`, - `transparent` - ]).optional(), - inputFidelity: Io([`low`, `high`]).optional(), - inputImageMask: Co({ - fileId: Ra$2().optional(), - imageUrl: Ra$2().optional() - }).optional(), - model: Ra$2().optional(), - moderation: Io([`auto`]).optional(), - outputCompression: oo().int().min(0).max(100).optional(), - outputFormat: Io([ - `png`, - `jpeg`, - `webp` - ]).optional(), - partialImages: oo().int().min(0).max(3).optional(), - quality: Io([ - `auto`, - `low`, - `medium`, - `high` - ]).optional(), - size: Io([ - `1024x1024`, - `1024x1536`, - `1536x1024`, - `auto` - ]).optional() -}).strict())); -var mt$2 = md({ - id: `openai.image_generation`, - inputSchema: Wu(() => Qu(Co({}))), - outputSchema: Wu(() => Qu(Co({ result: Ra$2() }))) -}); -var ht$2 = (e = {}) => mt$2(e); -var gt$2 = Wu(() => Qu(Co({ action: Co({ - type: Ro(`exec`), - command: xo(Ra$2()), - timeoutMs: oo().optional(), - user: Ra$2().optional(), - workingDirectory: Ra$2().optional(), - env: Po(Ra$2(), Ra$2()).optional() -}) }))); -var _t$2 = Wu(() => Qu(Co({ output: Ra$2() }))); -var vt$2 = pd({ - id: `openai.local_shell`, - inputSchema: gt$2, - outputSchema: _t$2 -}); -var yt$2 = Wu(() => Qu(Co({ action: Co({ - commands: xo(Ra$2()), - timeoutMs: oo().optional(), - maxOutputLength: oo().optional() -}) }))); -var bt$2 = Wu(() => Qu(Co({ output: xo(Co({ - stdout: Ra$2(), - stderr: Ra$2(), - outcome: Oo(`type`, [Co({ type: Ro(`timeout`) }), Co({ - type: Ro(`exit`), - exitCode: oo() - })]) -})) }))); -var xt$2 = xo(Oo(`type`, [Co({ - type: Ro(`skillReference`), - providerReference: Po(Ra$2(), Ra$2()), - version: Ra$2().optional() -}), Co({ - type: Ro(`inline`), - name: Ra$2(), - description: Ra$2(), - source: Co({ - type: Ro(`base64`), - mediaType: Ro(`application/zip`), - data: Ra$2() - }) -})])).optional(); -var St$2 = Wu(() => Qu(Co({ environment: Eo([ - Co({ - type: Ro(`containerAuto`), - fileIds: xo(Ra$2()).optional(), - memoryLimit: Io([ - `1g`, - `4g`, - `16g`, - `64g` - ]).optional(), - networkPolicy: Oo(`type`, [Co({ type: Ro(`disabled`) }), Co({ - type: Ro(`allowlist`), - allowedDomains: xo(Ra$2()), - domainSecrets: xo(Co({ - domain: Ra$2(), - name: Ra$2(), - value: Ra$2() - })).optional() - })]).optional(), - skills: xt$2 - }), - Co({ - type: Ro(`containerReference`), - containerId: Ra$2() - }), - Co({ - type: Ro(`local`).optional(), - skills: xo(Co({ - name: Ra$2(), - description: Ra$2(), - path: Ra$2() - })).optional() - }) -]).optional() }))); -var Ct$2 = pd({ - id: `openai.shell`, - inputSchema: yt$2, - outputSchema: bt$2 -}); -var wt$2 = Wu(() => Qu(Co({ - execution: Io([`server`, `client`]).optional(), - description: Ra$2().optional(), - parameters: Po(Ra$2(), _o()).optional() -}))); -var Tt$2 = Wu(() => Qu(Co({ - arguments: _o().optional(), - call_id: Ra$2().nullish() -}))); -var Et$2 = Wu(() => Qu(Co({ tools: xo(Po(Ra$2(), _o())) }))); -var Dt$2 = pd({ - id: `openai.tool_search`, - inputSchema: Tt$2, - outputSchema: Et$2 -}); -var Ot$2 = (e = {}) => Dt$2(e); -var kt$2 = Wu(() => Qu(Co({ - externalWebAccess: uo().optional(), - filters: Co({ allowedDomains: xo(Ra$2()).optional() }).optional(), - searchContextSize: Io([ - `low`, - `medium`, - `high` - ]).optional(), - userLocation: Co({ - type: Ro(`approximate`), - country: Ra$2().optional(), - city: Ra$2().optional(), - region: Ra$2().optional(), - timezone: Ra$2().optional() - }).optional() -}))); -var At$2 = md({ - id: `openai.web_search`, - inputSchema: Wu(() => Qu(Co({}))), - outputSchema: Wu(() => Qu(Co({ - action: Oo(`type`, [ - Co({ - type: Ro(`search`), - query: Ra$2().optional(), - queries: xo(Ra$2()).optional() - }), - Co({ - type: Ro(`openPage`), - url: Ra$2().nullish() - }), - Co({ - type: Ro(`findInPage`), - url: Ra$2().nullish(), - pattern: Ra$2().nullish() - }) - ]).optional(), - sources: xo(Oo(`type`, [Co({ - type: Ro(`url`), - url: Ra$2() - }), Co({ - type: Ro(`api`), - name: Ra$2() - })])).optional() - }))) -}); -var jt$2 = (e = {}) => At$2(e); -var Mt$2 = Wu(() => Qu(Co({ - searchContextSize: Io([ - `low`, - `medium`, - `high` - ]).optional(), - userLocation: Co({ - type: Ro(`approximate`), - country: Ra$2().optional(), - city: Ra$2().optional(), - region: Ra$2().optional(), - timezone: Ra$2().optional() - }).optional() -}))); -var Nt$2 = md({ - id: `openai.web_search_preview`, - inputSchema: Wu(() => Qu(Co({}))), - outputSchema: Wu(() => Qu(Co({ action: Oo(`type`, [ - Co({ - type: Ro(`search`), - query: Ra$2().optional() - }), - Co({ - type: Ro(`openPage`), - url: Ra$2().nullish() - }), - Co({ - type: Ro(`findInPage`), - url: Ra$2().nullish(), - pattern: Ra$2().nullish() - }) - ]).optional() }))) -}); -var Pt$2 = os(() => Eo([ - Ra$2(), - oo(), - uo(), - po(), - xo(Pt$2), - Po(Ra$2(), Pt$2) -])); -var Ft$2 = Wu(() => Qu(Co({ - serverLabel: Ra$2(), - allowedTools: Eo([xo(Ra$2()), Co({ - readOnly: uo().optional(), - toolNames: xo(Ra$2()).optional() - })]).optional(), - authorization: Ra$2().optional(), - connectorId: Ra$2().optional(), - headers: Po(Ra$2(), Ra$2()).optional(), - requireApproval: Eo([Io([`always`, `never`]), Co({ never: Co({ toolNames: xo(Ra$2()).optional() }).optional() })]).optional(), - serverDescription: Ra$2().optional(), - serverUrl: Ra$2().optional() -}).refine((e) => e.serverUrl != null || e.connectorId != null, `One of serverUrl or connectorId must be provided.`))); -var It$2 = md({ - id: `openai.mcp`, - inputSchema: Wu(() => Qu(Co({}))), - outputSchema: Wu(() => Qu(Co({ - type: Ro(`call`), - serverLabel: Ra$2(), - name: Ra$2(), - arguments: Ra$2(), - output: Ra$2().nullish(), - error: Eo([Ra$2(), Pt$2]).optional() - }))) -}); -var Lt$2 = { - applyPatch: $e$2, - customTool: st$2, - codeInterpreter: it$2, - fileSearch: ft$2, - imageGeneration: ht$2, - localShell: vt$2, - shell: Ct$2, - webSearchPreview: Nt$2, - webSearch: jt$2, - mcp: (e) => It$2(e), - toolSearch: Ot$2 -}; -function Rt$2(e) { - let t = e, n = t.type; - switch (n) { - case `session.created`: return { - type: `session-created`, - sessionId: t.session?.id, - raw: e - }; - case `session.updated`: return { - type: `session-updated`, - raw: e - }; - case `input_audio_buffer.speech_started`: return { - type: `speech-started`, - itemId: t.item_id, - raw: e - }; - case `input_audio_buffer.speech_stopped`: return { - type: `speech-stopped`, - itemId: t.item_id, - raw: e - }; - case `input_audio_buffer.committed`: return { - type: `audio-committed`, - itemId: t.item_id, - previousItemId: t.previous_item_id, - raw: e - }; - case `conversation.item.added`: return { - type: `conversation-item-added`, - itemId: t.item?.id ?? t.item_id, - item: t.item, - raw: e - }; - case `conversation.item.input_audio_transcription.completed`: return { - type: `input-transcription-completed`, - itemId: t.item_id, - transcript: t.transcript ?? ``, - raw: e - }; - case `response.created`: return { - type: `response-created`, - responseId: t.response?.id ?? t.response_id, - raw: e - }; - case `response.done`: return { - type: `response-done`, - responseId: t.response?.id ?? t.response_id, - status: t.response?.status ?? `completed`, - raw: e - }; - case `response.output_item.added`: return { - type: `output-item-added`, - responseId: t.response_id, - itemId: t.item?.id ?? t.item_id, - raw: e - }; - case `response.output_item.done`: return { - type: `output-item-done`, - responseId: t.response_id, - itemId: t.item?.id ?? t.item_id, - raw: e - }; - case `response.content_part.added`: return { - type: `content-part-added`, - responseId: t.response_id, - itemId: t.item_id, - raw: e - }; - case `response.content_part.done`: return { - type: `content-part-done`, - responseId: t.response_id, - itemId: t.item_id, - raw: e - }; - case `response.output_audio.delta`: return { - type: `audio-delta`, - responseId: t.response_id, - itemId: t.item_id, - delta: t.delta, - raw: e - }; - case `response.output_audio.done`: return { - type: `audio-done`, - responseId: t.response_id, - itemId: t.item_id, - raw: e - }; - case `response.output_audio_transcript.delta`: return { - type: `audio-transcript-delta`, - responseId: t.response_id, - itemId: t.item_id, - delta: t.delta, - raw: e - }; - case `response.output_audio_transcript.done`: return { - type: `audio-transcript-done`, - responseId: t.response_id, - itemId: t.item_id, - transcript: t.transcript, - raw: e - }; - case `response.output_text.delta`: return { - type: `text-delta`, - responseId: t.response_id, - itemId: t.item_id, - delta: t.delta, - raw: e - }; - case `response.output_text.done`: return { - type: `text-done`, - responseId: t.response_id, - itemId: t.item_id, - text: t.text, - raw: e - }; - case `response.function_call_arguments.delta`: return { - type: `function-call-arguments-delta`, - responseId: t.response_id, - itemId: t.item_id, - callId: t.call_id, - delta: t.delta, - raw: e - }; - case `response.function_call_arguments.done`: return { - type: `function-call-arguments-done`, - responseId: t.response_id, - itemId: t.item_id, - callId: t.call_id, - name: t.name, - arguments: t.arguments, - raw: e - }; - case `error`: return { - type: `error`, - message: t.error?.message ?? t.message ?? `Unknown error`, - code: t.error?.code ?? t.code, - raw: e - }; - default: return { - type: `custom`, - rawType: n, - raw: e - }; - } -} -function zt$2(e, t) { - switch (e.type) { - case `session-update`: return { - type: `session.update`, - session: Bt$2(e.config, t) - }; - case `input-audio-append`: return { - type: `input_audio_buffer.append`, - audio: e.audio - }; - case `input-audio-commit`: return { type: `input_audio_buffer.commit` }; - case `input-audio-clear`: return { type: `input_audio_buffer.clear` }; - case `conversation-item-create`: { - let t = e.item; - switch (t.type) { - case `text-message`: return { - type: `conversation.item.create`, - item: { - type: `message`, - role: t.role, - content: [{ - type: `input_text`, - text: t.text - }] - } - }; - case `audio-message`: return { - type: `conversation.item.create`, - item: { - type: `message`, - role: t.role, - content: [{ - type: `input_audio`, - audio: t.audio - }] - } - }; - case `function-call-output`: return { - type: `conversation.item.create`, - item: { - type: `function_call_output`, - call_id: t.callId, - output: t.output - } - }; - } - break; - } - case `conversation-item-truncate`: return { - type: `conversation.item.truncate`, - item_id: e.itemId, - content_index: e.contentIndex, - audio_end_ms: e.audioEndMs - }; - case `response-create`: return { - type: `response.create`, - ...e.options == null ? {} : { response: { - ...e.options.modalities == null ? {} : { output_modalities: e.options.modalities }, - ...e.options.instructions == null ? {} : { instructions: e.options.instructions }, - ...e.options.metadata == null ? {} : { metadata: e.options.metadata } - } } - }; - case `response-cancel`: return { type: `response.cancel` }; - } -} -function Bt$2(e, t) { - let n = { - type: `realtime`, - model: t - }; - e.instructions != null && (n.instructions = e.instructions), e.outputModalities != null && (n.output_modalities = e.outputModalities); - let r = {}; - if (e.inputAudioFormat != null || e.inputAudioTranscription != null || e.turnDetection != null) { - let t = {}; - if (e.inputAudioFormat != null && (t.format = { - type: e.inputAudioFormat.type, - ...e.inputAudioFormat.rate == null ? {} : { rate: e.inputAudioFormat.rate } - }), e.turnDetection != null) if (e.turnDetection.type === `disabled`) t.turn_detection = null; - else { - let n = { type: e.turnDetection.type === `server-vad` ? `server_vad` : `semantic_vad` }; - e.turnDetection.threshold != null && (n.threshold = e.turnDetection.threshold), e.turnDetection.silenceDurationMs != null && (n.silence_duration_ms = e.turnDetection.silenceDurationMs), e.turnDetection.prefixPaddingMs != null && (n.prefix_padding_ms = e.turnDetection.prefixPaddingMs), t.turn_detection = n; - } - e.inputAudioTranscription != null && (t.transcription = { - model: e.inputAudioTranscription.model ?? `gpt-realtime-whisper`, - ...e.inputAudioTranscription.language == null ? {} : { language: e.inputAudioTranscription.language }, - ...e.inputAudioTranscription.prompt == null ? {} : { prompt: e.inputAudioTranscription.prompt } - }), r.input = t; - } - if (e.outputAudioFormat != null || e.voice != null) { - let t = {}; - e.outputAudioFormat != null && (t.format = { - type: e.outputAudioFormat.type, - ...e.outputAudioFormat.rate == null ? {} : { rate: e.outputAudioFormat.rate } - }), e.voice != null && (t.voice = e.voice), r.output = t; - } - return Object.keys(r).length > 0 && (n.audio = r), e.tools != null && e.tools.length > 0 && (n.tools = e.tools.map((e) => ({ - type: e.type, - name: e.name, - description: e.description, - parameters: e.parameters - })), n.tool_choice = `auto`), e.providerOptions != null && Object.assign(n, e.providerOptions), n; -} -var Vt$2 = class { - constructor(e, t) { - this.specificationVersion = `v4`, this.modelId = e, this.provider = t.provider, this.config = t; - } - async doCreateClientSecret(e) { - let t = this.config.fetch ?? fetch, n = `${this.config.baseURL}/realtime/client_secrets`, r = e.sessionConfig == null ? { - type: `realtime`, - model: this.modelId - } : Bt$2(e.sessionConfig, this.modelId), i = await t(n, { - method: `POST`, - headers: { - ...this.config.headers(), - "Content-Type": `application/json` - }, - body: JSON.stringify({ - session: r, - ...e.expiresAfterSeconds == null ? {} : { expires_after: { - anchor: `created_at`, - seconds: e.expiresAfterSeconds - } } - }) - }); - if (!i.ok) { - let e = await i.text(); - throw Error(`OpenAI realtime client secret request failed: ${i.status} ${e}`); - } - let a = await i.json(); - return { - token: a.value, - url: `wss://${new URL(this.config.baseURL).host}/v1/realtime?model=${encodeURIComponent(this.modelId)}`, - expiresAt: a.expires_at - }; - } - getWebSocketConfig(e) { - return { - url: e.url, - protocols: [`realtime`, `openai-insecure-api-key.${e.token}`] - }; - } - parseServerEvent(e) { - return Rt$2(e); - } - serializeClientEvent(e) { - return zt$2(e, this.modelId); - } - buildSessionConfig(e) { - return Bt$2(e, this.modelId); - } -}; -function Ht$2(e) { - if (e == null) return { - inputTokens: { - total: void 0, - noCache: void 0, - cacheRead: void 0, - cacheWrite: void 0 - }, - outputTokens: { - total: void 0, - text: void 0, - reasoning: void 0 - }, - raw: void 0 - }; - let t = e.input_tokens, n = e.output_tokens, r = e.input_tokens_details?.cached_tokens ?? 0, i = e.output_tokens_details?.reasoning_tokens ?? 0; - return { - inputTokens: { - total: t, - noCache: t - r, - cacheRead: r, - cacheWrite: void 0 - }, - outputTokens: { - total: n, - text: n - i, - reasoning: i - }, - raw: e - }; -} -function Ut$2(e) { - return JSON.stringify(e === void 0 ? {} : e); -} -function Wt$2(e, t) { - return t ? t.some((t) => e.startsWith(t)) : !1; -} -async function Gt$2({ prompt: e, toolNameMapping: t, systemMessageMode: n, providerOptionsName: i, fileIdPrefixes: s, passThroughUnsupportedFiles: c = !1, store: d, hasConversation: p = !1, hasPreviousResponseId: m = !1, hasLocalShellTool: h = !1, hasShellTool: g = !1, hasApplyPatchTool: v = !1, customProviderToolNames: y }) { - let b = [], x = [], S = /* @__PURE__ */ new Set(); - for (let { role: C, content: w } of e) switch (C) { - case `system`: - switch (n) { - case `system`: - b.push({ - role: `system`, - content: w - }); - break; - case `developer`: - b.push({ - role: `developer`, - content: w - }); - break; - case `remove`: - x.push({ - type: `other`, - message: `system messages are removed for this model` - }); - break; - default: throw Error(`Unsupported system message mode: ${n}`); - } - break; - case `user`: - b.push({ - role: `user`, - content: w.map((e, t) => { - switch (e.type) { - case `text`: return { - type: `input_text`, - text: e.text - }; - case `file`: switch (e.data.type) { - case `reference`: { - let t = _d({ - reference: e.data.reference, - provider: i - }); - return el(e.mediaType) === `image` ? { - type: `input_image`, - file_id: t, - detail: e.providerOptions?.[i]?.imageDetail - } : { - type: `input_file`, - file_id: t - }; - } - case `text`: throw new Ie$10({ functionality: `text file parts` }); - case `url`: - case `data`: - if (el(e.mediaType) === `image`) return { - type: `input_image`, - ...e.data.type === `url` ? { image_url: e.data.url.toString() } : typeof e.data.data == `string` && Wt$2(e.data.data, s) ? { file_id: e.data.data } : { image_url: `data:${gd({ part: e })};base64,${zc(e.data.data)}` }, - detail: e.providerOptions?.[i]?.imageDetail - }; - { - if (e.data.type === `url`) return { - type: `input_file`, - file_url: e.data.url.toString() - }; - let n = gd({ part: e }); - if (n !== `application/pdf` && !c) throw new Ie$10({ functionality: `file part media type ${n}` }); - return { - type: `input_file`, - ...typeof e.data.data == `string` && Wt$2(e.data.data, s) ? { file_id: e.data.data } : { - filename: e.filename ?? (n === `application/pdf` ? `part-${t}.pdf` : `part-${t}`), - file_data: `data:${n};base64,${zc(e.data.data)}` - } - }; - } - } - } - }) - }); - break; - case `assistant`: { - let e = {}; - for (let n of w) switch (n.type) { - case `text`: { - let e = n.providerOptions?.[i], t = e?.itemId, r = e?.phase; - if (p && t != null) break; - if (d && t != null) { - b.push({ - type: `item_reference`, - id: t - }); - break; - } - b.push({ - role: `assistant`, - content: [{ - type: `output_text`, - text: n.text - }], - id: t, - ...r != null && { phase: r } - }); - break; - } - case `tool-call`: { - let e = n.providerOptions?.[i]?.itemId ?? n.providerMetadata?.[i]?.itemId, r = n.providerOptions?.[i]?.namespace ?? n.providerMetadata?.[i]?.namespace; - if (p && e != null) break; - let a = t.toProviderToolName(n.toolName); - if (a === `tool_search`) { - if (d && e != null) { - b.push({ - type: `item_reference`, - id: e - }); - break; - } - let t = typeof n.input == `string` ? await td({ - text: n.input, - schema: Tt$2 - }) : await $u({ - value: n.input, - schema: Tt$2 - }), r = t.call_id == null ? `server` : `client`; - b.push({ - type: `tool_search_call`, - id: e ?? n.toolCallId, - execution: r, - call_id: t.call_id ?? null, - status: `completed`, - arguments: t.arguments - }); - break; - } - if (n.providerExecuted) { - d && e != null && b.push({ - type: `item_reference`, - id: e - }); - break; - } - if (m && d && e != null) break; - let o = h && a === `local_shell` || g && a === `shell` || v && a === `apply_patch` || (y?.has(a) ?? !1); - if (d && e != null && o) { - b.push({ - type: `item_reference`, - id: e - }); - break; - } - if (h && a === `local_shell`) { - let t = await $u({ - value: n.input, - schema: gt$2 - }); - b.push({ - type: `local_shell_call`, - call_id: n.toolCallId, - id: e, - action: { - type: `exec`, - command: t.action.command, - timeout_ms: t.action.timeoutMs, - user: t.action.user, - working_directory: t.action.workingDirectory, - env: t.action.env - } - }); - break; - } - if (g && a === `shell`) { - let t = await $u({ - value: n.input, - schema: yt$2 - }); - b.push({ - type: `shell_call`, - call_id: n.toolCallId, - id: e, - status: `completed`, - action: { - commands: t.action.commands, - timeout_ms: t.action.timeoutMs, - max_output_length: t.action.maxOutputLength - } - }); - break; - } - if (v && a === `apply_patch`) { - let t = await $u({ - value: n.input, - schema: Ze$2 - }); - b.push({ - type: `apply_patch_call`, - call_id: t.callId, - id: e, - status: `completed`, - operation: t.operation - }); - break; - } - if (y?.has(a)) { - b.push({ - type: `custom_tool_call`, - call_id: n.toolCallId, - name: a, - input: typeof n.input == `string` ? n.input : JSON.stringify(n.input), - id: e - }); - break; - } - b.push({ - type: `function_call`, - call_id: n.toolCallId, - name: a, - arguments: Ut$2(n.input), - ...r != null && { namespace: r } - }); - break; - } - case `tool-result`: { - if (n.output.type === `execution-denied` || n.output.type === `json` && typeof n.output.value == `object` && n.output.value != null && `type` in n.output.value && n.output.value.type === `execution-denied` || p) break; - let e = t.toProviderToolName(n.toolName); - if (e === `tool_search`) { - let e = n.providerOptions?.[i]?.itemId ?? n.toolCallId; - if (d) b.push({ - type: `item_reference`, - id: e - }); - else if (n.output.type === `json`) { - let t = await $u({ - value: n.output.value, - schema: Et$2 - }); - b.push({ - type: `tool_search_output`, - id: e, - execution: `server`, - call_id: null, - status: `completed`, - tools: t.tools - }); - } - break; - } - if (g && e === `shell`) { - if (n.output.type === `json`) { - let e = await $u({ - value: n.output.value, - schema: bt$2 - }); - b.push({ - type: `shell_call_output`, - call_id: n.toolCallId, - output: e.output.map((e) => ({ - stdout: e.stdout, - stderr: e.stderr, - outcome: e.outcome.type === `timeout` ? { type: `timeout` } : { - type: `exit`, - exit_code: e.outcome.exitCode - } - })) - }); - } - break; - } - if (d) { - let e = n.providerOptions?.[i]?.itemId ?? n.toolCallId; - b.push({ - type: `item_reference`, - id: e - }); - } else x.push({ - type: `other`, - message: `Results for OpenAI tool ${n.toolName} are not sent to the API when store is false` - }); - break; - } - case `reasoning`: { - let t = await ad({ - provider: i, - providerOptions: n.providerOptions, - schema: Kt$2 - }), r = t?.itemId; - if ((p || m) && r != null) break; - if (r != null) { - let i = e[r]; - if (d) i === void 0 && (b.push({ - type: `item_reference`, - id: r - }), e[r] = { - type: `reasoning`, - id: r, - summary: [] - }); - else { - let a = []; - n.text.length > 0 ? a.push({ - type: `summary_text`, - text: n.text - }) : i !== void 0 && x.push({ - type: `other`, - message: `Cannot append empty reasoning part to existing reasoning sequence. Skipping reasoning part: ${JSON.stringify(n)}.` - }), i === void 0 ? (e[r] = { - type: `reasoning`, - id: r, - encrypted_content: t?.reasoningEncryptedContent, - summary: a - }, b.push(e[r])) : (i.summary.push(...a), t?.reasoningEncryptedContent != null && (i.encrypted_content = t.reasoningEncryptedContent)); - } - } else { - let e = t?.reasoningEncryptedContent; - if (e != null) { - let t = []; - n.text.length > 0 && t.push({ - type: `summary_text`, - text: n.text - }), b.push({ - type: `reasoning`, - encrypted_content: e, - summary: t - }); - } else x.push({ - type: `other`, - message: `Non-OpenAI reasoning parts are not supported. Skipping reasoning part: ${JSON.stringify(n)}.` - }); - } - break; - } - case `custom`: - if (n.kind === `openai.compaction`) { - let e = n.providerOptions?.[i], t = e?.itemId; - if (p && t != null) break; - if (d && t != null) { - b.push({ - type: `item_reference`, - id: t - }); - break; - } - let r = e?.encryptedContent; - t != null && b.push({ - type: `compaction`, - id: t, - encrypted_content: r - }); - } - break; - } - break; - } - case `tool`: - for (let e of w) { - if (e.type === `tool-approval-response`) { - let t = e; - if (S.has(t.approvalId)) continue; - S.add(t.approvalId), d && b.push({ - type: `item_reference`, - id: t.approvalId - }), b.push({ - type: `mcp_approval_response`, - approval_request_id: t.approvalId, - approve: t.approved - }); - continue; - } - let n = e.output; - if (n.type === `execution-denied` && n.providerOptions?.openai?.approvalId) continue; - let r = t.toProviderToolName(e.toolName); - if (r === `tool_search` && n.type === `json`) { - let t = await $u({ - value: n.value, - schema: Et$2 - }); - b.push({ - type: `tool_search_output`, - execution: `client`, - call_id: e.toolCallId, - status: `completed`, - tools: t.tools - }); - continue; - } - if (h && r === `local_shell` && n.type === `json`) { - let t = await $u({ - value: n.value, - schema: _t$2 - }); - b.push({ - type: `local_shell_call_output`, - call_id: e.toolCallId, - output: t.output - }); - continue; - } - if (g && r === `shell` && n.type === `json`) { - let t = await $u({ - value: n.value, - schema: bt$2 - }); - b.push({ - type: `shell_call_output`, - call_id: e.toolCallId, - output: t.output.map((e) => ({ - stdout: e.stdout, - stderr: e.stderr, - outcome: e.outcome.type === `timeout` ? { type: `timeout` } : { - type: `exit`, - exit_code: e.outcome.exitCode - } - })) - }); - continue; - } - if (v && e.toolName === `apply_patch` && n.type === `json`) { - let t = await $u({ - value: n.value, - schema: Qe$2 - }); - b.push({ - type: `apply_patch_call_output`, - call_id: e.toolCallId, - status: t.status, - output: t.output - }); - continue; - } - if (y?.has(r)) { - let t; - switch (n.type) { - case `text`: - case `error-text`: - t = n.value; - break; - case `execution-denied`: - t = n.reason ?? `Tool call execution denied.`; - break; - case `json`: - case `error-json`: - t = JSON.stringify(n.value); - break; - case `content`: - t = n.value.map((e) => { - switch (e.type) { - case `text`: return { - type: `input_text`, - text: e.text - }; - case `file`: { - let t = el(e.mediaType), n = e.providerOptions?.[i]?.imageDetail; - if (e.data.type === `data`) { - let r = gd({ part: e }); - return t === `image` ? { - type: `input_image`, - image_url: `data:${r};base64,${zc(e.data.data)}`, - detail: n - } : { - type: `input_file`, - filename: e.filename ?? `data`, - file_data: `data:${r};base64,${zc(e.data.data)}` - }; - } - if (e.data.type === `url`) return t === `image` ? { - type: `input_image`, - image_url: e.data.url.toString(), - detail: n - } : { - type: `input_file`, - file_url: e.data.url.toString() - }; - x.push({ - type: `other`, - message: `unsupported custom tool content part type: ${e.type} with data type: ${e.data.type}` - }); - return; - } - default: - x.push({ - type: `other`, - message: `unsupported custom tool content part type: ${e.type}` - }); - return; - } - }).filter(Nl); - break; - default: t = ``; - } - b.push({ - type: `custom_tool_call_output`, - call_id: e.toolCallId, - output: t - }); - continue; - } - let s; - switch (n.type) { - case `text`: - case `error-text`: - s = n.value; - break; - case `execution-denied`: - s = n.reason ?? `Tool call execution denied.`; - break; - case `json`: - case `error-json`: - s = JSON.stringify(n.value); - break; - case `content`: - s = n.value.map((e) => { - switch (e.type) { - case `text`: return { - type: `input_text`, - text: e.text - }; - case `file`: { - let t = el(e.mediaType), n = e.providerOptions?.[i]?.imageDetail; - if (e.data.type === `data`) { - let r = gd({ part: e }); - return t === `image` ? { - type: `input_image`, - image_url: `data:${r};base64,${zc(e.data.data)}`, - detail: n - } : { - type: `input_file`, - filename: e.filename ?? `data`, - file_data: `data:${r};base64,${zc(e.data.data)}` - }; - } - if (e.data.type === `url`) return t === `image` ? { - type: `input_image`, - image_url: e.data.url.toString(), - detail: n - } : { - type: `input_file`, - file_url: e.data.url.toString() - }; - x.push({ - type: `other`, - message: `unsupported tool content part type: ${e.type} with data type: ${e.data.type}` - }); - return; - } - default: - x.push({ - type: `other`, - message: `unsupported tool content part type: ${e.type}` - }); - return; - } - }).filter(Nl); - break; - } - b.push({ - type: `function_call_output`, - call_id: e.toolCallId, - output: s - }); - } - break; - default: throw Error(`Unsupported role: ${C}`); - } - return !d && b.some((e) => `type` in e && e.type === `reasoning` && e.encrypted_content == null) && (x.push({ - type: `other`, - message: `Reasoning parts without encrypted content are not supported when store is false. Skipping reasoning parts.` - }), b = b.filter((e) => !(`type` in e) || e.type !== `reasoning` || e.encrypted_content != null)), { - input: b, - warnings: x - }; -} -var Kt$2 = Co({ - itemId: Ra$2().nullish(), - reasoningEncryptedContent: Ra$2().nullish() -}); -function qt$2({ finishReason: e, hasFunctionCall: t }) { - switch (e) { - case void 0: - case null: return t ? `tool-calls` : `stop`; - case `max_output_tokens`: return `length`; - case `content_filter`: return `content-filter`; - default: return t ? `tool-calls` : `other`; - } -} -var Q$3 = os(() => Eo([ - Ra$2(), - oo(), - uo(), - po(), - xo(Q$3), - Po(Ra$2(), Q$3.optional()) -])); -var Jt$2 = Co({ - type: Ro(`error`), - sequence_number: oo(), - error: Co({ - type: Ra$2(), - code: Ra$2(), - message: Ra$2(), - param: Ra$2().nullish() - }) -}); -var Yt$2 = Co({ - type: Ro(`error`), - sequence_number: oo(), - code: Ra$2().nullish(), - message: Ra$2(), - param: Ra$2().nullish() -}); -var Xt$2 = Wu(() => Qu(Eo([ - Co({ - type: Ro(`response.output_text.delta`), - item_id: Ra$2(), - delta: Ra$2(), - logprobs: xo(Co({ - token: Ra$2(), - logprob: oo(), - top_logprobs: xo(Co({ - token: Ra$2(), - logprob: oo() - })) - })).nullish() - }), - Co({ - type: Io([`response.completed`, `response.incomplete`]), - response: Co({ - incomplete_details: Co({ reason: Ra$2() }).nullish(), - usage: Co({ - input_tokens: oo(), - input_tokens_details: Co({ - cached_tokens: oo().nullish(), - orchestration_input_tokens: oo().nullish(), - orchestration_input_cached_tokens: oo().nullish() - }).nullish(), - output_tokens: oo(), - output_tokens_details: Co({ - reasoning_tokens: oo().nullish(), - orchestration_output_tokens: oo().nullish() - }).nullish() - }), - service_tier: Ra$2().nullish() - }) - }), - Co({ - type: Ro(`response.failed`), - sequence_number: oo(), - response: Co({ - error: Co({ - code: Ra$2().nullish(), - message: Ra$2() - }).nullish(), - incomplete_details: Co({ reason: Ra$2() }).nullish(), - usage: Co({ - input_tokens: oo(), - input_tokens_details: Co({ - cached_tokens: oo().nullish(), - orchestration_input_tokens: oo().nullish(), - orchestration_input_cached_tokens: oo().nullish() - }).nullish(), - output_tokens: oo(), - output_tokens_details: Co({ - reasoning_tokens: oo().nullish(), - orchestration_output_tokens: oo().nullish() - }).nullish() - }).nullish(), - service_tier: Ra$2().nullish() - }) - }), - Co({ - type: Ro(`response.created`), - response: Co({ - id: Ra$2(), - created_at: oo(), - model: Ra$2(), - service_tier: Ra$2().nullish() - }) - }), - Co({ - type: Ro(`response.output_item.added`), - output_index: oo(), - item: Oo(`type`, [ - Co({ - type: Ro(`message`), - id: Ra$2(), - phase: Io([`commentary`, `final_answer`]).nullish() - }), - Co({ - type: Ro(`reasoning`), - id: Ra$2(), - encrypted_content: Ra$2().nullish() - }), - Co({ - type: Ro(`function_call`), - id: Ra$2(), - call_id: Ra$2(), - name: Ra$2(), - arguments: Ra$2(), - namespace: Ra$2().nullish() - }), - Co({ - type: Ro(`web_search_call`), - id: Ra$2(), - status: Ra$2() - }), - Co({ - type: Ro(`computer_call`), - id: Ra$2(), - status: Ra$2() - }), - Co({ - type: Ro(`file_search_call`), - id: Ra$2() - }), - Co({ - type: Ro(`image_generation_call`), - id: Ra$2() - }), - Co({ - type: Ro(`code_interpreter_call`), - id: Ra$2(), - container_id: Ra$2(), - code: Ra$2().nullable(), - outputs: xo(Oo(`type`, [Co({ - type: Ro(`logs`), - logs: Ra$2() - }), Co({ - type: Ro(`image`), - url: Ra$2() - })])).nullable(), - status: Ra$2() - }), - Co({ - type: Ro(`mcp_call`), - id: Ra$2(), - status: Ra$2(), - approval_request_id: Ra$2().nullish() - }), - Co({ - type: Ro(`mcp_list_tools`), - id: Ra$2() - }), - Co({ - type: Ro(`mcp_approval_request`), - id: Ra$2() - }), - Co({ - type: Ro(`apply_patch_call`), - id: Ra$2(), - call_id: Ra$2(), - status: Io([`in_progress`, `completed`]), - operation: Oo(`type`, [ - Co({ - type: Ro(`create_file`), - path: Ra$2(), - diff: Ra$2() - }), - Co({ - type: Ro(`delete_file`), - path: Ra$2() - }), - Co({ - type: Ro(`update_file`), - path: Ra$2(), - diff: Ra$2() - }) - ]) - }), - Co({ - type: Ro(`custom_tool_call`), - id: Ra$2(), - call_id: Ra$2(), - name: Ra$2(), - input: Ra$2() - }), - Co({ - type: Ro(`shell_call`), - id: Ra$2(), - call_id: Ra$2(), - status: Io([ - `in_progress`, - `completed`, - `incomplete` - ]), - action: Co({ commands: xo(Ra$2()) }) - }), - Co({ - type: Ro(`compaction`), - id: Ra$2(), - encrypted_content: Ra$2().nullish() - }), - Co({ - type: Ro(`shell_call_output`), - id: Ra$2(), - call_id: Ra$2(), - status: Io([ - `in_progress`, - `completed`, - `incomplete` - ]), - output: xo(Co({ - stdout: Ra$2(), - stderr: Ra$2(), - outcome: Oo(`type`, [Co({ type: Ro(`timeout`) }), Co({ - type: Ro(`exit`), - exit_code: oo() - })]) - })) - }), - Co({ - type: Ro(`tool_search_call`), - id: Ra$2(), - execution: Io([`server`, `client`]), - call_id: Ra$2().nullable(), - status: Io([ - `in_progress`, - `completed`, - `incomplete` - ]), - arguments: _o() - }), - Co({ - type: Ro(`tool_search_output`), - id: Ra$2(), - execution: Io([`server`, `client`]), - call_id: Ra$2().nullable(), - status: Io([ - `in_progress`, - `completed`, - `incomplete` - ]), - tools: xo(Po(Ra$2(), Q$3.optional())) - }) - ]) - }), - Co({ - type: Ro(`response.output_item.done`), - output_index: oo(), - item: Oo(`type`, [ - Co({ - type: Ro(`message`), - id: Ra$2(), - phase: Io([`commentary`, `final_answer`]).nullish() - }), - Co({ - type: Ro(`reasoning`), - id: Ra$2(), - encrypted_content: Ra$2().nullish() - }), - Co({ - type: Ro(`function_call`), - id: Ra$2(), - call_id: Ra$2(), - name: Ra$2(), - arguments: Ra$2(), - status: Ro(`completed`), - namespace: Ra$2().nullish() - }), - Co({ - type: Ro(`custom_tool_call`), - id: Ra$2(), - call_id: Ra$2(), - name: Ra$2(), - input: Ra$2(), - status: Ro(`completed`) - }), - Co({ - type: Ro(`code_interpreter_call`), - id: Ra$2(), - code: Ra$2().nullable(), - container_id: Ra$2(), - outputs: xo(Oo(`type`, [Co({ - type: Ro(`logs`), - logs: Ra$2() - }), Co({ - type: Ro(`image`), - url: Ra$2() - })])).nullable() - }), - Co({ - type: Ro(`image_generation_call`), - id: Ra$2(), - result: Ra$2() - }), - Co({ - type: Ro(`web_search_call`), - id: Ra$2(), - status: Ra$2(), - action: Oo(`type`, [ - Co({ - type: Ro(`search`), - query: Ra$2().nullish(), - queries: xo(Ra$2()).nullish(), - sources: xo(Oo(`type`, [Co({ - type: Ro(`url`), - url: Ra$2() - }), Co({ - type: Ro(`api`), - name: Ra$2() - })])).nullish() - }), - Co({ - type: Ro(`open_page`), - url: Ra$2().nullish() - }), - Co({ - type: Ro(`find_in_page`), - url: Ra$2().nullish(), - pattern: Ra$2().nullish() - }) - ]).nullish() - }), - Co({ - type: Ro(`file_search_call`), - id: Ra$2(), - queries: xo(Ra$2()), - results: xo(Co({ - attributes: Po(Ra$2(), Eo([ - Ra$2(), - oo(), - uo() - ])), - file_id: Ra$2(), - filename: Ra$2(), - score: oo(), - text: Ra$2() - })).nullish() - }), - Co({ - type: Ro(`local_shell_call`), - id: Ra$2(), - call_id: Ra$2(), - action: Co({ - type: Ro(`exec`), - command: xo(Ra$2()), - timeout_ms: oo().optional(), - user: Ra$2().optional(), - working_directory: Ra$2().optional(), - env: Po(Ra$2(), Ra$2()).optional() - }) - }), - Co({ - type: Ro(`computer_call`), - id: Ra$2(), - status: Ro(`completed`) - }), - Co({ - type: Ro(`mcp_call`), - id: Ra$2(), - status: Ra$2(), - arguments: Ra$2(), - name: Ra$2(), - server_label: Ra$2(), - output: Ra$2().nullish(), - error: Eo([Ra$2(), Co({ - type: Ra$2().optional(), - code: Eo([oo(), Ra$2()]).optional(), - message: Ra$2().optional() - }).loose()]).nullish(), - approval_request_id: Ra$2().nullish() - }), - Co({ - type: Ro(`mcp_list_tools`), - id: Ra$2(), - server_label: Ra$2(), - tools: xo(Co({ - name: Ra$2(), - description: Ra$2().optional(), - input_schema: ho(), - annotations: Po(Ra$2(), _o()).optional() - })), - error: Eo([Ra$2(), Co({ - type: Ra$2().optional(), - code: Eo([oo(), Ra$2()]).optional(), - message: Ra$2().optional() - }).loose()]).optional() - }), - Co({ - type: Ro(`mcp_approval_request`), - id: Ra$2(), - server_label: Ra$2(), - name: Ra$2(), - arguments: Ra$2(), - approval_request_id: Ra$2().optional() - }), - Co({ - type: Ro(`apply_patch_call`), - id: Ra$2(), - call_id: Ra$2(), - status: Io([`in_progress`, `completed`]), - operation: Oo(`type`, [ - Co({ - type: Ro(`create_file`), - path: Ra$2(), - diff: Ra$2() - }), - Co({ - type: Ro(`delete_file`), - path: Ra$2() - }), - Co({ - type: Ro(`update_file`), - path: Ra$2(), - diff: Ra$2() - }) - ]) - }), - Co({ - type: Ro(`shell_call`), - id: Ra$2(), - call_id: Ra$2(), - status: Io([ - `in_progress`, - `completed`, - `incomplete` - ]), - action: Co({ commands: xo(Ra$2()) }) - }), - Co({ - type: Ro(`compaction`), - id: Ra$2(), - encrypted_content: Ra$2() - }), - Co({ - type: Ro(`shell_call_output`), - id: Ra$2(), - call_id: Ra$2(), - status: Io([ - `in_progress`, - `completed`, - `incomplete` - ]), - output: xo(Co({ - stdout: Ra$2(), - stderr: Ra$2(), - outcome: Oo(`type`, [Co({ type: Ro(`timeout`) }), Co({ - type: Ro(`exit`), - exit_code: oo() - })]) - })) - }), - Co({ - type: Ro(`tool_search_call`), - id: Ra$2(), - execution: Io([`server`, `client`]), - call_id: Ra$2().nullable(), - status: Io([ - `in_progress`, - `completed`, - `incomplete` - ]), - arguments: _o() - }), - Co({ - type: Ro(`tool_search_output`), - id: Ra$2(), - execution: Io([`server`, `client`]), - call_id: Ra$2().nullable(), - status: Io([ - `in_progress`, - `completed`, - `incomplete` - ]), - tools: xo(Po(Ra$2(), Q$3.optional())) - }) - ]) - }), - Co({ - type: Ro(`response.function_call_arguments.delta`), - item_id: Ra$2(), - output_index: oo(), - delta: Ra$2() - }), - Co({ - type: Ro(`response.custom_tool_call_input.delta`), - item_id: Ra$2(), - output_index: oo(), - delta: Ra$2() - }), - Co({ - type: Ro(`response.image_generation_call.partial_image`), - item_id: Ra$2(), - output_index: oo(), - partial_image_b64: Ra$2() - }), - Co({ - type: Ro(`response.code_interpreter_call_code.delta`), - item_id: Ra$2(), - output_index: oo(), - delta: Ra$2() - }), - Co({ - type: Ro(`response.code_interpreter_call_code.done`), - item_id: Ra$2(), - output_index: oo(), - code: Ra$2() - }), - Co({ - type: Ro(`response.output_text.annotation.added`), - annotation: Oo(`type`, [ - Co({ - type: Ro(`url_citation`), - start_index: oo(), - end_index: oo(), - url: Ra$2(), - title: Ra$2() - }), - Co({ - type: Ro(`file_citation`), - file_id: Ra$2(), - filename: Ra$2(), - index: oo() - }), - Co({ - type: Ro(`container_file_citation`), - container_id: Ra$2(), - file_id: Ra$2(), - filename: Ra$2(), - start_index: oo(), - end_index: oo() - }), - Co({ - type: Ro(`file_path`), - file_id: Ra$2(), - index: oo() - }) - ]) - }), - Co({ - type: Ro(`response.reasoning_summary_part.added`), - item_id: Ra$2(), - summary_index: oo() - }), - Co({ - type: Ro(`response.reasoning_summary_text.delta`), - item_id: Ra$2(), - summary_index: oo(), - delta: Ra$2() - }), - Co({ - type: Ro(`response.reasoning_summary_part.done`), - item_id: Ra$2(), - summary_index: oo() - }), - Co({ - type: Ro(`response.apply_patch_call_operation_diff.delta`), - item_id: Ra$2(), - output_index: oo(), - delta: Ra$2(), - obfuscation: Ra$2().nullish() - }), - Co({ - type: Ro(`response.apply_patch_call_operation_diff.done`), - item_id: Ra$2(), - output_index: oo(), - diff: Ra$2() - }), - Jt$2, - Yt$2, - Co({ type: Ra$2() }).loose().transform((e) => ({ - type: `unknown_chunk`, - message: e.type - })) -]))); -var Zt$2 = Wu(() => Qu(Co({ - id: Ra$2().optional(), - created_at: oo().optional(), - error: Co({ - message: Ra$2(), - type: Ra$2(), - param: Ra$2().nullish(), - code: Ra$2() - }).nullish(), - model: Ra$2().optional(), - output: xo(Oo(`type`, [ - Co({ - type: Ro(`message`), - role: Ro(`assistant`), - id: Ra$2(), - phase: Io([`commentary`, `final_answer`]).nullish(), - content: xo(Co({ - type: Ro(`output_text`), - text: Ra$2(), - logprobs: xo(Co({ - token: Ra$2(), - logprob: oo(), - top_logprobs: xo(Co({ - token: Ra$2(), - logprob: oo() - })) - })).nullish(), - annotations: xo(Oo(`type`, [ - Co({ - type: Ro(`url_citation`), - start_index: oo(), - end_index: oo(), - url: Ra$2(), - title: Ra$2() - }), - Co({ - type: Ro(`file_citation`), - file_id: Ra$2(), - filename: Ra$2(), - index: oo() - }), - Co({ - type: Ro(`container_file_citation`), - container_id: Ra$2(), - file_id: Ra$2(), - filename: Ra$2(), - start_index: oo(), - end_index: oo() - }), - Co({ - type: Ro(`file_path`), - file_id: Ra$2(), - index: oo() - }) - ])) - })) - }), - Co({ - type: Ro(`web_search_call`), - id: Ra$2(), - status: Ra$2(), - action: Oo(`type`, [ - Co({ - type: Ro(`search`), - query: Ra$2().nullish(), - queries: xo(Ra$2()).nullish(), - sources: xo(Oo(`type`, [Co({ - type: Ro(`url`), - url: Ra$2() - }), Co({ - type: Ro(`api`), - name: Ra$2() - })])).nullish() - }), - Co({ - type: Ro(`open_page`), - url: Ra$2().nullish() - }), - Co({ - type: Ro(`find_in_page`), - url: Ra$2().nullish(), - pattern: Ra$2().nullish() - }) - ]).nullish() - }), - Co({ - type: Ro(`file_search_call`), - id: Ra$2(), - queries: xo(Ra$2()), - results: xo(Co({ - attributes: Po(Ra$2(), Eo([ - Ra$2(), - oo(), - uo() - ])), - file_id: Ra$2(), - filename: Ra$2(), - score: oo(), - text: Ra$2() - })).nullish() - }), - Co({ - type: Ro(`code_interpreter_call`), - id: Ra$2(), - code: Ra$2().nullable(), - container_id: Ra$2(), - outputs: xo(Oo(`type`, [Co({ - type: Ro(`logs`), - logs: Ra$2() - }), Co({ - type: Ro(`image`), - url: Ra$2() - })])).nullable() - }), - Co({ - type: Ro(`image_generation_call`), - id: Ra$2(), - result: Ra$2() - }), - Co({ - type: Ro(`local_shell_call`), - id: Ra$2(), - call_id: Ra$2(), - action: Co({ - type: Ro(`exec`), - command: xo(Ra$2()), - timeout_ms: oo().optional(), - user: Ra$2().optional(), - working_directory: Ra$2().optional(), - env: Po(Ra$2(), Ra$2()).optional() - }) - }), - Co({ - type: Ro(`function_call`), - call_id: Ra$2(), - name: Ra$2(), - arguments: Ra$2(), - id: Ra$2(), - namespace: Ra$2().nullish() - }), - Co({ - type: Ro(`custom_tool_call`), - call_id: Ra$2(), - name: Ra$2(), - input: Ra$2(), - id: Ra$2() - }), - Co({ - type: Ro(`computer_call`), - id: Ra$2(), - status: Ra$2().optional() - }), - Co({ - type: Ro(`reasoning`), - id: Ra$2(), - encrypted_content: Ra$2().nullish(), - summary: xo(Co({ - type: Ro(`summary_text`), - text: Ra$2() - })) - }), - Co({ - type: Ro(`mcp_call`), - id: Ra$2(), - status: Ra$2(), - arguments: Ra$2(), - name: Ra$2(), - server_label: Ra$2(), - output: Ra$2().nullish(), - error: Eo([Ra$2(), Co({ - type: Ra$2().optional(), - code: Eo([oo(), Ra$2()]).optional(), - message: Ra$2().optional() - }).loose()]).nullish(), - approval_request_id: Ra$2().nullish() - }), - Co({ - type: Ro(`mcp_list_tools`), - id: Ra$2(), - server_label: Ra$2(), - tools: xo(Co({ - name: Ra$2(), - description: Ra$2().optional(), - input_schema: ho(), - annotations: Po(Ra$2(), _o()).optional() - })), - error: Eo([Ra$2(), Co({ - type: Ra$2().optional(), - code: Eo([oo(), Ra$2()]).optional(), - message: Ra$2().optional() - }).loose()]).optional() - }), - Co({ - type: Ro(`mcp_approval_request`), - id: Ra$2(), - server_label: Ra$2(), - name: Ra$2(), - arguments: Ra$2(), - approval_request_id: Ra$2().optional() - }), - Co({ - type: Ro(`apply_patch_call`), - id: Ra$2(), - call_id: Ra$2(), - status: Io([`in_progress`, `completed`]), - operation: Oo(`type`, [ - Co({ - type: Ro(`create_file`), - path: Ra$2(), - diff: Ra$2() - }), - Co({ - type: Ro(`delete_file`), - path: Ra$2() - }), - Co({ - type: Ro(`update_file`), - path: Ra$2(), - diff: Ra$2() - }) - ]) - }), - Co({ - type: Ro(`shell_call`), - id: Ra$2(), - call_id: Ra$2(), - status: Io([ - `in_progress`, - `completed`, - `incomplete` - ]), - action: Co({ commands: xo(Ra$2()) }) - }), - Co({ - type: Ro(`compaction`), - id: Ra$2(), - encrypted_content: Ra$2() - }), - Co({ - type: Ro(`shell_call_output`), - id: Ra$2(), - call_id: Ra$2(), - status: Io([ - `in_progress`, - `completed`, - `incomplete` - ]), - output: xo(Co({ - stdout: Ra$2(), - stderr: Ra$2(), - outcome: Oo(`type`, [Co({ type: Ro(`timeout`) }), Co({ - type: Ro(`exit`), - exit_code: oo() - })]) - })) - }), - Co({ - type: Ro(`tool_search_call`), - id: Ra$2(), - execution: Io([`server`, `client`]), - call_id: Ra$2().nullable(), - status: Io([ - `in_progress`, - `completed`, - `incomplete` - ]), - arguments: _o() - }), - Co({ - type: Ro(`tool_search_output`), - id: Ra$2(), - execution: Io([`server`, `client`]), - call_id: Ra$2().nullable(), - status: Io([ - `in_progress`, - `completed`, - `incomplete` - ]), - tools: xo(Po(Ra$2(), Q$3.optional())) - }) - ])).optional(), - service_tier: Ra$2().nullish(), - incomplete_details: Co({ reason: Ra$2() }).nullish(), - usage: Co({ - input_tokens: oo(), - input_tokens_details: Co({ - cached_tokens: oo().nullish(), - orchestration_input_tokens: oo().nullish(), - orchestration_input_cached_tokens: oo().nullish() - }).nullish(), - output_tokens: oo(), - output_tokens_details: Co({ - reasoning_tokens: oo().nullish(), - orchestration_output_tokens: oo().nullish() - }).nullish() - }).optional() -}))); -var Qt$2 = 20; -var $t$2 = Wu(() => Qu(Co({ - conversation: Ra$2().nullish(), - include: xo(Io([ - `reasoning.encrypted_content`, - `file_search_call.results`, - `message.output_text.logprobs` - ])).nullish(), - instructions: Ra$2().nullish(), - logprobs: Eo([uo(), oo().min(1).max(Qt$2)]).optional(), - maxToolCalls: oo().nullish(), - metadata: ho().nullish(), - parallelToolCalls: uo().nullish(), - previousResponseId: Ra$2().nullish(), - promptCacheKey: Ra$2().nullish(), - promptCacheRetention: Io([`in_memory`, `24h`]).nullish(), - reasoningEffort: Ra$2().nullish(), - reasoningSummary: Ra$2().nullish(), - safetyIdentifier: Ra$2().nullish(), - serviceTier: Io([ - `auto`, - `flex`, - `priority`, - `default` - ]).nullish(), - store: uo().nullish(), - passThroughUnsupportedFiles: uo().optional(), - strictJsonSchema: uo().nullish(), - textVerbosity: Io([ - `low`, - `medium`, - `high` - ]).nullish(), - truncation: Io([`auto`, `disabled`]).nullish(), - user: Ra$2().nullish(), - systemMessageMode: Io([ - `system`, - `developer`, - `remove` - ]).optional(), - forceReasoning: uo().optional(), - contextManagement: xo(Co({ - type: Ro(`compaction`), - compactThreshold: oo() - })).nullish(), - allowedTools: Co({ - toolNames: xo(Ra$2()).min(1), - mode: Io([`auto`, `required`]).optional() - }).optional() -}))); -async function en$2({ tools: e, toolChoice: t, allowedTools: n, toolNameMapping: i, customProviderToolNames: a }) { - e = e?.length ? e : void 0; - let o = []; - if (e == null) return { - tools: void 0, - toolChoice: void 0, - toolWarnings: o - }; - let s = [], c = /* @__PURE__ */ new Map(), l = a ?? /* @__PURE__ */ new Set(); - for (let t of e) switch (t.type) { - case `function`: { - let e = t.providerOptions?.openai, n = tn$2({ - tool: t, - options: e - }), i = e?.namespace; - if (i == null) s.push(n); - else { - let e = c.get(i.name); - if (e == null) e = { - type: `namespace`, - name: i.name, - description: i.description, - tools: [] - }, c.set(i.name, e), s.push(e); - else if (e.description !== i.description) throw new Ie$10({ functionality: `conflicting descriptions for OpenAI tool namespace "${i.name}"` }); - e.tools.push(n); - } - break; - } - case `provider`: - switch (t.id) { - case `openai.file_search`: { - let e = await $u({ - value: t.args, - schema: ut$2 - }); - s.push({ - type: `file_search`, - vector_store_ids: e.vectorStoreIds, - max_num_results: e.maxNumResults, - ranking_options: e.ranking ? { - ranker: e.ranking.ranker, - score_threshold: e.ranking.scoreThreshold - } : void 0, - filters: e.filters - }); - break; - } - case `openai.local_shell`: - s.push({ type: `local_shell` }); - break; - case `openai.shell`: { - let e = await $u({ - value: t.args, - schema: St$2 - }); - s.push({ - type: `shell`, - ...e.environment && { environment: nn$2(e.environment) } - }); - break; - } - case `openai.apply_patch`: - s.push({ type: `apply_patch` }); - break; - case `openai.web_search_preview`: { - let e = await $u({ - value: t.args, - schema: Mt$2 - }); - s.push({ - type: `web_search_preview`, - search_context_size: e.searchContextSize, - user_location: e.userLocation - }); - break; - } - case `openai.web_search`: { - let e = await $u({ - value: t.args, - schema: kt$2 - }); - s.push({ - type: `web_search`, - filters: e.filters == null ? void 0 : { allowed_domains: e.filters.allowedDomains }, - external_web_access: e.externalWebAccess, - search_context_size: e.searchContextSize, - user_location: e.userLocation - }); - break; - } - case `openai.code_interpreter`: { - let e = await $u({ - value: t.args, - schema: nt$2 - }); - s.push({ - type: `code_interpreter`, - container: e.container == null ? { - type: `auto`, - file_ids: void 0 - } : typeof e.container == `string` ? e.container : { - type: `auto`, - file_ids: e.container.fileIds - } - }); - break; - } - case `openai.image_generation`: { - let e = await $u({ - value: t.args, - schema: pt$2 - }); - s.push({ - type: `image_generation`, - background: e.background, - input_fidelity: e.inputFidelity, - input_image_mask: e.inputImageMask ? { - file_id: e.inputImageMask.fileId, - image_url: e.inputImageMask.imageUrl - } : void 0, - model: e.model, - moderation: e.moderation, - partial_images: e.partialImages, - quality: e.quality, - output_compression: e.outputCompression, - output_format: e.outputFormat, - size: e.size - }); - break; - } - case `openai.mcp`: { - let e = await $u({ - value: t.args, - schema: Ft$2 - }), n = (e) => ({ tool_names: e.toolNames }), r = e.requireApproval, i = r == null ? void 0 : typeof r == `string` ? r : r.never == null ? void 0 : { never: n(r.never) }; - s.push({ - type: `mcp`, - server_label: e.serverLabel, - allowed_tools: Array.isArray(e.allowedTools) ? e.allowedTools : e.allowedTools ? { - read_only: e.allowedTools.readOnly, - tool_names: e.allowedTools.toolNames - } : void 0, - authorization: e.authorization, - connector_id: e.connectorId, - headers: e.headers, - require_approval: i ?? `never`, - server_description: e.serverDescription, - server_url: e.serverUrl - }); - break; - } - case `openai.custom`: { - let e = await $u({ - value: t.args, - schema: at$2 - }); - s.push({ - type: `custom`, - name: t.name, - description: e.description, - format: e.format - }), l.add(t.name); - break; - } - case `openai.tool_search`: { - let e = await $u({ - value: t.args, - schema: wt$2 - }); - s.push({ - type: `tool_search`, - ...e.execution == null ? {} : { execution: e.execution }, - ...e.description == null ? {} : { description: e.description }, - ...e.parameters == null ? {} : { parameters: e.parameters } - }); - break; - } - } - break; - default: - o.push({ - type: `unsupported`, - feature: `function tool ${t}` - }); - break; - } - if (n != null) return { - tools: s, - toolChoice: { - type: `allowed_tools`, - mode: n.mode ?? `auto`, - tools: n.toolNames.map((e) => ({ - type: `function`, - name: i?.toProviderToolName(e) ?? e - })) - }, - toolWarnings: o - }; - if (t == null) return { - tools: s, - toolChoice: void 0, - toolWarnings: o - }; - let u = t.type; - switch (u) { - case `auto`: - case `none`: - case `required`: return { - tools: s, - toolChoice: u, - toolWarnings: o - }; - case `tool`: { - let e = i?.toProviderToolName(t.toolName) ?? t.toolName; - return { - tools: s, - toolChoice: e === `code_interpreter` || e === `file_search` || e === `image_generation` || e === `web_search_preview` || e === `web_search` || e === `mcp` || e === `apply_patch` ? { type: e } : l.has(e) ? { - type: `custom`, - name: e - } : { - type: `function`, - name: e - }, - toolWarnings: o - }; - } - default: throw new Ie$10({ functionality: `tool choice type: ${u}` }); - } -} -function tn$2({ tool: e, options: t }) { - let n = t?.deferLoading; - return { - type: `function`, - name: e.name, - description: e.description, - parameters: e.inputSchema, - ...e.strict == null ? {} : { strict: e.strict }, - ...n == null ? {} : { defer_loading: n } - }; -} -function nn$2(e) { - if (e.type === `containerReference`) return { - type: `container_reference`, - container_id: e.containerId - }; - if (e.type === `containerAuto`) { - let t = e; - return { - type: `container_auto`, - file_ids: t.fileIds, - memory_limit: t.memoryLimit, - network_policy: t.networkPolicy == null ? void 0 : t.networkPolicy.type === `disabled` ? { type: `disabled` } : { - type: `allowlist`, - allowed_domains: t.networkPolicy.allowedDomains, - domain_secrets: t.networkPolicy.domainSecrets - }, - skills: rn$2(t.skills) - }; - } - return { - type: `local`, - skills: e.skills - }; -} -function rn$2(e) { - return e?.map((e) => e.type === `skillReference` ? { - type: `skill_reference`, - skill_id: _d({ - reference: e.providerReference ?? {}, - provider: `openai` - }), - version: e.version ?? `latest` - } : { - type: `inline`, - name: e.name, - description: e.description, - source: { - type: `base64`, - media_type: e.source.mediaType, - data: e.source.data - } - }); -} -function an$2(e) { - let t = {}; - for (let n of e) if (n.role === `assistant`) for (let e of n.content) { - if (e.type !== `tool-call`) continue; - let n = e.providerOptions?.openai?.approvalRequestId; - n != null && (t[n] = e.toolCallId); - } - return t; -} -var on$2 = class t { - constructor(e, t) { - this.specificationVersion = `v4`, this.supportedUrls = { - "image/*": [/^https?:\/\/.*$/], - "application/pdf": [/^https?:\/\/.*$/] - }, this.modelId = e, this.config = t; - } - static [Mc](e) { - return Cd({ - modelId: e.modelId, - config: e.config - }); - } - static [Nc](e) { - return new t(e.modelId, e.config); - } - get provider() { - return this.config.provider; - } - async getArgs({ maxOutputTokens: e, temperature: t, stopSequences: n, topP: r, topK: i, presencePenalty: a, frequencyPenalty: o, seed: s, prompt: c, reasoning: l, providerOptions: u, tools: d, toolChoice: p, responseFormat: m }) { - let h = [], _ = ce$2(this.modelId); - i != null && h.push({ - type: `unsupported`, - feature: `topK` - }), s != null && h.push({ - type: `unsupported`, - feature: `seed` - }), a != null && h.push({ - type: `unsupported`, - feature: `presencePenalty` - }), o != null && h.push({ - type: `unsupported`, - feature: `frequencyPenalty` - }), n != null && h.push({ - type: `unsupported`, - feature: `stopSequences` - }); - let v = this.config.provider.includes(`azure`) ? `azure` : `openai`, y = await ad({ - provider: v, - providerOptions: u, - schema: $t$2 - }); - y == null && v !== `openai` && (y = await ad({ - provider: `openai`, - providerOptions: u, - schema: $t$2 - })); - let b = y?.reasoningEffort ?? (Il(l) ? l : void 0), x = y?.reasoningSummary === void 0 ? b != null && b !== `none` ? `detailed` : void 0 : y.reasoningSummary, S = y?.forceReasoning ?? _.isReasoningModel; - y?.conversation && y?.previousResponseId && h.push({ - type: `unsupported`, - feature: `conversation`, - details: `conversation and previousResponseId cannot be used together` - }); - let C = Hc({ - tools: d, - providerToolNames: { - "openai.code_interpreter": `code_interpreter`, - "openai.file_search": `file_search`, - "openai.image_generation": `image_generation`, - "openai.local_shell": `local_shell`, - "openai.shell": `shell`, - "openai.web_search": `web_search`, - "openai.web_search_preview": `web_search_preview`, - "openai.mcp": `mcp`, - "openai.apply_patch": `apply_patch`, - "openai.tool_search": `tool_search` - } - }), w = /* @__PURE__ */ new Set(), { tools: T, toolChoice: E, toolWarnings: D } = await en$2({ - tools: d, - toolChoice: p, - allowedTools: y?.allowedTools ?? void 0, - toolNameMapping: C, - customProviderToolNames: w - }), { input: O, warnings: k } = await Gt$2({ - prompt: c, - toolNameMapping: C, - systemMessageMode: y?.systemMessageMode ?? (S ? `developer` : _.systemMessageMode), - providerOptionsName: v, - fileIdPrefixes: this.config.fileIdPrefixes, - passThroughUnsupportedFiles: y?.passThroughUnsupportedFiles ?? !1, - store: y?.store ?? !0, - hasConversation: y?.conversation != null, - hasPreviousResponseId: y?.previousResponseId != null, - hasLocalShellTool: N(`openai.local_shell`), - hasShellTool: N(`openai.shell`), - hasApplyPatchTool: N(`openai.apply_patch`), - customProviderToolNames: w.size > 0 ? w : void 0 - }); - h.push(...k); - let A = y?.strictJsonSchema ?? !0, j = y?.include; - function M(e) { - j == null ? j = [e] : j.includes(e) || (j = [...j, e]); - } - function N(e) { - return d?.find((t) => t.type === `provider` && t.id === e) != null; - } - let P = typeof y?.logprobs == `number` ? y?.logprobs : y?.logprobs === !0 ? Qt$2 : void 0; - P && M(`message.output_text.logprobs`); - let te = d?.find((e) => e.type === `provider` && (e.id === `openai.web_search` || e.id === `openai.web_search_preview`))?.name; - te && M(`web_search_call.action.sources`), N(`openai.code_interpreter`) && M(`code_interpreter_call.outputs`); - let F = y?.store; - F === !1 && S && M(`reasoning.encrypted_content`); - let I = { - model: this.modelId, - input: O, - temperature: t, - top_p: r, - max_output_tokens: e, - ...(m?.type === `json` || y?.textVerbosity) && { text: { - ...m?.type === `json` && { format: m.schema == null ? { type: `json_object` } : { - type: `json_schema`, - strict: A, - name: m.name ?? `response`, - description: m.description, - schema: m.schema - } }, - ...y?.textVerbosity && { verbosity: y.textVerbosity } - } }, - conversation: y?.conversation, - max_tool_calls: y?.maxToolCalls, - metadata: y?.metadata, - parallel_tool_calls: y?.parallelToolCalls, - previous_response_id: y?.previousResponseId, - store: F, - user: y?.user, - instructions: y?.instructions, - service_tier: y?.serviceTier, - include: j, - prompt_cache_key: y?.promptCacheKey, - prompt_cache_retention: y?.promptCacheRetention, - safety_identifier: y?.safetyIdentifier, - top_logprobs: P, - truncation: y?.truncation, - ...y?.contextManagement && { context_management: y.contextManagement.map((e) => ({ - type: e.type, - compact_threshold: e.compactThreshold - })) }, - ...S && (b != null || x != null) && { reasoning: { - ...b != null && { effort: b }, - ...x != null && { summary: x } - } } - }; - S ? b === `none` && _.supportsNonReasoningParameters || (I.temperature != null && (I.temperature = void 0, h.push({ - type: `unsupported`, - feature: `temperature`, - details: `temperature is not supported for reasoning models` - })), I.top_p != null && (I.top_p = void 0, h.push({ - type: `unsupported`, - feature: `topP`, - details: `topP is not supported for reasoning models` - }))) : (y?.reasoningEffort != null && h.push({ - type: `unsupported`, - feature: `reasoningEffort`, - details: `reasoningEffort is not supported for non-reasoning models` - }), y?.reasoningSummary != null && h.push({ - type: `unsupported`, - feature: `reasoningSummary`, - details: `reasoningSummary is not supported for non-reasoning models` - })), y?.serviceTier === `flex` && !_.supportsFlexProcessing && (h.push({ - type: `unsupported`, - feature: `serviceTier`, - details: `flex processing is only available for o3, o4-mini, and gpt-5 models` - }), delete I.service_tier), y?.serviceTier === `priority` && !_.supportsPriorityProcessing && (h.push({ - type: `unsupported`, - feature: `serviceTier`, - details: `priority processing is only available for supported models (gpt-4, gpt-5, gpt-5-mini, o3, o4-mini) and requires Enterprise access. gpt-5-nano is not supported` - }), delete I.service_tier); - let L = d?.find((e) => e.type === `provider` && e.id === `openai.shell`)?.args?.environment?.type, R = L === `containerAuto` || L === `containerReference`; - return { - webSearchToolName: te, - args: { - ...I, - tools: T, - tool_choice: E - }, - warnings: [...h, ...D], - store: F, - toolNameMapping: C, - providerOptionsName: v, - isShellProviderExecuted: R - }; - } - async doGenerate(t) { - var n, r, i, a, o, s; - let { args: c, warnings: l, webSearchToolName: u, toolNameMapping: d, providerOptionsName: f, isShellProviderExecuted: p } = await this.getArgs(t), m = this.config.url({ - path: `/responses`, - modelId: this.modelId - }), h = an$2(t.prompt), { responseHeaders: g, value: _, rawValue: v } = await sd({ - url: m, - headers: Pc((n = this.config).headers?.call(n), t.headers), - body: c, - failedResponseHandler: X$3, - successfulResponseHandler: bd(Zt$2), - abortSignal: t.abortSignal, - fetch: this.config.fetch - }); - if (_.error) throw new c$14({ - message: _.error.message, - url: m, - requestBodyValues: c, - statusCode: 400, - responseHeaders: g, - responseBody: v, - isRetryable: !1 - }); - let y = [], b = [], x = !1, S = []; - for (let e of _.output) switch (e.type) { - case `reasoning`: - e.summary.length === 0 && e.summary.push({ - type: `summary_text`, - text: `` - }); - for (let t of e.summary) y.push({ - type: `reasoning`, - text: t.text, - providerMetadata: { [f]: { - itemId: e.id, - reasoningEncryptedContent: e.encrypted_content ?? null - } } - }); - break; - case `image_generation_call`: - y.push({ - type: `tool-call`, - toolCallId: e.id, - toolName: d.toCustomToolName(`image_generation`), - input: `{}`, - providerExecuted: !0 - }), y.push({ - type: `tool-result`, - toolCallId: e.id, - toolName: d.toCustomToolName(`image_generation`), - result: { result: e.result } - }); - break; - case `tool_search_call`: { - let t = e.call_id ?? e.id, n = e.execution === `server`; - n && S.push(t), y.push({ - type: `tool-call`, - toolCallId: t, - toolName: d.toCustomToolName(`tool_search`), - input: JSON.stringify({ - arguments: e.arguments, - call_id: e.call_id - }), - ...n ? { providerExecuted: !0 } : {}, - providerMetadata: { [f]: { itemId: e.id } } - }); - break; - } - case `tool_search_output`: { - let t = e.call_id ?? S.shift() ?? e.id; - y.push({ - type: `tool-result`, - toolCallId: t, - toolName: d.toCustomToolName(`tool_search`), - result: { tools: e.tools }, - providerMetadata: { [f]: { itemId: e.id } } - }); - break; - } - case `local_shell_call`: - y.push({ - type: `tool-call`, - toolCallId: e.call_id, - toolName: d.toCustomToolName(`local_shell`), - input: JSON.stringify({ action: e.action }), - providerMetadata: { [f]: { itemId: e.id } } - }); - break; - case `shell_call`: - y.push({ - type: `tool-call`, - toolCallId: e.call_id, - toolName: d.toCustomToolName(`shell`), - input: JSON.stringify({ action: { commands: e.action.commands } }), - ...p && { providerExecuted: !0 }, - providerMetadata: { [f]: { itemId: e.id } } - }); - break; - case `shell_call_output`: - y.push({ - type: `tool-result`, - toolCallId: e.call_id, - toolName: d.toCustomToolName(`shell`), - result: { output: e.output.map((e) => ({ - stdout: e.stdout, - stderr: e.stderr, - outcome: e.outcome.type === `exit` ? { - type: `exit`, - exitCode: e.outcome.exit_code - } : { type: `timeout` } - })) } - }); - break; - case `message`: - for (let n of e.content) { - t.providerOptions?.[f]?.logprobs && n.logprobs && b.push(n.logprobs); - let s = { - itemId: e.id, - ...e.phase != null && { phase: e.phase }, - ...n.annotations.length > 0 && { annotations: n.annotations } - }; - y.push({ - type: `text`, - text: n.text, - providerMetadata: { [f]: s } - }); - for (let e of n.annotations) e.type === `url_citation` ? y.push({ - type: `source`, - sourceType: `url`, - id: (r = this.config).generateId?.call(r) ?? bl(), - url: e.url, - title: e.title - }) : e.type === `file_citation` ? y.push({ - type: `source`, - sourceType: `document`, - id: (i = this.config).generateId?.call(i) ?? bl(), - mediaType: `text/plain`, - title: e.filename, - filename: e.filename, - providerMetadata: { [f]: { - type: e.type, - fileId: e.file_id, - index: e.index - } } - }) : e.type === `container_file_citation` ? y.push({ - type: `source`, - sourceType: `document`, - id: (a = this.config).generateId?.call(a) ?? bl(), - mediaType: `text/plain`, - title: e.filename, - filename: e.filename, - providerMetadata: { [f]: { - type: e.type, - fileId: e.file_id, - containerId: e.container_id - } } - }) : e.type === `file_path` && y.push({ - type: `source`, - sourceType: `document`, - id: (o = this.config).generateId?.call(o) ?? bl(), - mediaType: `application/octet-stream`, - title: e.file_id, - filename: e.file_id, - providerMetadata: { [f]: { - type: e.type, - fileId: e.file_id, - index: e.index - } } - }); - } - break; - case `function_call`: - x = !0, y.push({ - type: `tool-call`, - toolCallId: e.call_id, - toolName: e.name, - input: e.arguments, - providerMetadata: { [f]: { - itemId: e.id, - ...e.namespace != null && { namespace: e.namespace } - } } - }); - break; - case `custom_tool_call`: { - x = !0; - let t = d.toCustomToolName(e.name); - y.push({ - type: `tool-call`, - toolCallId: e.call_id, - toolName: t, - input: JSON.stringify(e.input), - providerMetadata: { [f]: { itemId: e.id } } - }); - break; - } - case `web_search_call`: - y.push({ - type: `tool-call`, - toolCallId: e.id, - toolName: d.toCustomToolName(u ?? `web_search`), - input: JSON.stringify({}), - providerExecuted: !0 - }), y.push({ - type: `tool-result`, - toolCallId: e.id, - toolName: d.toCustomToolName(u ?? `web_search`), - result: Cn$2(e.action) - }); - break; - case `mcp_call`: { - let t = e.approval_request_id == null ? e.id : h[e.approval_request_id] ?? e.id, n = `mcp.${e.name}`; - y.push({ - type: `tool-call`, - toolCallId: t, - toolName: n, - input: e.arguments, - providerExecuted: !0, - dynamic: !0 - }), y.push({ - type: `tool-result`, - toolCallId: t, - toolName: n, - result: { - type: `call`, - serverLabel: e.server_label, - name: e.name, - arguments: e.arguments, - ...e.output == null ? {} : { output: e.output }, - ...e.error == null ? {} : { error: e.error } - }, - providerMetadata: { [f]: { itemId: e.id } } - }); - break; - } - case `mcp_list_tools`: break; - case `mcp_approval_request`: { - let t = e.approval_request_id ?? e.id, n = (s = this.config).generateId?.call(s) ?? bl(), r = `mcp.${e.name}`; - y.push({ - type: `tool-call`, - toolCallId: n, - toolName: r, - input: e.arguments, - providerExecuted: !0, - dynamic: !0 - }), y.push({ - type: `tool-approval-request`, - approvalId: t, - toolCallId: n - }); - break; - } - case `computer_call`: - y.push({ - type: `tool-call`, - toolCallId: e.id, - toolName: d.toCustomToolName(`computer_use`), - input: ``, - providerExecuted: !0 - }), y.push({ - type: `tool-result`, - toolCallId: e.id, - toolName: d.toCustomToolName(`computer_use`), - result: { - type: `computer_use_tool_result`, - status: e.status || `completed` - } - }); - break; - case `file_search_call`: - y.push({ - type: `tool-call`, - toolCallId: e.id, - toolName: d.toCustomToolName(`file_search`), - input: `{}`, - providerExecuted: !0 - }), y.push({ - type: `tool-result`, - toolCallId: e.id, - toolName: d.toCustomToolName(`file_search`), - result: { - queries: e.queries, - results: e.results?.map((e) => ({ - attributes: e.attributes, - fileId: e.file_id, - filename: e.filename, - score: e.score, - text: e.text - })) ?? null - } - }); - break; - case `code_interpreter_call`: - y.push({ - type: `tool-call`, - toolCallId: e.id, - toolName: d.toCustomToolName(`code_interpreter`), - input: JSON.stringify({ - code: e.code, - containerId: e.container_id - }), - providerExecuted: !0 - }), y.push({ - type: `tool-result`, - toolCallId: e.id, - toolName: d.toCustomToolName(`code_interpreter`), - result: { outputs: e.outputs } - }); - break; - case `apply_patch_call`: - y.push({ - type: `tool-call`, - toolCallId: e.call_id, - toolName: d.toCustomToolName(`apply_patch`), - input: JSON.stringify({ - callId: e.call_id, - operation: e.operation - }), - providerMetadata: { [f]: { itemId: e.id } } - }); - break; - case `compaction`: - y.push({ - type: `custom`, - kind: `openai.compaction`, - providerMetadata: { [f]: { - type: `compaction`, - itemId: e.id, - encryptedContent: e.encrypted_content - } } - }); - break; - } - let w = { [f]: { - responseId: _.id, - ...b.length > 0 ? { logprobs: b } : {}, - ...typeof _.service_tier == `string` ? { serviceTier: _.service_tier } : {} - } }, T = _.usage; - return { - content: y, - finishReason: { - unified: qt$2({ - finishReason: _.incomplete_details?.reason, - hasFunctionCall: x - }), - raw: _.incomplete_details?.reason ?? void 0 - }, - usage: Ht$2(T), - request: { body: c }, - response: { - id: _.id, - timestamp: /* @__PURE__ */ new Date(_.created_at * 1e3), - modelId: _.model, - headers: g, - body: v - }, - providerMetadata: w, - warnings: l - }; - } - async doStream(e) { - var t; - let { args: n, warnings: r, webSearchToolName: i, toolNameMapping: a, store: o, providerOptionsName: s, isShellProviderExecuted: c } = await this.getArgs(e), l = this.config.url({ - path: `/responses`, - modelId: this.modelId - }), { responseHeaders: u, value: d } = await sd({ - url: l, - headers: Pc((t = this.config).headers?.call(t), e.headers), - body: { - ...n, - stream: !0 - }, - failedResponseHandler: X$3, - successfulResponseHandler: yd(Xt$2), - abortSignal: e.abortSignal, - fetch: this.config.fetch - }), f = await le$2({ - stream: d, - getError: (e) => xn$2(e) || un$2(e) && e.response.error != null ? e : void 0, - isOutputChunk: Sn$2, - url: l, - requestBodyValues: n, - responseHeaders: u - }), p = this, m = an$2(e.prompt), h = /* @__PURE__ */ new Map(), g = { - unified: `other`, - raw: void 0 - }, _, v = [], y = null, b = {}, x = [], S, w = !1, T = {}, E, D = [], O = !1; - return { - stream: f.pipeThrough(new TransformStream({ - start(e) { - e.enqueue({ - type: `stream-start`, - warnings: r - }); - }, - transform(t, n) { - var r, l, u, d, f; - if (e.includeRawChunks && n.enqueue({ - type: `raw`, - rawValue: t.rawValue - }), !t.success) { - g = { - unified: `error`, - raw: void 0 - }, n.enqueue({ - type: `error`, - error: t.error - }); - return; - } - let k = t.value; - if (yn$2(k)) { - if (k.item.type === `function_call`) b[k.output_index] = { - toolName: k.item.name, - toolCallId: k.item.call_id - }, n.enqueue({ - type: `tool-input-start`, - id: k.item.call_id, - toolName: k.item.name - }); - else if (k.item.type === `custom_tool_call`) { - let e = a.toCustomToolName(k.item.name); - b[k.output_index] = { - toolName: e, - toolCallId: k.item.call_id - }, n.enqueue({ - type: `tool-input-start`, - id: k.item.call_id, - toolName: e - }); - } else if (k.item.type === `web_search_call`) b[k.output_index] = { - toolName: a.toCustomToolName(i ?? `web_search`), - toolCallId: k.item.id - }, n.enqueue({ - type: `tool-input-start`, - id: k.item.id, - toolName: a.toCustomToolName(i ?? `web_search`), - providerExecuted: !0 - }), n.enqueue({ - type: `tool-input-end`, - id: k.item.id - }), n.enqueue({ - type: `tool-call`, - toolCallId: k.item.id, - toolName: a.toCustomToolName(i ?? `web_search`), - input: JSON.stringify({}), - providerExecuted: !0 - }); - else if (k.item.type === `computer_call`) b[k.output_index] = { - toolName: a.toCustomToolName(`computer_use`), - toolCallId: k.item.id - }, n.enqueue({ - type: `tool-input-start`, - id: k.item.id, - toolName: a.toCustomToolName(`computer_use`), - providerExecuted: !0 - }); - else if (k.item.type === `code_interpreter_call`) b[k.output_index] = { - toolName: a.toCustomToolName(`code_interpreter`), - toolCallId: k.item.id, - codeInterpreter: { containerId: k.item.container_id } - }, n.enqueue({ - type: `tool-input-start`, - id: k.item.id, - toolName: a.toCustomToolName(`code_interpreter`), - providerExecuted: !0 - }), n.enqueue({ - type: `tool-input-delta`, - id: k.item.id, - delta: `{"containerId":"${k.item.container_id}","code":"` - }); - else if (k.item.type === `file_search_call`) n.enqueue({ - type: `tool-call`, - toolCallId: k.item.id, - toolName: a.toCustomToolName(`file_search`), - input: `{}`, - providerExecuted: !0 - }); - else if (k.item.type === `image_generation_call`) n.enqueue({ - type: `tool-call`, - toolCallId: k.item.id, - toolName: a.toCustomToolName(`image_generation`), - input: `{}`, - providerExecuted: !0 - }); - else if (k.item.type === `tool_search_call`) { - let e = k.item.id, t = a.toCustomToolName(`tool_search`), r = k.item.execution === `server`; - b[k.output_index] = { - toolName: t, - toolCallId: e, - toolSearchExecution: k.item.execution ?? `server` - }, r && n.enqueue({ - type: `tool-input-start`, - id: e, - toolName: t, - providerExecuted: !0 - }); - } else if (k.item.type !== `tool_search_output` && !(k.item.type === `mcp_call` || k.item.type === `mcp_list_tools` || k.item.type === `mcp_approval_request`)) if (k.item.type === `apply_patch_call`) { - let { call_id: e, operation: t } = k.item; - if (b[k.output_index] = { - toolName: a.toCustomToolName(`apply_patch`), - toolCallId: e, - applyPatch: { - hasDiff: t.type === `delete_file`, - endEmitted: t.type === `delete_file` - } - }, n.enqueue({ - type: `tool-input-start`, - id: e, - toolName: a.toCustomToolName(`apply_patch`) - }), t.type === `delete_file`) { - let r = JSON.stringify({ - callId: e, - operation: t - }); - n.enqueue({ - type: `tool-input-delta`, - id: e, - delta: r - }), n.enqueue({ - type: `tool-input-end`, - id: e - }); - } else n.enqueue({ - type: `tool-input-delta`, - id: e, - delta: `{"callId":"${$$3(e)}","operation":{"type":"${$$3(t.type)}","path":"${$$3(t.path)}","diff":"` - }); - } else k.item.type === `shell_call` ? b[k.output_index] = { - toolName: a.toCustomToolName(`shell`), - toolCallId: k.item.call_id - } : k.item.type === `shell_call_output` || (k.item.type === `message` ? (x.splice(0, x.length), S = k.item.phase ?? void 0, n.enqueue({ - type: `text-start`, - id: k.item.id, - providerMetadata: { [s]: { - itemId: k.item.id, - ...k.item.phase != null && { phase: k.item.phase } - } } - })) : yn$2(k) && k.item.type === `reasoning` && (T[k.item.id] = { - encryptedContent: k.item.encrypted_content, - summaryParts: { 0: `active` } - }, n.enqueue({ - type: `reasoning-start`, - id: `${k.item.id}:0`, - providerMetadata: { [s]: { - itemId: k.item.id, - reasoningEncryptedContent: k.item.encrypted_content ?? null - } } - }))); - } else if (cn$2(k)) if (k.item.type === `message`) { - let e = k.item.phase ?? S; - S = void 0, n.enqueue({ - type: `text-end`, - id: k.item.id, - providerMetadata: { [s]: { - itemId: k.item.id, - ...e != null && { phase: e }, - ...x.length > 0 && { annotations: x } - } } - }); - } else if (k.item.type === `function_call`) b[k.output_index] = void 0, w = !0, n.enqueue({ - type: `tool-input-end`, - id: k.item.call_id, - ...k.item.namespace != null && { providerMetadata: { [s]: { namespace: k.item.namespace } } } - }), n.enqueue({ - type: `tool-call`, - toolCallId: k.item.call_id, - toolName: k.item.name, - input: k.item.arguments, - providerMetadata: { [s]: { - itemId: k.item.id, - ...k.item.namespace != null && { namespace: k.item.namespace } - } } - }); - else if (k.item.type === `custom_tool_call`) { - b[k.output_index] = void 0, w = !0; - let e = a.toCustomToolName(k.item.name); - n.enqueue({ - type: `tool-input-end`, - id: k.item.call_id - }), n.enqueue({ - type: `tool-call`, - toolCallId: k.item.call_id, - toolName: e, - input: JSON.stringify(k.item.input), - providerMetadata: { [s]: { itemId: k.item.id } } - }); - } else if (k.item.type === `web_search_call`) b[k.output_index] = void 0, n.enqueue({ - type: `tool-result`, - toolCallId: k.item.id, - toolName: a.toCustomToolName(i ?? `web_search`), - result: Cn$2(k.item.action) - }); - else if (k.item.type === `computer_call`) b[k.output_index] = void 0, n.enqueue({ - type: `tool-input-end`, - id: k.item.id - }), n.enqueue({ - type: `tool-call`, - toolCallId: k.item.id, - toolName: a.toCustomToolName(`computer_use`), - input: ``, - providerExecuted: !0 - }), n.enqueue({ - type: `tool-result`, - toolCallId: k.item.id, - toolName: a.toCustomToolName(`computer_use`), - result: { - type: `computer_use_tool_result`, - status: k.item.status || `completed` - } - }); - else if (k.item.type === `file_search_call`) b[k.output_index] = void 0, n.enqueue({ - type: `tool-result`, - toolCallId: k.item.id, - toolName: a.toCustomToolName(`file_search`), - result: { - queries: k.item.queries, - results: k.item.results?.map((e) => ({ - attributes: e.attributes, - fileId: e.file_id, - filename: e.filename, - score: e.score, - text: e.text - })) ?? null - } - }); - else if (k.item.type === `code_interpreter_call`) b[k.output_index] = void 0, n.enqueue({ - type: `tool-result`, - toolCallId: k.item.id, - toolName: a.toCustomToolName(`code_interpreter`), - result: { outputs: k.item.outputs } - }); - else if (k.item.type === `image_generation_call`) n.enqueue({ - type: `tool-result`, - toolCallId: k.item.id, - toolName: a.toCustomToolName(`image_generation`), - result: { result: k.item.result } - }); - else if (k.item.type === `tool_search_call`) { - let e = b[k.output_index], t = k.item.execution === `server`; - if (e != null) { - let r = t ? e.toolCallId : k.item.call_id ?? k.item.id; - t ? D.push(r) : n.enqueue({ - type: `tool-input-start`, - id: r, - toolName: e.toolName - }), n.enqueue({ - type: `tool-input-end`, - id: r - }), n.enqueue({ - type: `tool-call`, - toolCallId: r, - toolName: e.toolName, - input: JSON.stringify({ - arguments: k.item.arguments, - call_id: t ? null : r - }), - ...t ? { providerExecuted: !0 } : {}, - providerMetadata: { [s]: { itemId: k.item.id } } - }); - } - b[k.output_index] = void 0; - } else if (k.item.type === `tool_search_output`) { - let e = k.item.call_id ?? D.shift() ?? k.item.id; - n.enqueue({ - type: `tool-result`, - toolCallId: e, - toolName: a.toCustomToolName(`tool_search`), - result: { tools: k.item.tools }, - providerMetadata: { [s]: { itemId: k.item.id } } - }); - } else if (k.item.type === `mcp_call`) { - b[k.output_index] = void 0; - let e = k.item.approval_request_id ?? void 0, t = e == null ? k.item.id : h.get(e) ?? m[e] ?? k.item.id, r = `mcp.${k.item.name}`; - n.enqueue({ - type: `tool-call`, - toolCallId: t, - toolName: r, - input: k.item.arguments, - providerExecuted: !0, - dynamic: !0 - }), n.enqueue({ - type: `tool-result`, - toolCallId: t, - toolName: r, - result: { - type: `call`, - serverLabel: k.item.server_label, - name: k.item.name, - arguments: k.item.arguments, - ...k.item.output == null ? {} : { output: k.item.output }, - ...k.item.error == null ? {} : { error: k.item.error } - }, - providerMetadata: { [s]: { itemId: k.item.id } } - }); - } else if (k.item.type === `mcp_list_tools`) b[k.output_index] = void 0; - else if (k.item.type === `apply_patch_call`) { - let e = b[k.output_index]; - e?.applyPatch && !e.applyPatch.endEmitted && k.item.operation.type !== `delete_file` && (e.applyPatch.hasDiff || n.enqueue({ - type: `tool-input-delta`, - id: e.toolCallId, - delta: $$3(k.item.operation.diff) - }), n.enqueue({ - type: `tool-input-delta`, - id: e.toolCallId, - delta: `"}}` - }), n.enqueue({ - type: `tool-input-end`, - id: e.toolCallId - }), e.applyPatch.endEmitted = !0), e && k.item.status === `completed` && n.enqueue({ - type: `tool-call`, - toolCallId: e.toolCallId, - toolName: a.toCustomToolName(`apply_patch`), - input: JSON.stringify({ - callId: k.item.call_id, - operation: k.item.operation - }), - providerMetadata: { [s]: { itemId: k.item.id } } - }), b[k.output_index] = void 0; - } else if (k.item.type === `mcp_approval_request`) { - b[k.output_index] = void 0; - let e = (r = p.config).generateId?.call(r) ?? bl(), t = k.item.approval_request_id ?? k.item.id; - h.set(t, e); - let i = `mcp.${k.item.name}`; - n.enqueue({ - type: `tool-call`, - toolCallId: e, - toolName: i, - input: k.item.arguments, - providerExecuted: !0, - dynamic: !0 - }), n.enqueue({ - type: `tool-approval-request`, - approvalId: t, - toolCallId: e - }); - } else if (k.item.type === `local_shell_call`) b[k.output_index] = void 0, n.enqueue({ - type: `tool-call`, - toolCallId: k.item.call_id, - toolName: a.toCustomToolName(`local_shell`), - input: JSON.stringify({ action: { - type: `exec`, - command: k.item.action.command, - timeoutMs: k.item.action.timeout_ms, - user: k.item.action.user, - workingDirectory: k.item.action.working_directory, - env: k.item.action.env - } }), - providerMetadata: { [s]: { itemId: k.item.id } } - }); - else if (k.item.type === `shell_call`) b[k.output_index] = void 0, n.enqueue({ - type: `tool-call`, - toolCallId: k.item.call_id, - toolName: a.toCustomToolName(`shell`), - input: JSON.stringify({ action: { commands: k.item.action.commands } }), - ...c && { providerExecuted: !0 }, - providerMetadata: { [s]: { itemId: k.item.id } } - }); - else if (k.item.type === `shell_call_output`) n.enqueue({ - type: `tool-result`, - toolCallId: k.item.call_id, - toolName: a.toCustomToolName(`shell`), - result: { output: k.item.output.map((e) => ({ - stdout: e.stdout, - stderr: e.stderr, - outcome: e.outcome.type === `exit` ? { - type: `exit`, - exitCode: e.outcome.exit_code - } : { type: `timeout` } - })) } - }); - else if (k.item.type === `reasoning`) { - let e = T[k.item.id], t = Object.entries(e.summaryParts).filter(([e, t]) => t === `active` || t === `can-conclude`).map(([e]) => e); - for (let e of t) n.enqueue({ - type: `reasoning-end`, - id: `${k.item.id}:${e}`, - providerMetadata: { [s]: { - itemId: k.item.id, - reasoningEncryptedContent: k.item.encrypted_content ?? null - } } - }); - delete T[k.item.id]; - } else k.item.type === `compaction` && n.enqueue({ - type: `custom`, - kind: `openai.compaction`, - providerMetadata: { [s]: { - type: `compaction`, - itemId: k.item.id, - encryptedContent: k.item.encrypted_content - } } - }); - else if (fn$2(k)) { - let e = b[k.output_index]; - e != null && n.enqueue({ - type: `tool-input-delta`, - id: e.toolCallId, - delta: k.delta - }); - } else if (pn$2(k)) { - let e = b[k.output_index]; - e != null && n.enqueue({ - type: `tool-input-delta`, - id: e.toolCallId, - delta: k.delta - }); - } else if (_n$2(k)) { - let e = b[k.output_index]; - e?.applyPatch && (n.enqueue({ - type: `tool-input-delta`, - id: e.toolCallId, - delta: $$3(k.delta) - }), e.applyPatch.hasDiff = !0); - } else if (vn$2(k)) { - let e = b[k.output_index]; - e?.applyPatch && !e.applyPatch.endEmitted && (e.applyPatch.hasDiff || (n.enqueue({ - type: `tool-input-delta`, - id: e.toolCallId, - delta: $$3(k.diff) - }), e.applyPatch.hasDiff = !0), n.enqueue({ - type: `tool-input-delta`, - id: e.toolCallId, - delta: `"}}` - }), n.enqueue({ - type: `tool-input-end`, - id: e.toolCallId - }), e.applyPatch.endEmitted = !0); - } else if (mn$2(k)) n.enqueue({ - type: `tool-result`, - toolCallId: k.item_id, - toolName: a.toCustomToolName(`image_generation`), - result: { result: k.partial_image_b64 }, - preliminary: !0 - }); - else if (hn$2(k)) { - let e = b[k.output_index]; - e != null && n.enqueue({ - type: `tool-input-delta`, - id: e.toolCallId, - delta: $$3(k.delta) - }); - } else if (gn$2(k)) { - let e = b[k.output_index]; - e != null && (n.enqueue({ - type: `tool-input-delta`, - id: e.toolCallId, - delta: `"}` - }), n.enqueue({ - type: `tool-input-end`, - id: e.toolCallId - }), n.enqueue({ - type: `tool-call`, - toolCallId: e.toolCallId, - toolName: a.toCustomToolName(`code_interpreter`), - input: JSON.stringify({ - code: k.code, - containerId: e.codeInterpreter.containerId - }), - providerExecuted: !0 - })); - } else if (dn$2(k)) y = k.response.id, n.enqueue({ - type: `response-metadata`, - id: k.response.id, - timestamp: /* @__PURE__ */ new Date(k.response.created_at * 1e3), - modelId: k.response.model - }); - else if (sn$2(k)) n.enqueue({ - type: `text-delta`, - id: k.item_id, - delta: k.delta - }), e.providerOptions?.[s]?.logprobs && k.logprobs && v.push(k.logprobs); - else if (k.type === `response.reasoning_summary_part.added`) { - if (k.summary_index > 0) { - let e = T[k.item_id]; - e.summaryParts[k.summary_index] = `active`; - for (let t of Object.keys(e.summaryParts)) e.summaryParts[t] === `can-conclude` && (n.enqueue({ - type: `reasoning-end`, - id: `${k.item_id}:${t}`, - providerMetadata: { [s]: { itemId: k.item_id } } - }), e.summaryParts[t] = `concluded`); - n.enqueue({ - type: `reasoning-start`, - id: `${k.item_id}:${k.summary_index}`, - providerMetadata: { [s]: { - itemId: k.item_id, - reasoningEncryptedContent: T[k.item_id]?.encryptedContent ?? null - } } - }); - } - } else if (k.type === `response.reasoning_summary_text.delta`) n.enqueue({ - type: `reasoning-delta`, - id: `${k.item_id}:${k.summary_index}`, - delta: k.delta, - providerMetadata: { [s]: { itemId: k.item_id } } - }); - else if (k.type === `response.reasoning_summary_part.done`) o ? (n.enqueue({ - type: `reasoning-end`, - id: `${k.item_id}:${k.summary_index}`, - providerMetadata: { [s]: { itemId: k.item_id } } - }), T[k.item_id].summaryParts[k.summary_index] = `concluded`) : T[k.item_id].summaryParts[k.summary_index] = `can-conclude`; - else if (ln$2(k)) g = { - unified: qt$2({ - finishReason: k.response.incomplete_details?.reason, - hasFunctionCall: w - }), - raw: k.response.incomplete_details?.reason ?? void 0 - }, _ = k.response.usage, typeof k.response.service_tier == `string` && (E = k.response.service_tier); - else if (un$2(k)) { - let e = k.response.incomplete_details?.reason; - g = { - unified: e ? qt$2({ - finishReason: e, - hasFunctionCall: w - }) : `error`, - raw: e ?? `error` - }, _ = k.response.usage ?? void 0, !O && k.response.error != null && (O = !0, n.enqueue({ - type: `error`, - error: { - type: `response.failed`, - sequence_number: k.sequence_number, - response: { - error: k.response.error, - incomplete_details: k.response.incomplete_details, - service_tier: k.response.service_tier - } - } - })); - } else bn$2(k) ? (x.push(k.annotation), k.annotation.type === `url_citation` ? n.enqueue({ - type: `source`, - sourceType: `url`, - id: (l = p.config).generateId?.call(l) ?? bl(), - url: k.annotation.url, - title: k.annotation.title - }) : k.annotation.type === `file_citation` ? n.enqueue({ - type: `source`, - sourceType: `document`, - id: (u = p.config).generateId?.call(u) ?? bl(), - mediaType: `text/plain`, - title: k.annotation.filename, - filename: k.annotation.filename, - providerMetadata: { [s]: { - type: k.annotation.type, - fileId: k.annotation.file_id, - index: k.annotation.index - } } - }) : k.annotation.type === `container_file_citation` ? n.enqueue({ - type: `source`, - sourceType: `document`, - id: (d = p.config).generateId?.call(d) ?? bl(), - mediaType: `text/plain`, - title: k.annotation.filename, - filename: k.annotation.filename, - providerMetadata: { [s]: { - type: k.annotation.type, - fileId: k.annotation.file_id, - containerId: k.annotation.container_id - } } - }) : k.annotation.type === `file_path` && n.enqueue({ - type: `source`, - sourceType: `document`, - id: (f = p.config).generateId?.call(f) ?? bl(), - mediaType: `application/octet-stream`, - title: k.annotation.file_id, - filename: k.annotation.file_id, - providerMetadata: { [s]: { - type: k.annotation.type, - fileId: k.annotation.file_id, - index: k.annotation.index - } } - })) : xn$2(k) && (O = !0, g = { - unified: `error`, - raw: `error` - }, n.enqueue({ - type: `error`, - error: k - })); - }, - flush(e) { - let t = { [s]: { - responseId: y, - ...v.length > 0 ? { logprobs: v } : {}, - ...E === void 0 ? {} : { serviceTier: E } - } }; - e.enqueue({ - type: `finish`, - finishReason: g, - usage: Ht$2(_), - providerMetadata: t - }); - } - })), - request: { body: n }, - response: { headers: u } - }; - } -}; -function sn$2(e) { - return e.type === `response.output_text.delta`; -} -function cn$2(e) { - return e.type === `response.output_item.done`; -} -function ln$2(e) { - return e.type === `response.completed` || e.type === `response.incomplete`; -} -function un$2(e) { - return e.type === `response.failed`; -} -function dn$2(e) { - return e.type === `response.created`; -} -function fn$2(e) { - return e.type === `response.function_call_arguments.delta`; -} -function pn$2(e) { - return e.type === `response.custom_tool_call_input.delta`; -} -function mn$2(e) { - return e.type === `response.image_generation_call.partial_image`; -} -function hn$2(e) { - return e.type === `response.code_interpreter_call_code.delta`; -} -function gn$2(e) { - return e.type === `response.code_interpreter_call_code.done`; -} -function _n$2(e) { - return e.type === `response.apply_patch_call_operation_diff.delta`; -} -function vn$2(e) { - return e.type === `response.apply_patch_call_operation_diff.done`; -} -function yn$2(e) { - return e.type === `response.output_item.added`; -} -function bn$2(e) { - return e.type === `response.output_text.annotation.added`; -} -function xn$2(e) { - return e.type === `error`; -} -function Sn$2(e) { - return !(e.type === `response.created` || e.type === `response.failed` || e.type === `error` || e.type === `unknown_chunk`); -} -function Cn$2(e) { - if (e == null) return {}; - switch (e.type) { - case `search`: return { - action: { - type: `search`, - query: e.query ?? void 0, - ...e.queries != null && { queries: e.queries } - }, - ...e.sources != null && { sources: e.sources } - }; - case `open_page`: return { action: { - type: `openPage`, - url: e.url - } }; - case `find_in_page`: return { action: { - type: `findInPage`, - url: e.url, - pattern: e.pattern - } }; - } -} -function $$3(e) { - return JSON.stringify(e).slice(1, -1); -} -var wn$2 = Wu(() => Qu(Co({ - instructions: Ra$2().nullish(), - speed: oo().min(.25).max(4).default(1).nullish() -}))); -var Tn$2 = class e { - constructor(e, t) { - this.modelId = e, this.config = t, this.specificationVersion = `v4`; - } - static [Mc](e) { - return Cd({ - modelId: e.modelId, - config: e.config - }); - } - static [Nc](t) { - return new e(t.modelId, t.config); - } - get provider() { - return this.config.provider; - } - async getArgs({ text: e, voice: t = `alloy`, outputFormat: n = `mp3`, speed: r, instructions: i, language: a, providerOptions: o }) { - let s = [], c = await ad({ - provider: `openai`, - providerOptions: o, - schema: wn$2 - }), l = { - model: this.modelId, - input: e, - voice: t, - response_format: `mp3`, - speed: r, - instructions: i - }; - if (n && ([ - `mp3`, - `opus`, - `aac`, - `flac`, - `wav`, - `pcm` - ].includes(n) ? l.response_format = n : s.push({ - type: `unsupported`, - feature: `outputFormat`, - details: `Unsupported output format: ${n}. Using mp3 instead.` - })), c) { - let e = {}; - for (let t in e) { - let n = e[t]; - n !== void 0 && (l[t] = n); - } - } - return a && s.push({ - type: `unsupported`, - feature: `language`, - details: `OpenAI speech models do not support language selection. Language parameter "${a}" was ignored.` - }), { - requestBody: l, - warnings: s - }; - } - async doGenerate(e) { - var t, n; - let r = ((t = this.config._internal)?.currentDate)?.call(t) ?? /* @__PURE__ */ new Date(), { requestBody: i, warnings: a } = await this.getArgs(e), { value: o, responseHeaders: s, rawValue: c } = await sd({ - url: this.config.url({ - path: `/audio/speech`, - modelId: this.modelId - }), - headers: Pc((n = this.config).headers?.call(n), e.headers), - body: i, - failedResponseHandler: X$3, - successfulResponseHandler: xd(), - abortSignal: e.abortSignal, - fetch: this.config.fetch - }); - return { - audio: o, - warnings: a, - request: { body: JSON.stringify(i) }, - response: { - timestamp: r, - modelId: this.modelId, - headers: s, - body: c - } - }; - } -}; -var En$2 = Wu(() => Qu(Co({ - text: Ra$2(), - language: Ra$2().nullish(), - duration: oo().nullish(), - words: xo(Co({ - word: Ra$2(), - start: oo(), - end: oo() - })).nullish(), - segments: xo(Co({ - id: oo(), - seek: oo(), - start: oo(), - end: oo(), - text: Ra$2(), - tokens: xo(oo()), - temperature: oo(), - avg_logprob: oo(), - compression_ratio: oo(), - no_speech_prob: oo() - })).nullish() -}))); -var Dn$2 = Wu(() => Qu(Co({ - include: xo(Ra$2()).optional(), - language: Ra$2().optional(), - prompt: Ra$2().optional(), - temperature: oo().min(0).max(1).default(0).optional(), - timestampGranularities: xo(Io([`word`, `segment`])).default([`segment`]).optional() -}))); -var On$2 = { - afrikaans: `af`, - arabic: `ar`, - armenian: `hy`, - azerbaijani: `az`, - belarusian: `be`, - bosnian: `bs`, - bulgarian: `bg`, - catalan: `ca`, - chinese: `zh`, - croatian: `hr`, - czech: `cs`, - danish: `da`, - dutch: `nl`, - english: `en`, - estonian: `et`, - finnish: `fi`, - french: `fr`, - galician: `gl`, - german: `de`, - greek: `el`, - hebrew: `he`, - hindi: `hi`, - hungarian: `hu`, - icelandic: `is`, - indonesian: `id`, - italian: `it`, - japanese: `ja`, - kannada: `kn`, - kazakh: `kk`, - korean: `ko`, - latvian: `lv`, - lithuanian: `lt`, - macedonian: `mk`, - malay: `ms`, - marathi: `mr`, - maori: `mi`, - nepali: `ne`, - norwegian: `no`, - persian: `fa`, - polish: `pl`, - portuguese: `pt`, - romanian: `ro`, - russian: `ru`, - serbian: `sr`, - slovak: `sk`, - slovenian: `sl`, - spanish: `es`, - swahili: `sw`, - swedish: `sv`, - tagalog: `tl`, - tamil: `ta`, - thai: `th`, - turkish: `tr`, - ukrainian: `uk`, - urdu: `ur`, - vietnamese: `vi`, - welsh: `cy` -}; -var kn$2 = class e { - constructor(e, t) { - this.modelId = e, this.config = t, this.specificationVersion = `v4`; - } - static [Mc](e) { - return Cd({ - modelId: e.modelId, - config: e.config - }); - } - static [Nc](t) { - return new e(t.modelId, t.config); - } - get provider() { - return this.config.provider; - } - async getArgs({ audio: e, mediaType: t, providerOptions: n }) { - let r = [], i = await ad({ - provider: `openai`, - providerOptions: n, - schema: Dn$2 - }), a = new FormData(), o = e instanceof Uint8Array ? new Blob([e]) : new Blob([Lc(e)]); - a.append(`model`, this.modelId); - let c = Bl(t); - if (a.append(`file`, new File([o], `audio`, { type: t }), `audio.${c}`), this.modelId === `whisper-1` && a.append(`response_format`, `verbose_json`), i) { - let e = [`gpt-4o-transcribe`, `gpt-4o-mini-transcribe`].includes(this.modelId), t = { - include: i.include, - language: i.language, - prompt: i.prompt, - ...this.modelId !== `whisper-1` && { response_format: e ? `json` : `verbose_json` }, - temperature: i.temperature, - timestamp_granularities: i.timestampGranularities - }; - for (let [e, n] of Object.entries(t)) if (n != null) if (Array.isArray(n)) for (let t of n) a.append(`${e}[]`, String(t)); - else a.append(e, String(n)); - } - return { - formData: a, - warnings: r - }; - } - async doGenerate(e) { - var t, n; - let r = ((t = this.config._internal)?.currentDate)?.call(t) ?? /* @__PURE__ */ new Date(), { formData: i, warnings: a } = await this.getArgs(e), { value: o, responseHeaders: s, rawValue: c } = await cd({ - url: this.config.url({ - path: `/audio/transcriptions`, - modelId: this.modelId - }), - headers: Pc((n = this.config).headers?.call(n), e.headers), - formData: i, - failedResponseHandler: X$3, - successfulResponseHandler: bd(En$2), - abortSignal: e.abortSignal, - fetch: this.config.fetch - }), l = o.language != null && o.language in On$2 ? On$2[o.language] : void 0; - return { - text: o.text, - segments: o.segments?.map((e) => ({ - text: e.text, - startSecond: e.start, - endSecond: e.end - })) ?? o.words?.map((e) => ({ - text: e.word, - startSecond: e.start, - endSecond: e.end - })) ?? [], - language: l, - durationInSeconds: o.duration ?? void 0, - warnings: a, - response: { - timestamp: r, - modelId: this.modelId, - headers: s, - body: c - } - }; - } -}; -var An$2 = Wu(() => Qu(Co({ - id: Ra$2(), - name: Ra$2().nullish(), - description: Ra$2().nullish(), - default_version: Ra$2().nullish(), - latest_version: Ra$2().nullish(), - created_at: oo(), - updated_at: oo().nullish() -}))); -var jn$2 = class { - constructor(e) { - this.config = e, this.specificationVersion = `v4`; - } - get provider() { - return this.config.provider; - } - async uploadSkill(e) { - let t = []; - e.displayTitle != null && t.push({ - type: `unsupported`, - feature: `displayTitle` - }); - let n = new FormData(); - for (let t of e.files) { - let e = Bc(t.data); - n.append(`files[]`, new Blob([e]), t.path); - } - let { value: r } = await cd({ - url: this.config.url({ path: `/skills` }), - headers: Pc(this.config.headers()), - formData: n, - failedResponseHandler: X$3, - successfulResponseHandler: bd(An$2), - fetch: this.config.fetch - }); - return { - providerReference: { openai: r.id }, - ...r.name == null ? {} : { name: r.name }, - ...r.description == null ? {} : { description: r.description }, - ...r.latest_version == null ? {} : { latestVersion: r.latest_version }, - providerMetadata: { openai: { - ...r.default_version == null ? {} : { defaultVersion: r.default_version }, - ...r.created_at == null ? {} : { createdAt: r.created_at }, - ...r.updated_at == null ? {} : { updatedAt: r.updated_at } - } }, - warnings: t - }; - } -}; -var Mn$2 = `4.0.0`; -function Nn$2(e = {}) { - let t = Ed(Fl({ - settingValue: e.baseURL, - environmentVariableName: `OPENAI_BASE_URL` - })) ?? `https://api.openai.com/v1`, n = e.name ?? `openai`, r = () => Ol({ - Authorization: `Bearer ${Pl({ - apiKey: e.apiKey, - environmentVariableName: `OPENAI_API_KEY`, - description: `OpenAI` - })}`, - "OpenAI-Organization": e.organization, - "OpenAI-Project": e.project, - ...e.headers - }, `ai-sdk/openai/${Mn$2}`), i = (i) => new we$2(i, { - provider: `${n}.chat`, - url: ({ path: e }) => `${t}${e}`, - headers: r, - fetch: e.fetch - }), a = (i) => new Ne$2(i, { - provider: `${n}.completion`, - url: ({ path: e }) => `${t}${e}`, - headers: r, - fetch: e.fetch - }), o = (i) => new Le$2(i, { - provider: `${n}.embedding`, - url: ({ path: e }) => `${t}${e}`, - headers: r, - fetch: e.fetch - }), s = (i) => new Je$2(i, { - provider: `${n}.image`, - url: ({ path: e }) => `${t}${e}`, - headers: r, - fetch: e.fetch - }), c = (i) => new kn$2(i, { - provider: `${n}.transcription`, - url: ({ path: e }) => `${t}${e}`, - headers: r, - fetch: e.fetch - }), l = (i) => new Tn$2(i, { - provider: `${n}.speech`, - url: ({ path: e }) => `${t}${e}`, - headers: r, - fetch: e.fetch - }), u = () => new Be$2({ - provider: `${n}.files`, - baseURL: t, - headers: r, - fetch: e.fetch - }), f = () => new jn$2({ - provider: `${n}.skills`, - url: ({ path: e }) => `${t}${e}`, - headers: r, - fetch: e.fetch - }), m = (e) => { - if (new.target) throw Error(`The OpenAI model function cannot be called with the new keyword.`); - return h(e); - }, h = (i) => new on$2(i, { - provider: `${n}.responses`, - url: ({ path: e }) => `${t}${e}`, - headers: r, - fetch: e.fetch, - fileIdPrefixes: [`file-`] - }), g = (i) => new Vt$2(i, { - provider: `${n}.realtime`, - baseURL: t, - headers: r, - fetch: e.fetch - }), _ = Object.assign((e) => g(e), { getToken: async (e) => { - let t = await g(e.model).doCreateClientSecret({ - sessionConfig: e.sessionConfig, - expiresAfterSeconds: e.expiresAfterSeconds - }); - return { - token: t.token, - url: t.url, - expiresAt: t.expiresAt - }; - } }), v = function(e) { - return m(e); - }; - return v.specificationVersion = `v4`, v.languageModel = m, v.chat = i, v.completion = a, v.responses = h, v.embedding = o, v.embeddingModel = o, v.textEmbedding = o, v.textEmbeddingModel = o, v.image = s, v.imageModel = s, v.transcription = c, v.transcriptionModel = c, v.speech = l, v.speechModel = l, v.files = u, v.skills = f, v.experimental_realtime = _, v.tools = Lt$2, v; -} -var Pn$2 = Nn$2(); -//#endregion -//#region node_modules/eve/dist/src/compiled/_chunks/node/dist-BdTs18CF.js -var t$3 = Object.create; -var n$3 = Object.defineProperty; -var r$6 = Object.getOwnPropertyDescriptor; -var i$4 = Object.getOwnPropertyNames; -var a$3 = Object.getPrototypeOf; -var o$3 = Object.prototype.hasOwnProperty; -var c$3 = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports); -var u$3 = (e, t, a, s) => { - if (t && typeof t == `object` || typeof t == `function`) for (var c = i$4(t), l = 0, u = c.length, d; l < u; l++) d = c[l], !o$3.call(e, d) && d !== a && n$3(e, d, { - get: ((e) => t[e]).bind(null, d), - enumerable: !(s = r$6(t, d)) || s.enumerable - }); - return e; -}; -var d$3 = (e, r, i) => (i = e == null ? {} : t$3(a$3(e)), u$3(r || !e || !e.__esModule ? n$3(i, `default`, { - value: e, - enumerable: !0 -}) : i, e)); -var p$4 = createRequire(import.meta.url); -const m$2 = Symbol.for(`workflow-serialize`); -const h$2 = Symbol.for(`workflow-deserialize`); -//#endregion -//#region node_modules/eve/dist/src/compiled/_chunks/node/retry-DkR2H1Y0.js -var t$2 = c$3(((e, t) => { - var n = 1e3, r = n * 60, i = r * 60, a = i * 24, o = a * 7, s = a * 365.25; - t.exports = function(e, t) { - t ||= {}; - var n = typeof e; - if (n === `string` && e.length > 0) return c(e); - if (n === `number` && isFinite(e)) return t.long ? u(e) : l(e); - throw Error(`val is not a non-empty string or a valid number. val=` + JSON.stringify(e)); - }; - function c(e) { - if (e = String(e), !(e.length > 100)) { - var t = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e); - if (t) { - var c = parseFloat(t[1]); - switch ((t[2] || `ms`).toLowerCase()) { - case `years`: - case `year`: - case `yrs`: - case `yr`: - case `y`: return c * s; - case `weeks`: - case `week`: - case `w`: return c * o; - case `days`: - case `day`: - case `d`: return c * a; - case `hours`: - case `hour`: - case `hrs`: - case `hr`: - case `h`: return c * i; - case `minutes`: - case `minute`: - case `mins`: - case `min`: - case `m`: return c * r; - case `seconds`: - case `second`: - case `secs`: - case `sec`: - case `s`: return c * n; - case `milliseconds`: - case `millisecond`: - case `msecs`: - case `msec`: - case `ms`: return c; - default: return; - } - } - } - } - function l(e) { - var t = Math.abs(e); - return t >= a ? Math.round(e / a) + `d` : t >= i ? Math.round(e / i) + `h` : t >= r ? Math.round(e / r) + `m` : t >= n ? Math.round(e / n) + `s` : e + `ms`; - } - function u(e) { - var t = Math.abs(e); - return t >= a ? d(e, t, a, `day`) : t >= i ? d(e, t, i, `hour`) : t >= r ? d(e, t, r, `minute`) : t >= n ? d(e, t, n, `second`) : e + ` ms`; - } - function d(e, t, n, r) { - var i = t >= n * 1.5; - return Math.round(e / n) + ` ` + r + (i ? `s` : ``); - } -})); -var n$2 = c$3(((e, t) => { - function n(e, t) { - typeof t == `boolean` && (t = { forever: t }), this._originalTimeouts = JSON.parse(JSON.stringify(e)), this._timeouts = e, this._options = t || {}, this._maxRetryTime = t && t.maxRetryTime || Infinity, this._fn = null, this._errors = [], this._attempts = 1, this._operationTimeout = null, this._operationTimeoutCb = null, this._timeout = null, this._operationStart = null, this._timer = null, this._options.forever && (this._cachedTimeouts = this._timeouts.slice(0)); - } - t.exports = n, n.prototype.reset = function() { - this._attempts = 1, this._timeouts = this._originalTimeouts.slice(0); - }, n.prototype.stop = function() { - this._timeout && clearTimeout(this._timeout), this._timer && clearTimeout(this._timer), this._timeouts = [], this._cachedTimeouts = null; - }, n.prototype.retry = function(e) { - if (this._timeout && clearTimeout(this._timeout), !e) return !1; - var t = (/* @__PURE__ */ new Date()).getTime(); - if (e && t - this._operationStart >= this._maxRetryTime) return this._errors.push(e), this._errors.unshift(Error(`RetryOperation timeout occurred`)), !1; - this._errors.push(e); - var n = this._timeouts.shift(); - if (n === void 0) if (this._cachedTimeouts) this._errors.splice(0, this._errors.length - 1), n = this._cachedTimeouts.slice(-1); - else return !1; - var r = this; - return this._timer = setTimeout(function() { - r._attempts++, r._operationTimeoutCb && (r._timeout = setTimeout(function() { - r._operationTimeoutCb(r._attempts); - }, r._operationTimeout), r._options.unref && r._timeout.unref()), r._fn(r._attempts); - }, n), this._options.unref && this._timer.unref(), !0; - }, n.prototype.attempt = function(e, t) { - this._fn = e, t && (t.timeout && (this._operationTimeout = t.timeout), t.cb && (this._operationTimeoutCb = t.cb)); - var n = this; - this._operationTimeoutCb && (this._timeout = setTimeout(function() { - n._operationTimeoutCb(); - }, n._operationTimeout)), this._operationStart = (/* @__PURE__ */ new Date()).getTime(), this._fn(this._attempts); - }, n.prototype.try = function(e) { - console.log(`Using RetryOperation.try() is deprecated`), this.attempt(e); - }, n.prototype.start = function(e) { - console.log(`Using RetryOperation.start() is deprecated`), this.attempt(e); - }, n.prototype.start = n.prototype.try, n.prototype.errors = function() { - return this._errors; - }, n.prototype.attempts = function() { - return this._attempts; - }, n.prototype.mainError = function() { - if (this._errors.length === 0) return null; - for (var e = {}, t = null, n = 0, r = 0; r < this._errors.length; r++) { - var i = this._errors[r], a = i.message, o = (e[a] || 0) + 1; - e[a] = o, o >= n && (t = i, n = o); - } - return t; - }; -})); -var r$5 = c$3(((e) => { - var t = n$2(); - e.operation = function(n) { - return new t(e.timeouts(n), { - forever: n && (n.forever || n.retries === Infinity), - unref: n && n.unref, - maxRetryTime: n && n.maxRetryTime - }); - }, e.timeouts = function(e) { - if (e instanceof Array) return [].concat(e); - var t = { - retries: 10, - factor: 2, - minTimeout: 1 * 1e3, - maxTimeout: Infinity, - randomize: !1 - }; - for (var n in e) t[n] = e[n]; - if (t.minTimeout > t.maxTimeout) throw Error(`minTimeout is greater than maxTimeout`); - for (var r = [], i = 0; i < t.retries; i++) r.push(this.createTimeout(i, t)); - return e && e.forever && !r.length && r.push(this.createTimeout(i, t)), r.sort(function(e, t) { - return e - t; - }), r; - }, e.createTimeout = function(e, t) { - var n = t.randomize ? Math.random() + 1 : 1, r = Math.round(n * Math.max(t.minTimeout, 1) * t.factor ** +e); - return r = Math.min(r, t.maxTimeout), r; - }, e.wrap = function(t, n, r) { - if (n instanceof Array && (r = n, n = null), !r) for (var i in r = [], t) typeof t[i] == `function` && r.push(i); - for (var a = 0; a < r.length; a++) { - var o = r[a], s = t[o]; - t[o] = function(r) { - var i = e.operation(n), a = Array.prototype.slice.call(arguments, 1), o = a.pop(); - a.push(function(e) { - i.retry(e) || (e && (arguments[0] = i.mainError()), o.apply(this, arguments)); - }), i.attempt(function() { - r.apply(t, a); - }); - }.bind(t, s), t[o].options = n; - } - }; -})); -var i$3 = c$3(((e, t) => { - t.exports = r$5(); -})); -//#endregion -//#region node_modules/eve/dist/src/compiled/_chunks/node/version-TugPKZua.js -var e; -const t$1 = Object.freeze({ status: `aborted` }); -function n$1(e, t, n) { - function r(n, r) { - if (n._zod || Object.defineProperty(n, "_zod", { - value: { - def: r, - constr: o, - traits: /* @__PURE__ */ new Set() - }, - enumerable: !1 - }), n._zod.traits.has(e)) return; - n._zod.traits.add(e), t(n, r); - let i = o.prototype, a = Object.keys(i); - for (let e = 0; e < a.length; e++) { - let t = a[e]; - t in n || (n[t] = i[t].bind(n)); - } - } - let i = n?.Parent ?? Object; - class a extends i {} - Object.defineProperty(a, "name", { value: e }); - function o(e) { - var t; - let i = n?.Parent ? new a() : this; - r(i, e), (t = i._zod).deferred ?? (t.deferred = []); - for (let e of i._zod.deferred) e(); - return i; - } - return Object.defineProperty(o, "init", { value: r }), Object.defineProperty(o, Symbol.hasInstance, { value: (t) => n?.Parent && t instanceof n.Parent ? !0 : t?._zod?.traits?.has(e) }), Object.defineProperty(o, "name", { value: e }), o; -} -var r$4 = class extends Error { - constructor() { - super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`); - } -}; -var i$2 = class extends Error { - constructor(e) { - super(`Encountered unidirectional transform during encode: ${e}`), this.name = `ZodEncodeError`; - } -}; -(e = globalThis).__zod_globalConfig ?? (e.__zod_globalConfig = {}); -const a$2 = globalThis.__zod_globalConfig; -function o$2(e) { - return e && Object.assign(a$2, e), a$2; -} -function s$2(e) { - let t = Object.values(e).filter((e) => typeof e == `number`); - return Object.entries(e).filter(([e, n]) => t.indexOf(+e) === -1).map(([e, t]) => t); -} -function c$2(e, t) { - return typeof t == `bigint` ? t.toString() : t; -} -function l$2(e) { - return { get value() { - { - let t = e(); - return Object.defineProperty(this, "value", { value: t }), t; - } - } }; -} -function u$2(e) { - return e == null; -} -function d$2(e) { - let t = +!!e.startsWith(`^`), n = e.endsWith(`$`) ? e.length - 1 : e.length; - return e.slice(t, n); -} -function f$2(e, t) { - let n = e / t, r = Math.round(n), i = 2 ** -52 * Math.max(Math.abs(n), 1); - return Math.abs(n - r) < i ? 0 : n - r; -} -const p$3 = Symbol(`evaluating`); -function m$1(e, t, n) { - let r; - Object.defineProperty(e, t, { - get() { - if (r !== p$3) return r === void 0 && (r = p$3, r = n()), r; - }, - set(n) { - Object.defineProperty(e, t, { value: n }); - }, - configurable: !0 - }); -} -function h$1(e, t, n) { - Object.defineProperty(e, t, { - value: n, - writable: !0, - enumerable: !0, - configurable: !0 - }); -} -function g$2(...e) { - let t = {}; - for (let n of e) Object.assign(t, Object.getOwnPropertyDescriptors(n)); - return Object.defineProperties({}, t); -} -function ee$3(e) { - return JSON.stringify(e); -} -function te$2(e) { - return e.toLowerCase().trim().replace(/[^\w\s-]/g, ``).replace(/[\s_-]+/g, `-`).replace(/^-+|-+$/g, ``); -} -const ne$2 = `captureStackTrace` in Error ? Error.captureStackTrace : (...e) => {}; -function _$1(e) { - return typeof e == `object` && !!e && !Array.isArray(e); -} -const re$2 = l$2(() => { - if (a$2.jitless || typeof navigator < `u` && navigator?.userAgent?.includes(`Cloudflare`)) return !1; - try { - return Function(``), !0; - } catch { - return !1; - } -}); -function v$2(e) { - if (_$1(e) === !1) return !1; - let t = e.constructor; - if (t === void 0 || typeof t != `function`) return !0; - let n = t.prototype; - return !(_$1(n) === !1 || Object.prototype.hasOwnProperty.call(n, `isPrototypeOf`) === !1); -} -function ie$2(e) { - return v$2(e) ? { ...e } : Array.isArray(e) ? [...e] : e instanceof Map ? new Map(e) : e instanceof Set ? new Set(e) : e; -} -const ae$2 = /* @__PURE__ */ new Set([ - `string`, - `number`, - `symbol` -]); -function y(e) { - return e.replace(/[.*+?^${}()|[\]\\]/g, `\\$&`); -} -function b$2(e, t, n) { - let r = new e._zod.constr(t ?? e._zod.def); - return (!t || n?.parent) && (r._zod.parent = e), r; -} -function x$1(e) { - let t = e; - if (!t) return {}; - if (typeof t == `string`) return { error: () => t }; - if (t?.message !== void 0) { - if (t?.error !== void 0) throw Error("Cannot specify both `message` and `error` params"); - t.error = t.message; - } - return delete t.message, typeof t.error == `string` ? { - ...t, - error: () => t.error - } : t; -} -function oe$1(e) { - return Object.keys(e).filter((t) => e[t]._zod.optin === `optional` && e[t]._zod.optout === `optional`); -} -const se$1 = { - safeint: [-(2 ** 53 - 1), 2 ** 53 - 1], - int32: [-2147483648, 2147483647], - uint32: [0, 4294967295], - float32: [-34028234663852886e22, 34028234663852886e22], - float64: [-Number.MAX_VALUE, Number.MAX_VALUE] -}; -function ce$1(e, t) { - let n = e._zod.def, r = n.checks; - if (r && r.length > 0) throw Error(`.pick() cannot be used on object schemas containing refinements`); - return b$2(e, g$2(e._zod.def, { - get shape() { - let e = {}; - for (let r in t) { - if (!(r in n.shape)) throw Error(`Unrecognized key: "${r}"`); - t[r] && (e[r] = n.shape[r]); - } - return h$1(this, `shape`, e), e; - }, - checks: [] - })); -} -function le$1(e, t) { - let n = e._zod.def, r = n.checks; - if (r && r.length > 0) throw Error(`.omit() cannot be used on object schemas containing refinements`); - return b$2(e, g$2(e._zod.def, { - get shape() { - let r = { ...e._zod.def.shape }; - for (let e in t) { - if (!(e in n.shape)) throw Error(`Unrecognized key: "${e}"`); - t[e] && delete r[e]; - } - return h$1(this, `shape`, r), r; - }, - checks: [] - })); -} -function ue$1(e, t) { - if (!v$2(t)) throw Error(`Invalid input to extend: expected a plain object`); - let n = e._zod.def.checks; - if (n && n.length > 0) { - let n = e._zod.def.shape; - for (let e in t) if (Object.getOwnPropertyDescriptor(n, e) !== void 0) throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead."); - } - return b$2(e, g$2(e._zod.def, { get shape() { - let n = { - ...e._zod.def.shape, - ...t - }; - return h$1(this, `shape`, n), n; - } })); -} -function de$1(e, t) { - if (!v$2(t)) throw Error(`Invalid input to safeExtend: expected a plain object`); - return b$2(e, g$2(e._zod.def, { get shape() { - let n = { - ...e._zod.def.shape, - ...t - }; - return h$1(this, `shape`, n), n; - } })); -} -function fe$1(e, t) { - if (e._zod.def.checks?.length) throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`); - return b$2(e, g$2(e._zod.def, { - get shape() { - let n = { - ...e._zod.def.shape, - ...t._zod.def.shape - }; - return h$1(this, `shape`, n), n; - }, - get catchall() { - return t._zod.def.catchall; - }, - checks: t._zod.def.checks ?? [] - })); -} -function pe$1(e, t, n) { - let r = t._zod.def.checks; - if (r && r.length > 0) throw Error(`.partial() cannot be used on object schemas containing refinements`); - return b$2(t, g$2(t._zod.def, { - get shape() { - let r = t._zod.def.shape, i = { ...r }; - if (n) for (let t in n) { - if (!(t in r)) throw Error(`Unrecognized key: "${t}"`); - n[t] && (i[t] = e ? new e({ - type: `optional`, - innerType: r[t] - }) : r[t]); - } - else for (let t in r) i[t] = e ? new e({ - type: `optional`, - innerType: r[t] - }) : r[t]; - return h$1(this, `shape`, i), i; - }, - checks: [] - })); -} -function me$1(e, t, n) { - return b$2(t, g$2(t._zod.def, { get shape() { - let r = t._zod.def.shape, i = { ...r }; - if (n) for (let t in n) { - if (!(t in i)) throw Error(`Unrecognized key: "${t}"`); - n[t] && (i[t] = new e({ - type: `nonoptional`, - innerType: r[t] - })); - } - else for (let t in r) i[t] = new e({ - type: `nonoptional`, - innerType: r[t] - }); - return h$1(this, `shape`, i), i; - } })); -} -function S$1(e, t = 0) { - if (e.aborted === !0) return !0; - for (let n = t; n < e.issues.length; n++) if (e.issues[n]?.continue !== !0) return !0; - return !1; -} -function he$1(e, t = 0) { - if (e.aborted === !0) return !0; - for (let n = t; n < e.issues.length; n++) if (e.issues[n]?.continue === !1) return !0; - return !1; -} -function C$2(e, t) { - return t.map((t) => { - var n; - return (n = t).path ?? (n.path = []), t.path.unshift(e), t; - }); -} -function w$2(e) { - return typeof e == `string` ? e : e?.message; -} -function T$2(e, t, n) { - let r = e.message ? e.message : w$2(e.inst?._zod.def?.error?.(e)) ?? w$2(t?.error?.(e)) ?? w$2(n.customError?.(e)) ?? w$2(n.localeError?.(e)) ?? `Invalid input`, { inst: i, continue: a, input: o, ...s } = e; - return s.path ??= [], s.message = r, t?.reportInput && (s.input = o), s; -} -function E$2(e) { - return Array.isArray(e) ? `array` : typeof e == `string` ? `string` : `unknown`; -} -function D$1(...e) { - let [t, n, r] = e; - return typeof t == `string` ? { - message: t, - code: `custom`, - input: n, - inst: r - } : { ...t }; -} -const ge$1 = (e, t) => { - e.name = `$ZodError`, Object.defineProperty(e, "_zod", { - value: e._zod, - enumerable: !1 - }), Object.defineProperty(e, "issues", { - value: t, - enumerable: !1 - }), e.message = JSON.stringify(t, c$2, 2), Object.defineProperty(e, "toString", { - value: () => e.message, - enumerable: !1 - }); -}; -const _e$1 = n$1(`$ZodError`, ge$1); -const ve$1 = n$1(`$ZodError`, ge$1, { Parent: Error }); -function ye$1(e, t = (e) => e.message) { - let n = {}, r = []; - for (let i of e.issues) i.path.length > 0 ? (n[i.path[0]] = n[i.path[0]] || [], n[i.path[0]].push(t(i))) : r.push(t(i)); - return { - formErrors: r, - fieldErrors: n - }; -} -function be$1(e, t = (e) => e.message) { - let n = { _errors: [] }, r = (e, i = []) => { - for (let a of e.issues) if (a.code === `invalid_union` && a.errors.length) a.errors.map((e) => r({ issues: e }, [...i, ...a.path])); - else if (a.code === `invalid_key`) r({ issues: a.issues }, [...i, ...a.path]); - else if (a.code === `invalid_element`) r({ issues: a.issues }, [...i, ...a.path]); - else { - let e = [...i, ...a.path]; - if (e.length === 0) n._errors.push(t(a)); - else { - let r = n, i = 0; - for (; i < e.length;) { - let n = e[i]; - i === e.length - 1 ? (r[n] = r[n] || { _errors: [] }, r[n]._errors.push(t(a))) : r[n] = r[n] || { _errors: [] }, r = r[n], i++; - } - } - } - }; - return r(e), n; -} -const O$1 = (e) => (t, n, i, a) => { - let s = i ? { - ...i, - async: !1 - } : { async: !1 }, c = t._zod.run({ - value: n, - issues: [] - }, s); - if (c instanceof Promise) throw new r$4(); - if (c.issues.length) { - let t = new ((a?.Err) ?? e)(c.issues.map((e) => T$2(e, s, o$2()))); - throw ne$2(t, a?.callee), t; - } - return c.value; -}; -const k$2 = (e) => async (t, n, r, i) => { - let a = r ? { - ...r, - async: !0 - } : { async: !0 }, s = t._zod.run({ - value: n, - issues: [] - }, a); - if (s instanceof Promise && (s = await s), s.issues.length) { - let t = new ((i?.Err) ?? e)(s.issues.map((e) => T$2(e, a, o$2()))); - throw ne$2(t, i?.callee), t; - } - return s.value; -}; -const A$2 = (e) => (t, n, i) => { - let a = i ? { - ...i, - async: !1 - } : { async: !1 }, s = t._zod.run({ - value: n, - issues: [] - }, a); - if (s instanceof Promise) throw new r$4(); - return s.issues.length ? { - success: !1, - error: new (e ?? _e$1)(s.issues.map((e) => T$2(e, a, o$2()))) - } : { - success: !0, - data: s.value - }; -}; -const xe$1 = A$2(ve$1); -const j$2 = (e) => async (t, n, r) => { - let i = r ? { - ...r, - async: !0 - } : { async: !0 }, a = t._zod.run({ - value: n, - issues: [] - }, i); - return a instanceof Promise && (a = await a), a.issues.length ? { - success: !1, - error: new e(a.issues.map((e) => T$2(e, i, o$2()))) - } : { - success: !0, - data: a.value - }; -}; -const Se$1 = j$2(ve$1); -const Ce$1 = (e) => (t, n, r) => { - let i = r ? { - ...r, - direction: `backward` - } : { direction: `backward` }; - return O$1(e)(t, n, i); -}; -const we$1 = (e) => (t, n, r) => O$1(e)(t, n, r); -const Te$1 = (e) => async (t, n, r) => { - let i = r ? { - ...r, - direction: `backward` - } : { direction: `backward` }; - return k$2(e)(t, n, i); -}; -const Ee$1 = (e) => async (t, n, r) => k$2(e)(t, n, r); -const De$1 = (e) => (t, n, r) => { - let i = r ? { - ...r, - direction: `backward` - } : { direction: `backward` }; - return A$2(e)(t, n, i); -}; -const Oe$1 = (e) => (t, n, r) => A$2(e)(t, n, r); -const ke$1 = (e) => async (t, n, r) => { - let i = r ? { - ...r, - direction: `backward` - } : { direction: `backward` }; - return j$2(e)(t, n, i); -}; -const Ae$1 = (e) => async (t, n, r) => j$2(e)(t, n, r); -const je$1 = /^[cC][0-9a-z]{6,}$/; -const Me$1 = /^[0-9a-z]+$/; -const Ne$1 = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/; -const Pe$1 = /^[0-9a-vA-V]{20}$/; -const Fe$1 = /^[A-Za-z0-9]{27}$/; -const Ie$1 = /^[a-zA-Z0-9_-]{21}$/; -const Le$1 = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/; -const Re$1 = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/; -const ze$1 = (e) => e ? RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`) : /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/; -const Be$1 = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/; -function Ve$1() { - return RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`, `u`); -} -const He$1 = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/; -const Ue$1 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/; -const We$1 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/; -const Ge$1 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/; -const Ke$1 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/; -const qe$1 = /^[A-Za-z0-9_-]*$/; -const Je$1 = /^https?$/; -const Ye$1 = /^\+[1-9]\d{6,14}$/; -const Xe$1 = `(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`; -const Ze$1 = RegExp(`^${Xe$1}$`); -function Qe$1(e) { - let t = `(?:[01]\\d|2[0-3]):[0-5]\\d`; - return typeof e.precision == `number` ? e.precision === -1 ? `${t}` : e.precision === 0 ? `${t}:[0-5]\\d` : `${t}:[0-5]\\d\\.\\d{${e.precision}}` : `${t}(?::[0-5]\\d(?:\\.\\d+)?)?`; -} -function $e$1(e) { - return RegExp(`^${Qe$1(e)}$`); -} -function et$1(e) { - let t = Qe$1({ precision: e.precision }), n = [`Z`]; - e.local && n.push(``), e.offset && n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`); - let r = `${t}(?:${n.join(`|`)})`; - return RegExp(`^${Xe$1}T(?:${r})$`); -} -const tt$1 = (e) => { - let t = e ? `[\\s\\S]{${e?.minimum ?? 0},${e?.maximum ?? ``}}` : `[\\s\\S]*`; - return RegExp(`^${t}$`); -}; -const nt$1 = /^-?\d+$/; -const rt$1 = /^-?\d+(?:\.\d+)?$/; -const it$1 = /^(?:true|false)$/i; -const at$1 = /^[^A-Z]*$/; -const ot$1 = /^[^a-z]*$/; -const M$2 = n$1(`$ZodCheck`, (e, t) => { - var n; - e._zod ??= {}, e._zod.def = t, (n = e._zod).onattach ?? (n.onattach = []); -}); -const st$1 = { - number: `number`, - bigint: `bigint`, - object: `date` -}; -const ct$1 = n$1(`$ZodCheckLessThan`, (e, t) => { - M$2.init(e, t); - let n = st$1[typeof t.value]; - e._zod.onattach.push((e) => { - let n = e._zod.bag, r = (t.inclusive ? n.maximum : n.exclusiveMaximum) ?? Infinity; - t.value < r && (t.inclusive ? n.maximum = t.value : n.exclusiveMaximum = t.value); - }), e._zod.check = (r) => { - (t.inclusive ? r.value <= t.value : r.value < t.value) || r.issues.push({ - origin: n, - code: `too_big`, - maximum: typeof t.value == `object` ? t.value.getTime() : t.value, - input: r.value, - inclusive: t.inclusive, - inst: e, - continue: !t.abort - }); - }; -}); -const lt$1 = n$1(`$ZodCheckGreaterThan`, (e, t) => { - M$2.init(e, t); - let n = st$1[typeof t.value]; - e._zod.onattach.push((e) => { - let n = e._zod.bag, r = (t.inclusive ? n.minimum : n.exclusiveMinimum) ?? -Infinity; - t.value > r && (t.inclusive ? n.minimum = t.value : n.exclusiveMinimum = t.value); - }), e._zod.check = (r) => { - (t.inclusive ? r.value >= t.value : r.value > t.value) || r.issues.push({ - origin: n, - code: `too_small`, - minimum: typeof t.value == `object` ? t.value.getTime() : t.value, - input: r.value, - inclusive: t.inclusive, - inst: e, - continue: !t.abort - }); - }; -}); -const ut$1 = n$1(`$ZodCheckMultipleOf`, (e, t) => { - M$2.init(e, t), e._zod.onattach.push((e) => { - var n; - (n = e._zod.bag).multipleOf ?? (n.multipleOf = t.value); - }), e._zod.check = (n) => { - if (typeof n.value != typeof t.value) throw Error(`Cannot mix number and bigint in multiple_of check.`); - (typeof n.value == `bigint` ? n.value % t.value === BigInt(0) : f$2(n.value, t.value) === 0) || n.issues.push({ - origin: typeof n.value, - code: `not_multiple_of`, - divisor: t.value, - input: n.value, - inst: e, - continue: !t.abort - }); - }; -}); -const dt$1 = n$1(`$ZodCheckNumberFormat`, (e, t) => { - M$2.init(e, t), t.format = t.format || `float64`; - let n = t.format?.includes(`int`), r = n ? `int` : `number`, [i, a] = se$1[t.format]; - e._zod.onattach.push((e) => { - let r = e._zod.bag; - r.format = t.format, r.minimum = i, r.maximum = a, n && (r.pattern = nt$1); - }), e._zod.check = (o) => { - let s = o.value; - if (n) { - if (!Number.isInteger(s)) { - o.issues.push({ - expected: r, - format: t.format, - code: `invalid_type`, - continue: !1, - input: s, - inst: e - }); - return; - } - if (!Number.isSafeInteger(s)) { - s > 0 ? o.issues.push({ - input: s, - code: `too_big`, - maximum: 2 ** 53 - 1, - note: `Integers must be within the safe integer range.`, - inst: e, - origin: r, - inclusive: !0, - continue: !t.abort - }) : o.issues.push({ - input: s, - code: `too_small`, - minimum: -(2 ** 53 - 1), - note: `Integers must be within the safe integer range.`, - inst: e, - origin: r, - inclusive: !0, - continue: !t.abort - }); - return; - } - } - s < i && o.issues.push({ - origin: `number`, - input: s, - code: `too_small`, - minimum: i, - inclusive: !0, - inst: e, - continue: !t.abort - }), s > a && o.issues.push({ - origin: `number`, - input: s, - code: `too_big`, - maximum: a, - inclusive: !0, - inst: e, - continue: !t.abort - }); - }; -}); -const ft$1 = n$1(`$ZodCheckMaxLength`, (e, t) => { - var n; - M$2.init(e, t), (n = e._zod.def).when ?? (n.when = (e) => { - let t = e.value; - return !u$2(t) && t.length !== void 0; - }), e._zod.onattach.push((e) => { - let n = e._zod.bag.maximum ?? Infinity; - t.maximum < n && (e._zod.bag.maximum = t.maximum); - }), e._zod.check = (n) => { - let r = n.value; - if (r.length <= t.maximum) return; - let i = E$2(r); - n.issues.push({ - origin: i, - code: `too_big`, - maximum: t.maximum, - inclusive: !0, - input: r, - inst: e, - continue: !t.abort - }); - }; -}); -const pt$1 = n$1(`$ZodCheckMinLength`, (e, t) => { - var n; - M$2.init(e, t), (n = e._zod.def).when ?? (n.when = (e) => { - let t = e.value; - return !u$2(t) && t.length !== void 0; - }), e._zod.onattach.push((e) => { - let n = e._zod.bag.minimum ?? -Infinity; - t.minimum > n && (e._zod.bag.minimum = t.minimum); - }), e._zod.check = (n) => { - let r = n.value; - if (r.length >= t.minimum) return; - let i = E$2(r); - n.issues.push({ - origin: i, - code: `too_small`, - minimum: t.minimum, - inclusive: !0, - input: r, - inst: e, - continue: !t.abort - }); - }; -}); -const mt$1 = n$1(`$ZodCheckLengthEquals`, (e, t) => { - var n; - M$2.init(e, t), (n = e._zod.def).when ?? (n.when = (e) => { - let t = e.value; - return !u$2(t) && t.length !== void 0; - }), e._zod.onattach.push((e) => { - let n = e._zod.bag; - n.minimum = t.length, n.maximum = t.length, n.length = t.length; - }), e._zod.check = (n) => { - let r = n.value, i = r.length; - if (i === t.length) return; - let a = E$2(r), o = i > t.length; - n.issues.push({ - origin: a, - ...o ? { - code: `too_big`, - maximum: t.length - } : { - code: `too_small`, - minimum: t.length - }, - inclusive: !0, - exact: !0, - input: n.value, - inst: e, - continue: !t.abort - }); - }; -}); -const N$2 = n$1(`$ZodCheckStringFormat`, (e, t) => { - var n, r; - M$2.init(e, t), e._zod.onattach.push((e) => { - let n = e._zod.bag; - n.format = t.format, t.pattern && (n.patterns ??= /* @__PURE__ */ new Set(), n.patterns.add(t.pattern)); - }), t.pattern ? (n = e._zod).check ?? (n.check = (n) => { - t.pattern.lastIndex = 0, !t.pattern.test(n.value) && n.issues.push({ - origin: `string`, - code: `invalid_format`, - format: t.format, - input: n.value, - ...t.pattern ? { pattern: t.pattern.toString() } : {}, - inst: e, - continue: !t.abort - }); - }) : (r = e._zod).check ?? (r.check = () => {}); -}); -const ht$1 = n$1(`$ZodCheckRegex`, (e, t) => { - N$2.init(e, t), e._zod.check = (n) => { - t.pattern.lastIndex = 0, !t.pattern.test(n.value) && n.issues.push({ - origin: `string`, - code: `invalid_format`, - format: `regex`, - input: n.value, - pattern: t.pattern.toString(), - inst: e, - continue: !t.abort - }); - }; -}); -const gt$1 = n$1(`$ZodCheckLowerCase`, (e, t) => { - t.pattern ??= at$1, N$2.init(e, t); -}); -const _t$1 = n$1(`$ZodCheckUpperCase`, (e, t) => { - t.pattern ??= ot$1, N$2.init(e, t); -}); -const vt$1 = n$1(`$ZodCheckIncludes`, (e, t) => { - M$2.init(e, t); - let n = y(t.includes), r = new RegExp(typeof t.position == `number` ? `^.{${t.position}}${n}` : n); - t.pattern = r, e._zod.onattach.push((e) => { - let t = e._zod.bag; - t.patterns ??= /* @__PURE__ */ new Set(), t.patterns.add(r); - }), e._zod.check = (n) => { - n.value.includes(t.includes, t.position) || n.issues.push({ - origin: `string`, - code: `invalid_format`, - format: `includes`, - includes: t.includes, - input: n.value, - inst: e, - continue: !t.abort - }); - }; -}); -const yt$1 = n$1(`$ZodCheckStartsWith`, (e, t) => { - M$2.init(e, t); - let n = RegExp(`^${y(t.prefix)}.*`); - t.pattern ??= n, e._zod.onattach.push((e) => { - let t = e._zod.bag; - t.patterns ??= /* @__PURE__ */ new Set(), t.patterns.add(n); - }), e._zod.check = (n) => { - n.value.startsWith(t.prefix) || n.issues.push({ - origin: `string`, - code: `invalid_format`, - format: `starts_with`, - prefix: t.prefix, - input: n.value, - inst: e, - continue: !t.abort - }); - }; -}); -const bt$1 = n$1(`$ZodCheckEndsWith`, (e, t) => { - M$2.init(e, t); - let n = RegExp(`.*${y(t.suffix)}$`); - t.pattern ??= n, e._zod.onattach.push((e) => { - let t = e._zod.bag; - t.patterns ??= /* @__PURE__ */ new Set(), t.patterns.add(n); - }), e._zod.check = (n) => { - n.value.endsWith(t.suffix) || n.issues.push({ - origin: `string`, - code: `invalid_format`, - format: `ends_with`, - suffix: t.suffix, - input: n.value, - inst: e, - continue: !t.abort - }); - }; -}); -const xt$1 = n$1(`$ZodCheckOverwrite`, (e, t) => { - M$2.init(e, t), e._zod.check = (e) => { - e.value = t.tx(e.value); - }; -}); -var St$1 = class { - constructor(e = []) { - this.content = [], this.indent = 0, this && (this.args = e); - } - indented(e) { - this.indent += 1, e(this), --this.indent; - } - write(e) { - if (typeof e == `function`) { - e(this, { execution: `sync` }), e(this, { execution: `async` }); - return; - } - let t = e.split(` -`).filter((e) => e), n = Math.min(...t.map((e) => e.length - e.trimStart().length)), r = t.map((e) => e.slice(n)).map((e) => ` `.repeat(this.indent * 2) + e); - for (let e of r) this.content.push(e); - } - compile() { - let e = Function, t = this?.args, n = [...(this?.content ?? [``]).map((e) => ` ${e}`)]; - return new e(...t, n.join(` -`)); - } -}; -const Ct$1 = { - major: 4, - minor: 4, - patch: 3 -}; -const P$2 = n$1(`$ZodType`, (e, t) => { - var n; - e ??= {}, e._zod.def = t, e._zod.bag = e._zod.bag || {}, e._zod.version = Ct$1; - let i = [...e._zod.def.checks ?? []]; - e._zod.traits.has(`$ZodCheck`) && i.unshift(e); - for (let t of i) for (let n of t._zod.onattach) n(e); - if (i.length === 0) (n = e._zod).deferred ?? (n.deferred = []), e._zod.deferred?.push(() => { - e._zod.run = e._zod.parse; - }); - else { - let t = (e, t, n) => { - let i = S$1(e), a; - for (let o of t) { - if (o._zod.def.when) { - if (he$1(e) || !o._zod.def.when(e)) continue; - } else if (i) continue; - let t = e.issues.length, s = o._zod.check(e); - if (s instanceof Promise && n?.async === !1) throw new r$4(); - if (a || s instanceof Promise) a = (a ?? Promise.resolve()).then(async () => { - await s, e.issues.length !== t && (i ||= S$1(e, t)); - }); - else { - if (e.issues.length === t) continue; - i ||= S$1(e, t); - } - } - return a ? a.then(() => e) : e; - }, n = (n, a, o) => { - if (S$1(n)) return n.aborted = !0, n; - let s = t(a, i, o); - if (s instanceof Promise) { - if (o.async === !1) throw new r$4(); - return s.then((t) => e._zod.parse(t, o)); - } - return e._zod.parse(s, o); - }; - e._zod.run = (a, o) => { - if (o.skipChecks) return e._zod.parse(a, o); - if (o.direction === `backward`) { - let t = e._zod.parse({ - value: a.value, - issues: [] - }, { - ...o, - skipChecks: !0 - }); - return t instanceof Promise ? t.then((e) => n(e, a, o)) : n(t, a, o); - } - let s = e._zod.parse(a, o); - if (s instanceof Promise) { - if (o.async === !1) throw new r$4(); - return s.then((e) => t(e, i, o)); - } - return t(s, i, o); - }; - } - m$1(e, `~standard`, () => ({ - validate: (t) => { - try { - let n = xe$1(e, t); - return n.success ? { value: n.data } : { issues: n.error?.issues }; - } catch { - return Se$1(e, t).then((e) => e.success ? { value: e.data } : { issues: e.error?.issues }); - } - }, - vendor: `zod`, - version: 1 - })); -}); -const F$2 = n$1(`$ZodString`, (e, t) => { - P$2.init(e, t), e._zod.pattern = [...e?._zod.bag?.patterns ?? []].pop() ?? tt$1(e._zod.bag), e._zod.parse = (n, r) => { - if (t.coerce) try { - n.value = String(n.value); - } catch {} - return typeof n.value == `string` || n.issues.push({ - expected: `string`, - code: `invalid_type`, - input: n.value, - inst: e - }), n; - }; -}); -const I$2 = n$1(`$ZodStringFormat`, (e, t) => { - N$2.init(e, t), F$2.init(e, t); -}); -const wt$1 = n$1(`$ZodGUID`, (e, t) => { - t.pattern ??= Re$1, I$2.init(e, t); -}); -const Tt$1 = n$1(`$ZodUUID`, (e, t) => { - if (t.version) { - let e = { - v1: 1, - v2: 2, - v3: 3, - v4: 4, - v5: 5, - v6: 6, - v7: 7, - v8: 8 - }[t.version]; - if (e === void 0) throw Error(`Invalid UUID version: "${t.version}"`); - t.pattern ??= ze$1(e); - } else t.pattern ??= ze$1(); - I$2.init(e, t); -}); -const Et$1 = n$1(`$ZodEmail`, (e, t) => { - t.pattern ??= Be$1, I$2.init(e, t); -}); -const Dt$1 = n$1(`$ZodURL`, (e, t) => { - I$2.init(e, t), e._zod.check = (n) => { - try { - let r = n.value.trim(); - if (!t.normalize && t.protocol?.source === Je$1.source && !/^https?:\/\//i.test(r)) { - n.issues.push({ - code: `invalid_format`, - format: `url`, - note: `Invalid URL format`, - input: n.value, - inst: e, - continue: !t.abort - }); - return; - } - let i = new URL(r); - t.hostname && (t.hostname.lastIndex = 0, t.hostname.test(i.hostname) || n.issues.push({ - code: `invalid_format`, - format: `url`, - note: `Invalid hostname`, - pattern: t.hostname.source, - input: n.value, - inst: e, - continue: !t.abort - })), t.protocol && (t.protocol.lastIndex = 0, t.protocol.test(i.protocol.endsWith(`:`) ? i.protocol.slice(0, -1) : i.protocol) || n.issues.push({ - code: `invalid_format`, - format: `url`, - note: `Invalid protocol`, - pattern: t.protocol.source, - input: n.value, - inst: e, - continue: !t.abort - })), t.normalize ? n.value = i.href : n.value = r; - return; - } catch { - n.issues.push({ - code: `invalid_format`, - format: `url`, - input: n.value, - inst: e, - continue: !t.abort - }); - } - }; -}); -const Ot$1 = n$1(`$ZodEmoji`, (e, t) => { - t.pattern ??= Ve$1(), I$2.init(e, t); -}); -const kt$1 = n$1(`$ZodNanoID`, (e, t) => { - t.pattern ??= Ie$1, I$2.init(e, t); -}); -const At$1 = n$1(`$ZodCUID`, (e, t) => { - t.pattern ??= je$1, I$2.init(e, t); -}); -const jt$1 = n$1(`$ZodCUID2`, (e, t) => { - t.pattern ??= Me$1, I$2.init(e, t); -}); -const Mt$1 = n$1(`$ZodULID`, (e, t) => { - t.pattern ??= Ne$1, I$2.init(e, t); -}); -const Nt$1 = n$1(`$ZodXID`, (e, t) => { - t.pattern ??= Pe$1, I$2.init(e, t); -}); -const Pt$1 = n$1(`$ZodKSUID`, (e, t) => { - t.pattern ??= Fe$1, I$2.init(e, t); -}); -const Ft$1 = n$1(`$ZodISODateTime`, (e, t) => { - t.pattern ??= et$1(t), I$2.init(e, t); -}); -const It$1 = n$1(`$ZodISODate`, (e, t) => { - t.pattern ??= Ze$1, I$2.init(e, t); -}); -const Lt$1 = n$1(`$ZodISOTime`, (e, t) => { - t.pattern ??= $e$1(t), I$2.init(e, t); -}); -const Rt$1 = n$1(`$ZodISODuration`, (e, t) => { - t.pattern ??= Le$1, I$2.init(e, t); -}); -const zt$1 = n$1(`$ZodIPv4`, (e, t) => { - t.pattern ??= He$1, I$2.init(e, t), e._zod.bag.format = `ipv4`; -}); -const Bt$1 = n$1(`$ZodIPv6`, (e, t) => { - t.pattern ??= Ue$1, I$2.init(e, t), e._zod.bag.format = `ipv6`, e._zod.check = (n) => { - try { - new URL(`http://[${n.value}]`); - } catch { - n.issues.push({ - code: `invalid_format`, - format: `ipv6`, - input: n.value, - inst: e, - continue: !t.abort - }); - } - }; -}); -const Vt$1 = n$1(`$ZodCIDRv4`, (e, t) => { - t.pattern ??= We$1, I$2.init(e, t); -}); -const Ht$1 = n$1(`$ZodCIDRv6`, (e, t) => { - t.pattern ??= Ge$1, I$2.init(e, t), e._zod.check = (n) => { - let r = n.value.split(`/`); - try { - if (r.length !== 2) throw Error(); - let [e, t] = r; - if (!t) throw Error(); - let n = Number(t); - if (`${n}` !== t || n < 0 || n > 128) throw Error(); - new URL(`http://[${e}]`); - } catch { - n.issues.push({ - code: `invalid_format`, - format: `cidrv6`, - input: n.value, - inst: e, - continue: !t.abort - }); - } - }; -}); -function Ut$1(e) { - if (e === ``) return !0; - if (/\s/.test(e) || e.length % 4 != 0) return !1; - try { - return atob(e), !0; - } catch { - return !1; - } -} -const Wt$1 = n$1(`$ZodBase64`, (e, t) => { - t.pattern ??= Ke$1, I$2.init(e, t), e._zod.bag.contentEncoding = `base64`, e._zod.check = (n) => { - Ut$1(n.value) || n.issues.push({ - code: `invalid_format`, - format: `base64`, - input: n.value, - inst: e, - continue: !t.abort - }); - }; -}); -function Gt$1(e) { - if (!qe$1.test(e)) return !1; - let t = e.replace(/[-_]/g, (e) => e === `-` ? `+` : `/`); - return Ut$1(t.padEnd(Math.ceil(t.length / 4) * 4, `=`)); -} -const Kt$1 = n$1(`$ZodBase64URL`, (e, t) => { - t.pattern ??= qe$1, I$2.init(e, t), e._zod.bag.contentEncoding = `base64url`, e._zod.check = (n) => { - Gt$1(n.value) || n.issues.push({ - code: `invalid_format`, - format: `base64url`, - input: n.value, - inst: e, - continue: !t.abort - }); - }; -}); -const qt$1 = n$1(`$ZodE164`, (e, t) => { - t.pattern ??= Ye$1, I$2.init(e, t); -}); -function Jt$1(e, t = null) { - try { - let n = e.split(`.`); - if (n.length !== 3) return !1; - let [r] = n; - if (!r) return !1; - let i = JSON.parse(atob(r)); - return !(`typ` in i && i?.typ !== `JWT` || !i.alg || t && (!(`alg` in i) || i.alg !== t)); - } catch { - return !1; - } -} -const Yt$1 = n$1(`$ZodJWT`, (e, t) => { - I$2.init(e, t), e._zod.check = (n) => { - Jt$1(n.value, t.alg) || n.issues.push({ - code: `invalid_format`, - format: `jwt`, - input: n.value, - inst: e, - continue: !t.abort - }); - }; -}); -const Xt$1 = n$1(`$ZodNumber`, (e, t) => { - P$2.init(e, t), e._zod.pattern = e._zod.bag.pattern ?? rt$1, e._zod.parse = (n, r) => { - if (t.coerce) try { - n.value = Number(n.value); - } catch {} - let i = n.value; - if (typeof i == `number` && !Number.isNaN(i) && Number.isFinite(i)) return n; - let a = typeof i == `number` ? Number.isNaN(i) ? `NaN` : Number.isFinite(i) ? void 0 : `Infinity` : void 0; - return n.issues.push({ - expected: `number`, - code: `invalid_type`, - input: i, - inst: e, - ...a ? { received: a } : {} - }), n; - }; -}); -const Zt$1 = n$1(`$ZodNumberFormat`, (e, t) => { - dt$1.init(e, t), Xt$1.init(e, t); -}); -const Qt$1 = n$1(`$ZodBoolean`, (e, t) => { - P$2.init(e, t), e._zod.pattern = it$1, e._zod.parse = (n, r) => { - if (t.coerce) try { - n.value = !!n.value; - } catch {} - let i = n.value; - return typeof i == `boolean` || n.issues.push({ - expected: `boolean`, - code: `invalid_type`, - input: i, - inst: e - }), n; - }; -}); -const $t$1 = n$1(`$ZodAny`, (e, t) => { - P$2.init(e, t), e._zod.parse = (e) => e; -}); -const en$1 = n$1(`$ZodUnknown`, (e, t) => { - P$2.init(e, t), e._zod.parse = (e) => e; -}); -const tn$1 = n$1(`$ZodNever`, (e, t) => { - P$2.init(e, t), e._zod.parse = (t, n) => (t.issues.push({ - expected: `never`, - code: `invalid_type`, - input: t.value, - inst: e - }), t); -}); -function nn$1(e, t, n) { - e.issues.length && t.issues.push(...C$2(n, e.issues)), t.value[n] = e.value; -} -const rn$1 = n$1(`$ZodArray`, (e, t) => { - P$2.init(e, t), e._zod.parse = (n, r) => { - let i = n.value; - if (!Array.isArray(i)) return n.issues.push({ - expected: `array`, - code: `invalid_type`, - input: i, - inst: e - }), n; - n.value = Array(i.length); - let a = []; - for (let e = 0; e < i.length; e++) { - let o = i[e], s = t.element._zod.run({ - value: o, - issues: [] - }, r); - s instanceof Promise ? a.push(s.then((t) => nn$1(t, n, e))) : nn$1(s, n, e); - } - return a.length ? Promise.all(a).then(() => n) : n; - }; -}); -function L$2(e, t, n, r, i, a) { - let o = n in r; - if (e.issues.length) { - if (i && a && !o) return; - t.issues.push(...C$2(n, e.issues)); - } - if (!o && !i) { - e.issues.length || t.issues.push({ - code: `invalid_type`, - expected: `nonoptional`, - input: void 0, - path: [n] - }); - return; - } - e.value === void 0 ? o && (t.value[n] = void 0) : t.value[n] = e.value; -} -function an$1(e) { - let t = Object.keys(e.shape); - for (let n of t) if (!e.shape?.[n]?._zod?.traits?.has(`$ZodType`)) throw Error(`Invalid element at key "${n}": expected a Zod schema`); - let n = oe$1(e.shape); - return { - ...e, - keys: t, - keySet: new Set(t), - numKeys: t.length, - optionalKeys: new Set(n) - }; -} -function on$1(e, t, n, r, i, a) { - let o = [], s = i.keySet, c = i.catchall._zod, l = c.def.type, u = c.optin === `optional`, d = c.optout === `optional`; - for (let i in t) { - if (i === `__proto__` || s.has(i)) continue; - if (l === `never`) { - o.push(i); - continue; - } - let a = c.run({ - value: t[i], - issues: [] - }, r); - a instanceof Promise ? e.push(a.then((e) => L$2(e, n, i, t, u, d))) : L$2(a, n, i, t, u, d); - } - return o.length && n.issues.push({ - code: `unrecognized_keys`, - keys: o, - input: t, - inst: a - }), e.length ? Promise.all(e).then(() => n) : n; -} -const sn$1 = n$1(`$ZodObject`, (e, t) => { - if (P$2.init(e, t), !Object.getOwnPropertyDescriptor(t, `shape`)?.get) { - let e = t.shape; - Object.defineProperty(t, "shape", { get: () => { - let n = { ...e }; - return Object.defineProperty(t, "shape", { value: n }), n; - } }); - } - let n = l$2(() => an$1(t)); - m$1(e._zod, `propValues`, () => { - let e = t.shape, n = {}; - for (let t in e) { - let r = e[t]._zod; - if (r.values) { - n[t] ?? (n[t] = /* @__PURE__ */ new Set()); - for (let e of r.values) n[t].add(e); - } - } - return n; - }); - let r = _$1, i = t.catchall, a; - e._zod.parse = (t, o) => { - a ??= n.value; - let s = t.value; - if (!r(s)) return t.issues.push({ - expected: `object`, - code: `invalid_type`, - input: s, - inst: e - }), t; - t.value = {}; - let c = [], l = a.shape; - for (let e of a.keys) { - let n = l[e], r = n._zod.optin === `optional`, i = n._zod.optout === `optional`, a = n._zod.run({ - value: s[e], - issues: [] - }, o); - a instanceof Promise ? c.push(a.then((n) => L$2(n, t, e, s, r, i))) : L$2(a, t, e, s, r, i); - } - return i ? on$1(c, s, t, o, n.value, e) : c.length ? Promise.all(c).then(() => t) : t; - }; -}); -const cn$1 = n$1(`$ZodObjectJIT`, (e, t) => { - sn$1.init(e, t); - let n = e._zod.parse, r = l$2(() => an$1(t)), i = (e) => { - let t = new St$1([ - `shape`, - `payload`, - `ctx` - ]), n = r.value, i = (e) => { - let t = ee$3(e); - return `shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`; - }; - t.write(`const input = payload.value;`); - let a = Object.create(null), o = 0; - for (let e of n.keys) a[e] = `key_${o++}`; - t.write(`const newResult = {};`); - for (let r of n.keys) { - let n = a[r], o = ee$3(r), s = e[r], c = s?._zod?.optin === `optional`, l = s?._zod?.optout === `optional`; - t.write(`const ${n} = ${i(r)};`), c && l ? t.write(` - if (${n}.issues.length) { - if (${o} in input) { - payload.issues = payload.issues.concat(${n}.issues.map(iss => ({ - ...iss, - path: iss.path ? [${o}, ...iss.path] : [${o}] - }))); - } - } - - if (${n}.value === undefined) { - if (${o} in input) { - newResult[${o}] = undefined; - } - } else { - newResult[${o}] = ${n}.value; - } - - `) : c ? t.write(` - if (${n}.issues.length) { - payload.issues = payload.issues.concat(${n}.issues.map(iss => ({ - ...iss, - path: iss.path ? [${o}, ...iss.path] : [${o}] - }))); - } - - if (${n}.value === undefined) { - if (${o} in input) { - newResult[${o}] = undefined; - } - } else { - newResult[${o}] = ${n}.value; - } - - `) : t.write(` - const ${n}_present = ${o} in input; - if (${n}.issues.length) { - payload.issues = payload.issues.concat(${n}.issues.map(iss => ({ - ...iss, - path: iss.path ? [${o}, ...iss.path] : [${o}] - }))); - } - if (!${n}_present && !${n}.issues.length) { - payload.issues.push({ - code: "invalid_type", - expected: "nonoptional", - input: undefined, - path: [${o}] - }); - } - - if (${n}_present) { - if (${n}.value === undefined) { - newResult[${o}] = undefined; - } else { - newResult[${o}] = ${n}.value; - } - } - - `); - } - t.write(`payload.value = newResult;`), t.write(`return payload;`); - let s = t.compile(); - return (t, n) => s(e, t, n); - }, o, s = _$1, c = !a$2.jitless, u = c && re$2.value, d = t.catchall, f; - e._zod.parse = (a, l) => { - f ??= r.value; - let p = a.value; - return s(p) ? c && u && l?.async === !1 && l.jitless !== !0 ? (o ||= i(t.shape), a = o(a, l), d ? on$1([], p, a, l, f, e) : a) : n(a, l) : (a.issues.push({ - expected: `object`, - code: `invalid_type`, - input: p, - inst: e - }), a); - }; -}); -function ln$1(e, t, n, r) { - for (let n of e) if (n.issues.length === 0) return t.value = n.value, t; - let i = e.filter((e) => !S$1(e)); - return i.length === 1 ? (t.value = i[0].value, i[0]) : (t.issues.push({ - code: `invalid_union`, - input: t.value, - inst: n, - errors: e.map((e) => e.issues.map((e) => T$2(e, r, o$2()))) - }), t); -} -const un$1 = n$1(`$ZodUnion`, (e, t) => { - P$2.init(e, t), m$1(e._zod, `optin`, () => t.options.some((e) => e._zod.optin === `optional`) ? `optional` : void 0), m$1(e._zod, `optout`, () => t.options.some((e) => e._zod.optout === `optional`) ? `optional` : void 0), m$1(e._zod, `values`, () => { - if (t.options.every((e) => e._zod.values)) return new Set(t.options.flatMap((e) => Array.from(e._zod.values))); - }), m$1(e._zod, `pattern`, () => { - if (t.options.every((e) => e._zod.pattern)) { - let e = t.options.map((e) => e._zod.pattern); - return RegExp(`^(${e.map((e) => d$2(e.source)).join(`|`)})$`); - } - }); - let n = t.options.length === 1 ? t.options[0]._zod.run : null; - e._zod.parse = (r, i) => { - if (n) return n(r, i); - let a = !1, o = []; - for (let e of t.options) { - let t = e._zod.run({ - value: r.value, - issues: [] - }, i); - if (t instanceof Promise) o.push(t), a = !0; - else { - if (t.issues.length === 0) return t; - o.push(t); - } - } - return a ? Promise.all(o).then((t) => ln$1(t, r, e, i)) : ln$1(o, r, e, i); - }; -}); -const dn$1 = n$1(`$ZodDiscriminatedUnion`, (e, t) => { - t.inclusive = !1, un$1.init(e, t); - let n = e._zod.parse; - m$1(e._zod, `propValues`, () => { - let e = {}; - for (let n of t.options) { - let r = n._zod.propValues; - if (!r || Object.keys(r).length === 0) throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`); - for (let [t, n] of Object.entries(r)) { - e[t] || (e[t] = /* @__PURE__ */ new Set()); - for (let r of n) e[t].add(r); - } - } - return e; - }); - let r = l$2(() => { - let e = t.options, n = /* @__PURE__ */ new Map(); - for (let r of e) { - let e = r._zod.propValues?.[t.discriminator]; - if (!e || e.size === 0) throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`); - for (let t of e) { - if (n.has(t)) throw Error(`Duplicate discriminator value "${String(t)}"`); - n.set(t, r); - } - } - return n; - }); - e._zod.parse = (i, a) => { - let o = i.value; - if (!_$1(o)) return i.issues.push({ - code: `invalid_type`, - expected: `object`, - input: o, - inst: e - }), i; - let s = r.value.get(o?.[t.discriminator]); - return s ? s._zod.run(i, a) : t.unionFallback || a.direction === `backward` ? n(i, a) : (i.issues.push({ - code: `invalid_union`, - errors: [], - note: `No matching discriminator`, - discriminator: t.discriminator, - options: Array.from(r.value.keys()), - input: o, - path: [t.discriminator], - inst: e - }), i); - }; -}); -const fn$1 = n$1(`$ZodIntersection`, (e, t) => { - P$2.init(e, t), e._zod.parse = (e, n) => { - let r = e.value, i = t.left._zod.run({ - value: r, - issues: [] - }, n), a = t.right._zod.run({ - value: r, - issues: [] - }, n); - return i instanceof Promise || a instanceof Promise ? Promise.all([i, a]).then(([t, n]) => pn$1(e, t, n)) : pn$1(e, i, a); - }; -}); -function R$2(e, t) { - if (e === t || e instanceof Date && t instanceof Date && +e == +t) return { - valid: !0, - data: e - }; - if (v$2(e) && v$2(t)) { - let n = Object.keys(t), r = Object.keys(e).filter((e) => n.indexOf(e) !== -1), i = { - ...e, - ...t - }; - for (let n of r) { - let r = R$2(e[n], t[n]); - if (!r.valid) return { - valid: !1, - mergeErrorPath: [n, ...r.mergeErrorPath] - }; - i[n] = r.data; - } - return { - valid: !0, - data: i - }; - } - if (Array.isArray(e) && Array.isArray(t)) { - if (e.length !== t.length) return { - valid: !1, - mergeErrorPath: [] - }; - let n = []; - for (let r = 0; r < e.length; r++) { - let i = e[r], a = t[r], o = R$2(i, a); - if (!o.valid) return { - valid: !1, - mergeErrorPath: [r, ...o.mergeErrorPath] - }; - n.push(o.data); - } - return { - valid: !0, - data: n - }; - } - return { - valid: !1, - mergeErrorPath: [] - }; -} -function pn$1(e, t, n) { - let r = /* @__PURE__ */ new Map(), i; - for (let n of t.issues) if (n.code === `unrecognized_keys`) { - i ??= n; - for (let e of n.keys) r.has(e) || r.set(e, {}), r.get(e).l = !0; - } else e.issues.push(n); - for (let t of n.issues) if (t.code === `unrecognized_keys`) for (let e of t.keys) r.has(e) || r.set(e, {}), r.get(e).r = !0; - else e.issues.push(t); - let a = [...r].filter(([, e]) => e.l && e.r).map(([e]) => e); - if (a.length && i && e.issues.push({ - ...i, - keys: a - }), S$1(e)) return e; - let o = R$2(t.value, n.value); - if (!o.valid) throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`); - return e.value = o.data, e; -} -const mn$1 = n$1(`$ZodRecord`, (e, t) => { - P$2.init(e, t), e._zod.parse = (n, r) => { - let i = n.value; - if (!v$2(i)) return n.issues.push({ - expected: `record`, - code: `invalid_type`, - input: i, - inst: e - }), n; - let a = [], s = t.keyType._zod.values; - if (s) { - n.value = {}; - let c = /* @__PURE__ */ new Set(); - for (let l of s) if (typeof l == `string` || typeof l == `number` || typeof l == `symbol`) { - c.add(typeof l == `number` ? l.toString() : l); - let s = t.keyType._zod.run({ - value: l, - issues: [] - }, r); - if (s instanceof Promise) throw Error(`Async schemas not supported in object keys currently`); - if (s.issues.length) { - n.issues.push({ - code: `invalid_key`, - origin: `record`, - issues: s.issues.map((e) => T$2(e, r, o$2())), - input: l, - path: [l], - inst: e - }); - continue; - } - let u = s.value, d = t.valueType._zod.run({ - value: i[l], - issues: [] - }, r); - d instanceof Promise ? a.push(d.then((e) => { - e.issues.length && n.issues.push(...C$2(l, e.issues)), n.value[u] = e.value; - })) : (d.issues.length && n.issues.push(...C$2(l, d.issues)), n.value[u] = d.value); - } - let l; - for (let e in i) c.has(e) || (l ??= [], l.push(e)); - l && l.length > 0 && n.issues.push({ - code: `unrecognized_keys`, - input: i, - inst: e, - keys: l - }); - } else { - n.value = {}; - for (let s of Reflect.ownKeys(i)) { - if (s === `__proto__` || !Object.prototype.propertyIsEnumerable.call(i, s)) continue; - let c = t.keyType._zod.run({ - value: s, - issues: [] - }, r); - if (c instanceof Promise) throw Error(`Async schemas not supported in object keys currently`); - if (typeof s == `string` && rt$1.test(s) && c.issues.length) { - let e = t.keyType._zod.run({ - value: Number(s), - issues: [] - }, r); - if (e instanceof Promise) throw Error(`Async schemas not supported in object keys currently`); - e.issues.length === 0 && (c = e); - } - if (c.issues.length) { - t.mode === `loose` ? n.value[s] = i[s] : n.issues.push({ - code: `invalid_key`, - origin: `record`, - issues: c.issues.map((e) => T$2(e, r, o$2())), - input: s, - path: [s], - inst: e - }); - continue; - } - let l = t.valueType._zod.run({ - value: i[s], - issues: [] - }, r); - l instanceof Promise ? a.push(l.then((e) => { - e.issues.length && n.issues.push(...C$2(s, e.issues)), n.value[c.value] = e.value; - })) : (l.issues.length && n.issues.push(...C$2(s, l.issues)), n.value[c.value] = l.value); - } - } - return a.length ? Promise.all(a).then(() => n) : n; - }; -}); -const hn$1 = n$1(`$ZodEnum`, (e, t) => { - P$2.init(e, t); - let n = s$2(t.entries), r = new Set(n); - e._zod.values = r, e._zod.pattern = RegExp(`^(${n.filter((e) => ae$2.has(typeof e)).map((e) => typeof e == `string` ? y(e) : e.toString()).join(`|`)})$`), e._zod.parse = (t, i) => { - let a = t.value; - return r.has(a) || t.issues.push({ - code: `invalid_value`, - values: n, - input: a, - inst: e - }), t; - }; -}); -const gn$1 = n$1(`$ZodLiteral`, (e, t) => { - if (P$2.init(e, t), t.values.length === 0) throw Error(`Cannot create literal schema with no valid values`); - let n = new Set(t.values); - e._zod.values = n, e._zod.pattern = RegExp(`^(${t.values.map((e) => typeof e == `string` ? y(e) : e ? y(e.toString()) : String(e)).join(`|`)})$`), e._zod.parse = (r, i) => { - let a = r.value; - return n.has(a) || r.issues.push({ - code: `invalid_value`, - values: t.values, - input: a, - inst: e - }), r; - }; -}); -const _n$1 = n$1(`$ZodTransform`, (e, t) => { - P$2.init(e, t), e._zod.optin = `optional`, e._zod.parse = (n, a) => { - if (a.direction === `backward`) throw new i$2(e.constructor.name); - let o = t.transform(n.value, n); - if (a.async) return (o instanceof Promise ? o : Promise.resolve(o)).then((e) => (n.value = e, n.fallback = !0, n)); - if (o instanceof Promise) throw new r$4(); - return n.value = o, n.fallback = !0, n; - }; -}); -function vn$1(e, t) { - return t === void 0 && (e.issues.length || e.fallback) ? { - issues: [], - value: void 0 - } : e; -} -const yn$1 = n$1(`$ZodOptional`, (e, t) => { - P$2.init(e, t), e._zod.optin = `optional`, e._zod.optout = `optional`, m$1(e._zod, `values`, () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, void 0]) : void 0), m$1(e._zod, `pattern`, () => { - let e = t.innerType._zod.pattern; - return e ? RegExp(`^(${d$2(e.source)})?$`) : void 0; - }), e._zod.parse = (e, n) => { - if (t.innerType._zod.optin === `optional`) { - let r = e.value, i = t.innerType._zod.run(e, n); - return i instanceof Promise ? i.then((e) => vn$1(e, r)) : vn$1(i, r); - } - return e.value === void 0 ? e : t.innerType._zod.run(e, n); - }; -}); -const bn$1 = n$1(`$ZodExactOptional`, (e, t) => { - yn$1.init(e, t), m$1(e._zod, `values`, () => t.innerType._zod.values), m$1(e._zod, `pattern`, () => t.innerType._zod.pattern), e._zod.parse = (e, n) => t.innerType._zod.run(e, n); -}); -const xn$1 = n$1(`$ZodNullable`, (e, t) => { - P$2.init(e, t), m$1(e._zod, `optin`, () => t.innerType._zod.optin), m$1(e._zod, `optout`, () => t.innerType._zod.optout), m$1(e._zod, `pattern`, () => { - let e = t.innerType._zod.pattern; - return e ? RegExp(`^(${d$2(e.source)}|null)$`) : void 0; - }), m$1(e._zod, `values`, () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, null]) : void 0), e._zod.parse = (e, n) => e.value === null ? e : t.innerType._zod.run(e, n); -}); -const Sn$1 = n$1(`$ZodDefault`, (e, t) => { - P$2.init(e, t), e._zod.optin = `optional`, m$1(e._zod, `values`, () => t.innerType._zod.values), e._zod.parse = (e, n) => { - if (n.direction === `backward`) return t.innerType._zod.run(e, n); - if (e.value === void 0) return e.value = t.defaultValue, e; - let r = t.innerType._zod.run(e, n); - return r instanceof Promise ? r.then((e) => Cn$1(e, t)) : Cn$1(r, t); - }; -}); -function Cn$1(e, t) { - return e.value === void 0 && (e.value = t.defaultValue), e; -} -const wn$1 = n$1(`$ZodPrefault`, (e, t) => { - P$2.init(e, t), e._zod.optin = `optional`, m$1(e._zod, `values`, () => t.innerType._zod.values), e._zod.parse = (e, n) => (n.direction === `backward` || e.value === void 0 && (e.value = t.defaultValue), t.innerType._zod.run(e, n)); -}); -const Tn$1 = n$1(`$ZodNonOptional`, (e, t) => { - P$2.init(e, t), m$1(e._zod, `values`, () => { - let e = t.innerType._zod.values; - return e ? new Set([...e].filter((e) => e !== void 0)) : void 0; - }), e._zod.parse = (n, r) => { - let i = t.innerType._zod.run(n, r); - return i instanceof Promise ? i.then((t) => En$1(t, e)) : En$1(i, e); - }; -}); -function En$1(e, t) { - return !e.issues.length && e.value === void 0 && e.issues.push({ - code: `invalid_type`, - expected: `nonoptional`, - input: e.value, - inst: t - }), e; -} -const Dn$1 = n$1(`$ZodCatch`, (e, t) => { - P$2.init(e, t), e._zod.optin = `optional`, m$1(e._zod, `optout`, () => t.innerType._zod.optout), m$1(e._zod, `values`, () => t.innerType._zod.values), e._zod.parse = (e, n) => { - if (n.direction === `backward`) return t.innerType._zod.run(e, n); - let r = t.innerType._zod.run(e, n); - return r instanceof Promise ? r.then((r) => (e.value = r.value, r.issues.length && (e.value = t.catchValue({ - ...e, - error: { issues: r.issues.map((e) => T$2(e, n, o$2())) }, - input: e.value - }), e.issues = [], e.fallback = !0), e)) : (e.value = r.value, r.issues.length && (e.value = t.catchValue({ - ...e, - error: { issues: r.issues.map((e) => T$2(e, n, o$2())) }, - input: e.value - }), e.issues = [], e.fallback = !0), e); - }; -}); -const On$1 = n$1(`$ZodPipe`, (e, t) => { - P$2.init(e, t), m$1(e._zod, `values`, () => t.in._zod.values), m$1(e._zod, `optin`, () => t.in._zod.optin), m$1(e._zod, `optout`, () => t.out._zod.optout), m$1(e._zod, `propValues`, () => t.in._zod.propValues), e._zod.parse = (e, n) => { - if (n.direction === `backward`) { - let r = t.out._zod.run(e, n); - return r instanceof Promise ? r.then((e) => z$2(e, t.in, n)) : z$2(r, t.in, n); - } - let r = t.in._zod.run(e, n); - return r instanceof Promise ? r.then((e) => z$2(e, t.out, n)) : z$2(r, t.out, n); - }; -}); -function z$2(e, t, n) { - return e.issues.length ? (e.aborted = !0, e) : t._zod.run({ - value: e.value, - issues: e.issues, - fallback: e.fallback - }, n); -} -const kn$1 = n$1(`$ZodReadonly`, (e, t) => { - P$2.init(e, t), m$1(e._zod, `propValues`, () => t.innerType._zod.propValues), m$1(e._zod, `values`, () => t.innerType._zod.values), m$1(e._zod, `optin`, () => t.innerType?._zod?.optin), m$1(e._zod, `optout`, () => t.innerType?._zod?.optout), e._zod.parse = (e, n) => { - if (n.direction === `backward`) return t.innerType._zod.run(e, n); - let r = t.innerType._zod.run(e, n); - return r instanceof Promise ? r.then(An$1) : An$1(r); - }; -}); -function An$1(e) { - return e.value = Object.freeze(e.value), e; -} -const jn$1 = n$1(`$ZodCustom`, (e, t) => { - M$2.init(e, t), P$2.init(e, t), e._zod.parse = (e, t) => e, e._zod.check = (n) => { - let r = n.value, i = t.fn(r); - if (i instanceof Promise) return i.then((t) => Mn$1(t, n, r, e)); - Mn$1(i, n, r, e); - }; -}); -function Mn$1(e, t, n, r) { - if (!e) { - let e = { - code: `custom`, - input: n, - inst: r, - path: [...r._zod.def.path ?? []], - continue: !r._zod.def.abort - }; - r._zod.def.params && (e.params = r._zod.def.params), t.issues.push(D$1(e)); - } -} -var Nn$1; -var Pn$1 = class { - constructor() { - this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map(); - } - add(e, ...t) { - let n = t[0]; - return this._map.set(e, n), n && typeof n == `object` && `id` in n && this._idmap.set(n.id, e), this; - } - clear() { - return this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map(), this; - } - remove(e) { - let t = this._map.get(e); - return t && typeof t == `object` && `id` in t && this._idmap.delete(t.id), this._map.delete(e), this; - } - get(e) { - let t = e._zod.parent; - if (t) { - let n = { ...this.get(t) ?? {} }; - delete n.id; - let r = { - ...n, - ...this._map.get(e) - }; - return Object.keys(r).length ? r : void 0; - } - return this._map.get(e); - } - has(e) { - return this._map.has(e); - } -}; -function Fn$1() { - return new Pn$1(); -} -(Nn$1 = globalThis).__zod_globalRegistry ?? (Nn$1.__zod_globalRegistry = Fn$1()); -const B$2 = globalThis.__zod_globalRegistry; -function In$1(e, t) { - return new e({ - type: `string`, - ...x$1(t) - }); -} -function Ln$1(e, t) { - return new e({ - type: `string`, - format: `email`, - check: `string_format`, - abort: !1, - ...x$1(t) - }); -} -function Rn$1(e, t) { - return new e({ - type: `string`, - format: `guid`, - check: `string_format`, - abort: !1, - ...x$1(t) - }); -} -function zn$1(e, t) { - return new e({ - type: `string`, - format: `uuid`, - check: `string_format`, - abort: !1, - ...x$1(t) - }); -} -function Bn$1(e, t) { - return new e({ - type: `string`, - format: `uuid`, - check: `string_format`, - abort: !1, - version: `v4`, - ...x$1(t) - }); -} -function Vn$1(e, t) { - return new e({ - type: `string`, - format: `uuid`, - check: `string_format`, - abort: !1, - version: `v6`, - ...x$1(t) - }); -} -function Hn$1(e, t) { - return new e({ - type: `string`, - format: `uuid`, - check: `string_format`, - abort: !1, - version: `v7`, - ...x$1(t) - }); -} -function Un$1(e, t) { - return new e({ - type: `string`, - format: `url`, - check: `string_format`, - abort: !1, - ...x$1(t) - }); -} -function Wn$1(e, t) { - return new e({ - type: `string`, - format: `emoji`, - check: `string_format`, - abort: !1, - ...x$1(t) - }); -} -function Gn$1(e, t) { - return new e({ - type: `string`, - format: `nanoid`, - check: `string_format`, - abort: !1, - ...x$1(t) - }); -} -function Kn$1(e, t) { - return new e({ - type: `string`, - format: `cuid`, - check: `string_format`, - abort: !1, - ...x$1(t) - }); -} -function qn$1(e, t) { - return new e({ - type: `string`, - format: `cuid2`, - check: `string_format`, - abort: !1, - ...x$1(t) - }); -} -function Jn$1(e, t) { - return new e({ - type: `string`, - format: `ulid`, - check: `string_format`, - abort: !1, - ...x$1(t) - }); -} -function Yn$1(e, t) { - return new e({ - type: `string`, - format: `xid`, - check: `string_format`, - abort: !1, - ...x$1(t) - }); -} -function Xn$2(e, t) { - return new e({ - type: `string`, - format: `ksuid`, - check: `string_format`, - abort: !1, - ...x$1(t) - }); -} -function Zn$1(e, t) { - return new e({ - type: `string`, - format: `ipv4`, - check: `string_format`, - abort: !1, - ...x$1(t) - }); -} -function Qn$1(e, t) { - return new e({ - type: `string`, - format: `ipv6`, - check: `string_format`, - abort: !1, - ...x$1(t) - }); -} -function $n$1(e, t) { - return new e({ - type: `string`, - format: `cidrv4`, - check: `string_format`, - abort: !1, - ...x$1(t) - }); -} -function er$1(e, t) { - return new e({ - type: `string`, - format: `cidrv6`, - check: `string_format`, - abort: !1, - ...x$1(t) - }); -} -function tr$1(e, t) { - return new e({ - type: `string`, - format: `base64`, - check: `string_format`, - abort: !1, - ...x$1(t) - }); -} -function nr$1(e, t) { - return new e({ - type: `string`, - format: `base64url`, - check: `string_format`, - abort: !1, - ...x$1(t) - }); -} -function rr$1(e, t) { - return new e({ - type: `string`, - format: `e164`, - check: `string_format`, - abort: !1, - ...x$1(t) - }); -} -function ir$1(e, t) { - return new e({ - type: `string`, - format: `jwt`, - check: `string_format`, - abort: !1, - ...x$1(t) - }); -} -function ar$1(e, t) { - return new e({ - type: `string`, - format: `datetime`, - check: `string_format`, - offset: !1, - local: !1, - precision: null, - ...x$1(t) - }); -} -function or$1(e, t) { - return new e({ - type: `string`, - format: `date`, - check: `string_format`, - ...x$1(t) - }); -} -function sr$1(e, t) { - return new e({ - type: `string`, - format: `time`, - check: `string_format`, - precision: null, - ...x$1(t) - }); -} -function cr$1(e, t) { - return new e({ - type: `string`, - format: `duration`, - check: `string_format`, - ...x$1(t) - }); -} -function lr$1(e, t) { - return new e({ - type: `number`, - checks: [], - ...x$1(t) - }); -} -function ur$1(e, t) { - return new e({ - type: `number`, - check: `number_format`, - abort: !1, - format: `safeint`, - ...x$1(t) - }); -} -function dr$1(e, t) { - return new e({ - type: `boolean`, - ...x$1(t) - }); -} -function fr$1(e) { - return new e({ type: `any` }); -} -function pr$2(e) { - return new e({ type: `unknown` }); -} -function mr$1(e, t) { - return new e({ - type: `never`, - ...x$1(t) - }); -} -function hr$1(e, t) { - return new ct$1({ - check: `less_than`, - ...x$1(t), - value: e, - inclusive: !1 - }); -} -function V$2(e, t) { - return new ct$1({ - check: `less_than`, - ...x$1(t), - value: e, - inclusive: !0 - }); -} -function gr$1(e, t) { - return new lt$1({ - check: `greater_than`, - ...x$1(t), - value: e, - inclusive: !1 - }); -} -function H$2(e, t) { - return new lt$1({ - check: `greater_than`, - ...x$1(t), - value: e, - inclusive: !0 - }); -} -function _r$1(e, t) { - return new ut$1({ - check: `multiple_of`, - ...x$1(t), - value: e - }); -} -function vr$1(e, t) { - return new ft$1({ - check: `max_length`, - ...x$1(t), - maximum: e - }); -} -function U$2(e, t) { - return new pt$1({ - check: `min_length`, - ...x$1(t), - minimum: e - }); -} -function yr$1(e, t) { - return new mt$1({ - check: `length_equals`, - ...x$1(t), - length: e - }); -} -function br$1(e, t) { - return new ht$1({ - check: `string_format`, - format: `regex`, - ...x$1(t), - pattern: e - }); -} -function xr$1(e) { - return new gt$1({ - check: `string_format`, - format: `lowercase`, - ...x$1(e) - }); -} -function Sr$1(e) { - return new _t$1({ - check: `string_format`, - format: `uppercase`, - ...x$1(e) - }); -} -function Cr$1(e, t) { - return new vt$1({ - check: `string_format`, - format: `includes`, - ...x$1(t), - includes: e - }); -} -function wr$1(e, t) { - return new yt$1({ - check: `string_format`, - format: `starts_with`, - ...x$1(t), - prefix: e - }); -} -function Tr$1(e, t) { - return new bt$1({ - check: `string_format`, - format: `ends_with`, - ...x$1(t), - suffix: e - }); -} -function W$2(e) { - return new xt$1({ - check: `overwrite`, - tx: e - }); -} -function Er$1(e) { - return W$2((t) => t.normalize(e)); -} -function Dr$1() { - return W$2((e) => e.trim()); -} -function Or$1() { - return W$2((e) => e.toLowerCase()); -} -function kr$1() { - return W$2((e) => e.toUpperCase()); -} -function Ar$1() { - return W$2((e) => te$2(e)); -} -function jr$1(e, t, n) { - return new e({ - type: `array`, - element: t, - ...x$1(n) - }); -} -function Mr$1(e, t, n) { - return new e({ - type: `custom`, - check: `custom`, - fn: t, - ...x$1(n) - }); -} -function Nr$1(e, t) { - let n = Pr$1((t) => (t.addIssue = (e) => { - if (typeof e == `string`) t.issues.push(D$1(e, t.value, n._zod.def)); - else { - let r = e; - r.fatal && (r.continue = !1), r.code ??= `custom`, r.input ??= t.value, r.inst ??= n, r.continue ??= !n._zod.def.abort, t.issues.push(D$1(r)); - } - }, e(t.value, t)), t); - return n; -} -function Pr$1(e, t) { - let n = new M$2({ - check: `custom`, - ...x$1(t) - }); - return n._zod.check = e, n; -} -function Fr$1(e) { - let t = e?.target ?? `draft-2020-12`; - return t === `draft-4` && (t = `draft-04`), t === `draft-7` && (t = `draft-07`), { - processors: e.processors ?? {}, - metadataRegistry: e?.metadata ?? B$2, - target: t, - unrepresentable: e?.unrepresentable ?? `throw`, - override: e?.override ?? (() => {}), - io: e?.io ?? `output`, - counter: 0, - seen: /* @__PURE__ */ new Map(), - cycles: e?.cycles ?? `ref`, - reused: e?.reused ?? `inline`, - external: e?.external ?? void 0 - }; -} -function G$3(e, t, n = { - path: [], - schemaPath: [] -}) { - var r; - let i = e._zod.def, a = t.seen.get(e); - if (a) return a.count++, n.schemaPath.includes(e) && (a.cycle = n.path), a.schema; - let o = { - schema: {}, - count: 1, - cycle: void 0, - path: n.path - }; - t.seen.set(e, o); - let s = e._zod.toJSONSchema?.(); - if (s) o.schema = s; - else { - let r = { - ...n, - schemaPath: [...n.schemaPath, e], - path: n.path - }; - if (e._zod.processJSONSchema) e._zod.processJSONSchema(t, o.schema, r); - else { - let n = o.schema, a = t.processors[i.type]; - if (!a) throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`); - a(e, t, n, r); - } - let a = e._zod.parent; - a && (o.ref ||= a, G$3(a, t, r), t.seen.get(a).isParent = !0); - } - let c = t.metadataRegistry.get(e); - return c && Object.assign(o.schema, c), t.io === `input` && K$2(e) && (delete o.schema.examples, delete o.schema.default), t.io === `input` && `_prefault` in o.schema && ((r = o.schema).default ?? (r.default = o.schema._prefault)), delete o.schema._prefault, t.seen.get(e).schema; -} -function Ir$1(e, t) { - let n = e.seen.get(t); - if (!n) throw Error(`Unprocessed schema. This is a bug in Zod.`); - let r = /* @__PURE__ */ new Map(); - for (let t of e.seen.entries()) { - let n = e.metadataRegistry.get(t[0])?.id; - if (n) { - let e = r.get(n); - if (e && e !== t[0]) throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`); - r.set(n, t[0]); - } - } - let i = (t) => { - let r = e.target === `draft-2020-12` ? `$defs` : `definitions`; - if (e.external) { - let n = e.external.registry.get(t[0])?.id, i = e.external.uri ?? ((e) => e); - if (n) return { ref: i(n) }; - let a = t[1].defId ?? t[1].schema.id ?? `schema${e.counter++}`; - return t[1].defId = a, { - defId: a, - ref: `${i(`__shared`)}#/${r}/${a}` - }; - } - if (t[1] === n) return { ref: `#` }; - let i = `#/${r}/`, a = t[1].schema.id ?? `__schema${e.counter++}`; - return { - defId: a, - ref: i + a - }; - }, a = (e) => { - if (e[1].schema.$ref) return; - let t = e[1], { ref: n, defId: r } = i(e); - t.def = { ...t.schema }, r && (t.defId = r); - let a = t.schema; - for (let e in a) delete a[e]; - a.$ref = n; - }; - if (e.cycles === `throw`) for (let t of e.seen.entries()) { - let e = t[1]; - if (e.cycle) throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/ - -Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`); - } - for (let n of e.seen.entries()) { - let r = n[1]; - if (t === n[0]) { - a(n); - continue; - } - if (e.external) { - let r = e.external.registry.get(n[0])?.id; - if (t !== n[0] && r) { - a(n); - continue; - } - } - if (e.metadataRegistry.get(n[0])?.id) { - a(n); - continue; - } - if (r.cycle) { - a(n); - continue; - } - if (r.count > 1 && e.reused === `ref`) { - a(n); - continue; - } - } -} -function Lr$1(e, t) { - let n = e.seen.get(t); - if (!n) throw Error(`Unprocessed schema. This is a bug in Zod.`); - let r = (t) => { - let n = e.seen.get(t); - if (n.ref === null) return; - let i = n.def ?? n.schema, a = { ...i }, o = n.ref; - if (n.ref = null, o) { - r(o); - let n = e.seen.get(o), s = n.schema; - if (s.$ref && (e.target === `draft-07` || e.target === `draft-04` || e.target === `openapi-3.0`) ? (i.allOf = i.allOf ?? [], i.allOf.push(s)) : Object.assign(i, s), Object.assign(i, a), t._zod.parent === o) for (let e in i) e === `$ref` || e === `allOf` || e in a || delete i[e]; - if (s.$ref && n.def) for (let e in i) e === `$ref` || e === `allOf` || e in n.def && JSON.stringify(i[e]) === JSON.stringify(n.def[e]) && delete i[e]; - } - let s = t._zod.parent; - if (s && s !== o) { - r(s); - let t = e.seen.get(s); - if (t?.schema.$ref && (i.$ref = t.schema.$ref, t.def)) for (let e in i) e === `$ref` || e === `allOf` || e in t.def && JSON.stringify(i[e]) === JSON.stringify(t.def[e]) && delete i[e]; - } - e.override({ - zodSchema: t, - jsonSchema: i, - path: n.path ?? [] - }); - }; - for (let t of [...e.seen.entries()].reverse()) r(t[0]); - let i = {}; - if (e.target === `draft-2020-12` ? i.$schema = `https://json-schema.org/draft/2020-12/schema` : e.target === `draft-07` ? i.$schema = `http://json-schema.org/draft-07/schema#` : e.target === `draft-04` ? i.$schema = `http://json-schema.org/draft-04/schema#` : e.target, e.external?.uri) { - let n = e.external.registry.get(t)?.id; - if (!n) throw Error("Schema is missing an `id` property"); - i.$id = e.external.uri(n); - } - Object.assign(i, n.def ?? n.schema); - let a = e.metadataRegistry.get(t)?.id; - a !== void 0 && i.id === a && delete i.id; - let o = e.external?.defs ?? {}; - for (let t of e.seen.entries()) { - let e = t[1]; - e.def && e.defId && (e.def.id === e.defId && delete e.def.id, o[e.defId] = e.def); - } - e.external || Object.keys(o).length > 0 && (e.target === `draft-2020-12` ? i.$defs = o : i.definitions = o); - try { - let n = JSON.parse(JSON.stringify(i)); - return Object.defineProperty(n, "~standard", { - value: { - ...t[`~standard`], - jsonSchema: { - input: q$2(t, `input`, e.processors), - output: q$2(t, `output`, e.processors) - } - }, - enumerable: !1, - writable: !1 - }), n; - } catch { - throw Error(`Error converting schema to JSON.`); - } -} -function K$2(e, t) { - let n = t ?? { seen: /* @__PURE__ */ new Set() }; - if (n.seen.has(e)) return !1; - n.seen.add(e); - let r = e._zod.def; - if (r.type === `transform`) return !0; - if (r.type === `array`) return K$2(r.element, n); - if (r.type === `set`) return K$2(r.valueType, n); - if (r.type === `lazy`) return K$2(r.getter(), n); - if (r.type === `promise` || r.type === `optional` || r.type === `nonoptional` || r.type === `nullable` || r.type === `readonly` || r.type === "default" || r.type === `prefault`) return K$2(r.innerType, n); - if (r.type === `intersection`) return K$2(r.left, n) || K$2(r.right, n); - if (r.type === `record` || r.type === `map`) return K$2(r.keyType, n) || K$2(r.valueType, n); - if (r.type === `pipe`) return e._zod.traits.has(`$ZodCodec`) ? !0 : K$2(r.in, n) || K$2(r.out, n); - if (r.type === `object`) { - for (let e in r.shape) if (K$2(r.shape[e], n)) return !0; - return !1; - } - if (r.type === `union`) { - for (let e of r.options) if (K$2(e, n)) return !0; - return !1; - } - if (r.type === `tuple`) { - for (let e of r.items) if (K$2(e, n)) return !0; - return !!(r.rest && K$2(r.rest, n)); - } - return !1; -} -const Rr$1 = (e, t = {}) => (n) => { - let r = Fr$1({ - ...n, - processors: t - }); - return G$3(e, r), Ir$1(r, e), Lr$1(r, e); -}; -const q$2 = (e, t, n = {}) => (r) => { - let { libraryOptions: i, target: a } = r ?? {}, o = Fr$1({ - ...i ?? {}, - target: a, - io: t, - processors: n - }); - return G$3(e, o), Ir$1(o, e), Lr$1(o, e); -}; -const zr$1 = { - guid: `uuid`, - url: `uri`, - datetime: `date-time`, - json_string: `json-string`, - regex: `` -}; -const Br$1 = (e, t, n, r) => { - let i = n; - i.type = `string`; - let { minimum: a, maximum: o, format: s, patterns: c, contentEncoding: l } = e._zod.bag; - if (typeof a == `number` && (i.minLength = a), typeof o == `number` && (i.maxLength = o), s && (i.format = zr$1[s] ?? s, i.format === `` && delete i.format, s === `time` && delete i.format), l && (i.contentEncoding = l), c && c.size > 0) { - let e = [...c]; - e.length === 1 ? i.pattern = e[0].source : e.length > 1 && (i.allOf = [...e.map((e) => ({ - ...t.target === `draft-07` || t.target === `draft-04` || t.target === `openapi-3.0` ? { type: `string` } : {}, - pattern: e.source - }))]); - } -}; -const Vr$1 = (e, t, n, r) => { - let i = n, { minimum: a, maximum: o, format: s, multipleOf: c, exclusiveMaximum: l, exclusiveMinimum: u } = e._zod.bag; - typeof s == `string` && s.includes(`int`) ? i.type = `integer` : i.type = `number`; - let d = typeof u == `number` && u >= (a ?? -Infinity), f = typeof l == `number` && l <= (o ?? Infinity), p = t.target === `draft-04` || t.target === `openapi-3.0`; - d ? p ? (i.minimum = u, i.exclusiveMinimum = !0) : i.exclusiveMinimum = u : typeof a == `number` && (i.minimum = a), f ? p ? (i.maximum = l, i.exclusiveMaximum = !0) : i.exclusiveMaximum = l : typeof o == `number` && (i.maximum = o), typeof c == `number` && (i.multipleOf = c); -}; -const Hr$1 = (e, t, n, r) => { - n.type = `boolean`; -}; -const Ur$1 = (e, t, n, r) => { - n.not = {}; -}; -const Wr$1 = (e, t, n, r) => { - let i = e._zod.def, a = s$2(i.entries); - a.every((e) => typeof e == `number`) && (n.type = `number`), a.every((e) => typeof e == `string`) && (n.type = `string`), n.enum = a; -}; -const Gr$1 = (e, t, n, r) => { - let i = e._zod.def, a = []; - for (let e of i.values) if (e === void 0) { - if (t.unrepresentable === `throw`) throw Error("Literal `undefined` cannot be represented in JSON Schema"); - } else if (typeof e == `bigint`) { - if (t.unrepresentable === `throw`) throw Error(`BigInt literals cannot be represented in JSON Schema`); - a.push(Number(e)); - } else a.push(e); - if (a.length !== 0) if (a.length === 1) { - let e = a[0]; - n.type = e === null ? `null` : typeof e, t.target === `draft-04` || t.target === `openapi-3.0` ? n.enum = [e] : n.const = e; - } else a.every((e) => typeof e == `number`) && (n.type = `number`), a.every((e) => typeof e == `string`) && (n.type = `string`), a.every((e) => typeof e == `boolean`) && (n.type = `boolean`), a.every((e) => e === null) && (n.type = `null`), n.enum = a; -}; -const Kr$1 = (e, t, n, r) => { - if (t.unrepresentable === `throw`) throw Error(`Custom types cannot be represented in JSON Schema`); -}; -const qr$1 = (e, t, n, r) => { - if (t.unrepresentable === `throw`) throw Error(`Transforms cannot be represented in JSON Schema`); -}; -const Jr$1 = (e, t, n, r) => { - let i = n, a = e._zod.def, { minimum: o, maximum: s } = e._zod.bag; - typeof o == `number` && (i.minItems = o), typeof s == `number` && (i.maxItems = s), i.type = `array`, i.items = G$3(a.element, t, { - ...r, - path: [...r.path, `items`] - }); -}; -const Yr$1 = (e, t, n, r) => { - let i = n, a = e._zod.def; - i.type = `object`, i.properties = {}; - let o = a.shape; - for (let e in o) i.properties[e] = G$3(o[e], t, { - ...r, - path: [ - ...r.path, - `properties`, - e - ] - }); - let s = new Set(Object.keys(o)), c = new Set([...s].filter((e) => { - let n = a.shape[e]._zod; - return t.io === `input` ? n.optin === void 0 : n.optout === void 0; - })); - c.size > 0 && (i.required = Array.from(c)), a.catchall?._zod.def.type === `never` ? i.additionalProperties = !1 : a.catchall ? a.catchall && (i.additionalProperties = G$3(a.catchall, t, { - ...r, - path: [...r.path, `additionalProperties`] - })) : t.io === `output` && (i.additionalProperties = !1); -}; -const Xr$1 = (e, t, n, r) => { - let i = e._zod.def, a = i.inclusive === !1, o = i.options.map((e, n) => G$3(e, t, { - ...r, - path: [ - ...r.path, - a ? `oneOf` : `anyOf`, - n - ] - })); - a ? n.oneOf = o : n.anyOf = o; -}; -const Zr$1 = (e, t, n, r) => { - let i = e._zod.def, a = G$3(i.left, t, { - ...r, - path: [ - ...r.path, - `allOf`, - 0 - ] - }), o = G$3(i.right, t, { - ...r, - path: [ - ...r.path, - `allOf`, - 1 - ] - }), s = (e) => `allOf` in e && Object.keys(e).length === 1; - n.allOf = [...s(a) ? a.allOf : [a], ...s(o) ? o.allOf : [o]]; -}; -const Qr$1 = (e, t, n, r) => { - let i = n, a = e._zod.def; - i.type = `object`; - let o = a.keyType, s = o._zod.bag?.patterns; - if (a.mode === `loose` && s && s.size > 0) { - let e = G$3(a.valueType, t, { - ...r, - path: [ - ...r.path, - `patternProperties`, - `*` - ] - }); - i.patternProperties = {}; - for (let t of s) i.patternProperties[t.source] = e; - } else (t.target === `draft-07` || t.target === `draft-2020-12`) && (i.propertyNames = G$3(a.keyType, t, { - ...r, - path: [...r.path, `propertyNames`] - })), i.additionalProperties = G$3(a.valueType, t, { - ...r, - path: [...r.path, `additionalProperties`] - }); - let c = o._zod.values; - if (c) { - let e = [...c].filter((e) => typeof e == `string` || typeof e == `number`); - e.length > 0 && (i.required = e); - } -}; -const $r$1 = (e, t, n, r) => { - let i = e._zod.def, a = G$3(i.innerType, t, r), o = t.seen.get(e); - t.target === `openapi-3.0` ? (o.ref = i.innerType, n.nullable = !0) : n.anyOf = [a, { type: `null` }]; -}; -const ei$1 = (e, t, n, r) => { - let i = e._zod.def; - G$3(i.innerType, t, r); - let a = t.seen.get(e); - a.ref = i.innerType; -}; -const ti$1 = (e, t, n, r) => { - let i = e._zod.def; - G$3(i.innerType, t, r); - let a = t.seen.get(e); - a.ref = i.innerType, n.default = JSON.parse(JSON.stringify(i.defaultValue)); -}; -const ni$1 = (e, t, n, r) => { - let i = e._zod.def; - G$3(i.innerType, t, r); - let a = t.seen.get(e); - a.ref = i.innerType, t.io === `input` && (n._prefault = JSON.parse(JSON.stringify(i.defaultValue))); -}; -const ri$1 = (e, t, n, r) => { - let i = e._zod.def; - G$3(i.innerType, t, r); - let a = t.seen.get(e); - a.ref = i.innerType; - let o; - try { - o = i.catchValue(void 0); - } catch { - throw Error(`Dynamic catch values are not supported in JSON Schema`); - } - n.default = o; -}; -const ii$1 = (e, t, n, r) => { - let i = e._zod.def, a = i.in._zod.traits.has(`$ZodTransform`), o = t.io === `input` ? a ? i.out : i.in : i.out; - G$3(o, t, r); - let s = t.seen.get(e); - s.ref = o; -}; -const ai$1 = (e, t, n, r) => { - let i = e._zod.def; - G$3(i.innerType, t, r); - let a = t.seen.get(e); - a.ref = i.innerType, n.readOnly = !0; -}; -const oi$1 = (e, t, n, r) => { - let i = e._zod.def; - G$3(i.innerType, t, r); - let a = t.seen.get(e); - a.ref = i.innerType; -}; -const si$1 = n$1(`ZodISODateTime`, (e, t) => { - Ft$1.init(e, t), Z$2.init(e, t); -}); -function ci$1(e) { - return ar$1(si$1, e); -} -const li$1 = n$1(`ZodISODate`, (e, t) => { - It$1.init(e, t), Z$2.init(e, t); -}); -function ui$1(e) { - return or$1(li$1, e); -} -const di$1 = n$1(`ZodISOTime`, (e, t) => { - Lt$1.init(e, t), Z$2.init(e, t); -}); -function fi$1(e) { - return sr$1(di$1, e); -} -const pi$1 = n$1(`ZodISODuration`, (e, t) => { - Rt$1.init(e, t), Z$2.init(e, t); -}); -function mi$1(e) { - return cr$1(pi$1, e); -} -const hi$1 = (e, t) => { - _e$1.init(e, t), e.name = `ZodError`, Object.defineProperties(e, { - format: { value: (t) => be$1(e, t) }, - flatten: { value: (t) => ye$1(e, t) }, - addIssue: { value: (t) => { - e.issues.push(t), e.message = JSON.stringify(e.issues, c$2, 2); - } }, - addIssues: { value: (t) => { - e.issues.push(...t), e.message = JSON.stringify(e.issues, c$2, 2); - } }, - isEmpty: { get() { - return e.issues.length === 0; - } } - }); -}; -const gi$1 = n$1(`ZodError`, hi$1); -const J$2 = n$1(`ZodError`, hi$1, { Parent: Error }); -const _i$1 = O$1(J$2); -const vi$1 = k$2(J$2); -const yi$1 = A$2(J$2); -const bi$1 = j$2(J$2); -const xi$1 = Ce$1(J$2); -const Si$1 = we$1(J$2); -const Ci$1 = Te$1(J$2); -const wi$1 = Ee$1(J$2); -const Ti$1 = De$1(J$2); -const Ei$1 = Oe$1(J$2); -const Di$1 = ke$1(J$2); -const Oi$1 = Ae$1(J$2); -const ki$1 = /* @__PURE__ */ new WeakMap(); -function Y$2(e, t, n) { - let r = Object.getPrototypeOf(e), i = ki$1.get(r); - if (i || (i = /* @__PURE__ */ new Set(), ki$1.set(r, i)), !i.has(t)) { - i.add(t); - for (let e in n) { - let t = n[e]; - Object.defineProperty(r, e, { - configurable: !0, - enumerable: !1, - get() { - let n = t.bind(this); - return Object.defineProperty(this, e, { - configurable: !0, - writable: !0, - enumerable: !0, - value: n - }), n; - }, - set(t) { - Object.defineProperty(this, e, { - configurable: !0, - writable: !0, - enumerable: !0, - value: t - }); - } - }); - } - } -} -const X$2 = n$1(`ZodType`, (e, t) => (P$2.init(e, t), Object.assign(e[`~standard`], { jsonSchema: { - input: q$2(e, `input`), - output: q$2(e, `output`) -} }), e.toJSONSchema = Rr$1(e, {}), e.def = t, e.type = t.type, Object.defineProperty(e, "_def", { value: t }), e.parse = (t, n) => _i$1(e, t, n, { callee: e.parse }), e.safeParse = (t, n) => yi$1(e, t, n), e.parseAsync = async (t, n) => vi$1(e, t, n, { callee: e.parseAsync }), e.safeParseAsync = async (t, n) => bi$1(e, t, n), e.spa = e.safeParseAsync, e.encode = (t, n) => xi$1(e, t, n), e.decode = (t, n) => Si$1(e, t, n), e.encodeAsync = async (t, n) => Ci$1(e, t, n), e.decodeAsync = async (t, n) => wi$1(e, t, n), e.safeEncode = (t, n) => Ti$1(e, t, n), e.safeDecode = (t, n) => Ei$1(e, t, n), e.safeEncodeAsync = async (t, n) => Di$1(e, t, n), e.safeDecodeAsync = async (t, n) => Oi$1(e, t, n), Y$2(e, `ZodType`, { - check(...e) { - let t = this.def; - return this.clone(g$2(t, { checks: [...t.checks ?? [], ...e.map((e) => typeof e == `function` ? { _zod: { - check: e, - def: { check: `custom` }, - onattach: [] - } } : e)] }), { parent: !0 }); - }, - with(...e) { - return this.check(...e); - }, - clone(e, t) { - return b$2(this, e, t); - }, - brand() { - return this; - }, - register(e, t) { - return e.add(this, t), this; - }, - refine(e, t) { - return this.check(Ga$1(e, t)); - }, - superRefine(e, t) { - return this.check(Ka$1(e, t)); - }, - overwrite(e) { - return this.check(W$2(e)); - }, - optional() { - return Da$1(this); - }, - exactOptional() { - return ka$1(this); - }, - nullable() { - return ja$1(this); - }, - nullish() { - return Da$1(ja$1(this)); - }, - nonoptional(e) { - return La$1(this, e); - }, - array() { - return la$1(this); - }, - or(e) { - return pa$1([this, e]); - }, - and(e) { - return _a$1(this, e); - }, - transform(e) { - return Va$1(this, Ta$1(e)); - }, - default(e) { - return Na$1(this, e); - }, - prefault(e) { - return Fa$1(this, e); - }, - catch(e) { - return za$1(this, e); - }, - pipe(e) { - return Va$1(this, e); - }, - readonly() { - return Ua$1(this); - }, - describe(e) { - let t = this.clone(); - return B$2.add(t, { description: e }), t; - }, - meta(...e) { - if (e.length === 0) return B$2.get(this); - let t = this.clone(); - return B$2.add(t, e[0]), t; - }, - isOptional() { - return this.safeParse(void 0).success; - }, - isNullable() { - return this.safeParse(null).success; - }, - apply(e) { - return e(this); - } -}), Object.defineProperty(e, "description", { - get() { - return B$2.get(e)?.description; - }, - configurable: !0 -}), e)); -const Ai$1 = n$1(`_ZodString`, (e, t) => { - F$2.init(e, t), X$2.init(e, t), e._zod.processJSONSchema = (t, n, r) => Br$1(e, t, n, r); - let n = e._zod.bag; - e.format = n.format ?? null, e.minLength = n.minimum ?? null, e.maxLength = n.maximum ?? null, Y$2(e, `_ZodString`, { - regex(...e) { - return this.check(br$1(...e)); - }, - includes(...e) { - return this.check(Cr$1(...e)); - }, - startsWith(...e) { - return this.check(wr$1(...e)); - }, - endsWith(...e) { - return this.check(Tr$1(...e)); - }, - min(...e) { - return this.check(U$2(...e)); - }, - max(...e) { - return this.check(vr$1(...e)); - }, - length(...e) { - return this.check(yr$1(...e)); - }, - nonempty(...e) { - return this.check(U$2(1, ...e)); - }, - lowercase(e) { - return this.check(xr$1(e)); - }, - uppercase(e) { - return this.check(Sr$1(e)); - }, - trim() { - return this.check(Dr$1()); - }, - normalize(...e) { - return this.check(Er$1(...e)); - }, - toLowerCase() { - return this.check(Or$1()); - }, - toUpperCase() { - return this.check(kr$1()); - }, - slugify() { - return this.check(Ar$1()); - } - }); -}); -const ji$1 = n$1(`ZodString`, (e, t) => { - F$2.init(e, t), Ai$1.init(e, t), e.email = (t) => e.check(Ln$1(Ni$1, t)), e.url = (t) => e.check(Un$1(Fi$1, t)), e.jwt = (t) => e.check(ir$1(Xi$1, t)), e.emoji = (t) => e.check(Wn$1(Ii$1, t)), e.guid = (t) => e.check(Rn$1(Pi$1, t)), e.uuid = (t) => e.check(zn$1(Q$2, t)), e.uuidv4 = (t) => e.check(Bn$1(Q$2, t)), e.uuidv6 = (t) => e.check(Vn$1(Q$2, t)), e.uuidv7 = (t) => e.check(Hn$1(Q$2, t)), e.nanoid = (t) => e.check(Gn$1(Li$1, t)), e.guid = (t) => e.check(Rn$1(Pi$1, t)), e.cuid = (t) => e.check(Kn$1(Ri$1, t)), e.cuid2 = (t) => e.check(qn$1(zi$1, t)), e.ulid = (t) => e.check(Jn$1(Bi$1, t)), e.base64 = (t) => e.check(tr$1(qi$1, t)), e.base64url = (t) => e.check(nr$1(Ji$1, t)), e.xid = (t) => e.check(Yn$1(Vi$1, t)), e.ksuid = (t) => e.check(Xn$2(Hi$1, t)), e.ipv4 = (t) => e.check(Zn$1(Ui$1, t)), e.ipv6 = (t) => e.check(Qn$1(Wi$1, t)), e.cidrv4 = (t) => e.check($n$1(Gi$1, t)), e.cidrv6 = (t) => e.check(er$1(Ki$1, t)), e.e164 = (t) => e.check(rr$1(Yi$1, t)), e.datetime = (t) => e.check(ci$1(t)), e.date = (t) => e.check(ui$1(t)), e.time = (t) => e.check(fi$1(t)), e.duration = (t) => e.check(mi$1(t)); -}); -function Mi$1(e) { - return In$1(ji$1, e); -} -const Z$2 = n$1(`ZodStringFormat`, (e, t) => { - I$2.init(e, t), Ai$1.init(e, t); -}); -const Ni$1 = n$1(`ZodEmail`, (e, t) => { - Et$1.init(e, t), Z$2.init(e, t); -}); -const Pi$1 = n$1(`ZodGUID`, (e, t) => { - wt$1.init(e, t), Z$2.init(e, t); -}); -const Q$2 = n$1(`ZodUUID`, (e, t) => { - Tt$1.init(e, t), Z$2.init(e, t); -}); -const Fi$1 = n$1(`ZodURL`, (e, t) => { - Dt$1.init(e, t), Z$2.init(e, t); -}); -const Ii$1 = n$1(`ZodEmoji`, (e, t) => { - Ot$1.init(e, t), Z$2.init(e, t); -}); -const Li$1 = n$1(`ZodNanoID`, (e, t) => { - kt$1.init(e, t), Z$2.init(e, t); -}); -const Ri$1 = n$1(`ZodCUID`, (e, t) => { - At$1.init(e, t), Z$2.init(e, t); -}); -const zi$1 = n$1(`ZodCUID2`, (e, t) => { - jt$1.init(e, t), Z$2.init(e, t); -}); -const Bi$1 = n$1(`ZodULID`, (e, t) => { - Mt$1.init(e, t), Z$2.init(e, t); -}); -const Vi$1 = n$1(`ZodXID`, (e, t) => { - Nt$1.init(e, t), Z$2.init(e, t); -}); -const Hi$1 = n$1(`ZodKSUID`, (e, t) => { - Pt$1.init(e, t), Z$2.init(e, t); -}); -const Ui$1 = n$1(`ZodIPv4`, (e, t) => { - zt$1.init(e, t), Z$2.init(e, t); -}); -const Wi$1 = n$1(`ZodIPv6`, (e, t) => { - Bt$1.init(e, t), Z$2.init(e, t); -}); -const Gi$1 = n$1(`ZodCIDRv4`, (e, t) => { - Vt$1.init(e, t), Z$2.init(e, t); -}); -const Ki$1 = n$1(`ZodCIDRv6`, (e, t) => { - Ht$1.init(e, t), Z$2.init(e, t); -}); -const qi$1 = n$1(`ZodBase64`, (e, t) => { - Wt$1.init(e, t), Z$2.init(e, t); -}); -const Ji$1 = n$1(`ZodBase64URL`, (e, t) => { - Kt$1.init(e, t), Z$2.init(e, t); -}); -const Yi$1 = n$1(`ZodE164`, (e, t) => { - qt$1.init(e, t), Z$2.init(e, t); -}); -const Xi$1 = n$1(`ZodJWT`, (e, t) => { - Yt$1.init(e, t), Z$2.init(e, t); -}); -const Zi$1 = n$1(`ZodNumber`, (e, t) => { - Xt$1.init(e, t), X$2.init(e, t), e._zod.processJSONSchema = (t, n, r) => Vr$1(e, t, n, r), Y$2(e, `ZodNumber`, { - gt(e, t) { - return this.check(gr$1(e, t)); - }, - gte(e, t) { - return this.check(H$2(e, t)); - }, - min(e, t) { - return this.check(H$2(e, t)); - }, - lt(e, t) { - return this.check(hr$1(e, t)); - }, - lte(e, t) { - return this.check(V$2(e, t)); - }, - max(e, t) { - return this.check(V$2(e, t)); - }, - int(e) { - return this.check(ea$1(e)); - }, - safe(e) { - return this.check(ea$1(e)); - }, - positive(e) { - return this.check(gr$1(0, e)); - }, - nonnegative(e) { - return this.check(H$2(0, e)); - }, - negative(e) { - return this.check(hr$1(0, e)); - }, - nonpositive(e) { - return this.check(V$2(0, e)); - }, - multipleOf(e, t) { - return this.check(_r$1(e, t)); - }, - step(e, t) { - return this.check(_r$1(e, t)); - }, - finite() { - return this; - } - }); - let n = e._zod.bag; - e.minValue = Math.max(n.minimum ?? -Infinity, n.exclusiveMinimum ?? -Infinity) ?? null, e.maxValue = Math.min(n.maximum ?? Infinity, n.exclusiveMaximum ?? Infinity) ?? null, e.isInt = (n.format ?? ``).includes(`int`) || Number.isSafeInteger(n.multipleOf ?? .5), e.isFinite = !0, e.format = n.format ?? null; -}); -function Qi$1(e) { - return lr$1(Zi$1, e); -} -const $i$1 = n$1(`ZodNumberFormat`, (e, t) => { - Zt$1.init(e, t), Zi$1.init(e, t); -}); -function ea$1(e) { - return ur$1($i$1, e); -} -const ta$1 = n$1(`ZodBoolean`, (e, t) => { - Qt$1.init(e, t), X$2.init(e, t), e._zod.processJSONSchema = (t, n, r) => Hr$1(e, t, n, r); -}); -function na$1(e) { - return dr$1(ta$1, e); -} -const ra$1 = n$1(`ZodAny`, (e, t) => { - $t$1.init(e, t), X$2.init(e, t), e._zod.processJSONSchema = (e, t, n) => void 0; -}); -function ia$1() { - return fr$1(ra$1); -} -const aa$1 = n$1(`ZodUnknown`, (e, t) => { - en$1.init(e, t), X$2.init(e, t), e._zod.processJSONSchema = (e, t, n) => void 0; -}); -function $$2() { - return pr$2(aa$1); -} -const oa$1 = n$1(`ZodNever`, (e, t) => { - tn$1.init(e, t), X$2.init(e, t), e._zod.processJSONSchema = (t, n, r) => Ur$1(e, t, n, r); -}); -function sa$1(e) { - return mr$1(oa$1, e); -} -const ca$1 = n$1(`ZodArray`, (e, t) => { - rn$1.init(e, t), X$2.init(e, t), e._zod.processJSONSchema = (t, n, r) => Jr$1(e, t, n, r), e.element = t.element, Y$2(e, `ZodArray`, { - min(e, t) { - return this.check(U$2(e, t)); - }, - nonempty(e) { - return this.check(U$2(1, e)); - }, - max(e, t) { - return this.check(vr$1(e, t)); - }, - length(e, t) { - return this.check(yr$1(e, t)); - }, - unwrap() { - return this.element; - } - }); -}); -function la$1(e, t) { - return jr$1(ca$1, e, t); -} -const ua$1 = n$1(`ZodObject`, (e, t) => { - cn$1.init(e, t), X$2.init(e, t), e._zod.processJSONSchema = (t, n, r) => Yr$1(e, t, n, r), m$1(e, `shape`, () => t.shape), Y$2(e, `ZodObject`, { - keyof() { - return xa$1(Object.keys(this._zod.def.shape)); - }, - catchall(e) { - return this.clone({ - ...this._zod.def, - catchall: e - }); - }, - passthrough() { - return this.clone({ - ...this._zod.def, - catchall: $$2() - }); - }, - loose() { - return this.clone({ - ...this._zod.def, - catchall: $$2() - }); - }, - strict() { - return this.clone({ - ...this._zod.def, - catchall: sa$1() - }); - }, - strip() { - return this.clone({ - ...this._zod.def, - catchall: void 0 - }); - }, - extend(e) { - return ue$1(this, e); - }, - safeExtend(e) { - return de$1(this, e); - }, - merge(e) { - return fe$1(this, e); - }, - pick(e) { - return ce$1(this, e); - }, - omit(e) { - return le$1(this, e); - }, - partial(...e) { - return pe$1(Ea$1, this, e[0]); - }, - required(...e) { - return me$1(Ia$1, this, e[0]); - } - }); -}); -function da$1(e, t) { - return new ua$1({ - type: `object`, - shape: e ?? {}, - ...x$1(t) - }); -} -const fa$1 = n$1(`ZodUnion`, (e, t) => { - un$1.init(e, t), X$2.init(e, t), e._zod.processJSONSchema = (t, n, r) => Xr$1(e, t, n, r), e.options = t.options; -}); -function pa$1(e, t) { - return new fa$1({ - type: `union`, - options: e, - ...x$1(t) - }); -} -const ma$1 = n$1(`ZodDiscriminatedUnion`, (e, t) => { - fa$1.init(e, t), dn$1.init(e, t); -}); -function ha$1(e, t, n) { - return new ma$1({ - type: `union`, - options: t, - discriminator: e, - ...x$1(n) - }); -} -const ga$1 = n$1(`ZodIntersection`, (e, t) => { - fn$1.init(e, t), X$2.init(e, t), e._zod.processJSONSchema = (t, n, r) => Zr$1(e, t, n, r); -}); -function _a$1(e, t) { - return new ga$1({ - type: `intersection`, - left: e, - right: t - }); -} -const va$1 = n$1(`ZodRecord`, (e, t) => { - mn$1.init(e, t), X$2.init(e, t), e._zod.processJSONSchema = (t, n, r) => Qr$1(e, t, n, r), e.keyType = t.keyType, e.valueType = t.valueType; -}); -function ya$1(e, t, n) { - return !t || !t._zod ? new va$1({ - type: `record`, - keyType: Mi$1(), - valueType: e, - ...x$1(t) - }) : new va$1({ - type: `record`, - keyType: e, - valueType: t, - ...x$1(n) - }); -} -const ba$1 = n$1(`ZodEnum`, (e, t) => { - hn$1.init(e, t), X$2.init(e, t), e._zod.processJSONSchema = (t, n, r) => Wr$1(e, t, n, r), e.enum = t.entries, e.options = Object.values(t.entries); - let n = new Set(Object.keys(t.entries)); - e.extract = (e, r) => { - let i = {}; - for (let r of e) if (n.has(r)) i[r] = t.entries[r]; - else throw Error(`Key ${r} not found in enum`); - return new ba$1({ - ...t, - checks: [], - ...x$1(r), - entries: i - }); - }, e.exclude = (e, r) => { - let i = { ...t.entries }; - for (let t of e) if (n.has(t)) delete i[t]; - else throw Error(`Key ${t} not found in enum`); - return new ba$1({ - ...t, - checks: [], - ...x$1(r), - entries: i - }); - }; -}); -function xa$1(e, t) { - return new ba$1({ - type: `enum`, - entries: Array.isArray(e) ? Object.fromEntries(e.map((e) => [e, e])) : e, - ...x$1(t) - }); -} -const Sa$1 = n$1(`ZodLiteral`, (e, t) => { - gn$1.init(e, t), X$2.init(e, t), e._zod.processJSONSchema = (t, n, r) => Gr$1(e, t, n, r), e.values = new Set(t.values), Object.defineProperty(e, "value", { get() { - if (t.values.length > 1) throw Error("This schema contains multiple valid literal values. Use `.values` instead."); - return t.values[0]; - } }); -}); -function Ca$1(e, t) { - return new Sa$1({ - type: `literal`, - values: Array.isArray(e) ? e : [e], - ...x$1(t) - }); -} -const wa$1 = n$1(`ZodTransform`, (e, t) => { - _n$1.init(e, t), X$2.init(e, t), e._zod.processJSONSchema = (t, n, r) => qr$1(e, t, n, r), e._zod.parse = (n, r) => { - if (r.direction === `backward`) throw new i$2(e.constructor.name); - n.addIssue = (r) => { - if (typeof r == `string`) n.issues.push(D$1(r, n.value, t)); - else { - let t = r; - t.fatal && (t.continue = !1), t.code ??= `custom`, t.input ??= n.value, t.inst ??= e, n.issues.push(D$1(t)); - } - }; - let a = t.transform(n.value, n); - return a instanceof Promise ? a.then((e) => (n.value = e, n.fallback = !0, n)) : (n.value = a, n.fallback = !0, n); - }; -}); -function Ta$1(e) { - return new wa$1({ - type: `transform`, - transform: e - }); -} -const Ea$1 = n$1(`ZodOptional`, (e, t) => { - yn$1.init(e, t), X$2.init(e, t), e._zod.processJSONSchema = (t, n, r) => oi$1(e, t, n, r), e.unwrap = () => e._zod.def.innerType; -}); -function Da$1(e) { - return new Ea$1({ - type: `optional`, - innerType: e - }); -} -const Oa$1 = n$1(`ZodExactOptional`, (e, t) => { - bn$1.init(e, t), X$2.init(e, t), e._zod.processJSONSchema = (t, n, r) => oi$1(e, t, n, r), e.unwrap = () => e._zod.def.innerType; -}); -function ka$1(e) { - return new Oa$1({ - type: `optional`, - innerType: e - }); -} -const Aa$1 = n$1(`ZodNullable`, (e, t) => { - xn$1.init(e, t), X$2.init(e, t), e._zod.processJSONSchema = (t, n, r) => $r$1(e, t, n, r), e.unwrap = () => e._zod.def.innerType; -}); -function ja$1(e) { - return new Aa$1({ - type: `nullable`, - innerType: e - }); -} -const Ma$1 = n$1(`ZodDefault`, (e, t) => { - Sn$1.init(e, t), X$2.init(e, t), e._zod.processJSONSchema = (t, n, r) => ti$1(e, t, n, r), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap; -}); -function Na$1(e, t) { - return new Ma$1({ - type: `default`, - innerType: e, - get defaultValue() { - return typeof t == `function` ? t() : ie$2(t); - } - }); -} -const Pa$1 = n$1(`ZodPrefault`, (e, t) => { - wn$1.init(e, t), X$2.init(e, t), e._zod.processJSONSchema = (t, n, r) => ni$1(e, t, n, r), e.unwrap = () => e._zod.def.innerType; -}); -function Fa$1(e, t) { - return new Pa$1({ - type: `prefault`, - innerType: e, - get defaultValue() { - return typeof t == `function` ? t() : ie$2(t); - } - }); -} -const Ia$1 = n$1(`ZodNonOptional`, (e, t) => { - Tn$1.init(e, t), X$2.init(e, t), e._zod.processJSONSchema = (t, n, r) => ei$1(e, t, n, r), e.unwrap = () => e._zod.def.innerType; -}); -function La$1(e, t) { - return new Ia$1({ - type: `nonoptional`, - innerType: e, - ...x$1(t) - }); -} -const Ra$1 = n$1(`ZodCatch`, (e, t) => { - Dn$1.init(e, t), X$2.init(e, t), e._zod.processJSONSchema = (t, n, r) => ri$1(e, t, n, r), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap; -}); -function za$1(e, t) { - return new Ra$1({ - type: `catch`, - innerType: e, - catchValue: typeof t == `function` ? t : () => t - }); -} -const Ba$1 = n$1(`ZodPipe`, (e, t) => { - On$1.init(e, t), X$2.init(e, t), e._zod.processJSONSchema = (t, n, r) => ii$1(e, t, n, r), e.in = t.in, e.out = t.out; -}); -function Va$1(e, t) { - return new Ba$1({ - type: `pipe`, - in: e, - out: t - }); -} -const Ha$1 = n$1(`ZodReadonly`, (e, t) => { - kn$1.init(e, t), X$2.init(e, t), e._zod.processJSONSchema = (t, n, r) => ai$1(e, t, n, r), e.unwrap = () => e._zod.def.innerType; -}); -function Ua$1(e) { - return new Ha$1({ - type: `readonly`, - innerType: e - }); -} -const Wa$1 = n$1(`ZodCustom`, (e, t) => { - jn$1.init(e, t), X$2.init(e, t), e._zod.processJSONSchema = (t, n, r) => Kr$1(e, t, n, r); -}); -function Ga$1(e, t = {}) { - return Mr$1(Wa$1, e, t); -} -function Ka$1(e, t) { - return Nr$1(e, t); -} -const qa$1 = `2.2.1`; -//#endregion -//#region node_modules/eve/dist/src/compiled/@vercel/sandbox/index.js -var sandbox_exports = /* @__PURE__ */ __exportAll({ - APIError: () => A$1, - Command: () => Fr, - CommandFinished: () => Ir, - FileSystem: () => ri, - Sandbox: () => li, - Session: () => Vr, - Snapshot: () => zr, - StreamError: () => j$1, - defineSandboxProxy: () => Ka, - n: () => $n, - t: () => ar -}); -var A$1 = class e extends Error { - constructor(t, n) { - super(t.statusText), Error.captureStackTrace && Error.captureStackTrace(this, e), this.response = t, this.message = n?.message ?? ``, this.json = n?.json, this.text = n?.text, this.sandboxName = n?.sandboxName, this.sessionId = n?.sessionId; - } -}; -var j$1 = class e extends Error { - constructor(t, n, r) { - super(n), this.name = `StreamError`, this.code = t, this.sessionId = r, Error.captureStackTrace && Error.captureStackTrace(this, e); - } -}; -function M$1(e) { - return e == null ? [] : Array.isArray(e) ? e : [e]; -} -var N$1 = d$3(c$3(((e, t) => { - var n = i$3(); - function r(e, t) { - function r(r, i) { - var a = t || {}, o; - `randomize` in a || (a.randomize = !0), o = n.operation(a); - function s(e) { - i(e || Error(`Aborted`)); - } - function c(e, t) { - if (e.bail) { - s(e); - return; - } - o.retry(e) ? a.onRetry && a.onRetry(e, t) : i(o.mainError()); - } - function l(t) { - var n; - try { - n = e(s, t); - } catch (e) { - c(e, t); - return; - } - Promise.resolve(n).then(r).catch(function(e) { - c(e, t); - }); - } - o.attempt(l); - } - return new Promise(r); - } - t.exports = r; -}))(), 1); -function P$1(e) { - return async (t, n = {}) => { - let r = Object.assign({ - minTimeout: 10, - retries: 5, - factor: 6, - maxRetryAfter: 20 - }, n.retry); - n.onRetry && (r.onRetry = (e, t) => { - n.onRetry(e, n), n.retry && n.retry.onRetry && n.retry.onRetry(e, t); - }); - try { - return await (0, N$1.default)(async (i) => { - try { - if (n.signal?.aborted) return i(n.signal.reason || Error(`Request aborted`)); - let a = await e(t, n); - if (a.status === 429) { - let e = parseInt(a.headers.get(`retry-after`) || ``, 10); - if (e && !isNaN(e)) { - if (e > r.maxRetryAfter) return a; - await setTimeout$1(e * 1e3); - } - throw new A$1(a); - } - if (a.status >= 500 && a.status < 600) throw new A$1(a); - return a; - } catch (e) { - if (F$1(e)) return i(e); - if (n.signal?.aborted) return i(n.signal.reason || Error(`Request aborted`)); - throw e; - } - }, r); - } catch (e) { - if (e instanceof A$1) return e.response; - throw e; - } - }; -} -function F$1(e) { - return e != null && e.name === `AbortError`; -} -var I$1 = c$3(((e, t) => { - t.exports = { - kClose: Symbol(`close`), - kDestroy: Symbol(`destroy`), - kDispatch: Symbol(`dispatch`), - kUrl: Symbol(`url`), - kWriting: Symbol(`writing`), - kResuming: Symbol(`resuming`), - kQueue: Symbol(`queue`), - kConnect: Symbol(`connect`), - kConnecting: Symbol(`connecting`), - kKeepAliveDefaultTimeout: Symbol(`default keep alive timeout`), - kKeepAliveMaxTimeout: Symbol(`max keep alive timeout`), - kKeepAliveTimeoutThreshold: Symbol(`keep alive timeout threshold`), - kKeepAliveTimeoutValue: Symbol(`keep alive timeout`), - kKeepAlive: Symbol(`keep alive`), - kHeadersTimeout: Symbol(`headers timeout`), - kBodyTimeout: Symbol(`body timeout`), - kServerName: Symbol(`server name`), - kLocalAddress: Symbol(`local address`), - kHost: Symbol(`host`), - kNoRef: Symbol(`no ref`), - kBodyUsed: Symbol(`used`), - kBody: Symbol(`abstracted request body`), - kRunning: Symbol(`running`), - kBlocking: Symbol(`blocking`), - kPending: Symbol(`pending`), - kSize: Symbol(`size`), - kBusy: Symbol(`busy`), - kQueued: Symbol(`queued`), - kFree: Symbol(`free`), - kConnected: Symbol(`connected`), - kClosed: Symbol(`closed`), - kNeedDrain: Symbol(`need drain`), - kReset: Symbol(`reset`), - kDestroyed: Symbol.for(`nodejs.stream.destroyed`), - kResume: Symbol(`resume`), - kOnError: Symbol(`on error`), - kMaxHeadersSize: Symbol(`max headers size`), - kRunningIdx: Symbol(`running index`), - kPendingIdx: Symbol(`pending index`), - kError: Symbol(`error`), - kClients: Symbol(`clients`), - kClient: Symbol(`client`), - kParser: Symbol(`parser`), - kOnDestroyed: Symbol(`destroy callbacks`), - kPipelining: Symbol(`pipelining`), - kSocket: Symbol(`socket`), - kHostHeader: Symbol(`host header`), - kConnector: Symbol(`connector`), - kStrictContentLength: Symbol(`strict content length`), - kMaxRedirections: Symbol(`maxRedirections`), - kMaxRequests: Symbol(`maxRequestsPerClient`), - kProxy: Symbol(`proxy agent options`), - kCounter: Symbol(`socket request counter`), - kMaxResponseSize: Symbol(`max response size`), - kHTTP2Session: Symbol(`http2Session`), - kHTTP2SessionState: Symbol(`http2Session state`), - kRetryHandlerDefaultRetry: Symbol(`retry agent default retry`), - kConstruct: Symbol(`constructable`), - kListeners: Symbol(`listeners`), - kHTTPContext: Symbol(`http context`), - kMaxConcurrentStreams: Symbol(`max concurrent streams`), - kHTTP2InitialWindowSize: Symbol(`http2 initial window size`), - kHTTP2ConnectionWindowSize: Symbol(`http2 connection window size`), - kEnableConnectProtocol: Symbol(`http2session connect protocol`), - kRemoteSettings: Symbol(`http2session remote settings`), - kHTTP2Stream: Symbol(`http2session client stream`), - kPingInterval: Symbol(`ping interval`), - kNoProxyAgent: Symbol(`no proxy agent`), - kHttpProxyAgent: Symbol(`http proxy agent`), - kHttpsProxyAgent: Symbol(`https proxy agent`), - kSocks5ProxyAgent: Symbol(`socks5 proxy agent`) - }; -})); -var L$1 = c$3(((e, t) => { - let n = 0, r = 1e3, i, a = Symbol(`kFastTimer`), o = []; - function s() { - n += 499; - let e = 0, t = o.length; - for (; e < t;) { - let r = o[e]; - r._state === 0 ? (r._idleStart = n - 499, r._state = 1) : r._state === 1 && n >= r._idleStart + r._idleTimeout && (r._state = -1, r._idleStart = -1, r._onTimeout(r._timerArg)), r._state === -1 ? (r._state = -2, --t !== 0 && (o[e] = o[t])) : ++e; - } - o.length = t, o.length !== 0 && c(); - } - function c() { - i?.refresh ? i.refresh() : (clearTimeout(i), i = setTimeout(s, 499), i?.unref()); - } - var l = class { - [a] = !0; - _state = -2; - _idleTimeout = -1; - _idleStart = -1; - _onTimeout; - _timerArg; - constructor(e, t, n) { - this._onTimeout = e, this._idleTimeout = t, this._timerArg = n, this.refresh(); - } - refresh() { - this._state === -2 && o.push(this), (!i || o.length === 1) && c(), this._state = 0; - } - clear() { - this._state = -1, this._idleStart = -1; - } - }; - t.exports = { - setTimeout(e, t, n) { - return t <= r ? setTimeout(e, t, n) : new l(e, t, n); - }, - clearTimeout(e) { - e[a] ? e.clear() : clearTimeout(e); - }, - setFastTimeout(e, t, n) { - return new l(e, t, n); - }, - clearFastTimeout(e) { - e.clear(); - }, - now() { - return n; - }, - tick(e = 0) { - n += e - r + 1, s(), s(); - }, - reset() { - n = 0, o.length = 0, clearTimeout(i), i = null; - }, - kFastTimer: a - }; -})); -var R$1 = c$3(((e, t) => { - let n = Symbol.for(`undici.error.UND_ERR`); - var r = class extends Error { - constructor(e, t) { - super(e, t), this.name = `UndiciError`, this.code = `UND_ERR`; - } - static [Symbol.hasInstance](e) { - return e && e[n] === !0; - } - get [n]() { - return !0; - } - }; - let i = Symbol.for(`undici.error.UND_ERR_CONNECT_TIMEOUT`); - var a = class extends r { - constructor(e) { - super(e), this.name = `ConnectTimeoutError`, this.message = e || `Connect Timeout Error`, this.code = `UND_ERR_CONNECT_TIMEOUT`; - } - static [Symbol.hasInstance](e) { - return e && e[i] === !0; - } - get [i]() { - return !0; - } - }; - let o = Symbol.for(`undici.error.UND_ERR_HEADERS_TIMEOUT`); - var s = class extends r { - constructor(e) { - super(e), this.name = `HeadersTimeoutError`, this.message = e || `Headers Timeout Error`, this.code = `UND_ERR_HEADERS_TIMEOUT`; - } - static [Symbol.hasInstance](e) { - return e && e[o] === !0; - } - get [o]() { - return !0; - } - }; - let c = Symbol.for(`undici.error.UND_ERR_HEADERS_OVERFLOW`); - var l = class extends r { - constructor(e) { - super(e), this.name = `HeadersOverflowError`, this.message = e || `Headers Overflow Error`, this.code = `UND_ERR_HEADERS_OVERFLOW`; - } - static [Symbol.hasInstance](e) { - return e && e[c] === !0; - } - get [c]() { - return !0; - } - }; - let u = Symbol.for(`undici.error.UND_ERR_BODY_TIMEOUT`); - var d = class extends r { - constructor(e) { - super(e), this.name = `BodyTimeoutError`, this.message = e || `Body Timeout Error`, this.code = `UND_ERR_BODY_TIMEOUT`; - } - static [Symbol.hasInstance](e) { - return e && e[u] === !0; - } - get [u]() { - return !0; - } - }; - let f = Symbol.for(`undici.error.UND_ERR_INVALID_ARG`); - var p = class extends r { - constructor(e) { - super(e), this.name = `InvalidArgumentError`, this.message = e || `Invalid Argument Error`, this.code = `UND_ERR_INVALID_ARG`; - } - static [Symbol.hasInstance](e) { - return e && e[f] === !0; - } - get [f]() { - return !0; - } - }; - let m = Symbol.for(`undici.error.UND_ERR_INVALID_RETURN_VALUE`); - var h = class extends r { - constructor(e) { - super(e), this.name = `InvalidReturnValueError`, this.message = e || `Invalid Return Value Error`, this.code = `UND_ERR_INVALID_RETURN_VALUE`; - } - static [Symbol.hasInstance](e) { - return e && e[m] === !0; - } - get [m]() { - return !0; - } - }; - let g = Symbol.for(`undici.error.UND_ERR_ABORT`); - var _ = class extends r { - constructor(e) { - super(e), this.name = `AbortError`, this.message = e || `The operation was aborted`, this.code = `UND_ERR_ABORT`; - } - static [Symbol.hasInstance](e) { - return e && e[g] === !0; - } - get [g]() { - return !0; - } - }; - let v = Symbol.for(`undici.error.UND_ERR_ABORTED`); - var y = class extends _ { - constructor(e) { - super(e), this.name = `AbortError`, this.message = e || `Request aborted`, this.code = `UND_ERR_ABORTED`; - } - static [Symbol.hasInstance](e) { - return e && e[v] === !0; - } - get [v]() { - return !0; - } - }; - let b = Symbol.for(`undici.error.UND_ERR_INFO`); - var x = class extends r { - constructor(e) { - super(e), this.name = `InformationalError`, this.message = e || `Request information`, this.code = `UND_ERR_INFO`; - } - static [Symbol.hasInstance](e) { - return e && e[b] === !0; - } - get [b]() { - return !0; - } - }; - let S = Symbol.for(`undici.error.UND_ERR_REQ_CONTENT_LENGTH_MISMATCH`); - var C = class extends r { - constructor(e) { - super(e), this.name = `RequestContentLengthMismatchError`, this.message = e || `Request body length does not match content-length header`, this.code = `UND_ERR_REQ_CONTENT_LENGTH_MISMATCH`; - } - static [Symbol.hasInstance](e) { - return e && e[S] === !0; - } - get [S]() { - return !0; - } - }; - let w = Symbol.for(`undici.error.UND_ERR_RES_CONTENT_LENGTH_MISMATCH`); - var T = class extends r { - constructor(e) { - super(e), this.name = `ResponseContentLengthMismatchError`, this.message = e || `Response body length does not match content-length header`, this.code = `UND_ERR_RES_CONTENT_LENGTH_MISMATCH`; - } - static [Symbol.hasInstance](e) { - return e && e[w] === !0; - } - get [w]() { - return !0; - } - }; - let E = Symbol.for(`undici.error.UND_ERR_DESTROYED`); - var D = class extends r { - constructor(e) { - super(e), this.name = `ClientDestroyedError`, this.message = e || `The client is destroyed`, this.code = `UND_ERR_DESTROYED`; - } - static [Symbol.hasInstance](e) { - return e && e[E] === !0; - } - get [E]() { - return !0; - } - }; - let O = Symbol.for(`undici.error.UND_ERR_CLOSED`); - var k = class extends r { - constructor(e) { - super(e), this.name = `ClientClosedError`, this.message = e || `The client is closed`, this.code = `UND_ERR_CLOSED`; - } - static [Symbol.hasInstance](e) { - return e && e[O] === !0; - } - get [O]() { - return !0; - } - }; - let A = Symbol.for(`undici.error.UND_ERR_SOCKET`); - var j = class extends r { - constructor(e, t) { - super(e), this.name = `SocketError`, this.message = e || `Socket error`, this.code = `UND_ERR_SOCKET`, this.socket = t; - } - static [Symbol.hasInstance](e) { - return e && e[A] === !0; - } - get [A]() { - return !0; - } - }; - let M = Symbol.for(`undici.error.UND_ERR_NOT_SUPPORTED`); - var N = class extends r { - constructor(e) { - super(e), this.name = `NotSupportedError`, this.message = e || `Not supported error`, this.code = `UND_ERR_NOT_SUPPORTED`; - } - static [Symbol.hasInstance](e) { - return e && e[M] === !0; - } - get [M]() { - return !0; - } - }; - let P = Symbol.for(`undici.error.UND_ERR_BPL_MISSING_UPSTREAM`); - var F = class extends r { - constructor(e) { - super(e), this.name = `MissingUpstreamError`, this.message = e || `No upstream has been added to the BalancedPool`, this.code = `UND_ERR_BPL_MISSING_UPSTREAM`; - } - static [Symbol.hasInstance](e) { - return e && e[P] === !0; - } - get [P]() { - return !0; - } - }; - let I = Symbol.for(`undici.error.UND_ERR_HTTP_PARSER`); - var L = class extends Error { - constructor(e, t, n) { - super(e), this.name = `HTTPParserError`, this.code = t ? `HPE_${t}` : void 0, this.data = n ? n.toString() : void 0; - } - static [Symbol.hasInstance](e) { - return e && e[I] === !0; - } - get [I]() { - return !0; - } - }; - let R = Symbol.for(`undici.error.UND_ERR_RES_EXCEEDED_MAX_SIZE`); - var ee = class extends r { - constructor(e) { - super(e), this.name = `ResponseExceededMaxSizeError`, this.message = e || `Response content exceeded max size`, this.code = `UND_ERR_RES_EXCEEDED_MAX_SIZE`; - } - static [Symbol.hasInstance](e) { - return e && e[R] === !0; - } - get [R]() { - return !0; - } - }; - let z = Symbol.for(`undici.error.UND_ERR_REQ_RETRY`); - var B = class extends r { - constructor(e, t, { headers: n, data: r }) { - super(e), this.name = `RequestRetryError`, this.message = e || `Request retry error`, this.code = `UND_ERR_REQ_RETRY`, this.statusCode = t, this.data = r, this.headers = n; - } - static [Symbol.hasInstance](e) { - return e && e[z] === !0; - } - get [z]() { - return !0; - } - }; - let V = Symbol.for(`undici.error.UND_ERR_RESPONSE`); - var H = class extends r { - constructor(e, t, { headers: n, body: r }) { - super(e), this.name = `ResponseError`, this.message = e || `Response error`, this.code = `UND_ERR_RESPONSE`, this.statusCode = t, this.body = r, this.headers = n; - } - static [Symbol.hasInstance](e) { - return e && e[V] === !0; - } - get [V]() { - return !0; - } - }; - let te = Symbol.for(`undici.error.UND_ERR_PRX_TLS`); - var U = class extends r { - constructor(e, t, n = {}) { - super(t, { - cause: e, - ...n - }), this.name = `SecureProxyConnectionError`, this.message = t || `Secure Proxy Connection failed`, this.code = `UND_ERR_PRX_TLS`, this.cause = e; - } - static [Symbol.hasInstance](e) { - return e && e[te] === !0; - } - get [te]() { - return !0; - } - }; - let W = Symbol.for(`undici.error.UND_ERR_MAX_ORIGINS_REACHED`); - var ne = class extends r { - constructor(e) { - super(e), this.name = `MaxOriginsReachedError`, this.message = e || `Maximum allowed origins reached`, this.code = `UND_ERR_MAX_ORIGINS_REACHED`; - } - static [Symbol.hasInstance](e) { - return e && e[W] === !0; - } - get [W]() { - return !0; - } - }, G = class extends r { - constructor(e, t) { - super(e), this.name = `Socks5ProxyError`, this.message = e || `SOCKS5 proxy error`, this.code = t || `UND_ERR_SOCKS5`; - } - }; - let K = Symbol.for(`undici.error.UND_ERR_WS_MESSAGE_SIZE_EXCEEDED`); - t.exports = { - AbortError: _, - HTTPParserError: L, - UndiciError: r, - HeadersTimeoutError: s, - HeadersOverflowError: l, - BodyTimeoutError: d, - RequestContentLengthMismatchError: C, - ConnectTimeoutError: a, - InvalidArgumentError: p, - InvalidReturnValueError: h, - RequestAbortedError: y, - ClientDestroyedError: D, - ClientClosedError: k, - InformationalError: x, - SocketError: j, - NotSupportedError: N, - ResponseContentLengthMismatchError: T, - BalancedPoolMissingUpstreamError: F, - ResponseExceededMaxSizeError: ee, - RequestRetryError: B, - ResponseError: H, - SecureProxyConnectionError: U, - MaxOriginsReachedError: ne, - Socks5ProxyError: G, - MessageSizeExceededError: class extends r { - constructor(e) { - super(e), this.name = `MessageSizeExceededError`, this.message = e || `Max decompressed message size exceeded`, this.code = `UND_ERR_WS_MESSAGE_SIZE_EXCEEDED`; - } - static [Symbol.hasInstance](e) { - return e && e[K] === !0; - } - get [K]() { - return !0; - } - } - }; -})); -var ee$2 = c$3(((e, t) => { - let n = `Accept.Accept-Encoding.Accept-Language.Accept-Ranges.Access-Control-Allow-Credentials.Access-Control-Allow-Headers.Access-Control-Allow-Methods.Access-Control-Allow-Origin.Access-Control-Expose-Headers.Access-Control-Max-Age.Access-Control-Request-Headers.Access-Control-Request-Method.Age.Allow.Alt-Svc.Alt-Used.Authorization.Cache-Control.Clear-Site-Data.Connection.Content-Disposition.Content-Encoding.Content-Language.Content-Length.Content-Location.Content-Range.Content-Security-Policy.Content-Security-Policy-Report-Only.Content-Type.Cookie.Cross-Origin-Embedder-Policy.Cross-Origin-Opener-Policy.Cross-Origin-Resource-Policy.Date.Device-Memory.Downlink.ECT.ETag.Expect.Expect-CT.Expires.Forwarded.From.Host.If-Match.If-Modified-Since.If-None-Match.If-Range.If-Unmodified-Since.Keep-Alive.Last-Modified.Link.Location.Max-Forwards.Origin.Permissions-Policy.Pragma.Proxy-Authenticate.Proxy-Authorization.RTT.Range.Referer.Referrer-Policy.Refresh.Retry-After.Sec-WebSocket-Accept.Sec-WebSocket-Extensions.Sec-WebSocket-Key.Sec-WebSocket-Protocol.Sec-WebSocket-Version.Server.Server-Timing.Service-Worker-Allowed.Service-Worker-Navigation-Preload.Set-Cookie.SourceMap.Strict-Transport-Security.Supports-Loading-Mode.TE.Timing-Allow-Origin.Trailer.Transfer-Encoding.Upgrade.Upgrade-Insecure-Requests.User-Agent.Vary.Via.WWW-Authenticate.X-Content-Type-Options.X-DNS-Prefetch-Control.X-Frame-Options.X-Permitted-Cross-Domain-Policies.X-Powered-By.X-Requested-With.X-XSS-Protection`.split(`.`), r = {}; - Object.setPrototypeOf(r, null); - let i = {}; - Object.setPrototypeOf(i, null); - function a(e) { - let t = i[e]; - return t === void 0 && (t = Buffer.from(e)), t; - } - for (let e = 0; e < n.length; ++e) { - let t = n[e], i = t.toLowerCase(); - r[t] = r[i] = i; - } - t.exports = { - wellknownHeaderNames: n, - headerNameLowerCasedRecord: r, - getHeaderNameAsBuffer: a - }; -})); -var z$1 = c$3(((e, t) => { - let { wellknownHeaderNames: n, headerNameLowerCasedRecord: r } = ee$2(); - var i = class e { - value = null; - left = null; - middle = null; - right = null; - code; - constructor(t, n, r) { - if (r === void 0 || r >= t.length) throw TypeError(`Unreachable`); - if ((this.code = t.charCodeAt(r)) > 127) throw TypeError(`key must be ascii string`); - t.length === ++r ? this.value = n : this.middle = new e(t, n, r); - } - add(t, n) { - let r = t.length; - if (r === 0) throw TypeError(`Unreachable`); - let i = 0, a = this; - for (;;) { - let o = t.charCodeAt(i); - if (o > 127) throw TypeError(`key must be ascii string`); - if (a.code === o) if (r === ++i) { - a.value = n; - break; - } else if (a.middle !== null) a = a.middle; - else { - a.middle = new e(t, n, i); - break; - } - else if (a.code < o) if (a.left !== null) a = a.left; - else { - a.left = new e(t, n, i); - break; - } - else if (a.right !== null) a = a.right; - else { - a.right = new e(t, n, i); - break; - } - } - } - search(e) { - let t = e.length, n = 0, r = this; - for (; r !== null && n < t;) { - let i = e[n]; - for (i <= 90 && i >= 65 && (i |= 32); r !== null;) { - if (i === r.code) { - if (t === ++n) return r; - r = r.middle; - break; - } - r = r.code < i ? r.left : r.right; - } - } - return null; - } - }, a = class { - node = null; - insert(e, t) { - this.node === null ? this.node = new i(e, t, 0) : this.node.add(e, t); - } - lookup(e) { - return this.node?.search(e)?.value ?? null; - } - }; - let o = new a(); - for (let e = 0; e < n.length; ++e) { - let t = r[n[e]]; - o.insert(t, t); - } - t.exports = { - TernarySearchTree: a, - tree: o - }; -})); -var B$1 = c$3(((e, t) => { - let r = p$4(`node:assert`), { kDestroyed: i, kBodyUsed: a, kListeners: o, kBody: s } = I$1(), { IncomingMessage: c } = p$4(`node:http`), l = p$4(`node:stream`), u = p$4(`node:net`), { stringify: d } = p$4(`node:querystring`), { EventEmitter: f } = p$4(`node:events`), p = L$1(), { InvalidArgumentError: m, ConnectTimeoutError: h } = R$1(), { headerNameLowerCasedRecord: g } = ee$2(), { tree: _ } = z$1(), [v, y] = process.versions.node.split(`.`, 2).map((e) => Number(e)); - var b = class { - constructor(e) { - this[s] = e, this[a] = !1; - } - async *[Symbol.asyncIterator]() { - r(!this[a], `disturbed`), this[a] = !0, yield* this[s]; - } - }; - function x() {} - function S(e) { - return C(e) ? (V(e) === 0 && e.on(`data`, function() { - r(!1); - }), typeof e.readableDidRead != `boolean` && (e[a] = !1, f.prototype.on.call(e, `data`, function() { - this[a] = !0; - })), e) : e && typeof e.pipeTo == `function` ? new b(e) : e && q(e) ? e : e && typeof e != `string` && !ArrayBuffer.isView(e) && F(e) ? new b(e) : e; - } - function C(e) { - return e && typeof e == `object` && typeof e.pipe == `function` && typeof e.on == `function`; - } - function w(e) { - if (e === null) return !1; - if (e instanceof Blob) return !0; - if (typeof e != `object`) return !1; - { - let t = e[Symbol.toStringTag]; - return (t === `Blob` || t === `File`) && (`stream` in e && typeof e.stream == `function` || `arrayBuffer` in e && typeof e.arrayBuffer == `function`); - } - } - function T(e) { - return e.includes(`?`) || e.includes(`#`); - } - function E(e, t) { - if (T(e)) throw Error(`Query params cannot be passed when url already contains "?" or "#".`); - let n = d(t); - return n && (e += `?` + n), e; - } - function D(e) { - let t = parseInt(e, 10); - return t === Number(e) && t >= 0 && t <= 65535; - } - function O(e) { - return e != null && e[0] === `h` && e[1] === `t` && e[2] === `t` && e[3] === `p` && (e[4] === `:` || e[4] === `s` && e[5] === `:`); - } - function k(e) { - if (typeof e == `string`) { - if (e = new URL(e), !O(e.origin || e.protocol)) throw new m("Invalid URL protocol: the URL must start with `http:` or `https:`."); - return e; - } - if (!e || typeof e != `object`) throw new m(`Invalid URL: The URL argument must be a non-null object.`); - if (!(e instanceof URL)) { - if (e.port != null && e.port !== `` && D(e.port) === !1) throw new m(`Invalid URL: port must be a valid integer or a string representation of an integer.`); - if (e.path != null && typeof e.path != `string`) throw new m(`Invalid URL path: the path must be a string or null/undefined.`); - if (e.pathname != null && typeof e.pathname != `string`) throw new m(`Invalid URL pathname: the pathname must be a string or null/undefined.`); - if (e.hostname != null && typeof e.hostname != `string`) throw new m(`Invalid URL hostname: the hostname must be a string or null/undefined.`); - if (e.origin != null && typeof e.origin != `string`) throw new m(`Invalid URL origin: the origin must be a string or null/undefined.`); - if (!O(e.origin || e.protocol)) throw new m("Invalid URL protocol: the URL must start with `http:` or `https:`."); - let t = e.port == null ? e.protocol === `https:` ? 443 : 80 : e.port, n = e.origin == null ? `${e.protocol || ``}//${e.hostname || ``}:${t}` : e.origin, r = e.path == null ? `${e.pathname || ``}${e.search || ``}` : e.path; - return n[n.length - 1] === `/` && (n = n.slice(0, n.length - 1)), r && r[0] !== `/` && (r = `/${r}`), new URL(`${n}${r}`); - } - if (!O(e.origin || e.protocol)) throw new m("Invalid URL protocol: the URL must start with `http:` or `https:`."); - return e; - } - function A(e) { - if (e = k(e), e.pathname !== `/` || e.search || e.hash) throw new m(`invalid url`); - return e; - } - function j(e) { - if (e[0] === `[`) { - let t = e.indexOf(`]`); - return r(t !== -1), e.substring(1, t); - } - let t = e.indexOf(`:`); - return t === -1 ? e : e.substring(0, t); - } - function M(e) { - if (!e) return null; - r(typeof e == `string`); - let t = j(e); - return u.isIP(t) ? `` : t; - } - function N(e) { - return JSON.parse(JSON.stringify(e)); - } - function P(e) { - return e != null && typeof e[Symbol.asyncIterator] == `function`; - } - function F(e) { - return e != null && (typeof e[Symbol.iterator] == `function` || typeof e[Symbol.asyncIterator] == `function`); - } - function B(e) { - let t = Object.getPrototypeOf(e); - return Object.prototype.hasOwnProperty.call(e, Symbol.iterator) || t != null && t !== Object.prototype && typeof e[Symbol.iterator] == `function`; - } - function V(e) { - if (e == null) return 0; - if (C(e)) { - let t = e._readableState; - return t && t.objectMode === !1 && t.ended === !0 && Number.isFinite(t.length) ? t.length : null; - } else if (w(e)) return e.size == null ? null : e.size; - else if (ae(e)) return e.byteLength; - return null; - } - function H(e) { - return e && !!(e.destroyed || e[i] || l.isDestroyed?.(e)); - } - function te(e, t) { - e == null || !C(e) || H(e) || (typeof e.destroy == `function` ? (Object.getPrototypeOf(e).constructor === c && (e.socket = null), e.destroy(t)) : t && queueMicrotask(() => { - e.emit(`error`, t); - }), e.destroyed !== !0 && (e[i] = !0)); - } - let U = /timeout=(\d+)/; - function W(e) { - let t = e.match(U); - return t ? parseInt(t[1], 10) * 1e3 : null; - } - function ne(e) { - return typeof e == `string` ? g[e] ?? e.toLowerCase() : _.lookup(e) ?? e.toString(`latin1`).toLowerCase(); - } - function G(e) { - return _.lookup(e) ?? e.toString(`latin1`).toLowerCase(); - } - function K(e, t) { - t === void 0 && (t = {}); - for (let n = 0; n < e.length; n += 2) { - let r = ne(e[n]), i = t[r]; - if (i !== void 0) if (Object.hasOwn(t, r)) typeof i == `string` && (i = [i], t[r] = i), i.push(e[n + 1].toString(`latin1`)); - else { - let i = typeof e[n + 1] == `string` ? e[n + 1] : Array.isArray(e[n + 1]) ? e[n + 1].map((e) => e.toString(`latin1`)) : e[n + 1].toString(`latin1`); - r === `__proto__` ? Object.defineProperty(t, r, { - value: i, - enumerable: !0, - configurable: !0, - writable: !0 - }) : t[r] = i; - } - else { - let i = typeof e[n + 1] == `string` ? e[n + 1] : Array.isArray(e[n + 1]) ? e[n + 1].map((e) => e.toString(`latin1`)) : e[n + 1].toString(`latin1`); - t[r] = i; - } - } - return t; - } - function re(e) { - let t = e.length, n = Array(t), r, i; - for (let a = 0; a < t; a += 2) r = e[a], i = e[a + 1], typeof r != `string` && (r = r.toString()), typeof i != `string` && (i = i.toString(`latin1`)), n[a] = r, n[a + 1] = i; - return n; - } - function ie(e) { - if (!Array.isArray(e)) throw TypeError(`expected headers to be an array`); - return e.map((e) => Buffer.from(e)); - } - function ae(e) { - return e instanceof Uint8Array || Buffer.isBuffer(e); - } - function oe(e, t, n) { - if (!e || typeof e != `object`) throw new m(`handler must be an object`); - if (typeof e.onRequestStart != `function`) { - if (typeof e.onConnect != `function`) throw new m(`invalid onConnect method`); - if (typeof e.onError != `function`) throw new m(`invalid onError method`); - if (typeof e.onBodySent != `function` && e.onBodySent !== void 0) throw new m(`invalid onBodySent method`); - if (n || t === `CONNECT`) { - if (typeof e.onUpgrade != `function`) throw new m(`invalid onUpgrade method`); - } else { - if (typeof e.onHeaders != `function`) throw new m(`invalid onHeaders method`); - if (typeof e.onData != `function`) throw new m(`invalid onData method`); - if (typeof e.onComplete != `function`) throw new m(`invalid onComplete method`); - } - } - } - function se(e) { - return !!(e && (l.isDisturbed(e) || e[a])); - } - function ce(e) { - return { - localAddress: e.localAddress, - localPort: e.localPort, - remoteAddress: e.remoteAddress, - remotePort: e.remotePort, - remoteFamily: e.remoteFamily, - timeout: e.timeout, - bytesWritten: e.bytesWritten, - bytesRead: e.bytesRead - }; - } - function le(e) { - let t; - return new ReadableStream({ - start() { - t = e[Symbol.asyncIterator](); - }, - pull(e) { - return t.next().then(({ done: t, value: n }) => { - if (t) return queueMicrotask(() => { - e.close(), e.byobRequest?.respond(0); - }); - { - let t = Buffer.isBuffer(n) ? n : Buffer.from(n); - return t.byteLength ? e.enqueue(new Uint8Array(t)) : this.pull(e); - } - }); - }, - cancel() { - return t.return(); - }, - type: `bytes` - }); - } - function q(e) { - return e && typeof e == `object` && typeof e.append == `function` && typeof e.delete == `function` && typeof e.get == `function` && typeof e.getAll == `function` && typeof e.has == `function` && typeof e.set == `function` && e[Symbol.toStringTag] === `FormData`; - } - function J(e, t) { - return `addEventListener` in e ? (e.addEventListener(`abort`, t, { once: !0 }), () => e.removeEventListener(`abort`, t)) : (e.once(`abort`, t), () => e.removeListener(`abort`, t)); - } - let ue = new Uint8Array([ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 0, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 1, - 1, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 1, - 0, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ]); - function de(e) { - return ue[e] === 1; - } - let Y = /^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/; - function fe(e) { - if (e.length >= 12) return Y.test(e); - if (e.length === 0) return !1; - for (let t = 0; t < e.length; t++) if (ue[e.charCodeAt(t)] !== 1) return !1; - return !0; - } - let pe = /[^\t\x20-\x7e\x80-\xff]/; - function X(e) { - return !pe.test(e); - } - let me = /^bytes (\d+)-(\d+)\/(\d+)?$/; - function he(e) { - if (e == null || e === ``) return { - start: 0, - end: null, - size: null - }; - let t = e ? e.match(me) : null; - return t ? { - start: parseInt(t[1]), - end: t[2] ? parseInt(t[2]) : null, - size: t[3] ? parseInt(t[3]) : null - } : null; - } - function ge(e, t, n) { - return (e[o] ??= []).push([t, n]), e.on(t, n), e; - } - function Z(e) { - if (e[o] != null) { - for (let [t, n] of e[o]) e.removeListener(t, n); - e[o] = null; - } - return e; - } - function _e(e, t, n) { - try { - t.onError(n), r(t.aborted); - } catch (t) { - e.emit(`error`, t); - } - } - let ve = process.platform === `win32` ? (e, t) => { - if (!t.timeout) return x; - let n = null, r = null, i = p.setFastTimeout(() => { - n = setImmediate(() => { - r = setImmediate(() => ye(e.deref(), t)); - }); - }, t.timeout); - return () => { - p.clearFastTimeout(i), clearImmediate(n), clearImmediate(r); - }; - } : (e, t) => { - if (!t.timeout) return x; - let n = null, r = p.setFastTimeout(() => { - n = setImmediate(() => { - ye(e.deref(), t); - }); - }, t.timeout); - return () => { - p.clearFastTimeout(r), clearImmediate(n); - }; - }; - function ye(e, t) { - if (e == null) return; - let n = `Connect Timeout Error`; - Array.isArray(e.autoSelectFamilyAttemptedAddresses) ? n += ` (attempted addresses: ${e.autoSelectFamilyAttemptedAddresses.join(`, `)},` : n += ` (attempted address: ${t.hostname}:${t.port},`, n += ` timeout: ${t.timeout}ms)`, te(e, new h(n)); - } - function be(e) { - if (e[0] === `h` && e[1] === `t` && e[2] === `t` && e[3] === `p`) switch (e[4]) { - case `:`: return `http:`; - case `s`: if (e[5] === `:`) return `https:`; - } - return e.slice(0, e.indexOf(`:`) + 1); - } - let xe = Object.create(null); - xe.enumerable = !0; - let Se = { - delete: `DELETE`, - DELETE: `DELETE`, - get: `GET`, - GET: `GET`, - head: `HEAD`, - HEAD: `HEAD`, - options: `OPTIONS`, - OPTIONS: `OPTIONS`, - post: `POST`, - POST: `POST`, - put: `PUT`, - PUT: `PUT` - }, Ce = { - ...Se, - patch: `patch`, - PATCH: `PATCH` - }; - Object.setPrototypeOf(Se, null), Object.setPrototypeOf(Ce, null), t.exports = { - kEnumerableProperty: xe, - isDisturbed: se, - isBlobLike: w, - parseOrigin: A, - parseURL: k, - getServerName: M, - isStream: C, - isIterable: F, - hasSafeIterator: B, - isAsyncIterable: P, - isDestroyed: H, - headerNameToString: ne, - bufferToLowerCasedHeaderName: G, - addListener: ge, - removeAllListeners: Z, - errorRequest: _e, - parseRawHeaders: re, - encodeRawHeaders: ie, - parseHeaders: K, - parseKeepAliveTimeout: W, - destroy: te, - bodyLength: V, - deepClone: N, - ReadableStreamFrom: le, - isBuffer: ae, - assertRequestHandler: oe, - getSocketInfo: ce, - isFormDataLike: q, - pathHasQueryOrFragment: T, - serializePathWithQuery: E, - addAbortListener: J, - isValidHTTPToken: fe, - isValidHeaderValue: X, - isTokenCharCode: de, - parseRangeHeader: he, - normalizedMethodRecordsBase: Se, - normalizedMethodRecords: Ce, - isValidPort: D, - isHttpOrHttpsPrefixed: O, - nodeMajor: v, - nodeMinor: y, - safeHTTPMethods: Object.freeze([ - `GET`, - `HEAD`, - `OPTIONS`, - `TRACE` - ]), - wrapRequestBody: S, - setupConnectTimeout: ve, - getProtocolFromUrlString: be - }; -})); -var V$1 = c$3(((e, t) => { - let { kConnected: n, kPending: r, kRunning: i, kSize: a, kFree: o, kQueued: s } = I$1(); - t.exports = { - ClientStats: class { - constructor(e) { - this.connected = e[n], this.pending = e[r], this.running = e[i], this.size = e[a]; - } - }, - PoolStats: class { - constructor(e) { - this.connected = e[n], this.free = e[o], this.pending = e[r], this.queued = e[s], this.running = e[i], this.size = e[a]; - } - } - }; -})); -var H$1 = c$3(((e, t) => { - let r = p$4(`node:diagnostics_channel`), i = p$4(`node:util`), a = i.debuglog(`undici`), o = i.debuglog(`fetch`), s = i.debuglog(`websocket`), c = { - beforeConnect: r.channel(`undici:client:beforeConnect`), - connected: r.channel(`undici:client:connected`), - connectError: r.channel(`undici:client:connectError`), - sendHeaders: r.channel(`undici:client:sendHeaders`), - create: r.channel(`undici:request:create`), - bodySent: r.channel(`undici:request:bodySent`), - bodyChunkSent: r.channel(`undici:request:bodyChunkSent`), - bodyChunkReceived: r.channel(`undici:request:bodyChunkReceived`), - headers: r.channel(`undici:request:headers`), - trailers: r.channel(`undici:request:trailers`), - error: r.channel(`undici:request:error`), - open: r.channel(`undici:websocket:open`), - close: r.channel(`undici:websocket:close`), - socketError: r.channel(`undici:websocket:socket_error`), - ping: r.channel(`undici:websocket:ping`), - pong: r.channel(`undici:websocket:pong`), - proxyConnected: r.channel(`undici:proxy:connected`) - }, l = !1; - function u(e = a) { - if (!l) { - if (c.beforeConnect.hasSubscribers || c.connected.hasSubscribers || c.connectError.hasSubscribers || c.sendHeaders.hasSubscribers) { - l = !0; - return; - } - l = !0, r.subscribe(`undici:client:beforeConnect`, (t) => { - let { connectParams: { version: n, protocol: r, port: i, host: a } } = t; - e(`connecting to %s%s using %s%s`, a, i ? `:${i}` : ``, r, n); - }), r.subscribe(`undici:client:connected`, (t) => { - let { connectParams: { version: n, protocol: r, port: i, host: a } } = t; - e(`connected to %s%s using %s%s`, a, i ? `:${i}` : ``, r, n); - }), r.subscribe(`undici:client:connectError`, (t) => { - let { connectParams: { version: n, protocol: r, port: i, host: a }, error: o } = t; - e(`connection to %s%s using %s%s errored - %s`, a, i ? `:${i}` : ``, r, n, o.message); - }), r.subscribe(`undici:client:sendHeaders`, (t) => { - let { request: { method: n, path: r, origin: i } } = t; - e(`sending request to %s %s%s`, n, i, r); - }); - } - } - let d = !1; - function f(e = a) { - if (!d) { - if (c.headers.hasSubscribers || c.trailers.hasSubscribers || c.error.hasSubscribers) { - d = !0; - return; - } - d = !0, r.subscribe(`undici:request:headers`, (t) => { - let { request: { method: n, path: r, origin: i }, response: { statusCode: a } } = t; - e(`received response to %s %s%s - HTTP %d`, n, i, r, a); - }), r.subscribe(`undici:request:trailers`, (t) => { - let { request: { method: n, path: r, origin: i } } = t; - e(`trailers received from %s %s%s`, n, i, r); - }), r.subscribe(`undici:request:error`, (t) => { - let { request: { method: n, path: r, origin: i }, error: a } = t; - e(`request to %s %s%s errored - %s`, n, i, r, a.message); - }); - } - } - let p = !1; - function m(e = s) { - if (!p) { - if (c.open.hasSubscribers || c.close.hasSubscribers || c.socketError.hasSubscribers || c.ping.hasSubscribers || c.pong.hasSubscribers) { - p = !0; - return; - } - p = !0, r.subscribe(`undici:websocket:open`, (t) => { - if (t.address != null) { - let { address: n, port: r } = t.address; - e(`connection opened %s%s`, n, r ? `:${r}` : ``); - } else e(`connection opened`); - }), r.subscribe(`undici:websocket:close`, (t) => { - let { websocket: n, code: r, reason: i } = t; - e(`closed connection to %s - %s %s`, n.url, r, i); - }), r.subscribe(`undici:websocket:socket_error`, (t) => { - e(`connection errored - %s`, t.message); - }), r.subscribe(`undici:websocket:ping`, (t) => { - e(`ping received`); - }), r.subscribe(`undici:websocket:pong`, (t) => { - e(`pong received`); - }); - } - } - (a.enabled || o.enabled) && (u(o.enabled ? o : a), f(o.enabled ? o : a)), s.enabled && (u(a.enabled ? a : s), m(s)), t.exports = { channels: c }; -})); -var te$1 = c$3(((e, t) => { - let { InvalidArgumentError: r, NotSupportedError: i } = R$1(), a = p$4(`node:assert`), { isValidHTTPToken: o, isValidHeaderValue: s, isStream: c, destroy: l, isBuffer: u, isFormDataLike: d, isIterable: f, hasSafeIterator: p, isBlobLike: m, serializePathWithQuery: h, assertRequestHandler: g, getServerName: _, normalizedMethodRecords: v, getProtocolFromUrlString: y } = B$1(), { channels: b } = H$1(), { headerNameLowerCasedRecord: x } = ee$2(), S = /[^\u0021-\u00ff]/; - function C(e) { - if (typeof e != `string` || e.length === 0) return !1; - for (let t = 0; t < e.length; t++) { - let n = e.charCodeAt(t); - if (n < 48 || n > 57) return !1; - } - return !0; - } - let w = Symbol(`handler`); - var T = class { - constructor(e, { path: t, method: n, body: i, headers: a, query: x, idempotent: C, blocking: T, upgrade: D, headersTimeout: O, bodyTimeout: k, reset: A, expectContinue: j, servername: M, throwOnError: N, maxRedirections: P, typeOfService: F }, I) { - if (typeof t != `string`) throw new r(`path must be a string`); - if (t[0] !== `/` && !(t.startsWith(`http://`) || t.startsWith(`https://`)) && n !== `CONNECT`) throw new r(`path must be an absolute URL or start with a slash`); - if (S.test(t)) throw new r(`invalid request path`); - if (typeof n != `string`) throw new r(`method must be a string`); - if (v[n] === void 0 && !o(n)) throw new r(`invalid request method`); - if (D && typeof D != `string`) throw new r(`upgrade must be a string`); - if (D && !s(D)) throw new r(`invalid upgrade header`); - if (O != null && (!Number.isFinite(O) || O < 0)) throw new r(`invalid headersTimeout`); - if (k != null && (!Number.isFinite(k) || k < 0)) throw new r(`invalid bodyTimeout`); - if (A != null && typeof A != `boolean`) throw new r(`invalid reset`); - if (j != null && typeof j != `boolean`) throw new r(`invalid expectContinue`); - if (N != null) throw new r(`invalid throwOnError`); - if (P != null && P !== 0) throw new r(`maxRedirections is not supported, use the redirect interceptor`); - if (F != null && (!Number.isInteger(F) || F < 0 || F > 255)) throw new r(`typeOfService must be an integer between 0 and 255`); - if (this.headersTimeout = O, this.bodyTimeout = k, this.method = n, this.typeOfService = F ?? 0, this.abort = null, i == null) this.body = null; - else if (c(i)) { - this.body = i; - let e = this.body._readableState; - (!e || !e.autoDestroy) && (this.endHandler = function() { - l(this); - }, this.body.on(`end`, this.endHandler)), this.errorHandler = (e) => { - this.abort ? this.abort(e) : this.error = e; - }, this.body.on(`error`, this.errorHandler); - } else if (u(i)) this.body = i.byteLength ? i : null; - else if (ArrayBuffer.isView(i)) this.body = i.buffer.byteLength ? Buffer.from(i.buffer, i.byteOffset, i.byteLength) : null; - else if (i instanceof ArrayBuffer) this.body = i.byteLength ? Buffer.from(i) : null; - else if (typeof i == `string`) this.body = i.length ? Buffer.from(i) : null; - else if (d(i) || f(i) || m(i)) this.body = i; - else throw new r(`body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable`); - if (this.completed = !1, this.aborted = !1, this.upgrade = D || null, this.path = x ? h(t, x) : t, this.origin = e, this.protocol = y(e), this.idempotent = C ?? (n === `HEAD` || n === `GET`), this.blocking = T ?? this.method !== `HEAD`, this.reset = A ?? null, this.host = null, this.contentLength = null, this.contentType = null, this.headers = [], this.expectContinue = j ?? !1, Array.isArray(a)) { - if (a.length % 2 != 0) throw new r(`headers array must be even`); - for (let e = 0; e < a.length; e += 2) E(this, a[e], a[e + 1]); - } else if (a && typeof a == `object`) if (p(a)) for (let e of a) { - if (!Array.isArray(e) || e.length !== 2) throw new r(`headers must be in key-value pair format`); - E(this, e[0], e[1]); - } - else { - let e = Object.keys(a); - for (let t = 0; t < e.length; ++t) E(this, e[t], a[e[t]]); - } - else if (a != null) throw new r(`headers must be an object or an array`); - g(I, n, D), this.servername = M || _(this.host) || null, this[w] = I, b.create.hasSubscribers && b.create.publish({ request: this }); - } - onBodySent(e) { - if (b.bodyChunkSent.hasSubscribers && b.bodyChunkSent.publish({ - request: this, - chunk: e - }), this[w].onBodySent) try { - return this[w].onBodySent(e); - } catch (e) { - this.abort(e); - } - } - onRequestSent() { - if (b.bodySent.hasSubscribers && b.bodySent.publish({ request: this }), this[w].onRequestSent) try { - return this[w].onRequestSent(); - } catch (e) { - this.abort(e); - } - } - onConnect(e) { - if (a(!this.aborted), a(!this.completed), this.error) e(this.error); - else return this.abort = e, this[w].onConnect(e); - } - onResponseStarted() { - return this[w].onResponseStarted?.(); - } - onHeaders(e, t, n, r) { - a(!this.aborted), a(!this.completed), b.headers.hasSubscribers && b.headers.publish({ - request: this, - response: { - statusCode: e, - headers: t, - statusText: r - } - }); - try { - return this[w].onHeaders(e, t, n, r); - } catch (e) { - this.abort(e); - } - } - onData(e) { - a(!this.aborted), a(!this.completed), b.bodyChunkReceived.hasSubscribers && b.bodyChunkReceived.publish({ - request: this, - chunk: e - }); - try { - return this[w].onData(e); - } catch (e) { - return this.abort(e), !1; - } - } - onUpgrade(e, t, n) { - return a(!this.aborted), a(!this.completed), this[w].onUpgrade(e, t, n); - } - onComplete(e) { - this.onFinally(), a(!this.aborted), a(!this.completed), this.completed = !0, b.trailers.hasSubscribers && b.trailers.publish({ - request: this, - trailers: e - }); - try { - return this[w].onComplete(e); - } catch (e) { - this.onError(e); - } - } - onError(e) { - if (this.onFinally(), b.error.hasSubscribers && b.error.publish({ - request: this, - error: e - }), !this.aborted) return this.aborted = !0, this[w].onError(e); - } - onFinally() { - this.errorHandler &&= (this.body.off(`error`, this.errorHandler), null), this.endHandler &&= (this.body.off(`end`, this.endHandler), null); - } - addHeader(e, t) { - return E(this, e, t), this; - } - }; - function E(e, t, n) { - if (n && typeof n == `object` && !Array.isArray(n)) throw new r(`invalid ${t} header`); - if (n === void 0) return; - let a = x[t]; - if (a === void 0 && (a = t.toLowerCase(), x[a] === void 0 && !o(a))) throw new r(`invalid header key`); - if (Array.isArray(n)) { - let e = []; - for (let i = 0; i < n.length; i++) if (typeof n[i] == `string`) { - if (!s(n[i])) throw new r(`invalid ${t} header`); - e.push(n[i]); - } else if (n[i] === null) e.push(``); - else if (typeof n[i] == `object`) throw new r(`invalid ${t} header`); - else e.push(`${n[i]}`); - n = e; - } else if (typeof n == `string`) { - if (!s(n)) throw new r(`invalid ${t} header`); - } else n = n === null ? `` : `${n}`; - if (a === `host`) { - if (e.host !== null) throw new r(`duplicate host header`); - if (typeof n != `string`) throw new r(`invalid host header`); - e.host = n; - } else if (a === `content-length`) { - if (e.contentLength !== null) throw new r(`duplicate content-length header`); - if (!C(n)) throw new r(`invalid content-length header`); - e.contentLength = parseInt(n, 10); - } else if (e.contentType === null && a === `content-type`) e.contentType = n, e.headers.push(t, n); - else if (a === `transfer-encoding` || a === `keep-alive` || a === `upgrade`) throw new r(`invalid ${a} header`); - else if (a === `connection`) { - let t = typeof n == `string` ? n : null; - if (t === null) throw new r(`invalid connection header`); - for (let n of t.toLowerCase().split(`,`)) { - let t = n.trim(); - if (!o(t)) throw new r(`invalid connection header`); - t === `close` && (e.reset = !0); - } - } else if (a === `expect`) throw new i(`expect header not supported`); - else e.headers.push(t, n); - } - t.exports = T; -})); -var U$1 = c$3(((e, t) => { - let { InvalidArgumentError: n } = R$1(); - t.exports = class e { - #e; - constructor(e) { - this.#e = e; - } - static wrap(t) { - return t.onRequestStart ? t : new e(t); - } - onConnect(e, t) { - return this.#e.onConnect?.(e, t); - } - onResponseStarted() { - return this.#e.onResponseStarted?.(); - } - onHeaders(e, t, n, r) { - return this.#e.onHeaders?.(e, t, n, r); - } - onUpgrade(e, t, n) { - return this.#e.onUpgrade?.(e, t, n); - } - onData(e) { - return this.#e.onData?.(e); - } - onComplete(e) { - return this.#e.onComplete?.(e); - } - onError(e) { - if (!this.#e.onError) throw e; - return this.#e.onError?.(e); - } - onRequestStart(e, t) { - this.#e.onConnect?.((t) => e.abort(t), t); - } - onRequestUpgrade(e, t, n, i) { - let a = []; - for (let [e, t] of Object.entries(n)) a.push(Buffer.from(e, `latin1`), r(t)); - this.#e.onUpgrade?.(t, a, i); - } - onResponseStart(e, t, n, i) { - let a = []; - for (let [e, t] of Object.entries(n)) a.push(Buffer.from(e, `latin1`), r(t)); - this.#e.onHeaders?.(t, a, () => e.resume(), i) === !1 && e.pause(); - } - onResponseData(e, t) { - this.#e.onData?.(t) === !1 && e.pause(); - } - onResponseEnd(e, t) { - let n = []; - for (let [e, i] of Object.entries(t)) n.push(Buffer.from(e, `latin1`), r(i)); - this.#e.onComplete?.(n); - } - onResponseError(e, t) { - if (!this.#e.onError) throw new n(`invalid onError method`); - this.#e.onError?.(t); - } - }; - function r(e) { - return Array.isArray(e) ? e.map((e) => Buffer.from(e, `latin1`)) : Buffer.from(e, `latin1`); - } -})); -var W$1 = c$3(((e, t) => { - let r = p$4(`node:events`), i = U$1(), a = (e) => (t, n) => e(t, i.wrap(n)); - t.exports = class extends r { - dispatch() { - throw Error(`not implemented`); - } - close() { - throw Error(`not implemented`); - } - destroy() { - throw Error(`not implemented`); - } - compose(...e) { - let t = Array.isArray(e[0]) ? e[0] : e, n = this.dispatch.bind(this); - for (let e of t) if (e != null) { - if (typeof e != `function`) throw TypeError(`invalid interceptor, expected function received ${typeof e}`); - if (n = e(n), n = a(n), n == null || typeof n != `function` || n.length !== 2) throw TypeError(`invalid interceptor`); - } - return new Proxy(this, { get: (e, t) => t === `dispatch` ? n : e[t] }); - } - }; -})); -var ne$1 = c$3(((e, t) => { - let { parseHeaders: n } = B$1(), { InvalidArgumentError: r } = R$1(), i = Symbol(`resume`); - var a = class { - #e = !1; - #t = null; - #n = !1; - #r; - [i] = null; - rawHeaders = null; - rawTrailers = null; - constructor(e) { - this.#r = e; - } - pause() { - this.#e = !0; - } - resume() { - this.#e && (this.#e = !1, this[i]?.()); - } - abort(e) { - this.#n || (this.#n = !0, this.#t = e, this.#r(e)); - } - get aborted() { - return this.#n; - } - get reason() { - return this.#t; - } - get paused() { - return this.#e; - } - }; - t.exports = class e { - #e; - #t; - constructor(e) { - this.#e = e; - } - static unwrap(t) { - return t.onRequestStart ? new e(t) : t; - } - onConnect(e, t) { - this.#t = new a(e), this.#e.onRequestStart?.(this.#t, t); - } - onResponseStarted() { - return this.#e.onResponseStarted?.(); - } - onUpgrade(e, t, r) { - this.#t.rawHeaders = t, this.#e.onRequestUpgrade?.(this.#t, e, n(t), r); - } - onHeaders(e, t, r, a) { - return this.#t[i] = r, this.#t.rawHeaders = t, this.#e.onResponseStart?.(this.#t, e, n(t), a), !this.#t.paused; - } - onData(e) { - return this.#e.onResponseData?.(this.#t, e), !this.#t.paused; - } - onComplete(e) { - this.#t.rawTrailers = e, this.#e.onResponseEnd?.(this.#t, n(e)); - } - onError(e) { - if (!this.#e.onResponseError) throw new r(`invalid onError method`); - this.#e.onResponseError?.(this.#t, e); - } - }; -})); -var G$2 = c$3(((e, t) => { - let n = W$1(), r = ne$1(), { ClientDestroyedError: i, ClientClosedError: a, InvalidArgumentError: o } = R$1(), { kDestroy: s, kClose: c, kClosed: l, kDestroyed: u, kDispatch: d } = I$1(), f = Symbol(`onDestroyed`), p = Symbol(`onClosed`); - t.exports = class extends n { - [u] = !1; - [f] = null; - [l] = !1; - [p] = null; - get destroyed() { - return this[u]; - } - get closed() { - return this[l]; - } - close(e) { - if (e === void 0) return new Promise((e, t) => { - this.close((n, r) => n ? t(n) : e(r)); - }); - if (typeof e != `function`) throw new o(`invalid callback`); - if (this[u]) { - let t = new i(); - queueMicrotask(() => e(t, null)); - return; - } - if (this[l]) { - this[p] ? this[p].push(e) : queueMicrotask(() => e(null, null)); - return; - } - this[l] = !0, this[p] ??= [], this[p].push(e); - let t = () => { - let e = this[p]; - this[p] = null; - for (let t = 0; t < e.length; t++) e[t](null, null); - }; - this[c]().then(() => this.destroy()).then(() => queueMicrotask(t)); - } - destroy(e, t) { - if (typeof e == `function` && (t = e, e = null), t === void 0) return new Promise((t, n) => { - this.destroy(e, (e, r) => e ? n(e) : t(r)); - }); - if (typeof t != `function`) throw new o(`invalid callback`); - if (this[u]) { - this[f] ? this[f].push(t) : queueMicrotask(() => t(null, null)); - return; - } - e ||= new i(), this[u] = !0, this[f] ??= [], this[f].push(t); - let n = () => { - let e = this[f]; - this[f] = null; - for (let t = 0; t < e.length; t++) e[t](null, null); - }; - this[s](e).then(() => queueMicrotask(n)); - } - dispatch(e, t) { - if (!t || typeof t != `object`) throw new o(`handler must be an object`); - t = r.unwrap(t); - try { - if (!e || typeof e != `object`) throw new o(`opts must be an object.`); - if (this[u] || this[f]) throw new i(); - if (this[l]) throw new a(); - return this[d](e, t); - } catch (e) { - if (typeof t.onError != `function`) throw e; - return t.onError(e), !1; - } - } - }; -})); -var K$1 = c$3(((e, t) => { - let r = p$4(`node:net`), i = p$4(`node:assert`), a = B$1(), { InvalidArgumentError: o } = R$1(), s, c = class { - constructor(e) { - this._maxCachedSessions = e, this._sessionCache = /* @__PURE__ */ new Map(), this._sessionRegistry = new FinalizationRegistry((e) => { - if (this._sessionCache.size < this._maxCachedSessions) return; - let t = this._sessionCache.get(e); - t !== void 0 && t.deref() === void 0 && this._sessionCache.delete(e); - }); - } - get(e) { - let t = this._sessionCache.get(e); - return t ? t.deref() : null; - } - set(e, t) { - if (this._maxCachedSessions !== 0) { - if (this._sessionCache.has(e)) this._sessionCache.delete(e); - else if (this._sessionCache.size >= this._maxCachedSessions) { - for (let [e, t] of this._sessionCache) if (t.deref() === void 0) { - this._sessionCache.delete(e); - return; - } - let e = this._sessionCache.keys().next(); - e.done || this._sessionCache.delete(e.value); - } - this._sessionCache.set(e, new WeakRef(t)), this._sessionRegistry.register(t, e); - } - } - }; - function l({ allowH2: e, useH2c: t, maxCachedSessions: l, socketPath: u, timeout: d, session: f, ...p }) { - if (l != null && (!Number.isInteger(l) || l < 0)) throw new o(`maxCachedSessions must be a positive integer or zero`); - let m = { - path: u, - ...p - }, h = new c(l ?? 100); - return d ??= 1e4, e ??= !1, function({ hostname: o, host: c, protocol: l, port: u, servername: p, localAddress: g, httpSocket: _ }, v) { - let y; - if (l === `https:`) { - s ||= p$4(`node:tls`), p = p || m.servername || a.getServerName(c) || null; - let t = p || o; - i(t); - let r = f || h.get(t) || null; - u ||= 443, y = s.connect({ - highWaterMark: 16384, - ...m, - servername: p, - session: r, - localAddress: g, - ALPNProtocols: e ? [`http/1.1`, `h2`] : [`http/1.1`], - socket: _, - port: u, - host: o - }), y.on(`session`, function(e) { - h.set(t, e); - }); - } else i(!_, `httpSocket can only be sent on TLS update`), u ||= 80, y = r.connect({ - highWaterMark: 64 * 1024, - ...m, - localAddress: g, - port: u, - host: o - }), t === !0 && (y.alpnProtocol = `h2`); - if (m.keepAlive == null || m.keepAlive) { - let e = m.keepAliveInitialDelay === void 0 ? 6e4 : m.keepAliveInitialDelay; - y.setKeepAlive(!0, e); - } - let b = a.setupConnectTimeout(new WeakRef(y), { - timeout: d, - hostname: o, - port: u - }); - return y.setNoDelay(!0).once(l === `https:` ? `secureConnect` : `connect`, function() { - if (queueMicrotask(b), v) { - let e = v; - v = null, e(null, this); - } - }).on(`error`, function(e) { - if (queueMicrotask(b), v) { - let t = v; - v = null, t(e); - } - }), y; - }; - } - t.exports = l; -})); -var re$1 = c$3(((e) => { - Object.defineProperty(e, "__esModule", { value: !0 }), e.enumToMap = t; - function t(e, t = [], n = []) { - let r = (t?.length ?? 0) === 0, i = (n?.length ?? 0) === 0; - return Object.fromEntries(Object.entries(e).filter(([, e]) => typeof e == `number` && (r || t.includes(e)) && (i || !n.includes(e)))); - } -})); -var ie$1 = c$3(((e) => { - Object.defineProperty(e, "__esModule", { value: !0 }), e.SPECIAL_HEADERS = e.MINOR = e.MAJOR = e.HTAB_SP_VCHAR_OBS_TEXT = e.QUOTED_STRING = e.CONNECTION_TOKEN_CHARS = e.HEADER_CHARS = e.TOKEN = e.HEX = e.URL_CHAR = e.USERINFO_CHARS = e.MARK = e.ALPHANUM = e.NUM = e.HEX_MAP = e.NUM_MAP = e.ALPHA = e.STATUSES_HTTP = e.H_METHOD_MAP = e.METHOD_MAP = e.METHODS_RTSP = e.METHODS_ICE = e.METHODS_HTTP = e.HEADER_STATE = e.FINISH = e.STATUSES = e.METHODS = e.LENIENT_FLAGS = e.FLAGS = e.TYPE = e.ERROR = void 0; - let t = re$1(); - e.ERROR = { - OK: 0, - INTERNAL: 1, - STRICT: 2, - CR_EXPECTED: 25, - LF_EXPECTED: 3, - UNEXPECTED_CONTENT_LENGTH: 4, - UNEXPECTED_SPACE: 30, - CLOSED_CONNECTION: 5, - INVALID_METHOD: 6, - INVALID_URL: 7, - INVALID_CONSTANT: 8, - INVALID_VERSION: 9, - INVALID_HEADER_TOKEN: 10, - INVALID_CONTENT_LENGTH: 11, - INVALID_CHUNK_SIZE: 12, - INVALID_STATUS: 13, - INVALID_EOF_STATE: 14, - INVALID_TRANSFER_ENCODING: 15, - CB_MESSAGE_BEGIN: 16, - CB_HEADERS_COMPLETE: 17, - CB_MESSAGE_COMPLETE: 18, - CB_CHUNK_HEADER: 19, - CB_CHUNK_COMPLETE: 20, - PAUSED: 21, - PAUSED_UPGRADE: 22, - PAUSED_H2_UPGRADE: 23, - USER: 24, - CB_URL_COMPLETE: 26, - CB_STATUS_COMPLETE: 27, - CB_METHOD_COMPLETE: 32, - CB_VERSION_COMPLETE: 33, - CB_HEADER_FIELD_COMPLETE: 28, - CB_HEADER_VALUE_COMPLETE: 29, - CB_CHUNK_EXTENSION_NAME_COMPLETE: 34, - CB_CHUNK_EXTENSION_VALUE_COMPLETE: 35, - CB_RESET: 31, - CB_PROTOCOL_COMPLETE: 38 - }, e.TYPE = { - BOTH: 0, - REQUEST: 1, - RESPONSE: 2 - }, e.FLAGS = { - CONNECTION_KEEP_ALIVE: 1, - CONNECTION_CLOSE: 2, - CONNECTION_UPGRADE: 4, - CHUNKED: 8, - UPGRADE: 16, - CONTENT_LENGTH: 32, - SKIPBODY: 64, - TRAILING: 128, - TRANSFER_ENCODING: 512 - }, e.LENIENT_FLAGS = { - HEADERS: 1, - CHUNKED_LENGTH: 2, - KEEP_ALIVE: 4, - TRANSFER_ENCODING: 8, - VERSION: 16, - DATA_AFTER_CLOSE: 32, - OPTIONAL_LF_AFTER_CR: 64, - OPTIONAL_CRLF_AFTER_CHUNK: 128, - OPTIONAL_CR_BEFORE_LF: 256, - SPACES_AFTER_CHUNK_SIZE: 512 - }, e.METHODS = { - DELETE: 0, - GET: 1, - HEAD: 2, - POST: 3, - PUT: 4, - CONNECT: 5, - OPTIONS: 6, - TRACE: 7, - COPY: 8, - LOCK: 9, - MKCOL: 10, - MOVE: 11, - PROPFIND: 12, - PROPPATCH: 13, - SEARCH: 14, - UNLOCK: 15, - BIND: 16, - REBIND: 17, - UNBIND: 18, - ACL: 19, - REPORT: 20, - MKACTIVITY: 21, - CHECKOUT: 22, - MERGE: 23, - "M-SEARCH": 24, - NOTIFY: 25, - SUBSCRIBE: 26, - UNSUBSCRIBE: 27, - PATCH: 28, - PURGE: 29, - MKCALENDAR: 30, - LINK: 31, - UNLINK: 32, - SOURCE: 33, - PRI: 34, - DESCRIBE: 35, - ANNOUNCE: 36, - SETUP: 37, - PLAY: 38, - PAUSE: 39, - TEARDOWN: 40, - GET_PARAMETER: 41, - SET_PARAMETER: 42, - REDIRECT: 43, - RECORD: 44, - FLUSH: 45, - QUERY: 46 - }, e.STATUSES = { - CONTINUE: 100, - SWITCHING_PROTOCOLS: 101, - PROCESSING: 102, - EARLY_HINTS: 103, - RESPONSE_IS_STALE: 110, - REVALIDATION_FAILED: 111, - DISCONNECTED_OPERATION: 112, - HEURISTIC_EXPIRATION: 113, - MISCELLANEOUS_WARNING: 199, - OK: 200, - CREATED: 201, - ACCEPTED: 202, - NON_AUTHORITATIVE_INFORMATION: 203, - NO_CONTENT: 204, - RESET_CONTENT: 205, - PARTIAL_CONTENT: 206, - MULTI_STATUS: 207, - ALREADY_REPORTED: 208, - TRANSFORMATION_APPLIED: 214, - IM_USED: 226, - MISCELLANEOUS_PERSISTENT_WARNING: 299, - MULTIPLE_CHOICES: 300, - MOVED_PERMANENTLY: 301, - FOUND: 302, - SEE_OTHER: 303, - NOT_MODIFIED: 304, - USE_PROXY: 305, - SWITCH_PROXY: 306, - TEMPORARY_REDIRECT: 307, - PERMANENT_REDIRECT: 308, - BAD_REQUEST: 400, - UNAUTHORIZED: 401, - PAYMENT_REQUIRED: 402, - FORBIDDEN: 403, - NOT_FOUND: 404, - METHOD_NOT_ALLOWED: 405, - NOT_ACCEPTABLE: 406, - PROXY_AUTHENTICATION_REQUIRED: 407, - REQUEST_TIMEOUT: 408, - CONFLICT: 409, - GONE: 410, - LENGTH_REQUIRED: 411, - PRECONDITION_FAILED: 412, - PAYLOAD_TOO_LARGE: 413, - URI_TOO_LONG: 414, - UNSUPPORTED_MEDIA_TYPE: 415, - RANGE_NOT_SATISFIABLE: 416, - EXPECTATION_FAILED: 417, - IM_A_TEAPOT: 418, - PAGE_EXPIRED: 419, - ENHANCE_YOUR_CALM: 420, - MISDIRECTED_REQUEST: 421, - UNPROCESSABLE_ENTITY: 422, - LOCKED: 423, - FAILED_DEPENDENCY: 424, - TOO_EARLY: 425, - UPGRADE_REQUIRED: 426, - PRECONDITION_REQUIRED: 428, - TOO_MANY_REQUESTS: 429, - REQUEST_HEADER_FIELDS_TOO_LARGE_UNOFFICIAL: 430, - REQUEST_HEADER_FIELDS_TOO_LARGE: 431, - LOGIN_TIMEOUT: 440, - NO_RESPONSE: 444, - RETRY_WITH: 449, - BLOCKED_BY_PARENTAL_CONTROL: 450, - UNAVAILABLE_FOR_LEGAL_REASONS: 451, - CLIENT_CLOSED_LOAD_BALANCED_REQUEST: 460, - INVALID_X_FORWARDED_FOR: 463, - REQUEST_HEADER_TOO_LARGE: 494, - SSL_CERTIFICATE_ERROR: 495, - SSL_CERTIFICATE_REQUIRED: 496, - HTTP_REQUEST_SENT_TO_HTTPS_PORT: 497, - INVALID_TOKEN: 498, - CLIENT_CLOSED_REQUEST: 499, - INTERNAL_SERVER_ERROR: 500, - NOT_IMPLEMENTED: 501, - BAD_GATEWAY: 502, - SERVICE_UNAVAILABLE: 503, - GATEWAY_TIMEOUT: 504, - HTTP_VERSION_NOT_SUPPORTED: 505, - VARIANT_ALSO_NEGOTIATES: 506, - INSUFFICIENT_STORAGE: 507, - LOOP_DETECTED: 508, - BANDWIDTH_LIMIT_EXCEEDED: 509, - NOT_EXTENDED: 510, - NETWORK_AUTHENTICATION_REQUIRED: 511, - WEB_SERVER_UNKNOWN_ERROR: 520, - WEB_SERVER_IS_DOWN: 521, - CONNECTION_TIMEOUT: 522, - ORIGIN_IS_UNREACHABLE: 523, - TIMEOUT_OCCURED: 524, - SSL_HANDSHAKE_FAILED: 525, - INVALID_SSL_CERTIFICATE: 526, - RAILGUN_ERROR: 527, - SITE_IS_OVERLOADED: 529, - SITE_IS_FROZEN: 530, - IDENTITY_PROVIDER_AUTHENTICATION_ERROR: 561, - NETWORK_READ_TIMEOUT: 598, - NETWORK_CONNECT_TIMEOUT: 599 - }, e.FINISH = { - SAFE: 0, - SAFE_WITH_CB: 1, - UNSAFE: 2 - }, e.HEADER_STATE = { - GENERAL: 0, - CONNECTION: 1, - CONTENT_LENGTH: 2, - TRANSFER_ENCODING: 3, - UPGRADE: 4, - CONNECTION_KEEP_ALIVE: 5, - CONNECTION_CLOSE: 6, - CONNECTION_UPGRADE: 7, - TRANSFER_ENCODING_CHUNKED: 8 - }, e.METHODS_HTTP = [ - e.METHODS.DELETE, - e.METHODS.GET, - e.METHODS.HEAD, - e.METHODS.POST, - e.METHODS.PUT, - e.METHODS.CONNECT, - e.METHODS.OPTIONS, - e.METHODS.TRACE, - e.METHODS.COPY, - e.METHODS.LOCK, - e.METHODS.MKCOL, - e.METHODS.MOVE, - e.METHODS.PROPFIND, - e.METHODS.PROPPATCH, - e.METHODS.SEARCH, - e.METHODS.UNLOCK, - e.METHODS.BIND, - e.METHODS.REBIND, - e.METHODS.UNBIND, - e.METHODS.ACL, - e.METHODS.REPORT, - e.METHODS.MKACTIVITY, - e.METHODS.CHECKOUT, - e.METHODS.MERGE, - e.METHODS[`M-SEARCH`], - e.METHODS.NOTIFY, - e.METHODS.SUBSCRIBE, - e.METHODS.UNSUBSCRIBE, - e.METHODS.PATCH, - e.METHODS.PURGE, - e.METHODS.MKCALENDAR, - e.METHODS.LINK, - e.METHODS.UNLINK, - e.METHODS.PRI, - e.METHODS.SOURCE, - e.METHODS.QUERY - ], e.METHODS_ICE = [e.METHODS.SOURCE], e.METHODS_RTSP = [ - e.METHODS.OPTIONS, - e.METHODS.DESCRIBE, - e.METHODS.ANNOUNCE, - e.METHODS.SETUP, - e.METHODS.PLAY, - e.METHODS.PAUSE, - e.METHODS.TEARDOWN, - e.METHODS.GET_PARAMETER, - e.METHODS.SET_PARAMETER, - e.METHODS.REDIRECT, - e.METHODS.RECORD, - e.METHODS.FLUSH, - e.METHODS.GET, - e.METHODS.POST - ], e.METHOD_MAP = (0, t.enumToMap)(e.METHODS), e.H_METHOD_MAP = Object.fromEntries(Object.entries(e.METHODS).filter(([e]) => e.startsWith(`H`))), e.STATUSES_HTTP = [ - e.STATUSES.CONTINUE, - e.STATUSES.SWITCHING_PROTOCOLS, - e.STATUSES.PROCESSING, - e.STATUSES.EARLY_HINTS, - e.STATUSES.RESPONSE_IS_STALE, - e.STATUSES.REVALIDATION_FAILED, - e.STATUSES.DISCONNECTED_OPERATION, - e.STATUSES.HEURISTIC_EXPIRATION, - e.STATUSES.MISCELLANEOUS_WARNING, - e.STATUSES.OK, - e.STATUSES.CREATED, - e.STATUSES.ACCEPTED, - e.STATUSES.NON_AUTHORITATIVE_INFORMATION, - e.STATUSES.NO_CONTENT, - e.STATUSES.RESET_CONTENT, - e.STATUSES.PARTIAL_CONTENT, - e.STATUSES.MULTI_STATUS, - e.STATUSES.ALREADY_REPORTED, - e.STATUSES.TRANSFORMATION_APPLIED, - e.STATUSES.IM_USED, - e.STATUSES.MISCELLANEOUS_PERSISTENT_WARNING, - e.STATUSES.MULTIPLE_CHOICES, - e.STATUSES.MOVED_PERMANENTLY, - e.STATUSES.FOUND, - e.STATUSES.SEE_OTHER, - e.STATUSES.NOT_MODIFIED, - e.STATUSES.USE_PROXY, - e.STATUSES.SWITCH_PROXY, - e.STATUSES.TEMPORARY_REDIRECT, - e.STATUSES.PERMANENT_REDIRECT, - e.STATUSES.BAD_REQUEST, - e.STATUSES.UNAUTHORIZED, - e.STATUSES.PAYMENT_REQUIRED, - e.STATUSES.FORBIDDEN, - e.STATUSES.NOT_FOUND, - e.STATUSES.METHOD_NOT_ALLOWED, - e.STATUSES.NOT_ACCEPTABLE, - e.STATUSES.PROXY_AUTHENTICATION_REQUIRED, - e.STATUSES.REQUEST_TIMEOUT, - e.STATUSES.CONFLICT, - e.STATUSES.GONE, - e.STATUSES.LENGTH_REQUIRED, - e.STATUSES.PRECONDITION_FAILED, - e.STATUSES.PAYLOAD_TOO_LARGE, - e.STATUSES.URI_TOO_LONG, - e.STATUSES.UNSUPPORTED_MEDIA_TYPE, - e.STATUSES.RANGE_NOT_SATISFIABLE, - e.STATUSES.EXPECTATION_FAILED, - e.STATUSES.IM_A_TEAPOT, - e.STATUSES.PAGE_EXPIRED, - e.STATUSES.ENHANCE_YOUR_CALM, - e.STATUSES.MISDIRECTED_REQUEST, - e.STATUSES.UNPROCESSABLE_ENTITY, - e.STATUSES.LOCKED, - e.STATUSES.FAILED_DEPENDENCY, - e.STATUSES.TOO_EARLY, - e.STATUSES.UPGRADE_REQUIRED, - e.STATUSES.PRECONDITION_REQUIRED, - e.STATUSES.TOO_MANY_REQUESTS, - e.STATUSES.REQUEST_HEADER_FIELDS_TOO_LARGE_UNOFFICIAL, - e.STATUSES.REQUEST_HEADER_FIELDS_TOO_LARGE, - e.STATUSES.LOGIN_TIMEOUT, - e.STATUSES.NO_RESPONSE, - e.STATUSES.RETRY_WITH, - e.STATUSES.BLOCKED_BY_PARENTAL_CONTROL, - e.STATUSES.UNAVAILABLE_FOR_LEGAL_REASONS, - e.STATUSES.CLIENT_CLOSED_LOAD_BALANCED_REQUEST, - e.STATUSES.INVALID_X_FORWARDED_FOR, - e.STATUSES.REQUEST_HEADER_TOO_LARGE, - e.STATUSES.SSL_CERTIFICATE_ERROR, - e.STATUSES.SSL_CERTIFICATE_REQUIRED, - e.STATUSES.HTTP_REQUEST_SENT_TO_HTTPS_PORT, - e.STATUSES.INVALID_TOKEN, - e.STATUSES.CLIENT_CLOSED_REQUEST, - e.STATUSES.INTERNAL_SERVER_ERROR, - e.STATUSES.NOT_IMPLEMENTED, - e.STATUSES.BAD_GATEWAY, - e.STATUSES.SERVICE_UNAVAILABLE, - e.STATUSES.GATEWAY_TIMEOUT, - e.STATUSES.HTTP_VERSION_NOT_SUPPORTED, - e.STATUSES.VARIANT_ALSO_NEGOTIATES, - e.STATUSES.INSUFFICIENT_STORAGE, - e.STATUSES.LOOP_DETECTED, - e.STATUSES.BANDWIDTH_LIMIT_EXCEEDED, - e.STATUSES.NOT_EXTENDED, - e.STATUSES.NETWORK_AUTHENTICATION_REQUIRED, - e.STATUSES.WEB_SERVER_UNKNOWN_ERROR, - e.STATUSES.WEB_SERVER_IS_DOWN, - e.STATUSES.CONNECTION_TIMEOUT, - e.STATUSES.ORIGIN_IS_UNREACHABLE, - e.STATUSES.TIMEOUT_OCCURED, - e.STATUSES.SSL_HANDSHAKE_FAILED, - e.STATUSES.INVALID_SSL_CERTIFICATE, - e.STATUSES.RAILGUN_ERROR, - e.STATUSES.SITE_IS_OVERLOADED, - e.STATUSES.SITE_IS_FROZEN, - e.STATUSES.IDENTITY_PROVIDER_AUTHENTICATION_ERROR, - e.STATUSES.NETWORK_READ_TIMEOUT, - e.STATUSES.NETWORK_CONNECT_TIMEOUT - ], e.ALPHA = []; - for (let t = 65; t <= 90; t++) e.ALPHA.push(String.fromCharCode(t)), e.ALPHA.push(String.fromCharCode(t + 32)); - e.NUM_MAP = { - 0: 0, - 1: 1, - 2: 2, - 3: 3, - 4: 4, - 5: 5, - 6: 6, - 7: 7, - 8: 8, - 9: 9 - }, e.HEX_MAP = { - 0: 0, - 1: 1, - 2: 2, - 3: 3, - 4: 4, - 5: 5, - 6: 6, - 7: 7, - 8: 8, - 9: 9, - A: 10, - B: 11, - C: 12, - D: 13, - E: 14, - F: 15, - a: 10, - b: 11, - c: 12, - d: 13, - e: 14, - f: 15 - }, e.NUM = [ - `0`, - `1`, - `2`, - `3`, - `4`, - `5`, - `6`, - `7`, - `8`, - `9` - ], e.ALPHANUM = e.ALPHA.concat(e.NUM), e.MARK = [ - `-`, - `_`, - `.`, - `!`, - `~`, - `*`, - `'`, - `(`, - `)` - ], e.USERINFO_CHARS = e.ALPHANUM.concat(e.MARK).concat([ - `%`, - `;`, - `:`, - `&`, - `=`, - `+`, - `$`, - `,` - ]), e.URL_CHAR = `!"$%&'()*+,-./:;<=>@[\\]^_\`{|}~`.split(``).concat(e.ALPHANUM), e.HEX = e.NUM.concat([ - `a`, - `b`, - `c`, - `d`, - `e`, - `f`, - `A`, - `B`, - `C`, - `D`, - `E`, - `F` - ]), e.TOKEN = [ - `!`, - `#`, - `$`, - `%`, - `&`, - `'`, - `*`, - `+`, - `-`, - `.`, - `^`, - `_`, - "`", - `|`, - `~` - ].concat(e.ALPHANUM), e.HEADER_CHARS = [` `]; - for (let t = 32; t <= 255; t++) t !== 127 && e.HEADER_CHARS.push(t); - e.CONNECTION_TOKEN_CHARS = e.HEADER_CHARS.filter((e) => e !== 44), e.QUOTED_STRING = [` `, ` `]; - for (let t = 33; t <= 255; t++) t !== 34 && t !== 92 && e.QUOTED_STRING.push(t); - e.HTAB_SP_VCHAR_OBS_TEXT = [` `, ` `]; - for (let t = 33; t <= 126; t++) e.HTAB_SP_VCHAR_OBS_TEXT.push(t); - for (let t = 128; t <= 255; t++) e.HTAB_SP_VCHAR_OBS_TEXT.push(t); - e.MAJOR = e.NUM_MAP, e.MINOR = e.MAJOR, e.SPECIAL_HEADERS = { - connection: e.HEADER_STATE.CONNECTION, - "content-length": e.HEADER_STATE.CONTENT_LENGTH, - "proxy-connection": e.HEADER_STATE.CONNECTION, - "transfer-encoding": e.HEADER_STATE.TRANSFER_ENCODING, - upgrade: e.HEADER_STATE.UPGRADE - }, e.default = { - ERROR: e.ERROR, - TYPE: e.TYPE, - FLAGS: e.FLAGS, - LENIENT_FLAGS: e.LENIENT_FLAGS, - METHODS: e.METHODS, - STATUSES: e.STATUSES, - FINISH: e.FINISH, - HEADER_STATE: e.HEADER_STATE, - ALPHA: e.ALPHA, - NUM_MAP: e.NUM_MAP, - HEX_MAP: e.HEX_MAP, - NUM: e.NUM, - ALPHANUM: e.ALPHANUM, - MARK: e.MARK, - USERINFO_CHARS: e.USERINFO_CHARS, - URL_CHAR: e.URL_CHAR, - HEX: e.HEX, - TOKEN: e.TOKEN, - HEADER_CHARS: e.HEADER_CHARS, - CONNECTION_TOKEN_CHARS: e.CONNECTION_TOKEN_CHARS, - QUOTED_STRING: e.QUOTED_STRING, - HTAB_SP_VCHAR_OBS_TEXT: e.HTAB_SP_VCHAR_OBS_TEXT, - MAJOR: e.MAJOR, - MINOR: e.MINOR, - SPECIAL_HEADERS: e.SPECIAL_HEADERS, - METHODS_HTTP: e.METHODS_HTTP, - METHODS_ICE: e.METHODS_ICE, - METHODS_RTSP: e.METHODS_RTSP, - METHOD_MAP: e.METHOD_MAP, - H_METHOD_MAP: e.H_METHOD_MAP, - STATUSES_HTTP: e.STATUSES_HTTP - }; -})); -var ae$1 = c$3(((e, t) => { - let { Buffer: r } = p$4(`node:buffer`), i; - Object.defineProperty(t, "exports", { get: () => i ||= r.from(`AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAn9/AGABfwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQAEA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAAzU0BQYAAAMAAAAAAAADAQMAAwMDAAACAAAAAAICAgICAgICAgIBAQEBAQEBAQEBAwAAAwAAAAQFAXABExMFAwEAAgYIAX8BQcDZBAsHxQcoBm1lbW9yeQIAC19pbml0aWFsaXplAAgZX19pbmRpcmVjdF9mdW5jdGlvbl90YWJsZQEAC2xsaHR0cF9pbml0AAkYbGxodHRwX3Nob3VsZF9rZWVwX2FsaXZlADcMbGxodHRwX2FsbG9jAAsGbWFsbG9jADkLbGxodHRwX2ZyZWUADARmcmVlAAwPbGxodHRwX2dldF90eXBlAA0VbGxodHRwX2dldF9odHRwX21ham9yAA4VbGxodHRwX2dldF9odHRwX21pbm9yAA8RbGxodHRwX2dldF9tZXRob2QAEBZsbGh0dHBfZ2V0X3N0YXR1c19jb2RlABESbGxodHRwX2dldF91cGdyYWRlABIMbGxodHRwX3Jlc2V0ABMObGxodHRwX2V4ZWN1dGUAFBRsbGh0dHBfc2V0dGluZ3NfaW5pdAAVDWxsaHR0cF9maW5pc2gAFgxsbGh0dHBfcGF1c2UAFw1sbGh0dHBfcmVzdW1lABgbbGxodHRwX3Jlc3VtZV9hZnRlcl91cGdyYWRlABkQbGxodHRwX2dldF9lcnJubwAaF2xsaHR0cF9nZXRfZXJyb3JfcmVhc29uABsXbGxodHRwX3NldF9lcnJvcl9yZWFzb24AHBRsbGh0dHBfZ2V0X2Vycm9yX3BvcwAdEWxsaHR0cF9lcnJub19uYW1lAB4SbGxodHRwX21ldGhvZF9uYW1lAB8SbGxodHRwX3N0YXR1c19uYW1lACAabGxodHRwX3NldF9sZW5pZW50X2hlYWRlcnMAISFsbGh0dHBfc2V0X2xlbmllbnRfY2h1bmtlZF9sZW5ndGgAIh1sbGh0dHBfc2V0X2xlbmllbnRfa2VlcF9hbGl2ZQAjJGxsaHR0cF9zZXRfbGVuaWVudF90cmFuc2Zlcl9lbmNvZGluZwAkGmxsaHR0cF9zZXRfbGVuaWVudF92ZXJzaW9uACUjbGxodHRwX3NldF9sZW5pZW50X2RhdGFfYWZ0ZXJfY2xvc2UAJidsbGh0dHBfc2V0X2xlbmllbnRfb3B0aW9uYWxfbGZfYWZ0ZXJfY3IAJyxsbGh0dHBfc2V0X2xlbmllbnRfb3B0aW9uYWxfY3JsZl9hZnRlcl9jaHVuawAoKGxsaHR0cF9zZXRfbGVuaWVudF9vcHRpb25hbF9jcl9iZWZvcmVfbGYAKSpsbGh0dHBfc2V0X2xlbmllbnRfc3BhY2VzX2FmdGVyX2NodW5rX3NpemUAKhhsbGh0dHBfbWVzc2FnZV9uZWVkc19lb2YANgkYAQBBAQsSAQIDBAUKBgcyNDMuKy8tLDAxCq/ZAjQWAEHA1QAoAgAEQAALQcDVAEEBNgIACxQAIAAQOCAAIAI2AjggACABOgAoCxQAIAAgAC8BNCAALQAwIAAQNxAACx4BAX9BwAAQOiIBEDggAUGACDYCOCABIAA6ACggAQuPDAEHfwJAIABFDQAgAEEIayIBIABBBGsoAgAiAEF4cSIEaiEFAkAgAEEBcQ0AIABBA3FFDQEgASABKAIAIgBrIgFB1NUAKAIASQ0BIAAgBGohBAJAAkBB2NUAKAIAIAFHBEAgAEH/AU0EQCAAQQN2IQMgASgCCCIAIAEoAgwiAkYEQEHE1QBBxNUAKAIAQX4gA3dxNgIADAULIAIgADYCCCAAIAI2AgwMBAsgASgCGCEGIAEgASgCDCIARwRAIAAgASgCCCICNgIIIAIgADYCDAwDCyABQRRqIgMoAgAiAkUEQCABKAIQIgJFDQIgAUEQaiEDCwNAIAMhByACIgBBFGoiAygCACICDQAgAEEQaiEDIAAoAhAiAg0ACyAHQQA2AgAMAgsgBSgCBCIAQQNxQQNHDQIgBSAAQX5xNgIEQczVACAENgIAIAUgBDYCACABIARBAXI2AgQMAwtBACEACyAGRQ0AAkAgASgCHCICQQJ0QfTXAGoiAygCACABRgRAIAMgADYCACAADQFByNUAQcjVACgCAEF+IAJ3cTYCAAwCCyAGQRBBFCAGKAIQIAFGG2ogADYCACAARQ0BCyAAIAY2AhggASgCECICBEAgACACNgIQIAIgADYCGAsgAUEUaigCACICRQ0AIABBFGogAjYCACACIAA2AhgLIAEgBU8NACAFKAIEIgBBAXFFDQACQAJAAkACQCAAQQJxRQRAQdzVACgCACAFRgRAQdzVACABNgIAQdDVAEHQ1QAoAgAgBGoiADYCACABIABBAXI2AgQgAUHY1QAoAgBHDQZBzNUAQQA2AgBB2NUAQQA2AgAMBgtB2NUAKAIAIAVGBEBB2NUAIAE2AgBBzNUAQczVACgCACAEaiIANgIAIAEgAEEBcjYCBCAAIAFqIAA2AgAMBgsgAEF4cSAEaiEEIABB/wFNBEAgAEEDdiEDIAUoAggiACAFKAIMIgJGBEBBxNUAQcTVACgCAEF+IAN3cTYCAAwFCyACIAA2AgggACACNgIMDAQLIAUoAhghBiAFIAUoAgwiAEcEQEHU1QAoAgAaIAAgBSgCCCICNgIIIAIgADYCDAwDCyAFQRRqIgMoAgAiAkUEQCAFKAIQIgJFDQIgBUEQaiEDCwNAIAMhByACIgBBFGoiAygCACICDQAgAEEQaiEDIAAoAhAiAg0ACyAHQQA2AgAMAgsgBSAAQX5xNgIEIAEgBGogBDYCACABIARBAXI2AgQMAwtBACEACyAGRQ0AAkAgBSgCHCICQQJ0QfTXAGoiAygCACAFRgRAIAMgADYCACAADQFByNUAQcjVACgCAEF+IAJ3cTYCAAwCCyAGQRBBFCAGKAIQIAVGG2ogADYCACAARQ0BCyAAIAY2AhggBSgCECICBEAgACACNgIQIAIgADYCGAsgBUEUaigCACICRQ0AIABBFGogAjYCACACIAA2AhgLIAEgBGogBDYCACABIARBAXI2AgQgAUHY1QAoAgBHDQBBzNUAIAQ2AgAMAQsgBEH/AU0EQCAEQXhxQezVAGohAAJ/QcTVACgCACICQQEgBEEDdnQiA3FFBEBBxNUAIAIgA3I2AgAgAAwBCyAAKAIICyICIAE2AgwgACABNgIIIAEgADYCDCABIAI2AggMAQtBHyECIARB////B00EQCAEQSYgBEEIdmciAGt2QQFxIABBAXRrQT5qIQILIAEgAjYCHCABQgA3AhAgAkECdEH01wBqIQACQEHI1QAoAgAiA0EBIAJ0IgdxRQRAIAAgATYCAEHI1QAgAyAHcjYCACABIAA2AhggASABNgIIIAEgATYCDAwBCyAEQRkgAkEBdmtBACACQR9HG3QhAiAAKAIAIQACQANAIAAiAygCBEF4cSAERg0BIAJBHXYhACACQQF0IQIgAyAAQQRxakEQaiIHKAIAIgANAAsgByABNgIAIAEgAzYCGCABIAE2AgwgASABNgIIDAELIAMoAggiACABNgIMIAMgATYCCCABQQA2AhggASADNgIMIAEgADYCCAtB5NUAQeTVACgCAEEBayIAQX8gABs2AgALCwcAIAAtACgLBwAgAC0AKgsHACAALQArCwcAIAAtACkLBwAgAC8BNAsHACAALQAwC0ABBH8gACgCGCEBIAAvAS4hAiAALQAoIQMgACgCOCEEIAAQOCAAIAQ2AjggACADOgAoIAAgAjsBLiAAIAE2AhgL5YUCAgd/A34gASACaiEEAkAgACIDKAIMIgANACADKAIEBEAgAyABNgIECyMAQRBrIgkkAAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAygCHCICQQJrDvwBAfkBAgMEBQYHCAkKCwwNDg8QERL4ARP3ARQV9gEWF/UBGBkaGxwdHh8g/QH7ASH0ASIjJCUmJygpKivzASwtLi8wMTLyAfEBMzTwAe8BNTY3ODk6Ozw9Pj9AQUJDREVGR0hJSktMTU5P+gFQUVJT7gHtAVTsAVXrAVZXWFla6gFbXF1eX2BhYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ent8fX5/gAGBAYIBgwGEAYUBhgGHAYgBiQGKAYsBjAGNAY4BjwGQAZEBkgGTAZQBlQGWAZcBmAGZAZoBmwGcAZ0BngGfAaABoQGiAaMBpAGlAaYBpwGoAakBqgGrAawBrQGuAa8BsAGxAbIBswG0AbUBtgG3AbgBuQG6AbsBvAG9Ab4BvwHAAcEBwgHDAcQBxQHGAccByAHJAcoBywHMAc0BzgHpAegBzwHnAdAB5gHRAdIB0wHUAeUB1QHWAdcB2AHZAdoB2wHcAd0B3gHfAeAB4QHiAeMBAPwBC0EADOMBC0EODOIBC0ENDOEBC0EPDOABC0EQDN8BC0ETDN4BC0EUDN0BC0EVDNwBC0EWDNsBC0EXDNoBC0EYDNkBC0EZDNgBC0EaDNcBC0EbDNYBC0EcDNUBC0EdDNQBC0EeDNMBC0EfDNIBC0EgDNEBC0EhDNABC0EIDM8BC0EiDM4BC0EkDM0BC0EjDMwBC0EHDMsBC0ElDMoBC0EmDMkBC0EnDMgBC0EoDMcBC0ESDMYBC0ERDMUBC0EpDMQBC0EqDMMBC0ErDMIBC0EsDMEBC0HeAQzAAQtBLgy/AQtBLwy+AQtBMAy9AQtBMQy8AQtBMgy7AQtBMwy6AQtBNAy5AQtB3wEMuAELQTUMtwELQTkMtgELQQwMtQELQTYMtAELQTcMswELQTgMsgELQT4MsQELQToMsAELQeABDK8BC0ELDK4BC0E/DK0BC0E7DKwBC0EKDKsBC0E8DKoBC0E9DKkBC0HhAQyoAQtBwQAMpwELQcAADKYBC0HCAAylAQtBCQykAQtBLQyjAQtBwwAMogELQcQADKEBC0HFAAygAQtBxgAMnwELQccADJ4BC0HIAAydAQtByQAMnAELQcoADJsBC0HLAAyaAQtBzAAMmQELQc0ADJgBC0HOAAyXAQtBzwAMlgELQdAADJUBC0HRAAyUAQtB0gAMkwELQdMADJIBC0HVAAyRAQtB1AAMkAELQdYADI8BC0HXAAyOAQtB2AAMjQELQdkADIwBC0HaAAyLAQtB2wAMigELQdwADIkBC0HdAAyIAQtB3gAMhwELQd8ADIYBC0HgAAyFAQtB4QAMhAELQeIADIMBC0HjAAyCAQtB5AAMgQELQeUADIABC0HiAQx/C0HmAAx+C0HnAAx9C0EGDHwLQegADHsLQQUMegtB6QAMeQtBBAx4C0HqAAx3C0HrAAx2C0HsAAx1C0HtAAx0C0EDDHMLQe4ADHILQe8ADHELQfAADHALQfIADG8LQfEADG4LQfMADG0LQfQADGwLQfUADGsLQfYADGoLQQIMaQtB9wAMaAtB+AAMZwtB+QAMZgtB+gAMZQtB+wAMZAtB/AAMYwtB/QAMYgtB/gAMYQtB/wAMYAtBgAEMXwtBgQEMXgtBggEMXQtBgwEMXAtBhAEMWwtBhQEMWgtBhgEMWQtBhwEMWAtBiAEMVwtBiQEMVgtBigEMVQtBiwEMVAtBjAEMUwtBjQEMUgtBjgEMUQtBjwEMUAtBkAEMTwtBkQEMTgtBkgEMTQtBkwEMTAtBlAEMSwtBlQEMSgtBlgEMSQtBlwEMSAtBmAEMRwtBmQEMRgtBmgEMRQtBmwEMRAtBnAEMQwtBnQEMQgtBngEMQQtBnwEMQAtBoAEMPwtBoQEMPgtBogEMPQtBowEMPAtBpAEMOwtBpQEMOgtBpgEMOQtBpwEMOAtBqAEMNwtBqQEMNgtBqgEMNQtBqwEMNAtBrAEMMwtBrQEMMgtBrgEMMQtBrwEMMAtBsAEMLwtBsQEMLgtBsgEMLQtBswEMLAtBtAEMKwtBtQEMKgtBtgEMKQtBtwEMKAtBuAEMJwtBuQEMJgtBugEMJQtBuwEMJAtBvAEMIwtBvQEMIgtBvgEMIQtBvwEMIAtBwAEMHwtBwQEMHgtBwgEMHQtBAQwcC0HDAQwbC0HEAQwaC0HFAQwZC0HGAQwYC0HHAQwXC0HIAQwWC0HJAQwVC0HKAQwUC0HLAQwTC0HMAQwSC0HNAQwRC0HOAQwQC0HPAQwPC0HQAQwOC0HRAQwNC0HSAQwMC0HTAQwLC0HUAQwKC0HVAQwJC0HWAQwIC0HjAQwHC0HXAQwGC0HYAQwFC0HZAQwEC0HaAQwDC0HbAQwCC0HdAQwBC0HcAQshAgNAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCADAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJ/AkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAMCfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAg7jAQABAgMEBQYHCAkKCwwNDg8QERITFBUWFxgZGhscHR4fICEjJCUnKCmeA5sDmgORA4oDgwOAA/0C+wL4AvIC8QLvAu0C6ALnAuYC5QLkAtwC2wLaAtkC2ALXAtYC1QLPAs4CzALLAsoCyQLIAscCxgLEAsMCvgK8AroCuQK4ArcCtgK1ArQCswKyArECsAKuAq0CqQKoAqcCpgKlAqQCowKiAqECoAKfApgCkAKMAosCigKBAv4B/QH8AfsB+gH5AfgB9wH1AfMB8AHrAekB6AHnAeYB5QHkAeMB4gHhAeAB3wHeAd0B3AHaAdkB2AHXAdYB1QHUAdMB0gHRAdABzwHOAc0BzAHLAcoByQHIAccBxgHFAcQBwwHCAcEBwAG/Ab4BvQG8AbsBugG5AbgBtwG2AbUBtAGzAbIBsQGwAa8BrgGtAawBqwGqAakBqAGnAaYBpQGkAaMBogGfAZ4BmQGYAZcBlgGVAZQBkwGSAZEBkAGPAY0BjAGHAYYBhQGEAYMBggF9fHt6eXZ1dFBRUlNUVQsgASAERw1yQf0BIQIMvgMLIAEgBEcNmAFB2wEhAgy9AwsgASAERw3xAUGOASECDLwDCyABIARHDfwBQYQBIQIMuwMLIAEgBEcNigJB/wAhAgy6AwsgASAERw2RAkH9ACECDLkDCyABIARHDZQCQfsAIQIMuAMLIAEgBEcNHkEeIQIMtwMLIAEgBEcNGUEYIQIMtgMLIAEgBEcNygJBzQAhAgy1AwsgASAERw3VAkHGACECDLQDCyABIARHDdYCQcMAIQIMswMLIAEgBEcN3AJBOCECDLIDCyADLQAwQQFGDa0DDIkDC0EAIQACQAJAAkAgAy0AKkUNACADLQArRQ0AIAMvATIiAkECcUUNAQwCCyADLwEyIgJBAXFFDQELQQEhACADLQAoQQFGDQAgAy8BNCIGQeQAa0HkAEkNACAGQcwBRg0AIAZBsAJGDQAgAkHAAHENAEEAIQAgAkGIBHFBgARGDQAgAkEocUEARyEACyADQQA7ATIgA0EAOgAxAkAgAEUEQCADQQA6ADEgAy0ALkEEcQ0BDLEDCyADQgA3AyALIANBADoAMSADQQE6ADYMSAtBACEAAkAgAygCOCICRQ0AIAIoAjAiAkUNACADIAIRAAAhAAsgAEUNSCAAQRVHDWIgA0EENgIcIAMgATYCFCADQdIbNgIQIANBFTYCDEEAIQIMrwMLIAEgBEYEQEEGIQIMrwMLIAEtAABBCkcNGSABQQFqIQEMGgsgA0IANwMgQRIhAgyUAwsgASAERw2KA0EjIQIMrAMLIAEgBEYEQEEHIQIMrAMLAkACQCABLQAAQQprDgQBGBgAGAsgAUEBaiEBQRAhAgyTAwsgAUEBaiEBIANBL2otAABBAXENF0EAIQIgA0EANgIcIAMgATYCFCADQZkgNgIQIANBGTYCDAyrAwsgAyADKQMgIgwgBCABa60iCn0iC0IAIAsgDFgbNwMgIAogDFoNGEEIIQIMqgMLIAEgBEcEQCADQQk2AgggAyABNgIEQRQhAgyRAwtBCSECDKkDCyADKQMgUA2uAgxDCyABIARGBEBBCyECDKgDCyABLQAAQQpHDRYgAUEBaiEBDBcLIANBL2otAABBAXFFDRkMJgtBACEAAkAgAygCOCICRQ0AIAIoAlAiAkUNACADIAIRAAAhAAsgAA0ZDEILQQAhAAJAIAMoAjgiAkUNACACKAJQIgJFDQAgAyACEQAAIQALIAANGgwkC0EAIQACQCADKAI4IgJFDQAgAigCUCICRQ0AIAMgAhEAACEACyAADRsMMgsgA0Evai0AAEEBcUUNHAwiC0EAIQACQCADKAI4IgJFDQAgAigCVCICRQ0AIAMgAhEAACEACyAADRwMQgtBACEAAkAgAygCOCICRQ0AIAIoAlQiAkUNACADIAIRAAAhAAsgAA0dDCALIAEgBEYEQEETIQIMoAMLAkAgAS0AACIAQQprDgQfIyMAIgsgAUEBaiEBDB8LQQAhAAJAIAMoAjgiAkUNACACKAJUIgJFDQAgAyACEQAAIQALIAANIgxCCyABIARGBEBBFiECDJ4DCyABLQAAQcDBAGotAABBAUcNIwyDAwsCQANAIAEtAABBsDtqLQAAIgBBAUcEQAJAIABBAmsOAgMAJwsgAUEBaiEBQSEhAgyGAwsgBCABQQFqIgFHDQALQRghAgydAwsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAFBAWoiARA0IgANIQxBC0EAIQACQCADKAI4IgJFDQAgAigCVCICRQ0AIAMgAhEAACEACyAADSMMKgsgASAERgRAQRwhAgybAwsgA0EKNgIIIAMgATYCBEEAIQACQCADKAI4IgJFDQAgAigCUCICRQ0AIAMgAhEAACEACyAADSVBJCECDIEDCyABIARHBEADQCABLQAAQbA9ai0AACIAQQNHBEAgAEEBaw4FGBomggMlJgsgBCABQQFqIgFHDQALQRshAgyaAwtBGyECDJkDCwNAIAEtAABBsD9qLQAAIgBBA0cEQCAAQQFrDgUPEScTJicLIAQgAUEBaiIBRw0AC0EeIQIMmAMLIAEgBEcEQCADQQs2AgggAyABNgIEQQchAgz/AgtBHyECDJcDCyABIARGBEBBICECDJcDCwJAIAEtAABBDWsOFC4/Pz8/Pz8/Pz8/Pz8/Pz8/Pz8APwtBACECIANBADYCHCADQb8LNgIQIANBAjYCDCADIAFBAWo2AhQMlgMLIANBL2ohAgNAIAEgBEYEQEEhIQIMlwMLAkACQAJAIAEtAAAiAEEJaw4YAgApKQEpKSkpKSkpKSkpKSkpKSkpKSkCJwsgAUEBaiEBIANBL2otAABBAXFFDQoMGAsgAUEBaiEBDBcLIAFBAWohASACLQAAQQJxDQALQQAhAiADQQA2AhwgAyABNgIUIANBnxU2AhAgA0EMNgIMDJUDCyADLQAuQYABcUUNAQtBACEAAkAgAygCOCICRQ0AIAIoAlwiAkUNACADIAIRAAAhAAsgAEUN5gIgAEEVRgRAIANBJDYCHCADIAE2AhQgA0GbGzYCECADQRU2AgxBACECDJQDC0EAIQIgA0EANgIcIAMgATYCFCADQZAONgIQIANBFDYCDAyTAwtBACECIANBADYCHCADIAE2AhQgA0G+IDYCECADQQI2AgwMkgMLIAMoAgQhAEEAIQIgA0EANgIEIAMgACABIAynaiIBEDIiAEUNKyADQQc2AhwgAyABNgIUIAMgADYCDAyRAwsgAy0ALkHAAHFFDQELQQAhAAJAIAMoAjgiAkUNACACKAJYIgJFDQAgAyACEQAAIQALIABFDSsgAEEVRgRAIANBCjYCHCADIAE2AhQgA0HrGTYCECADQRU2AgxBACECDJADC0EAIQIgA0EANgIcIAMgATYCFCADQZMMNgIQIANBEzYCDAyPAwtBACECIANBADYCHCADIAE2AhQgA0GCFTYCECADQQI2AgwMjgMLQQAhAiADQQA2AhwgAyABNgIUIANB3RQ2AhAgA0EZNgIMDI0DC0EAIQIgA0EANgIcIAMgATYCFCADQeYdNgIQIANBGTYCDAyMAwsgAEEVRg09QQAhAiADQQA2AhwgAyABNgIUIANB0A82AhAgA0EiNgIMDIsDCyADKAIEIQBBACECIANBADYCBCADIAAgARAzIgBFDSggA0ENNgIcIAMgATYCFCADIAA2AgwMigMLIABBFUYNOkEAIQIgA0EANgIcIAMgATYCFCADQdAPNgIQIANBIjYCDAyJAwsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEQMyIARQRAIAFBAWohAQwoCyADQQ42AhwgAyAANgIMIAMgAUEBajYCFAyIAwsgAEEVRg03QQAhAiADQQA2AhwgAyABNgIUIANB0A82AhAgA0EiNgIMDIcDCyADKAIEIQBBACECIANBADYCBCADIAAgARAzIgBFBEAgAUEBaiEBDCcLIANBDzYCHCADIAA2AgwgAyABQQFqNgIUDIYDC0EAIQIgA0EANgIcIAMgATYCFCADQeIXNgIQIANBGTYCDAyFAwsgAEEVRg0zQQAhAiADQQA2AhwgAyABNgIUIANB1gw2AhAgA0EjNgIMDIQDCyADKAIEIQBBACECIANBADYCBCADIAAgARA0IgBFDSUgA0ERNgIcIAMgATYCFCADIAA2AgwMgwMLIABBFUYNMEEAIQIgA0EANgIcIAMgATYCFCADQdYMNgIQIANBIzYCDAyCAwsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEQNCIARQRAIAFBAWohAQwlCyADQRI2AhwgAyAANgIMIAMgAUEBajYCFAyBAwsgA0Evai0AAEEBcUUNAQtBFyECDOYCC0EAIQIgA0EANgIcIAMgATYCFCADQeIXNgIQIANBGTYCDAz+AgsgAEE7Rw0AIAFBAWohAQwMC0EAIQIgA0EANgIcIAMgATYCFCADQZIYNgIQIANBAjYCDAz8AgsgAEEVRg0oQQAhAiADQQA2AhwgAyABNgIUIANB1gw2AhAgA0EjNgIMDPsCCyADQRQ2AhwgAyABNgIUIAMgADYCDAz6AgsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEQNCIARQRAIAFBAWohAQz1AgsgA0EVNgIcIAMgADYCDCADIAFBAWo2AhQM+QILIAMoAgQhAEEAIQIgA0EANgIEIAMgACABEDQiAEUEQCABQQFqIQEM8wILIANBFzYCHCADIAA2AgwgAyABQQFqNgIUDPgCCyAAQRVGDSNBACECIANBADYCHCADIAE2AhQgA0HWDDYCECADQSM2AgwM9wILIAMoAgQhAEEAIQIgA0EANgIEIAMgACABEDQiAEUEQCABQQFqIQEMHQsgA0EZNgIcIAMgADYCDCADIAFBAWo2AhQM9gILIAMoAgQhAEEAIQIgA0EANgIEIAMgACABEDQiAEUEQCABQQFqIQEM7wILIANBGjYCHCADIAA2AgwgAyABQQFqNgIUDPUCCyAAQRVGDR9BACECIANBADYCHCADIAE2AhQgA0HQDzYCECADQSI2AgwM9AILIAMoAgQhACADQQA2AgQgAyAAIAEQMyIARQRAIAFBAWohAQwbCyADQRw2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIM8wILIAMoAgQhACADQQA2AgQgAyAAIAEQMyIARQRAIAFBAWohAQzrAgsgA0EdNgIcIAMgADYCDCADIAFBAWo2AhRBACECDPICCyAAQTtHDQEgAUEBaiEBC0EmIQIM1wILQQAhAiADQQA2AhwgAyABNgIUIANBnxU2AhAgA0EMNgIMDO8CCyABIARHBEADQCABLQAAQSBHDYQCIAQgAUEBaiIBRw0AC0EsIQIM7wILQSwhAgzuAgsgASAERgRAQTQhAgzuAgsCQAJAA0ACQCABLQAAQQprDgQCAAADAAsgBCABQQFqIgFHDQALQTQhAgzvAgsgAygCBCEAIANBADYCBCADIAAgARAxIgBFDZ8CIANBMjYCHCADIAE2AhQgAyAANgIMQQAhAgzuAgsgAygCBCEAIANBADYCBCADIAAgARAxIgBFBEAgAUEBaiEBDJ8CCyADQTI2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIM7QILIAEgBEcEQAJAA0AgAS0AAEEwayIAQf8BcUEKTwRAQTohAgzXAgsgAykDICILQpmz5syZs+bMGVYNASADIAtCCn4iCjcDICAKIACtQv8BgyILQn+FVg0BIAMgCiALfDcDICAEIAFBAWoiAUcNAAtBwAAhAgzuAgsgAygCBCEAIANBADYCBCADIAAgAUEBaiIBEDEiAA0XDOICC0HAACECDOwCCyABIARGBEBByQAhAgzsAgsCQANAAkAgAS0AAEEJaw4YAAKiAqICqQKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogIAogILIAQgAUEBaiIBRw0AC0HJACECDOwCCyABQQFqIQEgA0Evai0AAEEBcQ2lAiADQQA2AhwgAyABNgIUIANBlxA2AhAgA0EKNgIMQQAhAgzrAgsgASAERwRAA0AgAS0AAEEgRw0VIAQgAUEBaiIBRw0AC0H4ACECDOsCC0H4ACECDOoCCyADQQI6ACgMOAtBACECIANBADYCHCADQb8LNgIQIANBAjYCDCADIAFBAWo2AhQM6AILQQAhAgzOAgtBDSECDM0CC0ETIQIMzAILQRUhAgzLAgtBFiECDMoCC0EYIQIMyQILQRkhAgzIAgtBGiECDMcCC0EbIQIMxgILQRwhAgzFAgtBHSECDMQCC0EeIQIMwwILQR8hAgzCAgtBICECDMECC0EiIQIMwAILQSMhAgy/AgtBJSECDL4CC0HlACECDL0CCyADQT02AhwgAyABNgIUIAMgADYCDEEAIQIM1QILIANBGzYCHCADIAE2AhQgA0GkHDYCECADQRU2AgxBACECDNQCCyADQSA2AhwgAyABNgIUIANBmBo2AhAgA0EVNgIMQQAhAgzTAgsgA0ETNgIcIAMgATYCFCADQZgaNgIQIANBFTYCDEEAIQIM0gILIANBCzYCHCADIAE2AhQgA0GYGjYCECADQRU2AgxBACECDNECCyADQRA2AhwgAyABNgIUIANBmBo2AhAgA0EVNgIMQQAhAgzQAgsgA0EgNgIcIAMgATYCFCADQaQcNgIQIANBFTYCDEEAIQIMzwILIANBCzYCHCADIAE2AhQgA0GkHDYCECADQRU2AgxBACECDM4CCyADQQw2AhwgAyABNgIUIANBpBw2AhAgA0EVNgIMQQAhAgzNAgtBACECIANBADYCHCADIAE2AhQgA0HdDjYCECADQRI2AgwMzAILAkADQAJAIAEtAABBCmsOBAACAgACCyAEIAFBAWoiAUcNAAtB/QEhAgzMAgsCQAJAIAMtADZBAUcNAEEAIQACQCADKAI4IgJFDQAgAigCYCICRQ0AIAMgAhEAACEACyAARQ0AIABBFUcNASADQfwBNgIcIAMgATYCFCADQdwZNgIQIANBFTYCDEEAIQIMzQILQdwBIQIMswILIANBADYCHCADIAE2AhQgA0H5CzYCECADQR82AgxBACECDMsCCwJAAkAgAy0AKEEBaw4CBAEAC0HbASECDLICC0HUASECDLECCyADQQI6ADFBACEAAkAgAygCOCICRQ0AIAIoAgAiAkUNACADIAIRAAAhAAsgAEUEQEHdASECDLECCyAAQRVHBEAgA0EANgIcIAMgATYCFCADQbQMNgIQIANBEDYCDEEAIQIMygILIANB+wE2AhwgAyABNgIUIANBgRo2AhAgA0EVNgIMQQAhAgzJAgsgASAERgRAQfoBIQIMyQILIAEtAABByABGDQEgA0EBOgAoC0HAASECDK4CC0HaASECDK0CCyABIARHBEAgA0EMNgIIIAMgATYCBEHZASECDK0CC0H5ASECDMUCCyABIARGBEBB+AEhAgzFAgsgAS0AAEHIAEcNBCABQQFqIQFB2AEhAgyrAgsgASAERgRAQfcBIQIMxAILAkACQCABLQAAQcUAaw4QAAUFBQUFBQUFBQUFBQUFAQULIAFBAWohAUHWASECDKsCCyABQQFqIQFB1wEhAgyqAgtB9gEhAiABIARGDcICIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQbrVAGotAABHDQMgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADMMCCyADKAIEIQAgA0IANwMAIAMgACAGQQFqIgEQLiIARQRAQeMBIQIMqgILIANB9QE2AhwgAyABNgIUIAMgADYCDEEAIQIMwgILQfQBIQIgASAERg3BAiADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEG41QBqLQAARw0CIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzCAgsgA0GBBDsBKCADKAIEIQAgA0IANwMAIAMgACAGQQFqIgEQLiIADQMMAgsgA0EANgIAC0EAIQIgA0EANgIcIAMgATYCFCADQeUfNgIQIANBCDYCDAy/AgtB1QEhAgylAgsgA0HzATYCHCADIAE2AhQgAyAANgIMQQAhAgy9AgtBACEAAkAgAygCOCICRQ0AIAIoAkAiAkUNACADIAIRAAAhAAsgAEUNbiAAQRVHBEAgA0EANgIcIAMgATYCFCADQYIPNgIQIANBIDYCDEEAIQIMvQILIANBjwE2AhwgAyABNgIUIANB7Bs2AhAgA0EVNgIMQQAhAgy8AgsgASAERwRAIANBDTYCCCADIAE2AgRB0wEhAgyjAgtB8gEhAgy7AgsgASAERgRAQfEBIQIMuwILAkACQAJAIAEtAABByABrDgsAAQgICAgICAgIAggLIAFBAWohAUHQASECDKMCCyABQQFqIQFB0QEhAgyiAgsgAUEBaiEBQdIBIQIMoQILQfABIQIgASAERg25AiADKAIAIgAgBCABa2ohBiABIABrQQJqIQUDQCABLQAAIABBtdUAai0AAEcNBCAAQQJGDQMgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAY2AgAMuQILQe8BIQIgASAERg24AiADKAIAIgAgBCABa2ohBiABIABrQQFqIQUDQCABLQAAIABBs9UAai0AAEcNAyAAQQFGDQIgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAY2AgAMuAILQe4BIQIgASAERg23AiADKAIAIgAgBCABa2ohBiABIABrQQJqIQUDQCABLQAAIABBsNUAai0AAEcNAiAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAY2AgAMtwILIAMoAgQhACADQgA3AwAgAyAAIAVBAWoiARArIgBFDQIgA0HsATYCHCADIAE2AhQgAyAANgIMQQAhAgy2AgsgA0EANgIACyADKAIEIQAgA0EANgIEIAMgACABECsiAEUNnAIgA0HtATYCHCADIAE2AhQgAyAANgIMQQAhAgy0AgtBzwEhAgyaAgtBACEAAkAgAygCOCICRQ0AIAIoAjQiAkUNACADIAIRAAAhAAsCQCAABEAgAEEVRg0BIANBADYCHCADIAE2AhQgA0HqDTYCECADQSY2AgxBACECDLQCC0HOASECDJoCCyADQesBNgIcIAMgATYCFCADQYAbNgIQIANBFTYCDEEAIQIMsgILIAEgBEYEQEHrASECDLICCyABLQAAQS9GBEAgAUEBaiEBDAELIANBADYCHCADIAE2AhQgA0GyODYCECADQQg2AgxBACECDLECC0HNASECDJcCCyABIARHBEAgA0EONgIIIAMgATYCBEHMASECDJcCC0HqASECDK8CCyABIARGBEBB6QEhAgyvAgsgAS0AAEEwayIAQf8BcUEKSQRAIAMgADoAKiABQQFqIQFBywEhAgyWAgsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDZcCIANB6AE2AhwgAyABNgIUIAMgADYCDEEAIQIMrgILIAEgBEYEQEHnASECDK4CCwJAIAEtAABBLkYEQCABQQFqIQEMAQsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDZgCIANB5gE2AhwgAyABNgIUIAMgADYCDEEAIQIMrgILQcoBIQIMlAILIAEgBEYEQEHlASECDK0CC0EAIQBBASEFQQEhB0EAIQICQAJAAkACQAJAAn8CQAJAAkACQAJAAkACQCABLQAAQTBrDgoKCQABAgMEBQYICwtBAgwGC0EDDAULQQQMBAtBBQwDC0EGDAILQQcMAQtBCAshAkEAIQVBACEHDAILQQkhAkEBIQBBACEFQQAhBwwBC0EAIQVBASECCyADIAI6ACsgAUEBaiEBAkACQCADLQAuQRBxDQACQAJAAkAgAy0AKg4DAQACBAsgB0UNAwwCCyAADQEMAgsgBUUNAQsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDQIgA0HiATYCHCADIAE2AhQgAyAANgIMQQAhAgyvAgsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDZoCIANB4wE2AhwgAyABNgIUIAMgADYCDEEAIQIMrgILIAMoAgQhACADQQA2AgQgAyAAIAEQLyIARQ2YAiADQeQBNgIcIAMgATYCFCADIAA2AgwMrQILQckBIQIMkwILQQAhAAJAIAMoAjgiAkUNACACKAJEIgJFDQAgAyACEQAAIQALAkAgAARAIABBFUYNASADQQA2AhwgAyABNgIUIANBpA02AhAgA0EhNgIMQQAhAgytAgtByAEhAgyTAgsgA0HhATYCHCADIAE2AhQgA0HQGjYCECADQRU2AgxBACECDKsCCyABIARGBEBB4QEhAgyrAgsCQCABLQAAQSBGBEAgA0EAOwE0IAFBAWohAQwBCyADQQA2AhwgAyABNgIUIANBmRE2AhAgA0EJNgIMQQAhAgyrAgtBxwEhAgyRAgsgASAERgRAQeABIQIMqgILAkAgAS0AAEEwa0H/AXEiAkEKSQRAIAFBAWohAQJAIAMvATQiAEGZM0sNACADIABBCmwiADsBNCAAQf7/A3EgAkH//wNzSw0AIAMgACACajsBNAwCC0EAIQIgA0EANgIcIAMgATYCFCADQZUeNgIQIANBDTYCDAyrAgsgA0EANgIcIAMgATYCFCADQZUeNgIQIANBDTYCDEEAIQIMqgILQcYBIQIMkAILIAEgBEYEQEHfASECDKkCCwJAIAEtAABBMGtB/wFxIgJBCkkEQCABQQFqIQECQCADLwE0IgBBmTNLDQAgAyAAQQpsIgA7ATQgAEH+/wNxIAJB//8Dc0sNACADIAAgAmo7ATQMAgtBACECIANBADYCHCADIAE2AhQgA0GVHjYCECADQQ02AgwMqgILIANBADYCHCADIAE2AhQgA0GVHjYCECADQQ02AgxBACECDKkCC0HFASECDI8CCyABIARGBEBB3gEhAgyoAgsCQCABLQAAQTBrQf8BcSICQQpJBEAgAUEBaiEBAkAgAy8BNCIAQZkzSw0AIAMgAEEKbCIAOwE0IABB/v8DcSACQf//A3NLDQAgAyAAIAJqOwE0DAILQQAhAiADQQA2AhwgAyABNgIUIANBlR42AhAgA0ENNgIMDKkCCyADQQA2AhwgAyABNgIUIANBlR42AhAgA0ENNgIMQQAhAgyoAgtBxAEhAgyOAgsgASAERgRAQd0BIQIMpwILAkACQAJAAkAgAS0AAEEKaw4XAgMDAAMDAwMDAwMDAwMDAwMDAwMDAwEDCyABQQFqDAULIAFBAWohAUHDASECDI8CCyABQQFqIQEgA0Evai0AAEEBcQ0IIANBADYCHCADIAE2AhQgA0GNCzYCECADQQ02AgxBACECDKcCCyADQQA2AhwgAyABNgIUIANBjQs2AhAgA0ENNgIMQQAhAgymAgsgASAERwRAIANBDzYCCCADIAE2AgRBASECDI0CC0HcASECDKUCCwJAAkADQAJAIAEtAABBCmsOBAIAAAMACyAEIAFBAWoiAUcNAAtB2wEhAgymAgsgAygCBCEAIANBADYCBCADIAAgARAtIgBFBEAgAUEBaiEBDAQLIANB2gE2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIMpQILIAMoAgQhACADQQA2AgQgAyAAIAEQLSIADQEgAUEBagshAUHBASECDIoCCyADQdkBNgIcIAMgADYCDCADIAFBAWo2AhRBACECDKICC0HCASECDIgCCyADQS9qLQAAQQFxDQEgA0EANgIcIAMgATYCFCADQeQcNgIQIANBGTYCDEEAIQIMoAILIAEgBEYEQEHZASECDKACCwJAAkACQCABLQAAQQprDgQBAgIAAgsgAUEBaiEBDAILIAFBAWohAQwBCyADLQAuQcAAcUUNAQtBACEAAkAgAygCOCICRQ0AIAIoAjwiAkUNACADIAIRAAAhAAsgAEUNoAEgAEEVRgRAIANB2QA2AhwgAyABNgIUIANBtxo2AhAgA0EVNgIMQQAhAgyfAgsgA0EANgIcIAMgATYCFCADQYANNgIQIANBGzYCDEEAIQIMngILIANBADYCHCADIAE2AhQgA0HcKDYCECADQQI2AgxBACECDJ0CCyABIARHBEAgA0EMNgIIIAMgATYCBEG/ASECDIQCC0HYASECDJwCCyABIARGBEBB1wEhAgycAgsCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAEtAABBwQBrDhUAAQIDWgQFBlpaWgcICQoLDA0ODxBaCyABQQFqIQFB+wAhAgySAgsgAUEBaiEBQfwAIQIMkQILIAFBAWohAUGBASECDJACCyABQQFqIQFBhQEhAgyPAgsgAUEBaiEBQYYBIQIMjgILIAFBAWohAUGJASECDI0CCyABQQFqIQFBigEhAgyMAgsgAUEBaiEBQY0BIQIMiwILIAFBAWohAUGWASECDIoCCyABQQFqIQFBlwEhAgyJAgsgAUEBaiEBQZgBIQIMiAILIAFBAWohAUGlASECDIcCCyABQQFqIQFBpgEhAgyGAgsgAUEBaiEBQawBIQIMhQILIAFBAWohAUG0ASECDIQCCyABQQFqIQFBtwEhAgyDAgsgAUEBaiEBQb4BIQIMggILIAEgBEYEQEHWASECDJsCCyABLQAAQc4ARw1IIAFBAWohAUG9ASECDIECCyABIARGBEBB1QEhAgyaAgsCQAJAAkAgAS0AAEHCAGsOEgBKSkpKSkpKSkoBSkpKSkpKAkoLIAFBAWohAUG4ASECDIICCyABQQFqIQFBuwEhAgyBAgsgAUEBaiEBQbwBIQIMgAILQdQBIQIgASAERg2YAiADKAIAIgAgBCABa2ohBSABIABrQQdqIQYCQANAIAEtAAAgAEGo1QBqLQAARw1FIABBB0YNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyZAgsgA0EANgIAIAZBAWohAUEbDEULIAEgBEYEQEHTASECDJgCCwJAAkAgAS0AAEHJAGsOBwBHR0dHRwFHCyABQQFqIQFBuQEhAgz/AQsgAUEBaiEBQboBIQIM/gELQdIBIQIgASAERg2WAiADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGm1QBqLQAARw1DIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyXAgsgA0EANgIAIAZBAWohAUEPDEMLQdEBIQIgASAERg2VAiADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGk1QBqLQAARw1CIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyWAgsgA0EANgIAIAZBAWohAUEgDEILQdABIQIgASAERg2UAiADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGh1QBqLQAARw1BIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyVAgsgA0EANgIAIAZBAWohAUESDEELIAEgBEYEQEHPASECDJQCCwJAAkAgAS0AAEHFAGsODgBDQ0NDQ0NDQ0NDQ0MBQwsgAUEBaiEBQbUBIQIM+wELIAFBAWohAUG2ASECDPoBC0HOASECIAEgBEYNkgIgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBntUAai0AAEcNPyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMkwILIANBADYCACAGQQFqIQFBBww/C0HNASECIAEgBEYNkQIgAygCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABBmNUAai0AAEcNPiAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMkgILIANBADYCACAGQQFqIQFBKAw+CyABIARGBEBBzAEhAgyRAgsCQAJAAkAgAS0AAEHFAGsOEQBBQUFBQUFBQUEBQUFBQUECQQsgAUEBaiEBQbEBIQIM+QELIAFBAWohAUGyASECDPgBCyABQQFqIQFBswEhAgz3AQtBywEhAiABIARGDY8CIAMoAgAiACAEIAFraiEFIAEgAGtBBmohBgJAA0AgAS0AACAAQZHVAGotAABHDTwgAEEGRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJACCyADQQA2AgAgBkEBaiEBQRoMPAtBygEhAiABIARGDY4CIAMoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQY3VAGotAABHDTsgAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADI8CCyADQQA2AgAgBkEBaiEBQSEMOwsgASAERgRAQckBIQIMjgILAkACQCABLQAAQcEAaw4UAD09PT09PT09PT09PT09PT09PQE9CyABQQFqIQFBrQEhAgz1AQsgAUEBaiEBQbABIQIM9AELIAEgBEYEQEHIASECDI0CCwJAAkAgAS0AAEHVAGsOCwA8PDw8PDw8PDwBPAsgAUEBaiEBQa4BIQIM9AELIAFBAWohAUGvASECDPMBC0HHASECIAEgBEYNiwIgAygCACIAIAQgAWtqIQUgASAAa0EIaiEGAkADQCABLQAAIABBhNUAai0AAEcNOCAAQQhGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMjAILIANBADYCACAGQQFqIQFBKgw4CyABIARGBEBBxgEhAgyLAgsgAS0AAEHQAEcNOCABQQFqIQFBJQw3C0HFASECIAEgBEYNiQIgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBgdUAai0AAEcNNiAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMigILIANBADYCACAGQQFqIQFBDgw2CyABIARGBEBBxAEhAgyJAgsgAS0AAEHFAEcNNiABQQFqIQFBqwEhAgzvAQsgASAERgRAQcMBIQIMiAILAkACQAJAAkAgAS0AAEHCAGsODwABAjk5OTk5OTk5OTk5AzkLIAFBAWohAUGnASECDPEBCyABQQFqIQFBqAEhAgzwAQsgAUEBaiEBQakBIQIM7wELIAFBAWohAUGqASECDO4BC0HCASECIAEgBEYNhgIgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABB/tQAai0AAEcNMyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMhwILIANBADYCACAGQQFqIQFBFAwzC0HBASECIAEgBEYNhQIgAygCACIAIAQgAWtqIQUgASAAa0EEaiEGAkADQCABLQAAIABB+dQAai0AAEcNMiAAQQRGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMhgILIANBADYCACAGQQFqIQFBKwwyC0HAASECIAEgBEYNhAIgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABB9tQAai0AAEcNMSAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMhQILIANBADYCACAGQQFqIQFBLAwxC0G/ASECIAEgBEYNgwIgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBodUAai0AAEcNMCAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMhAILIANBADYCACAGQQFqIQFBEQwwC0G+ASECIAEgBEYNggIgAygCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABB8tQAai0AAEcNLyAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMgwILIANBADYCACAGQQFqIQFBLgwvCyABIARGBEBBvQEhAgyCAgsCQAJAAkACQAJAIAEtAABBwQBrDhUANDQ0NDQ0NDQ0NAE0NAI0NAM0NAQ0CyABQQFqIQFBmwEhAgzsAQsgAUEBaiEBQZwBIQIM6wELIAFBAWohAUGdASECDOoBCyABQQFqIQFBogEhAgzpAQsgAUEBaiEBQaQBIQIM6AELIAEgBEYEQEG8ASECDIECCwJAAkAgAS0AAEHSAGsOAwAwATALIAFBAWohAUGjASECDOgBCyABQQFqIQFBBAwtC0G7ASECIAEgBEYN/wEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB8NQAai0AAEcNLCAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMgAILIANBADYCACAGQQFqIQFBHQwsCyABIARGBEBBugEhAgz/AQsCQAJAIAEtAABByQBrDgcBLi4uLi4ALgsgAUEBaiEBQaEBIQIM5gELIAFBAWohAUEiDCsLIAEgBEYEQEG5ASECDP4BCyABLQAAQdAARw0rIAFBAWohAUGgASECDOQBCyABIARGBEBBuAEhAgz9AQsCQAJAIAEtAABBxgBrDgsALCwsLCwsLCwsASwLIAFBAWohAUGeASECDOQBCyABQQFqIQFBnwEhAgzjAQtBtwEhAiABIARGDfsBIAMoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQezUAGotAABHDSggAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPwBCyADQQA2AgAgBkEBaiEBQQ0MKAtBtgEhAiABIARGDfoBIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQaHVAGotAABHDScgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPsBCyADQQA2AgAgBkEBaiEBQQwMJwtBtQEhAiABIARGDfkBIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQerUAGotAABHDSYgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPoBCyADQQA2AgAgBkEBaiEBQQMMJgtBtAEhAiABIARGDfgBIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQejUAGotAABHDSUgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPkBCyADQQA2AgAgBkEBaiEBQSYMJQsgASAERgRAQbMBIQIM+AELAkACQCABLQAAQdQAaw4CAAEnCyABQQFqIQFBmQEhAgzfAQsgAUEBaiEBQZoBIQIM3gELQbIBIQIgASAERg32ASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHm1ABqLQAARw0jIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAz3AQsgA0EANgIAIAZBAWohAUEnDCMLQbEBIQIgASAERg31ASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHk1ABqLQAARw0iIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAz2AQsgA0EANgIAIAZBAWohAUEcDCILQbABIQIgASAERg30ASADKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEHe1ABqLQAARw0hIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAz1AQsgA0EANgIAIAZBAWohAUEGDCELQa8BIQIgASAERg3zASADKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEHZ1ABqLQAARw0gIABBBEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAz0AQsgA0EANgIAIAZBAWohAUEZDCALIAEgBEYEQEGuASECDPMBCwJAAkACQAJAIAEtAABBLWsOIwAkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJAEkJCQkJAIkJCQDJAsgAUEBaiEBQY4BIQIM3AELIAFBAWohAUGPASECDNsBCyABQQFqIQFBlAEhAgzaAQsgAUEBaiEBQZUBIQIM2QELQa0BIQIgASAERg3xASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHX1ABqLQAARw0eIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzyAQsgA0EANgIAIAZBAWohAUELDB4LIAEgBEYEQEGsASECDPEBCwJAAkAgAS0AAEHBAGsOAwAgASALIAFBAWohAUGQASECDNgBCyABQQFqIQFBkwEhAgzXAQsgASAERgRAQasBIQIM8AELAkACQCABLQAAQcEAaw4PAB8fHx8fHx8fHx8fHx8BHwsgAUEBaiEBQZEBIQIM1wELIAFBAWohAUGSASECDNYBCyABIARGBEBBqgEhAgzvAQsgAS0AAEHMAEcNHCABQQFqIQFBCgwbC0GpASECIAEgBEYN7QEgAygCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABB0dQAai0AAEcNGiAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM7gELIANBADYCACAGQQFqIQFBHgwaC0GoASECIAEgBEYN7AEgAygCACIAIAQgAWtqIQUgASAAa0EGaiEGAkADQCABLQAAIABBytQAai0AAEcNGSAAQQZGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM7QELIANBADYCACAGQQFqIQFBFQwZC0GnASECIAEgBEYN6wEgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBx9QAai0AAEcNGCAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM7AELIANBADYCACAGQQFqIQFBFwwYC0GmASECIAEgBEYN6gEgAygCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABBwdQAai0AAEcNFyAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM6wELIANBADYCACAGQQFqIQFBGAwXCyABIARGBEBBpQEhAgzqAQsCQAJAIAEtAABByQBrDgcAGRkZGRkBGQsgAUEBaiEBQYsBIQIM0QELIAFBAWohAUGMASECDNABC0GkASECIAEgBEYN6AEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBptUAai0AAEcNFSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM6QELIANBADYCACAGQQFqIQFBCQwVC0GjASECIAEgBEYN5wEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBpNUAai0AAEcNFCAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM6AELIANBADYCACAGQQFqIQFBHwwUC0GiASECIAEgBEYN5gEgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBvtQAai0AAEcNEyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM5wELIANBADYCACAGQQFqIQFBAgwTC0GhASECIAEgBEYN5QEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGA0AgAS0AACAAQbzUAGotAABHDREgAEEBRg0CIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADOUBCyABIARGBEBBoAEhAgzlAQtBASABLQAAQd8ARw0RGiABQQFqIQFBhwEhAgzLAQsgA0EANgIAIAZBAWohAUGIASECDMoBC0GfASECIAEgBEYN4gEgAygCACIAIAQgAWtqIQUgASAAa0EIaiEGAkADQCABLQAAIABBhNUAai0AAEcNDyAAQQhGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM4wELIANBADYCACAGQQFqIQFBKQwPC0GeASECIAEgBEYN4QEgAygCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABBuNQAai0AAEcNDiAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM4gELIANBADYCACAGQQFqIQFBLQwOCyABIARGBEBBnQEhAgzhAQsgAS0AAEHFAEcNDiABQQFqIQFBhAEhAgzHAQsgASAERgRAQZwBIQIM4AELAkACQCABLQAAQcwAaw4IAA8PDw8PDwEPCyABQQFqIQFBggEhAgzHAQsgAUEBaiEBQYMBIQIMxgELQZsBIQIgASAERg3eASADKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEGz1ABqLQAARw0LIABBBEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzfAQsgA0EANgIAIAZBAWohAUEjDAsLQZoBIQIgASAERg3dASADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGw1ABqLQAARw0KIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzeAQsgA0EANgIAIAZBAWohAUEADAoLIAEgBEYEQEGZASECDN0BCwJAAkAgAS0AAEHIAGsOCAAMDAwMDAwBDAsgAUEBaiEBQf0AIQIMxAELIAFBAWohAUGAASECDMMBCyABIARGBEBBmAEhAgzcAQsCQAJAIAEtAABBzgBrDgMACwELCyABQQFqIQFB/gAhAgzDAQsgAUEBaiEBQf8AIQIMwgELIAEgBEYEQEGXASECDNsBCyABLQAAQdkARw0IIAFBAWohAUEIDAcLQZYBIQIgASAERg3ZASADKAIAIgAgBCABa2ohBSABIABrQQNqIQYCQANAIAEtAAAgAEGs1ABqLQAARw0GIABBA0YNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzaAQsgA0EANgIAIAZBAWohAUEFDAYLQZUBIQIgASAERg3YASADKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGm1ABqLQAARw0FIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzZAQsgA0EANgIAIAZBAWohAUEWDAULQZQBIQIgASAERg3XASADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGh1QBqLQAARw0EIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzYAQsgA0EANgIAIAZBAWohAUEQDAQLIAEgBEYEQEGTASECDNcBCwJAAkAgAS0AAEHDAGsODAAGBgYGBgYGBgYGAQYLIAFBAWohAUH5ACECDL4BCyABQQFqIQFB+gAhAgy9AQtBkgEhAiABIARGDdUBIAMoAgAiACAEIAFraiEFIAEgAGtBBWohBgJAA0AgAS0AACAAQaDUAGotAABHDQIgAEEFRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADNYBCyADQQA2AgAgBkEBaiEBQSQMAgsgA0EANgIADAILIAEgBEYEQEGRASECDNQBCyABLQAAQcwARw0BIAFBAWohAUETCzoAKSADKAIEIQAgA0EANgIEIAMgACABEC4iAA0CDAELQQAhAiADQQA2AhwgAyABNgIUIANB/h82AhAgA0EGNgIMDNEBC0H4ACECDLcBCyADQZABNgIcIAMgATYCFCADIAA2AgxBACECDM8BC0EAIQACQCADKAI4IgJFDQAgAigCQCICRQ0AIAMgAhEAACEACyAARQ0AIABBFUYNASADQQA2AhwgAyABNgIUIANBgg82AhAgA0EgNgIMQQAhAgzOAQtB9wAhAgy0AQsgA0GPATYCHCADIAE2AhQgA0HsGzYCECADQRU2AgxBACECDMwBCyABIARGBEBBjwEhAgzMAQsCQCABLQAAQSBGBEAgAUEBaiEBDAELIANBADYCHCADIAE2AhQgA0GbHzYCECADQQY2AgxBACECDMwBC0ECIQIMsgELA0AgAS0AAEEgRw0CIAQgAUEBaiIBRw0AC0GOASECDMoBCyABIARGBEBBjQEhAgzKAQsCQCABLQAAQQlrDgRKAABKAAtB9QAhAgywAQsgAy0AKUEFRgRAQfYAIQIMsAELQfQAIQIMrwELIAEgBEYEQEGMASECDMgBCyADQRA2AgggAyABNgIEDAoLIAEgBEYEQEGLASECDMcBCwJAIAEtAABBCWsOBEcAAEcAC0HzACECDK0BCyABIARHBEAgA0EQNgIIIAMgATYCBEHxACECDK0BC0GKASECDMUBCwJAIAEgBEcEQANAIAEtAABBoNAAai0AACIAQQNHBEACQCAAQQFrDgJJAAQLQfAAIQIMrwELIAQgAUEBaiIBRw0AC0GIASECDMYBC0GIASECDMUBCyADQQA2AhwgAyABNgIUIANB2yA2AhAgA0EHNgIMQQAhAgzEAQsgASAERgRAQYkBIQIMxAELAkACQAJAIAEtAABBoNIAai0AAEEBaw4DRgIAAQtB8gAhAgysAQsgA0EANgIcIAMgATYCFCADQbQSNgIQIANBBzYCDEEAIQIMxAELQeoAIQIMqgELIAEgBEcEQCABQQFqIQFB7wAhAgyqAQtBhwEhAgzCAQsgBCABIgBGBEBBhgEhAgzCAQsgAC0AACIBQS9GBEAgAEEBaiEBQe4AIQIMqQELIAFBCWsiAkEXSw0BIAAhAUEBIAJ0QZuAgARxDUEMAQsgBCABIgBGBEBBhQEhAgzBAQsgAC0AAEEvRw0AIABBAWohAQwDC0EAIQIgA0EANgIcIAMgADYCFCADQdsgNgIQIANBBzYCDAy/AQsCQAJAAkACQAJAA0AgAS0AAEGgzgBqLQAAIgBBBUcEQAJAAkAgAEEBaw4IRwUGBwgABAEIC0HrACECDK0BCyABQQFqIQFB7QAhAgysAQsgBCABQQFqIgFHDQALQYQBIQIMwwELIAFBAWoMFAsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDR4gA0HbADYCHCADIAE2AhQgAyAANgIMQQAhAgzBAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDR4gA0HdADYCHCADIAE2AhQgAyAANgIMQQAhAgzAAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDR4gA0H6ADYCHCADIAE2AhQgAyAANgIMQQAhAgy/AQsgA0EANgIcIAMgATYCFCADQfkPNgIQIANBBzYCDEEAIQIMvgELIAEgBEYEQEGDASECDL4BCwJAIAEtAABBoM4Aai0AAEEBaw4IPgQFBgAIAgMHCyABQQFqIQELQQMhAgyjAQsgAUEBagwNC0EAIQIgA0EANgIcIANB0RI2AhAgA0EHNgIMIAMgAUEBajYCFAy6AQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDRYgA0HbADYCHCADIAE2AhQgAyAANgIMQQAhAgy5AQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDRYgA0HdADYCHCADIAE2AhQgAyAANgIMQQAhAgy4AQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDRYgA0H6ADYCHCADIAE2AhQgAyAANgIMQQAhAgy3AQsgA0EANgIcIAMgATYCFCADQfkPNgIQIANBBzYCDEEAIQIMtgELQewAIQIMnAELIAEgBEYEQEGCASECDLUBCyABQQFqDAILIAEgBEYEQEGBASECDLQBCyABQQFqDAELIAEgBEYNASABQQFqCyEBQQQhAgyYAQtBgAEhAgywAQsDQCABLQAAQaDMAGotAAAiAEECRwRAIABBAUcEQEHpACECDJkBCwwxCyAEIAFBAWoiAUcNAAtB/wAhAgyvAQsgASAERgRAQf4AIQIMrwELAkAgAS0AAEEJaw43LwMGLwQGBgYGBgYGBgYGBgYGBgYGBgYFBgYCBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGAAYLIAFBAWoLIQFBBSECDJQBCyABQQFqDAYLIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0IIANB2wA2AhwgAyABNgIUIAMgADYCDEEAIQIMqwELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0IIANB3QA2AhwgAyABNgIUIAMgADYCDEEAIQIMqgELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0IIANB+gA2AhwgAyABNgIUIAMgADYCDEEAIQIMqQELIANBADYCHCADIAE2AhQgA0GNFDYCECADQQc2AgxBACECDKgBCwJAAkACQAJAA0AgAS0AAEGgygBqLQAAIgBBBUcEQAJAIABBAWsOBi4DBAUGAAYLQegAIQIMlAELIAQgAUEBaiIBRw0AC0H9ACECDKsBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNByADQdsANgIcIAMgATYCFCADIAA2AgxBACECDKoBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNByADQd0ANgIcIAMgATYCFCADIAA2AgxBACECDKkBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNByADQfoANgIcIAMgATYCFCADIAA2AgxBACECDKgBCyADQQA2AhwgAyABNgIUIANB5Ag2AhAgA0EHNgIMQQAhAgynAQsgASAERg0BIAFBAWoLIQFBBiECDIwBC0H8ACECDKQBCwJAAkACQAJAA0AgAS0AAEGgyABqLQAAIgBBBUcEQCAAQQFrDgQpAgMEBQsgBCABQQFqIgFHDQALQfsAIQIMpwELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0DIANB2wA2AhwgAyABNgIUIAMgADYCDEEAIQIMpgELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0DIANB3QA2AhwgAyABNgIUIAMgADYCDEEAIQIMpQELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0DIANB+gA2AhwgAyABNgIUIAMgADYCDEEAIQIMpAELIANBADYCHCADIAE2AhQgA0G8CjYCECADQQc2AgxBACECDKMBC0HPACECDIkBC0HRACECDIgBC0HnACECDIcBCyABIARGBEBB+gAhAgygAQsCQCABLQAAQQlrDgQgAAAgAAsgAUEBaiEBQeYAIQIMhgELIAEgBEYEQEH5ACECDJ8BCwJAIAEtAABBCWsOBB8AAB8AC0EAIQACQCADKAI4IgJFDQAgAigCOCICRQ0AIAMgAhEAACEACyAARQRAQeIBIQIMhgELIABBFUcEQCADQQA2AhwgAyABNgIUIANByQ02AhAgA0EaNgIMQQAhAgyfAQsgA0H4ADYCHCADIAE2AhQgA0HqGjYCECADQRU2AgxBACECDJ4BCyABIARHBEAgA0ENNgIIIAMgATYCBEHkACECDIUBC0H3ACECDJ0BCyABIARGBEBB9gAhAgydAQsCQAJAAkAgAS0AAEHIAGsOCwABCwsLCwsLCwsCCwsgAUEBaiEBQd0AIQIMhQELIAFBAWohAUHgACECDIQBCyABQQFqIQFB4wAhAgyDAQtB9QAhAiABIARGDZsBIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQbXVAGotAABHDQggAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJwBCyADKAIEIQAgA0IANwMAIAMgACAGQQFqIgEQKyIABEAgA0H0ADYCHCADIAE2AhQgAyAANgIMQQAhAgycAQtB4gAhAgyCAQtBACEAAkAgAygCOCICRQ0AIAIoAjQiAkUNACADIAIRAAAhAAsCQCAABEAgAEEVRg0BIANBADYCHCADIAE2AhQgA0HqDTYCECADQSY2AgxBACECDJwBC0HhACECDIIBCyADQfMANgIcIAMgATYCFCADQYAbNgIQIANBFTYCDEEAIQIMmgELIAMtACkiAEEja0ELSQ0JAkAgAEEGSw0AQQEgAHRBygBxRQ0ADAoLQQAhAiADQQA2AhwgAyABNgIUIANB7Qk2AhAgA0EINgIMDJkBC0HyACECIAEgBEYNmAEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBs9UAai0AAEcNBSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMmQELIAMoAgQhACADQgA3AwAgAyAAIAZBAWoiARArIgAEQCADQfEANgIcIAMgATYCFCADIAA2AgxBACECDJkBC0HfACECDH8LQQAhAAJAIAMoAjgiAkUNACACKAI0IgJFDQAgAyACEQAAIQALAkAgAARAIABBFUYNASADQQA2AhwgAyABNgIUIANB6g02AhAgA0EmNgIMQQAhAgyZAQtB3gAhAgx/CyADQfAANgIcIAMgATYCFCADQYAbNgIQIANBFTYCDEEAIQIMlwELIAMtAClBIUYNBiADQQA2AhwgAyABNgIUIANBkQo2AhAgA0EINgIMQQAhAgyWAQtB7wAhAiABIARGDZUBIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQbDVAGotAABHDQIgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJYBCyADKAIEIQAgA0IANwMAIAMgACAGQQFqIgEQKyIARQ0CIANB7QA2AhwgAyABNgIUIAMgADYCDEEAIQIMlQELIANBADYCAAsgAygCBCEAIANBADYCBCADIAAgARArIgBFDYABIANB7gA2AhwgAyABNgIUIAMgADYCDEEAIQIMkwELQdwAIQIMeQtBACEAAkAgAygCOCICRQ0AIAIoAjQiAkUNACADIAIRAAAhAAsCQCAABEAgAEEVRg0BIANBADYCHCADIAE2AhQgA0HqDTYCECADQSY2AgxBACECDJMBC0HbACECDHkLIANB7AA2AhwgAyABNgIUIANBgBs2AhAgA0EVNgIMQQAhAgyRAQsgAy0AKSIAQSNJDQAgAEEuRg0AIANBADYCHCADIAE2AhQgA0HJCTYCECADQQg2AgxBACECDJABC0HaACECDHYLIAEgBEYEQEHrACECDI8BCwJAIAEtAABBL0YEQCABQQFqIQEMAQsgA0EANgIcIAMgATYCFCADQbI4NgIQIANBCDYCDEEAIQIMjwELQdkAIQIMdQsgASAERwRAIANBDjYCCCADIAE2AgRB2AAhAgx1C0HqACECDI0BCyABIARGBEBB6QAhAgyNAQsgAS0AAEEwayIAQf8BcUEKSQRAIAMgADoAKiABQQFqIQFB1wAhAgx0CyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNeiADQegANgIcIAMgATYCFCADIAA2AgxBACECDIwBCyABIARGBEBB5wAhAgyMAQsCQCABLQAAQS5GBEAgAUEBaiEBDAELIAMoAgQhACADQQA2AgQgAyAAIAEQLyIARQ17IANB5gA2AhwgAyABNgIUIAMgADYCDEEAIQIMjAELQdYAIQIMcgsgASAERgRAQeUAIQIMiwELQQAhAEEBIQVBASEHQQAhAgJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAIAEtAABBMGsOCgoJAAECAwQFBggLC0ECDAYLQQMMBQtBBAwEC0EFDAMLQQYMAgtBBwwBC0EICyECQQAhBUEAIQcMAgtBCSECQQEhAEEAIQVBACEHDAELQQAhBUEBIQILIAMgAjoAKyABQQFqIQECQAJAIAMtAC5BEHENAAJAAkACQCADLQAqDgMBAAIECyAHRQ0DDAILIAANAQwCCyAFRQ0BCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNAiADQeIANgIcIAMgATYCFCADIAA2AgxBACECDI0BCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNfSADQeMANgIcIAMgATYCFCADIAA2AgxBACECDIwBCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNeyADQeQANgIcIAMgATYCFCADIAA2AgwMiwELQdQAIQIMcQsgAy0AKUEiRg2GAUHTACECDHALQQAhAAJAIAMoAjgiAkUNACACKAJEIgJFDQAgAyACEQAAIQALIABFBEBB1QAhAgxwCyAAQRVHBEAgA0EANgIcIAMgATYCFCADQaQNNgIQIANBITYCDEEAIQIMiQELIANB4QA2AhwgAyABNgIUIANB0Bo2AhAgA0EVNgIMQQAhAgyIAQsgASAERgRAQeAAIQIMiAELAkACQAJAAkACQCABLQAAQQprDgQBBAQABAsgAUEBaiEBDAELIAFBAWohASADQS9qLQAAQQFxRQ0BC0HSACECDHALIANBADYCHCADIAE2AhQgA0G2ETYCECADQQk2AgxBACECDIgBCyADQQA2AhwgAyABNgIUIANBthE2AhAgA0EJNgIMQQAhAgyHAQsgASAERgRAQd8AIQIMhwELIAEtAABBCkYEQCABQQFqIQEMCQsgAy0ALkHAAHENCCADQQA2AhwgAyABNgIUIANBthE2AhAgA0ECNgIMQQAhAgyGAQsgASAERgRAQd0AIQIMhgELIAEtAAAiAkENRgRAIAFBAWohAUHQACECDG0LIAEhACACQQlrDgQFAQEFAQsgBCABIgBGBEBB3AAhAgyFAQsgAC0AAEEKRw0AIABBAWoMAgtBACECIANBADYCHCADIAA2AhQgA0HKLTYCECADQQc2AgwMgwELIAEgBEYEQEHbACECDIMBCwJAIAEtAABBCWsOBAMAAAMACyABQQFqCyEBQc4AIQIMaAsgASAERgRAQdoAIQIMgQELIAEtAABBCWsOBAABAQABC0EAIQIgA0EANgIcIANBmhI2AhAgA0EHNgIMIAMgAUEBajYCFAx/CyADQYASOwEqQQAhAAJAIAMoAjgiAkUNACACKAI4IgJFDQAgAyACEQAAIQALIABFDQAgAEEVRw0BIANB2QA2AhwgAyABNgIUIANB6ho2AhAgA0EVNgIMQQAhAgx+C0HNACECDGQLIANBADYCHCADIAE2AhQgA0HJDTYCECADQRo2AgxBACECDHwLIAEgBEYEQEHZACECDHwLIAEtAABBIEcNPSABQQFqIQEgAy0ALkEBcQ09IANBADYCHCADIAE2AhQgA0HCHDYCECADQR42AgxBACECDHsLIAEgBEYEQEHYACECDHsLAkACQAJAAkACQCABLQAAIgBBCmsOBAIDAwABCyABQQFqIQFBLCECDGULIABBOkcNASADQQA2AhwgAyABNgIUIANB5xE2AhAgA0EKNgIMQQAhAgx9CyABQQFqIQEgA0Evai0AAEEBcUUNcyADLQAyQYABcUUEQCADQTJqIQIgAxA1QQAhAAJAIAMoAjgiBkUNACAGKAIoIgZFDQAgAyAGEQAAIQALAkACQCAADhZNTEsBAQEBAQEBAQEBAQEBAQEBAQEAAQsgA0EpNgIcIAMgATYCFCADQawZNgIQIANBFTYCDEEAIQIMfgsgA0EANgIcIAMgATYCFCADQeULNgIQIANBETYCDEEAIQIMfQtBACEAAkAgAygCOCICRQ0AIAIoAlwiAkUNACADIAIRAAAhAAsgAEUNWSAAQRVHDQEgA0EFNgIcIAMgATYCFCADQZsbNgIQIANBFTYCDEEAIQIMfAtBywAhAgxiC0EAIQIgA0EANgIcIAMgATYCFCADQZAONgIQIANBFDYCDAx6CyADIAMvATJBgAFyOwEyDDsLIAEgBEcEQCADQRE2AgggAyABNgIEQcoAIQIMYAtB1wAhAgx4CyABIARGBEBB1gAhAgx4CwJAAkACQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxQeMAaw4TAEBAQEBAQEBAQEBAQAFAQEACA0ALIAFBAWohAUHGACECDGELIAFBAWohAUHHACECDGALIAFBAWohAUHIACECDF8LIAFBAWohAUHJACECDF4LQdUAIQIgBCABIgBGDXYgBCABayADKAIAIgFqIQYgACABa0EFaiEHA0AgAUGQyABqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0IQQQgAUEFRg0KGiABQQFqIQEgBCAAQQFqIgBHDQALIAMgBjYCAAx2C0HUACECIAQgASIARg11IAQgAWsgAygCACIBaiEGIAAgAWtBD2ohBwNAIAFBgMgAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNB0EDIAFBD0YNCRogAUEBaiEBIAQgAEEBaiIARw0ACyADIAY2AgAMdQtB0wAhAiAEIAEiAEYNdCAEIAFrIAMoAgAiAWohBiAAIAFrQQ5qIQcDQCABQeLHAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQYgAUEORg0HIAFBAWohASAEIABBAWoiAEcNAAsgAyAGNgIADHQLQdIAIQIgBCABIgBGDXMgBCABayADKAIAIgFqIQUgACABa0EBaiEGA0AgAUHgxwBqLQAAIAAtAAAiB0EgciAHIAdBwQBrQf8BcUEaSRtB/wFxRw0FIAFBAUYNAiABQQFqIQEgBCAAQQFqIgBHDQALIAMgBTYCAAxzCyABIARGBEBB0QAhAgxzCwJAAkAgAS0AACIAQSByIAAgAEHBAGtB/wFxQRpJG0H/AXFB7gBrDgcAOTk5OTkBOQsgAUEBaiEBQcMAIQIMWgsgAUEBaiEBQcQAIQIMWQsgA0EANgIAIAZBAWohAUHFACECDFgLQdAAIQIgBCABIgBGDXAgBCABayADKAIAIgFqIQYgACABa0EJaiEHA0AgAUHWxwBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0CQQIgAUEJRg0EGiABQQFqIQEgBCAAQQFqIgBHDQALIAMgBjYCAAxwC0HPACECIAQgASIARg1vIAQgAWsgAygCACIBaiEGIAAgAWtBBWohBwNAIAFB0McAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNASABQQVGDQIgAUEBaiEBIAQgAEEBaiIARw0ACyADIAY2AgAMbwsgACEBIANBADYCAAwzC0EBCzoALCADQQA2AgAgB0EBaiEBC0EtIQIMUgsCQANAIAEtAABB0MUAai0AAEEBRw0BIAQgAUEBaiIBRw0AC0HNACECDGsLQcIAIQIMUQsgASAERgRAQcwAIQIMagsgAS0AAEE6RgRAIAMoAgQhACADQQA2AgQgAyAAIAEQMCIARQ0zIANBywA2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIMagsgA0EANgIcIAMgATYCFCADQecRNgIQIANBCjYCDEEAIQIMaQsCQAJAIAMtACxBAmsOAgABJwsgA0Ezai0AAEECcUUNJiADLQAuQQJxDSYgA0EANgIcIAMgATYCFCADQaYUNgIQIANBCzYCDEEAIQIMaQsgAy0AMkEgcUUNJSADLQAuQQJxDSUgA0EANgIcIAMgATYCFCADQb0TNgIQIANBDzYCDEEAIQIMaAtBACEAAkAgAygCOCICRQ0AIAIoAkgiAkUNACADIAIRAAAhAAsgAEUEQEHBACECDE8LIABBFUcEQCADQQA2AhwgAyABNgIUIANBpg82AhAgA0EcNgIMQQAhAgxoCyADQcoANgIcIAMgATYCFCADQYUcNgIQIANBFTYCDEEAIQIMZwsgASAERwRAA0AgAS0AAEHAwQBqLQAAQQFHDRcgBCABQQFqIgFHDQALQcQAIQIMZwtBxAAhAgxmCyABIARHBEADQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxIgBBCUYNACAAQSBGDQACQAJAAkACQCAAQeMAaw4TAAMDAwMDAwMBAwMDAwMDAwMDAgMLIAFBAWohAUE2IQIMUgsgAUEBaiEBQTchAgxRCyABQQFqIQFBOCECDFALDBULIAQgAUEBaiIBRw0AC0E8IQIMZgtBPCECDGULIAEgBEYEQEHIACECDGULIANBEjYCCCADIAE2AgQCQAJAAkACQAJAIAMtACxBAWsOBBQAAQIJCyADLQAyQSBxDQNB4AEhAgxPCwJAIAMvATIiAEEIcUUNACADLQAoQQFHDQAgAy0ALkEIcUUNAgsgAyAAQff7A3FBgARyOwEyDAsLIAMgAy8BMkEQcjsBMgwECyADQQA2AgQgAyABIAEQMSIABEAgA0HBADYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgxmCyABQQFqIQEMWAsgA0EANgIcIAMgATYCFCADQfQTNgIQIANBBDYCDEEAIQIMZAtBxwAhAiABIARGDWMgAygCACIAIAQgAWtqIQUgASAAa0EGaiEGAkADQCAAQcDFAGotAAAgAS0AAEEgckcNASAAQQZGDUogAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMZAsgA0EANgIADAULAkAgASAERwRAA0AgAS0AAEHAwwBqLQAAIgBBAUcEQCAAQQJHDQMgAUEBaiEBDAULIAQgAUEBaiIBRw0AC0HFACECDGQLQcUAIQIMYwsLIANBADoALAwBC0ELIQIMRwtBPyECDEYLAkACQANAIAEtAAAiAEEgRwRAAkAgAEEKaw4EAwUFAwALIABBLEYNAwwECyAEIAFBAWoiAUcNAAtBxgAhAgxgCyADQQg6ACwMDgsgAy0AKEEBRw0CIAMtAC5BCHENAiADKAIEIQAgA0EANgIEIAMgACABEDEiAARAIANBwgA2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIMXwsgAUEBaiEBDFALQTshAgxECwJAA0AgAS0AACIAQSBHIABBCUdxDQEgBCABQQFqIgFHDQALQcMAIQIMXQsLQTwhAgxCCwJAAkAgASAERwRAA0AgAS0AACIAQSBHBEAgAEEKaw4EAwQEAwQLIAQgAUEBaiIBRw0AC0E/IQIMXQtBPyECDFwLIAMgAy8BMkEgcjsBMgwKCyADKAIEIQAgA0EANgIEIAMgACABEDEiAEUNTiADQT42AhwgAyABNgIUIAMgADYCDEEAIQIMWgsCQCABIARHBEADQCABLQAAQcDDAGotAAAiAEEBRwRAIABBAkYNAwwMCyAEIAFBAWoiAUcNAAtBNyECDFsLQTchAgxaCyABQQFqIQEMBAtBOyECIAQgASIARg1YIAQgAWsgAygCACIBaiEGIAAgAWtBBWohBwJAA0AgAUGQyABqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBBUYEQEEHIQEMPwsgAUEBaiEBIAQgAEEBaiIARw0ACyADIAY2AgAMWQsgA0EANgIAIAAhAQwFC0E6IQIgBCABIgBGDVcgBCABayADKAIAIgFqIQYgACABa0EIaiEHAkADQCABQbTBAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQEgAUEIRgRAQQUhAQw+CyABQQFqIQEgBCAAQQFqIgBHDQALIAMgBjYCAAxYCyADQQA2AgAgACEBDAQLQTkhAiAEIAEiAEYNViAEIAFrIAMoAgAiAWohBiAAIAFrQQNqIQcCQANAIAFBsMEAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNASABQQNGBEBBBiEBDD0LIAFBAWohASAEIABBAWoiAEcNAAsgAyAGNgIADFcLIANBADYCACAAIQEMAwsCQANAIAEtAAAiAEEgRwRAIABBCmsOBAcEBAcCCyAEIAFBAWoiAUcNAAtBOCECDFYLIABBLEcNASABQQFqIQBBASEBAkACQAJAAkACQCADLQAsQQVrDgQDAQIEAAsgACEBDAQLQQIhAQwBC0EEIQELIANBAToALCADIAMvATIgAXI7ATIgACEBDAELIAMgAy8BMkEIcjsBMiAAIQELQT4hAgw7CyADQQA6ACwLQTkhAgw5CyABIARGBEBBNiECDFILAkACQAJAAkACQCABLQAAQQprDgQAAgIBAgsgAygCBCEAIANBADYCBCADIAAgARAxIgBFDQIgA0EzNgIcIAMgATYCFCADIAA2AgxBACECDFULIAMoAgQhACADQQA2AgQgAyAAIAEQMSIARQRAIAFBAWohAQwGCyADQTI2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIMVAsgAy0ALkEBcQRAQd8BIQIMOwsgAygCBCEAIANBADYCBCADIAAgARAxIgANAQxJC0E0IQIMOQsgA0E1NgIcIAMgATYCFCADIAA2AgxBACECDFELQTUhAgw3CyADQS9qLQAAQQFxDQAgA0EANgIcIAMgATYCFCADQesWNgIQIANBGTYCDEEAIQIMTwtBMyECDDULIAEgBEYEQEEyIQIMTgsCQCABLQAAQQpGBEAgAUEBaiEBDAELIANBADYCHCADIAE2AhQgA0GSFzYCECADQQM2AgxBACECDE4LQTIhAgw0CyABIARGBEBBMSECDE0LAkAgAS0AACIAQQlGDQAgAEEgRg0AQQEhAgJAIAMtACxBBWsOBAYEBQANCyADIAMvATJBCHI7ATIMDAsgAy0ALkEBcUUNASADLQAsQQhHDQAgA0EAOgAsC0E9IQIMMgsgA0EANgIcIAMgATYCFCADQcIWNgIQIANBCjYCDEEAIQIMSgtBAiECDAELQQQhAgsgA0EBOgAsIAMgAy8BMiACcjsBMgwGCyABIARGBEBBMCECDEcLIAEtAABBCkYEQCABQQFqIQEMAQsgAy0ALkEBcQ0AIANBADYCHCADIAE2AhQgA0HcKDYCECADQQI2AgxBACECDEYLQTAhAgwsCyABQQFqIQFBMSECDCsLIAEgBEYEQEEvIQIMRAsgAS0AACIAQQlHIABBIEdxRQRAIAFBAWohASADLQAuQQFxDQEgA0EANgIcIAMgATYCFCADQZcQNgIQIANBCjYCDEEAIQIMRAtBASECAkACQAJAAkACQAJAIAMtACxBAmsOBwUEBAMBAgAECyADIAMvATJBCHI7ATIMAwtBAiECDAELQQQhAgsgA0EBOgAsIAMgAy8BMiACcjsBMgtBLyECDCsLIANBADYCHCADIAE2AhQgA0GEEzYCECADQQs2AgxBACECDEMLQeEBIQIMKQsgASAERgRAQS4hAgxCCyADQQA2AgQgA0ESNgIIIAMgASABEDEiAA0BC0EuIQIMJwsgA0EtNgIcIAMgATYCFCADIAA2AgxBACECDD8LQQAhAAJAIAMoAjgiAkUNACACKAJMIgJFDQAgAyACEQAAIQALIABFDQAgAEEVRw0BIANB2AA2AhwgAyABNgIUIANBsxs2AhAgA0EVNgIMQQAhAgw+C0HMACECDCQLIANBADYCHCADIAE2AhQgA0GzDjYCECADQR02AgxBACECDDwLIAEgBEYEQEHOACECDDwLIAEtAAAiAEEgRg0CIABBOkYNAQsgA0EAOgAsQQkhAgwhCyADKAIEIQAgA0EANgIEIAMgACABEDAiAA0BDAILIAMtAC5BAXEEQEHeASECDCALIAMoAgQhACADQQA2AgQgAyAAIAEQMCIARQ0CIANBKjYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgw4CyADQcsANgIcIAMgADYCDCADIAFBAWo2AhRBACECDDcLIAFBAWohAUHAACECDB0LIAFBAWohAQwsCyABIARGBEBBKyECDDULAkAgAS0AAEEKRgRAIAFBAWohAQwBCyADLQAuQcAAcUUNBgsgAy0AMkGAAXEEQEEAIQACQCADKAI4IgJFDQAgAigCXCICRQ0AIAMgAhEAACEACyAARQ0SIABBFUYEQCADQQU2AhwgAyABNgIUIANBmxs2AhAgA0EVNgIMQQAhAgw2CyADQQA2AhwgAyABNgIUIANBkA42AhAgA0EUNgIMQQAhAgw1CyADQTJqIQIgAxA1QQAhAAJAIAMoAjgiBkUNACAGKAIoIgZFDQAgAyAGEQAAIQALIAAOFgIBAAQEBAQEBAQEBAQEBAQEBAQEBAMECyADQQE6ADALIAIgAi8BAEHAAHI7AQALQSshAgwYCyADQSk2AhwgAyABNgIUIANBrBk2AhAgA0EVNgIMQQAhAgwwCyADQQA2AhwgAyABNgIUIANB5Qs2AhAgA0ERNgIMQQAhAgwvCyADQQA2AhwgAyABNgIUIANBpQs2AhAgA0ECNgIMQQAhAgwuC0EBIQcgAy8BMiIFQQhxRQRAIAMpAyBCAFIhBwsCQCADLQAwBEBBASEAIAMtAClBBUYNASAFQcAAcUUgB3FFDQELAkAgAy0AKCICQQJGBEBBASEAIAMvATQiBkHlAEYNAkEAIQAgBUHAAHENAiAGQeQARg0CIAZB5gBrQQJJDQIgBkHMAUYNAiAGQbACRg0CDAELQQAhACAFQcAAcQ0BC0ECIQAgBUEIcQ0AIAVBgARxBEACQCACQQFHDQAgAy0ALkEKcQ0AQQUhAAwCC0EEIQAMAQsgBUEgcUUEQCADEDZBAEdBAnQhAAwBC0EAQQMgAykDIFAbIQALIABBAWsOBQIABwEDBAtBESECDBMLIANBAToAMQwpC0EAIQICQCADKAI4IgBFDQAgACgCMCIARQ0AIAMgABEAACECCyACRQ0mIAJBFUYEQCADQQM2AhwgAyABNgIUIANB0hs2AhAgA0EVNgIMQQAhAgwrC0EAIQIgA0EANgIcIAMgATYCFCADQd0ONgIQIANBEjYCDAwqCyADQQA2AhwgAyABNgIUIANB+SA2AhAgA0EPNgIMQQAhAgwpC0EAIQACQCADKAI4IgJFDQAgAigCMCICRQ0AIAMgAhEAACEACyAADQELQQ4hAgwOCyAAQRVGBEAgA0ECNgIcIAMgATYCFCADQdIbNgIQIANBFTYCDEEAIQIMJwsgA0EANgIcIAMgATYCFCADQd0ONgIQIANBEjYCDEEAIQIMJgtBKiECDAwLIAEgBEcEQCADQQk2AgggAyABNgIEQSkhAgwMC0EmIQIMJAsgAyADKQMgIgwgBCABa60iCn0iC0IAIAsgDFgbNwMgIAogDFQEQEElIQIMJAsgAygCBCEAIANBADYCBCADIAAgASAMp2oiARAyIgBFDQAgA0EFNgIcIAMgATYCFCADIAA2AgxBACECDCMLQQ8hAgwJC0IAIQoCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAS0AAEEwaw43FxYAAQIDBAUGBxQUFBQUFBQICQoLDA0UFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFA4PEBESExQLQgIhCgwWC0IDIQoMFQtCBCEKDBQLQgUhCgwTC0IGIQoMEgtCByEKDBELQgghCgwQC0IJIQoMDwtCCiEKDA4LQgshCgwNC0IMIQoMDAtCDSEKDAsLQg4hCgwKC0IPIQoMCQtCCiEKDAgLQgshCgwHC0IMIQoMBgtCDSEKDAULQg4hCgwEC0IPIQoMAwsgA0EANgIcIAMgATYCFCADQZ8VNgIQIANBDDYCDEEAIQIMIQsgASAERgRAQSIhAgwhC0IAIQoCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAEtAABBMGsONxUUAAECAwQFBgcWFhYWFhYWCAkKCwwNFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYODxAREhMWC0ICIQoMFAtCAyEKDBMLQgQhCgwSC0IFIQoMEQtCBiEKDBALQgchCgwPC0IIIQoMDgtCCSEKDA0LQgohCgwMC0ILIQoMCwtCDCEKDAoLQg0hCgwJC0IOIQoMCAtCDyEKDAcLQgohCgwGC0ILIQoMBQtCDCEKDAQLQg0hCgwDC0IOIQoMAgtCDyEKDAELQgEhCgsgAUEBaiEBIAMpAyAiC0L//////////w9YBEAgAyALQgSGIAqENwMgDAILIANBADYCHCADIAE2AhQgA0G1CTYCECADQQw2AgxBACECDB4LQSchAgwEC0EoIQIMAwsgAyABOgAsIANBADYCACAHQQFqIQFBDCECDAILIANBADYCACAGQQFqIQFBCiECDAELIAFBAWohAUEIIQIMAAsAC0EAIQIgA0EANgIcIAMgATYCFCADQbI4NgIQIANBCDYCDAwXC0EAIQIgA0EANgIcIAMgATYCFCADQYMRNgIQIANBCTYCDAwWC0EAIQIgA0EANgIcIAMgATYCFCADQd8KNgIQIANBCTYCDAwVC0EAIQIgA0EANgIcIAMgATYCFCADQe0QNgIQIANBCTYCDAwUC0EAIQIgA0EANgIcIAMgATYCFCADQdIRNgIQIANBCTYCDAwTC0EAIQIgA0EANgIcIAMgATYCFCADQbI4NgIQIANBCDYCDAwSC0EAIQIgA0EANgIcIAMgATYCFCADQYMRNgIQIANBCTYCDAwRC0EAIQIgA0EANgIcIAMgATYCFCADQd8KNgIQIANBCTYCDAwQC0EAIQIgA0EANgIcIAMgATYCFCADQe0QNgIQIANBCTYCDAwPC0EAIQIgA0EANgIcIAMgATYCFCADQdIRNgIQIANBCTYCDAwOC0EAIQIgA0EANgIcIAMgATYCFCADQbkXNgIQIANBDzYCDAwNC0EAIQIgA0EANgIcIAMgATYCFCADQbkXNgIQIANBDzYCDAwMC0EAIQIgA0EANgIcIAMgATYCFCADQZkTNgIQIANBCzYCDAwLC0EAIQIgA0EANgIcIAMgATYCFCADQZ0JNgIQIANBCzYCDAwKC0EAIQIgA0EANgIcIAMgATYCFCADQZcQNgIQIANBCjYCDAwJC0EAIQIgA0EANgIcIAMgATYCFCADQbEQNgIQIANBCjYCDAwIC0EAIQIgA0EANgIcIAMgATYCFCADQbsdNgIQIANBAjYCDAwHC0EAIQIgA0EANgIcIAMgATYCFCADQZYWNgIQIANBAjYCDAwGC0EAIQIgA0EANgIcIAMgATYCFCADQfkYNgIQIANBAjYCDAwFC0EAIQIgA0EANgIcIAMgATYCFCADQcQYNgIQIANBAjYCDAwECyADQQI2AhwgAyABNgIUIANBqR42AhAgA0EWNgIMQQAhAgwDC0HeACECIAEgBEYNAiAJQQhqIQcgAygCACEFAkACQCABIARHBEAgBUGWyABqIQggBCAFaiABayEGIAVBf3NBCmoiBSABaiEAA0AgAS0AACAILQAARwRAQQIhCAwDCyAFRQRAQQAhCCAAIQEMAwsgBUEBayEFIAhBAWohCCAEIAFBAWoiAUcNAAsgBiEFIAQhAQsgB0EBNgIAIAMgBTYCAAwBCyADQQA2AgAgByAINgIACyAHIAE2AgQgCSgCDCEAAkACQCAJKAIIQQFrDgIEAQALIANBADYCHCADQcIeNgIQIANBFzYCDCADIABBAWo2AhRBACECDAMLIANBADYCHCADIAA2AhQgA0HXHjYCECADQQk2AgxBACECDAILIAEgBEYEQEEoIQIMAgsgA0EJNgIIIAMgATYCBEEnIQIMAQsgASAERgRAQQEhAgwBCwNAAkACQAJAIAEtAABBCmsOBAABAQABCyABQQFqIQEMAQsgAUEBaiEBIAMtAC5BIHENAEEAIQIgA0EANgIcIAMgATYCFCADQaEhNgIQIANBBTYCDAwCC0EBIQIgASAERw0ACwsgCUEQaiQAIAJFBEAgAygCDCEADAELIAMgAjYCHEEAIQAgAygCBCIBRQ0AIAMgASAEIAMoAggRAQAiAUUNACADIAQ2AhQgAyABNgIMIAEhAAsgAAu+AgECfyAAQQA6AAAgAEHkAGoiAUEBa0EAOgAAIABBADoAAiAAQQA6AAEgAUEDa0EAOgAAIAFBAmtBADoAACAAQQA6AAMgAUEEa0EAOgAAQQAgAGtBA3EiASAAaiIAQQA2AgBB5AAgAWtBfHEiAiAAaiIBQQRrQQA2AgACQCACQQlJDQAgAEEANgIIIABBADYCBCABQQhrQQA2AgAgAUEMa0EANgIAIAJBGUkNACAAQQA2AhggAEEANgIUIABBADYCECAAQQA2AgwgAUEQa0EANgIAIAFBFGtBADYCACABQRhrQQA2AgAgAUEca0EANgIAIAIgAEEEcUEYciICayIBQSBJDQAgACACaiEAA0AgAEIANwMYIABCADcDECAAQgA3AwggAEIANwMAIABBIGohACABQSBrIgFBH0sNAAsLC1YBAX8CQCAAKAIMDQACQAJAAkACQCAALQAxDgMBAAMCCyAAKAI4IgFFDQAgASgCMCIBRQ0AIAAgAREAACIBDQMLQQAPCwALIABByhk2AhBBDiEBCyABCxoAIAAoAgxFBEAgAEHeHzYCECAAQRU2AgwLCxQAIAAoAgxBFUYEQCAAQQA2AgwLCxQAIAAoAgxBFkYEQCAAQQA2AgwLCwcAIAAoAgwLBwAgACgCEAsJACAAIAE2AhALBwAgACgCFAsrAAJAIABBJ08NAEL//////wkgAK2IQgGDUA0AIABBAnRB0DhqKAIADwsACxcAIABBL08EQAALIABBAnRB7DlqKAIAC78JAQF/QfQtIQECQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAAQeQAaw70A2NiAAFhYWFhYWECAwQFYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYQYHCAkKCwwNDg9hYWFhYRBhYWFhYWFhYWFhYRFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWESExQVFhcYGRobYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYRwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1NmE3ODk6YWFhYWFhYWE7YWFhPGFhYWE9Pj9hYWFhYWFhYUBhYUFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFCQ0RFRkdISUpLTE1OT1BRUlNhYWFhYWFhYVRVVldYWVpbYVxdYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhXmFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYV9gYQtB6iwPC0GYJg8LQe0xDwtBoDcPC0HJKQ8LQbQpDwtBli0PC0HrKw8LQaI1DwtB2zQPC0HgKQ8LQeMkDwtB1SQPC0HuJA8LQeYlDwtByjQPC0HQNw8LQao1DwtB9SwPC0H2Jg8LQYIiDwtB8jMPC0G+KA8LQec3DwtBzSEPC0HAIQ8LQbglDwtByyUPC0GWJA8LQY80DwtBzTUPC0HdKg8LQe4zDwtBnDQPC0GeMQ8LQfQ1DwtB5SIPC0GvJQ8LQZkxDwtBsjYPC0H5Ng8LQcQyDwtB3SwPC0GCMQ8LQcExDwtBjTcPC0HJJA8LQew2DwtB5yoPC0HIIw8LQeIhDwtByTcPC0GlIg8LQZQiDwtB2zYPC0HeNQ8LQYYmDwtBvCsPC0GLMg8LQaAjDwtB9jAPC0GALA8LQYkrDwtBpCYPC0HyIw8LQYEoDwtBqzIPC0HrJw8LQcI2DwtBoiQPC0HPKg8LQdwjDwtBhycPC0HkNA8LQbciDwtBrTEPC0HVIg8LQa80DwtB3iYPC0HWMg8LQfQ0DwtBgTgPC0H0Nw8LQZI2DwtBnScPC0GCKQ8LQY0jDwtB1zEPC0G9NQ8LQbQ3DwtB2DAPC0G2Jw8LQZo4DwtBpyoPC0HEJw8LQa4jDwtB9SIPCwALQcomIQELIAELFwAgACAALwEuQf7/A3EgAUEAR3I7AS4LGgAgACAALwEuQf3/A3EgAUEAR0EBdHI7AS4LGgAgACAALwEuQfv/A3EgAUEAR0ECdHI7AS4LGgAgACAALwEuQff/A3EgAUEAR0EDdHI7AS4LGgAgACAALwEuQe//A3EgAUEAR0EEdHI7AS4LGgAgACAALwEuQd//A3EgAUEAR0EFdHI7AS4LGgAgACAALwEuQb//A3EgAUEAR0EGdHI7AS4LGgAgACAALwEuQf/+A3EgAUEAR0EHdHI7AS4LGgAgACAALwEuQf/9A3EgAUEAR0EIdHI7AS4LGgAgACAALwEuQf/7A3EgAUEAR0EJdHI7AS4LPgECfwJAIAAoAjgiA0UNACADKAIEIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEHhEjYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIIIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEH8ETYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIMIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEHsCjYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIQIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEH6HjYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIUIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEHLEDYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIYIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEG3HzYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIcIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEG/FTYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIsIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEH+CDYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIgIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEGMHTYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIkIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEHmFTYCEEEYIQQLIAQLOAAgAAJ/IAAvATJBFHFBFEYEQEEBIAAtAChBAUYNARogAC8BNEHlAEYMAQsgAC0AKUEFRgs6ADALWQECfwJAIAAtAChBAUYNACAALwE0IgFB5ABrQeQASQ0AIAFBzAFGDQAgAUGwAkYNACAALwEyIgBBwABxDQBBASECIABBiARxQYAERg0AIABBKHFFIQILIAILjAEBAn8CQAJAAkAgAC0AKkUNACAALQArRQ0AIAAvATIiAUECcUUNAQwCCyAALwEyIgFBAXFFDQELQQEhAiAALQAoQQFGDQAgAC8BNCIAQeQAa0HkAEkNACAAQcwBRg0AIABBsAJGDQAgAUHAAHENAEEAIQIgAUGIBHFBgARGDQAgAUEocUEARyECCyACC1cAIABBGGpCADcDACAAQgA3AwAgAEE4akIANwMAIABBMGpCADcDACAAQShqQgA3AwAgAEEgakIANwMAIABBEGpCADcDACAAQQhqQgA3AwAgAEH9ATYCHAsGACAAEDoLmi0BC38jAEEQayIKJABB3NUAKAIAIglFBEBBnNkAKAIAIgVFBEBBqNkAQn83AgBBoNkAQoCAhICAgMAANwIAQZzZACAKQQhqQXBxQdiq1aoFcyIFNgIAQbDZAEEANgIAQYDZAEEANgIAC0GE2QBBwNkENgIAQdTVAEHA2QQ2AgBB6NUAIAU2AgBB5NUAQX82AgBBiNkAQcCmAzYCAANAIAFBgNYAaiABQfTVAGoiAjYCACACIAFB7NUAaiIDNgIAIAFB+NUAaiADNgIAIAFBiNYAaiABQfzVAGoiAzYCACADIAI2AgAgAUGQ1gBqIAFBhNYAaiICNgIAIAIgAzYCACABQYzWAGogAjYCACABQSBqIgFBgAJHDQALQczZBEGBpgM2AgBB4NUAQazZACgCADYCAEHQ1QBBgKYDNgIAQdzVAEHI2QQ2AgBBzP8HQTg2AgBByNkEIQkLAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAEHsAU0EQEHE1QAoAgAiBkEQIABBE2pBcHEgAEELSRsiBEEDdiIAdiIBQQNxBEACQCABQQFxIAByQQFzIgJBA3QiAEHs1QBqIgEgAEH01QBqKAIAIgAoAggiA0YEQEHE1QAgBkF+IAJ3cTYCAAwBCyABIAM2AgggAyABNgIMCyAAQQhqIQEgACACQQN0IgJBA3I2AgQgACACaiIAIAAoAgRBAXI2AgQMEQtBzNUAKAIAIgggBE8NASABBEACQEECIAB0IgJBACACa3IgASAAdHFoIgBBA3QiAkHs1QBqIgEgAkH01QBqKAIAIgIoAggiA0YEQEHE1QAgBkF+IAB3cSIGNgIADAELIAEgAzYCCCADIAE2AgwLIAIgBEEDcjYCBCAAQQN0IgAgBGshBSAAIAJqIAU2AgAgAiAEaiIEIAVBAXI2AgQgCARAIAhBeHFB7NUAaiEAQdjVACgCACEDAn9BASAIQQN2dCIBIAZxRQRAQcTVACABIAZyNgIAIAAMAQsgACgCCAsiASADNgIMIAAgAzYCCCADIAA2AgwgAyABNgIICyACQQhqIQFB2NUAIAQ2AgBBzNUAIAU2AgAMEQtByNUAKAIAIgtFDQEgC2hBAnRB9NcAaigCACIAKAIEQXhxIARrIQUgACECA0ACQCACKAIQIgFFBEAgAkEUaigCACIBRQ0BCyABKAIEQXhxIARrIgMgBUkhAiADIAUgAhshBSABIAAgAhshACABIQIMAQsLIAAoAhghCSAAKAIMIgMgAEcEQEHU1QAoAgAaIAMgACgCCCIBNgIIIAEgAzYCDAwQCyAAQRRqIgIoAgAiAUUEQCAAKAIQIgFFDQMgAEEQaiECCwNAIAIhByABIgNBFGoiAigCACIBDQAgA0EQaiECIAMoAhAiAQ0ACyAHQQA2AgAMDwtBfyEEIABBv39LDQAgAEETaiIBQXBxIQRByNUAKAIAIghFDQBBACAEayEFAkACQAJAAn9BACAEQYACSQ0AGkEfIARB////B0sNABogBEEmIAFBCHZnIgBrdkEBcSAAQQF0a0E+agsiBkECdEH01wBqKAIAIgJFBEBBACEBQQAhAwwBC0EAIQEgBEEZIAZBAXZrQQAgBkEfRxt0IQBBACEDA0ACQCACKAIEQXhxIARrIgcgBU8NACACIQMgByIFDQBBACEFIAIhAQwDCyABIAJBFGooAgAiByAHIAIgAEEddkEEcWpBEGooAgAiAkYbIAEgBxshASAAQQF0IQAgAg0ACwsgASADckUEQEEAIQNBAiAGdCIAQQAgAGtyIAhxIgBFDQMgAGhBAnRB9NcAaigCACEBCyABRQ0BCwNAIAEoAgRBeHEgBGsiAiAFSSEAIAIgBSAAGyEFIAEgAyAAGyEDIAEoAhAiAAR/IAAFIAFBFGooAgALIgENAAsLIANFDQAgBUHM1QAoAgAgBGtPDQAgAygCGCEHIAMgAygCDCIARwRAQdTVACgCABogACADKAIIIgE2AgggASAANgIMDA4LIANBFGoiAigCACIBRQRAIAMoAhAiAUUNAyADQRBqIQILA0AgAiEGIAEiAEEUaiICKAIAIgENACAAQRBqIQIgACgCECIBDQALIAZBADYCAAwNC0HM1QAoAgAiAyAETwRAQdjVACgCACEBAkAgAyAEayICQRBPBEAgASAEaiIAIAJBAXI2AgQgASADaiACNgIAIAEgBEEDcjYCBAwBCyABIANBA3I2AgQgASADaiIAIAAoAgRBAXI2AgRBACEAQQAhAgtBzNUAIAI2AgBB2NUAIAA2AgAgAUEIaiEBDA8LQdDVACgCACIDIARLBEAgBCAJaiIAIAMgBGsiAUEBcjYCBEHc1QAgADYCAEHQ1QAgATYCACAJIARBA3I2AgQgCUEIaiEBDA8LQQAhASAEAn9BnNkAKAIABEBBpNkAKAIADAELQajZAEJ/NwIAQaDZAEKAgISAgIDAADcCAEGc2QAgCkEMakFwcUHYqtWqBXM2AgBBsNkAQQA2AgBBgNkAQQA2AgBBgIAECyIAIARBxwBqIgVqIgZBACAAayIHcSICTwRAQbTZAEEwNgIADA8LAkBB/NgAKAIAIgFFDQBB9NgAKAIAIgggAmohACAAIAFNIAAgCEtxDQBBACEBQbTZAEEwNgIADA8LQYDZAC0AAEEEcQ0EAkACQCAJBEBBhNkAIQEDQCABKAIAIgAgCU0EQCAAIAEoAgRqIAlLDQMLIAEoAggiAQ0ACwtBABA7IgBBf0YNBSACIQZBoNkAKAIAIgFBAWsiAyAAcQRAIAIgAGsgACADakEAIAFrcWohBgsgBCAGTw0FIAZB/v///wdLDQVB/NgAKAIAIgMEQEH02AAoAgAiByAGaiEBIAEgB00NBiABIANLDQYLIAYQOyIBIABHDQEMBwsgBiADayAHcSIGQf7///8HSw0EIAYQOyEAIAAgASgCACABKAIEakYNAyAAIQELAkAgBiAEQcgAak8NACABQX9GDQBBpNkAKAIAIgAgBSAGa2pBACAAa3EiAEH+////B0sEQCABIQAMBwsgABA7QX9HBEAgACAGaiEGIAEhAAwHC0EAIAZrEDsaDAQLIAEiAEF/Rw0FDAMLQQAhAwwMC0EAIQAMCgsgAEF/Rw0CC0GA2QBBgNkAKAIAQQRyNgIACyACQf7///8HSw0BIAIQOyEAQQAQOyEBIABBf0YNASABQX9GDQEgACABTw0BIAEgAGsiBiAEQThqTQ0BC0H02ABB9NgAKAIAIAZqIgE2AgBB+NgAKAIAIAFJBEBB+NgAIAE2AgALAkACQAJAQdzVACgCACICBEBBhNkAIQEDQCAAIAEoAgAiAyABKAIEIgVqRg0CIAEoAggiAQ0ACwwCC0HU1QAoAgAiAUEARyAAIAFPcUUEQEHU1QAgADYCAAtBACEBQYjZACAGNgIAQYTZACAANgIAQeTVAEF/NgIAQejVAEGc2QAoAgA2AgBBkNkAQQA2AgADQCABQYDWAGogAUH01QBqIgI2AgAgAiABQezVAGoiAzYCACABQfjVAGogAzYCACABQYjWAGogAUH81QBqIgM2AgAgAyACNgIAIAFBkNYAaiABQYTWAGoiAjYCACACIAM2AgAgAUGM1gBqIAI2AgAgAUEgaiIBQYACRw0AC0F4IABrQQ9xIgEgAGoiAiAGQThrIgMgAWsiAUEBcjYCBEHg1QBBrNkAKAIANgIAQdDVACABNgIAQdzVACACNgIAIAAgA2pBODYCBAwCCyAAIAJNDQAgAiADSQ0AIAEoAgxBCHENAEF4IAJrQQ9xIgAgAmoiA0HQ1QAoAgAgBmoiByAAayIAQQFyNgIEIAEgBSAGajYCBEHg1QBBrNkAKAIANgIAQdDVACAANgIAQdzVACADNgIAIAIgB2pBODYCBAwBCyAAQdTVACgCAEkEQEHU1QAgADYCAAsgACAGaiEDQYTZACEBAkACQAJAA0AgAyABKAIARwRAIAEoAggiAQ0BDAILCyABLQAMQQhxRQ0BC0GE2QAhAQNAIAEoAgAiAyACTQRAIAMgASgCBGoiBSACSw0DCyABKAIIIQEMAAsACyABIAA2AgAgASABKAIEIAZqNgIEIABBeCAAa0EPcWoiCSAEQQNyNgIEIANBeCADa0EPcWoiBiAEIAlqIgRrIQEgAiAGRgRAQdzVACAENgIAQdDVAEHQ1QAoAgAgAWoiADYCACAEIABBAXI2AgQMCAtB2NUAKAIAIAZGBEBB2NUAIAQ2AgBBzNUAQczVACgCACABaiIANgIAIAQgAEEBcjYCBCAAIARqIAA2AgAMCAsgBigCBCIFQQNxQQFHDQYgBUF4cSEIIAVB/wFNBEAgBUEDdiEDIAYoAggiACAGKAIMIgJGBEBBxNUAQcTVACgCAEF+IAN3cTYCAAwHCyACIAA2AgggACACNgIMDAYLIAYoAhghByAGIAYoAgwiAEcEQCAAIAYoAggiAjYCCCACIAA2AgwMBQsgBkEUaiICKAIAIgVFBEAgBigCECIFRQ0EIAZBEGohAgsDQCACIQMgBSIAQRRqIgIoAgAiBQ0AIABBEGohAiAAKAIQIgUNAAsgA0EANgIADAQLQXggAGtBD3EiASAAaiIHIAZBOGsiAyABayIBQQFyNgIEIAAgA2pBODYCBCACIAVBNyAFa0EPcWpBP2siAyADIAJBEGpJGyIDQSM2AgRB4NUAQazZACgCADYCAEHQ1QAgATYCAEHc1QAgBzYCACADQRBqQYzZACkCADcCACADQYTZACkCADcCCEGM2QAgA0EIajYCAEGI2QAgBjYCAEGE2QAgADYCAEGQ2QBBADYCACADQSRqIQEDQCABQQc2AgAgBSABQQRqIgFLDQALIAIgA0YNACADIAMoAgRBfnE2AgQgAyADIAJrIgU2AgAgAiAFQQFyNgIEIAVB/wFNBEAgBUF4cUHs1QBqIQACf0HE1QAoAgAiAUEBIAVBA3Z0IgNxRQRAQcTVACABIANyNgIAIAAMAQsgACgCCAsiASACNgIMIAAgAjYCCCACIAA2AgwgAiABNgIIDAELQR8hASAFQf///wdNBEAgBUEmIAVBCHZnIgBrdkEBcSAAQQF0a0E+aiEBCyACIAE2AhwgAkIANwIQIAFBAnRB9NcAaiEAQcjVACgCACIDQQEgAXQiBnFFBEAgACACNgIAQcjVACADIAZyNgIAIAIgADYCGCACIAI2AgggAiACNgIMDAELIAVBGSABQQF2a0EAIAFBH0cbdCEBIAAoAgAhAwJAA0AgAyIAKAIEQXhxIAVGDQEgAUEddiEDIAFBAXQhASAAIANBBHFqQRBqIgYoAgAiAw0ACyAGIAI2AgAgAiAANgIYIAIgAjYCDCACIAI2AggMAQsgACgCCCIBIAI2AgwgACACNgIIIAJBADYCGCACIAA2AgwgAiABNgIIC0HQ1QAoAgAiASAETQ0AQdzVACgCACIAIARqIgIgASAEayIBQQFyNgIEQdDVACABNgIAQdzVACACNgIAIAAgBEEDcjYCBCAAQQhqIQEMCAtBACEBQbTZAEEwNgIADAcLQQAhAAsgB0UNAAJAIAYoAhwiAkECdEH01wBqIgMoAgAgBkYEQCADIAA2AgAgAA0BQcjVAEHI1QAoAgBBfiACd3E2AgAMAgsgB0EQQRQgBygCECAGRhtqIAA2AgAgAEUNAQsgACAHNgIYIAYoAhAiAgRAIAAgAjYCECACIAA2AhgLIAZBFGooAgAiAkUNACAAQRRqIAI2AgAgAiAANgIYCyABIAhqIQEgBiAIaiIGKAIEIQULIAYgBUF+cTYCBCABIARqIAE2AgAgBCABQQFyNgIEIAFB/wFNBEAgAUF4cUHs1QBqIQACf0HE1QAoAgAiAkEBIAFBA3Z0IgFxRQRAQcTVACABIAJyNgIAIAAMAQsgACgCCAsiASAENgIMIAAgBDYCCCAEIAA2AgwgBCABNgIIDAELQR8hBSABQf///wdNBEAgAUEmIAFBCHZnIgBrdkEBcSAAQQF0a0E+aiEFCyAEIAU2AhwgBEIANwIQIAVBAnRB9NcAaiEAQcjVACgCACICQQEgBXQiA3FFBEAgACAENgIAQcjVACACIANyNgIAIAQgADYCGCAEIAQ2AgggBCAENgIMDAELIAFBGSAFQQF2a0EAIAVBH0cbdCEFIAAoAgAhAAJAA0AgACICKAIEQXhxIAFGDQEgBUEddiEAIAVBAXQhBSACIABBBHFqQRBqIgMoAgAiAA0ACyADIAQ2AgAgBCACNgIYIAQgBDYCDCAEIAQ2AggMAQsgAigCCCIAIAQ2AgwgAiAENgIIIARBADYCGCAEIAI2AgwgBCAANgIICyAJQQhqIQEMAgsCQCAHRQ0AAkAgAygCHCIBQQJ0QfTXAGoiAigCACADRgRAIAIgADYCACAADQFByNUAIAhBfiABd3EiCDYCAAwCCyAHQRBBFCAHKAIQIANGG2ogADYCACAARQ0BCyAAIAc2AhggAygCECIBBEAgACABNgIQIAEgADYCGAsgA0EUaigCACIBRQ0AIABBFGogATYCACABIAA2AhgLAkAgBUEPTQRAIAMgBCAFaiIAQQNyNgIEIAAgA2oiACAAKAIEQQFyNgIEDAELIAMgBGoiAiAFQQFyNgIEIAMgBEEDcjYCBCACIAVqIAU2AgAgBUH/AU0EQCAFQXhxQezVAGohAAJ/QcTVACgCACIBQQEgBUEDdnQiBXFFBEBBxNUAIAEgBXI2AgAgAAwBCyAAKAIICyIBIAI2AgwgACACNgIIIAIgADYCDCACIAE2AggMAQtBHyEBIAVB////B00EQCAFQSYgBUEIdmciAGt2QQFxIABBAXRrQT5qIQELIAIgATYCHCACQgA3AhAgAUECdEH01wBqIQBBASABdCIEIAhxRQRAIAAgAjYCAEHI1QAgBCAIcjYCACACIAA2AhggAiACNgIIIAIgAjYCDAwBCyAFQRkgAUEBdmtBACABQR9HG3QhASAAKAIAIQQCQANAIAQiACgCBEF4cSAFRg0BIAFBHXYhBCABQQF0IQEgACAEQQRxakEQaiIGKAIAIgQNAAsgBiACNgIAIAIgADYCGCACIAI2AgwgAiACNgIIDAELIAAoAggiASACNgIMIAAgAjYCCCACQQA2AhggAiAANgIMIAIgATYCCAsgA0EIaiEBDAELAkAgCUUNAAJAIAAoAhwiAUECdEH01wBqIgIoAgAgAEYEQCACIAM2AgAgAw0BQcjVACALQX4gAXdxNgIADAILIAlBEEEUIAkoAhAgAEYbaiADNgIAIANFDQELIAMgCTYCGCAAKAIQIgEEQCADIAE2AhAgASADNgIYCyAAQRRqKAIAIgFFDQAgA0EUaiABNgIAIAEgAzYCGAsCQCAFQQ9NBEAgACAEIAVqIgFBA3I2AgQgACABaiIBIAEoAgRBAXI2AgQMAQsgACAEaiIHIAVBAXI2AgQgACAEQQNyNgIEIAUgB2ogBTYCACAIBEAgCEF4cUHs1QBqIQFB2NUAKAIAIQMCf0EBIAhBA3Z0IgIgBnFFBEBBxNUAIAIgBnI2AgAgAQwBCyABKAIICyICIAM2AgwgASADNgIIIAMgATYCDCADIAI2AggLQdjVACAHNgIAQczVACAFNgIACyAAQQhqIQELIApBEGokACABC0MAIABFBEA/AEEQdA8LAkAgAEH//wNxDQAgAEEASA0AIABBEHZAACIAQX9GBEBBtNkAQTA2AgBBfw8LIABBEHQPCwALC5lCIgBBgAgLDQEAAAAAAAAAAgAAAAMAQZgICwUEAAAABQBBqAgLCQYAAAAHAAAACABB5AgLwjJJbnZhbGlkIGNoYXIgaW4gdXJsIHF1ZXJ5AFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fYm9keQBDb250ZW50LUxlbmd0aCBvdmVyZmxvdwBDaHVuayBzaXplIG92ZXJmbG93AEludmFsaWQgbWV0aG9kIGZvciBIVFRQL3gueCByZXF1ZXN0AEludmFsaWQgbWV0aG9kIGZvciBSVFNQL3gueCByZXF1ZXN0AEV4cGVjdGVkIFNPVVJDRSBtZXRob2QgZm9yIElDRS94LnggcmVxdWVzdABJbnZhbGlkIGNoYXIgaW4gdXJsIGZyYWdtZW50IHN0YXJ0AEV4cGVjdGVkIGRvdABTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3N0YXR1cwBJbnZhbGlkIHJlc3BvbnNlIHN0YXR1cwBFeHBlY3RlZCBMRiBhZnRlciBoZWFkZXJzAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMAVXNlciBjYWxsYmFjayBlcnJvcgBgb25fcmVzZXRgIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19oZWFkZXJgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXNzYWdlX2JlZ2luYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfZXh0ZW5zaW9uX3ZhbHVlYCBjYWxsYmFjayBlcnJvcgBgb25fc3RhdHVzX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fdmVyc2lvbl9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3VybF9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3Byb3RvY29sX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9oZWFkZXJfdmFsdWVfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXNzYWdlX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fbWV0aG9kX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25faGVhZGVyX2ZpZWxkX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfZXh0ZW5zaW9uX25hbWVgIGNhbGxiYWNrIGVycm9yAFVuZXhwZWN0ZWQgY2hhciBpbiB1cmwgc2VydmVyAEludmFsaWQgaGVhZGVyIHZhbHVlIGNoYXIASW52YWxpZCBoZWFkZXIgZmllbGQgY2hhcgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3ZlcnNpb24ASW52YWxpZCBtaW5vciB2ZXJzaW9uAEludmFsaWQgbWFqb3IgdmVyc2lvbgBFeHBlY3RlZCBzcGFjZSBhZnRlciB2ZXJzaW9uAEV4cGVjdGVkIENSTEYgYWZ0ZXIgdmVyc2lvbgBJbnZhbGlkIEhUVFAgdmVyc2lvbgBJbnZhbGlkIGhlYWRlciB0b2tlbgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3VybABJbnZhbGlkIGNoYXJhY3RlcnMgaW4gdXJsAFVuZXhwZWN0ZWQgc3RhcnQgY2hhciBpbiB1cmwARG91YmxlIEAgaW4gdXJsAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fcHJvdG9jb2wARW1wdHkgQ29udGVudC1MZW5ndGgASW52YWxpZCBjaGFyYWN0ZXIgaW4gQ29udGVudC1MZW5ndGgAVHJhbnNmZXItRW5jb2RpbmcgY2FuJ3QgYmUgcHJlc2VudCB3aXRoIENvbnRlbnQtTGVuZ3RoAER1cGxpY2F0ZSBDb250ZW50LUxlbmd0aABJbnZhbGlkIGNoYXIgaW4gdXJsIHBhdGgAQ29udGVudC1MZW5ndGggY2FuJ3QgYmUgcHJlc2VudCB3aXRoIFRyYW5zZmVyLUVuY29kaW5nAE1pc3NpbmcgZXhwZWN0ZWQgQ1IgYWZ0ZXIgY2h1bmsgc2l6ZQBFeHBlY3RlZCBMRiBhZnRlciBjaHVuayBzaXplAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIHNpemUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfdmFsdWUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9jaHVua19leHRlbnNpb25fdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyB2YWx1ZQBVbmV4cGVjdGVkIHdoaXRlc3BhY2UgYWZ0ZXIgaGVhZGVyIHZhbHVlAE1pc3NpbmcgZXhwZWN0ZWQgQ1IgYWZ0ZXIgaGVhZGVyIHZhbHVlAE1pc3NpbmcgZXhwZWN0ZWQgTEYgYWZ0ZXIgaGVhZGVyIHZhbHVlAEludmFsaWQgYFRyYW5zZmVyLUVuY29kaW5nYCBoZWFkZXIgdmFsdWUATWlzc2luZyBleHBlY3RlZCBDUiBhZnRlciBjaHVuayBleHRlbnNpb24gdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBxdW90ZSB2YWx1ZQBJbnZhbGlkIHF1b3RlZC1wYWlyIGluIGNodW5rIGV4dGVuc2lvbnMgcXVvdGVkIHZhbHVlAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgcXVvdGVkIHZhbHVlAFBhdXNlZCBieSBvbl9oZWFkZXJzX2NvbXBsZXRlAEludmFsaWQgRU9GIHN0YXRlAG9uX3Jlc2V0IHBhdXNlAG9uX2NodW5rX2hlYWRlciBwYXVzZQBvbl9tZXNzYWdlX2JlZ2luIHBhdXNlAG9uX2NodW5rX2V4dGVuc2lvbl92YWx1ZSBwYXVzZQBvbl9zdGF0dXNfY29tcGxldGUgcGF1c2UAb25fdmVyc2lvbl9jb21wbGV0ZSBwYXVzZQBvbl91cmxfY29tcGxldGUgcGF1c2UAb25fcHJvdG9jb2xfY29tcGxldGUgcGF1c2UAb25fY2h1bmtfY29tcGxldGUgcGF1c2UAb25faGVhZGVyX3ZhbHVlX2NvbXBsZXRlIHBhdXNlAG9uX21lc3NhZ2VfY29tcGxldGUgcGF1c2UAb25fbWV0aG9kX2NvbXBsZXRlIHBhdXNlAG9uX2hlYWRlcl9maWVsZF9jb21wbGV0ZSBwYXVzZQBvbl9jaHVua19leHRlbnNpb25fbmFtZSBwYXVzZQBVbmV4cGVjdGVkIHNwYWNlIGFmdGVyIHN0YXJ0IGxpbmUATWlzc2luZyBleHBlY3RlZCBDUiBhZnRlciByZXNwb25zZSBsaW5lAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fY2h1bmtfZXh0ZW5zaW9uX25hbWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBuYW1lAE1pc3NpbmcgZXhwZWN0ZWQgQ1IgYWZ0ZXIgY2h1bmsgZXh0ZW5zaW9uIG5hbWUASW52YWxpZCBzdGF0dXMgY29kZQBQYXVzZSBvbiBDT05ORUNUL1VwZ3JhZGUAUGF1c2Ugb24gUFJJL1VwZ3JhZGUARXhwZWN0ZWQgSFRUUC8yIENvbm5lY3Rpb24gUHJlZmFjZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX21ldGhvZABFeHBlY3RlZCBzcGFjZSBhZnRlciBtZXRob2QAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfZmllbGQAUGF1c2VkAEludmFsaWQgd29yZCBlbmNvdW50ZXJlZABJbnZhbGlkIG1ldGhvZCBlbmNvdW50ZXJlZABNaXNzaW5nIGV4cGVjdGVkIENSIGFmdGVyIGNodW5rIGRhdGEARXhwZWN0ZWQgTEYgYWZ0ZXIgY2h1bmsgZGF0YQBVbmV4cGVjdGVkIGNoYXIgaW4gdXJsIHNjaGVtYQBSZXF1ZXN0IGhhcyBpbnZhbGlkIGBUcmFuc2Zlci1FbmNvZGluZ2AARGF0YSBhZnRlciBgQ29ubmVjdGlvbjogY2xvc2VgAFNXSVRDSF9QUk9YWQBVU0VfUFJPWFkATUtBQ1RJVklUWQBVTlBST0NFU1NBQkxFX0VOVElUWQBRVUVSWQBDT1BZAE1PVkVEX1BFUk1BTkVOVExZAFRPT19FQVJMWQBOT1RJRlkARkFJTEVEX0RFUEVOREVOQ1kAQkFEX0dBVEVXQVkAUExBWQBQVVQAQ0hFQ0tPVVQAR0FURVdBWV9USU1FT1VUAFJFUVVFU1RfVElNRU9VVABORVRXT1JLX0NPTk5FQ1RfVElNRU9VVABDT05ORUNUSU9OX1RJTUVPVVQATE9HSU5fVElNRU9VVABORVRXT1JLX1JFQURfVElNRU9VVABQT1NUAE1JU0RJUkVDVEVEX1JFUVVFU1QAQ0xJRU5UX0NMT1NFRF9SRVFVRVNUAENMSUVOVF9DTE9TRURfTE9BRF9CQUxBTkNFRF9SRVFVRVNUAEJBRF9SRVFVRVNUAEhUVFBfUkVRVUVTVF9TRU5UX1RPX0hUVFBTX1BPUlQAUkVQT1JUAElNX0FfVEVBUE9UAFJFU0VUX0NPTlRFTlQATk9fQ09OVEVOVABQQVJUSUFMX0NPTlRFTlQASFBFX0lOVkFMSURfQ09OU1RBTlQASFBFX0NCX1JFU0VUAEdFVABIUEVfU1RSSUNUAENPTkZMSUNUAFRFTVBPUkFSWV9SRURJUkVDVABQRVJNQU5FTlRfUkVESVJFQ1QAQ09OTkVDVABNVUxUSV9TVEFUVVMASFBFX0lOVkFMSURfU1RBVFVTAFRPT19NQU5ZX1JFUVVFU1RTAEVBUkxZX0hJTlRTAFVOQVZBSUxBQkxFX0ZPUl9MRUdBTF9SRUFTT05TAE9QVElPTlMAU1dJVENISU5HX1BST1RPQ09MUwBWQVJJQU5UX0FMU09fTkVHT1RJQVRFUwBNVUxUSVBMRV9DSE9JQ0VTAElOVEVSTkFMX1NFUlZFUl9FUlJPUgBXRUJfU0VSVkVSX1VOS05PV05fRVJST1IAUkFJTEdVTl9FUlJPUgBJREVOVElUWV9QUk9WSURFUl9BVVRIRU5USUNBVElPTl9FUlJPUgBTU0xfQ0VSVElGSUNBVEVfRVJST1IASU5WQUxJRF9YX0ZPUldBUkRFRF9GT1IAU0VUX1BBUkFNRVRFUgBHRVRfUEFSQU1FVEVSAEhQRV9VU0VSAFNFRV9PVEhFUgBIUEVfQ0JfQ0hVTktfSEVBREVSAEV4cGVjdGVkIExGIGFmdGVyIENSAE1LQ0FMRU5EQVIAU0VUVVAAV0VCX1NFUlZFUl9JU19ET1dOAFRFQVJET1dOAEhQRV9DTE9TRURfQ09OTkVDVElPTgBIRVVSSVNUSUNfRVhQSVJBVElPTgBESVNDT05ORUNURURfT1BFUkFUSU9OAE5PTl9BVVRIT1JJVEFUSVZFX0lORk9STUFUSU9OAEhQRV9JTlZBTElEX1ZFUlNJT04ASFBFX0NCX01FU1NBR0VfQkVHSU4AU0lURV9JU19GUk9aRU4ASFBFX0lOVkFMSURfSEVBREVSX1RPS0VOAElOVkFMSURfVE9LRU4ARk9SQklEREVOAEVOSEFOQ0VfWU9VUl9DQUxNAEhQRV9JTlZBTElEX1VSTABCTE9DS0VEX0JZX1BBUkVOVEFMX0NPTlRST0wATUtDT0wAQUNMAEhQRV9JTlRFUk5BTABSRVFVRVNUX0hFQURFUl9GSUVMRFNfVE9PX0xBUkdFX1VOT0ZGSUNJQUwASFBFX09LAFVOTElOSwBVTkxPQ0sAUFJJAFJFVFJZX1dJVEgASFBFX0lOVkFMSURfQ09OVEVOVF9MRU5HVEgASFBFX1VORVhQRUNURURfQ09OVEVOVF9MRU5HVEgARkxVU0gAUFJPUFBBVENIAE0tU0VBUkNIAFVSSV9UT09fTE9ORwBQUk9DRVNTSU5HAE1JU0NFTExBTkVPVVNfUEVSU0lTVEVOVF9XQVJOSU5HAE1JU0NFTExBTkVPVVNfV0FSTklORwBIUEVfSU5WQUxJRF9UUkFOU0ZFUl9FTkNPRElORwBFeHBlY3RlZCBDUkxGAEhQRV9JTlZBTElEX0NIVU5LX1NJWkUATU9WRQBDT05USU5VRQBIUEVfQ0JfU1RBVFVTX0NPTVBMRVRFAEhQRV9DQl9IRUFERVJTX0NPTVBMRVRFAEhQRV9DQl9WRVJTSU9OX0NPTVBMRVRFAEhQRV9DQl9VUkxfQ09NUExFVEUASFBFX0NCX1BST1RPQ09MX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19DT01QTEVURQBIUEVfQ0JfSEVBREVSX1ZBTFVFX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19FWFRFTlNJT05fVkFMVUVfQ09NUExFVEUASFBFX0NCX0NIVU5LX0VYVEVOU0lPTl9OQU1FX0NPTVBMRVRFAEhQRV9DQl9NRVNTQUdFX0NPTVBMRVRFAEhQRV9DQl9NRVRIT0RfQ09NUExFVEUASFBFX0NCX0hFQURFUl9GSUVMRF9DT01QTEVURQBERUxFVEUASFBFX0lOVkFMSURfRU9GX1NUQVRFAElOVkFMSURfU1NMX0NFUlRJRklDQVRFAFBBVVNFAE5PX1JFU1BPTlNFAFVOU1VQUE9SVEVEX01FRElBX1RZUEUAR09ORQBOT1RfQUNDRVBUQUJMRQBTRVJWSUNFX1VOQVZBSUxBQkxFAFJBTkdFX05PVF9TQVRJU0ZJQUJMRQBPUklHSU5fSVNfVU5SRUFDSEFCTEUAUkVTUE9OU0VfSVNfU1RBTEUAUFVSR0UATUVSR0UAUkVRVUVTVF9IRUFERVJfRklFTERTX1RPT19MQVJHRQBSRVFVRVNUX0hFQURFUl9UT09fTEFSR0UAUEFZTE9BRF9UT09fTEFSR0UASU5TVUZGSUNJRU5UX1NUT1JBR0UASFBFX1BBVVNFRF9VUEdSQURFAEhQRV9QQVVTRURfSDJfVVBHUkFERQBTT1VSQ0UAQU5OT1VOQ0UAVFJBQ0UASFBFX1VORVhQRUNURURfU1BBQ0UAREVTQ1JJQkUAVU5TVUJTQ1JJQkUAUkVDT1JEAEhQRV9JTlZBTElEX01FVEhPRABOT1RfRk9VTkQAUFJPUEZJTkQAVU5CSU5EAFJFQklORABVTkFVVEhPUklaRUQATUVUSE9EX05PVF9BTExPV0VEAEhUVFBfVkVSU0lPTl9OT1RfU1VQUE9SVEVEAEFMUkVBRFlfUkVQT1JURUQAQUNDRVBURUQATk9UX0lNUExFTUVOVEVEAExPT1BfREVURUNURUQASFBFX0NSX0VYUEVDVEVEAEhQRV9MRl9FWFBFQ1RFRABDUkVBVEVEAElNX1VTRUQASFBFX1BBVVNFRABUSU1FT1VUX09DQ1VSRUQAUEFZTUVOVF9SRVFVSVJFRABQUkVDT05ESVRJT05fUkVRVUlSRUQAUFJPWFlfQVVUSEVOVElDQVRJT05fUkVRVUlSRUQATkVUV09SS19BVVRIRU5USUNBVElPTl9SRVFVSVJFRABMRU5HVEhfUkVRVUlSRUQAU1NMX0NFUlRJRklDQVRFX1JFUVVJUkVEAFVQR1JBREVfUkVRVUlSRUQAUEFHRV9FWFBJUkVEAFBSRUNPTkRJVElPTl9GQUlMRUQARVhQRUNUQVRJT05fRkFJTEVEAFJFVkFMSURBVElPTl9GQUlMRUQAU1NMX0hBTkRTSEFLRV9GQUlMRUQATE9DS0VEAFRSQU5TRk9STUFUSU9OX0FQUExJRUQATk9UX01PRElGSUVEAE5PVF9FWFRFTkRFRABCQU5EV0lEVEhfTElNSVRfRVhDRUVERUQAU0lURV9JU19PVkVSTE9BREVEAEhFQUQARXhwZWN0ZWQgSFRUUC8sIFJUU1AvIG9yIElDRS8A5xUAAK8VAACkEgAAkhoAACYWAACeFAAA2xkAAHkVAAB+EgAA/hQAADYVAAALFgAA2BYAAPMSAABCGAAArBYAABIVAAAUFwAA7xcAAEgUAABxFwAAshoAAGsZAAB+GQAANRQAAIIaAABEFwAA/RYAAB4YAACHFwAAqhkAAJMSAAAHGAAALBcAAMoXAACkFwAA5xUAAOcVAABYFwAAOxgAAKASAAAtHAAAwxEAAEgRAADeEgAAQhMAAKQZAAD9EAAA9xUAAKUVAADvFgAA+BkAAEoWAABWFgAA9RUAAAoaAAAIGgAAARoAAKsVAABCEgAA1xAAAEwRAAAFGQAAVBYAAB4RAADKGQAAyBkAAE4WAAD/GAAAcRQAAPAVAADuFQAAlBkAAPwVAAC/GQAAmxkAAHwUAABDEQAAcBgAAJUUAAAnFAAAGRQAANUSAADUGQAARBYAAPcQAEG5OwsBAQBB0DsL4AEBAQIBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEDAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBBuj0LBAEAAAIAQdE9C14DBAMDAwMDAAADAwADAwADAwMDAwMDAwMDAAUAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAwADAEG6PwsEAQAAAgBB0T8LXgMAAwMDAwMAAAMDAAMDAAMDAwMDAwMDAwMABAAFAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwADAAMAQbDBAAsNbG9zZWVlcC1hbGl2ZQBBycEACwEBAEHgwQAL4AEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBBycMACwEBAEHgwwAL5wEBAQEBAQEBAQEBAQECAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAWNodW5rZWQAQfHFAAteAQABAQEBAQAAAQEAAQEAAQEBAQEBAQEBAQAAAAAAAAABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEAAQBB0McACyFlY3Rpb25lbnQtbGVuZ3Rob25yb3h5LWNvbm5lY3Rpb24AQYDIAAsgcmFuc2Zlci1lbmNvZGluZ3BncmFkZQ0KDQpTTQ0KDQoAQanIAAsFAQIAAQMAQcDIAAtfBAUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUAQanKAAsFAQIAAQMAQcDKAAtfBAUFBgUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUAQanMAAsEAQAAAQBBwcwAC14CAgACAgICAgICAgICAgICAgICAgICAgICAgICAgIAAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAEGpzgALBQECAAEDAEHAzgALXwQFAAAFBQUFBQUFBQUFBQYFBQUFBQUFBQUFBQUABQAHCAUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQAFAAUABQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUAAAAFAEGp0AALBQEBAAEBAEHA0AALAQEAQdrQAAtBAgAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAQanSAAsFAQEAAQEAQcDSAAsBAQBBytIACwYCAAAAAAIAQeHSAAs6AwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBBoNQAC50BTk9VTkNFRUNLT1VUTkVDVEVURUNSSUJFTFVTSEVURUFEU0VBUkNIUkdFQ1RJVklUWUxFTkRBUlZFT1RJRllQVElPTlNDSFNFQVlTVEFUQ0hHRVVFUllPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFVFRQQ0VUU1BBRFRQLw==`, `base64`) }); -})); -var oe = c$3(((e, t) => { - let { Buffer: r } = p$4(`node:buffer`), i; - Object.defineProperty(t, "exports", { get: () => i ||= r.from(`AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAn9/AGABfwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQAEA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAAzU0BQYAAAMAAAAAAAADAQMAAwMDAAACAAAAAAICAgICAgICAgIBAQEBAQEBAQEBAwAAAwAAAAQFAXABExMFAwEAAgYIAX8BQcDZBAsHxQcoBm1lbW9yeQIAC19pbml0aWFsaXplAAgZX19pbmRpcmVjdF9mdW5jdGlvbl90YWJsZQEAC2xsaHR0cF9pbml0AAkYbGxodHRwX3Nob3VsZF9rZWVwX2FsaXZlADcMbGxodHRwX2FsbG9jAAsGbWFsbG9jADkLbGxodHRwX2ZyZWUADARmcmVlAAwPbGxodHRwX2dldF90eXBlAA0VbGxodHRwX2dldF9odHRwX21ham9yAA4VbGxodHRwX2dldF9odHRwX21pbm9yAA8RbGxodHRwX2dldF9tZXRob2QAEBZsbGh0dHBfZ2V0X3N0YXR1c19jb2RlABESbGxodHRwX2dldF91cGdyYWRlABIMbGxodHRwX3Jlc2V0ABMObGxodHRwX2V4ZWN1dGUAFBRsbGh0dHBfc2V0dGluZ3NfaW5pdAAVDWxsaHR0cF9maW5pc2gAFgxsbGh0dHBfcGF1c2UAFw1sbGh0dHBfcmVzdW1lABgbbGxodHRwX3Jlc3VtZV9hZnRlcl91cGdyYWRlABkQbGxodHRwX2dldF9lcnJubwAaF2xsaHR0cF9nZXRfZXJyb3JfcmVhc29uABsXbGxodHRwX3NldF9lcnJvcl9yZWFzb24AHBRsbGh0dHBfZ2V0X2Vycm9yX3BvcwAdEWxsaHR0cF9lcnJub19uYW1lAB4SbGxodHRwX21ldGhvZF9uYW1lAB8SbGxodHRwX3N0YXR1c19uYW1lACAabGxodHRwX3NldF9sZW5pZW50X2hlYWRlcnMAISFsbGh0dHBfc2V0X2xlbmllbnRfY2h1bmtlZF9sZW5ndGgAIh1sbGh0dHBfc2V0X2xlbmllbnRfa2VlcF9hbGl2ZQAjJGxsaHR0cF9zZXRfbGVuaWVudF90cmFuc2Zlcl9lbmNvZGluZwAkGmxsaHR0cF9zZXRfbGVuaWVudF92ZXJzaW9uACUjbGxodHRwX3NldF9sZW5pZW50X2RhdGFfYWZ0ZXJfY2xvc2UAJidsbGh0dHBfc2V0X2xlbmllbnRfb3B0aW9uYWxfbGZfYWZ0ZXJfY3IAJyxsbGh0dHBfc2V0X2xlbmllbnRfb3B0aW9uYWxfY3JsZl9hZnRlcl9jaHVuawAoKGxsaHR0cF9zZXRfbGVuaWVudF9vcHRpb25hbF9jcl9iZWZvcmVfbGYAKSpsbGh0dHBfc2V0X2xlbmllbnRfc3BhY2VzX2FmdGVyX2NodW5rX3NpemUAKhhsbGh0dHBfbWVzc2FnZV9uZWVkc19lb2YANgkYAQBBAQsSAQIDBAUKBgcyNDMuKy8tLDAxCuzaAjQWAEHA1QAoAgAEQAALQcDVAEEBNgIACxQAIAAQOCAAIAI2AjggACABOgAoCxQAIAAgAC8BNCAALQAwIAAQNxAACx4BAX9BwAAQOiIBEDggAUGACDYCOCABIAA6ACggAQuPDAEHfwJAIABFDQAgAEEIayIBIABBBGsoAgAiAEF4cSIEaiEFAkAgAEEBcQ0AIABBA3FFDQEgASABKAIAIgBrIgFB1NUAKAIASQ0BIAAgBGohBAJAAkBB2NUAKAIAIAFHBEAgAEH/AU0EQCAAQQN2IQMgASgCCCIAIAEoAgwiAkYEQEHE1QBBxNUAKAIAQX4gA3dxNgIADAULIAIgADYCCCAAIAI2AgwMBAsgASgCGCEGIAEgASgCDCIARwRAIAAgASgCCCICNgIIIAIgADYCDAwDCyABQRRqIgMoAgAiAkUEQCABKAIQIgJFDQIgAUEQaiEDCwNAIAMhByACIgBBFGoiAygCACICDQAgAEEQaiEDIAAoAhAiAg0ACyAHQQA2AgAMAgsgBSgCBCIAQQNxQQNHDQIgBSAAQX5xNgIEQczVACAENgIAIAUgBDYCACABIARBAXI2AgQMAwtBACEACyAGRQ0AAkAgASgCHCICQQJ0QfTXAGoiAygCACABRgRAIAMgADYCACAADQFByNUAQcjVACgCAEF+IAJ3cTYCAAwCCyAGQRBBFCAGKAIQIAFGG2ogADYCACAARQ0BCyAAIAY2AhggASgCECICBEAgACACNgIQIAIgADYCGAsgAUEUaigCACICRQ0AIABBFGogAjYCACACIAA2AhgLIAEgBU8NACAFKAIEIgBBAXFFDQACQAJAAkACQCAAQQJxRQRAQdzVACgCACAFRgRAQdzVACABNgIAQdDVAEHQ1QAoAgAgBGoiADYCACABIABBAXI2AgQgAUHY1QAoAgBHDQZBzNUAQQA2AgBB2NUAQQA2AgAMBgtB2NUAKAIAIAVGBEBB2NUAIAE2AgBBzNUAQczVACgCACAEaiIANgIAIAEgAEEBcjYCBCAAIAFqIAA2AgAMBgsgAEF4cSAEaiEEIABB/wFNBEAgAEEDdiEDIAUoAggiACAFKAIMIgJGBEBBxNUAQcTVACgCAEF+IAN3cTYCAAwFCyACIAA2AgggACACNgIMDAQLIAUoAhghBiAFIAUoAgwiAEcEQEHU1QAoAgAaIAAgBSgCCCICNgIIIAIgADYCDAwDCyAFQRRqIgMoAgAiAkUEQCAFKAIQIgJFDQIgBUEQaiEDCwNAIAMhByACIgBBFGoiAygCACICDQAgAEEQaiEDIAAoAhAiAg0ACyAHQQA2AgAMAgsgBSAAQX5xNgIEIAEgBGogBDYCACABIARBAXI2AgQMAwtBACEACyAGRQ0AAkAgBSgCHCICQQJ0QfTXAGoiAygCACAFRgRAIAMgADYCACAADQFByNUAQcjVACgCAEF+IAJ3cTYCAAwCCyAGQRBBFCAGKAIQIAVGG2ogADYCACAARQ0BCyAAIAY2AhggBSgCECICBEAgACACNgIQIAIgADYCGAsgBUEUaigCACICRQ0AIABBFGogAjYCACACIAA2AhgLIAEgBGogBDYCACABIARBAXI2AgQgAUHY1QAoAgBHDQBBzNUAIAQ2AgAMAQsgBEH/AU0EQCAEQXhxQezVAGohAAJ/QcTVACgCACICQQEgBEEDdnQiA3FFBEBBxNUAIAIgA3I2AgAgAAwBCyAAKAIICyICIAE2AgwgACABNgIIIAEgADYCDCABIAI2AggMAQtBHyECIARB////B00EQCAEQSYgBEEIdmciAGt2QQFxIABBAXRrQT5qIQILIAEgAjYCHCABQgA3AhAgAkECdEH01wBqIQACQEHI1QAoAgAiA0EBIAJ0IgdxRQRAIAAgATYCAEHI1QAgAyAHcjYCACABIAA2AhggASABNgIIIAEgATYCDAwBCyAEQRkgAkEBdmtBACACQR9HG3QhAiAAKAIAIQACQANAIAAiAygCBEF4cSAERg0BIAJBHXYhACACQQF0IQIgAyAAQQRxakEQaiIHKAIAIgANAAsgByABNgIAIAEgAzYCGCABIAE2AgwgASABNgIIDAELIAMoAggiACABNgIMIAMgATYCCCABQQA2AhggASADNgIMIAEgADYCCAtB5NUAQeTVACgCAEEBayIAQX8gABs2AgALCwcAIAAtACgLBwAgAC0AKgsHACAALQArCwcAIAAtACkLBwAgAC8BNAsHACAALQAwC0ABBH8gACgCGCEBIAAvAS4hAiAALQAoIQMgACgCOCEEIAAQOCAAIAQ2AjggACADOgAoIAAgAjsBLiAAIAE2AhgLhocCAwd/A34BeyABIAJqIQQCQCAAIgMoAgwiAA0AIAMoAgQEQCADIAE2AgQLIwBBEGsiCSQAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCADKAIcIgJBAmsO/AEB+QECAwQFBgcICQoLDA0ODxAREvgBE/cBFBX2ARYX9QEYGRobHB0eHyD9AfsBIfQBIiMkJSYnKCkqK/MBLC0uLzAxMvIB8QEzNPAB7wE1Njc4OTo7PD0+P0BBQkNERUZHSElKS0xNTk/6AVBRUlPuAe0BVOwBVesBVldYWVrqAVtcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AAYEBggGDAYQBhQGGAYcBiAGJAYoBiwGMAY0BjgGPAZABkQGSAZMBlAGVAZYBlwGYAZkBmgGbAZwBnQGeAZ8BoAGhAaIBowGkAaUBpgGnAagBqQGqAasBrAGtAa4BrwGwAbEBsgGzAbQBtQG2AbcBuAG5AboBuwG8Ab0BvgG/AcABwQHCAcMBxAHFAcYBxwHIAckBygHLAcwBzQHOAekB6AHPAecB0AHmAdEB0gHTAdQB5QHVAdYB1wHYAdkB2gHbAdwB3QHeAd8B4AHhAeIB4wEA/AELQQAM4wELQQ4M4gELQQ0M4QELQQ8M4AELQRAM3wELQRMM3gELQRQM3QELQRUM3AELQRYM2wELQRcM2gELQRgM2QELQRkM2AELQRoM1wELQRsM1gELQRwM1QELQR0M1AELQR4M0wELQR8M0gELQSAM0QELQSEM0AELQQgMzwELQSIMzgELQSQMzQELQSMMzAELQQcMywELQSUMygELQSYMyQELQScMyAELQSgMxwELQRIMxgELQREMxQELQSkMxAELQSoMwwELQSsMwgELQSwMwQELQd4BDMABC0EuDL8BC0EvDL4BC0EwDL0BC0ExDLwBC0EyDLsBC0EzDLoBC0E0DLkBC0HfAQy4AQtBNQy3AQtBOQy2AQtBDAy1AQtBNgy0AQtBNwyzAQtBOAyyAQtBPgyxAQtBOgywAQtB4AEMrwELQQsMrgELQT8MrQELQTsMrAELQQoMqwELQTwMqgELQT0MqQELQeEBDKgBC0HBAAynAQtBwAAMpgELQcIADKUBC0EJDKQBC0EtDKMBC0HDAAyiAQtBxAAMoQELQcUADKABC0HGAAyfAQtBxwAMngELQcgADJ0BC0HJAAycAQtBygAMmwELQcsADJoBC0HMAAyZAQtBzQAMmAELQc4ADJcBC0HPAAyWAQtB0AAMlQELQdEADJQBC0HSAAyTAQtB0wAMkgELQdUADJEBC0HUAAyQAQtB1gAMjwELQdcADI4BC0HYAAyNAQtB2QAMjAELQdoADIsBC0HbAAyKAQtB3AAMiQELQd0ADIgBC0HeAAyHAQtB3wAMhgELQeAADIUBC0HhAAyEAQtB4gAMgwELQeMADIIBC0HkAAyBAQtB5QAMgAELQeIBDH8LQeYADH4LQecADH0LQQYMfAtB6AAMewtBBQx6C0HpAAx5C0EEDHgLQeoADHcLQesADHYLQewADHULQe0ADHQLQQMMcwtB7gAMcgtB7wAMcQtB8AAMcAtB8gAMbwtB8QAMbgtB8wAMbQtB9AAMbAtB9QAMawtB9gAMagtBAgxpC0H3AAxoC0H4AAxnC0H5AAxmC0H6AAxlC0H7AAxkC0H8AAxjC0H9AAxiC0H+AAxhC0H/AAxgC0GAAQxfC0GBAQxeC0GCAQxdC0GDAQxcC0GEAQxbC0GFAQxaC0GGAQxZC0GHAQxYC0GIAQxXC0GJAQxWC0GKAQxVC0GLAQxUC0GMAQxTC0GNAQxSC0GOAQxRC0GPAQxQC0GQAQxPC0GRAQxOC0GSAQxNC0GTAQxMC0GUAQxLC0GVAQxKC0GWAQxJC0GXAQxIC0GYAQxHC0GZAQxGC0GaAQxFC0GbAQxEC0GcAQxDC0GdAQxCC0GeAQxBC0GfAQxAC0GgAQw/C0GhAQw+C0GiAQw9C0GjAQw8C0GkAQw7C0GlAQw6C0GmAQw5C0GnAQw4C0GoAQw3C0GpAQw2C0GqAQw1C0GrAQw0C0GsAQwzC0GtAQwyC0GuAQwxC0GvAQwwC0GwAQwvC0GxAQwuC0GyAQwtC0GzAQwsC0G0AQwrC0G1AQwqC0G2AQwpC0G3AQwoC0G4AQwnC0G5AQwmC0G6AQwlC0G7AQwkC0G8AQwjC0G9AQwiC0G+AQwhC0G/AQwgC0HAAQwfC0HBAQweC0HCAQwdC0EBDBwLQcMBDBsLQcQBDBoLQcUBDBkLQcYBDBgLQccBDBcLQcgBDBYLQckBDBULQcoBDBQLQcsBDBMLQcwBDBILQc0BDBELQc4BDBALQc8BDA8LQdABDA4LQdEBDA0LQdIBDAwLQdMBDAsLQdQBDAoLQdUBDAkLQdYBDAgLQeMBDAcLQdcBDAYLQdgBDAULQdkBDAQLQdoBDAMLQdsBDAILQd0BDAELQdwBCyECA0ACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAMCfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAn8CQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAwJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCACDuMBAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISMkJScoKZ4DmwOaA5EDigODA4AD/QL7AvgC8gLxAu8C7QLoAucC5gLlAuQC3ALbAtoC2QLYAtcC1gLVAs8CzgLMAssCygLJAsgCxwLGAsQCwwK+ArwCugK5ArgCtwK2ArUCtAKzArICsQKwAq4CrQKpAqgCpwKmAqUCpAKjAqICoQKgAp8CmAKQAowCiwKKAoEC/gH9AfwB+wH6AfkB+AH3AfUB8wHwAesB6QHoAecB5gHlAeQB4wHiAeEB4AHfAd4B3QHcAdoB2QHYAdcB1gHVAdQB0wHSAdEB0AHPAc4BzQHMAcsBygHJAcgBxwHGAcUBxAHDAcIBwQHAAb8BvgG9AbwBuwG6AbkBuAG3AbYBtQG0AbMBsgGxAbABrwGuAa0BrAGrAaoBqQGoAacBpgGlAaQBowGiAZ8BngGZAZgBlwGWAZUBlAGTAZIBkQGQAY8BjQGMAYcBhgGFAYQBgwGCAX18e3p5dnV0UFFSU1RVCyABIARHDXJB/QEhAgy+AwsgASAERw2YAUHbASECDL0DCyABIARHDfEBQY4BIQIMvAMLIAEgBEcN/AFBhAEhAgy7AwsgASAERw2KAkH/ACECDLoDCyABIARHDZECQf0AIQIMuQMLIAEgBEcNlAJB+wAhAgy4AwsgASAERw0eQR4hAgy3AwsgASAERw0ZQRghAgy2AwsgASAERw3KAkHNACECDLUDCyABIARHDdUCQcYAIQIMtAMLIAEgBEcN1gJBwwAhAgyzAwsgASAERw3cAkE4IQIMsgMLIAMtADBBAUYNrQMMiQMLQQAhAAJAAkACQCADLQAqRQ0AIAMtACtFDQAgAy8BMiICQQJxRQ0BDAILIAMvATIiAkEBcUUNAQtBASEAIAMtAChBAUYNACADLwE0IgZB5ABrQeQASQ0AIAZBzAFGDQAgBkGwAkYNACACQcAAcQ0AQQAhACACQYgEcUGABEYNACACQShxQQBHIQALIANBADsBMiADQQA6ADECQCAARQRAIANBADoAMSADLQAuQQRxDQEMsQMLIANCADcDIAsgA0EAOgAxIANBAToANgxIC0EAIQACQCADKAI4IgJFDQAgAigCMCICRQ0AIAMgAhEAACEACyAARQ1IIABBFUcNYiADQQQ2AhwgAyABNgIUIANB0hs2AhAgA0EVNgIMQQAhAgyvAwsgASAERgRAQQYhAgyvAwsgAS0AAEEKRw0ZIAFBAWohAQwaCyADQgA3AyBBEiECDJQDCyABIARHDYoDQSMhAgysAwsgASAERgRAQQchAgysAwsCQAJAIAEtAABBCmsOBAEYGAAYCyABQQFqIQFBECECDJMDCyABQQFqIQEgA0Evai0AAEEBcQ0XQQAhAiADQQA2AhwgAyABNgIUIANBmSA2AhAgA0EZNgIMDKsDCyADIAMpAyAiDCAEIAFrrSIKfSILQgAgCyAMWBs3AyAgCiAMWg0YQQghAgyqAwsgASAERwRAIANBCTYCCCADIAE2AgRBFCECDJEDC0EJIQIMqQMLIAMpAyBQDa4CDEMLIAEgBEYEQEELIQIMqAMLIAEtAABBCkcNFiABQQFqIQEMFwsgA0Evai0AAEEBcUUNGQwmC0EAIQACQCADKAI4IgJFDQAgAigCUCICRQ0AIAMgAhEAACEACyAADRkMQgtBACEAAkAgAygCOCICRQ0AIAIoAlAiAkUNACADIAIRAAAhAAsgAA0aDCQLQQAhAAJAIAMoAjgiAkUNACACKAJQIgJFDQAgAyACEQAAIQALIAANGwwyCyADQS9qLQAAQQFxRQ0cDCILQQAhAAJAIAMoAjgiAkUNACACKAJUIgJFDQAgAyACEQAAIQALIAANHAxCC0EAIQACQCADKAI4IgJFDQAgAigCVCICRQ0AIAMgAhEAACEACyAADR0MIAsgASAERgRAQRMhAgygAwsCQCABLQAAIgBBCmsOBB8jIwAiCyABQQFqIQEMHwtBACEAAkAgAygCOCICRQ0AIAIoAlQiAkUNACADIAIRAAAhAAsgAA0iDEILIAEgBEYEQEEWIQIMngMLIAEtAABBwMEAai0AAEEBRw0jDIMDCwJAA0AgAS0AAEGwO2otAAAiAEEBRwRAAkAgAEECaw4CAwAnCyABQQFqIQFBISECDIYDCyAEIAFBAWoiAUcNAAtBGCECDJ0DCyADKAIEIQBBACECIANBADYCBCADIAAgAUEBaiIBEDQiAA0hDEELQQAhAAJAIAMoAjgiAkUNACACKAJUIgJFDQAgAyACEQAAIQALIAANIwwqCyABIARGBEBBHCECDJsDCyADQQo2AgggAyABNgIEQQAhAAJAIAMoAjgiAkUNACACKAJQIgJFDQAgAyACEQAAIQALIAANJUEkIQIMgQMLIAEgBEcEQANAIAEtAABBsD1qLQAAIgBBA0cEQCAAQQFrDgUYGiaCAyUmCyAEIAFBAWoiAUcNAAtBGyECDJoDC0EbIQIMmQMLA0AgAS0AAEGwP2otAAAiAEEDRwRAIABBAWsOBQ8RJxMmJwsgBCABQQFqIgFHDQALQR4hAgyYAwsgASAERwRAIANBCzYCCCADIAE2AgRBByECDP8CC0EfIQIMlwMLIAEgBEYEQEEgIQIMlwMLAkAgAS0AAEENaw4ULj8/Pz8/Pz8/Pz8/Pz8/Pz8/PwA/C0EAIQIgA0EANgIcIANBvws2AhAgA0ECNgIMIAMgAUEBajYCFAyWAwsgA0EvaiECA0AgASAERgRAQSEhAgyXAwsCQAJAAkAgAS0AACIAQQlrDhgCACkpASkpKSkpKSkpKSkpKSkpKSkpKQInCyABQQFqIQEgA0Evai0AAEEBcUUNCgwYCyABQQFqIQEMFwsgAUEBaiEBIAItAABBAnENAAtBACECIANBADYCHCADIAE2AhQgA0GfFTYCECADQQw2AgwMlQMLIAMtAC5BgAFxRQ0BC0EAIQACQCADKAI4IgJFDQAgAigCXCICRQ0AIAMgAhEAACEACyAARQ3mAiAAQRVGBEAgA0EkNgIcIAMgATYCFCADQZsbNgIQIANBFTYCDEEAIQIMlAMLQQAhAiADQQA2AhwgAyABNgIUIANBkA42AhAgA0EUNgIMDJMDC0EAIQIgA0EANgIcIAMgATYCFCADQb4gNgIQIANBAjYCDAySAwsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEgDKdqIgEQMiIARQ0rIANBBzYCHCADIAE2AhQgAyAANgIMDJEDCyADLQAuQcAAcUUNAQtBACEAAkAgAygCOCICRQ0AIAIoAlgiAkUNACADIAIRAAAhAAsgAEUNKyAAQRVGBEAgA0EKNgIcIAMgATYCFCADQesZNgIQIANBFTYCDEEAIQIMkAMLQQAhAiADQQA2AhwgAyABNgIUIANBkww2AhAgA0ETNgIMDI8DC0EAIQIgA0EANgIcIAMgATYCFCADQYIVNgIQIANBAjYCDAyOAwtBACECIANBADYCHCADIAE2AhQgA0HdFDYCECADQRk2AgwMjQMLQQAhAiADQQA2AhwgAyABNgIUIANB5h02AhAgA0EZNgIMDIwDCyAAQRVGDT1BACECIANBADYCHCADIAE2AhQgA0HQDzYCECADQSI2AgwMiwMLIAMoAgQhAEEAIQIgA0EANgIEIAMgACABEDMiAEUNKCADQQ02AhwgAyABNgIUIAMgADYCDAyKAwsgAEEVRg06QQAhAiADQQA2AhwgAyABNgIUIANB0A82AhAgA0EiNgIMDIkDCyADKAIEIQBBACECIANBADYCBCADIAAgARAzIgBFBEAgAUEBaiEBDCgLIANBDjYCHCADIAA2AgwgAyABQQFqNgIUDIgDCyAAQRVGDTdBACECIANBADYCHCADIAE2AhQgA0HQDzYCECADQSI2AgwMhwMLIAMoAgQhAEEAIQIgA0EANgIEIAMgACABEDMiAEUEQCABQQFqIQEMJwsgA0EPNgIcIAMgADYCDCADIAFBAWo2AhQMhgMLQQAhAiADQQA2AhwgAyABNgIUIANB4hc2AhAgA0EZNgIMDIUDCyAAQRVGDTNBACECIANBADYCHCADIAE2AhQgA0HWDDYCECADQSM2AgwMhAMLIAMoAgQhAEEAIQIgA0EANgIEIAMgACABEDQiAEUNJSADQRE2AhwgAyABNgIUIAMgADYCDAyDAwsgAEEVRg0wQQAhAiADQQA2AhwgAyABNgIUIANB1gw2AhAgA0EjNgIMDIIDCyADKAIEIQBBACECIANBADYCBCADIAAgARA0IgBFBEAgAUEBaiEBDCULIANBEjYCHCADIAA2AgwgAyABQQFqNgIUDIEDCyADQS9qLQAAQQFxRQ0BC0EXIQIM5gILQQAhAiADQQA2AhwgAyABNgIUIANB4hc2AhAgA0EZNgIMDP4CCyAAQTtHDQAgAUEBaiEBDAwLQQAhAiADQQA2AhwgAyABNgIUIANBkhg2AhAgA0ECNgIMDPwCCyAAQRVGDShBACECIANBADYCHCADIAE2AhQgA0HWDDYCECADQSM2AgwM+wILIANBFDYCHCADIAE2AhQgAyAANgIMDPoCCyADKAIEIQBBACECIANBADYCBCADIAAgARA0IgBFBEAgAUEBaiEBDPUCCyADQRU2AhwgAyAANgIMIAMgAUEBajYCFAz5AgsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEQNCIARQRAIAFBAWohAQzzAgsgA0EXNgIcIAMgADYCDCADIAFBAWo2AhQM+AILIABBFUYNI0EAIQIgA0EANgIcIAMgATYCFCADQdYMNgIQIANBIzYCDAz3AgsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEQNCIARQRAIAFBAWohAQwdCyADQRk2AhwgAyAANgIMIAMgAUEBajYCFAz2AgsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEQNCIARQRAIAFBAWohAQzvAgsgA0EaNgIcIAMgADYCDCADIAFBAWo2AhQM9QILIABBFUYNH0EAIQIgA0EANgIcIAMgATYCFCADQdAPNgIQIANBIjYCDAz0AgsgAygCBCEAIANBADYCBCADIAAgARAzIgBFBEAgAUEBaiEBDBsLIANBHDYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgzzAgsgAygCBCEAIANBADYCBCADIAAgARAzIgBFBEAgAUEBaiEBDOsCCyADQR02AhwgAyAANgIMIAMgAUEBajYCFEEAIQIM8gILIABBO0cNASABQQFqIQELQSYhAgzXAgtBACECIANBADYCHCADIAE2AhQgA0GfFTYCECADQQw2AgwM7wILIAEgBEcEQANAIAEtAABBIEcNhAIgBCABQQFqIgFHDQALQSwhAgzvAgtBLCECDO4CCyABIARGBEBBNCECDO4CCwJAAkADQAJAIAEtAABBCmsOBAIAAAMACyAEIAFBAWoiAUcNAAtBNCECDO8CCyADKAIEIQAgA0EANgIEIAMgACABEDEiAEUNnwIgA0EyNgIcIAMgATYCFCADIAA2AgxBACECDO4CCyADKAIEIQAgA0EANgIEIAMgACABEDEiAEUEQCABQQFqIQEMnwILIANBMjYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgztAgsgASAERwRAAkADQCABLQAAQTBrIgBB/wFxQQpPBEBBOiECDNcCCyADKQMgIgtCmbPmzJmz5swZVg0BIAMgC0IKfiIKNwMgIAogAK1C/wGDIgtCf4VWDQEgAyAKIAt8NwMgIAQgAUEBaiIBRw0AC0HAACECDO4CCyADKAIEIQAgA0EANgIEIAMgACABQQFqIgEQMSIADRcM4gILQcAAIQIM7AILIAEgBEYEQEHJACECDOwCCwJAA0ACQCABLQAAQQlrDhgAAqICogKpAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAgCiAgsgBCABQQFqIgFHDQALQckAIQIM7AILIAFBAWohASADQS9qLQAAQQFxDaUCIANBADYCHCADIAE2AhQgA0GXEDYCECADQQo2AgxBACECDOsCCyABIARHBEADQCABLQAAQSBHDRUgBCABQQFqIgFHDQALQfgAIQIM6wILQfgAIQIM6gILIANBAjoAKAw4C0EAIQIgA0EANgIcIANBvws2AhAgA0ECNgIMIAMgAUEBajYCFAzoAgtBACECDM4CC0ENIQIMzQILQRMhAgzMAgtBFSECDMsCC0EWIQIMygILQRghAgzJAgtBGSECDMgCC0EaIQIMxwILQRshAgzGAgtBHCECDMUCC0EdIQIMxAILQR4hAgzDAgtBHyECDMICC0EgIQIMwQILQSIhAgzAAgtBIyECDL8CC0ElIQIMvgILQeUAIQIMvQILIANBPTYCHCADIAE2AhQgAyAANgIMQQAhAgzVAgsgA0EbNgIcIAMgATYCFCADQaQcNgIQIANBFTYCDEEAIQIM1AILIANBIDYCHCADIAE2AhQgA0GYGjYCECADQRU2AgxBACECDNMCCyADQRM2AhwgAyABNgIUIANBmBo2AhAgA0EVNgIMQQAhAgzSAgsgA0ELNgIcIAMgATYCFCADQZgaNgIQIANBFTYCDEEAIQIM0QILIANBEDYCHCADIAE2AhQgA0GYGjYCECADQRU2AgxBACECDNACCyADQSA2AhwgAyABNgIUIANBpBw2AhAgA0EVNgIMQQAhAgzPAgsgA0ELNgIcIAMgATYCFCADQaQcNgIQIANBFTYCDEEAIQIMzgILIANBDDYCHCADIAE2AhQgA0GkHDYCECADQRU2AgxBACECDM0CC0EAIQIgA0EANgIcIAMgATYCFCADQd0ONgIQIANBEjYCDAzMAgsCQANAAkAgAS0AAEEKaw4EAAICAAILIAQgAUEBaiIBRw0AC0H9ASECDMwCCwJAAkAgAy0ANkEBRw0AQQAhAAJAIAMoAjgiAkUNACACKAJgIgJFDQAgAyACEQAAIQALIABFDQAgAEEVRw0BIANB/AE2AhwgAyABNgIUIANB3Bk2AhAgA0EVNgIMQQAhAgzNAgtB3AEhAgyzAgsgA0EANgIcIAMgATYCFCADQfkLNgIQIANBHzYCDEEAIQIMywILAkACQCADLQAoQQFrDgIEAQALQdsBIQIMsgILQdQBIQIMsQILIANBAjoAMUEAIQACQCADKAI4IgJFDQAgAigCACICRQ0AIAMgAhEAACEACyAARQRAQd0BIQIMsQILIABBFUcEQCADQQA2AhwgAyABNgIUIANBtAw2AhAgA0EQNgIMQQAhAgzKAgsgA0H7ATYCHCADIAE2AhQgA0GBGjYCECADQRU2AgxBACECDMkCCyABIARGBEBB+gEhAgzJAgsgAS0AAEHIAEYNASADQQE6ACgLQcABIQIMrgILQdoBIQIMrQILIAEgBEcEQCADQQw2AgggAyABNgIEQdkBIQIMrQILQfkBIQIMxQILIAEgBEYEQEH4ASECDMUCCyABLQAAQcgARw0EIAFBAWohAUHYASECDKsCCyABIARGBEBB9wEhAgzEAgsCQAJAIAEtAABBxQBrDhAABQUFBQUFBQUFBQUFBQUBBQsgAUEBaiEBQdYBIQIMqwILIAFBAWohAUHXASECDKoCC0H2ASECIAEgBEYNwgIgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABButUAai0AAEcNAyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMwwILIAMoAgQhACADQgA3AwAgAyAAIAZBAWoiARAuIgBFBEBB4wEhAgyqAgsgA0H1ATYCHCADIAE2AhQgAyAANgIMQQAhAgzCAgtB9AEhAiABIARGDcECIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbjVAGotAABHDQIgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADMICCyADQYEEOwEoIAMoAgQhACADQgA3AwAgAyAAIAZBAWoiARAuIgANAwwCCyADQQA2AgALQQAhAiADQQA2AhwgAyABNgIUIANB5R82AhAgA0EINgIMDL8CC0HVASECDKUCCyADQfMBNgIcIAMgATYCFCADIAA2AgxBACECDL0CC0EAIQACQCADKAI4IgJFDQAgAigCQCICRQ0AIAMgAhEAACEACyAARQ1uIABBFUcEQCADQQA2AhwgAyABNgIUIANBgg82AhAgA0EgNgIMQQAhAgy9AgsgA0GPATYCHCADIAE2AhQgA0HsGzYCECADQRU2AgxBACECDLwCCyABIARHBEAgA0ENNgIIIAMgATYCBEHTASECDKMCC0HyASECDLsCCyABIARGBEBB8QEhAgy7AgsCQAJAAkAgAS0AAEHIAGsOCwABCAgICAgICAgCCAsgAUEBaiEBQdABIQIMowILIAFBAWohAUHRASECDKICCyABQQFqIQFB0gEhAgyhAgtB8AEhAiABIARGDbkCIAMoAgAiACAEIAFraiEGIAEgAGtBAmohBQNAIAEtAAAgAEG11QBqLQAARw0EIABBAkYNAyAAQQFqIQAgBCABQQFqIgFHDQALIAMgBjYCAAy5AgtB7wEhAiABIARGDbgCIAMoAgAiACAEIAFraiEGIAEgAGtBAWohBQNAIAEtAAAgAEGz1QBqLQAARw0DIABBAUYNAiAAQQFqIQAgBCABQQFqIgFHDQALIAMgBjYCAAy4AgtB7gEhAiABIARGDbcCIAMoAgAiACAEIAFraiEGIAEgAGtBAmohBQNAIAEtAAAgAEGw1QBqLQAARw0CIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBjYCAAy3AgsgAygCBCEAIANCADcDACADIAAgBUEBaiIBECsiAEUNAiADQewBNgIcIAMgATYCFCADIAA2AgxBACECDLYCCyADQQA2AgALIAMoAgQhACADQQA2AgQgAyAAIAEQKyIARQ2cAiADQe0BNgIcIAMgATYCFCADIAA2AgxBACECDLQCC0HPASECDJoCC0EAIQACQCADKAI4IgJFDQAgAigCNCICRQ0AIAMgAhEAACEACwJAIAAEQCAAQRVGDQEgA0EANgIcIAMgATYCFCADQeoNNgIQIANBJjYCDEEAIQIMtAILQc4BIQIMmgILIANB6wE2AhwgAyABNgIUIANBgBs2AhAgA0EVNgIMQQAhAgyyAgsgASAERgRAQesBIQIMsgILIAEtAABBL0YEQCABQQFqIQEMAQsgA0EANgIcIAMgATYCFCADQbI4NgIQIANBCDYCDEEAIQIMsQILQc0BIQIMlwILIAEgBEcEQCADQQ42AgggAyABNgIEQcwBIQIMlwILQeoBIQIMrwILIAEgBEYEQEHpASECDK8CCyABLQAAQTBrIgBB/wFxQQpJBEAgAyAAOgAqIAFBAWohAUHLASECDJYCCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNlwIgA0HoATYCHCADIAE2AhQgAyAANgIMQQAhAgyuAgsgASAERgRAQecBIQIMrgILAkAgAS0AAEEuRgRAIAFBAWohAQwBCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNmAIgA0HmATYCHCADIAE2AhQgAyAANgIMQQAhAgyuAgtBygEhAgyUAgsgASAERgRAQeUBIQIMrQILQQAhAEEBIQVBASEHQQAhAgJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAIAEtAABBMGsOCgoJAAECAwQFBggLC0ECDAYLQQMMBQtBBAwEC0EFDAMLQQYMAgtBBwwBC0EICyECQQAhBUEAIQcMAgtBCSECQQEhAEEAIQVBACEHDAELQQAhBUEBIQILIAMgAjoAKyABQQFqIQECQAJAIAMtAC5BEHENAAJAAkACQCADLQAqDgMBAAIECyAHRQ0DDAILIAANAQwCCyAFRQ0BCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNAiADQeIBNgIcIAMgATYCFCADIAA2AgxBACECDK8CCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNmgIgA0HjATYCHCADIAE2AhQgAyAANgIMQQAhAgyuAgsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDZgCIANB5AE2AhwgAyABNgIUIAMgADYCDAytAgtByQEhAgyTAgtBACEAAkAgAygCOCICRQ0AIAIoAkQiAkUNACADIAIRAAAhAAsCQCAABEAgAEEVRg0BIANBADYCHCADIAE2AhQgA0GkDTYCECADQSE2AgxBACECDK0CC0HIASECDJMCCyADQeEBNgIcIAMgATYCFCADQdAaNgIQIANBFTYCDEEAIQIMqwILIAEgBEYEQEHhASECDKsCCwJAIAEtAABBIEYEQCADQQA7ATQgAUEBaiEBDAELIANBADYCHCADIAE2AhQgA0GZETYCECADQQk2AgxBACECDKsCC0HHASECDJECCyABIARGBEBB4AEhAgyqAgsCQCABLQAAQTBrQf8BcSICQQpJBEAgAUEBaiEBAkAgAy8BNCIAQZkzSw0AIAMgAEEKbCIAOwE0IABB/v8DcSACQf//A3NLDQAgAyAAIAJqOwE0DAILQQAhAiADQQA2AhwgAyABNgIUIANBlR42AhAgA0ENNgIMDKsCCyADQQA2AhwgAyABNgIUIANBlR42AhAgA0ENNgIMQQAhAgyqAgtBxgEhAgyQAgsgASAERgRAQd8BIQIMqQILAkAgAS0AAEEwa0H/AXEiAkEKSQRAIAFBAWohAQJAIAMvATQiAEGZM0sNACADIABBCmwiADsBNCAAQf7/A3EgAkH//wNzSw0AIAMgACACajsBNAwCC0EAIQIgA0EANgIcIAMgATYCFCADQZUeNgIQIANBDTYCDAyqAgsgA0EANgIcIAMgATYCFCADQZUeNgIQIANBDTYCDEEAIQIMqQILQcUBIQIMjwILIAEgBEYEQEHeASECDKgCCwJAIAEtAABBMGtB/wFxIgJBCkkEQCABQQFqIQECQCADLwE0IgBBmTNLDQAgAyAAQQpsIgA7ATQgAEH+/wNxIAJB//8Dc0sNACADIAAgAmo7ATQMAgtBACECIANBADYCHCADIAE2AhQgA0GVHjYCECADQQ02AgwMqQILIANBADYCHCADIAE2AhQgA0GVHjYCECADQQ02AgxBACECDKgCC0HEASECDI4CCyABIARGBEBB3QEhAgynAgsCQAJAAkACQCABLQAAQQprDhcCAwMAAwMDAwMDAwMDAwMDAwMDAwMDAQMLIAFBAWoMBQsgAUEBaiEBQcMBIQIMjwILIAFBAWohASADQS9qLQAAQQFxDQggA0EANgIcIAMgATYCFCADQY0LNgIQIANBDTYCDEEAIQIMpwILIANBADYCHCADIAE2AhQgA0GNCzYCECADQQ02AgxBACECDKYCCyABIARHBEAgA0EPNgIIIAMgATYCBEEBIQIMjQILQdwBIQIMpQILAkACQANAAkAgAS0AAEEKaw4EAgAAAwALIAQgAUEBaiIBRw0AC0HbASECDKYCCyADKAIEIQAgA0EANgIEIAMgACABEC0iAEUEQCABQQFqIQEMBAsgA0HaATYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgylAgsgAygCBCEAIANBADYCBCADIAAgARAtIgANASABQQFqCyEBQcEBIQIMigILIANB2QE2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIMogILQcIBIQIMiAILIANBL2otAABBAXENASADQQA2AhwgAyABNgIUIANB5Bw2AhAgA0EZNgIMQQAhAgygAgsgASAERgRAQdkBIQIMoAILAkACQAJAIAEtAABBCmsOBAECAgACCyABQQFqIQEMAgsgAUEBaiEBDAELIAMtAC5BwABxRQ0BC0EAIQACQCADKAI4IgJFDQAgAigCPCICRQ0AIAMgAhEAACEACyAARQ2gASAAQRVGBEAgA0HZADYCHCADIAE2AhQgA0G3GjYCECADQRU2AgxBACECDJ8CCyADQQA2AhwgAyABNgIUIANBgA02AhAgA0EbNgIMQQAhAgyeAgsgA0EANgIcIAMgATYCFCADQdwoNgIQIANBAjYCDEEAIQIMnQILIAEgBEcEQCADQQw2AgggAyABNgIEQb8BIQIMhAILQdgBIQIMnAILIAEgBEYEQEHXASECDJwCCwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAS0AAEHBAGsOFQABAgNaBAUGWlpaBwgJCgsMDQ4PEFoLIAFBAWohAUH7ACECDJICCyABQQFqIQFB/AAhAgyRAgsgAUEBaiEBQYEBIQIMkAILIAFBAWohAUGFASECDI8CCyABQQFqIQFBhgEhAgyOAgsgAUEBaiEBQYkBIQIMjQILIAFBAWohAUGKASECDIwCCyABQQFqIQFBjQEhAgyLAgsgAUEBaiEBQZYBIQIMigILIAFBAWohAUGXASECDIkCCyABQQFqIQFBmAEhAgyIAgsgAUEBaiEBQaUBIQIMhwILIAFBAWohAUGmASECDIYCCyABQQFqIQFBrAEhAgyFAgsgAUEBaiEBQbQBIQIMhAILIAFBAWohAUG3ASECDIMCCyABQQFqIQFBvgEhAgyCAgsgASAERgRAQdYBIQIMmwILIAEtAABBzgBHDUggAUEBaiEBQb0BIQIMgQILIAEgBEYEQEHVASECDJoCCwJAAkACQCABLQAAQcIAaw4SAEpKSkpKSkpKSgFKSkpKSkoCSgsgAUEBaiEBQbgBIQIMggILIAFBAWohAUG7ASECDIECCyABQQFqIQFBvAEhAgyAAgtB1AEhAiABIARGDZgCIAMoAgAiACAEIAFraiEFIAEgAGtBB2ohBgJAA0AgAS0AACAAQajVAGotAABHDUUgAEEHRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJkCCyADQQA2AgAgBkEBaiEBQRsMRQsgASAERgRAQdMBIQIMmAILAkACQCABLQAAQckAaw4HAEdHR0dHAUcLIAFBAWohAUG5ASECDP8BCyABQQFqIQFBugEhAgz+AQtB0gEhAiABIARGDZYCIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQabVAGotAABHDUMgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJcCCyADQQA2AgAgBkEBaiEBQQ8MQwtB0QEhAiABIARGDZUCIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQaTVAGotAABHDUIgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJYCCyADQQA2AgAgBkEBaiEBQSAMQgtB0AEhAiABIARGDZQCIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQaHVAGotAABHDUEgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJUCCyADQQA2AgAgBkEBaiEBQRIMQQsgASAERgRAQc8BIQIMlAILAkACQCABLQAAQcUAaw4OAENDQ0NDQ0NDQ0NDQwFDCyABQQFqIQFBtQEhAgz7AQsgAUEBaiEBQbYBIQIM+gELQc4BIQIgASAERg2SAiADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGe1QBqLQAARw0/IABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyTAgsgA0EANgIAIAZBAWohAUEHDD8LQc0BIQIgASAERg2RAiADKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGY1QBqLQAARw0+IABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAySAgsgA0EANgIAIAZBAWohAUEoDD4LIAEgBEYEQEHMASECDJECCwJAAkACQCABLQAAQcUAaw4RAEFBQUFBQUFBQQFBQUFBQQJBCyABQQFqIQFBsQEhAgz5AQsgAUEBaiEBQbIBIQIM+AELIAFBAWohAUGzASECDPcBC0HLASECIAEgBEYNjwIgAygCACIAIAQgAWtqIQUgASAAa0EGaiEGAkADQCABLQAAIABBkdUAai0AAEcNPCAAQQZGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMkAILIANBADYCACAGQQFqIQFBGgw8C0HKASECIAEgBEYNjgIgAygCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABBjdUAai0AAEcNOyAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMjwILIANBADYCACAGQQFqIQFBIQw7CyABIARGBEBByQEhAgyOAgsCQAJAIAEtAABBwQBrDhQAPT09PT09PT09PT09PT09PT09AT0LIAFBAWohAUGtASECDPUBCyABQQFqIQFBsAEhAgz0AQsgASAERgRAQcgBIQIMjQILAkACQCABLQAAQdUAaw4LADw8PDw8PDw8PAE8CyABQQFqIQFBrgEhAgz0AQsgAUEBaiEBQa8BIQIM8wELQccBIQIgASAERg2LAiADKAIAIgAgBCABa2ohBSABIABrQQhqIQYCQANAIAEtAAAgAEGE1QBqLQAARw04IABBCEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyMAgsgA0EANgIAIAZBAWohAUEqDDgLIAEgBEYEQEHGASECDIsCCyABLQAAQdAARw04IAFBAWohAUElDDcLQcUBIQIgASAERg2JAiADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGB1QBqLQAARw02IABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyKAgsgA0EANgIAIAZBAWohAUEODDYLIAEgBEYEQEHEASECDIkCCyABLQAAQcUARw02IAFBAWohAUGrASECDO8BCyABIARGBEBBwwEhAgyIAgsCQAJAAkACQCABLQAAQcIAaw4PAAECOTk5OTk5OTk5OTkDOQsgAUEBaiEBQacBIQIM8QELIAFBAWohAUGoASECDPABCyABQQFqIQFBqQEhAgzvAQsgAUEBaiEBQaoBIQIM7gELQcIBIQIgASAERg2GAiADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEH+1ABqLQAARw0zIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyHAgsgA0EANgIAIAZBAWohAUEUDDMLQcEBIQIgASAERg2FAiADKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEH51ABqLQAARw0yIABBBEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyGAgsgA0EANgIAIAZBAWohAUErDDILQcABIQIgASAERg2EAiADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEH21ABqLQAARw0xIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyFAgsgA0EANgIAIAZBAWohAUEsDDELQb8BIQIgASAERg2DAiADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGh1QBqLQAARw0wIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyEAgsgA0EANgIAIAZBAWohAUERDDALQb4BIQIgASAERg2CAiADKAIAIgAgBCABa2ohBSABIABrQQNqIQYCQANAIAEtAAAgAEHy1ABqLQAARw0vIABBA0YNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyDAgsgA0EANgIAIAZBAWohAUEuDC8LIAEgBEYEQEG9ASECDIICCwJAAkACQAJAAkAgAS0AAEHBAGsOFQA0NDQ0NDQ0NDQ0ATQ0AjQ0AzQ0BDQLIAFBAWohAUGbASECDOwBCyABQQFqIQFBnAEhAgzrAQsgAUEBaiEBQZ0BIQIM6gELIAFBAWohAUGiASECDOkBCyABQQFqIQFBpAEhAgzoAQsgASAERgRAQbwBIQIMgQILAkACQCABLQAAQdIAaw4DADABMAsgAUEBaiEBQaMBIQIM6AELIAFBAWohAUEEDC0LQbsBIQIgASAERg3/ASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHw1ABqLQAARw0sIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyAAgsgA0EANgIAIAZBAWohAUEdDCwLIAEgBEYEQEG6ASECDP8BCwJAAkAgAS0AAEHJAGsOBwEuLi4uLgAuCyABQQFqIQFBoQEhAgzmAQsgAUEBaiEBQSIMKwsgASAERgRAQbkBIQIM/gELIAEtAABB0ABHDSsgAUEBaiEBQaABIQIM5AELIAEgBEYEQEG4ASECDP0BCwJAAkAgAS0AAEHGAGsOCwAsLCwsLCwsLCwBLAsgAUEBaiEBQZ4BIQIM5AELIAFBAWohAUGfASECDOMBC0G3ASECIAEgBEYN+wEgAygCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABB7NQAai0AAEcNKCAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM/AELIANBADYCACAGQQFqIQFBDQwoC0G2ASECIAEgBEYN+gEgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBodUAai0AAEcNJyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM+wELIANBADYCACAGQQFqIQFBDAwnC0G1ASECIAEgBEYN+QEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB6tQAai0AAEcNJiAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM+gELIANBADYCACAGQQFqIQFBAwwmC0G0ASECIAEgBEYN+AEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB6NQAai0AAEcNJSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM+QELIANBADYCACAGQQFqIQFBJgwlCyABIARGBEBBswEhAgz4AQsCQAJAIAEtAABB1ABrDgIAAScLIAFBAWohAUGZASECDN8BCyABQQFqIQFBmgEhAgzeAQtBsgEhAiABIARGDfYBIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQebUAGotAABHDSMgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPcBCyADQQA2AgAgBkEBaiEBQScMIwtBsQEhAiABIARGDfUBIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQeTUAGotAABHDSIgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPYBCyADQQA2AgAgBkEBaiEBQRwMIgtBsAEhAiABIARGDfQBIAMoAgAiACAEIAFraiEFIAEgAGtBBWohBgJAA0AgAS0AACAAQd7UAGotAABHDSEgAEEFRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPUBCyADQQA2AgAgBkEBaiEBQQYMIQtBrwEhAiABIARGDfMBIAMoAgAiACAEIAFraiEFIAEgAGtBBGohBgJAA0AgAS0AACAAQdnUAGotAABHDSAgAEEERg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPQBCyADQQA2AgAgBkEBaiEBQRkMIAsgASAERgRAQa4BIQIM8wELAkACQAJAAkAgAS0AAEEtaw4jACQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkASQkJCQkAiQkJAMkCyABQQFqIQFBjgEhAgzcAQsgAUEBaiEBQY8BIQIM2wELIAFBAWohAUGUASECDNoBCyABQQFqIQFBlQEhAgzZAQtBrQEhAiABIARGDfEBIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQdfUAGotAABHDR4gAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPIBCyADQQA2AgAgBkEBaiEBQQsMHgsgASAERgRAQawBIQIM8QELAkACQCABLQAAQcEAaw4DACABIAsgAUEBaiEBQZABIQIM2AELIAFBAWohAUGTASECDNcBCyABIARGBEBBqwEhAgzwAQsCQAJAIAEtAABBwQBrDg8AHx8fHx8fHx8fHx8fHwEfCyABQQFqIQFBkQEhAgzXAQsgAUEBaiEBQZIBIQIM1gELIAEgBEYEQEGqASECDO8BCyABLQAAQcwARw0cIAFBAWohAUEKDBsLQakBIQIgASAERg3tASADKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEHR1ABqLQAARw0aIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzuAQsgA0EANgIAIAZBAWohAUEeDBoLQagBIQIgASAERg3sASADKAIAIgAgBCABa2ohBSABIABrQQZqIQYCQANAIAEtAAAgAEHK1ABqLQAARw0ZIABBBkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAztAQsgA0EANgIAIAZBAWohAUEVDBkLQacBIQIgASAERg3rASADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHH1ABqLQAARw0YIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzsAQsgA0EANgIAIAZBAWohAUEXDBgLQaYBIQIgASAERg3qASADKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEHB1ABqLQAARw0XIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzrAQsgA0EANgIAIAZBAWohAUEYDBcLIAEgBEYEQEGlASECDOoBCwJAAkAgAS0AAEHJAGsOBwAZGRkZGQEZCyABQQFqIQFBiwEhAgzRAQsgAUEBaiEBQYwBIQIM0AELQaQBIQIgASAERg3oASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGm1QBqLQAARw0VIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzpAQsgA0EANgIAIAZBAWohAUEJDBULQaMBIQIgASAERg3nASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGk1QBqLQAARw0UIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzoAQsgA0EANgIAIAZBAWohAUEfDBQLQaIBIQIgASAERg3mASADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEG+1ABqLQAARw0TIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAznAQsgA0EANgIAIAZBAWohAUECDBMLQaEBIQIgASAERg3lASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYDQCABLQAAIABBvNQAai0AAEcNESAAQQFGDQIgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM5QELIAEgBEYEQEGgASECDOUBC0EBIAEtAABB3wBHDREaIAFBAWohAUGHASECDMsBCyADQQA2AgAgBkEBaiEBQYgBIQIMygELQZ8BIQIgASAERg3iASADKAIAIgAgBCABa2ohBSABIABrQQhqIQYCQANAIAEtAAAgAEGE1QBqLQAARw0PIABBCEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzjAQsgA0EANgIAIAZBAWohAUEpDA8LQZ4BIQIgASAERg3hASADKAIAIgAgBCABa2ohBSABIABrQQNqIQYCQANAIAEtAAAgAEG41ABqLQAARw0OIABBA0YNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAziAQsgA0EANgIAIAZBAWohAUEtDA4LIAEgBEYEQEGdASECDOEBCyABLQAAQcUARw0OIAFBAWohAUGEASECDMcBCyABIARGBEBBnAEhAgzgAQsCQAJAIAEtAABBzABrDggADw8PDw8PAQ8LIAFBAWohAUGCASECDMcBCyABQQFqIQFBgwEhAgzGAQtBmwEhAiABIARGDd4BIAMoAgAiACAEIAFraiEFIAEgAGtBBGohBgJAA0AgAS0AACAAQbPUAGotAABHDQsgAEEERg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADN8BCyADQQA2AgAgBkEBaiEBQSMMCwtBmgEhAiABIARGDd0BIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQbDUAGotAABHDQogAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADN4BCyADQQA2AgAgBkEBaiEBQQAMCgsgASAERgRAQZkBIQIM3QELAkACQCABLQAAQcgAaw4IAAwMDAwMDAEMCyABQQFqIQFB/QAhAgzEAQsgAUEBaiEBQYABIQIMwwELIAEgBEYEQEGYASECDNwBCwJAAkAgAS0AAEHOAGsOAwALAQsLIAFBAWohAUH+ACECDMMBCyABQQFqIQFB/wAhAgzCAQsgASAERgRAQZcBIQIM2wELIAEtAABB2QBHDQggAUEBaiEBQQgMBwtBlgEhAiABIARGDdkBIAMoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQazUAGotAABHDQYgAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADNoBCyADQQA2AgAgBkEBaiEBQQUMBgtBlQEhAiABIARGDdgBIAMoAgAiACAEIAFraiEFIAEgAGtBBWohBgJAA0AgAS0AACAAQabUAGotAABHDQUgAEEFRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADNkBCyADQQA2AgAgBkEBaiEBQRYMBQtBlAEhAiABIARGDdcBIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQaHVAGotAABHDQQgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADNgBCyADQQA2AgAgBkEBaiEBQRAMBAsgASAERgRAQZMBIQIM1wELAkACQCABLQAAQcMAaw4MAAYGBgYGBgYGBgYBBgsgAUEBaiEBQfkAIQIMvgELIAFBAWohAUH6ACECDL0BC0GSASECIAEgBEYN1QEgAygCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABBoNQAai0AAEcNAiAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM1gELIANBADYCACAGQQFqIQFBJAwCCyADQQA2AgAMAgsgASAERgRAQZEBIQIM1AELIAEtAABBzABHDQEgAUEBaiEBQRMLOgApIAMoAgQhACADQQA2AgQgAyAAIAEQLiIADQIMAQtBACECIANBADYCHCADIAE2AhQgA0H+HzYCECADQQY2AgwM0QELQfgAIQIMtwELIANBkAE2AhwgAyABNgIUIAMgADYCDEEAIQIMzwELQQAhAAJAIAMoAjgiAkUNACACKAJAIgJFDQAgAyACEQAAIQALIABFDQAgAEEVRg0BIANBADYCHCADIAE2AhQgA0GCDzYCECADQSA2AgxBACECDM4BC0H3ACECDLQBCyADQY8BNgIcIAMgATYCFCADQewbNgIQIANBFTYCDEEAIQIMzAELIAEgBEYEQEGPASECDMwBCwJAIAEtAABBIEYEQCABQQFqIQEMAQsgA0EANgIcIAMgATYCFCADQZsfNgIQIANBBjYCDEEAIQIMzAELQQIhAgyyAQsDQCABLQAAQSBHDQIgBCABQQFqIgFHDQALQY4BIQIMygELIAEgBEYEQEGNASECDMoBCwJAIAEtAABBCWsOBEoAAEoAC0H1ACECDLABCyADLQApQQVGBEBB9gAhAgywAQtB9AAhAgyvAQsgASAERgRAQYwBIQIMyAELIANBEDYCCCADIAE2AgQMCgsgASAERgRAQYsBIQIMxwELAkAgAS0AAEEJaw4ERwAARwALQfMAIQIMrQELIAEgBEcEQCADQRA2AgggAyABNgIEQfEAIQIMrQELQYoBIQIMxQELAkAgASAERwRAA0AgAS0AAEGg0ABqLQAAIgBBA0cEQAJAIABBAWsOAkkABAtB8AAhAgyvAQsgBCABQQFqIgFHDQALQYgBIQIMxgELQYgBIQIMxQELIANBADYCHCADIAE2AhQgA0HbIDYCECADQQc2AgxBACECDMQBCyABIARGBEBBiQEhAgzEAQsCQAJAAkAgAS0AAEGg0gBqLQAAQQFrDgNGAgABC0HyACECDKwBCyADQQA2AhwgAyABNgIUIANBtBI2AhAgA0EHNgIMQQAhAgzEAQtB6gAhAgyqAQsgASAERwRAIAFBAWohAUHvACECDKoBC0GHASECDMIBCyAEIAEiAEYEQEGGASECDMIBCyAALQAAIgFBL0YEQCAAQQFqIQFB7gAhAgypAQsgAUEJayICQRdLDQEgACEBQQEgAnRBm4CABHENQQwBCyAEIAEiAEYEQEGFASECDMEBCyAALQAAQS9HDQAgAEEBaiEBDAMLQQAhAiADQQA2AhwgAyAANgIUIANB2yA2AhAgA0EHNgIMDL8BCwJAAkACQAJAAkADQCABLQAAQaDOAGotAAAiAEEFRwRAAkACQCAAQQFrDghHBQYHCAAEAQgLQesAIQIMrQELIAFBAWohAUHtACECDKwBCyAEIAFBAWoiAUcNAAtBhAEhAgzDAQsgAUEBagwUCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNHiADQdsANgIcIAMgATYCFCADIAA2AgxBACECDMEBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNHiADQd0ANgIcIAMgATYCFCADIAA2AgxBACECDMABCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNHiADQfoANgIcIAMgATYCFCADIAA2AgxBACECDL8BCyADQQA2AhwgAyABNgIUIANB+Q82AhAgA0EHNgIMQQAhAgy+AQsgASAERgRAQYMBIQIMvgELAkAgAS0AAEGgzgBqLQAAQQFrDgg+BAUGAAgCAwcLIAFBAWohAQtBAyECDKMBCyABQQFqDA0LQQAhAiADQQA2AhwgA0HREjYCECADQQc2AgwgAyABQQFqNgIUDLoBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNFiADQdsANgIcIAMgATYCFCADIAA2AgxBACECDLkBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNFiADQd0ANgIcIAMgATYCFCADIAA2AgxBACECDLgBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNFiADQfoANgIcIAMgATYCFCADIAA2AgxBACECDLcBCyADQQA2AhwgAyABNgIUIANB+Q82AhAgA0EHNgIMQQAhAgy2AQtB7AAhAgycAQsgASAERgRAQYIBIQIMtQELIAFBAWoMAgsgASAERgRAQYEBIQIMtAELIAFBAWoMAQsgASAERg0BIAFBAWoLIQFBBCECDJgBC0GAASECDLABCwNAIAEtAABBoMwAai0AACIAQQJHBEAgAEEBRwRAQekAIQIMmQELDDELIAQgAUEBaiIBRw0AC0H/ACECDK8BCyABIARGBEBB/gAhAgyvAQsCQCABLQAAQQlrDjcvAwYvBAYGBgYGBgYGBgYGBgYGBgYGBgUGBgIGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYABgsgAUEBagshAUEFIQIMlAELIAFBAWoMBgsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQggA0HbADYCHCADIAE2AhQgAyAANgIMQQAhAgyrAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQggA0HdADYCHCADIAE2AhQgAyAANgIMQQAhAgyqAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQggA0H6ADYCHCADIAE2AhQgAyAANgIMQQAhAgypAQsgA0EANgIcIAMgATYCFCADQY0UNgIQIANBBzYCDEEAIQIMqAELAkACQAJAAkADQCABLQAAQaDKAGotAAAiAEEFRwRAAkAgAEEBaw4GLgMEBQYABgtB6AAhAgyUAQsgBCABQQFqIgFHDQALQf0AIQIMqwELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0HIANB2wA2AhwgAyABNgIUIAMgADYCDEEAIQIMqgELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0HIANB3QA2AhwgAyABNgIUIAMgADYCDEEAIQIMqQELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0HIANB+gA2AhwgAyABNgIUIAMgADYCDEEAIQIMqAELIANBADYCHCADIAE2AhQgA0HkCDYCECADQQc2AgxBACECDKcBCyABIARGDQEgAUEBagshAUEGIQIMjAELQfwAIQIMpAELAkACQAJAAkADQCABLQAAQaDIAGotAAAiAEEFRwRAIABBAWsOBCkCAwQFCyAEIAFBAWoiAUcNAAtB+wAhAgynAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQMgA0HbADYCHCADIAE2AhQgAyAANgIMQQAhAgymAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQMgA0HdADYCHCADIAE2AhQgAyAANgIMQQAhAgylAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQMgA0H6ADYCHCADIAE2AhQgAyAANgIMQQAhAgykAQsgA0EANgIcIAMgATYCFCADQbwKNgIQIANBBzYCDEEAIQIMowELQc8AIQIMiQELQdEAIQIMiAELQecAIQIMhwELIAEgBEYEQEH6ACECDKABCwJAIAEtAABBCWsOBCAAACAACyABQQFqIQFB5gAhAgyGAQsgASAERgRAQfkAIQIMnwELAkAgAS0AAEEJaw4EHwAAHwALQQAhAAJAIAMoAjgiAkUNACACKAI4IgJFDQAgAyACEQAAIQALIABFBEBB4gEhAgyGAQsgAEEVRwRAIANBADYCHCADIAE2AhQgA0HJDTYCECADQRo2AgxBACECDJ8BCyADQfgANgIcIAMgATYCFCADQeoaNgIQIANBFTYCDEEAIQIMngELIAEgBEcEQCADQQ02AgggAyABNgIEQeQAIQIMhQELQfcAIQIMnQELIAEgBEYEQEH2ACECDJ0BCwJAAkACQCABLQAAQcgAaw4LAAELCwsLCwsLCwILCyABQQFqIQFB3QAhAgyFAQsgAUEBaiEBQeAAIQIMhAELIAFBAWohAUHjACECDIMBC0H1ACECIAEgBEYNmwEgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBtdUAai0AAEcNCCAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMnAELIAMoAgQhACADQgA3AwAgAyAAIAZBAWoiARArIgAEQCADQfQANgIcIAMgATYCFCADIAA2AgxBACECDJwBC0HiACECDIIBC0EAIQACQCADKAI4IgJFDQAgAigCNCICRQ0AIAMgAhEAACEACwJAIAAEQCAAQRVGDQEgA0EANgIcIAMgATYCFCADQeoNNgIQIANBJjYCDEEAIQIMnAELQeEAIQIMggELIANB8wA2AhwgAyABNgIUIANBgBs2AhAgA0EVNgIMQQAhAgyaAQsgAy0AKSIAQSNrQQtJDQkCQCAAQQZLDQBBASAAdEHKAHFFDQAMCgtBACECIANBADYCHCADIAE2AhQgA0HtCTYCECADQQg2AgwMmQELQfIAIQIgASAERg2YASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGz1QBqLQAARw0FIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyZAQsgAygCBCEAIANCADcDACADIAAgBkEBaiIBECsiAARAIANB8QA2AhwgAyABNgIUIAMgADYCDEEAIQIMmQELQd8AIQIMfwtBACEAAkAgAygCOCICRQ0AIAIoAjQiAkUNACADIAIRAAAhAAsCQCAABEAgAEEVRg0BIANBADYCHCADIAE2AhQgA0HqDTYCECADQSY2AgxBACECDJkBC0HeACECDH8LIANB8AA2AhwgAyABNgIUIANBgBs2AhAgA0EVNgIMQQAhAgyXAQsgAy0AKUEhRg0GIANBADYCHCADIAE2AhQgA0GRCjYCECADQQg2AgxBACECDJYBC0HvACECIAEgBEYNlQEgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBsNUAai0AAEcNAiAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMlgELIAMoAgQhACADQgA3AwAgAyAAIAZBAWoiARArIgBFDQIgA0HtADYCHCADIAE2AhQgAyAANgIMQQAhAgyVAQsgA0EANgIACyADKAIEIQAgA0EANgIEIAMgACABECsiAEUNgAEgA0HuADYCHCADIAE2AhQgAyAANgIMQQAhAgyTAQtB3AAhAgx5C0EAIQACQCADKAI4IgJFDQAgAigCNCICRQ0AIAMgAhEAACEACwJAIAAEQCAAQRVGDQEgA0EANgIcIAMgATYCFCADQeoNNgIQIANBJjYCDEEAIQIMkwELQdsAIQIMeQsgA0HsADYCHCADIAE2AhQgA0GAGzYCECADQRU2AgxBACECDJEBCyADLQApIgBBI0kNACAAQS5GDQAgA0EANgIcIAMgATYCFCADQckJNgIQIANBCDYCDEEAIQIMkAELQdoAIQIMdgsgASAERgRAQesAIQIMjwELAkAgAS0AAEEvRgRAIAFBAWohAQwBCyADQQA2AhwgAyABNgIUIANBsjg2AhAgA0EINgIMQQAhAgyPAQtB2QAhAgx1CyABIARHBEAgA0EONgIIIAMgATYCBEHYACECDHULQeoAIQIMjQELIAEgBEYEQEHpACECDI0BCyABLQAAQTBrIgBB/wFxQQpJBEAgAyAAOgAqIAFBAWohAUHXACECDHQLIAMoAgQhACADQQA2AgQgAyAAIAEQLyIARQ16IANB6AA2AhwgAyABNgIUIAMgADYCDEEAIQIMjAELIAEgBEYEQEHnACECDIwBCwJAIAEtAABBLkYEQCABQQFqIQEMAQsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDXsgA0HmADYCHCADIAE2AhQgAyAANgIMQQAhAgyMAQtB1gAhAgxyCyABIARGBEBB5QAhAgyLAQtBACEAQQEhBUEBIQdBACECAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkAgAS0AAEEwaw4KCgkAAQIDBAUGCAsLQQIMBgtBAwwFC0EEDAQLQQUMAwtBBgwCC0EHDAELQQgLIQJBACEFQQAhBwwCC0EJIQJBASEAQQAhBUEAIQcMAQtBACEFQQEhAgsgAyACOgArIAFBAWohAQJAAkAgAy0ALkEQcQ0AAkACQAJAIAMtACoOAwEAAgQLIAdFDQMMAgsgAA0BDAILIAVFDQELIAMoAgQhACADQQA2AgQgAyAAIAEQLyIARQ0CIANB4gA2AhwgAyABNgIUIAMgADYCDEEAIQIMjQELIAMoAgQhACADQQA2AgQgAyAAIAEQLyIARQ19IANB4wA2AhwgAyABNgIUIAMgADYCDEEAIQIMjAELIAMoAgQhACADQQA2AgQgAyAAIAEQLyIARQ17IANB5AA2AhwgAyABNgIUIAMgADYCDAyLAQtB1AAhAgxxCyADLQApQSJGDYYBQdMAIQIMcAtBACEAAkAgAygCOCICRQ0AIAIoAkQiAkUNACADIAIRAAAhAAsgAEUEQEHVACECDHALIABBFUcEQCADQQA2AhwgAyABNgIUIANBpA02AhAgA0EhNgIMQQAhAgyJAQsgA0HhADYCHCADIAE2AhQgA0HQGjYCECADQRU2AgxBACECDIgBCyABIARGBEBB4AAhAgyIAQsCQAJAAkACQAJAIAEtAABBCmsOBAEEBAAECyABQQFqIQEMAQsgAUEBaiEBIANBL2otAABBAXFFDQELQdIAIQIMcAsgA0EANgIcIAMgATYCFCADQbYRNgIQIANBCTYCDEEAIQIMiAELIANBADYCHCADIAE2AhQgA0G2ETYCECADQQk2AgxBACECDIcBCyABIARGBEBB3wAhAgyHAQsgAS0AAEEKRgRAIAFBAWohAQwJCyADLQAuQcAAcQ0IIANBADYCHCADIAE2AhQgA0G2ETYCECADQQI2AgxBACECDIYBCyABIARGBEBB3QAhAgyGAQsgAS0AACICQQ1GBEAgAUEBaiEBQdAAIQIMbQsgASEAIAJBCWsOBAUBAQUBCyAEIAEiAEYEQEHcACECDIUBCyAALQAAQQpHDQAgAEEBagwCC0EAIQIgA0EANgIcIAMgADYCFCADQcotNgIQIANBBzYCDAyDAQsgASAERgRAQdsAIQIMgwELAkAgAS0AAEEJaw4EAwAAAwALIAFBAWoLIQFBzgAhAgxoCyABIARGBEBB2gAhAgyBAQsgAS0AAEEJaw4EAAEBAAELQQAhAiADQQA2AhwgA0GaEjYCECADQQc2AgwgAyABQQFqNgIUDH8LIANBgBI7ASpBACEAAkAgAygCOCICRQ0AIAIoAjgiAkUNACADIAIRAAAhAAsgAEUNACAAQRVHDQEgA0HZADYCHCADIAE2AhQgA0HqGjYCECADQRU2AgxBACECDH4LQc0AIQIMZAsgA0EANgIcIAMgATYCFCADQckNNgIQIANBGjYCDEEAIQIMfAsgASAERgRAQdkAIQIMfAsgAS0AAEEgRw09IAFBAWohASADLQAuQQFxDT0gA0EANgIcIAMgATYCFCADQcIcNgIQIANBHjYCDEEAIQIMewsgASAERgRAQdgAIQIMewsCQAJAAkACQAJAIAEtAAAiAEEKaw4EAgMDAAELIAFBAWohAUEsIQIMZQsgAEE6Rw0BIANBADYCHCADIAE2AhQgA0HnETYCECADQQo2AgxBACECDH0LIAFBAWohASADQS9qLQAAQQFxRQ1zIAMtADJBgAFxRQRAIANBMmohAiADEDVBACEAAkAgAygCOCIGRQ0AIAYoAigiBkUNACADIAYRAAAhAAsCQAJAIAAOFk1MSwEBAQEBAQEBAQEBAQEBAQEBAQABCyADQSk2AhwgAyABNgIUIANBrBk2AhAgA0EVNgIMQQAhAgx+CyADQQA2AhwgAyABNgIUIANB5Qs2AhAgA0ERNgIMQQAhAgx9C0EAIQACQCADKAI4IgJFDQAgAigCXCICRQ0AIAMgAhEAACEACyAARQ1ZIABBFUcNASADQQU2AhwgAyABNgIUIANBmxs2AhAgA0EVNgIMQQAhAgx8C0HLACECDGILQQAhAiADQQA2AhwgAyABNgIUIANBkA42AhAgA0EUNgIMDHoLIAMgAy8BMkGAAXI7ATIMOwsgASAERwRAIANBETYCCCADIAE2AgRBygAhAgxgC0HXACECDHgLIAEgBEYEQEHWACECDHgLAkACQAJAAkAgAS0AACIAQSByIAAgAEHBAGtB/wFxQRpJG0H/AXFB4wBrDhMAQEBAQEBAQEBAQEBAAUBAQAIDQAsgAUEBaiEBQcYAIQIMYQsgAUEBaiEBQccAIQIMYAsgAUEBaiEBQcgAIQIMXwsgAUEBaiEBQckAIQIMXgtB1QAhAiAEIAEiAEYNdiAEIAFrIAMoAgAiAWohBiAAIAFrQQVqIQcDQCABQZDIAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQhBBCABQQVGDQoaIAFBAWohASAEIABBAWoiAEcNAAsgAyAGNgIADHYLQdQAIQIgBCABIgBGDXUgBCABayADKAIAIgFqIQYgACABa0EPaiEHA0AgAUGAyABqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0HQQMgAUEPRg0JGiABQQFqIQEgBCAAQQFqIgBHDQALIAMgBjYCAAx1C0HTACECIAQgASIARg10IAQgAWsgAygCACIBaiEGIAAgAWtBDmohBwNAIAFB4scAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNBiABQQ5GDQcgAUEBaiEBIAQgAEEBaiIARw0ACyADIAY2AgAMdAtB0gAhAiAEIAEiAEYNcyAEIAFrIAMoAgAiAWohBSAAIAFrQQFqIQYDQCABQeDHAGotAAAgAC0AACIHQSByIAcgB0HBAGtB/wFxQRpJG0H/AXFHDQUgAUEBRg0CIAFBAWohASAEIABBAWoiAEcNAAsgAyAFNgIADHMLIAEgBEYEQEHRACECDHMLAkACQCABLQAAIgBBIHIgACAAQcEAa0H/AXFBGkkbQf8BcUHuAGsOBwA5OTk5OQE5CyABQQFqIQFBwwAhAgxaCyABQQFqIQFBxAAhAgxZCyADQQA2AgAgBkEBaiEBQcUAIQIMWAtB0AAhAiAEIAEiAEYNcCAEIAFrIAMoAgAiAWohBiAAIAFrQQlqIQcDQCABQdbHAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQJBAiABQQlGDQQaIAFBAWohASAEIABBAWoiAEcNAAsgAyAGNgIADHALQc8AIQIgBCABIgBGDW8gBCABayADKAIAIgFqIQYgACABa0EFaiEHA0AgAUHQxwBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBBUYNAiABQQFqIQEgBCAAQQFqIgBHDQALIAMgBjYCAAxvCyAAIQEgA0EANgIADDMLQQELOgAsIANBADYCACAHQQFqIQELQS0hAgxSCwJAA0AgAS0AAEHQxQBqLQAAQQFHDQEgBCABQQFqIgFHDQALQc0AIQIMawtBwgAhAgxRCyABIARGBEBBzAAhAgxqCyABLQAAQTpGBEAgAygCBCEAIANBADYCBCADIAAgARAwIgBFDTMgA0HLADYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgxqCyADQQA2AhwgAyABNgIUIANB5xE2AhAgA0EKNgIMQQAhAgxpCwJAAkAgAy0ALEECaw4CAAEnCyADQTNqLQAAQQJxRQ0mIAMtAC5BAnENJiADQQA2AhwgAyABNgIUIANBphQ2AhAgA0ELNgIMQQAhAgxpCyADLQAyQSBxRQ0lIAMtAC5BAnENJSADQQA2AhwgAyABNgIUIANBvRM2AhAgA0EPNgIMQQAhAgxoC0EAIQACQCADKAI4IgJFDQAgAigCSCICRQ0AIAMgAhEAACEACyAARQRAQcEAIQIMTwsgAEEVRwRAIANBADYCHCADIAE2AhQgA0GmDzYCECADQRw2AgxBACECDGgLIANBygA2AhwgAyABNgIUIANBhRw2AhAgA0EVNgIMQQAhAgxnCyABIARHBEAgASECA0AgBCACIgFrQRBOBEAgAUEQaiEC/Qz/////////////////////IAH9AAAAIg1BB/1sIA39DODg4ODg4ODg4ODg4ODg4OD9bv0MX19fX19fX19fX19fX19fX/0mIA39DAkJCQkJCQkJCQkJCQkJCQn9I/1Q/VL9ZEF/c2giAEEQRg0BIAAgAWohAQwYCyABIARGBEBBxAAhAgxpCyABLQAAQcDBAGotAABBAUcNFyAEIAFBAWoiAkcNAAtBxAAhAgxnC0HEACECDGYLIAEgBEcEQANAAkAgAS0AACIAQSByIAAgAEHBAGtB/wFxQRpJG0H/AXEiAEEJRg0AIABBIEYNAAJAAkACQAJAIABB4wBrDhMAAwMDAwMDAwEDAwMDAwMDAwMCAwsgAUEBaiEBQTYhAgxSCyABQQFqIQFBNyECDFELIAFBAWohAUE4IQIMUAsMFQsgBCABQQFqIgFHDQALQTwhAgxmC0E8IQIMZQsgASAERgRAQcgAIQIMZQsgA0ESNgIIIAMgATYCBAJAAkACQAJAAkAgAy0ALEEBaw4EFAABAgkLIAMtADJBIHENA0HgASECDE8LAkAgAy8BMiIAQQhxRQ0AIAMtAChBAUcNACADLQAuQQhxRQ0CCyADIABB9/sDcUGABHI7ATIMCwsgAyADLwEyQRByOwEyDAQLIANBADYCBCADIAEgARAxIgAEQCADQcEANgIcIAMgADYCDCADIAFBAWo2AhRBACECDGYLIAFBAWohAQxYCyADQQA2AhwgAyABNgIUIANB9BM2AhAgA0EENgIMQQAhAgxkC0HHACECIAEgBEYNYyADKAIAIgAgBCABa2ohBSABIABrQQZqIQYCQANAIABBwMUAai0AACABLQAAQSByRw0BIABBBkYNSiAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAxkCyADQQA2AgAMBQsCQCABIARHBEADQCABLQAAQcDDAGotAAAiAEEBRwRAIABBAkcNAyABQQFqIQEMBQsgBCABQQFqIgFHDQALQcUAIQIMZAtBxQAhAgxjCwsgA0EAOgAsDAELQQshAgxHC0E/IQIMRgsCQAJAA0AgAS0AACIAQSBHBEACQCAAQQprDgQDBQUDAAsgAEEsRg0DDAQLIAQgAUEBaiIBRw0AC0HGACECDGALIANBCDoALAwOCyADLQAoQQFHDQIgAy0ALkEIcQ0CIAMoAgQhACADQQA2AgQgAyAAIAEQMSIABEAgA0HCADYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgxfCyABQQFqIQEMUAtBOyECDEQLAkADQCABLQAAIgBBIEcgAEEJR3ENASAEIAFBAWoiAUcNAAtBwwAhAgxdCwtBPCECDEILAkACQCABIARHBEADQCABLQAAIgBBIEcEQCAAQQprDgQDBAQDBAsgBCABQQFqIgFHDQALQT8hAgxdC0E/IQIMXAsgAyADLwEyQSByOwEyDAoLIAMoAgQhACADQQA2AgQgAyAAIAEQMSIARQ1OIANBPjYCHCADIAE2AhQgAyAANgIMQQAhAgxaCwJAIAEgBEcEQANAIAEtAABBwMMAai0AACIAQQFHBEAgAEECRg0DDAwLIAQgAUEBaiIBRw0AC0E3IQIMWwtBNyECDFoLIAFBAWohAQwEC0E7IQIgBCABIgBGDVggBCABayADKAIAIgFqIQYgACABa0EFaiEHAkADQCABQZDIAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQEgAUEFRgRAQQchAQw/CyABQQFqIQEgBCAAQQFqIgBHDQALIAMgBjYCAAxZCyADQQA2AgAgACEBDAULQTohAiAEIAEiAEYNVyAEIAFrIAMoAgAiAWohBiAAIAFrQQhqIQcCQANAIAFBtMEAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNASABQQhGBEBBBSEBDD4LIAFBAWohASAEIABBAWoiAEcNAAsgAyAGNgIADFgLIANBADYCACAAIQEMBAtBOSECIAQgASIARg1WIAQgAWsgAygCACIBaiEGIAAgAWtBA2ohBwJAA0AgAUGwwQBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBA0YEQEEGIQEMPQsgAUEBaiEBIAQgAEEBaiIARw0ACyADIAY2AgAMVwsgA0EANgIAIAAhAQwDCwJAA0AgAS0AACIAQSBHBEAgAEEKaw4EBwQEBwILIAQgAUEBaiIBRw0AC0E4IQIMVgsgAEEsRw0BIAFBAWohAEEBIQECQAJAAkACQAJAIAMtACxBBWsOBAMBAgQACyAAIQEMBAtBAiEBDAELQQQhAQsgA0EBOgAsIAMgAy8BMiABcjsBMiAAIQEMAQsgAyADLwEyQQhyOwEyIAAhAQtBPiECDDsLIANBADoALAtBOSECDDkLIAEgBEYEQEE2IQIMUgsCQAJAAkACQAJAIAEtAABBCmsOBAACAgECCyADKAIEIQAgA0EANgIEIAMgACABEDEiAEUNAiADQTM2AhwgAyABNgIUIAMgADYCDEEAIQIMVQsgAygCBCEAIANBADYCBCADIAAgARAxIgBFBEAgAUEBaiEBDAYLIANBMjYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgxUCyADLQAuQQFxBEBB3wEhAgw7CyADKAIEIQAgA0EANgIEIAMgACABEDEiAA0BDEkLQTQhAgw5CyADQTU2AhwgAyABNgIUIAMgADYCDEEAIQIMUQtBNSECDDcLIANBL2otAABBAXENACADQQA2AhwgAyABNgIUIANB6xY2AhAgA0EZNgIMQQAhAgxPC0EzIQIMNQsgASAERgRAQTIhAgxOCwJAIAEtAABBCkYEQCABQQFqIQEMAQsgA0EANgIcIAMgATYCFCADQZIXNgIQIANBAzYCDEEAIQIMTgtBMiECDDQLIAEgBEYEQEExIQIMTQsCQCABLQAAIgBBCUYNACAAQSBGDQBBASECAkAgAy0ALEEFaw4EBgQFAA0LIAMgAy8BMkEIcjsBMgwMCyADLQAuQQFxRQ0BIAMtACxBCEcNACADQQA6ACwLQT0hAgwyCyADQQA2AhwgAyABNgIUIANBwhY2AhAgA0EKNgIMQQAhAgxKC0ECIQIMAQtBBCECCyADQQE6ACwgAyADLwEyIAJyOwEyDAYLIAEgBEYEQEEwIQIMRwsgAS0AAEEKRgRAIAFBAWohAQwBCyADLQAuQQFxDQAgA0EANgIcIAMgATYCFCADQdwoNgIQIANBAjYCDEEAIQIMRgtBMCECDCwLIAFBAWohAUExIQIMKwsgASAERgRAQS8hAgxECyABLQAAIgBBCUcgAEEgR3FFBEAgAUEBaiEBIAMtAC5BAXENASADQQA2AhwgAyABNgIUIANBlxA2AhAgA0EKNgIMQQAhAgxEC0EBIQICQAJAAkACQAJAAkAgAy0ALEECaw4HBQQEAwECAAQLIAMgAy8BMkEIcjsBMgwDC0ECIQIMAQtBBCECCyADQQE6ACwgAyADLwEyIAJyOwEyC0EvIQIMKwsgA0EANgIcIAMgATYCFCADQYQTNgIQIANBCzYCDEEAIQIMQwtB4QEhAgwpCyABIARGBEBBLiECDEILIANBADYCBCADQRI2AgggAyABIAEQMSIADQELQS4hAgwnCyADQS02AhwgAyABNgIUIAMgADYCDEEAIQIMPwtBACEAAkAgAygCOCICRQ0AIAIoAkwiAkUNACADIAIRAAAhAAsgAEUNACAAQRVHDQEgA0HYADYCHCADIAE2AhQgA0GzGzYCECADQRU2AgxBACECDD4LQcwAIQIMJAsgA0EANgIcIAMgATYCFCADQbMONgIQIANBHTYCDEEAIQIMPAsgASAERgRAQc4AIQIMPAsgAS0AACIAQSBGDQIgAEE6Rg0BCyADQQA6ACxBCSECDCELIAMoAgQhACADQQA2AgQgAyAAIAEQMCIADQEMAgsgAy0ALkEBcQRAQd4BIQIMIAsgAygCBCEAIANBADYCBCADIAAgARAwIgBFDQIgA0EqNgIcIAMgADYCDCADIAFBAWo2AhRBACECDDgLIANBywA2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIMNwsgAUEBaiEBQcAAIQIMHQsgAUEBaiEBDCwLIAEgBEYEQEErIQIMNQsCQCABLQAAQQpGBEAgAUEBaiEBDAELIAMtAC5BwABxRQ0GCyADLQAyQYABcQRAQQAhAAJAIAMoAjgiAkUNACACKAJcIgJFDQAgAyACEQAAIQALIABFDRIgAEEVRgRAIANBBTYCHCADIAE2AhQgA0GbGzYCECADQRU2AgxBACECDDYLIANBADYCHCADIAE2AhQgA0GQDjYCECADQRQ2AgxBACECDDULIANBMmohAiADEDVBACEAAkAgAygCOCIGRQ0AIAYoAigiBkUNACADIAYRAAAhAAsgAA4WAgEABAQEBAQEBAQEBAQEBAQEBAQEAwQLIANBAToAMAsgAiACLwEAQcAAcjsBAAtBKyECDBgLIANBKTYCHCADIAE2AhQgA0GsGTYCECADQRU2AgxBACECDDALIANBADYCHCADIAE2AhQgA0HlCzYCECADQRE2AgxBACECDC8LIANBADYCHCADIAE2AhQgA0GlCzYCECADQQI2AgxBACECDC4LQQEhByADLwEyIgVBCHFFBEAgAykDIEIAUiEHCwJAIAMtADAEQEEBIQAgAy0AKUEFRg0BIAVBwABxRSAHcUUNAQsCQCADLQAoIgJBAkYEQEEBIQAgAy8BNCIGQeUARg0CQQAhACAFQcAAcQ0CIAZB5ABGDQIgBkHmAGtBAkkNAiAGQcwBRg0CIAZBsAJGDQIMAQtBACEAIAVBwABxDQELQQIhACAFQQhxDQAgBUGABHEEQAJAIAJBAUcNACADLQAuQQpxDQBBBSEADAILQQQhAAwBCyAFQSBxRQRAIAMQNkEAR0ECdCEADAELQQBBAyADKQMgUBshAAsgAEEBaw4FAgAHAQMEC0ERIQIMEwsgA0EBOgAxDCkLQQAhAgJAIAMoAjgiAEUNACAAKAIwIgBFDQAgAyAAEQAAIQILIAJFDSYgAkEVRgRAIANBAzYCHCADIAE2AhQgA0HSGzYCECADQRU2AgxBACECDCsLQQAhAiADQQA2AhwgAyABNgIUIANB3Q42AhAgA0ESNgIMDCoLIANBADYCHCADIAE2AhQgA0H5IDYCECADQQ82AgxBACECDCkLQQAhAAJAIAMoAjgiAkUNACACKAIwIgJFDQAgAyACEQAAIQALIAANAQtBDiECDA4LIABBFUYEQCADQQI2AhwgAyABNgIUIANB0hs2AhAgA0EVNgIMQQAhAgwnCyADQQA2AhwgAyABNgIUIANB3Q42AhAgA0ESNgIMQQAhAgwmC0EqIQIMDAsgASAERwRAIANBCTYCCCADIAE2AgRBKSECDAwLQSYhAgwkCyADIAMpAyAiDCAEIAFrrSIKfSILQgAgCyAMWBs3AyAgCiAMVARAQSUhAgwkCyADKAIEIQAgA0EANgIEIAMgACABIAynaiIBEDIiAEUNACADQQU2AhwgAyABNgIUIAMgADYCDEEAIQIMIwtBDyECDAkLQgAhCgJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCABLQAAQTBrDjcXFgABAgMEBQYHFBQUFBQUFAgJCgsMDRQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUDg8QERITFAtCAiEKDBYLQgMhCgwVC0IEIQoMFAtCBSEKDBMLQgYhCgwSC0IHIQoMEQtCCCEKDBALQgkhCgwPC0IKIQoMDgtCCyEKDA0LQgwhCgwMC0INIQoMCwtCDiEKDAoLQg8hCgwJC0IKIQoMCAtCCyEKDAcLQgwhCgwGC0INIQoMBQtCDiEKDAQLQg8hCgwDCyADQQA2AhwgAyABNgIUIANBnxU2AhAgA0EMNgIMQQAhAgwhCyABIARGBEBBIiECDCELQgAhCgJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAS0AAEEwaw43FRQAAQIDBAUGBxYWFhYWFhYICQoLDA0WFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFg4PEBESExYLQgIhCgwUC0IDIQoMEwtCBCEKDBILQgUhCgwRC0IGIQoMEAtCByEKDA8LQgghCgwOC0IJIQoMDQtCCiEKDAwLQgshCgwLC0IMIQoMCgtCDSEKDAkLQg4hCgwIC0IPIQoMBwtCCiEKDAYLQgshCgwFC0IMIQoMBAtCDSEKDAMLQg4hCgwCC0IPIQoMAQtCASEKCyABQQFqIQEgAykDICILQv//////////D1gEQCADIAtCBIYgCoQ3AyAMAgsgA0EANgIcIAMgATYCFCADQbUJNgIQIANBDDYCDEEAIQIMHgtBJyECDAQLQSghAgwDCyADIAE6ACwgA0EANgIAIAdBAWohAUEMIQIMAgsgA0EANgIAIAZBAWohAUEKIQIMAQsgAUEBaiEBQQghAgwACwALQQAhAiADQQA2AhwgAyABNgIUIANBsjg2AhAgA0EINgIMDBcLQQAhAiADQQA2AhwgAyABNgIUIANBgxE2AhAgA0EJNgIMDBYLQQAhAiADQQA2AhwgAyABNgIUIANB3wo2AhAgA0EJNgIMDBULQQAhAiADQQA2AhwgAyABNgIUIANB7RA2AhAgA0EJNgIMDBQLQQAhAiADQQA2AhwgAyABNgIUIANB0hE2AhAgA0EJNgIMDBMLQQAhAiADQQA2AhwgAyABNgIUIANBsjg2AhAgA0EINgIMDBILQQAhAiADQQA2AhwgAyABNgIUIANBgxE2AhAgA0EJNgIMDBELQQAhAiADQQA2AhwgAyABNgIUIANB3wo2AhAgA0EJNgIMDBALQQAhAiADQQA2AhwgAyABNgIUIANB7RA2AhAgA0EJNgIMDA8LQQAhAiADQQA2AhwgAyABNgIUIANB0hE2AhAgA0EJNgIMDA4LQQAhAiADQQA2AhwgAyABNgIUIANBuRc2AhAgA0EPNgIMDA0LQQAhAiADQQA2AhwgAyABNgIUIANBuRc2AhAgA0EPNgIMDAwLQQAhAiADQQA2AhwgAyABNgIUIANBmRM2AhAgA0ELNgIMDAsLQQAhAiADQQA2AhwgAyABNgIUIANBnQk2AhAgA0ELNgIMDAoLQQAhAiADQQA2AhwgAyABNgIUIANBlxA2AhAgA0EKNgIMDAkLQQAhAiADQQA2AhwgAyABNgIUIANBsRA2AhAgA0EKNgIMDAgLQQAhAiADQQA2AhwgAyABNgIUIANBux02AhAgA0ECNgIMDAcLQQAhAiADQQA2AhwgAyABNgIUIANBlhY2AhAgA0ECNgIMDAYLQQAhAiADQQA2AhwgAyABNgIUIANB+Rg2AhAgA0ECNgIMDAULQQAhAiADQQA2AhwgAyABNgIUIANBxBg2AhAgA0ECNgIMDAQLIANBAjYCHCADIAE2AhQgA0GpHjYCECADQRY2AgxBACECDAMLQd4AIQIgASAERg0CIAlBCGohByADKAIAIQUCQAJAIAEgBEcEQCAFQZbIAGohCCAEIAVqIAFrIQYgBUF/c0EKaiIFIAFqIQADQCABLQAAIAgtAABHBEBBAiEIDAMLIAVFBEBBACEIIAAhAQwDCyAFQQFrIQUgCEEBaiEIIAQgAUEBaiIBRw0ACyAGIQUgBCEBCyAHQQE2AgAgAyAFNgIADAELIANBADYCACAHIAg2AgALIAcgATYCBCAJKAIMIQACQAJAIAkoAghBAWsOAgQBAAsgA0EANgIcIANBwh42AhAgA0EXNgIMIAMgAEEBajYCFEEAIQIMAwsgA0EANgIcIAMgADYCFCADQdceNgIQIANBCTYCDEEAIQIMAgsgASAERgRAQSghAgwCCyADQQk2AgggAyABNgIEQSchAgwBCyABIARGBEBBASECDAELA0ACQAJAAkAgAS0AAEEKaw4EAAEBAAELIAFBAWohAQwBCyABQQFqIQEgAy0ALkEgcQ0AQQAhAiADQQA2AhwgAyABNgIUIANBoSE2AhAgA0EFNgIMDAILQQEhAiABIARHDQALCyAJQRBqJAAgAkUEQCADKAIMIQAMAQsgAyACNgIcQQAhACADKAIEIgFFDQAgAyABIAQgAygCCBEBACIBRQ0AIAMgBDYCFCADIAE2AgwgASEACyAAC74CAQJ/IABBADoAACAAQeQAaiIBQQFrQQA6AAAgAEEAOgACIABBADoAASABQQNrQQA6AAAgAUECa0EAOgAAIABBADoAAyABQQRrQQA6AABBACAAa0EDcSIBIABqIgBBADYCAEHkACABa0F8cSICIABqIgFBBGtBADYCAAJAIAJBCUkNACAAQQA2AgggAEEANgIEIAFBCGtBADYCACABQQxrQQA2AgAgAkEZSQ0AIABBADYCGCAAQQA2AhQgAEEANgIQIABBADYCDCABQRBrQQA2AgAgAUEUa0EANgIAIAFBGGtBADYCACABQRxrQQA2AgAgAiAAQQRxQRhyIgJrIgFBIEkNACAAIAJqIQADQCAAQgA3AxggAEIANwMQIABCADcDCCAAQgA3AwAgAEEgaiEAIAFBIGsiAUEfSw0ACwsLVgEBfwJAIAAoAgwNAAJAAkACQAJAIAAtADEOAwEAAwILIAAoAjgiAUUNACABKAIwIgFFDQAgACABEQAAIgENAwtBAA8LAAsgAEHKGTYCEEEOIQELIAELGgAgACgCDEUEQCAAQd4fNgIQIABBFTYCDAsLFAAgACgCDEEVRgRAIABBADYCDAsLFAAgACgCDEEWRgRAIABBADYCDAsLBwAgACgCDAsHACAAKAIQCwkAIAAgATYCEAsHACAAKAIUCysAAkAgAEEnTw0AQv//////CSAArYhCAYNQDQAgAEECdEHQOGooAgAPCwALFwAgAEEvTwRAAAsgAEECdEHsOWooAgALvwkBAX9B9C0hAQJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABB5ABrDvQDY2IAAWFhYWFhYQIDBAVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhBgcICQoLDA0OD2FhYWFhEGFhYWFhYWFhYWFhEWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYRITFBUWFxgZGhthYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2YTc4OTphYWFhYWFhYTthYWE8YWFhYT0+P2FhYWFhYWFhQGFhQWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYUJDREVGR0hJSktMTU5PUFFSU2FhYWFhYWFhVFVWV1hZWlthXF1hYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFeYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhX2BhC0HqLA8LQZgmDwtB7TEPC0GgNw8LQckpDwtBtCkPC0GWLQ8LQesrDwtBojUPC0HbNA8LQeApDwtB4yQPC0HVJA8LQe4kDwtB5iUPC0HKNA8LQdA3DwtBqjUPC0H1LA8LQfYmDwtBgiIPC0HyMw8LQb4oDwtB5zcPC0HNIQ8LQcAhDwtBuCUPC0HLJQ8LQZYkDwtBjzQPC0HNNQ8LQd0qDwtB7jMPC0GcNA8LQZ4xDwtB9DUPC0HlIg8LQa8lDwtBmTEPC0GyNg8LQfk2DwtBxDIPC0HdLA8LQYIxDwtBwTEPC0GNNw8LQckkDwtB7DYPC0HnKg8LQcgjDwtB4iEPC0HJNw8LQaUiDwtBlCIPC0HbNg8LQd41DwtBhiYPC0G8Kw8LQYsyDwtBoCMPC0H2MA8LQYAsDwtBiSsPC0GkJg8LQfIjDwtBgSgPC0GrMg8LQesnDwtBwjYPC0GiJA8LQc8qDwtB3CMPC0GHJw8LQeQ0DwtBtyIPC0GtMQ8LQdUiDwtBrzQPC0HeJg8LQdYyDwtB9DQPC0GBOA8LQfQ3DwtBkjYPC0GdJw8LQYIpDwtBjSMPC0HXMQ8LQb01DwtBtDcPC0HYMA8LQbYnDwtBmjgPC0GnKg8LQcQnDwtBriMPC0H1Ig8LAAtByiYhAQsgAQsXACAAIAAvAS5B/v8DcSABQQBHcjsBLgsaACAAIAAvAS5B/f8DcSABQQBHQQF0cjsBLgsaACAAIAAvAS5B+/8DcSABQQBHQQJ0cjsBLgsaACAAIAAvAS5B9/8DcSABQQBHQQN0cjsBLgsaACAAIAAvAS5B7/8DcSABQQBHQQR0cjsBLgsaACAAIAAvAS5B3/8DcSABQQBHQQV0cjsBLgsaACAAIAAvAS5Bv/8DcSABQQBHQQZ0cjsBLgsaACAAIAAvAS5B//4DcSABQQBHQQd0cjsBLgsaACAAIAAvAS5B//0DcSABQQBHQQh0cjsBLgsaACAAIAAvAS5B//sDcSABQQBHQQl0cjsBLgs+AQJ/AkAgACgCOCIDRQ0AIAMoAgQiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQeESNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAggiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQfwRNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAgwiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQewKNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAhAiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQfoeNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAhQiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQcsQNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAhgiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQbcfNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAhwiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQb8VNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAiwiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQf4INgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAiAiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQYwdNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAiQiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQeYVNgIQQRghBAsgBAs4ACAAAn8gAC8BMkEUcUEURgRAQQEgAC0AKEEBRg0BGiAALwE0QeUARgwBCyAALQApQQVGCzoAMAtZAQJ/AkAgAC0AKEEBRg0AIAAvATQiAUHkAGtB5ABJDQAgAUHMAUYNACABQbACRg0AIAAvATIiAEHAAHENAEEBIQIgAEGIBHFBgARGDQAgAEEocUUhAgsgAguMAQECfwJAAkACQCAALQAqRQ0AIAAtACtFDQAgAC8BMiIBQQJxRQ0BDAILIAAvATIiAUEBcUUNAQtBASECIAAtAChBAUYNACAALwE0IgBB5ABrQeQASQ0AIABBzAFGDQAgAEGwAkYNACABQcAAcQ0AQQAhAiABQYgEcUGABEYNACABQShxQQBHIQILIAILcwAgAEEQav0MAAAAAAAAAAAAAAAAAAAAAP0LAwAgAP0MAAAAAAAAAAAAAAAAAAAAAP0LAwAgAEEwav0MAAAAAAAAAAAAAAAAAAAAAP0LAwAgAEEgav0MAAAAAAAAAAAAAAAAAAAAAP0LAwAgAEH9ATYCHAsGACAAEDoLmi0BC38jAEEQayIKJABB3NUAKAIAIglFBEBBnNkAKAIAIgVFBEBBqNkAQn83AgBBoNkAQoCAhICAgMAANwIAQZzZACAKQQhqQXBxQdiq1aoFcyIFNgIAQbDZAEEANgIAQYDZAEEANgIAC0GE2QBBwNkENgIAQdTVAEHA2QQ2AgBB6NUAIAU2AgBB5NUAQX82AgBBiNkAQcCmAzYCAANAIAFBgNYAaiABQfTVAGoiAjYCACACIAFB7NUAaiIDNgIAIAFB+NUAaiADNgIAIAFBiNYAaiABQfzVAGoiAzYCACADIAI2AgAgAUGQ1gBqIAFBhNYAaiICNgIAIAIgAzYCACABQYzWAGogAjYCACABQSBqIgFBgAJHDQALQczZBEGBpgM2AgBB4NUAQazZACgCADYCAEHQ1QBBgKYDNgIAQdzVAEHI2QQ2AgBBzP8HQTg2AgBByNkEIQkLAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAEHsAU0EQEHE1QAoAgAiBkEQIABBE2pBcHEgAEELSRsiBEEDdiIAdiIBQQNxBEACQCABQQFxIAByQQFzIgJBA3QiAEHs1QBqIgEgAEH01QBqKAIAIgAoAggiA0YEQEHE1QAgBkF+IAJ3cTYCAAwBCyABIAM2AgggAyABNgIMCyAAQQhqIQEgACACQQN0IgJBA3I2AgQgACACaiIAIAAoAgRBAXI2AgQMEQtBzNUAKAIAIgggBE8NASABBEACQEECIAB0IgJBACACa3IgASAAdHFoIgBBA3QiAkHs1QBqIgEgAkH01QBqKAIAIgIoAggiA0YEQEHE1QAgBkF+IAB3cSIGNgIADAELIAEgAzYCCCADIAE2AgwLIAIgBEEDcjYCBCAAQQN0IgAgBGshBSAAIAJqIAU2AgAgAiAEaiIEIAVBAXI2AgQgCARAIAhBeHFB7NUAaiEAQdjVACgCACEDAn9BASAIQQN2dCIBIAZxRQRAQcTVACABIAZyNgIAIAAMAQsgACgCCAsiASADNgIMIAAgAzYCCCADIAA2AgwgAyABNgIICyACQQhqIQFB2NUAIAQ2AgBBzNUAIAU2AgAMEQtByNUAKAIAIgtFDQEgC2hBAnRB9NcAaigCACIAKAIEQXhxIARrIQUgACECA0ACQCACKAIQIgFFBEAgAkEUaigCACIBRQ0BCyABKAIEQXhxIARrIgMgBUkhAiADIAUgAhshBSABIAAgAhshACABIQIMAQsLIAAoAhghCSAAKAIMIgMgAEcEQEHU1QAoAgAaIAMgACgCCCIBNgIIIAEgAzYCDAwQCyAAQRRqIgIoAgAiAUUEQCAAKAIQIgFFDQMgAEEQaiECCwNAIAIhByABIgNBFGoiAigCACIBDQAgA0EQaiECIAMoAhAiAQ0ACyAHQQA2AgAMDwtBfyEEIABBv39LDQAgAEETaiIBQXBxIQRByNUAKAIAIghFDQBBACAEayEFAkACQAJAAn9BACAEQYACSQ0AGkEfIARB////B0sNABogBEEmIAFBCHZnIgBrdkEBcSAAQQF0a0E+agsiBkECdEH01wBqKAIAIgJFBEBBACEBQQAhAwwBC0EAIQEgBEEZIAZBAXZrQQAgBkEfRxt0IQBBACEDA0ACQCACKAIEQXhxIARrIgcgBU8NACACIQMgByIFDQBBACEFIAIhAQwDCyABIAJBFGooAgAiByAHIAIgAEEddkEEcWpBEGooAgAiAkYbIAEgBxshASAAQQF0IQAgAg0ACwsgASADckUEQEEAIQNBAiAGdCIAQQAgAGtyIAhxIgBFDQMgAGhBAnRB9NcAaigCACEBCyABRQ0BCwNAIAEoAgRBeHEgBGsiAiAFSSEAIAIgBSAAGyEFIAEgAyAAGyEDIAEoAhAiAAR/IAAFIAFBFGooAgALIgENAAsLIANFDQAgBUHM1QAoAgAgBGtPDQAgAygCGCEHIAMgAygCDCIARwRAQdTVACgCABogACADKAIIIgE2AgggASAANgIMDA4LIANBFGoiAigCACIBRQRAIAMoAhAiAUUNAyADQRBqIQILA0AgAiEGIAEiAEEUaiICKAIAIgENACAAQRBqIQIgACgCECIBDQALIAZBADYCAAwNC0HM1QAoAgAiAyAETwRAQdjVACgCACEBAkAgAyAEayICQRBPBEAgASAEaiIAIAJBAXI2AgQgASADaiACNgIAIAEgBEEDcjYCBAwBCyABIANBA3I2AgQgASADaiIAIAAoAgRBAXI2AgRBACEAQQAhAgtBzNUAIAI2AgBB2NUAIAA2AgAgAUEIaiEBDA8LQdDVACgCACIDIARLBEAgBCAJaiIAIAMgBGsiAUEBcjYCBEHc1QAgADYCAEHQ1QAgATYCACAJIARBA3I2AgQgCUEIaiEBDA8LQQAhASAEAn9BnNkAKAIABEBBpNkAKAIADAELQajZAEJ/NwIAQaDZAEKAgISAgIDAADcCAEGc2QAgCkEMakFwcUHYqtWqBXM2AgBBsNkAQQA2AgBBgNkAQQA2AgBBgIAECyIAIARBxwBqIgVqIgZBACAAayIHcSICTwRAQbTZAEEwNgIADA8LAkBB/NgAKAIAIgFFDQBB9NgAKAIAIgggAmohACAAIAFNIAAgCEtxDQBBACEBQbTZAEEwNgIADA8LQYDZAC0AAEEEcQ0EAkACQCAJBEBBhNkAIQEDQCABKAIAIgAgCU0EQCAAIAEoAgRqIAlLDQMLIAEoAggiAQ0ACwtBABA7IgBBf0YNBSACIQZBoNkAKAIAIgFBAWsiAyAAcQRAIAIgAGsgACADakEAIAFrcWohBgsgBCAGTw0FIAZB/v///wdLDQVB/NgAKAIAIgMEQEH02AAoAgAiByAGaiEBIAEgB00NBiABIANLDQYLIAYQOyIBIABHDQEMBwsgBiADayAHcSIGQf7///8HSw0EIAYQOyEAIAAgASgCACABKAIEakYNAyAAIQELAkAgBiAEQcgAak8NACABQX9GDQBBpNkAKAIAIgAgBSAGa2pBACAAa3EiAEH+////B0sEQCABIQAMBwsgABA7QX9HBEAgACAGaiEGIAEhAAwHC0EAIAZrEDsaDAQLIAEiAEF/Rw0FDAMLQQAhAwwMC0EAIQAMCgsgAEF/Rw0CC0GA2QBBgNkAKAIAQQRyNgIACyACQf7///8HSw0BIAIQOyEAQQAQOyEBIABBf0YNASABQX9GDQEgACABTw0BIAEgAGsiBiAEQThqTQ0BC0H02ABB9NgAKAIAIAZqIgE2AgBB+NgAKAIAIAFJBEBB+NgAIAE2AgALAkACQAJAQdzVACgCACICBEBBhNkAIQEDQCAAIAEoAgAiAyABKAIEIgVqRg0CIAEoAggiAQ0ACwwCC0HU1QAoAgAiAUEARyAAIAFPcUUEQEHU1QAgADYCAAtBACEBQYjZACAGNgIAQYTZACAANgIAQeTVAEF/NgIAQejVAEGc2QAoAgA2AgBBkNkAQQA2AgADQCABQYDWAGogAUH01QBqIgI2AgAgAiABQezVAGoiAzYCACABQfjVAGogAzYCACABQYjWAGogAUH81QBqIgM2AgAgAyACNgIAIAFBkNYAaiABQYTWAGoiAjYCACACIAM2AgAgAUGM1gBqIAI2AgAgAUEgaiIBQYACRw0AC0F4IABrQQ9xIgEgAGoiAiAGQThrIgMgAWsiAUEBcjYCBEHg1QBBrNkAKAIANgIAQdDVACABNgIAQdzVACACNgIAIAAgA2pBODYCBAwCCyAAIAJNDQAgAiADSQ0AIAEoAgxBCHENAEF4IAJrQQ9xIgAgAmoiA0HQ1QAoAgAgBmoiByAAayIAQQFyNgIEIAEgBSAGajYCBEHg1QBBrNkAKAIANgIAQdDVACAANgIAQdzVACADNgIAIAIgB2pBODYCBAwBCyAAQdTVACgCAEkEQEHU1QAgADYCAAsgACAGaiEDQYTZACEBAkACQAJAA0AgAyABKAIARwRAIAEoAggiAQ0BDAILCyABLQAMQQhxRQ0BC0GE2QAhAQNAIAEoAgAiAyACTQRAIAMgASgCBGoiBSACSw0DCyABKAIIIQEMAAsACyABIAA2AgAgASABKAIEIAZqNgIEIABBeCAAa0EPcWoiCSAEQQNyNgIEIANBeCADa0EPcWoiBiAEIAlqIgRrIQEgAiAGRgRAQdzVACAENgIAQdDVAEHQ1QAoAgAgAWoiADYCACAEIABBAXI2AgQMCAtB2NUAKAIAIAZGBEBB2NUAIAQ2AgBBzNUAQczVACgCACABaiIANgIAIAQgAEEBcjYCBCAAIARqIAA2AgAMCAsgBigCBCIFQQNxQQFHDQYgBUF4cSEIIAVB/wFNBEAgBUEDdiEDIAYoAggiACAGKAIMIgJGBEBBxNUAQcTVACgCAEF+IAN3cTYCAAwHCyACIAA2AgggACACNgIMDAYLIAYoAhghByAGIAYoAgwiAEcEQCAAIAYoAggiAjYCCCACIAA2AgwMBQsgBkEUaiICKAIAIgVFBEAgBigCECIFRQ0EIAZBEGohAgsDQCACIQMgBSIAQRRqIgIoAgAiBQ0AIABBEGohAiAAKAIQIgUNAAsgA0EANgIADAQLQXggAGtBD3EiASAAaiIHIAZBOGsiAyABayIBQQFyNgIEIAAgA2pBODYCBCACIAVBNyAFa0EPcWpBP2siAyADIAJBEGpJGyIDQSM2AgRB4NUAQazZACgCADYCAEHQ1QAgATYCAEHc1QAgBzYCACADQRBqQYzZACkCADcCACADQYTZACkCADcCCEGM2QAgA0EIajYCAEGI2QAgBjYCAEGE2QAgADYCAEGQ2QBBADYCACADQSRqIQEDQCABQQc2AgAgBSABQQRqIgFLDQALIAIgA0YNACADIAMoAgRBfnE2AgQgAyADIAJrIgU2AgAgAiAFQQFyNgIEIAVB/wFNBEAgBUF4cUHs1QBqIQACf0HE1QAoAgAiAUEBIAVBA3Z0IgNxRQRAQcTVACABIANyNgIAIAAMAQsgACgCCAsiASACNgIMIAAgAjYCCCACIAA2AgwgAiABNgIIDAELQR8hASAFQf///wdNBEAgBUEmIAVBCHZnIgBrdkEBcSAAQQF0a0E+aiEBCyACIAE2AhwgAkIANwIQIAFBAnRB9NcAaiEAQcjVACgCACIDQQEgAXQiBnFFBEAgACACNgIAQcjVACADIAZyNgIAIAIgADYCGCACIAI2AgggAiACNgIMDAELIAVBGSABQQF2a0EAIAFBH0cbdCEBIAAoAgAhAwJAA0AgAyIAKAIEQXhxIAVGDQEgAUEddiEDIAFBAXQhASAAIANBBHFqQRBqIgYoAgAiAw0ACyAGIAI2AgAgAiAANgIYIAIgAjYCDCACIAI2AggMAQsgACgCCCIBIAI2AgwgACACNgIIIAJBADYCGCACIAA2AgwgAiABNgIIC0HQ1QAoAgAiASAETQ0AQdzVACgCACIAIARqIgIgASAEayIBQQFyNgIEQdDVACABNgIAQdzVACACNgIAIAAgBEEDcjYCBCAAQQhqIQEMCAtBACEBQbTZAEEwNgIADAcLQQAhAAsgB0UNAAJAIAYoAhwiAkECdEH01wBqIgMoAgAgBkYEQCADIAA2AgAgAA0BQcjVAEHI1QAoAgBBfiACd3E2AgAMAgsgB0EQQRQgBygCECAGRhtqIAA2AgAgAEUNAQsgACAHNgIYIAYoAhAiAgRAIAAgAjYCECACIAA2AhgLIAZBFGooAgAiAkUNACAAQRRqIAI2AgAgAiAANgIYCyABIAhqIQEgBiAIaiIGKAIEIQULIAYgBUF+cTYCBCABIARqIAE2AgAgBCABQQFyNgIEIAFB/wFNBEAgAUF4cUHs1QBqIQACf0HE1QAoAgAiAkEBIAFBA3Z0IgFxRQRAQcTVACABIAJyNgIAIAAMAQsgACgCCAsiASAENgIMIAAgBDYCCCAEIAA2AgwgBCABNgIIDAELQR8hBSABQf///wdNBEAgAUEmIAFBCHZnIgBrdkEBcSAAQQF0a0E+aiEFCyAEIAU2AhwgBEIANwIQIAVBAnRB9NcAaiEAQcjVACgCACICQQEgBXQiA3FFBEAgACAENgIAQcjVACACIANyNgIAIAQgADYCGCAEIAQ2AgggBCAENgIMDAELIAFBGSAFQQF2a0EAIAVBH0cbdCEFIAAoAgAhAAJAA0AgACICKAIEQXhxIAFGDQEgBUEddiEAIAVBAXQhBSACIABBBHFqQRBqIgMoAgAiAA0ACyADIAQ2AgAgBCACNgIYIAQgBDYCDCAEIAQ2AggMAQsgAigCCCIAIAQ2AgwgAiAENgIIIARBADYCGCAEIAI2AgwgBCAANgIICyAJQQhqIQEMAgsCQCAHRQ0AAkAgAygCHCIBQQJ0QfTXAGoiAigCACADRgRAIAIgADYCACAADQFByNUAIAhBfiABd3EiCDYCAAwCCyAHQRBBFCAHKAIQIANGG2ogADYCACAARQ0BCyAAIAc2AhggAygCECIBBEAgACABNgIQIAEgADYCGAsgA0EUaigCACIBRQ0AIABBFGogATYCACABIAA2AhgLAkAgBUEPTQRAIAMgBCAFaiIAQQNyNgIEIAAgA2oiACAAKAIEQQFyNgIEDAELIAMgBGoiAiAFQQFyNgIEIAMgBEEDcjYCBCACIAVqIAU2AgAgBUH/AU0EQCAFQXhxQezVAGohAAJ/QcTVACgCACIBQQEgBUEDdnQiBXFFBEBBxNUAIAEgBXI2AgAgAAwBCyAAKAIICyIBIAI2AgwgACACNgIIIAIgADYCDCACIAE2AggMAQtBHyEBIAVB////B00EQCAFQSYgBUEIdmciAGt2QQFxIABBAXRrQT5qIQELIAIgATYCHCACQgA3AhAgAUECdEH01wBqIQBBASABdCIEIAhxRQRAIAAgAjYCAEHI1QAgBCAIcjYCACACIAA2AhggAiACNgIIIAIgAjYCDAwBCyAFQRkgAUEBdmtBACABQR9HG3QhASAAKAIAIQQCQANAIAQiACgCBEF4cSAFRg0BIAFBHXYhBCABQQF0IQEgACAEQQRxakEQaiIGKAIAIgQNAAsgBiACNgIAIAIgADYCGCACIAI2AgwgAiACNgIIDAELIAAoAggiASACNgIMIAAgAjYCCCACQQA2AhggAiAANgIMIAIgATYCCAsgA0EIaiEBDAELAkAgCUUNAAJAIAAoAhwiAUECdEH01wBqIgIoAgAgAEYEQCACIAM2AgAgAw0BQcjVACALQX4gAXdxNgIADAILIAlBEEEUIAkoAhAgAEYbaiADNgIAIANFDQELIAMgCTYCGCAAKAIQIgEEQCADIAE2AhAgASADNgIYCyAAQRRqKAIAIgFFDQAgA0EUaiABNgIAIAEgAzYCGAsCQCAFQQ9NBEAgACAEIAVqIgFBA3I2AgQgACABaiIBIAEoAgRBAXI2AgQMAQsgACAEaiIHIAVBAXI2AgQgACAEQQNyNgIEIAUgB2ogBTYCACAIBEAgCEF4cUHs1QBqIQFB2NUAKAIAIQMCf0EBIAhBA3Z0IgIgBnFFBEBBxNUAIAIgBnI2AgAgAQwBCyABKAIICyICIAM2AgwgASADNgIIIAMgATYCDCADIAI2AggLQdjVACAHNgIAQczVACAFNgIACyAAQQhqIQELIApBEGokACABC0MAIABFBEA/AEEQdA8LAkAgAEH//wNxDQAgAEEASA0AIABBEHZAACIAQX9GBEBBtNkAQTA2AgBBfw8LIABBEHQPCwALC5lCIgBBgAgLDQEAAAAAAAAAAgAAAAMAQZgICwUEAAAABQBBqAgLCQYAAAAHAAAACABB5AgLwjJJbnZhbGlkIGNoYXIgaW4gdXJsIHF1ZXJ5AFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fYm9keQBDb250ZW50LUxlbmd0aCBvdmVyZmxvdwBDaHVuayBzaXplIG92ZXJmbG93AEludmFsaWQgbWV0aG9kIGZvciBIVFRQL3gueCByZXF1ZXN0AEludmFsaWQgbWV0aG9kIGZvciBSVFNQL3gueCByZXF1ZXN0AEV4cGVjdGVkIFNPVVJDRSBtZXRob2QgZm9yIElDRS94LnggcmVxdWVzdABJbnZhbGlkIGNoYXIgaW4gdXJsIGZyYWdtZW50IHN0YXJ0AEV4cGVjdGVkIGRvdABTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3N0YXR1cwBJbnZhbGlkIHJlc3BvbnNlIHN0YXR1cwBFeHBlY3RlZCBMRiBhZnRlciBoZWFkZXJzAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMAVXNlciBjYWxsYmFjayBlcnJvcgBgb25fcmVzZXRgIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19oZWFkZXJgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXNzYWdlX2JlZ2luYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfZXh0ZW5zaW9uX3ZhbHVlYCBjYWxsYmFjayBlcnJvcgBgb25fc3RhdHVzX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fdmVyc2lvbl9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3VybF9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3Byb3RvY29sX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9oZWFkZXJfdmFsdWVfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXNzYWdlX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fbWV0aG9kX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25faGVhZGVyX2ZpZWxkX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfZXh0ZW5zaW9uX25hbWVgIGNhbGxiYWNrIGVycm9yAFVuZXhwZWN0ZWQgY2hhciBpbiB1cmwgc2VydmVyAEludmFsaWQgaGVhZGVyIHZhbHVlIGNoYXIASW52YWxpZCBoZWFkZXIgZmllbGQgY2hhcgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3ZlcnNpb24ASW52YWxpZCBtaW5vciB2ZXJzaW9uAEludmFsaWQgbWFqb3IgdmVyc2lvbgBFeHBlY3RlZCBzcGFjZSBhZnRlciB2ZXJzaW9uAEV4cGVjdGVkIENSTEYgYWZ0ZXIgdmVyc2lvbgBJbnZhbGlkIEhUVFAgdmVyc2lvbgBJbnZhbGlkIGhlYWRlciB0b2tlbgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3VybABJbnZhbGlkIGNoYXJhY3RlcnMgaW4gdXJsAFVuZXhwZWN0ZWQgc3RhcnQgY2hhciBpbiB1cmwARG91YmxlIEAgaW4gdXJsAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fcHJvdG9jb2wARW1wdHkgQ29udGVudC1MZW5ndGgASW52YWxpZCBjaGFyYWN0ZXIgaW4gQ29udGVudC1MZW5ndGgAVHJhbnNmZXItRW5jb2RpbmcgY2FuJ3QgYmUgcHJlc2VudCB3aXRoIENvbnRlbnQtTGVuZ3RoAER1cGxpY2F0ZSBDb250ZW50LUxlbmd0aABJbnZhbGlkIGNoYXIgaW4gdXJsIHBhdGgAQ29udGVudC1MZW5ndGggY2FuJ3QgYmUgcHJlc2VudCB3aXRoIFRyYW5zZmVyLUVuY29kaW5nAE1pc3NpbmcgZXhwZWN0ZWQgQ1IgYWZ0ZXIgY2h1bmsgc2l6ZQBFeHBlY3RlZCBMRiBhZnRlciBjaHVuayBzaXplAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIHNpemUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfdmFsdWUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9jaHVua19leHRlbnNpb25fdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyB2YWx1ZQBVbmV4cGVjdGVkIHdoaXRlc3BhY2UgYWZ0ZXIgaGVhZGVyIHZhbHVlAE1pc3NpbmcgZXhwZWN0ZWQgQ1IgYWZ0ZXIgaGVhZGVyIHZhbHVlAE1pc3NpbmcgZXhwZWN0ZWQgTEYgYWZ0ZXIgaGVhZGVyIHZhbHVlAEludmFsaWQgYFRyYW5zZmVyLUVuY29kaW5nYCBoZWFkZXIgdmFsdWUATWlzc2luZyBleHBlY3RlZCBDUiBhZnRlciBjaHVuayBleHRlbnNpb24gdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBxdW90ZSB2YWx1ZQBJbnZhbGlkIHF1b3RlZC1wYWlyIGluIGNodW5rIGV4dGVuc2lvbnMgcXVvdGVkIHZhbHVlAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgcXVvdGVkIHZhbHVlAFBhdXNlZCBieSBvbl9oZWFkZXJzX2NvbXBsZXRlAEludmFsaWQgRU9GIHN0YXRlAG9uX3Jlc2V0IHBhdXNlAG9uX2NodW5rX2hlYWRlciBwYXVzZQBvbl9tZXNzYWdlX2JlZ2luIHBhdXNlAG9uX2NodW5rX2V4dGVuc2lvbl92YWx1ZSBwYXVzZQBvbl9zdGF0dXNfY29tcGxldGUgcGF1c2UAb25fdmVyc2lvbl9jb21wbGV0ZSBwYXVzZQBvbl91cmxfY29tcGxldGUgcGF1c2UAb25fcHJvdG9jb2xfY29tcGxldGUgcGF1c2UAb25fY2h1bmtfY29tcGxldGUgcGF1c2UAb25faGVhZGVyX3ZhbHVlX2NvbXBsZXRlIHBhdXNlAG9uX21lc3NhZ2VfY29tcGxldGUgcGF1c2UAb25fbWV0aG9kX2NvbXBsZXRlIHBhdXNlAG9uX2hlYWRlcl9maWVsZF9jb21wbGV0ZSBwYXVzZQBvbl9jaHVua19leHRlbnNpb25fbmFtZSBwYXVzZQBVbmV4cGVjdGVkIHNwYWNlIGFmdGVyIHN0YXJ0IGxpbmUATWlzc2luZyBleHBlY3RlZCBDUiBhZnRlciByZXNwb25zZSBsaW5lAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fY2h1bmtfZXh0ZW5zaW9uX25hbWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBuYW1lAE1pc3NpbmcgZXhwZWN0ZWQgQ1IgYWZ0ZXIgY2h1bmsgZXh0ZW5zaW9uIG5hbWUASW52YWxpZCBzdGF0dXMgY29kZQBQYXVzZSBvbiBDT05ORUNUL1VwZ3JhZGUAUGF1c2Ugb24gUFJJL1VwZ3JhZGUARXhwZWN0ZWQgSFRUUC8yIENvbm5lY3Rpb24gUHJlZmFjZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX21ldGhvZABFeHBlY3RlZCBzcGFjZSBhZnRlciBtZXRob2QAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfZmllbGQAUGF1c2VkAEludmFsaWQgd29yZCBlbmNvdW50ZXJlZABJbnZhbGlkIG1ldGhvZCBlbmNvdW50ZXJlZABNaXNzaW5nIGV4cGVjdGVkIENSIGFmdGVyIGNodW5rIGRhdGEARXhwZWN0ZWQgTEYgYWZ0ZXIgY2h1bmsgZGF0YQBVbmV4cGVjdGVkIGNoYXIgaW4gdXJsIHNjaGVtYQBSZXF1ZXN0IGhhcyBpbnZhbGlkIGBUcmFuc2Zlci1FbmNvZGluZ2AARGF0YSBhZnRlciBgQ29ubmVjdGlvbjogY2xvc2VgAFNXSVRDSF9QUk9YWQBVU0VfUFJPWFkATUtBQ1RJVklUWQBVTlBST0NFU1NBQkxFX0VOVElUWQBRVUVSWQBDT1BZAE1PVkVEX1BFUk1BTkVOVExZAFRPT19FQVJMWQBOT1RJRlkARkFJTEVEX0RFUEVOREVOQ1kAQkFEX0dBVEVXQVkAUExBWQBQVVQAQ0hFQ0tPVVQAR0FURVdBWV9USU1FT1VUAFJFUVVFU1RfVElNRU9VVABORVRXT1JLX0NPTk5FQ1RfVElNRU9VVABDT05ORUNUSU9OX1RJTUVPVVQATE9HSU5fVElNRU9VVABORVRXT1JLX1JFQURfVElNRU9VVABQT1NUAE1JU0RJUkVDVEVEX1JFUVVFU1QAQ0xJRU5UX0NMT1NFRF9SRVFVRVNUAENMSUVOVF9DTE9TRURfTE9BRF9CQUxBTkNFRF9SRVFVRVNUAEJBRF9SRVFVRVNUAEhUVFBfUkVRVUVTVF9TRU5UX1RPX0hUVFBTX1BPUlQAUkVQT1JUAElNX0FfVEVBUE9UAFJFU0VUX0NPTlRFTlQATk9fQ09OVEVOVABQQVJUSUFMX0NPTlRFTlQASFBFX0lOVkFMSURfQ09OU1RBTlQASFBFX0NCX1JFU0VUAEdFVABIUEVfU1RSSUNUAENPTkZMSUNUAFRFTVBPUkFSWV9SRURJUkVDVABQRVJNQU5FTlRfUkVESVJFQ1QAQ09OTkVDVABNVUxUSV9TVEFUVVMASFBFX0lOVkFMSURfU1RBVFVTAFRPT19NQU5ZX1JFUVVFU1RTAEVBUkxZX0hJTlRTAFVOQVZBSUxBQkxFX0ZPUl9MRUdBTF9SRUFTT05TAE9QVElPTlMAU1dJVENISU5HX1BST1RPQ09MUwBWQVJJQU5UX0FMU09fTkVHT1RJQVRFUwBNVUxUSVBMRV9DSE9JQ0VTAElOVEVSTkFMX1NFUlZFUl9FUlJPUgBXRUJfU0VSVkVSX1VOS05PV05fRVJST1IAUkFJTEdVTl9FUlJPUgBJREVOVElUWV9QUk9WSURFUl9BVVRIRU5USUNBVElPTl9FUlJPUgBTU0xfQ0VSVElGSUNBVEVfRVJST1IASU5WQUxJRF9YX0ZPUldBUkRFRF9GT1IAU0VUX1BBUkFNRVRFUgBHRVRfUEFSQU1FVEVSAEhQRV9VU0VSAFNFRV9PVEhFUgBIUEVfQ0JfQ0hVTktfSEVBREVSAEV4cGVjdGVkIExGIGFmdGVyIENSAE1LQ0FMRU5EQVIAU0VUVVAAV0VCX1NFUlZFUl9JU19ET1dOAFRFQVJET1dOAEhQRV9DTE9TRURfQ09OTkVDVElPTgBIRVVSSVNUSUNfRVhQSVJBVElPTgBESVNDT05ORUNURURfT1BFUkFUSU9OAE5PTl9BVVRIT1JJVEFUSVZFX0lORk9STUFUSU9OAEhQRV9JTlZBTElEX1ZFUlNJT04ASFBFX0NCX01FU1NBR0VfQkVHSU4AU0lURV9JU19GUk9aRU4ASFBFX0lOVkFMSURfSEVBREVSX1RPS0VOAElOVkFMSURfVE9LRU4ARk9SQklEREVOAEVOSEFOQ0VfWU9VUl9DQUxNAEhQRV9JTlZBTElEX1VSTABCTE9DS0VEX0JZX1BBUkVOVEFMX0NPTlRST0wATUtDT0wAQUNMAEhQRV9JTlRFUk5BTABSRVFVRVNUX0hFQURFUl9GSUVMRFNfVE9PX0xBUkdFX1VOT0ZGSUNJQUwASFBFX09LAFVOTElOSwBVTkxPQ0sAUFJJAFJFVFJZX1dJVEgASFBFX0lOVkFMSURfQ09OVEVOVF9MRU5HVEgASFBFX1VORVhQRUNURURfQ09OVEVOVF9MRU5HVEgARkxVU0gAUFJPUFBBVENIAE0tU0VBUkNIAFVSSV9UT09fTE9ORwBQUk9DRVNTSU5HAE1JU0NFTExBTkVPVVNfUEVSU0lTVEVOVF9XQVJOSU5HAE1JU0NFTExBTkVPVVNfV0FSTklORwBIUEVfSU5WQUxJRF9UUkFOU0ZFUl9FTkNPRElORwBFeHBlY3RlZCBDUkxGAEhQRV9JTlZBTElEX0NIVU5LX1NJWkUATU9WRQBDT05USU5VRQBIUEVfQ0JfU1RBVFVTX0NPTVBMRVRFAEhQRV9DQl9IRUFERVJTX0NPTVBMRVRFAEhQRV9DQl9WRVJTSU9OX0NPTVBMRVRFAEhQRV9DQl9VUkxfQ09NUExFVEUASFBFX0NCX1BST1RPQ09MX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19DT01QTEVURQBIUEVfQ0JfSEVBREVSX1ZBTFVFX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19FWFRFTlNJT05fVkFMVUVfQ09NUExFVEUASFBFX0NCX0NIVU5LX0VYVEVOU0lPTl9OQU1FX0NPTVBMRVRFAEhQRV9DQl9NRVNTQUdFX0NPTVBMRVRFAEhQRV9DQl9NRVRIT0RfQ09NUExFVEUASFBFX0NCX0hFQURFUl9GSUVMRF9DT01QTEVURQBERUxFVEUASFBFX0lOVkFMSURfRU9GX1NUQVRFAElOVkFMSURfU1NMX0NFUlRJRklDQVRFAFBBVVNFAE5PX1JFU1BPTlNFAFVOU1VQUE9SVEVEX01FRElBX1RZUEUAR09ORQBOT1RfQUNDRVBUQUJMRQBTRVJWSUNFX1VOQVZBSUxBQkxFAFJBTkdFX05PVF9TQVRJU0ZJQUJMRQBPUklHSU5fSVNfVU5SRUFDSEFCTEUAUkVTUE9OU0VfSVNfU1RBTEUAUFVSR0UATUVSR0UAUkVRVUVTVF9IRUFERVJfRklFTERTX1RPT19MQVJHRQBSRVFVRVNUX0hFQURFUl9UT09fTEFSR0UAUEFZTE9BRF9UT09fTEFSR0UASU5TVUZGSUNJRU5UX1NUT1JBR0UASFBFX1BBVVNFRF9VUEdSQURFAEhQRV9QQVVTRURfSDJfVVBHUkFERQBTT1VSQ0UAQU5OT1VOQ0UAVFJBQ0UASFBFX1VORVhQRUNURURfU1BBQ0UAREVTQ1JJQkUAVU5TVUJTQ1JJQkUAUkVDT1JEAEhQRV9JTlZBTElEX01FVEhPRABOT1RfRk9VTkQAUFJPUEZJTkQAVU5CSU5EAFJFQklORABVTkFVVEhPUklaRUQATUVUSE9EX05PVF9BTExPV0VEAEhUVFBfVkVSU0lPTl9OT1RfU1VQUE9SVEVEAEFMUkVBRFlfUkVQT1JURUQAQUNDRVBURUQATk9UX0lNUExFTUVOVEVEAExPT1BfREVURUNURUQASFBFX0NSX0VYUEVDVEVEAEhQRV9MRl9FWFBFQ1RFRABDUkVBVEVEAElNX1VTRUQASFBFX1BBVVNFRABUSU1FT1VUX09DQ1VSRUQAUEFZTUVOVF9SRVFVSVJFRABQUkVDT05ESVRJT05fUkVRVUlSRUQAUFJPWFlfQVVUSEVOVElDQVRJT05fUkVRVUlSRUQATkVUV09SS19BVVRIRU5USUNBVElPTl9SRVFVSVJFRABMRU5HVEhfUkVRVUlSRUQAU1NMX0NFUlRJRklDQVRFX1JFUVVJUkVEAFVQR1JBREVfUkVRVUlSRUQAUEFHRV9FWFBJUkVEAFBSRUNPTkRJVElPTl9GQUlMRUQARVhQRUNUQVRJT05fRkFJTEVEAFJFVkFMSURBVElPTl9GQUlMRUQAU1NMX0hBTkRTSEFLRV9GQUlMRUQATE9DS0VEAFRSQU5TRk9STUFUSU9OX0FQUExJRUQATk9UX01PRElGSUVEAE5PVF9FWFRFTkRFRABCQU5EV0lEVEhfTElNSVRfRVhDRUVERUQAU0lURV9JU19PVkVSTE9BREVEAEhFQUQARXhwZWN0ZWQgSFRUUC8sIFJUU1AvIG9yIElDRS8A5xUAAK8VAACkEgAAkhoAACYWAACeFAAA2xkAAHkVAAB+EgAA/hQAADYVAAALFgAA2BYAAPMSAABCGAAArBYAABIVAAAUFwAA7xcAAEgUAABxFwAAshoAAGsZAAB+GQAANRQAAIIaAABEFwAA/RYAAB4YAACHFwAAqhkAAJMSAAAHGAAALBcAAMoXAACkFwAA5xUAAOcVAABYFwAAOxgAAKASAAAtHAAAwxEAAEgRAADeEgAAQhMAAKQZAAD9EAAA9xUAAKUVAADvFgAA+BkAAEoWAABWFgAA9RUAAAoaAAAIGgAAARoAAKsVAABCEgAA1xAAAEwRAAAFGQAAVBYAAB4RAADKGQAAyBkAAE4WAAD/GAAAcRQAAPAVAADuFQAAlBkAAPwVAAC/GQAAmxkAAHwUAABDEQAAcBgAAJUUAAAnFAAAGRQAANUSAADUGQAARBYAAPcQAEG5OwsBAQBB0DsL4AEBAQIBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEDAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBBuj0LBAEAAAIAQdE9C14DBAMDAwMDAAADAwADAwADAwMDAwMDAwMDAAUAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAwADAEG6PwsEAQAAAgBB0T8LXgMAAwMDAwMAAAMDAAMDAAMDAwMDAwMDAwMABAAFAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwADAAMAQbDBAAsNbG9zZWVlcC1hbGl2ZQBBycEACwEBAEHgwQAL4AEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBBycMACwEBAEHgwwAL5wEBAQEBAQEBAQEBAQECAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAWNodW5rZWQAQfHFAAteAQABAQEBAQAAAQEAAQEAAQEBAQEBAQEBAQAAAAAAAAABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEAAQBB0McACyFlY3Rpb25lbnQtbGVuZ3Rob25yb3h5LWNvbm5lY3Rpb24AQYDIAAsgcmFuc2Zlci1lbmNvZGluZ3BncmFkZQ0KDQpTTQ0KDQoAQanIAAsFAQIAAQMAQcDIAAtfBAUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUAQanKAAsFAQIAAQMAQcDKAAtfBAUFBgUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUAQanMAAsEAQAAAQBBwcwAC14CAgACAgICAgICAgICAgICAgICAgICAgICAgICAgIAAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAEGpzgALBQECAAEDAEHAzgALXwQFAAAFBQUFBQUFBQUFBQYFBQUFBQUFBQUFBQUABQAHCAUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQAFAAUABQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUAAAAFAEGp0AALBQEBAAEBAEHA0AALAQEAQdrQAAtBAgAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAQanSAAsFAQEAAQEAQcDSAAsBAQBBytIACwYCAAAAAAIAQeHSAAs6AwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBBoNQAC50BTk9VTkNFRUNLT1VUTkVDVEVURUNSSUJFTFVTSEVURUFEU0VBUkNIUkdFQ1RJVklUWUxFTkRBUlZFT1RJRllQVElPTlNDSFNFQVlTVEFUQ0hHRVVFUllPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFVFRQQ0VUU1BBRFRQLw==`, `base64`) }); -})); -var se = c$3(((e, t) => { - let n = [ - `GET`, - `HEAD`, - `POST` - ], r = new Set(n), i = [ - 101, - 204, - 205, - 304 - ], a = [ - 301, - 302, - 303, - 307, - 308 - ], o = new Set(a), s = `1.7.9.11.13.15.17.19.20.21.22.23.25.37.42.43.53.69.77.79.87.95.101.102.103.104.109.110.111.113.115.117.119.123.135.137.139.143.161.179.389.427.465.512.513.514.515.526.530.531.532.540.548.554.556.563.587.601.636.989.990.993.995.1719.1720.1723.2049.3659.4045.4190.5060.5061.6000.6566.6665.6666.6667.6668.6669.6679.6697.10080`.split(`.`), c = new Set(s), l = [ - `no-referrer`, - `no-referrer-when-downgrade`, - `same-origin`, - `origin`, - `strict-origin`, - `origin-when-cross-origin`, - `strict-origin-when-cross-origin`, - `unsafe-url` - ], u = [``, ...l], d = new Set(l), f = [ - `follow`, - `manual`, - `error` - ], p = [ - `GET`, - `HEAD`, - `OPTIONS`, - `TRACE` - ], m = new Set(p), h = [ - `navigate`, - `same-origin`, - `no-cors`, - `cors` - ], g = [ - `omit`, - `same-origin`, - `include` - ], _ = [ - `default`, - `no-store`, - `reload`, - `no-cache`, - `force-cache`, - `only-if-cached` - ], v = [ - `content-encoding`, - `content-language`, - `content-location`, - `content-type`, - `content-length` - ], y = [`half`], b = [ - `CONNECT`, - `TRACE`, - `TRACK` - ], x = new Set(b), S = [ - `audio`, - `audioworklet`, - `font`, - `image`, - `manifest`, - `paintworklet`, - `script`, - `style`, - `track`, - `video`, - `xslt`, - `` - ]; - t.exports = { - subresource: S, - forbiddenMethods: b, - requestBodyHeader: v, - referrerPolicy: u, - requestRedirect: f, - requestMode: h, - requestCredentials: g, - requestCache: _, - redirectStatus: a, - corsSafeListedMethods: n, - nullBodyStatus: i, - safeMethods: p, - badPorts: s, - requestDuplex: y, - subresourceSet: new Set(S), - badPortsSet: c, - redirectStatusSet: o, - corsSafeListedMethodsSet: r, - safeMethodsSet: m, - forbiddenMethodsSet: x, - referrerPolicyTokens: d - }; -})); -var ce = c$3(((e, t) => { - let n = Symbol.for(`undici.globalOrigin.1`); - function r() { - return globalThis[n]; - } - function i(e) { - if (e === void 0) { - Object.defineProperty(globalThis, n, { - value: void 0, - writable: !0, - enumerable: !1, - configurable: !1 - }); - return; - } - let t = new URL(e); - if (t.protocol !== `http:` && t.protocol !== `https:`) throw TypeError(`Only http & https urls are allowed, received ${t.protocol}`); - Object.defineProperty(globalThis, n, { - value: t, - writable: !0, - enumerable: !1, - configurable: !1 - }); - } - t.exports = { - getGlobalOrigin: r, - setGlobalOrigin: i - }; -})); -var le = c$3(((e, t) => { - let n = new TextDecoder(); - function r(e) { - return e.length === 0 ? `` : (e[0] === 239 && e[1] === 187 && e[2] === 191 && (e = e.subarray(3)), n.decode(e)); - } - t.exports = { utf8DecodeBytes: r }; -})); -var q$1 = c$3(((e, t) => { - let r = p$4(`node:assert`), { utf8DecodeBytes: i } = le(); - function a(e, t, n) { - let r = ``; - for (; n.position < t.length && e(t[n.position]);) r += t[n.position], n.position++; - return r; - } - function o(e, t, n) { - let r = t.indexOf(e, n.position), i = n.position; - return r === -1 ? (n.position = t.length, t.slice(i)) : (n.position = r, t.slice(i, n.position)); - } - let s = /[\u0009\u000A\u000C\u000D\u0020]/g; - function c(e) { - e = e.replace(s, ``); - let t = e.length; - if (t % 4 == 0 && e.charCodeAt(t - 1) === 61 && (--t, e.charCodeAt(t - 1) === 61 && --t), t % 4 == 1 || /[^+/0-9A-Za-z]/.test(e.length === t ? e : e.substring(0, t))) return `failure`; - let n = Buffer.from(e, `base64`); - return new Uint8Array(n.buffer, n.byteOffset, n.byteLength); - } - function l(e) { - return e === 9 || e === 10 || e === 12 || e === 13 || e === 32; - } - function u(e) { - let t = e.length; - if (65535 > t) return String.fromCharCode.apply(null, e); - let n = ``, r = 0, i = 65535; - for (; r < t;) r + i > t && (i = t - r), n += String.fromCharCode.apply(null, e.subarray(r, r += i)); - return n; - } - let d = /[^\x00-\xFF]/; - function f(e) { - return r(!d.test(e)), e; - } - function p(e) { - return JSON.parse(i(e)); - } - function m(e, t = !0, n = !0) { - return h(e, t, n, l); - } - function h(e, t, n, r) { - let i = 0, a = e.length - 1; - if (t) for (; i < e.length && r(e.charCodeAt(i));) i++; - if (n) for (; a > 0 && r(e.charCodeAt(a));) a--; - return i === 0 && a === e.length - 1 ? e : e.slice(i, a + 1); - } - function g(e) { - let t = JSON.stringify(e); - if (t === void 0) throw TypeError(`Value is not JSON serializable`); - return r(typeof t == `string`), t; - } - t.exports = { - collectASequenceOfCodePoints: a, - collectASequenceOfCodePointsFast: o, - forgivingBase64: c, - isASCIIWhitespace: l, - isomorphicDecode: u, - isomorphicEncode: f, - parseJSONFromBytes: p, - removeASCIIWhitespace: m, - removeChars: h, - serializeJavascriptValueToJSONString: g - }; -})); -var J$1 = c$3(((e, t) => { - let r = p$4(`node:assert`), { forgivingBase64: i, collectASequenceOfCodePoints: a, collectASequenceOfCodePointsFast: o, isomorphicDecode: s, removeASCIIWhitespace: c, removeChars: l } = q$1(), u = new TextEncoder(), d = /^[-!#$%&'*+.^_|~A-Za-z0-9]+$/u, f = /[\u000A\u000D\u0009\u0020]/u, p = /^[\u0009\u0020-\u007E\u0080-\u00FF]+$/u; - function m(e) { - r(e.protocol === `data:`); - let t = h(e, !0); - t = t.slice(5); - let n = { position: 0 }, a = o(`,`, t, n), l = a.length; - if (a = c(a, !0, !0), n.position >= t.length) return `failure`; - n.position++; - let u = g(t.slice(l + 1)); - if (/;(?:\u0020*)base64$/iu.test(a)) { - if (u = i(s(u)), u === `failure`) return `failure`; - a = a.slice(0, -6), a = a.replace(/(\u0020+)$/u, ``), a = a.slice(0, -1); - } - a.startsWith(`;`) && (a = `text/plain` + a); - let d = b(a); - return d === `failure` && (d = b(`text/plain;charset=US-ASCII`)), { - mimeType: d, - body: u - }; - } - function h(e, t = !1) { - if (!t) return e.href; - let n = e.href, r = e.hash.length, i = r === 0 ? n : n.substring(0, n.length - r); - return !r && n.endsWith(`#`) ? i.slice(0, -1) : i; - } - function g(e) { - return y(u.encode(e)); - } - function _(e) { - return e >= 48 && e <= 57 || e >= 65 && e <= 70 || e >= 97 && e <= 102; - } - function v(e) { - return e >= 48 && e <= 57 ? e - 48 : (e & 223) - 55; - } - function y(e) { - let t = e.length, n = new Uint8Array(t), r = 0, i = 0; - for (; i < t;) { - let t = e[i]; - t === 37 ? t === 37 && !(_(e[i + 1]) && _(e[i + 2])) ? n[r++] = 37 : (n[r++] = v(e[i + 1]) << 4 | v(e[i + 2]), i += 2) : n[r++] = t, ++i; - } - return t === r ? n : n.subarray(0, r); - } - function b(e) { - e = w(e, !0, !0); - let t = { position: 0 }, n = o(`/`, e, t); - if (n.length === 0 || !d.test(n) || t.position >= e.length) return `failure`; - t.position++; - let r = o(`;`, e, t); - if (r = w(r, !1, !0), r.length === 0 || !d.test(r)) return `failure`; - let i = n.toLowerCase(), s = r.toLowerCase(), c = { - type: i, - subtype: s, - parameters: /* @__PURE__ */ new Map(), - essence: `${i}/${s}` - }; - for (; t.position < e.length;) { - t.position++, a((e) => f.test(e), e, t); - let n = a((e) => e !== `;` && e !== `=`, e, t); - if (n = n.toLowerCase(), t.position < e.length) { - if (e[t.position] === `;`) continue; - t.position++; - } - if (t.position >= e.length) break; - let r = null; - if (e[t.position] === `"`) r = x(e, t, !0), o(`;`, e, t); - else if (r = o(`;`, e, t), r = w(r, !1, !0), r.length === 0) continue; - n.length !== 0 && d.test(n) && (r.length === 0 || p.test(r)) && !c.parameters.has(n) && c.parameters.set(n, r); - } - return c; - } - function x(e, t, n = !1) { - let i = t.position, o = ``; - for (r(e[t.position] === `"`), t.position++; o += a((e) => e !== `"` && e !== `\\`, e, t), !(t.position >= e.length);) { - let n = e[t.position]; - if (t.position++, n === `\\`) { - if (t.position >= e.length) { - o += `\\`; - break; - } - o += e[t.position], t.position++; - } else { - r(n === `"`); - break; - } - } - return n ? o : e.slice(i, t.position); - } - function S(e) { - r(e !== `failure`); - let { parameters: t, essence: n } = e, i = n; - for (let [e, n] of t.entries()) i += `;`, i += e, i += `=`, d.test(n) || (n = n.replace(/[\\"]/gu, `\\$&`), n = `"` + n, n += `"`), i += n; - return i; - } - function C(e) { - return e === 13 || e === 10 || e === 9 || e === 32; - } - function w(e, t = !0, n = !0) { - return l(e, t, n, C); - } - function T(e) { - switch (e.essence) { - case `application/ecmascript`: - case `application/javascript`: - case `application/x-ecmascript`: - case `application/x-javascript`: - case `text/ecmascript`: - case `text/javascript`: - case `text/javascript1.0`: - case `text/javascript1.1`: - case `text/javascript1.2`: - case `text/javascript1.3`: - case `text/javascript1.4`: - case `text/javascript1.5`: - case `text/jscript`: - case `text/livescript`: - case `text/x-ecmascript`: - case `text/x-javascript`: return `text/javascript`; - case `application/json`: - case `text/json`: return `application/json`; - case `image/svg+xml`: return `image/svg+xml`; - case `text/xml`: - case `application/xml`: return `application/xml`; - } - return e.subtype.endsWith(`+json`) ? `application/json` : e.subtype.endsWith(`+xml`) ? `application/xml` : ``; - } - t.exports = { - dataURLProcessor: m, - URLSerializer: h, - stringPercentDecode: g, - parseMIMEType: b, - collectAnHTTPQuotedString: x, - serializeAMimeType: S, - removeHTTPWhitespace: w, - minimizeSupportedMimeType: T, - HTTP_TOKEN_CODEPOINTS: d - }; -})); -var ue = c$3(((e, t) => { - let r = { - __proto__: null, - "node:crypto": () => p$4(`node:crypto`), - "node:sqlite": () => p$4(`node:sqlite`), - "node:worker_threads": () => p$4(`node:worker_threads`), - "node:zlib": () => p$4(`node:zlib`) - }; - function i(e) { - try { - return r[e](), !0; - } catch (e) { - if (e.code !== `ERR_UNKNOWN_BUILTIN_MODULE` && e.code !== `ERR_NO_CRYPTO`) throw e; - return !1; - } - } - function a(e, t) { - return r[e]()[t] !== void 0; - } - let o = [`markAsUncloneable`, `zstd`], s = { - markAsUncloneable: [`node:worker_threads`, `markAsUncloneable`], - zstd: [`node:zlib`, `createZstdDecompress`] - }, c = [`crypto`, `sqlite`], l = [...c, ...o]; - function u(e) { - if (c.includes(e)) return i(`node:${e}`); - if (o.includes(e)) { - let [t, n] = s[e]; - return a(t, n); - } - throw TypeError(`unknown feature: ${e}`); - } - let d = new class { - #e = /* @__PURE__ */ new Map(); - clear() { - this.#e.clear(); - } - has(e) { - return this.#e.get(e) ?? this.#t(e); - } - set(e, t) { - if (l.includes(e) === !1) throw TypeError(`unknown feature: ${e}`); - this.#e.set(e, t); - } - #t(e) { - let t = u(e); - return this.#e.set(e, t), t; - } - }(); - t.exports.runtimeFeatures = d, t.exports.default = d; -})); -var de = c$3(((e, t) => { - let r = p$4(`node:assert`), { types: i, inspect: a } = p$4(`node:util`), { runtimeFeatures: o } = ue(), s = Function.call.bind(Function.prototype[Symbol.hasInstance]), c = { - converters: {}, - util: {}, - errors: {}, - is: {} - }; - c.errors.exception = function(e) { - return TypeError(`${e.header}: ${e.message}`); - }, c.errors.conversionFailed = function(e) { - let t = e.types.length === 1 ? `` : ` one of`, n = `${e.argument} could not be converted to${t}: ${e.types.join(`, `)}.`; - return c.errors.exception({ - header: e.prefix, - message: n - }); - }, c.errors.invalidArgument = function(e) { - return c.errors.exception({ - header: e.prefix, - message: `"${e.value}" is an invalid ${e.type}.` - }); - }, c.brandCheck = function(e, t) { - if (!s(t, e)) { - let e = TypeError(`Illegal invocation`); - throw e.code = `ERR_INVALID_THIS`, e; - } - }, c.brandCheckMultiple = function(e) { - let t = e.map((e) => c.util.MakeTypeAssertion(e)); - return (e) => { - if (t.every((t) => !t(e))) { - let e = TypeError(`Illegal invocation`); - throw e.code = `ERR_INVALID_THIS`, e; - } - }; - }, c.argumentLengthCheck = function({ length: e }, t, n) { - if (e < t) throw c.errors.exception({ - message: `${t} argument${t === 1 ? `` : `s`} required, but${e ? ` only` : ``} ${e} found.`, - header: n - }); - }, c.illegalConstructor = function() { - throw c.errors.exception({ - header: `TypeError`, - message: `Illegal constructor` - }); - }, c.util.MakeTypeAssertion = function(e) { - return (t) => s(e, t); - }, c.util.Type = function(e) { - switch (typeof e) { - case `undefined`: return 1; - case `boolean`: return 2; - case `string`: return 3; - case `symbol`: return 4; - case `number`: return 5; - case `bigint`: return 6; - case `function`: - case `object`: return e === null ? 7 : 8; - } - }, c.util.Types = { - UNDEFINED: 1, - BOOLEAN: 2, - STRING: 3, - SYMBOL: 4, - NUMBER: 5, - BIGINT: 6, - NULL: 7, - OBJECT: 8 - }, c.util.TypeValueToString = function(e) { - switch (c.util.Type(e)) { - case 1: return `Undefined`; - case 2: return `Boolean`; - case 3: return `String`; - case 4: return `Symbol`; - case 5: return `Number`; - case 6: return `BigInt`; - case 7: return `Null`; - case 8: return `Object`; - } - }, c.util.markAsUncloneable = o.has(`markAsUncloneable`) ? p$4(`node:worker_threads`).markAsUncloneable : () => {}, c.util.ConvertToInt = function(e, t, n, r) { - let i, a; - t === 64 ? (i = 2 ** 53 - 1, a = n === `unsigned` ? 0 : -9007199254740991) : n === `unsigned` ? (a = 0, i = 2 ** t - 1) : (a = -(2 ** (t - 1)), i = 2 ** (t - 1) - 1); - let o = Number(e); - if (o === 0 && (o = 0), c.util.HasFlag(r, c.attributes.EnforceRange)) { - if (Number.isNaN(o) || o === Infinity || o === -Infinity) throw c.errors.exception({ - header: `Integer conversion`, - message: `Could not convert ${c.util.Stringify(e)} to an integer.` - }); - if (o = c.util.IntegerPart(o), o < a || o > i) throw c.errors.exception({ - header: `Integer conversion`, - message: `Value must be between ${a}-${i}, got ${o}.` - }); - return o; - } - return !Number.isNaN(o) && c.util.HasFlag(r, c.attributes.Clamp) ? (o = Math.min(Math.max(o, a), i), o = Math.floor(o) % 2 == 0 ? Math.floor(o) : Math.ceil(o), o) : Number.isNaN(o) || o === 0 && Object.is(0, o) || o === Infinity || o === -Infinity ? 0 : (o = c.util.IntegerPart(o), o %= 2 ** t, n === `signed` && o >= 2 ** (t - 1) ? o - 2 ** t : o); - }, c.util.IntegerPart = function(e) { - let t = Math.floor(Math.abs(e)); - return e < 0 ? -1 * t : t; - }, c.util.Stringify = function(e) { - switch (c.util.Type(e)) { - case 4: return `Symbol(${e.description})`; - case 8: return a(e); - case 3: return `"${e}"`; - case 6: return `${e}n`; - default: return `${e}`; - } - }, c.util.IsResizableArrayBuffer = function(e) { - if (i.isArrayBuffer(e)) return e.resizable; - if (i.isSharedArrayBuffer(e)) return e.growable; - throw c.errors.exception({ - header: `IsResizableArrayBuffer`, - message: `"${c.util.Stringify(e)}" is not an array buffer.` - }); - }, c.util.HasFlag = function(e, t) { - return typeof e == `number` && (e & t) === t; - }, c.sequenceConverter = function(e) { - return (t, n, r, i) => { - if (c.util.Type(t) !== 8) throw c.errors.exception({ - header: n, - message: `${r} (${c.util.Stringify(t)}) is not iterable.` - }); - let a = typeof i == `function` ? i() : t?.[Symbol.iterator]?.(), o = [], s = 0; - if (a === void 0 || typeof a.next != `function`) throw c.errors.exception({ - header: n, - message: `${r} is not iterable.` - }); - for (;;) { - let { done: t, value: i } = a.next(); - if (t) break; - o.push(e(i, n, `${r}[${s++}]`)); - } - return o; - }; - }, c.recordConverter = function(e, t) { - return (n, r, a) => { - if (c.util.Type(n) !== 8) throw c.errors.exception({ - header: r, - message: `${a} ("${c.util.TypeValueToString(n)}") is not an Object.` - }); - let o = {}; - if (!i.isProxy(n)) { - let i = [...Object.getOwnPropertyNames(n), ...Object.getOwnPropertySymbols(n)]; - for (let s of i) { - let i = c.util.Stringify(s), l = e(s, r, `Key ${i} in ${a}`); - o[l] = t(n[s], r, `${a}[${i}]`); - } - return o; - } - let s = Reflect.ownKeys(n); - for (let i of s) if (Reflect.getOwnPropertyDescriptor(n, i)?.enumerable) { - let s = e(i, r, a); - o[s] = t(n[i], r, a); - } - return o; - }; - }, c.interfaceConverter = function(e, t) { - return (n, r, i) => { - if (!e(n)) throw c.errors.exception({ - header: r, - message: `Expected ${i} ("${c.util.Stringify(n)}") to be an instance of ${t}.` - }); - return n; - }; - }, c.dictionaryConverter = function(e) { - return e.sort((e, t) => (e.key > t.key) - (e.key < t.key)), (t, n, r) => { - let i = {}; - if (t != null && c.util.Type(t) !== 8) throw c.errors.exception({ - header: n, - message: `Expected ${t} to be one of: Null, Undefined, Object.` - }); - for (let a of e) { - let { key: e, defaultValue: o, required: s, converter: l } = a; - if (s === !0 && (t == null || !Object.hasOwn(t, e))) throw c.errors.exception({ - header: n, - message: `Missing required key "${e}".` - }); - let u = t?.[e], d = o !== void 0; - if (d && u === void 0 && (u = o()), s || d || u !== void 0) { - if (u = l(u, n, `${r}.${e}`), a.allowedValues && !a.allowedValues.includes(u)) throw c.errors.exception({ - header: n, - message: `${u} is not an accepted type. Expected one of ${a.allowedValues.join(`, `)}.` - }); - i[e] = u; - } - } - return i; - }; - }, c.nullableConverter = function(e) { - return (t, n, r) => t === null ? t : e(t, n, r); - }, c.is.USVString = function(e) { - return typeof e == `string` && e.isWellFormed(); - }, c.is.ReadableStream = c.util.MakeTypeAssertion(ReadableStream), c.is.Blob = c.util.MakeTypeAssertion(Blob), c.is.URLSearchParams = c.util.MakeTypeAssertion(URLSearchParams), c.is.File = c.util.MakeTypeAssertion(File), c.is.URL = c.util.MakeTypeAssertion(URL), c.is.AbortSignal = c.util.MakeTypeAssertion(AbortSignal), c.is.MessagePort = c.util.MakeTypeAssertion(MessagePort), c.is.BufferSource = function(e) { - return i.isArrayBuffer(e) || ArrayBuffer.isView(e) && i.isArrayBuffer(e.buffer); - }, c.util.getCopyOfBytesHeldByBufferSource = function(e) { - let t = e, n = t, a = 0, o = 0; - if (i.isTypedArray(t) || i.isDataView(t) ? (n = t.buffer, a = t.byteOffset, o = t.byteLength) : (r(i.isAnyArrayBuffer(t)), o = t.byteLength), n.detached) return /* @__PURE__ */ new Uint8Array(); - let s = new Uint8Array(o), c = new Uint8Array(n, a, o); - return s.set(c), s; - }, c.converters.DOMString = function(e, t, n, r) { - if (e === null && c.util.HasFlag(r, c.attributes.LegacyNullToEmptyString)) return ``; - if (typeof e == `symbol`) throw c.errors.exception({ - header: t, - message: `${n} is a symbol, which cannot be converted to a DOMString.` - }); - return String(e); - }, c.converters.ByteString = function(e, t, n) { - if (typeof e == `symbol`) throw c.errors.exception({ - header: t, - message: `${n} is a symbol, which cannot be converted to a ByteString.` - }); - let r = String(e); - for (let e = 0; e < r.length; e++) if (r.charCodeAt(e) > 255) throw TypeError(`Cannot convert argument to a ByteString because the character at index ${e} has a value of ${r.charCodeAt(e)} which is greater than 255.`); - return r; - }, c.converters.USVString = function(e) { - return typeof e == `string` ? e.toWellFormed() : `${e}`.toWellFormed(); - }, c.converters.boolean = function(e) { - return !!e; - }, c.converters.any = function(e) { - return e; - }, c.converters[`long long`] = function(e, t, n) { - return c.util.ConvertToInt(e, 64, `signed`, 0, t, n); - }, c.converters[`unsigned long long`] = function(e, t, n) { - return c.util.ConvertToInt(e, 64, `unsigned`, 0, t, n); - }, c.converters[`unsigned long`] = function(e, t, n) { - return c.util.ConvertToInt(e, 32, `unsigned`, 0, t, n); - }, c.converters[`unsigned short`] = function(e, t, n, r) { - return c.util.ConvertToInt(e, 16, `unsigned`, r, t, n); - }, c.converters.ArrayBuffer = function(e, t, n, r) { - if (c.util.Type(e) !== 8 || !i.isArrayBuffer(e)) throw c.errors.conversionFailed({ - prefix: t, - argument: `${n} ("${c.util.Stringify(e)}")`, - types: [`ArrayBuffer`] - }); - if (!c.util.HasFlag(r, c.attributes.AllowResizable) && c.util.IsResizableArrayBuffer(e)) throw c.errors.exception({ - header: t, - message: `${n} cannot be a resizable ArrayBuffer.` - }); - return e; - }, c.converters.SharedArrayBuffer = function(e, t, n, r) { - if (c.util.Type(e) !== 8 || !i.isSharedArrayBuffer(e)) throw c.errors.conversionFailed({ - prefix: t, - argument: `${n} ("${c.util.Stringify(e)}")`, - types: [`SharedArrayBuffer`] - }); - if (!c.util.HasFlag(r, c.attributes.AllowResizable) && c.util.IsResizableArrayBuffer(e)) throw c.errors.exception({ - header: t, - message: `${n} cannot be a resizable SharedArrayBuffer.` - }); - return e; - }, c.converters.TypedArray = function(e, t, n, r, a) { - if (c.util.Type(e) !== 8 || !i.isTypedArray(e) || e.constructor.name !== t.name) throw c.errors.conversionFailed({ - prefix: n, - argument: `${r} ("${c.util.Stringify(e)}")`, - types: [t.name] - }); - if (!c.util.HasFlag(a, c.attributes.AllowShared) && i.isSharedArrayBuffer(e.buffer)) throw c.errors.exception({ - header: n, - message: `${r} cannot be a view on a shared array buffer.` - }); - if (!c.util.HasFlag(a, c.attributes.AllowResizable) && c.util.IsResizableArrayBuffer(e.buffer)) throw c.errors.exception({ - header: n, - message: `${r} cannot be a view on a resizable array buffer.` - }); - return e; - }, c.converters.DataView = function(e, t, n, r) { - if (c.util.Type(e) !== 8 || !i.isDataView(e)) throw c.errors.conversionFailed({ - prefix: t, - argument: `${n} ("${c.util.Stringify(e)}")`, - types: [`DataView`] - }); - if (!c.util.HasFlag(r, c.attributes.AllowShared) && i.isSharedArrayBuffer(e.buffer)) throw c.errors.exception({ - header: t, - message: `${n} cannot be a view on a shared array buffer.` - }); - if (!c.util.HasFlag(r, c.attributes.AllowResizable) && c.util.IsResizableArrayBuffer(e.buffer)) throw c.errors.exception({ - header: t, - message: `${n} cannot be a view on a resizable array buffer.` - }); - return e; - }, c.converters.ArrayBufferView = function(e, t, n, r) { - if (c.util.Type(e) !== 8 || !i.isArrayBufferView(e)) throw c.errors.conversionFailed({ - prefix: t, - argument: `${n} ("${c.util.Stringify(e)}")`, - types: [`ArrayBufferView`] - }); - if (!c.util.HasFlag(r, c.attributes.AllowShared) && i.isSharedArrayBuffer(e.buffer)) throw c.errors.exception({ - header: t, - message: `${n} cannot be a view on a shared array buffer.` - }); - if (!c.util.HasFlag(r, c.attributes.AllowResizable) && c.util.IsResizableArrayBuffer(e.buffer)) throw c.errors.exception({ - header: t, - message: `${n} cannot be a view on a resizable array buffer.` - }); - return e; - }, c.converters.BufferSource = function(e, t, n, r) { - if (i.isArrayBuffer(e)) return c.converters.ArrayBuffer(e, t, n, r); - if (i.isArrayBufferView(e)) return r &= ~c.attributes.AllowShared, c.converters.ArrayBufferView(e, t, n, r); - throw i.isSharedArrayBuffer(e) ? c.errors.exception({ - header: t, - message: `${n} cannot be a SharedArrayBuffer.` - }) : c.errors.conversionFailed({ - prefix: t, - argument: `${n} ("${c.util.Stringify(e)}")`, - types: [`ArrayBuffer`, `ArrayBufferView`] - }); - }, c.converters.AllowSharedBufferSource = function(e, t, n, r) { - if (i.isArrayBuffer(e)) return c.converters.ArrayBuffer(e, t, n, r); - if (i.isSharedArrayBuffer(e)) return c.converters.SharedArrayBuffer(e, t, n, r); - if (i.isArrayBufferView(e)) return r |= c.attributes.AllowShared, c.converters.ArrayBufferView(e, t, n, r); - throw c.errors.conversionFailed({ - prefix: t, - argument: `${n} ("${c.util.Stringify(e)}")`, - types: [ - `ArrayBuffer`, - `SharedArrayBuffer`, - `ArrayBufferView` - ] - }); - }, c.converters[`sequence`] = c.sequenceConverter(c.converters.ByteString), c.converters[`sequence>`] = c.sequenceConverter(c.converters[`sequence`]), c.converters[`record`] = c.recordConverter(c.converters.ByteString, c.converters.ByteString), c.converters.Blob = c.interfaceConverter(c.is.Blob, `Blob`), c.converters.AbortSignal = c.interfaceConverter(c.is.AbortSignal, `AbortSignal`), c.converters.EventHandlerNonNull = function(e) { - return c.util.Type(e) === 8 ? typeof e == `function` ? e : () => {} : null; - }, c.attributes = { - Clamp: 1, - EnforceRange: 2, - AllowShared: 4, - AllowResizable: 8, - LegacyNullToEmptyString: 16 - }, t.exports = { webidl: c }; -})); -var Y$1 = c$3(((e, t) => { - let { Transform: r } = p$4(`node:stream`), i = p$4(`node:zlib`), { redirectStatusSet: a, referrerPolicyTokens: o, badPortsSet: s } = se(), { getGlobalOrigin: c } = ce(), { collectAnHTTPQuotedString: l, parseMIMEType: u } = J$1(), { performance: d } = p$4(`node:perf_hooks`), { ReadableStreamFrom: f, isValidHTTPToken: p, normalizedMethodRecordsBase: m } = B$1(), h = p$4(`node:assert`), { isUint8Array: g } = p$4(`node:util/types`), { webidl: _ } = de(), { isomorphicEncode: v, collectASequenceOfCodePoints: y, removeChars: b } = q$1(); - function x(e) { - let t = e.urlList, n = t.length; - return n === 0 ? null : t[n - 1].toString(); - } - function S(e, t) { - if (!a.has(e.status)) return null; - let n = e.headersList.get(`location`, !0); - return n !== null && A(n) && (C(n) || (n = w(n)), n = new URL(n, x(e))), n && !n.hash && (n.hash = t), n; - } - function C(e) { - for (let t = 0; t < e.length; ++t) { - let n = e.charCodeAt(t); - if (n > 126 || n < 32) return !1; - } - return !0; - } - function w(e) { - return Buffer.from(e, `binary`).toString(`utf8`); - } - function T(e) { - return e.urlList[e.urlList.length - 1]; - } - function E(e) { - let t = T(e); - return ve(t) && s.has(t.port) ? `blocked` : `allowed`; - } - function D(e) { - return e instanceof Error || e?.constructor?.name === `Error` || e?.constructor?.name === `DOMException`; - } - function O(e) { - for (let t = 0; t < e.length; ++t) { - let n = e.charCodeAt(t); - if (!(n === 9 || n >= 32 && n <= 126 || n >= 128 && n <= 255)) return !1; - } - return !0; - } - let k = p; - function A(e) { - return (e[0] === ` ` || e[0] === ` ` || e[e.length - 1] === ` ` || e[e.length - 1] === ` ` || e.includes(` -`) || e.includes(`\r`) || e.includes(`\0`)) === !1; - } - function j(e) { - let t = (e.headersList.get(`referrer-policy`, !0) ?? ``).split(`,`), n = ``; - if (t.length) for (let e = t.length; e !== 0; e--) { - let r = t[e - 1].trim(); - if (o.has(r)) { - n = r; - break; - } - } - return n; - } - function M(e, t) { - let n = j(t); - n !== `` && (e.referrerPolicy = n); - } - function N() { - return `allowed`; - } - function P() { - return `success`; - } - function F() { - return `success`; - } - function I(e) { - let t = null; - t = e.mode, e.headersList.set(`sec-fetch-mode`, t, !0); - } - function L(e) { - let t = e.origin; - if (!(t === `client` || t === void 0)) { - if (e.responseTainting === `cors` || e.mode === `websocket`) e.headersList.append(`origin`, t, !0); - else if (e.method !== `GET` && e.method !== `HEAD`) { - switch (e.referrerPolicy) { - case `no-referrer`: - t = null; - break; - case `no-referrer-when-downgrade`: - case `strict-origin`: - case `strict-origin-when-cross-origin`: - e.origin && _e(e.origin) && !_e(T(e)) && (t = null); - break; - case `same-origin`: - oe(e, T(e)) || (t = null); - break; - default: - } - e.headersList.append(`origin`, t, !0); - } - } - } - function R(e, t) { - return e; - } - function ee(e, t, n) { - return !e?.startTime || e.startTime < t ? { - domainLookupStartTime: t, - domainLookupEndTime: t, - connectionStartTime: t, - connectionEndTime: t, - secureConnectionStartTime: t, - ALPNNegotiatedProtocol: e?.ALPNNegotiatedProtocol - } : { - domainLookupStartTime: R(e.domainLookupStartTime, n), - domainLookupEndTime: R(e.domainLookupEndTime, n), - connectionStartTime: R(e.connectionStartTime, n), - connectionEndTime: R(e.connectionEndTime, n), - secureConnectionStartTime: R(e.secureConnectionStartTime, n), - ALPNNegotiatedProtocol: e.ALPNNegotiatedProtocol - }; - } - function z(e) { - return R(d.now(), e); - } - function V(e) { - return { - startTime: e.startTime ?? 0, - redirectStartTime: 0, - redirectEndTime: 0, - postRedirectStartTime: e.startTime ?? 0, - finalServiceWorkerStartTime: 0, - finalNetworkResponseStartTime: 0, - finalNetworkRequestStartTime: 0, - endTime: 0, - encodedBodySize: 0, - decodedBodySize: 0, - finalConnectionTimingInfo: null - }; - } - function H() { - return { referrerPolicy: `strict-origin-when-cross-origin` }; - } - function te(e) { - return { referrerPolicy: e.referrerPolicy }; - } - function U(e) { - let t = e.referrerPolicy; - h(t); - let n = null; - if (e.referrer === `client`) { - let e = c(); - if (!e || e.origin === `null`) return `no-referrer`; - n = new URL(e); - } else _.is.URL(e.referrer) && (n = e.referrer); - let r = W(n), i = W(n, !0); - switch (r.toString().length > 4096 && (r = i), t) { - case `no-referrer`: return `no-referrer`; - case `origin`: return i ?? W(n, !0); - case `unsafe-url`: return r; - case `strict-origin`: { - let t = T(e); - return ie(r) && !ie(t) ? `no-referrer` : i; - } - case `strict-origin-when-cross-origin`: { - let t = T(e); - return oe(r, t) ? r : ie(r) && !ie(t) ? `no-referrer` : i; - } - case `same-origin`: return oe(e, r) ? r : `no-referrer`; - case `origin-when-cross-origin`: return oe(e, r) ? r : i; - case `no-referrer-when-downgrade`: { - let t = T(e); - return ie(r) && !ie(t) ? `no-referrer` : r; - } - } - } - function W(e, t = !1) { - return h(_.is.URL(e)), e = new URL(e), Z(e) ? `no-referrer` : (e.username = ``, e.password = ``, e.hash = ``, t === !0 && (e.pathname = ``, e.search = ``), e); - } - let ne = RegExp.prototype.test.bind(/^127\.(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)\.){2}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)$/), G = RegExp.prototype.test.bind(/^(?:(?:0{1,4}:){7}|(?:0{1,4}:){1,6}:|::)0{0,3}1$/); - function K(e) { - return e.includes(`:`) ? (e[0] === `[` && e[e.length - 1] === `]` && (e = e.slice(1, -1)), G(e)) : ne(e); - } - function re(e) { - return e == null || e === `null` ? !1 : (e = new URL(e), !!(e.protocol === `https:` || e.protocol === `wss:` || K(e.hostname) || e.hostname === `localhost` || e.hostname === `localhost.` || e.hostname.endsWith(`.localhost`) || e.hostname.endsWith(`.localhost.`) || e.protocol === `file:`)); - } - function ie(e) { - return _.is.URL(e) ? e.href === `about:blank` || e.href === `about:srcdoc` || e.protocol === `data:` || e.protocol === `blob:` ? !0 : re(e.origin) : !1; - } - function ae(e) {} - function oe(e, t) { - return e.origin === t.origin && e.origin === `null` || e.protocol === t.protocol && e.hostname === t.hostname && e.port === t.port; - } - function le(e) { - return e.controller.state === `aborted`; - } - function ue(e) { - return e.controller.state === `aborted` || e.controller.state === `terminated`; - } - function Y(e) { - return m[e.toLowerCase()] ?? e; - } - let fe = Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())); - function pe(e, t, n = 0, r = 1) { - class i { - #e; - #t; - #n; - constructor(e, t) { - this.#e = e, this.#t = t, this.#n = 0; - } - next() { - if (typeof this != `object` || this === null || !(#e in this)) throw TypeError(`'next' called on an object that does not implement interface ${e} Iterator.`); - let i = this.#n, a = t(this.#e); - if (i >= a.length) return { - value: void 0, - done: !0 - }; - let { [n]: o, [r]: s } = a[i]; - this.#n = i + 1; - let c; - switch (this.#t) { - case `key`: - c = o; - break; - case `value`: - c = s; - break; - case `key+value`: - c = [o, s]; - break; - } - return { - value: c, - done: !1 - }; - } - } - return delete i.prototype.constructor, Object.setPrototypeOf(i.prototype, fe), Object.defineProperties(i.prototype, { - [Symbol.toStringTag]: { - writable: !1, - enumerable: !1, - configurable: !0, - value: `${e} Iterator` - }, - next: { - writable: !0, - enumerable: !0, - configurable: !0 - } - }), function(e, t) { - return new i(e, t); - }; - } - function X(e, t, n, r = 0, i = 1) { - let a = pe(e, n, r, i), o = { - keys: { - writable: !0, - enumerable: !0, - configurable: !0, - value: function() { - return _.brandCheck(this, t), a(this, `key`); - } - }, - values: { - writable: !0, - enumerable: !0, - configurable: !0, - value: function() { - return _.brandCheck(this, t), a(this, `value`); - } - }, - entries: { - writable: !0, - enumerable: !0, - configurable: !0, - value: function() { - return _.brandCheck(this, t), a(this, `key+value`); - } - }, - forEach: { - writable: !0, - enumerable: !0, - configurable: !0, - value: function(n, r = globalThis) { - if (_.brandCheck(this, t), _.argumentLengthCheck(arguments, 1, `${e}.forEach`), typeof n != `function`) throw TypeError(`Failed to execute 'forEach' on '${e}': parameter 1 is not of type 'Function'.`); - for (let { 0: e, 1: t } of a(this, `key+value`)) n.call(r, t, e, this); - } - } - }; - return Object.defineProperties(t.prototype, { - ...o, - [Symbol.iterator]: { - writable: !0, - enumerable: !1, - configurable: !0, - value: o.entries.value - } - }); - } - function me(e, t, n) { - let r = t, i = n; - try { - ge(e.stream.getReader(), r, i); - } catch (e) { - i(e); - } - } - function he(e) { - try { - e.close(), e.byobRequest?.respond(0); - } catch (e) { - if (!e.message.includes(`Controller is already closed`) && !e.message.includes(`ReadableStream is already closed`)) throw e; - } - } - async function ge(e, t, n) { - try { - let r = [], i = 0; - do { - let { done: a, value: o } = await e.read(); - if (a) { - t(Buffer.concat(r, i)); - return; - } - if (!g(o)) { - n(TypeError(`Received non-Uint8Array chunk`)); - return; - } - r.push(o), i += o.length; - } while (!0); - } catch (e) { - n(e); - } - } - function Z(e) { - h(`protocol` in e); - let t = e.protocol; - return t === `about:` || t === `blob:` || t === `data:`; - } - function _e(e) { - return typeof e == `string` && e[5] === `:` && e[0] === `h` && e[1] === `t` && e[2] === `t` && e[3] === `p` && e[4] === `s` || e.protocol === `https:`; - } - function ve(e) { - h(`protocol` in e); - let t = e.protocol; - return t === `http:` || t === `https:`; - } - function ye(e, t) { - let n = e; - if (!n.startsWith(`bytes`)) return `failure`; - let r = { position: 5 }; - if (t && y((e) => e === ` ` || e === ` `, n, r), n.charCodeAt(r.position) !== 61) return `failure`; - r.position++, t && y((e) => e === ` ` || e === ` `, n, r); - let i = y((e) => { - let t = e.charCodeAt(0); - return t >= 48 && t <= 57; - }, n, r), a = i.length ? Number(i) : null; - if (t && y((e) => e === ` ` || e === ` `, n, r), n.charCodeAt(r.position) !== 45) return `failure`; - r.position++, t && y((e) => e === ` ` || e === ` `, n, r); - let o = y((e) => { - let t = e.charCodeAt(0); - return t >= 48 && t <= 57; - }, n, r), s = o.length ? Number(o) : null; - return r.position < n.length || s === null && a === null || a > s ? `failure` : { - rangeStartValue: a, - rangeEndValue: s - }; - } - function be(e, t, n) { - let r = `bytes `; - return r += v(`${e}`), r += `-`, r += v(`${t}`), r += `/`, r += v(`${n}`), r; - } - var xe = class extends r { - #e; - constructor(e) { - super(), this.#e = e; - } - _transform(e, t, n) { - if (!this._inflateStream) { - if (e.length === 0) { - n(); - return; - } - this._inflateStream = (e[0] & 15) == 8 ? i.createInflate(this.#e) : i.createInflateRaw(this.#e), this._inflateStream.on(`data`, this.push.bind(this)), this._inflateStream.on(`end`, () => this.push(null)), this._inflateStream.on(`error`, (e) => this.destroy(e)); - } - this._inflateStream.write(e, t, n); - } - _final(e) { - this._inflateStream &&= (this._inflateStream.end(), null), e(); - } - }; - function Se(e) { - return new xe(e); - } - function Ce(e) { - let t = null, n = null, r = null, i = Te(`content-type`, e); - if (i === null) return `failure`; - for (let e of i) { - let i = u(e); - i === `failure` || i.essence === `*/*` || (r = i, r.essence === n ? !r.parameters.has(`charset`) && t !== null && r.parameters.set(`charset`, t) : (t = null, r.parameters.has(`charset`) && (t = r.parameters.get(`charset`)), n = r.essence)); - } - return r ?? `failure`; - } - function we(e) { - let t = e, n = { position: 0 }, r = [], i = ``; - for (; n.position < t.length;) { - if (i += y((e) => e !== `"` && e !== `,`, t, n), n.position < t.length) if (t.charCodeAt(n.position) === 34) { - if (i += l(t, n), n.position < t.length) continue; - } else h(t.charCodeAt(n.position) === 44), n.position++; - i = b(i, !0, !0, (e) => e === 9 || e === 32), r.push(i), i = ``; - } - return r; - } - function Te(e, t) { - let n = t.get(e, !0); - return n === null ? null : we(n); - } - function Ee(e) { - return !1; - } - function De(e) { - return !!(e.username || e.password); - } - function Oe(e) { - return e != null && e !== `client` && e !== `no-traversable`; - } - var ke = class { - get baseUrl() { - return c(); - } - get origin() { - return this.baseUrl?.origin; - } - policyContainer = H(); - }; - t.exports = { - isAborted: le, - isCancelled: ue, - isValidEncodedURL: C, - ReadableStreamFrom: f, - tryUpgradeRequestToAPotentiallyTrustworthyURL: ae, - clampAndCoarsenConnectionTimingInfo: ee, - coarsenedSharedCurrentTime: z, - determineRequestsReferrer: U, - makePolicyContainer: H, - clonePolicyContainer: te, - appendFetchMetadata: I, - appendRequestOriginHeader: L, - TAOCheck: F, - corsCheck: P, - crossOriginResourcePolicyCheck: N, - createOpaqueTimingInfo: V, - setRequestReferrerPolicyOnRedirect: M, - isValidHTTPToken: p, - requestBadPort: E, - requestCurrentURL: T, - responseURL: x, - responseLocationURL: S, - isURLPotentiallyTrustworthy: ie, - isValidReasonPhrase: O, - sameOrigin: oe, - normalizeMethod: Y, - iteratorMixin: X, - createIterator: pe, - isValidHeaderName: k, - isValidHeaderValue: A, - isErrorLike: D, - fullyReadBody: me, - readableStreamClose: he, - urlIsLocal: Z, - urlHasHttpsScheme: _e, - urlIsHttpHttpsScheme: ve, - readAllBytes: ge, - simpleRangeHeaderValue: ye, - buildContentRange: be, - createInflate: Se, - extractMimeType: Ce, - getDecodeSplit: Te, - environmentSettingsObject: new class { - settingsObject = new ke(); - }(), - isOriginIPPotentiallyTrustworthy: K, - hasAuthenticationEntry: Ee, - includesCredentials: De, - isTraversableNavigable: Oe - }; -})); -var fe = c$3(((e, t) => { - let { iteratorMixin: r } = Y$1(), { kEnumerableProperty: i } = B$1(), { webidl: a } = de(), o = p$4(`node:util`); - var s = class e { - #e = []; - constructor(e = void 0) { - if (a.util.markAsUncloneable(this), e !== void 0) throw a.errors.conversionFailed({ - prefix: `FormData constructor`, - argument: `Argument 1`, - types: [`undefined`] - }); - } - append(t, n, r = void 0) { - a.brandCheck(this, e); - let i = `FormData.append`; - a.argumentLengthCheck(arguments, 2, i), t = a.converters.USVString(t), arguments.length === 3 || a.is.Blob(n) ? (n = a.converters.Blob(n, i, `value`), r !== void 0 && (r = a.converters.USVString(r))) : n = a.converters.USVString(n); - let o = u(t, n, r); - this.#e.push(o); - } - delete(t) { - a.brandCheck(this, e), a.argumentLengthCheck(arguments, 1, `FormData.delete`), t = a.converters.USVString(t), this.#e = this.#e.filter((e) => e.name !== t); - } - get(t) { - a.brandCheck(this, e), a.argumentLengthCheck(arguments, 1, `FormData.get`), t = a.converters.USVString(t); - let n = this.#e.findIndex((e) => e.name === t); - return n === -1 ? null : this.#e[n].value; - } - getAll(t) { - return a.brandCheck(this, e), a.argumentLengthCheck(arguments, 1, `FormData.getAll`), t = a.converters.USVString(t), this.#e.filter((e) => e.name === t).map((e) => e.value); - } - has(t) { - return a.brandCheck(this, e), a.argumentLengthCheck(arguments, 1, `FormData.has`), t = a.converters.USVString(t), this.#e.findIndex((e) => e.name === t) !== -1; - } - set(t, n, r = void 0) { - a.brandCheck(this, e); - let i = `FormData.set`; - a.argumentLengthCheck(arguments, 2, i), t = a.converters.USVString(t), arguments.length === 3 || a.is.Blob(n) ? (n = a.converters.Blob(n, i, `value`), r !== void 0 && (r = a.converters.USVString(r))) : n = a.converters.USVString(n); - let o = u(t, n, r), s = this.#e.findIndex((e) => e.name === t); - s === -1 ? this.#e.push(o) : this.#e = [ - ...this.#e.slice(0, s), - o, - ...this.#e.slice(s + 1).filter((e) => e.name !== t) - ]; - } - [o.inspect.custom](e, t) { - let n = this.#e.reduce((e, t) => (e[t.name] ? Array.isArray(e[t.name]) ? e[t.name].push(t.value) : e[t.name] = [e[t.name], t.value] : e[t.name] = t.value, e), { __proto__: null }); - t.depth ??= e, t.colors ??= !0; - let r = o.formatWithOptions(t, n); - return `FormData ${r.slice(r.indexOf(`]`) + 2)}`; - } - static getFormDataState(e) { - return e.#e; - } - static setFormDataState(e, t) { - e.#e = t; - } - }; - let { getFormDataState: c, setFormDataState: l } = s; - Reflect.deleteProperty(s, `getFormDataState`), Reflect.deleteProperty(s, `setFormDataState`), r(`FormData`, s, c, `name`, `value`), Object.defineProperties(s.prototype, { - append: i, - delete: i, - get: i, - getAll: i, - has: i, - set: i, - [Symbol.toStringTag]: { - value: `FormData`, - configurable: !0 - } - }); - function u(e, t, n) { - if (typeof t != `string` && (a.is.File(t) || (t = new File([t], `blob`, { type: t.type })), n !== void 0)) { - let e = { - type: t.type, - lastModified: t.lastModified - }; - t = new File([t], n, e); - } - return { - name: e, - value: t - }; - } - a.is.FormData = a.util.MakeTypeAssertion(s), t.exports = { - FormData: s, - makeEntry: u, - setFormDataState: l - }; -})); -var pe = c$3(((e, t) => { - let { bufferToLowerCasedHeaderName: r } = B$1(), { HTTP_TOKEN_CODEPOINTS: i } = J$1(), { makeEntry: a } = fe(), { webidl: o } = de(), s = p$4(`node:assert`), { isomorphicDecode: c } = q$1(), l = Buffer.from(`--`), u = new TextDecoder(), d = new TextDecoder(`utf-8`, { ignoreBOM: !0 }); - function f(e) { - for (let t = 0; t < e.length; ++t) if (e.charCodeAt(t) & -128) return !1; - return !0; - } - function p(e) { - let t = e.length; - if (t < 27 || t > 70) return !1; - for (let n = 0; n < t; ++n) { - let t = e.charCodeAt(n); - if (!(t >= 48 && t <= 57 || t >= 65 && t <= 90 || t >= 97 && t <= 122 || t === 39 || t === 45 || t === 95)) return !1; - } - return !0; - } - function m(e, t) { - s(t !== `failure` && t.essence === `multipart/form-data`); - let n = t.parameters.get(`boundary`); - if (n === void 0) throw b(`missing boundary in content-type header`); - let r = Buffer.from(`--${n}`, `utf8`), i = [], c = { position: 0 }, u = e.indexOf(r); - if (u === -1) throw b(`no boundary found in multipart body`); - for (c.position = u;;) { - if (e.subarray(c.position, c.position + r.length).equals(r)) c.position += r.length; - else throw b(`expected a value starting with -- and the boundary`); - if (y(e, l, c)) return i; - if (e[c.position] !== 13 || e[c.position + 1] !== 10) throw b(`expected CRLF`); - c.position += 2; - let { name: t, filename: n, contentType: u, encoding: p } = g(e, c); - c.position += 2; - let m; - { - let t = e.indexOf(r.subarray(2), c.position); - if (t === -1) throw b(`expected boundary after body`); - m = e.subarray(c.position, t - 4), c.position += m.length, p === `base64` && (m = Buffer.from(m.toString(), `base64`)); - } - if (e[c.position] !== 13 || e[c.position + 1] !== 10) throw b(`expected CRLF`); - c.position += 2; - let h; - n === null ? h = d.decode(Buffer.from(m)) : (u ??= `text/plain`, f(u) || (u = ``), h = new File([m], n, { type: u })), s(o.is.USVString(t)), s(typeof h == `string` && o.is.USVString(h) || o.is.File(h)), i.push(a(t, h, n)); - } - } - function h(e, t) { - e[t.position] === 59 && t.position++, _((e) => e === 32 || e === 9, e, t); - let n = _((e) => C(e) && e !== 61 && e !== 42, e, t); - if (n.length === 0) return null; - let r = n.toString(`ascii`).toLowerCase(), i = e[t.position] === 42; - if (i && t.position++, e[t.position] !== 61) return null; - t.position++, _((e) => e === 32 || e === 9, e, t); - let a; - if (i) { - let n = _((e) => e !== 32 && e !== 13 && e !== 10 && e !== 59, e, t); - if (n[0] !== 117 && n[0] !== 85 || n[1] !== 116 && n[1] !== 84 || n[2] !== 102 && n[2] !== 70 || n[3] !== 45 || n[4] !== 56) throw b(`unknown encoding, expected utf-8''`); - a = decodeURIComponent(u.decode(n.subarray(7))); - } else if (e[t.position] === 34) { - t.position++; - let n = _((e) => e !== 10 && e !== 13 && e !== 34, e, t); - if (e[t.position] !== 34) throw b(`Closing quote not found`); - t.position++, a = u.decode(n).replace(/%0A/gi, ` -`).replace(/%0D/gi, `\r`).replace(/%22/g, `"`); - } else { - let n = _((e) => C(e) && e !== 59, e, t); - a = u.decode(n); - } - return { - name: r, - value: a, - extended: i - }; - } - function g(e, t) { - let n = null, a = null, o = null, s = null; - for (;;) { - if (e[t.position] === 13 && e[t.position + 1] === 10) { - if (n === null) throw b(`header name is null`); - return { - name: n, - filename: a, - contentType: o, - encoding: s - }; - } - let l = _((e) => e !== 10 && e !== 13 && e !== 58, e, t); - if (l = v(l, !0, !0, (e) => e === 9 || e === 32), !i.test(l.toString())) throw b(`header name does not match the field-name token production`); - if (e[t.position] !== 58) throw b(`expected :`); - switch (t.position++, _((e) => e === 32 || e === 9, e, t), r(l)) { - case `content-disposition`: { - n = a = null; - let r = !1; - if (_((e) => C(e), e, t).toString(`ascii`).toLowerCase() !== `form-data`) throw b(`expected form-data for content-disposition header`); - for (; t.position < e.length && (e[t.position] !== 13 || e[t.position + 1] !== 10);) { - let i = h(e, t); - if (!i) break; - i.name === `name` ? n = i.value : i.name === `filename` && (i.extended ? (a = i.value, r = !0) : r || (a = i.value)); - } - if (n === null) throw b(`name attribute is required in content-disposition header`); - break; - } - case `content-type`: { - let n = _((e) => e !== 10 && e !== 13, e, t); - n = v(n, !1, !0, (e) => e === 9 || e === 32), o = c(n); - break; - } - case `content-transfer-encoding`: { - let n = _((e) => e !== 10 && e !== 13, e, t); - n = v(n, !1, !0, (e) => e === 9 || e === 32), s = c(n); - break; - } - default: _((e) => e !== 10 && e !== 13, e, t); - } - if (e[t.position] !== 13 || e[t.position + 1] !== 10) throw b(`expected CRLF`); - t.position += 2; - } - } - function _(e, t, n) { - let r = n.position; - for (; r < t.length && e(t[r]);) ++r; - return t.subarray(n.position, n.position = r); - } - function v(e, t, n, r) { - let i = 0, a = e.length - 1; - if (t) for (; i < e.length && r(e[i]);) i++; - if (n) for (; a > 0 && r(e[a]);) a--; - return i === 0 && a === e.length - 1 ? e : e.subarray(i, a + 1); - } - function y(e, t, n) { - if (e.length < t.length) return !1; - for (let r = 0; r < t.length; r++) if (t[r] !== e[n.position + r]) return !1; - return !0; - } - function b(e) { - return TypeError(`Failed to parse body as FormData.`, { cause: TypeError(e) }); - } - function x(e) { - return e <= 31 || e === 127; - } - function S(e) { - return e === 40 || e === 41 || e === 60 || e === 62 || e === 64 || e === 44 || e === 59 || e === 58 || e === 92 || e === 34 || e === 47 || e === 91 || e === 93 || e === 63 || e === 61; - } - function C(e) { - return e <= 127 && e !== 32 && e !== 9 && !x(e) && !S(e); - } - t.exports = { - multipartFormDataParser: m, - validateBoundary: p - }; -})); -var X$1 = c$3(((e, t) => { - function n() { - let e, t; - return { - promise: new Promise((n, r) => { - e = n, t = r; - }), - resolve: e, - reject: t - }; - } - t.exports = { createDeferredPromise: n }; -})); -var me = c$3(((e, t) => { - let r = B$1(), { ReadableStreamFrom: i, readableStreamClose: a, fullyReadBody: o, extractMimeType: s } = Y$1(), { FormData: c, setFormDataState: l } = fe(), { webidl: u } = de(), d = p$4(`node:assert`), { isErrored: f, isDisturbed: p } = p$4(`node:stream`), { isUint8Array: m } = p$4(`node:util/types`), { serializeAMimeType: h } = J$1(), { multipartFormDataParser: g } = pe(), { createDeferredPromise: _ } = X$1(), { parseJSONFromBytes: v } = q$1(), { utf8DecodeBytes: y } = le(), { runtimeFeatures: b } = ue(), x = b.has(`crypto`) ? p$4(`node:crypto`).randomInt : (e) => Math.floor(Math.random() * e), S = new TextEncoder(); - function C() {} - let w = new FinalizationRegistry((e) => { - let t = e.deref(); - t && !t.locked && !p(t) && !f(t) && t.cancel(`Response object has been garbage collected`).catch(C); - }); - function T(e, t = !1) { - let n = null, o = null; - n = u.is.ReadableStream(e) ? e : u.is.Blob(e) ? e.stream() : new ReadableStream({ - pull() {}, - start(e) { - o = e; - }, - cancel() {}, - type: `bytes` - }), d(u.is.ReadableStream(n)); - let s = null, c = null, l = null, p = null; - if (typeof e == `string`) c = e, p = `text/plain;charset=UTF-8`; - else if (u.is.URLSearchParams(e)) c = e.toString(), p = `application/x-www-form-urlencoded;charset=UTF-8`; - else if (u.is.BufferSource(e)) c = u.util.getCopyOfBytesHeldByBufferSource(e); - else if (u.is.FormData(e)) { - let t = `----formdata-undici-0${`${x(1e11)}`.padStart(11, `0`)}`, n = `--${t}\r\nContent-Disposition: form-data`, r = (e) => e.replace(/\n/g, `%0A`).replace(/\r/g, `%0D`).replace(/"/g, `%22`), i = (e) => e.replace(/\r?\n|\r/g, `\r -`), a = [], o = new Uint8Array([13, 10]); - l = 0; - let u = !1; - for (let [t, s] of e) if (typeof s == `string`) { - let e = S.encode(n + `; name="${r(i(t))}"\r\n\r\n${i(s)}\r\n`); - a.push(e), l += e.byteLength; - } else { - let e = S.encode(`${n}; name="${r(i(t))}"` + (s.name ? `; filename="${r(s.name)}"` : ``) + `\r -Content-Type: ${s.type || `application/octet-stream`}\r\n\r\n`); - a.push(e, s, o), typeof s.size == `number` ? l += e.byteLength + s.size + o.byteLength : u = !0; - } - let d = S.encode(`--${t}--\r\n`); - a.push(d), l += d.byteLength, u && (l = null), c = e, s = async function* () { - for (let e of a) e.stream ? yield* e.stream() : yield e; - }, p = `multipart/form-data; boundary=${t}`; - } else if (u.is.Blob(e)) c = e, l = e.size, e.type && (p = e.type); - else if (typeof e[Symbol.asyncIterator] == `function`) { - if (t) throw TypeError(`keepalive`); - if (r.isDisturbed(e) || e.locked) throw TypeError(`Response body object should not be disturbed or locked`); - n = u.is.ReadableStream(e) ? e : i(e); - } - return (typeof c == `string` || m(c)) && (s = () => (l = typeof c == `string` ? Buffer.byteLength(c) : c.length, c)), s != null && (async () => { - let e = s(), t = e?.[Symbol.asyncIterator]?.(); - if (t) for await (let e of t) { - if (f(n)) break; - e.length && o.enqueue(new Uint8Array(e)); - } - else e?.length && !f(n) && o.enqueue(typeof e == `string` ? S.encode(e) : new Uint8Array(e)); - queueMicrotask(() => a(o)); - })(), [{ - stream: n, - source: c, - length: l - }, p]; - } - function E(e, t = !1) { - return u.is.ReadableStream(e) && (d(!r.isDisturbed(e), `The body has already been consumed.`), d(!e.locked, `The stream is locked.`)), T(e, t); - } - function D(e) { - let { 0: t, 1: n } = e.stream.tee(); - return e.stream = t, { - stream: n, - length: e.length, - source: e.source - }; - } - function O(e, t) { - return { - blob() { - return A(this, (e) => { - let n = M(t(this)); - return n === null ? n = `` : n &&= h(n), new Blob([e], { type: n }); - }, e, t); - }, - arrayBuffer() { - return A(this, (e) => new Uint8Array(e).buffer, e, t); - }, - text() { - return A(this, y, e, t); - }, - json() { - return A(this, v, e, t); - }, - formData() { - return A(this, (e) => { - let n = M(t(this)); - if (n !== null) switch (n.essence) { - case `multipart/form-data`: { - let t = g(e, n), r = new c(); - return l(r, t), r; - } - case `application/x-www-form-urlencoded`: { - let t = new URLSearchParams(e.toString()), n = new c(); - for (let [e, r] of t) n.append(e, r); - return n; - } - } - throw TypeError(`Content-Type was not one of "multipart/form-data" or "application/x-www-form-urlencoded".`); - }, e, t); - }, - bytes() { - return A(this, (e) => new Uint8Array(e), e, t); - } - }; - } - function k(e, t) { - Object.assign(e.prototype, O(e, t)); - } - function A(e, t, n, r) { - try { - u.brandCheck(e, n); - } catch (e) { - return Promise.reject(e); - } - if (e = r(e), j(e)) return Promise.reject(TypeError(`Body is unusable: Body has already been read`)); - let i = _(), a = i.reject, s = (e) => { - try { - i.resolve(t(e)); - } catch (e) { - a(e); - } - }; - return e.body == null ? (s(Buffer.allocUnsafe(0)), i.promise) : (o(e.body, s, a), i.promise); - } - function j(e) { - let t = e.body; - return t != null && (t.stream.locked || r.isDisturbed(t.stream)); - } - function M(e) { - let t = e.headersList, n = s(t); - return n === `failure` ? null : n; - } - t.exports = { - extractBody: T, - safelyExtractBody: E, - cloneBody: D, - mixinBody: k, - streamRegistry: w, - bodyUnusable: j - }; -})); -var he = c$3(((e, t) => { - let r = p$4(`node:assert`), i = B$1(), { channels: a } = H$1(), o = L$1(), { RequestContentLengthMismatchError: s, ResponseContentLengthMismatchError: c, RequestAbortedError: l, HeadersTimeoutError: u, HeadersOverflowError: d, SocketError: f, InformationalError: p, BodyTimeoutError: m, HTTPParserError: h, ResponseExceededMaxSizeError: g } = R$1(), { kUrl: _, kReset: v, kClient: y, kParser: b, kBlocking: x, kRunning: S, kPending: C, kSize: w, kWriting: T, kQueue: E, kNoRef: D, kKeepAliveDefaultTimeout: O, kHostHeader: k, kPendingIdx: A, kRunningIdx: j, kError: M, kPipelining: N, kSocket: P, kKeepAliveTimeoutValue: F, kMaxHeadersSize: ee, kKeepAliveMaxTimeout: z, kKeepAliveTimeoutThreshold: V, kHeadersTimeout: te, kBodyTimeout: U, kStrictContentLength: W, kMaxRequests: ne, kCounter: G, kMaxResponseSize: K, kOnError: re, kResume: se, kHTTPContext: ce, kClosed: le } = I$1(), q = ie$1(), J = Buffer.alloc(0), ue = Buffer[Symbol.species], de = i.removeAllListeners, Y; - function fe() { - let e = process.env.JEST_WORKER_ID ? ae$1() : void 0, t, n = process.arch !== `ppc64`; - if (process.env.UNDICI_NO_WASM_SIMD === `1` ? n = !1 : process.env.UNDICI_NO_WASM_SIMD === `0` && (n = !0), n) try { - t = new WebAssembly.Module(oe()); - } catch {} - return t ||= new WebAssembly.Module(e || ae$1()), new WebAssembly.Instance(t, { env: { - wasm_on_url: (e, t, n) => 0, - wasm_on_status: (e, t, n) => { - r(X.ptr === e); - let i = t - Z + he.byteOffset; - return X.onStatus(new ue(he.buffer, i, n)); - }, - wasm_on_message_begin: (e) => (r(X.ptr === e), X.onMessageBegin()), - wasm_on_header_field: (e, t, n) => { - r(X.ptr === e); - let i = t - Z + he.byteOffset; - return X.onHeaderField(new ue(he.buffer, i, n)); - }, - wasm_on_header_value: (e, t, n) => { - r(X.ptr === e); - let i = t - Z + he.byteOffset; - return X.onHeaderValue(new ue(he.buffer, i, n)); - }, - wasm_on_headers_complete: (e, t, n, i) => (r(X.ptr === e), X.onHeadersComplete(t, n === 1, i === 1)), - wasm_on_body: (e, t, n) => { - r(X.ptr === e); - let i = t - Z + he.byteOffset; - return X.onBody(new ue(he.buffer, i, n)); - }, - wasm_on_message_complete: (e) => (r(X.ptr === e), X.onMessageComplete()) - } }); - } - let pe = null, X = null, he = null, ge = 0, Z = null; - var _e = class { - constructor(e, t, { exports: n }) { - this.llhttp = n, this.ptr = this.llhttp.llhttp_alloc(q.TYPE.RESPONSE), this.client = e, this.socket = t, this.timeout = null, this.timeoutWeakRef = new WeakRef(this), this.timeoutValue = null, this.timeoutType = null, this.statusCode = 0, this.statusText = ``, this.upgrade = !1, this.headers = [], this.headersSize = 0, this.headersMaxSize = e[ee], this.shouldKeepAlive = !1, this.paused = !1, this.resume = this.resume.bind(this), this.bytesRead = 0, this.keepAlive = ``, this.contentLength = ``, this.connection = ``, this.maxResponseSize = e[K]; - } - setTimeout(e, t) { - e !== this.timeoutValue || t & 1 ^ this.timeoutType & 1 ? (this.timeout &&= (o.clearTimeout(this.timeout), null), e && (t & 1 ? this.timeout = o.setFastTimeout(ve, e, this.timeoutWeakRef) : (this.timeout = setTimeout(ve, e, this.timeoutWeakRef), this.timeout?.unref())), this.timeoutValue = e) : this.timeout && this.timeout.refresh && this.timeout.refresh(), this.timeoutType = t; - } - resume() { - this.socket.destroyed || !this.paused || (r(this.ptr != null), r(X === null), this.llhttp.llhttp_resume(this.ptr), r(this.timeoutType === 5), this.timeout && this.timeout.refresh && this.timeout.refresh(), this.paused = !1, this.execute(this.socket.read() || J), this.readMore()); - } - readMore() { - for (; !this.paused && this.ptr;) { - let e = this.socket.read(); - if (e === null) break; - this.execute(e); - } - } - execute(e) { - r(X === null), r(this.ptr != null), r(!this.paused); - let { socket: t, llhttp: n } = this; - e.length > ge && (Z && n.free(Z), ge = Math.ceil(e.length / 4096) * 4096, Z = n.malloc(ge)), new Uint8Array(n.memory.buffer, Z, ge).set(e); - try { - let r; - try { - he = e, X = this, r = n.llhttp_execute(this.ptr, Z, e.length); - } finally { - X = null, he = null; - } - if (r !== q.ERROR.OK) { - let i = e.subarray(n.llhttp_get_error_pos(this.ptr) - Z); - if (r === q.ERROR.PAUSED_UPGRADE) this.onUpgrade(i); - else if (r === q.ERROR.PAUSED) this.paused = !0, t.unshift(i); - else throw this.createError(r, i); - } - } catch (e) { - i.destroy(t, e); - } - } - finish() { - r(X === null), r(this.ptr != null), r(!this.paused); - let { llhttp: e } = this, t; - try { - X = this, t = e.llhttp_finish(this.ptr); - } finally { - X = null; - } - return t === q.ERROR.OK ? null : t === q.ERROR.PAUSED || t === q.ERROR.PAUSED_UPGRADE ? (this.paused = !0, null) : this.createError(t, J); - } - createError(e, t) { - let { llhttp: n, contentLength: r, bytesRead: i } = this; - if (r && i !== parseInt(r, 10)) return new c(); - let a = n.llhttp_get_error_reason(this.ptr), o = ``; - if (a) { - let e = new Uint8Array(n.memory.buffer, a).indexOf(0); - o = `Response does not match the HTTP/1.1 protocol (` + Buffer.from(n.memory.buffer, a, e).toString() + `)`; - } - return new h(o, q.ERROR[e], t); - } - destroy() { - r(X === null), r(this.ptr != null), this.llhttp.llhttp_free(this.ptr), this.ptr = null, this.timeout && o.clearTimeout(this.timeout), this.timeout = null, this.timeoutValue = null, this.timeoutType = null, this.paused = !1; - } - onStatus(e) { - return this.statusText = e.toString(), 0; - } - onMessageBegin() { - let { socket: e, client: t } = this; - if (e.destroyed) return -1; - let n = t[E][t[j]]; - return n ? (n.onResponseStarted(), 0) : -1; - } - onHeaderField(e) { - let t = this.headers.length; - return t & 1 ? this.headers[t - 1] = Buffer.concat([this.headers[t - 1], e]) : this.headers.push(e), this.trackHeader(e.length), 0; - } - onHeaderValue(e) { - let t = this.headers.length; - (t & 1) == 1 ? (this.headers.push(e), t += 1) : this.headers[t - 1] = Buffer.concat([this.headers[t - 1], e]); - let n = this.headers[t - 2]; - if (n.length === 10) { - let t = i.bufferToLowerCasedHeaderName(n); - t === `keep-alive` ? this.keepAlive += e.toString() : t === `connection` && (this.connection += e.toString()); - } else n.length === 14 && i.bufferToLowerCasedHeaderName(n) === `content-length` && (this.contentLength += e.toString()); - return this.trackHeader(e.length), 0; - } - trackHeader(e) { - this.headersSize += e, this.headersSize >= this.headersMaxSize && i.destroy(this.socket, new d()); - } - onUpgrade(e) { - let { upgrade: t, client: n, socket: a, headers: o, statusCode: s } = this; - r(t), r(n[P] === a), r(!a.destroyed), r(!this.paused), r((o.length & 1) == 0); - let c = n[E][n[j]]; - r(c), r(c.upgrade || c.method === `CONNECT`), this.statusCode = 0, this.statusText = ``, this.shouldKeepAlive = !1, this.headers = [], this.headersSize = 0, a.unshift(e), a[b].destroy(), a[b] = null, a[y] = null, a[M] = null, de(a), n[P] = null, n[ce] = null, n[E][n[j]++] = null, n.emit(`disconnect`, n[_], [n], new p(`upgrade`)); - try { - c.onUpgrade(s, o, a); - } catch (e) { - i.destroy(a, e); - } - n[se](); - } - onHeadersComplete(e, t, n) { - let { client: a, socket: o, headers: s, statusText: c } = this; - if (o.destroyed) return -1; - let l = a[E][a[j]]; - if (!l) return -1; - if (r(!this.upgrade), r(this.statusCode < 200), e === 100) return i.destroy(o, new f(`bad response`, i.getSocketInfo(o))), -1; - if (t && !l.upgrade) return i.destroy(o, new f(`bad upgrade`, i.getSocketInfo(o))), -1; - if (r(this.timeoutType === 3), this.statusCode = e, this.shouldKeepAlive = n || l.method === `HEAD` && !o[v] && this.connection.toLowerCase() === `keep-alive`, this.statusCode >= 200) { - let e = l.bodyTimeout == null ? a[U] : l.bodyTimeout; - this.setTimeout(e, 5); - } else this.timeout && this.timeout.refresh && this.timeout.refresh(); - if (l.method === `CONNECT` || t) return r(a[S] === 1), this.upgrade = !0, 2; - if (r((this.headers.length & 1) == 0), this.headers = [], this.headersSize = 0, this.shouldKeepAlive && a[N]) { - let e = this.keepAlive ? i.parseKeepAliveTimeout(this.keepAlive) : null; - if (e != null) { - let t = Math.min(e - a[V], a[z]); - t <= 0 ? o[v] = !0 : a[F] = t; - } else a[F] = a[O]; - } else o[v] = !0; - let u = l.onHeaders(e, s, this.resume, c) === !1; - return l.aborted ? -1 : l.method === `HEAD` || e < 200 ? 1 : (o[x] && (o[x] = !1, a[se]()), u ? q.ERROR.PAUSED : 0); - } - onBody(e) { - let { client: t, socket: n, statusCode: a, maxResponseSize: o } = this; - if (n.destroyed) return -1; - let s = t[E][t[j]]; - return r(s), r(this.timeoutType === 5), this.timeout && this.timeout.refresh && this.timeout.refresh(), r(a >= 200), o > -1 && this.bytesRead + e.length > o ? (i.destroy(n, new g()), -1) : (this.bytesRead += e.length, s.onData(e) === !1 ? q.ERROR.PAUSED : 0); - } - onMessageComplete() { - let { client: e, socket: t, statusCode: n, upgrade: a, headers: o, contentLength: s, bytesRead: l, shouldKeepAlive: u } = this; - if (t.destroyed && (!n || u)) return -1; - if (a) return 0; - r(n >= 100), r((this.headers.length & 1) == 0); - let d = e[E][e[j]]; - return r(d), this.statusCode = 0, this.statusText = ``, this.bytesRead = 0, this.contentLength = ``, this.keepAlive = ``, this.connection = ``, this.headers = [], this.headersSize = 0, n < 200 ? 0 : d.method !== `HEAD` && s && l !== parseInt(s, 10) ? (i.destroy(t, new c()), -1) : (d.onComplete(o), e[E][e[j]++] = null, t[T] ? (r(e[S] === 0), i.destroy(t, new p(`reset`)), q.ERROR.PAUSED) : u ? t[v] && e[S] === 0 ? (i.destroy(t, new p(`reset`)), q.ERROR.PAUSED) : (e[N] == null || e[N] === 1 ? setImmediate(e[se]) : e[se](), 0) : (i.destroy(t, new p(`reset`)), q.ERROR.PAUSED)); - } - }; - function ve(e) { - let t = e.deref(); - if (!t) return; - let { socket: n, timeoutType: a, client: o, paused: s } = t; - a === 3 ? (!n[T] || n.writableNeedDrain || o[S] > 1) && (r(!s, `cannot be paused while waiting for headers`), i.destroy(n, new u())) : a === 5 ? s || i.destroy(n, new m()) : a === 8 && (r(o[S] === 0 && o[F]), i.destroy(n, new p(`socket idle timeout`))); - } - function ye(e, t) { - if (e[P] = t, pe ||= fe(), t.errored) throw t.errored; - if (t.destroyed) throw new f(`destroyed`); - return t[D] = !1, t[T] = !1, t[v] = !1, t[x] = !1, t[b] = new _e(e, t, pe), i.addListener(t, `error`, be), i.addListener(t, `readable`, xe), i.addListener(t, `end`, Se), i.addListener(t, `close`, Ce), t[le] = !1, t.on(`close`, we), { - version: `h1`, - defaultPipelining: 1, - write(t) { - return De(e, t); - }, - resume() { - Te(e); - }, - destroy(e, n) { - t[le] ? queueMicrotask(n) : (t.on(`close`, n), t.destroy(e)); - }, - get destroyed() { - return t.destroyed; - }, - busy(n) { - return !!(t[T] || t[v] || t[x] || n && (e[S] > 0 && !n.idempotent || e[S] > 0 && (n.upgrade || n.method === `CONNECT`) || e[S] > 0 && i.bodyLength(n.body) !== 0 && (i.isStream(n.body) || i.isAsyncIterable(n.body) || i.isFormDataLike(n.body)))); - } - }; - } - function be(e) { - r(e.code !== `ERR_TLS_CERT_ALTNAME_INVALID`); - let t = this[b]; - if (e.code === `ECONNRESET` && t.statusCode && !t.shouldKeepAlive) { - let e = t.finish(); - e && (this[M] = e, this[y][re](e)); - return; - } - this[M] = e, this[y][re](e); - } - function xe() { - this[b]?.readMore(); - } - function Se() { - let e = this[b]; - if (e.statusCode && !e.shouldKeepAlive) { - let t = e.finish(); - t && i.destroy(this, t); - return; - } - i.destroy(this, new f(`other side closed`, i.getSocketInfo(this))); - } - function Ce() { - let e = this[b]; - e && (!this[M] && e.statusCode && !e.shouldKeepAlive && (this[M] = e.finish() || this[M]), this[b].destroy(), this[b] = null); - let t = this[M] || new f(`closed`, i.getSocketInfo(this)), n = this[y]; - if (n[P] = null, n[ce] = null, n.destroyed) { - r(n[C] === 0); - let e = n[E].splice(n[j]); - for (let r = 0; r < e.length; r++) { - let a = e[r]; - i.errorRequest(n, a, t); - } - } else if (n[S] > 0 && t.code !== `UND_ERR_INFO`) { - let e = n[E][n[j]]; - n[E][n[j]++] = null, i.errorRequest(n, e, t); - } - n[A] = n[j], r(n[S] === 0), n.emit(`disconnect`, n[_], [n], t), n[se](); - } - function we() { - this[le] = !0; - } - function Te(e) { - let t = e[P]; - if (t && !t.destroyed) { - if (e[w] === 0 ? !t[D] && t.unref && (t.unref(), t[D] = !0) : t[D] && t.ref && (t.ref(), t[D] = !1), e[w] === 0) t[b].timeoutType !== 8 && t[b].setTimeout(e[F], 8); - else if (e[S] > 0 && t[b].statusCode < 200 && t[b].timeoutType !== 3) { - let n = e[E][e[j]], r = n.headersTimeout == null ? e[te] : n.headersTimeout; - t[b].setTimeout(r, 3); - } - } - } - function Ee(e) { - return e !== `GET` && e !== `HEAD` && e !== `OPTIONS` && e !== `TRACE` && e !== `CONNECT`; - } - function De(e, t) { - let { method: n, path: o, host: c, upgrade: u, blocking: d, reset: f } = t, { body: m, headers: h, contentLength: g } = t, _ = n === `PUT` || n === `POST` || n === `PATCH` || n === `QUERY` || n === `PROPFIND` || n === `PROPPATCH`; - if (i.isFormDataLike(m)) { - Y ||= me().extractBody; - let [e, n] = Y(m); - t.contentType ?? h.push(`content-type`, n), m = e.stream, g = e.length; - } else i.isBlobLike(m) && t.contentType == null && m.type && h.push(`content-type`, m.type); - m && typeof m.read == `function` && m.read(0); - let y = i.bodyLength(m); - if (g = y ?? g, g === null && (g = t.contentLength), g === 0 && !_ && (g = null), Ee(n) && g > 0 && t.contentLength !== null && t.contentLength !== g) { - if (e[W]) return i.errorRequest(e, t, new s()), !1; - process.emitWarning(new s()); - } - let b = e[P], S = (n) => { - t.aborted || t.completed || (i.errorRequest(e, t, n || new l()), i.destroy(m), i.destroy(b, new p(`aborted`))); - }; - try { - t.onConnect(S); - } catch (n) { - i.errorRequest(e, t, n); - } - if (t.aborted) return !1; - n === `HEAD` && (b[v] = !0), (u || n === `CONNECT`) && (b[v] = !0), f != null && (b[v] = f), e[ne] && b[G]++ >= e[ne] && (b[v] = !0), d && (b[x] = !0), b.setTypeOfService && b.setTypeOfService(t.typeOfService); - let C = `${n} ${o} HTTP/1.1\r\n`; - if (typeof c == `string` ? C += `host: ${c}\r\n` : C += e[k], u ? C += `connection: upgrade\r\nupgrade: ${u}\r\n` : e[N] && !b[v] ? C += `connection: keep-alive\r -` : C += `connection: close\r -`, Array.isArray(h)) for (let e = 0; e < h.length; e += 2) { - let t = h[e + 0], n = h[e + 1]; - if (Array.isArray(n)) for (let e = 0; e < n.length; e++) C += `${t}: ${n[e]}\r\n`; - else C += `${t}: ${n}\r\n`; - } - return a.sendHeaders.hasSubscribers && a.sendHeaders.publish({ - request: t, - headers: C, - socket: b - }), !m || y === 0 ? ke(S, null, e, t, b, g, C, _) : i.isBuffer(m) ? ke(S, m, e, t, b, g, C, _) : i.isBlobLike(m) ? typeof m.stream == `function` ? je(S, m.stream(), e, t, b, g, C, _) : Ae(S, m, e, t, b, g, C, _) : i.isStream(m) ? Oe(S, m, e, t, b, g, C, _) : i.isIterable(m) ? je(S, m, e, t, b, g, C, _) : r(!1), !0; - } - function Oe(e, t, n, a, o, s, c, u) { - r(s !== 0 || n[S] === 0, `stream body cannot be pipelined`); - let d = !1, f = new Me({ - abort: e, - socket: o, - request: a, - contentLength: s, - client: n, - expectsPayload: u, - header: c - }), p = function(e) { - if (!d) try { - !f.write(e) && this.pause && this.pause(); - } catch (e) { - i.destroy(this, e); - } - }, m = function() { - d || t.resume && t.resume(); - }, h = function() { - if (queueMicrotask(() => { - t.removeListener(`error`, g); - }), !d) { - let e = new l(); - queueMicrotask(() => g(e)); - } - }, g = function(e) { - if (!d) { - if (d = !0, r(o.destroyed || o[T] && n[S] <= 1), o.off(`drain`, m).off(`error`, g), t.removeListener(`data`, p).removeListener(`end`, g).removeListener(`close`, h), !e) try { - f.end(); - } catch (t) { - e = t; - } - f.destroy(e), e && (e.code !== `UND_ERR_INFO` || e.message !== `reset`) ? i.destroy(t, e) : i.destroy(t); - } - }; - t.on(`data`, p).on(`end`, g).on(`error`, g).on(`close`, h), t.resume && t.resume(), o.on(`drain`, m).on(`error`, g), t.errorEmitted ?? t.errored ? setImmediate(g, t.errored) : (t.endEmitted ?? t.readableEnded) && setImmediate(g, null), (t.closeEmitted ?? t.closed) && setImmediate(h); - } - function ke(e, t, n, a, o, s, c, l) { - try { - t ? i.isBuffer(t) && (r(s === t.byteLength, `buffer body must have content length`), o.cork(), o.write(`${c}content-length: ${s}\r\n\r\n`, `latin1`), o.write(t), o.uncork(), a.onBodySent(t), !l && a.reset !== !1 && (o[v] = !0)) : s === 0 ? o.write(`${c}content-length: 0\r\n\r\n`, `latin1`) : (r(s === null, `no body must not have content length`), o.write(`${c}\r\n`, `latin1`)), a.onRequestSent(), n[se](); - } catch (t) { - e(t); - } - } - async function Ae(e, t, n, i, a, o, c, l) { - r(o === t.size, `blob body must have content length`); - try { - if (o != null && o !== t.size) throw new s(); - let e = Buffer.from(await t.arrayBuffer()); - a.cork(), a.write(`${c}content-length: ${o}\r\n\r\n`, `latin1`), a.write(e), a.uncork(), i.onBodySent(e), i.onRequestSent(), !l && i.reset !== !1 && (a[v] = !0), n[se](); - } catch (t) { - e(t); - } - } - async function je(e, t, n, i, a, o, s, c) { - r(o !== 0 || n[S] === 0, `iterator body cannot be pipelined`); - let l = null; - function u() { - if (l) { - let e = l; - l = null, e(); - } - } - let d = () => new Promise((e, t) => { - r(l === null), a[M] ? t(a[M]) : l = e; - }); - a.on(`close`, u).on(`drain`, u); - let f = new Me({ - abort: e, - socket: a, - request: i, - contentLength: o, - client: n, - expectsPayload: c, - header: s - }); - try { - for await (let e of t) { - if (a[M]) throw a[M]; - f.write(e) || await d(); - } - f.end(); - } catch (e) { - f.destroy(e); - } finally { - a.off(`close`, u).off(`drain`, u); - } - } - var Me = class { - constructor({ abort: e, socket: t, request: n, contentLength: r, client: i, expectsPayload: a, header: o }) { - this.socket = t, this.request = n, this.contentLength = r, this.client = i, this.bytesWritten = 0, this.expectsPayload = a, this.header = o, this.abort = e, t[T] = !0; - } - write(e) { - let { socket: t, request: n, contentLength: r, client: i, bytesWritten: a, expectsPayload: o, header: c } = this; - if (t[M]) throw t[M]; - if (t.destroyed) return !1; - let l = Buffer.byteLength(e); - if (!l) return !0; - if (r !== null && a + l > r) { - if (i[W]) throw new s(); - process.emitWarning(new s()); - } - t.cork(), a === 0 && (!o && n.reset !== !1 && (t[v] = !0), r === null ? t.write(`${c}transfer-encoding: chunked\r\n`, `latin1`) : t.write(`${c}content-length: ${r}\r\n\r\n`, `latin1`)), r === null && t.write(`\r\n${l.toString(16)}\r\n`, `latin1`), this.bytesWritten += l; - let u = t.write(e); - return t.uncork(), n.onBodySent(e), u || t[b].timeout && t[b].timeoutType === 3 && t[b].timeout.refresh && t[b].timeout.refresh(), u; - } - end() { - let { socket: e, contentLength: t, client: n, bytesWritten: r, expectsPayload: i, header: a, request: o } = this; - if (o.onRequestSent(), e[T] = !1, e[M]) throw e[M]; - if (!e.destroyed) { - if (r === 0 ? i ? e.write(`${a}content-length: 0\r\n\r\n`, `latin1`) : e.write(`${a}\r\n`, `latin1`) : t === null && e.write(`\r -0\r -\r -`, `latin1`), t !== null && r !== t) { - if (n[W]) throw new s(); - process.emitWarning(new s()); - } - e[b].timeout && e[b].timeoutType === 3 && e[b].timeout.refresh && e[b].timeout.refresh(), n[se](); - } - } - destroy(e) { - let { socket: t, client: n, abort: i } = this; - t[T] = !1, e && (r(n[S] <= 1, `pipeline should only contain this request`), i(e)); - } - }; - t.exports = ye; -})); -var ge = c$3(((e, t) => { - let r = p$4(`node:assert`), { pipeline: i } = p$4(`node:stream`), a = B$1(), { RequestContentLengthMismatchError: o, RequestAbortedError: s, SocketError: c, InformationalError: l, InvalidArgumentError: u } = R$1(), { kUrl: d, kReset: f, kClient: p, kRunning: m, kPending: h, kQueue: g, kPendingIdx: _, kRunningIdx: v, kError: y, kSocket: b, kStrictContentLength: x, kOnError: S, kMaxConcurrentStreams: C, kPingInterval: w, kHTTP2Session: T, kHTTP2InitialWindowSize: E, kHTTP2ConnectionWindowSize: D, kResume: O, kSize: k, kHTTPContext: A, kClosed: j, kBodyTimeout: M, kEnableConnectProtocol: N, kRemoteSettings: P, kHTTP2Stream: F, kHTTP2SessionState: L } = I$1(), { channels: ee } = H$1(), z = Symbol(`open streams`), V, te; - try { - te = p$4(`node:http2`); - } catch { - te = { constants: {} }; - } - let { constants: { HTTP2_HEADER_AUTHORITY: U, HTTP2_HEADER_METHOD: W, HTTP2_HEADER_PATH: ne, HTTP2_HEADER_SCHEME: G, HTTP2_HEADER_CONTENT_LENGTH: K, HTTP2_HEADER_EXPECT: re, HTTP2_HEADER_STATUS: ie, HTTP2_HEADER_PROTOCOL: ae, NGHTTP2_REFUSED_STREAM: oe, NGHTTP2_CANCEL: se } } = te; - function ce(e) { - let t = []; - for (let [n, r] of Object.entries(e)) if (Array.isArray(r)) for (let e of r) t.push(Buffer.from(n), Buffer.from(e)); - else t.push(Buffer.from(n), Buffer.from(r)); - return t; - } - function le(e, t) { - e[b] = t; - let n = e[E], r = e[D], i = te.connect(e[d], { - createConnection: () => t, - peerMaxConcurrentStreams: e[C], - settings: { - enablePush: !1, - ...n == null ? null : { initialWindowSize: n } - } - }); - return e[b] = t, i[z] = 0, i[p] = e, i[b] = t, i[L] = { ping: { interval: e[w] === 0 ? null : setInterval(de, e[w], i).unref() } }, i[N] = !1, i[P] = !1, r && a.addListener(i, `connect`, J.bind(i, r)), a.addListener(i, `error`, Y), a.addListener(i, `frameError`, fe), a.addListener(i, `end`, pe), a.addListener(i, `goaway`, X), a.addListener(i, `close`, he), a.addListener(i, `remoteSettings`, ue), i.unref(), e[T] = i, t[T] = i, a.addListener(t, `error`, Z), a.addListener(t, `end`, _e), a.addListener(t, `close`, ge), t[j] = !1, t.on(`close`, ve), { - version: `h2`, - defaultPipelining: Infinity, - write(t) { - return be(e, t); - }, - resume() { - q(e); - }, - destroy(e, n) { - t[j] ? queueMicrotask(n) : t.destroy(e).on(`close`, n); - }, - get destroyed() { - return t.destroyed; - }, - busy(t) { - if (t != null) if (e[m] > 0) { - if (t.idempotent === !1 || (t.upgrade === `websocket` || t.method === `CONNECT`) && i[P] === !1 || a.bodyLength(t.body) !== 0 && (a.isStream(t.body) || a.isAsyncIterable(t.body) || a.isFormDataLike(t.body))) return !0; - } else return (t.upgrade === `websocket` || t.method === `CONNECT`) && i[P] === !1; - return !1; - } - }; - } - function q(e) { - let t = e[b]; - t?.destroyed === !1 && (e[k] === 0 || e[C] === 0 ? (t.unref(), e[T].unref()) : (t.ref(), e[T].ref())); - } - function J(e) { - try { - typeof this.setLocalWindowSize == `function` && this.setLocalWindowSize(e); - } catch {} - } - function ue(e) { - if (this[p][C] = e.maxConcurrentStreams ?? this[p][C], this[P] === !0 && this[N] === !0 && e.enableConnectProtocol === !1) { - let e = new l(`HTTP/2: Server disabled extended CONNECT protocol against RFC-8441`); - this[b][y] = e, this[p][S](e); - return; - } - this[N] = e.enableConnectProtocol ?? this[N], this[P] = !0, this[p][O](); - } - function de(e) { - let t = e[L]; - if ((e.closed || e.destroyed) && t.ping.interval != null) { - clearInterval(t.ping.interval), t.ping.interval = null; - return; - } - e.ping(n.bind(e)); - function n(e, t) { - let n = this[p], r = this[p]; - if (e != null) { - let t = new l(`HTTP/2: "PING" errored - type ${e.message}`); - r[y] = t, n[S](t); - } else n.emit(`ping`, t); - } - } - function Y(e) { - r(e.code !== `ERR_TLS_CERT_ALTNAME_INVALID`), this[b][y] = e, this[p][S](e); - } - function fe(e, t, n) { - if (n === 0) { - let n = new l(`HTTP/2: "frameError" received - type ${e}, code ${t}`); - this[b][y] = n, this[p][S](n); - } - } - function pe() { - let e = new c(`other side closed`, a.getSocketInfo(this[b])); - this.destroy(e), a.destroy(this[b], e); - } - function X(e) { - let t = this[y] || new c(`HTTP/2: "GOAWAY" frame received with code ${e}`, a.getSocketInfo(this[b])), n = this[p]; - if (n[b] = null, n[A] = null, this.close(), this[T] = null, a.destroy(this[b], t), n[v] < n[g].length) { - let e = n[g][n[v]]; - n[g][n[v]++] = null, a.errorRequest(n, e, t), n[_] = n[v]; - } - r(n[m] === 0), n.emit(`disconnect`, n[d], [n], t), n.emit(`connectionError`, n[d], [n], t), n[O](); - } - function he() { - let { [p]: e, [L]: t } = this, { [b]: n } = e, i = this[b][y] || this[y] || new c(`closed`, a.getSocketInfo(n)); - if (e[b] = null, e[A] = null, t.ping.interval != null && (clearInterval(t.ping.interval), t.ping.interval = null), e.destroyed) { - r(e[h] === 0); - let t = e[g].splice(e[v]); - for (let n = 0; n < t.length; n++) { - let r = t[n]; - a.errorRequest(e, r, i); - } - } - } - function ge() { - let e = this[y] || new c(`closed`, a.getSocketInfo(this)), t = this[T][p]; - t[b] = null, t[A] = null, this[T] !== null && this[T].destroy(e), t[_] = t[v], r(t[m] === 0), t.emit(`disconnect`, t[d], [t], e), t[O](); - } - function Z(e) { - r(e.code !== `ERR_TLS_CERT_ALTNAME_INVALID`), this[y] = e, this[p][S](e); - } - function _e() { - a.destroy(this, new c(`other side closed`, a.getSocketInfo(this))); - } - function ve() { - this[j] = !0; - } - function ye(e) { - return e !== `GET` && e !== `HEAD` && e !== `OPTIONS` && e !== `TRACE` && e !== `CONNECT`; - } - function be(e, t) { - let n = t.bodyTimeout ?? e[M], i = e[T], { method: c, path: f, host: p, upgrade: m, expectContinue: h, signal: y, protocol: C, headers: w } = t, { body: E } = t; - if (m != null && m !== `websocket`) return a.errorRequest(e, t, new u(`Custom upgrade "${m}" not supported over HTTP/2`)), !1; - let D = {}; - for (let e = 0; e < w.length; e += 2) { - let t = w[e + 0], n = w[e + 1]; - if (t === `cookie`) { - D[t] == null ? D[t] = n : D[t] = Array.isArray(D[t]) ? (D[t].push(n), D[t]) : [D[t], n]; - continue; - } - if (Array.isArray(n)) for (let e = 0; e < n.length; e++) D[t] ? D[t] += `, ${n[e]}` : D[t] = n[e]; - else D[t] ? D[t] += `, ${n}` : D[t] = n; - } - let k = null, { hostname: A, port: j } = e[d]; - D[U] = p || `${A}${j ? `:${j}` : ``}`, D[W] = c; - let P = (n) => { - t.aborted || t.completed || (n ||= new s(), a.errorRequest(e, t, n), k != null && (k.removeAllListeners(`data`), k.close(), e[S](n), e[O]()), a.destroy(E, n)); - }; - try { - t.onConnect(P); - } catch (n) { - a.errorRequest(e, t, n); - } - if (t.aborted) return !1; - if (m || c === `CONNECT`) return i.ref(), m === `websocket` ? i[N] === !1 ? (a.errorRequest(e, t, new l(`HTTP/2: Extended CONNECT protocol not supported by server`)), i.unref(), !1) : (D[W] = `CONNECT`, D[ae] = `websocket`, D[ne] = f, C === `ws:` || C === `wss:` ? D[G] = C === `ws:` ? `http` : `https` : D[G] = C === `http:` ? `http` : `https`, k = i.request(D, { - endStream: !1, - signal: y - }), k[F] = !0, k.once(`response`, (n, r) => { - let { [ie]: a, ...o } = n; - t.onUpgrade(a, ce(o), k), ++i[z], e[g][e[v]++] = null; - }), k.on(`error`, () => { - (k.rstCode === oe || k.rstCode === se) && P(new l(`HTTP/2: "stream error" received - code ${k.rstCode}`)); - }), k.once(`close`, () => { - --i[z], i[z] === 0 && i.unref(); - }), k.setTimeout(n), !0) : (k = i.request(D, { - endStream: !1, - signal: y - }), k[F] = !0, k.on(`response`, (n) => { - let { [ie]: r, ...a } = n; - t.onUpgrade(r, ce(a), k), ++i[z], e[g][e[v]++] = null; - }), k.once(`close`, () => { - --i[z], i[z] === 0 && i.unref(); - }), k.setTimeout(n), !0); - D[ne] = f, D[G] = C === `http:` ? `http` : `https`; - let I = c === `PUT` || c === `POST` || c === `PATCH`; - E && typeof E.read == `function` && E.read(0); - let L = a.bodyLength(E); - if (a.isFormDataLike(E)) { - V ??= me().extractBody; - let [e, t] = V(E); - D[`content-type`] = t, E = e.stream, L = e.length; - } - if (L ??= t.contentLength, I || (L = null), ye(c) && L > 0 && t.contentLength != null && t.contentLength !== L) { - if (e[x]) return a.errorRequest(e, t, new o()), !1; - process.emitWarning(new o()); - } - if (L != null && (r(E || L === 0, `no body must not have content length`), D[K] = `${L}`), i.ref(), ee.sendHeaders.hasSubscribers) { - let e = ``; - for (let t in D) e += `${t}: ${D[t]}\r\n`; - ee.sendHeaders.publish({ - request: t, - headers: e, - socket: i[b] - }); - } - let R = c === `GET` || c === `HEAD` || E === null; - h ? (D[re] = `100-continue`, k = i.request(D, { - endStream: R, - signal: y - }), k[F] = !0, k.once(`continue`, H)) : (k = i.request(D, { - endStream: R, - signal: y - }), k[F] = !0, H()), ++i[z], k.setTimeout(n); - let B = !1; - return k.once(`response`, (e) => { - let { [ie]: n, ...r } = e; - if (t.onResponseStarted(), B = !0, t.aborted) { - k.removeAllListeners(`data`); - return; - } - t.onHeaders(Number(n), ce(r), k.resume.bind(k), ``) === !1 && k.pause(), k.on(`data`, (e) => { - t.aborted || t.completed || t.onData(e) === !1 && k.pause(); - }); - }), k.once(`end`, () => { - k.removeAllListeners(`data`), B ? (!t.aborted && !t.completed && t.onComplete({}), e[g][e[v]++] = null, e[O]()) : (P(new l(`HTTP/2: stream half-closed (remote)`)), e[g][e[v]++] = null, e[_] = e[v], e[O]()); - }), k.once(`close`, () => { - k.removeAllListeners(`data`), --i[z], i[z] === 0 && i.unref(); - }), k.once(`error`, function(e) { - k.removeAllListeners(`data`), P(e); - }), k.once(`frameError`, (e, t) => { - k.removeAllListeners(`data`), P(new l(`HTTP/2: "frameError" received - type ${e}, code ${t}`)); - }), k.on(`aborted`, () => { - k.removeAllListeners(`data`); - }), k.on(`timeout`, () => { - let e = new l(`HTTP/2: "stream timeout after ${n}"`); - k.removeAllListeners(`data`), --i[z], i[z] === 0 && i.unref(), P(e); - }), k.once(`trailers`, (e) => { - t.aborted || t.completed || (k.removeAllListeners(`data`), t.onComplete(e)); - }), !0; - function H() { - !E || L === 0 ? xe(P, k, null, e, t, e[b], L, I) : a.isBuffer(E) ? xe(P, k, E, e, t, e[b], L, I) : a.isBlobLike(E) ? typeof E.stream == `function` ? we(P, k, E.stream(), e, t, e[b], L, I) : Ce(P, k, E, e, t, e[b], L, I) : a.isStream(E) ? Se(P, e[b], I, k, E, e, t, L) : a.isIterable(E) ? we(P, k, E, e, t, e[b], L, I) : r(!1); - } - } - function xe(e, t, n, i, o, s, c, l) { - try { - n != null && a.isBuffer(n) && (r(c === n.byteLength, `buffer body must have content length`), t.cork(), t.write(n), t.uncork(), t.end(), o.onBodySent(n)), l || (s[f] = !0), o.onRequestSent(), i[O](); - } catch (t) { - e(t); - } - } - function Se(e, t, n, o, s, c, l, u) { - r(u !== 0 || c[m] === 0, `stream body cannot be pipelined`); - let d = i(s, o, (r) => { - r ? (a.destroy(d, r), e(r)) : (a.removeAllListeners(d), l.onRequestSent(), n || (t[f] = !0), c[O]()); - }); - a.addListener(d, `data`, p); - function p(e) { - l.onBodySent(e); - } - } - async function Ce(e, t, n, i, a, s, c, l) { - r(c === n.size, `blob body must have content length`); - try { - if (c != null && c !== n.size) throw new o(); - let e = Buffer.from(await n.arrayBuffer()); - t.cork(), t.write(e), t.uncork(), t.end(), a.onBodySent(e), a.onRequestSent(), l || (s[f] = !0), i[O](); - } catch (t) { - e(t); - } - } - async function we(e, t, n, i, a, o, s, c) { - r(s !== 0 || i[m] === 0, `iterator body cannot be pipelined`); - let l = null; - function u() { - if (l) { - let e = l; - l = null, e(); - } - } - let d = () => new Promise((e, t) => { - r(l === null), o[y] ? t(o[y]) : l = e; - }); - t.on(`close`, u).on(`drain`, u); - try { - for await (let e of n) { - if (o[y]) throw o[y]; - let n = t.write(e); - a.onBodySent(e), n || await d(); - } - t.end(), a.onRequestSent(), c || (o[f] = !0), i[O](); - } catch (t) { - e(t); - } finally { - t.off(`close`, u).off(`drain`, u); - } - } - t.exports = le; -})); -var Z$1 = c$3(((e, t) => { - let r = p$4(`node:assert`), i = p$4(`node:net`), a = p$4(`node:http`), o = B$1(), { ClientStats: s } = V$1(), { channels: c } = H$1(), l = te$1(), u = G$2(), { InvalidArgumentError: d, InformationalError: f, ClientDestroyedError: p } = R$1(), m = K$1(), { kUrl: h, kServerName: g, kClient: _, kBusy: v, kConnect: y, kResuming: b, kRunning: x, kPending: S, kSize: C, kQueue: w, kConnected: T, kConnecting: E, kNeedDrain: D, kKeepAliveDefaultTimeout: O, kHostHeader: k, kPendingIdx: A, kRunningIdx: j, kError: M, kPipelining: N, kKeepAliveTimeoutValue: P, kMaxHeadersSize: F, kKeepAliveMaxTimeout: L, kKeepAliveTimeoutThreshold: ee, kHeadersTimeout: z, kBodyTimeout: U, kStrictContentLength: W, kConnector: ne, kMaxRequests: re, kCounter: ie, kClose: ae, kDestroy: oe, kDispatch: se, kLocalAddress: ce, kMaxResponseSize: le, kOnError: q, kHTTPContext: J, kMaxConcurrentStreams: ue, kHTTP2InitialWindowSize: de, kHTTP2ConnectionWindowSize: Y, kResume: fe, kPingInterval: pe } = I$1(), X = he(), me = ge(), Z = Symbol(`kClosedResolve`), _e = a && a.maxHeaderSize && Number.isInteger(a.maxHeaderSize) && a.maxHeaderSize > 0 ? () => a.maxHeaderSize : () => { - throw new d(`http module not available or http.maxHeaderSize invalid`); - }, ve = () => {}; - function ye(e) { - return e[N] ?? e[J]?.defaultPipelining ?? 1; - } - var be = class extends u { - constructor(e, { maxHeaderSize: t, headersTimeout: n, socketTimeout: r, requestTimeout: a, connectTimeout: s, bodyTimeout: c, idleTimeout: l, keepAlive: u, keepAliveTimeout: f, maxKeepAliveTimeout: p, keepAliveMaxTimeout: _, keepAliveTimeoutThreshold: v, socketPath: y, pipelining: x, tls: S, strictContentLength: C, maxCachedSessions: T, connect: E, maxRequestsPerClient: M, localAddress: I, maxResponseSize: R, autoSelectFamily: B, autoSelectFamilyAttemptTimeout: V, maxConcurrentStreams: H, allowH2: te, useH2c: G, initialWindowSize: K, connectionWindowSize: ie, pingInterval: ae } = {}) { - if (u !== void 0) throw new d(`unsupported keepAlive, use pipelining=0 instead`); - if (r !== void 0) throw new d(`unsupported socketTimeout, use headersTimeout & bodyTimeout instead`); - if (a !== void 0) throw new d(`unsupported requestTimeout, use headersTimeout & bodyTimeout instead`); - if (l !== void 0) throw new d(`unsupported idleTimeout, use keepAliveTimeout instead`); - if (p !== void 0) throw new d(`unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead`); - if (t != null) { - if (!Number.isInteger(t) || t < 1) throw new d(`invalid maxHeaderSize`); - } else t = _e(); - if (y != null && typeof y != `string`) throw new d(`invalid socketPath`); - if (s != null && (!Number.isFinite(s) || s < 0)) throw new d(`invalid connectTimeout`); - if (f != null && (!Number.isFinite(f) || f <= 0)) throw new d(`invalid keepAliveTimeout`); - if (_ != null && (!Number.isFinite(_) || _ <= 0)) throw new d(`invalid keepAliveMaxTimeout`); - if (v != null && !Number.isFinite(v)) throw new d(`invalid keepAliveTimeoutThreshold`); - if (n != null && (!Number.isInteger(n) || n < 0)) throw new d(`headersTimeout must be a positive integer or zero`); - if (c != null && (!Number.isInteger(c) || c < 0)) throw new d(`bodyTimeout must be a positive integer or zero`); - if (E != null && typeof E != `function` && typeof E != `object`) throw new d(`connect must be a function or an object`); - if (M != null && (!Number.isInteger(M) || M < 0)) throw new d(`maxRequestsPerClient must be a positive number`); - if (I != null && (typeof I != `string` || i.isIP(I) === 0)) throw new d(`localAddress must be valid string IP address`); - if (R != null && (!Number.isInteger(R) || R < -1)) throw new d(`maxResponseSize must be a positive number`); - if (V != null && (!Number.isInteger(V) || V < -1)) throw new d(`autoSelectFamilyAttemptTimeout must be a positive number`); - if (te != null && typeof te != `boolean`) throw new d(`allowH2 must be a valid boolean value`); - if (H != null && (typeof H != `number` || H < 1)) throw new d(`maxConcurrentStreams must be a positive integer, greater than 0`); - if (G != null && typeof G != `boolean`) throw new d(`useH2c must be a valid boolean value`); - if (K != null && (!Number.isInteger(K) || K < 1)) throw new d(`initialWindowSize must be a positive integer, greater than 0`); - if (ie != null && (!Number.isInteger(ie) || ie < 1)) throw new d(`connectionWindowSize must be a positive integer, greater than 0`); - if (ae != null && (typeof ae != `number` || !Number.isInteger(ae) || ae < 0)) throw new d(`pingInterval must be a positive integer, greater or equal to 0`); - if (super(), typeof E != `function`) E = m({ - ...S, - maxCachedSessions: T, - allowH2: te, - useH2c: G, - socketPath: y, - timeout: s, - ...typeof B == `boolean` ? { - autoSelectFamily: B, - autoSelectFamilyAttemptTimeout: V - } : void 0, - ...E - }); - else { - let e = E; - E = (t, n) => e({ - ...t, - ...y == null ? null : { socketPath: y }, - ...te == null ? null : { allowH2: te } - }, n); - } - this[h] = o.parseOrigin(e), this[ne] = E, this[N] = x ?? 1, this[F] = t, this[O] = f ?? 4e3, this[L] = _ ?? 6e5, this[ee] = v ?? 2e3, this[P] = this[O], this[g] = null, this[ce] = I ?? null, this[b] = 0, this[D] = 0, this[k] = `host: ${this[h].hostname}${this[h].port ? `:${this[h].port}` : ``}\r\n`, this[U] = c ?? 3e5, this[z] = n ?? 3e5, this[W] = C ?? !0, this[re] = M, this[Z] = null, this[le] = R > -1 ? R : -1, this[J] = null, this[ue] = H ?? 100, this[de] = K ?? 262144, this[Y] = ie ?? 524288, this[pe] = ae ?? 6e4, this[w] = [], this[j] = 0, this[A] = 0, this[fe] = (e) => Te(this, e), this[q] = (e) => xe(this, e); - } - get pipelining() { - return this[N]; - } - set pipelining(e) { - this[N] = e, this[fe](!0); - } - get stats() { - return new s(this); - } - get [S]() { - return this[w].length - this[A]; - } - get [x]() { - return this[A] - this[j]; - } - get [C]() { - return this[w].length - this[j]; - } - get [T]() { - return !!this[J] && !this[E] && !this[J].destroyed; - } - get [v]() { - return !!(this[J]?.busy(null) || this[C] >= (ye(this) || 1) || this[S] > 0); - } - [y](e) { - Se(this), this.once(`connect`, e); - } - [se](e, t) { - let n = new l(this[h].origin, e, t); - return this[w].push(n), this[b] || (o.bodyLength(n.body) == null && o.isIterable(n.body) ? (this[b] = 1, queueMicrotask(() => Te(this))) : this[fe](!0)), this[b] && this[D] !== 2 && this[v] && (this[D] = 2), this[D] < 2; - } - [ae]() { - return new Promise((e) => { - this[C] ? this[Z] = e : e(null); - }); - } - [oe](e) { - return new Promise((t) => { - let n = this[w].splice(this[A]); - for (let t = 0; t < n.length; t++) { - let r = n[t]; - o.errorRequest(this, r, e); - } - let r = () => { - this[Z] && (this[Z](), this[Z] = null), t(null); - }; - this[J] ? (this[J].destroy(e, r), this[J] = null) : queueMicrotask(r), this[fe](); - }); - } - }; - function xe(e, t) { - if (e[x] === 0 && t.code !== `UND_ERR_INFO` && t.code !== `UND_ERR_SOCKET`) { - r(e[A] === e[j]); - let n = e[w].splice(e[j]); - for (let r = 0; r < n.length; r++) { - let i = n[r]; - o.errorRequest(e, i, t); - } - r(e[C] === 0); - } - } - function Se(e) { - r(!e[E]), r(!e[J]); - let { host: t, hostname: n, protocol: a, port: s } = e[h]; - if (n[0] === `[`) { - let e = n.indexOf(`]`); - r(e !== -1); - let t = n.substring(1, e); - r(i.isIPv6(t)), n = t; - } - e[E] = !0, c.beforeConnect.hasSubscribers && c.beforeConnect.publish({ - connectParams: { - host: t, - hostname: n, - protocol: a, - port: s, - version: e[J]?.version, - servername: e[g], - localAddress: e[ce] - }, - connector: e[ne] - }); - try { - e[ne]({ - host: t, - hostname: n, - protocol: a, - port: s, - servername: e[g], - localAddress: e[ce] - }, (i, l) => { - if (i) { - Ce(e, i, { - host: t, - hostname: n, - protocol: a, - port: s - }), e[fe](); - return; - } - if (e.destroyed) { - o.destroy(l.on(`error`, ve), new p()), e[fe](); - return; - } - r(l); - try { - e[J] = l.alpnProtocol === `h2` ? me(e, l) : X(e, l); - } catch (r) { - l.destroy().on(`error`, ve), Ce(e, r, { - host: t, - hostname: n, - protocol: a, - port: s - }), e[fe](); - return; - } - e[E] = !1, l[ie] = 0, l[re] = e[re], l[_] = e, l[M] = null, c.connected.hasSubscribers && c.connected.publish({ - connectParams: { - host: t, - hostname: n, - protocol: a, - port: s, - version: e[J]?.version, - servername: e[g], - localAddress: e[ce] - }, - connector: e[ne], - socket: l - }), e.emit(`connect`, e[h], [e]), e[fe](); - }); - } catch (r) { - Ce(e, r, { - host: t, - hostname: n, - protocol: a, - port: s - }), e[fe](); - } - } - function Ce(e, t, { host: n, hostname: i, protocol: a, port: s }) { - if (!e.destroyed) { - if (e[E] = !1, c.connectError.hasSubscribers && c.connectError.publish({ - connectParams: { - host: n, - hostname: i, - protocol: a, - port: s, - version: e[J]?.version, - servername: e[g], - localAddress: e[ce] - }, - connector: e[ne], - error: t - }), t.code === `ERR_TLS_CERT_ALTNAME_INVALID`) for (r(e[x] === 0); e[S] > 0 && e[w][e[A]].servername === e[g];) { - let n = e[w][e[A]++]; - o.errorRequest(e, n, t); - } - else xe(e, t); - e.emit(`connectionError`, e[h], [e], t); - } - } - function we(e) { - e[D] = 0, e.emit(`drain`, e[h], [e]); - } - function Te(e, t) { - e[b] !== 2 && (e[b] = 2, Ee(e, t), e[b] = 0, e[j] > 256 && (e[w].splice(0, e[j]), e[A] -= e[j], e[j] = 0)); - } - function Ee(e, t) { - for (;;) { - if (e.destroyed) { - r(e[S] === 0); - return; - } - if (e[Z] && !e[C]) { - e[Z](), e[Z] = null; - return; - } - if (e[J] && e[J].resume(), e[v]) e[D] = 2; - else if (e[D] === 2) { - t ? (e[D] = 1, queueMicrotask(() => we(e))) : we(e); - continue; - } - if (e[S] === 0 || e[x] >= (ye(e) || 1)) return; - let n = e[w][e[A]]; - if (n === null) return; - if (e[h].protocol === `https:` && e[g] !== n.servername) { - if (e[x] > 0) return; - e[g] = n.servername, e[J]?.destroy(new f(`servername changed`), () => { - e[J] = null, Te(e); - }); - } - if (e[E]) return; - if (!e[J]) { - Se(e); - return; - } - if (e[J].destroyed || e[J].busy(n)) return; - !n.aborted && e[J].write(n) ? e[A]++ : e[w].splice(e[A], 1); - } - } - t.exports = be; -})); -var _e = c$3(((e, t) => { - let n = 2048, r = n - 1; - var i = class { - bottom = 0; - top = 0; - list = Array(n).fill(void 0); - next = null; - isEmpty() { - return this.top === this.bottom; - } - isFull() { - return (this.top + 1 & r) === this.bottom; - } - push(e) { - this.list[this.top] = e, this.top = this.top + 1 & r; - } - shift() { - let e = this.list[this.bottom]; - return e === void 0 ? null : (this.list[this.bottom] = void 0, this.bottom = this.bottom + 1 & r, e); - } - }; - t.exports = class { - constructor() { - this.head = this.tail = new i(); - } - isEmpty() { - return this.head.isEmpty(); - } - push(e) { - this.head.isFull() && (this.head = this.head.next = new i()), this.head.push(e); - } - shift() { - let e = this.tail, t = e.shift(); - return e.isEmpty() && e.next !== null && (this.tail = e.next, e.next = null), t; - } - }; -})); -var ve = c$3(((e, t) => { - let { PoolStats: n } = V$1(), r = G$2(), i = _e(), { kConnected: a, kSize: o, kRunning: s, kPending: c, kQueued: l, kBusy: u, kFree: d, kUrl: f, kClose: p, kDestroy: m, kDispatch: h } = I$1(), g = Symbol(`clients`), _ = Symbol(`needDrain`), v = Symbol(`queue`), y = Symbol(`closed resolve`), b = Symbol(`onDrain`), x = Symbol(`onConnect`), S = Symbol(`onDisconnect`), C = Symbol(`onConnectionError`), w = Symbol(`get dispatcher`), T = Symbol(`add client`), E = Symbol(`remove client`); - t.exports = { - PoolBase: class extends r { - [v] = new i(); - [l] = 0; - [g] = []; - [_] = !1; - [b](e, t, n) { - let r = this[v], i = !1; - for (; !i;) { - let t = r.shift(); - if (!t) break; - this[l]--, i = !e.dispatch(t.opts, t.handler); - } - if (e[_] = i, !i && this[_] && (this[_] = !1, this.emit(`drain`, t, [this, ...n])), this[y] && r.isEmpty()) { - let e = []; - for (let t = 0; t < this[g].length; t++) { - let n = this[g][t]; - n.destroyed || e.push(n.close()); - } - return Promise.all(e).then(this[y]); - } - } - [x] = (e, t) => { - this.emit(`connect`, e, [this, ...t]); - }; - [S] = (e, t, n) => { - this.emit(`disconnect`, e, [this, ...t], n); - }; - [C] = (e, t, n) => { - this.emit(`connectionError`, e, [this, ...t], n); - }; - get [u]() { - return this[_]; - } - get [a]() { - let e = 0; - for (let { [a]: t } of this[g]) e += t; - return e; - } - get [d]() { - let e = 0; - for (let { [a]: t, [_]: n } of this[g]) e += t && !n; - return e; - } - get [c]() { - let e = this[l]; - for (let { [c]: t } of this[g]) e += t; - return e; - } - get [s]() { - let e = 0; - for (let { [s]: t } of this[g]) e += t; - return e; - } - get [o]() { - let e = this[l]; - for (let { [o]: t } of this[g]) e += t; - return e; - } - get stats() { - return new n(this); - } - [p]() { - if (this[v].isEmpty()) { - let e = []; - for (let t = 0; t < this[g].length; t++) { - let n = this[g][t]; - n.destroyed || e.push(n.close()); - } - return Promise.all(e); - } else return new Promise((e) => { - this[y] = e; - }); - } - [m](e) { - for (;;) { - let t = this[v].shift(); - if (!t) break; - t.handler.onError(e); - } - let t = Array(this[g].length); - for (let n = 0; n < this[g].length; n++) t[n] = this[g][n].destroy(e); - return Promise.all(t); - } - [h](e, t) { - let n = this[w](); - return n ? n.dispatch(e, t) || (n[_] = !0, this[_] = !this[w]()) : (this[_] = !0, this[v].push({ - opts: e, - handler: t - }), this[l]++), !this[_]; - } - [T](e) { - return e.on(`drain`, this[b].bind(this, e)).on(`connect`, this[x]).on(`disconnect`, this[S]).on(`connectionError`, this[C]), this[g].push(e), this[_] && queueMicrotask(() => { - this[_] && this[b](e, e[f], [e, this]); - }), this; - } - [E](e) { - e.close(() => { - let t = this[g].indexOf(e); - t !== -1 && this[g].splice(t, 1); - }), this[_] = this[g].some((e) => !e[_] && e.closed !== !0 && e.destroyed !== !0); - } - }, - kClients: g, - kNeedDrain: _, - kAddClient: T, - kRemoveClient: E, - kGetDispatcher: w - }; -})); -var ye = c$3(((e, t) => { - let { PoolBase: n, kClients: r, kNeedDrain: i, kAddClient: a, kGetDispatcher: o, kRemoveClient: s } = ve(), c = Z$1(), { InvalidArgumentError: l } = R$1(), u = B$1(), { kUrl: d } = I$1(), f = K$1(), p = Symbol(`options`), m = Symbol(`connections`), h = Symbol(`factory`); - function g(e, t) { - return new c(e, t); - } - t.exports = class extends n { - constructor(e, { connections: t, factory: n = g, connect: i, connectTimeout: a, tls: o, maxCachedSessions: s, socketPath: c, autoSelectFamily: _, autoSelectFamilyAttemptTimeout: v, allowH2: y, clientTtl: b, ...x } = {}) { - if (t != null && (!Number.isFinite(t) || t < 0)) throw new l(`invalid connections`); - if (typeof n != `function`) throw new l(`factory must be a function.`); - if (i != null && typeof i != `function` && typeof i != `object`) throw new l(`connect must be a function or an object`); - typeof i != `function` && (i = f({ - ...o, - maxCachedSessions: s, - allowH2: y, - socketPath: c, - timeout: a, - ...typeof _ == `boolean` ? { - autoSelectFamily: _, - autoSelectFamilyAttemptTimeout: v - } : void 0, - ...i - })), super(), this[m] = t || null, this[d] = u.parseOrigin(e), this[p] = { - ...u.deepClone(x), - connect: i, - allowH2: y, - clientTtl: b, - socketPath: c - }, this[p].interceptors = x.interceptors ? { ...x.interceptors } : void 0, this[h] = n, this.on(`connect`, (e, t) => { - if (b != null && b > 0) for (let e of t) Object.assign(e, { ttl: Date.now() }); - }), this.on(`connectionError`, (e, t, n) => { - for (let e of t) { - let t = this[r].indexOf(e); - t !== -1 && this[r].splice(t, 1); - } - }); - } - [o]() { - let e = this[p].clientTtl; - for (let t of this[r]) if (e != null && e > 0 && t.ttl && Date.now() - t.ttl > e) this[s](t); - else if (!t[i]) return t; - if (!this[m] || this[r].length < this[m]) { - let e = this[h](this[d], this[p]); - return this[a](e), e; - } - } - }; -})); -var be = c$3(((e, t) => { - let { BalancedPoolMissingUpstreamError: n, InvalidArgumentError: r } = R$1(), { PoolBase: i, kClients: a, kNeedDrain: o, kAddClient: s, kRemoveClient: c, kGetDispatcher: l } = ve(), u = ye(), { kUrl: d } = I$1(), f = B$1(), p = Symbol(`factory`), m = Symbol(`options`), h = Symbol(`kGreatestCommonDivisor`), g = Symbol(`kCurrentWeight`), _ = Symbol(`kIndex`), v = Symbol(`kWeight`), y = Symbol(`kMaxWeightPerServer`), b = Symbol(`kErrorPenalty`); - function x(e, t) { - if (e === 0) return t; - for (; t !== 0;) { - let n = t; - t = e % t, e = n; - } - return e; - } - function S(e, t) { - return new u(e, t); - } - t.exports = class extends i { - constructor(e = [], { factory: t = S, ...n } = {}) { - if (typeof t != `function`) throw new r(`factory must be a function.`); - super(), this[m] = { ...f.deepClone(n) }, this[m].interceptors = n.interceptors ? { ...n.interceptors } : void 0, this[_] = -1, this[g] = 0, this[y] = this[m].maxWeightPerServer || 100, this[b] = this[m].errorPenalty || 15, Array.isArray(e) || (e = [e]), this[p] = t; - for (let t of e) this.addUpstream(t); - this._updateBalancedPoolStats(); - } - addUpstream(e) { - let t = f.parseOrigin(e).origin; - if (this[a].find((e) => e[d].origin === t && e.closed !== !0 && e.destroyed !== !0)) return this; - let n = this[p](t, this[m]); - this[s](n), n.on(`connect`, () => { - n[v] = Math.min(this[y], n[v] + this[b]); - }), n.on(`connectionError`, () => { - n[v] = Math.max(1, n[v] - this[b]), this._updateBalancedPoolStats(); - }), n.on(`disconnect`, (...e) => { - let t = e[2]; - t && t.code === `UND_ERR_SOCKET` && (n[v] = Math.max(1, n[v] - this[b]), this._updateBalancedPoolStats()); - }); - for (let e of this[a]) e[v] = this[y]; - return this._updateBalancedPoolStats(), this; - } - _updateBalancedPoolStats() { - let e = 0; - for (let t = 0; t < this[a].length; t++) e = x(this[a][t][v], e); - this[h] = e; - } - removeUpstream(e) { - let t = f.parseOrigin(e).origin, n = this[a].find((e) => e[d].origin === t && e.closed !== !0 && e.destroyed !== !0); - return n && this[c](n), this; - } - getUpstream(e) { - let t = f.parseOrigin(e).origin; - return this[a].find((e) => e[d].origin === t && e.closed !== !0 && e.destroyed !== !0); - } - get upstreams() { - return this[a].filter((e) => e.closed !== !0 && e.destroyed !== !0).map((e) => e[d].origin); - } - [l]() { - if (this[a].length === 0) throw new n(); - if (!this[a].find((e) => !e[o] && e.closed !== !0 && e.destroyed !== !0) || this[a].map((e) => e[o]).reduce((e, t) => e && t, !0)) return; - let e = 0, t = this[a].findIndex((e) => !e[o]); - for (; e++ < this[a].length;) { - this[_] = (this[_] + 1) % this[a].length; - let e = this[a][this[_]]; - if (e[v] > this[a][t][v] && !e[o] && (t = this[_]), this[_] === 0 && (this[g] = this[g] - this[h], this[g] <= 0 && (this[g] = this[y])), e[v] >= this[g] && !e[o]) return e; - } - return this[g] = this[a][t][v], this[_] = t, this[a][t]; - } - }; -})); -var xe = c$3(((e, t) => { - let { PoolBase: n, kClients: r, kNeedDrain: i, kAddClient: a, kGetDispatcher: o, kRemoveClient: s } = ve(), c = Z$1(), { InvalidArgumentError: l } = R$1(), u = B$1(), { kUrl: d } = I$1(), f = K$1(), p = Symbol(`options`), m = Symbol(`connections`), h = Symbol(`factory`), g = Symbol(`index`); - function _(e, t) { - return new c(e, t); - } - t.exports = class extends n { - constructor(e, { connections: t, factory: n = _, connect: i, connectTimeout: a, tls: o, maxCachedSessions: s, socketPath: c, autoSelectFamily: v, autoSelectFamilyAttemptTimeout: y, allowH2: b, clientTtl: x, ...S } = {}) { - if (t != null && (!Number.isFinite(t) || t < 0)) throw new l(`invalid connections`); - if (typeof n != `function`) throw new l(`factory must be a function.`); - if (i != null && typeof i != `function` && typeof i != `object`) throw new l(`connect must be a function or an object`); - typeof i != `function` && (i = f({ - ...o, - maxCachedSessions: s, - allowH2: b, - socketPath: c, - timeout: a, - ...typeof v == `boolean` ? { - autoSelectFamily: v, - autoSelectFamilyAttemptTimeout: y - } : void 0, - ...i - })), super(), this[m] = t || null, this[d] = u.parseOrigin(e), this[p] = { - ...u.deepClone(S), - connect: i, - allowH2: b, - clientTtl: x, - socketPath: c - }, this[p].interceptors = S.interceptors ? { ...S.interceptors } : void 0, this[h] = n, this[g] = -1, this.on(`connect`, (e, t) => { - if (x != null && x > 0) for (let e of t) Object.assign(e, { ttl: Date.now() }); - }), this.on(`connectionError`, (e, t, n) => { - for (let e of t) { - let t = this[r].indexOf(e); - t !== -1 && this[r].splice(t, 1); - } - }); - } - [o]() { - let e = this[p].clientTtl, t = this[r].length; - if (t === 0) { - let e = this[h](this[d], this[p]); - return this[a](e), e; - } - let n = 0; - for (; n < t;) { - this[g] = (this[g] + 1) % t; - let a = this[r][this[g]]; - if (e != null && e > 0 && a.ttl && Date.now() - a.ttl > e) { - this[s](a), n++; - continue; - } - if (!a[i]) return a; - n++; - } - if (!this[m] || t < this[m]) { - let e = this[h](this[d], this[p]); - return this[a](e), e; - } - } - }; -})); -var Se = c$3(((e, t) => { - let { InvalidArgumentError: n, MaxOriginsReachedError: r } = R$1(), { kClients: i, kRunning: a, kClose: o, kDestroy: s, kDispatch: c, kUrl: l } = I$1(), u = G$2(), d = ye(), f = Z$1(), p = B$1(), m = Symbol(`onConnect`), h = Symbol(`onDisconnect`), g = Symbol(`onConnectionError`), _ = Symbol(`onDrain`), v = Symbol(`factory`), y = Symbol(`options`), b = Symbol(`origins`); - function x(e, t) { - return t && t.connections === 1 ? new f(e, t) : new d(e, t); - } - t.exports = class extends u { - constructor({ factory: e = x, maxOrigins: t = Infinity, connect: r, ...a } = {}) { - if (typeof e != `function`) throw new n(`factory must be a function.`); - if (r != null && typeof r != `function` && typeof r != `object`) throw new n(`connect must be a function or an object`); - if (typeof t != `number` || Number.isNaN(t) || t <= 0) throw new n(`maxOrigins must be a number greater than 0`); - super(), r && typeof r != `function` && (r = { ...r }), this[y] = { - ...p.deepClone(a), - maxOrigins: t, - connect: r - }, this[v] = e, this[i] = /* @__PURE__ */ new Map(), this[b] = /* @__PURE__ */ new Set(), this[_] = (e, t) => { - this.emit(`drain`, e, [this, ...t]); - }, this[m] = (e, t) => { - this.emit(`connect`, e, [this, ...t]); - }, this[h] = (e, t, n) => { - this.emit(`disconnect`, e, [this, ...t], n); - }, this[g] = (e, t, n) => { - this.emit(`connectionError`, e, [this, ...t], n); - }; - } - get [a]() { - let e = 0; - for (let { dispatcher: t } of this[i].values()) e += t[a]; - return e; - } - [c](e, t) { - let a; - if (e.origin && (typeof e.origin == `string` || e.origin instanceof URL)) a = String(e.origin); - else throw new n(`opts.origin must be a non-empty string or URL.`); - if (this[b].size >= this[y].maxOrigins && !this[b].has(a)) throw new r(); - let o = this[i].get(a), s = o && o.dispatcher; - if (!s) { - let t = (e) => { - let t = this[i].get(a); - t && (e && --t.count, t.count <= 0 && (this[i].delete(a), t.dispatcher.destroyed || t.dispatcher.close()), this[b].delete(a)); - }; - s = this[v](e.origin, this[y]).on(`drain`, this[_]).on(`connect`, (e, t) => { - let n = this[i].get(a); - n && (n.count += 1), this[m](e, t); - }).on(`disconnect`, (e, n, r) => { - t(!0), this[h](e, n, r); - }).on(`connectionError`, (e, n, r) => { - t(!1), this[g](e, n, r); - }), this[i].set(a, { - count: 0, - dispatcher: s - }), this[b].add(a); - } - return s.dispatch(e, t); - } - [o]() { - let e = []; - for (let { dispatcher: t } of this[i].values()) e.push(t.close()); - return this[i].clear(), Promise.all(e); - } - [s](e) { - let t = []; - for (let { dispatcher: n } of this[i].values()) t.push(n.destroy(e)); - return this[i].clear(), Promise.all(t); - } - get stats() { - let e = {}; - for (let { dispatcher: t } of this[i].values()) t.stats && (e[t[l].origin] = t.stats); - return e; - } - }; -})); -var Ce = c$3(((e, t) => { - let { Buffer: r } = p$4(`node:buffer`), i = p$4(`node:net`), { InvalidArgumentError: a } = R$1(); - function o(e) { - if (i.isIPv4(e)) { - let t = e.split(`.`).map(Number); - return { - type: 1, - buffer: r.from(t) - }; - } - if (i.isIPv6(e)) return { - type: 4, - buffer: s(e) - }; - let t = r.from(e, `utf8`); - if (t.length > 255) throw new a(`Domain name too long (max 255 bytes)`); - return { - type: 3, - buffer: r.concat([r.from([t.length]), t]) - }; - } - function s(e) { - let t = r.alloc(16), n = e.indexOf(`::`); - if (n !== -1) { - let r = e.slice(0, n), i = e.slice(n + 2), a = r === `` ? [] : r.split(`:`), o = i === `` ? [] : i.split(`:`), s = 0; - for (let e of a) t.writeUInt16BE(parseInt(e, 16), s), s += 2; - s = 16 - o.length * 2; - for (let e of o) t.writeUInt16BE(parseInt(e, 16), s), s += 2; - } else { - let n = e.split(`:`); - for (let e = 0; e < n.length; e++) t.writeUInt16BE(parseInt(n[e], 16), e * 2); - } - return t; - } - function c(e, t, n) { - let i = r.allocUnsafe(2); - return i.writeUInt16BE(n, 0), r.concat([ - r.from([e]), - t, - i - ]); - } - function l(e, t = 0) { - if (e.length < t + 1) throw new a(`Buffer too small to contain address type`); - let n = e[t], r, i = t + 1; - switch (n) { - case 1: - if (e.length < i + 6) throw new a(`Buffer too small for IPv4 address`); - r = Array.from(e.subarray(i, i + 4)).join(`.`), i += 4; - break; - case 3: { - if (e.length < i + 1) throw new a(`Buffer too small for domain length`); - let t = e[i]; - if (i += 1, e.length < i + t + 2) throw new a(`Buffer too small for domain address`); - r = e.subarray(i, i + t).toString(`utf8`), i += t; - break; - } - case 4: { - if (e.length < i + 18) throw new a(`Buffer too small for IPv6 address`); - let t = []; - for (let n = 0; n < 8; n++) { - let r = e.readUInt16BE(i + n * 2); - t.push(r.toString(16)); - } - r = t.join(`:`), i += 16; - break; - } - default: throw new a(`Invalid address type: ${n}`); - } - if (e.length < i + 2) throw new a(`Buffer too small for port`); - let o = e.readUInt16BE(i); - return i += 2, { - address: r, - port: o, - bytesRead: i - t - }; - } - function u(e) { - let t = { - 1: `General SOCKS server failure`, - 2: `Connection not allowed by ruleset`, - 3: `Network unreachable`, - 4: `Host unreachable`, - 5: `Connection refused`, - 6: `TTL expired`, - 7: `Command not supported`, - 8: `Address type not supported` - }[e] || `Unknown SOCKS5 error code: ${e}`, n = Error(t); - return n.code = `SOCKS5_${e}`, n; - } - t.exports = { - parseAddress: o, - parseIPv6: s, - buildAddressBuffer: c, - parseResponseAddress: l, - createReplyError: u - }; -})); -var we = c$3(((e, t) => { - let { EventEmitter: r } = p$4(`node:events`), { Buffer: i } = p$4(`node:buffer`), { InvalidArgumentError: a, Socks5ProxyError: o } = R$1(), { debuglog: s } = p$4(`node:util`), { parseAddress: c } = Ce(), l = s(`undici:socks5`), u = i.alloc(0), d = { - NO_AUTH: 0, - GSSAPI: 1, - USERNAME_PASSWORD: 2, - NO_ACCEPTABLE: 255 - }, f = { - CONNECT: 1, - BIND: 2, - UDP_ASSOCIATE: 3 - }, p = { - IPV4: 1, - DOMAIN: 3, - IPV6: 4 - }, m = { - SUCCEEDED: 0, - GENERAL_FAILURE: 1, - CONNECTION_NOT_ALLOWED: 2, - NETWORK_UNREACHABLE: 3, - HOST_UNREACHABLE: 4, - CONNECTION_REFUSED: 5, - TTL_EXPIRED: 6, - COMMAND_NOT_SUPPORTED: 7, - ADDRESS_TYPE_NOT_SUPPORTED: 8 - }, h = { - INITIAL: `initial`, - HANDSHAKING: `handshaking`, - AUTHENTICATING: `authenticating`, - CONNECTING: `connecting`, - CONNECTED: `connected`, - ERROR: `error`, - CLOSED: `closed` - }; - t.exports = { - Socks5Client: class extends r { - constructor(e, t = {}) { - if (super(), !e) throw new a(`socket is required`); - this.socket = e, this.options = t, this.state = h.INITIAL, this.buffer = u, this.onSocketData = this.onData.bind(this), this.onSocketError = this.onError.bind(this), this.onSocketClose = this.onClose.bind(this), this.authMethods = [], t.username && t.password && this.authMethods.push(d.USERNAME_PASSWORD), this.authMethods.push(d.NO_AUTH), this.socket.on(`data`, this.onSocketData), this.socket.on(`error`, this.onSocketError), this.socket.on(`close`, this.onSocketClose); - } - onData(e) { - l(`received data`, e.length, `bytes in state`, this.state), this.buffer = i.concat([this.buffer, e]); - try { - switch (this.state) { - case h.HANDSHAKING: - this.handleHandshakeResponse(); - break; - case h.AUTHENTICATING: - this.handleAuthResponse(); - break; - case h.CONNECTING: - this.handleConnectResponse(); - break; - } - } catch (e) { - this.onError(e); - } - } - onError(e) { - l(`socket error`, e), this.state = h.ERROR, this.emit(`error`, e), this.destroy(); - } - onClose() { - l(`socket closed`), this.state = h.CLOSED, this.emit(`close`); - } - destroy() { - this.socket && !this.socket.destroyed && this.socket.destroy(); - } - handshake() { - if (this.state !== h.INITIAL) throw new a(`Handshake already started`); - l(`starting handshake with`, this.authMethods.length, `auth methods`), this.state = h.HANDSHAKING; - let e = i.alloc(2 + this.authMethods.length); - e[0] = 5, e[1] = this.authMethods.length, this.authMethods.forEach((t, n) => { - e[2 + n] = t; - }), this.socket.write(e); - } - handleHandshakeResponse() { - if (this.buffer.length < 2) return; - let e = this.buffer[0], t = this.buffer[1]; - if (e !== 5) throw new o(`Invalid SOCKS version: ${e}`, `UND_ERR_SOCKS5_VERSION`); - if (t === d.NO_ACCEPTABLE) throw new o(`No acceptable authentication method`, `UND_ERR_SOCKS5_AUTH_REJECTED`); - if (this.buffer = this.buffer.subarray(2), l(`server selected auth method`, t), t === d.NO_AUTH) this.emit(`authenticated`); - else if (t === d.USERNAME_PASSWORD) this.state = h.AUTHENTICATING, this.sendAuthRequest(); - else throw new o(`Unsupported authentication method: ${t}`, `UND_ERR_SOCKS5_AUTH_METHOD`); - } - sendAuthRequest() { - let { username: e, password: t } = this.options; - if (!e || !t) throw new a(`Username and password required for authentication`); - l(`sending username/password auth`); - let n = i.from(e), r = i.from(t); - if (n.length > 255 || r.length > 255) throw new a(`Username or password too long`); - let o = i.alloc(3 + n.length + r.length); - o[0] = 1, o[1] = n.length, n.copy(o, 2), o[2 + n.length] = r.length, r.copy(o, 3 + n.length), this.socket.write(o); - } - handleAuthResponse() { - if (this.buffer.length < 2) return; - let e = this.buffer[0], t = this.buffer[1]; - if (e !== 1) throw new o(`Invalid auth sub-negotiation version: ${e}`, `UND_ERR_SOCKS5_AUTH_VERSION`); - if (t !== 0) throw new o(`Authentication failed`, `UND_ERR_SOCKS5_AUTH_FAILED`); - this.buffer = this.buffer.subarray(2), l(`authentication successful`), this.emit(`authenticated`); - } - connect(e, t) { - if (this.state === h.CONNECTED) throw new a(`Already connected`); - l(`connecting to`, e, t), this.state = h.CONNECTING; - let n = this.buildConnectRequest(f.CONNECT, e, t); - this.socket.write(n); - } - buildConnectRequest(e, t, n) { - let { type: r, buffer: a } = c(t), o = i.alloc(4 + a.length + 2); - return o[0] = 5, o[1] = e, o[2] = 0, o[3] = r, a.copy(o, 4), o.writeUInt16BE(n, 4 + a.length), o; - } - handleConnectResponse() { - if (this.buffer.length < 4) return; - let e = this.buffer[0], t = this.buffer[1], n = this.buffer[3]; - if (e !== 5) throw new o(`Invalid SOCKS version in reply: ${e}`, `UND_ERR_SOCKS5_REPLY_VERSION`); - let r = 4; - if (n === p.IPV4) r += 6; - else if (n === p.DOMAIN) { - if (this.buffer.length < 5) return; - r += 1 + this.buffer[4] + 2; - } else if (n === p.IPV6) r += 18; - else throw new o(`Invalid address type in reply: ${n}`, `UND_ERR_SOCKS5_ADDR_TYPE`); - if (this.buffer.length < r) return; - if (t !== m.SUCCEEDED) throw new o(`SOCKS5 connection failed: ${this.getReplyErrorMessage(t)}`, `UND_ERR_SOCKS5_REPLY_${t}`); - let i, a = 4; - if (n === p.IPV4) i = Array.from(this.buffer.subarray(a, a + 4)).join(`.`), a += 4; - else if (n === p.DOMAIN) { - let e = this.buffer[a]; - a += 1, i = this.buffer.subarray(a, a + e).toString(), a += e; - } else if (n === p.IPV6) { - let e = []; - for (let t = 0; t < 8; t++) { - let n = this.buffer.readUInt16BE(a + t * 2); - e.push(n.toString(16)); - } - i = e.join(`:`), a += 16; - } - let s = this.buffer.readUInt16BE(a); - this.buffer = u, this.state = h.CONNECTED, this.socket.removeListener(`data`, this.onSocketData), l(`connected, bound address:`, i, `port:`, s), this.emit(`connected`, { - address: i, - port: s - }); - } - getReplyErrorMessage(e) { - switch (e) { - case m.GENERAL_FAILURE: return `General SOCKS server failure`; - case m.CONNECTION_NOT_ALLOWED: return `Connection not allowed by ruleset`; - case m.NETWORK_UNREACHABLE: return `Network unreachable`; - case m.HOST_UNREACHABLE: return `Host unreachable`; - case m.CONNECTION_REFUSED: return `Connection refused`; - case m.TTL_EXPIRED: return `TTL expired`; - case m.COMMAND_NOT_SUPPORTED: return `Command not supported`; - case m.ADDRESS_TYPE_NOT_SUPPORTED: return `Address type not supported`; - default: return `Unknown error code: ${e}`; - } - } - }, - AUTH_METHODS: d, - COMMANDS: f, - ADDRESS_TYPES: p, - REPLY_CODES: m, - STATES: h - }; -})); -var Te = c$3(((e, t) => { - let r = p$4(`node:net`), { URL: i } = p$4(`node:url`), a, o = G$2(), { InvalidArgumentError: s } = R$1(), { Socks5Client: c } = we(), { kDispatch: l, kClose: u, kDestroy: d } = I$1(), f = ye(), p = K$1(), { debuglog: m } = p$4(`node:util`), h = m(`undici:socks5-proxy`), g = Symbol(`proxy url`), _ = Symbol(`proxy headers`), v = Symbol(`proxy auth`), y = Symbol(`pool`), b = Symbol(`connector`), x = !1; - t.exports = class extends o { - constructor(e, t = {}) { - if (super(), x ||= (process.emitWarning(`SOCKS5 proxy support is experimental and subject to change`, `ExperimentalWarning`), !0), !e) throw new s(`Proxy URL is mandatory`); - let n = typeof e == `string` ? new i(e) : e; - if (n.protocol !== `socks5:` && n.protocol !== `socks:`) throw new s(`Proxy URL must use socks5:// or socks:// protocol`); - this[g] = n, this[_] = t.headers || {}, this[v] = { - username: t.username || (n.username ? decodeURIComponent(n.username) : null), - password: t.password || (n.password ? decodeURIComponent(n.password) : null) - }, this[b] = t.connect || p({ - ...t.proxyTls, - servername: t.proxyTls?.servername || n.hostname - }), this[y] = null; - } - async createSocks5Connection(e, t) { - let n = this[g].hostname, i = parseInt(this[g].port) || 1080; - h(`creating SOCKS5 connection to`, n, i); - let a = await new Promise((e, t) => { - let a = () => { - s.removeListener(`error`, o), e(s); - }, o = (e) => { - s.removeListener(`connect`, a), t(e); - }, s = r.connect({ - host: n, - port: i - }); - s.once(`connect`, a), s.once(`error`, o); - }), o = new c(a, this[v]); - return o.on(`error`, (e) => { - h(`SOCKS5 error:`, e), a.destroy(); - }), await o.handshake(), await new Promise((e, t) => { - let n = setTimeout(() => { - t(Error(`SOCKS5 authentication timeout`)); - }, 5e3), r = () => { - clearTimeout(n), o.removeListener(`error`, i), e(); - }, i = (e) => { - clearTimeout(n), o.removeListener(`authenticated`, r), t(e); - }; - o.state === `authenticated` ? (clearTimeout(n), e()) : (o.once(`authenticated`, r), o.once(`error`, i)); - }), await o.connect(e, t), await new Promise((n, r) => { - let i = setTimeout(() => { - r(Error(`SOCKS5 connection timeout`)); - }, 5e3), a = (r) => { - h(`SOCKS5 tunnel established to`, e, t, `via`, r), clearTimeout(i), o.removeListener(`error`, s), n(); - }, s = (e) => { - clearTimeout(i), o.removeListener(`connected`, a), r(e); - }; - o.once(`connected`, a), o.once(`error`, s); - }), a; - } - async [l](e, t) { - let { origin: r } = e; - h(`dispatching request to`, r, `via SOCKS5`); - try { - return (!this[y] || this[y].destroyed || this[y].closed) && (this[y] = new f(r, { - pipelining: e.pipelining, - connections: e.connections, - connect: async (e, t) => { - try { - let o = new i(r), s = o.hostname, c = parseInt(o.port) || (o.protocol === `https:` ? 443 : 80); - h(`establishing SOCKS5 connection to`, s, c); - let l = await this.createSocks5Connection(s, c), u = l; - o.protocol === `https:` && (a ||= p$4(`node:tls`), h(`upgrading to TLS`), u = a.connect({ - socket: l, - servername: s, - ...e.tls || {} - }), await new Promise((e, t) => { - u.once(`secureConnect`, e), u.once(`error`, t); - })), t(null, u); - } catch (e) { - h(`SOCKS5 connection error:`, e), t(e); - } - } - })), this[y][l](e, t); - } catch (e) { - if (h(`dispatch error:`, e), typeof t.onError == `function`) t.onError(e); - else throw e; - } - } - async [u]() { - this[y] && await this[y].close(); - } - async [d](e) { - this[y] && await this[y].destroy(e); - } - }; -})); -var Ee = c$3(((e, t) => { - let { kProxy: n, kClose: r, kDestroy: i, kDispatch: a } = I$1(), o = Se(), s = ye(), c = G$2(), { InvalidArgumentError: l, RequestAbortedError: u, SecureProxyConnectionError: d } = R$1(), f = K$1(), p = Z$1(), { channels: m } = H$1(), h = Te(), g = Symbol(`proxy agent`), _ = Symbol(`proxy client`), v = Symbol(`proxy headers`), y = Symbol(`request tls settings`), b = Symbol(`proxy tls settings`), x = Symbol(`connect endpoint function`), S = Symbol(`tunnel proxy`); - function C(e) { - return e === `https:` ? 443 : 80; - } - function w(e, t) { - return new s(e, t); - } - let T = () => {}; - function E(e, t) { - return t.connections === 1 ? new p(e, t) : new s(e, t); - } - var D = class extends c { - #e; - constructor(e, { headers: t = {}, connect: n, factory: r }) { - if (!e) throw new l(`Proxy URL is mandatory`); - super(), this[v] = t, r ? this.#e = r(e, { connect: n }) : this.#e = new p(e, { connect: n }); - } - [a](e, t) { - let n = t.onHeaders; - t.onHeaders = function(e, r, i) { - if (e === 407) { - typeof t.onError == `function` && t.onError(new l(`Proxy Authentication Required (407)`)); - return; - } - n && n.call(this, e, r, i); - }; - let { origin: r, path: i = `/`, headers: o = {} } = e; - if (e.path = r + i, !(`host` in o) && !(`Host` in o)) { - let { host: e } = new URL(r); - o.host = e; - } - return e.headers = { - ...this[v], - ...o - }, this.#e[a](e, t); - } - [r]() { - return this.#e.close(); - } - [i](e) { - return this.#e.destroy(e); - } - }, O = class extends c { - constructor(e) { - if (!e || typeof e == `object` && !(e instanceof URL) && !e.uri) throw new l(`Proxy uri is mandatory`); - let { clientFactory: t = w } = e; - if (typeof t != `function`) throw new l(`Proxy opts.clientFactory must be a function.`); - let { proxyTunnel: r = !0 } = e; - super(); - let i = this.#e(e), { href: a, origin: s, port: c, protocol: p, username: O, password: k, hostname: A } = i; - if (this[n] = { - uri: a, - protocol: p - }, this[y] = e.requestTls, this[b] = e.proxyTls, this[v] = e.headers || {}, this[S] = r, e.auth && e.token) throw new l(`opts.auth cannot be used in combination with opts.token`); - e.auth ? this[v][`proxy-authorization`] = `Basic ${e.auth}` : e.token ? this[v][`proxy-authorization`] = e.token : O && k && (this[v][`proxy-authorization`] = `Basic ${Buffer.from(`${decodeURIComponent(O)}:${decodeURIComponent(k)}`).toString(`base64`)}`); - let j = f({ ...e.proxyTls }); - this[x] = f({ ...e.requestTls }); - let M = e.factory || E, N = (t, r) => { - let { protocol: i } = new URL(t); - return this[n].protocol === `socks5:` || this[n].protocol === `socks:` ? new h(this[n].uri, { - headers: this[v], - connect: j, - factory: M, - username: e.username || O, - password: e.password || k, - proxyTls: e.proxyTls - }) : !this[S] && i === `http:` && this[n].protocol === `http:` ? new D(this[n].uri, { - headers: this[v], - connect: j, - factory: M - }) : M(t, r); - }; - p === `socks5:` || p === `socks:` ? this[_] = null : this[_] = t(i, { connect: j }), this[g] = new o({ - ...e, - factory: N, - connect: async (e, t) => { - if (!this[_]) { - t(new l(`Cannot establish tunnel connection without a proxy client`)); - return; - } - let n = e.host; - e.port || (n += `:${C(e.protocol)}`); - try { - let r = { - origin: s, - port: c, - path: n, - signal: e.signal, - headers: { - ...this[v], - host: e.host, - ...e.connections == null || e.connections > 0 ? { "proxy-connection": `keep-alive` } : {} - }, - servername: this[b]?.servername || A - }, { socket: i, statusCode: a } = await this[_].connect(r); - if (a !== 200) { - i.on(`error`, T).destroy(), t(new u(`Proxy response (${a}) !== 200 when HTTP Tunneling`)); - return; - } - if (m.proxyConnected.hasSubscribers && m.proxyConnected.publish({ - socket: i, - connectParams: r - }), e.protocol !== `https:`) { - t(null, i); - return; - } - let o; - o = this[y] ? this[y].servername : e.servername, this[x]({ - ...e, - servername: o, - httpSocket: i - }, t); - } catch (e) { - e.code === `ERR_TLS_CERT_ALTNAME_INVALID` ? t(new d(e)) : t(e); - } - } - }); - } - dispatch(e, t) { - let n = k(e.headers); - if (A(n), n && !(`host` in n) && !(`Host` in n)) { - let { host: t } = new URL(e.origin); - n.host = t; - } - return this[g].dispatch({ - ...e, - headers: n - }, t); - } - #e(e) { - return typeof e == `string` ? new URL(e) : e instanceof URL ? e : new URL(e.uri); - } - [r]() { - let e = [this[g].close()]; - return this[_] && e.push(this[_].close()), Promise.all(e); - } - [i]() { - let e = [this[g].destroy()]; - return this[_] && e.push(this[_].destroy()), Promise.all(e); - } - }; - function k(e) { - if (Array.isArray(e)) { - let t = {}; - for (let n = 0; n < e.length; n += 2) t[e[n]] = e[n + 1]; - return t; - } - return e; - } - function A(e) { - if (e && Object.keys(e).find((e) => e.toLowerCase() === `proxy-authorization`)) throw new l(`Proxy-Authorization should be sent in ProxyAgent constructor`); - } - t.exports = O; -})); -var De = c$3(((e, t) => { - let n = G$2(), { kClose: r, kDestroy: i, kClosed: a, kDestroyed: o, kDispatch: s, kNoProxyAgent: c, kHttpProxyAgent: l, kHttpsProxyAgent: u } = I$1(), d = Ee(), f = Se(), p = { - "http:": 80, - "https:": 443 - }; - t.exports = class extends n { - #e = null; - #t = null; - #n = null; - constructor(e = {}) { - super(), this.#n = e; - let { httpProxy: t, httpsProxy: n, noProxy: r, ...i } = e; - this[c] = new f(i); - let a = t ?? process.env.http_proxy ?? process.env.HTTP_PROXY; - a ? this[l] = new d({ - ...i, - uri: a - }) : this[l] = this[c]; - let o = n ?? process.env.https_proxy ?? process.env.HTTPS_PROXY; - o ? this[u] = new d({ - ...i, - uri: o - }) : this[u] = this[l], this.#a(); - } - [s](e, t) { - let n = new URL(e.origin); - return this.#r(n).dispatch(e, t); - } - [r]() { - return Promise.all([ - this[c].close(), - !this[l][a] && this[l].close(), - !this[u][a] && this[u].close() - ]); - } - [i](e) { - return Promise.all([ - this[c].destroy(e), - !this[l][o] && this[l].destroy(e), - !this[u][o] && this[u].destroy(e) - ]); - } - #r(e) { - let { protocol: t, host: n, port: r } = e; - return n = n.replace(/:\d*$/, ``).toLowerCase(), r = Number.parseInt(r, 10) || p[t] || 0, this.#i(n, r) ? t === `https:` ? this[u] : this[l] : this[c]; - } - #i(e, t) { - if (this.#o && this.#a(), this.#t.length === 0) return !0; - if (this.#e === `*`) return !1; - for (let n = 0; n < this.#t.length; n++) { - let r = this.#t[n]; - if (!(r.port && r.port !== t) && (e === r.hostname || e.slice(-(r.hostname.length + 1)) === `.${r.hostname}`)) return !1; - } - return !0; - } - #a() { - let e = this.#n.noProxy ?? this.#s, t = e.split(/[,\s]/), n = []; - for (let e = 0; e < t.length; e++) { - let r = t[e]; - if (!r) continue; - let i = r.match(/^(.+):(\d+)$/); - n.push({ - hostname: (i ? i[1] : r).replace(/^\*?\./, ``).toLowerCase(), - port: i ? Number.parseInt(i[2], 10) : 0 - }); - } - this.#e = e, this.#t = n; - } - get #o() { - return this.#n.noProxy === void 0 ? this.#e !== this.#s : !1; - } - get #s() { - return process.env.no_proxy ?? process.env.NO_PROXY ?? ``; - } - }; -})); -var Oe = c$3(((e, t) => { - let r = p$4(`node:assert`), { kRetryHandlerDefaultRetry: i } = I$1(), { RequestRetryError: a } = R$1(), o = U$1(), { isDisturbed: s, parseRangeHeader: c, wrapRequestBody: l } = B$1(); - function u(e) { - let t = new Date(e).getTime(); - return isNaN(t) ? 0 : t - Date.now(); - } - t.exports = class e { - constructor(t, { dispatch: n, handler: r }) { - let { retryOptions: a, ...s } = t, { retry: c, maxRetries: u, maxTimeout: d, minTimeout: f, timeoutFactor: p, methods: m, errorCodes: h, retryAfter: g, statusCodes: _, throwOnError: v } = a ?? {}; - this.error = null, this.dispatch = n, this.handler = o.wrap(r), this.opts = { - ...s, - body: l(t.body) - }, this.retryOpts = { - throwOnError: v ?? !0, - retry: c ?? e[i], - retryAfter: g ?? !0, - maxTimeout: d ?? 30 * 1e3, - minTimeout: f ?? 500, - timeoutFactor: p ?? 2, - maxRetries: u ?? 5, - methods: m ?? [ - `GET`, - `HEAD`, - `OPTIONS`, - `PUT`, - `DELETE`, - `TRACE` - ], - statusCodes: _ ?? [ - 500, - 502, - 503, - 504, - 429 - ], - errorCodes: h ?? [ - `ECONNRESET`, - `ECONNREFUSED`, - `ENOTFOUND`, - `ENETDOWN`, - `ENETUNREACH`, - `EHOSTDOWN`, - `EHOSTUNREACH`, - `EPIPE`, - `UND_ERR_SOCKET` - ] - }, this.retryCount = 0, this.retryCountCheckpoint = 0, this.headersSent = !1, this.start = 0, this.end = null, this.etag = null; - } - onResponseStartWithRetry(e, t, n, r, i) { - if (this.retryOpts.throwOnError) { - this.retryOpts.statusCodes.includes(t) === !1 ? (this.headersSent = !0, this.handler.onResponseStart?.(e, t, n, r)) : this.error = i; - return; - } - if (s(this.opts.body)) { - this.headersSent = !0, this.handler.onResponseStart?.(e, t, n, r); - return; - } - function a(a) { - if (a) { - this.headersSent = !0, this.handler.onResponseStart?.(e, t, n, r), e.resume(); - return; - } - this.error = i, e.resume(); - } - e.pause(), this.retryOpts.retry(i, { - state: { counter: this.retryCount }, - opts: { - retryOptions: this.retryOpts, - ...this.opts - } - }, a.bind(this)); - } - onRequestStart(e, t) { - this.headersSent || this.handler.onRequestStart?.(e, t); - } - onRequestUpgrade(e, t, n, r) { - this.handler.onRequestUpgrade?.(e, t, n, r); - } - static [i](e, { state: t, opts: n }, r) { - let { statusCode: i, code: a, headers: o } = e, { method: s, retryOptions: c } = n, { maxRetries: l, minTimeout: d, maxTimeout: f, timeoutFactor: p, statusCodes: m, errorCodes: h, methods: g } = c, { counter: _ } = t; - if (a && a !== `UND_ERR_REQ_RETRY` && !h.includes(a)) { - r(e); - return; - } - if (Array.isArray(g) && !g.includes(s)) { - r(e); - return; - } - if (i != null && Array.isArray(m) && !m.includes(i)) { - r(e); - return; - } - if (_ > l) { - r(e); - return; - } - let v = o?.[`retry-after`]; - v &&= (v = Number(v), Number.isNaN(v) ? u(o[`retry-after`]) : v * 1e3); - let y = Math.min(v > 0 ? v : d * p ** (_ - 1), f); - setTimeout(() => r(null), y); - } - onResponseStart(e, t, n, i) { - if (this.error = null, this.retryCount += 1, t >= 300) { - let r = new a(`Request failed`, t, { - headers: n, - data: { count: this.retryCount } - }); - this.onResponseStartWithRetry(e, t, n, i, r); - return; - } - if (this.headersSent) { - if (t !== 206 && (this.start > 0 || t !== 200)) throw new a(`server does not support the range header and the payload was partially consumed`, t, { - headers: n, - data: { count: this.retryCount } - }); - let e = c(n[`content-range`]); - if (!e) throw new a(`Content-Range mismatch`, t, { - headers: n, - data: { count: this.retryCount } - }); - if (this.etag != null && this.etag !== n.etag) throw new a(`ETag mismatch`, t, { - headers: n, - data: { count: this.retryCount } - }); - let { start: i, size: o, end: s = o ? o - 1 : null } = e; - r(this.start === i, `content-range mismatch`), r(this.end == null || this.end === s, `content-range mismatch`); - return; - } - if (this.end == null) { - if (t === 206) { - let a = c(n[`content-range`]); - if (a == null) { - this.headersSent = !0, this.handler.onResponseStart?.(e, t, n, i); - return; - } - let { start: o, size: s, end: l = s ? s - 1 : null } = a; - r(o != null && Number.isFinite(o), `content-range mismatch`), r(l != null && Number.isFinite(l), `invalid content-length`), this.start = o, this.end = l; - } - if (this.end == null) { - let e = n[`content-length`]; - this.end = e == null ? null : Number(e) - 1; - } - r(Number.isFinite(this.start)), r(this.end == null || Number.isFinite(this.end), `invalid content-length`), this.resume = !0, this.etag = n.etag == null ? null : n.etag, this.etag != null && this.etag[0] === `W` && this.etag[1] === `/` && (this.etag = null), this.headersSent = !0, this.handler.onResponseStart?.(e, t, n, i); - } else throw new a(`Request failed`, t, { - headers: n, - data: { count: this.retryCount } - }); - } - onResponseData(e, t) { - this.error || (this.start += t.length, this.handler.onResponseData?.(e, t)); - } - onResponseEnd(e, t) { - if (this.error && this.retryOpts.throwOnError) throw this.error; - if (!this.error) return this.retryCount = 0, this.handler.onResponseEnd?.(e, t); - this.retry(e); - } - retry(e) { - if (this.start !== 0) { - let e = { range: `bytes=${this.start}-${this.end ?? ``}` }; - this.etag != null && (e[`if-match`] = this.etag), this.opts = { - ...this.opts, - headers: { - ...this.opts.headers, - ...e - } - }; - } - try { - this.retryCountCheckpoint = this.retryCount, this.dispatch(this.opts, this); - } catch (t) { - this.handler.onResponseError?.(e, t); - } - } - onResponseError(e, t) { - if (e?.aborted || s(this.opts.body)) { - this.handler.onResponseError?.(e, t); - return; - } - function n(t) { - if (!t) { - this.retry(e); - return; - } - this.handler?.onResponseError?.(e, t); - } - this.retryCount - this.retryCountCheckpoint > 0 ? this.retryCount = this.retryCountCheckpoint + (this.retryCount - this.retryCountCheckpoint) : this.retryCount += 1, this.retryOpts.retry(t, { - state: { counter: this.retryCount }, - opts: { - retryOptions: this.retryOpts, - ...this.opts - } - }, n.bind(this)); - } - }; -})); -var ke = c$3(((e, t) => { - let n = W$1(), r = Oe(); - t.exports = class extends n { - #e = null; - #t = null; - constructor(e, t = {}) { - super(t), this.#e = e, this.#t = t; - } - dispatch(e, t) { - let n = new r({ - ...e, - retryOptions: this.#t - }, { - dispatch: this.#e.dispatch.bind(this.#e), - handler: t - }); - return this.#e.dispatch(e, n); - } - close() { - return this.#e.close(); - } - destroy() { - return this.#e.destroy(); - } - }; -})); -var Ae = c$3(((e, t) => { - let { InvalidArgumentError: n } = R$1(), r = Z$1(); - t.exports = class extends r { - constructor(e, t) { - if (typeof e == `string` && (e = new URL(e)), e.protocol !== `http:`) throw new n(`h2c-client: Only h2c protocol is supported`); - let { maxConcurrentStreams: r, pipelining: i, ...a } = t ?? {}, o = 100, s = 100; - if (r != null && Number.isInteger(r) && r > 0 && (o = r), i != null && Number.isInteger(i) && i > 0 && (s = i), s > o) throw new n(`h2c-client: pipelining cannot be greater than maxConcurrentStreams`); - super(e, { - ...a, - maxConcurrentStreams: o, - pipelining: s, - allowH2: !0, - useH2c: !0 - }); - } - }; -})); -var je = c$3(((e, t) => { - let r = p$4(`node:assert`), { Readable: i } = p$4(`node:stream`), { RequestAbortedError: a, NotSupportedError: o, InvalidArgumentError: s, AbortError: c } = R$1(), l = B$1(), { ReadableStreamFrom: u } = B$1(), d = Symbol(`kConsume`), f = Symbol(`kReading`), p = Symbol(`kBody`), m = Symbol(`kAbort`), h = Symbol(`kContentType`), g = Symbol(`kContentLength`), _ = Symbol(`kUsed`), v = Symbol(`kBytesRead`), y = () => {}; - var b = class extends i { - constructor({ resume: e, abort: t, contentType: n = ``, contentLength: r, highWaterMark: i = 64 * 1024 }) { - super({ - autoDestroy: !0, - read: e, - highWaterMark: i - }), this._readableState.dataEmitted = !1, this[m] = t, this[d] = null, this[v] = 0, this[p] = null, this[_] = !1, this[h] = n, this[g] = Number.isFinite(r) ? r : null, this[f] = !1; - } - _destroy(e, t) { - !e && !this._readableState.endEmitted && (e = new a()), e && this[m](), this[_] ? t(e) : setImmediate(t, e); - } - on(e, t) { - return (e === `data` || e === `readable`) && (this[f] = !0, this[_] = !0), super.on(e, t); - } - addListener(e, t) { - return this.on(e, t); - } - off(e, t) { - let n = super.off(e, t); - return (e === `data` || e === `readable`) && (this[f] = this.listenerCount(`data`) > 0 || this.listenerCount(`readable`) > 0), n; - } - removeListener(e, t) { - return this.off(e, t); - } - push(e) { - return e && (this[v] += e.length, this[d]) ? (O(this[d], e), this[f] ? super.push(e) : !0) : super.push(e); - } - text() { - return C(this, `text`); - } - json() { - return C(this, `json`); - } - blob() { - return C(this, `blob`); - } - bytes() { - return C(this, `bytes`); - } - arrayBuffer() { - return C(this, `arrayBuffer`); - } - async formData() { - throw new o(); - } - get bodyUsed() { - return l.isDisturbed(this); - } - get body() { - return this[p] || (this[p] = u(this), this[d] && (this[p].getReader(), r(this[p].locked))), this[p]; - } - dump(e) { - let t = e?.signal; - if (t != null && (typeof t != `object` || !(`aborted` in t))) return Promise.reject(new s(`signal must be an AbortSignal`)); - let n = e?.limit && Number.isFinite(e.limit) ? e.limit : 128 * 1024; - return t?.aborted ? Promise.reject(t.reason ?? new c()) : this._readableState.closeEmitted ? Promise.resolve(null) : new Promise((e, r) => { - if ((this[g] && this[g] > n || this[v] > n) && this.destroy(new c()), t) { - let n = () => { - this.destroy(t.reason ?? new c()); - }; - t.addEventListener(`abort`, n), this.on(`close`, function() { - t.removeEventListener(`abort`, n), t.aborted ? r(t.reason ?? new c()) : e(null); - }); - } else this.on(`close`, e); - this.on(`error`, y).on(`data`, () => { - this[v] > n && this.destroy(); - }).resume(); - }); - } - setEncoding(e) { - return Buffer.isEncoding(e) && (this._readableState.encoding = e), this; - } - }; - function x(e) { - return e[p]?.locked === !0 || e[d] !== null; - } - function S(e) { - return l.isDisturbed(e) || x(e); - } - function C(e, t) { - return r(!e[d]), new Promise((n, r) => { - if (S(e)) { - let t = e._readableState; - t.destroyed && t.closeEmitted === !1 ? e.on(`error`, r).on(`close`, () => { - r(TypeError(`unusable`)); - }) : r(t.errored ?? TypeError(`unusable`)); - } else queueMicrotask(() => { - e[d] = { - type: t, - stream: e, - resolve: n, - reject: r, - length: 0, - body: [] - }, e.on(`error`, function(e) { - k(this[d], e); - }).on(`close`, function() { - this[d].body !== null && k(this[d], new a()); - }), w(e[d]); - }); - }); - } - function w(e) { - if (e.body === null) return; - let { _readableState: t } = e.stream; - if (t.bufferIndex) { - let n = t.bufferIndex, r = t.buffer.length; - for (let i = n; i < r; i++) O(e, t.buffer[i]); - } else for (let n of t.buffer) O(e, n); - for (t.endEmitted ? D(this[d], this._readableState.encoding) : e.stream.on(`end`, function() { - D(this[d], this._readableState.encoding); - }), e.stream.resume(); e.stream.read() != null;); - } - function T(e, t, n) { - if (e.length === 0 || t === 0) return ``; - let r = e.length === 1 ? e[0] : Buffer.concat(e, t), i = r.length, a = i > 2 && r[0] === 239 && r[1] === 187 && r[2] === 191 ? 3 : 0; - return !n || n === `utf8` || n === `utf-8` ? r.utf8Slice(a, i) : r.subarray(a, i).toString(n); - } - function E(e, t) { - if (e.length === 0 || t === 0) return /* @__PURE__ */ new Uint8Array(); - if (e.length === 1) return new Uint8Array(e[0]); - let n = new Uint8Array(Buffer.allocUnsafeSlow(t).buffer), r = 0; - for (let t = 0; t < e.length; ++t) { - let i = e[t]; - n.set(i, r), r += i.length; - } - return n; - } - function D(e, t) { - let { type: n, body: r, resolve: i, stream: a, length: o } = e; - try { - n === `text` ? i(T(r, o, t)) : n === `json` ? i(JSON.parse(T(r, o, t))) : n === `arrayBuffer` ? i(E(r, o).buffer) : n === `blob` ? i(new Blob(r, { type: a[h] })) : n === `bytes` && i(E(r, o)), k(e); - } catch (e) { - a.destroy(e); - } - } - function O(e, t) { - e.length += t.length, e.body.push(t); - } - function k(e, t) { - e.body !== null && (t ? e.reject(t) : e.resolve(), e.type = null, e.stream = null, e.resolve = null, e.reject = null, e.length = 0, e.body = null); - } - t.exports = { - Readable: b, - chunksDecode: T - }; -})); -var Me = c$3(((e, t) => { - let r = p$4(`node:assert`), { AsyncResource: i } = p$4(`node:async_hooks`), { Readable: a } = je(), { InvalidArgumentError: o, RequestAbortedError: s } = R$1(), c = B$1(); - function l() {} - var u = class extends i { - constructor(e, t) { - if (!e || typeof e != `object`) throw new o(`invalid opts`); - let { signal: n, method: r, opaque: i, body: a, onInfo: u, responseHeaders: d, highWaterMark: f } = e; - try { - if (typeof t != `function`) throw new o(`invalid callback`); - if (f != null && (!Number.isFinite(f) || f < 0)) throw new o(`invalid highWaterMark`); - if (n && typeof n.on != `function` && typeof n.addEventListener != `function`) throw new o(`signal must be an EventEmitter or EventTarget`); - if (r === `CONNECT`) throw new o(`invalid method`); - if (u && typeof u != `function`) throw new o(`invalid onInfo callback`); - super(`UNDICI_REQUEST`); - } catch (e) { - throw c.isStream(a) && c.destroy(a.on(`error`, l), e), e; - } - this.method = r, this.responseHeaders = d || null, this.opaque = i || null, this.callback = t, this.res = null, this.abort = null, this.body = a, this.trailers = {}, this.context = null, this.onInfo = u || null, this.highWaterMark = f, this.reason = null, this.removeAbortListener = null, n?.aborted ? this.reason = n.reason ?? new s() : n && (this.removeAbortListener = c.addAbortListener(n, () => { - this.reason = n.reason ?? new s(), this.res ? c.destroy(this.res.on(`error`, l), this.reason) : this.abort && this.abort(this.reason); - })); - } - onConnect(e, t) { - if (this.reason) { - e(this.reason); - return; - } - r(this.callback), this.abort = e, this.context = t; - } - onHeaders(e, t, n, r) { - let { callback: i, opaque: o, abort: s, context: u, responseHeaders: d, highWaterMark: f } = this, p = d === `raw` ? c.parseRawHeaders(t) : c.parseHeaders(t); - if (e < 200) { - this.onInfo && this.onInfo({ - statusCode: e, - headers: p - }); - return; - } - let m = d === `raw` ? c.parseHeaders(t) : p, h = m[`content-type`], g = m[`content-length`], _ = new a({ - resume: n, - abort: s, - contentType: h, - contentLength: this.method !== `HEAD` && g ? Number(g) : null, - highWaterMark: f - }); - if (this.removeAbortListener &&= (_.on(`close`, this.removeAbortListener), null), this.callback = null, this.res = _, i !== null) try { - this.runInAsyncScope(i, null, null, { - statusCode: e, - statusText: r, - headers: p, - trailers: this.trailers, - opaque: o, - body: _, - context: u - }); - } catch (e) { - this.res = null, c.destroy(_.on(`error`, l), e), queueMicrotask(() => { - throw e; - }); - } - } - onData(e) { - return this.res.push(e); - } - onComplete(e) { - c.parseHeaders(e, this.trailers), this.res.push(null); - } - onError(e) { - let { res: t, callback: n, body: r, opaque: i } = this; - n && (this.callback = null, queueMicrotask(() => { - this.runInAsyncScope(n, null, e, { opaque: i }); - })), t && (this.res = null, queueMicrotask(() => { - c.destroy(t.on(`error`, l), e); - })), r && (this.body = null, c.isStream(r) && (r.on(`error`, l), c.destroy(r, e))), this.removeAbortListener &&= (this.removeAbortListener(), null); - } - }; - function d(e, t) { - if (t === void 0) return new Promise((t, n) => { - d.call(this, e, (e, r) => e ? n(e) : t(r)); - }); - try { - let n = new u(e, t); - this.dispatch(e, n); - } catch (n) { - if (typeof t != `function`) throw n; - let r = e?.opaque; - queueMicrotask(() => t(n, { opaque: r })); - } - } - t.exports = d, t.exports.RequestHandler = u; -})); -var Ne = c$3(((e, t) => { - let { addAbortListener: n } = B$1(), { RequestAbortedError: r } = R$1(), i = Symbol(`kListener`), a = Symbol(`kSignal`); - function o(e) { - e.abort ? e.abort(e[a]?.reason) : e.reason = e[a]?.reason ?? new r(), c(e); - } - function s(e, t) { - if (e.reason = null, e[a] = null, e[i] = null, t) { - if (t.aborted) { - o(e); - return; - } - e[a] = t, e[i] = () => { - o(e); - }, n(e[a], e[i]); - } - } - function c(e) { - e[a] && (`removeEventListener` in e[a] ? e[a].removeEventListener(`abort`, e[i]) : e[a].removeListener(`abort`, e[i]), e[a] = null, e[i] = null); - } - t.exports = { - addSignal: s, - removeSignal: c - }; -})); -var Pe = c$3(((e, t) => { - let r = p$4(`node:assert`), { finished: i } = p$4(`node:stream`), { AsyncResource: a } = p$4(`node:async_hooks`), { InvalidArgumentError: o, InvalidReturnValueError: s } = R$1(), c = B$1(), { addSignal: l, removeSignal: u } = Ne(); - function d() {} - var f = class extends a { - constructor(e, t, n) { - if (!e || typeof e != `object`) throw new o(`invalid opts`); - let { signal: r, method: i, opaque: a, body: s, onInfo: u, responseHeaders: f } = e; - try { - if (typeof n != `function`) throw new o(`invalid callback`); - if (typeof t != `function`) throw new o(`invalid factory`); - if (r && typeof r.on != `function` && typeof r.addEventListener != `function`) throw new o(`signal must be an EventEmitter or EventTarget`); - if (i === `CONNECT`) throw new o(`invalid method`); - if (u && typeof u != `function`) throw new o(`invalid onInfo callback`); - super(`UNDICI_STREAM`); - } catch (e) { - throw c.isStream(s) && c.destroy(s.on(`error`, d), e), e; - } - this.responseHeaders = f || null, this.opaque = a || null, this.factory = t, this.callback = n, this.res = null, this.abort = null, this.context = null, this.trailers = null, this.body = s, this.onInfo = u || null, c.isStream(s) && s.on(`error`, (e) => { - this.onError(e); - }), l(this, r); - } - onConnect(e, t) { - if (this.reason) { - e(this.reason); - return; - } - r(this.callback), this.abort = e, this.context = t; - } - onHeaders(e, t, n, r) { - let { factory: a, opaque: o, context: l, responseHeaders: u } = this, d = u === `raw` ? c.parseRawHeaders(t) : c.parseHeaders(t); - if (e < 200) { - this.onInfo && this.onInfo({ - statusCode: e, - headers: d - }); - return; - } - if (this.factory = null, a === null) return; - let f = this.runInAsyncScope(a, null, { - statusCode: e, - headers: d, - opaque: o, - context: l - }); - if (!f || typeof f.write != `function` || typeof f.end != `function` || typeof f.on != `function`) throw new s(`expected Writable`); - return i(f, { readable: !1 }, (e) => { - let { callback: t, res: n, opaque: r, trailers: i, abort: a } = this; - this.res = null, (e || !n?.readable) && c.destroy(n, e), this.callback = null, this.runInAsyncScope(t, null, e || null, { - opaque: r, - trailers: i - }), e && a(); - }), f.on(`drain`, n), this.res = f, (f.writableNeedDrain === void 0 ? f._writableState?.needDrain : f.writableNeedDrain) !== !0; - } - onData(e) { - let { res: t } = this; - return t ? t.write(e) : !0; - } - onComplete(e) { - let { res: t } = this; - u(this), t && (this.trailers = c.parseHeaders(e), t.end()); - } - onError(e) { - let { res: t, callback: n, opaque: r, body: i } = this; - u(this), this.factory = null, t ? (this.res = null, c.destroy(t, e)) : n && (this.callback = null, queueMicrotask(() => { - this.runInAsyncScope(n, null, e, { opaque: r }); - })), i && (this.body = null, c.destroy(i, e)); - } - }; - function p(e, t, n) { - if (n === void 0) return new Promise((n, r) => { - p.call(this, e, t, (e, t) => e ? r(e) : n(t)); - }); - try { - let r = new f(e, t, n); - this.dispatch(e, r); - } catch (t) { - if (typeof n != `function`) throw t; - let r = e?.opaque; - queueMicrotask(() => n(t, { opaque: r })); - } - } - t.exports = p; -})); -var Fe = c$3(((e, t) => { - let { Readable: r, Duplex: i, PassThrough: a } = p$4(`node:stream`), o = p$4(`node:assert`), { AsyncResource: s } = p$4(`node:async_hooks`), { InvalidArgumentError: c, InvalidReturnValueError: l, RequestAbortedError: u } = R$1(), d = B$1(), { addSignal: f, removeSignal: p } = Ne(); - function m() {} - let h = Symbol(`resume`); - var g = class extends r { - constructor() { - super({ autoDestroy: !0 }), this[h] = null; - } - _read() { - let { [h]: e } = this; - e && (this[h] = null, e()); - } - _destroy(e, t) { - this._read(), t(e); - } - }, _ = class extends r { - constructor(e) { - super({ autoDestroy: !0 }), this[h] = e; - } - _read() { - this[h](); - } - _destroy(e, t) { - !e && !this._readableState.endEmitted && (e = new u()), t(e); - } - }, v = class extends s { - constructor(e, t) { - if (!e || typeof e != `object`) throw new c(`invalid opts`); - if (typeof t != `function`) throw new c(`invalid handler`); - let { signal: n, method: r, opaque: a, onInfo: o, responseHeaders: s } = e; - if (n && typeof n.on != `function` && typeof n.addEventListener != `function`) throw new c(`signal must be an EventEmitter or EventTarget`); - if (r === `CONNECT`) throw new c(`invalid method`); - if (o && typeof o != `function`) throw new c(`invalid onInfo callback`); - super(`UNDICI_PIPELINE`), this.opaque = a || null, this.responseHeaders = s || null, this.handler = t, this.abort = null, this.context = null, this.onInfo = o || null, this.req = new g().on(`error`, m), this.ret = new i({ - readableObjectMode: e.objectMode, - autoDestroy: !0, - read: () => { - let { body: e } = this; - e?.resume && e.resume(); - }, - write: (e, t, n) => { - let { req: r } = this; - r.push(e, t) || r._readableState.destroyed ? n() : r[h] = n; - }, - destroy: (e, t) => { - let { body: n, req: r, res: i, ret: a, abort: o } = this; - !e && !a._readableState.endEmitted && (e = new u()), o && e && o(), d.destroy(n, e), d.destroy(r, e), d.destroy(i, e), p(this), t(e); - } - }).on(`prefinish`, () => { - let { req: e } = this; - e.push(null); - }), this.res = null, f(this, n); - } - onConnect(e, t) { - let { res: n } = this; - if (this.reason) { - e(this.reason); - return; - } - o(!n, `pipeline cannot be retried`), this.abort = e, this.context = t; - } - onHeaders(e, t, n) { - let { opaque: r, handler: i, context: a } = this; - if (e < 200) { - if (this.onInfo) { - let n = this.responseHeaders === `raw` ? d.parseRawHeaders(t) : d.parseHeaders(t); - this.onInfo({ - statusCode: e, - headers: n - }); - } - return; - } - this.res = new _(n); - let o; - try { - this.handler = null; - let n = this.responseHeaders === `raw` ? d.parseRawHeaders(t) : d.parseHeaders(t); - o = this.runInAsyncScope(i, null, { - statusCode: e, - headers: n, - opaque: r, - body: this.res, - context: a - }); - } catch (e) { - throw this.res.on(`error`, m), e; - } - if (!o || typeof o.on != `function`) throw new l(`expected Readable`); - o.on(`data`, (e) => { - let { ret: t, body: n } = this; - !t.push(e) && n.pause && n.pause(); - }).on(`error`, (e) => { - let { ret: t } = this; - d.destroy(t, e); - }).on(`end`, () => { - let { ret: e } = this; - e.push(null); - }).on(`close`, () => { - let { ret: e } = this; - e._readableState.ended || d.destroy(e, new u()); - }), this.body = o; - } - onData(e) { - let { res: t } = this; - return t.push(e); - } - onComplete(e) { - let { res: t } = this; - t.push(null); - } - onError(e) { - let { ret: t } = this; - this.handler = null, d.destroy(t, e); - } - }; - function y(e, t) { - try { - let n = new v(e, t); - return this.dispatch({ - ...e, - body: n.req - }, n), n.ret; - } catch (e) { - return new a().destroy(e); - } - } - t.exports = y; -})); -var Ie = c$3(((e, t) => { - let { InvalidArgumentError: r, SocketError: i } = R$1(), { AsyncResource: a } = p$4(`node:async_hooks`), o = p$4(`node:assert`), s = B$1(), { kHTTP2Stream: c } = I$1(), { addSignal: l, removeSignal: u } = Ne(); - var d = class extends a { - constructor(e, t) { - if (!e || typeof e != `object`) throw new r(`invalid opts`); - if (typeof t != `function`) throw new r(`invalid callback`); - let { signal: n, opaque: i, responseHeaders: a } = e; - if (n && typeof n.on != `function` && typeof n.addEventListener != `function`) throw new r(`signal must be an EventEmitter or EventTarget`); - super(`UNDICI_UPGRADE`), this.responseHeaders = a || null, this.opaque = i || null, this.callback = t, this.abort = null, this.context = null, l(this, n); - } - onConnect(e, t) { - if (this.reason) { - e(this.reason); - return; - } - o(this.callback), this.abort = e, this.context = null; - } - onHeaders() { - throw new i(`bad upgrade`, null); - } - onUpgrade(e, t, n) { - o(n[c] === !0 ? e === 200 : e === 101); - let { callback: r, opaque: i, context: a } = this; - u(this), this.callback = null; - let l = this.responseHeaders === `raw` ? s.parseRawHeaders(t) : s.parseHeaders(t); - this.runInAsyncScope(r, null, null, { - headers: l, - socket: n, - opaque: i, - context: a - }); - } - onError(e) { - let { callback: t, opaque: n } = this; - u(this), t && (this.callback = null, queueMicrotask(() => { - this.runInAsyncScope(t, null, e, { opaque: n }); - })); - } - }; - function f(e, t) { - if (t === void 0) return new Promise((t, n) => { - f.call(this, e, (e, r) => e ? n(e) : t(r)); - }); - try { - let n = new d(e, t), r = { - ...e, - method: e.method || `GET`, - upgrade: e.protocol || `Websocket` - }; - this.dispatch(r, n); - } catch (n) { - if (typeof t != `function`) throw n; - let r = e?.opaque; - queueMicrotask(() => t(n, { opaque: r })); - } - } - t.exports = f; -})); -var Le = c$3(((e, t) => { - let r = p$4(`node:assert`), { AsyncResource: i } = p$4(`node:async_hooks`), { InvalidArgumentError: a, SocketError: o } = R$1(), s = B$1(), { addSignal: c, removeSignal: l } = Ne(); - var u = class extends i { - constructor(e, t) { - if (!e || typeof e != `object`) throw new a(`invalid opts`); - if (typeof t != `function`) throw new a(`invalid callback`); - let { signal: n, opaque: r, responseHeaders: i } = e; - if (n && typeof n.on != `function` && typeof n.addEventListener != `function`) throw new a(`signal must be an EventEmitter or EventTarget`); - super(`UNDICI_CONNECT`), this.opaque = r || null, this.responseHeaders = i || null, this.callback = t, this.abort = null, c(this, n); - } - onConnect(e, t) { - if (this.reason) { - e(this.reason); - return; - } - r(this.callback), this.abort = e, this.context = t; - } - onHeaders() { - throw new o(`bad connect`, null); - } - onUpgrade(e, t, n) { - let { callback: r, opaque: i, context: a } = this; - l(this), this.callback = null; - let o = t; - o != null && (o = this.responseHeaders === `raw` ? s.parseRawHeaders(t) : s.parseHeaders(t)), this.runInAsyncScope(r, null, null, { - statusCode: e, - headers: o, - socket: n, - opaque: i, - context: a - }); - } - onError(e) { - let { callback: t, opaque: n } = this; - l(this), t && (this.callback = null, queueMicrotask(() => { - this.runInAsyncScope(t, null, e, { opaque: n }); - })); - } - }; - function d(e, t) { - if (t === void 0) return new Promise((t, n) => { - d.call(this, e, (e, r) => e ? n(e) : t(r)); - }); - try { - let n = new u(e, t), r = { - ...e, - method: `CONNECT` - }; - this.dispatch(r, n); - } catch (n) { - if (typeof t != `function`) throw n; - let r = e?.opaque; - queueMicrotask(() => t(n, { opaque: r })); - } - } - t.exports = d; -})); -var Re = c$3(((e, t) => { - t.exports.request = Me(), t.exports.stream = Pe(), t.exports.pipeline = Fe(), t.exports.upgrade = Ie(), t.exports.connect = Le(); -})); -var ze = c$3(((e, t) => { - let { UndiciError: n } = R$1(), r = Symbol.for(`undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED`); - t.exports = { MockNotMatchedError: class extends n { - constructor(e) { - super(e), this.name = `MockNotMatchedError`, this.message = e || `The request does not match any registered mock dispatches`, this.code = `UND_MOCK_ERR_MOCK_NOT_MATCHED`; - } - static [Symbol.hasInstance](e) { - return e && e[r] === !0; - } - get [r]() { - return !0; - } - } }; -})); -var Be = c$3(((e, t) => { - t.exports = { - kAgent: Symbol(`agent`), - kOptions: Symbol(`options`), - kFactory: Symbol(`factory`), - kDispatches: Symbol(`dispatches`), - kDispatchKey: Symbol(`dispatch key`), - kDefaultHeaders: Symbol(`default headers`), - kDefaultTrailers: Symbol(`default trailers`), - kContentLength: Symbol(`content length`), - kMockAgent: Symbol(`mock agent`), - kMockAgentSet: Symbol(`mock agent set`), - kMockAgentGet: Symbol(`mock agent get`), - kMockDispatch: Symbol(`mock dispatch`), - kClose: Symbol(`close`), - kOriginalClose: Symbol(`original agent close`), - kOriginalDispatch: Symbol(`original dispatch`), - kOrigin: Symbol(`origin`), - kIsMockActive: Symbol(`is mock active`), - kNetConnect: Symbol(`net connect`), - kGetNetConnect: Symbol(`get net connect`), - kConnected: Symbol(`connected`), - kIgnoreTrailingSlash: Symbol(`ignore trailing slash`), - kMockAgentMockCallHistoryInstance: Symbol(`mock agent mock call history name`), - kMockAgentRegisterCallHistory: Symbol(`mock agent register mock call history`), - kMockAgentAddCallHistoryLog: Symbol(`mock agent add call history log`), - kMockAgentIsCallHistoryEnabled: Symbol(`mock agent is call history enabled`), - kMockAgentAcceptsNonStandardSearchParameters: Symbol(`mock agent accepts non standard search parameters`), - kMockCallHistoryAddLog: Symbol(`mock call history add log`), - kTotalDispatchCount: Symbol(`total dispatch count`) - }; -})); -var Ve = c$3(((e, t) => { - let { MockNotMatchedError: r } = ze(), { kDispatches: i, kMockAgent: a, kOriginalDispatch: o, kOrigin: s, kGetNetConnect: c, kTotalDispatchCount: l } = Be(), { serializePathWithQuery: u } = B$1(), { STATUS_CODES: d } = p$4(`node:http`), { types: { isPromise: f } } = p$4(`node:util`), { InvalidArgumentError: p } = R$1(); - function m(e, t) { - return typeof e == `string` ? e === t : e instanceof RegExp ? e.test(t) : typeof e == `function` ? e(t) === !0 : !1; - } - function h(e) { - return Object.fromEntries(Object.entries(e).map(([e, t]) => [e.toLocaleLowerCase(), t])); - } - function g(e, t) { - if (Array.isArray(e)) { - for (let n = 0; n < e.length; n += 2) if (e[n].toLocaleLowerCase() === t.toLocaleLowerCase()) return e[n + 1]; - return; - } else if (typeof e.get == `function`) return e.get(t); - else return h(e)[t.toLocaleLowerCase()]; - } - function _(e) { - let t = e.slice(), n = []; - for (let e = 0; e < t.length; e += 2) n.push([t[e], t[e + 1]]); - return Object.fromEntries(n); - } - function v(e, t) { - if (typeof e.headers == `function`) return Array.isArray(t) && (t = _(t)), e.headers(t ? h(t) : {}); - if (e.headers === void 0) return !0; - if (typeof t != `object` || typeof e.headers != `object`) return !1; - for (let [n, r] of Object.entries(e.headers)) if (!m(r, g(t, n))) return !1; - return !0; - } - function y(e) { - if (typeof e != `string`) return e; - let t = new URLSearchParams(e), n = new URLSearchParams(); - for (let [e, r] of t.entries()) { - if (e = e.replace(`[]`, ``), /^(['"]).*\1$/.test(r)) { - n.append(e, r); - continue; - } - if (r.includes(`,`)) { - let t = r.split(`,`); - for (let r of t) n.append(e, r); - continue; - } - n.append(e, r); - } - return n; - } - function b(e) { - if (typeof e != `string`) return e; - let t = e.split(`?`, 3); - if (t.length !== 2) return e; - let n = new URLSearchParams(t.pop()); - return n.sort(), [...t, n.toString()].join(`?`); - } - function x(e, { path: t, method: n, body: r, headers: i }) { - let a = m(e.path, t), o = m(e.method, n), s = e.body === void 0 ? !0 : m(e.body, r), c = v(e, i); - return a && o && s && c; - } - function S(e) { - return Buffer.isBuffer(e) || e instanceof Uint8Array || e instanceof ArrayBuffer ? e : typeof e == `object` ? JSON.stringify(e) : e ? e.toString() : ``; - } - function C(e, t) { - let n = t.query ? u(t.path, t.query) : t.path, i = typeof n == `string` ? b(n) : n, a = E(i), o = e.filter(({ consumed: e }) => !e).filter(({ path: e, ignoreTrailingSlash: t }) => t ? m(E(b(e)), a) : m(b(e), i)); - if (o.length === 0) throw new r(`Mock dispatch not matched for path '${i}'`); - if (o = o.filter(({ method: e }) => m(e, t.method)), o.length === 0) throw new r(`Mock dispatch not matched for method '${t.method}' on path '${i}'`); - if (o = o.filter(({ body: e }) => e === void 0 ? !0 : m(e, t.body)), o.length === 0) throw new r(`Mock dispatch not matched for body '${t.body}' on path '${i}'`); - if (o = o.filter((e) => v(e, t.headers)), o.length === 0) throw new r(`Mock dispatch not matched for headers '${typeof t.headers == `object` ? JSON.stringify(t.headers) : t.headers}' on path '${i}'`); - return o[0]; - } - function w(e, t, n, r) { - let i = { - timesInvoked: 0, - times: 1, - persist: !1, - consumed: !1, - ...r - }, a = typeof n == `function` ? { callback: n } : { ...n }, o = { - ...i, - ...t, - pending: !0, - data: { - error: null, - ...a - } - }; - return e.push(o), e[l] = (e[l] || 0) + 1, o; - } - function T(e, t) { - let n = e.findIndex((e) => e.consumed ? x(e, t) : !1); - n !== -1 && e.splice(n, 1); - } - function E(e) { - for (; e.endsWith(`/`);) e = e.slice(0, -1); - return e.length === 0 && (e = `/`), e; - } - function D(e) { - let { path: t, method: n, body: r, headers: i, query: a } = e; - return { - path: t, - method: n, - body: r, - headers: i, - query: a - }; - } - function O(e) { - let t = Object.keys(e), n = []; - for (let r = 0; r < t.length; ++r) { - let i = t[r], a = e[i], o = Buffer.from(`${i}`); - if (Array.isArray(a)) for (let e = 0; e < a.length; ++e) n.push(o, Buffer.from(`${a[e]}`)); - else n.push(o, Buffer.from(`${a}`)); - } - return n; - } - function k(e) { - return d[e] || `unknown`; - } - async function A(e) { - let t = []; - for await (let n of e) t.push(n); - return Buffer.concat(t).toString(`utf8`); - } - function j(e, t) { - let n = D(e), r = C(this[i], n); - r.timesInvoked++, r.data.callback && (r.data = { - ...r.data, - ...r.data.callback(e) - }); - let { data: { statusCode: a, data: o, headers: s, trailers: c, error: l }, delay: u, persist: d } = r, { timesInvoked: p, times: m } = r; - if (r.consumed = !d && p >= m, r.pending = p < m, l !== null) return T(this[i], n), t.onError(l), !0; - let h = !1, g = null; - function v(e) { - h || (h = !0, g !== null && (clearTimeout(g), g = null), t.onError(e)); - } - t.onConnect?.(v, null), typeof u == `number` && u > 0 ? g = setTimeout(() => { - g = null, y(this[i]); - }, u) : y(this[i]); - function y(r, i = o) { - if (h) return; - let l = Array.isArray(e.headers) ? _(e.headers) : e.headers, u = typeof i == `function` ? i({ - ...e, - headers: l - }) : i; - if (f(u)) return u.then((e) => y(r, e)); - if (h) return; - let d = S(u), p = O(s), m = O(c); - t.onHeaders?.(a, p, b, k(a)), t.onData?.(Buffer.from(d)), t.onComplete?.(m), T(r, n); - } - function b() {} - return !0; - } - function M() { - let e = this[a], t = this[s], n = this[o]; - return function(a, o) { - if (e.isMockActive) try { - j.call(this, a, o); - } catch (s) { - if (s.code === `UND_MOCK_ERR_MOCK_NOT_MATCHED`) { - let u = e[c](), d = this[i][l] || this[i].length, f = `, ${this[i].filter(({ consumed: e }) => !e).length} interceptor(s) remaining out of ${d} defined`; - if (u === !1) throw new r(`${s.message}: subsequent request to origin ${t} was not allowed (net.connect disabled)${f}`); - if (N(u, t)) n.call(this, a, o); - else throw new r(`${s.message}: subsequent request to origin ${t} was not allowed (net.connect is not enabled for this origin)${f}`); - } else throw s; - } - else n.call(this, a, o); - }; - } - function N(e, t) { - let n = new URL(t); - return e === !0 ? !0 : !!(Array.isArray(e) && e.some((e) => m(e, n.host))); - } - function P(e) { - return typeof e != `string` && !(e instanceof URL) ? e : e instanceof URL ? e.origin : e.toLowerCase(); - } - function F(e) { - let { agent: t, ...n } = e; - if (`enableCallHistory` in n && typeof n.enableCallHistory != `boolean`) throw new p(`options.enableCallHistory must to be a boolean`); - if (`acceptNonStandardSearchParameters` in n && typeof n.acceptNonStandardSearchParameters != `boolean`) throw new p(`options.acceptNonStandardSearchParameters must to be a boolean`); - if (`ignoreTrailingSlash` in n && typeof n.ignoreTrailingSlash != `boolean`) throw new p(`options.ignoreTrailingSlash must to be a boolean`); - return n; - } - t.exports = { - getResponseData: S, - getMockDispatch: C, - addMockDispatch: w, - deleteMockDispatch: T, - buildKey: D, - generateKeyValues: O, - matchValue: m, - getResponse: A, - getStatusText: k, - mockDispatch: j, - buildMockDispatch: M, - checkNetConnect: N, - buildAndValidateMockOptions: F, - getHeaderByName: g, - buildHeadersFromArray: _, - normalizeSearchParams: y, - normalizeOrigin: P - }; -})); -var He = c$3(((e, t) => { - let { getResponseData: n, buildKey: r, addMockDispatch: i } = Ve(), { kDispatches: a, kDispatchKey: o, kDefaultHeaders: s, kDefaultTrailers: c, kContentLength: l, kMockDispatch: u, kIgnoreTrailingSlash: d } = Be(), { InvalidArgumentError: f } = R$1(), { serializePathWithQuery: p } = B$1(); - var m = class { - constructor(e) { - this[u] = e; - } - delay(e) { - if (typeof e != `number` || !Number.isInteger(e) || e <= 0) throw new f(`waitInMs must be a valid integer > 0`); - return this[u].delay = e, this; - } - persist() { - return this[u].persist = !0, this; - } - times(e) { - if (typeof e != `number` || !Number.isInteger(e) || e <= 0) throw new f(`repeatTimes must be a valid integer > 0`); - return this[u].times = e, this; - } - }, h = class { - constructor(e, t) { - if (typeof e != `object`) throw new f(`opts must be an object`); - if (e.path === void 0) throw new f(`opts.path must be defined`); - if (e.method === void 0 && (e.method = `GET`), typeof e.path == `string`) if (e.query) e.path = p(e.path, e.query); - else { - let t = new URL(e.path, `data://`); - e.path = t.pathname + t.search; - } - typeof e.method == `string` && (e.method = e.method.toUpperCase()), this[o] = r(e), this[a] = t, this[d] = e.ignoreTrailingSlash ?? !1, this[s] = {}, this[c] = {}, this[l] = !1; - } - createMockScopeDispatchData({ statusCode: e, data: t, responseOptions: r }) { - let i = n(t), a = this[l] ? { "content-length": i.length } : {}; - return { - statusCode: e, - data: t, - headers: { - ...this[s], - ...a, - ...r.headers - }, - trailers: { - ...this[c], - ...r.trailers - } - }; - } - validateReplyParameters(e) { - if (e.statusCode === void 0) throw new f(`statusCode must be defined`); - if (typeof e.responseOptions != `object` || e.responseOptions === null) throw new f(`responseOptions must be an object`); - } - reply(e) { - if (typeof e == `function`) return new m(i(this[a], this[o], (t) => { - let n = e(t); - if (typeof n != `object` || !n) throw new f(`reply options callback must return an object`); - let r = { - data: ``, - responseOptions: {}, - ...n - }; - return this.validateReplyParameters(r), { ...this.createMockScopeDispatchData(r) }; - }, { ignoreTrailingSlash: this[d] })); - let t = { - statusCode: e, - data: arguments[1] === void 0 ? `` : arguments[1], - responseOptions: arguments[2] === void 0 ? {} : arguments[2] - }; - this.validateReplyParameters(t); - let n = this.createMockScopeDispatchData(t); - return new m(i(this[a], this[o], n, { ignoreTrailingSlash: this[d] })); - } - replyWithError(e) { - if (e === void 0) throw new f(`error must be defined`); - return new m(i(this[a], this[o], { error: e }, { ignoreTrailingSlash: this[d] })); - } - defaultReplyHeaders(e) { - if (e === void 0) throw new f(`headers must be defined`); - return this[s] = e, this; - } - defaultReplyTrailers(e) { - if (e === void 0) throw new f(`trailers must be defined`); - return this[c] = e, this; - } - replyContentLength() { - return this[l] = !0, this; - } - }; - t.exports.MockInterceptor = h, t.exports.MockScope = m; -})); -var Ue = c$3(((e, t) => { - let { promisify: r } = p$4(`node:util`), i = Z$1(), { buildMockDispatch: a } = Ve(), { kDispatches: o, kMockAgent: s, kClose: c, kOriginalClose: l, kOrigin: u, kOriginalDispatch: d, kConnected: f, kIgnoreTrailingSlash: p } = Be(), { MockInterceptor: m } = He(), h = I$1(), { InvalidArgumentError: g } = R$1(); - t.exports = class extends i { - constructor(e, t) { - if (!t || !t.agent || typeof t.agent.dispatch != `function`) throw new g(`Argument opts.agent must implement Agent`); - super(e, t), this[s] = t.agent, this[u] = e, this[p] = t.ignoreTrailingSlash ?? !1, this[o] = [], this[f] = 1, this[d] = this.dispatch, this[l] = this.close.bind(this), this.dispatch = a.call(this), this.close = this[c]; - } - get [h.kConnected]() { - return this[f]; - } - intercept(e) { - return new m(e && { - ignoreTrailingSlash: this[p], - ...e - }, this[o]); - } - cleanMocks() { - this[o] = []; - } - async [c]() { - await r(this[l])(), this[f] = 0, this[s][h.kClients].delete(this[u]); - } - }; -})); -var We = c$3(((e, t) => { - let { kMockCallHistoryAddLog: n } = Be(), { InvalidArgumentError: r } = R$1(); - function i(e, t, n, i, a) { - switch (t.operator) { - case `OR`: return i.push(...n(e, a)), i; - case `AND`: return n(e, i); - default: throw new r(`options.operator must to be a case insensitive string equal to 'OR' or 'AND'`); - } - } - function a(e = {}) { - let t = {}; - if (`operator` in e) { - if (typeof e.operator != `string` || e.operator.toUpperCase() !== `OR` && e.operator.toUpperCase() !== `AND`) throw new r(`options.operator must to be a case insensitive string equal to 'OR' or 'AND'`); - return { - ...t, - operator: e.operator.toUpperCase() - }; - } - return t; - } - function o(e) { - return (t, n) => { - if (typeof t == `string` || t == null) return n.filter((n) => n[e] === t); - if (t instanceof RegExp) return n.filter((n) => t.test(n[e])); - throw new r(`${e} parameter should be one of string, regexp, undefined or null`); - }; - } - function s(e) { - try { - let t = new URL(e.path, e.origin); - return t.search.length === 0 && (t.search = new URLSearchParams(e.query).toString()), t; - } catch (e) { - throw new r(`An error occurred when computing MockCallHistoryLog.url`, { cause: e }); - } - } - var c = class { - constructor(e = {}) { - this.body = e.body, this.headers = e.headers, this.method = e.method; - let t = s(e); - this.fullUrl = t.toString(), this.origin = t.origin, this.path = t.pathname, this.searchParams = Object.fromEntries(t.searchParams), this.protocol = t.protocol, this.host = t.host, this.port = t.port, this.hash = t.hash; - } - toMap() { - return /* @__PURE__ */ new Map([ - [`protocol`, this.protocol], - [`host`, this.host], - [`port`, this.port], - [`origin`, this.origin], - [`path`, this.path], - [`hash`, this.hash], - [`searchParams`, this.searchParams], - [`fullUrl`, this.fullUrl], - [`method`, this.method], - [`body`, this.body], - [`headers`, this.headers] - ]); - } - toString() { - let e = { - betweenKeyValueSeparator: `->`, - betweenPairSeparator: `|` - }, t = ``; - return this.toMap().forEach((n, r) => { - (typeof n == `string` || n == null) && (t = `${t}${r}${e.betweenKeyValueSeparator}${n}${e.betweenPairSeparator}`), (typeof n == `object` && n || Array.isArray(n)) && (t = `${t}${r}${e.betweenKeyValueSeparator}${JSON.stringify(n)}${e.betweenPairSeparator}`); - }), t.slice(0, -1); - } - }, l = class { - logs = []; - calls() { - return this.logs; - } - firstCall() { - return this.logs.at(0); - } - lastCall() { - return this.logs.at(-1); - } - nthCall(e) { - if (typeof e != `number`) throw new r(`nthCall must be called with a number`); - if (!Number.isInteger(e)) throw new r(`nthCall must be called with an integer`); - if (Math.sign(e) !== 1) throw new r(`nthCall must be called with a positive value. use firstCall or lastCall instead`); - return this.logs.at(e - 1); - } - filterCalls(e, t) { - if (this.logs.length === 0) return this.logs; - if (typeof e == `function`) return this.logs.filter(e); - if (e instanceof RegExp) return this.logs.filter((t) => e.test(t.toString())); - if (typeof e == `object` && e) { - if (Object.keys(e).length === 0) return this.logs; - let n = { - operator: `OR`, - ...a(t) - }, r = n.operator === `AND` ? this.logs : []; - return `protocol` in e && (r = i(e.protocol, n, this.filterCallsByProtocol, r, this.logs)), `host` in e && (r = i(e.host, n, this.filterCallsByHost, r, this.logs)), `port` in e && (r = i(e.port, n, this.filterCallsByPort, r, this.logs)), `origin` in e && (r = i(e.origin, n, this.filterCallsByOrigin, r, this.logs)), `path` in e && (r = i(e.path, n, this.filterCallsByPath, r, this.logs)), `hash` in e && (r = i(e.hash, n, this.filterCallsByHash, r, this.logs)), `fullUrl` in e && (r = i(e.fullUrl, n, this.filterCallsByFullUrl, r, this.logs)), `method` in e && (r = i(e.method, n, this.filterCallsByMethod, r, this.logs)), [...new Set(r)]; - } - throw new r(`criteria parameter should be one of function, regexp, or object`); - } - filterCallsByProtocol = o.call(this, `protocol`); - filterCallsByHost = o.call(this, `host`); - filterCallsByPort = o.call(this, `port`); - filterCallsByOrigin = o.call(this, `origin`); - filterCallsByPath = o.call(this, `path`); - filterCallsByHash = o.call(this, `hash`); - filterCallsByFullUrl = o.call(this, `fullUrl`); - filterCallsByMethod = o.call(this, `method`); - clear() { - this.logs = []; - } - [n](e) { - let t = new c(e); - return this.logs.push(t), t; - } - *[Symbol.iterator]() { - for (let e of this.calls()) yield e; - } - }; - t.exports.MockCallHistory = l, t.exports.MockCallHistoryLog = c; -})); -var Ge = c$3(((e, t) => { - let { promisify: r } = p$4(`node:util`), i = ye(), { buildMockDispatch: a } = Ve(), { kDispatches: o, kMockAgent: s, kClose: c, kOriginalClose: l, kOrigin: u, kOriginalDispatch: d, kConnected: f, kIgnoreTrailingSlash: p } = Be(), { MockInterceptor: m } = He(), h = I$1(), { InvalidArgumentError: g } = R$1(); - t.exports = class extends i { - constructor(e, t) { - if (!t || !t.agent || typeof t.agent.dispatch != `function`) throw new g(`Argument opts.agent must implement Agent`); - super(e, t), this[s] = t.agent, this[u] = e, this[p] = t.ignoreTrailingSlash ?? !1, this[o] = [], this[f] = 1, this[d] = this.dispatch, this[l] = this.close.bind(this), this.dispatch = a.call(this), this.close = this[c]; - } - get [h.kConnected]() { - return this[f]; - } - intercept(e) { - return new m(e && { - ignoreTrailingSlash: this[p], - ...e - }, this[o]); - } - cleanMocks() { - this[o] = []; - } - async [c]() { - await r(this[l])(), this[f] = 0, this[s][h.kClients].delete(this[u]); - } - }; -})); -var Ke = c$3(((e, t) => { - let { Transform: r } = p$4(`node:stream`), { Console: i } = p$4(`node:console`), a = process.versions.icu ? `✅` : `Y `, o = process.versions.icu ? `❌` : `N `; - t.exports = class { - constructor({ disableColors: e } = {}) { - this.transform = new r({ transform(e, t, n) { - n(null, e); - } }), this.logger = new i({ - stdout: this.transform, - inspectOptions: { colors: !e && !process.env.CI } - }); - } - format(e) { - let t = e.map(({ method: e, path: t, data: { statusCode: n }, persist: r, times: i, timesInvoked: s, origin: c }) => ({ - Method: e, - Origin: c, - Path: t, - "Status code": n, - Persistent: r ? a : o, - Invocations: s, - Remaining: r ? Infinity : i - s - })); - return this.logger.table(t), this.transform.read().toString(); - } - }; -})); -var qe = c$3(((e, t) => { - let { kClients: n } = I$1(), r = Se(), { kAgent: i, kMockAgentSet: a, kMockAgentGet: o, kDispatches: s, kIsMockActive: c, kNetConnect: l, kGetNetConnect: u, kOptions: d, kFactory: f, kMockAgentRegisterCallHistory: p, kMockAgentIsCallHistoryEnabled: m, kMockAgentAddCallHistoryLog: h, kMockAgentMockCallHistoryInstance: g, kMockAgentAcceptsNonStandardSearchParameters: _, kMockCallHistoryAddLog: v, kIgnoreTrailingSlash: y } = Be(), b = Ue(), x = Ge(), { matchValue: S, normalizeSearchParams: C, buildAndValidateMockOptions: w, normalizeOrigin: T } = Ve(), { InvalidArgumentError: E, UndiciError: D } = R$1(), O = W$1(), k = Ke(), { MockCallHistory: A } = We(); - t.exports = class extends O { - constructor(e = {}) { - super(e); - let t = w(e); - if (this[l] = !0, this[c] = !0, this[m] = t.enableCallHistory ?? !1, this[_] = t.acceptNonStandardSearchParameters ?? !1, this[y] = t.ignoreTrailingSlash ?? !1, e?.agent && typeof e.agent.dispatch != `function`) throw new E(`Argument opts.agent must implement Agent`); - let a = e?.agent ? e.agent : new r(e); - this[i] = a, this[n] = a[n], this[d] = t, this[m] && this[p](); - } - get(e) { - let t = T(e), n = this[y] ? t.replace(/\/$/, ``) : t, r = this[o](n); - return r || (r = this[f](n), this[a](n, r)), r; - } - dispatch(e, t) { - e.origin = T(e.origin), this.get(e.origin), this[h](e); - let n = this[_], r = { ...e }; - if (n && r.path) { - let [e, t] = r.path.split(`?`); - r.path = `${e}?${C(t, n)}`; - } - return this[i].dispatch(r, t); - } - async close() { - this.clearCallHistory(), await this[i].close(), this[n].clear(); - } - deactivate() { - this[c] = !1; - } - activate() { - this[c] = !0; - } - enableNetConnect(e) { - if (typeof e == `string` || typeof e == `function` || e instanceof RegExp) Array.isArray(this[l]) ? this[l].push(e) : this[l] = [e]; - else if (e === void 0) this[l] = !0; - else throw new E(`Unsupported matcher. Must be one of String|Function|RegExp.`); - } - disableNetConnect() { - this[l] = !1; - } - enableCallHistory() { - return this[m] = !0, this; - } - disableCallHistory() { - return this[m] = !1, this; - } - getCallHistory() { - return this[g]; - } - clearCallHistory() { - this[g] !== void 0 && this[g].clear(); - } - get isMockActive() { - return this[c]; - } - [p]() { - this[g] === void 0 && (this[g] = new A()); - } - [h](e) { - this[m] && (this[p](), this[g][v](e)); - } - [a](e, t) { - this[n].set(e, { - count: 0, - dispatcher: t - }); - } - [f](e) { - let t = Object.assign({ agent: this }, this[d]); - return this[d] && this[d].connections === 1 ? new b(e, t) : new x(e, t); - } - [o](e) { - let t = this[n].get(e); - if (t?.dispatcher) return t.dispatcher; - if (typeof e != `string`) { - let t = this[f](`http://localhost:9999`); - return this[a](e, t), t; - } - for (let [t, r] of Array.from(this[n])) if (r && typeof t != `string` && S(t, e)) { - let t = this[f](e); - return this[a](e, t), t[s] = r.dispatcher[s], t; - } - } - [u]() { - return this[l]; - } - pendingInterceptors() { - let e = this[n]; - return Array.from(e.entries()).flatMap(([e, t]) => t.dispatcher[s].map((t) => ({ - ...t, - origin: e - }))).filter(({ pending: e }) => e); - } - assertNoPendingInterceptors({ pendingInterceptorsFormatter: e = new k() } = {}) { - let t = this.pendingInterceptors(); - if (t.length !== 0) throw new D(t.length === 1 ? `1 interceptor is pending:\n\n${e.format(t)}`.trim() : `${t.length} interceptors are pending:\n\n${e.format(t)}`.trim()); - } - }; -})); -var Je = c$3(((e, t) => { - let { InvalidArgumentError: r } = R$1(), { runtimeFeatures: i } = ue(); - function a(e = {}) { - let { ignoreHeaders: t = [], excludeHeaders: n = [], matchHeaders: r = [], caseSensitive: i = !1 } = e; - return { - ignore: new Set(t.map((e) => i ? e : e.toLowerCase())), - exclude: new Set(n.map((e) => i ? e : e.toLowerCase())), - match: new Set(r.map((e) => i ? e : e.toLowerCase())) - }; - } - let o = i.has(`crypto`) ? p$4(`node:crypto`) : null, s = o?.hash ? (e) => o.hash(`sha256`, e, `base64url`) : (e) => Buffer.from(e).toString(`base64url`); - function c(e) { - return Array.isArray(e) && (e.length & 1) == 0; - } - function l(e = []) { - return e.length === 0 ? () => !1 : function(t) { - let n; - for (let r of e) if (typeof r == `string`) { - if (n ||= t.toLowerCase(), n.includes(r.toLowerCase())) return !0; - } else if (r instanceof RegExp && r.test(t)) return !0; - return !1; - }; - } - function u(e) { - let t = {}; - if (!e) return t; - if (c(e)) { - for (let n = 0; n < e.length; n += 2) { - let r = e[n], i = e[n + 1]; - if (r && i !== void 0) { - let e = Buffer.isBuffer(r) ? r.toString() : r, n = Buffer.isBuffer(i) ? i.toString() : i; - t[e.toLowerCase()] = n; - } - } - return t; - } - if (e && typeof e == `object`) for (let [n, r] of Object.entries(e)) n && typeof n == `string` && (t[n.toLowerCase()] = Array.isArray(r) ? r.join(`, `) : String(r)); - return t; - } - let d = [ - `record`, - `playback`, - `update` - ]; - function f(e) { - if (!d.includes(e)) throw new r(`Invalid snapshot mode: ${e}. Must be one of: ${d.join(`, `)}`); - } - t.exports = { - createHeaderFilters: a, - hashId: s, - isUndiciHeaders: c, - normalizeHeaders: u, - isUrlExcludedFactory: l, - validateSnapshotMode: f - }; -})); -var Ye = c$3(((e, t) => { - let { writeFile: r, readFile: i, mkdir: a } = p$4(`node:fs/promises`), { dirname: o, resolve: s } = p$4(`node:path`), { setTimeout: c, clearTimeout: l } = p$4(`node:timers`), { InvalidArgumentError: u, UndiciError: d } = R$1(), { hashId: f, isUrlExcludedFactory: p, normalizeHeaders: m, createHeaderFilters: h } = Je(); - function g(e, t, n = {}) { - let r = new URL(e.path, e.origin), i = e._normalizedHeaders || m(e.headers); - return e._normalizedHeaders ||= i, { - method: e.method || `GET`, - url: n.matchQuery === !1 ? `${r.origin}${r.pathname}` : r.toString(), - headers: _(i, t, n), - body: n.matchBody !== !1 && e.body ? String(e.body) : `` - }; - } - function _(e, t, n = {}) { - if (!e || typeof e != `object`) return {}; - let { caseSensitive: r = !1 } = n, i = {}, { ignore: a, exclude: o, match: s } = t; - for (let [t, n] of Object.entries(e)) { - let e = r ? t : t.toLowerCase(); - o.has(e) || a.has(e) || s.size !== 0 && !s.has(e) || (i[e] = n); - } - return i; - } - function v(e, t, n = {}) { - if (!e || typeof e != `object`) return {}; - let { caseSensitive: r = !1 } = n, i = {}, { exclude: a } = t; - for (let [t, n] of Object.entries(e)) { - let e = r ? t : t.toLowerCase(); - a.has(e) || (i[e] = n); - } - return i; - } - function y(e) { - let t = [e.method, e.url]; - if (e.headers && typeof e.headers == `object`) { - let n = Object.keys(e.headers).sort(); - for (let r of n) { - let n = Array.isArray(e.headers[r]) ? e.headers[r] : [e.headers[r]]; - t.push(r); - for (let e of n.sort()) t.push(String(e)); - } - } - return t.push(e.body), f(t.join(`|`)); - } - t.exports = { - SnapshotRecorder: class { - #e; - #t; - #n = /* @__PURE__ */ new Map(); - #r; - #i = Infinity; - #a = !1; - #o; - constructor(e = {}) { - this.#r = e.snapshotPath, this.#i = e.maxSnapshots || Infinity, this.#a = e.autoFlush || !1, this.flushInterval = e.flushInterval || 3e4, this._flushTimer = null, this.matchOptions = { - matchHeaders: e.matchHeaders || [], - ignoreHeaders: e.ignoreHeaders || [], - excludeHeaders: e.excludeHeaders || [], - matchBody: e.matchBody !== !1, - matchQuery: e.matchQuery !== !1, - caseSensitive: e.caseSensitive || !1 - }, this.#o = h(this.matchOptions), this.shouldRecord = e.shouldRecord || (() => !0), this.shouldPlayback = e.shouldPlayback || (() => !0), this.#t = p(e.excludeUrls), this.#a && this.#r && this.#s(); - } - async record(e, t) { - if (!this.shouldRecord(e) || this.isUrlExcluded(e)) return; - let n = g(e, this.#o, this.matchOptions), r = y(n), i = m(t.headers), a = { - statusCode: t.statusCode, - headers: v(i, this.#o, this.matchOptions), - body: Buffer.isBuffer(t.body) ? t.body.toString(`base64`) : Buffer.from(String(t.body || ``)).toString(`base64`), - trailers: t.trailers - }; - if (this.#n.size >= this.#i && !this.#n.has(r)) { - let e = this.#n.keys().next().value; - this.#n.delete(e); - } - let o = this.#n.get(r); - o && o.responses ? (o.responses.push(a), o.timestamp = (/* @__PURE__ */ new Date()).toISOString()) : this.#n.set(r, { - request: n, - responses: [a], - callCount: 0, - timestamp: (/* @__PURE__ */ new Date()).toISOString() - }), this.#a && this.#r && this.#l(); - } - isUrlExcluded(e) { - let t = new URL(e.path, e.origin).toString(); - return this.#t(t); - } - findSnapshot(e) { - if (!this.shouldPlayback(e) || this.isUrlExcluded(e)) return; - let t = y(g(e, this.#o, this.matchOptions)), n = this.#n.get(t); - if (!n) return; - let r = n.callCount || 0, i = Math.min(r, n.responses.length - 1); - return n.callCount = r + 1, { - ...n, - response: n.responses[i] - }; - } - async loadSnapshots(e) { - let t = e || this.#r; - if (!t) throw new u(`Snapshot path is required`); - try { - let e = await i(s(t), `utf8`), n = JSON.parse(e); - if (Array.isArray(n)) { - this.#n.clear(); - for (let { hash: e, snapshot: t } of n) this.#n.set(e, t); - } else this.#n = new Map(Object.entries(n)); - } catch (e) { - if (e.code === `ENOENT`) this.#n.clear(); - else throw new d(`Failed to load snapshots from ${t}`, { cause: e }); - } - } - async saveSnapshots(e) { - let t = e || this.#r; - if (!t) throw new u(`Snapshot path is required`); - let n = s(t); - await a(o(n), { recursive: !0 }); - let i = Array.from(this.#n.entries()).map(([e, t]) => ({ - hash: e, - snapshot: t - })); - await r(n, JSON.stringify(i, null, 2), { flush: !0 }); - } - clear() { - this.#n.clear(); - } - getSnapshots() { - return Array.from(this.#n.values()); - } - size() { - return this.#n.size; - } - resetCallCounts() { - for (let e of this.#n.values()) e.callCount = 0; - } - deleteSnapshot(e) { - let t = y(g(e, this.#o, this.matchOptions)); - return this.#n.delete(t); - } - getSnapshotInfo(e) { - let t = y(g(e, this.#o, this.matchOptions)), n = this.#n.get(t); - return n ? { - hash: t, - request: n.request, - responseCount: n.responses ? n.responses.length : +!!n.response, - callCount: n.callCount || 0, - timestamp: n.timestamp - } : null; - } - replaceSnapshots(e) { - if (this.#n.clear(), Array.isArray(e)) for (let { hash: t, snapshot: n } of e) this.#n.set(t, n); - else e && typeof e == `object` && (this.#n = new Map(Object.entries(e))); - } - #s() { - return this.#l(); - } - #c() { - this.#e &&= (l(this.#e), this.saveSnapshots().catch(() => {}), null); - } - #l() { - this.#e = c(() => { - this.saveSnapshots().catch(() => {}), this.#a ? this.#e?.refresh() : this.#e = null; - }, 1e3); - } - destroy() { - this.#c(), this.#e &&= (l(this.#e), null); - } - async close() { - this.#r && this.#n.size !== 0 && await this.saveSnapshots(), this.destroy(); - } - }, - formatRequestKey: g, - createRequestHash: y, - filterHeadersForMatching: _, - filterHeadersForStorage: v, - createHeaderFilters: h - }; -})); -var Xe = c$3(((e, t) => { - let n = Se(), r = qe(), { SnapshotRecorder: i } = Ye(), a = U$1(), { InvalidArgumentError: o, UndiciError: s } = R$1(), { validateSnapshotMode: c } = Je(), l = Symbol(`kSnapshotRecorder`), u = Symbol(`kSnapshotMode`), d = Symbol(`kSnapshotPath`), f = Symbol(`kSnapshotLoaded`), p = Symbol(`kRealAgent`), m = !1; - t.exports = class extends r { - constructor(e = {}) { - m ||= (process.emitWarning(`SnapshotAgent is experimental and subject to change`, `ExperimentalWarning`), !0); - let { mode: t = `record`, snapshotPath: r = null, ...a } = e; - if (super(a), c(t), (t === `playback` || t === `update`) && !r) throw new o(`snapshotPath is required when mode is '${t}'`); - this[u] = t, this[d] = r, this[l] = new i({ - snapshotPath: this[d], - mode: this[u], - maxSnapshots: e.maxSnapshots, - autoFlush: e.autoFlush, - flushInterval: e.flushInterval, - matchHeaders: e.matchHeaders, - ignoreHeaders: e.ignoreHeaders, - excludeHeaders: e.excludeHeaders, - matchBody: e.matchBody, - matchQuery: e.matchQuery, - caseSensitive: e.caseSensitive, - shouldRecord: e.shouldRecord, - shouldPlayback: e.shouldPlayback, - excludeUrls: e.excludeUrls - }), this[f] = !1, (this[u] === `record` || this[u] === `update` || this[u] === `playback` && e.excludeUrls && e.excludeUrls.length > 0) && (this[p] = new n(e)), (this[u] === `playback` || this[u] === `update`) && this[d] && this.loadSnapshots().catch(() => {}); - } - dispatch(e, t) { - t = a.wrap(t); - let n = this[u]; - if (this[l].isUrlExcluded(e)) return this[p].dispatch(e, t); - if (n === `playback` || n === `update`) { - if (!this[f]) return this.#e(e, t); - let r = this[l].findSnapshot(e); - if (r) return this.#n(r, t); - if (n === `update`) return this.#t(e, t); - { - let n = new s(`No snapshot found for ${e.method || `GET`} ${e.path}`); - if (t.onError) { - t.onError(n); - return; - } - throw n; - } - } else if (n === `record`) return this.#t(e, t); - } - async #e(e, t) { - return await this.loadSnapshots(), this.dispatch(e, t); - } - #t(e, t) { - let n = { - statusCode: null, - headers: {}, - trailers: {}, - body: [] - }, r = this; - return this[p].dispatch(e, { - onRequestStart(e, n) { - return t.onRequestStart(e, { - ...n, - history: this.history - }); - }, - onRequestUpgrade(e, n, r, i) { - return t.onRequestUpgrade(e, n, r, i); - }, - onResponseStart(e, r, i, a) { - return n.statusCode = r, n.headers = i, t.onResponseStart(e, r, i, a); - }, - onResponseData(e, r) { - return n.body.push(r), t.onResponseData(e, r); - }, - onResponseEnd(i, a) { - n.trailers = a; - let o = Buffer.concat(n.body); - r[l].record(e, { - statusCode: n.statusCode, - headers: n.headers, - body: o, - trailers: n.trailers - }).then(() => t.onResponseEnd(i, a)).catch((e) => t.onResponseError(i, e)); - } - }); - } - #n(e, t) { - try { - let { response: n } = e, r = { - pause() {}, - resume() {}, - abort(e) { - this.aborted = !0, this.reason = e; - }, - aborted: !1, - paused: !1 - }; - t.onRequestStart(r), t.onResponseStart(r, n.statusCode, n.headers); - let i = Buffer.from(n.body, `base64`); - t.onResponseData(r, i), t.onResponseEnd(r, n.trailers); - } catch (e) { - t.onError?.(e); - } - } - async loadSnapshots(e) { - await this[l].loadSnapshots(e || this[d]), this[f] = !0, this[u] === `playback` && this.#r(); - } - async saveSnapshots(e) { - return this[l].saveSnapshots(e || this[d]); - } - #r() { - for (let e of this[l].getSnapshots()) { - let { request: t, responses: n, response: r } = e, i = new URL(t.url), a = this.get(i.origin), o = n ? n[0] : r; - o && a.intercept({ - path: i.pathname + i.search, - method: t.method, - headers: t.headers, - body: t.body - }).reply(o.statusCode, o.body, { - headers: o.headers, - trailers: o.trailers - }).persist(); - } - } - getRecorder() { - return this[l]; - } - getMode() { - return this[u]; - } - clearSnapshots() { - this[l].clear(); - } - resetCallCounts() { - this[l].resetCallCounts(); - } - deleteSnapshot(e) { - return this[l].deleteSnapshot(e); - } - getSnapshotInfo(e) { - return this[l].getSnapshotInfo(e); - } - replaceSnapshots(e) { - this[l].replaceSnapshots(e); - } - async close() { - await this[l].close(), await this[p]?.close(), await super.close(); - } - }; -})); -var Ze = c$3(((e, t) => { - let n = Symbol.for(`undici.globalDispatcher.2`), r = Symbol.for(`undici.globalDispatcher.1`), { InvalidArgumentError: i } = R$1(), a = Se(); - s() === void 0 && o(new a()); - function o(e) { - if (!e || typeof e.dispatch != `function`) throw new i(`Argument agent must implement Agent`); - Object.defineProperty(globalThis, n, { - value: e, - writable: !0, - enumerable: !1, - configurable: !1 - }), Object.defineProperty(globalThis, r, { - value: e, - writable: !0, - enumerable: !1, - configurable: !1 - }); - } - function s() { - return globalThis[r]; - } - t.exports = { - setGlobalDispatcher: o, - getGlobalDispatcher: s, - installedExports: [ - `fetch`, - `Headers`, - `Response`, - `Request`, - `FormData`, - `WebSocket`, - `CloseEvent`, - `ErrorEvent`, - `MessageEvent`, - `EventSource` - ] - }; -})); -var Qe = c$3(((e, t) => { - let r = p$4(`node:assert`), i = U$1(); - t.exports = class { - #e; - #t = !1; - #n = !1; - #r = !1; - constructor(e) { - if (typeof e != `object` || !e) throw TypeError(`handler must be an object`); - this.#e = i.wrap(e); - } - onRequestStart(...e) { - this.#e.onRequestStart?.(...e); - } - onRequestUpgrade(...e) { - return r(!this.#t), r(!this.#n), this.#e.onRequestUpgrade?.(...e); - } - onResponseStart(...e) { - return r(!this.#t), r(!this.#n), r(!this.#r), this.#r = !0, this.#e.onResponseStart?.(...e); - } - onResponseData(...e) { - return r(!this.#t), r(!this.#n), this.#e.onResponseData?.(...e); - } - onResponseEnd(...e) { - return r(!this.#t), r(!this.#n), this.#t = !0, this.#e.onResponseEnd?.(...e); - } - onResponseError(...e) { - return this.#n = !0, this.#e.onResponseError?.(...e); - } - onBodySent() {} - }; -})); -var $e = c$3(((e, t) => { - let r = B$1(), { kBodyUsed: i } = I$1(), a = p$4(`node:assert`), { InvalidArgumentError: o } = R$1(), s = p$4(`node:events`), c = [ - 300, - 301, - 302, - 303, - 307, - 308 - ], l = Symbol(`body`), u = () => {}; - var d = class { - constructor(e) { - this[l] = e, this[i] = !1; - } - async *[Symbol.asyncIterator]() { - a(!this[i], `disturbed`), this[i] = !0, yield* this[l]; - } - }, f = class e { - static buildDispatch(t, n) { - if (n != null && (!Number.isInteger(n) || n < 0)) throw new o(`maxRedirections must be a positive number`); - let r = t.dispatch.bind(t); - return (t, i) => r(t, new e(r, n, t, i)); - } - constructor(e, t, n, c) { - if (t != null && (!Number.isInteger(t) || t < 0)) throw new o(`maxRedirections must be a positive number`); - this.dispatch = e, this.location = null; - let { maxRedirections: l, ...u } = n; - this.opts = u, this.maxRedirections = t, this.handler = c, this.history = [], r.isStream(this.opts.body) ? (r.bodyLength(this.opts.body) === 0 && this.opts.body.on(`data`, function() { - a(!1); - }), typeof this.opts.body.readableDidRead != `boolean` && (this.opts.body[i] = !1, s.prototype.on.call(this.opts.body, `data`, function() { - this[i] = !0; - }))) : (this.opts.body && typeof this.opts.body.pipeTo == `function` || this.opts.body && typeof this.opts.body != `string` && !ArrayBuffer.isView(this.opts.body) && r.isIterable(this.opts.body) && !r.isFormDataLike(this.opts.body)) && (this.opts.body = new d(this.opts.body)); - } - onRequestStart(e, t) { - this.handler.onRequestStart?.(e, { - ...t, - history: this.history - }); - } - onRequestUpgrade(e, t, n, r) { - this.handler.onRequestUpgrade?.(e, t, n, r); - } - onResponseStart(e, t, n, i) { - if (this.opts.throwOnMaxRedirect && this.history.length >= this.maxRedirections) throw Error(`max redirects`); - if ((t === 301 || t === 302) && this.opts.method === `POST` && (this.opts.method = `GET`, r.isStream(this.opts.body) && r.destroy(this.opts.body.on(`error`, u)), this.opts.body = null), t === 303 && this.opts.method !== `HEAD` && (this.opts.method = `GET`, r.isStream(this.opts.body) && r.destroy(this.opts.body.on(`error`, u)), this.opts.body = null), this.location = this.history.length >= this.maxRedirections || r.isDisturbed(this.opts.body) || c.indexOf(t) === -1 ? null : n.location, this.opts.origin && this.history.push(new URL(this.opts.path, this.opts.origin)), !this.location) { - this.handler.onResponseStart?.(e, t, n, i); - return; - } - let { origin: a, pathname: s, search: l } = r.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin))), d = l ? `${s}${l}` : s, f = `${a}${d}`; - for (let e of this.history) if (e.toString() === f) throw new o(`Redirect loop detected. Cannot redirect to ${a}. This typically happens when using a Client or Pool with cross-origin redirects. Use an Agent for cross-origin redirects.`); - this.opts.headers = m(this.opts.headers, t === 303, this.opts.origin !== a), this.opts.path = d, this.opts.origin = a, this.opts.query = null; - } - onResponseData(e, t) { - this.location || this.handler.onResponseData?.(e, t); - } - onResponseEnd(e, t) { - this.location ? this.dispatch(this.opts, this) : this.handler.onResponseEnd(e, t); - } - onResponseError(e, t) { - this.handler.onResponseError?.(e, t); - } - }; - function p(e, t, n) { - if (e.length === 4) return r.headerNameToString(e) === `host`; - if (t && r.headerNameToString(e).startsWith(`content-`)) return !0; - if (n && (e.length === 13 || e.length === 6 || e.length === 19)) { - let t = r.headerNameToString(e); - return t === `authorization` || t === `cookie` || t === `proxy-authorization`; - } - return !1; - } - function m(e, t, n) { - let i = []; - if (Array.isArray(e)) for (let r = 0; r < e.length; r += 2) p(e[r], t, n) || i.push(e[r], e[r + 1]); - else if (e && typeof e == `object`) { - let a = r.hasSafeIterator(e) ? e : Object.entries(e); - for (let [e, r] of a) p(e, t, n) || i.push(e, r); - } else a(e == null, `headers must be an object or an array`); - return i; - } - t.exports = f; -})); -var et = c$3(((e, t) => { - let n = $e(); - function r({ maxRedirections: e } = {}) { - return (t) => function(r, i) { - let { maxRedirections: a = e, ...o } = r; - if (a == null || a === 0) return t(r, i); - let s = { ...o }; - return t(s, new n(t, a, s, i)); - }; - } - t.exports = r; -})); -var tt = c$3(((e, t) => { - let n = Qe(), { ResponseError: r } = R$1(); - var i = class extends n { - #e; - #t; - #n; - #r; - #i; - constructor(e, { handler: t }) { - super(t); - } - #a(e) { - return (this.#t ?? ``).indexOf(e) === 0; - } - onRequestStart(e, t) { - return this.#e = 0, this.#t = null, this.#n = null, this.#r = null, this.#i = ``, super.onRequestStart(e, t); - } - onResponseStart(e, t, n, r) { - if (this.#e = t, this.#r = n, this.#t = n[`content-type`], this.#e < 400) return super.onResponseStart(e, t, n, r); - (this.#a(`application/json`) || this.#a(`text/plain`)) && (this.#n = new TextDecoder(`utf-8`)); - } - onResponseData(e, t) { - if (this.#e < 400) return super.onResponseData(e, t); - this.#i += this.#n?.decode(t, { stream: !0 }) ?? ``; - } - onResponseEnd(e, t) { - if (this.#e >= 400) { - if (this.#i += this.#n?.decode(void 0, { stream: !1 }) ?? ``, this.#a(`application/json`)) try { - this.#i = JSON.parse(this.#i); - } catch {} - let t, n = Error.stackTraceLimit; - Error.stackTraceLimit = 0; - try { - t = new r(`Response Error`, this.#e, { - body: this.#i, - headers: this.#r - }); - } finally { - Error.stackTraceLimit = n; - } - super.onResponseError(e, t); - } else super.onResponseEnd(e, t); - } - onResponseError(e, t) { - super.onResponseError(e, t); - } - }; - t.exports = () => (e) => function(t, n) { - return e(t, new i(t, { handler: n })); - }; -})); -var nt = c$3(((e, t) => { - let n = Oe(); - t.exports = (e) => (t) => function(r, i) { - return t(r, new n({ - ...r, - retryOptions: { - ...e, - ...r.retryOptions - } - }, { - handler: i, - dispatch: t - })); - }; -})); -var rt = c$3(((e, t) => { - let { InvalidArgumentError: n, RequestAbortedError: r } = R$1(), i = Qe(); - var a = class extends i { - #e = 1024 * 1024; - #t = !1; - #n = 0; - #r = null; - aborted = !1; - reason = !1; - constructor({ maxSize: e, signal: t }, r) { - if (e != null && (!Number.isFinite(e) || e < 1)) throw new n(`maxSize must be a number greater than 0`); - super(r), this.#e = e ?? this.#e; - } - #i(e) { - this.aborted = !0, this.reason = e; - } - onRequestStart(e, t) { - return e.abort = this.#i.bind(this), this.#r = e, super.onRequestStart(e, t); - } - onResponseStart(e, t, n, i) { - let a = n[`content-length`]; - if (a != null && a > this.#e) throw new r(`Response size (${a}) larger than maxSize (${this.#e})`); - return this.aborted === !0 ? !0 : super.onResponseStart(e, t, n, i); - } - onResponseError(e, t) { - this.#t || (t = this.#r?.reason ?? t, super.onResponseError(e, t)); - } - onResponseData(e, t) { - return this.#n += t.length, this.#n >= this.#e && (this.#t = !0, this.aborted === !0 ? super.onResponseError(e, this.reason) : super.onResponseEnd(e, {})), !0; - } - onResponseEnd(e, t) { - if (!this.#t) { - if (this.#r.aborted === !0) { - super.onResponseError(e, this.reason); - return; - } - super.onResponseEnd(e, t); - } - } - }; - function o({ maxSize: e } = { maxSize: 1024 * 1024 }) { - return (t) => function(n, r) { - let { dumpMaxSize: i = e } = n; - return t(n, new a({ - maxSize: i, - signal: n.signal - }, r)); - }; - } - t.exports = o; -})); -var it = c$3(((e, t) => { - let { isIP: r } = p$4(`node:net`), { lookup: i } = p$4(`node:dns`), a = Qe(), { InvalidArgumentError: o, InformationalError: s } = R$1(), c = 2 ** 31 - 1; - function l(e) { - let t = Object.getPrototypeOf(e); - return Object.prototype.hasOwnProperty.call(e, Symbol.iterator) || t != null && t !== Object.prototype && typeof e[Symbol.iterator] == `function`; - } - function u(e) { - return typeof e == `string` && e.toLowerCase() === `host`; - } - function d(e) { - if (e == null) return null; - if (Array.isArray(e)) { - if (e.length === 0 || !Array.isArray(e[0])) return e; - let t = []; - for (let n of e) Array.isArray(n) && n.length === 2 ? t.push(n[0], n[1]) : t.push(n); - return t; - } - if (typeof e == `object` && l(e)) { - let t = []; - for (let n of e) Array.isArray(n) && n.length === 2 ? t.push(n[0], n[1]) : t.push(n); - return t; - } - return e; - } - function f(e) { - if (e == null) return !1; - if (Array.isArray(e)) { - if (e.length === 0) return !1; - for (let t = 0; t < e.length; t += 2) if (u(e[t])) return !0; - return !1; - } - if (typeof e == `object`) { - for (let t in e) if (u(t)) return !0; - } - return !1; - } - function p(e, t) { - let n = d(t); - return f(n) ? n : Array.isArray(n) ? [ - `host`, - e, - ...n - ] : n && typeof n == `object` ? { - host: e, - ...n - } : { host: e }; - } - var m = class { - #e = 0; - #t = /* @__PURE__ */ new Map(); - constructor(e) { - this.#e = e.maxItems; - } - get size() { - return this.#t.size; - } - get(e) { - return this.#t.get(e) ?? null; - } - set(e, t) { - this.#t.set(e, t); - } - delete(e) { - this.#t.delete(e); - } - full() { - return this.size >= this.#e; - } - }, h = class { - #e = 0; - #t = 0; - dualStack = !0; - affinity = null; - lookup = null; - pick = null; - storage = null; - constructor(e) { - this.#e = e.maxTTL, this.#t = e.maxItems, this.dualStack = e.dualStack, this.affinity = e.affinity, this.lookup = e.lookup ?? this.#n, this.pick = e.pick ?? this.#r, this.storage = e.storage ?? new m(e); - } - runLookup(e, t, n) { - let r = this.storage.get(e.hostname); - if (r == null && this.storage.full()) { - n(null, e); - return; - } - let i = { - affinity: this.affinity, - dualStack: this.dualStack, - lookup: this.lookup, - pick: this.pick, - ...t.dns, - maxTTL: this.#e, - maxItems: this.#t - }; - if (r == null) this.lookup(e, i, (t, r) => { - if (t || r == null || r.length === 0) { - n(t ?? new s(`No DNS entries found`)); - return; - } - this.setRecords(e, r); - let a = this.storage.get(e.hostname), o = this.pick(e, a, i.affinity), c; - c = typeof o.port == `number` ? `:${o.port}` : e.port === `` ? `` : `:${e.port}`, n(null, new URL(`${e.protocol}//${o.family === 6 ? `[${o.address}]` : o.address}${c}`)); - }); - else { - let a = this.pick(e, r, i.affinity); - if (a == null) { - this.storage.delete(e.hostname), this.runLookup(e, t, n); - return; - } - let o; - o = typeof a.port == `number` ? `:${a.port}` : e.port === `` ? `` : `:${e.port}`, n(null, new URL(`${e.protocol}//${a.family === 6 ? `[${a.address}]` : a.address}${o}`)); - } - } - #n(e, t, n) { - i(e.hostname, { - all: !0, - family: this.dualStack === !1 ? this.affinity : 0, - order: `ipv4first` - }, (e, t) => { - if (e) return n(e); - let r = /* @__PURE__ */ new Map(); - for (let e of t) r.set(`${e.address}:${e.family}`, e); - n(null, r.values()); - }); - } - #r(e, t, n) { - let r = null, { records: i, offset: a } = t, o; - if (this.dualStack ? (n ?? (a == null || a === c ? (t.offset = 0, n = 4) : (t.offset++, n = (t.offset & 1) == 1 ? 6 : 4)), o = i[n] != null && i[n].ips.length > 0 ? i[n] : i[n === 4 ? 6 : 4]) : o = i[n], o == null || o.ips.length === 0) return r; - o.offset == null || o.offset === c ? o.offset = 0 : o.offset++; - let s = o.offset % o.ips.length; - return r = o.ips[s] ?? null, r == null ? r : Date.now() - r.timestamp > r.ttl ? (o.ips.splice(s, 1), this.pick(e, t, n)) : r; - } - pickFamily(e, t) { - let n = this.storage.get(e.hostname)?.records; - if (!n) return null; - let r = n[t]; - if (!r) return null; - r.offset == null || r.offset === c ? r.offset = 0 : r.offset++; - let i = r.offset % r.ips.length, a = r.ips[i] ?? null; - return a == null || Date.now() - a.timestamp > a.ttl && r.ips.splice(i, 1), a; - } - setRecords(e, t) { - let n = Date.now(), r = { records: { - 4: null, - 6: null - } }, i = this.#e; - for (let e of t) { - e.timestamp = n, typeof e.ttl == `number` ? (e.ttl = Math.min(e.ttl, this.#e), i = Math.min(i, e.ttl)) : e.ttl = this.#e; - let t = r.records[e.family] ?? { ips: [] }; - t.ips.push(e), r.records[e.family] = t; - } - this.storage.set(e.hostname, r, { ttl: i }); - } - deleteRecords(e) { - this.storage.delete(e.hostname); - } - getHandler(e, t) { - return new g(this, e, t); - } - }, g = class extends a { - #e = null; - #t = null; - #n = null; - #r = null; - #i = null; - #a = !0; - constructor(e, { origin: t, handler: n, dispatch: r, newOrigin: i }, a) { - super(n), this.#r = t, this.#i = i, this.#t = { ...a }, this.#e = e, this.#n = r; - } - onResponseError(e, t) { - switch (t.code) { - case `ETIMEDOUT`: - case `ECONNREFUSED`: - if (this.#e.dualStack) { - if (!this.#a) { - super.onResponseError(e, t); - return; - } - this.#a = !1; - let n = this.#i.hostname[0] === `[` ? 4 : 6, r = this.#e.pickFamily(this.#r, n); - if (r == null) { - super.onResponseError(e, t); - return; - } - let i; - i = typeof r.port == `number` ? `:${r.port}` : this.#r.port === `` ? `` : `:${this.#r.port}`; - let a = { - ...this.#t, - origin: `${this.#r.protocol}//${r.family === 6 ? `[${r.address}]` : r.address}${i}`, - headers: p(this.#r.host, this.#t.headers) - }; - this.#n(a, this); - return; - } - super.onResponseError(e, t); - break; - case `ENOTFOUND`: - this.#e.deleteRecords(this.#r), super.onResponseError(e, t); - break; - default: - super.onResponseError(e, t); - break; - } - } - }; - t.exports = (e) => { - if (e?.maxTTL != null && (typeof e?.maxTTL != `number` || e?.maxTTL < 0)) throw new o(`Invalid maxTTL. Must be a positive number`); - if (e?.maxItems != null && (typeof e?.maxItems != `number` || e?.maxItems < 1)) throw new o(`Invalid maxItems. Must be a positive number and greater than zero`); - if (e?.affinity != null && e?.affinity !== 4 && e?.affinity !== 6) throw new o(`Invalid affinity. Must be either 4 or 6`); - if (e?.dualStack != null && typeof e?.dualStack != `boolean`) throw new o(`Invalid dualStack. Must be a boolean`); - if (e?.lookup != null && typeof e?.lookup != `function`) throw new o(`Invalid lookup. Must be a function`); - if (e?.pick != null && typeof e?.pick != `function`) throw new o(`Invalid pick. Must be a function`); - if (e?.storage != null && (typeof e?.storage?.get != `function` || typeof e?.storage?.set != `function` || typeof e?.storage?.full != `function` || typeof e?.storage?.delete != `function`)) throw new o(`Invalid storage. Must be a object with methods: { get, set, full, delete }`); - let t = e?.dualStack ?? !0, n; - n = t ? e?.affinity ?? null : e?.affinity ?? 4; - let i = new h({ - maxTTL: e?.maxTTL ?? 1e4, - lookup: e?.lookup ?? null, - pick: e?.pick ?? null, - dualStack: t, - affinity: n, - maxItems: e?.maxItems ?? Infinity, - storage: e?.storage - }); - return (e) => function(t, n) { - let a = t.origin.constructor === URL ? t.origin : new URL(t.origin); - return r(a.hostname) === 0 ? (i.runLookup(a, t, (r, o) => { - if (r) return n.onResponseError(null, r); - e({ - ...t, - servername: a.hostname, - origin: o.origin, - headers: p(a.host, t.headers) - }, i.getHandler({ - origin: a, - dispatch: e, - handler: n, - newOrigin: o - }, t)); - }), !0) : e(t, n); - }; - }; -})); -var at = c$3(((e, t) => { - let { safeHTTPMethods: n, pathHasQueryOrFragment: r, hasSafeIterator: i } = B$1(), { serializePathWithQuery: a } = B$1(); - function o(e) { - if (!e.origin) throw Error(`opts.origin is undefined`); - let t = e.path || `/`; - return e.query && !r(t) && (t = a(t, e.query)), { - origin: e.origin.toString(), - method: e.method, - path: t, - headers: e.headers - }; - } - function s(e) { - let t; - if (e.headers == null) t = {}; - else if (typeof e.headers == `object`) if (t = {}, i(e.headers)) for (let n of e.headers) { - if (!Array.isArray(n)) throw Error(`opts.headers is not a valid header map`); - let [e, r] = n; - if (typeof e != `string` || typeof r != `string`) throw Error(`opts.headers is not a valid header map`); - t[e.toLowerCase()] = r; - } - else for (let n of Object.keys(e.headers)) t[n.toLowerCase()] = e.headers[n]; - else throw Error(`opts.headers is not an object`); - return t; - } - function c(e) { - if (typeof e != `object`) throw TypeError(`expected key to be object, got ${typeof e}`); - for (let t of [ - `origin`, - `method`, - `path` - ]) if (typeof e[t] != `string`) throw TypeError(`expected key.${t} to be string, got ${typeof e[t]}`); - if (e.headers !== void 0 && typeof e.headers != `object`) throw TypeError(`expected headers to be object, got ${typeof e}`); - } - function l(e) { - if (typeof e != `object`) throw TypeError(`expected value to be object, got ${typeof e}`); - for (let t of [ - `statusCode`, - `cachedAt`, - `staleAt`, - `deleteAt` - ]) if (typeof e[t] != `number`) throw TypeError(`expected value.${t} to be number, got ${typeof e[t]}`); - if (typeof e.statusMessage != `string`) throw TypeError(`expected value.statusMessage to be string, got ${typeof e.statusMessage}`); - if (e.headers != null && typeof e.headers != `object`) throw TypeError(`expected value.rawHeaders to be object, got ${typeof e.headers}`); - if (e.vary !== void 0 && typeof e.vary != `object`) throw TypeError(`expected value.vary to be object, got ${typeof e.vary}`); - if (e.etag !== void 0 && typeof e.etag != `string`) throw TypeError(`expected value.etag to be string, got ${typeof e.etag}`); - } - function u(e) { - let t = {}, n; - if (Array.isArray(e)) { - n = []; - for (let t of e) n.push(...t.split(`,`)); - } else n = e.split(`,`); - for (let e = 0; e < n.length; e++) { - let r = n[e].toLowerCase(), i = r.indexOf(`=`), a, o; - switch (i === -1 ? a = r.trim() : (a = r.substring(0, i).trimStart(), o = r.substring(i + 1)), a) { - case `min-fresh`: - case `max-stale`: - case `max-age`: - case `s-maxage`: - case `stale-while-revalidate`: - case `stale-if-error`: { - if (o === void 0 || o[0] === ` `) continue; - o.length >= 2 && o[0] === `"` && o[o.length - 1] === `"` && (o = o.substring(1, o.length - 1)); - let e = parseInt(o, 10); - if (e !== e || a === `max-age` && a in t && t[a] >= e) continue; - t[a] = e; - break; - } - case `private`: - case `no-cache`: if (o) { - if (o[0] === `"`) { - let r = [o.substring(1)], i = o[o.length - 1] === `"`; - if (!i) for (let t = e + 1; t < n.length; t++) { - let e = n[t], a = e.length; - if (r.push(e.trim()), a !== 0 && e[a - 1] === `"`) { - i = !0; - break; - } - } - if (i) { - let e = r[r.length - 1]; - e[e.length - 1] === `"` && (e = e.substring(0, e.length - 1), r[r.length - 1] = e), a in t ? t[a] = t[a].concat(r) : t[a] = r; - } - } else a in t ? t[a] = t[a].concat(o) : t[a] = [o]; - break; - } - case `public`: - case `no-store`: - case `must-revalidate`: - case `proxy-revalidate`: - case `immutable`: - case `no-transform`: - case `must-understand`: - case `only-if-cached`: - if (o) continue; - t[a] = !0; - break; - default: continue; - } - } - return t; - } - function d(e, t) { - if (typeof e == `string` && e.includes(`*`)) return t; - let n = {}, r = typeof e == `string` ? e.split(`,`) : e; - for (let e of r) { - let r = e.trim().toLowerCase(); - n[r] = t[r] ?? null; - } - return n; - } - function f(e) { - return e.length <= 2 ? !1 : e[0] === `"` && e[e.length - 1] === `"` ? !(e[1] === `"` || e.startsWith(`"W/`)) : e.startsWith(`W/"`) && e[e.length - 1] === `"` ? e.length !== 4 : !1; - } - function p(e, t = `CacheStore`) { - if (typeof e != `object` || !e) throw TypeError(`expected type of ${t} to be a CacheStore, got ${e === null ? `null` : typeof e}`); - for (let n of [ - `get`, - `createWriteStream`, - `delete` - ]) if (typeof e[n] != `function`) throw TypeError(`${t} needs to have a \`${n}()\` function`); - } - function m(e, t = `CacheMethods`) { - if (!Array.isArray(e)) throw TypeError(`expected type of ${t} needs to be an array, got ${e === null ? `null` : typeof e}`); - if (e.length === 0) throw TypeError(`${t} needs to have at least one method`); - for (let r of e) if (!n.includes(r)) throw TypeError(`element of ${t}-array needs to be one of following values: ${n.join(`, `)}, got ${r}`); - } - function h(e, t) { - let n = {}; - if (e.headers) { - let r = Object.keys(e.headers).sort(); - for (let i of r) t?.has(i.toLowerCase()) || (n[i] = e.headers[i]); - } - return JSON.stringify([ - e.origin, - e.method, - e.path, - n - ]); - } - t.exports = { - makeCacheKey: o, - normalizeHeaders: s, - assertCacheKey: c, - assertCacheValue: l, - parseCacheControlHeader: u, - parseVaryHeader: d, - isEtagUsable: f, - assertCacheMethods: m, - assertCacheStore: p, - makeDeduplicationKey: h - }; -})); -var ot = c$3(((e, t) => { - function n(e) { - switch (e[3]) { - case `,`: return r(e); - case ` `: return i(e); - default: return a(e); - } - } - function r(e) { - if (e.length !== 29 || e[4] !== ` ` || e[7] !== ` ` || e[11] !== ` ` || e[16] !== ` ` || e[19] !== `:` || e[22] !== `:` || e[25] !== ` ` || e[26] !== `G` || e[27] !== `M` || e[28] !== `T`) return; - let t = -1; - if (e[0] === `S` && e[1] === `u` && e[2] === `n`) t = 0; - else if (e[0] === `M` && e[1] === `o` && e[2] === `n`) t = 1; - else if (e[0] === `T` && e[1] === `u` && e[2] === `e`) t = 2; - else if (e[0] === `W` && e[1] === `e` && e[2] === `d`) t = 3; - else if (e[0] === `T` && e[1] === `h` && e[2] === `u`) t = 4; - else if (e[0] === `F` && e[1] === `r` && e[2] === `i`) t = 5; - else if (e[0] === `S` && e[1] === `a` && e[2] === `t`) t = 6; - else return; - let n = 0; - if (e[5] === `0`) { - let t = e.charCodeAt(6); - if (t < 49 || t > 57) return; - n = t - 48; - } else { - let t = e.charCodeAt(5); - if (t < 49 || t > 51) return; - let r = e.charCodeAt(6); - if (r < 48 || r > 57) return; - n = (t - 48) * 10 + (r - 48); - } - let r = -1; - if (e[8] === `J` && e[9] === `a` && e[10] === `n`) r = 0; - else if (e[8] === `F` && e[9] === `e` && e[10] === `b`) r = 1; - else if (e[8] === `M` && e[9] === `a`) if (e[10] === `r`) r = 2; - else if (e[10] === `y`) r = 4; - else return; - else if (e[8] === `J`) if (e[9] === `a` && e[10] === `n`) r = 0; - else if (e[9] === `u`) if (e[10] === `n`) r = 5; - else if (e[10] === `l`) r = 6; - else return; - else return; - else if (e[8] === `A`) if (e[9] === `p` && e[10] === `r`) r = 3; - else if (e[9] === `u` && e[10] === `g`) r = 7; - else return; - else if (e[8] === `S` && e[9] === `e` && e[10] === `p`) r = 8; - else if (e[8] === `O` && e[9] === `c` && e[10] === `t`) r = 9; - else if (e[8] === `N` && e[9] === `o` && e[10] === `v`) r = 10; - else if (e[8] === `D` && e[9] === `e` && e[10] === `c`) r = 11; - else return; - let i = e.charCodeAt(12); - if (i < 48 || i > 57) return; - let a = e.charCodeAt(13); - if (a < 48 || a > 57) return; - let o = e.charCodeAt(14); - if (o < 48 || o > 57) return; - let s = e.charCodeAt(15); - if (s < 48 || s > 57) return; - let c = (i - 48) * 1e3 + (a - 48) * 100 + (o - 48) * 10 + (s - 48), l = 0; - if (e[17] === `0`) { - let t = e.charCodeAt(18); - if (t < 48 || t > 57) return; - l = t - 48; - } else { - let t = e.charCodeAt(17); - if (t < 48 || t > 50) return; - let n = e.charCodeAt(18); - if (n < 48 || n > 57 || t === 50 && n > 51) return; - l = (t - 48) * 10 + (n - 48); - } - let u = 0; - if (e[20] === `0`) { - let t = e.charCodeAt(21); - if (t < 48 || t > 57) return; - u = t - 48; - } else { - let t = e.charCodeAt(20); - if (t < 48 || t > 53) return; - let n = e.charCodeAt(21); - if (n < 48 || n > 57) return; - u = (t - 48) * 10 + (n - 48); - } - let d = 0; - if (e[23] === `0`) { - let t = e.charCodeAt(24); - if (t < 48 || t > 57) return; - d = t - 48; - } else { - let t = e.charCodeAt(23); - if (t < 48 || t > 53) return; - let n = e.charCodeAt(24); - if (n < 48 || n > 57) return; - d = (t - 48) * 10 + (n - 48); - } - let f = new Date(Date.UTC(c, r, n, l, u, d)); - return f.getUTCDay() === t ? f : void 0; - } - function i(e) { - if (e.length !== 24 || e[7] !== ` ` || e[10] !== ` ` || e[19] !== ` `) return; - let t = -1; - if (e[0] === `S` && e[1] === `u` && e[2] === `n`) t = 0; - else if (e[0] === `M` && e[1] === `o` && e[2] === `n`) t = 1; - else if (e[0] === `T` && e[1] === `u` && e[2] === `e`) t = 2; - else if (e[0] === `W` && e[1] === `e` && e[2] === `d`) t = 3; - else if (e[0] === `T` && e[1] === `h` && e[2] === `u`) t = 4; - else if (e[0] === `F` && e[1] === `r` && e[2] === `i`) t = 5; - else if (e[0] === `S` && e[1] === `a` && e[2] === `t`) t = 6; - else return; - let n = -1; - if (e[4] === `J` && e[5] === `a` && e[6] === `n`) n = 0; - else if (e[4] === `F` && e[5] === `e` && e[6] === `b`) n = 1; - else if (e[4] === `M` && e[5] === `a`) if (e[6] === `r`) n = 2; - else if (e[6] === `y`) n = 4; - else return; - else if (e[4] === `J`) if (e[5] === `a` && e[6] === `n`) n = 0; - else if (e[5] === `u`) if (e[6] === `n`) n = 5; - else if (e[6] === `l`) n = 6; - else return; - else return; - else if (e[4] === `A`) if (e[5] === `p` && e[6] === `r`) n = 3; - else if (e[5] === `u` && e[6] === `g`) n = 7; - else return; - else if (e[4] === `S` && e[5] === `e` && e[6] === `p`) n = 8; - else if (e[4] === `O` && e[5] === `c` && e[6] === `t`) n = 9; - else if (e[4] === `N` && e[5] === `o` && e[6] === `v`) n = 10; - else if (e[4] === `D` && e[5] === `e` && e[6] === `c`) n = 11; - else return; - let r = 0; - if (e[8] === ` `) { - let t = e.charCodeAt(9); - if (t < 49 || t > 57) return; - r = t - 48; - } else { - let t = e.charCodeAt(8); - if (t < 49 || t > 51) return; - let n = e.charCodeAt(9); - if (n < 48 || n > 57) return; - r = (t - 48) * 10 + (n - 48); - } - let i = 0; - if (e[11] === `0`) { - let t = e.charCodeAt(12); - if (t < 48 || t > 57) return; - i = t - 48; - } else { - let t = e.charCodeAt(11); - if (t < 48 || t > 50) return; - let n = e.charCodeAt(12); - if (n < 48 || n > 57 || t === 50 && n > 51) return; - i = (t - 48) * 10 + (n - 48); - } - let a = 0; - if (e[14] === `0`) { - let t = e.charCodeAt(15); - if (t < 48 || t > 57) return; - a = t - 48; - } else { - let t = e.charCodeAt(14); - if (t < 48 || t > 53) return; - let n = e.charCodeAt(15); - if (n < 48 || n > 57) return; - a = (t - 48) * 10 + (n - 48); - } - let o = 0; - if (e[17] === `0`) { - let t = e.charCodeAt(18); - if (t < 48 || t > 57) return; - o = t - 48; - } else { - let t = e.charCodeAt(17); - if (t < 48 || t > 53) return; - let n = e.charCodeAt(18); - if (n < 48 || n > 57) return; - o = (t - 48) * 10 + (n - 48); - } - let s = e.charCodeAt(20); - if (s < 48 || s > 57) return; - let c = e.charCodeAt(21); - if (c < 48 || c > 57) return; - let l = e.charCodeAt(22); - if (l < 48 || l > 57) return; - let u = e.charCodeAt(23); - if (u < 48 || u > 57) return; - let d = (s - 48) * 1e3 + (c - 48) * 100 + (l - 48) * 10 + (u - 48), f = new Date(Date.UTC(d, n, r, i, a, o)); - return f.getUTCDay() === t ? f : void 0; - } - function a(e) { - let t = -1, n = -1; - if (e[0] === `S`) e[1] === `u` && e[2] === `n` && e[3] === `d` && e[4] === `a` && e[5] === `y` ? (n = 0, t = 6) : e[1] === `a` && e[2] === `t` && e[3] === `u` && e[4] === `r` && e[5] === `d` && e[6] === `a` && e[7] === `y` && (n = 6, t = 8); - else if (e[0] === `M` && e[1] === `o` && e[2] === `n` && e[3] === `d` && e[4] === `a` && e[5] === `y`) n = 1, t = 6; - else if (e[0] === `T`) e[1] === `u` && e[2] === `e` && e[3] === `s` && e[4] === `d` && e[5] === `a` && e[6] === `y` ? (n = 2, t = 7) : e[1] === `h` && e[2] === `u` && e[3] === `r` && e[4] === `s` && e[5] === `d` && e[6] === `a` && e[7] === `y` && (n = 4, t = 8); - else if (e[0] === `W` && e[1] === `e` && e[2] === `d` && e[3] === `n` && e[4] === `e` && e[5] === `s` && e[6] === `d` && e[7] === `a` && e[8] === `y`) n = 3, t = 9; - else if (e[0] === `F` && e[1] === `r` && e[2] === `i` && e[3] === `d` && e[4] === `a` && e[5] === `y`) n = 5, t = 6; - else return; - if (e[t] !== `,` || e.length - t - 1 != 23 || e[t + 1] !== ` ` || e[t + 4] !== `-` || e[t + 8] !== `-` || e[t + 11] !== ` ` || e[t + 14] !== `:` || e[t + 17] !== `:` || e[t + 20] !== ` ` || e[t + 21] !== `G` || e[t + 22] !== `M` || e[t + 23] !== `T`) return; - let r = 0; - if (e[t + 2] === `0`) { - let n = e.charCodeAt(t + 3); - if (n < 49 || n > 57) return; - r = n - 48; - } else { - let n = e.charCodeAt(t + 2); - if (n < 49 || n > 51) return; - let i = e.charCodeAt(t + 3); - if (i < 48 || i > 57) return; - r = (n - 48) * 10 + (i - 48); - } - let i = -1; - if (e[t + 5] === `J` && e[t + 6] === `a` && e[t + 7] === `n`) i = 0; - else if (e[t + 5] === `F` && e[t + 6] === `e` && e[t + 7] === `b`) i = 1; - else if (e[t + 5] === `M` && e[t + 6] === `a` && e[t + 7] === `r`) i = 2; - else if (e[t + 5] === `A` && e[t + 6] === `p` && e[t + 7] === `r`) i = 3; - else if (e[t + 5] === `M` && e[t + 6] === `a` && e[t + 7] === `y`) i = 4; - else if (e[t + 5] === `J` && e[t + 6] === `u` && e[t + 7] === `n`) i = 5; - else if (e[t + 5] === `J` && e[t + 6] === `u` && e[t + 7] === `l`) i = 6; - else if (e[t + 5] === `A` && e[t + 6] === `u` && e[t + 7] === `g`) i = 7; - else if (e[t + 5] === `S` && e[t + 6] === `e` && e[t + 7] === `p`) i = 8; - else if (e[t + 5] === `O` && e[t + 6] === `c` && e[t + 7] === `t`) i = 9; - else if (e[t + 5] === `N` && e[t + 6] === `o` && e[t + 7] === `v`) i = 10; - else if (e[t + 5] === `D` && e[t + 6] === `e` && e[t + 7] === `c`) i = 11; - else return; - let a = e.charCodeAt(t + 9); - if (a < 48 || a > 57) return; - let o = e.charCodeAt(t + 10); - if (o < 48 || o > 57) return; - let s = (a - 48) * 10 + (o - 48); - s += s < 70 ? 2e3 : 1900; - let c = 0; - if (e[t + 12] === `0`) { - let n = e.charCodeAt(t + 13); - if (n < 48 || n > 57) return; - c = n - 48; - } else { - let n = e.charCodeAt(t + 12); - if (n < 48 || n > 50) return; - let r = e.charCodeAt(t + 13); - if (r < 48 || r > 57 || n === 50 && r > 51) return; - c = (n - 48) * 10 + (r - 48); - } - let l = 0; - if (e[t + 15] === `0`) { - let n = e.charCodeAt(t + 16); - if (n < 48 || n > 57) return; - l = n - 48; - } else { - let n = e.charCodeAt(t + 15); - if (n < 48 || n > 53) return; - let r = e.charCodeAt(t + 16); - if (r < 48 || r > 57) return; - l = (n - 48) * 10 + (r - 48); - } - let u = 0; - if (e[t + 18] === `0`) { - let n = e.charCodeAt(t + 19); - if (n < 48 || n > 57) return; - u = n - 48; - } else { - let n = e.charCodeAt(t + 18); - if (n < 48 || n > 53) return; - let r = e.charCodeAt(t + 19); - if (r < 48 || r > 57) return; - u = (n - 48) * 10 + (r - 48); - } - let d = new Date(Date.UTC(s, i, r, c, l, u)); - return d.getUTCDay() === n ? d : void 0; - } - t.exports = { parseHttpDate: n }; -})); -var st = c$3(((e, t) => { - let n = B$1(), { parseCacheControlHeader: r, parseVaryHeader: i, isEtagUsable: a } = at(), { parseHttpDate: o } = ot(); - function s() {} - let c = [ - 200, - 203, - 204, - 206, - 300, - 301, - 308, - 404, - 405, - 410, - 414, - 501 - ], l = [206]; - var u = class { - #e; - #t; - #n; - #r; - #i; - #a; - constructor({ store: e, type: t, cacheByDefault: n }, r, i) { - this.#r = e, this.#t = t, this.#n = n, this.#e = r, this.#i = i; - } - onRequestStart(e, t) { - this.#a?.destroy(), this.#a = void 0, this.#i.onRequestStart?.(e, t); - } - onRequestUpgrade(e, t, n, r) { - this.#i.onRequestUpgrade?.(e, t, n, r); - } - onResponseStart(e, t, l, u) { - let g = () => this.#i.onResponseStart?.(e, t, l, u), _ = this; - if (!n.safeHTTPMethods.includes(this.#e.method) && t >= 200 && t <= 399) { - try { - this.#r.delete(this.#e)?.catch?.(s); - } catch {} - return g(); - } - let v = l[`cache-control`], y = l[`last-modified`] && c.includes(t); - if (!v && !l.expires && !y && !this.#n) return g(); - let b = v ? r(v) : {}; - if (!d(this.#t, t, l, b, this.#e.headers)) return g(); - let x = Date.now(), S = l.age ? f(l.age) : void 0; - if (S && S >= 2147483647e3) return g(); - let C = typeof l.date == `string` ? o(l.date) : void 0, w = p(this.#t, x, S, l, C, b) ?? this.#n; - if (w === void 0 || S && S > w) return g(); - let T = C ? C.getTime() : x, E = w + T; - if (x >= E) return g(); - let D; - if (this.#e.headers && l.vary && (D = i(l.vary, this.#e.headers), !D)) return g(); - let O = m(T, b, E), k = h(l, b), A = { - statusCode: t, - statusMessage: u, - headers: k, - vary: D, - cacheControlDirectives: b, - cachedAt: S ? x - S : x, - staleAt: E, - deleteAt: O - }; - if (t === 304) { - let t = (t) => { - if (!t) return g(); - if (A.statusCode = t.statusCode, A.statusMessage = t.statusMessage, A.etag = t.etag, A.headers = { - ...t.headers, - ...k - }, g(), this.#a = this.#r.createWriteStream(this.#e, A), !(!this.#a || !t?.body)) if (typeof t.body.values == `function`) { - let n = t.body.values(), r = () => { - for (let t of n) { - let n = this.#a.write(t) === !1; - if (this.#i.onResponseData?.(e, t), n) break; - } - }; - this.#a.on(`error`, function() { - _.#a = void 0, _.#r.delete(_.#e); - }).on(`drain`, () => { - r(); - }).on(`close`, function() { - _.#a === this && (_.#a = void 0); - }), r(); - } else typeof t.body.on == `function` && (t.body.on(`data`, (t) => { - this.#a.write(t), this.#i.onResponseData?.(e, t); - }).on(`end`, () => { - this.#a.end(); - }).on(`error`, () => { - this.#a = void 0, this.#r.delete(this.#e); - }), this.#a.on(`error`, function() { - _.#a = void 0, _.#r.delete(_.#e); - }).on(`close`, function() { - _.#a === this && (_.#a = void 0); - })); - }, n = this.#r.get(this.#e); - n && typeof n.then == `function` ? n.then(t) : t(n); - } else { - if (typeof l.etag == `string` && a(l.etag) && (A.etag = l.etag), this.#a = this.#r.createWriteStream(this.#e, A), !this.#a) return g(); - this.#a.on(`drain`, () => e.resume()).on(`error`, function() { - _.#a = void 0, _.#r.delete(_.#e); - }).on(`close`, function() { - _.#a === this && (_.#a = void 0), e.resume(); - }), g(); - } - } - onResponseData(e, t) { - this.#a?.write(t) === !1 && e.pause(), this.#i.onResponseData?.(e, t); - } - onResponseEnd(e, t) { - this.#a?.end(), this.#i.onResponseEnd?.(e, t); - } - onResponseError(e, t) { - this.#a?.destroy(t), this.#a = void 0, this.#i.onResponseError?.(e, t); - } - }; - function d(e, t, n, r, i) { - return !(t < 200 || l.includes(t) || !c.includes(t) && !n.expires && !r.public && r[`max-age`] === void 0 && !(r.private && e === `private`) && !(r[`s-maxage`] !== void 0 && e === `shared`) || r[`no-store`] || e === `shared` && r.private === !0 || n.vary?.includes(`*`) || i?.authorization && (!r.public && !r[`s-maxage`] && !r[`must-revalidate`] || typeof i.authorization != `string` || Array.isArray(r[`no-cache`]) && r[`no-cache`].includes(`authorization`) || Array.isArray(r.private) && r.private.includes(`authorization`))); - } - function f(e) { - let t = parseInt(Array.isArray(e) ? e[0] : e); - return isNaN(t) ? void 0 : t * 1e3; - } - function p(e, t, n, r, i, a) { - if (e === `shared`) { - let e = a[`s-maxage`]; - if (e !== void 0) return e > 0 ? e * 1e3 : void 0; - } - let s = a[`max-age`]; - if (s !== void 0) return s > 0 ? s * 1e3 : void 0; - if (typeof r.expires == `string`) { - let e = o(r.expires); - if (e) return t >= e.getTime() || i && (i >= e || n !== void 0 && n > e - i) ? void 0 : e.getTime() - t; - } - if (typeof r[`last-modified`] == `string`) { - let e = new Date(r[`last-modified`]); - if (g(e)) return e.getTime() >= t ? void 0 : (t - e.getTime()) * .1; - } - if (a.immutable) return 31536e3; - } - function m(e, t, n) { - let r = -Infinity, i = -Infinity, a = -Infinity; - return t[`stale-while-revalidate`] && (r = n + t[`stale-while-revalidate`] * 1e3), t[`stale-if-error`] && (i = n + t[`stale-if-error`] * 1e3), t.immutable && r === -Infinity && i === -Infinity && (a = e + 31536e6), r === -Infinity && i === -Infinity && a === -Infinity ? n + (n - e) : Math.max(n, r, i, a); - } - function h(e, t) { - let n = [ - `connection`, - `proxy-authenticate`, - `proxy-authentication-info`, - `proxy-authorization`, - `proxy-connection`, - `te`, - `transfer-encoding`, - `upgrade`, - `age` - ]; - e.connection && (Array.isArray(e.connection) ? n.push(...e.connection.map((e) => e.trim())) : n.push(...e.connection.split(`,`).map((e) => e.trim()))), Array.isArray(t[`no-cache`]) && n.push(...t[`no-cache`]), Array.isArray(t.private) && n.push(...t.private); - let r; - for (let t of n) e[t] && (r ??= { ...e }, delete r[t]); - return r ?? e; - } - function g(e) { - return e instanceof Date && Number.isFinite(e.valueOf()); - } - t.exports = u; -})); -var ct = c$3(((e, t) => { - let { Writable: r } = p$4(`node:stream`), { EventEmitter: i } = p$4(`node:events`), { assertCacheKey: a, assertCacheValue: o } = at(); - var s = class extends i { - #e = 1024; - #t = 104857600; - #n = 5242880; - #r = 0; - #i = 0; - #a = /* @__PURE__ */ new Map(); - #o = !1; - constructor(e) { - if (super(), e) { - if (typeof e != `object`) throw TypeError(`MemoryCacheStore options must be an object`); - if (e.maxCount !== void 0) { - if (typeof e.maxCount != `number` || !Number.isInteger(e.maxCount) || e.maxCount < 0) throw TypeError(`MemoryCacheStore options.maxCount must be a non-negative integer`); - this.#e = e.maxCount; - } - if (e.maxSize !== void 0) { - if (typeof e.maxSize != `number` || !Number.isInteger(e.maxSize) || e.maxSize < 0) throw TypeError(`MemoryCacheStore options.maxSize must be a non-negative integer`); - this.#t = e.maxSize; - } - if (e.maxEntrySize !== void 0) { - if (typeof e.maxEntrySize != `number` || !Number.isInteger(e.maxEntrySize) || e.maxEntrySize < 0) throw TypeError(`MemoryCacheStore options.maxEntrySize must be a non-negative integer`); - this.#n = e.maxEntrySize; - } - } - } - get size() { - return this.#r; - } - isFull() { - return this.#r >= this.#t || this.#i >= this.#e; - } - get(e) { - a(e); - let t = `${e.origin}:${e.path}`, n = Date.now(), r = this.#a.get(t), i = r ? c(e, r, n) : null; - return i == null ? void 0 : { - statusMessage: i.statusMessage, - statusCode: i.statusCode, - headers: i.headers, - body: i.body, - vary: i.vary ? i.vary : void 0, - etag: i.etag, - cacheControlDirectives: i.cacheControlDirectives, - cachedAt: i.cachedAt, - staleAt: i.staleAt, - deleteAt: i.deleteAt - }; - } - createWriteStream(e, t) { - a(e), o(t); - let n = `${e.origin}:${e.path}`, i = this, s = { - ...e, - ...t, - body: [], - size: 0 - }; - return new r({ - write(e, t, n) { - typeof e == `string` && (e = Buffer.from(e, t)), s.size += e.byteLength, s.size >= i.#n ? this.destroy() : s.body.push(e), n(null); - }, - final(t) { - let r = i.#a.get(n); - r || (r = [], i.#a.set(n, r)); - let a = c(e, r, Date.now()); - if (a) { - let e = r.indexOf(a); - r.splice(e, 1, s), i.#r -= a.size; - } else r.push(s), i.#i += 1; - if (i.#r += s.size, i.#r > i.#t || i.#i > i.#e) { - i.#o ||= (i.emit(`maxSizeExceeded`, { - size: i.#r, - maxSize: i.#t, - count: i.#i, - maxCount: i.#e - }), !0); - for (let [e, t] of i.#a) { - for (let e of t.splice(0, t.length / 2)) i.#r -= e.size, --i.#i; - t.length === 0 && i.#a.delete(e); - } - i.#r < i.#t && i.#i < i.#e && (i.#o = !1); - } - t(null); - } - }); - } - delete(e) { - if (typeof e != `object`) throw TypeError(`expected key to be object, got ${typeof e}`); - let t = `${e.origin}:${e.path}`; - for (let e of this.#a.get(t) ?? []) this.#r -= e.size, --this.#i; - this.#a.delete(t); - } - }; - function c(e, t, n) { - return t.find((t) => t.deleteAt > n && t.method === e.method && (t.vary == null || Object.keys(t.vary).every((n) => t.vary[n] === null ? e.headers[n] === void 0 : t.vary[n] === e.headers[n]))); - } - t.exports = s; -})); -var lt = c$3(((e, t) => { - let r = p$4(`node:assert`); - t.exports = class { - #e = !1; - #t; - #n; - #r; - #i; - constructor(e, t, n) { - if (typeof e != `function`) throw TypeError(`callback must be a function`); - this.#t = e, this.#n = t, this.#i = n; - } - onRequestStart(e, t) { - this.#e = !1, this.#r = t; - } - onRequestUpgrade(e, t, n, r) { - this.#n.onRequestUpgrade?.(e, t, n, r); - } - onResponseStart(e, t, n, i) { - if (r(this.#t != null), this.#e = t === 304 || this.#i && t >= 500 && t <= 504, this.#t(this.#e, this.#r), this.#t = null, this.#e) return !0; - this.#n.onRequestStart?.(e, this.#r), this.#n.onResponseStart?.(e, t, n, i); - } - onResponseData(e, t) { - if (!this.#e) return this.#n.onResponseData?.(e, t); - } - onResponseEnd(e, t) { - this.#e || this.#n.onResponseEnd?.(e, t); - } - onResponseError(e, t) { - if (!this.#e) if (this.#t &&= (this.#t(!1), null), typeof this.#n.onResponseError == `function`) this.#n.onResponseError(e, t); - else throw t; - } - }; -})); -var ut = c$3(((e, t) => { - let r = p$4(`node:assert`), { Readable: i } = p$4(`node:stream`), a = B$1(), o = st(), s = ct(), c = lt(), { assertCacheStore: l, assertCacheMethods: u, makeCacheKey: d, normalizeHeaders: f, parseCacheControlHeader: p } = at(), { AbortError: m } = R$1(); - function h(e, t) { - if (e !== void 0) { - if (!Array.isArray(e)) throw TypeError(`expected ${t} to be an array or undefined, got ${typeof e}`); - for (let n = 0; n < e.length; n++) { - let r = e[n]; - if (typeof r != `string` && !(r instanceof RegExp)) throw TypeError(`expected ${t}[${n}] to be a string or RegExp, got ${typeof r}`); - } - } - } - let g = () => {}; - function _(e, t, { headers: n = {} }) { - return !!(t?.[`no-cache`] || e.cacheControlDirectives?.[`no-cache`] && !Array.isArray(e.cacheControlDirectives[`no-cache`]) || n[`if-modified-since`] || n[`if-none-match`]); - } - function v(e, t) { - let n = Date.now(); - return n > e.staleAt ? t?.[`max-stale`] ? n > e.staleAt + t[`max-stale`] * 1e3 : !0 : t?.[`min-fresh`] ? e.staleAt - n <= t[`min-fresh`] * 1e3 : !1; - } - function y(e) { - let t = e.cacheControlDirectives?.[`stale-while-revalidate`]; - return t ? Date.now() <= e.staleAt + t * 1e3 : !1; - } - function b(e, t, n, r, i, a) { - if (a?.[`only-if-cached`]) { - let e = !1; - try { - if (typeof r.onConnect == `function` && (r.onConnect(() => { - e = !0; - }), e) || typeof r.onHeaders == `function` && (r.onHeaders(504, [], g, `Gateway Timeout`), e)) return; - typeof r.onComplete == `function` && r.onComplete([]); - } catch (e) { - typeof r.onError == `function` && r.onError(e); - } - return !0; - } - return e(i, new o(t, n, r)); - } - function x(e, t, n, o, s, c) { - let l = a.isStream(n.body) ? n.body : i.from(n.body ?? []); - r(!l.destroyed, `stream should not be destroyed`), r(!l.readableDidRead, `stream should not be readableDidRead`); - let u = { - resume() { - l.resume(); - }, - pause() { - l.pause(); - }, - get paused() { - return l.isPaused(); - }, - get aborted() { - return l.destroyed; - }, - get reason() { - return l.errored; - }, - abort(e) { - l.destroy(e ?? new m()); - } - }; - if (l.on(`error`, function(t) { - if (!this.readableEnded) if (typeof e.onResponseError == `function`) e.onResponseError(u, t); - else throw t; - }).on(`close`, function() { - this.errored || e.onResponseEnd?.(u, {}); - }), e.onRequestStart?.(u, s), l.destroyed) return; - let d = { - ...n.headers, - age: String(o) - }; - c && (d.warning = `110 - "response is stale"`), e.onResponseStart?.(u, n.statusCode, d, n.statusMessage), t.method === `HEAD` ? l.destroy() : l.on(`data`, function(t) { - e.onResponseData?.(u, t); - }); - } - function S(e, t, n, r, i, s, l) { - if (!l) return b(e, t, n, r, i, s); - let u = Date.now(); - if (u > l.deleteAt) return e(i, new o(t, n, r)); - let d = Math.round((u - l.cachedAt) / 1e3); - if (s?.[`max-age`] && d >= s[`max-age`]) return e(i, r); - let f = v(l, s), p = _(l, s, i); - if (f || p) { - if (a.isStream(i.body) && a.bodyLength(i.body) !== 0) return e(i, new o(t, n, r)); - if (!p && y(l)) return x(r, i, l, d, null, !0), queueMicrotask(() => { - let r = { - ...i.headers, - "if-modified-since": new Date(l.cachedAt).toUTCString() - }; - if (l.etag && (r[`if-none-match`] = l.etag), l.vary) for (let e in l.vary) l.vary[e] != null && (r[e] = l.vary[e]); - e({ - ...i, - headers: r - }, new o(t, n, { - onRequestStart() {}, - onRequestUpgrade() {}, - onResponseStart() {}, - onResponseData() {}, - onResponseEnd() {}, - onResponseError() {} - })); - }), !0; - let m = !1, h = l.cacheControlDirectives[`stale-if-error`] ?? s?.[`stale-if-error`]; - h && (m = u < l.staleAt + h * 1e3); - let _ = { - ...i.headers, - "if-modified-since": new Date(l.cachedAt).toUTCString() - }; - if (l.etag && (_[`if-none-match`] = l.etag), l.vary) for (let e in l.vary) l.vary[e] != null && (_[e] = l.vary[e]); - return e({ - ...i, - headers: _ - }, new c((e, t) => { - e ? x(r, i, l, d, t, f) : a.isStream(l.body) && l.body.on(`error`, g).destroy(); - }, new o(t, n, r), m)); - } - a.isStream(i.body) && i.body.on(`error`, g).destroy(), x(r, i, l, d, null, !1); - } - t.exports = (e = {}) => { - let { store: t = new s(), methods: n = [`GET`], cacheByDefault: r = void 0, type: i = `shared`, origins: o = void 0 } = e; - if (typeof e != `object` || !e) throw TypeError(`expected type of opts to be an Object, got ${e === null ? `null` : typeof e}`); - if (l(t, `opts.store`), u(n, `opts.methods`), h(o, `opts.origins`), r !== void 0 && typeof r != `number`) throw TypeError(`expected opts.cacheByDefault to be number or undefined, got ${typeof r}`); - if (i !== void 0 && i !== `shared` && i !== `private`) throw TypeError(`expected opts.type to be shared, private, or undefined, got ${typeof i}`); - let c = { - store: t, - methods: n, - cacheByDefault: r, - type: i - }, m = a.safeHTTPMethods.filter((e) => n.includes(e) === !1); - return (e) => (n, r) => { - if (!n.origin || m.includes(n.method)) return e(n, r); - if (o !== void 0) { - let t = n.origin.toString().toLowerCase(), i = !1; - for (let e = 0; e < o.length; e++) { - let n = o[e]; - if (typeof n == `string`) { - if (n.toLowerCase() === t) { - i = !0; - break; - } - } else if (n.test(t)) { - i = !0; - break; - } - } - if (!i) return e(n, r); - } - n = { - ...n, - headers: f(n) - }; - let i = n.headers?.[`cache-control`] ? p(n.headers[`cache-control`]) : void 0; - if (i?.[`no-store`]) return e(n, r); - let a = d(n), s = t.get(a); - return s && typeof s.then == `function` ? s.then((t) => S(e, c, a, r, n, i, t)) : S(e, c, a, r, n, i, s); - }; - }; -})); -var dt = c$3(((e, t) => { - let { createInflate: r, createGunzip: i, createBrotliDecompress: a, createZstdDecompress: o } = p$4(`node:zlib`), { pipeline: s } = p$4(`node:stream`), c = Qe(), { runtimeFeatures: l } = ue(), u = { - gzip: i, - "x-gzip": i, - br: a, - deflate: r, - compress: r, - "x-compress": r, - ...l.has(`zstd`) ? { zstd: o } : {} - }, d = [204, 304], f = !1; - var p = class extends c { - #e = []; - #t; - #n; - constructor(e, { skipStatusCodes: t = d, skipErrorResponses: n = !0 } = {}) { - super(e), this.#t = t, this.#n = n; - } - #r(e, t) { - return !!(!e || t < 200 || this.#t.includes(t) || this.#n && t >= 400); - } - #i(e) { - let t = e.split(`,`); - if (t.length > 5) throw Error(`too many content-encodings in response: ${t.length}, maximum allowed is 5`); - let n = []; - for (let e = t.length - 1; e >= 0; e--) { - let r = t[e].trim(); - if (r) { - if (!u[r]) return n.length = 0, n; - n.push(u[r]()); - } - } - return n; - } - #a(e, t) { - e.on(`readable`, () => { - let n; - for (; (n = e.read()) !== null && super.onResponseData(t, n) !== !1;); - }), e.on(`error`, (e) => { - super.onResponseError(t, e); - }); - } - #o(e) { - let t = this.#e[0]; - this.#a(t, e), t.on(`end`, () => { - super.onResponseEnd(e, {}); - }); - } - #s(e) { - let t = this.#e[this.#e.length - 1]; - this.#a(t, e), s(this.#e, (t) => { - if (t) { - super.onResponseError(e, t); - return; - } - super.onResponseEnd(e, {}); - }); - } - #c() { - this.#e.length = 0; - } - onResponseStart(e, t, n, r) { - let i = n[`content-encoding`]; - if (this.#r(i, t)) return super.onResponseStart(e, t, n, r); - let a = this.#i(i.toLowerCase()); - if (a.length === 0) return this.#c(), super.onResponseStart(e, t, n, r); - this.#e = a; - let { "content-encoding": o, "content-length": s, ...c } = n; - return this.#e.length === 1 ? this.#o(e) : this.#s(e), super.onResponseStart(e, t, c, r); - } - onResponseData(e, t) { - if (this.#e.length > 0) { - this.#e[0].write(t); - return; - } - super.onResponseData(e, t); - } - onResponseEnd(e, t) { - if (this.#e.length > 0) { - this.#e[0].end(), this.#c(); - return; - } - super.onResponseEnd(e, t); - } - onResponseError(e, t) { - if (this.#e.length > 0) { - for (let e of this.#e) e.destroy(t); - this.#c(); - } - super.onResponseError(e, t); - } - }; - function m(e = {}) { - return f ||= (process.emitWarning(`DecompressInterceptor is experimental and subject to change`, `ExperimentalWarning`), !0), (t) => (n, r) => t(n, new p(r, e)); - } - t.exports = m; -})); -var ft = c$3(((e, t) => { - let { RequestAbortedError: n } = R$1(), r = 5 * 1024 * 1024; - t.exports = class { - #e; - #t = []; - #n = r; - #r = 0; - #i = {}; - #a = ``; - #o = !1; - #s = !1; - #c = !1; - #l = !1; - #u = null; - #d = null; - constructor(e, t, n = r) { - this.#e = e, this.#d = t, this.#n = n; - } - addWaitingHandler(e) { - if (this.#l || this.#c) return !1; - let t = this.#f(e), n = t.controller; - try { - if (e.onRequestStart?.(n, null), n.aborted) return t.done = !0, !0; - this.#s && e.onResponseStart?.(n, this.#r, this.#i, this.#a); - } catch { - return t.done = !0, !0; - } - return n.aborted || this.#t.push(t), !0; - } - onRequestStart(e, t) { - this.#u = e, this.#e.onRequestStart?.(e, t); - } - onRequestUpgrade(e, t, n, r) { - this.#e.onRequestUpgrade?.(e, t, n, r); - } - onResponseStart(e, t, n, r) { - this.#s = !0, this.#r = t, this.#i = n, this.#a = r, this.#e.onResponseStart?.(e, t, n, r); - for (let e of this.#t) { - let { handler: i, controller: a } = e; - if (e.done || a.aborted) { - e.done = !0; - continue; - } - try { - i.onResponseStart?.(a, t, n, r); - } catch {} - a.aborted && (e.done = !0); - } - this.#g(); - } - onResponseData(e, t) { - if (!(this.#o || this.#l)) { - this.#c = !0, this.#e.onResponseData?.(e, t); - for (let e of this.#t) { - let { handler: n, controller: r } = e; - if (e.done || r.aborted) { - e.done = !0; - continue; - } - if (r.paused) { - this.#p(e, t); - continue; - } - try { - n.onResponseData?.(r, t); - } catch {} - r.aborted && (e.done = !0, e.bufferedChunks = [], e.bufferedBytes = 0); - } - this.#g(); - } - } - onResponseEnd(e, t) { - if (!(this.#o || this.#l)) { - this.#l = !0, this.#e.onResponseEnd?.(e, t); - for (let e of this.#t) { - if (e.done || e.controller.aborted) { - e.done = !0; - continue; - } - if (this.#m(e), e.done || e.controller.aborted) { - e.done = !0; - continue; - } - if (e.controller.paused && e.bufferedChunks.length > 0) { - e.pendingTrailers = t; - continue; - } - try { - e.handler.onResponseEnd?.(e.controller, t); - } catch {} - e.done = !0; - } - this.#g(), this.#d?.(); - } - } - onResponseError(e, t) { - if (!this.#l) { - this.#o = !0, this.#l = !0, this.#e.onResponseError?.(e, t); - for (let e of this.#t) this.#h(e, t); - this.#t = [], this.#d?.(); - } - } - #f(e) { - let t = { - handler: e, - controller: null, - bufferedChunks: [], - bufferedBytes: 0, - pendingTrailers: null, - done: !1 - }, n = { - aborted: !1, - paused: !1, - reason: null - }; - return t.controller = { - resume: () => { - if (!n.aborted) { - if (n.paused = !1, this.#m(t), this.#l && t.pendingTrailers && t.bufferedChunks.length === 0 && !n.paused && !n.aborted) { - try { - t.handler.onResponseEnd?.(t.controller, t.pendingTrailers); - } catch {} - t.pendingTrailers = null, t.done = !0; - } - this.#g(); - } - }, - pause: () => { - n.aborted || (n.paused = !0); - }, - get paused() { - return n.paused; - }, - get aborted() { - return n.aborted; - }, - get reason() { - return n.reason; - }, - abort: (e) => { - n.aborted = !0, n.reason = e ?? null, t.done = !0, t.pendingTrailers = null, t.bufferedChunks = [], t.bufferedBytes = 0; - } - }, t; - } - #p(e, t) { - if (e.done || e.controller.aborted) { - e.done = !0, e.bufferedChunks = [], e.bufferedBytes = 0; - return; - } - let r = Buffer.from(t); - if (e.bufferedChunks.push(r), e.bufferedBytes += r.length, e.bufferedBytes > this.#n) { - let t = new n(`Deduplicated waiting handler exceeded maxBufferSize (${this.#n} bytes) while paused`); - this.#h(e, t); - } - } - #m(e) { - let { handler: t, controller: n } = e; - for (; !e.done && !n.aborted && !n.paused && e.bufferedChunks.length > 0;) { - let r = e.bufferedChunks.shift(); - e.bufferedBytes -= r.length; - try { - t.onResponseData?.(n, r); - } catch {} - if (n.aborted) { - e.done = !0, e.pendingTrailers = null, e.bufferedChunks = [], e.bufferedBytes = 0; - break; - } - } - } - #h(e, t) { - if (!e.done) { - e.done = !0, e.pendingTrailers = null, e.bufferedChunks = [], e.bufferedBytes = 0; - try { - e.controller.abort(t), e.handler.onResponseError?.(e.controller, t); - } catch {} - } - } - #g() { - this.#t = this.#t.filter((e) => e.done === !1); - } - }; -})); -var pt = c$3(((e, t) => { - let r = p$4(`node:diagnostics_channel`), i = B$1(), a = ft(), { normalizeHeaders: o, makeCacheKey: s, makeDeduplicationKey: c } = at(), l = r.channel(`undici:request:pending-requests`); - t.exports = (e = {}) => { - let { methods: t = [`GET`], skipHeaderNames: n = [], excludeHeaderNames: r = [], maxBufferSize: u = 5 * 1024 * 1024 } = e; - if (typeof e != `object` || !e) throw TypeError(`expected type of opts to be an Object, got ${e === null ? `null` : typeof e}`); - if (!Array.isArray(t)) throw TypeError(`expected opts.methods to be an array, got ${typeof t}`); - for (let e of t) if (!i.safeHTTPMethods.includes(e)) throw TypeError(`expected opts.methods to only contain safe HTTP methods, got ${e}`); - if (!Array.isArray(n)) throw TypeError(`expected opts.skipHeaderNames to be an array, got ${typeof n}`); - if (!Array.isArray(r)) throw TypeError(`expected opts.excludeHeaderNames to be an array, got ${typeof r}`); - if (!Number.isFinite(u) || u <= 0) throw TypeError(`expected opts.maxBufferSize to be a positive finite number, got ${u}`); - let d = new Set(n.map((e) => e.toLowerCase())), f = new Set(r.map((e) => e.toLowerCase())), p = /* @__PURE__ */ new Map(); - return (e) => (n, r) => { - if (!n.origin || t.includes(n.method) === !1) return e(n, r); - if (n = { - ...n, - headers: o(n) - }, d.size > 0) { - for (let t of Object.keys(n.headers)) if (d.has(t.toLowerCase())) return e(n, r); - } - let i = c(s(n), f), m = p.get(i); - if (m) return m.addWaitingHandler(r) ? !0 : e(n, r); - let h = new a(r, () => { - p.delete(i), l.hasSubscribers && l.publish({ - size: p.size, - key: i, - type: `removed` - }); - }, u); - return p.set(i, h), l.hasSubscribers && l.publish({ - size: p.size, - key: i, - type: `added` - }), e(n, h); - }; - }; -})); -var mt = c$3(((e, t) => { - let { Writable: r } = p$4(`node:stream`), { assertCacheKey: i, assertCacheValue: a } = at(), o, s = 2 * 1e3 * 1e3 * 1e3; - t.exports = class { - #e = s; - #t = Infinity; - #n; - #r; - #i; - #a; - #o; - #s; - #c; - #l; - constructor(e) { - if (e) { - if (typeof e != `object`) throw TypeError(`SqliteCacheStore options must be an object`); - if (e.maxEntrySize !== void 0) { - if (typeof e.maxEntrySize != `number` || !Number.isInteger(e.maxEntrySize) || e.maxEntrySize < 0) throw TypeError(`SqliteCacheStore options.maxEntrySize must be a non-negative integer`); - if (e.maxEntrySize > s) throw TypeError(`SqliteCacheStore options.maxEntrySize must be less than 2gb`); - this.#e = e.maxEntrySize; - } - if (e.maxCount !== void 0) { - if (typeof e.maxCount != `number` || !Number.isInteger(e.maxCount) || e.maxCount < 0) throw TypeError(`SqliteCacheStore options.maxCount must be a non-negative integer`); - this.#t = e.maxCount; - } - } - o ||= p$4(`node:sqlite`).DatabaseSync, this.#n = new o(e?.location ?? `:memory:`), this.#n.exec(` - PRAGMA journal_mode = WAL; - PRAGMA synchronous = NORMAL; - PRAGMA temp_store = memory; - PRAGMA optimize; - - CREATE TABLE IF NOT EXISTS cacheInterceptorV3 ( - -- Data specific to us - id INTEGER PRIMARY KEY AUTOINCREMENT, - url TEXT NOT NULL, - method TEXT NOT NULL, - - -- Data returned to the interceptor - body BUF NULL, - deleteAt INTEGER NOT NULL, - statusCode INTEGER NOT NULL, - statusMessage TEXT NOT NULL, - headers TEXT NULL, - cacheControlDirectives TEXT NULL, - etag TEXT NULL, - vary TEXT NULL, - cachedAt INTEGER NOT NULL, - staleAt INTEGER NOT NULL - ); - - CREATE INDEX IF NOT EXISTS idx_cacheInterceptorV3_getValuesQuery ON cacheInterceptorV3(url, method, deleteAt); - CREATE INDEX IF NOT EXISTS idx_cacheInterceptorV3_deleteByUrlQuery ON cacheInterceptorV3(deleteAt); - `), this.#r = this.#n.prepare(` - SELECT - id, - body, - deleteAt, - statusCode, - statusMessage, - headers, - etag, - cacheControlDirectives, - vary, - cachedAt, - staleAt - FROM cacheInterceptorV3 - WHERE - url = ? - AND method = ? - ORDER BY - deleteAt ASC - `), this.#i = this.#n.prepare(` - UPDATE cacheInterceptorV3 SET - body = ?, - deleteAt = ?, - statusCode = ?, - statusMessage = ?, - headers = ?, - etag = ?, - cacheControlDirectives = ?, - cachedAt = ?, - staleAt = ? - WHERE - id = ? - `), this.#a = this.#n.prepare(` - INSERT INTO cacheInterceptorV3 ( - url, - method, - body, - deleteAt, - statusCode, - statusMessage, - headers, - etag, - cacheControlDirectives, - vary, - cachedAt, - staleAt - ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) - `), this.#s = this.#n.prepare(`DELETE FROM cacheInterceptorV3 WHERE url = ?`), this.#c = this.#n.prepare(`SELECT COUNT(*) AS total FROM cacheInterceptorV3`), this.#o = this.#n.prepare(`DELETE FROM cacheInterceptorV3 WHERE deleteAt <= ?`), this.#l = this.#t === Infinity ? null : this.#n.prepare(` - DELETE FROM cacheInterceptorV3 - WHERE id IN ( - SELECT - id - FROM cacheInterceptorV3 - ORDER BY cachedAt ASC - LIMIT ? - ) - `); - } - close() { - this.#n.close(); - } - get(e) { - i(e); - let t = this.#f(e); - return t ? { - body: t.body ? Buffer.from(t.body.buffer, t.body.byteOffset, t.body.byteLength) : void 0, - statusCode: t.statusCode, - statusMessage: t.statusMessage, - headers: t.headers ? JSON.parse(t.headers) : void 0, - etag: t.etag ? t.etag : void 0, - vary: t.vary ? JSON.parse(t.vary) : void 0, - cacheControlDirectives: t.cacheControlDirectives ? JSON.parse(t.cacheControlDirectives) : void 0, - cachedAt: t.cachedAt, - staleAt: t.staleAt, - deleteAt: t.deleteAt - } : void 0; - } - set(e, t) { - i(e); - let n = this.#d(e), r = Array.isArray(t.body) ? Buffer.concat(t.body) : t.body, a = r?.byteLength; - if (a && a > this.#e) return; - let o = this.#f(e, !0); - o ? this.#i.run(r, t.deleteAt, t.statusCode, t.statusMessage, t.headers ? JSON.stringify(t.headers) : null, t.etag ? t.etag : null, t.cacheControlDirectives ? JSON.stringify(t.cacheControlDirectives) : null, t.cachedAt, t.staleAt, o.id) : (this.#a.run(n, e.method, r, t.deleteAt, t.statusCode, t.statusMessage, t.headers ? JSON.stringify(t.headers) : null, t.etag ? t.etag : null, t.cacheControlDirectives ? JSON.stringify(t.cacheControlDirectives) : null, t.vary ? JSON.stringify(t.vary) : null, t.cachedAt, t.staleAt), this.#u()); - } - createWriteStream(e, t) { - i(e), a(t); - let n = 0, o = [], s = this; - return new r({ - decodeStrings: !0, - write(e, t, r) { - n += e.byteLength, n < s.#e ? o.push(e) : this.destroy(), r(); - }, - final(n) { - s.set(e, { - ...t, - body: o - }), n(); - } - }); - } - delete(e) { - if (typeof e != `object`) throw TypeError(`expected key to be object, got ${typeof e}`); - this.#s.run(this.#d(e)); - } - #u() { - if (Number.isFinite(this.#t) && this.size <= this.#t) return 0; - { - let e = this.#o.run(Date.now()).changes; - if (e) return e; - } - { - let e = this.#l?.run(Math.max(Math.floor(this.#t * .1), 1)).changes; - if (e) return e; - } - return 0; - } - get size() { - let { total: e } = this.#c.get(); - return e; - } - #d(e) { - return `${e.origin}/${e.path}`; - } - #f(e, t = !1) { - let n = this.#d(e), { headers: r, method: i } = e, a = this.#r.all(n, i); - if (a.length === 0) return; - let o = Date.now(); - for (let e of a) { - if (o >= e.deleteAt && !t) continue; - let n = !0; - if (e.vary) { - let t = JSON.parse(e.vary); - for (let e in t) if (!c(r[e], t[e])) { - n = !1; - break; - } - } - if (n) return e; - } - } - }; - function c(e, t) { - return e == null && t == null ? !0 : e == null && t != null || e != null && t == null ? !1 : Array.isArray(e) && Array.isArray(t) ? e.length === t.length ? e.every((e, n) => e === t[n]) : !1 : e === t; - } -})); -var ht = c$3(((e, t) => { - let { kConstruct: r } = I$1(), { kEnumerableProperty: i } = B$1(), { iteratorMixin: a, isValidHeaderName: o, isValidHeaderValue: s } = Y$1(), { webidl: c } = de(), l = p$4(`node:assert`), u = p$4(`node:util`); - function d(e) { - return e === 10 || e === 13 || e === 9 || e === 32; - } - function f(e) { - let t = 0, n = e.length; - for (; n > t && d(e.charCodeAt(n - 1));) --n; - for (; n > t && d(e.charCodeAt(t));) ++t; - return t === 0 && n === e.length ? e : e.substring(t, n); - } - function p(e, t) { - if (Array.isArray(t)) for (let n = 0; n < t.length; ++n) { - let r = t[n]; - if (r.length !== 2) throw c.errors.exception({ - header: `Headers constructor`, - message: `expected name/value pair to be length 2, found ${r.length}.` - }); - m(e, r[0], r[1]); - } - else if (typeof t == `object` && t) { - let n = Object.keys(t); - for (let r = 0; r < n.length; ++r) m(e, n[r], t[n[r]]); - } else throw c.errors.conversionFailed({ - prefix: `Headers constructor`, - argument: `Argument 1`, - types: [`sequence>`, `record`] - }); - } - function m(e, t, n) { - if (n = f(n), !o(t)) throw c.errors.invalidArgument({ - prefix: `Headers.append`, - value: t, - type: `header name` - }); - if (!s(n)) throw c.errors.invalidArgument({ - prefix: `Headers.append`, - value: n, - type: `header value` - }); - if (y(e) === `immutable`) throw TypeError(`immutable`); - return x(e).append(t, n, !1); - } - function h(e) { - let t = x(e); - if (!t) return []; - if (t.sortedMap) return t.sortedMap; - let n = [], r = t.toSortedArray(), i = t.cookies; - if (i === null || i.length === 1) return t.sortedMap = r; - for (let e = 0; e < r.length; ++e) { - let { 0: t, 1: a } = r[e]; - if (t === `set-cookie`) for (let e = 0; e < i.length; ++e) n.push([t, i[e]]); - else n.push([t, a]); - } - return t.sortedMap = n; - } - function g(e, t) { - return e[0] < t[0] ? -1 : 1; - } - var _ = class e { - cookies = null; - sortedMap; - headersMap; - constructor(t) { - t instanceof e ? (this.headersMap = new Map(t.headersMap), this.sortedMap = t.sortedMap, this.cookies = t.cookies === null ? null : [...t.cookies]) : (this.headersMap = new Map(t), this.sortedMap = null); - } - contains(e, t) { - return this.headersMap.has(t ? e : e.toLowerCase()); - } - clear() { - this.headersMap.clear(), this.sortedMap = null, this.cookies = null; - } - append(e, t, n) { - this.sortedMap = null; - let r = n ? e : e.toLowerCase(), i = this.headersMap.get(r); - if (i) { - let e = r === `cookie` ? `; ` : `, `; - this.headersMap.set(r, { - name: i.name, - value: `${i.value}${e}${t}` - }); - } else this.headersMap.set(r, { - name: e, - value: t - }); - r === `set-cookie` && (this.cookies ??= []).push(t); - } - set(e, t, n) { - this.sortedMap = null; - let r = n ? e : e.toLowerCase(); - r === `set-cookie` && (this.cookies = [t]), this.headersMap.set(r, { - name: e, - value: t - }); - } - delete(e, t) { - this.sortedMap = null, t || (e = e.toLowerCase()), e === `set-cookie` && (this.cookies = null), this.headersMap.delete(e); - } - get(e, t) { - return this.headersMap.get(t ? e : e.toLowerCase())?.value ?? null; - } - *[Symbol.iterator]() { - for (let { 0: e, 1: { value: t } } of this.headersMap) yield [e, t]; - } - get entries() { - let e = {}; - if (this.headersMap.size !== 0) for (let { name: t, value: n } of this.headersMap.values()) e[t] = n; - return e; - } - rawValues() { - return this.headersMap.values(); - } - get entriesList() { - let e = []; - if (this.headersMap.size !== 0) for (let { 0: t, 1: { name: n, value: r } } of this.headersMap) if (t === `set-cookie`) for (let t of this.cookies) e.push([n, t]); - else e.push([n, r]); - return e; - } - toSortedArray() { - let e = this.headersMap.size, t = Array(e); - if (e <= 32) { - if (e === 0) return t; - let n = this.headersMap[Symbol.iterator](), r = n.next().value; - t[0] = [r[0], r[1].value], l(r[1].value !== null); - for (let r = 1, i = 0, a = 0, o = 0, s = 0, c, u; r < e; ++r) { - for (u = n.next().value, c = t[r] = [u[0], u[1].value], l(c[1] !== null), o = 0, a = r; o < a;) s = o + (a - o >> 1), t[s][0] <= c[0] ? o = s + 1 : a = s; - if (r !== s) { - for (i = r; i > o;) t[i] = t[--i]; - t[o] = c; - } - } - if (!n.next().done) throw TypeError(`Unreachable`); - return t; - } else { - let e = 0; - for (let { 0: n, 1: { value: r } } of this.headersMap) t[e++] = [n, r], l(r !== null); - return t.sort(g); - } - } - }, v = class e { - #e; - #t; - constructor(e = void 0) { - c.util.markAsUncloneable(this), e !== r && (this.#t = new _(), this.#e = `none`, e !== void 0 && (e = c.converters.HeadersInit(e, `Headers constructor`, `init`), p(this, e))); - } - append(t, n) { - c.brandCheck(this, e), c.argumentLengthCheck(arguments, 2, `Headers.append`); - let r = `Headers.append`; - return t = c.converters.ByteString(t, r, `name`), n = c.converters.ByteString(n, r, `value`), m(this, t, n); - } - delete(t) { - if (c.brandCheck(this, e), c.argumentLengthCheck(arguments, 1, `Headers.delete`), t = c.converters.ByteString(t, `Headers.delete`, `name`), !o(t)) throw c.errors.invalidArgument({ - prefix: `Headers.delete`, - value: t, - type: `header name` - }); - if (this.#e === `immutable`) throw TypeError(`immutable`); - this.#t.contains(t, !1) && this.#t.delete(t, !1); - } - get(t) { - c.brandCheck(this, e), c.argumentLengthCheck(arguments, 1, `Headers.get`); - let n = `Headers.get`; - if (t = c.converters.ByteString(t, n, `name`), !o(t)) throw c.errors.invalidArgument({ - prefix: n, - value: t, - type: `header name` - }); - return this.#t.get(t, !1); - } - has(t) { - c.brandCheck(this, e), c.argumentLengthCheck(arguments, 1, `Headers.has`); - let n = `Headers.has`; - if (t = c.converters.ByteString(t, n, `name`), !o(t)) throw c.errors.invalidArgument({ - prefix: n, - value: t, - type: `header name` - }); - return this.#t.contains(t, !1); - } - set(t, n) { - c.brandCheck(this, e), c.argumentLengthCheck(arguments, 2, `Headers.set`); - let r = `Headers.set`; - if (t = c.converters.ByteString(t, r, `name`), n = c.converters.ByteString(n, r, `value`), n = f(n), !o(t)) throw c.errors.invalidArgument({ - prefix: r, - value: t, - type: `header name` - }); - if (!s(n)) throw c.errors.invalidArgument({ - prefix: r, - value: n, - type: `header value` - }); - if (this.#e === `immutable`) throw TypeError(`immutable`); - this.#t.set(t, n, !1); - } - getSetCookie() { - c.brandCheck(this, e); - let t = this.#t.cookies; - return t ? [...t] : []; - } - [u.inspect.custom](e, t) { - return t.depth ??= e, `Headers ${u.formatWithOptions(t, this.#t.entries)}`; - } - static getHeadersGuard(e) { - return e.#e; - } - static setHeadersGuard(e, t) { - e.#e = t; - } - static getHeadersList(e) { - return e.#t; - } - static setHeadersList(e, t) { - e.#t = t; - } - }; - let { getHeadersGuard: y, setHeadersGuard: b, getHeadersList: x, setHeadersList: S } = v; - Reflect.deleteProperty(v, `getHeadersGuard`), Reflect.deleteProperty(v, `setHeadersGuard`), Reflect.deleteProperty(v, `getHeadersList`), Reflect.deleteProperty(v, `setHeadersList`), a(`Headers`, v, h, 0, 1), Object.defineProperties(v.prototype, { - append: i, - delete: i, - get: i, - has: i, - set: i, - getSetCookie: i, - [Symbol.toStringTag]: { - value: `Headers`, - configurable: !0 - }, - [u.inspect.custom]: { enumerable: !1 } - }), c.converters.HeadersInit = function(e, t, n) { - if (c.util.Type(e) === c.util.Types.OBJECT) { - let r = Reflect.get(e, Symbol.iterator); - if (!u.types.isProxy(e) && r === v.prototype.entries) try { - return x(e).entriesList; - } catch {} - return typeof r == `function` ? c.converters[`sequence>`](e, t, n, r.bind(e)) : c.converters[`record`](e, t, n); - } - throw c.errors.conversionFailed({ - prefix: `Headers constructor`, - argument: `Argument 1`, - types: [`sequence>`, `record`] - }); - }, t.exports = { - fill: p, - compareHeaderName: g, - Headers: v, - HeadersList: _, - getHeadersGuard: y, - setHeadersGuard: b, - setHeadersList: S, - getHeadersList: x - }; -})); -var gt = c$3(((e, t) => { - let { Headers: r, HeadersList: i, fill: a, getHeadersGuard: o, setHeadersGuard: s, setHeadersList: c } = ht(), { extractBody: l, cloneBody: u, mixinBody: d, streamRegistry: f, bodyUnusable: p } = me(), m = B$1(), h = p$4(`node:util`), { kEnumerableProperty: g } = m, { isValidReasonPhrase: _, isCancelled: v, isAborted: y, isErrorLike: b, environmentSettingsObject: x } = Y$1(), { redirectStatusSet: S, nullBodyStatus: C } = se(), { webidl: w } = de(), { URLSerializer: T } = J$1(), { kConstruct: E } = I$1(), D = p$4(`node:assert`), { isomorphicEncode: O, serializeJavascriptValueToJSONString: k } = q$1(), A = new TextEncoder(`utf-8`); - var j = class e { - #e; - #t; - static error() { - return W(ee(), `immutable`); - } - static json(e, t = void 0) { - w.argumentLengthCheck(arguments, 1, `Response.json`), t !== null && (t = w.converters.ResponseInit(t)); - let n = l(A.encode(k(e))), r = W(R({}), `response`); - return U(r, t, { - body: n[0], - type: `application/json` - }), r; - } - static redirect(e, t = 302) { - w.argumentLengthCheck(arguments, 1, `Response.redirect`), e = w.converters.USVString(e), t = w.converters[`unsigned short`](t); - let n; - try { - n = new URL(e, x.settingsObject.baseUrl); - } catch (t) { - throw TypeError(`Failed to parse URL from ${e}`, { cause: t }); - } - if (!S.has(t)) throw RangeError(`Invalid status code ${t}`); - let r = W(R({}), `immutable`); - r.#t.status = t; - let i = O(T(n)); - return r.#t.headersList.append(`location`, i, !0), r; - } - constructor(e = null, t = void 0) { - if (w.util.markAsUncloneable(this), e === E) return; - e !== null && (e = w.converters.BodyInit(e, `Response`, `body`)), t = w.converters.ResponseInit(t), this.#t = R({}), this.#e = new r(E), s(this.#e, `response`), c(this.#e, this.#t.headersList); - let n = null; - if (e != null) { - let [t, r] = l(e); - n = { - body: t, - type: r - }; - } - U(this, t, n); - } - get type() { - return w.brandCheck(this, e), this.#t.type; - } - get url() { - w.brandCheck(this, e); - let t = this.#t.urlList, n = t[t.length - 1] ?? null; - return n === null ? `` : T(n, !0); - } - get redirected() { - return w.brandCheck(this, e), this.#t.urlList.length > 1; - } - get status() { - return w.brandCheck(this, e), this.#t.status; - } - get ok() { - return w.brandCheck(this, e), this.#t.status >= 200 && this.#t.status <= 299; - } - get statusText() { - return w.brandCheck(this, e), this.#t.statusText; - } - get headers() { - return w.brandCheck(this, e), this.#e; - } - get body() { - return w.brandCheck(this, e), this.#t.body ? this.#t.body.stream : null; - } - get bodyUsed() { - return w.brandCheck(this, e), !!this.#t.body && m.isDisturbed(this.#t.body.stream); - } - clone() { - if (w.brandCheck(this, e), p(this.#t)) throw w.errors.exception({ - header: `Response.clone`, - message: `Body has already been consumed.` - }); - let t = L(this.#t); - return this.#t.urlList.length !== 0 && this.#t.body?.stream && f.register(this, new WeakRef(this.#t.body.stream)), W(t, o(this.#e)); - } - [h.inspect.custom](e, t) { - t.depth === null && (t.depth = 2), t.colors ??= !0; - let n = { - status: this.status, - statusText: this.statusText, - headers: this.headers, - body: this.body, - bodyUsed: this.bodyUsed, - ok: this.ok, - redirected: this.redirected, - type: this.type, - url: this.url - }; - return `Response ${h.formatWithOptions(t, n)}`; - } - static getResponseHeaders(e) { - return e.#e; - } - static setResponseHeaders(e, t) { - e.#e = t; - } - static getResponseState(e) { - return e.#t; - } - static setResponseState(e, t) { - e.#t = t; - } - }; - let { getResponseHeaders: M, setResponseHeaders: N, getResponseState: P, setResponseState: F } = j; - Reflect.deleteProperty(j, `getResponseHeaders`), Reflect.deleteProperty(j, `setResponseHeaders`), Reflect.deleteProperty(j, `getResponseState`), Reflect.deleteProperty(j, `setResponseState`), d(j, P), Object.defineProperties(j.prototype, { - type: g, - url: g, - status: g, - ok: g, - redirected: g, - statusText: g, - headers: g, - clone: g, - body: g, - bodyUsed: g, - [Symbol.toStringTag]: { - value: `Response`, - configurable: !0 - } - }), Object.defineProperties(j, { - json: g, - redirect: g, - error: g - }); - function L(e) { - if (e.internalResponse) return H(L(e.internalResponse), e.type); - let t = R({ - ...e, - body: null - }); - return e.body != null && (t.body = u(e.body)), t; - } - function R(e) { - return { - aborted: !1, - rangeRequested: !1, - timingAllowPassed: !1, - requestIncludesCredentials: !1, - type: `default`, - status: 200, - timingInfo: null, - cacheState: ``, - statusText: ``, - ...e, - headersList: e?.headersList ? new i(e?.headersList) : new i(), - urlList: e?.urlList ? [...e.urlList] : [] - }; - } - function ee(e) { - return R({ - type: `error`, - status: 0, - error: b(e) ? e : Error(e && String(e)), - aborted: e && e.name === `AbortError` - }); - } - function z(e) { - return e.type === `error` && e.status === 0; - } - function V(e, t) { - return t = { - internalResponse: e, - ...t - }, new Proxy(e, { - get(e, n) { - return n in t ? t[n] : e[n]; - }, - set(e, n, r) { - return D(!(n in t)), e[n] = r, !0; - } - }); - } - function H(e, t) { - if (t === `basic`) return V(e, { - type: `basic`, - headersList: e.headersList - }); - if (t === `cors`) return V(e, { - type: `cors`, - headersList: e.headersList - }); - if (t === `opaque`) return V(e, { - type: `opaque`, - urlList: [], - status: 0, - statusText: ``, - body: null - }); - if (t === `opaqueredirect`) return V(e, { - type: `opaqueredirect`, - status: 0, - statusText: ``, - headersList: [], - body: null - }); - D(!1); - } - function te(e, t = null) { - return D(v(e)), y(e) ? ee(Object.assign(new DOMException(`The operation was aborted.`, `AbortError`), { cause: t })) : ee(Object.assign(new DOMException(`Request was cancelled.`), { cause: t })); - } - function U(e, t, n) { - if (t.status !== null && (t.status < 200 || t.status > 599)) throw RangeError(`init["status"] must be in the range of 200 to 599, inclusive.`); - if (`statusText` in t && t.statusText != null && !_(String(t.statusText))) throw TypeError(`Invalid statusText`); - if (`status` in t && t.status != null && (P(e).status = t.status), `statusText` in t && t.statusText != null && (P(e).statusText = t.statusText), `headers` in t && t.headers != null && a(M(e), t.headers), n) { - if (C.includes(e.status)) throw w.errors.exception({ - header: `Response constructor`, - message: `Invalid response status code ${e.status}` - }); - P(e).body = n.body, n.type != null && !P(e).headersList.contains(`content-type`, !0) && P(e).headersList.append(`content-type`, n.type, !0); - } - } - function W(e, t) { - let n = new j(E); - F(n, e); - let i = new r(E); - return N(n, i), c(i, e.headersList), s(i, t), e.urlList.length !== 0 && e.body?.stream && f.register(n, new WeakRef(e.body.stream)), n; - } - w.converters.XMLHttpRequestBodyInit = function(e, t, n) { - return typeof e == `string` ? w.converters.USVString(e, t, n) : w.is.Blob(e) || w.is.BufferSource(e) || w.is.FormData(e) || w.is.URLSearchParams(e) ? e : w.converters.DOMString(e, t, n); - }, w.converters.BodyInit = function(e, t, n) { - return w.is.ReadableStream(e) || e?.[Symbol.asyncIterator] ? e : w.converters.XMLHttpRequestBodyInit(e, t, n); - }, w.converters.ResponseInit = w.dictionaryConverter([ - { - key: `status`, - converter: w.converters[`unsigned short`], - defaultValue: () => 200 - }, - { - key: `statusText`, - converter: w.converters.ByteString, - defaultValue: () => `` - }, - { - key: `headers`, - converter: w.converters.HeadersInit - } - ]), w.is.Response = w.util.MakeTypeAssertion(j), t.exports = { - isNetworkError: z, - makeNetworkError: ee, - makeResponse: R, - makeAppropriateNetworkError: te, - filterResponse: H, - Response: j, - cloneResponse: L, - fromInnerResponse: W, - getResponseState: P - }; -})); -var _t = c$3(((e, t) => { - let { extractBody: r, mixinBody: i, cloneBody: a, bodyUnusable: o } = me(), { Headers: s, fill: c, HeadersList: l, setHeadersGuard: u, getHeadersGuard: d, setHeadersList: f, getHeadersList: p } = ht(), m = B$1(), h = p$4(`node:util`), { isValidHTTPToken: g, sameOrigin: _, environmentSettingsObject: v } = Y$1(), { forbiddenMethodsSet: y, corsSafeListedMethodsSet: b, referrerPolicy: x, requestRedirect: S, requestMode: C, requestCredentials: w, requestCache: T, requestDuplex: E } = se(), { kEnumerableProperty: D, normalizedMethodRecordsBase: O, normalizedMethodRecords: k } = m, { webidl: A } = de(), { URLSerializer: j } = J$1(), { kConstruct: M } = I$1(), N = p$4(`node:assert`), { getMaxListeners: P, setMaxListeners: F, defaultMaxListeners: L } = p$4(`node:events`), R = Symbol(`abortController`), ee = new FinalizationRegistry(({ signal: e, abort: t }) => { - e.removeEventListener(`abort`, t); - }), z = /* @__PURE__ */ new WeakMap(), V; - try { - V = P(new AbortController().signal) > 0; - } catch { - V = !1; - } - function H(e) { - return t; - function t() { - let n = e.deref(); - if (n !== void 0) { - ee.unregister(t), this.removeEventListener(`abort`, t), n.abort(this.reason); - let e = z.get(n.signal); - if (e !== void 0) { - if (e.size !== 0) { - for (let t of e) { - let e = t.deref(); - e !== void 0 && e.abort(this.reason); - } - e.clear(); - } - z.delete(n.signal); - } - } - } - } - let te = !1; - var U = class e { - #e; - #t; - #n; - #r; - constructor(e, t = void 0) { - if (A.util.markAsUncloneable(this), e === M) return; - A.argumentLengthCheck(arguments, 1, `Request constructor`), e = A.converters.RequestInfo(e), t = A.converters.RequestInit(t); - let n = null, i = null, a = v.settingsObject.baseUrl, d = null; - if (typeof e == `string`) { - this.#t = t.dispatcher; - let r; - try { - r = new URL(e, a); - } catch (t) { - throw TypeError(`Failed to parse URL from ` + e, { cause: t }); - } - if (r.username || r.password) throw TypeError(`Request cannot be constructed from a URL that includes credentials: ` + e); - n = ae({ urlList: [r] }), i = `cors`; - } else N(A.is.Request(e)), n = e.#r, d = e.#e, this.#t = t.dispatcher || e.#t; - let h = v.settingsObject.origin, x = `client`; - if (n.window?.constructor?.name === `EnvironmentSettingsObject` && _(n.window, h) && (x = n.window), t.window != null) throw TypeError(`'window' option '${x}' must be null`); - `window` in t && (x = `no-window`), n = ae({ - method: n.method, - headersList: n.headersList, - unsafeRequest: n.unsafeRequest, - client: v.settingsObject, - window: x, - priority: n.priority, - origin: n.origin, - referrer: n.referrer, - referrerPolicy: n.referrerPolicy, - mode: n.mode, - credentials: n.credentials, - cache: n.cache, - redirect: n.redirect, - integrity: n.integrity, - keepalive: n.keepalive, - reloadNavigation: n.reloadNavigation, - historyNavigation: n.historyNavigation, - urlList: [...n.urlList] - }); - let S = Object.keys(t).length !== 0; - if (S && (n.mode === `navigate` && (n.mode = `same-origin`), n.reloadNavigation = !1, n.historyNavigation = !1, n.origin = `client`, n.referrer = `client`, n.referrerPolicy = ``, n.url = n.urlList[n.urlList.length - 1], n.urlList = [n.url]), t.referrer !== void 0) { - let e = t.referrer; - if (e === ``) n.referrer = `no-referrer`; - else { - let t; - try { - t = new URL(e, a); - } catch (t) { - throw TypeError(`Referrer "${e}" is not a valid URL.`, { cause: t }); - } - t.protocol === `about:` && t.hostname === `client` || h && !_(t, v.settingsObject.baseUrl) ? n.referrer = `client` : n.referrer = t; - } - } - t.referrerPolicy !== void 0 && (n.referrerPolicy = t.referrerPolicy); - let C; - if (C = t.mode === void 0 ? i : t.mode, C === `navigate`) throw A.errors.exception({ - header: `Request constructor`, - message: `invalid request mode navigate.` - }); - if (C != null && (n.mode = C), t.credentials !== void 0 && (n.credentials = t.credentials), t.cache !== void 0 && (n.cache = t.cache), n.cache === `only-if-cached` && n.mode !== `same-origin`) throw TypeError(`'only-if-cached' can be set only with 'same-origin' mode`); - if (t.redirect !== void 0 && (n.redirect = t.redirect), t.integrity != null && (n.integrity = String(t.integrity)), t.keepalive !== void 0 && (n.keepalive = !!t.keepalive), t.method !== void 0) { - let e = t.method, r = k[e]; - if (r !== void 0) n.method = r; - else { - if (!g(e)) throw TypeError(`'${e}' is not a valid HTTP method.`); - let t = e.toUpperCase(); - if (y.has(t)) throw TypeError(`'${e}' HTTP method is unsupported.`); - e = O[t] ?? e, n.method = e; - } - !te && n.method === `patch` && (process.emitWarning("Using `patch` is highly likely to result in a `405 Method Not Allowed`. `PATCH` is much more likely to succeed.", { code: `UNDICI-FETCH-patch` }), te = !0); - } - t.signal !== void 0 && (d = t.signal), this.#r = n; - let w = new AbortController(); - if (this.#e = w.signal, d != null) if (d.aborted) w.abort(d.reason); - else { - this[R] = w; - let e = H(new WeakRef(w)); - V && P(d) === L && F(1500, d), m.addAbortListener(d, e), ee.register(w, { - signal: d, - abort: e - }, e); - } - if (this.#n = new s(M), f(this.#n, n.headersList), u(this.#n, `request`), C === `no-cors`) { - if (!b.has(n.method)) throw TypeError(`'${n.method} is unsupported in no-cors mode.`); - u(this.#n, `request-no-cors`); - } - if (S) { - let e = p(this.#n), n = t.headers === void 0 ? new l(e) : t.headers; - if (e.clear(), n instanceof l) { - for (let { name: t, value: r } of n.rawValues()) e.append(t, r, !1); - e.cookies = n.cookies; - } else c(this.#n, n); - } - let T = A.is.Request(e) ? e.#r.body : null; - if ((t.body != null || T != null) && (n.method === `GET` || n.method === `HEAD`)) throw TypeError(`Request with GET/HEAD method cannot have body.`); - let E = null; - if (t.body != null) { - let [e, i] = r(t.body, n.keepalive); - E = e, i && !p(this.#n).contains(`content-type`, !0) && this.#n.append(`content-type`, i, !0); - } - let D = E ?? T; - if (D != null && D.source == null) { - if (E != null && t.duplex == null) throw TypeError(`RequestInit: duplex option is required when sending a body.`); - if (n.mode !== `same-origin` && n.mode !== `cors`) throw TypeError(`If request is made from ReadableStream, mode should be "same-origin" or "cors"`); - n.useCORSPreflightFlag = !0; - } - let j = D; - if (E == null && T != null) { - if (o(e.#r)) throw TypeError(`Cannot construct a Request with a Request object that has already been used.`); - let t = new TransformStream(); - T.stream.pipeThrough(t), j = { - source: T.source, - length: T.length, - stream: t.readable - }; - } - this.#r.body = j; - } - get method() { - return A.brandCheck(this, e), this.#r.method; - } - get url() { - return A.brandCheck(this, e), j(this.#r.url); - } - get headers() { - return A.brandCheck(this, e), this.#n; - } - get destination() { - return A.brandCheck(this, e), this.#r.destination; - } - get referrer() { - return A.brandCheck(this, e), this.#r.referrer === `no-referrer` ? `` : this.#r.referrer === `client` ? `about:client` : this.#r.referrer.toString(); - } - get referrerPolicy() { - return A.brandCheck(this, e), this.#r.referrerPolicy; - } - get mode() { - return A.brandCheck(this, e), this.#r.mode; - } - get credentials() { - return A.brandCheck(this, e), this.#r.credentials; - } - get cache() { - return A.brandCheck(this, e), this.#r.cache; - } - get redirect() { - return A.brandCheck(this, e), this.#r.redirect; - } - get integrity() { - return A.brandCheck(this, e), this.#r.integrity; - } - get keepalive() { - return A.brandCheck(this, e), this.#r.keepalive; - } - get isReloadNavigation() { - return A.brandCheck(this, e), this.#r.reloadNavigation; - } - get isHistoryNavigation() { - return A.brandCheck(this, e), this.#r.historyNavigation; - } - get signal() { - return A.brandCheck(this, e), this.#e; - } - get body() { - return A.brandCheck(this, e), this.#r.body ? this.#r.body.stream : null; - } - get bodyUsed() { - return A.brandCheck(this, e), !!this.#r.body && m.isDisturbed(this.#r.body.stream); - } - get duplex() { - return A.brandCheck(this, e), `half`; - } - clone() { - if (A.brandCheck(this, e), o(this.#r)) throw TypeError(`unusable`); - let t = oe(this.#r), n = new AbortController(); - if (this.signal.aborted) n.abort(this.signal.reason); - else { - let e = z.get(this.signal); - e === void 0 && (e = /* @__PURE__ */ new Set(), z.set(this.signal, e)); - let t = new WeakRef(n); - e.add(t), m.addAbortListener(n.signal, H(t)); - } - return ce(t, this.#t, n.signal, d(this.#n)); - } - [h.inspect.custom](e, t) { - t.depth === null && (t.depth = 2), t.colors ??= !0; - let n = { - method: this.method, - url: this.url, - headers: this.headers, - destination: this.destination, - referrer: this.referrer, - referrerPolicy: this.referrerPolicy, - mode: this.mode, - credentials: this.credentials, - cache: this.cache, - redirect: this.redirect, - integrity: this.integrity, - keepalive: this.keepalive, - isReloadNavigation: this.isReloadNavigation, - isHistoryNavigation: this.isHistoryNavigation, - signal: this.signal - }; - return `Request ${h.formatWithOptions(t, n)}`; - } - static setRequestSignal(e, t) { - return e.#e = t, e; - } - static getRequestDispatcher(e) { - return e.#t; - } - static setRequestDispatcher(e, t) { - e.#t = t; - } - static setRequestHeaders(e, t) { - e.#n = t; - } - static getRequestState(e) { - return e.#r; - } - static setRequestState(e, t) { - e.#r = t; - } - }; - let { setRequestSignal: W, getRequestDispatcher: ne, setRequestDispatcher: G, setRequestHeaders: K, getRequestState: re, setRequestState: ie } = U; - Reflect.deleteProperty(U, `setRequestSignal`), Reflect.deleteProperty(U, `getRequestDispatcher`), Reflect.deleteProperty(U, `setRequestDispatcher`), Reflect.deleteProperty(U, `setRequestHeaders`), Reflect.deleteProperty(U, `getRequestState`), Reflect.deleteProperty(U, `setRequestState`), i(U, re); - function ae(e) { - return { - method: e.method ?? `GET`, - localURLsOnly: e.localURLsOnly ?? !1, - unsafeRequest: e.unsafeRequest ?? !1, - body: e.body ?? null, - client: e.client ?? null, - reservedClient: e.reservedClient ?? null, - replacesClientId: e.replacesClientId ?? ``, - window: e.window ?? `client`, - keepalive: e.keepalive ?? !1, - serviceWorkers: e.serviceWorkers ?? `all`, - initiator: e.initiator ?? ``, - destination: e.destination ?? ``, - priority: e.priority ?? null, - origin: e.origin ?? `client`, - policyContainer: e.policyContainer ?? `client`, - referrer: e.referrer ?? `client`, - referrerPolicy: e.referrerPolicy ?? ``, - mode: e.mode ?? `no-cors`, - useCORSPreflightFlag: e.useCORSPreflightFlag ?? !1, - credentials: e.credentials ?? `same-origin`, - useCredentials: e.useCredentials ?? !1, - cache: e.cache ?? `default`, - redirect: e.redirect ?? `follow`, - integrity: e.integrity ?? ``, - cryptoGraphicsNonceMetadata: e.cryptoGraphicsNonceMetadata ?? ``, - parserMetadata: e.parserMetadata ?? ``, - reloadNavigation: e.reloadNavigation ?? !1, - historyNavigation: e.historyNavigation ?? !1, - userActivation: e.userActivation ?? !1, - taintedOrigin: e.taintedOrigin ?? !1, - redirectCount: e.redirectCount ?? 0, - responseTainting: e.responseTainting ?? `basic`, - preventNoCacheCacheControlHeaderModification: e.preventNoCacheCacheControlHeaderModification ?? !1, - done: e.done ?? !1, - timingAllowFailed: e.timingAllowFailed ?? !1, - useURLCredentials: e.useURLCredentials ?? void 0, - traversableForUserPrompts: e.traversableForUserPrompts ?? `client`, - urlList: e.urlList, - url: e.urlList[0], - headersList: e.headersList ? new l(e.headersList) : new l() - }; - } - function oe(e) { - let t = ae({ - ...e, - body: null - }); - return e.body != null && (t.body = a(e.body)), t; - } - function ce(e, t, n, r) { - let i = new U(M); - ie(i, e), G(i, t), W(i, n); - let a = new s(M); - return K(i, a), f(a, e.headersList), u(a, r), i; - } - Object.defineProperties(U.prototype, { - method: D, - url: D, - headers: D, - redirect: D, - clone: D, - signal: D, - duplex: D, - destination: D, - body: D, - bodyUsed: D, - isHistoryNavigation: D, - isReloadNavigation: D, - keepalive: D, - integrity: D, - cache: D, - credentials: D, - attribute: D, - referrerPolicy: D, - referrer: D, - mode: D, - [Symbol.toStringTag]: { - value: `Request`, - configurable: !0 - } - }), A.is.Request = A.util.MakeTypeAssertion(U), A.converters.RequestInfo = function(e) { - return typeof e == `string` ? A.converters.USVString(e) : A.is.Request(e) ? e : A.converters.USVString(e); - }, A.converters.RequestInit = A.dictionaryConverter([ - { - key: `method`, - converter: A.converters.ByteString - }, - { - key: `headers`, - converter: A.converters.HeadersInit - }, - { - key: `body`, - converter: A.nullableConverter(A.converters.BodyInit) - }, - { - key: `referrer`, - converter: A.converters.USVString - }, - { - key: `referrerPolicy`, - converter: A.converters.DOMString, - allowedValues: x - }, - { - key: `mode`, - converter: A.converters.DOMString, - allowedValues: C - }, - { - key: `credentials`, - converter: A.converters.DOMString, - allowedValues: w - }, - { - key: `cache`, - converter: A.converters.DOMString, - allowedValues: T - }, - { - key: `redirect`, - converter: A.converters.DOMString, - allowedValues: S - }, - { - key: `integrity`, - converter: A.converters.DOMString - }, - { - key: `keepalive`, - converter: A.converters.boolean - }, - { - key: `signal`, - converter: A.nullableConverter((e) => A.converters.AbortSignal(e, `RequestInit`, `signal`)) - }, - { - key: `window`, - converter: A.converters.any - }, - { - key: `duplex`, - converter: A.converters.DOMString, - allowedValues: E - }, - { - key: `dispatcher`, - converter: A.converters.any - }, - { - key: `priority`, - converter: A.converters.DOMString, - allowedValues: [ - `high`, - `low`, - `auto` - ], - defaultValue: () => `auto` - } - ]), t.exports = { - Request: U, - makeRequest: ae, - fromInnerRequest: ce, - cloneRequest: oe, - getRequestDispatcher: ne, - getRequestState: re - }; -})); -var vt = c$3(((e, t) => { - let r = p$4(`node:assert`), { runtimeFeatures: i } = ue(), a = /* @__PURE__ */ new Map([ - [`sha256`, 0], - [`sha384`, 1], - [`sha512`, 2] - ]), o; - if (i.has(`crypto`)) { - o = p$4(`node:crypto`); - let e = o.getHashes(); - e.length === 0 && a.clear(); - for (let t of a.keys()) e.includes(t) === !1 && a.delete(t); - } else a.clear(); - let s = Map.prototype.get.bind(a), c = Map.prototype.has.bind(a), l = i.has(`crypto`) === !1 || a.size === 0 ? () => !0 : (e, t) => { - let n = d(t); - if (n.length === 0) return !0; - let r = u(n); - for (let t of r) { - let n = t.alg, r = t.val; - if (p(f(n, e), r)) return !0; - } - return !1; - }; - function u(e) { - let t = [], n = null; - for (let i of e) { - if (r(c(i.alg), `Invalid SRI hash algorithm token`), t.length === 0) { - t.push(i), n = i; - continue; - } - let e = n.alg, a = s(e), o = i.alg, l = s(o); - l < a || (l > a ? (n = i, t[0] = i, t.length = 1) : t.push(i)); - } - return t; - } - function d(e) { - let t = []; - for (let n of e.split(` `)) { - let e = n.split(`?`, 1)[0], r = ``, i = [e.slice(0, 6), e.slice(7)], a = i[0]; - if (!c(a)) continue; - i[1] && (r = i[1]); - let o = { - alg: a, - val: r - }; - t.push(o); - } - return t; - } - let f = (e, t) => o.hash(e, t, `base64`); - function p(e, t) { - let n = e.length; - n !== 0 && e[n - 1] === `=` && --n, n !== 0 && e[n - 1] === `=` && --n; - let r = t.length; - if (r !== 0 && t[r - 1] === `=` && --r, r !== 0 && t[r - 1] === `=` && --r, n !== r) return !1; - for (let r = 0; r < n; ++r) if (!(e[r] === t[r] || e[r] === `+` && t[r] === `-` || e[r] === `/` && t[r] === `_`)) return !1; - return !0; - } - t.exports = { - applyAlgorithmToBytes: f, - bytesMatch: l, - caseSensitiveMatch: p, - isValidSRIHashAlgorithm: c, - getStrongestMetadata: u, - parseMetadata: d - }; -})); -var yt = c$3(((e, t) => { - let { makeNetworkError: r, makeAppropriateNetworkError: i, filterResponse: a, makeResponse: o, fromInnerResponse: s, getResponseState: c } = gt(), { HeadersList: l } = ht(), { Request: u, cloneRequest: d, getRequestDispatcher: f, getRequestState: p } = _t(), m = p$4(`node:zlib`), { makePolicyContainer: h, clonePolicyContainer: g, requestBadPort: _, TAOCheck: v, appendRequestOriginHeader: y, responseLocationURL: b, requestCurrentURL: x, setRequestReferrerPolicyOnRedirect: S, tryUpgradeRequestToAPotentiallyTrustworthyURL: C, createOpaqueTimingInfo: w, appendFetchMetadata: T, corsCheck: E, crossOriginResourcePolicyCheck: D, determineRequestsReferrer: O, coarsenedSharedCurrentTime: k, sameOrigin: A, isCancelled: j, isAborted: M, isErrorLike: N, fullyReadBody: P, readableStreamClose: F, urlIsLocal: I, urlIsHttpHttpsScheme: L, urlHasHttpsScheme: R, clampAndCoarsenConnectionTimingInfo: ee, simpleRangeHeaderValue: z, buildContentRange: V, createInflate: H, extractMimeType: te, hasAuthenticationEntry: U, includesCredentials: W, isTraversableNavigable: ne } = Y$1(), G = p$4(`node:assert`), { safelyExtractBody: K, extractBody: re } = me(), { redirectStatusSet: ie, nullBodyStatus: ae, safeMethodsSet: oe, requestBodyHeader: ce, subresourceSet: le } = se(), fe = p$4(`node:events`), { Readable: pe, pipeline: he, finished: ge, isErrored: Z, isReadable: _e } = p$4(`node:stream`), { addAbortListener: ve, bufferToLowerCasedHeaderName: ye } = B$1(), { dataURLProcessor: be, serializeAMimeType: xe, minimizeSupportedMimeType: Se } = J$1(), { getGlobalDispatcher: Ce } = Ze(), { webidl: we } = de(), { STATUS_CODES: Te } = p$4(`node:http`), { bytesMatch: Ee } = vt(), { createDeferredPromise: De } = X$1(), { isomorphicEncode: Oe } = q$1(), { runtimeFeatures: ke } = ue(), Ae = ke.has(`zstd`), je = [`GET`, `HEAD`], Me = typeof __UNDICI_IS_NODE__ < `u` || typeof esbuildDetection < `u` ? `node` : `undici`, Ne; - var Pe = class extends fe { - constructor(e) { - super(), this.dispatcher = e, this.connection = null, this.dump = !1, this.state = `ongoing`; - } - terminate(e) { - this.state === `ongoing` && (this.state = `terminated`, this.connection?.destroy(e), this.emit(`terminated`, e)); - } - abort(e) { - this.state === `ongoing` && (this.state = `aborted`, e ||= new DOMException(`The operation was aborted.`, `AbortError`), this.serializedAbortReason = e, this.connection?.destroy(e), this.emit(`terminated`, e)); - } - }; - function Fe(e) { - Le(e, `fetch`); - } - function Ie(e, t = void 0) { - we.argumentLengthCheck(arguments, 1, `globalThis.fetch`); - let n = De(), r; - try { - r = new u(e, t); - } catch (e) { - return n.reject(e), n.promise; - } - let i = p(r); - if (r.signal.aborted) return ze(n, i, null, r.signal.reason, null), n.promise; - i.client.globalObject?.constructor?.name === `ServiceWorkerGlobalScope` && (i.serviceWorkers = `none`); - let a = null, o = !1, c = null; - return ve(r.signal, () => { - o = !0, G(c != null), c.abort(r.signal.reason); - let e = a?.deref(); - ze(n, i, e, r.signal.reason, c.controller); - }), c = Be({ - request: i, - processResponseEndOfBody: Fe, - processResponse: (e) => { - if (!o) { - if (e.aborted) { - ze(n, i, a, c.serializedAbortReason, c.controller); - return; - } - if (e.type === `error`) { - n.reject(TypeError(`fetch failed`, { cause: e.error })); - return; - } - a = new WeakRef(s(e, `immutable`)), n.resolve(a.deref()), n = null; - } - }, - dispatcher: f(r), - requestObject: r - }), n.promise; - } - function Le(e, t = `other`) { - if (e.type === `error` && e.aborted || !e.urlList?.length) return; - let n = e.urlList[0], r = e.timingInfo, i = e.cacheState; - L(n) && r !== null && (e.timingAllowPassed || (r = w({ startTime: r.startTime }), i = ``), r.endTime = k(), e.timingInfo = r, Re(r, n.href, t, globalThis, i, ``, e.status)); - } - let Re = performance.markResourceTiming; - function ze(e, t, n, r, i) { - if (e && e.reject(r), t.body?.stream != null && _e(t.body.stream) && t.body.stream.cancel(r).catch((e) => { - if (e.code !== `ERR_INVALID_STATE`) throw e; - }), n == null) return; - let a = c(n); - a.body?.stream != null && _e(a.body.stream) && i.error(r); - } - function Be({ request: e, processRequestBodyChunkLength: t, processRequestEndOfBody: n, processResponse: r, processResponseEndOfBody: i, processResponseConsumeBody: a, useParallelQueue: o = !1, dispatcher: s = Ce(), requestObject: c = null }) { - G(s); - let l = null, u = !1; - e.client != null && (l = e.client.globalObject, u = e.client.crossOriginIsolatedCapability); - let d = w({ startTime: k(u) }), f = { - controller: new Pe(s), - request: e, - timingInfo: d, - processRequestBodyChunkLength: t, - processRequestEndOfBody: n, - processResponse: r, - processResponseConsumeBody: a, - processResponseEndOfBody: i, - taskDestination: l, - crossOriginIsolatedCapability: u, - requestObject: c - }; - return G(!e.body || e.body.stream), e.window === `client` && (e.window = e.client?.globalObject?.constructor?.name === `Window` ? e.client : `no-window`), e.origin === `client` && (e.origin = e.client.origin), e.policyContainer === `client` && (e.client == null ? e.policyContainer = h() : e.policyContainer = g(e.client.policyContainer)), e.headersList.contains(`accept`, !0) || e.headersList.append(`accept`, `*/*`, !0), e.headersList.contains(`accept-language`, !0) || e.headersList.append(`accept-language`, `*`, !0), e.priority, le.has(e.destination), Ve(f, !1), f.controller; - } - async function Ve(e, t) { - try { - let n = e.request, i = null; - if (n.localURLsOnly && !I(x(n)) && (i = r(`local URLs only`)), C(n), _(n) === `blocked` && (i = r(`bad port`)), n.referrerPolicy === `` && (n.referrerPolicy = n.policyContainer.referrerPolicy), n.referrer !== `no-referrer` && (n.referrer = O(n)), i === null) { - let t = x(n); - A(t, n.url) && n.responseTainting === `basic` || t.protocol === `data:` || n.mode === `navigate` || n.mode === `websocket` ? (n.responseTainting = `basic`, i = await He(e)) : n.mode === `same-origin` ? i = r(`request mode cannot be "same-origin"`) : n.mode === `no-cors` ? n.redirect === `follow` ? (n.responseTainting = `opaque`, i = await He(e)) : i = r(`redirect mode cannot be "follow" for "no-cors" request`) : L(x(n)) ? (n.responseTainting = `cors`, i = await Ge(e)) : i = r(`URL scheme must be a HTTP(S) scheme`); - } - if (t) return i; - i.status !== 0 && !i.internalResponse && (n.responseTainting, n.responseTainting === `basic` ? i = a(i, `basic`) : n.responseTainting === `cors` ? i = a(i, `cors`) : n.responseTainting === `opaque` ? i = a(i, `opaque`) : G(!1)); - let o = i.status === 0 ? i : i.internalResponse; - if (o.urlList.length === 0 && o.urlList.push(...n.urlList), n.timingAllowFailed || (i.timingAllowPassed = !0), i.type === `opaque` && o.status === 206 && o.rangeRequested && !n.headers.contains(`range`, !0) && (i = o = r()), i.status !== 0 && (n.method === `HEAD` || n.method === `CONNECT` || ae.includes(o.status)) && (o.body = null, e.controller.dump = !0), n.integrity) { - let t = (t) => We(e, r(t)); - if (n.responseTainting === `opaque` || i.body == null) { - t(i.error); - return; - } - P(i.body, (r) => { - if (!Ee(r, n.integrity)) { - t(`integrity mismatch`); - return; - } - i.body = K(r)[0], We(e, i); - }, t); - } else We(e, i); - } catch (t) { - e.controller.terminate(t); - } - } - function He(e) { - if (j(e) && e.request.redirectCount === 0) return Promise.resolve(i(e)); - let { request: t } = e, { protocol: a } = x(t); - switch (a) { - case `about:`: return Promise.resolve(r(`about scheme is not supported`)); - case `blob:`: { - Ne ||= p$4(`node:buffer`).resolveObjectURL; - let e = x(t); - if (e.search.length !== 0) return Promise.resolve(r(`NetworkError when attempting to fetch resource.`)); - let i = Ne(e.toString()); - if (t.method !== `GET` || !we.is.Blob(i)) return Promise.resolve(r(`invalid method`)); - let a = o(), s = i.size, c = Oe(`${s}`), l = i.type; - if (t.headersList.contains(`range`, !0)) { - a.rangeRequested = !0; - let e = z(t.headersList.get(`range`, !0), !0); - if (e === `failure`) return Promise.resolve(r(`failed to fetch the data URL`)); - let { rangeStartValue: n, rangeEndValue: o } = e; - if (n === null) n = s - o, o = n + o - 1; - else { - if (n >= s) return Promise.resolve(r(`Range start is greater than the blob's size.`)); - (o === null || o >= s) && (o = s - 1); - } - let c = i.slice(n, o + 1, l); - a.body = re(c)[0]; - let u = Oe(`${c.size}`), d = V(n, o, s); - a.status = 206, a.statusText = `Partial Content`, a.headersList.set(`content-length`, u, !0), a.headersList.set(`content-type`, l, !0), a.headersList.set(`content-range`, d, !0); - } else { - let e = re(i); - a.statusText = `OK`, a.body = e[0], a.headersList.set(`content-length`, c, !0), a.headersList.set(`content-type`, l, !0); - } - return Promise.resolve(a); - } - case `data:`: { - let e = be(x(t)); - if (e === `failure`) return Promise.resolve(r(`failed to fetch the data URL`)); - let n = xe(e.mimeType); - return Promise.resolve(o({ - statusText: `OK`, - headersList: [[`content-type`, { - name: `Content-Type`, - value: n - }]], - body: K(e.body)[0] - })); - } - case `file:`: return Promise.resolve(r(`not implemented... yet...`)); - case `http:`: - case `https:`: return Ge(e).catch((e) => r(e)); - default: return Promise.resolve(r(`unknown scheme`)); - } - } - function Ue(e, t) { - e.request.done = !0, e.processResponseDone != null && queueMicrotask(() => e.processResponseDone(t)); - } - function We(e, t) { - let n = e.timingInfo, r = () => { - let r = Date.now(); - e.request.destination === `document` && (e.controller.fullTimingInfo = n), e.controller.reportTimingSteps = () => { - if (!L(e.request.url)) return; - n.endTime = r; - let i = t.cacheState, a = t.bodyInfo; - t.timingAllowPassed || (n = w(n), i = ``); - let o = 0; - if (e.request.mode !== `navigate` || !t.hasCrossOriginRedirects) { - o = t.status; - let e = te(t.headersList); - e !== `failure` && (a.contentType = Se(e)); - } - e.request.initiatorType != null && Re(n, e.request.url.href, e.request.initiatorType, globalThis, i, a, o); - }; - let i = () => { - e.request.done = !0, e.processResponseEndOfBody != null && queueMicrotask(() => e.processResponseEndOfBody(t)), e.request.initiatorType != null && e.controller.reportTimingSteps(); - }; - queueMicrotask(() => i()); - }; - e.processResponse != null && queueMicrotask(() => { - e.processResponse(t), e.processResponse = null; - }); - let i = t.type === `error` ? t : t.internalResponse ?? t; - i.body == null ? r() : ge(i.body.stream, () => { - r(); - }); - } - async function Ge(e) { - let t = e.request, n = null, i = null, a = e.timingInfo; - if (t.serviceWorkers, n === null) { - if (t.redirect === `follow` && (t.serviceWorkers = `none`), i = n = await qe(e), t.responseTainting === `cors` && E(t, n) === `failure`) return r(`cors failure`); - v(t, n) === `failure` && (t.timingAllowFailed = !0); - } - return (t.responseTainting === `opaque` || n.type === `opaque`) && D(t.origin, t.client, t.destination, i) === `blocked` ? r(`blocked`) : (ie.has(i.status) && (t.redirect !== `manual` && e.controller.connection.destroy(void 0, !1), t.redirect === `error` ? n = r(`unexpected redirect`) : t.redirect === `manual` ? n = i : t.redirect === `follow` ? n = await Ke(e, n) : G(!1)), n.timingInfo = a, n); - } - function Ke(e, t) { - let n = e.request, i = t.internalResponse ? t.internalResponse : t, a; - try { - if (a = b(i, x(n).hash), a == null) return t; - } catch (e) { - return Promise.resolve(r(e)); - } - if (!L(a)) return Promise.resolve(r(`URL scheme must be a HTTP(S) scheme`)); - if (n.redirectCount === 20) return Promise.resolve(r(`redirect count exceeded`)); - if (n.redirectCount += 1, n.mode === `cors` && (a.username || a.password) && !A(n, a)) return Promise.resolve(r(`cross origin not allowed for request mode "cors"`)); - if (n.responseTainting === `cors` && (a.username || a.password)) return Promise.resolve(r(`URL cannot contain credentials for request mode "cors"`)); - if (i.status !== 303 && n.body != null && n.body.source == null) return Promise.resolve(r()); - if ([301, 302].includes(i.status) && n.method === `POST` || i.status === 303 && !je.includes(n.method)) { - n.method = `GET`, n.body = null; - for (let e of ce) n.headersList.delete(e); - } - A(x(n), a) || (n.headersList.delete(`authorization`, !0), n.headersList.delete(`proxy-authorization`, !0), n.headersList.delete(`cookie`, !0), n.headersList.delete(`host`, !0)), n.body != null && (G(n.body.source != null), n.body = K(n.body.source)[0]); - let o = e.timingInfo; - return o.redirectEndTime = o.postRedirectStartTime = k(e.crossOriginIsolatedCapability), o.redirectStartTime === 0 && (o.redirectStartTime = o.startTime), n.urlList.push(a), S(n, i), Ve(e, !0); - } - async function qe(e, t = !1, n = !1) { - let a = e.request, o = null, s = null, c = null; - a.window === `no-window` && a.redirect === `error` ? (o = e, s = a) : (s = d(a), o = { ...e }, o.request = s); - let l = a.credentials === `include` || a.credentials === `same-origin` && a.responseTainting === `basic`, u = s.body ? s.body.length : null, f = null; - if (s.body == null && [`POST`, `PUT`].includes(s.method) && (f = `0`), u != null && (f = Oe(`${u}`)), f != null && !s.headersList.contains(`content-length`, !0) && s.headersList.append(`content-length`, f, !0), u != null && s.keepalive, we.is.URL(s.referrer) && s.headersList.append(`referer`, Oe(s.referrer.href), !0), y(s), T(s), s.headersList.contains(`user-agent`, !0) || s.headersList.append(`user-agent`, Me, !0), s.cache === "default" && (s.headersList.contains(`if-modified-since`, !0) || s.headersList.contains(`if-none-match`, !0) || s.headersList.contains(`if-unmodified-since`, !0) || s.headersList.contains(`if-match`, !0) || s.headersList.contains(`if-range`, !0)) && (s.cache = `no-store`), s.cache === `no-cache` && !s.preventNoCacheCacheControlHeaderModification && !s.headersList.contains(`cache-control`, !0) && s.headersList.append(`cache-control`, `max-age=0`, !0), (s.cache === `no-store` || s.cache === `reload`) && (s.headersList.contains(`pragma`, !0) || s.headersList.append(`pragma`, `no-cache`, !0), s.headersList.contains(`cache-control`, !0) || s.headersList.append(`cache-control`, `no-cache`, !0)), s.headersList.contains(`range`, !0) && s.headersList.append(`accept-encoding`, `identity`, !0), s.headersList.contains(`accept-encoding`, !0) || (R(x(s)) ? s.headersList.append(`accept-encoding`, `br, gzip, deflate`, !0) : s.headersList.append(`accept-encoding`, `gzip, deflate`, !0)), s.headersList.delete(`host`, !0), l && !s.headersList.contains(`authorization`, !0)) { - let e = null; - if (!(U(s) && (s.useURLCredentials === void 0 || !W(x(s)))) && W(x(s)) && t) { - let { username: t, password: n } = x(s); - e = `Basic ${Buffer.from(`${t}:${n}`).toString(`base64`)}`; - } - e !== null && s.headersList.append(`Authorization`, e, !1); - } - if (s.cache = `no-store`, s.cache !== `no-store` && s.cache, c == null) { - if (s.cache === `only-if-cached`) return r(`only if cached`); - let e = await Je(o, l, n); - !oe.has(s.method) && e.status >= 200 && e.status, c ??= e; - } - if (c.urlList = [...s.urlList], s.headersList.contains(`range`, !0) && (c.rangeRequested = !0), c.requestIncludesCredentials = l, c.status === 401 && s.responseTainting !== `cors` && l && (a.useURLCredentials !== void 0 || ne(a.traversableForUserPrompts))) { - if (a.body != null) { - if (a.body.source == null) return c; - a.body = K(a.body.source)[0]; - } - if (a.useURLCredentials === void 0 || t) return j(e) ? i(e) : c; - e.controller.connection.destroy(), c = await qe(e, !0); - } - if (c.status === 407) return a.window === `no-window` ? r() : j(e) ? i(e) : r(`proxy authentication required`); - if (c.status === 421 && !n && (a.body == null || a.body.source != null)) { - if (j(e)) return i(e); - e.controller.connection.destroy(), c = await qe(e, t, !0); - } - return c; - } - async function Je(e, t = !1, n = !1) { - G(!e.controller.connection || e.controller.connection.destroyed), e.controller.connection = { - abort: null, - destroyed: !1, - destroy(e, t = !0) { - this.destroyed || (this.destroyed = !0, t && this.abort?.(e ?? new DOMException(`The operation was aborted.`, `AbortError`))); - } - }; - let a = e.request, s = null, c = e.timingInfo; - a.cache = `no-store`, a.mode; - let u = null; - if (a.body == null && e.processRequestEndOfBody) queueMicrotask(() => e.processRequestEndOfBody()); - else if (a.body != null) { - let t = async function* (t) { - j(e) || (yield t, e.processRequestBodyChunkLength?.(t.byteLength)); - }, n = () => { - j(e) || e.processRequestEndOfBody && e.processRequestEndOfBody(); - }, r = (t) => { - j(e) || (t.name === `AbortError` ? e.controller.abort() : e.controller.terminate(t)); - }; - u = (async function* () { - try { - for await (let e of a.body.stream) yield* t(e); - n(); - } catch (e) { - r(e); - } - })(); - } - try { - let { body: t, status: n, statusText: r, headersList: i, socket: a } = await p({ body: u }); - if (a) s = o({ - status: n, - statusText: r, - headersList: i, - socket: a - }); - else { - let a = t[Symbol.asyncIterator](); - e.controller.next = () => a.next(), s = o({ - status: n, - statusText: r, - headersList: i - }); - } - } catch (t) { - return t.name === `AbortError` ? (e.controller.connection.destroy(), i(e, t)) : r(t); - } - let d = new ReadableStream({ - start(t) { - e.controller.controller = t; - }, - pull: () => e.controller.resume(), - cancel: (t) => { - j(e) || e.controller.abort(t); - }, - type: `bytes` - }); - s.body = { - stream: d, - source: null, - length: null - }, e.controller.resume || e.controller.on(`terminated`, f), e.controller.resume = async () => { - for (;;) { - let t, n; - try { - let { done: n, value: r } = await e.controller.next(); - if (M(e)) break; - t = n ? void 0 : r; - } catch (r) { - e.controller.ended && !c.encodedBodySize ? t = void 0 : (t = r, n = !0); - } - if (t === void 0) { - F(e.controller.controller), Ue(e, s); - return; - } - if (c.decodedBodySize += t?.byteLength ?? 0, n) { - e.controller.terminate(t); - return; - } - let r = new Uint8Array(t); - if (r.byteLength && e.controller.controller.enqueue(r), Z(d)) { - e.controller.terminate(); - return; - } - if (e.controller.controller.desiredSize <= 0) return; - } - }; - function f(t) { - M(e) ? (s.aborted = !0, _e(d) && e.controller.controller.error(e.controller.serializedAbortReason)) : _e(d) && e.controller.controller.error(TypeError(`terminated`, { cause: N(t) ? t : void 0 })), e.controller.connection.destroy(); - } - return s; - function p({ body: t }) { - let n = x(a), r = e.controller.dispatcher, i = n.pathname + n.search, o = n.search.length === 0 && n.href[n.href.length - n.hash.length - 1] === `?`; - return new Promise((s, u) => r.dispatch({ - path: o ? `${i}?` : i, - origin: n.origin, - method: a.method, - body: r.isMockActive ? a.body && (a.body.source || a.body.stream) : t, - headers: a.headersList.entries, - maxRedirections: 0, - upgrade: a.mode === `websocket` ? `websocket` : void 0 - }, { - body: null, - abort: null, - onConnect(t) { - let { connection: n } = e.controller; - c.finalConnectionTimingInfo = ee(void 0, c.postRedirectStartTime, e.crossOriginIsolatedCapability), n.destroyed ? t(new DOMException(`The operation was aborted.`, `AbortError`)) : (e.controller.on(`terminated`, t), this.abort = n.abort = t), c.finalNetworkRequestStartTime = k(e.crossOriginIsolatedCapability); - }, - onResponseStarted() { - c.finalNetworkResponseStartTime = k(e.crossOriginIsolatedCapability); - }, - onHeaders(e, t, n, r) { - if (e < 200) return !1; - let i = new l(); - for (let e = 0; e < t.length; e += 2) { - let n = ye(t[e]), r = t[e + 1]; - if (Array.isArray(r) && !Buffer.isBuffer(t[e + 1])) for (let e of r) i.append(n, e.toString(`latin1`), !0); - else i.append(n, r.toString(`latin1`), !0); - } - let o = i.get(`location`, !0); - this.body = new pe({ read: n }); - let c = o && a.redirect === `follow` && ie.has(e), d = []; - if (a.method !== `HEAD` && a.method !== `CONNECT` && !ae.includes(e) && !c) { - let e = i.get(`content-encoding`, !0), t = e ? e.toLowerCase().split(`,`) : []; - if (t.length > 5) return u(Error(`too many content-encodings in response: ${t.length}, maximum allowed is 5`)), !0; - for (let e = t.length - 1; e >= 0; --e) { - let n = t[e].trim(); - if (n === `x-gzip` || n === `gzip`) d.push(m.createGunzip({ - flush: m.constants.Z_SYNC_FLUSH, - finishFlush: m.constants.Z_SYNC_FLUSH - })); - else if (n === `deflate`) d.push(H({ - flush: m.constants.Z_SYNC_FLUSH, - finishFlush: m.constants.Z_SYNC_FLUSH - })); - else if (n === `br`) d.push(m.createBrotliDecompress({ - flush: m.constants.BROTLI_OPERATION_FLUSH, - finishFlush: m.constants.BROTLI_OPERATION_FLUSH - })); - else if (n === `zstd` && Ae) d.push(m.createZstdDecompress({ - flush: m.constants.ZSTD_e_continue, - finishFlush: m.constants.ZSTD_e_end - })); - else { - d.length = 0; - break; - } - } - } - let f = this.onError.bind(this); - return s({ - status: e, - statusText: r, - headersList: i, - body: d.length ? he(this.body, ...d, (e) => { - e && this.onError(e); - }).on(`error`, f) : this.body.on(`error`, f) - }), !0; - }, - onData(t) { - if (e.controller.dump) return; - let n = t; - return c.encodedBodySize += n.byteLength, this.body.push(n); - }, - onComplete() { - this.abort && e.controller.off(`terminated`, this.abort), e.controller.ended = !0, this.body.push(null); - }, - onError(t) { - this.abort && e.controller.off(`terminated`, this.abort), this.body?.destroy(t), e.controller.terminate(t), u(t); - }, - onRequestUpgrade(e, t, n, r) { - if (r.session != null && t !== 200 || r.session == null && t !== 101) return !1; - let i = new l(); - for (let [e, t] of Object.entries(n)) { - if (t == null) continue; - let n = e.toLowerCase(); - if (Array.isArray(t)) for (let e of t) i.append(n, String(e), !0); - else i.append(n, String(t), !0); - } - return s({ - status: t, - statusText: Te[t], - headersList: i, - socket: r - }), !0; - }, - onUpgrade(e, t, n) { - if (n.session != null && e !== 200 || n.session == null && e !== 101) return !1; - let r = new l(); - for (let e = 0; e < t.length; e += 2) { - let n = ye(t[e]), i = t[e + 1]; - if (Array.isArray(i) && !Buffer.isBuffer(t[e + 1])) for (let e of i) r.append(n, e.toString(`latin1`), !0); - else r.append(n, i.toString(`latin1`), !0); - } - return s({ - status: e, - statusText: Te[e], - headersList: r, - socket: n - }), !0; - } - })); - } - } - t.exports = { - fetch: Ie, - Fetch: Pe, - fetching: Be, - finalizeAndReportTiming: Le - }; -})); -var bt = c$3(((e, t) => { - let r = p$4(`node:assert`), { URLSerializer: i } = J$1(), { isValidHeaderName: a } = Y$1(); - function o(e, t, n = !1) { - return i(e, n) === i(t, n); - } - function s(e) { - r(e !== null); - let t = []; - for (let n of e.split(`,`)) n = n.trim(), a(n) && t.push(n); - return t; - } - t.exports = { - urlEquals: o, - getFieldValues: s - }; -})); -var xt = c$3(((e, t) => { - let r = p$4(`node:assert`), { kConstruct: i } = I$1(), { urlEquals: a, getFieldValues: o } = bt(), { kEnumerableProperty: s, isDisturbed: c } = B$1(), { webidl: l } = de(), { cloneResponse: u, fromInnerResponse: d, getResponseState: f } = gt(), { Request: p, fromInnerRequest: m, getRequestState: h } = _t(), { fetching: g } = yt(), { urlIsHttpHttpsScheme: _, readAllBytes: v } = Y$1(), { createDeferredPromise: y } = X$1(); - var b = class e { - #e; - constructor() { - arguments[0] !== i && l.illegalConstructor(), l.util.markAsUncloneable(this), this.#e = arguments[1]; - } - async match(t, n = {}) { - l.brandCheck(this, e); - let r = `Cache.match`; - l.argumentLengthCheck(arguments, 1, r), t = l.converters.RequestInfo(t), n = l.converters.CacheQueryOptions(n, r, `options`); - let i = this.#i(t, n, 1); - if (i.length !== 0) return i[0]; - } - async matchAll(t = void 0, n = {}) { - return l.brandCheck(this, e), t !== void 0 && (t = l.converters.RequestInfo(t)), n = l.converters.CacheQueryOptions(n, `Cache.matchAll`, `options`), this.#i(t, n); - } - async add(t) { - l.brandCheck(this, e), l.argumentLengthCheck(arguments, 1, `Cache.add`), t = l.converters.RequestInfo(t); - let n = [t]; - return await this.addAll(n); - } - async addAll(t) { - l.brandCheck(this, e); - let n = `Cache.addAll`; - l.argumentLengthCheck(arguments, 1, n); - let r = [], i = []; - for (let e of t) { - if (e === void 0) throw l.errors.conversionFailed({ - prefix: n, - argument: `Argument 1`, - types: [`undefined is not allowed`] - }); - if (e = l.converters.RequestInfo(e), typeof e == `string`) continue; - let t = h(e); - if (!_(t.url) || t.method !== `GET`) throw l.errors.exception({ - header: n, - message: `Expected http/s scheme when method is not GET.` - }); - } - let a = []; - for (let e of t) { - let t = h(new p(e)); - if (!_(t.url)) throw l.errors.exception({ - header: n, - message: `Expected http/s scheme.` - }); - t.initiator = `fetch`, t.destination = `subresource`, i.push(t); - let s = y(); - a.push(g({ - request: t, - processResponse(e) { - if (e.type === `error` || e.status === 206 || e.status < 200 || e.status > 299) s.reject(l.errors.exception({ - header: `Cache.addAll`, - message: `Received an invalid status code or the request failed.` - })); - else if (e.headersList.contains(`vary`)) { - let t = o(e.headersList.get(`vary`)); - for (let e of t) if (e === `*`) { - s.reject(l.errors.exception({ - header: `Cache.addAll`, - message: `invalid vary field value` - })); - for (let e of a) e.abort(); - return; - } - } - }, - processResponseEndOfBody(e) { - if (e.aborted) { - s.reject(new DOMException(`aborted`, `AbortError`)); - return; - } - s.resolve(e); - } - })), r.push(s.promise); - } - let s = await Promise.all(r), c = [], u = 0; - for (let e of s) { - let t = { - type: `put`, - request: i[u], - response: e - }; - c.push(t), u++; - } - let d = y(), f = null; - try { - this.#t(c); - } catch (e) { - f = e; - } - return queueMicrotask(() => { - f === null ? d.resolve(void 0) : d.reject(f); - }), d.promise; - } - async put(t, n) { - l.brandCheck(this, e); - let r = `Cache.put`; - l.argumentLengthCheck(arguments, 2, r), t = l.converters.RequestInfo(t), n = l.converters.Response(n, r, `response`); - let i = null; - if (i = l.is.Request(t) ? h(t) : h(new p(t)), !_(i.url) || i.method !== `GET`) throw l.errors.exception({ - header: r, - message: `Expected an http/s scheme when method is not GET` - }); - let a = f(n); - if (a.status === 206) throw l.errors.exception({ - header: r, - message: `Got 206 status` - }); - if (a.headersList.contains(`vary`)) { - let e = o(a.headersList.get(`vary`)); - for (let t of e) if (t === `*`) throw l.errors.exception({ - header: r, - message: `Got * vary field value` - }); - } - if (a.body && (c(a.body.stream) || a.body.stream.locked)) throw l.errors.exception({ - header: r, - message: `Response body is locked or disturbed` - }); - let s = u(a), d = y(); - a.body == null ? d.resolve(void 0) : v(a.body.stream.getReader(), d.resolve, d.reject); - let m = [], g = { - type: `put`, - request: i, - response: s - }; - m.push(g); - let b = await d.promise; - s.body != null && (s.body.source = b); - let x = y(), S = null; - try { - this.#t(m); - } catch (e) { - S = e; - } - return queueMicrotask(() => { - S === null ? x.resolve() : x.reject(S); - }), x.promise; - } - async delete(t, n = {}) { - l.brandCheck(this, e); - let i = `Cache.delete`; - l.argumentLengthCheck(arguments, 1, i), t = l.converters.RequestInfo(t), n = l.converters.CacheQueryOptions(n, i, `options`); - let a = null; - if (l.is.Request(t)) { - if (a = h(t), a.method !== `GET` && !n.ignoreMethod) return !1; - } else r(typeof t == `string`), a = h(new p(t)); - let o = [], s = { - type: `delete`, - request: a, - options: n - }; - o.push(s); - let c = y(), u = null, d; - try { - d = this.#t(o); - } catch (e) { - u = e; - } - return queueMicrotask(() => { - u === null ? c.resolve(!!d?.length) : c.reject(u); - }), c.promise; - } - async keys(t = void 0, n = {}) { - l.brandCheck(this, e), t !== void 0 && (t = l.converters.RequestInfo(t)), n = l.converters.CacheQueryOptions(n, `Cache.keys`, `options`); - let r = null; - if (t !== void 0) if (l.is.Request(t)) { - if (r = h(t), r.method !== `GET` && !n.ignoreMethod) return []; - } else typeof t == `string` && (r = h(new p(t))); - let i = y(), a = []; - if (t === void 0) for (let e of this.#e) a.push(e[0]); - else { - let e = this.#n(r, n); - for (let t of e) a.push(t[0]); - } - return queueMicrotask(() => { - let e = []; - for (let t of a) { - let n = m(t, void 0, new AbortController().signal, `immutable`); - e.push(n); - } - i.resolve(Object.freeze(e)); - }), i.promise; - } - #t(e) { - let t = this.#e, n = [...t], i = [], a = []; - try { - for (let n of e) { - if (n.type !== `delete` && n.type !== `put`) throw l.errors.exception({ - header: `Cache.#batchCacheOperations`, - message: `operation type does not match "delete" or "put"` - }); - if (n.type === `delete` && n.response != null) throw l.errors.exception({ - header: `Cache.#batchCacheOperations`, - message: `delete operation should not have an associated response` - }); - if (this.#n(n.request, n.options, i).length) throw new DOMException(`???`, `InvalidStateError`); - let e; - if (n.type === `delete`) { - if (e = this.#n(n.request, n.options), e.length === 0) return []; - for (let n of e) { - let e = t.indexOf(n); - r(e !== -1), t.splice(e, 1); - } - } else if (n.type === `put`) { - if (n.response == null) throw l.errors.exception({ - header: `Cache.#batchCacheOperations`, - message: `put operation should have an associated response` - }); - let a = n.request; - if (!_(a.url)) throw l.errors.exception({ - header: `Cache.#batchCacheOperations`, - message: `expected http or https scheme` - }); - if (a.method !== `GET`) throw l.errors.exception({ - header: `Cache.#batchCacheOperations`, - message: `not get method` - }); - if (n.options != null) throw l.errors.exception({ - header: `Cache.#batchCacheOperations`, - message: `options must not be defined` - }); - e = this.#n(n.request); - for (let n of e) { - let e = t.indexOf(n); - r(e !== -1), t.splice(e, 1); - } - t.push([n.request, n.response]), i.push([n.request, n.response]); - } - a.push([n.request, n.response]); - } - return a; - } catch (e) { - throw this.#e.length = 0, this.#e = n, e; - } - } - #n(e, t, n) { - let r = [], i = n ?? this.#e; - for (let n of i) { - let [i, a] = n; - this.#r(e, i, a, t) && r.push(n); - } - return r; - } - #r(e, t, n = null, r) { - let i = new URL(e.url), s = new URL(t.url); - if (r?.ignoreSearch && (s.search = ``, i.search = ``), !a(i, s, !0)) return !1; - if (n == null || r?.ignoreVary || !n.headersList.contains(`vary`)) return !0; - let c = o(n.headersList.get(`vary`)); - for (let n of c) if (n === `*` || t.headersList.get(n) !== e.headersList.get(n)) return !1; - return !0; - } - #i(e, t, n = Infinity) { - let r = null; - if (e !== void 0) if (l.is.Request(e)) { - if (r = h(e), r.method !== `GET` && !t.ignoreMethod) return []; - } else typeof e == `string` && (r = h(new p(e))); - let i = []; - if (e === void 0) for (let e of this.#e) i.push(e[1]); - else { - let e = this.#n(r, t); - for (let t of e) i.push(t[1]); - } - let a = []; - for (let e of i) { - let t = d(u(e), `immutable`); - if (a.push(t), a.length >= n) break; - } - return Object.freeze(a); - } - }; - Object.defineProperties(b.prototype, { - [Symbol.toStringTag]: { - value: `Cache`, - configurable: !0 - }, - match: s, - matchAll: s, - add: s, - addAll: s, - put: s, - delete: s, - keys: s - }); - let x = [ - { - key: `ignoreSearch`, - converter: l.converters.boolean, - defaultValue: () => !1 - }, - { - key: `ignoreMethod`, - converter: l.converters.boolean, - defaultValue: () => !1 - }, - { - key: `ignoreVary`, - converter: l.converters.boolean, - defaultValue: () => !1 - } - ]; - l.converters.CacheQueryOptions = l.dictionaryConverter(x), l.converters.MultiCacheQueryOptions = l.dictionaryConverter([...x, { - key: `cacheName`, - converter: l.converters.DOMString - }]), l.converters.Response = l.interfaceConverter(l.is.Response, `Response`), l.converters[`sequence`] = l.sequenceConverter(l.converters.RequestInfo), t.exports = { Cache: b }; -})); -var St = c$3(((e, t) => { - let { Cache: n } = xt(), { webidl: r } = de(), { kEnumerableProperty: i } = B$1(), { kConstruct: a } = I$1(); - var o = class e { - #e = /* @__PURE__ */ new Map(); - constructor() { - arguments[0] !== a && r.illegalConstructor(), r.util.markAsUncloneable(this); - } - async match(t, i = {}) { - if (r.brandCheck(this, e), r.argumentLengthCheck(arguments, 1, `CacheStorage.match`), t = r.converters.RequestInfo(t), i = r.converters.MultiCacheQueryOptions(i), i.cacheName != null) { - if (this.#e.has(i.cacheName)) return await new n(a, this.#e.get(i.cacheName)).match(t, i); - } else for (let e of this.#e.values()) { - let r = await new n(a, e).match(t, i); - if (r !== void 0) return r; - } - } - async has(t) { - r.brandCheck(this, e); - let n = `CacheStorage.has`; - return r.argumentLengthCheck(arguments, 1, n), t = r.converters.DOMString(t, n, `cacheName`), this.#e.has(t); - } - async open(t) { - r.brandCheck(this, e); - let i = `CacheStorage.open`; - if (r.argumentLengthCheck(arguments, 1, i), t = r.converters.DOMString(t, i, `cacheName`), this.#e.has(t)) return new n(a, this.#e.get(t)); - let o = []; - return this.#e.set(t, o), new n(a, o); - } - async delete(t) { - r.brandCheck(this, e); - let n = `CacheStorage.delete`; - return r.argumentLengthCheck(arguments, 1, n), t = r.converters.DOMString(t, n, `cacheName`), this.#e.delete(t); - } - async keys() { - return r.brandCheck(this, e), [...this.#e.keys()]; - } - }; - Object.defineProperties(o.prototype, { - [Symbol.toStringTag]: { - value: `CacheStorage`, - configurable: !0 - }, - match: i, - has: i, - open: i, - delete: i, - keys: i - }), t.exports = { CacheStorage: o }; -})); -var Ct = c$3(((e, t) => { - t.exports = { - maxAttributeValueSize: 1024, - maxNameValuePairSize: 4096 - }; -})); -var wt = c$3(((e, t) => { - function n(e) { - for (let t = 0; t < e.length; ++t) { - let n = e.charCodeAt(t); - if (n >= 0 && n <= 8 || n >= 10 && n <= 31 || n === 127) return !0; - } - return !1; - } - function r(e) { - for (let t = 0; t < e.length; ++t) { - let n = e.charCodeAt(t); - if (n < 33 || n > 126 || n === 34 || n === 40 || n === 41 || n === 60 || n === 62 || n === 64 || n === 44 || n === 59 || n === 58 || n === 92 || n === 47 || n === 91 || n === 93 || n === 63 || n === 61 || n === 123 || n === 125) throw Error(`Invalid cookie name`); - } - } - function i(e) { - let t = e.length, n = 0; - if (e[0] === `"`) { - if (t === 1 || e[t - 1] !== `"`) throw Error(`Invalid cookie value`); - --t, ++n; - } - for (; n < t;) { - let t = e.charCodeAt(n++); - if (t < 33 || t > 126 || t === 34 || t === 44 || t === 59 || t === 92) throw Error(`Invalid cookie value`); - } - } - function a(e) { - for (let t = 0; t < e.length; ++t) { - let n = e.charCodeAt(t); - if (n < 32 || n === 127 || n === 59) throw Error(`Invalid cookie path`); - } - } - function o(e) { - if (e.startsWith(`-`) || e.endsWith(`.`) || e.endsWith(`-`)) throw Error(`Invalid cookie domain`); - } - let s = [ - `Sun`, - `Mon`, - `Tue`, - `Wed`, - `Thu`, - `Fri`, - `Sat` - ], c = [ - `Jan`, - `Feb`, - `Mar`, - `Apr`, - `May`, - `Jun`, - `Jul`, - `Aug`, - `Sep`, - `Oct`, - `Nov`, - `Dec` - ], l = Array(61).fill(0).map((e, t) => t.toString().padStart(2, `0`)); - function u(e) { - return typeof e == `number` && (e = new Date(e)), `${s[e.getUTCDay()]}, ${l[e.getUTCDate()]} ${c[e.getUTCMonth()]} ${e.getUTCFullYear()} ${l[e.getUTCHours()]}:${l[e.getUTCMinutes()]}:${l[e.getUTCSeconds()]} GMT`; - } - function d(e) { - if (e < 0) throw Error(`Invalid cookie max-age`); - } - function f(e) { - if (e.name.length === 0) return null; - r(e.name), i(e.value); - let t = [`${e.name}=${e.value}`]; - e.name.startsWith(`__Secure-`) && (e.secure = !0), e.name.startsWith(`__Host-`) && (e.secure = !0, e.domain = null, e.path = `/`), e.secure && t.push(`Secure`), e.httpOnly && t.push(`HttpOnly`), typeof e.maxAge == `number` && (d(e.maxAge), t.push(`Max-Age=${e.maxAge}`)), e.domain && (o(e.domain), t.push(`Domain=${e.domain}`)), e.path && (a(e.path), t.push(`Path=${e.path}`)), e.expires && e.expires.toString() !== `Invalid Date` && t.push(`Expires=${u(e.expires)}`), e.sameSite && t.push(`SameSite=${e.sameSite}`); - for (let n of e.unparsed) { - if (!n.includes(`=`)) throw Error(`Invalid unparsed`); - let [e, ...r] = n.split(`=`); - t.push(`${e.trim()}=${r.join(`=`)}`); - } - return t.join(`; `); - } - t.exports = { - isCTLExcludingHtab: n, - validateCookieName: r, - validateCookiePath: a, - validateCookieValue: i, - toIMFDate: u, - stringify: f - }; -})); -var Tt = c$3(((e, t) => { - let { collectASequenceOfCodePointsFast: r } = q$1(), { maxNameValuePairSize: i, maxAttributeValueSize: a } = Ct(), { isCTLExcludingHtab: o } = wt(), s = p$4(`node:assert`), { unescape: c } = p$4(`node:querystring`); - function l(e) { - if (o(e)) return null; - let t = ``, n = ``, a = ``, s = ``; - if (e.includes(`;`)) { - let i = { position: 0 }; - t = r(`;`, e, i), n = e.slice(i.position); - } else t = e; - if (!t.includes(`=`)) s = t; - else { - let e = { position: 0 }; - a = r(`=`, t, e), s = t.slice(e.position + 1); - } - return a = a.trim(), s = s.trim(), a.length + s.length > i ? null : { - name: a, - value: c(s), - ...u(n) - }; - } - function u(e, t = {}) { - if (e.length === 0) return t; - s(e[0] === `;`), e = e.slice(1); - let n = ``; - e.includes(`;`) ? (n = r(`;`, e, { position: 0 }), e = e.slice(n.length)) : (n = e, e = ``); - let i = ``, o = ``; - if (n.includes(`=`)) { - let e = { position: 0 }; - i = r(`=`, n, e), o = n.slice(e.position + 1); - } else i = n; - if (i = i.trim(), o = o.trim(), o.length > a) return u(e, t); - let c = i.toLowerCase(); - if (c === `expires`) t.expires = new Date(o); - else if (c === `max-age`) { - let n = o.charCodeAt(0); - if ((n < 48 || n > 57) && o[0] !== `-` || !/^\d+$/.test(o)) return u(e, t); - t.maxAge = Number(o); - } else if (c === `domain`) { - let e = o; - e[0] === `.` && (e = e.slice(1)), e = e.toLowerCase(), t.domain = e; - } else if (c === `path`) { - let e = ``; - e = o.length === 0 || o[0] !== `/` ? `/` : o, t.path = e; - } else if (c === `secure`) t.secure = !0; - else if (c === `httponly`) t.httpOnly = !0; - else if (c === `samesite`) { - let e = `Default`, n = o.toLowerCase(); - n.includes(`none`) && (e = `None`), n.includes(`strict`) && (e = `Strict`), n.includes(`lax`) && (e = `Lax`), t.sameSite = e; - } else t.unparsed ??= [], t.unparsed.push(`${i}=${o}`); - return u(e, t); - } - t.exports = { - parseSetCookie: l, - parseUnparsedAttributes: u - }; -})); -var Et = c$3(((e, t) => { - let { parseSetCookie: n } = Tt(), { stringify: r } = wt(), { webidl: i } = de(), { Headers: a } = ht(), o = i.brandCheckMultiple([a, globalThis.Headers].filter(Boolean)); - function s(e) { - i.argumentLengthCheck(arguments, 1, `getCookies`), o(e); - let t = e.get(`cookie`), n = {}; - if (!t) return n; - for (let e of t.split(`;`)) { - let [t, ...r] = e.split(`=`); - n[t.trim()] = r.join(`=`); - } - return n; - } - function c(e, t, n) { - o(e); - let r = `deleteCookie`; - i.argumentLengthCheck(arguments, 2, r), t = i.converters.DOMString(t, r, `name`), n = i.converters.DeleteCookieAttributes(n), d(e, { - name: t, - value: ``, - expires: /* @__PURE__ */ new Date(0), - ...n - }); - } - function l(e) { - i.argumentLengthCheck(arguments, 1, `getSetCookies`), o(e); - let t = e.getSetCookie(); - return t ? t.map((e) => n(e)) : []; - } - function u(e) { - return e = i.converters.DOMString(e), n(e); - } - function d(e, t) { - i.argumentLengthCheck(arguments, 2, `setCookie`), o(e), t = i.converters.Cookie(t); - let n = r(t); - n && e.append(`set-cookie`, n, !0); - } - i.converters.DeleteCookieAttributes = i.dictionaryConverter([{ - converter: i.nullableConverter(i.converters.DOMString), - key: `path`, - defaultValue: () => null - }, { - converter: i.nullableConverter(i.converters.DOMString), - key: `domain`, - defaultValue: () => null - }]), i.converters.Cookie = i.dictionaryConverter([ - { - converter: i.converters.DOMString, - key: `name` - }, - { - converter: i.converters.DOMString, - key: `value` - }, - { - converter: i.nullableConverter((e) => typeof e == `number` ? i.converters[`unsigned long long`](e) : new Date(e)), - key: `expires`, - defaultValue: () => null - }, - { - converter: i.nullableConverter(i.converters[`long long`]), - key: `maxAge`, - defaultValue: () => null - }, - { - converter: i.nullableConverter(i.converters.DOMString), - key: `domain`, - defaultValue: () => null - }, - { - converter: i.nullableConverter(i.converters.DOMString), - key: `path`, - defaultValue: () => null - }, - { - converter: i.nullableConverter(i.converters.boolean), - key: `secure`, - defaultValue: () => null - }, - { - converter: i.nullableConverter(i.converters.boolean), - key: `httpOnly`, - defaultValue: () => null - }, - { - converter: i.converters.USVString, - key: `sameSite`, - allowedValues: [ - `Strict`, - `Lax`, - `None` - ] - }, - { - converter: i.sequenceConverter(i.converters.DOMString), - key: `unparsed`, - defaultValue: () => [] - } - ]), t.exports = { - getCookies: s, - deleteCookie: c, - getSetCookies: l, - setCookie: d, - parseCookie: u - }; -})); -var Dt = c$3(((e, t) => { - let { webidl: n } = de(), { kEnumerableProperty: r } = B$1(), { kConstruct: i } = I$1(); - var a = class e extends Event { - #e; - constructor(e, t = {}) { - if (e === i) { - super(arguments[1], arguments[2]), n.util.markAsUncloneable(this); - return; - } - let r = `MessageEvent constructor`; - n.argumentLengthCheck(arguments, 1, r), e = n.converters.DOMString(e, r, `type`), t = n.converters.MessageEventInit(t, r, `eventInitDict`), super(e, t), this.#e = t, n.util.markAsUncloneable(this); - } - get data() { - return n.brandCheck(this, e), this.#e.data; - } - get origin() { - return n.brandCheck(this, e), this.#e.origin; - } - get lastEventId() { - return n.brandCheck(this, e), this.#e.lastEventId; - } - get source() { - return n.brandCheck(this, e), this.#e.source; - } - get ports() { - return n.brandCheck(this, e), Object.isFrozen(this.#e.ports) || Object.freeze(this.#e.ports), this.#e.ports; - } - initMessageEvent(t, r = !1, i = !1, a = null, o = ``, s = ``, c = null, l = []) { - return n.brandCheck(this, e), n.argumentLengthCheck(arguments, 1, `MessageEvent.initMessageEvent`), new e(t, { - bubbles: r, - cancelable: i, - data: a, - origin: o, - lastEventId: s, - source: c, - ports: l - }); - } - static createFastMessageEvent(t, n) { - let r = new e(i, t, n); - return r.#e = n, r.#e.data ??= null, r.#e.origin ??= ``, r.#e.lastEventId ??= ``, r.#e.source ??= null, r.#e.ports ??= [], r; - } - }; - let { createFastMessageEvent: o } = a; - delete a.createFastMessageEvent; - var s = class e extends Event { - #e; - constructor(e, t = {}) { - let r = `CloseEvent constructor`; - n.argumentLengthCheck(arguments, 1, r), e = n.converters.DOMString(e, r, `type`), t = n.converters.CloseEventInit(t), super(e, t), this.#e = t, n.util.markAsUncloneable(this); - } - get wasClean() { - return n.brandCheck(this, e), this.#e.wasClean; - } - get code() { - return n.brandCheck(this, e), this.#e.code; - } - get reason() { - return n.brandCheck(this, e), this.#e.reason; - } - }, c = class e extends Event { - #e; - constructor(e, t) { - let r = `ErrorEvent constructor`; - n.argumentLengthCheck(arguments, 1, r), super(e, t), n.util.markAsUncloneable(this), e = n.converters.DOMString(e, r, `type`), t = n.converters.ErrorEventInit(t ?? {}), this.#e = t; - } - get message() { - return n.brandCheck(this, e), this.#e.message; - } - get filename() { - return n.brandCheck(this, e), this.#e.filename; - } - get lineno() { - return n.brandCheck(this, e), this.#e.lineno; - } - get colno() { - return n.brandCheck(this, e), this.#e.colno; - } - get error() { - return n.brandCheck(this, e), this.#e.error; - } - }; - Object.defineProperties(a.prototype, { - [Symbol.toStringTag]: { - value: `MessageEvent`, - configurable: !0 - }, - data: r, - origin: r, - lastEventId: r, - source: r, - ports: r, - initMessageEvent: r - }), Object.defineProperties(s.prototype, { - [Symbol.toStringTag]: { - value: `CloseEvent`, - configurable: !0 - }, - reason: r, - code: r, - wasClean: r - }), Object.defineProperties(c.prototype, { - [Symbol.toStringTag]: { - value: `ErrorEvent`, - configurable: !0 - }, - message: r, - filename: r, - lineno: r, - colno: r, - error: r - }), n.converters.MessagePort = n.interfaceConverter(n.is.MessagePort, `MessagePort`), n.converters[`sequence`] = n.sequenceConverter(n.converters.MessagePort); - let l = [ - { - key: `bubbles`, - converter: n.converters.boolean, - defaultValue: () => !1 - }, - { - key: `cancelable`, - converter: n.converters.boolean, - defaultValue: () => !1 - }, - { - key: `composed`, - converter: n.converters.boolean, - defaultValue: () => !1 - } - ]; - n.converters.MessageEventInit = n.dictionaryConverter([ - ...l, - { - key: `data`, - converter: n.converters.any, - defaultValue: () => null - }, - { - key: `origin`, - converter: n.converters.USVString, - defaultValue: () => `` - }, - { - key: `lastEventId`, - converter: n.converters.DOMString, - defaultValue: () => `` - }, - { - key: `source`, - converter: n.nullableConverter(n.converters.MessagePort), - defaultValue: () => null - }, - { - key: `ports`, - converter: n.converters[`sequence`], - defaultValue: () => [] - } - ]), n.converters.CloseEventInit = n.dictionaryConverter([ - ...l, - { - key: `wasClean`, - converter: n.converters.boolean, - defaultValue: () => !1 - }, - { - key: `code`, - converter: n.converters[`unsigned short`], - defaultValue: () => 0 - }, - { - key: `reason`, - converter: n.converters.USVString, - defaultValue: () => `` - } - ]), n.converters.ErrorEventInit = n.dictionaryConverter([ - ...l, - { - key: `message`, - converter: n.converters.DOMString, - defaultValue: () => `` - }, - { - key: `filename`, - converter: n.converters.USVString, - defaultValue: () => `` - }, - { - key: `lineno`, - converter: n.converters[`unsigned long`], - defaultValue: () => 0 - }, - { - key: `colno`, - converter: n.converters[`unsigned long`], - defaultValue: () => 0 - }, - { - key: `error`, - converter: n.converters.any - } - ]), t.exports = { - MessageEvent: a, - CloseEvent: s, - ErrorEvent: c, - createFastMessageEvent: o - }; -})); -var Ot = c$3(((e, t) => { - t.exports = { - uid: `258EAFA5-E914-47DA-95CA-C5AB0DC85B11`, - sentCloseFrameState: { - SENT: 1, - RECEIVED: 2 - }, - staticPropertyDescriptors: { - enumerable: !0, - writable: !1, - configurable: !1 - }, - states: { - CONNECTING: 0, - OPEN: 1, - CLOSING: 2, - CLOSED: 3 - }, - opcodes: { - CONTINUATION: 0, - TEXT: 1, - BINARY: 2, - CLOSE: 8, - PING: 9, - PONG: 10 - }, - maxUnsigned16Bit: 65535, - parserStates: { - INFO: 0, - PAYLOADLENGTH_16: 2, - PAYLOADLENGTH_64: 3, - READ_DATA: 4 - }, - emptyBuffer: Buffer.allocUnsafe(0), - sendHints: { - text: 1, - typedArray: 2, - arrayBuffer: 3, - blob: 4 - } - }; -})); -var kt = c$3(((e, t) => { - let { states: r, opcodes: i } = Ot(), { isUtf8: a } = p$4(`node:buffer`), { removeHTTPWhitespace: o } = J$1(), { collectASequenceOfCodePointsFast: s } = q$1(); - function c(e) { - return e === r.CONNECTING; - } - function l(e) { - return e === r.OPEN; - } - function u(e) { - return e === r.CLOSING; - } - function d(e) { - return e === r.CLOSED; - } - function f(e, t, n = (e, t) => new Event(e, t), r = {}) { - let i = n(e, r); - t.dispatchEvent(i); - } - function p(e, t, n) { - e.onMessage(t, n); - } - function m(e) { - return e.byteLength === e.buffer.byteLength ? e.buffer : new Uint8Array(e).buffer; - } - function h(e) { - if (e.length === 0) return !1; - for (let t = 0; t < e.length; ++t) { - let n = e.charCodeAt(t); - if (n < 33 || n > 126 || n === 34 || n === 40 || n === 41 || n === 44 || n === 47 || n === 58 || n === 59 || n === 60 || n === 61 || n === 62 || n === 63 || n === 64 || n === 91 || n === 92 || n === 93 || n === 123 || n === 125) return !1; - } - return !0; - } - function g(e) { - return e >= 1e3 && e < 1015 ? e !== 1004 && e !== 1005 && e !== 1006 : e >= 3e3 && e <= 4999; - } - function _(e) { - return e === i.CLOSE || e === i.PING || e === i.PONG; - } - function v(e) { - return e === i.CONTINUATION; - } - function y(e) { - return e === i.TEXT || e === i.BINARY; - } - function b(e) { - return y(e) || v(e) || _(e); - } - function x(e) { - let t = { position: 0 }, n = /* @__PURE__ */ new Map(); - for (; t.position < e.length;) { - let [r, i = ``] = s(`;`, e, t).split(`=`, 2); - n.set(o(r, !0, !1), o(i, !1, !0)), t.position++; - } - return n; - } - function S(e) { - if (e.length === 0) return !1; - for (let t = 0; t < e.length; t++) { - let n = e.charCodeAt(t); - if (n < 48 || n > 57) return !1; - } - let t = Number.parseInt(e, 10); - return t >= 8 && t <= 15; - } - function C(e, t) { - let n; - try { - n = new URL(e, t); - } catch (e) { - throw new DOMException(e, `SyntaxError`); - } - if (n.protocol === `http:` ? n.protocol = `ws:` : n.protocol === `https:` && (n.protocol = `wss:`), n.protocol !== `ws:` && n.protocol !== `wss:`) throw new DOMException(`expected a ws: or wss: url`, `SyntaxError`); - if (n.hash.length || n.href.endsWith(`#`)) throw new DOMException(`hash`, `SyntaxError`); - return n; - } - function w(e, t) { - if (e !== null && e !== 1e3 && (e < 3e3 || e > 4999)) throw new DOMException(`invalid code`, `InvalidAccessError`); - if (t !== null) { - let e = Buffer.byteLength(t); - if (e > 123) throw new DOMException(`Reason must be less than 123 bytes; received ${e}`, `SyntaxError`); - } - } - t.exports = { - isConnecting: c, - isEstablished: l, - isClosing: u, - isClosed: d, - fireEvent: f, - isValidSubprotocol: h, - isValidStatusCode: g, - websocketMessageReceived: p, - utf8Decode: (() => { - if (typeof process.versions.icu == `string`) { - let e = new TextDecoder(`utf-8`, { fatal: !0 }); - return e.decode.bind(e); - } - return function(e) { - if (a(e)) return e.toString(`utf-8`); - throw TypeError(`Invalid utf-8 received.`); - }; - })(), - isControlFrame: _, - isContinuationFrame: v, - isTextBinaryFrame: y, - isValidOpcode: b, - parseExtensions: x, - isValidClientWindowBits: S, - toArrayBuffer: m, - getURLRecord: C, - validateCloseCodeAndReason: w - }; -})); -var At = c$3(((e, t) => { - let { runtimeFeatures: r } = ue(), { maxUnsigned16Bit: i, opcodes: a } = Ot(), o = 8 * 1024, s = null, c = o, l = r.has(`crypto`) ? p$4(`node:crypto`).randomFillSync : function(e, t, n) { - for (let t = 0; t < e.length; ++t) e[t] = Math.random() * 255 | 0; - return e; - }; - function u() { - return c === o && (c = 0, l(s ??= Buffer.allocUnsafeSlow(o), 0, o)), [ - s[c++], - s[c++], - s[c++], - s[c++] - ]; - } - t.exports = { - WebsocketFrameSend: class { - constructor(e) { - this.frameData = e; - } - createFrame(e) { - let t = this.frameData, n = u(), r = t?.byteLength ?? 0, a = r, o = 6; - r > i ? (o += 8, a = 127) : r > 125 && (o += 2, a = 126); - let s = Buffer.allocUnsafe(r + o); - s[0] = s[1] = 0, s[0] |= 128, s[0] = (s[0] & 240) + e, s[o - 4] = n[0], s[o - 3] = n[1], s[o - 2] = n[2], s[o - 1] = n[3], s[1] = a, a === 126 ? s.writeUInt16BE(r, 2) : a === 127 && (s[2] = s[3] = 0, s.writeUIntBE(r, 4, 6)), s[1] |= 128; - for (let e = 0; e < r; ++e) s[o + e] = t[e] ^ n[e & 3]; - return s; - } - static createFastTextFrame(e) { - let t = u(), n = e.length; - for (let r = 0; r < n; ++r) e[r] ^= t[r & 3]; - let r = n, o = 6; - n > i ? (o += 8, r = 127) : n > 125 && (o += 2, r = 126); - let s = Buffer.allocUnsafeSlow(o); - return s[0] = 128 | a.TEXT, s[1] = r | 128, s[o - 4] = t[0], s[o - 3] = t[1], s[o - 2] = t[2], s[o - 1] = t[3], r === 126 ? s.writeUInt16BE(n, 2) : r === 127 && (s[2] = s[3] = 0, s.writeUIntBE(n, 4, 6)), [s, e]; - } - }, - generateMask: u - }; -})); -var jt = c$3(((e, t) => { - let { uid: r, states: i, sentCloseFrameState: a, emptyBuffer: o, opcodes: s } = Ot(), { parseExtensions: c, isClosed: l, isClosing: u, isEstablished: d, isConnecting: f, validateCloseCodeAndReason: p } = kt(), { makeRequest: m } = _t(), { fetching: h } = yt(), { Headers: g, getHeadersList: _ } = ht(), { getDecodeSplit: v } = Y$1(), { WebsocketFrameSend: y } = At(), b = p$4(`node:assert`), { runtimeFeatures: x } = ue(), S = x.has(`crypto`) ? p$4(`node:crypto`) : null, C = !1; - function w(e, t, n, i, a) { - let o = e; - o.protocol = e.protocol === `ws:` ? `http:` : `https:`; - let s = m({ - urlList: [o], - client: n, - serviceWorkers: `none`, - referrer: `no-referrer`, - mode: `websocket`, - credentials: `include`, - cache: `no-store`, - redirect: `error`, - useURLCredentials: !0 - }); - a.headers && (s.headersList = _(new g(a.headers))); - let l = S.randomBytes(16).toString(`base64`); - s.headersList.append(`sec-websocket-key`, l, !0), s.headersList.append(`sec-websocket-version`, `13`, !0); - for (let e of t) s.headersList.append(`sec-websocket-protocol`, e, !0); - return s.headersList.append(`sec-websocket-extensions`, `permessage-deflate; client_max_window_bits`, !0), h({ - request: s, - useParallelQueue: !0, - dispatcher: a.dispatcher, - processResponse(e) { - if (e.type === `error` || e.status !== 101) { - if (e.socket?.session == null) { - E(i, 1002, `Received network error or non-101 status code.`, e.error); - return; - } - if (e.status !== 200) { - E(i, 1002, `Received network error or non-200 status code.`, e.error); - return; - } - } - if (C === !1 && e.socket?.session != null && (process.emitWarning(`WebSocket over HTTP2 is experimental, and subject to change.`, `ExperimentalWarning`), C = !0), t.length !== 0 && !e.headersList.get(`Sec-WebSocket-Protocol`)) { - E(i, 1002, `Server did not respond with sent protocols.`); - return; - } - if (e.socket.session == null && e.headersList.get(`Upgrade`)?.toLowerCase() !== `websocket`) { - E(i, 1002, `Server did not set Upgrade header to "websocket".`); - return; - } - if (e.socket.session == null && e.headersList.get(`Connection`)?.toLowerCase() !== `upgrade`) { - E(i, 1002, `Server did not set Connection header to "upgrade".`); - return; - } - if (e.headersList.get(`Sec-WebSocket-Accept`) !== S.hash(`sha1`, l + r, `base64`)) { - E(i, 1002, `Incorrect hash received in Sec-WebSocket-Accept header.`); - return; - } - let n = e.headersList.get(`Sec-WebSocket-Extensions`), a; - if (n !== null && (a = c(n), !a.has(`permessage-deflate`))) { - E(i, 1002, `Sec-WebSocket-Extensions header does not match.`); - return; - } - let o = e.headersList.get(`Sec-WebSocket-Protocol`); - if (o !== null && !v(`sec-websocket-protocol`, s.headersList).includes(o)) { - E(i, 1002, `Protocol was not set in the opening handshake.`); - return; - } - e.socket.on(`data`, i.onSocketData), e.socket.on(`close`, i.onSocketClose), e.socket.on(`error`, i.onSocketError), i.wasEverConnected = !0, i.onConnectionEstablished(e, a); - } - }); - } - function T(e, t, n, r = !1) { - if (t ??= null, n ??= ``, r && p(t, n), !(l(e.readyState) || u(e.readyState))) if (!d(e.readyState)) E(e), e.readyState = i.CLOSING; - else if (!e.closeState.has(a.SENT) && !e.closeState.has(a.RECEIVED)) { - let r = new y(); - n.length !== 0 && t === null && (t = 1e3), b(t === null || Number.isInteger(t)), t === null && n.length === 0 ? r.frameData = o : t !== null && n === null ? (r.frameData = Buffer.allocUnsafe(2), r.frameData.writeUInt16BE(t, 0)) : t !== null && n !== null ? (r.frameData = Buffer.allocUnsafe(2 + Buffer.byteLength(n)), r.frameData.writeUInt16BE(t, 0), r.frameData.write(n, 2, `utf-8`)) : r.frameData = o, e.socket.write(r.createFrame(s.CLOSE)), e.closeState.add(a.SENT), e.readyState = i.CLOSING; - } else e.readyState = i.CLOSING; - } - function E(e, t, n, r) { - d(e.readyState) && T(e, t, n, !1), e.controller.abort(), f(e.readyState) ? e.onSocketClose() : e.socket?.destroyed === !1 && e.socket.destroy(); - } - t.exports = { - establishWebSocketConnection: w, - failWebsocketConnection: E, - closeWebSocketConnection: T - }; -})); -var Mt = c$3(((e, t) => { - let { createInflateRaw: r, Z_DEFAULT_WINDOWBITS: i } = p$4(`node:zlib`), { isValidClientWindowBits: a } = kt(), { MessageSizeExceededError: o } = R$1(), s = Buffer.from([ - 0, - 0, - 255, - 255 - ]), c = Symbol(`kBuffer`), l = Symbol(`kLength`); - t.exports = { PerMessageDeflate: class { - #e; - #t = {}; - #n = !1; - #r = null; - constructor(e) { - this.#t.serverNoContextTakeover = e.has(`server_no_context_takeover`), this.#t.serverMaxWindowBits = e.get(`server_max_window_bits`); - } - decompress(e, t, n) { - if (this.#n) { - n(new o()); - return; - } - if (!this.#e) { - let e = i; - if (this.#t.serverMaxWindowBits) { - if (!a(this.#t.serverMaxWindowBits)) { - n(Error(`Invalid server_max_window_bits`)); - return; - } - e = Number.parseInt(this.#t.serverMaxWindowBits); - } - try { - this.#e = r({ windowBits: e }); - } catch (e) { - n(e); - return; - } - this.#e[c] = [], this.#e[l] = 0, this.#e.on(`data`, (e) => { - if (!this.#n) { - if (this.#e[l] += e.length, this.#e[l] > 4194304) { - if (this.#n = !0, this.#e.removeAllListeners(), this.#e.destroy(), this.#e = null, this.#r) { - let e = this.#r; - this.#r = null, e(new o()); - } - return; - } - this.#e[c].push(e); - } - }), this.#e.on(`error`, (e) => { - this.#e = null, n(e); - }); - } - this.#r = n, this.#e.write(e), t && this.#e.write(s), this.#e.flush(() => { - if (this.#n || !this.#e) return; - let e = Buffer.concat(this.#e[c], this.#e[l]); - this.#e[c].length = 0, this.#e[l] = 0, this.#r = null, n(null, e); - }); - } - } }; -})); -var Nt = c$3(((e, t) => { - let { Writable: r } = p$4(`node:stream`), i = p$4(`node:assert`), { parserStates: a, opcodes: o, states: s, emptyBuffer: c, sentCloseFrameState: l } = Ot(), { isValidStatusCode: u, isValidOpcode: d, websocketMessageReceived: f, utf8Decode: p, isControlFrame: m, isTextBinaryFrame: h, isContinuationFrame: g } = kt(), { failWebsocketConnection: _ } = jt(), { WebsocketFrameSend: v } = At(), { PerMessageDeflate: y } = Mt(), { MessageSizeExceededError: b } = R$1(); - t.exports = { ByteParser: class extends r { - #e = []; - #t = 0; - #n = 0; - #r = !1; - #i = a.INFO; - #a = {}; - #o = []; - #s; - #c; - constructor(e, t) { - super(), this.#c = e, this.#s = t ?? /* @__PURE__ */ new Map(), this.#s.has(`permessage-deflate`) && this.#s.set(`permessage-deflate`, new y(t)); - } - _write(e, t, n) { - this.#e.push(e), this.#n += e.length, this.#r = !0, this.run(n); - } - run(e) { - for (; this.#r;) if (this.#i === a.INFO) { - if (this.#n < 2) return e(); - let t = this.consume(2), n = (t[0] & 128) != 0, r = t[0] & 15, i = (t[1] & 128) == 128, s = !n && r !== o.CONTINUATION, c = t[1] & 127, l = t[0] & 64, u = t[0] & 32, f = t[0] & 16; - if (!d(r)) return _(this.#c, 1002, `Invalid opcode received`), e(); - if (i) return _(this.#c, 1002, `Frame cannot be masked`), e(); - if (l !== 0 && !this.#s.has(`permessage-deflate`)) { - _(this.#c, 1002, `Expected RSV1 to be clear.`); - return; - } - if (u !== 0 || f !== 0) { - _(this.#c, 1002, `RSV1, RSV2, RSV3 must be clear`); - return; - } - if (s && !h(r)) { - _(this.#c, 1002, `Invalid frame type was fragmented.`); - return; - } - if (h(r) && this.#o.length > 0) { - _(this.#c, 1002, `Expected continuation frame`); - return; - } - if (this.#a.fragmented && s) { - _(this.#c, 1002, `Fragmented frame exceeded 125 bytes.`); - return; - } - if ((c > 125 || s) && m(r)) { - _(this.#c, 1002, `Control frame either too large or fragmented`); - return; - } - if (g(r) && this.#o.length === 0 && !this.#a.compressed) { - _(this.#c, 1002, `Unexpected continuation frame`); - return; - } - c <= 125 ? (this.#a.payloadLength = c, this.#i = a.READ_DATA) : c === 126 ? this.#i = a.PAYLOADLENGTH_16 : c === 127 && (this.#i = a.PAYLOADLENGTH_64), h(r) && (this.#a.binaryType = r, this.#a.compressed = l !== 0), this.#a.opcode = r, this.#a.masked = i, this.#a.fin = n, this.#a.fragmented = s; - } else if (this.#i === a.PAYLOADLENGTH_16) { - if (this.#n < 2) return e(); - let t = this.consume(2); - this.#a.payloadLength = t.readUInt16BE(0), this.#i = a.READ_DATA; - } else if (this.#i === a.PAYLOADLENGTH_64) { - if (this.#n < 8) return e(); - let t = this.consume(8), n = t.readUInt32BE(0), r = t.readUInt32BE(4); - if (n !== 0 || r > 2 ** 31 - 1) { - _(this.#c, 1009, `Received payload length > 2^31 bytes.`); - return; - } - this.#a.payloadLength = r, this.#i = a.READ_DATA; - } else if (this.#i === a.READ_DATA) { - if (this.#n < this.#a.payloadLength) return e(); - let t = this.consume(this.#a.payloadLength); - if (m(this.#a.opcode)) this.#r = this.parseControlFrame(t), this.#i = a.INFO; - else if (!this.#a.compressed) this.writeFragments(t), !this.#a.fragmented && this.#a.fin && f(this.#c, this.#a.binaryType, this.consumeFragments()), this.#i = a.INFO; - else { - this.#s.get(`permessage-deflate`).decompress(t, this.#a.fin, (t, n) => { - if (t) { - let e = t instanceof b ? 1009 : 1007; - _(this.#c, e, t.message); - return; - } - if (this.writeFragments(n), !this.#a.fin) { - this.#i = a.INFO, this.#r = !0, this.run(e); - return; - } - f(this.#c, this.#a.binaryType, this.consumeFragments()), this.#r = !0, this.#i = a.INFO, this.run(e); - }), this.#r = !1; - break; - } - } - } - consume(e) { - if (e > this.#n) throw Error(`Called consume() before buffers satiated.`); - if (e === 0) return c; - this.#n -= e; - let t = this.#e[0]; - if (t.length > e) return this.#e[0] = t.subarray(e, t.length), t.subarray(0, e); - if (t.length === e) return this.#e.shift(); - { - let t = 0, n = Buffer.allocUnsafeSlow(e); - for (; t !== e;) { - let r = this.#e[0], i = r.length; - if (i + t === e) { - n.set(this.#e.shift(), t); - break; - } else if (i + t > e) { - n.set(r.subarray(0, e - t), t), this.#e[0] = r.subarray(e - t); - break; - } else n.set(this.#e.shift(), t), t += i; - } - return n; - } - } - writeFragments(e) { - this.#t += e.length, this.#o.push(e); - } - consumeFragments() { - let e = this.#o; - if (e.length === 1) return this.#t = 0, e.shift(); - let t = 0, n = Buffer.allocUnsafeSlow(this.#t); - for (let r = 0; r < e.length; ++r) { - let i = e[r]; - n.set(i, t), t += i.length; - } - return this.#o = [], this.#t = 0, n; - } - parseCloseBody(e) { - i(e.length !== 1); - let t; - if (e.length >= 2 && (t = e.readUInt16BE(0)), t !== void 0 && !u(t)) return { - code: 1002, - reason: `Invalid status code`, - error: !0 - }; - let n = e.subarray(2); - n[0] === 239 && n[1] === 187 && n[2] === 191 && (n = n.subarray(3)); - try { - n = p(n); - } catch { - return { - code: 1007, - reason: `Invalid UTF-8`, - error: !0 - }; - } - return { - code: t, - reason: n, - error: !1 - }; - } - parseControlFrame(e) { - let { opcode: t, payloadLength: n } = this.#a; - if (t === o.CLOSE) { - if (n === 1) return _(this.#c, 1002, `Received close frame with a 1-byte body.`), !1; - if (this.#a.closeInfo = this.parseCloseBody(e), this.#a.closeInfo.error) { - let { code: e, reason: t } = this.#a.closeInfo; - return _(this.#c, e, t), !1; - } - if (!this.#c.closeState.has(l.SENT) && !this.#c.closeState.has(l.RECEIVED)) { - let e = c; - this.#a.closeInfo.code && (e = Buffer.allocUnsafe(2), e.writeUInt16BE(this.#a.closeInfo.code, 0)); - let t = new v(e); - this.#c.socket.write(t.createFrame(o.CLOSE)), this.#c.closeState.add(l.SENT); - } - return this.#c.readyState = s.CLOSING, this.#c.closeState.add(l.RECEIVED), !1; - } else if (t === o.PING) { - if (!this.#c.closeState.has(l.RECEIVED)) { - let t = new v(e); - this.#c.socket.write(t.createFrame(o.PONG)), this.#c.onPing(e); - } - } else t === o.PONG && this.#c.onPong(e); - return !0; - } - get closingInfo() { - return this.#a.closeInfo; - } - } }; -})); -var Pt = c$3(((e, t) => { - let { WebsocketFrameSend: n } = At(), { opcodes: r, sendHints: i } = Ot(), a = _e(); - var o = class { - #e = new a(); - #t = !1; - #n; - constructor(e) { - this.#n = e; - } - add(e, t, r) { - if (r !== i.blob) { - if (this.#t) { - let n = { - promise: null, - callback: t, - frame: s(e, r) - }; - this.#e.push(n); - } else if (r === i.text) { - let { 0: r, 1: i } = n.createFastTextFrame(e); - this.#n.cork(), this.#n.write(r), this.#n.write(i, t), this.#n.uncork(); - } else this.#n.write(s(e, r), t); - return; - } - let a = { - promise: e.arrayBuffer().then((e) => { - a.promise = null, a.frame = s(e, r); - }), - callback: t, - frame: null - }; - this.#e.push(a), this.#t || this.#r(); - } - async #r() { - this.#t = !0; - let e = this.#e; - for (; !e.isEmpty();) { - let t = e.shift(); - t.promise !== null && await t.promise, this.#n.write(t.frame, t.callback), t.callback = t.frame = null; - } - this.#t = !1; - } - }; - function s(e, t) { - return new n(c(e, t)).createFrame(t === i.text ? r.TEXT : r.BINARY); - } - function c(e, t) { - switch (t) { - case i.text: - case i.typedArray: return new Uint8Array(e.buffer, e.byteOffset, e.byteLength); - case i.arrayBuffer: - case i.blob: return new Uint8Array(e); - } - } - t.exports = { SendQueue: o }; -})); -var Ft = c$3(((e, t) => { - let { isArrayBuffer: r } = p$4(`node:util/types`), { webidl: i } = de(), { URLSerializer: a } = J$1(), { environmentSettingsObject: o } = Y$1(), { staticPropertyDescriptors: s, states: c, sentCloseFrameState: l, sendHints: u, opcodes: d } = Ot(), { isConnecting: f, isEstablished: p, isClosing: m, isClosed: h, isValidSubprotocol: g, fireEvent: _, utf8Decode: v, toArrayBuffer: y, getURLRecord: b } = kt(), { establishWebSocketConnection: x, closeWebSocketConnection: S, failWebsocketConnection: C } = jt(), { ByteParser: w } = Nt(), { kEnumerableProperty: T } = B$1(), { getGlobalDispatcher: E } = Ze(), { ErrorEvent: D, CloseEvent: O, createFastMessageEvent: k } = Dt(), { SendQueue: A } = Pt(), { WebsocketFrameSend: j } = At(), { channels: M } = H$1(); - function N(e) { - return typeof e?.address == `function` ? e.address() : typeof e?.session?.socket?.address == `function` ? e.session.socket.address() : null; - } - var P = class e extends EventTarget { - #e = { - open: null, - error: null, - close: null, - message: null - }; - #t = 0; - #n = ``; - #r = ``; - #i; - #a = { - onConnectionEstablished: (e, t) => this.#l(e, t), - onMessage: (e, t) => this.#u(e, t), - onParserError: (e) => C(this.#a, null, e.message), - onParserDrain: () => this.#d(), - onSocketData: (e) => { - this.#c.write(e) || this.#a.socket.pause(); - }, - onSocketError: (e) => { - this.#a.readyState = c.CLOSING, M.socketError.hasSubscribers && M.socketError.publish(e), this.#a.socket.destroy(); - }, - onSocketClose: () => this.#f(), - onPing: (e) => { - M.ping.hasSubscribers && M.ping.publish({ - payload: e, - websocket: this - }); - }, - onPong: (e) => { - M.pong.hasSubscribers && M.pong.publish({ - payload: e, - websocket: this - }); - }, - readyState: c.CONNECTING, - socket: null, - closeState: /* @__PURE__ */ new Set(), - controller: null, - wasEverConnected: !1 - }; - #o; - #s; - #c; - constructor(t, n = []) { - super(), i.util.markAsUncloneable(this); - let r = `WebSocket constructor`; - i.argumentLengthCheck(arguments, 1, r); - let a = i.converters[`DOMString or sequence or WebSocketInit`](n, r, `options`); - t = i.converters.USVString(t), n = a.protocols; - let s = o.settingsObject.baseUrl, c = b(t, s); - if (typeof n == `string` && (n = [n]), n.length !== new Set(n.map((e) => e.toLowerCase())).size || n.length > 0 && !n.every((e) => g(e))) throw new DOMException(`Invalid Sec-WebSocket-Protocol value`, `SyntaxError`); - this.#o = new URL(c.href); - let l = o.settingsObject; - this.#a.controller = x(c, n, l, this.#a, a), this.#a.readyState = e.CONNECTING, this.#s = `blob`; - } - close(t = void 0, n = void 0) { - i.brandCheck(this, e), t !== void 0 && (t = i.converters[`unsigned short`](t, `WebSocket.close`, `code`, i.attributes.Clamp)), n !== void 0 && (n = i.converters.USVString(n)), t ??= null, n ??= ``, S(this.#a, t, n, !0); - } - send(t) { - i.brandCheck(this, e); - let n = `WebSocket.send`; - if (i.argumentLengthCheck(arguments, 1, n), t = i.converters.WebSocketSendData(t, n, `data`), f(this.#a.readyState)) throw new DOMException(`Sent before connected.`, `InvalidStateError`); - if (!(!p(this.#a.readyState) || m(this.#a.readyState))) if (typeof t == `string`) { - let e = Buffer.from(t); - this.#t += e.byteLength, this.#i.add(e, () => { - this.#t -= e.byteLength; - }, u.text); - } else r(t) ? (this.#t += t.byteLength, this.#i.add(t, () => { - this.#t -= t.byteLength; - }, u.arrayBuffer)) : ArrayBuffer.isView(t) ? (this.#t += t.byteLength, this.#i.add(t, () => { - this.#t -= t.byteLength; - }, u.typedArray)) : i.is.Blob(t) && (this.#t += t.size, this.#i.add(t, () => { - this.#t -= t.size; - }, u.blob)); - } - get readyState() { - return i.brandCheck(this, e), this.#a.readyState; - } - get bufferedAmount() { - return i.brandCheck(this, e), this.#t; - } - get url() { - return i.brandCheck(this, e), a(this.#o); - } - get extensions() { - return i.brandCheck(this, e), this.#r; - } - get protocol() { - return i.brandCheck(this, e), this.#n; - } - get onopen() { - return i.brandCheck(this, e), this.#e.open; - } - set onopen(t) { - i.brandCheck(this, e), this.#e.open && this.removeEventListener(`open`, this.#e.open); - let n = i.converters.EventHandlerNonNull(t); - n === null ? this.#e.open = null : (this.addEventListener(`open`, n), this.#e.open = t); - } - get onerror() { - return i.brandCheck(this, e), this.#e.error; - } - set onerror(t) { - i.brandCheck(this, e), this.#e.error && this.removeEventListener(`error`, this.#e.error); - let n = i.converters.EventHandlerNonNull(t); - n === null ? this.#e.error = null : (this.addEventListener(`error`, n), this.#e.error = t); - } - get onclose() { - return i.brandCheck(this, e), this.#e.close; - } - set onclose(t) { - i.brandCheck(this, e), this.#e.close && this.removeEventListener(`close`, this.#e.close); - let n = i.converters.EventHandlerNonNull(t); - n === null ? this.#e.close = null : (this.addEventListener(`close`, n), this.#e.close = t); - } - get onmessage() { - return i.brandCheck(this, e), this.#e.message; - } - set onmessage(t) { - i.brandCheck(this, e), this.#e.message && this.removeEventListener(`message`, this.#e.message); - let n = i.converters.EventHandlerNonNull(t); - n === null ? this.#e.message = null : (this.addEventListener(`message`, n), this.#e.message = t); - } - get binaryType() { - return i.brandCheck(this, e), this.#s; - } - set binaryType(t) { - i.brandCheck(this, e), t !== `blob` && t !== `arraybuffer` ? this.#s = `blob` : this.#s = t; - } - #l(e, t) { - this.#a.socket = e.socket; - let n = new w(this.#a, t); - n.on(`drain`, () => this.#a.onParserDrain()), n.on(`error`, (e) => this.#a.onParserError(e)), this.#c = n, this.#i = new A(e.socket), this.#a.readyState = c.OPEN; - let r = e.headersList.get(`sec-websocket-extensions`); - r !== null && (this.#r = r); - let i = e.headersList.get(`sec-websocket-protocol`); - if (i !== null && (this.#n = i), _(`open`, this), M.open.hasSubscribers) { - let t = e.headersList.entries; - M.open.publish({ - address: N(e.socket), - protocol: this.#n, - extensions: this.#r, - websocket: this, - handshakeResponse: { - status: e.status, - statusText: e.statusText, - headers: t - } - }); - } - } - #u(e, t) { - if (this.#a.readyState !== c.OPEN) return; - let n; - if (e === d.TEXT) try { - n = v(t); - } catch { - C(this.#a, 1007, `Received invalid UTF-8 in text frame.`); - return; - } - else e === d.BINARY && (n = this.#s === `blob` ? new Blob([t]) : y(t)); - _(`message`, this, k, { - origin: this.#o.origin, - data: n - }); - } - #d() { - this.#a.socket.resume(); - } - #f() { - let e = this.#a.closeState.has(l.SENT) && this.#a.closeState.has(l.RECEIVED), t = 1005, n = ``, r = this.#c?.closingInfo; - r && !r.error && (t = r.code ?? 1005, n = r.reason), this.#a.readyState = c.CLOSED, this.#a.closeState.has(l.RECEIVED) || (t = 1006, _(`error`, this, (e, t) => new D(e, t), { error: TypeError(n) })), _(`close`, this, (e, t) => new O(e, t), { - wasClean: e, - code: t, - reason: n - }), M.close.hasSubscribers && M.close.publish({ - websocket: this, - code: t, - reason: n - }); - } - static ping(e, t) { - if (Buffer.isBuffer(t)) { - if (t.length > 125) throw TypeError(`A PING frame cannot have a body larger than 125 bytes.`); - } else if (t !== void 0) throw TypeError(`Expected buffer payload`); - let n = e.#a.readyState; - if (p(n) && !m(n) && !h(n)) { - let n = new j(t); - e.#a.socket.write(n.createFrame(d.PING)); - } - } - }; - let { ping: F } = P; - Reflect.deleteProperty(P, `ping`), P.CONNECTING = P.prototype.CONNECTING = c.CONNECTING, P.OPEN = P.prototype.OPEN = c.OPEN, P.CLOSING = P.prototype.CLOSING = c.CLOSING, P.CLOSED = P.prototype.CLOSED = c.CLOSED, Object.defineProperties(P.prototype, { - CONNECTING: s, - OPEN: s, - CLOSING: s, - CLOSED: s, - url: T, - readyState: T, - bufferedAmount: T, - onopen: T, - onerror: T, - onclose: T, - close: T, - onmessage: T, - binaryType: T, - send: T, - extensions: T, - protocol: T, - [Symbol.toStringTag]: { - value: `WebSocket`, - writable: !1, - enumerable: !1, - configurable: !0 - } - }), Object.defineProperties(P, { - CONNECTING: s, - OPEN: s, - CLOSING: s, - CLOSED: s - }), i.converters[`sequence`] = i.sequenceConverter(i.converters.DOMString), i.converters[`DOMString or sequence`] = function(e, t, n) { - return i.util.Type(e) === i.util.Types.OBJECT && Symbol.iterator in e ? i.converters[`sequence`](e) : i.converters.DOMString(e, t, n); - }, i.converters.WebSocketInit = i.dictionaryConverter([ - { - key: `protocols`, - converter: i.converters[`DOMString or sequence`], - defaultValue: () => [] - }, - { - key: `dispatcher`, - converter: i.converters.any, - defaultValue: () => E() - }, - { - key: `headers`, - converter: i.nullableConverter(i.converters.HeadersInit) - } - ]), i.converters[`DOMString or sequence or WebSocketInit`] = function(e) { - return i.util.Type(e) === i.util.Types.OBJECT && !(Symbol.iterator in e) ? i.converters.WebSocketInit(e) : { protocols: i.converters[`DOMString or sequence`](e) }; - }, i.converters.WebSocketSendData = function(e) { - return i.util.Type(e) === i.util.Types.OBJECT && (i.is.Blob(e) || i.is.BufferSource(e)) ? e : i.converters.USVString(e); - }, t.exports = { - WebSocket: P, - ping: F - }; -})); -var It = c$3(((e, t) => { - let { webidl: n } = de(), { validateCloseCodeAndReason: r } = kt(), { kConstruct: i } = I$1(), { kEnumerableProperty: a } = B$1(); - function o() { - class e extends DOMException { - get reason() { - return ``; - } - } - return new e().reason === void 0 ? new Proxy(DOMException, { construct(e, t, n) { - let r = Reflect.construct(e, t, e); - return Object.setPrototypeOf(r, n.prototype), r; - } }) : DOMException; - } - var s = class e extends o() { - #e; - #t; - constructor(e = ``, t = void 0) { - if (e = n.converters.DOMString(e, `WebSocketError`, `message`), super(e, `WebSocketError`), t === i) return; - t !== null && (t = n.converters.WebSocketCloseInfo(t)); - let a = t.closeCode ?? null, o = t.reason ?? ``; - r(a, o), o.length !== 0 && a === null && (a = 1e3), this.#e = a, this.#t = o; - } - get closeCode() { - return this.#e; - } - get reason() { - return this.#t; - } - static createUnvalidatedWebSocketError(t, n, r) { - let a = new e(t, i); - return a.#e = n, a.#t = r, a; - } - }; - let { createUnvalidatedWebSocketError: c } = s; - delete s.createUnvalidatedWebSocketError, Object.defineProperties(s.prototype, { - closeCode: a, - reason: a, - [Symbol.toStringTag]: { - value: `WebSocketError`, - writable: !1, - enumerable: !1, - configurable: !0 - } - }), n.is.WebSocketError = n.util.MakeTypeAssertion(s), t.exports = { - WebSocketError: s, - createUnvalidatedWebSocketError: c - }; -})); -var Lt = c$3(((e, t) => { - let { createDeferredPromise: n } = X$1(), { environmentSettingsObject: r } = Y$1(), { states: i, opcodes: a, sentCloseFrameState: o } = Ot(), { webidl: s } = de(), { getURLRecord: c, isValidSubprotocol: l, isEstablished: u, utf8Decode: d } = kt(), { establishWebSocketConnection: f, failWebsocketConnection: p, closeWebSocketConnection: m } = jt(), { channels: h } = H$1(), { WebsocketFrameSend: g } = At(), { ByteParser: _ } = Nt(), { WebSocketError: v, createUnvalidatedWebSocketError: y } = It(), { kEnumerableProperty: b } = B$1(), { utf8DecodeBytes: x } = le(), S = !1; - var C = class { - #e; - #t; - #n; - #r; - #i; - #a; - #o = !1; - #s = { - onConnectionEstablished: (e, t) => this.#u(e, t), - onMessage: (e, t) => this.#d(e, t), - onParserError: (e) => p(this.#s, null, e.message), - onParserDrain: () => this.#s.socket.resume(), - onSocketData: (e) => { - this.#c.write(e) || this.#s.socket.pause(); - }, - onSocketError: (e) => { - this.#s.readyState = i.CLOSING, h.socketError.hasSubscribers && h.socketError.publish(e), this.#s.socket.destroy(); - }, - onSocketClose: () => this.#f(), - onPing: () => {}, - onPong: () => {}, - readyState: i.CONNECTING, - socket: null, - closeState: /* @__PURE__ */ new Set(), - controller: null, - wasEverConnected: !1 - }; - #c; - constructor(e, t = void 0) { - S ||= (process.emitWarning(`WebSocketStream is experimental! Expect it to change at any time.`, { code: `UNDICI-WSS` }), !0), s.argumentLengthCheck(arguments, 1, `WebSocket`), e = s.converters.USVString(e), t !== null && (t = s.converters.WebSocketStreamOptions(t)); - let a = r.settingsObject.baseUrl, o = c(e, a), d = t.protocols; - if (d.length !== new Set(d.map((e) => e.toLowerCase())).size || d.length > 0 && !d.every((e) => l(e))) throw new DOMException(`Invalid Sec-WebSocket-Protocol value`, `SyntaxError`); - if (this.#e = o.toString(), this.#t = n(), this.#n = n(), t.signal != null) { - let e = t.signal; - if (e.aborted) { - this.#t.reject(e.reason), this.#n.reject(e.reason); - return; - } - e.addEventListener(`abort`, () => { - u(this.#s.readyState) || (p(this.#s), this.#s.readyState = i.CLOSING, this.#t.reject(e.reason), this.#n.reject(e.reason), this.#o = !0); - }, { once: !0 }); - } - let m = r.settingsObject; - this.#s.controller = f(o, d, m, this.#s, t); - } - get url() { - return this.#e.toString(); - } - get opened() { - return this.#t.promise; - } - get closed() { - return this.#n.promise; - } - close(e = void 0) { - e !== null && (e = s.converters.WebSocketCloseInfo(e)); - let t = e.closeCode ?? null, n = e.reason; - m(this.#s, t, n, !0); - } - #l(e) { - e = s.converters.WebSocketStreamWrite(e); - let t = n(), r = null, i = null; - if (s.is.BufferSource(e)) r = new Uint8Array(ArrayBuffer.isView(e) ? new Uint8Array(e.buffer, e.byteOffset, e.byteLength) : e.slice()), i = a.BINARY; - else { - let n; - try { - n = s.converters.DOMString(e); - } catch (e) { - return t.reject(e), t.promise; - } - r = new TextEncoder().encode(n), i = a.TEXT; - } - if (!this.#s.closeState.has(o.SENT) && !this.#s.closeState.has(o.RECEIVED)) { - let e = new g(r); - this.#s.socket.write(e.createFrame(i), () => { - t.resolve(void 0); - }); - } - return t.promise; - } - #u(e, t) { - this.#s.socket = e.socket; - let n = new _(this.#s, t); - n.on(`drain`, () => this.#s.onParserDrain()), n.on(`error`, (e) => this.#s.onParserError(e)), this.#c = n, this.#s.readyState = i.OPEN; - let r = t ?? ``, a = e.headersList.get(`sec-websocket-protocol`) ?? ``, o = new ReadableStream({ - start: (e) => { - this.#i = e; - }, - cancel: (e) => this.#m(e) - }), s = new WritableStream({ - write: (e) => this.#l(e), - close: () => m(this.#s, null, null), - abort: (e) => this.#p(e) - }); - this.#r = o, this.#a = s, this.#t.resolve({ - extensions: r, - protocol: a, - readable: o, - writable: s - }); - } - #d(e, t) { - if (this.#s.readyState !== i.OPEN) return; - let n; - if (e === a.TEXT) try { - n = d(t); - } catch { - p(this.#s, 1007, `Received invalid UTF-8 in text frame.`); - return; - } - else e === a.BINARY && (n = new Uint8Array(t.buffer, t.byteOffset, t.byteLength)); - this.#i.enqueue(n); - } - #f() { - let e = this.#s.closeState.has(o.SENT) && this.#s.closeState.has(o.RECEIVED); - if (this.#s.readyState = i.CLOSED, this.#o) return; - this.#s.wasEverConnected || this.#t.reject(new v(`Socket never opened`)); - let t = this.#c?.closingInfo, n = t?.code ?? 1005; - !this.#s.closeState.has(o.SENT) && !this.#s.closeState.has(o.RECEIVED) && (n = 1006); - let r = t?.reason == null ? `` : x(Buffer.from(t.reason)); - if (e) this.#i.close(), this.#a.locked || this.#a.abort(new DOMException(`A closed WebSocketStream cannot be written to`, `InvalidStateError`)), this.#n.resolve({ - closeCode: n, - reason: r - }); - else { - let e = y(`unclean close`, n, r); - this.#i?.error(e), this.#a?.abort(e), this.#n.reject(e); - } - } - #p(e) { - let t = null, n = ``; - s.is.WebSocketError(e) && (t = e.closeCode, n = e.reason), m(this.#s, t, n); - } - #m(e) { - this.#p(e); - } - }; - Object.defineProperties(C.prototype, { - url: b, - opened: b, - closed: b, - close: b, - [Symbol.toStringTag]: { - value: `WebSocketStream`, - writable: !1, - enumerable: !1, - configurable: !0 - } - }), s.converters.WebSocketStreamOptions = s.dictionaryConverter([{ - key: `protocols`, - converter: s.sequenceConverter(s.converters.USVString), - defaultValue: () => [] - }, { - key: `signal`, - converter: s.nullableConverter(s.converters.AbortSignal), - defaultValue: () => null - }]), s.converters.WebSocketCloseInfo = s.dictionaryConverter([{ - key: `closeCode`, - converter: (e) => s.converters[`unsigned short`](e, s.attributes.EnforceRange) - }, { - key: `reason`, - converter: s.converters.USVString, - defaultValue: () => `` - }]), s.converters.WebSocketStreamWrite = function(e) { - return typeof e == `string` ? s.converters.USVString(e) : s.converters.BufferSource(e); - }, t.exports = { WebSocketStream: C }; -})); -var Rt = c$3(((e, t) => { - function n(e) { - return e.indexOf(`\0`) === -1; - } - function r(e) { - if (e.length === 0) return !1; - for (let t = 0; t < e.length; t++) if (e.charCodeAt(t) < 48 || e.charCodeAt(t) > 57) return !1; - return !0; - } - t.exports = { - isValidLastEventId: n, - isASCIINumber: r - }; -})); -var zt = c$3(((e, t) => { - let { Transform: r } = p$4(`node:stream`), { isASCIINumber: i, isValidLastEventId: a } = Rt(), o = [ - 239, - 187, - 191 - ]; - t.exports = { EventSourceStream: class extends r { - state; - checkBOM = !0; - crlfCheck = !1; - eventEndCheck = !1; - buffer = null; - pos = 0; - event = { - data: void 0, - event: void 0, - id: void 0, - retry: void 0 - }; - constructor(e = {}) { - e.readableObjectMode = !0, super(e), this.state = e.eventSourceSettings || {}, e.push && (this.push = e.push); - } - _transform(e, t, n) { - if (e.length === 0) { - n(); - return; - } - if (this.buffer ? this.buffer = Buffer.concat([this.buffer, e]) : this.buffer = e, this.checkBOM) switch (this.buffer.length) { - case 1: - if (this.buffer[0] === o[0]) { - n(); - return; - } - this.checkBOM = !1, n(); - return; - case 2: - if (this.buffer[0] === o[0] && this.buffer[1] === o[1]) { - n(); - return; - } - this.checkBOM = !1; - break; - case 3: - if (this.buffer[0] === o[0] && this.buffer[1] === o[1] && this.buffer[2] === o[2]) { - this.buffer = Buffer.alloc(0), this.checkBOM = !1, n(); - return; - } - this.checkBOM = !1; - break; - default: - this.buffer[0] === o[0] && this.buffer[1] === o[1] && this.buffer[2] === o[2] && (this.buffer = this.buffer.subarray(3)), this.checkBOM = !1; - break; - } - for (; this.pos < this.buffer.length;) { - if (this.eventEndCheck) { - if (this.crlfCheck) { - if (this.buffer[this.pos] === 10) { - this.buffer = this.buffer.subarray(this.pos + 1), this.pos = 0, this.crlfCheck = !1; - continue; - } - this.crlfCheck = !1; - } - if (this.buffer[this.pos] === 10 || this.buffer[this.pos] === 13) { - this.buffer[this.pos] === 13 && (this.crlfCheck = !0), this.buffer = this.buffer.subarray(this.pos + 1), this.pos = 0, (this.event.data !== void 0 || this.event.event || this.event.id !== void 0 || this.event.retry) && this.processEvent(this.event), this.clearEvent(); - continue; - } - this.eventEndCheck = !1; - continue; - } - if (this.buffer[this.pos] === 10 || this.buffer[this.pos] === 13) { - this.buffer[this.pos] === 13 && (this.crlfCheck = !0), this.parseLine(this.buffer.subarray(0, this.pos), this.event), this.buffer = this.buffer.subarray(this.pos + 1), this.pos = 0, this.eventEndCheck = !0; - continue; - } - this.pos++; - } - n(); - } - parseLine(e, t) { - if (e.length === 0) return; - let n = e.indexOf(58); - if (n === 0) return; - let r = ``, o = ``; - if (n !== -1) { - r = e.subarray(0, n).toString(`utf8`); - let t = n + 1; - e[t] === 32 && ++t, o = e.subarray(t).toString(`utf8`); - } else r = e.toString(`utf8`), o = ``; - switch (r) { - case `data`: - t[r] === void 0 ? t[r] = o : t[r] += `\n${o}`; - break; - case `retry`: - i(o) && (t[r] = o); - break; - case `id`: - a(o) && (t[r] = o); - break; - case `event`: - o.length > 0 && (t[r] = o); - break; - } - } - processEvent(e) { - e.retry && i(e.retry) && (this.state.reconnectionTime = parseInt(e.retry, 10)), e.id !== void 0 && a(e.id) && (this.state.lastEventId = e.id), e.data !== void 0 && this.push({ - type: e.event || `message`, - options: { - data: e.data, - lastEventId: this.state.lastEventId, - origin: this.state.origin - } - }); - } - clearEvent() { - this.event = { - data: void 0, - event: void 0, - id: void 0, - retry: void 0 - }; - } - } }; -})); -var Bt = c$3(((e, t) => { - let { pipeline: r } = p$4(`node:stream`), { fetching: i } = yt(), { makeRequest: a } = _t(), { webidl: o } = de(), { EventSourceStream: s } = zt(), { parseMIMEType: c } = J$1(), { createFastMessageEvent: l } = Dt(), { isNetworkError: u } = gt(), { kEnumerableProperty: d } = B$1(), { environmentSettingsObject: f } = Y$1(), p = !1, m = 3e3; - var h = class e extends EventTarget { - #e = { - open: null, - error: null, - message: null - }; - #t; - #n = !1; - #r = 0; - #i = null; - #a = null; - #o; - #s; - constructor(e, t = {}) { - super(), o.util.markAsUncloneable(this); - let n = `EventSource constructor`; - o.argumentLengthCheck(arguments, 1, n), p || (p = !0, process.emitWarning(`EventSource is experimental, expect them to change at any time.`, { code: `UNDICI-ES` })), e = o.converters.USVString(e), t = o.converters.EventSourceInitDict(t, n, `eventSourceInitDict`), this.#o = t.node.dispatcher || t.dispatcher, this.#s = { - lastEventId: ``, - reconnectionTime: t.node.reconnectionTime - }; - let r = f, i; - try { - i = new URL(e, r.settingsObject.baseUrl), this.#s.origin = i.origin; - } catch (e) { - throw new DOMException(e, `SyntaxError`); - } - this.#t = i.href; - let s = `anonymous`; - t.withCredentials === !0 && (s = `use-credentials`, this.#n = !0); - let c = { - redirect: `follow`, - keepalive: !0, - mode: `cors`, - credentials: s === `anonymous` ? `same-origin` : `omit`, - referrer: `no-referrer` - }; - c.client = f.settingsObject, c.headersList = [[`accept`, { - name: `accept`, - value: `text/event-stream` - }]], c.cache = `no-store`, c.initiator = `other`, c.urlList = [new URL(this.#t)], this.#i = a(c), this.#c(); - } - get readyState() { - return this.#r; - } - get url() { - return this.#t; - } - get withCredentials() { - return this.#n; - } - #c() { - if (this.#r === 2) return; - this.#r = 0; - let e = { - request: this.#i, - dispatcher: this.#o - }; - e.processResponseEndOfBody = (e) => { - if (!u(e)) return this.#l(); - }, e.processResponse = (e) => { - if (u(e)) if (e.aborted) { - this.close(), this.dispatchEvent(new Event(`error`)); - return; - } else { - this.#l(); - return; - } - let t = e.headersList.get(`content-type`, !0), n = t === null ? `failure` : c(t), i = n !== `failure` && n.essence === `text/event-stream`; - if (e.status !== 200 || i === !1) { - this.close(), this.dispatchEvent(new Event(`error`)); - return; - } - this.#r = 1, this.dispatchEvent(new Event(`open`)), this.#s.origin = e.urlList[e.urlList.length - 1].origin; - let a = new s({ - eventSourceSettings: this.#s, - push: (e) => { - this.dispatchEvent(l(e.type, e.options)); - } - }); - r(e.body.stream, a, (e) => { - e?.aborted === !1 && (this.close(), this.dispatchEvent(new Event(`error`))); - }); - }, this.#a = i(e); - } - #l() { - this.#r !== 2 && (this.#r = 0, this.dispatchEvent(new Event(`error`)), setTimeout(() => { - this.#r === 0 && (this.#s.lastEventId.length && this.#i.headersList.set(`last-event-id`, this.#s.lastEventId, !0), this.#c()); - }, this.#s.reconnectionTime)?.unref()); - } - close() { - o.brandCheck(this, e), this.#r !== 2 && (this.#r = 2, this.#a.abort(), this.#i = null); - } - get onopen() { - return this.#e.open; - } - set onopen(e) { - this.#e.open && this.removeEventListener(`open`, this.#e.open); - let t = o.converters.EventHandlerNonNull(e); - t === null ? this.#e.open = null : (this.addEventListener(`open`, t), this.#e.open = e); - } - get onmessage() { - return this.#e.message; - } - set onmessage(e) { - this.#e.message && this.removeEventListener(`message`, this.#e.message); - let t = o.converters.EventHandlerNonNull(e); - t === null ? this.#e.message = null : (this.addEventListener(`message`, t), this.#e.message = e); - } - get onerror() { - return this.#e.error; - } - set onerror(e) { - this.#e.error && this.removeEventListener(`error`, this.#e.error); - let t = o.converters.EventHandlerNonNull(e); - t === null ? this.#e.error = null : (this.addEventListener(`error`, t), this.#e.error = e); - } - }; - let g = { - CONNECTING: { - __proto__: null, - configurable: !1, - enumerable: !0, - value: 0, - writable: !1 - }, - OPEN: { - __proto__: null, - configurable: !1, - enumerable: !0, - value: 1, - writable: !1 - }, - CLOSED: { - __proto__: null, - configurable: !1, - enumerable: !0, - value: 2, - writable: !1 - } - }; - Object.defineProperties(h, g), Object.defineProperties(h.prototype, g), Object.defineProperties(h.prototype, { - close: d, - onerror: d, - onmessage: d, - onopen: d, - readyState: d, - url: d, - withCredentials: d - }), o.converters.EventSourceInitDict = o.dictionaryConverter([ - { - key: `withCredentials`, - converter: o.converters.boolean, - defaultValue: () => !1 - }, - { - key: `dispatcher`, - converter: o.converters.any - }, - { - key: `node`, - converter: o.dictionaryConverter([{ - key: `reconnectionTime`, - converter: o.converters[`unsigned long`], - defaultValue: () => m - }, { - key: `dispatcher`, - converter: o.converters.any - }]), - defaultValue: () => ({}) - } - ]), t.exports = { - EventSource: h, - defaultReconnectionTime: m - }; -})); -const Vt = new (c$3(((e, t) => { - let n = Z$1(), r = W$1(), i = ye(), a = be(), o = xe(), s = Se(), c = Ee(), l = Te(), u = De(), d = ke(), f = Ae(), p = R$1(), m = B$1(), { InvalidArgumentError: h } = p, g = Re(), _ = K$1(), v = Ue(), { MockCallHistory: y, MockCallHistoryLog: b } = We(), x = qe(), S = Ge(), C = Xe(), w = ze(), T = Oe(), { getGlobalDispatcher: E, setGlobalDispatcher: D } = Ze(), O = Qe(), k = $e(); - Object.assign(r.prototype, g), t.exports.Dispatcher = r, t.exports.Client = n, t.exports.Pool = i, t.exports.BalancedPool = a, t.exports.RoundRobinPool = o, t.exports.Agent = s, t.exports.ProxyAgent = c, t.exports.Socks5ProxyAgent = l, t.exports.EnvHttpProxyAgent = u, t.exports.RetryAgent = d, t.exports.H2CClient = f, t.exports.RetryHandler = T, t.exports.DecoratorHandler = O, t.exports.RedirectHandler = k, t.exports.interceptors = { - redirect: et(), - responseError: tt(), - retry: nt(), - dump: rt(), - dns: it(), - cache: ut(), - decompress: dt(), - deduplicate: pt() - }, t.exports.cacheStores = { MemoryCacheStore: ct() }; - let A = mt(); - t.exports.cacheStores.SqliteCacheStore = A, t.exports.buildConnector = _, t.exports.errors = p, t.exports.util = { - parseHeaders: m.parseHeaders, - headerNameToString: m.headerNameToString - }; - function j(e) { - return (t, n, r) => { - if (typeof n == `function` && (r = n, n = null), !t || typeof t != `string` && typeof t != `object` && !(t instanceof URL)) throw new h(`invalid url`); - if (n != null && typeof n != `object`) throw new h(`invalid opts`); - if (n && n.path != null) { - if (typeof n.path != `string`) throw new h(`invalid opts.path`); - let e = n.path; - n.path.startsWith(`/`) || (e = `/${e}`), t = new URL(m.parseOrigin(t).origin + e); - } else n ||= typeof t == `object` ? t : {}, t = m.parseURL(t); - let { agent: i, dispatcher: a = E() } = n; - if (i) throw new h(`unsupported opts.agent. Did you mean opts.client?`); - return e.call(a, { - ...n, - origin: t.origin, - path: t.search ? `${t.pathname}${t.search}` : t.pathname, - method: n.method || (n.body ? `PUT` : `GET`) - }, r); - }; - } - t.exports.setGlobalDispatcher = D, t.exports.getGlobalDispatcher = E; - let M = yt().fetch, N = typeof __filename < `u` ? __filename : void 0; - function P(e, t) { - if (!e || typeof e != `object`) return; - let n = typeof e.stack == `string` ? e.stack : ``, r = t.replace(/\\/g, `/`); - if (n && (n.includes(t) || n.includes(r))) return; - let i = {}; - if (Error.captureStackTrace(i, P), !i.stack) return; - let a = i.stack.split(` -`).slice(1).join(` -`); - e.stack = n ? `${n}\n${a}` : i.stack; - } - t.exports.fetch = function(e, n = void 0) { - return M(e, n).catch((e) => { - throw N ? P(e, N) : e && typeof e == `object` && Error.captureStackTrace(e, t.exports.fetch), e; - }); - }, t.exports.Headers = ht().Headers, t.exports.Response = gt().Response, t.exports.Request = _t().Request, t.exports.FormData = fe().FormData; - let { setGlobalOrigin: F, getGlobalOrigin: L } = ce(); - t.exports.setGlobalOrigin = F, t.exports.getGlobalOrigin = L; - let { CacheStorage: ee } = St(), { kConstruct: z } = I$1(); - t.exports.caches = new ee(z); - let { deleteCookie: V, getCookies: H, getSetCookies: te, setCookie: U, parseCookie: ne } = Et(); - t.exports.deleteCookie = V, t.exports.getCookies = H, t.exports.getSetCookies = te, t.exports.setCookie = U, t.exports.parseCookie = ne; - let { parseMIMEType: G, serializeAMimeType: re } = J$1(); - t.exports.parseMIMEType = G, t.exports.serializeAMimeType = re; - let { CloseEvent: ie, ErrorEvent: ae, MessageEvent: oe } = Dt(), { WebSocket: se, ping: le } = Ft(); - t.exports.WebSocket = se, t.exports.CloseEvent = ie, t.exports.ErrorEvent = ae, t.exports.MessageEvent = oe, t.exports.ping = le, t.exports.WebSocketStream = Lt().WebSocketStream, t.exports.WebSocketError = It().WebSocketError, t.exports.request = j(g.request), t.exports.stream = j(g.stream), t.exports.pipeline = j(g.pipeline), t.exports.connect = j(g.connect), t.exports.upgrade = j(g.upgrade), t.exports.MockClient = v, t.exports.MockCallHistory = y, t.exports.MockCallHistoryLog = b, t.exports.MockPool = S, t.exports.MockAgent = x, t.exports.SnapshotAgent = C, t.exports.mockErrors = w; - let { EventSource: q } = Bt(); - t.exports.EventSource = q; - function ue() { - globalThis.fetch = t.exports.fetch, globalThis.Headers = t.exports.Headers, globalThis.Response = t.exports.Response, globalThis.Request = t.exports.Request, globalThis.FormData = t.exports.FormData, globalThis.WebSocket = t.exports.WebSocket, globalThis.CloseEvent = t.exports.CloseEvent, globalThis.ErrorEvent = t.exports.ErrorEvent, globalThis.MessageEvent = t.exports.MessageEvent, globalThis.EventSource = t.exports.EventSource; - } - t.exports.install = ue; -}))()).Agent({ bodyTimeout: 0 }); -var Ht = class { - constructor(e) { - this.fetch = P$1(e.fetch ?? globalThis.fetch), this.baseUrl = e.baseUrl, this.debug = e.debug ?? process.env.DEBUG_FETCH === `true`, this.token = e.token, this.agent = Vt; - } - async request(e, t) { - let n = new URL(`${this.baseUrl}${e}`); - if (t?.query) for (let [e, r] of Object.entries(t.query)) M$1(r).forEach((t) => { - n.searchParams.append(e, t.toString()); - }); - let r = Date.now(), i = await this.fetch(n.toString(), { - ...t, - body: t?.body, - method: t?.method || `GET`, - headers: this.token ? { - Authorization: `Bearer ${this.token}`, - ...t?.headers - } : t?.headers, - dispatcher: this.agent, - signal: t?.signal - }); - if (this.debug) { - let e = Date.now() - r; - if (console.log(`[API] ${n} (${i.status}) ${e}ms`), i.status === 429) { - let e = parseInt(i.headers.get(`Retry-After`) ?? ``, 10), t = Math.floor(e / 60 / 60), r = Math.floor(e / 60) % 60, a = e % 60; - console.warn(`[API] ${n} Rate Limited, Retry After ${t}h ${r}m ${a}s`); - } - } - return i; - } -}; -function Ut(e) { - return e.match(/\/v2\/sandboxes\/sessions\/([^/?]+)/)?.[1]; -} -function Wt(e) { - return e.match(/\/v2\/sandboxes\/(?!sessions(?:\/|$|\?))(?!snapshots(?:\/|$|\?))([^/?]+)/)?.[1]; -} -async function Gt(e, t) { - let n = Ut(t.url), r; - n || (r = Wt(t.url)); - let i = await t.text().catch((e) => new A$1(t, { - message: `Can't read response text: ${String(e)}`, - sessionId: n, - sandboxName: r - })); - if (typeof i != `string`) return i; - let a; - try { - a = JSON.parse(i || `{}`); - } catch (e) { - return new A$1(t, { - message: `Can't parse JSON: ${String(e)}`, - text: i, - sessionId: n, - sandboxName: r - }); - } - if (!t.ok) return new A$1(t, { - message: `Status code ${t.status} is not ok`, - json: a, - text: i, - sessionId: n, - sandboxName: r - }); - let o = e.safeParse(a); - return o.success ? { - json: o.data, - response: t, - text: i - } : new A$1(t, { - message: `Response JSON is not valid: ${o.error}`, - json: a, - text: i, - sessionId: n, - sandboxName: r - }); -} -async function Q$1(e, t) { - let n = await Gt(e, t); - if (n instanceof A$1) throw n; - return n; -} -const Kt = da$1({ - exact: Mi$1().optional(), - startsWith: Mi$1().optional(), - regex: Mi$1().optional() -}); -const qt = da$1({ - key: Kt.optional(), - value: Kt.optional() -}); -const Jt = da$1({ - path: Kt.optional(), - method: la$1(Mi$1()).optional(), - queryString: la$1(qt).optional(), - headers: la$1(qt).optional() -}); -const Yt = da$1({ - domain: Mi$1(), - headers: ya$1(Mi$1(), Mi$1()).optional(), - headerNames: la$1(Mi$1()).optional(), - match: Jt.optional() -}); -const Xt = da$1({ - domain: Mi$1(), - forwardURL: Mi$1(), - match: Jt.optional() -}); -const Zt = da$1({ headers: ya$1(Mi$1(), Mi$1()).optional() }); -const Qt = da$1({ - match: Jt.optional(), - transform: la$1(Zt).optional(), - forwardURL: Mi$1().optional() -}); -const $t = da$1({ - allow: pa$1([la$1(Mi$1()), ya$1(Mi$1(), la$1(Qt))]).optional(), - subnets: da$1({ - allow: la$1(Mi$1()).optional(), - deny: la$1(Mi$1()).optional() - }).optional() -}); -const en = pa$1([da$1({ mode: Ca$1(`allow-all`) }).passthrough(), da$1({ mode: Ca$1(`deny-all`) }).passthrough()]); -const tn = da$1({ - mode: Ca$1(`custom`), - allowedDomains: la$1(Mi$1()).optional(), - allowedCIDRs: la$1(Mi$1()).optional(), - deniedCIDRs: la$1(Mi$1()).optional(), - injectionRules: la$1(Yt).optional(), - forwardRules: la$1(Xt).optional() -}).passthrough(); -pa$1([en, $t.passthrough()]); -const nn = pa$1([en, tn]); -const rn = da$1({ - id: Mi$1(), - memory: Qi$1(), - vcpus: Qi$1(), - region: Mi$1(), - runtime: Mi$1(), - timeout: Qi$1(), - status: xa$1([ - `pending`, - `running`, - `stopping`, - `stopped`, - `failed`, - `aborted`, - `snapshotting` - ]), - requestedAt: Qi$1(), - startedAt: Qi$1().optional(), - requestedStopAt: Qi$1().optional(), - stoppedAt: Qi$1().optional(), - abortedAt: Qi$1().optional(), - duration: Qi$1().optional(), - sourceSnapshotId: Mi$1().optional(), - snapshottedAt: Qi$1().optional(), - createdAt: Qi$1(), - cwd: Mi$1(), - updatedAt: Qi$1(), - interactivePort: Qi$1().optional(), - networkPolicy: nn.optional(), - activeCpuDurationMs: Qi$1().optional(), - networkTransfer: da$1({ - ingress: Qi$1(), - egress: Qi$1() - }).optional() -}); -const an = da$1({ - url: Mi$1(), - subdomain: Mi$1(), - port: Qi$1() -}); -const on = da$1({ - id: Mi$1(), - sourceSessionId: Mi$1(), - region: Mi$1(), - status: xa$1([ - `created`, - `deleted`, - `failed` - ]), - sizeBytes: Qi$1(), - expiresAt: Qi$1().optional(), - createdAt: Qi$1(), - updatedAt: Qi$1(), - lastUsedAt: Qi$1().optional(), - creationMethod: Mi$1().optional(), - parentId: Mi$1().optional() -}); -const sn = da$1({ - count: Qi$1(), - next: Mi$1().nullable() -}); -const cn = da$1({ - id: Mi$1(), - name: Mi$1(), - args: la$1(Mi$1()), - cwd: Mi$1(), - sessionId: Mi$1(), - exitCode: Qi$1().nullable(), - startedAt: Qi$1() -}); -const ln = cn.extend({ exitCode: Qi$1() }); -const un = da$1({ session: rn.passthrough() }); -const dn = un.extend({ routes: la$1(an) }); -const fn = da$1({ - url: Mi$1(), - token: Mi$1() -}); -const pn = da$1({ - sessions: la$1(rn.passthrough()), - pagination: sn -}); -const mn = da$1({ command: cn }); -const hn = da$1({ command: ln }); -const gn = da$1({}); -const _n = da$1({ data: Mi$1() }); -const vn = ha$1(`stream`, [ - _n.extend({ stream: Ca$1(`stdout`) }), - _n.extend({ stream: Ca$1(`stderr`) }), - da$1({ - stream: Ca$1(`error`), - data: da$1({ - code: Mi$1(), - message: Mi$1() - }) - }) -]); -const yn = da$1({ - snapshots: la$1(on), - pagination: sn -}); -const bn = da$1({ - snapshot: on, - siblings: la$1(on), - count: Mi$1() -}); -const xn = da$1({ - snapshots: la$1(bn), - anchor: bn.optional(), - pagination: sn -}); -const Sn = da$1({ - snapshot: on, - session: rn.passthrough() -}); -const Cn = da$1({ snapshot: on }); -const wn = da$1({ - name: Mi$1(), - persistent: na$1(), - region: Mi$1().optional(), - vcpus: Qi$1().optional(), - memory: Qi$1().optional(), - runtime: Mi$1().optional(), - timeout: Qi$1().optional(), - networkPolicy: nn.optional(), - totalEgressBytes: Qi$1().optional(), - totalIngressBytes: Qi$1().optional(), - totalActiveCpuDurationMs: Qi$1().optional(), - totalDurationMs: Qi$1().optional(), - createdAt: Qi$1(), - updatedAt: Qi$1(), - currentSessionId: Mi$1(), - currentSnapshotId: Mi$1().optional(), - status: rn.shape.status, - statusUpdatedAt: Qi$1().optional(), - cwd: Mi$1().optional(), - tags: ya$1(Mi$1(), Mi$1()).optional(), - snapshotExpiration: Qi$1().optional(), - keepLastSnapshots: da$1({ - count: Qi$1(), - expiration: Qi$1().optional(), - deleteEvicted: na$1().optional() - }).optional() -}); -const Tn = da$1({ - session: rn.passthrough(), - sandbox: wn.optional(), - snapshot: on.optional() -}); -const En = da$1({ - sandbox: wn, - session: rn.passthrough(), - routes: la$1(an), - resumed: na$1().optional() -}); -const Dn = da$1({ - sandboxes: la$1(wn), - pagination: sn -}); -const On = da$1({ - sandbox: wn, - routes: la$1(an).optional() -}); -var kn = c$3(((e, t) => { - t.exports = p$4(`events`); -})); -var An = c$3(((e, t) => { - t.exports = class { - constructor(e) { - if (!(e > 0) || e - 1 & e) throw Error(`Max size for a FixedFIFO should be a power of two`); - this.buffer = Array(e), this.mask = e - 1, this.top = 0, this.btm = 0, this.next = null; - } - clear() { - this.top = this.btm = 0, this.next = null, this.buffer.fill(void 0); - } - push(e) { - return this.buffer[this.top] === void 0 ? (this.buffer[this.top] = e, this.top = this.top + 1 & this.mask, !0) : !1; - } - shift() { - let e = this.buffer[this.btm]; - if (e !== void 0) return this.buffer[this.btm] = void 0, this.btm = this.btm + 1 & this.mask, e; - } - peek() { - return this.buffer[this.btm]; - } - isEmpty() { - return this.buffer[this.btm] === void 0; - } - }; -})); -var jn = c$3(((e, t) => { - let n = An(); - t.exports = class { - constructor(e) { - this.hwm = e || 16, this.head = new n(this.hwm), this.tail = this.head, this.length = 0; - } - clear() { - this.head = this.tail, this.head.clear(), this.length = 0; - } - push(e) { - if (this.length++, !this.head.push(e)) { - let t = this.head; - this.head = t.next = new n(2 * this.head.buffer.length), this.head.push(e); - } - } - shift() { - this.length !== 0 && this.length--; - let e = this.tail.shift(); - if (e === void 0 && this.tail.next) { - let e = this.tail.next; - return this.tail.next = null, this.tail = e, this.tail.shift(); - } - return e; - } - peek() { - let e = this.tail.peek(); - return e === void 0 && this.tail.next ? this.tail.next.peek() : e; - } - isEmpty() { - return this.length === 0; - } - }; -})); -var Mn = c$3(((e, t) => { - function n(e) { - return Buffer.isBuffer(e) || e instanceof Uint8Array; - } - function r(e) { - return Buffer.isEncoding(e); - } - function i(e, t, n) { - return Buffer.alloc(e, t, n); - } - function a(e) { - return Buffer.allocUnsafe(e); - } - function o(e) { - return Buffer.allocUnsafeSlow(e); - } - function s(e, t) { - return Buffer.byteLength(e, t); - } - function c(e, t) { - return Buffer.compare(e, t); - } - function l(e, t) { - return Buffer.concat(e, t); - } - function u(e, t, n, r, i) { - return b(e).copy(t, n, r, i); - } - function d(e, t) { - return b(e).equals(t); - } - function f(e, t, n, r, i) { - return b(e).fill(t, n, r, i); - } - function p(e, t, n) { - return Buffer.from(e, t, n); - } - function m(e, t, n, r) { - return b(e).includes(t, n, r); - } - function h(e, t, n, r) { - return b(e).indexOf(t, n, r); - } - function g(e, t, n, r) { - return b(e).lastIndexOf(t, n, r); - } - function _(e) { - return b(e).swap16(); - } - function v(e) { - return b(e).swap32(); - } - function y(e) { - return b(e).swap64(); - } - function b(e) { - return Buffer.isBuffer(e) ? e : Buffer.from(e.buffer, e.byteOffset, e.byteLength); - } - function x(e, t, n, r) { - return b(e).toString(t, n, r); - } - function S(e, t, n, r, i) { - return b(e).write(t, n, r, i); - } - function C(e, t) { - return b(e).readDoubleBE(t); - } - function w(e, t) { - return b(e).readDoubleLE(t); - } - function T(e, t) { - return b(e).readFloatBE(t); - } - function E(e, t) { - return b(e).readFloatLE(t); - } - function D(e, t) { - return b(e).readInt32BE(t); - } - function O(e, t) { - return b(e).readInt32LE(t); - } - function k(e, t) { - return b(e).readUInt32BE(t); - } - function A(e, t) { - return b(e).readUInt32LE(t); - } - function j(e, t, n) { - return b(e).writeDoubleBE(t, n); - } - function M(e, t, n) { - return b(e).writeDoubleLE(t, n); - } - function N(e, t, n) { - return b(e).writeFloatBE(t, n); - } - function P(e, t, n) { - return b(e).writeFloatLE(t, n); - } - function F(e, t, n) { - return b(e).writeInt32BE(t, n); - } - function I(e, t, n) { - return b(e).writeInt32LE(t, n); - } - function L(e, t, n) { - return b(e).writeUInt32BE(t, n); - } - function R(e, t, n) { - return b(e).writeUInt32LE(t, n); - } - t.exports = { - isBuffer: n, - isEncoding: r, - alloc: i, - allocUnsafe: a, - allocUnsafeSlow: o, - byteLength: s, - compare: c, - concat: l, - copy: u, - equals: d, - fill: f, - from: p, - includes: m, - indexOf: h, - lastIndexOf: g, - swap16: _, - swap32: v, - swap64: y, - toBuffer: b, - toString: x, - write: S, - readDoubleBE: C, - readDoubleLE: w, - readFloatBE: T, - readFloatLE: E, - readInt32BE: D, - readInt32LE: O, - readUInt32BE: k, - readUInt32LE: A, - writeDoubleBE: j, - writeDoubleLE: M, - writeFloatBE: N, - writeFloatLE: P, - writeInt32BE: F, - writeInt32LE: I, - writeUInt32BE: L, - writeUInt32LE: R - }; -})); -var Nn = c$3(((e, t) => { - let n = Mn(); - t.exports = class { - constructor(e) { - this.encoding = e; - } - get remaining() { - return 0; - } - decode(e) { - return n.toString(e, this.encoding); - } - flush() { - return ``; - } - }; -})); -var Pn = c$3(((e, t) => { - let n = Mn(); - t.exports = class { - constructor() { - this._reset(); - } - get remaining() { - return this.bytesSeen; - } - decode(e) { - if (e.byteLength === 0) return ``; - if (this.bytesNeeded === 0 && r(e, 0) === 0) return this.bytesSeen = i(e), n.toString(e, `utf8`); - let t = ``, a = 0; - if (this.bytesNeeded > 0) { - for (; a < e.byteLength;) { - let n = e[a]; - if (n < this.lowerBoundary || n > this.upperBoundary) { - t += `�`, this._reset(); - break; - } - if (this.lowerBoundary = 128, this.upperBoundary = 191, this.codePoint = this.codePoint << 6 | n & 63, this.bytesSeen++, a++, this.bytesSeen === this.bytesNeeded) { - t += String.fromCodePoint(this.codePoint), this._reset(); - break; - } - } - if (this.bytesNeeded > 0) return t; - } - let o = r(e, a), s = e.byteLength - o; - s > a && (t += n.toString(e, `utf8`, a, s)); - for (let n = s; n < e.byteLength; n++) { - let r = e[n]; - if (this.bytesNeeded === 0) { - r <= 127 ? (this.bytesSeen = 0, t += String.fromCharCode(r)) : r >= 194 && r <= 223 ? (this.bytesNeeded = 2, this.bytesSeen = 1, this.codePoint = r & 31) : r >= 224 && r <= 239 ? (r === 224 ? this.lowerBoundary = 160 : r === 237 && (this.upperBoundary = 159), this.bytesNeeded = 3, this.bytesSeen = 1, this.codePoint = r & 15) : r >= 240 && r <= 244 ? (r === 240 ? this.lowerBoundary = 144 : r === 244 && (this.upperBoundary = 143), this.bytesNeeded = 4, this.bytesSeen = 1, this.codePoint = r & 7) : (this.bytesSeen = 1, t += `�`); - continue; - } - if (r < this.lowerBoundary || r > this.upperBoundary) { - t += `�`, n--, this._reset(); - continue; - } - this.lowerBoundary = 128, this.upperBoundary = 191, this.codePoint = this.codePoint << 6 | r & 63, this.bytesSeen++, this.bytesSeen === this.bytesNeeded && (t += String.fromCodePoint(this.codePoint), this._reset()); - } - return t; - } - flush() { - let e = this.bytesNeeded > 0 ? `�` : ``; - return this._reset(), e; - } - _reset() { - this.codePoint = 0, this.bytesNeeded = 0, this.bytesSeen = 0, this.lowerBoundary = 128, this.upperBoundary = 191; - } - }; - function r(e, t) { - let n = e.byteLength; - if (n <= t) return 0; - let r = Math.max(t, n - 4), i = n - 1; - for (; i > r && (e[i] & 192) == 128;) i--; - if (i < t) return 0; - let a = e[i], o; - if (a <= 127) return 0; - if (a >= 194 && a <= 223) o = 2; - else if (a >= 224 && a <= 239) o = 3; - else if (a >= 240 && a <= 244) o = 4; - else return 0; - let s = n - i; - return s < o ? s : 0; - } - function i(e) { - let t = e.byteLength; - if (t === 0) return 0; - let n = e[t - 1]; - if (n <= 127) return 0; - if ((n & 192) != 128) return 1; - let r = Math.max(0, t - 4), i = t - 2; - for (; i >= r && (e[i] & 192) == 128;) i--; - if (i < 0) return 1; - let a = e[i], o; - if (a >= 194 && a <= 223) o = 2; - else if (a >= 224 && a <= 239) o = 3; - else if (a >= 240 && a <= 244) o = 4; - else return 1; - if (t - i !== o) return 1; - if (o >= 3) { - let t = e[i + 1]; - if (a === 224 && t < 160 || a === 237 && t > 159 || a === 240 && t < 144 || a === 244 && t > 143) return 1; - } - return 0; - } -})); -var Fn = c$3(((e, t) => { - let n = Nn(), r = Pn(); - t.exports = class { - constructor(e = `utf8`) { - switch (this.encoding = i(e), this.encoding) { - case `utf8`: - this.decoder = new r(); - break; - case `utf16le`: - case `base64`: throw Error(`Unsupported encoding: ` + this.encoding); - default: this.decoder = new n(this.encoding); - } - } - get remaining() { - return this.decoder.remaining; - } - push(e) { - return typeof e == `string` ? e : this.decoder.decode(e); - } - write(e) { - return this.push(e); - } - end(e) { - let t = ``; - return e && (t = this.push(e)), t += this.decoder.flush(), t; - } - }; - function i(e) { - switch (e = e.toLowerCase(), e) { - case `utf8`: - case `utf-8`: return `utf8`; - case `ucs2`: - case `ucs-2`: - case `utf16le`: - case `utf-16le`: return `utf16le`; - case `latin1`: - case `binary`: return `latin1`; - case `base64`: - case `ascii`: - case `hex`: return e; - default: throw Error(`Unknown encoding: ` + e); - } - } -})); -var In = c$3(((e, t) => { - t.exports = class e extends Error { - constructor(t, n, r = e) { - super(t), this.code = n, Error.captureStackTrace && Error.captureStackTrace(this, r); - } - static isStreamDestroyed(e) { - return e && e.code === `STREAM_DESTROYED`; - } - static isPrematureClose(e) { - return e && e.code === `PREMATURE_CLOSE`; - } - static isAborted(e) { - return e && e.code === `ABORTED`; - } - get name() { - return `StreamError`; - } - static STREAM_DESTROYED() { - return new e(`Stream was destroyed`, `STREAM_DESTROYED`, e.STREAM_DESTROYED); - } - static PREMATURE_CLOSE() { - return new e(`Premature close`, `PREMATURE_CLOSE`, e.PREMATURE_CLOSE); - } - static ABORTED() { - return new e(`Stream aborted`, `ABORTED`, e.ABORTED); - } - }; -})); -var Ln = c$3(((e, t) => { - let { EventEmitter: n } = kn(), r = jn(), i = Fn(), a = In(), o = typeof queueMicrotask > `u` ? (e) => global.process.nextTick(e) : queueMicrotask, s = 536870910, c = 1024, l = 2048, u = 16384, d = 32768, f = 131072, p = 536805375, m = 536870143, h = 536838143, g = 536739839, _ = 2 << 18, v = 4 << 18, y = 8 << 18, b = 32 << 18, x = 64 << 18, S = 128 << 18, C = 512 << 18, w = 1024 << 18, T = 503316479, E = 268435455, D = 262160, O = 8404992, k = 8405006, A = 33587200, j = 33587215, M = 16527, N = 270794767, P = Symbol.asyncIterator || Symbol(`asyncIterator`); - var F = class { - constructor(e, { highWaterMark: t = 16384, map: n = null, mapWritable: i, byteLength: a, byteLengthWritable: o } = {}) { - this.stream = e, this.queue = new r(), this.highWaterMark = t, this.buffered = 0, this.error = null, this.pipeline = null, this.drains = null, this.byteLength = o || a || ve, this.map = i || n, this.afterWrite = V.bind(this), this.afterUpdateNextTick = U.bind(this); - } - get ending() { - return (this.stream._duplexState & C) != 0; - } - get ended() { - return (this.stream._duplexState & b) != 0; - } - push(e) { - return this.stream._duplexState & 142606350 ? !1 : (this.map !== null && (e = this.map(e)), this.buffered += this.byteLength(e), this.queue.push(e), this.buffered < this.highWaterMark ? (this.stream._duplexState |= y, !0) : (this.stream._duplexState |= 6291456, !1)); - } - shift() { - let e = this.queue.shift(); - return this.buffered -= this.byteLength(e), this.buffered === 0 && (this.stream._duplexState &= 534773759), e; - } - end(e) { - typeof e == `function` ? this.stream.once(`finish`, e) : e != null && this.push(e), this.stream._duplexState = (this.stream._duplexState | C) & 535822335; - } - autoBatch(e, t) { - let n = [], r = this.stream; - for (n.push(e); (r._duplexState & N) == 2359296;) n.push(r._writableState.shift()); - if (r._duplexState & 15) return t(null); - r._writev(n, t); - } - update() { - let e = this.stream; - e._duplexState |= _; - do { - for (; (e._duplexState & N) == y;) { - let t = this.shift(); - e._duplexState |= 67371008, e._write(t, this.afterWrite); - } - e._duplexState & 1310720 || this.updateNonPrimary(); - } while (this.continueUpdate() === !0); - e._duplexState &= 536346623; - } - updateNonPrimary() { - let e = this.stream; - if ((e._duplexState & 144965647) == C) { - e._duplexState |= 262144, e._final(z.bind(this)); - return; - } - if ((e._duplexState & 14) == 4) { - e._duplexState & A || (e._duplexState |= D, e._destroy(B.bind(this))); - return; - } - (e._duplexState & j) == 1 && (e._duplexState = (e._duplexState | D) & s, e._open(ne.bind(this))); - } - continueUpdate() { - return this.stream._duplexState & S ? (this.stream._duplexState &= T, !0) : !1; - } - updateCallback() { - (this.stream._duplexState & 35127311) == v ? this.update() : this.updateNextTick(); - } - updateNextTick() { - this.stream._duplexState & S || (this.stream._duplexState |= S, this.stream._duplexState & _ || o(this.afterUpdateNextTick)); - } - }, I = class { - constructor(e, { highWaterMark: t = 16384, map: n = null, mapReadable: i, byteLength: a, byteLengthReadable: o } = {}) { - this.stream = e, this.queue = new r(), this.highWaterMark = t === 0 ? 1 : t, this.buffered = 0, this.readAhead = t > 0, this.error = null, this.pipeline = null, this.byteLength = o || a || ve, this.map = i || n, this.pipeTo = null, this.afterRead = H.bind(this), this.afterUpdateNextTick = te.bind(this); - } - get ending() { - return (this.stream._duplexState & c) != 0; - } - get ended() { - return (this.stream._duplexState & u) != 0; - } - pipe(e, t) { - if (this.pipeTo !== null) throw Error(`Can only pipe to one destination`); - if (typeof t != `function` && (t = null), this.stream._duplexState |= 512, this.pipeTo = e, this.pipeline = new R(this.stream, e, t), t && this.stream.on(`error`, ye), Y(e)) e._writableState.pipeline = this.pipeline, t && e.on(`error`, ye), e.on(`finish`, this.pipeline.finished.bind(this.pipeline)); - else { - let t = this.pipeline.done.bind(this.pipeline, e), n = this.pipeline.done.bind(this.pipeline, e, null); - e.on(`error`, t), e.on(`close`, n), e.on(`finish`, this.pipeline.finished.bind(this.pipeline)); - } - e.on(`drain`, ee.bind(this)), this.stream.emit(`piping`, e), e.emit(`pipe`, this.stream); - } - push(e) { - let t = this.stream; - return e === null ? (this.highWaterMark = 0, t._duplexState = (t._duplexState | c) & 536805311, !1) : this.map !== null && (e = this.map(e), e === null) ? (t._duplexState &= p, this.buffered < this.highWaterMark) : (this.buffered += this.byteLength(e), this.queue.push(e), t._duplexState = (t._duplexState | 128) & p, this.buffered < this.highWaterMark); - } - shift() { - let e = this.queue.shift(); - return this.buffered -= this.byteLength(e), this.buffered === 0 && (this.stream._duplexState &= 536862591), e; - } - unshift(e) { - let t = [this.map === null ? e : this.map(e)]; - for (; this.buffered > 0;) t.push(this.shift()); - for (let e = 0; e < t.length - 1; e++) { - let n = t[e]; - this.buffered += this.byteLength(n), this.queue.push(n); - } - this.push(t[t.length - 1]); - } - read() { - let e = this.stream; - if ((e._duplexState & M) == 128) { - let t = this.shift(); - return this.pipeTo !== null && this.pipeTo.write(t) === !1 && (e._duplexState &= m), e._duplexState & l && e.emit(`data`, t), t; - } - return this.readAhead === !1 && (e._duplexState |= f, this.updateNextTick()), null; - } - drain() { - let e = this.stream; - for (; (e._duplexState & M) == 128 && e._duplexState & 768;) { - let t = this.shift(); - this.pipeTo !== null && this.pipeTo.write(t) === !1 && (e._duplexState &= m), e._duplexState & l && e.emit(`data`, t); - } - } - update() { - let e = this.stream; - e._duplexState |= 32; - do { - for (this.drain(); this.buffered < this.highWaterMark && (e._duplexState & 214047) == f;) e._duplexState |= 65552, e._read(this.afterRead), this.drain(); - (e._duplexState & 12431) == 4224 && (e._duplexState |= 8192, e.emit(`readable`)), e._duplexState & 80 || this.updateNonPrimary(); - } while (this.continueUpdate() === !0); - e._duplexState &= 536870879; - } - updateNonPrimary() { - let e = this.stream; - if ((e._duplexState & 1167) == c && (e._duplexState = (e._duplexState | u) & 536869887, e.emit(`end`), (e._duplexState & k) == O && (e._duplexState |= 4), this.pipeTo !== null && this.pipeTo.end()), (e._duplexState & 14) == 4) { - e._duplexState & A || (e._duplexState |= D, e._destroy(B.bind(this))); - return; - } - (e._duplexState & j) == 1 && (e._duplexState = (e._duplexState | D) & s, e._open(ne.bind(this))); - } - continueUpdate() { - return this.stream._duplexState & d ? (this.stream._duplexState &= h, !0) : !1; - } - updateCallback() { - (this.stream._duplexState & 32879) == 64 ? this.update() : this.updateNextTick(); - } - updateNextTickIfOpen() { - this.stream._duplexState & 32769 || (this.stream._duplexState |= d, this.stream._duplexState & 32 || o(this.afterUpdateNextTick)); - } - updateNextTick() { - this.stream._duplexState & d || (this.stream._duplexState |= d, this.stream._duplexState & 32 || o(this.afterUpdateNextTick)); - } - }, L = class { - constructor(e) { - this.data = null, this.afterTransform = G.bind(e), this.afterFinal = null; - } - }, R = class { - constructor(e, t, n) { - this.from = e, this.to = t, this.afterPipe = n, this.error = null, this.pipeToFinished = !1; - } - finished() { - this.pipeToFinished = !0; - } - done(e, t) { - if (t && (this.error = t), e === this.to && (this.to = null, this.from !== null)) { - (!(this.from._duplexState & u) || !this.pipeToFinished) && this.from.destroy(this.error || Error(`Writable stream closed prematurely`)); - return; - } - if (e === this.from && (this.from = null, this.to !== null)) { - e._duplexState & u || this.to.destroy(this.error || Error(`Readable stream closed before ending`)); - return; - } - this.afterPipe !== null && this.afterPipe(this.error), this.to = this.from = this.afterPipe = null; - } - }; - function ee() { - this.stream._duplexState |= 512, this.updateCallback(); - } - function z(e) { - let t = this.stream; - e && t.destroy(e), t._duplexState & 14 || (t._duplexState |= b, t.emit(`finish`)), (t._duplexState & k) == O && (t._duplexState |= 4), t._duplexState &= 402391039, t._duplexState & _ ? this.updateNextTick() : this.update(); - } - function B(e) { - let t = this.stream; - !e && !a.isStreamDestroyed(this.error) && (e = this.error), e && t.emit(`error`, e), t._duplexState |= 8, t.emit(`close`); - let n = t._readableState, r = t._writableState; - if (n !== null && n.pipeline !== null && n.pipeline.done(t, e), r !== null) { - for (; r.drains !== null && r.drains.length > 0;) r.drains.shift().resolve(!1); - r.pipeline !== null && r.pipeline.done(t, e); - } - } - function V(e) { - let t = this.stream; - e && t.destroy(e), t._duplexState &= 469499903, this.drains !== null && W(this.drains), (t._duplexState & 6553615) == 4194304 && (t._duplexState &= 532676607, (t._duplexState & x) == x && t.emit(`drain`)), this.updateCallback(); - } - function H(e) { - e && this.stream.destroy(e), this.stream._duplexState &= 536870895, this.readAhead === !1 && !(this.stream._duplexState & 256) && (this.stream._duplexState &= g), this.updateCallback(); - } - function te() { - this.stream._duplexState & 32 || (this.stream._duplexState &= h, this.update()); - } - function U() { - this.stream._duplexState & _ || (this.stream._duplexState &= T, this.update()); - } - function W(e) { - for (let t = 0; t < e.length; t++) --e[t].writes === 0 && (e.shift().resolve(!0), t--); - } - function ne(e) { - let t = this.stream; - e && t.destroy(e), t._duplexState & 4 || (t._duplexState & 17423 || (t._duplexState |= 64), t._duplexState & 142606351 || (t._duplexState |= v), t.emit(`open`)), t._duplexState &= 536608751, t._writableState !== null && t._writableState.updateCallback(), t._readableState !== null && t._readableState.updateCallback(); - } - function G(e, t) { - t != null && this.push(t), this._writableState.afterWrite(e); - } - function K(e) { - this._readableState !== null && (e === `data` && (this._duplexState |= 133376, this._readableState.updateNextTick()), e === `readable` && (this._duplexState |= 4096, this._readableState.updateNextTick())), this._writableState !== null && e === `drain` && (this._duplexState |= x, this._writableState.updateNextTick()); - } - var re = class extends n { - constructor(e) { - super(), this._duplexState = 0, this._readableState = null, this._writableState = null, e && (e.open && (this._open = e.open), e.destroy && (this._destroy = e.destroy), e.predestroy && (this._predestroy = e.predestroy), e.signal && e.signal.addEventListener(`abort`, be.bind(this))), this.on(`newListener`, K); - } - _open(e) { - e(null); - } - _destroy(e) { - e(null); - } - _predestroy() {} - get readable() { - return this._readableState === null ? void 0 : !0; - } - get writable() { - return this._writableState === null ? void 0 : !0; - } - get destroyed() { - return (this._duplexState & 8) != 0; - } - get destroying() { - return (this._duplexState & 14) != 0; - } - destroy(e) { - this._duplexState & 14 || (e ||= a.STREAM_DESTROYED(), this._duplexState = (this._duplexState | 4) & 535822271, this._readableState !== null && (this._readableState.highWaterMark = 0, this._readableState.error = e), this._writableState !== null && (this._writableState.highWaterMark = 0, this._writableState.error = e), this._duplexState |= 2, this._predestroy(), this._duplexState &= 536870909, this._readableState !== null && this._readableState.updateNextTick(), this._writableState !== null && this._writableState.updateNextTick()); - } - }, ie = class e extends re { - constructor(e) { - super(e), this._duplexState |= 8519681, this._readableState = new I(this, e), e && (this._readableState.readAhead === !1 && (this._duplexState &= g), e.read && (this._read = e.read), e.eagerOpen && this._readableState.updateNextTick(), e.encoding && this.setEncoding(e.encoding)); - } - static deferred(e, t) { - let n = new ce(t); - return e().then((e) => { - if (e === null) return n.end(); - n.destroying || J(e, n, ye); - }).catch((e) => n.destroy(e)), n; - } - setEncoding(e) { - let t = new i(e), n = this._readableState.map || ue; - return this._readableState.map = r, this; - function r(e) { - let r = t.push(e); - return r === `` && (e.byteLength !== 0 || t.remaining > 0) ? null : n(r); - } - } - _read(e) { - e(null); - } - pipe(e, t) { - return this._readableState.updateNextTick(), this._readableState.pipe(e, t), e; - } - read() { - return this._readableState.updateNextTick(), this._readableState.read(); - } - push(e) { - return this._readableState.updateNextTickIfOpen(), this._readableState.push(e); - } - unshift(e) { - return this._readableState.updateNextTickIfOpen(), this._readableState.unshift(e); - } - resume() { - return this._duplexState |= 131328, this._readableState.updateNextTick(), this; - } - pause() { - return this._duplexState &= this._readableState.readAhead === !1 ? 536739583 : 536870655, this; - } - static _fromAsyncIterator(t, n) { - let r, i = new e({ - ...n, - read(e) { - t.next().then(a).then(e.bind(null, null)).catch(e); - }, - predestroy() { - r = t.return(); - }, - destroy(e) { - if (!r) return e(null); - r.then(e.bind(null, null)).catch(e); - } - }); - return i; - function a(e) { - e.done ? i.push(null) : i.push(e.value); - } - } - static from(t, n) { - if (ge(t)) return t; - if (t[P]) return this._fromAsyncIterator(t[P](), n); - Array.isArray(t) || (t = t === void 0 ? [] : [t]); - let r = 0; - return new e({ - ...n, - read(e) { - this.push(r === t.length ? null : t[r++]), e(null); - } - }); - } - static isBackpressured(e) { - return (e._duplexState & 17422) != 0 || e._readableState.buffered >= e._readableState.highWaterMark; - } - static isPaused(e) { - return (e._duplexState & 256) == 0; - } - [P]() { - let e = this, t = null, n = null, r = null; - return this.on(`error`, (e) => { - t = e; - }), this.on(`readable`, i), this.on(`close`, o), { - [P]() { - return this; - }, - next() { - return new Promise(function(t, i) { - n = t, r = i; - let a = e.read(); - a === null ? e._duplexState & 8 && s(null) : s(a); - }); - }, - return() { - return c(null); - }, - throw(e) { - return c(e); - } - }; - function i() { - n !== null && s(e.read()); - } - function o() { - n !== null && s(null); - } - function s(i) { - r !== null && (t ? r(t) : i === null && !(e._duplexState & u) ? r(a.STREAM_DESTROYED()) : n({ - value: i, - done: i === null - }), r = n = null); - } - function c(t) { - return e.destroy(t), new Promise((n, r) => { - if (e._duplexState & 8) return n({ - value: void 0, - done: !0 - }); - e.once(`close`, function() { - t ? r(t) : n({ - value: void 0, - done: !0 - }); - }); - }); - } - } - }, ae = class extends re { - constructor(e) { - super(e), this._duplexState |= 16385, this._writableState = new F(this, e), e && (e.writev && (this._writev = e.writev), e.write && (this._write = e.write), e.final && (this._final = e.final), e.eagerOpen && this._writableState.updateNextTick()); - } - cork() { - this._duplexState |= w; - } - uncork() { - this._duplexState &= E, this._writableState.updateNextTick(); - } - _writev(e, t) { - t(null); - } - _write(e, t) { - this._writableState.autoBatch(e, t); - } - _final(e) { - e(null); - } - static isBackpressured(e) { - return (e._duplexState & 146800654) != 0; - } - static drained(e) { - if (e.destroyed) return Promise.resolve(!1); - let t = e._writableState, n = (xe(e) ? Math.min(1, t.queue.length) : t.queue.length) + (e._duplexState & 67108864 ? 1 : 0); - return n === 0 ? Promise.resolve(!0) : (t.drains === null && (t.drains = []), new Promise((e) => { - t.drains.push({ - writes: n, - resolve: e - }); - })); - } - write(e) { - return this._writableState.updateNextTick(), this._writableState.push(e); - } - end(e) { - return this._writableState.updateNextTick(), this._writableState.end(e), this; - } - }, oe = class extends ie { - constructor(e) { - super(e), this._duplexState = 1 | this._duplexState & f, this._writableState = new F(this, e), e && (e.writev && (this._writev = e.writev), e.write && (this._write = e.write), e.final && (this._final = e.final)); - } - cork() { - this._duplexState |= w; - } - uncork() { - this._duplexState &= E, this._writableState.updateNextTick(); - } - _writev(e, t) { - t(null); - } - _write(e, t) { - this._writableState.autoBatch(e, t); - } - _final(e) { - e(null); - } - write(e) { - return this._writableState.updateNextTick(), this._writableState.push(e); - } - end(e) { - return this._writableState.updateNextTick(), this._writableState.end(e), this; - } - }, se = class extends oe { - constructor(e) { - super(e), this._transformState = new L(this), e && (e.transform && (this._transform = e.transform), e.flush && (this._flush = e.flush)); - } - _write(e, t) { - this._readableState.buffered >= this._readableState.highWaterMark ? this._transformState.data = e : this._transform(e, this._transformState.afterTransform); - } - _read(e) { - if (this._transformState.data !== null) { - let t = this._transformState.data; - this._transformState.data = null, e(null), this._transform(t, this._transformState.afterTransform); - } else e(null); - } - destroy(e) { - super.destroy(e), this._transformState.data !== null && (this._transformState.data = null, this._transformState.afterTransform()); - } - _transform(e, t) { - t(null, e); - } - _flush(e) { - e(null); - } - _final(e) { - this._transformState.afterFinal = e, this._flush(le.bind(this)); - } - }, ce = class extends se {}; - function le(e, t) { - let n = this._transformState.afterFinal; - if (e) return n(e); - t != null && this.push(t), this.push(null), n(null); - } - function q(...e) { - return new Promise((t, n) => J(...e, (e) => { - if (e) return n(e); - t(); - })); - } - function J(e, ...t) { - let n = Array.isArray(e) ? [...e, ...t] : [e, ...t], r = n.length && typeof n[n.length - 1] == `function` ? n.pop() : null; - if (n.length < 2) throw Error(`Pipeline requires at least 2 streams`); - let i = n[0], o = null, s = null; - for (let e = 1; e < n.length; e++) o = n[e], Y(i) ? i.pipe(o, l) : (c(i, !0, e > 1, l), i.pipe(o)), i = o; - if (r) { - let e = !1, t = Y(o) || !!(o._writableState && o._writableState.autoDestroy); - o.on(`error`, (e) => { - s === null && (s = e); - }), o.on(`finish`, () => { - e = !0, t || r(s); - }), t && o.on(`close`, () => r(s || (e ? null : a.PREMATURE_CLOSE()))); - } - return o; - function c(e, t, n, r) { - e.on(`error`, r), e.on(`close`, i); - function i() { - if (t && e._readableState && !e._readableState.ended || n && e._writableState && !e._writableState.ended) return r(a.PREMATURE_CLOSE()); - } - } - function l(e) { - if (!(!e || s)) { - s = e; - for (let t of n) t.destroy(e); - } - } - } - function ue(e) { - return e; - } - function de(e) { - return !!e._readableState || !!e._writableState; - } - function Y(e) { - return typeof e._duplexState == `number` && de(e); - } - function fe(e) { - return !!e._readableState && e._readableState.ending; - } - function pe(e) { - return !!e._readableState && e._readableState.ended; - } - function X(e) { - return !!e._writableState && e._writableState.ending; - } - function me(e) { - return !!e._writableState && e._writableState.ended; - } - function he(e, t = {}) { - let n = e._readableState && e._readableState.error || e._writableState && e._writableState.error; - return !t.all && a.isStreamDestroyed(n) ? null : n; - } - function ge(e) { - return Y(e) && e.readable; - } - function Z(e) { - return (e._duplexState & 1) != 1 || (e._duplexState & 4) == 4 || (e._duplexState & A) != 0; - } - function _e(e) { - return typeof e == `object` && !!e && typeof e.byteLength == `number`; - } - function ve(e) { - return _e(e) ? e.byteLength : 1024; - } - function ye() {} - function be() { - this.destroy(a.ABORTED()); - } - function xe(e) { - return e._writev !== ae.prototype._writev && e._writev !== oe.prototype._writev; - } - t.exports = { - pipeline: J, - pipelinePromise: q, - isStream: de, - isStreamx: Y, - isEnding: fe, - isEnded: pe, - isFinishing: X, - isFinished: me, - isDisturbed: Z, - getStreamError: he, - Stream: re, - Writable: ae, - Readable: ie, - Duplex: oe, - Transform: se, - PassThrough: ce - }; -})); -var Rn = c$3(((e) => { - let t = Mn(), n = t.from([ - 117, - 115, - 116, - 97, - 114, - 0 - ]), r = t.from([48, 48]), i = t.from([ - 117, - 115, - 116, - 97, - 114, - 32 - ]), a = t.from([32, 0]); - e.decodeLongPath = function(e, t) { - return v(e, 0, e.length, t); - }, e.encodePax = function(e) { - let n = ``; - e.name && (n += y(` path=` + e.name + ` -`)), e.linkname && (n += y(` linkpath=` + e.linkname + ` -`)); - let r = e.pax; - if (r) for (let e in r) n += y(` ` + e + `=` + r[e] + ` -`); - return t.from(n); - }, e.decodePax = function(e) { - let n = {}; - for (; e.length;) { - let r = 0; - for (; r < e.length && e[r] !== 32;) r++; - let i = parseInt(t.toString(e.subarray(0, r)), 10); - if (!i) return n; - let a = t.toString(e.subarray(r + 1, i - 1)), o = a.indexOf(`=`); - if (o === -1) return n; - n[a.slice(0, o)] = a.slice(o + 1), e = e.subarray(i); - } - return n; - }, e.encode = function(e) { - let i = t.alloc(512), a = e.name, o = ``; - if (e.typeflag === 5 && a[a.length - 1] !== `/` && (a += `/`), t.byteLength(a) !== a.length) return null; - for (; t.byteLength(a) > 100;) { - let e = a.indexOf(`/`); - if (e === -1) return null; - o += o ? `/` + a.slice(0, e) : a.slice(0, e), a = a.slice(e + 1); - } - return t.byteLength(a) > 100 || t.byteLength(o) > 155 || e.linkname && t.byteLength(e.linkname) > 100 ? null : (t.write(i, a), t.write(i, p(e.mode & 4095, 6), 100), t.write(i, p(e.uid, 6), 108), t.write(i, p(e.gid, 6), 116), h(e.size, i, 124), t.write(i, p(e.mtime.getTime() / 1e3 | 0, 11), 136), i[156] = 48 + u(e.type), e.linkname && t.write(i, e.linkname, 157), t.copy(n, i, 257), t.copy(r, i, 263), e.uname && t.write(i, e.uname, 265), e.gname && t.write(i, e.gname, 297), t.write(i, p(e.devmajor || 0, 6), 329), t.write(i, p(e.devminor || 0, 6), 337), o && t.write(i, o, 345), t.write(i, p(f(i), 6), 148), i); - }, e.decode = function(e, t, n) { - let r = e[156] === 0 ? 0 : e[156] - 48, i = v(e, 0, 100, t), a = _(e, 100, 8), c = _(e, 108, 8), u = _(e, 116, 8), d = _(e, 124, 12), p = _(e, 136, 12), m = l(r), h = e[157] === 0 ? null : v(e, 157, 100, t), g = v(e, 265, 32), y = v(e, 297, 32), b = _(e, 329, 8), x = _(e, 337, 8), S = f(e); - if (S === 256) return null; - if (S !== _(e, 148, 8)) throw Error(`Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?`); - if (o(e)) e[345] && (i = v(e, 345, 155, t) + `/` + i); - else if (!s(e) && !n) throw Error(`Invalid tar header: unknown format.`); - return r === 0 && i && i[i.length - 1] === `/` && (r = 5), { - name: i, - mode: a, - uid: c, - gid: u, - size: d, - mtime: /* @__PURE__ */ new Date(1e3 * p), - type: m, - linkname: h, - uname: g, - gname: y, - devmajor: b, - devminor: x, - pax: null - }; - }; - function o(e) { - return t.equals(n, e.subarray(257, 263)); - } - function s(e) { - return t.equals(i, e.subarray(257, 263)) && t.equals(a, e.subarray(263, 265)); - } - function c(e, t, n) { - return typeof e == `number` ? (e = ~~e, e >= t ? t : e >= 0 || (e += t, e >= 0) ? e : 0) : n; - } - function l(e) { - switch (e) { - case 0: return `file`; - case 1: return `link`; - case 2: return `symlink`; - case 3: return `character-device`; - case 4: return `block-device`; - case 5: return `directory`; - case 6: return `fifo`; - case 7: return `contiguous-file`; - case 72: return `pax-header`; - case 55: return `pax-global-header`; - case 27: return `gnu-long-link-path`; - case 28: - case 30: return `gnu-long-path`; - } - return null; - } - function u(e) { - switch (e) { - case `file`: return 0; - case `link`: return 1; - case `symlink`: return 2; - case `character-device`: return 3; - case `block-device`: return 4; - case `directory`: return 5; - case `fifo`: return 6; - case `contiguous-file`: return 7; - case `pax-header`: return 72; - } - return 0; - } - function d(e, t, n, r) { - for (; n < r; n++) if (e[n] === t) return n; - return r; - } - function f(e) { - let t = 256; - for (let n = 0; n < 148; n++) t += e[n]; - for (let n = 156; n < 512; n++) t += e[n]; - return t; - } - function p(e, t) { - return e = e.toString(8), e.length > t ? `7777777777777777777`.slice(0, t) + ` ` : `0000000000000000000`.slice(0, t - e.length) + e + ` `; - } - function m(e, t, n) { - t[n] = 128; - for (let r = 11; r > 0; r--) t[n + r] = e & 255, e = Math.floor(e / 256); - } - function h(e, n, r) { - e.toString(8).length > 11 ? m(e, n, r) : t.write(n, p(e, 11), r); - } - function g(e) { - let t; - if (e[0] === 128) t = !0; - else if (e[0] === 255) t = !1; - else return null; - let n = [], r; - for (r = e.length - 1; r > 0; r--) { - let i = e[r]; - t ? n.push(i) : n.push(255 - i); - } - let i = 0, a = n.length; - for (r = 0; r < a; r++) i += n[r] * 256 ** r; - return t ? i : -1 * i; - } - function _(e, n, r) { - if (e = e.subarray(n, n + r), n = 0, e[n] & 128) return g(e); - { - for (; n < e.length && e[n] === 32;) n++; - let r = c(d(e, 32, n, e.length), e.length, e.length); - for (; n < r && e[n] === 0;) n++; - return r === n ? 0 : parseInt(t.toString(e.subarray(n, r)), 8); - } - } - function v(e, n, r, i) { - return t.toString(e.subarray(n, d(e, 0, n, n + r)), i); - } - function y(e) { - let n = t.byteLength(e), r = Math.floor(Math.log(n) / Math.log(10)) + 1; - return n + r >= 10 ** r && r++, n + r + e; - } -})); -var zn = c$3(((e, t) => { - let { Writable: n, Readable: r, getStreamError: i } = Ln(), a = jn(), o = Mn(), s = Rn(), c = o.alloc(0); - var l = class { - constructor() { - this.buffered = 0, this.shifted = 0, this.queue = new a(), this._offset = 0; - } - push(e) { - this.buffered += e.byteLength, this.queue.push(e); - } - shiftFirst(e) { - return this._buffered === 0 ? null : this._next(e); - } - shift(e) { - if (e > this.buffered) return null; - if (e === 0) return c; - let t = this._next(e); - if (e === t.byteLength) return t; - let n = [t]; - for (; (e -= t.byteLength) > 0;) t = this._next(e), n.push(t); - return o.concat(n); - } - _next(e) { - let t = this.queue.peek(), n = t.byteLength - this._offset; - if (e >= n) { - let e = this._offset ? t.subarray(this._offset, t.byteLength) : t; - return this.queue.shift(), this._offset = 0, this.buffered -= n, this.shifted += n, e; - } - return this.buffered -= e, this.shifted += e, t.subarray(this._offset, this._offset += e); - } - }, u = class extends r { - constructor(e, t, n) { - super(), this.header = t, this.offset = n, this._parent = e; - } - _read(e) { - this.header.size === 0 && this.push(null), this._parent._stream === this && this._parent._update(), e(null); - } - _predestroy() { - this._parent.destroy(i(this)); - } - _detach() { - this._parent._stream === this && (this._parent._stream = null, this._parent._missing = p(this.header.size), this._parent._update()); - } - _destroy(e) { - this._detach(), e(null); - } - }, d = class extends n { - constructor(e) { - super(e), e ||= {}, this._buffer = new l(), this._offset = 0, this._header = null, this._stream = null, this._missing = 0, this._longHeader = !1, this._callback = f, this._locked = !1, this._finished = !1, this._pax = null, this._paxGlobal = null, this._gnuLongPath = null, this._gnuLongLinkPath = null, this._filenameEncoding = e.filenameEncoding || `utf-8`, this._allowUnknownFormat = !!e.allowUnknownFormat, this._unlockBound = this._unlock.bind(this); - } - _unlock(e) { - if (this._locked = !1, e) { - this.destroy(e), this._continueWrite(e); - return; - } - this._update(); - } - _consumeHeader() { - if (this._locked) return !1; - this._offset = this._buffer.shifted; - try { - this._header = s.decode(this._buffer.shift(512), this._filenameEncoding, this._allowUnknownFormat); - } catch (e) { - return this._continueWrite(e), !1; - } - if (!this._header) return !0; - switch (this._header.type) { - case `gnu-long-path`: - case `gnu-long-link-path`: - case `pax-global-header`: - case `pax-header`: return this._longHeader = !0, this._missing = this._header.size, !0; - } - return this._locked = !0, this._applyLongHeaders(), this._header.size === 0 || this._header.type === `directory` ? (this.emit(`entry`, this._header, this._createStream(), this._unlockBound), !0) : (this._stream = this._createStream(), this._missing = this._header.size, this.emit(`entry`, this._header, this._stream, this._unlockBound), !0); - } - _applyLongHeaders() { - this._gnuLongPath &&= (this._header.name = this._gnuLongPath, null), this._gnuLongLinkPath &&= (this._header.linkname = this._gnuLongLinkPath, null), this._pax &&= (this._pax.path && (this._header.name = this._pax.path), this._pax.linkpath && (this._header.linkname = this._pax.linkpath), this._pax.size && (this._header.size = parseInt(this._pax.size, 10)), this._header.pax = this._pax, null); - } - _decodeLongHeader(e) { - switch (this._header.type) { - case `gnu-long-path`: - this._gnuLongPath = s.decodeLongPath(e, this._filenameEncoding); - break; - case `gnu-long-link-path`: - this._gnuLongLinkPath = s.decodeLongPath(e, this._filenameEncoding); - break; - case `pax-global-header`: - this._paxGlobal = s.decodePax(e); - break; - case `pax-header`: - this._pax = this._paxGlobal === null ? s.decodePax(e) : Object.assign({}, this._paxGlobal, s.decodePax(e)); - break; - } - } - _consumeLongHeader() { - this._longHeader = !1, this._missing = p(this._header.size); - let e = this._buffer.shift(this._header.size); - try { - this._decodeLongHeader(e); - } catch (e) { - return this._continueWrite(e), !1; - } - return !0; - } - _consumeStream() { - let e = this._buffer.shiftFirst(this._missing); - if (e === null) return !1; - this._missing -= e.byteLength; - let t = this._stream.push(e); - return this._missing === 0 ? (this._stream.push(null), t && this._stream._detach(), t && this._locked === !1) : t; - } - _createStream() { - return new u(this, this._header, this._offset); - } - _update() { - for (; this._buffer.buffered > 0 && !this.destroying;) { - if (this._missing > 0) { - if (this._stream !== null) { - if (this._consumeStream() === !1) return; - continue; - } - if (this._longHeader === !0) { - if (this._missing > this._buffer.buffered) break; - if (this._consumeLongHeader() === !1) return !1; - continue; - } - let e = this._buffer.shiftFirst(this._missing); - e !== null && (this._missing -= e.byteLength); - continue; - } - if (this._buffer.buffered < 512) break; - if (this._stream !== null || this._consumeHeader() === !1) return; - } - this._continueWrite(null); - } - _continueWrite(e) { - let t = this._callback; - this._callback = f, t(e); - } - _write(e, t) { - this._callback = t, this._buffer.push(e), this._update(); - } - _final(e) { - this._finished = this._missing === 0 && this._buffer.buffered === 0, e(this._finished ? null : Error(`Unexpected end of data`)); - } - _predestroy() { - this._continueWrite(null); - } - _destroy(e) { - this._stream && this._stream.destroy(i(this)), e(null); - } - [Symbol.asyncIterator]() { - let e = null, t = null, n = null, r = null, i = null, a = this; - return this.on(`entry`, c), this.on(`error`, (t) => { - e = t; - }), this.on(`close`, l), { - [Symbol.asyncIterator]() { - return this; - }, - next() { - return new Promise(s); - }, - return() { - return u(null); - }, - throw(e) { - return u(e); - } - }; - function o(e) { - if (!i) return; - let t = i; - i = null, t(e); - } - function s(i, s) { - if (e) return s(e); - if (r) { - i({ - value: r, - done: !1 - }), r = null; - return; - } - t = i, n = s, o(null), a._finished && t && (t({ - value: void 0, - done: !0 - }), t = n = null); - } - function c(e, a, o) { - i = o, a.on(`error`, f), t ? (t({ - value: a, - done: !1 - }), t = n = null) : r = a; - } - function l() { - o(e), t &&= (e ? n(e) : t({ - value: void 0, - done: !0 - }), n = null); - } - function u(e) { - return a.destroy(e), o(e), new Promise((t, n) => { - if (a.destroyed) return t({ - value: void 0, - done: !0 - }); - a.once(`close`, function() { - e ? n(e) : t({ - value: void 0, - done: !0 - }); - }); - }); - } - } - }; - t.exports = function(e) { - return new d(e); - }; - function f() {} - function p(e) { - return e &= 511, e && 512 - e; - } -})); -var Bn = c$3(((e, t) => { - let r = { - S_IFMT: 61440, - S_IFDIR: 16384, - S_IFCHR: 8192, - S_IFBLK: 24576, - S_IFIFO: 4096, - S_IFLNK: 40960 - }; - try { - t.exports = p$4(`fs`).constants || r; - } catch { - t.exports = r; - } -})); -var Vn = c$3(((e, t) => { - let { Readable: n, Writable: r, getStreamError: i } = Ln(), a = Mn(), o = Bn(), s = Rn(), c = a.alloc(1024); - var l = class extends r { - constructor(e, t, n) { - super({ - mapWritable: m, - eagerOpen: !0 - }), this.written = 0, this.header = t, this._callback = n, this._linkname = null, this._isLinkname = t.type === `symlink` && !t.linkname, this._isVoid = t.type !== `file` && t.type !== `contiguous-file`, this._finished = !1, this._pack = e, this._openCallback = null, this._pack._stream === null ? this._pack._stream = this : this._pack._pending.push(this); - } - _open(e) { - this._openCallback = e, this._pack._stream === this && this._continueOpen(); - } - _continuePack(e) { - if (this._callback === null) return; - let t = this._callback; - this._callback = null, t(e); - } - _continueOpen() { - this._pack._stream === null && (this._pack._stream = this); - let e = this._openCallback; - if (this._openCallback = null, e !== null) { - if (this._pack.destroying) return e(Error(`pack stream destroyed`)); - if (this._pack._finalized) return e(Error(`pack stream is already finalized`)); - this._pack._stream = this, this._isLinkname || this._pack._encode(this.header), this._isVoid && (this._finish(), this._continuePack(null)), e(null); - } - } - _write(e, t) { - if (this._isLinkname) return this._linkname = this._linkname ? a.concat([this._linkname, e]) : e, t(null); - if (this._isVoid) return e.byteLength > 0 ? t(Error(`No body allowed for this entry`)) : t(); - if (this.written += e.byteLength, this._pack.push(e)) return t(); - this._pack._drain = t; - } - _finish() { - this._finished || (this._finished = !0, this._isLinkname && (this.header.linkname = this._linkname ? a.toString(this._linkname, `utf-8`) : ``, this._pack._encode(this.header)), p(this._pack, this.header.size), this._pack._done(this)); - } - _final(e) { - if (this.written !== this.header.size) return e(Error(`Size mismatch`)); - this._finish(), e(null); - } - _getError() { - return i(this) || Error(`tar entry destroyed`); - } - _predestroy() { - this._pack.destroy(this._getError()); - } - _destroy(e) { - this._pack._done(this), this._continuePack(this._finished ? null : this._getError()), e(); - } - }, u = class extends n { - constructor(e) { - super(e), this._drain = f, this._finalized = !1, this._finalizing = !1, this._pending = [], this._stream = null; - } - entry(e, t, n) { - if (this._finalized || this.destroying) throw Error(`already finalized or destroyed`); - typeof t == `function` && (n = t, t = null), n ||= f, (!e.size || e.type === `symlink`) && (e.size = 0), e.type ||= d(e.mode), e.mode ||= e.type === `directory` ? 493 : 420, e.uid ||= 0, e.gid ||= 0, e.mtime ||= /* @__PURE__ */ new Date(), typeof t == `string` && (t = a.from(t)); - let r = new l(this, e, n); - return a.isBuffer(t) ? (e.size = t.byteLength, r.write(t), r.end(), r) : (r._isVoid, r); - } - finalize() { - if (this._stream || this._pending.length > 0) { - this._finalizing = !0; - return; - } - this._finalized || (this._finalized = !0, this.push(c), this.push(null)); - } - _done(e) { - e === this._stream && (this._stream = null, this._finalizing && this.finalize(), this._pending.length && this._pending.shift()._continueOpen()); - } - _encode(e) { - if (!e.pax) { - let t = s.encode(e); - if (t) { - this.push(t); - return; - } - } - this._encodePax(e); - } - _encodePax(e) { - let t = s.encodePax({ - name: e.name, - linkname: e.linkname, - pax: e.pax - }), n = { - name: `PaxHeader`, - mode: e.mode, - uid: e.uid, - gid: e.gid, - size: t.byteLength, - mtime: e.mtime, - type: `pax-header`, - linkname: e.linkname && `PaxHeader`, - uname: e.uname, - gname: e.gname, - devmajor: e.devmajor, - devminor: e.devminor - }; - this.push(s.encode(n)), this.push(t), p(this, t.byteLength), n.size = e.size, n.type = e.type, this.push(s.encode(n)); - } - _doDrain() { - let e = this._drain; - this._drain = f, e(); - } - _predestroy() { - let e = i(this); - for (this._stream && this._stream.destroy(e); this._pending.length;) { - let t = this._pending.shift(); - t.destroy(e), t._continueOpen(); - } - this._doDrain(); - } - _read(e) { - this._doDrain(), e(); - } - }; - t.exports = function(e) { - return new u(e); - }; - function d(e) { - switch (e & o.S_IFMT) { - case o.S_IFBLK: return `block-device`; - case o.S_IFCHR: return `character-device`; - case o.S_IFDIR: return `directory`; - case o.S_IFIFO: return `fifo`; - case o.S_IFLNK: return `symlink`; - } - return `file`; - } - function f() {} - function p(e, t) { - t &= 511, t && e.push(c.subarray(0, 512 - t)); - } - function m(e) { - return a.isBuffer(e) ? e : a.from(e); - } -})); -var Hn = d$3(c$3(((e) => { - e.extract = zn(), e.pack = Vn(); -}))(), 1); -var Un = class { - constructor() { - let e = w.createGzip(); - this.pack = Hn.pack(), this.readable = this.pack.pipe(e); - } - async addFile(e) { - return new Promise((t, n) => { - let r = this.pack.entry(`size` in e ? { - name: e.name, - size: e.size, - mode: e.mode - } : { - name: e.name, - size: Buffer.byteLength(e.content), - mode: e.mode - }, (e) => { - if (e) return n(e); - t(); - }); - e.content instanceof Readable$1 ? e.content.pipe(r) : r.end(e.content); - }); - } - async end() { - return new Promise((e, t) => { - this.readable.on(`error`, t), this.readable.on(`end`, e), this.pack.finalize(); - }); - } -}; -function Wn(e) { - return new Promise((t, n) => { - let r = []; - e.on(`error`, (e) => n(e)), e.on(`data`, (e) => r.push(e)), e.on(`end`, () => t(Buffer.concat(r))); - }); -} -function Gn(e) { - if (!b.posix.isAbsolute(e.cwd)) throw Error(`cwd dir must be absolute`); - if (!b.posix.isAbsolute(e.extractDir)) throw Error(`extractDir must be absolute`); - let t = b.posix.isAbsolute(e.filePath) ? b.posix.normalize(e.filePath) : b.posix.join(e.cwd, e.filePath); - return b.posix.relative(e.extractDir, t); -} -function Kn(e) { - return e === `allow-all` || e === `deny-all` ? { mode: e } : e; -} -function qn(e) { - if (e.mode === `allow-all` || e.mode === `deny-all`) return e.mode; - let t = e.allowedCIDRs || e.deniedCIDRs ? { subnets: { - ...e.allowedCIDRs && { allow: e.allowedCIDRs }, - ...e.deniedCIDRs && { deny: e.deniedCIDRs } - } } : void 0; - if (e.injectionRules && e.injectionRules.length > 0 || e.forwardRules && e.forwardRules.length > 0) { - let n = /* @__PURE__ */ new Map(); - for (let t of e.injectionRules ?? []) { - let e = Object.fromEntries((t.headerNames ?? []).map((e) => [e, ``])), r = n.get(t.domain) ?? []; - r.push({ - ...t.match ? { match: t.match } : {}, - transform: [{ headers: e }] - }), n.set(t.domain, r); - } - for (let t of e.forwardRules ?? []) { - let e = n.get(t.domain) ?? []; - e.push({ - ...t.match ? { match: t.match } : {}, - forwardURL: t.forwardURL - }), n.set(t.domain, e); - } - let r = {}; - for (let t of e.allowedDomains ?? []) r[t] = n.get(t) ?? []; - for (let t of [...e.injectionRules ?? [], ...e.forwardRules ?? []]) t.domain in r || (r[t.domain] = n.get(t.domain) ?? []); - return { - allow: r, - ...t - }; - } - return { - ...e.allowedDomains && { allow: e.allowedDomains }, - ...t - }; -} -const Jn = (e) => { - let t = Object.entries(e ?? {}).filter(([e]) => e.startsWith(`__`)); - return Object.fromEntries(t); -}; -var Yn = c$3(((e, t) => { - var r = p$4(`stream`).Transform; - function i(e) { - if (!(this instanceof i)) throw TypeError(`Cannot call a class as a function`); - e ||= {}, r.call(this, { objectMode: !0 }), this._memory = ``, this._emitInvalidLines = e.emitInvalidLines || !1; - } - i.prototype = Object.create(r.prototype), i.prototype._handleLines = function(e, t) { - for (var n = 0; n < e.length; n++) if (e[n] !== ``) { - var r = null, i = null; - try { - i = JSON.parse(e[n]); - } catch (t) { - t.source = e[n], r = t; - } - if (r) if (this._emitInvalidLines) this.emit(`invalid-line`, r); - else return t(r); - else this.push(i); - } - t(null); - }, i.prototype._transform = function(e, t, n) { - var r = (this._memory + e.toString()).split(` -`); - this._memory = r.pop(), this._handleLines(r, n); - }, i.prototype._flush = function(e) { - if (!this._memory) return e(null); - var t = this._memory; - this._memory = ``, this._handleLines([t], e); - }, t.exports = i; -})); -var Xn$1 = c$3(((e, t) => { - var r = p$4(`stream`).Transform; - function i() { - if (!(this instanceof i)) throw TypeError(`Cannot call a class as a function`); - r.call(this, { objectMode: !0 }); - } - i.prototype = Object.create(r.prototype), i.prototype._transform = function(e, t, n) { - var r; - try { - r = JSON.stringify(e); - } catch (t) { - return t.source = e, n(t); - } - n(null, r + ` -`); - }, t.exports = i; -})); -var Zn = c$3(((e) => { - var t = Yn(); - Xn$1(), e.parse = function(e) { - return new t(e); - }; -})); -var Qn = c$3(((e, t) => { - var n = Object.defineProperty, r = Object.getOwnPropertyDescriptor, i = Object.getOwnPropertyNames, a = Object.prototype.hasOwnProperty, o = (e, t) => { - for (var r in t) n(e, r, { - get: t[r], - enumerable: !0 - }); - }, s = (e, t, o, s) => { - if (t && typeof t == `object` || typeof t == `function`) for (let c of i(t)) !a.call(e, c) && c !== o && n(e, c, { - get: () => t[c], - enumerable: !(s = r(t, c)) || s.enumerable - }); - return e; - }, c = (e) => s(n({}, `__esModule`, { value: !0 }), e), l = {}; - o(l, { - SYMBOL_FOR_REQ_CONTEXT: () => u, - getContext: () => d - }), t.exports = c(l); - let u = Symbol.for(`@vercel/request-context`); - function d() { - return globalThis[u]?.get?.() ?? {}; - } -})); -var $n = c$3(((e, t) => { - var n = Object.defineProperty, r = Object.getOwnPropertyDescriptor, i = Object.getOwnPropertyNames, a = Object.prototype.hasOwnProperty, o = (e, t) => { - for (var r in t) n(e, r, { - get: t[r], - enumerable: !0 - }); - }, s = (e, t, o, s) => { - if (t && typeof t == `object` || typeof t == `function`) for (let c of i(t)) !a.call(e, c) && c !== o && n(e, c, { - get: () => t[c], - enumerable: !(s = r(t, c)) || s.enumerable - }); - return e; - }, c = (e) => s(n({}, `__esModule`, { value: !0 }), e), l = {}; - o(l, { VercelOidcTokenError: () => u }), t.exports = c(l); - var u = class extends Error { - constructor(e, t) { - super(e), this.name = `VercelOidcTokenError`, this.cause = t; - } - toString() { - return this.cause ? `${this.name}: ${this.message}: ${this.cause}` : `${this.name}: ${this.message}`; - } - }; -})); -var er = c$3(((t, n) => { - var r = Object.defineProperty, i = Object.getOwnPropertyDescriptor, a = Object.getOwnPropertyNames, o = Object.prototype.hasOwnProperty, s = (e, t) => { - for (var n in t) r(e, n, { - get: t[n], - enumerable: !0 - }); - }, c = (e, t, n, s) => { - if (t && typeof t == `object` || typeof t == `function`) for (let c of a(t)) !o.call(e, c) && c !== n && r(e, c, { - get: () => t[c], - enumerable: !(s = i(t, c)) || s.enumerable - }); - return e; - }, l = (e) => c(r({}, `__esModule`, { value: !0 }), e), u = {}; - s(u, { - getVercelOidcToken: () => p, - getVercelOidcTokenSync: () => m - }), n.exports = l(u); - var d = Qn(), f = $n(); - async function p(t) { - let n = ``, r; - try { - n = m(); - } catch (e) { - r = e; - } - try { - let [{ getTokenPayload: r, isExpired: i }, { refreshToken: a }] = await Promise.all([await Promise.resolve().then(() => d$3(ar())), await Promise.resolve().then(() => token_ORseRyWn_exports).then((t) => d$3(t.default))]); - (!n || i(r(n), t?.expirationBufferMs)) && (await a(t), n = m()); - } catch (e) { - let t = r instanceof Error ? r.message : ``; - throw e instanceof Error && (t = `${t} -${e.message}`), t ? new f.VercelOidcTokenError(t) : e; - } - return n; - } - function m() { - let e = (0, d.getContext)().headers?.[`x-vercel-oidc-token`] ?? process.env.VERCEL_OIDC_TOKEN; - if (!e) throw Error(`The 'x-vercel-oidc-token' header is missing from the request. Do you have the OIDC option enabled in the Vercel project settings?`); - return e; - } -})); -var tr = c$3(((e, t) => { - var n = Object.defineProperty, r = Object.getOwnPropertyDescriptor, i = Object.getOwnPropertyNames, a = Object.prototype.hasOwnProperty, o = (e, t) => { - for (var r in t) n(e, r, { - get: t[r], - enumerable: !0 - }); - }, s = (e, t, o, s) => { - if (t && typeof t == `object` || typeof t == `function`) for (let c of i(t)) !a.call(e, c) && c !== o && n(e, c, { - get: () => t[c], - enumerable: !(s = r(t, c)) || s.enumerable - }); - return e; - }, c = (e) => s(n({}, `__esModule`, { value: !0 }), e), l = {}; - o(l, { - AccessTokenMissingError: () => u, - RefreshAccessTokenFailedError: () => d - }), t.exports = c(l); - var u = class extends Error { - constructor() { - super(`No authentication found. Please log in with the Vercel CLI (vercel login).`), this.name = `AccessTokenMissingError`; - } - }, d = class extends Error { - constructor(e) { - super(`Failed to refresh authentication token.`, { cause: e }), this.name = `RefreshAccessTokenFailedError`; - } - }; -})); -var nr = c$3(((e, t) => { - var r = Object.create, i = Object.defineProperty, a = Object.getOwnPropertyDescriptor, o = Object.getOwnPropertyNames, s = Object.getPrototypeOf, c = Object.prototype.hasOwnProperty, l = (e, t) => { - for (var n in t) i(e, n, { - get: t[n], - enumerable: !0 - }); - }, u = (e, t, n, r) => { - if (t && typeof t == `object` || typeof t == `function`) for (let s of o(t)) !c.call(e, s) && s !== n && i(e, s, { - get: () => t[s], - enumerable: !(r = a(t, s)) || r.enumerable - }); - return e; - }, d = (e, t, n) => (n = e == null ? {} : r(s(e)), u(t || !e || !e.__esModule ? i(n, `default`, { - value: e, - enumerable: !0 - }) : n, e)), f = (e) => u(i({}, `__esModule`, { value: !0 }), e), p = {}; - l(p, { - findRootDir: () => v, - getUserDataDir: () => y - }), t.exports = f(p); - var m = d(p$4(`path`)), h = d(p$4(`fs`)), g = d(p$4(`os`)), _ = $n(); - function v() { - try { - let e = process.cwd(); - for (; e !== m.default.dirname(e);) { - let t = m.default.join(e, `.vercel`); - if (h.default.existsSync(t)) return e; - e = m.default.dirname(e); - } - } catch { - throw new _.VercelOidcTokenError(`Token refresh only supported in node server environments`); - } - return null; - } - function y() { - if (process.env.XDG_DATA_HOME) return process.env.XDG_DATA_HOME; - switch (g.default.platform()) { - case `darwin`: return m.default.join(g.default.homedir(), `Library/Application Support`); - case `linux`: return m.default.join(g.default.homedir(), `.local/share`); - case `win32`: return process.env.LOCALAPPDATA ? process.env.LOCALAPPDATA : null; - default: return null; - } - } -})); -var rr = c$3(((e, t) => { - var r = Object.create, i = Object.defineProperty, a = Object.getOwnPropertyDescriptor, o = Object.getOwnPropertyNames, s = Object.getPrototypeOf, c = Object.prototype.hasOwnProperty, l = (e, t) => { - for (var n in t) i(e, n, { - get: t[n], - enumerable: !0 - }); - }, u = (e, t, n, r) => { - if (t && typeof t == `object` || typeof t == `function`) for (let s of o(t)) !c.call(e, s) && s !== n && i(e, s, { - get: () => t[s], - enumerable: !(r = a(t, s)) || r.enumerable - }); - return e; - }, d = (e, t, n) => (n = e == null ? {} : r(s(e)), u(t || !e || !e.__esModule ? i(n, `default`, { - value: e, - enumerable: !0 - }) : n, e)), f = (e) => u(i({}, `__esModule`, { value: !0 }), e), p = {}; - l(p, { - isValidAccessToken: () => b, - readAuthConfig: () => v, - writeAuthConfig: () => y - }), t.exports = f(p); - var m = d(p$4(`fs`)), h = d(p$4(`path`)), g = ar(); - function _() { - let e = (0, g.getVercelDataDir)(); - if (!e) throw Error(`Unable to find Vercel CLI data directory. Your platform: ${process.platform}. Supported: darwin, linux, win32.`); - return h.join(e, `auth.json`); - } - function v() { - try { - let e = _(); - if (!m.existsSync(e)) return null; - let t = m.readFileSync(e, `utf8`); - return t ? JSON.parse(t) : null; - } catch { - return null; - } - } - function y(e) { - let t = _(), n = h.dirname(t); - m.existsSync(n) || m.mkdirSync(n, { - mode: 504, - recursive: !0 - }), m.writeFileSync(t, JSON.stringify(e, null, 2), { mode: 384 }); - } - function b(e, t = 0) { - if (!e.token) return !1; - if (typeof e.expiresAt != `number`) return !0; - let n = Math.floor(Date.now() / 1e3), r = t / 1e3; - return e.expiresAt >= n + r; - } -})); -var ir = c$3(((e, t) => { - var r = Object.defineProperty, i = Object.getOwnPropertyDescriptor, a = Object.getOwnPropertyNames, o = Object.prototype.hasOwnProperty, s = (e, t) => { - for (var n in t) r(e, n, { - get: t[n], - enumerable: !0 - }); - }, c = (e, t, n, s) => { - if (t && typeof t == `object` || typeof t == `function`) for (let c of a(t)) !o.call(e, c) && c !== n && r(e, c, { - get: () => t[c], - enumerable: !(s = i(t, c)) || s.enumerable - }); - return e; - }, l = (e) => c(r({}, `__esModule`, { value: !0 }), e), u = {}; - s(u, { - processTokenResponse: () => g, - refreshTokenRequest: () => h - }), t.exports = l(u); - var d = p$4(`os`); - let f = `@vercel/oidc node-${process.version} ${(0, d.platform)()} (${(0, d.arch)()}) ${(0, d.hostname)()}`, p = null; - async function m() { - if (p) return p; - let e = await fetch(`https://vercel.com/.well-known/openid-configuration`, { headers: { "user-agent": f } }); - if (!e.ok) throw Error(`Failed to discover OAuth endpoints`); - let t = await e.json(); - if (!t || typeof t.token_endpoint != `string`) throw Error(`Invalid OAuth discovery response`); - let n = t.token_endpoint; - return p = n, n; - } - async function h(e) { - let t = await m(); - return await fetch(t, { - method: `POST`, - headers: { - "Content-Type": `application/x-www-form-urlencoded`, - "user-agent": f - }, - body: new URLSearchParams({ - client_id: `cl_HYyOPBNtFMfHhaUn9L4QPfTZz6TP47bp`, - grant_type: `refresh_token`, - ...e - }) - }); - } - async function g(e) { - let t = await e.json(); - if (!e.ok) { - let e = typeof t == `object` && t && `error` in t ? String(t.error) : `Token refresh failed`; - return [Error(e)]; - } - return typeof t != `object` || !t ? [Error(`Invalid token response`)] : typeof t.access_token == `string` ? t.token_type === `Bearer` ? typeof t.expires_in == `number` ? [null, t] : [Error(`Missing expires_in in response`)] : [Error(`Invalid token_type in response`)] : [Error(`Missing access_token in response`)]; - } -})); -var ar = c$3(((e, t) => { - var r = Object.create, i = Object.defineProperty, a = Object.getOwnPropertyDescriptor, o = Object.getOwnPropertyNames, s = Object.getPrototypeOf, c = Object.prototype.hasOwnProperty, l = (e, t) => { - for (var n in t) i(e, n, { - get: t[n], - enumerable: !0 - }); - }, u = (e, t, n, r) => { - if (t && typeof t == `object` || typeof t == `function`) for (let s of o(t)) !c.call(e, s) && s !== n && i(e, s, { - get: () => t[s], - enumerable: !(r = a(t, s)) || r.enumerable - }); - return e; - }, d = (e, t, n) => (n = e == null ? {} : r(s(e)), u(t || !e || !e.__esModule ? i(n, `default`, { - value: e, - enumerable: !0 - }) : n, e)), f = (e) => u(i({}, `__esModule`, { value: !0 }), e), p = {}; - l(p, { - assertVercelOidcTokenResponse: () => w, - findProjectInfo: () => T, - getTokenPayload: () => O, - getVercelDataDir: () => x, - getVercelOidcToken: () => C, - getVercelToken: () => S, - isExpired: () => k, - loadToken: () => D, - saveToken: () => E - }), t.exports = f(p); - var m = d(p$4(`path`)), h = d(p$4(`fs`)), g = $n(), _ = nr(), v = rr(), y = ir(), b = tr(); - function x() { - let e = (0, _.getUserDataDir)(); - return e ? m.join(e, `com.vercel.cli`) : null; - } - async function S(e) { - let t = (0, v.readAuthConfig)(); - if (!t?.token) throw new b.AccessTokenMissingError(); - if ((0, v.isValidAccessToken)(t, e?.expirationBufferMs)) return t.token; - if (!t.refreshToken) throw (0, v.writeAuthConfig)({}), new b.RefreshAccessTokenFailedError(`No refresh token available`); - try { - let e = await (0, y.refreshTokenRequest)({ refresh_token: t.refreshToken }), [n, r] = await (0, y.processTokenResponse)(e); - if (n || !r) throw (0, v.writeAuthConfig)({}), new b.RefreshAccessTokenFailedError(n); - let i = { - token: r.access_token, - expiresAt: Math.floor(Date.now() / 1e3) + r.expires_in - }; - return r.refresh_token && (i.refreshToken = r.refresh_token), (0, v.writeAuthConfig)(i), i.token; - } catch (e) { - throw (0, v.writeAuthConfig)({}), e instanceof b.AccessTokenMissingError || e instanceof b.RefreshAccessTokenFailedError ? e : new b.RefreshAccessTokenFailedError(e); - } - } - async function C(e, t, n) { - let r = `https://api.vercel.com/v1/projects/${t}/token?source=vercel-oidc-refresh${n ? `&teamId=${n}` : ``}`, i = await fetch(r, { - method: `POST`, - headers: { Authorization: `Bearer ${e}` } - }); - if (!i.ok) throw new g.VercelOidcTokenError(`Failed to refresh OIDC token: ${i.statusText}`); - let a = await i.json(); - return w(a), a; - } - function w(e) { - if (!e || typeof e != `object`) throw TypeError("Vercel OIDC token is malformed. Expected an object. Please run `vc env pull` and try again"); - if (!(`token` in e) || typeof e.token != `string`) throw TypeError("Vercel OIDC token is malformed. Expected a string-valued token property. Please run `vc env pull` and try again"); - } - function T() { - let e = (0, _.findRootDir)(); - if (!e) throw new g.VercelOidcTokenError("Unable to find project root directory. Have you linked your project with `vc link?`"); - let t = m.join(e, `.vercel`, `project.json`); - if (!h.existsSync(t)) throw new g.VercelOidcTokenError("project.json not found, have you linked your project with `vc link?`"); - let n = JSON.parse(h.readFileSync(t, `utf8`)); - if (typeof n.projectId != `string` && typeof n.orgId != `string`) throw TypeError("Expected a string-valued projectId property. Try running `vc link` to re-link your project."); - return { - projectId: n.projectId, - teamId: n.orgId - }; - } - function E(e, t) { - let n = (0, _.getUserDataDir)(); - if (!n) throw new g.VercelOidcTokenError(`Unable to find user data directory. Please reach out to Vercel support.`); - let r = m.join(n, `com.vercel.token`, `${t}.json`), i = JSON.stringify(e); - h.mkdirSync(m.dirname(r), { - mode: 504, - recursive: !0 - }), h.writeFileSync(r, i), h.chmodSync(r, 432); - } - function D(e) { - let t = (0, _.getUserDataDir)(); - if (!t) throw new g.VercelOidcTokenError(`Unable to find user data directory. Please reach out to Vercel support.`); - let n = m.join(t, `com.vercel.token`, `${e}.json`); - if (!h.existsSync(n)) return null; - let r = JSON.parse(h.readFileSync(n, `utf8`)); - return w(r), r; - } - function O(e) { - let t = e.split(`.`); - if (t.length !== 3) throw new g.VercelOidcTokenError("Invalid token. Please run `vc env pull` and try again"); - let n = t[1].replace(/-/g, `+`).replace(/_/g, `/`), r = n.padEnd(n.length + (4 - n.length % 4) % 4, `=`); - return JSON.parse(Buffer.from(r, `base64`).toString(`utf8`)); - } - function k(e, t = 0) { - return e.exp * 1e3 < Date.now() + t; - } -})); -var or = c$3(((e, t) => { - var n = Object.defineProperty, r = Object.getOwnPropertyDescriptor, i = Object.getOwnPropertyNames, a = Object.prototype.hasOwnProperty, o = (e, t) => { - for (var r in t) n(e, r, { - get: t[r], - enumerable: !0 - }); - }, s = (e, t, o, s) => { - if (t && typeof t == `object` || typeof t == `function`) for (let c of i(t)) !a.call(e, c) && c !== o && n(e, c, { - get: () => t[c], - enumerable: !(s = r(t, c)) || s.enumerable - }); - return e; - }, c = (e) => s(n({}, `__esModule`, { value: !0 }), e), l = {}; - o(l, { - AccessTokenMissingError: () => f.AccessTokenMissingError, - RefreshAccessTokenFailedError: () => f.RefreshAccessTokenFailedError, - getContext: () => d.getContext, - getVercelOidcToken: () => u.getVercelOidcToken, - getVercelOidcTokenSync: () => u.getVercelOidcTokenSync, - getVercelToken: () => p.getVercelToken - }), t.exports = c(l); - var u = er(), d = Qn(), f = tr(), p = ar(); -})); -var sr = d$3(Zn(), 1); -var cr = or(); -function lr(e) { - if (e.split(`.`).length !== 3) return null; - try { - let t = JSON.parse(Buffer.from(e.split(`.`)[1], `base64url`).toString(`utf8`)); - return t.owner_id ? { - owner_id: t.owner_id, - project_id: t.project_id - } : null; - } catch { - return null; - } -} -var ur = class extends Ht { - constructor(e) { - super({ - baseUrl: e.baseUrl ?? `https://vercel.com/api`, - token: e.token, - debug: !1, - fetch: e.fetch - }), this.teamId = e.teamId, this.isJwtToken = !1; - let t = lr(e.token); - t && (this.isJwtToken = !0, this.projectId = t.project_id, this.teamId = t.owner_id); - } - async ensureValidToken() { - if (this.isJwtToken) try { - let e = await (0, cr.getVercelOidcToken)({ - expirationBufferMs: 300 * 1e3, - team: this.teamId, - project: this.projectId - }); - if (e !== this.token) { - this.token = e; - let t = lr(e); - t && (this.teamId = t.owner_id); - } - } catch {} - } - async request(e, t) { - return await this.ensureValidToken(), super.request(e, { - ...t, - query: { - teamId: this.teamId, - ...t?.query - }, - headers: { - "content-type": `application/json`, - "user-agent": `vercel/sandbox/${qa$1} (Node.js/${process.version}; ${E.platform()}/${E.arch()})`, - ...t?.headers - } - }); - } - async getSession(e) { - let t = Jn(e), n = new URLSearchParams(t).toString(); - return n = n ? `?${n}` : ``, Q$1(dn, await this.request(`/v2/sandboxes/sessions/${e.sessionId}${n}`, { signal: e.signal })); - } - async createSandbox(e) { - let t = Jn(e); - return Q$1(En, await this.request(`/v2/sandboxes`, { - method: `POST`, - body: JSON.stringify({ - projectId: e.projectId, - ports: e.ports, - source: e.source, - timeout: e.timeout, - resources: e.resources, - runtime: e.runtime, - name: e.name, - persistent: e.persistent, - networkPolicy: e.networkPolicy ? Kn(e.networkPolicy) : void 0, - env: e.env, - tags: e.tags, - snapshotExpiration: e.snapshotExpiration, - keepLastSnapshots: e.keepLastSnapshots, - ...t - }), - signal: e.signal - })); - } - async runCommand(e) { - if (e.wait) { - let t = await this.request(`/v2/sandboxes/sessions/${e.sessionId}/cmd`, { - method: `POST`, - body: JSON.stringify({ - command: e.command, - args: e.args, - cwd: e.cwd, - env: e.env, - sudo: e.sudo, - wait: !0, - timeout: e.timeout - }), - signal: e.signal - }); - if (t.ok || await Q$1(ia$1(), t), t.headers.get(`content-type`) !== `application/x-ndjson`) throw new A$1(t, { - message: `Expected a stream of command data`, - sessionId: e.sessionId - }); - if (t.body === null) throw new A$1(t, { - message: `No response body`, - sessionId: e.sessionId - }); - let n = sr.parse(); - dr(t.body, n, { signal: e.signal }).catch((e) => { - console.error(`Error piping command stream:`, e); - }); - let r = n[Symbol.asyncIterator](), i = await r.next(); - if (i.done) throw new j$1(`stream_ended_early`, `Stream ended before command data was received`, e.sessionId); - let { command: a } = mn.parse(i.value); - return { - command: a, - finished: (async () => { - let t = await r.next(); - if (t.done) throw new j$1(`stream_ended_early`, `Stream ended before command finished`, e.sessionId); - let { command: n } = hn.parse(t.value); - return n; - })() - }; - } - return Q$1(mn, await this.request(`/v2/sandboxes/sessions/${e.sessionId}/cmd`, { - method: `POST`, - body: JSON.stringify({ - command: e.command, - args: e.args, - cwd: e.cwd, - env: e.env, - sudo: e.sudo, - timeout: e.timeout - }), - signal: e.signal - })); - } - async getCommand(e) { - return e.wait ? Q$1(hn, await this.request(`/v2/sandboxes/sessions/${e.sessionId}/cmd/${e.cmdId}`, { - signal: e.signal, - query: { wait: `true` } - })) : Q$1(mn, await this.request(`/v2/sandboxes/sessions/${e.sessionId}/cmd/${e.cmdId}`, { signal: e.signal })); - } - async openInteractive(e) { - return Q$1(fn, await this.request(`/v2/sandboxes/sessions/${e.sessionId}/interactive`, { - method: `POST`, - body: JSON.stringify({}), - signal: e.signal - })); - } - async mkDir(e) { - return Q$1(gn, await this.request(`/v2/sandboxes/sessions/${e.sessionId}/fs/mkdir`, { - method: `POST`, - body: JSON.stringify({ - path: e.path, - cwd: e.cwd - }), - signal: e.signal - })); - } - getFileWriter(e) { - let t = new Un(); - return { - response: (async () => this.request(`/v2/sandboxes/sessions/${e.sessionId}/fs/write`, { - method: `POST`, - headers: { - "content-type": `application/gzip`, - "x-cwd": e.extractDir - }, - body: await Wn(t.readable), - signal: e.signal - }))(), - writer: t - }; - } - async listSessions(e) { - return Q$1(pn, await this.request(`/v2/sandboxes/sessions`, { - query: { - project: e.projectId, - name: e.name, - limit: e.limit, - cursor: e.cursor, - sortOrder: e.sortOrder - }, - method: `GET`, - signal: e.signal - })); - } - async listSnapshots(e) { - return Q$1(yn, await this.request(`/v2/sandboxes/snapshots`, { - query: { - project: e.projectId, - name: e.name, - limit: e.limit, - cursor: e.cursor, - sortOrder: e.sortOrder - }, - method: `GET`, - signal: e.signal - })); - } - async getSnapshotTree(e) { - return Q$1(xn, await this.request(`/v2/sandboxes/snapshots/tree`, { - query: { - project: e.projectId, - snapshotId: e.snapshotId, - limit: e.limit, - sortOrder: e.sortOrder - }, - method: `GET`, - signal: e.signal - })); - } - async writeFiles(e) { - let { writer: t, response: n } = this.getFileWriter({ - sessionId: e.sessionId, - extractDir: e.extractDir, - signal: e.signal - }); - for (let n of e.files) await t.addFile({ - name: Gn({ - filePath: n.path, - extractDir: e.extractDir, - cwd: e.cwd - }), - content: n.content, - mode: n.mode - }); - t.end(), await Q$1(gn, await n); - } - async readFile(e) { - let t = await this.request(`/v2/sandboxes/sessions/${e.sessionId}/fs/read`, { - method: `POST`, - body: JSON.stringify({ - path: e.path, - cwd: e.cwd - }), - signal: e.signal - }); - if (t.status === 404) return null; - let n = t.headers.get(`content-type`) ?? ``; - if (!t.ok || !n.includes(`application/octet-stream`)) { - let e = await t.text().catch(() => ``), r; - try { - r = JSON.parse(e || `{}`); - } catch { - r = void 0; - } - throw new A$1(t, { - message: `Unexpected response reading file: status ${t.status}, content-type ${n || `(none)`}`, - json: r, - text: e - }); - } - return t.body === null ? null : Readable$1.fromWeb(t.body); - } - async killCommand(e) { - return Q$1(mn, await this.request(`/v2/sandboxes/sessions/${e.sessionId}/cmd/${e.commandId}/kill`, { - method: `POST`, - body: JSON.stringify({ signal: e.signal }), - signal: e.abortSignal - })); - } - getLogs(e) { - let t = this, n = new AbortController(), r = e.signal ? fr(e.signal, n.signal) : n.signal, i = (async function* () { - let n = `/v2/sandboxes/sessions/${e.sessionId}/cmd/${e.cmdId}/logs`, i = await t.request(n, { - method: `GET`, - signal: r - }); - if (i.ok || await Q$1(ia$1(), i), i.headers.get(`content-type`) !== `application/x-ndjson`) throw new A$1(i, { - message: `Expected a stream of logs`, - sessionId: e.sessionId - }); - if (i.body === null) throw new A$1(i, { - message: `No response body`, - sessionId: e.sessionId - }); - let a = sr.parse(); - dr(i.body, a, { signal: r }).catch((e) => { - console.error(`Error piping logs:`, e); - }); - for await (let t of a) { - let n = vn.parse(t); - if (n.stream === `error`) throw new j$1(n.data.code, n.data.message, e.sessionId); - yield n; - } - })(); - return Object.assign(i, { - [Symbol.dispose]() { - n.abort(`Disposed`); - }, - close: () => n.abort(`Disposed`) - }); - } - async stopSession(e) { - let t = `/v2/sandboxes/sessions/${e.sessionId}/stop`; - return Q$1(Tn, await this.request(t, { - method: `POST`, - signal: e.signal - })); - } - async updateNetworkPolicy(e) { - let t = `/v2/sandboxes/sessions/${e.sessionId}/network-policy`; - return Q$1(un, await this.request(t, { - method: `POST`, - body: JSON.stringify(Kn(e.networkPolicy)), - signal: e.signal - })); - } - async extendTimeout(e) { - let t = `/v2/sandboxes/sessions/${e.sessionId}/extend-timeout`; - return Q$1(un, await this.request(t, { - method: `POST`, - body: JSON.stringify({ duration: e.duration }), - signal: e.signal - })); - } - async createSnapshot(e) { - let t = `/v2/sandboxes/sessions/${e.sessionId}/snapshot`, n = e.expiration === void 0 ? void 0 : JSON.stringify({ expiration: e.expiration }); - return Q$1(Sn, await this.request(t, { - method: `POST`, - body: n, - signal: e.signal - })); - } - async deleteSnapshot(e) { - let t = `/v2/sandboxes/snapshots/${e.snapshotId}`; - return Q$1(Cn, await this.request(t, { - method: `DELETE`, - signal: e.signal - })); - } - async getSnapshot(e) { - let t = `/v2/sandboxes/snapshots/${e.snapshotId}`; - return Q$1(Cn, await this.request(t, { signal: e.signal })); - } - async getSandbox(e) { - let t = Jn(e), n = { - projectId: e.projectId, - ...t - }; - return e.resume !== void 0 && (n.resume = String(e.resume)), Q$1(En, await this.request(`/v2/sandboxes/${encodeURIComponent(e.name)}`, { - query: n, - signal: e.signal - })); - } - async listSandboxes(e) { - return Q$1(Dn, await this.request(`/v2/sandboxes`, { - query: { - project: e.projectId, - limit: e.limit, - sortBy: e.sortBy, - sortOrder: e.sortOrder, - namePrefix: e.namePrefix, - cursor: e.cursor, - tags: pr$1(e.tags) - }, - method: `GET`, - signal: e.signal - })); - } - async updateSandbox(e) { - return Q$1(On, await this.request(`/v2/sandboxes/${encodeURIComponent(e.name)}`, { - method: `PATCH`, - query: { projectId: e.projectId }, - body: JSON.stringify({ - persistent: e.persistent, - resources: e.resources, - runtime: e.runtime, - timeout: e.timeout, - networkPolicy: e.networkPolicy ? Kn(e.networkPolicy) : void 0, - tags: e.tags, - ports: e.ports, - snapshotExpiration: e.snapshotExpiration, - keepLastSnapshots: e.keepLastSnapshots, - currentSnapshotId: e.currentSnapshotId - }), - signal: e.signal - })); - } - async deleteSandbox(e) { - return Q$1(On, await this.request(`/v2/sandboxes/${encodeURIComponent(e.name)}`, { - method: `DELETE`, - query: { projectId: e.projectId }, - signal: e.signal - })); - } -}; -async function dr(e, t, n) { - let r = e.getReader(), i = !1, a = n?.signal, o = () => { - i = !0; - let e = a?.reason ?? new DOMException(`The operation was aborted.`, `AbortError`); - if (r.cancel(e).catch(() => {}), `destroy` in t && typeof t.destroy == `function`) { - t.destroy(e); - return; - } - t.emit(`error`, e), t.end(); - }; - a && (a.aborted ? o() : a.addEventListener(`abort`, o, { once: !0 })); - try { - for (;;) { - let e = await r.read(); - if (e.value && t.write(Buffer.from(e.value)), e.done) break; - } - } catch (e) { - i || t.emit(`error`, e); - } finally { - a?.removeEventListener(`abort`, o), i || t.end(); - } -} -function fr(...e) { - let t = new AbortController(), n = () => { - t.abort(); - for (let t of e) t.removeEventListener(`abort`, n); - }; - for (let r of e) { - if (r.aborted) { - t.abort(); - break; - } - r.addEventListener(`abort`, n); - } - return t.signal; -} -function pr$1(e) { - if (e === void 0) return; - let t = Object.entries(e); - if (t.length !== 0) return t.map(([e, t]) => `${e}:${t}`); -} -function mr(e) { - return JSON.parse(Buffer.from(e.replace(/-/g, `+`).replace(/_/g, `/`), `base64`).toString(`utf8`)); -} -var hr = d$3(c$3(((e, t) => { - let n = process || {}, r = n.argv || [], i = n.env || {}, a = !(i.NO_COLOR || r.includes(`--no-color`)) && (!!i.FORCE_COLOR || r.includes(`--color`) || n.platform === `win32` || (n.stdout || {}).isTTY && i.TERM !== `dumb` || !!i.CI), o = (e, t, n = e) => (r) => { - let i = `` + r, a = i.indexOf(t, e.length); - return ~a ? e + s(i, t, n, a) + t : e + i + t; - }, s = (e, t, n, r) => { - let i = ``, a = 0; - do - i += e.substring(a, r) + n, a = r + t.length, r = e.indexOf(t, a); - while (~r); - return i + e.substring(a); - }, c = (e = a) => { - let t = e ? o : () => String; - return { - isColorSupported: e, - reset: t(`\x1B[0m`, `\x1B[0m`), - bold: t(`\x1B[1m`, `\x1B[22m`, `\x1B[22m\x1B[1m`), - dim: t(`\x1B[2m`, `\x1B[22m`, `\x1B[22m\x1B[2m`), - italic: t(`\x1B[3m`, `\x1B[23m`), - underline: t(`\x1B[4m`, `\x1B[24m`), - inverse: t(`\x1B[7m`, `\x1B[27m`), - hidden: t(`\x1B[8m`, `\x1B[28m`), - strikethrough: t(`\x1B[9m`, `\x1B[29m`), - black: t(`\x1B[30m`, `\x1B[39m`), - red: t(`\x1B[31m`, `\x1B[39m`), - green: t(`\x1B[32m`, `\x1B[39m`), - yellow: t(`\x1B[33m`, `\x1B[39m`), - blue: t(`\x1B[34m`, `\x1B[39m`), - magenta: t(`\x1B[35m`, `\x1B[39m`), - cyan: t(`\x1B[36m`, `\x1B[39m`), - white: t(`\x1B[37m`, `\x1B[39m`), - gray: t(`\x1B[90m`, `\x1B[39m`), - bgBlack: t(`\x1B[40m`, `\x1B[49m`), - bgRed: t(`\x1B[41m`, `\x1B[49m`), - bgGreen: t(`\x1B[42m`, `\x1B[49m`), - bgYellow: t(`\x1B[43m`, `\x1B[49m`), - bgBlue: t(`\x1B[44m`, `\x1B[49m`), - bgMagenta: t(`\x1B[45m`, `\x1B[49m`), - bgCyan: t(`\x1B[46m`, `\x1B[49m`), - bgWhite: t(`\x1B[47m`, `\x1B[49m`), - blackBright: t(`\x1B[90m`, `\x1B[39m`), - redBright: t(`\x1B[91m`, `\x1B[39m`), - greenBright: t(`\x1B[92m`, `\x1B[39m`), - yellowBright: t(`\x1B[93m`, `\x1B[39m`), - blueBright: t(`\x1B[94m`, `\x1B[39m`), - magentaBright: t(`\x1B[95m`, `\x1B[39m`), - cyanBright: t(`\x1B[96m`, `\x1B[39m`), - whiteBright: t(`\x1B[97m`, `\x1B[39m`), - bgBlackBright: t(`\x1B[100m`, `\x1B[49m`), - bgRedBright: t(`\x1B[101m`, `\x1B[49m`), - bgGreenBright: t(`\x1B[102m`, `\x1B[49m`), - bgYellowBright: t(`\x1B[103m`, `\x1B[49m`), - bgBlueBright: t(`\x1B[104m`, `\x1B[49m`), - bgMagentaBright: t(`\x1B[105m`, `\x1B[49m`), - bgCyanBright: t(`\x1B[106m`, `\x1B[49m`), - bgWhiteBright: t(`\x1B[107m`, `\x1B[49m`) - }; - }; - t.exports = c(), t.exports.createColors = c; -}))(), 1); -const gr = { - warn: hr.default.yellow, - error: hr.default.red, - success: hr.default.green, - info: hr.default.blue -}; -const _r = hr.default.dim(`[vercel/sandbox]`); -function vr(e, t) { - t = Array.isArray(t) ? t.join(` -`) : t; - let n = t.replace(/^/gm, `${_r} `); - console.error(gr[e](n)); -} -function yr(e) { - return hr.default.italic(hr.default.dim("`") + e + hr.default.dim("`")); -} -var br = d$3(t$2(), 1); -async function xr() { - return await Promise.resolve().then(() => auth_DF_ft5ea_exports); -} -function Sr() { - return process.env.NODE_ENV !== `production` && ![`1`, `true`].includes(process.env.CI || ``) && process.stdout.isTTY && process.stdin.isTTY; -} -const Cr = (() => { - let e = null; - return async (t) => { - (!e || e[0].teamId !== t.teamId || e[0].projectId !== t.projectId) && (e = [t, wr(t).catch((t) => { - throw e = null, t; - })]); - let n = await e[1]; - return vr(`warn`, `using inferred credentials team=${n.teamId} project=${n.projectId}`), n; - }; -})(); -async function wr(e) { - let { OAuth: t, pollForToken: n, getAuth: r, updateAuthConfig: i, inferScope: a } = await xr(), o = r(); - if (!o?.token) { - let e = process.env.VERCEL_URL ? `1 minute` : `5 minutes`; - o = await Tr({ - OAuth: t, - pollForToken: n, - getAuth: r - }, e); - } - if (o?.refreshToken && o.expiresAt && o.expiresAt.getTime() <= Date.now()) { - let e = await (await t()).refreshToken(o.refreshToken); - o = { - expiresAt: new Date(Date.now() + e.expires_in * 1e3), - token: e.access_token, - refreshToken: e.refresh_token || o.refreshToken - }, i(o); - } - if (!o?.token) throw Error([ - `Failed to retrieve authentication token.`, - `${hr.default.bold(`hint:`)} Set VERCEL_OIDC_TOKEN or provide a Vercel API token.`, - `├▶ Sandbox docs: https://vercel.com/docs/vercel-sandbox`, - `╰▶ Access tokens: https://vercel.com/kb/guide/how-do-i-use-a-vercel-api-access-token` - ].join(` -`)); - if (e.teamId && e.projectId) return { - token: o.token, - teamId: e.teamId, - projectId: e.projectId - }; - let s = await a({ - teamId: e.teamId, - token: o.token - }); - return s.created && vr(`info`, `Created default project "${s.projectId}" in team "${s.teamId}".`), { - token: o.token, - teamId: e.teamId || s.teamId, - projectId: e.projectId || s.projectId - }; -} -async function Tr(e, t) { - vr(`warn`, [ - `No VERCEL_OIDC_TOKEN environment variable found, initiating device authorization flow...`, - `│ ${hr.default.bold(`help:`)} this flow only happens on development environment.`, - `│ In production, make sure to set up a proper token, or set up Vercel OIDC [https://vercel.com/docs/oidc].` - ]); - let n = await e.OAuth(), r = await n.deviceAuthorizationRequest(); - vr(`info`, [ - `╰▶ To authenticate, visit: ${r.verification_uri_complete}`, - ` or visit ${hr.default.italic(r.verification_uri)} and type ${hr.default.bold(r.user_code)}`, - ` Press ${hr.default.bold(``)} to open in your browser` - ]); - let i, a = e.pollForToken({ - request: r, - oauth: n - }), o = !1, s = setTimeout(() => { - if (o) return; - let e = [ - `Authentication flow timed out after ${t}.`, - `│ Make sure to provide a token to avoid prompting an interactive flow.`, - `╰▶ ${hr.default.bold(`help:`)} Link your project with ${yr(`npx vercel link`)} to refresh OIDC token automatically.` - ].join(` -`); - i = Error(e), a.return(); - }, (0, br.default)(t)); - try { - for await (let e of a) switch (e._tag) { - case `SlowDown`: - case `Timeout`: - case `Response`: break; - case `Error`: - i = e.error; - break; - default: throw Error(`Unknown event type: ${JSON.stringify(e)}`); - } - } finally { - o = !0, clearTimeout(s); - } - if (i) throw vr(`error`, `${hr.default.bold(`error:`)} Authentication failed: ${i.message}`), i; - return vr(`success`, `${hr.default.bold(`done!`)} Authenticated successfully!`), e.getAuth(); -} -var Er = class extends Error { - constructor(e) { - let t = [ - `Could not get credentials from OIDC context.`, - "Please link your Vercel project using `npx vercel link`.", - "Then, pull an initial OIDC token with `npx vercel env pull`", - `and retry.`, - "╰▶ Make sure you are loading `.env.local` correctly, or passing $VERCEL_OIDC_TOKEN directly." - ].join(` -`); - super(t, { cause: e }), this.name = `LocalOidcContextError`; - } -}; -var Dr = class extends Error { - constructor(e) { - let t = [ - `Could not get credentials from OIDC context.`, - `Please make sure OIDC is set up for your project`, - `╰▶ Docs: https://vercel.com/docs/oidc` - ].join(` -`); - super(t, { cause: e }), this.name = `VercelOidcContextError`; - } -}; -async function Or(e) { - try { - return Mr(await (0, cr.getVercelOidcToken)({ - team: e.teamId, - project: e.projectId - })); - } catch (t) { - if (!Sr()) throw process.env.VERCEL_URL ? new Dr(t) : new Er(t); - return await Cr(e); - } -} -async function kr(e) { - return Ar(e ?? {}) || await Or({ - teamId: e && typeof e == `object` && `teamId` in e && typeof e.teamId == `string` ? e.teamId : void 0, - projectId: e && typeof e == `object` && `projectId` in e && typeof e.projectId == `string` ? e.projectId : void 0 - }); -} -function Ar(e) { - if (!e || typeof e != `object`) return null; - let t = [ - `token` in e && typeof e.token == `string` ? null : `token`, - `teamId` in e && typeof e.teamId == `string` ? null : `teamId`, - `projectId` in e && typeof e.projectId == `string` ? null : `projectId` - ].filter((e) => e !== null); - if (t.length === 0) return { - token: e.token, - projectId: e.projectId, - teamId: e.teamId - }; - if (t.length < 3) throw Error(`Missing credentials parameters to access the Vercel API: ${t.filter((e) => e !== null).join(`, `)}`); - return null; -} -const jr = da$1({ - exp: Qi$1().optional().describe(`Expiry timestamp (seconds since epoch)`), - iat: Qi$1().optional().describe(`Issued at timestamp`), - owner_id: Mi$1(), - project_id: Mi$1() -}); -function Mr(e) { - try { - let t = jr.parse(mr(e.split(`.`)[1])); - return { - token: e, - projectId: t.project_id, - teamId: t.owner_id - }; - } catch (e) { - throw Error(`Invalid Vercel OIDC token: ${e instanceof Error ? e.message : String(e)}`); - } -} -const Nr = { - SIGHUP: 1, - SIGINT: 2, - SIGQUIT: 3, - SIGKILL: 9, - SIGTERM: 15, - SIGCONT: 18, - SIGSTOP: 19 -}; -function Pr(e) { - if (typeof e == `number`) return e; - if (e in Nr) return Nr[e]; - throw Error(`Unknown signal name: ${String(e)}`); -} -var Fr = class e { - async ensureClient() { - "use step"; - if (this._client) return this._client; - let e = await kr(); - return this._client = new ur({ - teamId: e.teamId, - token: e.token - }), this._client; - } - get cmdId() { - return this.cmd.id; - } - get cwd() { - return this.cmd.cwd; - } - get startedAt() { - return this.cmd.startedAt; - } - constructor({ client: e, sessionId: t, cmd: n, output: r }) { - this._client = null, this.outputCache = null, this._resolvedOutput = null, this._client = e ?? null, this.sessionId = t, this.cmd = n, this.exitCode = n.exitCode ?? null, r && (this._resolvedOutput = r, this.outputCache = Promise.resolve({ - stdout: r.stdout, - stderr: r.stderr, - both: r.stdout + r.stderr - })); - } - static [m$2](e) { - let t = { - sandboxId: e.sessionId, - cmd: e.cmd - }; - return e._resolvedOutput && (t.output = e._resolvedOutput), t; - } - static [h$2](t) { - return new e({ - sessionId: t.sandboxId, - cmd: t.cmd, - output: t.output - }); - } - logs(e) { - if (!this._client) throw Error(`logs() requires an API client. Call an async method first to initialize the client.`); - return this._client.getLogs({ - sessionId: this.sessionId, - cmdId: this.cmd.id, - signal: e?.signal - }); - } - async wait(e) { - "use step"; - let t = await this.ensureClient(); - e?.signal?.throwIfAborted(); - let n = await t.getCommand({ - sessionId: this.sessionId, - cmdId: this.cmd.id, - wait: !0, - signal: e?.signal - }); - return new Ir({ - client: t, - sessionId: this.sessionId, - cmd: n.json.command, - exitCode: n.json.command.exitCode - }); - } - async getCachedOutput(e) { - return this.outputCache ||= (async () => { - try { - e?.signal?.throwIfAborted(), await this.ensureClient(); - let t = ``, n = ``, r = ``; - for await (let i of this.logs({ signal: e?.signal })) r += i.data, i.stream === `stdout` ? t += i.data : n += i.data; - return this._resolvedOutput = { - stdout: t, - stderr: n - }, { - stdout: t, - stderr: n, - both: r - }; - } catch (e) { - throw this.outputCache = null, e; - } - })(), this.outputCache; - } - async output(e = `both`, t) { - "use step"; - return (await this.getCachedOutput(t))[e]; - } - async stdout(e) { - "use step"; - return this.output(`stdout`, e); - } - async stderr(e) { - "use step"; - return this.output(`stderr`, e); - } - async kill(e, t) { - "use step"; - await (await this.ensureClient()).killCommand({ - sessionId: this.sessionId, - commandId: this.cmd.id, - signal: Pr(e ?? `SIGTERM`), - abortSignal: t?.abortSignal - }); - } -}; -var Ir = class e extends Fr { - constructor(e) { - super({ ...e }), this.exitCode = e.exitCode; - } - static [m$2](e) { - return { - ...Fr[m$2](e), - exitCode: e.exitCode - }; - } - static [h$2](t) { - return new e({ - sessionId: t.sandboxId, - cmd: t.cmd, - exitCode: t.exitCode, - output: t.output - }); - } - async wait() { - return this; - } -}; -function Lr(e, t) { - let { itemsKey: n, fetchNext: r, signal: i } = t; - async function* a() { - Rr(i); - let t = e; - for (yield t; t.pagination.next !== null;) Rr(i), t = await r(t.pagination.next), yield t; - } - async function* o() { - for await (let e of a()) { - let t = e[n]; - for (let e of t) Rr(i), yield e; - } - } - return { - ...e, - [Symbol.asyncIterator]: o, - pages: a, - toArray: async () => { - let e = []; - for await (let t of o()) e.push(t); - return e; - } - }; -} -function Rr(e) { - if (e?.aborted) throw e.reason ?? new DOMException(`Aborted`, `AbortError`); -} -var zr = class e { - async ensureClient() { - "use step"; - if (this._client) return this._client; - let e = await kr(); - return this._client = new ur({ - teamId: e.teamId, - token: e.token - }), this._client; - } - get snapshotId() { - return this.snapshot.id; - } - get sourceSessionId() { - return this.snapshot.sourceSessionId; - } - get status() { - return this.snapshot.status; - } - get sizeBytes() { - return this.snapshot.sizeBytes; - } - get createdAt() { - return new Date(this.snapshot.createdAt); - } - get updatedAt() { - return new Date(this.snapshot.updatedAt); - } - get expiresAt() { - if (this.snapshot.expiresAt !== void 0) return new Date(this.snapshot.expiresAt); - } - static [m$2](e) { - return { snapshot: e.snapshot }; - } - static [h$2](t) { - return new e({ snapshot: t.snapshot }); - } - constructor({ client: e, snapshot: t }) { - this._client = null, this._client = e ?? null, this.snapshot = t; - } - static async list(e) { - "use step"; - let t = await kr(e), n = new ur({ - teamId: t.teamId, - token: t.token, - fetch: e?.fetch - }), r = async (r) => (await n.listSnapshots({ - ...t, - ...e, - ...r !== void 0 && { cursor: r } - })).json; - return Lr(await r(e?.cursor), { - itemsKey: `snapshots`, - fetchNext: r, - signal: e?.signal - }); - } - static async tree(e) { - "use step"; - let t = await kr(e), n = new ur({ - teamId: t.teamId, - token: t.token, - fetch: e.fetch - }), r = async (r) => (await n.getSnapshotTree({ - ...t, - ...e, - snapshotId: r - })).json; - return Lr(await r(e.snapshotId), { - itemsKey: `snapshots`, - fetchNext: r, - signal: e.signal - }); - } - static async get(t) { - "use step"; - let n = await kr(t), r = new ur({ - teamId: n.teamId, - token: n.token - }); - return new e({ - client: r, - snapshot: (await r.getSnapshot({ - snapshotId: t.snapshotId, - signal: t.signal - })).json.snapshot - }); - } - async delete(e) { - "use step"; - this.snapshot = (await (await this.ensureClient()).deleteSnapshot({ - snapshotId: this.snapshot.id, - signal: e?.signal - })).json.snapshot; - } -}; -function Br(e) { - let { networkPolicy: t, ...n } = e; - return { - ...n, - networkPolicy: t ? qn(t) : void 0 - }; -} -var Vr = class e { - async ensureClient() { - "use step"; - if (this._client) return this._client; - let e = await kr(); - return this._client = new ur({ - teamId: e.teamId, - token: e.token - }), this._client; - } - get client() { - if (!this._client) throw Error(`API client not initialized`); - return this._client; - } - get _sessionSnapshot() { - return this.session; - } - get sessionId() { - return this.session.id; - } - get interactivePort() { - return this.session.interactivePort ?? void 0; - } - get status() { - return this.session.status; - } - get createdAt() { - return new Date(this.session.createdAt); - } - get timeout() { - return this.session.timeout; - } - get networkPolicy() { - return this.session.networkPolicy; - } - get sourceSnapshotId() { - return this.session.sourceSnapshotId; - } - get memory() { - return this.session.memory; - } - get vcpus() { - return this.session.vcpus; - } - get region() { - return this.session.region; - } - get runtime() { - return this.session.runtime; - } - get cwd() { - return this.session.cwd; - } - get requestedAt() { - return new Date(this.session.requestedAt); - } - get startedAt() { - return this.session.startedAt == null ? void 0 : new Date(this.session.startedAt); - } - get requestedStopAt() { - return this.session.requestedStopAt == null ? void 0 : new Date(this.session.requestedStopAt); - } - get stoppedAt() { - return this.session.stoppedAt == null ? void 0 : new Date(this.session.stoppedAt); - } - get abortedAt() { - return this.session.abortedAt == null ? void 0 : new Date(this.session.abortedAt); - } - get duration() { - return this.session.duration; - } - get snapshottedAt() { - return this.session.snapshottedAt == null ? void 0 : new Date(this.session.snapshottedAt); - } - get updatedAt() { - return new Date(this.session.updatedAt); - } - get activeCpuUsageMs() { - return this.session.activeCpuDurationMs; - } - get networkTransfer() { - return this.session.networkTransfer; - } - static [m$2](e) { - return { - session: e.session, - routes: e.routes - }; - } - static [h$2](t) { - return new e({ - routes: t.routes, - snapshot: t.session - }); - } - constructor(e) { - this._client = null, this.routes = e.routes, `snapshot` in e ? this.session = e.snapshot : (this._client = e.client, this.session = Br(e.session)); - } - updateRoutes(e) { - this.routes = e; - } - async getCommand(e, t) { - "use step"; - let n = await this.ensureClient(), r = await n.getCommand({ - sessionId: this.session.id, - cmdId: e, - signal: t?.signal - }); - return new Fr({ - client: n, - sessionId: this.session.id, - cmd: r.json.command - }); - } - async runCommand(e, t, n) { - "use step"; - let r = await this.ensureClient(), i = typeof e == `string` ? { - cmd: e, - args: t, - signal: n?.signal, - timeoutMs: n?.timeoutMs - } : e, a = !i.detached, o = async (e) => { - if (!(!i.stdout && !i.stderr)) try { - for await (let t of e.logs({ signal: i.signal })) t.stream === `stdout` ? i.stdout?.write(t.data) : t.stream === `stderr` && i.stderr?.write(t.data); - } catch (e) { - if (i.signal?.aborted) return; - throw e; - } - }; - if (a) { - let e = await r.runCommand({ - sessionId: this.session.id, - command: i.cmd, - args: i.args ?? [], - cwd: i.cwd, - env: i.env ?? {}, - sudo: i.sudo ?? !1, - wait: !0, - timeout: i.timeoutMs, - signal: i.signal - }), t = new Fr({ - client: r, - sessionId: this.session.id, - cmd: e.command - }), [n] = await Promise.all([e.finished, o(t)]); - return new Ir({ - client: r, - sessionId: this.session.id, - cmd: n, - exitCode: n.exitCode ?? 0 - }); - } - let s = await r.runCommand({ - sessionId: this.session.id, - command: i.cmd, - args: i.args ?? [], - cwd: i.cwd, - env: i.env ?? {}, - sudo: i.sudo ?? !1, - timeout: i.timeoutMs, - signal: i.signal - }), c = new Fr({ - client: r, - sessionId: this.session.id, - cmd: s.json.command - }); - return o(c).catch((e) => { - i.signal?.aborted || (i.stderr ?? i.stdout)?.emit(`error`, e); - }), c; - } - async mkDir(e, t) { - "use step"; - await (await this.ensureClient()).mkDir({ - sessionId: this.session.id, - path: e, - signal: t?.signal - }); - } - async openInteractive(e) { - "use step"; - let { json: t } = await (await this.ensureClient()).openInteractive({ - sessionId: this.session.id, - signal: e?.signal - }); - return { - url: t.url, - token: t.token - }; - } - async readFile(e, t) { - "use step"; - return (await this.ensureClient()).readFile({ - sessionId: this.session.id, - path: e.path, - cwd: e.cwd, - signal: t?.signal - }); - } - async readFileToBuffer(e, t) { - "use step"; - let n = await (await this.ensureClient()).readFile({ - sessionId: this.session.id, - path: e.path, - cwd: e.cwd, - signal: t?.signal - }); - return n === null ? null : Wn(n); - } - async downloadFile(e, t, n) { - "use step"; - let r = await this.ensureClient(); - if (!e?.path) throw Error(`downloadFile: source path is required`); - if (!t?.path) throw Error(`downloadFile: destination path is required`); - let i = await r.readFile({ - sessionId: this.session.id, - path: e.path, - cwd: e.cwd, - signal: n?.signal - }); - if (i === null) return null; - try { - let e = resolve$1(t.cwd ?? ``, t.path); - return n?.mkdirRecursive && await mkdir$1(dirname$1(e), { recursive: !0 }), await pipeline(i, createWriteStream(e), { signal: n?.signal }), e; - } finally { - i.destroy(); - } - } - async writeFiles(e, t) { - "use step"; - return (await this.ensureClient()).writeFiles({ - sessionId: this.session.id, - cwd: this.session.cwd, - extractDir: `/`, - files: e, - signal: t?.signal - }); - } - domain(e) { - let t = this.routes.find(({ port: t }) => t == e); - if (t) return `https://${t.subdomain}.vercel.run`; - throw Error(`No route for port ${e}`); - } - async stop(e) { - "use step"; - let t = await (await this.ensureClient()).stopSession({ - sessionId: this.session.id, - signal: e?.signal - }); - return this.session = Br(t.json.session), { - session: this.session, - sandbox: t.json.sandbox, - snapshot: t.json.snapshot - }; - } - async update(e, t) { - "use step"; - e.networkPolicy !== void 0 && (this.session = Br((await (await this.ensureClient()).updateNetworkPolicy({ - sessionId: this.session.id, - networkPolicy: e.networkPolicy, - signal: t?.signal - })).json.session)); - } - async extendTimeout(e, t) { - "use step"; - this.session = Br((await (await this.ensureClient()).extendTimeout({ - sessionId: this.session.id, - duration: e, - signal: t?.signal - })).json.session); - } - async snapshot(e) { - "use step"; - let t = await this.ensureClient(), n = await t.createSnapshot({ - sessionId: this.session.id, - expiration: e?.expiration, - signal: e?.signal - }); - return this.session = Br(n.json.session), new zr({ - client: t, - snapshot: n.json.snapshot - }); - } -}; -const { S_IFMT: Hr, S_IFREG: Ur, S_IFDIR: Wr, S_IFLNK: Gr, S_IFBLK: Kr, S_IFCHR: qr, S_IFIFO: Jr, S_IFSOCK: Yr } = k$1; -function $$1(e, t, n, r) { - let i = Error(`${e}: ${t}, ${n} '${r}'`); - return i.code = e, i.syscall = n, i.path = r, i; -} -function Xr(e) { - return e == null ? { encoding: null } : typeof e == `string` ? { encoding: e } : { - encoding: e.encoding ?? null, - signal: e.signal - }; -} -var Zr = class { - constructor(e, t, n, r, i, a, o, s, c, l, u, d, f, p) { - this.dev = e, this._mode = t, this.nlink = n, this.uid = r, this.gid = i, this.rdev = a, this.blksize = o, this.ino = s, this.size = c, this.blocks = l, this.atimeMs = u, this.mtimeMs = d, this.ctimeMs = f, this.birthtimeMs = p, this.atime = new Date(u), this.mtime = new Date(d), this.ctime = new Date(f), this.birthtime = new Date(p); - } - get mode() { - return this._mode; - } - isFile() { - return (this.mode & Hr) === Ur; - } - isDirectory() { - return (this.mode & Hr) === Wr; - } - isBlockDevice() { - return (this.mode & Hr) === Kr; - } - isCharacterDevice() { - return (this.mode & Hr) === qr; - } - isSymbolicLink() { - return (this.mode & Hr) === Gr; - } - isFIFO() { - return (this.mode & Hr) === Jr; - } - isSocket() { - return (this.mode & Hr) === Yr; - } -}; -var Qr = class { - constructor(e, t, n) { - this.name = e, this.type = t, this.parentPath = n, this.path = `${this.parentPath}/${this.name}`; - } - isFile() { - return this.type === 1; - } - isDirectory() { - return this.type === 2; - } - isBlockDevice() { - return this.type === 7; - } - isCharacterDevice() { - return this.type === 6; - } - isSymbolicLink() { - return this.type === 3; - } - isFIFO() { - return this.type === 4; - } - isSocket() { - return this.type === 5; - } -}; -function $r(e) { - let t = e.trim().split(`|`); - return new Zr(parseInt(t[10], 10), parseInt(t[1], 16), parseInt(t[8], 10), parseInt(t[2], 10), parseInt(t[3], 10), 0, parseInt(t[11], 10), parseInt(t[9], 10), parseInt(t[0], 10), parseInt(t[12], 10), parseFloat(t[4]) * 1e3, parseFloat(t[5]) * 1e3, parseFloat(t[6]) * 1e3, parseFloat(t[7]) * 1e3); -} -function ei(e, t) { - let n = e.trim().split(`|`), r = n[0], i = n[1]; - if (!r) throw $$1(`ENOENT`, `no such file or directory`, `readdir`, t); - if (!i) throw Error(`Invalid dirent type: ${i}`); - return new Qr(r, ni[i] ?? 1, t); -} -const ti = `%s|%f|%u|%g|%X|%Y|%Z|%W|%h|%i|%d|%B|%b`; -const ni = { - f: 1, - d: 2, - l: 3, - b: 7, - c: 6, - p: 4, - s: 5 -}; -var ri = class { - constructor(e) { - this.sandbox = e; - } - async readFile(e, t) { - "use step"; - let { encoding: n, signal: r } = Xr(t), i = await this.sandbox.readFileToBuffer({ path: e }, { signal: r }); - if (i === null) throw $$1(`ENOENT`, `no such file or directory`, `open`, e); - return n ? i.toString(n) : i; - } - async writeFile(e, t, n) { - "use step"; - let { encoding: r, signal: i } = typeof n == `string` ? { - encoding: n, - signal: void 0 - } : { - encoding: n?.encoding, - signal: n?.signal - }, a; - a = typeof t == `string` ? Buffer.from(t, r ?? `utf8`) : Buffer.isBuffer(t) ? t : Buffer.from(t), await this.sandbox.writeFiles([{ - path: e, - content: a - }], { signal: i }); - } - async appendFile(e, t, n) { - "use step"; - let { encoding: r, signal: i } = typeof n == `string` ? { - encoding: n, - signal: void 0 - } : { - encoding: n?.encoding, - signal: n?.signal - }, a; - a = typeof t == `string` ? Buffer.from(t, r ?? `utf8`) : Buffer.isBuffer(t) ? t : Buffer.from(t); - let o = await this.sandbox.readFileToBuffer({ path: e }, { signal: i }), s = o === null ? a : Buffer.concat([o, a]); - await this.sandbox.writeFiles([{ - path: e, - content: s - }], { signal: i }); - } - async mkdir(e, t) { - "use step"; - let n = typeof t == `number` ? { recursive: !1 } : t ?? {}; - if (n.recursive) { - let t = await this.sandbox.runCommand(`mkdir`, [`-p`, e], { signal: n.signal }); - if (t.exitCode !== 0) throw $$1(`EACCES`, (await t.stderr()).trim() || `permission denied`, `mkdir`, e); - return; - } - await this.sandbox.mkDir(e, { signal: n.signal }); - } - async readdir(e, t) { - "use step"; - if (t?.withFileTypes) { - let n = await this.sandbox.runCommand(`find`, [ - e, - `-maxdepth`, - `1`, - `-mindepth`, - `1`, - `-printf`, - `%f|%y\\n` - ], { signal: t?.signal }); - if (n.exitCode !== 0) { - let t = await n.stderr(); - throw t.includes(`No such file or directory`) ? $$1(`ENOENT`, `no such file or directory`, `scandir`, e) : $$1(`EACCES`, t.trim(), `scandir`, e); - } - return (await n.stdout()).trim().split(` -`).filter(Boolean).map((t) => ei(t, e)); - } - let n = await this.sandbox.runCommand(`ls`, [`-1`, e], { signal: t?.signal }); - if (n.exitCode !== 0) { - let t = await n.stderr(); - throw t.includes(`No such file or directory`) ? $$1(`ENOENT`, `no such file or directory`, `scandir`, e) : $$1(`EACCES`, t.trim(), `scandir`, e); - } - return (await n.stdout()).trim().split(` -`).filter(Boolean); - } - async stat(e, t) { - "use step"; - let n = await this.sandbox.runCommand(`stat`, [ - `-L`, - `-c`, - ti, - e - ], { signal: t?.signal }); - if (n.exitCode !== 0) { - let t = await n.stderr(); - throw t.includes(`No such file or directory`) ? $$1(`ENOENT`, `no such file or directory`, `stat`, e) : $$1(`EACCES`, t.trim(), `stat`, e); - } - return $r(await n.stdout()); - } - async lstat(e, t) { - "use step"; - let n = await this.sandbox.runCommand(`stat`, [ - `-c`, - ti, - e - ], { signal: t?.signal }); - if (n.exitCode !== 0) { - let t = await n.stderr(); - throw t.includes(`No such file or directory`) ? $$1(`ENOENT`, `no such file or directory`, `lstat`, e) : $$1(`EACCES`, t.trim(), `lstat`, e); - } - return $r(await n.stdout()); - } - async unlink(e, t) { - "use step"; - let n = await this.sandbox.runCommand(`rm`, [e], { signal: t?.signal }); - if (n.exitCode !== 0) { - let t = await n.stderr(); - throw t.includes(`No such file or directory`) ? $$1(`ENOENT`, `no such file or directory`, `unlink`, e) : $$1(`EACCES`, t.trim(), `unlink`, e); - } - } - async rm(e, t) { - "use step"; - let n = []; - t?.recursive && n.push(`-r`), t?.force && n.push(`-f`), n.push(e); - let r = await this.sandbox.runCommand(`rm`, n, { signal: t?.signal }); - if (r.exitCode !== 0) { - let t = await r.stderr(); - throw t.includes(`No such file or directory`) ? $$1(`ENOENT`, `no such file or directory`, `rm`, e) : $$1(`EACCES`, t.trim(), `rm`, e); - } - } - async rmdir(e, t) { - "use step"; - let n = await this.sandbox.runCommand(`rmdir`, [e], { signal: t?.signal }); - if (n.exitCode !== 0) { - let t = await n.stderr(); - throw t.includes(`No such file or directory`) ? $$1(`ENOENT`, `no such file or directory`, `rmdir`, e) : t.includes(`not empty`) ? $$1(`ENOTEMPTY`, `directory not empty`, `rmdir`, e) : $$1(`EACCES`, t.trim(), `rmdir`, e); - } - } - async rename(e, t, n) { - "use step"; - let r = await this.sandbox.runCommand(`mv`, [e, t], { signal: n?.signal }); - if (r.exitCode !== 0) { - let t = await r.stderr(); - throw t.includes(`No such file or directory`) ? $$1(`ENOENT`, `no such file or directory`, `rename`, e) : $$1(`EACCES`, t.trim(), `rename`, e); - } - } - async copyFile(e, t, n) { - "use step"; - let r = await this.sandbox.runCommand(`cp`, [e, t], { signal: n?.signal }); - if (r.exitCode !== 0) { - let t = await r.stderr(); - throw t.includes(`No such file or directory`) ? $$1(`ENOENT`, `no such file or directory`, `copyfile`, e) : $$1(`EACCES`, t.trim(), `copyfile`, e); - } - } - async access(e, t) { - "use step"; - if ((await this.sandbox.runCommand(`test`, [`-e`, e], { signal: t?.signal })).exitCode !== 0) throw $$1(`ENOENT`, `no such file or directory`, `access`, e); - } - async exists(e, t) { - return (await this.sandbox.runCommand(`test`, [`-e`, e], { signal: t?.signal })).exitCode === 0; - } - async chmod(e, t, n) { - "use step"; - let r = typeof t == `number` ? t.toString(8) : t, i = await this.sandbox.runCommand(`chmod`, [r, e], { signal: n?.signal }); - if (i.exitCode !== 0) { - let t = await i.stderr(); - throw t.includes(`No such file or directory`) ? $$1(`ENOENT`, `no such file or directory`, `chmod`, e) : $$1(`EACCES`, t.trim(), `chmod`, e); - } - } - async chown(e, t, n, r) { - "use step"; - let i = await this.sandbox.runCommand(`chown`, [`${t}:${n}`, e], { signal: r?.signal }); - if (i.exitCode !== 0) { - let t = await i.stderr(); - throw t.includes(`No such file or directory`) ? $$1(`ENOENT`, `no such file or directory`, `chown`, e) : $$1(`EACCES`, t.trim(), `chown`, e); - } - } - async symlink(e, t, n) { - "use step"; - let r = await this.sandbox.runCommand(`ln`, [ - `-s`, - e, - t - ], { signal: n?.signal }); - if (r.exitCode !== 0) { - let e = await r.stderr(); - throw e.includes(`File exists`) ? $$1(`EEXIST`, `file already exists`, `symlink`, t) : $$1(`EACCES`, e.trim(), `symlink`, t); - } - } - async readlink(e, t) { - "use step"; - let n = await this.sandbox.runCommand(`readlink`, [e], { signal: t?.signal }); - if (n.exitCode !== 0) throw (await n.stderr()).includes(`No such file or directory`) ? $$1(`ENOENT`, `no such file or directory`, `readlink`, e) : $$1(`EINVAL`, `invalid argument`, `readlink`, e); - return (await n.stdout()).trim(); - } - async realpath(e, t) { - "use step"; - let n = await this.sandbox.runCommand(`realpath`, [e], { signal: t?.signal }); - if (n.exitCode !== 0) { - let t = await n.stderr(); - throw t.includes(`No such file or directory`) ? $$1(`ENOENT`, `no such file or directory`, `realpath`, e) : $$1(`EACCES`, t.trim(), `realpath`, e); - } - return (await n.stdout()).trim(); - } - async truncate(e, t, n) { - "use step"; - let r = await this.sandbox.runCommand(`truncate`, [ - `-s`, - String(t ?? 0), - e - ], { signal: n?.signal }); - if (r.exitCode !== 0) { - let t = await r.stderr(); - throw t.includes(`No such file or directory`) ? $$1(`ENOENT`, `no such file or directory`, `truncate`, e) : $$1(`EACCES`, t.trim(), `truncate`, e); - } - } - async mkdtemp(e, t) { - "use step"; - let n = await this.sandbox.runCommand(`mktemp`, [`-d`, `${e}XXXXXX`], { signal: t?.signal }); - if (n.exitCode !== 0) throw $$1(`EACCES`, (await n.stderr()).trim(), `mkdtemp`, e); - return (await n.stdout()).trim(); - } -}; -function ii(e) { - return e instanceof A$1 && e.response.status === 410; -} -function ai(e) { - return e instanceof A$1 && e.response.status === 404; -} -function oi(e) { - return e instanceof A$1 && e.response.status === 410 && e.json?.error?.code === `snapshot_not_found`; -} -function si(e) { - return e instanceof A$1 && e.response.status === 422 && e.json?.error?.code === `sandbox_stopping`; -} -function ci(e) { - return e instanceof A$1 && e.response.status === 422 && e.json?.error?.code === `sandbox_snapshotting`; -} -var li = class e { - async ensureClient() { - "use step"; - if (this._client) return this._client; - let e = await kr(); - return this._client = new ur({ - teamId: e.teamId, - token: e.token - }), this._client; - } - get name() { - return this.sandbox.name; - } - get routes() { - return this.currentSession().routes; - } - get persistent() { - return this.sandbox.persistent; - } - get region() { - return this.sandbox.region; - } - get vcpus() { - return this.sandbox.vcpus; - } - get memory() { - return this.sandbox.memory; - } - get runtime() { - return this.sandbox.runtime; - } - get totalEgressBytes() { - return this.sandbox.totalEgressBytes; - } - get totalIngressBytes() { - return this.sandbox.totalIngressBytes; - } - get totalActiveCpuDurationMs() { - return this.sandbox.totalActiveCpuDurationMs; - } - get totalDurationMs() { - return this.sandbox.totalDurationMs; - } - get updatedAt() { - return new Date(this.sandbox.updatedAt); - } - get statusUpdatedAt() { - return this.sandbox.statusUpdatedAt ? new Date(this.sandbox.statusUpdatedAt) : void 0; - } - get createdAt() { - return new Date(this.sandbox.createdAt); - } - get interactivePort() { - return this.currentSession().interactivePort; - } - get cwd() { - return this.currentSession().cwd; - } - get status() { - return this.currentSession().status; - } - get timeout() { - return this.sandbox.timeout; - } - get tags() { - return this.sandbox.tags; - } - get networkPolicy() { - return this.sandbox.networkPolicy ? qn(this.sandbox.networkPolicy) : void 0; - } - get sourceSnapshotId() { - return this.currentSession().sourceSnapshotId; - } - get currentSnapshotId() { - return this.sandbox.currentSnapshotId; - } - get snapshotExpiration() { - return this.sandbox.snapshotExpiration; - } - get keepLastSnapshots() { - return this.sandbox.keepLastSnapshots; - } - get activeCpuUsageMs() { - return this.currentSession().activeCpuUsageMs; - } - get networkTransfer() { - return this.currentSession().networkTransfer; - } - static async list(e) { - "use step"; - let t = await kr(e), n = new ur({ - teamId: t.teamId, - token: t.token, - fetch: e?.fetch - }), r = async (r) => (await n.listSandboxes({ - ...t, - ...e, - ...r !== void 0 && { cursor: r } - })).json; - return Lr(await r(e?.cursor), { - itemsKey: `sandboxes`, - fetchNext: r, - signal: e?.signal - }); - } - static [m$2](e) { - return { - metadata: e.session?._sessionSnapshot, - routes: e.session?.routes ?? [], - sandboxMetadata: e.sandbox, - projectId: e.projectId - }; - } - static [h$2](t) { - let n = new e({ - sandbox: t.sandboxMetadata, - routes: t.routes, - projectId: t.projectId - }); - return t.metadata && (n.session = new Vr({ - routes: t.routes, - snapshot: t.metadata - })), n; - } - static async create(e) { - "use step"; - let t = await kr(e), n = new ur({ - teamId: t.teamId, - token: t.token, - fetch: e?.fetch - }), r = Jn(e), i = await n.createSandbox({ - source: e?.source, - projectId: t.projectId, - ports: e?.ports ?? [], - timeout: e?.timeout, - resources: e?.resources, - runtime: e && `runtime` in e ? e?.runtime : void 0, - networkPolicy: e?.networkPolicy, - env: e?.env, - tags: e?.tags, - snapshotExpiration: e?.snapshotExpiration, - keepLastSnapshots: e?.keepLastSnapshots, - signal: e?.signal, - name: e?.name, - persistent: e?.persistent, - ...r - }); - return new ui({ - client: n, - session: i.json.session, - sandbox: i.json.sandbox, - routes: i.json.routes, - projectId: t.projectId, - onResume: e?.onResume - }); - } - static async fork(t) { - "use step"; - let { sourceSandbox: n, ...r } = t, i = t, a = await e.get({ - token: i.token, - projectId: i.projectId, - teamId: i.teamId, - fetch: t.fetch, - signal: t.signal, - ...Jn(t), - name: n, - resume: !1 - }), o = a.routes.filter((e) => e.port !== a.interactivePort).map((e) => e.port), s = { - ...a.vcpus !== void 0 && { resources: { vcpus: a.vcpus } }, - ...a.timeout !== void 0 && { timeout: a.timeout }, - ...a.networkPolicy !== void 0 && { networkPolicy: a.networkPolicy }, - ...a.tags !== void 0 && { tags: a.tags }, - ...o.length > 0 && { ports: o }, - persistent: a.persistent, - ...a.snapshotExpiration !== void 0 && { snapshotExpiration: a.snapshotExpiration }, - ...a.keepLastSnapshots !== void 0 && { keepLastSnapshots: a.keepLastSnapshots } - }, c = a.currentSnapshotId; - return c ? e.create({ - ...s, - ...r, - source: { - type: `snapshot`, - snapshotId: c - } - }) : e.create({ - ...s, - ...a.runtime !== void 0 && { runtime: a.runtime }, - ...r - }); - } - static async get(t) { - "use step"; - let n = await kr(t), r = new ur({ - teamId: n.teamId, - token: n.token, - fetch: t.fetch - }), i = Jn(t), a = await r.getSandbox({ - name: t.name, - projectId: n.projectId, - resume: t.resume, - signal: t.signal, - ...i - }), o = new e({ - client: r, - session: a.json.session, - sandbox: a.json.sandbox, - routes: a.json.routes, - projectId: n.projectId, - onResume: t.onResume - }); - return a.json.resumed && t.onResume && await t.onResume(o), o; - } - static async getOrCreate(t) { - "use step"; - if (!t?.name) { - let n = await e.create(t); - return t?.onCreate && await t.onCreate(n), n; - } - try { - return await e.get(t); - } catch (n) { - if (ai(n)) { - let n = await e.create(t); - return t.onCreate && await t.onCreate(n), n; - } - if (oi(n)) { - let n = await kr(t), r = new ur({ - teamId: n.teamId, - token: n.token, - fetch: t.fetch - }), i = Jn(t); - try { - await r.deleteSandbox({ - name: t.name, - projectId: n.projectId, - signal: t.signal, - ...i - }); - } catch (e) { - if (!ai(e)) throw e; - } - let a = await e.create(t); - return t.onCreate && await t.onCreate(a), a; - } - throw n; - } - } - constructor({ client: e, routes: t, session: n, sandbox: r, projectId: i, onResume: a }) { - this._client = null, this.resumePromise = null, this._client = e ?? null, n && (this.session = new Vr({ - client: e, - routes: t, - session: n - })), this.sandbox = r, this.projectId = i ?? ``, this.onResume = a, this.fs = new ri(this); - } - currentSession() { - if (!this.session) throw Error(`No active session. Run a command or call resume first.`); - return this.session; - } - async resume(e) { - return this.resumePromise ||= this.doResume(e).finally(() => { - this.resumePromise = null; - }), this.resumePromise; - } - async doResume(e) { - let t = await this.ensureClient(), n = await t.getSandbox({ - name: this.sandbox.name, - projectId: this.projectId, - resume: !0, - signal: e - }); - this.session = new Vr({ - client: t, - routes: n.json.routes, - session: n.json.session - }), this.onResume && n.json.resumed && await this.onResume(this); - } - async waitForStopAndResume(e) { - "use step"; - let t = await this.ensureClient(), n = this.session.status; - for (; n === `stopping` || n === `snapshotting`;) { - await setTimeout$1(500, void 0, { signal: e }); - let r = await t.getSession({ - sessionId: this.session.sessionId, - signal: e - }); - this.session = new Vr({ - client: t, - routes: r.json.routes, - session: r.json.session - }), n = r.json.session.status; - } - await this.resume(e); - } - async withResume(e, t) { - this.session || await this.resume(t); - try { - return await e(); - } catch (n) { - if (ii(n)) return await this.resume(t), e(); - if (si(n) || ci(n)) return await this.waitForStopAndResume(t), e(); - throw n; - } - } - async runCommand(e, t, n) { - "use step"; - let r = typeof e == `string` ? n?.signal : e.signal; - return this.withResume(() => this.session.runCommand(e, t, n), r); - } - async getCommand(e, t) { - "use step"; - return this.withResume(() => this.session.getCommand(e, t), t?.signal); - } - async mkDir(e, t) { - "use step"; - return this.withResume(() => this.session.mkDir(e, t), t?.signal); - } - async openInteractive(e) { - "use step"; - return this.withResume(() => this.session.openInteractive(e), e?.signal); - } - async readFile(e, t) { - "use step"; - return this.withResume(() => this.session.readFile(e, t), t?.signal); - } - async readFileToBuffer(e, t) { - "use step"; - return this.withResume(() => this.session.readFileToBuffer(e, t), t?.signal); - } - async downloadFile(e, t, n) { - "use step"; - return this.withResume(() => this.session.downloadFile(e, t, n), n?.signal); - } - async writeFiles(e, t) { - "use step"; - return this.withResume(() => this.session.writeFiles(e, t), t?.signal); - } - domain(e) { - return this.currentSession().domain(e); - } - async stop(e) { - "use step"; - if (!this.session) throw Error(`No active session to stop.`); - let { session: t, sandbox: n, snapshot: r } = await this.session.stop(e); - return n && (this.sandbox = n), Object.assign(t, { snapshot: r }); - } - async updateNetworkPolicy(e, t) { - "use step"; - return await this.withResume(() => this.session.update({ networkPolicy: e }, t), t?.signal), this.session.networkPolicy; - } - async extendTimeout(e, t) { - "use step"; - return this.withResume(() => this.session.extendTimeout(e, t), t?.signal); - } - async snapshot(e) { - "use step"; - return this.withResume(() => this.session.snapshot(e), e?.signal); - } - async update(e, t) { - "use step"; - let n = await this.ensureClient(), r; - e.resources?.vcpus && (r = { - vcpus: e.resources.vcpus, - memory: e.resources.vcpus * 2048 - }); - let i = await n.updateSandbox({ - name: this.sandbox.name, - projectId: this.projectId, - persistent: e.persistent, - resources: r, - timeout: e.timeout, - networkPolicy: e.networkPolicy, - tags: e.tags, - ports: e.ports, - snapshotExpiration: e.snapshotExpiration, - keepLastSnapshots: e.keepLastSnapshots, - currentSnapshotId: e.currentSnapshotId, - signal: t?.signal - }); - if (this.sandbox = i.json.sandbox, e.ports !== void 0 && i.json.routes && this.session?.updateRoutes(i.json.routes), e.networkPolicy) try { - return await this.session?.update({ networkPolicy: e.networkPolicy }, t); - } catch (e) { - if (ii(e) || si(e)) return; - throw e; - } - } - async delete(e) { - "use step"; - await (await this.ensureClient()).deleteSandbox({ - name: this.sandbox.name, - projectId: this.projectId, - signal: e?.signal - }); - } - async listSessions(e) { - "use step"; - let t = await this.ensureClient(), n = async (n) => (await t.listSessions({ - projectId: this.projectId, - name: this.sandbox.name, - limit: e?.limit, - cursor: n, - sortOrder: e?.sortOrder, - signal: e?.signal - })).json; - return Lr(await n(e?.cursor), { - itemsKey: `sessions`, - fetchNext: n, - signal: e?.signal - }); - } - async listSnapshots(e) { - "use step"; - let t = await this.ensureClient(), n = async (n) => (await t.listSnapshots({ - projectId: this.projectId, - name: this.sandbox.name, - limit: e?.limit, - cursor: n, - sortOrder: e?.sortOrder, - signal: e?.signal - })).json; - return Lr(await n(e?.cursor), { - itemsKey: `snapshots`, - fetchNext: n, - signal: e?.signal - }); - } -}; -var ui = class extends li { - async [Symbol.asyncDispose]() { - await this.stop(); - } -}; -const di = new TextEncoder(); -const fi = new TextDecoder(); -function pi(...e) { - let t = e.reduce((e, { length: t }) => e + t, 0), n = new Uint8Array(t), r = 0; - for (let t of e) n.set(t, r), r += t.length; - return n; -} -function mi(e) { - let t = new Uint8Array(e.length); - for (let n = 0; n < e.length; n++) { - let r = e.charCodeAt(n); - if (r > 127) throw TypeError(`non-ASCII string encountered in encode()`); - t[n] = r; - } - return t; -} -function hi(e) { - if (Uint8Array.fromBase64) return Uint8Array.fromBase64(e); - let t = atob(e), n = new Uint8Array(t.length); - for (let e = 0; e < t.length; e++) n[e] = t.charCodeAt(e); - return n; -} -function gi(e) { - if (Uint8Array.fromBase64) return Uint8Array.fromBase64(typeof e == `string` ? e : fi.decode(e), { alphabet: `base64url` }); - let t = e; - t instanceof Uint8Array && (t = fi.decode(t)), t = t.replace(/-/g, `+`).replace(/_/g, `/`); - try { - return hi(t); - } catch { - throw TypeError(`The input to be decoded is not correctly encoded.`); - } -} -var _i = class extends Error { - static code = `ERR_JOSE_GENERIC`; - code = `ERR_JOSE_GENERIC`; - constructor(e, t) { - super(e, t), this.name = this.constructor.name, Error.captureStackTrace?.(this, this.constructor); - } -}; -var vi = class extends _i { - static code = `ERR_JWT_CLAIM_VALIDATION_FAILED`; - code = `ERR_JWT_CLAIM_VALIDATION_FAILED`; - claim; - reason; - payload; - constructor(e, t, n = `unspecified`, r = `unspecified`) { - super(e, { cause: { - claim: n, - reason: r, - payload: t - } }), this.claim = n, this.reason = r, this.payload = t; - } -}; -var yi = class extends _i { - static code = `ERR_JWT_EXPIRED`; - code = `ERR_JWT_EXPIRED`; - claim; - reason; - payload; - constructor(e, t, n = `unspecified`, r = `unspecified`) { - super(e, { cause: { - claim: n, - reason: r, - payload: t - } }), this.claim = n, this.reason = r, this.payload = t; - } -}; -var bi = class extends _i { - static code = `ERR_JOSE_ALG_NOT_ALLOWED`; - code = `ERR_JOSE_ALG_NOT_ALLOWED`; -}; -var xi = class extends _i { - static code = `ERR_JOSE_NOT_SUPPORTED`; - code = `ERR_JOSE_NOT_SUPPORTED`; -}; -var Si = class extends _i { - static code = `ERR_JWS_INVALID`; - code = `ERR_JWS_INVALID`; -}; -var Ci = class extends _i { - static code = `ERR_JWT_INVALID`; - code = `ERR_JWT_INVALID`; -}; -var wi = class extends _i { - static code = `ERR_JWKS_INVALID`; - code = `ERR_JWKS_INVALID`; -}; -var Ti = class extends _i { - static code = `ERR_JWKS_NO_MATCHING_KEY`; - code = `ERR_JWKS_NO_MATCHING_KEY`; - constructor(e = `no applicable key found in the JSON Web Key Set`, t) { - super(e, t); - } -}; -var Ei = class extends _i { - [Symbol.asyncIterator]; - static code = `ERR_JWKS_MULTIPLE_MATCHING_KEYS`; - code = `ERR_JWKS_MULTIPLE_MATCHING_KEYS`; - constructor(e = `multiple matching keys found in the JSON Web Key Set`, t) { - super(e, t); - } -}; -var Di = class extends _i { - static code = `ERR_JWKS_TIMEOUT`; - code = `ERR_JWKS_TIMEOUT`; - constructor(e = `request timed out`, t) { - super(e, t); - } -}; -var Oi = class extends _i { - static code = `ERR_JWS_SIGNATURE_VERIFICATION_FAILED`; - code = `ERR_JWS_SIGNATURE_VERIFICATION_FAILED`; - constructor(e = `signature verification failed`, t) { - super(e, t); - } -}; -const ki = (e, t = `algorithm.name`) => TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`); -const Ai = (e, t) => e.name === t; -function ji(e) { - return parseInt(e.name.slice(4), 10); -} -function Mi(e, t) { - if (ji(e.hash) !== t) throw ki(`SHA-${t}`, `algorithm.hash`); -} -function Ni(e) { - switch (e) { - case `ES256`: return `P-256`; - case `ES384`: return `P-384`; - case `ES512`: return `P-521`; - default: throw Error(`unreachable`); - } -} -function Pi(e, t) { - if (t && !e.usages.includes(t)) throw TypeError(`CryptoKey does not support this operation, its usages must include ${t}.`); -} -function Fi(e, t, n) { - switch (t) { - case `HS256`: - case `HS384`: - case `HS512`: - if (!Ai(e.algorithm, `HMAC`)) throw ki(`HMAC`); - Mi(e.algorithm, parseInt(t.slice(2), 10)); - break; - case `RS256`: - case `RS384`: - case `RS512`: - if (!Ai(e.algorithm, `RSASSA-PKCS1-v1_5`)) throw ki(`RSASSA-PKCS1-v1_5`); - Mi(e.algorithm, parseInt(t.slice(2), 10)); - break; - case `PS256`: - case `PS384`: - case `PS512`: - if (!Ai(e.algorithm, `RSA-PSS`)) throw ki(`RSA-PSS`); - Mi(e.algorithm, parseInt(t.slice(2), 10)); - break; - case `Ed25519`: - case `EdDSA`: - if (!Ai(e.algorithm, `Ed25519`)) throw ki(`Ed25519`); - break; - case `ML-DSA-44`: - case `ML-DSA-65`: - case `ML-DSA-87`: - if (!Ai(e.algorithm, t)) throw ki(t); - break; - case `ES256`: - case `ES384`: - case `ES512`: { - if (!Ai(e.algorithm, `ECDSA`)) throw ki(`ECDSA`); - let n = Ni(t); - if (e.algorithm.namedCurve !== n) throw ki(n, `algorithm.namedCurve`); - break; - } - default: throw TypeError(`CryptoKey does not support this operation`); - } - Pi(e, n); -} -function Ii(e, t, ...n) { - if (n = n.filter(Boolean), n.length > 2) { - let t = n.pop(); - e += `one of type ${n.join(`, `)}, or ${t}.`; - } else n.length === 2 ? e += `one of type ${n[0]} or ${n[1]}.` : e += `of type ${n[0]}.`; - return t == null ? e += ` Received ${t}` : typeof t == `function` && t.name ? e += ` Received function ${t.name}` : typeof t == `object` && t && t.constructor?.name && (e += ` Received an instance of ${t.constructor.name}`), e; -} -const Li = (e, ...t) => Ii(`Key must be `, e, ...t); -const Ri = (e, t, ...n) => Ii(`Key for the ${e} algorithm must be `, t, ...n); -function zi(e, t) { - if (e.startsWith(`RS`) || e.startsWith(`PS`)) { - let { modulusLength: n } = t.algorithm; - if (typeof n != `number` || n < 2048) throw TypeError(`${e} requires key modulusLength to be 2048 bits or larger`); - } -} -function Bi(e, t) { - let n = `SHA-${e.slice(-3)}`; - switch (e) { - case `HS256`: - case `HS384`: - case `HS512`: return { - hash: n, - name: `HMAC` - }; - case `PS256`: - case `PS384`: - case `PS512`: return { - hash: n, - name: `RSA-PSS`, - saltLength: parseInt(e.slice(-3), 10) >> 3 - }; - case `RS256`: - case `RS384`: - case `RS512`: return { - hash: n, - name: `RSASSA-PKCS1-v1_5` - }; - case `ES256`: - case `ES384`: - case `ES512`: return { - hash: n, - name: `ECDSA`, - namedCurve: t.namedCurve - }; - case `Ed25519`: - case `EdDSA`: return { name: `Ed25519` }; - case `ML-DSA-44`: - case `ML-DSA-65`: - case `ML-DSA-87`: return { name: e }; - default: throw new xi(`alg ${e} is not supported either by JOSE or your javascript runtime`); - } -} -async function Vi(e, t, n) { - if (t instanceof Uint8Array) { - if (!e.startsWith(`HS`)) throw TypeError(Li(t, `CryptoKey`, `KeyObject`, `JSON Web Key`)); - return crypto.subtle.importKey(`raw`, t, { - hash: `SHA-${e.slice(-3)}`, - name: `HMAC` - }, !1, [n]); - } - return Fi(t, e, n), t; -} -async function Hi(e, t, n, r) { - let i = await Vi(e, t, `verify`); - zi(e, i); - let a = Bi(e, i.algorithm); - try { - return await crypto.subtle.verify(a, i, n, r); - } catch { - return !1; - } -} -function Ui(e, t, n) { - try { - return gi(e); - } catch { - throw new n(`Failed to base64url decode the ${t}`); - } -} -const Wi = (e) => typeof e == `object` && !!e; -function Gi(e) { - if (!Wi(e) || Object.prototype.toString.call(e) !== `[object Object]`) return !1; - if (Object.getPrototypeOf(e) === null) return !0; - let t = e; - for (; Object.getPrototypeOf(t) !== null;) t = Object.getPrototypeOf(t); - return Object.getPrototypeOf(e) === t; -} -function Ki(...e) { - let t = e.filter(Boolean); - if (t.length === 0 || t.length === 1) return !0; - let n; - for (let e of t) { - let t = Object.keys(e); - if (!n || n.size === 0) { - n = new Set(t); - continue; - } - for (let e of t) { - if (n.has(e)) return !1; - n.add(e); - } - } - return !0; -} -const qi = (e) => Gi(e) && typeof e.kty == `string`; -const Ji = (e) => e.kty !== `oct` && (e.kty === `AKP` && typeof e.priv == `string` || typeof e.d == `string`); -const Yi = (e) => e.kty !== `oct` && e.d === void 0 && e.priv === void 0; -const Xi = (e) => e.kty === `oct` && typeof e.k == `string`; -const Zi = (e) => { - if (e?.[Symbol.toStringTag] === `CryptoKey`) return !0; - try { - return e instanceof CryptoKey; - } catch { - return !1; - } -}; -const Qi = (e) => e?.[Symbol.toStringTag] === `KeyObject`; -const $i = (e) => Zi(e) || Qi(e); -const ea = (e) => e?.[Symbol.toStringTag]; -const ta = (e, t, n) => { - if (t.use !== void 0) { - let e; - switch (n) { - case `sign`: - case `verify`: - e = `sig`; - break; - case `encrypt`: - case `decrypt`: - e = `enc`; - break; - } - if (t.use !== e) throw TypeError(`Invalid key for this operation, its "use" must be "${e}" when present`); - } - if (t.alg !== void 0 && t.alg !== e) throw TypeError(`Invalid key for this operation, its "alg" must be "${e}" when present`); - if (Array.isArray(t.key_ops)) { - let r; - switch (!0) { - case n === `sign` || n === `verify`: - case e === `dir`: - case e.includes(`CBC-HS`): - r = n; - break; - case e.startsWith(`PBES2`): - r = `deriveBits`; - break; - case /^A\d{3}(?:GCM)?(?:KW)?$/.test(e): - r = !e.includes(`GCM`) && e.endsWith(`KW`) ? n === `encrypt` ? `wrapKey` : `unwrapKey` : n; - break; - case n === `encrypt` && e.startsWith(`RSA`): - r = `wrapKey`; - break; - case n === `decrypt`: - r = e.startsWith(`RSA`) ? `unwrapKey` : `deriveBits`; - break; - } - if (r && t.key_ops?.includes?.(r) === !1) throw TypeError(`Invalid key for this operation, its "key_ops" must include "${r}" when present`); - } - return !0; -}; -const na = (e, t, n) => { - if (!(t instanceof Uint8Array)) { - if (qi(t)) { - if (Xi(t) && ta(e, t, n)) return; - throw TypeError(`JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present`); - } - if (!$i(t)) throw TypeError(Ri(e, t, `CryptoKey`, `KeyObject`, `JSON Web Key`, `Uint8Array`)); - if (t.type !== `secret`) throw TypeError(`${ea(t)} instances for symmetric algorithms must be of type "secret"`); - } -}; -const ra = (e, t, n) => { - if (qi(t)) switch (n) { - case `decrypt`: - case `sign`: - if (Ji(t) && ta(e, t, n)) return; - throw TypeError(`JSON Web Key for this operation must be a private JWK`); - case `encrypt`: - case `verify`: - if (Yi(t) && ta(e, t, n)) return; - throw TypeError(`JSON Web Key for this operation must be a public JWK`); - } - if (!$i(t)) throw TypeError(Ri(e, t, `CryptoKey`, `KeyObject`, `JSON Web Key`)); - if (t.type === `secret`) throw TypeError(`${ea(t)} instances for asymmetric algorithms must not be of type "secret"`); - if (t.type === `public`) switch (n) { - case `sign`: throw TypeError(`${ea(t)} instances for asymmetric algorithm signing must be of type "private"`); - case `decrypt`: throw TypeError(`${ea(t)} instances for asymmetric algorithm decryption must be of type "private"`); - } - if (t.type === `private`) switch (n) { - case `verify`: throw TypeError(`${ea(t)} instances for asymmetric algorithm verifying must be of type "public"`); - case `encrypt`: throw TypeError(`${ea(t)} instances for asymmetric algorithm encryption must be of type "public"`); - } -}; -function ia(e, t, n) { - switch (e.substring(0, 2)) { - case `A1`: - case `A2`: - case `di`: - case `HS`: - case `PB`: - na(e, t, n); - break; - default: ra(e, t, n); - } -} -function aa(e, t, n, r, i) { - if (i.crit !== void 0 && r?.crit === void 0) throw new e(`"crit" (Critical) Header Parameter MUST be integrity protected`); - if (!r || r.crit === void 0) return /* @__PURE__ */ new Set(); - if (!Array.isArray(r.crit) || r.crit.length === 0 || r.crit.some((e) => typeof e != `string` || e.length === 0)) throw new e(`"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present`); - let a; - a = n === void 0 ? t : new Map([...Object.entries(n), ...t.entries()]); - for (let t of r.crit) { - if (!a.has(t)) throw new xi(`Extension Header Parameter "${t}" is not recognized`); - if (i[t] === void 0) throw new e(`Extension Header Parameter "${t}" is missing`); - if (a.get(t) && r[t] === void 0) throw new e(`Extension Header Parameter "${t}" MUST be integrity protected`); - } - return new Set(r.crit); -} -function oa(e, t) { - if (t !== void 0 && (!Array.isArray(t) || t.some((e) => typeof e != `string`))) throw TypeError(`"${e}" option must be an array of strings`); - if (t) return new Set(t); -} -const sa = `Invalid or unsupported JWK "alg" (Algorithm) Parameter value`; -function ca(e) { - let t, n; - switch (e.kty) { - case `AKP`: - switch (e.alg) { - case `ML-DSA-44`: - case `ML-DSA-65`: - case `ML-DSA-87`: - t = { name: e.alg }, n = e.priv ? [`sign`] : [`verify`]; - break; - default: throw new xi(sa); - } - break; - case `RSA`: - switch (e.alg) { - case `PS256`: - case `PS384`: - case `PS512`: - t = { - name: `RSA-PSS`, - hash: `SHA-${e.alg.slice(-3)}` - }, n = e.d ? [`sign`] : [`verify`]; - break; - case `RS256`: - case `RS384`: - case `RS512`: - t = { - name: `RSASSA-PKCS1-v1_5`, - hash: `SHA-${e.alg.slice(-3)}` - }, n = e.d ? [`sign`] : [`verify`]; - break; - case `RSA-OAEP`: - case `RSA-OAEP-256`: - case `RSA-OAEP-384`: - case `RSA-OAEP-512`: - t = { - name: `RSA-OAEP`, - hash: `SHA-${parseInt(e.alg.slice(-3), 10) || 1}` - }, n = e.d ? [`decrypt`, `unwrapKey`] : [`encrypt`, `wrapKey`]; - break; - default: throw new xi(sa); - } - break; - case `EC`: - switch (e.alg) { - case `ES256`: - case `ES384`: - case `ES512`: - t = { - name: `ECDSA`, - namedCurve: { - ES256: `P-256`, - ES384: `P-384`, - ES512: `P-521` - }[e.alg] - }, n = e.d ? [`sign`] : [`verify`]; - break; - case `ECDH-ES`: - case `ECDH-ES+A128KW`: - case `ECDH-ES+A192KW`: - case `ECDH-ES+A256KW`: - t = { - name: `ECDH`, - namedCurve: e.crv - }, n = e.d ? [`deriveBits`] : []; - break; - default: throw new xi(sa); - } - break; - case `OKP`: - switch (e.alg) { - case `Ed25519`: - case `EdDSA`: - t = { name: `Ed25519` }, n = e.d ? [`sign`] : [`verify`]; - break; - case `ECDH-ES`: - case `ECDH-ES+A128KW`: - case `ECDH-ES+A192KW`: - case `ECDH-ES+A256KW`: - t = { name: e.crv }, n = e.d ? [`deriveBits`] : []; - break; - default: throw new xi(sa); - } - break; - default: throw new xi(`Invalid or unsupported JWK "kty" (Key Type) Parameter value`); - } - return { - algorithm: t, - keyUsages: n - }; -} -async function la(e) { - if (!e.alg) throw TypeError(`"alg" argument is required when "jwk.alg" is not present`); - let { algorithm: t, keyUsages: n } = ca(e), r = { ...e }; - return r.kty !== `AKP` && delete r.alg, delete r.use, crypto.subtle.importKey(`jwk`, r, t, e.ext ?? !(e.d || e.priv), e.key_ops ?? n); -} -const ua = `given KeyObject instance cannot be used for this algorithm`; -let da; -const fa = async (e, t, n, r = !1) => { - da ||= /* @__PURE__ */ new WeakMap(); - let i = da.get(e); - if (i?.[n]) return i[n]; - let a = await la({ - ...t, - alg: n - }); - return r && Object.freeze(e), i ? i[n] = a : da.set(e, { [n]: a }), a; -}; -const pa = (e, t) => { - da ||= /* @__PURE__ */ new WeakMap(); - let n = da.get(e); - if (n?.[t]) return n[t]; - let r = e.type === `public`, i = !!r, a; - if (e.asymmetricKeyType === `x25519`) { - switch (t) { - case `ECDH-ES`: - case `ECDH-ES+A128KW`: - case `ECDH-ES+A192KW`: - case `ECDH-ES+A256KW`: break; - default: throw TypeError(ua); - } - a = e.toCryptoKey(e.asymmetricKeyType, i, r ? [] : [`deriveBits`]); - } - if (e.asymmetricKeyType === `ed25519`) { - if (t !== `EdDSA` && t !== `Ed25519`) throw TypeError(ua); - a = e.toCryptoKey(e.asymmetricKeyType, i, [r ? `verify` : `sign`]); - } - switch (e.asymmetricKeyType) { - case `ml-dsa-44`: - case `ml-dsa-65`: - case `ml-dsa-87`: - if (t !== e.asymmetricKeyType.toUpperCase()) throw TypeError(ua); - a = e.toCryptoKey(e.asymmetricKeyType, i, [r ? `verify` : `sign`]); - } - if (e.asymmetricKeyType === `rsa`) { - let n; - switch (t) { - case `RSA-OAEP`: - n = `SHA-1`; - break; - case `RS256`: - case `PS256`: - case `RSA-OAEP-256`: - n = `SHA-256`; - break; - case `RS384`: - case `PS384`: - case `RSA-OAEP-384`: - n = `SHA-384`; - break; - case `RS512`: - case `PS512`: - case `RSA-OAEP-512`: - n = `SHA-512`; - break; - default: throw TypeError(ua); - } - if (t.startsWith(`RSA-OAEP`)) return e.toCryptoKey({ - name: `RSA-OAEP`, - hash: n - }, i, r ? [`encrypt`] : [`decrypt`]); - a = e.toCryptoKey({ - name: t.startsWith(`PS`) ? `RSA-PSS` : `RSASSA-PKCS1-v1_5`, - hash: n - }, i, [r ? `verify` : `sign`]); - } - if (e.asymmetricKeyType === `ec`) { - let n = (/* @__PURE__ */ new Map([ - [`prime256v1`, `P-256`], - [`secp384r1`, `P-384`], - [`secp521r1`, `P-521`] - ])).get(e.asymmetricKeyDetails?.namedCurve); - if (!n) throw TypeError(ua); - let o = { - ES256: `P-256`, - ES384: `P-384`, - ES512: `P-521` - }; - o[t] && n === o[t] && (a = e.toCryptoKey({ - name: `ECDSA`, - namedCurve: n - }, i, [r ? `verify` : `sign`])), t.startsWith(`ECDH-ES`) && (a = e.toCryptoKey({ - name: `ECDH`, - namedCurve: n - }, i, r ? [] : [`deriveBits`])); - } - if (!a) throw TypeError(ua); - return n ? n[t] = a : da.set(e, { [t]: a }), a; -}; -async function ma(e, t) { - if (e instanceof Uint8Array || Zi(e)) return e; - if (Qi(e)) { - if (e.type === `secret`) return e.export(); - if (`toCryptoKey` in e && typeof e.toCryptoKey == `function`) try { - return pa(e, t); - } catch (e) { - if (e instanceof TypeError) throw e; - } - return fa(e, e.export({ format: `jwk` }), t); - } - if (qi(e)) return e.k ? gi(e.k) : fa(e, e, t, !0); - throw Error(`unreachable`); -} -async function ha(e, t, n) { - if (!Gi(e)) throw new Si(`Flattened JWS must be an object`); - if (e.protected === void 0 && e.header === void 0) throw new Si(`Flattened JWS must have either of the "protected" or "header" members`); - if (e.protected !== void 0 && typeof e.protected != `string`) throw new Si(`JWS Protected Header incorrect type`); - if (e.payload === void 0) throw new Si(`JWS Payload missing`); - if (typeof e.signature != `string`) throw new Si(`JWS Signature missing or incorrect type`); - if (e.header !== void 0 && !Gi(e.header)) throw new Si(`JWS Unprotected Header incorrect type`); - let r = {}; - if (e.protected) try { - let t = gi(e.protected); - r = JSON.parse(fi.decode(t)); - } catch { - throw new Si(`JWS Protected Header is invalid`); - } - if (!Ki(r, e.header)) throw new Si(`JWS Protected and JWS Unprotected Header Parameter names must be disjoint`); - let i = { - ...r, - ...e.header - }, a = aa(Si, /* @__PURE__ */ new Map([[`b64`, !0]]), n?.crit, r, i), o = !0; - if (a.has(`b64`) && (o = r.b64, typeof o != `boolean`)) throw new Si(`The "b64" (base64url-encode payload) Header Parameter must be a boolean`); - let { alg: s } = i; - if (typeof s != `string` || !s) throw new Si(`JWS "alg" (Algorithm) Header Parameter missing or invalid`); - let c = n && oa(`algorithms`, n.algorithms); - if (c && !c.has(s)) throw new bi(`"alg" (Algorithm) Header Parameter value not allowed`); - if (o) { - if (typeof e.payload != `string`) throw new Si(`JWS Payload must be a string`); - } else if (typeof e.payload != `string` && !(e.payload instanceof Uint8Array)) throw new Si(`JWS Payload must be a string or an Uint8Array instance`); - let l = !1; - typeof t == `function` && (t = await t(r, e), l = !0), ia(s, t, `verify`); - let u = pi(e.protected === void 0 ? /* @__PURE__ */ new Uint8Array() : mi(e.protected), mi(`.`), typeof e.payload == `string` ? o ? mi(e.payload) : di.encode(e.payload) : e.payload), d = Ui(e.signature, `signature`, Si), f = await ma(t, s); - if (!await Hi(s, f, d, u)) throw new Oi(); - let p; - p = o ? Ui(e.payload, `payload`, Si) : typeof e.payload == `string` ? di.encode(e.payload) : e.payload; - let m = { payload: p }; - return e.protected !== void 0 && (m.protectedHeader = r), e.header !== void 0 && (m.unprotectedHeader = e.header), l ? { - ...m, - key: f - } : m; -} -async function ga(e, t, n) { - if (e instanceof Uint8Array && (e = fi.decode(e)), typeof e != `string`) throw new Si(`Compact JWS must be a string or Uint8Array`); - let { 0: r, 1: i, 2: a, length: o } = e.split(`.`); - if (o !== 3) throw new Si(`Invalid Compact JWS`); - let s = await ha({ - payload: i, - protected: r, - signature: a - }, t, n), c = { - payload: s.payload, - protectedHeader: s.protectedHeader - }; - return typeof t == `function` ? { - ...c, - key: s.key - } : c; -} -const _a = (e) => Math.floor(e.getTime() / 1e3); -const va = /^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i; -function ya(e) { - let t = va.exec(e); - if (!t || t[4] && t[1]) throw TypeError(`Invalid time period format`); - let n = parseFloat(t[2]), r = t[3].toLowerCase(), i; - switch (r) { - case `sec`: - case `secs`: - case `second`: - case `seconds`: - case `s`: - i = Math.round(n); - break; - case `minute`: - case `minutes`: - case `min`: - case `mins`: - case `m`: - i = Math.round(n * 60); - break; - case `hour`: - case `hours`: - case `hr`: - case `hrs`: - case `h`: - i = Math.round(n * 3600); - break; - case `day`: - case `days`: - case `d`: - i = Math.round(n * 86400); - break; - case `week`: - case `weeks`: - case `w`: - i = Math.round(n * 604800); - break; - default: - i = Math.round(n * 31557600); - break; - } - return t[1] === `-` || t[4] === `ago` ? -i : i; -} -const ba = (e) => e.includes(`/`) ? e.toLowerCase() : `application/${e.toLowerCase()}`; -const xa = (e, t) => typeof e == `string` ? t.includes(e) : Array.isArray(e) ? t.some(Set.prototype.has.bind(new Set(e))) : !1; -function Sa(e, t, n = {}) { - let r; - try { - r = JSON.parse(fi.decode(t)); - } catch {} - if (!Gi(r)) throw new Ci(`JWT Claims Set must be a top-level JSON object`); - let { typ: i } = n; - if (i && (typeof e.typ != `string` || ba(e.typ) !== ba(i))) throw new vi(`unexpected "typ" JWT header value`, r, `typ`, `check_failed`); - let { requiredClaims: a = [], issuer: o, subject: s, audience: c, maxTokenAge: l } = n, u = [...a]; - l !== void 0 && u.push(`iat`), c !== void 0 && u.push(`aud`), s !== void 0 && u.push(`sub`), o !== void 0 && u.push(`iss`); - for (let e of new Set(u.reverse())) if (!(e in r)) throw new vi(`missing required "${e}" claim`, r, e, `missing`); - if (o && !(Array.isArray(o) ? o : [o]).includes(r.iss)) throw new vi(`unexpected "iss" claim value`, r, `iss`, `check_failed`); - if (s && r.sub !== s) throw new vi(`unexpected "sub" claim value`, r, `sub`, `check_failed`); - if (c && !xa(r.aud, typeof c == `string` ? [c] : c)) throw new vi(`unexpected "aud" claim value`, r, `aud`, `check_failed`); - let d; - switch (typeof n.clockTolerance) { - case `string`: - d = ya(n.clockTolerance); - break; - case `number`: - d = n.clockTolerance; - break; - case `undefined`: - d = 0; - break; - default: throw TypeError(`Invalid clockTolerance option type`); - } - let { currentDate: f } = n, p = _a(f || /* @__PURE__ */ new Date()); - if ((r.iat !== void 0 || l) && typeof r.iat != `number`) throw new vi(`"iat" claim must be a number`, r, `iat`, `invalid`); - if (r.nbf !== void 0) { - if (typeof r.nbf != `number`) throw new vi(`"nbf" claim must be a number`, r, `nbf`, `invalid`); - if (r.nbf > p + d) throw new vi(`"nbf" claim timestamp check failed`, r, `nbf`, `check_failed`); - } - if (r.exp !== void 0) { - if (typeof r.exp != `number`) throw new vi(`"exp" claim must be a number`, r, `exp`, `invalid`); - if (r.exp <= p - d) throw new yi(`"exp" claim timestamp check failed`, r, `exp`, `check_failed`); - } - if (l) { - let e = p - r.iat, t = typeof l == `number` ? l : ya(l); - if (e - d > t) throw new yi(`"iat" claim timestamp check failed (too far in the past)`, r, `iat`, `check_failed`); - if (e < 0 - d) throw new vi(`"iat" claim timestamp check failed (it should be in the past)`, r, `iat`, `check_failed`); - } - return r; -} -async function Ca(e, t, n) { - let r = await ga(e, t, n); - if (r.protectedHeader.crit?.includes(`b64`) && r.protectedHeader.b64 === !1) throw new Ci(`JWTs MUST NOT use unencoded payload`); - let i = { - payload: Sa(r.protectedHeader, r.payload, n), - protectedHeader: r.protectedHeader - }; - return typeof t == `function` ? { - ...i, - key: r.key - } : i; -} -async function wa(e, t, n) { - if (!Gi(e)) throw TypeError(`JWK must be an object`); - let r; - switch (t ??= e.alg, r ??= n?.extractable ?? e.ext, e.kty) { - case `oct`: - if (typeof e.k != `string` || !e.k) throw TypeError(`missing "k" (Key Value) Parameter value`); - return gi(e.k); - case `RSA`: - if (`oth` in e && e.oth !== void 0) throw new xi(`RSA JWK "oth" (Other Primes Info) Parameter value is not supported`); - return la({ - ...e, - alg: t, - ext: r - }); - case `AKP`: - if (typeof e.alg != `string` || !e.alg) throw TypeError(`missing "alg" (Algorithm) Parameter value`); - if (t !== void 0 && t !== e.alg) throw TypeError(`JWK alg and alg option value mismatch`); - return la({ - ...e, - ext: r - }); - case `EC`: - case `OKP`: return la({ - ...e, - alg: t, - ext: r - }); - default: throw new xi(`Unsupported "kty" (Key Type) Parameter value`); - } -} -function Ta(e) { - switch (typeof e == `string` && e.slice(0, 2)) { - case `RS`: - case `PS`: return `RSA`; - case `ES`: return `EC`; - case `Ed`: return `OKP`; - case `ML`: return `AKP`; - default: throw new xi(`Unsupported "alg" value for a JSON Web Key Set`); - } -} -function Ea(e) { - return e && typeof e == `object` && Array.isArray(e.keys) && e.keys.every(Da); -} -function Da(e) { - return Gi(e); -} -var Oa = class { - #e; - #t = /* @__PURE__ */ new WeakMap(); - constructor(e) { - if (!Ea(e)) throw new wi(`JSON Web Key Set malformed`); - this.#e = structuredClone(e); - } - jwks() { - return this.#e; - } - async getKey(e, t) { - let { alg: n, kid: r } = { - ...e, - ...t?.header - }, i = Ta(n), a = this.#e.keys.filter((e) => { - let t = i === e.kty; - if (t && typeof r == `string` && (t = r === e.kid), t && (typeof e.alg == `string` || i === `AKP`) && (t = n === e.alg), t && typeof e.use == `string` && (t = e.use === `sig`), t && Array.isArray(e.key_ops) && (t = e.key_ops.includes(`verify`)), t) switch (n) { - case `ES256`: - t = e.crv === `P-256`; - break; - case `ES384`: - t = e.crv === `P-384`; - break; - case `ES512`: - t = e.crv === `P-521`; - break; - case `Ed25519`: - case `EdDSA`: - t = e.crv === `Ed25519`; - break; - } - return t; - }), { 0: o, length: s } = a; - if (s === 0) throw new Ti(); - if (s !== 1) { - let e = new Ei(), t = this.#t; - throw e[Symbol.asyncIterator] = async function* () { - for (let e of a) try { - yield await ka(t, e, n); - } catch {} - }, e; - } - return ka(this.#t, o, n); - } -}; -async function ka(e, t, n) { - let r = e.get(t) || e.set(t, {}).get(t); - if (r[n] === void 0) { - let e = await wa({ - ...t, - ext: !0 - }, n); - if (e instanceof Uint8Array || e.type !== `public`) throw new wi(`JSON Web Key Set members must be public keys`); - r[n] = e; - } - return r[n]; -} -function Aa(e) { - let t = new Oa(e), n = async (e, n) => t.getKey(e, n); - return Object.defineProperties(n, { jwks: { - value: () => structuredClone(t.jwks()), - enumerable: !1, - configurable: !1, - writable: !1 - } }), n; -} -function ja() { - return typeof WebSocketPair < `u` || typeof navigator < `u` && navigator.userAgent === `Cloudflare-Workers` || typeof EdgeRuntime < `u` && EdgeRuntime === `vercel`; -} -let Ma; -(typeof navigator > `u` || !navigator.userAgent?.startsWith?.(`Mozilla/5.0 `)) && (Ma = `jose/v6.2.3`); -const Na = Symbol(); -async function Pa(e, t, n, r = fetch) { - let i = await r(e, { - method: `GET`, - signal: n, - redirect: `manual`, - headers: t - }).catch((e) => { - throw e.name === `TimeoutError` ? new Di() : e; - }); - if (i.status !== 200) throw new _i(`Expected 200 OK from the JSON Web Key Set HTTP response`); - try { - return await i.json(); - } catch { - throw new _i(`Failed to parse the JSON Web Key Set HTTP response as JSON`); - } -} -const Fa = Symbol(); -function Ia(e, t) { - return !(typeof e != `object` || !e || !(`uat` in e) || typeof e.uat != `number` || Date.now() - e.uat >= t || !(`jwks` in e) || !Gi(e.jwks) || !Array.isArray(e.jwks.keys) || !Array.prototype.every.call(e.jwks.keys, Gi)); -} -var La = class { - #e; - #t; - #n; - #r; - #i; - #a; - #o; - #s; - #c; - #l; - constructor(e, t) { - if (!(e instanceof URL)) throw TypeError(`url must be an instance of URL`); - this.#e = new URL(e.href), this.#t = typeof t?.timeoutDuration == `number` ? t?.timeoutDuration : 5e3, this.#n = typeof t?.cooldownDuration == `number` ? t?.cooldownDuration : 3e4, this.#r = typeof t?.cacheMaxAge == `number` ? t?.cacheMaxAge : 6e5, this.#o = new Headers(t?.headers), Ma && !this.#o.has(`User-Agent`) && this.#o.set(`User-Agent`, Ma), this.#o.has(`accept`) || (this.#o.set(`accept`, `application/json`), this.#o.append(`accept`, `application/jwk-set+json`)), this.#s = t?.[Na], t?.[Fa] !== void 0 && (this.#l = t?.[Fa], Ia(t?.[Fa], this.#r) && (this.#i = this.#l.uat, this.#c = Aa(this.#l.jwks))); - } - pendingFetch() { - return !!this.#a; - } - coolingDown() { - return typeof this.#i == `number` ? Date.now() < this.#i + this.#n : !1; - } - fresh() { - return typeof this.#i == `number` ? Date.now() < this.#i + this.#r : !1; - } - jwks() { - return this.#c?.jwks(); - } - async getKey(e, t) { - (!this.#c || !this.fresh()) && await this.reload(); - try { - return await this.#c(e, t); - } catch (n) { - if (n instanceof Ti && this.coolingDown() === !1) return await this.reload(), this.#c(e, t); - throw n; - } - } - async reload() { - this.#a && ja() && (this.#a = void 0), this.#a ||= Pa(this.#e.href, this.#o, AbortSignal.timeout(this.#t), this.#s).then((e) => { - this.#c = Aa(e), this.#l && (this.#l.uat = Date.now(), this.#l.jwks = e), this.#i = Date.now(), this.#a = void 0; - }).catch((e) => { - throw this.#a = void 0, e; - }), await this.#a; - } -}; -function Ra(e, t) { - let n = new La(e, t), r = async (e, t) => n.getKey(e, t); - return Object.defineProperties(r, { - coolingDown: { - get: () => n.coolingDown(), - enumerable: !0, - configurable: !1 - }, - fresh: { - get: () => n.fresh(), - enumerable: !0, - configurable: !1 - }, - reload: { - value: () => n.reload(), - enumerable: !0, - configurable: !1, - writable: !1 - }, - reloading: { - get: () => n.pendingFetch(), - enumerable: !0, - configurable: !1 - }, - jwks: { - value: () => n.jwks(), - enumerable: !0, - configurable: !1, - writable: !1 - } - }), r; -} -function za(e) { - if (typeof e != `string`) throw new Ci(`JWTs must use Compact JWS serialization, JWT must be a string`); - let { 1: t, length: n } = e.split(`.`); - if (n === 5) throw new Ci(`Only JWTs using Compact JWS serialization can be decoded`); - if (n !== 3) throw new Ci(`Invalid JWT`); - if (!t) throw new Ci(`JWTs must contain a payload`); - let r; - try { - r = gi(t); - } catch { - throw new Ci(`Failed to base64url decode the payload`); - } - let i; - try { - i = JSON.parse(fi.decode(r)); - } catch { - throw new Ci(`Failed to parse the decoded payload as JSON`); - } - if (!Gi(i)) throw new Ci(`Invalid JWT Claims Set`); - return i; -} -const Ba = `vercel-forwarded-host`; -const Va = `vercel-forwarded-scheme`; -const Ha = `vercel-forwarded-port`; -const Ua = `vercel-forwarded-path`; -const Wa = `vercel-sandbox-oidc-token`; -const Ga = /* @__PURE__ */ new Map(); -function Ka(e, t = qa) { - return async function(n) { - let r = new Headers(n.headers), i = r.get(Ba), a = r.get(Va), o = r.get(Ha), s = r.get(Ua), c = r.get(Wa); - if (r.delete(Ba), r.delete(Va), r.delete(Ha), r.delete(Ua), r.delete(Wa), !i || !a || !o || !s || !c) return t(n, Error(`Missing required proxy headers`)); - let l; - try { - l = new Request(Ja(a, i, o, s), { - method: n.method, - body: n.body, - headers: r, - duplex: `half` - }); - } catch { - return t(new Request(n, { headers: r }), Error(`Invalid proxied request URL`)); - } - l.headers.set(`host`, i); - try { - let t = Ya(new URL(n.url), s), r = await Qa(c, t), i = Za(t.host, r); - return e(l, i); - } catch (e) { - return t(l, e instanceof Error ? e : Error(`Invalid OIDC token`)); - } - }; -} -function qa() { - return new Response(`Forbidden`, { status: 403 }); -} -function Ja(e, t, n, r) { - let i = `${e}://${t}:${n}`; - return r === `/` ? i : `${i}${r}`; -} -function Ya(e, t) { - let n = Xa(new URL(t, e.origin).pathname), r = new URL(e); - return r.pathname = Xa(r.pathname), n !== `/` && r.pathname.endsWith(n) && (r.pathname = Xa(r.pathname.slice(0, -n.length))), r; -} -function Xa(e) { - return e.replace(/\/+$/, ``) || `/`; -} -function Za(e, t) { - let n = to(t, `team_id`), r = to(t, `project_id`), i = to(t, `sandbox_id`), a = to(t, `sandbox_name`) ?? i; - if (!n || !r || !i || !a) throw Error(`Missing required claims in OIDC token`); - return { - host: e, - teamId: n, - projectId: r, - sandboxId: i, - sandboxName: a - }; -} -async function Qa(e, t) { - let n = to(za(e), `iss`); - if (!n) throw Error(`Missing OIDC issuer`); - let r; - try { - r = new URL(n); - } catch { - throw Error(`Invalid OIDC issuer`); - } - if (r.protocol !== `https:` || r.hostname !== `oidc.vercel.com`) throw Error(`Invalid OIDC issuer`); - let { payload: i } = await Ca(e, eo(n), { - audience: $a(t), - algorithms: [`RS256`], - clockTolerance: 60, - issuer: n - }); - return i; -} -function $a(e) { - let t = Xa(e.pathname); - return t === `/` ? e.origin : e.origin + t; -} -function eo(e) { - let t = Ga.get(e); - if (t) return t; - let n = Ra(new URL(`${e.replace(/\/$/, ``)}/.well-known/jwks`)); - return Ga.set(e, n), n; -} -function to(e, t) { - let n = e[t]; - if (typeof n == `string` && n) return n; -} -//#endregion -//#region node_modules/eve/dist/src/compiled/@workflow/core/index.js -var core_exports = /* @__PURE__ */ __exportAll({ - FatalError: () => D$10, - experimental_setAttributes: () => C$1, - getWorkflowMetadata: () => T$1 -}); -async function C$1(e, n = {}) { - let i = Vb.getStore(), o = i?.workflowMetadata?.workflowRunId; - if (!o) throw new D$10(`experimental_setAttributes() must be called from a 'use workflow' or 'use step' function. Calling it from plain host code is not supported.`); - let s = vS(e, n); - s.length !== 0 && await (await T_$1()).events.create(o, { - eventType: `attr_set`, - specVersion: 5, - eventData: { - changes: s, - writer: { - type: `step`, - stepId: i.stepMetadata.stepId, - attempt: i.stepMetadata.attempt - }, - ...n.allowReservedAttributes === !0 ? { allowReservedAttributes: !0 } : {} - } - }); -} -function T$1() { - let e = Vb.getStore(); - return e || je$8(`getWorkflowMetadata()`, `https://workflow-sdk.dev/docs/api-reference/workflow/get-workflow-metadata`, T$1), e.workflowMetadata; -} -//#endregion -//#region node_modules/eve/dist/src/compiled/_chunks/node/auth-DF_ft5ea.js -var auth_DF_ft5ea_exports = /* @__PURE__ */ __exportAll({ - NotOk: () => G$1, - OAuth: () => R, - getAuth: () => O, - inferScope: () => ie, - isOAuthError: () => U, - pollForToken: () => W, - updateAuthConfig: () => k -}); -const b$1 = { - invalid_type: `invalid_type`, - too_big: `too_big`, - too_small: `too_small`, - invalid_format: `invalid_format`, - not_multiple_of: `not_multiple_of`, - unrecognized_keys: `unrecognized_keys`, - invalid_union: `invalid_union`, - invalid_key: `invalid_key`, - invalid_element: `invalid_element`, - invalid_value: `invalid_value`, - custom: `custom` -}; -var ee$1; -ee$1 ||= {}; -const x = Mi$1().transform((e, t) => { - try { - return JSON.parse(e); - } catch (e) { - return t.addIssue({ - code: b$1.custom, - message: `Invalid JSON: ${e.message}` - }), t$1; - } -}); -var S = c$3(((e, n) => { - let r = p$4(`os`), i = p$4(`path`), a = /^win/i.test(process.platform); - function o(e) { - return i.normalize(i.join(e, `.`)); - } - let s = () => { - let { env: e } = process, t = {}; - return t.home = () => o(r.homedir ? r.homedir() : e.HOME), t.temp = () => o(r.tmpdir ? r.tmpdir() : e.TMPDIR || e.TEMP || e.TMP), t; - }, c = () => { - let { env: e } = process, t = {}; - return t.home = () => o(r.homedir ? r.homedir() : e.USERPROFILE || i.join(e.HOMEDRIVE, e.HOMEPATH) || e.HOME), t.temp = () => o(r.tmpdir ? r.tmpdir() : e.TEMP || e.TMP || i.join(e.LOCALAPPDATA || e.SystemRoot || e.windir, `Temp`)), t; - }; - n.exports = new class e { - constructor() { - let t = function() { - return new e(); - }; - this._fn = t; - let n = a ? c() : s(); - return Object.keys(n).forEach((e) => { - this._fn[e] = n[e]; - }), this._fn; - } - }(); -})); -var C = c$3(((e, n) => { - let r = p$4(`path`), i = S(), a = () => { - let e = {}; - return e.cache = () => process.env.XDG_CACHE_HOME || r.join(i.home() || i.temp(), `.cache`), e.config = () => process.env.XDG_CONFIG_HOME || r.join(i.home() || i.temp(), `.config`), e.data = () => process.env.XDG_DATA_HOME || r.join(i.home() || i.temp(), `.local`, `share`), e.runtime = () => process.env.XDG_RUNTIME_DIR || void 0, e.state = () => process.env.XDG_STATE_HOME || r.join(i.home() || i.temp(), `.local`, `state`), e; - }, o = () => { - let e = {}; - return e.cache = () => process.env.XDG_CACHE_HOME || r.join(r.join(i.home() || i.temp(), `Library`), `Caches`), e.config = () => process.env.XDG_CONFIG_HOME || r.join(r.join(i.home() || i.temp(), `Library`), `Preferences`), e.data = () => process.env.XDG_DATA_HOME || r.join(r.join(i.home() || i.temp(), `Library`), `Application Support`), e.runtime = () => process.env.XDG_RUNTIME_DIR || void 0, e.state = () => process.env.XDG_STATE_HOME || r.join(r.join(i.home() || i.temp(), `Library`), `State`), e; - }, s = () => { - let e = {}; - return e.cache = () => { - let e = process.env.LOCALAPPDATA || r.join(i.home() || i.temp(), `AppData`, `Local`); - return process.env.XDG_CACHE_HOME || r.join(e, `xdg.cache`); - }, e.config = () => { - let e = process.env.APPDATA || r.join(i.home() || i.temp(), `AppData`, `Roaming`); - return process.env.XDG_CONFIG_HOME || r.join(e, `xdg.config`); - }, e.data = () => { - let e = process.env.APPDATA || r.join(i.home() || i.temp(), `AppData`, `Roaming`); - return process.env.XDG_DATA_HOME || r.join(e, `xdg.data`); - }, e.runtime = () => process.env.XDG_RUNTIME_DIR || void 0, e.state = () => { - let e = process.env.LOCALAPPDATA || r.join(i.home() || i.temp(), `AppData`, `Local`); - return process.env.XDG_STATE_HOME || r.join(e, `xdg.state`); - }, e; - }, c = () => { - let e = function() { - return c(); - }, t = {}; - return t = /^darwin$/i.test(process.platform) ? o() : /^win/i.test(process.platform) ? s() : a(), t.configDirs = () => { - let e = []; - return e.push(t.config()), process.env.XDG_CONFIG_DIRS && e.push(...process.env.XDG_CONFIG_DIRS.split(r.delimiter)), e; - }, t.dataDirs = () => { - let e = []; - return e.push(t.data()), process.env.XDG_DATA_DIRS && e.push(...process.env.XDG_DATA_DIRS.split(r.delimiter)), e; - }, Object.keys(t).forEach((n) => { - e[n] = t[n]; - }), e; - }; - n.exports = c(); -})); -var w$1 = d$3(c$3(((e, n) => { - let r = p$4(`path`), i = p$4(`os`), a = C(), o = /^win/i.test(process.platform); - function s(e, t) { - if (e ||= {}, typeof e != `object` && (e = { isolated: e }), e.isolated = e.isolated === void 0 || e.isolated === null ? t : e.isolated, typeof e.isolated != `boolean`) throw TypeError(`Expected boolean for "isolated" argument, got ${typeof e.isolated}`); - return e; - } - let c = (e, t) => { - let n = {}; - return n.cache = (n = { isolated: null }) => (n = s(n, t), r.join(a.cache(), n.isolated ? e : ``)), n.config = (n = { isolated: null }) => (n = s(n, t), r.join(a.config(), n.isolated ? e : ``)), n.data = (n = { isolated: null }) => (n = s(n, t), r.join(a.data(), n.isolated ? e : ``)), n.runtime = (n = { isolated: null }) => (n = s(n, t), a.runtime() ? r.join(a.runtime(), n.isolated ? e : ``) : void 0), n.state = (n = { isolated: null }) => (n = s(n, t), r.join(a.state(), n.isolated ? e : ``)), n.configDirs = (n = { isolated: null }) => (n = s(n, t), a.configDirs().map((t) => r.join(t, n.isolated ? e : ``))), n.dataDirs = (n = { isolated: null }) => (n = s(n, t), a.dataDirs().map((t) => r.join(t, n.isolated ? e : ``))), n; - }, l = (e, t) => { - let { env: n } = process, o = i.homedir(), c = i.tmpdir(), l = n.APPDATA || r.join(o || c, `AppData`, `Roaming`), u = n.LOCALAPPDATA || r.join(o || c, `AppData`, `Local`), d = {}; - return d.cache = (i = { isolated: null }) => (i = s(i, t), !i.isolated || n.XDG_CACHE_HOME ? r.join(a.cache(), i.isolated ? e : ``) : r.join(u, i.isolated ? e : ``, `Cache`)), d.config = (i = { isolated: null }) => (i = s(i, t), !i.isolated || n.XDG_CONFIG_HOME ? r.join(a.config(), i.isolated ? e : ``) : r.join(l, i.isolated ? e : ``, `Config`)), d.data = (i = { isolated: null }) => (i = s(i, t), !i.isolated || n.XDG_DATA_HOME ? r.join(a.data(), i.isolated ? e : ``) : r.join(l, i.isolated ? e : ``, `Data`)), d.runtime = (n = { isolated: null }) => (n = s(n, t), a.runtime() ? r.join(a.runtime(), n.isolated ? e : ``) : void 0), d.state = (i = { isolated: null }) => (i = s(i, t), !i.isolated || n.XDG_STATE_HOME ? r.join(a.state(), i.isolated ? e : ``) : r.join(u, i.isolated ? e : ``, `State`)), d.configDirs = (i = { isolated: null }) => { - i = s(i, t); - let a = [d.config(i)]; - return n.XDG_CONFIG_DIRS && a.push(...n.XDG_CONFIG_DIRS.split(r.delimiter).map((t) => r.join(t, i.isolated ? e : ``))), a; - }, d.dataDirs = (i = { isolated: null }) => { - i = s(i, t); - let a = [d.data(i)]; - return n.XDG_DATA_DIRS && a.push(...n.XDG_DATA_DIRS.split(r.delimiter).map((t) => r.join(t, i.isolated ? e : ``))), a; - }, d; - }; - n.exports = new class e { - constructor(n = { - name: null, - suffix: null, - isolated: !0 - }) { - let i = function(t = { - name: null, - suffix: null, - isolated: !0 - }) { - return new e(t); - }; - this._fn = i, n ||= {}, typeof n != `object` && (n = { name: n }); - let a = n.name || ``; - if (typeof a != `string`) throw TypeError(`Expected string for "name" argument, got ${typeof a}`); - let s = n.suffix || ``; - if (typeof s != `string`) throw TypeError(`Expected string for "suffix" argument, got ${typeof s}`); - let u = n.isolated === void 0 || n.isolated === null ? !0 : n.isolated; - if (typeof u != `boolean`) throw TypeError(`Expected boolean for "isolated" argument, got ${typeof u}`); - a ||= r.parse(process.pkg ? process.execPath : p$4.main ? p$4.main.filename : process.argv[0]).name, s && (a += s), this._fn.$name = () => a, this._fn.$isolated = () => u; - let d = o ? l(a, u) : c(a, u); - return Object.keys(d).forEach((e) => { - this._fn[e] = d[e]; - }), this._fn; - } - }(); -}))(), 1); -const T = Qi$1().transform((e) => /* @__PURE__ */ new Date(e * 1e3)); -const E$1 = da$1({ - token: Mi$1().min(1).optional(), - refreshToken: Mi$1().min(1).optional(), - expiresAt: T.optional() -}); -const te = x.pipe(E$1); -const ne = (e) => { - try { - return g.lstatSync(e).isDirectory(); - } catch { - return !1; - } -}; -const D = () => { - if (process.env.VERCEL_AUTH_CONFIG_DIR) return process.env.VERCEL_AUTH_CONFIG_DIR; - let e = (0, w$1.default)(`com.vercel.cli`).dataDirs(); - return [ - ...e, - G.join(homedir(), `.now`), - ...(0, w$1.default)(`now`).dataDirs() - ].find((e) => ne(e)) || e[0]; -}; -const O = () => { - try { - let e = G.join(D(), `auth.json`); - return te.parse(g.readFileSync(e, `utf8`)); - } catch { - return null; - } -}; -function k(e) { - let t = G.join(D(), `auth.json`); - g.mkdirSync(G.dirname(t), { recursive: !0 }); - let n = { - token: e.token, - expiresAt: e.expiresAt && Math.round(e.expiresAt.getTime() / 1e3), - refreshToken: e.refreshToken - }; - g.writeFileSync(t, JSON.stringify(n) + ` -`); -} -const A = `${E.hostname()} @ vercel/sandbox/${qa$1} node-${process.version} ${E.platform()} (${E.arch()})`; -const j = new URL(`https://vercel.com`); -const M = `cl_HYyOPBNtFMfHhaUn9L4QPfTZz6TP47bp`; -const N = da$1({ - issuer: Mi$1().url(), - device_authorization_endpoint: Mi$1().url(), - token_endpoint: Mi$1().url(), - revocation_endpoint: Mi$1().url(), - jwks_uri: Mi$1().url(), - introspection_endpoint: Mi$1().url() -}); -let P; -const F = da$1({ - device_code: Mi$1(), - user_code: Mi$1(), - verification_uri: Mi$1().url(), - verification_uri_complete: Mi$1().url(), - expires_in: Qi$1(), - interval: Qi$1() -}); -const I = da$1({ - active: Ca$1(!0), - client_id: Mi$1(), - session_id: Mi$1() -}).or(da$1({ active: Ca$1(!1) })); -async function L() { - if (P) return P; - let e = await fetch(new URL(`.well-known/openid-configuration`, j), { headers: { - "Content-Type": `application/json`, - "user-agent": A - } }); - return P = N.parse(await e.json()), P; -} -async function R() { - let e = await L(); - return { - async deviceAuthorizationRequest() { - let t = await (await fetch(e.device_authorization_endpoint, { - method: `POST`, - headers: { - "Content-Type": `application/x-www-form-urlencoded`, - "user-agent": A - }, - body: new URLSearchParams({ - client_id: M, - scope: `openid offline_access` - }) - })).json(), n = F.safeParse(t); - if (!n.success) throw new H(`Failed to parse device authorization response from the Vercel authorization server.`, t); - return { - device_code: n.data.device_code, - user_code: n.data.user_code, - verification_uri: n.data.verification_uri, - verification_uri_complete: n.data.verification_uri_complete, - expiresAt: Date.now() + n.data.expires_in * 1e3, - interval: n.data.interval - }; - }, - async deviceAccessTokenRequest(t) { - try { - return [null, await fetch(e.token_endpoint, { - method: `POST`, - headers: { - "Content-Type": `application/x-www-form-urlencoded`, - "user-agent": A - }, - body: new URLSearchParams({ - client_id: M, - grant_type: `urn:ietf:params:oauth:grant-type:device_code`, - device_code: t - }), - signal: AbortSignal.timeout(10 * 1e3) - })]; - } catch (e) { - return e instanceof Error ? [e] : [Error(`An unknown error occurred. See the logs for details.`, { cause: e })]; - } - }, - async processTokenResponse(e) { - let t = await e.json(), n = z.safeParse(t); - return n.success ? [null, n.data] : [new H(`Failed to parse token response from the Vercel authorization server.`, t)]; - }, - async revokeToken(t) { - let n = await fetch(e.revocation_endpoint, { - method: `POST`, - headers: { - "Content-Type": `application/x-www-form-urlencoded`, - "user-agent": A - }, - body: new URLSearchParams({ - token: t, - client_id: M - }) - }); - if (!n.ok) return new H(`Revocation request failed`, await n.json()); - }, - async refreshToken(t) { - let n = await fetch(e.token_endpoint, { - method: `POST`, - headers: { - "Content-Type": `application/x-www-form-urlencoded`, - "user-agent": A - }, - body: new URLSearchParams({ - client_id: M, - grant_type: `refresh_token`, - refresh_token: t - }) - }), [r, i] = await this.processTokenResponse(n); - if (r) throw r; - return i; - }, - async introspectToken(t) { - let n = await (await fetch(e.introspection_endpoint, { - method: `POST`, - headers: { - "Content-Type": `application/x-www-form-urlencoded`, - "user-agent": A - }, - body: new URLSearchParams({ token: t }) - })).json(), r = I.safeParse(n); - if (!r.success) throw new H(`Failed to parse introspection response from the Vercel authorization server.`, n); - return r.data; - } - }; -} -const z = da$1({ - access_token: Mi$1(), - token_type: Ca$1(`Bearer`), - expires_in: Qi$1(), - refresh_token: Mi$1().optional(), - scope: Mi$1().optional() -}); -const B = da$1({ - error: xa$1([ - `invalid_request`, - `invalid_client`, - `invalid_grant`, - `unauthorized_client`, - `unsupported_grant_type`, - `invalid_scope`, - `server_error`, - `authorization_pending`, - `slow_down`, - `access_denied`, - `expired_token`, - `unsupported_token_type` - ]), - error_description: Mi$1().optional(), - error_uri: Mi$1().optional() -}); -function V(e) { - try { - return B.parse(e); - } catch (e) { - return e instanceof gi$1 ? TypeError(`Invalid OAuth error response: ${e.message}`) : TypeError(`Failed to parse OAuth error response`); - } -} -var H = class extends Error { - constructor(e, t) { - super(e), this.name = `OAuthError`; - let n = V(t); - if (n instanceof TypeError) { - this.cause = Error(`Unexpected response from the Vercel authorization server.`), this.code = `server_error`; - return; - } - let r = n.error; - n.error_description && (r += `: ${n.error_description}`), n.error_uri && (r += ` (${n.error_uri})`), this.cause = Error(r), this.code = n.error; - } -}; -function U(e) { - return e instanceof H; -} -async function* W({ request: e, oauth: t }) { - let n = new AbortController(); - try { - let r = e.interval * 1e3; - for (; Date.now() < e.expiresAt;) { - let [i, a] = await t.deviceAccessTokenRequest(e.device_code); - if (i) { - if (i.message.includes(`timeout`)) { - r *= 2, yield { - _tag: `Timeout`, - newInterval: r - }, await setTimeout$1(r, { signal: n.signal }); - continue; - } - yield { - _tag: `Error`, - error: i - }; - return; - } - yield { - _tag: `Response`, - response: a.clone() - }; - let [o, s] = await t.processTokenResponse(a); - if (U(o)) { - let { code: e } = o; - switch (e) { - case `authorization_pending`: - await setTimeout$1(r, { signal: n.signal }); - continue; - case `slow_down`: - r += 5 * 1e3, yield { - _tag: `SlowDown`, - newInterval: r - }, await setTimeout$1(r, { signal: n.signal }); - continue; - default: - yield { - _tag: `Error`, - error: o.cause - }; - return; - } - } - if (o) { - yield { - _tag: `Error`, - error: o - }; - return; - } - k({ - token: s.access_token, - expiresAt: new Date(Date.now() + s.expires_in * 1e3), - refreshToken: s.refresh_token - }); - return; - } - yield { - _tag: `Error`, - error: Error(`Timed out waiting for authentication. Please try again.`) - }; - return; - } finally { - n.abort(); - } -} -var G$1 = class extends Error { - constructor(e) { - super(`HTTP ${e.statusCode}: ${e.responseText}`), this.name = `NotOk`, this.response = e; - } -}; -async function K(e) { - let t = await fetch(`https://vercel.com/api${e.endpoint}`, { - method: e.method, - body: e.body, - headers: { - Authorization: `Bearer ${e.token}`, - "Content-Type": `application/json` - } - }); - if (!t.ok) { - let e = await t.text(); - try { - let { error: t } = JSON.parse(e); - e = `${t.code.toUpperCase()}: ${t.message}`; - } catch {} - throw new G$1({ - responseText: e, - statusCode: t.status - }); - } - return await t.json(); -} -const q = x.pipe(da$1({ - projectId: Mi$1(), - orgId: Mi$1() -})); -async function J(e) { - let t = p$2.join(e, `.vercel`, `project.json`), n; - try { - n = await v$1.readFile(t, `utf-8`); - } catch { - return null; - } - let r = q.safeParse(n); - return r.success ? { - projectId: r.data.projectId, - teamId: r.data.orgId - } : null; -} -const Y = da$1({ user: da$1({ - defaultTeamId: Mi$1().nullable(), - username: Mi$1() -}) }); -const X = da$1({ - id: Mi$1(), - slug: Mi$1(), - updatedAt: Qi$1().optional(), - membership: da$1({ role: Mi$1() }), - billing: da$1({ plan: Mi$1() }) -}); -const re = da$1({ - teams: la$1($$2()).transform((e) => e.flatMap((e) => { - let t = X.safeParse(e); - return t.success ? [t.data] : []; - })), - pagination: da$1({ - count: Qi$1(), - next: Qi$1().nullable() - }) -}); -const Z = `vercel-sandbox-default-project`; -function Q(e) { - return e instanceof G$1 && (e.response.statusCode === 402 || e.response.statusCode === 403); -} -async function ie(e) { - let t = await J(e.cwd ?? process.cwd()); - if (t) { - let n = await ae(e.token, t.teamId, t.projectId); - return { - ...t, - created: !1, - ...n - }; - } - if (e.teamId) return $(e.token, e.teamId); - let { defaultTeamId: n, username: r } = (await K({ - token: e.token, - endpoint: `/v2/user` - }).then(Y.parse)).user; - if (n) try { - let t = await $(e.token, n); - try { - let r = await K({ - token: e.token, - endpoint: `/v2/teams/${encodeURIComponent(n)}` - }).then(da$1({ slug: Mi$1() }).parse); - return { - ...t, - teamSlug: r.slug - }; - } catch { - return t; - } - } catch (e) { - if (!Q(e)) throw e; - } - let a = null; - do { - let t = a === null ? `/v2/teams?limit=20` : `/v2/teams?limit=20&until=${a}`, i = await K({ - token: e.token, - endpoint: t - }).then(re.parse); - a = i.pagination.next; - let o = i.teams.filter((e) => e.membership.role === `OWNER` && e.billing.plan === `hobby`); - if (o.length === 0) continue; - let s = o.find((e) => e.slug === r) ?? o.sort((e, t) => (t.updatedAt ?? 0) - (e.updatedAt ?? 0))[0]; - if (s && s.id !== n) try { - return { - ...await $(e.token, s.id), - teamSlug: s.slug - }; - } catch (e) { - if (!Q(e)) throw e; - } - } while (a !== null); - try { - return { - ...await $(e.token, r), - teamSlug: r - }; - } catch (e) { - if (!Q(e)) throw e; - } - throw new G$1({ - statusCode: 403, - responseText: `Authenticated as "${r}" but none of the available teams allow sandbox creation.` - }); -} -async function $(e, t) { - let n = t.startsWith(`team_`) ? `teamId=${encodeURIComponent(t)}` : `slug=${encodeURIComponent(t)}`, r = !1; - try { - await K({ - token: e, - endpoint: `/v2/projects/vercel-sandbox-default-project?${n}` - }); - } catch (t) { - if (!(t instanceof G$1) || t.response.statusCode !== 404) throw t; - await K({ - token: e, - endpoint: `/v11/projects?${n}`, - method: `POST`, - body: JSON.stringify({ name: Z }) - }), r = !0; - } - return { - projectId: Z, - teamId: t, - created: r - }; -} -async function ae(e, t, n) { - try { - let r = t.startsWith(`team_`) ? `teamId=${encodeURIComponent(t)}` : `slug=${encodeURIComponent(t)}`, [a, o] = await Promise.all([K({ - token: e, - endpoint: `/v2/teams/${encodeURIComponent(t)}` - }).then(da$1({ slug: Mi$1() }).parse), K({ - token: e, - endpoint: `/v2/projects/${encodeURIComponent(n)}?${r}` - }).then(da$1({ name: Mi$1() }).parse)]); - return { - teamSlug: a.slug, - projectSlug: o.name - }; - } catch { - return {}; - } -} -//#endregion -//#region node_modules/eve/dist/src/compiled/_chunks/node/token-ORseRyWn.js -var token_ORseRyWn_exports = /* @__PURE__ */ __exportAll({ default: () => token_ORseRyWn_default }); -var r$3 = c$3(((e, r) => { - var i = Object.defineProperty, a = Object.getOwnPropertyDescriptor, o = Object.getOwnPropertyNames, s = Object.prototype.hasOwnProperty, c = (e, t) => { - for (var n in t) i(e, n, { - get: t[n], - enumerable: !0 - }); - }, l = (e, t, n, r) => { - if (t && typeof t == `object` || typeof t == `function`) for (let c of o(t)) !s.call(e, c) && c !== n && i(e, c, { - get: () => t[c], - enumerable: !(r = a(t, c)) || r.enumerable - }); - return e; - }, u = (e) => l(i({}, `__esModule`, { value: !0 }), e), d = {}; - c(d, { refreshToken: () => m }), r.exports = u(d); - var f = $n(), p = ar(); - async function m(e) { - let t = e?.project, n = e?.team; - if (!t && !n) { - let e = (0, p.findProjectInfo)(); - t = e.projectId, n = e.teamId; - } else if (!t || !n) { - let e = (0, p.findProjectInfo)(); - t ??= e.projectId, n ??= e.teamId; - } - if (!t) throw new f.VercelOidcTokenError("Failed to refresh OIDC token: No project specified. Try re-linking your project with `vc link`"); - let r = (0, p.loadToken)(t); - if (!r || (0, p.isExpired)((0, p.getTokenPayload)(r.token), e?.expirationBufferMs)) { - let i = await (0, p.getVercelToken)({ expirationBufferMs: e?.expirationBufferMs }); - if (r = await (0, p.getVercelOidcToken)(i, t, n), !r) throw new f.VercelOidcTokenError(`Failed to refresh OIDC token`); - (0, p.saveToken)(r, t); - } - process.env.VERCEL_OIDC_TOKEN = r.token; - } -})); -var token_ORseRyWn_default = r$3(); -//#endregion -//#region node_modules/eve/dist/src/compiled/_chunks/workflow/functions-CnVBREsg.js -var functions_CnVBREsg_exports = /* @__PURE__ */ __exportAll({ default: () => functions_CnVBREsg_default }); -var t = c$12(((e, t) => { - var n = Object.defineProperty, r = Object.getOwnPropertyDescriptor, i = Object.getOwnPropertyNames, a = Object.prototype.hasOwnProperty, o = (e, t) => { - for (var r in t) n(e, r, { - get: t[r], - enumerable: !0 - }); - }, s = (e, t, o, s) => { - if (t && typeof t == `object` || typeof t == `function`) for (let c of i(t)) !a.call(e, c) && c !== o && n(e, c, { - get: () => t[c], - enumerable: !(s = r(t, c)) || s.enumerable - }); - return e; - }, c = (e) => s(n({}, `__esModule`, { value: !0 }), e), l = {}; - o(l, { - CITY_HEADER_NAME: () => u, - COUNTRY_HEADER_NAME: () => d, - EMOJI_FLAG_UNICODE_STARTING_POSITION: () => v, - IP_HEADER_NAME: () => f, - LATITUDE_HEADER_NAME: () => p, - LONGITUDE_HEADER_NAME: () => m, - POSTAL_CODE_HEADER_NAME: () => g, - REGION_HEADER_NAME: () => h, - REQUEST_ID_HEADER_NAME: () => _, - geolocation: () => w, - ipAddress: () => S - }), t.exports = c(l); - let u = `x-vercel-ip-city`, d = `x-vercel-ip-country`, f = `x-real-ip`, p = `x-vercel-ip-latitude`, m = `x-vercel-ip-longitude`, h = `x-vercel-ip-country-region`, g = `x-vercel-ip-postal-code`, _ = `x-vercel-id`, v = 127397; - function y(e, t) { - return e.get(t) ?? void 0; - } - function b(e, t) { - let n = y(e.headers, t); - return n ? decodeURIComponent(n) : void 0; - } - function x(e) { - let t = RegExp(`^[A-Z]{2}$`).test(e); - if (!(!e || !t)) return String.fromCodePoint(...e.split(``).map((e) => v + e.charCodeAt(0))); - } - function S(e) { - return y(`headers` in e ? e.headers : e, f); - } - function C(e) { - return e ? e.split(`:`)[0] : `dev1`; - } - function w(e) { - return { - city: b(e, u), - country: y(e.headers, d), - flag: x(y(e.headers, d)), - countryRegion: y(e.headers, h), - region: C(y(e.headers, _)), - latitude: y(e.headers, p), - longitude: y(e.headers, m), - postalCode: y(e.headers, g) - }; - } -})); -var n = c$12(((e, t) => { - var n = Object.defineProperty, r = Object.getOwnPropertyDescriptor, i = Object.getOwnPropertyNames, a = Object.prototype.hasOwnProperty, o = (e, t) => { - for (var r in t) n(e, r, { - get: t[r], - enumerable: !0 - }); - }, s = (e, t, o, s) => { - if (t && typeof t == `object` || typeof t == `function`) for (let c of i(t)) !a.call(e, c) && c !== o && n(e, c, { - get: () => t[c], - enumerable: !(s = r(t, c)) || s.enumerable - }); - return e; - }, c = (e) => s(n({}, `__esModule`, { value: !0 }), e), l = {}; - o(l, { getEnv: () => u }), t.exports = c(l); - let u = (e = process.env) => ({ - VERCEL: d(e, `VERCEL`), - CI: d(e, `CI`), - VERCEL_ENV: d(e, `VERCEL_ENV`), - VERCEL_URL: d(e, `VERCEL_URL`), - VERCEL_BRANCH_URL: d(e, `VERCEL_BRANCH_URL`), - VERCEL_PROJECT_PRODUCTION_URL: d(e, `VERCEL_PROJECT_PRODUCTION_URL`), - VERCEL_REGION: d(e, `VERCEL_REGION`), - VERCEL_DEPLOYMENT_ID: d(e, `VERCEL_DEPLOYMENT_ID`), - VERCEL_SKEW_PROTECTION_ENABLED: d(e, `VERCEL_SKEW_PROTECTION_ENABLED`), - VERCEL_AUTOMATION_BYPASS_SECRET: d(e, `VERCEL_AUTOMATION_BYPASS_SECRET`), - VERCEL_GIT_PROVIDER: d(e, `VERCEL_GIT_PROVIDER`), - VERCEL_GIT_REPO_SLUG: d(e, `VERCEL_GIT_REPO_SLUG`), - VERCEL_GIT_REPO_OWNER: d(e, `VERCEL_GIT_REPO_OWNER`), - VERCEL_GIT_REPO_ID: d(e, `VERCEL_GIT_REPO_ID`), - VERCEL_GIT_COMMIT_REF: d(e, `VERCEL_GIT_COMMIT_REF`), - VERCEL_GIT_COMMIT_SHA: d(e, `VERCEL_GIT_COMMIT_SHA`), - VERCEL_GIT_COMMIT_MESSAGE: d(e, `VERCEL_GIT_COMMIT_MESSAGE`), - VERCEL_GIT_COMMIT_AUTHOR_LOGIN: d(e, `VERCEL_GIT_COMMIT_AUTHOR_LOGIN`), - VERCEL_GIT_COMMIT_AUTHOR_NAME: d(e, `VERCEL_GIT_COMMIT_AUTHOR_NAME`), - VERCEL_GIT_PREVIOUS_SHA: d(e, `VERCEL_GIT_PREVIOUS_SHA`), - VERCEL_GIT_PULL_REQUEST_ID: d(e, `VERCEL_GIT_PULL_REQUEST_ID`) - }), d = (e, t) => { - let n = e[t]; - return n === `` ? void 0 : n; - }; -})); -var r$2 = c$12(((e, t) => { - var n = Object.defineProperty, r = Object.getOwnPropertyDescriptor, i = Object.getOwnPropertyNames, a = Object.prototype.hasOwnProperty, o = (e, t) => { - for (var r in t) n(e, r, { - get: t[r], - enumerable: !0 - }); - }, s = (e, t, o, s) => { - if (t && typeof t == `object` || typeof t == `function`) for (let c of i(t)) !a.call(e, c) && c !== o && n(e, c, { - get: () => t[c], - enumerable: !(s = r(t, c)) || s.enumerable - }); - return e; - }, c = (e) => s(n({}, `__esModule`, { value: !0 }), e), l = {}; - o(l, { - SYMBOL_FOR_REQ_CONTEXT: () => u, - getContext: () => d - }), t.exports = c(l); - let u = Symbol.for(`@vercel/request-context`); - function d() { - return globalThis[u]?.get?.() ?? {}; - } -})); -var i$1 = c$12(((e, t) => { - var n = Object.defineProperty, i = Object.getOwnPropertyDescriptor, a = Object.getOwnPropertyNames, o = Object.prototype.hasOwnProperty, s = (e, t) => { - for (var r in t) n(e, r, { - get: t[r], - enumerable: !0 - }); - }, c = (e, t, r, s) => { - if (t && typeof t == `object` || typeof t == `function`) for (let c of a(t)) !o.call(e, c) && c !== r && n(e, c, { - get: () => t[c], - enumerable: !(s = i(t, c)) || s.enumerable - }); - return e; - }, l = (e) => c(n({}, `__esModule`, { value: !0 }), e), u = {}; - s(u, { waitUntil: () => f }), t.exports = l(u); - var d = r$2(); - let f = (e) => { - if (typeof e != `object` || !e || typeof e.then != `function`) throw TypeError(`waitUntil can only be called with a Promise, got ${typeof e}`); - return (0, d.getContext)().waitUntil?.(e); - }; -})); -var a$1 = c$12(((e, t) => { - var n = Object.defineProperty, r = Object.getOwnPropertyDescriptor, i = Object.getOwnPropertyNames, a = Object.prototype.hasOwnProperty, o = (e, t) => { - for (var r in t) n(e, r, { - get: t[r], - enumerable: !0 - }); - }, s = (e, t, o, s) => { - if (t && typeof t == `object` || typeof t == `function`) for (let c of i(t)) !a.call(e, c) && c !== o && n(e, c, { - get: () => t[c], - enumerable: !(s = r(t, c)) || s.enumerable - }); - return e; - }, c = (e) => s(n({}, `__esModule`, { value: !0 }), e), l = {}; - o(l, { - next: () => f, - rewrite: () => d - }), t.exports = c(l); - function u(e, t) { - if (e?.request?.headers) { - if (!(e.request.headers instanceof Headers)) throw Error(`request.headers must be an instance of Headers`); - let n = []; - for (let [r, i] of e.request.headers) t.set(`x-middleware-request-` + r, i), n.push(r); - t.set(`x-middleware-override-headers`, n.join(`,`)); - } - } - function d(e, t) { - let n = new Headers(t?.headers ?? {}); - return n.set(`x-middleware-rewrite`, String(e)), u(t, n), new Response(null, { - ...t, - headers: n - }); - } - function f(e) { - let t = new Headers(e?.headers ?? {}); - return t.set(`x-middleware-next`, `1`), u(e, t), new Response(null, { - ...e, - headers: t - }); - } -})); -var o$1 = c$12(((e, t) => { - var n = Object.defineProperty, r = Object.getOwnPropertyDescriptor, i = Object.getOwnPropertyNames, a = Object.prototype.hasOwnProperty, o = (e, t) => { - for (var r in t) n(e, r, { - get: t[r], - enumerable: !0 - }); - }, s = (e, t, o, s) => { - if (t && typeof t == `object` || typeof t == `function`) for (let c of i(t)) !a.call(e, c) && c !== o && n(e, c, { - get: () => t[c], - enumerable: !(s = r(t, c)) || s.enumerable - }); - return e; - }, c = (e) => s(n({}, `__esModule`, { value: !0 }), e), l = {}; - o(l, { InMemoryCache: () => u }), t.exports = c(l); - var u = class { - constructor() { - this.cache = {}; - } - async get(e) { - let t = this.cache[e]; - return t ? t.ttl && t.lastModified + t.ttl * 1e3 < Date.now() ? (await this.delete(e), null) : JSON.parse(t.value) : null; - } - async set(e, t, n) { - let r = JSON.stringify(t ?? null); - this.cache[e] = { - value: r, - lastModified: Date.now(), - ttl: n?.ttl, - tags: new Set(n?.tags || []) - }; - } - async delete(e) { - delete this.cache[e]; - } - async expireTag(e) { - let t = Array.isArray(e) ? e : [e]; - for (let e in this.cache) if (Object.prototype.hasOwnProperty.call(this.cache, e)) { - let n = this.cache[e]; - t.some((e) => n.tags.has(e)) && delete this.cache[e]; - } - } - }; -})); -var s$1 = c$12(((e, t) => { - var n = Object.defineProperty, r = Object.getOwnPropertyDescriptor, i = Object.getOwnPropertyNames, a = Object.prototype.hasOwnProperty, o = (e, t) => { - for (var r in t) n(e, r, { - get: t[r], - enumerable: !0 - }); - }, s = (e, t, o, s) => { - if (t && typeof t == `object` || typeof t == `function`) for (let c of i(t)) !a.call(e, c) && c !== o && n(e, c, { - get: () => t[c], - enumerable: !(s = r(t, c)) || s.enumerable - }); - return e; - }, l = (e) => s(n({}, `__esModule`, { value: !0 }), e), u = {}; - o(u, { BuildCache: () => f }), t.exports = l(u); - var d = c$1(), f = class { - constructor({ endpoint: e, headers: t, onError: n, timeout: r = 500 }) { - this.get = async (e) => { - let t = new AbortController(), n = setTimeout(() => t.abort(), this.timeout); - try { - let r = await fetch(`${this.endpoint}${e}`, { - headers: this.headers, - method: `GET`, - signal: t.signal - }); - if (r.status === 404) return clearTimeout(n), null; - if (r.status === 200) { - if (r.headers.get(d.HEADERS_VERCEL_CACHE_STATE) !== d.PkgCacheState.Fresh) return r.body?.cancel?.(), clearTimeout(n), null; - let e = await r.json(); - return clearTimeout(n), e; - } else throw clearTimeout(n), Error(`Failed to get cache: ${r.statusText}`); - } catch (e) { - if (clearTimeout(n), e.name === `AbortError`) { - let t = Error(`Cache request timed out after ${this.timeout}ms`); - t.stack = e.stack, this.onError?.(t); - } else this.onError?.(e); - return null; - } - }, this.set = async (e, t, n) => { - let r = new AbortController(), i = setTimeout(() => r.abort(), this.timeout); - try { - let a = {}; - n?.ttl && (a[d.HEADERS_VERCEL_REVALIDATE] = n.ttl.toString()), n?.tags && n.tags.length > 0 && (a[d.HEADERS_VERCEL_CACHE_TAGS] = n.tags.join(`,`)), n?.name && (a[d.HEADERS_VERCEL_CACHE_ITEM_NAME] = n.name); - let o = await fetch(`${this.endpoint}${e}`, { - method: `POST`, - headers: { - ...this.headers, - ...a - }, - body: JSON.stringify(t), - signal: r.signal - }); - if (clearTimeout(i), o.status !== 200) throw Error(`Failed to set cache: ${o.status} ${o.statusText}`); - } catch (e) { - if (clearTimeout(i), e.name === `AbortError`) { - let t = Error(`Cache request timed out after ${this.timeout}ms`); - t.stack = e.stack, this.onError?.(t); - } else this.onError?.(e); - } - }, this.delete = async (e) => { - let t = new AbortController(), n = setTimeout(() => t.abort(), this.timeout); - try { - let r = await fetch(`${this.endpoint}${e}`, { - method: `DELETE`, - headers: this.headers, - signal: t.signal - }); - if (clearTimeout(n), r.status !== 200) throw Error(`Failed to delete cache: ${r.statusText}`); - } catch (e) { - if (clearTimeout(n), e.name === `AbortError`) { - let t = Error(`Cache request timed out after ${this.timeout}ms`); - t.stack = e.stack, this.onError?.(t); - } else this.onError?.(e); - } - }, this.expireTag = async (e) => { - let t = new AbortController(), n = setTimeout(() => t.abort(), this.timeout); - try { - Array.isArray(e) && (e = e.join(`,`)); - let r = await fetch(`${this.endpoint}revalidate?tags=${e}`, { - method: `POST`, - headers: this.headers, - signal: t.signal - }); - if (clearTimeout(n), r.status !== 200) throw Error(`Failed to revalidate tag: ${r.statusText}`); - } catch (e) { - if (clearTimeout(n), e.name === `AbortError`) { - let t = Error(`Cache request timed out after ${this.timeout}ms`); - t.stack = e.stack, this.onError?.(t); - } else this.onError?.(e); - } - }, this.endpoint = e, this.headers = t, this.onError = n, this.timeout = r; - } - }; -})); -var c$1 = c$12(((e, t) => { - var n = Object.defineProperty, i = Object.getOwnPropertyDescriptor, a = Object.getOwnPropertyNames, c = Object.prototype.hasOwnProperty, l = (e, t) => { - for (var r in t) n(e, r, { - get: t[r], - enumerable: !0 - }); - }, u = (e, t, r, o) => { - if (t && typeof t == `object` || typeof t == `function`) for (let s of a(t)) !c.call(e, s) && s !== r && n(e, s, { - get: () => t[s], - enumerable: !(o = i(t, s)) || o.enumerable - }); - return e; - }, d = (e) => u(n({}, `__esModule`, { value: !0 }), e), f = {}; - l(f, { - HEADERS_VERCEL_CACHE_ITEM_NAME: () => O, - HEADERS_VERCEL_CACHE_STATE: () => T, - HEADERS_VERCEL_CACHE_TAGS: () => D, - HEADERS_VERCEL_REVALIDATE: () => E, - PkgCacheState: () => w, - getCache: () => y - }), t.exports = d(f); - var p = r$2(), m = o$1(), h = s$1(); - let g = (e) => { - let t = 5381; - for (let n = 0; n < e.length; n++) t = t * 33 ^ e.charCodeAt(n); - return (t >>> 0).toString(16); - }, _ = null, v = null, y = (e) => x(() => { - let e; - return e = (0, p.getContext)().cache ? (0, p.getContext)().cache : C(process.env.SUSPENSE_CACHE_DEBUG === `true`), e; - }, b(e)); - function b(e) { - let t = e?.keyHashFunction || g; - return (n) => { - if (!e?.namespace) return t(n); - let r = e.namespaceSeparator || `$`; - return `${e.namespace}${r}${t(n)}`; - }; - } - function x(e, t) { - return { - get: (n) => e().get(t(n)), - set: (n, r, i) => e().set(t(n), r, { - ...i, - name: i?.name ?? n - }), - delete: (n) => e().delete(t(n)), - expireTag: (t) => e().expireTag(t) - }; - } - let S = !1; - function C(e) { - if (_ ||= new m.InMemoryCache(), process.env.RUNTIME_CACHE_DISABLE_BUILD_CACHE === `true`) return e && console.log(`Using InMemoryCache as build cache is disabled`), _; - let { RUNTIME_CACHE_ENDPOINT: t, RUNTIME_CACHE_HEADERS: n } = process.env; - if (e && console.log(`Runtime cache environment variables:`, { - RUNTIME_CACHE_ENDPOINT: t, - RUNTIME_CACHE_HEADERS: n - }), !t || !n) return S ||= (console.warn(`Runtime Cache unavailable in this environment. Falling back to in-memory cache.`), !0), _; - if (!v) { - let e = {}; - try { - e = JSON.parse(n); - } catch (e) { - return console.error(`Failed to parse RUNTIME_CACHE_HEADERS:`, e), _; - } - let r = 500; - if (process.env.RUNTIME_CACHE_TIMEOUT) { - let e = parseInt(process.env.RUNTIME_CACHE_TIMEOUT, 10); - !isNaN(e) && e > 0 ? r = e : console.warn(`Invalid RUNTIME_CACHE_TIMEOUT value: "${process.env.RUNTIME_CACHE_TIMEOUT}". Using default: ${r}ms`); - } - v = new h.BuildCache({ - endpoint: t, - headers: e, - onError: (e) => console.error(e), - timeout: r - }); - } - return v; - } - var w = ((e) => (e.Fresh = `fresh`, e.Stale = `stale`, e.Expired = `expired`, e.NotFound = `notFound`, e.Error = `error`, e))(w || {}); - let T = `x-vercel-cache-state`, E = `x-vercel-revalidate`, D = `x-vercel-cache-tags`, O = `x-vercel-cache-item-name`; -})); -var l$1 = c$12(((e, t) => { - var n = Object.defineProperty, i = Object.getOwnPropertyDescriptor, a = Object.getOwnPropertyNames, o = Object.prototype.hasOwnProperty, s = (e, t) => { - for (var r in t) n(e, r, { - get: t[r], - enumerable: !0 - }); - }, c = (e, t, r, s) => { - if (t && typeof t == `object` || typeof t == `function`) for (let c of a(t)) !o.call(e, c) && c !== r && n(e, c, { - get: () => t[c], - enumerable: !(s = i(t, c)) || s.enumerable - }); - return e; - }, l = (e) => c(n({}, `__esModule`, { value: !0 }), e), u = {}; - s(u, { - attachDatabasePool: () => v, - experimental_attachDatabasePool: () => y - }), t.exports = l(u); - var d = r$2(); - let f = !!process.env.DEBUG; - function p(e) { - if (`options` in e && e.options) { - if (`idleTimeoutMillis` in e.options) return typeof e.options.idleTimeoutMillis == `number` ? e.options.idleTimeoutMillis : 1e4; - if (`maxIdleTimeMS` in e.options) return typeof e.options.maxIdleTimeMS == `number` ? e.options.maxIdleTimeMS : 0; - if (`status` in e) return 5e3; - if (`connect` in e && `execute` in e) return 3e4; - } - if (`config` in e && e.config) { - if (`connectionConfig` in e.config && e.config.connectionConfig) return e.config.connectionConfig.idleTimeout || 6e4; - if (`idleTimeout` in e.config) return typeof e.config.idleTimeout == `number` ? e.config.idleTimeout : 6e4; - } - return `poolTimeout` in e ? typeof e.poolTimeout == `number` ? e.poolTimeout : 6e4 : `idleTimeout` in e ? typeof e.idleTimeout == `number` ? e.idleTimeout : 0 : 1e4; - } - let m = null, h = () => {}, g = Date.now(); - function _(e) { - if (!process.env.VERCEL_URL || !process.env.VERCEL_REGION) return; - m && (clearTimeout(m), h()); - let t = new Promise((e) => { - h = e; - }), n = Math.min(p(e) + 100, Math.max(100, 899e3 - (Date.now() - g))); - m = setTimeout(() => { - h?.(), f && console.log(`Database pool idle timeout reached. Releasing connections.`); - }, n); - let r = (0, d.getContext)(); - r?.waitUntil ? r.waitUntil(t) : console.warn(`Pool release event triggered outside of request scope.`); - } - function v(e) { - if (m && (h?.(), clearTimeout(m)), `on` in e && e.on && `options` in e && `idleTimeoutMillis` in e.options) { - e.on(`release`, () => { - f && console.log(`Client released from pool`), _(e); - }); - return; - } else if (`on` in e && e.on && `config` in e && e.config && `connectionConfig` in e.config) { - e.on(`release`, () => { - f && console.log(`MySQL client released from pool`), _(e); - }); - return; - } else if (`on` in e && e.on && `config` in e && e.config && `idleTimeout` in e.config) { - e.on(`release`, () => { - f && console.log(`MySQL2/MariaDB client released from pool`), _(e); - }); - return; - } - if (`on` in e && e.on && `options` in e && e.options && `maxIdleTimeMS` in e.options) { - e.on(`connectionCheckedOut`, () => { - f && console.log(`MongoDB connection checked out`), _(e); - }); - return; - } - if (`on` in e && e.on && `options` in e && e.options && `socket` in e.options) { - e.on(`end`, () => { - f && console.log(`Redis connection ended`), _(e); - }); - return; - } - throw Error(`Unsupported database pool type`); - } - let y = v; -})); -var u$1 = c$12(((e, t) => { - var n = Object.defineProperty, i = Object.getOwnPropertyDescriptor, a = Object.getOwnPropertyNames, o = Object.prototype.hasOwnProperty, s = (e, t) => { - for (var r in t) n(e, r, { - get: t[r], - enumerable: !0 - }); - }, c = (e, t, r, s) => { - if (t && typeof t == `object` || typeof t == `function`) for (let c of a(t)) !o.call(e, c) && c !== r && n(e, c, { - get: () => t[c], - enumerable: !(s = i(t, c)) || s.enumerable - }); - return e; - }, l = (e) => c(n({}, `__esModule`, { value: !0 }), e), u = {}; - s(u, { - dangerouslyDeleteBySrcImage: () => h, - dangerouslyDeleteByTag: () => p, - invalidateBySrcImage: () => m, - invalidateByTag: () => f - }), t.exports = l(u); - var d = r$2(); - let f = (e) => { - let t = (0, d.getContext)().purge; - return t ? t.invalidateByTag(e) : Promise.resolve(); - }, p = (e, t) => { - let n = (0, d.getContext)().purge; - return n ? n.dangerouslyDeleteByTag(e, t) : Promise.resolve(); - }, m = (e) => { - let t = (0, d.getContext)().purge; - return t ? t.invalidateBySrcImage(e) : Promise.resolve(); - }, h = (e, t) => { - let n = (0, d.getContext)().purge; - return n ? n.dangerouslyDeleteBySrcImage(e, t) : Promise.resolve(); - }; -})); -var d$1 = c$12(((e, t) => { - var n = Object.defineProperty, i = Object.getOwnPropertyDescriptor, a = Object.getOwnPropertyNames, o = Object.prototype.hasOwnProperty, s = (e, t) => { - for (var r in t) n(e, r, { - get: t[r], - enumerable: !0 - }); - }, c = (e, t, r, s) => { - if (t && typeof t == `object` || typeof t == `function`) for (let c of a(t)) !o.call(e, c) && c !== r && n(e, c, { - get: () => t[c], - enumerable: !(s = i(t, c)) || s.enumerable - }); - return e; - }, l = (e) => c(n({}, `__esModule`, { value: !0 }), e), u = {}; - s(u, { addCacheTag: () => f }), t.exports = l(u); - var d = r$2(); - let f = (e) => { - let t = (0, d.getContext)().addCacheTag; - return t ? t(e) : Promise.resolve(); - }; -})); -var f$1 = c$12(((e, t) => { - var n = Object.defineProperty, i = Object.getOwnPropertyDescriptor, a = Object.getOwnPropertyNames, o = Object.prototype.hasOwnProperty, s = (e, t) => { - for (var r in t) n(e, r, { - get: t[r], - enumerable: !0 - }); - }, c = (e, t, r, s) => { - if (t && typeof t == `object` || typeof t == `function`) for (let c of a(t)) !o.call(e, c) && c !== r && n(e, c, { - get: () => t[c], - enumerable: !(s = i(t, c)) || s.enumerable - }); - return e; - }, l = (e) => c(n({}, `__esModule`, { value: !0 }), e), u = {}; - s(u, { experimental_upgradeWebSocket: () => p }), t.exports = l(u); - var d = r$2(); - async function f() { - try { - return (await Promise.resolve().then(() => wrapper_CQmdlFyy_exports)).WebSocketServer; - } catch { - throw Error(`The "ws" package is required for experimental_upgradeWebSocket(). Install it with: npm install ws`); - } - } - async function p(e) { - let t = (0, d.getContext)(); - if (typeof t.upgradeWebSocket != `function`) throw Error(`experimental_upgradeWebSocket is not available in the current runtime environment. This feature requires a Vercel runtime that supports WebSocket upgrades.`); - let n = await f(), { req: r, socket: i, head: a } = t.upgradeWebSocket(), o = new n({ noServer: !0 }), s = await new Promise((e, t) => { - let n = () => { - i.removeListener(`error`, l), i.removeListener(`close`, u); - }, s = (e) => { - if (n(), e instanceof Error) { - t(e); - return; - } - let r = Error(`WebSocket upgrade failed`); - r.cause = e, t(r); - }, c = (t) => { - n(), e(t); - }, l = (e) => s(e), u = () => s(Error(`socket closed before the WebSocket upgrade completed`)); - i.once(`error`, l), i.once(`close`, u); - try { - o.handleUpgrade(r, i, a, c); - } catch (e) { - s(e); - } - }); - try { - await e(s); - } catch (e) { - throw s.close(1011, `WebSocket handler failed`), e; - } - return new Response(null, { status: 204 }); - } -})); -var p$1 = c$12(((e, r) => { - var o = Object.defineProperty, s = Object.getOwnPropertyDescriptor, p = Object.getOwnPropertyNames, m = Object.prototype.hasOwnProperty, h = (e, t) => { - for (var n in t) o(e, n, { - get: t[n], - enumerable: !0 - }); - }, g = (e, t, n, r) => { - if (t && typeof t == `object` || typeof t == `function`) for (let i of p(t)) !m.call(e, i) && i !== n && o(e, i, { - get: () => t[i], - enumerable: !(r = s(t, i)) || r.enumerable - }); - return e; - }, _ = (e) => g(o({}, `__esModule`, { value: !0 }), e), v = {}; - h(v, { - addCacheTag: () => E.addCacheTag, - attachDatabasePool: () => w.attachDatabasePool, - dangerouslyDeleteBySrcImage: () => T.dangerouslyDeleteBySrcImage, - dangerouslyDeleteByTag: () => T.dangerouslyDeleteByTag, - experimental_attachDatabasePool: () => w.experimental_attachDatabasePool, - experimental_upgradeWebSocket: () => D.experimental_upgradeWebSocket, - geolocation: () => y.geolocation, - getCache: () => C.getCache, - getEnv: () => b.getEnv, - invalidateBySrcImage: () => T.invalidateBySrcImage, - invalidateByTag: () => T.invalidateByTag, - ipAddress: () => y.ipAddress, - next: () => S.next, - rewrite: () => S.rewrite, - waitUntil: () => x.waitUntil - }), r.exports = _(v); - var y = t(), b = n(), x = i$1(), S = a$1(), C = c$1(), w = l$1(), T = u$1(), E = d$1(), D = f$1(); -})); -var functions_CnVBREsg_default = p$1(); -//#endregion -//#region node_modules/eve/dist/src/compiled/_chunks/workflow/token-Bm-WLAUB.js -var token_Bm_WLAUB_exports = /* @__PURE__ */ __exportAll({ default: () => token_Bm_WLAUB_default }); -var r$1 = c$12(((e, r) => { - var i = Object.defineProperty, a = Object.getOwnPropertyDescriptor, o = Object.getOwnPropertyNames, s = Object.prototype.hasOwnProperty, c = (e, t) => { - for (var n in t) i(e, n, { - get: t[n], - enumerable: !0 - }); - }, l = (e, t, n, r) => { - if (t && typeof t == `object` || typeof t == `function`) for (let c of o(t)) !s.call(e, c) && c !== n && i(e, c, { - get: () => t[c], - enumerable: !(r = a(t, c)) || r.enumerable - }); - return e; - }, u = (e) => l(i({}, `__esModule`, { value: !0 }), e), d = {}; - c(d, { refreshToken: () => m }), r.exports = u(d); - var f = Iu$1(), p = Hu$1(); - async function m(e) { - let t = e?.project, n = e?.team; - if (!t && !n) { - let e = (0, p.findProjectInfo)(); - t = e.projectId, n = e.teamId; - } else if (!t || !n) { - let e = (0, p.findProjectInfo)(); - t ??= e.projectId, n ??= e.teamId; - } - if (!t) throw new f.VercelOidcTokenError("Failed to refresh OIDC token: No project specified. Try re-linking your project with `vc link`"); - let r = (0, p.loadToken)(t); - if (!r || (0, p.isExpired)((0, p.getTokenPayload)(r.token), e?.expirationBufferMs)) { - let i = await (0, p.getVercelToken)({ expirationBufferMs: e?.expirationBufferMs }); - if (r = await (0, p.getVercelOidcToken)(i, t, n), !r) throw new f.VercelOidcTokenError(`Failed to refresh OIDC token`); - (0, p.saveToken)(r, t); - } - process.env.VERCEL_OIDC_TOKEN = r.token; - } -})); -var token_Bm_WLAUB_default = r$1(); -//#endregion -//#region node_modules/eve/dist/src/compiled/_chunks/workflow/token-J7YP0s9a.js -var token_J7YP0s9a_exports = /* @__PURE__ */ __exportAll({ default: () => token_J7YP0s9a_default }); -var r = c$12(((e, r) => { - var i = Object.defineProperty, a = Object.getOwnPropertyDescriptor, o = Object.getOwnPropertyNames, s = Object.prototype.hasOwnProperty, c = (e, t) => { - for (var n in t) i(e, n, { - get: t[n], - enumerable: !0 - }); - }, l = (e, t, n, r) => { - if (t && typeof t == `object` || typeof t == `function`) for (let c of o(t)) !s.call(e, c) && c !== n && i(e, c, { - get: () => t[c], - enumerable: !(r = a(t, c)) || r.enumerable - }); - return e; - }, u = (e) => l(i({}, `__esModule`, { value: !0 }), e), d = {}; - c(d, { refreshToken: () => m }), r.exports = u(d); - var f = cc$1(), p = mc$1(); - async function m(e) { - let t = e?.project, n = e?.team; - if (!t && !n) { - let e = (0, p.findProjectInfo)(); - t = e.projectId, n = e.teamId; - } else if (!t || !n) { - let e = (0, p.findProjectInfo)(); - t ??= e.projectId, n ??= e.teamId; - } - if (!t) throw new f.VercelOidcTokenError("Failed to refresh OIDC token: No project specified. Try re-linking your project with `vc link`"); - let r = (0, p.loadToken)(t); - if (!r || (0, p.isExpired)((0, p.getTokenPayload)(r.token), e?.expirationBufferMs)) { - let i = await (0, p.getVercelToken)({ expirationBufferMs: e?.expirationBufferMs }); - if (r = await (0, p.getVercelOidcToken)(i, t, n), !r) throw new f.VercelOidcTokenError(`Failed to refresh OIDC token`); - (0, p.saveToken)(r, t); - } - process.env.VERCEL_OIDC_TOKEN = r.token; - } -})); -var token_J7YP0s9a_default = r(); -//#endregion -//#region node_modules/eve/dist/src/compiled/_chunks/workflow/wrapper-CQmdlFyy.js -var wrapper_CQmdlFyy_exports = /* @__PURE__ */ __exportAll({ WebSocketServer: () => v }); -var i = c$12(((e, t) => { - let n = [ - `nodebuffer`, - `arraybuffer`, - `fragments` - ], r = typeof Blob < `u`; - r && n.push(`blob`), t.exports = { - BINARY_TYPES: n, - CLOSE_TIMEOUT: 3e4, - EMPTY_BUFFER: Buffer.alloc(0), - GUID: `258EAFA5-E914-47DA-95CA-C5AB0DC85B11`, - hasBlob: r, - kForOnEventAttribute: Symbol(`kIsForOnEventAttribute`), - kListener: Symbol(`kListener`), - kStatusCode: Symbol(`status-code`), - kWebSocket: Symbol(`websocket`), - NOOP: () => {} - }; -})); -var a = c$12(((e, n) => { - let { EMPTY_BUFFER: r } = i(), a = Buffer[Symbol.species]; - function o(e, t) { - if (e.length === 0) return r; - if (e.length === 1) return e[0]; - let n = Buffer.allocUnsafe(t), i = 0; - for (let t = 0; t < e.length; t++) { - let r = e[t]; - n.set(r, i), i += r.length; - } - return i < t ? new a(n.buffer, n.byteOffset, i) : n; - } - function s(e, t, n, r, i) { - for (let a = 0; a < i; a++) n[r + a] = e[a] ^ t[a & 3]; - } - function c(e, t) { - for (let n = 0; n < e.length; n++) e[n] ^= t[n & 3]; - } - function l(e) { - return e.length === e.buffer.byteLength ? e.buffer : e.buffer.slice(e.byteOffset, e.byteOffset + e.length); - } - function u(e) { - if (u.readOnly = !0, Buffer.isBuffer(e)) return e; - let t; - return e instanceof ArrayBuffer ? t = new a(e) : ArrayBuffer.isView(e) ? t = new a(e.buffer, e.byteOffset, e.byteLength) : (t = Buffer.from(e), u.readOnly = !1), t; - } - if (n.exports = { - concat: o, - mask: s, - toArrayBuffer: l, - toBuffer: u, - unmask: c - }, !process.env.WS_NO_BUFFER_UTIL) try { - let e = f$11(`bufferutil`); - n.exports.mask = function(t, n, r, i, a) { - a < 48 ? s(t, n, r, i, a) : e.mask(t, n, r, i, a); - }, n.exports.unmask = function(t, n) { - t.length < 32 ? c(t, n) : e.unmask(t, n); - }; - } catch {} -})); -var o = c$12(((e, t) => { - let n = Symbol(`kDone`), r = Symbol(`kRun`); - t.exports = class { - constructor(e) { - this[n] = () => { - this.pending--, this[r](); - }, this.concurrency = e || Infinity, this.jobs = [], this.pending = 0; - } - add(e) { - this.jobs.push(e), this[r](); - } - [r]() { - if (this.pending !== this.concurrency && this.jobs.length) { - let e = this.jobs.shift(); - this.pending++, e(this[n]); - } - } - }; -})); -var s = c$12(((e, n) => { - let r = f$11(`zlib`), s = a(), c = o(), { kStatusCode: l } = i(), u = Buffer[Symbol.species], d = Buffer.from([ - 0, - 0, - 255, - 255 - ]), f = Symbol(`permessage-deflate`), p = Symbol(`total-length`), m = Symbol(`callback`), h = Symbol(`buffers`), g = Symbol(`error`), _; - n.exports = class { - constructor(e) { - this._options = e || {}, this._threshold = this._options.threshold === void 0 ? 1024 : this._options.threshold, this._maxPayload = this._options.maxPayload | 0, this._isServer = !!this._options.isServer, this._deflate = null, this._inflate = null, this.params = null, _ ||= new c(this._options.concurrencyLimit === void 0 ? 10 : this._options.concurrencyLimit); - } - static get extensionName() { - return `permessage-deflate`; - } - offer() { - let e = {}; - return this._options.serverNoContextTakeover && (e.server_no_context_takeover = !0), this._options.clientNoContextTakeover && (e.client_no_context_takeover = !0), this._options.serverMaxWindowBits && (e.server_max_window_bits = this._options.serverMaxWindowBits), this._options.clientMaxWindowBits ? e.client_max_window_bits = this._options.clientMaxWindowBits : this._options.clientMaxWindowBits ?? (e.client_max_window_bits = !0), e; - } - accept(e) { - return e = this.normalizeParams(e), this.params = this._isServer ? this.acceptAsServer(e) : this.acceptAsClient(e), this.params; - } - cleanup() { - if (this._inflate &&= (this._inflate.close(), null), this._deflate) { - let e = this._deflate[m]; - this._deflate.close(), this._deflate = null, e && e(Error(`The deflate stream was closed while data was being processed`)); - } - } - acceptAsServer(e) { - let t = this._options, n = e.find((e) => !(t.serverNoContextTakeover === !1 && e.server_no_context_takeover || e.server_max_window_bits && (t.serverMaxWindowBits === !1 || typeof t.serverMaxWindowBits == `number` && t.serverMaxWindowBits > e.server_max_window_bits) || typeof t.clientMaxWindowBits == `number` && !e.client_max_window_bits)); - if (!n) throw Error(`None of the extension offers can be accepted`); - return t.serverNoContextTakeover && (n.server_no_context_takeover = !0), t.clientNoContextTakeover && (n.client_no_context_takeover = !0), typeof t.serverMaxWindowBits == `number` && (n.server_max_window_bits = t.serverMaxWindowBits), typeof t.clientMaxWindowBits == `number` ? n.client_max_window_bits = t.clientMaxWindowBits : (n.client_max_window_bits === !0 || t.clientMaxWindowBits === !1) && delete n.client_max_window_bits, n; - } - acceptAsClient(e) { - let t = e[0]; - if (this._options.clientNoContextTakeover === !1 && t.client_no_context_takeover) throw Error(`Unexpected parameter "client_no_context_takeover"`); - if (!t.client_max_window_bits) typeof this._options.clientMaxWindowBits == `number` && (t.client_max_window_bits = this._options.clientMaxWindowBits); - else if (this._options.clientMaxWindowBits === !1 || typeof this._options.clientMaxWindowBits == `number` && t.client_max_window_bits > this._options.clientMaxWindowBits) throw Error(`Unexpected or invalid parameter "client_max_window_bits"`); - return t; - } - normalizeParams(e) { - return e.forEach((e) => { - Object.keys(e).forEach((t) => { - let n = e[t]; - if (n.length > 1) throw Error(`Parameter "${t}" must have only a single value`); - if (n = n[0], t === `client_max_window_bits`) { - if (n !== !0) { - let e = +n; - if (!Number.isInteger(e) || e < 8 || e > 15) throw TypeError(`Invalid value for parameter "${t}": ${n}`); - n = e; - } else if (!this._isServer) throw TypeError(`Invalid value for parameter "${t}": ${n}`); - } else if (t === `server_max_window_bits`) { - let e = +n; - if (!Number.isInteger(e) || e < 8 || e > 15) throw TypeError(`Invalid value for parameter "${t}": ${n}`); - n = e; - } else if (t === `client_no_context_takeover` || t === `server_no_context_takeover`) { - if (n !== !0) throw TypeError(`Invalid value for parameter "${t}": ${n}`); - } else throw Error(`Unknown parameter "${t}"`); - e[t] = n; - }); - }), e; - } - decompress(e, t, n) { - _.add((r) => { - this._decompress(e, t, (e, t) => { - r(), n(e, t); - }); - }); - } - compress(e, t, n) { - _.add((r) => { - this._compress(e, t, (e, t) => { - r(), n(e, t); - }); - }); - } - _decompress(e, t, n) { - let i = this._isServer ? `client` : `server`; - if (!this._inflate) { - let e = `${i}_max_window_bits`, t = typeof this.params[e] == `number` ? this.params[e] : r.Z_DEFAULT_WINDOWBITS; - this._inflate = r.createInflateRaw({ - ...this._options.zlibInflateOptions, - windowBits: t - }), this._inflate[f] = this, this._inflate[p] = 0, this._inflate[h] = [], this._inflate.on(`error`, b), this._inflate.on(`data`, y); - } - this._inflate[m] = n, this._inflate.write(e), t && this._inflate.write(d), this._inflate.flush(() => { - let e = this._inflate[g]; - if (e) { - this._inflate.close(), this._inflate = null, n(e); - return; - } - let r = s.concat(this._inflate[h], this._inflate[p]); - this._inflate._readableState.endEmitted ? (this._inflate.close(), this._inflate = null) : (this._inflate[p] = 0, this._inflate[h] = [], t && this.params[`${i}_no_context_takeover`] && this._inflate.reset()), n(null, r); - }); - } - _compress(e, t, n) { - let i = this._isServer ? `server` : `client`; - if (!this._deflate) { - let e = `${i}_max_window_bits`, t = typeof this.params[e] == `number` ? this.params[e] : r.Z_DEFAULT_WINDOWBITS; - this._deflate = r.createDeflateRaw({ - ...this._options.zlibDeflateOptions, - windowBits: t - }), this._deflate[p] = 0, this._deflate[h] = [], this._deflate.on(`data`, v); - } - this._deflate[m] = n, this._deflate.write(e), this._deflate.flush(r.Z_SYNC_FLUSH, () => { - if (!this._deflate) return; - let e = s.concat(this._deflate[h], this._deflate[p]); - t && (e = new u(e.buffer, e.byteOffset, e.length - 4)), this._deflate[m] = null, this._deflate[p] = 0, this._deflate[h] = [], t && this.params[`${i}_no_context_takeover`] && this._deflate.reset(), n(null, e); - }); - } - }; - function v(e) { - this[h].push(e), this[p] += e.length; - } - function y(e) { - if (this[p] += e.length, this[f]._maxPayload < 1 || this[p] <= this[f]._maxPayload) { - this[h].push(e); - return; - } - this[g] = RangeError(`Max payload size exceeded`), this[g].code = `WS_ERR_UNSUPPORTED_MESSAGE_LENGTH`, this[g][l] = 1009, this.removeListener(`data`, y), this.reset(); - } - function b(e) { - if (this[f]._inflate = null, this[g]) { - this[m](this[g]); - return; - } - e[l] = 1007, this[m](e); - } -})); -var c = c$12(((e, n) => { - let { isUtf8: r } = f$11(`buffer`), { hasBlob: a } = i(), o = [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 0, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 1, - 1, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 1, - 0, - 1, - 0 - ]; - function s(e) { - return e >= 1e3 && e <= 1014 && e !== 1004 && e !== 1005 && e !== 1006 || e >= 3e3 && e <= 4999; - } - function c(e) { - let t = e.length, n = 0; - for (; n < t;) if (!(e[n] & 128)) n++; - else if ((e[n] & 224) == 192) { - if (n + 1 === t || (e[n + 1] & 192) != 128 || (e[n] & 254) == 192) return !1; - n += 2; - } else if ((e[n] & 240) == 224) { - if (n + 2 >= t || (e[n + 1] & 192) != 128 || (e[n + 2] & 192) != 128 || e[n] === 224 && (e[n + 1] & 224) == 128 || e[n] === 237 && (e[n + 1] & 224) == 160) return !1; - n += 3; - } else if ((e[n] & 248) == 240) { - if (n + 3 >= t || (e[n + 1] & 192) != 128 || (e[n + 2] & 192) != 128 || (e[n + 3] & 192) != 128 || e[n] === 240 && (e[n + 1] & 240) == 128 || e[n] === 244 && e[n + 1] > 143 || e[n] > 244) return !1; - n += 4; - } else return !1; - return !0; - } - function l(e) { - return a && typeof e == `object` && typeof e.arrayBuffer == `function` && typeof e.type == `string` && typeof e.stream == `function` && (e[Symbol.toStringTag] === `Blob` || e[Symbol.toStringTag] === `File`); - } - if (n.exports = { - isBlob: l, - isValidStatusCode: s, - isValidUTF8: c, - tokenChars: o - }, r) n.exports.isValidUTF8 = function(e) { - return e.length < 24 ? c(e) : r(e); - }; - else if (!process.env.WS_NO_UTF_8_VALIDATE) try { - let e = f$11(`utf-8-validate`); - n.exports.isValidUTF8 = function(t) { - return t.length < 32 ? c(t) : e(t); - }; - } catch {} -})); -var l = c$12(((e, n) => { - let { Writable: r } = f$11(`stream`), o = s(), { BINARY_TYPES: l, EMPTY_BUFFER: u, kStatusCode: d, kWebSocket: f } = i(), { concat: p, toArrayBuffer: m, unmask: h } = a(), { isValidStatusCode: g, isValidUTF8: _ } = c(), v = Buffer[Symbol.species]; - n.exports = class extends r { - constructor(e = {}) { - super(), this._allowSynchronousEvents = e.allowSynchronousEvents === void 0 ? !0 : e.allowSynchronousEvents, this._binaryType = e.binaryType || l[0], this._extensions = e.extensions || {}, this._isServer = !!e.isServer, this._maxBufferedChunks = e.maxBufferedChunks | 0, this._maxFragments = e.maxFragments | 0, this._maxPayload = e.maxPayload | 0, this._skipUTF8Validation = !!e.skipUTF8Validation, this[f] = void 0, this._bufferedBytes = 0, this._buffers = [], this._compressed = !1, this._payloadLength = 0, this._mask = void 0, this._fragmented = 0, this._masked = !1, this._fin = !1, this._opcode = 0, this._totalPayloadLength = 0, this._messageLength = 0, this._fragments = [], this._errored = !1, this._loop = !1, this._state = 0; - } - _write(e, t, n) { - if (this._opcode === 8 && this._state == 0) return n(); - if (this._maxBufferedChunks > 0 && this._buffers.length >= this._maxBufferedChunks) { - n(this.createError(RangeError, `Too many buffered chunks`, !1, 1008, `WS_ERR_TOO_MANY_BUFFERED_PARTS`)); - return; - } - this._bufferedBytes += e.length, this._buffers.push(e), this.startLoop(n); - } - consume(e) { - if (this._bufferedBytes -= e, e === this._buffers[0].length) return this._buffers.shift(); - if (e < this._buffers[0].length) { - let t = this._buffers[0]; - return this._buffers[0] = new v(t.buffer, t.byteOffset + e, t.length - e), new v(t.buffer, t.byteOffset, e); - } - let t = Buffer.allocUnsafe(e); - do { - let n = this._buffers[0], r = t.length - e; - e >= n.length ? t.set(this._buffers.shift(), r) : (t.set(new Uint8Array(n.buffer, n.byteOffset, e), r), this._buffers[0] = new v(n.buffer, n.byteOffset + e, n.length - e)), e -= n.length; - } while (e > 0); - return t; - } - startLoop(e) { - this._loop = !0; - do - switch (this._state) { - case 0: - this.getInfo(e); - break; - case 1: - this.getPayloadLength16(e); - break; - case 2: - this.getPayloadLength64(e); - break; - case 3: - this.getMask(); - break; - case 4: - this.getData(e); - break; - case 5: - case 6: - this._loop = !1; - return; - } - while (this._loop); - this._errored || e(); - } - getInfo(e) { - if (this._bufferedBytes < 2) { - this._loop = !1; - return; - } - let t = this.consume(2); - if (t[0] & 48) { - e(this.createError(RangeError, `RSV2 and RSV3 must be clear`, !0, 1002, `WS_ERR_UNEXPECTED_RSV_2_3`)); - return; - } - let n = (t[0] & 64) == 64; - if (n && !this._extensions[o.extensionName]) { - e(this.createError(RangeError, `RSV1 must be clear`, !0, 1002, `WS_ERR_UNEXPECTED_RSV_1`)); - return; - } - if (this._fin = (t[0] & 128) == 128, this._opcode = t[0] & 15, this._payloadLength = t[1] & 127, this._opcode === 0) { - if (n) { - e(this.createError(RangeError, `RSV1 must be clear`, !0, 1002, `WS_ERR_UNEXPECTED_RSV_1`)); - return; - } - if (!this._fragmented) { - e(this.createError(RangeError, `invalid opcode 0`, !0, 1002, `WS_ERR_INVALID_OPCODE`)); - return; - } - this._opcode = this._fragmented; - } else if (this._opcode === 1 || this._opcode === 2) { - if (this._fragmented) { - e(this.createError(RangeError, `invalid opcode ${this._opcode}`, !0, 1002, `WS_ERR_INVALID_OPCODE`)); - return; - } - this._compressed = n; - } else if (this._opcode > 7 && this._opcode < 11) { - if (!this._fin) { - e(this.createError(RangeError, `FIN must be set`, !0, 1002, `WS_ERR_EXPECTED_FIN`)); - return; - } - if (n) { - e(this.createError(RangeError, `RSV1 must be clear`, !0, 1002, `WS_ERR_UNEXPECTED_RSV_1`)); - return; - } - if (this._payloadLength > 125 || this._opcode === 8 && this._payloadLength === 1) { - e(this.createError(RangeError, `invalid payload length ${this._payloadLength}`, !0, 1002, `WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH`)); - return; - } - } else { - e(this.createError(RangeError, `invalid opcode ${this._opcode}`, !0, 1002, `WS_ERR_INVALID_OPCODE`)); - return; - } - if (!this._fin && !this._fragmented && (this._fragmented = this._opcode), this._masked = (t[1] & 128) == 128, this._isServer) { - if (!this._masked) { - e(this.createError(RangeError, `MASK must be set`, !0, 1002, `WS_ERR_EXPECTED_MASK`)); - return; - } - } else if (this._masked) { - e(this.createError(RangeError, `MASK must be clear`, !0, 1002, `WS_ERR_UNEXPECTED_MASK`)); - return; - } - this._payloadLength === 126 ? this._state = 1 : this._payloadLength === 127 ? this._state = 2 : this.haveLength(e); - } - getPayloadLength16(e) { - if (this._bufferedBytes < 2) { - this._loop = !1; - return; - } - this._payloadLength = this.consume(2).readUInt16BE(0), this.haveLength(e); - } - getPayloadLength64(e) { - if (this._bufferedBytes < 8) { - this._loop = !1; - return; - } - let t = this.consume(8), n = t.readUInt32BE(0); - if (n > 2 ** 21 - 1) { - e(this.createError(RangeError, `Unsupported WebSocket frame: payload length > 2^53 - 1`, !1, 1009, `WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH`)); - return; - } - this._payloadLength = n * 2 ** 32 + t.readUInt32BE(4), this.haveLength(e); - } - haveLength(e) { - if (this._payloadLength && this._opcode < 8 && (this._totalPayloadLength += this._payloadLength, this._totalPayloadLength > this._maxPayload && this._maxPayload > 0)) { - e(this.createError(RangeError, `Max payload size exceeded`, !1, 1009, `WS_ERR_UNSUPPORTED_MESSAGE_LENGTH`)); - return; - } - this._masked ? this._state = 3 : this._state = 4; - } - getMask() { - if (this._bufferedBytes < 4) { - this._loop = !1; - return; - } - this._mask = this.consume(4), this._state = 4; - } - getData(e) { - let t = u; - if (this._payloadLength) { - if (this._bufferedBytes < this._payloadLength) { - this._loop = !1; - return; - } - t = this.consume(this._payloadLength), this._masked && (this._mask[0] | this._mask[1] | this._mask[2] | this._mask[3]) !== 0 && h(t, this._mask); - } - if (this._opcode > 7) { - this.controlMessage(t, e); - return; - } - if (this._compressed) { - this._state = 5, this.decompress(t, e); - return; - } - if (t.length) { - if (this._maxFragments > 0 && this._fragments.length >= this._maxFragments) { - e(this.createError(RangeError, `Too many message fragments`, !1, 1008, `WS_ERR_TOO_MANY_BUFFERED_PARTS`)); - return; - } - this._messageLength = this._totalPayloadLength, this._fragments.push(t); - } - this.dataMessage(e); - } - decompress(e, t) { - this._extensions[o.extensionName].decompress(e, this._fin, (e, n) => { - if (e) return t(e); - if (n.length) { - if (this._messageLength += n.length, this._messageLength > this._maxPayload && this._maxPayload > 0) { - t(this.createError(RangeError, `Max payload size exceeded`, !1, 1009, `WS_ERR_UNSUPPORTED_MESSAGE_LENGTH`)); - return; - } - if (this._maxFragments > 0 && this._fragments.length >= this._maxFragments) { - t(this.createError(RangeError, `Too many message fragments`, !1, 1008, `WS_ERR_TOO_MANY_BUFFERED_PARTS`)); - return; - } - this._fragments.push(n); - } - this.dataMessage(t), this._state === 0 && this.startLoop(t); - }); - } - dataMessage(e) { - if (!this._fin) { - this._state = 0; - return; - } - let t = this._messageLength, n = this._fragments; - if (this._totalPayloadLength = 0, this._messageLength = 0, this._fragmented = 0, this._fragments = [], this._opcode === 2) { - let r; - r = this._binaryType === `nodebuffer` ? p(n, t) : this._binaryType === `arraybuffer` ? m(p(n, t)) : this._binaryType === `blob` ? new Blob(n) : n, this._allowSynchronousEvents ? (this.emit(`message`, r, !0), this._state = 0) : (this._state = 6, setImmediate(() => { - this.emit(`message`, r, !0), this._state = 0, this.startLoop(e); - })); - } else { - let r = p(n, t); - if (!this._skipUTF8Validation && !_(r)) { - e(this.createError(Error, `invalid UTF-8 sequence`, !0, 1007, `WS_ERR_INVALID_UTF8`)); - return; - } - this._state === 5 || this._allowSynchronousEvents ? (this.emit(`message`, r, !1), this._state = 0) : (this._state = 6, setImmediate(() => { - this.emit(`message`, r, !1), this._state = 0, this.startLoop(e); - })); - } - } - controlMessage(e, t) { - if (this._opcode === 8) { - if (e.length === 0) this._loop = !1, this.emit(`conclude`, 1005, u), this.end(); - else { - let n = e.readUInt16BE(0); - if (!g(n)) { - t(this.createError(RangeError, `invalid status code ${n}`, !0, 1002, `WS_ERR_INVALID_CLOSE_CODE`)); - return; - } - let r = new v(e.buffer, e.byteOffset + 2, e.length - 2); - if (!this._skipUTF8Validation && !_(r)) { - t(this.createError(Error, `invalid UTF-8 sequence`, !0, 1007, `WS_ERR_INVALID_UTF8`)); - return; - } - this._loop = !1, this.emit(`conclude`, n, r), this.end(); - } - this._state = 0; - return; - } - this._allowSynchronousEvents ? (this.emit(this._opcode === 9 ? `ping` : `pong`, e), this._state = 0) : (this._state = 6, setImmediate(() => { - this.emit(this._opcode === 9 ? `ping` : `pong`, e), this._state = 0, this.startLoop(t); - })); - } - createError(e, t, n, r, i) { - this._loop = !1, this._errored = !0; - let a = new e(n ? `Invalid WebSocket frame: ${t}` : t); - return Error.captureStackTrace(a, this.createError), a.code = i, a[d] = r, a; - } - }; -})); -var u = c$12(((e, n) => { - let { Duplex: r } = f$11(`stream`), { randomFillSync: o } = f$11(`crypto`), { types: { isUint8Array: l } } = f$11(`util`), u = s(), { EMPTY_BUFFER: d, kWebSocket: f, NOOP: p } = i(), { isBlob: m, isValidStatusCode: h } = c(), { mask: g, toBuffer: _ } = a(), v = Symbol(`kByteLength`), y = Buffer.alloc(4), b = 8 * 1024, x, S = b; - n.exports = class e { - constructor(e, t, n) { - this._extensions = t || {}, n && (this._generateMask = n, this._maskBuffer = Buffer.alloc(4)), this._socket = e, this._firstFragment = !0, this._compress = !1, this._bufferedBytes = 0, this._queue = [], this._state = 0, this.onerror = p, this[f] = void 0; - } - static frame(e, t) { - let n, r = !1, i = 2, a = !1; - t.mask && (n = t.maskBuffer || y, t.generateMask ? t.generateMask(n) : (S === b && (x === void 0 && (x = Buffer.alloc(b)), o(x, 0, b), S = 0), n[0] = x[S++], n[1] = x[S++], n[2] = x[S++], n[3] = x[S++]), a = (n[0] | n[1] | n[2] | n[3]) === 0, i = 6); - let s; - typeof e == `string` ? (!t.mask || a) && t[v] !== void 0 ? s = t[v] : (e = Buffer.from(e), s = e.length) : (s = e.length, r = t.mask && t.readOnly && !a); - let c = s; - s >= 65536 ? (i += 8, c = 127) : s > 125 && (i += 2, c = 126); - let l = Buffer.allocUnsafe(r ? s + i : i); - return l[0] = t.fin ? t.opcode | 128 : t.opcode, t.rsv1 && (l[0] |= 64), l[1] = c, c === 126 ? l.writeUInt16BE(s, 2) : c === 127 && (l[2] = l[3] = 0, l.writeUIntBE(s, 4, 6)), !t.mask || (l[1] |= 128, l[i - 4] = n[0], l[i - 3] = n[1], l[i - 2] = n[2], l[i - 1] = n[3], a) ? [l, e] : r ? (g(e, n, l, i, s), [l]) : (g(e, n, e, 0, s), [l, e]); - } - close(t, n, r, i) { - let a; - if (t === void 0) a = d; - else if (typeof t != `number` || !h(t)) throw TypeError(`First argument must be a valid error code number`); - else if (n === void 0 || !n.length) a = Buffer.allocUnsafe(2), a.writeUInt16BE(t, 0); - else { - let e = Buffer.byteLength(n); - if (e > 123) throw RangeError(`The message must not be greater than 123 bytes`); - if (a = Buffer.allocUnsafe(2 + e), a.writeUInt16BE(t, 0), typeof n == `string`) a.write(n, 2); - else if (l(n)) a.set(n, 2); - else throw TypeError(`Second argument must be a string or a Uint8Array`); - } - let o = { - [v]: a.length, - fin: !0, - generateMask: this._generateMask, - mask: r, - maskBuffer: this._maskBuffer, - opcode: 8, - readOnly: !1, - rsv1: !1 - }; - this._state === 0 ? this.sendFrame(e.frame(a, o), i) : this.enqueue([ - this.dispatch, - a, - !1, - o, - i - ]); - } - ping(t, n, r) { - let i, a; - if (typeof t == `string` ? (i = Buffer.byteLength(t), a = !1) : m(t) ? (i = t.size, a = !1) : (t = _(t), i = t.length, a = _.readOnly), i > 125) throw RangeError(`The data size must not be greater than 125 bytes`); - let o = { - [v]: i, - fin: !0, - generateMask: this._generateMask, - mask: n, - maskBuffer: this._maskBuffer, - opcode: 9, - readOnly: a, - rsv1: !1 - }; - m(t) ? this._state === 0 ? this.getBlobData(t, !1, o, r) : this.enqueue([ - this.getBlobData, - t, - !1, - o, - r - ]) : this._state === 0 ? this.sendFrame(e.frame(t, o), r) : this.enqueue([ - this.dispatch, - t, - !1, - o, - r - ]); - } - pong(t, n, r) { - let i, a; - if (typeof t == `string` ? (i = Buffer.byteLength(t), a = !1) : m(t) ? (i = t.size, a = !1) : (t = _(t), i = t.length, a = _.readOnly), i > 125) throw RangeError(`The data size must not be greater than 125 bytes`); - let o = { - [v]: i, - fin: !0, - generateMask: this._generateMask, - mask: n, - maskBuffer: this._maskBuffer, - opcode: 10, - readOnly: a, - rsv1: !1 - }; - m(t) ? this._state === 0 ? this.getBlobData(t, !1, o, r) : this.enqueue([ - this.getBlobData, - t, - !1, - o, - r - ]) : this._state === 0 ? this.sendFrame(e.frame(t, o), r) : this.enqueue([ - this.dispatch, - t, - !1, - o, - r - ]); - } - send(e, t, n) { - let r = this._extensions[u.extensionName], i = t.binary ? 2 : 1, a = t.compress, o, s; - typeof e == `string` ? (o = Buffer.byteLength(e), s = !1) : m(e) ? (o = e.size, s = !1) : (e = _(e), o = e.length, s = _.readOnly), this._firstFragment ? (this._firstFragment = !1, a && r && r.params[r._isServer ? `server_no_context_takeover` : `client_no_context_takeover`] && (a = o >= r._threshold), this._compress = a) : (a = !1, i = 0), t.fin && (this._firstFragment = !0); - let c = { - [v]: o, - fin: t.fin, - generateMask: this._generateMask, - mask: t.mask, - maskBuffer: this._maskBuffer, - opcode: i, - readOnly: s, - rsv1: a - }; - m(e) ? this._state === 0 ? this.getBlobData(e, this._compress, c, n) : this.enqueue([ - this.getBlobData, - e, - this._compress, - c, - n - ]) : this._state === 0 ? this.dispatch(e, this._compress, c, n) : this.enqueue([ - this.dispatch, - e, - this._compress, - c, - n - ]); - } - getBlobData(t, n, r, i) { - this._bufferedBytes += r[v], this._state = 2, t.arrayBuffer().then((t) => { - if (this._socket.destroyed) { - let e = Error(`The socket was closed while the blob was being read`); - process.nextTick(C, this, e, i); - return; - } - this._bufferedBytes -= r[v]; - let a = _(t); - n ? this.dispatch(a, n, r, i) : (this._state = 0, this.sendFrame(e.frame(a, r), i), this.dequeue()); - }).catch((e) => { - process.nextTick(w, this, e, i); - }); - } - dispatch(t, n, r, i) { - if (!n) { - this.sendFrame(e.frame(t, r), i); - return; - } - let a = this._extensions[u.extensionName]; - this._bufferedBytes += r[v], this._state = 1, a.compress(t, r.fin, (t, n) => { - if (this._socket.destroyed) { - let e = Error(`The socket was closed while data was being compressed`); - C(this, e, i); - return; - } - this._bufferedBytes -= r[v], this._state = 0, r.readOnly = !1, this.sendFrame(e.frame(n, r), i), this.dequeue(); - }); - } - dequeue() { - for (; this._state === 0 && this._queue.length;) { - let e = this._queue.shift(); - this._bufferedBytes -= e[3][v], Reflect.apply(e[0], this, e.slice(1)); - } - } - enqueue(e) { - this._bufferedBytes += e[3][v], this._queue.push(e); - } - sendFrame(e, t) { - e.length === 2 ? (this._socket.cork(), this._socket.write(e[0]), this._socket.write(e[1], t), this._socket.uncork()) : this._socket.write(e[0], t); - } - }; - function C(e, t, n) { - typeof n == `function` && n(t); - for (let n = 0; n < e._queue.length; n++) { - let r = e._queue[n], i = r[r.length - 1]; - typeof i == `function` && i(t); - } - } - function w(e, t, n) { - C(e, t, n), e.onerror(t); - } -})); -var d = c$12(((e, t) => { - let { kForOnEventAttribute: n, kListener: r } = i(), a = Symbol(`kCode`), o = Symbol(`kData`), s = Symbol(`kError`), c = Symbol(`kMessage`), l = Symbol(`kReason`), u = Symbol(`kTarget`), d = Symbol(`kType`), f = Symbol(`kWasClean`); - var p = class { - constructor(e) { - this[u] = null, this[d] = e; - } - get target() { - return this[u]; - } - get type() { - return this[d]; - } - }; - Object.defineProperty(p.prototype, "target", { enumerable: !0 }), Object.defineProperty(p.prototype, "type", { enumerable: !0 }); - var m = class extends p { - constructor(e, t = {}) { - super(e), this[a] = t.code === void 0 ? 0 : t.code, this[l] = t.reason === void 0 ? `` : t.reason, this[f] = t.wasClean === void 0 ? !1 : t.wasClean; - } - get code() { - return this[a]; - } - get reason() { - return this[l]; - } - get wasClean() { - return this[f]; - } - }; - Object.defineProperty(m.prototype, "code", { enumerable: !0 }), Object.defineProperty(m.prototype, "reason", { enumerable: !0 }), Object.defineProperty(m.prototype, "wasClean", { enumerable: !0 }); - var h = class extends p { - constructor(e, t = {}) { - super(e), this[s] = t.error === void 0 ? null : t.error, this[c] = t.message === void 0 ? `` : t.message; - } - get error() { - return this[s]; - } - get message() { - return this[c]; - } - }; - Object.defineProperty(h.prototype, "error", { enumerable: !0 }), Object.defineProperty(h.prototype, "message", { enumerable: !0 }); - var g = class extends p { - constructor(e, t = {}) { - super(e), this[o] = t.data === void 0 ? null : t.data; - } - get data() { - return this[o]; - } - }; - Object.defineProperty(g.prototype, "data", { enumerable: !0 }), t.exports = { - CloseEvent: m, - ErrorEvent: h, - Event: p, - EventTarget: { - addEventListener(e, t, i = {}) { - for (let a of this.listeners(e)) if (!i[n] && a[r] === t && !a[n]) return; - let a; - if (e === `message`) a = function(e, n) { - let r = new g(`message`, { data: n ? e : e.toString() }); - r[u] = this, _(t, this, r); - }; - else if (e === `close`) a = function(e, n) { - let r = new m(`close`, { - code: e, - reason: n.toString(), - wasClean: this._closeFrameReceived && this._closeFrameSent - }); - r[u] = this, _(t, this, r); - }; - else if (e === `error`) a = function(e) { - let n = new h(`error`, { - error: e, - message: e.message - }); - n[u] = this, _(t, this, n); - }; - else if (e === `open`) a = function() { - let e = new p(`open`); - e[u] = this, _(t, this, e); - }; - else return; - a[n] = !!i[n], a[r] = t, i.once ? this.once(e, a) : this.on(e, a); - }, - removeEventListener(e, t) { - for (let i of this.listeners(e)) if (i[r] === t && !i[n]) { - this.removeListener(e, i); - break; - } - } - }, - MessageEvent: g - }; - function _(e, t, n) { - typeof e == `object` && e.handleEvent ? e.handleEvent.call(e, n) : e.call(t, n); - } -})); -var f = c$12(((e, t) => { - let { tokenChars: n } = c(); - function r(e, t, n) { - e[t] === void 0 ? e[t] = [n] : e[t].push(n); - } - function i(e) { - let t = Object.create(null), i = Object.create(null), a = !1, o = !1, s = !1, c, l, u = -1, d = -1, f = -1, p = 0; - for (; p < e.length; p++) if (d = e.charCodeAt(p), c === void 0) if (f === -1 && n[d] === 1) u === -1 && (u = p); - else if (p !== 0 && (d === 32 || d === 9)) f === -1 && u !== -1 && (f = p); - else if (d === 59 || d === 44) { - if (u === -1) throw SyntaxError(`Unexpected character at index ${p}`); - f === -1 && (f = p); - let n = e.slice(u, f); - d === 44 ? (r(t, n, i), i = Object.create(null)) : c = n, u = f = -1; - } else throw SyntaxError(`Unexpected character at index ${p}`); - else if (l === void 0) if (f === -1 && n[d] === 1) u === -1 && (u = p); - else if (d === 32 || d === 9) f === -1 && u !== -1 && (f = p); - else if (d === 59 || d === 44) { - if (u === -1) throw SyntaxError(`Unexpected character at index ${p}`); - f === -1 && (f = p), r(i, e.slice(u, f), !0), d === 44 && (r(t, c, i), i = Object.create(null), c = void 0), u = f = -1; - } else if (d === 61 && u !== -1 && f === -1) l = e.slice(u, p), u = f = -1; - else throw SyntaxError(`Unexpected character at index ${p}`); - else if (o) { - if (n[d] !== 1) throw SyntaxError(`Unexpected character at index ${p}`); - u === -1 ? u = p : a ||= !0, o = !1; - } else if (s) if (n[d] === 1) u === -1 && (u = p); - else if (d === 34 && u !== -1) s = !1, f = p; - else if (d === 92) o = !0; - else throw SyntaxError(`Unexpected character at index ${p}`); - else if (d === 34 && e.charCodeAt(p - 1) === 61) s = !0; - else if (f === -1 && n[d] === 1) u === -1 && (u = p); - else if (u !== -1 && (d === 32 || d === 9)) f === -1 && (f = p); - else if (d === 59 || d === 44) { - if (u === -1) throw SyntaxError(`Unexpected character at index ${p}`); - f === -1 && (f = p); - let n = e.slice(u, f); - a &&= (n = n.replace(/\\/g, ``), !1), r(i, l, n), d === 44 && (r(t, c, i), i = Object.create(null), c = void 0), l = void 0, u = f = -1; - } else throw SyntaxError(`Unexpected character at index ${p}`); - if (u === -1 || s || d === 32 || d === 9) throw SyntaxError(`Unexpected end of input`); - f === -1 && (f = p); - let m = e.slice(u, f); - return c === void 0 ? r(t, m, i) : (l === void 0 ? r(i, m, !0) : a ? r(i, l, m.replace(/\\/g, ``)) : r(i, l, m), r(t, c, i)), t; - } - function a(e) { - return Object.keys(e).map((t) => { - let n = e[t]; - return Array.isArray(n) || (n = [n]), n.map((e) => [t].concat(Object.keys(e).map((t) => { - let n = e[t]; - return Array.isArray(n) || (n = [n]), n.map((e) => e === !0 ? t : `${t}=${e}`).join(`; `); - })).join(`; `)).join(`, `); - }).join(`, `); - } - t.exports = { - format: a, - parse: i - }; -})); -var p = c$12(((e, n) => { - let r = f$11(`events`), o = f$11(`https`), p = f$11(`http`), m = f$11(`net`), h = f$11(`tls`), { randomBytes: g, createHash: _ } = f$11(`crypto`), { Duplex: v, Readable: y } = f$11(`stream`), { URL: b } = f$11(`url`), x = s(), S = l(), C = u(), { isBlob: w } = c(), { BINARY_TYPES: T, CLOSE_TIMEOUT: E, EMPTY_BUFFER: D, GUID: O, kForOnEventAttribute: k, kListener: A, kStatusCode: j, kWebSocket: M, NOOP: N } = i(), { EventTarget: { addEventListener: ee, removeEventListener: te } } = d(), { format: P, parse: F } = f(), { toBuffer: I } = a(), L = Symbol(`kAborted`), R = [8, 13], z = [ - `CONNECTING`, - `OPEN`, - `CLOSING`, - `CLOSED` - ], B = /^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/; - var V = class e extends r { - constructor(t, n, r) { - super(), this._binaryType = T[0], this._closeCode = 1006, this._closeFrameReceived = !1, this._closeFrameSent = !1, this._closeMessage = D, this._closeTimer = null, this._errorEmitted = !1, this._extensions = {}, this._paused = !1, this._protocol = ``, this._readyState = e.CONNECTING, this._receiver = null, this._sender = null, this._socket = null, t === null ? (this._autoPong = r.autoPong, this._closeTimeout = r.closeTimeout, this._isServer = !0) : (this._bufferedAmount = 0, this._isServer = !1, this._redirects = 0, n === void 0 ? n = [] : Array.isArray(n) || (typeof n == `object` && n ? (r = n, n = []) : n = [n]), H(this, t, n, r)); - } - get binaryType() { - return this._binaryType; - } - set binaryType(e) { - T.includes(e) && (this._binaryType = e, this._receiver && (this._receiver._binaryType = e)); - } - get bufferedAmount() { - return this._socket ? this._socket._writableState.length + this._sender._bufferedBytes : this._bufferedAmount; - } - get extensions() { - return Object.keys(this._extensions).join(); - } - get isPaused() { - return this._paused; - } - get onclose() { - return null; - } - get onerror() { - return null; - } - get onopen() { - return null; - } - get onmessage() { - return null; - } - get protocol() { - return this._protocol; - } - get readyState() { - return this._readyState; - } - get url() { - return this._url; - } - setSocket(t, n, r) { - let i = new S({ - allowSynchronousEvents: r.allowSynchronousEvents, - binaryType: this.binaryType, - extensions: this._extensions, - isServer: this._isServer, - maxBufferedChunks: r.maxBufferedChunks, - maxFragments: r.maxFragments, - maxPayload: r.maxPayload, - skipUTF8Validation: r.skipUTF8Validation - }), a = new C(t, this._extensions, r.generateMask); - this._receiver = i, this._sender = a, this._socket = t, i[M] = this, a[M] = this, t[M] = this, i.on(`conclude`, re), i.on(`drain`, ie), i.on(`error`, ae), i.on(`message`, oe), i.on(`ping`, se), i.on(`pong`, ce), a.onerror = le, t.setTimeout && t.setTimeout(0), t.setNoDelay && t.setNoDelay(), n.length > 0 && t.unshift(n), t.on(`close`, X), t.on(`data`, Z), t.on(`end`, Q), t.on(`error`, $), this._readyState = e.OPEN, this.emit(`open`); - } - emitClose() { - if (!this._socket) { - this._readyState = e.CLOSED, this.emit(`close`, this._closeCode, this._closeMessage); - return; - } - this._extensions[x.extensionName] && this._extensions[x.extensionName].cleanup(), this._receiver.removeAllListeners(), this._readyState = e.CLOSED, this.emit(`close`, this._closeCode, this._closeMessage); - } - close(t, n) { - if (this.readyState !== e.CLOSED) { - if (this.readyState === e.CONNECTING) { - G(this, this._req, `WebSocket was closed before the connection was established`); - return; - } - if (this.readyState === e.CLOSING) { - this._closeFrameSent && (this._closeFrameReceived || this._receiver._writableState.errorEmitted) && this._socket.end(); - return; - } - this._readyState = e.CLOSING, this._sender.close(t, n, !this._isServer, (e) => { - e || (this._closeFrameSent = !0, (this._closeFrameReceived || this._receiver._writableState.errorEmitted) && this._socket.end()); - }), Y(this); - } - } - pause() { - this.readyState === e.CONNECTING || this.readyState === e.CLOSED || (this._paused = !0, this._socket.pause()); - } - ping(t, n, r) { - if (this.readyState === e.CONNECTING) throw Error(`WebSocket is not open: readyState 0 (CONNECTING)`); - if (typeof t == `function` ? (r = t, t = n = void 0) : typeof n == `function` && (r = n, n = void 0), typeof t == `number` && (t = t.toString()), this.readyState !== e.OPEN) { - K(this, t, r); - return; - } - n === void 0 && (n = !this._isServer), this._sender.ping(t || D, n, r); - } - pong(t, n, r) { - if (this.readyState === e.CONNECTING) throw Error(`WebSocket is not open: readyState 0 (CONNECTING)`); - if (typeof t == `function` ? (r = t, t = n = void 0) : typeof n == `function` && (r = n, n = void 0), typeof t == `number` && (t = t.toString()), this.readyState !== e.OPEN) { - K(this, t, r); - return; - } - n === void 0 && (n = !this._isServer), this._sender.pong(t || D, n, r); - } - resume() { - this.readyState === e.CONNECTING || this.readyState === e.CLOSED || (this._paused = !1, this._receiver._writableState.needDrain || this._socket.resume()); - } - send(t, n, r) { - if (this.readyState === e.CONNECTING) throw Error(`WebSocket is not open: readyState 0 (CONNECTING)`); - if (typeof n == `function` && (r = n, n = {}), typeof t == `number` && (t = t.toString()), this.readyState !== e.OPEN) { - K(this, t, r); - return; - } - let i = { - binary: typeof t != `string`, - mask: !this._isServer, - compress: !0, - fin: !0, - ...n - }; - this._extensions[x.extensionName] || (i.compress = !1), this._sender.send(t || D, i, r); - } - terminate() { - if (this.readyState !== e.CLOSED) { - if (this.readyState === e.CONNECTING) { - G(this, this._req, `WebSocket was closed before the connection was established`); - return; - } - this._socket && (this._readyState = e.CLOSING, this._socket.destroy()); - } - } - }; - Object.defineProperty(V, "CONNECTING", { - enumerable: !0, - value: z.indexOf(`CONNECTING`) - }), Object.defineProperty(V.prototype, "CONNECTING", { - enumerable: !0, - value: z.indexOf(`CONNECTING`) - }), Object.defineProperty(V, "OPEN", { - enumerable: !0, - value: z.indexOf(`OPEN`) - }), Object.defineProperty(V.prototype, "OPEN", { - enumerable: !0, - value: z.indexOf(`OPEN`) - }), Object.defineProperty(V, "CLOSING", { - enumerable: !0, - value: z.indexOf(`CLOSING`) - }), Object.defineProperty(V.prototype, "CLOSING", { - enumerable: !0, - value: z.indexOf(`CLOSING`) - }), Object.defineProperty(V, "CLOSED", { - enumerable: !0, - value: z.indexOf(`CLOSED`) - }), Object.defineProperty(V.prototype, "CLOSED", { - enumerable: !0, - value: z.indexOf(`CLOSED`) - }), [ - `binaryType`, - `bufferedAmount`, - `extensions`, - `isPaused`, - `protocol`, - `readyState`, - `url` - ].forEach((e) => { - Object.defineProperty(V.prototype, e, { enumerable: !0 }); - }), [ - `open`, - `error`, - `close`, - `message` - ].forEach((e) => { - Object.defineProperty(V.prototype, `on${e}`, { - enumerable: !0, - get() { - for (let t of this.listeners(e)) if (t[k]) return t[A]; - return null; - }, - set(t) { - for (let t of this.listeners(e)) if (t[k]) { - this.removeListener(e, t); - break; - } - typeof t == `function` && this.addEventListener(e, t, { [k]: !0 }); - } - }); - }), V.prototype.addEventListener = ee, V.prototype.removeEventListener = te, n.exports = V; - function H(e, t, n, r) { - let i = { - allowSynchronousEvents: !0, - autoPong: !0, - closeTimeout: E, - protocolVersion: R[1], - maxBufferedChunks: 1024 * 1024, - maxFragments: 128 * 1024, - maxPayload: 100 * 1024 * 1024, - skipUTF8Validation: !1, - perMessageDeflate: !0, - followRedirects: !1, - maxRedirects: 10, - ...r, - socketPath: void 0, - hostname: void 0, - protocol: void 0, - timeout: void 0, - method: `GET`, - host: void 0, - path: void 0, - port: void 0 - }; - if (e._autoPong = i.autoPong, e._closeTimeout = i.closeTimeout, !R.includes(i.protocolVersion)) throw RangeError(`Unsupported protocol version: ${i.protocolVersion} (supported versions: ${R.join(`, `)})`); - let a; - if (t instanceof b) a = t; - else try { - a = new b(t); - } catch { - throw SyntaxError(`Invalid URL: ${t}`); - } - a.protocol === `http:` ? a.protocol = `ws:` : a.protocol === `https:` && (a.protocol = `wss:`), e._url = a.href; - let s = a.protocol === `wss:`, c = a.protocol === `ws+unix:`, l; - if (a.protocol !== `ws:` && !s && !c ? l = `The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"` : c && !a.pathname ? l = `The URL's pathname is empty` : a.hash && (l = `The URL contains a fragment identifier`), l) { - let t = SyntaxError(l); - if (e._redirects === 0) throw t; - U(e, t); - return; - } - let u = s ? 443 : 80, d = g(16).toString(`base64`), f = s ? o.request : p.request, m = /* @__PURE__ */ new Set(), h; - if (i.createConnection = i.createConnection || (s ? ne : W), i.defaultPort = i.defaultPort || u, i.port = a.port || u, i.host = a.hostname.startsWith(`[`) ? a.hostname.slice(1, -1) : a.hostname, i.headers = { - ...i.headers, - "Sec-WebSocket-Version": i.protocolVersion, - "Sec-WebSocket-Key": d, - Connection: `Upgrade`, - Upgrade: `websocket` - }, i.path = a.pathname + a.search, i.timeout = i.handshakeTimeout, i.perMessageDeflate && (h = new x({ - ...i.perMessageDeflate, - isServer: !1, - maxPayload: i.maxPayload - }), i.headers[`Sec-WebSocket-Extensions`] = P({ [x.extensionName]: h.offer() })), n.length) { - for (let e of n) { - if (typeof e != `string` || !B.test(e) || m.has(e)) throw SyntaxError(`An invalid or duplicated subprotocol was specified`); - m.add(e); - } - i.headers[`Sec-WebSocket-Protocol`] = n.join(`,`); - } - if (i.origin && (i.protocolVersion < 13 ? i.headers[`Sec-WebSocket-Origin`] = i.origin : i.headers.Origin = i.origin), (a.username || a.password) && (i.auth = `${a.username}:${a.password}`), c) { - let e = i.path.split(`:`); - i.socketPath = e[0], i.path = e[1]; - } - let v; - if (i.followRedirects) { - if (e._redirects === 0) { - e._originalIpc = c, e._originalSecure = s, e._originalHostOrSocketPath = c ? i.socketPath : a.host; - let t = r && r.headers; - if (r = { - ...r, - headers: {} - }, t) for (let [e, n] of Object.entries(t)) r.headers[e.toLowerCase()] = n; - } else if (e.listenerCount(`redirect`) === 0) { - let t = c ? e._originalIpc ? i.socketPath === e._originalHostOrSocketPath : !1 : e._originalIpc ? !1 : a.host === e._originalHostOrSocketPath; - (!t || e._originalSecure && !s) && (delete i.headers.authorization, delete i.headers.cookie, t || delete i.headers.host, i.auth = void 0); - } - i.auth && !r.headers.authorization && (r.headers.authorization = `Basic ` + Buffer.from(i.auth).toString(`base64`)), v = e._req = f(i), e._redirects && e.emit(`redirect`, e.url, v); - } else v = e._req = f(i); - i.timeout && v.on(`timeout`, () => { - G(e, v, `Opening handshake has timed out`); - }), v.on(`error`, (t) => { - v === null || v[L] || (v = e._req = null, U(e, t)); - }), v.on(`response`, (a) => { - let o = a.headers.location, s = a.statusCode; - if (o && i.followRedirects && s >= 300 && s < 400) { - if (++e._redirects > i.maxRedirects) { - G(e, v, `Maximum redirects exceeded`); - return; - } - v.abort(); - let a; - try { - a = new b(o, t); - } catch { - U(e, SyntaxError(`Invalid URL: ${o}`)); - return; - } - H(e, a, n, r); - } else e.emit(`unexpected-response`, v, a) || G(e, v, `Unexpected server response: ${a.statusCode}`); - }), v.on(`upgrade`, (t, n, r) => { - if (e.emit(`upgrade`, t), e.readyState !== V.CONNECTING) return; - v = e._req = null; - let a = t.headers.upgrade; - if (a === void 0 || a.toLowerCase() !== `websocket`) { - G(e, n, `Invalid Upgrade header`); - return; - } - let o = _(`sha1`).update(d + O).digest(`base64`); - if (t.headers[`sec-websocket-accept`] !== o) { - G(e, n, `Invalid Sec-WebSocket-Accept header`); - return; - } - let s = t.headers[`sec-websocket-protocol`], c; - if (s === void 0 ? m.size && (c = `Server sent no subprotocol`) : m.size ? m.has(s) || (c = `Server sent an invalid subprotocol`) : c = `Server sent a subprotocol but none was requested`, c) { - G(e, n, c); - return; - } - s && (e._protocol = s); - let l = t.headers[`sec-websocket-extensions`]; - if (l !== void 0) { - if (!h) { - G(e, n, `Server sent a Sec-WebSocket-Extensions header but no extension was requested`); - return; - } - let t; - try { - t = F(l); - } catch { - G(e, n, `Invalid Sec-WebSocket-Extensions header`); - return; - } - let r = Object.keys(t); - if (r.length !== 1 || r[0] !== x.extensionName) { - G(e, n, `Server indicated an extension that was not requested`); - return; - } - try { - h.accept(t[x.extensionName]); - } catch { - G(e, n, `Invalid Sec-WebSocket-Extensions header`); - return; - } - e._extensions[x.extensionName] = h; - } - e.setSocket(n, r, { - allowSynchronousEvents: i.allowSynchronousEvents, - generateMask: i.generateMask, - maxBufferedChunks: i.maxBufferedChunks, - maxFragments: i.maxFragments, - maxPayload: i.maxPayload, - skipUTF8Validation: i.skipUTF8Validation - }); - }), i.finishRequest ? i.finishRequest(v, e) : v.end(); - } - function U(e, t) { - e._readyState = V.CLOSING, e._errorEmitted = !0, e.emit(`error`, t), e.emitClose(); - } - function W(e) { - return e.path = e.socketPath, m.connect(e); - } - function ne(e) { - return e.path = void 0, !e.servername && e.servername !== `` && (e.servername = m.isIP(e.host) ? `` : e.host), h.connect(e); - } - function G(e, t, n) { - e._readyState = V.CLOSING; - let r = Error(n); - Error.captureStackTrace(r, G), t.setHeader ? (t[L] = !0, t.abort(), t.socket && !t.socket.destroyed && t.socket.destroy(), process.nextTick(U, e, r)) : (t.destroy(r), t.once(`error`, e.emit.bind(e, `error`)), t.once(`close`, e.emitClose.bind(e))); - } - function K(e, t, n) { - if (t) { - let n = w(t) ? t.size : I(t).length; - e._socket ? e._sender._bufferedBytes += n : e._bufferedAmount += n; - } - if (n) { - let t = Error(`WebSocket is not open: readyState ${e.readyState} (${z[e.readyState]})`); - process.nextTick(n, t); - } - } - function re(e, t) { - let n = this[M]; - n._closeFrameReceived = !0, n._closeMessage = t, n._closeCode = e, n._socket[M] !== void 0 && (n._socket.removeListener(`data`, Z), process.nextTick(J, n._socket), e === 1005 ? n.close() : n.close(e, t)); - } - function ie() { - let e = this[M]; - e.isPaused || e._socket.resume(); - } - function ae(e) { - let t = this[M]; - t._socket[M] !== void 0 && (t._socket.removeListener(`data`, Z), process.nextTick(J, t._socket), t.close(e[j])), t._errorEmitted || (t._errorEmitted = !0, t.emit(`error`, e)); - } - function q() { - this[M].emitClose(); - } - function oe(e, t) { - this[M].emit(`message`, e, t); - } - function se(e) { - let t = this[M]; - t._autoPong && t.pong(e, !this._isServer, N), t.emit(`ping`, e); - } - function ce(e) { - this[M].emit(`pong`, e); - } - function J(e) { - e.resume(); - } - function le(e) { - let t = this[M]; - t.readyState !== V.CLOSED && (t.readyState === V.OPEN && (t._readyState = V.CLOSING, Y(t)), this._socket.end(), t._errorEmitted || (t._errorEmitted = !0, t.emit(`error`, e))); - } - function Y(e) { - e._closeTimer = setTimeout(e._socket.destroy.bind(e._socket), e._closeTimeout); - } - function X() { - let e = this[M]; - if (this.removeListener(`close`, X), this.removeListener(`data`, Z), this.removeListener(`end`, Q), e._readyState = V.CLOSING, !this._readableState.endEmitted && !e._closeFrameReceived && !e._receiver._writableState.errorEmitted && this._readableState.length !== 0) { - let t = this.read(this._readableState.length); - e._receiver.write(t); - } - e._receiver.end(), this[M] = void 0, clearTimeout(e._closeTimer), e._receiver._writableState.finished || e._receiver._writableState.errorEmitted ? e.emitClose() : (e._receiver.on(`error`, q), e._receiver.on(`finish`, q)); - } - function Z(e) { - this[M]._receiver.write(e) || this.pause(); - } - function Q() { - let e = this[M]; - e._readyState = V.CLOSING, e._receiver.end(), this.end(); - } - function $() { - let e = this[M]; - this.removeListener(`error`, $), this.on(`error`, N), e && (e._readyState = V.CLOSING, this.destroy()); - } -})); -var m = c$12(((e, n) => { - p(); - let { Duplex: r } = f$11(`stream`); - function i(e) { - e.emit(`close`); - } - function a() { - !this.destroyed && this._writableState.finished && this.destroy(); - } - function o(e) { - this.removeListener(`error`, o), this.destroy(), this.listenerCount(`error`) === 0 && this.emit(`error`, e); - } - function s(e, t) { - let n = !0, s = new r({ - ...t, - autoDestroy: !1, - emitClose: !1, - objectMode: !1, - writableObjectMode: !1 - }); - return e.on(`message`, function(t, n) { - let r = !n && s._readableState.objectMode ? t.toString() : t; - s.push(r) || e.pause(); - }), e.once(`error`, function(e) { - s.destroyed || (n = !1, s.destroy(e)); - }), e.once(`close`, function() { - s.destroyed || s.push(null); - }), s._destroy = function(t, r) { - if (e.readyState === e.CLOSED) { - r(t), process.nextTick(i, s); - return; - } - let a = !1; - e.once(`error`, function(e) { - a = !0, r(e); - }), e.once(`close`, function() { - a || r(t), process.nextTick(i, s); - }), n && e.terminate(); - }, s._final = function(t) { - if (e.readyState === e.CONNECTING) { - e.once(`open`, function() { - s._final(t); - }); - return; - } - e._socket !== null && (e._socket._writableState.finished ? (t(), s._readableState.endEmitted && s.destroy()) : (e._socket.once(`finish`, function() { - t(); - }), e.close())); - }, s._read = function() { - e.isPaused && e.resume(); - }, s._write = function(t, n, r) { - if (e.readyState === e.CONNECTING) { - e.once(`open`, function() { - s._write(t, n, r); - }); - return; - } - e.send(t, r); - }, s.on(`end`, a), s.on(`error`, o), s; - } - n.exports = s; -})); -var h = c$12(((e, t) => { - let { tokenChars: n } = c(); - function r(e) { - let t = /* @__PURE__ */ new Set(), r = -1, i = -1, a = 0; - for (; a < e.length; a++) { - let o = e.charCodeAt(a); - if (i === -1 && n[o] === 1) r === -1 && (r = a); - else if (a !== 0 && (o === 32 || o === 9)) i === -1 && r !== -1 && (i = a); - else if (o === 44) { - if (r === -1) throw SyntaxError(`Unexpected character at index ${a}`); - i === -1 && (i = a); - let n = e.slice(r, i); - if (t.has(n)) throw SyntaxError(`The "${n}" subprotocol is duplicated`); - t.add(n), r = i = -1; - } else throw SyntaxError(`Unexpected character at index ${a}`); - } - if (r === -1 || i !== -1) throw SyntaxError(`Unexpected end of input`); - let o = e.slice(r, a); - if (t.has(o)) throw SyntaxError(`The "${o}" subprotocol is duplicated`); - return t.add(o), t; - } - t.exports = { parse: r }; -})); -var g$1 = c$12(((e, n) => { - let r = f$11(`events`), a = f$11(`http`), { Duplex: o } = f$11(`stream`), { createHash: c } = f$11(`crypto`), l = f(), u = s(), d = h(), m = p(), { CLOSE_TIMEOUT: g, GUID: _, kWebSocket: v } = i(), y = /^[+/0-9A-Za-z]{22}==$/; - n.exports = class extends r { - constructor(e, t) { - if (super(), e = { - allowSynchronousEvents: !0, - autoPong: !0, - maxBufferedChunks: 1024 * 1024, - maxFragments: 128 * 1024, - maxPayload: 100 * 1024 * 1024, - skipUTF8Validation: !1, - perMessageDeflate: !1, - handleProtocols: null, - clientTracking: !0, - closeTimeout: g, - verifyClient: null, - noServer: !1, - backlog: null, - server: null, - host: null, - path: null, - port: null, - WebSocket: m, - ...e - }, e.port == null && !e.server && !e.noServer || e.port != null && (e.server || e.noServer) || e.server && e.noServer) throw TypeError(`One and only one of the "port", "server", or "noServer" options must be specified`); - if (e.port == null ? e.server && (this._server = e.server) : (this._server = a.createServer((e, t) => { - let n = a.STATUS_CODES[426]; - t.writeHead(426, { - "Content-Length": n.length, - "Content-Type": `text/plain` - }), t.end(n); - }), this._server.listen(e.port, e.host, e.backlog, t)), this._server) { - let e = this.emit.bind(this, `connection`); - this._removeListeners = b(this._server, { - listening: this.emit.bind(this, `listening`), - error: this.emit.bind(this, `error`), - upgrade: (t, n, r) => { - this.handleUpgrade(t, n, r, e); - } - }); - } - e.perMessageDeflate === !0 && (e.perMessageDeflate = {}), e.clientTracking && (this.clients = /* @__PURE__ */ new Set(), this._shouldEmitClose = !1), this.options = e, this._state = 0; - } - address() { - if (this.options.noServer) throw Error(`The server is operating in "noServer" mode`); - return this._server ? this._server.address() : null; - } - close(e) { - if (this._state === 2) { - e && this.once(`close`, () => { - e(Error(`The server is not running`)); - }), process.nextTick(x, this); - return; - } - if (e && this.once(`close`, e), this._state !== 1) if (this._state = 1, this.options.noServer || this.options.server) this._server && (this._removeListeners(), this._removeListeners = this._server = null), this.clients && this.clients.size ? this._shouldEmitClose = !0 : process.nextTick(x, this); - else { - let e = this._server; - this._removeListeners(), this._removeListeners = this._server = null, e.close(() => { - x(this); - }); - } - } - shouldHandle(e) { - if (this.options.path) { - let t = e.url.indexOf(`?`); - if ((t === -1 ? e.url : e.url.slice(0, t)) !== this.options.path) return !1; - } - return !0; - } - handleUpgrade(e, t, n, r) { - t.on(`error`, S); - let i = e.headers[`sec-websocket-key`], a = e.headers.upgrade, o = +e.headers[`sec-websocket-version`]; - if (e.method !== `GET`) { - w(this, e, t, 405, `Invalid HTTP method`); - return; - } - if (a === void 0 || a.toLowerCase() !== `websocket`) { - w(this, e, t, 400, `Invalid Upgrade header`); - return; - } - if (i === void 0 || !y.test(i)) { - w(this, e, t, 400, `Missing or invalid Sec-WebSocket-Key header`); - return; - } - if (o !== 13 && o !== 8) { - w(this, e, t, 400, `Missing or invalid Sec-WebSocket-Version header`, { "Sec-WebSocket-Version": `13, 8` }); - return; - } - if (!this.shouldHandle(e)) { - C(t, 400); - return; - } - let s = e.headers[`sec-websocket-protocol`], c = /* @__PURE__ */ new Set(); - if (s !== void 0) try { - c = d.parse(s); - } catch { - w(this, e, t, 400, `Invalid Sec-WebSocket-Protocol header`); - return; - } - let f = e.headers[`sec-websocket-extensions`], p = {}; - if (this.options.perMessageDeflate && f !== void 0) { - let n = new u({ - ...this.options.perMessageDeflate, - isServer: !0, - maxPayload: this.options.maxPayload - }); - try { - let e = l.parse(f); - e[u.extensionName] && (n.accept(e[u.extensionName]), p[u.extensionName] = n); - } catch { - w(this, e, t, 400, `Invalid or unacceptable Sec-WebSocket-Extensions header`); - return; - } - } - if (this.options.verifyClient) { - let a = { - origin: e.headers[`${o === 8 ? `sec-websocket-origin` : `origin`}`], - secure: !!(e.socket.authorized || e.socket.encrypted), - req: e - }; - if (this.options.verifyClient.length === 2) { - this.options.verifyClient(a, (a, o, s, l) => { - if (!a) return C(t, o || 401, s, l); - this.completeUpgrade(p, i, c, e, t, n, r); - }); - return; - } - if (!this.options.verifyClient(a)) return C(t, 401); - } - this.completeUpgrade(p, i, c, e, t, n, r); - } - completeUpgrade(e, t, n, r, i, a, o) { - if (!i.readable || !i.writable) return i.destroy(); - if (i[v]) throw Error(`server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration`); - if (this._state > 0) return C(i, 503); - let s = [ - `HTTP/1.1 101 Switching Protocols`, - `Upgrade: websocket`, - `Connection: Upgrade`, - `Sec-WebSocket-Accept: ${c(`sha1`).update(t + _).digest(`base64`)}` - ], d = new this.options.WebSocket(null, void 0, this.options); - if (n.size) { - let e = this.options.handleProtocols ? this.options.handleProtocols(n, r) : n.values().next().value; - e && (s.push(`Sec-WebSocket-Protocol: ${e}`), d._protocol = e); - } - if (e[u.extensionName]) { - let t = e[u.extensionName].params, n = l.format({ [u.extensionName]: [t] }); - s.push(`Sec-WebSocket-Extensions: ${n}`), d._extensions = e; - } - this.emit(`headers`, s, r), i.write(s.concat(`\r -`).join(`\r -`)), i.removeListener(`error`, S), d.setSocket(i, a, { - allowSynchronousEvents: this.options.allowSynchronousEvents, - maxBufferedChunks: this.options.maxBufferedChunks, - maxFragments: this.options.maxFragments, - maxPayload: this.options.maxPayload, - skipUTF8Validation: this.options.skipUTF8Validation - }), this.clients && (this.clients.add(d), d.on(`close`, () => { - this.clients.delete(d), this._shouldEmitClose && !this.clients.size && process.nextTick(x, this); - })), o(d, r); - } - }; - function b(e, t) { - for (let n of Object.keys(t)) e.on(n, t[n]); - return function() { - for (let n of Object.keys(t)) e.removeListener(n, t[n]); - }; - } - function x(e) { - e._state = 2, e.emit(`close`); - } - function S() { - this.destroy(); - } - function C(e, t, n, r) { - n ||= a.STATUS_CODES[t], r = { - Connection: `close`, - "Content-Type": `text/html`, - "Content-Length": Buffer.byteLength(n), - ...r - }, e.once(`finish`, e.destroy), e.end(`HTTP/1.1 ${t} ${a.STATUS_CODES[t]}\r\n` + Object.keys(r).map((e) => `${e}: ${r[e]}`).join(`\r -`) + `\r -\r -` + n); - } - function w(e, t, n, r, i, a) { - if (e.listenerCount(`wsClientError`)) { - let r = Error(i); - Error.captureStackTrace(r, w), e.emit(`wsClientError`, r, n, t); - } else C(n, r, i, a); - } -})); -var _; -s$10((() => { - m(), f(), s(), l(), u(), h(), p(), _ = d$13(g$1(), 1); -}))(); -var v = _.default; -//#endregion -export { sandbox_exports$1 as a, dispatchChannelRequest as c, s$7 as d, installBundledCompiledArtifacts as f, list_search_console_sites_exports as i, handleAgentInfoRequest as l, POST as n, dataforseo_exports as o, handleHomePageRequest as p, query_search_analytics_exports as r, installEveWorkflowQueueNamespace as s, dispatchScheduleTask as t, health_default as u }; diff --git a/.output/server/_libs/h3+rou3+srvx.mjs b/.output/server/_libs/h3+rou3+srvx.mjs deleted file mode 100644 index 953918b..0000000 --- a/.output/server/_libs/h3+rou3+srvx.mjs +++ /dev/null @@ -1,1341 +0,0 @@ -import { fileURLToPath as __eveFileURLToPath } from "node:url"; -import { dirname as __eveDirname } from "node:path"; -__eveDirname(__eveFileURLToPath(import.meta.url)); -import nodeHTTP from "node:http"; -import { PassThrough, Readable } from "node:stream"; -import { pipeline } from "node:stream/promises"; -import nodeHTTPS from "node:https"; -import nodeHTTP2 from "node:http2"; -//#region node_modules/srvx/dist/_chunks/_url.mjs -function lazyInherit(target, source, sourceKey) { - for (const key of [...Object.getOwnPropertyNames(source), ...Object.getOwnPropertySymbols(source)]) { - if (key === "constructor") continue; - const targetDesc = Object.getOwnPropertyDescriptor(target, key); - const desc = Object.getOwnPropertyDescriptor(source, key); - let modified = false; - if (desc.get) { - modified = true; - desc.get = targetDesc?.get || function() { - return this[sourceKey][key]; - }; - } - if (desc.set) { - modified = true; - desc.set = targetDesc?.set || function(value) { - this[sourceKey][key] = value; - }; - } - if (!targetDesc?.value && typeof desc.value === "function") { - modified = true; - desc.value = function(...args) { - return this[sourceKey][key](...args); - }; - } - if (modified) Object.defineProperty(target, key, desc); - } -} -const _needsNormRE = /(?:(?:^|\/)(?:\.|\.\.|%2e|%2e\.|\.%2e|%2e%2e)(?:\/|$))|[\\^#"<>{}`\x80-\uffff]/i; -const _searchNeedsNormRE = /[#"'<>]/; -const FastURL = /* @__PURE__ */ (() => { - const NativeURL = globalThis.URL; - const FastURL = class URL { - #url; - #href; - #protocol; - #host; - #pathname; - #search; - #searchParams; - #pos; - constructor(url) { - if (typeof url === "string") { - const isOriginForm = url[0] === "/"; - if (isOriginForm && !_searchNeedsNormRE.test(url)) this.#href = url; - else this.#url = new NativeURL(isOriginForm ? `http://localhost${url}` : url); - } else if (_needsNormRE.test(url.pathname) || url.search && _searchNeedsNormRE.test(url.search)) this.#url = new NativeURL(`${url.protocol || "http:"}//${url.host || "localhost"}${url.pathname}${url.search || ""}`); - else { - this.#protocol = url.protocol; - this.#host = url.host; - this.#pathname = url.pathname; - this.#search = url.search; - } - } - static [Symbol.hasInstance](val) { - return val instanceof NativeURL; - } - get _url() { - if (this.#url) return this.#url; - this.#url = new NativeURL(this.href); - this.#href = void 0; - this.#protocol = void 0; - this.#host = void 0; - this.#pathname = void 0; - this.#search = void 0; - this.#searchParams = void 0; - this.#pos = void 0; - return this.#url; - } - get href() { - if (this.#url) return this.#url.href; - if (!this.#href) this.#href = `${this.#protocol || "http:"}//${this.#host || "localhost"}${this.#pathname || "/"}${this.#search || ""}`; - return this.#href; - } - #getPos() { - if (!this.#pos) { - const url = this.href; - const protoIndex = url.indexOf("://"); - const pathnameIndex = protoIndex === -1 ? -1 : url.indexOf("/", protoIndex + 4); - const qIndex = pathnameIndex === -1 ? -1 : url.indexOf("?", pathnameIndex); - this.#pos = [ - protoIndex, - pathnameIndex, - qIndex - ]; - } - return this.#pos; - } - get pathname() { - if (this.#url) return this.#url.pathname; - if (this.#pathname === void 0) { - const [, pathnameIndex, queryIndex] = this.#getPos(); - if (pathnameIndex === -1) return this._url.pathname; - this.#pathname = this.href.slice(pathnameIndex, queryIndex === -1 ? void 0 : queryIndex); - } - return this.#pathname; - } - get search() { - if (this.#url) return this.#url.search; - if (this.#search === void 0) { - const [, pathnameIndex, queryIndex] = this.#getPos(); - if (pathnameIndex === -1) return this._url.search; - const url = this.href; - this.#search = queryIndex === -1 || queryIndex === url.length - 1 ? "" : url.slice(queryIndex); - } - return this.#search; - } - get searchParams() { - if (this.#url) return this.#url.searchParams; - if (!this.#searchParams) this.#searchParams = new URLSearchParams(this.search); - return this.#searchParams; - } - get protocol() { - if (this.#url) return this.#url.protocol; - if (this.#protocol === void 0) { - const [protocolIndex] = this.#getPos(); - if (protocolIndex === -1) return this._url.protocol; - const url = this.href; - this.#protocol = url.slice(0, protocolIndex + 1); - } - return this.#protocol; - } - toString() { - return this.href; - } - toJSON() { - return this.href; - } - }; - lazyInherit(FastURL.prototype, NativeURL.prototype, "_url"); - Object.setPrototypeOf(FastURL.prototype, NativeURL.prototype); - Object.setPrototypeOf(FastURL, NativeURL); - return FastURL; -})(); -//#endregion -//#region node_modules/srvx/dist/_chunks/_utils2.mjs -function resolvePortAndHost(opts) { - const _port = opts.port ?? globalThis.process?.env.PORT ?? 3e3; - const port = typeof _port === "number" ? _port : Number.parseInt(_port, 10); - if (port < 0 || port > 65535) throw new RangeError(`Port must be between 0 and 65535 (got "${port}").`); - return { - port, - hostname: opts.hostname ?? globalThis.process?.env.HOST - }; -} -function fmtURL(host, port, secure) { - if (!host || !port) return; - if (host.includes(":")) host = `[${host}]`; - return `http${secure ? "s" : ""}://${host}:${port}/`; -} -function printListening(opts, url) { - if (!url || (opts.silent ?? globalThis.process?.env?.TEST)) return; - let additionalInfo = ""; - try { - const _url = new URL(url); - if (_url.hostname === "[::]" || _url.hostname === "0.0.0.0") { - _url.hostname = "localhost"; - url = _url.href; - additionalInfo = " (all interfaces)"; - } - } catch {} - let listeningOn = `➜ Listening on:`; - if (globalThis.process.stdout?.isTTY) { - listeningOn = `\u001B[32m${listeningOn}\u001B[0m`; - url = `\u001B[36m${url}\u001B[0m`; - additionalInfo = `\u001B[2m${additionalInfo}\u001B[0m`; - } - console.log(`${listeningOn} ${url}${additionalInfo}`); -} -function resolveTLSOptions(opts) { - if (!opts.tls || opts.protocol === "http") return; - const cert = resolveCertOrKey(opts.tls.cert); - const key = resolveCertOrKey(opts.tls.key); - if (!cert && !key) { - if (opts.protocol === "https") throw new TypeError("TLS `cert` and `key` must be provided for `https` protocol."); - return; - } - if (!cert || !key) throw new TypeError("TLS `cert` and `key` must be provided together."); - return { - cert, - key, - passphrase: opts.tls.passphrase - }; -} -function resolveCertOrKey(value) { - if (!value) return; - if (typeof value !== "string") throw new TypeError("TLS certificate and key must be strings in PEM format or file paths."); - if (value.startsWith("-----BEGIN ")) return value; - const { readFileSync } = process.getBuiltinModule("node:fs"); - return readFileSync(value, "utf8"); -} -function createWaitUntil() { - const promises = /* @__PURE__ */ new Set(); - return { - waitUntil: (promise) => { - if (typeof promise?.then !== "function") return; - promises.add(Promise.resolve(promise).catch(console.error).finally(() => { - promises.delete(promise); - })); - }, - wait: () => { - return Promise.all(promises); - } - }; -} -//#endregion -//#region node_modules/srvx/dist/_chunks/_utils.mjs -const noColor = /* @__PURE__ */ (() => { - const env = globalThis.process?.env ?? {}; - return env.NO_COLOR === "1" || env.TERM === "dumb"; -})(); -const _c = (c, r = 39) => (t) => noColor ? t : `\u001B[${c}m${t}\u001B[${r}m`; -const bold = /* @__PURE__ */ _c(1, 22); -const red = /* @__PURE__ */ _c(31); -const green = /* @__PURE__ */ _c(32); -const gray = /* @__PURE__ */ _c(90); -//#endregion -//#region node_modules/srvx/dist/_chunks/_plugins.mjs -function wrapFetch(server) { - const fetchHandler = server.options.fetch; - const middleware = server.options.middleware || []; - return middleware.length === 0 ? fetchHandler : (request) => callMiddleware$1(request, fetchHandler, middleware, 0); -} -function callMiddleware$1(request, fetchHandler, middleware, index) { - if (index === middleware.length) return fetchHandler(request); - return middleware[index](request, () => callMiddleware$1(request, fetchHandler, middleware, index + 1)); -} -const errorPlugin = (server) => { - const errorHandler = server.options.error; - if (!errorHandler) return; - server.options.middleware.unshift((_req, next) => { - try { - const res = next(); - return res instanceof Promise ? res.catch((error) => errorHandler(error)) : res; - } catch (error) { - return errorHandler(error); - } - }); -}; -const gracefulShutdownPlugin = (server) => { - const config = server.options?.gracefulShutdown; - if (!globalThis.process?.on || config === false || config === void 0 && (process.env.CI || process.env.TEST)) return; - const gracefulTimeout = config === true || !config?.gracefulTimeout ? Number.parseInt(process.env.SERVER_SHUTDOWN_TIMEOUT || "") || 5 : config.gracefulTimeout; - let isClosing = false; - let isClosed = false; - const w = server.options.silent ? () => {} : process.stderr.write.bind(process.stderr); - const forceClose = async () => { - if (isClosed) return; - w(red("\x1B[2K\rForcibly closing connections...\n")); - isClosed = true; - await server.close(true); - }; - const shutdown = async () => { - if (isClosing || isClosed) return; - setTimeout(() => { - globalThis.process.once("SIGINT", forceClose); - }, 100); - isClosing = true; - const closePromise = server.close(); - for (let remaining = gracefulTimeout; remaining > 0; remaining--) { - w(gray(`\rStopping server gracefully (${remaining}s)... Press ${bold("Ctrl+C")} again to force close.`)); - if (await Promise.race([closePromise.then(() => true), new Promise((r) => setTimeout(() => r(false), 1e3))])) { - w("\x1B[2K\r" + green("Server closed successfully.\n")); - isClosed = true; - return; - } - } - w("\x1B[2K\rGraceful shutdown timed out.\n"); - await forceClose(); - }; - for (const sig of ["SIGINT", "SIGTERM"]) globalThis.process.on(sig, shutdown); -}; -//#endregion -//#region node_modules/srvx/dist/_chunks/_trust-proxy.mjs -function isTrustedProxy(trustProxy, remoteAddress) { - if (trustProxy === void 0 || trustProxy === false) return false; - if (trustProxy === true) return true; - if (trustProxy === "loopback") return isLoopbackAddress(remoteAddress); - if (remoteAddress === void 0) return false; - if (trustProxy.includes(remoteAddress)) return true; - const mapped = ipv4FromMapped(remoteAddress); - return mapped !== void 0 && trustProxy.includes(mapped); -} -function ipv4FromMapped(address) { - return address.startsWith("::ffff:") && address.includes(".") ? address.slice(7) : void 0; -} -function isLoopbackAddress(address) { - return !!address && (address === "::1" || address.startsWith("127.") || address.startsWith("::ffff:127.")); -} -const HOST_RE = /^(\[(?:[A-Fa-f0-9:.]+)\]|(?:[A-Za-z0-9_-]+\.)*[A-Za-z0-9_-]+|(?:\d{1,3}\.){3}\d{1,3})(:\d{1,5})?$/; -function firstForwardedValue(value) { - if (!value) return; - return (Array.isArray(value) ? value[0] : value).split(",")[0].trim() || void 0; -} -//#endregion -//#region node_modules/srvx/dist/_chunks/_body-limit.mjs -function createBodyTooLargeError(maxRequestBodySize) { - return Object.assign(/* @__PURE__ */ new Error(`Request body exceeds the maximum allowed size of ${maxRequestBodySize} bytes.`), { - code: "ERR_BODY_TOO_LARGE", - statusCode: 413, - status: 413 - }); -} -function limitBodyStream(stream, maxRequestBodySize) { - const reader = stream.getReader(); - let size = 0; - return new ReadableStream({ - async pull(controller) { - const { done, value } = await reader.read(); - if (done) { - controller.close(); - return; - } - size += value.byteLength; - if (size > maxRequestBodySize) { - const error = createBodyTooLargeError(maxRequestBodySize); - reader.cancel(error).catch(() => {}); - controller.error(error); - return; - } - controller.enqueue(value); - }, - cancel(reason) { - return reader.cancel(reason); - } - }); -} -//#endregion -//#region node_modules/srvx/dist/adapters/node.mjs -function sendNodeResponseDetached(nodeRes, webRes) { - try { - return _sendNodeResponse(nodeRes, webRes, true); - } catch (error) { - handleSendError(nodeRes, error); - } -} -function handleSendError(nodeRes, _error) { - if (nodeRes.headersSent) nodeRes.destroy(); - else { - nodeRes.statusCode = 500; - nodeRes.end(); - } -} -function _sendNodeResponse(nodeRes, webRes, detached) { - if (!webRes) { - nodeRes.statusCode = 500; - return endNodeResponse(nodeRes, detached); - } - if (webRes._toNodeResponse) { - const res = webRes._toNodeResponse(); - if (res.body) { - if (res.body instanceof ReadableStream) { - writeHead(nodeRes, res.status, res.statusText, res.headers); - return streamBody(res.body, nodeRes); - } else if (typeof res.body?.pipe === "function") return pipeBody(res.body, nodeRes, res.status, res.statusText, res.headers); - writeHead(nodeRes, res.status, res.statusText, res.headers); - nodeRes.write(res.body); - } else writeHead(nodeRes, res.status, res.statusText, res.headers); - return endNodeResponse(nodeRes, detached); - } - const rawHeaders = []; - for (const [key, value] of webRes.headers) rawHeaders.push(key, value); - writeHead(nodeRes, webRes.status, webRes.statusText, rawHeaders); - return webRes.body ? streamBody(webRes.body, nodeRes) : endNodeResponse(nodeRes, detached); -} -function writeHead(nodeRes, status, statusText, rawHeaders) { - if (!nodeRes.headersSent) if (nodeRes.req?.httpVersion === "2.0") nodeRes.writeHead(status, rawHeaders); - else nodeRes.writeHead(status, statusText, rawHeaders); -} -function endNodeResponse(nodeRes, detached) { - if (detached) { - nodeRes.end(); - return; - } - return new Promise((resolve) => nodeRes.end(resolve)); -} -function pipeBody(stream, nodeRes, status, statusText, headers) { - if (nodeRes.destroyed) { - stream.destroy?.(); - return; - } - if (typeof stream.on !== "function" || typeof stream.destroy !== "function") { - writeHead(nodeRes, status, statusText, headers); - stream.pipe(nodeRes); - return new Promise((resolve) => nodeRes.on("close", resolve)); - } - if (stream.destroyed) { - writeHead(nodeRes, 500, "Internal Server Error", []); - return endNodeResponse(nodeRes); - } - return new Promise((resolve) => { - function onEarlyError() { - stream.off("readable", onReadable); - stream.destroy(); - writeHead(nodeRes, 500, "Internal Server Error", []); - endNodeResponse(nodeRes).then(resolve); - } - function onReadable() { - stream.off("error", onEarlyError); - if (nodeRes.destroyed) { - stream.destroy(); - return resolve(); - } - writeHead(nodeRes, status, statusText, headers); - pipeline(stream, nodeRes).catch(() => {}).then(() => resolve()); - } - stream.once("error", onEarlyError); - stream.once("readable", onReadable); - }); -} -function streamBody(stream, nodeRes) { - if (nodeRes.destroyed) { - stream.cancel(); - return; - } - const reader = stream.getReader(); - function streamCancel(error) { - reader.cancel(error).catch(() => {}); - if (error) nodeRes.destroy(error); - } - function streamHandle({ done, value }) { - try { - if (done) nodeRes.end(); - else if (nodeRes.write(value)) reader.read().then(streamHandle, streamCancel); - else nodeRes.once("drain", () => reader.read().then(streamHandle, streamCancel)); - } catch (error) { - streamCancel(error instanceof Error ? error : void 0); - } - } - nodeRes.on("close", streamCancel); - nodeRes.on("error", streamCancel); - reader.read().then(streamHandle, streamCancel); - return reader.closed.catch(streamCancel).finally(() => { - nodeRes.off("close", streamCancel); - nodeRes.off("error", streamCancel); - }); -} -var NodeRequestURL = class extends FastURL { - constructor({ req, trusted = false }) { - const path = req.url || "/"; - const forwardedHost = trusted ? firstForwardedValue(req.headers["x-forwarded-host"]) : void 0; - let host = (forwardedHost && HOST_RE.test(forwardedHost) ? forwardedHost : void 0) || req.headers.host || req.headers[":authority"]; - if (host && !HOST_RE.test(host)) host = "_invalid_"; - else if (!host) if (req.socket) host = `${req.socket.localFamily === "IPv6" ? "[" + req.socket.localAddress + "]" : req.socket.localAddress}:${req.socket?.localPort || "80"}`; - else host = "localhost"; - const forwardedProto = trusted ? firstForwardedValue(req.headers["x-forwarded-proto"]) : void 0; - const protocol = req.socket?.encrypted || forwardedProto === "https" || trusted && req.headers[":scheme"] === "https" ? "https:" : "http:"; - if (path[0] === "/") { - const qIndex = path.indexOf("?"); - super({ - protocol, - host, - pathname: qIndex === -1 ? path : path.slice(0, qIndex) || "/", - search: qIndex === -1 ? "" : path.slice(qIndex) || "" - }); - } else if (path === "*") super({ - protocol, - host, - pathname: "/*", - search: "" - }); - else super(path); - } -}; -const _nonJoinedHeaders = /* @__PURE__ */ new Set([ - "age", - "authorization", - "content-length", - "content-type", - "etag", - "expires", - "from", - "host", - "if-modified-since", - "if-unmodified-since", - "last-modified", - "location", - "max-forwards", - "proxy-authorization", - "referer", - "retry-after", - "server", - "user-agent" -]); -const _validHeaderNameRE = /^[!#$%&'*+\-.^_`|~\dA-Za-z]+$/; -function _isRepeated(rawHeaders, lowerName) { - let seen = false; - for (let i = 0; i < rawHeaders.length; i += 2) { - const key = rawHeaders[i]; - if (key.length === lowerName.length && key.toLowerCase() === lowerName) { - if (seen) return true; - seen = true; - } - } - return false; -} -const NodeRequestHeaders = /* @__PURE__ */ (() => { - const NativeHeaders = globalThis.Headers; - class Headers { - #req; - #headers; - constructor(req) { - this.#req = req; - } - static [Symbol.hasInstance](val) { - return val instanceof NativeHeaders; - } - get _headers() { - if (!this.#headers) { - const headers = new NativeHeaders(); - const rawHeaders = this.#req.rawHeaders; - const len = rawHeaders.length; - for (let i = 0; i < len; i += 2) { - const key = rawHeaders[i]; - if (key.charCodeAt(0) === 58) continue; - const value = rawHeaders[i + 1]; - headers.append(key, value); - } - this.#headers = headers; - } - return this.#headers; - } - get(name) { - if (this.#headers) return this.#headers.get(name); - const lower = name.toLowerCase(); - if (lower.charCodeAt(0) === 58) return this._headers.get(name); - const value = this.#req.headers[lower]; - if (typeof value === "string") return _nonJoinedHeaders.has(lower) && _isRepeated(this.#req.rawHeaders, lower) ? this._headers.get(name) : value; - if (Array.isArray(value)) return value.join(", "); - return lower !== "__proto__" && _validHeaderNameRE.test(name) ? null : this._headers.get(name); - } - has(name) { - if (this.#headers) return this.#headers.has(name); - const lower = name.toLowerCase(); - if (lower.charCodeAt(0) === 58) return this._headers.has(name); - if (Object.hasOwn(this.#req.headers, lower)) return true; - return lower !== "__proto__" && _validHeaderNameRE.test(name) ? false : this._headers.has(name); - } - getSetCookie() { - if (this.#headers) return this.#headers.getSetCookie(); - const value = this.#req.headers["set-cookie"]; - return Array.isArray(value) ? value.slice() : value ? [value] : []; - } - entries() { - return this._headers.entries(); - } - [Symbol.iterator]() { - return this.entries(); - } - } - lazyInherit(Headers.prototype, NativeHeaders.prototype, "_headers"); - Object.setPrototypeOf(Headers, NativeHeaders); - Object.setPrototypeOf(Headers.prototype, NativeHeaders.prototype); - return Headers; -})(); -const kNativeRequest = /* @__PURE__ */ Symbol.for("srvx.nativeRequest"); -const NodeRequest = /* @__PURE__ */ (() => { - const NativeRequest = getNativeRequest(); - class Request { - runtime; - waitUntil; - #req; - #url; - #bodyStream; - #request; - #headers; - #abortController; - #maxRequestBodySize; - #trustProxy; - #ip; - #ipResolved = false; - #remoteAddress; - #trusted; - constructor(ctx) { - this.#req = ctx.req; - this.#maxRequestBodySize = ctx.maxRequestBodySize; - this.#trustProxy = ctx.trustProxy; - this.runtime = { - name: "node", - node: ctx - }; - } - static [Symbol.hasInstance](val) { - return val instanceof NativeRequest; - } - #resolveTrusted() { - if (this.#trusted === void 0) { - this.#remoteAddress = this.#req.socket?.remoteAddress; - this.#trusted = isTrustedProxy(this.#trustProxy, this.#remoteAddress); - } - return this.#trusted; - } - get ip() { - if (this.#ipResolved) return this.#ip; - this.#ipResolved = true; - if (this.#resolveTrusted()) { - const forwarded = firstForwardedValue(this.#req.headers["x-forwarded-for"]); - if (forwarded) return this.#ip = forwarded; - } - return this.#ip = this.#remoteAddress; - } - get method() { - if (this.#request) return this.#request.method; - return this.#req.method || "GET"; - } - get _url() { - return this.#url ||= new NodeRequestURL({ - req: this.#req, - trusted: this.#resolveTrusted() - }); - } - set _url(url) { - this.#url = url; - } - get url() { - if (this.#request) return this.#request.url; - return this._url.href; - } - get headers() { - if (this.#request) return this.#request.headers; - return this.#headers ||= new NodeRequestHeaders(this.#req); - } - get _abortController() { - if (!this.#abortController) { - this.#abortController = new AbortController(); - const { req, res } = this.runtime.node; - const abortController = this.#abortController; - const abort = (err) => abortController.abort?.(err); - if (res) res.once("close", () => { - const reqError = req.errored; - if (reqError) abort(reqError); - else if (!res.writableEnded) abort(); - }); - else req.once("close", () => { - if (!req.complete) abort(); - }); - } - return this.#abortController; - } - get signal() { - return this.#request ? this.#request.signal : this._abortController.signal; - } - get body() { - if (this.#request) return this.#request.body; - if (this.#bodyStream === void 0) { - const method = this.method; - let stream = !(method === "GET" || method === "HEAD") ? Readable.toWeb(this.#req) : null; - if (stream && this.#maxRequestBodySize !== void 0) stream = limitBodyStream(stream, this.#maxRequestBodySize); - this.#bodyStream = stream; - } - return this.#bodyStream; - } - #readBuffered() { - return readBody(this.#req, this.#maxRequestBodySize); - } - text() { - if (this.#request) return this.#request.text(); - if (this.#bodyStream !== void 0) return this.#bodyStream ? new Response(this.#bodyStream).text() : Promise.resolve(""); - return this.#readBuffered().then((buf) => buf.toString()); - } - json() { - if (this.#request) return this.#request.json(); - if (this.#bodyStream !== void 0) return this.text().then((text) => JSON.parse(text)); - return this.#readBuffered().then((buf) => JSON.parse(buf.toString())); - } - get _request() { - if (!this.#request) { - const body = this.body; - this.#request = new NativeRequest(this.url, { - method: this.method, - headers: this.headers, - signal: this._abortController.signal, - body, - duplex: body ? "half" : void 0 - }); - this.#headers = void 0; - this.#bodyStream = void 0; - } - return this.#request; - } - } - lazyInherit(Request.prototype, NativeRequest.prototype, "_request"); - Object.setPrototypeOf(Request.prototype, NativeRequest.prototype); - return Request; -})(); -function readBody(req, maxRequestBodySize) { - if ("rawBody" in req && Buffer.isBuffer(req.rawBody)) { - if (maxRequestBodySize !== void 0 && req.rawBody.length > maxRequestBodySize) return Promise.reject(createBodyTooLargeError(maxRequestBodySize)); - return Promise.resolve(req.rawBody); - } - return new Promise((resolve, reject) => { - const chunks = []; - let size = 0; - const cleanup = () => { - req.off("data", onData); - req.off("end", onEnd); - req.off("error", onError); - }; - const onData = (chunk) => { - if (maxRequestBodySize !== void 0) { - size += chunk.length; - if (size > maxRequestBodySize) { - cleanup(); - req.pause?.(); - reject(createBodyTooLargeError(maxRequestBodySize)); - return; - } - } - chunks.push(chunk); - }; - const onError = (err) => { - cleanup(); - reject(err); - }; - const onEnd = () => { - cleanup(); - resolve(chunks.length === 1 ? chunks[0] : Buffer.concat(chunks)); - }; - req.on("data", onData).once("end", onEnd).once("error", onError); - }); -} -function getNativeRequest() { - let R = globalThis[kNativeRequest] || globalThis.Request; - while (R?._srvx) R = Object.getPrototypeOf(R); - return globalThis[kNativeRequest] ??= R; -} -const NodeResponse = /* @__PURE__ */ (() => { - const NativeResponse = globalThis.Response; - const STATUS_CODES = globalThis.process?.getBuiltinModule?.("node:http")?.STATUS_CODES || {}; - class NodeResponse { - #body; - #init; - #headers; - #response; - constructor(body, init) { - this.#body = body; - this.#init = init; - } - static [Symbol.hasInstance](val) { - return val instanceof NativeResponse; - } - get status() { - return this.#response?.status || this.#init?.status || 200; - } - get statusText() { - return this.#response?.statusText || this.#init?.statusText || STATUS_CODES[this.status] || ""; - } - get headers() { - if (this.#response) return this.#response.headers; - if (this.#headers) return this.#headers; - const initHeaders = this.#init?.headers; - return this.#headers = initHeaders instanceof Headers ? initHeaders : new Headers(initHeaders); - } - get ok() { - if (this.#response) return this.#response.ok; - const status = this.status; - return status >= 200 && status < 300; - } - get _response() { - if (this.#response) return this.#response; - let body = this.#body; - if (body && typeof body.pipe === "function" && !(body instanceof Readable)) { - const stream = new PassThrough(); - body.pipe(stream); - const abort = body.abort; - if (abort) stream.once("close", () => abort()); - body = stream; - } - this.#response = new NativeResponse(body, this.#headers ? { - ...this.#init, - headers: this.#headers - } : this.#init); - this.#init = void 0; - this.#headers = void 0; - this.#body = void 0; - return this.#response; - } - _toNodeResponse() { - const status = this.status; - const statusText = this.statusText; - let body; - let contentType; - let contentLength; - if (this.#response) body = this.#response.body; - else if (this.#body) if (this.#body instanceof ReadableStream) body = this.#body; - else if (typeof this.#body === "string") { - body = this.#body; - contentType = "text/plain; charset=UTF-8"; - contentLength = Buffer.byteLength(this.#body); - } else if (this.#body instanceof ArrayBuffer) { - body = Buffer.from(this.#body); - contentLength = this.#body.byteLength; - } else if (this.#body instanceof Uint8Array) { - body = this.#body; - contentLength = this.#body.byteLength; - } else if (this.#body instanceof DataView) { - body = Buffer.from(this.#body.buffer); - contentLength = this.#body.byteLength; - } else if (this.#body instanceof Blob) { - body = this.#body.stream(); - contentType = this.#body.type; - contentLength = this.#body.size; - } else if (typeof this.#body.pipe === "function") body = this.#body; - else body = this._response.body; - const headers = []; - const initHeaders = this.#init?.headers; - const headerEntries = this.#response?.headers || this.#headers || (initHeaders ? Array.isArray(initHeaders) ? initHeaders : initHeaders?.entries ? initHeaders.entries() : Object.entries(initHeaders) : void 0); - let hasContentTypeHeader; - let hasContentLength; - if (headerEntries) for (const [key, value] of headerEntries) { - const lowerKey = typeof key === "string" ? key.toLowerCase() : String(key); - if (Array.isArray(value)) for (const v of value) headers.push(lowerKey, v); - else headers.push(lowerKey, value); - if (lowerKey === "content-type") hasContentTypeHeader = true; - else if (lowerKey === "content-length") hasContentLength = true; - } - if (contentType && !hasContentTypeHeader) headers.push("content-type", contentType); - if (contentLength && !hasContentLength) headers.push("content-length", String(contentLength)); - this.#init = void 0; - this.#headers = void 0; - this.#response = void 0; - this.#body = void 0; - return { - status, - statusText, - headers, - body - }; - } - } - lazyInherit(NodeResponse.prototype, NativeResponse.prototype, "_response"); - Object.setPrototypeOf(NodeResponse, NativeResponse); - Object.setPrototypeOf(NodeResponse.prototype, NativeResponse.prototype); - return NodeResponse; -})(); -function serve(options) { - return new NodeServer(options); -} -var NodeServer = class { - runtime = "node"; - options; - node; - serveOptions; - fetch; - waitUntil; - #isSecure; - #listeningPromise; - #listenError; - #wait; - constructor(options) { - this.options = { - ...options, - middleware: [...options.middleware || []] - }; - for (const plugin of options.plugins || []) plugin(this); - errorPlugin(this); - const fetchHandler = this.fetch = wrapFetch(this); - const handler = (nodeReq, nodeRes) => { - const reqUrl = nodeReq.url; - if (reqUrl && reqUrl[0] !== "/" && reqUrl !== "*" && !URL.canParse(reqUrl)) { - nodeRes.statusCode = 400; - nodeRes.end(); - return; - } - const request = new NodeRequest({ - req: nodeReq, - res: nodeRes, - maxRequestBodySize: this.options.maxRequestBodySize, - trustProxy: this.options.trustProxy - }); - request.waitUntil = this.#wait?.waitUntil; - const res = fetchHandler(request); - return res instanceof Promise ? res.then((resolvedRes) => sendNodeResponseDetached(nodeRes, resolvedRes)) : sendNodeResponseDetached(nodeRes, res); - }; - this.node = { - handler, - server: void 0 - }; - const loader = globalThis.__srvxLoader__; - if (loader) { - loader({ server: this }); - return; - } - gracefulShutdownPlugin(this); - this.#wait = createWaitUntil(); - this.waitUntil = this.#wait.waitUntil; - const tls = resolveTLSOptions(this.options); - const { port, hostname: host } = resolvePortAndHost(this.options); - this.serveOptions = { - port, - host, - exclusive: !this.options.reusePort, - ...tls, - ...this.options.node - }; - let server; - this.#isSecure = !!this.serveOptions.cert && this.options.protocol !== "http"; - if (this.options.node?.http2 ?? this.#isSecure) if (this.#isSecure) server = nodeHTTP2.createSecureServer({ - allowHTTP1: true, - ...this.serveOptions - }, handler); - else throw new Error("node.http2 option requires tls certificate!"); - else if (this.#isSecure) server = nodeHTTPS.createServer(this.serveOptions, handler); - else server = nodeHTTP.createServer(this.serveOptions, handler); - this.node.server = server; - if (!options.manual) this.serve().catch(() => {}); - } - serve() { - if (this.#listeningPromise) return this.#listeningPromise.then(() => this); - const server = this.node?.server; - if (!server) return Promise.reject(/* @__PURE__ */ new Error("Server not initialized")); - this.#listenError = void 0; - this.#listeningPromise = new Promise((resolve, reject) => { - const onError = (error) => { - server.off("listening", onListening); - this.#listenError = error; - this.#listeningPromise = void 0; - reject(error); - }; - const onListening = () => { - server.off("error", onError); - printListening(this.options, this.url); - resolve(); - }; - server.once("error", onError); - server.once("listening", onListening); - server.listen(this.serveOptions); - }); - return this.#listeningPromise.then(() => this); - } - get url() { - const addr = this.node?.server?.address(); - if (!addr) return; - return typeof addr === "string" ? addr : fmtURL(addr.address, addr.port, this.#isSecure); - } - ready() { - if (this.#listenError) return Promise.reject(this.#listenError); - return Promise.resolve(this.#listeningPromise).then(() => this); - } - async close(closeAll) { - await Promise.all([this.#wait?.wait(), new Promise((resolve, reject) => { - const server = this.node?.server; - if (server && closeAll && "closeAllConnections" in server) server.closeAllConnections(); - if (!server || !server.listening) return resolve(); - server.close((error) => error ? reject(error) : resolve()); - })]); - } -}; -//#endregion -//#region node_modules/rou3/dist/index.mjs -const NullProtoObj = /* @__PURE__ */ (() => { - const e = function() {}; - return e.prototype = Object.create(null), Object.freeze(e.prototype), e; -})(); -//#endregion -//#region node_modules/h3/dist/h3.mjs -function decodePathname(pathname) { - return decodeURI(pathname.includes("%25") ? pathname.replace(/%25/g, "%2525") : pathname); -} -const kEventNS = "h3.internal.event."; -const kEventRes = /* @__PURE__ */ Symbol.for(`${kEventNS}res`); -const kEventResHeaders = /* @__PURE__ */ Symbol.for(`${kEventNS}res.headers`); -const kEventResErrHeaders = /* @__PURE__ */ Symbol.for(`${kEventNS}res.err.headers`); -var H3Event = class { - app; - req; - url; - context; - static __is_event__ = true; - constructor(req, context, app) { - this.context = context || req.context || new NullProtoObj(); - this.req = req; - this.app = app; - const _url = req._url; - const url = _url && _url instanceof URL ? _url : new FastURL(req.url); - if (url.pathname.includes("%")) url.pathname = decodePathname(url.pathname); - this.url = url; - } - get res() { - return this[kEventRes] ||= new H3EventResponse(); - } - get runtime() { - return this.req.runtime; - } - waitUntil(promise) { - this.req.waitUntil?.(promise); - } - toString() { - return `[${this.req.method}] ${this.req.url}`; - } - toJSON() { - return this.toString(); - } - get node() { - return this.req.runtime?.node; - } - get headers() { - return this.req.headers; - } - get path() { - return this.url.pathname + this.url.search; - } - get method() { - return this.req.method; - } -}; -var H3EventResponse = class { - status; - statusText; - get headers() { - return this[kEventResHeaders] ||= new Headers(); - } - get errHeaders() { - return this[kEventResErrHeaders] ||= new Headers(); - } -}; -const DISALLOWED_STATUS_CHARS = /[^\u0009\u0020-\u007E]/g; -function sanitizeStatusMessage(statusMessage = "") { - return statusMessage.replace(DISALLOWED_STATUS_CHARS, ""); -} -function sanitizeStatusCode(statusCode, defaultStatusCode = 200) { - if (!statusCode) return defaultStatusCode; - if (typeof statusCode === "string") statusCode = +statusCode; - if (statusCode < 100 || statusCode > 599) return defaultStatusCode; - return statusCode; -} -var HTTPError = class HTTPError extends Error { - get name() { - return "HTTPError"; - } - status; - statusText; - headers; - cause; - data; - body; - unhandled; - static isError(input) { - return input instanceof Error && input?.name === "HTTPError"; - } - static status(status, statusText, details) { - return new HTTPError({ - ...details, - statusText, - status - }); - } - constructor(arg1, arg2) { - let messageInput; - let details; - if (typeof arg1 === "string") { - messageInput = arg1; - details = arg2; - } else details = arg1; - const status = sanitizeStatusCode(details?.status || details?.statusCode || (details?.cause)?.status || (details?.cause)?.statusCode, 500); - const statusText = sanitizeStatusMessage(details?.statusText || details?.statusMessage || (details?.cause)?.statusText || (details?.cause)?.statusMessage); - const message = messageInput || details?.message || (details?.cause)?.message || details?.statusText || details?.statusMessage || [ - "HTTPError", - status, - statusText - ].filter(Boolean).join(" "); - super(message, { cause: details }); - this.cause = details; - this.status = status; - this.statusText = statusText || void 0; - const rawHeaders = details?.headers || (details?.cause)?.headers; - this.headers = rawHeaders ? new Headers(rawHeaders) : void 0; - this.unhandled = details?.unhandled ?? (details?.cause)?.unhandled ?? void 0; - this.data = details?.data; - this.body = details?.body; - } - get statusCode() { - return this.status; - } - get statusMessage() { - return this.statusText; - } - toJSON() { - const unhandled = this.unhandled; - return { - status: this.status, - statusText: this.statusText, - unhandled, - message: unhandled ? "HTTPError" : this.message, - data: unhandled ? void 0 : this.data, - ...unhandled ? void 0 : this.body - }; - } -}; -function isJSONSerializable(value, _type) { - if (value === null || value === void 0) return true; - if (_type !== "object") return _type === "boolean" || _type === "number" || _type === "string"; - if (typeof value.toJSON === "function") return true; - if (Array.isArray(value)) return true; - if (typeof value.pipe === "function" || typeof value.pipeTo === "function") return false; - if (value instanceof NullProtoObj) return true; - const proto = Object.getPrototypeOf(value); - return proto === Object.prototype || proto === null; -} -const kNotFound = /* @__PURE__ */ Symbol.for("h3.notFound"); -const kHandled = /* @__PURE__ */ Symbol.for("h3.handled"); -function toResponse(val, event, config = {}) { - if (typeof val?.then === "function") return val.then((resolvedVal) => toResponse(resolvedVal, event, config), (r) => toResponse(typeof r === "number" ? new HTTPError({ status: r }) : r, event, config)); - const response = prepareResponse(val, event, config); - if (typeof response?.then === "function") return toResponse(response, event, config); - const { onResponse } = config; - return onResponse ? Promise.resolve(onResponse(response, event)).then(() => response) : response; -} -var HTTPResponse = class { - #headers; - #init; - body; - constructor(body, init) { - this.body = body; - this.#init = init; - } - get status() { - return this.#init?.status || 200; - } - get statusText() { - return this.#init?.statusText || "OK"; - } - get headers() { - return this.#headers ||= new Headers(this.#init?.headers); - } -}; -function prepareResponse(val, event, config, nested) { - if (val === kHandled) return new NodeResponse(null); - if (val === kNotFound) val = new HTTPError({ - status: 404, - message: `Cannot find any route matching [${event.req.method}] ${event.url}` - }); - if (val && val instanceof Error) { - const isHTTPError = HTTPError.isError(val); - const error = isHTTPError ? val : new HTTPError(val); - if (!isHTTPError) { - error.unhandled = true; - if (val?.stack) error.stack = val.stack; - } - if (error.unhandled && !config.silent) console.error(error); - const { onError } = config; - const errHeaders = event[kEventRes]?.[kEventResErrHeaders]; - return onError && !nested ? Promise.resolve(onError(error, event)).catch((error) => error).then((newVal) => prepareResponse(newVal ?? val, event, config, true)) : errorResponse(error, config.debug, errHeaders); - } - const preparedRes = event[kEventRes]; - const preparedHeaders = preparedRes?.[kEventResHeaders]; - event[kEventRes] = void 0; - if (!(val instanceof Response)) { - const res = prepareResponseBody(val, event, config); - const status = res.status || preparedRes?.status; - return new NodeResponse(nullBody(event.req.method, status) ? null : res.body, { - status, - statusText: res.statusText || preparedRes?.statusText, - headers: res.headers && preparedHeaders ? mergeHeaders$1(res.headers, preparedHeaders) : res.headers || preparedHeaders - }); - } - if (!preparedHeaders || nested || !val.ok) return val; - try { - mergeHeaders$1(val.headers, preparedHeaders, val.headers); - return val; - } catch { - return new NodeResponse(nullBody(event.req.method, val.status) ? null : val.body, { - status: val.status, - statusText: val.statusText, - headers: mergeHeaders$1(val.headers, preparedHeaders) - }); - } -} -function mergeHeaders$1(base, overrides, target = new Headers(base)) { - for (const [name, value] of overrides) if (name === "set-cookie") target.append(name, value); - else target.set(name, value); - return target; -} -const frozen = (name) => (...args) => { - throw new Error(`Headers are frozen (${name} ${args.join(", ")})`); -}; -var FrozenHeaders = class extends Headers { - set = frozen("set"); - append = frozen("append"); - delete = frozen("delete"); -}; -const emptyHeaders = /* @__PURE__ */ new FrozenHeaders({ "content-length": "0" }); -const jsonHeaders = /* @__PURE__ */ new FrozenHeaders({ "content-type": "application/json;charset=UTF-8" }); -function prepareResponseBody(val, event, config) { - if (val === null || val === void 0) return { - body: "", - headers: emptyHeaders - }; - const valType = typeof val; - if (valType === "string") return { body: val }; - if (val instanceof Uint8Array) { - event.res.headers.set("content-length", val.byteLength.toString()); - return { body: val }; - } - if (val instanceof HTTPResponse || val?.constructor?.name === "HTTPResponse") return val; - if (isJSONSerializable(val, valType)) return { - body: JSON.stringify(val, void 0, config.debug ? 2 : void 0), - headers: jsonHeaders - }; - if (valType === "bigint") return { - body: val.toString(), - headers: jsonHeaders - }; - if (val instanceof Blob) { - const headers = new Headers({ - "content-type": val.type, - "content-length": val.size.toString() - }); - let filename = val.name; - if (filename) { - filename = encodeURIComponent(filename); - headers.set("content-disposition", `filename="${filename}"; filename*=UTF-8''${filename}`); - } - return { - body: val.stream(), - headers - }; - } - if (valType === "symbol") return { body: val.toString() }; - if (valType === "function") return { body: `${val.name}()` }; - return { body: val }; -} -function nullBody(method, status) { - return method === "HEAD" || status === 100 || status === 101 || status === 102 || status === 204 || status === 205 || status === 304; -} -function errorResponse(error, debug, errHeaders) { - let headers = error.headers ? mergeHeaders$1(jsonHeaders, error.headers) : new Headers(jsonHeaders); - if (errHeaders) headers = mergeHeaders$1(headers, errHeaders); - return new NodeResponse(JSON.stringify({ - ...error.toJSON(), - stack: debug && error.stack ? error.stack.split("\n").map((l) => l.trim()) : void 0 - }, void 0, debug ? 2 : void 0), { - status: error.status, - statusText: error.statusText, - headers - }); -} -function callMiddleware(event, middleware, handler, index = 0) { - if (index === middleware.length) return handler(event); - const fn = middleware[index]; - let nextCalled; - let nextResult; - const next = () => { - if (nextCalled) return nextResult; - nextCalled = true; - nextResult = callMiddleware(event, middleware, handler, index + 1); - return nextResult; - }; - const ret = fn(event, next); - return isUnhandledResponse(ret) ? next() : typeof ret?.then === "function" ? ret.then((resolved) => isUnhandledResponse(resolved) ? next() : resolved) : ret; -} -function isUnhandledResponse(val) { - return val === void 0 || val === kNotFound; -} -function defineHandler(input) { - if (typeof input === "function") return handlerWithFetch(input); - const handler = input.handler || (input.fetch ? function _fetchHandler(event) { - return input.fetch(event.req); - } : NoHandler); - return Object.assign(handlerWithFetch(input.middleware?.length ? function _handlerMiddleware(event) { - return callMiddleware(event, input.middleware, handler); - } : handler), input); -} -function handlerWithFetch(handler) { - if ("fetch" in handler) return handler; - return Object.assign(handler, { fetch: (req) => { - if (typeof req === "string") req = new URL(req, "http://_"); - if (req instanceof URL) req = new Request(req); - const event = new H3Event(req); - try { - return Promise.resolve(toResponse(handler(event), event)); - } catch (error) { - return Promise.resolve(toResponse(error, event)); - } - } }); -} -function toEventHandler(handler) { - if (typeof handler === "function") return handler; - if (typeof handler?.handler === "function" && handler.constructor?.["~h3"]) return handler.handler; - if (typeof handler?.fetch === "function") return function _fetchHandler(event) { - return handler.fetch(event.req); - }; -} -const NoHandler = () => kNotFound; -var H3Core = class { - static "~h3" = true; - config; - "~middleware"; - "~routes" = []; - constructor(config = {}) { - this["~middleware"] = []; - this.config = config; - this.fetch = this.fetch.bind(this); - this.handler = this.handler.bind(this); - } - fetch(request) { - return this["~request"](request); - } - handler(event) { - const route = this["~findRoute"](event); - if (route) { - event.context.params = route.params; - event.context.matchedRoute = route.data; - } - const routeHandler = route?.data.handler || NoHandler; - const middleware = this["~getMiddleware"](event, route); - return middleware.length > 0 ? callMiddleware(event, middleware, routeHandler) : routeHandler(event); - } - "~request"(request, context) { - const event = new H3Event(request, context, this); - let handlerRes; - try { - if (this.config.onRequest) { - const hookRes = this.config.onRequest(event); - handlerRes = typeof hookRes?.then === "function" ? hookRes.then(() => this.handler(event)) : this.handler(event); - } else handlerRes = this.handler(event); - } catch (error) { - handlerRes = Promise.reject(error); - } - return toResponse(handlerRes, event, this.config); - } - "~findRoute"(_event) {} - "~addRoute"(_route) { - this["~routes"].push(_route); - } - "~getMiddleware"(_event, route) { - const routeMiddleware = route?.data.middleware; - const globalMiddleware = this["~middleware"]; - return routeMiddleware ? [...globalMiddleware, ...routeMiddleware] : globalMiddleware; - } -}; -//#endregion -export { NodeResponse as a, toEventHandler as i, HTTPError as n, serve as o, defineHandler as r, H3Core as t }; diff --git a/.output/server/_libs/hookable.mjs b/.output/server/_libs/hookable.mjs deleted file mode 100644 index ae5051b..0000000 --- a/.output/server/_libs/hookable.mjs +++ /dev/null @@ -1,44 +0,0 @@ -import { fileURLToPath as __eveFileURLToPath } from "node:url"; -import { dirname as __eveDirname } from "node:path"; -__eveDirname(__eveFileURLToPath(import.meta.url)); -//#region node_modules/hookable/dist/index.mjs -function callHooks(hooks, args, startIndex, task) { - for (let i = startIndex; i < hooks.length; i += 1) try { - const result = task ? task.run(() => hooks[i](...args)) : hooks[i](...args); - if (result && typeof result.then === "function") return Promise.resolve(result).then(() => callHooks(hooks, args, i + 1, task)); - } catch (error) { - return Promise.reject(error); - } -} -var HookableCore = class { - _hooks; - constructor() { - this._hooks = {}; - } - hook(name, fn) { - if (!name || typeof fn !== "function") return () => {}; - this._hooks[name] = this._hooks[name] || []; - this._hooks[name].push(fn); - return () => { - if (fn) { - this.removeHook(name, fn); - fn = void 0; - } - }; - } - removeHook(name, function_) { - const hooks = this._hooks[name]; - if (hooks) { - const index = hooks.indexOf(function_); - if (index !== -1) hooks.splice(index, 1); - if (hooks.length === 0) this._hooks[name] = void 0; - } - } - callHook(name, ...args) { - const hooks = this._hooks[name]; - if (!hooks || hooks.length === 0) return; - return callHooks(hooks, args, 0); - } -}; -//#endregion -export { HookableCore as t }; diff --git a/.output/server/_libs/ufo.mjs b/.output/server/_libs/ufo.mjs deleted file mode 100644 index ecaccf4..0000000 --- a/.output/server/_libs/ufo.mjs +++ /dev/null @@ -1,67 +0,0 @@ -import { fileURLToPath as __eveFileURLToPath } from "node:url"; -import { dirname as __eveDirname } from "node:path"; -__eveDirname(__eveFileURLToPath(import.meta.url)); -String.fromCharCode; -const ENC_SLASH_RE = /%2f/gi; -function decode(text = "") { - try { - return decodeURIComponent("" + text); - } catch { - return "" + text; - } -} -function decodePath(text) { - return decode(text.replace(ENC_SLASH_RE, "%252F")); -} -const TRAILING_SLASH_RE = /\/$|\/\?|\/#/; -const JOIN_LEADING_SLASH_RE = /^\.?\//; -function hasTrailingSlash(input = "", respectQueryAndFragment) { - if (!respectQueryAndFragment) return input.endsWith("/"); - return TRAILING_SLASH_RE.test(input); -} -function withoutTrailingSlash(input = "", respectQueryAndFragment) { - if (!respectQueryAndFragment) return (hasTrailingSlash(input) ? input.slice(0, -1) : input) || "/"; - if (!hasTrailingSlash(input, true)) return input || "/"; - let path = input; - let fragment = ""; - const fragmentIndex = input.indexOf("#"); - if (fragmentIndex !== -1) { - path = input.slice(0, fragmentIndex); - fragment = input.slice(fragmentIndex); - } - const [s0, ...s] = path.split("?"); - return ((s0.endsWith("/") ? s0.slice(0, -1) : s0) || "/") + (s.length > 0 ? `?${s.join("?")}` : "") + fragment; -} -function withTrailingSlash(input = "", respectQueryAndFragment) { - if (!respectQueryAndFragment) return input.endsWith("/") ? input : input + "/"; - if (hasTrailingSlash(input, true)) return input || "/"; - let path = input; - let fragment = ""; - const fragmentIndex = input.indexOf("#"); - if (fragmentIndex !== -1) { - path = input.slice(0, fragmentIndex); - fragment = input.slice(fragmentIndex); - if (!path) return fragment; - } - const [s0, ...s] = path.split("?"); - return s0 + "/" + (s.length > 0 ? `?${s.join("?")}` : "") + fragment; -} -function hasLeadingSlash(input = "") { - return input.startsWith("/"); -} -function withLeadingSlash(input = "") { - return hasLeadingSlash(input) ? input : "/" + input; -} -function isNonEmptyURL(url) { - return url && url !== "/"; -} -function joinURL(base, ...input) { - let url = base || ""; - for (const segment of input.filter((url2) => isNonEmptyURL(url2))) if (url) { - const _segment = segment.replace(JOIN_LEADING_SLASH_RE, ""); - url = withTrailingSlash(url) + _segment; - } else url = segment; - return url; -} -//#endregion -export { withoutTrailingSlash as i, joinURL as n, withLeadingSlash as r, decodePath as t }; diff --git a/.output/server/_libs/vercel__oidc.mjs b/.output/server/_libs/vercel__oidc.mjs deleted file mode 100644 index 1dbb30e..0000000 --- a/.output/server/_libs/vercel__oidc.mjs +++ /dev/null @@ -1,58 +0,0 @@ -import { fileURLToPath as __eveFileURLToPath } from "node:url"; -import { dirname as __eveDirname } from "node:path"; -__eveDirname(__eveFileURLToPath(import.meta.url)); -import { t as __commonJSMin } from "../_runtime.mjs"; -import { a as require_token_error, i as require_token_util } from "./@ai-sdk/gateway+[...].mjs"; -//#region node_modules/@vercel/oidc/dist/token.js -var require_token = /* @__PURE__ */ __commonJSMin(((exports, module) => { - var __defProp = Object.defineProperty; - var __getOwnPropDesc = Object.getOwnPropertyDescriptor; - var __getOwnPropNames = Object.getOwnPropertyNames; - var __hasOwnProp = Object.prototype.hasOwnProperty; - var __export = (target, all) => { - for (var name in all) __defProp(target, name, { - get: all[name], - enumerable: true - }); - }; - var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { - get: () => from[key], - enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable - }); - } - return to; - }; - var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - var token_exports = {}; - __export(token_exports, { refreshToken: () => refreshToken }); - module.exports = __toCommonJS(token_exports); - var import_token_error = require_token_error(); - var import_token_util = require_token_util(); - async function refreshToken(options) { - let projectId = options?.project; - let teamId = options?.team; - if (!projectId && !teamId) { - const projectInfo = (0, import_token_util.findProjectInfo)(); - projectId = projectInfo.projectId; - teamId = projectInfo.teamId; - } else if (!projectId || !teamId) { - const projectInfo = (0, import_token_util.findProjectInfo)(); - projectId = projectId ?? projectInfo.projectId; - teamId = teamId ?? projectInfo.teamId; - } - if (!projectId) throw new import_token_error.VercelOidcTokenError("Failed to refresh OIDC token: No project specified. Try re-linking your project with `vc link`"); - let maybeToken = (0, import_token_util.loadToken)(projectId); - if (!maybeToken || (0, import_token_util.isExpired)((0, import_token_util.getTokenPayload)(maybeToken.token), options?.expirationBufferMs)) { - const authToken = await (0, import_token_util.getVercelToken)({ expirationBufferMs: options?.expirationBufferMs }); - maybeToken = await (0, import_token_util.getVercelOidcToken)(authToken, projectId, teamId); - if (!maybeToken) throw new import_token_error.VercelOidcTokenError("Failed to refresh OIDC token"); - (0, import_token_util.saveToken)(maybeToken, projectId); - } - process.env.VERCEL_OIDC_TOKEN = maybeToken.token; - } - 0 && (module.exports = { refreshToken }); -})); -//#endregion -export { require_token as t }; diff --git a/.output/server/_runtime.mjs b/.output/server/_runtime.mjs deleted file mode 100644 index f1ed844..0000000 --- a/.output/server/_runtime.mjs +++ /dev/null @@ -1,38 +0,0 @@ -import { fileURLToPath as __eveFileURLToPath } from "node:url"; -import { dirname as __eveDirname } from "node:path"; -__eveDirname(__eveFileURLToPath(import.meta.url)); -import { createRequire } from "node:module"; -//#region \0rolldown/runtime.js -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports); -var __exportAll = (all, no_symbols) => { - let target = {}; - for (var name in all) __defProp(target, name, { - get: all[name], - enumerable: true - }); - if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" }); - return target; -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) { - key = keys[i]; - if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { - get: ((k) => from[k]).bind(null, key), - enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable - }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { - value: mod, - enumerable: true -}) : target, mod)); -var __require = /* #__PURE__ */ (() => createRequire(import.meta.url))(); -//#endregion -export { __toESM as i, __exportAll as n, __require as r, __commonJSMin as t }; diff --git a/.output/server/_virtual/eve.schedule.mjs b/.output/server/_virtual/eve.schedule.mjs deleted file mode 100644 index 4e058d8..0000000 --- a/.output/server/_virtual/eve.schedule.mjs +++ /dev/null @@ -1,17 +0,0 @@ -import { fileURLToPath as __eveFileURLToPath } from "node:url"; -import { dirname as __eveDirname } from "node:path"; -__eveDirname(__eveFileURLToPath(import.meta.url)); -import { t as dispatchScheduleTask } from "../_libs/eve.mjs"; -//#region #eve-schedule-task/eve.schedule.c2NoZWR1bGVzL3dlZWtseS50cw -const config = { - "appRoot": "C:\\Users\\timo\\Documents\\qrmaster\\QR-master", - "dev": false -}; -var eve_schedule_default = { - meta: { description: "Run eve schedule \"weekly\" from \"schedules/weekly.ts\"." }, - async run(event) { - return { result: await dispatchScheduleTask(event.name, config) }; - } -}; -//#endregion -export { eve_schedule_default as default }; diff --git a/.output/server/index.mjs b/.output/server/index.mjs deleted file mode 100644 index 89a73d9..0000000 --- a/.output/server/index.mjs +++ /dev/null @@ -1,2180 +0,0 @@ -globalThis.__nitro_main__ = import.meta.url; -import { fileURLToPath as __eveFileURLToPath } from "node:url"; -import { dirname as __eveDirname } from "node:path"; -__eveDirname(__eveFileURLToPath(import.meta.url)); -import { a as NodeResponse, i as toEventHandler, n as HTTPError, o as serve, r as defineHandler, t as H3Core } from "./_libs/h3+rou3+srvx.mjs"; -import { t as HookableCore } from "./_libs/hookable.mjs"; -import { i as withoutTrailingSlash, n as joinURL, r as withLeadingSlash, t as decodePath } from "./_libs/ufo.mjs"; -import { a as sandbox_exports, c as dispatchChannelRequest, d as s, f as installBundledCompiledArtifacts, i as list_search_console_sites_exports, l as handleAgentInfoRequest, n as POST, o as dataforseo_exports, p as handleHomePageRequest, r as query_search_analytics_exports, s as installEveWorkflowQueueNamespace, u as health_default$2 } from "./_libs/eve.mjs"; -import { t as E } from "./_libs/croner.mjs"; -import { promises } from "node:fs"; -import { dirname, resolve } from "node:path"; -import { fileURLToPath } from "node:url"; -//#region #eve-route-handler/GET / -var GET__default = handleHomePageRequest; -//#endregion -//#region #eve-route-handler/GET /eve/v1/health -var health_default$1 = health_default$2; -//#endregion -//#region #eve-route-handler/HEAD /eve/v1/health -var health_default = health_default$2; -//#endregion -//#region #eve-route/eve/v1/info -var info_default = async (event) => handleAgentInfoRequest({ - "appRoot": "C:\\Users\\timo\\Documents\\qrmaster\\QR-master", - "dev": false, - "mode": "production" -}, event.req); -//#endregion -//#region #nitro/virtual/eve-channel/POST /eve/v1/session -const config$5 = { - "appRoot": "C:\\Users\\timo\\Documents\\qrmaster\\QR-master", - "dev": false -}; -var session_default = (event) => dispatchChannelRequest(event, "POST /eve/v1/session", config$5); -//#endregion -//#region #nitro/virtual/eve-channel/POST /eve/v1/session/:sessionId -const config$4 = { - "appRoot": "C:\\Users\\timo\\Documents\\qrmaster\\QR-master", - "dev": false -}; -var _sessionId_default = (event) => dispatchChannelRequest(event, "POST /eve/v1/session/:sessionId", config$4); -//#endregion -//#region #nitro/virtual/eve-channel/GET /eve/v1/session/:sessionId/stream -const config$3 = { - "appRoot": "C:\\Users\\timo\\Documents\\qrmaster\\QR-master", - "dev": false -}; -var stream_default = (event) => dispatchChannelRequest(event, "GET /eve/v1/session/:sessionId/stream", config$3); -//#endregion -//#region #nitro/virtual/eve-channel/GET /eve/v1/connections/:name/callback/:token -const config$2 = { - "appRoot": "C:\\Users\\timo\\Documents\\qrmaster\\QR-master", - "dev": false -}; -var _token_default$2 = (event) => dispatchChannelRequest(event, "GET /eve/v1/connections/:name/callback/:token", config$2); -//#endregion -//#region #nitro/virtual/eve-channel/POST /eve/v1/connections/:name/callback/:token -const config$1 = { - "appRoot": "C:\\Users\\timo\\Documents\\qrmaster\\QR-master", - "dev": false -}; -var _token_default$1 = (event) => dispatchChannelRequest(event, "POST /eve/v1/connections/:name/callback/:token", config$1); -//#endregion -//#region #nitro/virtual/eve-channel/POST /eve/v1/callback/:token -const config = { - "appRoot": "C:\\Users\\timo\\Documents\\qrmaster\\QR-master", - "dev": false -}; -var _token_default = (event) => dispatchChannelRequest(event, "POST /eve/v1/callback/:token", config); -//#endregion -//#region .eve/nitro/workflow/workflows-handler.mjs -var workflows_handler_default = async ({ req }) => { - return await POST(req); -}; -//#endregion -//#region #nitro/virtual/public-assets-data -var public_assets_data_default = { - "/5b9d3b9b2d156ee884bbfc4700bdf2b4.txt": { - "type": "text/plain; charset=utf-8", - "etag": "\"20-bK8BqLwaIn6Epuo3GA5cKY51cys\"", - "mtime": "2026-07-13T13:09:20.030Z", - "size": 32, - "path": "../public/5b9d3b9b2d156ee884bbfc4700bdf2b4.txt" - }, - "/1234567890abcdef.txt": { - "type": "text/plain; charset=utf-8", - "etag": "\"26-Z5BH4aWTPOyM99V2eXQbAMDcCu0\"", - "mtime": "2026-01-22T18:34:57.961Z", - "size": 38, - "path": "../public/1234567890abcdef.txt" - }, - "/bb6dfaacf1ed41a880281c426c54ed7c.txt": { - "type": "text/plain; charset=utf-8", - "etag": "\"22-/mpRPsVg02ZpW0A+Eycs6LqSD2Y\"", - "mtime": "2026-01-22T18:34:57.967Z", - "size": 34, - "path": "../public/bb6dfaacf1ed41a880281c426c54ed7c.txt" - }, - "/favicon.ico": { - "type": "image/vnd.microsoft.icon", - "etag": "\"3a5-WUS6xNGU5t2f2FU2Um1DcALn7uk\"", - "mtime": "2026-03-06T16:32:06.332Z", - "size": 933, - "path": "../public/favicon.ico" - }, - "/ads.txt": { - "type": "text/plain; charset=utf-8", - "etag": "\"3c-+/TkWvoaNuYDo/IwNvbAyI7iphg\"", - "mtime": "2026-01-25T21:07:41.809Z", - "size": 60, - "path": "../public/ads.txt" - }, - "/favicon.svg": { - "type": "image/svg+xml", - "etag": "\"58b-/HogARB7rL/jL9akgeMG0eVK3d4\"", - "mtime": "2026-04-01T16:56:26.565Z", - "size": 1419, - "path": "../public/favicon.svg" - }, - "/barcode-generator-preview.png": { - "type": "image/png", - "etag": "\"6378d-wudlvy69DRhapaifokuBuLPTXZ4\"", - "mtime": "2026-01-22T18:34:57.966Z", - "size": 407437, - "path": "../public/barcode-generator-preview.png" - }, - "/googleccd5315437d68a49.html": { - "type": "text/html; charset=utf-8", - "etag": "\"37-mNxzeYVwjcziQoqb9hKQVmJ4DEA\"", - "mtime": "2026-01-22T18:34:58.058Z", - "size": 55, - "path": "../public/googleccd5315437d68a49.html" - }, - "/humans.txt": { - "type": "text/plain; charset=utf-8", - "etag": "\"fd-fEiLEWdTG9inxXXV8e/+CPvGqgA\"", - "mtime": "2026-01-22T18:34:58.058Z", - "size": 253, - "path": "../public/humans.txt" - }, - "/favicon1.png": { - "type": "image/png", - "etag": "\"1dd0f-SILC9+waMB6AHqXf8xs1V+S9RyE\"", - "mtime": "2026-06-28T15:42:11.439Z", - "size": 122127, - "path": "../public/favicon1.png" - }, - "/hero-qr-scan-mockup.png": { - "type": "image/png", - "etag": "\"11772-48NUaa36VfbVH+wTdOhx6cxN3n8\"", - "mtime": "2026-04-01T16:56:26.566Z", - "size": 71538, - "path": "../public/hero-qr-scan-mockup.png" - }, - "/grid-pattern.svg": { - "type": "image/svg+xml", - "etag": "\"c1-gvTi7kUc2y8mzydCoQKaBK9QeMA\"", - "mtime": "2026-03-06T16:32:06.335Z", - "size": 193, - "path": "../public/grid-pattern.svg" - }, - "/landing-hero-1.png": { - "type": "image/png", - "etag": "\"6ab42-01Eor7bOqZuWkZZ4K19dZtz3CIo\"", - "mtime": "2026-01-14T23:00:18.932Z", - "size": 437058, - "path": "../public/landing-hero-1.png" - }, - "/landing-hero-2.png": { - "type": "image/png", - "etag": "\"6fbe6-8tcXA7jfbwKUpZ8tsLEea4kLmAU\"", - "mtime": "2026-01-14T23:00:18.966Z", - "size": 457702, - "path": "../public/landing-hero-2.png" - }, - "/email-hero-light.png": { - "type": "image/png", - "etag": "\"84a9e-rjF0qUjhc5+CXllI8HS7/+JuRlI\"", - "mtime": "2026-04-23T12:07:07.970Z", - "size": 543390, - "path": "../public/email-hero-light.png" - }, - "/hero-fluid.png": { - "type": "image/png", - "etag": "\"81674-OCLT89Scw+En1D3V0ULROdzDFj4\"", - "mtime": "2026-01-14T23:00:18.820Z", - "size": 530036, - "path": "../public/hero-fluid.png" - }, - "/landing-hero-3.png": { - "type": "image/png", - "etag": "\"863ef-sEzMifkzDKOFfKIPPrpddqfloWM\"", - "mtime": "2026-01-14T23:00:19.000Z", - "size": 549871, - "path": "../public/landing-hero-3.png" - }, - "/landing-analytics.png": { - "type": "image/png", - "etag": "\"9c98e-n4A/DV5KQ+j6kXlhJdtOG8WFkZk\"", - "mtime": "2026-01-14T23:00:18.863Z", - "size": 641422, - "path": "../public/landing-analytics.png" - }, - "/landing-business.png": { - "type": "image/png", - "etag": "\"959fd-sOjRY0Zi0LAzSYFtOdzTqJ3cdGM\"", - "mtime": "2026-01-14T23:00:18.900Z", - "size": 612861, - "path": "../public/landing-business.png" - }, - "/landing-hero-4.png": { - "type": "image/png", - "etag": "\"8ab35-VDJO7hpbm9AVRt5E5aelohZ4Sdk\"", - "mtime": "2026-01-14T23:00:19.035Z", - "size": 568117, - "path": "../public/landing-hero-4.png" - }, - "/llms.txt": { - "type": "text/plain; charset=utf-8", - "etag": "\"d9b-uV5hniByy8hSVx2Zrhi6pk3ljls\"", - "mtime": "2026-04-23T12:07:07.986Z", - "size": 3483, - "path": "../public/llms.txt" - }, - "/landing-qr-scan.png": { - "type": "image/png", - "etag": "\"8e7a5-LBbGVnojJUx+W0grmKiJpTP85ro\"", - "mtime": "2026-01-14T23:00:19.077Z", - "size": 583589, - "path": "../public/landing-qr-scan.png" - }, - "/landing-restaurant.png": { - "type": "image/png", - "etag": "\"a443c-2dLEY6jNU6lubUvfz2AGzkEFTu4\"", - "mtime": "2026-01-14T23:00:19.127Z", - "size": 672828, - "path": "../public/landing-restaurant.png" - }, - "/Background__White_#FFFFFF_202604201334.png": { - "type": "image/png", - "etag": "\"17d9ac-pSXGqbom2JjCgIKOIzZB7OMJ0wU\"", - "mtime": "2026-04-23T12:07:07.923Z", - "size": 1563052, - "path": "../public/Background__White_#FFFFFF_202604201334.png" - }, - "/landing-retail.png": { - "type": "image/png", - "etag": "\"9fcc4-/1t+7An/aTZKkMWIVe+9KTLwmOU\"", - "mtime": "2026-01-14T23:00:19.171Z", - "size": 654532, - "path": "../public/landing-retail.png" - }, - "/logo.svg": { - "type": "image/svg+xml", - "etag": "\"589-HWVBMs8h46nV9RPh+2UPHEpRgOg\"", - "mtime": "2026-04-01T16:56:26.567Z", - "size": 1417, - "path": "../public/logo.svg" - }, - "/og-custom-qr-generator.png": { - "type": "image/png", - "etag": "\"73e16-2mmafTrETXyBLjYzPbf/gXJxRS8\"", - "mtime": "2026-03-06T16:32:06.893Z", - "size": 474646, - "path": "../public/og-custom-qr-generator.png" - }, - "/og-email-generator.png": { - "type": "image/png", - "etag": "\"7c0a8-1w0RK20KMhJVd0paUmPy7HndSCE\"", - "mtime": "2026-01-14T23:00:19.276Z", - "size": 508072, - "path": "../public/og-email-generator.png" - }, - "/og-geolocation-generator.png": { - "type": "image/png", - "etag": "\"7fbf6-YvUDhyD/9xBh8GN99/i2D0UvJ78\"", - "mtime": "2026-01-14T23:00:19.390Z", - "size": 523254, - "path": "../public/og-geolocation-generator.png" - }, - "/og-location-generator.png": { - "type": "image/png", - "etag": "\"7fbf6-YvUDhyD/9xBh8GN99/i2D0UvJ78\"", - "mtime": "2026-01-14T23:00:19.481Z", - "size": 523254, - "path": "../public/og-location-generator.png" - }, - "/og-image.png": { - "type": "image/png", - "etag": "\"73e16-2mmafTrETXyBLjYzPbf/gXJxRS8\"", - "mtime": "2026-01-22T18:34:58.065Z", - "size": 474646, - "path": "../public/og-image.png" - }, - "/og-manage-qr-codes.png": { - "type": "image/png", - "etag": "\"73e16-2mmafTrETXyBLjYzPbf/gXJxRS8\"", - "mtime": "2026-03-06T16:32:06.916Z", - "size": 474646, - "path": "../public/og-manage-qr-codes.png" - }, - "/og-crypto-generator.png": { - "type": "image/png", - "etag": "\"84bc0-VR2Y+iDqX3pzji6Km92dY+XwMlA\"", - "mtime": "2026-01-14T23:00:19.235Z", - "size": 543680, - "path": "../public/og-crypto-generator.png" - }, - "/og-instagram-generator.png": { - "type": "image/png", - "etag": "\"6ffd6-U3jBEIUsbAfa0DOsWy7+mS4w+8Q\"", - "mtime": "2026-01-14T23:00:19.462Z", - "size": 458710, - "path": "../public/og-instagram-generator.png" - }, - "/og-event-generator.png": { - "type": "image/png", - "etag": "\"942ac-ozcNuBYYu9hL7PNRsBUmSVnipKM\"", - "mtime": "2026-01-14T23:00:19.320Z", - "size": 606892, - "path": "../public/og-event-generator.png" - }, - "/og-facebook-generator.png": { - "type": "image/png", - "etag": "\"91b47-enmZPLVuUIz8HLum3VOm3sRvJiw\"", - "mtime": "2026-01-14T23:00:19.360Z", - "size": 596807, - "path": "../public/og-facebook-generator.png" - }, - "/og-sms-generator.png": { - "type": "image/png", - "etag": "\"6e850-+eGLOKnr9Ep31vRr68jqt6jYC5U\"", - "mtime": "2026-01-14T23:00:19.547Z", - "size": 452688, - "path": "../public/og-sms-generator.png" - }, - "/og-paypal-generator.png": { - "type": "image/png", - "etag": "\"74678-KEfwoMgPBKpdAkdBFFnehVfDZsY\"", - "mtime": "2026-01-14T23:00:19.504Z", - "size": 476792, - "path": "../public/og-paypal-generator.png" - }, - "/og-phone-generator.png": { - "type": "image/png", - "etag": "\"7c833-SC3SkLNugEygju6LiboZzTTAgF4\"", - "mtime": "2026-01-14T23:00:19.527Z", - "size": 510003, - "path": "../public/og-phone-generator.png" - }, - "/og-tiktok-generator.png": { - "type": "image/png", - "etag": "\"6336a-MbPLMIQtJRKIruH9JGNdM25RJAA\"", - "mtime": "2026-01-14T23:00:19.602Z", - "size": 406378, - "path": "../public/og-tiktok-generator.png" - }, - "/og-teams-generator.png": { - "type": "image/png", - "etag": "\"799ba-e9N98PP2GXEbqjx0Fdc54iYb2YE\"", - "mtime": "2026-01-14T23:00:19.566Z", - "size": 498106, - "path": "../public/og-teams-generator.png" - }, - "/og-text-generator.png": { - "type": "image/png", - "etag": "\"735e1-PIeFNZ0i5wysjVPELckPy6fze/8\"", - "mtime": "2026-01-14T23:00:19.586Z", - "size": 472545, - "path": "../public/og-text-generator.png" - }, - "/Move_the_4-5_202604201400.png": { - "type": "image/png", - "etag": "\"15ed2f-za4hPfOjOz3HTZ7IJeJhZEqBt18\"", - "mtime": "2026-04-23T12:07:07.932Z", - "size": 1436975, - "path": "../public/Move_the_4-5_202604201400.png" - }, - "/og-twitter-generator.png": { - "type": "image/png", - "etag": "\"53b8a-b/VY52EY3/8MMuahmPRXttePZH4\"", - "mtime": "2026-01-14T23:00:19.616Z", - "size": 342922, - "path": "../public/og-twitter-generator.png" - }, - "/meta-restaurant-dashboard-ad.png": { - "type": "image/png", - "etag": "\"1e7980-VOkJHVzu2juCIQ6IacSxxkVCXCs\"", - "mtime": "2026-06-28T15:42:11.453Z", - "size": 1997184, - "path": "../public/meta-restaurant-dashboard-ad.png" - }, - "/og-vcard-generator.png": { - "type": "image/png", - "etag": "\"8ab06-/NPWbYYOpJ9j0uBokhvPH/y7ACA\"", - "mtime": "2026-01-14T23:00:19.657Z", - "size": 568070, - "path": "../public/og-vcard-generator.png" - }, - "/og-url-generator.png": { - "type": "image/png", - "etag": "\"85b48-7aGKY6IMqwpNN6S9qITZNAf+P/8\"", - "mtime": "2026-01-14T23:00:19.636Z", - "size": 547656, - "path": "../public/og-url-generator.png" - }, - "/producthunt-featured.svg": { - "type": "image/svg+xml", - "etag": "\"3cd-iAa34l39IgBUw8YQHXNf6Pi1Nxg\"", - "mtime": "2026-07-06T19:51:29.403Z", - "size": 973, - "path": "../public/producthunt-featured.svg" - }, - "/og-wifi-generator.png": { - "type": "image/png", - "etag": "\"6b3e7-9X3KcTQ/I7tpXrBHAQ2hYq+zJBY\"", - "mtime": "2026-01-14T23:00:19.694Z", - "size": 439271, - "path": "../public/og-wifi-generator.png" - }, - "/og-whatsapp-generator.png": { - "type": "image/png", - "etag": "\"95e51-jQbHSxho6sdfRiKzlZIXFhAB3zs\"", - "mtime": "2026-01-14T23:00:19.678Z", - "size": 613969, - "path": "../public/og-whatsapp-generator.png" - }, - "/og-youtube-generator.png": { - "type": "image/png", - "etag": "\"621b4-srtYF6tA3WvCbdgYNX8NJgMVkyk\"", - "mtime": "2026-01-14T23:00:19.711Z", - "size": 401844, - "path": "../public/og-youtube-generator.png" - }, - "/restaurants-hero-og.jpg": { - "type": "image/jpeg", - "etag": "\"193c2-MgZtgqyYgblrNHiR/DZ3+n82IK4\"", - "mtime": "2026-06-28T15:42:11.454Z", - "size": 103362, - "path": "../public/restaurants-hero-og.jpg" - }, - "/restaurants-hero-wide.webp": { - "type": "image/webp", - "etag": "\"18ba4-GvCXzzrA+Goo+qyycOo5x6UD1Xs\"", - "mtime": "2026-06-28T15:42:11.461Z", - "size": 101284, - "path": "../public/restaurants-hero-wide.webp" - }, - "/Screenshot 2026-04-20 132947.png": { - "type": "image/png", - "etag": "\"1b06b-58cBVPldzhXmLSMeRZWBVKz4vNk\"", - "mtime": "2026-04-23T12:07:07.933Z", - "size": 110699, - "path": "../public/Screenshot 2026-04-20 132947.png" - }, - "/tiktokVwGRbyf2BbBLqUlFrnehtntSEU9Ihiok.txt": { - "type": "text/plain; charset=utf-8", - "etag": "\"46-+qp5BuWQlFl4jShMyLQwCOeJnAo\"", - "mtime": "2026-04-01T16:56:26.748Z", - "size": 70, - "path": "../public/tiktokVwGRbyf2BbBLqUlFrnehtntSEU9Ihiok.txt" - }, - "/Screenshot 2026-04-22 123347.png": { - "type": "image/png", - "etag": "\"200ba-cUyh8sSp0Qiu75OoAeDZ0R5/Lh0\"", - "mtime": "2026-04-23T12:07:07.935Z", - "size": 131258, - "path": "../public/Screenshot 2026-04-22 123347.png" - }, - "/images/restaurant_qr_flat_mockup.png": { - "type": "image/png", - "etag": "\"62cee-nyNg2dtE0RGx1Bqd40e2x6jcgS8\"", - "mtime": "2026-07-06T19:51:29.363Z", - "size": 404718, - "path": "../public/images/restaurant_qr_flat_mockup.png" - }, - "/og-zoom-generator.png": { - "type": "image/png", - "etag": "\"89afb-lFgTScGmFf0dIQDW0fftC0q+c7o\"", - "mtime": "2026-01-14T23:00:19.730Z", - "size": 563963, - "path": "../public/og-zoom-generator.png" - }, - "/.well-known/security.txt": { - "type": "text/plain; charset=utf-8", - "etag": "\"a6-hpWXLZ/xW+D/Zj5ArWJUTNjKMaw\"", - "mtime": "2026-01-22T18:34:57.960Z", - "size": 166, - "path": "../public/.well-known/security.txt" - }, - "/images/static-vs-dynamic-qr-de.svg": { - "type": "image/svg+xml", - "etag": "\"131f-dyOO5FlrInFML04PHS1MN+KeYr4\"", - "mtime": "2026-07-13T14:31:47.903Z", - "size": 4895, - "path": "../public/images/static-vs-dynamic-qr-de.svg" - }, - "/blog/2-hero.webp": { - "type": "image/webp", - "etag": "\"1f764-m2uZDRE7ZJI9M5qfHDYnyFim0W0\"", - "mtime": "2026-01-22T18:34:57.972Z", - "size": 128868, - "path": "../public/blog/2-hero.webp" - }, - "/blog/2-body.webp": { - "type": "image/webp", - "etag": "\"22ca4-tQZLJW3LlpY1x+WhazyMOD2IYlk\"", - "mtime": "2026-01-22T18:34:57.970Z", - "size": 142500, - "path": "../public/blog/2-body.webp" - }, - "/blog/1-hero.webp": { - "type": "image/webp", - "etag": "\"15a26-TDe8nH1U4ErSvqCzhKxiN56OzWg\"", - "mtime": "2026-01-22T18:34:57.968Z", - "size": 88614, - "path": "../public/blog/1-hero.webp" - }, - "/images/restaurant_qr_mockup.png": { - "type": "image/png", - "etag": "\"8d004-Wr3NtKdgJTt0EyT+yegc7w+3248\"", - "mtime": "2026-07-06T19:51:29.385Z", - "size": 577540, - "path": "../public/images/restaurant_qr_mockup.png" - }, - "/blog/best-qr-generator-2026.png": { - "type": "image/png", - "etag": "\"bb349-AqJ6LDeBqevDjmwh8cnvWSZBfg4\"", - "mtime": "2026-01-26T19:09:18.602Z", - "size": 766793, - "path": "../public/blog/best-qr-generator-2026.png" - }, - "/restaurants-hero-wide.png": { - "type": "image/png", - "etag": "\"1e7ea0-/RgTo9yWP6o5998FCA6gfAcKbo4\"", - "mtime": "2026-06-28T15:42:11.461Z", - "size": 1998496, - "path": "../public/restaurants-hero-wide.png" - }, - "/blog/bulk-qr-events-hero.png": { - "type": "image/png", - "etag": "\"c9160-YtmBbqp0/LKpotSnnSJPfwwkyyw\"", - "mtime": "2026-01-22T18:34:57.985Z", - "size": 823648, - "path": "../public/blog/bulk-qr-events-hero.png" - }, - "/blog/building-qr-generator.png": { - "type": "image/png", - "etag": "\"b8523-FdAl7rTd45Nrnpne7CxHaAqcgPU\"", - "mtime": "2026-01-22T18:34:57.978Z", - "size": 754979, - "path": "../public/blog/building-qr-generator.png" - }, - "/images/review-collection-qr-hero.png": { - "type": "image/png", - "etag": "\"181e32-khCSIYjAF+1i375shDkWzNiviw8\"", - "mtime": "2026-06-28T15:42:11.446Z", - "size": 1580594, - "path": "../public/images/review-collection-qr-hero.png" - }, - "/blog/editing_qr_dashboard.png": { - "type": "image/png", - "etag": "\"ae185-TwXW8N3XTVBj0ffD8CLubnpH+GE\"", - "mtime": "2026-07-09T20:43:35.236Z", - "size": 713093, - "path": "../public/blog/editing_qr_dashboard.png" - }, - "/blog/qr-code-analytics-dashboard.png": { - "type": "image/png", - "etag": "\"57731-y9ekUZzqwDJS7Z4oqUKuBmiB74s\"", - "mtime": "2026-01-22T18:34:58.006Z", - "size": 358193, - "path": "../public/blog/qr-code-analytics-dashboard.png" - }, - "/blog/free-barcode-generator-guide.png": { - "type": "image/png", - "etag": "\"9bd28-iD4vjj8a5Dv6KTV3nIhdcSn20eY\"", - "mtime": "2026-01-26T19:09:18.626Z", - "size": 638248, - "path": "../public/blog/free-barcode-generator-guide.png" - }, - "/blog/free-vs-paid-qr.png": { - "type": "image/png", - "etag": "\"962f2-Vcwa1TGHcFqgSXV/Yv56u/5gE+0\"", - "mtime": "2026-01-26T19:09:18.647Z", - "size": 615154, - "path": "../public/blog/free-vs-paid-qr.png" - }, - "/blog/dynamic-vs-static-hero-v2.png": { - "type": "image/png", - "etag": "\"d7179-n9127Zjitxpo6vrKj7nOCZHP0k0\"", - "mtime": "2026-01-22T18:34:57.995Z", - "size": 881017, - "path": "../public/blog/dynamic-vs-static-hero-v2.png" - }, - "/Split-screen_product_comparison_202604201333.png": { - "type": "image/png", - "etag": "\"20a08e-Ledt8cNPKsptDK+gcMU1OKcxLqg\"", - "mtime": "2026-04-23T12:07:07.950Z", - "size": 2138254, - "path": "../public/Split-screen_product_comparison_202604201333.png" - }, - "/blog/qr-code-analytics-hero.webp": { - "type": "image/webp", - "etag": "\"18bc6-xKcXogGnTzc84mIMHiIs27qlHzQ\"", - "mtime": "2026-01-22T18:34:58.017Z", - "size": 101318, - "path": "../public/blog/qr-code-analytics-hero.webp" - }, - "/blog/instagram-qr-code.png": { - "type": "image/png", - "etag": "\"9046e-sIaNtxduJGMHOcpl8Prd1l18K2k\"", - "mtime": "2026-01-26T19:09:18.668Z", - "size": 590958, - "path": "../public/blog/instagram-qr-code.png" - }, - "/blog/qr-api.png": { - "type": "image/png", - "etag": "\"d859e-X2HDaWmnkS22vA7RayBFRxC2aNs\"", - "mtime": "2026-01-26T19:09:18.698Z", - "size": 886174, - "path": "../public/blog/qr-api.png" - }, - "/blog/qr-code-generator-guide-hero.png": { - "type": "image/png", - "etag": "\"71885-XszAr/yWSHxVSIP2qqYc+NrxAxQ\"", - "mtime": "2026-01-22T18:34:58.025Z", - "size": 465029, - "path": "../public/blog/qr-code-generator-guide-hero.png" - }, - "/blog/qr-analytics-guide-hero.png": { - "type": "image/png", - "etag": "\"9d85d-s34ZIu8LtFKOCO0psO2qKiz2tDQ\"", - "mtime": "2026-01-22T18:34:58.002Z", - "size": 645213, - "path": "../public/blog/qr-analytics-guide-hero.png" - }, - "/blog/qr-code-tracking-guide-hero.webp": { - "type": "image/webp", - "etag": "\"178e2-oyfxhAZWTMyNfn2ZSdn1umrufNo\"", - "mtime": "2026-01-22T18:34:58.028Z", - "size": 96482, - "path": "../public/blog/qr-code-tracking-guide-hero.webp" - }, - "/blog/qr-code-tracking-guide-body.png": { - "type": "image/png", - "etag": "\"35b7a-QouImQa2Y2MiY/BneUUEJ6W9O00\"", - "mtime": "2026-01-22T18:34:58.027Z", - "size": 220026, - "path": "../public/blog/qr-code-tracking-guide-body.png" - }, - "/blog/qr-code-analytics-hero-v2.png": { - "type": "image/png", - "etag": "\"d7d9d-8Da48T63z2+wJYXQilwyaniQ63M\"", - "mtime": "2026-01-22T18:34:58.015Z", - "size": 884125, - "path": "../public/blog/qr-code-analytics-hero-v2.png" - }, - "/blog/qr-code-events.png": { - "type": "image/png", - "etag": "\"e0089-NifG2xY4bZg04M1fqjsSPUq3PnA\"", - "mtime": "2026-01-26T19:09:18.726Z", - "size": 917641, - "path": "../public/blog/qr-code-events.png" - }, - "/blog/qr-marketing-best-practices-hero.png": { - "type": "image/png", - "etag": "\"aec66-c1ND+d/1tsJ8k9ONtW3oRR2B9ag\"", - "mtime": "2026-01-22T18:34:58.042Z", - "size": 715878, - "path": "../public/blog/qr-marketing-best-practices-hero.png" - }, - "/blog/qr-code-tracking-hero-v2.png": { - "type": "image/png", - "etag": "\"a1696-a4uqn+nbr43OQLi/Dp6Zu1KmYLs\"", - "mtime": "2026-01-22T18:34:58.035Z", - "size": 661142, - "path": "../public/blog/qr-code-tracking-hero-v2.png" - }, - "/blog/qr-print-sizes.png": { - "type": "image/png", - "etag": "\"99883-9udEzPSE7n5cnio8POHcdYWU6/Q\"", - "mtime": "2026-01-14T23:00:18.450Z", - "size": 628867, - "path": "../public/blog/qr-print-sizes.png" - }, - "/blog/qr-marketing-strategy.png": { - "type": "image/png", - "etag": "\"a7fbd-EJFybD+z/PnK/hOsbJYwm9tArj0\"", - "mtime": "2026-01-26T19:09:18.769Z", - "size": 688061, - "path": "../public/blog/qr-marketing-strategy.png" - }, - "/blog/qr-sizes-body.png": { - "type": "image/png", - "etag": "\"a6eba-0zgLi5FlYoBjAHwVKr6WyVGAxis\"", - "mtime": "2026-01-14T23:00:18.486Z", - "size": 683706, - "path": "../public/blog/qr-sizes-body.png" - }, - "/blog/qr-security.png": { - "type": "image/png", - "etag": "\"f1735-AZ567PyU7b9+vy5ftLB046aaO7Y\"", - "mtime": "2026-01-26T19:09:18.803Z", - "size": 988981, - "path": "../public/blog/qr-security.png" - }, - "/blog/qr-statistics-2026.png": { - "type": "image/png", - "etag": "\"b1ec0-rIkhsH8pnouPD8fDQAmGkxmBuR8\"", - "mtime": "2026-01-26T19:09:18.835Z", - "size": 728768, - "path": "../public/blog/qr-statistics-2026.png" - }, - "/blog/static-vs-dynamic-qr-codes-hero.png": { - "type": "image/png", - "etag": "\"4297f-wgvSV+PHUX7kweCgXMT6Bk8EJo8\"", - "mtime": "2026-01-22T18:34:58.050Z", - "size": 272767, - "path": "../public/blog/static-vs-dynamic-qr-codes-hero.png" - }, - "/blog/static-vs-dynamic-qr-codes-body.png": { - "type": "image/png", - "etag": "\"5002d-5joBOxu7kWjZcUJy9Gc3kcn8yTQ\"", - "mtime": "2026-01-22T18:34:58.046Z", - "size": 327725, - "path": "../public/blog/static-vs-dynamic-qr-codes-body.png" - }, - "/blog/teams-qr-code.svg": { - "type": "image/svg+xml", - "etag": "\"daf-9b11orfQOcrGUu+5yHpCUUjo9w4\"", - "mtime": "2026-07-06T19:51:29.342Z", - "size": 3503, - "path": "../public/blog/teams-qr-code.svg" - }, - "/blog/restaurant-qr-menu.png": { - "type": "image/png", - "etag": "\"b92fa-xroo9xDRcV8W+SOue4gZEcwA9aE\"", - "mtime": "2026-01-14T23:00:18.560Z", - "size": 758522, - "path": "../public/blog/restaurant-qr-menu.png" - }, - "/blog/restaurant-qr-body.png": { - "type": "image/png", - "etag": "\"b0886-Smdr/7LDBNoFQsg21pfvlv49T1U\"", - "mtime": "2026-01-14T23:00:18.523Z", - "size": 723078, - "path": "../public/blog/restaurant-qr-body.png" - }, - "/blog/small-business-body.png": { - "type": "image/png", - "etag": "\"bdbd3-tFM6l3umm5DMQ1Bf5aTsAYttzbE\"", - "mtime": "2026-01-14T23:00:18.597Z", - "size": 777171, - "path": "../public/blog/small-business-body.png" - }, - "/blog/small-business-qr.png": { - "type": "image/png", - "etag": "\"bf993-0PpXi/YZ2UhMEpMojBUBpoNZVT8\"", - "mtime": "2026-01-14T23:00:18.633Z", - "size": 784787, - "path": "../public/blog/small-business-qr.png" - }, - "/blog/spotify-qr-code.png": { - "type": "image/png", - "etag": "\"90467-Uql675NzbyQOhI0v/fsiNO8pCX4\"", - "mtime": "2026-01-26T19:09:18.870Z", - "size": 590951, - "path": "../public/blog/spotify-qr-code.png" - }, - "/blog/static_vs_dynamic.png": { - "type": "image/png", - "etag": "\"b2687-kdtaNgy2+Q1RhgSs7Y6DQB03gYY\"", - "mtime": "2026-07-09T20:22:36.032Z", - "size": 730759, - "path": "../public/blog/static_vs_dynamic.png" - }, - "/blog/sustainable-packaging-qr.png": { - "type": "image/png", - "etag": "\"b59cb-jcd0xlfC/nekkZzg3tEVanqPquM\"", - "mtime": "2026-01-22T18:34:58.057Z", - "size": 743883, - "path": "../public/blog/sustainable-packaging-qr.png" - }, - "/blog/utm-qr-codes.png": { - "type": "image/png", - "etag": "\"a9be5-HqsHpvlT8N1uUkYwvcCxgladXv0\"", - "mtime": "2026-01-26T19:09:18.927Z", - "size": 695269, - "path": "../public/blog/utm-qr-codes.png" - }, - "/static/.gitkeep": { - "type": "text/plain; charset=utf-8", - "etag": "\"7c-hBYiOnUE/lO6XuSDS8JC2OB6StU\"", - "mtime": "2026-04-01T16:56:26.747Z", - "size": 124, - "path": "../public/static/.gitkeep" - }, - "/blog/trackable-qr-codes.png": { - "type": "image/png", - "etag": "\"a5961-u1tZHfTLt3AbxmDUA6mewpU5ATA\"", - "mtime": "2026-01-26T19:09:18.902Z", - "size": 678241, - "path": "../public/blog/trackable-qr-codes.png" - }, - "/static/og-image.png": { - "type": "image/png", - "etag": "\"73e16-2mmafTrETXyBLjYzPbf/gXJxRS8\"", - "mtime": "2026-03-06T16:32:06.951Z", - "size": 474646, - "path": "../public/static/og-image.png" - }, - "/blog/vcard-qr-body.png": { - "type": "image/png", - "etag": "\"b40d5-z+7ml++qJT3VkdVxapVBqqUU6Zo\"", - "mtime": "2026-01-14T23:00:18.727Z", - "size": 737493, - "path": "../public/blog/vcard-qr-body.png" - }, - "/blog/whatsapp-qr-code.png": { - "type": "image/png", - "etag": "\"92110-p+MntfIVxmzmOF9bP5dqdq1aV6c\"", - "mtime": "2026-01-26T19:09:18.950Z", - "size": 598288, - "path": "../public/blog/whatsapp-qr-code.png" - }, - "/blog/vcard-qr-code.png": { - "type": "image/png", - "etag": "\"9039c-wvoHMRl6dSXZ7YuA0UokP/3k3UE\"", - "mtime": "2026-01-14T23:00:18.777Z", - "size": 590748, - "path": "../public/blog/vcard-qr-code.png" - }, - "/images/examples/qr_example_ecommerce_1769163606650.png": { - "type": "image/png", - "etag": "\"81115-iAO1GDzcXDupgZk1sIK8TA5YJzY\"", - "mtime": "2026-01-25T21:07:41.866Z", - "size": 528661, - "path": "../public/images/examples/qr_example_ecommerce_1769163606650.png" - }, - "/images/examples/qr_example_event_1769163635077.png": { - "type": "image/png", - "etag": "\"69cd1-XzNC71Oa+99nr0fvtC8gJo3cWmY\"", - "mtime": "2026-01-25T21:07:41.883Z", - "size": 433361, - "path": "../public/images/examples/qr_example_event_1769163635077.png" - }, - "/images/examples/qr_example_business_1769163647196.png": { - "type": "image/png", - "etag": "\"a4528-UUf5bKoxY1XpMJ4Zf49upMOAZbQ\"", - "mtime": "2026-01-25T21:07:41.842Z", - "size": 673064, - "path": "../public/images/examples/qr_example_business_1769163647196.png" - }, - "/marketing/qrmaster-hero-generated-v1.png": { - "type": "image/png", - "etag": "\"157525-4kwnImLBhU36TZK8TUXQ8TS/xVg\"", - "mtime": "2026-04-23T12:07:07.991Z", - "size": 1406245, - "path": "../public/marketing/qrmaster-hero-generated-v1.png" - }, - "/images/examples/qr_example_realestate_1769163689433.png": { - "type": "image/png", - "etag": "\"7ae31-x7fTYLMvXS0oKXYibRTMWTmp2Sg\"", - "mtime": "2026-01-25T21:07:41.953Z", - "size": 503345, - "path": "../public/images/examples/qr_example_realestate_1769163689433.png" - }, - "/images/examples/qr_example_social_1769163660794.png": { - "type": "image/png", - "etag": "\"697c4-DHX+NwPQ+HMpcFWhEVeUqWHwFU0\"", - "mtime": "2026-01-25T21:07:41.997Z", - "size": 432068, - "path": "../public/images/examples/qr_example_social_1769163660794.png" - }, - "/blog/static-vs-dynamic-qr-code.png": { - "type": "image/png", - "etag": "\"229ea8-B0VrvfT4FlHXDX6qQv1L40/vJ1M\"", - "mtime": "2026-04-23T12:07:07.966Z", - "size": 2268840, - "path": "../public/blog/static-vs-dynamic-qr-code.png" - }, - "/images/og/og-custom-qr-generator.png": { - "type": "image/png", - "etag": "\"73e16-2mmafTrETXyBLjYzPbf/gXJxRS8\"", - "mtime": "2026-03-06T16:32:06.397Z", - "size": 474646, - "path": "../public/images/og/og-custom-qr-generator.png" - }, - "/images/og/og-email-generator.png": { - "type": "image/png", - "etag": "\"7c0a8-1w0RK20KMhJVd0paUmPy7HndSCE\"", - "mtime": "2026-03-06T16:32:06.423Z", - "size": 508072, - "path": "../public/images/og/og-email-generator.png" - }, - "/images/examples/qr_example_packaging_1769163674382.png": { - "type": "image/png", - "etag": "\"a198b-rFIfSeRVt0F2wFI38JWOdkKKbKM\"", - "mtime": "2026-01-25T21:07:41.931Z", - "size": 661899, - "path": "../public/images/examples/qr_example_packaging_1769163674382.png" - }, - "/images/examples/qr_example_nonprofit_1769163705055.png": { - "type": "image/png", - "etag": "\"a29b1-c0KJcjHl7X/rJv+DZrgUxz0y0OY\"", - "mtime": "2026-01-25T21:07:41.907Z", - "size": 666033, - "path": "../public/images/examples/qr_example_nonprofit_1769163705055.png" - }, - "/images/og/og-crypto-generator.png": { - "type": "image/png", - "etag": "\"84bc0-VR2Y+iDqX3pzji6Km92dY+XwMlA\"", - "mtime": "2026-03-06T16:32:06.369Z", - "size": 543680, - "path": "../public/images/og/og-crypto-generator.png" - }, - "/images/examples/qr_example_restaurant_1769163621640.png": { - "type": "image/png", - "etag": "\"af076-L+YH8kxXHCkh8TCveXdAH37KTvM\"", - "mtime": "2026-01-25T21:07:41.979Z", - "size": 716918, - "path": "../public/images/examples/qr_example_restaurant_1769163621640.png" - }, - "/images/og/og-geolocation-generator.png": { - "type": "image/png", - "etag": "\"7fbf6-YvUDhyD/9xBh8GN99/i2D0UvJ78\"", - "mtime": "2026-03-06T16:32:06.499Z", - "size": 523254, - "path": "../public/images/og/og-geolocation-generator.png" - }, - "/images/og/og-instagram-generator.png": { - "type": "image/png", - "etag": "\"6ffd6-U3jBEIUsbAfa0DOsWy7+mS4w+8Q\"", - "mtime": "2026-03-06T16:32:06.548Z", - "size": 458710, - "path": "../public/images/og/og-instagram-generator.png" - }, - "/images/og/og-image.png": { - "type": "image/png", - "etag": "\"73e16-2mmafTrETXyBLjYzPbf/gXJxRS8\"", - "mtime": "2026-03-06T16:32:06.527Z", - "size": 474646, - "path": "../public/images/og/og-image.png" - }, - "/images/og/og-location-generator.png": { - "type": "image/png", - "etag": "\"7fbf6-YvUDhyD/9xBh8GN99/i2D0UvJ78\"", - "mtime": "2026-03-06T16:32:06.566Z", - "size": 523254, - "path": "../public/images/og/og-location-generator.png" - }, - "/images/og/og-event-generator.png": { - "type": "image/png", - "etag": "\"942ac-ozcNuBYYu9hL7PNRsBUmSVnipKM\"", - "mtime": "2026-03-06T16:32:06.450Z", - "size": 606892, - "path": "../public/images/og/og-event-generator.png" - }, - "/images/og/og-facebook-generator.png": { - "type": "image/png", - "etag": "\"91b47-enmZPLVuUIz8HLum3VOm3sRvJiw\"", - "mtime": "2026-03-06T16:32:06.475Z", - "size": 596807, - "path": "../public/images/og/og-facebook-generator.png" - }, - "/images/og/og-manage-qr-codes.png": { - "type": "image/png", - "etag": "\"73e16-2mmafTrETXyBLjYzPbf/gXJxRS8\"", - "mtime": "2026-03-06T16:32:06.590Z", - "size": 474646, - "path": "../public/images/og/og-manage-qr-codes.png" - }, - "/images/og/og-paypal-generator.png": { - "type": "image/png", - "etag": "\"74678-KEfwoMgPBKpdAkdBFFnehVfDZsY\"", - "mtime": "2026-03-06T16:32:06.614Z", - "size": 476792, - "path": "../public/images/og/og-paypal-generator.png" - }, - "/images/og/og-phone-generator.png": { - "type": "image/png", - "etag": "\"7c833-SC3SkLNugEygju6LiboZzTTAgF4\"", - "mtime": "2026-03-06T16:32:06.635Z", - "size": 510003, - "path": "../public/images/og/og-phone-generator.png" - }, - "/images/og/og-sms-generator.png": { - "type": "image/png", - "etag": "\"6e850-+eGLOKnr9Ep31vRr68jqt6jYC5U\"", - "mtime": "2026-03-06T16:32:06.654Z", - "size": 452688, - "path": "../public/images/og/og-sms-generator.png" - }, - "/images/og/og-teams-generator.png": { - "type": "image/png", - "etag": "\"799ba-e9N98PP2GXEbqjx0Fdc54iYb2YE\"", - "mtime": "2026-03-06T16:32:06.676Z", - "size": 498106, - "path": "../public/images/og/og-teams-generator.png" - }, - "/images/og/og-text-generator.png": { - "type": "image/png", - "etag": "\"735e1-PIeFNZ0i5wysjVPELckPy6fze/8\"", - "mtime": "2026-03-06T16:32:06.700Z", - "size": 472545, - "path": "../public/images/og/og-text-generator.png" - }, - "/images/og/og-tiktok-generator.png": { - "type": "image/png", - "etag": "\"6336a-MbPLMIQtJRKIruH9JGNdM25RJAA\"", - "mtime": "2026-03-06T16:32:06.718Z", - "size": 406378, - "path": "../public/images/og/og-tiktok-generator.png" - }, - "/images/og/og-twitter-generator.png": { - "type": "image/png", - "etag": "\"53b8a-b/VY52EY3/8MMuahmPRXttePZH4\"", - "mtime": "2026-03-06T16:32:06.737Z", - "size": 342922, - "path": "../public/images/og/og-twitter-generator.png" - }, - "/images/og/og-wifi-generator.png": { - "type": "image/png", - "etag": "\"6b3e7-9X3KcTQ/I7tpXrBHAQ2hYq+zJBY\"", - "mtime": "2026-03-06T16:32:06.828Z", - "size": 439271, - "path": "../public/images/og/og-wifi-generator.png" - }, - "/images/og/og-youtube-generator.png": { - "type": "image/png", - "etag": "\"621b4-srtYF6tA3WvCbdgYNX8NJgMVkyk\"", - "mtime": "2026-03-06T16:32:06.847Z", - "size": 401844, - "path": "../public/images/og/og-youtube-generator.png" - }, - "/images/og/og-url-generator.png": { - "type": "image/png", - "etag": "\"85b48-7aGKY6IMqwpNN6S9qITZNAf+P/8\"", - "mtime": "2026-03-06T16:32:06.759Z", - "size": 547656, - "path": "../public/images/og/og-url-generator.png" - }, - "/images/og/og-vcard-generator.png": { - "type": "image/png", - "etag": "\"8ab06-/NPWbYYOpJ9j0uBokhvPH/y7ACA\"", - "mtime": "2026-03-06T16:32:06.783Z", - "size": 568070, - "path": "../public/images/og/og-vcard-generator.png" - }, - "/marketing/industries/bakeries.png": { - "type": "image/png", - "etag": "\"14993-0Hdc2zMPAuWFZri3bCjefTJbBeI\"", - "mtime": "2026-04-01T16:56:26.583Z", - "size": 84371, - "path": "../public/marketing/industries/bakeries.png" - }, - "/images/og/og-whatsapp-generator.png": { - "type": "image/png", - "etag": "\"95e51-jQbHSxho6sdfRiKzlZIXFhAB3zs\"", - "mtime": "2026-03-06T16:32:06.807Z", - "size": 613969, - "path": "../public/images/og/og-whatsapp-generator.png" - }, - "/marketing/industries/bars.png": { - "type": "image/png", - "etag": "\"f044-WiHLOCoM/JV6Ac5Mcy+ykTys6uQ\"", - "mtime": "2026-04-01T16:56:26.587Z", - "size": 61508, - "path": "../public/marketing/industries/bars.png" - }, - "/images/og/og-zoom-generator.png": { - "type": "image/png", - "etag": "\"89afb-lFgTScGmFf0dIQDW0fftC0q+c7o\"", - "mtime": "2026-03-06T16:32:06.870Z", - "size": 563963, - "path": "../public/images/og/og-zoom-generator.png" - }, - "/marketing/industries/cafes.png": { - "type": "image/png", - "etag": "\"f073-FkwYSaG6pOtPiK2Pqh0GTmSF6sU\"", - "mtime": "2026-04-01T16:56:26.597Z", - "size": 61555, - "path": "../public/marketing/industries/cafes.png" - }, - "/marketing/industries/breweries.png": { - "type": "image/png", - "etag": "\"1314a-rBiqKpuAyp+1ywvbHdFJoSoeV1g\"", - "mtime": "2026-04-01T16:56:26.596Z", - "size": 78154, - "path": "../public/marketing/industries/breweries.png" - }, - "/marketing/industries/airports.jpeg": { - "type": "image/jpeg", - "etag": "\"d590d-rONYG2kjusSlzjKYKC9vVHv3UD4\"", - "mtime": "2026-04-01T16:56:26.577Z", - "size": 874765, - "path": "../public/marketing/industries/airports.jpeg" - }, - "/marketing/industries/accountants.jpeg": { - "type": "image/jpeg", - "etag": "\"963f4-M7iohtR+5EaM3dAd0o7giYffdXw\"", - "mtime": "2026-04-01T16:56:26.572Z", - "size": 615412, - "path": "../public/marketing/industries/accountants.jpeg" - }, - "/marketing/industries/art-galleries.jpeg": { - "type": "image/jpeg", - "etag": "\"a2da9-gPs9/0Es/x3BzznTo2D4r2Hwpq4\"", - "mtime": "2026-04-01T16:56:26.581Z", - "size": 667049, - "path": "../public/marketing/industries/art-galleries.jpeg" - }, - "/marketing/industries/barbershops.jpeg": { - "type": "image/jpeg", - "etag": "\"c2b53-JgpgEFXgDjTkOmbKP4rabWOy7Pk\"", - "mtime": "2026-04-01T16:56:26.586Z", - "size": 797523, - "path": "../public/marketing/industries/barbershops.jpeg" - }, - "/marketing/industries/catering.png": { - "type": "image/png", - "etag": "\"105de-2MR15sKa5FtdvBcwUoWC0RtZ5tg\"", - "mtime": "2026-04-01T16:56:26.602Z", - "size": 67038, - "path": "../public/marketing/industries/catering.png" - }, - "/marketing/industries/beauty-salons.jpeg": { - "type": "image/jpeg", - "etag": "\"a0f85-ING48m4V3nTkRvDYPetpyhCUE3E\"", - "mtime": "2026-04-01T16:56:26.592Z", - "size": 659333, - "path": "../public/marketing/industries/beauty-salons.jpeg" - }, - "/marketing/industries/bookstores.jpeg": { - "type": "image/jpeg", - "etag": "\"cbd2a-HcQ9ipMeA4DVjja6i41Y2x5JzHs\"", - "mtime": "2026-04-01T16:56:26.595Z", - "size": 834858, - "path": "../public/marketing/industries/bookstores.jpeg" - }, - "/marketing/industries/car-dealerships.jpeg": { - "type": "image/jpeg", - "etag": "\"a216a-gT2fJqYK6pk9TbmOk4ke/zC9q9w\"", - "mtime": "2026-04-01T16:56:26.601Z", - "size": 663914, - "path": "../public/marketing/industries/car-dealerships.jpeg" - }, - "/marketing/industries/churches.jpeg": { - "type": "image/jpeg", - "etag": "\"c5899-jVImAA1UKosK+lqht0MO/j702x0\"", - "mtime": "2026-04-01T16:56:26.608Z", - "size": 809113, - "path": "../public/marketing/industries/churches.jpeg" - }, - "/marketing/industries/cinemas.jpeg": { - "type": "image/jpeg", - "etag": "\"9b775-3JQgGIjXSflpd3ZcZzKSso53Hvc\"", - "mtime": "2026-04-01T16:56:26.612Z", - "size": 636789, - "path": "../public/marketing/industries/cinemas.jpeg" - }, - "/marketing/industries/clothing-stores.jpeg": { - "type": "image/jpeg", - "etag": "\"a81ef-GmDNzTxSDSO0wkrtYzHNIFDsSHU\"", - "mtime": "2026-04-01T16:56:26.617Z", - "size": 688623, - "path": "../public/marketing/industries/clothing-stores.jpeg" - }, - "/marketing/industries/doctors-dentists.png": { - "type": "image/png", - "etag": "\"cdfd-nVMupv8WLnR17WCyMtmCmFwZ+R0\"", - "mtime": "2026-04-01T16:56:26.627Z", - "size": 52733, - "path": "../public/marketing/industries/doctors-dentists.png" - }, - "/marketing/industries/dentists.jpeg": { - "type": "image/jpeg", - "etag": "\"97a88-yeCUsqFPYUQAE6KjHmNAlZDR65U\"", - "mtime": "2026-04-01T16:56:26.626Z", - "size": 621192, - "path": "../public/marketing/industries/dentists.jpeg" - }, - "/marketing/industries/coworking-spaces.jpeg": { - "type": "image/jpeg", - "etag": "\"ab8d9-7IUJc+lAsCGvp3cOTmJzjB38FwY\"", - "mtime": "2026-04-01T16:56:26.621Z", - "size": 702681, - "path": "../public/marketing/industries/coworking-spaces.jpeg" - }, - "/marketing/industries/events.png": { - "type": "image/png", - "etag": "\"f911-n0lcSnIicgVatF7n/xiKt98grIA\"", - "mtime": "2026-04-01T16:56:26.632Z", - "size": 63761, - "path": "../public/marketing/industries/events.png" - }, - "/marketing/industries/food-trucks.png": { - "type": "image/png", - "etag": "\"19765-g0JuSePMFLYd84WHBcKrgu6vEMs\"", - "mtime": "2026-04-01T16:56:26.637Z", - "size": 104293, - "path": "../public/marketing/industries/food-trucks.png" - }, - "/marketing/industries/gyms.png": { - "type": "image/png", - "etag": "\"101b4-BIEKp50cZjY0eQ+dNtH+qRMI2+A\"", - "mtime": "2026-04-01T16:56:26.638Z", - "size": 65972, - "path": "../public/marketing/industries/gyms.png" - }, - "/marketing/industries/hotels.png": { - "type": "image/png", - "etag": "\"d902-qGaEuVo0Kj1ANCfzljQDHGsNIjE\"", - "mtime": "2026-04-01T16:56:26.644Z", - "size": 55554, - "path": "../public/marketing/industries/hotels.png" - }, - "/marketing/industries/electronics-stores.jpeg": { - "type": "image/jpeg", - "etag": "\"98532-6SfwTBwTuUnuzB/ccP3Cungh/fo\"", - "mtime": "2026-04-01T16:56:26.631Z", - "size": 623922, - "path": "../public/marketing/industries/electronics-stores.jpeg" - }, - "/marketing/industries/florists.jpeg": { - "type": "image/jpeg", - "etag": "\"d5690-8wcJkPkBYW/cwpxG34TAw9Xw5SQ\"", - "mtime": "2026-04-01T16:56:26.636Z", - "size": 874128, - "path": "../public/marketing/industries/florists.jpeg" - }, - "/marketing/industries/hardware-stores.jpeg": { - "type": "image/jpeg", - "etag": "\"ce543-yhKJOHSl8SoVWx41Wui0RNv/JLQ\"", - "mtime": "2026-04-01T16:56:26.643Z", - "size": 845123, - "path": "../public/marketing/industries/hardware-stores.jpeg" - }, - "/marketing/industries/nightclubs.png": { - "type": "image/png", - "etag": "\"11f46-WeGXxcgsEChsMlHnFtc4ZoWA0fk\"", - "mtime": "2026-04-01T16:56:26.674Z", - "size": 73542, - "path": "../public/marketing/industries/nightclubs.png" - }, - "/marketing/industries/insurance-agencies.jpeg": { - "type": "image/jpeg", - "etag": "\"909f7-lFPGkv6xBo585UKcLWAIBa0Mg0E\"", - "mtime": "2026-04-01T16:56:26.649Z", - "size": 592375, - "path": "../public/marketing/industries/insurance-agencies.jpeg" - }, - "/marketing/industries/jewelry-stores.jpeg": { - "type": "image/jpeg", - "etag": "\"96376-UBLZtKJMiNCrJy//JXb3p4qYX64\"", - "mtime": "2026-04-01T16:56:26.653Z", - "size": 615286, - "path": "../public/marketing/industries/jewelry-stores.jpeg" - }, - "/marketing/industries/law-firms.jpeg": { - "type": "image/jpeg", - "etag": "\"a4a00-PZGk/vE1NRPBwkyNJtHl18RJk1Q\"", - "mtime": "2026-04-01T16:56:26.658Z", - "size": 674304, - "path": "../public/marketing/industries/law-firms.jpeg" - }, - "/marketing/industries/libraries.jpeg": { - "type": "image/jpeg", - "etag": "\"bfcc3-IYv9tjQttngrkcEI+Gvvqdn0t30\"", - "mtime": "2026-04-01T16:56:26.663Z", - "size": 785603, - "path": "../public/marketing/industries/libraries.jpeg" - }, - "/marketing/industries/museums.jpeg": { - "type": "image/jpeg", - "etag": "\"c2f16-JuFJZ3i8Oap5bmIH3Kb5rt0eY+4\"", - "mtime": "2026-04-01T16:56:26.667Z", - "size": 798486, - "path": "../public/marketing/industries/museums.jpeg" - }, - "/marketing/industries/nail-salons.jpeg": { - "type": "image/jpeg", - "etag": "\"86d09-aVHnM0GmM/KFgIYsjiySp2Fuphw\"", - "mtime": "2026-04-01T16:56:26.672Z", - "size": 552201, - "path": "../public/marketing/industries/nail-salons.jpeg" - }, - "/marketing/industries/real-estate.png": { - "type": "image/png", - "etag": "\"14441-k5+L8iUV68TFSeq9Yw2VwxWfpeQ\"", - "mtime": "2026-04-01T16:56:26.695Z", - "size": 83009, - "path": "../public/marketing/industries/real-estate.png" - }, - "/marketing/industries/pet-stores.jpeg": { - "type": "image/jpeg", - "etag": "\"b5b68-nVgT9HOana8Bg3Tc4y5HhDcwsuc\"", - "mtime": "2026-04-01T16:56:26.682Z", - "size": 744296, - "path": "../public/marketing/industries/pet-stores.jpeg" - }, - "/marketing/industries/pet-grooming.jpeg": { - "type": "image/jpeg", - "etag": "\"9c8e6-GtPxdp1iGGqtwjEd89uchFKBcVU\"", - "mtime": "2026-04-01T16:56:26.678Z", - "size": 641254, - "path": "../public/marketing/industries/pet-grooming.jpeg" - }, - "/marketing/industries/restaurants.png": { - "type": "image/png", - "etag": "\"12701-fy284eu1FQXpYKaCnpHPmwowacE\"", - "mtime": "2026-04-01T16:56:26.695Z", - "size": 75521, - "path": "../public/marketing/industries/restaurants.png" - }, - "/marketing/industries/pharmacies.jpeg": { - "type": "image/jpeg", - "etag": "\"966e5-TrxJJYnCHr+SoiJVrYWXrfBb9X8\"", - "mtime": "2026-04-01T16:56:26.686Z", - "size": 616165, - "path": "../public/marketing/industries/pharmacies.jpeg" - }, - "/marketing/industries/property-management.jpeg": { - "type": "image/jpeg", - "etag": "\"bc019-hHrIncAgiBKWQPRjnlEpYRQQd1A\"", - "mtime": "2026-04-01T16:56:26.694Z", - "size": 770073, - "path": "../public/marketing/industries/property-management.jpeg" - }, - "/marketing/industries/retail.png": { - "type": "image/png", - "etag": "\"f793-3X4eO86keRJPZbPUJTW0s9DE4pY\"", - "mtime": "2026-04-01T16:56:26.696Z", - "size": 63379, - "path": "../public/marketing/industries/retail.png" - }, - "/marketing/industries/photographers.jpeg": { - "type": "image/jpeg", - "etag": "\"9a422-FbACxvHTdV/zbys+I/ARfrIeCEQ\"", - "mtime": "2026-04-01T16:56:26.690Z", - "size": 631842, - "path": "../public/marketing/industries/photographers.jpeg" - }, - "/marketing/industries/schools.jpeg": { - "type": "image/jpeg", - "etag": "\"af2f6-K95bA4b8wuJl/RA4SxHo769Qk1k\"", - "mtime": "2026-04-01T16:56:26.701Z", - "size": 717558, - "path": "../public/marketing/industries/schools.jpeg" - }, - "/marketing/industries/spas.jpeg": { - "type": "image/jpeg", - "etag": "\"8b693-YVhyxlTDxG25c4Yp1TjcrmdrTTI\"", - "mtime": "2026-04-01T16:56:26.705Z", - "size": 571027, - "path": "../public/marketing/industries/spas.jpeg" - }, - "/marketing/industries/stadiums.jpeg": { - "type": "image/jpeg", - "etag": "\"b2eeb-ApaofAh0tI7FgbMuTHLe32diMbk\"", - "mtime": "2026-04-01T16:56:26.710Z", - "size": 732907, - "path": "../public/marketing/industries/stadiums.jpeg" - }, - "/marketing/industries/theaters.jpeg": { - "type": "image/jpeg", - "etag": "\"adc48-H891URPP7x/y2roApAouSgGCCeg\"", - "mtime": "2026-04-01T16:56:26.719Z", - "size": 711752, - "path": "../public/marketing/industries/theaters.jpeg" - }, - "/marketing/industries/tattoo-studios.jpeg": { - "type": "image/jpeg", - "etag": "\"b8702-5LaCteXZfo/VNP+k2Pj/bhme3DQ\"", - "mtime": "2026-04-01T16:56:26.714Z", - "size": 755458, - "path": "../public/marketing/industries/tattoo-studios.jpeg" - }, - "/marketing/industries/wineries.png": { - "type": "image/png", - "etag": "\"12785-A40w526UGVYfKRnqbiIfY481QVU\"", - "mtime": "2026-04-01T16:56:26.745Z", - "size": 75653, - "path": "../public/marketing/industries/wineries.png" - }, - "/marketing/industries/yoga-studios.png": { - "type": "image/png", - "etag": "\"11cec-mRc6a+vvJ/RoDw/PXj3aONFUpO8\"", - "mtime": "2026-04-01T16:56:26.747Z", - "size": 72940, - "path": "../public/marketing/industries/yoga-studios.png" - }, - "/marketing/industries/universities.jpeg": { - "type": "image/jpeg", - "etag": "\"dfeb0-B9YXHdvabJbshBjgrieoLc6nfKA\"", - "mtime": "2026-04-01T16:56:26.736Z", - "size": 917168, - "path": "../public/marketing/industries/universities.jpeg" - }, - "/marketing/industries/travel-agencies.jpeg": { - "type": "image/jpeg", - "etag": "\"a1c0a-ggRF21VLOpIuYucksbS0Ee5xzGM\"", - "mtime": "2026-04-01T16:56:26.729Z", - "size": 662538, - "path": "../public/marketing/industries/travel-agencies.jpeg" - }, - "/marketing/industries/veterinarians.jpeg": { - "type": "image/jpeg", - "etag": "\"a360d-QwPiYFWIjS1fnqao77SnQHnEr60\"", - "mtime": "2026-04-01T16:56:26.741Z", - "size": 669197, - "path": "../public/marketing/industries/veterinarians.jpeg" - }, - "/marketing/industries/trade-shows.jpeg": { - "type": "image/jpeg", - "etag": "\"b142e-cRcUqO5Hymg2PCVJ2/3fZMD39kk\"", - "mtime": "2026-04-01T16:56:26.723Z", - "size": 726062, - "path": "../public/marketing/industries/trade-shows.jpeg" - }, - "/marketing/industries/wedding-planners.jpeg": { - "type": "image/jpeg", - "etag": "\"a6fda-HKmd0VWEsMRHyITtkDO8box8TfQ\"", - "mtime": "2026-04-01T16:56:26.744Z", - "size": 683994, - "path": "../public/marketing/industries/wedding-planners.jpeg" - }, - "/marketing/use-cases/event-qr-codes.png": { - "type": "image/png", - "etag": "\"a8109-zTdfBUUd8shk3Uka7ah2MmnNMwU\"", - "mtime": "2026-07-10T08:39:35.700Z", - "size": 688393, - "path": "../public/marketing/use-cases/event-qr-codes.png" - }, - "/marketing/use-cases/coupon-qr-codes.png": { - "type": "image/png", - "etag": "\"173dad-+avAvO5WGfEWHP6klccBC0M3Hpo\"", - "mtime": "2026-07-06T19:30:18.025Z", - "size": 1523117, - "path": "../public/marketing/use-cases/coupon-qr-codes.png" - }, - "/marketing/use-cases/business-card-qr-codes.png": { - "type": "image/png", - "etag": "\"1f9109-h4PLk0izUB6vbIeRnODqj75kPQc\"", - "mtime": "2026-07-06T19:22:07.813Z", - "size": 2068745, - "path": "../public/marketing/use-cases/business-card-qr-codes.png" - }, - "/social/tiktok/2026-07-10-print-once/slide-1-create-dynamic-qr.jpg": { - "type": "image/jpeg", - "etag": "\"2775c-MAwiwCQLKr+SfBk4xQivnHlCRo0\"", - "mtime": "2026-07-10T08:38:48.385Z", - "size": 161628, - "path": "../public/social/tiktok/2026-07-10-print-once/slide-1-create-dynamic-qr.jpg" - }, - "/marketing/use-cases/qr-codes-for-gyms.png": { - "type": "image/png", - "etag": "\"abb7b-S45YEmJFR3GXeLBoM4WFWiNjy3k\"", - "mtime": "2026-07-10T08:39:20.101Z", - "size": 703355, - "path": "../public/marketing/use-cases/qr-codes-for-gyms.png" - }, - "/social/tiktok/2026-07-10-print-once/slide-2-print-once-update-anytime.jpg": { - "type": "image/jpeg", - "etag": "\"299cb-ny5GwZ8KpJ2RyLeIde/f510v6gg\"", - "mtime": "2026-07-10T08:38:46.306Z", - "size": 170443, - "path": "../public/social/tiktok/2026-07-10-print-once/slide-2-print-once-update-anytime.jpg" - }, - "/marketing/use-cases/feedback-qr-codes.png": { - "type": "image/png", - "etag": "\"1d5fb4-fSMab3y/E1kZQUOHdUKhO33HYhE\"", - "mtime": "2026-07-06T19:30:17.935Z", - "size": 1925044, - "path": "../public/marketing/use-cases/feedback-qr-codes.png" - }, - "/marketing/use-cases/qr-codes-for-barbershops.png": { - "type": "image/png", - "etag": "\"1b735b-sh57hzKlPKY1cMMTmkS+oPt0bTI\"", - "mtime": "2026-07-06T19:30:18.094Z", - "size": 1799003, - "path": "../public/marketing/use-cases/qr-codes-for-barbershops.png" - }, - "/marketing/use-cases/real-estate-sign-qr-codes.png": { - "type": "image/png", - "etag": "\"dd6f0-3vWgGkqmmNLIMtbcElbr13mNb6Q\"", - "mtime": "2026-07-10T08:37:26.791Z", - "size": 906992, - "path": "../public/marketing/use-cases/real-estate-sign-qr-codes.png" - }, - "/marketing/use-cases/flyer-qr-codes.png": { - "type": "image/png", - "etag": "\"2048f4-ZCChcYigp92AObjV/kyKP+wZojI\"", - "mtime": "2026-07-06T19:22:07.871Z", - "size": 2115828, - "path": "../public/marketing/use-cases/flyer-qr-codes.png" - }, - "/marketing/use-cases/hotel-welcome-qr-codes.png": { - "type": "image/png", - "etag": "\"2098e0-m2Ue/gcvV1WFHmpYshZPwf1o/9Q\"", - "mtime": "2026-07-06T19:30:18.059Z", - "size": 2136288, - "path": "../public/marketing/use-cases/hotel-welcome-qr-codes.png" - }, - "/marketing/use-cases/payment-qr-codes.png": { - "type": "image/png", - "etag": "\"201335-HG7D89yriPNg2WlXz4CAsFp3GFY\"", - "mtime": "2026-07-06T19:30:17.992Z", - "size": 2102069, - "path": "../public/marketing/use-cases/payment-qr-codes.png" - }, - "/marketing/use-cases/packaging-qr-codes.png": { - "type": "image/png", - "etag": "\"2697cb-jwe0FDRSpi++rXDozvahc4ifbuM\"", - "mtime": "2026-07-06T19:30:17.877Z", - "size": 2529227, - "path": "../public/marketing/use-cases/packaging-qr-codes.png" - }, - "/marketing/use-cases/qr-codes-for-review-collection.png": { - "type": "image/png", - "etag": "\"1c9280-d+6u/xd1WRkdLJw13N0u2bEGaOc\"", - "mtime": "2026-07-06T19:30:17.962Z", - "size": 1872512, - "path": "../public/marketing/use-cases/qr-codes-for-review-collection.png" - }, - "/marketing/use-cases/salon-barbershop-qr-codes.png": { - "type": "image/png", - "etag": "\"19e808-8WvvC6otFZnhGSu63epg4PsKiCQ\"", - "mtime": "2026-07-06T17:37:35.499Z", - "size": 1697800, - "path": "../public/marketing/use-cases/salon-barbershop-qr-codes.png" - }, - "/marketing/use-cases/qr-codes-for-hotel.png": { - "type": "image/png", - "etag": "\"2098e0-m2Ue/gcvV1WFHmpYshZPwf1o/9Q\"", - "mtime": "2026-07-06T19:34:24.308Z", - "size": 2136288, - "path": "../public/marketing/use-cases/qr-codes-for-hotel.png" - }, - "/social/tiktok/2026-07-10-print-once/slide-5-change-link-after-printing.jpg": { - "type": "image/jpeg", - "etag": "\"29a30-Io7mSyZulRPXOvJ8SECFajK+GmA\"", - "mtime": "2026-07-10T08:38:40.506Z", - "size": 170544, - "path": "../public/social/tiktok/2026-07-10-print-once/slide-5-change-link-after-printing.jpg" - }, - "/social/tiktok/2026-07-10-print-once/slide-3-one-qr-menu-offers-events.jpg": { - "type": "image/jpeg", - "etag": "\"38868-pqfb/LohAtopFZBZUN6/znMxJx0\"", - "mtime": "2026-07-10T08:38:44.348Z", - "size": 231528, - "path": "../public/social/tiktok/2026-07-10-print-once/slide-3-one-qr-menu-offers-events.jpg" - }, - "/social/tiktok/2026-07-10-print-once/slide-4-track-which-menus-get-scanned.jpg": { - "type": "image/jpeg", - "etag": "\"2dbc9-drjEsDIpKPC/VDeMKl1KWs1on3I\"", - "mtime": "2026-07-10T08:38:42.394Z", - "size": 187337, - "path": "../public/social/tiktok/2026-07-10-print-once/slide-4-track-which-menus-get-scanned.jpg" - }, - "/marketing/use-cases/restaurant-menu-qr-codes.png": { - "type": "image/png", - "etag": "\"28efc1-hMFLUanRlc6xEtG0ysGjmzQ4nZ4\"", - "mtime": "2026-07-06T19:18:46.446Z", - "size": 2682817, - "path": "../public/marketing/use-cases/restaurant-menu-qr-codes.png" - } -}; -//#endregion -//#region #nitro/virtual/public-assets-node -function readAsset(id) { - const serverDir = dirname(fileURLToPath(globalThis.__nitro_main__)); - return promises.readFile(resolve(serverDir, public_assets_data_default[id].path)); -} -//#endregion -//#region #nitro/virtual/public-assets -const publicAssetBases = {}; -function isPublicAssetURL(id = "") { - if (public_assets_data_default[id]) return true; - for (const base in publicAssetBases) if (id.startsWith(base)) return true; - return false; -} -function getAsset(id) { - return public_assets_data_default[id]; -} -//#endregion -//#region node_modules/nitro/dist/runtime/internal/static.mjs -const METHODS = /* @__PURE__ */ new Set(["HEAD", "GET"]); -const EncodingMap = { - gzip: ".gz", - br: ".br", - zstd: ".zst" -}; -var static_default = defineHandler((event) => { - if (event.req.method && !METHODS.has(event.req.method)) return; - let id = decodePath(withLeadingSlash(withoutTrailingSlash(event.url.pathname))); - let asset; - const encodings = [...(event.req.headers.get("accept-encoding") || "").split(",").map((e) => EncodingMap[e.trim()]).filter(Boolean).sort(), ""]; - for (const encoding of encodings) for (const _id of [id + encoding, joinURL(id, "index.html" + encoding)]) { - const _asset = getAsset(_id); - if (_asset) { - asset = _asset; - id = _id; - break; - } - } - if (!asset) { - if (isPublicAssetURL(id)) { - event.res.headers.delete("Cache-Control"); - throw new HTTPError({ status: 404 }); - } - return; - } - if (encodings.length > 1) event.res.headers.append("Vary", "Accept-Encoding"); - if (event.req.headers.get("if-none-match") === asset.etag) { - event.res.status = 304; - event.res.statusText = "Not Modified"; - return ""; - } - const ifModifiedSinceH = event.req.headers.get("if-modified-since"); - const mtimeDate = new Date(asset.mtime); - if (ifModifiedSinceH && asset.mtime && new Date(ifModifiedSinceH) >= mtimeDate) { - event.res.status = 304; - event.res.statusText = "Not Modified"; - return ""; - } - if (asset.type) event.res.headers.set("Content-Type", asset.type); - if (asset.etag && !event.res.headers.has("ETag")) event.res.headers.set("ETag", asset.etag); - if (asset.mtime && !event.res.headers.has("Last-Modified")) event.res.headers.set("Last-Modified", mtimeDate.toUTCString()); - if (asset.encoding && !event.res.headers.has("Content-Encoding")) event.res.headers.set("Content-Encoding", asset.encoding); - if (asset.size > 0 && !event.res.headers.has("Content-Length")) event.res.headers.set("Content-Length", asset.size.toString()); - return readAsset(id); -}); -//#endregion -//#region #nitro/virtual/routing -const findRoute = /* @__PURE__ */ (() => { - const $0 = { - route: "/", - method: "GET", - handler: toEventHandler(GET__default) - }, $1 = { - route: "/eve/v1/health", - method: "GET", - handler: toEventHandler(health_default$1) - }, $2 = { - route: "/eve/v1/health", - method: "HEAD", - handler: toEventHandler(health_default) - }, $3 = { - route: "/eve/v1/info", - method: "GET", - handler: toEventHandler(info_default) - }, $4 = { - route: "/eve/v1/session", - method: "POST", - handler: toEventHandler(session_default) - }, $5 = { - route: "/.well-known/workflow/v1/flow", - handler: toEventHandler(workflows_handler_default) - }, $6 = { - route: "/eve/v1/session/:sessionId", - method: "POST", - handler: toEventHandler(_sessionId_default) - }, $7 = { - route: "/eve/v1/session/:sessionId/stream", - method: "GET", - handler: toEventHandler(stream_default) - }, $8 = { - route: "/eve/v1/connections/:name/callback/:token", - method: "GET", - handler: toEventHandler(_token_default$2) - }, $9 = { - route: "/eve/v1/connections/:name/callback/:token", - method: "POST", - handler: toEventHandler(_token_default$1) - }, $10 = { - route: "/eve/v1/callback/:token", - method: "POST", - handler: toEventHandler(_token_default) - }; - return (m, p) => { - if (p.charCodeAt(p.length - 1) === 47) p = p.slice(0, -1) || "/"; - if (p === "/") { - if (m === "GET") return { data: $0 }; - } else if (p === "/eve/v1/health") { - if (m === "GET") return { data: $1 }; - if (m === "HEAD") return { data: $2 }; - } else if (p === "/eve/v1/info") { - if (m === "GET") return { data: $3 }; - } else if (p === "/eve/v1/session") { - if (m === "POST") return { data: $4 }; - } else if (p === "/.well-known/workflow/v1/flow") return { data: $5 }; - let s = p.split("/"), l = s.length; - if (l > 1) { - if (s[1] === "eve") { - if (l > 2) { - if (s[2] === "v1") { - if (l > 3) { - if (s[3] === "session") { - if (l === 5 || l === 4) { - if (m === "POST") { - if (l > 4) return { - data: $6, - params: { "sessionId": s[4] } - }; - } - } else if (s[5] === "stream") { - if (l === 6) { - if (m === "GET") return { - data: $7, - params: { "sessionId": s[4] } - }; - } - } - } else if (s[3] === "connections") { - if (l > 5) { - if (s[5] === "callback") { - if (l === 7 || l === 6) { - if (m === "GET") { - if (l > 6) return { - data: $8, - params: { - "name": s[4], - "token": s[6] - } - }; - } - if (m === "POST") { - if (l > 6) return { - data: $9, - params: { - "name": s[4], - "token": s[6] - } - }; - } - } - } - } - } else if (s[3] === "callback") { - if (l === 5 || l === 4) { - if (m === "POST") { - if (l > 4) return { - data: $10, - params: { "token": s[4] } - }; - } - } - } - } - } - } - } - } - }; -})(); -const globalMiddleware = [toEventHandler(static_default)].filter(Boolean); -//#endregion -//#region node_modules/nitro/dist/runtime/internal/error/prod.mjs -const errorHandler = (error, event) => { - const res = defaultHandler(error, event); - return new NodeResponse(typeof res.body === "string" ? res.body : JSON.stringify(res.body, null, 2), res); -}; -function defaultHandler(error, event) { - const unhandled = error.unhandled ?? !HTTPError.isError(error); - const { status = 500, statusText = "" } = unhandled ? {} : error; - if (status === 404) { - const url = event.url || new URL(event.req.url); - const baseURL = "/"; - if (/^\/[^/]/.test(baseURL) && !url.pathname.startsWith(baseURL)) return { - status: 302, - headers: new Headers({ location: `${baseURL}${url.pathname.slice(1)}${url.search}` }) - }; - } - const headers = new Headers(unhandled ? {} : error.headers); - headers.set("content-type", "application/json; charset=utf-8"); - return { - status, - statusText, - headers, - body: { - error: true, - ...unhandled ? { - status, - unhandled: true - } : typeof error.toJSON === "function" ? error.toJSON() : { - status, - statusText, - message: error.message - } - } - }; -} -//#endregion -//#region #nitro/virtual/error-handler -const errorHandlers = [errorHandler]; -async function error_handler_default(error, event) { - for (const handler of errorHandlers) try { - const response = await handler(error, event, { defaultHandler }); - if (response) return response; - } catch (error) { - console.error(error); - } -} -//#endregion -//#region .eve/compile/compiled-artifacts-bootstrap.mjs -installEveWorkflowQueueNamespace("qr-master"); -const moduleMap = Object.freeze({ "nodes": Object.freeze({ "__root__": Object.freeze({ "modules": Object.freeze({ - "connections/dataforseo.ts": dataforseo_exports, - "sandbox/sandbox.ts": sandbox_exports, - "tools/list_search_console_sites.ts": list_search_console_sites_exports, - "tools/query_search_analytics.ts": query_search_analytics_exports -}) }) }) }); -const metadata = { - "compile": { "moduleMap": { - "path": ".eve/compile/module-map.mjs", - "sha256": "c76cab7c1a37dca6eb591740264f371cca3e74760abc1f9fc4652f959f1e0353" - } }, - "discovery": { - "diagnostics": { - "path": ".eve/discovery/diagnostics.json", - "sha256": "b26fc8e66ee943f962b1bab4a790f6a611ce7e6738aa29f83ea53b73cc362c63" - }, - "manifest": { - "path": ".eve/discovery/agent-discovery-manifest.json", - "sha256": "305c68e3493f0a1ba53702641dbf8675e60374b68a24b73f13b69ac6246dbcaa" - }, - "sourceGraphHash": "3370c163e654fd12b5b4097da0747ee823445d615e0713c04b38ac808c739532", - "summary": { - "errors": 0, - "warnings": 0 - } - }, - "generator": { - "name": "eve", - "version": "0.16.2" - }, - "kind": "eve-compile-metadata", - "status": "ready", - "version": 5 -}; -const manifest = { - "agentRoot": "C:\\Users\\timo\\Documents\\qrmaster\\QR-master\\agent", - "appRoot": "C:\\Users\\timo\\Documents\\qrmaster\\QR-master", - "channels": [], - "connections": [{ - "connectionName": "dataforseo", - "logicalPath": "connections/dataforseo.ts", - "sourceId": "connections/dataforseo.ts", - "sourceKind": "module", - "description": "DataForSEO rankings data: live SERP results by keyword/location, the domain's ranked keywords with position and search volume, keyword gaps against competitors, and search volume lookups.", - "protocol": "mcp", - "url": "https://mcp.dataforseo.com/mcp" - }], - "config": { - "compaction": {}, - "model": { - "id": "anthropic/claude-sonnet-4.6", - "routing": { - "kind": "gateway", - "target": "anthropic" - }, - "contextWindowTokens": 1e6 - }, - "name": "qr-master" - }, - "diagnosticsSummary": { - "errors": 0, - "warnings": 0 - }, - "disabledFrameworkTools": [], - "workflowEnabled": false, - "dynamicInstructions": [], - "dynamicSkills": [], - "dynamicTools": [], - "hooks": [], - "remoteAgents": [], - "sandbox": { - "backendName": "just-bash", - "logicalPath": "sandbox/sandbox.ts", - "revalidationKey": "seo-improver-agent-browser-gh-v1", - "sourceHash": "838127a7092961bbfd47e3b91a0e14b19afb7d655167d4d079c474abd40f570e", - "sourceId": "sandbox/sandbox.ts", - "sourceKind": "module" - }, - "sandboxWorkspaces": [{ - "logicalPath": "sandbox/workspace", - "rootEntries": ["setup-agent-browser.sh", "setup-gh.sh"], - "sourceId": "sandbox/workspace", - "sourcePath": "C:\\Users\\timo\\Documents\\qrmaster\\QR-master\\agent\\sandbox\\workspace" - }], - "schedules": [{ - "cron": "0 9 * * 1", - "hasRun": false, - "logicalPath": "schedules/weekly.ts", - "name": "weekly", - "sourceId": "schedules/weekly.ts", - "sourceKind": "module", - "markdown": "Run the weekly SEO improver loop for the configured property and tracked keywords." - }], - "skills": [], - "tools": [{ - "description": "List the Search Console properties the configured service account can access. Useful to confirm access and the exact property name before querying.", - "inputSchema": { - "type": "object", - "additionalProperties": false, - "properties": {} - }, - "logicalPath": "tools/list_search_console_sites.ts", - "name": "list_search_console_sites", - "sourceId": "tools/list_search_console_sites.ts", - "sourceKind": "module" - }, { - "description": "Query Google Search Console Search Analytics for the property: the site's own real clicks, impressions, CTR, and average position by query, page, country, device, and date. First-party ground truth for striking-distance, low-CTR, cannibalization, and decay analysis.", - "inputSchema": { - "type": "object", - "additionalProperties": false, - "required": [ - "siteUrl", - "startDate", - "endDate" - ], - "properties": { - "siteUrl": { - "type": "string", - "description": "The property, e.g. `sc-domain:example.com` or `https://www.example.com/`." - }, - "startDate": { - "type": "string", - "description": "YYYY-MM-DD (inclusive)." - }, - "endDate": { - "type": "string", - "description": "YYYY-MM-DD (inclusive)." - }, - "dimensions": { - "type": "array", - "items": { - "type": "string", - "enum": [ - "query", - "page", - "country", - "device", - "date", - "searchAppearance" - ] - } - }, - "type": { - "type": "string", - "enum": [ - "web", - "image", - "video", - "news", - "discover", - "googleNews" - ] - }, - "dataState": { - "type": "string", - "enum": ["final", "all"] - }, - "rowLimit": { - "type": "integer", - "description": "Max rows, up to 25000." - }, - "startRow": { - "type": "integer", - "description": "Zero-based row offset for paging." - }, - "dimensionFilterGroups": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true - } - } - } - }, - "logicalPath": "tools/query_search_analytics.ts", - "name": "query_search_analytics", - "sourceId": "tools/query_search_analytics.ts", - "sourceKind": "module" - }], - "workspaceResourceRoot": { - "contentHash": "9f97e6abb4302039c6c4e2b3d4de3cf5c149de805a90c3e20c3f21da697afb92", - "logicalPath": "workspace-resources/__root__", - "rootEntries": ["setup-agent-browser.sh", "setup-gh.sh"] - }, - "instructions": { - "name": "instructions", - "logicalPath": "instructions.md", - "markdown": "\r\nSearch Console property: https://www.qrmaster.net/\r\nProject domain: qrmaster.net\r\nTracked keywords: not set (derive from the domain's own ranked keywords)\r\nBlog repo and content path: not set (report-only)\r\n\r\n\r\nYou are an SEO improver agent. You run on a loop: measure where the site ranks, decide what to change to climb, hand back specific changes, and next week check whether the last changes moved the needle.\r\n\r\nYou do three things every run: **track rankings**, **prioritize a small set of high-leverage improvements**, and **report movement since the previous run**. You do not guess at rankings; you read them from data. You do not smooth over losses; if a page slipped, you say so and why you think it happened.\r\n\r\nYour project configuration is the `project-config` block at the top of this file. Do not assume values from examples. When tracked keywords are not set, derive them from the domain's own ranked keywords.\r\n\r\n## Data sources\r\n\r\nYou use two sources, and each answers a different question. **Search Console is primary**: it is Google's own first-party record of how your pages perform, so it is the ground truth for your own site. **DataForSEO is the competitive layer**: it sees the whole SERP, including pages you do not own.\r\n\r\nUse the `query_search_analytics` tool for your site's real performance: clicks, impressions, CTR, and average position by query and page, for the configured property. Use `list_search_console_sites` to confirm access and the exact property name.\r\n\r\nUse the `dataforseo` connection for what Search Console cannot see: the live SERP for a keyword, who ranks above you and what their pages do, search volume, and keyword gaps you do not yet rank for. It exposes only the tools for those four jobs. This is how you answer \"who is beating me and why\" and size the opportunity.\r\n\r\nIf either source is unauthorized or errors, stop and report that blocker instead of fabricating data. Do not silently fall back to a single source.\r\n\r\nUse native sandbox command execution for lightweight checks such as `curl`, `node`, CSV/JSON writing, HTTP status, titles, and parsing. Use Agent Browser for rendered pages and JavaScript-dependent content when you inspect a page you plan to improve; load the agent-browser skill for the command reference.\r\n\r\nKeep the run read-only against the target site. Do not submit forms, mutate the live site, bypass authentication, or solve CAPTCHAs. Respect robots and obvious rate limits. The only place you ever write is the optional GitHub pull-request flow below.\r\n\r\n## State and the loop\r\n\r\nPersist each run under `reports/seo-improver//`. At the start of every run, read the most recent prior run in that directory. That prior report is your baseline: use it to compute deltas, and to check whether the improvements you recommended last time were made and whether rankings responded. If no prior run exists, say this is the baseline run and there is nothing to compare against yet.\r\n\r\n## Each run\r\n\r\n1. Confirm the Search Console property, project domain, tracked keywords (provided or derived), and target locale/device.\r\n2. Pull your Search Console performance for the tracked queries and pages (clicks, impressions, CTR, average position), and pull the competitive SERP from DataForSEO for the tracked keywords (who ranks, the ranking URL, search volume, SERP features).\r\n3. Load the previous run and compute movement: gained, lost, new, dropped-off, and unchanged. Flag anything that fell out of the top 100.\r\n4. Identify the highest-leverage opportunities, ranked by realistic upside, not just raw volume:\r\n - **Striking distance**: queries at ~4-20 where a focused improvement can win a page-1 or top-3 slot; confirm the competition against the live SERP.\r\n - **High impressions, low CTR**: pages that earn impressions but lose the click; rewrite title/meta to win it without new rankings.\r\n - **Cannibalization**: several of your pages competing for one query; recommend which to consolidate.\r\n - **Decay**: pages whose clicks or position fell since a prior run; diagnose likely cause (content staleness, lost links, SERP change, intent shift) and check DataForSEO for what moved above you.\r\n5. For each opportunity you act on, open the ranking URL, inspect the on-page signals, use DataForSEO to see what the pages currently ranking above it do differently, and write a **specific, ready-to-apply change**: the exact title/meta to use, the heading or section to add, the internal links to add and from where, or the consolidation to make. Tie every recommendation to the ranking evidence that motivates it.\r\n6. Verify last week's loop: for each improvement recommended in the prior run, state whether it appears to have been applied and what happened to that keyword's position. Keep what worked, drop or revise what did not.\r\n\r\n## Output\r\n\r\nWrite two artifacts under `reports/seo-improver//`:\r\n\r\n- `rankings.csv` — the tracked-keyword snapshot for week-over-week diffing.\r\n\r\n ```csv\r\n keyword,location,device,position,previous_position,delta,ranking_url,search_volume,serp_features,status\r\n ```\r\n\r\n `status` is one of `gained`, `lost`, `new`, `dropped`, or `flat`. `delta` is positive when position improved (moved toward #1). Leave `previous_position` blank on the baseline run.\r\n\r\n- `report.md` — a concise Markdown report:\r\n 1. Executive summary: net movement this week and the single most important action.\r\n 2. Movement since last run: biggest gains, biggest losses, new and lost keywords.\r\n 3. Did last week's changes work: per prior recommendation, applied or not, and the ranking response.\r\n 4. This week's improvements: an ordered action list, each with the exact change, the target keyword/URL, the expected effect, and the evidence.\r\n 5. Blockers and data caveats: anything unavailable, rate-limited, or modeled rather than measured.\r\n\r\nUse stable IDs such as `SEO-STRIKE-001`, `SEO-CTR-002`, `SEO-DECAY-003` so recommendations are easy to reference across runs and you can report next week on the same ID.\r\n\r\nKeep the action list short and high-conviction. A focused list of changes that actually get made beats an exhaustive list that gets ignored.\r\n\r\n## Applying changes to a GitHub blog (optional)\r\n\r\nBy default you only report. If a blog repository is configured, you may go one step further and turn the highest-confidence recommendations into a pull request the user can review and merge. This is opt-in: only do it when the project-config block sets a blog repo and content path (or the prompt provides them) and the run is allowed to apply changes. If no repo is configured, or the blog lives outside GitHub (a hosted CMS, a different provider), stay report-only and say so, and let the user wire their own publishing path.\r\n\r\nUse the sandbox `bash` tool to run the GitHub CLI (`gh`), targeting the configured repo with `-R owner/repo`. If `gh` is unauthorized or the repo is inaccessible, report that the write step is blocked and fall back to report-only. Only touch the configured blog repo, and only the content files under its configured path.\r\n\r\nWhen you apply changes:\r\n\r\n1. Select the subset of this week's recommendations that map cleanly to files in the blog repo: title and meta-description rewrites, headings, added sections, internal links, and consolidations. Skip anything you cannot ground in a specific source file.\r\n2. Clone or fetch the repo, create a new branch named like `seo-improver/-`, and edit the source files (Markdown, MDX, or frontmatter). Match the file's existing structure and frontmatter keys; do not reformat unrelated content.\r\n3. Open a pull request with `gh pr create`. Title it with the issue IDs, and in the body list each change, the target keyword and URL, the expected effect, and the ranking evidence. Never push to the default branch, never merge, never force-push.\r\n4. Record every PR URL in `report.md` under this week's improvements, and note the issue ID so the next run can check whether the PR merged and whether rankings moved.\r\n\r\nOne branch and pull request per run unless the user asks otherwise. Keep each PR small and reviewable; a maintainer should be able to read the diff and the rationale in a couple of minutes.\r\n", - "sourceId": "instructions.md", - "sourceKind": "markdown" - }, - "kind": "eve-agent-compiled-manifest", - "subagentEdges": [], - "subagents": [], - "version": 31 -}; -function installCompiledArtifactsBootstrap() { - installBundledCompiledArtifacts({ - manifest, - metadata, - moduleMap - }); -} -installCompiledArtifactsBootstrap(); -function installCompiledArtifactsPlugin() {} -async function __eveInstallCompiledArtifactsStep() { - return null; -} -s("step//./.eve/compile/compiled-artifacts-bootstrap//__eveInstallCompiledArtifactsStep", __eveInstallCompiledArtifactsStep); -//#endregion -//#region #nitro/virtual/plugins -const plugins = [installCompiledArtifactsPlugin]; -//#endregion -//#region #nitro/virtual/app -function createNitroApp() { - const hooks = new HookableCore(); - const captureError = (error, errorCtx) => { - const promise = hooks.callHook("error", error, errorCtx)?.catch?.((hookError) => { - console.error("Error while capturing another error", hookError); - }); - if (errorCtx?.event) { - const errors = errorCtx.event.req.context?.nitro?.errors; - if (errors) errors.push({ - error, - context: errorCtx - }); - if (promise && typeof errorCtx.event.req.waitUntil === "function") errorCtx.event.req.waitUntil(promise); - } - }; - const h3App = createH3App({ onError(error, event) { - captureError(error, { event }); - return error_handler_default(error, event); - } }); - h3App.config.onRequest = (event) => { - return hooks.callHook("request", event)?.catch?.((error) => { - captureError(error, { - event, - tags: ["request"] - }); - }); - }; - h3App.config.onResponse = (res, event) => { - return hooks.callHook("response", res, event)?.catch?.((error) => { - captureError(error, { - event, - tags: ["response"] - }); - }); - }; - let appHandler = (req) => { - req.context ||= {}; - req.context.nitro = req.context.nitro || { errors: [] }; - return h3App.fetch(req); - }; - return { - fetch: appHandler, - h3: h3App, - hooks, - captureError - }; -} -function initNitroPlugins(app) { - for (const plugin of plugins) try { - plugin(app); - } catch (error) { - app.captureError?.(error, { tags: ["plugin"] }); - throw error; - } - return app; -} -function createH3App(config) { - const h3App = new H3Core(config); - h3App["~findRoute"] = (event) => findRoute(event.req.method, event.url.pathname); - h3App["~middleware"].push(...globalMiddleware); - return h3App; -} -//#endregion -//#region node_modules/nitro/dist/runtime/internal/app.mjs -const APP_ID = "default"; -function useNitroApp() { - let instance = useNitroApp._instance; - if (instance) return instance; - instance = useNitroApp._instance = createNitroApp(); - globalThis.__nitro__ = globalThis.__nitro__ || {}; - globalThis.__nitro__[APP_ID] = instance; - initNitroPlugins(instance); - return instance; -} -//#endregion -//#region #nitro/virtual/tasks -const scheduledTasks = [{ - "cron": "0 9 * * 1", - "tasks": ["eve.schedule.c2NoZWR1bGVzL3dlZWtseS50cw"] -}]; -const tasks = { "eve.schedule.c2NoZWR1bGVzL3dlZWtseS50cw": { - meta: { description: "Run eve schedule \"weekly\" from \"schedules/weekly.ts\"." }, - resolve: () => import("./_virtual/eve.schedule.mjs").then((r) => r.default || r) -} }; -//#endregion -//#region node_modules/nitro/dist/runtime/internal/task.mjs -const __runningTasks__ = {}; -async function runTask(name, { payload = {}, context = {} } = {}) { - if (__runningTasks__[name]) return __runningTasks__[name]; - if (!(name in tasks)) throw new HTTPError({ - message: `Task \`${name}\` is not available!`, - status: 404 - }); - if (!tasks[name].resolve) throw new HTTPError({ - message: `Task \`${name}\` is not implemented!`, - status: 501 - }); - const handler = await tasks[name].resolve(); - const taskEvent = { - name, - payload, - context - }; - __runningTasks__[name] = handler.run(taskEvent); - try { - return await __runningTasks__[name]; - } finally { - delete __runningTasks__[name]; - } -} -function startScheduleRunner({ waitUntil } = {}) { - if (!scheduledTasks || scheduledTasks.length === 0 || process.env.TEST) return; - const payload = { scheduledTime: Date.now() }; - for (const schedule of scheduledTasks) new E(schedule.cron, async () => { - await Promise.all(schedule.tasks.map((name) => runTask(name, { - payload, - context: { waitUntil } - }).catch((error) => { - console.error(`Error while running scheduled task "${name}"`, error); - }))); - }); -} -//#endregion -//#region node_modules/nitro/dist/runtime/internal/error/hooks.mjs -function _captureError(error, type) { - console.error(`[${type}]`, error); - useNitroApp().captureError?.(error, { tags: [type] }); -} -function trapUnhandledErrors() { - process.on("unhandledRejection", (error) => _captureError(error, "unhandledRejection")); - process.on("uncaughtException", (error) => _captureError(error, "uncaughtException")); -} -//#endregion -//#region #nitro/virtual/tracing -const tracingSrvxPlugins = []; -//#endregion -//#region node_modules/nitro/dist/presets/node/runtime/node-server.mjs -const _parsedPort = Number.parseInt(process.env.NITRO_PORT ?? process.env.PORT ?? ""); -const port = Number.isNaN(_parsedPort) ? 3e3 : _parsedPort; -const host = process.env.NITRO_HOST || process.env.HOST; -const cert = process.env.NITRO_SSL_CERT; -const key = process.env.NITRO_SSL_KEY; -const nitroApp = useNitroApp(); -const server = serve({ - port, - hostname: host, - tls: cert && key ? { - cert, - key - } : void 0, - fetch: nitroApp.fetch, - plugins: [...tracingSrvxPlugins] -}); -trapUnhandledErrors(); -startScheduleRunner({ waitUntil: server.waitUntil }); -var node_server_default = {}; -//#endregion -export { node_server_default as default }; diff --git a/.output/server/node_modules/@jitl/quickjs-ffi-types/dist/index.mjs b/.output/server/node_modules/@jitl/quickjs-ffi-types/dist/index.mjs deleted file mode 100644 index eddabdc..0000000 --- a/.output/server/node_modules/@jitl/quickjs-ffi-types/dist/index.mjs +++ /dev/null @@ -1,2 +0,0 @@ -function assertSync(fn){return function(...args){let result=fn(...args);if(result&&typeof result=="object"&&result instanceof Promise)throw new Error("Function unexpectedly returned a Promise");return result}}var EvalFlags={JS_EVAL_TYPE_GLOBAL:0,JS_EVAL_TYPE_MODULE:1,JS_EVAL_TYPE_DIRECT:2,JS_EVAL_TYPE_INDIRECT:3,JS_EVAL_TYPE_MASK:3,JS_EVAL_FLAG_STRICT:8,JS_EVAL_FLAG_STRIP:16,JS_EVAL_FLAG_COMPILE_ONLY:32,JS_EVAL_FLAG_BACKTRACE_BARRIER:64},IntrinsicsFlags={BaseObjects:1,Date:2,Eval:4,StringNormalize:8,RegExp:16,RegExpCompiler:32,JSON:64,Proxy:128,MapSet:256,TypedArrays:512,Promise:1024,BigInt:2048,BigFloat:4096,BigDecimal:8192,OperatorOverloading:16384,BignumExt:32768},JSPromiseStateEnum={Pending:0,Fulfilled:1,Rejected:2},GetOwnPropertyNamesFlags={JS_GPN_STRING_MASK:1,JS_GPN_SYMBOL_MASK:2,JS_GPN_PRIVATE_MASK:4,JS_GPN_ENUM_ONLY:16,JS_GPN_SET_ENUM:32,QTS_GPN_NUMBER_MASK:64,QTS_STANDARD_COMPLIANT_NUMBER:128},IsEqualOp={IsStrictlyEqual:0,IsSameValue:1,IsSameValueZero:2};export{EvalFlags,GetOwnPropertyNamesFlags,IntrinsicsFlags,IsEqualOp,JSPromiseStateEnum,assertSync}; -//# sourceMappingURL=index.mjs.map \ No newline at end of file diff --git a/.output/server/node_modules/@jitl/quickjs-ffi-types/package.json b/.output/server/node_modules/@jitl/quickjs-ffi-types/package.json deleted file mode 100644 index 22d27ff..0000000 --- a/.output/server/node_modules/@jitl/quickjs-ffi-types/package.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "@jitl/quickjs-ffi-types", - "version": "0.32.0", - "license": "MIT", - "repository": { - "type": "git", - "url": "https://github.com/justjake/quickjs-emscripten" - }, - "author": { - "name": "Jake Teton-Landis", - "url": "https://jake.tl" - }, - "scripts": { - "check": "npx tsc --project . --noEmit", - "build": "npx tsup", - "clean": "git clean -fx dist" - }, - "files": [ - "LICENSE", - "dist/**/*" - ], - "types": "dist/index.d.ts", - "main": "dist/index.js", - "module": "dist/index.mjs", - "exports": { - "./package.json": "./package.json", - ".": { - "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", - "require": "./dist/index.js" - } - }, - "devDependencies": { - "@jitl/tsconfig": "0.32.0" - } -} \ No newline at end of file diff --git a/.output/server/node_modules/@jitl/quickjs-wasmfile-debug-asyncify/dist/emscripten-module.mjs b/.output/server/node_modules/@jitl/quickjs-wasmfile-debug-asyncify/dist/emscripten-module.mjs deleted file mode 100644 index 1e82a0a..0000000 --- a/.output/server/node_modules/@jitl/quickjs-wasmfile-debug-asyncify/dist/emscripten-module.mjs +++ /dev/null @@ -1,2 +0,0 @@ -async function QuickJSRaw(moduleArg={}){var moduleRtn;(function(){function humanReadableVersionToPacked(str){str=str.split("-")[0];var vers=str.split(".").slice(0,3);while(vers.length<3)vers.push("00");vers=vers.map((n,i,arr)=>n.padStart(2,"0"));return vers.join("")}var packedVersionToHumanReadable=n=>[n/1e4|0,(n/100|0)%100,n%100].join(".");var TARGET_NOT_SUPPORTED=2147483647;var currentNodeVersion=typeof process!=="undefined"&&process.versions?.node?humanReadableVersionToPacked(process.versions.node):TARGET_NOT_SUPPORTED;if(currentNodeVersion<16e4){throw new Error(`This emscripten-generated code requires node v${packedVersionToHumanReadable(16e4)} (detected v${packedVersionToHumanReadable(currentNodeVersion)})`)}var userAgent=typeof navigator!=="undefined"&&navigator.userAgent;if(!userAgent){return}var currentSafariVersion=userAgent.includes("Safari/")&&!userAgent.includes("Chrome/")&&userAgent.match(/Version\/(\d+\.?\d*\.?\d*)/)?humanReadableVersionToPacked(userAgent.match(/Version\/(\d+\.?\d*\.?\d*)/)[1]):TARGET_NOT_SUPPORTED;if(currentSafariVersion<15e4){throw new Error(`This emscripten-generated code requires Safari v${packedVersionToHumanReadable(15e4)} (detected v${currentSafariVersion})`)}var currentFirefoxVersion=userAgent.match(/Firefox\/(\d+(?:\.\d+)?)/)?parseFloat(userAgent.match(/Firefox\/(\d+(?:\.\d+)?)/)[1]):TARGET_NOT_SUPPORTED;if(currentFirefoxVersion<79){throw new Error(`This emscripten-generated code requires Firefox v79 (detected v${currentFirefoxVersion})`)}var currentChromeVersion=userAgent.match(/Chrome\/(\d+(?:\.\d+)?)/)?parseFloat(userAgent.match(/Chrome\/(\d+(?:\.\d+)?)/)[1]):TARGET_NOT_SUPPORTED;if(currentChromeVersion<85){throw new Error(`This emscripten-generated code requires Chrome v85 (detected v${currentChromeVersion})`)}})();var Module=moduleArg;var ENVIRONMENT_IS_WEB=!!globalThis.window;var ENVIRONMENT_IS_WORKER=!!globalThis.WorkerGlobalScope;var ENVIRONMENT_IS_NODE=globalThis.process?.versions?.node&&globalThis.process?.type!="renderer";var ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(ENVIRONMENT_IS_NODE){const{createRequire}=await import("node:module");var require=createRequire(import.meta.url)}function quickjsEmscriptenInit(debugLog){const log=debugLog||function(){};const extension={log};for(const init of quickjsEmscriptenInit.inits){init(extension)}Module["quickJSEmscriptenExtensions"]=extension;return extension}quickjsEmscriptenInit.inits=[];Module["quickjsEmscriptenInit"]=quickjsEmscriptenInit;quickjsEmscriptenInit.inits.push(extension=>{if(typeof receiveSourceMapJSON!=="undefined"){extension["receiveSourceMapJSON"]=data=>{if(typeof wasmSourceMap==="undefined"){extension.log("receiveSourceMapJSON: received",data);return receiveSourceMapJSON(data)}else{extension.log("receiveSourceMapJSON: already have data:",wasmSourceMap,"ignoring",data)}}}});quickjsEmscriptenInit.inits.push(extension=>{if(typeof WasmOffsetConverter!=="undefined"){extension["WasmOffsetConverter"]=WasmOffsetConverter;try{extension["existingWasmOffsetConverter"]=wasmOffsetConverter;extension["receiveWasmOffsetConverter"]=function(wasmBinary,wasmModule){if(!wasmOffsetConverter){extension.log("wasmOffsetConverter set");wasmOffsetConverter=new WasmOffsetConverter(wasmBinary,wasmModule)}else{extension.log("wasmOffsetConverter already set, ignored")}}}catch(error){extension["receiveWasmOffsetConverter"]=function(){extension.log("wasmOffsetConverter variable not defined, this is a no-op")}}}});quickjsEmscriptenInit.inits.push(extension=>{extension["getWasmMemory"]=function(){return wasmMemory}});var arguments_=[];var thisProgram="./this.program";var quit_=(status,toThrow)=>{throw toThrow};var _scriptName=import.meta.url;var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var readAsync,readBinary;if(ENVIRONMENT_IS_NODE){const isNode=globalThis.process?.versions?.node&&globalThis.process?.type!="renderer";if(!isNode)throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");var fs=require("node:fs");if(_scriptName.startsWith("file:")){scriptDirectory=require("node:path").dirname(require("node:url").fileURLToPath(_scriptName))+"/"}readBinary=filename=>{filename=isFileURI(filename)?new URL(filename):filename;var ret=fs.readFileSync(filename);assert(Buffer.isBuffer(ret));return ret};readAsync=async(filename,binary=true)=>{filename=isFileURI(filename)?new URL(filename):filename;var ret=fs.readFileSync(filename,binary?undefined:"utf8");assert(binary?Buffer.isBuffer(ret):typeof ret=="string");return ret};if(process.argv.length>1){thisProgram=process.argv[1].replace(/\\/g,"/")}arguments_=process.argv.slice(2);quit_=(status,toThrow)=>{process.exitCode=status;throw toThrow}}else if(ENVIRONMENT_IS_SHELL){}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){try{scriptDirectory=new URL(".",_scriptName).href}catch{}if(!(globalThis.window||globalThis.WorkerGlobalScope))throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");{if(ENVIRONMENT_IS_WORKER){readBinary=url=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=async url=>{if(isFileURI(url)){return new Promise((resolve,reject)=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=()=>{if(xhr.status==200||xhr.status==0&&xhr.response){resolve(xhr.response);return}reject(xhr.status)};xhr.onerror=reject;xhr.send(null)})}var response=await fetch(url,{credentials:"same-origin"});if(response.ok){return response.arrayBuffer()}throw new Error(response.status+" : "+response.url)}}}else{throw new Error("environment detection error")}var out=console.log.bind(console);var err=console.error.bind(console);assert(!ENVIRONMENT_IS_SHELL,"shell environment detected but not enabled at build time. Add `shell` to `-sENVIRONMENT` to enable.");var wasmBinary;if(!globalThis.WebAssembly){err("no native wasm support detected")}var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed"+(text?": "+text:""))}}var isFileURI=filename=>filename.startsWith("file://");function writeStackCookie(){var max=_emscripten_stack_get_end();assert((max&3)==0);if(max==0){max+=4}HEAPU32[max>>2]=34821223;HEAPU32[max+4>>2]=2310721022;HEAPU32[0>>2]=1668509029}function checkStackCookie(){if(ABORT)return;var max=_emscripten_stack_get_end();if(max==0){max+=4}var cookie1=HEAPU32[max>>2];var cookie2=HEAPU32[max+4>>2];if(cookie1!=34821223||cookie2!=2310721022){abort(`Stack overflow! Stack cookie has been overwritten at ${ptrToString(max)}, expected hex dwords 0x89BACDFE and 0x2135467, but received ${ptrToString(cookie2)} ${ptrToString(cookie1)}`)}if(HEAPU32[0>>2]!=1668509029){abort("Runtime error: The application has corrupted its heap memory area (address zero)!")}}var runtimeDebug=true;(()=>{var h16=new Int16Array(1);var h8=new Int8Array(h16.buffer);h16[0]=25459;if(h8[0]!==115||h8[1]!==99)abort("Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)")})();function consumedModuleProp(prop){if(!Object.getOwnPropertyDescriptor(Module,prop)){Object.defineProperty(Module,prop,{configurable:true,set(){abort(`Attempt to set \`Module.${prop}\` after it has already been processed. This can happen, for example, when code is injected via '--post-js' rather than '--pre-js'`)}})}}function makeInvalidEarlyAccess(name){return()=>assert(false,`call to '${name}' via reference taken before Wasm module initialization`)}function ignoredModuleProp(prop){if(Object.getOwnPropertyDescriptor(Module,prop)){abort(`\`Module.${prop}\` was supplied but \`${prop}\` not included in INCOMING_MODULE_JS_API`)}}function isExportedByForceFilesystem(name){return name==="FS_createPath"||name==="FS_createDataFile"||name==="FS_createPreloadedFile"||name==="FS_preloadFile"||name==="FS_unlink"||name==="addRunDependency"||name==="FS_createLazyFile"||name==="FS_createDevice"||name==="removeRunDependency"}function missingLibrarySymbol(sym){unexportedRuntimeSymbol(sym)}function unexportedRuntimeSymbol(sym){if(!Object.getOwnPropertyDescriptor(Module,sym)){Object.defineProperty(Module,sym,{configurable:true,get(){var msg=`'${sym}' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the Emscripten FAQ)`;if(isExportedByForceFilesystem(sym)){msg+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"}abort(msg)}})}}var readyPromiseResolve,readyPromiseReject;var HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;var HEAP64,HEAPU64;var runtimeInitialized=false;function updateMemoryViews(){var b=wasmMemory.buffer;Module["HEAP8"]=HEAP8=new Int8Array(b);HEAP16=new Int16Array(b);Module["HEAPU8"]=HEAPU8=new Uint8Array(b);HEAPU16=new Uint16Array(b);HEAP32=new Int32Array(b);HEAPU32=new Uint32Array(b);HEAPF32=new Float32Array(b);HEAPF64=new Float64Array(b);HEAP64=new BigInt64Array(b);HEAPU64=new BigUint64Array(b)}function initMemory(){if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;assert(INITIAL_MEMORY>=5242880,"INITIAL_MEMORY should be larger than STACK_SIZE, was "+INITIAL_MEMORY+"! (STACK_SIZE="+5242880+")");wasmMemory=new WebAssembly.Memory({initial:INITIAL_MEMORY/65536,maximum:32768})}updateMemoryViews()}assert(globalThis.Int32Array&&globalThis.Float64Array&&Int32Array.prototype.subarray&&Int32Array.prototype.set,"JS engine does not provide full typed array support");function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}consumedModuleProp("preRun");callRuntimeCallbacks(onPreRuns)}function initRuntime(){assert(!runtimeInitialized);runtimeInitialized=true;checkStackCookie();wasmExports["__wasm_call_ctors"]()}function postRun(){checkStackCookie();if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}consumedModuleProp("postRun");callRuntimeCallbacks(onPostRuns)}function abort(what){Module["onAbort"]?.(what);what="Aborted("+what+")";err(what);ABORT=true;if(what.search(/RuntimeError: [Uu]nreachable/)>=0){what+='. "unreachable" may be due to ASYNCIFY_STACK_SIZE not being large enough (try increasing it)'}var e=new WebAssembly.RuntimeError(what);readyPromiseReject?.(e);throw e}var FS={error(){abort("Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -sFORCE_FILESYSTEM")},init(){FS.error()},createDataFile(){FS.error()},createPreloadedFile(){FS.error()},createLazyFile(){FS.error()},open(){FS.error()},mkdev(){FS.error()},registerDevice(){FS.error()},analyzePath(){FS.error()},ErrnoError(){FS.error()}};function createExportWrapper(name,nargs){return(...args)=>{assert(runtimeInitialized,`native function \`${name}\` called before runtime initialization`);var f=wasmExports[name];assert(f,`exported native function \`${name}\` not found`);assert(args.length<=nargs,`native function \`${name}\` called with ${args.length} args but expects ${nargs}`);return f(...args)}}var wasmBinaryFile;function findWasmBinary(){if(Module["locateFile"]){return locateFile("emscripten-module.wasm")}return new URL("emscripten-module.wasm",import.meta.url).href}function getBinarySync(file){if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}throw"both async and sync fetching of the wasm failed"}async function getWasmBinary(binaryFile){if(!wasmBinary){try{var response=await readAsync(binaryFile);return new Uint8Array(response)}catch{}}return getBinarySync(binaryFile)}async function instantiateArrayBuffer(binaryFile,imports){try{var binary=await getWasmBinary(binaryFile);var instance=await WebAssembly.instantiate(binary,imports);return instance}catch(reason){err(`failed to asynchronously prepare wasm: ${reason}`);if(isFileURI(binaryFile)){err(`warning: Loading from a file URI (${binaryFile}) is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing`)}abort(reason)}}async function instantiateAsync(binary,binaryFile,imports){if(!binary&&!isFileURI(binaryFile)&&!ENVIRONMENT_IS_NODE){try{var response=fetch(binaryFile,{credentials:"same-origin"});var instantiationResult=await WebAssembly.instantiateStreaming(response,imports);return instantiationResult}catch(reason){err(`wasm streaming compile failed: ${reason}`);err("falling back to ArrayBuffer instantiation")}}return instantiateArrayBuffer(binaryFile,imports)}function getWasmImports(){Asyncify.instrumentWasmImports(wasmImports);var imports={env:wasmImports,wasi_snapshot_preview1:wasmImports};return imports}async function createWasm(){function receiveInstance(instance,module){wasmExports=instance.exports;wasmExports=Asyncify.instrumentWasmExports(wasmExports);assignWasmExports(wasmExports);return wasmExports}var trueModule=Module;function receiveInstantiationResult(result){assert(Module===trueModule,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?");trueModule=null;return receiveInstance(result["instance"])}var info=getWasmImports();if(Module["instantiateWasm"]){return new Promise((resolve,reject)=>{try{Module["instantiateWasm"](info,(inst,mod)=>{resolve(receiveInstance(inst,mod))})}catch(e){err(`Module.instantiateWasm callback failed with error: ${e}`);reject(e)}})}wasmBinaryFile??=findWasmBinary();var result=await instantiateAsync(wasmBinary,wasmBinaryFile,info);var exports=receiveInstantiationResult(result);return exports}class ExitStatus{name="ExitStatus";constructor(status){this.message=`Program terminated with exit(${status})`;this.status=status}}var callRuntimeCallbacks=callbacks=>{while(callbacks.length>0){callbacks.shift()(Module)}};var onPostRuns=[];var addOnPostRun=cb=>onPostRuns.push(cb);var onPreRuns=[];var addOnPreRun=cb=>onPreRuns.push(cb);var dynCalls={};var dynCallLegacy=(sig,ptr,args)=>{sig=sig.replace(/p/g,"i");assert(sig in dynCalls,`bad function pointer type - sig is not in dynCalls: '${sig}'`);if(args?.length){assert(args.length===sig.length-1)}else{assert(sig.length==1)}var f=dynCalls[sig];return f(ptr,...args)};var noExitRuntime=true;var ptrToString=ptr=>{assert(typeof ptr==="number",`ptrToString expects a number, got ${typeof ptr}`);ptr>>>=0;return"0x"+ptr.toString(16).padStart(8,"0")};var stackRestore=val=>__emscripten_stack_restore(val);var stackSave=()=>_emscripten_stack_get_current();var warnOnce=text=>{warnOnce.shown||={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;if(ENVIRONMENT_IS_NODE)text="warning: "+text;err(text)}};var wasmMemory;var UTF8Decoder=globalThis.TextDecoder&&new TextDecoder;var findStringEnd=(heapOrArray,idx,maxBytesToRead,ignoreNul)=>{var maxIdx=idx+maxBytesToRead;if(ignoreNul)return maxIdx;while(heapOrArray[idx]&&!(idx>=maxIdx))++idx;return idx};var UTF8ArrayToString=(heapOrArray,idx=0,maxBytesToRead,ignoreNul)=>{var endPtr=findStringEnd(heapOrArray,idx,maxBytesToRead,ignoreNul);if(endPtr-idx>16&&heapOrArray.buffer&&UTF8Decoder){return UTF8Decoder.decode(heapOrArray.subarray(idx,endPtr))}var str="";while(idx>10,56320|ch&1023)}}return str};var UTF8ToString=(ptr,maxBytesToRead,ignoreNul)=>{assert(typeof ptr=="number",`UTF8ToString expects a number (got ${typeof ptr})`);return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead,ignoreNul):""};var ___assert_fail=(condition,filename,line,func)=>abort(`Assertion failed: ${UTF8ToString(condition)}, at: `+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"]);var __abort_js=()=>abort("native code called abort()");var isLeapYear=year=>year%4===0&&(year%100!==0||year%400===0);var MONTH_DAYS_LEAP_CUMULATIVE=[0,31,60,91,121,152,182,213,244,274,305,335];var MONTH_DAYS_REGULAR_CUMULATIVE=[0,31,59,90,120,151,181,212,243,273,304,334];var ydayFromDate=date=>{var leap=isLeapYear(date.getFullYear());var monthDaysCumulative=leap?MONTH_DAYS_LEAP_CUMULATIVE:MONTH_DAYS_REGULAR_CUMULATIVE;var yday=monthDaysCumulative[date.getMonth()]+date.getDate()-1;return yday};var INT53_MAX=9007199254740992;var INT53_MIN=-9007199254740992;var bigintToI53Checked=num=>numINT53_MAX?NaN:Number(num);function __localtime_js(time,tmPtr){time=bigintToI53Checked(time);var date=new Date(time*1e3);HEAP32[tmPtr>>2]=date.getSeconds();HEAP32[tmPtr+4>>2]=date.getMinutes();HEAP32[tmPtr+8>>2]=date.getHours();HEAP32[tmPtr+12>>2]=date.getDate();HEAP32[tmPtr+16>>2]=date.getMonth();HEAP32[tmPtr+20>>2]=date.getFullYear()-1900;HEAP32[tmPtr+24>>2]=date.getDay();var yday=ydayFromDate(date)|0;HEAP32[tmPtr+28>>2]=yday;HEAP32[tmPtr+36>>2]=-(date.getTimezoneOffset()*60);var start=new Date(date.getFullYear(),0,1);var summerOffset=new Date(date.getFullYear(),6,1).getTimezoneOffset();var winterOffset=start.getTimezoneOffset();var dst=(summerOffset!=winterOffset&&date.getTimezoneOffset()==Math.min(winterOffset,summerOffset))|0;HEAP32[tmPtr+32>>2]=dst}var stringToUTF8Array=(str,heap,outIdx,maxBytesToWrite)=>{assert(typeof str==="string",`stringToUTF8Array expects a string (got ${typeof str})`);if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;if(u>1114111)warnOnce("Invalid Unicode code point "+ptrToString(u)+" encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF).");heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63;i++}}heap[outIdx]=0;return outIdx-startIdx};var stringToUTF8=(str,outPtr,maxBytesToWrite)=>{assert(typeof maxBytesToWrite=="number","stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!");return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)};var lengthBytesUTF8=str=>{var len=0;for(var i=0;i=55296&&c<=57343){len+=4;++i}else{len+=3}}return len};var __tzset_js=(timezone,daylight,std_name,dst_name)=>{var currentYear=(new Date).getFullYear();var winter=new Date(currentYear,0,1);var summer=new Date(currentYear,6,1);var winterOffset=winter.getTimezoneOffset();var summerOffset=summer.getTimezoneOffset();var stdTimezoneOffset=Math.max(winterOffset,summerOffset);HEAPU32[timezone>>2]=stdTimezoneOffset*60;HEAP32[daylight>>2]=Number(winterOffset!=summerOffset);var extractZone=timezoneOffset=>{var sign=timezoneOffset>=0?"-":"+";var absOffset=Math.abs(timezoneOffset);var hours=String(Math.floor(absOffset/60)).padStart(2,"0");var minutes=String(absOffset%60).padStart(2,"0");return`UTC${sign}${hours}${minutes}`};var winterName=extractZone(winterOffset);var summerName=extractZone(summerOffset);assert(winterName);assert(summerName);assert(lengthBytesUTF8(winterName)<=16,`timezone name truncated to fit in TZNAME_MAX (${winterName})`);assert(lengthBytesUTF8(summerName)<=16,`timezone name truncated to fit in TZNAME_MAX (${summerName})`);if(summerOffsetDate.now();var getHeapMax=()=>2147483648;var alignMemory=(size,alignment)=>{assert(alignment,"alignment argument is required");return Math.ceil(size/alignment)*alignment};var growMemory=size=>{var oldHeapSize=wasmMemory.buffer.byteLength;var pages=(size-oldHeapSize+65535)/65536|0;try{wasmMemory.grow(pages);updateMemoryViews();return 1}catch(e){err(`growMemory: Attempted to grow heap from ${oldHeapSize} bytes to ${size} bytes, but got error: ${e}`)}};var _emscripten_resize_heap=requestedSize=>{var oldSize=HEAPU8.length;requestedSize>>>=0;assert(requestedSize>oldSize);var maxHeapSize=getHeapMax();if(requestedSize>maxHeapSize){err(`Cannot enlarge memory, requested ${requestedSize} bytes, but the limit is ${maxHeapSize} bytes!`);return false}for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize*(1+.2/cutDown);overGrownHeapSize=Math.min(overGrownHeapSize,requestedSize+100663296);var newSize=Math.min(maxHeapSize,alignMemory(Math.max(requestedSize,overGrownHeapSize),65536));var replacement=growMemory(newSize);if(replacement){return true}}err(`Failed to grow the heap from ${oldSize} bytes to ${newSize} bytes, not enough memory!`);return false};var _fd_close=fd=>{abort("fd_close called without SYSCALLS_REQUIRE_FILESYSTEM")};function _fd_seek(fd,offset,whence,newOffset){offset=bigintToI53Checked(offset);return 70}var printCharBuffers=[null,[],[]];var printChar=(stream,curr)=>{var buffer=printCharBuffers[stream];assert(buffer);if(curr===0||curr===10){(stream===1?out:err)(UTF8ArrayToString(buffer));buffer.length=0}else{buffer.push(curr)}};var flush_NO_FILESYSTEM=()=>{_fflush(0);if(printCharBuffers[1].length)printChar(1,10);if(printCharBuffers[2].length)printChar(2,10)};var _fd_write=(fd,iov,iovcnt,pnum)=>{var num=0;for(var i=0;i>2];var len=HEAPU32[iov+4>>2];iov+=8;for(var j=0;j>2]=num;return 0};var runAndAbortIfError=func=>{try{return func()}catch(e){abort(e)}};var handleException=e=>{if(e instanceof ExitStatus||e=="unwind"){return EXITSTATUS}checkStackCookie();if(e instanceof WebAssembly.RuntimeError){if(_emscripten_stack_get_current()<=0){err("Stack overflow detected. You can try increasing -sSTACK_SIZE (currently set to 5242880)")}}quit_(1,e)};var runtimeKeepaliveCounter=0;var keepRuntimeAlive=()=>noExitRuntime||runtimeKeepaliveCounter>0;var _proc_exit=code=>{EXITSTATUS=code;if(!keepRuntimeAlive()){Module["onExit"]?.(code);ABORT=true}quit_(code,new ExitStatus(code))};var exitJS=(status,implicit)=>{EXITSTATUS=status;checkUnflushedContent();if(keepRuntimeAlive()&&!implicit){var msg=`program exited (with status: ${status}), but keepRuntimeAlive() is set (counter=${runtimeKeepaliveCounter}) due to an async operation, so halting execution but not exiting the runtime or preventing further async execution (you can use emscripten_force_exit, if you want to force a true shutdown)`;readyPromiseReject?.(msg);err(msg)}_proc_exit(status)};var _exit=exitJS;var maybeExit=()=>{if(!keepRuntimeAlive()){try{_exit(EXITSTATUS)}catch(e){handleException(e)}}};var callUserCallback=func=>{if(ABORT){err("user callback triggered after runtime exited or application aborted. Ignoring.");return}try{return func()}catch(e){handleException(e)}finally{maybeExit()}};var createNamedFunction=(name,func)=>Object.defineProperty(func,"name",{value:name});var runtimeKeepalivePush=()=>{runtimeKeepaliveCounter+=1};var runtimeKeepalivePop=()=>{assert(runtimeKeepaliveCounter>0);runtimeKeepaliveCounter-=1};var Asyncify={instrumentWasmImports(imports){var importPattern=/^(qts_host_call_function|qts_host_load_module_source|qts_host_normalize_module|invoke_.*|__asyncjs__.*)$/;for(let[x,original]of Object.entries(imports)){if(typeof original=="function"){let isAsyncifyImport=original.isAsync||importPattern.test(x);imports[x]=(...args)=>{var originalAsyncifyState=Asyncify.state;try{return original(...args)}finally{var changedToDisabled=originalAsyncifyState===Asyncify.State.Normal&&Asyncify.state===Asyncify.State.Disabled;var ignoredInvoke=x.startsWith("invoke_")&&true;if(Asyncify.state!==originalAsyncifyState&&!isAsyncifyImport&&!changedToDisabled&&!ignoredInvoke){abort(`import ${x} was not in ASYNCIFY_IMPORTS, but changed the state`)}}}}}},instrumentFunction(original){var wrapper=(...args)=>{Asyncify.exportCallStack.push(original);try{return original(...args)}finally{if(!ABORT){var top=Asyncify.exportCallStack.pop();assert(top===original);Asyncify.maybeStopUnwind()}}};Asyncify.funcWrappers.set(original,wrapper);wrapper=createNamedFunction(`__asyncify_wrapper_${original.name}`,wrapper);return wrapper},instrumentWasmExports(exports){var ret={};for(let[x,original]of Object.entries(exports)){if(typeof original=="function"){var wrapper=Asyncify.instrumentFunction(original);ret[x]=wrapper}else{ret[x]=original}}return ret},State:{Normal:0,Unwinding:1,Rewinding:2,Disabled:3},state:0,StackSize:81920,currData:null,handleSleepReturnValue:0,exportCallStack:[],callstackFuncToId:new Map,callStackIdToFunc:new Map,funcWrappers:new Map,callStackId:0,asyncPromiseHandlers:null,sleepCallbacks:[],getCallStackId(func){assert(func);if(!Asyncify.callstackFuncToId.has(func)){var id=Asyncify.callStackId++;Asyncify.callstackFuncToId.set(func,id);Asyncify.callStackIdToFunc.set(id,func)}return Asyncify.callstackFuncToId.get(func)},maybeStopUnwind(){if(Asyncify.currData&&Asyncify.state===Asyncify.State.Unwinding&&Asyncify.exportCallStack.length===0){Asyncify.state=Asyncify.State.Normal;runAndAbortIfError(_asyncify_stop_unwind);if(typeof Fibers!="undefined"){Fibers.trampoline()}}},whenDone(){assert(Asyncify.currData,"Tried to wait for an async operation when none is in progress.");assert(!Asyncify.asyncPromiseHandlers,"Cannot have multiple async operations in flight at once");return new Promise((resolve,reject)=>{Asyncify.asyncPromiseHandlers={resolve,reject}})},allocateData(){var ptr=_malloc(12+Asyncify.StackSize);Asyncify.setDataHeader(ptr,ptr+12,Asyncify.StackSize);Asyncify.setDataRewindFunc(ptr);return ptr},setDataHeader(ptr,stack,stackSize){HEAPU32[ptr>>2]=stack;HEAPU32[ptr+4>>2]=stack+stackSize},setDataRewindFunc(ptr){var bottomOfCallStack=Asyncify.exportCallStack[0];assert(bottomOfCallStack,"exportCallStack is empty");var rewindId=Asyncify.getCallStackId(bottomOfCallStack);HEAP32[ptr+8>>2]=rewindId},getDataRewindFunc(ptr){var id=HEAP32[ptr+8>>2];var func=Asyncify.callStackIdToFunc.get(id);assert(func,`id ${id} not found in callStackIdToFunc`);return func},doRewind(ptr){var original=Asyncify.getDataRewindFunc(ptr);var func=Asyncify.funcWrappers.get(original);assert(original);assert(func);return callUserCallback(func)},handleSleep(startAsync){assert(Asyncify.state!==Asyncify.State.Disabled,"Asyncify cannot be done during or after the runtime exits");if(ABORT)return;if(Asyncify.state===Asyncify.State.Normal){var reachedCallback=false;var reachedAfterCallback=false;startAsync((handleSleepReturnValue=0)=>{assert(["undefined","number","boolean","bigint"].includes(typeof handleSleepReturnValue),`invalid type for handleSleepReturnValue: '${typeof handleSleepReturnValue}'`);if(ABORT)return;Asyncify.handleSleepReturnValue=handleSleepReturnValue;reachedCallback=true;if(!reachedAfterCallback){return}assert(!Asyncify.exportCallStack.length,"Waking up (starting to rewind) must be done from JS, without compiled code on the stack.");Asyncify.state=Asyncify.State.Rewinding;runAndAbortIfError(()=>_asyncify_start_rewind(Asyncify.currData));if(typeof MainLoop!="undefined"&&MainLoop.func){MainLoop.resume()}var asyncWasmReturnValue,isError=false;try{asyncWasmReturnValue=Asyncify.doRewind(Asyncify.currData)}catch(err){asyncWasmReturnValue=err;isError=true}var handled=false;if(!Asyncify.currData){var asyncPromiseHandlers=Asyncify.asyncPromiseHandlers;if(asyncPromiseHandlers){Asyncify.asyncPromiseHandlers=null;(isError?asyncPromiseHandlers.reject:asyncPromiseHandlers.resolve)(asyncWasmReturnValue);handled=true}}if(isError&&!handled){throw asyncWasmReturnValue}});reachedAfterCallback=true;if(!reachedCallback){Asyncify.state=Asyncify.State.Unwinding;Asyncify.currData=Asyncify.allocateData();if(typeof MainLoop!="undefined"&&MainLoop.func){MainLoop.pause()}runAndAbortIfError(()=>_asyncify_start_unwind(Asyncify.currData))}}else if(Asyncify.state===Asyncify.State.Rewinding){Asyncify.state=Asyncify.State.Normal;runAndAbortIfError(_asyncify_stop_rewind);_free(Asyncify.currData);Asyncify.currData=null;Asyncify.sleepCallbacks.forEach(callUserCallback)}else{abort(`invalid state: ${Asyncify.state}`)}return Asyncify.handleSleepReturnValue},handleAsync:startAsync=>Asyncify.handleSleep(async wakeUp=>{wakeUp(await startAsync())})};var getCFunc=ident=>{var func=Module["_"+ident];assert(func,"Cannot call unknown function "+ident+", make sure it is exported");return func};var writeArrayToMemory=(array,buffer)=>{assert(array.length>=0,"writeArrayToMemory array must have a length (should be an array or typed array)");HEAP8.set(array,buffer)};var stackAlloc=sz=>__emscripten_stack_alloc(sz);var stringToUTF8OnStack=str=>{var size=lengthBytesUTF8(str)+1;var ret=stackAlloc(size);stringToUTF8(str,ret,size);return ret};var ccall=(ident,returnType,argTypes,args,opts)=>{var toC={string:str=>{var ret=0;if(str!==null&&str!==undefined&&str!==0){ret=stringToUTF8OnStack(str)}return ret},array:arr=>{var ret=stackAlloc(arr.length);writeArrayToMemory(arr,ret);return ret}};function convertReturnValue(ret){if(returnType==="string"){return UTF8ToString(ret)}if(returnType==="boolean")return Boolean(ret);return ret}var func=getCFunc(ident);var cArgs=[];var stack=0;assert(returnType!=="array",'Return type should not be "array".');if(args){for(var i=0;i(...args)=>ccall(ident,returnType,argTypes,args,opts);{initMemory();if(Module["noExitRuntime"])noExitRuntime=Module["noExitRuntime"];if(Module["print"])out=Module["print"];if(Module["printErr"])err=Module["printErr"];if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];Module["FS_createDataFile"]=FS.createDataFile;Module["FS_createPreloadedFile"]=FS.createPreloadedFile;checkIncomingModuleAPI();if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];assert(typeof Module["memoryInitializerPrefixURL"]=="undefined","Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["pthreadMainPrefixURL"]=="undefined","Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["cdInitializerPrefixURL"]=="undefined","Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["filePackagePrefixURL"]=="undefined","Module.filePackagePrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["read"]=="undefined","Module.read option was removed");assert(typeof Module["readAsync"]=="undefined","Module.readAsync option was removed (modify readAsync in JS)");assert(typeof Module["readBinary"]=="undefined","Module.readBinary option was removed (modify readBinary in JS)");assert(typeof Module["setWindowTitle"]=="undefined","Module.setWindowTitle option was removed (modify emscripten_set_window_title in JS)");assert(typeof Module["TOTAL_MEMORY"]=="undefined","Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY");assert(typeof Module["ENVIRONMENT"]=="undefined","Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)");assert(typeof Module["STACK_SIZE"]=="undefined","STACK_SIZE can no longer be set at runtime. Use -sSTACK_SIZE at link time");if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].shift()()}}consumedModuleProp("preInit")}Module["cwrap"]=cwrap;Module["UTF8ToString"]=UTF8ToString;Module["stringToUTF8"]=stringToUTF8;Module["lengthBytesUTF8"]=lengthBytesUTF8;Module["Asyncify"]=Asyncify;var missingLibrarySymbols=["writeI53ToI64","writeI53ToI64Clamped","writeI53ToI64Signaling","writeI53ToU64Clamped","writeI53ToU64Signaling","readI53FromI64","readI53FromU64","convertI32PairToI53","convertI32PairToI53Checked","convertU32PairToI53","getTempRet0","setTempRet0","zeroMemory","withStackSave","strError","inetPton4","inetNtop4","inetPton6","inetNtop6","readSockaddr","writeSockaddr","readEmAsmArgs","jstoi_q","getExecutableName","autoResumeAudioContext","getDynCaller","asyncLoad","asmjsMangle","mmapAlloc","HandleAllocator","getUniqueRunDependency","addRunDependency","removeRunDependency","addOnInit","addOnPostCtor","addOnPreMain","addOnExit","STACK_SIZE","STACK_ALIGN","POINTER_SIZE","ASSERTIONS","convertJsFunctionToWasm","getEmptyTableSlot","updateTableMap","getFunctionAddress","addFunction","removeFunction","intArrayFromString","intArrayToString","AsciiToString","stringToAscii","UTF16ToString","stringToUTF16","lengthBytesUTF16","UTF32ToString","stringToUTF32","lengthBytesUTF32","stringToNewUTF8","registerKeyEventCallback","maybeCStringToJsString","findEventTarget","getBoundingClientRect","fillMouseEventData","registerMouseEventCallback","registerWheelEventCallback","registerUiEventCallback","registerFocusEventCallback","fillDeviceOrientationEventData","registerDeviceOrientationEventCallback","fillDeviceMotionEventData","registerDeviceMotionEventCallback","screenOrientation","fillOrientationChangeEventData","registerOrientationChangeEventCallback","fillFullscreenChangeEventData","registerFullscreenChangeEventCallback","JSEvents_requestFullscreen","JSEvents_resizeCanvasForFullscreen","registerRestoreOldStyle","hideEverythingExceptGivenElement","restoreHiddenElements","setLetterbox","softFullscreenResizeWebGLRenderTarget","doRequestFullscreen","fillPointerlockChangeEventData","registerPointerlockChangeEventCallback","registerPointerlockErrorEventCallback","requestPointerLock","fillVisibilityChangeEventData","registerVisibilityChangeEventCallback","registerTouchEventCallback","fillGamepadEventData","registerGamepadEventCallback","registerBeforeUnloadEventCallback","fillBatteryEventData","registerBatteryEventCallback","setCanvasElementSize","getCanvasElementSize","jsStackTrace","getCallstack","convertPCtoSourceLocation","getEnvStrings","checkWasiClock","wasiRightsToMuslOFlags","wasiOFlagsToMuslOFlags","initRandomFill","randomFill","safeSetTimeout","setImmediateWrapped","safeRequestAnimationFrame","clearImmediateWrapped","registerPostMainLoop","registerPreMainLoop","getPromise","makePromise","idsToPromises","makePromiseCallback","Browser_asyncPrepareDataCounter","arraySum","addDays","getSocketFromFD","getSocketAddress","FS_createPreloadedFile","FS_preloadFile","FS_modeStringToFlags","FS_getMode","FS_stdin_getChar","FS_mkdirTree","_setNetworkCallback","ALLOC_NORMAL","ALLOC_STACK","allocate","writeStringToMemory","writeAsciiToMemory","allocateUTF8","allocateUTF8OnStack","stackTrace","getNativeTypeSize"];missingLibrarySymbols.forEach(missingLibrarySymbol);var unexportedSymbols=["run","out","err","callMain","abort","wasmExports","HEAPF32","HEAPF64","HEAP16","HEAPU16","HEAP32","HEAPU32","HEAP64","HEAPU64","writeStackCookie","checkStackCookie","INT53_MAX","INT53_MIN","bigintToI53Checked","stackSave","stackRestore","stackAlloc","createNamedFunction","ptrToString","exitJS","getHeapMax","growMemory","ENV","ERRNO_CODES","DNS","Protocols","Sockets","timers","warnOnce","readEmAsmArgsArray","dynCallLegacy","dynCall","handleException","keepRuntimeAlive","runtimeKeepalivePush","runtimeKeepalivePop","callUserCallback","maybeExit","alignMemory","wasmTable","wasmMemory","noExitRuntime","addOnPreRun","addOnPostRun","ccall","freeTableIndexes","functionsInTableMap","setValue","getValue","PATH","PATH_FS","UTF8Decoder","UTF8ArrayToString","stringToUTF8Array","UTF16Decoder","stringToUTF8OnStack","writeArrayToMemory","JSEvents","specialHTMLTargets","findCanvasEventTarget","currentFullscreenStrategy","restoreOldWindowedStyle","UNWIND_CACHE","ExitStatus","flush_NO_FILESYSTEM","emSetImmediate","emClearImmediate_deps","emClearImmediate","promiseMap","Browser","requestFullscreen","requestFullScreen","setCanvasSize","getUserMedia","createContext","getPreloadedImageData__data","wget","MONTH_DAYS_REGULAR","MONTH_DAYS_LEAP","MONTH_DAYS_REGULAR_CUMULATIVE","MONTH_DAYS_LEAP_CUMULATIVE","isLeapYear","ydayFromDate","SYSCALLS","preloadPlugins","FS_stdin_getChar_buffer","FS_unlink","FS_createPath","FS_createDevice","FS_readFile","FS","FS_root","FS_mounts","FS_devices","FS_streams","FS_nextInode","FS_nameTable","FS_currentPath","FS_initialized","FS_ignorePermissions","FS_filesystems","FS_syncFSRequests","FS_lookupPath","FS_getPath","FS_hashName","FS_hashAddNode","FS_hashRemoveNode","FS_lookupNode","FS_createNode","FS_destroyNode","FS_isRoot","FS_isMountpoint","FS_isFile","FS_isDir","FS_isLink","FS_isChrdev","FS_isBlkdev","FS_isFIFO","FS_isSocket","FS_flagsToPermissionString","FS_nodePermissions","FS_mayLookup","FS_mayCreate","FS_mayDelete","FS_mayOpen","FS_checkOpExists","FS_nextfd","FS_getStreamChecked","FS_getStream","FS_createStream","FS_closeStream","FS_dupStream","FS_doSetAttr","FS_chrdev_stream_ops","FS_major","FS_minor","FS_makedev","FS_registerDevice","FS_getDevice","FS_getMounts","FS_syncfs","FS_mount","FS_unmount","FS_lookup","FS_mknod","FS_statfs","FS_statfsStream","FS_statfsNode","FS_create","FS_mkdir","FS_mkdev","FS_symlink","FS_rename","FS_rmdir","FS_readdir","FS_readlink","FS_stat","FS_fstat","FS_lstat","FS_doChmod","FS_chmod","FS_lchmod","FS_fchmod","FS_doChown","FS_chown","FS_lchown","FS_fchown","FS_doTruncate","FS_truncate","FS_ftruncate","FS_utime","FS_open","FS_close","FS_isClosed","FS_llseek","FS_read","FS_write","FS_mmap","FS_msync","FS_ioctl","FS_writeFile","FS_cwd","FS_chdir","FS_createDefaultDirectories","FS_createDefaultDevices","FS_createSpecialDirectories","FS_createStandardStreams","FS_staticInit","FS_init","FS_quit","FS_findObject","FS_analyzePath","FS_createFile","FS_createDataFile","FS_forceLoadFile","FS_createLazyFile","FS_absolutePath","FS_createFolder","FS_createLink","FS_joinPath","FS_mmapAlloc","FS_standardizePath","MEMFS","TTY","PIPEFS","SOCKFS","runAndAbortIfError","Fibers","print","printErr","jstoi_s"];unexportedSymbols.forEach(unexportedRuntimeSymbol);function checkIncomingModuleAPI(){ignoredModuleProp("fetchSettings");ignoredModuleProp("logReadFiles");ignoredModuleProp("loadSplitModule")}function set_asyncify_stack_size(size,default_size){Asyncify.StackSize=size||default_size}function qts_host_ref_free(rt,id){const asyncify=undefined;Module["callbacks"]["freeHostRef"](asyncify,rt,id)}function qts_host_call_function(ctx,this_ptr,argc,argv,host_ref_id){const asyncify={["handleSleep"]:Asyncify.handleSleep};return Module["callbacks"]["callFunction"](asyncify,ctx,this_ptr,argc,argv,host_ref_id)}function qts_host_interrupt_handler(rt){const asyncify=undefined;return Module["callbacks"]["shouldInterrupt"](asyncify,rt)}function qts_host_load_module_source(rt,ctx,module_name){const asyncify={["handleSleep"]:Asyncify.handleSleep};const moduleNameString=UTF8ToString(module_name);return Module["callbacks"]["loadModuleSource"](asyncify,rt,ctx,moduleNameString)}function qts_host_normalize_module(rt,ctx,module_base_name,module_name){const asyncify={["handleSleep"]:Asyncify.handleSleep};const moduleBaseNameString=UTF8ToString(module_base_name);const moduleNameString=UTF8ToString(module_name);return Module["callbacks"]["normalizeModule"](asyncify,rt,ctx,moduleBaseNameString,moduleNameString)}var _malloc=Module["_malloc"]=makeInvalidEarlyAccess("_malloc");var _QTS_Throw=Module["_QTS_Throw"]=makeInvalidEarlyAccess("_QTS_Throw");var _QTS_NewError=Module["_QTS_NewError"]=makeInvalidEarlyAccess("_QTS_NewError");var _QTS_RuntimeSetMemoryLimit=Module["_QTS_RuntimeSetMemoryLimit"]=makeInvalidEarlyAccess("_QTS_RuntimeSetMemoryLimit");var _QTS_RuntimeComputeMemoryUsage=Module["_QTS_RuntimeComputeMemoryUsage"]=makeInvalidEarlyAccess("_QTS_RuntimeComputeMemoryUsage");var _QTS_RuntimeDumpMemoryUsage=Module["_QTS_RuntimeDumpMemoryUsage"]=makeInvalidEarlyAccess("_QTS_RuntimeDumpMemoryUsage");var _QTS_RecoverableLeakCheck=Module["_QTS_RecoverableLeakCheck"]=makeInvalidEarlyAccess("_QTS_RecoverableLeakCheck");var _QTS_BuildIsSanitizeLeak=Module["_QTS_BuildIsSanitizeLeak"]=makeInvalidEarlyAccess("_QTS_BuildIsSanitizeLeak");var _QTS_RuntimeSetMaxStackSize=Module["_QTS_RuntimeSetMaxStackSize"]=makeInvalidEarlyAccess("_QTS_RuntimeSetMaxStackSize");var _QTS_GetUndefined=Module["_QTS_GetUndefined"]=makeInvalidEarlyAccess("_QTS_GetUndefined");var _QTS_GetNull=Module["_QTS_GetNull"]=makeInvalidEarlyAccess("_QTS_GetNull");var _QTS_GetFalse=Module["_QTS_GetFalse"]=makeInvalidEarlyAccess("_QTS_GetFalse");var _QTS_GetTrue=Module["_QTS_GetTrue"]=makeInvalidEarlyAccess("_QTS_GetTrue");var _QTS_NewHostRef=Module["_QTS_NewHostRef"]=makeInvalidEarlyAccess("_QTS_NewHostRef");var _QTS_GetHostRefId=Module["_QTS_GetHostRefId"]=makeInvalidEarlyAccess("_QTS_GetHostRefId");var _QTS_NewRuntime=Module["_QTS_NewRuntime"]=makeInvalidEarlyAccess("_QTS_NewRuntime");var _QTS_FreeRuntime=Module["_QTS_FreeRuntime"]=makeInvalidEarlyAccess("_QTS_FreeRuntime");var _free=Module["_free"]=makeInvalidEarlyAccess("_free");var _QTS_NewContext=Module["_QTS_NewContext"]=makeInvalidEarlyAccess("_QTS_NewContext");var _QTS_FreeContext=Module["_QTS_FreeContext"]=makeInvalidEarlyAccess("_QTS_FreeContext");var _QTS_FreeValuePointer=Module["_QTS_FreeValuePointer"]=makeInvalidEarlyAccess("_QTS_FreeValuePointer");var _QTS_FreeValuePointerRuntime=Module["_QTS_FreeValuePointerRuntime"]=makeInvalidEarlyAccess("_QTS_FreeValuePointerRuntime");var _QTS_FreeVoidPointer=Module["_QTS_FreeVoidPointer"]=makeInvalidEarlyAccess("_QTS_FreeVoidPointer");var _QTS_FreeCString=Module["_QTS_FreeCString"]=makeInvalidEarlyAccess("_QTS_FreeCString");var _QTS_DupValuePointer=Module["_QTS_DupValuePointer"]=makeInvalidEarlyAccess("_QTS_DupValuePointer");var _QTS_NewObject=Module["_QTS_NewObject"]=makeInvalidEarlyAccess("_QTS_NewObject");var _QTS_NewObjectProto=Module["_QTS_NewObjectProto"]=makeInvalidEarlyAccess("_QTS_NewObjectProto");var _QTS_NewArray=Module["_QTS_NewArray"]=makeInvalidEarlyAccess("_QTS_NewArray");var _QTS_NewArrayBuffer=Module["_QTS_NewArrayBuffer"]=makeInvalidEarlyAccess("_QTS_NewArrayBuffer");var _QTS_NewFloat64=Module["_QTS_NewFloat64"]=makeInvalidEarlyAccess("_QTS_NewFloat64");var _QTS_GetFloat64=Module["_QTS_GetFloat64"]=makeInvalidEarlyAccess("_QTS_GetFloat64");var _QTS_NewString=Module["_QTS_NewString"]=makeInvalidEarlyAccess("_QTS_NewString");var _QTS_GetString=Module["_QTS_GetString"]=makeInvalidEarlyAccess("_QTS_GetString");var _QTS_GetArrayBuffer=Module["_QTS_GetArrayBuffer"]=makeInvalidEarlyAccess("_QTS_GetArrayBuffer");var _QTS_GetArrayBufferLength=Module["_QTS_GetArrayBufferLength"]=makeInvalidEarlyAccess("_QTS_GetArrayBufferLength");var _QTS_NewSymbol=Module["_QTS_NewSymbol"]=makeInvalidEarlyAccess("_QTS_NewSymbol");var _QTS_GetSymbolDescriptionOrKey=Module["_QTS_GetSymbolDescriptionOrKey"]=makeInvalidEarlyAccess("_QTS_GetSymbolDescriptionOrKey");var _QTS_IsGlobalSymbol=Module["_QTS_IsGlobalSymbol"]=makeInvalidEarlyAccess("_QTS_IsGlobalSymbol");var _QTS_IsJobPending=Module["_QTS_IsJobPending"]=makeInvalidEarlyAccess("_QTS_IsJobPending");var _QTS_ExecutePendingJob=Module["_QTS_ExecutePendingJob"]=makeInvalidEarlyAccess("_QTS_ExecutePendingJob");var _QTS_GetProp=Module["_QTS_GetProp"]=makeInvalidEarlyAccess("_QTS_GetProp");var _QTS_GetPropNumber=Module["_QTS_GetPropNumber"]=makeInvalidEarlyAccess("_QTS_GetPropNumber");var _QTS_SetProp=Module["_QTS_SetProp"]=makeInvalidEarlyAccess("_QTS_SetProp");var _QTS_DefineProp=Module["_QTS_DefineProp"]=makeInvalidEarlyAccess("_QTS_DefineProp");var _QTS_GetOwnPropertyNames=Module["_QTS_GetOwnPropertyNames"]=makeInvalidEarlyAccess("_QTS_GetOwnPropertyNames");var _QTS_Call=Module["_QTS_Call"]=makeInvalidEarlyAccess("_QTS_Call");var _QTS_ResolveException=Module["_QTS_ResolveException"]=makeInvalidEarlyAccess("_QTS_ResolveException");var _QTS_Dump=Module["_QTS_Dump"]=makeInvalidEarlyAccess("_QTS_Dump");var _QTS_Eval=Module["_QTS_Eval"]=makeInvalidEarlyAccess("_QTS_Eval");var _QTS_GetModuleNamespace=Module["_QTS_GetModuleNamespace"]=makeInvalidEarlyAccess("_QTS_GetModuleNamespace");var _QTS_Typeof=Module["_QTS_Typeof"]=makeInvalidEarlyAccess("_QTS_Typeof");var _QTS_GetLength=Module["_QTS_GetLength"]=makeInvalidEarlyAccess("_QTS_GetLength");var _QTS_IsEqual=Module["_QTS_IsEqual"]=makeInvalidEarlyAccess("_QTS_IsEqual");var _QTS_GetGlobalObject=Module["_QTS_GetGlobalObject"]=makeInvalidEarlyAccess("_QTS_GetGlobalObject");var _QTS_NewPromiseCapability=Module["_QTS_NewPromiseCapability"]=makeInvalidEarlyAccess("_QTS_NewPromiseCapability");var _QTS_PromiseState=Module["_QTS_PromiseState"]=makeInvalidEarlyAccess("_QTS_PromiseState");var _QTS_PromiseResult=Module["_QTS_PromiseResult"]=makeInvalidEarlyAccess("_QTS_PromiseResult");var _QTS_TestStringArg=Module["_QTS_TestStringArg"]=makeInvalidEarlyAccess("_QTS_TestStringArg");var _QTS_GetDebugLogEnabled=Module["_QTS_GetDebugLogEnabled"]=makeInvalidEarlyAccess("_QTS_GetDebugLogEnabled");var _QTS_SetDebugLogEnabled=Module["_QTS_SetDebugLogEnabled"]=makeInvalidEarlyAccess("_QTS_SetDebugLogEnabled");var _QTS_BuildIsDebug=Module["_QTS_BuildIsDebug"]=makeInvalidEarlyAccess("_QTS_BuildIsDebug");var _QTS_BuildIsAsyncify=Module["_QTS_BuildIsAsyncify"]=makeInvalidEarlyAccess("_QTS_BuildIsAsyncify");var _QTS_NewFunction=Module["_QTS_NewFunction"]=makeInvalidEarlyAccess("_QTS_NewFunction");var _QTS_ArgvGetJSValueConstPointer=Module["_QTS_ArgvGetJSValueConstPointer"]=makeInvalidEarlyAccess("_QTS_ArgvGetJSValueConstPointer");var _QTS_RuntimeEnableInterruptHandler=Module["_QTS_RuntimeEnableInterruptHandler"]=makeInvalidEarlyAccess("_QTS_RuntimeEnableInterruptHandler");var _QTS_RuntimeDisableInterruptHandler=Module["_QTS_RuntimeDisableInterruptHandler"]=makeInvalidEarlyAccess("_QTS_RuntimeDisableInterruptHandler");var _QTS_RuntimeEnableModuleLoader=Module["_QTS_RuntimeEnableModuleLoader"]=makeInvalidEarlyAccess("_QTS_RuntimeEnableModuleLoader");var _QTS_RuntimeDisableModuleLoader=Module["_QTS_RuntimeDisableModuleLoader"]=makeInvalidEarlyAccess("_QTS_RuntimeDisableModuleLoader");var _QTS_bjson_encode=Module["_QTS_bjson_encode"]=makeInvalidEarlyAccess("_QTS_bjson_encode");var _QTS_bjson_decode=Module["_QTS_bjson_decode"]=makeInvalidEarlyAccess("_QTS_bjson_decode");var _fflush=makeInvalidEarlyAccess("_fflush");var _strerror=makeInvalidEarlyAccess("_strerror");var _emscripten_stack_init=makeInvalidEarlyAccess("_emscripten_stack_init");var _emscripten_stack_get_free=makeInvalidEarlyAccess("_emscripten_stack_get_free");var _emscripten_stack_get_base=makeInvalidEarlyAccess("_emscripten_stack_get_base");var _emscripten_stack_get_end=makeInvalidEarlyAccess("_emscripten_stack_get_end");var __emscripten_stack_restore=makeInvalidEarlyAccess("__emscripten_stack_restore");var __emscripten_stack_alloc=makeInvalidEarlyAccess("__emscripten_stack_alloc");var _emscripten_stack_get_current=makeInvalidEarlyAccess("_emscripten_stack_get_current");var dynCall_viii=makeInvalidEarlyAccess("dynCall_viii");var dynCall_jijiiii=makeInvalidEarlyAccess("dynCall_jijiiii");var dynCall_iii=makeInvalidEarlyAccess("dynCall_iii");var dynCall_iiiii=makeInvalidEarlyAccess("dynCall_iiiii");var dynCall_iiii=makeInvalidEarlyAccess("dynCall_iiii");var dynCall_vij=makeInvalidEarlyAccess("dynCall_vij");var dynCall_ii=makeInvalidEarlyAccess("dynCall_ii");var dynCall_jijjiii=makeInvalidEarlyAccess("dynCall_jijjiii");var dynCall_vii=makeInvalidEarlyAccess("dynCall_vii");var dynCall_jijiii=makeInvalidEarlyAccess("dynCall_jijiii");var dynCall_jiii=makeInvalidEarlyAccess("dynCall_jiii");var dynCall_jijii=makeInvalidEarlyAccess("dynCall_jijii");var dynCall_jijiiiii=makeInvalidEarlyAccess("dynCall_jijiiiii");var dynCall_jijj=makeInvalidEarlyAccess("dynCall_jijj");var dynCall_viji=makeInvalidEarlyAccess("dynCall_viji");var dynCall_jij=makeInvalidEarlyAccess("dynCall_jij");var dynCall_jiji=makeInvalidEarlyAccess("dynCall_jiji");var dynCall_iijijjji=makeInvalidEarlyAccess("dynCall_iijijjji");var dynCall_iiiji=makeInvalidEarlyAccess("dynCall_iiiji");var dynCall_iiji=makeInvalidEarlyAccess("dynCall_iiji");var dynCall_iiiij=makeInvalidEarlyAccess("dynCall_iiiij");var dynCall_jijij=makeInvalidEarlyAccess("dynCall_jijij");var dynCall_iijijji=makeInvalidEarlyAccess("dynCall_iijijji");var dynCall_iijj=makeInvalidEarlyAccess("dynCall_iijj");var dynCall_iij=makeInvalidEarlyAccess("dynCall_iij");var dynCall_jiiii=makeInvalidEarlyAccess("dynCall_jiiii");var dynCall_dd=makeInvalidEarlyAccess("dynCall_dd");var dynCall_ddd=makeInvalidEarlyAccess("dynCall_ddd");var dynCall_jii=makeInvalidEarlyAccess("dynCall_jii");var dynCall_iidiiii=makeInvalidEarlyAccess("dynCall_iidiiii");var _asyncify_start_unwind=makeInvalidEarlyAccess("_asyncify_start_unwind");var _asyncify_stop_unwind=makeInvalidEarlyAccess("_asyncify_stop_unwind");var _asyncify_start_rewind=makeInvalidEarlyAccess("_asyncify_start_rewind");var _asyncify_stop_rewind=makeInvalidEarlyAccess("_asyncify_stop_rewind");var __indirect_function_table=makeInvalidEarlyAccess("__indirect_function_table");function assignWasmExports(wasmExports){assert(typeof wasmExports["malloc"]!="undefined","missing Wasm export: malloc");assert(typeof wasmExports["QTS_Throw"]!="undefined","missing Wasm export: QTS_Throw");assert(typeof wasmExports["QTS_NewError"]!="undefined","missing Wasm export: QTS_NewError");assert(typeof wasmExports["QTS_RuntimeSetMemoryLimit"]!="undefined","missing Wasm export: QTS_RuntimeSetMemoryLimit");assert(typeof wasmExports["QTS_RuntimeComputeMemoryUsage"]!="undefined","missing Wasm export: QTS_RuntimeComputeMemoryUsage");assert(typeof wasmExports["QTS_RuntimeDumpMemoryUsage"]!="undefined","missing Wasm export: QTS_RuntimeDumpMemoryUsage");assert(typeof wasmExports["QTS_RecoverableLeakCheck"]!="undefined","missing Wasm export: QTS_RecoverableLeakCheck");assert(typeof wasmExports["QTS_BuildIsSanitizeLeak"]!="undefined","missing Wasm export: QTS_BuildIsSanitizeLeak");assert(typeof wasmExports["QTS_RuntimeSetMaxStackSize"]!="undefined","missing Wasm export: QTS_RuntimeSetMaxStackSize");assert(typeof wasmExports["QTS_GetUndefined"]!="undefined","missing Wasm export: QTS_GetUndefined");assert(typeof wasmExports["QTS_GetNull"]!="undefined","missing Wasm export: QTS_GetNull");assert(typeof wasmExports["QTS_GetFalse"]!="undefined","missing Wasm export: QTS_GetFalse");assert(typeof wasmExports["QTS_GetTrue"]!="undefined","missing Wasm export: QTS_GetTrue");assert(typeof wasmExports["QTS_NewHostRef"]!="undefined","missing Wasm export: QTS_NewHostRef");assert(typeof wasmExports["QTS_GetHostRefId"]!="undefined","missing Wasm export: QTS_GetHostRefId");assert(typeof wasmExports["QTS_NewRuntime"]!="undefined","missing Wasm export: QTS_NewRuntime");assert(typeof wasmExports["QTS_FreeRuntime"]!="undefined","missing Wasm export: QTS_FreeRuntime");assert(typeof wasmExports["free"]!="undefined","missing Wasm export: free");assert(typeof wasmExports["QTS_NewContext"]!="undefined","missing Wasm export: QTS_NewContext");assert(typeof wasmExports["QTS_FreeContext"]!="undefined","missing Wasm export: QTS_FreeContext");assert(typeof wasmExports["QTS_FreeValuePointer"]!="undefined","missing Wasm export: QTS_FreeValuePointer");assert(typeof wasmExports["QTS_FreeValuePointerRuntime"]!="undefined","missing Wasm export: QTS_FreeValuePointerRuntime");assert(typeof wasmExports["QTS_FreeVoidPointer"]!="undefined","missing Wasm export: QTS_FreeVoidPointer");assert(typeof wasmExports["QTS_FreeCString"]!="undefined","missing Wasm export: QTS_FreeCString");assert(typeof wasmExports["QTS_DupValuePointer"]!="undefined","missing Wasm export: QTS_DupValuePointer");assert(typeof wasmExports["QTS_NewObject"]!="undefined","missing Wasm export: QTS_NewObject");assert(typeof wasmExports["QTS_NewObjectProto"]!="undefined","missing Wasm export: QTS_NewObjectProto");assert(typeof wasmExports["QTS_NewArray"]!="undefined","missing Wasm export: QTS_NewArray");assert(typeof wasmExports["QTS_NewArrayBuffer"]!="undefined","missing Wasm export: QTS_NewArrayBuffer");assert(typeof wasmExports["QTS_NewFloat64"]!="undefined","missing Wasm export: QTS_NewFloat64");assert(typeof wasmExports["QTS_GetFloat64"]!="undefined","missing Wasm export: QTS_GetFloat64");assert(typeof wasmExports["QTS_NewString"]!="undefined","missing Wasm export: QTS_NewString");assert(typeof wasmExports["QTS_GetString"]!="undefined","missing Wasm export: QTS_GetString");assert(typeof wasmExports["QTS_GetArrayBuffer"]!="undefined","missing Wasm export: QTS_GetArrayBuffer");assert(typeof wasmExports["QTS_GetArrayBufferLength"]!="undefined","missing Wasm export: QTS_GetArrayBufferLength");assert(typeof wasmExports["QTS_NewSymbol"]!="undefined","missing Wasm export: QTS_NewSymbol");assert(typeof wasmExports["QTS_GetSymbolDescriptionOrKey"]!="undefined","missing Wasm export: QTS_GetSymbolDescriptionOrKey");assert(typeof wasmExports["QTS_IsGlobalSymbol"]!="undefined","missing Wasm export: QTS_IsGlobalSymbol");assert(typeof wasmExports["QTS_IsJobPending"]!="undefined","missing Wasm export: QTS_IsJobPending");assert(typeof wasmExports["QTS_ExecutePendingJob"]!="undefined","missing Wasm export: QTS_ExecutePendingJob");assert(typeof wasmExports["QTS_GetProp"]!="undefined","missing Wasm export: QTS_GetProp");assert(typeof wasmExports["QTS_GetPropNumber"]!="undefined","missing Wasm export: QTS_GetPropNumber");assert(typeof wasmExports["QTS_SetProp"]!="undefined","missing Wasm export: QTS_SetProp");assert(typeof wasmExports["QTS_DefineProp"]!="undefined","missing Wasm export: QTS_DefineProp");assert(typeof wasmExports["QTS_GetOwnPropertyNames"]!="undefined","missing Wasm export: QTS_GetOwnPropertyNames");assert(typeof wasmExports["QTS_Call"]!="undefined","missing Wasm export: QTS_Call");assert(typeof wasmExports["QTS_ResolveException"]!="undefined","missing Wasm export: QTS_ResolveException");assert(typeof wasmExports["QTS_Dump"]!="undefined","missing Wasm export: QTS_Dump");assert(typeof wasmExports["QTS_Eval"]!="undefined","missing Wasm export: QTS_Eval");assert(typeof wasmExports["QTS_GetModuleNamespace"]!="undefined","missing Wasm export: QTS_GetModuleNamespace");assert(typeof wasmExports["QTS_Typeof"]!="undefined","missing Wasm export: QTS_Typeof");assert(typeof wasmExports["QTS_GetLength"]!="undefined","missing Wasm export: QTS_GetLength");assert(typeof wasmExports["QTS_IsEqual"]!="undefined","missing Wasm export: QTS_IsEqual");assert(typeof wasmExports["QTS_GetGlobalObject"]!="undefined","missing Wasm export: QTS_GetGlobalObject");assert(typeof wasmExports["QTS_NewPromiseCapability"]!="undefined","missing Wasm export: QTS_NewPromiseCapability");assert(typeof wasmExports["QTS_PromiseState"]!="undefined","missing Wasm export: QTS_PromiseState");assert(typeof wasmExports["QTS_PromiseResult"]!="undefined","missing Wasm export: QTS_PromiseResult");assert(typeof wasmExports["QTS_TestStringArg"]!="undefined","missing Wasm export: QTS_TestStringArg");assert(typeof wasmExports["QTS_GetDebugLogEnabled"]!="undefined","missing Wasm export: QTS_GetDebugLogEnabled");assert(typeof wasmExports["QTS_SetDebugLogEnabled"]!="undefined","missing Wasm export: QTS_SetDebugLogEnabled");assert(typeof wasmExports["QTS_BuildIsDebug"]!="undefined","missing Wasm export: QTS_BuildIsDebug");assert(typeof wasmExports["QTS_BuildIsAsyncify"]!="undefined","missing Wasm export: QTS_BuildIsAsyncify");assert(typeof wasmExports["QTS_NewFunction"]!="undefined","missing Wasm export: QTS_NewFunction");assert(typeof wasmExports["QTS_ArgvGetJSValueConstPointer"]!="undefined","missing Wasm export: QTS_ArgvGetJSValueConstPointer");assert(typeof wasmExports["QTS_RuntimeEnableInterruptHandler"]!="undefined","missing Wasm export: QTS_RuntimeEnableInterruptHandler");assert(typeof wasmExports["QTS_RuntimeDisableInterruptHandler"]!="undefined","missing Wasm export: QTS_RuntimeDisableInterruptHandler");assert(typeof wasmExports["QTS_RuntimeEnableModuleLoader"]!="undefined","missing Wasm export: QTS_RuntimeEnableModuleLoader");assert(typeof wasmExports["QTS_RuntimeDisableModuleLoader"]!="undefined","missing Wasm export: QTS_RuntimeDisableModuleLoader");assert(typeof wasmExports["QTS_bjson_encode"]!="undefined","missing Wasm export: QTS_bjson_encode");assert(typeof wasmExports["QTS_bjson_decode"]!="undefined","missing Wasm export: QTS_bjson_decode");assert(typeof wasmExports["fflush"]!="undefined","missing Wasm export: fflush");assert(typeof wasmExports["strerror"]!="undefined","missing Wasm export: strerror");assert(typeof wasmExports["emscripten_stack_init"]!="undefined","missing Wasm export: emscripten_stack_init");assert(typeof wasmExports["emscripten_stack_get_free"]!="undefined","missing Wasm export: emscripten_stack_get_free");assert(typeof wasmExports["emscripten_stack_get_base"]!="undefined","missing Wasm export: emscripten_stack_get_base");assert(typeof wasmExports["emscripten_stack_get_end"]!="undefined","missing Wasm export: emscripten_stack_get_end");assert(typeof wasmExports["_emscripten_stack_restore"]!="undefined","missing Wasm export: _emscripten_stack_restore");assert(typeof wasmExports["_emscripten_stack_alloc"]!="undefined","missing Wasm export: _emscripten_stack_alloc");assert(typeof wasmExports["emscripten_stack_get_current"]!="undefined","missing Wasm export: emscripten_stack_get_current");assert(typeof wasmExports["dynCall_viii"]!="undefined","missing Wasm export: dynCall_viii");assert(typeof wasmExports["dynCall_jijiiii"]!="undefined","missing Wasm export: dynCall_jijiiii");assert(typeof wasmExports["dynCall_iii"]!="undefined","missing Wasm export: dynCall_iii");assert(typeof wasmExports["dynCall_iiiii"]!="undefined","missing Wasm export: dynCall_iiiii");assert(typeof wasmExports["dynCall_iiii"]!="undefined","missing Wasm export: dynCall_iiii");assert(typeof wasmExports["dynCall_vij"]!="undefined","missing Wasm export: dynCall_vij");assert(typeof wasmExports["dynCall_ii"]!="undefined","missing Wasm export: dynCall_ii");assert(typeof wasmExports["dynCall_jijjiii"]!="undefined","missing Wasm export: dynCall_jijjiii");assert(typeof wasmExports["dynCall_vii"]!="undefined","missing Wasm export: dynCall_vii");assert(typeof wasmExports["dynCall_jijiii"]!="undefined","missing Wasm export: dynCall_jijiii");assert(typeof wasmExports["dynCall_jiii"]!="undefined","missing Wasm export: dynCall_jiii");assert(typeof wasmExports["dynCall_jijii"]!="undefined","missing Wasm export: dynCall_jijii");assert(typeof wasmExports["dynCall_jijiiiii"]!="undefined","missing Wasm export: dynCall_jijiiiii");assert(typeof wasmExports["dynCall_jijj"]!="undefined","missing Wasm export: dynCall_jijj");assert(typeof wasmExports["dynCall_viji"]!="undefined","missing Wasm export: dynCall_viji");assert(typeof wasmExports["dynCall_jij"]!="undefined","missing Wasm export: dynCall_jij");assert(typeof wasmExports["dynCall_jiji"]!="undefined","missing Wasm export: dynCall_jiji");assert(typeof wasmExports["dynCall_iijijjji"]!="undefined","missing Wasm export: dynCall_iijijjji");assert(typeof wasmExports["dynCall_iiiji"]!="undefined","missing Wasm export: dynCall_iiiji");assert(typeof wasmExports["dynCall_iiji"]!="undefined","missing Wasm export: dynCall_iiji");assert(typeof wasmExports["dynCall_iiiij"]!="undefined","missing Wasm export: dynCall_iiiij");assert(typeof wasmExports["dynCall_jijij"]!="undefined","missing Wasm export: dynCall_jijij");assert(typeof wasmExports["dynCall_iijijji"]!="undefined","missing Wasm export: dynCall_iijijji");assert(typeof wasmExports["dynCall_iijj"]!="undefined","missing Wasm export: dynCall_iijj");assert(typeof wasmExports["dynCall_iij"]!="undefined","missing Wasm export: dynCall_iij");assert(typeof wasmExports["dynCall_jiiii"]!="undefined","missing Wasm export: dynCall_jiiii");assert(typeof wasmExports["dynCall_dd"]!="undefined","missing Wasm export: dynCall_dd");assert(typeof wasmExports["dynCall_ddd"]!="undefined","missing Wasm export: dynCall_ddd");assert(typeof wasmExports["dynCall_jii"]!="undefined","missing Wasm export: dynCall_jii");assert(typeof wasmExports["dynCall_iidiiii"]!="undefined","missing Wasm export: dynCall_iidiiii");assert(typeof wasmExports["asyncify_start_unwind"]!="undefined","missing Wasm export: asyncify_start_unwind");assert(typeof wasmExports["asyncify_stop_unwind"]!="undefined","missing Wasm export: asyncify_stop_unwind");assert(typeof wasmExports["asyncify_start_rewind"]!="undefined","missing Wasm export: asyncify_start_rewind");assert(typeof wasmExports["asyncify_stop_rewind"]!="undefined","missing Wasm export: asyncify_stop_rewind");assert(typeof wasmExports["__indirect_function_table"]!="undefined","missing Wasm export: __indirect_function_table");_malloc=Module["_malloc"]=createExportWrapper("malloc",1);_QTS_Throw=Module["_QTS_Throw"]=createExportWrapper("QTS_Throw",2);_QTS_NewError=Module["_QTS_NewError"]=createExportWrapper("QTS_NewError",1);_QTS_RuntimeSetMemoryLimit=Module["_QTS_RuntimeSetMemoryLimit"]=createExportWrapper("QTS_RuntimeSetMemoryLimit",2);_QTS_RuntimeComputeMemoryUsage=Module["_QTS_RuntimeComputeMemoryUsage"]=createExportWrapper("QTS_RuntimeComputeMemoryUsage",2);_QTS_RuntimeDumpMemoryUsage=Module["_QTS_RuntimeDumpMemoryUsage"]=createExportWrapper("QTS_RuntimeDumpMemoryUsage",1);_QTS_RecoverableLeakCheck=Module["_QTS_RecoverableLeakCheck"]=createExportWrapper("QTS_RecoverableLeakCheck",0);_QTS_BuildIsSanitizeLeak=Module["_QTS_BuildIsSanitizeLeak"]=createExportWrapper("QTS_BuildIsSanitizeLeak",0);_QTS_RuntimeSetMaxStackSize=Module["_QTS_RuntimeSetMaxStackSize"]=createExportWrapper("QTS_RuntimeSetMaxStackSize",2);_QTS_GetUndefined=Module["_QTS_GetUndefined"]=createExportWrapper("QTS_GetUndefined",0);_QTS_GetNull=Module["_QTS_GetNull"]=createExportWrapper("QTS_GetNull",0);_QTS_GetFalse=Module["_QTS_GetFalse"]=createExportWrapper("QTS_GetFalse",0);_QTS_GetTrue=Module["_QTS_GetTrue"]=createExportWrapper("QTS_GetTrue",0);_QTS_NewHostRef=Module["_QTS_NewHostRef"]=createExportWrapper("QTS_NewHostRef",2);_QTS_GetHostRefId=Module["_QTS_GetHostRefId"]=createExportWrapper("QTS_GetHostRefId",1);_QTS_NewRuntime=Module["_QTS_NewRuntime"]=createExportWrapper("QTS_NewRuntime",0);_QTS_FreeRuntime=Module["_QTS_FreeRuntime"]=createExportWrapper("QTS_FreeRuntime",1);_free=Module["_free"]=createExportWrapper("free",1);_QTS_NewContext=Module["_QTS_NewContext"]=createExportWrapper("QTS_NewContext",2);_QTS_FreeContext=Module["_QTS_FreeContext"]=createExportWrapper("QTS_FreeContext",1);_QTS_FreeValuePointer=Module["_QTS_FreeValuePointer"]=createExportWrapper("QTS_FreeValuePointer",2);_QTS_FreeValuePointerRuntime=Module["_QTS_FreeValuePointerRuntime"]=createExportWrapper("QTS_FreeValuePointerRuntime",2);_QTS_FreeVoidPointer=Module["_QTS_FreeVoidPointer"]=createExportWrapper("QTS_FreeVoidPointer",2);_QTS_FreeCString=Module["_QTS_FreeCString"]=createExportWrapper("QTS_FreeCString",2);_QTS_DupValuePointer=Module["_QTS_DupValuePointer"]=createExportWrapper("QTS_DupValuePointer",2);_QTS_NewObject=Module["_QTS_NewObject"]=createExportWrapper("QTS_NewObject",1);_QTS_NewObjectProto=Module["_QTS_NewObjectProto"]=createExportWrapper("QTS_NewObjectProto",2);_QTS_NewArray=Module["_QTS_NewArray"]=createExportWrapper("QTS_NewArray",1);_QTS_NewArrayBuffer=Module["_QTS_NewArrayBuffer"]=createExportWrapper("QTS_NewArrayBuffer",3);_QTS_NewFloat64=Module["_QTS_NewFloat64"]=createExportWrapper("QTS_NewFloat64",2);_QTS_GetFloat64=Module["_QTS_GetFloat64"]=createExportWrapper("QTS_GetFloat64",2);_QTS_NewString=Module["_QTS_NewString"]=createExportWrapper("QTS_NewString",2);_QTS_GetString=Module["_QTS_GetString"]=createExportWrapper("QTS_GetString",2);_QTS_GetArrayBuffer=Module["_QTS_GetArrayBuffer"]=createExportWrapper("QTS_GetArrayBuffer",2);_QTS_GetArrayBufferLength=Module["_QTS_GetArrayBufferLength"]=createExportWrapper("QTS_GetArrayBufferLength",2);_QTS_NewSymbol=Module["_QTS_NewSymbol"]=createExportWrapper("QTS_NewSymbol",3);_QTS_GetSymbolDescriptionOrKey=Module["_QTS_GetSymbolDescriptionOrKey"]=createExportWrapper("QTS_GetSymbolDescriptionOrKey",2);_QTS_IsGlobalSymbol=Module["_QTS_IsGlobalSymbol"]=createExportWrapper("QTS_IsGlobalSymbol",2);_QTS_IsJobPending=Module["_QTS_IsJobPending"]=createExportWrapper("QTS_IsJobPending",1);_QTS_ExecutePendingJob=Module["_QTS_ExecutePendingJob"]=createExportWrapper("QTS_ExecutePendingJob",3);_QTS_GetProp=Module["_QTS_GetProp"]=createExportWrapper("QTS_GetProp",3);_QTS_GetPropNumber=Module["_QTS_GetPropNumber"]=createExportWrapper("QTS_GetPropNumber",3);_QTS_SetProp=Module["_QTS_SetProp"]=createExportWrapper("QTS_SetProp",4);_QTS_DefineProp=Module["_QTS_DefineProp"]=createExportWrapper("QTS_DefineProp",9);_QTS_GetOwnPropertyNames=Module["_QTS_GetOwnPropertyNames"]=createExportWrapper("QTS_GetOwnPropertyNames",5);_QTS_Call=Module["_QTS_Call"]=createExportWrapper("QTS_Call",5);_QTS_ResolveException=Module["_QTS_ResolveException"]=createExportWrapper("QTS_ResolveException",2);_QTS_Dump=Module["_QTS_Dump"]=createExportWrapper("QTS_Dump",2);_QTS_Eval=Module["_QTS_Eval"]=createExportWrapper("QTS_Eval",6);_QTS_GetModuleNamespace=Module["_QTS_GetModuleNamespace"]=createExportWrapper("QTS_GetModuleNamespace",2);_QTS_Typeof=Module["_QTS_Typeof"]=createExportWrapper("QTS_Typeof",2);_QTS_GetLength=Module["_QTS_GetLength"]=createExportWrapper("QTS_GetLength",3);_QTS_IsEqual=Module["_QTS_IsEqual"]=createExportWrapper("QTS_IsEqual",4);_QTS_GetGlobalObject=Module["_QTS_GetGlobalObject"]=createExportWrapper("QTS_GetGlobalObject",1);_QTS_NewPromiseCapability=Module["_QTS_NewPromiseCapability"]=createExportWrapper("QTS_NewPromiseCapability",2);_QTS_PromiseState=Module["_QTS_PromiseState"]=createExportWrapper("QTS_PromiseState",2);_QTS_PromiseResult=Module["_QTS_PromiseResult"]=createExportWrapper("QTS_PromiseResult",2);_QTS_TestStringArg=Module["_QTS_TestStringArg"]=createExportWrapper("QTS_TestStringArg",1);_QTS_GetDebugLogEnabled=Module["_QTS_GetDebugLogEnabled"]=createExportWrapper("QTS_GetDebugLogEnabled",1);_QTS_SetDebugLogEnabled=Module["_QTS_SetDebugLogEnabled"]=createExportWrapper("QTS_SetDebugLogEnabled",2);_QTS_BuildIsDebug=Module["_QTS_BuildIsDebug"]=createExportWrapper("QTS_BuildIsDebug",0);_QTS_BuildIsAsyncify=Module["_QTS_BuildIsAsyncify"]=createExportWrapper("QTS_BuildIsAsyncify",0);_QTS_NewFunction=Module["_QTS_NewFunction"]=createExportWrapper("QTS_NewFunction",5);_QTS_ArgvGetJSValueConstPointer=Module["_QTS_ArgvGetJSValueConstPointer"]=createExportWrapper("QTS_ArgvGetJSValueConstPointer",2);_QTS_RuntimeEnableInterruptHandler=Module["_QTS_RuntimeEnableInterruptHandler"]=createExportWrapper("QTS_RuntimeEnableInterruptHandler",1);_QTS_RuntimeDisableInterruptHandler=Module["_QTS_RuntimeDisableInterruptHandler"]=createExportWrapper("QTS_RuntimeDisableInterruptHandler",1);_QTS_RuntimeEnableModuleLoader=Module["_QTS_RuntimeEnableModuleLoader"]=createExportWrapper("QTS_RuntimeEnableModuleLoader",2);_QTS_RuntimeDisableModuleLoader=Module["_QTS_RuntimeDisableModuleLoader"]=createExportWrapper("QTS_RuntimeDisableModuleLoader",1);_QTS_bjson_encode=Module["_QTS_bjson_encode"]=createExportWrapper("QTS_bjson_encode",2);_QTS_bjson_decode=Module["_QTS_bjson_decode"]=createExportWrapper("QTS_bjson_decode",2);_fflush=createExportWrapper("fflush",1);_strerror=createExportWrapper("strerror",1);_emscripten_stack_init=wasmExports["emscripten_stack_init"];_emscripten_stack_get_free=wasmExports["emscripten_stack_get_free"];_emscripten_stack_get_base=wasmExports["emscripten_stack_get_base"];_emscripten_stack_get_end=wasmExports["emscripten_stack_get_end"];__emscripten_stack_restore=wasmExports["_emscripten_stack_restore"];__emscripten_stack_alloc=wasmExports["_emscripten_stack_alloc"];_emscripten_stack_get_current=wasmExports["emscripten_stack_get_current"];dynCall_viii=dynCalls["viii"]=createExportWrapper("dynCall_viii",4);dynCall_jijiiii=dynCalls["jijiiii"]=createExportWrapper("dynCall_jijiiii",7);dynCall_iii=dynCalls["iii"]=createExportWrapper("dynCall_iii",3);dynCall_iiiii=dynCalls["iiiii"]=createExportWrapper("dynCall_iiiii",5);dynCall_iiii=dynCalls["iiii"]=createExportWrapper("dynCall_iiii",4);dynCall_vij=dynCalls["vij"]=createExportWrapper("dynCall_vij",3);dynCall_ii=dynCalls["ii"]=createExportWrapper("dynCall_ii",2);dynCall_jijjiii=dynCalls["jijjiii"]=createExportWrapper("dynCall_jijjiii",7);dynCall_vii=dynCalls["vii"]=createExportWrapper("dynCall_vii",3);dynCall_jijiii=dynCalls["jijiii"]=createExportWrapper("dynCall_jijiii",6);dynCall_jiii=dynCalls["jiii"]=createExportWrapper("dynCall_jiii",4);dynCall_jijii=dynCalls["jijii"]=createExportWrapper("dynCall_jijii",5);dynCall_jijiiiii=dynCalls["jijiiiii"]=createExportWrapper("dynCall_jijiiiii",8);dynCall_jijj=dynCalls["jijj"]=createExportWrapper("dynCall_jijj",4);dynCall_viji=dynCalls["viji"]=createExportWrapper("dynCall_viji",4);dynCall_jij=dynCalls["jij"]=createExportWrapper("dynCall_jij",3);dynCall_jiji=dynCalls["jiji"]=createExportWrapper("dynCall_jiji",4);dynCall_iijijjji=dynCalls["iijijjji"]=createExportWrapper("dynCall_iijijjji",8);dynCall_iiiji=dynCalls["iiiji"]=createExportWrapper("dynCall_iiiji",5);dynCall_iiji=dynCalls["iiji"]=createExportWrapper("dynCall_iiji",4);dynCall_iiiij=dynCalls["iiiij"]=createExportWrapper("dynCall_iiiij",5);dynCall_jijij=dynCalls["jijij"]=createExportWrapper("dynCall_jijij",5);dynCall_iijijji=dynCalls["iijijji"]=createExportWrapper("dynCall_iijijji",7);dynCall_iijj=dynCalls["iijj"]=createExportWrapper("dynCall_iijj",4);dynCall_iij=dynCalls["iij"]=createExportWrapper("dynCall_iij",3);dynCall_jiiii=dynCalls["jiiii"]=createExportWrapper("dynCall_jiiii",5);dynCall_dd=dynCalls["dd"]=createExportWrapper("dynCall_dd",2);dynCall_ddd=dynCalls["ddd"]=createExportWrapper("dynCall_ddd",3);dynCall_jii=dynCalls["jii"]=createExportWrapper("dynCall_jii",3);dynCall_iidiiii=dynCalls["iidiiii"]=createExportWrapper("dynCall_iidiiii",7);_asyncify_start_unwind=createExportWrapper("asyncify_start_unwind",1);_asyncify_stop_unwind=createExportWrapper("asyncify_stop_unwind",0);_asyncify_start_rewind=createExportWrapper("asyncify_start_rewind",1);_asyncify_stop_rewind=createExportWrapper("asyncify_stop_rewind",0);__indirect_function_table=wasmExports["__indirect_function_table"]}var wasmImports={__assert_fail:___assert_fail,_abort_js:__abort_js,_localtime_js:__localtime_js,_tzset_js:__tzset_js,emscripten_date_now:_emscripten_date_now,emscripten_resize_heap:_emscripten_resize_heap,fd_close:_fd_close,fd_seek:_fd_seek,fd_write:_fd_write,memory:wasmMemory,qts_host_call_function,qts_host_interrupt_handler,qts_host_load_module_source,qts_host_normalize_module,qts_host_ref_free,set_asyncify_stack_size};var calledRun;function stackCheckInit(){_emscripten_stack_init();writeStackCookie()}function run(){stackCheckInit();preRun();function doRun(){assert(!calledRun);calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();readyPromiseResolve?.(Module);Module["onRuntimeInitialized"]?.();consumedModuleProp("onRuntimeInitialized");assert(!Module["_main"],'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]');postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(()=>{setTimeout(()=>Module["setStatus"](""),1);doRun()},1)}else{doRun()}checkStackCookie()}function checkUnflushedContent(){var oldOut=out;var oldErr=err;var has=false;out=err=x=>{has=true};try{flush_NO_FILESYSTEM()}catch(e){}out=oldOut;err=oldErr;if(has){warnOnce("stdio streams had content in them that was not flushed. you should set EXIT_RUNTIME to 1 (see the Emscripten FAQ), or make sure to emit a newline when you printf etc.");warnOnce("(this may also be due to not including full filesystem support - try building with -sFORCE_FILESYSTEM)")}}var wasmExports;wasmExports=await (createWasm());run();if(runtimeInitialized){moduleRtn=Module}else{moduleRtn=new Promise((resolve,reject)=>{readyPromiseResolve=resolve;readyPromiseReject=reject})}for(const prop of Object.keys(Module)){if(!(prop in moduleArg)){Object.defineProperty(moduleArg,prop,{configurable:true,get(){abort(`Access to module property ('${prop}') is no longer possible via the module constructor argument; Instead, use the result of the module constructor.`)}})}} -;return moduleRtn}export default QuickJSRaw; diff --git a/.output/server/node_modules/@jitl/quickjs-wasmfile-debug-asyncify/dist/emscripten-module.wasm b/.output/server/node_modules/@jitl/quickjs-wasmfile-debug-asyncify/dist/emscripten-module.wasm deleted file mode 100644 index e0bc38f..0000000 Binary files a/.output/server/node_modules/@jitl/quickjs-wasmfile-debug-asyncify/dist/emscripten-module.wasm and /dev/null differ diff --git a/.output/server/node_modules/@jitl/quickjs-wasmfile-debug-asyncify/dist/ffi.mjs b/.output/server/node_modules/@jitl/quickjs-wasmfile-debug-asyncify/dist/ffi.mjs deleted file mode 100644 index a8ddbed..0000000 --- a/.output/server/node_modules/@jitl/quickjs-wasmfile-debug-asyncify/dist/ffi.mjs +++ /dev/null @@ -1,2 +0,0 @@ -import{assertSync}from"@jitl/quickjs-ffi-types";var QuickJSAsyncFFI=class{constructor(module){this.module=module;this.DEBUG=!0;this.QTS_Throw=this.module.cwrap("QTS_Throw","number",["number","number"]);this.QTS_NewError=this.module.cwrap("QTS_NewError","number",["number"]);this.QTS_RuntimeSetMemoryLimit=this.module.cwrap("QTS_RuntimeSetMemoryLimit",null,["number","number"]);this.QTS_RuntimeComputeMemoryUsage=this.module.cwrap("QTS_RuntimeComputeMemoryUsage","number",["number","number"]);this.QTS_RuntimeDumpMemoryUsage=this.module.cwrap("QTS_RuntimeDumpMemoryUsage","number",["number"]);this.QTS_RecoverableLeakCheck=this.module.cwrap("QTS_RecoverableLeakCheck","number",[]);this.QTS_BuildIsSanitizeLeak=this.module.cwrap("QTS_BuildIsSanitizeLeak","number",[]);this.QTS_RuntimeSetMaxStackSize=this.module.cwrap("QTS_RuntimeSetMaxStackSize",null,["number","number"]);this.QTS_GetUndefined=this.module.cwrap("QTS_GetUndefined","number",[]);this.QTS_GetNull=this.module.cwrap("QTS_GetNull","number",[]);this.QTS_GetFalse=this.module.cwrap("QTS_GetFalse","number",[]);this.QTS_GetTrue=this.module.cwrap("QTS_GetTrue","number",[]);this.QTS_NewHostRef=this.module.cwrap("QTS_NewHostRef","number",["number","number"]);this.QTS_GetHostRefId=this.module.cwrap("QTS_GetHostRefId","number",["number"]);this.QTS_NewRuntime=this.module.cwrap("QTS_NewRuntime","number",[]);this.QTS_FreeRuntime=this.module.cwrap("QTS_FreeRuntime",null,["number"]);this.QTS_NewContext=this.module.cwrap("QTS_NewContext","number",["number","number"]);this.QTS_FreeContext=this.module.cwrap("QTS_FreeContext",null,["number"]);this.QTS_FreeValuePointer=this.module.cwrap("QTS_FreeValuePointer",null,["number","number"]);this.QTS_FreeValuePointerRuntime=this.module.cwrap("QTS_FreeValuePointerRuntime",null,["number","number"]);this.QTS_FreeVoidPointer=this.module.cwrap("QTS_FreeVoidPointer",null,["number","number"]);this.QTS_FreeCString=this.module.cwrap("QTS_FreeCString",null,["number","number"]);this.QTS_DupValuePointer=this.module.cwrap("QTS_DupValuePointer","number",["number","number"]);this.QTS_NewObject=this.module.cwrap("QTS_NewObject","number",["number"]);this.QTS_NewObjectProto=this.module.cwrap("QTS_NewObjectProto","number",["number","number"]);this.QTS_NewArray=this.module.cwrap("QTS_NewArray","number",["number"]);this.QTS_NewArrayBuffer=this.module.cwrap("QTS_NewArrayBuffer","number",["number","number","number"]);this.QTS_NewFloat64=this.module.cwrap("QTS_NewFloat64","number",["number","number"]);this.QTS_GetFloat64=this.module.cwrap("QTS_GetFloat64","number",["number","number"]);this.QTS_NewString=this.module.cwrap("QTS_NewString","number",["number","number"]);this.QTS_GetString=this.module.cwrap("QTS_GetString","number",["number","number"]);this.QTS_GetArrayBuffer=this.module.cwrap("QTS_GetArrayBuffer","number",["number","number"]);this.QTS_GetArrayBufferLength=this.module.cwrap("QTS_GetArrayBufferLength","number",["number","number"]);this.QTS_NewSymbol=this.module.cwrap("QTS_NewSymbol","number",["number","number","number"]);this.QTS_GetSymbolDescriptionOrKey=assertSync(this.module.cwrap("QTS_GetSymbolDescriptionOrKey","number",["number","number"]));this.QTS_GetSymbolDescriptionOrKey_MaybeAsync=this.module.cwrap("QTS_GetSymbolDescriptionOrKey","number",["number","number"],{async:!0});this.QTS_IsGlobalSymbol=this.module.cwrap("QTS_IsGlobalSymbol","number",["number","number"]);this.QTS_IsJobPending=this.module.cwrap("QTS_IsJobPending","number",["number"]);this.QTS_ExecutePendingJob=assertSync(this.module.cwrap("QTS_ExecutePendingJob","number",["number","number","number"]));this.QTS_ExecutePendingJob_MaybeAsync=this.module.cwrap("QTS_ExecutePendingJob","number",["number","number","number"],{async:!0});this.QTS_GetProp=assertSync(this.module.cwrap("QTS_GetProp","number",["number","number","number"]));this.QTS_GetProp_MaybeAsync=this.module.cwrap("QTS_GetProp","number",["number","number","number"],{async:!0});this.QTS_GetPropNumber=assertSync(this.module.cwrap("QTS_GetPropNumber","number",["number","number","number"]));this.QTS_GetPropNumber_MaybeAsync=this.module.cwrap("QTS_GetPropNumber","number",["number","number","number"],{async:!0});this.QTS_SetProp=assertSync(this.module.cwrap("QTS_SetProp",null,["number","number","number","number"]));this.QTS_SetProp_MaybeAsync=this.module.cwrap("QTS_SetProp",null,["number","number","number","number"],{async:!0});this.QTS_DefineProp=this.module.cwrap("QTS_DefineProp",null,["number","number","number","number","number","number","boolean","boolean","boolean"]);this.QTS_GetOwnPropertyNames=assertSync(this.module.cwrap("QTS_GetOwnPropertyNames","number",["number","number","number","number","number"]));this.QTS_GetOwnPropertyNames_MaybeAsync=this.module.cwrap("QTS_GetOwnPropertyNames","number",["number","number","number","number","number"],{async:!0});this.QTS_Call=assertSync(this.module.cwrap("QTS_Call","number",["number","number","number","number","number"]));this.QTS_Call_MaybeAsync=this.module.cwrap("QTS_Call","number",["number","number","number","number","number"],{async:!0});this.QTS_ResolveException=this.module.cwrap("QTS_ResolveException","number",["number","number"]);this.QTS_Dump=assertSync(this.module.cwrap("QTS_Dump","number",["number","number"]));this.QTS_Dump_MaybeAsync=this.module.cwrap("QTS_Dump","number",["number","number"],{async:!0});this.QTS_Eval=assertSync(this.module.cwrap("QTS_Eval","number",["number","number","number","string","number","number"]));this.QTS_Eval_MaybeAsync=this.module.cwrap("QTS_Eval","number",["number","number","number","string","number","number"],{async:!0});this.QTS_GetModuleNamespace=this.module.cwrap("QTS_GetModuleNamespace","number",["number","number"]);this.QTS_Typeof=this.module.cwrap("QTS_Typeof","number",["number","number"]);this.QTS_GetLength=this.module.cwrap("QTS_GetLength","number",["number","number","number"]);this.QTS_IsEqual=this.module.cwrap("QTS_IsEqual","number",["number","number","number","number"]);this.QTS_GetGlobalObject=this.module.cwrap("QTS_GetGlobalObject","number",["number"]);this.QTS_NewPromiseCapability=this.module.cwrap("QTS_NewPromiseCapability","number",["number","number"]);this.QTS_PromiseState=this.module.cwrap("QTS_PromiseState","number",["number","number"]);this.QTS_PromiseResult=this.module.cwrap("QTS_PromiseResult","number",["number","number"]);this.QTS_TestStringArg=this.module.cwrap("QTS_TestStringArg",null,["string"]);this.QTS_GetDebugLogEnabled=this.module.cwrap("QTS_GetDebugLogEnabled","number",["number"]);this.QTS_SetDebugLogEnabled=this.module.cwrap("QTS_SetDebugLogEnabled",null,["number","number"]);this.QTS_BuildIsDebug=this.module.cwrap("QTS_BuildIsDebug","number",[]);this.QTS_BuildIsAsyncify=this.module.cwrap("QTS_BuildIsAsyncify","number",[]);this.QTS_NewFunction=this.module.cwrap("QTS_NewFunction","number",["number","string","number","boolean","number"]);this.QTS_ArgvGetJSValueConstPointer=this.module.cwrap("QTS_ArgvGetJSValueConstPointer","number",["number","number"]);this.QTS_RuntimeEnableInterruptHandler=this.module.cwrap("QTS_RuntimeEnableInterruptHandler",null,["number"]);this.QTS_RuntimeDisableInterruptHandler=this.module.cwrap("QTS_RuntimeDisableInterruptHandler",null,["number"]);this.QTS_RuntimeEnableModuleLoader=this.module.cwrap("QTS_RuntimeEnableModuleLoader",null,["number","number"]);this.QTS_RuntimeDisableModuleLoader=this.module.cwrap("QTS_RuntimeDisableModuleLoader",null,["number"]);this.QTS_bjson_encode=this.module.cwrap("QTS_bjson_encode","number",["number","number"]);this.QTS_bjson_decode=this.module.cwrap("QTS_bjson_decode","number",["number","number"])}};export{QuickJSAsyncFFI}; -//# sourceMappingURL=ffi.mjs.map \ No newline at end of file diff --git a/.output/server/node_modules/@jitl/quickjs-wasmfile-debug-asyncify/dist/index.mjs b/.output/server/node_modules/@jitl/quickjs-wasmfile-debug-asyncify/dist/index.mjs deleted file mode 100644 index 5ecbbbf..0000000 --- a/.output/server/node_modules/@jitl/quickjs-wasmfile-debug-asyncify/dist/index.mjs +++ /dev/null @@ -1,2 +0,0 @@ -var variant={type:"async",importFFI:()=>import("./ffi.mjs").then(mod=>mod.QuickJSAsyncFFI),importModuleLoader:()=>import("@jitl/quickjs-wasmfile-debug-asyncify/emscripten-module").then(mod=>mod.default)},src_default=variant;export{src_default as default}; -//# sourceMappingURL=index.mjs.map \ No newline at end of file diff --git a/.output/server/node_modules/@jitl/quickjs-wasmfile-debug-asyncify/package.json b/.output/server/node_modules/@jitl/quickjs-wasmfile-debug-asyncify/package.json deleted file mode 100644 index a719ef7..0000000 --- a/.output/server/node_modules/@jitl/quickjs-wasmfile-debug-asyncify/package.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "name": "@jitl/quickjs-wasmfile-debug-asyncify", - "license": "MIT", - "version": "0.32.0", - "description": "Variant of quickjs library: Variant with separate .WASM file. Supports browser ESM, NodeJS ESM, and NodeJS CommonJS.", - "sideEffects": false, - "repository": { - "type": "git", - "url": "https://github.com/justjake/quickjs-emscripten" - }, - "author": { - "name": "Jake Teton-Landis", - "url": "https://jake.tl" - }, - "scripts": { - "build": "yarn build:c && yarn build:ts", - "build:c": "make", - "build:ts": "npx tsup", - "check:types": "npx tsc --project . --noEmit", - "clean": "make clean", - "prepare": "yarn clean && yarn build" - }, - "files": [ - "LICENSE", - "README.md", - "dist/**/*", - "!dist/*.tsbuildinfo" - ], - "types": "./dist/index.d.ts", - "main": "./dist/index.js", - "module": "./dist/index.mjs", - "browser": "./dist/index.mjs", - "exports": { - ".": { - "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", - "require": "./dist/index.js", - "default": "./dist/index.js" - }, - "./package.json": "./package.json", - "./ffi": { - "types": "./dist/ffi.d.ts", - "import": "./dist/ffi.mjs", - "require": "./dist/ffi.js", - "default": "./dist/ffi.js" - }, - "./wasm": "./dist/emscripten-module.wasm", - "./emscripten-module": { - "types": "./dist/emscripten-module.browser.d.ts", - "iife": "./dist/emscripten-module.cjs", - "workerd": "./dist/emscripten-module.cloudflare.cjs", - "browser": "./dist/emscripten-module.browser.mjs", - "import": "./dist/emscripten-module.mjs", - "require": "./dist/emscripten-module.cjs", - "default": "./dist/emscripten-module.cjs" - } - }, - "dependencies": { - "@jitl/quickjs-ffi-types": "0.32.0" - } -} \ No newline at end of file diff --git a/.output/server/node_modules/@jitl/quickjs-wasmfile-debug-sync/dist/emscripten-module.mjs b/.output/server/node_modules/@jitl/quickjs-wasmfile-debug-sync/dist/emscripten-module.mjs deleted file mode 100644 index 8a3ac7d..0000000 --- a/.output/server/node_modules/@jitl/quickjs-wasmfile-debug-sync/dist/emscripten-module.mjs +++ /dev/null @@ -1,5541 +0,0 @@ -// This code implements the `-sMODULARIZE` settings by taking the generated -// JS program code (INNER_JS_CODE) and wrapping it in a factory function. - -// When targeting node and ES6 we use `await import ..` in the generated code -// so the outer function needs to be marked as async. -async function QuickJSRaw(moduleArg = {}) { - var moduleRtn; - -// include: shell.js -// include: minimum_runtime_check.js -(function() { - // "30.0.0" -> 300000 - function humanReadableVersionToPacked(str) { - str = str.split('-')[0]; // Remove any trailing part from e.g. "12.53.3-alpha" - var vers = str.split('.').slice(0, 3); - while(vers.length < 3) vers.push('00'); - vers = vers.map((n, i, arr) => n.padStart(2, '0')); - return vers.join(''); - } - // 300000 -> "30.0.0" - var packedVersionToHumanReadable = n => [n / 10000 | 0, (n / 100 | 0) % 100, n % 100].join('.'); - - var TARGET_NOT_SUPPORTED = 2147483647; - - // Note: We use a typeof check here instead of optional chaining using - // globalThis because older browsers might not have globalThis defined. - var currentNodeVersion = typeof process !== 'undefined' && process.versions?.node ? humanReadableVersionToPacked(process.versions.node) : TARGET_NOT_SUPPORTED; - if (currentNodeVersion < 160000) { - throw new Error(`This emscripten-generated code requires node v${ packedVersionToHumanReadable(160000) } (detected v${packedVersionToHumanReadable(currentNodeVersion)})`); - } - - var userAgent = typeof navigator !== 'undefined' && navigator.userAgent; - if (!userAgent) { - return; - } - - var currentSafariVersion = userAgent.includes("Safari/") && !userAgent.includes("Chrome/") && userAgent.match(/Version\/(\d+\.?\d*\.?\d*)/) ? humanReadableVersionToPacked(userAgent.match(/Version\/(\d+\.?\d*\.?\d*)/)[1]) : TARGET_NOT_SUPPORTED; - if (currentSafariVersion < 150000) { - throw new Error(`This emscripten-generated code requires Safari v${ packedVersionToHumanReadable(150000) } (detected v${currentSafariVersion})`); - } - - var currentFirefoxVersion = userAgent.match(/Firefox\/(\d+(?:\.\d+)?)/) ? parseFloat(userAgent.match(/Firefox\/(\d+(?:\.\d+)?)/)[1]) : TARGET_NOT_SUPPORTED; - if (currentFirefoxVersion < 79) { - throw new Error(`This emscripten-generated code requires Firefox v79 (detected v${currentFirefoxVersion})`); - } - - var currentChromeVersion = userAgent.match(/Chrome\/(\d+(?:\.\d+)?)/) ? parseFloat(userAgent.match(/Chrome\/(\d+(?:\.\d+)?)/)[1]) : TARGET_NOT_SUPPORTED; - if (currentChromeVersion < 85) { - throw new Error(`This emscripten-generated code requires Chrome v85 (detected v${currentChromeVersion})`); - } -})(); - -// end include: minimum_runtime_check.js -// The Module object: Our interface to the outside world. We import -// and export values on it. There are various ways Module can be used: -// 1. Not defined. We create it here -// 2. A function parameter, function(moduleArg) => Promise -// 3. pre-run appended it, var Module = {}; ..generated code.. -// 4. External script tag defines var Module. -// We need to check if Module already exists (e.g. case 3 above). -// Substitution will be replaced with actual code on later stage of the build, -// this way Closure Compiler will not mangle it (e.g. case 4. above). -// Note that if you want to run closure, and also to use Module -// after the generated code, you will need to define var Module = {}; -// before the code. Then that object will be used in the code, and you -// can continue to use Module afterwards as well. -var Module = moduleArg; - -// Determine the runtime environment we are in. You can customize this by -// setting the ENVIRONMENT setting at compile time (see settings.js). - -// Attempt to auto-detect the environment -var ENVIRONMENT_IS_WEB = !!globalThis.window; -var ENVIRONMENT_IS_WORKER = !!globalThis.WorkerGlobalScope; -// N.b. Electron.js environment is simultaneously a NODE-environment, but -// also a web environment. -var ENVIRONMENT_IS_NODE = globalThis.process?.versions?.node && globalThis.process?.type != 'renderer'; -var ENVIRONMENT_IS_SHELL = !ENVIRONMENT_IS_WEB && !ENVIRONMENT_IS_NODE && !ENVIRONMENT_IS_WORKER; - -if (ENVIRONMENT_IS_NODE) { - // When building an ES module `require` is not normally available. - // We need to use `createRequire()` to construct the require()` function. - const { createRequire } = await import('node:module'); - /** @suppress{duplicate} */ - var require = createRequire(import.meta.url); - -} - -// --pre-jses are emitted after the Module integration code, so that they can -// refer to Module (if they choose; they can also define Module) -// include: ../../templates/pre-extension.js -/* eslint-disable no-undef */ -// quickjs-emscripten code injected into emscripten-module.js -// We use this to expose and patch up issues with Emscripten's source map handling... -function quickjsEmscriptenInit(debugLog) { - const log = debugLog || function () {} - // Everything goes in a function so we can defer running until other variables - // are initialized in case they change. - const extension = { log } - for (const init of quickjsEmscriptenInit.inits) { - init(extension) - } - Module["quickJSEmscriptenExtensions"] = extension - return extension -} -quickjsEmscriptenInit.inits = [] -Module["quickjsEmscriptenInit"] = quickjsEmscriptenInit -// end include: ../../templates/pre-extension.js -// include: ../../templates/pre-sourceMapJson.js -/* eslint-disable no-undef */ -quickjsEmscriptenInit.inits.push((extension) => { - if (typeof receiveSourceMapJSON !== "undefined") { - extension["receiveSourceMapJSON"] = (data) => { - if (typeof wasmSourceMap === "undefined") { - extension.log("receiveSourceMapJSON: received", data) - return receiveSourceMapJSON(data) - } else { - extension.log("receiveSourceMapJSON: already have data:", wasmSourceMap, "ignoring", data) - } - } - } -}) -// end include: ../../templates/pre-sourceMapJson.js -// include: ../../templates/pre-wasmOffsetConverter.js -/* eslint-disable no-undef */ -quickjsEmscriptenInit.inits.push((extension) => { - if (typeof WasmOffsetConverter !== "undefined") { - extension["WasmOffsetConverter"] = WasmOffsetConverter - // Expose function to receive WasmOffsetConverter, set to wasmOffsetConverter local variable - // if it exists - try { - // Check if wasmOffsetConverter variable exists. If it isn't defined, this - // will throw and we'll skip the rest of the branch. - extension["existingWasmOffsetConverter"] = wasmOffsetConverter - extension["receiveWasmOffsetConverter"] = function (wasmBinary, wasmModule) { - if (!wasmOffsetConverter) { - extension.log("wasmOffsetConverter set") - wasmOffsetConverter = new WasmOffsetConverter(wasmBinary, wasmModule) - } else { - extension.log("wasmOffsetConverter already set, ignored") - } - } - } catch (error) { - // Nothing. - extension["receiveWasmOffsetConverter"] = function () { - extension.log("wasmOffsetConverter variable not defined, this is a no-op") - } - } - } -}) -// end include: ../../templates/pre-wasmOffsetConverter.js -// include: ../../templates/pre-wasmMemory.js -/* eslint-disable no-undef */ -quickjsEmscriptenInit.inits.push((extension) => { - extension["getWasmMemory"] = function () { - return wasmMemory - } -}) -// end include: ../../templates/pre-wasmMemory.js - - -var arguments_ = []; -var thisProgram = './this.program'; -var quit_ = (status, toThrow) => { - throw toThrow; -}; - -var _scriptName = import.meta.url; - -// `/` should be present at the end if `scriptDirectory` is not empty -var scriptDirectory = ''; -function locateFile(path) { - if (Module['locateFile']) { - return Module['locateFile'](path, scriptDirectory); - } - return scriptDirectory + path; -} - -// Hooks that are implemented differently in different runtime environments. -var readAsync, readBinary; - -if (ENVIRONMENT_IS_NODE) { - const isNode = globalThis.process?.versions?.node && globalThis.process?.type != 'renderer'; - if (!isNode) throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)'); - - // These modules will usually be used on Node.js. Load them eagerly to avoid - // the complexity of lazy-loading. - var fs = require('node:fs'); - - if (_scriptName.startsWith('file:')) { - scriptDirectory = require('node:path').dirname(require('node:url').fileURLToPath(_scriptName)) + '/'; - } - -// include: node_shell_read.js -readBinary = (filename) => { - // We need to re-wrap `file://` strings to URLs. - filename = isFileURI(filename) ? new URL(filename) : filename; - var ret = fs.readFileSync(filename); - assert(Buffer.isBuffer(ret)); - return ret; -}; - -readAsync = async (filename, binary = true) => { - // See the comment in the `readBinary` function. - filename = isFileURI(filename) ? new URL(filename) : filename; - var ret = fs.readFileSync(filename, binary ? undefined : 'utf8'); - assert(binary ? Buffer.isBuffer(ret) : typeof ret == 'string'); - return ret; -}; -// end include: node_shell_read.js - if (process.argv.length > 1) { - thisProgram = process.argv[1].replace(/\\/g, '/'); - } - - arguments_ = process.argv.slice(2); - - quit_ = (status, toThrow) => { - process.exitCode = status; - throw toThrow; - }; - -} else -if (ENVIRONMENT_IS_SHELL) { - -} else - -// Note that this includes Node.js workers when relevant (pthreads is enabled). -// Node.js workers are detected as a combination of ENVIRONMENT_IS_WORKER and -// ENVIRONMENT_IS_NODE. -if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) { - try { - scriptDirectory = new URL('.', _scriptName).href; // includes trailing slash - } catch { - // Must be a `blob:` or `data:` URL (e.g. `blob:http://site.com/etc/etc`), we cannot - // infer anything from them. - } - - if (!(globalThis.window || globalThis.WorkerGlobalScope)) throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)'); - - { -// include: web_or_worker_shell_read.js -if (ENVIRONMENT_IS_WORKER) { - readBinary = (url) => { - var xhr = new XMLHttpRequest(); - xhr.open('GET', url, false); - xhr.responseType = 'arraybuffer'; - xhr.send(null); - return new Uint8Array(/** @type{!ArrayBuffer} */(xhr.response)); - }; - } - - readAsync = async (url) => { - // Fetch has some additional restrictions over XHR, like it can't be used on a file:// url. - // See https://github.com/github/fetch/pull/92#issuecomment-140665932 - // Cordova or Electron apps are typically loaded from a file:// url. - // So use XHR on webview if URL is a file URL. - if (isFileURI(url)) { - return new Promise((resolve, reject) => { - var xhr = new XMLHttpRequest(); - xhr.open('GET', url, true); - xhr.responseType = 'arraybuffer'; - xhr.onload = () => { - if (xhr.status == 200 || (xhr.status == 0 && xhr.response)) { // file URLs can return 0 - resolve(xhr.response); - return; - } - reject(xhr.status); - }; - xhr.onerror = reject; - xhr.send(null); - }); - } - var response = await fetch(url, { credentials: 'same-origin' }); - if (response.ok) { - return response.arrayBuffer(); - } - throw new Error(response.status + ' : ' + response.url); - }; -// end include: web_or_worker_shell_read.js - } -} else -{ - throw new Error('environment detection error'); -} - -var out = console.log.bind(console); -var err = console.error.bind(console); - -var IDBFS = 'IDBFS is no longer included by default; build with -lidbfs.js'; -var PROXYFS = 'PROXYFS is no longer included by default; build with -lproxyfs.js'; -var WORKERFS = 'WORKERFS is no longer included by default; build with -lworkerfs.js'; -var FETCHFS = 'FETCHFS is no longer included by default; build with -lfetchfs.js'; -var ICASEFS = 'ICASEFS is no longer included by default; build with -licasefs.js'; -var JSFILEFS = 'JSFILEFS is no longer included by default; build with -ljsfilefs.js'; -var OPFS = 'OPFS is no longer included by default; build with -lopfs.js'; - -var NODEFS = 'NODEFS is no longer included by default; build with -lnodefs.js'; - -// perform assertions in shell.js after we set up out() and err(), as otherwise -// if an assertion fails it cannot print the message - -assert(!ENVIRONMENT_IS_SHELL, 'shell environment detected but not enabled at build time. Add `shell` to `-sENVIRONMENT` to enable.'); - -// end include: shell.js - -// include: preamble.js -// === Preamble library stuff === - -// Documentation for the public APIs defined in this file must be updated in: -// site/source/docs/api_reference/preamble.js.rst -// A prebuilt local version of the documentation is available at: -// site/build/text/docs/api_reference/preamble.js.txt -// You can also build docs locally as HTML or other formats in site/ -// An online HTML version (which may be of a different version of Emscripten) -// is up at http://kripken.github.io/emscripten-site/docs/api_reference/preamble.js.html - -var wasmBinary; - -if (!globalThis.WebAssembly) { - err('no native wasm support detected'); -} - -// Wasm globals - -//======================================== -// Runtime essentials -//======================================== - -// whether we are quitting the application. no code should run after this. -// set in exit() and abort() -var ABORT = false; - -// set by exit() and abort(). Passed to 'onExit' handler. -// NOTE: This is also used as the process return code in shell environments -// but only when noExitRuntime is false. -var EXITSTATUS; - -// In STRICT mode, we only define assert() when ASSERTIONS is set. i.e. we -// don't define it at all in release modes. This matches the behaviour of -// MINIMAL_RUNTIME. -// TODO(sbc): Make this the default even without STRICT enabled. -/** @type {function(*, string=)} */ -function assert(condition, text) { - if (!condition) { - abort('Assertion failed' + (text ? ': ' + text : '')); - } -} - -// We used to include malloc/free by default in the past. Show a helpful error in -// builds with assertions. - -/** - * Indicates whether filename is delivered via file protocol (as opposed to http/https) - * @noinline - */ -var isFileURI = (filename) => filename.startsWith('file://'); - -// include: runtime_common.js -// include: runtime_stack_check.js -// Initializes the stack cookie. Called at the startup of main and at the startup of each thread in pthreads mode. -function writeStackCookie() { - var max = _emscripten_stack_get_end(); - assert((max & 3) == 0); - // If the stack ends at address zero we write our cookies 4 bytes into the - // stack. This prevents interference with SAFE_HEAP and ASAN which also - // monitor writes to address zero. - if (max == 0) { - max += 4; - } - // The stack grow downwards towards _emscripten_stack_get_end. - // We write cookies to the final two words in the stack and detect if they are - // ever overwritten. - HEAPU32[((max)>>2)] = 0x02135467; - HEAPU32[(((max)+(4))>>2)] = 0x89BACDFE; - // Also test the global address 0 for integrity. - HEAPU32[((0)>>2)] = 1668509029; -} - -function checkStackCookie() { - if (ABORT) return; - var max = _emscripten_stack_get_end(); - // See writeStackCookie(). - if (max == 0) { - max += 4; - } - var cookie1 = HEAPU32[((max)>>2)]; - var cookie2 = HEAPU32[(((max)+(4))>>2)]; - if (cookie1 != 0x02135467 || cookie2 != 0x89BACDFE) { - abort(`Stack overflow! Stack cookie has been overwritten at ${ptrToString(max)}, expected hex dwords 0x89BACDFE and 0x2135467, but received ${ptrToString(cookie2)} ${ptrToString(cookie1)}`); - } - // Also test the global address 0 for integrity. - if (HEAPU32[((0)>>2)] != 0x63736d65 /* 'emsc' */) { - abort('Runtime error: The application has corrupted its heap memory area (address zero)!'); - } -} -// end include: runtime_stack_check.js -// include: runtime_exceptions.js -// end include: runtime_exceptions.js -// include: runtime_debug.js -var runtimeDebug = true; // Switch to false at runtime to disable logging at the right times - -// Used by XXXXX_DEBUG settings to output debug messages. -function dbg(...args) { - if (!runtimeDebug && typeof runtimeDebug != 'undefined') return; - // TODO(sbc): Make this configurable somehow. Its not always convenient for - // logging to show up as warnings. - console.warn(...args); -} - -// Endianness check -(() => { - var h16 = new Int16Array(1); - var h8 = new Int8Array(h16.buffer); - h16[0] = 0x6373; - if (h8[0] !== 0x73 || h8[1] !== 0x63) abort('Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)'); -})(); - -function consumedModuleProp(prop) { - if (!Object.getOwnPropertyDescriptor(Module, prop)) { - Object.defineProperty(Module, prop, { - configurable: true, - set() { - abort(`Attempt to set \`Module.${prop}\` after it has already been processed. This can happen, for example, when code is injected via '--post-js' rather than '--pre-js'`); - - } - }); - } -} - -function makeInvalidEarlyAccess(name) { - return () => assert(false, `call to '${name}' via reference taken before Wasm module initialization`); - -} - -function ignoredModuleProp(prop) { - if (Object.getOwnPropertyDescriptor(Module, prop)) { - abort(`\`Module.${prop}\` was supplied but \`${prop}\` not included in INCOMING_MODULE_JS_API`); - } -} - -// forcing the filesystem exports a few things by default -function isExportedByForceFilesystem(name) { - return name === 'FS_createPath' || - name === 'FS_createDataFile' || - name === 'FS_createPreloadedFile' || - name === 'FS_preloadFile' || - name === 'FS_unlink' || - name === 'addRunDependency' || - // The old FS has some functionality that WasmFS lacks. - name === 'FS_createLazyFile' || - name === 'FS_createDevice' || - name === 'removeRunDependency'; -} - -function missingLibrarySymbol(sym) { - - // Any symbol that is not included from the JS library is also (by definition) - // not exported on the Module object. - unexportedRuntimeSymbol(sym); -} - -function unexportedRuntimeSymbol(sym) { - if (!Object.getOwnPropertyDescriptor(Module, sym)) { - Object.defineProperty(Module, sym, { - configurable: true, - get() { - var msg = `'${sym}' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the Emscripten FAQ)`; - if (isExportedByForceFilesystem(sym)) { - msg += '. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'; - } - abort(msg); - }, - }); - } -} - -// end include: runtime_debug.js -var readyPromiseResolve, readyPromiseReject; - -// Memory management -var -/** @type {!Int8Array} */ - HEAP8, -/** @type {!Uint8Array} */ - HEAPU8, -/** @type {!Int16Array} */ - HEAP16, -/** @type {!Uint16Array} */ - HEAPU16, -/** @type {!Int32Array} */ - HEAP32, -/** @type {!Uint32Array} */ - HEAPU32, -/** @type {!Float32Array} */ - HEAPF32, -/** @type {!Float64Array} */ - HEAPF64; - -// BigInt64Array type is not correctly defined in closure -var -/** not-@type {!BigInt64Array} */ - HEAP64, -/* BigUint64Array type is not correctly defined in closure -/** not-@type {!BigUint64Array} */ - HEAPU64; - -var runtimeInitialized = false; - -var runtimeExited = false; - - - -function updateMemoryViews() { - var b = wasmMemory.buffer; - Module['HEAP8'] = HEAP8 = new Int8Array(b); - HEAP16 = new Int16Array(b); - Module['HEAPU8'] = HEAPU8 = new Uint8Array(b); - HEAPU16 = new Uint16Array(b); - HEAP32 = new Int32Array(b); - HEAPU32 = new Uint32Array(b); - HEAPF32 = new Float32Array(b); - HEAPF64 = new Float64Array(b); - HEAP64 = new BigInt64Array(b); - HEAPU64 = new BigUint64Array(b); -} - -// In non-standalone/normal mode, we create the memory here. -// include: runtime_init_memory.js -// Create the wasm memory. (Note: this only applies if IMPORTED_MEMORY is defined) - -// check for full engine support (use string 'subarray' to avoid closure compiler confusion) - -function initMemory() { - - - - if (Module['wasmMemory']) { - wasmMemory = Module['wasmMemory']; - } else - { - var INITIAL_MEMORY = Module['INITIAL_MEMORY'] || 16777216; - - assert(INITIAL_MEMORY >= 5242880, 'INITIAL_MEMORY should be larger than STACK_SIZE, was ' + INITIAL_MEMORY + '! (STACK_SIZE=' + 5242880 + ')'); - /** @suppress {checkTypes} */ - wasmMemory = new WebAssembly.Memory({ - 'initial': INITIAL_MEMORY / 65536, - // In theory we should not need to emit the maximum if we want "unlimited" - // or 4GB of memory, but VMs error on that atm, see - // https://github.com/emscripten-core/emscripten/issues/14130 - // And in the pthreads case we definitely need to emit a maximum. So - // always emit one. - 'maximum': 32768, - }); - } - - updateMemoryViews(); -} - -// end include: runtime_init_memory.js - -// include: memoryprofiler.js -// end include: memoryprofiler.js -// end include: runtime_common.js -assert(globalThis.Int32Array && globalThis.Float64Array && Int32Array.prototype.subarray && Int32Array.prototype.set, - 'JS engine does not provide full typed array support'); - -function preRun() { - if (Module['preRun']) { - if (typeof Module['preRun'] == 'function') Module['preRun'] = [Module['preRun']]; - while (Module['preRun'].length) { - addOnPreRun(Module['preRun'].shift()); - } - } - consumedModuleProp('preRun'); - // Begin ATPRERUNS hooks - callRuntimeCallbacks(onPreRuns); - // End ATPRERUNS hooks -} - -function initRuntime() { - assert(!runtimeInitialized); - runtimeInitialized = true; - - checkStackCookie(); - - // Begin ATINITS hooks - if (!Module['noFSInit'] && !FS.initialized) FS.init(); -TTY.init(); - // End ATINITS hooks - - wasmExports['__wasm_call_ctors'](); - - // Begin ATPOSTCTORS hooks - FS.ignorePermissions = false; - // End ATPOSTCTORS hooks -} - -function exitRuntime() { - assert(!runtimeExited); - checkStackCookie(); - // PThreads reuse the runtime from the main thread. - ___funcs_on_exit(); // Native atexit() functions - // Begin ATEXITS hooks - FS.quit(); -TTY.shutdown(); - // End ATEXITS hooks - runtimeExited = true; -} - -function postRun() { - checkStackCookie(); - // PThreads reuse the runtime from the main thread. - - if (Module['postRun']) { - if (typeof Module['postRun'] == 'function') Module['postRun'] = [Module['postRun']]; - while (Module['postRun'].length) { - addOnPostRun(Module['postRun'].shift()); - } - } - consumedModuleProp('postRun'); - - // Begin ATPOSTRUNS hooks - callRuntimeCallbacks(onPostRuns); - // End ATPOSTRUNS hooks -} - -/** @param {string|number=} what */ -function abort(what) { - Module['onAbort']?.(what); - - what = 'Aborted(' + what + ')'; - // TODO(sbc): Should we remove printing and leave it up to whoever - // catches the exception? - err(what); - - ABORT = true; - - // Use a wasm runtime error, because a JS error might be seen as a foreign - // exception, which means we'd run destructors on it. We need the error to - // simply make the program stop. - // FIXME This approach does not work in Wasm EH because it currently does not assume - // all RuntimeErrors are from traps; it decides whether a RuntimeError is from - // a trap or not based on a hidden field within the object. So at the moment - // we don't have a way of throwing a wasm trap from JS. TODO Make a JS API that - // allows this in the wasm spec. - - // Suppress closure compiler warning here. Closure compiler's builtin extern - // definition for WebAssembly.RuntimeError claims it takes no arguments even - // though it can. - // TODO(https://github.com/google/closure-compiler/pull/3913): Remove if/when upstream closure gets fixed. - /** @suppress {checkTypes} */ - var e = new WebAssembly.RuntimeError(what); - - readyPromiseReject?.(e); - // Throw the error whether or not MODULARIZE is set because abort is used - // in code paths apart from instantiation where an exception is expected - // to be thrown when abort is called. - throw e; -} - -function createExportWrapper(name, nargs) { - return (...args) => { - assert(runtimeInitialized, `native function \`${name}\` called before runtime initialization`); - assert(!runtimeExited, `native function \`${name}\` called after runtime exit (use NO_EXIT_RUNTIME to keep it alive after main() exits)`); - var f = wasmExports[name]; - assert(f, `exported native function \`${name}\` not found`); - // Only assert for too many arguments. Too few can be valid since the missing arguments will be zero filled. - assert(args.length <= nargs, `native function \`${name}\` called with ${args.length} args but expects ${nargs}`); - return f(...args); - }; -} - -var wasmBinaryFile; - -function findWasmBinary() { - - if (Module['locateFile']) { - return locateFile('emscripten-module.wasm'); - } - - // Use bundler-friendly `new URL(..., import.meta.url)` pattern; works in browsers too. - return new URL('emscripten-module.wasm', import.meta.url).href; - -} - -function getBinarySync(file) { - if (file == wasmBinaryFile && wasmBinary) { - return new Uint8Array(wasmBinary); - } - if (readBinary) { - return readBinary(file); - } - // Throwing a plain string here, even though it not normally advisable since - // this gets turning into an `abort` in instantiateArrayBuffer. - throw 'both async and sync fetching of the wasm failed'; -} - -async function getWasmBinary(binaryFile) { - // If we don't have the binary yet, load it asynchronously using readAsync. - if (!wasmBinary) { - // Fetch the binary using readAsync - try { - var response = await readAsync(binaryFile); - return new Uint8Array(response); - } catch { - // Fall back to getBinarySync below; - } - } - - // Otherwise, getBinarySync should be able to get it synchronously - return getBinarySync(binaryFile); -} - -async function instantiateArrayBuffer(binaryFile, imports) { - try { - var binary = await getWasmBinary(binaryFile); - var instance = await WebAssembly.instantiate(binary, imports); - return instance; - } catch (reason) { - err(`failed to asynchronously prepare wasm: ${reason}`); - - // Warn on some common problems. - if (isFileURI(binaryFile)) { - err(`warning: Loading from a file URI (${binaryFile}) is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing`); - } - abort(reason); - } -} - -async function instantiateAsync(binary, binaryFile, imports) { - if (!binary - // Don't use streaming for file:// delivered objects in a webview, fetch them synchronously. - && !isFileURI(binaryFile) - // Avoid instantiateStreaming() on Node.js environment for now, as while - // Node.js v18.1.0 implements it, it does not have a full fetch() - // implementation yet. - // - // Reference: - // https://github.com/emscripten-core/emscripten/pull/16917 - && !ENVIRONMENT_IS_NODE - ) { - try { - var response = fetch(binaryFile, { credentials: 'same-origin' }); - var instantiationResult = await WebAssembly.instantiateStreaming(response, imports); - return instantiationResult; - } catch (reason) { - // We expect the most common failure cause to be a bad MIME type for the binary, - // in which case falling back to ArrayBuffer instantiation should work. - err(`wasm streaming compile failed: ${reason}`); - err('falling back to ArrayBuffer instantiation'); - // fall back of instantiateArrayBuffer below - }; - } - return instantiateArrayBuffer(binaryFile, imports); -} - -function getWasmImports() { - // prepare imports - var imports = { - 'env': wasmImports, - 'wasi_snapshot_preview1': wasmImports, - }; - return imports; -} - -// Create the wasm instance. -// Receives the wasm imports, returns the exports. -async function createWasm() { - // Load the wasm module and create an instance of using native support in the JS engine. - // handle a generated wasm instance, receiving its exports and - // performing other necessary setup - /** @param {WebAssembly.Module=} module*/ - function receiveInstance(instance, module) { - wasmExports = instance.exports; - - assignWasmExports(wasmExports); - - return wasmExports; - } - - // Prefer streaming instantiation if available. - // Async compilation can be confusing when an error on the page overwrites Module - // (for example, if the order of elements is wrong, and the one defining Module is - // later), so we save Module and check it later. - var trueModule = Module; - function receiveInstantiationResult(result) { - // 'result' is a ResultObject object which has both the module and instance. - // receiveInstance() will swap in the exports (to Module.asm) so they can be called - assert(Module === trueModule, 'the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?'); - trueModule = null; - // TODO: Due to Closure regression https://github.com/google/closure-compiler/issues/3193, the above line no longer optimizes out down to the following line. - // When the regression is fixed, can restore the above PTHREADS-enabled path. - return receiveInstance(result['instance']); - } - - var info = getWasmImports(); - - // User shell pages can write their own Module.instantiateWasm = function(imports, successCallback) callback - // to manually instantiate the Wasm module themselves. This allows pages to - // run the instantiation parallel to any other async startup actions they are - // performing. - // Also pthreads and wasm workers initialize the wasm instance through this - // path. - if (Module['instantiateWasm']) { - return new Promise((resolve, reject) => { - try { - Module['instantiateWasm'](info, (inst, mod) => { - resolve(receiveInstance(inst, mod)); - }); - } catch(e) { - err(`Module.instantiateWasm callback failed with error: ${e}`); - reject(e); - } - }); - } - - wasmBinaryFile ??= findWasmBinary(); - var result = await instantiateAsync(wasmBinary, wasmBinaryFile, info); - var exports = receiveInstantiationResult(result); - return exports; -} - -// end include: preamble.js - -// Begin JS library code - - - class ExitStatus { - name = 'ExitStatus'; - constructor(status) { - this.message = `Program terminated with exit(${status})`; - this.status = status; - } - } - - var callRuntimeCallbacks = (callbacks) => { - while (callbacks.length > 0) { - // Pass the module as the first argument. - callbacks.shift()(Module); - } - }; - var onPostRuns = []; - var addOnPostRun = (cb) => onPostRuns.push(cb); - - var onPreRuns = []; - var addOnPreRun = (cb) => onPreRuns.push(cb); - - - - /** - * @param {number} ptr - * @param {string} type - */ - function getValue(ptr, type = 'i8') { - if (type.endsWith('*')) type = '*'; - switch (type) { - case 'i1': return HEAP8[ptr]; - case 'i8': return HEAP8[ptr]; - case 'i16': return HEAP16[((ptr)>>1)]; - case 'i32': return HEAP32[((ptr)>>2)]; - case 'i64': return HEAP64[((ptr)>>3)]; - case 'float': return HEAPF32[((ptr)>>2)]; - case 'double': return HEAPF64[((ptr)>>3)]; - case '*': return HEAPU32[((ptr)>>2)]; - default: abort(`invalid type for getValue: ${type}`); - } - } - - var noExitRuntime = false; - - var ptrToString = (ptr) => { - assert(typeof ptr === 'number', `ptrToString expects a number, got ${typeof ptr}`); - // Convert to 32-bit unsigned value - ptr >>>= 0; - return '0x' + ptr.toString(16).padStart(8, '0'); - }; - - - /** - * @param {number} ptr - * @param {number} value - * @param {string} type - */ - function setValue(ptr, value, type = 'i8') { - if (type.endsWith('*')) type = '*'; - switch (type) { - case 'i1': HEAP8[ptr] = value; break; - case 'i8': HEAP8[ptr] = value; break; - case 'i16': HEAP16[((ptr)>>1)] = value; break; - case 'i32': HEAP32[((ptr)>>2)] = value; break; - case 'i64': HEAP64[((ptr)>>3)] = BigInt(value); break; - case 'float': HEAPF32[((ptr)>>2)] = value; break; - case 'double': HEAPF64[((ptr)>>3)] = value; break; - case '*': HEAPU32[((ptr)>>2)] = value; break; - default: abort(`invalid type for setValue: ${type}`); - } - } - - var stackRestore = (val) => __emscripten_stack_restore(val); - - var stackSave = () => _emscripten_stack_get_current(); - - var warnOnce = (text) => { - warnOnce.shown ||= {}; - if (!warnOnce.shown[text]) { - warnOnce.shown[text] = 1; - if (ENVIRONMENT_IS_NODE) text = 'warning: ' + text; - err(text); - } - }; - - var wasmMemory; - - var UTF8Decoder = globalThis.TextDecoder && new TextDecoder(); - - var findStringEnd = (heapOrArray, idx, maxBytesToRead, ignoreNul) => { - var maxIdx = idx + maxBytesToRead; - if (ignoreNul) return maxIdx; - // TextDecoder needs to know the byte length in advance, it doesn't stop on - // null terminator by itself. - // As a tiny code save trick, compare idx against maxIdx using a negation, - // so that maxBytesToRead=undefined/NaN means Infinity. - while (heapOrArray[idx] && !(idx >= maxIdx)) ++idx; - return idx; - }; - - - /** - * Given a pointer 'idx' to a null-terminated UTF8-encoded string in the given - * array that contains uint8 values, returns a copy of that string as a - * Javascript String object. - * heapOrArray is either a regular array, or a JavaScript typed array view. - * @param {number=} idx - * @param {number=} maxBytesToRead - * @param {boolean=} ignoreNul - If true, the function will not stop on a NUL character. - * @return {string} - */ - var UTF8ArrayToString = (heapOrArray, idx = 0, maxBytesToRead, ignoreNul) => { - - var endPtr = findStringEnd(heapOrArray, idx, maxBytesToRead, ignoreNul); - - // When using conditional TextDecoder, skip it for short strings as the overhead of the native call is not worth it. - if (endPtr - idx > 16 && heapOrArray.buffer && UTF8Decoder) { - return UTF8Decoder.decode(heapOrArray.subarray(idx, endPtr)); - } - var str = ''; - while (idx < endPtr) { - // For UTF8 byte structure, see: - // http://en.wikipedia.org/wiki/UTF-8#Description - // https://www.ietf.org/rfc/rfc2279.txt - // https://tools.ietf.org/html/rfc3629 - var u0 = heapOrArray[idx++]; - if (!(u0 & 0x80)) { str += String.fromCharCode(u0); continue; } - var u1 = heapOrArray[idx++] & 63; - if ((u0 & 0xE0) == 0xC0) { str += String.fromCharCode(((u0 & 31) << 6) | u1); continue; } - var u2 = heapOrArray[idx++] & 63; - if ((u0 & 0xF0) == 0xE0) { - u0 = ((u0 & 15) << 12) | (u1 << 6) | u2; - } else { - if ((u0 & 0xF8) != 0xF0) warnOnce('Invalid UTF-8 leading byte ' + ptrToString(u0) + ' encountered when deserializing a UTF-8 string in wasm memory to a JS string!'); - u0 = ((u0 & 7) << 18) | (u1 << 12) | (u2 << 6) | (heapOrArray[idx++] & 63); - } - - if (u0 < 0x10000) { - str += String.fromCharCode(u0); - } else { - var ch = u0 - 0x10000; - str += String.fromCharCode(0xD800 | (ch >> 10), 0xDC00 | (ch & 0x3FF)); - } - } - return str; - }; - - /** - * Given a pointer 'ptr' to a null-terminated UTF8-encoded string in the - * emscripten HEAP, returns a copy of that string as a Javascript String object. - * - * @param {number} ptr - * @param {number=} maxBytesToRead - An optional length that specifies the - * maximum number of bytes to read. You can omit this parameter to scan the - * string until the first 0 byte. If maxBytesToRead is passed, and the string - * at [ptr, ptr+maxBytesToReadr[ contains a null byte in the middle, then the - * string will cut short at that byte index. - * @param {boolean=} ignoreNul - If true, the function will not stop on a NUL character. - * @return {string} - */ - var UTF8ToString = (ptr, maxBytesToRead, ignoreNul) => { - assert(typeof ptr == 'number', `UTF8ToString expects a number (got ${typeof ptr})`); - return ptr ? UTF8ArrayToString(HEAPU8, ptr, maxBytesToRead, ignoreNul) : ''; - }; - var ___assert_fail = (condition, filename, line, func) => - abort(`Assertion failed: ${UTF8ToString(condition)}, at: ` + [filename ? UTF8ToString(filename) : 'unknown filename', line, func ? UTF8ToString(func) : 'unknown function']); - - var PATH = { - isAbs:(path) => path.charAt(0) === '/', - splitPath:(filename) => { - var splitPathRe = /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; - return splitPathRe.exec(filename).slice(1); - }, - normalizeArray:(parts, allowAboveRoot) => { - // if the path tries to go above the root, `up` ends up > 0 - var up = 0; - for (var i = parts.length - 1; i >= 0; i--) { - var last = parts[i]; - if (last === '.') { - parts.splice(i, 1); - } else if (last === '..') { - parts.splice(i, 1); - up++; - } else if (up) { - parts.splice(i, 1); - up--; - } - } - // if the path is allowed to go above the root, restore leading ..s - if (allowAboveRoot) { - for (; up; up--) { - parts.unshift('..'); - } - } - return parts; - }, - normalize:(path) => { - var isAbsolute = PATH.isAbs(path), - trailingSlash = path.slice(-1) === '/'; - // Normalize the path - path = PATH.normalizeArray(path.split('/').filter((p) => !!p), !isAbsolute).join('/'); - if (!path && !isAbsolute) { - path = '.'; - } - if (path && trailingSlash) { - path += '/'; - } - return (isAbsolute ? '/' : '') + path; - }, - dirname:(path) => { - var result = PATH.splitPath(path), - root = result[0], - dir = result[1]; - if (!root && !dir) { - // No dirname whatsoever - return '.'; - } - if (dir) { - // It has a dirname, strip trailing slash - dir = dir.slice(0, -1); - } - return root + dir; - }, - basename:(path) => path && path.match(/([^\/]+|\/)\/*$/)[1], -join:(...paths) => PATH.normalize(paths.join('/')), -join2:(l, r) => PATH.normalize(l + '/' + r), -}; - -var initRandomFill = () => { - // This block is not needed on v19+ since crypto.getRandomValues is builtin - if (ENVIRONMENT_IS_NODE) { - var nodeCrypto = require('node:crypto'); - return (view) => nodeCrypto.randomFillSync(view); - } - - return (view) => crypto.getRandomValues(view); - }; -var randomFill = (view) => { - // Lazily init on the first invocation. - (randomFill = initRandomFill())(view); - }; - - - -var PATH_FS = { -resolve:(...args) => { - var resolvedPath = '', - resolvedAbsolute = false; - for (var i = args.length - 1; i >= -1 && !resolvedAbsolute; i--) { - var path = (i >= 0) ? args[i] : FS.cwd(); - // Skip empty and invalid entries - if (typeof path != 'string') { - throw new TypeError('Arguments to path.resolve must be strings'); - } else if (!path) { - return ''; // an invalid portion invalidates the whole thing - } - resolvedPath = path + '/' + resolvedPath; - resolvedAbsolute = PATH.isAbs(path); - } - // At this point the path should be resolved to a full absolute path, but - // handle relative paths to be safe (might happen when process.cwd() fails) - resolvedPath = PATH.normalizeArray(resolvedPath.split('/').filter((p) => !!p), !resolvedAbsolute).join('/'); - return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.'; - }, -relative:(from, to) => { - from = PATH_FS.resolve(from).slice(1); - to = PATH_FS.resolve(to).slice(1); - function trim(arr) { - var start = 0; - for (; start < arr.length; start++) { - if (arr[start] !== '') break; - } - var end = arr.length - 1; - for (; end >= 0; end--) { - if (arr[end] !== '') break; - } - if (start > end) return []; - return arr.slice(start, end - start + 1); - } - var fromParts = trim(from.split('/')); - var toParts = trim(to.split('/')); - var length = Math.min(fromParts.length, toParts.length); - var samePartsLength = length; - for (var i = 0; i < length; i++) { - if (fromParts[i] !== toParts[i]) { - samePartsLength = i; - break; - } - } - var outputParts = []; - for (var i = samePartsLength; i < fromParts.length; i++) { - outputParts.push('..'); - } - outputParts = outputParts.concat(toParts.slice(samePartsLength)); - return outputParts.join('/'); - }, -}; - - - -var FS_stdin_getChar_buffer = []; - -var lengthBytesUTF8 = (str) => { - var len = 0; - for (var i = 0; i < str.length; ++i) { - // Gotcha: charCodeAt returns a 16-bit word that is a UTF-16 encoded code - // unit, not a Unicode code point of the character! So decode - // UTF16->UTF32->UTF8. - // See http://unicode.org/faq/utf_bom.html#utf16-3 - var c = str.charCodeAt(i); // possibly a lead surrogate - if (c <= 0x7F) { - len++; - } else if (c <= 0x7FF) { - len += 2; - } else if (c >= 0xD800 && c <= 0xDFFF) { - len += 4; ++i; - } else { - len += 3; - } - } - return len; - }; - -var stringToUTF8Array = (str, heap, outIdx, maxBytesToWrite) => { - assert(typeof str === 'string', `stringToUTF8Array expects a string (got ${typeof str})`); - // Parameter maxBytesToWrite is not optional. Negative values, 0, null, - // undefined and false each don't write out any bytes. - if (!(maxBytesToWrite > 0)) - return 0; - - var startIdx = outIdx; - var endIdx = outIdx + maxBytesToWrite - 1; // -1 for string null terminator. - for (var i = 0; i < str.length; ++i) { - // For UTF8 byte structure, see http://en.wikipedia.org/wiki/UTF-8#Description - // and https://www.ietf.org/rfc/rfc2279.txt - // and https://tools.ietf.org/html/rfc3629 - var u = str.codePointAt(i); - if (u <= 0x7F) { - if (outIdx >= endIdx) break; - heap[outIdx++] = u; - } else if (u <= 0x7FF) { - if (outIdx + 1 >= endIdx) break; - heap[outIdx++] = 0xC0 | (u >> 6); - heap[outIdx++] = 0x80 | (u & 63); - } else if (u <= 0xFFFF) { - if (outIdx + 2 >= endIdx) break; - heap[outIdx++] = 0xE0 | (u >> 12); - heap[outIdx++] = 0x80 | ((u >> 6) & 63); - heap[outIdx++] = 0x80 | (u & 63); - } else { - if (outIdx + 3 >= endIdx) break; - if (u > 0x10FFFF) warnOnce('Invalid Unicode code point ' + ptrToString(u) + ' encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF).'); - heap[outIdx++] = 0xF0 | (u >> 18); - heap[outIdx++] = 0x80 | ((u >> 12) & 63); - heap[outIdx++] = 0x80 | ((u >> 6) & 63); - heap[outIdx++] = 0x80 | (u & 63); - // Gotcha: if codePoint is over 0xFFFF, it is represented as a surrogate pair in UTF-16. - // We need to manually skip over the second code unit for correct iteration. - i++; - } - } - // Null-terminate the pointer to the buffer. - heap[outIdx] = 0; - return outIdx - startIdx; - }; -/** @type {function(string, boolean=, number=)} */ - var intArrayFromString = (stringy, dontAddNull, length) => { - var len = length > 0 ? length : lengthBytesUTF8(stringy)+1; - var u8array = new Array(len); - var numBytesWritten = stringToUTF8Array(stringy, u8array, 0, u8array.length); - if (dontAddNull) u8array.length = numBytesWritten; - return u8array; - }; - var FS_stdin_getChar = () => { - if (!FS_stdin_getChar_buffer.length) { - var result = null; - if (ENVIRONMENT_IS_NODE) { - // we will read data by chunks of BUFSIZE - var BUFSIZE = 256; - var buf = Buffer.alloc(BUFSIZE); - var bytesRead = 0; - - // For some reason we must suppress a closure warning here, even though - // fd definitely exists on process.stdin, and is even the proper way to - // get the fd of stdin, - // https://github.com/nodejs/help/issues/2136#issuecomment-523649904 - // This started to happen after moving this logic out of library_tty.js, - // so it is related to the surrounding code in some unclear manner. - /** @suppress {missingProperties} */ - var fd = process.stdin.fd; - - try { - bytesRead = fs.readSync(fd, buf, 0, BUFSIZE); - } catch(e) { - // Cross-platform differences: on Windows, reading EOF throws an - // exception, but on other OSes, reading EOF returns 0. Uniformize - // behavior by treating the EOF exception to return 0. - if (e.toString().includes('EOF')) bytesRead = 0; - else throw e; - } - - if (bytesRead > 0) { - result = buf.slice(0, bytesRead).toString('utf-8'); - } - } else - if (globalThis.window?.prompt) { - // Browser. - result = window.prompt('Input: '); // returns null on cancel - if (result !== null) { - result += '\n'; - } - } else - {} - if (!result) { - return null; - } - FS_stdin_getChar_buffer = intArrayFromString(result, true); - } - return FS_stdin_getChar_buffer.shift(); - }; - var TTY = { - ttys:[], - init() { - // https://github.com/emscripten-core/emscripten/pull/1555 - // if (ENVIRONMENT_IS_NODE) { - // // currently, FS.init does not distinguish if process.stdin is a file or TTY - // // device, it always assumes it's a TTY device. because of this, we're forcing - // // process.stdin to UTF8 encoding to at least make stdin reading compatible - // // with text files until FS.init can be refactored. - // process.stdin.setEncoding('utf8'); - // } - }, - shutdown() { - // https://github.com/emscripten-core/emscripten/pull/1555 - // if (ENVIRONMENT_IS_NODE) { - // // inolen: any idea as to why node -e 'process.stdin.read()' wouldn't exit immediately (with process.stdin being a tty)? - // // isaacs: because now it's reading from the stream, you've expressed interest in it, so that read() kicks off a _read() which creates a ReadReq operation - // // inolen: I thought read() in that case was a synchronous operation that just grabbed some amount of buffered data if it exists? - // // isaacs: it is. but it also triggers a _read() call, which calls readStart() on the handle - // // isaacs: do process.stdin.pause() and i'd think it'd probably close the pending call - // process.stdin.pause(); - // } - }, - register(dev, ops) { - TTY.ttys[dev] = { input: [], output: [], ops: ops }; - FS.registerDevice(dev, TTY.stream_ops); - }, - stream_ops:{ - open(stream) { - var tty = TTY.ttys[stream.node.rdev]; - if (!tty) { - throw new FS.ErrnoError(43); - } - stream.tty = tty; - stream.seekable = false; - }, - close(stream) { - // flush any pending line data - stream.tty.ops.fsync(stream.tty); - }, - fsync(stream) { - stream.tty.ops.fsync(stream.tty); - }, - read(stream, buffer, offset, length, pos /* ignored */) { - if (!stream.tty || !stream.tty.ops.get_char) { - throw new FS.ErrnoError(60); - } - var bytesRead = 0; - for (var i = 0; i < length; i++) { - var result; - try { - result = stream.tty.ops.get_char(stream.tty); - } catch (e) { - throw new FS.ErrnoError(29); - } - if (result === undefined && bytesRead === 0) { - throw new FS.ErrnoError(6); - } - if (result === null || result === undefined) break; - bytesRead++; - buffer[offset+i] = result; - } - if (bytesRead) { - stream.node.atime = Date.now(); - } - return bytesRead; - }, - write(stream, buffer, offset, length, pos) { - if (!stream.tty || !stream.tty.ops.put_char) { - throw new FS.ErrnoError(60); - } - try { - for (var i = 0; i < length; i++) { - stream.tty.ops.put_char(stream.tty, buffer[offset+i]); - } - } catch (e) { - throw new FS.ErrnoError(29); - } - if (length) { - stream.node.mtime = stream.node.ctime = Date.now(); - } - return i; - }, - }, - default_tty_ops:{ - get_char(tty) { - return FS_stdin_getChar(); - }, - put_char(tty, val) { - if (val === null || val === 10) { - out(UTF8ArrayToString(tty.output)); - tty.output = []; - } else { - if (val != 0) tty.output.push(val); // val == 0 would cut text output off in the middle. - } - }, - fsync(tty) { - if (tty.output?.length > 0) { - out(UTF8ArrayToString(tty.output)); - tty.output = []; - } - }, - ioctl_tcgets(tty) { - // typical setting - return { - c_iflag: 25856, - c_oflag: 5, - c_cflag: 191, - c_lflag: 35387, - c_cc: [ - 0x03, 0x1c, 0x7f, 0x15, 0x04, 0x00, 0x01, 0x00, 0x11, 0x13, 0x1a, 0x00, - 0x12, 0x0f, 0x17, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - ] - }; - }, - ioctl_tcsets(tty, optional_actions, data) { - // currently just ignore - return 0; - }, - ioctl_tiocgwinsz(tty) { - return [24, 80]; - }, - }, - default_tty1_ops:{ - put_char(tty, val) { - if (val === null || val === 10) { - err(UTF8ArrayToString(tty.output)); - tty.output = []; - } else { - if (val != 0) tty.output.push(val); - } - }, - fsync(tty) { - if (tty.output?.length > 0) { - err(UTF8ArrayToString(tty.output)); - tty.output = []; - } - }, - }, - }; - - - var zeroMemory = (ptr, size) => HEAPU8.fill(0, ptr, ptr + size); - - var alignMemory = (size, alignment) => { - assert(alignment, "alignment argument is required"); - return Math.ceil(size / alignment) * alignment; - }; - var mmapAlloc = (size) => { - size = alignMemory(size, 65536); - var ptr = _emscripten_builtin_memalign(65536, size); - if (ptr) zeroMemory(ptr, size); - return ptr; - }; - var MEMFS = { - ops_table:null, - mount(mount) { - return MEMFS.createNode(null, '/', 16895, 0); - }, - createNode(parent, name, mode, dev) { - if (FS.isBlkdev(mode) || FS.isFIFO(mode)) { - // not supported - throw new FS.ErrnoError(63); - } - MEMFS.ops_table ||= { - dir: { - node: { - getattr: MEMFS.node_ops.getattr, - setattr: MEMFS.node_ops.setattr, - lookup: MEMFS.node_ops.lookup, - mknod: MEMFS.node_ops.mknod, - rename: MEMFS.node_ops.rename, - unlink: MEMFS.node_ops.unlink, - rmdir: MEMFS.node_ops.rmdir, - readdir: MEMFS.node_ops.readdir, - symlink: MEMFS.node_ops.symlink - }, - stream: { - llseek: MEMFS.stream_ops.llseek - } - }, - file: { - node: { - getattr: MEMFS.node_ops.getattr, - setattr: MEMFS.node_ops.setattr - }, - stream: { - llseek: MEMFS.stream_ops.llseek, - read: MEMFS.stream_ops.read, - write: MEMFS.stream_ops.write, - mmap: MEMFS.stream_ops.mmap, - msync: MEMFS.stream_ops.msync - } - }, - link: { - node: { - getattr: MEMFS.node_ops.getattr, - setattr: MEMFS.node_ops.setattr, - readlink: MEMFS.node_ops.readlink - }, - stream: {} - }, - chrdev: { - node: { - getattr: MEMFS.node_ops.getattr, - setattr: MEMFS.node_ops.setattr - }, - stream: FS.chrdev_stream_ops - } - }; - var node = FS.createNode(parent, name, mode, dev); - if (FS.isDir(node.mode)) { - node.node_ops = MEMFS.ops_table.dir.node; - node.stream_ops = MEMFS.ops_table.dir.stream; - node.contents = {}; - } else if (FS.isFile(node.mode)) { - node.node_ops = MEMFS.ops_table.file.node; - node.stream_ops = MEMFS.ops_table.file.stream; - node.usedBytes = 0; // The actual number of bytes used in the typed array, as opposed to contents.length which gives the whole capacity. - // When the byte data of the file is populated, this will point to either a typed array, or a normal JS array. Typed arrays are preferred - // for performance, and used by default. However, typed arrays are not resizable like normal JS arrays are, so there is a small disk size - // penalty involved for appending file writes that continuously grow a file similar to std::vector capacity vs used -scheme. - node.contents = null; - } else if (FS.isLink(node.mode)) { - node.node_ops = MEMFS.ops_table.link.node; - node.stream_ops = MEMFS.ops_table.link.stream; - } else if (FS.isChrdev(node.mode)) { - node.node_ops = MEMFS.ops_table.chrdev.node; - node.stream_ops = MEMFS.ops_table.chrdev.stream; - } - node.atime = node.mtime = node.ctime = Date.now(); - // add the new node to the parent - if (parent) { - parent.contents[name] = node; - parent.atime = parent.mtime = parent.ctime = node.atime; - } - return node; - }, - getFileDataAsTypedArray(node) { - if (!node.contents) return new Uint8Array(0); - if (node.contents.subarray) return node.contents.subarray(0, node.usedBytes); // Make sure to not return excess unused bytes. - return new Uint8Array(node.contents); - }, - expandFileStorage(node, newCapacity) { - var prevCapacity = node.contents ? node.contents.length : 0; - if (prevCapacity >= newCapacity) return; // No need to expand, the storage was already large enough. - // Don't expand strictly to the given requested limit if it's only a very small increase, but instead geometrically grow capacity. - // For small filesizes (<1MB), perform size*2 geometric increase, but for large sizes, do a much more conservative size*1.125 increase to - // avoid overshooting the allocation cap by a very large margin. - var CAPACITY_DOUBLING_MAX = 1024 * 1024; - newCapacity = Math.max(newCapacity, (prevCapacity * (prevCapacity < CAPACITY_DOUBLING_MAX ? 2.0 : 1.125)) >>> 0); - if (prevCapacity != 0) newCapacity = Math.max(newCapacity, 256); // At minimum allocate 256b for each file when expanding. - var oldContents = node.contents; - node.contents = new Uint8Array(newCapacity); // Allocate new storage. - if (node.usedBytes > 0) node.contents.set(oldContents.subarray(0, node.usedBytes), 0); // Copy old data over to the new storage. - }, - resizeFileStorage(node, newSize) { - if (node.usedBytes == newSize) return; - if (newSize == 0) { - node.contents = null; // Fully decommit when requesting a resize to zero. - node.usedBytes = 0; - } else { - var oldContents = node.contents; - node.contents = new Uint8Array(newSize); // Allocate new storage. - if (oldContents) { - node.contents.set(oldContents.subarray(0, Math.min(newSize, node.usedBytes))); // Copy old data over to the new storage. - } - node.usedBytes = newSize; - } - }, - node_ops:{ - getattr(node) { - var attr = {}; - // device numbers reuse inode numbers. - attr.dev = FS.isChrdev(node.mode) ? node.id : 1; - attr.ino = node.id; - attr.mode = node.mode; - attr.nlink = 1; - attr.uid = 0; - attr.gid = 0; - attr.rdev = node.rdev; - if (FS.isDir(node.mode)) { - attr.size = 4096; - } else if (FS.isFile(node.mode)) { - attr.size = node.usedBytes; - } else if (FS.isLink(node.mode)) { - attr.size = node.link.length; - } else { - attr.size = 0; - } - attr.atime = new Date(node.atime); - attr.mtime = new Date(node.mtime); - attr.ctime = new Date(node.ctime); - // NOTE: In our implementation, st_blocks = Math.ceil(st_size/st_blksize), - // but this is not required by the standard. - attr.blksize = 4096; - attr.blocks = Math.ceil(attr.size / attr.blksize); - return attr; - }, - setattr(node, attr) { - for (const key of ["mode", "atime", "mtime", "ctime"]) { - if (attr[key] != null) { - node[key] = attr[key]; - } - } - if (attr.size !== undefined) { - MEMFS.resizeFileStorage(node, attr.size); - } - }, - lookup(parent, name) { - throw new FS.ErrnoError(44); - }, - mknod(parent, name, mode, dev) { - return MEMFS.createNode(parent, name, mode, dev); - }, - rename(old_node, new_dir, new_name) { - var new_node; - try { - new_node = FS.lookupNode(new_dir, new_name); - } catch (e) {} - if (new_node) { - if (FS.isDir(old_node.mode)) { - // if we're overwriting a directory at new_name, make sure it's empty. - for (var i in new_node.contents) { - throw new FS.ErrnoError(55); - } - } - FS.hashRemoveNode(new_node); - } - // do the internal rewiring - delete old_node.parent.contents[old_node.name]; - new_dir.contents[new_name] = old_node; - old_node.name = new_name; - new_dir.ctime = new_dir.mtime = old_node.parent.ctime = old_node.parent.mtime = Date.now(); - }, - unlink(parent, name) { - delete parent.contents[name]; - parent.ctime = parent.mtime = Date.now(); - }, - rmdir(parent, name) { - var node = FS.lookupNode(parent, name); - for (var i in node.contents) { - throw new FS.ErrnoError(55); - } - delete parent.contents[name]; - parent.ctime = parent.mtime = Date.now(); - }, - readdir(node) { - return ['.', '..', ...Object.keys(node.contents)]; - }, - symlink(parent, newname, oldpath) { - var node = MEMFS.createNode(parent, newname, 0o777 | 40960, 0); - node.link = oldpath; - return node; - }, - readlink(node) { - if (!FS.isLink(node.mode)) { - throw new FS.ErrnoError(28); - } - return node.link; - }, - }, - stream_ops:{ - read(stream, buffer, offset, length, position) { - var contents = stream.node.contents; - if (position >= stream.node.usedBytes) return 0; - var size = Math.min(stream.node.usedBytes - position, length); - assert(size >= 0); - if (size > 8 && contents.subarray) { // non-trivial, and typed array - buffer.set(contents.subarray(position, position + size), offset); - } else { - for (var i = 0; i < size; i++) buffer[offset + i] = contents[position + i]; - } - return size; - }, - write(stream, buffer, offset, length, position, canOwn) { - // The data buffer should be a typed array view - assert(!(buffer instanceof ArrayBuffer)); - // If the buffer is located in main memory (HEAP), and if - // memory can grow, we can't hold on to references of the - // memory buffer, as they may get invalidated. That means we - // need to copy its contents. - if (buffer.buffer === HEAP8.buffer) { - canOwn = false; - } - - if (!length) return 0; - var node = stream.node; - node.mtime = node.ctime = Date.now(); - - if (buffer.subarray && (!node.contents || node.contents.subarray)) { // This write is from a typed array to a typed array? - if (canOwn) { - assert(position === 0, 'canOwn must imply no weird position inside the file'); - node.contents = buffer.subarray(offset, offset + length); - node.usedBytes = length; - return length; - } else if (node.usedBytes === 0 && position === 0) { // If this is a simple first write to an empty file, do a fast set since we don't need to care about old data. - node.contents = buffer.slice(offset, offset + length); - node.usedBytes = length; - return length; - } else if (position + length <= node.usedBytes) { // Writing to an already allocated and used subrange of the file? - node.contents.set(buffer.subarray(offset, offset + length), position); - return length; - } - } - - // Appending to an existing file and we need to reallocate, or source data did not come as a typed array. - MEMFS.expandFileStorage(node, position+length); - if (node.contents.subarray && buffer.subarray) { - // Use typed array write which is available. - node.contents.set(buffer.subarray(offset, offset + length), position); - } else { - for (var i = 0; i < length; i++) { - node.contents[position + i] = buffer[offset + i]; // Or fall back to manual write if not. - } - } - node.usedBytes = Math.max(node.usedBytes, position + length); - return length; - }, - llseek(stream, offset, whence) { - var position = offset; - if (whence === 1) { - position += stream.position; - } else if (whence === 2) { - if (FS.isFile(stream.node.mode)) { - position += stream.node.usedBytes; - } - } - if (position < 0) { - throw new FS.ErrnoError(28); - } - return position; - }, - mmap(stream, length, position, prot, flags) { - if (!FS.isFile(stream.node.mode)) { - throw new FS.ErrnoError(43); - } - var ptr; - var allocated; - var contents = stream.node.contents; - // Only make a new copy when MAP_PRIVATE is specified. - if (!(flags & 2) && contents && contents.buffer === HEAP8.buffer) { - // We can't emulate MAP_SHARED when the file is not backed by the - // buffer we're mapping to (e.g. the HEAP buffer). - allocated = false; - ptr = contents.byteOffset; - } else { - allocated = true; - ptr = mmapAlloc(length); - if (!ptr) { - throw new FS.ErrnoError(48); - } - if (contents) { - // Try to avoid unnecessary slices. - if (position > 0 || position + length < contents.length) { - if (contents.subarray) { - contents = contents.subarray(position, position + length); - } else { - contents = Array.prototype.slice.call(contents, position, position + length); - } - } - HEAP8.set(contents, ptr); - } - } - return { ptr, allocated }; - }, - msync(stream, buffer, offset, length, mmapFlags) { - MEMFS.stream_ops.write(stream, buffer, 0, length, offset, false); - // should we check if bytesWritten and length are the same? - return 0; - }, - }, - }; - - var FS_modeStringToFlags = (str) => { - var flagModes = { - 'r': 0, - 'r+': 2, - 'w': 512 | 64 | 1, - 'w+': 512 | 64 | 2, - 'a': 1024 | 64 | 1, - 'a+': 1024 | 64 | 2, - }; - var flags = flagModes[str]; - if (typeof flags == 'undefined') { - throw new Error(`Unknown file open mode: ${str}`); - } - return flags; - }; - - var FS_getMode = (canRead, canWrite) => { - var mode = 0; - if (canRead) mode |= 292 | 73; - if (canWrite) mode |= 146; - return mode; - }; - - - - - var strError = (errno) => UTF8ToString(_strerror(errno)); - - var ERRNO_CODES = { - 'EPERM': 63, - 'ENOENT': 44, - 'ESRCH': 71, - 'EINTR': 27, - 'EIO': 29, - 'ENXIO': 60, - 'E2BIG': 1, - 'ENOEXEC': 45, - 'EBADF': 8, - 'ECHILD': 12, - 'EAGAIN': 6, - 'EWOULDBLOCK': 6, - 'ENOMEM': 48, - 'EACCES': 2, - 'EFAULT': 21, - 'ENOTBLK': 105, - 'EBUSY': 10, - 'EEXIST': 20, - 'EXDEV': 75, - 'ENODEV': 43, - 'ENOTDIR': 54, - 'EISDIR': 31, - 'EINVAL': 28, - 'ENFILE': 41, - 'EMFILE': 33, - 'ENOTTY': 59, - 'ETXTBSY': 74, - 'EFBIG': 22, - 'ENOSPC': 51, - 'ESPIPE': 70, - 'EROFS': 69, - 'EMLINK': 34, - 'EPIPE': 64, - 'EDOM': 18, - 'ERANGE': 68, - 'ENOMSG': 49, - 'EIDRM': 24, - 'ECHRNG': 106, - 'EL2NSYNC': 156, - 'EL3HLT': 107, - 'EL3RST': 108, - 'ELNRNG': 109, - 'EUNATCH': 110, - 'ENOCSI': 111, - 'EL2HLT': 112, - 'EDEADLK': 16, - 'ENOLCK': 46, - 'EBADE': 113, - 'EBADR': 114, - 'EXFULL': 115, - 'ENOANO': 104, - 'EBADRQC': 103, - 'EBADSLT': 102, - 'EDEADLOCK': 16, - 'EBFONT': 101, - 'ENOSTR': 100, - 'ENODATA': 116, - 'ETIME': 117, - 'ENOSR': 118, - 'ENONET': 119, - 'ENOPKG': 120, - 'EREMOTE': 121, - 'ENOLINK': 47, - 'EADV': 122, - 'ESRMNT': 123, - 'ECOMM': 124, - 'EPROTO': 65, - 'EMULTIHOP': 36, - 'EDOTDOT': 125, - 'EBADMSG': 9, - 'ENOTUNIQ': 126, - 'EBADFD': 127, - 'EREMCHG': 128, - 'ELIBACC': 129, - 'ELIBBAD': 130, - 'ELIBSCN': 131, - 'ELIBMAX': 132, - 'ELIBEXEC': 133, - 'ENOSYS': 52, - 'ENOTEMPTY': 55, - 'ENAMETOOLONG': 37, - 'ELOOP': 32, - 'EOPNOTSUPP': 138, - 'EPFNOSUPPORT': 139, - 'ECONNRESET': 15, - 'ENOBUFS': 42, - 'EAFNOSUPPORT': 5, - 'EPROTOTYPE': 67, - 'ENOTSOCK': 57, - 'ENOPROTOOPT': 50, - 'ESHUTDOWN': 140, - 'ECONNREFUSED': 14, - 'EADDRINUSE': 3, - 'ECONNABORTED': 13, - 'ENETUNREACH': 40, - 'ENETDOWN': 38, - 'ETIMEDOUT': 73, - 'EHOSTDOWN': 142, - 'EHOSTUNREACH': 23, - 'EINPROGRESS': 26, - 'EALREADY': 7, - 'EDESTADDRREQ': 17, - 'EMSGSIZE': 35, - 'EPROTONOSUPPORT': 66, - 'ESOCKTNOSUPPORT': 137, - 'EADDRNOTAVAIL': 4, - 'ENETRESET': 39, - 'EISCONN': 30, - 'ENOTCONN': 53, - 'ETOOMANYREFS': 141, - 'EUSERS': 136, - 'EDQUOT': 19, - 'ESTALE': 72, - 'ENOTSUP': 138, - 'ENOMEDIUM': 148, - 'EILSEQ': 25, - 'EOVERFLOW': 61, - 'ECANCELED': 11, - 'ENOTRECOVERABLE': 56, - 'EOWNERDEAD': 62, - 'ESTRPIPE': 135, - }; - - var asyncLoad = async (url) => { - var arrayBuffer = await readAsync(url); - assert(arrayBuffer, `Loading data file "${url}" failed (no arrayBuffer).`); - return new Uint8Array(arrayBuffer); - }; - - - var FS_createDataFile = (...args) => FS.createDataFile(...args); - - var getUniqueRunDependency = (id) => { - var orig = id; - while (1) { - if (!runDependencyTracking[id]) return id; - id = orig + Math.random(); - } - }; - - var runDependencies = 0; - - - var dependenciesFulfilled = null; - - var runDependencyTracking = { - }; - - var runDependencyWatcher = null; - var removeRunDependency = (id) => { - runDependencies--; - - Module['monitorRunDependencies']?.(runDependencies); - - assert(id, 'removeRunDependency requires an ID'); - assert(runDependencyTracking[id]); - delete runDependencyTracking[id]; - if (runDependencies == 0) { - if (runDependencyWatcher !== null) { - clearInterval(runDependencyWatcher); - runDependencyWatcher = null; - } - if (dependenciesFulfilled) { - var callback = dependenciesFulfilled; - dependenciesFulfilled = null; - callback(); // can add another dependenciesFulfilled - } - } - }; - - - var addRunDependency = (id) => { - runDependencies++; - - Module['monitorRunDependencies']?.(runDependencies); - - assert(id, 'addRunDependency requires an ID') - assert(!runDependencyTracking[id]); - runDependencyTracking[id] = 1; - if (runDependencyWatcher === null && globalThis.setInterval) { - // Check for missing dependencies every few seconds - runDependencyWatcher = setInterval(() => { - if (ABORT) { - clearInterval(runDependencyWatcher); - runDependencyWatcher = null; - return; - } - var shown = false; - for (var dep in runDependencyTracking) { - if (!shown) { - shown = true; - err('still waiting on run dependencies:'); - } - err(`dependency: ${dep}`); - } - if (shown) { - err('(end of list)'); - } - }, 10000); - // Prevent this timer from keeping the runtime alive if nothing - // else is. - runDependencyWatcher.unref?.() - } - }; - - - var preloadPlugins = []; - var FS_handledByPreloadPlugin = async (byteArray, fullname) => { - // Ensure plugins are ready. - if (typeof Browser != 'undefined') Browser.init(); - - for (var plugin of preloadPlugins) { - if (plugin['canHandle'](fullname)) { - assert(plugin['handle'].constructor.name === 'AsyncFunction', 'Filesystem plugin handlers must be async functions (See #24914)') - return plugin['handle'](byteArray, fullname); - } - } - // If no plugin handled this file then return the original/unmodified - // byteArray. - return byteArray; - }; - var FS_preloadFile = async (parent, name, url, canRead, canWrite, dontCreateFile, canOwn, preFinish) => { - // TODO we should allow people to just pass in a complete filename instead - // of parent and name being that we just join them anyways - var fullname = name ? PATH_FS.resolve(PATH.join2(parent, name)) : parent; - var dep = getUniqueRunDependency(`cp ${fullname}`); // might have several active requests for the same fullname - addRunDependency(dep); - - try { - var byteArray = url; - if (typeof url == 'string') { - byteArray = await asyncLoad(url); - } - - byteArray = await FS_handledByPreloadPlugin(byteArray, fullname); - preFinish?.(); - if (!dontCreateFile) { - FS_createDataFile(parent, name, byteArray, canRead, canWrite, canOwn); - } - } finally { - removeRunDependency(dep); - } - }; - var FS_createPreloadedFile = (parent, name, url, canRead, canWrite, onload, onerror, dontCreateFile, canOwn, preFinish) => { - FS_preloadFile(parent, name, url, canRead, canWrite, dontCreateFile, canOwn, preFinish).then(onload).catch(onerror); - }; - var FS = { - root:null, - mounts:[], - devices:{ - }, - streams:[], - nextInode:1, - nameTable:null, - currentPath:"/", - initialized:false, - ignorePermissions:true, - filesystems:null, - syncFSRequests:0, - ErrnoError:class extends Error { - name = 'ErrnoError'; - // We set the `name` property to be able to identify `FS.ErrnoError` - // - the `name` is a standard ECMA-262 property of error objects. Kind of good to have it anyway. - // - when using PROXYFS, an error can come from an underlying FS - // as different FS objects have their own FS.ErrnoError each, - // the test `err instanceof FS.ErrnoError` won't detect an error coming from another filesystem, causing bugs. - // we'll use the reliable test `err.name == "ErrnoError"` instead - constructor(errno) { - super(runtimeInitialized ? strError(errno) : ''); - this.errno = errno; - for (var key in ERRNO_CODES) { - if (ERRNO_CODES[key] === errno) { - this.code = key; - break; - } - } - } - }, - FSStream:class { - shared = {}; - get object() { - return this.node; - } - set object(val) { - this.node = val; - } - get isRead() { - return (this.flags & 2097155) !== 1; - } - get isWrite() { - return (this.flags & 2097155) !== 0; - } - get isAppend() { - return (this.flags & 1024); - } - get flags() { - return this.shared.flags; - } - set flags(val) { - this.shared.flags = val; - } - get position() { - return this.shared.position; - } - set position(val) { - this.shared.position = val; - } - }, - FSNode:class { - node_ops = {}; - stream_ops = {}; - readMode = 292 | 73; - writeMode = 146; - mounted = null; - constructor(parent, name, mode, rdev) { - if (!parent) { - parent = this; // root node sets parent to itself - } - this.parent = parent; - this.mount = parent.mount; - this.id = FS.nextInode++; - this.name = name; - this.mode = mode; - this.rdev = rdev; - this.atime = this.mtime = this.ctime = Date.now(); - } - get read() { - return (this.mode & this.readMode) === this.readMode; - } - set read(val) { - val ? this.mode |= this.readMode : this.mode &= ~this.readMode; - } - get write() { - return (this.mode & this.writeMode) === this.writeMode; - } - set write(val) { - val ? this.mode |= this.writeMode : this.mode &= ~this.writeMode; - } - get isFolder() { - return FS.isDir(this.mode); - } - get isDevice() { - return FS.isChrdev(this.mode); - } - }, - lookupPath(path, opts = {}) { - if (!path) { - throw new FS.ErrnoError(44); - } - opts.follow_mount ??= true - - if (!PATH.isAbs(path)) { - path = FS.cwd() + '/' + path; - } - - // limit max consecutive symlinks to 40 (SYMLOOP_MAX). - linkloop: for (var nlinks = 0; nlinks < 40; nlinks++) { - // split the absolute path - var parts = path.split('/').filter((p) => !!p); - - // start at the root - var current = FS.root; - var current_path = '/'; - - for (var i = 0; i < parts.length; i++) { - var islast = (i === parts.length-1); - if (islast && opts.parent) { - // stop resolving - break; - } - - if (parts[i] === '.') { - continue; - } - - if (parts[i] === '..') { - current_path = PATH.dirname(current_path); - if (FS.isRoot(current)) { - path = current_path + '/' + parts.slice(i + 1).join('/'); - // We're making progress here, don't let many consecutive ..'s - // lead to ELOOP - nlinks--; - continue linkloop; - } else { - current = current.parent; - } - continue; - } - - current_path = PATH.join2(current_path, parts[i]); - try { - current = FS.lookupNode(current, parts[i]); - } catch (e) { - // if noent_okay is true, suppress a ENOENT in the last component - // and return an object with an undefined node. This is needed for - // resolving symlinks in the path when creating a file. - if ((e?.errno === 44) && islast && opts.noent_okay) { - return { path: current_path }; - } - throw e; - } - - // jump to the mount's root node if this is a mountpoint - if (FS.isMountpoint(current) && (!islast || opts.follow_mount)) { - current = current.mounted.root; - } - - // by default, lookupPath will not follow a symlink if it is the final path component. - // setting opts.follow = true will override this behavior. - if (FS.isLink(current.mode) && (!islast || opts.follow)) { - if (!current.node_ops.readlink) { - throw new FS.ErrnoError(52); - } - var link = current.node_ops.readlink(current); - if (!PATH.isAbs(link)) { - link = PATH.dirname(current_path) + '/' + link; - } - path = link + '/' + parts.slice(i + 1).join('/'); - continue linkloop; - } - } - return { path: current_path, node: current }; - } - throw new FS.ErrnoError(32); - }, - getPath(node) { - var path; - while (true) { - if (FS.isRoot(node)) { - var mount = node.mount.mountpoint; - if (!path) return mount; - return mount[mount.length-1] !== '/' ? `${mount}/${path}` : mount + path; - } - path = path ? `${node.name}/${path}` : node.name; - node = node.parent; - } - }, - hashName(parentid, name) { - var hash = 0; - - for (var i = 0; i < name.length; i++) { - hash = ((hash << 5) - hash + name.charCodeAt(i)) | 0; - } - return ((parentid + hash) >>> 0) % FS.nameTable.length; - }, - hashAddNode(node) { - var hash = FS.hashName(node.parent.id, node.name); - node.name_next = FS.nameTable[hash]; - FS.nameTable[hash] = node; - }, - hashRemoveNode(node) { - var hash = FS.hashName(node.parent.id, node.name); - if (FS.nameTable[hash] === node) { - FS.nameTable[hash] = node.name_next; - } else { - var current = FS.nameTable[hash]; - while (current) { - if (current.name_next === node) { - current.name_next = node.name_next; - break; - } - current = current.name_next; - } - } - }, - lookupNode(parent, name) { - var errCode = FS.mayLookup(parent); - if (errCode) { - throw new FS.ErrnoError(errCode); - } - var hash = FS.hashName(parent.id, name); - for (var node = FS.nameTable[hash]; node; node = node.name_next) { - var nodeName = node.name; - if (node.parent.id === parent.id && nodeName === name) { - return node; - } - } - // if we failed to find it in the cache, call into the VFS - return FS.lookup(parent, name); - }, - createNode(parent, name, mode, rdev) { - assert(typeof parent == 'object') - var node = new FS.FSNode(parent, name, mode, rdev); - - FS.hashAddNode(node); - - return node; - }, - destroyNode(node) { - FS.hashRemoveNode(node); - }, - isRoot(node) { - return node === node.parent; - }, - isMountpoint(node) { - return !!node.mounted; - }, - isFile(mode) { - return (mode & 61440) === 32768; - }, - isDir(mode) { - return (mode & 61440) === 16384; - }, - isLink(mode) { - return (mode & 61440) === 40960; - }, - isChrdev(mode) { - return (mode & 61440) === 8192; - }, - isBlkdev(mode) { - return (mode & 61440) === 24576; - }, - isFIFO(mode) { - return (mode & 61440) === 4096; - }, - isSocket(mode) { - return (mode & 49152) === 49152; - }, - flagsToPermissionString(flag) { - var perms = ['r', 'w', 'rw'][flag & 3]; - if ((flag & 512)) { - perms += 'w'; - } - return perms; - }, - nodePermissions(node, perms) { - if (FS.ignorePermissions) { - return 0; - } - // return 0 if any user, group or owner bits are set. - if (perms.includes('r') && !(node.mode & 292)) { - return 2; - } - if (perms.includes('w') && !(node.mode & 146)) { - return 2; - } - if (perms.includes('x') && !(node.mode & 73)) { - return 2; - } - return 0; - }, - mayLookup(dir) { - if (!FS.isDir(dir.mode)) return 54; - var errCode = FS.nodePermissions(dir, 'x'); - if (errCode) return errCode; - if (!dir.node_ops.lookup) return 2; - return 0; - }, - mayCreate(dir, name) { - if (!FS.isDir(dir.mode)) { - return 54; - } - try { - var node = FS.lookupNode(dir, name); - return 20; - } catch (e) { - } - return FS.nodePermissions(dir, 'wx'); - }, - mayDelete(dir, name, isdir) { - var node; - try { - node = FS.lookupNode(dir, name); - } catch (e) { - return e.errno; - } - var errCode = FS.nodePermissions(dir, 'wx'); - if (errCode) { - return errCode; - } - if (isdir) { - if (!FS.isDir(node.mode)) { - return 54; - } - if (FS.isRoot(node) || FS.getPath(node) === FS.cwd()) { - return 10; - } - } else if (FS.isDir(node.mode)) { - return 31; - } - return 0; - }, - mayOpen(node, flags) { - if (!node) { - return 44; - } - if (FS.isLink(node.mode)) { - return 32; - } - var mode = FS.flagsToPermissionString(flags); - if (FS.isDir(node.mode)) { - // opening for write - // TODO: check for O_SEARCH? (== search for dir only) - if (mode !== 'r' || (flags & (512 | 64))) { - return 31; - } - } - return FS.nodePermissions(node, mode); - }, - checkOpExists(op, err) { - if (!op) { - throw new FS.ErrnoError(err); - } - return op; - }, - MAX_OPEN_FDS:4096, - nextfd() { - for (var fd = 0; fd <= FS.MAX_OPEN_FDS; fd++) { - if (!FS.streams[fd]) { - return fd; - } - } - throw new FS.ErrnoError(33); - }, - getStreamChecked(fd) { - var stream = FS.getStream(fd); - if (!stream) { - throw new FS.ErrnoError(8); - } - return stream; - }, - getStream:(fd) => FS.streams[fd], - createStream(stream, fd = -1) { - assert(fd >= -1); - - // clone it, so we can return an instance of FSStream - stream = Object.assign(new FS.FSStream(), stream); - if (fd == -1) { - fd = FS.nextfd(); - } - stream.fd = fd; - FS.streams[fd] = stream; - return stream; - }, - closeStream(fd) { - FS.streams[fd] = null; - }, - dupStream(origStream, fd = -1) { - var stream = FS.createStream(origStream, fd); - stream.stream_ops?.dup?.(stream); - return stream; - }, - doSetAttr(stream, node, attr) { - var setattr = stream?.stream_ops.setattr; - var arg = setattr ? stream : node; - setattr ??= node.node_ops.setattr; - FS.checkOpExists(setattr, 63) - setattr(arg, attr); - }, - chrdev_stream_ops:{ - open(stream) { - var device = FS.getDevice(stream.node.rdev); - // override node's stream ops with the device's - stream.stream_ops = device.stream_ops; - // forward the open call - stream.stream_ops.open?.(stream); - }, - llseek() { - throw new FS.ErrnoError(70); - }, - }, - major:(dev) => ((dev) >> 8), - minor:(dev) => ((dev) & 0xff), - makedev:(ma, mi) => ((ma) << 8 | (mi)), - registerDevice(dev, ops) { - FS.devices[dev] = { stream_ops: ops }; - }, - getDevice:(dev) => FS.devices[dev], - getMounts(mount) { - var mounts = []; - var check = [mount]; - - while (check.length) { - var m = check.pop(); - - mounts.push(m); - - check.push(...m.mounts); - } - - return mounts; - }, - syncfs(populate, callback) { - if (typeof populate == 'function') { - callback = populate; - populate = false; - } - - FS.syncFSRequests++; - - if (FS.syncFSRequests > 1) { - err(`warning: ${FS.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`); - } - - var mounts = FS.getMounts(FS.root.mount); - var completed = 0; - - function doCallback(errCode) { - assert(FS.syncFSRequests > 0); - FS.syncFSRequests--; - return callback(errCode); - } - - function done(errCode) { - if (errCode) { - if (!done.errored) { - done.errored = true; - return doCallback(errCode); - } - return; - } - if (++completed >= mounts.length) { - doCallback(null); - } - }; - - // sync all mounts - for (var mount of mounts) { - if (mount.type.syncfs) { - mount.type.syncfs(mount, populate, done); - } else { - done(null); - } - } - }, - mount(type, opts, mountpoint) { - if (typeof type == 'string') { - // The filesystem was not included, and instead we have an error - // message stored in the variable. - throw type; - } - var root = mountpoint === '/'; - var pseudo = !mountpoint; - var node; - - if (root && FS.root) { - throw new FS.ErrnoError(10); - } else if (!root && !pseudo) { - var lookup = FS.lookupPath(mountpoint, { follow_mount: false }); - - mountpoint = lookup.path; // use the absolute path - node = lookup.node; - - if (FS.isMountpoint(node)) { - throw new FS.ErrnoError(10); - } - - if (!FS.isDir(node.mode)) { - throw new FS.ErrnoError(54); - } - } - - var mount = { - type, - opts, - mountpoint, - mounts: [] - }; - - // create a root node for the fs - var mountRoot = type.mount(mount); - mountRoot.mount = mount; - mount.root = mountRoot; - - if (root) { - FS.root = mountRoot; - } else if (node) { - // set as a mountpoint - node.mounted = mount; - - // add the new mount to the current mount's children - if (node.mount) { - node.mount.mounts.push(mount); - } - } - - return mountRoot; - }, - unmount(mountpoint) { - var lookup = FS.lookupPath(mountpoint, { follow_mount: false }); - - if (!FS.isMountpoint(lookup.node)) { - throw new FS.ErrnoError(28); - } - - // destroy the nodes for this mount, and all its child mounts - var node = lookup.node; - var mount = node.mounted; - var mounts = FS.getMounts(mount); - - for (var [hash, current] of Object.entries(FS.nameTable)) { - while (current) { - var next = current.name_next; - - if (mounts.includes(current.mount)) { - FS.destroyNode(current); - } - - current = next; - } - } - - // no longer a mountpoint - node.mounted = null; - - // remove this mount from the child mounts - var idx = node.mount.mounts.indexOf(mount); - assert(idx !== -1); - node.mount.mounts.splice(idx, 1); - }, - lookup(parent, name) { - return parent.node_ops.lookup(parent, name); - }, - mknod(path, mode, dev) { - var lookup = FS.lookupPath(path, { parent: true }); - var parent = lookup.node; - var name = PATH.basename(path); - if (!name) { - throw new FS.ErrnoError(28); - } - if (name === '.' || name === '..') { - throw new FS.ErrnoError(20); - } - var errCode = FS.mayCreate(parent, name); - if (errCode) { - throw new FS.ErrnoError(errCode); - } - if (!parent.node_ops.mknod) { - throw new FS.ErrnoError(63); - } - return parent.node_ops.mknod(parent, name, mode, dev); - }, - statfs(path) { - return FS.statfsNode(FS.lookupPath(path, {follow: true}).node); - }, - statfsStream(stream) { - // We keep a separate statfsStream function because noderawfs overrides - // it. In noderawfs, stream.node is sometimes null. Instead, we need to - // look at stream.path. - return FS.statfsNode(stream.node); - }, - statfsNode(node) { - // NOTE: None of the defaults here are true. We're just returning safe and - // sane values. Currently nodefs and rawfs replace these defaults, - // other file systems leave them alone. - var rtn = { - bsize: 4096, - frsize: 4096, - blocks: 1e6, - bfree: 5e5, - bavail: 5e5, - files: FS.nextInode, - ffree: FS.nextInode - 1, - fsid: 42, - flags: 2, - namelen: 255, - }; - - if (node.node_ops.statfs) { - Object.assign(rtn, node.node_ops.statfs(node.mount.opts.root)); - } - return rtn; - }, - create(path, mode = 0o666) { - mode &= 4095; - mode |= 32768; - return FS.mknod(path, mode, 0); - }, - mkdir(path, mode = 0o777) { - mode &= 511 | 512; - mode |= 16384; - return FS.mknod(path, mode, 0); - }, - mkdirTree(path, mode) { - var dirs = path.split('/'); - var d = ''; - for (var dir of dirs) { - if (!dir) continue; - if (d || PATH.isAbs(path)) d += '/'; - d += dir; - try { - FS.mkdir(d, mode); - } catch(e) { - if (e.errno != 20) throw e; - } - } - }, - mkdev(path, mode, dev) { - if (typeof dev == 'undefined') { - dev = mode; - mode = 0o666; - } - mode |= 8192; - return FS.mknod(path, mode, dev); - }, - symlink(oldpath, newpath) { - if (!PATH_FS.resolve(oldpath)) { - throw new FS.ErrnoError(44); - } - var lookup = FS.lookupPath(newpath, { parent: true }); - var parent = lookup.node; - if (!parent) { - throw new FS.ErrnoError(44); - } - var newname = PATH.basename(newpath); - var errCode = FS.mayCreate(parent, newname); - if (errCode) { - throw new FS.ErrnoError(errCode); - } - if (!parent.node_ops.symlink) { - throw new FS.ErrnoError(63); - } - return parent.node_ops.symlink(parent, newname, oldpath); - }, - rename(old_path, new_path) { - var old_dirname = PATH.dirname(old_path); - var new_dirname = PATH.dirname(new_path); - var old_name = PATH.basename(old_path); - var new_name = PATH.basename(new_path); - // parents must exist - var lookup, old_dir, new_dir; - - // let the errors from non existent directories percolate up - lookup = FS.lookupPath(old_path, { parent: true }); - old_dir = lookup.node; - lookup = FS.lookupPath(new_path, { parent: true }); - new_dir = lookup.node; - - if (!old_dir || !new_dir) throw new FS.ErrnoError(44); - // need to be part of the same mount - if (old_dir.mount !== new_dir.mount) { - throw new FS.ErrnoError(75); - } - // source must exist - var old_node = FS.lookupNode(old_dir, old_name); - // old path should not be an ancestor of the new path - var relative = PATH_FS.relative(old_path, new_dirname); - if (relative.charAt(0) !== '.') { - throw new FS.ErrnoError(28); - } - // new path should not be an ancestor of the old path - relative = PATH_FS.relative(new_path, old_dirname); - if (relative.charAt(0) !== '.') { - throw new FS.ErrnoError(55); - } - // see if the new path already exists - var new_node; - try { - new_node = FS.lookupNode(new_dir, new_name); - } catch (e) { - // not fatal - } - // early out if nothing needs to change - if (old_node === new_node) { - return; - } - // we'll need to delete the old entry - var isdir = FS.isDir(old_node.mode); - var errCode = FS.mayDelete(old_dir, old_name, isdir); - if (errCode) { - throw new FS.ErrnoError(errCode); - } - // need delete permissions if we'll be overwriting. - // need create permissions if new doesn't already exist. - errCode = new_node ? - FS.mayDelete(new_dir, new_name, isdir) : - FS.mayCreate(new_dir, new_name); - if (errCode) { - throw new FS.ErrnoError(errCode); - } - if (!old_dir.node_ops.rename) { - throw new FS.ErrnoError(63); - } - if (FS.isMountpoint(old_node) || (new_node && FS.isMountpoint(new_node))) { - throw new FS.ErrnoError(10); - } - // if we are going to change the parent, check write permissions - if (new_dir !== old_dir) { - errCode = FS.nodePermissions(old_dir, 'w'); - if (errCode) { - throw new FS.ErrnoError(errCode); - } - } - // remove the node from the lookup hash - FS.hashRemoveNode(old_node); - // do the underlying fs rename - try { - old_dir.node_ops.rename(old_node, new_dir, new_name); - // update old node (we do this here to avoid each backend - // needing to) - old_node.parent = new_dir; - } catch (e) { - throw e; - } finally { - // add the node back to the hash (in case node_ops.rename - // changed its name) - FS.hashAddNode(old_node); - } - }, - rmdir(path) { - var lookup = FS.lookupPath(path, { parent: true }); - var parent = lookup.node; - var name = PATH.basename(path); - var node = FS.lookupNode(parent, name); - var errCode = FS.mayDelete(parent, name, true); - if (errCode) { - throw new FS.ErrnoError(errCode); - } - if (!parent.node_ops.rmdir) { - throw new FS.ErrnoError(63); - } - if (FS.isMountpoint(node)) { - throw new FS.ErrnoError(10); - } - parent.node_ops.rmdir(parent, name); - FS.destroyNode(node); - }, - readdir(path) { - var lookup = FS.lookupPath(path, { follow: true }); - var node = lookup.node; - var readdir = FS.checkOpExists(node.node_ops.readdir, 54); - return readdir(node); - }, - unlink(path) { - var lookup = FS.lookupPath(path, { parent: true }); - var parent = lookup.node; - if (!parent) { - throw new FS.ErrnoError(44); - } - var name = PATH.basename(path); - var node = FS.lookupNode(parent, name); - var errCode = FS.mayDelete(parent, name, false); - if (errCode) { - // According to POSIX, we should map EISDIR to EPERM, but - // we instead do what Linux does (and we must, as we use - // the musl linux libc). - throw new FS.ErrnoError(errCode); - } - if (!parent.node_ops.unlink) { - throw new FS.ErrnoError(63); - } - if (FS.isMountpoint(node)) { - throw new FS.ErrnoError(10); - } - parent.node_ops.unlink(parent, name); - FS.destroyNode(node); - }, - readlink(path) { - var lookup = FS.lookupPath(path); - var link = lookup.node; - if (!link) { - throw new FS.ErrnoError(44); - } - if (!link.node_ops.readlink) { - throw new FS.ErrnoError(28); - } - return link.node_ops.readlink(link); - }, - stat(path, dontFollow) { - var lookup = FS.lookupPath(path, { follow: !dontFollow }); - var node = lookup.node; - var getattr = FS.checkOpExists(node.node_ops.getattr, 63); - return getattr(node); - }, - fstat(fd) { - var stream = FS.getStreamChecked(fd); - var node = stream.node; - var getattr = stream.stream_ops.getattr; - var arg = getattr ? stream : node; - getattr ??= node.node_ops.getattr; - FS.checkOpExists(getattr, 63) - return getattr(arg); - }, - lstat(path) { - return FS.stat(path, true); - }, - doChmod(stream, node, mode, dontFollow) { - FS.doSetAttr(stream, node, { - mode: (mode & 4095) | (node.mode & ~4095), - ctime: Date.now(), - dontFollow - }); - }, - chmod(path, mode, dontFollow) { - var node; - if (typeof path == 'string') { - var lookup = FS.lookupPath(path, { follow: !dontFollow }); - node = lookup.node; - } else { - node = path; - } - FS.doChmod(null, node, mode, dontFollow); - }, - lchmod(path, mode) { - FS.chmod(path, mode, true); - }, - fchmod(fd, mode) { - var stream = FS.getStreamChecked(fd); - FS.doChmod(stream, stream.node, mode, false); - }, - doChown(stream, node, dontFollow) { - FS.doSetAttr(stream, node, { - timestamp: Date.now(), - dontFollow - // we ignore the uid / gid for now - }); - }, - chown(path, uid, gid, dontFollow) { - var node; - if (typeof path == 'string') { - var lookup = FS.lookupPath(path, { follow: !dontFollow }); - node = lookup.node; - } else { - node = path; - } - FS.doChown(null, node, dontFollow); - }, - lchown(path, uid, gid) { - FS.chown(path, uid, gid, true); - }, - fchown(fd, uid, gid) { - var stream = FS.getStreamChecked(fd); - FS.doChown(stream, stream.node, false); - }, - doTruncate(stream, node, len) { - if (FS.isDir(node.mode)) { - throw new FS.ErrnoError(31); - } - if (!FS.isFile(node.mode)) { - throw new FS.ErrnoError(28); - } - var errCode = FS.nodePermissions(node, 'w'); - if (errCode) { - throw new FS.ErrnoError(errCode); - } - FS.doSetAttr(stream, node, { - size: len, - timestamp: Date.now() - }); - }, - truncate(path, len) { - if (len < 0) { - throw new FS.ErrnoError(28); - } - var node; - if (typeof path == 'string') { - var lookup = FS.lookupPath(path, { follow: true }); - node = lookup.node; - } else { - node = path; - } - FS.doTruncate(null, node, len); - }, - ftruncate(fd, len) { - var stream = FS.getStreamChecked(fd); - if (len < 0 || (stream.flags & 2097155) === 0) { - throw new FS.ErrnoError(28); - } - FS.doTruncate(stream, stream.node, len); - }, - utime(path, atime, mtime) { - var lookup = FS.lookupPath(path, { follow: true }); - var node = lookup.node; - var setattr = FS.checkOpExists(node.node_ops.setattr, 63); - setattr(node, { - atime: atime, - mtime: mtime - }); - }, - open(path, flags, mode = 0o666) { - if (path === "") { - throw new FS.ErrnoError(44); - } - flags = typeof flags == 'string' ? FS_modeStringToFlags(flags) : flags; - if ((flags & 64)) { - mode = (mode & 4095) | 32768; - } else { - mode = 0; - } - var node; - var isDirPath; - if (typeof path == 'object') { - node = path; - } else { - isDirPath = path.endsWith("/"); - // noent_okay makes it so that if the final component of the path - // doesn't exist, lookupPath returns `node: undefined`. `path` will be - // updated to point to the target of all symlinks. - var lookup = FS.lookupPath(path, { - follow: !(flags & 131072), - noent_okay: true - }); - node = lookup.node; - path = lookup.path; - } - // perhaps we need to create the node - var created = false; - if ((flags & 64)) { - if (node) { - // if O_CREAT and O_EXCL are set, error out if the node already exists - if ((flags & 128)) { - throw new FS.ErrnoError(20); - } - } else if (isDirPath) { - throw new FS.ErrnoError(31); - } else { - // node doesn't exist, try to create it - // Ignore the permission bits here to ensure we can `open` this new - // file below. We use chmod below to apply the permissions once the - // file is open. - node = FS.mknod(path, mode | 0o777, 0); - created = true; - } - } - if (!node) { - throw new FS.ErrnoError(44); - } - // can't truncate a device - if (FS.isChrdev(node.mode)) { - flags &= ~512; - } - // if asked only for a directory, then this must be one - if ((flags & 65536) && !FS.isDir(node.mode)) { - throw new FS.ErrnoError(54); - } - // check permissions, if this is not a file we just created now (it is ok to - // create and write to a file with read-only permissions; it is read-only - // for later use) - if (!created) { - var errCode = FS.mayOpen(node, flags); - if (errCode) { - throw new FS.ErrnoError(errCode); - } - } - // do truncation if necessary - if ((flags & 512) && !created) { - FS.truncate(node, 0); - } - // we've already handled these, don't pass down to the underlying vfs - flags &= ~(128 | 512 | 131072); - - // register the stream with the filesystem - var stream = FS.createStream({ - node, - path: FS.getPath(node), // we want the absolute path to the node - flags, - seekable: true, - position: 0, - stream_ops: node.stream_ops, - // used by the file family libc calls (fopen, fwrite, ferror, etc.) - ungotten: [], - error: false - }); - // call the new stream's open function - if (stream.stream_ops.open) { - stream.stream_ops.open(stream); - } - if (created) { - FS.chmod(node, mode & 0o777); - } - return stream; - }, - close(stream) { - if (FS.isClosed(stream)) { - throw new FS.ErrnoError(8); - } - if (stream.getdents) stream.getdents = null; // free readdir state - try { - if (stream.stream_ops.close) { - stream.stream_ops.close(stream); - } - } catch (e) { - throw e; - } finally { - FS.closeStream(stream.fd); - } - stream.fd = null; - }, - isClosed(stream) { - return stream.fd === null; - }, - llseek(stream, offset, whence) { - if (FS.isClosed(stream)) { - throw new FS.ErrnoError(8); - } - if (!stream.seekable || !stream.stream_ops.llseek) { - throw new FS.ErrnoError(70); - } - if (whence != 0 && whence != 1 && whence != 2) { - throw new FS.ErrnoError(28); - } - stream.position = stream.stream_ops.llseek(stream, offset, whence); - stream.ungotten = []; - return stream.position; - }, - read(stream, buffer, offset, length, position) { - assert(offset >= 0); - if (length < 0 || position < 0) { - throw new FS.ErrnoError(28); - } - if (FS.isClosed(stream)) { - throw new FS.ErrnoError(8); - } - if ((stream.flags & 2097155) === 1) { - throw new FS.ErrnoError(8); - } - if (FS.isDir(stream.node.mode)) { - throw new FS.ErrnoError(31); - } - if (!stream.stream_ops.read) { - throw new FS.ErrnoError(28); - } - var seeking = typeof position != 'undefined'; - if (!seeking) { - position = stream.position; - } else if (!stream.seekable) { - throw new FS.ErrnoError(70); - } - var bytesRead = stream.stream_ops.read(stream, buffer, offset, length, position); - if (!seeking) stream.position += bytesRead; - return bytesRead; - }, - write(stream, buffer, offset, length, position, canOwn) { - assert(offset >= 0); - if (length < 0 || position < 0) { - throw new FS.ErrnoError(28); - } - if (FS.isClosed(stream)) { - throw new FS.ErrnoError(8); - } - if ((stream.flags & 2097155) === 0) { - throw new FS.ErrnoError(8); - } - if (FS.isDir(stream.node.mode)) { - throw new FS.ErrnoError(31); - } - if (!stream.stream_ops.write) { - throw new FS.ErrnoError(28); - } - if (stream.seekable && stream.flags & 1024) { - // seek to the end before writing in append mode - FS.llseek(stream, 0, 2); - } - var seeking = typeof position != 'undefined'; - if (!seeking) { - position = stream.position; - } else if (!stream.seekable) { - throw new FS.ErrnoError(70); - } - var bytesWritten = stream.stream_ops.write(stream, buffer, offset, length, position, canOwn); - if (!seeking) stream.position += bytesWritten; - return bytesWritten; - }, - mmap(stream, length, position, prot, flags) { - // User requests writing to file (prot & PROT_WRITE != 0). - // Checking if we have permissions to write to the file unless - // MAP_PRIVATE flag is set. According to POSIX spec it is possible - // to write to file opened in read-only mode with MAP_PRIVATE flag, - // as all modifications will be visible only in the memory of - // the current process. - if ((prot & 2) !== 0 - && (flags & 2) === 0 - && (stream.flags & 2097155) !== 2) { - throw new FS.ErrnoError(2); - } - if ((stream.flags & 2097155) === 1) { - throw new FS.ErrnoError(2); - } - if (!stream.stream_ops.mmap) { - throw new FS.ErrnoError(43); - } - if (!length) { - throw new FS.ErrnoError(28); - } - return stream.stream_ops.mmap(stream, length, position, prot, flags); - }, - msync(stream, buffer, offset, length, mmapFlags) { - assert(offset >= 0); - if (!stream.stream_ops.msync) { - return 0; - } - return stream.stream_ops.msync(stream, buffer, offset, length, mmapFlags); - }, - ioctl(stream, cmd, arg) { - if (!stream.stream_ops.ioctl) { - throw new FS.ErrnoError(59); - } - return stream.stream_ops.ioctl(stream, cmd, arg); - }, - readFile(path, opts = {}) { - opts.flags = opts.flags || 0; - opts.encoding = opts.encoding || 'binary'; - if (opts.encoding !== 'utf8' && opts.encoding !== 'binary') { - abort(`Invalid encoding type "${opts.encoding}"`); - } - var stream = FS.open(path, opts.flags); - var stat = FS.stat(path); - var length = stat.size; - var buf = new Uint8Array(length); - FS.read(stream, buf, 0, length, 0); - if (opts.encoding === 'utf8') { - buf = UTF8ArrayToString(buf); - } - FS.close(stream); - return buf; - }, - writeFile(path, data, opts = {}) { - opts.flags = opts.flags || 577; - var stream = FS.open(path, opts.flags, opts.mode); - if (typeof data == 'string') { - data = new Uint8Array(intArrayFromString(data, true)); - } - if (ArrayBuffer.isView(data)) { - FS.write(stream, data, 0, data.byteLength, undefined, opts.canOwn); - } else { - abort('Unsupported data type'); - } - FS.close(stream); - }, - cwd:() => FS.currentPath, - chdir(path) { - var lookup = FS.lookupPath(path, { follow: true }); - if (lookup.node === null) { - throw new FS.ErrnoError(44); - } - if (!FS.isDir(lookup.node.mode)) { - throw new FS.ErrnoError(54); - } - var errCode = FS.nodePermissions(lookup.node, 'x'); - if (errCode) { - throw new FS.ErrnoError(errCode); - } - FS.currentPath = lookup.path; - }, - createDefaultDirectories() { - FS.mkdir('/tmp'); - FS.mkdir('/home'); - FS.mkdir('/home/web_user'); - }, - createDefaultDevices() { - // create /dev - FS.mkdir('/dev'); - // setup /dev/null - FS.registerDevice(FS.makedev(1, 3), { - read: () => 0, - write: (stream, buffer, offset, length, pos) => length, - llseek: () => 0, - }); - FS.mkdev('/dev/null', FS.makedev(1, 3)); - // setup /dev/tty and /dev/tty1 - // stderr needs to print output using err() rather than out() - // so we register a second tty just for it. - TTY.register(FS.makedev(5, 0), TTY.default_tty_ops); - TTY.register(FS.makedev(6, 0), TTY.default_tty1_ops); - FS.mkdev('/dev/tty', FS.makedev(5, 0)); - FS.mkdev('/dev/tty1', FS.makedev(6, 0)); - // setup /dev/[u]random - // use a buffer to avoid overhead of individual crypto calls per byte - var randomBuffer = new Uint8Array(1024), randomLeft = 0; - var randomByte = () => { - if (randomLeft === 0) { - randomFill(randomBuffer); - randomLeft = randomBuffer.byteLength; - } - return randomBuffer[--randomLeft]; - }; - FS.createDevice('/dev', 'random', randomByte); - FS.createDevice('/dev', 'urandom', randomByte); - // we're not going to emulate the actual shm device, - // just create the tmp dirs that reside in it commonly - FS.mkdir('/dev/shm'); - FS.mkdir('/dev/shm/tmp'); - }, - createSpecialDirectories() { - // create /proc/self/fd which allows /proc/self/fd/6 => readlink gives the - // name of the stream for fd 6 (see test_unistd_ttyname) - FS.mkdir('/proc'); - var proc_self = FS.mkdir('/proc/self'); - FS.mkdir('/proc/self/fd'); - FS.mount({ - mount() { - var node = FS.createNode(proc_self, 'fd', 16895, 73); - node.stream_ops = { - llseek: MEMFS.stream_ops.llseek, - }; - node.node_ops = { - lookup(parent, name) { - var fd = +name; - var stream = FS.getStreamChecked(fd); - var ret = { - parent: null, - mount: { mountpoint: 'fake' }, - node_ops: { readlink: () => stream.path }, - id: fd + 1, - }; - ret.parent = ret; // make it look like a simple root node - return ret; - }, - readdir() { - return Array.from(FS.streams.entries()) - .filter(([k, v]) => v) - .map(([k, v]) => k.toString()); - } - }; - return node; - } - }, {}, '/proc/self/fd'); - }, - createStandardStreams(input, output, error) { - // TODO deprecate the old functionality of a single - // input / output callback and that utilizes FS.createDevice - // and instead require a unique set of stream ops - - // by default, we symlink the standard streams to the - // default tty devices. however, if the standard streams - // have been overwritten we create a unique device for - // them instead. - if (input) { - FS.createDevice('/dev', 'stdin', input); - } else { - FS.symlink('/dev/tty', '/dev/stdin'); - } - if (output) { - FS.createDevice('/dev', 'stdout', null, output); - } else { - FS.symlink('/dev/tty', '/dev/stdout'); - } - if (error) { - FS.createDevice('/dev', 'stderr', null, error); - } else { - FS.symlink('/dev/tty1', '/dev/stderr'); - } - - // open default streams for the stdin, stdout and stderr devices - var stdin = FS.open('/dev/stdin', 0); - var stdout = FS.open('/dev/stdout', 1); - var stderr = FS.open('/dev/stderr', 1); - assert(stdin.fd === 0, `invalid handle for stdin (${stdin.fd})`); - assert(stdout.fd === 1, `invalid handle for stdout (${stdout.fd})`); - assert(stderr.fd === 2, `invalid handle for stderr (${stderr.fd})`); - }, - staticInit() { - FS.nameTable = new Array(4096); - - FS.mount(MEMFS, {}, '/'); - - FS.createDefaultDirectories(); - FS.createDefaultDevices(); - FS.createSpecialDirectories(); - - FS.filesystems = { - 'MEMFS': MEMFS, - }; - }, - init(input, output, error) { - assert(!FS.initialized, 'FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)'); - FS.initialized = true; - - // Allow Module.stdin etc. to provide defaults, if none explicitly passed to us here - input ??= Module['stdin']; - output ??= Module['stdout']; - error ??= Module['stderr']; - - FS.createStandardStreams(input, output, error); - }, - quit() { - FS.initialized = false; - // force-flush all streams, so we get musl std streams printed out - _fflush(0); - // close all of our streams - for (var stream of FS.streams) { - if (stream) { - FS.close(stream); - } - } - }, - findObject(path, dontResolveLastLink) { - var ret = FS.analyzePath(path, dontResolveLastLink); - if (!ret.exists) { - return null; - } - return ret.object; - }, - analyzePath(path, dontResolveLastLink) { - // operate from within the context of the symlink's target - try { - var lookup = FS.lookupPath(path, { follow: !dontResolveLastLink }); - path = lookup.path; - } catch (e) { - } - var ret = { - isRoot: false, exists: false, error: 0, name: null, path: null, object: null, - parentExists: false, parentPath: null, parentObject: null - }; - try { - var lookup = FS.lookupPath(path, { parent: true }); - ret.parentExists = true; - ret.parentPath = lookup.path; - ret.parentObject = lookup.node; - ret.name = PATH.basename(path); - lookup = FS.lookupPath(path, { follow: !dontResolveLastLink }); - ret.exists = true; - ret.path = lookup.path; - ret.object = lookup.node; - ret.name = lookup.node.name; - ret.isRoot = lookup.path === '/'; - } catch (e) { - ret.error = e.errno; - }; - return ret; - }, - createPath(parent, path, canRead, canWrite) { - parent = typeof parent == 'string' ? parent : FS.getPath(parent); - var parts = path.split('/').reverse(); - while (parts.length) { - var part = parts.pop(); - if (!part) continue; - var current = PATH.join2(parent, part); - try { - FS.mkdir(current); - } catch (e) { - if (e.errno != 20) throw e; - } - parent = current; - } - return current; - }, - createFile(parent, name, properties, canRead, canWrite) { - var path = PATH.join2(typeof parent == 'string' ? parent : FS.getPath(parent), name); - var mode = FS_getMode(canRead, canWrite); - return FS.create(path, mode); - }, - createDataFile(parent, name, data, canRead, canWrite, canOwn) { - var path = name; - if (parent) { - parent = typeof parent == 'string' ? parent : FS.getPath(parent); - path = name ? PATH.join2(parent, name) : parent; - } - var mode = FS_getMode(canRead, canWrite); - var node = FS.create(path, mode); - if (data) { - if (typeof data == 'string') { - var arr = new Array(data.length); - for (var i = 0, len = data.length; i < len; ++i) arr[i] = data.charCodeAt(i); - data = arr; - } - // make sure we can write to the file - FS.chmod(node, mode | 146); - var stream = FS.open(node, 577); - FS.write(stream, data, 0, data.length, 0, canOwn); - FS.close(stream); - FS.chmod(node, mode); - } - }, - createDevice(parent, name, input, output) { - var path = PATH.join2(typeof parent == 'string' ? parent : FS.getPath(parent), name); - var mode = FS_getMode(!!input, !!output); - FS.createDevice.major ??= 64; - var dev = FS.makedev(FS.createDevice.major++, 0); - // Create a fake device that a set of stream ops to emulate - // the old behavior. - FS.registerDevice(dev, { - open(stream) { - stream.seekable = false; - }, - close(stream) { - // flush any pending line data - if (output?.buffer?.length) { - output(10); - } - }, - read(stream, buffer, offset, length, pos /* ignored */) { - var bytesRead = 0; - for (var i = 0; i < length; i++) { - var result; - try { - result = input(); - } catch (e) { - throw new FS.ErrnoError(29); - } - if (result === undefined && bytesRead === 0) { - throw new FS.ErrnoError(6); - } - if (result === null || result === undefined) break; - bytesRead++; - buffer[offset+i] = result; - } - if (bytesRead) { - stream.node.atime = Date.now(); - } - return bytesRead; - }, - write(stream, buffer, offset, length, pos) { - for (var i = 0; i < length; i++) { - try { - output(buffer[offset+i]); - } catch (e) { - throw new FS.ErrnoError(29); - } - } - if (length) { - stream.node.mtime = stream.node.ctime = Date.now(); - } - return i; - } - }); - return FS.mkdev(path, mode, dev); - }, - forceLoadFile(obj) { - if (obj.isDevice || obj.isFolder || obj.link || obj.contents) return true; - if (globalThis.XMLHttpRequest) { - abort("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread."); - } else { // Command-line. - try { - obj.contents = readBinary(obj.url); - } catch (e) { - throw new FS.ErrnoError(29); - } - } - }, - createLazyFile(parent, name, url, canRead, canWrite) { - // Lazy chunked Uint8Array (implements get and length from Uint8Array). - // Actual getting is abstracted away for eventual reuse. - class LazyUint8Array { - lengthKnown = false; - chunks = []; // Loaded chunks. Index is the chunk number - get(idx) { - if (idx > this.length-1 || idx < 0) { - return undefined; - } - var chunkOffset = idx % this.chunkSize; - var chunkNum = (idx / this.chunkSize)|0; - return this.getter(chunkNum)[chunkOffset]; - } - setDataGetter(getter) { - this.getter = getter; - } - cacheLength() { - // Find length - var xhr = new XMLHttpRequest(); - xhr.open('HEAD', url, false); - xhr.send(null); - if (!(xhr.status >= 200 && xhr.status < 300 || xhr.status === 304)) abort("Couldn't load " + url + ". Status: " + xhr.status); - var datalength = Number(xhr.getResponseHeader("Content-length")); - var header; - var hasByteServing = (header = xhr.getResponseHeader("Accept-Ranges")) && header === "bytes"; - var usesGzip = (header = xhr.getResponseHeader("Content-Encoding")) && header === "gzip"; - - var chunkSize = 1024*1024; // Chunk size in bytes - - if (!hasByteServing) chunkSize = datalength; - - // Function to get a range from the remote URL. - var doXHR = (from, to) => { - if (from > to) abort("invalid range (" + from + ", " + to + ") or no bytes requested!"); - if (to > datalength-1) abort("only " + datalength + " bytes available! programmer error!"); - - // TODO: Use mozResponseArrayBuffer, responseStream, etc. if available. - var xhr = new XMLHttpRequest(); - xhr.open('GET', url, false); - if (datalength !== chunkSize) xhr.setRequestHeader("Range", "bytes=" + from + "-" + to); - - // Some hints to the browser that we want binary data. - xhr.responseType = 'arraybuffer'; - if (xhr.overrideMimeType) { - xhr.overrideMimeType('text/plain; charset=x-user-defined'); - } - - xhr.send(null); - if (!(xhr.status >= 200 && xhr.status < 300 || xhr.status === 304)) abort("Couldn't load " + url + ". Status: " + xhr.status); - if (xhr.response !== undefined) { - return new Uint8Array(/** @type{Array} */(xhr.response || [])); - } - return intArrayFromString(xhr.responseText || '', true); - }; - var lazyArray = this; - lazyArray.setDataGetter((chunkNum) => { - var start = chunkNum * chunkSize; - var end = (chunkNum+1) * chunkSize - 1; // including this byte - end = Math.min(end, datalength-1); // if datalength-1 is selected, this is the last block - if (typeof lazyArray.chunks[chunkNum] == 'undefined') { - lazyArray.chunks[chunkNum] = doXHR(start, end); - } - if (typeof lazyArray.chunks[chunkNum] == 'undefined') abort('doXHR failed!'); - return lazyArray.chunks[chunkNum]; - }); - - if (usesGzip || !datalength) { - // if the server uses gzip or doesn't supply the length, we have to download the whole file to get the (uncompressed) length - chunkSize = datalength = 1; // this will force getter(0)/doXHR do download the whole file - datalength = this.getter(0).length; - chunkSize = datalength; - out("LazyFiles on gzip forces download of the whole file when length is accessed"); - } - - this._length = datalength; - this._chunkSize = chunkSize; - this.lengthKnown = true; - } - get length() { - if (!this.lengthKnown) { - this.cacheLength(); - } - return this._length; - } - get chunkSize() { - if (!this.lengthKnown) { - this.cacheLength(); - } - return this._chunkSize; - } - } - - if (globalThis.XMLHttpRequest) { - if (!ENVIRONMENT_IS_WORKER) abort('Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc'); - var lazyArray = new LazyUint8Array(); - var properties = { isDevice: false, contents: lazyArray }; - } else { - var properties = { isDevice: false, url: url }; - } - - var node = FS.createFile(parent, name, properties, canRead, canWrite); - // This is a total hack, but I want to get this lazy file code out of the - // core of MEMFS. If we want to keep this lazy file concept I feel it should - // be its own thin LAZYFS proxying calls to MEMFS. - if (properties.contents) { - node.contents = properties.contents; - } else if (properties.url) { - node.contents = null; - node.url = properties.url; - } - // Add a function that defers querying the file size until it is asked the first time. - Object.defineProperties(node, { - usedBytes: { - get: function() { return this.contents.length; } - } - }); - // override each stream op with one that tries to force load the lazy file first - var stream_ops = {}; - for (const [key, fn] of Object.entries(node.stream_ops)) { - stream_ops[key] = (...args) => { - FS.forceLoadFile(node); - return fn(...args); - }; - } - function writeChunks(stream, buffer, offset, length, position) { - var contents = stream.node.contents; - if (position >= contents.length) - return 0; - var size = Math.min(contents.length - position, length); - assert(size >= 0); - if (contents.slice) { // normal array - for (var i = 0; i < size; i++) { - buffer[offset + i] = contents[position + i]; - } - } else { - for (var i = 0; i < size; i++) { // LazyUint8Array from sync binary XHR - buffer[offset + i] = contents.get(position + i); - } - } - return size; - } - // use a custom read function - stream_ops.read = (stream, buffer, offset, length, position) => { - FS.forceLoadFile(node); - return writeChunks(stream, buffer, offset, length, position) - }; - // use a custom mmap function - stream_ops.mmap = (stream, length, position, prot, flags) => { - FS.forceLoadFile(node); - var ptr = mmapAlloc(length); - if (!ptr) { - throw new FS.ErrnoError(48); - } - writeChunks(stream, HEAP8, ptr, length, position); - return { ptr, allocated: true }; - }; - node.stream_ops = stream_ops; - return node; - }, - absolutePath() { - abort('FS.absolutePath has been removed; use PATH_FS.resolve instead'); - }, - createFolder() { - abort('FS.createFolder has been removed; use FS.mkdir instead'); - }, - createLink() { - abort('FS.createLink has been removed; use FS.symlink instead'); - }, - joinPath() { - abort('FS.joinPath has been removed; use PATH.join instead'); - }, - mmapAlloc() { - abort('FS.mmapAlloc has been replaced by the top level function mmapAlloc'); - }, - standardizePath() { - abort('FS.standardizePath has been removed; use PATH.normalize instead'); - }, - }; - - var SYSCALLS = { - calculateAt(dirfd, path, allowEmpty) { - if (PATH.isAbs(path)) { - return path; - } - // relative path - var dir; - if (dirfd === -100) { - dir = FS.cwd(); - } else { - var dirstream = SYSCALLS.getStreamFromFD(dirfd); - dir = dirstream.path; - } - if (path.length == 0) { - if (!allowEmpty) { - throw new FS.ErrnoError(44);; - } - return dir; - } - return dir + '/' + path; - }, - writeStat(buf, stat) { - HEAPU32[((buf)>>2)] = stat.dev; - HEAPU32[(((buf)+(4))>>2)] = stat.mode; - HEAPU32[(((buf)+(8))>>2)] = stat.nlink; - HEAPU32[(((buf)+(12))>>2)] = stat.uid; - HEAPU32[(((buf)+(16))>>2)] = stat.gid; - HEAPU32[(((buf)+(20))>>2)] = stat.rdev; - HEAP64[(((buf)+(24))>>3)] = BigInt(stat.size); - HEAP32[(((buf)+(32))>>2)] = 4096; - HEAP32[(((buf)+(36))>>2)] = stat.blocks; - var atime = stat.atime.getTime(); - var mtime = stat.mtime.getTime(); - var ctime = stat.ctime.getTime(); - HEAP64[(((buf)+(40))>>3)] = BigInt(Math.floor(atime / 1000)); - HEAPU32[(((buf)+(48))>>2)] = (atime % 1000) * 1000 * 1000; - HEAP64[(((buf)+(56))>>3)] = BigInt(Math.floor(mtime / 1000)); - HEAPU32[(((buf)+(64))>>2)] = (mtime % 1000) * 1000 * 1000; - HEAP64[(((buf)+(72))>>3)] = BigInt(Math.floor(ctime / 1000)); - HEAPU32[(((buf)+(80))>>2)] = (ctime % 1000) * 1000 * 1000; - HEAP64[(((buf)+(88))>>3)] = BigInt(stat.ino); - return 0; - }, - writeStatFs(buf, stats) { - HEAPU32[(((buf)+(4))>>2)] = stats.bsize; - HEAPU32[(((buf)+(60))>>2)] = stats.bsize; - HEAP64[(((buf)+(8))>>3)] = BigInt(stats.blocks); - HEAP64[(((buf)+(16))>>3)] = BigInt(stats.bfree); - HEAP64[(((buf)+(24))>>3)] = BigInt(stats.bavail); - HEAP64[(((buf)+(32))>>3)] = BigInt(stats.files); - HEAP64[(((buf)+(40))>>3)] = BigInt(stats.ffree); - HEAPU32[(((buf)+(48))>>2)] = stats.fsid; - HEAPU32[(((buf)+(64))>>2)] = stats.flags; // ST_NOSUID - HEAPU32[(((buf)+(56))>>2)] = stats.namelen; - }, - doMsync(addr, stream, len, flags, offset) { - if (!FS.isFile(stream.node.mode)) { - throw new FS.ErrnoError(43); - } - if (flags & 2) { - // MAP_PRIVATE calls need not to be synced back to underlying fs - return 0; - } - var buffer = HEAPU8.slice(addr, addr + len); - FS.msync(stream, buffer, offset, len, flags); - }, - getStreamFromFD(fd) { - var stream = FS.getStreamChecked(fd); - return stream; - }, - varargs:undefined, - getStr(ptr) { - var ret = UTF8ToString(ptr); - return ret; - }, - }; - function ___syscall_dup(fd) { - try { - - var old = SYSCALLS.getStreamFromFD(fd); - return FS.dupStream(old).fd; - } catch (e) { - if (typeof FS == 'undefined' || !(e.name === 'ErrnoError')) throw e; - return -e.errno; - } - } - - function ___syscall_fstat64(fd, buf) { - try { - - return SYSCALLS.writeStat(buf, FS.fstat(fd)); - } catch (e) { - if (typeof FS == 'undefined' || !(e.name === 'ErrnoError')) throw e; - return -e.errno; - } - } - - function ___syscall_lstat64(path, buf) { - try { - - path = SYSCALLS.getStr(path); - return SYSCALLS.writeStat(buf, FS.lstat(path)); - } catch (e) { - if (typeof FS == 'undefined' || !(e.name === 'ErrnoError')) throw e; - return -e.errno; - } - } - - function ___syscall_mkdirat(dirfd, path, mode) { - try { - - path = SYSCALLS.getStr(path); - path = SYSCALLS.calculateAt(dirfd, path); - FS.mkdir(path, mode, 0); - return 0; - } catch (e) { - if (typeof FS == 'undefined' || !(e.name === 'ErrnoError')) throw e; - return -e.errno; - } - } - - function ___syscall_newfstatat(dirfd, path, buf, flags) { - try { - - path = SYSCALLS.getStr(path); - var nofollow = flags & 256; - var allowEmpty = flags & 4096; - flags = flags & (~6400); - assert(!flags, `unknown flags in __syscall_newfstatat: ${flags}`); - path = SYSCALLS.calculateAt(dirfd, path, allowEmpty); - return SYSCALLS.writeStat(buf, nofollow ? FS.lstat(path) : FS.stat(path)); - } catch (e) { - if (typeof FS == 'undefined' || !(e.name === 'ErrnoError')) throw e; - return -e.errno; - } - } - - var syscallGetVarargI = () => { - assert(SYSCALLS.varargs != undefined); - // the `+` prepended here is necessary to convince the JSCompiler that varargs is indeed a number. - var ret = HEAP32[((+SYSCALLS.varargs)>>2)]; - SYSCALLS.varargs += 4; - return ret; - }; - - function ___syscall_openat(dirfd, path, flags, varargs) { - SYSCALLS.varargs = varargs; - try { - - path = SYSCALLS.getStr(path); - path = SYSCALLS.calculateAt(dirfd, path); - var mode = varargs ? syscallGetVarargI() : 0; - return FS.open(path, flags, mode).fd; - } catch (e) { - if (typeof FS == 'undefined' || !(e.name === 'ErrnoError')) throw e; - return -e.errno; - } - } - - function ___syscall_stat64(path, buf) { - try { - - path = SYSCALLS.getStr(path); - return SYSCALLS.writeStat(buf, FS.stat(path)); - } catch (e) { - if (typeof FS == 'undefined' || !(e.name === 'ErrnoError')) throw e; - return -e.errno; - } - } - - var __abort_js = () => - abort('native code called abort()'); - - var getExecutableName = () => thisProgram || './this.program'; - - var stringToUTF8 = (str, outPtr, maxBytesToWrite) => { - assert(typeof maxBytesToWrite == 'number', 'stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!'); - return stringToUTF8Array(str, HEAPU8, outPtr, maxBytesToWrite); - }; - var __emscripten_get_progname = (str, len) => stringToUTF8(getExecutableName(), str, len); - - - - var stringToNewUTF8 = (str) => { - var size = lengthBytesUTF8(str) + 1; - var ret = _malloc(size); - if (ret) stringToUTF8(str, ret, size); - return ret; - }; - - - var __emscripten_sanitizer_get_option = (name) => stringToNewUTF8(Module[UTF8ToString(name)] || ''); - - var __emscripten_sanitizer_use_colors = () => { - var setting = Module['printWithColors']; - if (setting !== undefined) { - return setting; - } - return ENVIRONMENT_IS_NODE && process.stderr.isTTY; - }; - - var isLeapYear = (year) => year%4 === 0 && (year%100 !== 0 || year%400 === 0); - - var MONTH_DAYS_LEAP_CUMULATIVE = [0,31,60,91,121,152,182,213,244,274,305,335]; - - var MONTH_DAYS_REGULAR_CUMULATIVE = [0,31,59,90,120,151,181,212,243,273,304,334]; - var ydayFromDate = (date) => { - var leap = isLeapYear(date.getFullYear()); - var monthDaysCumulative = (leap ? MONTH_DAYS_LEAP_CUMULATIVE : MONTH_DAYS_REGULAR_CUMULATIVE); - var yday = monthDaysCumulative[date.getMonth()] + date.getDate() - 1; // -1 since it's days since Jan 1 - - return yday; - }; - - var INT53_MAX = 9007199254740992; - - var INT53_MIN = -9007199254740992; - var bigintToI53Checked = (num) => (num < INT53_MIN || num > INT53_MAX) ? NaN : Number(num); - function __localtime_js(time, tmPtr) { - time = bigintToI53Checked(time); - - - var date = new Date(time*1000); - HEAP32[((tmPtr)>>2)] = date.getSeconds(); - HEAP32[(((tmPtr)+(4))>>2)] = date.getMinutes(); - HEAP32[(((tmPtr)+(8))>>2)] = date.getHours(); - HEAP32[(((tmPtr)+(12))>>2)] = date.getDate(); - HEAP32[(((tmPtr)+(16))>>2)] = date.getMonth(); - HEAP32[(((tmPtr)+(20))>>2)] = date.getFullYear()-1900; - HEAP32[(((tmPtr)+(24))>>2)] = date.getDay(); - - var yday = ydayFromDate(date)|0; - HEAP32[(((tmPtr)+(28))>>2)] = yday; - HEAP32[(((tmPtr)+(36))>>2)] = -(date.getTimezoneOffset() * 60); - - // Attention: DST is in December in South, and some regions don't have DST at all. - var start = new Date(date.getFullYear(), 0, 1); - var summerOffset = new Date(date.getFullYear(), 6, 1).getTimezoneOffset(); - var winterOffset = start.getTimezoneOffset(); - var dst = (summerOffset != winterOffset && date.getTimezoneOffset() == Math.min(winterOffset, summerOffset))|0; - HEAP32[(((tmPtr)+(32))>>2)] = dst; - ; - } - - - - - - - function __mmap_js(len, prot, flags, fd, offset, allocated, addr) { - offset = bigintToI53Checked(offset); - - - try { - - // musl's mmap doesn't allow values over a certain limit - // see OFF_MASK in mmap.c. - assert(!isNaN(offset)); - var stream = SYSCALLS.getStreamFromFD(fd); - var res = FS.mmap(stream, len, offset, prot, flags); - var ptr = res.ptr; - HEAP32[((allocated)>>2)] = res.allocated; - HEAPU32[((addr)>>2)] = ptr; - return 0; - } catch (e) { - if (typeof FS == 'undefined' || !(e.name === 'ErrnoError')) throw e; - return -e.errno; - } - ; - } - - - function __munmap_js(addr, len, prot, flags, fd, offset) { - offset = bigintToI53Checked(offset); - - - try { - - var stream = SYSCALLS.getStreamFromFD(fd); - if (prot & 2) { - SYSCALLS.doMsync(addr, stream, len, flags, offset); - } - } catch (e) { - if (typeof FS == 'undefined' || !(e.name === 'ErrnoError')) throw e; - return -e.errno; - } - ; - } - - - var __tzset_js = (timezone, daylight, std_name, dst_name) => { - // TODO: Use (malleable) environment variables instead of system settings. - var currentYear = new Date().getFullYear(); - var winter = new Date(currentYear, 0, 1); - var summer = new Date(currentYear, 6, 1); - var winterOffset = winter.getTimezoneOffset(); - var summerOffset = summer.getTimezoneOffset(); - - // Local standard timezone offset. Local standard time is not adjusted for - // daylight savings. This code uses the fact that getTimezoneOffset returns - // a greater value during Standard Time versus Daylight Saving Time (DST). - // Thus it determines the expected output during Standard Time, and it - // compares whether the output of the given date the same (Standard) or less - // (DST). - var stdTimezoneOffset = Math.max(winterOffset, summerOffset); - - // timezone is specified as seconds west of UTC ("The external variable - // `timezone` shall be set to the difference, in seconds, between - // Coordinated Universal Time (UTC) and local standard time."), the same - // as returned by stdTimezoneOffset. - // See http://pubs.opengroup.org/onlinepubs/009695399/functions/tzset.html - HEAPU32[((timezone)>>2)] = stdTimezoneOffset * 60; - - HEAP32[((daylight)>>2)] = Number(winterOffset != summerOffset); - - var extractZone = (timezoneOffset) => { - // Why inverse sign? - // Read here https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getTimezoneOffset - var sign = timezoneOffset >= 0 ? "-" : "+"; - - var absOffset = Math.abs(timezoneOffset) - var hours = String(Math.floor(absOffset / 60)).padStart(2, "0"); - var minutes = String(absOffset % 60).padStart(2, "0"); - - return `UTC${sign}${hours}${minutes}`; - } - - var winterName = extractZone(winterOffset); - var summerName = extractZone(summerOffset); - assert(winterName); - assert(summerName); - assert(lengthBytesUTF8(winterName) <= 16, `timezone name truncated to fit in TZNAME_MAX (${winterName})`); - assert(lengthBytesUTF8(summerName) <= 16, `timezone name truncated to fit in TZNAME_MAX (${summerName})`); - if (summerOffset < winterOffset) { - // Northern hemisphere - stringToUTF8(winterName, std_name, 17); - stringToUTF8(summerName, dst_name, 17); - } else { - stringToUTF8(winterName, dst_name, 17); - stringToUTF8(summerName, std_name, 17); - } - }; - - var _emscripten_get_now = () => performance.now(); - - var _emscripten_date_now = () => Date.now(); - - var nowIsMonotonic = 1; - - var checkWasiClock = (clock_id) => clock_id >= 0 && clock_id <= 3; - - function _clock_time_get(clk_id, ignored_precision, ptime) { - ignored_precision = bigintToI53Checked(ignored_precision); - - - if (!checkWasiClock(clk_id)) { - return 28; - } - var now; - // all wasi clocks but realtime are monotonic - if (clk_id === 0) { - now = _emscripten_date_now(); - } else if (nowIsMonotonic) { - now = _emscripten_get_now(); - } else { - return 52; - } - // "now" is in ms, and wasi times are in ns. - var nsec = Math.round(now * 1000 * 1000); - HEAP64[((ptime)>>3)] = BigInt(nsec); - return 0; - ; - } - - - var getHeapMax = () => - // Stay one Wasm page short of 4GB: while e.g. Chrome is able to allocate - // full 4GB Wasm memories, the size will wrap back to 0 bytes in Wasm side - // for any code that deals with heap sizes, which would require special - // casing all heap size related code to treat 0 specially. - 2147483648; - var _emscripten_get_heap_max = () => getHeapMax(); - - - var UNWIND_CACHE = { - }; - var convertPCtoSourceLocation = (pc) => { - if (UNWIND_CACHE.last_get_source_pc == pc) return UNWIND_CACHE.last_source; - - var match; - var source; - if (wasmSourceMap) { - source = wasmSourceMap.lookup(pc); - } - - if (!source) { - var frame = UNWIND_CACHE[pc]; - if (!frame) return null; - // Example: at callMain (a.out.js:6335:22) - if (match = /\((.*):(\d+):(\d+)\)$/.exec(frame)) { - source = {file: match[1], line: match[2], column: match[3]}; - // Example: main@a.out.js:1337:42 - } else if (match = /@(.*):(\d+):(\d+)/.exec(frame)) { - source = {file: match[1], line: match[2], column: match[3]}; - } - } - UNWIND_CACHE.last_get_source_pc = pc; - UNWIND_CACHE.last_source = source; - return source; - }; - var _emscripten_pc_get_column = (pc) => { - var result = convertPCtoSourceLocation(pc); - return result ? result.column || 0 : 0; - }; - - - - - - /** @suppress{checkTypes} */ - var noLeakCheck = (func) => { - if (runtimeInitialized) ___lsan_disable(); - try { - return func(); - } finally { - if (runtimeInitialized) ___lsan_enable(); - } - }; - var _emscripten_pc_get_file = (pc) => noLeakCheck(() => { - var result = convertPCtoSourceLocation(pc); - if (!result) return 0; - - _free(_emscripten_pc_get_file.ret ?? 0); - _emscripten_pc_get_file.ret = stringToNewUTF8(result.file); - return _emscripten_pc_get_file.ret; - }); - - - - - /** @returns {number} */ - var convertFrameToPC = (frame) => { - var match; - - if (match = /\bwasm-function\[\d+\]:(0x[0-9a-f]+)/.exec(frame)) { - // Wasm engines give the binary offset directly, so we use that as return address - return +match[1]; - } else if (match = /\bwasm-function\[(\d+)\]:(\d+)/.exec(frame)) { - // Older versions of v8 (e.g node v10) give function index and offset in - // the function. That format is not supported since it does not provide - // the information we need to map the frame to a global program counter. - warnOnce('legacy backtrace format detected, this version of v8 is no longer supported by the emscripten backtrace mechanism') - } else if (match = /:(\d+):\d+(?:\)|$)/.exec(frame)) { - // If we are in js, we can use the js line number as the "return address". - // This should work for wasm2js. We tag the high bit to distinguish this - // from wasm addresses. - return 0x80000000 | +match[1]; - } - // return 0 if we can't find any - return 0; - }; - - - - var saveInUnwindCache = (callstack) => { - for (var line of callstack) { - var pc = convertFrameToPC(line); - if (pc) { - UNWIND_CACHE[pc] = line; - } - } - }; - - var jsStackTrace = () => new Error().stack.toString(); - var _emscripten_stack_snapshot = () => { - var callstack = jsStackTrace().split('\n'); - if (callstack[0] == 'Error') { - callstack.shift(); - } - saveInUnwindCache(callstack); - - // Caches the stack snapshot so that emscripten_stack_unwind_buffer() can - // unwind from this spot. - UNWIND_CACHE.last_addr = convertFrameToPC(callstack[3]); - UNWIND_CACHE.last_stack = callstack; - return UNWIND_CACHE.last_addr; - }; - - var _emscripten_pc_get_function = (pc) => noLeakCheck(() => { - var frame = UNWIND_CACHE[pc]; - if (!frame) return 0; - - var name; - var match; - // First try to match foo.wasm.sym files explcitly. e.g. - // - // at test_return_address.wasm.main (wasm://wasm/test_return_address.wasm-0012cc2a:wasm-function[26]:0x9f3 - // - // Then match JS symbols which don't include that module name: - // - // at invokeEntryPoint (.../test_return_address.js:1500:42) - // - // Finally match firefox format: - // - // Object._main@http://server.com:4324:12' - if (match = /^\s+at .*\.wasm\.(.*) \(.*\)$/.exec(frame)) { - name = match[1]; - } else if (match = /^\s+at (.*) \(.*\)$/.exec(frame)) { - name = match[1]; - } else if (match = /^(.+?)@/.exec(frame)) { - name = match[1]; - } else { - return 0; - } - - _free(_emscripten_pc_get_function.ret ?? 0); - _emscripten_pc_get_function.ret = stringToNewUTF8(name); - return _emscripten_pc_get_function.ret; - }); - - var _emscripten_pc_get_line = (pc) => { - var result = convertPCtoSourceLocation(pc); - return result ? result.line : 0; - }; - - - - var growMemory = (size) => { - var oldHeapSize = wasmMemory.buffer.byteLength; - var pages = ((size - oldHeapSize + 65535) / 65536) | 0; - try { - // round size grow request up to wasm page size (fixed 64KB per spec) - wasmMemory.grow(pages); // .grow() takes a delta compared to the previous size - updateMemoryViews(); - return 1 /*success*/; - } catch(e) { - err(`growMemory: Attempted to grow heap from ${oldHeapSize} bytes to ${size} bytes, but got error: ${e}`); - } - // implicit 0 return to save code size (caller will cast "undefined" into 0 - // anyhow) - }; - var _emscripten_resize_heap = (requestedSize) => { - var oldSize = HEAPU8.length; - // With CAN_ADDRESS_2GB or MEMORY64, pointers are already unsigned. - requestedSize >>>= 0; - // With multithreaded builds, races can happen (another thread might increase the size - // in between), so return a failure, and let the caller retry. - assert(requestedSize > oldSize); - - // Memory resize rules: - // 1. Always increase heap size to at least the requested size, rounded up - // to next page multiple. - // 2a. If MEMORY_GROWTH_LINEAR_STEP == -1, excessively resize the heap - // geometrically: increase the heap size according to - // MEMORY_GROWTH_GEOMETRIC_STEP factor (default +20%), At most - // overreserve by MEMORY_GROWTH_GEOMETRIC_CAP bytes (default 96MB). - // 2b. If MEMORY_GROWTH_LINEAR_STEP != -1, excessively resize the heap - // linearly: increase the heap size by at least - // MEMORY_GROWTH_LINEAR_STEP bytes. - // 3. Max size for the heap is capped at 2048MB-WASM_PAGE_SIZE, or by - // MAXIMUM_MEMORY, or by ASAN limit, depending on which is smallest - // 4. If we were unable to allocate as much memory, it may be due to - // over-eager decision to excessively reserve due to (3) above. - // Hence if an allocation fails, cut down on the amount of excess - // growth, in an attempt to succeed to perform a smaller allocation. - - // A limit is set for how much we can grow. We should not exceed that - // (the wasm binary specifies it, so if we tried, we'd fail anyhow). - var maxHeapSize = getHeapMax(); - if (requestedSize > maxHeapSize) { - err(`Cannot enlarge memory, requested ${requestedSize} bytes, but the limit is ${maxHeapSize} bytes!`); - return false; - } - - // Loop through potential heap size increases. If we attempt a too eager - // reservation that fails, cut down on the attempted size and reserve a - // smaller bump instead. (max 3 times, chosen somewhat arbitrarily) - for (var cutDown = 1; cutDown <= 4; cutDown *= 2) { - var overGrownHeapSize = oldSize * (1 + 0.2 / cutDown); // ensure geometric growth - // but limit overreserving (default to capping at +96MB overgrowth at most) - overGrownHeapSize = Math.min(overGrownHeapSize, requestedSize + 100663296 ); - - var newSize = Math.min(maxHeapSize, alignMemory(Math.max(requestedSize, overGrownHeapSize), 65536)); - - var replacement = growMemory(newSize); - if (replacement) { - - return true; - } - } - err(`Failed to grow the heap from ${oldSize} bytes to ${newSize} bytes, not enough memory!`); - return false; - }; - - - - - - var _emscripten_stack_unwind_buffer = (addr, buffer, count) => { - var stack; - if (UNWIND_CACHE.last_addr == addr) { - stack = UNWIND_CACHE.last_stack; - } else { - stack = jsStackTrace().split('\n'); - if (stack[0] == 'Error') { - stack.shift(); - } - saveInUnwindCache(stack); - } - - var offset = 3; - while (stack[offset] && convertFrameToPC(stack[offset]) != addr) { - ++offset; - } - - for (var i = 0; i < count && stack[i+offset]; ++i) { - HEAP32[(((buffer)+(i*4))>>2)] = convertFrameToPC(stack[i + offset]); - } - return i; - }; - - var ENV = { - }; - - var getEnvStrings = () => { - if (!getEnvStrings.strings) { - // Default values. - // Browser language detection #8751 - var lang = (globalThis.navigator?.language ?? 'C').replace('-', '_') + '.UTF-8'; - var env = { - 'USER': 'web_user', - 'LOGNAME': 'web_user', - 'PATH': '/', - 'PWD': '/', - 'HOME': '/home/web_user', - 'LANG': lang, - '_': getExecutableName() - }; - // Apply the user-provided values, if any. - for (var x in ENV) { - // x is a key in ENV; if ENV[x] is undefined, that means it was - // explicitly set to be so. We allow user code to do that to - // force variables with default values to remain unset. - if (ENV[x] === undefined) delete env[x]; - else env[x] = ENV[x]; - } - var strings = []; - for (var x in env) { - strings.push(`${x}=${env[x]}`); - } - getEnvStrings.strings = strings; - } - return getEnvStrings.strings; - }; - - var _environ_get = (__environ, environ_buf) => { - var bufSize = 0; - var envp = 0; - for (var string of getEnvStrings()) { - var ptr = environ_buf + bufSize; - HEAPU32[(((__environ)+(envp))>>2)] = ptr; - bufSize += stringToUTF8(string, ptr, Infinity) + 1; - envp += 4; - } - return 0; - }; - - - var _environ_sizes_get = (penviron_count, penviron_buf_size) => { - var strings = getEnvStrings(); - HEAPU32[((penviron_count)>>2)] = strings.length; - var bufSize = 0; - for (var string of strings) { - bufSize += lengthBytesUTF8(string) + 1; - } - HEAPU32[((penviron_buf_size)>>2)] = bufSize; - return 0; - }; - - function _fd_close(fd) { - try { - - var stream = SYSCALLS.getStreamFromFD(fd); - FS.close(stream); - return 0; - } catch (e) { - if (typeof FS == 'undefined' || !(e.name === 'ErrnoError')) throw e; - return e.errno; - } - } - - /** @param {number=} offset */ - var doReadv = (stream, iov, iovcnt, offset) => { - var ret = 0; - for (var i = 0; i < iovcnt; i++) { - var ptr = HEAPU32[((iov)>>2)]; - var len = HEAPU32[(((iov)+(4))>>2)]; - iov += 8; - var curr = FS.read(stream, HEAP8, ptr, len, offset); - if (curr < 0) return -1; - ret += curr; - if (curr < len) break; // nothing more to read - if (typeof offset != 'undefined') { - offset += curr; - } - } - return ret; - }; - - function _fd_read(fd, iov, iovcnt, pnum) { - try { - - var stream = SYSCALLS.getStreamFromFD(fd); - var num = doReadv(stream, iov, iovcnt); - HEAPU32[((pnum)>>2)] = num; - return 0; - } catch (e) { - if (typeof FS == 'undefined' || !(e.name === 'ErrnoError')) throw e; - return e.errno; - } - } - - - function _fd_seek(fd, offset, whence, newOffset) { - offset = bigintToI53Checked(offset); - - - try { - - if (isNaN(offset)) return 61; - var stream = SYSCALLS.getStreamFromFD(fd); - FS.llseek(stream, offset, whence); - HEAP64[((newOffset)>>3)] = BigInt(stream.position); - if (stream.getdents && offset === 0 && whence === 0) stream.getdents = null; // reset readdir state - return 0; - } catch (e) { - if (typeof FS == 'undefined' || !(e.name === 'ErrnoError')) throw e; - return e.errno; - } - ; - } - - /** @param {number=} offset */ - var doWritev = (stream, iov, iovcnt, offset) => { - var ret = 0; - for (var i = 0; i < iovcnt; i++) { - var ptr = HEAPU32[((iov)>>2)]; - var len = HEAPU32[(((iov)+(4))>>2)]; - iov += 8; - var curr = FS.write(stream, HEAP8, ptr, len, offset); - if (curr < 0) return -1; - ret += curr; - if (curr < len) { - // No more space to write. - break; - } - if (typeof offset != 'undefined') { - offset += curr; - } - } - return ret; - }; - - function _fd_write(fd, iov, iovcnt, pnum) { - try { - - var stream = SYSCALLS.getStreamFromFD(fd); - var num = doWritev(stream, iov, iovcnt); - HEAPU32[((pnum)>>2)] = num; - return 0; - } catch (e) { - if (typeof FS == 'undefined' || !(e.name === 'ErrnoError')) throw e; - return e.errno; - } - } - - - var runtimeKeepaliveCounter = 0; - var keepRuntimeAlive = () => noExitRuntime || runtimeKeepaliveCounter > 0; - var _proc_exit = (code) => { - EXITSTATUS = code; - if (!keepRuntimeAlive()) { - Module['onExit']?.(code); - ABORT = true; - } - quit_(code, new ExitStatus(code)); - }; - - var getCFunc = (ident) => { - var func = Module['_' + ident]; // closure exported function - assert(func, 'Cannot call unknown function ' + ident + ', make sure it is exported'); - return func; - }; - - var writeArrayToMemory = (array, buffer) => { - assert(array.length >= 0, 'writeArrayToMemory array must have a length (should be an array or typed array)') - HEAP8.set(array, buffer); - }; - - - - var stackAlloc = (sz) => __emscripten_stack_alloc(sz); - var stringToUTF8OnStack = (str) => { - var size = lengthBytesUTF8(str) + 1; - var ret = stackAlloc(size); - stringToUTF8(str, ret, size); - return ret; - }; - - - - - - /** - * @param {string|null=} returnType - * @param {Array=} argTypes - * @param {Array=} args - * @param {Object=} opts - */ - var ccall = (ident, returnType, argTypes, args, opts) => { - // For fast lookup of conversion functions - var toC = { - 'string': (str) => { - var ret = 0; - if (str !== null && str !== undefined && str !== 0) { // null string - ret = stringToUTF8OnStack(str); - } - return ret; - }, - 'array': (arr) => { - var ret = stackAlloc(arr.length); - writeArrayToMemory(arr, ret); - return ret; - } - }; - - function convertReturnValue(ret) { - if (returnType === 'string') { - return UTF8ToString(ret); - } - if (returnType === 'boolean') return Boolean(ret); - return ret; - } - - var func = getCFunc(ident); - var cArgs = []; - var stack = 0; - assert(returnType !== 'array', 'Return type should not be "array".'); - if (args) { - for (var i = 0; i < args.length; i++) { - var converter = toC[argTypes[i]]; - if (converter) { - if (stack === 0) stack = stackSave(); - cArgs[i] = converter(args[i]); - } else { - cArgs[i] = args[i]; - } - } - } - var ret = func(...cArgs); - function onDone(ret) { - if (stack !== 0) stackRestore(stack); - return convertReturnValue(ret); - } - - ret = onDone(ret); - return ret; - }; - - /** - * @param {string=} returnType - * @param {Array=} argTypes - * @param {Object=} opts - */ - var cwrap = (ident, returnType, argTypes, opts) => { - return (...args) => ccall(ident, returnType, argTypes, args, opts); - }; - - - - - FS.createPreloadedFile = FS_createPreloadedFile; - FS.preloadFile = FS_preloadFile; - FS.staticInit();; -// End JS library code - -// include: postlibrary.js -// This file is included after the automatically-generated JS library code -// but before the wasm module is created. - -{ - // With WASM_ESM_INTEGRATION this has to happen at the top level and not - // delayed until processModuleArgs. - initMemory(); - - // Begin ATMODULES hooks - if (Module['noExitRuntime']) noExitRuntime = Module['noExitRuntime']; -if (Module['preloadPlugins']) preloadPlugins = Module['preloadPlugins']; -if (Module['print']) out = Module['print']; -if (Module['printErr']) err = Module['printErr']; -if (Module['wasmBinary']) wasmBinary = Module['wasmBinary']; - // End ATMODULES hooks - - checkIncomingModuleAPI(); - - if (Module['arguments']) arguments_ = Module['arguments']; - if (Module['thisProgram']) thisProgram = Module['thisProgram']; - - // Assertions on removed incoming Module JS APIs. - assert(typeof Module['memoryInitializerPrefixURL'] == 'undefined', 'Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead'); - assert(typeof Module['pthreadMainPrefixURL'] == 'undefined', 'Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead'); - assert(typeof Module['cdInitializerPrefixURL'] == 'undefined', 'Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead'); - assert(typeof Module['filePackagePrefixURL'] == 'undefined', 'Module.filePackagePrefixURL option was removed, use Module.locateFile instead'); - assert(typeof Module['read'] == 'undefined', 'Module.read option was removed'); - assert(typeof Module['readAsync'] == 'undefined', 'Module.readAsync option was removed (modify readAsync in JS)'); - assert(typeof Module['readBinary'] == 'undefined', 'Module.readBinary option was removed (modify readBinary in JS)'); - assert(typeof Module['setWindowTitle'] == 'undefined', 'Module.setWindowTitle option was removed (modify emscripten_set_window_title in JS)'); - assert(typeof Module['TOTAL_MEMORY'] == 'undefined', 'Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY'); - assert(typeof Module['ENVIRONMENT'] == 'undefined', 'Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)'); - assert(typeof Module['STACK_SIZE'] == 'undefined', 'STACK_SIZE can no longer be set at runtime. Use -sSTACK_SIZE at link time') - - if (Module['preInit']) { - if (typeof Module['preInit'] == 'function') Module['preInit'] = [Module['preInit']]; - while (Module['preInit'].length > 0) { - Module['preInit'].shift()(); - } - } - consumedModuleProp('preInit'); -} - -// Begin runtime exports - Module['cwrap'] = cwrap; - Module['UTF8ToString'] = UTF8ToString; - Module['stringToUTF8'] = stringToUTF8; - Module['lengthBytesUTF8'] = lengthBytesUTF8; - var missingLibrarySymbols = [ - 'writeI53ToI64', - 'writeI53ToI64Clamped', - 'writeI53ToI64Signaling', - 'writeI53ToU64Clamped', - 'writeI53ToU64Signaling', - 'readI53FromI64', - 'readI53FromU64', - 'convertI32PairToI53', - 'convertI32PairToI53Checked', - 'convertU32PairToI53', - 'getTempRet0', - 'setTempRet0', - 'createNamedFunction', - 'exitJS', - 'withStackSave', - 'inetPton4', - 'inetNtop4', - 'inetPton6', - 'inetNtop6', - 'readSockaddr', - 'writeSockaddr', - 'readEmAsmArgs', - 'jstoi_q', - 'autoResumeAudioContext', - 'getDynCaller', - 'dynCall', - 'handleException', - 'runtimeKeepalivePush', - 'runtimeKeepalivePop', - 'callUserCallback', - 'maybeExit', - 'asmjsMangle', - 'HandleAllocator', - 'addOnInit', - 'addOnPostCtor', - 'addOnPreMain', - 'addOnExit', - 'STACK_SIZE', - 'STACK_ALIGN', - 'POINTER_SIZE', - 'ASSERTIONS', - 'convertJsFunctionToWasm', - 'getEmptyTableSlot', - 'updateTableMap', - 'getFunctionAddress', - 'addFunction', - 'removeFunction', - 'intArrayToString', - 'AsciiToString', - 'stringToAscii', - 'UTF16ToString', - 'stringToUTF16', - 'lengthBytesUTF16', - 'UTF32ToString', - 'stringToUTF32', - 'lengthBytesUTF32', - 'registerKeyEventCallback', - 'maybeCStringToJsString', - 'findEventTarget', - 'getBoundingClientRect', - 'fillMouseEventData', - 'registerMouseEventCallback', - 'registerWheelEventCallback', - 'registerUiEventCallback', - 'registerFocusEventCallback', - 'fillDeviceOrientationEventData', - 'registerDeviceOrientationEventCallback', - 'fillDeviceMotionEventData', - 'registerDeviceMotionEventCallback', - 'screenOrientation', - 'fillOrientationChangeEventData', - 'registerOrientationChangeEventCallback', - 'fillFullscreenChangeEventData', - 'registerFullscreenChangeEventCallback', - 'JSEvents_requestFullscreen', - 'JSEvents_resizeCanvasForFullscreen', - 'registerRestoreOldStyle', - 'hideEverythingExceptGivenElement', - 'restoreHiddenElements', - 'setLetterbox', - 'softFullscreenResizeWebGLRenderTarget', - 'doRequestFullscreen', - 'fillPointerlockChangeEventData', - 'registerPointerlockChangeEventCallback', - 'registerPointerlockErrorEventCallback', - 'requestPointerLock', - 'fillVisibilityChangeEventData', - 'registerVisibilityChangeEventCallback', - 'registerTouchEventCallback', - 'fillGamepadEventData', - 'registerGamepadEventCallback', - 'registerBeforeUnloadEventCallback', - 'fillBatteryEventData', - 'registerBatteryEventCallback', - 'setCanvasElementSize', - 'getCanvasElementSize', - 'getCallstack', - 'wasiRightsToMuslOFlags', - 'wasiOFlagsToMuslOFlags', - 'safeSetTimeout', - 'setImmediateWrapped', - 'safeRequestAnimationFrame', - 'clearImmediateWrapped', - 'registerPostMainLoop', - 'registerPreMainLoop', - 'getPromise', - 'makePromise', - 'idsToPromises', - 'makePromiseCallback', - 'Browser_asyncPrepareDataCounter', - 'arraySum', - 'addDays', - 'getSocketFromFD', - 'getSocketAddress', - 'FS_mkdirTree', - '_setNetworkCallback', - 'ALLOC_NORMAL', - 'ALLOC_STACK', - 'allocate', - 'writeStringToMemory', - 'writeAsciiToMemory', - 'allocateUTF8', - 'allocateUTF8OnStack', - 'stackTrace', - 'getNativeTypeSize', -]; -missingLibrarySymbols.forEach(missingLibrarySymbol) - - var unexportedSymbols = [ - 'run', - 'out', - 'err', - 'callMain', - 'abort', - 'wasmExports', - 'HEAPF32', - 'HEAPF64', - 'HEAP16', - 'HEAPU16', - 'HEAP32', - 'HEAPU32', - 'HEAP64', - 'HEAPU64', - 'WasmSourceMap', - 'writeStackCookie', - 'checkStackCookie', - 'INT53_MAX', - 'INT53_MIN', - 'bigintToI53Checked', - 'stackSave', - 'stackRestore', - 'stackAlloc', - 'ptrToString', - 'zeroMemory', - 'getHeapMax', - 'growMemory', - 'ENV', - 'ERRNO_CODES', - 'strError', - 'DNS', - 'Protocols', - 'Sockets', - 'timers', - 'warnOnce', - 'noLeakCheck', - 'readEmAsmArgsArray', - 'getExecutableName', - 'keepRuntimeAlive', - 'asyncLoad', - 'alignMemory', - 'mmapAlloc', - 'wasmTable', - 'wasmMemory', - 'getUniqueRunDependency', - 'noExitRuntime', - 'addRunDependency', - 'removeRunDependency', - 'addOnPreRun', - 'addOnPostRun', - 'ccall', - 'freeTableIndexes', - 'functionsInTableMap', - 'setValue', - 'getValue', - 'PATH', - 'PATH_FS', - 'UTF8Decoder', - 'UTF8ArrayToString', - 'stringToUTF8Array', - 'intArrayFromString', - 'UTF16Decoder', - 'stringToNewUTF8', - 'stringToUTF8OnStack', - 'writeArrayToMemory', - 'JSEvents', - 'specialHTMLTargets', - 'findCanvasEventTarget', - 'currentFullscreenStrategy', - 'restoreOldWindowedStyle', - 'jsStackTrace', - 'UNWIND_CACHE', - 'convertPCtoSourceLocation', - 'ExitStatus', - 'getEnvStrings', - 'checkWasiClock', - 'doReadv', - 'doWritev', - 'initRandomFill', - 'randomFill', - 'emSetImmediate', - 'emClearImmediate_deps', - 'emClearImmediate', - 'promiseMap', - 'Browser', - 'requestFullscreen', - 'requestFullScreen', - 'setCanvasSize', - 'getUserMedia', - 'createContext', - 'getPreloadedImageData__data', - 'wget', - 'MONTH_DAYS_REGULAR', - 'MONTH_DAYS_LEAP', - 'MONTH_DAYS_REGULAR_CUMULATIVE', - 'MONTH_DAYS_LEAP_CUMULATIVE', - 'isLeapYear', - 'ydayFromDate', - 'SYSCALLS', - 'preloadPlugins', - 'FS_createPreloadedFile', - 'FS_preloadFile', - 'FS_modeStringToFlags', - 'FS_getMode', - 'FS_stdin_getChar_buffer', - 'FS_stdin_getChar', - 'FS_unlink', - 'FS_createPath', - 'FS_createDevice', - 'FS_readFile', - 'FS', - 'FS_root', - 'FS_mounts', - 'FS_devices', - 'FS_streams', - 'FS_nextInode', - 'FS_nameTable', - 'FS_currentPath', - 'FS_initialized', - 'FS_ignorePermissions', - 'FS_filesystems', - 'FS_syncFSRequests', - 'FS_lookupPath', - 'FS_getPath', - 'FS_hashName', - 'FS_hashAddNode', - 'FS_hashRemoveNode', - 'FS_lookupNode', - 'FS_createNode', - 'FS_destroyNode', - 'FS_isRoot', - 'FS_isMountpoint', - 'FS_isFile', - 'FS_isDir', - 'FS_isLink', - 'FS_isChrdev', - 'FS_isBlkdev', - 'FS_isFIFO', - 'FS_isSocket', - 'FS_flagsToPermissionString', - 'FS_nodePermissions', - 'FS_mayLookup', - 'FS_mayCreate', - 'FS_mayDelete', - 'FS_mayOpen', - 'FS_checkOpExists', - 'FS_nextfd', - 'FS_getStreamChecked', - 'FS_getStream', - 'FS_createStream', - 'FS_closeStream', - 'FS_dupStream', - 'FS_doSetAttr', - 'FS_chrdev_stream_ops', - 'FS_major', - 'FS_minor', - 'FS_makedev', - 'FS_registerDevice', - 'FS_getDevice', - 'FS_getMounts', - 'FS_syncfs', - 'FS_mount', - 'FS_unmount', - 'FS_lookup', - 'FS_mknod', - 'FS_statfs', - 'FS_statfsStream', - 'FS_statfsNode', - 'FS_create', - 'FS_mkdir', - 'FS_mkdev', - 'FS_symlink', - 'FS_rename', - 'FS_rmdir', - 'FS_readdir', - 'FS_readlink', - 'FS_stat', - 'FS_fstat', - 'FS_lstat', - 'FS_doChmod', - 'FS_chmod', - 'FS_lchmod', - 'FS_fchmod', - 'FS_doChown', - 'FS_chown', - 'FS_lchown', - 'FS_fchown', - 'FS_doTruncate', - 'FS_truncate', - 'FS_ftruncate', - 'FS_utime', - 'FS_open', - 'FS_close', - 'FS_isClosed', - 'FS_llseek', - 'FS_read', - 'FS_write', - 'FS_mmap', - 'FS_msync', - 'FS_ioctl', - 'FS_writeFile', - 'FS_cwd', - 'FS_chdir', - 'FS_createDefaultDirectories', - 'FS_createDefaultDevices', - 'FS_createSpecialDirectories', - 'FS_createStandardStreams', - 'FS_staticInit', - 'FS_init', - 'FS_quit', - 'FS_findObject', - 'FS_analyzePath', - 'FS_createFile', - 'FS_createDataFile', - 'FS_forceLoadFile', - 'FS_createLazyFile', - 'FS_absolutePath', - 'FS_createFolder', - 'FS_createLink', - 'FS_joinPath', - 'FS_mmapAlloc', - 'FS_standardizePath', - 'MEMFS', - 'TTY', - 'PIPEFS', - 'SOCKFS', - 'print', - 'printErr', - 'jstoi_s', -]; -unexportedSymbols.forEach(unexportedRuntimeSymbol); - - // End runtime exports - // Begin JS library exports - // End JS library exports - -// end include: postlibrary.js - -function checkIncomingModuleAPI() { - ignoredModuleProp('fetchSettings'); - ignoredModuleProp('logReadFiles'); - ignoredModuleProp('loadSplitModule'); -} -function qts_host_ref_free(rt,id) { const asyncify = undefined; Module['callbacks']['freeHostRef'](asyncify, rt, id); } -function qts_host_call_function(ctx,this_ptr,argc,argv,host_ref_id) { const asyncify = undefined; return Module['callbacks']['callFunction'](asyncify, ctx, this_ptr, argc, argv, host_ref_id); } -function qts_host_interrupt_handler(rt) { const asyncify = undefined; return Module['callbacks']['shouldInterrupt'](asyncify, rt); } -function qts_host_load_module_source(rt,ctx,module_name) { const asyncify = undefined; const moduleNameString = UTF8ToString(module_name); return Module['callbacks']['loadModuleSource'](asyncify, rt, ctx, moduleNameString); } -function qts_host_normalize_module(rt,ctx,module_base_name,module_name) { const asyncify = undefined; const moduleBaseNameString = UTF8ToString(module_base_name); const moduleNameString = UTF8ToString(module_name); return Module['callbacks']['normalizeModule'](asyncify, rt, ctx, moduleBaseNameString, moduleNameString); } - -// Imports from the Wasm binary. -var _malloc = Module['_malloc'] = makeInvalidEarlyAccess('_malloc'); -var _QTS_Throw = Module['_QTS_Throw'] = makeInvalidEarlyAccess('_QTS_Throw'); -var _QTS_NewError = Module['_QTS_NewError'] = makeInvalidEarlyAccess('_QTS_NewError'); -var _QTS_RuntimeSetMemoryLimit = Module['_QTS_RuntimeSetMemoryLimit'] = makeInvalidEarlyAccess('_QTS_RuntimeSetMemoryLimit'); -var _QTS_RuntimeComputeMemoryUsage = Module['_QTS_RuntimeComputeMemoryUsage'] = makeInvalidEarlyAccess('_QTS_RuntimeComputeMemoryUsage'); -var _QTS_RuntimeDumpMemoryUsage = Module['_QTS_RuntimeDumpMemoryUsage'] = makeInvalidEarlyAccess('_QTS_RuntimeDumpMemoryUsage'); -var _QTS_RecoverableLeakCheck = Module['_QTS_RecoverableLeakCheck'] = makeInvalidEarlyAccess('_QTS_RecoverableLeakCheck'); -var _QTS_BuildIsSanitizeLeak = Module['_QTS_BuildIsSanitizeLeak'] = makeInvalidEarlyAccess('_QTS_BuildIsSanitizeLeak'); -var _QTS_RuntimeSetMaxStackSize = Module['_QTS_RuntimeSetMaxStackSize'] = makeInvalidEarlyAccess('_QTS_RuntimeSetMaxStackSize'); -var _QTS_GetUndefined = Module['_QTS_GetUndefined'] = makeInvalidEarlyAccess('_QTS_GetUndefined'); -var _QTS_GetNull = Module['_QTS_GetNull'] = makeInvalidEarlyAccess('_QTS_GetNull'); -var _QTS_GetFalse = Module['_QTS_GetFalse'] = makeInvalidEarlyAccess('_QTS_GetFalse'); -var _QTS_GetTrue = Module['_QTS_GetTrue'] = makeInvalidEarlyAccess('_QTS_GetTrue'); -var _QTS_NewHostRef = Module['_QTS_NewHostRef'] = makeInvalidEarlyAccess('_QTS_NewHostRef'); -var _QTS_GetHostRefId = Module['_QTS_GetHostRefId'] = makeInvalidEarlyAccess('_QTS_GetHostRefId'); -var _QTS_NewRuntime = Module['_QTS_NewRuntime'] = makeInvalidEarlyAccess('_QTS_NewRuntime'); -var _QTS_FreeRuntime = Module['_QTS_FreeRuntime'] = makeInvalidEarlyAccess('_QTS_FreeRuntime'); -var _free = Module['_free'] = makeInvalidEarlyAccess('_free'); -var _QTS_NewContext = Module['_QTS_NewContext'] = makeInvalidEarlyAccess('_QTS_NewContext'); -var _QTS_FreeContext = Module['_QTS_FreeContext'] = makeInvalidEarlyAccess('_QTS_FreeContext'); -var _QTS_FreeValuePointer = Module['_QTS_FreeValuePointer'] = makeInvalidEarlyAccess('_QTS_FreeValuePointer'); -var _QTS_FreeValuePointerRuntime = Module['_QTS_FreeValuePointerRuntime'] = makeInvalidEarlyAccess('_QTS_FreeValuePointerRuntime'); -var _QTS_FreeVoidPointer = Module['_QTS_FreeVoidPointer'] = makeInvalidEarlyAccess('_QTS_FreeVoidPointer'); -var _QTS_FreeCString = Module['_QTS_FreeCString'] = makeInvalidEarlyAccess('_QTS_FreeCString'); -var _QTS_DupValuePointer = Module['_QTS_DupValuePointer'] = makeInvalidEarlyAccess('_QTS_DupValuePointer'); -var _QTS_NewObject = Module['_QTS_NewObject'] = makeInvalidEarlyAccess('_QTS_NewObject'); -var _QTS_NewObjectProto = Module['_QTS_NewObjectProto'] = makeInvalidEarlyAccess('_QTS_NewObjectProto'); -var _QTS_NewArray = Module['_QTS_NewArray'] = makeInvalidEarlyAccess('_QTS_NewArray'); -var _QTS_NewArrayBuffer = Module['_QTS_NewArrayBuffer'] = makeInvalidEarlyAccess('_QTS_NewArrayBuffer'); -var _QTS_NewFloat64 = Module['_QTS_NewFloat64'] = makeInvalidEarlyAccess('_QTS_NewFloat64'); -var _QTS_GetFloat64 = Module['_QTS_GetFloat64'] = makeInvalidEarlyAccess('_QTS_GetFloat64'); -var _QTS_NewString = Module['_QTS_NewString'] = makeInvalidEarlyAccess('_QTS_NewString'); -var _QTS_GetString = Module['_QTS_GetString'] = makeInvalidEarlyAccess('_QTS_GetString'); -var _QTS_GetArrayBuffer = Module['_QTS_GetArrayBuffer'] = makeInvalidEarlyAccess('_QTS_GetArrayBuffer'); -var _QTS_GetArrayBufferLength = Module['_QTS_GetArrayBufferLength'] = makeInvalidEarlyAccess('_QTS_GetArrayBufferLength'); -var _QTS_NewSymbol = Module['_QTS_NewSymbol'] = makeInvalidEarlyAccess('_QTS_NewSymbol'); -var _QTS_GetSymbolDescriptionOrKey = Module['_QTS_GetSymbolDescriptionOrKey'] = makeInvalidEarlyAccess('_QTS_GetSymbolDescriptionOrKey'); -var _QTS_IsGlobalSymbol = Module['_QTS_IsGlobalSymbol'] = makeInvalidEarlyAccess('_QTS_IsGlobalSymbol'); -var _QTS_IsJobPending = Module['_QTS_IsJobPending'] = makeInvalidEarlyAccess('_QTS_IsJobPending'); -var _QTS_ExecutePendingJob = Module['_QTS_ExecutePendingJob'] = makeInvalidEarlyAccess('_QTS_ExecutePendingJob'); -var _QTS_GetProp = Module['_QTS_GetProp'] = makeInvalidEarlyAccess('_QTS_GetProp'); -var _QTS_GetPropNumber = Module['_QTS_GetPropNumber'] = makeInvalidEarlyAccess('_QTS_GetPropNumber'); -var _QTS_SetProp = Module['_QTS_SetProp'] = makeInvalidEarlyAccess('_QTS_SetProp'); -var _QTS_DefineProp = Module['_QTS_DefineProp'] = makeInvalidEarlyAccess('_QTS_DefineProp'); -var _QTS_GetOwnPropertyNames = Module['_QTS_GetOwnPropertyNames'] = makeInvalidEarlyAccess('_QTS_GetOwnPropertyNames'); -var _QTS_Call = Module['_QTS_Call'] = makeInvalidEarlyAccess('_QTS_Call'); -var _QTS_ResolveException = Module['_QTS_ResolveException'] = makeInvalidEarlyAccess('_QTS_ResolveException'); -var _QTS_Dump = Module['_QTS_Dump'] = makeInvalidEarlyAccess('_QTS_Dump'); -var _QTS_Eval = Module['_QTS_Eval'] = makeInvalidEarlyAccess('_QTS_Eval'); -var _QTS_GetModuleNamespace = Module['_QTS_GetModuleNamespace'] = makeInvalidEarlyAccess('_QTS_GetModuleNamespace'); -var _QTS_Typeof = Module['_QTS_Typeof'] = makeInvalidEarlyAccess('_QTS_Typeof'); -var _QTS_GetLength = Module['_QTS_GetLength'] = makeInvalidEarlyAccess('_QTS_GetLength'); -var _QTS_IsEqual = Module['_QTS_IsEqual'] = makeInvalidEarlyAccess('_QTS_IsEqual'); -var _QTS_GetGlobalObject = Module['_QTS_GetGlobalObject'] = makeInvalidEarlyAccess('_QTS_GetGlobalObject'); -var _QTS_NewPromiseCapability = Module['_QTS_NewPromiseCapability'] = makeInvalidEarlyAccess('_QTS_NewPromiseCapability'); -var _QTS_PromiseState = Module['_QTS_PromiseState'] = makeInvalidEarlyAccess('_QTS_PromiseState'); -var _QTS_PromiseResult = Module['_QTS_PromiseResult'] = makeInvalidEarlyAccess('_QTS_PromiseResult'); -var _QTS_TestStringArg = Module['_QTS_TestStringArg'] = makeInvalidEarlyAccess('_QTS_TestStringArg'); -var _QTS_GetDebugLogEnabled = Module['_QTS_GetDebugLogEnabled'] = makeInvalidEarlyAccess('_QTS_GetDebugLogEnabled'); -var _QTS_SetDebugLogEnabled = Module['_QTS_SetDebugLogEnabled'] = makeInvalidEarlyAccess('_QTS_SetDebugLogEnabled'); -var _QTS_BuildIsDebug = Module['_QTS_BuildIsDebug'] = makeInvalidEarlyAccess('_QTS_BuildIsDebug'); -var _QTS_BuildIsAsyncify = Module['_QTS_BuildIsAsyncify'] = makeInvalidEarlyAccess('_QTS_BuildIsAsyncify'); -var _QTS_NewFunction = Module['_QTS_NewFunction'] = makeInvalidEarlyAccess('_QTS_NewFunction'); -var _QTS_ArgvGetJSValueConstPointer = Module['_QTS_ArgvGetJSValueConstPointer'] = makeInvalidEarlyAccess('_QTS_ArgvGetJSValueConstPointer'); -var _QTS_RuntimeEnableInterruptHandler = Module['_QTS_RuntimeEnableInterruptHandler'] = makeInvalidEarlyAccess('_QTS_RuntimeEnableInterruptHandler'); -var _QTS_RuntimeDisableInterruptHandler = Module['_QTS_RuntimeDisableInterruptHandler'] = makeInvalidEarlyAccess('_QTS_RuntimeDisableInterruptHandler'); -var _QTS_RuntimeEnableModuleLoader = Module['_QTS_RuntimeEnableModuleLoader'] = makeInvalidEarlyAccess('_QTS_RuntimeEnableModuleLoader'); -var _QTS_RuntimeDisableModuleLoader = Module['_QTS_RuntimeDisableModuleLoader'] = makeInvalidEarlyAccess('_QTS_RuntimeDisableModuleLoader'); -var _QTS_bjson_encode = Module['_QTS_bjson_encode'] = makeInvalidEarlyAccess('_QTS_bjson_encode'); -var _QTS_bjson_decode = Module['_QTS_bjson_decode'] = makeInvalidEarlyAccess('_QTS_bjson_decode'); -var _fflush = makeInvalidEarlyAccess('_fflush'); -var _strerror = makeInvalidEarlyAccess('_strerror'); -var ___funcs_on_exit = makeInvalidEarlyAccess('___funcs_on_exit'); -var _emscripten_builtin_memalign = makeInvalidEarlyAccess('_emscripten_builtin_memalign'); -var _emscripten_stack_init = makeInvalidEarlyAccess('_emscripten_stack_init'); -var _emscripten_stack_get_free = makeInvalidEarlyAccess('_emscripten_stack_get_free'); -var _emscripten_stack_get_base = makeInvalidEarlyAccess('_emscripten_stack_get_base'); -var _emscripten_stack_get_end = makeInvalidEarlyAccess('_emscripten_stack_get_end'); -var __emscripten_stack_restore = makeInvalidEarlyAccess('__emscripten_stack_restore'); -var __emscripten_stack_alloc = makeInvalidEarlyAccess('__emscripten_stack_alloc'); -var _emscripten_stack_get_current = makeInvalidEarlyAccess('_emscripten_stack_get_current'); -var ___lsan_disable = makeInvalidEarlyAccess('___lsan_disable'); -var ___lsan_enable = makeInvalidEarlyAccess('___lsan_enable'); -var __indirect_function_table = makeInvalidEarlyAccess('__indirect_function_table'); - -function assignWasmExports(wasmExports) { - assert(typeof wasmExports['malloc'] != 'undefined', 'missing Wasm export: malloc'); - assert(typeof wasmExports['QTS_Throw'] != 'undefined', 'missing Wasm export: QTS_Throw'); - assert(typeof wasmExports['QTS_NewError'] != 'undefined', 'missing Wasm export: QTS_NewError'); - assert(typeof wasmExports['QTS_RuntimeSetMemoryLimit'] != 'undefined', 'missing Wasm export: QTS_RuntimeSetMemoryLimit'); - assert(typeof wasmExports['QTS_RuntimeComputeMemoryUsage'] != 'undefined', 'missing Wasm export: QTS_RuntimeComputeMemoryUsage'); - assert(typeof wasmExports['QTS_RuntimeDumpMemoryUsage'] != 'undefined', 'missing Wasm export: QTS_RuntimeDumpMemoryUsage'); - assert(typeof wasmExports['QTS_RecoverableLeakCheck'] != 'undefined', 'missing Wasm export: QTS_RecoverableLeakCheck'); - assert(typeof wasmExports['QTS_BuildIsSanitizeLeak'] != 'undefined', 'missing Wasm export: QTS_BuildIsSanitizeLeak'); - assert(typeof wasmExports['QTS_RuntimeSetMaxStackSize'] != 'undefined', 'missing Wasm export: QTS_RuntimeSetMaxStackSize'); - assert(typeof wasmExports['QTS_GetUndefined'] != 'undefined', 'missing Wasm export: QTS_GetUndefined'); - assert(typeof wasmExports['QTS_GetNull'] != 'undefined', 'missing Wasm export: QTS_GetNull'); - assert(typeof wasmExports['QTS_GetFalse'] != 'undefined', 'missing Wasm export: QTS_GetFalse'); - assert(typeof wasmExports['QTS_GetTrue'] != 'undefined', 'missing Wasm export: QTS_GetTrue'); - assert(typeof wasmExports['QTS_NewHostRef'] != 'undefined', 'missing Wasm export: QTS_NewHostRef'); - assert(typeof wasmExports['QTS_GetHostRefId'] != 'undefined', 'missing Wasm export: QTS_GetHostRefId'); - assert(typeof wasmExports['QTS_NewRuntime'] != 'undefined', 'missing Wasm export: QTS_NewRuntime'); - assert(typeof wasmExports['QTS_FreeRuntime'] != 'undefined', 'missing Wasm export: QTS_FreeRuntime'); - assert(typeof wasmExports['free'] != 'undefined', 'missing Wasm export: free'); - assert(typeof wasmExports['QTS_NewContext'] != 'undefined', 'missing Wasm export: QTS_NewContext'); - assert(typeof wasmExports['QTS_FreeContext'] != 'undefined', 'missing Wasm export: QTS_FreeContext'); - assert(typeof wasmExports['QTS_FreeValuePointer'] != 'undefined', 'missing Wasm export: QTS_FreeValuePointer'); - assert(typeof wasmExports['QTS_FreeValuePointerRuntime'] != 'undefined', 'missing Wasm export: QTS_FreeValuePointerRuntime'); - assert(typeof wasmExports['QTS_FreeVoidPointer'] != 'undefined', 'missing Wasm export: QTS_FreeVoidPointer'); - assert(typeof wasmExports['QTS_FreeCString'] != 'undefined', 'missing Wasm export: QTS_FreeCString'); - assert(typeof wasmExports['QTS_DupValuePointer'] != 'undefined', 'missing Wasm export: QTS_DupValuePointer'); - assert(typeof wasmExports['QTS_NewObject'] != 'undefined', 'missing Wasm export: QTS_NewObject'); - assert(typeof wasmExports['QTS_NewObjectProto'] != 'undefined', 'missing Wasm export: QTS_NewObjectProto'); - assert(typeof wasmExports['QTS_NewArray'] != 'undefined', 'missing Wasm export: QTS_NewArray'); - assert(typeof wasmExports['QTS_NewArrayBuffer'] != 'undefined', 'missing Wasm export: QTS_NewArrayBuffer'); - assert(typeof wasmExports['QTS_NewFloat64'] != 'undefined', 'missing Wasm export: QTS_NewFloat64'); - assert(typeof wasmExports['QTS_GetFloat64'] != 'undefined', 'missing Wasm export: QTS_GetFloat64'); - assert(typeof wasmExports['QTS_NewString'] != 'undefined', 'missing Wasm export: QTS_NewString'); - assert(typeof wasmExports['QTS_GetString'] != 'undefined', 'missing Wasm export: QTS_GetString'); - assert(typeof wasmExports['QTS_GetArrayBuffer'] != 'undefined', 'missing Wasm export: QTS_GetArrayBuffer'); - assert(typeof wasmExports['QTS_GetArrayBufferLength'] != 'undefined', 'missing Wasm export: QTS_GetArrayBufferLength'); - assert(typeof wasmExports['QTS_NewSymbol'] != 'undefined', 'missing Wasm export: QTS_NewSymbol'); - assert(typeof wasmExports['QTS_GetSymbolDescriptionOrKey'] != 'undefined', 'missing Wasm export: QTS_GetSymbolDescriptionOrKey'); - assert(typeof wasmExports['QTS_IsGlobalSymbol'] != 'undefined', 'missing Wasm export: QTS_IsGlobalSymbol'); - assert(typeof wasmExports['QTS_IsJobPending'] != 'undefined', 'missing Wasm export: QTS_IsJobPending'); - assert(typeof wasmExports['QTS_ExecutePendingJob'] != 'undefined', 'missing Wasm export: QTS_ExecutePendingJob'); - assert(typeof wasmExports['QTS_GetProp'] != 'undefined', 'missing Wasm export: QTS_GetProp'); - assert(typeof wasmExports['QTS_GetPropNumber'] != 'undefined', 'missing Wasm export: QTS_GetPropNumber'); - assert(typeof wasmExports['QTS_SetProp'] != 'undefined', 'missing Wasm export: QTS_SetProp'); - assert(typeof wasmExports['QTS_DefineProp'] != 'undefined', 'missing Wasm export: QTS_DefineProp'); - assert(typeof wasmExports['QTS_GetOwnPropertyNames'] != 'undefined', 'missing Wasm export: QTS_GetOwnPropertyNames'); - assert(typeof wasmExports['QTS_Call'] != 'undefined', 'missing Wasm export: QTS_Call'); - assert(typeof wasmExports['QTS_ResolveException'] != 'undefined', 'missing Wasm export: QTS_ResolveException'); - assert(typeof wasmExports['QTS_Dump'] != 'undefined', 'missing Wasm export: QTS_Dump'); - assert(typeof wasmExports['QTS_Eval'] != 'undefined', 'missing Wasm export: QTS_Eval'); - assert(typeof wasmExports['QTS_GetModuleNamespace'] != 'undefined', 'missing Wasm export: QTS_GetModuleNamespace'); - assert(typeof wasmExports['QTS_Typeof'] != 'undefined', 'missing Wasm export: QTS_Typeof'); - assert(typeof wasmExports['QTS_GetLength'] != 'undefined', 'missing Wasm export: QTS_GetLength'); - assert(typeof wasmExports['QTS_IsEqual'] != 'undefined', 'missing Wasm export: QTS_IsEqual'); - assert(typeof wasmExports['QTS_GetGlobalObject'] != 'undefined', 'missing Wasm export: QTS_GetGlobalObject'); - assert(typeof wasmExports['QTS_NewPromiseCapability'] != 'undefined', 'missing Wasm export: QTS_NewPromiseCapability'); - assert(typeof wasmExports['QTS_PromiseState'] != 'undefined', 'missing Wasm export: QTS_PromiseState'); - assert(typeof wasmExports['QTS_PromiseResult'] != 'undefined', 'missing Wasm export: QTS_PromiseResult'); - assert(typeof wasmExports['QTS_TestStringArg'] != 'undefined', 'missing Wasm export: QTS_TestStringArg'); - assert(typeof wasmExports['QTS_GetDebugLogEnabled'] != 'undefined', 'missing Wasm export: QTS_GetDebugLogEnabled'); - assert(typeof wasmExports['QTS_SetDebugLogEnabled'] != 'undefined', 'missing Wasm export: QTS_SetDebugLogEnabled'); - assert(typeof wasmExports['QTS_BuildIsDebug'] != 'undefined', 'missing Wasm export: QTS_BuildIsDebug'); - assert(typeof wasmExports['QTS_BuildIsAsyncify'] != 'undefined', 'missing Wasm export: QTS_BuildIsAsyncify'); - assert(typeof wasmExports['QTS_NewFunction'] != 'undefined', 'missing Wasm export: QTS_NewFunction'); - assert(typeof wasmExports['QTS_ArgvGetJSValueConstPointer'] != 'undefined', 'missing Wasm export: QTS_ArgvGetJSValueConstPointer'); - assert(typeof wasmExports['QTS_RuntimeEnableInterruptHandler'] != 'undefined', 'missing Wasm export: QTS_RuntimeEnableInterruptHandler'); - assert(typeof wasmExports['QTS_RuntimeDisableInterruptHandler'] != 'undefined', 'missing Wasm export: QTS_RuntimeDisableInterruptHandler'); - assert(typeof wasmExports['QTS_RuntimeEnableModuleLoader'] != 'undefined', 'missing Wasm export: QTS_RuntimeEnableModuleLoader'); - assert(typeof wasmExports['QTS_RuntimeDisableModuleLoader'] != 'undefined', 'missing Wasm export: QTS_RuntimeDisableModuleLoader'); - assert(typeof wasmExports['QTS_bjson_encode'] != 'undefined', 'missing Wasm export: QTS_bjson_encode'); - assert(typeof wasmExports['QTS_bjson_decode'] != 'undefined', 'missing Wasm export: QTS_bjson_decode'); - assert(typeof wasmExports['fflush'] != 'undefined', 'missing Wasm export: fflush'); - assert(typeof wasmExports['strerror'] != 'undefined', 'missing Wasm export: strerror'); - assert(typeof wasmExports['__funcs_on_exit'] != 'undefined', 'missing Wasm export: __funcs_on_exit'); - assert(typeof wasmExports['emscripten_builtin_memalign'] != 'undefined', 'missing Wasm export: emscripten_builtin_memalign'); - assert(typeof wasmExports['emscripten_stack_init'] != 'undefined', 'missing Wasm export: emscripten_stack_init'); - assert(typeof wasmExports['emscripten_stack_get_free'] != 'undefined', 'missing Wasm export: emscripten_stack_get_free'); - assert(typeof wasmExports['emscripten_stack_get_base'] != 'undefined', 'missing Wasm export: emscripten_stack_get_base'); - assert(typeof wasmExports['emscripten_stack_get_end'] != 'undefined', 'missing Wasm export: emscripten_stack_get_end'); - assert(typeof wasmExports['_emscripten_stack_restore'] != 'undefined', 'missing Wasm export: _emscripten_stack_restore'); - assert(typeof wasmExports['_emscripten_stack_alloc'] != 'undefined', 'missing Wasm export: _emscripten_stack_alloc'); - assert(typeof wasmExports['emscripten_stack_get_current'] != 'undefined', 'missing Wasm export: emscripten_stack_get_current'); - assert(typeof wasmExports['__lsan_disable'] != 'undefined', 'missing Wasm export: __lsan_disable'); - assert(typeof wasmExports['__lsan_enable'] != 'undefined', 'missing Wasm export: __lsan_enable'); - assert(typeof wasmExports['__indirect_function_table'] != 'undefined', 'missing Wasm export: __indirect_function_table'); - _malloc = Module['_malloc'] = createExportWrapper('malloc', 1); - _QTS_Throw = Module['_QTS_Throw'] = createExportWrapper('QTS_Throw', 2); - _QTS_NewError = Module['_QTS_NewError'] = createExportWrapper('QTS_NewError', 1); - _QTS_RuntimeSetMemoryLimit = Module['_QTS_RuntimeSetMemoryLimit'] = createExportWrapper('QTS_RuntimeSetMemoryLimit', 2); - _QTS_RuntimeComputeMemoryUsage = Module['_QTS_RuntimeComputeMemoryUsage'] = createExportWrapper('QTS_RuntimeComputeMemoryUsage', 2); - _QTS_RuntimeDumpMemoryUsage = Module['_QTS_RuntimeDumpMemoryUsage'] = createExportWrapper('QTS_RuntimeDumpMemoryUsage', 1); - _QTS_RecoverableLeakCheck = Module['_QTS_RecoverableLeakCheck'] = createExportWrapper('QTS_RecoverableLeakCheck', 0); - _QTS_BuildIsSanitizeLeak = Module['_QTS_BuildIsSanitizeLeak'] = createExportWrapper('QTS_BuildIsSanitizeLeak', 0); - _QTS_RuntimeSetMaxStackSize = Module['_QTS_RuntimeSetMaxStackSize'] = createExportWrapper('QTS_RuntimeSetMaxStackSize', 2); - _QTS_GetUndefined = Module['_QTS_GetUndefined'] = createExportWrapper('QTS_GetUndefined', 0); - _QTS_GetNull = Module['_QTS_GetNull'] = createExportWrapper('QTS_GetNull', 0); - _QTS_GetFalse = Module['_QTS_GetFalse'] = createExportWrapper('QTS_GetFalse', 0); - _QTS_GetTrue = Module['_QTS_GetTrue'] = createExportWrapper('QTS_GetTrue', 0); - _QTS_NewHostRef = Module['_QTS_NewHostRef'] = createExportWrapper('QTS_NewHostRef', 2); - _QTS_GetHostRefId = Module['_QTS_GetHostRefId'] = createExportWrapper('QTS_GetHostRefId', 1); - _QTS_NewRuntime = Module['_QTS_NewRuntime'] = createExportWrapper('QTS_NewRuntime', 0); - _QTS_FreeRuntime = Module['_QTS_FreeRuntime'] = createExportWrapper('QTS_FreeRuntime', 1); - _free = Module['_free'] = createExportWrapper('free', 1); - _QTS_NewContext = Module['_QTS_NewContext'] = createExportWrapper('QTS_NewContext', 2); - _QTS_FreeContext = Module['_QTS_FreeContext'] = createExportWrapper('QTS_FreeContext', 1); - _QTS_FreeValuePointer = Module['_QTS_FreeValuePointer'] = createExportWrapper('QTS_FreeValuePointer', 2); - _QTS_FreeValuePointerRuntime = Module['_QTS_FreeValuePointerRuntime'] = createExportWrapper('QTS_FreeValuePointerRuntime', 2); - _QTS_FreeVoidPointer = Module['_QTS_FreeVoidPointer'] = createExportWrapper('QTS_FreeVoidPointer', 2); - _QTS_FreeCString = Module['_QTS_FreeCString'] = createExportWrapper('QTS_FreeCString', 2); - _QTS_DupValuePointer = Module['_QTS_DupValuePointer'] = createExportWrapper('QTS_DupValuePointer', 2); - _QTS_NewObject = Module['_QTS_NewObject'] = createExportWrapper('QTS_NewObject', 1); - _QTS_NewObjectProto = Module['_QTS_NewObjectProto'] = createExportWrapper('QTS_NewObjectProto', 2); - _QTS_NewArray = Module['_QTS_NewArray'] = createExportWrapper('QTS_NewArray', 1); - _QTS_NewArrayBuffer = Module['_QTS_NewArrayBuffer'] = createExportWrapper('QTS_NewArrayBuffer', 3); - _QTS_NewFloat64 = Module['_QTS_NewFloat64'] = createExportWrapper('QTS_NewFloat64', 2); - _QTS_GetFloat64 = Module['_QTS_GetFloat64'] = createExportWrapper('QTS_GetFloat64', 2); - _QTS_NewString = Module['_QTS_NewString'] = createExportWrapper('QTS_NewString', 2); - _QTS_GetString = Module['_QTS_GetString'] = createExportWrapper('QTS_GetString', 2); - _QTS_GetArrayBuffer = Module['_QTS_GetArrayBuffer'] = createExportWrapper('QTS_GetArrayBuffer', 2); - _QTS_GetArrayBufferLength = Module['_QTS_GetArrayBufferLength'] = createExportWrapper('QTS_GetArrayBufferLength', 2); - _QTS_NewSymbol = Module['_QTS_NewSymbol'] = createExportWrapper('QTS_NewSymbol', 3); - _QTS_GetSymbolDescriptionOrKey = Module['_QTS_GetSymbolDescriptionOrKey'] = createExportWrapper('QTS_GetSymbolDescriptionOrKey', 2); - _QTS_IsGlobalSymbol = Module['_QTS_IsGlobalSymbol'] = createExportWrapper('QTS_IsGlobalSymbol', 2); - _QTS_IsJobPending = Module['_QTS_IsJobPending'] = createExportWrapper('QTS_IsJobPending', 1); - _QTS_ExecutePendingJob = Module['_QTS_ExecutePendingJob'] = createExportWrapper('QTS_ExecutePendingJob', 3); - _QTS_GetProp = Module['_QTS_GetProp'] = createExportWrapper('QTS_GetProp', 3); - _QTS_GetPropNumber = Module['_QTS_GetPropNumber'] = createExportWrapper('QTS_GetPropNumber', 3); - _QTS_SetProp = Module['_QTS_SetProp'] = createExportWrapper('QTS_SetProp', 4); - _QTS_DefineProp = Module['_QTS_DefineProp'] = createExportWrapper('QTS_DefineProp', 9); - _QTS_GetOwnPropertyNames = Module['_QTS_GetOwnPropertyNames'] = createExportWrapper('QTS_GetOwnPropertyNames', 5); - _QTS_Call = Module['_QTS_Call'] = createExportWrapper('QTS_Call', 5); - _QTS_ResolveException = Module['_QTS_ResolveException'] = createExportWrapper('QTS_ResolveException', 2); - _QTS_Dump = Module['_QTS_Dump'] = createExportWrapper('QTS_Dump', 2); - _QTS_Eval = Module['_QTS_Eval'] = createExportWrapper('QTS_Eval', 6); - _QTS_GetModuleNamespace = Module['_QTS_GetModuleNamespace'] = createExportWrapper('QTS_GetModuleNamespace', 2); - _QTS_Typeof = Module['_QTS_Typeof'] = createExportWrapper('QTS_Typeof', 2); - _QTS_GetLength = Module['_QTS_GetLength'] = createExportWrapper('QTS_GetLength', 3); - _QTS_IsEqual = Module['_QTS_IsEqual'] = createExportWrapper('QTS_IsEqual', 4); - _QTS_GetGlobalObject = Module['_QTS_GetGlobalObject'] = createExportWrapper('QTS_GetGlobalObject', 1); - _QTS_NewPromiseCapability = Module['_QTS_NewPromiseCapability'] = createExportWrapper('QTS_NewPromiseCapability', 2); - _QTS_PromiseState = Module['_QTS_PromiseState'] = createExportWrapper('QTS_PromiseState', 2); - _QTS_PromiseResult = Module['_QTS_PromiseResult'] = createExportWrapper('QTS_PromiseResult', 2); - _QTS_TestStringArg = Module['_QTS_TestStringArg'] = createExportWrapper('QTS_TestStringArg', 1); - _QTS_GetDebugLogEnabled = Module['_QTS_GetDebugLogEnabled'] = createExportWrapper('QTS_GetDebugLogEnabled', 1); - _QTS_SetDebugLogEnabled = Module['_QTS_SetDebugLogEnabled'] = createExportWrapper('QTS_SetDebugLogEnabled', 2); - _QTS_BuildIsDebug = Module['_QTS_BuildIsDebug'] = createExportWrapper('QTS_BuildIsDebug', 0); - _QTS_BuildIsAsyncify = Module['_QTS_BuildIsAsyncify'] = createExportWrapper('QTS_BuildIsAsyncify', 0); - _QTS_NewFunction = Module['_QTS_NewFunction'] = createExportWrapper('QTS_NewFunction', 5); - _QTS_ArgvGetJSValueConstPointer = Module['_QTS_ArgvGetJSValueConstPointer'] = createExportWrapper('QTS_ArgvGetJSValueConstPointer', 2); - _QTS_RuntimeEnableInterruptHandler = Module['_QTS_RuntimeEnableInterruptHandler'] = createExportWrapper('QTS_RuntimeEnableInterruptHandler', 1); - _QTS_RuntimeDisableInterruptHandler = Module['_QTS_RuntimeDisableInterruptHandler'] = createExportWrapper('QTS_RuntimeDisableInterruptHandler', 1); - _QTS_RuntimeEnableModuleLoader = Module['_QTS_RuntimeEnableModuleLoader'] = createExportWrapper('QTS_RuntimeEnableModuleLoader', 2); - _QTS_RuntimeDisableModuleLoader = Module['_QTS_RuntimeDisableModuleLoader'] = createExportWrapper('QTS_RuntimeDisableModuleLoader', 1); - _QTS_bjson_encode = Module['_QTS_bjson_encode'] = createExportWrapper('QTS_bjson_encode', 2); - _QTS_bjson_decode = Module['_QTS_bjson_decode'] = createExportWrapper('QTS_bjson_decode', 2); - _fflush = createExportWrapper('fflush', 1); - _strerror = createExportWrapper('strerror', 1); - ___funcs_on_exit = createExportWrapper('__funcs_on_exit', 0); - _emscripten_builtin_memalign = createExportWrapper('emscripten_builtin_memalign', 2); - _emscripten_stack_init = wasmExports['emscripten_stack_init']; - _emscripten_stack_get_free = wasmExports['emscripten_stack_get_free']; - _emscripten_stack_get_base = wasmExports['emscripten_stack_get_base']; - _emscripten_stack_get_end = wasmExports['emscripten_stack_get_end']; - __emscripten_stack_restore = wasmExports['_emscripten_stack_restore']; - __emscripten_stack_alloc = wasmExports['_emscripten_stack_alloc']; - _emscripten_stack_get_current = wasmExports['emscripten_stack_get_current']; - ___lsan_disable = wasmExports['__lsan_disable']; - ___lsan_enable = wasmExports['__lsan_enable']; - __indirect_function_table = wasmExports['__indirect_function_table']; -} - -var wasmImports = { - /** @export */ - __assert_fail: ___assert_fail, - /** @export */ - __syscall_dup: ___syscall_dup, - /** @export */ - __syscall_fstat64: ___syscall_fstat64, - /** @export */ - __syscall_lstat64: ___syscall_lstat64, - /** @export */ - __syscall_mkdirat: ___syscall_mkdirat, - /** @export */ - __syscall_newfstatat: ___syscall_newfstatat, - /** @export */ - __syscall_openat: ___syscall_openat, - /** @export */ - __syscall_stat64: ___syscall_stat64, - /** @export */ - _abort_js: __abort_js, - /** @export */ - _emscripten_get_progname: __emscripten_get_progname, - /** @export */ - _emscripten_sanitizer_get_option: __emscripten_sanitizer_get_option, - /** @export */ - _emscripten_sanitizer_use_colors: __emscripten_sanitizer_use_colors, - /** @export */ - _localtime_js: __localtime_js, - /** @export */ - _mmap_js: __mmap_js, - /** @export */ - _munmap_js: __munmap_js, - /** @export */ - _tzset_js: __tzset_js, - /** @export */ - clock_time_get: _clock_time_get, - /** @export */ - emscripten_date_now: _emscripten_date_now, - /** @export */ - emscripten_get_heap_max: _emscripten_get_heap_max, - /** @export */ - emscripten_get_now: _emscripten_get_now, - /** @export */ - emscripten_pc_get_column: _emscripten_pc_get_column, - /** @export */ - emscripten_pc_get_file: _emscripten_pc_get_file, - /** @export */ - emscripten_pc_get_function: _emscripten_pc_get_function, - /** @export */ - emscripten_pc_get_line: _emscripten_pc_get_line, - /** @export */ - emscripten_resize_heap: _emscripten_resize_heap, - /** @export */ - emscripten_stack_snapshot: _emscripten_stack_snapshot, - /** @export */ - emscripten_stack_unwind_buffer: _emscripten_stack_unwind_buffer, - /** @export */ - environ_get: _environ_get, - /** @export */ - environ_sizes_get: _environ_sizes_get, - /** @export */ - fd_close: _fd_close, - /** @export */ - fd_read: _fd_read, - /** @export */ - fd_seek: _fd_seek, - /** @export */ - fd_write: _fd_write, - /** @export */ - memory: wasmMemory, - /** @export */ - proc_exit: _proc_exit, - /** @export */ - qts_host_call_function, - /** @export */ - qts_host_interrupt_handler, - /** @export */ - qts_host_load_module_source, - /** @export */ - qts_host_normalize_module, - /** @export */ - qts_host_ref_free -}; - - -// include: postamble.js -// === Auto-generated postamble setup entry stuff === - -// include: source_map_support.js -class WasmSourceMap { - mapping = {}; - offsets = []; - - constructor(sourceMap) { - this.version = sourceMap.version; - this.sources = sourceMap.sources; - this.names = sourceMap.names; - - var vlqMap = {}; - 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='.split('').forEach((c, i) => vlqMap[c] = i); - - // based on https://github.com/Rich-Harris/vlq/blob/master/src/vlq.ts - function decodeVLQ(string) { - var result = []; - var shift = 0; - var value = 0; - - for (var ch of string) { - var integer = vlqMap[ch]; - if (integer === undefined) { - throw new Error(`Invalid character (${ch})`); - } - - value += (integer & 31) << shift; - - if (integer & 32) { - shift += 5; - } else { - var negate = value & 1; - value >>= 1; - result.push(negate ? -value : value); - value = shift = 0; - } - } - return result; - } - - var offset = 0, src = 0, line = 1, col = 1, name = 0; - for (const [index, segment] of sourceMap.mappings.split(',').entries()) { - if (!segment) continue; - var data = decodeVLQ(segment); - var info = {}; - - offset += data[0]; - if (data.length >= 2) info.source = src += data[1]; - if (data.length >= 3) info.line = line += data[2]; - if (data.length >= 4) info.column = col += data[3]; - if (data.length >= 5) info.name = name += data[4]; - this.mapping[offset] = info; - this.offsets.push(offset); - } - this.offsets.sort((a, b) => a - b); - } - - lookup(offset) { - var normalized = this.normalizeOffset(offset); - var info = this.mapping[normalized]; - if (!info) { - return null; - } - return { - file: this.sources[info.source], - line: info.line, - column: info.column, - name: this.names[info.name], - }; - } - - normalizeOffset(offset) { - var lo = 0; - var hi = this.offsets.length; - var mid; - - while (lo < hi) { - mid = Math.floor((lo + hi) / 2); - if (this.offsets[mid] > offset) { - hi = mid; - } else { - lo = mid + 1; - } - } - return this.offsets[lo - 1]; - } -} - -var wasmSourceMap; -var wasmSourceMapFile = locateFile('emscripten-module.wasm.map'); - -function receiveSourceMapJSON(sourceMap) { - wasmSourceMap = new WasmSourceMap(sourceMap); -} - -function getSourceMap() { - var buf = readBinary(wasmSourceMapFile); - return JSON.parse(UTF8ArrayToString(buf)); -} - -async function getSourceMapAsync() { - if (ENVIRONMENT_IS_WEB - || ENVIRONMENT_IS_WORKER - ) { - try { - var response = await fetch(wasmSourceMapFile, { credentials: 'same-origin' }); - return response.json(); - } catch { - // Fall back to getSourceMap below - } - } - return getSourceMap(); -} - -addRunDependency('source-map'); -getSourceMapAsync().then((json) => { - receiveSourceMapJSON(json); - removeRunDependency('source-map'); -}); - -// end include: source_map_support.js -var calledRun; - -function stackCheckInit() { - // This is normally called automatically during __wasm_call_ctors but need to - // get these values before even running any of the ctors so we call it redundantly - // here. - _emscripten_stack_init(); - // TODO(sbc): Move writeStackCookie to native to to avoid this. - writeStackCookie(); -} - -function run() { - - if (runDependencies > 0) { - dependenciesFulfilled = run; - return; - } - - stackCheckInit(); - - preRun(); - - // a preRun added a dependency, run will be called later - if (runDependencies > 0) { - dependenciesFulfilled = run; - return; - } - - function doRun() { - // run may have just been called through dependencies being fulfilled just in this very frame, - // or while the async setStatus time below was happening - assert(!calledRun); - calledRun = true; - Module['calledRun'] = true; - - if (ABORT) return; - - initRuntime(); - - readyPromiseResolve?.(Module); - Module['onRuntimeInitialized']?.(); - consumedModuleProp('onRuntimeInitialized'); - - assert(!Module['_main'], 'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'); - - postRun(); - } - - if (Module['setStatus']) { - Module['setStatus']('Running...'); - setTimeout(() => { - setTimeout(() => Module['setStatus'](''), 1); - doRun(); - }, 1); - } else - { - doRun(); - } - checkStackCookie(); -} - -var wasmExports; - -// In modularize mode the generated code is within a factory function so we -// can use await here (since it's not top-level-await). -wasmExports = await (createWasm()); - -run(); - -// end include: postamble.js - -// include: postamble_modularize.js -// In MODULARIZE mode we wrap the generated code in a factory function -// and return either the Module itself, or a promise of the module. -// -// We assign to the `moduleRtn` global here and configure closure to see -// this as an extern so it won't get minified. - -if (runtimeInitialized) { - moduleRtn = Module; -} else { - // Set up the promise that indicates the Module is initialized - moduleRtn = new Promise((resolve, reject) => { - readyPromiseResolve = resolve; - readyPromiseReject = reject; - }); -} - -// Assertion for attempting to access module properties on the incoming -// moduleArg. In the past we used this object as the prototype of the module -// and assigned properties to it, but now we return a distinct object. This -// keeps the instance private until it is ready (i.e the promise has been -// resolved). -for (const prop of Object.keys(Module)) { - if (!(prop in moduleArg)) { - Object.defineProperty(moduleArg, prop, { - configurable: true, - get() { - abort(`Access to module property ('${prop}') is no longer possible via the module constructor argument; Instead, use the result of the module constructor.`) - } - }); - } -} -// end include: postamble_modularize.js - - - - return moduleRtn; -} - -// Export using a UMD style export, or ES6 exports if selected -export default QuickJSRaw; - diff --git a/.output/server/node_modules/@jitl/quickjs-wasmfile-debug-sync/dist/emscripten-module.wasm b/.output/server/node_modules/@jitl/quickjs-wasmfile-debug-sync/dist/emscripten-module.wasm deleted file mode 100644 index 0bc37c7..0000000 Binary files a/.output/server/node_modules/@jitl/quickjs-wasmfile-debug-sync/dist/emscripten-module.wasm and /dev/null differ diff --git a/.output/server/node_modules/@jitl/quickjs-wasmfile-debug-sync/dist/ffi.mjs b/.output/server/node_modules/@jitl/quickjs-wasmfile-debug-sync/dist/ffi.mjs deleted file mode 100644 index 7b2e2c2..0000000 --- a/.output/server/node_modules/@jitl/quickjs-wasmfile-debug-sync/dist/ffi.mjs +++ /dev/null @@ -1,2 +0,0 @@ -var QuickJSFFI=class{constructor(module){this.module=module;this.DEBUG=!0;this.QTS_Throw=this.module.cwrap("QTS_Throw","number",["number","number"]);this.QTS_NewError=this.module.cwrap("QTS_NewError","number",["number"]);this.QTS_RuntimeSetMemoryLimit=this.module.cwrap("QTS_RuntimeSetMemoryLimit",null,["number","number"]);this.QTS_RuntimeComputeMemoryUsage=this.module.cwrap("QTS_RuntimeComputeMemoryUsage","number",["number","number"]);this.QTS_RuntimeDumpMemoryUsage=this.module.cwrap("QTS_RuntimeDumpMemoryUsage","number",["number"]);this.QTS_RecoverableLeakCheck=this.module.cwrap("QTS_RecoverableLeakCheck","number",[]);this.QTS_BuildIsSanitizeLeak=this.module.cwrap("QTS_BuildIsSanitizeLeak","number",[]);this.QTS_RuntimeSetMaxStackSize=this.module.cwrap("QTS_RuntimeSetMaxStackSize",null,["number","number"]);this.QTS_GetUndefined=this.module.cwrap("QTS_GetUndefined","number",[]);this.QTS_GetNull=this.module.cwrap("QTS_GetNull","number",[]);this.QTS_GetFalse=this.module.cwrap("QTS_GetFalse","number",[]);this.QTS_GetTrue=this.module.cwrap("QTS_GetTrue","number",[]);this.QTS_NewHostRef=this.module.cwrap("QTS_NewHostRef","number",["number","number"]);this.QTS_GetHostRefId=this.module.cwrap("QTS_GetHostRefId","number",["number"]);this.QTS_NewRuntime=this.module.cwrap("QTS_NewRuntime","number",[]);this.QTS_FreeRuntime=this.module.cwrap("QTS_FreeRuntime",null,["number"]);this.QTS_NewContext=this.module.cwrap("QTS_NewContext","number",["number","number"]);this.QTS_FreeContext=this.module.cwrap("QTS_FreeContext",null,["number"]);this.QTS_FreeValuePointer=this.module.cwrap("QTS_FreeValuePointer",null,["number","number"]);this.QTS_FreeValuePointerRuntime=this.module.cwrap("QTS_FreeValuePointerRuntime",null,["number","number"]);this.QTS_FreeVoidPointer=this.module.cwrap("QTS_FreeVoidPointer",null,["number","number"]);this.QTS_FreeCString=this.module.cwrap("QTS_FreeCString",null,["number","number"]);this.QTS_DupValuePointer=this.module.cwrap("QTS_DupValuePointer","number",["number","number"]);this.QTS_NewObject=this.module.cwrap("QTS_NewObject","number",["number"]);this.QTS_NewObjectProto=this.module.cwrap("QTS_NewObjectProto","number",["number","number"]);this.QTS_NewArray=this.module.cwrap("QTS_NewArray","number",["number"]);this.QTS_NewArrayBuffer=this.module.cwrap("QTS_NewArrayBuffer","number",["number","number","number"]);this.QTS_NewFloat64=this.module.cwrap("QTS_NewFloat64","number",["number","number"]);this.QTS_GetFloat64=this.module.cwrap("QTS_GetFloat64","number",["number","number"]);this.QTS_NewString=this.module.cwrap("QTS_NewString","number",["number","number"]);this.QTS_GetString=this.module.cwrap("QTS_GetString","number",["number","number"]);this.QTS_GetArrayBuffer=this.module.cwrap("QTS_GetArrayBuffer","number",["number","number"]);this.QTS_GetArrayBufferLength=this.module.cwrap("QTS_GetArrayBufferLength","number",["number","number"]);this.QTS_NewSymbol=this.module.cwrap("QTS_NewSymbol","number",["number","number","number"]);this.QTS_GetSymbolDescriptionOrKey=this.module.cwrap("QTS_GetSymbolDescriptionOrKey","number",["number","number"]);this.QTS_IsGlobalSymbol=this.module.cwrap("QTS_IsGlobalSymbol","number",["number","number"]);this.QTS_IsJobPending=this.module.cwrap("QTS_IsJobPending","number",["number"]);this.QTS_ExecutePendingJob=this.module.cwrap("QTS_ExecutePendingJob","number",["number","number","number"]);this.QTS_GetProp=this.module.cwrap("QTS_GetProp","number",["number","number","number"]);this.QTS_GetPropNumber=this.module.cwrap("QTS_GetPropNumber","number",["number","number","number"]);this.QTS_SetProp=this.module.cwrap("QTS_SetProp",null,["number","number","number","number"]);this.QTS_DefineProp=this.module.cwrap("QTS_DefineProp",null,["number","number","number","number","number","number","boolean","boolean","boolean"]);this.QTS_GetOwnPropertyNames=this.module.cwrap("QTS_GetOwnPropertyNames","number",["number","number","number","number","number"]);this.QTS_Call=this.module.cwrap("QTS_Call","number",["number","number","number","number","number"]);this.QTS_ResolveException=this.module.cwrap("QTS_ResolveException","number",["number","number"]);this.QTS_Dump=this.module.cwrap("QTS_Dump","number",["number","number"]);this.QTS_Eval=this.module.cwrap("QTS_Eval","number",["number","number","number","string","number","number"]);this.QTS_GetModuleNamespace=this.module.cwrap("QTS_GetModuleNamespace","number",["number","number"]);this.QTS_Typeof=this.module.cwrap("QTS_Typeof","number",["number","number"]);this.QTS_GetLength=this.module.cwrap("QTS_GetLength","number",["number","number","number"]);this.QTS_IsEqual=this.module.cwrap("QTS_IsEqual","number",["number","number","number","number"]);this.QTS_GetGlobalObject=this.module.cwrap("QTS_GetGlobalObject","number",["number"]);this.QTS_NewPromiseCapability=this.module.cwrap("QTS_NewPromiseCapability","number",["number","number"]);this.QTS_PromiseState=this.module.cwrap("QTS_PromiseState","number",["number","number"]);this.QTS_PromiseResult=this.module.cwrap("QTS_PromiseResult","number",["number","number"]);this.QTS_TestStringArg=this.module.cwrap("QTS_TestStringArg",null,["string"]);this.QTS_GetDebugLogEnabled=this.module.cwrap("QTS_GetDebugLogEnabled","number",["number"]);this.QTS_SetDebugLogEnabled=this.module.cwrap("QTS_SetDebugLogEnabled",null,["number","number"]);this.QTS_BuildIsDebug=this.module.cwrap("QTS_BuildIsDebug","number",[]);this.QTS_BuildIsAsyncify=this.module.cwrap("QTS_BuildIsAsyncify","number",[]);this.QTS_NewFunction=this.module.cwrap("QTS_NewFunction","number",["number","string","number","boolean","number"]);this.QTS_ArgvGetJSValueConstPointer=this.module.cwrap("QTS_ArgvGetJSValueConstPointer","number",["number","number"]);this.QTS_RuntimeEnableInterruptHandler=this.module.cwrap("QTS_RuntimeEnableInterruptHandler",null,["number"]);this.QTS_RuntimeDisableInterruptHandler=this.module.cwrap("QTS_RuntimeDisableInterruptHandler",null,["number"]);this.QTS_RuntimeEnableModuleLoader=this.module.cwrap("QTS_RuntimeEnableModuleLoader",null,["number","number"]);this.QTS_RuntimeDisableModuleLoader=this.module.cwrap("QTS_RuntimeDisableModuleLoader",null,["number"]);this.QTS_bjson_encode=this.module.cwrap("QTS_bjson_encode","number",["number","number"]);this.QTS_bjson_decode=this.module.cwrap("QTS_bjson_decode","number",["number","number"])}};export{QuickJSFFI}; -//# sourceMappingURL=ffi.mjs.map \ No newline at end of file diff --git a/.output/server/node_modules/@jitl/quickjs-wasmfile-debug-sync/dist/index.mjs b/.output/server/node_modules/@jitl/quickjs-wasmfile-debug-sync/dist/index.mjs deleted file mode 100644 index b1aaa8d..0000000 --- a/.output/server/node_modules/@jitl/quickjs-wasmfile-debug-sync/dist/index.mjs +++ /dev/null @@ -1,2 +0,0 @@ -var variant={type:"sync",importFFI:()=>import("./ffi.mjs").then(mod=>mod.QuickJSFFI),importModuleLoader:()=>import("@jitl/quickjs-wasmfile-debug-sync/emscripten-module").then(mod=>mod.default)},src_default=variant;export{src_default as default}; -//# sourceMappingURL=index.mjs.map \ No newline at end of file diff --git a/.output/server/node_modules/@jitl/quickjs-wasmfile-debug-sync/package.json b/.output/server/node_modules/@jitl/quickjs-wasmfile-debug-sync/package.json deleted file mode 100644 index b0cefb8..0000000 --- a/.output/server/node_modules/@jitl/quickjs-wasmfile-debug-sync/package.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "name": "@jitl/quickjs-wasmfile-debug-sync", - "license": "MIT", - "version": "0.32.0", - "description": "Variant of quickjs library: Variant with separate .WASM file. Supports browser ESM, NodeJS ESM, and NodeJS CommonJS.", - "sideEffects": false, - "repository": { - "type": "git", - "url": "https://github.com/justjake/quickjs-emscripten" - }, - "author": { - "name": "Jake Teton-Landis", - "url": "https://jake.tl" - }, - "scripts": { - "build": "yarn build:c && yarn build:ts", - "build:c": "make", - "build:ts": "npx tsup", - "check:types": "npx tsc --project . --noEmit", - "clean": "make clean", - "prepare": "yarn clean && yarn build" - }, - "files": [ - "LICENSE", - "README.md", - "dist/**/*", - "!dist/*.tsbuildinfo" - ], - "types": "./dist/index.d.ts", - "main": "./dist/index.js", - "module": "./dist/index.mjs", - "browser": "./dist/index.mjs", - "exports": { - ".": { - "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", - "require": "./dist/index.js", - "default": "./dist/index.js" - }, - "./package.json": "./package.json", - "./ffi": { - "types": "./dist/ffi.d.ts", - "import": "./dist/ffi.mjs", - "require": "./dist/ffi.js", - "default": "./dist/ffi.js" - }, - "./wasm": "./dist/emscripten-module.wasm", - "./emscripten-module": { - "types": "./dist/emscripten-module.browser.d.ts", - "iife": "./dist/emscripten-module.cjs", - "workerd": "./dist/emscripten-module.cloudflare.cjs", - "browser": "./dist/emscripten-module.browser.mjs", - "import": "./dist/emscripten-module.mjs", - "require": "./dist/emscripten-module.cjs", - "default": "./dist/emscripten-module.cjs" - } - }, - "dependencies": { - "@jitl/quickjs-ffi-types": "0.32.0" - } -} \ No newline at end of file diff --git a/.output/server/node_modules/@jitl/quickjs-wasmfile-release-asyncify/dist/emscripten-module.mjs b/.output/server/node_modules/@jitl/quickjs-wasmfile-release-asyncify/dist/emscripten-module.mjs deleted file mode 100644 index e13148f..0000000 --- a/.output/server/node_modules/@jitl/quickjs-wasmfile-release-asyncify/dist/emscripten-module.mjs +++ /dev/null @@ -1,30 +0,0 @@ -async function QuickJSRaw(moduleArg={}){var moduleRtn;var d=moduleArg,aa=!!globalThis.window,f=!!globalThis.WorkerGlobalScope,m=globalThis.process?.versions?.node&&"renderer"!=globalThis.process?.type;if(m){const {createRequire:a}=await import("node:module");var require=a(import.meta.url)}function r(a){a={log:a||function(){}};for(const c of r.eb)c(a);return d.quickJSEmscriptenExtensions=a}r.eb=[];d.quickjsEmscriptenInit=r;r.eb.push(a=>{a.getWasmMemory=function(){return t}}); -var w="./this.program",x=(a,c)=>{throw c;},y=import.meta.url,z="",A,B; -if(m){var fs=require("node:fs");y.startsWith("file:")&&(z=require("node:path").dirname(require("node:url").fileURLToPath(y))+"/");B=a=>{a=C(a)?new URL(a):a;return fs.readFileSync(a)};A=async a=>{a=C(a)?new URL(a):a;return fs.readFileSync(a,void 0)};1{process.exitCode=a;throw c;}}else if(aa||f){try{z=(new URL(".",y)).href}catch{}f&&(B=a=>{var c=new XMLHttpRequest;c.open("GET",a,!1);c.responseType="arraybuffer"; -c.send(null);return new Uint8Array(c.response)});A=async a=>{if(C(a))return new Promise((b,e)=>{var g=new XMLHttpRequest;g.open("GET",a,!0);g.responseType="arraybuffer";g.onload=()=>{200==g.status||0==g.status&&g.response?b(g.response):e(g.status)};g.onerror=e;g.send(null)});var c=await fetch(a,{credentials:"same-origin"});if(c.ok)return c.arrayBuffer();throw Error(c.status+" : "+c.url);}} -var ba=console.log.bind(console),D=console.error.bind(console),E,F=!1,G,C=a=>a.startsWith("file://"),ca,da,ea,H,I,J,fa=!1;function ha(){var a=t.buffer;d.HEAP8=ea=new Int8Array(a);new Int16Array(a);d.HEAPU8=H=new Uint8Array(a);new Uint16Array(a);I=new Int32Array(a);J=new Uint32Array(a);new Float32Array(a);new Float64Array(a);new BigInt64Array(a);new BigUint64Array(a)} -function K(a){d.onAbort?.(a);a="Aborted("+a+")";D(a);F=!0;a=new WebAssembly.RuntimeError(a+". Build with -sASSERTIONS for more info.");da?.(a);throw a;}var L;async function ia(a){if(!E)try{var c=await A(a);return new Uint8Array(c)}catch{}if(a==L&&E)a=new Uint8Array(E);else if(B)a=B(a);else throw"both async and sync fetching of the wasm failed";return a} -async function ja(a,c){try{var b=await ia(a);return await WebAssembly.instantiate(b,c)}catch(e){D(`failed to asynchronously prepare wasm: ${e}`),K(e)}}async function ka(a){var c=L;if(!E&&!C(c)&&!m)try{var b=fetch(c,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(b,a)}catch(e){D(`wasm streaming compile failed: ${e}`),D("falling back to ArrayBuffer instantiation")}return ja(c,a)} -class M{name="ExitStatus";constructor(a){this.message=`Program terminated with exit(${a})`;this.status=a}} -var la=a=>{for(;0{var a=d.preRun.shift();na.push(a)},N=!0,t,pa=new TextDecoder,qa=(a,c,b,e)=>{b=c+b;if(e)return b;for(;a[c]&&!(c>=b);)++c;return c},O=(a,c,b)=>a?pa.decode(H.subarray(a,qa(H,a,c,b))):"",P=0,ra=[0,31,60,91,121,152,182,213,244,274,305,335],sa=[0,31,59,90,120,151,181,212,243,273,304,334],Q={},ta=a=>{G=a;N||0{if(!F)try{return a()}catch(c){c instanceof M||"unwind"==c||x(1,c)}finally{if(!(N||0{var e=H;if(!(0=k){if(c>=b)break;e[c++]=k}else if(2047>=k){if(c+1>=b)break;e[c++]=192|k>>6;e[c++]=128|k&63}else if(65535>=k){if(c+2>=b)break;e[c++]=224|k>>12;e[c++]=128|k>>6&63;e[c++]=128|k&63}else{if(c+3>=b)break;e[c++]=240|k>>18;e[c++]=128|k>>12&63;e[c++]=128|k>>6&63;e[c++]=128|k&63;h++}}e[c]=0;return c-g},T={},ua=()=>{if(!U){var a={USER:"web_user", -LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(globalThis.navigator?.language??"C").replace("-","_")+".UTF-8",_:w||"./this.program"},c;for(c in T)void 0===T[c]?delete a[c]:a[c]=T[c];var b=[];for(c in a)b.push(`${c}=${a[c]}`);U=b}return U},U,V=a=>{for(var c=0,b=0;b=e?c++:2047>=e?c+=2:55296<=e&&57343>=e?(c+=4,++b):c+=3}return c},wa=[null,[],[]],W=a=>{try{a()}catch(c){K(c)}}; -function xa(a){var c=(...b)=>{X.Sa.push(a);try{return a(...b)}finally{F||(X.Sa.pop(),X.Qa&&X.state===X.Ra.Za&&0===X.Sa.length&&(X.state=X.Ra.Ua,W(ya),"undefined"!=typeof Fibers&&Fibers.nb()))}};X.ab.set(a,c);return c}function za(){return new Promise((a,c)=>{X.Wa={resolve:a,reject:c}})}function Aa(){var a=Ba(12+X.Va),c=a+12,b=X.Va;J[a>>2]=c;J[a+4>>2]=c+b;c=X.Sa[0];X.Xa.has(c)||(b=X.fb++,X.Xa.set(c,b),X.$a.set(b,c));c=X.Xa.get(c);I[a+8>>2]=c;return a} -function Ca(){var a=X.$a.get(I[X.Qa+8>>2]);a=X.ab.get(a);return R(a)} -var X={kb(a){var c=/^(qts_host_call_function|qts_host_load_module_source|qts_host_normalize_module|invoke_.*|__asyncjs__.*)$/;for(let [b,e]of Object.entries(a))"function"==typeof e&&(e.lb||c.test(b))},Ra:{Ua:0,Za:1,Ya:2,ib:3},state:0,Va:81920,Qa:null,cb:0,Sa:[],Xa:new Map,$a:new Map,ab:new Map,fb:0,Wa:null,hb:[],Ta(a){if(!F){if(X.state===X.Ra.Ua){var c=!1,b=!1;a((e=0)=>{if(!F&&(X.cb=e,c=!0,b)){X.state=X.Ra.Ya;W(()=>Da(X.Qa));"undefined"!=typeof MainLoop&&MainLoop.gb&&MainLoop.resume();e=!1;try{var g= -Ca()}catch(p){g=p,e=!0}var h=!1;if(!X.Qa){var k=X.Wa;k&&(X.Wa=null,(e?k.reject:k.resolve)(g),h=!0)}if(e&&!h)throw g;}});b=!0;c||(X.state=X.Ra.Za,X.Qa=Aa(),"undefined"!=typeof MainLoop&&MainLoop.gb&&MainLoop.pause(),W(()=>Ea(X.Qa)))}else X.state===X.Ra.Ya?(X.state=X.Ra.Ua,W(Fa),Ga(X.Qa),X.Qa=null,X.hb.forEach(R)):K(`invalid state: ${X.state}`);return X.cb}},jb:a=>X.Ta(async c=>{c(await a())})},Ja=(a,c,b,e,g)=>{function h(l){--P;0!==u&&Ha(u);return"string"===c?O(l):"boolean"===c?!!l:l}var k={string:l=> -{var v=0;if(null!==l&&void 0!==l&&0!==l){v=V(l)+1;var va=Y(v);S(l,va,v);v=va}return v},array:l=>{var v=Y(l.length);ea.set(l,v);return v}};a=d["_"+a];var p=[],u=0;if(e)for(var n=0;n{var g=!b||b.every(h=>"number"===h||"boolean"===h);return"string"!==c&&g&&!e?d["_"+a]:(...h)=>Ja(a,c,b,h,e)};d.UTF8ToString=O;d.stringToUTF8=(a,c,b)=>S(a,c,b);d.lengthBytesUTF8=V;d.Asyncify=X; -var Ba,Ga,Ka,Ha,Y,Ia,dynCall_iii,dynCall_vii,dynCall_vi,Ea,ya,Da,Fa,La={b:(a,c,b,e)=>K(`Assertion failed: ${O(a)}, at: `+[c?O(c):"unknown filename",b,e?O(e):"unknown function"]),q:()=>K(""),l:()=>{N=!1;P=0},m:function(a,c){a=-9007199254740992>a||9007199254740992>2]=a.getSeconds();I[c+4>>2]=a.getMinutes();I[c+8>>2]=a.getHours();I[c+12>>2]=a.getDate();I[c+16>>2]=a.getMonth();I[c+20>>2]=a.getFullYear()-1900;I[c+24>>2]=a.getDay();var b=a.getFullYear();I[c+28>>2]= -(0!==b%4||0===b%100&&0!==b%400?sa:ra)[a.getMonth()]+a.getDate()-1|0;I[c+36>>2]=-(60*a.getTimezoneOffset());b=(new Date(a.getFullYear(),6,1)).getTimezoneOffset();var e=(new Date(a.getFullYear(),0,1)).getTimezoneOffset();I[c+32>>2]=(b!=e&&a.getTimezoneOffset()==Math.min(e,b))|0},j:(a,c)=>{Q[a]&&(clearTimeout(Q[a].id),delete Q[a]);if(!c)return 0;var b=setTimeout(()=>{delete Q[a];R(()=>Ka(a,performance.now()))},c);Q[a]={id:b,mb:c};return 0},n:(a,c,b,e)=>{var g=(new Date).getFullYear(),h=(new Date(g,0, -1)).getTimezoneOffset();g=(new Date(g,6,1)).getTimezoneOffset();J[a>>2]=60*Math.max(h,g);I[c>>2]=Number(h!=g);c=k=>{var p=Math.abs(k);return`UTC${0<=k?"-":"+"}${String(Math.floor(p/60)).padStart(2,"0")}${String(p%60).padStart(2,"0")}`};a=c(h);c=c(g);gDate.now(),k:a=>{var c=H.length;a>>>=0;if(2147483648=b;b*=2){var e=c*(1+.2/b);e=Math.min(e,a+100663296);a:{e=(Math.min(2147483648,65536*Math.ceil(Math.max(a,e)/65536))-t.buffer.byteLength+ -65535)/65536|0;try{t.grow(e);ha();var g=1;break a}catch(h){}g=void 0}if(g)return!0}return!1},d:(a,c)=>{var b=0,e=0,g;for(g of ua()){var h=c+b;J[a+e>>2]=h;b+=S(g,h,Infinity)+1;e+=4}return 0},e:(a,c)=>{var b=ua();J[a>>2]=b.length;a=0;for(var e of b)a+=V(e)+1;J[c>>2]=a;return 0},c:()=>52,o:function(){return 70},s:(a,c,b,e)=>{for(var g=0,h=0;h>2],p=J[c+4>>2];c+=8;for(var u=0;u>2]=g;return 0},a:t,r:ta,i:function(a,c,b,e,g){return d.callbacks.callFunction({handleSleep:X.Ta},a,c,b,e,g)},h:function(a){return d.callbacks.shouldInterrupt(void 0,a)},g:function(a,c,b){const e={handleSleep:X.Ta};b=O(b);return d.callbacks.loadModuleSource(e,a,c,b)},f:function(a,c,b,e){const g={handleSleep:X.Ta};b=O(b);e=O(e);return d.callbacks.normalizeModule(g,a,c,b,e)},t:function(a,c){d.callbacks.freeHostRef(void 0,a,c)},u:function(a, -c){X.Va=a||c}},Z; -Z=await (async function(){function a(b){var e=Z=b.exports;b={};for(let [g,h]of Object.entries(e))"function"==typeof h?(e=xa(h),b[g]=e):b[g]=h;b=Z=b;Ba=d._malloc=b.w;d._QTS_Throw=b.x;d._QTS_NewError=b.y;d._QTS_RuntimeSetMemoryLimit=b.z;d._QTS_RuntimeComputeMemoryUsage=b.A;d._QTS_RuntimeDumpMemoryUsage=b.B;d._QTS_RecoverableLeakCheck=b.C;d._QTS_BuildIsSanitizeLeak=b.D;d._QTS_RuntimeSetMaxStackSize=b.E;d._QTS_GetUndefined=b.F;d._QTS_GetNull=b.G;d._QTS_GetFalse=b.H;d._QTS_GetTrue=b.I;d._QTS_NewHostRef= -b.J;d._QTS_GetHostRefId=b.K;d._QTS_NewRuntime=b.L;d._QTS_FreeRuntime=b.M;Ga=d._free=b.N;d._QTS_NewContext=b.O;d._QTS_FreeContext=b.P;d._QTS_FreeValuePointer=b.Q;d._QTS_FreeValuePointerRuntime=b.R;d._QTS_FreeVoidPointer=b.S;d._QTS_FreeCString=b.T;d._QTS_DupValuePointer=b.U;d._QTS_NewObject=b.V;d._QTS_NewObjectProto=b.W;d._QTS_NewArray=b.X;d._QTS_NewArrayBuffer=b.Y;d._QTS_NewFloat64=b.Z;d._QTS_GetFloat64=b._;d._QTS_NewString=b.$;d._QTS_GetString=b.aa;d._QTS_GetArrayBuffer=b.ba;d._QTS_GetArrayBufferLength= -b.ca;d._QTS_NewSymbol=b.da;d._QTS_GetSymbolDescriptionOrKey=b.ea;d._QTS_IsGlobalSymbol=b.fa;d._QTS_IsJobPending=b.ga;d._QTS_ExecutePendingJob=b.ha;d._QTS_GetProp=b.ia;d._QTS_GetPropNumber=b.ja;d._QTS_SetProp=b.ka;d._QTS_DefineProp=b.la;d._QTS_GetOwnPropertyNames=b.ma;d._QTS_Call=b.na;d._QTS_ResolveException=b.oa;d._QTS_Dump=b.pa;d._QTS_Eval=b.qa;d._QTS_GetModuleNamespace=b.ra;d._QTS_Typeof=b.sa;d._QTS_GetLength=b.ta;d._QTS_IsEqual=b.ua;d._QTS_GetGlobalObject=b.va;d._QTS_NewPromiseCapability=b.wa; -d._QTS_PromiseState=b.xa;d._QTS_PromiseResult=b.ya;d._QTS_TestStringArg=b.za;d._QTS_GetDebugLogEnabled=b.Aa;d._QTS_SetDebugLogEnabled=b.Ba;d._QTS_BuildIsDebug=b.Ca;d._QTS_BuildIsAsyncify=b.Da;d._QTS_NewFunction=b.Ea;d._QTS_ArgvGetJSValueConstPointer=b.Fa;d._QTS_RuntimeEnableInterruptHandler=b.Ga;d._QTS_RuntimeDisableInterruptHandler=b.Ha;d._QTS_RuntimeEnableModuleLoader=b.Ia;d._QTS_RuntimeDisableModuleLoader=b.Ja;d._QTS_bjson_encode=b.Ka;d._QTS_bjson_decode=b.La;Ka=b.Ma;Ha=b.Na;Y=b.Oa;Ia=b.Pa;dynCall_iii= -b._a;dynCall_vii=b.bb;dynCall_vi=b.sb;Ea=b.tb;ya=b.ub;Da=b.vb;Fa=b.wb;return Z}var c={a:La};if(d.instantiateWasm)return new Promise(b=>{d.instantiateWasm(c,(e,g)=>{b(a(e,g))})});L??=d.locateFile?d.locateFile?d.locateFile("emscripten-module.wasm",z):z+"emscripten-module.wasm":(new URL("emscripten-module.wasm",import.meta.url)).href;return a((await ka(c)).instance)}()); -(function(){function a(){d.calledRun=!0;if(!F){fa=!0;Z.v();ca?.(d);d.onRuntimeInitialized?.();if(d.postRun)for("function"==typeof d.postRun&&(d.postRun=[d.postRun]);d.postRun.length;){var c=d.postRun.shift();ma.push(c)}la(ma)}}if(d.preRun)for("function"==typeof d.preRun&&(d.preRun=[d.preRun]);d.preRun.length;)oa();la(na);d.setStatus?(d.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>d.setStatus(""),1);a()},1)):a()})();fa?moduleRtn=d:moduleRtn=new Promise((a,c)=>{ca=a;da=c}); -;return moduleRtn}export default QuickJSRaw; diff --git a/.output/server/node_modules/@jitl/quickjs-wasmfile-release-asyncify/dist/emscripten-module.wasm b/.output/server/node_modules/@jitl/quickjs-wasmfile-release-asyncify/dist/emscripten-module.wasm deleted file mode 100644 index 53a809d..0000000 Binary files a/.output/server/node_modules/@jitl/quickjs-wasmfile-release-asyncify/dist/emscripten-module.wasm and /dev/null differ diff --git a/.output/server/node_modules/@jitl/quickjs-wasmfile-release-asyncify/dist/ffi.mjs b/.output/server/node_modules/@jitl/quickjs-wasmfile-release-asyncify/dist/ffi.mjs deleted file mode 100644 index ae31c92..0000000 --- a/.output/server/node_modules/@jitl/quickjs-wasmfile-release-asyncify/dist/ffi.mjs +++ /dev/null @@ -1,2 +0,0 @@ -import{assertSync}from"@jitl/quickjs-ffi-types";var QuickJSAsyncFFI=class{constructor(module){this.module=module;this.DEBUG=!1;this.QTS_Throw=this.module.cwrap("QTS_Throw","number",["number","number"]);this.QTS_NewError=this.module.cwrap("QTS_NewError","number",["number"]);this.QTS_RuntimeSetMemoryLimit=this.module.cwrap("QTS_RuntimeSetMemoryLimit",null,["number","number"]);this.QTS_RuntimeComputeMemoryUsage=this.module.cwrap("QTS_RuntimeComputeMemoryUsage","number",["number","number"]);this.QTS_RuntimeDumpMemoryUsage=this.module.cwrap("QTS_RuntimeDumpMemoryUsage","number",["number"]);this.QTS_RecoverableLeakCheck=this.module.cwrap("QTS_RecoverableLeakCheck","number",[]);this.QTS_BuildIsSanitizeLeak=this.module.cwrap("QTS_BuildIsSanitizeLeak","number",[]);this.QTS_RuntimeSetMaxStackSize=this.module.cwrap("QTS_RuntimeSetMaxStackSize",null,["number","number"]);this.QTS_GetUndefined=this.module.cwrap("QTS_GetUndefined","number",[]);this.QTS_GetNull=this.module.cwrap("QTS_GetNull","number",[]);this.QTS_GetFalse=this.module.cwrap("QTS_GetFalse","number",[]);this.QTS_GetTrue=this.module.cwrap("QTS_GetTrue","number",[]);this.QTS_NewHostRef=this.module.cwrap("QTS_NewHostRef","number",["number","number"]);this.QTS_GetHostRefId=this.module.cwrap("QTS_GetHostRefId","number",["number"]);this.QTS_NewRuntime=this.module.cwrap("QTS_NewRuntime","number",[]);this.QTS_FreeRuntime=this.module.cwrap("QTS_FreeRuntime",null,["number"]);this.QTS_NewContext=this.module.cwrap("QTS_NewContext","number",["number","number"]);this.QTS_FreeContext=this.module.cwrap("QTS_FreeContext",null,["number"]);this.QTS_FreeValuePointer=this.module.cwrap("QTS_FreeValuePointer",null,["number","number"]);this.QTS_FreeValuePointerRuntime=this.module.cwrap("QTS_FreeValuePointerRuntime",null,["number","number"]);this.QTS_FreeVoidPointer=this.module.cwrap("QTS_FreeVoidPointer",null,["number","number"]);this.QTS_FreeCString=this.module.cwrap("QTS_FreeCString",null,["number","number"]);this.QTS_DupValuePointer=this.module.cwrap("QTS_DupValuePointer","number",["number","number"]);this.QTS_NewObject=this.module.cwrap("QTS_NewObject","number",["number"]);this.QTS_NewObjectProto=this.module.cwrap("QTS_NewObjectProto","number",["number","number"]);this.QTS_NewArray=this.module.cwrap("QTS_NewArray","number",["number"]);this.QTS_NewArrayBuffer=this.module.cwrap("QTS_NewArrayBuffer","number",["number","number","number"]);this.QTS_NewFloat64=this.module.cwrap("QTS_NewFloat64","number",["number","number"]);this.QTS_GetFloat64=this.module.cwrap("QTS_GetFloat64","number",["number","number"]);this.QTS_NewString=this.module.cwrap("QTS_NewString","number",["number","number"]);this.QTS_GetString=this.module.cwrap("QTS_GetString","number",["number","number"]);this.QTS_GetArrayBuffer=this.module.cwrap("QTS_GetArrayBuffer","number",["number","number"]);this.QTS_GetArrayBufferLength=this.module.cwrap("QTS_GetArrayBufferLength","number",["number","number"]);this.QTS_NewSymbol=this.module.cwrap("QTS_NewSymbol","number",["number","number","number"]);this.QTS_GetSymbolDescriptionOrKey=assertSync(this.module.cwrap("QTS_GetSymbolDescriptionOrKey","number",["number","number"]));this.QTS_GetSymbolDescriptionOrKey_MaybeAsync=this.module.cwrap("QTS_GetSymbolDescriptionOrKey","number",["number","number"]);this.QTS_IsGlobalSymbol=this.module.cwrap("QTS_IsGlobalSymbol","number",["number","number"]);this.QTS_IsJobPending=this.module.cwrap("QTS_IsJobPending","number",["number"]);this.QTS_ExecutePendingJob=assertSync(this.module.cwrap("QTS_ExecutePendingJob","number",["number","number","number"]));this.QTS_ExecutePendingJob_MaybeAsync=this.module.cwrap("QTS_ExecutePendingJob","number",["number","number","number"]);this.QTS_GetProp=assertSync(this.module.cwrap("QTS_GetProp","number",["number","number","number"]));this.QTS_GetProp_MaybeAsync=this.module.cwrap("QTS_GetProp","number",["number","number","number"]);this.QTS_GetPropNumber=assertSync(this.module.cwrap("QTS_GetPropNumber","number",["number","number","number"]));this.QTS_GetPropNumber_MaybeAsync=this.module.cwrap("QTS_GetPropNumber","number",["number","number","number"]);this.QTS_SetProp=assertSync(this.module.cwrap("QTS_SetProp",null,["number","number","number","number"]));this.QTS_SetProp_MaybeAsync=this.module.cwrap("QTS_SetProp",null,["number","number","number","number"]);this.QTS_DefineProp=this.module.cwrap("QTS_DefineProp",null,["number","number","number","number","number","number","boolean","boolean","boolean"]);this.QTS_GetOwnPropertyNames=assertSync(this.module.cwrap("QTS_GetOwnPropertyNames","number",["number","number","number","number","number"]));this.QTS_GetOwnPropertyNames_MaybeAsync=this.module.cwrap("QTS_GetOwnPropertyNames","number",["number","number","number","number","number"]);this.QTS_Call=assertSync(this.module.cwrap("QTS_Call","number",["number","number","number","number","number"]));this.QTS_Call_MaybeAsync=this.module.cwrap("QTS_Call","number",["number","number","number","number","number"]);this.QTS_ResolveException=this.module.cwrap("QTS_ResolveException","number",["number","number"]);this.QTS_Dump=assertSync(this.module.cwrap("QTS_Dump","number",["number","number"]));this.QTS_Dump_MaybeAsync=this.module.cwrap("QTS_Dump","number",["number","number"]);this.QTS_Eval=assertSync(this.module.cwrap("QTS_Eval","number",["number","number","number","string","number","number"]));this.QTS_Eval_MaybeAsync=this.module.cwrap("QTS_Eval","number",["number","number","number","string","number","number"]);this.QTS_GetModuleNamespace=this.module.cwrap("QTS_GetModuleNamespace","number",["number","number"]);this.QTS_Typeof=this.module.cwrap("QTS_Typeof","number",["number","number"]);this.QTS_GetLength=this.module.cwrap("QTS_GetLength","number",["number","number","number"]);this.QTS_IsEqual=this.module.cwrap("QTS_IsEqual","number",["number","number","number","number"]);this.QTS_GetGlobalObject=this.module.cwrap("QTS_GetGlobalObject","number",["number"]);this.QTS_NewPromiseCapability=this.module.cwrap("QTS_NewPromiseCapability","number",["number","number"]);this.QTS_PromiseState=this.module.cwrap("QTS_PromiseState","number",["number","number"]);this.QTS_PromiseResult=this.module.cwrap("QTS_PromiseResult","number",["number","number"]);this.QTS_TestStringArg=this.module.cwrap("QTS_TestStringArg",null,["string"]);this.QTS_GetDebugLogEnabled=this.module.cwrap("QTS_GetDebugLogEnabled","number",["number"]);this.QTS_SetDebugLogEnabled=this.module.cwrap("QTS_SetDebugLogEnabled",null,["number","number"]);this.QTS_BuildIsDebug=this.module.cwrap("QTS_BuildIsDebug","number",[]);this.QTS_BuildIsAsyncify=this.module.cwrap("QTS_BuildIsAsyncify","number",[]);this.QTS_NewFunction=this.module.cwrap("QTS_NewFunction","number",["number","string","number","boolean","number"]);this.QTS_ArgvGetJSValueConstPointer=this.module.cwrap("QTS_ArgvGetJSValueConstPointer","number",["number","number"]);this.QTS_RuntimeEnableInterruptHandler=this.module.cwrap("QTS_RuntimeEnableInterruptHandler",null,["number"]);this.QTS_RuntimeDisableInterruptHandler=this.module.cwrap("QTS_RuntimeDisableInterruptHandler",null,["number"]);this.QTS_RuntimeEnableModuleLoader=this.module.cwrap("QTS_RuntimeEnableModuleLoader",null,["number","number"]);this.QTS_RuntimeDisableModuleLoader=this.module.cwrap("QTS_RuntimeDisableModuleLoader",null,["number"]);this.QTS_bjson_encode=this.module.cwrap("QTS_bjson_encode","number",["number","number"]);this.QTS_bjson_decode=this.module.cwrap("QTS_bjson_decode","number",["number","number"])}};export{QuickJSAsyncFFI}; -//# sourceMappingURL=ffi.mjs.map \ No newline at end of file diff --git a/.output/server/node_modules/@jitl/quickjs-wasmfile-release-asyncify/dist/index.mjs b/.output/server/node_modules/@jitl/quickjs-wasmfile-release-asyncify/dist/index.mjs deleted file mode 100644 index 1df6a57..0000000 --- a/.output/server/node_modules/@jitl/quickjs-wasmfile-release-asyncify/dist/index.mjs +++ /dev/null @@ -1,2 +0,0 @@ -var variant={type:"async",importFFI:()=>import("./ffi.mjs").then(mod=>mod.QuickJSAsyncFFI),importModuleLoader:()=>import("@jitl/quickjs-wasmfile-release-asyncify/emscripten-module").then(mod=>mod.default)},src_default=variant;export{src_default as default}; -//# sourceMappingURL=index.mjs.map \ No newline at end of file diff --git a/.output/server/node_modules/@jitl/quickjs-wasmfile-release-asyncify/package.json b/.output/server/node_modules/@jitl/quickjs-wasmfile-release-asyncify/package.json deleted file mode 100644 index 4a148eb..0000000 --- a/.output/server/node_modules/@jitl/quickjs-wasmfile-release-asyncify/package.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "name": "@jitl/quickjs-wasmfile-release-asyncify", - "license": "MIT", - "version": "0.32.0", - "description": "Variant of quickjs library: Variant with separate .WASM file. Supports browser ESM, NodeJS ESM, and NodeJS CommonJS.", - "sideEffects": false, - "repository": { - "type": "git", - "url": "https://github.com/justjake/quickjs-emscripten" - }, - "author": { - "name": "Jake Teton-Landis", - "url": "https://jake.tl" - }, - "scripts": { - "build": "yarn build:c && yarn build:ts", - "build:c": "make", - "build:ts": "npx tsup", - "check:types": "npx tsc --project . --noEmit", - "clean": "make clean", - "prepare": "yarn clean && yarn build" - }, - "files": [ - "LICENSE", - "README.md", - "dist/**/*", - "!dist/*.tsbuildinfo" - ], - "types": "./dist/index.d.ts", - "main": "./dist/index.js", - "module": "./dist/index.mjs", - "browser": "./dist/index.mjs", - "exports": { - ".": { - "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", - "require": "./dist/index.js", - "default": "./dist/index.js" - }, - "./package.json": "./package.json", - "./ffi": { - "types": "./dist/ffi.d.ts", - "import": "./dist/ffi.mjs", - "require": "./dist/ffi.js", - "default": "./dist/ffi.js" - }, - "./wasm": "./dist/emscripten-module.wasm", - "./emscripten-module": { - "types": "./dist/emscripten-module.browser.d.ts", - "iife": "./dist/emscripten-module.cjs", - "workerd": "./dist/emscripten-module.cloudflare.cjs", - "browser": "./dist/emscripten-module.browser.mjs", - "import": "./dist/emscripten-module.mjs", - "require": "./dist/emscripten-module.cjs", - "default": "./dist/emscripten-module.cjs" - } - }, - "dependencies": { - "@jitl/quickjs-ffi-types": "0.32.0" - } -} \ No newline at end of file diff --git a/.output/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.mjs b/.output/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.mjs deleted file mode 100644 index c551b23..0000000 --- a/.output/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.mjs +++ /dev/null @@ -1,25 +0,0 @@ -async function QuickJSRaw(moduleArg={}){var moduleRtn;var d=moduleArg,aa=!!globalThis.window,n=!!globalThis.WorkerGlobalScope,q=globalThis.process?.versions?.node&&"renderer"!=globalThis.process?.type;if(q){const {createRequire:a}=await import("node:module");var require=a(import.meta.url)}function r(a){a={log:a||function(){}};for(const c of r.Pa)c(a);return d.quickJSEmscriptenExtensions=a}r.Pa=[];d.quickjsEmscriptenInit=r;r.Pa.push(a=>{a.getWasmMemory=function(){return t}}); -var u="./this.program",v=(a,c)=>{throw c;},w=import.meta.url,y="",z,A; -if(q){var fs=require("node:fs");w.startsWith("file:")&&(y=require("node:path").dirname(require("node:url").fileURLToPath(w))+"/");A=a=>{a=B(a)?new URL(a):a;return fs.readFileSync(a)};z=async a=>{a=B(a)?new URL(a):a;return fs.readFileSync(a,void 0)};1{process.exitCode=a;throw c;}}else if(aa||n){try{y=(new URL(".",w)).href}catch{}n&&(A=a=>{var c=new XMLHttpRequest;c.open("GET",a,!1);c.responseType="arraybuffer"; -c.send(null);return new Uint8Array(c.response)});z=async a=>{if(B(a))return new Promise((b,e)=>{var f=new XMLHttpRequest;f.open("GET",a,!0);f.responseType="arraybuffer";f.onload=()=>{200==f.status||0==f.status&&f.response?b(f.response):e(f.status)};f.onerror=e;f.send(null)});var c=await fetch(a,{credentials:"same-origin"});if(c.ok)return c.arrayBuffer();throw Error(c.status+" : "+c.url);}} -var C=console.log.bind(console),D=console.error.bind(console),E,F=!1,G,B=a=>a.startsWith("file://"),H,I,J,K,L,M,ba=!1;function ca(){var a=t.buffer;d.HEAP8=J=new Int8Array(a);new Int16Array(a);d.HEAPU8=K=new Uint8Array(a);new Uint16Array(a);L=new Int32Array(a);M=new Uint32Array(a);new Float32Array(a);new Float64Array(a);new BigInt64Array(a);new BigUint64Array(a)} -function N(a){d.onAbort?.(a);a="Aborted("+a+")";D(a);F=!0;a=new WebAssembly.RuntimeError(a+". Build with -sASSERTIONS for more info.");I?.(a);throw a;}var O;async function da(a){if(!E)try{var c=await z(a);return new Uint8Array(c)}catch{}if(a==O&&E)a=new Uint8Array(E);else if(A)a=A(a);else throw"both async and sync fetching of the wasm failed";return a} -async function ea(a,c){try{var b=await da(a);return await WebAssembly.instantiate(b,c)}catch(e){D(`failed to asynchronously prepare wasm: ${e}`),N(e)}}async function fa(a){var c=O;if(!E&&!B(c)&&!q)try{var b=fetch(c,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(b,a)}catch(e){D(`wasm streaming compile failed: ${e}`),D("falling back to ArrayBuffer instantiation")}return ea(c,a)} -class P{name="ExitStatus";constructor(a){this.message=`Program terminated with exit(${a})`;this.status=a}} -var ha=a=>{for(;0{var a=d.preRun.shift();ja.push(a)},Q=!0,t,la=new TextDecoder,ma=(a,c,b,e)=>{b=c+b;if(e)return b;for(;a[c]&&!(c>=b);)++c;return c},R=(a,c,b)=>a?la.decode(K.subarray(a,ma(K,a,c,b))):"",S=0,na=[0,31,60,91,121,152,182,213,244,274,305,335],oa=[0,31,59,90,120,151,181,212,243,273,304,334],T={},pa=a=>{G=a;Q||0{if(!F)try{a()}catch(c){c instanceof P||"unwind"==c||v(1,c)}finally{if(!(Q||0{var e=K;if(!(0=h){if(c>=b)break;e[c++]=h}else if(2047>=h){if(c+1>=b)break;e[c++]=192|h>>6;e[c++]=128|h&63}else if(65535>=h){if(c+2>=b)break;e[c++]=224|h>>12;e[c++]=128|h>>6&63;e[c++]=128|h&63}else{if(c+3>=b)break;e[c++]=240|h>>18;e[c++]=128|h>>12&63;e[c++]=128|h>>6&63;e[c++]=128|h&63;g++}}e[c]=0;return c-f},V={},ra=()=>{if(!W){var a={USER:"web_user", -LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(globalThis.navigator?.language??"C").replace("-","_")+".UTF-8",_:u||"./this.program"},c;for(c in V)void 0===V[c]?delete a[c]:a[c]=V[c];var b=[];for(c in a)b.push(`${c}=${a[c]}`);W=b}return W},W,X=a=>{for(var c=0,b=0;b=e?c++:2047>=e?c+=2:55296<=e&&57343>=e?(c+=4,++b):c+=3}return c},sa=[null,[],[]],va=(a,c,b,e)=>{var f={string:k=>{var l=0;if(null!==k&&void 0!==k&&0!==k){l=X(k)+1;var p=Y(l);U(k,p, -l);l=p}return l},array:k=>{var l=Y(k.length);J.set(k,l);return l}};a=d["_"+a];var g=[],h=0;if(e)for(var m=0;m{var f=!b||b.every(g=>"number"===g||"boolean"===g);return"string"!==c&&f&&!e?d["_"+a]:(...g)=>va(a,c,b,g)};d.UTF8ToString=R;d.stringToUTF8=(a,c,b)=>U(a,c,b);d.lengthBytesUTF8=X; -var wa,ua,Y,ta,xa={b:(a,c,b,e)=>N(`Assertion failed: ${R(a)}, at: `+[c?R(c):"unknown filename",b,e?R(e):"unknown function"]),q:()=>N(""),l:()=>{Q=!1;S=0},m:function(a,c){a=-9007199254740992>a||9007199254740992>2]=a.getSeconds();L[c+4>>2]=a.getMinutes();L[c+8>>2]=a.getHours();L[c+12>>2]=a.getDate();L[c+16>>2]=a.getMonth();L[c+20>>2]=a.getFullYear()-1900;L[c+24>>2]=a.getDay();var b=a.getFullYear();L[c+28>>2]=(0!==b%4||0===b%100&&0!==b%400?oa:na)[a.getMonth()]+ -a.getDate()-1|0;L[c+36>>2]=-(60*a.getTimezoneOffset());b=(new Date(a.getFullYear(),6,1)).getTimezoneOffset();var e=(new Date(a.getFullYear(),0,1)).getTimezoneOffset();L[c+32>>2]=(b!=e&&a.getTimezoneOffset()==Math.min(e,b))|0},j:(a,c)=>{T[a]&&(clearTimeout(T[a].id),delete T[a]);if(!c)return 0;var b=setTimeout(()=>{delete T[a];qa(()=>wa(a,performance.now()))},c);T[a]={id:b,Qa:c};return 0},n:(a,c,b,e)=>{var f=(new Date).getFullYear(),g=(new Date(f,0,1)).getTimezoneOffset();f=(new Date(f,6,1)).getTimezoneOffset(); -M[a>>2]=60*Math.max(g,f);L[c>>2]=Number(g!=f);c=h=>{var m=Math.abs(h);return`UTC${0<=h?"-":"+"}${String(Math.floor(m/60)).padStart(2,"0")}${String(m%60).padStart(2,"0")}`};a=c(g);c=c(f);fDate.now(),k:a=>{var c=K.length;a>>>=0;if(2147483648=b;b*=2){var e=c*(1+.2/b);e=Math.min(e,a+100663296);a:{e=(Math.min(2147483648,65536*Math.ceil(Math.max(a,e)/65536))-t.buffer.byteLength+65535)/65536|0;try{t.grow(e);ca();var f=1;break a}catch(g){}f= -void 0}if(f)return!0}return!1},e:(a,c)=>{var b=0,e=0,f;for(f of ra()){var g=c+b;M[a+e>>2]=g;b+=U(f,g,Infinity)+1;e+=4}return 0},f:(a,c)=>{var b=ra();M[a>>2]=b.length;a=0;for(var e of b)a+=X(e)+1;M[c>>2]=a;return 0},d:()=>52,o:function(){return 70},c:(a,c,b,e)=>{for(var f=0,g=0;g>2],m=M[c+4>>2];c+=8;for(var x=0;x> -2]=f;return 0},a:t,r:pa,s:function(a,c,b,e,f){return d.callbacks.callFunction(void 0,a,c,b,e,f)},i:function(a){return d.callbacks.shouldInterrupt(void 0,a)},h:function(a,c,b){b=R(b);return d.callbacks.loadModuleSource(void 0,a,c,b)},g:function(a,c,b,e){b=R(b);e=R(e);return d.callbacks.normalizeModule(void 0,a,c,b,e)},t:function(a,c){d.callbacks.freeHostRef(void 0,a,c)}},Z; -Z=await (async function(){function a(b){b=Z=b.exports;d._malloc=b.v;d._QTS_Throw=b.w;d._QTS_NewError=b.x;d._QTS_RuntimeSetMemoryLimit=b.y;d._QTS_RuntimeComputeMemoryUsage=b.z;d._QTS_RuntimeDumpMemoryUsage=b.A;d._QTS_RecoverableLeakCheck=b.B;d._QTS_BuildIsSanitizeLeak=b.C;d._QTS_RuntimeSetMaxStackSize=b.D;d._QTS_GetUndefined=b.E;d._QTS_GetNull=b.F;d._QTS_GetFalse=b.G;d._QTS_GetTrue=b.H;d._QTS_NewHostRef=b.I;d._QTS_GetHostRefId=b.J;d._QTS_NewRuntime=b.K;d._QTS_FreeRuntime=b.L;d._free=b.M; -d._QTS_NewContext=b.N;d._QTS_FreeContext=b.O;d._QTS_FreeValuePointer=b.P;d._QTS_FreeValuePointerRuntime=b.Q;d._QTS_FreeVoidPointer=b.R;d._QTS_FreeCString=b.S;d._QTS_DupValuePointer=b.T;d._QTS_NewObject=b.U;d._QTS_NewObjectProto=b.V;d._QTS_NewArray=b.W;d._QTS_NewArrayBuffer=b.X;d._QTS_NewFloat64=b.Y;d._QTS_GetFloat64=b.Z;d._QTS_NewString=b._;d._QTS_GetString=b.$;d._QTS_GetArrayBuffer=b.aa;d._QTS_GetArrayBufferLength=b.ba;d._QTS_NewSymbol=b.ca;d._QTS_GetSymbolDescriptionOrKey=b.da;d._QTS_IsGlobalSymbol= -b.ea;d._QTS_IsJobPending=b.fa;d._QTS_ExecutePendingJob=b.ga;d._QTS_GetProp=b.ha;d._QTS_GetPropNumber=b.ia;d._QTS_SetProp=b.ja;d._QTS_DefineProp=b.ka;d._QTS_GetOwnPropertyNames=b.la;d._QTS_Call=b.ma;d._QTS_ResolveException=b.na;d._QTS_Dump=b.oa;d._QTS_Eval=b.pa;d._QTS_GetModuleNamespace=b.qa;d._QTS_Typeof=b.ra;d._QTS_GetLength=b.sa;d._QTS_IsEqual=b.ta;d._QTS_GetGlobalObject=b.ua;d._QTS_NewPromiseCapability=b.va;d._QTS_PromiseState=b.wa;d._QTS_PromiseResult=b.xa;d._QTS_TestStringArg=b.ya;d._QTS_GetDebugLogEnabled= -b.za;d._QTS_SetDebugLogEnabled=b.Aa;d._QTS_BuildIsDebug=b.Ba;d._QTS_BuildIsAsyncify=b.Ca;d._QTS_NewFunction=b.Da;d._QTS_ArgvGetJSValueConstPointer=b.Ea;d._QTS_RuntimeEnableInterruptHandler=b.Fa;d._QTS_RuntimeDisableInterruptHandler=b.Ga;d._QTS_RuntimeEnableModuleLoader=b.Ha;d._QTS_RuntimeDisableModuleLoader=b.Ia;d._QTS_bjson_encode=b.Ja;d._QTS_bjson_decode=b.Ka;wa=b.La;ua=b.Ma;Y=b.Na;ta=b.Oa;return Z}var c={a:xa};if(d.instantiateWasm)return new Promise(b=>{d.instantiateWasm(c,(e,f)=>{b(a(e,f))})}); -O??=d.locateFile?d.locateFile?d.locateFile("emscripten-module.wasm",y):y+"emscripten-module.wasm":(new URL("emscripten-module.wasm",import.meta.url)).href;return a((await fa(c)).instance)}()); -(function(){function a(){d.calledRun=!0;if(!F){ba=!0;Z.u();H?.(d);d.onRuntimeInitialized?.();if(d.postRun)for("function"==typeof d.postRun&&(d.postRun=[d.postRun]);d.postRun.length;){var c=d.postRun.shift();ia.push(c)}ha(ia)}}if(d.preRun)for("function"==typeof d.preRun&&(d.preRun=[d.preRun]);d.preRun.length;)ka();ha(ja);d.setStatus?(d.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>d.setStatus(""),1);a()},1)):a()})();ba?moduleRtn=d:moduleRtn=new Promise((a,c)=>{H=a;I=c}); -;return moduleRtn}export default QuickJSRaw; diff --git a/.output/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.wasm b/.output/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.wasm deleted file mode 100644 index 1815757..0000000 Binary files a/.output/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.wasm and /dev/null differ diff --git a/.output/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.mjs b/.output/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.mjs deleted file mode 100644 index 6753b3f..0000000 --- a/.output/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.mjs +++ /dev/null @@ -1,2 +0,0 @@ -var QuickJSFFI=class{constructor(module){this.module=module;this.DEBUG=!1;this.QTS_Throw=this.module.cwrap("QTS_Throw","number",["number","number"]);this.QTS_NewError=this.module.cwrap("QTS_NewError","number",["number"]);this.QTS_RuntimeSetMemoryLimit=this.module.cwrap("QTS_RuntimeSetMemoryLimit",null,["number","number"]);this.QTS_RuntimeComputeMemoryUsage=this.module.cwrap("QTS_RuntimeComputeMemoryUsage","number",["number","number"]);this.QTS_RuntimeDumpMemoryUsage=this.module.cwrap("QTS_RuntimeDumpMemoryUsage","number",["number"]);this.QTS_RecoverableLeakCheck=this.module.cwrap("QTS_RecoverableLeakCheck","number",[]);this.QTS_BuildIsSanitizeLeak=this.module.cwrap("QTS_BuildIsSanitizeLeak","number",[]);this.QTS_RuntimeSetMaxStackSize=this.module.cwrap("QTS_RuntimeSetMaxStackSize",null,["number","number"]);this.QTS_GetUndefined=this.module.cwrap("QTS_GetUndefined","number",[]);this.QTS_GetNull=this.module.cwrap("QTS_GetNull","number",[]);this.QTS_GetFalse=this.module.cwrap("QTS_GetFalse","number",[]);this.QTS_GetTrue=this.module.cwrap("QTS_GetTrue","number",[]);this.QTS_NewHostRef=this.module.cwrap("QTS_NewHostRef","number",["number","number"]);this.QTS_GetHostRefId=this.module.cwrap("QTS_GetHostRefId","number",["number"]);this.QTS_NewRuntime=this.module.cwrap("QTS_NewRuntime","number",[]);this.QTS_FreeRuntime=this.module.cwrap("QTS_FreeRuntime",null,["number"]);this.QTS_NewContext=this.module.cwrap("QTS_NewContext","number",["number","number"]);this.QTS_FreeContext=this.module.cwrap("QTS_FreeContext",null,["number"]);this.QTS_FreeValuePointer=this.module.cwrap("QTS_FreeValuePointer",null,["number","number"]);this.QTS_FreeValuePointerRuntime=this.module.cwrap("QTS_FreeValuePointerRuntime",null,["number","number"]);this.QTS_FreeVoidPointer=this.module.cwrap("QTS_FreeVoidPointer",null,["number","number"]);this.QTS_FreeCString=this.module.cwrap("QTS_FreeCString",null,["number","number"]);this.QTS_DupValuePointer=this.module.cwrap("QTS_DupValuePointer","number",["number","number"]);this.QTS_NewObject=this.module.cwrap("QTS_NewObject","number",["number"]);this.QTS_NewObjectProto=this.module.cwrap("QTS_NewObjectProto","number",["number","number"]);this.QTS_NewArray=this.module.cwrap("QTS_NewArray","number",["number"]);this.QTS_NewArrayBuffer=this.module.cwrap("QTS_NewArrayBuffer","number",["number","number","number"]);this.QTS_NewFloat64=this.module.cwrap("QTS_NewFloat64","number",["number","number"]);this.QTS_GetFloat64=this.module.cwrap("QTS_GetFloat64","number",["number","number"]);this.QTS_NewString=this.module.cwrap("QTS_NewString","number",["number","number"]);this.QTS_GetString=this.module.cwrap("QTS_GetString","number",["number","number"]);this.QTS_GetArrayBuffer=this.module.cwrap("QTS_GetArrayBuffer","number",["number","number"]);this.QTS_GetArrayBufferLength=this.module.cwrap("QTS_GetArrayBufferLength","number",["number","number"]);this.QTS_NewSymbol=this.module.cwrap("QTS_NewSymbol","number",["number","number","number"]);this.QTS_GetSymbolDescriptionOrKey=this.module.cwrap("QTS_GetSymbolDescriptionOrKey","number",["number","number"]);this.QTS_IsGlobalSymbol=this.module.cwrap("QTS_IsGlobalSymbol","number",["number","number"]);this.QTS_IsJobPending=this.module.cwrap("QTS_IsJobPending","number",["number"]);this.QTS_ExecutePendingJob=this.module.cwrap("QTS_ExecutePendingJob","number",["number","number","number"]);this.QTS_GetProp=this.module.cwrap("QTS_GetProp","number",["number","number","number"]);this.QTS_GetPropNumber=this.module.cwrap("QTS_GetPropNumber","number",["number","number","number"]);this.QTS_SetProp=this.module.cwrap("QTS_SetProp",null,["number","number","number","number"]);this.QTS_DefineProp=this.module.cwrap("QTS_DefineProp",null,["number","number","number","number","number","number","boolean","boolean","boolean"]);this.QTS_GetOwnPropertyNames=this.module.cwrap("QTS_GetOwnPropertyNames","number",["number","number","number","number","number"]);this.QTS_Call=this.module.cwrap("QTS_Call","number",["number","number","number","number","number"]);this.QTS_ResolveException=this.module.cwrap("QTS_ResolveException","number",["number","number"]);this.QTS_Dump=this.module.cwrap("QTS_Dump","number",["number","number"]);this.QTS_Eval=this.module.cwrap("QTS_Eval","number",["number","number","number","string","number","number"]);this.QTS_GetModuleNamespace=this.module.cwrap("QTS_GetModuleNamespace","number",["number","number"]);this.QTS_Typeof=this.module.cwrap("QTS_Typeof","number",["number","number"]);this.QTS_GetLength=this.module.cwrap("QTS_GetLength","number",["number","number","number"]);this.QTS_IsEqual=this.module.cwrap("QTS_IsEqual","number",["number","number","number","number"]);this.QTS_GetGlobalObject=this.module.cwrap("QTS_GetGlobalObject","number",["number"]);this.QTS_NewPromiseCapability=this.module.cwrap("QTS_NewPromiseCapability","number",["number","number"]);this.QTS_PromiseState=this.module.cwrap("QTS_PromiseState","number",["number","number"]);this.QTS_PromiseResult=this.module.cwrap("QTS_PromiseResult","number",["number","number"]);this.QTS_TestStringArg=this.module.cwrap("QTS_TestStringArg",null,["string"]);this.QTS_GetDebugLogEnabled=this.module.cwrap("QTS_GetDebugLogEnabled","number",["number"]);this.QTS_SetDebugLogEnabled=this.module.cwrap("QTS_SetDebugLogEnabled",null,["number","number"]);this.QTS_BuildIsDebug=this.module.cwrap("QTS_BuildIsDebug","number",[]);this.QTS_BuildIsAsyncify=this.module.cwrap("QTS_BuildIsAsyncify","number",[]);this.QTS_NewFunction=this.module.cwrap("QTS_NewFunction","number",["number","string","number","boolean","number"]);this.QTS_ArgvGetJSValueConstPointer=this.module.cwrap("QTS_ArgvGetJSValueConstPointer","number",["number","number"]);this.QTS_RuntimeEnableInterruptHandler=this.module.cwrap("QTS_RuntimeEnableInterruptHandler",null,["number"]);this.QTS_RuntimeDisableInterruptHandler=this.module.cwrap("QTS_RuntimeDisableInterruptHandler",null,["number"]);this.QTS_RuntimeEnableModuleLoader=this.module.cwrap("QTS_RuntimeEnableModuleLoader",null,["number","number"]);this.QTS_RuntimeDisableModuleLoader=this.module.cwrap("QTS_RuntimeDisableModuleLoader",null,["number"]);this.QTS_bjson_encode=this.module.cwrap("QTS_bjson_encode","number",["number","number"]);this.QTS_bjson_decode=this.module.cwrap("QTS_bjson_decode","number",["number","number"])}};export{QuickJSFFI}; -//# sourceMappingURL=ffi.mjs.map \ No newline at end of file diff --git a/.output/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.mjs b/.output/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.mjs deleted file mode 100644 index afc4c93..0000000 --- a/.output/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.mjs +++ /dev/null @@ -1,2 +0,0 @@ -var variant={type:"sync",importFFI:()=>import("./ffi.mjs").then(mod=>mod.QuickJSFFI),importModuleLoader:()=>import("@jitl/quickjs-wasmfile-release-sync/emscripten-module").then(mod=>mod.default)},src_default=variant;export{src_default as default}; -//# sourceMappingURL=index.mjs.map \ No newline at end of file diff --git a/.output/server/node_modules/@jitl/quickjs-wasmfile-release-sync/package.json b/.output/server/node_modules/@jitl/quickjs-wasmfile-release-sync/package.json deleted file mode 100644 index 0daef12..0000000 --- a/.output/server/node_modules/@jitl/quickjs-wasmfile-release-sync/package.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "name": "@jitl/quickjs-wasmfile-release-sync", - "license": "MIT", - "version": "0.32.0", - "description": "Variant of quickjs library: Variant with separate .WASM file. Supports browser ESM, NodeJS ESM, and NodeJS CommonJS.", - "sideEffects": false, - "repository": { - "type": "git", - "url": "https://github.com/justjake/quickjs-emscripten" - }, - "author": { - "name": "Jake Teton-Landis", - "url": "https://jake.tl" - }, - "scripts": { - "build": "yarn build:c && yarn build:ts", - "build:c": "make", - "build:ts": "npx tsup", - "check:types": "npx tsc --project . --noEmit", - "clean": "make clean", - "prepare": "yarn clean && yarn build" - }, - "files": [ - "LICENSE", - "README.md", - "dist/**/*", - "!dist/*.tsbuildinfo" - ], - "types": "./dist/index.d.ts", - "main": "./dist/index.js", - "module": "./dist/index.mjs", - "browser": "./dist/index.mjs", - "exports": { - ".": { - "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", - "require": "./dist/index.js", - "default": "./dist/index.js" - }, - "./package.json": "./package.json", - "./ffi": { - "types": "./dist/ffi.d.ts", - "import": "./dist/ffi.mjs", - "require": "./dist/ffi.js", - "default": "./dist/ffi.js" - }, - "./wasm": "./dist/emscripten-module.wasm", - "./emscripten-module": { - "types": "./dist/emscripten-module.browser.d.ts", - "iife": "./dist/emscripten-module.cjs", - "workerd": "./dist/emscripten-module.cloudflare.cjs", - "browser": "./dist/emscripten-module.browser.mjs", - "import": "./dist/emscripten-module.mjs", - "require": "./dist/emscripten-module.cjs", - "default": "./dist/emscripten-module.cjs" - } - }, - "dependencies": { - "@jitl/quickjs-ffi-types": "0.32.0" - } -} \ No newline at end of file diff --git a/.output/server/node_modules/@mixmark-io/domino/lib/CSSStyleDeclaration.js b/.output/server/node_modules/@mixmark-io/domino/lib/CSSStyleDeclaration.js deleted file mode 100644 index f4ddf65..0000000 --- a/.output/server/node_modules/@mixmark-io/domino/lib/CSSStyleDeclaration.js +++ /dev/null @@ -1,234 +0,0 @@ -"use strict"; - -const { parse } = require('./style_parser'); - -module.exports = function (elt) { - const style = new CSSStyleDeclaration(elt) - const handler = { - get: function(target, property) { - return property in target ? target[property] : target.getPropertyValue(dasherizeProperty(property)); - }, - has: function(target, key) { - return true; - }, - set: function(target, property, value) { - if (property in target) { - target[property] = value; - } else { - target.setProperty(dasherizeProperty(property), value ?? undefined); - } - - return true; - } - }; - - return new Proxy(style, handler); -}; - -function dasherizeProperty(property) { - return property.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase(); -} - - -function CSSStyleDeclaration(elt) { - this._element = elt; -} - -const IMPORTANT_BANG = '!important'; - -// Utility function for parsing style declarations -// Pass in a string like "margin-left: 5px; border-style: solid" -// and this function returns an object like -// {"margin-left":"5px", "border-style":"solid"} -function parseStyles(value) { - const result = { - property: {}, - priority: {}, - } - - if (!value) { - return result; - } - - const styleValues = parse(value); - if (styleValues.length < 2) { - return result; - } - - for (let i = 0; i < styleValues.length; i += 2) { - const name = styleValues[i]; - let value = styleValues[i+1]; - - if (value.endsWith(IMPORTANT_BANG)) { - result.priority[name] = 'important'; - value = value.slice(0, -IMPORTANT_BANG.length).trim(); - } - - result.property[name] = value; - } - - return result; -} - -var NO_CHANGE = {}; // Private marker object - -CSSStyleDeclaration.prototype = Object.create(Object.prototype, { - - // Return the parsed form of the element's style attribute. - // If the element's style attribute has never been parsed - // or if it has changed since the last parse, then reparse it - // Note that the styles don't get parsed until they're actually needed - _parsed: { get: function() { - if (!this._parsedStyles || this.cssText !== this._lastParsedText) { - var text = this.cssText; - this._parsedStyles = parseStyles(text); - this._lastParsedText = text; - delete this._names; - } - return this._parsedStyles; - }}, - - // Call this method any time the parsed representation of the - // style changes. It converts the style properties to a string and - // sets cssText and the element's style attribute - _serialize: { value: function() { - var styles = this._parsed; - var s = ""; - - for(var name in styles.property) { - if (s) s += " "; - s += name + ": " + styles.property[name]; - if (styles.priority[name]) { - s += " !" + styles.priority[name]; - } - s += ";"; - } - - this.cssText = s; // also sets the style attribute - this._lastParsedText = s; // so we don't reparse - delete this._names; - }}, - - cssText: { - get: function() { - // XXX: this is a CSSStyleDeclaration for an element. - // A different impl might be necessary for a set of styles - // associated returned by getComputedStyle(), e.g. - return this._element.getAttribute("style"); - }, - set: function(value) { - // XXX: I should parse and serialize the value to - // normalize it and remove errors. FF and chrome do that. - this._element.setAttribute("style", value); - } - }, - - length: { get: function() { - if (!this._names) - this._names = Object.getOwnPropertyNames(this._parsed.property); - return this._names.length; - }}, - - item: { value: function(n) { - if (!this._names) - this._names = Object.getOwnPropertyNames(this._parsed.property); - return this._names[n]; - }}, - - getPropertyValue: { value: function(property) { - property = property.toLowerCase(); - return this._parsed.property[property] || ""; - }}, - - getPropertyPriority: { value: function(property) { - property = property.toLowerCase(); - return this._parsed.priority[property] || ""; - }}, - - setProperty: { value: function(property, value, priority) { - property = property.toLowerCase(); - if (value === null || value === undefined) { - value = ""; - } - if (priority === null || priority === undefined) { - priority = ""; - } - - // String coercion - if (value !== NO_CHANGE) { - value = "" + value; - } - - value = value.trim(); - if (value === "") { - this.removeProperty(property); - return; - } - - if (priority !== "" && priority !== NO_CHANGE && - !/^important$/i.test(priority)) { - return; - } - - var styles = this._parsed; - if (value === NO_CHANGE) { - if (!styles.property[property]) { - return; // Not a valid property name. - } - if (priority !== "") { - styles.priority[property] = "important"; - } else { - delete styles.priority[property]; - } - } else { - // We don't just accept the property value. Instead - // we parse it to ensure that it is something valid. - // If it contains a semicolon it is invalid - if (value.indexOf(";") !== -1) return; - - var newprops = parseStyles(property + ":" + value); - if (Object.getOwnPropertyNames(newprops.property).length === 0) { - return; // no valid property found - } - if (Object.getOwnPropertyNames(newprops.priority).length !== 0) { - return; // if the value included '!important' it wasn't valid. - } - - // XXX handle shorthand properties - - for (var p in newprops.property) { - styles.property[p] = newprops.property[p]; - if (priority === NO_CHANGE) { - continue; - } else if (priority !== "") { - styles.priority[p] = "important"; - } else if (styles.priority[p]) { - delete styles.priority[p]; - } - } - } - - // Serialize and update cssText and element.style! - this._serialize(); - }}, - - setPropertyValue: { value: function(property, value) { - return this.setProperty(property, value, NO_CHANGE); - }}, - - setPropertyPriority: { value: function(property, priority) { - return this.setProperty(property, NO_CHANGE, priority); - }}, - - removeProperty: { value: function(property) { - property = property.toLowerCase(); - var styles = this._parsed; - if (property in styles.property) { - delete styles.property[property]; - delete styles.priority[property]; - - // Serialize and update cssText and element.style! - this._serialize(); - } - }}, -}); diff --git a/.output/server/node_modules/@mixmark-io/domino/lib/CharacterData.js b/.output/server/node_modules/@mixmark-io/domino/lib/CharacterData.js deleted file mode 100644 index 5718b55..0000000 --- a/.output/server/node_modules/@mixmark-io/domino/lib/CharacterData.js +++ /dev/null @@ -1,120 +0,0 @@ -/* jshint bitwise: false */ -"use strict"; -module.exports = CharacterData; - -var Leaf = require('./Leaf'); -var utils = require('./utils'); -var ChildNode = require('./ChildNode'); -var NonDocumentTypeChildNode = require('./NonDocumentTypeChildNode'); - -function CharacterData() { - Leaf.call(this); -} - -CharacterData.prototype = Object.create(Leaf.prototype, { - // DOMString substringData(unsigned long offset, - // unsigned long count); - // The substringData(offset, count) method must run these steps: - // - // If offset is greater than the context object's - // length, throw an INDEX_SIZE_ERR exception and - // terminate these steps. - // - // If offset+count is greater than the context - // object's length, return a DOMString whose value is - // the UTF-16 code units from the offsetth UTF-16 code - // unit to the end of data. - // - // Return a DOMString whose value is the UTF-16 code - // units from the offsetth UTF-16 code unit to the - // offset+countth UTF-16 code unit in data. - substringData: { value: function substringData(offset, count) { - if (arguments.length < 2) { throw new TypeError("Not enough arguments"); } - // Convert arguments to WebIDL "unsigned long" - offset = offset >>> 0; - count = count >>> 0; - if (offset > this.data.length || offset < 0 || count < 0) { - utils.IndexSizeError(); - } - return this.data.substring(offset, offset+count); - }}, - - // void appendData(DOMString data); - // The appendData(data) method must append data to the context - // object's data. - appendData: { value: function appendData(data) { - if (arguments.length < 1) { throw new TypeError("Not enough arguments"); } - this.data += String(data); - }}, - - // void insertData(unsigned long offset, DOMString data); - // The insertData(offset, data) method must run these steps: - // - // If offset is greater than the context object's - // length, throw an INDEX_SIZE_ERR exception and - // terminate these steps. - // - // Insert data into the context object's data after - // offset UTF-16 code units. - // - insertData: { value: function insertData(offset, data) { - return this.replaceData(offset, 0, data); - }}, - - - // void deleteData(unsigned long offset, unsigned long count); - // The deleteData(offset, count) method must run these steps: - // - // If offset is greater than the context object's - // length, throw an INDEX_SIZE_ERR exception and - // terminate these steps. - // - // If offset+count is greater than the context - // object's length var count be length-offset. - // - // Starting from offset UTF-16 code units remove count - // UTF-16 code units from the context object's data. - deleteData: { value: function deleteData(offset, count) { - return this.replaceData(offset, count, ''); - }}, - - - // void replaceData(unsigned long offset, unsigned long count, - // DOMString data); - // - // The replaceData(offset, count, data) method must act as - // if the deleteData() method is invoked with offset and - // count as arguments followed by the insertData() method - // with offset and data as arguments and re-throw any - // exceptions these methods might have thrown. - replaceData: { value: function replaceData(offset, count, data) { - var curtext = this.data, len = curtext.length; - // Convert arguments to correct WebIDL type - offset = offset >>> 0; - count = count >>> 0; - data = String(data); - - if (offset > len || offset < 0) utils.IndexSizeError(); - - if (offset+count > len) - count = len - offset; - - var prefix = curtext.substring(0, offset), - suffix = curtext.substring(offset+count); - - this.data = prefix + data + suffix; - }}, - - // Utility method that Node.isEqualNode() calls to test Text and - // Comment nodes for equality. It is okay to put it here, since - // Node will have already verified that nodeType is equal - isEqual: { value: function isEqual(n) { - return this._data === n._data; - }}, - - length: { get: function() { return this.data.length; }} - -}); - -Object.defineProperties(CharacterData.prototype, ChildNode); -Object.defineProperties(CharacterData.prototype, NonDocumentTypeChildNode); diff --git a/.output/server/node_modules/@mixmark-io/domino/lib/ChildNode.js b/.output/server/node_modules/@mixmark-io/domino/lib/ChildNode.js deleted file mode 100644 index f55d95f..0000000 --- a/.output/server/node_modules/@mixmark-io/domino/lib/ChildNode.js +++ /dev/null @@ -1,119 +0,0 @@ -"use strict"; - -var Node = require('./Node'); -var LinkedList = require('./LinkedList'); - -var createDocumentFragmentFromArguments = function(document, args) { - var docFrag = document.createDocumentFragment(); - - for (var i=0; i 0; - } - return this._firstChild !== null; - }}, - - childNodes: { get: function() { - this._ensureChildNodes(); - return this._childNodes; - }}, - - firstChild: { get: function() { - if (this._childNodes) { - return this._childNodes.length === 0 ? null : this._childNodes[0]; - } - return this._firstChild; - }}, - - lastChild: { get: function() { - var kids = this._childNodes, first; - if (kids) { - return kids.length === 0 ? null: kids[kids.length-1]; - } - first = this._firstChild; - if (first === null) { return null; } - return first._previousSibling; // circular linked list - }}, - - _ensureChildNodes: { value: function() { - if (this._childNodes) { return; } - var first = this._firstChild, - kid = first, - childNodes = this._childNodes = new NodeList(); - if (first) do { - childNodes.push(kid); - kid = kid._nextSibling; - } while (kid !== first); // circular linked list - this._firstChild = null; // free memory - }}, - - // Remove all of this node's children. This is a minor - // optimization that only calls modify() once. - removeChildren: { value: function removeChildren() { - var root = this.rooted ? this.ownerDocument : null, - next = this.firstChild, - kid; - while (next !== null) { - kid = next; - next = kid.nextSibling; - - if (root) root.mutateRemove(kid); - kid.parentNode = null; - } - if (this._childNodes) { - this._childNodes.length = 0; - } else { - this._firstChild = null; - } - this.modify(); // Update last modified type once only - }}, - -}); diff --git a/.output/server/node_modules/@mixmark-io/domino/lib/CustomEvent.js b/.output/server/node_modules/@mixmark-io/domino/lib/CustomEvent.js deleted file mode 100644 index aaaf137..0000000 --- a/.output/server/node_modules/@mixmark-io/domino/lib/CustomEvent.js +++ /dev/null @@ -1,12 +0,0 @@ -"use strict"; -module.exports = CustomEvent; - -var Event = require('./Event'); - -function CustomEvent(type, dictionary) { - // Just use the superclass constructor to initialize - Event.call(this, type, dictionary); -} -CustomEvent.prototype = Object.create(Event.prototype, { - constructor: { value: CustomEvent } -}); diff --git a/.output/server/node_modules/@mixmark-io/domino/lib/DOMException.js b/.output/server/node_modules/@mixmark-io/domino/lib/DOMException.js deleted file mode 100644 index ab87b28..0000000 --- a/.output/server/node_modules/@mixmark-io/domino/lib/DOMException.js +++ /dev/null @@ -1,134 +0,0 @@ -"use strict"; -module.exports = DOMException; - -var INDEX_SIZE_ERR = 1; -var HIERARCHY_REQUEST_ERR = 3; -var WRONG_DOCUMENT_ERR = 4; -var INVALID_CHARACTER_ERR = 5; -var NO_MODIFICATION_ALLOWED_ERR = 7; -var NOT_FOUND_ERR = 8; -var NOT_SUPPORTED_ERR = 9; -var INVALID_STATE_ERR = 11; -var SYNTAX_ERR = 12; -var INVALID_MODIFICATION_ERR = 13; -var NAMESPACE_ERR = 14; -var INVALID_ACCESS_ERR = 15; -var TYPE_MISMATCH_ERR = 17; -var SECURITY_ERR = 18; -var NETWORK_ERR = 19; -var ABORT_ERR = 20; -var URL_MISMATCH_ERR = 21; -var QUOTA_EXCEEDED_ERR = 22; -var TIMEOUT_ERR = 23; -var INVALID_NODE_TYPE_ERR = 24; -var DATA_CLONE_ERR = 25; - -// Code to name -var names = [ - null, // No error with code 0 - 'INDEX_SIZE_ERR', - null, // historical - 'HIERARCHY_REQUEST_ERR', - 'WRONG_DOCUMENT_ERR', - 'INVALID_CHARACTER_ERR', - null, // historical - 'NO_MODIFICATION_ALLOWED_ERR', - 'NOT_FOUND_ERR', - 'NOT_SUPPORTED_ERR', - 'INUSE_ATTRIBUTE_ERR', // historical - 'INVALID_STATE_ERR', - 'SYNTAX_ERR', - 'INVALID_MODIFICATION_ERR', - 'NAMESPACE_ERR', - 'INVALID_ACCESS_ERR', - null, // historical - 'TYPE_MISMATCH_ERR', - 'SECURITY_ERR', - 'NETWORK_ERR', - 'ABORT_ERR', - 'URL_MISMATCH_ERR', - 'QUOTA_EXCEEDED_ERR', - 'TIMEOUT_ERR', - 'INVALID_NODE_TYPE_ERR', - 'DATA_CLONE_ERR', -]; - -// Code to message -// These strings are from the 13 May 2011 Editor's Draft of DOM Core. -// http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html -// Copyright © 2011 W3C® (MIT, ERCIM, Keio), All Rights Reserved. -// Used under the terms of the W3C Document License: -// http://www.w3.org/Consortium/Legal/2002/copyright-documents-20021231 -var messages = [ - null, // No error with code 0 - 'INDEX_SIZE_ERR (1): the index is not in the allowed range', - null, - 'HIERARCHY_REQUEST_ERR (3): the operation would yield an incorrect nodes model', - 'WRONG_DOCUMENT_ERR (4): the object is in the wrong Document, a call to importNode is required', - 'INVALID_CHARACTER_ERR (5): the string contains invalid characters', - null, - 'NO_MODIFICATION_ALLOWED_ERR (7): the object can not be modified', - 'NOT_FOUND_ERR (8): the object can not be found here', - 'NOT_SUPPORTED_ERR (9): this operation is not supported', - 'INUSE_ATTRIBUTE_ERR (10): setAttributeNode called on owned Attribute', - 'INVALID_STATE_ERR (11): the object is in an invalid state', - 'SYNTAX_ERR (12): the string did not match the expected pattern', - 'INVALID_MODIFICATION_ERR (13): the object can not be modified in this way', - 'NAMESPACE_ERR (14): the operation is not allowed by Namespaces in XML', - 'INVALID_ACCESS_ERR (15): the object does not support the operation or argument', - null, - 'TYPE_MISMATCH_ERR (17): the type of the object does not match the expected type', - 'SECURITY_ERR (18): the operation is insecure', - 'NETWORK_ERR (19): a network error occurred', - 'ABORT_ERR (20): the user aborted an operation', - 'URL_MISMATCH_ERR (21): the given URL does not match another URL', - 'QUOTA_EXCEEDED_ERR (22): the quota has been exceeded', - 'TIMEOUT_ERR (23): a timeout occurred', - 'INVALID_NODE_TYPE_ERR (24): the supplied node is invalid or has an invalid ancestor for this operation', - 'DATA_CLONE_ERR (25): the object can not be cloned.' -]; - -// Name to code -var constants = { - INDEX_SIZE_ERR: INDEX_SIZE_ERR, - DOMSTRING_SIZE_ERR: 2, // historical - HIERARCHY_REQUEST_ERR: HIERARCHY_REQUEST_ERR, - WRONG_DOCUMENT_ERR: WRONG_DOCUMENT_ERR, - INVALID_CHARACTER_ERR: INVALID_CHARACTER_ERR, - NO_DATA_ALLOWED_ERR: 6, // historical - NO_MODIFICATION_ALLOWED_ERR: NO_MODIFICATION_ALLOWED_ERR, - NOT_FOUND_ERR: NOT_FOUND_ERR, - NOT_SUPPORTED_ERR: NOT_SUPPORTED_ERR, - INUSE_ATTRIBUTE_ERR: 10, // historical - INVALID_STATE_ERR: INVALID_STATE_ERR, - SYNTAX_ERR: SYNTAX_ERR, - INVALID_MODIFICATION_ERR: INVALID_MODIFICATION_ERR, - NAMESPACE_ERR: NAMESPACE_ERR, - INVALID_ACCESS_ERR: INVALID_ACCESS_ERR, - VALIDATION_ERR: 16, // historical - TYPE_MISMATCH_ERR: TYPE_MISMATCH_ERR, - SECURITY_ERR: SECURITY_ERR, - NETWORK_ERR: NETWORK_ERR, - ABORT_ERR: ABORT_ERR, - URL_MISMATCH_ERR: URL_MISMATCH_ERR, - QUOTA_EXCEEDED_ERR: QUOTA_EXCEEDED_ERR, - TIMEOUT_ERR: TIMEOUT_ERR, - INVALID_NODE_TYPE_ERR: INVALID_NODE_TYPE_ERR, - DATA_CLONE_ERR: DATA_CLONE_ERR -}; - -function DOMException(code) { - Error.call(this); - Error.captureStackTrace(this, this.constructor); - this.code = code; - this.message = messages[code]; - this.name = names[code]; -} -DOMException.prototype.__proto__ = Error.prototype; - -// Initialize the constants on DOMException and DOMException.prototype -for(var c in constants) { - var v = { value: constants[c] }; - Object.defineProperty(DOMException, c, v); - Object.defineProperty(DOMException.prototype, c, v); -} diff --git a/.output/server/node_modules/@mixmark-io/domino/lib/DOMImplementation.js b/.output/server/node_modules/@mixmark-io/domino/lib/DOMImplementation.js deleted file mode 100644 index 03f2d3a..0000000 --- a/.output/server/node_modules/@mixmark-io/domino/lib/DOMImplementation.js +++ /dev/null @@ -1,94 +0,0 @@ -"use strict"; -module.exports = DOMImplementation; - -var Document = require('./Document'); -var DocumentType = require('./DocumentType'); -var HTMLParser = require('./HTMLParser'); -var utils = require('./utils'); -var xml = require('./xmlnames'); - -// Each document must have its own instance of the domimplementation object -function DOMImplementation(contextObject) { - this.contextObject = contextObject; -} - - -// Feature/version pairs that DOMImplementation.hasFeature() returns -// true for. It returns false for anything else. -var supportedFeatures = { - 'xml': { '': true, '1.0': true, '2.0': true }, // DOM Core - 'core': { '': true, '2.0': true }, // DOM Core - 'html': { '': true, '1.0': true, '2.0': true} , // HTML - 'xhtml': { '': true, '1.0': true, '2.0': true} , // HTML -}; - -DOMImplementation.prototype = { - hasFeature: function hasFeature(feature, version) { - var f = supportedFeatures[(feature || '').toLowerCase()]; - return (f && f[version || '']) || false; - }, - - createDocumentType: function createDocumentType(qualifiedName, publicId, systemId) { - if (!xml.isValidQName(qualifiedName)) utils.InvalidCharacterError(); - - return new DocumentType(this.contextObject, qualifiedName, publicId, systemId); - }, - - createDocument: function createDocument(namespace, qualifiedName, doctype) { - // - // Note that the current DOMCore spec makes it impossible to - // create an HTML document with this function, even if the - // namespace and doctype are propertly set. See this thread: - // http://lists.w3.org/Archives/Public/www-dom/2011AprJun/0132.html - // - var d = new Document(false, null); - var e; - - if (qualifiedName) - e = d.createElementNS(namespace, qualifiedName); - else - e = null; - - if (doctype) { - d.appendChild(doctype); - } - - if (e) d.appendChild(e); - if (namespace === utils.NAMESPACE.HTML) { - d._contentType = 'application/xhtml+xml'; - } else if (namespace === utils.NAMESPACE.SVG) { - d._contentType = 'image/svg+xml'; - } else { - d._contentType = 'application/xml'; - } - - return d; - }, - - createHTMLDocument: function createHTMLDocument(titleText) { - var d = new Document(true, null); - d.appendChild(new DocumentType(d, 'html')); - var html = d.createElement('html'); - d.appendChild(html); - var head = d.createElement('head'); - html.appendChild(head); - if (titleText !== undefined) { - var title = d.createElement('title'); - head.appendChild(title); - title.appendChild(d.createTextNode(titleText)); - } - html.appendChild(d.createElement('body')); - d.modclock = 1; // Start tracking modifications - return d; - }, - - mozSetOutputMutationHandler: function(doc, handler) { - doc.mutationHandler = handler; - }, - - mozGetInputMutationHandler: function(doc) { - utils.nyi(); - }, - - mozHTMLParser: HTMLParser, -}; diff --git a/.output/server/node_modules/@mixmark-io/domino/lib/DOMTokenList.js b/.output/server/node_modules/@mixmark-io/domino/lib/DOMTokenList.js deleted file mode 100644 index c2580fd..0000000 --- a/.output/server/node_modules/@mixmark-io/domino/lib/DOMTokenList.js +++ /dev/null @@ -1,186 +0,0 @@ -"use strict"; -// DOMTokenList implementation based on https://github.com/Raynos/DOM-shim -var utils = require('./utils'); - -module.exports = DOMTokenList; - -function DOMTokenList(getter, setter) { - this._getString = getter; - this._setString = setter; - this._length = 0; - this._lastStringValue = ''; - this._update(); -} - -Object.defineProperties(DOMTokenList.prototype, { - length: { get: function() { return this._length; } }, - item: { value: function(index) { - var list = getList(this); - if (index < 0 || index >= list.length) { - return null; - } - return list[index]; - }}, - - contains: { value: function(token) { - token = String(token); // no error checking for contains() - var list = getList(this); - return list.indexOf(token) > -1; - }}, - - add: { value: function() { - var list = getList(this); - for (var i = 0, len = arguments.length; i < len; i++) { - var token = handleErrors(arguments[i]); - if (list.indexOf(token) < 0) { - list.push(token); - } - } - // Note: as per spec, if handleErrors() throws any errors, we never - // make it here and none of the changes take effect. - // Also per spec: we run the "update steps" even if no change was - // made (ie, if the token already existed) - this._update(list); - }}, - - remove: { value: function() { - var list = getList(this); - for (var i = 0, len = arguments.length; i < len; i++) { - var token = handleErrors(arguments[i]); - var index = list.indexOf(token); - if (index > -1) { - list.splice(index, 1); - } - } - // Note: as per spec, if handleErrors() throws any errors, we never - // make it here and none of the changes take effect. - // Also per spec: we run the "update steps" even if no change was - // made (ie, if the token wasn't previously present) - this._update(list); - }}, - - toggle: { value: function toggle(token, force) { - token = handleErrors(token); - if (this.contains(token)) { - if (force === undefined || force === false) { - this.remove(token); - return false; - } - return true; - } else { - if (force === undefined || force === true) { - this.add(token); - return true; - } - return false; - } - }}, - - replace: { value: function replace(token, newToken) { - // weird corner case of spec: if `token` contains whitespace, but - // `newToken` is the empty string, we must throw SyntaxError not - // InvalidCharacterError (sigh) - if (String(newToken)==='') { utils.SyntaxError(); } - token = handleErrors(token); - newToken = handleErrors(newToken); - var list = getList(this); - var idx = list.indexOf(token); - if (idx < 0) { - // Note that, per spec, we do not run the update steps on this path. - return false; - } - var idx2 = list.indexOf(newToken); - if (idx2 < 0) { - list[idx] = newToken; - } else { - // "replace the first instance of either `token` or `newToken` with - // `newToken` and remove all other instances" - if (idx < idx2) { - list[idx] = newToken; - list.splice(idx2, 1); - } else { - // idx2 is already `newToken` - list.splice(idx, 1); - } - } - this._update(list); - return true; - }}, - - toString: { value: function() { - return this._getString(); - }}, - - value: { - get: function() { - return this._getString(); - }, - set: function(v) { - this._setString(v); - this._update(); - } - }, - - // Called when the setter is called from outside this interface. - _update: { value: function(list) { - if (list) { - fixIndex(this, list); - this._setString(list.join(" ").trim()); - } else { - fixIndex(this, getList(this)); - } - this._lastStringValue = this._getString(); - } }, -}); - -function fixIndex(clist, list) { - var oldLength = clist._length; - var i; - clist._length = list.length; - for (i = 0; i < list.length; i++) { - clist[i] = list[i]; - } - // Clear/free old entries. - for (; i < oldLength; i++) { - clist[i] = undefined; - } -} - -function handleErrors(token) { - token = String(token); - if (token === "") { - utils.SyntaxError(); - } - if (/[ \t\r\n\f]/.test(token)) { - utils.InvalidCharacterError(); - } - return token; -} - -function toArray(clist) { - var length = clist._length; - var arr = Array(length); - for (var i = 0; i < length; i++) { - arr[i] = clist[i]; - } - return arr; -} - -function getList(clist) { - var strProp = clist._getString(); - if (strProp === clist._lastStringValue) { - return toArray(clist); - } - var str = strProp.replace(/(^[ \t\r\n\f]+)|([ \t\r\n\f]+$)/g, ''); - if (str === "") { - return []; - } else { - var seen = Object.create(null); - return str.split(/[ \t\r\n\f]+/g).filter(function(n) { - var key = '$' + n; - if (seen[key]) { return false; } - seen[key] = true; - return true; - }); - } -} diff --git a/.output/server/node_modules/@mixmark-io/domino/lib/Document.js b/.output/server/node_modules/@mixmark-io/domino/lib/Document.js deleted file mode 100644 index bcd50ea..0000000 --- a/.output/server/node_modules/@mixmark-io/domino/lib/Document.js +++ /dev/null @@ -1,884 +0,0 @@ -"use strict"; -module.exports = Document; - -var Node = require('./Node'); -var NodeList = require('./NodeList'); -var ContainerNode = require('./ContainerNode'); -var Element = require('./Element'); -var Text = require('./Text'); -var Comment = require('./Comment'); -var Event = require('./Event'); -var DocumentFragment = require('./DocumentFragment'); -var ProcessingInstruction = require('./ProcessingInstruction'); -var DOMImplementation = require('./DOMImplementation'); -var TreeWalker = require('./TreeWalker'); -var NodeIterator = require('./NodeIterator'); -var NodeFilter = require('./NodeFilter'); -var URL = require('./URL'); -var select = require('./select'); -var events = require('./events'); -var xml = require('./xmlnames'); -var html = require('./htmlelts'); -var svg = require('./svg'); -var utils = require('./utils'); -var MUTATE = require('./MutationConstants'); -var NAMESPACE = utils.NAMESPACE; -var isApiWritable = require("./config").isApiWritable; - -function Document(isHTML, address) { - ContainerNode.call(this); - this.nodeType = Node.DOCUMENT_NODE; - this.isHTML = isHTML; - this._address = address || 'about:blank'; - this.readyState = 'loading'; - this.implementation = new DOMImplementation(this); - - // DOMCore says that documents are always associated with themselves - this.ownerDocument = null; // ... but W3C tests expect null - this._contentType = isHTML ? 'text/html' : 'application/xml'; - - // These will be initialized by our custom versions of - // appendChild and insertBefore that override the inherited - // Node methods. - // XXX: override those methods! - this.doctype = null; - this.documentElement = null; - - // "Associated inert template document" - this._templateDocCache = null; - // List of active NodeIterators, see NodeIterator#_preremove() - this._nodeIterators = null; - - // Documents are always rooted, by definition - this._nid = 1; - this._nextnid = 2; // For numbering children of the document - this._nodes = [null, this]; // nid to node map - - // This maintains the mapping from element ids to element nodes. - // We may need to update this mapping every time a node is rooted - // or uprooted, and any time an attribute is added, removed or changed - // on a rooted element. - this.byId = Object.create(null); - - // This property holds a monotonically increasing value akin to - // a timestamp used to record the last modification time of nodes - // and their subtrees. See the lastModTime attribute and modify() - // method of the Node class. And see FilteredElementList for an example - // of the use of lastModTime - this.modclock = 0; -} - -// Map from lowercase event category names (used as arguments to -// createEvent()) to the property name in the impl object of the -// event constructor. -var supportedEvents = { - event: 'Event', - customevent: 'CustomEvent', - uievent: 'UIEvent', - mouseevent: 'MouseEvent' -}; - -// Certain arguments to document.createEvent() must be treated specially -var replacementEvent = { - events: 'event', - htmlevents: 'event', - mouseevents: 'mouseevent', - mutationevents: 'mutationevent', - uievents: 'uievent' -}; - -var mirrorAttr = function(f, name, defaultValue) { - return { - get: function() { - var o = f.call(this); - if (o) { return o[name]; } - return defaultValue; - }, - set: function(value) { - var o = f.call(this); - if (o) { o[name] = value; } - }, - }; -}; - -/** @spec https://dom.spec.whatwg.org/#validate-and-extract */ -function validateAndExtract(namespace, qualifiedName) { - var prefix, localName, pos; - if (namespace==='') { namespace = null; } - // See https://github.com/whatwg/dom/issues/671 - // and https://github.com/whatwg/dom/issues/319 - if (!xml.isValidQName(qualifiedName)) { - utils.InvalidCharacterError(); - } - prefix = null; - localName = qualifiedName; - - pos = qualifiedName.indexOf(':'); - if (pos >= 0) { - prefix = qualifiedName.substring(0, pos); - localName = qualifiedName.substring(pos+1); - } - if (prefix !== null && namespace === null) { - utils.NamespaceError(); - } - if (prefix === 'xml' && namespace !== NAMESPACE.XML) { - utils.NamespaceError(); - } - if ((prefix === 'xmlns' || qualifiedName === 'xmlns') && - namespace !== NAMESPACE.XMLNS) { - utils.NamespaceError(); - } - if (namespace === NAMESPACE.XMLNS && !(prefix==='xmlns' || qualifiedName==='xmlns')) { - utils.NamespaceError(); - } - return { namespace: namespace, prefix: prefix, localName: localName }; -} - -Document.prototype = Object.create(ContainerNode.prototype, { - // This method allows dom.js to communicate with a renderer - // that displays the document in some way - // XXX: I should probably move this to the window object - _setMutationHandler: { value: function(handler) { - this.mutationHandler = handler; - }}, - - // This method allows dom.js to receive event notifications - // from the renderer. - // XXX: I should probably move this to the window object - _dispatchRendererEvent: { value: function(targetNid, type, details) { - var target = this._nodes[targetNid]; - if (!target) return; - target._dispatchEvent(new Event(type, details), true); - }}, - - nodeName: { value: '#document'}, - nodeValue: { - get: function() { - return null; - }, - set: function() {} - }, - - // XXX: DOMCore may remove documentURI, so it is NYI for now - documentURI: { get: function() { return this._address; }, set: utils.nyi }, - compatMode: { get: function() { - // The _quirks property is set by the HTML parser - return this._quirks ? 'BackCompat' : 'CSS1Compat'; - }}, - - createTextNode: { value: function(data) { - return new Text(this, String(data)); - }}, - createComment: { value: function(data) { - return new Comment(this, data); - }}, - createDocumentFragment: { value: function() { - return new DocumentFragment(this); - }}, - createProcessingInstruction: { value: function(target, data) { - if (!xml.isValidName(target) || data.indexOf('?>') !== -1) - utils.InvalidCharacterError(); - return new ProcessingInstruction(this, target, data); - }}, - - createAttribute: { value: function(localName) { - localName = String(localName); - if (!xml.isValidName(localName)) utils.InvalidCharacterError(); - if (this.isHTML) { - localName = utils.toASCIILowerCase(localName); - } - return new Element._Attr(null, localName, null, null, ''); - }}, - createAttributeNS: { value: function(namespace, qualifiedName) { - // Convert parameter types according to WebIDL - namespace = - (namespace === null || namespace === undefined || namespace === '') ? null : - String(namespace); - qualifiedName = String(qualifiedName); - var ve = validateAndExtract(namespace, qualifiedName); - return new Element._Attr(null, ve.localName, ve.prefix, ve.namespace, ''); - }}, - - createElement: { value: function(localName) { - localName = String(localName); - if (!xml.isValidName(localName)) utils.InvalidCharacterError(); - // Per spec, namespace should be HTML namespace if "context object is - // an HTML document or context object's content type is - // "application/xhtml+xml", and null otherwise. - if (this.isHTML) { - if (/[A-Z]/.test(localName)) - localName = utils.toASCIILowerCase(localName); - return html.createElement(this, localName, null); - } else if (this.contentType === 'application/xhtml+xml') { - return html.createElement(this, localName, null); - } else { - return new Element(this, localName, null, null); - } - }, writable: isApiWritable }, - - createElementNS: { value: function(namespace, qualifiedName) { - // Convert parameter types according to WebIDL - namespace = - (namespace === null || namespace === undefined || namespace === '') ? null : - String(namespace); - qualifiedName = String(qualifiedName); - var ve = validateAndExtract(namespace, qualifiedName); - return this._createElementNS(ve.localName, ve.namespace, ve.prefix); - }, writable: isApiWritable }, - - // This is used directly by HTML parser, which allows it to create - // elements with localNames containing ':' and non-default namespaces - _createElementNS: { value: function(localName, namespace, prefix) { - if (namespace === NAMESPACE.HTML) { - return html.createElement(this, localName, prefix); - } - else if (namespace === NAMESPACE.SVG) { - return svg.createElement(this, localName, prefix); - } - - return new Element(this, localName, namespace, prefix); - }}, - - createEvent: { value: function createEvent(interfaceName) { - interfaceName = interfaceName.toLowerCase(); - var name = replacementEvent[interfaceName] || interfaceName; - var constructor = events[supportedEvents[name]]; - - if (constructor) { - var e = new constructor(); - e._initialized = false; - return e; - } - else { - utils.NotSupportedError(); - } - }}, - - // See: http://www.w3.org/TR/dom/#dom-document-createtreewalker - createTreeWalker: {value: function (root, whatToShow, filter) { - if (!root) { throw new TypeError("root argument is required"); } - if (!(root instanceof Node)) { throw new TypeError("root not a node"); } - whatToShow = whatToShow === undefined ? NodeFilter.SHOW_ALL : (+whatToShow); - filter = filter === undefined ? null : filter; - - return new TreeWalker(root, whatToShow, filter); - }}, - - // See: http://www.w3.org/TR/dom/#dom-document-createnodeiterator - createNodeIterator: {value: function (root, whatToShow, filter) { - if (!root) { throw new TypeError("root argument is required"); } - if (!(root instanceof Node)) { throw new TypeError("root not a node"); } - whatToShow = whatToShow === undefined ? NodeFilter.SHOW_ALL : (+whatToShow); - filter = filter === undefined ? null : filter; - - return new NodeIterator(root, whatToShow, filter); - }}, - - _attachNodeIterator: { value: function(ni) { - // XXX ideally this should be a weak reference from Document to NodeIterator - if (!this._nodeIterators) { this._nodeIterators = []; } - this._nodeIterators.push(ni); - }}, - - _detachNodeIterator: { value: function(ni) { - // ni should always be in list of node iterators - var idx = this._nodeIterators.indexOf(ni); - this._nodeIterators.splice(idx, 1); - }}, - - _preremoveNodeIterators: { value: function(toBeRemoved) { - if (this._nodeIterators) { - this._nodeIterators.forEach(function(ni) { ni._preremove(toBeRemoved); }); - } - }}, - - // Maintain the documentElement and - // doctype properties of the document. Each of the following - // methods chains to the Node implementation of the method - // to do the actual inserting, removal or replacement. - - _updateDocTypeElement: { value: function _updateDocTypeElement() { - this.doctype = this.documentElement = null; - for (var kid = this.firstChild; kid !== null; kid = kid.nextSibling) { - if (kid.nodeType === Node.DOCUMENT_TYPE_NODE) - this.doctype = kid; - else if (kid.nodeType === Node.ELEMENT_NODE) - this.documentElement = kid; - } - }}, - - insertBefore: { value: function insertBefore(child, refChild) { - Node.prototype.insertBefore.call(this, child, refChild); - this._updateDocTypeElement(); - return child; - }}, - - replaceChild: { value: function replaceChild(node, child) { - Node.prototype.replaceChild.call(this, node, child); - this._updateDocTypeElement(); - return child; - }}, - - removeChild: { value: function removeChild(child) { - Node.prototype.removeChild.call(this, child); - this._updateDocTypeElement(); - return child; - }}, - - getElementById: { value: function(id) { - var n = this.byId[id]; - if (!n) return null; - if (n instanceof MultiId) { // there was more than one element with this id - return n.getFirst(); - } - return n; - }}, - - _hasMultipleElementsWithId: { value: function(id) { - // Used internally by querySelectorAll optimization - return (this.byId[id] instanceof MultiId); - }}, - - // Just copy this method from the Element prototype - getElementsByName: { value: Element.prototype.getElementsByName }, - getElementsByTagName: { value: Element.prototype.getElementsByTagName }, - getElementsByTagNameNS: { value: Element.prototype.getElementsByTagNameNS }, - getElementsByClassName: { value: Element.prototype.getElementsByClassName }, - - adoptNode: { value: function adoptNode(node) { - if (node.nodeType === Node.DOCUMENT_NODE) utils.NotSupportedError(); - if (node.nodeType === Node.ATTRIBUTE_NODE) { return node; } - - if (node.parentNode) node.parentNode.removeChild(node); - - if (node.ownerDocument !== this) - recursivelySetOwner(node, this); - - return node; - }}, - - importNode: { value: function importNode(node, deep) { - return this.adoptNode(node.cloneNode(deep)); - }, writable: isApiWritable }, - - // The following attributes and methods are from the HTML spec - origin: { get: function origin() { return null; } }, - characterSet: { get: function characterSet() { return "UTF-8"; } }, - contentType: { get: function contentType() { return this._contentType; } }, - URL: { get: function URL() { return this._address; } }, - domain: { get: utils.nyi, set: utils.nyi }, - referrer: { get: utils.nyi }, - cookie: { get: utils.nyi, set: utils.nyi }, - lastModified: { get: utils.nyi }, - location: { - get: function() { - return this.defaultView ? this.defaultView.location : null; // gh #75 - }, - set: utils.nyi - }, - _titleElement: { - get: function() { - // The title element of a document is the first title element in the - // document in tree order, if there is one, or null otherwise. - return this.getElementsByTagName('title').item(0) || null; - } - }, - title: { - get: function() { - var elt = this._titleElement; - // The child text content of the title element, or '' if null. - var value = elt ? elt.textContent : ''; - // Strip and collapse whitespace in value - return value.replace(/[ \t\n\r\f]+/g, ' ').replace(/(^ )|( $)/g, ''); - }, - set: function(value) { - var elt = this._titleElement; - var head = this.head; - if (!elt && !head) { return; /* according to spec */ } - if (!elt) { - elt = this.createElement('title'); - head.appendChild(elt); - } - elt.textContent = value; - } - }, - dir: mirrorAttr(function() { - var htmlElement = this.documentElement; - if (htmlElement && htmlElement.tagName === 'HTML') { return htmlElement; } - }, 'dir', ''), - fgColor: mirrorAttr(function() { return this.body; }, 'text', ''), - linkColor: mirrorAttr(function() { return this.body; }, 'link', ''), - vlinkColor: mirrorAttr(function() { return this.body; }, 'vLink', ''), - alinkColor: mirrorAttr(function() { return this.body; }, 'aLink', ''), - bgColor: mirrorAttr(function() { return this.body; }, 'bgColor', ''), - - // Historical aliases of Document#characterSet - charset: { get: function() { return this.characterSet; } }, - inputEncoding: { get: function() { return this.characterSet; } }, - - scrollingElement: { - get: function() { - return this._quirks ? this.body : this.documentElement; - } - }, - - // Return the first child of the document element. - // XXX For now, setting this attribute is not implemented. - body: { - get: function() { - return namedHTMLChild(this.documentElement, 'body'); - }, - set: utils.nyi - }, - // Return the first child of the document element. - head: { get: function() { - return namedHTMLChild(this.documentElement, 'head'); - }}, - images: { get: utils.nyi }, - embeds: { get: utils.nyi }, - plugins: { get: utils.nyi }, - links: { get: utils.nyi }, - forms: { get: utils.nyi }, - scripts: { get: utils.nyi }, - applets: { get: function() { return []; } }, - activeElement: { get: function() { return null; } }, - innerHTML: { - get: function() { return this.serialize(); }, - set: utils.nyi - }, - outerHTML: { - get: function() { return this.serialize(); }, - set: utils.nyi - }, - - write: { value: function(args) { - if (!this.isHTML) utils.InvalidStateError(); - - // XXX: still have to implement the ignore part - if (!this._parser /* && this._ignore_destructive_writes > 0 */ ) - return; - - if (!this._parser) { - // XXX call document.open, etc. - } - - var s = arguments.join(''); - - // If the Document object's reload override flag is set, then - // append the string consisting of the concatenation of all the - // arguments to the method to the Document's reload override - // buffer. - // XXX: don't know what this is about. Still have to do it - - // If there is no pending parsing-blocking script, have the - // tokenizer process the characters that were inserted, one at a - // time, processing resulting tokens as they are emitted, and - // stopping when the tokenizer reaches the insertion point or when - // the processing of the tokenizer is aborted by the tree - // construction stage (this can happen if a script end tag token is - // emitted by the tokenizer). - - // XXX: still have to do the above. Sounds as if we don't - // always call parse() here. If we're blocked, then we just - // insert the text into the stream but don't parse it reentrantly... - - // Invoke the parser reentrantly - this._parser.parse(s); - }}, - - writeln: { value: function writeln(args) { - this.write(Array.prototype.join.call(arguments, '') + '\n'); - }}, - - open: { value: function() { - this.documentElement = null; - }}, - - close: { value: function() { - this.readyState = 'interactive'; - this._dispatchEvent(new Event('readystatechange'), true); - this._dispatchEvent(new Event('DOMContentLoaded'), true); - this.readyState = 'complete'; - this._dispatchEvent(new Event('readystatechange'), true); - if (this.defaultView) { - this.defaultView._dispatchEvent(new Event('load'), true); - } - }}, - - // Utility methods - clone: { value: function clone() { - var d = new Document(this.isHTML, this._address); - d._quirks = this._quirks; - d._contentType = this._contentType; - return d; - }}, - - // We need to adopt the nodes if we do a deep clone - cloneNode: { value: function cloneNode(deep) { - var clone = Node.prototype.cloneNode.call(this, false); - if (deep) { - for (var kid = this.firstChild; kid !== null; kid = kid.nextSibling) { - clone._appendChild(clone.importNode(kid, true)); - } - } - clone._updateDocTypeElement(); - return clone; - }}, - - isEqual: { value: function isEqual(n) { - // Any two documents are shallowly equal. - // Node.isEqualNode will also test the children - return true; - }}, - - // Implementation-specific function. Called when a text, comment, - // or pi value changes. - mutateValue: { value: function(node) { - if (this.mutationHandler) { - this.mutationHandler({ - type: MUTATE.VALUE, - target: node, - data: node.data - }); - } - }}, - - // Invoked when an attribute's value changes. Attr holds the new - // value. oldval is the old value. Attribute mutations can also - // involve changes to the prefix (and therefore the qualified name) - mutateAttr: { value: function(attr, oldval) { - // Manage id->element mapping for getElementsById() - // XXX: this special case id handling should not go here, - // but in the attribute declaration for the id attribute - /* - if (attr.localName === 'id' && attr.namespaceURI === null) { - if (oldval) delId(oldval, attr.ownerElement); - addId(attr.value, attr.ownerElement); - } - */ - if (this.mutationHandler) { - this.mutationHandler({ - type: MUTATE.ATTR, - target: attr.ownerElement, - attr: attr - }); - } - }}, - - // Used by removeAttribute and removeAttributeNS for attributes. - mutateRemoveAttr: { value: function(attr) { -/* -* This is now handled in Attributes.js - // Manage id to element mapping - if (attr.localName === 'id' && attr.namespaceURI === null) { - this.delId(attr.value, attr.ownerElement); - } -*/ - if (this.mutationHandler) { - this.mutationHandler({ - type: MUTATE.REMOVE_ATTR, - target: attr.ownerElement, - attr: attr - }); - } - }}, - - // Called by Node.removeChild, etc. to remove a rooted element from - // the tree. Only needs to generate a single mutation event when a - // node is removed, but must recursively mark all descendants as not - // rooted. - mutateRemove: { value: function(node) { - // Send a single mutation event - if (this.mutationHandler) { - this.mutationHandler({ - type: MUTATE.REMOVE, - target: node.parentNode, - node: node - }); - } - - // Mark this and all descendants as not rooted - recursivelyUproot(node); - }}, - - // Called when a new element becomes rooted. It must recursively - // generate mutation events for each of the children, and mark them all - // as rooted. - mutateInsert: { value: function(node) { - // Mark node and its descendants as rooted - recursivelyRoot(node); - - // Send a single mutation event - if (this.mutationHandler) { - this.mutationHandler({ - type: MUTATE.INSERT, - target: node.parentNode, - node: node - }); - } - }}, - - // Called when a rooted element is moved within the document - mutateMove: { value: function(node) { - if (this.mutationHandler) { - this.mutationHandler({ - type: MUTATE.MOVE, - target: node - }); - } - }}, - - - // Add a mapping from id to n for n.ownerDocument - addId: { value: function addId(id, n) { - var val = this.byId[id]; - if (!val) { - this.byId[id] = n; - } - else { - // TODO: Add a way to opt-out console warnings - //console.warn('Duplicate element id ' + id); - if (!(val instanceof MultiId)) { - val = new MultiId(val); - this.byId[id] = val; - } - val.add(n); - } - }}, - - // Delete the mapping from id to n for n.ownerDocument - delId: { value: function delId(id, n) { - var val = this.byId[id]; - utils.assert(val); - - if (val instanceof MultiId) { - val.del(n); - if (val.length === 1) { // convert back to a single node - this.byId[id] = val.downgrade(); - } - } - else { - this.byId[id] = undefined; - } - }}, - - _resolve: { value: function(href) { - //XXX: Cache the URL - return new URL(this._documentBaseURL).resolve(href); - }}, - - _documentBaseURL: { get: function() { - // XXX: This is not implemented correctly yet - var url = this._address; - if (url === 'about:blank') url = '/'; - - var base = this.querySelector('base[href]'); - if (base) { - return new URL(url).resolve(base.getAttribute('href')); - } - return url; - - // The document base URL of a Document object is the - // absolute URL obtained by running these substeps: - - // Let fallback base url be the document's address. - - // If fallback base url is about:blank, and the - // Document's browsing context has a creator browsing - // context, then let fallback base url be the document - // base URL of the creator Document instead. - - // If the Document is an iframe srcdoc document, then - // let fallback base url be the document base URL of - // the Document's browsing context's browsing context - // container's Document instead. - - // If there is no base element that has an href - // attribute, then the document base URL is fallback - // base url; abort these steps. Otherwise, let url be - // the value of the href attribute of the first such - // element. - - // Resolve url relative to fallback base url (thus, - // the base href attribute isn't affected by xml:base - // attributes). - - // The document base URL is the result of the previous - // step if it was successful; otherwise it is fallback - // base url. - }}, - - _templateDoc: { get: function() { - if (!this._templateDocCache) { - // "associated inert template document" - var newDoc = new Document(this.isHTML, this._address); - this._templateDocCache = newDoc._templateDocCache = newDoc; - } - return this._templateDocCache; - }}, - - querySelector: { value: function(selector) { - return select(selector, this)[0]; - }}, - - querySelectorAll: { value: function(selector) { - var nodes = select(selector, this); - return nodes.item ? nodes : new NodeList(nodes); - }} - -}); - - -var eventHandlerTypes = [ - 'abort', 'canplay', 'canplaythrough', 'change', 'click', 'contextmenu', - 'cuechange', 'dblclick', 'drag', 'dragend', 'dragenter', 'dragleave', - 'dragover', 'dragstart', 'drop', 'durationchange', 'emptied', 'ended', - 'input', 'invalid', 'keydown', 'keypress', 'keyup', 'loadeddata', - 'loadedmetadata', 'loadstart', 'mousedown', 'mousemove', 'mouseout', - 'mouseover', 'mouseup', 'mousewheel', 'pause', 'play', 'playing', - 'progress', 'ratechange', 'readystatechange', 'reset', 'seeked', - 'seeking', 'select', 'show', 'stalled', 'submit', 'suspend', - 'timeupdate', 'volumechange', 'waiting', - - 'blur', 'error', 'focus', 'load', 'scroll' -]; - -// Add event handler idl attribute getters and setters to Document -eventHandlerTypes.forEach(function(type) { - // Define the event handler registration IDL attribute for this type - Object.defineProperty(Document.prototype, 'on' + type, { - get: function() { - return this._getEventHandler(type); - }, - set: function(v) { - this._setEventHandler(type, v); - } - }); -}); - -function namedHTMLChild(parent, name) { - if (parent && parent.isHTML) { - for (var kid = parent.firstChild; kid !== null; kid = kid.nextSibling) { - if (kid.nodeType === Node.ELEMENT_NODE && - kid.localName === name && - kid.namespaceURI === NAMESPACE.HTML) { - return kid; - } - } - } - return null; -} - -function root(n) { - n._nid = n.ownerDocument._nextnid++; - n.ownerDocument._nodes[n._nid] = n; - // Manage id to element mapping - if (n.nodeType === Node.ELEMENT_NODE) { - var id = n.getAttribute('id'); - if (id) n.ownerDocument.addId(id, n); - - // Script elements need to know when they're inserted - // into the document - if (n._roothook) n._roothook(); - } -} - -function uproot(n) { - // Manage id to element mapping - if (n.nodeType === Node.ELEMENT_NODE) { - var id = n.getAttribute('id'); - if (id) n.ownerDocument.delId(id, n); - } - n.ownerDocument._nodes[n._nid] = undefined; - n._nid = undefined; -} - -function recursivelyRoot(node) { - root(node); - // XXX: - // accessing childNodes on a leaf node creates a new array the - // first time, so be careful to write this loop so that it - // doesn't do that. node is polymorphic, so maybe this is hard to - // optimize? Try switching on nodeType? -/* - if (node.hasChildNodes()) { - var kids = node.childNodes; - for(var i = 0, n = kids.length; i < n; i++) - recursivelyRoot(kids[i]); - } -*/ - if (node.nodeType === Node.ELEMENT_NODE) { - for (var kid = node.firstChild; kid !== null; kid = kid.nextSibling) - recursivelyRoot(kid); - } -} - -function recursivelyUproot(node) { - uproot(node); - for (var kid = node.firstChild; kid !== null; kid = kid.nextSibling) - recursivelyUproot(kid); -} - -function recursivelySetOwner(node, owner) { - node.ownerDocument = owner; - node._lastModTime = undefined; // mod times are document-based - if (Object.prototype.hasOwnProperty.call(node, '_tagName')) { - node._tagName = undefined; // Element subclasses might need to change case - } - for (var kid = node.firstChild; kid !== null; kid = kid.nextSibling) - recursivelySetOwner(kid, owner); -} - -// A class for storing multiple nodes with the same ID -function MultiId(node) { - this.nodes = Object.create(null); - this.nodes[node._nid] = node; - this.length = 1; - this.firstNode = undefined; -} - -// Add a node to the list, with O(1) time -MultiId.prototype.add = function(node) { - if (!this.nodes[node._nid]) { - this.nodes[node._nid] = node; - this.length++; - this.firstNode = undefined; - } -}; - -// Remove a node from the list, with O(1) time -MultiId.prototype.del = function(node) { - if (this.nodes[node._nid]) { - delete this.nodes[node._nid]; - this.length--; - this.firstNode = undefined; - } -}; - -// Get the first node from the list, in the document order -// Takes O(N) time in the size of the list, with a cache that is invalidated -// when the list is modified. -MultiId.prototype.getFirst = function() { - /* jshint bitwise: false */ - if (!this.firstNode) { - var nid; - for (nid in this.nodes) { - if (this.firstNode === undefined || - this.firstNode.compareDocumentPosition(this.nodes[nid]) & Node.DOCUMENT_POSITION_PRECEDING) { - this.firstNode = this.nodes[nid]; - } - } - } - return this.firstNode; -}; - -// If there is only one node left, return it. Otherwise return "this". -MultiId.prototype.downgrade = function() { - if (this.length === 1) { - var nid; - for (nid in this.nodes) { - return this.nodes[nid]; - } - } - return this; -}; diff --git a/.output/server/node_modules/@mixmark-io/domino/lib/DocumentFragment.js b/.output/server/node_modules/@mixmark-io/domino/lib/DocumentFragment.js deleted file mode 100644 index e2605fa..0000000 --- a/.output/server/node_modules/@mixmark-io/domino/lib/DocumentFragment.js +++ /dev/null @@ -1,71 +0,0 @@ -"use strict"; -module.exports = DocumentFragment; - -var Node = require('./Node'); -var NodeList = require('./NodeList'); -var ContainerNode = require('./ContainerNode'); -var Element = require('./Element'); -var select = require('./select'); -var utils = require('./utils'); - -function DocumentFragment(doc) { - ContainerNode.call(this); - this.nodeType = Node.DOCUMENT_FRAGMENT_NODE; - this.ownerDocument = doc; -} - -DocumentFragment.prototype = Object.create(ContainerNode.prototype, { - nodeName: { value: '#document-fragment' }, - nodeValue: { - get: function() { - return null; - }, - set: function() {} - }, - // Copy the text content getter/setter from Element - textContent: Object.getOwnPropertyDescriptor(Element.prototype, 'textContent'), - - // Copy the text content getter/setter from Element - innerText: Object.getOwnPropertyDescriptor(Element.prototype, 'innerText'), - - querySelector: { value: function(selector) { - // implement in terms of querySelectorAll - var nodes = this.querySelectorAll(selector); - return nodes.length ? nodes[0] : null; - }}, - querySelectorAll: { value: function(selector) { - // create a context - var context = Object.create(this); - // add some methods to the context for zest implementation, without - // adding them to the public DocumentFragment API - context.isHTML = true; // in HTML namespace (case-insensitive match) - context.getElementsByTagName = Element.prototype.getElementsByTagName; - context.nextElement = - Object.getOwnPropertyDescriptor(Element.prototype, 'firstElementChild'). - get; - // invoke zest - var nodes = select(selector, context); - return nodes.item ? nodes : new NodeList(nodes); - }}, - - // Utility methods - clone: { value: function clone() { - return new DocumentFragment(this.ownerDocument); - }}, - isEqual: { value: function isEqual(n) { - // Any two document fragments are shallowly equal. - // Node.isEqualNode() will test their children for equality - return true; - }}, - - // Non-standard, but useful (github issue #73) - innerHTML: { - get: function() { return this.serialize(); }, - set: utils.nyi - }, - outerHTML: { - get: function() { return this.serialize(); }, - set: utils.nyi - }, - -}); diff --git a/.output/server/node_modules/@mixmark-io/domino/lib/DocumentType.js b/.output/server/node_modules/@mixmark-io/domino/lib/DocumentType.js deleted file mode 100644 index 680ea13..0000000 --- a/.output/server/node_modules/@mixmark-io/domino/lib/DocumentType.js +++ /dev/null @@ -1,36 +0,0 @@ -"use strict"; -module.exports = DocumentType; - -var Node = require('./Node'); -var Leaf = require('./Leaf'); -var ChildNode = require('./ChildNode'); - -function DocumentType(ownerDocument, name, publicId, systemId) { - Leaf.call(this); - this.nodeType = Node.DOCUMENT_TYPE_NODE; - this.ownerDocument = ownerDocument || null; - this.name = name; - this.publicId = publicId || ""; - this.systemId = systemId || ""; -} - -DocumentType.prototype = Object.create(Leaf.prototype, { - nodeName: { get: function() { return this.name; }}, - nodeValue: { - get: function() { return null; }, - set: function() {} - }, - - // Utility methods - clone: { value: function clone() { - return new DocumentType(this.ownerDocument, this.name, this.publicId, this.systemId); - }}, - - isEqual: { value: function isEqual(n) { - return this.name === n.name && - this.publicId === n.publicId && - this.systemId === n.systemId; - }} -}); - -Object.defineProperties(DocumentType.prototype, ChildNode); diff --git a/.output/server/node_modules/@mixmark-io/domino/lib/Element.js b/.output/server/node_modules/@mixmark-io/domino/lib/Element.js deleted file mode 100644 index dc8cbc6..0000000 --- a/.output/server/node_modules/@mixmark-io/domino/lib/Element.js +++ /dev/null @@ -1,1228 +0,0 @@ -"use strict"; -module.exports = Element; - -var xml = require('./xmlnames'); -var utils = require('./utils'); -var NAMESPACE = utils.NAMESPACE; -var attributes = require('./attributes'); -var Node = require('./Node'); -var NodeList = require('./NodeList'); -var NodeUtils = require('./NodeUtils'); -var FilteredElementList = require('./FilteredElementList'); -var DOMException = require('./DOMException'); -var DOMTokenList = require('./DOMTokenList'); -var select = require('./select'); -var ContainerNode = require('./ContainerNode'); -var ChildNode = require('./ChildNode'); -var NonDocumentTypeChildNode = require('./NonDocumentTypeChildNode'); -var NamedNodeMap = require('./NamedNodeMap'); - -var uppercaseCache = Object.create(null); - -function Element(doc, localName, namespaceURI, prefix) { - ContainerNode.call(this); - this.nodeType = Node.ELEMENT_NODE; - this.ownerDocument = doc; - this.localName = localName; - this.namespaceURI = namespaceURI; - this.prefix = prefix; - this._tagName = undefined; - - // These properties maintain the set of attributes - this._attrsByQName = Object.create(null); // The qname->Attr map - this._attrsByLName = Object.create(null); // The ns|lname->Attr map - this._attrKeys = []; // attr index -> ns|lname -} - -function recursiveGetText(node, a) { - if (node.nodeType === Node.TEXT_NODE) { - a.push(node._data); - } - else { - for(var i = 0, n = node.childNodes.length; i < n; i++) - recursiveGetText(node.childNodes[i], a); - } -} - -Element.prototype = Object.create(ContainerNode.prototype, { - isHTML: { get: function isHTML() { - return this.namespaceURI === NAMESPACE.HTML && this.ownerDocument.isHTML; - }}, - tagName: { get: function tagName() { - if (this._tagName === undefined) { - var tn; - if (this.prefix === null) { - tn = this.localName; - } else { - tn = this.prefix + ':' + this.localName; - } - if (this.isHTML) { - var up = uppercaseCache[tn]; - if (!up) { - // Converting to uppercase can be slow, so cache the conversion. - uppercaseCache[tn] = up = utils.toASCIIUpperCase(tn); - } - tn = up; - } - this._tagName = tn; - } - return this._tagName; - }}, - nodeName: { get: function() { return this.tagName; }}, - nodeValue: { - get: function() { - return null; - }, - set: function() {} - }, - textContent: { - get: function() { - var strings = []; - recursiveGetText(this, strings); - return strings.join(''); - }, - set: function(newtext) { - this.removeChildren(); - if (newtext !== null && newtext !== undefined && newtext !== '') { - this._appendChild(this.ownerDocument.createTextNode(newtext)); - } - } - }, - innerText: { - get: function() { - var strings = []; - recursiveGetText(this, strings); - // Strip and collapse whitespace - // This doesn't 100% match the browser behavior, - // but should cover most of the cases. This is also similar to - // how Angular's renderer used to work: the `textContent` and `innerText` - // were almost equivalent from the renderer perspective. - // See: https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent#differences_from_innertext - return strings.join('').replace(/[ \t\n\f\r]+/g, ' ').trim(); - }, - set: function(newtext) { - this.removeChildren(); - if (newtext !== null && newtext !== undefined && newtext !== '') { - this._appendChild(this.ownerDocument.createTextNode(newtext)); - } - } - }, - innerHTML: { - get: function() { - return this.serialize(); - }, - set: utils.nyi - }, - outerHTML: { - get: function() { - // "the attribute must return the result of running the HTML fragment - // serialization algorithm on a fictional node whose only child is - // the context object" - // - // The serialization logic is intentionally implemented in a separate - // `NodeUtils` helper instead of the more obvious choice of a private - // `_serializeOne()` method on the `Node.prototype` in order to avoid - // the megamorphic `this._serializeOne` property access, which reduces - // performance unnecessarily. If you need specialized behavior for a - // certain subclass, you'll need to implement that in `NodeUtils`. - // See https://github.com/fgnass/domino/pull/142 for more information. - return NodeUtils.serializeOne(this, { nodeType: 0 }); - }, - set: function(v) { - var document = this.ownerDocument; - var parent = this.parentNode; - if (parent === null) { return; } - if (parent.nodeType === Node.DOCUMENT_NODE) { - utils.NoModificationAllowedError(); - } - if (parent.nodeType === Node.DOCUMENT_FRAGMENT_NODE) { - parent = parent.ownerDocument.createElement("body"); - } - var parser = document.implementation.mozHTMLParser( - document._address, - parent - ); - parser.parse(v===null?'':String(v), true); - this.replaceWith(parser._asDocumentFragment()); - }, - }, - - _insertAdjacent: { value: function _insertAdjacent(position, node) { - var first = false; - switch(position) { - case 'beforebegin': - first = true; - /* falls through */ - case 'afterend': - var parent = this.parentNode; - if (parent === null) { return null; } - return parent.insertBefore(node, first ? this : this.nextSibling); - case 'afterbegin': - first = true; - /* falls through */ - case 'beforeend': - return this.insertBefore(node, first ? this.firstChild : null); - default: - return utils.SyntaxError(); - } - }}, - - insertAdjacentElement: { value: function insertAdjacentElement(position, element) { - if (element.nodeType !== Node.ELEMENT_NODE) { - throw new TypeError('not an element'); - } - position = utils.toASCIILowerCase(String(position)); - return this._insertAdjacent(position, element); - }}, - - insertAdjacentText: { value: function insertAdjacentText(position, data) { - var textNode = this.ownerDocument.createTextNode(data); - position = utils.toASCIILowerCase(String(position)); - this._insertAdjacent(position, textNode); - // "This method returns nothing because it existed before we had a chance - // to design it." - }}, - - insertAdjacentHTML: { value: function insertAdjacentHTML(position, text) { - position = utils.toASCIILowerCase(String(position)); - text = String(text); - var context; - switch(position) { - case 'beforebegin': - case 'afterend': - context = this.parentNode; - if (context === null || context.nodeType === Node.DOCUMENT_NODE) { - utils.NoModificationAllowedError(); - } - break; - case 'afterbegin': - case 'beforeend': - context = this; - break; - default: - utils.SyntaxError(); - } - if ( (!(context instanceof Element)) || ( - context.ownerDocument.isHTML && - context.localName === 'html' && - context.namespaceURI === NAMESPACE.HTML - ) ) { - context = context.ownerDocument.createElementNS(NAMESPACE.HTML, 'body'); - } - var parser = this.ownerDocument.implementation.mozHTMLParser( - this.ownerDocument._address, context - ); - parser.parse(text, true); - this._insertAdjacent(position, parser._asDocumentFragment()); - }}, - - children: { get: function() { - if (!this._children) { - this._children = new ChildrenCollection(this); - } - return this._children; - }}, - - attributes: { get: function() { - if (!this._attributes) { - this._attributes = new AttributesArray(this); - } - return this._attributes; - }}, - - - firstElementChild: { get: function() { - for (var kid = this.firstChild; kid !== null; kid = kid.nextSibling) { - if (kid.nodeType === Node.ELEMENT_NODE) return kid; - } - return null; - }}, - - lastElementChild: { get: function() { - for (var kid = this.lastChild; kid !== null; kid = kid.previousSibling) { - if (kid.nodeType === Node.ELEMENT_NODE) return kid; - } - return null; - }}, - - childElementCount: { get: function() { - return this.children.length; - }}, - - - // Return the next element, in source order, after this one or - // null if there are no more. If root element is specified, - // then don't traverse beyond its subtree. - // - // This is not a DOM method, but is convenient for - // lazy traversals of the tree. - nextElement: { value: function(root) { - if (!root) root = this.ownerDocument.documentElement; - var next = this.firstElementChild; - if (!next) { - // don't use sibling if we're at root - if (this===root) return null; - next = this.nextElementSibling; - } - if (next) return next; - - // If we can't go down or across, then we have to go up - // and across to the parent sibling or another ancestor's - // sibling. Be careful, though: if we reach the root - // element, or if we reach the documentElement, then - // the traversal ends. - for(var parent = this.parentElement; - parent && parent !== root; - parent = parent.parentElement) { - - next = parent.nextElementSibling; - if (next) return next; - } - - return null; - }}, - - // XXX: - // Tests are currently failing for this function. - // Awaiting resolution of: - // http://lists.w3.org/Archives/Public/www-dom/2011JulSep/0016.html - getElementsByTagName: { value: function getElementsByTagName(lname) { - var filter; - if (!lname) return new NodeList(); - if (lname === '*') - filter = function() { return true; }; - else if (this.isHTML) - filter = htmlLocalNameElementFilter(lname); - else - filter = localNameElementFilter(lname); - - return new FilteredElementList(this, filter); - }}, - - getElementsByTagNameNS: { value: function getElementsByTagNameNS(ns, lname){ - var filter; - if (ns === '*' && lname === '*') - filter = function() { return true; }; - else if (ns === '*') - filter = localNameElementFilter(lname); - else if (lname === '*') - filter = namespaceElementFilter(ns); - else - filter = namespaceLocalNameElementFilter(ns, lname); - - return new FilteredElementList(this, filter); - }}, - - getElementsByClassName: { value: function getElementsByClassName(names){ - names = String(names).trim(); - if (names === '') { - var result = new NodeList(); // Empty node list - return result; - } - names = names.split(/[ \t\r\n\f]+/); // Split on ASCII whitespace - return new FilteredElementList(this, classNamesElementFilter(names)); - }}, - - getElementsByName: { value: function getElementsByName(name) { - return new FilteredElementList(this, elementNameFilter(String(name))); - }}, - - // Utility methods used by the public API methods above - clone: { value: function clone() { - var e; - - // XXX: - // Modify this to use the constructor directly or - // avoid error checking in some other way. In case we try - // to clone an invalid node that the parser inserted. - // - if (this.namespaceURI !== NAMESPACE.HTML || this.prefix || !this.ownerDocument.isHTML) { - e = this.ownerDocument.createElementNS( - this.namespaceURI, (this.prefix !== null) ? - (this.prefix + ':' + this.localName) : this.localName - ); - } else { - e = this.ownerDocument.createElement(this.localName); - } - - for(var i = 0, n = this._attrKeys.length; i < n; i++) { - var lname = this._attrKeys[i]; - var a = this._attrsByLName[lname]; - var b = a.cloneNode(); - b._setOwnerElement(e); - e._attrsByLName[lname] = b; - e._addQName(b); - } - e._attrKeys = this._attrKeys.concat(); - - return e; - }}, - - isEqual: { value: function isEqual(that) { - if (this.localName !== that.localName || - this.namespaceURI !== that.namespaceURI || - this.prefix !== that.prefix || - this._numattrs !== that._numattrs) - return false; - - // Compare the sets of attributes, ignoring order - // and ignoring attribute prefixes. - for(var i = 0, n = this._numattrs; i < n; i++) { - var a = this._attr(i); - if (!that.hasAttributeNS(a.namespaceURI, a.localName)) - return false; - if (that.getAttributeNS(a.namespaceURI,a.localName) !== a.value) - return false; - } - - return true; - }}, - - // This is the 'locate a namespace prefix' algorithm from the - // DOM specification. It is used by Node.lookupPrefix() - // (Be sure to compare DOM3 and DOM4 versions of spec.) - _lookupNamespacePrefix: { value: function _lookupNamespacePrefix(ns, originalElement) { - if ( - this.namespaceURI && - this.namespaceURI === ns && - this.prefix !== null && - originalElement.lookupNamespaceURI(this.prefix) === ns - ) { - return this.prefix; - } - - for(var i = 0, n = this._numattrs; i < n; i++) { - var a = this._attr(i); - if ( - a.prefix === 'xmlns' && - a.value === ns && - originalElement.lookupNamespaceURI(a.localName) === ns - ) { - return a.localName; - } - } - - var parent = this.parentElement; - return parent ? parent._lookupNamespacePrefix(ns, originalElement) : null; - }}, - - // This is the 'locate a namespace' algorithm for Element nodes - // from the DOM Core spec. It is used by Node#lookupNamespaceURI() - lookupNamespaceURI: { value: function lookupNamespaceURI(prefix) { - if (prefix === '' || prefix === undefined) { prefix = null; } - if (this.namespaceURI !== null && this.prefix === prefix) - return this.namespaceURI; - - for(var i = 0, n = this._numattrs; i < n; i++) { - var a = this._attr(i); - if (a.namespaceURI === NAMESPACE.XMLNS) { - if ( - (a.prefix === 'xmlns' && a.localName === prefix) || - (prefix === null && a.prefix === null && a.localName === 'xmlns') - ) { - return a.value || null; - } - } - } - - var parent = this.parentElement; - return parent ? parent.lookupNamespaceURI(prefix) : null; - }}, - - // - // Attribute handling methods and utilities - // - - /* - * Attributes in the DOM are tricky: - * - * - there are the 8 basic get/set/has/removeAttribute{NS} methods - * - * - but many HTML attributes are also 'reflected' through IDL - * attributes which means that they can be queried and set through - * regular properties of the element. There is just one attribute - * value, but two ways to get and set it. - * - * - Different HTML element types have different sets of reflected - attributes. - * - * - attributes can also be queried and set through the .attributes - * property of an element. This property behaves like an array of - * Attr objects. The value property of each Attr is writeable, so - * this is a third way to read and write attributes. - * - * - for efficiency, we really want to store attributes in some kind - * of name->attr map. But the attributes[] array is an array, not a - * map, which is kind of unnatural. - * - * - When using namespaces and prefixes, and mixing the NS methods - * with the non-NS methods, it is apparently actually possible for - * an attributes[] array to have more than one attribute with the - * same qualified name. And certain methods must operate on only - * the first attribute with such a name. So for these methods, an - * inefficient array-like data structure would be easier to - * implement. - * - * - The attributes[] array is live, not a snapshot, so changes to the - * attributes must be immediately visible through existing arrays. - * - * - When attributes are queried and set through IDL properties - * (instead of the get/setAttributes() method or the attributes[] - * array) they may be subject to type conversions, URL - * normalization, etc., so some extra processing is required in that - * case. - * - * - But access through IDL properties is probably the most common - * case, so we'd like that to be as fast as possible. - * - * - We can't just store attribute values in their parsed idl form, - * because setAttribute() has to return whatever string is passed to - * getAttribute even if it is not a legal, parseable value. So - * attribute values must be stored in unparsed string form. - * - * - We need to be able to send change notifications or mutation - * events of some sort to the renderer whenever an attribute value - * changes, regardless of the way in which it changes. - * - * - Some attributes, such as id and class affect other parts of the - * DOM API, like getElementById and getElementsByClassName and so - * for efficiency, we need to specially track changes to these - * special attributes. - * - * - Some attributes like class have different names (className) when - * reflected. - * - * - Attributes whose names begin with the string 'data-' are treated - specially. - * - * - Reflected attributes that have a boolean type in IDL have special - * behavior: setting them to false (in IDL) is the same as removing - * them with removeAttribute() - * - * - numeric attributes (like HTMLElement.tabIndex) can have default - * values that must be returned by the idl getter even if the - * content attribute does not exist. (The default tabIndex value - * actually varies based on the type of the element, so that is a - * tricky one). - * - * See - * http://www.whatwg.org/specs/web-apps/current-work/multipage/urls.html#reflect - * for rules on how attributes are reflected. - * - */ - - getAttribute: { value: function getAttribute(qname) { - var attr = this.getAttributeNode(qname); - return attr ? attr.value : null; - }}, - - getAttributeNS: { value: function getAttributeNS(ns, lname) { - var attr = this.getAttributeNodeNS(ns, lname); - return attr ? attr.value : null; - }}, - - getAttributeNode: { value: function getAttributeNode(qname) { - qname = String(qname); - if (/[A-Z]/.test(qname) && this.isHTML) - qname = utils.toASCIILowerCase(qname); - var attr = this._attrsByQName[qname]; - if (!attr) return null; - - if (Array.isArray(attr)) // If there is more than one - attr = attr[0]; // use the first - - return attr; - }}, - - getAttributeNodeNS: { value: function getAttributeNodeNS(ns, lname) { - ns = (ns === undefined || ns === null) ? '' : String(ns); - lname = String(lname); - var attr = this._attrsByLName[ns + '|' + lname]; - return attr ? attr : null; - }}, - - hasAttribute: { value: function hasAttribute(qname) { - qname = String(qname); - if (/[A-Z]/.test(qname) && this.isHTML) - qname = utils.toASCIILowerCase(qname); - return this._attrsByQName[qname] !== undefined; - }}, - - hasAttributeNS: { value: function hasAttributeNS(ns, lname) { - ns = (ns === undefined || ns === null) ? '' : String(ns); - lname = String(lname); - var key = ns + '|' + lname; - return this._attrsByLName[key] !== undefined; - }}, - - hasAttributes: { value: function hasAttributes() { - return this._numattrs > 0; - }}, - - toggleAttribute: { value: function toggleAttribute(qname, force) { - qname = String(qname); - if (!xml.isValidName(qname)) utils.InvalidCharacterError(); - if (/[A-Z]/.test(qname) && this.isHTML) - qname = utils.toASCIILowerCase(qname); - var a = this._attrsByQName[qname]; - if (a === undefined) { - if (force === undefined || force === true) { - this._setAttribute(qname, ''); - return true; - } - return false; - } else { - if (force === undefined || force === false) { - this.removeAttribute(qname); - return false; - } - return true; - } - }}, - - // Set the attribute without error checking. The parser uses this. - _setAttribute: { value: function _setAttribute(qname, value) { - // XXX: the spec says that this next search should be done - // on the local name, but I think that is an error. - // email pending on www-dom about it. - var attr = this._attrsByQName[qname]; - var isnew; - if (!attr) { - attr = this._newattr(qname); - isnew = true; - } - else { - if (Array.isArray(attr)) attr = attr[0]; - } - - // Now set the attribute value on the new or existing Attr object. - // The Attr.value setter method handles mutation events, etc. - attr.value = value; - if (this._attributes) this._attributes[qname] = attr; - if (isnew && this._newattrhook) this._newattrhook(qname, value); - }}, - - // Check for errors, and then set the attribute - setAttribute: { value: function setAttribute(qname, value) { - qname = String(qname); - if (!xml.isValidName(qname)) utils.InvalidCharacterError(); - if (/[A-Z]/.test(qname) && this.isHTML) - qname = utils.toASCIILowerCase(qname); - this._setAttribute(qname, String(value)); - }}, - - - // The version with no error checking used by the parser - _setAttributeNS: { value: function _setAttributeNS(ns, qname, value) { - var pos = qname.indexOf(':'), prefix, lname; - if (pos < 0) { - prefix = null; - lname = qname; - } - else { - prefix = qname.substring(0, pos); - lname = qname.substring(pos+1); - } - - if (ns === '' || ns === undefined) ns = null; - var key = (ns === null ? '' : ns) + '|' + lname; - - var attr = this._attrsByLName[key]; - var isnew; - if (!attr) { - attr = new Attr(this, lname, prefix, ns); - isnew = true; - this._attrsByLName[key] = attr; - if (this._attributes) { - this._attributes[this._attrKeys.length] = attr; - } - this._attrKeys.push(key); - - // We also have to make the attr searchable by qname. - // But we have to be careful because there may already - // be an attr with this qname. - this._addQName(attr); - } - else if (false /* changed in DOM 4 */) { - // Calling setAttributeNS() can change the prefix of an - // existing attribute in DOM 2/3. - if (attr.prefix !== prefix) { - // Unbind the old qname - this._removeQName(attr); - // Update the prefix - attr.prefix = prefix; - // Bind the new qname - this._addQName(attr); - } - - } - attr.value = value; // Automatically sends mutation event - if (isnew && this._newattrhook) this._newattrhook(qname, value); - }}, - - // Do error checking then call _setAttributeNS - setAttributeNS: { value: function setAttributeNS(ns, qname, value) { - // Convert parameter types according to WebIDL - ns = (ns === null || ns === undefined || ns === '') ? null : String(ns); - qname = String(qname); - if (!xml.isValidQName(qname)) utils.InvalidCharacterError(); - - var pos = qname.indexOf(':'); - var prefix = (pos < 0) ? null : qname.substring(0, pos); - - if ((prefix !== null && ns === null) || - (prefix === 'xml' && ns !== NAMESPACE.XML) || - ((qname === 'xmlns' || prefix === 'xmlns') && - (ns !== NAMESPACE.XMLNS)) || - (ns === NAMESPACE.XMLNS && - !(qname === 'xmlns' || prefix === 'xmlns'))) - utils.NamespaceError(); - - this._setAttributeNS(ns, qname, String(value)); - }}, - - setAttributeNode: { value: function setAttributeNode(attr) { - if (attr.ownerElement !== null && attr.ownerElement !== this) { - throw new DOMException(DOMException.INUSE_ATTRIBUTE_ERR); - } - var result = null; - var oldAttrs = this._attrsByQName[attr.name]; - if (oldAttrs) { - if (!Array.isArray(oldAttrs)) { oldAttrs = [ oldAttrs ]; } - if (oldAttrs.some(function(a) { return a===attr; })) { - return attr; - } else if (attr.ownerElement !== null) { - throw new DOMException(DOMException.INUSE_ATTRIBUTE_ERR); - } - oldAttrs.forEach(function(a) { this.removeAttributeNode(a); }, this); - result = oldAttrs[0]; - } - this.setAttributeNodeNS(attr); - return result; - }}, - - setAttributeNodeNS: { value: function setAttributeNodeNS(attr) { - if (attr.ownerElement !== null) { - throw new DOMException(DOMException.INUSE_ATTRIBUTE_ERR); - } - var ns = attr.namespaceURI; - var key = (ns === null ? '' : ns) + '|' + attr.localName; - var oldAttr = this._attrsByLName[key]; - if (oldAttr) { this.removeAttributeNode(oldAttr); } - attr._setOwnerElement(this); - this._attrsByLName[key] = attr; - if (this._attributes) { - this._attributes[this._attrKeys.length] = attr; - } - this._attrKeys.push(key); - this._addQName(attr); - if (this._newattrhook) this._newattrhook(attr.name, attr.value); - return oldAttr || null; - }}, - - removeAttribute: { value: function removeAttribute(qname) { - qname = String(qname); - if (/[A-Z]/.test(qname) && this.isHTML) - qname = utils.toASCIILowerCase(qname); - - var attr = this._attrsByQName[qname]; - if (!attr) return; - - // If there is more than one match for this qname - // so don't delete the qname mapping, just remove the first - // element from it. - if (Array.isArray(attr)) { - if (attr.length > 2) { - attr = attr.shift(); // remove it from the array - } - else { - this._attrsByQName[qname] = attr[1]; - attr = attr[0]; - } - } - else { - // only a single match, so remove the qname mapping - this._attrsByQName[qname] = undefined; - } - - var ns = attr.namespaceURI; - // Now attr is the removed attribute. Figure out its - // ns+lname key and remove it from the other mapping as well. - var key = (ns === null ? '' : ns) + '|' + attr.localName; - this._attrsByLName[key] = undefined; - - var i = this._attrKeys.indexOf(key); - if (this._attributes) { - Array.prototype.splice.call(this._attributes, i, 1); - this._attributes[qname] = undefined; - } - this._attrKeys.splice(i, 1); - - // Onchange handler for the attribute - var onchange = attr.onchange; - attr._setOwnerElement(null); - if (onchange) { - onchange.call(attr, this, attr.localName, attr.value, null); - } - // Mutation event - if (this.rooted) this.ownerDocument.mutateRemoveAttr(attr); - }}, - - removeAttributeNS: { value: function removeAttributeNS(ns, lname) { - ns = (ns === undefined || ns === null) ? '' : String(ns); - lname = String(lname); - var key = ns + '|' + lname; - var attr = this._attrsByLName[key]; - if (!attr) return; - - this._attrsByLName[key] = undefined; - - var i = this._attrKeys.indexOf(key); - if (this._attributes) { - Array.prototype.splice.call(this._attributes, i, 1); - } - this._attrKeys.splice(i, 1); - - // Now find the same Attr object in the qname mapping and remove it - // But be careful because there may be more than one match. - this._removeQName(attr); - - // Onchange handler for the attribute - var onchange = attr.onchange; - attr._setOwnerElement(null); - if (onchange) { - onchange.call(attr, this, attr.localName, attr.value, null); - } - // Mutation event - if (this.rooted) this.ownerDocument.mutateRemoveAttr(attr); - }}, - - removeAttributeNode: { value: function removeAttributeNode(attr) { - var ns = attr.namespaceURI; - var key = (ns === null ? '' : ns) + '|' + attr.localName; - if (this._attrsByLName[key] !== attr) { - utils.NotFoundError(); - } - this.removeAttributeNS(ns, attr.localName); - return attr; - }}, - - getAttributeNames: { value: function getAttributeNames() { - var elt = this; - return this._attrKeys.map(function(key) { - return elt._attrsByLName[key].name; - }); - }}, - - // This 'raw' version of getAttribute is used by the getter functions - // of reflected attributes. It skips some error checking and - // namespace steps - _getattr: { value: function _getattr(qname) { - // Assume that qname is already lowercased, so don't do it here. - // Also don't check whether attr is an array: a qname with no - // prefix will never have two matching Attr objects (because - // setAttributeNS doesn't allow a non-null namespace with a - // null prefix. - var attr = this._attrsByQName[qname]; - return attr ? attr.value : null; - }}, - - // The raw version of setAttribute for reflected idl attributes. - _setattr: { value: function _setattr(qname, value) { - var attr = this._attrsByQName[qname]; - var isnew; - if (!attr) { - attr = this._newattr(qname); - isnew = true; - } - attr.value = String(value); - if (this._attributes) this._attributes[qname] = attr; - if (isnew && this._newattrhook) this._newattrhook(qname, value); - }}, - - // Create a new Attr object, insert it, and return it. - // Used by setAttribute() and by set() - _newattr: { value: function _newattr(qname) { - var attr = new Attr(this, qname, null, null); - var key = '|' + qname; - this._attrsByQName[qname] = attr; - this._attrsByLName[key] = attr; - if (this._attributes) { - this._attributes[this._attrKeys.length] = attr; - } - this._attrKeys.push(key); - return attr; - }}, - - // Add a qname->Attr mapping to the _attrsByQName object, taking into - // account that there may be more than one attr object with the - // same qname - _addQName: { value: function(attr) { - var qname = attr.name; - var existing = this._attrsByQName[qname]; - if (!existing) { - this._attrsByQName[qname] = attr; - } - else if (Array.isArray(existing)) { - existing.push(attr); - } - else { - this._attrsByQName[qname] = [existing, attr]; - } - if (this._attributes) this._attributes[qname] = attr; - }}, - - // Remove a qname->Attr mapping to the _attrsByQName object, taking into - // account that there may be more than one attr object with the - // same qname - _removeQName: { value: function(attr) { - var qname = attr.name; - var target = this._attrsByQName[qname]; - - if (Array.isArray(target)) { - var idx = target.indexOf(attr); - utils.assert(idx !== -1); // It must be here somewhere - if (target.length === 2) { - this._attrsByQName[qname] = target[1-idx]; - if (this._attributes) { - this._attributes[qname] = this._attrsByQName[qname]; - } - } else { - target.splice(idx, 1); - if (this._attributes && this._attributes[qname] === attr) { - this._attributes[qname] = target[0]; - } - } - } - else { - utils.assert(target === attr); // If only one, it must match - this._attrsByQName[qname] = undefined; - if (this._attributes) { - this._attributes[qname] = undefined; - } - } - }}, - - // Return the number of attributes - _numattrs: { get: function() { return this._attrKeys.length; }}, - // Return the nth Attr object - _attr: { value: function(n) { - return this._attrsByLName[this._attrKeys[n]]; - }}, - - // Define getters and setters for an 'id' property that reflects - // the content attribute 'id'. - id: attributes.property({name: 'id'}), - - // Define getters and setters for a 'className' property that reflects - // the content attribute 'class'. - className: attributes.property({name: 'class'}), - - classList: { get: function() { - var self = this; - if (this._classList) { - return this._classList; - } - var dtlist = new DOMTokenList( - function() { - return self.className || ""; - }, - function(v) { - self.className = v; - } - ); - this._classList = dtlist; - return dtlist; - }, set: function(v) { this.className = v; }}, - - matches: { value: function(selector) { - return select.matches(this, selector); - }}, - - closest: { value: function(selector) { - var el = this; - do { - if (el.matches && el.matches(selector)) { return el; } - el = el.parentElement || el.parentNode; - } while (el !== null && el.nodeType === Node.ELEMENT_NODE); - return null; - }}, - - querySelector: { value: function(selector) { - return select(selector, this)[0]; - }}, - - querySelectorAll: { value: function(selector) { - var nodes = select(selector, this); - return nodes.item ? nodes : new NodeList(nodes); - }} - -}); - -Object.defineProperties(Element.prototype, ChildNode); -Object.defineProperties(Element.prototype, NonDocumentTypeChildNode); - -// Register special handling for the id attribute -attributes.registerChangeHandler(Element, 'id', - function(element, lname, oldval, newval) { - if (element.rooted) { - if (oldval) { - element.ownerDocument.delId(oldval, element); - } - if (newval) { - element.ownerDocument.addId(newval, element); - } - } - } -); -attributes.registerChangeHandler(Element, 'class', - function(element, lname, oldval, newval) { - if (element._classList) { element._classList._update(); } - } -); - -// The Attr class represents a single attribute. The values in -// _attrsByQName and _attrsByLName are instances of this class. -function Attr(elt, lname, prefix, namespace, value) { - // localName and namespace are constant for any attr object. - // But value may change. And so can prefix, and so, therefore can name. - this.localName = lname; - this.prefix = (prefix===null || prefix==='') ? null : ('' + prefix); - this.namespaceURI = (namespace===null || namespace==='') ? null : ('' + namespace); - this.data = value; - // Set ownerElement last to ensure it is hooked up to onchange handler - this._setOwnerElement(elt); -} - -// In DOM 3 Attr was supposed to extend Node; in DOM 4 that was abandoned. -Attr.prototype = Object.create(Object.prototype, { - ownerElement: { - get: function() { return this._ownerElement; }, - }, - _setOwnerElement: { value: function _setOwnerElement(elt) { - this._ownerElement = elt; - if (this.prefix === null && this.namespaceURI === null && elt) { - this.onchange = elt._attributeChangeHandlers[this.localName]; - } else { - this.onchange = null; - } - }}, - - name: { get: function() { - return this.prefix ? this.prefix + ':' + this.localName : this.localName; - }}, - - specified: { get: function() { - // Deprecated - return true; - }}, - - value: { - get: function() { - return this.data; - }, - set: function(value) { - var oldval = this.data; - value = (value === undefined) ? '' : value + ''; - if (value === oldval) return; - - this.data = value; - - // Run the onchange hook for the attribute - // if there is one. - if (this.ownerElement) { - if (this.onchange) - this.onchange(this.ownerElement,this.localName, oldval, value); - - // Generate a mutation event if the element is rooted - if (this.ownerElement.rooted) - this.ownerElement.ownerDocument.mutateAttr(this, oldval); - } - }, - }, - - cloneNode: { value: function cloneNode(deep) { - // Both this method and Document#createAttribute*() create unowned Attrs - return new Attr( - null, this.localName, this.prefix, this.namespaceURI, this.data - ); - }}, - - // Legacy aliases (see gh#70 and https://dom.spec.whatwg.org/#interface-attr) - nodeType: { get: function() { return Node.ATTRIBUTE_NODE; } }, - nodeName: { get: function() { return this.name; } }, - nodeValue: { - get: function() { return this.value; }, - set: function(v) { this.value = v; }, - }, - textContent: { - get: function() { return this.value; }, - set: function(v) { - if (v === null || v === undefined) { v = ''; } - this.value = v; - }, - }, - innerText: { - get: function() { return this.value; }, - set: function(v) { - if (v === null || v === undefined) { v = ''; } - this.value = v; - }, - }, -}); -// Sneakily export this class for use by Document.createAttribute() -Element._Attr = Attr; - -// The attributes property of an Element will be an instance of this class. -// This class is really just a dummy, though. It only defines a length -// property and an item() method. The AttrArrayProxy that -// defines the public API just uses the Element object itself. -function AttributesArray(elt) { - NamedNodeMap.call(this, elt); - for (var name in elt._attrsByQName) { - this[name] = elt._attrsByQName[name]; - } - for (var i = 0; i < elt._attrKeys.length; i++) { - this[i] = elt._attrsByLName[elt._attrKeys[i]]; - } -} -AttributesArray.prototype = Object.create(NamedNodeMap.prototype, { - length: { get: function() { - return this.element._attrKeys.length; - }, set: function() { /* ignore */ } }, - item: { value: function(n) { - /* jshint bitwise: false */ - n = n >>> 0; - if (n >= this.length) { return null; } - return this.element._attrsByLName[this.element._attrKeys[n]]; - /* jshint bitwise: true */ - } }, -}); - -// We can't make direct array access work (without Proxies, node >=6) -// but we can make `Array.from(node.attributes)` and for-of loops work. -if (globalThis.Symbol?.iterator) { - AttributesArray.prototype[globalThis.Symbol.iterator] = function() { - var i=0, n=this.length, self=this; - return { - next: function() { - if (ielement map. - // It is not part of the HTMLCollection API, but we need it in - // src/HTMLCollectionProxy - namedItems: { get: function() { - this.updateCache(); - return this.childrenByName; - } }, - - updateCache: { value: function updateCache() { - var namedElts = /^(a|applet|area|embed|form|frame|frameset|iframe|img|object)$/; - if (this.lastModTime !== this.element.lastModTime) { - this.lastModTime = this.element.lastModTime; - - var n = this.childrenByNumber && this.childrenByNumber.length || 0; - for(var i = 0; i < n; i++) { - this[i] = undefined; - } - - this.childrenByNumber = []; - this.childrenByName = Object.create(null); - - for (var c = this.element.firstChild; c !== null; c = c.nextSibling) { - if (c.nodeType === Node.ELEMENT_NODE) { - - this[this.childrenByNumber.length] = c; - this.childrenByNumber.push(c); - - // XXX Are there any requirements about the namespace - // of the id property? - var id = c.getAttribute('id'); - - // If there is an id that is not already in use... - if (id && !this.childrenByName[id]) - this.childrenByName[id] = c; - - // For certain HTML elements we check the name attribute - var name = c.getAttribute('name'); - if (name && - this.element.namespaceURI === NAMESPACE.HTML && - namedElts.test(this.element.localName) && - !this.childrenByName[name]) - this.childrenByName[id] = c; - } - } - } - } }, -}); - -// These functions return predicates for filtering elements. -// They're used by the Document and Element classes for methods like -// getElementsByTagName and getElementsByClassName - -function localNameElementFilter(lname) { - return function(e) { return e.localName === lname; }; -} - -function htmlLocalNameElementFilter(lname) { - var lclname = utils.toASCIILowerCase(lname); - if (lclname === lname) - return localNameElementFilter(lname); - - return function(e) { - return e.isHTML ? e.localName === lclname : e.localName === lname; - }; -} - -function namespaceElementFilter(ns) { - return function(e) { return e.namespaceURI === ns; }; -} - -function namespaceLocalNameElementFilter(ns, lname) { - return function(e) { - return e.namespaceURI === ns && e.localName === lname; - }; -} - -function classNamesElementFilter(names) { - return function(e) { - return names.every(function(n) { return e.classList.contains(n); }); - }; -} - -function elementNameFilter(name) { - return function(e) { - // All the *HTML elements* in the document with the given name attribute - if (e.namespaceURI !== NAMESPACE.HTML) { return false; } - return e.getAttribute('name') === name; - }; -} diff --git a/.output/server/node_modules/@mixmark-io/domino/lib/Event.js b/.output/server/node_modules/@mixmark-io/domino/lib/Event.js deleted file mode 100644 index a1272c4..0000000 --- a/.output/server/node_modules/@mixmark-io/domino/lib/Event.js +++ /dev/null @@ -1,66 +0,0 @@ -"use strict"; -module.exports = Event; - -Event.CAPTURING_PHASE = 1; -Event.AT_TARGET = 2; -Event.BUBBLING_PHASE = 3; - -function Event(type, dictionary) { - // Initialize basic event properties - this.type = ''; - this.target = null; - this.currentTarget = null; - this.eventPhase = Event.AT_TARGET; - this.bubbles = false; - this.cancelable = false; - this.isTrusted = false; - this.defaultPrevented = false; - this.timeStamp = Date.now(); - - // Initialize internal flags - // XXX: Would it be better to inherit these defaults from the prototype? - this._propagationStopped = false; - this._immediatePropagationStopped = false; - this._initialized = true; - this._dispatching = false; - - // Now initialize based on the constructor arguments (if any) - if (type) this.type = type; - if (dictionary) { - for(var p in dictionary) { - this[p] = dictionary[p]; - } - } -} - -Event.prototype = Object.create(Object.prototype, { - constructor: { value: Event }, - stopPropagation: { value: function stopPropagation() { - this._propagationStopped = true; - }}, - - stopImmediatePropagation: { value: function stopImmediatePropagation() { - this._propagationStopped = true; - this._immediatePropagationStopped = true; - }}, - - preventDefault: { value: function preventDefault() { - if (this.cancelable) this.defaultPrevented = true; - }}, - - initEvent: { value: function initEvent(type, bubbles, cancelable) { - this._initialized = true; - if (this._dispatching) return; - - this._propagationStopped = false; - this._immediatePropagationStopped = false; - this.defaultPrevented = false; - this.isTrusted = false; - - this.target = null; - this.type = type; - this.bubbles = bubbles; - this.cancelable = cancelable; - }}, - -}); diff --git a/.output/server/node_modules/@mixmark-io/domino/lib/EventTarget.js b/.output/server/node_modules/@mixmark-io/domino/lib/EventTarget.js deleted file mode 100644 index 03a9919..0000000 --- a/.output/server/node_modules/@mixmark-io/domino/lib/EventTarget.js +++ /dev/null @@ -1,298 +0,0 @@ -"use strict"; -var Event = require('./Event'); -var MouseEvent = require('./MouseEvent'); -var utils = require('./utils'); - -module.exports = EventTarget; - -function EventTarget() {} - -EventTarget.prototype = { - // XXX - // See WebIDL §4.8 for details on object event handlers - // and how they should behave. We actually have to accept - // any object to addEventListener... Can't type check it. - // on registration. - - // XXX: - // Capturing event listeners are sort of rare. I think I can optimize - // them so that dispatchEvent can skip the capturing phase (or much of - // it). Each time a capturing listener is added, increment a flag on - // the target node and each of its ancestors. Decrement when removed. - // And update the counter when nodes are added and removed from the - // tree as well. Then, in dispatch event, the capturing phase can - // abort if it sees any node with a zero count. - addEventListener: function addEventListener(type, listener, capture) { - if (!listener) return; - if (capture === undefined) capture = false; - if (!this._listeners) this._listeners = Object.create(null); - if (!this._listeners[type]) this._listeners[type] = []; - var list = this._listeners[type]; - - // If this listener has already been registered, just return - for(var i = 0, n = list.length; i < n; i++) { - var l = list[i]; - if (l.listener === listener && l.capture === capture) - return; - } - - // Add an object to the list of listeners - var obj = { listener: listener, capture: capture }; - if (typeof listener === 'function') obj.f = listener; - list.push(obj); - }, - - removeEventListener: function removeEventListener(type, - listener, - capture) { - if (capture === undefined) capture = false; - if (this._listeners) { - var list = this._listeners[type]; - if (list) { - // Find the listener in the list and remove it - for(var i = 0, n = list.length; i < n; i++) { - var l = list[i]; - if (l.listener === listener && l.capture === capture) { - if (list.length === 1) { - this._listeners[type] = undefined; - } - else { - list.splice(i, 1); - } - return; - } - } - } - } - }, - - // This is the public API for dispatching untrusted public events. - // See _dispatchEvent for the implementation - dispatchEvent: function dispatchEvent(event) { - // Dispatch an untrusted event - return this._dispatchEvent(event, false); - }, - - // - // See DOMCore §4.4 - // XXX: I'll probably need another version of this method for - // internal use, one that does not set isTrusted to false. - // XXX: see Document._dispatchEvent: perhaps that and this could - // call a common internal function with different settings of - // a trusted boolean argument - // - // XXX: - // The spec has changed in how to deal with handlers registered - // on idl or content attributes rather than with addEventListener. - // Used to say that they always ran first. That's how webkit does it - // Spec now says that they run in a position determined by - // when they were first set. FF does it that way. See: - // http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#event-handlers - // - _dispatchEvent: function _dispatchEvent(event, trusted) { - if (typeof trusted !== 'boolean') trusted = false; - function invoke(target, event) { - var type = event.type, phase = event.eventPhase; - event.currentTarget = target; - - // If there was an individual handler defined, invoke it first - // XXX: see comment above: this shouldn't always be first. - if (phase !== Event.CAPTURING_PHASE && - target._handlers && target._handlers[type]) - { - var handler = target._handlers[type]; - var rv; - if (typeof handler === 'function') { - rv=handler.call(event.currentTarget, event); - } - else { - var f = handler.handleEvent; - if (typeof f !== 'function') - throw new TypeError('handleEvent property of ' + - 'event handler object is' + - 'not a function.'); - rv=f.call(handler, event); - } - - switch(event.type) { - case 'mouseover': - if (rv === true) // Historical baggage - event.preventDefault(); - break; - case 'beforeunload': - // XXX: eventually we need a special case here - /* falls through */ - default: - if (rv === false) - event.preventDefault(); - break; - } - } - - // Now invoke list list of listeners for this target and type - var list = target._listeners && target._listeners[type]; - if (!list) return; - list = list.slice(); - for(var i = 0, n = list.length; i < n; i++) { - if (event._immediatePropagationStopped) return; - var l = list[i]; - if ((phase === Event.CAPTURING_PHASE && !l.capture) || - (phase === Event.BUBBLING_PHASE && l.capture)) - continue; - if (l.f) { - l.f.call(event.currentTarget, event); - } - else { - var fn = l.listener.handleEvent; - if (typeof fn !== 'function') - throw new TypeError('handleEvent property of event listener object is not a function.'); - fn.call(l.listener, event); - } - } - } - - if (!event._initialized || event._dispatching) utils.InvalidStateError(); - event.isTrusted = trusted; - - // Begin dispatching the event now - event._dispatching = true; - event.target = this; - - // Build the list of targets for the capturing and bubbling phases - // XXX: we'll eventually have to add Window to this list. - var ancestors = []; - for(var n = this.parentNode; n; n = n.parentNode) - ancestors.push(n); - - // Capturing phase - event.eventPhase = Event.CAPTURING_PHASE; - for(var i = ancestors.length-1; i >= 0; i--) { - invoke(ancestors[i], event); - if (event._propagationStopped) break; - } - - // At target phase - if (!event._propagationStopped) { - event.eventPhase = Event.AT_TARGET; - invoke(this, event); - } - - // Bubbling phase - if (event.bubbles && !event._propagationStopped) { - event.eventPhase = Event.BUBBLING_PHASE; - for(var ii = 0, nn = ancestors.length; ii < nn; ii++) { - invoke(ancestors[ii], event); - if (event._propagationStopped) break; - } - } - - event._dispatching = false; - event.eventPhase = Event.AT_TARGET; - event.currentTarget = null; - - // Deal with mouse events and figure out when - // a click has happened - if (trusted && !event.defaultPrevented && event instanceof MouseEvent) { - switch(event.type) { - case 'mousedown': - this._armed = { - x: event.clientX, - y: event.clientY, - t: event.timeStamp - }; - break; - case 'mouseout': - case 'mouseover': - this._armed = null; - break; - case 'mouseup': - if (this._isClick(event)) this._doClick(event); - this._armed = null; - break; - } - } - - - - return !event.defaultPrevented; - }, - - // Determine whether a click occurred - // XXX We don't support double clicks for now - _isClick: function(event) { - return (this._armed !== null && - event.type === 'mouseup' && - event.isTrusted && - event.button === 0 && - event.timeStamp - this._armed.t < 1000 && - Math.abs(event.clientX - this._armed.x) < 10 && - Math.abs(event.clientY - this._armed.Y) < 10); - }, - - // Clicks are handled like this: - // http://www.whatwg.org/specs/web-apps/current-work/multipage/elements.html#interactive-content-0 - // - // Note that this method is similar to the HTMLElement.click() method - // The event argument must be the trusted mouseup event - _doClick: function(event) { - if (this._click_in_progress) return; - this._click_in_progress = true; - - // Find the nearest enclosing element that is activatable - // An element is activatable if it has a - // _post_click_activation_steps hook - var activated = this; - while(activated && !activated._post_click_activation_steps) - activated = activated.parentNode; - - if (activated && activated._pre_click_activation_steps) { - activated._pre_click_activation_steps(); - } - - var click = this.ownerDocument.createEvent('MouseEvent'); - click.initMouseEvent('click', true, true, - this.ownerDocument.defaultView, 1, - event.screenX, event.screenY, - event.clientX, event.clientY, - event.ctrlKey, event.altKey, - event.shiftKey, event.metaKey, - event.button, null); - - var result = this._dispatchEvent(click, true); - - if (activated) { - if (result) { - // This is where hyperlinks get followed, for example. - if (activated._post_click_activation_steps) - activated._post_click_activation_steps(click); - } - else { - if (activated._cancelled_activation_steps) - activated._cancelled_activation_steps(); - } - } - }, - - // - // An event handler is like an event listener, but it registered - // by setting an IDL or content attribute like onload or onclick. - // There can only be one of these at a time for any event type. - // This is an internal method for the attribute accessors and - // content attribute handlers that need to register events handlers. - // The type argument is the same as in addEventListener(). - // The handler argument is the same as listeners in addEventListener: - // it can be a function or an object. Pass null to remove any existing - // handler. Handlers are always invoked before any listeners of - // the same type. They are not invoked during the capturing phase - // of event dispatch. - // - _setEventHandler: function _setEventHandler(type, handler) { - if (!this._handlers) this._handlers = Object.create(null); - this._handlers[type] = handler; - }, - - _getEventHandler: function _getEventHandler(type) { - return (this._handlers && this._handlers[type]) || null; - } - -}; diff --git a/.output/server/node_modules/@mixmark-io/domino/lib/FilteredElementList.js b/.output/server/node_modules/@mixmark-io/domino/lib/FilteredElementList.js deleted file mode 100644 index 72e912d..0000000 --- a/.output/server/node_modules/@mixmark-io/domino/lib/FilteredElementList.js +++ /dev/null @@ -1,92 +0,0 @@ -"use strict"; -module.exports = FilteredElementList; - -var Node = require('./Node'); - -// -// This file defines node list implementation that lazily traverses -// the document tree (or a subtree rooted at any element) and includes -// only those elements for which a specified filter function returns true. -// It is used to implement the -// {Document,Element}.getElementsBy{TagName,ClassName}{,NS} methods. -// -// XXX this should inherit from NodeList - -function FilteredElementList(root, filter) { - this.root = root; - this.filter = filter; - this.lastModTime = root.lastModTime; - this.done = false; - this.cache = []; - this.traverse(); -} - -FilteredElementList.prototype = Object.create(Object.prototype, { - length: { get: function() { - this.checkcache(); - if (!this.done) this.traverse(); - return this.cache.length; - } }, - - item: { value: function(n) { - this.checkcache(); - if (!this.done && n >= this.cache.length) { - // This can lead to O(N^2) behavior if we stop when we get to n - // and the caller is iterating through the items in order; so - // be sure to do the full traverse here. - this.traverse(/*n*/); - } - return this.cache[n]; - } }, - - checkcache: { value: function() { - if (this.lastModTime !== this.root.lastModTime) { - // subtree has changed, so invalidate cache - for (var i = this.cache.length-1; i>=0; i--) { - this[i] = undefined; - } - this.cache.length = 0; - this.done = false; - this.lastModTime = this.root.lastModTime; - } - } }, - - // If n is specified, then traverse the tree until we've found the nth - // item (or until we've found all items). If n is not specified, - // traverse until we've found all items. - traverse: { value: function(n) { - // increment n so we can compare to length, and so it is never falsy - if (n !== undefined) n++; - - var elt; - while ((elt = this.next()) !== null) { - this[this.cache.length] = elt; //XXX Use proxy instead - this.cache.push(elt); - if (n && this.cache.length === n) return; - } - - // no next element, so we've found everything - this.done = true; - } }, - - // Return the next element under root that matches filter - next: { value: function() { - var start = (this.cache.length === 0) ? this.root // Start at the root or at - : this.cache[this.cache.length-1]; // the last element we found - - var elt; - if (start.nodeType === Node.DOCUMENT_NODE) - elt = start.documentElement; - else - elt = start.nextElement(this.root); - - while(elt) { - if (this.filter(elt)) { - return elt; - } - - elt = elt.nextElement(this.root); - } - return null; - } }, -}); diff --git a/.output/server/node_modules/@mixmark-io/domino/lib/HTMLParser.js b/.output/server/node_modules/@mixmark-io/domino/lib/HTMLParser.js deleted file mode 100644 index 45d8fc1..0000000 --- a/.output/server/node_modules/@mixmark-io/domino/lib/HTMLParser.js +++ /dev/null @@ -1,7254 +0,0 @@ -"use strict"; -module.exports = HTMLParser; - -var Document = require('./Document'); -var DocumentType = require('./DocumentType'); -var Node = require('./Node'); -var NAMESPACE = require('./utils').NAMESPACE; -var html = require('./htmlelts'); -var impl = html.elements; - -var pushAll = Function.prototype.apply.bind(Array.prototype.push); - -/* - * This file contains an implementation of the HTML parsing algorithm. - * The algorithm and the implementation are complex because HTML - * explicitly defines how the parser should behave for all possible - * valid and invalid inputs. - * - * Usage: - * - * The file defines a single HTMLParser() function, which dom.js exposes - * publicly as document.implementation.mozHTMLParser(). This is a - * factory function, not a constructor. - * - * When you call document.implementation.mozHTMLParser(), it returns - * an object that has parse() and document() methods. To parse HTML text, - * pass the text (in one or more chunks) to the parse() method. When - * you've passed all the text (on the last chunk, or afterward) pass - * true as the second argument to parse() to tell the parser that there - * is no more coming. Call document() to get the document object that - * the parser is parsing into. You can call this at any time, before - * or after calling parse(). - * - * The first argument to mozHTMLParser is the absolute URL of the document. - * - * The second argument is optional and is for internal use only. Pass an - * element as the fragmentContext to do innerHTML parsing for the - * element. To do innerHTML parsing on a document, pass null. Otherwise, - * omit the 2nd argument. See HTMLElement.innerHTML for an example. Note - * that if you pass a context element, the end() method will return an - * unwrapped document instead of a wrapped one. - * - * Implementation details: - * - * This is a long file of almost 7000 lines. It is structured as one - * big function nested within another big function. The outer - * function defines a bunch of constant data, utility functions - * that use that data, and a couple of classes used by the parser. - * The outer function also defines and returns the - * inner function. This inner function is the HTMLParser factory - * function that implements the parser and holds all the parser state - * as local variables. The HTMLParser function is quite big because - * it defines many nested functions that use those local variables. - * - * There are three tightly coupled parser stages: a scanner, a - * tokenizer and a tree builder. In a (possibly misguided) attempt at - * efficiency, the stages are not implemented as separate classes: - * everything shares state and is (mostly) implemented in imperative - * (rather than OO) style. - * - * The stages of the parser work like this: When the client code calls - * the parser's parse() method, the specified string is passed to - * scanChars(). The scanner loops through that string and passes characters - * (sometimes one at a time, sometimes in chunks) to the tokenizer stage. - * The tokenizer groups the characters into tokens: tags, endtags, runs - * of text, comments, doctype declarations, and the end-of-file (EOF) - * token. These tokens are then passed to the tree building stage via - * the insertToken() function. The tree building stage builds up the - * document tree. - * - * The tokenizer stage is a finite state machine. Each state is - * implemented as a function with a name that ends in "_state". The - * initial state is data_state(). The current tokenizer state is stored - * in the variable 'tokenizer'. Most state functions expect a single - * integer argument which represents a single UTF-16 codepoint. Some - * states want more characters and set a lookahead property on - * themselves. The scanChars() function in the scanner checks for this - * lookahead property. If it doesn't exist, then scanChars() just passes - * the next input character to the current tokenizer state function. - * Otherwise, scanChars() looks ahead (a given # of characters, or for a - * matching string, or for a matching regexp) and passes a string of - * characters to the current tokenizer state function. - * - * As a shortcut, certain states of the tokenizer use regular expressions - * to look ahead in the scanner's input buffer for runs of text, simple - * tags and attributes. For well-formed input, these shortcuts skip a - * lot of state transitions and speed things up a bit. - * - * When a tokenizer state function has consumed a complete token, it - * emits that token, by calling insertToken(), or by calling a utility - * function that itself calls insertToken(). These tokens are passed to - * the tree building stage, which is also a state machine. Like the - * tokenizer, the tree building states are implemented as functions, and - * these functions have names that end with _mode (because the HTML spec - * refers to them as insertion modes). The current insertion mode is held - * by the 'parser' variable. Each insertion mode function takes up to 4 - * arguments. The first is a token type, represented by the constants - * TAG, ENDTAG, TEXT, COMMENT, DOCTYPE and EOF. The second argument is - * the value of the token: the text or comment data, or tagname or - * doctype. For tags, the 3rd argument is an array of attributes. For - * DOCTYPES it is the optional public id. For tags, the 4th argument is - * true if the tag is self-closing. For doctypes, the 4th argument is the - * optional system id. - * - * Search for "***" to find the major sub-divisions in the code. - */ - - -/*** - * Data prolog. Lots of constants declared here, including some - * very large objects. They're used throughout the code that follows - */ -// Token types for the tree builder. -var EOF = -1; -var TEXT = 1; -var TAG = 2; -var ENDTAG = 3; -var COMMENT = 4; -var DOCTYPE = 5; - -// A re-usable empty array -var NOATTRS = []; - -// These DTD public ids put the browser in quirks mode -var quirkyPublicIds = /^HTML$|^-\/\/W3O\/\/DTD W3 HTML Strict 3\.0\/\/EN\/\/$|^-\/W3C\/DTD HTML 4\.0 Transitional\/EN$|^\+\/\/Silmaril\/\/dtd html Pro v0r11 19970101\/\/|^-\/\/AdvaSoft Ltd\/\/DTD HTML 3\.0 asWedit \+ extensions\/\/|^-\/\/AS\/\/DTD HTML 3\.0 asWedit \+ extensions\/\/|^-\/\/IETF\/\/DTD HTML 2\.0 Level 1\/\/|^-\/\/IETF\/\/DTD HTML 2\.0 Level 2\/\/|^-\/\/IETF\/\/DTD HTML 2\.0 Strict Level 1\/\/|^-\/\/IETF\/\/DTD HTML 2\.0 Strict Level 2\/\/|^-\/\/IETF\/\/DTD HTML 2\.0 Strict\/\/|^-\/\/IETF\/\/DTD HTML 2\.0\/\/|^-\/\/IETF\/\/DTD HTML 2\.1E\/\/|^-\/\/IETF\/\/DTD HTML 3\.0\/\/|^-\/\/IETF\/\/DTD HTML 3\.2 Final\/\/|^-\/\/IETF\/\/DTD HTML 3\.2\/\/|^-\/\/IETF\/\/DTD HTML 3\/\/|^-\/\/IETF\/\/DTD HTML Level 0\/\/|^-\/\/IETF\/\/DTD HTML Level 1\/\/|^-\/\/IETF\/\/DTD HTML Level 2\/\/|^-\/\/IETF\/\/DTD HTML Level 3\/\/|^-\/\/IETF\/\/DTD HTML Strict Level 0\/\/|^-\/\/IETF\/\/DTD HTML Strict Level 1\/\/|^-\/\/IETF\/\/DTD HTML Strict Level 2\/\/|^-\/\/IETF\/\/DTD HTML Strict Level 3\/\/|^-\/\/IETF\/\/DTD HTML Strict\/\/|^-\/\/IETF\/\/DTD HTML\/\/|^-\/\/Metrius\/\/DTD Metrius Presentational\/\/|^-\/\/Microsoft\/\/DTD Internet Explorer 2\.0 HTML Strict\/\/|^-\/\/Microsoft\/\/DTD Internet Explorer 2\.0 HTML\/\/|^-\/\/Microsoft\/\/DTD Internet Explorer 2\.0 Tables\/\/|^-\/\/Microsoft\/\/DTD Internet Explorer 3\.0 HTML Strict\/\/|^-\/\/Microsoft\/\/DTD Internet Explorer 3\.0 HTML\/\/|^-\/\/Microsoft\/\/DTD Internet Explorer 3\.0 Tables\/\/|^-\/\/Netscape Comm\. Corp\.\/\/DTD HTML\/\/|^-\/\/Netscape Comm\. Corp\.\/\/DTD Strict HTML\/\/|^-\/\/O'Reilly and Associates\/\/DTD HTML 2\.0\/\/|^-\/\/O'Reilly and Associates\/\/DTD HTML Extended 1\.0\/\/|^-\/\/O'Reilly and Associates\/\/DTD HTML Extended Relaxed 1\.0\/\/|^-\/\/SoftQuad Software\/\/DTD HoTMetaL PRO 6\.0::19990601::extensions to HTML 4\.0\/\/|^-\/\/SoftQuad\/\/DTD HoTMetaL PRO 4\.0::19971010::extensions to HTML 4\.0\/\/|^-\/\/Spyglass\/\/DTD HTML 2\.0 Extended\/\/|^-\/\/SQ\/\/DTD HTML 2\.0 HoTMetaL \+ extensions\/\/|^-\/\/Sun Microsystems Corp\.\/\/DTD HotJava HTML\/\/|^-\/\/Sun Microsystems Corp\.\/\/DTD HotJava Strict HTML\/\/|^-\/\/W3C\/\/DTD HTML 3 1995-03-24\/\/|^-\/\/W3C\/\/DTD HTML 3\.2 Draft\/\/|^-\/\/W3C\/\/DTD HTML 3\.2 Final\/\/|^-\/\/W3C\/\/DTD HTML 3\.2\/\/|^-\/\/W3C\/\/DTD HTML 3\.2S Draft\/\/|^-\/\/W3C\/\/DTD HTML 4\.0 Frameset\/\/|^-\/\/W3C\/\/DTD HTML 4\.0 Transitional\/\/|^-\/\/W3C\/\/DTD HTML Experimental 19960712\/\/|^-\/\/W3C\/\/DTD HTML Experimental 970421\/\/|^-\/\/W3C\/\/DTD W3 HTML\/\/|^-\/\/W3O\/\/DTD W3 HTML 3\.0\/\/|^-\/\/WebTechs\/\/DTD Mozilla HTML 2\.0\/\/|^-\/\/WebTechs\/\/DTD Mozilla HTML\/\//i; - -var quirkySystemId = "http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd"; - -var conditionallyQuirkyPublicIds = /^-\/\/W3C\/\/DTD HTML 4\.01 Frameset\/\/|^-\/\/W3C\/\/DTD HTML 4\.01 Transitional\/\//i; - -// These DTD public ids put the browser in limited quirks mode -var limitedQuirkyPublicIds = /^-\/\/W3C\/\/DTD XHTML 1\.0 Frameset\/\/|^-\/\/W3C\/\/DTD XHTML 1\.0 Transitional\/\//i; - - -// Element sets below. See the isA() function for a way to test -// whether an element is a member of a set -var specialSet = Object.create(null); -specialSet[NAMESPACE.HTML] = { - __proto__: null, - "address":true, "applet":true, "area":true, "article":true, - "aside":true, "base":true, "basefont":true, "bgsound":true, - "blockquote":true, "body":true, "br":true, "button":true, - "caption":true, "center":true, "col":true, "colgroup":true, - "dd":true, "details":true, "dir":true, - "div":true, "dl":true, "dt":true, "embed":true, - "fieldset":true, "figcaption":true, "figure":true, "footer":true, - "form":true, "frame":true, "frameset":true, "h1":true, - "h2":true, "h3":true, "h4":true, "h5":true, - "h6":true, "head":true, "header":true, "hgroup":true, - "hr":true, "html":true, "iframe":true, "img":true, - "input":true, "li":true, "link":true, - "listing":true, "main":true, "marquee":true, "menu":true, "meta":true, - "nav":true, "noembed":true, "noframes":true, "noscript":true, - "object":true, "ol":true, "p":true, "param":true, - "plaintext":true, "pre":true, "script":true, "section":true, - "select":true, "source":true, "style":true, "summary":true, "table":true, - "tbody":true, "td":true, "template":true, "textarea":true, "tfoot":true, - "th":true, "thead":true, "title":true, "tr":true, "track":true, - // Note that "xmp" was removed from the "special" set in the latest - // spec, apparently by accident; see - // https://github.com/whatwg/html/pull/1919 - "ul":true, "wbr":true, "xmp":true -}; -specialSet[NAMESPACE.SVG] = { - __proto__: null, - "foreignObject": true, "desc": true, "title": true -}; -specialSet[NAMESPACE.MATHML] = { - __proto__: null, - "mi":true, "mo":true, "mn":true, "ms":true, - "mtext":true, "annotation-xml":true -}; - -// The set of address, div, and p HTML tags -var addressdivpSet = Object.create(null); -addressdivpSet[NAMESPACE.HTML] = { - __proto__: null, - "address":true, "div":true, "p":true -}; - -var dddtSet = Object.create(null); -dddtSet[NAMESPACE.HTML] = { - __proto__: null, - "dd":true, "dt":true -}; - -var tablesectionrowSet = Object.create(null); -tablesectionrowSet[NAMESPACE.HTML] = { - __proto__: null, - "table":true, "thead":true, "tbody":true, "tfoot":true, "tr":true -}; - -var impliedEndTagsSet = Object.create(null); -impliedEndTagsSet[NAMESPACE.HTML] = { - __proto__: null, - "dd": true, "dt": true, "li": true, "menuitem": true, "optgroup": true, - "option": true, "p": true, "rb": true, "rp": true, "rt": true, "rtc": true -}; - -var thoroughImpliedEndTagsSet = Object.create(null); -thoroughImpliedEndTagsSet[NAMESPACE.HTML] = { - __proto__: null, - "caption": true, "colgroup": true, "dd": true, "dt": true, "li": true, - "optgroup": true, "option": true, "p": true, "rb": true, "rp": true, - "rt": true, "rtc": true, "tbody": true, "td": true, "tfoot": true, - "th": true, "thead": true, "tr": true -}; - -var tableContextSet = Object.create(null); -tableContextSet[NAMESPACE.HTML] = { - __proto__: null, - "table": true, "template": true, "html": true -}; - -var tableBodyContextSet = Object.create(null); -tableBodyContextSet[NAMESPACE.HTML] = { - __proto__: null, - "tbody": true, "tfoot": true, "thead": true, "template": true, "html": true -}; - -var tableRowContextSet = Object.create(null); -tableRowContextSet[NAMESPACE.HTML] = { - __proto__: null, - "tr": true, "template": true, "html": true -}; - -// See http://www.w3.org/TR/html5/forms.html#form-associated-element -var formassociatedSet = Object.create(null); -formassociatedSet[NAMESPACE.HTML] = { - __proto__: null, - "button": true, "fieldset": true, "input": true, "keygen": true, - "object": true, "output": true, "select": true, "textarea": true, - "img": true -}; - -var inScopeSet = Object.create(null); -inScopeSet[NAMESPACE.HTML]= { - __proto__: null, - "applet":true, "caption":true, "html":true, "table":true, - "td":true, "th":true, "marquee":true, "object":true, - "template":true -}; -inScopeSet[NAMESPACE.MATHML] = { - __proto__: null, - "mi":true, "mo":true, "mn":true, "ms":true, - "mtext":true, "annotation-xml":true -}; -inScopeSet[NAMESPACE.SVG] = { - __proto__: null, - "foreignObject":true, "desc":true, "title":true -}; - -var inListItemScopeSet = Object.create(inScopeSet); -inListItemScopeSet[NAMESPACE.HTML] = - Object.create(inScopeSet[NAMESPACE.HTML]); -inListItemScopeSet[NAMESPACE.HTML].ol = true; -inListItemScopeSet[NAMESPACE.HTML].ul = true; - -var inButtonScopeSet = Object.create(inScopeSet); -inButtonScopeSet[NAMESPACE.HTML] = - Object.create(inScopeSet[NAMESPACE.HTML]); -inButtonScopeSet[NAMESPACE.HTML].button = true; - -var inTableScopeSet = Object.create(null); -inTableScopeSet[NAMESPACE.HTML] = { - __proto__: null, - "html":true, "table":true, "template":true -}; - -// The set of elements for select scope is the everything *except* these -var invertedSelectScopeSet = Object.create(null); -invertedSelectScopeSet[NAMESPACE.HTML] = { - __proto__: null, - "optgroup":true, "option":true -}; - -var mathmlTextIntegrationPointSet = Object.create(null); -mathmlTextIntegrationPointSet[NAMESPACE.MATHML] = { - __proto__: null, - mi: true, - mo: true, - mn: true, - ms: true, - mtext: true -}; - -var htmlIntegrationPointSet = Object.create(null); -htmlIntegrationPointSet[NAMESPACE.SVG] = { - __proto__: null, - foreignObject: true, - desc: true, - title: true -}; - -var foreignAttributes = { - __proto__: null, - "xlink:actuate": NAMESPACE.XLINK, "xlink:arcrole": NAMESPACE.XLINK, - "xlink:href": NAMESPACE.XLINK, "xlink:role": NAMESPACE.XLINK, - "xlink:show": NAMESPACE.XLINK, "xlink:title": NAMESPACE.XLINK, - "xlink:type": NAMESPACE.XLINK, "xml:base": NAMESPACE.XML, - "xml:lang": NAMESPACE.XML, "xml:space": NAMESPACE.XML, - "xmlns": NAMESPACE.XMLNS, "xmlns:xlink": NAMESPACE.XMLNS -}; - - -// Lowercase to mixed case mapping for SVG attributes and tagnames -var svgAttrAdjustments = { - __proto__: null, - attributename: "attributeName", attributetype: "attributeType", - basefrequency: "baseFrequency", baseprofile: "baseProfile", - calcmode: "calcMode", clippathunits: "clipPathUnits", - diffuseconstant: "diffuseConstant", - edgemode: "edgeMode", - filterunits: "filterUnits", - glyphref: "glyphRef", gradienttransform: "gradientTransform", - gradientunits: "gradientUnits", kernelmatrix: "kernelMatrix", - kernelunitlength: "kernelUnitLength", keypoints: "keyPoints", - keysplines: "keySplines", keytimes: "keyTimes", - lengthadjust: "lengthAdjust", limitingconeangle: "limitingConeAngle", - markerheight: "markerHeight", markerunits: "markerUnits", - markerwidth: "markerWidth", maskcontentunits: "maskContentUnits", - maskunits: "maskUnits", numoctaves: "numOctaves", - pathlength: "pathLength", patterncontentunits: "patternContentUnits", - patterntransform: "patternTransform", patternunits: "patternUnits", - pointsatx: "pointsAtX", pointsaty: "pointsAtY", - pointsatz: "pointsAtZ", preservealpha: "preserveAlpha", - preserveaspectratio: "preserveAspectRatio", - primitiveunits: "primitiveUnits", refx: "refX", - refy: "refY", repeatcount: "repeatCount", - repeatdur: "repeatDur", requiredextensions: "requiredExtensions", - requiredfeatures: "requiredFeatures", - specularconstant: "specularConstant", - specularexponent: "specularExponent", spreadmethod: "spreadMethod", - startoffset: "startOffset", stddeviation: "stdDeviation", - stitchtiles: "stitchTiles", surfacescale: "surfaceScale", - systemlanguage: "systemLanguage", tablevalues: "tableValues", - targetx: "targetX", targety: "targetY", - textlength: "textLength", viewbox: "viewBox", - viewtarget: "viewTarget", xchannelselector: "xChannelSelector", - ychannelselector: "yChannelSelector", zoomandpan: "zoomAndPan" -}; - -var svgTagNameAdjustments = { - __proto__: null, - altglyph: "altGlyph", altglyphdef: "altGlyphDef", - altglyphitem: "altGlyphItem", animatecolor: "animateColor", - animatemotion: "animateMotion", animatetransform: "animateTransform", - clippath: "clipPath", feblend: "feBlend", - fecolormatrix: "feColorMatrix", - fecomponenttransfer: "feComponentTransfer", fecomposite: "feComposite", - feconvolvematrix: "feConvolveMatrix", - fediffuselighting: "feDiffuseLighting", - fedisplacementmap: "feDisplacementMap", - fedistantlight: "feDistantLight", feflood: "feFlood", - fefunca: "feFuncA", fefuncb: "feFuncB", - fefuncg: "feFuncG", fefuncr: "feFuncR", - fegaussianblur: "feGaussianBlur", feimage: "feImage", - femerge: "feMerge", femergenode: "feMergeNode", - femorphology: "feMorphology", feoffset: "feOffset", - fepointlight: "fePointLight", fespecularlighting: "feSpecularLighting", - fespotlight: "feSpotLight", fetile: "feTile", - feturbulence: "feTurbulence", foreignobject: "foreignObject", - glyphref: "glyphRef", lineargradient: "linearGradient", - radialgradient: "radialGradient", textpath: "textPath" -}; - - -// Data for parsing numeric and named character references -// These next 3 objects are direct translations of tables -// in the HTML spec into JavaScript object format -var numericCharRefReplacements = { - __proto__: null, - 0x00:0xFFFD, 0x80:0x20AC, 0x82:0x201A, 0x83:0x0192, 0x84:0x201E, - 0x85:0x2026, 0x86:0x2020, 0x87:0x2021, 0x88:0x02C6, 0x89:0x2030, - 0x8A:0x0160, 0x8B:0x2039, 0x8C:0x0152, 0x8E:0x017D, 0x91:0x2018, - 0x92:0x2019, 0x93:0x201C, 0x94:0x201D, 0x95:0x2022, 0x96:0x2013, - 0x97:0x2014, 0x98:0x02DC, 0x99:0x2122, 0x9A:0x0161, 0x9B:0x203A, - 0x9C:0x0153, 0x9E:0x017E, 0x9F:0x0178 -}; - -/* - * This table is generated with test/tools/update-entities.js - */ -var namedCharRefs = { - __proto__: null, - "AElig":0xc6, "AElig;":0xc6, - "AMP":0x26, "AMP;":0x26, - "Aacute":0xc1, "Aacute;":0xc1, - "Abreve;":0x102, "Acirc":0xc2, - "Acirc;":0xc2, "Acy;":0x410, - "Afr;":[0xd835,0xdd04], "Agrave":0xc0, - "Agrave;":0xc0, "Alpha;":0x391, - "Amacr;":0x100, "And;":0x2a53, - "Aogon;":0x104, "Aopf;":[0xd835,0xdd38], - "ApplyFunction;":0x2061, "Aring":0xc5, - "Aring;":0xc5, "Ascr;":[0xd835,0xdc9c], - "Assign;":0x2254, "Atilde":0xc3, - "Atilde;":0xc3, "Auml":0xc4, - "Auml;":0xc4, "Backslash;":0x2216, - "Barv;":0x2ae7, "Barwed;":0x2306, - "Bcy;":0x411, "Because;":0x2235, - "Bernoullis;":0x212c, "Beta;":0x392, - "Bfr;":[0xd835,0xdd05], "Bopf;":[0xd835,0xdd39], - "Breve;":0x2d8, "Bscr;":0x212c, - "Bumpeq;":0x224e, "CHcy;":0x427, - "COPY":0xa9, "COPY;":0xa9, - "Cacute;":0x106, "Cap;":0x22d2, - "CapitalDifferentialD;":0x2145, "Cayleys;":0x212d, - "Ccaron;":0x10c, "Ccedil":0xc7, - "Ccedil;":0xc7, "Ccirc;":0x108, - "Cconint;":0x2230, "Cdot;":0x10a, - "Cedilla;":0xb8, "CenterDot;":0xb7, - "Cfr;":0x212d, "Chi;":0x3a7, - "CircleDot;":0x2299, "CircleMinus;":0x2296, - "CirclePlus;":0x2295, "CircleTimes;":0x2297, - "ClockwiseContourIntegral;":0x2232, "CloseCurlyDoubleQuote;":0x201d, - "CloseCurlyQuote;":0x2019, "Colon;":0x2237, - "Colone;":0x2a74, "Congruent;":0x2261, - "Conint;":0x222f, "ContourIntegral;":0x222e, - "Copf;":0x2102, "Coproduct;":0x2210, - "CounterClockwiseContourIntegral;":0x2233, "Cross;":0x2a2f, - "Cscr;":[0xd835,0xdc9e], "Cup;":0x22d3, - "CupCap;":0x224d, "DD;":0x2145, - "DDotrahd;":0x2911, "DJcy;":0x402, - "DScy;":0x405, "DZcy;":0x40f, - "Dagger;":0x2021, "Darr;":0x21a1, - "Dashv;":0x2ae4, "Dcaron;":0x10e, - "Dcy;":0x414, "Del;":0x2207, - "Delta;":0x394, "Dfr;":[0xd835,0xdd07], - "DiacriticalAcute;":0xb4, "DiacriticalDot;":0x2d9, - "DiacriticalDoubleAcute;":0x2dd, "DiacriticalGrave;":0x60, - "DiacriticalTilde;":0x2dc, "Diamond;":0x22c4, - "DifferentialD;":0x2146, "Dopf;":[0xd835,0xdd3b], - "Dot;":0xa8, "DotDot;":0x20dc, - "DotEqual;":0x2250, "DoubleContourIntegral;":0x222f, - "DoubleDot;":0xa8, "DoubleDownArrow;":0x21d3, - "DoubleLeftArrow;":0x21d0, "DoubleLeftRightArrow;":0x21d4, - "DoubleLeftTee;":0x2ae4, "DoubleLongLeftArrow;":0x27f8, - "DoubleLongLeftRightArrow;":0x27fa, "DoubleLongRightArrow;":0x27f9, - "DoubleRightArrow;":0x21d2, "DoubleRightTee;":0x22a8, - "DoubleUpArrow;":0x21d1, "DoubleUpDownArrow;":0x21d5, - "DoubleVerticalBar;":0x2225, "DownArrow;":0x2193, - "DownArrowBar;":0x2913, "DownArrowUpArrow;":0x21f5, - "DownBreve;":0x311, "DownLeftRightVector;":0x2950, - "DownLeftTeeVector;":0x295e, "DownLeftVector;":0x21bd, - "DownLeftVectorBar;":0x2956, "DownRightTeeVector;":0x295f, - "DownRightVector;":0x21c1, "DownRightVectorBar;":0x2957, - "DownTee;":0x22a4, "DownTeeArrow;":0x21a7, - "Downarrow;":0x21d3, "Dscr;":[0xd835,0xdc9f], - "Dstrok;":0x110, "ENG;":0x14a, - "ETH":0xd0, "ETH;":0xd0, - "Eacute":0xc9, "Eacute;":0xc9, - "Ecaron;":0x11a, "Ecirc":0xca, - "Ecirc;":0xca, "Ecy;":0x42d, - "Edot;":0x116, "Efr;":[0xd835,0xdd08], - "Egrave":0xc8, "Egrave;":0xc8, - "Element;":0x2208, "Emacr;":0x112, - "EmptySmallSquare;":0x25fb, "EmptyVerySmallSquare;":0x25ab, - "Eogon;":0x118, "Eopf;":[0xd835,0xdd3c], - "Epsilon;":0x395, "Equal;":0x2a75, - "EqualTilde;":0x2242, "Equilibrium;":0x21cc, - "Escr;":0x2130, "Esim;":0x2a73, - "Eta;":0x397, "Euml":0xcb, - "Euml;":0xcb, "Exists;":0x2203, - "ExponentialE;":0x2147, "Fcy;":0x424, - "Ffr;":[0xd835,0xdd09], "FilledSmallSquare;":0x25fc, - "FilledVerySmallSquare;":0x25aa, "Fopf;":[0xd835,0xdd3d], - "ForAll;":0x2200, "Fouriertrf;":0x2131, - "Fscr;":0x2131, "GJcy;":0x403, - "GT":0x3e, "GT;":0x3e, - "Gamma;":0x393, "Gammad;":0x3dc, - "Gbreve;":0x11e, "Gcedil;":0x122, - "Gcirc;":0x11c, "Gcy;":0x413, - "Gdot;":0x120, "Gfr;":[0xd835,0xdd0a], - "Gg;":0x22d9, "Gopf;":[0xd835,0xdd3e], - "GreaterEqual;":0x2265, "GreaterEqualLess;":0x22db, - "GreaterFullEqual;":0x2267, "GreaterGreater;":0x2aa2, - "GreaterLess;":0x2277, "GreaterSlantEqual;":0x2a7e, - "GreaterTilde;":0x2273, "Gscr;":[0xd835,0xdca2], - "Gt;":0x226b, "HARDcy;":0x42a, - "Hacek;":0x2c7, "Hat;":0x5e, - "Hcirc;":0x124, "Hfr;":0x210c, - "HilbertSpace;":0x210b, "Hopf;":0x210d, - "HorizontalLine;":0x2500, "Hscr;":0x210b, - "Hstrok;":0x126, "HumpDownHump;":0x224e, - "HumpEqual;":0x224f, "IEcy;":0x415, - "IJlig;":0x132, "IOcy;":0x401, - "Iacute":0xcd, "Iacute;":0xcd, - "Icirc":0xce, "Icirc;":0xce, - "Icy;":0x418, "Idot;":0x130, - "Ifr;":0x2111, "Igrave":0xcc, - "Igrave;":0xcc, "Im;":0x2111, - "Imacr;":0x12a, "ImaginaryI;":0x2148, - "Implies;":0x21d2, "Int;":0x222c, - "Integral;":0x222b, "Intersection;":0x22c2, - "InvisibleComma;":0x2063, "InvisibleTimes;":0x2062, - "Iogon;":0x12e, "Iopf;":[0xd835,0xdd40], - "Iota;":0x399, "Iscr;":0x2110, - "Itilde;":0x128, "Iukcy;":0x406, - "Iuml":0xcf, "Iuml;":0xcf, - "Jcirc;":0x134, "Jcy;":0x419, - "Jfr;":[0xd835,0xdd0d], "Jopf;":[0xd835,0xdd41], - "Jscr;":[0xd835,0xdca5], "Jsercy;":0x408, - "Jukcy;":0x404, "KHcy;":0x425, - "KJcy;":0x40c, "Kappa;":0x39a, - "Kcedil;":0x136, "Kcy;":0x41a, - "Kfr;":[0xd835,0xdd0e], "Kopf;":[0xd835,0xdd42], - "Kscr;":[0xd835,0xdca6], "LJcy;":0x409, - "LT":0x3c, "LT;":0x3c, - "Lacute;":0x139, "Lambda;":0x39b, - "Lang;":0x27ea, "Laplacetrf;":0x2112, - "Larr;":0x219e, "Lcaron;":0x13d, - "Lcedil;":0x13b, "Lcy;":0x41b, - "LeftAngleBracket;":0x27e8, "LeftArrow;":0x2190, - "LeftArrowBar;":0x21e4, "LeftArrowRightArrow;":0x21c6, - "LeftCeiling;":0x2308, "LeftDoubleBracket;":0x27e6, - "LeftDownTeeVector;":0x2961, "LeftDownVector;":0x21c3, - "LeftDownVectorBar;":0x2959, "LeftFloor;":0x230a, - "LeftRightArrow;":0x2194, "LeftRightVector;":0x294e, - "LeftTee;":0x22a3, "LeftTeeArrow;":0x21a4, - "LeftTeeVector;":0x295a, "LeftTriangle;":0x22b2, - "LeftTriangleBar;":0x29cf, "LeftTriangleEqual;":0x22b4, - "LeftUpDownVector;":0x2951, "LeftUpTeeVector;":0x2960, - "LeftUpVector;":0x21bf, "LeftUpVectorBar;":0x2958, - "LeftVector;":0x21bc, "LeftVectorBar;":0x2952, - "Leftarrow;":0x21d0, "Leftrightarrow;":0x21d4, - "LessEqualGreater;":0x22da, "LessFullEqual;":0x2266, - "LessGreater;":0x2276, "LessLess;":0x2aa1, - "LessSlantEqual;":0x2a7d, "LessTilde;":0x2272, - "Lfr;":[0xd835,0xdd0f], "Ll;":0x22d8, - "Lleftarrow;":0x21da, "Lmidot;":0x13f, - "LongLeftArrow;":0x27f5, "LongLeftRightArrow;":0x27f7, - "LongRightArrow;":0x27f6, "Longleftarrow;":0x27f8, - "Longleftrightarrow;":0x27fa, "Longrightarrow;":0x27f9, - "Lopf;":[0xd835,0xdd43], "LowerLeftArrow;":0x2199, - "LowerRightArrow;":0x2198, "Lscr;":0x2112, - "Lsh;":0x21b0, "Lstrok;":0x141, - "Lt;":0x226a, "Map;":0x2905, - "Mcy;":0x41c, "MediumSpace;":0x205f, - "Mellintrf;":0x2133, "Mfr;":[0xd835,0xdd10], - "MinusPlus;":0x2213, "Mopf;":[0xd835,0xdd44], - "Mscr;":0x2133, "Mu;":0x39c, - "NJcy;":0x40a, "Nacute;":0x143, - "Ncaron;":0x147, "Ncedil;":0x145, - "Ncy;":0x41d, "NegativeMediumSpace;":0x200b, - "NegativeThickSpace;":0x200b, "NegativeThinSpace;":0x200b, - "NegativeVeryThinSpace;":0x200b, "NestedGreaterGreater;":0x226b, - "NestedLessLess;":0x226a, "NewLine;":0xa, - "Nfr;":[0xd835,0xdd11], "NoBreak;":0x2060, - "NonBreakingSpace;":0xa0, "Nopf;":0x2115, - "Not;":0x2aec, "NotCongruent;":0x2262, - "NotCupCap;":0x226d, "NotDoubleVerticalBar;":0x2226, - "NotElement;":0x2209, "NotEqual;":0x2260, - "NotEqualTilde;":[0x2242,0x338], "NotExists;":0x2204, - "NotGreater;":0x226f, "NotGreaterEqual;":0x2271, - "NotGreaterFullEqual;":[0x2267,0x338], "NotGreaterGreater;":[0x226b,0x338], - "NotGreaterLess;":0x2279, "NotGreaterSlantEqual;":[0x2a7e,0x338], - "NotGreaterTilde;":0x2275, "NotHumpDownHump;":[0x224e,0x338], - "NotHumpEqual;":[0x224f,0x338], "NotLeftTriangle;":0x22ea, - "NotLeftTriangleBar;":[0x29cf,0x338], "NotLeftTriangleEqual;":0x22ec, - "NotLess;":0x226e, "NotLessEqual;":0x2270, - "NotLessGreater;":0x2278, "NotLessLess;":[0x226a,0x338], - "NotLessSlantEqual;":[0x2a7d,0x338], "NotLessTilde;":0x2274, - "NotNestedGreaterGreater;":[0x2aa2,0x338], "NotNestedLessLess;":[0x2aa1,0x338], - "NotPrecedes;":0x2280, "NotPrecedesEqual;":[0x2aaf,0x338], - "NotPrecedesSlantEqual;":0x22e0, "NotReverseElement;":0x220c, - "NotRightTriangle;":0x22eb, "NotRightTriangleBar;":[0x29d0,0x338], - "NotRightTriangleEqual;":0x22ed, "NotSquareSubset;":[0x228f,0x338], - "NotSquareSubsetEqual;":0x22e2, "NotSquareSuperset;":[0x2290,0x338], - "NotSquareSupersetEqual;":0x22e3, "NotSubset;":[0x2282,0x20d2], - "NotSubsetEqual;":0x2288, "NotSucceeds;":0x2281, - "NotSucceedsEqual;":[0x2ab0,0x338], "NotSucceedsSlantEqual;":0x22e1, - "NotSucceedsTilde;":[0x227f,0x338], "NotSuperset;":[0x2283,0x20d2], - "NotSupersetEqual;":0x2289, "NotTilde;":0x2241, - "NotTildeEqual;":0x2244, "NotTildeFullEqual;":0x2247, - "NotTildeTilde;":0x2249, "NotVerticalBar;":0x2224, - "Nscr;":[0xd835,0xdca9], "Ntilde":0xd1, - "Ntilde;":0xd1, "Nu;":0x39d, - "OElig;":0x152, "Oacute":0xd3, - "Oacute;":0xd3, "Ocirc":0xd4, - "Ocirc;":0xd4, "Ocy;":0x41e, - "Odblac;":0x150, "Ofr;":[0xd835,0xdd12], - "Ograve":0xd2, "Ograve;":0xd2, - "Omacr;":0x14c, "Omega;":0x3a9, - "Omicron;":0x39f, "Oopf;":[0xd835,0xdd46], - "OpenCurlyDoubleQuote;":0x201c, "OpenCurlyQuote;":0x2018, - "Or;":0x2a54, "Oscr;":[0xd835,0xdcaa], - "Oslash":0xd8, "Oslash;":0xd8, - "Otilde":0xd5, "Otilde;":0xd5, - "Otimes;":0x2a37, "Ouml":0xd6, - "Ouml;":0xd6, "OverBar;":0x203e, - "OverBrace;":0x23de, "OverBracket;":0x23b4, - "OverParenthesis;":0x23dc, "PartialD;":0x2202, - "Pcy;":0x41f, "Pfr;":[0xd835,0xdd13], - "Phi;":0x3a6, "Pi;":0x3a0, - "PlusMinus;":0xb1, "Poincareplane;":0x210c, - "Popf;":0x2119, "Pr;":0x2abb, - "Precedes;":0x227a, "PrecedesEqual;":0x2aaf, - "PrecedesSlantEqual;":0x227c, "PrecedesTilde;":0x227e, - "Prime;":0x2033, "Product;":0x220f, - "Proportion;":0x2237, "Proportional;":0x221d, - "Pscr;":[0xd835,0xdcab], "Psi;":0x3a8, - "QUOT":0x22, "QUOT;":0x22, - "Qfr;":[0xd835,0xdd14], "Qopf;":0x211a, - "Qscr;":[0xd835,0xdcac], "RBarr;":0x2910, - "REG":0xae, "REG;":0xae, - "Racute;":0x154, "Rang;":0x27eb, - "Rarr;":0x21a0, "Rarrtl;":0x2916, - "Rcaron;":0x158, "Rcedil;":0x156, - "Rcy;":0x420, "Re;":0x211c, - "ReverseElement;":0x220b, "ReverseEquilibrium;":0x21cb, - "ReverseUpEquilibrium;":0x296f, "Rfr;":0x211c, - "Rho;":0x3a1, "RightAngleBracket;":0x27e9, - "RightArrow;":0x2192, "RightArrowBar;":0x21e5, - "RightArrowLeftArrow;":0x21c4, "RightCeiling;":0x2309, - "RightDoubleBracket;":0x27e7, "RightDownTeeVector;":0x295d, - "RightDownVector;":0x21c2, "RightDownVectorBar;":0x2955, - "RightFloor;":0x230b, "RightTee;":0x22a2, - "RightTeeArrow;":0x21a6, "RightTeeVector;":0x295b, - "RightTriangle;":0x22b3, "RightTriangleBar;":0x29d0, - "RightTriangleEqual;":0x22b5, "RightUpDownVector;":0x294f, - "RightUpTeeVector;":0x295c, "RightUpVector;":0x21be, - "RightUpVectorBar;":0x2954, "RightVector;":0x21c0, - "RightVectorBar;":0x2953, "Rightarrow;":0x21d2, - "Ropf;":0x211d, "RoundImplies;":0x2970, - "Rrightarrow;":0x21db, "Rscr;":0x211b, - "Rsh;":0x21b1, "RuleDelayed;":0x29f4, - "SHCHcy;":0x429, "SHcy;":0x428, - "SOFTcy;":0x42c, "Sacute;":0x15a, - "Sc;":0x2abc, "Scaron;":0x160, - "Scedil;":0x15e, "Scirc;":0x15c, - "Scy;":0x421, "Sfr;":[0xd835,0xdd16], - "ShortDownArrow;":0x2193, "ShortLeftArrow;":0x2190, - "ShortRightArrow;":0x2192, "ShortUpArrow;":0x2191, - "Sigma;":0x3a3, "SmallCircle;":0x2218, - "Sopf;":[0xd835,0xdd4a], "Sqrt;":0x221a, - "Square;":0x25a1, "SquareIntersection;":0x2293, - "SquareSubset;":0x228f, "SquareSubsetEqual;":0x2291, - "SquareSuperset;":0x2290, "SquareSupersetEqual;":0x2292, - "SquareUnion;":0x2294, "Sscr;":[0xd835,0xdcae], - "Star;":0x22c6, "Sub;":0x22d0, - "Subset;":0x22d0, "SubsetEqual;":0x2286, - "Succeeds;":0x227b, "SucceedsEqual;":0x2ab0, - "SucceedsSlantEqual;":0x227d, "SucceedsTilde;":0x227f, - "SuchThat;":0x220b, "Sum;":0x2211, - "Sup;":0x22d1, "Superset;":0x2283, - "SupersetEqual;":0x2287, "Supset;":0x22d1, - "THORN":0xde, "THORN;":0xde, - "TRADE;":0x2122, "TSHcy;":0x40b, - "TScy;":0x426, "Tab;":0x9, - "Tau;":0x3a4, "Tcaron;":0x164, - "Tcedil;":0x162, "Tcy;":0x422, - "Tfr;":[0xd835,0xdd17], "Therefore;":0x2234, - "Theta;":0x398, "ThickSpace;":[0x205f,0x200a], - "ThinSpace;":0x2009, "Tilde;":0x223c, - "TildeEqual;":0x2243, "TildeFullEqual;":0x2245, - "TildeTilde;":0x2248, "Topf;":[0xd835,0xdd4b], - "TripleDot;":0x20db, "Tscr;":[0xd835,0xdcaf], - "Tstrok;":0x166, "Uacute":0xda, - "Uacute;":0xda, "Uarr;":0x219f, - "Uarrocir;":0x2949, "Ubrcy;":0x40e, - "Ubreve;":0x16c, "Ucirc":0xdb, - "Ucirc;":0xdb, "Ucy;":0x423, - "Udblac;":0x170, "Ufr;":[0xd835,0xdd18], - "Ugrave":0xd9, "Ugrave;":0xd9, - "Umacr;":0x16a, "UnderBar;":0x5f, - "UnderBrace;":0x23df, "UnderBracket;":0x23b5, - "UnderParenthesis;":0x23dd, "Union;":0x22c3, - "UnionPlus;":0x228e, "Uogon;":0x172, - "Uopf;":[0xd835,0xdd4c], "UpArrow;":0x2191, - "UpArrowBar;":0x2912, "UpArrowDownArrow;":0x21c5, - "UpDownArrow;":0x2195, "UpEquilibrium;":0x296e, - "UpTee;":0x22a5, "UpTeeArrow;":0x21a5, - "Uparrow;":0x21d1, "Updownarrow;":0x21d5, - "UpperLeftArrow;":0x2196, "UpperRightArrow;":0x2197, - "Upsi;":0x3d2, "Upsilon;":0x3a5, - "Uring;":0x16e, "Uscr;":[0xd835,0xdcb0], - "Utilde;":0x168, "Uuml":0xdc, - "Uuml;":0xdc, "VDash;":0x22ab, - "Vbar;":0x2aeb, "Vcy;":0x412, - "Vdash;":0x22a9, "Vdashl;":0x2ae6, - "Vee;":0x22c1, "Verbar;":0x2016, - "Vert;":0x2016, "VerticalBar;":0x2223, - "VerticalLine;":0x7c, "VerticalSeparator;":0x2758, - "VerticalTilde;":0x2240, "VeryThinSpace;":0x200a, - "Vfr;":[0xd835,0xdd19], "Vopf;":[0xd835,0xdd4d], - "Vscr;":[0xd835,0xdcb1], "Vvdash;":0x22aa, - "Wcirc;":0x174, "Wedge;":0x22c0, - "Wfr;":[0xd835,0xdd1a], "Wopf;":[0xd835,0xdd4e], - "Wscr;":[0xd835,0xdcb2], "Xfr;":[0xd835,0xdd1b], - "Xi;":0x39e, "Xopf;":[0xd835,0xdd4f], - "Xscr;":[0xd835,0xdcb3], "YAcy;":0x42f, - "YIcy;":0x407, "YUcy;":0x42e, - "Yacute":0xdd, "Yacute;":0xdd, - "Ycirc;":0x176, "Ycy;":0x42b, - "Yfr;":[0xd835,0xdd1c], "Yopf;":[0xd835,0xdd50], - "Yscr;":[0xd835,0xdcb4], "Yuml;":0x178, - "ZHcy;":0x416, "Zacute;":0x179, - "Zcaron;":0x17d, "Zcy;":0x417, - "Zdot;":0x17b, "ZeroWidthSpace;":0x200b, - "Zeta;":0x396, "Zfr;":0x2128, - "Zopf;":0x2124, "Zscr;":[0xd835,0xdcb5], - "aacute":0xe1, "aacute;":0xe1, - "abreve;":0x103, "ac;":0x223e, - "acE;":[0x223e,0x333], "acd;":0x223f, - "acirc":0xe2, "acirc;":0xe2, - "acute":0xb4, "acute;":0xb4, - "acy;":0x430, "aelig":0xe6, - "aelig;":0xe6, "af;":0x2061, - "afr;":[0xd835,0xdd1e], "agrave":0xe0, - "agrave;":0xe0, "alefsym;":0x2135, - "aleph;":0x2135, "alpha;":0x3b1, - "amacr;":0x101, "amalg;":0x2a3f, - "amp":0x26, "amp;":0x26, - "and;":0x2227, "andand;":0x2a55, - "andd;":0x2a5c, "andslope;":0x2a58, - "andv;":0x2a5a, "ang;":0x2220, - "ange;":0x29a4, "angle;":0x2220, - "angmsd;":0x2221, "angmsdaa;":0x29a8, - "angmsdab;":0x29a9, "angmsdac;":0x29aa, - "angmsdad;":0x29ab, "angmsdae;":0x29ac, - "angmsdaf;":0x29ad, "angmsdag;":0x29ae, - "angmsdah;":0x29af, "angrt;":0x221f, - "angrtvb;":0x22be, "angrtvbd;":0x299d, - "angsph;":0x2222, "angst;":0xc5, - "angzarr;":0x237c, "aogon;":0x105, - "aopf;":[0xd835,0xdd52], "ap;":0x2248, - "apE;":0x2a70, "apacir;":0x2a6f, - "ape;":0x224a, "apid;":0x224b, - "apos;":0x27, "approx;":0x2248, - "approxeq;":0x224a, "aring":0xe5, - "aring;":0xe5, "ascr;":[0xd835,0xdcb6], - "ast;":0x2a, "asymp;":0x2248, - "asympeq;":0x224d, "atilde":0xe3, - "atilde;":0xe3, "auml":0xe4, - "auml;":0xe4, "awconint;":0x2233, - "awint;":0x2a11, "bNot;":0x2aed, - "backcong;":0x224c, "backepsilon;":0x3f6, - "backprime;":0x2035, "backsim;":0x223d, - "backsimeq;":0x22cd, "barvee;":0x22bd, - "barwed;":0x2305, "barwedge;":0x2305, - "bbrk;":0x23b5, "bbrktbrk;":0x23b6, - "bcong;":0x224c, "bcy;":0x431, - "bdquo;":0x201e, "becaus;":0x2235, - "because;":0x2235, "bemptyv;":0x29b0, - "bepsi;":0x3f6, "bernou;":0x212c, - "beta;":0x3b2, "beth;":0x2136, - "between;":0x226c, "bfr;":[0xd835,0xdd1f], - "bigcap;":0x22c2, "bigcirc;":0x25ef, - "bigcup;":0x22c3, "bigodot;":0x2a00, - "bigoplus;":0x2a01, "bigotimes;":0x2a02, - "bigsqcup;":0x2a06, "bigstar;":0x2605, - "bigtriangledown;":0x25bd, "bigtriangleup;":0x25b3, - "biguplus;":0x2a04, "bigvee;":0x22c1, - "bigwedge;":0x22c0, "bkarow;":0x290d, - "blacklozenge;":0x29eb, "blacksquare;":0x25aa, - "blacktriangle;":0x25b4, "blacktriangledown;":0x25be, - "blacktriangleleft;":0x25c2, "blacktriangleright;":0x25b8, - "blank;":0x2423, "blk12;":0x2592, - "blk14;":0x2591, "blk34;":0x2593, - "block;":0x2588, "bne;":[0x3d,0x20e5], - "bnequiv;":[0x2261,0x20e5], "bnot;":0x2310, - "bopf;":[0xd835,0xdd53], "bot;":0x22a5, - "bottom;":0x22a5, "bowtie;":0x22c8, - "boxDL;":0x2557, "boxDR;":0x2554, - "boxDl;":0x2556, "boxDr;":0x2553, - "boxH;":0x2550, "boxHD;":0x2566, - "boxHU;":0x2569, "boxHd;":0x2564, - "boxHu;":0x2567, "boxUL;":0x255d, - "boxUR;":0x255a, "boxUl;":0x255c, - "boxUr;":0x2559, "boxV;":0x2551, - "boxVH;":0x256c, "boxVL;":0x2563, - "boxVR;":0x2560, "boxVh;":0x256b, - "boxVl;":0x2562, "boxVr;":0x255f, - "boxbox;":0x29c9, "boxdL;":0x2555, - "boxdR;":0x2552, "boxdl;":0x2510, - "boxdr;":0x250c, "boxh;":0x2500, - "boxhD;":0x2565, "boxhU;":0x2568, - "boxhd;":0x252c, "boxhu;":0x2534, - "boxminus;":0x229f, "boxplus;":0x229e, - "boxtimes;":0x22a0, "boxuL;":0x255b, - "boxuR;":0x2558, "boxul;":0x2518, - "boxur;":0x2514, "boxv;":0x2502, - "boxvH;":0x256a, "boxvL;":0x2561, - "boxvR;":0x255e, "boxvh;":0x253c, - "boxvl;":0x2524, "boxvr;":0x251c, - "bprime;":0x2035, "breve;":0x2d8, - "brvbar":0xa6, "brvbar;":0xa6, - "bscr;":[0xd835,0xdcb7], "bsemi;":0x204f, - "bsim;":0x223d, "bsime;":0x22cd, - "bsol;":0x5c, "bsolb;":0x29c5, - "bsolhsub;":0x27c8, "bull;":0x2022, - "bullet;":0x2022, "bump;":0x224e, - "bumpE;":0x2aae, "bumpe;":0x224f, - "bumpeq;":0x224f, "cacute;":0x107, - "cap;":0x2229, "capand;":0x2a44, - "capbrcup;":0x2a49, "capcap;":0x2a4b, - "capcup;":0x2a47, "capdot;":0x2a40, - "caps;":[0x2229,0xfe00], "caret;":0x2041, - "caron;":0x2c7, "ccaps;":0x2a4d, - "ccaron;":0x10d, "ccedil":0xe7, - "ccedil;":0xe7, "ccirc;":0x109, - "ccups;":0x2a4c, "ccupssm;":0x2a50, - "cdot;":0x10b, "cedil":0xb8, - "cedil;":0xb8, "cemptyv;":0x29b2, - "cent":0xa2, "cent;":0xa2, - "centerdot;":0xb7, "cfr;":[0xd835,0xdd20], - "chcy;":0x447, "check;":0x2713, - "checkmark;":0x2713, "chi;":0x3c7, - "cir;":0x25cb, "cirE;":0x29c3, - "circ;":0x2c6, "circeq;":0x2257, - "circlearrowleft;":0x21ba, "circlearrowright;":0x21bb, - "circledR;":0xae, "circledS;":0x24c8, - "circledast;":0x229b, "circledcirc;":0x229a, - "circleddash;":0x229d, "cire;":0x2257, - "cirfnint;":0x2a10, "cirmid;":0x2aef, - "cirscir;":0x29c2, "clubs;":0x2663, - "clubsuit;":0x2663, "colon;":0x3a, - "colone;":0x2254, "coloneq;":0x2254, - "comma;":0x2c, "commat;":0x40, - "comp;":0x2201, "compfn;":0x2218, - "complement;":0x2201, "complexes;":0x2102, - "cong;":0x2245, "congdot;":0x2a6d, - "conint;":0x222e, "copf;":[0xd835,0xdd54], - "coprod;":0x2210, "copy":0xa9, - "copy;":0xa9, "copysr;":0x2117, - "crarr;":0x21b5, "cross;":0x2717, - "cscr;":[0xd835,0xdcb8], "csub;":0x2acf, - "csube;":0x2ad1, "csup;":0x2ad0, - "csupe;":0x2ad2, "ctdot;":0x22ef, - "cudarrl;":0x2938, "cudarrr;":0x2935, - "cuepr;":0x22de, "cuesc;":0x22df, - "cularr;":0x21b6, "cularrp;":0x293d, - "cup;":0x222a, "cupbrcap;":0x2a48, - "cupcap;":0x2a46, "cupcup;":0x2a4a, - "cupdot;":0x228d, "cupor;":0x2a45, - "cups;":[0x222a,0xfe00], "curarr;":0x21b7, - "curarrm;":0x293c, "curlyeqprec;":0x22de, - "curlyeqsucc;":0x22df, "curlyvee;":0x22ce, - "curlywedge;":0x22cf, "curren":0xa4, - "curren;":0xa4, "curvearrowleft;":0x21b6, - "curvearrowright;":0x21b7, "cuvee;":0x22ce, - "cuwed;":0x22cf, "cwconint;":0x2232, - "cwint;":0x2231, "cylcty;":0x232d, - "dArr;":0x21d3, "dHar;":0x2965, - "dagger;":0x2020, "daleth;":0x2138, - "darr;":0x2193, "dash;":0x2010, - "dashv;":0x22a3, "dbkarow;":0x290f, - "dblac;":0x2dd, "dcaron;":0x10f, - "dcy;":0x434, "dd;":0x2146, - "ddagger;":0x2021, "ddarr;":0x21ca, - "ddotseq;":0x2a77, "deg":0xb0, - "deg;":0xb0, "delta;":0x3b4, - "demptyv;":0x29b1, "dfisht;":0x297f, - "dfr;":[0xd835,0xdd21], "dharl;":0x21c3, - "dharr;":0x21c2, "diam;":0x22c4, - "diamond;":0x22c4, "diamondsuit;":0x2666, - "diams;":0x2666, "die;":0xa8, - "digamma;":0x3dd, "disin;":0x22f2, - "div;":0xf7, "divide":0xf7, - "divide;":0xf7, "divideontimes;":0x22c7, - "divonx;":0x22c7, "djcy;":0x452, - "dlcorn;":0x231e, "dlcrop;":0x230d, - "dollar;":0x24, "dopf;":[0xd835,0xdd55], - "dot;":0x2d9, "doteq;":0x2250, - "doteqdot;":0x2251, "dotminus;":0x2238, - "dotplus;":0x2214, "dotsquare;":0x22a1, - "doublebarwedge;":0x2306, "downarrow;":0x2193, - "downdownarrows;":0x21ca, "downharpoonleft;":0x21c3, - "downharpoonright;":0x21c2, "drbkarow;":0x2910, - "drcorn;":0x231f, "drcrop;":0x230c, - "dscr;":[0xd835,0xdcb9], "dscy;":0x455, - "dsol;":0x29f6, "dstrok;":0x111, - "dtdot;":0x22f1, "dtri;":0x25bf, - "dtrif;":0x25be, "duarr;":0x21f5, - "duhar;":0x296f, "dwangle;":0x29a6, - "dzcy;":0x45f, "dzigrarr;":0x27ff, - "eDDot;":0x2a77, "eDot;":0x2251, - "eacute":0xe9, "eacute;":0xe9, - "easter;":0x2a6e, "ecaron;":0x11b, - "ecir;":0x2256, "ecirc":0xea, - "ecirc;":0xea, "ecolon;":0x2255, - "ecy;":0x44d, "edot;":0x117, - "ee;":0x2147, "efDot;":0x2252, - "efr;":[0xd835,0xdd22], "eg;":0x2a9a, - "egrave":0xe8, "egrave;":0xe8, - "egs;":0x2a96, "egsdot;":0x2a98, - "el;":0x2a99, "elinters;":0x23e7, - "ell;":0x2113, "els;":0x2a95, - "elsdot;":0x2a97, "emacr;":0x113, - "empty;":0x2205, "emptyset;":0x2205, - "emptyv;":0x2205, "emsp13;":0x2004, - "emsp14;":0x2005, "emsp;":0x2003, - "eng;":0x14b, "ensp;":0x2002, - "eogon;":0x119, "eopf;":[0xd835,0xdd56], - "epar;":0x22d5, "eparsl;":0x29e3, - "eplus;":0x2a71, "epsi;":0x3b5, - "epsilon;":0x3b5, "epsiv;":0x3f5, - "eqcirc;":0x2256, "eqcolon;":0x2255, - "eqsim;":0x2242, "eqslantgtr;":0x2a96, - "eqslantless;":0x2a95, "equals;":0x3d, - "equest;":0x225f, "equiv;":0x2261, - "equivDD;":0x2a78, "eqvparsl;":0x29e5, - "erDot;":0x2253, "erarr;":0x2971, - "escr;":0x212f, "esdot;":0x2250, - "esim;":0x2242, "eta;":0x3b7, - "eth":0xf0, "eth;":0xf0, - "euml":0xeb, "euml;":0xeb, - "euro;":0x20ac, "excl;":0x21, - "exist;":0x2203, "expectation;":0x2130, - "exponentiale;":0x2147, "fallingdotseq;":0x2252, - "fcy;":0x444, "female;":0x2640, - "ffilig;":0xfb03, "fflig;":0xfb00, - "ffllig;":0xfb04, "ffr;":[0xd835,0xdd23], - "filig;":0xfb01, "fjlig;":[0x66,0x6a], - "flat;":0x266d, "fllig;":0xfb02, - "fltns;":0x25b1, "fnof;":0x192, - "fopf;":[0xd835,0xdd57], "forall;":0x2200, - "fork;":0x22d4, "forkv;":0x2ad9, - "fpartint;":0x2a0d, "frac12":0xbd, - "frac12;":0xbd, "frac13;":0x2153, - "frac14":0xbc, "frac14;":0xbc, - "frac15;":0x2155, "frac16;":0x2159, - "frac18;":0x215b, "frac23;":0x2154, - "frac25;":0x2156, "frac34":0xbe, - "frac34;":0xbe, "frac35;":0x2157, - "frac38;":0x215c, "frac45;":0x2158, - "frac56;":0x215a, "frac58;":0x215d, - "frac78;":0x215e, "frasl;":0x2044, - "frown;":0x2322, "fscr;":[0xd835,0xdcbb], - "gE;":0x2267, "gEl;":0x2a8c, - "gacute;":0x1f5, "gamma;":0x3b3, - "gammad;":0x3dd, "gap;":0x2a86, - "gbreve;":0x11f, "gcirc;":0x11d, - "gcy;":0x433, "gdot;":0x121, - "ge;":0x2265, "gel;":0x22db, - "geq;":0x2265, "geqq;":0x2267, - "geqslant;":0x2a7e, "ges;":0x2a7e, - "gescc;":0x2aa9, "gesdot;":0x2a80, - "gesdoto;":0x2a82, "gesdotol;":0x2a84, - "gesl;":[0x22db,0xfe00], "gesles;":0x2a94, - "gfr;":[0xd835,0xdd24], "gg;":0x226b, - "ggg;":0x22d9, "gimel;":0x2137, - "gjcy;":0x453, "gl;":0x2277, - "glE;":0x2a92, "gla;":0x2aa5, - "glj;":0x2aa4, "gnE;":0x2269, - "gnap;":0x2a8a, "gnapprox;":0x2a8a, - "gne;":0x2a88, "gneq;":0x2a88, - "gneqq;":0x2269, "gnsim;":0x22e7, - "gopf;":[0xd835,0xdd58], "grave;":0x60, - "gscr;":0x210a, "gsim;":0x2273, - "gsime;":0x2a8e, "gsiml;":0x2a90, - "gt":0x3e, "gt;":0x3e, - "gtcc;":0x2aa7, "gtcir;":0x2a7a, - "gtdot;":0x22d7, "gtlPar;":0x2995, - "gtquest;":0x2a7c, "gtrapprox;":0x2a86, - "gtrarr;":0x2978, "gtrdot;":0x22d7, - "gtreqless;":0x22db, "gtreqqless;":0x2a8c, - "gtrless;":0x2277, "gtrsim;":0x2273, - "gvertneqq;":[0x2269,0xfe00], "gvnE;":[0x2269,0xfe00], - "hArr;":0x21d4, "hairsp;":0x200a, - "half;":0xbd, "hamilt;":0x210b, - "hardcy;":0x44a, "harr;":0x2194, - "harrcir;":0x2948, "harrw;":0x21ad, - "hbar;":0x210f, "hcirc;":0x125, - "hearts;":0x2665, "heartsuit;":0x2665, - "hellip;":0x2026, "hercon;":0x22b9, - "hfr;":[0xd835,0xdd25], "hksearow;":0x2925, - "hkswarow;":0x2926, "hoarr;":0x21ff, - "homtht;":0x223b, "hookleftarrow;":0x21a9, - "hookrightarrow;":0x21aa, "hopf;":[0xd835,0xdd59], - "horbar;":0x2015, "hscr;":[0xd835,0xdcbd], - "hslash;":0x210f, "hstrok;":0x127, - "hybull;":0x2043, "hyphen;":0x2010, - "iacute":0xed, "iacute;":0xed, - "ic;":0x2063, "icirc":0xee, - "icirc;":0xee, "icy;":0x438, - "iecy;":0x435, "iexcl":0xa1, - "iexcl;":0xa1, "iff;":0x21d4, - "ifr;":[0xd835,0xdd26], "igrave":0xec, - "igrave;":0xec, "ii;":0x2148, - "iiiint;":0x2a0c, "iiint;":0x222d, - "iinfin;":0x29dc, "iiota;":0x2129, - "ijlig;":0x133, "imacr;":0x12b, - "image;":0x2111, "imagline;":0x2110, - "imagpart;":0x2111, "imath;":0x131, - "imof;":0x22b7, "imped;":0x1b5, - "in;":0x2208, "incare;":0x2105, - "infin;":0x221e, "infintie;":0x29dd, - "inodot;":0x131, "int;":0x222b, - "intcal;":0x22ba, "integers;":0x2124, - "intercal;":0x22ba, "intlarhk;":0x2a17, - "intprod;":0x2a3c, "iocy;":0x451, - "iogon;":0x12f, "iopf;":[0xd835,0xdd5a], - "iota;":0x3b9, "iprod;":0x2a3c, - "iquest":0xbf, "iquest;":0xbf, - "iscr;":[0xd835,0xdcbe], "isin;":0x2208, - "isinE;":0x22f9, "isindot;":0x22f5, - "isins;":0x22f4, "isinsv;":0x22f3, - "isinv;":0x2208, "it;":0x2062, - "itilde;":0x129, "iukcy;":0x456, - "iuml":0xef, "iuml;":0xef, - "jcirc;":0x135, "jcy;":0x439, - "jfr;":[0xd835,0xdd27], "jmath;":0x237, - "jopf;":[0xd835,0xdd5b], "jscr;":[0xd835,0xdcbf], - "jsercy;":0x458, "jukcy;":0x454, - "kappa;":0x3ba, "kappav;":0x3f0, - "kcedil;":0x137, "kcy;":0x43a, - "kfr;":[0xd835,0xdd28], "kgreen;":0x138, - "khcy;":0x445, "kjcy;":0x45c, - "kopf;":[0xd835,0xdd5c], "kscr;":[0xd835,0xdcc0], - "lAarr;":0x21da, "lArr;":0x21d0, - "lAtail;":0x291b, "lBarr;":0x290e, - "lE;":0x2266, "lEg;":0x2a8b, - "lHar;":0x2962, "lacute;":0x13a, - "laemptyv;":0x29b4, "lagran;":0x2112, - "lambda;":0x3bb, "lang;":0x27e8, - "langd;":0x2991, "langle;":0x27e8, - "lap;":0x2a85, "laquo":0xab, - "laquo;":0xab, "larr;":0x2190, - "larrb;":0x21e4, "larrbfs;":0x291f, - "larrfs;":0x291d, "larrhk;":0x21a9, - "larrlp;":0x21ab, "larrpl;":0x2939, - "larrsim;":0x2973, "larrtl;":0x21a2, - "lat;":0x2aab, "latail;":0x2919, - "late;":0x2aad, "lates;":[0x2aad,0xfe00], - "lbarr;":0x290c, "lbbrk;":0x2772, - "lbrace;":0x7b, "lbrack;":0x5b, - "lbrke;":0x298b, "lbrksld;":0x298f, - "lbrkslu;":0x298d, "lcaron;":0x13e, - "lcedil;":0x13c, "lceil;":0x2308, - "lcub;":0x7b, "lcy;":0x43b, - "ldca;":0x2936, "ldquo;":0x201c, - "ldquor;":0x201e, "ldrdhar;":0x2967, - "ldrushar;":0x294b, "ldsh;":0x21b2, - "le;":0x2264, "leftarrow;":0x2190, - "leftarrowtail;":0x21a2, "leftharpoondown;":0x21bd, - "leftharpoonup;":0x21bc, "leftleftarrows;":0x21c7, - "leftrightarrow;":0x2194, "leftrightarrows;":0x21c6, - "leftrightharpoons;":0x21cb, "leftrightsquigarrow;":0x21ad, - "leftthreetimes;":0x22cb, "leg;":0x22da, - "leq;":0x2264, "leqq;":0x2266, - "leqslant;":0x2a7d, "les;":0x2a7d, - "lescc;":0x2aa8, "lesdot;":0x2a7f, - "lesdoto;":0x2a81, "lesdotor;":0x2a83, - "lesg;":[0x22da,0xfe00], "lesges;":0x2a93, - "lessapprox;":0x2a85, "lessdot;":0x22d6, - "lesseqgtr;":0x22da, "lesseqqgtr;":0x2a8b, - "lessgtr;":0x2276, "lesssim;":0x2272, - "lfisht;":0x297c, "lfloor;":0x230a, - "lfr;":[0xd835,0xdd29], "lg;":0x2276, - "lgE;":0x2a91, "lhard;":0x21bd, - "lharu;":0x21bc, "lharul;":0x296a, - "lhblk;":0x2584, "ljcy;":0x459, - "ll;":0x226a, "llarr;":0x21c7, - "llcorner;":0x231e, "llhard;":0x296b, - "lltri;":0x25fa, "lmidot;":0x140, - "lmoust;":0x23b0, "lmoustache;":0x23b0, - "lnE;":0x2268, "lnap;":0x2a89, - "lnapprox;":0x2a89, "lne;":0x2a87, - "lneq;":0x2a87, "lneqq;":0x2268, - "lnsim;":0x22e6, "loang;":0x27ec, - "loarr;":0x21fd, "lobrk;":0x27e6, - "longleftarrow;":0x27f5, "longleftrightarrow;":0x27f7, - "longmapsto;":0x27fc, "longrightarrow;":0x27f6, - "looparrowleft;":0x21ab, "looparrowright;":0x21ac, - "lopar;":0x2985, "lopf;":[0xd835,0xdd5d], - "loplus;":0x2a2d, "lotimes;":0x2a34, - "lowast;":0x2217, "lowbar;":0x5f, - "loz;":0x25ca, "lozenge;":0x25ca, - "lozf;":0x29eb, "lpar;":0x28, - "lparlt;":0x2993, "lrarr;":0x21c6, - "lrcorner;":0x231f, "lrhar;":0x21cb, - "lrhard;":0x296d, "lrm;":0x200e, - "lrtri;":0x22bf, "lsaquo;":0x2039, - "lscr;":[0xd835,0xdcc1], "lsh;":0x21b0, - "lsim;":0x2272, "lsime;":0x2a8d, - "lsimg;":0x2a8f, "lsqb;":0x5b, - "lsquo;":0x2018, "lsquor;":0x201a, - "lstrok;":0x142, "lt":0x3c, - "lt;":0x3c, "ltcc;":0x2aa6, - "ltcir;":0x2a79, "ltdot;":0x22d6, - "lthree;":0x22cb, "ltimes;":0x22c9, - "ltlarr;":0x2976, "ltquest;":0x2a7b, - "ltrPar;":0x2996, "ltri;":0x25c3, - "ltrie;":0x22b4, "ltrif;":0x25c2, - "lurdshar;":0x294a, "luruhar;":0x2966, - "lvertneqq;":[0x2268,0xfe00], "lvnE;":[0x2268,0xfe00], - "mDDot;":0x223a, "macr":0xaf, - "macr;":0xaf, "male;":0x2642, - "malt;":0x2720, "maltese;":0x2720, - "map;":0x21a6, "mapsto;":0x21a6, - "mapstodown;":0x21a7, "mapstoleft;":0x21a4, - "mapstoup;":0x21a5, "marker;":0x25ae, - "mcomma;":0x2a29, "mcy;":0x43c, - "mdash;":0x2014, "measuredangle;":0x2221, - "mfr;":[0xd835,0xdd2a], "mho;":0x2127, - "micro":0xb5, "micro;":0xb5, - "mid;":0x2223, "midast;":0x2a, - "midcir;":0x2af0, "middot":0xb7, - "middot;":0xb7, "minus;":0x2212, - "minusb;":0x229f, "minusd;":0x2238, - "minusdu;":0x2a2a, "mlcp;":0x2adb, - "mldr;":0x2026, "mnplus;":0x2213, - "models;":0x22a7, "mopf;":[0xd835,0xdd5e], - "mp;":0x2213, "mscr;":[0xd835,0xdcc2], - "mstpos;":0x223e, "mu;":0x3bc, - "multimap;":0x22b8, "mumap;":0x22b8, - "nGg;":[0x22d9,0x338], "nGt;":[0x226b,0x20d2], - "nGtv;":[0x226b,0x338], "nLeftarrow;":0x21cd, - "nLeftrightarrow;":0x21ce, "nLl;":[0x22d8,0x338], - "nLt;":[0x226a,0x20d2], "nLtv;":[0x226a,0x338], - "nRightarrow;":0x21cf, "nVDash;":0x22af, - "nVdash;":0x22ae, "nabla;":0x2207, - "nacute;":0x144, "nang;":[0x2220,0x20d2], - "nap;":0x2249, "napE;":[0x2a70,0x338], - "napid;":[0x224b,0x338], "napos;":0x149, - "napprox;":0x2249, "natur;":0x266e, - "natural;":0x266e, "naturals;":0x2115, - "nbsp":0xa0, "nbsp;":0xa0, - "nbump;":[0x224e,0x338], "nbumpe;":[0x224f,0x338], - "ncap;":0x2a43, "ncaron;":0x148, - "ncedil;":0x146, "ncong;":0x2247, - "ncongdot;":[0x2a6d,0x338], "ncup;":0x2a42, - "ncy;":0x43d, "ndash;":0x2013, - "ne;":0x2260, "neArr;":0x21d7, - "nearhk;":0x2924, "nearr;":0x2197, - "nearrow;":0x2197, "nedot;":[0x2250,0x338], - "nequiv;":0x2262, "nesear;":0x2928, - "nesim;":[0x2242,0x338], "nexist;":0x2204, - "nexists;":0x2204, "nfr;":[0xd835,0xdd2b], - "ngE;":[0x2267,0x338], "nge;":0x2271, - "ngeq;":0x2271, "ngeqq;":[0x2267,0x338], - "ngeqslant;":[0x2a7e,0x338], "nges;":[0x2a7e,0x338], - "ngsim;":0x2275, "ngt;":0x226f, - "ngtr;":0x226f, "nhArr;":0x21ce, - "nharr;":0x21ae, "nhpar;":0x2af2, - "ni;":0x220b, "nis;":0x22fc, - "nisd;":0x22fa, "niv;":0x220b, - "njcy;":0x45a, "nlArr;":0x21cd, - "nlE;":[0x2266,0x338], "nlarr;":0x219a, - "nldr;":0x2025, "nle;":0x2270, - "nleftarrow;":0x219a, "nleftrightarrow;":0x21ae, - "nleq;":0x2270, "nleqq;":[0x2266,0x338], - "nleqslant;":[0x2a7d,0x338], "nles;":[0x2a7d,0x338], - "nless;":0x226e, "nlsim;":0x2274, - "nlt;":0x226e, "nltri;":0x22ea, - "nltrie;":0x22ec, "nmid;":0x2224, - "nopf;":[0xd835,0xdd5f], "not":0xac, - "not;":0xac, "notin;":0x2209, - "notinE;":[0x22f9,0x338], "notindot;":[0x22f5,0x338], - "notinva;":0x2209, "notinvb;":0x22f7, - "notinvc;":0x22f6, "notni;":0x220c, - "notniva;":0x220c, "notnivb;":0x22fe, - "notnivc;":0x22fd, "npar;":0x2226, - "nparallel;":0x2226, "nparsl;":[0x2afd,0x20e5], - "npart;":[0x2202,0x338], "npolint;":0x2a14, - "npr;":0x2280, "nprcue;":0x22e0, - "npre;":[0x2aaf,0x338], "nprec;":0x2280, - "npreceq;":[0x2aaf,0x338], "nrArr;":0x21cf, - "nrarr;":0x219b, "nrarrc;":[0x2933,0x338], - "nrarrw;":[0x219d,0x338], "nrightarrow;":0x219b, - "nrtri;":0x22eb, "nrtrie;":0x22ed, - "nsc;":0x2281, "nsccue;":0x22e1, - "nsce;":[0x2ab0,0x338], "nscr;":[0xd835,0xdcc3], - "nshortmid;":0x2224, "nshortparallel;":0x2226, - "nsim;":0x2241, "nsime;":0x2244, - "nsimeq;":0x2244, "nsmid;":0x2224, - "nspar;":0x2226, "nsqsube;":0x22e2, - "nsqsupe;":0x22e3, "nsub;":0x2284, - "nsubE;":[0x2ac5,0x338], "nsube;":0x2288, - "nsubset;":[0x2282,0x20d2], "nsubseteq;":0x2288, - "nsubseteqq;":[0x2ac5,0x338], "nsucc;":0x2281, - "nsucceq;":[0x2ab0,0x338], "nsup;":0x2285, - "nsupE;":[0x2ac6,0x338], "nsupe;":0x2289, - "nsupset;":[0x2283,0x20d2], "nsupseteq;":0x2289, - "nsupseteqq;":[0x2ac6,0x338], "ntgl;":0x2279, - "ntilde":0xf1, "ntilde;":0xf1, - "ntlg;":0x2278, "ntriangleleft;":0x22ea, - "ntrianglelefteq;":0x22ec, "ntriangleright;":0x22eb, - "ntrianglerighteq;":0x22ed, "nu;":0x3bd, - "num;":0x23, "numero;":0x2116, - "numsp;":0x2007, "nvDash;":0x22ad, - "nvHarr;":0x2904, "nvap;":[0x224d,0x20d2], - "nvdash;":0x22ac, "nvge;":[0x2265,0x20d2], - "nvgt;":[0x3e,0x20d2], "nvinfin;":0x29de, - "nvlArr;":0x2902, "nvle;":[0x2264,0x20d2], - "nvlt;":[0x3c,0x20d2], "nvltrie;":[0x22b4,0x20d2], - "nvrArr;":0x2903, "nvrtrie;":[0x22b5,0x20d2], - "nvsim;":[0x223c,0x20d2], "nwArr;":0x21d6, - "nwarhk;":0x2923, "nwarr;":0x2196, - "nwarrow;":0x2196, "nwnear;":0x2927, - "oS;":0x24c8, "oacute":0xf3, - "oacute;":0xf3, "oast;":0x229b, - "ocir;":0x229a, "ocirc":0xf4, - "ocirc;":0xf4, "ocy;":0x43e, - "odash;":0x229d, "odblac;":0x151, - "odiv;":0x2a38, "odot;":0x2299, - "odsold;":0x29bc, "oelig;":0x153, - "ofcir;":0x29bf, "ofr;":[0xd835,0xdd2c], - "ogon;":0x2db, "ograve":0xf2, - "ograve;":0xf2, "ogt;":0x29c1, - "ohbar;":0x29b5, "ohm;":0x3a9, - "oint;":0x222e, "olarr;":0x21ba, - "olcir;":0x29be, "olcross;":0x29bb, - "oline;":0x203e, "olt;":0x29c0, - "omacr;":0x14d, "omega;":0x3c9, - "omicron;":0x3bf, "omid;":0x29b6, - "ominus;":0x2296, "oopf;":[0xd835,0xdd60], - "opar;":0x29b7, "operp;":0x29b9, - "oplus;":0x2295, "or;":0x2228, - "orarr;":0x21bb, "ord;":0x2a5d, - "order;":0x2134, "orderof;":0x2134, - "ordf":0xaa, "ordf;":0xaa, - "ordm":0xba, "ordm;":0xba, - "origof;":0x22b6, "oror;":0x2a56, - "orslope;":0x2a57, "orv;":0x2a5b, - "oscr;":0x2134, "oslash":0xf8, - "oslash;":0xf8, "osol;":0x2298, - "otilde":0xf5, "otilde;":0xf5, - "otimes;":0x2297, "otimesas;":0x2a36, - "ouml":0xf6, "ouml;":0xf6, - "ovbar;":0x233d, "par;":0x2225, - "para":0xb6, "para;":0xb6, - "parallel;":0x2225, "parsim;":0x2af3, - "parsl;":0x2afd, "part;":0x2202, - "pcy;":0x43f, "percnt;":0x25, - "period;":0x2e, "permil;":0x2030, - "perp;":0x22a5, "pertenk;":0x2031, - "pfr;":[0xd835,0xdd2d], "phi;":0x3c6, - "phiv;":0x3d5, "phmmat;":0x2133, - "phone;":0x260e, "pi;":0x3c0, - "pitchfork;":0x22d4, "piv;":0x3d6, - "planck;":0x210f, "planckh;":0x210e, - "plankv;":0x210f, "plus;":0x2b, - "plusacir;":0x2a23, "plusb;":0x229e, - "pluscir;":0x2a22, "plusdo;":0x2214, - "plusdu;":0x2a25, "pluse;":0x2a72, - "plusmn":0xb1, "plusmn;":0xb1, - "plussim;":0x2a26, "plustwo;":0x2a27, - "pm;":0xb1, "pointint;":0x2a15, - "popf;":[0xd835,0xdd61], "pound":0xa3, - "pound;":0xa3, "pr;":0x227a, - "prE;":0x2ab3, "prap;":0x2ab7, - "prcue;":0x227c, "pre;":0x2aaf, - "prec;":0x227a, "precapprox;":0x2ab7, - "preccurlyeq;":0x227c, "preceq;":0x2aaf, - "precnapprox;":0x2ab9, "precneqq;":0x2ab5, - "precnsim;":0x22e8, "precsim;":0x227e, - "prime;":0x2032, "primes;":0x2119, - "prnE;":0x2ab5, "prnap;":0x2ab9, - "prnsim;":0x22e8, "prod;":0x220f, - "profalar;":0x232e, "profline;":0x2312, - "profsurf;":0x2313, "prop;":0x221d, - "propto;":0x221d, "prsim;":0x227e, - "prurel;":0x22b0, "pscr;":[0xd835,0xdcc5], - "psi;":0x3c8, "puncsp;":0x2008, - "qfr;":[0xd835,0xdd2e], "qint;":0x2a0c, - "qopf;":[0xd835,0xdd62], "qprime;":0x2057, - "qscr;":[0xd835,0xdcc6], "quaternions;":0x210d, - "quatint;":0x2a16, "quest;":0x3f, - "questeq;":0x225f, "quot":0x22, - "quot;":0x22, "rAarr;":0x21db, - "rArr;":0x21d2, "rAtail;":0x291c, - "rBarr;":0x290f, "rHar;":0x2964, - "race;":[0x223d,0x331], "racute;":0x155, - "radic;":0x221a, "raemptyv;":0x29b3, - "rang;":0x27e9, "rangd;":0x2992, - "range;":0x29a5, "rangle;":0x27e9, - "raquo":0xbb, "raquo;":0xbb, - "rarr;":0x2192, "rarrap;":0x2975, - "rarrb;":0x21e5, "rarrbfs;":0x2920, - "rarrc;":0x2933, "rarrfs;":0x291e, - "rarrhk;":0x21aa, "rarrlp;":0x21ac, - "rarrpl;":0x2945, "rarrsim;":0x2974, - "rarrtl;":0x21a3, "rarrw;":0x219d, - "ratail;":0x291a, "ratio;":0x2236, - "rationals;":0x211a, "rbarr;":0x290d, - "rbbrk;":0x2773, "rbrace;":0x7d, - "rbrack;":0x5d, "rbrke;":0x298c, - "rbrksld;":0x298e, "rbrkslu;":0x2990, - "rcaron;":0x159, "rcedil;":0x157, - "rceil;":0x2309, "rcub;":0x7d, - "rcy;":0x440, "rdca;":0x2937, - "rdldhar;":0x2969, "rdquo;":0x201d, - "rdquor;":0x201d, "rdsh;":0x21b3, - "real;":0x211c, "realine;":0x211b, - "realpart;":0x211c, "reals;":0x211d, - "rect;":0x25ad, "reg":0xae, - "reg;":0xae, "rfisht;":0x297d, - "rfloor;":0x230b, "rfr;":[0xd835,0xdd2f], - "rhard;":0x21c1, "rharu;":0x21c0, - "rharul;":0x296c, "rho;":0x3c1, - "rhov;":0x3f1, "rightarrow;":0x2192, - "rightarrowtail;":0x21a3, "rightharpoondown;":0x21c1, - "rightharpoonup;":0x21c0, "rightleftarrows;":0x21c4, - "rightleftharpoons;":0x21cc, "rightrightarrows;":0x21c9, - "rightsquigarrow;":0x219d, "rightthreetimes;":0x22cc, - "ring;":0x2da, "risingdotseq;":0x2253, - "rlarr;":0x21c4, "rlhar;":0x21cc, - "rlm;":0x200f, "rmoust;":0x23b1, - "rmoustache;":0x23b1, "rnmid;":0x2aee, - "roang;":0x27ed, "roarr;":0x21fe, - "robrk;":0x27e7, "ropar;":0x2986, - "ropf;":[0xd835,0xdd63], "roplus;":0x2a2e, - "rotimes;":0x2a35, "rpar;":0x29, - "rpargt;":0x2994, "rppolint;":0x2a12, - "rrarr;":0x21c9, "rsaquo;":0x203a, - "rscr;":[0xd835,0xdcc7], "rsh;":0x21b1, - "rsqb;":0x5d, "rsquo;":0x2019, - "rsquor;":0x2019, "rthree;":0x22cc, - "rtimes;":0x22ca, "rtri;":0x25b9, - "rtrie;":0x22b5, "rtrif;":0x25b8, - "rtriltri;":0x29ce, "ruluhar;":0x2968, - "rx;":0x211e, "sacute;":0x15b, - "sbquo;":0x201a, "sc;":0x227b, - "scE;":0x2ab4, "scap;":0x2ab8, - "scaron;":0x161, "sccue;":0x227d, - "sce;":0x2ab0, "scedil;":0x15f, - "scirc;":0x15d, "scnE;":0x2ab6, - "scnap;":0x2aba, "scnsim;":0x22e9, - "scpolint;":0x2a13, "scsim;":0x227f, - "scy;":0x441, "sdot;":0x22c5, - "sdotb;":0x22a1, "sdote;":0x2a66, - "seArr;":0x21d8, "searhk;":0x2925, - "searr;":0x2198, "searrow;":0x2198, - "sect":0xa7, "sect;":0xa7, - "semi;":0x3b, "seswar;":0x2929, - "setminus;":0x2216, "setmn;":0x2216, - "sext;":0x2736, "sfr;":[0xd835,0xdd30], - "sfrown;":0x2322, "sharp;":0x266f, - "shchcy;":0x449, "shcy;":0x448, - "shortmid;":0x2223, "shortparallel;":0x2225, - "shy":0xad, "shy;":0xad, - "sigma;":0x3c3, "sigmaf;":0x3c2, - "sigmav;":0x3c2, "sim;":0x223c, - "simdot;":0x2a6a, "sime;":0x2243, - "simeq;":0x2243, "simg;":0x2a9e, - "simgE;":0x2aa0, "siml;":0x2a9d, - "simlE;":0x2a9f, "simne;":0x2246, - "simplus;":0x2a24, "simrarr;":0x2972, - "slarr;":0x2190, "smallsetminus;":0x2216, - "smashp;":0x2a33, "smeparsl;":0x29e4, - "smid;":0x2223, "smile;":0x2323, - "smt;":0x2aaa, "smte;":0x2aac, - "smtes;":[0x2aac,0xfe00], "softcy;":0x44c, - "sol;":0x2f, "solb;":0x29c4, - "solbar;":0x233f, "sopf;":[0xd835,0xdd64], - "spades;":0x2660, "spadesuit;":0x2660, - "spar;":0x2225, "sqcap;":0x2293, - "sqcaps;":[0x2293,0xfe00], "sqcup;":0x2294, - "sqcups;":[0x2294,0xfe00], "sqsub;":0x228f, - "sqsube;":0x2291, "sqsubset;":0x228f, - "sqsubseteq;":0x2291, "sqsup;":0x2290, - "sqsupe;":0x2292, "sqsupset;":0x2290, - "sqsupseteq;":0x2292, "squ;":0x25a1, - "square;":0x25a1, "squarf;":0x25aa, - "squf;":0x25aa, "srarr;":0x2192, - "sscr;":[0xd835,0xdcc8], "ssetmn;":0x2216, - "ssmile;":0x2323, "sstarf;":0x22c6, - "star;":0x2606, "starf;":0x2605, - "straightepsilon;":0x3f5, "straightphi;":0x3d5, - "strns;":0xaf, "sub;":0x2282, - "subE;":0x2ac5, "subdot;":0x2abd, - "sube;":0x2286, "subedot;":0x2ac3, - "submult;":0x2ac1, "subnE;":0x2acb, - "subne;":0x228a, "subplus;":0x2abf, - "subrarr;":0x2979, "subset;":0x2282, - "subseteq;":0x2286, "subseteqq;":0x2ac5, - "subsetneq;":0x228a, "subsetneqq;":0x2acb, - "subsim;":0x2ac7, "subsub;":0x2ad5, - "subsup;":0x2ad3, "succ;":0x227b, - "succapprox;":0x2ab8, "succcurlyeq;":0x227d, - "succeq;":0x2ab0, "succnapprox;":0x2aba, - "succneqq;":0x2ab6, "succnsim;":0x22e9, - "succsim;":0x227f, "sum;":0x2211, - "sung;":0x266a, "sup1":0xb9, - "sup1;":0xb9, "sup2":0xb2, - "sup2;":0xb2, "sup3":0xb3, - "sup3;":0xb3, "sup;":0x2283, - "supE;":0x2ac6, "supdot;":0x2abe, - "supdsub;":0x2ad8, "supe;":0x2287, - "supedot;":0x2ac4, "suphsol;":0x27c9, - "suphsub;":0x2ad7, "suplarr;":0x297b, - "supmult;":0x2ac2, "supnE;":0x2acc, - "supne;":0x228b, "supplus;":0x2ac0, - "supset;":0x2283, "supseteq;":0x2287, - "supseteqq;":0x2ac6, "supsetneq;":0x228b, - "supsetneqq;":0x2acc, "supsim;":0x2ac8, - "supsub;":0x2ad4, "supsup;":0x2ad6, - "swArr;":0x21d9, "swarhk;":0x2926, - "swarr;":0x2199, "swarrow;":0x2199, - "swnwar;":0x292a, "szlig":0xdf, - "szlig;":0xdf, "target;":0x2316, - "tau;":0x3c4, "tbrk;":0x23b4, - "tcaron;":0x165, "tcedil;":0x163, - "tcy;":0x442, "tdot;":0x20db, - "telrec;":0x2315, "tfr;":[0xd835,0xdd31], - "there4;":0x2234, "therefore;":0x2234, - "theta;":0x3b8, "thetasym;":0x3d1, - "thetav;":0x3d1, "thickapprox;":0x2248, - "thicksim;":0x223c, "thinsp;":0x2009, - "thkap;":0x2248, "thksim;":0x223c, - "thorn":0xfe, "thorn;":0xfe, - "tilde;":0x2dc, "times":0xd7, - "times;":0xd7, "timesb;":0x22a0, - "timesbar;":0x2a31, "timesd;":0x2a30, - "tint;":0x222d, "toea;":0x2928, - "top;":0x22a4, "topbot;":0x2336, - "topcir;":0x2af1, "topf;":[0xd835,0xdd65], - "topfork;":0x2ada, "tosa;":0x2929, - "tprime;":0x2034, "trade;":0x2122, - "triangle;":0x25b5, "triangledown;":0x25bf, - "triangleleft;":0x25c3, "trianglelefteq;":0x22b4, - "triangleq;":0x225c, "triangleright;":0x25b9, - "trianglerighteq;":0x22b5, "tridot;":0x25ec, - "trie;":0x225c, "triminus;":0x2a3a, - "triplus;":0x2a39, "trisb;":0x29cd, - "tritime;":0x2a3b, "trpezium;":0x23e2, - "tscr;":[0xd835,0xdcc9], "tscy;":0x446, - "tshcy;":0x45b, "tstrok;":0x167, - "twixt;":0x226c, "twoheadleftarrow;":0x219e, - "twoheadrightarrow;":0x21a0, "uArr;":0x21d1, - "uHar;":0x2963, "uacute":0xfa, - "uacute;":0xfa, "uarr;":0x2191, - "ubrcy;":0x45e, "ubreve;":0x16d, - "ucirc":0xfb, "ucirc;":0xfb, - "ucy;":0x443, "udarr;":0x21c5, - "udblac;":0x171, "udhar;":0x296e, - "ufisht;":0x297e, "ufr;":[0xd835,0xdd32], - "ugrave":0xf9, "ugrave;":0xf9, - "uharl;":0x21bf, "uharr;":0x21be, - "uhblk;":0x2580, "ulcorn;":0x231c, - "ulcorner;":0x231c, "ulcrop;":0x230f, - "ultri;":0x25f8, "umacr;":0x16b, - "uml":0xa8, "uml;":0xa8, - "uogon;":0x173, "uopf;":[0xd835,0xdd66], - "uparrow;":0x2191, "updownarrow;":0x2195, - "upharpoonleft;":0x21bf, "upharpoonright;":0x21be, - "uplus;":0x228e, "upsi;":0x3c5, - "upsih;":0x3d2, "upsilon;":0x3c5, - "upuparrows;":0x21c8, "urcorn;":0x231d, - "urcorner;":0x231d, "urcrop;":0x230e, - "uring;":0x16f, "urtri;":0x25f9, - "uscr;":[0xd835,0xdcca], "utdot;":0x22f0, - "utilde;":0x169, "utri;":0x25b5, - "utrif;":0x25b4, "uuarr;":0x21c8, - "uuml":0xfc, "uuml;":0xfc, - "uwangle;":0x29a7, "vArr;":0x21d5, - "vBar;":0x2ae8, "vBarv;":0x2ae9, - "vDash;":0x22a8, "vangrt;":0x299c, - "varepsilon;":0x3f5, "varkappa;":0x3f0, - "varnothing;":0x2205, "varphi;":0x3d5, - "varpi;":0x3d6, "varpropto;":0x221d, - "varr;":0x2195, "varrho;":0x3f1, - "varsigma;":0x3c2, "varsubsetneq;":[0x228a,0xfe00], - "varsubsetneqq;":[0x2acb,0xfe00], "varsupsetneq;":[0x228b,0xfe00], - "varsupsetneqq;":[0x2acc,0xfe00], "vartheta;":0x3d1, - "vartriangleleft;":0x22b2, "vartriangleright;":0x22b3, - "vcy;":0x432, "vdash;":0x22a2, - "vee;":0x2228, "veebar;":0x22bb, - "veeeq;":0x225a, "vellip;":0x22ee, - "verbar;":0x7c, "vert;":0x7c, - "vfr;":[0xd835,0xdd33], "vltri;":0x22b2, - "vnsub;":[0x2282,0x20d2], "vnsup;":[0x2283,0x20d2], - "vopf;":[0xd835,0xdd67], "vprop;":0x221d, - "vrtri;":0x22b3, "vscr;":[0xd835,0xdccb], - "vsubnE;":[0x2acb,0xfe00], "vsubne;":[0x228a,0xfe00], - "vsupnE;":[0x2acc,0xfe00], "vsupne;":[0x228b,0xfe00], - "vzigzag;":0x299a, "wcirc;":0x175, - "wedbar;":0x2a5f, "wedge;":0x2227, - "wedgeq;":0x2259, "weierp;":0x2118, - "wfr;":[0xd835,0xdd34], "wopf;":[0xd835,0xdd68], - "wp;":0x2118, "wr;":0x2240, - "wreath;":0x2240, "wscr;":[0xd835,0xdccc], - "xcap;":0x22c2, "xcirc;":0x25ef, - "xcup;":0x22c3, "xdtri;":0x25bd, - "xfr;":[0xd835,0xdd35], "xhArr;":0x27fa, - "xharr;":0x27f7, "xi;":0x3be, - "xlArr;":0x27f8, "xlarr;":0x27f5, - "xmap;":0x27fc, "xnis;":0x22fb, - "xodot;":0x2a00, "xopf;":[0xd835,0xdd69], - "xoplus;":0x2a01, "xotime;":0x2a02, - "xrArr;":0x27f9, "xrarr;":0x27f6, - "xscr;":[0xd835,0xdccd], "xsqcup;":0x2a06, - "xuplus;":0x2a04, "xutri;":0x25b3, - "xvee;":0x22c1, "xwedge;":0x22c0, - "yacute":0xfd, "yacute;":0xfd, - "yacy;":0x44f, "ycirc;":0x177, - "ycy;":0x44b, "yen":0xa5, - "yen;":0xa5, "yfr;":[0xd835,0xdd36], - "yicy;":0x457, "yopf;":[0xd835,0xdd6a], - "yscr;":[0xd835,0xdcce], "yucy;":0x44e, - "yuml":0xff, "yuml;":0xff, - "zacute;":0x17a, "zcaron;":0x17e, - "zcy;":0x437, "zdot;":0x17c, - "zeetrf;":0x2128, "zeta;":0x3b6, - "zfr;":[0xd835,0xdd37], "zhcy;":0x436, - "zigrarr;":0x21dd, "zopf;":[0xd835,0xdd6b], - "zscr;":[0xd835,0xdccf], "zwj;":0x200d, - "zwnj;":0x200c, -}; -/* - * This regexp is generated with test/tools/update-entities.js - * It will always match at least one character -- but note that there - * are no entities whose names are a single character long. - */ -var NAMEDCHARREF = /(A(?:Elig;?|MP;?|acute;?|breve;|c(?:irc;?|y;)|fr;|grave;?|lpha;|macr;|nd;|o(?:gon;|pf;)|pplyFunction;|ring;?|s(?:cr;|sign;)|tilde;?|uml;?)|B(?:a(?:ckslash;|r(?:v;|wed;))|cy;|e(?:cause;|rnoullis;|ta;)|fr;|opf;|reve;|scr;|umpeq;)|C(?:Hcy;|OPY;?|a(?:cute;|p(?:;|italDifferentialD;)|yleys;)|c(?:aron;|edil;?|irc;|onint;)|dot;|e(?:dilla;|nterDot;)|fr;|hi;|ircle(?:Dot;|Minus;|Plus;|Times;)|lo(?:ckwiseContourIntegral;|seCurly(?:DoubleQuote;|Quote;))|o(?:lon(?:;|e;)|n(?:gruent;|int;|tourIntegral;)|p(?:f;|roduct;)|unterClockwiseContourIntegral;)|ross;|scr;|up(?:;|Cap;))|D(?:D(?:;|otrahd;)|Jcy;|Scy;|Zcy;|a(?:gger;|rr;|shv;)|c(?:aron;|y;)|el(?:;|ta;)|fr;|i(?:a(?:critical(?:Acute;|Do(?:t;|ubleAcute;)|Grave;|Tilde;)|mond;)|fferentialD;)|o(?:pf;|t(?:;|Dot;|Equal;)|uble(?:ContourIntegral;|Do(?:t;|wnArrow;)|L(?:eft(?:Arrow;|RightArrow;|Tee;)|ong(?:Left(?:Arrow;|RightArrow;)|RightArrow;))|Right(?:Arrow;|Tee;)|Up(?:Arrow;|DownArrow;)|VerticalBar;)|wn(?:Arrow(?:;|Bar;|UpArrow;)|Breve;|Left(?:RightVector;|TeeVector;|Vector(?:;|Bar;))|Right(?:TeeVector;|Vector(?:;|Bar;))|Tee(?:;|Arrow;)|arrow;))|s(?:cr;|trok;))|E(?:NG;|TH;?|acute;?|c(?:aron;|irc;?|y;)|dot;|fr;|grave;?|lement;|m(?:acr;|pty(?:SmallSquare;|VerySmallSquare;))|o(?:gon;|pf;)|psilon;|qu(?:al(?:;|Tilde;)|ilibrium;)|s(?:cr;|im;)|ta;|uml;?|x(?:ists;|ponentialE;))|F(?:cy;|fr;|illed(?:SmallSquare;|VerySmallSquare;)|o(?:pf;|rAll;|uriertrf;)|scr;)|G(?:Jcy;|T;?|amma(?:;|d;)|breve;|c(?:edil;|irc;|y;)|dot;|fr;|g;|opf;|reater(?:Equal(?:;|Less;)|FullEqual;|Greater;|Less;|SlantEqual;|Tilde;)|scr;|t;)|H(?:ARDcy;|a(?:cek;|t;)|circ;|fr;|ilbertSpace;|o(?:pf;|rizontalLine;)|s(?:cr;|trok;)|ump(?:DownHump;|Equal;))|I(?:Ecy;|Jlig;|Ocy;|acute;?|c(?:irc;?|y;)|dot;|fr;|grave;?|m(?:;|a(?:cr;|ginaryI;)|plies;)|n(?:t(?:;|e(?:gral;|rsection;))|visible(?:Comma;|Times;))|o(?:gon;|pf;|ta;)|scr;|tilde;|u(?:kcy;|ml;?))|J(?:c(?:irc;|y;)|fr;|opf;|s(?:cr;|ercy;)|ukcy;)|K(?:Hcy;|Jcy;|appa;|c(?:edil;|y;)|fr;|opf;|scr;)|L(?:Jcy;|T;?|a(?:cute;|mbda;|ng;|placetrf;|rr;)|c(?:aron;|edil;|y;)|e(?:ft(?:A(?:ngleBracket;|rrow(?:;|Bar;|RightArrow;))|Ceiling;|Do(?:ubleBracket;|wn(?:TeeVector;|Vector(?:;|Bar;)))|Floor;|Right(?:Arrow;|Vector;)|T(?:ee(?:;|Arrow;|Vector;)|riangle(?:;|Bar;|Equal;))|Up(?:DownVector;|TeeVector;|Vector(?:;|Bar;))|Vector(?:;|Bar;)|arrow;|rightarrow;)|ss(?:EqualGreater;|FullEqual;|Greater;|Less;|SlantEqual;|Tilde;))|fr;|l(?:;|eftarrow;)|midot;|o(?:ng(?:Left(?:Arrow;|RightArrow;)|RightArrow;|left(?:arrow;|rightarrow;)|rightarrow;)|pf;|wer(?:LeftArrow;|RightArrow;))|s(?:cr;|h;|trok;)|t;)|M(?:ap;|cy;|e(?:diumSpace;|llintrf;)|fr;|inusPlus;|opf;|scr;|u;)|N(?:Jcy;|acute;|c(?:aron;|edil;|y;)|e(?:gative(?:MediumSpace;|Thi(?:ckSpace;|nSpace;)|VeryThinSpace;)|sted(?:GreaterGreater;|LessLess;)|wLine;)|fr;|o(?:Break;|nBreakingSpace;|pf;|t(?:;|C(?:ongruent;|upCap;)|DoubleVerticalBar;|E(?:lement;|qual(?:;|Tilde;)|xists;)|Greater(?:;|Equal;|FullEqual;|Greater;|Less;|SlantEqual;|Tilde;)|Hump(?:DownHump;|Equal;)|Le(?:ftTriangle(?:;|Bar;|Equal;)|ss(?:;|Equal;|Greater;|Less;|SlantEqual;|Tilde;))|Nested(?:GreaterGreater;|LessLess;)|Precedes(?:;|Equal;|SlantEqual;)|R(?:everseElement;|ightTriangle(?:;|Bar;|Equal;))|S(?:quareSu(?:bset(?:;|Equal;)|perset(?:;|Equal;))|u(?:bset(?:;|Equal;)|cceeds(?:;|Equal;|SlantEqual;|Tilde;)|perset(?:;|Equal;)))|Tilde(?:;|Equal;|FullEqual;|Tilde;)|VerticalBar;))|scr;|tilde;?|u;)|O(?:Elig;|acute;?|c(?:irc;?|y;)|dblac;|fr;|grave;?|m(?:acr;|ega;|icron;)|opf;|penCurly(?:DoubleQuote;|Quote;)|r;|s(?:cr;|lash;?)|ti(?:lde;?|mes;)|uml;?|ver(?:B(?:ar;|rac(?:e;|ket;))|Parenthesis;))|P(?:artialD;|cy;|fr;|hi;|i;|lusMinus;|o(?:incareplane;|pf;)|r(?:;|ecedes(?:;|Equal;|SlantEqual;|Tilde;)|ime;|o(?:duct;|portion(?:;|al;)))|s(?:cr;|i;))|Q(?:UOT;?|fr;|opf;|scr;)|R(?:Barr;|EG;?|a(?:cute;|ng;|rr(?:;|tl;))|c(?:aron;|edil;|y;)|e(?:;|verse(?:E(?:lement;|quilibrium;)|UpEquilibrium;))|fr;|ho;|ight(?:A(?:ngleBracket;|rrow(?:;|Bar;|LeftArrow;))|Ceiling;|Do(?:ubleBracket;|wn(?:TeeVector;|Vector(?:;|Bar;)))|Floor;|T(?:ee(?:;|Arrow;|Vector;)|riangle(?:;|Bar;|Equal;))|Up(?:DownVector;|TeeVector;|Vector(?:;|Bar;))|Vector(?:;|Bar;)|arrow;)|o(?:pf;|undImplies;)|rightarrow;|s(?:cr;|h;)|uleDelayed;)|S(?:H(?:CHcy;|cy;)|OFTcy;|acute;|c(?:;|aron;|edil;|irc;|y;)|fr;|hort(?:DownArrow;|LeftArrow;|RightArrow;|UpArrow;)|igma;|mallCircle;|opf;|q(?:rt;|uare(?:;|Intersection;|Su(?:bset(?:;|Equal;)|perset(?:;|Equal;))|Union;))|scr;|tar;|u(?:b(?:;|set(?:;|Equal;))|c(?:ceeds(?:;|Equal;|SlantEqual;|Tilde;)|hThat;)|m;|p(?:;|erset(?:;|Equal;)|set;)))|T(?:HORN;?|RADE;|S(?:Hcy;|cy;)|a(?:b;|u;)|c(?:aron;|edil;|y;)|fr;|h(?:e(?:refore;|ta;)|i(?:ckSpace;|nSpace;))|ilde(?:;|Equal;|FullEqual;|Tilde;)|opf;|ripleDot;|s(?:cr;|trok;))|U(?:a(?:cute;?|rr(?:;|ocir;))|br(?:cy;|eve;)|c(?:irc;?|y;)|dblac;|fr;|grave;?|macr;|n(?:der(?:B(?:ar;|rac(?:e;|ket;))|Parenthesis;)|ion(?:;|Plus;))|o(?:gon;|pf;)|p(?:Arrow(?:;|Bar;|DownArrow;)|DownArrow;|Equilibrium;|Tee(?:;|Arrow;)|arrow;|downarrow;|per(?:LeftArrow;|RightArrow;)|si(?:;|lon;))|ring;|scr;|tilde;|uml;?)|V(?:Dash;|bar;|cy;|dash(?:;|l;)|e(?:e;|r(?:bar;|t(?:;|ical(?:Bar;|Line;|Separator;|Tilde;))|yThinSpace;))|fr;|opf;|scr;|vdash;)|W(?:circ;|edge;|fr;|opf;|scr;)|X(?:fr;|i;|opf;|scr;)|Y(?:Acy;|Icy;|Ucy;|acute;?|c(?:irc;|y;)|fr;|opf;|scr;|uml;)|Z(?:Hcy;|acute;|c(?:aron;|y;)|dot;|e(?:roWidthSpace;|ta;)|fr;|opf;|scr;)|a(?:acute;?|breve;|c(?:;|E;|d;|irc;?|ute;?|y;)|elig;?|f(?:;|r;)|grave;?|l(?:e(?:fsym;|ph;)|pha;)|m(?:a(?:cr;|lg;)|p;?)|n(?:d(?:;|and;|d;|slope;|v;)|g(?:;|e;|le;|msd(?:;|a(?:a;|b;|c;|d;|e;|f;|g;|h;))|rt(?:;|vb(?:;|d;))|s(?:ph;|t;)|zarr;))|o(?:gon;|pf;)|p(?:;|E;|acir;|e;|id;|os;|prox(?:;|eq;))|ring;?|s(?:cr;|t;|ymp(?:;|eq;))|tilde;?|uml;?|w(?:conint;|int;))|b(?:Not;|a(?:ck(?:cong;|epsilon;|prime;|sim(?:;|eq;))|r(?:vee;|wed(?:;|ge;)))|brk(?:;|tbrk;)|c(?:ong;|y;)|dquo;|e(?:caus(?:;|e;)|mptyv;|psi;|rnou;|t(?:a;|h;|ween;))|fr;|ig(?:c(?:ap;|irc;|up;)|o(?:dot;|plus;|times;)|s(?:qcup;|tar;)|triangle(?:down;|up;)|uplus;|vee;|wedge;)|karow;|l(?:a(?:ck(?:lozenge;|square;|triangle(?:;|down;|left;|right;))|nk;)|k(?:1(?:2;|4;)|34;)|ock;)|n(?:e(?:;|quiv;)|ot;)|o(?:pf;|t(?:;|tom;)|wtie;|x(?:D(?:L;|R;|l;|r;)|H(?:;|D;|U;|d;|u;)|U(?:L;|R;|l;|r;)|V(?:;|H;|L;|R;|h;|l;|r;)|box;|d(?:L;|R;|l;|r;)|h(?:;|D;|U;|d;|u;)|minus;|plus;|times;|u(?:L;|R;|l;|r;)|v(?:;|H;|L;|R;|h;|l;|r;)))|prime;|r(?:eve;|vbar;?)|s(?:cr;|emi;|im(?:;|e;)|ol(?:;|b;|hsub;))|u(?:ll(?:;|et;)|mp(?:;|E;|e(?:;|q;))))|c(?:a(?:cute;|p(?:;|and;|brcup;|c(?:ap;|up;)|dot;|s;)|r(?:et;|on;))|c(?:a(?:ps;|ron;)|edil;?|irc;|ups(?:;|sm;))|dot;|e(?:dil;?|mptyv;|nt(?:;|erdot;|))|fr;|h(?:cy;|eck(?:;|mark;)|i;)|ir(?:;|E;|c(?:;|eq;|le(?:arrow(?:left;|right;)|d(?:R;|S;|ast;|circ;|dash;)))|e;|fnint;|mid;|scir;)|lubs(?:;|uit;)|o(?:lon(?:;|e(?:;|q;))|m(?:ma(?:;|t;)|p(?:;|fn;|le(?:ment;|xes;)))|n(?:g(?:;|dot;)|int;)|p(?:f;|rod;|y(?:;|sr;|)))|r(?:arr;|oss;)|s(?:cr;|u(?:b(?:;|e;)|p(?:;|e;)))|tdot;|u(?:darr(?:l;|r;)|e(?:pr;|sc;)|larr(?:;|p;)|p(?:;|brcap;|c(?:ap;|up;)|dot;|or;|s;)|r(?:arr(?:;|m;)|ly(?:eq(?:prec;|succ;)|vee;|wedge;)|ren;?|vearrow(?:left;|right;))|vee;|wed;)|w(?:conint;|int;)|ylcty;)|d(?:Arr;|Har;|a(?:gger;|leth;|rr;|sh(?:;|v;))|b(?:karow;|lac;)|c(?:aron;|y;)|d(?:;|a(?:gger;|rr;)|otseq;)|e(?:g;?|lta;|mptyv;)|f(?:isht;|r;)|har(?:l;|r;)|i(?:am(?:;|ond(?:;|suit;)|s;)|e;|gamma;|sin;|v(?:;|ide(?:;|ontimes;|)|onx;))|jcy;|lc(?:orn;|rop;)|o(?:llar;|pf;|t(?:;|eq(?:;|dot;)|minus;|plus;|square;)|ublebarwedge;|wn(?:arrow;|downarrows;|harpoon(?:left;|right;)))|r(?:bkarow;|c(?:orn;|rop;))|s(?:c(?:r;|y;)|ol;|trok;)|t(?:dot;|ri(?:;|f;))|u(?:arr;|har;)|wangle;|z(?:cy;|igrarr;))|e(?:D(?:Dot;|ot;)|a(?:cute;?|ster;)|c(?:aron;|ir(?:;|c;?)|olon;|y;)|dot;|e;|f(?:Dot;|r;)|g(?:;|rave;?|s(?:;|dot;))|l(?:;|inters;|l;|s(?:;|dot;))|m(?:acr;|pty(?:;|set;|v;)|sp(?:1(?:3;|4;)|;))|n(?:g;|sp;)|o(?:gon;|pf;)|p(?:ar(?:;|sl;)|lus;|si(?:;|lon;|v;))|q(?:c(?:irc;|olon;)|s(?:im;|lant(?:gtr;|less;))|u(?:als;|est;|iv(?:;|DD;))|vparsl;)|r(?:Dot;|arr;)|s(?:cr;|dot;|im;)|t(?:a;|h;?)|u(?:ml;?|ro;)|x(?:cl;|ist;|p(?:ectation;|onentiale;)))|f(?:allingdotseq;|cy;|emale;|f(?:ilig;|l(?:ig;|lig;)|r;)|ilig;|jlig;|l(?:at;|lig;|tns;)|nof;|o(?:pf;|r(?:all;|k(?:;|v;)))|partint;|r(?:a(?:c(?:1(?:2;?|3;|4;?|5;|6;|8;)|2(?:3;|5;)|3(?:4;?|5;|8;)|45;|5(?:6;|8;)|78;)|sl;)|own;)|scr;)|g(?:E(?:;|l;)|a(?:cute;|mma(?:;|d;)|p;)|breve;|c(?:irc;|y;)|dot;|e(?:;|l;|q(?:;|q;|slant;)|s(?:;|cc;|dot(?:;|o(?:;|l;))|l(?:;|es;)))|fr;|g(?:;|g;)|imel;|jcy;|l(?:;|E;|a;|j;)|n(?:E;|ap(?:;|prox;)|e(?:;|q(?:;|q;))|sim;)|opf;|rave;|s(?:cr;|im(?:;|e;|l;))|t(?:;|c(?:c;|ir;)|dot;|lPar;|quest;|r(?:a(?:pprox;|rr;)|dot;|eq(?:less;|qless;)|less;|sim;)|)|v(?:ertneqq;|nE;))|h(?:Arr;|a(?:irsp;|lf;|milt;|r(?:dcy;|r(?:;|cir;|w;)))|bar;|circ;|e(?:arts(?:;|uit;)|llip;|rcon;)|fr;|ks(?:earow;|warow;)|o(?:arr;|mtht;|ok(?:leftarrow;|rightarrow;)|pf;|rbar;)|s(?:cr;|lash;|trok;)|y(?:bull;|phen;))|i(?:acute;?|c(?:;|irc;?|y;)|e(?:cy;|xcl;?)|f(?:f;|r;)|grave;?|i(?:;|i(?:int;|nt;)|nfin;|ota;)|jlig;|m(?:a(?:cr;|g(?:e;|line;|part;)|th;)|of;|ped;)|n(?:;|care;|fin(?:;|tie;)|odot;|t(?:;|cal;|e(?:gers;|rcal;)|larhk;|prod;))|o(?:cy;|gon;|pf;|ta;)|prod;|quest;?|s(?:cr;|in(?:;|E;|dot;|s(?:;|v;)|v;))|t(?:;|ilde;)|u(?:kcy;|ml;?))|j(?:c(?:irc;|y;)|fr;|math;|opf;|s(?:cr;|ercy;)|ukcy;)|k(?:appa(?:;|v;)|c(?:edil;|y;)|fr;|green;|hcy;|jcy;|opf;|scr;)|l(?:A(?:arr;|rr;|tail;)|Barr;|E(?:;|g;)|Har;|a(?:cute;|emptyv;|gran;|mbda;|ng(?:;|d;|le;)|p;|quo;?|rr(?:;|b(?:;|fs;)|fs;|hk;|lp;|pl;|sim;|tl;)|t(?:;|ail;|e(?:;|s;)))|b(?:arr;|brk;|r(?:ac(?:e;|k;)|k(?:e;|sl(?:d;|u;))))|c(?:aron;|e(?:dil;|il;)|ub;|y;)|d(?:ca;|quo(?:;|r;)|r(?:dhar;|ushar;)|sh;)|e(?:;|ft(?:arrow(?:;|tail;)|harpoon(?:down;|up;)|leftarrows;|right(?:arrow(?:;|s;)|harpoons;|squigarrow;)|threetimes;)|g;|q(?:;|q;|slant;)|s(?:;|cc;|dot(?:;|o(?:;|r;))|g(?:;|es;)|s(?:approx;|dot;|eq(?:gtr;|qgtr;)|gtr;|sim;)))|f(?:isht;|loor;|r;)|g(?:;|E;)|h(?:ar(?:d;|u(?:;|l;))|blk;)|jcy;|l(?:;|arr;|corner;|hard;|tri;)|m(?:idot;|oust(?:;|ache;))|n(?:E;|ap(?:;|prox;)|e(?:;|q(?:;|q;))|sim;)|o(?:a(?:ng;|rr;)|brk;|ng(?:left(?:arrow;|rightarrow;)|mapsto;|rightarrow;)|oparrow(?:left;|right;)|p(?:ar;|f;|lus;)|times;|w(?:ast;|bar;)|z(?:;|enge;|f;))|par(?:;|lt;)|r(?:arr;|corner;|har(?:;|d;)|m;|tri;)|s(?:aquo;|cr;|h;|im(?:;|e;|g;)|q(?:b;|uo(?:;|r;))|trok;)|t(?:;|c(?:c;|ir;)|dot;|hree;|imes;|larr;|quest;|r(?:Par;|i(?:;|e;|f;))|)|ur(?:dshar;|uhar;)|v(?:ertneqq;|nE;))|m(?:DDot;|a(?:cr;?|l(?:e;|t(?:;|ese;))|p(?:;|sto(?:;|down;|left;|up;))|rker;)|c(?:omma;|y;)|dash;|easuredangle;|fr;|ho;|i(?:cro;?|d(?:;|ast;|cir;|dot;?)|nus(?:;|b;|d(?:;|u;)))|l(?:cp;|dr;)|nplus;|o(?:dels;|pf;)|p;|s(?:cr;|tpos;)|u(?:;|ltimap;|map;))|n(?:G(?:g;|t(?:;|v;))|L(?:eft(?:arrow;|rightarrow;)|l;|t(?:;|v;))|Rightarrow;|V(?:Dash;|dash;)|a(?:bla;|cute;|ng;|p(?:;|E;|id;|os;|prox;)|tur(?:;|al(?:;|s;)))|b(?:sp;?|ump(?:;|e;))|c(?:a(?:p;|ron;)|edil;|ong(?:;|dot;)|up;|y;)|dash;|e(?:;|Arr;|ar(?:hk;|r(?:;|ow;))|dot;|quiv;|s(?:ear;|im;)|xist(?:;|s;))|fr;|g(?:E;|e(?:;|q(?:;|q;|slant;)|s;)|sim;|t(?:;|r;))|h(?:Arr;|arr;|par;)|i(?:;|s(?:;|d;)|v;)|jcy;|l(?:Arr;|E;|arr;|dr;|e(?:;|ft(?:arrow;|rightarrow;)|q(?:;|q;|slant;)|s(?:;|s;))|sim;|t(?:;|ri(?:;|e;)))|mid;|o(?:pf;|t(?:;|in(?:;|E;|dot;|v(?:a;|b;|c;))|ni(?:;|v(?:a;|b;|c;))|))|p(?:ar(?:;|allel;|sl;|t;)|olint;|r(?:;|cue;|e(?:;|c(?:;|eq;))))|r(?:Arr;|arr(?:;|c;|w;)|ightarrow;|tri(?:;|e;))|s(?:c(?:;|cue;|e;|r;)|hort(?:mid;|parallel;)|im(?:;|e(?:;|q;))|mid;|par;|qsu(?:be;|pe;)|u(?:b(?:;|E;|e;|set(?:;|eq(?:;|q;)))|cc(?:;|eq;)|p(?:;|E;|e;|set(?:;|eq(?:;|q;)))))|t(?:gl;|ilde;?|lg;|riangle(?:left(?:;|eq;)|right(?:;|eq;)))|u(?:;|m(?:;|ero;|sp;))|v(?:Dash;|Harr;|ap;|dash;|g(?:e;|t;)|infin;|l(?:Arr;|e;|t(?:;|rie;))|r(?:Arr;|trie;)|sim;)|w(?:Arr;|ar(?:hk;|r(?:;|ow;))|near;))|o(?:S;|a(?:cute;?|st;)|c(?:ir(?:;|c;?)|y;)|d(?:ash;|blac;|iv;|ot;|sold;)|elig;|f(?:cir;|r;)|g(?:on;|rave;?|t;)|h(?:bar;|m;)|int;|l(?:arr;|c(?:ir;|ross;)|ine;|t;)|m(?:acr;|ega;|i(?:cron;|d;|nus;))|opf;|p(?:ar;|erp;|lus;)|r(?:;|arr;|d(?:;|er(?:;|of;)|f;?|m;?)|igof;|or;|slope;|v;)|s(?:cr;|lash;?|ol;)|ti(?:lde;?|mes(?:;|as;))|uml;?|vbar;)|p(?:ar(?:;|a(?:;|llel;|)|s(?:im;|l;)|t;)|cy;|er(?:cnt;|iod;|mil;|p;|tenk;)|fr;|h(?:i(?:;|v;)|mmat;|one;)|i(?:;|tchfork;|v;)|l(?:an(?:ck(?:;|h;)|kv;)|us(?:;|acir;|b;|cir;|d(?:o;|u;)|e;|mn;?|sim;|two;))|m;|o(?:intint;|pf;|und;?)|r(?:;|E;|ap;|cue;|e(?:;|c(?:;|approx;|curlyeq;|eq;|n(?:approx;|eqq;|sim;)|sim;))|ime(?:;|s;)|n(?:E;|ap;|sim;)|o(?:d;|f(?:alar;|line;|surf;)|p(?:;|to;))|sim;|urel;)|s(?:cr;|i;)|uncsp;)|q(?:fr;|int;|opf;|prime;|scr;|u(?:at(?:ernions;|int;)|est(?:;|eq;)|ot;?))|r(?:A(?:arr;|rr;|tail;)|Barr;|Har;|a(?:c(?:e;|ute;)|dic;|emptyv;|ng(?:;|d;|e;|le;)|quo;?|rr(?:;|ap;|b(?:;|fs;)|c;|fs;|hk;|lp;|pl;|sim;|tl;|w;)|t(?:ail;|io(?:;|nals;)))|b(?:arr;|brk;|r(?:ac(?:e;|k;)|k(?:e;|sl(?:d;|u;))))|c(?:aron;|e(?:dil;|il;)|ub;|y;)|d(?:ca;|ldhar;|quo(?:;|r;)|sh;)|e(?:al(?:;|ine;|part;|s;)|ct;|g;?)|f(?:isht;|loor;|r;)|h(?:ar(?:d;|u(?:;|l;))|o(?:;|v;))|i(?:ght(?:arrow(?:;|tail;)|harpoon(?:down;|up;)|left(?:arrows;|harpoons;)|rightarrows;|squigarrow;|threetimes;)|ng;|singdotseq;)|l(?:arr;|har;|m;)|moust(?:;|ache;)|nmid;|o(?:a(?:ng;|rr;)|brk;|p(?:ar;|f;|lus;)|times;)|p(?:ar(?:;|gt;)|polint;)|rarr;|s(?:aquo;|cr;|h;|q(?:b;|uo(?:;|r;)))|t(?:hree;|imes;|ri(?:;|e;|f;|ltri;))|uluhar;|x;)|s(?:acute;|bquo;|c(?:;|E;|a(?:p;|ron;)|cue;|e(?:;|dil;)|irc;|n(?:E;|ap;|sim;)|polint;|sim;|y;)|dot(?:;|b;|e;)|e(?:Arr;|ar(?:hk;|r(?:;|ow;))|ct;?|mi;|swar;|tm(?:inus;|n;)|xt;)|fr(?:;|own;)|h(?:arp;|c(?:hcy;|y;)|ort(?:mid;|parallel;)|y;?)|i(?:gma(?:;|f;|v;)|m(?:;|dot;|e(?:;|q;)|g(?:;|E;)|l(?:;|E;)|ne;|plus;|rarr;))|larr;|m(?:a(?:llsetminus;|shp;)|eparsl;|i(?:d;|le;)|t(?:;|e(?:;|s;)))|o(?:ftcy;|l(?:;|b(?:;|ar;))|pf;)|pa(?:des(?:;|uit;)|r;)|q(?:c(?:ap(?:;|s;)|up(?:;|s;))|su(?:b(?:;|e;|set(?:;|eq;))|p(?:;|e;|set(?:;|eq;)))|u(?:;|ar(?:e;|f;)|f;))|rarr;|s(?:cr;|etmn;|mile;|tarf;)|t(?:ar(?:;|f;)|r(?:aight(?:epsilon;|phi;)|ns;))|u(?:b(?:;|E;|dot;|e(?:;|dot;)|mult;|n(?:E;|e;)|plus;|rarr;|s(?:et(?:;|eq(?:;|q;)|neq(?:;|q;))|im;|u(?:b;|p;)))|cc(?:;|approx;|curlyeq;|eq;|n(?:approx;|eqq;|sim;)|sim;)|m;|ng;|p(?:1;?|2;?|3;?|;|E;|d(?:ot;|sub;)|e(?:;|dot;)|hs(?:ol;|ub;)|larr;|mult;|n(?:E;|e;)|plus;|s(?:et(?:;|eq(?:;|q;)|neq(?:;|q;))|im;|u(?:b;|p;))))|w(?:Arr;|ar(?:hk;|r(?:;|ow;))|nwar;)|zlig;?)|t(?:a(?:rget;|u;)|brk;|c(?:aron;|edil;|y;)|dot;|elrec;|fr;|h(?:e(?:re(?:4;|fore;)|ta(?:;|sym;|v;))|i(?:ck(?:approx;|sim;)|nsp;)|k(?:ap;|sim;)|orn;?)|i(?:lde;|mes(?:;|b(?:;|ar;)|d;|)|nt;)|o(?:ea;|p(?:;|bot;|cir;|f(?:;|ork;))|sa;)|prime;|r(?:ade;|i(?:angle(?:;|down;|left(?:;|eq;)|q;|right(?:;|eq;))|dot;|e;|minus;|plus;|sb;|time;)|pezium;)|s(?:c(?:r;|y;)|hcy;|trok;)|w(?:ixt;|ohead(?:leftarrow;|rightarrow;)))|u(?:Arr;|Har;|a(?:cute;?|rr;)|br(?:cy;|eve;)|c(?:irc;?|y;)|d(?:arr;|blac;|har;)|f(?:isht;|r;)|grave;?|h(?:ar(?:l;|r;)|blk;)|l(?:c(?:orn(?:;|er;)|rop;)|tri;)|m(?:acr;|l;?)|o(?:gon;|pf;)|p(?:arrow;|downarrow;|harpoon(?:left;|right;)|lus;|si(?:;|h;|lon;)|uparrows;)|r(?:c(?:orn(?:;|er;)|rop;)|ing;|tri;)|scr;|t(?:dot;|ilde;|ri(?:;|f;))|u(?:arr;|ml;?)|wangle;)|v(?:Arr;|Bar(?:;|v;)|Dash;|a(?:ngrt;|r(?:epsilon;|kappa;|nothing;|p(?:hi;|i;|ropto;)|r(?:;|ho;)|s(?:igma;|u(?:bsetneq(?:;|q;)|psetneq(?:;|q;)))|t(?:heta;|riangle(?:left;|right;))))|cy;|dash;|e(?:e(?:;|bar;|eq;)|llip;|r(?:bar;|t;))|fr;|ltri;|nsu(?:b;|p;)|opf;|prop;|rtri;|s(?:cr;|u(?:bn(?:E;|e;)|pn(?:E;|e;)))|zigzag;)|w(?:circ;|e(?:d(?:bar;|ge(?:;|q;))|ierp;)|fr;|opf;|p;|r(?:;|eath;)|scr;)|x(?:c(?:ap;|irc;|up;)|dtri;|fr;|h(?:Arr;|arr;)|i;|l(?:Arr;|arr;)|map;|nis;|o(?:dot;|p(?:f;|lus;)|time;)|r(?:Arr;|arr;)|s(?:cr;|qcup;)|u(?:plus;|tri;)|vee;|wedge;)|y(?:ac(?:ute;?|y;)|c(?:irc;|y;)|en;?|fr;|icy;|opf;|scr;|u(?:cy;|ml;?))|z(?:acute;|c(?:aron;|y;)|dot;|e(?:etrf;|ta;)|fr;|hcy;|igrarr;|opf;|scr;|w(?:j;|nj;)))|[\s\S]/g; - -var NAMEDCHARREF_MAXLEN = 32; - -// Regular expression constants used by the tokenizer and parser - -// Note that \r is included in all of these regexps because it will need -// to be converted to LF by the scanChars() function. -var DBLQUOTEATTRVAL = /[^\r"&\u0000]+/g; -var SINGLEQUOTEATTRVAL = /[^\r'&\u0000]+/g; -var UNQUOTEDATTRVAL = /[^\r\t\n\f &>\u0000]+/g; -var TAGNAME = /[^\r\t\n\f \/>A-Z\u0000]+/g; -var ATTRNAME = /[^\r\t\n\f \/=>A-Z\u0000]+/g; - -var CDATATEXT = /[^\]\r\u0000\uffff]*/g; -var DATATEXT = /[^&<\r\u0000\uffff]*/g; -var RAWTEXT = /[^<\r\u0000\uffff]*/g; -var PLAINTEXT = /[^\r\u0000\uffff]*/g; -// Since we don't have the 'sticky tag', add '|.' to the end of SIMPLETAG -// and SIMPLEATTR so that we are guaranteed to always match. This prevents -// us from scanning past the lastIndex set. (Note that the desired matches -// are always greater than 1 char long, so longest-match will ensure that . -// is not matched unless the desired match fails.) -var SIMPLETAG = /(?:(\/)?([a-z]+)>)|[\s\S]/g; -var SIMPLEATTR = /(?:([-a-z]+)[ \t\n\f]*=[ \t\n\f]*('[^'&\r\u0000]*'|"[^"&\r\u0000]*"|[^\t\n\r\f "&'\u0000>][^&> \t\n\r\f\u0000]*[ \t\n\f]))|[\s\S]/g; - -var NONWS = /[^\x09\x0A\x0C\x0D\x20]/; -var ALLNONWS = /[^\x09\x0A\x0C\x0D\x20]/g; // like above, with g flag -var NONWSNONNUL = /[^\x00\x09\x0A\x0C\x0D\x20]/; // don't allow NUL either -var LEADINGWS = /^[\x09\x0A\x0C\x0D\x20]+/; -var NULCHARS = /\x00/g; - -/*** - * These are utility functions that don't use any of the parser's - * internal state. - */ -function buf2str(buf) { - var CHUNKSIZE=16384; - if (buf.length < CHUNKSIZE) { - return String.fromCharCode.apply(String, buf); - } - // special case for large strings, to avoid busting the stack. - var result = ''; - for (var i = 0; i < buf.length; i += CHUNKSIZE) { - result += String.fromCharCode.apply(String, buf.slice(i, i+CHUNKSIZE)); - } - return result; -} - -function str2buf(s) { - var result = []; - for (var i=0; i 0; i--) { - var e = this.elements[i]; - if (isA(e, tag)) break; - } - this.elements.length = i; - this.top = this.elements[i-1]; -}; - -// Pop elements off the stack up to and including the first -// element that is an instance of the specified type -HTMLParser.ElementStack.prototype.popElementType = function(type) { - for(var i = this.elements.length-1; i > 0; i--) { - if (this.elements[i] instanceof type) break; - } - this.elements.length = i; - this.top = this.elements[i-1]; -}; - -// Pop elements off the stack up to and including the element e. -// Note that this is very different from removeElement() -// This requires that e is on the stack. -HTMLParser.ElementStack.prototype.popElement = function(e) { - for(var i = this.elements.length-1; i > 0; i--) { - if (this.elements[i] === e) break; - } - this.elements.length = i; - this.top = this.elements[i-1]; -}; - -// Remove a specific element from the stack. -// Do nothing if the element is not on the stack -HTMLParser.ElementStack.prototype.removeElement = function(e) { - if (this.top === e) this.pop(); - else { - var idx = this.elements.lastIndexOf(e); - if (idx !== -1) - this.elements.splice(idx, 1); - } -}; - -HTMLParser.ElementStack.prototype.clearToContext = function(set) { - // Note that we don't loop to 0. Never pop the elt off. - for(var i = this.elements.length-1; i > 0; i--) { - if (isA(this.elements[i], set)) break; - } - this.elements.length = i+1; - this.top = this.elements[i]; -}; - -HTMLParser.ElementStack.prototype.contains = function(tag) { - return this.inSpecificScope(tag, Object.create(null)); -}; - -HTMLParser.ElementStack.prototype.inSpecificScope = function(tag, set) { - for(var i = this.elements.length-1; i >= 0; i--) { - var elt = this.elements[i]; - if (isA(elt, tag)) return true; - if (isA(elt, set)) return false; - } - return false; -}; - -// Like the above, but for a specific element, not a tagname -HTMLParser.ElementStack.prototype.elementInSpecificScope = function(target, set) { - for(var i = this.elements.length-1; i >= 0; i--) { - var elt = this.elements[i]; - if (elt === target) return true; - if (isA(elt, set)) return false; - } - return false; -}; - -// Like the above, but for an element interface, not a tagname -HTMLParser.ElementStack.prototype.elementTypeInSpecificScope = function(target, set) { - for(var i = this.elements.length-1; i >= 0; i--) { - var elt = this.elements[i]; - if (elt instanceof target) return true; - if (isA(elt, set)) return false; - } - return false; -}; - -HTMLParser.ElementStack.prototype.inScope = function(tag) { - return this.inSpecificScope(tag, inScopeSet); -}; - -HTMLParser.ElementStack.prototype.elementInScope = function(e) { - return this.elementInSpecificScope(e, inScopeSet); -}; - -HTMLParser.ElementStack.prototype.elementTypeInScope = function(type) { - return this.elementTypeInSpecificScope(type, inScopeSet); -}; - -HTMLParser.ElementStack.prototype.inButtonScope = function(tag) { - return this.inSpecificScope(tag, inButtonScopeSet); -}; - -HTMLParser.ElementStack.prototype.inListItemScope = function(tag) { - return this.inSpecificScope(tag, inListItemScopeSet); -}; - -HTMLParser.ElementStack.prototype.inTableScope = function(tag) { - return this.inSpecificScope(tag, inTableScopeSet); -}; - -HTMLParser.ElementStack.prototype.inSelectScope = function(tag) { - // Can't implement this one with inSpecificScope, since it involves - // a set defined by inverting another set. So implement manually. - for(var i = this.elements.length-1; i >= 0; i--) { - var elt = this.elements[i]; - if (elt.namespaceURI !== NAMESPACE.HTML) return false; - var localname = elt.localName; - if (localname === tag) return true; - if (localname !== "optgroup" && localname !== "option") - return false; - } - return false; -}; - -HTMLParser.ElementStack.prototype.generateImpliedEndTags = function(butnot, thorough) { - var endTagSet = thorough ? thoroughImpliedEndTagsSet : impliedEndTagsSet; - for(var i = this.elements.length-1; i >= 0; i--) { - var e = this.elements[i]; - if (butnot && isA(e, butnot)) break; - if (!isA(this.elements[i], endTagSet)) break; - } - - this.elements.length = i+1; - this.top = this.elements[i]; -}; - -/*** - * The ActiveFormattingElements class - */ -HTMLParser.ActiveFormattingElements = function AFE() { - this.list = []; // elements - this.attrs = []; // attribute tokens for cloning -}; - -HTMLParser.ActiveFormattingElements.prototype.MARKER = { localName: "|" }; - -/* -// For debugging -HTMLParser.ActiveFormattingElements.prototype.toString = function() { - return "AFE: " + - this.list.map(function(e) { return e.localName; }).join("-"); -} -*/ - -HTMLParser.ActiveFormattingElements.prototype.insertMarker = function() { - this.list.push(this.MARKER); - this.attrs.push(this.MARKER); -}; - -HTMLParser.ActiveFormattingElements.prototype.push = function(elt, attrs) { - // Scan backwards: if there are already 3 copies of this element - // before we encounter a marker, then drop the last one - var count = 0; - for(var i = this.list.length-1; i >= 0; i--) { - if (this.list[i] === this.MARKER) break; - // equal() is defined below - if (equal(elt, this.list[i], this.attrs[i])) { - count++; - if (count === 3) { - this.list.splice(i, 1); - this.attrs.splice(i, 1); - break; - } - } - } - - - // Now push the element onto the list - this.list.push(elt); - - // Copy the attributes and push those on, too - var attrcopy = []; - for(var ii = 0; ii < attrs.length; ii++) { - attrcopy[ii] = attrs[ii]; - } - - this.attrs.push(attrcopy); - - // This function defines equality of two elements for the purposes - // of the AFE list. Note that it compares the new elements - // attributes to the saved array of attributes associated with - // the old element because a script could have changed the - // old element's set of attributes - function equal(newelt, oldelt, oldattrs) { - if (newelt.localName !== oldelt.localName) return false; - if (newelt._numattrs !== oldattrs.length) return false; - for(var i = 0, n = oldattrs.length; i < n; i++) { - var oldname = oldattrs[i][0]; - var oldval = oldattrs[i][1]; - if (!newelt.hasAttribute(oldname)) return false; - if (newelt.getAttribute(oldname) !== oldval) return false; - } - return true; - } -}; - -HTMLParser.ActiveFormattingElements.prototype.clearToMarker = function() { - for(var i = this.list.length-1; i >= 0; i--) { - if (this.list[i] === this.MARKER) break; - } - if (i < 0) i = 0; - this.list.length = i; - this.attrs.length = i; -}; - -// Find and return the last element with the specified tag between the -// end of the list and the last marker on the list. -// Used when parsing in_body_mode() -HTMLParser.ActiveFormattingElements.prototype.findElementByTag = function(tag) { - for(var i = this.list.length-1; i >= 0; i--) { - var elt = this.list[i]; - if (elt === this.MARKER) break; - if (elt.localName === tag) return elt; - } - return null; -}; - -HTMLParser.ActiveFormattingElements.prototype.indexOf = function(e) { - return this.list.lastIndexOf(e); -}; - -// Find the element e in the list and remove it -// Used when parsing in_body() -HTMLParser.ActiveFormattingElements.prototype.remove = function(e) { - var idx = this.list.lastIndexOf(e); - if (idx !== -1) { - this.list.splice(idx, 1); - this.attrs.splice(idx, 1); - } -}; - -// Find element a in the list and replace it with element b -// XXX: Do I need to handle attributes here? -HTMLParser.ActiveFormattingElements.prototype.replace = function(a, b, attrs) { - var idx = this.list.lastIndexOf(a); - if (idx !== -1) { - this.list[idx] = b; - this.attrs[idx] = attrs; - } -}; - -// Find a in the list and insert b after it -// This is only used for insert a bookmark object, so the -// attrs array doesn't really matter -HTMLParser.ActiveFormattingElements.prototype.insertAfter = function(a,b) { - var idx = this.list.lastIndexOf(a); - if (idx !== -1) { - this.list.splice(idx, 0, b); - this.attrs.splice(idx, 0, b); - } -}; - - - - -/*** - * This is the parser factory function. It is the return value of - * the outer closure that it is defined within. Most of the parser - * implementation details are inside this function. - */ -function HTMLParser(address, fragmentContext, options) { - /*** - * These are the parser's state variables - */ - // Scanner state - var chars = null; - var numchars = 0; // Length of chars - var nextchar = 0; // Index of next char - var input_complete = false; // Becomes true when end() called. - var scanner_skip_newline = false; // If previous char was CR - var reentrant_invocations = 0; - var saved_scanner_state = []; - var leftovers = ""; - var first_batch = true; - var paused = 0; // Becomes non-zero while loading scripts - - - // Tokenizer state - var tokenizer = data_state; // Current tokenizer state - var return_state; - var character_reference_code; - var tagnamebuf = ""; - var lasttagname = ""; // holds the target end tag for text states - var tempbuf = []; - var attrnamebuf = ""; - var attrvaluebuf = ""; - var commentbuf = []; - var doctypenamebuf = []; - var doctypepublicbuf = []; - var doctypesystembuf = []; - var attributes = []; - var is_end_tag = false; - - // Tree builder state - var parser = initial_mode; // Current insertion mode - var originalInsertionMode = null; // A saved insertion mode - var templateInsertionModes = []; // Stack of template insertion modes. - var stack = new HTMLParser.ElementStack(); // Stack of open elements - var afe = new HTMLParser.ActiveFormattingElements(); // mis-nested tags - var fragment = (fragmentContext!==undefined); // For innerHTML, etc. - var head_element_pointer = null; - var form_element_pointer = null; - var scripting_enabled = true; - if (fragmentContext) { - scripting_enabled = fragmentContext.ownerDocument._scripting_enabled; - } - if (options && options.scripting_enabled === false) - scripting_enabled = false; - var frameset_ok = true; - var force_quirks = false; - var pending_table_text; - var text_integration_mode; // XXX a spec bug workaround? - - // A single run of characters, buffered up to be sent to - // the parser as a single string. - var textrun = []; - var textIncludesNUL = false; - var ignore_linefeed = false; - - /*** - * This is the parser object that will be the return value of this - * factory function, which is some 5000 lines below. - * Note that the variable "parser" is the current state of the - * parser's state machine. This variable "htmlparser" is the - * return value and defines the public API of the parser - */ - var htmlparser = { - document: function() { - return doc; - }, - - // Convenience function for internal use. Can only be called once, - // as it removes the nodes from `doc` to add them to fragment. - _asDocumentFragment: function() { - var frag = doc.createDocumentFragment(); - var root = doc.firstChild; - while(root.hasChildNodes()) { - frag.appendChild(root.firstChild); - } - return frag; - }, - - // Internal function used from HTMLScriptElement to pause the - // parser while a script is being loaded from the network - pause: function() { - // print("pausing parser"); - paused++; - }, - - // Called when a script finishes loading - resume: function() { - // print("resuming parser"); - paused--; - // XXX: added this to force a resumption. - // Is this the right thing to do? - this.parse(""); - }, - - // Parse the HTML text s. - // The second argument should be true if there is no more - // text to be parsed, and should be false or omitted otherwise. - // The second argument must not be set for recursive invocations - // from document.write() - parse: function(s, end, shouldPauseFunc) { - var moreToDo; - - // If we're paused, remember the text to parse, but - // don't parse it now. - // (Don't invoke shouldPauseFunc because we haven't handled 'end' yet.) - if (paused > 0) { - leftovers += s; - return true; // more to do - } - - - if (reentrant_invocations === 0) { - // A normal, top-level invocation - if (leftovers) { - s = leftovers + s; - leftovers = ""; - } - - // Add a special marker character to the end of - // the buffer. If the scanner is at the end of - // the buffer and input_complete is set, then this - // character will transform into an EOF token. - // Having an actual character that represents EOF - // in the character buffer makes lookahead regexp - // matching work more easily, and this is - // important for character references. - if (end) { - s += "\uFFFF"; - input_complete = true; // Makes scanChars() send EOF - } - - chars = s; - numchars = s.length; - nextchar = 0; - - if (first_batch) { - // We skip a leading Byte Order Mark (\uFEFF) - // on first batch of text we're given - first_batch = false; - if (chars.charCodeAt(0) === 0xFEFF) nextchar = 1; - } - - reentrant_invocations++; - moreToDo = scanChars(shouldPauseFunc); - leftovers = chars.substring(nextchar, numchars); - reentrant_invocations--; - } - else { - // This is the re-entrant case, which we have to - // handle a little differently. - reentrant_invocations++; - - // Save current scanner state - saved_scanner_state.push(chars, numchars, nextchar); - - // Set new scanner state - chars = s; - numchars = s.length; - nextchar = 0; - - // Now scan as many of these new chars as we can - scanChars(); - moreToDo = false; - - leftovers = chars.substring(nextchar, numchars); - - // restore old scanner state - nextchar = saved_scanner_state.pop(); - numchars = saved_scanner_state.pop(); - chars = saved_scanner_state.pop(); - - // If there were leftover chars from this invocation - // insert them into the pending invocation's buffer - // and trim already processed chars at the same time - if (leftovers) { - chars = leftovers + chars.substring(nextchar); - numchars = chars.length; - nextchar = 0; - leftovers = ""; - } - - // Decrement the counter - reentrant_invocations--; - } - return moreToDo; - } - }; - - - // This is the document we'll be building up - var doc = new Document(true, address); - - // The document needs to know about the parser, for document.write(). - // This _parser property will be deleted when we're done parsing. - doc._parser = htmlparser; - - // XXX I think that any document we use this parser on should support - // scripts. But I may need to configure that through a parser parameter - // Only documents with windows ("browsing contexts" to be precise) - // allow scripting. - doc._scripting_enabled = scripting_enabled; - - - /*** - * The actual code of the HTMLParser() factory function begins here. - */ - - if (fragmentContext) { // for innerHTML parsing - if (fragmentContext.ownerDocument._quirks) - doc._quirks = true; - if (fragmentContext.ownerDocument._limitedQuirks) - doc._limitedQuirks = true; - - // Set the initial tokenizer state - if (fragmentContext.namespaceURI === NAMESPACE.HTML) { - switch(fragmentContext.localName) { - case "title": - case "textarea": - tokenizer = rcdata_state; - break; - case "style": - case "xmp": - case "iframe": - case "noembed": - case "noframes": - case "script": - case "plaintext": - tokenizer = plaintext_state; - break; - } - } - - var root = doc.createElement("html"); - doc._appendChild(root); - stack.push(root); - if (fragmentContext instanceof impl.HTMLTemplateElement) { - templateInsertionModes.push(in_template_mode); - } - resetInsertionMode(); - - for(var e = fragmentContext; e !== null; e = e.parentElement) { - if (e instanceof impl.HTMLFormElement) { - form_element_pointer = e; - break; - } - } - } - - /*** - * Scanner functions - */ - // Loop through the characters in chars, and pass them one at a time - // to the tokenizer FSM. Return when no more characters can be processed - // (This may leave 1 or more characters in the buffer: like a CR - // waiting to see if the next char is LF, or for states that require - // lookahead...) - function scanChars(shouldPauseFunc) { - var codepoint, s, pattern, eof; - - while(nextchar < numchars) { - - // If we just tokenized a tag, then the paused flag - // may have been set to tell us to stop tokenizing while - // the script is loading - if (paused > 0 || (shouldPauseFunc && shouldPauseFunc())) { - return true; - } - - - switch(typeof tokenizer.lookahead) { - case 'undefined': - codepoint = chars.charCodeAt(nextchar++); - if (scanner_skip_newline) { - scanner_skip_newline = false; - if (codepoint === 0x000A) { - nextchar++; - continue; - } - } - switch(codepoint) { - case 0x000D: - // CR always turns into LF, but if the next character - // is LF, then that second LF is skipped. - if (nextchar < numchars) { - if (chars.charCodeAt(nextchar) === 0x000A) - nextchar++; - } - else { - // We don't know the next char right now, so we - // can't check if it is a LF. So set a flag - scanner_skip_newline = true; - } - - // In either case, emit a LF - tokenizer(0x000A); - - break; - case 0xFFFF: - if (input_complete && nextchar === numchars) { - tokenizer(EOF); // codepoint will be 0xFFFF here - break; - } - /* falls through */ - default: - tokenizer(codepoint); - break; - } - break; - - case 'number': - codepoint = chars.charCodeAt(nextchar); - - // The only tokenizer states that require fixed lookahead - // only consume alphanum characters, so we don't have - // to worry about CR and LF in this case - - // tokenizer wants n chars of lookahead - var n = tokenizer.lookahead; - var needsString = true; - if (n < 0) { - needsString = false; - n = -n; - } - - if (n < numchars - nextchar) { - // If we can look ahead that far - s = needsString ? chars.substring(nextchar, nextchar+n) : null; - eof = false; - } - else { // if we don't have that many characters - if (input_complete) { // If no more are coming - // Just return what we have - s = needsString ? chars.substring(nextchar, numchars) : null; - eof = true; - if (codepoint === 0xFFFF && nextchar === numchars-1) - codepoint = EOF; - } - else { - // Return now and wait for more chars later - return true; - } - } - tokenizer(codepoint, s, eof); - break; - case 'string': - codepoint = chars.charCodeAt(nextchar); - - // tokenizer wants characters up to a matching string - pattern = tokenizer.lookahead; - var pos = chars.indexOf(pattern, nextchar); - if (pos !== -1) { - s = chars.substring(nextchar, pos + pattern.length); - eof = false; - } - else { // No match - // If more characters coming, wait for them - if (!input_complete) return true; - - // Otherwise, we've got to return what we've got - s = chars.substring(nextchar, numchars); - if (codepoint === 0xFFFF && nextchar === numchars-1) - codepoint = EOF; - eof = true; - } - - // The tokenizer states that require this kind of - // lookahead have to be careful to handle CR characters - // correctly - tokenizer(codepoint, s, eof); - break; - } - } - return false; // no more characters to scan! - } - - - /*** - * Tokenizer utility functions - */ - function addAttribute(name,value) { - // Make sure there isn't already an attribute with this name - // If there is, ignore this one. - for(var i = 0; i < attributes.length; i++) { - if (attributes[i][0] === name) return; - } - - if (value !== undefined) { - attributes.push([name, value]); - } - else { - attributes.push([name]); - } - } - - // Shortcut for simple attributes - function handleSimpleAttribute() { - SIMPLEATTR.lastIndex = nextchar-1; - var matched = SIMPLEATTR.exec(chars); - if (!matched) throw new Error("should never happen"); - var name = matched[1]; - if (!name) return false; - var value = matched[2]; - var len = value.length; - switch(value[0]) { - case '"': - case "'": - value = value.substring(1, len-1); - nextchar += (matched[0].length-1); - tokenizer = after_attribute_value_quoted_state; - break; - default: - tokenizer = before_attribute_name_state; - nextchar += (matched[0].length-1); - value = value.substring(0, len-1); - break; - } - - // Make sure there isn't already an attribute with this name - // If there is, ignore this one. - for(var i = 0; i < attributes.length; i++) { - if (attributes[i][0] === name) return true; - } - - attributes.push([name, value]); - return true; - } - - function beginTagName() { - is_end_tag = false; - tagnamebuf = ""; - attributes.length = 0; - } - function beginEndTagName() { - is_end_tag = true; - tagnamebuf = ""; - attributes.length = 0; - } - - function beginTempBuf() { tempbuf.length = 0; } - function beginAttrName() { attrnamebuf = ""; } - function beginAttrValue() { attrvaluebuf = ""; } - function beginComment() { commentbuf.length = 0; } - function beginDoctype() { - doctypenamebuf.length = 0; - doctypepublicbuf = null; - doctypesystembuf = null; - } - function beginDoctypePublicId() { doctypepublicbuf = []; } - function beginDoctypeSystemId() { doctypesystembuf = []; } - function forcequirks() { force_quirks = true; } - function cdataAllowed() { - return stack.top && - stack.top.namespaceURI !== "http://www.w3.org/1999/xhtml"; - } - - // Return true if the codepoints in the specified buffer match the - // characters of lasttagname - function appropriateEndTag(buf) { - return lasttagname === buf; - } - - function flushText() { - if (textrun.length > 0) { - var s = buf2str(textrun); - textrun.length = 0; - - if (ignore_linefeed) { - ignore_linefeed = false; - if (s[0] === "\n") s = s.substring(1); - if (s.length === 0) return; - } - - insertToken(TEXT, s); - textIncludesNUL = false; - } - ignore_linefeed = false; - } - - // Consume chars matched by the pattern and return them as a string. Starts - // matching at the current position, so users should drop the current char - // otherwise. - function getMatchingChars(pattern) { - pattern.lastIndex = nextchar - 1; - var match = pattern.exec(chars); - if (match && match.index === nextchar - 1) { - match = match[0]; - nextchar += match.length - 1; - /* Careful! Make sure we haven't matched the EOF character! */ - if (input_complete && nextchar === numchars) { - // Oops, backup one. - match = match.slice(0, -1); - nextchar--; - } - return match; - } else { - throw new Error("should never happen"); - } - } - - // emit a string of chars that match a regexp - // Returns false if no chars matched. - function emitCharsWhile(pattern) { - pattern.lastIndex = nextchar-1; - var match = pattern.exec(chars)[0]; - if (!match) return false; - emitCharString(match); - nextchar += match.length - 1; - return true; - } - - // This is used by CDATA sections - function emitCharString(s) { - if (textrun.length > 0) flushText(); - - if (ignore_linefeed) { - ignore_linefeed = false; - if (s[0] === "\n") s = s.substring(1); - if (s.length === 0) return; - } - - insertToken(TEXT, s); - } - - function emitTag() { - if (is_end_tag) insertToken(ENDTAG, tagnamebuf); - else { - // Remember the last open tag we emitted - var tagname = tagnamebuf; - tagnamebuf = ""; - lasttagname = tagname; - insertToken(TAG, tagname, attributes); - } - } - - - // A shortcut: look ahead and if this is a open or close tag - // in lowercase with no spaces and no attributes, just emit it now. - function emitSimpleTag() { - if (nextchar === numchars) { return false; /* not even 1 char left */ } - SIMPLETAG.lastIndex = nextchar; - var matched = SIMPLETAG.exec(chars); - if (!matched) throw new Error("should never happen"); - var tagname = matched[2]; - if (!tagname) return false; - var endtag = matched[1]; - if (endtag) { - nextchar += (tagname.length+2); - insertToken(ENDTAG, tagname); - } - else { - nextchar += (tagname.length+1); - lasttagname = tagname; - insertToken(TAG, tagname, NOATTRS); - } - return true; - } - - function emitSelfClosingTag() { - if (is_end_tag) insertToken(ENDTAG, tagnamebuf, null, true); - else { - insertToken(TAG, tagnamebuf, attributes, true); - } - } - - function emitDoctype() { - insertToken(DOCTYPE, - buf2str(doctypenamebuf), - doctypepublicbuf ? buf2str(doctypepublicbuf) : undefined, - doctypesystembuf ? buf2str(doctypesystembuf) : undefined); - } - - function emitEOF() { - flushText(); - parser(EOF); // EOF never goes to insertForeignContent() - doc.modclock = 1; // Start tracking modifications - } - - // Insert a token, either using the current parser insertion mode - // (for HTML stuff) or using the insertForeignToken() method. - var insertToken = htmlparser.insertToken = function insertToken(t, value, arg3, arg4) { - flushText(); - var current = stack.top; - - if (!current || current.namespaceURI === NAMESPACE.HTML) { - // This is the common case - parser(t, value, arg3, arg4); - } - else { - // Otherwise we may need to insert this token as foreign content - if (t !== TAG && t !== TEXT) { - insertForeignToken(t, value, arg3, arg4); - } - else { - // But in some cases we treat it as regular content - if ((isMathmlTextIntegrationPoint(current) && - (t === TEXT || - (t === TAG && - value !== "mglyph" && value !== "malignmark"))) || - (t === TAG && - value === "svg" && - current.namespaceURI === NAMESPACE.MATHML && - current.localName === "annotation-xml") || - isHTMLIntegrationPoint(current)) { - - // XXX: the text_integration_mode stuff is an - // attempted bug workaround of mine - text_integration_mode = true; - parser(t, value, arg3, arg4); - text_integration_mode = false; - } - // Otherwise it is foreign content - else { - insertForeignToken(t, value, arg3, arg4); - } - } - } - }; - - - /*** - * Tree building utility functions - */ - function insertComment(data) { - var parent = stack.top; - if (foster_parent_mode && isA(parent, tablesectionrowSet)) { - fosterParent(function(doc) { return doc.createComment(data); }); - } else { - // "If the adjusted insertion location is inside a template element, - // let it instead be inside the template element's template contents" - if (parent instanceof impl.HTMLTemplateElement) { - parent = parent.content; - } - parent._appendChild(parent.ownerDocument.createComment(data)); - } - } - - function insertText(s) { - var parent = stack.top; - if (foster_parent_mode && isA(parent, tablesectionrowSet)) { - fosterParent(function(doc) { return doc.createTextNode(s); }); - } else { - // "If the adjusted insertion location is inside a template element, - // let it instead be inside the template element's template contents" - if (parent instanceof impl.HTMLTemplateElement) { - parent = parent.content; - } - // "If there is a Text node immediately before the adjusted insertion - // location, then append data to that Text node's data." - var lastChild = parent.lastChild; - if (lastChild && lastChild.nodeType === Node.TEXT_NODE) { - lastChild.appendData(s); - } else { - parent._appendChild(parent.ownerDocument.createTextNode(s)); - } - } - } - - function createHTMLElt(doc, name, attrs) { - // Create the element this way, rather than with - // doc.createElement because createElement() does error - // checking on the element name that we need to avoid here. - var elt = html.createElement(doc, name, null); - - if (attrs) { - for(var i = 0, n = attrs.length; i < n; i++) { - // Use the _ version to avoid testing the validity - // of the attribute name - elt._setAttribute(attrs[i][0], attrs[i][1]); - } - } - // XXX - // If the element is a resettable form element, - // run its reset algorithm now - // XXX - // handle case where form-element-pointer is not null - return elt; - } - - // The in_table insertion mode turns on this flag, and that makes - // insertHTMLElement use the foster parenting algorithm for elements - // tags inside a table - var foster_parent_mode = false; - - function insertHTMLElement(name, attrs) { - var elt = insertElement(function(doc) { - return createHTMLElt(doc, name, attrs); - }); - - // XXX - // If this is a form element, set its form attribute property here - if (isA(elt, formassociatedSet)) { - elt._form = form_element_pointer; - } - - return elt; - } - - // Insert the element into the open element or foster parent it - function insertElement(eltFunc) { - var elt; - if (foster_parent_mode && isA(stack.top, tablesectionrowSet)) { - elt = fosterParent(eltFunc); - } - else if (stack.top instanceof impl.HTMLTemplateElement) { - // "If the adjusted insertion location is inside a template element, - // let it instead be inside the template element's template contents" - elt = eltFunc(stack.top.content.ownerDocument); - stack.top.content._appendChild(elt); - } else { - elt = eltFunc(stack.top.ownerDocument); - stack.top._appendChild(elt); - } - - stack.push(elt); - return elt; - } - - function insertForeignElement(name, attrs, ns) { - return insertElement(function(doc) { - // We need to prevent createElementNS from trying to parse `name` as a - // `qname`, so use an internal Document#_createElementNS() interface. - var elt = doc._createElementNS(name, ns, null); - if (attrs) { - for(var i = 0, n = attrs.length; i < n; i++) { - var attr = attrs[i]; - if (attr.length === 2) - elt._setAttribute(attr[0], attr[1]); - else { - elt._setAttributeNS(attr[2], attr[0], attr[1]); - } - } - } - return elt; - }); - } - - function lastElementOfType(type) { - for(var i = stack.elements.length-1; i >= 0; i--) { - if (stack.elements[i] instanceof type) { - return i; - } - } - return -1; - } - - function fosterParent(eltFunc) { - var parent, before, lastTable = -1, lastTemplate = -1, elt; - - lastTable = lastElementOfType(impl.HTMLTableElement); - lastTemplate = lastElementOfType(impl.HTMLTemplateElement); - - if (lastTemplate >= 0 && (lastTable < 0 || lastTemplate > lastTable)) { - parent = stack.elements[lastTemplate]; - } else if (lastTable >= 0) { - parent = stack.elements[lastTable].parentNode; - if (parent) { - before = stack.elements[lastTable]; - } else { - parent = stack.elements[lastTable - 1]; - } - } - if (!parent) parent = stack.elements[0]; // the `html` element. - - // "If the adjusted insertion location is inside a template element, - // let it instead be inside the template element's template contents" - if (parent instanceof impl.HTMLTemplateElement) { - parent = parent.content; - } - // Create element in the appropriate document. - elt = eltFunc(parent.ownerDocument); - - if (elt.nodeType === Node.TEXT_NODE) { - var prev; - if (before) prev = before.previousSibling; - else prev = parent.lastChild; - if (prev && prev.nodeType === Node.TEXT_NODE) { - prev.appendData(elt.data); - return elt; - } - } - if (before) - parent.insertBefore(elt, before); - else - parent._appendChild(elt); - return elt; - } - - - function resetInsertionMode() { - var last = false; - for(var i = stack.elements.length-1; i >= 0; i--) { - var node = stack.elements[i]; - if (i === 0) { - last = true; - if (fragment) { - node = fragmentContext; - } - } - if (node.namespaceURI === NAMESPACE.HTML) { - var tag = node.localName; - switch(tag) { - case "select": - for(var j = i; j > 0; ) { - var ancestor = stack.elements[--j]; - if (ancestor instanceof impl.HTMLTemplateElement) { - break; - } else if (ancestor instanceof impl.HTMLTableElement) { - parser = in_select_in_table_mode; - return; - } - } - parser = in_select_mode; - return; - case "tr": - parser = in_row_mode; - return; - case "tbody": - case "tfoot": - case "thead": - parser = in_table_body_mode; - return; - case "caption": - parser = in_caption_mode; - return; - case "colgroup": - parser = in_column_group_mode; - return; - case "table": - parser = in_table_mode; - return; - case "template": - parser = templateInsertionModes[templateInsertionModes.length-1]; - return; - case "body": - parser = in_body_mode; - return; - case "frameset": - parser = in_frameset_mode; - return; - case "html": - if (head_element_pointer === null) { - parser = before_head_mode; - } else { - parser = after_head_mode; - } - return; - default: - if (!last) { - if (tag === "head") { - parser = in_head_mode; - return; - } - if (tag === "td" || tag === "th") { - parser = in_cell_mode; - return; - } - } - } - } - if (last) { - parser = in_body_mode; - return; - } - } - } - - - function parseRawText(name, attrs) { - insertHTMLElement(name, attrs); - tokenizer = rawtext_state; - originalInsertionMode = parser; - parser = text_mode; - } - - function parseRCDATA(name, attrs) { - insertHTMLElement(name, attrs); - tokenizer = rcdata_state; - originalInsertionMode = parser; - parser = text_mode; - } - - // Make a copy of element i on the list of active formatting - // elements, using its original attributes, not current - // attributes (which may have been modified by a script) - function afeclone(doc, i) { - return { - elt: createHTMLElt(doc, afe.list[i].localName, afe.attrs[i]), - attrs: afe.attrs[i], - }; - } - - - function afereconstruct() { - if (afe.list.length === 0) return; - var entry = afe.list[afe.list.length-1]; - // If the last is a marker , do nothing - if (entry === afe.MARKER) return; - // Or if it is an open element, do nothing - if (stack.elements.lastIndexOf(entry) !== -1) return; - - // Loop backward through the list until we find a marker or an - // open element, and then move forward one from there. - for(var i = afe.list.length-2; i >= 0; i--) { - entry = afe.list[i]; - if (entry === afe.MARKER) break; - if (stack.elements.lastIndexOf(entry) !== -1) break; - } - - // Now loop forward, starting from the element after the current - // one, recreating formatting elements and pushing them back onto - // the list of open elements - for(i = i+1; i < afe.list.length; i++) { - var newelt = insertElement(function(doc) { return afeclone(doc, i).elt; }); - afe.list[i] = newelt; - } - } - - // Used by the adoptionAgency() function - var BOOKMARK = {localName:"BM"}; - - function adoptionAgency(tag) { - // If the current node is an HTML element whose tag name is subject, - // and the current node is not in the list of active formatting - // elements, then pop the current node off the stack of open - // elements and abort these steps. - if (isA(stack.top, tag) && afe.indexOf(stack.top) === -1) { - stack.pop(); - return true; // no more handling required - } - - // Let outer loop counter be zero. - var outer = 0; - - // Outer loop: If outer loop counter is greater than or - // equal to eight, then abort these steps. - while(outer < 8) { - // Increment outer loop counter by one. - outer++; - - // Let the formatting element be the last element in the list - // of active formatting elements that: is between the end of - // the list and the last scope marker in the list, if any, or - // the start of the list otherwise, and has the same tag name - // as the token. - var fmtelt = afe.findElementByTag(tag); - - // If there is no such node, then abort these steps and instead - // act as described in the "any other end tag" entry below. - if (!fmtelt) { - return false; // false means handle by the default case - } - - // Otherwise, if there is such a node, but that node is not in - // the stack of open elements, then this is a parse error; - // remove the element from the list, and abort these steps. - var index = stack.elements.lastIndexOf(fmtelt); - if (index === -1) { - afe.remove(fmtelt); - return true; // true means no more handling required - } - - // Otherwise, if there is such a node, and that node is also in - // the stack of open elements, but the element is not in scope, - // then this is a parse error; ignore the token, and abort - // these steps. - if (!stack.elementInScope(fmtelt)) { - return true; - } - - // Let the furthest block be the topmost node in the stack of - // open elements that is lower in the stack than the formatting - // element, and is an element in the special category. There - // might not be one. - var furthestblock = null, furthestblockindex; - for(var i = index+1; i < stack.elements.length; i++) { - if (isA(stack.elements[i], specialSet)) { - furthestblock = stack.elements[i]; - furthestblockindex = i; - break; - } - } - - // If there is no furthest block, then the UA must skip the - // subsequent steps and instead just pop all the nodes from the - // bottom of the stack of open elements, from the current node - // up to and including the formatting element, and remove the - // formatting element from the list of active formatting - // elements. - if (!furthestblock) { - stack.popElement(fmtelt); - afe.remove(fmtelt); - return true; - } - else { - // Let the common ancestor be the element immediately above - // the formatting element in the stack of open elements. - var ancestor = stack.elements[index-1]; - - // Let a bookmark note the position of the formatting - // element in the list of active formatting elements - // relative to the elements on either side of it in the - // list. - afe.insertAfter(fmtelt, BOOKMARK); - - // Let node and last node be the furthest block. - var node = furthestblock; - var lastnode = furthestblock; - var nodeindex = furthestblockindex; - var nodeafeindex; - - // Let inner loop counter be zero. - var inner = 0; - - while (true) { - - // Increment inner loop counter by one. - inner++; - - // Let node be the element immediately above node in - // the stack of open elements, or if node is no longer - // in the stack of open elements (e.g. because it got - // removed by this algorithm), the element that was - // immediately above node in the stack of open elements - // before node was removed. - node = stack.elements[--nodeindex]; - - // If node is the formatting element, then go - // to the next step in the overall algorithm. - if (node === fmtelt) break; - - // If the inner loop counter is greater than three and node - // is in the list of active formatting elements, then remove - // node from the list of active formatting elements. - nodeafeindex = afe.indexOf(node); - if (inner > 3 && nodeafeindex !== -1) { - afe.remove(node); - nodeafeindex = -1; - } - - // If node is not in the list of active formatting - // elements, then remove node from the stack of open - // elements and then go back to the step labeled inner - // loop. - if (nodeafeindex === -1) { - stack.removeElement(node); - continue; - } - - // Create an element for the token for which the - // element node was created with common ancestor as - // the intended parent, replace the entry for node - // in the list of active formatting elements with an - // entry for the new element, replace the entry for - // node in the stack of open elements with an entry for - // the new element, and let node be the new element. - var newelt = afeclone(ancestor.ownerDocument, nodeafeindex); - afe.replace(node, newelt.elt, newelt.attrs); - stack.elements[nodeindex] = newelt.elt; - node = newelt.elt; - - // If last node is the furthest block, then move the - // aforementioned bookmark to be immediately after the - // new node in the list of active formatting elements. - if (lastnode === furthestblock) { - afe.remove(BOOKMARK); - afe.insertAfter(newelt.elt, BOOKMARK); - } - - // Insert last node into node, first removing it from - // its previous parent node if any. - node._appendChild(lastnode); - - // Let last node be node. - lastnode = node; - } - - // If the common ancestor node is a table, tbody, tfoot, - // thead, or tr element, then, foster parent whatever last - // node ended up being in the previous step, first removing - // it from its previous parent node if any. - if (foster_parent_mode && isA(ancestor, tablesectionrowSet)) { - fosterParent(function() { return lastnode; }); - } - // Otherwise, append whatever last node ended up being in - // the previous step to the common ancestor node, first - // removing it from its previous parent node if any. - else if (ancestor instanceof impl.HTMLTemplateElement) { - ancestor.content._appendChild(lastnode); - } else { - ancestor._appendChild(lastnode); - } - - // Create an element for the token for which the - // formatting element was created, with furthest block - // as the intended parent. - var newelt2 = afeclone(furthestblock.ownerDocument, afe.indexOf(fmtelt)); - - // Take all of the child nodes of the furthest block and - // append them to the element created in the last step. - while(furthestblock.hasChildNodes()) { - newelt2.elt._appendChild(furthestblock.firstChild); - } - - // Append that new element to the furthest block. - furthestblock._appendChild(newelt2.elt); - - // Remove the formatting element from the list of active - // formatting elements, and insert the new element into the - // list of active formatting elements at the position of - // the aforementioned bookmark. - afe.remove(fmtelt); - afe.replace(BOOKMARK, newelt2.elt, newelt2.attrs); - - // Remove the formatting element from the stack of open - // elements, and insert the new element into the stack of - // open elements immediately below the position of the - // furthest block in that stack. - stack.removeElement(fmtelt); - var pos = stack.elements.lastIndexOf(furthestblock); - stack.elements.splice(pos+1, 0, newelt2.elt); - } - } - - return true; - } - - // We do this when we get /script in in_text_mode - function handleScriptEnd() { - // XXX: - // This is just a stub implementation right now and doesn't run scripts. - // Getting this method right involves the event loop, URL resolution - // script fetching etc. For now I just want to be able to parse - // documents and test the parser. - - //var script = stack.top; - stack.pop(); - parser = originalInsertionMode; - //script._prepare(); - return; - - // XXX: here is what this method is supposed to do - - // Provide a stable state. - - // Let script be the current node (which will be a script - // element). - - // Pop the current node off the stack of open elements. - - // Switch the insertion mode to the original insertion mode. - - // Let the old insertion point have the same value as the current - // insertion point. Let the insertion point be just before the - // next input character. - - // Increment the parser's script nesting level by one. - - // Prepare the script. This might cause some script to execute, - // which might cause new characters to be inserted into the - // tokenizer, and might cause the tokenizer to output more tokens, - // resulting in a reentrant invocation of the parser. - - // Decrement the parser's script nesting level by one. If the - // parser's script nesting level is zero, then set the parser - // pause flag to false. - - // Let the insertion point have the value of the old insertion - // point. (In other words, restore the insertion point to its - // previous value. This value might be the "undefined" value.) - - // At this stage, if there is a pending parsing-blocking script, - // then: - - // If the script nesting level is not zero: - - // Set the parser pause flag to true, and abort the processing - // of any nested invocations of the tokenizer, yielding - // control back to the caller. (Tokenization will resume when - // the caller returns to the "outer" tree construction stage.) - - // The tree construction stage of this particular parser is - // being called reentrantly, say from a call to - // document.write(). - - // Otherwise: - - // Run these steps: - - // Let the script be the pending parsing-blocking - // script. There is no longer a pending - // parsing-blocking script. - - // Block the tokenizer for this instance of the HTML - // parser, such that the event loop will not run tasks - // that invoke the tokenizer. - - // If the parser's Document has a style sheet that is - // blocking scripts or the script's "ready to be - // parser-executed" flag is not set: spin the event - // loop until the parser's Document has no style sheet - // that is blocking scripts and the script's "ready to - // be parser-executed" flag is set. - - // Unblock the tokenizer for this instance of the HTML - // parser, such that tasks that invoke the tokenizer - // can again be run. - - // Let the insertion point be just before the next - // input character. - - // Increment the parser's script nesting level by one - // (it should be zero before this step, so this sets - // it to one). - - // Execute the script. - - // Decrement the parser's script nesting level by - // one. If the parser's script nesting level is zero - // (which it always should be at this point), then set - // the parser pause flag to false. - - // Let the insertion point be undefined again. - - // If there is once again a pending parsing-blocking - // script, then repeat these steps from step 1. - - - } - - function stopParsing() { - // XXX This is just a temporary implementation to get the parser working. - // A full implementation involves scripts and events and the event loop. - - // Remove the link from document to parser. - // This is instead of "set the insertion point to undefined". - // It means that document.write() can't write into the doc anymore. - delete doc._parser; - - stack.elements.length = 0; // pop everything off - - // If there is a window object associated with the document - // then trigger an load event on it - if (doc.defaultView) { - doc.defaultView.dispatchEvent(new impl.Event("load",{})); - } - - } - - /**** - * Tokenizer states - */ - - /** - * This file was partially mechanically generated from - * http://www.whatwg.org/specs/web-apps/current-work/multipage/tokenization.html - * - * After mechanical conversion, it was further converted from - * prose to JS by hand, but the intent is that it is a very - * faithful rendering of the HTML tokenization spec in - * JavaScript. - * - * It is not a goal of this tokenizer to detect or report - * parse errors. - * - * XXX The tokenizer is supposed to work with straight UTF32 - * codepoints. But I don't think it has any dependencies on - * any character outside of the BMP so I think it is safe to - * pass it UTF16 characters. I don't think it will ever change - * state in the middle of a surrogate pair. - */ - - /* - * Each state is represented by a function. For most states, the - * scanner simply passes the next character (as an integer - * codepoint) to the current state function and automatically - * consumes the character. If the state function can't process - * the character it can call pushback() to push it back to the - * scanner. - * - * Some states require lookahead, though. If a state function has - * a lookahead property, then it is invoked differently. In this - * case, the scanner invokes the function with 3 arguments: 1) the - * next codepoint 2) a string of lookahead text 3) a boolean that - * is true if the lookahead goes all the way to the EOF. (XXX - * actually maybe this third is not necessary... the lookahead - * could just include \uFFFF?) - * - * If the lookahead property of a state function is an integer, it - * specifies the number of characters required. If it is a string, - * then the scanner will scan for that string and return all - * characters up to and including that sequence, or up to EOF. If - * the lookahead property is a regexp, then the scanner will match - * the regexp at the current point and return the matching string. - * - * States that require lookahead are responsible for explicitly - * consuming the characters they process. They do this by - * incrementing nextchar by the number of processed characters. - */ - function reconsume(c, new_state) { - tokenizer = new_state; - nextchar--; // pushback - } - - function data_state(c) { - switch(c) { - case 0x0026: // AMPERSAND - return_state = data_state; - tokenizer = character_reference_state; - break; - case 0x003C: // LESS-THAN SIGN - if (emitSimpleTag()) // Shortcut for

,

, etc. - break; - tokenizer = tag_open_state; - break; - case 0x0000: // NULL - // Usually null characters emitted by the tokenizer will be - // ignored by the tree builder, but sometimes they'll be - // converted to \uFFFD. I don't want to have the search every - // string emitted to replace NULs, so I'll set a flag - // if I've emitted a NUL. - textrun.push(c); - textIncludesNUL = true; - break; - case -1: // EOF - emitEOF(); - break; - default: - // Instead of just pushing a single character and then - // coming back to the very same place, lookahead and - // emit everything we can at once. - /*jshint -W030 */ - emitCharsWhile(DATATEXT) || textrun.push(c); - break; - } - } - - function rcdata_state(c) { - // Save the open tag so we can find a matching close tag - switch(c) { - case 0x0026: // AMPERSAND - return_state = rcdata_state; - tokenizer = character_reference_state; - break; - case 0x003C: // LESS-THAN SIGN - tokenizer = rcdata_less_than_sign_state; - break; - case 0x0000: // NULL - textrun.push(0xFFFD); // REPLACEMENT CHARACTER - textIncludesNUL = true; - break; - case -1: // EOF - emitEOF(); - break; - default: - textrun.push(c); - break; - } - } - - function rawtext_state(c) { - switch(c) { - case 0x003C: // LESS-THAN SIGN - tokenizer = rawtext_less_than_sign_state; - break; - case 0x0000: // NULL - textrun.push(0xFFFD); // REPLACEMENT CHARACTER - break; - case -1: // EOF - emitEOF(); - break; - default: - /*jshint -W030 */ - emitCharsWhile(RAWTEXT) || textrun.push(c); - break; - } - } - - function script_data_state(c) { - switch(c) { - case 0x003C: // LESS-THAN SIGN - tokenizer = script_data_less_than_sign_state; - break; - case 0x0000: // NULL - textrun.push(0xFFFD); // REPLACEMENT CHARACTER - break; - case -1: // EOF - emitEOF(); - break; - default: - /*jshint -W030 */ - emitCharsWhile(RAWTEXT) || textrun.push(c); - break; - } - } - - function plaintext_state(c) { - switch(c) { - case 0x0000: // NULL - textrun.push(0xFFFD); // REPLACEMENT CHARACTER - break; - case -1: // EOF - emitEOF(); - break; - default: - /*jshint -W030 */ - emitCharsWhile(PLAINTEXT) || textrun.push(c); - break; - } - } - - function tag_open_state(c) { - switch(c) { - case 0x0021: // EXCLAMATION MARK - tokenizer = markup_declaration_open_state; - break; - case 0x002F: // SOLIDUS - tokenizer = end_tag_open_state; - break; - case 0x0041: // [A-Z] - case 0x0042:case 0x0043:case 0x0044:case 0x0045:case 0x0046: - case 0x0047:case 0x0048:case 0x0049:case 0x004A:case 0x004B: - case 0x004C:case 0x004D:case 0x004E:case 0x004F:case 0x0050: - case 0x0051:case 0x0052:case 0x0053:case 0x0054:case 0x0055: - case 0x0056:case 0x0057:case 0x0058:case 0x0059:case 0x005A: - case 0x0061: // [a-z] - case 0x0062:case 0x0063:case 0x0064:case 0x0065:case 0x0066: - case 0x0067:case 0x0068:case 0x0069:case 0x006A:case 0x006B: - case 0x006C:case 0x006D:case 0x006E:case 0x006F:case 0x0070: - case 0x0071:case 0x0072:case 0x0073:case 0x0074:case 0x0075: - case 0x0076:case 0x0077:case 0x0078:case 0x0079:case 0x007A: - beginTagName(); - reconsume(c, tag_name_state); - break; - case 0x003F: // QUESTION MARK - reconsume(c, bogus_comment_state); - break; - default: - textrun.push(0x003C); // LESS-THAN SIGN - reconsume(c, data_state); - break; - } - } - - function end_tag_open_state(c) { - switch(c) { - case 0x0041: // [A-Z] - case 0x0042:case 0x0043:case 0x0044:case 0x0045:case 0x0046: - case 0x0047:case 0x0048:case 0x0049:case 0x004A:case 0x004B: - case 0x004C:case 0x004D:case 0x004E:case 0x004F:case 0x0050: - case 0x0051:case 0x0052:case 0x0053:case 0x0054:case 0x0055: - case 0x0056:case 0x0057:case 0x0058:case 0x0059:case 0x005A: - case 0x0061: // [a-z] - case 0x0062:case 0x0063:case 0x0064:case 0x0065:case 0x0066: - case 0x0067:case 0x0068:case 0x0069:case 0x006A:case 0x006B: - case 0x006C:case 0x006D:case 0x006E:case 0x006F:case 0x0070: - case 0x0071:case 0x0072:case 0x0073:case 0x0074:case 0x0075: - case 0x0076:case 0x0077:case 0x0078:case 0x0079:case 0x007A: - beginEndTagName(); - reconsume(c, tag_name_state); - break; - case 0x003E: // GREATER-THAN SIGN - tokenizer = data_state; - break; - case -1: // EOF - textrun.push(0x003C); // LESS-THAN SIGN - textrun.push(0x002F); // SOLIDUS - emitEOF(); - break; - default: - reconsume(c, bogus_comment_state); - break; - } - } - - function tag_name_state(c) { - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE - tokenizer = before_attribute_name_state; - break; - case 0x002F: // SOLIDUS - tokenizer = self_closing_start_tag_state; - break; - case 0x003E: // GREATER-THAN SIGN - tokenizer = data_state; - emitTag(); - break; - case 0x0041: // [A-Z] - case 0x0042:case 0x0043:case 0x0044:case 0x0045:case 0x0046: - case 0x0047:case 0x0048:case 0x0049:case 0x004A:case 0x004B: - case 0x004C:case 0x004D:case 0x004E:case 0x004F:case 0x0050: - case 0x0051:case 0x0052:case 0x0053:case 0x0054:case 0x0055: - case 0x0056:case 0x0057:case 0x0058:case 0x0059:case 0x005A: - tagnamebuf += String.fromCharCode(c + 0x0020); - break; - case 0x0000: // NULL - tagnamebuf += String.fromCharCode(0xFFFD /* REPLACEMENT CHARACTER */); - break; - case -1: // EOF - emitEOF(); - break; - default: - tagnamebuf += getMatchingChars(TAGNAME); - break; - } - } - - function rcdata_less_than_sign_state(c) { - /* identical to the RAWTEXT less-than sign state, except s/RAWTEXT/RCDATA/g */ - if (c === 0x002F) { // SOLIDUS - beginTempBuf(); - tokenizer = rcdata_end_tag_open_state; - } - else { - textrun.push(0x003C); // LESS-THAN SIGN - reconsume(c, rcdata_state); - } - } - - function rcdata_end_tag_open_state(c) { - /* identical to the RAWTEXT (and Script data) end tag open state, except s/RAWTEXT/RCDATA/g */ - switch(c) { - case 0x0041: // [A-Z] - case 0x0042:case 0x0043:case 0x0044:case 0x0045:case 0x0046: - case 0x0047:case 0x0048:case 0x0049:case 0x004A:case 0x004B: - case 0x004C:case 0x004D:case 0x004E:case 0x004F:case 0x0050: - case 0x0051:case 0x0052:case 0x0053:case 0x0054:case 0x0055: - case 0x0056:case 0x0057:case 0x0058:case 0x0059:case 0x005A: - case 0x0061: // [a-z] - case 0x0062:case 0x0063:case 0x0064:case 0x0065:case 0x0066: - case 0x0067:case 0x0068:case 0x0069:case 0x006A:case 0x006B: - case 0x006C:case 0x006D:case 0x006E:case 0x006F:case 0x0070: - case 0x0071:case 0x0072:case 0x0073:case 0x0074:case 0x0075: - case 0x0076:case 0x0077:case 0x0078:case 0x0079:case 0x007A: - beginEndTagName(); - reconsume(c, rcdata_end_tag_name_state); - break; - default: - textrun.push(0x003C); // LESS-THAN SIGN - textrun.push(0x002F); // SOLIDUS - reconsume(c, rcdata_state); - break; - } - } - - function rcdata_end_tag_name_state(c) { - /* identical to the RAWTEXT (and Script data) end tag name state, except s/RAWTEXT/RCDATA/g */ - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE - if (appropriateEndTag(tagnamebuf)) { - tokenizer = before_attribute_name_state; - return; - } - break; - case 0x002F: // SOLIDUS - if (appropriateEndTag(tagnamebuf)) { - tokenizer = self_closing_start_tag_state; - return; - } - break; - case 0x003E: // GREATER-THAN SIGN - if (appropriateEndTag(tagnamebuf)) { - tokenizer = data_state; - emitTag(); - return; - } - break; - case 0x0041: // [A-Z] - case 0x0042:case 0x0043:case 0x0044:case 0x0045:case 0x0046: - case 0x0047:case 0x0048:case 0x0049:case 0x004A:case 0x004B: - case 0x004C:case 0x004D:case 0x004E:case 0x004F:case 0x0050: - case 0x0051:case 0x0052:case 0x0053:case 0x0054:case 0x0055: - case 0x0056:case 0x0057:case 0x0058:case 0x0059:case 0x005A: - - tagnamebuf += String.fromCharCode(c + 0x0020); - tempbuf.push(c); - return; - case 0x0061: // [a-z] - case 0x0062:case 0x0063:case 0x0064:case 0x0065:case 0x0066: - case 0x0067:case 0x0068:case 0x0069:case 0x006A:case 0x006B: - case 0x006C:case 0x006D:case 0x006E:case 0x006F:case 0x0070: - case 0x0071:case 0x0072:case 0x0073:case 0x0074:case 0x0075: - case 0x0076:case 0x0077:case 0x0078:case 0x0079:case 0x007A: - - tagnamebuf += String.fromCharCode(c); - tempbuf.push(c); - return; - default: - break; - } - - // If we don't return in one of the cases above, then this was not - // an appropriately matching close tag, so back out by emitting all - // the characters as text - textrun.push(0x003C); // LESS-THAN SIGN - textrun.push(0x002F); // SOLIDUS - pushAll(textrun, tempbuf); - reconsume(c, rcdata_state); - } - - function rawtext_less_than_sign_state(c) { - /* identical to the RCDATA less-than sign state, except s/RCDATA/RAWTEXT/g - */ - if (c === 0x002F) { // SOLIDUS - beginTempBuf(); - tokenizer = rawtext_end_tag_open_state; - } - else { - textrun.push(0x003C); // LESS-THAN SIGN - reconsume(c, rawtext_state); - } - } - - function rawtext_end_tag_open_state(c) { - /* identical to the RCDATA (and Script data) end tag open state, except s/RCDATA/RAWTEXT/g */ - switch(c) { - case 0x0041: // [A-Z] - case 0x0042:case 0x0043:case 0x0044:case 0x0045:case 0x0046: - case 0x0047:case 0x0048:case 0x0049:case 0x004A:case 0x004B: - case 0x004C:case 0x004D:case 0x004E:case 0x004F:case 0x0050: - case 0x0051:case 0x0052:case 0x0053:case 0x0054:case 0x0055: - case 0x0056:case 0x0057:case 0x0058:case 0x0059:case 0x005A: - case 0x0061: // [a-z] - case 0x0062:case 0x0063:case 0x0064:case 0x0065:case 0x0066: - case 0x0067:case 0x0068:case 0x0069:case 0x006A:case 0x006B: - case 0x006C:case 0x006D:case 0x006E:case 0x006F:case 0x0070: - case 0x0071:case 0x0072:case 0x0073:case 0x0074:case 0x0075: - case 0x0076:case 0x0077:case 0x0078:case 0x0079:case 0x007A: - beginEndTagName(); - reconsume(c, rawtext_end_tag_name_state); - break; - default: - textrun.push(0x003C); // LESS-THAN SIGN - textrun.push(0x002F); // SOLIDUS - reconsume(c, rawtext_state); - break; - } - } - - function rawtext_end_tag_name_state(c) { - /* identical to the RCDATA (and Script data) end tag name state, except s/RCDATA/RAWTEXT/g */ - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE - if (appropriateEndTag(tagnamebuf)) { - tokenizer = before_attribute_name_state; - return; - } - break; - case 0x002F: // SOLIDUS - if (appropriateEndTag(tagnamebuf)) { - tokenizer = self_closing_start_tag_state; - return; - } - break; - case 0x003E: // GREATER-THAN SIGN - if (appropriateEndTag(tagnamebuf)) { - tokenizer = data_state; - emitTag(); - return; - } - break; - case 0x0041: // [A-Z] - case 0x0042:case 0x0043:case 0x0044:case 0x0045:case 0x0046: - case 0x0047:case 0x0048:case 0x0049:case 0x004A:case 0x004B: - case 0x004C:case 0x004D:case 0x004E:case 0x004F:case 0x0050: - case 0x0051:case 0x0052:case 0x0053:case 0x0054:case 0x0055: - case 0x0056:case 0x0057:case 0x0058:case 0x0059:case 0x005A: - tagnamebuf += String.fromCharCode(c + 0x0020); - tempbuf.push(c); - return; - case 0x0061: // [a-z] - case 0x0062:case 0x0063:case 0x0064:case 0x0065:case 0x0066: - case 0x0067:case 0x0068:case 0x0069:case 0x006A:case 0x006B: - case 0x006C:case 0x006D:case 0x006E:case 0x006F:case 0x0070: - case 0x0071:case 0x0072:case 0x0073:case 0x0074:case 0x0075: - case 0x0076:case 0x0077:case 0x0078:case 0x0079:case 0x007A: - tagnamebuf += String.fromCharCode(c); - tempbuf.push(c); - return; - default: - break; - } - - // If we don't return in one of the cases above, then this was not - // an appropriately matching close tag, so back out by emitting all - // the characters as text - textrun.push(0x003C); // LESS-THAN SIGN - textrun.push(0x002F); // SOLIDUS - pushAll(textrun,tempbuf); - reconsume(c, rawtext_state); - } - - function script_data_less_than_sign_state(c) { - switch(c) { - case 0x002F: // SOLIDUS - beginTempBuf(); - tokenizer = script_data_end_tag_open_state; - break; - case 0x0021: // EXCLAMATION MARK - tokenizer = script_data_escape_start_state; - textrun.push(0x003C); // LESS-THAN SIGN - textrun.push(0x0021); // EXCLAMATION MARK - break; - default: - textrun.push(0x003C); // LESS-THAN SIGN - reconsume(c, script_data_state); - break; - } - } - - function script_data_end_tag_open_state(c) { - /* identical to the RCDATA (and RAWTEXT) end tag open state, except s/RCDATA/Script data/g */ - switch(c) { - case 0x0041: // [A-Z] - case 0x0042:case 0x0043:case 0x0044:case 0x0045:case 0x0046: - case 0x0047:case 0x0048:case 0x0049:case 0x004A:case 0x004B: - case 0x004C:case 0x004D:case 0x004E:case 0x004F:case 0x0050: - case 0x0051:case 0x0052:case 0x0053:case 0x0054:case 0x0055: - case 0x0056:case 0x0057:case 0x0058:case 0x0059:case 0x005A: - case 0x0061: // [a-z] - case 0x0062:case 0x0063:case 0x0064:case 0x0065:case 0x0066: - case 0x0067:case 0x0068:case 0x0069:case 0x006A:case 0x006B: - case 0x006C:case 0x006D:case 0x006E:case 0x006F:case 0x0070: - case 0x0071:case 0x0072:case 0x0073:case 0x0074:case 0x0075: - case 0x0076:case 0x0077:case 0x0078:case 0x0079:case 0x007A: - beginEndTagName(); - reconsume(c, script_data_end_tag_name_state); - break; - default: - textrun.push(0x003C); // LESS-THAN SIGN - textrun.push(0x002F); // SOLIDUS - reconsume(c, script_data_state); - break; - } - } - - function script_data_end_tag_name_state(c) { - /* identical to the RCDATA (and RAWTEXT) end tag name state, except s/RCDATA/Script data/g */ - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE - if (appropriateEndTag(tagnamebuf)) { - tokenizer = before_attribute_name_state; - return; - } - break; - case 0x002F: // SOLIDUS - if (appropriateEndTag(tagnamebuf)) { - tokenizer = self_closing_start_tag_state; - return; - } - break; - case 0x003E: // GREATER-THAN SIGN - if (appropriateEndTag(tagnamebuf)) { - tokenizer = data_state; - emitTag(); - return; - } - break; - case 0x0041: // [A-Z] - case 0x0042:case 0x0043:case 0x0044:case 0x0045:case 0x0046: - case 0x0047:case 0x0048:case 0x0049:case 0x004A:case 0x004B: - case 0x004C:case 0x004D:case 0x004E:case 0x004F:case 0x0050: - case 0x0051:case 0x0052:case 0x0053:case 0x0054:case 0x0055: - case 0x0056:case 0x0057:case 0x0058:case 0x0059:case 0x005A: - - tagnamebuf += String.fromCharCode(c + 0x0020); - tempbuf.push(c); - return; - case 0x0061: // [a-z] - case 0x0062:case 0x0063:case 0x0064:case 0x0065:case 0x0066: - case 0x0067:case 0x0068:case 0x0069:case 0x006A:case 0x006B: - case 0x006C:case 0x006D:case 0x006E:case 0x006F:case 0x0070: - case 0x0071:case 0x0072:case 0x0073:case 0x0074:case 0x0075: - case 0x0076:case 0x0077:case 0x0078:case 0x0079:case 0x007A: - - tagnamebuf += String.fromCharCode(c); - tempbuf.push(c); - return; - default: - break; - } - - // If we don't return in one of the cases above, then this was not - // an appropriately matching close tag, so back out by emitting all - // the characters as text - textrun.push(0x003C); // LESS-THAN SIGN - textrun.push(0x002F); // SOLIDUS - pushAll(textrun,tempbuf); - reconsume(c, script_data_state); - } - - function script_data_escape_start_state(c) { - if (c === 0x002D) { // HYPHEN-MINUS - tokenizer = script_data_escape_start_dash_state; - textrun.push(0x002D); // HYPHEN-MINUS - } - else { - reconsume(c, script_data_state); - } - } - - function script_data_escape_start_dash_state(c) { - if (c === 0x002D) { // HYPHEN-MINUS - tokenizer = script_data_escaped_dash_dash_state; - textrun.push(0x002D); // HYPHEN-MINUS - } - else { - reconsume(c, script_data_state); - } - } - - function script_data_escaped_state(c) { - switch(c) { - case 0x002D: // HYPHEN-MINUS - tokenizer = script_data_escaped_dash_state; - textrun.push(0x002D); // HYPHEN-MINUS - break; - case 0x003C: // LESS-THAN SIGN - tokenizer = script_data_escaped_less_than_sign_state; - break; - case 0x0000: // NULL - textrun.push(0xFFFD); // REPLACEMENT CHARACTER - break; - case -1: // EOF - emitEOF(); - break; - default: - textrun.push(c); - break; - } - } - - function script_data_escaped_dash_state(c) { - switch(c) { - case 0x002D: // HYPHEN-MINUS - tokenizer = script_data_escaped_dash_dash_state; - textrun.push(0x002D); // HYPHEN-MINUS - break; - case 0x003C: // LESS-THAN SIGN - tokenizer = script_data_escaped_less_than_sign_state; - break; - case 0x0000: // NULL - tokenizer = script_data_escaped_state; - textrun.push(0xFFFD); // REPLACEMENT CHARACTER - break; - case -1: // EOF - emitEOF(); - break; - default: - tokenizer = script_data_escaped_state; - textrun.push(c); - break; - } - } - - function script_data_escaped_dash_dash_state(c) { - switch(c) { - case 0x002D: // HYPHEN-MINUS - textrun.push(0x002D); // HYPHEN-MINUS - break; - case 0x003C: // LESS-THAN SIGN - tokenizer = script_data_escaped_less_than_sign_state; - break; - case 0x003E: // GREATER-THAN SIGN - tokenizer = script_data_state; - textrun.push(0x003E); // GREATER-THAN SIGN - break; - case 0x0000: // NULL - tokenizer = script_data_escaped_state; - textrun.push(0xFFFD); // REPLACEMENT CHARACTER - break; - case -1: // EOF - emitEOF(); - break; - default: - tokenizer = script_data_escaped_state; - textrun.push(c); - break; - } - } - - function script_data_escaped_less_than_sign_state(c) { - switch(c) { - case 0x002F: // SOLIDUS - beginTempBuf(); - tokenizer = script_data_escaped_end_tag_open_state; - break; - case 0x0041: // [A-Z] - case 0x0042:case 0x0043:case 0x0044:case 0x0045:case 0x0046: - case 0x0047:case 0x0048:case 0x0049:case 0x004A:case 0x004B: - case 0x004C:case 0x004D:case 0x004E:case 0x004F:case 0x0050: - case 0x0051:case 0x0052:case 0x0053:case 0x0054:case 0x0055: - case 0x0056:case 0x0057:case 0x0058:case 0x0059:case 0x005A: - case 0x0061: // [a-z] - case 0x0062:case 0x0063:case 0x0064:case 0x0065:case 0x0066: - case 0x0067:case 0x0068:case 0x0069:case 0x006A:case 0x006B: - case 0x006C:case 0x006D:case 0x006E:case 0x006F:case 0x0070: - case 0x0071:case 0x0072:case 0x0073:case 0x0074:case 0x0075: - case 0x0076:case 0x0077:case 0x0078:case 0x0079:case 0x007A: - beginTempBuf(); - textrun.push(0x003C); // LESS-THAN SIGN - reconsume(c, script_data_double_escape_start_state); - break; - default: - textrun.push(0x003C); // LESS-THAN SIGN - reconsume(c, script_data_escaped_state); - break; - } - } - - function script_data_escaped_end_tag_open_state(c) { - switch(c) { - case 0x0041: // [A-Z] - case 0x0042:case 0x0043:case 0x0044:case 0x0045:case 0x0046: - case 0x0047:case 0x0048:case 0x0049:case 0x004A:case 0x004B: - case 0x004C:case 0x004D:case 0x004E:case 0x004F:case 0x0050: - case 0x0051:case 0x0052:case 0x0053:case 0x0054:case 0x0055: - case 0x0056:case 0x0057:case 0x0058:case 0x0059:case 0x005A: - case 0x0061: // [a-z] - case 0x0062:case 0x0063:case 0x0064:case 0x0065:case 0x0066: - case 0x0067:case 0x0068:case 0x0069:case 0x006A:case 0x006B: - case 0x006C:case 0x006D:case 0x006E:case 0x006F:case 0x0070: - case 0x0071:case 0x0072:case 0x0073:case 0x0074:case 0x0075: - case 0x0076:case 0x0077:case 0x0078:case 0x0079:case 0x007A: - beginEndTagName(); - reconsume(c, script_data_escaped_end_tag_name_state); - break; - default: - textrun.push(0x003C); // LESS-THAN SIGN - textrun.push(0x002F); // SOLIDUS - reconsume(c, script_data_escaped_state); - break; - } - } - - function script_data_escaped_end_tag_name_state(c) { - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE - if (appropriateEndTag(tagnamebuf)) { - tokenizer = before_attribute_name_state; - return; - } - break; - case 0x002F: // SOLIDUS - if (appropriateEndTag(tagnamebuf)) { - tokenizer = self_closing_start_tag_state; - return; - } - break; - case 0x003E: // GREATER-THAN SIGN - if (appropriateEndTag(tagnamebuf)) { - tokenizer = data_state; - emitTag(); - return; - } - break; - case 0x0041: // [A-Z] - case 0x0042:case 0x0043:case 0x0044:case 0x0045:case 0x0046: - case 0x0047:case 0x0048:case 0x0049:case 0x004A:case 0x004B: - case 0x004C:case 0x004D:case 0x004E:case 0x004F:case 0x0050: - case 0x0051:case 0x0052:case 0x0053:case 0x0054:case 0x0055: - case 0x0056:case 0x0057:case 0x0058:case 0x0059:case 0x005A: - tagnamebuf += String.fromCharCode(c + 0x0020); - tempbuf.push(c); - return; - case 0x0061: // [a-z] - case 0x0062:case 0x0063:case 0x0064:case 0x0065:case 0x0066: - case 0x0067:case 0x0068:case 0x0069:case 0x006A:case 0x006B: - case 0x006C:case 0x006D:case 0x006E:case 0x006F:case 0x0070: - case 0x0071:case 0x0072:case 0x0073:case 0x0074:case 0x0075: - case 0x0076:case 0x0077:case 0x0078:case 0x0079:case 0x007A: - tagnamebuf += String.fromCharCode(c); - tempbuf.push(c); - return; - default: - break; - } - - // We get here in the default case, and if the closing tagname - // is not an appropriate tagname. - textrun.push(0x003C); // LESS-THAN SIGN - textrun.push(0x002F); // SOLIDUS - pushAll(textrun,tempbuf); - reconsume(c, script_data_escaped_state); - } - - function script_data_double_escape_start_state(c) { - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE - case 0x002F: // SOLIDUS - case 0x003E: // GREATER-THAN SIGN - if (buf2str(tempbuf) === "script") { - tokenizer = script_data_double_escaped_state; - } - else { - tokenizer = script_data_escaped_state; - } - textrun.push(c); - break; - case 0x0041: // [A-Z] - case 0x0042:case 0x0043:case 0x0044:case 0x0045:case 0x0046: - case 0x0047:case 0x0048:case 0x0049:case 0x004A:case 0x004B: - case 0x004C:case 0x004D:case 0x004E:case 0x004F:case 0x0050: - case 0x0051:case 0x0052:case 0x0053:case 0x0054:case 0x0055: - case 0x0056:case 0x0057:case 0x0058:case 0x0059:case 0x005A: - tempbuf.push(c + 0x0020); - textrun.push(c); - break; - case 0x0061: // [a-z] - case 0x0062:case 0x0063:case 0x0064:case 0x0065:case 0x0066: - case 0x0067:case 0x0068:case 0x0069:case 0x006A:case 0x006B: - case 0x006C:case 0x006D:case 0x006E:case 0x006F:case 0x0070: - case 0x0071:case 0x0072:case 0x0073:case 0x0074:case 0x0075: - case 0x0076:case 0x0077:case 0x0078:case 0x0079:case 0x007A: - tempbuf.push(c); - textrun.push(c); - break; - default: - reconsume(c, script_data_escaped_state); - break; - } - } - - function script_data_double_escaped_state(c) { - switch(c) { - case 0x002D: // HYPHEN-MINUS - tokenizer = script_data_double_escaped_dash_state; - textrun.push(0x002D); // HYPHEN-MINUS - break; - case 0x003C: // LESS-THAN SIGN - tokenizer = script_data_double_escaped_less_than_sign_state; - textrun.push(0x003C); // LESS-THAN SIGN - break; - case 0x0000: // NULL - textrun.push(0xFFFD); // REPLACEMENT CHARACTER - break; - case -1: // EOF - emitEOF(); - break; - default: - textrun.push(c); - break; - } - } - - function script_data_double_escaped_dash_state(c) { - switch(c) { - case 0x002D: // HYPHEN-MINUS - tokenizer = script_data_double_escaped_dash_dash_state; - textrun.push(0x002D); // HYPHEN-MINUS - break; - case 0x003C: // LESS-THAN SIGN - tokenizer = script_data_double_escaped_less_than_sign_state; - textrun.push(0x003C); // LESS-THAN SIGN - break; - case 0x0000: // NULL - tokenizer = script_data_double_escaped_state; - textrun.push(0xFFFD); // REPLACEMENT CHARACTER - break; - case -1: // EOF - emitEOF(); - break; - default: - tokenizer = script_data_double_escaped_state; - textrun.push(c); - break; - } - } - - function script_data_double_escaped_dash_dash_state(c) { - switch(c) { - case 0x002D: // HYPHEN-MINUS - textrun.push(0x002D); // HYPHEN-MINUS - break; - case 0x003C: // LESS-THAN SIGN - tokenizer = script_data_double_escaped_less_than_sign_state; - textrun.push(0x003C); // LESS-THAN SIGN - break; - case 0x003E: // GREATER-THAN SIGN - tokenizer = script_data_state; - textrun.push(0x003E); // GREATER-THAN SIGN - break; - case 0x0000: // NULL - tokenizer = script_data_double_escaped_state; - textrun.push(0xFFFD); // REPLACEMENT CHARACTER - break; - case -1: // EOF - emitEOF(); - break; - default: - tokenizer = script_data_double_escaped_state; - textrun.push(c); - break; - } - } - - function script_data_double_escaped_less_than_sign_state(c) { - if (c === 0x002F) { // SOLIDUS - beginTempBuf(); - tokenizer = script_data_double_escape_end_state; - textrun.push(0x002F); // SOLIDUS - } - else { - reconsume(c, script_data_double_escaped_state); - } - } - - function script_data_double_escape_end_state(c) { - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE - case 0x002F: // SOLIDUS - case 0x003E: // GREATER-THAN SIGN - if (buf2str(tempbuf) === "script") { - tokenizer = script_data_escaped_state; - } - else { - tokenizer = script_data_double_escaped_state; - } - textrun.push(c); - break; - case 0x0041: // [A-Z] - case 0x0042:case 0x0043:case 0x0044:case 0x0045:case 0x0046: - case 0x0047:case 0x0048:case 0x0049:case 0x004A:case 0x004B: - case 0x004C:case 0x004D:case 0x004E:case 0x004F:case 0x0050: - case 0x0051:case 0x0052:case 0x0053:case 0x0054:case 0x0055: - case 0x0056:case 0x0057:case 0x0058:case 0x0059:case 0x005A: - tempbuf.push(c + 0x0020); - textrun.push(c); - break; - case 0x0061: // [a-z] - case 0x0062:case 0x0063:case 0x0064:case 0x0065:case 0x0066: - case 0x0067:case 0x0068:case 0x0069:case 0x006A:case 0x006B: - case 0x006C:case 0x006D:case 0x006E:case 0x006F:case 0x0070: - case 0x0071:case 0x0072:case 0x0073:case 0x0074:case 0x0075: - case 0x0076:case 0x0077:case 0x0078:case 0x0079:case 0x007A: - tempbuf.push(c); - textrun.push(c); - break; - default: - reconsume(c, script_data_double_escaped_state); - break; - } - } - - function before_attribute_name_state(c) { - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE - /* Ignore the character. */ - break; - // For SOLIDUS, GREATER-THAN SIGN, and EOF, spec says "reconsume in - // the after attribute name state", but in our implementation that - // state always has an active attribute in attrnamebuf. Just clone - // the rules here, without the addAttribute business. - case 0x002F: // SOLIDUS - tokenizer = self_closing_start_tag_state; - break; - case 0x003E: // GREATER-THAN SIGN - tokenizer = data_state; - emitTag(); - break; - case -1: // EOF - emitEOF(); - break; - case 0x003D: // EQUALS SIGN - beginAttrName(); - attrnamebuf += String.fromCharCode(c); - tokenizer = attribute_name_state; - break; - default: - if (handleSimpleAttribute()) break; - beginAttrName(); - reconsume(c, attribute_name_state); - break; - } - } - - // beginAttrName() must have been called before this point - // There is an active attribute in attrnamebuf (but not attrvaluebuf) - function attribute_name_state(c) { - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE - case 0x002F: // SOLIDUS - case 0x003E: // GREATER-THAN SIGN - case -1: // EOF - reconsume(c, after_attribute_name_state); - break; - case 0x003D: // EQUALS SIGN - tokenizer = before_attribute_value_state; - break; - case 0x0041: // [A-Z] - case 0x0042:case 0x0043:case 0x0044:case 0x0045:case 0x0046: - case 0x0047:case 0x0048:case 0x0049:case 0x004A:case 0x004B: - case 0x004C:case 0x004D:case 0x004E:case 0x004F:case 0x0050: - case 0x0051:case 0x0052:case 0x0053:case 0x0054:case 0x0055: - case 0x0056:case 0x0057:case 0x0058:case 0x0059:case 0x005A: - attrnamebuf += String.fromCharCode(c + 0x0020); - break; - case 0x0000: // NULL - attrnamebuf += String.fromCharCode(0xFFFD /* REPLACEMENT CHARACTER */); - break; - case 0x0022: // QUOTATION MARK - case 0x0027: // APOSTROPHE - case 0x003C: // LESS-THAN SIGN - /* falls through */ - default: - attrnamebuf += getMatchingChars(ATTRNAME); - break; - } - } - - // There is an active attribute in attrnamebuf, but not yet in attrvaluebuf. - function after_attribute_name_state(c) { - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE - /* Ignore the character. */ - break; - case 0x002F: // SOLIDUS - // Keep in sync with before_attribute_name_state. - addAttribute(attrnamebuf); - tokenizer = self_closing_start_tag_state; - break; - case 0x003D: // EQUALS SIGN - tokenizer = before_attribute_value_state; - break; - case 0x003E: // GREATER-THAN SIGN - // Keep in sync with before_attribute_name_state. - tokenizer = data_state; - addAttribute(attrnamebuf); - emitTag(); - break; - case -1: // EOF - // Keep in sync with before_attribute_name_state. - addAttribute(attrnamebuf); - emitEOF(); - break; - default: - addAttribute(attrnamebuf); - beginAttrName(); - reconsume(c, attribute_name_state); - break; - } - } - - function before_attribute_value_state(c) { - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE - /* Ignore the character. */ - break; - case 0x0022: // QUOTATION MARK - beginAttrValue(); - tokenizer = attribute_value_double_quoted_state; - break; - case 0x0027: // APOSTROPHE - beginAttrValue(); - tokenizer = attribute_value_single_quoted_state; - break; - case 0x003E: // GREATER-THAN SIGN - /* falls through */ - default: - beginAttrValue(); - reconsume(c, attribute_value_unquoted_state); - break; - } - } - - function attribute_value_double_quoted_state(c) { - switch(c) { - case 0x0022: // QUOTATION MARK - addAttribute(attrnamebuf, attrvaluebuf); - tokenizer = after_attribute_value_quoted_state; - break; - case 0x0026: // AMPERSAND - return_state = attribute_value_double_quoted_state; - tokenizer = character_reference_state; - break; - case 0x0000: // NULL - attrvaluebuf += String.fromCharCode(0xFFFD /* REPLACEMENT CHARACTER */); - break; - case -1: // EOF - emitEOF(); - break; - case 0x000A: // LF - // this could be a converted \r, so don't use getMatchingChars - attrvaluebuf += String.fromCharCode(c); - break; - default: - attrvaluebuf += getMatchingChars(DBLQUOTEATTRVAL); - break; - } - } - - function attribute_value_single_quoted_state(c) { - switch(c) { - case 0x0027: // APOSTROPHE - addAttribute(attrnamebuf, attrvaluebuf); - tokenizer = after_attribute_value_quoted_state; - break; - case 0x0026: // AMPERSAND - return_state = attribute_value_single_quoted_state; - tokenizer = character_reference_state; - break; - case 0x0000: // NULL - attrvaluebuf += String.fromCharCode(0xFFFD /* REPLACEMENT CHARACTER */); - break; - case -1: // EOF - emitEOF(); - break; - case 0x000A: // LF - // this could be a converted \r, so don't use getMatchingChars - attrvaluebuf += String.fromCharCode(c); - break; - default: - attrvaluebuf += getMatchingChars(SINGLEQUOTEATTRVAL); - break; - } - } - - function attribute_value_unquoted_state(c) { - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE - addAttribute(attrnamebuf, attrvaluebuf); - tokenizer = before_attribute_name_state; - break; - case 0x0026: // AMPERSAND - return_state = attribute_value_unquoted_state; - tokenizer = character_reference_state; - break; - case 0x003E: // GREATER-THAN SIGN - addAttribute(attrnamebuf, attrvaluebuf); - tokenizer = data_state; - emitTag(); - break; - case 0x0000: // NULL - attrvaluebuf += String.fromCharCode(0xFFFD /* REPLACEMENT CHARACTER */); - break; - case -1: // EOF - nextchar--; // pushback - tokenizer = data_state; - break; - case 0x0022: // QUOTATION MARK - case 0x0027: // APOSTROPHE - case 0x003C: // LESS-THAN SIGN - case 0x003D: // EQUALS SIGN - case 0x0060: // GRAVE ACCENT - /* falls through */ - default: - attrvaluebuf += getMatchingChars(UNQUOTEDATTRVAL); - break; - } - } - - function after_attribute_value_quoted_state(c) { - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE - tokenizer = before_attribute_name_state; - break; - case 0x002F: // SOLIDUS - tokenizer = self_closing_start_tag_state; - break; - case 0x003E: // GREATER-THAN SIGN - tokenizer = data_state; - emitTag(); - break; - case -1: // EOF - emitEOF(); - break; - default: - reconsume(c, before_attribute_name_state); - break; - } - } - - function self_closing_start_tag_state(c) { - switch(c) { - case 0x003E: // GREATER-THAN SIGN - // Set the self-closing flag of the current tag token. - tokenizer = data_state; - emitSelfClosingTag(true); - break; - case -1: // EOF - emitEOF(); - break; - default: - reconsume(c, before_attribute_name_state); - break; - } - } - - function bogus_comment_state(c, lookahead, eof) { - var len = lookahead.length; - - if (eof) { - nextchar += len-1; // don't consume the eof - } - else { - nextchar += len; - } - - var comment = lookahead.substring(0, len-1); - - comment = comment.replace(/\u0000/g,"\uFFFD"); - comment = comment.replace(/\u000D\u000A/g,"\u000A"); - comment = comment.replace(/\u000D/g,"\u000A"); - - insertToken(COMMENT, comment); - tokenizer = data_state; - } - bogus_comment_state.lookahead = ">"; - - function markup_declaration_open_state(c, lookahead, eof) { - if (lookahead[0] === "-" && lookahead[1] === "-") { - nextchar += 2; - beginComment(); - tokenizer = comment_start_state; - return; - } - - if (lookahead.toUpperCase() === "DOCTYPE") { - nextchar += 7; - tokenizer = doctype_state; - } - else if (lookahead === "[CDATA[" && cdataAllowed()) { - nextchar += 7; - tokenizer = cdata_section_state; - } - else { - tokenizer = bogus_comment_state; - } - } - markup_declaration_open_state.lookahead = 7; - - function comment_start_state(c) { - beginComment(); - switch(c) { - case 0x002D: // HYPHEN-MINUS - tokenizer = comment_start_dash_state; - break; - case 0x003E: // GREATER-THAN SIGN - tokenizer = data_state; - insertToken(COMMENT, buf2str(commentbuf)); - break; /* see comment in comment end state */ - default: - reconsume(c, comment_state); - break; - } - } - - function comment_start_dash_state(c) { - switch(c) { - case 0x002D: // HYPHEN-MINUS - tokenizer = comment_end_state; - break; - case 0x003E: // GREATER-THAN SIGN - tokenizer = data_state; - insertToken(COMMENT, buf2str(commentbuf)); - break; - case -1: // EOF - insertToken(COMMENT, buf2str(commentbuf)); - emitEOF(); - break; /* see comment in comment end state */ - default: - commentbuf.push(0x002D /* HYPHEN-MINUS */); - reconsume(c, comment_state); - break; - } - } - - function comment_state(c) { - switch(c) { - case 0x003C: // LESS-THAN SIGN - commentbuf.push(c); - tokenizer = comment_less_than_sign_state; - break; - case 0x002D: // HYPHEN-MINUS - tokenizer = comment_end_dash_state; - break; - case 0x0000: // NULL - commentbuf.push(0xFFFD /* REPLACEMENT CHARACTER */); - break; - case -1: // EOF - insertToken(COMMENT, buf2str(commentbuf)); - emitEOF(); - break; /* see comment in comment end state */ - default: - commentbuf.push(c); - break; - } - } - - function comment_less_than_sign_state(c) { - switch(c) { - case 0x0021: // EXCLAMATION MARK - commentbuf.push(c); - tokenizer = comment_less_than_sign_bang_state; - break; - case 0x003C: // LESS-THAN SIGN - commentbuf.push(c); - break; - default: - reconsume(c, comment_state); - break; - } - } - - function comment_less_than_sign_bang_state(c) { - switch(c) { - case 0x002D: // HYPHEN-MINUS - tokenizer = comment_less_than_sign_bang_dash_state; - break; - default: - reconsume(c, comment_state); - break; - } - } - - function comment_less_than_sign_bang_dash_state(c) { - switch(c) { - case 0x002D: // HYPHEN-MINUS - tokenizer = comment_less_than_sign_bang_dash_dash_state; - break; - default: - reconsume(c, comment_end_dash_state); - break; - } - } - - function comment_less_than_sign_bang_dash_dash_state(c) { - switch(c) { - case 0x003E: // GREATER-THAN SIGN - case -1: // EOF - reconsume(c, comment_end_state); - break; - default: - // parse error - reconsume(c, comment_end_state); - break; - } - } - - function comment_end_dash_state(c) { - switch(c) { - case 0x002D: // HYPHEN-MINUS - tokenizer = comment_end_state; - break; - case -1: // EOF - insertToken(COMMENT, buf2str(commentbuf)); - emitEOF(); - break; /* see comment in comment end state */ - default: - commentbuf.push(0x002D /* HYPHEN-MINUS */); - reconsume(c, comment_state); - break; - } - } - - function comment_end_state(c) { - switch(c) { - case 0x003E: // GREATER-THAN SIGN - tokenizer = data_state; - insertToken(COMMENT, buf2str(commentbuf)); - break; - case 0x0021: // EXCLAMATION MARK - tokenizer = comment_end_bang_state; - break; - case 0x002D: // HYPHEN-MINUS - commentbuf.push(0x002D); - break; - case -1: // EOF - insertToken(COMMENT, buf2str(commentbuf)); - emitEOF(); - break; /* For security reasons: otherwise, hostile user could put a script in a comment e.g. in a blog comment and then DOS the server so that the end tag isn't read, and then the commented script tag would be treated as live code */ - default: - commentbuf.push(0x002D); - commentbuf.push(0x002D); - reconsume(c, comment_state); - break; - } - } - - function comment_end_bang_state(c) { - switch(c) { - case 0x002D: // HYPHEN-MINUS - commentbuf.push(0x002D); - commentbuf.push(0x002D); - commentbuf.push(0x0021); - tokenizer = comment_end_dash_state; - break; - case 0x003E: // GREATER-THAN SIGN - tokenizer = data_state; - insertToken(COMMENT, buf2str(commentbuf)); - break; - case -1: // EOF - insertToken(COMMENT, buf2str(commentbuf)); - emitEOF(); - break; /* see comment in comment end state */ - default: - commentbuf.push(0x002D); - commentbuf.push(0x002D); - commentbuf.push(0x0021); - reconsume(c, comment_state); - break; - } - } - - function doctype_state(c) { - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE - tokenizer = before_doctype_name_state; - break; - case -1: // EOF - beginDoctype(); - forcequirks(); - emitDoctype(); - emitEOF(); - break; - default: - reconsume(c, before_doctype_name_state); - break; - } - } - - function before_doctype_name_state(c) { - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE - /* Ignore the character. */ - break; - case 0x0041: // [A-Z] - case 0x0042:case 0x0043:case 0x0044:case 0x0045:case 0x0046: - case 0x0047:case 0x0048:case 0x0049:case 0x004A:case 0x004B: - case 0x004C:case 0x004D:case 0x004E:case 0x004F:case 0x0050: - case 0x0051:case 0x0052:case 0x0053:case 0x0054:case 0x0055: - case 0x0056:case 0x0057:case 0x0058:case 0x0059:case 0x005A: - beginDoctype(); - doctypenamebuf.push(c + 0x0020); - tokenizer = doctype_name_state; - break; - case 0x0000: // NULL - beginDoctype(); - doctypenamebuf.push(0xFFFD); - tokenizer = doctype_name_state; - break; - case 0x003E: // GREATER-THAN SIGN - beginDoctype(); - forcequirks(); - tokenizer = data_state; - emitDoctype(); - break; - case -1: // EOF - beginDoctype(); - forcequirks(); - emitDoctype(); - emitEOF(); - break; - default: - beginDoctype(); - doctypenamebuf.push(c); - tokenizer = doctype_name_state; - break; - } - } - - function doctype_name_state(c) { - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE - tokenizer = after_doctype_name_state; - break; - case 0x003E: // GREATER-THAN SIGN - tokenizer = data_state; - emitDoctype(); - break; - case 0x0041: // [A-Z] - case 0x0042:case 0x0043:case 0x0044:case 0x0045:case 0x0046: - case 0x0047:case 0x0048:case 0x0049:case 0x004A:case 0x004B: - case 0x004C:case 0x004D:case 0x004E:case 0x004F:case 0x0050: - case 0x0051:case 0x0052:case 0x0053:case 0x0054:case 0x0055: - case 0x0056:case 0x0057:case 0x0058:case 0x0059:case 0x005A: - doctypenamebuf.push(c + 0x0020); - break; - case 0x0000: // NULL - doctypenamebuf.push(0xFFFD /* REPLACEMENT CHARACTER */); - break; - case -1: // EOF - forcequirks(); - emitDoctype(); - emitEOF(); - break; - default: - doctypenamebuf.push(c); - break; - } - } - - function after_doctype_name_state(c, lookahead, eof) { - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE - /* Ignore the character. */ - nextchar += 1; - break; - case 0x003E: // GREATER-THAN SIGN - tokenizer = data_state; - nextchar += 1; - emitDoctype(); - break; - case -1: // EOF - forcequirks(); - emitDoctype(); - emitEOF(); - break; - default: - lookahead = lookahead.toUpperCase(); - if (lookahead === "PUBLIC") { - nextchar += 6; - tokenizer = after_doctype_public_keyword_state; - } - else if (lookahead === "SYSTEM") { - nextchar += 6; - tokenizer = after_doctype_system_keyword_state; - } - else { - forcequirks(); - tokenizer = bogus_doctype_state; - } - break; - } - } - after_doctype_name_state.lookahead = 6; - - function after_doctype_public_keyword_state(c) { - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE - tokenizer = before_doctype_public_identifier_state; - break; - case 0x0022: // QUOTATION MARK - beginDoctypePublicId(); - tokenizer = doctype_public_identifier_double_quoted_state; - break; - case 0x0027: // APOSTROPHE - beginDoctypePublicId(); - tokenizer = doctype_public_identifier_single_quoted_state; - break; - case 0x003E: // GREATER-THAN SIGN - forcequirks(); - tokenizer = data_state; - emitDoctype(); - break; - case -1: // EOF - forcequirks(); - emitDoctype(); - emitEOF(); - break; - default: - forcequirks(); - tokenizer = bogus_doctype_state; - break; - } - } - - function before_doctype_public_identifier_state(c) { - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE - /* Ignore the character. */ - break; - case 0x0022: // QUOTATION MARK - beginDoctypePublicId(); - tokenizer = doctype_public_identifier_double_quoted_state; - break; - case 0x0027: // APOSTROPHE - beginDoctypePublicId(); - tokenizer = doctype_public_identifier_single_quoted_state; - break; - case 0x003E: // GREATER-THAN SIGN - forcequirks(); - tokenizer = data_state; - emitDoctype(); - break; - case -1: // EOF - forcequirks(); - emitDoctype(); - emitEOF(); - break; - default: - forcequirks(); - tokenizer = bogus_doctype_state; - break; - } - } - - function doctype_public_identifier_double_quoted_state(c) { - switch(c) { - case 0x0022: // QUOTATION MARK - tokenizer = after_doctype_public_identifier_state; - break; - case 0x0000: // NULL - doctypepublicbuf.push(0xFFFD /* REPLACEMENT CHARACTER */); - break; - case 0x003E: // GREATER-THAN SIGN - forcequirks(); - tokenizer = data_state; - emitDoctype(); - break; - case -1: // EOF - forcequirks(); - emitDoctype(); - emitEOF(); - break; - default: - doctypepublicbuf.push(c); - break; - } - } - - function doctype_public_identifier_single_quoted_state(c) { - switch(c) { - case 0x0027: // APOSTROPHE - tokenizer = after_doctype_public_identifier_state; - break; - case 0x0000: // NULL - doctypepublicbuf.push(0xFFFD /* REPLACEMENT CHARACTER */); - break; - case 0x003E: // GREATER-THAN SIGN - forcequirks(); - tokenizer = data_state; - emitDoctype(); - break; - case -1: // EOF - forcequirks(); - emitDoctype(); - emitEOF(); - break; - default: - doctypepublicbuf.push(c); - break; - } - } - - function after_doctype_public_identifier_state(c) { - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE - tokenizer = between_doctype_public_and_system_identifiers_state; - break; - case 0x003E: // GREATER-THAN SIGN - tokenizer = data_state; - emitDoctype(); - break; - case 0x0022: // QUOTATION MARK - beginDoctypeSystemId(); - tokenizer = doctype_system_identifier_double_quoted_state; - break; - case 0x0027: // APOSTROPHE - beginDoctypeSystemId(); - tokenizer = doctype_system_identifier_single_quoted_state; - break; - case -1: // EOF - forcequirks(); - emitDoctype(); - emitEOF(); - break; - default: - forcequirks(); - tokenizer = bogus_doctype_state; - break; - } - } - - function between_doctype_public_and_system_identifiers_state(c) { - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE Ignore the character. - break; - case 0x003E: // GREATER-THAN SIGN - tokenizer = data_state; - emitDoctype(); - break; - case 0x0022: // QUOTATION MARK - beginDoctypeSystemId(); - tokenizer = doctype_system_identifier_double_quoted_state; - break; - case 0x0027: // APOSTROPHE - beginDoctypeSystemId(); - tokenizer = doctype_system_identifier_single_quoted_state; - break; - case -1: // EOF - forcequirks(); - emitDoctype(); - emitEOF(); - break; - default: - forcequirks(); - tokenizer = bogus_doctype_state; - break; - } - } - - function after_doctype_system_keyword_state(c) { - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE - tokenizer = before_doctype_system_identifier_state; - break; - case 0x0022: // QUOTATION MARK - beginDoctypeSystemId(); - tokenizer = doctype_system_identifier_double_quoted_state; - break; - case 0x0027: // APOSTROPHE - beginDoctypeSystemId(); - tokenizer = doctype_system_identifier_single_quoted_state; - break; - case 0x003E: // GREATER-THAN SIGN - forcequirks(); - tokenizer = data_state; - emitDoctype(); - break; - case -1: // EOF - forcequirks(); - emitDoctype(); - emitEOF(); - break; - default: - forcequirks(); - tokenizer = bogus_doctype_state; - break; - } - } - - function before_doctype_system_identifier_state(c) { - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE Ignore the character. - break; - case 0x0022: // QUOTATION MARK - beginDoctypeSystemId(); - tokenizer = doctype_system_identifier_double_quoted_state; - break; - case 0x0027: // APOSTROPHE - beginDoctypeSystemId(); - tokenizer = doctype_system_identifier_single_quoted_state; - break; - case 0x003E: // GREATER-THAN SIGN - forcequirks(); - tokenizer = data_state; - emitDoctype(); - break; - case -1: // EOF - forcequirks(); - emitDoctype(); - emitEOF(); - break; - default: - forcequirks(); - tokenizer = bogus_doctype_state; - break; - } - } - - function doctype_system_identifier_double_quoted_state(c) { - switch(c) { - case 0x0022: // QUOTATION MARK - tokenizer = after_doctype_system_identifier_state; - break; - case 0x0000: // NULL - doctypesystembuf.push(0xFFFD /* REPLACEMENT CHARACTER */); - break; - case 0x003E: // GREATER-THAN SIGN - forcequirks(); - tokenizer = data_state; - emitDoctype(); - break; - case -1: // EOF - forcequirks(); - emitDoctype(); - emitEOF(); - break; - default: - doctypesystembuf.push(c); - break; - } - } - - function doctype_system_identifier_single_quoted_state(c) { - switch(c) { - case 0x0027: // APOSTROPHE - tokenizer = after_doctype_system_identifier_state; - break; - case 0x0000: // NULL - doctypesystembuf.push(0xFFFD /* REPLACEMENT CHARACTER */); - break; - case 0x003E: // GREATER-THAN SIGN - forcequirks(); - tokenizer = data_state; - emitDoctype(); - break; - case -1: // EOF - forcequirks(); - emitDoctype(); - emitEOF(); - break; - default: - doctypesystembuf.push(c); - break; - } - } - - function after_doctype_system_identifier_state(c) { - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE - /* Ignore the character. */ - break; - case 0x003E: // GREATER-THAN SIGN - tokenizer = data_state; - emitDoctype(); - break; - case -1: // EOF - forcequirks(); - emitDoctype(); - emitEOF(); - break; - default: - tokenizer = bogus_doctype_state; - /* This does *not* set the DOCTYPE token's force-quirks flag. */ - break; - } - } - - function bogus_doctype_state(c) { - switch(c) { - case 0x003E: // GREATER-THAN SIGN - tokenizer = data_state; - emitDoctype(); - break; - case -1: // EOF - emitDoctype(); - emitEOF(); - break; - default: - /* Ignore the character. */ - break; - } - } - - function cdata_section_state(c) { - switch(c) { - case 0x005D: // RIGHT SQUARE BRACKET - tokenizer = cdata_section_bracket_state; - break; - case -1: // EOF - emitEOF(); - break; - case 0x0000: // NULL - textIncludesNUL = true; - /* fall through */ - default: - // Instead of just pushing a single character and then - // coming back to the very same place, lookahead and - // emit everything we can at once. - /*jshint -W030 */ - emitCharsWhile(CDATATEXT) || textrun.push(c); - break; - } - } - - function cdata_section_bracket_state(c) { - switch(c) { - case 0x005D: // RIGHT SQUARE BRACKET - tokenizer = cdata_section_end_state; - break; - default: - textrun.push(0x005D); - reconsume(c, cdata_section_state); - break; - } - } - - function cdata_section_end_state(c) { - switch(c) { - case 0x005D: // RIGHT SQUARE BRACKET - textrun.push(0x005D); - break; - case 0x003E: // GREATER-THAN SIGN - flushText(); - tokenizer = data_state; - break; - default: - textrun.push(0x005D); - textrun.push(0x005D); - reconsume(c, cdata_section_state); - break; - } - } - - function character_reference_state(c) { - beginTempBuf(); - tempbuf.push(0x0026); - switch(c) { - case 0x0009: // TAB - case 0x000A: // LINE FEED - case 0x000C: // FORM FEED - case 0x0020: // SPACE - case 0x003C: // LESS-THAN SIGN - case 0x0026: // AMPERSAND - case -1: // EOF - reconsume(c, character_reference_end_state); - break; - case 0x0023: // NUMBER SIGN - tempbuf.push(c); - tokenizer = numeric_character_reference_state; - break; - default: - reconsume(c, named_character_reference_state); - break; - } - } - - function named_character_reference_state(c) { - NAMEDCHARREF.lastIndex = nextchar; // w/ lookahead no char has been consumed - var matched = NAMEDCHARREF.exec(chars); - if (!matched) throw new Error("should never happen"); - var name = matched[1]; - if (!name) { - // If no match can be made, switch to the character reference end state - tokenizer = character_reference_end_state; - return; - } - - // Consume the matched characters and append them to temporary buffer - nextchar += name.length; - pushAll(tempbuf, str2buf(name)); - - switch(return_state) { - case attribute_value_double_quoted_state: - case attribute_value_single_quoted_state: - case attribute_value_unquoted_state: - // If the character reference was consumed as part of an attribute... - if (name[name.length-1] !== ';') { // ...and the last char is not ; - if (/[=A-Za-z0-9]/.test(chars[nextchar])) { - tokenizer = character_reference_end_state; - return; - } - } - break; - default: - break; - } - - beginTempBuf(); - var rv = namedCharRefs[name]; - if (typeof rv === 'number') { - tempbuf.push(rv); - } else { - pushAll(tempbuf, rv); - } - tokenizer = character_reference_end_state; - } - // We might need to pause tokenization until we have enough characters - // in the buffer for longest possible character reference. - named_character_reference_state.lookahead = -NAMEDCHARREF_MAXLEN; - - function numeric_character_reference_state(c) { - character_reference_code = 0; - switch(c) { - case 0x0078: // x - case 0x0058: // X - tempbuf.push(c); - tokenizer = hexadecimal_character_reference_start_state; - break; - default: - reconsume(c, decimal_character_reference_start_state); - break; - } - } - - function hexadecimal_character_reference_start_state(c) { - switch(c) { - case 0x0030: case 0x0031: case 0x0032: case 0x0033: case 0x0034: - case 0x0035: case 0x0036: case 0x0037: case 0x0038: case 0x0039: // [0-9] - case 0x0041: case 0x0042: case 0x0043: case 0x0044: case 0x0045: - case 0x0046: // [A-F] - case 0x0061: case 0x0062: case 0x0063: case 0x0064: case 0x0065: - case 0x0066: // [a-f] - reconsume(c, hexadecimal_character_reference_state); - break; - default: - reconsume(c, character_reference_end_state); - break; - } - } - - function decimal_character_reference_start_state(c) { - switch(c) { - case 0x0030: case 0x0031: case 0x0032: case 0x0033: case 0x0034: - case 0x0035: case 0x0036: case 0x0037: case 0x0038: case 0x0039: // [0-9] - reconsume(c, decimal_character_reference_state); - break; - default: - reconsume(c, character_reference_end_state); - break; - } - } - - function hexadecimal_character_reference_state(c) { - switch(c) { - case 0x0041: case 0x0042: case 0x0043: case 0x0044: case 0x0045: - case 0x0046: // [A-F] - character_reference_code *= 16; - character_reference_code += (c - 0x0037); - break; - case 0x0061: case 0x0062: case 0x0063: case 0x0064: case 0x0065: - case 0x0066: // [a-f] - character_reference_code *= 16; - character_reference_code += (c - 0x0057); - break; - case 0x0030: case 0x0031: case 0x0032: case 0x0033: case 0x0034: - case 0x0035: case 0x0036: case 0x0037: case 0x0038: case 0x0039: // [0-9] - character_reference_code *= 16; - character_reference_code += (c - 0x0030); - break; - case 0x003B: // SEMICOLON - tokenizer = numeric_character_reference_end_state; - break; - default: - reconsume(c, numeric_character_reference_end_state); - break; - } - } - - function decimal_character_reference_state(c) { - switch(c) { - case 0x0030: case 0x0031: case 0x0032: case 0x0033: case 0x0034: - case 0x0035: case 0x0036: case 0x0037: case 0x0038: case 0x0039: // [0-9] - character_reference_code *= 10; - character_reference_code += (c - 0x0030); - break; - case 0x003B: // SEMICOLON - tokenizer = numeric_character_reference_end_state; - break; - default: - reconsume(c, numeric_character_reference_end_state); - break; - } - } - - function numeric_character_reference_end_state(c) { - if (character_reference_code in numericCharRefReplacements) { - character_reference_code = numericCharRefReplacements[character_reference_code]; - } else if (character_reference_code > 0x10FFFF || (character_reference_code >= 0xD800 && character_reference_code < 0xE000)) { - character_reference_code = 0xFFFD; - } - - beginTempBuf(); - if (character_reference_code <= 0xFFFF) { - tempbuf.push(character_reference_code); - } else { - character_reference_code = character_reference_code - 0x10000; - /* jshint bitwise: false */ - tempbuf.push(0xD800 + (character_reference_code >> 10)); - tempbuf.push(0xDC00 + (character_reference_code & 0x03FF)); - } - reconsume(c, character_reference_end_state); - } - - function character_reference_end_state(c) { - switch(return_state) { - case attribute_value_double_quoted_state: - case attribute_value_single_quoted_state: - case attribute_value_unquoted_state: - // append each character to the current attribute's value - attrvaluebuf += buf2str(tempbuf); - break; - default: - pushAll(textrun, tempbuf); - break; - } - reconsume(c, return_state); - } - - /*** - * The tree builder insertion modes - */ - - // 11.2.5.4.1 The "initial" insertion mode - function initial_mode(t, value, arg3, arg4) { - switch(t) { - case 1: // TEXT - value = value.replace(LEADINGWS, ""); // Ignore spaces - if (value.length === 0) return; // Are we done? - break; // Handle anything non-space text below - case 4: // COMMENT - doc._appendChild(doc.createComment(value)); - return; - case 5: // DOCTYPE - var name = value; - var publicid = arg3; - var systemid = arg4; - // Use the constructor directly instead of - // implementation.createDocumentType because the create - // function throws errors on invalid characters, and - // we don't want the parser to throw them. - doc.appendChild(new DocumentType(doc, name, publicid, systemid)); - - // Note that there is no public API for setting quirks mode We can - // do this here because we have access to implementation details - if (force_quirks || - name.toLowerCase() !== "html" || - quirkyPublicIds.test(publicid) || - (systemid && systemid.toLowerCase() === quirkySystemId) || - (systemid === undefined && - conditionallyQuirkyPublicIds.test(publicid))) - doc._quirks = true; - else if (limitedQuirkyPublicIds.test(publicid) || - (systemid !== undefined && - conditionallyQuirkyPublicIds.test(publicid))) - doc._limitedQuirks = true; - parser = before_html_mode; - return; - } - - // tags or non-whitespace text - doc._quirks = true; - parser = before_html_mode; - parser(t,value,arg3,arg4); - } - - // 11.2.5.4.2 The "before html" insertion mode - function before_html_mode(t,value,arg3,arg4) { - var elt; - switch(t) { - case 1: // TEXT - value = value.replace(LEADINGWS, ""); // Ignore spaces - if (value.length === 0) return; // Are we done? - break; // Handle anything non-space text below - case 5: // DOCTYPE - /* ignore the token */ - return; - case 4: // COMMENT - doc._appendChild(doc.createComment(value)); - return; - case 2: // TAG - if (value === "html") { - elt = createHTMLElt(doc, value, arg3); - stack.push(elt); - doc.appendChild(elt); - // XXX: handle application cache here - parser = before_head_mode; - return; - } - break; - case 3: // ENDTAG - switch(value) { - case "html": - case "head": - case "body": - case "br": - break; // fall through on these - default: - return; // ignore most end tags - } - } - - // Anything that didn't get handled above is handled like this: - elt = createHTMLElt(doc, "html", null); - stack.push(elt); - doc.appendChild(elt); - // XXX: handle application cache here - parser = before_head_mode; - parser(t,value,arg3,arg4); - } - - // 11.2.5.4.3 The "before head" insertion mode - function before_head_mode(t,value,arg3,arg4) { - switch(t) { - case 1: // TEXT - value = value.replace(LEADINGWS, ""); // Ignore spaces - if (value.length === 0) return; // Are we done? - break; // Handle anything non-space text below - case 5: // DOCTYPE - /* ignore the token */ - return; - case 4: // COMMENT - insertComment(value); - return; - case 2: // TAG - switch(value) { - case "html": - in_body_mode(t,value,arg3,arg4); - return; - case "head": - var elt = insertHTMLElement(value, arg3); - head_element_pointer = elt; - parser = in_head_mode; - return; - } - break; - case 3: // ENDTAG - switch(value) { - case "html": - case "head": - case "body": - case "br": - break; - default: - return; // ignore most end tags - } - } - - // If not handled explicitly above - before_head_mode(TAG, "head", null); // create a head tag - parser(t, value, arg3, arg4); // then try again with this token - } - - function in_head_mode(t, value, arg3, arg4) { - switch(t) { - case 1: // TEXT - var ws = value.match(LEADINGWS); - if (ws) { - insertText(ws[0]); - value = value.substring(ws[0].length); - } - if (value.length === 0) return; - break; // Handle non-whitespace below - case 4: // COMMENT - insertComment(value); - return; - case 5: // DOCTYPE - return; - case 2: // TAG - switch(value) { - case "html": - in_body_mode(t, value, arg3, arg4); - return; - case "meta": - // XXX: - // May need to change the encoding based on this tag - /* falls through */ - case "base": - case "basefont": - case "bgsound": - case "link": - insertHTMLElement(value, arg3); - stack.pop(); - return; - case "title": - parseRCDATA(value, arg3); - return; - case "noscript": - if (!scripting_enabled) { - insertHTMLElement(value, arg3); - parser = in_head_noscript_mode; - return; - } - // Otherwise, if scripting is enabled... - /* falls through */ - case "noframes": - case "style": - parseRawText(value,arg3); - return; - case "script": - insertElement(function(doc) { - var elt = createHTMLElt(doc, value, arg3); - elt._parser_inserted = true; - elt._force_async = false; - if (fragment) elt._already_started = true; - flushText(); - return elt; - }); - tokenizer = script_data_state; - originalInsertionMode = parser; - parser = text_mode; - return; - case "template": - insertHTMLElement(value, arg3); - afe.insertMarker(); - frameset_ok = false; - parser = in_template_mode; - templateInsertionModes.push(parser); - return; - case "head": - return; // ignore it - } - break; - case 3: // ENDTAG - switch(value) { - case "head": - stack.pop(); - parser = after_head_mode; - return; - case "body": - case "html": - case "br": - break; // handle these at the bottom of the function - case "template": - if (!stack.contains("template")) { - return; - } - stack.generateImpliedEndTags(null, "thorough"); - stack.popTag("template"); - afe.clearToMarker(); - templateInsertionModes.pop(); - resetInsertionMode(); - return; - default: - // ignore any other end tag - return; - } - break; - } - - // If not handled above - in_head_mode(ENDTAG, "head", null); // synthetic - parser(t, value, arg3, arg4); // Then redo this one - } - - // 13.2.5.4.5 The "in head noscript" insertion mode - function in_head_noscript_mode(t, value, arg3, arg4) { - switch(t) { - case 5: // DOCTYPE - return; - case 4: // COMMENT - in_head_mode(t, value); - return; - case 1: // TEXT - var ws = value.match(LEADINGWS); - if (ws) { - in_head_mode(t, ws[0]); - value = value.substring(ws[0].length); - } - if (value.length === 0) return; // no more text - break; // Handle non-whitespace below - case 2: // TAG - switch(value) { - case "html": - in_body_mode(t, value, arg3, arg4); - return; - case "basefont": - case "bgsound": - case "link": - case "meta": - case "noframes": - case "style": - in_head_mode(t, value, arg3); - return; - case "head": - case "noscript": - return; - } - break; - case 3: // ENDTAG - switch(value) { - case "noscript": - stack.pop(); - parser = in_head_mode; - return; - case "br": - break; // goes to the outer default - default: - return; // ignore other end tags - } - break; - } - - // If not handled above - in_head_noscript_mode(ENDTAG, "noscript", null); - parser(t, value, arg3, arg4); - } - - function after_head_mode(t, value, arg3, arg4) { - switch(t) { - case 1: // TEXT - var ws = value.match(LEADINGWS); - if (ws) { - insertText(ws[0]); - value = value.substring(ws[0].length); - } - if (value.length === 0) return; - break; // Handle non-whitespace below - case 4: // COMMENT - insertComment(value); - return; - case 5: // DOCTYPE - return; - case 2: // TAG - switch(value) { - case "html": - in_body_mode(t, value, arg3, arg4); - return; - case "body": - insertHTMLElement(value, arg3); - frameset_ok = false; - parser = in_body_mode; - return; - case "frameset": - insertHTMLElement(value, arg3); - parser = in_frameset_mode; - return; - case "base": - case "basefont": - case "bgsound": - case "link": - case "meta": - case "noframes": - case "script": - case "style": - case "template": - case "title": - stack.push(head_element_pointer); - in_head_mode(TAG, value, arg3); - stack.removeElement(head_element_pointer); - return; - case "head": - return; - } - break; - case 3: // ENDTAG - switch(value) { - case "template": - return in_head_mode(t, value, arg3, arg4); - case "body": - case "html": - case "br": - break; - default: - return; // ignore any other end tag - } - break; - } - - after_head_mode(TAG, "body", null); - frameset_ok = true; - parser(t, value, arg3, arg4); - } - - // 13.2.5.4.7 The "in body" insertion mode - function in_body_mode(t,value,arg3,arg4) { - var body, i, node, elt; - switch(t) { - case 1: // TEXT - if (textIncludesNUL) { - value = value.replace(NULCHARS, ""); - if (value.length === 0) return; - } - // If any non-space characters - if (frameset_ok && NONWS.test(value)) - frameset_ok = false; - afereconstruct(); - insertText(value); - return; - case 5: // DOCTYPE - return; - case 4: // COMMENT - insertComment(value); - return; - case -1: // EOF - if (templateInsertionModes.length) { - return in_template_mode(t); - } - stopParsing(); - return; - case 2: // TAG - switch(value) { - case "html": - if (stack.contains("template")) { - return; - } - transferAttributes(arg3, stack.elements[0]); - return; - case "base": - case "basefont": - case "bgsound": - case "link": - case "meta": - case "noframes": - case "script": - case "style": - case "template": - case "title": - in_head_mode(TAG, value, arg3); - return; - case "body": - body = stack.elements[1]; - if (!body || !(body instanceof impl.HTMLBodyElement) || - stack.contains("template")) - return; - frameset_ok = false; - transferAttributes(arg3, body); - return; - case "frameset": - if (!frameset_ok) return; - body = stack.elements[1]; - if (!body || !(body instanceof impl.HTMLBodyElement)) - return; - if (body.parentNode) body.parentNode.removeChild(body); - while(!(stack.top instanceof impl.HTMLHtmlElement)) - stack.pop(); - insertHTMLElement(value, arg3); - parser = in_frameset_mode; - return; - - case "address": - case "article": - case "aside": - case "blockquote": - case "center": - case "details": - case "dialog": - case "dir": - case "div": - case "dl": - case "fieldset": - case "figcaption": - case "figure": - case "footer": - case "header": - case "hgroup": - case "main": - case "nav": - case "ol": - case "p": - case "section": - case "summary": - case "ul": - if (stack.inButtonScope("p")) in_body_mode(ENDTAG, "p"); - insertHTMLElement(value, arg3); - return; - - case "menu": - if (stack.inButtonScope("p")) in_body_mode(ENDTAG, "p"); - if (isA(stack.top, 'menuitem')) { - stack.pop(); - } - insertHTMLElement(value, arg3); - return; - - case "h1": - case "h2": - case "h3": - case "h4": - case "h5": - case "h6": - if (stack.inButtonScope("p")) in_body_mode(ENDTAG, "p"); - if (stack.top instanceof impl.HTMLHeadingElement) - stack.pop(); - insertHTMLElement(value, arg3); - return; - - case "pre": - case "listing": - if (stack.inButtonScope("p")) in_body_mode(ENDTAG, "p"); - insertHTMLElement(value, arg3); - ignore_linefeed = true; - frameset_ok = false; - return; - - case "form": - if (form_element_pointer && !stack.contains("template")) return; - if (stack.inButtonScope("p")) in_body_mode(ENDTAG, "p"); - elt = insertHTMLElement(value, arg3); - if (!stack.contains("template")) - form_element_pointer = elt; - return; - - case "li": - frameset_ok = false; - for(i = stack.elements.length-1; i >= 0; i--) { - node = stack.elements[i]; - if (node instanceof impl.HTMLLIElement) { - in_body_mode(ENDTAG, "li"); - break; - } - if (isA(node, specialSet) && !isA(node, addressdivpSet)) - break; - } - if (stack.inButtonScope("p")) in_body_mode(ENDTAG, "p"); - insertHTMLElement(value, arg3); - return; - - case "dd": - case "dt": - frameset_ok = false; - for(i = stack.elements.length-1; i >= 0; i--) { - node = stack.elements[i]; - if (isA(node, dddtSet)) { - in_body_mode(ENDTAG, node.localName); - break; - } - if (isA(node, specialSet) && !isA(node, addressdivpSet)) - break; - } - if (stack.inButtonScope("p")) in_body_mode(ENDTAG, "p"); - insertHTMLElement(value, arg3); - return; - - case "plaintext": - if (stack.inButtonScope("p")) in_body_mode(ENDTAG, "p"); - insertHTMLElement(value, arg3); - tokenizer = plaintext_state; - return; - - case "button": - if (stack.inScope("button")) { - in_body_mode(ENDTAG, "button"); - parser(t, value, arg3, arg4); - } - else { - afereconstruct(); - insertHTMLElement(value, arg3); - frameset_ok = false; - } - return; - - case "a": - var activeElement = afe.findElementByTag("a"); - if (activeElement) { - in_body_mode(ENDTAG, value); - afe.remove(activeElement); - stack.removeElement(activeElement); - } - /* falls through */ - case "b": - case "big": - case "code": - case "em": - case "font": - case "i": - case "s": - case "small": - case "strike": - case "strong": - case "tt": - case "u": - afereconstruct(); - afe.push(insertHTMLElement(value,arg3), arg3); - return; - - case "nobr": - afereconstruct(); - - if (stack.inScope(value)) { - in_body_mode(ENDTAG, value); - afereconstruct(); - } - afe.push(insertHTMLElement(value,arg3), arg3); - return; - - case "applet": - case "marquee": - case "object": - afereconstruct(); - insertHTMLElement(value,arg3); - afe.insertMarker(); - frameset_ok = false; - return; - - case "table": - if (!doc._quirks && stack.inButtonScope("p")) { - in_body_mode(ENDTAG, "p"); - } - insertHTMLElement(value,arg3); - frameset_ok = false; - parser = in_table_mode; - return; - - case "area": - case "br": - case "embed": - case "img": - case "keygen": - case "wbr": - afereconstruct(); - insertHTMLElement(value,arg3); - stack.pop(); - frameset_ok = false; - return; - - case "input": - afereconstruct(); - elt = insertHTMLElement(value,arg3); - stack.pop(); - var type = elt.getAttribute("type"); - if (!type || type.toLowerCase() !== "hidden") - frameset_ok = false; - return; - - case "param": - case "source": - case "track": - insertHTMLElement(value,arg3); - stack.pop(); - return; - - case "hr": - if (stack.inButtonScope("p")) in_body_mode(ENDTAG, "p"); - if (isA(stack.top, 'menuitem')) { - stack.pop(); - } - insertHTMLElement(value,arg3); - stack.pop(); - frameset_ok = false; - return; - - case "image": - in_body_mode(TAG, "img", arg3, arg4); - return; - - case "textarea": - insertHTMLElement(value,arg3); - ignore_linefeed = true; - frameset_ok = false; - tokenizer = rcdata_state; - originalInsertionMode = parser; - parser = text_mode; - return; - - case "xmp": - if (stack.inButtonScope("p")) in_body_mode(ENDTAG, "p"); - afereconstruct(); - frameset_ok = false; - parseRawText(value, arg3); - return; - - case "iframe": - frameset_ok = false; - parseRawText(value, arg3); - return; - - case "noembed": - parseRawText(value,arg3); - return; - - case "select": - afereconstruct(); - insertHTMLElement(value,arg3); - frameset_ok = false; - if (parser === in_table_mode || - parser === in_caption_mode || - parser === in_table_body_mode || - parser === in_row_mode || - parser === in_cell_mode) - parser = in_select_in_table_mode; - else - parser = in_select_mode; - return; - - case "optgroup": - case "option": - if (stack.top instanceof impl.HTMLOptionElement) { - in_body_mode(ENDTAG, "option"); - } - afereconstruct(); - insertHTMLElement(value,arg3); - return; - - case "menuitem": - if (isA(stack.top, 'menuitem')) { - stack.pop(); - } - afereconstruct(); - insertHTMLElement(value, arg3); - return; - - case "rb": - case "rtc": - if (stack.inScope("ruby")) { - stack.generateImpliedEndTags(); - } - insertHTMLElement(value,arg3); - return; - - case "rp": - case "rt": - if (stack.inScope("ruby")) { - stack.generateImpliedEndTags("rtc"); - } - insertHTMLElement(value,arg3); - return; - - case "math": - afereconstruct(); - adjustMathMLAttributes(arg3); - adjustForeignAttributes(arg3); - insertForeignElement(value, arg3, NAMESPACE.MATHML); - if (arg4) // self-closing flag - stack.pop(); - return; - - case "svg": - afereconstruct(); - adjustSVGAttributes(arg3); - adjustForeignAttributes(arg3); - insertForeignElement(value, arg3, NAMESPACE.SVG); - if (arg4) // self-closing flag - stack.pop(); - return; - - case "caption": - case "col": - case "colgroup": - case "frame": - case "head": - case "tbody": - case "td": - case "tfoot": - case "th": - case "thead": - case "tr": - // Ignore table tags if we're not in_table mode - return; - } - - // Handle any other start tag here - // (and also noscript tags when scripting is disabled) - afereconstruct(); - insertHTMLElement(value,arg3); - return; - - case 3: // ENDTAG - switch(value) { - case "template": - in_head_mode(ENDTAG, value, arg3); - return; - case "body": - if (!stack.inScope("body")) return; - parser = after_body_mode; - return; - case "html": - if (!stack.inScope("body")) return; - parser = after_body_mode; - parser(t, value, arg3); - return; - - case "address": - case "article": - case "aside": - case "blockquote": - case "button": - case "center": - case "details": - case "dialog": - case "dir": - case "div": - case "dl": - case "fieldset": - case "figcaption": - case "figure": - case "footer": - case "header": - case "hgroup": - case "listing": - case "main": - case "menu": - case "nav": - case "ol": - case "pre": - case "section": - case "summary": - case "ul": - // Ignore if there is not a matching open tag - if (!stack.inScope(value)) return; - stack.generateImpliedEndTags(); - stack.popTag(value); - return; - - case "form": - if (!stack.contains("template")) { - var openform = form_element_pointer; - form_element_pointer = null; - if (!openform || !stack.elementInScope(openform)) return; - stack.generateImpliedEndTags(); - stack.removeElement(openform); - } else { - if (!stack.inScope("form")) return; - stack.generateImpliedEndTags(); - stack.popTag("form"); - } - return; - - case "p": - if (!stack.inButtonScope(value)) { - in_body_mode(TAG, value, null); - parser(t, value, arg3, arg4); - } - else { - stack.generateImpliedEndTags(value); - stack.popTag(value); - } - return; - - case "li": - if (!stack.inListItemScope(value)) return; - stack.generateImpliedEndTags(value); - stack.popTag(value); - return; - - case "dd": - case "dt": - if (!stack.inScope(value)) return; - stack.generateImpliedEndTags(value); - stack.popTag(value); - return; - - case "h1": - case "h2": - case "h3": - case "h4": - case "h5": - case "h6": - if (!stack.elementTypeInScope(impl.HTMLHeadingElement)) return; - stack.generateImpliedEndTags(); - stack.popElementType(impl.HTMLHeadingElement); - return; - - case "sarcasm": - // Take a deep breath, and then: - break; - - case "a": - case "b": - case "big": - case "code": - case "em": - case "font": - case "i": - case "nobr": - case "s": - case "small": - case "strike": - case "strong": - case "tt": - case "u": - var result = adoptionAgency(value); - if (result) return; // If we did something we're done - break; // Go to the "any other end tag" case - - case "applet": - case "marquee": - case "object": - if (!stack.inScope(value)) return; - stack.generateImpliedEndTags(); - stack.popTag(value); - afe.clearToMarker(); - return; - - case "br": - in_body_mode(TAG, value, null); // Turn
into
- return; - } - - // Any other end tag goes here - for(i = stack.elements.length-1; i >= 0; i--) { - node = stack.elements[i]; - if (isA(node, value)) { - stack.generateImpliedEndTags(value); - stack.popElement(node); - break; - } - else if (isA(node, specialSet)) { - return; - } - } - - return; - } - } - - function text_mode(t, value, arg3, arg4) { - switch(t) { - case 1: // TEXT - insertText(value); - return; - case -1: // EOF - if (stack.top instanceof impl.HTMLScriptElement) - stack.top._already_started = true; - stack.pop(); - parser = originalInsertionMode; - parser(t); - return; - case 3: // ENDTAG - if (value === "script") { - handleScriptEnd(); - } - else { - stack.pop(); - parser = originalInsertionMode; - } - return; - default: - // We should never get any other token types - return; - } - } - - function in_table_mode(t, value, arg3, arg4) { - function getTypeAttr(attrs) { - for(var i = 0, n = attrs.length; i < n; i++) { - if (attrs[i][0] === "type") - return attrs[i][1].toLowerCase(); - } - return null; - } - - switch(t) { - case 1: // TEXT - // XXX the text_integration_mode stuff is - // just a hack I made up - if (text_integration_mode) { - in_body_mode(t, value, arg3, arg4); - return; - } - else if (isA(stack.top, tablesectionrowSet)) { - pending_table_text = []; - originalInsertionMode = parser; - parser = in_table_text_mode; - parser(t, value, arg3, arg4); - return; - } - break; - case 4: // COMMENT - insertComment(value); - return; - case 5: // DOCTYPE - return; - case 2: // TAG - switch(value) { - case "caption": - stack.clearToContext(tableContextSet); - afe.insertMarker(); - insertHTMLElement(value,arg3); - parser = in_caption_mode; - return; - case "colgroup": - stack.clearToContext(tableContextSet); - insertHTMLElement(value,arg3); - parser = in_column_group_mode; - return; - case "col": - in_table_mode(TAG, "colgroup", null); - parser(t, value, arg3, arg4); - return; - case "tbody": - case "tfoot": - case "thead": - stack.clearToContext(tableContextSet); - insertHTMLElement(value,arg3); - parser = in_table_body_mode; - return; - case "td": - case "th": - case "tr": - in_table_mode(TAG, "tbody", null); - parser(t, value, arg3, arg4); - return; - - case "table": - if (!stack.inTableScope(value)) { - return; // Ignore the token - } - in_table_mode(ENDTAG, value); - parser(t, value, arg3, arg4); - return; - - case "style": - case "script": - case "template": - in_head_mode(t, value, arg3, arg4); - return; - - case "input": - var type = getTypeAttr(arg3); - if (type !== "hidden") break; // to the anything else case - insertHTMLElement(value,arg3); - stack.pop(); - return; - - case "form": - if (form_element_pointer || stack.contains("template")) return; - form_element_pointer = insertHTMLElement(value, arg3); - stack.popElement(form_element_pointer); - return; - } - break; - case 3: // ENDTAG - switch(value) { - case "table": - if (!stack.inTableScope(value)) return; - stack.popTag(value); - resetInsertionMode(); - return; - case "body": - case "caption": - case "col": - case "colgroup": - case "html": - case "tbody": - case "td": - case "tfoot": - case "th": - case "thead": - case "tr": - return; - case "template": - in_head_mode(t, value, arg3, arg4); - return; - } - - break; - case -1: // EOF - in_body_mode(t, value, arg3, arg4); - return; - } - - // This is the anything else case - foster_parent_mode = true; - in_body_mode(t, value, arg3, arg4); - foster_parent_mode = false; - } - - function in_table_text_mode(t, value, arg3, arg4) { - if (t === TEXT) { - if (textIncludesNUL) { - value = value.replace(NULCHARS, ""); - if (value.length === 0) return; - } - pending_table_text.push(value); - } - else { - var s = pending_table_text.join(""); - pending_table_text.length = 0; - if (NONWS.test(s)) { // If any non-whitespace characters - // This must be the same code as the "anything else" - // case of the in_table mode above. - foster_parent_mode = true; - in_body_mode(TEXT, s); - foster_parent_mode = false; - } - else { - insertText(s); - } - parser = originalInsertionMode; - parser(t, value, arg3, arg4); - } - } - - - function in_caption_mode(t, value, arg3, arg4) { - function end_caption() { - if (!stack.inTableScope("caption")) return false; - stack.generateImpliedEndTags(); - stack.popTag("caption"); - afe.clearToMarker(); - parser = in_table_mode; - return true; - } - - switch(t) { - case 2: // TAG - switch(value) { - case "caption": - case "col": - case "colgroup": - case "tbody": - case "td": - case "tfoot": - case "th": - case "thead": - case "tr": - if (end_caption()) parser(t, value, arg3, arg4); - return; - } - break; - case 3: // ENDTAG - switch(value) { - case "caption": - end_caption(); - return; - case "table": - if (end_caption()) parser(t, value, arg3, arg4); - return; - case "body": - case "col": - case "colgroup": - case "html": - case "tbody": - case "td": - case "tfoot": - case "th": - case "thead": - case "tr": - return; - } - break; - } - - // The Anything Else case - in_body_mode(t, value, arg3, arg4); - } - - function in_column_group_mode(t, value, arg3, arg4) { - switch(t) { - case 1: // TEXT - var ws = value.match(LEADINGWS); - if (ws) { - insertText(ws[0]); - value = value.substring(ws[0].length); - } - if (value.length === 0) return; - break; // Handle non-whitespace below - - case 4: // COMMENT - insertComment(value); - return; - case 5: // DOCTYPE - return; - case 2: // TAG - switch(value) { - case "html": - in_body_mode(t, value, arg3, arg4); - return; - case "col": - insertHTMLElement(value, arg3); - stack.pop(); - return; - case "template": - in_head_mode(t, value, arg3, arg4); - return; - } - break; - case 3: // ENDTAG - switch(value) { - case "colgroup": - if (!isA(stack.top, 'colgroup')) { - return; // Ignore the token. - } - stack.pop(); - parser = in_table_mode; - return; - case "col": - return; - case "template": - in_head_mode(t, value, arg3, arg4); - return; - } - break; - case -1: // EOF - in_body_mode(t, value, arg3, arg4); - return; - } - - // Anything else - if (!isA(stack.top, 'colgroup')) { - return; // Ignore the token. - } - in_column_group_mode(ENDTAG, "colgroup"); - parser(t, value, arg3, arg4); - } - - function in_table_body_mode(t, value, arg3, arg4) { - function endsect() { - if (!stack.inTableScope("tbody") && - !stack.inTableScope("thead") && - !stack.inTableScope("tfoot")) - return; - stack.clearToContext(tableBodyContextSet); - in_table_body_mode(ENDTAG, stack.top.localName, null); - parser(t, value, arg3, arg4); - } - - switch(t) { - case 2: // TAG - switch(value) { - case "tr": - stack.clearToContext(tableBodyContextSet); - insertHTMLElement(value, arg3); - parser = in_row_mode; - return; - case "th": - case "td": - in_table_body_mode(TAG, "tr", null); - parser(t, value, arg3, arg4); - return; - case "caption": - case "col": - case "colgroup": - case "tbody": - case "tfoot": - case "thead": - endsect(); - return; - } - break; - case 3: // ENDTAG - switch(value) { - case "table": - endsect(); - return; - case "tbody": - case "tfoot": - case "thead": - if (stack.inTableScope(value)) { - stack.clearToContext(tableBodyContextSet); - stack.pop(); - parser = in_table_mode; - } - return; - case "body": - case "caption": - case "col": - case "colgroup": - case "html": - case "td": - case "th": - case "tr": - return; - } - break; - } - - // Anything else: - in_table_mode(t, value, arg3, arg4); - } - - function in_row_mode(t, value, arg3, arg4) { - function endrow() { - if (!stack.inTableScope("tr")) return false; - stack.clearToContext(tableRowContextSet); - stack.pop(); - parser = in_table_body_mode; - return true; - } - - switch(t) { - case 2: // TAG - switch(value) { - case "th": - case "td": - stack.clearToContext(tableRowContextSet); - insertHTMLElement(value, arg3); - parser = in_cell_mode; - afe.insertMarker(); - return; - case "caption": - case "col": - case "colgroup": - case "tbody": - case "tfoot": - case "thead": - case "tr": - if (endrow()) parser(t, value, arg3, arg4); - return; - } - break; - case 3: // ENDTAG - switch(value) { - case "tr": - endrow(); - return; - case "table": - if (endrow()) parser(t, value, arg3, arg4); - return; - case "tbody": - case "tfoot": - case "thead": - if (stack.inTableScope(value)) { - if (endrow()) parser(t, value, arg3, arg4); - } - return; - case "body": - case "caption": - case "col": - case "colgroup": - case "html": - case "td": - case "th": - return; - } - break; - } - - // anything else - in_table_mode(t, value, arg3, arg4); - } - - function in_cell_mode(t, value, arg3, arg4) { - switch(t) { - case 2: // TAG - switch(value) { - case "caption": - case "col": - case "colgroup": - case "tbody": - case "td": - case "tfoot": - case "th": - case "thead": - case "tr": - if (stack.inTableScope("td")) { - in_cell_mode(ENDTAG, "td"); - parser(t, value, arg3, arg4); - } - else if (stack.inTableScope("th")) { - in_cell_mode(ENDTAG, "th"); - parser(t, value, arg3, arg4); - } - return; - } - break; - case 3: // ENDTAG - switch(value) { - case "td": - case "th": - if (!stack.inTableScope(value)) return; - stack.generateImpliedEndTags(); - stack.popTag(value); - afe.clearToMarker(); - parser = in_row_mode; - return; - - case "body": - case "caption": - case "col": - case "colgroup": - case "html": - return; - - case "table": - case "tbody": - case "tfoot": - case "thead": - case "tr": - if (!stack.inTableScope(value)) return; - in_cell_mode(ENDTAG, stack.inTableScope("td") ? "td" : "th"); - parser(t, value, arg3, arg4); - return; - } - break; - } - - // anything else - in_body_mode(t, value, arg3, arg4); - } - - function in_select_mode(t, value, arg3, arg4) { - switch(t) { - case 1: // TEXT - if (textIncludesNUL) { - value = value.replace(NULCHARS, ""); - if (value.length === 0) return; - } - insertText(value); - return; - case 4: // COMMENT - insertComment(value); - return; - case 5: // DOCTYPE - return; - case -1: // EOF - in_body_mode(t, value, arg3, arg4); - return; - case 2: // TAG - switch(value) { - case "html": - in_body_mode(t, value, arg3, arg4); - return; - case "option": - if (stack.top instanceof impl.HTMLOptionElement) - in_select_mode(ENDTAG, value); - insertHTMLElement(value, arg3); - return; - case "optgroup": - if (stack.top instanceof impl.HTMLOptionElement) - in_select_mode(ENDTAG, "option"); - if (stack.top instanceof impl.HTMLOptGroupElement) - in_select_mode(ENDTAG, value); - insertHTMLElement(value, arg3); - return; - case "select": - in_select_mode(ENDTAG, value); // treat it as a close tag - return; - - case "input": - case "keygen": - case "textarea": - if (!stack.inSelectScope("select")) return; - in_select_mode(ENDTAG, "select"); - parser(t, value, arg3, arg4); - return; - - case "script": - case "template": - in_head_mode(t, value, arg3, arg4); - return; - } - break; - case 3: // ENDTAG - switch(value) { - case "optgroup": - if (stack.top instanceof impl.HTMLOptionElement && - stack.elements[stack.elements.length-2] instanceof - impl.HTMLOptGroupElement) { - in_select_mode(ENDTAG, "option"); - } - if (stack.top instanceof impl.HTMLOptGroupElement) - stack.pop(); - - return; - - case "option": - if (stack.top instanceof impl.HTMLOptionElement) - stack.pop(); - return; - - case "select": - if (!stack.inSelectScope(value)) return; - stack.popTag(value); - resetInsertionMode(); - return; - - case "template": - in_head_mode(t, value, arg3, arg4); - return; - } - - break; - } - - // anything else: just ignore the token - } - - function in_select_in_table_mode(t, value, arg3, arg4) { - switch(value) { - case "caption": - case "table": - case "tbody": - case "tfoot": - case "thead": - case "tr": - case "td": - case "th": - switch(t) { - case 2: // TAG - in_select_in_table_mode(ENDTAG, "select"); - parser(t, value, arg3, arg4); - return; - case 3: // ENDTAG - if (stack.inTableScope(value)) { - in_select_in_table_mode(ENDTAG, "select"); - parser(t, value, arg3, arg4); - } - return; - } - } - - // anything else - in_select_mode(t, value, arg3, arg4); - } - - function in_template_mode(t, value, arg3, arg4) { - function switchModeAndReprocess(mode) { - parser = mode; - templateInsertionModes[templateInsertionModes.length-1] = parser; - parser(t, value, arg3, arg4); - } - switch(t) { - case 1: // TEXT - case 4: // COMMENT - case 5: // DOCTYPE - in_body_mode(t, value, arg3, arg4); - return; - case -1: // EOF - if (!stack.contains("template")) { - stopParsing(); - } else { - stack.popTag("template"); - afe.clearToMarker(); - templateInsertionModes.pop(); - resetInsertionMode(); - parser(t, value, arg3, arg4); - } - return; - case 2: // TAG - switch(value) { - case "base": - case "basefont": - case "bgsound": - case "link": - case "meta": - case "noframes": - case "script": - case "style": - case "template": - case "title": - in_head_mode(t, value, arg3, arg4); - return; - case "caption": - case "colgroup": - case "tbody": - case "tfoot": - case "thead": - switchModeAndReprocess(in_table_mode); - return; - case "col": - switchModeAndReprocess(in_column_group_mode); - return; - case "tr": - switchModeAndReprocess(in_table_body_mode); - return; - case "td": - case "th": - switchModeAndReprocess(in_row_mode); - return; - } - switchModeAndReprocess(in_body_mode); - return; - case 3: // ENDTAG - switch(value) { - case "template": - in_head_mode(t, value, arg3, arg4); - return; - default: - return; - } - } - } - - function after_body_mode(t, value, arg3, arg4) { - switch(t) { - case 1: // TEXT - // If any non-space chars, handle below - if (NONWS.test(value)) break; - in_body_mode(t, value); - return; - case 4: // COMMENT - // Append it to the element - stack.elements[0]._appendChild(doc.createComment(value)); - return; - case 5: // DOCTYPE - return; - case -1: // EOF - stopParsing(); - return; - case 2: // TAG - if (value === "html") { - in_body_mode(t, value, arg3, arg4); - return; - } - break; // for any other tags - case 3: // ENDTAG - if (value === "html") { - if (fragment) return; - parser = after_after_body_mode; - return; - } - break; // for any other tags - } - - // anything else - parser = in_body_mode; - parser(t, value, arg3, arg4); - } - - function in_frameset_mode(t, value, arg3, arg4) { - switch(t) { - case 1: // TEXT - // Ignore any non-space characters - value = value.replace(ALLNONWS, ""); - if (value.length > 0) insertText(value); - return; - case 4: // COMMENT - insertComment(value); - return; - case 5: // DOCTYPE - return; - case -1: // EOF - stopParsing(); - return; - case 2: // TAG - switch(value) { - case "html": - in_body_mode(t, value, arg3, arg4); - return; - case "frameset": - insertHTMLElement(value, arg3); - return; - case "frame": - insertHTMLElement(value, arg3); - stack.pop(); - return; - case "noframes": - in_head_mode(t, value, arg3, arg4); - return; - } - break; - case 3: // ENDTAG - if (value === "frameset") { - if (fragment && stack.top instanceof impl.HTMLHtmlElement) - return; - stack.pop(); - if (!fragment && - !(stack.top instanceof impl.HTMLFrameSetElement)) - parser = after_frameset_mode; - return; - } - break; - } - - // ignore anything else - } - - function after_frameset_mode(t, value, arg3, arg4) { - switch(t) { - case 1: // TEXT - // Ignore any non-space characters - value = value.replace(ALLNONWS, ""); - if (value.length > 0) insertText(value); - return; - case 4: // COMMENT - insertComment(value); - return; - case 5: // DOCTYPE - return; - case -1: // EOF - stopParsing(); - return; - case 2: // TAG - switch(value) { - case "html": - in_body_mode(t, value, arg3, arg4); - return; - case "noframes": - in_head_mode(t, value, arg3, arg4); - return; - } - break; - case 3: // ENDTAG - if (value === "html") { - parser = after_after_frameset_mode; - return; - } - break; - } - - // ignore anything else - } - - function after_after_body_mode(t, value, arg3, arg4) { - switch(t) { - case 1: // TEXT - // If any non-space chars, handle below - if (NONWS.test(value)) break; - in_body_mode(t, value, arg3, arg4); - return; - case 4: // COMMENT - doc._appendChild(doc.createComment(value)); - return; - case 5: // DOCTYPE - in_body_mode(t, value, arg3, arg4); - return; - case -1: // EOF - stopParsing(); - return; - case 2: // TAG - if (value === "html") { - in_body_mode(t, value, arg3, arg4); - return; - } - break; - } - - // anything else - parser = in_body_mode; - parser(t, value, arg3, arg4); - } - - function after_after_frameset_mode(t, value, arg3, arg4) { - switch(t) { - case 1: // TEXT - // Ignore any non-space characters - value = value.replace(ALLNONWS, ""); - if (value.length > 0) - in_body_mode(t, value, arg3, arg4); - return; - case 4: // COMMENT - doc._appendChild(doc.createComment(value)); - return; - case 5: // DOCTYPE - in_body_mode(t, value, arg3, arg4); - return; - case -1: // EOF - stopParsing(); - return; - case 2: // TAG - switch(value) { - case "html": - in_body_mode(t, value, arg3, arg4); - return; - case "noframes": - in_head_mode(t, value, arg3, arg4); - return; - } - break; - } - - // ignore anything else - } - - - // 13.2.5.5 The rules for parsing tokens in foreign content - // - // This is like one of the insertion modes above, but is - // invoked somewhat differently when the current token is not HTML. - // See the insertToken() function. - function insertForeignToken(t, value, arg3, arg4) { - // A tag is an HTML font tag if it has a color, font, or size - // attribute. Otherwise we assume it is foreign content - function isHTMLFont(attrs) { - for(var i = 0, n = attrs.length; i < n; i++) { - switch(attrs[i][0]) { - case "color": - case "face": - case "size": - return true; - } - } - return false; - } - - var current; - - switch(t) { - case 1: // TEXT - // If any non-space, non-nul characters - if (frameset_ok && NONWSNONNUL.test(value)) - frameset_ok = false; - if (textIncludesNUL) { - value = value.replace(NULCHARS, "\uFFFD"); - } - insertText(value); - return; - case 4: // COMMENT - insertComment(value); - return; - case 5: // DOCTYPE - // ignore it - return; - case 2: // TAG - switch(value) { - case "font": - if (!isHTMLFont(arg3)) break; - /* falls through */ - case "b": - case "big": - case "blockquote": - case "body": - case "br": - case "center": - case "code": - case "dd": - case "div": - case "dl": - case "dt": - case "em": - case "embed": - case "h1": - case "h2": - case "h3": - case "h4": - case "h5": - case "h6": - case "head": - case "hr": - case "i": - case "img": - case "li": - case "listing": - case "menu": - case "meta": - case "nobr": - case "ol": - case "p": - case "pre": - case "ruby": - case "s": - case "small": - case "span": - case "strong": - case "strike": - case "sub": - case "sup": - case "table": - case "tt": - case "u": - case "ul": - case "var": - if (fragment) { - break; - } - do { - stack.pop(); - current = stack.top; - } while(current.namespaceURI !== NAMESPACE.HTML && - !isMathmlTextIntegrationPoint(current) && - !isHTMLIntegrationPoint(current)); - - insertToken(t, value, arg3, arg4); // reprocess - return; - } - - // Any other start tag case goes here - current = (stack.elements.length===1 && fragment) ? fragmentContext : - stack.top; - if (current.namespaceURI === NAMESPACE.MATHML) { - adjustMathMLAttributes(arg3); - } - else if (current.namespaceURI === NAMESPACE.SVG) { - value = adjustSVGTagName(value); - adjustSVGAttributes(arg3); - } - adjustForeignAttributes(arg3); - - insertForeignElement(value, arg3, current.namespaceURI); - if (arg4) { // the self-closing flag - if (value === 'script' && current.namespaceURI === NAMESPACE.SVG) { - // XXX deal with SVG scripts here - } - stack.pop(); - } - return; - - case 3: // ENDTAG - current = stack.top; - if (value === "script" && - current.namespaceURI === NAMESPACE.SVG && - current.localName === "script") { - - stack.pop(); - - // XXX - // Deal with SVG scripts here - } - else { - // The any other end tag case - var i = stack.elements.length-1; - var node = stack.elements[i]; - for(;;) { - if (node.localName.toLowerCase() === value) { - stack.popElement(node); - break; - } - node = stack.elements[--i]; - // If non-html, keep looping - if (node.namespaceURI !== NAMESPACE.HTML) - continue; - // Otherwise process the end tag as html - parser(t, value, arg3, arg4); - break; - } - } - return; - } - } - - /*** - * Finally, this is the end of the HTMLParser() factory function. - * It returns the htmlparser object with the append() and end() methods. - */ - - // Sneak another method into the htmlparser object to allow us to run - // tokenizer tests. This can be commented out in production code. - // This is a hook for testing the tokenizer. It has to be here - // because the tokenizer details are all hidden away within the closure. - // It should return an array of tokens generated while parsing the - // input string. - htmlparser.testTokenizer = function(input, initialState, lastStartTag, charbychar) { - var tokens = []; - - switch(initialState) { - case "PCDATA state": - tokenizer = data_state; - break; - case "RCDATA state": - tokenizer = rcdata_state; - break; - case "RAWTEXT state": - tokenizer = rawtext_state; - break; - case "PLAINTEXT state": - tokenizer = plaintext_state; - break; - } - - if (lastStartTag) { - lasttagname = lastStartTag; - } - - insertToken = function(t, value, arg3, arg4) { - flushText(); - switch(t) { - case 1: // TEXT - if (tokens.length > 0 && - tokens[tokens.length-1][0] === "Character") { - tokens[tokens.length-1][1] += value; - } - else tokens.push(["Character", value]); - break; - case 4: // COMMENT - tokens.push(["Comment", value]); - break; - case 5: // DOCTYPE - tokens.push(["DOCTYPE", value, - arg3 === undefined ? null : arg3, - arg4 === undefined ? null : arg4, - !force_quirks]); - break; - case 2: // TAG - var attrs = Object.create(null); - for(var i = 0; i < arg3.length; i++) { - // XXX: does attribute order matter? - var a = arg3[i]; - if (a.length === 1) { - attrs[a[0]] = ""; - } - else { - attrs[a[0]] = a[1]; - } - } - var token = ["StartTag", value, attrs]; - if (arg4) token.push(true); - tokens.push(token); - break; - case 3: // ENDTAG - tokens.push(["EndTag", value]); - break; - case -1: // EOF - break; - } - }; - - if (!charbychar) { - this.parse(input, true); - } - else { - for(var i = 0; i < input.length; i++) { - this.parse(input[i]); - } - this.parse("", true); - } - return tokens; - }; - - // Return the parser object from the HTMLParser() factory function - return htmlparser; -} diff --git a/.output/server/node_modules/@mixmark-io/domino/lib/Leaf.js b/.output/server/node_modules/@mixmark-io/domino/lib/Leaf.js deleted file mode 100644 index 2b0fd57..0000000 --- a/.output/server/node_modules/@mixmark-io/domino/lib/Leaf.js +++ /dev/null @@ -1,37 +0,0 @@ -"use strict"; -module.exports = Leaf; - -var Node = require('./Node'); -var NodeList = require('./NodeList'); -var utils = require('./utils'); -var HierarchyRequestError = utils.HierarchyRequestError; -var NotFoundError = utils.NotFoundError; - -// This class defines common functionality for node subtypes that -// can never have children -function Leaf() { - Node.call(this); -} - -Leaf.prototype = Object.create(Node.prototype, { - hasChildNodes: { value: function() { return false; }}, - firstChild: { value: null }, - lastChild: { value: null }, - insertBefore: { value: function(node, child) { - if (!node.nodeType) throw new TypeError('not a node'); - HierarchyRequestError(); - }}, - replaceChild: { value: function(node, child) { - if (!node.nodeType) throw new TypeError('not a node'); - HierarchyRequestError(); - }}, - removeChild: { value: function(node) { - if (!node.nodeType) throw new TypeError('not a node'); - NotFoundError(); - }}, - removeChildren: { value: function() { /* no op */ }}, - childNodes: { get: function() { - if (!this._childNodes) this._childNodes = new NodeList(); - return this._childNodes; - }} -}); diff --git a/.output/server/node_modules/@mixmark-io/domino/lib/LinkedList.js b/.output/server/node_modules/@mixmark-io/domino/lib/LinkedList.js deleted file mode 100644 index f62885e..0000000 --- a/.output/server/node_modules/@mixmark-io/domino/lib/LinkedList.js +++ /dev/null @@ -1,44 +0,0 @@ -"use strict"; -var utils = require('./utils'); - -var LinkedList = module.exports = { - // basic validity tests on a circular linked list a - valid: function(a) { - utils.assert(a, "list falsy"); - utils.assert(a._previousSibling, "previous falsy"); - utils.assert(a._nextSibling, "next falsy"); - // xxx check that list is actually circular - return true; - }, - // insert a before b - insertBefore: function(a, b) { - utils.assert(LinkedList.valid(a) && LinkedList.valid(b)); - var a_first = a, a_last = a._previousSibling; - var b_first = b, b_last = b._previousSibling; - a_first._previousSibling = b_last; - a_last._nextSibling = b_first; - b_last._nextSibling = a_first; - b_first._previousSibling = a_last; - utils.assert(LinkedList.valid(a) && LinkedList.valid(b)); - }, - // replace a single node a with a list b (which could be null) - replace: function(a, b) { - utils.assert(LinkedList.valid(a) && (b===null || LinkedList.valid(b))); - if (b!==null) { - LinkedList.insertBefore(b, a); - } - LinkedList.remove(a); - utils.assert(LinkedList.valid(a) && (b===null || LinkedList.valid(b))); - }, - // remove single node a from its list - remove: function(a) { - utils.assert(LinkedList.valid(a)); - var prev = a._previousSibling; - if (prev === a) { return; } - var next = a._nextSibling; - prev._nextSibling = next; - next._previousSibling = prev; - a._previousSibling = a._nextSibling = a; - utils.assert(LinkedList.valid(a)); - } -}; diff --git a/.output/server/node_modules/@mixmark-io/domino/lib/Location.js b/.output/server/node_modules/@mixmark-io/domino/lib/Location.js deleted file mode 100644 index ae09151..0000000 --- a/.output/server/node_modules/@mixmark-io/domino/lib/Location.js +++ /dev/null @@ -1,56 +0,0 @@ -"use strict"; -var URL = require('./URL'); -var URLUtils = require('./URLUtils'); - -module.exports = Location; - -function Location(window, href) { - this._window = window; - this._href = href; -} - -Location.prototype = Object.create(URLUtils.prototype, { - constructor: { value: Location }, - - // Special behavior when href is set - href: { - get: function() { return this._href; }, - set: function(v) { this.assign(v); } - }, - - assign: { value: function(url) { - // Resolve the new url against the current one - // XXX: - // This is not actually correct. It should be resolved against - // the URL of the document of the script. For now, though, I only - // support a single window and there is only one base url. - // So this is good enough for now. - var current = new URL(this._href); - var newurl = current.resolve(url); - - // Save the new url - this._href = newurl; - - // Start loading the new document! - // XXX - // This is just something hacked together. - // The real algorithm is: http://www.whatwg.org/specs/web-apps/current-work/multipage/history.html#navigate - }}, - - replace: { value: function(url) { - // XXX - // Since we aren't tracking history yet, replace is the same as assign - this.assign(url); - }}, - - reload: { value: function() { - // XXX: - // Actually, the spec is a lot more complicated than this - this.assign(this.href); - }}, - - toString: { value: function() { - return this.href; - }} - -}); diff --git a/.output/server/node_modules/@mixmark-io/domino/lib/MouseEvent.js b/.output/server/node_modules/@mixmark-io/domino/lib/MouseEvent.js deleted file mode 100644 index fc3d69f..0000000 --- a/.output/server/node_modules/@mixmark-io/domino/lib/MouseEvent.js +++ /dev/null @@ -1,52 +0,0 @@ -"use strict"; -var UIEvent = require('./UIEvent'); - -module.exports = MouseEvent; - -function MouseEvent() { - // Just use the superclass constructor to initialize - UIEvent.call(this); - - this.screenX = this.screenY = this.clientX = this.clientY = 0; - this.ctrlKey = this.altKey = this.shiftKey = this.metaKey = false; - this.button = 0; - this.buttons = 1; - this.relatedTarget = null; -} -MouseEvent.prototype = Object.create(UIEvent.prototype, { - constructor: { value: MouseEvent }, - initMouseEvent: { value: function(type, bubbles, cancelable, - view, detail, - screenX, screenY, clientX, clientY, - ctrlKey, altKey, shiftKey, metaKey, - button, relatedTarget) { - - this.initEvent(type, bubbles, cancelable, view, detail); - this.screenX = screenX; - this.screenY = screenY; - this.clientX = clientX; - this.clientY = clientY; - this.ctrlKey = ctrlKey; - this.altKey = altKey; - this.shiftKey = shiftKey; - this.metaKey = metaKey; - this.button = button; - switch(button) { - case 0: this.buttons = 1; break; - case 1: this.buttons = 4; break; - case 2: this.buttons = 2; break; - default: this.buttons = 0; break; - } - this.relatedTarget = relatedTarget; - }}, - - getModifierState: { value: function(key) { - switch(key) { - case "Alt": return this.altKey; - case "Control": return this.ctrlKey; - case "Shift": return this.shiftKey; - case "Meta": return this.metaKey; - default: return false; - } - }} -}); diff --git a/.output/server/node_modules/@mixmark-io/domino/lib/MutationConstants.js b/.output/server/node_modules/@mixmark-io/domino/lib/MutationConstants.js deleted file mode 100644 index 81ddc3e..0000000 --- a/.output/server/node_modules/@mixmark-io/domino/lib/MutationConstants.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -module.exports = { - VALUE: 1, // The value of a Text, Comment or PI node changed - ATTR: 2, // A new attribute was added or an attribute value and/or prefix changed - REMOVE_ATTR: 3, // An attribute was removed - REMOVE: 4, // A node was removed - MOVE: 5, // A node was moved - INSERT: 6 // A node (or a subtree of nodes) was inserted -}; \ No newline at end of file diff --git a/.output/server/node_modules/@mixmark-io/domino/lib/NamedNodeMap.js b/.output/server/node_modules/@mixmark-io/domino/lib/NamedNodeMap.js deleted file mode 100644 index 01c4801..0000000 --- a/.output/server/node_modules/@mixmark-io/domino/lib/NamedNodeMap.js +++ /dev/null @@ -1,41 +0,0 @@ -"use strict"; -module.exports = NamedNodeMap; - -var utils = require('./utils'); - -/* This is a hacky implementation of NamedNodeMap, intended primarily to - * satisfy clients (like dompurify and the web-platform-tests) which check - * to ensure that Node#attributes instanceof NamedNodeMap. */ - -function NamedNodeMap(element) { - this.element = element; -} -Object.defineProperties(NamedNodeMap.prototype, { - length: { get: utils.shouldOverride }, - item: { value: utils.shouldOverride }, - - getNamedItem: { value: function getNamedItem(qualifiedName) { - return this.element.getAttributeNode(qualifiedName); - } }, - getNamedItemNS: { value: function getNamedItemNS(namespace, localName) { - return this.element.getAttributeNodeNS(namespace, localName); - } }, - setNamedItem: { value: utils.nyi }, - setNamedItemNS: { value: utils.nyi }, - removeNamedItem: { value: function removeNamedItem(qualifiedName) { - var attr = this.element.getAttributeNode(qualifiedName); - if (attr) { - this.element.removeAttribute(qualifiedName); - return attr; - } - utils.NotFoundError(); - } }, - removeNamedItemNS: { value: function removeNamedItemNS(ns, lname) { - var attr = this.element.getAttributeNodeNS(ns, lname); - if (attr) { - this.element.removeAttributeNS(ns, lname); - return attr; - } - utils.NotFoundError(); - } }, -}); diff --git a/.output/server/node_modules/@mixmark-io/domino/lib/NavigatorID.js b/.output/server/node_modules/@mixmark-io/domino/lib/NavigatorID.js deleted file mode 100644 index d6f985c..0000000 --- a/.output/server/node_modules/@mixmark-io/domino/lib/NavigatorID.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; - -// https://html.spec.whatwg.org/multipage/webappapis.html#navigatorid -var NavigatorID = Object.create(null, { - appCodeName: { value: "Mozilla" }, - appName: { value: "Netscape" }, - appVersion: { value: "4.0" }, - platform: { value: "" }, - product: { value: "Gecko" }, - productSub: { value: "20100101" }, - userAgent: { value: "" }, - vendor: { value: "" }, - vendorSub: { value: "" }, - taintEnabled: { value: function() { return false; } } -}); - -module.exports = NavigatorID; diff --git a/.output/server/node_modules/@mixmark-io/domino/lib/Node.js b/.output/server/node_modules/@mixmark-io/domino/lib/Node.js deleted file mode 100644 index e8ac690..0000000 --- a/.output/server/node_modules/@mixmark-io/domino/lib/Node.js +++ /dev/null @@ -1,764 +0,0 @@ -"use strict"; -module.exports = Node; - -var EventTarget = require('./EventTarget'); -var LinkedList = require('./LinkedList'); -var NodeUtils = require('./NodeUtils'); -var utils = require('./utils'); - -// All nodes have a nodeType and an ownerDocument. -// Once inserted, they also have a parentNode. -// This is an abstract class; all nodes in a document are instances -// of a subtype, so all the properties are defined by more specific -// constructors. -function Node() { - EventTarget.call(this); - this.parentNode = null; - this._nextSibling = this._previousSibling = this; - this._index = undefined; -} - -var ELEMENT_NODE = Node.ELEMENT_NODE = 1; -var ATTRIBUTE_NODE = Node.ATTRIBUTE_NODE = 2; -var TEXT_NODE = Node.TEXT_NODE = 3; -var CDATA_SECTION_NODE = Node.CDATA_SECTION_NODE = 4; -var ENTITY_REFERENCE_NODE = Node.ENTITY_REFERENCE_NODE = 5; -var ENTITY_NODE = Node.ENTITY_NODE = 6; -var PROCESSING_INSTRUCTION_NODE = Node.PROCESSING_INSTRUCTION_NODE = 7; -var COMMENT_NODE = Node.COMMENT_NODE = 8; -var DOCUMENT_NODE = Node.DOCUMENT_NODE = 9; -var DOCUMENT_TYPE_NODE = Node.DOCUMENT_TYPE_NODE = 10; -var DOCUMENT_FRAGMENT_NODE = Node.DOCUMENT_FRAGMENT_NODE = 11; -var NOTATION_NODE = Node.NOTATION_NODE = 12; - -var DOCUMENT_POSITION_DISCONNECTED = Node.DOCUMENT_POSITION_DISCONNECTED = 0x01; -var DOCUMENT_POSITION_PRECEDING = Node.DOCUMENT_POSITION_PRECEDING = 0x02; -var DOCUMENT_POSITION_FOLLOWING = Node.DOCUMENT_POSITION_FOLLOWING = 0x04; -var DOCUMENT_POSITION_CONTAINS = Node.DOCUMENT_POSITION_CONTAINS = 0x08; -var DOCUMENT_POSITION_CONTAINED_BY = Node.DOCUMENT_POSITION_CONTAINED_BY = 0x10; -var DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20; - -Node.prototype = Object.create(EventTarget.prototype, { - - // Node that are not inserted into the tree inherit a null parent - - // XXX: the baseURI attribute is defined by dom core, but - // a correct implementation of it requires HTML features, so - // we'll come back to this later. - baseURI: { get: utils.nyi }, - - parentElement: { get: function() { - return (this.parentNode && this.parentNode.nodeType===ELEMENT_NODE) ? this.parentNode : null; - }}, - - hasChildNodes: { value: utils.shouldOverride }, - - firstChild: { get: utils.shouldOverride }, - - lastChild: { get: utils.shouldOverride }, - - isConnected: { - get: function () { - let node = this; - while (node != null) { - if (node.nodeType === Node.DOCUMENT_NODE) { - return true; - } - - node = node.parentNode; - if (node != null && node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) { - node = node.host; - } - } - return false; - }, - }, - - previousSibling: { get: function() { - var parent = this.parentNode; - if (!parent) return null; - if (this === parent.firstChild) return null; - return this._previousSibling; - }}, - - nextSibling: { get: function() { - var parent = this.parentNode, next = this._nextSibling; - if (!parent) return null; - if (next === parent.firstChild) return null; - return next; - }}, - - textContent: { - // Should override for DocumentFragment/Element/Attr/Text/PI/Comment - get: function() { return null; }, - set: function(v) { /* do nothing */ }, - }, - - innerText: { - // Should override for DocumentFragment/Element/Attr/Text/PI/Comment - get: function() { return null; }, - set: function(v) { /* do nothing */ }, - }, - - _countChildrenOfType: { value: function(type) { - var sum = 0; - for (var kid = this.firstChild; kid !== null; kid = kid.nextSibling) { - if (kid.nodeType === type) sum++; - } - return sum; - }}, - - _ensureInsertValid: { value: function _ensureInsertValid(node, child, isPreinsert) { - var parent = this, i, kid; - if (!node.nodeType) throw new TypeError('not a node'); - // 1. If parent is not a Document, DocumentFragment, or Element - // node, throw a HierarchyRequestError. - switch (parent.nodeType) { - case DOCUMENT_NODE: - case DOCUMENT_FRAGMENT_NODE: - case ELEMENT_NODE: - break; - default: utils.HierarchyRequestError(); - } - // 2. If node is a host-including inclusive ancestor of parent, - // throw a HierarchyRequestError. - if (node.isAncestor(parent)) utils.HierarchyRequestError(); - // 3. If child is not null and its parent is not parent, then - // throw a NotFoundError. (replaceChild omits the 'child is not null' - // and throws a TypeError here if child is null.) - if (child !== null || !isPreinsert) { - if (child.parentNode !== parent) utils.NotFoundError(); - } - // 4. If node is not a DocumentFragment, DocumentType, Element, - // Text, ProcessingInstruction, or Comment node, throw a - // HierarchyRequestError. - switch (node.nodeType) { - case DOCUMENT_FRAGMENT_NODE: - case DOCUMENT_TYPE_NODE: - case ELEMENT_NODE: - case TEXT_NODE: - case PROCESSING_INSTRUCTION_NODE: - case COMMENT_NODE: - break; - default: utils.HierarchyRequestError(); - } - // 5. If either node is a Text node and parent is a document, or - // node is a doctype and parent is not a document, throw a - // HierarchyRequestError. - // 6. If parent is a document, and any of the statements below, switched - // on node, are true, throw a HierarchyRequestError. - if (parent.nodeType === DOCUMENT_NODE) { - switch (node.nodeType) { - case TEXT_NODE: - utils.HierarchyRequestError(); - break; - case DOCUMENT_FRAGMENT_NODE: - // 6a1. If node has more than one element child or has a Text - // node child. - if (node._countChildrenOfType(TEXT_NODE) > 0) - utils.HierarchyRequestError(); - switch (node._countChildrenOfType(ELEMENT_NODE)) { - case 0: - break; - case 1: - // 6a2. Otherwise, if node has one element child and either - // parent has an element child, child is a doctype, or child - // is not null and a doctype is following child. [preinsert] - // 6a2. Otherwise, if node has one element child and either - // parent has an element child that is not child or a - // doctype is following child. [replaceWith] - if (child !== null /* always true here for replaceWith */) { - if (isPreinsert && child.nodeType === DOCUMENT_TYPE_NODE) - utils.HierarchyRequestError(); - for (kid = child.nextSibling; kid !== null; kid = kid.nextSibling) { - if (kid.nodeType === DOCUMENT_TYPE_NODE) - utils.HierarchyRequestError(); - } - } - i = parent._countChildrenOfType(ELEMENT_NODE); - if (isPreinsert) { - // "parent has an element child" - if (i > 0) - utils.HierarchyRequestError(); - } else { - // "parent has an element child that is not child" - if (i > 1 || (i === 1 && child.nodeType !== ELEMENT_NODE)) - utils.HierarchyRequestError(); - } - break; - default: // 6a1, continued. (more than one Element child) - utils.HierarchyRequestError(); - } - break; - case ELEMENT_NODE: - // 6b. parent has an element child, child is a doctype, or - // child is not null and a doctype is following child. [preinsert] - // 6b. parent has an element child that is not child or a - // doctype is following child. [replaceWith] - if (child !== null /* always true here for replaceWith */) { - if (isPreinsert && child.nodeType === DOCUMENT_TYPE_NODE) - utils.HierarchyRequestError(); - for (kid = child.nextSibling; kid !== null; kid = kid.nextSibling) { - if (kid.nodeType === DOCUMENT_TYPE_NODE) - utils.HierarchyRequestError(); - } - } - i = parent._countChildrenOfType(ELEMENT_NODE); - if (isPreinsert) { - // "parent has an element child" - if (i > 0) - utils.HierarchyRequestError(); - } else { - // "parent has an element child that is not child" - if (i > 1 || (i === 1 && child.nodeType !== ELEMENT_NODE)) - utils.HierarchyRequestError(); - } - break; - case DOCUMENT_TYPE_NODE: - // 6c. parent has a doctype child, child is non-null and an - // element is preceding child, or child is null and parent has - // an element child. [preinsert] - // 6c. parent has a doctype child that is not child, or an - // element is preceding child. [replaceWith] - if (child === null) { - if (parent._countChildrenOfType(ELEMENT_NODE)) - utils.HierarchyRequestError(); - } else { - // child is always non-null for [replaceWith] case - for (kid = parent.firstChild; kid !== null; kid = kid.nextSibling) { - if (kid === child) break; - if (kid.nodeType === ELEMENT_NODE) - utils.HierarchyRequestError(); - } - } - i = parent._countChildrenOfType(DOCUMENT_TYPE_NODE); - if (isPreinsert) { - // "parent has an doctype child" - if (i > 0) - utils.HierarchyRequestError(); - } else { - // "parent has an doctype child that is not child" - if (i > 1 || (i === 1 && child.nodeType !== DOCUMENT_TYPE_NODE)) - utils.HierarchyRequestError(); - } - break; - } - } else { - // 5, continued: (parent is not a document) - if (node.nodeType === DOCUMENT_TYPE_NODE) utils.HierarchyRequestError(); - } - }}, - - insertBefore: { value: function insertBefore(node, child) { - var parent = this; - // 1. Ensure pre-insertion validity - parent._ensureInsertValid(node, child, true); - // 2. Let reference child be child. - var refChild = child; - // 3. If reference child is node, set it to node's next sibling - if (refChild === node) { refChild = node.nextSibling; } - // 4. Adopt node into parent's node document. - parent.doc.adoptNode(node); - // 5. Insert node into parent before reference child. - node._insertOrReplace(parent, refChild, false); - // 6. Return node - return node; - }}, - - - appendChild: { value: function(child) { - // This invokes _appendChild after doing validity checks. - return this.insertBefore(child, null); - }}, - - _appendChild: { value: function(child) { - child._insertOrReplace(this, null, false); - }}, - - removeChild: { value: function removeChild(child) { - var parent = this; - if (!child.nodeType) throw new TypeError('not a node'); - if (child.parentNode !== parent) utils.NotFoundError(); - child.remove(); - return child; - }}, - - // To replace a `child` with `node` within a `parent` (this) - replaceChild: { value: function replaceChild(node, child) { - var parent = this; - // Ensure validity (slight differences from pre-insertion check) - parent._ensureInsertValid(node, child, false); - // Adopt node into parent's node document. - if (node.doc !== parent.doc) { - // XXX adoptNode has side-effect of removing node from its parent - // and generating a mutation event, thus causing the _insertOrReplace - // to generate two deletes and an insert instead of a 'move' - // event. It looks like the new MutationObserver stuff avoids - // this problem, but for now let's only adopt (ie, remove `node` - // from its parent) here if we need to. - parent.doc.adoptNode(node); - } - // Do the replace. - node._insertOrReplace(parent, child, true); - return child; - }}, - - // See: http://ejohn.org/blog/comparing-document-position/ - contains: { value: function contains(node) { - if (node === null) { return false; } - if (this === node) { return true; /* inclusive descendant */ } - /* jshint bitwise: false */ - return (this.compareDocumentPosition(node) & - DOCUMENT_POSITION_CONTAINED_BY) !== 0; - }}, - - compareDocumentPosition: { value: function compareDocumentPosition(that){ - // Basic algorithm for finding the relative position of two nodes. - // Make a list the ancestors of each node, starting with the - // document element and proceeding down to the nodes themselves. - // Then, loop through the lists, looking for the first element - // that differs. The order of those two elements give the - // order of their descendant nodes. Or, if one list is a prefix - // of the other one, then that node contains the other. - - if (this === that) return 0; - - // If they're not owned by the same document or if one is rooted - // and one is not, then they're disconnected. - if (this.doc !== that.doc || - this.rooted !== that.rooted) - return (DOCUMENT_POSITION_DISCONNECTED + - DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC); - - // Get arrays of ancestors for this and that - var these = [], those = []; - for(var n = this; n !== null; n = n.parentNode) these.push(n); - for(n = that; n !== null; n = n.parentNode) those.push(n); - these.reverse(); // So we start with the outermost - those.reverse(); - - if (these[0] !== those[0]) // No common ancestor - return (DOCUMENT_POSITION_DISCONNECTED + - DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC); - - n = Math.min(these.length, those.length); - for(var i = 1; i < n; i++) { - if (these[i] !== those[i]) { - // We found two different ancestors, so compare - // their positions - if (these[i].index < those[i].index) - return DOCUMENT_POSITION_FOLLOWING; - else - return DOCUMENT_POSITION_PRECEDING; - } - } - - // If we get to here, then one of the nodes (the one with the - // shorter list of ancestors) contains the other one. - if (these.length < those.length) - return (DOCUMENT_POSITION_FOLLOWING + - DOCUMENT_POSITION_CONTAINED_BY); - else - return (DOCUMENT_POSITION_PRECEDING + - DOCUMENT_POSITION_CONTAINS); - }}, - - isSameNode: {value : function isSameNode(node) { - return this === node; - }}, - - - // This method implements the generic parts of node equality testing - // and defers to the (non-recursive) type-specific isEqual() method - // defined by subclasses - isEqualNode: { value: function isEqualNode(node) { - if (!node) return false; - if (node.nodeType !== this.nodeType) return false; - - // Check type-specific properties for equality - if (!this.isEqual(node)) return false; - - // Now check children for number and equality - for (var c1 = this.firstChild, c2 = node.firstChild; - c1 && c2; - c1 = c1.nextSibling, c2 = c2.nextSibling) { - if (!c1.isEqualNode(c2)) return false; - } - return c1 === null && c2 === null; - }}, - - // This method delegates shallow cloning to a clone() method - // that each concrete subclass must implement - cloneNode: { value: function(deep) { - // Clone this node - var clone = this.clone(); - - // Handle the recursive case if necessary - if (deep) { - for (var kid = this.firstChild; kid !== null; kid = kid.nextSibling) { - clone._appendChild(kid.cloneNode(true)); - } - } - - return clone; - }}, - - lookupPrefix: { value: function lookupPrefix(ns) { - var e; - if (ns === '' || ns === null || ns === undefined) return null; - switch(this.nodeType) { - case ELEMENT_NODE: - return this._lookupNamespacePrefix(ns, this); - case DOCUMENT_NODE: - e = this.documentElement; - return e ? e.lookupPrefix(ns) : null; - case ENTITY_NODE: - case NOTATION_NODE: - case DOCUMENT_FRAGMENT_NODE: - case DOCUMENT_TYPE_NODE: - return null; - case ATTRIBUTE_NODE: - e = this.ownerElement; - return e ? e.lookupPrefix(ns) : null; - default: - e = this.parentElement; - return e ? e.lookupPrefix(ns) : null; - } - }}, - - - lookupNamespaceURI: {value: function lookupNamespaceURI(prefix) { - if (prefix === '' || prefix === undefined) { prefix = null; } - var e; - switch(this.nodeType) { - case ELEMENT_NODE: - return utils.shouldOverride(); - case DOCUMENT_NODE: - e = this.documentElement; - return e ? e.lookupNamespaceURI(prefix) : null; - case ENTITY_NODE: - case NOTATION_NODE: - case DOCUMENT_TYPE_NODE: - case DOCUMENT_FRAGMENT_NODE: - return null; - case ATTRIBUTE_NODE: - e = this.ownerElement; - return e ? e.lookupNamespaceURI(prefix) : null; - default: - e = this.parentElement; - return e ? e.lookupNamespaceURI(prefix) : null; - } - }}, - - isDefaultNamespace: { value: function isDefaultNamespace(ns) { - if (ns === '' || ns === undefined) { ns = null; } - var defaultNamespace = this.lookupNamespaceURI(null); - return (defaultNamespace === ns); - }}, - - // Utility methods for nodes. Not part of the DOM - - // Return the index of this node in its parent. - // Throw if no parent, or if this node is not a child of its parent - index: { get: function() { - var parent = this.parentNode; - if (this === parent.firstChild) return 0; // fast case - var kids = parent.childNodes; - if (this._index === undefined || kids[this._index] !== this) { - // Ensure that we don't have an O(N^2) blowup if none of the - // kids have defined indices yet and we're traversing via - // nextSibling or previousSibling - for (var i=0; i 2 ? spliceArgs[2] : null); - } else if (len > 2 && n !== null) { - LinkedList.insertBefore(spliceArgs[2], n); - } - if (parent._childNodes) { - spliceArgs[0] = (before === null) ? - parent._childNodes.length : before._index; - parent._childNodes.splice.apply(parent._childNodes, spliceArgs); - for (i=2; i 2) { - parent._firstChild = spliceArgs[2]; - } else if (isReplace) { - parent._firstChild = null; - } - } - // Remove all nodes from the document fragment - if (child._childNodes) { - child._childNodes.length = 0; - } else { - child._firstChild = null; - } - // Call the mutation handlers - // Use spliceArgs since the original array has been destroyed. The - // liveness guarantee requires us to clone the array so that - // references to the childNodes of the DocumentFragment will be empty - // when the insertion handlers are called. - if (parent.rooted) { - parent.modify(); - for (i = 2; i < len; i++) { - parent.doc.mutateInsert(spliceArgs[i]); - } - } - } else { - if (before === child) { return; } - if (bothRooted) { - // Remove the child from its current position in the tree - // without calling remove(), since we don't want to uproot it. - child._remove(); - } else if (child.parentNode) { - child.remove(); - } - - // Insert it as a child of its new parent - child.parentNode = parent; - if (isReplace) { - LinkedList.replace(n, child); - if (parent._childNodes) { - child._index = before_index; - parent._childNodes[before_index] = child; - } else if (parent._firstChild === before) { - parent._firstChild = child; - } - } else { - if (n !== null) { - LinkedList.insertBefore(child, n); - } - if (parent._childNodes) { - child._index = before_index; - parent._childNodes.splice(before_index, 0, child); - } else if (parent._firstChild === before) { - parent._firstChild = child; - } - } - if (bothRooted) { - parent.modify(); - // Generate a move mutation event - parent.doc.mutateMove(child); - } else if (parent.rooted) { - parent.modify(); - parent.doc.mutateInsert(child); - } - } - }}, - - - // Return the lastModTime value for this node. (For use as a - // cache invalidation mechanism. If the node does not already - // have one, initialize it from the owner document's modclock - // property. (Note that modclock does not return the actual - // time; it is simply a counter incremented on each document - // modification) - lastModTime: { get: function() { - if (!this._lastModTime) { - this._lastModTime = this.doc.modclock; - } - return this._lastModTime; - }}, - - // Increment the owner document's modclock and use the new - // value to update the lastModTime value for this node and - // all of its ancestors. Nodes that have never had their - // lastModTime value queried do not need to have a - // lastModTime property set on them since there is no - // previously queried value to ever compare the new value - // against, so only update nodes that already have a - // _lastModTime property. - modify: { value: function() { - if (this.doc.modclock) { // Skip while doc.modclock == 0 - var time = ++this.doc.modclock; - for(var n = this; n; n = n.parentElement) { - if (n._lastModTime) { - n._lastModTime = time; - } - } - } - }}, - - // This attribute is not part of the DOM but is quite helpful. - // It returns the document with which a node is associated. Usually - // this is the ownerDocument. But ownerDocument is null for the - // document object itself, so this is a handy way to get the document - // regardless of the node type - doc: { get: function() { - return this.ownerDocument || this; - }}, - - - // If the node has a nid (node id), then it is rooted in a document - rooted: { get: function() { - return !!this._nid; - }}, - - normalize: { value: function() { - var next; - for (var child=this.firstChild; child !== null; child=next) { - next = child.nextSibling; - - if (child.normalize) { - child.normalize(); - } - - if (child.nodeType !== Node.TEXT_NODE) { - continue; - } - - if (child.nodeValue === "") { - this.removeChild(child); - continue; - } - - var prevChild = child.previousSibling; - if (prevChild === null) { - continue; - } else if (prevChild.nodeType === Node.TEXT_NODE) { - // merge this with previous and remove the child - prevChild.appendData(child.nodeValue); - this.removeChild(child); - } - } - }}, - - // Convert the children of a node to an HTML string. - // This is used by the innerHTML getter - // The serialization spec is at: - // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-end.html#serializing-html-fragments - // - // The serialization logic is intentionally implemented in a separate - // `NodeUtils` helper instead of the more obvious choice of a private - // `_serializeOne()` method on the `Node.prototype` in order to avoid - // the megamorphic `this._serializeOne` property access, which reduces - // performance unnecessarily. If you need specialized behavior for a - // certain subclass, you'll need to implement that in `NodeUtils`. - // See https://github.com/fgnass/domino/pull/142 for more information. - serialize: { value: function() { - if (this._innerHTML) { - return this._innerHTML; - } - var s = ''; - for (var kid = this.firstChild; kid !== null; kid = kid.nextSibling) { - s += NodeUtils.serializeOne(kid, this); - } - return s; - }}, - - // Non-standard, but often useful for debugging. - outerHTML: { - get: function() { - return NodeUtils.serializeOne(this, { nodeType: 0 }); - }, - set: utils.nyi, - }, - - // mirror node type properties in the prototype, so they are present - // in instances of Node (and subclasses) - ELEMENT_NODE: { value: ELEMENT_NODE }, - ATTRIBUTE_NODE: { value: ATTRIBUTE_NODE }, - TEXT_NODE: { value: TEXT_NODE }, - CDATA_SECTION_NODE: { value: CDATA_SECTION_NODE }, - ENTITY_REFERENCE_NODE: { value: ENTITY_REFERENCE_NODE }, - ENTITY_NODE: { value: ENTITY_NODE }, - PROCESSING_INSTRUCTION_NODE: { value: PROCESSING_INSTRUCTION_NODE }, - COMMENT_NODE: { value: COMMENT_NODE }, - DOCUMENT_NODE: { value: DOCUMENT_NODE }, - DOCUMENT_TYPE_NODE: { value: DOCUMENT_TYPE_NODE }, - DOCUMENT_FRAGMENT_NODE: { value: DOCUMENT_FRAGMENT_NODE }, - NOTATION_NODE: { value: NOTATION_NODE }, - - DOCUMENT_POSITION_DISCONNECTED: { value: DOCUMENT_POSITION_DISCONNECTED }, - DOCUMENT_POSITION_PRECEDING: { value: DOCUMENT_POSITION_PRECEDING }, - DOCUMENT_POSITION_FOLLOWING: { value: DOCUMENT_POSITION_FOLLOWING }, - DOCUMENT_POSITION_CONTAINS: { value: DOCUMENT_POSITION_CONTAINS }, - DOCUMENT_POSITION_CONTAINED_BY: { value: DOCUMENT_POSITION_CONTAINED_BY }, - DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: { value: DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC }, -}); diff --git a/.output/server/node_modules/@mixmark-io/domino/lib/NodeFilter.js b/.output/server/node_modules/@mixmark-io/domino/lib/NodeFilter.js deleted file mode 100644 index efa5183..0000000 --- a/.output/server/node_modules/@mixmark-io/domino/lib/NodeFilter.js +++ /dev/null @@ -1,24 +0,0 @@ -"use strict"; -var NodeFilter = { - // Constants for acceptNode() - FILTER_ACCEPT: 1, - FILTER_REJECT: 2, - FILTER_SKIP: 3, - - // Constants for whatToShow - SHOW_ALL: 0xFFFFFFFF, - SHOW_ELEMENT: 0x1, - SHOW_ATTRIBUTE: 0x2, // historical - SHOW_TEXT: 0x4, - SHOW_CDATA_SECTION: 0x8, // historical - SHOW_ENTITY_REFERENCE: 0x10, // historical - SHOW_ENTITY: 0x20, // historical - SHOW_PROCESSING_INSTRUCTION: 0x40, - SHOW_COMMENT: 0x80, - SHOW_DOCUMENT: 0x100, - SHOW_DOCUMENT_TYPE: 0x200, - SHOW_DOCUMENT_FRAGMENT: 0x400, - SHOW_NOTATION: 0x800 // historical -}; - -module.exports = (NodeFilter.constructor = NodeFilter.prototype = NodeFilter); diff --git a/.output/server/node_modules/@mixmark-io/domino/lib/NodeIterator.js b/.output/server/node_modules/@mixmark-io/domino/lib/NodeIterator.js deleted file mode 100644 index 8a2d90d..0000000 --- a/.output/server/node_modules/@mixmark-io/domino/lib/NodeIterator.js +++ /dev/null @@ -1,217 +0,0 @@ -"use strict"; -module.exports = NodeIterator; - -var NodeFilter = require('./NodeFilter'); -var NodeTraversal = require('./NodeTraversal'); -var utils = require('./utils'); - -/* Private methods and helpers */ - -/** - * @based on WebKit's NodeIterator::moveToNext and NodeIterator::moveToPrevious - * https://trac.webkit.org/browser/trunk/Source/WebCore/dom/NodeIterator.cpp?rev=186279#L51 - */ -function move(node, stayWithin, directionIsNext) { - if (directionIsNext) { - return NodeTraversal.next(node, stayWithin); - } else { - if (node === stayWithin) { - return null; - } - return NodeTraversal.previous(node, null); - } -} - -function isInclusiveAncestor(node, possibleChild) { - for ( ; possibleChild; possibleChild = possibleChild.parentNode) { - if (node === possibleChild) { return true; } - } - return false; -} - -/** - * @spec http://www.w3.org/TR/dom/#concept-nodeiterator-traverse - * @method - * @access private - * @param {NodeIterator} ni - * @param {string} direction One of 'next' or 'previous'. - * @return {Node|null} - */ -function traverse(ni, directionIsNext) { - var node, beforeNode; - node = ni._referenceNode; - beforeNode = ni._pointerBeforeReferenceNode; - while (true) { - if (beforeNode === directionIsNext) { - beforeNode = !beforeNode; - } else { - node = move(node, ni._root, directionIsNext); - if (node === null) { - return null; - } - } - var result = ni._internalFilter(node); - if (result === NodeFilter.FILTER_ACCEPT) { - break; - } - } - ni._referenceNode = node; - ni._pointerBeforeReferenceNode = beforeNode; - return node; -} - -/* Public API */ - -/** - * Implemented version: http://www.w3.org/TR/2015/WD-dom-20150618/#nodeiterator - * Latest version: http://www.w3.org/TR/dom/#nodeiterator - * - * @constructor - * @param {Node} root - * @param {number} whatToShow [optional] - * @param {Function|NodeFilter} filter [optional] - * @throws Error - */ -function NodeIterator(root, whatToShow, filter) { - if (!root || !root.nodeType) { - utils.NotSupportedError(); - } - - // Read-only properties - this._root = root; - this._referenceNode = root; - this._pointerBeforeReferenceNode = true; - this._whatToShow = Number(whatToShow) || 0; - this._filter = filter || null; - this._active = false; - // Record active node iterators in the document, in order to perform - // "node iterator pre-removal steps". - root.doc._attachNodeIterator(this); -} - -Object.defineProperties(NodeIterator.prototype, { - root: { get: function root() { - return this._root; - } }, - referenceNode: { get: function referenceNode() { - return this._referenceNode; - } }, - pointerBeforeReferenceNode: { get: function pointerBeforeReferenceNode() { - return this._pointerBeforeReferenceNode; - } }, - whatToShow: { get: function whatToShow() { - return this._whatToShow; - } }, - filter: { get: function filter() { - return this._filter; - } }, - - /** - * @method - * @param {Node} node - * @return {Number} Constant NodeFilter.FILTER_ACCEPT, - * NodeFilter.FILTER_REJECT or NodeFilter.FILTER_SKIP. - */ - _internalFilter: { value: function _internalFilter(node) { - /* jshint bitwise: false */ - var result, filter; - if (this._active) { - utils.InvalidStateError(); - } - - // Maps nodeType to whatToShow - if (!(((1 << (node.nodeType - 1)) & this._whatToShow))) { - return NodeFilter.FILTER_SKIP; - } - - filter = this._filter; - if (filter === null) { - result = NodeFilter.FILTER_ACCEPT; - } else { - this._active = true; - try { - if (typeof filter === 'function') { - result = filter(node); - } else { - result = filter.acceptNode(node); - } - } finally { - this._active = false; - } - } - - // Note that coercing to a number means that - // `true` becomes `1` (which is NodeFilter.FILTER_ACCEPT) - // `false` becomes `0` (neither accept, reject, or skip) - return (+result); - } }, - - /** - * @spec https://dom.spec.whatwg.org/#nodeiterator-pre-removing-steps - * @method - * @return void - */ - _preremove: { value: function _preremove(toBeRemovedNode) { - if (isInclusiveAncestor(toBeRemovedNode, this._root)) { return; } - if (!isInclusiveAncestor(toBeRemovedNode, this._referenceNode)) { return; } - if (this._pointerBeforeReferenceNode) { - var next = toBeRemovedNode; - while (next.lastChild) { - next = next.lastChild; - } - next = NodeTraversal.next(next, this.root); - if (next) { - this._referenceNode = next; - return; - } - this._pointerBeforeReferenceNode = false; - // fall through - } - if (toBeRemovedNode.previousSibling === null) { - this._referenceNode = toBeRemovedNode.parentNode; - } else { - this._referenceNode = toBeRemovedNode.previousSibling; - var lastChild; - for (lastChild = this._referenceNode.lastChild; - lastChild; - lastChild = this._referenceNode.lastChild) { - this._referenceNode = lastChild; - } - } - } }, - - /** - * @spec http://www.w3.org/TR/dom/#dom-nodeiterator-nextnode - * @method - * @return {Node|null} - */ - nextNode: { value: function nextNode() { - return traverse(this, true); - } }, - - /** - * @spec http://www.w3.org/TR/dom/#dom-nodeiterator-previousnode - * @method - * @return {Node|null} - */ - previousNode: { value: function previousNode() { - return traverse(this, false); - } }, - - /** - * @spec http://www.w3.org/TR/dom/#dom-nodeiterator-detach - * @method - * @return void - */ - detach: { value: function detach() { - /* "The detach() method must do nothing. - * Its functionality (disabling a NodeIterator object) was removed, - * but the method itself is preserved for compatibility. - */ - } }, - - /** For compatibility with web-platform-tests. */ - toString: { value: function toString() { - return "[object NodeIterator]"; - } }, -}); diff --git a/.output/server/node_modules/@mixmark-io/domino/lib/NodeList.es5.js b/.output/server/node_modules/@mixmark-io/domino/lib/NodeList.es5.js deleted file mode 100644 index dede302..0000000 --- a/.output/server/node_modules/@mixmark-io/domino/lib/NodeList.es5.js +++ /dev/null @@ -1,15 +0,0 @@ -"use strict"; - -// No support for subclassing array, return an actual Array object. -function item(i) { - /* jshint validthis: true */ - return this[i] || null; -} - -function NodeList(a) { - if (!a) a = []; - a.item = item; - return a; -} - -module.exports = NodeList; diff --git a/.output/server/node_modules/@mixmark-io/domino/lib/NodeList.es6.js b/.output/server/node_modules/@mixmark-io/domino/lib/NodeList.es6.js deleted file mode 100644 index ee47bfa..0000000 --- a/.output/server/node_modules/@mixmark-io/domino/lib/NodeList.es6.js +++ /dev/null @@ -1,12 +0,0 @@ -/* jshint esversion: 6 */ -"use strict"; - -module.exports = class NodeList extends Array { - constructor(a) { - super((a && a.length) || 0); - if (a) { - for (var idx in a) { this[idx] = a[idx]; } - } - } - item(i) { return this[i] || null; } -}; diff --git a/.output/server/node_modules/@mixmark-io/domino/lib/NodeList.js b/.output/server/node_modules/@mixmark-io/domino/lib/NodeList.js deleted file mode 100644 index cff8fae..0000000 --- a/.output/server/node_modules/@mixmark-io/domino/lib/NodeList.js +++ /dev/null @@ -1,13 +0,0 @@ -"use strict"; - -var NodeList; - -try { - // Attempt to use ES6-style Array subclass if possible. - NodeList = require('./NodeList.es6.js'); -} catch (e) { - // No support for subclassing array, return an actual Array object. - NodeList = require('./NodeList.es5.js'); -} - -module.exports = NodeList; diff --git a/.output/server/node_modules/@mixmark-io/domino/lib/NodeTraversal.js b/.output/server/node_modules/@mixmark-io/domino/lib/NodeTraversal.js deleted file mode 100644 index 1d3648d..0000000 --- a/.output/server/node_modules/@mixmark-io/domino/lib/NodeTraversal.js +++ /dev/null @@ -1,87 +0,0 @@ -"use strict"; -/* exported NodeTraversal */ -var NodeTraversal = module.exports = { - nextSkippingChildren: nextSkippingChildren, - nextAncestorSibling: nextAncestorSibling, - next: next, - previous: previous, - deepLastChild: deepLastChild -}; - -/** - * @based on WebKit's NodeTraversal::nextSkippingChildren - * https://trac.webkit.org/browser/trunk/Source/WebCore/dom/NodeTraversal.h?rev=179143#L109 - */ -function nextSkippingChildren(node, stayWithin) { - if (node === stayWithin) { - return null; - } - if (node.nextSibling !== null) { - return node.nextSibling; - } - return nextAncestorSibling(node, stayWithin); -} - -/** - * @based on WebKit's NodeTraversal::nextAncestorSibling - * https://trac.webkit.org/browser/trunk/Source/WebCore/dom/NodeTraversal.cpp?rev=179143#L93 - */ -function nextAncestorSibling(node, stayWithin) { - for (node = node.parentNode; node !== null; node = node.parentNode) { - if (node === stayWithin) { - return null; - } - if (node.nextSibling !== null) { - return node.nextSibling; - } - } - return null; -} - -/** - * @based on WebKit's NodeTraversal::next - * https://trac.webkit.org/browser/trunk/Source/WebCore/dom/NodeTraversal.h?rev=179143#L99 - */ -function next(node, stayWithin) { - var n; - n = node.firstChild; - if (n !== null) { - return n; - } - if (node === stayWithin) { - return null; - } - n = node.nextSibling; - if (n !== null) { - return n; - } - return nextAncestorSibling(node, stayWithin); -} - -/** - * @based on WebKit's NodeTraversal::deepLastChild - * https://trac.webkit.org/browser/trunk/Source/WebCore/dom/NodeTraversal.cpp?rev=179143#L116 - */ -function deepLastChild(node) { - while (node.lastChild) { - node = node.lastChild; - } - return node; -} - -/** - * @based on WebKit's NodeTraversal::previous - * https://trac.webkit.org/browser/trunk/Source/WebCore/dom/NodeTraversal.h?rev=179143#L121 - */ -function previous(node, stayWithin) { - var p; - p = node.previousSibling; - if (p !== null) { - return deepLastChild(p); - } - p = node.parentNode; - if (p === stayWithin) { - return null; - } - return p; -} diff --git a/.output/server/node_modules/@mixmark-io/domino/lib/NodeUtils.js b/.output/server/node_modules/@mixmark-io/domino/lib/NodeUtils.js deleted file mode 100644 index b10e359..0000000 --- a/.output/server/node_modules/@mixmark-io/domino/lib/NodeUtils.js +++ /dev/null @@ -1,246 +0,0 @@ -"use strict"; -module.exports = { - // NOTE: The `serializeOne()` function used to live on the `Node.prototype` - // as a private method `Node#_serializeOne(child)`, however that requires - // a megamorphic property access `this._serializeOne` just to get to the - // method, and this is being done on lots of different `Node` subclasses, - // which puts a lot of pressure on V8's megamorphic stub cache. So by - // moving the helper off of the `Node.prototype` and into a separate - // function in this helper module, we get a monomorphic property access - // `NodeUtils.serializeOne` to get to the function and reduce pressure - // on the megamorphic stub cache. - // See https://github.com/fgnass/domino/pull/142 for more information. - serializeOne: serializeOne, - - // Export util functions so that we can run extra test for them. - // Note: we prefix function names with `ɵ`, similar to what we do - // with internal functions in Angular packages. - ɵescapeMatchingClosingTag: escapeMatchingClosingTag, - ɵescapeClosingCommentTag: escapeClosingCommentTag, - ɵescapeProcessingInstructionContent: escapeProcessingInstructionContent -}; - -var utils = require('./utils'); -var NAMESPACE = utils.NAMESPACE; - -var hasRawContent = { - STYLE: true, - SCRIPT: true, - XMP: true, - IFRAME: true, - NOEMBED: true, - NOFRAMES: true, - PLAINTEXT: true -}; - -var emptyElements = { - area: true, - base: true, - basefont: true, - bgsound: true, - br: true, - col: true, - embed: true, - frame: true, - hr: true, - img: true, - input: true, - keygen: true, - link: true, - meta: true, - param: true, - source: true, - track: true, - wbr: true -}; - -var extraNewLine = { - /* Removed in https://github.com/whatwg/html/issues/944 - pre: true, - textarea: true, - listing: true - */ -}; - -const ESCAPE_REGEXP = /[&<>\u00A0]/g; -const ESCAPE_ATTR_REGEXP = /[&"<>\u00A0]/g; - -function escape(s) { - if (!ESCAPE_REGEXP.test(s)) { - // nothing to do, fast path - return s; - } - - return s.replace(ESCAPE_REGEXP, (c) => { - switch (c) { - case "&": - return "&"; - case "<": - return "<"; - case ">": - return ">"; - case "\u00A0": - return " "; - } - }); -} - -function escapeAttr(s) { - if (!ESCAPE_ATTR_REGEXP.test(s)) { - // nothing to do, fast path - return s; - } - - return s.replace(ESCAPE_ATTR_REGEXP, (c) => { - switch (c) { - case "<": - return "<"; - case ">": - return ">"; - case "&": - return "&"; - case '"': - return """; - case "\u00A0": - return " "; - } - }); -} - -function attrname(a) { - var ns = a.namespaceURI; - if (!ns) - return a.localName; - if (ns === NAMESPACE.XML) - return 'xml:' + a.localName; - if (ns === NAMESPACE.XLINK) - return 'xlink:' + a.localName; - - if (ns === NAMESPACE.XMLNS) { - if (a.localName === 'xmlns') return 'xmlns'; - else return 'xmlns:' + a.localName; - } - return a.name; -} - -/** - * Escapes matching closing tag in a raw text. - * - * For example, given `)`, - * the parent tag would by "style" and the raw text is - * "". If we come across a matching closing tag - * (in out case ``) - replace `<` with `<` to avoid unexpected - * and unsafe behavior after de-serialization. - */ -function escapeMatchingClosingTag(rawText, parentTag) { - const parentClosingTag = '/; - -/** - * Escapes closing comment tag in a comment content. - * - * For example, given `#comment('-->')`, the content of a comment would be - * updated to `-->` to avoid unexpected and unsafe behavior after - * de-serialization. - */ -function escapeClosingCommentTag(rawContent) { - if (!CLOSING_COMMENT_REGEXP.test(rawContent)) { - return rawContent; // fast path - } - return rawContent.replace(/(--\!?)>/g, '$1>'); -} - -/** - * Escapes processing instruction content by replacing `>` with `>`. - */ -function escapeProcessingInstructionContent(rawContent) { - return rawContent.includes('>') - ? rawContent.replaceAll('>', '>') - : rawContent; -} - -function serializeOne(kid, parent) { - var s = ''; - switch(kid.nodeType) { - case 1: //ELEMENT_NODE - var ns = kid.namespaceURI; - var html = ns === NAMESPACE.HTML; - var tagname = (html || ns === NAMESPACE.SVG || ns === NAMESPACE.MATHML) ? kid.localName : kid.tagName; - - s += '<' + tagname; - - for(var j = 0, k = kid._numattrs; j < k; j++) { - var a = kid._attr(j); - s += ' ' + attrname(a); - if (a.value !== undefined) s += '="' + escapeAttr(a.value) + '"'; - } - s += '>'; - - if (!(html && emptyElements[tagname])) { - var ss = kid.serialize(); - // If an element can have raw content, this content may - // potentially require escaping to avoid XSS. - if (hasRawContent[tagname.toUpperCase()]) { - ss = escapeMatchingClosingTag(ss, tagname); - } - if (html && extraNewLine[tagname] && ss.charAt(0)==='\n') s += '\n'; - // Serialize children and add end tag for all others - s += ss; - s += ''; - } - break; - case 3: //TEXT_NODE - case 4: //CDATA_SECTION_NODE - var parenttag; - if (parent.nodeType === 1 /*ELEMENT_NODE*/ && - parent.namespaceURI === NAMESPACE.HTML) - parenttag = parent.tagName; - else - parenttag = ''; - - if (hasRawContent[parenttag] || - (parenttag==='NOSCRIPT' && parent.ownerDocument._scripting_enabled)) { - s += kid.data; - } else { - s += escape(kid.data); - } - break; - case 8: //COMMENT_NODE - s += ''; - break; - case 7: //PROCESSING_INSTRUCTION_NODE - const content = escapeProcessingInstructionContent(kid.data); - s += ''; - break; - case 10: //DOCUMENT_TYPE_NODE - s += ''; - break; - default: - utils.InvalidStateError(); - } - return s; -} diff --git a/.output/server/node_modules/@mixmark-io/domino/lib/NonDocumentTypeChildNode.js b/.output/server/node_modules/@mixmark-io/domino/lib/NonDocumentTypeChildNode.js deleted file mode 100644 index 38ed5d2..0000000 --- a/.output/server/node_modules/@mixmark-io/domino/lib/NonDocumentTypeChildNode.js +++ /dev/null @@ -1,26 +0,0 @@ -"use strict"; -var Node = require('./Node'); - -var NonDocumentTypeChildNode = { - - nextElementSibling: { get: function() { - if (this.parentNode) { - for (var kid = this.nextSibling; kid !== null; kid = kid.nextSibling) { - if (kid.nodeType === Node.ELEMENT_NODE) return kid; - } - } - return null; - }}, - - previousElementSibling: { get: function() { - if (this.parentNode) { - for (var kid = this.previousSibling; kid !== null; kid = kid.previousSibling) { - if (kid.nodeType === Node.ELEMENT_NODE) return kid; - } - } - return null; - }} - -}; - -module.exports = NonDocumentTypeChildNode; diff --git a/.output/server/node_modules/@mixmark-io/domino/lib/ProcessingInstruction.js b/.output/server/node_modules/@mixmark-io/domino/lib/ProcessingInstruction.js deleted file mode 100644 index 8056fb6..0000000 --- a/.output/server/node_modules/@mixmark-io/domino/lib/ProcessingInstruction.js +++ /dev/null @@ -1,44 +0,0 @@ -"use strict"; -module.exports = ProcessingInstruction; - -var Node = require('./Node'); -var CharacterData = require('./CharacterData'); - -function ProcessingInstruction(doc, target, data) { - CharacterData.call(this); - this.nodeType = Node.PROCESSING_INSTRUCTION_NODE; - this.ownerDocument = doc; - this.target = target; - this._data = data; -} - -var nodeValue = { - get: function() { return this._data; }, - set: function(v) { - if (v === null || v === undefined) { v = ''; } else { v = String(v); } - this._data = v; - if (this.rooted) this.ownerDocument.mutateValue(this); - } -}; - -ProcessingInstruction.prototype = Object.create(CharacterData.prototype, { - nodeName: { get: function() { return this.target; }}, - nodeValue: nodeValue, - textContent: nodeValue, - innerText: nodeValue, - data: { - get: nodeValue.get, - set: function(v) { - nodeValue.set.call(this, v===null ? '' : String(v)); - }, - }, - - // Utility methods - clone: { value: function clone() { - return new ProcessingInstruction(this.ownerDocument, this.target, this._data); - }}, - isEqual: { value: function isEqual(n) { - return this.target === n.target && this._data === n._data; - }} - -}); diff --git a/.output/server/node_modules/@mixmark-io/domino/lib/Text.js b/.output/server/node_modules/@mixmark-io/domino/lib/Text.js deleted file mode 100644 index 8ee099a..0000000 --- a/.output/server/node_modules/@mixmark-io/domino/lib/Text.js +++ /dev/null @@ -1,75 +0,0 @@ -"use strict"; -module.exports = Text; - -var utils = require('./utils'); -var Node = require('./Node'); -var CharacterData = require('./CharacterData'); - -function Text(doc, data) { - CharacterData.call(this); - this.nodeType = Node.TEXT_NODE; - this.ownerDocument = doc; - this._data = data; - this._index = undefined; -} - -var nodeValue = { - get: function() { return this._data; }, - set: function(v) { - if (v === null || v === undefined) { v = ''; } else { v = String(v); } - if (v === this._data) return; - this._data = v; - if (this.rooted) - this.ownerDocument.mutateValue(this); - if (this.parentNode && - this.parentNode._textchangehook) - this.parentNode._textchangehook(this); - } -}; - -Text.prototype = Object.create(CharacterData.prototype, { - nodeName: { value: "#text" }, - // These three attributes are all the same. - // The data attribute has a [TreatNullAs=EmptyString] but we'll - // implement that at the interface level - nodeValue: nodeValue, - textContent: nodeValue, - innerText: nodeValue, - data: { - get: nodeValue.get, - set: function(v) { - nodeValue.set.call(this, v===null ? '' : String(v)); - }, - }, - - splitText: { value: function splitText(offset) { - if (offset > this._data.length || offset < 0) utils.IndexSizeError(); - - var newdata = this._data.substring(offset), - newnode = this.ownerDocument.createTextNode(newdata); - this.data = this.data.substring(0, offset); - - var parent = this.parentNode; - if (parent !== null) - parent.insertBefore(newnode, this.nextSibling); - - return newnode; - }}, - - wholeText: { get: function wholeText() { - var result = this.textContent; - for (var next = this.nextSibling; next; next = next.nextSibling) { - if (next.nodeType !== Node.TEXT_NODE) { break; } - result += next.textContent; - } - return result; - }}, - // Obsolete, removed from spec. - replaceWholeText: { value: utils.nyi }, - - // Utility methods - clone: { value: function clone() { - return new Text(this.ownerDocument, this._data); - }}, - -}); diff --git a/.output/server/node_modules/@mixmark-io/domino/lib/TreeWalker.js b/.output/server/node_modules/@mixmark-io/domino/lib/TreeWalker.js deleted file mode 100644 index b23756d..0000000 --- a/.output/server/node_modules/@mixmark-io/domino/lib/TreeWalker.js +++ /dev/null @@ -1,336 +0,0 @@ -"use strict"; -module.exports = TreeWalker; - -var Node = require('./Node'); -var NodeFilter = require('./NodeFilter'); -var NodeTraversal = require('./NodeTraversal'); -var utils = require('./utils'); - -var mapChild = { - first: 'firstChild', - last: 'lastChild', - next: 'firstChild', - previous: 'lastChild' -}; - -var mapSibling = { - first: 'nextSibling', - last: 'previousSibling', - next: 'nextSibling', - previous: 'previousSibling' -}; - -/* Private methods and helpers */ - -/** - * @spec https://dom.spec.whatwg.org/#concept-traverse-children - * @method - * @access private - * @param {TreeWalker} tw - * @param {string} type One of 'first' or 'last'. - * @return {Node|null} - */ -function traverseChildren(tw, type) { - var child, node, parent, result, sibling; - node = tw._currentNode[mapChild[type]]; - while (node !== null) { - result = tw._internalFilter(node); - if (result === NodeFilter.FILTER_ACCEPT) { - tw._currentNode = node; - return node; - } - if (result === NodeFilter.FILTER_SKIP) { - child = node[mapChild[type]]; - if (child !== null) { - node = child; - continue; - } - } - while (node !== null) { - sibling = node[mapSibling[type]]; - if (sibling !== null) { - node = sibling; - break; - } - parent = node.parentNode; - if (parent === null || parent === tw.root || parent === tw._currentNode) { - return null; - } else { - node = parent; - } - } - } - return null; -} - -/** - * @spec https://dom.spec.whatwg.org/#concept-traverse-siblings - * @method - * @access private - * @param {TreeWalker} tw - * @param {TreeWalker} type One of 'next' or 'previous'. - * @return {Node|nul} - */ -function traverseSiblings(tw, type) { - var node, result, sibling; - node = tw._currentNode; - if (node === tw.root) { - return null; - } - while (true) { - sibling = node[mapSibling[type]]; - while (sibling !== null) { - node = sibling; - result = tw._internalFilter(node); - if (result === NodeFilter.FILTER_ACCEPT) { - tw._currentNode = node; - return node; - } - sibling = node[mapChild[type]]; - if (result === NodeFilter.FILTER_REJECT || sibling === null) { - sibling = node[mapSibling[type]]; - } - } - node = node.parentNode; - if (node === null || node === tw.root) { - return null; - } - if (tw._internalFilter(node) === NodeFilter.FILTER_ACCEPT) { - return null; - } - } -} - - -/* Public API */ - -/** - * Latest version: https://dom.spec.whatwg.org/#treewalker - * - * @constructor - * @param {Node} root - * @param {number} whatToShow [optional] - * @param {Function|NodeFilter} filter [optional] - * @throws Error - */ -function TreeWalker(root, whatToShow, filter) { - if (!root || !root.nodeType) { - utils.NotSupportedError(); - } - - // Read-only properties - this._root = root; - this._whatToShow = Number(whatToShow) || 0; - this._filter = filter || null; - this._active = false; - // Read-write property - this._currentNode = root; -} - -Object.defineProperties(TreeWalker.prototype, { - root: { get: function() { return this._root; } }, - whatToShow: { get: function() { return this._whatToShow; } }, - filter: { get: function() { return this._filter; } }, - - currentNode: { - get: function currentNode() { - return this._currentNode; - }, - set: function setCurrentNode(v) { - if (!(v instanceof Node)) { - throw new TypeError("Not a Node"); // `null` is also not a node - } - this._currentNode = v; - }, - }, - - /** - * @method - * @param {Node} node - * @return {Number} Constant NodeFilter.FILTER_ACCEPT, - * NodeFilter.FILTER_REJECT or NodeFilter.FILTER_SKIP. - */ - _internalFilter: { value: function _internalFilter(node) { - /* jshint bitwise: false */ - var result, filter; - if (this._active) { - utils.InvalidStateError(); - } - - // Maps nodeType to whatToShow - if (!(((1 << (node.nodeType - 1)) & this._whatToShow))) { - return NodeFilter.FILTER_SKIP; - } - - filter = this._filter; - if (filter === null) { - result = NodeFilter.FILTER_ACCEPT; - } else { - this._active = true; - try { - if (typeof filter === 'function') { - result = filter(node); - } else { - result = filter.acceptNode(node); - } - } finally { - this._active = false; - } - } - - // Note that coercing to a number means that - // `true` becomes `1` (which is NodeFilter.FILTER_ACCEPT) - // `false` becomes `0` (neither accept, reject, or skip) - return (+result); - }}, - - /** - * @spec https://dom.spec.whatwg.org/#dom-treewalker-parentnode - * @based on WebKit's TreeWalker::parentNode - * https://trac.webkit.org/browser/webkit/trunk/Source/WebCore/dom/TreeWalker.cpp?rev=220453#L50 - * @method - * @return {Node|null} - */ - parentNode: { value: function parentNode() { - var node = this._currentNode; - while (node !== this.root) { - node = node.parentNode; - if (node === null) { - return null; - } - if (this._internalFilter(node) === NodeFilter.FILTER_ACCEPT) { - this._currentNode = node; - return node; - } - } - return null; - }}, - - /** - * @spec https://dom.spec.whatwg.org/#dom-treewalker-firstchild - * @method - * @return {Node|null} - */ - firstChild: { value: function firstChild() { - return traverseChildren(this, 'first'); - }}, - - /** - * @spec https://dom.spec.whatwg.org/#dom-treewalker-lastchild - * @method - * @return {Node|null} - */ - lastChild: { value: function lastChild() { - return traverseChildren(this, 'last'); - }}, - - /** - * @spec http://www.w3.org/TR/dom/#dom-treewalker-previoussibling - * @method - * @return {Node|null} - */ - previousSibling: { value: function previousSibling() { - return traverseSiblings(this, 'previous'); - }}, - - /** - * @spec http://www.w3.org/TR/dom/#dom-treewalker-nextsibling - * @method - * @return {Node|null} - */ - nextSibling: { value: function nextSibling() { - return traverseSiblings(this, 'next'); - }}, - - /** - * @spec https://dom.spec.whatwg.org/#dom-treewalker-previousnode - * @based on WebKit's TreeWalker::previousNode - * https://trac.webkit.org/browser/webkit/trunk/Source/WebCore/dom/TreeWalker.cpp?rev=220453#L181 - * @method - * @return {Node|null} - */ - previousNode: { value: function previousNode() { - var node, result, previousSibling, lastChild; - node = this._currentNode; - while (node !== this._root) { - for (previousSibling = node.previousSibling; - previousSibling; - previousSibling = node.previousSibling) { - node = previousSibling; - result = this._internalFilter(node); - if (result === NodeFilter.FILTER_REJECT) { - continue; - } - for (lastChild = node.lastChild; - lastChild; - lastChild = node.lastChild) { - node = lastChild; - result = this._internalFilter(node); - if (result === NodeFilter.FILTER_REJECT) { - break; - } - } - if (result === NodeFilter.FILTER_ACCEPT) { - this._currentNode = node; - return node; - } - } - if (node === this.root || node.parentNode === null) { - return null; - } - node = node.parentNode; - if (this._internalFilter(node) === NodeFilter.FILTER_ACCEPT) { - this._currentNode = node; - return node; - } - } - return null; - }}, - - /** - * @spec https://dom.spec.whatwg.org/#dom-treewalker-nextnode - * @based on WebKit's TreeWalker::nextNode - * https://trac.webkit.org/browser/webkit/trunk/Source/WebCore/dom/TreeWalker.cpp?rev=220453#L228 - * @method - * @return {Node|null} - */ - nextNode: { value: function nextNode() { - var node, result, firstChild, nextSibling; - node = this._currentNode; - result = NodeFilter.FILTER_ACCEPT; - - CHILDREN: - while (true) { - for (firstChild = node.firstChild; - firstChild; - firstChild = node.firstChild) { - node = firstChild; - result = this._internalFilter(node); - if (result === NodeFilter.FILTER_ACCEPT) { - this._currentNode = node; - return node; - } else if (result === NodeFilter.FILTER_REJECT) { - break; - } - } - for (nextSibling = NodeTraversal.nextSkippingChildren(node, this.root); - nextSibling; - nextSibling = NodeTraversal.nextSkippingChildren(node, this.root)) { - node = nextSibling; - result = this._internalFilter(node); - if (result === NodeFilter.FILTER_ACCEPT) { - this._currentNode = node; - return node; - } else if (result === NodeFilter.FILTER_SKIP) { - continue CHILDREN; - } - } - return null; - } - }}, - - /** For compatibility with web-platform-tests. */ - toString: { value: function toString() { - return "[object TreeWalker]"; - }}, -}); diff --git a/.output/server/node_modules/@mixmark-io/domino/lib/UIEvent.js b/.output/server/node_modules/@mixmark-io/domino/lib/UIEvent.js deleted file mode 100644 index f065b9c..0000000 --- a/.output/server/node_modules/@mixmark-io/domino/lib/UIEvent.js +++ /dev/null @@ -1,19 +0,0 @@ -"use strict"; -var Event = require('./Event'); - -module.exports = UIEvent; - -function UIEvent() { - // Just use the superclass constructor to initialize - Event.call(this); - this.view = null; // FF uses the current window - this.detail = 0; -} -UIEvent.prototype = Object.create(Event.prototype, { - constructor: { value: UIEvent }, - initUIEvent: { value: function(type, bubbles, cancelable, view, detail) { - this.initEvent(type, bubbles, cancelable); - this.view = view; - this.detail = detail; - }} -}); diff --git a/.output/server/node_modules/@mixmark-io/domino/lib/URL.js b/.output/server/node_modules/@mixmark-io/domino/lib/URL.js deleted file mode 100644 index d52be34..0000000 --- a/.output/server/node_modules/@mixmark-io/domino/lib/URL.js +++ /dev/null @@ -1,194 +0,0 @@ -"use strict"; -module.exports = URL; - -function URL(url) { - if (!url) return Object.create(URL.prototype); - // Can't use String.trim() since it defines whitespace differently than HTML - this.url = url.replace(/^[ \t\n\r\f]+|[ \t\n\r\f]+$/g, ""); - - // See http://tools.ietf.org/html/rfc3986#appendix-B - // and https://url.spec.whatwg.org/#parsing - var match = URL.pattern.exec(this.url); - if (match) { - if (match[2]) this.scheme = match[2]; - if (match[4]) { - // parse username/password - var userinfo = match[4].match(URL.userinfoPattern); - if (userinfo) { - this.username = userinfo[1]; - this.password = userinfo[3]; - match[4] = match[4].substring(userinfo[0].length); - } - if (match[4].match(URL.portPattern)) { - var pos = match[4].lastIndexOf(':'); - this.host = match[4].substring(0, pos); - this.port = match[4].substring(pos+1); - } - else { - this.host = match[4]; - } - } - if (match[5]) this.path = match[5]; - if (match[6]) this.query = match[7]; - if (match[8]) this.fragment = match[9]; - } -} - -URL.pattern = /^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/; -URL.userinfoPattern = /^([^@:]*)(:([^@]*))?@/; -URL.portPattern = /:\d+$/; -URL.authorityPattern = /^[^:\/?#]+:\/\//; -URL.hierarchyPattern = /^[^:\/?#]+:\//; - -// Return a percentEncoded version of s. -// S should be a single-character string -// XXX: needs to do utf-8 encoding? -URL.percentEncode = function percentEncode(s) { - var c = s.charCodeAt(0); - if (c < 256) return "%" + c.toString(16); - else throw Error("can't percent-encode codepoints > 255 yet"); -}; - -URL.prototype = { - constructor: URL, - - // XXX: not sure if this is the precise definition of absolute - isAbsolute: function() { return !!this.scheme; }, - isAuthorityBased: function() { - return URL.authorityPattern.test(this.url); - }, - isHierarchical: function() { - return URL.hierarchyPattern.test(this.url); - }, - - toString: function() { - var s = ""; - if (this.scheme !== undefined) s += this.scheme + ":"; - if (this.isAbsolute()) { - s += '//'; - if (this.username || this.password) { - s += this.username || ''; - if (this.password) { - s += ':' + this.password; - } - s += '@'; - } - if (this.host) { - s += this.host; - } - } - if (this.port !== undefined) s += ":" + this.port; - if (this.path !== undefined) s += this.path; - if (this.query !== undefined) s += "?" + this.query; - if (this.fragment !== undefined) s += "#" + this.fragment; - return s; - }, - - // See: http://tools.ietf.org/html/rfc3986#section-5.2 - // and https://url.spec.whatwg.org/#constructors - resolve: function(relative) { - var base = this; // The base url we're resolving against - var r = new URL(relative); // The relative reference url to resolve - var t = new URL(); // The absolute target url we will return - - if (r.scheme !== undefined) { - t.scheme = r.scheme; - t.username = r.username; - t.password = r.password; - t.host = r.host; - t.port = r.port; - t.path = remove_dot_segments(r.path); - t.query = r.query; - } - else { - t.scheme = base.scheme; - if (r.host !== undefined) { - t.username = r.username; - t.password = r.password; - t.host = r.host; - t.port = r.port; - t.path = remove_dot_segments(r.path); - t.query = r.query; - } - else { - t.username = base.username; - t.password = base.password; - t.host = base.host; - t.port = base.port; - if (!r.path) { // undefined or empty - t.path = base.path; - if (r.query !== undefined) - t.query = r.query; - else - t.query = base.query; - } - else { - if (r.path.charAt(0) === "/") { - t.path = remove_dot_segments(r.path); - } - else { - t.path = merge(base.path, r.path); - t.path = remove_dot_segments(t.path); - } - t.query = r.query; - } - } - } - t.fragment = r.fragment; - - return t.toString(); - - - function merge(basepath, refpath) { - if (base.host !== undefined && !base.path) - return "/" + refpath; - - var lastslash = basepath.lastIndexOf("/"); - if (lastslash === -1) - return refpath; - else - return basepath.substring(0, lastslash+1) + refpath; - } - - function remove_dot_segments(path) { - if (!path) return path; // For "" or undefined - - var output = ""; - while(path.length > 0) { - if (path === "." || path === "..") { - path = ""; - break; - } - - var twochars = path.substring(0,2); - var threechars = path.substring(0,3); - var fourchars = path.substring(0,4); - if (threechars === "../") { - path = path.substring(3); - } - else if (twochars === "./") { - path = path.substring(2); - } - else if (threechars === "/./") { - path = "/" + path.substring(3); - } - else if (twochars === "/." && path.length === 2) { - path = "/"; - } - else if (fourchars === "/../" || - (threechars === "/.." && path.length === 3)) { - path = "/" + path.substring(4); - - output = output.replace(/\/?[^\/]*$/, ""); - } - else { - var segment = path.match(/(\/?([^\/]*))/)[0]; - output += segment; - path = path.substring(segment.length); - } - } - - return output; - } - }, -}; diff --git a/.output/server/node_modules/@mixmark-io/domino/lib/URLUtils.js b/.output/server/node_modules/@mixmark-io/domino/lib/URLUtils.js deleted file mode 100644 index 14b2ae0..0000000 --- a/.output/server/node_modules/@mixmark-io/domino/lib/URLUtils.js +++ /dev/null @@ -1,270 +0,0 @@ -"use strict"; -var URL = require('./URL'); - -module.exports = URLUtils; - -// Allow the `x == null` pattern. This is eslint's "null: 'ignore'" option, -// but jshint doesn't support this. -/* jshint eqeqeq: false */ - -// This is an abstract superclass for Location, HTMLAnchorElement and -// other types that have the standard complement of "URL decomposition -// IDL attributes". This is now standardized as URLUtils, see: -// https://url.spec.whatwg.org/#urlutils -// Subclasses must define a getter/setter on href. -// The getter and setter methods parse and rebuild the URL on each -// invocation; there is no attempt to cache the value and be more efficient -function URLUtils() {} -URLUtils.prototype = Object.create(Object.prototype, { - - _url: { get: function() { - // XXX: this should do the "Reinitialize url" steps, and "null" should - // be a valid return value. - return new URL(this.href); - } }, - - protocol: { - get: function() { - var url = this._url; - if (url && url.scheme) return url.scheme + ":"; - else return ":"; - }, - set: function(v) { - var output = this.href; - var url = new URL(output); - if (url.isAbsolute()) { - v = v.replace(/:+$/, ""); - v = v.replace(/[^-+\.a-zA-Z0-9]/g, URL.percentEncode); - if (v.length > 0) { - url.scheme = v; - output = url.toString(); - } - } - this.href = output; - }, - }, - - host: { - get: function() { - var url = this._url; - if (url.isAbsolute() && url.isAuthorityBased()) - return url.host + (url.port ? (":" + url.port) : ""); - else - return ""; - }, - set: function(v) { - var output = this.href; - var url = new URL(output); - if (url.isAbsolute() && url.isAuthorityBased()) { - v = v.replace(/[^-+\._~!$&'()*,;:=a-zA-Z0-9]/g, URL.percentEncode); - if (v.length > 0) { - url.host = v; - delete url.port; - output = url.toString(); - } - } - this.href = output; - }, - }, - - hostname: { - get: function() { - var url = this._url; - if (url.isAbsolute() && url.isAuthorityBased()) - return url.host; - else - return ""; - }, - set: function(v) { - var output = this.href; - var url = new URL(output); - if (url.isAbsolute() && url.isAuthorityBased()) { - v = v.replace(/^\/+/, ""); - v = v.replace(/[^-+\._~!$&'()*,;:=a-zA-Z0-9]/g, URL.percentEncode); - if (v.length > 0) { - url.host = v; - output = url.toString(); - } - } - this.href = output; - }, - }, - - port: { - get: function() { - var url = this._url; - if (url.isAbsolute() && url.isAuthorityBased() && url.port!==undefined) - return url.port; - else - return ""; - }, - set: function(v) { - var output = this.href; - var url = new URL(output); - if (url.isAbsolute() && url.isAuthorityBased()) { - v = '' + v; - v = v.replace(/[^0-9].*$/, ""); - v = v.replace(/^0+/, ""); - if (v.length === 0) v = "0"; - if (parseInt(v, 10) <= 65535) { - url.port = v; - output = url.toString(); - } - } - this.href = output; - }, - }, - - pathname: { - get: function() { - var url = this._url; - if (url.isAbsolute() && url.isHierarchical()) - return url.path; - else - return ""; - }, - set: function(v) { - var output = this.href; - var url = new URL(output); - if (url.isAbsolute() && url.isHierarchical()) { - if (v.charAt(0) !== "/") - v = "/" + v; - v = v.replace(/[^-+\._~!$&'()*,;:=@\/a-zA-Z0-9]/g, URL.percentEncode); - url.path = v; - output = url.toString(); - } - this.href = output; - }, - }, - - search: { - get: function() { - var url = this._url; - if (url.isAbsolute() && url.isHierarchical() && url.query!==undefined) - return "?" + url.query; - else - return ""; - }, - set: function(v) { - var output = this.href; - var url = new URL(output); - if (url.isAbsolute() && url.isHierarchical()) { - if (v.charAt(0) === "?") v = v.substring(1); - v = v.replace(/[^-+\._~!$&'()*,;:=@\/?a-zA-Z0-9]/g, URL.percentEncode); - url.query = v; - output = url.toString(); - } - this.href = output; - }, - }, - - hash: { - get: function() { - var url = this._url; - if (url == null || url.fragment == null || url.fragment === '') { - return ""; - } else { - return "#" + url.fragment; - } - }, - set: function(v) { - var output = this.href; - var url = new URL(output); - - if (v.charAt(0) === "#") v = v.substring(1); - v = v.replace(/[^-+\._~!$&'()*,;:=@\/?a-zA-Z0-9]/g, URL.percentEncode); - url.fragment = v; - output = url.toString(); - - this.href = output; - }, - }, - - username: { - get: function() { - var url = this._url; - return url.username || ''; - }, - set: function(v) { - var output = this.href; - var url = new URL(output); - if (url.isAbsolute()) { - v = v.replace(/[\x00-\x1F\x7F-\uFFFF "#<>?`\/@\\:]/g, URL.percentEncode); - url.username = v; - output = url.toString(); - } - this.href = output; - }, - }, - - password: { - get: function() { - var url = this._url; - return url.password || ''; - }, - set: function(v) { - var output = this.href; - var url = new URL(output); - if (url.isAbsolute()) { - if (v==='') { - url.password = null; - } else { - v = v.replace(/[\x00-\x1F\x7F-\uFFFF "#<>?`\/@\\]/g, URL.percentEncode); - url.password = v; - } - output = url.toString(); - } - this.href = output; - }, - }, - - origin: { get: function() { - var url = this._url; - if (url == null) { return ''; } - var originForPort = function(defaultPort) { - var origin = [url.scheme, url.host, +url.port || defaultPort]; - // XXX should be "unicode serialization" - return origin[0] + '://' + origin[1] + - (origin[2] === defaultPort ? '' : (':' + origin[2])); - }; - switch (url.scheme) { - case 'ftp': - return originForPort(21); - case 'gopher': - return originForPort(70); - case 'http': - case 'ws': - return originForPort(80); - case 'https': - case 'wss': - return originForPort(443); - default: - // this is what chrome does - return url.scheme + '://'; - } - } }, - - /* - searchParams: { - get: function() { - var url = this._url; - // XXX - }, - set: function(v) { - var output = this.href; - var url = new URL(output); - // XXX - this.href = output; - }, - }, - */ -}); - -URLUtils._inherit = function(proto) { - // copy getters/setters from URLUtils to o. - Object.getOwnPropertyNames(URLUtils.prototype).forEach(function(p) { - if (p==='constructor' || p==='href') { return; } - var desc = Object.getOwnPropertyDescriptor(URLUtils.prototype, p); - Object.defineProperty(proto, p, desc); - }); -}; diff --git a/.output/server/node_modules/@mixmark-io/domino/lib/Window.js b/.output/server/node_modules/@mixmark-io/domino/lib/Window.js deleted file mode 100644 index 71cf5eb..0000000 --- a/.output/server/node_modules/@mixmark-io/domino/lib/Window.js +++ /dev/null @@ -1,60 +0,0 @@ -"use strict"; -var DOMImplementation = require('./DOMImplementation'); -var EventTarget = require('./EventTarget'); -var Location = require('./Location'); -var utils = require('./utils'); - -module.exports = Window; - -function Window(document) { - this.document = document || new DOMImplementation(null).createHTMLDocument(""); - this.document._scripting_enabled = true; - this.document.defaultView = this; - this.location = new Location(this, this.document._address || 'about:blank'); -} - -Window.prototype = Object.create(EventTarget.prototype, { - console: { value: console }, - history: { value: { - back: utils.nyi, - forward: utils.nyi, - go: utils.nyi - }}, - navigator: { value: require("./NavigatorID") }, - - // Self-referential properties - window: { get: function() { return this; }}, - self: { get: function() { return this; }}, - frames: { get: function() { return this; }}, - - // Self-referential properties for a top-level window - parent: { get: function() { return this; }}, - top: { get: function() { return this; }}, - - // We don't support any other windows for now - length: { value: 0 }, // no frames - frameElement: { value: null }, // not part of a frame - opener: { value: null }, // not opened by another window - - // The onload event handler. - // XXX: need to support a bunch of other event types, too, - // and have them interoperate with document.body. - - onload: { - get: function() { - return this._getEventHandler("load"); - }, - set: function(v) { - this._setEventHandler("load", v); - } - }, - - // XXX This is a completely broken implementation - getComputedStyle: { value: function getComputedStyle(elt) { - return elt.style; - }} - -}); - -utils.expose(require('./WindowTimers'), Window); -utils.expose(require('./impl'), Window); diff --git a/.output/server/node_modules/@mixmark-io/domino/lib/WindowTimers.js b/.output/server/node_modules/@mixmark-io/domino/lib/WindowTimers.js deleted file mode 100644 index eaf7e0e..0000000 --- a/.output/server/node_modules/@mixmark-io/domino/lib/WindowTimers.js +++ /dev/null @@ -1,11 +0,0 @@ -"use strict"; - -// https://html.spec.whatwg.org/multipage/webappapis.html#windowtimers -var WindowTimers = { - setTimeout: setTimeout, - clearTimeout: clearTimeout, - setInterval: setInterval, - clearInterval: clearInterval -}; - -module.exports = WindowTimers; diff --git a/.output/server/node_modules/@mixmark-io/domino/lib/attributes.js b/.output/server/node_modules/@mixmark-io/domino/lib/attributes.js deleted file mode 100644 index 68d1470..0000000 --- a/.output/server/node_modules/@mixmark-io/domino/lib/attributes.js +++ /dev/null @@ -1,152 +0,0 @@ -"use strict"; -var utils = require('./utils'); - -exports.property = function(attr) { - if (Array.isArray(attr.type)) { - var valid = Object.create(null); - attr.type.forEach(function(val) { - valid[val.value || val] = val.alias || val; - }); - var missingValueDefault = attr.missing; - if (missingValueDefault===undefined) { missingValueDefault = null; } - var invalidValueDefault = attr.invalid; - if (invalidValueDefault===undefined) { invalidValueDefault = missingValueDefault; } - return { - get: function() { - var v = this._getattr(attr.name); - if (v === null) return missingValueDefault; - - v = valid[v.toLowerCase()]; - if (v !== undefined) return v; - if (invalidValueDefault !== null) return invalidValueDefault; - return v; - }, - set: function(v) { - this._setattr(attr.name, v); - } - }; - } - else if (attr.type === Boolean) { - return { - get: function() { - return this.hasAttribute(attr.name); - }, - set: function(v) { - if (v) { - this._setattr(attr.name, ''); - } - else { - this.removeAttribute(attr.name); - } - } - }; - } - else if (attr.type === Number || - attr.type === "long" || - attr.type === "unsigned long" || - attr.type === "limited unsigned long with fallback") { - return numberPropDesc(attr); - } - else if (!attr.type || attr.type === String) { - return { - get: function() { return this._getattr(attr.name) || ''; }, - set: function(v) { - if (attr.treatNullAsEmptyString && v === null) { v = ''; } - this._setattr(attr.name, v); - } - }; - } - else if (typeof attr.type === 'function') { - return attr.type(attr.name, attr); - } - throw new Error('Invalid attribute definition'); -}; - -// See http://www.whatwg.org/specs/web-apps/current-work/#reflect -// -// defval is the default value. If it is a function, then that function -// will be invoked as a method of the element to obtain the default. -// If no default is specified for a given attribute, then the default -// depends on the type of the attribute, but since this function handles -// 4 integer cases, you must specify the default value in each call -// -// min and max define a valid range for getting the attribute. -// -// setmin defines a minimum value when setting. If the value is less -// than that, then throw INDEX_SIZE_ERR. -// -// Conveniently, JavaScript's parseInt function appears to be -// compatible with HTML's 'rules for parsing integers' -function numberPropDesc(a) { - var def; - if(typeof a.default === 'function') { - def = a.default; - } - else if(typeof a.default === 'number') { - def = function() { return a.default; }; - } - else { - def = function() { utils.assert(false, typeof a.default); }; - } - var unsigned_long = (a.type === 'unsigned long'); - var signed_long = (a.type === 'long'); - var unsigned_fallback = (a.type === 'limited unsigned long with fallback'); - var min = a.min, max = a.max, setmin = a.setmin; - if (min === undefined) { - if (unsigned_long) min = 0; - if (signed_long) min = -0x80000000; - if (unsigned_fallback) min = 1; - } - if (max === undefined) { - if (unsigned_long || signed_long || unsigned_fallback) max = 0x7FFFFFFF; - } - - return { - get: function() { - var v = this._getattr(a.name); - var n = a.float ? parseFloat(v) : parseInt(v, 10); - if (v === null || !isFinite(n) || (min !== undefined && n < min) || (max !== undefined && n > max)) { - return def.call(this); - } - if (unsigned_long || signed_long || unsigned_fallback) { - if (!/^[ \t\n\f\r]*[-+]?[0-9]/.test(v)) { return def.call(this); } - n = n|0; // jshint ignore:line - } - return n; - }, - set: function(v) { - if (!a.float) { v = Math.floor(v); } - if (setmin !== undefined && v < setmin) { - utils.IndexSizeError(a.name + ' set to ' + v); - } - if (unsigned_long) { - v = (v < 0 || v > 0x7FFFFFFF) ? def.call(this) : - (v|0); // jshint ignore:line - } else if (unsigned_fallback) { - v = (v < 1 || v > 0x7FFFFFFF) ? def.call(this) : - (v|0); // jshint ignore:line - } else if (signed_long) { - v = (v < -0x80000000 || v > 0x7FFFFFFF) ? def.call(this) : - (v|0); // jshint ignore:line - } - this._setattr(a.name, String(v)); - } - }; -} - -// This is a utility function for setting up change handler functions -// for attributes like 'id' that require special handling when they change. -exports.registerChangeHandler = function(c, name, handler) { - var p = c.prototype; - - // If p does not already have its own _attributeChangeHandlers - // then create one for it, inheriting from the inherited - // _attributeChangeHandlers. At the top (for the Element class) the - // _attributeChangeHandlers object will be created with a null prototype. - if (!Object.prototype.hasOwnProperty.call(p, '_attributeChangeHandlers')) { - p._attributeChangeHandlers = - Object.create(p._attributeChangeHandlers || null); - } - - p._attributeChangeHandlers[name] = handler; -}; diff --git a/.output/server/node_modules/@mixmark-io/domino/lib/config.js b/.output/server/node_modules/@mixmark-io/domino/lib/config.js deleted file mode 100644 index efdc169..0000000 --- a/.output/server/node_modules/@mixmark-io/domino/lib/config.js +++ /dev/null @@ -1,7 +0,0 @@ -/* - * This file defines Domino behaviour that can be externally configured. - * To change these settings, set the relevant global property *before* - * you call `require("domino")`. - */ - -exports.isApiWritable = !globalThis.__domino_frozen__; diff --git a/.output/server/node_modules/@mixmark-io/domino/lib/defineElement.js b/.output/server/node_modules/@mixmark-io/domino/lib/defineElement.js deleted file mode 100644 index 5ba5295..0000000 --- a/.output/server/node_modules/@mixmark-io/domino/lib/defineElement.js +++ /dev/null @@ -1,71 +0,0 @@ -"use strict"; - -var attributes = require('./attributes'); -var isApiWritable = require("./config").isApiWritable; - -module.exports = function(spec, defaultConstructor, tagList, tagNameToImpl) { - var c = spec.ctor; - if (c) { - var props = spec.props || {}; - - if (spec.attributes) { - for (var n in spec.attributes) { - var attr = spec.attributes[n]; - if (typeof attr !== 'object' || Array.isArray(attr)) attr = {type: attr}; - if (!attr.name) attr.name = n.toLowerCase(); - props[n] = attributes.property(attr); - } - } - - props.constructor = { value : c, writable: isApiWritable }; - c.prototype = Object.create((spec.superclass || defaultConstructor).prototype, props); - if (spec.events) { - addEventHandlers(c, spec.events); - } - tagList[spec.name] = c; - } - else { - c = defaultConstructor; - } - - (spec.tags || spec.tag && [spec.tag] || []).forEach(function(tag) { - tagNameToImpl[tag] = c; - }); - - return c; -}; - -function EventHandlerBuilder(body, document, form, element) { - this.body = body; - this.document = document; - this.form = form; - this.element = element; -} - -EventHandlerBuilder.prototype.build = function () { - return () => {}; -}; - -function EventHandlerChangeHandler(elt, name, oldval, newval) { - var doc = elt.ownerDocument || Object.create(null); - var form = elt.form || Object.create(null); - elt[name] = new EventHandlerBuilder(newval, doc, form, elt).build(); -} - -function addEventHandlers(c, eventHandlerTypes) { - var p = c.prototype; - eventHandlerTypes.forEach(function(type) { - // Define the event handler registration IDL attribute for this type - Object.defineProperty(p, "on" + type, { - get: function() { - return this._getEventHandler(type); - }, - set: function(v) { - this._setEventHandler(type, v); - }, - }); - - // Define special behavior for the content attribute as well - attributes.registerChangeHandler(c, "on" + type, EventHandlerChangeHandler); - }); -} diff --git a/.output/server/node_modules/@mixmark-io/domino/lib/events.js b/.output/server/node_modules/@mixmark-io/domino/lib/events.js deleted file mode 100644 index 6b20fb5..0000000 --- a/.output/server/node_modules/@mixmark-io/domino/lib/events.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; -module.exports = { - Event: require('./Event'), - UIEvent: require('./UIEvent'), - MouseEvent: require('./MouseEvent'), - CustomEvent: require('./CustomEvent') -}; diff --git a/.output/server/node_modules/@mixmark-io/domino/lib/htmlelts.js b/.output/server/node_modules/@mixmark-io/domino/lib/htmlelts.js deleted file mode 100644 index 68de66d..0000000 --- a/.output/server/node_modules/@mixmark-io/domino/lib/htmlelts.js +++ /dev/null @@ -1,1499 +0,0 @@ -"use strict"; -var Node = require('./Node'); -var Element = require('./Element'); -var CSSStyleDeclaration = require('./CSSStyleDeclaration'); -var utils = require('./utils'); -var URLUtils = require('./URLUtils'); -var defineElement = require('./defineElement'); - -var htmlElements = exports.elements = {}; -var htmlNameToImpl = Object.create(null); - -exports.createElement = function(doc, localName, prefix) { - var impl = htmlNameToImpl[localName] || HTMLUnknownElement; - return new impl(doc, localName, prefix); -}; - -function define(spec) { - return defineElement(spec, HTMLElement, htmlElements, htmlNameToImpl); -} - -function URL(attr) { - return { - get: function() { - var v = this._getattr(attr); - if (v === null) { return ''; } - var url = this.doc._resolve(v); - return (url === null) ? v : url; - }, - set: function(value) { - this._setattr(attr, value); - } - }; -} - -function CORS(attr) { - return { - get: function() { - var v = this._getattr(attr); - if (v === null) { return null; } - if (v.toLowerCase() === 'use-credentials') { return 'use-credentials'; } - return 'anonymous'; - }, - set: function(value) { - if (value===null || value===undefined) { - this.removeAttribute(attr); - } else { - this._setattr(attr, value); - } - } - }; -} - -const REFERRER = { - type: ["", "no-referrer", "no-referrer-when-downgrade", "same-origin", "origin", "strict-origin", "origin-when-cross-origin", "strict-origin-when-cross-origin", "unsafe-url"], - missing: '', -}; - - -// XXX: the default value for tabIndex should be 0 if the element is -// focusable and -1 if it is not. But the full definition of focusable -// is actually hard to compute, so for now, I'll follow Firefox and -// just base the default value on the type of the element. -var focusableElements = { - "A":true, "LINK":true, "BUTTON":true, "INPUT":true, - "SELECT":true, "TEXTAREA":true, "COMMAND":true -}; - -var HTMLFormElement = function(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - this._form = null; // Prevent later deoptimization -}; - -var HTMLElement = exports.HTMLElement = define({ - superclass: Element, - name: 'HTMLElement', - ctor: function HTMLElement(doc, localName, prefix) { - Element.call(this, doc, localName, utils.NAMESPACE.HTML, prefix); - }, - props: { - dangerouslySetInnerHTML: { - set: function (v) { - this._innerHTML = v; - }, - }, - innerHTML: { - get: function() { - return this.serialize(); - }, - set: function(v) { - var parser = this.ownerDocument.implementation.mozHTMLParser( - this.ownerDocument._address, - this); - parser.parse(v===null ? '' : String(v), true); - - // Remove any existing children of this node - var target = (this instanceof htmlNameToImpl.template) ? - this.content : this; - while(target.hasChildNodes()) - target.removeChild(target.firstChild); - - // Now copy newly parsed children to this node - target.appendChild(parser._asDocumentFragment()); - } - }, - style: { get: function() { - if (!this._style) - this._style = new CSSStyleDeclaration(this); - return this._style; - }, set: function(v) { - if (v===null||v===undefined) { v = ''; } - this._setattr('style', String(v)); - }}, - - // These can't really be implemented server-side in a reasonable way. - blur: { value: function() {}}, - focus: { value: function() {}}, - forceSpellCheck: { value: function() {}}, - - click: { value: function() { - if (this._click_in_progress) return; - this._click_in_progress = true; - try { - if (this._pre_click_activation_steps) - this._pre_click_activation_steps(); - - var event = this.ownerDocument.createEvent("MouseEvent"); - event.initMouseEvent("click", true, true, - this.ownerDocument.defaultView, 1, - 0, 0, 0, 0, - // These 4 should be initialized with - // the actually current keyboard state - // somehow... - false, false, false, false, - 0, null - ); - - // Dispatch this as an untrusted event since it is synthetic - var success = this.dispatchEvent(event); - - if (success) { - if (this._post_click_activation_steps) - this._post_click_activation_steps(event); - } - else { - if (this._cancelled_activation_steps) - this._cancelled_activation_steps(); - } - } - finally { - this._click_in_progress = false; - } - }}, - submit: { value: utils.nyi }, - }, - attributes: { - title: String, - lang: String, - dir: {type: ["ltr", "rtl", "auto"], missing: ''}, - draggable: {type: ["true", "false"], treatNullAsEmptyString: true }, - spellcheck: {type: ["true", "false"], missing: ''}, - enterKeyHint: {type: ["enter", "done", "go", "next", "previous", "search", "send"], missing: ''}, - autoCapitalize: {type: ["off", "on", "none", "sentences", "words", "characters"], missing: '' }, - autoFocus: Boolean, - accessKey: String, - nonce: String, - hidden: Boolean, - translate: {type: ["no", "yes"], missing: '' }, - tabIndex: {type: "long", default: function() { - if (this.tagName in focusableElements || - this.contentEditable) - return 0; - else - return -1; - }} - }, - events: [ - "abort", "canplay", "canplaythrough", "change", "click", "contextmenu", - "cuechange", "dblclick", "drag", "dragend", "dragenter", "dragleave", - "dragover", "dragstart", "drop", "durationchange", "emptied", "ended", - "input", "invalid", "keydown", "keypress", "keyup", "loadeddata", - "loadedmetadata", "loadstart", "mousedown", "mousemove", "mouseout", - "mouseover", "mouseup", "mousewheel", "pause", "play", "playing", - "progress", "ratechange", "readystatechange", "reset", "seeked", - "seeking", "select", "show", "stalled", "submit", "suspend", - "timeupdate", "volumechange", "waiting", - - // These last 5 event types will be overriden by HTMLBodyElement - "blur", "error", "focus", "load", "scroll" - ] -}); - - -// XXX: reflect contextmenu as contextMenu, with element type - - -// style: the spec doesn't call this a reflected attribute. -// may want to handle it manually. - -// contentEditable: enumerated, not clear if it is actually -// reflected or requires custom getter/setter. Not listed as -// "limited to known values". Raises syntax_err on bad setting, -// so I think this is custom. - -// contextmenu: content is element id, idl type is an element -// draggable: boolean, but not a reflected attribute -// dropzone: reflected SettableTokenList, experimental, so don't -// implement it right away. - -// data-* attributes: need special handling in setAttribute? -// Or maybe that isn't necessary. Can I just scan the attribute list -// when building the dataset? Liveness and caching issues? - -// microdata attributes: many are simple reflected attributes, but -// I'm not going to implement this now. - - -var HTMLUnknownElement = define({ - name: 'HTMLUnknownElement', - ctor: function HTMLUnknownElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - } -}); - - -var formAssociatedProps = { - // See http://www.w3.org/TR/html5/association-of-controls-and-forms.html#form-owner - form: { get: function() { - return this._form; - }} -}; - -define({ - tag: 'a', - name: 'HTMLAnchorElement', - ctor: function HTMLAnchorElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - props: { - _post_click_activation_steps: { value: function(e) { - if (this.href) { - // Follow the link - // XXX: this is just a quick hack - // XXX: the HTML spec probably requires more than this - this.ownerDocument.defaultView.location = this.href; - } - }}, - }, - attributes: { - href: URL, - ping: String, - download: String, - target: String, - rel: String, - media: String, - hreflang: String, - type: String, - referrerPolicy: REFERRER, - // Obsolete - coords: String, - charset: String, - name: String, - rev: String, - shape: String, - } -}); -// Latest WhatWG spec says these methods come via HTMLHyperlinkElementUtils -URLUtils._inherit(htmlNameToImpl.a.prototype); - -define({ - tag: 'area', - name: 'HTMLAreaElement', - ctor: function HTMLAreaElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - alt: String, - target: String, - download: String, - rel: String, - media: String, - href: URL, - hreflang: String, - type: String, - shape: String, - coords: String, - ping: String, - // XXX: also reflect relList - referrerPolicy: REFERRER, - // Obsolete - noHref: Boolean, - } -}); -// Latest WhatWG spec says these methods come via HTMLHyperlinkElementUtils -URLUtils._inherit(htmlNameToImpl.area.prototype); - -define({ - tag: 'br', - name: 'HTMLBRElement', - ctor: function HTMLBRElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - // Obsolete - clear: String - }, -}); - -define({ - tag: 'base', - name: 'HTMLBaseElement', - ctor: function HTMLBaseElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - "target": String - } -}); - - -define({ - tag: 'body', - name: 'HTMLBodyElement', - ctor: function HTMLBodyElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - // Certain event handler attributes on a tag actually set - // handlers for the window rather than just that element. Define - // getters and setters for those here. Note that some of these override - // properties on HTMLElement.prototype. - // XXX: If I add support for , these have to go there, too - // XXX - // When the Window object is implemented, these attribute will have - // to work with the same-named attributes on the Window. - events: [ - "afterprint", "beforeprint", "beforeunload", "blur", "error", - "focus","hashchange", "load", "message", "offline", "online", - "pagehide", "pageshow","popstate","resize","scroll","storage","unload", - ], - attributes: { - // Obsolete - text: { type: String, treatNullAsEmptyString: true }, - link: { type: String, treatNullAsEmptyString: true }, - vLink: { type: String, treatNullAsEmptyString: true }, - aLink: { type: String, treatNullAsEmptyString: true }, - bgColor: { type: String, treatNullAsEmptyString: true }, - background: String, - } -}); - -define({ - tag: 'button', - name: 'HTMLButtonElement', - ctor: function HTMLButtonElement(doc, localName, prefix) { - HTMLFormElement.call(this, doc, localName, prefix); - }, - props: formAssociatedProps, - attributes: { - name: String, - value: String, - disabled: Boolean, - autofocus: Boolean, - type: { type:["submit", "reset", "button", "menu"], missing: 'submit' }, - formTarget: String, - formAction: URL, - formNoValidate: Boolean, - formMethod: { type: ["get", "post", "dialog"], invalid: 'get', missing: '' }, - formEnctype: { type: ["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"], invalid: "application/x-www-form-urlencoded", missing: '' }, - } -}); - -define({ - tag: 'dl', - name: 'HTMLDListElement', - ctor: function HTMLDListElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - // Obsolete - compact: Boolean, - } -}); - -define({ - tag: 'data', - name: 'HTMLDataElement', - ctor: function HTMLDataElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - value: String, - } -}); - -define({ - tag: 'datalist', - name: 'HTMLDataListElement', - ctor: function HTMLDataListElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - } -}); - -define({ - tag: 'details', - name: 'HTMLDetailsElement', - ctor: function HTMLDetailsElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - "open": Boolean - } -}); - -define({ - tag: 'div', - name: 'HTMLDivElement', - ctor: function HTMLDivElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - // Obsolete - align: String - } -}); - -define({ - tag: 'embed', - name: 'HTMLEmbedElement', - ctor: function HTMLEmbedElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - src: URL, - type: String, - width: String, - height: String, - // Obsolete - align: String, - name: String, - } -}); - -define({ - tag: 'fieldset', - name: 'HTMLFieldSetElement', - ctor: function HTMLFieldSetElement(doc, localName, prefix) { - HTMLFormElement.call(this, doc, localName, prefix); - }, - props: formAssociatedProps, - attributes: { - disabled: Boolean, - name: String - } -}); - -define({ - tag: 'form', - name: 'HTMLFormElement', - ctor: function HTMLFormElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - action: String, - autocomplete: {type:['on', 'off'], missing: 'on'}, - name: String, - acceptCharset: {name: "accept-charset"}, - target: String, - noValidate: Boolean, - method: { type: ["get", "post", "dialog"], invalid: 'get', missing: 'get' }, - // Both enctype and encoding reflect the enctype content attribute - enctype: { type: ["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"], invalid: "application/x-www-form-urlencoded", missing: "application/x-www-form-urlencoded" }, - encoding: {name: 'enctype', type: ["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"], invalid: "application/x-www-form-urlencoded", missing: "application/x-www-form-urlencoded" }, - } -}); - -define({ - tag: 'hr', - name: 'HTMLHRElement', - ctor: function HTMLHRElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - // Obsolete - align: String, - color: String, - noShade: Boolean, - size: String, - width: String, - }, -}); - -define({ - tag: 'head', - name: 'HTMLHeadElement', - ctor: function HTMLHeadElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - } -}); - -define({ - tags: ['h1','h2','h3','h4','h5','h6'], - name: 'HTMLHeadingElement', - ctor: function HTMLHeadingElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - // Obsolete - align: String, - }, -}); - -define({ - tag: 'html', - name: 'HTMLHtmlElement', - ctor: function HTMLHtmlElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - xmlns: URL, - // Obsolete - version: String - } -}); - -define({ - tag: 'iframe', - name: 'HTMLIFrameElement', - ctor: function HTMLIFrameElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - src: URL, - srcdoc: String, - name: String, - width: String, - height: String, - // XXX: sandbox is a reflected settable token list - seamless: Boolean, - allow: Boolean, - allowFullscreen: Boolean, - allowUserMedia: Boolean, - allowPaymentRequest: Boolean, - referrerPolicy: REFERRER, - loading: { type:['eager','lazy'], treatNullAsEmptyString: true }, - // Obsolete - align: String, - scrolling: String, - frameBorder: String, - longDesc: URL, - marginHeight: { type: String, treatNullAsEmptyString: true }, - marginWidth: { type: String, treatNullAsEmptyString: true }, - } -}); - -define({ - tag: 'img', - name: 'HTMLImageElement', - ctor: function HTMLImageElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - alt: String, - src: URL, - srcset: String, - crossOrigin: CORS, - useMap: String, - isMap: Boolean, - sizes: String, - height: { type: "unsigned long", default: 0 }, - width: { type: "unsigned long", default: 0 }, - referrerPolicy: REFERRER, - loading: { type:['eager','lazy'], missing: '' }, - // Obsolete: - name: String, - lowsrc: URL, - align: String, - hspace: { type: "unsigned long", default: 0 }, - vspace: { type: "unsigned long", default: 0 }, - longDesc: URL, - border: { type: String, treatNullAsEmptyString: true }, - } -}); - -define({ - tag: 'input', - name: 'HTMLInputElement', - ctor: function HTMLInputElement(doc, localName, prefix) { - HTMLFormElement.call(this, doc, localName, prefix); - }, - props: { - form: formAssociatedProps.form, - _post_click_activation_steps: { value: function(e) { - if (this.type === 'checkbox') { - this.checked = !this.checked; - } - else if (this.type === 'radio') { - var group = this.form.getElementsByName(this.name); - for (var i=group.length-1; i >= 0; i--) { - var el = group[i]; - el.checked = (el === this); - } - } - }}, - }, - attributes: { - name: String, - disabled: Boolean, - autofocus: Boolean, - accept: String, - alt: String, - max: String, - min: String, - pattern: String, - placeholder: String, - step: String, - dirName: String, - defaultValue: {name: 'value'}, - multiple: Boolean, - required: Boolean, - readOnly: Boolean, - checked: Boolean, - value: String, - src: URL, - defaultChecked: {name: 'checked', type: Boolean}, - size: {type: 'unsigned long', default: 20, min: 1, setmin: 1}, - width: {type: 'unsigned long', min: 0, setmin: 0, default: 0}, - height: {type: 'unsigned long', min: 0, setmin: 0, default: 0}, - minLength: {type: 'unsigned long', min: 0, setmin: 0, default: -1}, - maxLength: {type: 'unsigned long', min: 0, setmin: 0, default: -1}, - autocomplete: String, // It's complicated - type: { type: - ["text", "hidden", "search", "tel", "url", "email", "password", - "datetime", "date", "month", "week", "time", "datetime-local", - "number", "range", "color", "checkbox", "radio", "file", "submit", - "image", "reset", "button"], - missing: 'text' }, - formTarget: String, - formNoValidate: Boolean, - formMethod: { type: ["get", "post"], invalid: 'get', missing: '' }, - formEnctype: { type: ["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"], invalid: "application/x-www-form-urlencoded", missing: '' }, - inputMode: { type: [ "verbatim", "latin", "latin-name", "latin-prose", "full-width-latin", "kana", "kana-name", "katakana", "numeric", "tel", "email", "url" ], missing: '' }, - // Obsolete - align: String, - useMap: String, - } -}); - -define({ - tag: 'keygen', - name: 'HTMLKeygenElement', - ctor: function HTMLKeygenElement(doc, localName, prefix) { - HTMLFormElement.call(this, doc, localName, prefix); - }, - props: formAssociatedProps, - attributes: { - name: String, - disabled: Boolean, - autofocus: Boolean, - challenge: String, - keytype: { type:["rsa"], missing: '' }, - } -}); - -define({ - tag: 'li', - name: 'HTMLLIElement', - ctor: function HTMLLIElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - value: {type: "long", default: 0}, - // Obsolete - type: String, - } -}); - -define({ - tag: 'label', - name: 'HTMLLabelElement', - ctor: function HTMLLabelElement(doc, localName, prefix) { - HTMLFormElement.call(this, doc, localName, prefix); - }, - props: formAssociatedProps, - attributes: { - htmlFor: {name: 'for', type: String} - } -}); - -define({ - tag: 'legend', - name: 'HTMLLegendElement', - ctor: function HTMLLegendElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - // Obsolete - align: String - }, -}); - -define({ - tag: 'link', - name: 'HTMLLinkElement', - ctor: function HTMLLinkElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - // XXX Reflect DOMSettableTokenList sizes also DOMTokenList relList - href: URL, - rel: String, - media: String, - hreflang: String, - type: String, - crossOrigin: CORS, - nonce: String, - integrity: String, - referrerPolicy: REFERRER, - imageSizes: String, - imageSrcset: String, - // Obsolete - charset: String, - rev: String, - target: String, - } -}); - -define({ - tag: 'map', - name: 'HTMLMapElement', - ctor: function HTMLMapElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - name: String - } -}); - -define({ - tag: 'menu', - name: 'HTMLMenuElement', - ctor: function HTMLMenuElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - // XXX: not quite right, default should be popup if parent element is - // popup. - type: { type: [ 'context', 'popup', 'toolbar' ], missing: 'toolbar' }, - label: String, - // Obsolete - compact: Boolean, - } -}); - -define({ - tag: 'meta', - name: 'HTMLMetaElement', - ctor: function HTMLMetaElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - name: String, - content: String, - httpEquiv: {name: 'http-equiv', type: String}, - // Obsolete - scheme: String, - } -}); - -define({ - tag: 'meter', - name: 'HTMLMeterElement', - ctor: function HTMLMeterElement(doc, localName, prefix) { - HTMLFormElement.call(this, doc, localName, prefix); - }, - props: formAssociatedProps -}); - -define({ - tags: ['ins', 'del'], - name: 'HTMLModElement', - ctor: function HTMLModElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - cite: URL, - dateTime: String - } -}); - -define({ - tag: 'ol', - name: 'HTMLOListElement', - ctor: function HTMLOListElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - props: { - // Utility function (see the start attribute default value). Returns - // the number of
  • children of this element - _numitems: { get: function() { - var items = 0; - this.childNodes.forEach(function(n) { - if (n.nodeType === Node.ELEMENT_NODE && n.tagName === "LI") - items++; - }); - return items; - }} - }, - attributes: { - type: String, - reversed: Boolean, - start: { - type: "long", - default: function() { - // The default value of the start attribute is 1 unless the list is - // reversed. Then it is the # of li children - if (this.reversed) - return this._numitems; - else - return 1; - } - }, - // Obsolete - compact: Boolean, - } -}); - -define({ - tag: 'object', - name: 'HTMLObjectElement', - ctor: function HTMLObjectElement(doc, localName, prefix) { - HTMLFormElement.call(this, doc, localName, prefix); - }, - props: formAssociatedProps, - attributes: { - data: URL, - type: String, - name: String, - useMap: String, - typeMustMatch: Boolean, - width: String, - height: String, - // Obsolete - align: String, - archive: String, - code: String, - declare: Boolean, - hspace: { type: "unsigned long", default: 0 }, - standby: String, - vspace: { type: "unsigned long", default: 0 }, - codeBase: URL, - codeType: String, - border: { type: String, treatNullAsEmptyString: true }, - } -}); - -define({ - tag: 'optgroup', - name: 'HTMLOptGroupElement', - ctor: function HTMLOptGroupElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - disabled: Boolean, - label: String - } -}); - -define({ - tag: 'option', - name: 'HTMLOptionElement', - ctor: function HTMLOptionElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - props: { - form: { get: function() { - var p = this.parentNode; - while (p && p.nodeType === Node.ELEMENT_NODE) { - if (p.localName === 'select') return p.form; - p = p.parentNode; - } - }}, - value: { - get: function() { return this._getattr('value') || this.text; }, - set: function(v) { this._setattr('value', v); }, - }, - text: { - get: function() { - // Strip and collapse whitespace - return this.textContent.replace(/[ \t\n\f\r]+/g, ' ').trim(); - }, - set: function(v) { this.textContent = v; }, - }, - // missing: index - }, - attributes: { - disabled: Boolean, - defaultSelected: {name: 'selected', type: Boolean}, - label: String, - } -}); - -define({ - tag: 'output', - name: 'HTMLOutputElement', - ctor: function HTMLOutputElement(doc, localName, prefix) { - HTMLFormElement.call(this, doc, localName, prefix); - }, - props: formAssociatedProps, - attributes: { - // XXX Reflect for/htmlFor as a settable token list - name: String - } -}); - -define({ - tag: 'p', - name: 'HTMLParagraphElement', - ctor: function HTMLParagraphElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - // Obsolete - align: String - } -}); - -define({ - tag: 'param', - name: 'HTMLParamElement', - ctor: function HTMLParamElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - name: String, - value: String, - // Obsolete - type: String, - valueType: String, - } -}); - -define({ - tags: ['pre',/*legacy elements:*/'listing','xmp'], - name: 'HTMLPreElement', - ctor: function HTMLPreElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - // Obsolete - width: { type: "long", default: 0 }, - } -}); - -define({ - tag: 'progress', - name: 'HTMLProgressElement', - ctor: function HTMLProgressElement(doc, localName, prefix) { - HTMLFormElement.call(this, doc, localName, prefix); - }, - props: formAssociatedProps, - attributes: { - max: {type: Number, float: true, default: 1.0, min: 0} - } -}); - -define({ - tags: ['q', 'blockquote'], - name: 'HTMLQuoteElement', - ctor: function HTMLQuoteElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - cite: URL - } -}); - -define({ - tag: 'script', - name: 'HTMLScriptElement', - ctor: function HTMLScriptElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - props: { - text: { - get: function() { - var s = ""; - for(var i = 0, n = this.childNodes.length; i < n; i++) { - var child = this.childNodes[i]; - if (child.nodeType === Node.TEXT_NODE) - s += child._data; - } - return s; - }, - set: function(value) { - this.removeChildren(); - if (value !== null && value !== "") { - this.appendChild(this.ownerDocument.createTextNode(value)); - } - } - } - }, - attributes: { - src: URL, - type: String, - charset: String, - referrerPolicy: REFERRER, - defer: Boolean, - async: Boolean, - nomodule: Boolean, - crossOrigin: CORS, - nonce: String, - integrity: String, - } -}); - -define({ - tag: 'select', - name: 'HTMLSelectElement', - ctor: function HTMLSelectElement(doc, localName, prefix) { - HTMLFormElement.call(this, doc, localName, prefix); - }, - props: { - form: formAssociatedProps.form, - options: { get: function() { - return this.getElementsByTagName('option'); - }} - }, - attributes: { - autocomplete: String, // It's complicated - name: String, - disabled: Boolean, - autofocus: Boolean, - multiple: Boolean, - required: Boolean, - size: {type: "unsigned long", default: 0} - } -}); - -define({ - tag: 'span', - name: 'HTMLSpanElement', - ctor: function HTMLSpanElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - } -}); - -define({ - tag: 'style', - name: 'HTMLStyleElement', - ctor: function HTMLStyleElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - media: String, - type: String, - scoped: Boolean - } -}); - -define({ - tag: 'caption', - name: 'HTMLTableCaptionElement', - ctor: function HTMLTableCaptionElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - // Obsolete - align: String, - } -}); - - -define({ - name: 'HTMLTableCellElement', - ctor: function HTMLTableCellElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - colSpan: {type: "unsigned long", default: 1}, - rowSpan: {type: "unsigned long", default: 1}, - //XXX Also reflect settable token list headers - scope: { type: ['row','col','rowgroup','colgroup'], missing: '' }, - abbr: String, - // Obsolete - align: String, - axis: String, - height: String, - width: String, - ch: { name: 'char', type: String }, - chOff: { name: 'charoff', type: String }, - noWrap: Boolean, - vAlign: String, - bgColor: { type: String, treatNullAsEmptyString: true }, - } -}); - -define({ - tags: ['col', 'colgroup'], - name: 'HTMLTableColElement', - ctor: function HTMLTableColElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - span: {type: 'limited unsigned long with fallback', default: 1, min: 1}, - // Obsolete - align: String, - ch: { name: 'char', type: String }, - chOff: { name: 'charoff', type: String }, - vAlign: String, - width: String, - } -}); - -define({ - tag: 'table', - name: 'HTMLTableElement', - ctor: function HTMLTableElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - props: { - rows: { get: function() { - return this.getElementsByTagName('tr'); - }} - }, - attributes: { - // Obsolete - align: String, - border: String, - frame: String, - rules: String, - summary: String, - width: String, - bgColor: { type: String, treatNullAsEmptyString: true }, - cellPadding: { type: String, treatNullAsEmptyString: true }, - cellSpacing: { type: String, treatNullAsEmptyString: true }, - } -}); - -define({ - tag: 'template', - name: 'HTMLTemplateElement', - ctor: function HTMLTemplateElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - this._contentFragment = doc._templateDoc.createDocumentFragment(); - }, - props: { - content: { get: function() { return this._contentFragment; } }, - serialize: { value: function() { return this.content.serialize(); } } - } -}); - -define({ - tag: 'tr', - name: 'HTMLTableRowElement', - ctor: function HTMLTableRowElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - props: { - cells: { get: function() { - return this.querySelectorAll('td,th'); - }} - }, - attributes: { - // Obsolete - align: String, - ch: { name: 'char', type: String }, - chOff: { name: 'charoff', type: String }, - vAlign: String, - bgColor: { type: String, treatNullAsEmptyString: true }, - }, -}); - -define({ - tags: ['thead', 'tfoot', 'tbody'], - name: 'HTMLTableSectionElement', - ctor: function HTMLTableSectionElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - props: { - rows: { get: function() { - return this.getElementsByTagName('tr'); - }} - }, - attributes: { - // Obsolete - align: String, - ch: { name: 'char', type: String }, - chOff: { name: 'charoff', type: String }, - vAlign: String, - } -}); - -define({ - tag: 'textarea', - name: 'HTMLTextAreaElement', - ctor: function HTMLTextAreaElement(doc, localName, prefix) { - HTMLFormElement.call(this, doc, localName, prefix); - }, - props: { - form: formAssociatedProps.form, - type: { get: function() { return 'textarea'; } }, - defaultValue: { - get: function() { return this.textContent; }, - set: function(v) { this.textContent = v; }, - }, - value: { - get: function() { return this.defaultValue; /* never dirty */ }, - set: function(v) { - // This isn't completely correct: according to the spec, this - // should "dirty" the API value, and result in - // `this.value !== this.defaultValue`. But for most of what - // folks want to do, this implementation should be fine: - this.defaultValue = v; - }, - }, - textLength: { get: function() { return this.value.length; } }, - }, - attributes: { - autocomplete: String, // It's complicated - name: String, - disabled: Boolean, - autofocus: Boolean, - placeholder: String, - wrap: String, - dirName: String, - required: Boolean, - readOnly: Boolean, - rows: {type: 'limited unsigned long with fallback', default: 2 }, - cols: {type: 'limited unsigned long with fallback', default: 20 }, - maxLength: {type: 'unsigned long', min: 0, setmin: 0, default: -1}, - minLength: {type: 'unsigned long', min: 0, setmin: 0, default: -1}, - inputMode: { type: [ "verbatim", "latin", "latin-name", "latin-prose", "full-width-latin", "kana", "kana-name", "katakana", "numeric", "tel", "email", "url" ], missing: '' }, - } -}); - -define({ - tag: 'time', - name: 'HTMLTimeElement', - ctor: function HTMLTimeElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - dateTime: String, - pubDate: Boolean - } -}); - -define({ - tag: 'title', - name: 'HTMLTitleElement', - ctor: function HTMLTitleElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - props: { - text: { get: function() { - return this.textContent; - }} - } -}); - -define({ - tag: 'ul', - name: 'HTMLUListElement', - ctor: function HTMLUListElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - type: String, - // Obsolete - compact: Boolean, - } -}); - -define({ - name: 'HTMLMediaElement', - ctor: function HTMLMediaElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - src: URL, - crossOrigin: CORS, - preload: { type:["metadata", "none", "auto", {value: "", alias: "auto"}], missing: 'auto' }, - loop: Boolean, - autoplay: Boolean, - mediaGroup: String, - controls: Boolean, - defaultMuted: {name: "muted", type: Boolean} - } -}); - -define({ - name: 'HTMLAudioElement', - tag: 'audio', - superclass: htmlElements.HTMLMediaElement, - ctor: function HTMLAudioElement(doc, localName, prefix) { - htmlElements.HTMLMediaElement.call(this, doc, localName, prefix); - } -}); - -define({ - name: 'HTMLVideoElement', - tag: 'video', - superclass: htmlElements.HTMLMediaElement, - ctor: function HTMLVideoElement(doc, localName, prefix) { - htmlElements.HTMLMediaElement.call(this, doc, localName, prefix); - }, - attributes: { - poster: URL, - width: {type: "unsigned long", min: 0, default: 0 }, - height: {type: "unsigned long", min: 0, default: 0 } - } -}); - -define({ - tag: 'td', - name: 'HTMLTableDataCellElement', - superclass: htmlElements.HTMLTableCellElement, - ctor: function HTMLTableDataCellElement(doc, localName, prefix) { - htmlElements.HTMLTableCellElement.call(this, doc, localName, prefix); - } -}); - -define({ - tag: 'th', - name: 'HTMLTableHeaderCellElement', - superclass: htmlElements.HTMLTableCellElement, - ctor: function HTMLTableHeaderCellElement(doc, localName, prefix) { - htmlElements.HTMLTableCellElement.call(this, doc, localName, prefix); - }, -}); - -define({ - tag: 'frameset', - name: 'HTMLFrameSetElement', - ctor: function HTMLFrameSetElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - } -}); - -define({ - tag: 'frame', - name: 'HTMLFrameElement', - ctor: function HTMLFrameElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - } -}); - -define({ - tag: 'canvas', - name: 'HTMLCanvasElement', - ctor: function HTMLCanvasElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - props: { - getContext: { value: utils.nyi }, - probablySupportsContext: { value: utils.nyi }, - setContext: { value: utils.nyi }, - transferControlToProxy: { value: utils.nyi }, - toDataURL: { value: utils.nyi }, - toBlob: { value: utils.nyi } - }, - attributes: { - width: { type: "unsigned long", default: 300}, - height: { type: "unsigned long", default: 150} - } -}); - -define({ - tag: 'dialog', - name: 'HTMLDialogElement', - ctor: function HTMLDialogElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - props: { - show: { value: utils.nyi }, - showModal: { value: utils.nyi }, - close: { value: utils.nyi } - }, - attributes: { - open: Boolean, - returnValue: String - } -}); - -define({ - tag: 'menuitem', - name: 'HTMLMenuItemElement', - ctor: function HTMLMenuItemElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - props: { - // The menuitem's label - _label: { - get: function() { - var val = this._getattr('label'); - if (val !== null && val !== '') { return val; } - val = this.textContent; - // Strip and collapse whitespace - return val.replace(/[ \t\n\f\r]+/g, ' ').trim(); - } - }, - // The menuitem label IDL attribute - label: { - get: function() { - var val = this._getattr('label'); - if (val !== null) { return val; } - return this._label; - }, - set: function(v) { - this._setattr('label', v); - }, - } - }, - attributes: { - type: { type: ["command","checkbox","radio"], missing: 'command' }, - icon: URL, - disabled: Boolean, - checked: Boolean, - radiogroup: String, - default: Boolean - } -}); - -define({ - tag: 'source', - name: 'HTMLSourceElement', - ctor: function HTMLSourceElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - srcset: String, - sizes: String, - media: String, - src: URL, - type: String, - width: String, - height: String, - } -}); - -define({ - tag: 'track', - name: 'HTMLTrackElement', - ctor: function HTMLTrackElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - src: URL, - srclang: String, - label: String, - default: Boolean, - kind: { type: ["subtitles", "captions", "descriptions", "chapters", "metadata"], missing: 'subtitles', invalid: 'metadata' }, - }, - props: { - NONE: { get: function() { return 0; } }, - LOADING: { get: function() { return 1; } }, - LOADED: { get: function() { return 2; } }, - ERROR: { get: function() { return 3; } }, - readyState: { get: utils.nyi }, - track: { get: utils.nyi } - } -}); - -define({ - // obsolete - tag: 'font', - name: 'HTMLFontElement', - ctor: function HTMLFontElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - color: { type: String, treatNullAsEmptyString: true }, - face: { type: String }, - size: { type: String }, - }, -}); - -define({ - // obsolete - tag: 'dir', - name: 'HTMLDirectoryElement', - ctor: function HTMLDirectoryElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - compact: Boolean, - }, -}); - -define({ - tags: [ - "abbr", "address", "article", "aside", "b", "bdi", "bdo", "cite", "content", "code", - "dd", "dfn", "dt", "em", "figcaption", "figure", "footer", "header", "hgroup", "i", "kbd", - "main", "mark", "nav", "noscript", "rb", "rp", "rt", "rtc", - "ruby", "s", "samp", "section", "small", "strong", "sub", "summary", "sup", "u", "var", "wbr", - // Legacy elements - "acronym", "basefont", "big", "center", "nobr", "noembed", "noframes", - "plaintext", "strike", "tt" - ] -}); diff --git a/.output/server/node_modules/@mixmark-io/domino/lib/impl.js b/.output/server/node_modules/@mixmark-io/domino/lib/impl.js deleted file mode 100644 index 732e821..0000000 --- a/.output/server/node_modules/@mixmark-io/domino/lib/impl.js +++ /dev/null @@ -1,27 +0,0 @@ -"use strict"; -var utils = require('./utils'); - -exports = module.exports = { - CSSStyleDeclaration: require('./CSSStyleDeclaration'), - CharacterData: require('./CharacterData'), - Comment: require('./Comment'), - DOMException: require('./DOMException'), - DOMImplementation: require('./DOMImplementation'), - DOMTokenList: require('./DOMTokenList'), - Document: require('./Document'), - DocumentFragment: require('./DocumentFragment'), - DocumentType: require('./DocumentType'), - Element: require('./Element'), - HTMLParser: require('./HTMLParser'), - NamedNodeMap: require('./NamedNodeMap'), - Node: require('./Node'), - NodeList: require('./NodeList'), - NodeFilter: require('./NodeFilter'), - ProcessingInstruction: require('./ProcessingInstruction'), - Text: require('./Text'), - Window: require('./Window') -}; - -utils.merge(exports, require('./events')); -utils.merge(exports, require('./htmlelts').elements); -utils.merge(exports, require('./svg').elements); diff --git a/.output/server/node_modules/@mixmark-io/domino/lib/index.js b/.output/server/node_modules/@mixmark-io/domino/lib/index.js deleted file mode 100644 index ebca071..0000000 --- a/.output/server/node_modules/@mixmark-io/domino/lib/index.js +++ /dev/null @@ -1,80 +0,0 @@ -"use strict"; -var DOMImplementation = require('./DOMImplementation'); -var HTMLParser = require('./HTMLParser'); -var Window = require('./Window'); -var impl = require('./impl'); - -exports.createDOMImplementation = function() { - return new DOMImplementation(null); -}; - -exports.createDocument = function(html, force) { - // Previous API couldn't let you pass '' as a document, and that - // yields a slightly different document than createHTMLDocument('') - // does. The new `force` parameter lets you pass '' if you want to. - if (html || force) { - var parser = new HTMLParser(); - parser.parse(html || '', true); - return parser.document(); - } - return new DOMImplementation(null).createHTMLDocument(""); -}; - -exports.createIncrementalHTMLParser = function() { - var parser = new HTMLParser(); - /** API for incremental parser. */ - return { - /** Provide an additional chunk of text to be parsed. */ - write: function(s) { - if (s.length > 0) { - parser.parse(s, false, function() { return true; }); - } - }, - /** - * Signal that we are done providing input text, optionally - * providing one last chunk as a parameter. - */ - end: function(s) { - parser.parse(s || '', true, function() { return true; }); - }, - /** - * Performs a chunk of parsing work, returning at the end of - * the next token as soon as shouldPauseFunc() returns true. - * Returns true iff there is more work to do. - * - * For example: - * ``` - * var incrParser = domino.createIncrementalHTMLParser(); - * incrParser.end('...long html document...'); - * while (true) { - * // Pause every 10ms - * var start = Date.now(); - * var pauseIn10 = function() { return (Date.now() - start) >= 10; }; - * if (!incrParser.process(pauseIn10)) { - * break; - * } - * ...yield to other tasks, do other housekeeping, etc... - * } - * ``` - */ - process: function(shouldPauseFunc) { - return parser.parse('', false, shouldPauseFunc); - }, - /** - * Returns the result of the incremental parse. Valid after - * `this.end()` has been called and `this.process()` has returned - * false. - */ - document: function() { - return parser.document(); - }, - }; -}; - -exports.createWindow = function(html, address) { - var document = exports.createDocument(html); - if (address !== undefined) { document._address = address; } - return new impl.Window(document); -}; - -exports.impl = impl; \ No newline at end of file diff --git a/.output/server/node_modules/@mixmark-io/domino/lib/select.js b/.output/server/node_modules/@mixmark-io/domino/lib/select.js deleted file mode 100644 index 4e68e74..0000000 --- a/.output/server/node_modules/@mixmark-io/domino/lib/select.js +++ /dev/null @@ -1,933 +0,0 @@ -"use strict"; -/* jshint eqnull: true */ -/** - * Zest (https://github.com/chjj/zest) - * A css selector engine. - * Copyright (c) 2011-2012, Christopher Jeffrey. (MIT Licensed) - * Domino version based on Zest v0.1.3 with bugfixes applied. - */ - -/** - * Helpers - */ - -var window = Object.create(null, { - location: { get: function() { - throw new Error('window.location is not supported.'); - } } -}); - -var compareDocumentPosition = function(a, b) { - return a.compareDocumentPosition(b); -}; - -var order = function(a, b) { - /* jshint bitwise: false */ - return compareDocumentPosition(a, b) & 2 ? 1 : -1; -}; - -var next = function(el) { - while ((el = el.nextSibling) - && el.nodeType !== 1); - return el; -}; - -var prev = function(el) { - while ((el = el.previousSibling) - && el.nodeType !== 1); - return el; -}; - -var child = function(el) { - /*jshint -W084 */ - if (el = el.firstChild) { - while (el.nodeType !== 1 - && (el = el.nextSibling)); - } - return el; -}; - -var lastChild = function(el) { - /*jshint -W084 */ - if (el = el.lastChild) { - while (el.nodeType !== 1 - && (el = el.previousSibling)); - } - return el; -}; - -var parentIsElement = function(n) { - if (!n.parentNode) { return false; } - var nodeType = n.parentNode.nodeType; - // The root `html` element can be a first- or last-child, too. - return nodeType === 1 || nodeType === 9; -}; - -var unquote = function(str) { - if (!str) return str; - var ch = str[0]; - if (ch === '"' || ch === '\'') { - if (str[str.length-1] === ch) { - str = str.slice(1, -1); - } else { - // bad string. - str = str.slice(1); - } - return str.replace(rules.str_escape, function(s) { - var m = /^\\(?:([0-9A-Fa-f]+)|([\r\n\f]+))/.exec(s); - if (!m) { return s.slice(1); } - if (m[2]) { return ''; /* escaped newlines are ignored in strings. */ } - var cp = parseInt(m[1], 16); - return String.fromCodePoint ? String.fromCodePoint(cp) : - // Not all JavaScript implementations have String.fromCodePoint yet. - String.fromCharCode(cp); - }); - } else if (rules.ident.test(str)) { - return decodeid(str); - } else { - // NUMBER, PERCENTAGE, DIMENSION, etc - return str; - } -}; - -var decodeid = function(str) { - return str.replace(rules.escape, function(s) { - var m = /^\\([0-9A-Fa-f]+)/.exec(s); - if (!m) { return s[1]; } - var cp = parseInt(m[1], 16); - return String.fromCodePoint ? String.fromCodePoint(cp) : - // Not all JavaScript implementations have String.fromCodePoint yet. - String.fromCharCode(cp); - }); -}; - -var indexOf = (function() { - if (Array.prototype.indexOf) { - return Array.prototype.indexOf; - } - return function(obj, item) { - var i = this.length; - while (i--) { - if (this[i] === item) return i; - } - return -1; - }; -})(); - -var makeInside = function(start, end) { - var regex = rules.inside.source - .replace(//g, end); - - return new RegExp(regex); -}; - -var replace = function(regex, name, val) { - regex = regex.source; - regex = regex.replace(name, val.source || val); - return new RegExp(regex); -}; - -var truncateUrl = function(url, num) { - return url - .replace(/^(?:\w+:\/\/|\/+)/, '') - .replace(/(?:\/+|\/*#.*?)$/, '') - .split('/', num) - .join('/'); -}; - -/** - * Handle `nth` Selectors - */ - -var parseNth = function(param_, test) { - var param = param_.replace(/\s+/g, '') - , cap; - - if (param === 'even') { - param = '2n+0'; - } else if (param === 'odd') { - param = '2n+1'; - } else if (param.indexOf('n') === -1) { - param = '0n' + param; - } - - cap = /^([+-])?(\d+)?n([+-])?(\d+)?$/.exec(param); - - return { - group: cap[1] === '-' - ? -(cap[2] || 1) - : +(cap[2] || 1), - offset: cap[4] - ? (cap[3] === '-' ? -cap[4] : +cap[4]) - : 0 - }; -}; - -var nth = function(param_, test, last) { - var param = parseNth(param_) - , group = param.group - , offset = param.offset - , find = !last ? child : lastChild - , advance = !last ? next : prev; - - return function(el) { - if (!parentIsElement(el)) return; - - var rel = find(el.parentNode) - , pos = 0; - - while (rel) { - if (test(rel, el)) pos++; - if (rel === el) { - pos -= offset; - return group && pos - ? (pos % group) === 0 && (pos < 0 === group < 0) - : !pos; - } - rel = advance(rel); - } - }; -}; - -/** - * Simple Selectors - */ - -var selectors = { - '*': (function() { - if (false/*function() { - var el = document.createElement('div'); - el.appendChild(document.createComment('')); - return !!el.getElementsByTagName('*')[0]; - }()*/) { - return function(el) { - if (el.nodeType === 1) return true; - }; - } - return function() { - return true; - }; - })(), - 'type': function(type) { - type = type.toLowerCase(); - return function(el) { - return el.nodeName.toLowerCase() === type; - }; - }, - 'attr': function(key, op, val, i) { - op = operators[op]; - return function(el) { - var attr; - switch (key) { - case 'for': - attr = el.htmlFor; - break; - case 'class': - // className is '' when non-existent - // getAttribute('class') is null - attr = el.className; - if (attr === '' && el.getAttribute('class') == null) { - attr = null; - } - break; - case 'href': - case 'src': - attr = el.getAttribute(key, 2); - break; - case 'title': - // getAttribute('title') can be '' when non-existent sometimes? - attr = el.getAttribute('title') || null; - break; - // careful with attributes with special getter functions - case 'id': - case 'lang': - case 'dir': - case 'accessKey': - case 'hidden': - case 'tabIndex': - case 'style': - if (el.getAttribute) { - attr = el.getAttribute(key); - break; - } - /* falls through */ - default: - if (el.hasAttribute && !el.hasAttribute(key)) { - break; - } - attr = el[key] != null - ? el[key] - : el.getAttribute && el.getAttribute(key); - break; - } - if (attr == null) return; - attr = attr + ''; - if (i) { - attr = attr.toLowerCase(); - val = val.toLowerCase(); - } - return op(attr, val); - }; - }, - ':first-child': function(el) { - return !prev(el) && parentIsElement(el); - }, - ':last-child': function(el) { - return !next(el) && parentIsElement(el); - }, - ':only-child': function(el) { - return !prev(el) && !next(el) && parentIsElement(el); - }, - ':nth-child': function(param, last) { - return nth(param, function() { - return true; - }, last); - }, - ':nth-last-child': function(param) { - return selectors[':nth-child'](param, true); - }, - ':root': function(el) { - return el.ownerDocument.documentElement === el; - }, - ':empty': function(el) { - return !el.firstChild; - }, - ':not': function(sel) { - var test = compileGroup(sel); - return function(el) { - return !test(el); - }; - }, - ':first-of-type': function(el) { - if (!parentIsElement(el)) return; - var type = el.nodeName; - /*jshint -W084 */ - while (el = prev(el)) { - if (el.nodeName === type) return; - } - return true; - }, - ':last-of-type': function(el) { - if (!parentIsElement(el)) return; - var type = el.nodeName; - /*jshint -W084 */ - while (el = next(el)) { - if (el.nodeName === type) return; - } - return true; - }, - ':only-of-type': function(el) { - return selectors[':first-of-type'](el) - && selectors[':last-of-type'](el); - }, - ':nth-of-type': function(param, last) { - return nth(param, function(rel, el) { - return rel.nodeName === el.nodeName; - }, last); - }, - ':nth-last-of-type': function(param) { - return selectors[':nth-of-type'](param, true); - }, - ':checked': function(el) { - return !!(el.checked || el.selected); - }, - ':indeterminate': function(el) { - return !selectors[':checked'](el); - }, - ':enabled': function(el) { - return !el.disabled && el.type !== 'hidden'; - }, - ':disabled': function(el) { - return !!el.disabled; - }, - ':target': function(el) { - return el.id === window.location.hash.substring(1); - }, - ':focus': function(el) { - return el === el.ownerDocument.activeElement; - }, - ':is': function(sel) { - return compileGroup(sel); - }, - // :matches is an older name for :is; see - // https://github.com/w3c/csswg-drafts/issues/3258 - ':matches': function(sel) { - return selectors[':is'](sel); - }, - ':nth-match': function(param, last) { - var args = param.split(/\s*,\s*/) - , arg = args.shift() - , test = compileGroup(args.join(',')); - - return nth(arg, test, last); - }, - ':nth-last-match': function(param) { - return selectors[':nth-match'](param, true); - }, - ':links-here': function(el) { - return el + '' === window.location + ''; - }, - ':lang': function(param) { - return function(el) { - while (el) { - if (el.lang) return el.lang.indexOf(param) === 0; - el = el.parentNode; - } - }; - }, - ':dir': function(param) { - return function(el) { - while (el) { - if (el.dir) return el.dir === param; - el = el.parentNode; - } - }; - }, - ':scope': function(el, con) { - var context = con || el.ownerDocument; - if (context.nodeType === 9) { - return el === context.documentElement; - } - return el === context; - }, - ':any-link': function(el) { - return typeof el.href === 'string'; - }, - ':local-link': function(el) { - if (el.nodeName) { - return el.href && el.host === window.location.host; - } - var param = +el + 1; - return function(el) { - if (!el.href) return; - - var url = window.location + '' - , href = el + ''; - - return truncateUrl(url, param) === truncateUrl(href, param); - }; - }, - ':default': function(el) { - return !!el.defaultSelected; - }, - ':valid': function(el) { - return el.willValidate || (el.validity && el.validity.valid); - }, - ':invalid': function(el) { - return !selectors[':valid'](el); - }, - ':in-range': function(el) { - return el.value > el.min && el.value <= el.max; - }, - ':out-of-range': function(el) { - return !selectors[':in-range'](el); - }, - ':required': function(el) { - return !!el.required; - }, - ':optional': function(el) { - return !el.required; - }, - ':read-only': function(el) { - if (el.readOnly) return true; - - var attr = el.getAttribute('contenteditable') - , prop = el.contentEditable - , name = el.nodeName.toLowerCase(); - - name = name !== 'input' && name !== 'textarea'; - - return (name || el.disabled) && attr == null && prop !== 'true'; - }, - ':read-write': function(el) { - return !selectors[':read-only'](el); - }, - ':hover': function() { - throw new Error(':hover is not supported.'); - }, - ':active': function() { - throw new Error(':active is not supported.'); - }, - ':link': function() { - throw new Error(':link is not supported.'); - }, - ':visited': function() { - throw new Error(':visited is not supported.'); - }, - ':column': function() { - throw new Error(':column is not supported.'); - }, - ':nth-column': function() { - throw new Error(':nth-column is not supported.'); - }, - ':nth-last-column': function() { - throw new Error(':nth-last-column is not supported.'); - }, - ':current': function() { - throw new Error(':current is not supported.'); - }, - ':past': function() { - throw new Error(':past is not supported.'); - }, - ':future': function() { - throw new Error(':future is not supported.'); - }, - // Non-standard, for compatibility purposes. - ':contains': function(param) { - return function(el) { - var text = el.innerText || el.textContent || el.value || ''; - return text.indexOf(param) !== -1; - }; - }, - ':has': function(param) { - return function(el) { - return find(param, el).length > 0; - }; - } - // Potentially add more pseudo selectors for - // compatibility with sizzle and most other - // selector engines (?). -}; - -/** - * Attribute Operators - */ - -var operators = { - '-': function() { - return true; - }, - '=': function(attr, val) { - return attr === val; - }, - '*=': function(attr, val) { - return attr.indexOf(val) !== -1; - }, - '~=': function(attr, val) { - var i - , s - , f - , l; - - for (s = 0; true; s = i + 1) { - i = attr.indexOf(val, s); - if (i === -1) return false; - f = attr[i - 1]; - l = attr[i + val.length]; - if ((!f || f === ' ') && (!l || l === ' ')) return true; - } - }, - '|=': function(attr, val) { - var i = attr.indexOf(val) - , l; - - if (i !== 0) return; - l = attr[i + val.length]; - - return l === '-' || !l; - }, - '^=': function(attr, val) { - return attr.indexOf(val) === 0; - }, - '$=': function(attr, val) { - var i = attr.lastIndexOf(val); - return i !== -1 && i + val.length === attr.length; - }, - // non-standard - '!=': function(attr, val) { - return attr !== val; - } -}; - -/** - * Combinator Logic - */ - -var combinators = { - ' ': function(test) { - return function(el) { - /*jshint -W084 */ - while (el = el.parentNode) { - if (test(el)) return el; - } - }; - }, - '>': function(test) { - return function(el) { - /*jshint -W084 */ - if (el = el.parentNode) { - return test(el) && el; - } - }; - }, - '+': function(test) { - return function(el) { - /*jshint -W084 */ - if (el = prev(el)) { - return test(el) && el; - } - }; - }, - '~': function(test) { - return function(el) { - /*jshint -W084 */ - while (el = prev(el)) { - if (test(el)) return el; - } - }; - }, - 'noop': function(test) { - return function(el) { - return test(el) && el; - }; - }, - 'ref': function(test, name) { - var node; - - function ref(el) { - var doc = el.ownerDocument - , nodes = doc.getElementsByTagName('*') - , i = nodes.length; - - while (i--) { - node = nodes[i]; - if (ref.test(el)) { - node = null; - return true; - } - } - - node = null; - } - - ref.combinator = function(el) { - if (!node || !node.getAttribute) return; - - var attr = node.getAttribute(name) || ''; - if (attr[0] === '#') attr = attr.substring(1); - - if (attr === el.id && test(node)) { - return node; - } - }; - - return ref; - } -}; - -/** - * Grammar - */ - -var rules = { - escape: /\\(?:[^0-9A-Fa-f\r\n]|[0-9A-Fa-f]{1,6}[\r\n\t ]?)/g, - str_escape: /(escape)|\\(\n|\r\n?|\f)/g, - nonascii: /[\u00A0-\uFFFF]/, - cssid: /(?:(?!-?[0-9])(?:escape|nonascii|[-_a-zA-Z0-9])+)/, - qname: /^ *(cssid|\*)/, - simple: /^(?:([.#]cssid)|pseudo|attr)/, - ref: /^ *\/(cssid)\/ */, - combinator: /^(?: +([^ \w*.#\\]) +|( )+|([^ \w*.#\\]))(?! *$)/, - attr: /^\[(cssid)(?:([^\w]?=)(inside))?\]/, - pseudo: /^(:cssid)(?:\((inside)\))?/, - inside: /(?:"(?:\\"|[^"])*"|'(?:\\'|[^'])*'|<[^"'>]*>|\\["'>]|[^"'>])*/, - ident: /^(cssid)$/ -}; - -rules.cssid = replace(rules.cssid, 'nonascii', rules.nonascii); -rules.cssid = replace(rules.cssid, 'escape', rules.escape); -rules.qname = replace(rules.qname, 'cssid', rules.cssid); -rules.simple = replace(rules.simple, 'cssid', rules.cssid); -rules.ref = replace(rules.ref, 'cssid', rules.cssid); -rules.attr = replace(rules.attr, 'cssid', rules.cssid); -rules.pseudo = replace(rules.pseudo, 'cssid', rules.cssid); -rules.inside = replace(rules.inside, '[^"\'>]*', rules.inside); -rules.attr = replace(rules.attr, 'inside', makeInside('\\[', '\\]')); -rules.pseudo = replace(rules.pseudo, 'inside', makeInside('\\(', '\\)')); -rules.simple = replace(rules.simple, 'pseudo', rules.pseudo); -rules.simple = replace(rules.simple, 'attr', rules.attr); -rules.ident = replace(rules.ident, 'cssid', rules.cssid); -rules.str_escape = replace(rules.str_escape, 'escape', rules.escape); - -/** - * Compiling - */ - -var compile = function(sel_) { - var sel = sel_.replace(/^\s+|\s+$/g, '') - , test - , filter = [] - , buff = [] - , subject - , qname - , cap - , op - , ref; - - /*jshint -W084 */ - while (sel) { - if (cap = rules.qname.exec(sel)) { - sel = sel.substring(cap[0].length); - qname = decodeid(cap[1]); - buff.push(tok(qname, true)); - } else if (cap = rules.simple.exec(sel)) { - sel = sel.substring(cap[0].length); - qname = '*'; - buff.push(tok(qname, true)); - buff.push(tok(cap)); - } else { - throw new SyntaxError('Invalid selector.'); - } - - while (cap = rules.simple.exec(sel)) { - sel = sel.substring(cap[0].length); - buff.push(tok(cap)); - } - - if (sel[0] === '!') { - sel = sel.substring(1); - subject = makeSubject(); - subject.qname = qname; - buff.push(subject.simple); - } - - if (cap = rules.ref.exec(sel)) { - sel = sel.substring(cap[0].length); - ref = combinators.ref(makeSimple(buff), decodeid(cap[1])); - filter.push(ref.combinator); - buff = []; - continue; - } - - if (cap = rules.combinator.exec(sel)) { - sel = sel.substring(cap[0].length); - op = cap[1] || cap[2] || cap[3]; - if (op === ',') { - filter.push(combinators.noop(makeSimple(buff))); - break; - } - } else { - op = 'noop'; - } - - if (!combinators[op]) { throw new SyntaxError('Bad combinator.'); } - filter.push(combinators[op](makeSimple(buff))); - buff = []; - } - - test = makeTest(filter); - test.qname = qname; - test.sel = sel; - - if (subject) { - subject.lname = test.qname; - - subject.test = test; - subject.qname = subject.qname; - subject.sel = test.sel; - test = subject; - } - - if (ref) { - ref.test = test; - ref.qname = test.qname; - ref.sel = test.sel; - test = ref; - } - - return test; -}; - -var tok = function(cap, qname) { - // qname - if (qname) { - return cap === '*' - ? selectors['*'] - : selectors.type(cap); - } - - // class/id - if (cap[1]) { - return cap[1][0] === '.' - // XXX unescape here? or in attr? - ? selectors.attr('class', '~=', decodeid(cap[1].substring(1)), false) - : selectors.attr('id', '=', decodeid(cap[1].substring(1)), false); - } - - // pseudo-name - // inside-pseudo - if (cap[2]) { - return cap[3] - ? selectors[decodeid(cap[2])](unquote(cap[3])) - : selectors[decodeid(cap[2])]; - } - - // attr name - // attr op - // attr value - if (cap[4]) { - var value = cap[6]; - var i = /["'\s]\s*I$/i.test(value); - if (i) { - value = value.replace(/\s*I$/i, ''); - } - return selectors.attr(decodeid(cap[4]), cap[5] || '-', unquote(value), i); - } - - throw new SyntaxError('Unknown Selector.'); -}; - -var makeSimple = function(func) { - var l = func.length - , i; - - // Potentially make sure - // `el` is truthy. - if (l < 2) return func[0]; - - return function(el) { - if (!el) return; - for (i = 0; i < l; i++) { - if (!func[i](el)) return; - } - return true; - }; -}; - -var makeTest = function(func) { - if (func.length < 2) { - return function(el) { - return !!func[0](el); - }; - } - return function(el) { - var i = func.length; - while (i--) { - if (!(el = func[i](el))) return; - } - return true; - }; -}; - -var makeSubject = function() { - var target; - - function subject(el) { - var node = el.ownerDocument - , scope = node.getElementsByTagName(subject.lname) - , i = scope.length; - - while (i--) { - if (subject.test(scope[i]) && target === el) { - target = null; - return true; - } - } - - target = null; - } - - subject.simple = function(el) { - target = el; - return true; - }; - - return subject; -}; - -var compileGroup = function(sel) { - var test = compile(sel) - , tests = [ test ]; - - while (test.sel) { - test = compile(test.sel); - tests.push(test); - } - - if (tests.length < 2) return test; - - return function(el) { - var l = tests.length - , i = 0; - - for (; i < l; i++) { - if (tests[i](el)) return true; - } - }; -}; - -/** - * Selection - */ - -var find = function(sel, node) { - var results = [] - , test = compile(sel) - , scope = node.getElementsByTagName(test.qname) - , i = 0 - , el; - - /*jshint -W084 */ - while (el = scope[i++]) { - if (test(el)) results.push(el); - } - - if (test.sel) { - while (test.sel) { - test = compile(test.sel); - scope = node.getElementsByTagName(test.qname); - i = 0; - /*jshint -W084 */ - while (el = scope[i++]) { - if (test(el) && indexOf.call(results, el) === -1) { - results.push(el); - } - } - } - results.sort(order); - } - - return results; -}; - -/** - * Expose - */ - -module.exports = exports = function(sel, context) { - /* when context isn't a DocumentFragment and the selector is simple: */ - var id, r; - if (context.nodeType !== 11 && sel.indexOf(' ') === -1) { - if (sel[0] === '#' && context.rooted && /^#[A-Z_][-A-Z0-9_]*$/i.test(sel)) { - if (context.doc._hasMultipleElementsWithId) { - id = sel.substring(1); - if (!context.doc._hasMultipleElementsWithId(id)) { - r = context.doc.getElementById(id); - return r ? [r] : []; - } - } - } - if (sel[0] === '.' && /^\.\w+$/.test(sel)) { - return context.getElementsByClassName(sel.substring(1)); - } - if (/^\w+$/.test(sel)) { - return context.getElementsByTagName(sel); - } - } - /* do things the hard/slow way */ - return find(sel, context); -}; - -exports.selectors = selectors; -exports.operators = operators; -exports.combinators = combinators; - -exports.matches = function(el, sel) { - var test = { sel: sel }; - do { - test = compile(test.sel); - if (test(el)) { return true; } - } while (test.sel); - return false; -}; diff --git a/.output/server/node_modules/@mixmark-io/domino/lib/style_parser.js b/.output/server/node_modules/@mixmark-io/domino/lib/style_parser.js deleted file mode 100644 index 6b893c8..0000000 --- a/.output/server/node_modules/@mixmark-io/domino/lib/style_parser.js +++ /dev/null @@ -1,106 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ - -// The below is a compiled copy of https://github.com/angular/angular/blob/92e41e9cb417223d9888a4c23b4c0e73188f87d0/packages/compiler/src/render3/view/style_parser.ts - -Object.defineProperty(exports, "__esModule", { value: true }); -exports.hyphenate = exports.parse = void 0; -/** - * Parses string representation of a style and converts it into object literal. - * - * @param value string representation of style as used in the `style` attribute in HTML. - * Example: `color: red; height: auto`. - * @returns An array of style property name and value pairs, e.g. `['color', 'red', 'height', - * 'auto']` - */ -function parse(value) { - // we use a string array here instead of a string map - // because a string-map is not guaranteed to retain the - // order of the entries whereas a string array can be - // constructed in a [key, value, key, value] format. - const styles = []; - let i = 0; - let parenDepth = 0; - let quote = 0; /* Char.QuoteNone */ - let valueStart = 0; - let propStart = 0; - let currentProp = null; - while (i < value.length) { - const token = value.charCodeAt(i++); - switch (token) { - case 40 /* Char.OpenParen */: - parenDepth++; - break; - case 41 /* Char.CloseParen */: - parenDepth--; - break; - case 39 /* Char.QuoteSingle */: - // valueStart needs to be there since prop values don't - // have quotes in CSS - if (quote === 0 /* Char.QuoteNone */) { - quote = 39 /* Char.QuoteSingle */; - } else if ( - quote === 39 /* Char.QuoteSingle */ && - value.charCodeAt(i - 1) !== 92 /* Char.BackSlash */ - ) { - quote = 0 /* Char.QuoteNone */; - } - break; - case 34 /* Char.QuoteDouble */: - // same logic as above - if (quote === 0 /* Char.QuoteNone */) { - quote = 34 /* Char.QuoteDouble */; - } else if ( - quote === 34 /* Char.QuoteDouble */ && - value.charCodeAt(i - 1) !== 92 /* Char.BackSlash */ - ) { - quote = 0 /* Char.QuoteNone */; - } - break; - case 58 /* Char.Colon */: - if ( - !currentProp && - parenDepth === 0 && - quote === 0 /* Char.QuoteNone */ - ) { - currentProp = hyphenate(value.substring(propStart, i - 1).trim()); - valueStart = i; - } - break; - case 59 /* Char.Semicolon */: - if ( - currentProp && - valueStart > 0 && - parenDepth === 0 && - quote === 0 /* Char.QuoteNone */ - ) { - const styleVal = value.substring(valueStart, i - 1).trim(); - styles.push(currentProp, styleVal); - propStart = i; - valueStart = 0; - currentProp = null; - } - break; - } - } - if (currentProp && valueStart) { - const styleVal = value.slice(valueStart).trim(); - styles.push(currentProp, styleVal); - } - return styles; -} -exports.parse = parse; -function hyphenate(value) { - return value - .replace(/[a-z][A-Z]/g, (v) => { - return v.charAt(0) + "-" + v.charAt(1); - }) - .toLowerCase(); -} -exports.hyphenate = hyphenate; diff --git a/.output/server/node_modules/@mixmark-io/domino/lib/svg.js b/.output/server/node_modules/@mixmark-io/domino/lib/svg.js deleted file mode 100644 index c46e990..0000000 --- a/.output/server/node_modules/@mixmark-io/domino/lib/svg.js +++ /dev/null @@ -1,59 +0,0 @@ -"use strict"; -var Element = require('./Element'); -var defineElement = require('./defineElement'); -var utils = require('./utils'); -var CSSStyleDeclaration = require('./CSSStyleDeclaration'); - -var svgElements = exports.elements = {}; -var svgNameToImpl = Object.create(null); - -exports.createElement = function(doc, localName, prefix) { - var impl = svgNameToImpl[localName] || SVGElement; - return new impl(doc, localName, prefix); -}; - -function define(spec) { - return defineElement(spec, SVGElement, svgElements, svgNameToImpl); -} - -var SVGElement = define({ - superclass: Element, - name: 'SVGElement', - ctor: function SVGElement(doc, localName, prefix) { - Element.call(this, doc, localName, utils.NAMESPACE.SVG, prefix); - }, - props: { - style: { get: function() { - if (!this._style) - this._style = new CSSStyleDeclaration(this); - return this._style; - }} - } -}); - -define({ - name: 'SVGSVGElement', - ctor: function SVGSVGElement(doc, localName, prefix) { - SVGElement.call(this, doc, localName, prefix); - }, - tag: 'svg', - props: { - createSVGRect: { value: function () { - return exports.createElement(this.ownerDocument, 'rect', null); - } } - } -}); - -define({ - tags: [ - 'a', 'altGlyph', 'altGlyphDef', 'altGlyphItem', 'animate', 'animateColor', 'animateMotion', 'animateTransform', - 'circle', 'clipPath', 'color-profile', 'cursor', 'defs', 'desc', 'ellipse', 'feBlend', 'feColorMatrix', - 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', - 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', - 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence', 'filter', - 'font', 'font-face', 'font-face-format', 'font-face-name', 'font-face-src', 'font-face-uri', 'foreignObject', 'g', - 'glyph', 'glyphRef', 'hkern', 'image', 'line', 'linearGradient', 'marker', 'mask', 'metadata', 'missing-glyph', - 'mpath', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'script', 'set', 'stop', 'style', - 'switch', 'symbol', 'text', 'textPath', 'title', 'tref', 'tspan', 'use', 'view', 'vkern' - ] -}); diff --git a/.output/server/node_modules/@mixmark-io/domino/lib/utils.js b/.output/server/node_modules/@mixmark-io/domino/lib/utils.js deleted file mode 100644 index affaed8..0000000 --- a/.output/server/node_modules/@mixmark-io/domino/lib/utils.js +++ /dev/null @@ -1,85 +0,0 @@ -"use strict"; -var DOMException = require('./DOMException'); -var ERR = DOMException; -var isApiWritable = require("./config").isApiWritable; - -exports.NAMESPACE = { - HTML: 'http://www.w3.org/1999/xhtml', - XML: 'http://www.w3.org/XML/1998/namespace', - XMLNS: 'http://www.w3.org/2000/xmlns/', - MATHML: 'http://www.w3.org/1998/Math/MathML', - SVG: 'http://www.w3.org/2000/svg', - XLINK: 'http://www.w3.org/1999/xlink' -}; - -// -// Shortcut functions for throwing errors of various types. -// -exports.IndexSizeError = function() { throw new DOMException(ERR.INDEX_SIZE_ERR); }; -exports.HierarchyRequestError = function() { throw new DOMException(ERR.HIERARCHY_REQUEST_ERR); }; -exports.WrongDocumentError = function() { throw new DOMException(ERR.WRONG_DOCUMENT_ERR); }; -exports.InvalidCharacterError = function() { throw new DOMException(ERR.INVALID_CHARACTER_ERR); }; -exports.NoModificationAllowedError = function() { throw new DOMException(ERR.NO_MODIFICATION_ALLOWED_ERR); }; -exports.NotFoundError = function() { throw new DOMException(ERR.NOT_FOUND_ERR); }; -exports.NotSupportedError = function() { throw new DOMException(ERR.NOT_SUPPORTED_ERR); }; -exports.InvalidStateError = function() { throw new DOMException(ERR.INVALID_STATE_ERR); }; -exports.SyntaxError = function() { throw new DOMException(ERR.SYNTAX_ERR); }; -exports.InvalidModificationError = function() { throw new DOMException(ERR.INVALID_MODIFICATION_ERR); }; -exports.NamespaceError = function() { throw new DOMException(ERR.NAMESPACE_ERR); }; -exports.InvalidAccessError = function() { throw new DOMException(ERR.INVALID_ACCESS_ERR); }; -exports.TypeMismatchError = function() { throw new DOMException(ERR.TYPE_MISMATCH_ERR); }; -exports.SecurityError = function() { throw new DOMException(ERR.SECURITY_ERR); }; -exports.NetworkError = function() { throw new DOMException(ERR.NETWORK_ERR); }; -exports.AbortError = function() { throw new DOMException(ERR.ABORT_ERR); }; -exports.UrlMismatchError = function() { throw new DOMException(ERR.URL_MISMATCH_ERR); }; -exports.QuotaExceededError = function() { throw new DOMException(ERR.QUOTA_EXCEEDED_ERR); }; -exports.TimeoutError = function() { throw new DOMException(ERR.TIMEOUT_ERR); }; -exports.InvalidNodeTypeError = function() { throw new DOMException(ERR.INVALID_NODE_TYPE_ERR); }; -exports.DataCloneError = function() { throw new DOMException(ERR.DATA_CLONE_ERR); }; - -exports.nyi = function() { - throw new Error("NotYetImplemented"); -}; - -exports.shouldOverride = function() { - throw new Error("Abstract function; should be overriding in subclass."); -}; - -exports.assert = function(expr, msg) { - if (!expr) { - throw new Error("Assertion failed: " + (msg || "") + "\n" + new Error().stack); - } -}; - -exports.expose = function(src, c) { - for (var n in src) { - Object.defineProperty(c.prototype, n, { value: src[n], writable: isApiWritable }); - } -}; - -exports.merge = function(a, b) { - for (var n in b) { - a[n] = b[n]; - } -}; - -// Compare two nodes based on their document order. This function is intended -// to be passed to sort(). Assumes that the array being sorted does not -// contain duplicates. And that all nodes are connected and comparable. -// Clever code by ppk via jeresig. -exports.documentOrder = function(n,m) { - /* jshint bitwise: false */ - return 3 - (n.compareDocumentPosition(m) & 6); -}; - -exports.toASCIILowerCase = function(s) { - return s.replace(/[A-Z]+/g, function(c) { - return c.toLowerCase(); - }); -}; - -exports.toASCIIUpperCase = function(s) { - return s.replace(/[a-z]+/g, function(c) { - return c.toUpperCase(); - }); -}; diff --git a/.output/server/node_modules/@mixmark-io/domino/lib/xmlnames.js b/.output/server/node_modules/@mixmark-io/domino/lib/xmlnames.js deleted file mode 100644 index e131d81..0000000 --- a/.output/server/node_modules/@mixmark-io/domino/lib/xmlnames.js +++ /dev/null @@ -1,91 +0,0 @@ -"use strict"; -// This grammar is from the XML and XML Namespace specs. It specifies whether -// a string (such as an element or attribute name) is a valid Name or QName. -// -// Name ::= NameStartChar (NameChar)* -// NameStartChar ::= ":" | [A-Z] | "_" | [a-z] | -// [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x2FF] | -// [#x370-#x37D] | [#x37F-#x1FFF] | -// [#x200C-#x200D] | [#x2070-#x218F] | -// [#x2C00-#x2FEF] | [#x3001-#xD7FF] | -// [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | -// [#x10000-#xEFFFF] -// -// NameChar ::= NameStartChar | "-" | "." | [0-9] | -// #xB7 | [#x0300-#x036F] | [#x203F-#x2040] -// -// QName ::= PrefixedName| UnprefixedName -// PrefixedName ::= Prefix ':' LocalPart -// UnprefixedName ::= LocalPart -// Prefix ::= NCName -// LocalPart ::= NCName -// NCName ::= Name - (Char* ':' Char*) -// # An XML Name, minus the ":" -// - -exports.isValidName = isValidName; -exports.isValidQName = isValidQName; - -// Most names will be ASCII only. Try matching against simple regexps first -var simplename = /^[_:A-Za-z][-.:\w]+$/; -var simpleqname = /^([_A-Za-z][-.\w]+|[_A-Za-z][-.\w]+:[_A-Za-z][-.\w]+)$/; - -// If the regular expressions above fail, try more complex ones that work -// for any identifiers using codepoints from the Unicode BMP -var ncnamestartchars = "_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02ff\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD"; -var ncnamechars = "-._A-Za-z0-9\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02ff\u0300-\u037D\u037F-\u1FFF\u200C\u200D\u203f\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD"; - -var ncname = "[" + ncnamestartchars + "][" + ncnamechars + "]*"; -var namestartchars = ncnamestartchars + ":"; -var namechars = ncnamechars + ":"; -var name = new RegExp("^[" + namestartchars + "]" + "[" + namechars + "]*$"); -var qname = new RegExp("^(" + ncname + "|" + ncname + ":" + ncname + ")$"); - -// XML says that these characters are also legal: -// [#x10000-#xEFFFF]. So if the patterns above fail, and the -// target string includes surrogates, then try the following -// patterns that allow surrogates and then run an extra validation -// step to make sure that the surrogates are in valid pairs and in -// the right range. Note that since the characters \uf0000 to \u1f0000 -// are not allowed, it means that the high surrogate can only go up to -// \uDB7f instead of \uDBFF. -var hassurrogates = /[\uD800-\uDB7F\uDC00-\uDFFF]/; -var surrogatechars = /[\uD800-\uDB7F\uDC00-\uDFFF]/g; -var surrogatepairs = /[\uD800-\uDB7F][\uDC00-\uDFFF]/g; - -// Modify the variables above to allow surrogates -ncnamestartchars += "\uD800-\uDB7F\uDC00-\uDFFF"; -ncnamechars += "\uD800-\uDB7F\uDC00-\uDFFF"; -ncname = "[" + ncnamestartchars + "][" + ncnamechars + "]*"; -namestartchars = ncnamestartchars + ":"; -namechars = ncnamechars + ":"; - -// Build another set of regexps that include surrogates -var surrogatename = new RegExp("^[" + namestartchars + "]" + "[" + namechars + "]*$"); -var surrogateqname = new RegExp("^(" + ncname + "|" + ncname + ":" + ncname + ")$"); - -function isValidName(s) { - if (simplename.test(s)) return true; // Plain ASCII - if (name.test(s)) return true; // Unicode BMP - - // Maybe the tests above failed because s includes surrogate pairs - // Most likely, though, they failed for some more basic syntax problem - if (!hassurrogates.test(s)) return false; - - // Is the string a valid name if we allow surrogates? - if (!surrogatename.test(s)) return false; - - // Finally, are the surrogates all correctly paired up? - var chars = s.match(surrogatechars), pairs = s.match(surrogatepairs); - return pairs !== null && 2*pairs.length === chars.length; -} - -function isValidQName(s) { - if (simpleqname.test(s)) return true; // Plain ASCII - if (qname.test(s)) return true; // Unicode BMP - - if (!hassurrogates.test(s)) return false; - if (!surrogateqname.test(s)) return false; - var chars = s.match(surrogatechars), pairs = s.match(surrogatepairs); - return pairs !== null && 2*pairs.length === chars.length; -} diff --git a/.output/server/node_modules/@mixmark-io/domino/package.json b/.output/server/node_modules/@mixmark-io/domino/package.json deleted file mode 100644 index ca66696..0000000 --- a/.output/server/node_modules/@mixmark-io/domino/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "@mixmark-io/domino", - "version": "2.2.0", - "license": "BSD-2-Clause", - "author": "Felix Gnass ", - "description": "Server-side DOM implementation based on Mozilla's dom.js", - "main": "./lib", - "repository": { - "type": "git", - "url": "https://github.com/mixmark-io/domino.git" - }, - "scripts": { - "test": "mocha" - }, - "types": "lib/index.d.ts", - "devDependencies": { - "jquery": "^3.5.1", - "mocha": "^6.2.3", - "puppeteer": "^21.3.5", - "should": "^13.2.3" - } -} \ No newline at end of file diff --git a/.output/server/node_modules/@mongodb-js/zstd/build/Release/zstd.node b/.output/server/node_modules/@mongodb-js/zstd/build/Release/zstd.node deleted file mode 100644 index f6e09b7..0000000 Binary files a/.output/server/node_modules/@mongodb-js/zstd/build/Release/zstd.node and /dev/null differ diff --git a/.output/server/node_modules/@mongodb-js/zstd/lib/index.js b/.output/server/node_modules/@mongodb-js/zstd/lib/index.js deleted file mode 100644 index 994f967..0000000 --- a/.output/server/node_modules/@mongodb-js/zstd/lib/index.js +++ /dev/null @@ -1,55 +0,0 @@ -'use strict'; -const { promisify } = require('util'); -const { isUint8Array } = require('util/types'); - -function load() { - try { - return require('../build/Release/zstd.node'); - } catch { - // Webpack will fail when just returning the require, so we need to wrap - // in a try/catch and rethrow. - /* eslint no-useless-catch: 0 */ - try { - return require('../build/Debug/zstd.node'); - } catch (error) { - throw error; - } - } -} - -const zstd = load(); - -const _compress = promisify(zstd.compress); -const _decompress = promisify(zstd.decompress); -// Error objects created via napi don't have JS stacks; wrap them so .stack is present -// https://github.com/nodejs/node/issues/25318#issuecomment-451068073 - -exports.compress = async function compress(data, compressionLevel) { - if (!isUint8Array(data)) { - throw new TypeError(`parameter 'data' must be a Uint8Array.`); - } - - if (compressionLevel != null && typeof compressionLevel !== 'number') { - throw new TypeError(`parameter 'compressionLevel' must be a number.`); - } - - try { - return await _compress(data, compressionLevel ?? 3); - } catch (e) { - throw new Error(`zstd: ${e.message}`); - } -}; - -exports.decompress = async function decompress(data) { - if (!isUint8Array(data)) { - throw new TypeError(`parameter 'data' must be a Uint8Array.`); - } - try { - return await _decompress(data); - } catch (e) { - throw new Error(`zstd: ${e.message}`); - } -}; - -/** used for testing */ -exports.getDefinedNapiVersion = zstd.getDefinedNapiVersion; diff --git a/.output/server/node_modules/@mongodb-js/zstd/package.json b/.output/server/node_modules/@mongodb-js/zstd/package.json deleted file mode 100644 index f09c555..0000000 --- a/.output/server/node_modules/@mongodb-js/zstd/package.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "name": "@mongodb-js/zstd", - "version": "7.0.0", - "main": "lib/index.js", - "types": "index.d.ts", - "repository": "https://github.com/mongodb-js/zstd", - "files": [ - "index.d.ts", - "lib/index.js", - "addon/*", - "binding.gyp" - ], - "dependencies": { - "node-addon-api": "^8.5.0", - "prebuild-install": "^7.1.3" - }, - "license": "Apache-2.0", - "devDependencies": { - "@mongodb-js/zstd": "^1.2.0", - "@typescript-eslint/eslint-plugin": "^8.46.0", - "@wasm-fmt/clang-format": "^21.1.4", - "chai": "^4.5.0", - "eslint": "^9.37.0", - "eslint-config-prettier": "^10.1.8", - "eslint-plugin-prettier": "^5.5.4", - "mocha": "^11.7.4", - "node-gyp": "^11.4.2", - "prebuild": "^13.0.1", - "prettier": "^3.6.2" - }, - "engines": { - "node": ">= 20.19.0" - }, - "scripts": { - "install": "prebuild-install --runtime napi || npm run clean-install", - "clean-install": "npm run install-zstd && npm run compile", - "compile": "node-gyp rebuild", - "test": "mocha test/*.js", - "install-zstd": "bash etc/install-zstd.sh", - "check:eslint": "ESLINT_USE_FLAT_CONFIG=false eslint *ts lib/*.js test/*.js .*.json", - "clang-format": "clang-format --style=file:.clang-format --Werror -i addon/*", - "check:clang-format": "clang-format --style=file:.clang-format --dry-run --Werror addon/*", - "prebuild": "prebuild --runtime napi --strip --verbose --all" - }, - "binary": { - "napi_versions": [ - 9 - ] - }, - "mongodb:zstd_version": "1.5.6" -} \ No newline at end of file diff --git a/.output/server/node_modules/balanced-match/dist/esm/index.js b/.output/server/node_modules/balanced-match/dist/esm/index.js deleted file mode 100644 index fe81200..0000000 --- a/.output/server/node_modules/balanced-match/dist/esm/index.js +++ /dev/null @@ -1,54 +0,0 @@ -export const balanced = (a, b, str) => { - const ma = a instanceof RegExp ? maybeMatch(a, str) : a; - const mb = b instanceof RegExp ? maybeMatch(b, str) : b; - const r = ma !== null && mb != null && range(ma, mb, str); - return (r && { - start: r[0], - end: r[1], - pre: str.slice(0, r[0]), - body: str.slice(r[0] + ma.length, r[1]), - post: str.slice(r[1] + mb.length), - }); -}; -const maybeMatch = (reg, str) => { - const m = str.match(reg); - return m ? m[0] : null; -}; -export const range = (a, b, str) => { - let begs, beg, left, right = undefined, result; - let ai = str.indexOf(a); - let bi = str.indexOf(b, ai + 1); - let i = ai; - if (ai >= 0 && bi > 0) { - if (a === b) { - return [ai, bi]; - } - begs = []; - left = str.length; - while (i >= 0 && !result) { - if (i === ai) { - begs.push(i); - ai = str.indexOf(a, i + 1); - } - else if (begs.length === 1) { - const r = begs.pop(); - if (r !== undefined) - result = [r, bi]; - } - else { - beg = begs.pop(); - if (beg !== undefined && beg < left) { - left = beg; - right = bi; - } - bi = str.indexOf(b, i + 1); - } - i = ai < bi && ai >= 0 ? ai : bi; - } - if (begs.length && right !== undefined) { - result = [left, right]; - } - } - return result; -}; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/.output/server/node_modules/balanced-match/dist/esm/package.json b/.output/server/node_modules/balanced-match/dist/esm/package.json deleted file mode 100644 index 3dbc1ca..0000000 --- a/.output/server/node_modules/balanced-match/dist/esm/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "type": "module" -} diff --git a/.output/server/node_modules/balanced-match/package.json b/.output/server/node_modules/balanced-match/package.json deleted file mode 100644 index 367c6d4..0000000 --- a/.output/server/node_modules/balanced-match/package.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "name": "balanced-match", - "description": "Match balanced character pairs, like \"{\" and \"}\"", - "version": "4.0.4", - "files": [ - "dist" - ], - "repository": { - "type": "git", - "url": "git://github.com/juliangruber/balanced-match.git" - }, - "exports": { - "./package.json": "./package.json", - ".": { - "import": { - "types": "./dist/esm/index.d.ts", - "default": "./dist/esm/index.js" - }, - "require": { - "types": "./dist/commonjs/index.d.ts", - "default": "./dist/commonjs/index.js" - } - } - }, - "type": "module", - "scripts": { - "preversion": "npm test", - "postversion": "npm publish", - "prepublishOnly": "git push origin --follow-tags", - "prepare": "tshy", - "pretest": "npm run prepare", - "presnap": "npm run prepare", - "test": "tap", - "snap": "tap", - "format": "prettier --write .", - "benchmark": "node benchmark/index.js", - "typedoc": "typedoc --tsconfig .tshy/esm.json ./src/*.ts" - }, - "devDependencies": { - "@types/brace-expansion": "^1.1.2", - "@types/node": "^25.2.1", - "mkdirp": "^3.0.1", - "prettier": "^3.3.2", - "tap": "^21.6.2", - "tshy": "^3.0.2", - "typedoc": "^0.28.5" - }, - "keywords": [ - "match", - "regexp", - "test", - "balanced", - "parse" - ], - "license": "MIT", - "engines": { - "node": "18 || 20 || >=22" - }, - "tshy": { - "exports": { - "./package.json": "./package.json", - ".": "./src/index.ts" - } - }, - "main": "./dist/commonjs/index.js", - "types": "./dist/commonjs/index.d.ts", - "module": "./dist/esm/index.js" -} \ No newline at end of file diff --git a/.output/server/node_modules/brace-expansion/dist/esm/index.js b/.output/server/node_modules/brace-expansion/dist/esm/index.js deleted file mode 100644 index b2d2aa9..0000000 --- a/.output/server/node_modules/brace-expansion/dist/esm/index.js +++ /dev/null @@ -1,207 +0,0 @@ -import { balanced } from 'balanced-match'; -const escSlash = '\0SLASH' + Math.random() + '\0'; -const escOpen = '\0OPEN' + Math.random() + '\0'; -const escClose = '\0CLOSE' + Math.random() + '\0'; -const escComma = '\0COMMA' + Math.random() + '\0'; -const escPeriod = '\0PERIOD' + Math.random() + '\0'; -const escSlashPattern = new RegExp(escSlash, 'g'); -const escOpenPattern = new RegExp(escOpen, 'g'); -const escClosePattern = new RegExp(escClose, 'g'); -const escCommaPattern = new RegExp(escComma, 'g'); -const escPeriodPattern = new RegExp(escPeriod, 'g'); -const slashPattern = /\\\\/g; -const openPattern = /\\{/g; -const closePattern = /\\}/g; -const commaPattern = /\\,/g; -const periodPattern = /\\\./g; -export const EXPANSION_MAX = 100_000; -function numeric(str) { - return !isNaN(str) ? parseInt(str, 10) : str.charCodeAt(0); -} -function escapeBraces(str) { - return str - .replace(slashPattern, escSlash) - .replace(openPattern, escOpen) - .replace(closePattern, escClose) - .replace(commaPattern, escComma) - .replace(periodPattern, escPeriod); -} -function unescapeBraces(str) { - return str - .replace(escSlashPattern, '\\') - .replace(escOpenPattern, '{') - .replace(escClosePattern, '}') - .replace(escCommaPattern, ',') - .replace(escPeriodPattern, '.'); -} -/** - * Basically just str.split(","), but handling cases - * where we have nested braced sections, which should be - * treated as individual members, like {a,{b,c},d} - */ -function parseCommaParts(str) { - if (!str) { - return ['']; - } - const parts = []; - const m = balanced('{', '}', str); - if (!m) { - return str.split(','); - } - const { pre, body, post } = m; - const p = pre.split(','); - p[p.length - 1] += '{' + body + '}'; - const postParts = parseCommaParts(post); - if (post.length) { - ; - p[p.length - 1] += postParts.shift(); - p.push.apply(p, postParts); - } - parts.push.apply(parts, p); - return parts; -} -export function expand(str, options = {}) { - if (!str) { - return []; - } - const { max = EXPANSION_MAX } = options; - // I don't know why Bash 4.3 does this, but it does. - // Anything starting with {} will have the first two bytes preserved - // but *only* at the top level, so {},a}b will not expand to anything, - // but a{},b}c will be expanded to [a}c,abc]. - // One could argue that this is a bug in Bash, but since the goal of - // this module is to match Bash's rules, we escape a leading {} - if (str.slice(0, 2) === '{}') { - str = '\\{\\}' + str.slice(2); - } - return expand_(escapeBraces(str), max, true).map(unescapeBraces); -} -function embrace(str) { - return '{' + str + '}'; -} -function isPadded(el) { - return /^-?0\d/.test(el); -} -function lte(i, y) { - return i <= y; -} -function gte(i, y) { - return i >= y; -} -function expand_(str, max, isTop) { - /** @type {string[]} */ - const expansions = []; - // The `{a},b}` rewrite below restarts expansion on a rewritten string with - // the same `max` and `isTop = true`. Loop instead of recursing so a long run - // of non-expanding `{}` groups can't exhaust the call stack. - for (;;) { - const m = balanced('{', '}', str); - if (!m) - return [str]; - // no need to expand pre, since it is guaranteed to be free of brace-sets - const pre = m.pre; - if (/\$$/.test(m.pre)) { - const post = m.post.length ? expand_(m.post, max, false) : ['']; - for (let k = 0; k < post.length && k < max; k++) { - const expansion = pre + '{' + m.body + '}' + post[k]; - expansions.push(expansion); - } - return expansions; - } - const isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); - const isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); - const isSequence = isNumericSequence || isAlphaSequence; - const isOptions = m.body.indexOf(',') >= 0; - if (!isSequence && !isOptions) { - // {a},b} - if (m.post.match(/,(?!,).*\}/)) { - str = m.pre + '{' + m.body + escClose + m.post; - isTop = true; - continue; - } - return [str]; - } - // Only expand post once we know this brace set actually expands. Computing - // it before the early returns above expanded post a second time on every - // non-expanding `{}`, which is what made inputs like `a{},{},{}...` blow up - // exponentially. - const post = m.post.length ? expand_(m.post, max, false) : ['']; - let n; - if (isSequence) { - n = m.body.split(/\.\./); - } - else { - n = parseCommaParts(m.body); - if (n.length === 1 && n[0] !== undefined) { - // x{{a,b}}y ==> x{a}y x{b}y - n = expand_(n[0], max, false).map(embrace); - //XXX is this necessary? Can't seem to hit it in tests. - /* c8 ignore start */ - if (n.length === 1) { - return post.map(p => m.pre + n[0] + p); - } - /* c8 ignore stop */ - } - } - // at this point, n is the parts, and we know it's not a comma set - // with a single entry. - let N; - if (isSequence && n[0] !== undefined && n[1] !== undefined) { - const x = numeric(n[0]); - const y = numeric(n[1]); - const width = Math.max(n[0].length, n[1].length); - let incr = n.length === 3 && n[2] !== undefined ? - Math.max(Math.abs(numeric(n[2])), 1) - : 1; - let test = lte; - const reverse = y < x; - if (reverse) { - incr *= -1; - test = gte; - } - const pad = n.some(isPadded); - N = []; - for (let i = x; test(i, y) && N.length < max; i += incr) { - let c; - if (isAlphaSequence) { - c = String.fromCharCode(i); - if (c === '\\') { - c = ''; - } - } - else { - c = String(i); - if (pad) { - const need = width - c.length; - if (need > 0) { - const z = new Array(need + 1).join('0'); - if (i < 0) { - c = '-' + z + c.slice(1); - } - else { - c = z + c; - } - } - } - } - N.push(c); - } - } - else { - N = []; - for (let j = 0; j < n.length; j++) { - N.push.apply(N, expand_(n[j], max, false)); - } - } - for (let j = 0; j < N.length; j++) { - for (let k = 0; k < post.length && expansions.length < max; k++) { - const expansion = pre + N[j] + post[k]; - if (!isTop || isSequence || expansion) { - expansions.push(expansion); - } - } - } - return expansions; - } -} -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/.output/server/node_modules/brace-expansion/dist/esm/package.json b/.output/server/node_modules/brace-expansion/dist/esm/package.json deleted file mode 100644 index 3dbc1ca..0000000 --- a/.output/server/node_modules/brace-expansion/dist/esm/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "type": "module" -} diff --git a/.output/server/node_modules/brace-expansion/package.json b/.output/server/node_modules/brace-expansion/package.json deleted file mode 100644 index f1d2ac3..0000000 --- a/.output/server/node_modules/brace-expansion/package.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "name": "brace-expansion", - "description": "Brace expansion as known from sh/bash", - "version": "5.0.7", - "files": [ - "dist" - ], - "exports": { - "./package.json": "./package.json", - ".": { - "import": { - "types": "./dist/esm/index.d.ts", - "default": "./dist/esm/index.js" - }, - "require": { - "types": "./dist/commonjs/index.d.ts", - "default": "./dist/commonjs/index.js" - } - } - }, - "type": "module", - "scripts": { - "preversion": "npm test", - "postversion": "npm publish", - "prepublishOnly": "git push origin --follow-tags", - "prepare": "tshy", - "pretest": "npm run prepare", - "presnap": "npm run prepare", - "test": "tap", - "snap": "tap", - "format": "prettier --write .", - "benchmark": "node benchmark/index.js", - "typedoc": "typedoc --tsconfig .tshy/esm.json ./src/*.ts" - }, - "devDependencies": { - "@types/brace-expansion": "^1.1.2", - "@types/node": "^25.2.1", - "mkdirp": "^3.0.1", - "prettier": "^3.3.2", - "tap": "^21.6.2", - "tshy": "^3.0.2", - "typedoc": "^0.28.5" - }, - "dependencies": { - "balanced-match": "^4.0.2" - }, - "license": "MIT", - "engines": { - "node": "18 || 20 || >=22" - }, - "tshy": { - "exports": { - "./package.json": "./package.json", - ".": "./src/index.ts" - } - }, - "main": "./dist/commonjs/index.js", - "types": "./dist/commonjs/index.d.ts", - "module": "./dist/esm/index.js", - "repository": { - "type": "git", - "url": "git+https://github.com/juliangruber/brace-expansion.git" - } -} \ No newline at end of file diff --git a/.output/server/node_modules/diff/libesm/convert/dmp.js b/.output/server/node_modules/diff/libesm/convert/dmp.js deleted file mode 100644 index 44d2841..0000000 --- a/.output/server/node_modules/diff/libesm/convert/dmp.js +++ /dev/null @@ -1,21 +0,0 @@ -/** - * converts a list of change objects to the format returned by Google's [diff-match-patch](https://github.com/google/diff-match-patch) library - */ -export function convertChangesToDMP(changes) { - const ret = []; - let change, operation; - for (let i = 0; i < changes.length; i++) { - change = changes[i]; - if (change.added) { - operation = 1; - } - else if (change.removed) { - operation = -1; - } - else { - operation = 0; - } - ret.push([operation, change.value]); - } - return ret; -} diff --git a/.output/server/node_modules/diff/libesm/convert/xml.js b/.output/server/node_modules/diff/libesm/convert/xml.js deleted file mode 100644 index 90ea8a2..0000000 --- a/.output/server/node_modules/diff/libesm/convert/xml.js +++ /dev/null @@ -1,31 +0,0 @@ -/** - * converts a list of change objects to a serialized XML format - */ -export function convertChangesToXML(changes) { - const ret = []; - for (let i = 0; i < changes.length; i++) { - const change = changes[i]; - if (change.added) { - ret.push(''); - } - else if (change.removed) { - ret.push(''); - } - ret.push(escapeHTML(change.value)); - if (change.added) { - ret.push(''); - } - else if (change.removed) { - ret.push(''); - } - } - return ret.join(''); -} -function escapeHTML(s) { - let n = s; - n = n.replace(/&/g, '&'); - n = n.replace(//g, '>'); - n = n.replace(/"/g, '"'); - return n; -} diff --git a/.output/server/node_modules/diff/libesm/diff/array.js b/.output/server/node_modules/diff/libesm/diff/array.js deleted file mode 100644 index d92aeb4..0000000 --- a/.output/server/node_modules/diff/libesm/diff/array.js +++ /dev/null @@ -1,16 +0,0 @@ -import Diff from './base.js'; -class ArrayDiff extends Diff { - tokenize(value) { - return value.slice(); - } - join(value) { - return value; - } - removeEmpty(value) { - return value; - } -} -export const arrayDiff = new ArrayDiff(); -export function diffArrays(oldArr, newArr, options) { - return arrayDiff.diff(oldArr, newArr, options); -} diff --git a/.output/server/node_modules/diff/libesm/diff/base.js b/.output/server/node_modules/diff/libesm/diff/base.js deleted file mode 100644 index db02845..0000000 --- a/.output/server/node_modules/diff/libesm/diff/base.js +++ /dev/null @@ -1,253 +0,0 @@ -export default class Diff { - diff(oldStr, newStr, - // Type below is not accurate/complete - see above for full possibilities - but it compiles - options = {}) { - let callback; - if (typeof options === 'function') { - callback = options; - options = {}; - } - else if ('callback' in options) { - callback = options.callback; - } - // Allow subclasses to massage the input prior to running - const oldString = this.castInput(oldStr, options); - const newString = this.castInput(newStr, options); - const oldTokens = this.removeEmpty(this.tokenize(oldString, options)); - const newTokens = this.removeEmpty(this.tokenize(newString, options)); - return this.diffWithOptionsObj(oldTokens, newTokens, options, callback); - } - diffWithOptionsObj(oldTokens, newTokens, options, callback) { - var _a; - const done = (value) => { - value = this.postProcess(value, options); - if (callback) { - setTimeout(function () { callback(value); }, 0); - return undefined; - } - else { - return value; - } - }; - const newLen = newTokens.length, oldLen = oldTokens.length; - let editLength = 1; - let maxEditLength = newLen + oldLen; - if (options.maxEditLength != null) { - maxEditLength = Math.min(maxEditLength, options.maxEditLength); - } - const maxExecutionTime = (_a = options.timeout) !== null && _a !== void 0 ? _a : Infinity; - const abortAfterTimestamp = Date.now() + maxExecutionTime; - const bestPath = [{ oldPos: -1, lastComponent: undefined }]; - // Seed editLength = 0, i.e. the content starts with the same values - let newPos = this.extractCommon(bestPath[0], newTokens, oldTokens, 0, options); - if (bestPath[0].oldPos + 1 >= oldLen && newPos + 1 >= newLen) { - // Identity per the equality and tokenizer - return done(this.buildValues(bestPath[0].lastComponent, newTokens, oldTokens)); - } - // Once we hit the right edge of the edit graph on some diagonal k, we can - // definitely reach the end of the edit graph in no more than k edits, so - // there's no point in considering any moves to diagonal k+1 any more (from - // which we're guaranteed to need at least k+1 more edits). - // Similarly, once we've reached the bottom of the edit graph, there's no - // point considering moves to lower diagonals. - // We record this fact by setting minDiagonalToConsider and - // maxDiagonalToConsider to some finite value once we've hit the edge of - // the edit graph. - // This optimization is not faithful to the original algorithm presented in - // Myers's paper, which instead pointlessly extends D-paths off the end of - // the edit graph - see page 7 of Myers's paper which notes this point - // explicitly and illustrates it with a diagram. This has major performance - // implications for some common scenarios. For instance, to compute a diff - // where the new text simply appends d characters on the end of the - // original text of length n, the true Myers algorithm will take O(n+d^2) - // time while this optimization needs only O(n+d) time. - let minDiagonalToConsider = -Infinity, maxDiagonalToConsider = Infinity; - // Main worker method. checks all permutations of a given edit length for acceptance. - const execEditLength = () => { - for (let diagonalPath = Math.max(minDiagonalToConsider, -editLength); diagonalPath <= Math.min(maxDiagonalToConsider, editLength); diagonalPath += 2) { - let basePath; - const removePath = bestPath[diagonalPath - 1], addPath = bestPath[diagonalPath + 1]; - if (removePath) { - // No one else is going to attempt to use this value, clear it - // @ts-expect-error - perf optimisation. This type-violating value will never be read. - bestPath[diagonalPath - 1] = undefined; - } - let canAdd = false; - if (addPath) { - // what newPos will be after we do an insertion: - const addPathNewPos = addPath.oldPos - diagonalPath; - canAdd = addPath && 0 <= addPathNewPos && addPathNewPos < newLen; - } - const canRemove = removePath && removePath.oldPos + 1 < oldLen; - if (!canAdd && !canRemove) { - // If this path is a terminal then prune - // @ts-expect-error - perf optimisation. This type-violating value will never be read. - bestPath[diagonalPath] = undefined; - continue; - } - // Select the diagonal that we want to branch from. We select the prior - // path whose position in the old string is the farthest from the origin - // and does not pass the bounds of the diff graph - if (!canRemove || (canAdd && removePath.oldPos < addPath.oldPos)) { - basePath = this.addToPath(addPath, true, false, 0, options); - } - else { - basePath = this.addToPath(removePath, false, true, 1, options); - } - newPos = this.extractCommon(basePath, newTokens, oldTokens, diagonalPath, options); - if (basePath.oldPos + 1 >= oldLen && newPos + 1 >= newLen) { - // If we have hit the end of both strings, then we are done - return done(this.buildValues(basePath.lastComponent, newTokens, oldTokens)) || true; - } - else { - bestPath[diagonalPath] = basePath; - if (basePath.oldPos + 1 >= oldLen) { - maxDiagonalToConsider = Math.min(maxDiagonalToConsider, diagonalPath - 1); - } - if (newPos + 1 >= newLen) { - minDiagonalToConsider = Math.max(minDiagonalToConsider, diagonalPath + 1); - } - } - } - editLength++; - }; - // Performs the length of edit iteration. Is a bit fugly as this has to support the - // sync and async mode which is never fun. Loops over execEditLength until a value - // is produced, or until the edit length exceeds options.maxEditLength (if given), - // in which case it will return undefined. - if (callback) { - (function exec() { - setTimeout(function () { - if (editLength > maxEditLength || Date.now() > abortAfterTimestamp) { - return callback(undefined); - } - if (!execEditLength()) { - exec(); - } - }, 0); - }()); - } - else { - while (editLength <= maxEditLength && Date.now() <= abortAfterTimestamp) { - const ret = execEditLength(); - if (ret) { - return ret; - } - } - } - } - addToPath(path, added, removed, oldPosInc, options) { - const last = path.lastComponent; - if (last && !options.oneChangePerToken && last.added === added && last.removed === removed) { - return { - oldPos: path.oldPos + oldPosInc, - lastComponent: { count: last.count + 1, added: added, removed: removed, previousComponent: last.previousComponent } - }; - } - else { - return { - oldPos: path.oldPos + oldPosInc, - lastComponent: { count: 1, added: added, removed: removed, previousComponent: last } - }; - } - } - extractCommon(basePath, newTokens, oldTokens, diagonalPath, options) { - const newLen = newTokens.length, oldLen = oldTokens.length; - let oldPos = basePath.oldPos, newPos = oldPos - diagonalPath, commonCount = 0; - while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(oldTokens[oldPos + 1], newTokens[newPos + 1], options)) { - newPos++; - oldPos++; - commonCount++; - if (options.oneChangePerToken) { - basePath.lastComponent = { count: 1, previousComponent: basePath.lastComponent, added: false, removed: false }; - } - } - if (commonCount && !options.oneChangePerToken) { - basePath.lastComponent = { count: commonCount, previousComponent: basePath.lastComponent, added: false, removed: false }; - } - basePath.oldPos = oldPos; - return newPos; - } - equals(left, right, options) { - if (options.comparator) { - return options.comparator(left, right); - } - else { - return left === right - || (!!options.ignoreCase && left.toLowerCase() === right.toLowerCase()); - } - } - removeEmpty(array) { - const ret = []; - for (let i = 0; i < array.length; i++) { - if (array[i]) { - ret.push(array[i]); - } - } - return ret; - } - // eslint-disable-next-line @typescript-eslint/no-unused-vars - castInput(value, options) { - return value; - } - // eslint-disable-next-line @typescript-eslint/no-unused-vars - tokenize(value, options) { - return Array.from(value); - } - join(chars) { - // Assumes ValueT is string, which is the case for most subclasses. - // When it's false, e.g. in diffArrays, this method needs to be overridden (e.g. with a no-op) - // Yes, the casts are verbose and ugly, because this pattern - of having the base class SORT OF - // assume tokens and values are strings, but not completely - is weird and janky. - return chars.join(''); - } - postProcess(changeObjects, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - options) { - return changeObjects; - } - get useLongestToken() { - return false; - } - buildValues(lastComponent, newTokens, oldTokens) { - // First we convert our linked list of components in reverse order to an - // array in the right order: - const components = []; - let nextComponent; - while (lastComponent) { - components.push(lastComponent); - nextComponent = lastComponent.previousComponent; - delete lastComponent.previousComponent; - lastComponent = nextComponent; - } - components.reverse(); - const componentLen = components.length; - let componentPos = 0, newPos = 0, oldPos = 0; - for (; componentPos < componentLen; componentPos++) { - const component = components[componentPos]; - if (!component.removed) { - if (!component.added && this.useLongestToken) { - let value = newTokens.slice(newPos, newPos + component.count); - value = value.map(function (value, i) { - const oldValue = oldTokens[oldPos + i]; - return oldValue.length > value.length ? oldValue : value; - }); - component.value = this.join(value); - } - else { - component.value = this.join(newTokens.slice(newPos, newPos + component.count)); - } - newPos += component.count; - // Common case - if (!component.added) { - oldPos += component.count; - } - } - else { - component.value = this.join(oldTokens.slice(oldPos, oldPos + component.count)); - oldPos += component.count; - } - } - return components; - } -} diff --git a/.output/server/node_modules/diff/libesm/diff/character.js b/.output/server/node_modules/diff/libesm/diff/character.js deleted file mode 100644 index ca70d06..0000000 --- a/.output/server/node_modules/diff/libesm/diff/character.js +++ /dev/null @@ -1,7 +0,0 @@ -import Diff from './base.js'; -class CharacterDiff extends Diff { -} -export const characterDiff = new CharacterDiff(); -export function diffChars(oldStr, newStr, options) { - return characterDiff.diff(oldStr, newStr, options); -} diff --git a/.output/server/node_modules/diff/libesm/diff/css.js b/.output/server/node_modules/diff/libesm/diff/css.js deleted file mode 100644 index 2e7adcc..0000000 --- a/.output/server/node_modules/diff/libesm/diff/css.js +++ /dev/null @@ -1,10 +0,0 @@ -import Diff from './base.js'; -class CssDiff extends Diff { - tokenize(value) { - return value.split(/([{}:;,]|\s+)/); - } -} -export const cssDiff = new CssDiff(); -export function diffCss(oldStr, newStr, options) { - return cssDiff.diff(oldStr, newStr, options); -} diff --git a/.output/server/node_modules/diff/libesm/diff/json.js b/.output/server/node_modules/diff/libesm/diff/json.js deleted file mode 100644 index be9f761..0000000 --- a/.output/server/node_modules/diff/libesm/diff/json.js +++ /dev/null @@ -1,78 +0,0 @@ -import Diff from './base.js'; -import { tokenize } from './line.js'; -class JsonDiff extends Diff { - constructor() { - super(...arguments); - this.tokenize = tokenize; - } - get useLongestToken() { - // Discriminate between two lines of pretty-printed, serialized JSON where one of them has a - // dangling comma and the other doesn't. Turns out including the dangling comma yields the nicest output: - return true; - } - castInput(value, options) { - const { undefinedReplacement, stringifyReplacer = (k, v) => typeof v === 'undefined' ? undefinedReplacement : v } = options; - return typeof value === 'string' ? value : JSON.stringify(canonicalize(value, null, null, stringifyReplacer), null, ' '); - } - equals(left, right, options) { - return super.equals(left.replace(/,([\r\n])/g, '$1'), right.replace(/,([\r\n])/g, '$1'), options); - } -} -export const jsonDiff = new JsonDiff(); -export function diffJson(oldStr, newStr, options) { - return jsonDiff.diff(oldStr, newStr, options); -} -// This function handles the presence of circular references by bailing out when encountering an -// object that is already on the "stack" of items being processed. Accepts an optional replacer -export function canonicalize(obj, stack, replacementStack, replacer, key) { - stack = stack || []; - replacementStack = replacementStack || []; - if (replacer) { - obj = replacer(key === undefined ? '' : key, obj); - } - let i; - for (i = 0; i < stack.length; i += 1) { - if (stack[i] === obj) { - return replacementStack[i]; - } - } - let canonicalizedObj; - if ('[object Array]' === Object.prototype.toString.call(obj)) { - stack.push(obj); - canonicalizedObj = new Array(obj.length); - replacementStack.push(canonicalizedObj); - for (i = 0; i < obj.length; i += 1) { - canonicalizedObj[i] = canonicalize(obj[i], stack, replacementStack, replacer, String(i)); - } - stack.pop(); - replacementStack.pop(); - return canonicalizedObj; - } - if (obj && obj.toJSON) { - obj = obj.toJSON(); - } - if (typeof obj === 'object' && obj !== null) { - stack.push(obj); - canonicalizedObj = {}; - replacementStack.push(canonicalizedObj); - const sortedKeys = []; - let key; - for (key in obj) { - /* istanbul ignore else */ - if (Object.prototype.hasOwnProperty.call(obj, key)) { - sortedKeys.push(key); - } - } - sortedKeys.sort(); - for (i = 0; i < sortedKeys.length; i += 1) { - key = sortedKeys[i]; - canonicalizedObj[key] = canonicalize(obj[key], stack, replacementStack, replacer, key); - } - stack.pop(); - replacementStack.pop(); - } - else { - canonicalizedObj = obj; - } - return canonicalizedObj; -} diff --git a/.output/server/node_modules/diff/libesm/diff/line.js b/.output/server/node_modules/diff/libesm/diff/line.js deleted file mode 100644 index 0675d4f..0000000 --- a/.output/server/node_modules/diff/libesm/diff/line.js +++ /dev/null @@ -1,65 +0,0 @@ -import Diff from './base.js'; -import { generateOptions } from '../util/params.js'; -class LineDiff extends Diff { - constructor() { - super(...arguments); - this.tokenize = tokenize; - } - equals(left, right, options) { - // If we're ignoring whitespace, we need to normalise lines by stripping - // whitespace before checking equality. (This has an annoying interaction - // with newlineIsToken that requires special handling: if newlines get their - // own token, then we DON'T want to trim the *newline* tokens down to empty - // strings, since this would cause us to treat whitespace-only line content - // as equal to a separator between lines, which would be weird and - // inconsistent with the documented behavior of the options.) - if (options.ignoreWhitespace) { - if (!options.newlineIsToken || !left.includes('\n')) { - left = left.trim(); - } - if (!options.newlineIsToken || !right.includes('\n')) { - right = right.trim(); - } - } - else if (options.ignoreNewlineAtEof && !options.newlineIsToken) { - if (left.endsWith('\n')) { - left = left.slice(0, -1); - } - if (right.endsWith('\n')) { - right = right.slice(0, -1); - } - } - return super.equals(left, right, options); - } -} -export const lineDiff = new LineDiff(); -export function diffLines(oldStr, newStr, options) { - return lineDiff.diff(oldStr, newStr, options); -} -export function diffTrimmedLines(oldStr, newStr, options) { - options = generateOptions(options, { ignoreWhitespace: true }); - return lineDiff.diff(oldStr, newStr, options); -} -// Exported standalone so it can be used from jsonDiff too. -export function tokenize(value, options) { - if (options.stripTrailingCr) { - // remove one \r before \n to match GNU diff's --strip-trailing-cr behavior - value = value.replace(/\r\n/g, '\n'); - } - const retLines = [], linesAndNewlines = value.split(/(\n|\r\n)/); - // Ignore the final empty token that occurs if the string ends with a new line - if (!linesAndNewlines[linesAndNewlines.length - 1]) { - linesAndNewlines.pop(); - } - // Merge the content and line separators into single tokens - for (let i = 0; i < linesAndNewlines.length; i++) { - const line = linesAndNewlines[i]; - if (i % 2 && !options.newlineIsToken) { - retLines[retLines.length - 1] += line; - } - else { - retLines.push(line); - } - } - return retLines; -} diff --git a/.output/server/node_modules/diff/libesm/diff/sentence.js b/.output/server/node_modules/diff/libesm/diff/sentence.js deleted file mode 100644 index db37010..0000000 --- a/.output/server/node_modules/diff/libesm/diff/sentence.js +++ /dev/null @@ -1,43 +0,0 @@ -import Diff from './base.js'; -function isSentenceEndPunct(char) { - return char == '.' || char == '!' || char == '?'; -} -class SentenceDiff extends Diff { - tokenize(value) { - var _a; - // If in future we drop support for environments that don't support lookbehinds, we can replace - // this entire function with: - // return value.split(/(?<=[.!?])(\s+|$)/); - // but until then, for similar reasons to the trailingWs function in string.ts, we are forced - // to do this verbosely "by hand" instead of using a regex. - const result = []; - let tokenStartI = 0; - for (let i = 0; i < value.length; i++) { - if (i == value.length - 1) { - result.push(value.slice(tokenStartI)); - break; - } - if (isSentenceEndPunct(value[i]) && value[i + 1].match(/\s/)) { - // We've hit a sentence break - i.e. a punctuation mark followed by whitespace. - // We now want to push TWO tokens to the result: - // 1. the sentence - result.push(value.slice(tokenStartI, i + 1)); - // 2. the whitespace - i = tokenStartI = i + 1; - while ((_a = value[i + 1]) === null || _a === void 0 ? void 0 : _a.match(/\s/)) { - i++; - } - result.push(value.slice(tokenStartI, i + 1)); - // Then the next token (a sentence) starts on the character after the whitespace. - // (It's okay if this is off the end of the string - then the outer loop will terminate - // here anyway.) - tokenStartI = i + 1; - } - } - return result; - } -} -export const sentenceDiff = new SentenceDiff(); -export function diffSentences(oldStr, newStr, options) { - return sentenceDiff.diff(oldStr, newStr, options); -} diff --git a/.output/server/node_modules/diff/libesm/diff/word.js b/.output/server/node_modules/diff/libesm/diff/word.js deleted file mode 100644 index 284231e..0000000 --- a/.output/server/node_modules/diff/libesm/diff/word.js +++ /dev/null @@ -1,281 +0,0 @@ -import Diff from './base.js'; -import { longestCommonPrefix, longestCommonSuffix, replacePrefix, replaceSuffix, removePrefix, removeSuffix, maximumOverlap, leadingWs, trailingWs, leadingAndTrailingWs, segment } from '../util/string.js'; -// Based on https://en.wikipedia.org/wiki/Latin_script_in_Unicode -// -// Chars/ranges counted as "word" characters by this regex are as follows: -// -// + U+00AD Soft hyphen -// + 00C0–00FF (letters with diacritics from the Latin-1 Supplement), except: -// - U+00D7 × Multiplication sign -// - U+00F7 ÷ Division sign -// + Latin Extended-A, 0100–017F -// + Latin Extended-B, 0180–024F -// + IPA Extensions, 0250–02AF -// + Spacing Modifier Letters, 02B0–02FF, except: -// - U+02C7 ˇ ˇ Caron -// - U+02D8 ˘ ˘ Breve -// - U+02D9 ˙ ˙ Dot Above -// - U+02DA ˚ ˚ Ring Above -// - U+02DB ˛ ˛ Ogonek -// - U+02DC ˜ ˜ Small Tilde -// - U+02DD ˝ ˝ Double Acute Accent -// + Latin Extended Additional, 1E00–1EFF -const extendedWordChars = 'a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}'; -// Each token is one of the following: -// - A punctuation mark plus the surrounding whitespace -// - A word plus the surrounding whitespace -// - Pure whitespace (but only in the special case where the entire text -// is just whitespace) -// -// We have to include surrounding whitespace in the tokens because the two -// alternative approaches produce horribly broken results: -// * If we just discard the whitespace, we can't fully reproduce the original -// text from the sequence of tokens and any attempt to render the diff will -// get the whitespace wrong. -// * If we have separate tokens for whitespace, then in a typical text every -// second token will be a single space character. But this often results in -// the optimal diff between two texts being a perverse one that preserves -// the spaces between words but deletes and reinserts actual common words. -// See https://github.com/kpdecker/jsdiff/issues/160#issuecomment-1866099640 -// for an example. -// -// Keeping the surrounding whitespace of course has implications for .equals -// and .join, not just .tokenize. -// This regex does NOT fully implement the tokenization rules described above. -// Instead, it gives runs of whitespace their own "token". The tokenize method -// then handles stitching whitespace tokens onto adjacent word or punctuation -// tokens. -const tokenizeIncludingWhitespace = new RegExp(`[${extendedWordChars}]+|\\s+|[^${extendedWordChars}]`, 'ug'); -class WordDiff extends Diff { - equals(left, right, options) { - if (options.ignoreCase) { - left = left.toLowerCase(); - right = right.toLowerCase(); - } - return left.trim() === right.trim(); - } - tokenize(value, options = {}) { - let parts; - if (options.intlSegmenter) { - const segmenter = options.intlSegmenter; - if (segmenter.resolvedOptions().granularity != 'word') { - throw new Error('The segmenter passed must have a granularity of "word"'); - } - // We want `parts` to be an array whose elements alternate between being - // pure whitespace and being pure non-whitespace. This is ALMOST what the - // segments returned by a word-based Intl.Segmenter already look like, - // but not quite - see explanation in the docs of our custom segment() - // function. - parts = segment(value, segmenter); - } - else { - parts = value.match(tokenizeIncludingWhitespace) || []; - } - const tokens = []; - let prevPart = null; - parts.forEach(part => { - if ((/\s/).test(part)) { - if (prevPart == null) { - tokens.push(part); - } - else { - tokens.push(tokens.pop() + part); - } - } - else if (prevPart != null && (/\s/).test(prevPart)) { - if (tokens[tokens.length - 1] == prevPart) { - tokens.push(tokens.pop() + part); - } - else { - tokens.push(prevPart + part); - } - } - else { - tokens.push(part); - } - prevPart = part; - }); - return tokens; - } - join(tokens) { - // Tokens being joined here will always have appeared consecutively in the - // same text, so we can simply strip off the leading whitespace from all the - // tokens except the first (and except any whitespace-only tokens - but such - // a token will always be the first and only token anyway) and then join them - // and the whitespace around words and punctuation will end up correct. - return tokens.map((token, i) => { - if (i == 0) { - return token; - } - else { - return token.replace((/^\s+/), ''); - } - }).join(''); - } - postProcess(changes, options) { - if (!changes || options.oneChangePerToken) { - return changes; - } - let lastKeep = null; - // Change objects representing any insertion or deletion since the last - // "keep" change object. There can be at most one of each. - let insertion = null; - let deletion = null; - changes.forEach(change => { - if (change.added) { - insertion = change; - } - else if (change.removed) { - deletion = change; - } - else { - if (insertion || deletion) { // May be false at start of text - dedupeWhitespaceInChangeObjects(lastKeep, deletion, insertion, change, options.intlSegmenter); - } - lastKeep = change; - insertion = null; - deletion = null; - } - }); - if (insertion || deletion) { - dedupeWhitespaceInChangeObjects(lastKeep, deletion, insertion, null, options.intlSegmenter); - } - return changes; - } -} -export const wordDiff = new WordDiff(); -export function diffWords(oldStr, newStr, options) { - // This option has never been documented and never will be (it's clearer to - // just call `diffWordsWithSpace` directly if you need that behavior), but - // has existed in jsdiff for a long time, so we retain support for it here - // for the sake of backwards compatibility. - if ((options === null || options === void 0 ? void 0 : options.ignoreWhitespace) != null && !options.ignoreWhitespace) { - return diffWordsWithSpace(oldStr, newStr, options); - } - return wordDiff.diff(oldStr, newStr, options); -} -function dedupeWhitespaceInChangeObjects(startKeep, deletion, insertion, endKeep, segmenter) { - // Before returning, we tidy up the leading and trailing whitespace of the - // change objects to eliminate cases where trailing whitespace in one object - // is repeated as leading whitespace in the next. - // Below are examples of the outcomes we want here to explain the code. - // I=insert, K=keep, D=delete - // 1. diffing 'foo bar baz' vs 'foo baz' - // Prior to cleanup, we have K:'foo ' D:' bar ' K:' baz' - // After cleanup, we want: K:'foo ' D:'bar ' K:'baz' - // - // 2. Diffing 'foo bar baz' vs 'foo qux baz' - // Prior to cleanup, we have K:'foo ' D:' bar ' I:' qux ' K:' baz' - // After cleanup, we want K:'foo ' D:'bar' I:'qux' K:' baz' - // - // 3. Diffing 'foo\nbar baz' vs 'foo baz' - // Prior to cleanup, we have K:'foo ' D:'\nbar ' K:' baz' - // After cleanup, we want K'foo' D:'\nbar' K:' baz' - // - // 4. Diffing 'foo baz' vs 'foo\nbar baz' - // Prior to cleanup, we have K:'foo\n' I:'\nbar ' K:' baz' - // After cleanup, we ideally want K'foo' I:'\nbar' K:' baz' - // but don't actually manage this currently (the pre-cleanup change - // objects don't contain enough information to make it possible). - // - // 5. Diffing 'foo bar baz' vs 'foo baz' - // Prior to cleanup, we have K:'foo ' D:' bar ' K:' baz' - // After cleanup, we want K:'foo ' D:' bar ' K:'baz' - // - // Our handling is unavoidably imperfect in the case where there's a single - // indel between keeps and the whitespace has changed. For instance, consider - // diffing 'foo\tbar\nbaz' vs 'foo baz'. Unless we create an extra change - // object to represent the insertion of the space character (which isn't even - // a token), we have no way to avoid losing information about the texts' - // original whitespace in the result we return. Still, we do our best to - // output something that will look sensible if we e.g. print it with - // insertions in green and deletions in red. - // Between two "keep" change objects (or before the first or after the last - // change object), we can have either: - // * A "delete" followed by an "insert" - // * Just an "insert" - // * Just a "delete" - // We handle the three cases separately. - if (deletion && insertion) { - const [oldWsPrefix, oldWsSuffix] = leadingAndTrailingWs(deletion.value, segmenter); - const [newWsPrefix, newWsSuffix] = leadingAndTrailingWs(insertion.value, segmenter); - if (startKeep) { - const commonWsPrefix = longestCommonPrefix(oldWsPrefix, newWsPrefix); - startKeep.value = replaceSuffix(startKeep.value, newWsPrefix, commonWsPrefix); - deletion.value = removePrefix(deletion.value, commonWsPrefix); - insertion.value = removePrefix(insertion.value, commonWsPrefix); - } - if (endKeep) { - const commonWsSuffix = longestCommonSuffix(oldWsSuffix, newWsSuffix); - endKeep.value = replacePrefix(endKeep.value, newWsSuffix, commonWsSuffix); - deletion.value = removeSuffix(deletion.value, commonWsSuffix); - insertion.value = removeSuffix(insertion.value, commonWsSuffix); - } - } - else if (insertion) { - // The whitespaces all reflect what was in the new text rather than - // the old, so we essentially have no information about whitespace - // insertion or deletion. We just want to dedupe the whitespace. - // We do that by having each change object keep its trailing - // whitespace and deleting duplicate leading whitespace where - // present. - if (startKeep) { - const ws = leadingWs(insertion.value, segmenter); - insertion.value = insertion.value.substring(ws.length); - } - if (endKeep) { - const ws = leadingWs(endKeep.value, segmenter); - endKeep.value = endKeep.value.substring(ws.length); - } - // otherwise we've got a deletion and no insertion - } - else if (startKeep && endKeep) { - const newWsFull = leadingWs(endKeep.value, segmenter), [delWsStart, delWsEnd] = leadingAndTrailingWs(deletion.value, segmenter); - // Any whitespace that comes straight after startKeep in both the old and - // new texts, assign to startKeep and remove from the deletion. - const newWsStart = longestCommonPrefix(newWsFull, delWsStart); - deletion.value = removePrefix(deletion.value, newWsStart); - // Any whitespace that comes straight before endKeep in both the old and - // new texts, and hasn't already been assigned to startKeep, assign to - // endKeep and remove from the deletion. - const newWsEnd = longestCommonSuffix(removePrefix(newWsFull, newWsStart), delWsEnd); - deletion.value = removeSuffix(deletion.value, newWsEnd); - endKeep.value = replacePrefix(endKeep.value, newWsFull, newWsEnd); - // If there's any whitespace from the new text that HASN'T already been - // assigned, assign it to the start: - startKeep.value = replaceSuffix(startKeep.value, newWsFull, newWsFull.slice(0, newWsFull.length - newWsEnd.length)); - } - else if (endKeep) { - // We are at the start of the text. Preserve all the whitespace on - // endKeep, and just remove whitespace from the end of deletion to the - // extent that it overlaps with the start of endKeep. - const endKeepWsPrefix = leadingWs(endKeep.value, segmenter); - const deletionWsSuffix = trailingWs(deletion.value, segmenter); - const overlap = maximumOverlap(deletionWsSuffix, endKeepWsPrefix); - deletion.value = removeSuffix(deletion.value, overlap); - } - else if (startKeep) { - // We are at the END of the text. Preserve all the whitespace on - // startKeep, and just remove whitespace from the start of deletion to - // the extent that it overlaps with the end of startKeep. - const startKeepWsSuffix = trailingWs(startKeep.value, segmenter); - const deletionWsPrefix = leadingWs(deletion.value, segmenter); - const overlap = maximumOverlap(startKeepWsSuffix, deletionWsPrefix); - deletion.value = removePrefix(deletion.value, overlap); - } -} -class WordsWithSpaceDiff extends Diff { - tokenize(value) { - // Slightly different to the tokenizeIncludingWhitespace regex used above in - // that this one treats each individual newline as a distinct token, rather - // than merging them into other surrounding whitespace. This was requested - // in https://github.com/kpdecker/jsdiff/issues/180 & - // https://github.com/kpdecker/jsdiff/issues/211 - const regex = new RegExp(`(\\r?\\n)|[${extendedWordChars}]+|[^\\S\\n\\r]+|[^${extendedWordChars}]`, 'ug'); - return value.match(regex) || []; - } -} -export const wordsWithSpaceDiff = new WordsWithSpaceDiff(); -export function diffWordsWithSpace(oldStr, newStr, options) { - return wordsWithSpaceDiff.diff(oldStr, newStr, options); -} diff --git a/.output/server/node_modules/diff/libesm/index.js b/.output/server/node_modules/diff/libesm/index.js deleted file mode 100644 index 18a495a..0000000 --- a/.output/server/node_modules/diff/libesm/index.js +++ /dev/null @@ -1,30 +0,0 @@ -/* See LICENSE file for terms of use */ -/* - * Text diff implementation. - * - * This library supports the following APIs: - * Diff.diffChars: Character by character diff - * Diff.diffWords: Word (as defined by \b regex) diff which ignores whitespace - * Diff.diffLines: Line based diff - * - * Diff.diffCss: Diff targeted at CSS content - * - * These methods are based on the implementation proposed in - * "An O(ND) Difference Algorithm and its Variations" (Myers, 1986). - * http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.4.6927 - */ -import Diff from './diff/base.js'; -import { diffChars, characterDiff } from './diff/character.js'; -import { diffWords, diffWordsWithSpace, wordDiff, wordsWithSpaceDiff } from './diff/word.js'; -import { diffLines, diffTrimmedLines, lineDiff } from './diff/line.js'; -import { diffSentences, sentenceDiff } from './diff/sentence.js'; -import { diffCss, cssDiff } from './diff/css.js'; -import { diffJson, canonicalize, jsonDiff } from './diff/json.js'; -import { diffArrays, arrayDiff } from './diff/array.js'; -import { applyPatch, applyPatches } from './patch/apply.js'; -import { parsePatch } from './patch/parse.js'; -import { reversePatch } from './patch/reverse.js'; -import { structuredPatch, createTwoFilesPatch, createPatch, formatPatch, INCLUDE_HEADERS, FILE_HEADERS_ONLY, OMIT_HEADERS } from './patch/create.js'; -import { convertChangesToDMP } from './convert/dmp.js'; -import { convertChangesToXML } from './convert/xml.js'; -export { Diff, diffChars, characterDiff, diffWords, wordDiff, diffWordsWithSpace, wordsWithSpaceDiff, diffLines, lineDiff, diffTrimmedLines, diffSentences, sentenceDiff, diffCss, cssDiff, diffJson, jsonDiff, diffArrays, arrayDiff, structuredPatch, createTwoFilesPatch, createPatch, formatPatch, INCLUDE_HEADERS, FILE_HEADERS_ONLY, OMIT_HEADERS, applyPatch, applyPatches, parsePatch, reversePatch, convertChangesToDMP, convertChangesToXML, canonicalize }; diff --git a/.output/server/node_modules/diff/libesm/package.json b/.output/server/node_modules/diff/libesm/package.json deleted file mode 100644 index 2bd6e50..0000000 --- a/.output/server/node_modules/diff/libesm/package.json +++ /dev/null @@ -1 +0,0 @@ -{"type":"module","sideEffects":false} \ No newline at end of file diff --git a/.output/server/node_modules/diff/libesm/patch/apply.js b/.output/server/node_modules/diff/libesm/patch/apply.js deleted file mode 100644 index fe2e8db..0000000 --- a/.output/server/node_modules/diff/libesm/patch/apply.js +++ /dev/null @@ -1,257 +0,0 @@ -import { hasOnlyWinLineEndings, hasOnlyUnixLineEndings } from '../util/string.js'; -import { isWin, isUnix, unixToWin, winToUnix } from './line-endings.js'; -import { parsePatch } from './parse.js'; -import distanceIterator from '../util/distance-iterator.js'; -/** - * attempts to apply a unified diff patch. - * - * Hunks are applied first to last. - * `applyPatch` first tries to apply the first hunk at the line number specified in the hunk header, and with all context lines matching exactly. - * If that fails, it tries scanning backwards and forwards, one line at a time, to find a place to apply the hunk where the context lines match exactly. - * If that still fails, and `fuzzFactor` is greater than zero, it increments the maximum number of mismatches (missing, extra, or changed context lines) that there can be between the hunk context and a region where we are trying to apply the patch such that the hunk will still be considered to match. - * Regardless of `fuzzFactor`, lines to be deleted in the hunk *must* be present for a hunk to match, and the context lines *immediately* before and after an insertion must match exactly. - * - * Once a hunk is successfully fitted, the process begins again with the next hunk. - * Regardless of `fuzzFactor`, later hunks must be applied later in the file than earlier hunks. - * - * If a hunk cannot be successfully fitted *anywhere* with fewer than `fuzzFactor` mismatches, `applyPatch` fails and returns `false`. - * - * If a hunk is successfully fitted but not at the line number specified by the hunk header, all subsequent hunks have their target line number adjusted accordingly. - * (e.g. if the first hunk is applied 10 lines below where the hunk header said it should fit, `applyPatch` will *start* looking for somewhere to apply the second hunk 10 lines below where its hunk header says it goes.) - * - * If the patch was applied successfully, returns a string containing the patched text. - * If the patch could not be applied (because some hunks in the patch couldn't be fitted to the text in `source`), `applyPatch` returns false. - * - * @param patch a string diff or the output from the `parsePatch` or `structuredPatch` methods. - */ -export function applyPatch(source, patch, options = {}) { - let patches; - if (typeof patch === 'string') { - patches = parsePatch(patch); - } - else if (Array.isArray(patch)) { - patches = patch; - } - else { - patches = [patch]; - } - if (patches.length > 1) { - throw new Error('applyPatch only works with a single input.'); - } - return applyStructuredPatch(source, patches[0], options); -} -function applyStructuredPatch(source, patch, options = {}) { - if (options.autoConvertLineEndings || options.autoConvertLineEndings == null) { - if (hasOnlyWinLineEndings(source) && isUnix(patch)) { - patch = unixToWin(patch); - } - else if (hasOnlyUnixLineEndings(source) && isWin(patch)) { - patch = winToUnix(patch); - } - } - // Apply the diff to the input - const lines = source.split('\n'), hunks = patch.hunks, compareLine = options.compareLine || ((lineNumber, line, operation, patchContent) => line === patchContent), fuzzFactor = options.fuzzFactor || 0; - let minLine = 0; - if (fuzzFactor < 0 || !Number.isInteger(fuzzFactor)) { - throw new Error('fuzzFactor must be a non-negative integer'); - } - // Special case for empty patch. - if (!hunks.length) { - return source; - } - // Before anything else, handle EOFNL insertion/removal. If the patch tells us to make a change - // to the EOFNL that is redundant/impossible - i.e. to remove a newline that's not there, or add a - // newline that already exists - then we either return false and fail to apply the patch (if - // fuzzFactor is 0) or simply ignore the problem and do nothing (if fuzzFactor is >0). - // If we do need to remove/add a newline at EOF, this will always be in the final hunk: - let prevLine = '', removeEOFNL = false, addEOFNL = false; - for (let i = 0; i < hunks[hunks.length - 1].lines.length; i++) { - const line = hunks[hunks.length - 1].lines[i]; - if (line[0] == '\\') { - if (prevLine[0] == '+') { - removeEOFNL = true; - } - else if (prevLine[0] == '-') { - addEOFNL = true; - } - } - prevLine = line; - } - if (removeEOFNL) { - if (addEOFNL) { - // This means the final line gets changed but doesn't have a trailing newline in either the - // original or patched version. In that case, we do nothing if fuzzFactor > 0, and if - // fuzzFactor is 0, we simply validate that the source file has no trailing newline. - if (!fuzzFactor && lines[lines.length - 1] == '') { - return false; - } - } - else if (lines[lines.length - 1] == '') { - lines.pop(); - } - else if (!fuzzFactor) { - return false; - } - } - else if (addEOFNL) { - if (lines[lines.length - 1] != '') { - lines.push(''); - } - else if (!fuzzFactor) { - return false; - } - } - /** - * Checks if the hunk can be made to fit at the provided location with at most `maxErrors` - * insertions, substitutions, or deletions, while ensuring also that: - * - lines deleted in the hunk match exactly, and - * - wherever an insertion operation or block of insertion operations appears in the hunk, the - * immediately preceding and following lines of context match exactly - * - * `toPos` should be set such that lines[toPos] is meant to match hunkLines[0]. - * - * If the hunk can be applied, returns an object with properties `oldLineLastI` and - * `replacementLines`. Otherwise, returns null. - */ - function applyHunk(hunkLines, toPos, maxErrors, hunkLinesI = 0, lastContextLineMatched = true, patchedLines = [], patchedLinesLength = 0) { - let nConsecutiveOldContextLines = 0; - let nextContextLineMustMatch = false; - for (; hunkLinesI < hunkLines.length; hunkLinesI++) { - const hunkLine = hunkLines[hunkLinesI], operation = (hunkLine.length > 0 ? hunkLine[0] : ' '), content = (hunkLine.length > 0 ? hunkLine.substr(1) : hunkLine); - if (operation === '-') { - if (compareLine(toPos + 1, lines[toPos], operation, content)) { - toPos++; - nConsecutiveOldContextLines = 0; - } - else { - if (!maxErrors || lines[toPos] == null) { - return null; - } - patchedLines[patchedLinesLength] = lines[toPos]; - return applyHunk(hunkLines, toPos + 1, maxErrors - 1, hunkLinesI, false, patchedLines, patchedLinesLength + 1); - } - } - if (operation === '+') { - if (!lastContextLineMatched) { - return null; - } - patchedLines[patchedLinesLength] = content; - patchedLinesLength++; - nConsecutiveOldContextLines = 0; - nextContextLineMustMatch = true; - } - if (operation === ' ') { - nConsecutiveOldContextLines++; - patchedLines[patchedLinesLength] = lines[toPos]; - if (compareLine(toPos + 1, lines[toPos], operation, content)) { - patchedLinesLength++; - lastContextLineMatched = true; - nextContextLineMustMatch = false; - toPos++; - } - else { - if (nextContextLineMustMatch || !maxErrors) { - return null; - } - // Consider 3 possibilities in sequence: - // 1. lines contains a *substitution* not included in the patch context, or - // 2. lines contains an *insertion* not included in the patch context, or - // 3. lines contains a *deletion* not included in the patch context - // The first two options are of course only possible if the line from lines is non-null - - // i.e. only option 3 is possible if we've overrun the end of the old file. - return (lines[toPos] && (applyHunk(hunkLines, toPos + 1, maxErrors - 1, hunkLinesI + 1, false, patchedLines, patchedLinesLength + 1) || applyHunk(hunkLines, toPos + 1, maxErrors - 1, hunkLinesI, false, patchedLines, patchedLinesLength + 1)) || applyHunk(hunkLines, toPos, maxErrors - 1, hunkLinesI + 1, false, patchedLines, patchedLinesLength)); - } - } - } - // Before returning, trim any unmodified context lines off the end of patchedLines and reduce - // toPos (and thus oldLineLastI) accordingly. This allows later hunks to be applied to a region - // that starts in this hunk's trailing context. - patchedLinesLength -= nConsecutiveOldContextLines; - toPos -= nConsecutiveOldContextLines; - patchedLines.length = patchedLinesLength; - return { - patchedLines, - oldLineLastI: toPos - 1 - }; - } - const resultLines = []; - // Search best fit offsets for each hunk based on the previous ones - let prevHunkOffset = 0; - for (let i = 0; i < hunks.length; i++) { - const hunk = hunks[i]; - let hunkResult; - const maxLine = lines.length - hunk.oldLines + fuzzFactor; - let toPos; - for (let maxErrors = 0; maxErrors <= fuzzFactor; maxErrors++) { - toPos = hunk.oldStart + prevHunkOffset - 1; - const iterator = distanceIterator(toPos, minLine, maxLine); - for (; toPos !== undefined; toPos = iterator()) { - hunkResult = applyHunk(hunk.lines, toPos, maxErrors); - if (hunkResult) { - break; - } - } - if (hunkResult) { - break; - } - } - if (!hunkResult) { - return false; - } - // Copy everything from the end of where we applied the last hunk to the start of this hunk - for (let i = minLine; i < toPos; i++) { - resultLines.push(lines[i]); - } - // Add the lines produced by applying the hunk: - for (let i = 0; i < hunkResult.patchedLines.length; i++) { - const line = hunkResult.patchedLines[i]; - resultLines.push(line); - } - // Set lower text limit to end of the current hunk, so next ones don't try - // to fit over already patched text - minLine = hunkResult.oldLineLastI + 1; - // Note the offset between where the patch said the hunk should've applied and where we - // applied it, so we can adjust future hunks accordingly: - prevHunkOffset = toPos + 1 - hunk.oldStart; - } - // Copy over the rest of the lines from the old text - for (let i = minLine; i < lines.length; i++) { - resultLines.push(lines[i]); - } - return resultLines.join('\n'); -} -/** - * applies one or more patches. - * - * `patch` may be either an array of structured patch objects, or a string representing a patch in unified diff format (which may patch one or more files). - * - * This method will iterate over the contents of the patch and apply to data provided through callbacks. The general flow for each patch index is: - * - * - `options.loadFile(index, callback)` is called. The caller should then load the contents of the file and then pass that to the `callback(err, data)` callback. Passing an `err` will terminate further patch execution. - * - `options.patched(index, content, callback)` is called once the patch has been applied. `content` will be the return value from `applyPatch`. When it's ready, the caller should call `callback(err)` callback. Passing an `err` will terminate further patch execution. - * - * Once all patches have been applied or an error occurs, the `options.complete(err)` callback is made. - */ -export function applyPatches(uniDiff, options) { - const spDiff = typeof uniDiff === 'string' ? parsePatch(uniDiff) : uniDiff; - let currentIndex = 0; - function processIndex() { - const index = spDiff[currentIndex++]; - if (!index) { - return options.complete(); - } - options.loadFile(index, function (err, data) { - if (err) { - return options.complete(err); - } - const updatedContent = applyPatch(data, index, options); - options.patched(index, updatedContent, function (err) { - if (err) { - return options.complete(err); - } - processIndex(); - }); - }); - } - processIndex(); -} diff --git a/.output/server/node_modules/diff/libesm/patch/create.js b/.output/server/node_modules/diff/libesm/patch/create.js deleted file mode 100644 index 73ba296..0000000 --- a/.output/server/node_modules/diff/libesm/patch/create.js +++ /dev/null @@ -1,228 +0,0 @@ -import { diffLines } from '../diff/line.js'; -export const INCLUDE_HEADERS = { - includeIndex: true, - includeUnderline: true, - includeFileHeaders: true -}; -export const FILE_HEADERS_ONLY = { - includeIndex: false, - includeUnderline: false, - includeFileHeaders: true -}; -export const OMIT_HEADERS = { - includeIndex: false, - includeUnderline: false, - includeFileHeaders: false -}; -export function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) { - let optionsObj; - if (!options) { - optionsObj = {}; - } - else if (typeof options === 'function') { - optionsObj = { callback: options }; - } - else { - optionsObj = options; - } - if (typeof optionsObj.context === 'undefined') { - optionsObj.context = 4; - } - // We copy this into its own variable to placate TypeScript, which thinks - // optionsObj.context might be undefined in the callbacks below. - const context = optionsObj.context; - // @ts-expect-error (runtime check for something that is correctly a static type error) - if (optionsObj.newlineIsToken) { - throw new Error('newlineIsToken may not be used with patch-generation functions, only with diffing functions'); - } - if (!optionsObj.callback) { - return diffLinesResultToPatch(diffLines(oldStr, newStr, optionsObj)); - } - else { - const { callback } = optionsObj; - diffLines(oldStr, newStr, Object.assign(Object.assign({}, optionsObj), { callback: (diff) => { - const patch = diffLinesResultToPatch(diff); - // TypeScript is unhappy without the cast because it does not understand that `patch` may - // be undefined here only if `callback` is StructuredPatchCallbackAbortable: - callback(patch); - } })); - } - function diffLinesResultToPatch(diff) { - // STEP 1: Build up the patch with no "\ No newline at end of file" lines and with the arrays - // of lines containing trailing newline characters. We'll tidy up later... - if (!diff) { - return; - } - diff.push({ value: '', lines: [] }); // Append an empty value to make cleanup easier - function contextLines(lines) { - return lines.map(function (entry) { return ' ' + entry; }); - } - const hunks = []; - let oldRangeStart = 0, newRangeStart = 0, curRange = [], oldLine = 1, newLine = 1; - for (let i = 0; i < diff.length; i++) { - const current = diff[i], lines = current.lines || splitLines(current.value); - current.lines = lines; - if (current.added || current.removed) { - // If we have previous context, start with that - if (!oldRangeStart) { - const prev = diff[i - 1]; - oldRangeStart = oldLine; - newRangeStart = newLine; - if (prev) { - curRange = context > 0 ? contextLines(prev.lines.slice(-context)) : []; - oldRangeStart -= curRange.length; - newRangeStart -= curRange.length; - } - } - // Output our changes - for (const line of lines) { - curRange.push((current.added ? '+' : '-') + line); - } - // Track the updated file position - if (current.added) { - newLine += lines.length; - } - else { - oldLine += lines.length; - } - } - else { - // Identical context lines. Track line changes - if (oldRangeStart) { - // Close out any changes that have been output (or join overlapping) - if (lines.length <= context * 2 && i < diff.length - 2) { - // Overlapping - for (const line of contextLines(lines)) { - curRange.push(line); - } - } - else { - // end the range and output - const contextSize = Math.min(lines.length, context); - for (const line of contextLines(lines.slice(0, contextSize))) { - curRange.push(line); - } - const hunk = { - oldStart: oldRangeStart, - oldLines: (oldLine - oldRangeStart + contextSize), - newStart: newRangeStart, - newLines: (newLine - newRangeStart + contextSize), - lines: curRange - }; - hunks.push(hunk); - oldRangeStart = 0; - newRangeStart = 0; - curRange = []; - } - } - oldLine += lines.length; - newLine += lines.length; - } - } - // Step 2: eliminate the trailing `\n` from each line of each hunk, and, where needed, add - // "\ No newline at end of file". - for (const hunk of hunks) { - for (let i = 0; i < hunk.lines.length; i++) { - if (hunk.lines[i].endsWith('\n')) { - hunk.lines[i] = hunk.lines[i].slice(0, -1); - } - else { - hunk.lines.splice(i + 1, 0, '\\ No newline at end of file'); - i++; // Skip the line we just added, then continue iterating - } - } - } - return { - oldFileName: oldFileName, newFileName: newFileName, - oldHeader: oldHeader, newHeader: newHeader, - hunks: hunks - }; - } -} -/** - * creates a unified diff patch. - * @param patch either a single structured patch object (as returned by `structuredPatch`) or an array of them (as returned by `parsePatch`) - */ -export function formatPatch(patch, headerOptions) { - if (!headerOptions) { - headerOptions = INCLUDE_HEADERS; - } - if (Array.isArray(patch)) { - if (patch.length > 1 && !headerOptions.includeFileHeaders) { - throw new Error('Cannot omit file headers on a multi-file patch. ' - + '(The result would be unparseable; how would a tool trying to apply ' - + 'the patch know which changes are to which file?)'); - } - return patch.map(p => formatPatch(p, headerOptions)).join('\n'); - } - const ret = []; - if (headerOptions.includeIndex && patch.oldFileName == patch.newFileName) { - ret.push('Index: ' + patch.oldFileName); - } - if (headerOptions.includeUnderline) { - ret.push('==================================================================='); - } - if (headerOptions.includeFileHeaders) { - ret.push('--- ' + patch.oldFileName + (typeof patch.oldHeader === 'undefined' ? '' : '\t' + patch.oldHeader)); - ret.push('+++ ' + patch.newFileName + (typeof patch.newHeader === 'undefined' ? '' : '\t' + patch.newHeader)); - } - for (let i = 0; i < patch.hunks.length; i++) { - const hunk = patch.hunks[i]; - // Unified Diff Format quirk: If the chunk size is 0, - // the first number is one lower than one would expect. - // https://www.artima.com/weblogs/viewpost.jsp?thread=164293 - if (hunk.oldLines === 0) { - hunk.oldStart -= 1; - } - if (hunk.newLines === 0) { - hunk.newStart -= 1; - } - ret.push('@@ -' + hunk.oldStart + ',' + hunk.oldLines - + ' +' + hunk.newStart + ',' + hunk.newLines - + ' @@'); - for (const line of hunk.lines) { - ret.push(line); - } - } - return ret.join('\n') + '\n'; -} -export function createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) { - if (typeof options === 'function') { - options = { callback: options }; - } - if (!(options === null || options === void 0 ? void 0 : options.callback)) { - const patchObj = structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options); - if (!patchObj) { - return; - } - return formatPatch(patchObj, options === null || options === void 0 ? void 0 : options.headerOptions); - } - else { - const { callback } = options; - structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, Object.assign(Object.assign({}, options), { callback: patchObj => { - if (!patchObj) { - callback(undefined); - } - else { - callback(formatPatch(patchObj, options.headerOptions)); - } - } })); - } -} -export function createPatch(fileName, oldStr, newStr, oldHeader, newHeader, options) { - return createTwoFilesPatch(fileName, fileName, oldStr, newStr, oldHeader, newHeader, options); -} -/** - * Split `text` into an array of lines, including the trailing newline character (where present) - */ -function splitLines(text) { - const hasTrailingNl = text.endsWith('\n'); - const result = text.split('\n').map(line => line + '\n'); - if (hasTrailingNl) { - result.pop(); - } - else { - result.push(result.pop().slice(0, -1)); - } - return result; -} diff --git a/.output/server/node_modules/diff/libesm/patch/line-endings.js b/.output/server/node_modules/diff/libesm/patch/line-endings.js deleted file mode 100644 index ab54b71..0000000 --- a/.output/server/node_modules/diff/libesm/patch/line-endings.js +++ /dev/null @@ -1,44 +0,0 @@ -export function unixToWin(patch) { - if (Array.isArray(patch)) { - // It would be cleaner if instead of the line below we could just write - // return patch.map(unixToWin) - // but mysteriously TypeScript (v5.7.3 at the time of writing) does not like this and it will - // refuse to compile, thinking that unixToWin could then return StructuredPatch[][] and the - // result would be incompatible with the overload signatures. - // See bug report at https://github.com/microsoft/TypeScript/issues/61398. - return patch.map(p => unixToWin(p)); - } - return Object.assign(Object.assign({}, patch), { hunks: patch.hunks.map(hunk => (Object.assign(Object.assign({}, hunk), { lines: hunk.lines.map((line, i) => { - var _a; - return (line.startsWith('\\') || line.endsWith('\r') || ((_a = hunk.lines[i + 1]) === null || _a === void 0 ? void 0 : _a.startsWith('\\'))) - ? line - : line + '\r'; - }) }))) }); -} -export function winToUnix(patch) { - if (Array.isArray(patch)) { - // (See comment above equivalent line in unixToWin) - return patch.map(p => winToUnix(p)); - } - return Object.assign(Object.assign({}, patch), { hunks: patch.hunks.map(hunk => (Object.assign(Object.assign({}, hunk), { lines: hunk.lines.map(line => line.endsWith('\r') ? line.substring(0, line.length - 1) : line) }))) }); -} -/** - * Returns true if the patch consistently uses Unix line endings (or only involves one line and has - * no line endings). - */ -export function isUnix(patch) { - if (!Array.isArray(patch)) { - patch = [patch]; - } - return !patch.some(index => index.hunks.some(hunk => hunk.lines.some(line => !line.startsWith('\\') && line.endsWith('\r')))); -} -/** - * Returns true if the patch uses Windows line endings and only Windows line endings. - */ -export function isWin(patch) { - if (!Array.isArray(patch)) { - patch = [patch]; - } - return patch.some(index => index.hunks.some(hunk => hunk.lines.some(line => line.endsWith('\r')))) - && patch.every(index => index.hunks.every(hunk => hunk.lines.every((line, i) => { var _a; return line.startsWith('\\') || line.endsWith('\r') || ((_a = hunk.lines[i + 1]) === null || _a === void 0 ? void 0 : _a.startsWith('\\')); }))); -} diff --git a/.output/server/node_modules/diff/libesm/patch/parse.js b/.output/server/node_modules/diff/libesm/patch/parse.js deleted file mode 100644 index 1dacac7..0000000 --- a/.output/server/node_modules/diff/libesm/patch/parse.js +++ /dev/null @@ -1,147 +0,0 @@ -/** - * Parses a patch into structured data, in the same structure returned by `structuredPatch`. - * - * @return a JSON object representation of the a patch, suitable for use with the `applyPatch` method. - */ -export function parsePatch(uniDiff) { - const diffstr = uniDiff.split(/\n/), list = []; - let i = 0; - function parseIndex() { - const index = {}; - list.push(index); - // Parse diff metadata - while (i < diffstr.length) { - const line = diffstr[i]; - // File header found, end parsing diff metadata - if ((/^(---|\+\+\+|@@)\s/).test(line)) { - break; - } - // Try to parse the line as a diff header, like - // Index: README.md - // or - // diff -r 9117c6561b0b -r 273ce12ad8f1 .hgignore - // or - // Index: something with multiple words - // and extract the filename (or whatever else is used as an index name) - // from the end (i.e. 'README.md', '.hgignore', or - // 'something with multiple words' in the examples above). - // - // TODO: It seems awkward that we indiscriminately trim off trailing - // whitespace here. Theoretically, couldn't that be meaningful - - // e.g. if the patch represents a diff of a file whose name ends - // with a space? Seems wrong to nuke it. - // But this behaviour has been around since v2.2.1 in 2015, so if - // it's going to change, it should be done cautiously and in a new - // major release, for backwards-compat reasons. - // -- ExplodingCabbage - const headerMatch = (/^(?:Index:|diff(?: -r \w+)+)\s+/).exec(line); - if (headerMatch) { - index.index = line.substring(headerMatch[0].length).trim(); - } - i++; - } - // Parse file headers if they are defined. Unified diff requires them, but - // there's no technical issues to have an isolated hunk without file header - parseFileHeader(index); - parseFileHeader(index); - // Parse hunks - index.hunks = []; - while (i < diffstr.length) { - const line = diffstr[i]; - if ((/^(Index:\s|diff\s|---\s|\+\+\+\s|===================================================================)/).test(line)) { - break; - } - else if ((/^@@/).test(line)) { - index.hunks.push(parseHunk()); - } - else if (line) { - throw new Error('Unknown line ' + (i + 1) + ' ' + JSON.stringify(line)); - } - else { - i++; - } - } - } - // Parses the --- and +++ headers, if none are found, no lines - // are consumed. - function parseFileHeader(index) { - const fileHeaderMatch = (/^(---|\+\+\+)\s+/).exec(diffstr[i]); - if (fileHeaderMatch) { - const prefix = fileHeaderMatch[1], data = diffstr[i].substring(3).trim().split('\t', 2), header = (data[1] || '').trim(); - let fileName = data[0].replace(/\\\\/g, '\\'); - if (fileName.startsWith('"') && fileName.endsWith('"')) { - fileName = fileName.substr(1, fileName.length - 2); - } - if (prefix === '---') { - index.oldFileName = fileName; - index.oldHeader = header; - } - else { - index.newFileName = fileName; - index.newHeader = header; - } - i++; - } - } - // Parses a hunk - // This assumes that we are at the start of a hunk. - function parseHunk() { - var _a; - const chunkHeaderIndex = i, chunkHeaderLine = diffstr[i++], chunkHeader = chunkHeaderLine.split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/); - const hunk = { - oldStart: +chunkHeader[1], - oldLines: typeof chunkHeader[2] === 'undefined' ? 1 : +chunkHeader[2], - newStart: +chunkHeader[3], - newLines: typeof chunkHeader[4] === 'undefined' ? 1 : +chunkHeader[4], - lines: [] - }; - // Unified Diff Format quirk: If the chunk size is 0, - // the first number is one lower than one would expect. - // https://www.artima.com/weblogs/viewpost.jsp?thread=164293 - if (hunk.oldLines === 0) { - hunk.oldStart += 1; - } - if (hunk.newLines === 0) { - hunk.newStart += 1; - } - let addCount = 0, removeCount = 0; - for (; i < diffstr.length && (removeCount < hunk.oldLines || addCount < hunk.newLines || ((_a = diffstr[i]) === null || _a === void 0 ? void 0 : _a.startsWith('\\'))); i++) { - const operation = (diffstr[i].length == 0 && i != (diffstr.length - 1)) ? ' ' : diffstr[i][0]; - if (operation === '+' || operation === '-' || operation === ' ' || operation === '\\') { - hunk.lines.push(diffstr[i]); - if (operation === '+') { - addCount++; - } - else if (operation === '-') { - removeCount++; - } - else if (operation === ' ') { - addCount++; - removeCount++; - } - } - else { - throw new Error(`Hunk at line ${chunkHeaderIndex + 1} contained invalid line ${diffstr[i]}`); - } - } - // Handle the empty block count case - if (!addCount && hunk.newLines === 1) { - hunk.newLines = 0; - } - if (!removeCount && hunk.oldLines === 1) { - hunk.oldLines = 0; - } - // Perform sanity checking - if (addCount !== hunk.newLines) { - throw new Error('Added line count did not match for hunk at line ' + (chunkHeaderIndex + 1)); - } - if (removeCount !== hunk.oldLines) { - throw new Error('Removed line count did not match for hunk at line ' + (chunkHeaderIndex + 1)); - } - return hunk; - } - while (i < diffstr.length) { - parseIndex(); - } - return list; -} diff --git a/.output/server/node_modules/diff/libesm/patch/reverse.js b/.output/server/node_modules/diff/libesm/patch/reverse.js deleted file mode 100644 index 9207b51..0000000 --- a/.output/server/node_modules/diff/libesm/patch/reverse.js +++ /dev/null @@ -1,23 +0,0 @@ -export function reversePatch(structuredPatch) { - if (Array.isArray(structuredPatch)) { - // (See comment in unixToWin for why we need the pointless-looking anonymous function here) - return structuredPatch.map(patch => reversePatch(patch)).reverse(); - } - return Object.assign(Object.assign({}, structuredPatch), { oldFileName: structuredPatch.newFileName, oldHeader: structuredPatch.newHeader, newFileName: structuredPatch.oldFileName, newHeader: structuredPatch.oldHeader, hunks: structuredPatch.hunks.map(hunk => { - return { - oldLines: hunk.newLines, - oldStart: hunk.newStart, - newLines: hunk.oldLines, - newStart: hunk.oldStart, - lines: hunk.lines.map(l => { - if (l.startsWith('-')) { - return `+${l.slice(1)}`; - } - if (l.startsWith('+')) { - return `-${l.slice(1)}`; - } - return l; - }) - }; - }) }); -} diff --git a/.output/server/node_modules/diff/libesm/util/distance-iterator.js b/.output/server/node_modules/diff/libesm/util/distance-iterator.js deleted file mode 100644 index afa6381..0000000 --- a/.output/server/node_modules/diff/libesm/util/distance-iterator.js +++ /dev/null @@ -1,37 +0,0 @@ -// Iterator that traverses in the range of [min, max], stepping -// by distance from a given start position. I.e. for [0, 4], with -// start of 2, this will iterate 2, 3, 1, 4, 0. -export default function (start, minLine, maxLine) { - let wantForward = true, backwardExhausted = false, forwardExhausted = false, localOffset = 1; - return function iterator() { - if (wantForward && !forwardExhausted) { - if (backwardExhausted) { - localOffset++; - } - else { - wantForward = false; - } - // Check if trying to fit beyond text length, and if not, check it fits - // after offset location (or desired location on first iteration) - if (start + localOffset <= maxLine) { - return start + localOffset; - } - forwardExhausted = true; - } - if (!backwardExhausted) { - if (!forwardExhausted) { - wantForward = true; - } - // Check if trying to fit before text beginning, and if not, check it fits - // before offset location - if (minLine <= start - localOffset) { - return start - localOffset++; - } - backwardExhausted = true; - return iterator(); - } - // We tried to fit hunk before text beginning and beyond text length, then - // hunk can't fit on the text. Return undefined - return undefined; - }; -} diff --git a/.output/server/node_modules/diff/libesm/util/params.js b/.output/server/node_modules/diff/libesm/util/params.js deleted file mode 100644 index c9921a2..0000000 --- a/.output/server/node_modules/diff/libesm/util/params.js +++ /dev/null @@ -1,14 +0,0 @@ -export function generateOptions(options, defaults) { - if (typeof options === 'function') { - defaults.callback = options; - } - else if (options) { - for (const name in options) { - /* istanbul ignore else */ - if (Object.prototype.hasOwnProperty.call(options, name)) { - defaults[name] = options[name]; - } - } - } - return defaults; -} diff --git a/.output/server/node_modules/diff/libesm/util/string.js b/.output/server/node_modules/diff/libesm/util/string.js deleted file mode 100644 index edb6d14..0000000 --- a/.output/server/node_modules/diff/libesm/util/string.js +++ /dev/null @@ -1,184 +0,0 @@ -export function longestCommonPrefix(str1, str2) { - let i; - for (i = 0; i < str1.length && i < str2.length; i++) { - if (str1[i] != str2[i]) { - return str1.slice(0, i); - } - } - return str1.slice(0, i); -} -export function longestCommonSuffix(str1, str2) { - let i; - // Unlike longestCommonPrefix, we need a special case to handle all scenarios - // where we return the empty string since str1.slice(-0) will return the - // entire string. - if (!str1 || !str2 || str1[str1.length - 1] != str2[str2.length - 1]) { - return ''; - } - for (i = 0; i < str1.length && i < str2.length; i++) { - if (str1[str1.length - (i + 1)] != str2[str2.length - (i + 1)]) { - return str1.slice(-i); - } - } - return str1.slice(-i); -} -export function replacePrefix(string, oldPrefix, newPrefix) { - if (string.slice(0, oldPrefix.length) != oldPrefix) { - throw Error(`string ${JSON.stringify(string)} doesn't start with prefix ${JSON.stringify(oldPrefix)}; this is a bug`); - } - return newPrefix + string.slice(oldPrefix.length); -} -export function replaceSuffix(string, oldSuffix, newSuffix) { - if (!oldSuffix) { - return string + newSuffix; - } - if (string.slice(-oldSuffix.length) != oldSuffix) { - throw Error(`string ${JSON.stringify(string)} doesn't end with suffix ${JSON.stringify(oldSuffix)}; this is a bug`); - } - return string.slice(0, -oldSuffix.length) + newSuffix; -} -export function removePrefix(string, oldPrefix) { - return replacePrefix(string, oldPrefix, ''); -} -export function removeSuffix(string, oldSuffix) { - return replaceSuffix(string, oldSuffix, ''); -} -export function maximumOverlap(string1, string2) { - return string2.slice(0, overlapCount(string1, string2)); -} -// Nicked from https://stackoverflow.com/a/60422853/1709587 -function overlapCount(a, b) { - // Deal with cases where the strings differ in length - let startA = 0; - if (a.length > b.length) { - startA = a.length - b.length; - } - let endB = b.length; - if (a.length < b.length) { - endB = a.length; - } - // Create a back-reference for each index - // that should be followed in case of a mismatch. - // We only need B to make these references: - const map = Array(endB); - let k = 0; // Index that lags behind j - map[0] = 0; - for (let j = 1; j < endB; j++) { - if (b[j] == b[k]) { - map[j] = map[k]; // skip over the same character (optional optimisation) - } - else { - map[j] = k; - } - while (k > 0 && b[j] != b[k]) { - k = map[k]; - } - if (b[j] == b[k]) { - k++; - } - } - // Phase 2: use these references while iterating over A - k = 0; - for (let i = startA; i < a.length; i++) { - while (k > 0 && a[i] != b[k]) { - k = map[k]; - } - if (a[i] == b[k]) { - k++; - } - } - return k; -} -/** - * Returns true if the string consistently uses Windows line endings. - */ -export function hasOnlyWinLineEndings(string) { - return string.includes('\r\n') && !string.startsWith('\n') && !string.match(/[^\r]\n/); -} -/** - * Returns true if the string consistently uses Unix line endings. - */ -export function hasOnlyUnixLineEndings(string) { - return !string.includes('\r\n') && string.includes('\n'); -} -/** - * Split a string into segments using a word segmenter, merging consecutive - * segments if they are both whitespace segments. Whitespace segments can - * appear adjacent to one another for two reasons: - * - newlines always get their own segment - * - where a diacritic is attached to a whitespace character in the text, the - * segment ends after the diacritic, so e.g. " \u0300 " becomes two segments. - * This function therefore runs the segmenter's .segment() method and then - * merges consecutive segments of whitespace into a single part. - */ -export function segment(string, segmenter) { - const parts = []; - for (const segmentObj of Array.from(segmenter.segment(string))) { - const segment = segmentObj.segment; - if (parts.length && (/\s/).test(parts[parts.length - 1]) && (/\s/).test(segment)) { - parts[parts.length - 1] += segment; - } - else { - parts.push(segment); - } - } - return parts; -} -// The functions below take a `segmenter` argument so that, when called from -// diffWords when it is using a segmenter, they can use a notion of what -// constitutes "whitespace" that is consistent with the segmenter. -// -// USUALLY this will be identical to the result of the non-segmenter-based -// logic, but it differs in at least one case: when whitespace characters are -// modified by diacritics. A word segmenter considers these diacritics to be -// part of the whitespace, whereas our non-segmenter-based logic does not. -// -// Because the segmenter-based approach necessarily requires segmenting the -// entire string, we offer a leadingAndTrailingWs function to allow getting the -// whitespace prefix AND whitespace suffix with a single call to the segmenter, -// for efficiency's sake. -export function trailingWs(string, segmenter) { - if (segmenter) { - return leadingAndTrailingWs(string, segmenter)[1]; - } - // Yes, this looks overcomplicated and dumb - why not replace the whole function with - // return string.match(/\s*$/)[0] - // you ask? Because: - // 1. the trap described at https://markamery.com/blog/quadratic-time-regexes/ would mean doing - // this would cause this function to take O(n²) time in the worst case (specifically when - // there is a massive run of NON-TRAILING whitespace in `string`), and - // 2. the fix proposed in the same blog post, of using a negative lookbehind, is incompatible - // with old Safari versions that we'd like to not break if possible (see - // https://github.com/kpdecker/jsdiff/pull/550) - // It feels absurd to do this with an explicit loop instead of a regex, but I really can't see a - // better way that doesn't result in broken behaviour. - let i; - for (i = string.length - 1; i >= 0; i--) { - if (!string[i].match(/\s/)) { - break; - } - } - return string.substring(i + 1); -} -export function leadingWs(string, segmenter) { - if (segmenter) { - return leadingAndTrailingWs(string, segmenter)[0]; - } - // Thankfully the annoying considerations described in trailingWs don't apply here: - const match = string.match(/^\s*/); - return match ? match[0] : ''; -} -export function leadingAndTrailingWs(string, segmenter) { - if (!segmenter) { - return [leadingWs(string), trailingWs(string)]; - } - if (segmenter.resolvedOptions().granularity != 'word') { - throw new Error('The segmenter passed must have a granularity of "word"'); - } - const segments = segment(string, segmenter); - const firstSeg = segments[0]; - const lastSeg = segments[segments.length - 1]; - const head = (/\s/).test(firstSeg) ? firstSeg : ''; - const tail = (/\s/).test(lastSeg) ? lastSeg : ''; - return [head, tail]; -} diff --git a/.output/server/node_modules/diff/package.json b/.output/server/node_modules/diff/package.json deleted file mode 100644 index 7d021f3..0000000 --- a/.output/server/node_modules/diff/package.json +++ /dev/null @@ -1,130 +0,0 @@ -{ - "name": "diff", - "version": "8.0.4", - "description": "A JavaScript text diff implementation.", - "keywords": [ - "diff", - "jsdiff", - "compare", - "patch", - "text", - "json", - "css", - "javascript" - ], - "maintainers": [ - "Kevin Decker (http://incaseofstairs.com)", - "Mark Amery " - ], - "bugs": { - "email": "kpdecker@gmail.com", - "url": "http://github.com/kpdecker/jsdiff/issues" - }, - "license": "BSD-3-Clause", - "repository": { - "type": "git", - "url": "https://github.com/kpdecker/jsdiff.git" - }, - "engines": { - "node": ">=0.3.1" - }, - "main": "./libcjs/index.js", - "module": "./libesm/index.js", - "browser": "./dist/diff.js", - "unpkg": "./dist/diff.js", - "exports": { - ".": { - "import": { - "types": "./libesm/index.d.ts", - "default": "./libesm/index.js" - }, - "require": { - "types": "./libcjs/index.d.ts", - "default": "./libcjs/index.js" - } - }, - "./package.json": "./package.json", - "./lib/*.js": { - "import": { - "types": "./libesm/*.d.ts", - "default": "./libesm/*.js" - }, - "require": { - "types": "./libcjs/*.d.ts", - "default": "./libcjs/*.js" - } - }, - "./lib/": { - "import": { - "types": "./libesm/", - "default": "./libesm/" - }, - "require": { - "types": "./libcjs/", - "default": "./libcjs/" - } - } - }, - "type": "module", - "types": "libcjs/index.d.ts", - "scripts": { - "clean": "rm -rf libcjs/ libesm/ dist/ coverage/ .nyc_output/", - "lint": "yarn eslint", - "build": "yarn lint && yarn generate-esm && yarn generate-cjs && yarn check-types && yarn run-rollup && yarn run-uglify", - "generate-cjs": "yarn tsc --module commonjs --outDir libcjs && node --eval \"fs.writeFileSync('libcjs/package.json', JSON.stringify({type:'commonjs',sideEffects:false}))\"", - "generate-esm": "yarn tsc --module nodenext --outDir libesm --target es6 && node --eval \"fs.writeFileSync('libesm/package.json', JSON.stringify({type:'module',sideEffects:false}))\"", - "check-types": "yarn run-tsd && yarn run-attw", - "test": "nyc yarn _test", - "_test": "yarn build && cross-env NODE_ENV=test yarn run-mocha", - "run-attw": "yarn attw --pack --entrypoints . && yarn attw --pack --entrypoints lib/diff/word.js --profile node16", - "run-tsd": "yarn tsd --typings libesm/ && yarn tsd --files test-d/", - "run-rollup": "rollup -c rollup.config.mjs", - "run-uglify": "uglifyjs dist/diff.js -c -o dist/diff.min.js", - "run-mocha": "mocha --require ./runtime 'test/**/*.js'" - }, - "devDependencies": { - "@arethetypeswrong/cli": "^0.18.2", - "@babel/core": "^7.29.0", - "@babel/preset-env": "^7.29.2", - "@babel/register": "^7.28.6", - "@colors/colors": "^1.6.0", - "@eslint/js": "^10.0.1", - "babel-loader": "^10.1.1", - "babel-plugin-istanbul": "^7.0.1", - "chai": "^6.2.2", - "cross-env": "^10.1.0", - "eslint": "^10.1.0", - "globals": "^17.4.0", - "karma": "^6.4.4", - "karma-mocha": "^2.0.1", - "karma-mocha-reporter": "^2.2.5", - "karma-sourcemap-loader": "^0.4.0", - "karma-webpack": "^5.0.1", - "mocha": "^11.7.5", - "nyc": "^18.0.0", - "rollup": "^4.60.0", - "tsd": "^0.33.0", - "typescript": "^5.9.3", - "typescript-eslint": "^8.57.1", - "uglify-js": "^3.19.3", - "webpack": "^5.105.4", - "webpack-dev-server": "^5.2.3" - }, - "nyc": { - "require": [ - "@babel/register" - ], - "reporter": [ - "lcov", - "text" - ], - "sourceMap": false, - "instrument": false, - "check-coverage": true, - "branches": 100, - "lines": 100, - "functions": 100, - "statements": 100 - }, - "packageManager": "yarn@4.12.0" -} \ No newline at end of file diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/alias-RTYYYW3D.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/alias-RTYYYW3D.js deleted file mode 100644 index a6738af..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/alias-RTYYYW3D.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b,c,d}from"./chunk-FHC24QSK.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{a as aliasCommand,c as flagsForFuzzing,b as unaliasCommand,d as unaliasFlagsForFuzzing}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/awk2-SREAOJRG.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/awk2-SREAOJRG.js deleted file mode 100644 index 7ca9dad..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/awk2-SREAOJRG.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-GRQJA2J7.js";import"./chunk-DLL7UR66.js";import"./chunk-KAPG5ONA.js";import"./chunk-VACKIICN.js";import"./chunk-7CSMHFIJ.js";import"./chunk-XEKXHOPO.js";import"./chunk-SAI2SPQQ.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{a as awkCommand2,b as flagsForFuzzing}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/base64-WIGL46P3.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/base64-WIGL46P3.js deleted file mode 100644 index e0b7887..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/base64-WIGL46P3.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-CN5XGDNN.js";import"./chunk-XEKXHOPO.js";import"./chunk-QIQMJJZ4.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{a as base64Command,b as flagsForFuzzing}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/basename-UB3CIYNI.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/basename-UB3CIYNI.js deleted file mode 100644 index d499d8c..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/basename-UB3CIYNI.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-ZDPFA4L3.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{a as basenameCommand,b as flagsForFuzzing}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/bash-F4KHPMTX.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/bash-F4KHPMTX.js deleted file mode 100644 index f609cc5..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/bash-F4KHPMTX.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b,c,d}from"./chunk-VBLMIJON.js";import"./chunk-DLL7UR66.js";import"./chunk-XEKXHOPO.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{a as bashCommand,c as flagsForFuzzing,b as shCommand,d as shFlagsForFuzzing}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/cat-LPZ6XNHG.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/cat-LPZ6XNHG.js deleted file mode 100644 index d602657..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/cat-LPZ6XNHG.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-MFRETFZB.js";import"./chunk-KTPCYKBB.js";import"./chunk-XEKXHOPO.js";import"./chunk-STHBFACM.js";import"./chunk-QIQMJJZ4.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{a as catCommand,b as flagsForFuzzing}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chmod-TFEPA42X.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chmod-TFEPA42X.js deleted file mode 100644 index a80a435..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chmod-TFEPA42X.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-WM5IJFMP.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{a as chmodCommand,b as flagsForFuzzing}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-27JIFWUR.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-27JIFWUR.js deleted file mode 100644 index 2ae880a..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-27JIFWUR.js +++ /dev/null @@ -1,3 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -function i(t,l,e){let c=t;e>=0&&c.length>e&&(c=c.slice(0,e));let n=Math.abs(l);return n>c.length&&(l<0?c=c.padEnd(n," "):c=c.padStart(n," ")),c}function h(t,l){let e=l,c=0,n=-1,a=!1;for(e0&&(c=-c),[c,n,e-l]}function r(t){let l="",e=0;for(;e0){try{let s=new TextDecoder("utf-8",{fatal:!0});l+=s.decode(new Uint8Array(n))}catch{for(let s of n)l+=String.fromCharCode(s)}e=a}else l+=t[e],e++;break}case"u":{let n="",a=e+2;for(;a=r.length)return{stdout:"",stderr:`time: missing argument to '-f' -`,exitCode:1};a=r[t],t++}else if(e==="-o"||e==="--output"){if(t++,t>=r.length)return{stdout:"",stderr:`time: missing argument to '-o' -`,exitCode:1};o=r[t],t++}else if(e==="-a"||e==="--append")u=!0,t++;else if(e==="-v"||e==="--verbose")a=`Command being timed: %C -Elapsed (wall clock) time: %e seconds -Maximum resident set size (kbytes): %M`,t++;else if(e==="-p"||e==="--portability")c=!0,t++;else if(e==="--"){t++;break}else if(e.startsWith("-"))t++;else break}let l=r.slice(t);if(l.length===0)return{stdout:"",stderr:"",exitCode:0};let w=p(),C=l.join(" "),i;try{if(!s.exec)return{stdout:"",stderr:`time: exec not available -`,exitCode:1};i=await s.exec(g([l[0]]),{env:h(s.env),cwd:s.cwd,stdin:s.stdin,stdinKind:"bytes",signal:s.signal,args:l.slice(1)})}catch(e){i={stdout:"",stderr:`time: ${f(e.message)} -`,exitCode:127}}let m=(p()-w)/1e3,n;if(c?n=`real ${m.toFixed(2)} -user 0.00 -sys 0.00 -`:(n=a.replace(/%e/g,m.toFixed(2)).replace(/%E/g,F(m)).replace(/%M/g,"0").replace(/%S/g,"0.00").replace(/%U/g,"0.00").replace(/%P/g,"0%").replace(/%C/g,C),n.endsWith(` -`)||(n+=` -`)),o)try{let e=s.fs.resolvePath(s.cwd,o);if(u&&await s.fs.exists(e)){let d=await s.fs.readFile(e);await s.fs.writeFile(e,d+n)}else await s.fs.writeFile(e,n)}catch(e){let d=f(e.message);return{stdout:i.stdout,stderr:i.stderr+`time: cannot write to '${o}': ${d} -`,exitCode:i.exitCode}}else i={...i,stderr:i.stderr+n};return i}};function F(r){let s=Math.floor(r/3600),a=Math.floor(r%3600/60),o=r%60;return s>0?`${s}:${a.toString().padStart(2,"0")}:${o.toFixed(2).padStart(5,"0")}`:`${a}:${o.toFixed(2).padStart(5,"0")}`}var k={name:"time",flags:[{flag:"-p",type:"boolean"}],needsArgs:!0};export{T as a,k as b}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-2VJJEDV2.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-2VJJEDV2.js deleted file mode 100644 index 5a0e899..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-2VJJEDV2.js +++ /dev/null @@ -1,8 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a as b}from"./chunk-QIQMJJZ4.js";import{a as $,b as F}from"./chunk-QAYAQNCG.js";var x={name:"du",summary:"estimate file space usage",usage:"du [OPTION]... [FILE]...",options:["-a write counts for all files, not just directories","-h print sizes in human readable format","-s display only a total for each argument","-c produce a grand total","--max-depth=N print total for directory only if N or fewer levels deep"," --help display this help and exit"]},R={allFiles:{short:"a",type:"boolean"},humanReadable:{short:"h",type:"boolean"},summarize:{short:"s",type:"boolean"},grandTotal:{short:"c",type:"boolean"},maxDepth:{long:"max-depth",type:"number"}},_={name:"du",async execute(a,s){if(F(a))return $(x);let n=b("du",a,R);if(!n.ok)return n.error;let r={allFiles:n.result.flags.allFiles,humanReadable:n.result.flags.humanReadable,summarize:n.result.flags.summarize,grandTotal:n.result.flags.grandTotal,maxDepth:n.result.flags.maxDepth??null},l=n.result.positional;l.length===0&&l.push(".");let o="",m="",p=0;for(let u of l){let z=s.fs.resolvePath(s.cwd,u);try{await s.fs.stat(z);let h=await w(s,z,u,r,0);o+=h.output,p+=h.totalSize,m+=h.stderr}catch{m+=`du: cannot access '${u}': No such file or directory -`}}return r.grandTotal&&l.length>0&&(o+=`${D(p,r.humanReadable)} total -`),{stdout:o,stderr:m,exitCode:m?1:0}}},E=1e3;async function w(a,s,n,r,l){let o={output:"",totalSize:0,stderr:""};if(l>E)return o;try{let m=await a.fs.stat(s);if(!m.isDirectory)return o.totalSize=m.size,(r.allFiles||l===0)&&(o.output=D(m.size,r.humanReadable)+" "+n+` -`),o;let p=0,u=[];if(a.fs.readdirWithFileTypes){let t=await a.fs.readdirWithFileTypes(s),i=t.filter(e=>e.isFile),f=t.filter(e=>e.isDirectory);for(let e=0;e{let T=s==="/"?`/${d.name}`:`${s}/${d.name}`;try{let S=await a.fs.stat(T);return{name:d.name,isDirectory:!1,size:S.size}}catch{return{name:d.name,isDirectory:!1,size:0}}}));u.push(...y)}u.push(...f.map(e=>({name:e.name,isDirectory:!0})))}else{let t=await a.fs.readdir(s);for(let i=0;i{let y=s==="/"?`/${c}`:`${s}/${c}`;try{let d=await a.fs.stat(y);return{name:c,isDirectory:d.isDirectory,size:d.isDirectory?void 0:d.size}}catch{return{name:c,isDirectory:!1,size:0}}}));u.push(...e)}}u.sort((t,i)=>t.name.localeCompare(i.name));let z=u.filter(t=>!t.isDirectory);for(let t of z){let i=t.size??0;if(p+=i,r.allFiles&&!r.summarize){let f=n==="."?t.name:`${n}/${t.name}`;o.output+=D(i,r.humanReadable)+" "+f+` -`}}let h=u.filter(t=>t.isDirectory);for(let t=0;t{let c=s==="/"?`/${e.name}`:`${s}/${e.name}`,y=n==="."?e.name:`${n}/${e.name}`;return{name:e.name,result:await w(a,c,y,r,l+1)}}));f.sort((e,c)=>e.name.localeCompare(c.name));for(let{result:e}of f)p+=e.totalSize,r.summarize||(r.maxDepth===null||l+1<=r.maxDepth)&&(o.output+=e.output)}o.totalSize=p,(r.summarize||r.maxDepth===null||l<=r.maxDepth)&&(o.output+=`${D(p,r.humanReadable)} ${n} -`)}catch{o.stderr=`du: cannot read directory '${n}': Permission denied -`}return o}function D(a,s){return s?a<1024?`${a}`:a<1024*1024?`${(a/1024).toFixed(1)}K`:a<1024*1024*1024?`${(a/(1024*1024)).toFixed(1)}M`:`${(a/(1024*1024*1024)).toFixed(1)}G`:String(Math.ceil(a/1024)||1)}var v={name:"du",flags:[{flag:"-a",type:"boolean"},{flag:"-h",type:"boolean"},{flag:"-s",type:"boolean"},{flag:"-c",type:"boolean"},{flag:"--max-depth",type:"value",valueHint:"number"}],needsFiles:!0};export{_ as a,v as b}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-4I3HOE5Z.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-4I3HOE5Z.js deleted file mode 100644 index edc6167..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-4I3HOE5Z.js +++ /dev/null @@ -1,21 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a as we,c as Oe}from"./chunk-BZUGFHVS.js";var xe=Oe((de,pe)=>{(function(oe,R){typeof define=="function"&&define.amd?define([],R):typeof pe=="object"&&typeof de<"u"?pe.exports=R():oe.Papa=R()})(de,function oe(){"use strict";var R=(function(){return typeof self<"u"?self:typeof window<"u"?window:typeof R<"u"?R:{}})();function _e(){var e=R.URL||R.webkitURL||null,t=oe.toString();return l.BLOB_URL||(l.BLOB_URL=e.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",t,")();"],{type:"text/javascript"})))}var Y=!R.document&&!!R.postMessage,ue=R.IS_PAPA_WORKER||!1,ae={},ge=0,l={};if(l.parse=Ce,l.unparse=Re,l.RECORD_SEP="",l.UNIT_SEP="",l.BYTE_ORDER_MARK="\uFEFF",l.BAD_DELIMITERS=["\r",` -`,'"',l.BYTE_ORDER_MARK],l.WORKERS_SUPPORTED=!Y&&!!R.Worker,l.NODE_STREAM_INPUT=1,l.LocalChunkSize=1024*1024*10,l.RemoteChunkSize=1024*1024*5,l.DefaultDelimiter=",",l.Parser=fe,l.ParserHandle=ce,l.NetworkStreamer=G,l.FileStreamer=ee,l.StringStreamer=Z,l.ReadableStreamStreamer=te,typeof PAPA_BROWSER_CONTEXT>"u"&&(l.DuplexStreamStreamer=re),R.jQuery){var V=R.jQuery;V.fn.parse=function(e){var t=e.config||{},r=[];return this.each(function(h){var i=V(this).prop("tagName").toUpperCase()==="INPUT"&&V(this).attr("type").toLowerCase()==="file"&&R.FileReader;if(!i||!this.files||this.files.length===0)return!0;for(var y=0;y"u")return n=new re(t),n.getStream();return typeof e=="string"?(e=p(e),t.download?n=new G(t):n=new Z(t)):e.readable===!0&&g(e.read)&&g(e.on)?n=new te(t):(R.File&&e instanceof File||e instanceof Object)&&(n=new ee(t)),n.stream(e);function p(h){return h.charCodeAt(0)===65279?h.slice(1):h}}function Re(e,t){var r=!1,s=!0,n=",",p=`\r -`,h='"',i=h+h,y=!1,E=null,O=!1;L();var d=new RegExp(se(h),"g");if(typeof e=="string"&&(e=JSON.parse(e)),Array.isArray(e)){if(!e.length||Array.isArray(e[0]))return u(null,e,y);if(typeof e[0]=="object")return u(E||Object.keys(e[0]),e,y)}else if(typeof e=="object")return typeof e.data=="string"&&(e.data=JSON.parse(e.data)),Array.isArray(e.data)&&(e.fields||(e.fields=e.meta&&e.meta.fields||E),e.fields||(e.fields=Array.isArray(e.data[0])?e.fields:typeof e.data[0]=="object"?Object.keys(e.data[0]):[]),!Array.isArray(e.data[0])&&typeof e.data[0]!="object"&&(e.data=[e.data])),u(e.fields||[],e.data||[],y);throw new Error("Unable to serialize unrecognized input");function L(){if(typeof t=="object"){if(typeof t.delimiter=="string"&&!l.BAD_DELIMITERS.filter(function(v){return t.delimiter.indexOf(v)!==-1}).length&&(n=t.delimiter),(typeof t.quotes=="boolean"||typeof t.quotes=="function"||Array.isArray(t.quotes))&&(r=t.quotes),(typeof t.skipEmptyLines=="boolean"||typeof t.skipEmptyLines=="string")&&(y=t.skipEmptyLines),typeof t.newline=="string"&&(p=t.newline),typeof t.quoteChar=="string"&&(h=t.quoteChar),typeof t.header=="boolean"&&(s=t.header),Array.isArray(t.columns)){if(t.columns.length===0)throw new Error("Option columns is empty");E=t.columns}t.escapeChar!==void 0&&(i=t.escapeChar+h),t.escapeFormulae instanceof RegExp?O=t.escapeFormulae:typeof t.escapeFormulae=="boolean"&&t.escapeFormulae&&(O=/^[=+\-@\t\r].*$/)}}function u(v,k,S){var w="";typeof v=="string"&&(v=JSON.parse(v)),typeof k=="string"&&(k=JSON.parse(k));var M=Array.isArray(v)&&v.length>0,T=!Array.isArray(k[0]);if(M&&s){for(var q=0;q0&&(w+=n),w+=c(v[q],q);k.length>0&&(w+=p)}for(var _=0;_0&&!o&&(w+=n);var C=M&&T?v[a]:a;w+=c(k[_][C],a)}_0&&!o)&&(w+=p)}}return w}function c(v,k){if(typeof v>"u"||v===null)return"";if(v.constructor===Date)return JSON.stringify(v).slice(1,25);var S=!1;O&&typeof v=="string"&&O.test(v)&&(v="'"+v,S=!0);var w=v.toString().replace(d,i);return S=S||r===!0||typeof r=="function"&&r(v,k)||Array.isArray(r)&&r[k]||Q(w,l.BAD_DELIMITERS)||w.indexOf(n)>-1||w.charAt(0)===" "||w.charAt(w.length-1)===" ",S?h+w+h:w}function Q(v,k){for(var S=0;S-1)return!0;return!1}}function z(e){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},t.call(this,e),this.parseChunk=function(r,s){let n=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&n>0){let O=this._config.newline;if(!O){let L=this._config.quoteChar||'"';O=this._handle.guessLineEndings(r,L)}r=[...r.split(O).slice(n)].join(O)}if(this.isFirstChunk&&g(this._config.beforeFirstChunk)){var p=this._config.beforeFirstChunk(r);p!==void 0&&(r=p)}this.isFirstChunk=!1,this._halted=!1;var h=this._partialLine+r;this._partialLine="";var i=this._handle.parse(h,this._baseIndex,!this._finished);if(this._handle.paused()||this._handle.aborted()){this._halted=!0;return}var y=i.meta.cursor;this._finished||(this._partialLine=h.substring(y-this._baseIndex),this._baseIndex=y),i&&i.data&&(this._rowCount+=i.data.length);var E=this._finished||this._config.preview&&this._rowCount>=this._config.preview;if(ue)R.postMessage({results:i,workerId:l.WORKER_ID,finished:E});else if(g(this._config.chunk)&&!s){if(this._config.chunk(i,this._handle),this._handle.paused()||this._handle.aborted()){this._halted=!0;return}i=void 0,this._completeResults=void 0}return!this._config.step&&!this._config.chunk&&(this._completeResults.data=this._completeResults.data.concat(i.data),this._completeResults.errors=this._completeResults.errors.concat(i.errors),this._completeResults.meta=i.meta),!this._completed&&E&&g(this._config.complete)&&(!i||!i.meta.aborted)&&(this._config.complete(this._completeResults,this._input),this._completed=!0),!E&&(!i||!i.meta.paused)&&this._nextChunk(),i},this._sendError=function(r){g(this._config.error)?this._config.error(r):ue&&this._config.error&&R.postMessage({workerId:l.WORKER_ID,error:r,finished:!1})};function t(r){var s=he(r);s.chunkSize=parseInt(s.chunkSize),!r.step&&!r.chunk&&(s.chunkSize=null),this._handle=new ce(s),this._handle.streamer=this,this._config=s}}function G(e){e=e||{},e.chunkSize||(e.chunkSize=l.RemoteChunkSize),z.call(this,e);var t;Y?this._nextChunk=function(){this._readChunk(),this._chunkLoaded()}:this._nextChunk=function(){this._readChunk()},this.stream=function(s){this._input=s,this._nextChunk()},this._readChunk=function(){if(this._finished){this._chunkLoaded();return}if(t=new XMLHttpRequest,this._config.withCredentials&&(t.withCredentials=this._config.withCredentials),Y||(t.onload=F(this._chunkLoaded,this),t.onerror=F(this._chunkError,this)),t.open(this._config.downloadRequestBody?"POST":"GET",this._input,!Y),this._config.downloadRequestHeaders){var s=this._config.downloadRequestHeaders;for(var n in s)t.setRequestHeader(n,s[n])}if(this._config.chunkSize){var p=this._start+this._config.chunkSize-1;t.setRequestHeader("Range","bytes="+this._start+"-"+p)}try{t.send(this._config.downloadRequestBody)}catch(h){this._chunkError(h.message)}Y&&t.status===0&&this._chunkError()},this._chunkLoaded=function(){if(t.readyState===4){if(t.status<200||t.status>=400){this._chunkError();return}this._start+=this._config.chunkSize?this._config.chunkSize:t.responseText.length,this._finished=!this._config.chunkSize||this._start>=r(t),this.parseChunk(t.responseText)}},this._chunkError=function(s){var n=t.statusText||s;this._sendError(new Error(n))};function r(s){var n=s.getResponseHeader("Content-Range");return n===null?-1:parseInt(n.substring(n.lastIndexOf("/")+1))}}G.prototype=Object.create(z.prototype),G.prototype.constructor=G;function ee(e){e=e||{},e.chunkSize||(e.chunkSize=l.LocalChunkSize),z.call(this,e);var t,r,s=typeof FileReader<"u";this.stream=function(n){this._input=n,r=n.slice||n.webkitSlice||n.mozSlice,s?(t=new FileReader,t.onload=F(this._chunkLoaded,this),t.onerror=F(this._chunkError,this)):t=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){!this._finished&&(!this._config.preview||this._rowCount=this._input.size,this.parseChunk(n.target.result)},this._chunkError=function(){this._sendError(t.error)}}ee.prototype=Object.create(z.prototype),ee.prototype.constructor=ee;function Z(e){e=e||{},z.call(this,e);var t;this.stream=function(r){return t=r,this._nextChunk()},this._nextChunk=function(){if(!this._finished){var r=this._config.chunkSize,s;return r?(s=t.substring(0,r),t=t.substring(r)):(s=t,t=""),this._finished=!t,this.parseChunk(s)}}}Z.prototype=Object.create(Z.prototype),Z.prototype.constructor=Z;function te(e){e=e||{},z.call(this,e);var t=[],r=!0,s=!1;this.pause=function(){z.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){z.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(n){this._input=n,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){s&&t.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),t.length?this.parseChunk(t.shift()):r=!0},this._streamData=F(function(n){try{t.push(typeof n=="string"?n:n.toString(this._config.encoding)),r&&(r=!1,this._checkIsFinished(),this.parseChunk(t.shift()))}catch(p){this._streamError(p)}},this),this._streamError=F(function(n){this._streamCleanUp(),this._sendError(n)},this),this._streamEnd=F(function(){this._streamCleanUp(),s=!0,this._streamData("")},this),this._streamCleanUp=F(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}te.prototype=Object.create(z.prototype),te.prototype.constructor=te;function re(e){var t=we("stream").Duplex,r=he(e),s=!0,n=!1,p=[],h=null;this._onCsvData=function(i){var y=i.data;!h.push(y)&&!this._handle.paused()&&this._handle.pause()},this._onCsvComplete=function(){h.push(null)},r.step=F(this._onCsvData,this),r.complete=F(this._onCsvComplete,this),z.call(this,r),this._nextChunk=function(){n&&p.length===1&&(this._finished=!0),p.length?p.shift()():s=!0},this._addToParseQueue=function(i,y){p.push(F(function(){if(this.parseChunk(typeof i=="string"?i:i.toString(r.encoding)),g(y))return y()},this)),s&&(s=!1,this._nextChunk())},this._onRead=function(){this._handle.paused()&&this._handle.resume()},this._onWrite=function(i,y,E){this._addToParseQueue(i,E)},this._onWriteComplete=function(){n=!0,this._addToParseQueue("")},this.getStream=function(){return h},h=new t({readableObjectMode:!0,decodeStrings:!1,read:F(this._onRead,this),write:F(this._onWrite,this)}),h.once("finish",F(this._onWriteComplete,this))}typeof PAPA_BROWSER_CONTEXT>"u"&&(re.prototype=Object.create(z.prototype),re.prototype.constructor=re);function ce(e){var t=Math.pow(2,53),r=-t,s=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,n=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,p=this,h=0,i=0,y,E,O=!1,d=!1,L,u=[],c={data:[],errors:[],meta:{}};if(g(e.step)){var Q=e.step;e.step=function(o){if(c=o,w())S();else{if(S(),c.data.length===0)return;h+=o.data.length,e.preview&&h>e.preview?E.abort():(c.data=c.data[0],Q(c,p))}}}this.parse=function(o,f,m){var b=e.quoteChar||'"';if(e.newline||(e.newline=this.guessLineEndings(o,b)),L=!1,e.delimiter)g(e.delimiter)&&(e.delimiter=e.delimiter(o),c.meta.delimiter=e.delimiter);else{var a=j(o,e.newline,e.skipEmptyLines,e.comments,e.delimitersToGuess);a.successful?e.delimiter=a.bestDelimiter:(L=!0,e.delimiter=l.DefaultDelimiter),c.meta.delimiter=e.delimiter}var C=he(e);return e.preview&&e.header&&C.preview++,y=o,E=new fe(C),c=E.parse(y,f,m),S(),O?{meta:{paused:!0}}:c||{meta:{paused:!1}}},this.paused=function(){return O},this.pause=function(){O=!0,E.abort(),y=g(e.chunk)?"":y.substring(E.getCharIndex())},this.resume=function(){p.streamer._halted?(O=!1,p.streamer.parseChunk(y,!0)):setTimeout(p.resume,3)},this.aborted=function(){return d},this.abort=function(){d=!0,E.abort(),c.meta.aborted=!0,g(e.complete)&&e.complete(c),y=""},this.guessLineEndings=function(o,f){o=o.substring(0,1024*1024);var m=new RegExp(se(f)+"([^]*?)"+se(f),"gm");o=o.replace(m,"");var b=o.split("\r"),a=o.split(` -`),C=a.length>1&&a[0].length=b.length/2?`\r -`:"\r"};function v(o){return e.skipEmptyLines==="greedy"?o.join("").trim()==="":o.length===1&&o[0].length===0}function k(o){if(s.test(o)){var f=parseFloat(o);if(f>r&&f=u.length?"__parsed_extra":u[C]),e.transform&&(x=e.transform(x,A)),x=q(A,x),A==="__parsed_extra"?(a[A]=a[A]||[],a[A].push(x)):a[A]=x}return e.header&&(C>u.length?W("FieldMismatch","TooManyFields","Too many fields: expected "+u.length+" fields but parsed "+C,i+b):C"u"){x=P;continue}else P>0&&(X+=Math.abs(P-x),x=P)}H.data.length>0&&(K/=H.data.length-I),(typeof A>"u"||X<=A)&&(typeof J>"u"||K>J)&&K>1.99&&(A=X,C=ie,J=K)}return e.delimiter=C,{successful:!!C,bestDelimiter:C}}function W(o,f,m,b){var a={type:o,code:f,message:m};b!==void 0&&(a.row=b),c.errors.push(a)}}function se(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function fe(e){e=e||{};var t=e.delimiter,r=e.newline,s=e.comments,n=e.step,p=e.preview,h=e.fastMode,i,y=null,E=!1;e.quoteChar===void 0||e.quoteChar===null?i='"':i=e.quoteChar;var O=i;if(e.escapeChar!==void 0&&(O=e.escapeChar),(typeof t!="string"||l.BAD_DELIMITERS.indexOf(t)>-1)&&(t=","),s===t)throw new Error("Comment character same as delimiter");s===!0?s="#":(typeof s!="string"||l.BAD_DELIMITERS.indexOf(s)>-1)&&(s=!1),r!==` -`&&r!=="\r"&&r!==`\r -`&&(r=` -`);var d=0,L=!1;this.parse=function(u,c,Q){if(typeof u!="string")throw new Error("Input must be a string");var v=u.length,k=t.length,S=r.length,w=s.length,M=g(n);d=0;var T=[],q=[],_=[],j=0;if(!u)return I();if(h||h!==!1&&u.indexOf(i)===-1){for(var W=u.split(r),o=0;o=p)return T=T.slice(0,p),I(!0)}}return I()}for(var f=u.indexOf(t,d),m=u.indexOf(r,d),b=new RegExp(se(O)+se(i),"g"),a=u.indexOf(i,d);;){if(u[d]===i){for(a=d,d++;;){if(a=u.indexOf(i,a+1),a===-1)return Q||q.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:T.length,index:d}),X();if(a===v-1){var C=u.substring(d,a).replace(b,i);return X(C)}if(i===O&&u[a+1]===O){a++;continue}if(!(i!==O&&a!==0&&u[a-1]===O)){f!==-1&&f=p)return I(!0);break}q.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:T.length,index:d}),a++}}continue}if(s&&_.length===0&&u.substring(d,d+w)===s){if(m===-1)return I();d=m+S,m=u.indexOf(r,d),f=u.indexOf(t,d);continue}if(f!==-1&&(f=p)return I(!0);continue}break}return X();function N(D){T.push(D),j=d}function ie(D){var P=0;if(D!==-1){var B=u.substring(a+1,D);B&&B.trim()===""&&(P=B.length)}return P}function X(D){return Q||(typeof D>"u"&&(D=u.substring(d)),_.push(D),d=v,N(_),M&&H()),I()}function K(D){d=D,N(_),_=[],m=u.indexOf(r,d)}function I(D){if(e.header&&!c&&T.length&&!E){let P=T[0],B=Object.create(null),le=new Set(P),ve=!1;for(let $=0;$"u"&&t&&(l.WORKER_ID=t.workerId),typeof t.input=="string")R.postMessage({workerId:l.WORKER_ID,results:l.parse(t.input,t.config),finished:!0});else if(R.File&&t.input instanceof File||t.input instanceof Object){var r=l.parse(t.input,t.config);r&&R.postMessage({workerId:l.WORKER_ID,results:r,finished:!0})}}function he(e){if(typeof e!="object"||e===null)return e;var t=Array.isArray(e)?[]:{};for(var r in e)t[r]=he(e[r]);return t}function F(e,t){return function(){e.apply(t,arguments)}}function g(e){return typeof e=="function"}return l})});export{xe as a}; -/*! Bundled license information: - -papaparse/papaparse.js: - (* @license - Papa Parse - v5.5.3 - https://github.com/mholt/PapaParse - License: MIT - *) -*/ diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-4JLVZKHC.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-4JLVZKHC.js deleted file mode 100644 index d40dea4..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-4JLVZKHC.js +++ /dev/null @@ -1,8 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a as m}from"./chunk-QIQMJJZ4.js";import{a as $}from"./chunk-W5DWRFSU.js";import{a as y,b as h}from"./chunk-QAYAQNCG.js";var D={name:"cp",summary:"copy files and directories",usage:"cp [OPTION]... SOURCE... DEST",options:["-r, -R, --recursive copy directories recursively","-n, --no-clobber do not overwrite an existing file","-p, --preserve preserve file attributes","-v, --verbose explain what is being done"," --help display this help and exit"]},E={recursive:{short:"r",long:"recursive",type:"boolean"},recursiveUpper:{short:"R",type:"boolean"},noClobber:{short:"n",long:"no-clobber",type:"boolean"},preserve:{short:"p",long:"preserve",type:"boolean"},verbose:{short:"v",long:"verbose",type:"boolean"}},A={name:"cp",async execute(f,e){if(h(f))return y(D);let t=m("cp",f,E);if(!t.ok)return t.error;let u=t.result.flags.recursive||t.result.flags.recursiveUpper,w=t.result.flags.noClobber,C=t.result.flags.preserve,P=t.result.flags.verbose,c=t.result.positional;if(c.length<2)return{stdout:"",stderr:`cp: missing destination file operand -`,exitCode:1};let g=c.pop()??"",d=c,o=e.fs.resolvePath(e.cwd,g),b="",n="",l=0,p=!1;try{p=(await e.fs.stat(o)).isDirectory}catch{}if(d.length>1&&!p)return{stdout:"",stderr:`cp: target '${g}' is not a directory -`,exitCode:1};for(let r of d)try{let a=e.fs.resolvePath(e.cwd,r),s=await e.fs.stat(a),i=o;if(p){let v=r.split("/").pop()||r;i=o==="/"?`/${v}`:`${o}/${v}`}if(s.isDirectory&&!u){n+=`cp: -r not specified; omitting directory '${r}' -`,l=1;continue}if(w)try{await e.fs.stat(i);continue}catch{}await e.fs.cp(a,i,{recursive:u}),P&&(b+=`'${r}' -> '${i}' -`)}catch(a){let s=$(a);s.includes("ENOENT")||s.includes("no such file")?n+=`cp: cannot stat '${r}': No such file or directory -`:n+=`cp: cannot copy '${r}': ${s} -`,l=1}return{stdout:b,stderr:n,exitCode:l}}},F={name:"cp",flags:[{flag:"-r",type:"boolean"},{flag:"-R",type:"boolean"},{flag:"-n",type:"boolean"},{flag:"-p",type:"boolean"},{flag:"-v",type:"boolean"}],needsArgs:!0,minArgs:2};export{A as a,F as b}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-4MZPEZTU.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-4MZPEZTU.js deleted file mode 100644 index 1405831..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-4MZPEZTU.js +++ /dev/null @@ -1,3 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -async function e(t,o){return{stdout:`user -`,stderr:"",exitCode:0}}var a={name:"whoami",execute:e},n={name:"whoami",flags:[]};export{a,n as b}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-4WKZNNJK.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-4WKZNNJK.js deleted file mode 100644 index 6818a83..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-4WKZNNJK.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -var i=new Set(["__proto__","constructor","prototype"]),p=new Set([...i,"__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]);function a(e,n){if(Array.isArray(e))throw new TypeError(`${n}: expected object, got array`);if(Object.getPrototypeOf(e)!==null)throw new TypeError(`${n}: expected null-prototype object, got prototypal object`)}function u(e){return!i.has(e)}function l(e,n,o){a(e,"safeSet"),u(n)&&(e[n]=o)}function y(e,n){return a(e,"safeHasOwn"),Object.hasOwn(e,n)}function O(e){let n=new WeakMap,o=t=>{if(t===null||typeof t!="object"||t instanceof Date)return t;let f=n.get(t);if(f!==void 0)return f;if(Array.isArray(t)){let r=[];n.set(t,r);for(let c of t)r.push(o(c));return r}let s=Object.create(null);n.set(t,s);for(let r of Object.keys(t))s[r]=o(t[r]);return s};return o(e)}function _(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}function x(e){return Object.assign(Object.create(null),e)}function S(e){return Object.assign(Object.create(null),e)}function b(...e){return Object.assign(Object.create(null),...e)}export{u as a,l as b,y as c,O as d,_ as e,x as f,S as g,b as h}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-55LZFN6S.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-55LZFN6S.js deleted file mode 100644 index 1c006c2..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-55LZFN6S.js +++ /dev/null @@ -1,36 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a as q,b as w}from"./chunk-SY4HAUHP.js";import{c as b}from"./chunk-KAPG5ONA.js";import{b as E}from"./chunk-VACKIICN.js";import{c as x}from"./chunk-XEKXHOPO.js";import{a as T,b as g}from"./chunk-FOCWZZDE.js";import{a as C,b as M}from"./chunk-QAYAQNCG.js";import{randomBytes as Y}from"node:crypto";import{existsSync as G}from"node:fs";import{dirname as K,join as $,sep as O}from"node:path";import{fileURLToPath as Z}from"node:url";import{Worker as v}from"node:worker_threads";import ee from"sql.js";function B(e,t,r){switch(r.mode){case"list":return N(e,t,r);case"csv":return R(e,t,r);case"json":return W(e,t);case"line":return F(e,t,r);case"column":return Q(e,t,r);case"table":return U(e,t,r);case"markdown":return H(e,t,r);case"tabs":return J(e,t,r);case"box":return _(e,t,r);case"quote":return z(e,t,r);case"html":return D(e,t,r);case"ascii":return X(e,t,r)}}function f(e,t){return e==null?t:e instanceof Uint8Array||Buffer.isBuffer(e)?Buffer.from(e).toString("utf8"):typeof e=="number"&&!Number.isInteger(e)?e.toPrecision(17).replace(/\.?0+$/,""):String(e)}function N(e,t,r){let n=[];r.header&&e.length>0&&n.push(e.join(r.separator));for(let a of t)n.push(a.map(o=>f(o,r.nullValue)).join(r.separator));return n.length>0?`${n.join(r.newline)}${r.newline}`:""}function R(e,t,r){let n=[];r.header&&e.length>0&&n.push(e.map(L).join(","));for(let a of t)n.push(a.map(o=>L(f(o,r.nullValue))).join(","));return n.length>0?`${n.join(` -`)} -`:""}function L(e){return e.includes(",")||e.includes('"')||e.includes("'")||e.includes(` -`)?`"${e.replace(/"/g,'""')}"`:e}function A(e){return e.toPrecision(17).replace(/\.?0+$/,"")}function P(e){return e===null?"null":typeof e=="number"?Number.isInteger(e)?String(e):A(e):JSON.stringify(e)}function W(e,t){return t.length===0?"":`[${t.map(n=>`{${e.map((o,i)=>`${JSON.stringify(o)}:${P(n[i])}`).join(",")}}`).join(`, -`)}] -`}function F(e,t,r){if(e.length===0||t.length===0)return"";let n=Math.max(5,...e.map(o=>o.length)),a=[];for(let o of t)for(let i=0;io.length);for(let o of t)for(let i=0;in[i]&&(n[i]=s)}let a=[];r.header&&(a.push(e.map((o,i)=>o.padEnd(n[i])).join(" ")),a.push(n.map(o=>"-".repeat(o)).join(" ")));for(let o of t)a.push(o.map((i,s)=>f(i,r.nullValue).padEnd(n[s])).join(" "));return a.length>0?`${a.join(` -`)} -`:""}function U(e,t,r){if(e.length===0)return"";let n=e.map(i=>i.length);for(let i of t)for(let s=0;sn[s]&&(n[s]=m)}let a=[],o=`+${n.map(i=>"-".repeat(i+2)).join("+")}+`;a.push(o),r.header&&(a.push(`| ${e.map((i,s)=>i.padEnd(n[s])).join(" | ")} |`),a.push(o));for(let i of t)a.push(`| ${i.map((s,m)=>f(s,r.nullValue).padEnd(n[m])).join(" | ")} |`);return a.push(o),`${a.join(` -`)} -`}function H(e,t,r){if(e.length===0)return"";let n=[];r.header&&(n.push(`| ${e.join(" | ")} |`),n.push(`|${e.map(()=>"---").join("|")}|`));for(let a of t)n.push(`| ${a.map(o=>f(o,r.nullValue)).join(" | ")} |`);return n.length>0?`${n.join(` -`)} -`:""}function J(e,t,r){let n=[];r.header&&e.length>0&&n.push(e.join(" "));for(let a of t)n.push(a.map(o=>f(o,r.nullValue)).join(" "));return n.length>0?`${n.join(r.newline)}${r.newline}`:""}function _(e,t,r){if(e.length===0)return"";let n=e.map(o=>o.length);for(let o of t)for(let i=0;in[i]&&(n[i]=s)}let a=[];a.push(`\u250C${n.map(o=>"\u2500".repeat(o+2)).join("\u252C")}\u2510`),a.push(`\u2502 ${e.map((o,i)=>o.padEnd(n[i])).join(" \u2502 ")} \u2502`),a.push(`\u251C${n.map(o=>"\u2500".repeat(o+2)).join("\u253C")}\u2524`);for(let o of t)a.push(`\u2502 ${o.map((i,s)=>f(i,r.nullValue).padEnd(n[s])).join(" \u2502 ")} \u2502`);return a.push(`\u2514${n.map(o=>"\u2500".repeat(o+2)).join("\u2534")}\u2518`),`${a.join(` -`)} -`}function z(e,t,r){let n=[];r.header&&e.length>0&&n.push(e.map(a=>`'${a}'`).join(","));for(let a of t)n.push(a.map(o=>o==null?"NULL":typeof o=="number"?Number.isInteger(o)?String(o):A(o):`'${String(o)}'`).join(","));return n.length>0?`${n.join(r.newline)}${r.newline}`:""}function D(e,t,r){let n=[];r.header&&e.length>0&&(n.push(`${e.map(a=>`${V(a)}`).join("")}`),n.push(""));for(let a of t)n.push(`${a.map(o=>`${V(f(o,r.nullValue))}`).join("")}`),n.push("");return n.length>0?`${n.join(` -`)} -`:""}function V(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""")}function X(e,t,r){let o=[];r.header&&e.length>0&&o.push(e.join(""));for(let i of t)o.push(i.map(s=>f(s,r.nullValue)).join(""));return o.length>0?o.join("")+"":""}var re=5e3,te={name:"sqlite3",summary:"SQLite database CLI",usage:"sqlite3 [OPTIONS] DATABASE [SQL]",options:["-list output in list mode (default)","-csv output in CSV mode","-json output in JSON mode","-line output in line mode","-column output in column mode","-table output as ASCII table","-markdown output as markdown table","-tabs output in tab-separated mode","-box output in Unicode box mode","-quote output in SQL quote mode","-html output as HTML table","-ascii output in ASCII mode (control chars)","-header show column headers","-noheader hide column headers","-separator SEP field separator for list mode (default: |)","-newline SEP row separator (default: \\n)","-nullvalue TEXT text for NULL values (default: empty)","-readonly open database read-only (no writeback)","-bail stop on first error","-echo print SQL before execution","-cmd COMMAND run SQL command before main SQL","-version show SQLite version","-- end of options","--help show this help"],examples:['sqlite3 :memory: "CREATE TABLE t(x); INSERT INTO t VALUES(1); SELECT * FROM t"','sqlite3 -json data.db "SELECT * FROM users"','sqlite3 -csv -header data.db "SELECT id, name FROM products"','sqlite3 -box data.db "SELECT * FROM users"']};function ne(e){let t={mode:"list",header:!1,separator:"|",newline:` -`,nullValue:"",readonly:!1,bail:!1,echo:!1,cmd:null},r=null,n=null,a=!1,o=!1;for(let i=0;i=e.length)return{stdout:"",stderr:`sqlite3: Error: missing argument to -separator -`,exitCode:1};t.separator=e[++i]}else if(s==="-newline"){if(i+1>=e.length)return{stdout:"",stderr:`sqlite3: Error: missing argument to -newline -`,exitCode:1};t.newline=e[++i]}else if(s==="-nullvalue"){if(i+1>=e.length)return{stdout:"",stderr:`sqlite3: Error: missing argument to -nullvalue -`,exitCode:1};t.nullValue=e[++i]}else if(s==="-cmd"){if(i+1>=e.length)return{stdout:"",stderr:`sqlite3: Error: missing argument to -cmd -`,exitCode:1};t.cmd=e[++i]}else{if(s.startsWith("-"))return{stdout:"",stderr:`sqlite3: Error: unknown option: ${s.startsWith("--")?s.slice(1):s} -Use -help for a list of options. -`,exitCode:1};r===null?r=s:n===null&&(n=s)}}return{options:t,database:r,sql:n,showVersion:a}}async function oe(){let e=await E.runTrustedAsync(()=>ee()),t=new e.Database;try{let r=t.exec("SELECT sqlite_version()");return r.length>0&&r[0].values.length>0?String(r[0].values[0][0]):"unknown"}finally{t.close()}}function I(e=K(Z(import.meta.url))){let t=[$(e,"sqlite3-worker.js"),$(e,"../../commands/sqlite3/worker.js")];(e.endsWith(`${O}commands${O}sqlite3`)||e.endsWith("/commands/sqlite3"))&&t.push($(e,"worker.js")),t.push($(e,"../../../dist/commands/sqlite3/worker.js"));for(let r of t)if(G(r))return r;throw new Error("sqlite3 worker not found. Run 'pnpm build' to compile the worker.")}var se={createWorker(e,t){return new v(e,{workerData:t})},findWorkerPath:I};function ie(){return Y(16).toString("hex")}function ae(e,t){if(!e||typeof e!="object")return{success:!1,error:"Malformed worker response"};let r=e;return typeof r.protocolToken!="string"||r.protocolToken!==t?{success:!1,error:"Malformed worker response: invalid protocol token"}:r.type==="security-violation"?{success:!1,error:`Security violation: ${typeof r.violation?.type=="string"?r.violation.type:"unknown"}`}:typeof r.success!="boolean"?{success:!1,error:"Malformed worker response: missing success flag"}:r.success?Array.isArray(r.results)?typeof r.hasModifications!="boolean"?{success:!1,error:"Malformed worker response: missing hasModifications flag"}:r.dbBuffer!==null&&r.dbBuffer!==void 0&&!(r.dbBuffer instanceof Uint8Array)?{success:!1,error:"Malformed worker response: invalid dbBuffer"}:{success:!0,results:r.results,hasModifications:r.hasModifications,dbBuffer:r.dbBuffer===void 0?null:r.dbBuffer,defenseStats:r.defenseStats}:{success:!1,error:"Malformed worker response: missing results array"}:{success:!1,error:typeof r.error=="string"&&r.error.length>0?r.error:"Worker execution failed"}}async function le(e,t,r){try{let n=I();return await new Promise((a,o)=>{let i=E.runTrusted(()=>se.createWorker(n,e)),s=b(r,"sqlite3","worker timeout callback",()=>{i.terminate(),a({success:!1,error:`Query timeout: execution exceeded ${t}ms limit`})}),c=q(()=>{try{s()}catch(u){let l=u instanceof Error?u.message:String(u);a({success:!1,error:g(l)})}},t),S=b(r,"sqlite3","worker message callback",u=>{w(c),a(ae(u,e.protocolToken))}),y=b(r,"sqlite3","worker error callback",u=>{w(c),o(u)}),k=b(r,"sqlite3","worker exit callback",u=>{w(c),u!==0&&a({success:!1,error:`Worker exited with code ${u}`})}),p=u=>{try{S(u)}catch(l){w(c);let d=l instanceof Error?l.message:String(l);a({success:!1,error:g(d)})}},j=u=>{try{y(u)}catch(l){w(c);let d=l instanceof Error?l.message:String(l);o(new Error(g(d)))}},h=u=>{try{k(u)}catch(l){w(c);let d=l instanceof Error?l.message:String(l);a({success:!1,error:g(d)})}};i.on("message",p),i.on("error",j),i.on("exit",h)})}catch(n){let a=g(n.message);throw new Error(`sqlite3 worker failed to load: ${a}`)}}var je={name:"sqlite3",async execute(e,t){if(M(e)||e.includes("-help"))return C(te);let r=ne(e);if("exitCode"in r)return r;let{options:n,database:a,sql:o,showVersion:i}=r;if(i)return{stdout:`${await oe()} -`,stderr:"",exitCode:0};if(!a)return{stdout:"",stderr:`sqlite3: missing database argument -`,exitCode:1};let s=o||x(t.stdin).trim();if(n.cmd&&(s=n.cmd+(s?`; ${s}`:"")),!s)return{stdout:"",stderr:`sqlite3: no SQL provided -`,exitCode:1};let m=a===":memory:",c="",S=null;try{m||(c=t.fs.resolvePath(t.cwd,a),await t.fs.exists(c)&&(S=await t.fs.readFileBuffer(c)))}catch(l){let d=T(l.message);return{stdout:"",stderr:`sqlite3: unable to open database "${a}": ${d} -`,exitCode:1}}let y=t.limits?.maxSqliteTimeoutMs??re,k={protocolToken:ie(),dbBuffer:S,sql:s,options:{bail:n.bail,echo:n.echo}},p;try{p=await le(k,y,t.requireDefenseContext)}catch(l){return{stdout:"",stderr:`sqlite3: worker error: ${g(l.message)} -`,exitCode:1}}if(!p.success)return{stdout:"",stderr:`sqlite3: ${g(p.error)} -`,exitCode:1};let j={mode:n.mode,header:n.header,separator:n.separator,newline:n.newline,nullValue:n.nullValue},h="";n.echo&&(h+=`${s} -`);let u=!1;for(let l of p.results)if(l.type==="error"){if(n.bail)return{stdout:h,stderr:`Error: ${l.error} -`,exitCode:1};h+=`Error: ${l.error} -`,u=!0}else l.columns&&l.rows&&(l.rows.length>0||n.header)&&(h+=B(l.columns,l.rows,j));if(p.hasModifications&&!n.readonly&&!m&&c&&p.dbBuffer)try{await t.fs.writeFile(c,p.dbBuffer)}catch(l){let d=T(l.message);return{stdout:h,stderr:`sqlite3: failed to write database: ${d} -`,exitCode:1}}return{stdout:h,stderr:"",exitCode:u&&n.bail?1:0}}},Ee={name:"sqlite3",flags:[],needsArgs:!0};export{se as a,je as b,Ee as c}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-5MV7Q5QB.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-5MV7Q5QB.js deleted file mode 100644 index cbf4b3b..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-5MV7Q5QB.js +++ /dev/null @@ -1,5 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{b as m}from"./chunk-KTPCYKBB.js";import{c as d}from"./chunk-XEKXHOPO.js";import{a as y}from"./chunk-QIQMJJZ4.js";import{a as f,b as g}from"./chunk-QAYAQNCG.js";var T={name:"uniq",summary:"report or omit repeated lines",usage:"uniq [OPTION]... [INPUT [OUTPUT]]",options:["-c, --count prefix lines by the number of occurrences","-d, --repeated only print duplicate lines","-i, --ignore-case ignore case when comparing","-u, --unique only print unique lines"," --help display this help and exit"]},w={count:{short:"c",long:"count",type:"boolean"},duplicatesOnly:{short:"d",long:"repeated",type:"boolean"},uniqueOnly:{short:"u",long:"unique",type:"boolean"},ignoreCase:{short:"i",long:"ignore-case",type:"boolean"}},$={name:"uniq",async execute(p,h){if(g(p))return f(T);let o=y("uniq",p,w);if(!o.ok)return o.error;let{count:q,duplicatesOnly:b,uniqueOnly:C,ignoreCase:a}=o.result.flags,x=o.result.positional,r=await m(h,x,{cmdName:"uniq"});if(!r.ok)return r.error;let t=(a?d(r.content):r.content).split(` -`);if(t.length>0&&t[t.length-1]===""&&t.pop(),t.length===0)return{stdout:"",stderr:"",exitCode:0};let n=[],i=t[0],s=1,O=(e,u)=>a?e.toLowerCase()===u.toLowerCase():e===u;for(let e=1;ee.count>1):C&&(c=n.filter(e=>e.count===1));let l="";for(let{line:e,count:u}of c)q?l+=`${String(u).padStart(4)} ${e} -`:l+=`${e} -`;return a?{stdout:l,stderr:"",exitCode:0}:{stdout:l,stderr:"",exitCode:0,stdoutKind:"bytes",stdoutEncoding:"binary"}}},k={name:"uniq",flags:[{flag:"-c",type:"boolean"},{flag:"-d",type:"boolean"},{flag:"-u",type:"boolean"},{flag:"-i",type:"boolean"}],stdinType:"text",needsFiles:!0};export{$ as a,k as b}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-6L65G6A7.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-6L65G6A7.js deleted file mode 100644 index ed33194..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-6L65G6A7.js +++ /dev/null @@ -1,17 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{f as a}from"./chunk-XEKXHOPO.js";import{a as d,b as h,c as p}from"./chunk-QAYAQNCG.js";var k={name:"split",summary:"split a file into pieces",usage:"split [OPTION]... [FILE [PREFIX]]",description:"Output pieces of FILE to PREFIXaa, PREFIXab, ...; default size is 1000 lines, and default PREFIX is 'x'.",options:["-l N Put N lines per output file","-b SIZE Put SIZE bytes per output file (K, M, G suffixes)","-n CHUNKS Split into CHUNKS equal-sized files","-d Use numeric suffixes (00, 01, ...) instead of alphabetic","-a LENGTH Use suffixes of length LENGTH (default: 2)","--additional-suffix=SUFFIX Append SUFFIX to file names"],examples:["split -l 100 file.txt # Split into 100-line chunks","split -b 1M file.bin # Split into 1MB chunks","split -n 5 file.txt # Split into 5 equal parts","split -d file.txt part_ # part_00, part_01, ...","split -a 3 -d file.txt x # x000, x001, ..."]},m=1e5;function b(s){let l=s.match(/^(\d+)([KMGTPEZY]?)([B]?)$/i);if(!l)return null;let e=Number.parseInt(l[1],10);if(Number.isNaN(e)||e<1)return null;let u=(l[2]||"").toUpperCase(),o=new Map([["",1],["K",1024],["M",1024*1024],["G",1024*1024*1024],["T",1024*1024*1024*1024],["P",1024*1024*1024*1024*1024]]).get(u);return o===void 0?null:e*o}function g(s,l,e){if(l)return s.toString().padStart(e,"0");let u="abcdefghijklmnopqrstuvwxyz",t="",o=s;for(let r=0;r=e.length&&!u?r.join(` -`):`${r.join(` -`)} -`;t.push({content:c,hasContent:!0})}return t}function S(s,l){let u=new TextEncoder().encode(s),t=new TextDecoder,o=[];for(let r=0;r0})}return o}function v(s,l){let u=new TextEncoder().encode(s),t=new TextDecoder,o=[],r=Math.ceil(u.length/l);for(let f=0;f0})}return o}var F={name:"split",execute:async(s,l)=>{if(h(s))return d(k);let e={mode:"lines",lines:1e3,bytes:0,chunks:0,useNumericSuffix:!1,suffixLength:2,additionalSuffix:""},u=[],t=0;for(;t=1&&(o=u[0]),u.length>=2&&(r=u[1]);let f;if(o==="-")f=l.stdin??"";else{let i=l.fs.resolvePath(l.cwd,o);try{let n=await a(l.fs,i);f=n}catch{return{exitCode:1,stdout:"",stderr:`split: ${o}: No such file or directory -`}}}if(f==="")return{exitCode:0,stdout:"",stderr:""};let c;switch(e.mode){case"lines":c=C(f,e.lines);break;case"bytes":c=S(f,e.bytes);break;case"chunks":c=v(f,e.chunks);break;default:return e.mode}if(c.length>m)return{exitCode:1,stdout:"",stderr:`split: too many output files (${c.length}), limit is ${m} -`};for(let i=0;i0&&a[a.length-1]===""&&a.pop();let F=p.filter(e=>e==="-").length,f=[],h=0;for(let e of p)if(e==="-"){let t=[];for(let o=h;o0&&r[r.length-1]===""&&r.pop(),f.push(r)}catch{return{stdout:"",stderr:`paste: ${e}: No such file or directory -`,exitCode:1}}}let u="";if(d)for(let e of f)e&&(u+=`${I(e,l)} -`);else{let e=Math.max(...f.map(t=>t?.length??0));for(let t=0;t=r.length){s+="\\";break}let o=r[e+1];switch(o){case"\\":s+="\\",e+=2;break;case"n":s+=` -`,e+=2;break;case"t":s+=" ",e+=2;break;case"r":s+="\r",e+=2;break;case"a":s+="\x07",e+=2;break;case"b":s+="\b",e+=2;break;case"f":s+="\f",e+=2;break;case"v":s+="\v",e+=2;break;case"e":case"E":s+="\x1B",e+=2;break;case"c":return{output:s,stop:!0};case"0":{let a="",t=e+2;for(;t{"use strict";q=class{input;pos=0;tokens=[];constructor(n){this.input=n}tokenize(){for(;this.pos=this.input.length));){let n=this.nextToken();n&&this.tokens.push(n)}return this.tokens.push({type:"eof",value:"",pos:this.pos}),this.tokens}skipWhitespace(){for(;this.pos="0"&&t<="9")return this.readNumber();if(t==='"'||t==="'"||t==="`")return this.readString(t);if(t==="b"&&this.pos+1"))return{type:"=>",value:"=>",pos:n};if(this.match("**"))return{type:"**",value:"**",pos:n};if(this.match("++"))return{type:"++",value:"++",pos:n};if(this.match("//"))return{type:"//",value:"//",pos:n};if(this.match("=="))return{type:"==",value:"==",pos:n};if(this.match("!="))return{type:"!=",value:"!=",pos:n};if(this.match("<="))return{type:"<=",value:"<=",pos:n};if(this.match(">="))return{type:">=",value:">=",pos:n};if(this.match("&&"))return{type:"&&",value:"&&",pos:n};if(this.match("||"))return{type:"||",value:"||",pos:n};let r=new Map([["(","("],[")",")"],["[","["],["]","]"],["{","{"],["}","}"],[",",","],[":",":"],[";",";"],["+","+"],["-","-"],["*","*"],["%","%"],["<","<"],[">",">"],["!","!"],[".","."],["|","|"],["=","="]]).get(t);if(r!==void 0)return this.pos++,{type:r,value:t,pos:n};if(this.isIdentStart(t))return this.readIdentifier();throw new Error(`Unexpected character '${t}' at position ${this.pos}`)}match(n){if(this.input.slice(this.pos,this.pos+n.length)===n){if(/^[a-zA-Z]/.test(n)){let t=this.input[this.pos+n.length];if(t&&this.isIdentChar(t))return!1}return this.pos+=n.length,!0}return!1}isIdentStart(n){return n>="a"&&n<="z"||n>="A"&&n<="Z"||n==="_"}isIdentChar(n){return this.isIdentStart(n)||n>="0"&&n<="9"}readNumber(){let n=this.pos,t=!1,s=!1;for(;this.pos="0"&&o<="9")this.pos++;else if(o==="_")this.pos++;else if(o==="."&&!t&&!s)t=!0,this.pos++;else if((o==="e"||o==="E")&&!s)s=!0,t=!0,this.pos++,this.posH,parseNamedExpressions:()=>U});function U(e){let n=[],s=new q(e).tokenize(),r=0,o=()=>s[r]||{type:"eof",value:"",pos:0},a=()=>s[r++];for(;o().type!=="eof";){if(o().type===","&&n.length>0){a();continue}let d=[],u=0,p=r;for(;o().type!=="eof";){let i=o();if((i.type===","||i.type==="as")&&u===0)break;(i.type==="("||i.type==="["||i.type==="{")&&u++,(i.type===")"||i.type==="]"||i.type==="}")&&u--,d.push(a())}d.push({type:"eof",value:"",pos:0});let h=new z(d).parse(),l;if(o().type==="as")if(a(),o().type==="("){a();let i=[];for(;o().type!==")"&&o().type!=="eof";)(o().type==="ident"||o().type==="string")&&(i.push(o().value),a()),o().type===","&&a();o().type===")"&&a(),l=i}else if(o().type==="ident"||o().type==="string")l=o().value,a();else throw new Error(`Expected name after 'as', got ${o().type}`);else l=e.slice(s[p].pos,s[r-1]?.pos||e.length).trim(),h.type==="identifier"&&(l=h.name);n.push({expr:h,name:l})}return n}function H(e){let t=new q(e).tokenize();return new z(t).parse()}var R,z,V=We(()=>{"use strict";Je();R={PIPE:1,OR:2,AND:3,EQUALITY:4,COMPARISON:5,ADDITIVE:6,MULTIPLICATIVE:7,POWER:8,UNARY:9,POSTFIX:10},z=class{pos=0;tokens;constructor(n){this.tokens=n}parse(){let n=this.parseExpr(0);if(this.peek().type!=="eof")throw new Error(`Unexpected token: ${this.peek().value}`);return n}parseExpr(n){let t=this.parsePrefix();for(;;){let s=this.peek(),r=this.getInfixPrec(s.type);if(r1?t[t.length-1]:"";return{type:"regex",pattern:t.slice(0,-1).join("/")||n.value,caseInsensitive:s.includes("i")}}case"true":return this.advance(),{type:"bool",value:!0};case"false":return this.advance(),{type:"bool",value:!1};case"null":return this.advance(),{type:"null"};case"_":return this.advance(),{type:"underscore"};case"ident":{let t=n.value,s=t.endsWith("?"),r=s?t.slice(0,-1):t;if(this.advance(),this.peek().type==="(")return this.parseFunctionCall(r);if(this.peek().type==="=>"){this.advance();let o=this.parseExpr(0);return this.bindLambdaArgs({type:"lambda",params:[r],body:o},[r])}return{type:"identifier",name:r,unsure:s}}case"(":{this.advance();let t=this.pos;if(this.peek().type===")"){if(this.advance(),this.peek().type==="=>"){this.advance();let r=this.parseExpr(0);return{type:"lambda",params:[],body:r}}throw new Error("Empty parentheses not allowed")}if(this.peek().type==="ident"){let r=[this.peek().value];this.advance();let o=!0;for(;this.peek().type===",";)if(this.advance(),this.peek().type==="ident")r.push(this.peek().value),this.advance();else{o=!1;break}if(o&&this.peek().type===")"&&this.peekAt(1).type==="=>"){this.advance(),this.advance();let a=this.parseExpr(0);return this.bindLambdaArgs({type:"lambda",params:r,body:a},r)}this.pos=t}let s=this.parseExpr(0);return this.expect(")"),s}case"[":return this.parseList();case"{":return this.parseMap();case"-":{this.advance();let t=this.parseExpr(R.UNARY);return t.type==="int"?{type:"int",value:-t.value}:t.type==="float"?{type:"float",value:-t.value}:{type:"func",name:"neg",args:[{expr:t}]}}case"!":return this.advance(),{type:"func",name:"not",args:[{expr:this.parseExpr(R.UNARY)}]};default:throw new Error(`Unexpected token: ${n.type} (${n.value})`)}}parseFunctionCall(n){this.expect("(");let t=[];if(this.peek().type!==")")do{t.length>0&&this.peek().type===","&&this.advance();let s;if(this.peek().type==="ident"){let o=this.peek().value,a=this.pos+1;a0&&this.peek().type===","&&this.advance(),n.push(this.parseExpr(0));while(this.peek().type===",");return this.expect("]"),{type:"list",elements:n}}parseMap(){this.expect("{");let n=[];if(this.peek().type!=="}")do{n.length>0&&this.peek().type===","&&this.advance();let t;if(this.peek().type==="ident")t=this.peek().value,this.advance();else if(this.peek().type==="string")t=this.peek().value,this.advance();else throw new Error(`Expected map key, got ${this.peek().type}`);this.expect(":");let s=this.parseExpr(0);n.push({key:t,value:s})}while(this.peek().type===",");return this.expect("}"),{type:"map",entries:n}}parseInfix(n,t){let s=this.peek(),o=new Map([["+","add"],["-","sub"],["*","mul"],["/","div"],["//","idiv"],["%","mod"],["**","pow"],["++","concat"],["==","=="],["!=","!="],["<","<"],["<=","<="],[">",">"],[">=",">="],["eq","eq"],["ne","ne"],["lt","lt"],["le","le"],["gt","gt"],["ge","ge"],["&&","and"],["and","and"],["||","or"],["or","or"]]).get(s.type);if(o!==void 0){this.advance();let a=this.parseExpr(t+(this.isRightAssoc(s.type)?0:1));return{type:"func",name:o,args:[{expr:n},{expr:a}]}}if(s.type==="|"){this.advance();let a=this.parseExpr(t);return this.handlePipe(n,a)}if(s.type===".")return this.advance(),this.handleDot(n);if(s.type==="[")return this.advance(),this.handleIndexing(n);if(s.type==="in")return this.advance(),{type:"func",name:"contains",args:[{expr:this.parseExpr(t+1)},{expr:n}]};if(s.type==="not in")return this.advance(),{type:"func",name:"not",args:[{expr:{type:"func",name:"contains",args:[{expr:this.parseExpr(t+1)},{expr:n}]}}]};throw new Error(`Unexpected infix token: ${s.type}`)}handlePipe(n,t){if(t.type==="identifier")return{type:"func",name:t.name,args:[{expr:n}]};if(t.type==="func"){let s=this.countUnderscores(t);return s===0?t:s===1?this.fillUnderscore(t,n):{type:"pipeline",exprs:[n,t]}}return this.countUnderscores(t)===1?this.fillUnderscore(t,n):t}handleDot(n){let t=this.peek();if(t.type==="ident"){let s=t.value;if(this.advance(),this.peek().type==="("){let r=this.parseFunctionCall(s);return r.type==="func"&&r.args.unshift({expr:n}),r}return{type:"func",name:"get",args:[{expr:n},{expr:{type:"string",value:s}}]}}if(t.type==="int"){let s=Number.parseInt(t.value,10);return this.advance(),{type:"func",name:"get",args:[{expr:n},{expr:{type:"int",value:s}}]}}if(t.type==="string"){let s=t.value;return this.advance(),{type:"func",name:"get",args:[{expr:n},{expr:{type:"string",value:s}}]}}throw new Error(`Expected identifier, number, or string after dot, got ${t.type}`)}handleIndexing(n){if(this.peek().type===":"){if(this.advance(),this.peek().type==="]")return this.advance(),{type:"func",name:"slice",args:[{expr:n}]};let s=this.parseExpr(0);return this.expect("]"),{type:"func",name:"slice",args:[{expr:n},{expr:{type:"int",value:0}},{expr:s}]}}let t=this.parseExpr(0);if(this.peek().type===":"){if(this.advance(),this.peek().type==="]")return this.advance(),{type:"func",name:"slice",args:[{expr:n},{expr:t}]};let s=this.parseExpr(0);return this.expect("]"),{type:"func",name:"slice",args:[{expr:n},{expr:t},{expr:s}]}}return this.expect("]"),{type:"func",name:"get",args:[{expr:n},{expr:t}]}}countUnderscores(n){return n.type==="underscore"?1:n.type==="func"?n.args.reduce((t,s)=>t+this.countUnderscores(s.expr),0):n.type==="list"?n.elements.reduce((t,s)=>t+this.countUnderscores(s),0):n.type==="map"?n.entries.reduce((t,s)=>t+this.countUnderscores(s.value),0):0}fillUnderscore(n,t){return n.type==="underscore"?t:n.type==="func"?{...n,args:n.args.map(s=>({...s,expr:this.fillUnderscore(s.expr,t)}))}:n.type==="list"?{...n,elements:n.elements.map(s=>this.fillUnderscore(s,t))}:n.type==="map"?{...n,entries:n.entries.map(s=>({...s,value:this.fillUnderscore(s.value,t)}))}:n}bindLambdaArgs(n,t){return{...n,body:this.bindLambdaArgsInExpr(n.body,t)}}bindLambdaArgsInExpr(n,t){return n.type==="identifier"&&t.includes(n.name)?{type:"lambdaBinding",name:n.name}:n.type==="func"?{...n,args:n.args.map(s=>({...s,expr:this.bindLambdaArgsInExpr(s.expr,t)}))}:n.type==="list"?{...n,elements:n.elements.map(s=>this.bindLambdaArgsInExpr(s,t))}:n.type==="map"?{...n,entries:n.entries.map(s=>({...s,value:this.bindLambdaArgsInExpr(s.value,t)}))}:n}getInfixPrec(n){switch(n){case"|":return R.PIPE;case"||":case"or":return R.OR;case"&&":case"and":return R.AND;case"==":case"!=":case"eq":case"ne":return R.EQUALITY;case"<":case"<=":case">":case">=":case"lt":case"le":case"gt":case"ge":case"in":case"not in":return R.COMPARISON;case"+":case"-":case"++":return R.ADDITIVE;case"*":case"/":case"//":case"%":return R.MULTIPLICATIVE;case"**":return R.POWER;case".":case"[":return R.POSTFIX;default:return-1}}isRightAssoc(n){return n==="**"}peek(){return this.tokens[this.pos]||{type:"eof",value:"",pos:0}}peekAt(n){return this.tokens[this.pos+n]||{type:"eof",value:"",pos:0}}advance(){return this.tokens[this.pos++]}expect(n){let t=this.peek();if(t.type!==n)throw new Error(`Expected ${n}, got ${t.type}`);return this.advance()}}});V();function E(e,n){return n.length===0?I(e,[]):n.length===1?{type:"Pipe",left:n[0],right:I(e,[])}:{type:"Pipe",left:n[0],right:I(e,n.slice(1))}}var K={add:e=>S("+",e[0],e[1]),sub:e=>S("-",e[0],e[1]),mul:e=>S("*",e[0],e[1]),div:e=>S("/",e[0],e[1]),mod:e=>S("%",e[0],e[1]),idiv:e=>I("floor",[S("/",e[0],e[1])]),pow:e=>E("pow",e),neg:e=>({type:"UnaryOp",op:"-",operand:e[0]}),"==":e=>S("==",e[0],e[1]),"!=":e=>S("!=",e[0],e[1]),"<":e=>S("<",e[0],e[1]),"<=":e=>S("<=",e[0],e[1]),">":e=>S(">",e[0],e[1]),">=":e=>S(">=",e[0],e[1]),eq:e=>S("==",P(e[0]),P(e[1])),ne:e=>S("!=",P(e[0]),P(e[1])),lt:e=>S("<",P(e[0]),P(e[1])),le:e=>S("<=",P(e[0]),P(e[1])),gt:e=>S(">",P(e[0]),P(e[1])),ge:e=>S(">=",P(e[0]),P(e[1])),and:e=>S("and",e[0],e[1]),or:e=>S("or",e[0],e[1]),not:e=>({type:"UnaryOp",op:"not",operand:e[0]}),len:e=>E("length",e),length:e=>E("length",e),upper:e=>E("ascii_upcase",e),lower:e=>E("ascii_downcase",e),trim:e=>E("trim",e),ltrim:e=>e.length===0?I("ltrimstr",[{type:"Literal",value:" "}]):{type:"Pipe",left:e[0],right:I("ltrimstr",[{type:"Literal",value:" "}])},rtrim:e=>e.length===0?I("rtrimstr",[{type:"Literal",value:" "}]):{type:"Pipe",left:e[0],right:I("rtrimstr",[{type:"Literal",value:" "}])},split:e=>E("split",e),join:e=>e.length===1?I("join",[{type:"Literal",value:""}]):E("join",e),concat:e=>S("+",e[0],e[1]),startswith:e=>E("startswith",e),endswith:e=>E("endswith",e),contains:e=>E("contains",e),replace:e=>E("gsub",e),substr:e=>e.length===2?{type:"Slice",base:e[0],start:e[1]}:{type:"Slice",base:e[0],start:e[1],end:S("+",e[1],e[2])},abs:e=>E("fabs",e),floor:e=>E("floor",e),ceil:e=>E("ceil",e),round:e=>E("round",e),sqrt:e=>E("sqrt",e),log:e=>E("log",e),log10:e=>E("log10",e),log2:e=>E("log2",e),exp:e=>E("exp",e),sin:e=>E("sin",e),cos:e=>E("cos",e),tan:e=>E("tan",e),asin:e=>E("asin",e),acos:e=>E("acos",e),atan:e=>E("atan",e),min:e=>E("min",e),max:e=>E("max",e),first:e=>e.length===0?{type:"Index",index:{type:"Literal",value:0}}:{type:"Index",index:{type:"Literal",value:0},base:e[0]},last:e=>e.length===0?{type:"Index",index:{type:"Literal",value:-1}}:{type:"Index",index:{type:"Literal",value:-1},base:e[0]},get:e=>e.length===1?{type:"Index",index:e[0]}:{type:"Index",index:e[1],base:e[0]},slice:e=>e.length===1?{type:"Slice",base:e[0]}:e.length===2?{type:"Slice",base:e[0],start:e[1]}:{type:"Slice",base:e[0],start:e[1],end:e[2]},keys:"keys",values:"values",entries:e=>I("to_entries",e),from_entries:"from_entries",reverse:"reverse",sort:"sort",sort_by:"sort_by",group_by:"group_by",unique:"unique",unique_by:"unique_by",flatten:"flatten",map:e=>({type:"Pipe",left:e[0],right:{type:"Array",elements:e[1]}}),select:e=>I("select",e),empty:()=>I("empty",[]),count:()=>I("length",[]),sum:e=>e.length===0?I("add",[]):{type:"Pipe",left:{type:"Array",elements:e[0]},right:I("add",[])},mean:e=>e.length===0?{type:"Pipe",left:{type:"Identity"},right:S("/",I("add",[]),I("length",[]))}:{type:"Pipe",left:{type:"Array",elements:e[0]},right:S("/",I("add",[]),I("length",[]))},avg:e=>e.length===0?{type:"Pipe",left:{type:"Identity"},right:S("/",I("add",[]),I("length",[]))}:{type:"Pipe",left:{type:"Array",elements:e[0]},right:S("/",I("add",[]),I("length",[]))},type:"type",isnull:e=>e.length===0?S("==",{type:"Identity"},{type:"Literal",value:null}):S("==",e[0],{type:"Literal",value:null}),isempty:e=>e.length===0?S("==",{type:"Identity"},{type:"Literal",value:""}):S("==",e[0],{type:"Literal",value:""}),tonumber:e=>e.length===0?I("tonumber",[]):I("tonumber",e),tostring:e=>e.length===0?I("tostring",[]):I("tostring",e),if:e=>Ke(e[0],e[1],e[2]),coalesce:e=>{if(e.length===0)return{type:"Literal",value:null};if(e.length===1)return e[0];let[n,...t]=e,s=S("and",S("!=",n,{type:"Literal",value:null}),S("!=",n,{type:"Literal",value:""}));return Ke(s,n,t.length===1?t[0]:K.coalesce(t))},index:()=>({type:"Field",name:"_row_index"}),now:()=>I("now",[]),fmt:e=>I("tostring",e),format:e=>I("tostring",e)};Object.setPrototypeOf(K,null);function S(e,n,t){return{type:"BinaryOp",op:e,left:n,right:t}}function I(e,n){return{type:"Call",name:e,args:n}}var rt="then";function Ke(e,n,t){let s=qe({type:"Cond",cond:e,elifs:[],else:t||{type:"Literal",value:null}});return s[rt]=n,s}function P(e){return{type:"Pipe",left:e,right:{type:"Call",name:"tostring",args:[]}}}function O(e,n=!0){switch(e.type){case"int":case"float":return{type:"Literal",value:e.value};case"string":return{type:"Literal",value:e.value};case"bool":return{type:"Literal",value:e.value};case"null":return{type:"Literal",value:null};case"underscore":return{type:"Index",base:{type:"Identity"},index:{type:"Literal",value:"_"}};case"identifier":return n?{type:"Field",name:e.name}:{type:"VarRef",name:e.name};case"lambdaBinding":return{type:"VarRef",name:e.name};case"func":{let t=e.args.map(r=>O(r.expr,n)),s=Object.hasOwn(K,e.name)?K[e.name]:void 0;return typeof s=="function"?s(t):I(typeof s=="string"?s:e.name,t)}case"list":return e.elements.length===0?{type:"Array"}:{type:"Array",elements:e.elements.reduce((t,s,r)=>{let o=O(s,n);return r===0?o:{type:"Comma",left:t,right:o}},null)};case"map":return{type:"Object",entries:e.entries.map(t=>({key:t.key,value:O(t.value,n)}))};case"regex":return{type:"Literal",value:e.pattern};case"slice":return{type:"Slice",start:e.start?O(e.start,n):void 0,end:e.end?O(e.end,n):void 0};case"lambda":return O(e.body,n);case"pipeline":return{type:"Identity"};default:throw new Error(`Unknown moonblade expression type: ${e.type}`)}}function ee(e){let n=[],t=0;for(;t=e.length)break;let s=t;for(;t0;)e[t]==="("?o++:e[t]===")"&&o--,o>0&&t++;let d=e.slice(a,t).trim();for(t++;t0?r[0]:null}function te(e,n,t={}){let{func:s,expr:r}=n;if(s==="count"&&!r)return e.length;let o;switch(Be(r)?o=e.map(a=>a[r]).filter(a=>a!=null):o=e.map(a=>Q(a,r,t)).filter(a=>a!=null),s){case"count":return Be(r)?o.length:o.filter(a=>!!a).length;case"sum":return o.map(d=>typeof d=="number"?d:Number.parseFloat(String(d))).reduce((d,u)=>d+u,0);case"mean":case"avg":{let a=o.map(d=>typeof d=="number"?d:Number.parseFloat(String(d)));return a.length>0?a.reduce((d,u)=>d+u,0)/a.length:0}case"min":{let a=o.map(d=>typeof d=="number"?d:Number.parseFloat(String(d)));return a.length>0?Math.min(...a):null}case"max":{let a=o.map(d=>typeof d=="number"?d:Number.parseFloat(String(d)));return a.length>0?Math.max(...a):null}case"first":return o.length>0?o[0]:null;case"last":return o.length>0?o[o.length-1]:null;case"median":{let a=o.map(u=>typeof u=="number"?u:Number.parseFloat(String(u))).filter(u=>!Number.isNaN(u)).sort((u,p)=>u-p);if(a.length===0)return null;let d=Math.floor(a.length/2);return a.length%2===0?(a[d-1]+a[d])/2:a[d]}case"mode":{let a=new Map;for(let p of o){let c=String(p);a.set(c,(a.get(c)||0)+1)}let d=0,u=null;for(let[p,c]of a)c>d&&(d=c,u=p);return u}case"cardinality":return new Set(o.map(d=>String(d))).size;case"values":return o.map(a=>String(a)).join("|");case"distinct_values":return[...new Set(o.map(d=>String(d)))].sort().join("|");case"all":{if(e.length===0)return!0;for(let a of e)if(!Q(a,r,t))return!1;return!0}case"any":{for(let a of e)if(Q(a,r,t))return!0;return!1}default:return null}}function Ge(e,n,t={}){let s=F();for(let r of n)b(s,r.alias,te(e,r,t));return s}async function ne(e,n){let t="",s=[];for(let c of e)c.startsWith("-")||(t?s.push(c):t=c);if(!t)return{stdout:"",stderr:`xan agg: no aggregation expression -`,exitCode:1};let{data:r,error:o}=await v(s,n);if(o)return o;let a={limits:n.limits?{maxIterations:n.limits.maxJqIterations}:void 0},d=ee(t),u=d.map(c=>c.alias),p=Ge(r,d,a);return{stdout:w(u,[p]),stderr:"",exitCode:0}}async function se(e,n){let t="",s="",r=[];for(let f=0;fString(f[g])).join("\0");h.has(m)||(h.set(m,[]),c.push(m)),h.get(m)?.push(f)}let l=[...u,...p.map(f=>f.alias)],i=[];for(let f of c){let m=h.get(f);if(!m)continue;let g=F();for(let y of u)b(g,y,m[0][y]);for(let y of p)b(g,y.alias,te(m,y,d));i.push(g)}return{stdout:w(l,i),stderr:"",exitCode:0}}async function re(e,n){let t=[],s="",r=10,o=!1,a=[];for(let i=0;i0?t:d.filter(i=>i!==s);s&&t.length===0&&(c=d.filter(i=>i!==s));let h=[],l=s?["field",s,"value","count"]:["field","value","count"];if(s){let i=new Map;for(let f of u){let m=String(f[s]??"");i.has(m)||i.set(m,[]),i.get(m)?.push(f)}for(let f of c)for(let[m,g]of i){let y=new Map;for(let k of g){let N=k[f],C=N===""||N===null||N===void 0?"":String(N);y.set(C,(y.get(C)||0)+1)}let x=[...y.entries()].sort((k,N)=>N[1]!==k[1]?N[1]-k[1]:k[0].localeCompare(N[0]));o&&(x=x.filter(([k])=>k!=="")),r>0&&(x=x.slice(0,r));for(let[k,N]of x)h.push({field:f,[s]:m,value:k===""?"":k,count:N})}}else for(let i of c){let f=new Map;for(let g of u){let y=g[i],x=y===""||y===null||y===void 0?"":String(y);f.set(x,(f.get(x)||0)+1)}let m=[...f.entries()].sort((g,y)=>y[1]!==g[1]?y[1]-g[1]:g[0].localeCompare(y[0]));o&&(m=m.filter(([g])=>g!=="")),r>0&&(m=m.slice(0,r));for(let[g,y]of m)h.push({field:i,value:g===""?"":g,count:y})}return{stdout:w(l,h),stderr:"",exitCode:0}}async function oe(e,n){let t=[],s=[];for(let c=0;c0?t:r,u=["field","type","count","min","max","mean"],p=[];for(let c of d){let h=o.map(f=>f[c]).filter(f=>f!=null),l=h.map(f=>typeof f=="number"?f:Number.parseFloat(String(f))).filter(f=>!Number.isNaN(f)),i=l.length===h.length&&l.length>0;p.push({field:c,type:i?"Number":"String",count:h.length,min:i?Math.min(...l):"",max:i?Math.max(...l):"",mean:i?Math.round(l.reduce((f,m)=>f+m,0)/l.length*1e10)/1e10:""})}return{stdout:w(u,p),stderr:"",exitCode:0}}V();function Xe(e){let n=H(e);return O(n)}function ot(e){let t=e.replace(/[.+?^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*");return J(`^${t}$`)}function B(e,n){let t=[],s=new Set;for(let r of e.split(",")){let o=r.trim();if(o.startsWith("!")){let p=o.slice(1),c=B(p,n);for(let h of c)s.add(h);continue}if(o==="*"){for(let p of n)t.includes(p)||t.push(p);continue}if(o.includes("*")){let p=ot(o);for(let c of n)p.test(c)&&!t.includes(c)&&t.push(c);continue}let a=o.match(/^([^:]*):([^:]*)$/);if(a&&(a[1]||a[2])){let p=a[1],c=a[2],h=p?n.indexOf(p):0,l=c?n.indexOf(c):n.length-1;if(h!==-1&&l!==-1){let i=h<=l?1:-1;for(let f=h;i>0?f<=l:f>=l;f+=i)t.includes(n[f])||t.push(n[f])}continue}let d=o.match(/^(\d+)-(\d+)$/);if(d){let p=Number.parseInt(d[1],10),c=Number.parseInt(d[2],10);for(let h=p;h<=c&&h=0&&u0?t.filter(r=>!s.has(r)):t}async function ie(e,n){let t="",s=[];for(let p of e)p.startsWith("-")||(t?s.push(p):t=p);if(!t)return{stdout:"",stderr:`xan select: no columns specified -`,exitCode:1};let{headers:r,data:o,error:a}=await v(s,n);if(a)return a;let d=B(t,r),u=o.map(p=>{let c=F();for(let h of d)b(c,h,p[h]);return c});return{stdout:w(d,u),stderr:"",exitCode:0}}async function ae(e,n){let t="",s=[];for(let c of e)c.startsWith("-")||(t?s.push(c):t=c);if(!t)return{stdout:"",stderr:`xan drop: no columns specified -`,exitCode:1};let{headers:r,data:o,error:a}=await v(s,n);if(a)return a;let d=new Set(B(t,r)),u=r.filter(c=>!d.has(c)),p=o.map(c=>{let h=F();for(let l of u)b(h,l,c[l]);return h});return{stdout:w(u,p),stderr:"",exitCode:0}}async function le(e,n){let t="",s="",r=[];for(let c=0;cl.get(i)||i)}else{let c=t.split(",");u=o.map((h,l)=>l{let h=F();for(let l=0;l{let h=F();b(h,t,c);for(let l of r)b(h,l,p[l]);return h});return{stdout:w(d,u),stderr:"",exitCode:0}}async function ce(e,n){let t=e.includes("-j")||e.includes("--just-names"),{headers:s,error:r}=await v(e.filter(a=>a!=="-j"&&a!=="--just-names"),n);return r||{stdout:t?`${s.map(a=>a).join(` -`)} -`:`${s.map((a,d)=>`${d} ${a}`).join(` -`)} -`,stderr:"",exitCode:0}}async function pe(e,n){let{data:t,error:s}=await v(e,n);return s||{stdout:`${t.length} -`,stderr:"",exitCode:0}}async function fe(e,n){let t=10,s=[];for(let u=0;u!p.startsWith("-")),{headers:s,data:r,error:o}=await v(t,n);if(o)return o;if(r.length===0){let p=["column"],c=s.map(h=>({column:h}));return{stdout:w(p,c),stderr:"",exitCode:0}}let a=s[0],d=[a,...r.map((p,c)=>String(p[a]??`row_${c}`))],u=[];for(let p=1;p(d=d*1103515245+12345&2147483647,d/2147483647),p=[...o];for(let c=p.length-1;c>0;c--){let h=Math.floor(u()*(c+1));[p[c],p[h]]=[p[h],p[c]]}return{stdout:w(r,p),stderr:"",exitCode:0}}async function we(e,n){let t=null,s="",r=[];for(let i=0;ii.length)),c=t??p,h=u.map(i=>i.length===c?i:i.lengthl.length>0),h=o[0]?.replace(/\.csv$/,"")||"part";try{let l=n.fs.resolvePath(n.cwd,r);for(let i=0;i`Part ${f+1}: ${i.length} rows`).join(` -`)} -`,stderr:"",exitCode:0}}}function Ye(e){return e.replace(/[^a-zA-Z0-9_-]/g,"_")||"empty"}function it(e){let n=2166136261;for(let t=0;t>>0;return n.toString(36).padStart(6,"0").slice(0,6)}async function Ce(e,n){let t="",s=".",r=[];for(let l=0;l1?`${i}_${it(l)}`:i,g=`${m}.csv`,y=1;for(;c.has(g);)g=`${m}_${y}.csv`,y++;c.add(g),h.set(l,g)}try{let l=n.fs.resolvePath(n.cwd,s);for(let[i,f]of u){let m=h.get(i);if(!m)continue;let g=n.fs.resolvePath(l,m);await n.fs.writeFile(g,w(o,f))}return{stdout:`Partitioned into ${u.size} files by '${t}' -`,stderr:"",exitCode:0}}catch{return{stdout:`${Array.from(u.entries()).map(([i,f])=>`${i}: ${f.length} rows`).join(` -`)} -`,stderr:"",exitCode:0}}}async function be(e,n){if(e.length===0)return{stdout:"",stderr:`xan to: usage: xan to [FILE] -`,exitCode:1};let t=e[0],s=e.slice(1);return t==="json"?at(s,n):{stdout:"",stderr:`xan to: unsupported format '${t}' -`,exitCode:1}}async function at(e,n){let t=e.filter(a=>!a.startsWith("-")),{data:s,error:r}=await v(t,n);return r||{stdout:`${JSON.stringify(s,null,2)} -`,stderr:"",exitCode:0}}async function Se(e,n){let t="",s=[];for(let r=0;r [FILE] -`,exitCode:1}}async function lt(e,n){let t=e[0],s;if(!t||t==="-")s=_(n.stdin);else try{let r=n.fs.resolvePath(n.cwd,t);s=await n.fs.readFile(r)}catch{return{stdout:"",stderr:`xan from: ${t}: No such file or directory -`,exitCode:1}}try{let r=JSON.parse(s.trim());if(!Array.isArray(r))return{stdout:"",stderr:`xan from: JSON input must be an array -`,exitCode:1};if(r.length===0)return{stdout:` -`,stderr:"",exitCode:0};if(Array.isArray(r[0])){let[a,...d]=r,u=d.map(p=>{let c=F();for(let h=0;h0&&h.length>=s)break;let i=$(l,c,p),f=i.length>0&&i.some(m=>!!m);(t?!f:f)&&h.push(l)}return{stdout:w(a,h),stderr:"",exitCode:0}}async function Ie(e,n){let t="",s=!1,r=!1,o=[];for(let c=0;c0&&(t=a[0]);let p=[...d].sort((c,h)=>{let l=c[t],i=h[t],f;if(s){let m=typeof l=="number"?l:Number.parseFloat(String(l)),g=typeof i=="number"?i:Number.parseFloat(String(i));f=m-g}else f=String(l).localeCompare(String(i));return r?-f:f});return{stdout:w(a,p),stderr:"",exitCode:0}}async function Ne(e,n){let t="",s=[];for(let p=0;p{let c=t?String(p[t]):JSON.stringify(p);return d.has(c)?!1:(d.add(c),!0)});return{stdout:w(r,u),stderr:"",exitCode:0}}async function Ee(e,n){let t=10,s="",r=!1,o=[];for(let h=0;h0&&(s=a[0]);let c=[...d].sort((h,l)=>{let i=h[s],f=l[s],m=typeof i=="number"?i:Number.parseFloat(String(i)),g=typeof f=="number"?f:Number.parseFloat(String(f));return r?m-g:g-m}).slice(0,t);return{stdout:w(a,c),stderr:"",exitCode:0}}V();async function Ae(e,n){let t="",s=!1,r=!1,o=[];for(let f=0;f({alias:typeof m=="string"?m:m[0],ast:O(f)})),h={limits:n.limits?{maxIterations:n.limits.maxJqIterations}:void 0},l;if(s){l=[...a];for(let f of c)a.includes(f.alias)||l.push(f.alias)}else l=[...a,...c.map(f=>f.alias)];let i=[];for(let f=0;f0?N[0]:null;if(r&&C==null){y=!0;break}b(g,k.alias,C)}y||i.push(g)}return{stdout:w(l,i),stderr:"",exitCode:0}}async function Fe(e,n){let t="",s="",r="",o=[];for(let m=0;mm.trim()),c=r?r.split(",").map(m=>m.trim()):[];for(let m of p)if(!a.includes(m))return{stdout:"",stderr:`xan transform: column '${m}' not found -`,exitCode:1};let h=O(U(s)[0]?.expr||(V(),nt(ze)).parseMoonblade(s)),l={limits:n.limits?{maxIterations:n.limits.maxJqIterations}:void 0},i=a.map(m=>{let g=p.indexOf(m);return g!==-1&&c[g]?c[g]:m}),f=[];for(let m of d){let g=M(m);for(let y=0;y0?N[0]:null,A=c[y]||x;A!==x&&delete g[x],b(g,A,C)}f.push(g)}return{stdout:w(i,f),stderr:"",exitCode:0}}async function Oe(e,n){let t="",s="|",r=!1,o="",a=[];for(let i=0;ii===t?o:i):d,h=o||t,l=[];for(let i of u){let f=i[t],m=f==null?"":String(f);if(m===""){if(!r){let g=M(i);o&&(delete g[t],b(g,h,"")),l.push(g)}}else{let g=m.split(s);for(let y of g){let x=M(i);o&&delete x[t],b(x,h,y),l.push(x)}}}return{stdout:w(c,l),stderr:"",exitCode:0}}async function Le(e,n){let t="",s="|",r="",o=[];for(let g=0;gg!==t),c=r?a.map(g=>g===t?r:g):a,h=r||t,l=[],i=null,f=[],m=null;for(let g of d){let y=p.map(N=>String(g[N]??"")).join("\0"),x=g[t],k=x==null?"":String(x);if(y!==i){if(m!==null){let N=M(m);r&&delete N[t],b(N,h,f.join(s)),l.push(N)}i=y,f=[k],m=g}else f.push(k)}if(m!==null){let g=M(m);r&&delete g[t],b(g,h,f.join(s)),l.push(g)}return{stdout:w(c,l),stderr:"",exitCode:0}}async function Pe(e,n){let t="",s="",r="",o="",a="inner",d="",u=0;for(let C=0;C!g.has(C)),x=[...h,...y],k=[],N=new Set;for(let C of l){let A=String(C[t]??""),j=m.get(A);if(j&&j.length>0){N.add(A);for(let L of j){let T=F();for(let W of h)b(T,W,C[W]);for(let W of y)b(T,W,L[W]);k.push(T)}}else if(a==="left"||a==="full"){let L=F();for(let T of h)b(L,T,C[T]);for(let T of y)b(L,T,d);k.push(L)}}if(a==="right"||a==="full")for(let C of f){let A=String(C[r]??"");if(!N.has(A)){let j=F();for(let L of h)b(j,L,i.includes(L)?C[L]:d);for(let L of y)b(j,L,C[L]);k.push(j)}}return{stdout:w(x,k),stderr:"",exitCode:0}}async function Re(e,n){let t="",s="",r=[],o=[];for(let y=0;yk.trim()):x.startsWith("-")||(t?s?o.push(x):s=x:t=x)}if(!t||!s)return{stdout:"",stderr:`xan pivot: usage: xan pivot COLUMN AGG_EXPR [OPTIONS] [FILE] -`,exitCode:1};let{headers:a,data:d,error:u}=await v(o,n);if(u)return u;if(!a.includes(t))return{stdout:"",stderr:`xan pivot: column '${t}' not found -`,exitCode:1};let p=s.match(/^(\w+)\((\w+)\)$/);if(!p)return{stdout:"",stderr:`xan pivot: invalid aggregation expression '${s}' -`,exitCode:1};let[,c,h]=p;r.length===0&&(r=a.filter(y=>y!==t&&y!==h));let l=[];for(let y of d){let x=String(y[t]??"");l.includes(x)||l.push(x)}let i=new Map,f=[];for(let y of d){let x=r.map(A=>String(y[A]??"")).join("\0"),k=String(y[t]??""),N=y[h];i.has(x)||(i.set(x,new Map),f.push(x));let C=i.get(x);C&&(C.has(k)||C.set(k,[]),C.get(k)?.push(N))}let m=[...r,...l],g=[];for(let y of f){let x=y.split("\0"),k=i.get(y);if(!k)continue;let N=F();for(let C=0;Cs!=null).map(s=>typeof s=="number"?s:Number.parseFloat(String(s))).filter(s=>!Number.isNaN(s));switch(e){case"count":return n.length;case"sum":return t.reduce((s,r)=>s+r,0);case"mean":case"avg":return t.length>0?t.reduce((s,r)=>s+r,0)/t.length:null;case"min":return t.length>0?Math.min(...t):null;case"max":return t.length>0?Math.max(...t):null;case"first":return n.length>0?String(n[0]??""):null;case"last":return n.length>0?String(n[n.length-1]??""):null;default:return null}}async function Me(e,n){let t="",s=[];for(let d=0;d{let p=d[t],c=u[t],h=typeof p=="number"?p:Number.parseFloat(String(p)),l=typeof c=="number"?c:Number.parseFloat(String(c));return!Number.isNaN(h)&&!Number.isNaN(l)?h-l:String(p??"").localeCompare(String(c??""))})}return{stdout:w(o,a),stderr:"",exitCode:0}}V();async function $e(e,n){let t=e.filter(u=>!u.startsWith("-")),{headers:s,data:r,error:o}=await v(t,n);return o||(r.length===0?{stdout:"",stderr:"",exitCode:0}:{stdout:r.map(u=>s.map(p=>u[p])).map(u=>u.map(p=>ct(p)).join(",")).join(` -`)+` -`,stderr:"",exitCode:0})}function ct(e){if(e==null)return"";let n=String(e);return n.includes(",")||n.includes('"')||n.includes(` -`)?`"${n.replace(/"/g,'""')}"`:n}async function Te(e,n){let t=null,s=null,r=[];for(let l=0;l0?t=f:r.push(i)}}if(t===null)return{stdout:"",stderr:`xan sample: usage: xan sample [FILE] -`,exitCode:1};let{headers:o,data:a,error:d}=await v(r,n);if(d)return d;if(a.length<=t)return{stdout:w(o,a),stderr:"",exitCode:0};let u=s!==null?s:Date.now(),p=()=>(u=u*1103515245+12345&2147483647,u/2147483647),c=a.map((l,i)=>i);for(let l=c.length-1;l>0;l--){let i=Math.floor(p()*(l+1));[c[l],c[i]]=[c[i],c[l]]}let h=c.slice(0,t).sort((l,i)=>l-i).map(l=>a[l]);return{stdout:w(o,h),stderr:"",exitCode:0}}async function je(e,n){let t=!1,s=[];for(let u=0;u0?s:d,h;try{h=J(t,o?"i":"")}catch{return{stdout:"",stderr:`xan search: invalid regex pattern '${t}' -`,exitCode:1}}let l=u.filter(i=>{let f=c.some(m=>{let g=i[m];return g!=null&&h.test(String(g))});return r?!f:f});return{stdout:w(d,l),stderr:"",exitCode:0}}async function Ue(e,n){let t="",s=[];for(let l of e)l.startsWith("-")||(t?s.push(l):t=l);if(!t)return{stdout:"",stderr:`xan flatmap: no expression specified -`,exitCode:1};let{headers:r,data:o,error:a}=await v(s,n);if(a)return a;let u=U(t).map(({expr:l,name:i})=>({alias:typeof i=="string"?i:i[0],ast:O(l)})),p={limits:n.limits?{maxIterations:n.limits.maxJqIterations}:void 0},c=[...r,...u.map(l=>l.alias)],h=[];for(let l of o){let i=[],f=1;for(let m of u){let g=$(l,m.ast,p),y=g.length>0&&Array.isArray(g[0])?g[0]:g;i.push(y),f=Math.max(f,y.length)}for(let m=0;m [OPTIONS] [FILE]",description:`xan is a collection of commands for working with CSV data. -It provides a simple, ergonomic interface for common data operations. - -COMMANDS: - Core: - headers Show column names - count Count rows - head Show first N rows - tail Show last N rows - slice Extract row range - reverse Reverse row order - behead Remove header row - sample Random sample of rows - - Column operations: - select Select columns (supports glob, ranges, negation) - drop Drop columns - rename Rename columns - enum Add row index column - - Row operations: - filter Filter rows by expression - search Filter rows by regex match - sort Sort rows - dedup Remove duplicates - top Get top N by column - - Transformations: - map Add computed columns - transform Modify existing columns - explode Split column into multiple rows - implode Combine rows, join column values - flatmap Map returning multiple rows - pivot Reshape rows into columns - transpose Swap rows and columns - - Aggregation: - agg Aggregate values - groupby Group and aggregate - frequency Count value occurrences - stats Show column statistics - - Multi-file: - cat Concatenate CSV files - join Join two CSV files on key - merge Merge sorted CSV files - split Split into multiple files - partition Split by column value - - Data conversion: - to Convert CSV to other formats (json) - from Convert other formats to CSV (json) - shuffle Randomly reorder rows - fixlengths Fix ragged CSV files - - Output: - view Pretty print as table - flatten Display records vertically (alias: f) - fmt Format output - -EXAMPLES: - xan headers data.csv - xan count data.csv - xan head -n 5 data.csv - xan select name,email data.csv - xan select 'vec_*' data.csv # glob pattern - xan select 'a:c' data.csv # column range - xan filter 'age > 30' data.csv - xan search -r '^foo' data.csv - xan sort -N price data.csv - xan agg 'sum(amount) as total' data.csv - xan groupby region 'count() as n' data.csv - xan explode tags data.csv - xan join id file1.csv id file2.csv - xan pivot year 'sum(sales)' data.csv`,options:[" --help display this help and exit"]},ft={headers:{name:"xan headers",summary:"Show column names",usage:"xan headers [OPTIONS] [FILE]",description:"Display column names from a CSV file.",options:["-j, --just-names show names only (no index)"]},count:{name:"xan count",summary:"Count rows",usage:"xan count [FILE]",description:"Count the number of data rows (excluding header).",options:[]},filter:{name:"xan filter",summary:"Filter rows by expression",usage:"xan filter [OPTIONS] EXPR [FILE]",description:"Filter CSV rows using moonblade expressions.",options:["-v, --invert invert match","-l, --limit N limit output rows"]},search:{name:"xan search",summary:"Filter rows by regex",usage:"xan search [OPTIONS] PATTERN [FILE]",description:"Filter CSV rows by regex match on columns.",options:["-s, --select COLS search only these columns","-v, --invert invert match","-i, --ignore-case case insensitive"]},select:{name:"xan select",summary:"Select columns",usage:"xan select COLS [FILE]",description:"Select columns by name, index, glob, or range.",options:["Supports: col names, indices (0,1), ranges (a:c), globs (vec_*), negation (!col)"]},explode:{name:"xan explode",summary:"Split column into rows",usage:"xan explode COLUMN [OPTIONS] [FILE]",description:"Split delimited column values into multiple rows.",options:["-s, --separator SEP separator (default: |)","--drop-empty drop empty values","-r, --rename NAME rename column"]},implode:{name:"xan implode",summary:"Combine rows",usage:"xan implode COLUMN [OPTIONS] [FILE]",description:"Combine consecutive rows, joining column values.",options:["-s, --sep SEP separator (default: |)","-r, --rename NAME rename column"]},join:{name:"xan join",summary:"Join CSV files",usage:"xan join KEY1 FILE1 KEY2 FILE2 [OPTIONS]",description:"Join two CSV files on key columns.",options:["--left left outer join","--right right outer join","--full full outer join","-D, --default VAL default for missing"]},pivot:{name:"xan pivot",summary:"Reshape to columns",usage:"xan pivot COLUMN AGG_EXPR [OPTIONS] [FILE]",description:"Turn row values into columns.",options:["-g, --groupby COLS group by columns"]}},yn={name:"xan",async execute(e,n){if(e.length===0||G(e))return D(Ze);let t=e[0],s=e.slice(1);if(G(s)){let r=ft[t];return r?D(r):D(Ze)}if(Qe.has(t))return{stdout:"",stderr:`xan ${t}: not yet implemented -`,exitCode:1};switch(t){case"headers":return ce(s,n);case"count":return pe(s,n);case"head":return fe(s,n);case"tail":return de(s,n);case"slice":return he(s,n);case"reverse":return me(s,n);case"behead":return $e(s,n);case"sample":return Te(s,n);case"select":return ie(s,n);case"drop":return ae(s,n);case"rename":return le(s,n);case"enum":return ue(s,n);case"filter":return ke(s,n);case"search":return De(s,n);case"sort":return Ie(s,n);case"dedup":return Ne(s,n);case"top":return Ee(s,n);case"map":return Ae(s,n);case"transform":return Fe(s,n);case"explode":return Oe(s,n);case"implode":return Le(s,n);case"flatmap":return Ue(s,n);case"pivot":return Re(s,n);case"agg":return ne(s,n);case"groupby":return se(s,n);case"frequency":case"freq":return re(s,n);case"stats":return oe(s,n);case"cat":return je(s,n);case"join":return Pe(s,n);case"merge":return Me(s,n);case"split":return ve(s,n);case"partition":return Ce(s,n);case"to":return be(s,n);case"from":return Se(s,n);case"transpose":return ye(s,n);case"shuffle":return xe(s,n);case"fixlengths":return we(s,n);case"view":return Z(s,n);case"flatten":case"f":return Y(s,n);case"fmt":return Ve(s,n);default:return pt.has(t)?{stdout:"",stderr:`xan ${t}: not yet implemented -`,exitCode:1}:{stdout:"",stderr:`xan: unknown command '${t}' -Run 'xan --help' for usage. -`,exitCode:1}}}},xn={name:"xan",flags:[],stdinType:"text",needsArgs:!0};export{yn as a,xn as b}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-7AISL3XV.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-7AISL3XV.js deleted file mode 100644 index b4cae13..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-7AISL3XV.js +++ /dev/null @@ -1,12 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a as g}from"./chunk-QIQMJJZ4.js";import{a as D,b as $}from"./chunk-QAYAQNCG.js";var P={name:"tree",summary:"list contents of directories in a tree-like format",usage:"tree [OPTION]... [DIRECTORY]...",options:["-a include hidden files","-d list directories only","-L LEVEL limit depth of directory tree","-f print full path prefix for each file"," --help display this help and exit"]},b={showHidden:{short:"a",type:"boolean"},directoriesOnly:{short:"d",type:"boolean"},fullPath:{short:"f",type:"boolean"},maxDepth:{short:"L",type:"number"}},O={name:"tree",async execute(i,o){if($(i))return D(P);let s=g("tree",i,b);if(!s.ok)return s.error;let f={showHidden:s.result.flags.showHidden,directoriesOnly:s.result.flags.directoriesOnly,maxDepth:s.result.flags.maxDepth??null,fullPath:s.result.flags.fullPath},d=s.result.positional;d.length===0&&d.push(".");let e="",l="",a=0,n=0;for(let t of d){let r=await T(o,t,f,"",0);e+=r.output,l+=r.stderr,a+=r.dirCount,n+=r.fileCount}return e+=` -${a} director${a===1?"y":"ies"}`,f.directoriesOnly||(e+=`, ${n} file${n===1?"":"s"}`),e+=` -`,{stdout:e,stderr:l,exitCode:l?1:0}}};async function T(i,o,s,f,d){let e={output:"",stderr:"",dirCount:0,fileCount:0},l=i.fs.resolvePath(i.cwd,o);try{if(!(await i.fs.stat(l)).isDirectory)return e.output=`${o} -`,e.fileCount=1,e}catch{return e.stderr=`tree: ${o}: No such file or directory -`,e}if(e.output=`${o} -`,s.maxDepth!==null&&d>=s.maxDepth)return e;try{let a=[];if(i.fs.readdirWithFileTypes)a=(await i.fs.readdirWithFileTypes(l)).map(r=>({name:r.name,isDirectory:r.isDirectory}));else{let t=await i.fs.readdir(l);for(let r=0;r{let y=l==="/"?`/${c}`:`${l}/${c}`;try{let h=await i.fs.stat(y);return{name:c,isDirectory:h.isDirectory}}catch{return null}}));a.push(...u.filter(c=>c!==null))}}let n=a.filter(t=>!(!s.showHidden&&t.name.startsWith(".")||s.directoriesOnly&&!t.isDirectory));n.sort((t,r)=>t.name.localeCompare(r.name));for(let t=0;t=s.maxDepth)return e;try{let l=[];if(i.fs.readdirWithFileTypes)l=(await i.fs.readdirWithFileTypes(o)).map(t=>({name:t.name,isDirectory:t.isDirectory}));else{let n=await i.fs.readdir(o);for(let t=0;t{let c=o==="/"?`/${u}`:`${o}/${u}`;try{let y=await i.fs.stat(c);return{name:u,isDirectory:y.isDirectory}}catch{return null}}));l.push(...m.filter(u=>u!==null))}}let a=l.filter(n=>!(!s.showHidden&&n.name.startsWith(".")||s.directoriesOnly&&!n.isDirectory));a.sort((n,t)=>n.name.localeCompare(t.name));for(let n=0;n",62],["?",63],["A",65],["B",66],["C",67],["F",70],["P",80],["Q",81],["U",85],["Z",90],["[",91],["\\",92],["]",93],["^",94],["_",95],["a",97],["b",98],["f",102],["i",105],["m",109],["n",110],["r",114],["s",115],["t",116],["v",118],["x",120],["z",122],["{",123],["|",124],["}",125]]);static toUpperCase(t){let e=String.fromCodePoint(t).toUpperCase();if(e.length>1)return t;let s=String.fromCodePoint(e.codePointAt(0)).toLowerCase();return s.length>1||s.codePointAt(0)!==t?t:e.codePointAt(0)}static toLowerCase(t){let e=String.fromCodePoint(t).toLowerCase();if(e.length>1)return t;let s=String.fromCodePoint(e.codePointAt(0)).toUpperCase();return s.length>1||s.codePointAt(0)!==t?t:e.codePointAt(0)}},l=class{SIZE=3;constructor(t){this.data=t}getLo(t){return this.data[t*this.SIZE]}getHi(t){return this.data[t*this.SIZE+1]}getStride(t){return this.data[t*this.SIZE+2]}get(t){let e=t*this.SIZE;return[this.data[e],this.data[e+1],this.data[e+2]]}get length(){return this.data.length/this.SIZE}},b=class i{static CASE_ORBIT=new Map([[75,107],[107,8490],[8490,75],[83,115],[115,383],[383,83],[181,924],[924,956],[956,181],[197,229],[229,8491],[8491,197],[452,453],[453,454],[454,452],[455,456],[456,457],[457,455],[458,459],[459,460],[460,458],[497,498],[498,499],[499,497],[837,921],[921,953],[953,8126],[8126,837],[914,946],[946,976],[976,914],[917,949],[949,1013],[1013,917],[920,952],[952,977],[977,1012],[1012,920],[922,954],[954,1008],[1008,922],[928,960],[960,982],[982,928],[929,961],[961,1009],[1009,929],[931,962],[962,963],[963,931],[934,966],[966,981],[981,934],[937,969],[969,8486],[8486,937],[1042,1074],[1074,7296],[7296,1042],[1044,1076],[1076,7297],[7297,1044],[1054,1086],[1086,7298],[7298,1054],[1057,1089],[1089,7299],[7299,1057],[1058,1090],[1090,7300],[7300,7301],[7301,1058],[1066,1098],[1098,7302],[7302,1066],[1122,1123],[1123,7303],[7303,1122],[7304,42570],[42570,42571],[42571,7304],[7776,7777],[7777,7835],[7835,7776],[223,7838],[7838,223],[8064,8072],[8072,8064],[8065,8073],[8073,8065],[8066,8074],[8074,8066],[8067,8075],[8075,8067],[8068,8076],[8076,8068],[8069,8077],[8077,8069],[8070,8078],[8078,8070],[8071,8079],[8079,8071],[8080,8088],[8088,8080],[8081,8089],[8089,8081],[8082,8090],[8090,8082],[8083,8091],[8091,8083],[8084,8092],[8092,8084],[8085,8093],[8093,8085],[8086,8094],[8094,8086],[8087,8095],[8095,8087],[8096,8104],[8104,8096],[8097,8105],[8105,8097],[8098,8106],[8106,8098],[8099,8107],[8107,8099],[8100,8108],[8108,8100],[8101,8109],[8109,8101],[8102,8110],[8110,8102],[8103,8111],[8111,8103],[8115,8124],[8124,8115],[8131,8140],[8140,8131],[912,8147],[8147,912],[944,8163],[8163,944],[8179,8188],[8188,8179],[64261,64262],[64262,64261],[66560,66600],[66600,66560],[66561,66601],[66601,66561],[66562,66602],[66602,66562],[66563,66603],[66603,66563],[66564,66604],[66604,66564],[66565,66605],[66605,66565],[66566,66606],[66606,66566],[66567,66607],[66607,66567],[66568,66608],[66608,66568],[66569,66609],[66609,66569],[66570,66610],[66610,66570],[66571,66611],[66611,66571],[66572,66612],[66612,66572],[66573,66613],[66613,66573],[66574,66614],[66614,66574],[66575,66615],[66615,66575],[66576,66616],[66616,66576],[66577,66617],[66617,66577],[66578,66618],[66618,66578],[66579,66619],[66619,66579],[66580,66620],[66620,66580],[66581,66621],[66621,66581],[66582,66622],[66622,66582],[66583,66623],[66623,66583],[66584,66624],[66624,66584],[66585,66625],[66625,66585],[66586,66626],[66626,66586],[66587,66627],[66627,66587],[66588,66628],[66628,66588],[66589,66629],[66629,66589],[66590,66630],[66630,66590],[66591,66631],[66631,66591],[66592,66632],[66632,66592],[66593,66633],[66633,66593],[66594,66634],[66634,66594],[66595,66635],[66635,66595],[66596,66636],[66636,66596],[66597,66637],[66637,66597],[66598,66638],[66638,66598],[66599,66639],[66639,66599],[66736,66776],[66776,66736],[66737,66777],[66777,66737],[66738,66778],[66778,66738],[66739,66779],[66779,66739],[66740,66780],[66780,66740],[66741,66781],[66781,66741],[66742,66782],[66782,66742],[66743,66783],[66783,66743],[66744,66784],[66784,66744],[66745,66785],[66785,66745],[66746,66786],[66786,66746],[66747,66787],[66787,66747],[66748,66788],[66788,66748],[66749,66789],[66789,66749],[66750,66790],[66790,66750],[66751,66791],[66791,66751],[66752,66792],[66792,66752],[66753,66793],[66793,66753],[66754,66794],[66794,66754],[66755,66795],[66795,66755],[66756,66796],[66796,66756],[66757,66797],[66797,66757],[66758,66798],[66798,66758],[66759,66799],[66799,66759],[66760,66800],[66800,66760],[66761,66801],[66801,66761],[66762,66802],[66802,66762],[66763,66803],[66803,66763],[66764,66804],[66804,66764],[66765,66805],[66805,66765],[66766,66806],[66806,66766],[66767,66807],[66807,66767],[66768,66808],[66808,66768],[66769,66809],[66809,66769],[66770,66810],[66810,66770],[66771,66811],[66811,66771],[66928,66967],[66967,66928],[66929,66968],[66968,66929],[66930,66969],[66969,66930],[66931,66970],[66970,66931],[66932,66971],[66971,66932],[66933,66972],[66972,66933],[66934,66973],[66973,66934],[66935,66974],[66974,66935],[66936,66975],[66975,66936],[66937,66976],[66976,66937],[66938,66977],[66977,66938],[66940,66979],[66979,66940],[66941,66980],[66980,66941],[66942,66981],[66981,66942],[66943,66982],[66982,66943],[66944,66983],[66983,66944],[66945,66984],[66984,66945],[66946,66985],[66985,66946],[66947,66986],[66986,66947],[66948,66987],[66987,66948],[66949,66988],[66988,66949],[66950,66989],[66989,66950],[66951,66990],[66990,66951],[66952,66991],[66991,66952],[66953,66992],[66992,66953],[66954,66993],[66993,66954],[66956,66995],[66995,66956],[66957,66996],[66996,66957],[66958,66997],[66997,66958],[66959,66998],[66998,66959],[66960,66999],[66999,66960],[66961,67e3],[67e3,66961],[66962,67001],[67001,66962],[66964,67003],[67003,66964],[66965,67004],[67004,66965],[68736,68800],[68800,68736],[68737,68801],[68801,68737],[68738,68802],[68802,68738],[68739,68803],[68803,68739],[68740,68804],[68804,68740],[68741,68805],[68805,68741],[68742,68806],[68806,68742],[68743,68807],[68807,68743],[68744,68808],[68808,68744],[68745,68809],[68809,68745],[68746,68810],[68810,68746],[68747,68811],[68811,68747],[68748,68812],[68812,68748],[68749,68813],[68813,68749],[68750,68814],[68814,68750],[68751,68815],[68815,68751],[68752,68816],[68816,68752],[68753,68817],[68817,68753],[68754,68818],[68818,68754],[68755,68819],[68819,68755],[68756,68820],[68820,68756],[68757,68821],[68821,68757],[68758,68822],[68822,68758],[68759,68823],[68823,68759],[68760,68824],[68824,68760],[68761,68825],[68825,68761],[68762,68826],[68826,68762],[68763,68827],[68827,68763],[68764,68828],[68828,68764],[68765,68829],[68829,68765],[68766,68830],[68830,68766],[68767,68831],[68831,68767],[68768,68832],[68832,68768],[68769,68833],[68833,68769],[68770,68834],[68834,68770],[68771,68835],[68835,68771],[68772,68836],[68836,68772],[68773,68837],[68837,68773],[68774,68838],[68838,68774],[68775,68839],[68839,68775],[68776,68840],[68840,68776],[68777,68841],[68841,68777],[68778,68842],[68842,68778],[68779,68843],[68843,68779],[68780,68844],[68844,68780],[68781,68845],[68845,68781],[68782,68846],[68846,68782],[68783,68847],[68847,68783],[68784,68848],[68848,68784],[68785,68849],[68849,68785],[68786,68850],[68850,68786],[68944,68976],[68976,68944],[68945,68977],[68977,68945],[68946,68978],[68978,68946],[68947,68979],[68979,68947],[68948,68980],[68980,68948],[68949,68981],[68981,68949],[68950,68982],[68982,68950],[68951,68983],[68983,68951],[68952,68984],[68984,68952],[68953,68985],[68985,68953],[68954,68986],[68986,68954],[68955,68987],[68987,68955],[68956,68988],[68988,68956],[68957,68989],[68989,68957],[68958,68990],[68990,68958],[68959,68991],[68991,68959],[68960,68992],[68992,68960],[68961,68993],[68993,68961],[68962,68994],[68994,68962],[68963,68995],[68995,68963],[68964,68996],[68996,68964],[68965,68997],[68997,68965],[71840,71872],[71872,71840],[71841,71873],[71873,71841],[71842,71874],[71874,71842],[71843,71875],[71875,71843],[71844,71876],[71876,71844],[71845,71877],[71877,71845],[71846,71878],[71878,71846],[71847,71879],[71879,71847],[71848,71880],[71880,71848],[71849,71881],[71881,71849],[71850,71882],[71882,71850],[71851,71883],[71883,71851],[71852,71884],[71884,71852],[71853,71885],[71885,71853],[71854,71886],[71886,71854],[71855,71887],[71887,71855],[71856,71888],[71888,71856],[71857,71889],[71889,71857],[71858,71890],[71890,71858],[71859,71891],[71891,71859],[71860,71892],[71892,71860],[71861,71893],[71893,71861],[71862,71894],[71894,71862],[71863,71895],[71895,71863],[71864,71896],[71896,71864],[71865,71897],[71897,71865],[71866,71898],[71898,71866],[71867,71899],[71899,71867],[71868,71900],[71900,71868],[71869,71901],[71901,71869],[71870,71902],[71902,71870],[71871,71903],[71903,71871],[93760,93792],[93792,93760],[93761,93793],[93793,93761],[93762,93794],[93794,93762],[93763,93795],[93795,93763],[93764,93796],[93796,93764],[93765,93797],[93797,93765],[93766,93798],[93798,93766],[93767,93799],[93799,93767],[93768,93800],[93800,93768],[93769,93801],[93801,93769],[93770,93802],[93802,93770],[93771,93803],[93803,93771],[93772,93804],[93804,93772],[93773,93805],[93805,93773],[93774,93806],[93806,93774],[93775,93807],[93807,93775],[93776,93808],[93808,93776],[93777,93809],[93809,93777],[93778,93810],[93810,93778],[93779,93811],[93811,93779],[93780,93812],[93812,93780],[93781,93813],[93813,93781],[93782,93814],[93814,93782],[93783,93815],[93815,93783],[93784,93816],[93816,93784],[93785,93817],[93817,93785],[93786,93818],[93818,93786],[93787,93819],[93819,93787],[93788,93820],[93820,93788],[93789,93821],[93821,93789],[93790,93822],[93822,93790],[93791,93823],[93823,93791],[125184,125218],[125218,125184],[125185,125219],[125219,125185],[125186,125220],[125220,125186],[125187,125221],[125221,125187],[125188,125222],[125222,125188],[125189,125223],[125223,125189],[125190,125224],[125224,125190],[125191,125225],[125225,125191],[125192,125226],[125226,125192],[125193,125227],[125227,125193],[125194,125228],[125228,125194],[125195,125229],[125229,125195],[125196,125230],[125230,125196],[125197,125231],[125231,125197],[125198,125232],[125232,125198],[125199,125233],[125233,125199],[125200,125234],[125234,125200],[125201,125235],[125235,125201],[125202,125236],[125236,125202],[125203,125237],[125237,125203],[125204,125238],[125238,125204],[125205,125239],[125239,125205],[125206,125240],[125240,125206],[125207,125241],[125241,125207],[125208,125242],[125242,125208],[125209,125243],[125243,125209],[125210,125244],[125244,125210],[125211,125245],[125245,125211],[125212,125246],[125246,125212],[125213,125247],[125247,125213],[125214,125248],[125248,125214],[125215,125249],[125249,125215],[125216,125250],[125250,125216],[125217,125251],[125251,125217]]);static C=new l(new Uint32Array([0,31,1,127,159,1,173,888,715,889,896,7,897,899,1,907,909,2,930,1328,398,1367,1368,1,1419,1420,1,1424,1480,56,1481,1487,1,1515,1518,1,1525,1541,1,1564,1757,193,1806,1807,1,1867,1868,1,1970,1983,1,2043,2044,1,2094,2095,1,2111,2140,29,2141,2143,2,2155,2159,1,2191,2198,1,2274,2436,162,2445,2446,1,2449,2450,1,2473,2481,8,2483,2485,1,2490,2491,1,2501,2502,1,2505,2506,1,2511,2518,1,2520,2523,1,2526,2532,6,2533,2559,26,2560,2564,4,2571,2574,1,2577,2578,1,2601,2609,8,2612,2618,3,2619,2621,2,2627,2630,1,2633,2634,1,2638,2640,1,2642,2648,1,2653,2655,2,2656,2661,1,2679,2688,1,2692,2702,10,2706,2729,23,2737,2740,3,2746,2747,1,2758,2766,4,2767,2769,2,2770,2783,1,2788,2789,1,2802,2808,1,2816,2820,4,2829,2830,1,2833,2834,1,2857,2865,8,2868,2874,6,2875,2885,10,2886,2889,3,2890,2894,4,2895,2900,1,2904,2907,1,2910,2916,6,2917,2936,19,2937,2945,1,2948,2955,7,2956,2957,1,2961,2966,5,2967,2968,1,2971,2973,2,2976,2978,1,2981,2983,1,2987,2989,1,3002,3005,1,3011,3013,1,3017,3022,5,3023,3025,2,3026,3030,1,3032,3045,1,3067,3071,1,3085,3089,4,3113,3130,17,3131,3141,10,3145,3150,5,3151,3156,1,3159,3163,4,3164,3166,2,3167,3172,5,3173,3184,11,3185,3190,1,3213,3217,4,3241,3252,11,3258,3259,1,3269,3273,4,3278,3284,1,3287,3292,1,3295,3300,5,3301,3312,11,3316,3327,1,3341,3345,4,3397,3401,4,3408,3411,1,3428,3429,1,3456,3460,4,3479,3481,1,3506,3516,10,3518,3519,1,3527,3529,1,3531,3534,1,3541,3543,2,3552,3557,1,3568,3569,1,3573,3584,1,3643,3646,1,3676,3712,1,3715,3717,2,3723,3748,25,3750,3774,24,3775,3781,6,3783,3791,8,3802,3803,1,3808,3839,1,3912,3949,37,3950,3952,1,3992,4029,37,4045,4059,14,4060,4095,1,4294,4296,2,4297,4300,1,4302,4303,1,4681,4686,5,4687,4695,8,4697,4702,5,4703,4745,42,4750,4751,1,4785,4790,5,4791,4799,8,4801,4806,5,4807,4823,16,4881,4886,5,4887,4955,68,4956,4989,33,4990,4991,1,5018,5023,1,5110,5111,1,5118,5119,1,5789,5791,1,5881,5887,1,5910,5918,1,5943,5951,1,5972,5983,1,5997,6001,4,6004,6015,1,6110,6111,1,6122,6127,1,6138,6143,1,6158,6170,12,6171,6175,1,6265,6271,1,6315,6319,1,6390,6399,1,6431,6444,13,6445,6447,1,6460,6463,1,6465,6467,1,6510,6511,1,6517,6527,1,6572,6575,1,6602,6607,1,6619,6621,1,6684,6685,1,6751,6781,30,6782,6794,12,6795,6799,1,6810,6815,1,6830,6831,1,6863,6911,1,6989,7156,167,7157,7163,1,7224,7226,1,7242,7244,1,7307,7311,1,7355,7356,1,7368,7375,1,7419,7423,1,7958,7959,1,7966,7967,1,8006,8007,1,8014,8015,1,8024,8030,2,8062,8063,1,8117,8133,16,8148,8149,1,8156,8176,20,8177,8181,4,8191,8203,12,8204,8207,1,8234,8238,1,8288,8303,1,8306,8307,1,8335,8349,14,8350,8351,1,8385,8399,1,8433,8447,1,8588,8591,1,9258,9279,1,9291,9311,1,11124,11125,1,11158,11508,350,11509,11512,1,11558,11560,2,11561,11564,1,11566,11567,1,11624,11630,1,11633,11646,1,11671,11679,1,11687,11743,8,11870,11903,1,11930,12020,90,12021,12031,1,12246,12271,1,12352,12439,87,12440,12544,104,12545,12548,1,12592,12687,95,12774,12782,1,12831,42125,29294,42126,42127,1,42183,42191,1,42540,42559,1,42744,42751,1,42958,42959,1,42962,42964,2,42973,42993,1,43053,43055,1,43066,43071,1,43128,43135,1,43206,43213,1,43226,43231,1,43348,43358,1,43389,43391,1,43470,43482,12,43483,43485,1,43519,43575,56,43576,43583,1,43598,43599,1,43610,43611,1,43715,43738,1,43767,43776,1,43783,43784,1,43791,43792,1,43799,43807,1,43815,43823,8,43884,43887,1,44014,44015,1,44026,44031,1,55204,55215,1,55239,55242,1,55292,63743,1,64110,64111,1,64218,64255,1,64263,64274,1,64280,64284,1,64311,64317,6,64319,64325,3,64451,64466,1,64912,64913,1,64968,64974,1,64976,65007,1,65050,65055,1,65107,65127,20,65132,65135,1,65141,65277,136,65278,65280,1,65471,65473,1,65480,65481,1,65488,65489,1,65496,65497,1,65501,65503,1,65511,65519,8,65520,65531,1,65534,65535,1,65548,65575,27,65595,65598,3,65614,65615,1,65630,65663,1,65787,65791,1,65795,65798,1,65844,65846,1,65935,65949,14,65950,65951,1,65953,65999,1,66046,66175,1,66205,66207,1,66257,66271,1,66300,66303,1,66340,66348,1,66379,66383,1,66427,66431,1,66462,66500,38,66501,66503,1,66518,66559,1,66718,66719,1,66730,66735,1,66772,66775,1,66812,66815,1,66856,66863,1,66916,66926,1,66939,66955,16,66963,66966,3,66978,66994,16,67002,67005,3,67006,67007,1,67060,67071,1,67383,67391,1,67414,67423,1,67432,67455,1,67462,67505,43,67515,67583,1,67590,67591,1,67593,67638,45,67641,67643,1,67645,67646,1,67670,67743,73,67744,67750,1,67760,67807,1,67827,67830,3,67831,67834,1,67868,67870,1,67898,67902,1,67904,67967,1,68024,68027,1,68048,68049,1,68100,68103,3,68104,68107,1,68116,68120,4,68150,68151,1,68155,68158,1,68169,68175,1,68185,68191,1,68256,68287,1,68327,68330,1,68343,68351,1,68406,68408,1,68438,68439,1,68467,68471,1,68498,68504,1,68509,68520,1,68528,68607,1,68681,68735,1,68787,68799,1,68851,68857,1,68904,68911,1,68922,68927,1,68966,68968,1,68998,69005,1,69008,69215,1,69247,69290,43,69294,69295,1,69298,69313,1,69317,69371,1,69416,69423,1,69466,69487,1,69514,69551,1,69580,69599,1,69623,69631,1,69710,69713,1,69750,69758,1,69821,69827,6,69828,69839,1,69865,69871,1,69882,69887,1,69941,69960,19,69961,69967,1,70007,70015,1,70112,70133,21,70134,70143,1,70162,70210,48,70211,70271,1,70279,70281,2,70286,70302,16,70314,70319,1,70379,70383,1,70394,70399,1,70404,70413,9,70414,70417,3,70418,70441,23,70449,70452,3,70458,70469,11,70470,70473,3,70474,70478,4,70479,70481,2,70482,70486,1,70488,70492,1,70500,70501,1,70509,70511,1,70517,70527,1,70538,70540,2,70541,70543,2,70582,70593,11,70595,70596,1,70598,70603,5,70614,70617,3,70618,70624,1,70627,70655,1,70748,70754,6,70755,70783,1,70856,70863,1,70874,71039,1,71094,71095,1,71134,71167,1,71237,71247,1,71258,71263,1,71277,71295,1,71354,71359,1,71370,71375,1,71396,71423,1,71451,71452,1,71468,71471,1,71495,71679,1,71740,71839,1,71923,71934,1,71943,71944,1,71946,71947,1,71956,71959,3,71990,71993,3,71994,72007,13,72008,72015,1,72026,72095,1,72104,72105,1,72152,72153,1,72165,72191,1,72264,72271,1,72355,72367,1,72441,72447,1,72458,72639,1,72674,72687,1,72698,72703,1,72713,72759,46,72774,72783,1,72813,72815,1,72848,72849,1,72872,72887,15,72888,72959,1,72967,72970,3,73015,73017,1,73019,73022,3,73032,73039,1,73050,73055,1,73062,73065,3,73103,73106,3,73113,73119,1,73130,73439,1,73465,73471,1,73489,73531,42,73532,73533,1,73563,73647,1,73649,73663,1,73714,73726,1,74650,74751,1,74863,74869,6,74870,74879,1,75076,77711,1,77811,77823,1,78896,78911,1,78934,78943,1,82939,82943,1,83527,90367,1,90426,92159,1,92729,92735,1,92767,92778,11,92779,92781,1,92863,92874,11,92875,92879,1,92910,92911,1,92918,92927,1,92998,93007,1,93018,93026,8,93048,93052,1,93072,93503,1,93562,93759,1,93851,93951,1,94027,94030,1,94088,94094,1,94112,94175,1,94181,94191,1,94194,94207,1,100344,100351,1,101590,101630,1,101641,110575,1,110580,110588,8,110591,110883,292,110884,110897,1,110899,110927,1,110931,110932,1,110934,110947,1,110952,110959,1,111356,113663,1,113771,113775,1,113789,113791,1,113801,113807,1,113818,113819,1,113824,117759,1,118010,118015,1,118452,118527,1,118574,118575,1,118599,118607,1,118724,118783,1,119030,119039,1,119079,119080,1,119155,119162,1,119275,119295,1,119366,119487,1,119508,119519,1,119540,119551,1,119639,119647,1,119673,119807,1,119893,119965,72,119968,119969,1,119971,119972,1,119975,119976,1,119981,119994,13,119996,120004,8,120070,120075,5,120076,120085,9,120093,120122,29,120127,120133,6,120135,120137,1,120145,120486,341,120487,120780,293,120781,121484,703,121485,121498,1,121504,121520,16,121521,122623,1,122655,122660,1,122667,122879,1,122887,122905,18,122906,122914,8,122917,122923,6,122924,122927,1,122990,123022,1,123024,123135,1,123181,123183,1,123198,123199,1,123210,123213,1,123216,123535,1,123567,123583,1,123642,123646,1,123648,124111,1,124154,124367,1,124411,124414,1,124416,124895,1,124903,124908,5,124911,124927,16,125125,125126,1,125143,125183,1,125260,125263,1,125274,125277,1,125280,126064,1,126133,126208,1,126270,126463,1,126468,126496,28,126499,126501,2,126502,126504,2,126515,126520,5,126522,126524,2,126525,126529,1,126531,126534,1,126536,126540,2,126544,126547,3,126549,126550,1,126552,126560,2,126563,126565,2,126566,126571,5,126579,126589,5,126591,126602,11,126620,126624,1,126628,126634,6,126652,126703,1,126706,126975,1,127020,127023,1,127124,127135,1,127151,127152,1,127168,127184,16,127222,127231,1,127406,127461,1,127491,127503,1,127548,127551,1,127561,127567,1,127570,127583,1,127590,127743,1,128728,128731,1,128749,128751,1,128765,128767,1,128887,128890,1,128986,128991,1,129004,129007,1,129009,129023,1,129036,129039,1,129096,129103,1,129114,129119,1,129160,129167,1,129198,129199,1,129212,129215,1,129218,129279,1,129620,129631,1,129646,129647,1,129661,129663,1,129674,129678,1,129735,129741,1,129757,129758,1,129770,129775,1,129785,129791,1,129939,130042,103,130043,131071,1,173792,173823,1,177978,177983,1,178206,178207,1,183970,183983,1,191457,191471,1,192094,194559,1,195102,196607,1,201547,201551,1,205744,917759,1,918e3,1114111,1]));static Cc=new l(new Uint32Array([0,31,1,127,159,1]));static Cf=new l(new Uint32Array([173,1536,1363,1537,1541,1,1564,1757,193,1807,2192,385,2193,2274,81,6158,8203,2045,8204,8207,1,8234,8238,1,8288,8292,1,8294,8303,1,65279,65529,250,65530,65531,1,69821,69837,16,78896,78911,1,113824,113827,1,119155,119162,1,917505,917536,31,917537,917631,1]));static Co=new l(new Uint32Array([57344,63743,1,983040,1048573,1,1048576,1114109,1]));static Cs=new l(new Uint32Array([55296,57343,1]));static L=new l(new Uint32Array([65,90,1,97,122,1,170,181,11,186,192,6,193,214,1,216,246,1,248,705,1,710,721,1,736,740,1,748,750,2,880,884,1,886,887,1,890,893,1,895,902,7,904,906,1,908,910,2,911,929,1,931,1013,1,1015,1153,1,1162,1327,1,1329,1366,1,1369,1376,7,1377,1416,1,1488,1514,1,1519,1522,1,1568,1610,1,1646,1647,1,1649,1747,1,1749,1765,16,1766,1774,8,1775,1786,11,1787,1788,1,1791,1808,17,1810,1839,1,1869,1957,1,1969,1994,25,1995,2026,1,2036,2037,1,2042,2048,6,2049,2069,1,2074,2084,10,2088,2112,24,2113,2136,1,2144,2154,1,2160,2183,1,2185,2190,1,2208,2249,1,2308,2361,1,2365,2384,19,2392,2401,1,2417,2432,1,2437,2444,1,2447,2448,1,2451,2472,1,2474,2480,1,2482,2486,4,2487,2489,1,2493,2510,17,2524,2525,1,2527,2529,1,2544,2545,1,2556,2565,9,2566,2570,1,2575,2576,1,2579,2600,1,2602,2608,1,2610,2611,1,2613,2614,1,2616,2617,1,2649,2652,1,2654,2674,20,2675,2676,1,2693,2701,1,2703,2705,1,2707,2728,1,2730,2736,1,2738,2739,1,2741,2745,1,2749,2768,19,2784,2785,1,2809,2821,12,2822,2828,1,2831,2832,1,2835,2856,1,2858,2864,1,2866,2867,1,2869,2873,1,2877,2908,31,2909,2911,2,2912,2913,1,2929,2947,18,2949,2954,1,2958,2960,1,2962,2965,1,2969,2970,1,2972,2974,2,2975,2979,4,2980,2984,4,2985,2986,1,2990,3001,1,3024,3077,53,3078,3084,1,3086,3088,1,3090,3112,1,3114,3129,1,3133,3160,27,3161,3162,1,3165,3168,3,3169,3200,31,3205,3212,1,3214,3216,1,3218,3240,1,3242,3251,1,3253,3257,1,3261,3293,32,3294,3296,2,3297,3313,16,3314,3332,18,3333,3340,1,3342,3344,1,3346,3386,1,3389,3406,17,3412,3414,1,3423,3425,1,3450,3455,1,3461,3478,1,3482,3505,1,3507,3515,1,3517,3520,3,3521,3526,1,3585,3632,1,3634,3635,1,3648,3654,1,3713,3714,1,3716,3718,2,3719,3722,1,3724,3747,1,3749,3751,2,3752,3760,1,3762,3763,1,3773,3776,3,3777,3780,1,3782,3804,22,3805,3807,1,3840,3904,64,3905,3911,1,3913,3948,1,3976,3980,1,4096,4138,1,4159,4176,17,4177,4181,1,4186,4189,1,4193,4197,4,4198,4206,8,4207,4208,1,4213,4225,1,4238,4256,18,4257,4293,1,4295,4301,6,4304,4346,1,4348,4680,1,4682,4685,1,4688,4694,1,4696,4698,2,4699,4701,1,4704,4744,1,4746,4749,1,4752,4784,1,4786,4789,1,4792,4798,1,4800,4802,2,4803,4805,1,4808,4822,1,4824,4880,1,4882,4885,1,4888,4954,1,4992,5007,1,5024,5109,1,5112,5117,1,5121,5740,1,5743,5759,1,5761,5786,1,5792,5866,1,5873,5880,1,5888,5905,1,5919,5937,1,5952,5969,1,5984,5996,1,5998,6e3,1,6016,6067,1,6103,6108,5,6176,6264,1,6272,6276,1,6279,6312,1,6314,6320,6,6321,6389,1,6400,6430,1,6480,6509,1,6512,6516,1,6528,6571,1,6576,6601,1,6656,6678,1,6688,6740,1,6823,6917,94,6918,6963,1,6981,6988,1,7043,7072,1,7086,7087,1,7098,7141,1,7168,7203,1,7245,7247,1,7258,7293,1,7296,7306,1,7312,7354,1,7357,7359,1,7401,7404,1,7406,7411,1,7413,7414,1,7418,7424,6,7425,7615,1,7680,7957,1,7960,7965,1,7968,8005,1,8008,8013,1,8016,8023,1,8025,8031,2,8032,8061,1,8064,8116,1,8118,8124,1,8126,8130,4,8131,8132,1,8134,8140,1,8144,8147,1,8150,8155,1,8160,8172,1,8178,8180,1,8182,8188,1,8305,8319,14,8336,8348,1,8450,8455,5,8458,8467,1,8469,8473,4,8474,8477,1,8484,8490,2,8491,8493,1,8495,8505,1,8508,8511,1,8517,8521,1,8526,8579,53,8580,11264,2684,11265,11492,1,11499,11502,1,11506,11507,1,11520,11557,1,11559,11565,6,11568,11623,1,11631,11648,17,11649,11670,1,11680,11686,1,11688,11694,1,11696,11702,1,11704,11710,1,11712,11718,1,11720,11726,1,11728,11734,1,11736,11742,1,11823,12293,470,12294,12337,43,12338,12341,1,12347,12348,1,12353,12438,1,12445,12447,1,12449,12538,1,12540,12543,1,12549,12591,1,12593,12686,1,12704,12735,1,12784,12799,1,13312,19903,1,19968,42124,1,42192,42237,1,42240,42508,1,42512,42527,1,42538,42539,1,42560,42606,1,42623,42653,1,42656,42725,1,42775,42783,1,42786,42888,1,42891,42957,1,42960,42961,1,42963,42965,2,42966,42972,1,42994,43009,1,43011,43013,1,43015,43018,1,43020,43042,1,43072,43123,1,43138,43187,1,43250,43255,1,43259,43261,2,43262,43274,12,43275,43301,1,43312,43334,1,43360,43388,1,43396,43442,1,43471,43488,17,43489,43492,1,43494,43503,1,43514,43518,1,43520,43560,1,43584,43586,1,43588,43595,1,43616,43638,1,43642,43646,4,43647,43695,1,43697,43701,4,43702,43705,3,43706,43709,1,43712,43714,2,43739,43741,1,43744,43754,1,43762,43764,1,43777,43782,1,43785,43790,1,43793,43798,1,43808,43814,1,43816,43822,1,43824,43866,1,43868,43881,1,43888,44002,1,44032,55203,1,55216,55238,1,55243,55291,1,63744,64109,1,64112,64217,1,64256,64262,1,64275,64279,1,64285,64287,2,64288,64296,1,64298,64310,1,64312,64316,1,64318,64320,2,64321,64323,2,64324,64326,2,64327,64433,1,64467,64829,1,64848,64911,1,64914,64967,1,65008,65019,1,65136,65140,1,65142,65276,1,65313,65338,1,65345,65370,1,65382,65470,1,65474,65479,1,65482,65487,1,65490,65495,1,65498,65500,1,65536,65547,1,65549,65574,1,65576,65594,1,65596,65597,1,65599,65613,1,65616,65629,1,65664,65786,1,66176,66204,1,66208,66256,1,66304,66335,1,66349,66368,1,66370,66377,1,66384,66421,1,66432,66461,1,66464,66499,1,66504,66511,1,66560,66717,1,66736,66771,1,66776,66811,1,66816,66855,1,66864,66915,1,66928,66938,1,66940,66954,1,66956,66962,1,66964,66965,1,66967,66977,1,66979,66993,1,66995,67001,1,67003,67004,1,67008,67059,1,67072,67382,1,67392,67413,1,67424,67431,1,67456,67461,1,67463,67504,1,67506,67514,1,67584,67589,1,67592,67594,2,67595,67637,1,67639,67640,1,67644,67647,3,67648,67669,1,67680,67702,1,67712,67742,1,67808,67826,1,67828,67829,1,67840,67861,1,67872,67897,1,67968,68023,1,68030,68031,1,68096,68112,16,68113,68115,1,68117,68119,1,68121,68149,1,68192,68220,1,68224,68252,1,68288,68295,1,68297,68324,1,68352,68405,1,68416,68437,1,68448,68466,1,68480,68497,1,68608,68680,1,68736,68786,1,68800,68850,1,68864,68899,1,68938,68965,1,68975,68997,1,69248,69289,1,69296,69297,1,69314,69316,1,69376,69404,1,69415,69424,9,69425,69445,1,69488,69505,1,69552,69572,1,69600,69622,1,69635,69687,1,69745,69746,1,69749,69763,14,69764,69807,1,69840,69864,1,69891,69926,1,69956,69959,3,69968,70002,1,70006,70019,13,70020,70066,1,70081,70084,1,70106,70108,2,70144,70161,1,70163,70187,1,70207,70208,1,70272,70278,1,70280,70282,2,70283,70285,1,70287,70301,1,70303,70312,1,70320,70366,1,70405,70412,1,70415,70416,1,70419,70440,1,70442,70448,1,70450,70451,1,70453,70457,1,70461,70480,19,70493,70497,1,70528,70537,1,70539,70542,3,70544,70581,1,70583,70609,26,70611,70656,45,70657,70708,1,70727,70730,1,70751,70753,1,70784,70831,1,70852,70853,1,70855,71040,185,71041,71086,1,71128,71131,1,71168,71215,1,71236,71296,60,71297,71338,1,71352,71424,72,71425,71450,1,71488,71494,1,71680,71723,1,71840,71903,1,71935,71942,1,71945,71948,3,71949,71955,1,71957,71958,1,71960,71983,1,71999,72001,2,72096,72103,1,72106,72144,1,72161,72163,2,72192,72203,11,72204,72242,1,72250,72272,22,72284,72329,1,72349,72368,19,72369,72440,1,72640,72672,1,72704,72712,1,72714,72750,1,72768,72818,50,72819,72847,1,72960,72966,1,72968,72969,1,72971,73008,1,73030,73056,26,73057,73061,1,73063,73064,1,73066,73097,1,73112,73440,328,73441,73458,1,73474,73476,2,73477,73488,1,73490,73523,1,73648,73728,80,73729,74649,1,74880,75075,1,77712,77808,1,77824,78895,1,78913,78918,1,78944,82938,1,82944,83526,1,90368,90397,1,92160,92728,1,92736,92766,1,92784,92862,1,92880,92909,1,92928,92975,1,92992,92995,1,93027,93047,1,93053,93071,1,93504,93548,1,93760,93823,1,93952,94026,1,94032,94099,67,94100,94111,1,94176,94177,1,94179,94208,29,94209,100343,1,100352,101589,1,101631,101640,1,110576,110579,1,110581,110587,1,110589,110590,1,110592,110882,1,110898,110928,30,110929,110930,1,110933,110948,15,110949,110951,1,110960,111355,1,113664,113770,1,113776,113788,1,113792,113800,1,113808,113817,1,119808,119892,1,119894,119964,1,119966,119967,1,119970,119973,3,119974,119977,3,119978,119980,1,119982,119993,1,119995,119997,2,119998,120003,1,120005,120069,1,120071,120074,1,120077,120084,1,120086,120092,1,120094,120121,1,120123,120126,1,120128,120132,1,120134,120138,4,120139,120144,1,120146,120485,1,120488,120512,1,120514,120538,1,120540,120570,1,120572,120596,1,120598,120628,1,120630,120654,1,120656,120686,1,120688,120712,1,120714,120744,1,120746,120770,1,120772,120779,1,122624,122654,1,122661,122666,1,122928,122989,1,123136,123180,1,123191,123197,1,123214,123536,322,123537,123565,1,123584,123627,1,124112,124139,1,124368,124397,1,124400,124896,496,124897,124902,1,124904,124907,1,124909,124910,1,124912,124926,1,124928,125124,1,125184,125251,1,125259,126464,1205,126465,126467,1,126469,126495,1,126497,126498,1,126500,126503,3,126505,126514,1,126516,126519,1,126521,126523,2,126530,126535,5,126537,126541,2,126542,126543,1,126545,126546,1,126548,126551,3,126553,126561,2,126562,126564,2,126567,126570,1,126572,126578,1,126580,126583,1,126585,126588,1,126590,126592,2,126593,126601,1,126603,126619,1,126625,126627,1,126629,126633,1,126635,126651,1,131072,173791,1,173824,177977,1,177984,178205,1,178208,183969,1,183984,191456,1,191472,192093,1,194560,195101,1,196608,201546,1,201552,205743,1]));static foldL=new l(new Uint32Array([837,837,1]));static Ll=new l(new Uint32Array([97,122,1,181,223,42,224,246,1,248,255,1,257,311,2,312,328,2,329,375,2,378,382,2,383,384,1,387,389,2,392,396,4,397,402,5,405,409,4,410,411,1,414,417,3,419,421,2,424,426,2,427,429,2,432,436,4,438,441,3,442,445,3,446,447,1,454,460,3,462,476,2,477,495,2,496,499,3,501,505,4,507,563,2,564,569,1,572,575,3,576,578,2,583,591,2,592,659,1,661,687,1,881,883,2,887,891,4,892,893,1,912,940,28,941,974,1,976,977,1,981,983,1,985,1007,2,1008,1011,1,1013,1019,3,1020,1072,52,1073,1119,1,1121,1153,2,1163,1215,2,1218,1230,2,1231,1327,2,1376,1416,1,4304,4346,1,4349,4351,1,5112,5117,1,7296,7304,1,7306,7424,118,7425,7467,1,7531,7543,1,7545,7578,1,7681,7829,2,7830,7837,1,7839,7935,2,7936,7943,1,7952,7957,1,7968,7975,1,7984,7991,1,8e3,8005,1,8016,8023,1,8032,8039,1,8048,8061,1,8064,8071,1,8080,8087,1,8096,8103,1,8112,8116,1,8118,8119,1,8126,8130,4,8131,8132,1,8134,8135,1,8144,8147,1,8150,8151,1,8160,8167,1,8178,8180,1,8182,8183,1,8458,8462,4,8463,8467,4,8495,8505,5,8508,8509,1,8518,8521,1,8526,8580,54,11312,11359,1,11361,11365,4,11366,11372,2,11377,11379,2,11380,11382,2,11383,11387,1,11393,11491,2,11492,11500,8,11502,11507,5,11520,11557,1,11559,11565,6,42561,42605,2,42625,42651,2,42787,42799,2,42800,42801,1,42803,42865,2,42866,42872,1,42874,42876,2,42879,42887,2,42892,42894,2,42897,42899,2,42900,42901,1,42903,42921,2,42927,42933,6,42935,42947,2,42952,42954,2,42957,42961,4,42963,42971,2,42998,43002,4,43824,43866,1,43872,43880,1,43888,43967,1,64256,64262,1,64275,64279,1,65345,65370,1,66600,66639,1,66776,66811,1,66967,66977,1,66979,66993,1,66995,67001,1,67003,67004,1,68800,68850,1,68976,68997,1,71872,71903,1,93792,93823,1,119834,119859,1,119886,119892,1,119894,119911,1,119938,119963,1,119990,119993,1,119995,119997,2,119998,120003,1,120005,120015,1,120042,120067,1,120094,120119,1,120146,120171,1,120198,120223,1,120250,120275,1,120302,120327,1,120354,120379,1,120406,120431,1,120458,120485,1,120514,120538,1,120540,120545,1,120572,120596,1,120598,120603,1,120630,120654,1,120656,120661,1,120688,120712,1,120714,120719,1,120746,120770,1,120772,120777,1,120779,122624,1845,122625,122633,1,122635,122654,1,122661,122666,1,125218,125251,1]));static foldLl=new l(new Uint32Array([65,90,1,192,214,1,216,222,1,256,302,2,306,310,2,313,327,2,330,376,2,377,381,2,385,386,1,388,390,2,391,393,2,394,395,1,398,401,1,403,404,1,406,408,1,412,413,1,415,416,1,418,422,2,423,425,2,428,430,2,431,433,2,434,435,1,437,439,2,440,444,4,452,453,1,455,456,1,458,459,1,461,475,2,478,494,2,497,498,1,500,502,2,503,504,1,506,562,2,570,571,1,573,574,1,577,579,2,580,582,1,584,590,2,837,880,43,882,886,4,895,902,7,904,906,1,908,910,2,911,913,2,914,929,1,931,939,1,975,984,9,986,1006,2,1012,1015,3,1017,1018,1,1021,1071,1,1120,1152,2,1162,1216,2,1217,1229,2,1232,1326,2,1329,1366,1,4256,4293,1,4295,4301,6,5024,5109,1,7305,7312,7,7313,7354,1,7357,7359,1,7680,7828,2,7838,7934,2,7944,7951,1,7960,7965,1,7976,7983,1,7992,7999,1,8008,8013,1,8025,8031,2,8040,8047,1,8072,8079,1,8088,8095,1,8104,8111,1,8120,8124,1,8136,8140,1,8152,8155,1,8168,8172,1,8184,8188,1,8486,8490,4,8491,8498,7,8579,11264,2685,11265,11311,1,11360,11362,2,11363,11364,1,11367,11373,2,11374,11376,1,11378,11381,3,11390,11392,1,11394,11490,2,11499,11501,2,11506,42560,31054,42562,42604,2,42624,42650,2,42786,42798,2,42802,42862,2,42873,42877,2,42878,42886,2,42891,42893,2,42896,42898,2,42902,42922,2,42923,42926,1,42928,42932,1,42934,42948,2,42949,42951,1,42953,42955,2,42956,42960,4,42966,42972,2,42997,65313,22316,65314,65338,1,66560,66599,1,66736,66771,1,66928,66938,1,66940,66954,1,66956,66962,1,66964,66965,1,68736,68786,1,68944,68965,1,71840,71871,1,93760,93791,1,125184,125217,1]));static Lm=new l(new Uint32Array([688,705,1,710,721,1,736,740,1,748,750,2,884,890,6,1369,1600,231,1765,1766,1,2036,2037,1,2042,2074,32,2084,2088,4,2249,2417,168,3654,3782,128,4348,6103,1755,6211,6823,612,7288,7293,1,7468,7530,1,7544,7579,35,7580,7615,1,8305,8319,14,8336,8348,1,11388,11389,1,11631,11823,192,12293,12337,44,12338,12341,1,12347,12445,98,12446,12540,94,12541,12542,1,40981,42232,1251,42233,42237,1,42508,42623,115,42652,42653,1,42775,42783,1,42864,42888,24,42994,42996,1,43e3,43001,1,43471,43494,23,43632,43741,109,43763,43764,1,43868,43871,1,43881,65392,21511,65438,65439,1,67456,67461,1,67463,67504,1,67506,67514,1,68942,68975,33,92992,92995,1,93504,93506,1,93547,93548,1,94099,94111,1,94176,94177,1,94179,110576,16397,110577,110579,1,110581,110587,1,110589,110590,1,122928,122989,1,123191,123197,1,124139,125259,1120]));static Lo=new l(new Uint32Array([170,186,16,443,448,5,449,451,1,660,1488,828,1489,1514,1,1519,1522,1,1568,1599,1,1601,1610,1,1646,1647,1,1649,1747,1,1749,1774,25,1775,1786,11,1787,1788,1,1791,1808,17,1810,1839,1,1869,1957,1,1969,1994,25,1995,2026,1,2048,2069,1,2112,2136,1,2144,2154,1,2160,2183,1,2185,2190,1,2208,2248,1,2308,2361,1,2365,2384,19,2392,2401,1,2418,2432,1,2437,2444,1,2447,2448,1,2451,2472,1,2474,2480,1,2482,2486,4,2487,2489,1,2493,2510,17,2524,2525,1,2527,2529,1,2544,2545,1,2556,2565,9,2566,2570,1,2575,2576,1,2579,2600,1,2602,2608,1,2610,2611,1,2613,2614,1,2616,2617,1,2649,2652,1,2654,2674,20,2675,2676,1,2693,2701,1,2703,2705,1,2707,2728,1,2730,2736,1,2738,2739,1,2741,2745,1,2749,2768,19,2784,2785,1,2809,2821,12,2822,2828,1,2831,2832,1,2835,2856,1,2858,2864,1,2866,2867,1,2869,2873,1,2877,2908,31,2909,2911,2,2912,2913,1,2929,2947,18,2949,2954,1,2958,2960,1,2962,2965,1,2969,2970,1,2972,2974,2,2975,2979,4,2980,2984,4,2985,2986,1,2990,3001,1,3024,3077,53,3078,3084,1,3086,3088,1,3090,3112,1,3114,3129,1,3133,3160,27,3161,3162,1,3165,3168,3,3169,3200,31,3205,3212,1,3214,3216,1,3218,3240,1,3242,3251,1,3253,3257,1,3261,3293,32,3294,3296,2,3297,3313,16,3314,3332,18,3333,3340,1,3342,3344,1,3346,3386,1,3389,3406,17,3412,3414,1,3423,3425,1,3450,3455,1,3461,3478,1,3482,3505,1,3507,3515,1,3517,3520,3,3521,3526,1,3585,3632,1,3634,3635,1,3648,3653,1,3713,3714,1,3716,3718,2,3719,3722,1,3724,3747,1,3749,3751,2,3752,3760,1,3762,3763,1,3773,3776,3,3777,3780,1,3804,3807,1,3840,3904,64,3905,3911,1,3913,3948,1,3976,3980,1,4096,4138,1,4159,4176,17,4177,4181,1,4186,4189,1,4193,4197,4,4198,4206,8,4207,4208,1,4213,4225,1,4238,4352,114,4353,4680,1,4682,4685,1,4688,4694,1,4696,4698,2,4699,4701,1,4704,4744,1,4746,4749,1,4752,4784,1,4786,4789,1,4792,4798,1,4800,4802,2,4803,4805,1,4808,4822,1,4824,4880,1,4882,4885,1,4888,4954,1,4992,5007,1,5121,5740,1,5743,5759,1,5761,5786,1,5792,5866,1,5873,5880,1,5888,5905,1,5919,5937,1,5952,5969,1,5984,5996,1,5998,6e3,1,6016,6067,1,6108,6176,68,6177,6210,1,6212,6264,1,6272,6276,1,6279,6312,1,6314,6320,6,6321,6389,1,6400,6430,1,6480,6509,1,6512,6516,1,6528,6571,1,6576,6601,1,6656,6678,1,6688,6740,1,6917,6963,1,6981,6988,1,7043,7072,1,7086,7087,1,7098,7141,1,7168,7203,1,7245,7247,1,7258,7287,1,7401,7404,1,7406,7411,1,7413,7414,1,7418,8501,1083,8502,8504,1,11568,11623,1,11648,11670,1,11680,11686,1,11688,11694,1,11696,11702,1,11704,11710,1,11712,11718,1,11720,11726,1,11728,11734,1,11736,11742,1,12294,12348,54,12353,12438,1,12447,12449,2,12450,12538,1,12543,12549,6,12550,12591,1,12593,12686,1,12704,12735,1,12784,12799,1,13312,19903,1,19968,40980,1,40982,42124,1,42192,42231,1,42240,42507,1,42512,42527,1,42538,42539,1,42606,42656,50,42657,42725,1,42895,42999,104,43003,43009,1,43011,43013,1,43015,43018,1,43020,43042,1,43072,43123,1,43138,43187,1,43250,43255,1,43259,43261,2,43262,43274,12,43275,43301,1,43312,43334,1,43360,43388,1,43396,43442,1,43488,43492,1,43495,43503,1,43514,43518,1,43520,43560,1,43584,43586,1,43588,43595,1,43616,43631,1,43633,43638,1,43642,43646,4,43647,43695,1,43697,43701,4,43702,43705,3,43706,43709,1,43712,43714,2,43739,43740,1,43744,43754,1,43762,43777,15,43778,43782,1,43785,43790,1,43793,43798,1,43808,43814,1,43816,43822,1,43968,44002,1,44032,55203,1,55216,55238,1,55243,55291,1,63744,64109,1,64112,64217,1,64285,64287,2,64288,64296,1,64298,64310,1,64312,64316,1,64318,64320,2,64321,64323,2,64324,64326,2,64327,64433,1,64467,64829,1,64848,64911,1,64914,64967,1,65008,65019,1,65136,65140,1,65142,65276,1,65382,65391,1,65393,65437,1,65440,65470,1,65474,65479,1,65482,65487,1,65490,65495,1,65498,65500,1,65536,65547,1,65549,65574,1,65576,65594,1,65596,65597,1,65599,65613,1,65616,65629,1,65664,65786,1,66176,66204,1,66208,66256,1,66304,66335,1,66349,66368,1,66370,66377,1,66384,66421,1,66432,66461,1,66464,66499,1,66504,66511,1,66640,66717,1,66816,66855,1,66864,66915,1,67008,67059,1,67072,67382,1,67392,67413,1,67424,67431,1,67584,67589,1,67592,67594,2,67595,67637,1,67639,67640,1,67644,67647,3,67648,67669,1,67680,67702,1,67712,67742,1,67808,67826,1,67828,67829,1,67840,67861,1,67872,67897,1,67968,68023,1,68030,68031,1,68096,68112,16,68113,68115,1,68117,68119,1,68121,68149,1,68192,68220,1,68224,68252,1,68288,68295,1,68297,68324,1,68352,68405,1,68416,68437,1,68448,68466,1,68480,68497,1,68608,68680,1,68864,68899,1,68938,68941,1,68943,69248,305,69249,69289,1,69296,69297,1,69314,69316,1,69376,69404,1,69415,69424,9,69425,69445,1,69488,69505,1,69552,69572,1,69600,69622,1,69635,69687,1,69745,69746,1,69749,69763,14,69764,69807,1,69840,69864,1,69891,69926,1,69956,69959,3,69968,70002,1,70006,70019,13,70020,70066,1,70081,70084,1,70106,70108,2,70144,70161,1,70163,70187,1,70207,70208,1,70272,70278,1,70280,70282,2,70283,70285,1,70287,70301,1,70303,70312,1,70320,70366,1,70405,70412,1,70415,70416,1,70419,70440,1,70442,70448,1,70450,70451,1,70453,70457,1,70461,70480,19,70493,70497,1,70528,70537,1,70539,70542,3,70544,70581,1,70583,70609,26,70611,70656,45,70657,70708,1,70727,70730,1,70751,70753,1,70784,70831,1,70852,70853,1,70855,71040,185,71041,71086,1,71128,71131,1,71168,71215,1,71236,71296,60,71297,71338,1,71352,71424,72,71425,71450,1,71488,71494,1,71680,71723,1,71935,71942,1,71945,71948,3,71949,71955,1,71957,71958,1,71960,71983,1,71999,72001,2,72096,72103,1,72106,72144,1,72161,72163,2,72192,72203,11,72204,72242,1,72250,72272,22,72284,72329,1,72349,72368,19,72369,72440,1,72640,72672,1,72704,72712,1,72714,72750,1,72768,72818,50,72819,72847,1,72960,72966,1,72968,72969,1,72971,73008,1,73030,73056,26,73057,73061,1,73063,73064,1,73066,73097,1,73112,73440,328,73441,73458,1,73474,73476,2,73477,73488,1,73490,73523,1,73648,73728,80,73729,74649,1,74880,75075,1,77712,77808,1,77824,78895,1,78913,78918,1,78944,82938,1,82944,83526,1,90368,90397,1,92160,92728,1,92736,92766,1,92784,92862,1,92880,92909,1,92928,92975,1,93027,93047,1,93053,93071,1,93507,93546,1,93952,94026,1,94032,94208,176,94209,100343,1,100352,101589,1,101631,101640,1,110592,110882,1,110898,110928,30,110929,110930,1,110933,110948,15,110949,110951,1,110960,111355,1,113664,113770,1,113776,113788,1,113792,113800,1,113808,113817,1,122634,123136,502,123137,123180,1,123214,123536,322,123537,123565,1,123584,123627,1,124112,124138,1,124368,124397,1,124400,124896,496,124897,124902,1,124904,124907,1,124909,124910,1,124912,124926,1,124928,125124,1,126464,126467,1,126469,126495,1,126497,126498,1,126500,126503,3,126505,126514,1,126516,126519,1,126521,126523,2,126530,126535,5,126537,126541,2,126542,126543,1,126545,126546,1,126548,126551,3,126553,126561,2,126562,126564,2,126567,126570,1,126572,126578,1,126580,126583,1,126585,126588,1,126590,126592,2,126593,126601,1,126603,126619,1,126625,126627,1,126629,126633,1,126635,126651,1,131072,173791,1,173824,177977,1,177984,178205,1,178208,183969,1,183984,191456,1,191472,192093,1,194560,195101,1,196608,201546,1,201552,205743,1]));static Lt=new l(new Uint32Array([453,459,3,498,8072,7574,8073,8079,1,8088,8095,1,8104,8111,1,8124,8140,16,8188,8188,1]));static foldLt=new l(new Uint32Array([452,454,2,455,457,2,458,460,2,497,499,2,8064,8071,1,8080,8087,1,8096,8103,1,8115,8131,16,8179,8179,1]));static Lu=new l(new Uint32Array([65,90,1,192,214,1,216,222,1,256,310,2,313,327,2,330,376,2,377,381,2,385,386,1,388,390,2,391,393,2,394,395,1,398,401,1,403,404,1,406,408,1,412,413,1,415,416,1,418,422,2,423,425,2,428,430,2,431,433,2,434,435,1,437,439,2,440,444,4,452,461,3,463,475,2,478,494,2,497,500,3,502,504,1,506,562,2,570,571,1,573,574,1,577,579,2,580,582,1,584,590,2,880,882,2,886,895,9,902,904,2,905,906,1,908,910,2,911,913,2,914,929,1,931,939,1,975,978,3,979,980,1,984,1006,2,1012,1015,3,1017,1018,1,1021,1071,1,1120,1152,2,1162,1216,2,1217,1229,2,1232,1326,2,1329,1366,1,4256,4293,1,4295,4301,6,5024,5109,1,7305,7312,7,7313,7354,1,7357,7359,1,7680,7828,2,7838,7934,2,7944,7951,1,7960,7965,1,7976,7983,1,7992,7999,1,8008,8013,1,8025,8031,2,8040,8047,1,8120,8123,1,8136,8139,1,8152,8155,1,8168,8172,1,8184,8187,1,8450,8455,5,8459,8461,1,8464,8466,1,8469,8473,4,8474,8477,1,8484,8490,2,8491,8493,1,8496,8499,1,8510,8511,1,8517,8579,62,11264,11311,1,11360,11362,2,11363,11364,1,11367,11373,2,11374,11376,1,11378,11381,3,11390,11392,1,11394,11490,2,11499,11501,2,11506,42560,31054,42562,42604,2,42624,42650,2,42786,42798,2,42802,42862,2,42873,42877,2,42878,42886,2,42891,42893,2,42896,42898,2,42902,42922,2,42923,42926,1,42928,42932,1,42934,42948,2,42949,42951,1,42953,42955,2,42956,42960,4,42966,42972,2,42997,65313,22316,65314,65338,1,66560,66599,1,66736,66771,1,66928,66938,1,66940,66954,1,66956,66962,1,66964,66965,1,68736,68786,1,68944,68965,1,71840,71871,1,93760,93791,1,119808,119833,1,119860,119885,1,119912,119937,1,119964,119966,2,119967,119973,3,119974,119977,3,119978,119980,1,119982,119989,1,120016,120041,1,120068,120069,1,120071,120074,1,120077,120084,1,120086,120092,1,120120,120121,1,120123,120126,1,120128,120132,1,120134,120138,4,120139,120144,1,120172,120197,1,120224,120249,1,120276,120301,1,120328,120353,1,120380,120405,1,120432,120457,1,120488,120512,1,120546,120570,1,120604,120628,1,120662,120686,1,120720,120744,1,120778,125184,4406,125185,125217,1]));static Upper=this.Lu;static foldLu=new l(new Uint32Array([97,122,1,181,223,42,224,246,1,248,255,1,257,303,2,307,311,2,314,328,2,331,375,2,378,382,2,383,384,1,387,389,2,392,396,4,402,405,3,409,411,1,414,417,3,419,421,2,424,429,5,432,436,4,438,441,3,445,447,2,453,454,1,456,457,1,459,460,1,462,476,2,477,495,2,498,499,1,501,505,4,507,543,2,547,563,2,572,575,3,576,578,2,583,591,2,592,596,1,598,599,1,601,603,2,604,608,4,609,611,2,612,614,1,616,620,1,623,625,2,626,629,3,637,640,3,642,643,1,647,652,1,658,669,11,670,837,167,881,883,2,887,891,4,892,893,1,940,943,1,945,974,1,976,977,1,981,983,1,985,1007,2,1008,1011,1,1013,1019,3,1072,1119,1,1121,1153,2,1163,1215,2,1218,1230,2,1231,1327,2,1377,1414,1,4304,4346,1,4349,4351,1,5112,5117,1,7296,7304,1,7306,7545,239,7549,7566,17,7681,7829,2,7835,7841,6,7843,7935,2,7936,7943,1,7952,7957,1,7968,7975,1,7984,7991,1,8e3,8005,1,8017,8023,2,8032,8039,1,8048,8061,1,8112,8113,1,8126,8144,18,8145,8160,15,8161,8165,4,8526,8580,54,11312,11359,1,11361,11365,4,11366,11372,2,11379,11382,3,11393,11491,2,11500,11502,2,11507,11520,13,11521,11557,1,11559,11565,6,42561,42605,2,42625,42651,2,42787,42799,2,42803,42863,2,42874,42876,2,42879,42887,2,42892,42897,5,42899,42900,1,42903,42921,2,42933,42947,2,42952,42954,2,42957,42961,4,42967,42971,2,42998,43859,861,43888,43967,1,65345,65370,1,66600,66639,1,66776,66811,1,66967,66977,1,66979,66993,1,66995,67001,1,67003,67004,1,68800,68850,1,68976,68997,1,71872,71903,1,93792,93823,1,125218,125251,1]));static M=new l(new Uint32Array([768,879,1,1155,1161,1,1425,1469,1,1471,1473,2,1474,1476,2,1477,1479,2,1552,1562,1,1611,1631,1,1648,1750,102,1751,1756,1,1759,1764,1,1767,1768,1,1770,1773,1,1809,1840,31,1841,1866,1,1958,1968,1,2027,2035,1,2045,2070,25,2071,2073,1,2075,2083,1,2085,2087,1,2089,2093,1,2137,2139,1,2199,2207,1,2250,2273,1,2275,2307,1,2362,2364,1,2366,2383,1,2385,2391,1,2402,2403,1,2433,2435,1,2492,2494,2,2495,2500,1,2503,2504,1,2507,2509,1,2519,2530,11,2531,2558,27,2561,2563,1,2620,2622,2,2623,2626,1,2631,2632,1,2635,2637,1,2641,2672,31,2673,2677,4,2689,2691,1,2748,2750,2,2751,2757,1,2759,2761,1,2763,2765,1,2786,2787,1,2810,2815,1,2817,2819,1,2876,2878,2,2879,2884,1,2887,2888,1,2891,2893,1,2901,2903,1,2914,2915,1,2946,3006,60,3007,3010,1,3014,3016,1,3018,3021,1,3031,3072,41,3073,3076,1,3132,3134,2,3135,3140,1,3142,3144,1,3146,3149,1,3157,3158,1,3170,3171,1,3201,3203,1,3260,3262,2,3263,3268,1,3270,3272,1,3274,3277,1,3285,3286,1,3298,3299,1,3315,3328,13,3329,3331,1,3387,3388,1,3390,3396,1,3398,3400,1,3402,3405,1,3415,3426,11,3427,3457,30,3458,3459,1,3530,3535,5,3536,3540,1,3542,3544,2,3545,3551,1,3570,3571,1,3633,3636,3,3637,3642,1,3655,3662,1,3761,3764,3,3765,3772,1,3784,3790,1,3864,3865,1,3893,3897,2,3902,3903,1,3953,3972,1,3974,3975,1,3981,3991,1,3993,4028,1,4038,4139,101,4140,4158,1,4182,4185,1,4190,4192,1,4194,4196,1,4199,4205,1,4209,4212,1,4226,4237,1,4239,4250,11,4251,4253,1,4957,4959,1,5906,5909,1,5938,5940,1,5970,5971,1,6002,6003,1,6068,6099,1,6109,6155,46,6156,6157,1,6159,6277,118,6278,6313,35,6432,6443,1,6448,6459,1,6679,6683,1,6741,6750,1,6752,6780,1,6783,6832,49,6833,6862,1,6912,6916,1,6964,6980,1,7019,7027,1,7040,7042,1,7073,7085,1,7142,7155,1,7204,7223,1,7376,7378,1,7380,7400,1,7405,7412,7,7415,7417,1,7616,7679,1,8400,8432,1,11503,11505,1,11647,11744,97,11745,11775,1,12330,12335,1,12441,12442,1,42607,42610,1,42612,42621,1,42654,42655,1,42736,42737,1,43010,43014,4,43019,43043,24,43044,43047,1,43052,43136,84,43137,43188,51,43189,43205,1,43232,43249,1,43263,43302,39,43303,43309,1,43335,43347,1,43392,43395,1,43443,43456,1,43493,43561,68,43562,43574,1,43587,43596,9,43597,43643,46,43644,43645,1,43696,43698,2,43699,43700,1,43703,43704,1,43710,43711,1,43713,43755,42,43756,43759,1,43765,43766,1,44003,44010,1,44012,44013,1,64286,65024,738,65025,65039,1,65056,65071,1,66045,66272,227,66422,66426,1,68097,68099,1,68101,68102,1,68108,68111,1,68152,68154,1,68159,68325,166,68326,68900,574,68901,68903,1,68969,68973,1,69291,69292,1,69372,69375,1,69446,69456,1,69506,69509,1,69632,69634,1,69688,69702,1,69744,69747,3,69748,69759,11,69760,69762,1,69808,69818,1,69826,69888,62,69889,69890,1,69927,69940,1,69957,69958,1,70003,70016,13,70017,70018,1,70067,70080,1,70089,70092,1,70094,70095,1,70188,70199,1,70206,70209,3,70367,70378,1,70400,70403,1,70459,70460,1,70462,70468,1,70471,70472,1,70475,70477,1,70487,70498,11,70499,70502,3,70503,70508,1,70512,70516,1,70584,70592,1,70594,70597,3,70599,70602,1,70604,70608,1,70610,70625,15,70626,70709,83,70710,70726,1,70750,70832,82,70833,70851,1,71087,71093,1,71096,71104,1,71132,71133,1,71216,71232,1,71339,71351,1,71453,71467,1,71724,71738,1,71984,71989,1,71991,71992,1,71995,71998,1,72e3,72002,2,72003,72145,142,72146,72151,1,72154,72160,1,72164,72193,29,72194,72202,1,72243,72249,1,72251,72254,1,72263,72273,10,72274,72283,1,72330,72345,1,72751,72758,1,72760,72767,1,72850,72871,1,72873,72886,1,73009,73014,1,73018,73020,2,73021,73023,2,73024,73029,1,73031,73098,67,73099,73102,1,73104,73105,1,73107,73111,1,73459,73462,1,73472,73473,1,73475,73524,49,73525,73530,1,73534,73538,1,73562,78912,5350,78919,78933,1,90398,90415,1,92912,92916,1,92976,92982,1,94031,94033,2,94034,94087,1,94095,94098,1,94180,94192,12,94193,113821,19628,113822,118528,4706,118529,118573,1,118576,118598,1,119141,119145,1,119149,119154,1,119163,119170,1,119173,119179,1,119210,119213,1,119362,119364,1,121344,121398,1,121403,121452,1,121461,121476,15,121499,121503,1,121505,121519,1,122880,122886,1,122888,122904,1,122907,122913,1,122915,122916,1,122918,122922,1,123023,123184,161,123185,123190,1,123566,123628,62,123629,123631,1,124140,124143,1,124398,124399,1,125136,125142,1,125252,125258,1,917760,917999,1]));static foldM=new l(new Uint32Array([921,953,32,8126,8126,1]));static Mc=new l(new Uint32Array([2307,2363,56,2366,2368,1,2377,2380,1,2382,2383,1,2434,2435,1,2494,2496,1,2503,2504,1,2507,2508,1,2519,2563,44,2622,2624,1,2691,2750,59,2751,2752,1,2761,2763,2,2764,2818,54,2819,2878,59,2880,2887,7,2888,2891,3,2892,2903,11,3006,3007,1,3009,3010,1,3014,3016,1,3018,3020,1,3031,3073,42,3074,3075,1,3137,3140,1,3202,3203,1,3262,3264,2,3265,3268,1,3271,3272,1,3274,3275,1,3285,3286,1,3315,3330,15,3331,3390,59,3391,3392,1,3398,3400,1,3402,3404,1,3415,3458,43,3459,3535,76,3536,3537,1,3544,3551,1,3570,3571,1,3902,3903,1,3967,4139,172,4140,4145,5,4152,4155,3,4156,4182,26,4183,4194,11,4195,4196,1,4199,4205,1,4227,4228,1,4231,4236,1,4239,4250,11,4251,4252,1,5909,5940,31,6070,6078,8,6079,6085,1,6087,6088,1,6435,6438,1,6441,6443,1,6448,6449,1,6451,6456,1,6681,6682,1,6741,6743,2,6753,6755,2,6756,6765,9,6766,6770,1,6916,6965,49,6971,6973,2,6974,6977,1,6979,6980,1,7042,7073,31,7078,7079,1,7082,7143,61,7146,7148,1,7150,7154,4,7155,7204,49,7205,7211,1,7220,7221,1,7393,7415,22,12334,12335,1,43043,43044,1,43047,43136,89,43137,43188,51,43189,43203,1,43346,43347,1,43395,43444,49,43445,43450,5,43451,43454,3,43455,43456,1,43567,43568,1,43571,43572,1,43597,43643,46,43645,43755,110,43758,43759,1,43765,44003,238,44004,44006,2,44007,44009,2,44010,44012,2,69632,69634,2,69762,69808,46,69809,69810,1,69815,69816,1,69932,69957,25,69958,70018,60,70067,70069,1,70079,70080,1,70094,70188,94,70189,70190,1,70194,70195,1,70197,70368,171,70369,70370,1,70402,70403,1,70462,70463,1,70465,70468,1,70471,70472,1,70475,70477,1,70487,70498,11,70499,70584,85,70585,70586,1,70594,70597,3,70599,70602,1,70604,70605,1,70607,70709,102,70710,70711,1,70720,70721,1,70725,70832,107,70833,70834,1,70841,70843,2,70844,70846,1,70849,71087,238,71088,71089,1,71096,71099,1,71102,71216,114,71217,71218,1,71227,71228,1,71230,71340,110,71342,71343,1,71350,71454,104,71456,71457,1,71462,71724,262,71725,71726,1,71736,71984,248,71985,71989,1,71991,71992,1,71997,72e3,3,72002,72145,143,72146,72147,1,72156,72159,1,72164,72249,85,72279,72280,1,72343,72751,408,72766,72873,107,72881,72884,3,73098,73102,1,73107,73108,1,73110,73461,351,73462,73475,13,73524,73525,1,73534,73535,1,73537,90410,16873,90411,90412,1,94033,94087,1,94192,94193,1,119141,119142,1,119149,119154,1]));static Me=new l(new Uint32Array([1160,1161,1,6846,8413,1567,8414,8416,1,8418,8420,1,42608,42610,1]));static Mn=new l(new Uint32Array([768,879,1,1155,1159,1,1425,1469,1,1471,1473,2,1474,1476,2,1477,1479,2,1552,1562,1,1611,1631,1,1648,1750,102,1751,1756,1,1759,1764,1,1767,1768,1,1770,1773,1,1809,1840,31,1841,1866,1,1958,1968,1,2027,2035,1,2045,2070,25,2071,2073,1,2075,2083,1,2085,2087,1,2089,2093,1,2137,2139,1,2199,2207,1,2250,2273,1,2275,2306,1,2362,2364,2,2369,2376,1,2381,2385,4,2386,2391,1,2402,2403,1,2433,2492,59,2497,2500,1,2509,2530,21,2531,2558,27,2561,2562,1,2620,2625,5,2626,2631,5,2632,2635,3,2636,2637,1,2641,2672,31,2673,2677,4,2689,2690,1,2748,2753,5,2754,2757,1,2759,2760,1,2765,2786,21,2787,2810,23,2811,2815,1,2817,2876,59,2879,2881,2,2882,2884,1,2893,2901,8,2902,2914,12,2915,2946,31,3008,3021,13,3072,3076,4,3132,3134,2,3135,3136,1,3142,3144,1,3146,3149,1,3157,3158,1,3170,3171,1,3201,3260,59,3263,3270,7,3276,3277,1,3298,3299,1,3328,3329,1,3387,3388,1,3393,3396,1,3405,3426,21,3427,3457,30,3530,3538,8,3539,3540,1,3542,3633,91,3636,3642,1,3655,3662,1,3761,3764,3,3765,3772,1,3784,3790,1,3864,3865,1,3893,3897,2,3953,3966,1,3968,3972,1,3974,3975,1,3981,3991,1,3993,4028,1,4038,4141,103,4142,4144,1,4146,4151,1,4153,4154,1,4157,4158,1,4184,4185,1,4190,4192,1,4209,4212,1,4226,4229,3,4230,4237,7,4253,4957,704,4958,4959,1,5906,5908,1,5938,5939,1,5970,5971,1,6002,6003,1,6068,6069,1,6071,6077,1,6086,6089,3,6090,6099,1,6109,6155,46,6156,6157,1,6159,6277,118,6278,6313,35,6432,6434,1,6439,6440,1,6450,6457,7,6458,6459,1,6679,6680,1,6683,6742,59,6744,6750,1,6752,6754,2,6757,6764,1,6771,6780,1,6783,6832,49,6833,6845,1,6847,6862,1,6912,6915,1,6964,6966,2,6967,6970,1,6972,6978,6,7019,7027,1,7040,7041,1,7074,7077,1,7080,7081,1,7083,7085,1,7142,7144,2,7145,7149,4,7151,7153,1,7212,7219,1,7222,7223,1,7376,7378,1,7380,7392,1,7394,7400,1,7405,7412,7,7416,7417,1,7616,7679,1,8400,8412,1,8417,8421,4,8422,8432,1,11503,11505,1,11647,11744,97,11745,11775,1,12330,12333,1,12441,12442,1,42607,42612,5,42613,42621,1,42654,42655,1,42736,42737,1,43010,43014,4,43019,43045,26,43046,43052,6,43204,43205,1,43232,43249,1,43263,43302,39,43303,43309,1,43335,43345,1,43392,43394,1,43443,43446,3,43447,43449,1,43452,43453,1,43493,43561,68,43562,43566,1,43569,43570,1,43573,43574,1,43587,43596,9,43644,43696,52,43698,43700,1,43703,43704,1,43710,43711,1,43713,43756,43,43757,43766,9,44005,44008,3,44013,64286,20273,65024,65039,1,65056,65071,1,66045,66272,227,66422,66426,1,68097,68099,1,68101,68102,1,68108,68111,1,68152,68154,1,68159,68325,166,68326,68900,574,68901,68903,1,68969,68973,1,69291,69292,1,69372,69375,1,69446,69456,1,69506,69509,1,69633,69688,55,69689,69702,1,69744,69747,3,69748,69759,11,69760,69761,1,69811,69814,1,69817,69818,1,69826,69888,62,69889,69890,1,69927,69931,1,69933,69940,1,70003,70016,13,70017,70070,53,70071,70078,1,70089,70092,1,70095,70191,96,70192,70193,1,70196,70198,2,70199,70206,7,70209,70367,158,70371,70378,1,70400,70401,1,70459,70460,1,70464,70502,38,70503,70508,1,70512,70516,1,70587,70592,1,70606,70610,2,70625,70626,1,70712,70719,1,70722,70724,1,70726,70750,24,70835,70840,1,70842,70847,5,70848,70850,2,70851,71090,239,71091,71093,1,71100,71101,1,71103,71104,1,71132,71133,1,71219,71226,1,71229,71231,2,71232,71339,107,71341,71344,3,71345,71349,1,71351,71453,102,71455,71458,3,71459,71461,1,71463,71467,1,71727,71735,1,71737,71738,1,71995,71996,1,71998,72003,5,72148,72151,1,72154,72155,1,72160,72193,33,72194,72202,1,72243,72248,1,72251,72254,1,72263,72273,10,72274,72278,1,72281,72283,1,72330,72342,1,72344,72345,1,72752,72758,1,72760,72765,1,72767,72850,83,72851,72871,1,72874,72880,1,72882,72883,1,72885,72886,1,73009,73014,1,73018,73020,2,73021,73023,2,73024,73029,1,73031,73104,73,73105,73109,4,73111,73459,348,73460,73472,12,73473,73526,53,73527,73530,1,73536,73538,2,73562,78912,5350,78919,78933,1,90398,90409,1,90413,90415,1,92912,92916,1,92976,92982,1,94031,94095,64,94096,94098,1,94180,113821,19641,113822,118528,4706,118529,118573,1,118576,118598,1,119143,119145,1,119163,119170,1,119173,119179,1,119210,119213,1,119362,119364,1,121344,121398,1,121403,121452,1,121461,121476,15,121499,121503,1,121505,121519,1,122880,122886,1,122888,122904,1,122907,122913,1,122915,122916,1,122918,122922,1,123023,123184,161,123185,123190,1,123566,123628,62,123629,123631,1,124140,124143,1,124398,124399,1,125136,125142,1,125252,125258,1,917760,917999,1]));static foldMn=new l(new Uint32Array([921,953,32,8126,8126,1]));static N=new l(new Uint32Array([48,57,1,178,179,1,185,188,3,189,190,1,1632,1641,1,1776,1785,1,1984,1993,1,2406,2415,1,2534,2543,1,2548,2553,1,2662,2671,1,2790,2799,1,2918,2927,1,2930,2935,1,3046,3058,1,3174,3183,1,3192,3198,1,3302,3311,1,3416,3422,1,3430,3448,1,3558,3567,1,3664,3673,1,3792,3801,1,3872,3891,1,4160,4169,1,4240,4249,1,4969,4988,1,5870,5872,1,6112,6121,1,6128,6137,1,6160,6169,1,6470,6479,1,6608,6618,1,6784,6793,1,6800,6809,1,6992,7001,1,7088,7097,1,7232,7241,1,7248,7257,1,8304,8308,4,8309,8313,1,8320,8329,1,8528,8578,1,8581,8585,1,9312,9371,1,9450,9471,1,10102,10131,1,11517,12295,778,12321,12329,1,12344,12346,1,12690,12693,1,12832,12841,1,12872,12879,1,12881,12895,1,12928,12937,1,12977,12991,1,42528,42537,1,42726,42735,1,43056,43061,1,43216,43225,1,43264,43273,1,43472,43481,1,43504,43513,1,43600,43609,1,44016,44025,1,65296,65305,1,65799,65843,1,65856,65912,1,65930,65931,1,66273,66299,1,66336,66339,1,66369,66378,9,66513,66517,1,66720,66729,1,67672,67679,1,67705,67711,1,67751,67759,1,67835,67839,1,67862,67867,1,68028,68029,1,68032,68047,1,68050,68095,1,68160,68168,1,68221,68222,1,68253,68255,1,68331,68335,1,68440,68447,1,68472,68479,1,68521,68527,1,68858,68863,1,68912,68921,1,68928,68937,1,69216,69246,1,69405,69414,1,69457,69460,1,69573,69579,1,69714,69743,1,69872,69881,1,69942,69951,1,70096,70105,1,70113,70132,1,70384,70393,1,70736,70745,1,70864,70873,1,71248,71257,1,71360,71369,1,71376,71395,1,71472,71483,1,71904,71922,1,72016,72025,1,72688,72697,1,72784,72812,1,73040,73049,1,73120,73129,1,73552,73561,1,73664,73684,1,74752,74862,1,90416,90425,1,92768,92777,1,92864,92873,1,93008,93017,1,93019,93025,1,93552,93561,1,93824,93846,1,118e3,118009,1,119488,119507,1,119520,119539,1,119648,119672,1,120782,120831,1,123200,123209,1,123632,123641,1,124144,124153,1,124401,124410,1,125127,125135,1,125264,125273,1,126065,126123,1,126125,126127,1,126129,126132,1,126209,126253,1,126255,126269,1,127232,127244,1,130032,130041,1]));static Nd=new l(new Uint32Array([48,57,1,1632,1641,1,1776,1785,1,1984,1993,1,2406,2415,1,2534,2543,1,2662,2671,1,2790,2799,1,2918,2927,1,3046,3055,1,3174,3183,1,3302,3311,1,3430,3439,1,3558,3567,1,3664,3673,1,3792,3801,1,3872,3881,1,4160,4169,1,4240,4249,1,6112,6121,1,6160,6169,1,6470,6479,1,6608,6617,1,6784,6793,1,6800,6809,1,6992,7001,1,7088,7097,1,7232,7241,1,7248,7257,1,42528,42537,1,43216,43225,1,43264,43273,1,43472,43481,1,43504,43513,1,43600,43609,1,44016,44025,1,65296,65305,1,66720,66729,1,68912,68921,1,68928,68937,1,69734,69743,1,69872,69881,1,69942,69951,1,70096,70105,1,70384,70393,1,70736,70745,1,70864,70873,1,71248,71257,1,71360,71369,1,71376,71395,1,71472,71481,1,71904,71913,1,72016,72025,1,72688,72697,1,72784,72793,1,73040,73049,1,73120,73129,1,73552,73561,1,90416,90425,1,92768,92777,1,92864,92873,1,93008,93017,1,93552,93561,1,118e3,118009,1,120782,120831,1,123200,123209,1,123632,123641,1,124144,124153,1,124401,124410,1,125264,125273,1,130032,130041,1]));static Nl=new l(new Uint32Array([5870,5872,1,8544,8578,1,8581,8584,1,12295,12321,26,12322,12329,1,12344,12346,1,42726,42735,1,65856,65908,1,66369,66378,9,66513,66517,1,74752,74862,1]));static No=new l(new Uint32Array([178,179,1,185,188,3,189,190,1,2548,2553,1,2930,2935,1,3056,3058,1,3192,3198,1,3416,3422,1,3440,3448,1,3882,3891,1,4969,4988,1,6128,6137,1,6618,8304,1686,8308,8313,1,8320,8329,1,8528,8543,1,8585,9312,727,9313,9371,1,9450,9471,1,10102,10131,1,11517,12690,1173,12691,12693,1,12832,12841,1,12872,12879,1,12881,12895,1,12928,12937,1,12977,12991,1,43056,43061,1,65799,65843,1,65909,65912,1,65930,65931,1,66273,66299,1,66336,66339,1,67672,67679,1,67705,67711,1,67751,67759,1,67835,67839,1,67862,67867,1,68028,68029,1,68032,68047,1,68050,68095,1,68160,68168,1,68221,68222,1,68253,68255,1,68331,68335,1,68440,68447,1,68472,68479,1,68521,68527,1,68858,68863,1,69216,69246,1,69405,69414,1,69457,69460,1,69573,69579,1,69714,69733,1,70113,70132,1,71482,71483,1,71914,71922,1,72794,72812,1,73664,73684,1,93019,93025,1,93824,93846,1,119488,119507,1,119520,119539,1,119648,119672,1,125127,125135,1,126065,126123,1,126125,126127,1,126129,126132,1,126209,126253,1,126255,126269,1,127232,127244,1]));static P=new l(new Uint32Array([33,35,1,37,42,1,44,47,1,58,59,1,63,64,1,91,93,1,95,123,28,125,161,36,167,171,4,182,183,1,187,191,4,894,903,9,1370,1375,1,1417,1418,1,1470,1472,2,1475,1478,3,1523,1524,1,1545,1546,1,1548,1549,1,1563,1565,2,1566,1567,1,1642,1645,1,1748,1792,44,1793,1805,1,2039,2041,1,2096,2110,1,2142,2404,262,2405,2416,11,2557,2678,121,2800,3191,391,3204,3572,368,3663,3674,11,3675,3844,169,3845,3858,1,3860,3898,38,3899,3901,1,3973,4048,75,4049,4052,1,4057,4058,1,4170,4175,1,4347,4960,613,4961,4968,1,5120,5742,622,5787,5788,1,5867,5869,1,5941,5942,1,6100,6102,1,6104,6106,1,6144,6154,1,6468,6469,1,6686,6687,1,6816,6822,1,6824,6829,1,6990,6991,1,7002,7008,1,7037,7039,1,7164,7167,1,7227,7231,1,7294,7295,1,7360,7367,1,7379,8208,829,8209,8231,1,8240,8259,1,8261,8273,1,8275,8286,1,8317,8318,1,8333,8334,1,8968,8971,1,9001,9002,1,10088,10101,1,10181,10182,1,10214,10223,1,10627,10648,1,10712,10715,1,10748,10749,1,11513,11516,1,11518,11519,1,11632,11776,144,11777,11822,1,11824,11855,1,11858,11869,1,12289,12291,1,12296,12305,1,12308,12319,1,12336,12349,13,12448,12539,91,42238,42239,1,42509,42511,1,42611,42622,11,42738,42743,1,43124,43127,1,43214,43215,1,43256,43258,1,43260,43310,50,43311,43359,48,43457,43469,1,43486,43487,1,43612,43615,1,43742,43743,1,43760,43761,1,44011,64830,20819,64831,65040,209,65041,65049,1,65072,65106,1,65108,65121,1,65123,65128,5,65130,65131,1,65281,65283,1,65285,65290,1,65292,65295,1,65306,65307,1,65311,65312,1,65339,65341,1,65343,65371,28,65373,65375,2,65376,65381,1,65792,65794,1,66463,66512,49,66927,67671,744,67871,67903,32,68176,68184,1,68223,68336,113,68337,68342,1,68409,68415,1,68505,68508,1,68974,69293,319,69461,69465,1,69510,69513,1,69703,69709,1,69819,69820,1,69822,69825,1,69952,69955,1,70004,70005,1,70085,70088,1,70093,70107,14,70109,70111,1,70200,70205,1,70313,70612,299,70613,70615,2,70616,70731,115,70732,70735,1,70746,70747,1,70749,70854,105,71105,71127,1,71233,71235,1,71264,71276,1,71353,71484,131,71485,71486,1,71739,72004,265,72005,72006,1,72162,72255,93,72256,72262,1,72346,72348,1,72350,72354,1,72448,72457,1,72673,72769,96,72770,72773,1,72816,72817,1,73463,73464,1,73539,73551,1,73727,74864,1137,74865,74868,1,77809,77810,1,92782,92783,1,92917,92983,66,92984,92987,1,92996,93549,553,93550,93551,1,93847,93850,1,94178,113823,19645,121479,121483,1,124415,125278,863,125279,125279,1]));static Pc=new l(new Uint32Array([95,8255,8160,8256,8276,20,65075,65076,1,65101,65103,1,65343,65343,1]));static Pd=new l(new Uint32Array([45,1418,1373,1470,5120,3650,6150,8208,2058,8209,8213,1,11799,11802,3,11834,11835,1,11840,11869,29,12316,12336,20,12448,65073,52625,65074,65112,38,65123,65293,170,68974,69293,319]));static Pe=new l(new Uint32Array([41,93,52,125,3899,3774,3901,5788,1887,8262,8318,56,8334,8969,635,8971,9002,31,10089,10101,2,10182,10215,33,10217,10223,2,10628,10648,2,10713,10715,2,10749,11811,1062,11813,11817,2,11862,11868,2,12297,12305,2,12309,12315,2,12318,12319,1,64830,65048,218,65078,65092,2,65096,65114,18,65116,65118,2,65289,65341,52,65373,65379,3]));static Pf=new l(new Uint32Array([187,8217,8030,8221,8250,29,11779,11781,2,11786,11789,3,11805,11809,4]));static Pi=new l(new Uint32Array([171,8216,8045,8219,8220,1,8223,8249,26,11778,11780,2,11785,11788,3,11804,11808,4]));static Po=new l(new Uint32Array([33,35,1,37,39,1,42,46,2,47,58,11,59,63,4,64,92,28,161,167,6,182,183,1,191,894,703,903,1370,467,1371,1375,1,1417,1472,55,1475,1478,3,1523,1524,1,1545,1546,1,1548,1549,1,1563,1565,2,1566,1567,1,1642,1645,1,1748,1792,44,1793,1805,1,2039,2041,1,2096,2110,1,2142,2404,262,2405,2416,11,2557,2678,121,2800,3191,391,3204,3572,368,3663,3674,11,3675,3844,169,3845,3858,1,3860,3973,113,4048,4052,1,4057,4058,1,4170,4175,1,4347,4960,613,4961,4968,1,5742,5867,125,5868,5869,1,5941,5942,1,6100,6102,1,6104,6106,1,6144,6149,1,6151,6154,1,6468,6469,1,6686,6687,1,6816,6822,1,6824,6829,1,6990,6991,1,7002,7008,1,7037,7039,1,7164,7167,1,7227,7231,1,7294,7295,1,7360,7367,1,7379,8214,835,8215,8224,9,8225,8231,1,8240,8248,1,8251,8254,1,8257,8259,1,8263,8273,1,8275,8277,2,8278,8286,1,11513,11516,1,11518,11519,1,11632,11776,144,11777,11782,5,11783,11784,1,11787,11790,3,11791,11798,1,11800,11801,1,11803,11806,3,11807,11818,11,11819,11822,1,11824,11833,1,11836,11839,1,11841,11843,2,11844,11855,1,11858,11860,1,12289,12291,1,12349,12539,190,42238,42239,1,42509,42511,1,42611,42622,11,42738,42743,1,43124,43127,1,43214,43215,1,43256,43258,1,43260,43310,50,43311,43359,48,43457,43469,1,43486,43487,1,43612,43615,1,43742,43743,1,43760,43761,1,44011,65040,21029,65041,65046,1,65049,65072,23,65093,65094,1,65097,65100,1,65104,65106,1,65108,65111,1,65119,65121,1,65128,65130,2,65131,65281,150,65282,65283,1,65285,65287,1,65290,65294,2,65295,65306,11,65307,65311,4,65312,65340,28,65377,65380,3,65381,65792,411,65793,65794,1,66463,66512,49,66927,67671,744,67871,67903,32,68176,68184,1,68223,68336,113,68337,68342,1,68409,68415,1,68505,68508,1,69461,69465,1,69510,69513,1,69703,69709,1,69819,69820,1,69822,69825,1,69952,69955,1,70004,70005,1,70085,70088,1,70093,70107,14,70109,70111,1,70200,70205,1,70313,70612,299,70613,70615,2,70616,70731,115,70732,70735,1,70746,70747,1,70749,70854,105,71105,71127,1,71233,71235,1,71264,71276,1,71353,71484,131,71485,71486,1,71739,72004,265,72005,72006,1,72162,72255,93,72256,72262,1,72346,72348,1,72350,72354,1,72448,72457,1,72673,72769,96,72770,72773,1,72816,72817,1,73463,73464,1,73539,73551,1,73727,74864,1137,74865,74868,1,77809,77810,1,92782,92783,1,92917,92983,66,92984,92987,1,92996,93549,553,93550,93551,1,93847,93850,1,94178,113823,19645,121479,121483,1,124415,125278,863,125279,125279,1]));static Ps=new l(new Uint32Array([40,91,51,123,3898,3775,3900,5787,1887,8218,8222,4,8261,8317,56,8333,8968,635,8970,9001,31,10088,10100,2,10181,10214,33,10216,10222,2,10627,10647,2,10712,10714,2,10748,11810,1062,11812,11816,2,11842,11861,19,11863,11867,2,12296,12304,2,12308,12314,2,12317,64831,52514,65047,65077,30,65079,65091,2,65095,65113,18,65115,65117,2,65288,65339,51,65371,65375,4,65378,65378,1]));static S=new l(new Uint32Array([36,43,7,60,62,1,94,96,2,124,126,2,162,166,1,168,169,1,172,174,2,175,177,1,180,184,4,215,247,32,706,709,1,722,735,1,741,747,1,749,751,2,752,767,1,885,900,15,901,1014,113,1154,1421,267,1422,1423,1,1542,1544,1,1547,1550,3,1551,1758,207,1769,1789,20,1790,2038,248,2046,2047,1,2184,2546,362,2547,2554,7,2555,2801,246,2928,3059,131,3060,3066,1,3199,3407,208,3449,3647,198,3841,3843,1,3859,3861,2,3862,3863,1,3866,3871,1,3892,3896,2,4030,4037,1,4039,4044,1,4046,4047,1,4053,4056,1,4254,4255,1,5008,5017,1,5741,6107,366,6464,6622,158,6623,6655,1,7009,7018,1,7028,7036,1,8125,8127,2,8128,8129,1,8141,8143,1,8157,8159,1,8173,8175,1,8189,8190,1,8260,8274,14,8314,8316,1,8330,8332,1,8352,8384,1,8448,8449,1,8451,8454,1,8456,8457,1,8468,8470,2,8471,8472,1,8478,8483,1,8485,8489,2,8494,8506,12,8507,8512,5,8513,8516,1,8522,8525,1,8527,8586,59,8587,8592,5,8593,8967,1,8972,9e3,1,9003,9257,1,9280,9290,1,9372,9449,1,9472,10087,1,10132,10180,1,10183,10213,1,10224,10626,1,10649,10711,1,10716,10747,1,10750,11123,1,11126,11157,1,11159,11263,1,11493,11498,1,11856,11857,1,11904,11929,1,11931,12019,1,12032,12245,1,12272,12287,1,12292,12306,14,12307,12320,13,12342,12343,1,12350,12351,1,12443,12444,1,12688,12689,1,12694,12703,1,12736,12773,1,12783,12800,17,12801,12830,1,12842,12871,1,12880,12896,16,12897,12927,1,12938,12976,1,12992,13311,1,19904,19967,1,42128,42182,1,42752,42774,1,42784,42785,1,42889,42890,1,43048,43051,1,43062,43065,1,43639,43641,1,43867,43882,15,43883,64297,20414,64434,64450,1,64832,64847,1,64975,65020,45,65021,65023,1,65122,65124,2,65125,65126,1,65129,65284,155,65291,65308,17,65309,65310,1,65342,65344,2,65372,65374,2,65504,65510,1,65512,65518,1,65532,65533,1,65847,65855,1,65913,65929,1,65932,65934,1,65936,65948,1,65952,66e3,48,66001,66044,1,67703,67704,1,68296,69006,710,69007,71487,2480,73685,73713,1,92988,92991,1,92997,113820,20823,117760,117999,1,118016,118451,1,118608,118723,1,118784,119029,1,119040,119078,1,119081,119140,1,119146,119148,1,119171,119172,1,119180,119209,1,119214,119274,1,119296,119361,1,119365,119552,187,119553,119638,1,120513,120539,26,120571,120597,26,120629,120655,26,120687,120713,26,120745,120771,26,120832,121343,1,121399,121402,1,121453,121460,1,121462,121475,1,121477,121478,1,123215,123647,432,126124,126128,4,126254,126704,450,126705,126976,271,126977,127019,1,127024,127123,1,127136,127150,1,127153,127167,1,127169,127183,1,127185,127221,1,127245,127405,1,127462,127490,1,127504,127547,1,127552,127560,1,127568,127569,1,127584,127589,1,127744,128727,1,128732,128748,1,128752,128764,1,128768,128886,1,128891,128985,1,128992,129003,1,129008,129024,16,129025,129035,1,129040,129095,1,129104,129113,1,129120,129159,1,129168,129197,1,129200,129211,1,129216,129217,1,129280,129619,1,129632,129645,1,129648,129660,1,129664,129673,1,129679,129734,1,129742,129756,1,129759,129769,1,129776,129784,1,129792,129938,1,129940,130031,1]));static Sc=new l(new Uint32Array([36,162,126,163,165,1,1423,1547,124,2046,2047,1,2546,2547,1,2555,2801,246,3065,3647,582,6107,8352,2245,8353,8384,1,43064,65020,21956,65129,65284,155,65504,65505,1,65509,65510,1,73693,73696,1,123647,126128,2481]));static Sk=new l(new Uint32Array([94,96,2,168,175,7,180,184,4,706,709,1,722,735,1,741,747,1,749,751,2,752,767,1,885,900,15,901,2184,1283,8125,8127,2,8128,8129,1,8141,8143,1,8157,8159,1,8173,8175,1,8189,8190,1,12443,12444,1,42752,42774,1,42784,42785,1,42889,42890,1,43867,43882,15,43883,64434,20551,64435,64450,1,65342,65344,2,65507,127995,62488,127996,127999,1]));static Sm=new l(new Uint32Array([43,60,17,61,62,1,124,126,2,172,177,5,215,247,32,1014,1542,528,1543,1544,1,8260,8274,14,8314,8316,1,8330,8332,1,8472,8512,40,8513,8516,1,8523,8592,69,8593,8596,1,8602,8603,1,8608,8614,3,8622,8654,32,8655,8658,3,8660,8692,32,8693,8959,1,8992,8993,1,9084,9115,31,9116,9139,1,9180,9185,1,9655,9665,10,9720,9727,1,9839,10176,337,10177,10180,1,10183,10213,1,10224,10239,1,10496,10626,1,10649,10711,1,10716,10747,1,10750,11007,1,11056,11076,1,11079,11084,1,64297,65122,825,65124,65126,1,65291,65308,17,65309,65310,1,65372,65374,2,65506,65513,7,65514,65516,1,69006,69007,1,120513,120539,26,120571,120597,26,120629,120655,26,120687,120713,26,120745,120771,26,126704,126705,1]));static So=new l(new Uint32Array([166,169,3,174,176,2,1154,1421,267,1422,1550,128,1551,1758,207,1769,1789,20,1790,2038,248,2554,2928,374,3059,3064,1,3066,3199,133,3407,3449,42,3841,3843,1,3859,3861,2,3862,3863,1,3866,3871,1,3892,3896,2,4030,4037,1,4039,4044,1,4046,4047,1,4053,4056,1,4254,4255,1,5008,5017,1,5741,6464,723,6622,6655,1,7009,7018,1,7028,7036,1,8448,8449,1,8451,8454,1,8456,8457,1,8468,8470,2,8471,8478,7,8479,8483,1,8485,8489,2,8494,8506,12,8507,8522,15,8524,8525,1,8527,8586,59,8587,8597,10,8598,8601,1,8604,8607,1,8609,8610,1,8612,8613,1,8615,8621,1,8623,8653,1,8656,8657,1,8659,8661,2,8662,8691,1,8960,8967,1,8972,8991,1,8994,9e3,1,9003,9083,1,9085,9114,1,9140,9179,1,9186,9257,1,9280,9290,1,9372,9449,1,9472,9654,1,9656,9664,1,9666,9719,1,9728,9838,1,9840,10087,1,10132,10175,1,10240,10495,1,11008,11055,1,11077,11078,1,11085,11123,1,11126,11157,1,11159,11263,1,11493,11498,1,11856,11857,1,11904,11929,1,11931,12019,1,12032,12245,1,12272,12287,1,12292,12306,14,12307,12320,13,12342,12343,1,12350,12351,1,12688,12689,1,12694,12703,1,12736,12773,1,12783,12800,17,12801,12830,1,12842,12871,1,12880,12896,16,12897,12927,1,12938,12976,1,12992,13311,1,19904,19967,1,42128,42182,1,43048,43051,1,43062,43063,1,43065,43639,574,43640,43641,1,64832,64847,1,64975,65021,46,65022,65023,1,65508,65512,4,65517,65518,1,65532,65533,1,65847,65855,1,65913,65929,1,65932,65934,1,65936,65948,1,65952,66e3,48,66001,66044,1,67703,67704,1,68296,71487,3191,73685,73692,1,73697,73713,1,92988,92991,1,92997,113820,20823,117760,117999,1,118016,118451,1,118608,118723,1,118784,119029,1,119040,119078,1,119081,119140,1,119146,119148,1,119171,119172,1,119180,119209,1,119214,119274,1,119296,119361,1,119365,119552,187,119553,119638,1,120832,121343,1,121399,121402,1,121453,121460,1,121462,121475,1,121477,121478,1,123215,126124,2909,126254,126976,722,126977,127019,1,127024,127123,1,127136,127150,1,127153,127167,1,127169,127183,1,127185,127221,1,127245,127405,1,127462,127490,1,127504,127547,1,127552,127560,1,127568,127569,1,127584,127589,1,127744,127994,1,128e3,128727,1,128732,128748,1,128752,128764,1,128768,128886,1,128891,128985,1,128992,129003,1,129008,129024,16,129025,129035,1,129040,129095,1,129104,129113,1,129120,129159,1,129168,129197,1,129200,129211,1,129216,129217,1,129280,129619,1,129632,129645,1,129648,129660,1,129664,129673,1,129679,129734,1,129742,129756,1,129759,129769,1,129776,129784,1,129792,129938,1,129940,130031,1]));static Z=new l(new Uint32Array([32,160,128,5760,8192,2432,8193,8202,1,8232,8233,1,8239,8287,48,12288,12288,1]));static Zl=new l(new Uint32Array([8232,8232,1]));static Zp=new l(new Uint32Array([8233,8233,1]));static Zs=new l(new Uint32Array([32,160,128,5760,8192,2432,8193,8202,1,8239,8287,48,12288,12288,1]));static Adlam=new l(new Uint32Array([125184,125259,1,125264,125273,1,125278,125279,1]));static Ahom=new l(new Uint32Array([71424,71450,1,71453,71467,1,71472,71494,1]));static Anatolian_Hieroglyphs=new l(new Uint32Array([82944,83526,1]));static Arabic=new l(new Uint32Array([1536,1540,1,1542,1547,1,1549,1562,1,1564,1566,1,1568,1599,1,1601,1610,1,1622,1647,1,1649,1756,1,1758,1791,1,1872,1919,1,2160,2190,1,2192,2193,1,2199,2273,1,2275,2303,1,64336,64450,1,64467,64829,1,64832,64911,1,64914,64967,1,64975,65008,33,65009,65023,1,65136,65140,1,65142,65276,1,69216,69246,1,69314,69316,1,69372,69375,1,126464,126467,1,126469,126495,1,126497,126498,1,126500,126503,3,126505,126514,1,126516,126519,1,126521,126523,2,126530,126535,5,126537,126541,2,126542,126543,1,126545,126546,1,126548,126551,3,126553,126561,2,126562,126564,2,126567,126570,1,126572,126578,1,126580,126583,1,126585,126588,1,126590,126592,2,126593,126601,1,126603,126619,1,126625,126627,1,126629,126633,1,126635,126651,1,126704,126705,1]));static Armenian=new l(new Uint32Array([1329,1366,1,1369,1418,1,1421,1423,1,64275,64279,1]));static Avestan=new l(new Uint32Array([68352,68405,1,68409,68415,1]));static Balinese=new l(new Uint32Array([6912,6988,1,6990,7039,1]));static Bamum=new l(new Uint32Array([42656,42743,1,92160,92728,1]));static Bassa_Vah=new l(new Uint32Array([92880,92909,1,92912,92917,1]));static Batak=new l(new Uint32Array([7104,7155,1,7164,7167,1]));static Bengali=new l(new Uint32Array([2432,2435,1,2437,2444,1,2447,2448,1,2451,2472,1,2474,2480,1,2482,2486,4,2487,2489,1,2492,2500,1,2503,2504,1,2507,2510,1,2519,2524,5,2525,2527,2,2528,2531,1,2534,2558,1]));static Bhaiksuki=new l(new Uint32Array([72704,72712,1,72714,72758,1,72760,72773,1,72784,72812,1]));static Bopomofo=new l(new Uint32Array([746,747,1,12549,12591,1,12704,12735,1]));static Brahmi=new l(new Uint32Array([69632,69709,1,69714,69749,1,69759,69759,1]));static Braille=new l(new Uint32Array([10240,10495,1]));static Buginese=new l(new Uint32Array([6656,6683,1,6686,6687,1]));static Buhid=new l(new Uint32Array([5952,5971,1]));static Canadian_Aboriginal=new l(new Uint32Array([5120,5759,1,6320,6389,1,72368,72383,1]));static Carian=new l(new Uint32Array([66208,66256,1]));static Caucasian_Albanian=new l(new Uint32Array([66864,66915,1,66927,66927,1]));static Chakma=new l(new Uint32Array([69888,69940,1,69942,69959,1]));static Cham=new l(new Uint32Array([43520,43574,1,43584,43597,1,43600,43609,1,43612,43615,1]));static Cherokee=new l(new Uint32Array([5024,5109,1,5112,5117,1,43888,43967,1]));static Chorasmian=new l(new Uint32Array([69552,69579,1]));static Common=new l(new Uint32Array([0,64,1,91,96,1,123,169,1,171,185,1,187,191,1,215,247,32,697,735,1,741,745,1,748,767,1,884,894,10,901,903,2,1541,1548,7,1563,1567,4,1600,1757,157,2274,2404,130,2405,3647,1242,4053,4056,1,4347,5867,1520,5868,5869,1,5941,5942,1,6146,6147,1,6149,7379,1230,7393,7401,8,7402,7404,1,7406,7411,1,7413,7415,1,7418,8192,774,8193,8203,1,8206,8292,1,8294,8304,1,8308,8318,1,8320,8334,1,8352,8384,1,8448,8485,1,8487,8489,1,8492,8497,1,8499,8525,1,8527,8543,1,8585,8587,1,8592,9257,1,9280,9290,1,9312,10239,1,10496,11123,1,11126,11157,1,11159,11263,1,11776,11869,1,12272,12292,1,12294,12296,2,12297,12320,1,12336,12343,1,12348,12351,1,12443,12444,1,12448,12539,91,12540,12688,148,12689,12703,1,12736,12773,1,12783,12832,49,12833,12895,1,12927,13007,1,13055,13144,89,13145,13311,1,19904,19967,1,42752,42785,1,42888,42890,1,43056,43065,1,43310,43471,161,43867,43882,15,43883,64830,20947,64831,65040,209,65041,65049,1,65072,65106,1,65108,65126,1,65128,65131,1,65279,65281,2,65282,65312,1,65339,65344,1,65371,65381,1,65392,65438,46,65439,65504,65,65505,65510,1,65512,65518,1,65529,65533,1,65792,65794,1,65799,65843,1,65847,65855,1,65936,65948,1,66e3,66044,1,66273,66299,1,113824,113827,1,117760,118009,1,118016,118451,1,118608,118723,1,118784,119029,1,119040,119078,1,119081,119142,1,119146,119162,1,119171,119172,1,119180,119209,1,119214,119274,1,119488,119507,1,119520,119539,1,119552,119638,1,119648,119672,1,119808,119892,1,119894,119964,1,119966,119967,1,119970,119973,3,119974,119977,3,119978,119980,1,119982,119993,1,119995,119997,2,119998,120003,1,120005,120069,1,120071,120074,1,120077,120084,1,120086,120092,1,120094,120121,1,120123,120126,1,120128,120132,1,120134,120138,4,120139,120144,1,120146,120485,1,120488,120779,1,120782,120831,1,126065,126132,1,126209,126269,1,126976,127019,1,127024,127123,1,127136,127150,1,127153,127167,1,127169,127183,1,127185,127221,1,127232,127405,1,127462,127487,1,127489,127490,1,127504,127547,1,127552,127560,1,127568,127569,1,127584,127589,1,127744,128727,1,128732,128748,1,128752,128764,1,128768,128886,1,128891,128985,1,128992,129003,1,129008,129024,16,129025,129035,1,129040,129095,1,129104,129113,1,129120,129159,1,129168,129197,1,129200,129211,1,129216,129217,1,129280,129619,1,129632,129645,1,129648,129660,1,129664,129673,1,129679,129734,1,129742,129756,1,129759,129769,1,129776,129784,1,129792,129938,1,129940,130041,1,917505,917536,31,917537,917631,1]));static foldCommon=new l(new Uint32Array([924,956,32]));static Coptic=new l(new Uint32Array([994,1007,1,11392,11507,1,11513,11519,1]));static Cuneiform=new l(new Uint32Array([73728,74649,1,74752,74862,1,74864,74868,1,74880,75075,1]));static Cypriot=new l(new Uint32Array([67584,67589,1,67592,67594,2,67595,67637,1,67639,67640,1,67644,67647,3]));static Cypro_Minoan=new l(new Uint32Array([77712,77810,1]));static Cyrillic=new l(new Uint32Array([1024,1156,1,1159,1327,1,7296,7306,1,7467,7544,77,11744,11775,1,42560,42655,1,65070,65071,1,122928,122989,1,123023,123023,1]));static Deseret=new l(new Uint32Array([66560,66639,1]));static Devanagari=new l(new Uint32Array([2304,2384,1,2389,2403,1,2406,2431,1,43232,43263,1,72448,72457,1]));static Dives_Akuru=new l(new Uint32Array([71936,71942,1,71945,71948,3,71949,71955,1,71957,71958,1,71960,71989,1,71991,71992,1,71995,72006,1,72016,72025,1]));static Dogra=new l(new Uint32Array([71680,71739,1]));static Duployan=new l(new Uint32Array([113664,113770,1,113776,113788,1,113792,113800,1,113808,113817,1,113820,113823,1]));static Egyptian_Hieroglyphs=new l(new Uint32Array([77824,78933,1,78944,82938,1]));static Elbasan=new l(new Uint32Array([66816,66855,1]));static Elymaic=new l(new Uint32Array([69600,69622,1]));static Ethiopic=new l(new Uint32Array([4608,4680,1,4682,4685,1,4688,4694,1,4696,4698,2,4699,4701,1,4704,4744,1,4746,4749,1,4752,4784,1,4786,4789,1,4792,4798,1,4800,4802,2,4803,4805,1,4808,4822,1,4824,4880,1,4882,4885,1,4888,4954,1,4957,4988,1,4992,5017,1,11648,11670,1,11680,11686,1,11688,11694,1,11696,11702,1,11704,11710,1,11712,11718,1,11720,11726,1,11728,11734,1,11736,11742,1,43777,43782,1,43785,43790,1,43793,43798,1,43808,43814,1,43816,43822,1,124896,124902,1,124904,124907,1,124909,124910,1,124912,124926,1]));static Garay=new l(new Uint32Array([68928,68965,1,68969,68997,1,69006,69007,1]));static Georgian=new l(new Uint32Array([4256,4293,1,4295,4301,6,4304,4346,1,4348,4351,1,7312,7354,1,7357,7359,1,11520,11557,1,11559,11565,6]));static Glagolitic=new l(new Uint32Array([11264,11359,1,122880,122886,1,122888,122904,1,122907,122913,1,122915,122916,1,122918,122922,1]));static Gothic=new l(new Uint32Array([66352,66378,1]));static Grantha=new l(new Uint32Array([70400,70403,1,70405,70412,1,70415,70416,1,70419,70440,1,70442,70448,1,70450,70451,1,70453,70457,1,70460,70468,1,70471,70472,1,70475,70477,1,70480,70487,7,70493,70499,1,70502,70508,1,70512,70516,1]));static Greek=new l(new Uint32Array([880,883,1,885,887,1,890,893,1,895,900,5,902,904,2,905,906,1,908,910,2,911,929,1,931,993,1,1008,1023,1,7462,7466,1,7517,7521,1,7526,7530,1,7615,7936,321,7937,7957,1,7960,7965,1,7968,8005,1,8008,8013,1,8016,8023,1,8025,8031,2,8032,8061,1,8064,8116,1,8118,8132,1,8134,8147,1,8150,8155,1,8157,8175,1,8178,8180,1,8182,8190,1,8486,43877,35391,65856,65934,1,65952,119296,53344,119297,119365,1]));static foldGreek=new l(new Uint32Array([181,837,656]));static Gujarati=new l(new Uint32Array([2689,2691,1,2693,2701,1,2703,2705,1,2707,2728,1,2730,2736,1,2738,2739,1,2741,2745,1,2748,2757,1,2759,2761,1,2763,2765,1,2768,2784,16,2785,2787,1,2790,2801,1,2809,2815,1]));static Gunjala_Gondi=new l(new Uint32Array([73056,73061,1,73063,73064,1,73066,73102,1,73104,73105,1,73107,73112,1,73120,73129,1]));static Gurmukhi=new l(new Uint32Array([2561,2563,1,2565,2570,1,2575,2576,1,2579,2600,1,2602,2608,1,2610,2611,1,2613,2614,1,2616,2617,1,2620,2622,2,2623,2626,1,2631,2632,1,2635,2637,1,2641,2649,8,2650,2652,1,2654,2662,8,2663,2678,1]));static Gurung_Khema=new l(new Uint32Array([90368,90425,1]));static Han=new l(new Uint32Array([11904,11929,1,11931,12019,1,12032,12245,1,12293,12295,2,12321,12329,1,12344,12347,1,13312,19903,1,19968,40959,1,63744,64109,1,64112,64217,1,94178,94179,1,94192,94193,1,131072,173791,1,173824,177977,1,177984,178205,1,178208,183969,1,183984,191456,1,191472,192093,1,194560,195101,1,196608,201546,1,201552,205743,1]));static Hangul=new l(new Uint32Array([4352,4607,1,12334,12335,1,12593,12686,1,12800,12830,1,12896,12926,1,43360,43388,1,44032,55203,1,55216,55238,1,55243,55291,1,65440,65470,1,65474,65479,1,65482,65487,1,65490,65495,1,65498,65500,1]));static Hanifi_Rohingya=new l(new Uint32Array([68864,68903,1,68912,68921,1]));static Hanunoo=new l(new Uint32Array([5920,5940,1]));static Hatran=new l(new Uint32Array([67808,67826,1,67828,67829,1,67835,67839,1]));static Hebrew=new l(new Uint32Array([1425,1479,1,1488,1514,1,1519,1524,1,64285,64310,1,64312,64316,1,64318,64320,2,64321,64323,2,64324,64326,2,64327,64335,1]));static Hiragana=new l(new Uint32Array([12353,12438,1,12445,12447,1,110593,110879,1,110898,110928,30,110929,110930,1,127488,127488,1]));static Imperial_Aramaic=new l(new Uint32Array([67648,67669,1,67671,67679,1]));static Inherited=new l(new Uint32Array([768,879,1,1157,1158,1,1611,1621,1,1648,2385,737,2386,2388,1,6832,6862,1,7376,7378,1,7380,7392,1,7394,7400,1,7405,7412,7,7416,7417,1,7616,7679,1,8204,8205,1,8400,8432,1,12330,12333,1,12441,12442,1,65024,65039,1,65056,65069,1,66045,66272,227,70459,118528,48069,118529,118573,1,118576,118598,1,119143,119145,1,119163,119170,1,119173,119179,1,119210,119213,1,917760,917999,1]));static foldInherited=new l(new Uint32Array([921,953,32,8126,8126,1]));static Inscriptional_Pahlavi=new l(new Uint32Array([68448,68466,1,68472,68479,1]));static Inscriptional_Parthian=new l(new Uint32Array([68416,68437,1,68440,68447,1]));static Javanese=new l(new Uint32Array([43392,43469,1,43472,43481,1,43486,43487,1]));static Kaithi=new l(new Uint32Array([69760,69826,1,69837,69837,1]));static Kannada=new l(new Uint32Array([3200,3212,1,3214,3216,1,3218,3240,1,3242,3251,1,3253,3257,1,3260,3268,1,3270,3272,1,3274,3277,1,3285,3286,1,3293,3294,1,3296,3299,1,3302,3311,1,3313,3315,1]));static Katakana=new l(new Uint32Array([12449,12538,1,12541,12543,1,12784,12799,1,13008,13054,1,13056,13143,1,65382,65391,1,65393,65437,1,110576,110579,1,110581,110587,1,110589,110590,1,110592,110880,288,110881,110882,1,110933,110948,15,110949,110951,1]));static Kawi=new l(new Uint32Array([73472,73488,1,73490,73530,1,73534,73562,1]));static Kayah_Li=new l(new Uint32Array([43264,43309,1,43311,43311,1]));static Kharoshthi=new l(new Uint32Array([68096,68099,1,68101,68102,1,68108,68115,1,68117,68119,1,68121,68149,1,68152,68154,1,68159,68168,1,68176,68184,1]));static Khitan_Small_Script=new l(new Uint32Array([94180,101120,6940,101121,101589,1,101631,101631,1]));static Khmer=new l(new Uint32Array([6016,6109,1,6112,6121,1,6128,6137,1,6624,6655,1]));static Khojki=new l(new Uint32Array([70144,70161,1,70163,70209,1]));static Khudawadi=new l(new Uint32Array([70320,70378,1,70384,70393,1]));static Kirat_Rai=new l(new Uint32Array([93504,93561,1]));static Lao=new l(new Uint32Array([3713,3714,1,3716,3718,2,3719,3722,1,3724,3747,1,3749,3751,2,3752,3773,1,3776,3780,1,3782,3784,2,3785,3790,1,3792,3801,1,3804,3807,1]));static Latin=new l(new Uint32Array([65,90,1,97,122,1,170,186,16,192,214,1,216,246,1,248,696,1,736,740,1,7424,7461,1,7468,7516,1,7522,7525,1,7531,7543,1,7545,7614,1,7680,7935,1,8305,8319,14,8336,8348,1,8490,8491,1,8498,8526,28,8544,8584,1,11360,11391,1,42786,42887,1,42891,42957,1,42960,42961,1,42963,42965,2,42966,42972,1,42994,43007,1,43824,43866,1,43868,43876,1,43878,43881,1,64256,64262,1,65313,65338,1,65345,65370,1,67456,67461,1,67463,67504,1,67506,67514,1,122624,122654,1,122661,122666,1]));static Lepcha=new l(new Uint32Array([7168,7223,1,7227,7241,1,7245,7247,1]));static Limbu=new l(new Uint32Array([6400,6430,1,6432,6443,1,6448,6459,1,6464,6468,4,6469,6479,1]));static Linear_A=new l(new Uint32Array([67072,67382,1,67392,67413,1,67424,67431,1]));static Linear_B=new l(new Uint32Array([65536,65547,1,65549,65574,1,65576,65594,1,65596,65597,1,65599,65613,1,65616,65629,1,65664,65786,1]));static Lisu=new l(new Uint32Array([42192,42239,1,73648,73648,1]));static Lycian=new l(new Uint32Array([66176,66204,1]));static Lydian=new l(new Uint32Array([67872,67897,1,67903,67903,1]));static Mahajani=new l(new Uint32Array([69968,70006,1]));static Makasar=new l(new Uint32Array([73440,73464,1]));static Malayalam=new l(new Uint32Array([3328,3340,1,3342,3344,1,3346,3396,1,3398,3400,1,3402,3407,1,3412,3427,1,3430,3455,1]));static Mandaic=new l(new Uint32Array([2112,2139,1,2142,2142,1]));static Manichaean=new l(new Uint32Array([68288,68326,1,68331,68342,1]));static Marchen=new l(new Uint32Array([72816,72847,1,72850,72871,1,72873,72886,1]));static Masaram_Gondi=new l(new Uint32Array([72960,72966,1,72968,72969,1,72971,73014,1,73018,73020,2,73021,73023,2,73024,73031,1,73040,73049,1]));static Medefaidrin=new l(new Uint32Array([93760,93850,1]));static Meetei_Mayek=new l(new Uint32Array([43744,43766,1,43968,44013,1,44016,44025,1]));static Mende_Kikakui=new l(new Uint32Array([124928,125124,1,125127,125142,1]));static Meroitic_Cursive=new l(new Uint32Array([68e3,68023,1,68028,68047,1,68050,68095,1]));static Meroitic_Hieroglyphs=new l(new Uint32Array([67968,67999,1]));static Miao=new l(new Uint32Array([93952,94026,1,94031,94087,1,94095,94111,1]));static Modi=new l(new Uint32Array([71168,71236,1,71248,71257,1]));static Mongolian=new l(new Uint32Array([6144,6145,1,6148,6150,2,6151,6169,1,6176,6264,1,6272,6314,1,71264,71276,1]));static Mro=new l(new Uint32Array([92736,92766,1,92768,92777,1,92782,92783,1]));static Multani=new l(new Uint32Array([70272,70278,1,70280,70282,2,70283,70285,1,70287,70301,1,70303,70313,1]));static Myanmar=new l(new Uint32Array([4096,4255,1,43488,43518,1,43616,43647,1,71376,71395,1]));static Nabataean=new l(new Uint32Array([67712,67742,1,67751,67759,1]));static Nag_Mundari=new l(new Uint32Array([124112,124153,1]));static Nandinagari=new l(new Uint32Array([72096,72103,1,72106,72151,1,72154,72164,1]));static New_Tai_Lue=new l(new Uint32Array([6528,6571,1,6576,6601,1,6608,6618,1,6622,6623,1]));static Newa=new l(new Uint32Array([70656,70747,1,70749,70753,1]));static Nko=new l(new Uint32Array([1984,2042,1,2045,2047,1]));static Nushu=new l(new Uint32Array([94177,110960,16783,110961,111355,1]));static Nyiakeng_Puachue_Hmong=new l(new Uint32Array([123136,123180,1,123184,123197,1,123200,123209,1,123214,123215,1]));static Ogham=new l(new Uint32Array([5760,5788,1]));static Ol_Chiki=new l(new Uint32Array([7248,7295,1]));static Ol_Onal=new l(new Uint32Array([124368,124410,1,124415,124415,1]));static Old_Hungarian=new l(new Uint32Array([68736,68786,1,68800,68850,1,68858,68863,1]));static Old_Italic=new l(new Uint32Array([66304,66339,1,66349,66351,1]));static Old_North_Arabian=new l(new Uint32Array([68224,68255,1]));static Old_Permic=new l(new Uint32Array([66384,66426,1]));static Old_Persian=new l(new Uint32Array([66464,66499,1,66504,66517,1]));static Old_Sogdian=new l(new Uint32Array([69376,69415,1]));static Old_South_Arabian=new l(new Uint32Array([68192,68223,1]));static Old_Turkic=new l(new Uint32Array([68608,68680,1]));static Old_Uyghur=new l(new Uint32Array([69488,69513,1]));static Oriya=new l(new Uint32Array([2817,2819,1,2821,2828,1,2831,2832,1,2835,2856,1,2858,2864,1,2866,2867,1,2869,2873,1,2876,2884,1,2887,2888,1,2891,2893,1,2901,2903,1,2908,2909,1,2911,2915,1,2918,2935,1]));static Osage=new l(new Uint32Array([66736,66771,1,66776,66811,1]));static Osmanya=new l(new Uint32Array([66688,66717,1,66720,66729,1]));static Pahawh_Hmong=new l(new Uint32Array([92928,92997,1,93008,93017,1,93019,93025,1,93027,93047,1,93053,93071,1]));static Palmyrene=new l(new Uint32Array([67680,67711,1]));static Pau_Cin_Hau=new l(new Uint32Array([72384,72440,1]));static Phags_Pa=new l(new Uint32Array([43072,43127,1]));static Phoenician=new l(new Uint32Array([67840,67867,1,67871,67871,1]));static Psalter_Pahlavi=new l(new Uint32Array([68480,68497,1,68505,68508,1,68521,68527,1]));static Rejang=new l(new Uint32Array([43312,43347,1,43359,43359,1]));static Runic=new l(new Uint32Array([5792,5866,1,5870,5880,1]));static Samaritan=new l(new Uint32Array([2048,2093,1,2096,2110,1]));static Saurashtra=new l(new Uint32Array([43136,43205,1,43214,43225,1]));static Sharada=new l(new Uint32Array([70016,70111,1]));static Shavian=new l(new Uint32Array([66640,66687,1]));static Siddham=new l(new Uint32Array([71040,71093,1,71096,71133,1]));static SignWriting=new l(new Uint32Array([120832,121483,1,121499,121503,1,121505,121519,1]));static Sinhala=new l(new Uint32Array([3457,3459,1,3461,3478,1,3482,3505,1,3507,3515,1,3517,3520,3,3521,3526,1,3530,3535,5,3536,3540,1,3542,3544,2,3545,3551,1,3558,3567,1,3570,3572,1,70113,70132,1]));static Sogdian=new l(new Uint32Array([69424,69465,1]));static Sora_Sompeng=new l(new Uint32Array([69840,69864,1,69872,69881,1]));static Soyombo=new l(new Uint32Array([72272,72354,1]));static Sundanese=new l(new Uint32Array([7040,7103,1,7360,7367,1]));static Sunuwar=new l(new Uint32Array([72640,72673,1,72688,72697,1]));static Syloti_Nagri=new l(new Uint32Array([43008,43052,1]));static Syriac=new l(new Uint32Array([1792,1805,1,1807,1866,1,1869,1871,1,2144,2154,1]));static Tagalog=new l(new Uint32Array([5888,5909,1,5919,5919,1]));static Tagbanwa=new l(new Uint32Array([5984,5996,1,5998,6e3,1,6002,6003,1]));static Tai_Le=new l(new Uint32Array([6480,6509,1,6512,6516,1]));static Tai_Tham=new l(new Uint32Array([6688,6750,1,6752,6780,1,6783,6793,1,6800,6809,1,6816,6829,1]));static Tai_Viet=new l(new Uint32Array([43648,43714,1,43739,43743,1]));static Takri=new l(new Uint32Array([71296,71353,1,71360,71369,1]));static Tamil=new l(new Uint32Array([2946,2947,1,2949,2954,1,2958,2960,1,2962,2965,1,2969,2970,1,2972,2974,2,2975,2979,4,2980,2984,4,2985,2986,1,2990,3001,1,3006,3010,1,3014,3016,1,3018,3021,1,3024,3031,7,3046,3066,1,73664,73713,1,73727,73727,1]));static Tangsa=new l(new Uint32Array([92784,92862,1,92864,92873,1]));static Tangut=new l(new Uint32Array([94176,94208,32,94209,100343,1,100352,101119,1,101632,101640,1]));static Telugu=new l(new Uint32Array([3072,3084,1,3086,3088,1,3090,3112,1,3114,3129,1,3132,3140,1,3142,3144,1,3146,3149,1,3157,3158,1,3160,3162,1,3165,3168,3,3169,3171,1,3174,3183,1,3191,3199,1]));static Thaana=new l(new Uint32Array([1920,1969,1]));static Thai=new l(new Uint32Array([3585,3642,1,3648,3675,1]));static Tibetan=new l(new Uint32Array([3840,3911,1,3913,3948,1,3953,3991,1,3993,4028,1,4030,4044,1,4046,4052,1,4057,4058,1]));static Tifinagh=new l(new Uint32Array([11568,11623,1,11631,11632,1,11647,11647,1]));static Tirhuta=new l(new Uint32Array([70784,70855,1,70864,70873,1]));static Todhri=new l(new Uint32Array([67008,67059,1]));static Toto=new l(new Uint32Array([123536,123566,1]));static Tulu_Tigalari=new l(new Uint32Array([70528,70537,1,70539,70542,3,70544,70581,1,70583,70592,1,70594,70597,3,70599,70602,1,70604,70613,1,70615,70616,1,70625,70626,1]));static Ugaritic=new l(new Uint32Array([66432,66461,1,66463,66463,1]));static Vai=new l(new Uint32Array([42240,42539,1]));static Vithkuqi=new l(new Uint32Array([66928,66938,1,66940,66954,1,66956,66962,1,66964,66965,1,66967,66977,1,66979,66993,1,66995,67001,1,67003,67004,1]));static Wancho=new l(new Uint32Array([123584,123641,1,123647,123647,1]));static Warang_Citi=new l(new Uint32Array([71840,71922,1,71935,71935,1]));static Yezidi=new l(new Uint32Array([69248,69289,1,69291,69293,1,69296,69297,1]));static Yi=new l(new Uint32Array([40960,42124,1,42128,42182,1]));static Zanabazar_Square=new l(new Uint32Array([72192,72263,1]));static CATEGORIES=new Map([["C",i.C],["Cc",i.Cc],["Cf",i.Cf],["Co",i.Co],["Cs",i.Cs],["L",i.L],["Ll",i.Ll],["Lm",i.Lm],["Lo",i.Lo],["Lt",i.Lt],["Lu",i.Lu],["M",i.M],["Mc",i.Mc],["Me",i.Me],["Mn",i.Mn],["N",i.N],["Nd",i.Nd],["Nl",i.Nl],["No",i.No],["P",i.P],["Pc",i.Pc],["Pd",i.Pd],["Pe",i.Pe],["Pf",i.Pf],["Pi",i.Pi],["Po",i.Po],["Ps",i.Ps],["S",i.S],["Sc",i.Sc],["Sk",i.Sk],["Sm",i.Sm],["So",i.So],["Z",i.Z],["Zl",i.Zl],["Zp",i.Zp],["Zs",i.Zs]]);static SCRIPTS=new Map([["Adlam",i.Adlam],["Ahom",i.Ahom],["Anatolian_Hieroglyphs",i.Anatolian_Hieroglyphs],["Arabic",i.Arabic],["Armenian",i.Armenian],["Avestan",i.Avestan],["Balinese",i.Balinese],["Bamum",i.Bamum],["Bassa_Vah",i.Bassa_Vah],["Batak",i.Batak],["Bengali",i.Bengali],["Bhaiksuki",i.Bhaiksuki],["Bopomofo",i.Bopomofo],["Brahmi",i.Brahmi],["Braille",i.Braille],["Buginese",i.Buginese],["Buhid",i.Buhid],["Canadian_Aboriginal",i.Canadian_Aboriginal],["Carian",i.Carian],["Caucasian_Albanian",i.Caucasian_Albanian],["Chakma",i.Chakma],["Cham",i.Cham],["Cherokee",i.Cherokee],["Chorasmian",i.Chorasmian],["Common",i.Common],["Coptic",i.Coptic],["Cuneiform",i.Cuneiform],["Cypriot",i.Cypriot],["Cypro_Minoan",i.Cypro_Minoan],["Cyrillic",i.Cyrillic],["Deseret",i.Deseret],["Devanagari",i.Devanagari],["Dives_Akuru",i.Dives_Akuru],["Dogra",i.Dogra],["Duployan",i.Duployan],["Egyptian_Hieroglyphs",i.Egyptian_Hieroglyphs],["Elbasan",i.Elbasan],["Elymaic",i.Elymaic],["Ethiopic",i.Ethiopic],["Garay",i.Garay],["Georgian",i.Georgian],["Glagolitic",i.Glagolitic],["Gothic",i.Gothic],["Grantha",i.Grantha],["Greek",i.Greek],["Gujarati",i.Gujarati],["Gunjala_Gondi",i.Gunjala_Gondi],["Gurmukhi",i.Gurmukhi],["Gurung_Khema",i.Gurung_Khema],["Han",i.Han],["Hangul",i.Hangul],["Hanifi_Rohingya",i.Hanifi_Rohingya],["Hanunoo",i.Hanunoo],["Hatran",i.Hatran],["Hebrew",i.Hebrew],["Hiragana",i.Hiragana],["Imperial_Aramaic",i.Imperial_Aramaic],["Inherited",i.Inherited],["Inscriptional_Pahlavi",i.Inscriptional_Pahlavi],["Inscriptional_Parthian",i.Inscriptional_Parthian],["Javanese",i.Javanese],["Kaithi",i.Kaithi],["Kannada",i.Kannada],["Katakana",i.Katakana],["Kawi",i.Kawi],["Kayah_Li",i.Kayah_Li],["Kharoshthi",i.Kharoshthi],["Khitan_Small_Script",i.Khitan_Small_Script],["Khmer",i.Khmer],["Khojki",i.Khojki],["Khudawadi",i.Khudawadi],["Kirat_Rai",i.Kirat_Rai],["Lao",i.Lao],["Latin",i.Latin],["Lepcha",i.Lepcha],["Limbu",i.Limbu],["Linear_A",i.Linear_A],["Linear_B",i.Linear_B],["Lisu",i.Lisu],["Lycian",i.Lycian],["Lydian",i.Lydian],["Mahajani",i.Mahajani],["Makasar",i.Makasar],["Malayalam",i.Malayalam],["Mandaic",i.Mandaic],["Manichaean",i.Manichaean],["Marchen",i.Marchen],["Masaram_Gondi",i.Masaram_Gondi],["Medefaidrin",i.Medefaidrin],["Meetei_Mayek",i.Meetei_Mayek],["Mende_Kikakui",i.Mende_Kikakui],["Meroitic_Cursive",i.Meroitic_Cursive],["Meroitic_Hieroglyphs",i.Meroitic_Hieroglyphs],["Miao",i.Miao],["Modi",i.Modi],["Mongolian",i.Mongolian],["Mro",i.Mro],["Multani",i.Multani],["Myanmar",i.Myanmar],["Nabataean",i.Nabataean],["Nag_Mundari",i.Nag_Mundari],["Nandinagari",i.Nandinagari],["New_Tai_Lue",i.New_Tai_Lue],["Newa",i.Newa],["Nko",i.Nko],["Nushu",i.Nushu],["Nyiakeng_Puachue_Hmong",i.Nyiakeng_Puachue_Hmong],["Ogham",i.Ogham],["Ol_Chiki",i.Ol_Chiki],["Ol_Onal",i.Ol_Onal],["Old_Hungarian",i.Old_Hungarian],["Old_Italic",i.Old_Italic],["Old_North_Arabian",i.Old_North_Arabian],["Old_Permic",i.Old_Permic],["Old_Persian",i.Old_Persian],["Old_Sogdian",i.Old_Sogdian],["Old_South_Arabian",i.Old_South_Arabian],["Old_Turkic",i.Old_Turkic],["Old_Uyghur",i.Old_Uyghur],["Oriya",i.Oriya],["Osage",i.Osage],["Osmanya",i.Osmanya],["Pahawh_Hmong",i.Pahawh_Hmong],["Palmyrene",i.Palmyrene],["Pau_Cin_Hau",i.Pau_Cin_Hau],["Phags_Pa",i.Phags_Pa],["Phoenician",i.Phoenician],["Psalter_Pahlavi",i.Psalter_Pahlavi],["Rejang",i.Rejang],["Runic",i.Runic],["Samaritan",i.Samaritan],["Saurashtra",i.Saurashtra],["Sharada",i.Sharada],["Shavian",i.Shavian],["Siddham",i.Siddham],["SignWriting",i.SignWriting],["Sinhala",i.Sinhala],["Sogdian",i.Sogdian],["Sora_Sompeng",i.Sora_Sompeng],["Soyombo",i.Soyombo],["Sundanese",i.Sundanese],["Sunuwar",i.Sunuwar],["Syloti_Nagri",i.Syloti_Nagri],["Syriac",i.Syriac],["Tagalog",i.Tagalog],["Tagbanwa",i.Tagbanwa],["Tai_Le",i.Tai_Le],["Tai_Tham",i.Tai_Tham],["Tai_Viet",i.Tai_Viet],["Takri",i.Takri],["Tamil",i.Tamil],["Tangsa",i.Tangsa],["Tangut",i.Tangut],["Telugu",i.Telugu],["Thaana",i.Thaana],["Thai",i.Thai],["Tibetan",i.Tibetan],["Tifinagh",i.Tifinagh],["Tirhuta",i.Tirhuta],["Todhri",i.Todhri],["Toto",i.Toto],["Tulu_Tigalari",i.Tulu_Tigalari],["Ugaritic",i.Ugaritic],["Vai",i.Vai],["Vithkuqi",i.Vithkuqi],["Wancho",i.Wancho],["Warang_Citi",i.Warang_Citi],["Yezidi",i.Yezidi],["Yi",i.Yi],["Zanabazar_Square",i.Zanabazar_Square]]);static FOLD_CATEGORIES=new Map([["L",i.foldL],["Ll",i.foldLl],["Lt",i.foldLt],["Lu",i.foldLu],["M",i.foldM],["Mn",i.foldMn]]);static FOLD_SCRIPT=new Map([["Common",i.foldCommon],["Greek",i.foldGreek],["Inherited",i.foldInherited]]);static Print=new l(new Uint32Array([33,126,1,161,172,1,174,887,1,890,895,1,900,906,1,908,910,2,911,929,1,931,1327,1,1329,1366,1,1369,1418,1,1421,1423,1,1425,1479,1,1488,1514,1,1519,1524,1,1542,1563,1,1565,1756,1,1758,1805,1,1808,1866,1,1869,1969,1,1984,2042,1,2045,2093,1,2096,2110,1,2112,2139,1,2142,2144,2,2145,2154,1,2160,2190,1,2199,2273,1,2275,2435,1,2437,2444,1,2447,2448,1,2451,2472,1,2474,2480,1,2482,2486,4,2487,2489,1,2492,2500,1,2503,2504,1,2507,2510,1,2519,2524,5,2525,2527,2,2528,2531,1,2534,2558,1,2561,2563,1,2565,2570,1,2575,2576,1,2579,2600,1,2602,2608,1,2610,2611,1,2613,2614,1,2616,2617,1,2620,2622,2,2623,2626,1,2631,2632,1,2635,2637,1,2641,2649,8,2650,2652,1,2654,2662,8,2663,2678,1,2689,2691,1,2693,2701,1,2703,2705,1,2707,2728,1,2730,2736,1,2738,2739,1,2741,2745,1,2748,2757,1,2759,2761,1,2763,2765,1,2768,2784,16,2785,2787,1,2790,2801,1,2809,2815,1,2817,2819,1,2821,2828,1,2831,2832,1,2835,2856,1,2858,2864,1,2866,2867,1,2869,2873,1,2876,2884,1,2887,2888,1,2891,2893,1,2901,2903,1,2908,2909,1,2911,2915,1,2918,2935,1,2946,2947,1,2949,2954,1,2958,2960,1,2962,2965,1,2969,2970,1,2972,2974,2,2975,2979,4,2980,2984,4,2985,2986,1,2990,3001,1,3006,3010,1,3014,3016,1,3018,3021,1,3024,3031,7,3046,3066,1,3072,3084,1,3086,3088,1,3090,3112,1,3114,3129,1,3132,3140,1,3142,3144,1,3146,3149,1,3157,3158,1,3160,3162,1,3165,3168,3,3169,3171,1,3174,3183,1,3191,3212,1,3214,3216,1,3218,3240,1,3242,3251,1,3253,3257,1,3260,3268,1,3270,3272,1,3274,3277,1,3285,3286,1,3293,3294,1,3296,3299,1,3302,3311,1,3313,3315,1,3328,3340,1,3342,3344,1,3346,3396,1,3398,3400,1,3402,3407,1,3412,3427,1,3430,3455,1,3457,3459,1,3461,3478,1,3482,3505,1,3507,3515,1,3517,3520,3,3521,3526,1,3530,3535,5,3536,3540,1,3542,3544,2,3545,3551,1,3558,3567,1,3570,3572,1,3585,3642,1,3647,3675,1,3713,3714,1,3716,3718,2,3719,3722,1,3724,3747,1,3749,3751,2,3752,3773,1,3776,3780,1,3782,3784,2,3785,3790,1,3792,3801,1,3804,3807,1,3840,3911,1,3913,3948,1,3953,3991,1,3993,4028,1,4030,4044,1,4046,4058,1,4096,4293,1,4295,4301,6,4304,4680,1,4682,4685,1,4688,4694,1,4696,4698,2,4699,4701,1,4704,4744,1,4746,4749,1,4752,4784,1,4786,4789,1,4792,4798,1,4800,4802,2,4803,4805,1,4808,4822,1,4824,4880,1,4882,4885,1,4888,4954,1,4957,4988,1,4992,5017,1,5024,5109,1,5112,5117,1,5120,5759,1,5761,5788,1,5792,5880,1,5888,5909,1,5919,5942,1,5952,5971,1,5984,5996,1,5998,6e3,1,6002,6003,1,6016,6109,1,6112,6121,1,6128,6137,1,6144,6157,1,6159,6169,1,6176,6264,1,6272,6314,1,6320,6389,1,6400,6430,1,6432,6443,1,6448,6459,1,6464,6468,4,6469,6509,1,6512,6516,1,6528,6571,1,6576,6601,1,6608,6618,1,6622,6683,1,6686,6750,1,6752,6780,1,6783,6793,1,6800,6809,1,6816,6829,1,6832,6862,1,6912,6988,1,6990,7155,1,7164,7223,1,7227,7241,1,7245,7306,1,7312,7354,1,7357,7367,1,7376,7418,1,7424,7957,1,7960,7965,1,7968,8005,1,8008,8013,1,8016,8023,1,8025,8031,2,8032,8061,1,8064,8116,1,8118,8132,1,8134,8147,1,8150,8155,1,8157,8175,1,8178,8180,1,8182,8190,1,8208,8231,1,8240,8286,1,8304,8305,1,8308,8334,1,8336,8348,1,8352,8384,1,8400,8432,1,8448,8587,1,8592,9257,1,9280,9290,1,9312,11123,1,11126,11157,1,11159,11507,1,11513,11557,1,11559,11565,6,11568,11623,1,11631,11632,1,11647,11670,1,11680,11686,1,11688,11694,1,11696,11702,1,11704,11710,1,11712,11718,1,11720,11726,1,11728,11734,1,11736,11742,1,11744,11869,1,11904,11929,1,11931,12019,1,12032,12245,1,12272,12287,1,12289,12351,1,12353,12438,1,12441,12543,1,12549,12591,1,12593,12686,1,12688,12773,1,12783,12830,1,12832,42124,1,42128,42182,1,42192,42539,1,42560,42743,1,42752,42957,1,42960,42961,1,42963,42965,2,42966,42972,1,42994,43052,1,43056,43065,1,43072,43127,1,43136,43205,1,43214,43225,1,43232,43347,1,43359,43388,1,43392,43469,1,43471,43481,1,43486,43518,1,43520,43574,1,43584,43597,1,43600,43609,1,43612,43714,1,43739,43766,1,43777,43782,1,43785,43790,1,43793,43798,1,43808,43814,1,43816,43822,1,43824,43883,1,43888,44013,1,44016,44025,1,44032,55203,1,55216,55238,1,55243,55291,1,63744,64109,1,64112,64217,1,64256,64262,1,64275,64279,1,64285,64310,1,64312,64316,1,64318,64320,2,64321,64323,2,64324,64326,2,64327,64450,1,64467,64911,1,64914,64967,1,64975,65008,33,65009,65049,1,65056,65106,1,65108,65126,1,65128,65131,1,65136,65140,1,65142,65276,1,65281,65470,1,65474,65479,1,65482,65487,1,65490,65495,1,65498,65500,1,65504,65510,1,65512,65518,1,65532,65533,1,65536,65547,1,65549,65574,1,65576,65594,1,65596,65597,1,65599,65613,1,65616,65629,1,65664,65786,1,65792,65794,1,65799,65843,1,65847,65934,1,65936,65948,1,65952,66e3,48,66001,66045,1,66176,66204,1,66208,66256,1,66272,66299,1,66304,66339,1,66349,66378,1,66384,66426,1,66432,66461,1,66463,66499,1,66504,66517,1,66560,66717,1,66720,66729,1,66736,66771,1,66776,66811,1,66816,66855,1,66864,66915,1,66927,66938,1,66940,66954,1,66956,66962,1,66964,66965,1,66967,66977,1,66979,66993,1,66995,67001,1,67003,67004,1,67008,67059,1,67072,67382,1,67392,67413,1,67424,67431,1,67456,67461,1,67463,67504,1,67506,67514,1,67584,67589,1,67592,67594,2,67595,67637,1,67639,67640,1,67644,67647,3,67648,67669,1,67671,67742,1,67751,67759,1,67808,67826,1,67828,67829,1,67835,67867,1,67871,67897,1,67903,67968,65,67969,68023,1,68028,68047,1,68050,68099,1,68101,68102,1,68108,68115,1,68117,68119,1,68121,68149,1,68152,68154,1,68159,68168,1,68176,68184,1,68192,68255,1,68288,68326,1,68331,68342,1,68352,68405,1,68409,68437,1,68440,68466,1,68472,68497,1,68505,68508,1,68521,68527,1,68608,68680,1,68736,68786,1,68800,68850,1,68858,68903,1,68912,68921,1,68928,68965,1,68969,68997,1,69006,69007,1,69216,69246,1,69248,69289,1,69291,69293,1,69296,69297,1,69314,69316,1,69372,69415,1,69424,69465,1,69488,69513,1,69552,69579,1,69600,69622,1,69632,69709,1,69714,69749,1,69759,69820,1,69822,69826,1,69840,69864,1,69872,69881,1,69888,69940,1,69942,69959,1,69968,70006,1,70016,70111,1,70113,70132,1,70144,70161,1,70163,70209,1,70272,70278,1,70280,70282,2,70283,70285,1,70287,70301,1,70303,70313,1,70320,70378,1,70384,70393,1,70400,70403,1,70405,70412,1,70415,70416,1,70419,70440,1,70442,70448,1,70450,70451,1,70453,70457,1,70459,70468,1,70471,70472,1,70475,70477,1,70480,70487,7,70493,70499,1,70502,70508,1,70512,70516,1,70528,70537,1,70539,70542,3,70544,70581,1,70583,70592,1,70594,70597,3,70599,70602,1,70604,70613,1,70615,70616,1,70625,70626,1,70656,70747,1,70749,70753,1,70784,70855,1,70864,70873,1,71040,71093,1,71096,71133,1,71168,71236,1,71248,71257,1,71264,71276,1,71296,71353,1,71360,71369,1,71376,71395,1,71424,71450,1,71453,71467,1,71472,71494,1,71680,71739,1,71840,71922,1,71935,71942,1,71945,71948,3,71949,71955,1,71957,71958,1,71960,71989,1,71991,71992,1,71995,72006,1,72016,72025,1,72096,72103,1,72106,72151,1,72154,72164,1,72192,72263,1,72272,72354,1,72368,72440,1,72448,72457,1,72640,72673,1,72688,72697,1,72704,72712,1,72714,72758,1,72760,72773,1,72784,72812,1,72816,72847,1,72850,72871,1,72873,72886,1,72960,72966,1,72968,72969,1,72971,73014,1,73018,73020,2,73021,73023,2,73024,73031,1,73040,73049,1,73056,73061,1,73063,73064,1,73066,73102,1,73104,73105,1,73107,73112,1,73120,73129,1,73440,73464,1,73472,73488,1,73490,73530,1,73534,73562,1,73648,73664,16,73665,73713,1,73727,74649,1,74752,74862,1,74864,74868,1,74880,75075,1,77712,77810,1,77824,78895,1,78912,78933,1,78944,82938,1,82944,83526,1,90368,90425,1,92160,92728,1,92736,92766,1,92768,92777,1,92782,92862,1,92864,92873,1,92880,92909,1,92912,92917,1,92928,92997,1,93008,93017,1,93019,93025,1,93027,93047,1,93053,93071,1,93504,93561,1,93760,93850,1,93952,94026,1,94031,94087,1,94095,94111,1,94176,94180,1,94192,94193,1,94208,100343,1,100352,101589,1,101631,101640,1,110576,110579,1,110581,110587,1,110589,110590,1,110592,110882,1,110898,110928,30,110929,110930,1,110933,110948,15,110949,110951,1,110960,111355,1,113664,113770,1,113776,113788,1,113792,113800,1,113808,113817,1,113820,113823,1,117760,118009,1,118016,118451,1,118528,118573,1,118576,118598,1,118608,118723,1,118784,119029,1,119040,119078,1,119081,119154,1,119163,119274,1,119296,119365,1,119488,119507,1,119520,119539,1,119552,119638,1,119648,119672,1,119808,119892,1,119894,119964,1,119966,119967,1,119970,119973,3,119974,119977,3,119978,119980,1,119982,119993,1,119995,119997,2,119998,120003,1,120005,120069,1,120071,120074,1,120077,120084,1,120086,120092,1,120094,120121,1,120123,120126,1,120128,120132,1,120134,120138,4,120139,120144,1,120146,120485,1,120488,120779,1,120782,121483,1,121499,121503,1,121505,121519,1,122624,122654,1,122661,122666,1,122880,122886,1,122888,122904,1,122907,122913,1,122915,122916,1,122918,122922,1,122928,122989,1,123023,123136,113,123137,123180,1,123184,123197,1,123200,123209,1,123214,123215,1,123536,123566,1,123584,123641,1,123647,124112,465,124113,124153,1,124368,124410,1,124415,124896,481,124897,124902,1,124904,124907,1,124909,124910,1,124912,124926,1,124928,125124,1,125127,125142,1,125184,125259,1,125264,125273,1,125278,125279,1,126065,126132,1,126209,126269,1,126464,126467,1,126469,126495,1,126497,126498,1,126500,126503,3,126505,126514,1,126516,126519,1,126521,126523,2,126530,126535,5,126537,126541,2,126542,126543,1,126545,126546,1,126548,126551,3,126553,126561,2,126562,126564,2,126567,126570,1,126572,126578,1,126580,126583,1,126585,126588,1,126590,126592,2,126593,126601,1,126603,126619,1,126625,126627,1,126629,126633,1,126635,126651,1,126704,126705,1,126976,127019,1,127024,127123,1,127136,127150,1,127153,127167,1,127169,127183,1,127185,127221,1,127232,127405,1,127462,127490,1,127504,127547,1,127552,127560,1,127568,127569,1,127584,127589,1,127744,128727,1,128732,128748,1,128752,128764,1,128768,128886,1,128891,128985,1,128992,129003,1,129008,129024,16,129025,129035,1,129040,129095,1,129104,129113,1,129120,129159,1,129168,129197,1,129200,129211,1,129216,129217,1,129280,129619,1,129632,129645,1,129648,129660,1,129664,129673,1,129679,129734,1,129742,129756,1,129759,129769,1,129776,129784,1,129792,129938,1,129940,130041,1,131072,173791,1,173824,177977,1,177984,178205,1,178208,183969,1,183984,191456,1,191472,192093,1,194560,195101,1,196608,201546,1,201552,205743,1,917760,917999,1]))},w=class{static MAX_RUNE=1114111;static MAX_ASCII=127;static MAX_LATIN1=255;static MAX_BMP=65535;static MIN_FOLD=65;static MAX_FOLD=125251;static is32(t,e){let s=0,n=t.length;for(;sn)continue;let r=t.getLo(s);if(e0&&e>=t.getLo(0)&&this.is32(t,e)}static isUpper(t){if(t<=this.MAX_LATIN1){let e=String.fromCodePoint(t);return e.toUpperCase()===e&&e.toLowerCase()!==e}return this.is(b.Upper,t)}static isPrint(t){return t<=this.MAX_LATIN1?t>=32&&t=161&&t!==173:this.is(b.Print,t)}static simpleFold(t){if(b.CASE_ORBIT.has(t))return b.CASE_ORBIT.get(t);let e=u.toLowerCase(t);return e!==t?e:u.toUpperCase(t)}static equalsIgnoreCase(t,e){if(t<0||e<0||t===e)return!0;if(t<=this.MAX_ASCII&&e<=this.MAX_ASCII)return u.CODES.get("A")<=t&&t<=u.CODES.get("Z")&&(t|=32),u.CODES.get("A")<=e&&e<=u.CODES.get("Z")&&(e|=32),t===e;for(let s=this.simpleFold(t);s!==t;s=this.simpleFold(s))if(s===e)return!0;return!1}},C=class{static METACHARACTERS="\\.+*?()|[]{}^$";static EMPTY_BEGIN_LINE=1;static EMPTY_END_LINE=2;static EMPTY_BEGIN_TEXT=4;static EMPTY_END_TEXT=8;static EMPTY_WORD_BOUNDARY=16;static EMPTY_NO_WORD_BOUNDARY=32;static EMPTY_ALL=-1;static emptyInts(){return[]}static isalnum(t){return u.CODES.get("0")<=t&&t<=u.CODES.get("9")||u.CODES.get("a")<=t&&t<=u.CODES.get("z")||u.CODES.get("A")<=t&&t<=u.CODES.get("Z")}static unhex(t){return u.CODES.get("0")<=t&&t<=u.CODES.get("9")?t-u.CODES.get("0"):u.CODES.get("a")<=t&&t<=u.CODES.get("f")?t-u.CODES.get("a")+10:u.CODES.get("A")<=t&&t<=u.CODES.get("F")?t-u.CODES.get("A")+10:-1}static escapeRune(t){let e="";if(w.isPrint(t))this.METACHARACTERS.indexOf(String.fromCodePoint(t))>=0&&(e+="\\"),e+=String.fromCodePoint(t);else switch(t){case u.CODES.get('"'):e+='\\"';break;case u.CODES.get("\\"):e+="\\\\";break;case u.CODES.get(" "):e+="\\t";break;case u.CODES.get(` -`):e+="\\n";break;case u.CODES.get("\r"):e+="\\r";break;case u.CODES.get("\b"):e+="\\b";break;case u.CODES.get("\f"):e+="\\f";break;default:{let s=t.toString(16);t<256?(e+="\\x",s.length===1&&(e+="0"),e+=s):e+=`\\x{${s}}`;break}}return e}static stringToRunes(t){return String(t).split("").map(e=>e.codePointAt(0))}static runeToString(t){return String.fromCodePoint(t)}static isWordRune(t){return u.CODES.get("a")<=t&&t<=u.CODES.get("z")||u.CODES.get("A")<=t&&t<=u.CODES.get("Z")||u.CODES.get("0")<=t&&t<=u.CODES.get("9")||t===u.CODES.get("_")}static emptyOpContext(t,e){let s=0;return t<0&&(s|=this.EMPTY_BEGIN_TEXT|this.EMPTY_BEGIN_LINE),t===u.CODES.get(` -`)&&(s|=this.EMPTY_BEGIN_LINE),e<0&&(s|=this.EMPTY_END_TEXT|this.EMPTY_END_LINE),e===u.CODES.get(` -`)&&(s|=this.EMPTY_END_LINE),this.isWordRune(t)!==this.isWordRune(e)?s|=this.EMPTY_WORD_BOUNDARY:s|=this.EMPTY_NO_WORD_BOUNDARY,s}static quoteMeta(t){return t.split("").map(e=>this.METACHARACTERS.indexOf(e)>=0?`\\${e}`:e).join("")}static charCount(t){return t>w.MAX_BMP?2:1}static stringToUtf8ByteArray(t){if(globalThis.TextEncoder)return Array.from(new TextEncoder().encode(t));{let e=[],s=0;for(let n=0;n>6|192,e[s++]=r&63|128):(r&64512)===55296&&n+1>18|240,e[s++]=r>>12&63|128,e[s++]=r>>6&63|128,e[s++]=r&63|128):(e[s++]=r>>12|224,e[s++]=r>>6&63|128,e[s++]=r&63|128)}return e}}static utf8ByteArrayToString(t){if(globalThis.TextDecoder)return new TextDecoder("utf-8").decode(new Uint8Array(t));{let e=[],s=0,n=0;for(;s191&&r<224){let a=t[s++];e[n++]=String.fromCharCode((r&31)<<6|a&63)}else if(r>239&&r<365){let a=t[s++],o=t[s++],h=t[s++],p=((r&7)<<18|(a&63)<<12|(o&63)<<6|h&63)-65536;e[n++]=String.fromCharCode(55296+(p>>10)),e[n++]=String.fromCharCode(56320+(p&1023))}else{let a=t[s++],o=t[s++];e[n++]=String.fromCharCode((r&15)<<12|(a&63)<<6|o&63)}}return e.join("")}}},N1=(i=[],t=0)=>{let e={};for(let s=0;st.codePointAt(0))}length(){return this.charSequence.length}},_=class{static utf16(t){return new v(t)}static utf8(t){return Array.isArray(t)?new F(t):new F(C.stringToUtf8ByteArray(t))}},L=class{static EOF(){return-8}canCheckPrefix(){return!0}endPos(){return this.end}},z=class extends L{constructor(t,e=0,s=t.length){super(),this.bytes=t,this.start=e,this.end=s}step(t){if(t+=this.start,t>=this.end)return L.EOF();let e=this.bytes[t++]&255;return(e&128)===0?e<<3|1:(e&224)===192?(e=e&31,t>=this.end?L.EOF():(e=e<<6|this.bytes[t++]&63,e<<3|2)):(e&240)===224?(e=e&15,t+1>=this.end?L.EOF():(e=e<<6|this.bytes[t++]&63,e=e<<6|this.bytes[t++]&63,e<<3|3)):(e=e&7,t+2>=this.end?L.EOF():(e=e<<6|this.bytes[t++]&63,e=e<<6|this.bytes[t++]&63,e=e<<6|this.bytes[t++]&63,e<<3|4))}index(t,e){e+=this.start;let s=this.indexOf(this.bytes,t.prefixUTF8,e);return s<0?s:s-e}context(t){t+=this.start;let e=-1;if(t>this.start&&t<=this.end){let n=t-1;if(e=this.bytes[n--],e>=128){let r=t-4;for(r=r&&(this.bytes[n]&192)===128;)n--;n>3}}let s=t>3:-1;return C.emptyOpContext(e,s)}indexOf(t,e,s=0){let n=e.length;if(n===0)return-1;let r=t.length;for(let a=s;a<=r-n;a++)for(let o=0;o0&&t<=this.charSequence.length?this.charSequence.codePointAt(t-1):-1,s=t{let n=s.codePointAt(0);return n===u.CODES.get("\\")||n===u.CODES.get("$")?`\\${s}`:s}).join(""):t.indexOf("$")<0?t:t.split("").map(s=>s.codePointAt(0)===u.CODES.get("$")?"$$":s).join("")}constructor(t,e){if(t===null)throw new Error("pattern is null");this.patternInput=t;let s=this.patternInput.re2();this.patternGroupCount=s.numberOfCapturingGroups(),this.groups=[],this.namedGroups=s.namedGroups,this.numberOfInstructions=s.numberOfInstructions(),e instanceof I?this.resetMatcherInput(e):Array.isArray(e)?this.resetMatcherInput(_.utf8(e)):this.resetMatcherInput(_.utf16(e))}pattern(){return this.patternInput}reset(){return this.matcherInputLength=this.matcherInput.length(),this.appendPos=0,this.hasMatch=!1,this.hasGroups=!1,this.anchorFlag=0,this}resetMatcherInput(t){if(t===null)throw new Error("input is null");return this.matcherInput=t,this.reset(),this}start(t=0){if(typeof t=="string"){let e=this.namedGroups[t];if(!Number.isFinite(e))throw new U(`group '${t}' not found`);t=e}return this.loadGroup(t),this.groups[2*t]}end(t=0){if(typeof t=="string"){let e=this.namedGroups[t];if(!Number.isFinite(e))throw new U(`group '${t}' not found`);t=e}return this.loadGroup(t),this.groups[2*t+1]}programSize(){return this.numberOfInstructions}group(t=0){if(typeof t=="string"){let n=this.namedGroups[t];if(!Number.isFinite(n))throw new U(`group '${t}' not found`);t=n}let e=this.start(t),s=this.end(t);return e<0&&s<0?null:this.substring(e,s)}groupCount(){return this.patternGroupCount}loadGroup(t){if(t<0||t>this.patternGroupCount)throw new U(`Group index out of bounds: ${t}`);if(!this.hasMatch)throw new U("perhaps no match attempted");if(t===0||this.hasGroups)return;let e=this.groups[1]+1;e>this.matcherInputLength&&(e=this.matcherInputLength);let s=this.patternInput.re2().matchMachineInput(this.matcherInput,this.groups[0],e,this.anchorFlag,1+this.patternGroupCount);if(!s[0])throw new U("inconsistency in matching group data");this.groups=s[1],this.hasGroups=!0}matches(){return this.genMatch(0,g.ANCHOR_BOTH)}lookingAt(){return this.genMatch(0,g.ANCHOR_START)}find(t=null){if(t!==null){if(t<0||t>this.matcherInputLength)throw new U(`start index out of bounds: ${t}`);return this.reset(),this.genMatch(t,0)}return t=0,this.hasMatch&&(t=this.groups[1],this.groups[0]===this.groups[1]&&t++),this.genMatch(t,g.UNANCHORED)}genMatch(t,e){let s=this.patternInput.re2().matchMachineInput(this.matcherInput,t,this.matcherInputLength,e,1);return s[0]?(this.groups=s[1],this.hasMatch=!0,this.hasGroups=!1,this.anchorFlag=e,!0):!1}substring(t,e){return this.matcherInput.isUTF8Encoding()?C.utf8ByteArrayToString(this.matcherInput.asBytes().slice(t,e)):this.matcherInput.asCharSequence().substring(t,e).toString()}inputLength(){return this.matcherInputLength}appendReplacement(t,e=!1){let s="",n=this.start(),r=this.end();return this.appendPosu.CODES.get("9")||o*10+a-u.CODES.get("0")>this.patternGroupCount));r++)o=o*10+a-u.CODES.get("0");if(o>this.patternGroupCount)throw new U(`n > number of groups: ${o}`);let h=this.group(o);h!==null&&(e+=h),s=r,r--;continue}else if(a===u.CODES.get("{")){su.CODES.get("9")||o*10+a-u.CODES.get("0")>this.patternGroupCount));r++)o=o*10+a-u.CODES.get("0");if(o>this.patternGroupCount){e+=`$${o}`,s=r,r--;continue}let h=this.group(o);h!==null&&(e+=h),s=r,r--;continue}else if(a===u.CODES.get("<")){s")&&t.codePointAt(o)!==u.CODES.get(" ");)o++;if(o===t.length||t.codePointAt(o)!==u.CODES.get(">")){e+=t.substring(r-1,o+1),s=o+1;continue}let h=t.substring(r+1,o);Object.prototype.hasOwnProperty.call(this.namedGroups,h)?e+=this.group(h):e+=`$<${h}>`,s=o+1}}return s ${this.out}, ${this.arg}`;case i.ALT_MATCH:return`altmatch -> ${this.out}, ${this.arg}`;case i.CAPTURE:return`cap ${this.arg} -> ${this.out}`;case i.EMPTY_WIDTH:return`empty ${this.arg} -> ${this.out}`;case i.MATCH:return"match";case i.FAIL:return"fail";case i.NOP:return`nop -> ${this.out}`;case i.RUNE:return this.runes===null?"rune ":["rune ",i.escapeRunes(this.runes),(this.arg&g.FOLD_CASE)!==0?"/i":""," -> ",this.out].join("");case i.RUNE1:return`rune1 ${i.escapeRunes(this.runes)} -> ${this.out}`;case i.RUNE_ANY:return`any -> ${this.out}`;case i.RUNE_ANY_NOT_NL:return`anynotnl -> ${this.out}`;default:throw new Error("unhandled case in Inst.toString")}}},V=class{constructor(){this.inst=null,this.cap=[]}},Y=class{constructor(){this.sparse=[],this.densePcs=[],this.denseThreads=[],this.size=0}contains(t){let e=this.sparse[t];return ethis.matchcap.length?this.initNewCap(t):this.resetCap(t)}resetCap(t){for(let e=0;e0?(this.poolSize--,e=this.pool[this.poolSize]):e=new V,e.inst=t,e}freeQueue(t,e=0){let s=t.size-e,n=this.poolSize+s;this.pool.length>3,p=o&7,f=-1,A=0;o!==L.EOF()&&(o=t.step(e+p),f=o>>3,A=o&7);let N;for(e===0?N=C.emptyOpContext(-1,h):N=t.context(e);;){if(r.isEmpty()){if((n&C.EMPTY_BEGIN_TEXT)!==0&&e!==0||this.matched)break;if(this.re2.prefix.length!==0&&f!==this.re2.prefixRune&&t.canCheckPrefix()){let R=t.index(this.re2,e);if(R<0)break;e+=R,o=t.step(e),h=o>>3,p=o&7,o=t.step(e+p),f=o>>3,A=o&7}}!this.matched&&(e===0||s===g.UNANCHORED)&&(this.ncap>0&&(this.matchcap[0]=e),this.add(r,this.prog.start,e,this.matchcap,N,null));let O=e+p;if(N=t.context(O),this.step(r,a,e,O,h,N,s,e===t.endPos()),p===0||this.ncap===0&&this.matched)break;e+=p,h=f,p=A,h!==-1&&(o=t.step(e+p),f=o>>3,A=o&7);let S=r;r=a,a=S}return this.freeQueue(a),this.matched}step(t,e,s,n,r,a,o,h){let p=this.re2.longest;for(let f=0;f0&&this.matchcap[0]0&&(!p||!this.matched||this.matchcap[1]0&&a.cap!==n&&(a.cap=n.slice(0,this.ncap)),t.denseThreads[o]=a,a=null;break;default:throw new Error("unhandled")}return a}},b1=i=>{let t=-2128831035;for(let e=0;e{if(i.length!==t.length)return!1;for(let e=0;e0;){let a=s.pop();if(e.has(a))continue;e.add(a);let o=this.prog.getInst(a);switch(o.op){case E.MATCH:n=!0;break;case E.ALT:case E.ALT_MATCH:s.push(o.out),s.push(o.arg);break;case E.NOP:case E.CAPTURE:s.push(o.out);break;case E.EMPTY_WIDTH:return null}}return{pcs:Int32Array.from(e).sort(),isMatch:n}}getState(t){let e=this.computeClosure(t);if(!e)return null;let s=e.pcs,n=b1(s),r=this.stateCache.get(n);if(r)for(let o=0;o=this.stateLimit)return this.stateCache.clear(),this.stateCount=0,this.startState=null,null;let a=new W(s,e.isMatch);return r.push(a),this.stateCount++,a}step(t,e,s){if(s===g.UNANCHORED&&e<=w.MAX_ASCII){let a=t.nextAscii[e];if(a!==null)return a}else{let a=e+(s===g.UNANCHORED?0:w.MAX_RUNE+1);if(t.nextMap.has(a))return t.nextMap.get(a)}let n=[];for(let a=0;a>3,p=o&7;if(p===0)break;if(r=this.step(r,h,s),r===null)return null;if(r.isMatch)if(s===g.ANCHOR_BOTH){if(a+p===n)return!0}else return!0;if(r.nfaStates.length===0&&s!==g.UNANCHORED)return!1;a+=p}return!1}},c=class i{static Op=N1(["NO_MATCH","EMPTY_MATCH","LITERAL","CHAR_CLASS","ANY_CHAR_NOT_NL","ANY_CHAR","BEGIN_LINE","END_LINE","BEGIN_TEXT","END_TEXT","WORD_BOUNDARY","NO_WORD_BOUNDARY","CAPTURE","STAR","PLUS","QUEST","REPEAT","CONCAT","ALTERNATE","LEFT_PAREN","VERTICAL_BAR"]);static isPseudoOp(t){return t>=i.Op.LEFT_PAREN}static emptySubs(){return[]}static quoteIfHyphen(t){return t===u.CODES.get("-")?"\\":""}static fromRegexp(t){let e=new i(t.op);return e.flags=t.flags,e.subs=t.subs,e.runes=t.runes,e.cap=t.cap,e.min=t.min,e.max=t.max,e.name=t.name,e.namedGroups=t.namedGroups,e}constructor(t){this.op=t,this.flags=0,this.subs=i.emptySubs(),this.runes=[],this.min=0,this.max=0,this.cap=0,this.name=null,this.namedGroups={}}reinit(){this.flags=0,this.subs=i.emptySubs(),this.runes=[],this.cap=0,this.min=0,this.max=0,this.name=null,this.namedGroups={}}toString(){return this.appendTo()}appendTo(){let t="";switch(this.op){case i.Op.NO_MATCH:t+="[^\\x00-\\x{10FFFF}]";break;case i.Op.EMPTY_MATCH:t+="(?:)";break;case i.Op.STAR:case i.Op.PLUS:case i.Op.QUEST:case i.Op.REPEAT:{let e=this.subs[0];switch(e.op>i.Op.CAPTURE||e.op===i.Op.LITERAL&&e.runes.length>1?t+=`(?:${e.appendTo()})`:t+=e.appendTo(),this.op){case i.Op.STAR:t+="*";break;case i.Op.PLUS:t+="+";break;case i.Op.QUEST:t+="?";break;case i.Op.REPEAT:t+=`{${this.min}`,this.min!==this.max&&(t+=",",this.max>=0&&(t+=this.max)),t+="}";break}(this.flags&g.NON_GREEDY)!==0&&(t+="?");break}case i.Op.CONCAT:{for(let e of this.subs)e.op===i.Op.ALTERNATE?t+=`(?:${e.appendTo()})`:t+=e.appendTo();break}case i.Op.ALTERNATE:{let e="";for(let s of this.subs)t+=e,e="|",t+=s.appendTo();break}case i.Op.LITERAL:(this.flags&g.FOLD_CASE)!==0&&(t+="(?i:");for(let e of this.runes)t+=C.escapeRune(e);(this.flags&g.FOLD_CASE)!==0&&(t+=")");break;case i.Op.ANY_CHAR_NOT_NL:t+="(?-s:.)";break;case i.Op.ANY_CHAR:t+="(?s:.)";break;case i.Op.CAPTURE:this.name===null||this.name.length===0?t+="(":t+=`(?P<${this.name}>`,this.subs[0].op!==i.Op.EMPTY_MATCH&&(t+=this.subs[0].appendTo()),t+=")";break;case i.Op.BEGIN_TEXT:t+="\\A";break;case i.Op.END_TEXT:(this.flags&g.WAS_DOLLAR)!==0?t+="(?-m:$)":t+="\\z";break;case i.Op.BEGIN_LINE:t+="^";break;case i.Op.END_LINE:t+="$";break;case i.Op.WORD_BOUNDARY:t+="\\b";break;case i.Op.NO_WORD_BOUNDARY:t+="\\B";break;case i.Op.CHAR_CLASS:if(this.runes.length%2!==0){t+="[invalid char class]";break}if(t+="[",this.runes.length===0)t+="^\\x00-\\x{10FFFF}";else if(this.runes[0]===0&&this.runes[this.runes.length-1]===w.MAX_RUNE){t+="^";for(let e=1;e>1];return(t&1)===0?e.out:e.arg}patch(t,e){for(;t!==0;){let s=this.inst[t>>1];(t&1)===0?(t=s.out,s.out=e):(t=s.arg,s.arg=e)}}append(t,e){if(t===0)return e;if(e===0)return t;let s=t;for(;;){let r=this.next(s);if(r===0)break;s=r}let n=this.inst[s>>1];return(s&1)===0?n.out=e:n.arg=e,t}toString(){let t="";for(let e=0;e0){s=[];for(let n=0;nt.min){let n=i.simplify1(c.Op.QUEST,t.flags,e,null);for(let r=t.min+1;r0&&(s+=" ");let r=t[n],a=t[n+1];r===a?s+=`0x${r.toString(16)}`:s+=`0x${r.toString(16)}-0x${a.toString(16)}`}return s+="]",s}static cmp(t,e,s,n){let r=t[e]-s;return r!==0?r:n-t[e+1]}static qsortIntPair(t,e,s){let n=((e+s)/2|0)&-2,r=t[n],a=t[n+1],o=e,h=s;for(;o<=h;){for(;oe&&i.cmp(t,h,r,a)>0;)h-=2;if(o<=h){if(o!==h){let p=t[o];t[o]=t[h],t[h]=p,p=t[o+1],t[o+1]=t[h+1],t[h+1]=p}o+=2,h-=2}}ethis.r[t-1]&&(this.r[t-1]=n);continue}this.r[t]=s,this.r[t+1]=n,t+=2}return this.len=t,this}appendLiteral(t,e){return(e&g.FOLD_CASE)!==0?this.appendFoldedRange(t,t):this.appendRange(t,t)}appendRange(t,e){if(this.len>0){for(let s=2;s<=4;s+=2)if(this.len>=s){let n=this.r[this.len-s],r=this.r[this.len-s+1];if(t<=r+1&&n<=e+1)return tr&&(this.r[this.len-s+1]=e),this}}return this.r[this.len++]=t,this.r[this.len++]=e,this}appendFoldedRange(t,e){if(t<=w.MIN_FOLD&&e>=w.MAX_FOLD)return this.appendRange(t,e);if(ew.MAX_FOLD)return this.appendRange(t,e);tw.MAX_FOLD&&(this.appendRange(w.MAX_FOLD+1,e),e=w.MAX_FOLD);for(let s=t;s<=e;s++){this.appendRange(s,s);for(let n=w.simpleFold(s);n!==s;n=w.simpleFold(n))this.appendRange(n,n)}return this}appendClass(t){for(let e=0;ew.MAX_FOLD)return t;let e=t,s=t;for(t=w.simpleFold(t);t!==s;t=w.simpleFold(t))e>t&&(e=t);return e}static leadingRegexp(t){if(t.op===c.Op.EMPTY_MATCH)return null;if(t.op===c.Op.CONCAT&&t.subs.length>0){let e=t.subs[0];return e.op===c.Op.EMPTY_MATCH?null:e}return t}static literalRegexp(t,e){let s=new c(c.Op.LITERAL);return s.flags=e,s.runes=C.stringToRunes(t),s}static parse(t,e){return new i(t,e).parseInternal()}static parseRepeat(t){let e=t.pos();if(!t.more()||!t.lookingAt("{"))return-1;t.skip(1);let s=i.parseInt(t);if(s===-1||!t.more())return-1;let n;if(!t.lookingAt(","))n=s;else{if(t.skip(1),!t.more())return-1;if(t.lookingAt("}"))n=-1;else if((n=i.parseInt(t))===-1)return-1}if(!t.more()||!t.lookingAt("}"))return-1;if(t.skip(1),s<0||s>1e3||n===-2||n>1e3||n>=0&&s>n)throw new m(i.ERR_INVALID_REPEAT_SIZE,t.from(e));return s<<16|n&w.MAX_BMP}static isValidCaptureName(t){if(t.length===0)return!1;for(let e=0;e=u.CODES.get("0")&&t.peek()<=u.CODES.get("9");)t.skip(1);let s=t.from(e);return s.length===0||s.length>1&&s.codePointAt(0)===u.CODES.get("0")?-1:s.length>8?-2:parseFloat(s,10)}static isCharClass(t){return t.op===c.Op.LITERAL&&t.runes.length===1||t.op===c.Op.CHAR_CLASS||t.op===c.Op.ANY_CHAR_NOT_NL||t.op===c.Op.ANY_CHAR}static matchRune(t,e){switch(t.op){case c.Op.LITERAL:return t.runes.length===1&&t.runes[0]===e;case c.Op.CHAR_CLASS:for(let s=0;su.CODES.get("7"))break;case u.CODES.get("0"):{let n=s-u.CODES.get("0");for(let r=1;r<3&&!(!t.more()||t.peek()u.CODES.get("7"));r++)n=n*8+t.peek()-u.CODES.get("0"),t.skip(1);return n}case u.CODES.get("x"):{if(!t.more())break;if(s=t.pop(),s===u.CODES.get("{")){let a=0,o=0;for(;;){if(!t.more())break t;if(s=t.pop(),s===u.CODES.get("}"))break;let h=C.unhex(s);if(h<0||(o=o*16+h,o>w.MAX_RUNE))break t;a++}if(a===0)break t;return o}let n=C.unhex(s);if(!t.more())break;s=t.pop();let r=C.unhex(s);if(n<0||r<0)break;return n*16+r}case u.CODES.get("a"):return u.CODES.get("\x07");case u.CODES.get("f"):return u.CODES.get("\f");case u.CODES.get("n"):return u.CODES.get(` -`);case u.CODES.get("r"):return u.CODES.get("\r");case u.CODES.get("t"):return u.CODES.get(" ");case u.CODES.get("v"):return u.CODES.get("\v");default:if(s<=w.MAX_ASCII&&!C.isalnum(s))return s;break}throw new m(i.ERR_INVALID_ESCAPE,t.from(e))}static parseClassChar(t,e){if(!t.more())throw new m(i.ERR_MISSING_BRACKET,t.from(e));return t.lookingAt("\\")?i.parseEscape(t):t.pop()}static concatRunes(t,e){return[...t,...e]}constructor(t,e=0){this.wholeRegexp=t,this.flags=e,this.numCap=0,this.namedGroups={},this.stack=[],this.free=null,this.numRegexp=0,this.numRunes=0,this.repeats=0,this.height=null,this.size=null}newRegexp(t){let e=this.free;return e!==null&&e.subs!==null&&e.subs.length>0?(this.free=e.subs[0],e.reinit(),e.op=t):(e=new c(t),this.numRegexp+=1),e}reuse(t){this.height!==null&&Object.prototype.hasOwnProperty.call(this.height,t)&&delete this.height[t],t.subs!==null&&t.subs.length>0&&(t.subs[0]=this.free),this.free=t}checkLimits(t){if(this.numRunes>i.MAX_RUNES)throw new m(i.ERR_LARGE);this.checkSize(t),this.checkHeight(t)}checkSize(t){if(this.size===null){if(this.repeats===0&&(this.repeats=1),t.op===c.Op.REPEAT){let e=t.max;e===-1&&(e=t.min),e<=0&&(e=1),e>i.MAX_SIZE/this.repeats?this.repeats=i.MAX_SIZE:this.repeats*=e}if(this.numRegexpi.MAX_SIZE)throw new m(i.ERR_LARGE)}calcSize(t,e=!1){if(!e&&Object.prototype.hasOwnProperty.call(this.size,t))return this.size[t];let s=0;switch(t.op){case c.Op.LITERAL:{s=t.runes.length;break}case c.Op.CAPTURE:case c.Op.STAR:{s=2+this.calcSize(t.subs[0]);break}case c.Op.PLUS:case c.Op.QUEST:{s=1+this.calcSize(t.subs[0]);break}case c.Op.CONCAT:{for(let n of t.subs)s=s+this.calcSize(n);break}case c.Op.ALTERNATE:{for(let n of t.subs)s=s+this.calcSize(n);t.subs.length>1&&(s=s+t.subs.length-1);break}case c.Op.REPEAT:{let n=this.calcSize(t.subs[0]);if(t.max===-1){t.min===0?s=2+n:s=1+t.min*n;break}s=t.max*n+(t.max-t.min);break}}return s=Math.max(1,s),this.size[t]=s,s}checkHeight(t){if(!(this.numRegexpi.MAX_HEIGHT)throw new m(i.ERR_NESTING_DEPTH)}}calcHeight(t,e=!1){if(!e&&Object.prototype.hasOwnProperty.call(this.height,t))return this.height[t];let s=1;for(let n of t.subs){let r=this.calcHeight(n);s<1+r&&(s=1+r)}return this.height[t]=s,s}pop(){return this.stack.pop()}popToPseudo(){let t=this.stack.length,e=t;for(;e>0&&!c.isPseudoOp(this.stack[e-1].op);)e--;let s=this.stack.slice(e,t);return this.stack=this.stack.slice(0,e),s}push(t){if(this.numRunes+=t.runes.length,t.op===c.Op.CHAR_CLASS&&t.runes.length===2&&t.runes[0]===t.runes[1]){if(this.maybeConcat(t.runes[0],this.flags&-2))return null;t.op=c.Op.LITERAL,t.runes=[t.runes[0]],t.flags=this.flags&-2}else if(t.op===c.Op.CHAR_CLASS&&t.runes.length===4&&t.runes[0]===t.runes[1]&&t.runes[2]===t.runes[3]&&w.simpleFold(t.runes[0])===t.runes[2]&&w.simpleFold(t.runes[2])===t.runes[0]||t.op===c.Op.CHAR_CLASS&&t.runes.length===2&&t.runes[0]+1===t.runes[1]&&w.simpleFold(t.runes[0])===t.runes[1]&&w.simpleFold(t.runes[1])===t.runes[0]){if(this.maybeConcat(t.runes[0],this.flags|g.FOLD_CASE))return null;t.op=c.Op.LITERAL,t.runes=[t.runes[0]],t.flags=this.flags|g.FOLD_CASE}else this.maybeConcat(-1,0);return this.stack.push(t),this.checkLimits(t),t}maybeConcat(t,e){let s=this.stack.length;if(s<2)return!1;let n=this.stack[s-1],r=this.stack[s-2];return n.op!==c.Op.LITERAL||r.op!==c.Op.LITERAL||(n.flags&g.FOLD_CASE)!==(r.flags&g.FOLD_CASE)?!1:(r.runes=i.concatRunes(r.runes,n.runes),t>=0?(n.runes=[t],n.flags=e,!0):(this.pop(),this.reuse(n),!1))}newLiteral(t,e){let s=this.newRegexp(c.Op.LITERAL);return s.flags=e,(e&g.FOLD_CASE)!==0&&(t=i.minFoldRune(t)),s.runes=[t],s}literal(t){this.push(this.newLiteral(t,this.flags))}op(t){let e=this.newRegexp(t);return e.flags=this.flags,this.push(e)}repeat(t,e,s,n,r,a){let o=this.flags;if((o&g.PERL_X)!==0&&(r.more()&&r.lookingAt("?")&&(r.skip(1),o^=g.NON_GREEDY),a!==-1))throw new m(i.ERR_INVALID_REPEAT_OP,r.from(a));let h=this.stack.length;if(h===0)throw new m(i.ERR_MISSING_REPEAT_ARGUMENT,r.from(n));let p=this.stack[h-1];if(c.isPseudoOp(p.op))throw new m(i.ERR_MISSING_REPEAT_ARGUMENT,r.from(n));let f=this.newRegexp(t);if(f.min=e,f.max=s,f.flags=o,f.subs=[p],this.stack[h-1]=f,this.checkLimits(f),t===c.Op.REPEAT&&(e>=2||s>=2)&&!this.repeatIsValid(f,1e3))throw new m(i.ERR_INVALID_REPEAT_SIZE,r.from(n))}repeatIsValid(t,e){if(t.op===c.Op.REPEAT){let s=t.max;if(s===0)return!0;if(s<0&&(s=t.min),s>e)return!1;s>0&&(e=Math.trunc(e/s))}for(let s of t.subs)if(!this.repeatIsValid(s,e))return!1;return!0}concat(){this.maybeConcat(-1,0);let t=this.popToPseudo();return t.length===0?this.push(this.newRegexp(c.Op.EMPTY_MATCH)):this.push(this.collapse(t,c.Op.CONCAT))}alternate(){let t=this.popToPseudo();return t.length>0&&this.cleanAlt(t[t.length-1]),t.length===0?this.push(this.newRegexp(c.Op.NO_MATCH)):this.push(this.collapse(t,c.Op.ALTERNATE))}cleanAlt(t){t.op===c.Op.CHAR_CLASS&&(t.runes=new x(t.runes).cleanClass().toArray(),t.runes.length===2&&t.runes[0]===0&&t.runes[1]===w.MAX_RUNE?(t.runes=[],t.op=c.Op.ANY_CHAR):t.runes.length===4&&t.runes[0]===0&&t.runes[1]===u.CODES.get(` -`)-1&&t.runes[2]===u.CODES.get(` -`)+1&&t.runes[3]===w.MAX_RUNE&&(t.runes=[],t.op=c.Op.ANY_CHAR_NOT_NL))}collapse(t,e){if(t.length===1)return t[0];let s=0;for(let o of t)s+=o.op===e?o.subs.length:1;let n=new Array(s).fill(null),r=0;for(let o of t)o.op===e?(n.splice(r,o.subs.length,...o.subs),r+=o.subs.length,this.reuse(o)):n[r++]=o;let a=this.newRegexp(e);if(a.subs=n,e===c.Op.ALTERNATE&&(a.subs=this.factor(a.subs),a.subs.length===1)){let o=a;a=a.subs[0],this.reuse(o)}return a}factor(t){if(t.length<2)return t;let e=0,s=t.length,n=0,r=null,a=0,o=0,h=0;for(let f=0;f<=s;f++){let A=null,N=0,O=0;if(f0&&(S=S.subs[0]),S.op===c.Op.LITERAL&&(A=S.runes,N=S.runes.length,O=S.flags&g.FOLD_CASE),O===o){let R=0;for(;R0){a=R;continue}}}if(f!==h)if(f===h+1)t[n++]=t[e+h];else{let S=this.newRegexp(c.Op.LITERAL);S.flags=o,S.runes=r.slice(0,a);for(let k=h;k0){let s=this.removeLeadingString(t.subs[0],e);if(t.subs[0]=s,s.op===c.Op.EMPTY_MATCH)switch(this.reuse(s),t.subs.length){case 0:case 1:t.op=c.Op.EMPTY_MATCH,t.subs=null;break;case 2:{let n=t;t=t.subs[1],this.reuse(n);break}default:t.subs=t.subs.slice(1,t.subs.length);break}return t}return t.op===c.Op.LITERAL&&(t.runes=t.runes.slice(e,t.runes.length),t.runes.length===0&&(t.op=c.Op.EMPTY_MATCH)),t}removeLeadingRegexp(t,e){if(t.op===c.Op.CONCAT&&t.subs.length>0){switch(e&&this.reuse(t.subs[0]),t.subs=t.subs.slice(1,t.subs.length),t.subs.length){case 0:{t.op=c.Op.EMPTY_MATCH,t.subs=c.emptySubs();break}case 1:{let s=t;t=t.subs[0],this.reuse(s);break}}return t}return e&&this.reuse(t),this.newRegexp(c.Op.EMPTY_MATCH)}parseInternal(){if((this.flags&g.LITERAL)!==0)return i.literalRegexp(this.wholeRegexp,this.flags);let t=-1,e=-1,s=-1,n=new t1(this.wholeRegexp);for(;n.more();){let a=-1;t:switch(n.peek()){case u.CODES.get("("):if((this.flags&g.PERL_X)!==0&&n.lookingAt("(?")){this.parsePerlFlags(n);break}this.op(c.Op.LEFT_PAREN).cap=++this.numCap,n.skip(1);break;case u.CODES.get("|"):this.parseVerticalBar(),n.skip(1);break;case u.CODES.get(")"):this.parseRightParen(),n.skip(1);break;case u.CODES.get("^"):(this.flags&g.ONE_LINE)!==0?this.op(c.Op.BEGIN_TEXT):this.op(c.Op.BEGIN_LINE),n.skip(1);break;case u.CODES.get("$"):(this.flags&g.ONE_LINE)!==0?this.op(c.Op.END_TEXT).flags|=g.WAS_DOLLAR:this.op(c.Op.END_LINE),n.skip(1);break;case u.CODES.get("."):(this.flags&g.DOT_NL)!==0?this.op(c.Op.ANY_CHAR):this.op(c.Op.ANY_CHAR_NOT_NL),n.skip(1);break;case u.CODES.get("["):this.parseClass(n);break;case u.CODES.get("*"):case u.CODES.get("+"):case u.CODES.get("?"):{a=n.pos();let o=null;switch(n.pop()){case u.CODES.get("*"):o=c.Op.STAR;break;case u.CODES.get("+"):o=c.Op.PLUS;break;case u.CODES.get("?"):o=c.Op.QUEST;break}this.repeat(o,e,s,a,n,t);break}case u.CODES.get("{"):{a=n.pos();let o=i.parseRepeat(n);if(o<0){n.rewindTo(a),this.literal(n.pop());break}e=o>>16,s=(o&w.MAX_BMP)<<16>>16,this.repeat(c.Op.REPEAT,e,s,a,n,t);break}case u.CODES.get("\\"):{let o=n.pos();if(n.skip(1),(this.flags&g.PERL_X)!==0&&n.more())switch(n.pop()){case u.CODES.get("A"):this.op(c.Op.BEGIN_TEXT);break t;case u.CODES.get("b"):this.op(c.Op.WORD_BOUNDARY);break t;case u.CODES.get("B"):this.op(c.Op.NO_WORD_BOUNDARY);break t;case u.CODES.get("C"):throw new m(i.ERR_INVALID_ESCAPE,"\\C");case u.CODES.get("Q"):{let A=n.rest(),N=A.indexOf("\\E");N>=0&&(A=A.substring(0,N)),n.skipString(A),n.skipString("\\E");let O=0;for(;O");if(h<0)throw new m(i.ERR_INVALID_NAMED_CAPTURE,s);let p=s.substring(o,h);if(t.skipString(p),t.skip(o+1),!i.isValidCaptureName(p))throw new m(i.ERR_INVALID_NAMED_CAPTURE,s.substring(0,h+1));let f=this.op(c.Op.LEFT_PAREN);if(f.cap=++this.numCap,this.namedGroups[p])throw new m(i.ERR_DUPLICATE_NAMED_CAPTURE,p);this.namedGroups[p]=this.numCap,f.name=p;return}t.skip(2);let n=this.flags,r=1,a=!1;t:for(;t.more();){let o=t.pop();switch(o){case u.CODES.get("i"):n|=g.FOLD_CASE,a=!0;break;case u.CODES.get("m"):n&=-17,a=!0;break;case u.CODES.get("s"):n|=g.DOT_NL,a=!0;break;case u.CODES.get("U"):n|=g.NON_GREEDY,a=!0;break;case u.CODES.get("-"):if(r<0)break t;r=-1,n=~n,a=!1;break;case u.CODES.get(":"):case u.CODES.get(")"):if(r<0){if(!a)break t;n=~n}o===u.CODES.get(":")&&this.op(c.Op.LEFT_PAREN),this.flags=n;return;default:break t}}throw new m(i.ERR_INVALID_PERL_OP,t.from(e))}parseVerticalBar(){this.concat(),this.swapVerticalBar()||this.op(c.Op.VERTICAL_BAR)}swapVerticalBar(){let t=this.stack.length;if(t>=3&&this.stack[t-2].op===c.Op.VERTICAL_BAR&&i.isCharClass(this.stack[t-1])&&i.isCharClass(this.stack[t-3])){let e=this.stack[t-1],s=this.stack[t-3];if(e.op>s.op){let n=s;s=e,e=n,this.stack[t-3]=s}return i.mergeCharClass(s,e),this.reuse(e),this.pop(),!0}if(t>=2){let e=this.stack[t-1],s=this.stack[t-2];if(s.op===c.Op.VERTICAL_BAR)return t>=3&&this.cleanAlt(this.stack[t-3]),this.stack[t-2]=e,this.stack[t-1]=s,!0}return!1}parseRightParen(){if(this.concat(),this.swapVerticalBar()&&this.pop(),this.alternate(),this.stack.length<2)throw new m(i.ERR_UNEXPECTED_PAREN,this.wholeRegexp);let e=this.pop(),s=this.pop();if(s.op!==c.Op.LEFT_PAREN)throw new m(i.ERR_UNEXPECTED_PAREN,this.wholeRegexp);this.flags=s.flags,s.cap===0?this.push(e):(s.op=c.Op.CAPTURE,s.subs=[e],this.push(s))}parsePerlClassEscape(t,e){let s=t.pos();if((this.flags&g.PERL_X)===0||!t.more()||t.pop()!==u.CODES.get("\\")||!t.more())return!1;t.pop();let n=t.from(s),r=h1.has(n)?h1.get(n):null;return r===null?!1:(e.appendGroup(r,(this.flags&g.FOLD_CASE)!==0),!0)}parseNamedClass(t,e){let s=t.rest(),n=s.indexOf(":]");if(n<0)return!1;let r=s.substring(0,n+2);t.skipString(r);let a=T1.has(r)?T1.get(r):null;if(a===null)throw new m(i.ERR_INVALID_CHAR_RANGE,r);return e.appendGroup(a,(this.flags&g.FOLD_CASE)!==0),!0}parseUnicodeClass(t,e){let s=t.pos();if((this.flags&g.UNICODE_GROUPS)===0||!t.lookingAt("\\p")&&!t.lookingAt("\\P"))return!1;t.skip(1);let n=1,r=t.pop();if(r===u.CODES.get("P")&&(n=-1),!t.more())throw t.rewindTo(s),new m(i.ERR_INVALID_CHAR_RANGE,t.rest());r=t.pop();let a;if(r!==u.CODES.get("{"))a=C.runeToString(r);else{let f=t.rest(),A=f.indexOf("}");if(A<0)throw t.rewindTo(s),new m(i.ERR_INVALID_CHAR_RANGE,t.rest());a=f.substring(0,A),t.skipString(a),t.skip(1)}a.length!==0&&a.codePointAt(0)===u.CODES.get("^")&&(n=0-n,a=a.substring(1));let o=i.unicodeTable(a);if(o===null)throw new m(i.ERR_INVALID_CHAR_RANGE,t.from(s));let h=o.first,p=o.second;if((this.flags&g.FOLD_CASE)===0||p===null)e.appendTableWithSign(h,n);else{let f=new x().appendTable(h).appendTable(p).cleanClass().toArray();e.appendClassWithSign(f,n)}return!0}parseClass(t){let e=t.pos();t.skip(1);let s=this.newRegexp(c.Op.CHAR_CLASS);s.flags=this.flags;let n=new x,r=1;t.more()&&t.lookingAt("^")&&(r=-1,t.skip(1),(this.flags&g.CLASS_NL)===0&&n.appendRange(u.CODES.get(` -`),u.CODES.get(` -`)));let a=!0;for(;!t.more()||t.peek()!==u.CODES.get("]")||a;){if(t.more()&&t.lookingAt("-")&&(this.flags&g.PERL_X)===0&&!a){let f=t.rest();if(f==="-"||!f.startsWith("-]"))throw t.rewindTo(e),new m(i.ERR_INVALID_CHAR_RANGE,t.rest())}a=!1;let o=t.pos();if(t.lookingAt("[:")){if(this.parseNamedClass(t,n))continue;t.rewindTo(o)}if(this.parseUnicodeClass(t,n)||this.parsePerlClassEscape(t,n))continue;t.rewindTo(o);let h=i.parseClassChar(t,e),p=h;if(t.more()&&t.lookingAt("-")){if(t.skip(1),t.more()&&t.lookingAt("]"))t.skip(-1);else if(p=i.parseClassChar(t,e),p0&&(o.prefixRune=o.prefix.codePointAt(0)),o.namedGroups=n.namedGroups,o}static match(t,e){return i.compile(t).match(e)}constructor(t,e,s=0,n=0){this.expr=t,this.prog=e,this.numSubexp=s,this.longest=n,this.cond=e.startCond(),this.prefix=null,this.prefixUTF8=null,this.prefixComplete=!1,this.prefixRune=0,this.pooled=new s1,this.dfa=new K(e)}executeEngine(t,e,s,n){if(n>0)return this.doExecuteNFA(t,e,s,n);let r=this.dfa.match(t,e,s);return r!==null?r?[]:null:this.doExecuteNFA(t,e,s,n)}numberOfCapturingGroups(){return this.numSubexp}numberOfInstructions(){return this.prog.numInst()}get(){let t;do t=this.pooled.get();while(t&&!this.pooled.compareAndSet(t,t.next));return t}reset(){this.pooled.set(null)}put(t,e){let s=this.pooled.get();do s=this.pooled.get(),!e&&s&&(t=M.fromMachine(t),e=!0),t.next!==s&&(t.next=s);while(!this.pooled.compareAndSet(s,t))}toString(){return this.expr}doExecuteNFA(t,e,s,n){let r=this.get(),a=!1;r?r.next!==null&&(r=M.fromMachine(r),a=!0):(r=M.fromRE2(this),a=!0),r.init(n);let o=r.match(t,e,s)?r.submatches():null;return this.put(r,a),o}match(t){return this.executeEngine(T.fromUTF16(t),0,g.UNANCHORED,0)!==null}matchWithGroup(t,e,s,n,r){return t instanceof I||(t=_.utf16(t)),this.matchMachineInput(t,e,s,n,r)}matchMachineInput(t,e,s,n,r){if(e>s)return[!1,null];let a=t.isUTF16Encoding()?T.fromUTF16(t.asCharSequence(),0,s):T.fromUTF8(t.asBytes(),0,s),o=this.executeEngine(a,e,n,2*r);return o===null?[!1,null]:[!0,o]}matchUTF8(t){return this.executeEngine(T.fromUTF8(t),0,g.UNANCHORED,0)!==null}replaceAll(t,e){return this.replaceAllFunc(t,()=>e,2*t.length+1)}replaceFirst(t,e){return this.replaceAllFunc(t,()=>e,1)}replaceAllFunc(t,e,s){let n=0,r=0,a="",o=T.fromUTF16(t),h=0;for(;r<=t.length;){let p=this.executeEngine(o,r,g.UNANCHORED,2);if(p===null||p.length===0)break;a+=t.substring(n,p[0]),(p[1]>n||p[0]===0)&&(a+=e(t.substring(p[0],p[1])),h++),n=p[1];let f=o.step(r)&7;if(r+f>p[1]?r+=f:r+1>p[1]?r++:r=p[1],h>=s)break}return a+=t.substring(n),a}pad(t){if(t===null)return null;let e=(1+this.numSubexp)*2;if(t.lengthn){let n=[],r=t.endPos();e<0&&(e=r+1);let a=0,o=0,h=-1;for(;o=0&&(s[n]=t.slice(e[2*n],e[2*n+1]));return s}findUTF8SubmatchIndex(t){return this.pad(this.executeEngine(T.fromUTF8(t),0,g.UNANCHORED,this.prog.numCap))}findSubmatch(t){let e=this.executeEngine(T.fromUTF16(t),0,g.UNANCHORED,this.prog.numCap);if(e===null)return null;let s=new Array(1+this.numSubexp).fill(null);for(let n=0;n=0&&(s[n]=t.substring(e[2*n],e[2*n+1]));return s}findSubmatchIndex(t){return this.pad(this.executeEngine(T.fromUTF16(t),0,g.UNANCHORED,this.prog.numCap))}findAllUTF8(t,e){let s=this.allMatches(T.fromUTF8(t),e,n=>t.slice(n[0],n[1]));return s.length===0?null:s}findAllUTF8Index(t,e){let s=this.allMatches(T.fromUTF8(t),e,n=>n.slice(0,2));return s.length===0?null:s}findAll(t,e){let s=this.allMatches(T.fromUTF16(t),e,n=>t.substring(n[0],n[1]));return s.length===0?null:s}findAllIndex(t,e){let s=this.allMatches(T.fromUTF16(t),e,n=>n.slice(0,2));return s.length===0?null:s}findAllUTF8Submatch(t,e){let s=this.allMatches(T.fromUTF8(t),e,n=>{let r=new Array(n.length/2|0).fill(null);for(let a=0;a=0&&(r[a]=t.slice(n[2*a],n[2*a+1]));return r});return s.length===0?null:s}findAllUTF8SubmatchIndex(t,e){let s=this.allMatches(T.fromUTF8(t),e);return s.length===0?null:s}findAllSubmatch(t,e){let s=this.allMatches(T.fromUTF16(t),e,n=>{let r=new Array(n.length/2|0).fill(null);for(let a=0;a=0&&(r[a]=t.substring(n[2*a],n[2*a+1]));return r});return s.length===0?null:s}findAllSubmatchIndex(t,e){let s=this.allMatches(T.fromUTF16(t),e);return s.length===0?null:s}},i1=class i{static isUpperCaseAlpha(t){return"A"<=t&&t<="Z"}static isHexadecimal(t){return"0"<=t&&t<="9"||"A"<=t&&t<="F"||"a"<=t&&t<="f"}static getUtf8CharSize(t){let e=t.charCodeAt(0);return e<128?1:e<2048?2:e<65536?3:4}static translate(t){if(typeof t!="string")return t;let e="",s=!1,n=t.length;n===0&&(e="(?:)",s=!0);let r=0;for(;r>4).toString(16).toUpperCase(),e+=(h.charCodeAt(0)-64&15).toString(16).toUpperCase(),r+=3,s=!0;continue}}e+="\\c",r+=2;continue}case"u":{if(r+2=n||t[r+3]!=="="&&t[r+3]!=="!")){e+="(?P<",r+=3,s=!0;continue}let o=i.getUtf8CharSize(a);e+=t.substring(r,r+o),r+=o}return s?e:t}},y=class i{static CASE_INSENSITIVE=1;static DOTALL=2;static MULTILINE=4;static DISABLE_UNICODE_GROUPS=8;static LONGEST_MATCH=16;static quote(t){return C.quoteMeta(t)}static quoteReplacement(t,e=!1){return B.quoteReplacement(t,e)}static translateRegExp(t){return i1.translate(t)}static compile(t,e=0){let s=t;if((e&i.CASE_INSENSITIVE)!==0&&(s=`(?i)${s}`),(e&i.DOTALL)!==0&&(s=`(?s)${s}`),(e&i.MULTILINE)!==0&&(s=`(?m)${s}`),(e&~(i.MULTILINE|i.DOTALL|i.CASE_INSENSITIVE|i.DISABLE_UNICODE_GROUPS|i.LONGEST_MATCH))!==0)throw new j("Flags should only be a combination of MULTILINE, DOTALL, CASE_INSENSITIVE, DISABLE_UNICODE_GROUPS, LONGEST_MATCH");let n=g.PERL;(e&i.DISABLE_UNICODE_GROUPS)!==0&&(n&=-129);let r=new i(t,e);return r.re2Input=n1.compileImpl(s,n,(e&i.LONGEST_MATCH)!==0),r}static matches(t,e){return i.compile(t).testExact(e)}static initTest(t,e,s){if(t==null)throw new Error("pattern is null");if(s==null)throw new Error("re2 is null");let n=new i(t,e);return n.re2Input=s,n}constructor(t,e){this.patternInput=t,this.flagsInput=e}reset(){this.re2Input.reset()}flags(){return this.flagsInput}pattern(){return this.patternInput}re2(){return this.re2Input}matches(t){return this.testExact(t)}matcher(t){return Array.isArray(t)&&(t=_.utf8(t)),new B(this,t)}test(t){return Array.isArray(t)?this.re2Input.matchUTF8(t):this.re2Input.match(t)}testExact(t){let e=Array.isArray(t)?T.fromUTF8(t):T.fromUTF16(t);return this.re2Input.executeEngine(e,0,g.ANCHOR_BOTH,0)!==null}split(t,e=0){let s=this.matcher(t),n=[],r=0,a=0;for(;s.find();){if(a===0&&s.end()===0){a=s.end();continue}if(e>0&&n.length===e-1)break;if(a===s.start()){if(e===0){r+=1,a=s.end();continue}}else for(;r>0;)n.push(""),r-=1;n.push(s.substring(a,s.start())),a=s.end()}if(e===0&&a!==s.inputLength()){for(;r>0;)n.push(""),r-=1;n.push(s.substring(a,s.inputLength()))}return(e!==0||n.length===0)&&n.push(s.substring(a,s.inputLength())),n}toString(){return this.patternInput}programSize(){return this.re2Input.numberOfInstructions()}groupCount(){return this.re2Input.numberOfCapturingGroups()}namedGroups(){return this.re2Input.namedGroups}equals(t){return this===t?!0:t===null||this.constructor!==t.constructor?!1:this.flagsInput===t.flagsInput&&this.patternInput===t.patternInput}};function x1(i){let t=0;return i.includes("i")&&(t|=y.CASE_INSENSITIVE),i.includes("m")&&(t|=y.MULTILINE),i.includes("s")&&(t|=y.DOTALL),t}function L1(i){return y.translateRegExp(i)}var X=class{_re2;_pattern;_flags;_global;_ignoreCase;_multiline;_lastIndex=0;_nativeRegex=null;_matcher=null;_matcherInput=null;acquireMatcher(t){return this._matcher===null?(this._matcher=this._re2.matcher(t),this._matcherInput=t,this._matcher):(this._matcherInput!==t&&(this._matcher.matcherInput.charSequence=t,this._matcherInput=t),this._matcher.reset(),this._matcher)}constructor(t,e=""){this._pattern=t,this._flags=e,this._global=e.includes("g"),this._ignoreCase=e.includes("i"),this._multiline=e.includes("m");try{let s=L1(t),n=x1(e);this._re2=y.compile(s,n)}catch(s){if(s instanceof m){let n=s.message||"",r="";throw n.includes("(?=")||n.includes("(?!")||n.includes("(?<")||n.includes("(?0){let h=Object.create(null);for(let[p,f]of Object.entries(o)){let A=e.group(f);A!==null&&(h[p]=A)}a.groups=h}return this._global&&(this._lastIndex=e.end(0),e.start(0)===e.end(0)&&this._lastIndex++),a}match(t){if(this._global&&(this._lastIndex=0),!this._global)return this.exec(t);let e=[],s=this.acquireMatcher(t),n=0;for(;s.find(n);){let r=s.group(0)??"";if(e.push(r),n=s.end(0),s.start(0)===s.end(0)&&n++,n>t.length)break}return e.length>0?e:null}replace(t,e){if(this._global&&(this._lastIndex=0),typeof e=="string"){let p=this.acquireMatcher(t);return this._global?p.replaceAll(e,!0):p.replaceFirst(e,!0)}let s=[],n=this._re2.matcher(t),r=0,a=0,o=this._re2.groupCount(),h=this._re2.namedGroups();for(;n.find(a);){s.push(t.slice(r,n.start(0)));let p=[],f=n.group(0)??"";for(let O=1;O<=o;O++)p.push(n.group(O));if(p.push(n.start(0)),p.push(t),h&&Object.keys(h).length>0){let O=Object.create(null);for(let[S,R]of Object.entries(h))O[S]=n.group(R)??"";p.push(O)}let A=n.start(0),N=n.end(0);if(s.push(e(f,...p)),r=N,a=r,A===N&&a++,!this._global||a>t.length)break}return s.push(t.slice(r)),s.join("")}split(t,e){return e===void 0||e<0?this._re2.split(t,-1):e===0?[]:this._re2.split(t,-1).slice(0,e)}search(t){let e=this.acquireMatcher(t);return e.find()?e.start(0):-1}*matchAll(t){if(!this._global)throw new Error("matchAll requires global flag");this._lastIndex=0;let e=this._re2.matcher(t),s=this._re2.groupCount(),n=this._re2.namedGroups(),r=0;for(;e.find(r);){let a=[];a.push(e.group(0)??"");for(let h=1;h<=s;h++)a.push(e.group(h));let o=a;if(o.index=e.start(0),o.input=t,n&&Object.keys(n).length>0){let h=Object.create(null);for(let[p,f]of Object.entries(n)){let A=e.group(f);A!==null&&(h[p]=A)}o.groups=h}if(yield o,r=e.end(0),e.start(0)===e.end(0)&&r++,r>t.length)break}}get native(){if(!this._nativeRegex)try{this._nativeRegex=new RegExp(this._pattern,this._flags)}catch{this._nativeRegex=new RegExp("",this._flags),Object.defineProperty(this._nativeRegex,"source",{value:this._pattern,writable:!1})}return this._nativeRegex}get source(){return this._pattern}get flags(){return this._flags}get global(){return this._global}get ignoreCase(){return this._ignoreCase}get multiline(){return this._multiline}get lastIndex(){return this._lastIndex}set lastIndex(t){this._lastIndex=t}};function I1(i,t=""){return new X(i,t)}var r1=class{_regex;constructor(t){this._regex=t}test(t){return this._regex.global&&(this._regex.lastIndex=0),this._regex.test(t)}exec(t){return this._regex.exec(t)}match(t){return this._regex.global&&(this._regex.lastIndex=0),t.match(this._regex)}replace(t,e){return this._regex.global&&(this._regex.lastIndex=0),t.replace(this._regex,e)}split(t,e){return t.split(this._regex,e)}search(t){return t.search(this._regex)}*matchAll(t){if(!this._regex.global)throw new Error("matchAll requires global flag");this._regex.lastIndex=0;let e=this._regex.exec(t);for(;e!==null;)yield e,e[0].length===0&&this._regex.lastIndex++,e=this._regex.exec(t)}get native(){return this._regex}get source(){return this._regex.source}get flags(){return this._regex.flags}get global(){return this._regex.global}get ignoreCase(){return this._regex.ignoreCase}get multiline(){return this._regex.multiline}get lastIndex(){return this._regex.lastIndex}set lastIndex(t){this._regex.lastIndex=t}};export{I1 as a,r1 as b}; -/*! Bundled license information: - -re2js/build/index.esm.js: - (*! - * re2js - * RE2JS is the JavaScript port of RE2, a regular expression engine that provides linear time matching - * - * @version v1.4.0 - * @author Alexey Vasiliev - * @homepage https://github.com/le0pard/re2js#readme - * @repository github:le0pard/re2js - * @license MIT - *) -*/ diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-7EUWTCWK.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-7EUWTCWK.js deleted file mode 100644 index e48ed8a..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-7EUWTCWK.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a as e,b as a}from"./chunk-QAYAQNCG.js";var t={name:"clear",summary:"clear the terminal screen",usage:"clear [OPTIONS]",options:[" --help display this help and exit"]},s={name:"clear",async execute(r,c){return a(r)?e(t):{stdout:"\x1B[2J\x1B[H",stderr:"",exitCode:0}}},o={name:"clear",flags:[]};export{s as a,o as b}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-A4R2GWRF.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-A4R2GWRF.js deleted file mode 100644 index 28b16e5..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-A4R2GWRF.js +++ /dev/null @@ -1,9 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a as d}from"./chunk-DLL7UR66.js";import{a as f,b as m,c}from"./chunk-QAYAQNCG.js";var g={name:"env",summary:"run a program in a modified environment",usage:"env [OPTION]... [NAME=VALUE]... [COMMAND [ARG]...]",options:["-i, --ignore-environment start with an empty environment","-u NAME, --unset=NAME remove NAME from the environment"," --help display this help and exit"]},M={name:"env",async execute(o,i){if(m(o))return f(g);let a=!1,r=[],u=new Map,t=-1;for(let n=0;n0?` -`:""),stderr:"",exitCode:0}}if(!i.exec)return{stdout:"",stderr:`env: command execution not supported in this context -`,exitCode:1};let p=o.slice(t);return i.exec("command",{cwd:i.cwd,env:d(s),replaceEnv:!0,stdin:i.stdin,stdinKind:"bytes",signal:i.signal,args:p})}},y={name:"printenv",summary:"print all or part of environment",usage:"printenv [OPTION]... [VARIABLE]...",options:[" --help display this help and exit"]},N={name:"printenv",async execute(o,i){if(m(o))return f(y);let a=o.filter(t=>!t.startsWith("-"));if(a.length===0){let t=[];for(let[s,p]of i.env)t.push(`${s}=${p}`);return{stdout:t.join(` -`)+(t.length>0?` -`:""),stderr:"",exitCode:0}}let r=[],u=0;for(let t of a){let s=i.env.get(t);s!==void 0?r.push(s):u=1}return{stdout:r.join(` -`)+(r.length>0?` -`:""),stderr:"",exitCode:u}}},C={name:"env",flags:[{flag:"-i",type:"boolean"},{flag:"-u",type:"value",valueHint:"string"}]},F={name:"printenv",flags:[]};export{M as a,N as b,C as c,F as d}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-AAGO7IQ5.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-AAGO7IQ5.js deleted file mode 100644 index 7837aaf..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-AAGO7IQ5.js +++ /dev/null @@ -1,11 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{c as g}from"./chunk-XEKXHOPO.js";import{a as b,b as m,c as v}from"./chunk-QAYAQNCG.js";var L={name:"unexpand",summary:"convert spaces to tabs",usage:"unexpand [OPTION]... [FILE]...",description:"Convert blanks in each FILE to TABs, writing to standard output. If no FILE is specified, standard input is read.",options:["-t N Use N spaces per tab (default: 8)","-t LIST Use comma-separated list of tab stops","-a Convert all sequences of blanks (not just leading)"],examples:["unexpand file.txt # Convert leading spaces to tabs","unexpand -a file.txt # Convert all space sequences","unexpand -t 4 file.txt # Use 4-space tabs"]};function f(s){let i=s.split(",").map(o=>o.trim()),e=[];for(let o of i){let n=parseInt(o,10);if(Number.isNaN(n)||n<1)return null;e.push(n)}for(let o=1;os)return e;if(i.length>=2){let e=i[i.length-1]-i[i.length-2],o=i[i.length-1],n=Math.floor((s-o)/e)+1;return o+n*e}return-1}function N(s,i){let{tabStops:e,allBlanks:o}=i,n="",a=0,t="",l=0,u=!0,d=()=>{if(t.length===0)return;let r=l+t.length;if(!o&&!u){n+=t,t="";return}let p=l,c="";for(;pp)c+=" ",p=h;else break}let x=r-p;x>0&&(c+=" ".repeat(x)),n+=c,t=""};for(let r of s)r===" "?(t.length===0&&(l=a),t+=r,a++):r===" "?(d(),n+=r,a=C(a,e)):(d(),n+=r,a++,u=!1);return d(),n}function k(s,i){if(s==="")return"";let e=s.split(` -`),o=s.endsWith(` -`)&&e[e.length-1]==="";return o&&e.pop(),e.map(a=>N(a,i)).join(` -`)+(o?` -`:"")}var I={name:"unexpand",execute:async(s,i)=>{if(m(s))return b(L);let e={tabStops:[8],allBlanks:!1},o=[],n=0;for(;n2){let l=f(t.slice(2));if(!l)return{exitCode:1,stdout:"",stderr:`unexpand: invalid tab size: '${t.slice(2)}' -`};e.tabStops=l,n++}else if(t==="--tabs"&&n+1p.PATH_BUFFER)throw new Error(`Path too long: ${e.length} > ${p.PATH_BUFFER}`);this.uint8View.set(e,o.PATH_BUFFER),this.setPathLength(e.length)}getData(){let t=this.getDataLength();return this.uint8View.slice(o.DATA_BUFFER,o.DATA_BUFFER+t)}setData(t){if(t.length>p.DATA_BUFFER)throw new Error(`Data too large: ${t.length} > ${p.DATA_BUFFER}`);this.uint8View.set(t,o.DATA_BUFFER),this.setDataLength(t.length)}getDataAsString(){let t=this.getData();return new TextDecoder().decode(t)}setDataFromString(t){let e=new TextEncoder().encode(t);this.setData(e)}getResult(){let t=this.getResultLength();return this.uint8View.slice(o.DATA_BUFFER,o.DATA_BUFFER+t)}setResult(t){if(t.length>p.DATA_BUFFER)throw new Error(`Result too large: ${t.length} > ${p.DATA_BUFFER}`);this.uint8View.set(t,o.DATA_BUFFER),this.setResultLength(t.length)}getResultAsString(){let t=this.getResult();return new TextDecoder().decode(t)}setResultFromString(t){let e=new TextEncoder().encode(t);this.setResult(e)}encodeStat(t){this.uint8View[o.DATA_BUFFER+u.IS_FILE]=t.isFile?1:0,this.uint8View[o.DATA_BUFFER+u.IS_DIRECTORY]=t.isDirectory?1:0,this.uint8View[o.DATA_BUFFER+u.IS_SYMLINK]=t.isSymbolicLink?1:0,this.dataView.setInt32(o.DATA_BUFFER+u.MODE,t.mode,!0);let e=Math.min(t.size,Number.MAX_SAFE_INTEGER);this.dataView.setFloat64(o.DATA_BUFFER+u.SIZE,e,!0),this.dataView.setFloat64(o.DATA_BUFFER+u.MTIME,t.mtime.getTime(),!0),this.setResultLength(u.TOTAL)}decodeStat(){return{isFile:this.uint8View[o.DATA_BUFFER+u.IS_FILE]===1,isDirectory:this.uint8View[o.DATA_BUFFER+u.IS_DIRECTORY]===1,isSymbolicLink:this.uint8View[o.DATA_BUFFER+u.IS_SYMLINK]===1,mode:this.dataView.getInt32(o.DATA_BUFFER+u.MODE,!0),size:this.dataView.getFloat64(o.DATA_BUFFER+u.SIZE,!0),mtime:new Date(this.dataView.getFloat64(o.DATA_BUFFER+u.MTIME,!0))}}waitForReady(t){return h.wait(this.int32View,o.STATUS/4,r.PENDING,t)}waitForReadyAsync(t){return h.waitAsync(this.int32View,o.STATUS/4,r.PENDING,t)}async waitUntilReady(t){let e=Date.now();for(;;){let a=this.getStatus();if(a===r.READY)return!0;let s=Date.now()-e;if(s>=t)return!1;let i=t-s,c=h.waitAsync(this.int32View,o.STATUS/4,a,i);if(c.async&&await c.value==="timed-out")return!1}}waitForResult(t){return h.wait(this.int32View,o.STATUS/4,r.READY,t)}notify(){return h.notify(this.int32View,o.STATUS/4)}reset(){this.setOpCode(n.NOOP),this.setStatus(r.PENDING),this.setPathLength(0),this.setDataLength(0),this.setResultLength(0),this.setErrorCode(l.NONE),this.setFlags(S.NONE),this.setMode(0)}};var C=class{fs;cwd;commandName;secureFetch;maxOutputSize;exec;invokeTool;protocol;running=!1;output={stdout:"",stderr:"",exitCode:0};outputLimitExceeded=!1;startTime=0;timeoutMs=0;constructor(t,e,a,s,i=void 0,c=0,d=void 0,E=void 0){this.fs=e,this.cwd=a,this.commandName=s,this.secureFetch=i,this.maxOutputSize=c,this.exec=d,this.invokeTool=E,this.protocol=new R(t)}remainingMs(){return Math.max(0,this.timeoutMs-(Date.now()-this.startTime))}raceDeadline(t){let e=this.remainingMs();if(e<=0)return this.running=!1,this.output.exitCode=124,this.output.stderr+=` -${this.commandName}: execution timeout exceeded -`,Promise.reject(new Error("Operation timed out"));let a=t();return new Promise((s,i)=>{let c=F(()=>{this.running=!1,this.output.exitCode=124,this.output.stderr+=` -${this.commandName}: execution timeout exceeded -`,i(new Error("Operation timed out"))},e);a.then(d=>{g(c),s(d)},d=>{g(c),i(d)})})}async run(t){for(this.running=!0,this.startTime=Date.now(),this.timeoutMs=t;this.running;){if(Date.now()-this.startTime>=t){this.output.stderr+=` -${this.commandName}: execution timeout exceeded -`,this.output.exitCode=124;break}let a=this.remainingMs();if(!await this.protocol.waitUntilReady(a)){this.output.stderr+=` -${this.commandName}: execution timeout exceeded -`,this.output.exitCode=124;break}let i=this.protocol.getOpCode();await this.handleOperation(i),this.protocol.notify()}return this.output}stop(){this.running=!1}async handleOperation(t){try{switch(t){case n.READ_FILE:await this.handleReadFile();break;case n.WRITE_FILE:await this.handleWriteFile();break;case n.STAT:await this.handleStat();break;case n.LSTAT:await this.handleLstat();break;case n.READDIR:await this.handleReaddir();break;case n.MKDIR:await this.handleMkdir();break;case n.RM:await this.handleRm();break;case n.EXISTS:await this.handleExists();break;case n.APPEND_FILE:await this.handleAppendFile();break;case n.SYMLINK:await this.handleSymlink();break;case n.READLINK:await this.handleReadlink();break;case n.CHMOD:await this.handleChmod();break;case n.REALPATH:await this.handleRealpath();break;case n.RENAME:await this.handleRename();break;case n.COPY_FILE:await this.handleCopyFile();break;case n.WRITE_STDOUT:this.handleWriteStdout();break;case n.WRITE_STDERR:this.handleWriteStderr();break;case n.EXIT:this.handleExit();break;case n.HTTP_REQUEST:await this.handleHttpRequest();break;case n.EXEC_COMMAND:await this.handleExecCommand();break;case n.INVOKE_TOOL:await this.handleInvokeTool();break;default:this.protocol.setErrorCode(l.IO_ERROR),this.protocol.setStatus(r.ERROR)}}catch(e){this.setErrorFromException(e)}}resolvePath(t){return this.fs.resolvePath(this.cwd,t)}async handleReadFile(){let t=this.resolvePath(this.protocol.getPath());try{let e=await this.fs.readFileBuffer(t);this.protocol.setResult(e),this.protocol.setStatus(r.SUCCESS)}catch(e){this.setErrorFromException(e)}}async handleWriteFile(){let t=this.resolvePath(this.protocol.getPath()),e=this.protocol.getData();try{await this.fs.writeFile(t,e),this.protocol.setStatus(r.SUCCESS)}catch(a){this.setErrorFromException(a)}}async handleStat(){let t=this.resolvePath(this.protocol.getPath());try{let e=await this.fs.stat(t);this.protocol.encodeStat(e),this.protocol.setStatus(r.SUCCESS)}catch(e){this.setErrorFromException(e)}}async handleLstat(){let t=this.resolvePath(this.protocol.getPath());try{let e=await this.fs.lstat(t);this.protocol.encodeStat(e),this.protocol.setStatus(r.SUCCESS)}catch(e){this.setErrorFromException(e)}}async handleReaddir(){let t=this.resolvePath(this.protocol.getPath());try{let e=await this.fs.readdir(t);this.protocol.setResultFromString(JSON.stringify(e)),this.protocol.setStatus(r.SUCCESS)}catch(e){this.setErrorFromException(e)}}async handleMkdir(){let t=this.resolvePath(this.protocol.getPath()),a=(this.protocol.getFlags()&S.MKDIR_RECURSIVE)!==0;try{await this.fs.mkdir(t,{recursive:a}),this.protocol.setStatus(r.SUCCESS)}catch(s){this.setErrorFromException(s)}}async handleRm(){let t=this.resolvePath(this.protocol.getPath()),e=this.protocol.getFlags(),a=(e&S.RECURSIVE)!==0,s=(e&S.FORCE)!==0;try{await this.fs.rm(t,{recursive:a,force:s}),this.protocol.setStatus(r.SUCCESS)}catch(i){this.setErrorFromException(i)}}async handleExists(){let t=this.resolvePath(this.protocol.getPath());try{let e=await this.fs.exists(t);this.protocol.setResult(new Uint8Array([e?1:0])),this.protocol.setStatus(r.SUCCESS)}catch(e){this.setErrorFromException(e)}}async handleAppendFile(){let t=this.resolvePath(this.protocol.getPath()),e=this.protocol.getData();try{await this.fs.appendFile(t,e),this.protocol.setStatus(r.SUCCESS)}catch(a){this.setErrorFromException(a)}}async handleSymlink(){let t=this.protocol.getPath(),e=this.protocol.getDataAsString(),a=this.resolvePath(t);try{await this.fs.symlink(e,a),this.protocol.setStatus(r.SUCCESS)}catch(s){this.setErrorFromException(s)}}async handleReadlink(){let t=this.resolvePath(this.protocol.getPath());try{let e=await this.fs.readlink(t);this.protocol.setResultFromString(e),this.protocol.setStatus(r.SUCCESS)}catch(e){this.setErrorFromException(e)}}async handleChmod(){let t=this.resolvePath(this.protocol.getPath()),e=this.protocol.getMode();try{await this.fs.chmod(t,e),this.protocol.setStatus(r.SUCCESS)}catch(a){this.setErrorFromException(a)}}async handleRealpath(){let t=this.resolvePath(this.protocol.getPath());try{let e=await this.fs.realpath(t);this.protocol.setResultFromString(e),this.protocol.setStatus(r.SUCCESS)}catch(e){this.setErrorFromException(e)}}async handleRename(){let t=this.resolvePath(this.protocol.getPath()),e=this.resolvePath(this.protocol.getDataAsString());try{await this.fs.mv(t,e),this.protocol.setStatus(r.SUCCESS)}catch(a){this.setErrorFromException(a)}}async handleCopyFile(){let t=this.resolvePath(this.protocol.getPath()),e=this.resolvePath(this.protocol.getDataAsString());try{await this.fs.cp(t,e),this.protocol.setStatus(r.SUCCESS)}catch(a){this.setErrorFromException(a)}}handleWriteStdout(){let t=this.protocol.getDataAsString();if(!this.tryAppendOutput("stdout",t)){this.outputLimitExceeded=!0,this.output.exitCode=1,this.appendOutputLimitError(),this.protocol.setErrorCode(l.IO_ERROR),this.protocol.setResultFromString("Output size limit exceeded"),this.protocol.setStatus(r.ERROR);return}this.protocol.setStatus(r.SUCCESS)}handleWriteStderr(){let t=this.protocol.getDataAsString();if(!this.tryAppendOutput("stderr",t)){this.outputLimitExceeded=!0,this.output.exitCode=1,this.appendOutputLimitError(),this.protocol.setErrorCode(l.IO_ERROR),this.protocol.setResultFromString("Output size limit exceeded"),this.protocol.setStatus(r.ERROR);return}this.protocol.setStatus(r.SUCCESS)}handleExit(){let t=this.protocol.getFlags();this.outputLimitExceeded?this.output.exitCode===0&&(this.output.exitCode=1):this.output.exitCode=t,this.protocol.setStatus(r.SUCCESS),this.running=!1}tryAppendOutput(t,e){return this.outputLimitExceeded?!1:this.maxOutputSize<=0?(t==="stdout"?this.output.stdout+=e:this.output.stderr+=e,!0):this.output.stdout.length+this.output.stderr.length+e.length>this.maxOutputSize?!1:(t==="stdout"?this.output.stdout+=e:this.output.stderr+=e,!0)}appendOutputLimitError(){if(this.maxOutputSize<=0)return;let t=`${this.commandName}: total output size exceeded (>${this.maxOutputSize} bytes), increase executionLimits.maxOutputSize -`,e=t.length>this.maxOutputSize?t.slice(0,this.maxOutputSize):t;if(this.output.stderr.includes("total output size exceeded"))return;let s=this.output.stdout.length+this.output.stderr.length+e.length-this.maxOutputSize;if(s>0)if(this.output.stdout.length>=s)this.output.stdout=this.output.stdout.slice(0,this.output.stdout.length-s);else{let i=s-this.output.stdout.length;this.output.stdout="",i>=this.output.stderr.length?this.output.stderr="":this.output.stderr=this.output.stderr.slice(0,this.output.stderr.length-i)}this.output.stderr+=e}async handleHttpRequest(){let t=this.secureFetch;if(!t){this.protocol.setErrorCode(l.NETWORK_NOT_CONFIGURED),this.protocol.setResultFromString("Network access not configured. Enable network in Bash options."),this.protocol.setStatus(r.ERROR);return}let e=this.protocol.getPath(),a=this.protocol.getDataAsString();try{let s=a?JSON.parse(a):{},i=this.remainingMs(),c=await this.raceDeadline(()=>t(e,{method:s.method,headers:s.headers,body:s.body,timeoutMs:i})),d=JSON.stringify({status:c.status,statusText:c.statusText,headers:c.headers,bodyBase64:D(c.body,"base64"),url:c.url});this.protocol.setResultFromString(d),this.protocol.setStatus(r.SUCCESS)}catch(s){let i=m(s instanceof Error?s.message:String(s));this.protocol.setErrorCode(l.NETWORK_ERROR),this.protocol.setResultFromString(i),this.protocol.setStatus(r.ERROR)}}async handleExecCommand(){let t=this.exec;if(!t){this.protocol.setErrorCode(l.IO_ERROR),this.protocol.setResultFromString("Command execution not available in this context."),this.protocol.setStatus(r.ERROR);return}let e=this.protocol.getPath(),a=this.protocol.getDataAsString(),s=new AbortController;try{let i={cwd:this.cwd,signal:s.signal};if(a){let E=JSON.parse(a);E.stdin&&(i.stdin=E.stdin),E.args&&Array.isArray(E.args)&&(i.args=E.args.map(f=>String(f)),e=O([e]))}let c=await this.raceDeadline(()=>t(e,i)),d=JSON.stringify({stdout:c.stdout,stderr:c.stderr,exitCode:c.exitCode});this.protocol.setResultFromString(d),this.protocol.setStatus(r.SUCCESS)}catch(i){s.abort();let c=i instanceof Error?i.message:String(i);this.protocol.setErrorCode(l.IO_ERROR),this.protocol.setResultFromString(c),this.protocol.setStatus(r.ERROR)}}async handleInvokeTool(){let t=this.invokeTool;if(!t){this.protocol.setErrorCode(l.IO_ERROR),this.protocol.setResultFromString("Tool invocation not available in this context."),this.protocol.setStatus(r.ERROR);return}let e=this.protocol.getPath(),a=this.protocol.getDataAsString();try{let s=await this.raceDeadline(()=>T.runTrustedAsync(()=>t(e,a)));this.protocol.setResultFromString(s),this.protocol.setStatus(r.SUCCESS)}catch(s){let i=w(s instanceof Error?s.message:String(s));this.protocol.setErrorCode(l.IO_ERROR),this.protocol.setResultFromString(i),this.protocol.setStatus(r.ERROR)}}setErrorFromException(t){let e=t instanceof Error?t.message:String(t),a=m(e),s=l.IO_ERROR,i=e.toLowerCase();i.includes("no such file")||i.includes("not found")||i.includes("enoent")?s=l.NOT_FOUND:i.includes("is a directory")||i.includes("eisdir")?s=l.IS_DIRECTORY:i.includes("not a directory")||i.includes("enotdir")?s=l.NOT_DIRECTORY:i.includes("already exists")||i.includes("eexist")?s=l.EXISTS:(i.includes("permission")||i.includes("eperm")||i.includes("eacces"))&&(s=l.PERMISSION_DENIED),this.protocol.setErrorCode(s),this.protocol.setResultFromString(a),this.protocol.setStatus(r.ERROR)}};export{x as a,C as b}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-AXMYAPFA.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-AXMYAPFA.js deleted file mode 100644 index 7c90120..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-AXMYAPFA.js +++ /dev/null @@ -1,9 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{c as U}from"./chunk-XEKXHOPO.js";import{a as $,b as F,c as k}from"./chunk-QAYAQNCG.js";var L=new Map([["sha1","SHA-1"],["sha256","SHA-256"]]);function D(n){function h(r,u){return r<>>32-u}let g=new Uint32Array([3614090360,3905402710,606105819,3250441966,4118548399,1200080426,2821735955,4249261313,1770035416,2336552879,4294925233,2304563134,1804603682,4254626195,2792965006,1236535329,4129170786,3225465664,643717713,3921069994,3593408605,38016083,3634488961,3889429448,568446438,3275163606,4107603335,1163531501,2850285829,4243563512,1735328473,2368359562,4294588738,2272392833,1839030562,4259657740,2763975236,1272893353,4139469664,3200236656,681279174,3936430074,3572445317,76029189,3654602809,3873151461,530742520,3299628645,4096336452,1126891415,2878612391,4237533241,1700485571,2399980690,4293915773,2240044497,1873313359,4264355552,2734768916,1309151649,4149444226,3174756917,718787259,3951481745]),A=[7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21],b=n.length*8,c=(n.length%64<56?56:120)-n.length%64,s=new Uint8Array(n.length+c+8);s.set(n),s[n.length]=128;let d=new DataView(s.buffer);d.setUint32(s.length-8,b>>>0,!0),d.setUint32(s.length-4,Math.floor(b/4294967296),!0);let w=1732584193,l=4023233417,p=2562383102,e=271733878;for(let r=0;r>>0,m=o,o=x,x=a,a=a+h(i,A[t])>>>0}w=w+m>>>0,l=l+a>>>0,p=p+x>>>0,e=e+o>>>0}let f=new Uint8Array(16);return new DataView(f.buffer).setUint32(0,w,!0),new DataView(f.buffer).setUint32(4,l,!0),new DataView(f.buffer).setUint32(8,p,!0),new DataView(f.buffer).setUint32(12,e,!0),Array.from(f).map(r=>r.toString(16).padStart(2,"0")).join("")}async function C(n,h){if(n==="md5")return D(h);let g=L.get(n);if(!g)throw new Error(`Unknown algorithm: ${n}`);let A=await globalThis.crypto.subtle.digest(g,new Uint8Array(h).buffer);return Array.from(new Uint8Array(A)).map(b=>b.toString(16).padStart(2,"0")).join("")}function I(n,h,g){let A={name:n,summary:g,usage:`${n} [OPTION]... [FILE]...`,options:["-c, --check read checksums from FILEs and check them"," --help display this help and exit"]};return{name:n,async execute(b,c){if(F(b))return $(A);let s=!1,d=[];for(let e of b)if(e==="-c"||e==="--check")s=!0;else if(!(e==="-b"||e==="-t"||e==="--binary"||e==="--text")){if(e.startsWith("-")&&e!=="-")return k(n,e);d.push(e)}d.length===0&&d.push("-");let w=async e=>{if(e==="-")return Uint8Array.from(c.stdin,f=>f.charCodeAt(0));try{return await c.fs.readFileBuffer(c.fs.resolvePath(c.cwd,e))}catch{return null}};if(s){let e=0,f="";for(let r of d){let u=r==="-"?U(c.stdin):await c.fs.readFile(c.fs.resolvePath(c.cwd,r)).catch(()=>null);if(u===null)return{stdout:"",stderr:`${n}: ${r}: No such file or directory -`,exitCode:1};for(let m of u.split(` -`)){let a=m.match(/^([a-fA-F0-9]+)\s+[* ]?(.+)$/);if(!a)continue;let[,x,o]=a,t=await w(o);if(t===null){f+=`${o}: FAILED open or read -`,e++;continue}let i=await C(h,t)===x.toLowerCase();f+=`${o}: ${i?"OK":"FAILED"} -`,i||e++}}return e>0&&(f+=`${n}: WARNING: ${e} computed checksum${e>1?"s":""} did NOT match -`),{stdout:f,stderr:"",exitCode:e>0?1:0}}let l="",p=0;for(let e of d){let f=await w(e);if(f===null){l+=`${n}: ${e}: No such file or directory -`,p=1;continue}l+=`${await C(h,f)} ${e} -`}return{stdout:l,stderr:"",exitCode:p}}}}export{I as a}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-BU36VZYL.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-BU36VZYL.js deleted file mode 100644 index 3b48be8..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-BU36VZYL.js +++ /dev/null @@ -1,4 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a as p}from"./chunk-RBQG6ZUG.js";import{a as g,b as y,c as h}from"./chunk-QAYAQNCG.js";var w={name:"date",summary:"display the current time in the given FORMAT",usage:"date [OPTION]... [+FORMAT]",options:["-d, --date=STRING display time described by STRING, not 'now'","-u, --utc print Coordinated Universal Time (UTC)","-I, --iso-8601 output date/time in ISO 8601 format","-R, --rfc-email output RFC 5322 date format"," --help display this help and exit"]};function $(t){try{return new Intl.DateTimeFormat(void 0,{timeZone:t}),!0}catch{return!1}}function D(t,s){let r=new Intl.DateTimeFormat("en-US",{timeZone:s,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).formatToParts(t),n=d=>r.find(o=>o.type===d)?.value??"00",i=Number.parseInt(n("hour"),10)%24,l=new Date(`${n("year")}-${n("month")}-${n("day")}T${String(i).padStart(2,"0")}:${n("minute")}:${n("second")}Z`);return Number.isNaN(l.getTime())?null:l}function I(t,s){let r=t.match(/^(\d{4})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2})(?::(\d{2}))?)?$/);if(!r)return null;let[,n,i,l,d="00",o="00",m="00"]=r,c=new Date(`${n}-${i}-${l}T${d}:${o}:${m}Z`);if(Number.isNaN(c.getTime()))return null;try{let a=c;for(let u=0;u<3;u++){let f=D(a,s);if(f===null)return null;let e=f.getTime()-c.getTime();if(e===0)return a;a=new Date(a.getTime()-e)}return a}catch{return null}}function N(t,s){if(t.startsWith("@")){let i=t.slice(1);return/^-?\d+$/.test(i)?new Date(Number.parseInt(i,10)*1e3):null}let r=t.toLowerCase().trim();if(r==="now"||r==="today")return new Date;if(r==="yesterday")return new Date(Date.now()-864e5);if(r==="tomorrow")return new Date(Date.now()+864e5);if(s&&!/Z$/i.test(t)&&!/[+-]\d{2}:?\d{2}$/.test(t)){let i=I(t,s);if(i)return i}let n=new Date(t);return Number.isNaN(n.getTime())?null:n}var C={name:"date",async execute(t,s){if(y(t))return g(w);let r=!1,n=null,i=null,l=!1,d=!1;for(let f=0;ftypeof require<"u"?require:typeof Proxy<"u"?new Proxy(a,{get:(b,c)=>(typeof require<"u"?require:b)[c]}):a)(function(a){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+a+'" is not supported')});var n=(a,b)=>()=>(a&&(b=a(a=0)),b);var o=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports),p=(a,b)=>{for(var c in b)e(a,c,{get:b[c],enumerable:!0})},g=(a,b,c,f)=>{if(b&&typeof b=="object"||typeof b=="function")for(let d of j(b))!l.call(a,d)&&d!==c&&e(a,d,{get:()=>b[d],enumerable:!(f=i(b,d))||f.enumerable});return a};var q=(a,b,c)=>(c=a!=null?h(k(a)):{},g(b||!a||!a.__esModule?e(c,"default",{value:a,enumerable:!0}):c,a)),r=a=>g(e({},"__esModule",{value:!0}),a);export{m as a,n as b,o as c,p as d,q as e,r as f}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-CJFAMHFC.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-CJFAMHFC.js deleted file mode 100644 index 1d6e93d..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-CJFAMHFC.js +++ /dev/null @@ -1,7 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{c as a}from"./chunk-XEKXHOPO.js";import{a as c}from"./chunk-QIQMJJZ4.js";import{a as u,b as p}from"./chunk-QAYAQNCG.js";import*as g from"diff";var b={name:"diff",summary:"compare files line by line",usage:"diff [OPTION]... FILE1 FILE2",options:["-u, --unified output unified diff format (default)","-q, --brief report only whether files differ","-s, --report-identical-files report when files are the same","-i, --ignore-case ignore case differences"," --help display this help and exit"]},C={unified:{short:"u",long:"unified",type:"boolean"},brief:{short:"q",long:"brief",type:"boolean"},reportSame:{short:"s",long:"report-identical-files",type:"boolean"},ignoreCase:{short:"i",long:"ignore-case",type:"boolean"}},L={name:"diff",async execute(d,e){if(p(d))return u(b);let t=c("diff",d,C);if(!t.ok)return t.error;let m=t.result.flags.brief,h=t.result.flags.reportSame,y=t.result.flags.ignoreCase,l=t.result.positional;if(t.result.flags.unified,l.length<2)return{stdout:"",stderr:`diff: missing operand -`,exitCode:2};let i,s,[r,o]=l;try{i=r==="-"?a(e.stdin):await e.fs.readFile(e.fs.resolvePath(e.cwd,r))}catch{return{stdout:"",stderr:`diff: ${r}: No such file or directory -`,exitCode:2}}try{s=o==="-"?a(e.stdin):await e.fs.readFile(e.fs.resolvePath(e.cwd,o))}catch{return{stdout:"",stderr:`diff: ${o}: No such file or directory -`,exitCode:2}}let f=i,n=s;return y&&(f=f.toLowerCase(),n=n.toLowerCase()),f===n?h?{stdout:`Files ${r} and ${o} are identical -`,stderr:"",exitCode:0}:{stdout:"",stderr:"",exitCode:0}:m?{stdout:`Files ${r} and ${o} differ -`,stderr:"",exitCode:1}:{stdout:g.createTwoFilesPatch(r,o,i,s,"","",{context:3}),stderr:"",exitCode:1}}},P={name:"diff",flags:[{flag:"-u",type:"boolean"},{flag:"-q",type:"boolean"},{flag:"-s",type:"boolean"},{flag:"-i",type:"boolean"}],needsArgs:!0,minArgs:2};export{L as a,P as b}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-CN5XGDNN.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-CN5XGDNN.js deleted file mode 100644 index d5cd886..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-CN5XGDNN.js +++ /dev/null @@ -1,6 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a as l}from"./chunk-QIQMJJZ4.js";import{a as u,b as c}from"./chunk-QAYAQNCG.js";var b={name:"base64",summary:"base64 encode/decode data and print to standard output",usage:"base64 [OPTION]... [FILE]",options:["-d, --decode decode data","-w, --wrap=COLS wrap encoded lines after COLS character (default 76, 0 to disable)"," --help display this help and exit"]},m={decode:{short:"d",long:"decode",type:"boolean"},wrap:{short:"w",long:"wrap",type:"number",default:76}};async function p(r,o,n){if(o.length===0||o.length===1&&o[0]==="-")return{ok:!0,data:Uint8Array.from(r.stdin,e=>e.charCodeAt(0))};let d=[];for(let e of o){if(e==="-"){d.push(Uint8Array.from(r.stdin,t=>t.charCodeAt(0)));continue}try{let t=r.fs.resolvePath(r.cwd,e),s=await r.fs.readFileBuffer(t);d.push(s)}catch{return{ok:!1,error:{stdout:"",stderr:`${n}: ${e}: No such file or directory -`,exitCode:1}}}}let f=d.reduce((e,t)=>e+t.length,0),i=new Uint8Array(f),a=0;for(let e of d)i.set(e,a),a+=e.length;return{ok:!0,data:i}}var x={name:"base64",async execute(r,o){if(c(r))return u(b);let n=l("base64",r,m);if(!n.ok)return n.error;let d=n.result.flags.decode,f=n.result.flags.wrap,i=n.result.positional;try{if(d){let t=await p(o,i,"base64");if(!t.ok)return t.error;if(typeof Buffer<"u"){let g=Buffer.from(t.data).toString("utf8").replace(/\s/g,"");return{stdout:Buffer.from(g,"base64").toString("latin1"),stderr:"",exitCode:0,stdoutEncoding:"binary"}}let h=String.fromCharCode(...t.data).replace(/\s/g,"");return{stdout:atob(h),stderr:"",exitCode:0,stdoutEncoding:"binary"}}let a=await p(o,i,"base64");if(!a.ok)return a.error;let e;if(typeof Buffer<"u"?e=Buffer.from(a.data).toString("base64"):e=btoa(String.fromCharCode(...a.data)),f>0){let t=[];for(let s=0;s0?` -`:"")}return{stdout:e,stderr:"",exitCode:0}}catch{return{stdout:"",stderr:`base64: invalid input -`,exitCode:1}}}},v={name:"base64",flags:[{flag:"-d",type:"boolean"},{flag:"-w",type:"value",valueHint:"number"}],stdinType:"text",needsFiles:!0};export{x as a,v as b}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-CQV3EITV.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-CQV3EITV.js deleted file mode 100644 index f344e60..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-CQV3EITV.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a as m}from"./chunk-AXMYAPFA.js";var s=m("md5sum","md5","compute MD5 message digest"),o={name:"md5sum",flags:[{flag:"-c",type:"boolean"}],needsFiles:!0};export{s as a,o as b}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-DLL7UR66.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-DLL7UR66.js deleted file mode 100644 index 7c5dd0a..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-DLL7UR66.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -function r(e){return Object.assign(Object.create(null),Object.fromEntries(e))}function n(e,t){return Object.assign(Object.create(null),Object.fromEntries(e),t)}function c(...e){return Object.assign(Object.create(null),...e)}export{r as a,n as b,c}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-DVJY2RAX.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-DVJY2RAX.js deleted file mode 100644 index 4970d9b..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-DVJY2RAX.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a as s}from"./chunk-AXMYAPFA.js";var a=s("sha1sum","sha1","compute SHA1 message digest"),m={name:"sha1sum",flags:[{flag:"-c",type:"boolean"}],needsFiles:!0};export{a,m as b}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-FHC24QSK.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-FHC24QSK.js deleted file mode 100644 index 8391a82..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-FHC24QSK.js +++ /dev/null @@ -1,7 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a as r,b as u}from"./chunk-QAYAQNCG.js";var d={name:"alias",summary:"define or display aliases",usage:"alias [name[=value] ...]",options:[" --help display this help and exit"]},o="BASH_ALIAS_",m={name:"alias",async execute(e,a){if(u(e))return r(d);if(e.length===0){let s="";for(let[i,t]of a.env)if(i.startsWith(o)){let n=i.slice(o.length);s+=`alias ${n}='${t}' -`}return{stdout:s,stderr:"",exitCode:0}}let l=e[0]==="--"?e.slice(1):e;for(let s of l){let i=s.indexOf("=");if(i===-1){let t=o+s;return a.env.get(t)?{stdout:`alias ${s}='${a.env.get(t)}' -`,stderr:"",exitCode:0}:{stdout:"",stderr:`alias: ${s}: not found -`,exitCode:1}}else{let t=s.slice(0,i),n=s.slice(i+1);(n.startsWith("'")&&n.endsWith("'")||n.startsWith('"')&&n.endsWith('"'))&&(n=n.slice(1,-1)),a.env.set(o+t,n)}}return{stdout:"",stderr:"",exitCode:0}}},c={name:"unalias",async execute(e,a){if(u(e))return r({name:"unalias",summary:"remove alias definitions",usage:"unalias name [name ...]",options:["-a remove all aliases"," --help display this help and exit"]});if(e.length===0)return{stdout:"",stderr:`unalias: usage: unalias [-a] name [name ...] -`,exitCode:1};if(e[0]==="-a"){for(let t of a.env.keys())t.startsWith(o)&&a.env.delete(t);return{stdout:"",stderr:"",exitCode:0}}let l=e[0]==="--"?e.slice(1):e,s=!1,i="";for(let t of l){let n=o+t;a.env.get(n)?a.env.delete(n):(i+=`unalias: ${t}: not found -`,s=!0)}return{stdout:"",stderr:i,exitCode:s?1:0}}},p={name:"alias",flags:[]},h={name:"unalias",flags:[{flag:"-a",type:"boolean"}]};export{m as a,c as b,p as c,h as d}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-FLMHFDSN.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-FLMHFDSN.js deleted file mode 100644 index 21a7242..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-FLMHFDSN.js +++ /dev/null @@ -1,5 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a}from"./chunk-7CSMHFIJ.js";import{a as d}from"./chunk-FOCWZZDE.js";var S={name:"expr",async execute(s,r){if(s.length===0)return{stdout:"",stderr:`expr: missing operand -`,exitCode:2};try{let c=x(s),h=c==="0"||c===""?1:0;return{stdout:`${c} -`,stderr:"",exitCode:h}}catch(c){return{stdout:"",stderr:`expr: ${d(c.message)} -`,exitCode:2}}}};function x(s){if(s.length===1)return s[0];let r=0;function c(){let e=h();for(;r","<=",">="].includes(t)){r++;let o=g(),n=parseInt(e,10),i=parseInt(o,10),f=!Number.isNaN(n)&&!Number.isNaN(i),l;t==="="?l=f?n===i:e===o:t==="!="?l=f?n!==i:e!==o:t==="<"?l=f?n"?l=f?n>i:e>o:t==="<="?l=f?n<=i:e<=o:l=f?n>=i:e>=o,e=l?"1":"0"}else break}return e}function g(){let e=p();for(;r=s.length)throw new Error("syntax error");let e=s[r];if(e==="match"){r++;let t=u(),o=u(),i=a(o).match(t);return i?i[1]!==void 0?i[1]:String(i[0].length):"0"}if(e==="substr"){r++;let t=u(),o=parseInt(u(),10),n=parseInt(u(),10);if(Number.isNaN(o)||Number.isNaN(n))throw new Error("non-integer argument");return t.substring(o-1,o-1+n)}if(e==="index"){r++;let t=u(),o=u();for(let n=0;n=s.length||s[r]!==")")throw new Error("syntax error");return r++,t}return r++,e}return c()}var E={name:"expr",flags:[],needsArgs:!0};export{S as a,E as b}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-FOCWZZDE.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-FOCWZZDE.js deleted file mode 100644 index 21ee2f9..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-FOCWZZDE.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -function a(r,s,t){if(!r)return r;let e=r.replace(/\n\s+at\s.*/g,"");return t&&(e=e.replace(/\bfile:\/\/\/?[^\s'",)}\]:]+/g,"")),e=e.replace(s?/(?:\/(?:Users|home|private|var|opt|Library|System|usr|etc|tmp|nix|snap|workspace|root|srv|mnt|app))\b[^\s'",)}\]:]*/g:/(?:\/(?:Users|home|private|var|opt|Library|System|usr|etc|tmp|nix|snap))\b[^\s'",)}\]:]*/g,""),e=e.replace(/node:internal\/[^\s'",)}\]:]+/g,""),e=e.replace(/[A-Z]:\\[^\s'",)}\]:]+/g,""),t&&(e=e.replace(/\\\\[^\s\\]+\\[^\s'",)}\]:]+/g,"")),e}function n(r){return a(r,!1,!1)}function i(r){return a(r,!0,!0)}export{n as a,i as b}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-FX4RBUYU.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-FX4RBUYU.js deleted file mode 100644 index 8721485..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-FX4RBUYU.js +++ /dev/null @@ -1,5 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a as o,b as i}from"./chunk-QAYAQNCG.js";var m={name:"dirname",summary:"strip last component from file name",usage:"dirname [OPTION] NAME...",options:[" --help display this help and exit"]},p={name:"dirname",async execute(t,l){if(i(t))return o(m);let r=t.filter(n=>!n.startsWith("-"));if(r.length===0)return{stdout:"",stderr:`dirname: missing operand -`,exitCode:1};let e=[];for(let n of r){let a=n.replace(/\/+$/,""),s=a.lastIndexOf("/");s===-1?e.push("."):s===0?e.push("/"):e.push(a.slice(0,s))}return{stdout:`${e.join(` -`)} -`,stderr:"",exitCode:0}}},c={name:"dirname",flags:[],needsArgs:!0};export{p as a,c as b}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-FZRQOL3C.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-FZRQOL3C.js deleted file mode 100644 index 3aae7a5..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-FZRQOL3C.js +++ /dev/null @@ -1,7 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a as m}from"./chunk-W5DWRFSU.js";import{c}from"./chunk-QAYAQNCG.js";function h(s){let a=s.replace(/\//g,"-"),r=new Date(a);if(!Number.isNaN(r.getTime()))return r;let i=a.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(i){let[,o,l,f]=i;if(r=new Date(Number.parseInt(o,10),Number.parseInt(l,10)-1,Number.parseInt(f,10)),!Number.isNaN(r.getTime()))return r}let u=a.match(/^(\d{4})-(\d{2})-(\d{2})\s+(\d{2}):(\d{2}):(\d{2})$/);if(u){let[,o,l,f,t,e,d]=u;if(r=new Date(Number.parseInt(o,10),Number.parseInt(l,10)-1,Number.parseInt(f,10),Number.parseInt(t,10),Number.parseInt(e,10),Number.parseInt(d,10)),!Number.isNaN(r.getTime()))return r}return null}var N={name:"touch",async execute(s,a){let r=[],i=null,u=!1;for(let t=0;t=s.length)return{stdout:"",stderr:`touch: option requires an argument -- 'd' -`,exitCode:1};i=s[++t]}else if(e.startsWith("--date="))i=e.slice(7);else if(e==="-c"||e==="--no-create")u=!0;else if(e==="-a"||e==="-m"||e==="-r"||e==="-t")(e==="-r"||e==="-t")&&t++;else{if(e.startsWith("--"))return c("touch",e);if(e.startsWith("-")&&e.length>1){let d=!1;for(let n of e.slice(1))if(n==="c")u=!0;else if(!(n==="a"||n==="m"))if(n==="d"){if(t+1>=s.length)return{stdout:"",stderr:`touch: option requires an argument -- 'd' -`,exitCode:1};i=s[++t],d=!0;break}else if(n==="r"||n==="t"){t++,d=!0;break}else return c("touch",`-${n}`);if(d)continue}else r.push(e)}}if(r.length===0)return{stdout:"",stderr:`touch: missing file operand -`,exitCode:1};let o=null;if(i!==null&&(o=h(i),o===null))return{stdout:"",stderr:`touch: invalid date format '${i}' -`,exitCode:1};let l="",f=0;for(let t of r)try{let e=a.fs.resolvePath(a.cwd,t);if(!await a.fs.exists(e)){if(u)continue;await a.fs.writeFile(e,"")}let n=o??new Date;await a.fs.utimes(e,n,n)}catch(e){l+=`touch: cannot touch '${t}': ${m(e)} -`,f=1}return{stdout:"",stderr:l,exitCode:f}}},b={name:"touch",flags:[{flag:"-c",type:"boolean"},{flag:"-a",type:"boolean"},{flag:"-m",type:"boolean"},{flag:"-d",type:"value",valueHint:"string"}],needsArgs:!0};export{N as a,b}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-GE6OQDB2.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-GE6OQDB2.js deleted file mode 100644 index 9d998a2..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-GE6OQDB2.js +++ /dev/null @@ -1,10 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a as x}from"./chunk-QAJKDPNS.js";import{a as D,b as ee}from"./chunk-KSBHIW2H.js";import{c as K}from"./chunk-XEKXHOPO.js";import{a as V,b as Y,c as z}from"./chunk-QAYAQNCG.js";var le={name:"grep",summary:"print lines that match patterns",usage:"grep [OPTION]... PATTERN [FILE]...",options:["-E, --extended-regexp PATTERN is an extended regular expression","-P, --perl-regexp PATTERN is a Perl regular expression","-F, --fixed-strings PATTERN is a set of newline-separated strings","-i, --ignore-case ignore case distinctions","-v, --invert-match select non-matching lines","-w, --word-regexp match only whole words","-x, --line-regexp match only whole lines","-c, --count print only a count of matching lines","-l, --files-with-matches print only names of files with matches","-L, --files-without-match print names of files with no matches","-m NUM, --max-count=NUM stop after NUM matches","-n, --line-number print line number with output lines","-h, --no-filename suppress the file name prefix on output","-o, --only-matching show only nonempty parts of lines that match","-q, --quiet, --silent suppress all normal output","-r, -R, --recursive search directories recursively","-A NUM print NUM lines of trailing context","-B NUM print NUM lines of leading context","-C NUM print NUM lines of context","-e PATTERN use PATTERN for matching"," --include=GLOB search only files matching GLOB"," --exclude=GLOB skip files matching GLOB"," --exclude-dir=DIR skip directories matching DIR"," --help display this help and exit"]},te={name:"grep",async execute(t,s){if(Y(t))return V(le);let l=!1,f=!1,u=!1,p=!1,m=!1,a=!1,n=!1,c=!1,y=!1,w=!1,h=!1,d=!1,F=!1,C=!1,I=!1,W=0,P=0,T=0,A=[],E=[],U=[],R=null,H=[];for(let r=0;r1||n)&&!C,j=50;for(let r=0;r{let g=o.path,e=g.split("/").pop()||g;if(E.length>0&&!n&&E.some(N=>x(e,N,{stripQuotes:!0}))||A.length>0&&!n&&!A.some(N=>x(e,N,{stripQuotes:!0})))return null;try{let N=s.fs.resolvePath(s.cwd,g),G=!1;if(o.isFile===void 0?G=(await s.fs.stat(N)).isDirectory:G=!o.isFile,G)return n?null:{error:`grep: ${g}: Is a directory -`};let S=await s.fs.readFile(N);if($&&!u){let J=$.ignoreCase?S.toLowerCase():S;if(!$.needles.some(q=>J.includes(q))){if(p){let q=Z?`${g}:0`:"0";return{file:g,result:{output:`${q} -`,matched:!1,matchCount:0}}}return{file:g,result:{output:"",matched:!1,matchCount:0}}}}let re=D(S,O,{invertMatch:u,showLineNumbers:f,countOnly:p,filename:Z?g:"",onlyMatching:F,beforeContext:P,afterContext:T,maxCount:W,kResetGroup:Q,preFilter:$});return{file:g,result:re}}catch{return{error:`grep: ${g}: No such file or directory -`}}}));for(let o of b){if(o===null)continue;if("error"in o&&o.error){k+=o.error,o.error.includes("Is a directory")||(X=!0);continue}if(!("file"in o)||!o.result)continue;let{file:g,result:e}=o;if(e.matched){if(_=!0,I)return{stdout:"",stderr:"",exitCode:0};m?M+=`${g} -`:a||(M+=e.output)}else a?M+=`${g} -`:p&&!m&&(M+=e.output)}}let B;return X?B=2:a?B=M.length>0?0:1:B=_?0:1,I?{stdout:"",stderr:"",exitCode:B}:{stdout:M,stderr:k,exitCode:B}}},se=256;async function ne(t,s,l,f,u=0){if(u>=se)return;let p=l.fs.resolvePath(l.cwd,t);try{if(!(await l.fs.stat(p)).isDirectory){let n=t.split("/").pop()||"";if(s){let c=s.replace(/^\//,"");x(n,c,{stripQuotes:!0})&&f.push(t)}return}let a=await l.fs.readdir(p);for(let n of a){let c=t==="."?n:`${t}/${n}`,y=l.fs.resolvePath(l.cwd,c);if((await l.fs.stat(y)).isDirectory)await ne(c,s,l,f,u+1);else if(s){let h=s.replace(/^\//,"");x(n,h,{stripQuotes:!0})&&f.push(c)}}}catch{}}async function oe(t,s){let l=[],f=t.lastIndexOf("/"),u,p;if(f===-1?(u=s.cwd,p=t):(u=t.slice(0,f)||"/",p=t.slice(f+1)),t.includes("**")){let a=[],n=t.split("**"),c=n[0].replace(/\/$/,"")||".",y=n[1]||"";return await ne(c,y,s,a),a.map(w=>({path:w}))}let m=s.fs.resolvePath(s.cwd,u);try{if(s.fs.readdirWithFileTypes){let a=await s.fs.readdirWithFileTypes(m);for(let n of a)if(x(n.name,p,{stripQuotes:!0})){let c=f===-1?n.name:`${u}/${n.name}`;l.push({path:c,isFile:n.isFile})}}else{let a=await s.fs.readdir(m);for(let n of a)if(x(n,p,{stripQuotes:!0})){let c=f===-1?n:`${u}/${n}`;l.push({path:c})}}}catch{}return l.sort((a,n)=>a.path.localeCompare(n.path))}async function L(t,s,l=[],f=[],u=[],p,m=0){if(m>=se)return[];let a=s.fs.resolvePath(s.cwd,t),n=[];try{let c,y;if(p!==void 0)c=p,y=!p;else{let h=await s.fs.stat(a);c=h.isFile,y=h.isDirectory}if(c){let h=t.split("/").pop()||t;return f.length>0&&f.some(d=>x(h,d,{stripQuotes:!0}))?[]:l.length>0&&!l.some(d=>x(h,d,{stripQuotes:!0}))?[]:[{path:t,isFile:!0}]}if(!y)return[];let w=t.split("/").pop()||t;if(u.length>0&&u.some(h=>x(w,h,{stripQuotes:!0})))return[];if(s.fs.readdirWithFileTypes){let h=await s.fs.readdirWithFileTypes(a);for(let d of h){if(d.name.startsWith("."))continue;let F=t==="."?d.name:`${t}/${d.name}`,C=await L(F,s,l,f,u,d.isFile,m+1);n.push(...C)}}else{let h=await s.fs.readdir(a);for(let d of h){if(d.startsWith("."))continue;let F=t==="."?d:`${t}/${d}`,C=await L(F,s,l,f,u,void 0,m+1);n.push(...C)}}}catch{}return n}var pe={name:"fgrep",async execute(t,s){return te.execute(["-F",...t],s)}},he={name:"egrep",async execute(t,s){return te.execute(["-E",...t],s)}},de={name:"grep",flags:[{flag:"-E",type:"boolean"},{flag:"-F",type:"boolean"},{flag:"-P",type:"boolean"},{flag:"-i",type:"boolean"},{flag:"-v",type:"boolean"},{flag:"-w",type:"boolean"},{flag:"-x",type:"boolean"},{flag:"-c",type:"boolean"},{flag:"-l",type:"boolean"},{flag:"-L",type:"boolean"},{flag:"-n",type:"boolean"},{flag:"-h",type:"boolean"},{flag:"-o",type:"boolean"},{flag:"-q",type:"boolean"},{flag:"-r",type:"boolean"},{flag:"-m",type:"value",valueHint:"number"},{flag:"-A",type:"value",valueHint:"number"},{flag:"-B",type:"value",valueHint:"number"},{flag:"-C",type:"value",valueHint:"number"},{flag:"-e",type:"value",valueHint:"pattern"}],stdinType:"text",needsArgs:!0},ge={name:"fgrep",flags:[],stdinType:"text",needsArgs:!0},me={name:"egrep",flags:[],stdinType:"text",needsArgs:!0};export{te as a,pe as b,he as c,de as d,ge as e,me as f}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-GHB6M7KA.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-GHB6M7KA.js deleted file mode 100644 index b8fdc7e..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-GHB6M7KA.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a as s}from"./chunk-AXMYAPFA.js";var a=s("sha256sum","sha256","compute SHA256 message digest"),m={name:"sha256sum",flags:[{flag:"-c",type:"boolean"}],needsFiles:!0};export{a,m as b}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-GRQJA2J7.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-GRQJA2J7.js deleted file mode 100644 index 76f3eb5..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-GRQJA2J7.js +++ /dev/null @@ -1,21 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a as Ee}from"./chunk-DLL7UR66.js";import{a as D,b as _}from"./chunk-KAPG5ONA.js";import{a as x}from"./chunk-VACKIICN.js";import{a as v,b as H}from"./chunk-7CSMHFIJ.js";import{c as z}from"./chunk-XEKXHOPO.js";import{k as P}from"./chunk-SAI2SPQQ.js";import{a as fe,b as de,c as ie}from"./chunk-QAYAQNCG.js";var Be=1e4,He=100,$e=new H(/\s+/);function se(e={}){let{fieldSep:t=$e,maxIterations:n=Be,maxRecursionDepth:i=He,maxOutputSize:s=0,fs:a,cwd:o,exec:l,coverage:u,requireDefenseContext:N}=e;return{FS:" ",OFS:" ",ORS:` -`,OFMT:"%.6g",NR:0,NF:0,FNR:0,FILENAME:"",RSTART:0,RLENGTH:-1,SUBSEP:"",fields:[],line:"",vars:Object.create(null),arrays:Object.create(null),arrayAliases:new Map,ARGC:0,ARGV:Object.create(null),ENVIRON:Object.create(null),functions:new Map,fieldSep:t,maxIterations:n,maxRecursionDepth:i,maxOutputSize:s,currentRecursionDepth:0,exitCode:0,shouldExit:!1,shouldNext:!1,shouldNextFile:!1,loopBreak:!1,loopContinue:!1,hasReturn:!1,inEndBlock:!1,output:"",openedFiles:new Set,fs:a,cwd:o,exec:l,coverage:u,requireDefenseContext:N}}function Ne(e,t,n){switch(n){case"+":return e+t;case"-":return e-t;case"*":return e*t;case"/":return t!==0?e/t:0;case"%":return t!==0?e%t:0;case"^":case"**":return e**t;default:return 0}}function M(e){if(typeof e=="number")return e;let t=parseFloat(e);return Number.isNaN(t)?0:t}function k(e){return typeof e=="string"?e:(Number.isInteger(e),String(e))}async function j(e,t){if(e.type==="regex")return e.pattern;let n=k(await t.evalExpr(e));return n.startsWith("/")&&n.endsWith("/")&&(n=n.slice(1,-1)),n}async function Se(e,t){return e?e.type==="variable"?e.name:e.type==="field"?`$${Math.floor(M(await t.evalExpr(e.index)))}`:"$0":"$0"}function me(e,t){if(e==="$0")return t.line;if(e.startsWith("$")){let n=parseInt(e.slice(1),10)-1;return t.fields[n]||""}return k(t.vars[e]??"")}function we(e,t,n){if(e==="$0")n.line=t,n.fields=n.FS===" "?t.trim().split(/\s+/).filter(Boolean):n.fieldSep.split(t),n.NF=n.fields.length;else if(e.startsWith("$")){let i=parseInt(e.slice(1),10)-1;for(;n.fields.length<=i;)n.fields.push("");n.fields[i]=t,n.NF=n.fields.length,n.line=n.fields.join(n.OFS)}else n.vars[e]=t}async function We(e,t,n){return e.length===0?t.line.length:k(await n.evalExpr(e[0])).length}async function Ve(e,t,n){if(e.length<2)return"";let i=k(await n.evalExpr(e[0])),s=Math.floor(M(await n.evalExpr(e[1])))-1;if(e.length>=3){let a=Math.floor(M(await n.evalExpr(e[2])));return i.substr(Math.max(0,s),a)}return i.substr(Math.max(0,s))}async function Ke(e,t,n){if(e.length<2)return 0;let i=k(await n.evalExpr(e[0])),s=k(await n.evalExpr(e[1])),a=i.indexOf(s);return a===-1?0:a+1}async function Xe(e,t,n){if(e.length<2)return 0;let i=k(await n.evalExpr(e[0])),s=e[1];if(s.type!=="variable")return 0;let a=s.name,o=t.FS;if(e.length>=3){let u=e[2];if(u.type==="regex")o=v(u.pattern);else{let N=k(await n.evalExpr(u));o=N===" "?v("\\s+"):N}}else t.FS===" "&&(o=v("\\s+"));let l=typeof o=="string"?i.split(o):o.split(i);t.arrays[a]=Object.create(null);for(let u=0;u{let n="",i=0;for(;i=4?k(await n.evalExpr(e[3])):t.line;try{let l=a.toLowerCase()==="g",u=l?0:parseInt(a,10)||1;if(l)return v(i,"g").replace(o,(A,...C)=>ye(s,A,C.slice(0,-2)));{let N=0;return v(i,"g").replace(o,(C,...O)=>(N++,N===u?ye(s,C,O.slice(0,-2)):C))}}catch{return o}}function ye(e,t,n){let i="",s=0;for(;s="1"&&a<="9"){let o=parseInt(a,10)-1;i+=n[o]||"",s+=2}else a==="n"?(i+=` -`,s+=2):a==="t"?(i+=" ",s+=2):(i+=a,s+=2)}else e[s]==="&"?(i+=t,s++):(i+=e[s],s++);return i}async function Je(e,t,n){return e.length===0?"":k(await n.evalExpr(e[0])).toLowerCase()}async function Ze(e,t,n){return e.length===0?"":k(await n.evalExpr(e[0])).toUpperCase()}async function Ye(e,t,n){if(e.length===0)return"";let i=k(await n.evalExpr(e[0])),s=[];for(let a=1;a0?M(await n.evalExpr(e[0])):0,s=e.length>1?M(await n.evalExpr(e[1])):0;return Math.atan2(i,s)}async function st(e,t,n){return e.length===0?0:Math.log(M(await n.evalExpr(e[0])))}async function at(e,t,n){return e.length===0?1:Math.exp(M(await n.evalExpr(e[0])))}function ot(e,t,n){return t.random?t.random():Math.random()}async function lt(e,t,n){let i=e.length>0?M(await n.evalExpr(e[0])):Date.now();return t.vars._srand_seed=i,i}function ut(e,t){return()=>{throw new Error(`${e}() is not supported - ${t}`)}}function ae(e){return()=>{throw new Error(`function '${e}()' is not implemented`)}}var U=1e4;function Q(e,t){let n=0,i="",s=0;for(;sA&&e[a]==="$"?(N=parseInt(e.substring(A,a),10)-1,a++):a=A;let C=()=>{if(aU&&(l=String(U)),e[a]==="."){if(a++,e[a]==="*"){let d=t[n++];u=String(Math.min(d!==void 0?Math.floor(Number(d)):0,U)),a++}else for(;aU&&(u=String(U))}C();let O=e[a],w=t[N!==void 0?N:n];switch(O){case"s":{let d=w!==void 0?String(w):"";if(u&&(d=d.substring(0,parseInt(u,10))),l){let R=parseInt(l,10);o.includes("-")?d=d.padEnd(R):d=d.padStart(R)}i+=d,N===void 0&&n++;break}case"d":case"i":{let d=w!==void 0?Math.floor(Number(w)):0;Number.isNaN(d)&&(d=0);let R=d<0,h=Math.abs(d).toString();if(u){let F=parseInt(u,10);h=h.padStart(F,"0")}let c="";R?c="-":o.includes("+")?c="+":o.includes(" ")&&(c=" ");let E=c+h;if(l){let F=parseInt(l,10);o.includes("-")?E=E.padEnd(F):o.includes("0")&&!u?E=c+h.padStart(F-c.length,"0"):E=E.padStart(F)}i+=E,N===void 0&&n++;break}case"f":{let d=w!==void 0?Number(w):0;Number.isNaN(d)&&(d=0);let R=u?parseInt(u,10):6,h=d.toFixed(R);if(l){let c=parseInt(l,10);o.includes("-")?h=h.padEnd(c):h=h.padStart(c)}i+=h,N===void 0&&n++;break}case"e":case"E":{let d=w!==void 0?Number(w):0;Number.isNaN(d)&&(d=0);let R=u?parseInt(u,10):6,h=d.toExponential(R);if(O==="E"&&(h=h.toUpperCase()),l){let c=parseInt(l,10);o.includes("-")?h=h.padEnd(c):h=h.padStart(c)}i+=h,N===void 0&&n++;break}case"g":case"G":{let d=w!==void 0?Number(w):0;Number.isNaN(d)&&(d=0);let R=u?parseInt(u,10):6,h=d!==0?Math.floor(Math.log10(Math.abs(d))):0,c;if(d===0?c="0":h<-4||h>=R?(c=d.toExponential(R-1),O==="G"&&(c=c.toUpperCase())):c=d.toPrecision(R),c.includes(".")&&(c=c.replace(/\.?0+$/,"").replace(/\.?0+e/,"e")),c.includes("e")&&(c=c.replace(/\.?0+e/,"e")),l){let E=parseInt(l,10);o.includes("-")?c=c.padEnd(E):c=c.padStart(E)}i+=c,N===void 0&&n++;break}case"x":case"X":{let d=w!==void 0?Math.floor(Number(w)):0;Number.isNaN(d)&&(d=0);let R=Math.abs(d).toString(16);if(O==="X"&&(R=R.toUpperCase()),u){let E=parseInt(u,10);R=R.padStart(E,"0")}let h=d<0?"-":"",c=h+R;if(l){let E=parseInt(l,10);o.includes("-")?c=c.padEnd(E):o.includes("0")&&!u?c=h+R.padStart(E-h.length,"0"):c=c.padStart(E)}i+=c,N===void 0&&n++;break}case"o":{let d=w!==void 0?Math.floor(Number(w)):0;Number.isNaN(d)&&(d=0);let R=Math.abs(d).toString(8);if(u){let E=parseInt(u,10);R=R.padStart(E,"0")}let h=d<0?"-":"",c=h+R;if(l){let E=parseInt(l,10);o.includes("-")?c=c.padEnd(E):o.includes("0")&&!u?c=h+R.padStart(E-h.length,"0"):c=c.padStart(E)}i+=c,N===void 0&&n++;break}case"c":{typeof w=="number"?i+=String.fromCharCode(w):i+=String(w??"").charAt(0)||"",N===void 0&&n++;break}case"%":i+="%";break;default:i+=e.substring(s,a+1)}s=a+1}else if(e[s]==="\\"&&s+10],["fflush",()=>0],["systime",ae("systime")],["mktime",ae("mktime")],["strftime",ae("strftime")]]);function b(e){return typeof e=="number"?e!==0:!(e===""||e==="0")}function g(e){if(typeof e=="number")return e;let t=parseFloat(e);return Number.isNaN(t)?0:t}function m(e){return typeof e=="string"?e:(Number.isInteger(e),String(e))}function oe(e){if(typeof e=="number")return!0;let t=String(e).trim();return t===""?!1:!Number.isNaN(Number(t))}function K(e,t){try{return v(e).test(t)}catch{return!1}}function Ae(e,t){return t===""?[]:e.FS===" "?t.trim().split(/\s+/).filter(Boolean):e.fieldSep.split(t)}function J(e,t){return t===0?e.line:t<0||t>e.fields.length?"":e.fields[t-1]??""}function le(e,t,n){if(t===0)e.line=m(n),e.fields=Ae(e,e.line),e.NF=e.fields.length;else if(t>0){for(;e.fields.lengthe.NF){for(;e.fields.lengthf(e,t.condition)))?await S(e,"ternary consequent evaluation",()=>f(e,t.consequent)):await S(e,"ternary alternate evaluation",()=>f(e,t.alternate));case"call":return Nt(e,t.name,t.args);case"assignment":return St(e,t);case"pre_increment":return mt(e,t.operand);case"pre_decrement":return wt(e,t.operand);case"post_increment":return Rt(e,t.operand);case"post_decrement":return gt(e,t.operand);case"in":return At(e,t.key,t.array);case"getline":return vt(e,t.variable,t.file,t.command);case"tuple":return Ct(e,t.elements);default:return""}}async function ct(e,t){L(e,"field reference evaluation");let n=Math.floor(g(await S(e,"field index evaluation",()=>f(e,t.index))));return J(e,n)}async function ht(e,t){L(e,"array access evaluation");let n=m(await S(e,"array key evaluation",()=>f(e,t.key)));return Y(e,t.array,n)}async function pt(e,t){L(e,"binary expression evaluation");let n=t.operator;if(n==="||")return b(await S(e,"logical-or left evaluation",()=>f(e,t.left)))||b(await S(e,"logical-or right evaluation",()=>f(e,t.right)))?1:0;if(n==="&&")return b(await S(e,"logical-and left evaluation",()=>f(e,t.left)))&&b(await S(e,"logical-and right evaluation",()=>f(e,t.right)))?1:0;if(n==="~"){let l=await S(e,"regex left evaluation",()=>f(e,t.left));t.right.type==="regex"&&e.coverage?.hit("awk:expr:regex");let u=t.right.type==="regex"?t.right.pattern:m(await S(e,"regex right evaluation",()=>f(e,t.right)));try{return v(u).test(m(l))?1:0}catch{return 0}}if(n==="!~"){let l=await S(e,"negated-regex left evaluation",()=>f(e,t.left));t.right.type==="regex"&&e.coverage?.hit("awk:expr:regex");let u=t.right.type==="regex"?t.right.pattern:m(await S(e,"negated-regex right evaluation",()=>f(e,t.right)));try{return v(u).test(m(l))?0:1}catch{return 1}}let i=await S(e,"binary left evaluation",()=>f(e,t.left)),s=await S(e,"binary right evaluation",()=>f(e,t.right));if(n===" "){let l=m(i)+m(s);if(e.maxOutputSize>0&&l.length>e.maxOutputSize)throw new P(`awk: string concatenation size limit exceeded (${e.maxOutputSize} bytes)`,"string_length",e.output);return l}if(ft(n))return dt(i,s,n);let a=g(i),o=g(s);return Ne(a,o,n)}function ft(e){return["<","<=",">",">=","==","!="].includes(e)}function dt(e,t,n){let i=oe(e),s=oe(t);if(i&&s){let l=g(e),u=g(t);switch(n){case"<":return l":return l>u?1:0;case">=":return l>=u?1:0;case"==":return l===u?1:0;case"!=":return l!==u?1:0}}let a=m(e),o=m(t);switch(n){case"<":return a":return a>o?1:0;case">=":return a>=o?1:0;case"==":return a===o?1:0;case"!=":return a!==o?1:0}return 0}async function Et(e,t){L(e,"unary expression evaluation");let n=await S(e,"unary operand evaluation",()=>f(e,t.operand));switch(t.operator){case"!":return b(n)?0:1;case"-":return-g(n);case"+":return+g(n);default:return n}}async function Nt(e,t,n){L(e,"function call evaluation");let i=ge.get(t);if(i)return i(n,e,{evalExpr:a=>f(e,a)});let s=e.functions.get(t);return s?yt(e,s,n):""}async function yt(e,t,n){if(L(e,"user function call"),e.currentRecursionDepth++,e.currentRecursionDepth>e.maxRecursionDepth)throw e.currentRecursionDepth--,new P(`awk: recursion depth exceeded maximum (${e.maxRecursionDepth})`,"recursion",e.output);let i=Object.create(null);for(let l of t.params)i[l]=e.vars[l];let s=[];for(let l=0;lf(e,N));e.vars[u]=A}else e.vars[u]=""}e.hasReturn=!1,e.returnValue=void 0;let a=be;a&&await S(e,"user function body execution",()=>a(e,t.body.statements));let o=e.returnValue??"";for(let l of t.params)i[l]!==void 0?e.vars[l]=i[l]:delete e.vars[l];for(let l of s)e.arrayAliases.delete(l);return e.hasReturn=!1,e.returnValue=void 0,e.currentRecursionDepth--,o}async function St(e,t){L(e,"assignment evaluation");let n=await S(e,"assignment value evaluation",()=>f(e,t.value)),i=t.target,s=t.operator,a;if(s==="=")a=n;else{let o;if(i.type==="field"){let N=Math.floor(g(await S(e,"assignment field index",()=>f(e,i.index))));o=J(e,N)}else if(i.type==="variable")o=Z(e,i.name);else{let N=m(await S(e,"assignment array key",()=>f(e,i.key)));o=Y(e,i.array,N)}let l=g(o),u=g(n);switch(s){case"+=":a=l+u;break;case"-=":a=l-u;break;case"*=":a=l*u;break;case"/=":a=u!==0?l/u:0;break;case"%=":a=u!==0?l%u:0;break;case"^=":a=l**u;break;default:a=n}}if(i.type==="field"){let o=Math.floor(g(await S(e,"assignment target field index",()=>f(e,i.index))));le(e,o,a)}else if(i.type==="variable")W(e,i.name,a);else{let o=m(await S(e,"assignment target array key",()=>f(e,i.key)));ue(e,i.array,o,a)}return a}async function ee(e,t,n,i){L(e,"inc/dec evaluation");let s;if(t.type==="field"){let a=Math.floor(g(await S(e,"inc/dec field index",()=>f(e,t.index))));s=g(J(e,a)),le(e,a,s+n)}else if(t.type==="variable")s=g(Z(e,t.name)),W(e,t.name,s+n);else{let a=m(await S(e,"inc/dec array key",()=>f(e,t.key)));s=g(Y(e,t.array,a)),ue(e,t.array,a,s+n)}return i?s+n:s}async function mt(e,t){return ee(e,t,1,!0)}async function wt(e,t){return ee(e,t,-1,!0)}async function Rt(e,t){return ee(e,t,1,!1)}async function gt(e,t){return ee(e,t,-1,!1)}async function At(e,t,n){L(e,"in-expression evaluation");let i;if(t.type==="tuple"){e.coverage?.hit("awk:expr:tuple");let s=[];for(let a of t.elements)s.push(m(await S(e,"tuple key element evaluation",()=>f(e,a))));i=s.join(e.SUBSEP)}else i=m(await S(e,"in-expression key evaluation",()=>f(e,t)));return Ie(e,n,i)?1:0}async function vt(e,t,n,i){if(L(e,"getline evaluation"),i)return It(e,t,i);if(n)return kt(e,t,n);if(!e.lines||e.lineIndex===void 0)return-1;let s=e.lineIndex+1;if(s>=e.lines.length)return 0;let a=e.lines[s];return t?W(e,t,a):$(e,a),e.NR++,e.lineIndex=s,1}async function It(e,t,n){let i=e.exec;if(!i)return-1;L(e,"getline command source");let s=m(await S(e,"getline command expression",()=>f(e,n))),a=`__cmd_${s}`,o=`__cmdi_${s}`,l,u;if(e.vars[a]===void 0)try{let C=await S(e,"getline command exec",()=>i(s));l=z(C.stdout).split(` -`),l.length>0&&l[l.length-1]===""&&l.pop(),e.vars[a]=JSON.stringify(l),e.vars[o]=-1,u=-1}catch(C){if(C instanceof x)throw C;return-1}else l=JSON.parse(e.vars[a]),u=e.vars[o];let N=u+1;if(N>=l.length)return 0;let A=l[N];return e.vars[o]=N,t?W(e,t,A):$(e,A),1}async function kt(e,t,n){let i=e.fs;if(!i||!e.cwd)return-1;L(e,"getline file source");let s=m(await S(e,"getline filename evaluation",()=>f(e,n)));if(s==="/dev/null")return 0;let a=i.resolvePath(e.cwd,s),o=`__fc_${a}`,l=`__fi_${a}`,u,N;if(e.vars[o]===void 0)try{u=(await S(e,"getline file read",()=>i.readFile(a))).split(` -`),u.length>0&&u[u.length-1]===""&&u.pop(),e.vars[o]=JSON.stringify(u),e.vars[l]=-1,N=-1}catch(O){if(O instanceof x)throw O;return-1}else u=JSON.parse(e.vars[o]),N=e.vars[l];let A=N+1;if(A>=u.length)return 0;let C=u[A];return e.vars[l]=A,t?W(e,t,C):$(e,C),1}async function Ct(e,t){if(L(e,"tuple evaluation"),t.length===0)return"";for(let n=0;nf(e,t[n]));return S(e,"tuple final element",()=>f(e,t[t.length-1]))}Oe(V);function ce(e){if(e.maxOutputSize>0&&e.output.length>e.maxOutputSize)throw new P(`awk: output size limit exceeded (${e.maxOutputSize} bytes)`,"string_length",e.output)}function T(e,t){D(e.requireDefenseContext,"awk",t)}function y(e,t,n){return _(e.requireDefenseContext,"awk",t,n)}async function V(e,t){T(e,"block execution");for(let n of t)if(await y(e,"statement execution",()=>B(e,n)),bt(e))break}function bt(e){return e.shouldExit||e.shouldNext||e.shouldNextFile||e.loopBreak||e.loopContinue||e.hasReturn}async function B(e,t){switch(T(e,"single statement execution"),e.coverage?.hit(`awk:stmt:${t.type}`),t.type){case"block":await y(e,"nested block statement",()=>V(e,t.statements));break;case"expr_stmt":await y(e,"expression statement",()=>f(e,t.expression));break;case"print":await y(e,"print statement",()=>Ot(e,t.args,t.output));break;case"printf":await y(e,"printf statement",()=>Lt(e,t.format,t.args,t.output));break;case"if":await y(e,"if statement",()=>Mt(e,t));break;case"while":await y(e,"while statement",()=>Pt(e,t));break;case"do_while":await y(e,"do-while statement",()=>Tt(e,t));break;case"for":await y(e,"for statement",()=>Ft(e,t));break;case"for_in":await y(e,"for-in statement",()=>Dt(e,t));break;case"break":e.loopBreak=!0;break;case"continue":e.loopContinue=!0;break;case"next":e.shouldNext=!0;break;case"nextfile":e.shouldNextFile=!0;break;case"exit":e.shouldExit=!0;{let n=t.code;e.exitCode=n?Math.floor(g(await y(e,"exit code expression",()=>f(e,n)))):0}break;case"return":e.hasReturn=!0;{let n=t.value;e.returnValue=n?await y(e,"return expression",()=>f(e,n)):""}break;case"delete":await y(e,"delete statement",()=>_t(e,t.target));break}}async function Ot(e,t,n){T(e,"print execution");let i=[];for(let a of t){let o=await y(e,"print argument evaluation",()=>f(e,a));typeof o=="number"?Number.isInteger(o)&&Math.abs(o)Le(e,n.redirect,n.file,s)):(e.output+=s,ce(e))}async function Lt(e,t,n,i){T(e,"printf execution");let s=m(await y(e,"printf format evaluation",()=>f(e,t))),a=[];for(let l of n)a.push(await y(e,"printf argument evaluation",()=>f(e,l)));let o=Q(s,a);i?await y(e,"printf redirection write",()=>Le(e,i.redirect,i.file,o)):(e.output+=o,ce(e))}async function Le(e,t,n,i){T(e,"file write execution");let s=e.fs;if(!s||!e.cwd){e.output+=i,ce(e);return}let a=m(await y(e,"redirection filename evaluation",()=>f(e,n))),o=s.resolvePath(e.cwd,a);t===">"?e.openedFiles.has(o)?await y(e,"redirection append write",()=>s.appendFile(o,i)):(await y(e,"redirection overwrite write",()=>s.writeFile(o,i)),e.openedFiles.add(o)):(e.openedFiles.has(o)||e.openedFiles.add(o),await y(e,"redirection append mode write",()=>s.appendFile(o,i)))}async function Mt(e,t){if(T(e,"if execution"),b(await y(e,"if condition evaluation",()=>f(e,t.condition))))await y(e,"if consequent execution",()=>B(e,t.consequent));else if(t.alternate){let n=t.alternate;await y(e,"if alternate execution",()=>B(e,n))}}async function Pt(e,t){T(e,"while execution");let n=0;for(;b(await y(e,"while condition evaluation",()=>f(e,t.condition)));){if(n++,n>e.maxIterations)throw new P(`awk: while loop exceeded maximum iterations (${e.maxIterations})`,"iterations",e.output);if(e.loopContinue=!1,await y(e,"while body execution",()=>B(e,t.body)),e.loopBreak){e.loopBreak=!1;break}if(e.shouldExit||e.shouldNext||e.hasReturn)break}}async function Tt(e,t){T(e,"do-while execution");let n=0;do{if(n++,n>e.maxIterations)throw new P(`awk: do-while loop exceeded maximum iterations (${e.maxIterations})`,"iterations",e.output);if(e.loopContinue=!1,await y(e,"do-while body execution",()=>B(e,t.body)),e.loopBreak){e.loopBreak=!1;break}if(e.shouldExit||e.shouldNext||e.hasReturn)break}while(b(await y(e,"do-while condition evaluation",()=>f(e,t.condition))))}async function Ft(e,t){T(e,"for execution");let n=t.init,i=t.condition,s=t.update;n&&await y(e,"for init evaluation",()=>f(e,n));let a=0;for(;!i||b(await y(e,"for condition evaluation",()=>f(e,i)));){if(a++,a>e.maxIterations)throw new P(`awk: for loop exceeded maximum iterations (${e.maxIterations})`,"iterations",e.output);if(e.loopContinue=!1,await y(e,"for body execution",()=>B(e,t.body)),e.loopBreak){e.loopBreak=!1;break}if(e.shouldExit||e.shouldNext||e.hasReturn)break;s&&await y(e,"for update evaluation",()=>f(e,s))}}async function Dt(e,t){T(e,"for-in execution");let n=e.arrays[t.array];if(n)for(let i of Object.keys(n)){if(e.vars[t.variable]=i,e.loopContinue=!1,await y(e,"for-in body execution",()=>B(e,t.body)),e.loopBreak){e.loopBreak=!1;break}if(e.shouldExit||e.shouldNext||e.hasReturn)break}}async function _t(e,t){if(T(e,"delete execution"),t.type==="array_access"){let n=m(await y(e,"delete key evaluation",()=>f(e,t.key)));ke(e,t.array,n)}else t.type==="variable"&&Ce(e,t.name)}var q=class{ctx;program=null;rangeStates=[];constructor(t){this.ctx=t}assertDefenseContext(t){D(this.ctx.requireDefenseContext,"awk",t)}withDefenseContext(t,n){return _(this.ctx.requireDefenseContext,"awk",t,n)}execute(t){this.assertDefenseContext("program initialization"),this.program=t,this.ctx.output="";for(let n of t.functions)this.ctx.functions.set(n.name,n);this.rangeStates=t.rules.map(()=>!1)}async executeBegin(){if(this.assertDefenseContext("BEGIN execution entry"),!!this.program){for(let t of this.program.rules)if(t.pattern?.type==="begin"&&(await this.withDefenseContext("BEGIN block execution",()=>V(this.ctx,t.action.statements)),this.ctx.shouldExit))break}}async executeLine(t){if(this.assertDefenseContext("line execution entry"),!(!this.program||this.ctx.shouldExit)){$(this.ctx,t),this.ctx.NR++,this.ctx.FNR++,this.ctx.shouldNext=!1;for(let n=0;nthis.matchesRule(i,n))&&await this.withDefenseContext("rule block execution",()=>V(this.ctx,i.action.statements))}}}async executeEnd(){if(this.assertDefenseContext("END execution entry"),!!this.program&&!this.ctx.inEndBlock){this.ctx.inEndBlock=!0,this.ctx.shouldExit=!1;for(let t of this.program.rules)if(t.pattern?.type==="end"&&(await this.withDefenseContext("END block execution",()=>V(this.ctx,t.action.statements)),this.ctx.shouldExit))break;this.ctx.inEndBlock=!1}}getOutput(){return this.ctx.output}getExitCode(){return this.ctx.exitCode}getContext(){return this.ctx}async matchesRule(t,n){this.assertDefenseContext("rule matching");let i=t.pattern;if(!i)return!0;switch(i.type){case"begin":case"end":return!1;case"regex_pattern":return K(i.pattern,this.ctx.line);case"expr_pattern":return b(await this.withDefenseContext("expression pattern evaluation",()=>f(this.ctx,i.expression)));case"range":{let s=await this.withDefenseContext("range start pattern",()=>this.matchPattern(i.start)),a=await this.withDefenseContext("range end pattern",()=>this.matchPattern(i.end));return this.rangeStates[n]?(a&&(this.rangeStates[n]=!1),!0):s?(this.rangeStates[n]=!0,a&&(this.rangeStates[n]=!1),!0):!1}default:return!1}}async matchPattern(t){switch(this.assertDefenseContext("pattern matching"),t.type){case"regex_pattern":return K(t.pattern,this.ctx.line);case"expr_pattern":return b(await this.withDefenseContext("nested expression pattern",()=>f(this.ctx,t.expression)));default:return!1}}};var r;(function(e){e.NUMBER="NUMBER",e.STRING="STRING",e.REGEX="REGEX",e.IDENT="IDENT",e.BEGIN="BEGIN",e.END="END",e.IF="IF",e.ELSE="ELSE",e.WHILE="WHILE",e.DO="DO",e.FOR="FOR",e.IN="IN",e.BREAK="BREAK",e.CONTINUE="CONTINUE",e.NEXT="NEXT",e.NEXTFILE="NEXTFILE",e.EXIT="EXIT",e.RETURN="RETURN",e.DELETE="DELETE",e.FUNCTION="FUNCTION",e.PRINT="PRINT",e.PRINTF="PRINTF",e.GETLINE="GETLINE",e.PLUS="PLUS",e.MINUS="MINUS",e.STAR="STAR",e.SLASH="SLASH",e.PERCENT="PERCENT",e.CARET="CARET",e.EQ="EQ",e.NE="NE",e.LT="LT",e.GT="GT",e.LE="LE",e.GE="GE",e.MATCH="MATCH",e.NOT_MATCH="NOT_MATCH",e.AND="AND",e.OR="OR",e.NOT="NOT",e.ASSIGN="ASSIGN",e.PLUS_ASSIGN="PLUS_ASSIGN",e.MINUS_ASSIGN="MINUS_ASSIGN",e.STAR_ASSIGN="STAR_ASSIGN",e.SLASH_ASSIGN="SLASH_ASSIGN",e.PERCENT_ASSIGN="PERCENT_ASSIGN",e.CARET_ASSIGN="CARET_ASSIGN",e.INCREMENT="INCREMENT",e.DECREMENT="DECREMENT",e.QUESTION="QUESTION",e.COLON="COLON",e.COMMA="COMMA",e.SEMICOLON="SEMICOLON",e.NEWLINE="NEWLINE",e.LPAREN="LPAREN",e.RPAREN="RPAREN",e.LBRACE="LBRACE",e.RBRACE="RBRACE",e.LBRACKET="LBRACKET",e.RBRACKET="RBRACKET",e.DOLLAR="DOLLAR",e.APPEND="APPEND",e.PIPE="PIPE",e.EOF="EOF"})(r||(r={}));var Gt=new Map([["BEGIN",r.BEGIN],["END",r.END],["if",r.IF],["else",r.ELSE],["while",r.WHILE],["do",r.DO],["for",r.FOR],["in",r.IN],["break",r.BREAK],["continue",r.CONTINUE],["next",r.NEXT],["nextfile",r.NEXTFILE],["exit",r.EXIT],["return",r.RETURN],["delete",r.DELETE],["function",r.FUNCTION],["print",r.PRINT],["printf",r.PRINTF],["getline",r.GETLINE]]);function xt(e){return e.replace(/\[\[:space:\]\]/g,"[ \\t\\n\\r\\f\\v]").replace(/\[\[:blank:\]\]/g,"[ \\t]").replace(/\[\[:alpha:\]\]/g,"[a-zA-Z]").replace(/\[\[:digit:\]\]/g,"[0-9]").replace(/\[\[:alnum:\]\]/g,"[a-zA-Z0-9]").replace(/\[\[:upper:\]\]/g,"[A-Z]").replace(/\[\[:lower:\]\]/g,"[a-z]").replace(/\[\[:punct:\]\]/g,"[!\"#$%&'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~]").replace(/\[\[:xdigit:\]\]/g,"[0-9A-Fa-f]").replace(/\[\[:graph:\]\]/g,"[!-~]").replace(/\[\[:print:\]\]/g,"[ -~]").replace(/\[\[:cntrl:\]\]/g,"[\\x00-\\x1f\\x7f]")}var Ut=new Set([r.COMMA,r.LBRACE,r.AND,r.OR,r.QUESTION,r.COLON,r.DO,r.ELSE,r.IF,r.WHILE]),te=class{input;pos=0;line=1;column=1;lastTokenType=null;constructor(t){this.input=t}tokenize(){let t=[];for(;this.pos=this.input.length)return null;let t=this.line,n=this.column,i=this.peek();return i===` -`?(this.advance(),this.lastTokenType!==null&&Ut.has(this.lastTokenType)?this.nextToken():{type:r.NEWLINE,value:` -`,line:t,column:n}):i==='"'?this.readString():i==="/"&&this.canBeRegex()?this.readRegex():this.isDigit(i)||i==="."&&this.isDigit(this.peek(1))?this.readNumber():this.isAlpha(i)||i==="_"?this.readIdentifier():this.readOperator()}canBeRegex(){return new Set([null,r.NEWLINE,r.SEMICOLON,r.LBRACE,r.RBRACE,r.LPAREN,r.LBRACKET,r.COMMA,r.ASSIGN,r.PLUS_ASSIGN,r.MINUS_ASSIGN,r.STAR_ASSIGN,r.SLASH_ASSIGN,r.PERCENT_ASSIGN,r.CARET_ASSIGN,r.AND,r.OR,r.NOT,r.MATCH,r.NOT_MATCH,r.QUESTION,r.COLON,r.LT,r.GT,r.LE,r.GE,r.EQ,r.NE,r.PLUS,r.MINUS,r.STAR,r.PERCENT,r.CARET,r.PRINT,r.PRINTF,r.IF,r.WHILE,r.DO,r.FOR,r.RETURN]).has(this.lastTokenType)}readString(){let t=this.line,n=this.column;this.advance();let i="";for(;this.pos0?i+=String.fromCharCode(parseInt(a,16)):i+="x";break}default:if(/[0-7]/.test(s)){let a=s;for(;a.length<3&&/[0-7]/.test(this.peek());)a+=this.advance();i+=String.fromCharCode(parseInt(a,8))}else i+=s}}else i+=this.advance();return this.peek()==='"'&&this.advance(),{type:r.STRING,value:i,line:t,column:n}}readRegex(){let t=this.line,n=this.column;this.advance();let i="";for(;this.pos":return s==="="?(this.advance(),{type:r.GE,value:">=",line:t,column:n}):s===">"?(this.advance(),{type:r.APPEND,value:">>",line:t,column:n}):{type:r.GT,value:">",line:t,column:n};case"&":return s==="&"?(this.advance(),{type:r.AND,value:"&&",line:t,column:n}):{type:r.IDENT,value:"&",line:t,column:n};case"|":return s==="|"?(this.advance(),{type:r.OR,value:"||",line:t,column:n}):{type:r.PIPE,value:"|",line:t,column:n};case"~":return{type:r.MATCH,value:"~",line:t,column:n};case"?":return{type:r.QUESTION,value:"?",line:t,column:n};case":":return{type:r.COLON,value:":",line:t,column:n};case",":return{type:r.COMMA,value:",",line:t,column:n};case";":return{type:r.SEMICOLON,value:";",line:t,column:n};case"(":return{type:r.LPAREN,value:"(",line:t,column:n};case")":return{type:r.RPAREN,value:")",line:t,column:n};case"{":return{type:r.LBRACE,value:"{",line:t,column:n};case"}":return{type:r.RBRACE,value:"}",line:t,column:n};case"[":return{type:r.LBRACKET,value:"[",line:t,column:n};case"]":return{type:r.RBRACKET,value:"]",line:t,column:n};case"$":return{type:r.DOLLAR,value:"$",line:t,column:n};default:return{type:r.IDENT,value:i,line:t,column:n}}}isDigit(t){return t>="0"&&t<="9"}isAlpha(t){return t>="a"&&t<="z"||t>="A"&&t<="Z"}isAlphaNumeric(t){return this.isDigit(t)||this.isAlpha(t)}};var p={LPAREN:"LPAREN",RPAREN:"RPAREN",QUESTION:"QUESTION",NEWLINE:"NEWLINE",SEMICOLON:"SEMICOLON",RBRACE:"RBRACE",COMMA:"COMMA",PIPE:"PIPE",GT:"GT",APPEND:"APPEND",AND:"AND",OR:"OR",ASSIGN:"ASSIGN",PLUS_ASSIGN:"PLUS_ASSIGN",MINUS_ASSIGN:"MINUS_ASSIGN",STAR_ASSIGN:"STAR_ASSIGN",SLASH_ASSIGN:"SLASH_ASSIGN",PERCENT_ASSIGN:"PERCENT_ASSIGN",CARET_ASSIGN:"CARET_ASSIGN",RBRACKET:"RBRACKET",COLON:"COLON",IN:"IN",PRINT:"PRINT",PRINTF:"PRINTF",IDENT:"IDENT",LT:"LT",LE:"LE",GE:"GE",EQ:"EQ",NE:"NE",MATCH:"MATCH",NOT_MATCH:"NOT_MATCH",NUMBER:"NUMBER",STRING:"STRING",DOLLAR:"DOLLAR",NOT:"NOT",MINUS:"MINUS",PLUS:"PLUS",INCREMENT:"INCREMENT",DECREMENT:"DECREMENT"};function De(e){e.expect(p.PRINT);let t=[];if(e.check(p.NEWLINE)||e.check(p.SEMICOLON)||e.check(p.RBRACE)||e.check(p.PIPE)||e.check(p.GT)||e.check(p.APPEND))t.push({type:"field",index:{type:"number",value:0}});else for(t.push(ne(e));e.check(p.COMMA);)e.advance(),t.push(ne(e));let n;return e.check(p.GT)?(e.advance(),n={redirect:">",file:e.parsePrimary()}):e.check(p.APPEND)&&(e.advance(),n={redirect:">>",file:e.parsePrimary()}),{type:"print",args:t,output:n}}function ne(e){return Bt(e)?he(e,!0):he(e,!1)}function he(e,t){let n=t?e.parseTernary():Ht(e);if(e.match(p.ASSIGN,p.PLUS_ASSIGN,p.MINUS_ASSIGN,p.STAR_ASSIGN,p.SLASH_ASSIGN,p.PERCENT_ASSIGN,p.CARET_ASSIGN)){let i=e.advance(),s=he(e,t);if(n.type!=="variable"&&n.type!=="field"&&n.type!=="array_access")throw new Error("Invalid assignment target");return{type:"assignment",operator:new Map([["=","="],["+=","+="],["-=","-="],["*=","*="],["/=","/="],["%=","%="],["^=","^="]]).get(i.value)??"=",target:n,value:s}}return n}function Bt(e){let t=0,n=e.pos;for(;n=",">="],["==","=="],["!=","!="]]).get(n.value)??"==",left:t,right:i}}return t}function Wt(e){return e.match(p.NUMBER,p.STRING,p.IDENT,p.DOLLAR,p.LPAREN,p.NOT,p.MINUS,p.PLUS,p.INCREMENT,p.DECREMENT)}function Vt(e){return e.match(p.AND,p.OR,p.QUESTION,p.ASSIGN,p.PLUS_ASSIGN,p.MINUS_ASSIGN,p.STAR_ASSIGN,p.SLASH_ASSIGN,p.PERCENT_ASSIGN,p.CARET_ASSIGN,p.COMMA,p.SEMICOLON,p.NEWLINE,p.RBRACE,p.RPAREN,p.RBRACKET,p.COLON,p.PIPE,p.APPEND,p.GT,p.IN)}function _e(e){e.expect(p.PRINTF);let t=e.check(p.LPAREN);t&&(e.advance(),e.skipNewlines());let n=t?e.parseExpression():ne(e),i=[];for(;e.check(p.COMMA);)e.advance(),t&&e.skipNewlines(),i.push(t?e.parseExpression():ne(e));t&&(e.skipNewlines(),e.expect(p.RPAREN));let s;return e.check(p.GT)?(e.advance(),s={redirect:">",file:e.parsePrimary()}):e.check(p.APPEND)&&(e.advance(),s={redirect:">>",file:e.parsePrimary()}),{type:"printf",format:n,args:i,output:s}}var re=class{tokens=[];pos=0;parse(t){let n=new te(t);return this.tokens=n.tokenize(),this.pos=0,this.parseProgram()}setPos(t){this.pos=t}current(){return this.tokens[this.pos]||{type:r.EOF,value:"",line:0,column:0}}advance(){let t=this.current();return this.pos",">"],[">=",">="],["==","=="],["!=","!="]]).get(n.value)??"==",left:t,right:i}}return t}canStartExpression(){return this.match(r.NUMBER,r.STRING,r.IDENT,r.DOLLAR,r.LPAREN,r.NOT,r.MINUS,r.PLUS,r.INCREMENT,r.DECREMENT)}isConcatTerminator(){return this.match(r.AND,r.OR,r.QUESTION,r.ASSIGN,r.PLUS_ASSIGN,r.MINUS_ASSIGN,r.STAR_ASSIGN,r.SLASH_ASSIGN,r.PERCENT_ASSIGN,r.CARET_ASSIGN,r.COMMA,r.SEMICOLON,r.NEWLINE,r.RBRACE,r.RPAREN,r.RBRACKET,r.COLON,r.PIPE,r.APPEND,r.IN)}parseAddSub(){let t=this.parseMulDiv();for(;this.match(r.PLUS,r.MINUS);){let n=this.advance().value,i=this.parseMulDiv();t={type:"binary",operator:n,left:t,right:i}}return t}parseMulDiv(){let t=this.parseUnary();for(;this.match(r.STAR,r.SLASH,r.PERCENT);){let n=this.advance(),i=this.parseUnary();t={type:"binary",operator:new Map([["*","*"],["/","/"],["%","%"]]).get(n.value)??"*",left:t,right:i}}return t}parseUnary(){if(this.check(r.INCREMENT)){this.advance();let t=this.parseUnary();return t.type!=="variable"&&t.type!=="field"&&t.type!=="array_access"?{type:"unary",operator:"+",operand:{type:"unary",operator:"+",operand:t}}:{type:"pre_increment",operand:t}}if(this.check(r.DECREMENT)){this.advance();let t=this.parseUnary();return t.type!=="variable"&&t.type!=="field"&&t.type!=="array_access"?{type:"unary",operator:"-",operand:{type:"unary",operator:"-",operand:t}}:{type:"pre_decrement",operand:t}}if(this.match(r.NOT,r.MINUS,r.PLUS)){let t=this.advance().value,n=this.parseUnary();return{type:"unary",operator:t,operand:n}}return this.parsePower()}parsePower(){let t=this.parsePostfix();if(this.check(r.CARET)){this.advance();let n=this.parsePower();t={type:"binary",operator:"^",left:t,right:n}}return t}parsePostfix(){let t=this.parsePrimary();if(this.check(r.INCREMENT)){if(this.advance(),t.type!=="variable"&&t.type!=="field"&&t.type!=="array_access")throw new Error("Invalid increment operand");return{type:"post_increment",operand:t}}if(this.check(r.DECREMENT)){if(this.advance(),t.type!=="variable"&&t.type!=="field"&&t.type!=="array_access")throw new Error("Invalid decrement operand");return{type:"post_decrement",operand:t}}return t}parseFieldIndex(){if(this.check(r.INCREMENT)){this.advance();let t=this.parseFieldIndex();return t.type!=="variable"&&t.type!=="field"&&t.type!=="array_access"?{type:"unary",operator:"+",operand:{type:"unary",operator:"+",operand:t}}:{type:"pre_increment",operand:t}}if(this.check(r.DECREMENT)){this.advance();let t=this.parseFieldIndex();return t.type!=="variable"&&t.type!=="field"&&t.type!=="array_access"?{type:"unary",operator:"-",operand:{type:"unary",operator:"-",operand:t}}:{type:"pre_decrement",operand:t}}if(this.match(r.NOT,r.MINUS,r.PLUS)){let t=this.advance().value,n=this.parseFieldIndex();return{type:"unary",operator:t,operand:n}}return this.parseFieldIndexPower()}parseFieldIndexPower(){let t=this.parseFieldIndexPrimary();if(this.check(r.CARET)){this.advance();let n=this.parseFieldIndexPower();t={type:"binary",operator:"^",left:t,right:n}}return t}parseFieldIndexPrimary(){if(this.check(r.NUMBER))return{type:"number",value:this.advance().value};if(this.check(r.STRING))return{type:"string",value:this.advance().value};if(this.check(r.DOLLAR))return this.advance(),{type:"field",index:this.parseFieldIndex()};if(this.check(r.LPAREN)){this.advance();let t=this.parseExpression();return this.expect(r.RPAREN),t}if(this.check(r.IDENT)){let t=this.advance().value;if(this.check(r.LPAREN)){this.advance();let n=[];if(!this.check(r.RPAREN))for(n.push(this.parseExpression());this.check(r.COMMA);)this.advance(),n.push(this.parseExpression());return this.expect(r.RPAREN),{type:"call",name:t,args:n}}if(this.check(r.LBRACKET)){this.advance();let n=this.parseExpression();if(this.check(r.COMMA)){let i=[n];for(;this.check(r.COMMA);)this.advance(),i.push(this.parseExpression());this.expect(r.RBRACKET);let s=i.reduce((a,o)=>({type:"binary",operator:" ",left:{type:"binary",operator:" ",left:a,right:{type:"variable",name:"SUBSEP"}},right:o}));return{type:"array_access",array:t,key:s}}return this.expect(r.RBRACKET),{type:"array_access",array:t,key:n}}return{type:"variable",name:t}}throw new Error(`Unexpected token in field index: ${this.current().type} at line ${this.current().line}:${this.current().column}`)}parsePrimary(){if(this.check(r.NUMBER))return{type:"number",value:this.advance().value};if(this.check(r.STRING))return{type:"string",value:this.advance().value};if(this.check(r.REGEX))return{type:"regex",pattern:this.advance().value};if(this.check(r.DOLLAR))return this.advance(),{type:"field",index:this.parseFieldIndex()};if(this.check(r.LPAREN)){this.advance();let t=this.parseExpression();if(this.check(r.COMMA)){let n=[t];for(;this.check(r.COMMA);)this.advance(),n.push(this.parseExpression());return this.expect(r.RPAREN),{type:"tuple",elements:n}}return this.expect(r.RPAREN),t}if(this.check(r.GETLINE)){this.advance();let t,n;return this.check(r.IDENT)&&(t=this.advance().value),this.check(r.LT)&&(this.advance(),n=this.parsePrimary()),{type:"getline",variable:t,file:n}}if(this.check(r.IDENT)){let t=this.advance().value;if(this.check(r.LPAREN)){this.advance();let n=[];if(this.skipNewlines(),!this.check(r.RPAREN))for(n.push(this.parseExpression());this.check(r.COMMA);)this.advance(),this.skipNewlines(),n.push(this.parseExpression());return this.skipNewlines(),this.expect(r.RPAREN),{type:"call",name:t,args:n}}if(this.check(r.LBRACKET)){this.advance();let n=[this.parseExpression()];for(;this.check(r.COMMA);)this.advance(),n.push(this.parseExpression());this.expect(r.RBRACKET);let i;if(n.length===1)i=n[0];else{i=n[0];for(let s=1;s_(t.requireDefenseContext,"awk",h,c);if(de(e))return fe(Kt);let i=new H(/\s+/),s=" ",a=Object.create(null),o=0;for(let h=0;h0){let G=E.slice(0,F),Ue=pe(E.slice(F+1));a[G]=Ue}o=h+1}else{if(c.startsWith("--"))return ie("awk",c);if(c.startsWith("-")&&c.length>1){let E=c[1];if(E!=="F"&&E!=="v")return ie("awk",`-${E}`);o=h+1}else if(!c.startsWith("-")){o=h;break}}}if(o>=e.length)return{stdout:"",stderr:`awk: missing program -`,exitCode:1};let l=e[o],u=e.slice(o+1),N=new re,A;try{A=N.parse(l)}catch(h){return{stdout:"",stderr:`awk: ${h instanceof Error?h.message:String(h)} -`,exitCode:1}}let C={readFile:t.fs.readFile.bind(t.fs),writeFile:t.fs.writeFile.bind(t.fs),appendFile:async(h,c)=>{try{let E=await n("appendFile read",()=>t.fs.readFile(h));await n("appendFile write",()=>t.fs.writeFile(h,E+c))}catch(E){if(E instanceof x)throw E;await n("appendFile create",()=>t.fs.writeFile(h,c))}},resolvePath:t.fs.resolvePath.bind(t.fs)},O=t.exec,I=se({fieldSep:i,maxIterations:t.limits?.maxAwkIterations,maxOutputSize:t.limits?.maxStringLength,fs:C,cwd:t.cwd,exec:O?h=>n("command pipe exec",()=>O(h,{cwd:t.cwd,signal:t.signal})):void 0,coverage:t.coverage,requireDefenseContext:t.requireDefenseContext});I.FS=s,I.vars=Object.assign(Object.create(null),a),I.ARGC=u.length+1,I.ARGV=Object.create(null),I.ARGV[0]="awk";for(let h=0;hh.pattern?.type!=="begin"&&h.pattern?.type!=="end"),R=A.rules.some(h=>h.pattern?.type==="end");try{if(await n("BEGIN execution",()=>w.executeBegin()),I.shouldExit)return await n("END execution after BEGIN exit",()=>w.executeEnd()),{stdout:w.getOutput(),stderr:"",exitCode:w.getExitCode()};if(!d&&!R)return{stdout:w.getOutput(),stderr:"",exitCode:w.getExitCode()};let h=[];if(u.length>0)for(let c of u)try{let E=t.fs.resolvePath(t.cwd,c),G=(await n("input file read",()=>t.fs.readFile(E))).split(` -`);G.length>0&&G[G.length-1]===""&&G.pop(),h.push({filename:c,lines:G})}catch(E){if(E instanceof x)throw E;return{stdout:"",stderr:`awk: ${c}: No such file or directory -`,exitCode:1}}else{let c=z(t.stdin).split(` -`);c.length>0&&c[c.length-1]===""&&c.pop(),h.push({filename:"",lines:c})}for(let c of h){for(I.FILENAME=c.filename,I.FNR=0,I.lines=c.lines,I.lineIndex=-1,I.shouldNextFile=!1;I.lineIndexw.executeLine(c.lines[E])),I.shouldExit||I.shouldNextFile)break}if(I.shouldExit)break}return await n("END execution",()=>w.executeEnd()),{stdout:w.getOutput(),stderr:"",exitCode:w.getExitCode()}}catch(h){if(h instanceof x)throw h;let c=h instanceof Error?h.message:String(h),E=h instanceof P?P.EXIT_CODE:2;return{stdout:w.getOutput(),stderr:`awk: ${c} -`,exitCode:E}}}};function pe(e){return e.replace(/\\t/g," ").replace(/\\n/g,` -`).replace(/\\r/g,"\r").replace(/\\b/g,"\b").replace(/\\f/g,"\f").replace(/\\a/g,"\x07").replace(/\\v/g,"\v").replace(/\\\\/g,"\\")}function Ge(e){if(e===" ")return v("\\s+");if(/[[\](){}.*+?^$|\\]/.test(e))try{return v(e)}catch{return v(xe(e))}return v(xe(e))}function xe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var jn={name:"awk",flags:[{flag:"-F",type:"value",valueHint:"delimiter"},{flag:"-v",type:"value",valueHint:"string"}],stdinType:"text",needsArgs:!0};export{zn as a,jn as b}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-H2TS57O5.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-H2TS57O5.js deleted file mode 100644 index 7b5628a..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-H2TS57O5.js +++ /dev/null @@ -1,5 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{c}from"./chunk-XEKXHOPO.js";import{a as u,b as f,c as h}from"./chunk-QAYAQNCG.js";import p from"turndown";var w={name:"html-to-markdown",summary:"convert HTML to Markdown (BashEnv extension)",usage:"html-to-markdown [OPTION]... [FILE]",description:["Convert HTML content to Markdown format using the turndown library.","This is a non-standard BashEnv extension command, not available in regular bash.","","Read HTML from FILE or standard input and output Markdown to standard output.","Commonly used with curl to convert web pages:"," curl -s https://example.com | html-to-markdown","","Supported HTML elements:"," - Headings (h1-h6) \u2192 # Markdown headings"," - Paragraphs (p) \u2192 Plain text with blank lines"," - Links (a) \u2192 [text](url)"," - Images (img) \u2192 ![alt](src)"," - Bold/Strong \u2192 **text**"," - Italic/Em \u2192 _text_"," - Code (code, pre) \u2192 `inline` or fenced blocks"," - Lists (ul, ol, li) \u2192 - or 1. items"," - Blockquotes \u2192 > quoted text"," - Horizontal rules (hr) \u2192 ---"],options:["-b, --bullet=CHAR bullet character for unordered lists (-, +, or *)","-c, --code=FENCE fence style for code blocks (``` or ~~~)","-r, --hr=STRING string for horizontal rules (default: ---)"," --heading-style=STYLE"," heading style: 'atx' for # headings (default),"," 'setext' for underlined headings (h1/h2 only)"," --help display this help and exit"],examples:["echo '

    Hello

    World

    ' | html-to-markdown","html-to-markdown page.html","curl -s https://example.com | html-to-markdown > page.md"]},y={name:"html-to-markdown",async execute(r,n){if(f(r))return u(w);let s="-",a="```",i="---",m="atx",o=[];for(let e=0;e=0&&!l.includes(s[i])&&l.push(s[i])}return l}var E={name:"cut",async execute(s,c){if(I(s))return x(T);let l=" ",n=null,t=null,r=!1,i=[];for(let o=0;o0&&a[a.length-1]===""&&a.pop();let g=b(n||t||"1"),h="";for(let o of a)if(t){let e=Array.from(o),f=[];for(let u of g){let F=u.start-1,H=u.end===null?e.length:u.end;for(let d=F;d=0&&f.push(e[d])}h+=`${f.join("")} -`}else{if(r&&!o.includes(l))continue;let e=o.split(l),f=w(e,g);h+=`${f.join(l)} -`}return t?{stdout:h,stderr:"",exitCode:0}:{stdout:h,stderr:"",exitCode:0,stdoutKind:"bytes",stdoutEncoding:"binary"}}},S={name:"cut",flags:[{flag:"-d",type:"value",valueHint:"delimiter"},{flag:"-f",type:"value",valueHint:"string"},{flag:"-c",type:"value",valueHint:"string"},{flag:"-s",type:"boolean"}],stdinType:"text",needsFiles:!0};export{E as a,S as b}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-HAIOEUEV.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-HAIOEUEV.js deleted file mode 100644 index 67cd6c6..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-HAIOEUEV.js +++ /dev/null @@ -1,63 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a as ye}from"./chunk-TDD4NFYE.js";import{b as Q}from"./chunk-VACKIICN.js";import{a as U}from"./chunk-7CSMHFIJ.js";import{a as pe,b as ge,c as ee}from"./chunk-QAYAQNCG.js";var Ke="file",Je="link",Ve="symlink",ke="directory",Qe={file:"0",link:"1",symlink:"2","character-device":"3","block-device":"4",directory:"5",fifo:"6","pax-header":"x","pax-global-header":"g","gnu-long-name":"L","gnu-long-link-name":"K"},et={0:Ke,1:Je,2:Ve,3:"character-device",4:"block-device",5:ke,6:"fifo",x:"pax-header",g:"pax-global-header",L:"gnu-long-name",K:"gnu-long-link-name"},tt=new Uint8Array(512),_=new Uint8Array(0),T=new TextEncoder,ze=new TextDecoder;function P(e,t,n,r){r&&T.encodeInto(r,e.subarray(t,t+n))}function L(e,t,n,r){if(r===void 0)return;let s=r.toString(8).padStart(n-1,"0");T.encodeInto(s,e.subarray(t,t+n-1))}function S(e,t,n){let r=e.indexOf(0,t),s=r===-1||r>t+n?t+n:r;return ze.decode(e.subarray(t,s))}function ne(e,t,n){let r=0,s=t+n;for(let o=t;oe.type==="directory"||e.type==="symlink"||e.type==="link"||e.type==="character-device"||e.type==="block-device"||e.type==="fifo";async function Ce(e){if(e==null)return _;if(e instanceof Uint8Array)return e;if(typeof e=="string")return T.encode(e);if(e instanceof ArrayBuffer)return new Uint8Array(e);if(e instanceof Blob)return new Uint8Array(await e.arrayBuffer());throw new TypeError("Unsupported content type for entry body.")}var we=(e,t)=>{let n=e.split("/").filter(Boolean);return t>=n.length?"":n.slice(t).join("/")};function Ae(e,t){let{strip:n,filter:r,map:s}=t;if(!n&&!r&&!s)return e;let o={...e};if(n&&n>0){let a=we(o.name,n);if(!a)return null;if(o.name=o.type==="directory"&&!a.endsWith("/")?`${a}/`:a,o.linkname){let l=o.linkname.startsWith("/");if(l||o.type==="link"){let c=we(o.linkname,n);o.linkname=l?`/${c}`||"/":c}}}if(r?.(o)===!1)return null;let i=s?s(o):o;return i&&(!i.name||!i.name.trim()||i.name==="."||i.name==="/")?null:i}var re=32,rt=48;function nt(e){let t=ne(e,148,8),n=0;for(let r=0;r=148&&r<156?n+=re:n+=e[r];return t===n}function it(e){e.fill(re,148,156);let t=0;for(let n of e)t+=n;for(let n=153;n>=148;n--)e[n]=(t&7)+rt,t>>=3;e[154]=0,e[155]=re}var st=256;function ot(e){let t={};T.encode(e.name).length>100&&Ee(e.name)===null&&(t.path=e.name),e.linkname&&T.encode(e.linkname).length>100&&(t.linkpath=e.linkname),e.uname&&T.encode(e.uname).length>32&&(t.uname=e.uname),e.gname&&T.encode(e.gname).length>32&&(t.gname=e.gname),e.uid!=null&&e.uid>2097151&&(t.uid=String(e.uid)),e.gid!=null&&e.gid>2097151&&(t.gid=String(e.gid)),e.size!=null&&e.size>8589934591&&(t.size=String(e.size)),e.pax&&Object.assign(t,e.pax);let n=Object.entries(t);if(n.length===0)return null;let r=T.encode(n.map(([s,o])=>{let i=`${s}=${o} -`,a=T.encode(i).length+1,l=a+String(a).length;return l=a+String(l).length,`${l} ${i}`}).join(""));return{paxHeader:$e({name:ze.decode(T.encode(`PaxHeader/${e.name}`).slice(0,100)),size:r.length,type:"pax-header",mode:420,mtime:e.mtime,uname:e.uname,gname:e.gname,uid:e.uid,gid:e.gid}),paxBody:r}}function Ee(e){let t=T.encode(e).length;if(t<=100||t>st)return null;for(let n=e.length-1;n>0;n--){if(e[n]!=="/")continue;let r=e.slice(0,n),s=e.slice(n+1);if(T.encode(r).length<=155&&T.encode(s).length<=100)return{prefix:r,name:s}}return null}function $e(e){let t=new Uint8Array(512),n=N(e)?0:e.size??0,r=e.name,s="";if(!e.pax?.path){let o=Ee(r);o&&(r=o.name,s=o.prefix)}return P(t,0,100,r),L(t,100,8,e.mode??(e.type==="directory"?493:420)),L(t,108,8,e.uid??0),L(t,116,8,e.gid??0),L(t,124,12,n),L(t,136,12,Math.floor((e.mtime?.getTime()??Date.now())/1e3)),P(t,156,1,Qe[e.type??"file"]),P(t,157,100,e.linkname),P(t,257,6,"ustar\0"),P(t,263,2,"00"),P(t,265,32,e.uname),P(t,297,32,e.gname),P(t,345,155,s),it(t),t}function at(e,t){if(t&&!nt(e))throw new Error("Invalid tar header checksum.");let n=S(e,156,1),r={name:S(e,0,100),mode:ne(e,100,8),uid:W(e,108,8),gid:W(e,116,8),size:W(e,124,12),mtime:new Date(W(e,136,12)*1e3),type:et[n]||"file",linkname:S(e,157,100)},s=S(e,257,6);return N(r)&&(r.size=0),s.trim()==="ustar"&&(r.uname=S(e,265,32),r.gname=S(e,297,32)),s==="ustar"&&(r.prefix=S(e,345,155)),r}var be={path:["name",e=>e],linkpath:["linkname",e=>e],size:["size",e=>parseInt(e,10)],mtime:["mtime",parseFloat],uid:["uid",e=>parseInt(e,10)],gid:["gid",e=>parseInt(e,10)],uname:["uname",e=>e],gname:["gname",e=>e]};function lt(e){let t=new TextDecoder("utf-8"),n=Object.create(null),r=Object.create(null),s=0;for(;s0&&(n.pax=r),n}function xe(e,t){t.name!==void 0&&(e.name=t.name),t.linkname!==void 0&&(e.linkname=t.linkname),t.size!==void 0&&(e.size=t.size),t.mtime!==void 0&&(e.mtime=new Date(t.mtime*1e3)),t.uid!==void 0&&(e.uid=t.uid),t.gid!==void 0&&(e.gid=t.gid),t.uname!==void 0&&(e.uname=t.uname),t.gname!==void 0&&(e.gname=t.gname),t.pax&&(e.pax=Object.assign({},e.pax??{},t.pax))}function ct(e){switch(e){case"pax-global-header":case"pax-header":return lt;case"gnu-long-name":return t=>({name:S(t,0,t.length)});case"gnu-long-link-name":return t=>({linkname:S(t,0,t.length)});default:return}}function ft(e){let t=$e(e),n=ot(e);if(!n)return[t];let r=-n.paxBody.length&511,s=r>0?[tt.subarray(0,r)]:[];return[n.paxHeader,n.paxBody,...s,t]}var ut=new Uint8Array(512*2);function Be(e,t,n){let r=null,s=0,o=!1,i=a=>{let l=new Error(a);throw t(l),l};return{add(a){o&&i("No new tar entries after finalize."),r!==null&&i("Previous entry must be completed before adding a new one");let l=N(a)?0:a.size;(!Number.isSafeInteger(l)||l<0)&&i("Invalid tar entry size.");try{let c=ft({...a,size:l});for(let f of c)e(f);r={...a,size:l},s=0}catch(c){t(c)}},write(a){r||i("No active tar entry."),o&&i("Cannot write data after finalize.");let l=s+a.length;l>r.size&&i(`"${r.name}" exceeds given size of ${r.size} bytes.`);try{s=l,e(a)}catch(c){t(c)}},endEntry(){r||i("No active entry to end."),o&&i("Cannot end entry after finalize.");try{s!==r.size&&i(`Size mismatch for "${r.name}".`);let a=-r.size&511;a>0&&e(new Uint8Array(a)),r=null,s=0}catch(a){throw t(a),a}},finalize(){o&&i("Archive has already been finalized"),r!==null&&i("Cannot finalize while an entry is still active");try{e(ut),o=!0,n&&n()}catch(a){t(a)}}}}var j=256;function dt(){let e=new Array(j),t=e.length-1,n=0,r=0,s=0,o=a=>{let l=e[n];a===l.length?(e[n]=_,n=n+1&t):e[n]=l.subarray(a),s-=a,s===0&&e.length>j&&(e=new Array(j),t=j-1,n=0,r=0)};function i(a,l){if(l){let g=0,d=Math.min(a,s);for(;d>0;){let p=e[n],m=Math.min(d,p.length),x=m===p.length?p:p.subarray(0,m);if(o(m),d-=m,g+=m,!l(x))break}return g}if(s=a){let g=c.length===a?c:c.subarray(0,a);return o(a),g}let f=new Uint8Array(a),u=0,y=a;for(;y>0;){let g=e[n],d=Math.min(y,g.length);f.set(d===g.length?g:g.subarray(0,d),u),u+=d,y-=d,o(d)}return f}return{push:a=>{if(a.length===0)return;let l=r+1&t;if(l===n){let c=e.length,f=c*2,u=new Array(f),y=r-n+c&c-1;if(n0){let g=c-n;for(let d=0;ds,peek:a=>{if(s=a)return l.length===a?l:l.subarray(0,a);let c=new Uint8Array(a),f=0,u=n;for(;f{if(a>s)throw new Error("Too many bytes consumed");if(a===0)return;let l=a;for(;l>0;){let c=e[n],f=Math.min(l,c.length);o(f),l-=f}},pull:i}}var te=0,D=1,H=new Error("Tar archive is truncated.");function Te(e={}){let t=e.strict??!1,{available:n,peek:r,push:s,discard:o,pull:i}=dt(),a=te,l=!1,c=!1,f=!1,u=null,y={},g={},d={isEntryActive:()=>a===D,isBodyComplete:()=>!u||u.remaining===0,canFinish:()=>!u||n()>=u.remaining+u.padding,write(p){if(l)throw new Error("Archive already ended.");s(p)},end(){l=!0},readHeader(){if(a!==te)throw new Error("Cannot read header while an entry is active");if(!c)for(;!c;){if(n()<512){if(l){if(n()>0&&t)throw H;c=!0;return}return null}let p=r(512);if(ve(p)){if(n()<512*2){if(l){if(t)throw H;c=!0;return}return null}if(ve(r(512*2).subarray(512))){o(512*2),c=!0,f=!0;return}if(t)throw new Error("Invalid tar header.");o(512);continue}let m;try{m=at(p,t)}catch(E){if(t)throw E;o(512);continue}let x=ct(m.type);if(x){let E=m.size+(-m.size&511);if(n()<512+E){if(l&&t)throw H;return null}o(512);let v=x(i(E).subarray(0,m.size)),$=m.type==="pax-global-header"?y:g;for(let z in v)$[z]=v[z];continue}o(512);let b=m;return m.prefix&&(b.name=`${m.prefix}/${b.name}`),xe(b,y),xe(b,g),b.name.endsWith("/")&&b.type==="file"&&(b.type=ke),g={},u={header:b,remaining:b.size,padding:-b.size&511},a=D,b}},streamBody(p){if(a!==D||!u||u.remaining===0)return 0;let m=Math.min(u.remaining,n());if(m===0)return 0;let x=i(m,p);return u.remaining-=x,x},skipPadding(){if(a!==D||!u)return!0;if(u.remaining>0)throw new Error("Body not fully consumed");return n()0&&(o(p),u.remaining-=p),u.remaining>0?!1:d.skipPadding()},validateEOF(){if(t){if(!f)throw H;if(n()>0&&i(n()).some(p=>p!==0))throw new Error("Invalid EOF.")}}};return d}function ve(e){if(e.byteOffset%8===0){let t=new BigUint64Array(e.buffer,e.byteOffset,e.length/8);for(let n=0;ne.pipeTo(new WritableStream);function ht(e={}){let t=Te(e),n=e.strict??!1,r=null,s=null,o=!1,i=!1,a=!1,l=!1,c=()=>{try{s?.close()}catch{}s=null},f=d=>{if(!l){l=!0;try{s?.error(d)}catch{}s=null;try{r.error(d)}catch{}r=null}},u=()=>{if(!l){l=!0,c();try{r.close()}catch{}r=null}},y=()=>{if(n)throw new Error("Tar archive is truncated.");u()},g=()=>{if(!(o||l||!r)){o=!0;try{for(;;){if(i){a&&(t.validateEOF(),u());break}if(t.isEntryActive()){if(a&&!t.canFinish()){y();break}if(s){if((s.desiredSize??1)<=0)break;if(t.streamBody(d=>(s.enqueue(d),(s.desiredSize??1)>0))===0&&!t.isBodyComplete()){a&&y();break}}else if(!t.skipEntry()){a&&y();break}if(t.isBodyComplete()&&(c(),!t.skipPadding())){a&&y();break}}else{if((r.desiredSize??0)<0)break;let d=t.readHeader();if(d===null){a&&u();break}if(d===void 0){if(a){t.validateEOF(),u();break}i=!0;break}r.enqueue({header:d,body:new ReadableStream({start(p){d.size===0?p.close():s=p},pull:g,cancel(){s=null,g()}})})}}}catch(d){throw f(d),d}finally{o=!1}}};return{readable:new ReadableStream({start(d){r=d},pull:g,cancel(d){d!==void 0?f(d):u()}},{highWaterMark:2}),writable:new WritableStream({write(d){try{if(i&&n&&d.some(p=>p!==0))throw new Error("Invalid EOF.");t.write(d),g()}catch(p){throw f(p),p}},close(){try{a=!0,t.end(),g()}catch(d){throw f(d),d}},abort(d){f(d)}})}}async function Oe(e){let{readable:t,controller:n}=mt();return await(async()=>{for(let r of e){let s=n.add(r.header),o="body"in r?r.body:r.data;if(!o){await s.close();continue}if(o instanceof ReadableStream)await o.pipeTo(s);else if(o instanceof Blob)await o.stream().pipeTo(s);else try{let i=await Ce(o);if(i.length>0){let a=s.getWriter();await a.write(i),await a.close()}else await s.close()}catch{throw new TypeError(`Unsupported content type for entry "${r.header.name}".`)}}})().then(()=>n.finalize()).catch(r=>n.error(r)),new Uint8Array(await Pe(t))}async function Ue(e,t={}){let n=e instanceof ReadableStream?e:new ReadableStream({start(o){o.enqueue(e instanceof Uint8Array?e:new Uint8Array(e)),o.close()}}),r=[],s=n.pipeThrough(ht(t));for await(let o of s){let i;try{i=Ae(o.header,t)}catch(a){throw await o.body.cancel(),a}if(i===null){await Se(o.body);continue}N(i)?(await Se(o.body),r.push({header:i})):r.push({header:i,data:await Pe(o.body)})}return r}import At from"seek-bzip";var pt=(()=>{let e=new Uint32Array(256);for(let t=0;t<256;t++){let n=t<<24;for(let r=0;r<8;r++)n=n&2147483648?n<<1^79764919:n<<1;e[t]=n>>>0}return e})();function gt(e,t){return(e<<8^pt[(e>>>24^t)&255])>>>0}var ie=class{buffer=[];current=0;bitCount=0;writeBits(t,n){for(let r=t-1;r>=0;r--)this.current=this.current<<1|n>>>r&1,this.bitCount++,this.bitCount===8&&(this.buffer.push(this.current),this.current=0,this.bitCount=0)}writeBit(t){this.current=this.current<<1|t&1,this.bitCount++,this.bitCount===8&&(this.buffer.push(this.current),this.current=0,this.bitCount=0)}finish(){return this.bitCount>0&&this.buffer.push(this.current<<8-this.bitCount),new Uint8Array(this.buffer)}};function yt(e){let t=[],n=0;for(;n=4?(t.push(r,r,r,r),t.push(s-4),n+=s):(t.push(r),n++)}return new Uint8Array(t)}function wt(e){let t=e.length;if(t===0)return{transformed:new Uint8Array(0),pointer:0};let n=bt(e),r=new Uint8Array(t),s=0;for(let o=0;oo[i]!==o[a]?o[i]-o[a]:o[(i+s)%t]-o[(a+s)%t]),r[n[0]]=0;for(let i=1;i0){let c=o[l];for(let f=l;f>0;f--)o[f]=o[f-1];o[0]=c}}return{encoded:s,length:e.length}}function vt(e,t,n){let o=n+1,i=[],a=0;for(;a0;)f--,f&1?i.push(1):i.push(0),f>>>=1}else i.push(e[a]+1),a++;i.push(o);let l=new Uint16Array(i.length);for(let c=0;c0&&(c[f]=1);return{codeLengths:c,maxLen:1,minLen:1}}let r=[];for(let c=0;c0&&r.push({freq:e[c],symbol:c,left:null,right:null});if(r.length===0)return{codeLengths:new Array(e.length).fill(0),maxLen:0,minLen:0};if(r.length===1){let c=new Array(e.length).fill(0);return c[r[0].symbol]=1,{codeLengths:c,maxLen:1,minLen:1}}for(;r.length>1;){r.sort((u,y)=>u.freq-y.freq);let c=r.shift(),f=r.shift();r.push({freq:c.freq+f.freq,symbol:-1,left:c,right:f})}let s=new Array(e.length).fill(0);function o(c,f){if(!c.left&&!c.right){s[c.symbol]=f;return}c.left&&o(c.left,f+1),c.right&&o(c.right,f+1)}o(r[0],0);let i=!0;for(;i;){i=!1;for(let c=0;cn&&(s[c]=n,i=!0);if(i){let c=0;for(let f=0;f0&&(c+=1/(1<1)for(let f=1;f1;f++)for(let u=0;u1;u++)s[u]===f&&(s[u]++,c-=1/(1<n){i=!0;break}}}let a=n,l=0;for(let c=0;c0&&(s[c]l&&(l=s[c]));return{codeLengths:s,maxLen:l,minLen:a}}function kt(e,t){let n=new Array(t).fill(0),r=e.slice(0,t),s=Math.max(...r,0),o=new Array(s+1).fill(0);for(let l=0;l0&&o[r[l]]++;let i=new Array(s+1).fill(0),a=0;for(let l=1;l<=s;l++)a=a+o[l-1]<<1,i[l]=a;for(let l=0;l0&&(n[l]=i[r[l]]++);return{codes:n,lengths:r}}function zt(e,t,n){e.writeBits(24,3227993),e.writeBits(24,2511705),e.writeBits(32,n),e.writeBit(0);let r=yt(t),{transformed:s,pointer:o}=wt(r);e.writeBits(24,o);let i=new Array(256).fill(!1);for(let h=0;hp&&(m=Math.max(2,p));let x=[];for(let h=0;h0){let B=z[k];for(let C=k;C>0;C--)z[C]=z[C-1];z[0]=B}}for(let h=0;hC;)e.writeBit(1),e.writeBit(1),k--;e.writeBit(0)}}for(let h=0;h=d)&&(h>0&&he++,R=0);let w=b[he],k=v[w],B=u[h],C=k._lengths[B],M=k._codes[B];C>0&&e.writeBits(C,M),R++}}var Ct=10*1024*1024;function Le(e,t=9,n=Ct){if(t<1||t>9)throw new Error("Block size level must be 1-9");if(e.length>n)throw new Error(`Input too large for bzip2 compression (${e.length} bytes, max ${n})`);let r=t*1e5,s=new ie;s.writeBits(8,66),s.writeBits(8,90),s.writeBits(8,104),s.writeBits(8,48+t);let o=0,i=0;for(;i>>0,o=(o<<1|o>>>31)>>>0,o=(o^c)>>>0,zt(s,l,c),i=a}return s.writeBits(24,1536581),s.writeBits(24,3690640),s.writeBits(32,o),s.finish()}var X=null,Z=null;async function Me(){if(X)return X;if(Z)throw Z;try{return X=await Q.runTrustedAsync(()=>import("node-liblzma")),X}catch{throw Z=new Error("xz compression requires node-liblzma which failed to load. Install liblzma-dev (apt) or xz (brew) and reinstall dependencies."),Z}}var G=null,q=null;async function We(){if(G)return G;if(q)throw q;try{return G=await Q.runTrustedAsync(()=>import("@mongodb-js/zstd")),G}catch{throw q=new Error("zstd compression requires @mongodb-js/zstd which is not installed. Install it with: npm install @mongodb-js/zstd"),q}}var A=100*1024*1024,De=512,Re=1e4;function Et(e){let t="file";e.isDirectory?t="directory":e.isSymlink&&(t="symlink");let n=e.name;e.isDirectory&&!n.endsWith("/")&&(n+="/");let r;e.content!==void 0&&(typeof e.content=="string"?r=new TextEncoder().encode(e.content):r=e.content);let s=e.isDirectory||e.isSymlink?0:r?.length??0;return{header:{name:n,mode:e.mode??(e.isDirectory?493:420),uid:e.uid??0,gid:e.gid??0,size:s,mtime:e.mtime??new Date,type:t,linkname:e.linkTarget??"",uname:"user",gname:"user"},body:r}}async function O(e){let t=e.map(Et);return Oe(t)}async function je(e){let t=await O(e),s=new ReadableStream({start(c){c.enqueue(t),c.close()}}).pipeThrough(Fe()).getReader(),o=[];for(;;){let{done:c,value:f}=await s.read();if(c)break;o.push(f)}let i=o.reduce((c,f)=>c+f.length,0),a=new Uint8Array(i),l=0;for(let c of o)a.set(c,l),l+=c.length;return a}async function F(e){if(e.length>A)return{entries:[],error:`Archive too large (max ${A} bytes)`};if(e.length=Re)return{entries:n,error:`Too many entries (max ${Re})`};let s="file";switch(r.header.type){case"directory":s="directory";break;case"symlink":s="symlink";break;case"link":s="hardlink";break;case"file":s="file";break;default:s="other"}n.push({name:r.header.name,mode:r.header.mode??420,uid:r.header.uid??0,gid:r.header.gid??0,size:r.header.size,mtime:r.header.mtime??new Date,type:s,linkTarget:r.header.linkname||void 0,content:r.data??new Uint8Array(0)})}return{entries:n}}catch(t){let n=t instanceof Error?t.message:"Unknown error";return{entries:[],error:n}}}async function se(e){if(e.length>A)return{entries:[],error:`Archive too large (max ${A} bytes)`};try{let r=new ReadableStream({start(l){l.enqueue(e),l.close()}}).pipeThrough(Ie()).getReader(),s=[],o=0;for(;;){let{done:l,value:c}=await r.read();if(l)break;if(o+=c.length,o>A)return await r.cancel(),{entries:[],error:`Decompressed archive too large (max ${A} bytes)`};s.push(c)}let i=new Uint8Array(o),a=0;for(let l of s)i.set(l,a),a+=l.length;return F(i)}catch(t){let n=t instanceof Error?t.message:"Unknown error";return{entries:[],error:`Decompression failed: ${n}`}}}function oe(e){return e.length>=2&&e[0]===31&&e[1]===139}function ae(e){return e.length>=3&&e[0]===66&&e[1]===90&&e[2]===104}function le(e){return e.length>=6&&e[0]===253&&e[1]===55&&e[2]===122&&e[3]===88&&e[4]===90&&e[5]===0}async function $t(e){let t=At.decode(Buffer.from(e));return new Uint8Array(t)}async function Bt(e){return Le(e,9)}async function Tt(e){let n=(await Me()).unxzSync(Buffer.from(e));return new Uint8Array(n)}async function St(e){let n=(await Me()).xzSync(Buffer.from(e));return new Uint8Array(n)}async function He(e){let t=await O(e);return Bt(t)}async function _e(e,t){if(!t?.allowNativeCodecs)throw new Error("xz compression is disabled by default (native codec risk). Pass { allowNativeCodecs: true } to opt in.");let n=await O(e);return St(n)}async function ce(e){if(e.length>A)return{entries:[],error:`Archive too large (max ${A} bytes)`};try{let t=await $t(e);return t.length>A?{entries:[],error:`Decompressed archive too large (max ${A} bytes)`}:F(t)}catch(t){let n=t instanceof Error?t.message:"Unknown error";return{entries:[],error:n}}}async function fe(e,t){if(!t?.allowNativeCodecs)return{entries:[],error:"xz decompression is disabled by default (native codec risk). Pass { allowNativeCodecs: true } to opt in, or decompress the archive externally before extraction."};if(e.length>A)return{entries:[],error:`Archive too large (max ${A} bytes)`};try{let n=await Tt(e);return n.length>A?{entries:[],error:`Decompressed archive too large (max ${A} bytes)`}:F(n)}catch(n){let r=n instanceof Error?n.message:"Unknown error";return{entries:[],error:r}}}function ue(e){return e.length>=4&&e[0]===40&&e[1]===181&&e[2]===47&&e[3]===253}async function Ft(e){let n=await(await We()).compress(Buffer.from(e),3);return new Uint8Array(n)}async function It(e){let n=await(await We()).decompress(Buffer.from(e));return new Uint8Array(n)}async function Xe(e,t){if(!t?.allowNativeCodecs)throw new Error("zstd compression is disabled by default (native codec risk). Pass { allowNativeCodecs: true } to opt in.");let n=await O(e);return Ft(n)}async function de(e,t){if(!t?.allowNativeCodecs)return{entries:[],error:"zstd decompression is disabled by default (native codec risk). Pass { allowNativeCodecs: true } to opt in, or decompress the archive externally before extraction."};if(e.length>A)return{entries:[],error:`Archive too large (max ${A} bytes)`};try{let n=await It(e);return n.length>A?{entries:[],error:`Decompressed archive too large (max ${A} bytes)`}:F(n)}catch(n){let r=n instanceof Error?n.message:"Unknown error";return{entries:[],error:r}}}function Ze(e){let t=/[fCTX]/g,n=e.length>0&&e[0]!==""&&!e[0].startsWith("-")?[`-${e[0].replace(t,"")+(e[0].match(t)??[]).join("")}`,...e.slice(1)]:e,r={create:!1,append:!1,update:!1,extract:!1,list:!1,file:"",autoCompress:!1,gzip:!1,bzip2:!1,xz:!1,zstd:!1,verbose:!1,toStdout:!1,keepOldFiles:!1,touch:!1,directory:"",preserve:!1,absoluteNames:!1,strip:0,exclude:[],filesFrom:"",excludeFrom:"",wildcards:!1},s=[],o=0;for(;o2){if(/^-\d+$/.test(i)){s.push(i),o++;continue}for(let a=1;a=n.length)return{ok:!1,error:{stdout:"",stderr:`tar: option requires an argument -- 'f' -`,exitCode:2}};r.file=n[o]}break;case"C":if(a=n.length)return{ok:!1,error:{stdout:"",stderr:`tar: option requires an argument -- 'C' -`,exitCode:2}};r.directory=n[o]}break;case"T":if(a=n.length)return{ok:!1,error:{stdout:"",stderr:`tar: option requires an argument -- 'T' -`,exitCode:2}};r.filesFrom=n[o]}break;case"X":if(a=n.length)return{ok:!1,error:{stdout:"",stderr:`tar: option requires an argument -- 'X' -`,exitCode:2}};r.excludeFrom=n[o]}break;default:return{ok:!1,error:ee("tar",`-${l}`)}}}o++;continue}if(i==="-c"||i==="--create")r.create=!0;else if(i==="-r"||i==="--append")r.append=!0;else if(i==="-u"||i==="--update")r.update=!0;else if(i==="-x"||i==="--extract"||i==="--get")r.extract=!0;else if(i==="-t"||i==="--list")r.list=!0;else if(i==="-a"||i==="--auto-compress")r.autoCompress=!0;else if(i==="-z"||i==="--gzip"||i==="--gunzip")r.gzip=!0;else if(i==="-j"||i==="--bzip2")r.bzip2=!0;else if(i==="-J"||i==="--xz")r.xz=!0;else if(i==="--zstd")r.zstd=!0;else if(i==="-v"||i==="--verbose")r.verbose=!0;else if(i==="-O"||i==="--to-stdout")r.toStdout=!0;else if(i==="-k"||i==="--keep-old-files")r.keepOldFiles=!0;else if(i==="-m"||i==="--touch")r.touch=!0;else if(i==="--wildcards")r.wildcards=!0;else if(i==="-p"||i==="--preserve"||i==="--preserve-permissions")r.preserve=!0;else if(i==="-P"||i==="--absolute-names")r.absoluteNames=!0;else if(i==="-f"||i==="--file"){if(o++,o>=n.length)return{ok:!1,error:{stdout:"",stderr:`tar: option requires an argument -- 'f' -`,exitCode:2}};r.file=n[o]}else if(i.startsWith("--file="))r.file=i.substring(7);else if(i==="-C"||i==="--directory"){if(o++,o>=n.length)return{ok:!1,error:{stdout:"",stderr:`tar: option requires an argument -- 'C' -`,exitCode:2}};r.directory=n[o]}else if(i.startsWith("--directory="))r.directory=i.substring(12);else if(i.startsWith("--strip-components=")||i.startsWith("--strip=")){let a=i.includes("--strip-components=")?i.substring(19):i.substring(8),l=parseInt(a,10);if(Number.isNaN(l)||l<0)return{ok:!1,error:{stdout:"",stderr:`tar: invalid number for --strip: '${a}' -`,exitCode:2}};r.strip=l}else if(i.startsWith("--exclude="))r.exclude.push(i.substring(10));else if(i==="--exclude"){if(o++,o>=n.length)return{ok:!1,error:{stdout:"",stderr:`tar: option '--exclude' requires an argument -`,exitCode:2}};r.exclude.push(n[o])}else if(i==="-T"||i==="--files-from"){if(o++,o>=n.length)return{ok:!1,error:{stdout:"",stderr:`tar: option requires an argument -- 'T' -`,exitCode:2}};r.filesFrom=n[o]}else if(i.startsWith("--files-from="))r.filesFrom=i.substring(13);else if(i==="-X"||i==="--exclude-from"){if(o++,o>=n.length)return{ok:!1,error:{stdout:"",stderr:`tar: option requires an argument -- 'X' -`,exitCode:2}};r.excludeFrom=n[o]}else if(i.startsWith("--exclude-from="))r.excludeFrom=i.substring(15);else if(i==="--"){s.push(...n.slice(o+1));break}else{if(i.startsWith("-"))return{ok:!1,error:ee("tar",i)};s.push(i)}o++}return{ok:!0,options:r,files:s}}var Ge=100,Pt={name:"tar",summary:"manipulate tape archives",usage:"tar [options] [file...]",description:["Create, extract, or list contents of tar archives.","","One of -c, -r, -u, -x, or -t is required to specify the operation."],options:["-c, --create create a new archive","-r, --append append files to the end of an archive","-u, --update only append files newer than copy in archive","-x, --extract extract files from an archive","-t, --list list contents of an archive","-f, --file=ARCHIVE use archive file ARCHIVE","-a, --auto-compress use archive suffix to determine compression","-z, --gzip filter archive through gzip","-j, --bzip2 filter archive through bzip2","-J, --xz filter archive through xz","--zstd filter archive through zstd","-v, --verbose verbosely list files processed","-O, --to-stdout extract files to standard output","-k, --keep-old-files don't replace existing files when extracting","-m, --touch don't extract file modified time","-C, --directory=DIR change to directory DIR before performing operations","-p, --preserve preserve permissions","-P, --absolute-names do not strip leading '/' or block '..' paths","-T, --files-from=FILE read files to extract/create from FILE","-X, --exclude-from=FILE read exclude patterns from FILE","--strip=N strip N leading path components on extraction","--exclude=PATTERN exclude files matching PATTERN","--wildcards use wildcards for pattern matching"," --help display this help and exit"],examples:["tar -cvf archive.tar file1 file2 Create archive from files","tar -czvf archive.tar.gz dir/ Create gzip-compressed archive","tar -cjvf archive.tar.bz2 dir/ Create bzip2-compressed archive","tar -rf archive.tar newfile.txt Append file to archive","tar -uf archive.tar dir/ Update archive with newer files","tar -xvf archive.tar Extract archive","tar -xvf archive.tar -C /tmp Extract to /tmp","tar -tvf archive.tar List archive contents","tar -xzf archive.tar.gz Extract gzip archive","tar -xf archive.tar file1.txt Extract specific file","tar -xOf archive.tar file.txt Extract file to stdout","tar -xf archive.tar --wildcards '*.txt' Extract matching files"]};function me(e,t){let n=e.includes("/")?e.substring(e.lastIndexOf("/")+1):e;for(let r of t){let s=r.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,"<<>>").replace(/\*/g,"[^/]*").replace(/<<>>/g,".*").replace(/\?/g,".");if(U(`^${s}$`).test(e)||U(`^${s}/`).test(e)||!r.includes("/")&&U(`^${s}$`).test(n))return!0}return!1}function Y(e,t){let n=t.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,"<<>>").replace(/\*/g,"[^/]*").replace(/<<>>/g,".*").replace(/\?/g,"."),r=e.includes("/")?e.substring(e.lastIndexOf("/")+1):e;return U(`^${n}$`).test(e)||U(`^${n}$`).test(r)}function qe(e,t){if(t<=0)return e;let n=e.split("/").filter(r=>r!=="");return n.length<=t?"":n.slice(t).join("/")}function Ye(e){return e.split("/").some(t=>t==="..")}function Ot(e,t){if(t)return{safePath:e};let n=e.replace(/^\/+/,"");return n.length===0?{safePath:""}:Ye(n)?{error:"Path contains '..'"}:{safePath:n}}function Ut(e){let n=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],r=e.getDate().toString().padStart(2," "),s=e.getHours().toString().padStart(2,"0"),o=e.getMinutes().toString().padStart(2,"0");return`${n} ${r} ${s}:${o}`}async function K(e,t,n,r){let s=[],o=[],i=e.fs.resolvePath(t,n);try{let a=await e.fs.stat(i);if(me(n,r))return{entries:s,errors:o};if(a.isDirectory){s.push({name:n,isDirectory:!0,mode:a.mode,mtime:a.mtime});let l=await e.fs.readdir(i);for(let c=0;cK(e,t,n?`${n}/${y}`:y,r)));for(let y of u)s.push(...y.entries),o.push(...y.errors)}}else if(a.isFile){let l=await e.fs.readFileBuffer(i);s.push({name:n,content:l,mode:a.mode,mtime:a.mtime})}else if(a.isSymbolicLink){let l=await e.fs.readlink(i);s.push({name:n,isSymlink:!0,linkTarget:l,mode:a.mode,mtime:a.mtime})}}catch(a){let l=a instanceof Error?a.message:"unknown error";o.push(`tar: ${n}: ${l}`)}return{entries:s,errors:o}}async function Nt(e,t,n){if(n.length===0)return{stdout:"",stderr:`tar: Cowardly refusing to create an empty archive -`,exitCode:2};let r=t.directory?e.fs.resolvePath(e.cwd,t.directory):e.cwd,s=[],o=[],i="";for(let f of n){let{entries:u,errors:y}=await K(e,r,f,t.exclude);if(s.push(...u),o.push(...y),t.verbose)for(let g of u)i+=`${g.name}${g.isDirectory?"/":""} -`}if(s.length===0&&o.length>0)return{stdout:"",stderr:`${o.join(` -`)} -`,exitCode:2};let a;try{t.gzip?a=await je(s):t.bzip2?a=await He(s):t.xz?a=await _e(s):t.zstd?a=await Xe(s):a=await O(s)}catch(f){return{stdout:"",stderr:`tar: error creating archive: ${f instanceof Error?f.message:"unknown error"} -`,exitCode:2}}let l="";if(t.file&&t.file!=="-"){let f=e.fs.resolvePath(e.cwd,t.file);try{await e.fs.writeFile(f,a)}catch(u){let y=u instanceof Error?u.message:"unknown error";return{stdout:"",stderr:`tar: ${t.file}: ${y} -`,exitCode:2}}}else l=Buffer.from(a).toString("latin1");let c=i;return o.length>0&&(c+=`${o.join(` -`)} -`),{stdout:l,stderr:c,exitCode:o.length>0?2:0,stdoutKind:l.length>0?"bytes":"text"}}async function Lt(e,t,n){if(!t.file||t.file==="-")return{stdout:"",stderr:`tar: Cannot append to stdin/stdout -`,exitCode:2};if(n.length===0)return{stdout:"",stderr:`tar: Cowardly refusing to append nothing to archive -`,exitCode:2};let r=e.fs.resolvePath(e.cwd,t.file),s;try{s=await e.fs.readFileBuffer(r)}catch{return{stdout:"",stderr:`tar: ${t.file}: Cannot open: No such file or directory -`,exitCode:2}}let o=await F(s);if(o.error)return{stdout:"",stderr:`tar: ${o.error} -`,exitCode:2};let i=o.entries.map(d=>({name:d.name,content:d.content,mode:d.mode,mtime:d.mtime,isDirectory:d.type==="directory",isSymlink:d.type==="symlink",linkTarget:d.linkTarget,uid:d.uid,gid:d.gid})),a=t.directory?e.fs.resolvePath(e.cwd,t.directory):e.cwd,l=[],c=[],f="";for(let d of n){let{entries:p,errors:m}=await K(e,a,d,t.exclude);if(l.push(...p),c.push(...m),t.verbose)for(let x of p)f+=`${x.name}${x.isDirectory?"/":""} -`}let u=[...i,...l],y;try{y=await O(u)}catch(d){return{stdout:"",stderr:`tar: error creating archive: ${d instanceof Error?d.message:"unknown error"} -`,exitCode:2}}try{await e.fs.writeFile(r,y)}catch(d){let p=d instanceof Error?d.message:"unknown error";return{stdout:"",stderr:`tar: ${t.file}: ${p} -`,exitCode:2}}let g=f;return c.length>0&&(g+=`${c.join(` -`)} -`),{stdout:"",stderr:g,exitCode:c.length>0?2:0}}async function Dt(e,t,n){if(!t.file||t.file==="-")return{stdout:"",stderr:`tar: Cannot update stdin/stdout -`,exitCode:2};if(n.length===0)return{stdout:"",stderr:`tar: Cowardly refusing to update with nothing -`,exitCode:2};let r=e.fs.resolvePath(e.cwd,t.file),s;try{s=await e.fs.readFileBuffer(r)}catch{return{stdout:"",stderr:`tar: ${t.file}: Cannot open: No such file or directory -`,exitCode:2}}let o=await F(s);if(o.error)return{stdout:"",stderr:`tar: ${o.error} -`,exitCode:2};let i=new Map;for(let m of o.entries)i.set(m.name,m.mtime);let a=t.directory?e.fs.resolvePath(e.cwd,t.directory):e.cwd,l=[],c=[],f="";for(let m of n){let{entries:x,errors:b}=await K(e,a,m,t.exclude);c.push(...b);for(let E of x){let v=i.get(E.name);(!v||E.mtime&&E.mtime.getTime()>v.getTime())&&(l.push(E),t.verbose&&(f+=`${E.name}${E.isDirectory?"/":""} -`))}}if(l.length===0){let m="";return c.length>0&&(m=`${c.join(` -`)} -`),{stdout:"",stderr:m,exitCode:c.length>0?2:0}}let u=new Set(l.map(m=>m.name)),g=[...o.entries.filter(m=>!u.has(m.name)).map(m=>({name:m.name,content:m.content,mode:m.mode,mtime:m.mtime,isDirectory:m.type==="directory",isSymlink:m.type==="symlink",linkTarget:m.linkTarget,uid:m.uid,gid:m.gid})),...l],d;try{d=await O(g)}catch(m){return{stdout:"",stderr:`tar: error creating archive: ${m instanceof Error?m.message:"unknown error"} -`,exitCode:2}}try{await e.fs.writeFile(r,d)}catch(m){let x=m instanceof Error?m.message:"unknown error";return{stdout:"",stderr:`tar: ${t.file}: ${x} -`,exitCode:2}}let p=f;return c.length>0&&(p+=`${c.join(` -`)} -`),{stdout:"",stderr:p,exitCode:c.length>0?2:0}}async function Rt(e,t,n){let r;if(t.file&&t.file!=="-"){let p=e.fs.resolvePath(e.cwd,t.file);try{r=await e.fs.readFileBuffer(p)}catch{return{stdout:"",stderr:`tar: ${t.file}: Cannot open: No such file or directory -`,exitCode:2}}}else r=Uint8Array.from(e.stdin,p=>p.charCodeAt(0));let s,o=t.gzip||oe(r),i=t.bzip2||ae(r),a=t.xz||le(r),l=t.zstd||ue(r);if(o?s=await se(r):i?s=await ce(r):a?s=await fe(r):l?s=await de(r):s=await F(r),s.error)return{stdout:"",stderr:`tar: ${s.error} -`,exitCode:2};let c=t.directory?e.fs.resolvePath(e.cwd,t.directory):e.cwd,f=t.absoluteNames?n:n.map(p=>p.replace(/^\/+/,"")).filter(p=>p.length>0),u="",y="",g=[];if(t.directory&&!t.toStdout)try{await e.fs.mkdir(c,{recursive:!0})}catch{}for(let p of s.entries){let m=qe(p.name,t.strip);if(!m)continue;let x=Ot(m,t.absoluteNames);if(x.error){g.push(`tar: ${m}: ${x.error}`);continue}let b=x.safePath??"";if(!b)continue;let E=b.endsWith("/")?b.slice(0,-1):b;if(f.length>0){let $;if(t.wildcards?$=f.some(z=>Y(b,z)||Y(E,z)||b.startsWith(`${z}/`)):$=f.some(z=>b===z||b.startsWith(`${z}/`)||E===z),!$)continue}if(me(b,t.exclude))continue;let v=e.fs.resolvePath(c,b);try{if(p.type==="directory"){if(t.toStdout)continue;await e.fs.mkdir(v,{recursive:!0}),t.verbose&&(u+=`${b} -`)}else if(p.type==="file"){if(t.toStdout){y+=new TextDecoder().decode(p.content),t.verbose&&(u+=`${b} -`);continue}if(t.keepOldFiles)try{await e.fs.stat(v),t.verbose&&(u+=`${b}: not overwritten, file exists -`);continue}catch{}let $=v.substring(0,v.lastIndexOf("/"));if($)try{await e.fs.mkdir($,{recursive:!0})}catch{}if(await e.fs.writeFile(v,p.content),t.preserve&&p.mode)try{await e.fs.chmod(v,p.mode)}catch{}t.verbose&&(u+=`${b} -`)}else if(p.type==="symlink"&&p.linkTarget){if(t.toStdout)continue;if(!t.absoluteNames&&(p.linkTarget.startsWith("/")||Ye(p.linkTarget))){g.push(`tar: ${b}: unsafe symlink target`);continue}if(t.keepOldFiles)try{await e.fs.stat(v),t.verbose&&(u+=`${b}: not overwritten, file exists -`);continue}catch{}let $=v.substring(0,v.lastIndexOf("/"));if($)try{await e.fs.mkdir($,{recursive:!0})}catch{}try{await e.fs.symlink(p.linkTarget,v)}catch{}t.verbose&&(u+=`${b} -`)}}catch($){let z=$ instanceof Error?$.message:"unknown error";g.push(`tar: ${b}: ${z}`)}}let d=u;return g.length>0&&(d+=`${g.join(` -`)} -`),{stdout:y,stderr:d,exitCode:g.length>0?2:0}}async function Mt(e,t,n){let r;if(t.file&&t.file!=="-"){let f=e.fs.resolvePath(e.cwd,t.file);try{r=await e.fs.readFileBuffer(f)}catch{return{stdout:"",stderr:`tar: ${t.file}: Cannot open: No such file or directory -`,exitCode:2}}}else r=Uint8Array.from(e.stdin,f=>f.charCodeAt(0));let s,o=t.gzip||oe(r),i=t.bzip2||ae(r),a=t.xz||le(r),l=t.zstd||ue(r);if(o?s=await se(r):i?s=await ce(r):a?s=await fe(r):l?s=await de(r):s=await F(r),s.error)return{stdout:"",stderr:`tar: ${s.error} -`,exitCode:2};let c="";for(let f of s.entries){let u=qe(f.name,t.strip);if(!u)continue;let y=u.endsWith("/")?u.slice(0,-1):u;if(n.length>0){let g;if(t.wildcards?g=n.some(d=>Y(u,d)||Y(y,d)||u.startsWith(`${d}/`)):g=n.some(d=>u===d||u.startsWith(`${d}/`)||y===d),!g)continue}if(!me(u,t.exclude))if(t.verbose){let g=f.type==="directory",d=ye(f.mode,g),p=`${f.uid}/${f.gid}`,m=f.size.toString().padStart(8," "),x=Ut(f.mtime),b=`${d} ${p.padEnd(10)} ${m} ${x} ${u}`;f.type==="symlink"&&f.linkTarget&&(b+=` -> ${f.linkTarget}`),c+=`${b} -`}else c+=`${u} -`}return{stdout:c,stderr:"",exitCode:0}}var sr={name:"tar",async execute(e,t){if(ge(e))return pe(Pt);let n=Ze(e);if(!n.ok)return n.error;let{options:r,files:s}=n,o=[r.create,r.append,r.update,r.extract,r.list].filter(Boolean).length;if(o===0)return{stdout:"",stderr:`tar: You must specify one of -c, -r, -u, -x, or -t -`,exitCode:2};if(o>1)return{stdout:"",stderr:`tar: You may not specify more than one of -c, -r, -u, -x, or -t -`,exitCode:2};if(r.autoCompress&&r.file&&r.create){let l=r.file.toLowerCase();l.endsWith(".tar.gz")||l.endsWith(".tgz")?r.gzip=!0:l.endsWith(".tar.bz2")||l.endsWith(".tbz2")?r.bzip2=!0:l.endsWith(".tar.xz")||l.endsWith(".txz")?r.xz=!0:(l.endsWith(".tar.zst")||l.endsWith(".tzst"))&&(r.zstd=!0)}let i=[r.gzip,r.bzip2,r.xz,r.zstd].filter(Boolean).length;if(i>1)return{stdout:"",stderr:`tar: You may not specify more than one compression option -`,exitCode:2};if((r.append||r.update)&&i>0)return{stdout:"",stderr:`tar: Cannot append/update compressed archives - decompress first -`,exitCode:2};let a=s;if(r.filesFrom){let l=t.fs.resolvePath(t.cwd,r.filesFrom);try{let f=(await t.fs.readFile(l)).split(` -`).map(u=>u.trim()).filter(u=>u.length>0&&!u.startsWith("#"));a=[...s,...f]}catch{return{stdout:"",stderr:`tar: ${r.filesFrom}: Cannot open: No such file or directory -`,exitCode:2}}}if(r.excludeFrom){let l=t.fs.resolvePath(t.cwd,r.excludeFrom);try{let f=(await t.fs.readFile(l)).split(` -`).map(u=>u.trim()).filter(u=>u.length>0&&!u.startsWith("#"));r.exclude.push(...f)}catch{return{stdout:"",stderr:`tar: ${r.excludeFrom}: Cannot open: No such file or directory -`,exitCode:2}}}return r.create?Nt(t,r,a):r.append?Lt(t,r,a):r.update?Dt(t,r,a):r.extract?Rt(t,r,a):Mt(t,r,a)}},or={name:"tar",flags:[{flag:"-c",type:"boolean"},{flag:"-x",type:"boolean"},{flag:"-t",type:"boolean"},{flag:"-f",type:"value",valueHint:"path"},{flag:"-z",type:"boolean"},{flag:"-j",type:"boolean"},{flag:"-v",type:"boolean"},{flag:"-C",type:"value",valueHint:"path"},{flag:"--strip-components",type:"value",valueHint:"number"},{flag:"--exclude",type:"value",valueHint:"pattern"}],needsArgs:!0};export{sr as a,or as b}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-HBVMHTO5.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-HBVMHTO5.js deleted file mode 100644 index b045ae8..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-HBVMHTO5.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -var r=globalThis.SharedArrayBuffer,e=globalThis.Atomics,o=performance.now.bind(performance),a=globalThis.Headers;export{r as a,e as b,o as c,a as d}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-HDRAUQK2.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-HDRAUQK2.js deleted file mode 100644 index e4243c9..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-HDRAUQK2.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -var e={name:"true",async execute(){return{stdout:"",stderr:"",exitCode:0}}},t={name:"false",async execute(){return{stdout:"",stderr:"",exitCode:1}}},s={name:"true",flags:[]},r={name:"false",flags:[]};export{e as a,t as b,s as c,r as d}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-IZ6KBTV7.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-IZ6KBTV7.js deleted file mode 100644 index e98bdbe..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-IZ6KBTV7.js +++ /dev/null @@ -1,100 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a as U,b as z}from"./chunk-KAPG5ONA.js";import{a as I}from"./chunk-VACKIICN.js";import{a as A}from"./chunk-7CSMHFIJ.js";import{c as P}from"./chunk-XEKXHOPO.js";import{k}from"./chunk-SAI2SPQQ.js";import{a as L}from"./chunk-FOCWZZDE.js";import{a as te,b as ne,c as W}from"./chunk-QAYAQNCG.js";var H=new Map([["alnum","a-zA-Z0-9"],["alpha","a-zA-Z"],["ascii","\\x00-\\x7F"],["blank"," \\t"],["cntrl","\\x00-\\x1F\\x7F"],["digit","0-9"],["graph","!-~"],["lower","a-z"],["print"," -~"],["punct","!-/:-@\\[-`{-~"],["space"," \\t\\n\\r\\f\\v"],["upper","A-Z"],["word","a-zA-Z0-9_"],["xdigit","0-9A-Fa-f"]]);function V(i){let e="",t=0,n=!1;for(;t=127?e+=`\\${s.toString(8).padStart(3,"0")}`:e+=n}return`${e}$`}var pe=1e4;function re(i,e,t){return{patternSpace:"",holdSpace:"",lineNumber:0,totalLines:i,deleted:!1,printed:!1,quit:!1,quitSilent:!1,exitCode:void 0,errorMessage:void 0,appendBuffer:[],substitutionMade:!1,lineNumberOutput:[],nCommandOutput:[],restartCycle:!1,inDRestartedCycle:!1,currentFilename:e,pendingFileReads:[],pendingFileWrites:[],rangeStates:t||new Map,linesConsumedInCycle:0}}function me(i){return typeof i=="object"&&"first"in i&&"step"in i}function ge(i){return typeof i=="object"&&"offset"in i}function N(i,e,t,n,s){if(i==="$")return e===t;if(typeof i=="number")return e===i;if(me(i)){let{first:a,step:r}=i;return r===0?e===a:(e-a)%r===0&&e>=a}if(typeof i=="object"&&"pattern"in i)try{let a=i.pattern;a===""&&s?.lastPattern?a=s.lastPattern:a!==""&&s&&(s.lastPattern=a);let r=X(V(a));return A(r).test(n)}catch{return!1}return!1}function G(i){let e=t=>t===void 0?"undefined":t==="$"?"$":typeof t=="number"?String(t):"pattern"in t?`/${t.pattern}/`:"first"in t?`${t.first}~${t.step}`:"unknown";return`${e(i.start)},${e(i.end)}`}function be(i,e,t,n,s,a){if(!i||!i.start&&!i.end)return!0;let r=i.start,l=i.end;if(r!==void 0&&l===void 0)return N(r,e,t,n,a);if(r!==void 0&&l!==void 0){let c=typeof r=="object"&&"pattern"in r,f=typeof l=="object"&&"pattern"in l,p=ge(l);if(p&&s){let g=G(i),d=s.get(g);if(d||(d={active:!1},s.set(g,d)),d.active){let E=d.startLine||e;return e>=E+l.offset&&(d.active=!1,s.set(g,d)),!0}else return N(r,e,t,n,a)?(d.active=!0,d.startLine=e,s.set(g,d),l.offset===0&&(d.active=!1,s.set(g,d)),!0):!1}if(!c&&!f&&!p){let g=typeof r=="number"?r:r==="$"?t:1,d=typeof l=="number"?l:t;if(g<=d)return e>=g&&e<=d;if(s){let E=G(i),u=s.get(E);return u||(u={active:!1},s.set(E,u)),!u.completed&&e>=g?(u.completed=!0,s.set(E,u),!0):!1}return!1}if(s){let g=G(i),d=s.get(g);if(d||(d={active:!1},s.set(g,d)),d.active)return N(l,e,t,n,a)&&(d.active=!1,typeof r=="number"&&(d.completed=!0),s.set(g,d)),!0;{if(d.completed)return!1;let E=!1;return typeof r=="number"?E=e>=r:E=N(r,e,t,n,a),E?(d.active=!0,d.startLine=e,s.set(g,d),N(l,e,t,n,a)&&(d.active=!1,typeof r=="number"&&(d.completed=!0),s.set(g,d)),!0):!1}}return N(r,e,t,n,a)}return!0}function w(i,e,t,n,s,a){let r=be(i,e,t,n,s,a);return i?.negated?!r:r}function Ee(i,e,t,n){let s="",a=0,r=!1;for(;a<=i.length;){e.lastIndex=a;let l=e.exec(i);if(!l){s+=i.slice(a);break}if(l.index!==a){s+=i.slice(a,l.index),a=l.index,r=!1;continue}let c=l[0],f=l.slice(1);if(r&&c.length===0){if(a=1&&r<=9){n+=t[r-1]||"",s+=2;continue}n+=a,s+=2;continue}if(i[s]==="&"){n+=e,s++;continue}n+=i[s],s++}return n}function se(i,e,t){if(e>0&&i.length>e)throw new k(`sed: ${t} size limit exceeded (${e} bytes)`,"string_length")}function ve(i,e,t){let{lineNumber:n,totalLines:s,patternSpace:a}=e;if(i.type==="label"){e.coverage?.hit(`sed:cmd:${i.type}`);return}if(w(i.address,n,s,a,e.rangeStates,e))switch(e.coverage?.hit(`sed:cmd:${i.type}`),i.type){case"substitute":{let r=i,l="";r.global&&(l+="g"),r.ignoreCase&&(l+="i");let c=r.pattern;c===""&&e.lastPattern?c=e.lastPattern:c!==""&&(e.lastPattern=c);let f=X(r.extendedRegex?c:V(c));try{let p=A(f,l),x=p.test(e.patternSpace);if(p.lastIndex=0,x){if(e.substitutionMade=!0,r.nthOccurrence&&r.nthOccurrence>0&&!r.global){let g=0,d=r.nthOccurrence,E=A(f,`g${r.ignoreCase?"i":""}`);e.patternSpace=E.replace(e.patternSpace,(u,...h)=>{if(g++,g===d){let b=h.slice(0,-2);return j(r.replacement,u,b)}return u})}else if(r.global){let g=A(f,`g${r.ignoreCase?"i":""}`);e.patternSpace=Ee(e.patternSpace,g,r.replacement,(d,E)=>j(r.replacement,d,E))}else e.patternSpace=p.replace(e.patternSpace,(g,...d)=>{let E=d.slice(0,-2);return j(r.replacement,g,E)});r.printOnMatch&&e.lineNumberOutput.push(e.patternSpace)}}catch{}break}case"print":e.lineNumberOutput.push(e.patternSpace);break;case"printFirstLine":{let r=e.patternSpace.indexOf(` -`);r!==-1?e.lineNumberOutput.push(e.patternSpace.slice(0,r)):e.lineNumberOutput.push(e.patternSpace);break}case"delete":e.deleted=!0;break;case"deleteFirstLine":{let r=e.patternSpace.indexOf(` -`);r!==-1?(e.patternSpace=e.patternSpace.slice(r+1),e.restartCycle=!0,e.inDRestartedCycle=!0):e.deleted=!0;break}case"zap":e.patternSpace="";break;case"append":e.appendBuffer.push(i.text);break;case"insert":e.appendBuffer.unshift(`__INSERT__${i.text}`);break;case"change":e.deleted=!0,e.changedText=i.text;break;case"hold":e.holdSpace=e.patternSpace;break;case"holdAppend":e.holdSpace?e.holdSpace+=` -${e.patternSpace}`:e.holdSpace=e.patternSpace,se(e.holdSpace,t?.maxStringLength??0,"hold space");break;case"get":e.patternSpace=e.holdSpace;break;case"getAppend":e.patternSpace+=` -${e.holdSpace}`,se(e.patternSpace,t?.maxStringLength??0,"pattern space");break;case"exchange":{let r=e.patternSpace;e.patternSpace=e.holdSpace,e.holdSpace=r;break}case"next":e.printed=!0;break;case"quit":e.quit=!0,i.exitCode!==void 0&&(e.exitCode=i.exitCode);break;case"quitSilent":e.quit=!0,e.quitSilent=!0,i.exitCode!==void 0&&(e.exitCode=i.exitCode);break;case"list":{let r=ie(e.patternSpace);e.lineNumberOutput.push(r);break}case"printFilename":e.currentFilename&&e.lineNumberOutput.push(e.currentFilename);break;case"version":{let r=[4,8,0];if(i.minVersion){let l=i.minVersion.split("."),c=[],f=!1;for(let p of l){let x=parseInt(p,10);if(Number.isNaN(x)||x<0){e.quit=!0,e.exitCode=1,e.errorMessage=`sed: invalid version string: ${i.minVersion}`,f=!0;break}c.push(x)}if(!f){for(;c.length<3;)c.push(0);for(let p=0;p<3;p++){if(c[p]>r[p]){e.quit=!0,e.exitCode=1,e.errorMessage=`sed: this is not GNU sed version ${i.minVersion}`;break}if(c[p]a)throw new k(`sed: command execution exceeded maximum iterations (${a})`,"iterations");if(e.deleted||e.quit||e.quitSilent||e.restartCycle)break;let c=i[l];if(c.type==="next"){if(w(c.address,e.lineNumber,e.totalLines,e.patternSpace,e.rangeStates,e))if(e.coverage?.hit("sed:cmd:next"),e.nCommandOutput.push(e.patternSpace),t&&t.currentLineIndex+e.linesConsumedInCycle+1=this.input.length)return null;let e=this.line,t=this.column,n=this.peek();return n===` -`?(this.advance(),{type:o.NEWLINE,value:` -`,line:e,column:t}):n===";"?(this.advance(),{type:o.SEMICOLON,value:";",line:e,column:t}):n==="{"?(this.advance(),{type:o.LBRACE,value:"{",line:e,column:t}):n==="}"?(this.advance(),{type:o.RBRACE,value:"}",line:e,column:t}):n===","?(this.advance(),{type:o.COMMA,value:",",line:e,column:t}):n==="!"?(this.advance(),{type:o.NEGATION,value:"!",line:e,column:t}):n==="$"?(this.advance(),{type:o.DOLLAR,value:"$",line:e,column:t}):this.isDigit(n)?this.readNumber():n==="+"&&this.isDigit(this.input[this.pos+1]||"")?this.readRelativeOffset():n==="/"?this.readPattern():n===":"?this.readLabelDef():this.readCommand()}readNumber(){let e=this.line,t=this.column,n="";for(;this.isDigit(this.peek());)n+=this.advance();if(this.peek()==="~"){this.advance();let s="";for(;this.isDigit(this.peek());)s+=this.advance();let a=parseInt(n,10),r=parseInt(s,10)||0;return{type:o.STEP,value:`${a}~${r}`,first:a,step:r,line:e,column:t}}return{type:o.NUMBER,value:parseInt(n,10),line:e,column:t}}readRelativeOffset(){let e=this.line,t=this.column;this.advance();let n="";for(;this.isDigit(this.peek());)n+=this.advance();let s=parseInt(n,10)||0;return{type:o.RELATIVE_OFFSET,value:`+${s}`,offset:s,line:e,column:t}}readPattern(){let e=this.line,t=this.column;this.advance();let n="",s=!1;for(;this.pos="0"&&e<="9"}};var K=class{scripts;tokens=[];pos=0;extendedRegex=!1;constructor(e,t=!1){this.scripts=e,this.extendedRegex=t}parse(){let e=[];for(let t of this.scripts){let n=new _(t);for(this.tokens=n.tokenize(),this.pos=0;!this.isAtEnd();){if(this.check(o.NEWLINE)||this.check(o.SEMICOLON)){this.advance();continue}let s=this.pos,a=this.parseCommand();if(a.error)return{commands:[],error:a.error};if(a.command&&e.push(a.command),this.pos===s&&!this.isAtEnd())return{commands:[],error:`unknown command: '${this.peek()?.value??this.peek()?.type}'`}}}return{commands:e}}parseCommand(){let e=this.parseAddressRange();if(e?.error)return{command:null,error:e.error};let t=e?.address;for(this.check(o.NEGATION)&&(this.advance(),t&&(t.negated=!0));this.check(o.NEWLINE)||this.check(o.SEMICOLON);)this.advance();if(this.isAtEnd())return t&&(t.start!==void 0||t.end!==void 0)?{command:null,error:"command expected"}:{command:null};let n=this.peek();switch(n.type){case o.COMMAND:return this.parseSimpleCommand(n,t);case o.SUBSTITUTE:return this.parseSubstituteFromToken(n,t);case o.TRANSLITERATE:return this.parseTransliterateFromToken(n,t);case o.LABEL_DEF:return this.advance(),{command:{type:"label",name:n.label||""}};case o.BRANCH:return this.advance(),{command:{type:"branch",address:t,label:n.label}};case o.BRANCH_ON_SUBST:return this.advance(),{command:{type:"branchOnSubst",address:t,label:n.label}};case o.BRANCH_ON_NO_SUBST:return this.advance(),{command:{type:"branchOnNoSubst",address:t,label:n.label}};case o.TEXT_CMD:return this.advance(),this.parseTextCommand(n,t);case o.FILE_READ:return this.advance(),{command:{type:"readFile",address:t,filename:n.filename||""}};case o.FILE_READ_LINE:return this.advance(),{command:{type:"readFileLine",address:t,filename:n.filename||""}};case o.FILE_WRITE:return this.advance(),{command:{type:"writeFile",address:t,filename:n.filename||""}};case o.FILE_WRITE_LINE:return this.advance(),{command:{type:"writeFirstLine",address:t,filename:n.filename||""}};case o.EXECUTE:return this.advance(),{command:{type:"execute",address:t,command:n.command}};case o.VERSION:return this.advance(),{command:{type:"version",address:t,minVersion:n.label}};case o.LBRACE:return this.parseGroup(t);case o.RBRACE:return{command:null};case o.ERROR:return{command:null,error:`invalid command: ${n.value}`};default:return t&&(t.start!==void 0||t.end!==void 0)?{command:null,error:"command expected"}:{command:null}}}parseSimpleCommand(e,t){this.advance();let n=e.value;switch(n){case"p":return{command:{type:"print",address:t}};case"P":return{command:{type:"printFirstLine",address:t}};case"d":return{command:{type:"delete",address:t}};case"D":return{command:{type:"deleteFirstLine",address:t}};case"h":return{command:{type:"hold",address:t}};case"H":return{command:{type:"holdAppend",address:t}};case"g":return{command:{type:"get",address:t}};case"G":return{command:{type:"getAppend",address:t}};case"x":return{command:{type:"exchange",address:t}};case"n":return{command:{type:"next",address:t}};case"N":return{command:{type:"nextAppend",address:t}};case"q":return{command:{type:"quit",address:t}};case"Q":return{command:{type:"quitSilent",address:t}};case"z":return{command:{type:"zap",address:t}};case"=":return{command:{type:"lineNumber",address:t}};case"l":return{command:{type:"list",address:t}};case"F":return{command:{type:"printFilename",address:t}};default:return{command:null,error:`unknown command: ${n}`}}}parseSubstituteFromToken(e,t){this.advance();let n=e.flags||"",s,a=n.match(/(\d+)/);return a&&(s=parseInt(a[1],10)),{command:{type:"substitute",address:t,pattern:e.pattern||"",replacement:e.replacement||"",global:n.includes("g"),ignoreCase:n.includes("i")||n.includes("I"),printOnMatch:n.includes("p"),nthOccurrence:s,extendedRegex:this.extendedRegex}}}parseTransliterateFromToken(e,t){this.advance();let n=e.source||"",s=e.dest||"";return n.length!==s.length?{command:null,error:"transliteration sets must have same length"}:{command:{type:"transliterate",address:t,source:n,dest:s}}}parseTextCommand(e,t){let n=e.value,s=e.text||"";switch(n){case"a":return{command:{type:"append",address:t,text:s}};case"i":return{command:{type:"insert",address:t,text:s}};case"c":return{command:{type:"change",address:t,text:s}};default:return{command:null,error:`unknown text command: ${n}`}}}parseGroup(e){this.advance();let t=[];for(;!this.isAtEnd()&&!this.check(o.RBRACE);){if(this.check(o.NEWLINE)||this.check(o.SEMICOLON)){this.advance();continue}let n=this.pos,s=this.parseCommand();if(s.error)return{command:null,error:s.error};if(s.command&&t.push(s.command),this.pos===n&&!this.isAtEnd())return{command:null,error:`unknown command: '${this.peek()?.value??this.peek()?.type}'`}}return this.check(o.RBRACE)?(this.advance(),{command:{type:"group",address:e,commands:t}}):{command:null,error:"unmatched brace in grouped commands"}}parseAddressRange(){if(this.check(o.COMMA))return{error:"expected context address"};let e=this.parseAddress();if(e===void 0)return;let t;if(this.check(o.RELATIVE_OFFSET))t={offset:this.advance().offset||0};else if(this.check(o.COMMA)&&(this.advance(),t=this.parseAddress(),t===void 0))return{error:"expected context address"};return{address:{start:e,end:t}}}parseAddress(){let e=this.peek();switch(e.type){case o.NUMBER:return this.advance(),e.value;case o.DOLLAR:return this.advance(),"$";case o.PATTERN:return this.advance(),{pattern:e.pattern||e.value};case o.STEP:return this.advance(),{first:e.first||0,step:e.step||0};case o.RELATIVE_OFFSET:return this.advance(),{offset:e.offset||0};default:return}}peek(){return this.tokens[this.pos]||{type:o.EOF,value:"",line:0,column:0}}advance(){return this.isAtEnd()||this.pos++,this.tokens[this.pos-1]}check(e){return this.peek().type===e}isAtEnd(){return this.peek().type===o.EOF}};function ae(i,e=!1){let t=!1,n=!1,s=[];for(let c=0;c0&&s[s.length-1].endsWith("\\")){let p=s[s.length-1];s[s.length-1]=`${p} -${f}`}else s.push(f)}let a=s.join(` -`),l=new K([a],e||n).parse();if(!l.error&&l.commands.length>0){let c=xe(l.commands);if(c)return{commands:[],error:c,silentMode:t,extendedRegexMode:n}}return{...l,silentMode:t,extendedRegexMode:n}}function xe(i){let e=new Set;ce(i,e);let t=oe(i,e);if(t)return`undefined label '${t}'`}function ce(i,e){for(let t of i)t.type==="label"?e.add(t.name):t.type==="group"&&ce(t.commands,e)}function oe(i,e){for(let t of i){if((t.type==="branch"||t.type==="branchOnSubst"||t.type==="branchOnNoSubst")&&t.label&&!e.has(t.label))return t.label;if(t.type==="group"){let n=oe(t.commands,e);if(n)return n}}}var ke={name:"sed",summary:"stream editor for filtering and transforming text",usage:"sed [OPTION]... {script} [input-file]...",options:["-n, --quiet, --silent suppress automatic printing of pattern space","-e script add the script to commands to be executed","-f script-file read script from file","-i, --in-place edit files in place","-E, -r, --regexp-extended use extended regular expressions"," --help display this help and exit"],description:`Commands: - s/regexp/replacement/[flags] substitute - d delete pattern space - p print pattern space - a\\ text append text after line - i\\ text insert text before line - c\\ text change (replace) line with text - h copy pattern space to hold space - H append pattern space to hold space - g copy hold space to pattern space - G append hold space to pattern space - x exchange pattern and hold spaces - n read next line into pattern space - N append next line to pattern space - y/source/dest/ transliterate characters - = print line number - l list pattern space (escape special chars) - b [label] branch to label - t [label] branch on substitution - T [label] branch if no substitution - :label define label - q quit - Q quit without printing - -Addresses: - N line number - $ last line - /regexp/ lines matching regexp - N,M range from line N to M - first~step every step-th line starting at first`};async function Q(i,e,t,n={}){let{limits:s,filename:a,fs:r,cwd:l,coverage:c,requireDefenseContext:f}=n;U(f,"sed","processing entry");let p=(R,m)=>z(f,"sed",R,m),x=i.endsWith(` -`),g=i.split(` -`);g.length>0&&g[g.length-1]===""&&g.pop();let d=g.length,E="",u,h=!1,b=s?.maxStringLength??0,v=R=>{if(E+=R,b>0&&E.length>b)throw new k(`sed: output size limit exceeded (${b} bytes)`,"string_length")},O="",J,le=new Map,T=new Map,B=new Map,D=new Map,ue=s?{maxIterations:s.maxSedIterations,maxStringLength:b}:void 0;for(let R=0;Rhe)break;if(m.restartCycle=!1,m.pendingFileReads=[],m.pendingFileWrites=[],Z(e,m,F,ue),r&&l){for(let C of m.pendingFileReads){let S=r.resolvePath(l,C.filename);try{if(C.wholeFile){let y=await p("read command file",()=>r.readFile(S));m.appendBuffer.push(y.replace(/\n$/,""))}else{if(!T.has(S)){let de=await p("read command file line cache",()=>r.readFile(S));T.set(S,de.split(` -`)),B.set(S,0)}let y=T.get(S),M=B.get(S);y&&M!==void 0&&M0;for(let C of m.lineNumberOutput)v(`${C} -`);let ee=[],q=[];for(let C of m.appendBuffer)C.startsWith("__INSERT__")?ee.push(C.slice(10)):q.push(C);for(let C of ee)v(`${C} -`);let $=!1;!m.deleted&&!m.quitSilent?t?m.printed&&(v(`${m.patternSpace} -`),$=!0):(v(`${m.patternSpace} -`),$=!0):m.changedText!==void 0&&(v(`${m.changedText} -`),$=!0);for(let C of q)v(`${C} -`);if(h=(fe||$)&&q.length===0,m.quit||m.quitSilent){if(m.exitCode!==void 0&&(u=m.exitCode),m.errorMessage)return{output:"",exitCode:u||1,errorMessage:m.errorMessage};break}}if(r&&l)for(let[R,m]of D)try{await p("flush pending file writes",()=>r.writeFile(R,m))}catch(F){if(F instanceof I)throw F}return!x&&h&&E.endsWith(` -`)&&(E=E.slice(0,-1)),{output:E,exitCode:u}}var Pe={name:"sed",async execute(i,e){U(e.requireDefenseContext,"sed","execution entry");let t=(u,h)=>z(e.requireDefenseContext,"sed",u,h);if(ne(i))return te(ke);let n=[],s=[],a=!1,r=!1,l=!1,c=[];for(let u=0;u1){for(let b of h.slice(1))if(b!=="n"&&b!=="e"&&b!=="f"&&b!=="i"&&b!=="E"&&b!=="r")return W("sed",`-${b}`);h.includes("n")&&(a=!0),h.includes("i")&&(r=!0),(h.includes("E")||h.includes("r"))&&(l=!0),h.includes("e")&&!h.includes("n")&&!h.includes("i")&&u+1e.fs.readFile(h));for(let v of b.split(` -`)){let O=v.trim();O&&!O.startsWith("#")&&n.push(O)}}catch(b){if(b instanceof I)throw b;return{stdout:"",stderr:`sed: couldn't open file ${u}: No such file or directory -`,exitCode:1}}}if(n.length===0)return{stdout:"",stderr:`sed: no script specified -`,exitCode:1};let{commands:f,error:p,silentMode:x}=ae(n,l);if(p)return{stdout:"",stderr:`sed: ${p} -`,exitCode:1};let g=!!(a||x);if(r){if(c.length===0)return{stdout:"",stderr:`sed: -i requires at least one file argument -`,exitCode:1};for(let u of c){if(u==="-")continue;let h=e.fs.resolvePath(e.cwd,u);try{let b=await t("in-place input read",()=>e.fs.readFile(h)),v=await t("in-place processing",()=>Q(b,f,g,{limits:e.limits,filename:u,fs:e.fs,cwd:e.cwd,coverage:e.coverage,requireDefenseContext:e.requireDefenseContext}));if(v.errorMessage)return{stdout:"",stderr:`${v.errorMessage} -`,exitCode:v.exitCode??1};await t("in-place output write",()=>e.fs.writeFile(h,v.output))}catch(b){if(b instanceof I)throw b;return b instanceof k?{stdout:"",stderr:`sed: ${L(b.message)} -`,exitCode:k.EXIT_CODE}:{stdout:"",stderr:`sed: ${u}: No such file or directory -`,exitCode:1}}}return{stdout:"",stderr:"",exitCode:0}}let d="";if(c.length===0){d=P(e.stdin);try{let u=await t("stdin processing",()=>Q(d,f,g,{limits:e.limits,fs:e.fs,cwd:e.cwd,coverage:e.coverage,requireDefenseContext:e.requireDefenseContext}));return{stdout:u.output,stderr:u.errorMessage?`${u.errorMessage} -`:"",exitCode:u.exitCode??0}}catch(u){if(u instanceof I)throw u;if(u instanceof k)return{stdout:"",stderr:`sed: ${L(u.message)} -`,exitCode:k.EXIT_CODE};throw u}}let E=!1;for(let u of c){let h;if(u==="-")E?h="":(h=P(e.stdin),E=!0);else{let b=e.fs.resolvePath(e.cwd,u);try{h=await t("input file read",()=>e.fs.readFile(b))}catch(v){if(v instanceof I)throw v;return v instanceof k?{stdout:"",stderr:`sed: ${L(v.message)} -`,exitCode:k.EXIT_CODE}:{stdout:"",stderr:`sed: ${u}: No such file or directory -`,exitCode:1}}}d.length>0&&h.length>0&&!d.endsWith(` -`)&&(d+=` -`),d+=h}try{let u=await t("final processing",()=>Q(d,f,g,{limits:e.limits,filename:c.length===1?c[0]:void 0,fs:e.fs,cwd:e.cwd,coverage:e.coverage,requireDefenseContext:e.requireDefenseContext}));return{stdout:u.output,stderr:u.errorMessage?`${u.errorMessage} -`:"",exitCode:u.exitCode??0}}catch(u){if(u instanceof I)throw u;if(u instanceof k)return{stdout:"",stderr:`sed: ${L(u.message)} -`,exitCode:k.EXIT_CODE};throw u}}},We={name:"sed",flags:[{flag:"-n",type:"boolean"},{flag:"-i",type:"boolean"},{flag:"-E",type:"boolean"},{flag:"-r",type:"boolean"},{flag:"-e",type:"value",valueHint:"string"}],stdinType:"text",needsArgs:!0};export{Pe as a,We as b}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-J3LJZWL2.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-J3LJZWL2.js deleted file mode 100644 index d1d73df..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-J3LJZWL2.js +++ /dev/null @@ -1,6 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a as g,b as A,c as T,d as at,e as E,g as O,h as G}from"./chunk-4WKZNNJK.js";import{a as X,c as lt}from"./chunk-DLL7UR66.js";import{a as yt}from"./chunk-KAPG5ONA.js";import{a as R}from"./chunk-7CSMHFIJ.js";import{k as B}from"./chunk-SAI2SPQQ.js";function W(t,r,e,n,c,o,u,p,s,f){switch(r){case"sort":return Array.isArray(t)?[[...t].sort(u)]:[null];case"sort_by":return!Array.isArray(t)||e.length===0?[null]:[[...t].sort((h,a)=>{let y=c(h,e[0],n)[0],l=c(a,e[0],n)[0];return u(y,l)})];case"bsearch":{if(!Array.isArray(t)){let h=t===null?"null":typeof t=="object"?"object":typeof t;throw new Error(`${h} (${JSON.stringify(t)}) cannot be searched from`)}return e.length===0?[null]:c(t,e[0],n).map(h=>{let a=0,y=t.length;for(;a>>1;u(t[l],h)<0?a=l+1:y=l}return au(a.key,y.key)),[h.map(a=>a.item)]}case"group_by":{if(!Array.isArray(t)||e.length===0)return[null];let i=new Map;for(let h of t){let a=JSON.stringify(c(h,e[0],n)[0]);i.has(a)||i.set(a,[]),i.get(a)?.push(h)}return[[...i.values()]]}case"max":return Array.isArray(t)&&t.length>0?[t.reduce((i,h)=>u(i,h)>0?i:h)]:[null];case"max_by":return!Array.isArray(t)||t.length===0||e.length===0?[null]:[t.reduce((i,h)=>{let a=c(i,e[0],n)[0],y=c(h,e[0],n)[0];return u(a,y)>0?i:h})];case"min":return Array.isArray(t)&&t.length>0?[t.reduce((i,h)=>u(i,h)<0?i:h)]:[null];case"min_by":return!Array.isArray(t)||t.length===0||e.length===0?[null]:[t.reduce((i,h)=>{let a=c(i,e[0],n)[0],y=c(h,e[0],n)[0];return u(a,y)<0?i:h})];case"add":{let i=h=>{let a=h.filter(y=>y!==null);return a.length===0?null:a.every(y=>typeof y=="number")?a.reduce((y,l)=>y+l,0):a.every(y=>typeof y=="string")?a.join(""):a.every(y=>Array.isArray(y))?a.flat():a.every(y=>y&&typeof y=="object"&&!Array.isArray(y))?lt(...a):null};if(e.length>=1){let h=c(t,e[0],n);return[i(h)]}return Array.isArray(t)?[i(t)]:[null]}case"any":{if(e.length>=2){try{let i=o(t,e[0],n);for(let h of i)if(c(h,e[1],n).some(p))return[!0]}catch(i){if(i instanceof f)throw i}return[!1]}return e.length===1?Array.isArray(t)?[t.some(i=>p(c(i,e[0],n)[0]))]:[!1]:Array.isArray(t)?[t.some(p)]:[!1]}case"all":{if(e.length>=2){try{let i=o(t,e[0],n);for(let h of i)if(!c(h,e[1],n).some(p))return[!1]}catch(i){if(i instanceof f)throw i}return[!0]}return e.length===1?Array.isArray(t)?[t.every(i=>p(c(i,e[0],n)[0]))]:[!0]:Array.isArray(t)?[t.every(p)]:[!0]}case"select":return e.length===0?[t]:c(t,e[0],n).some(p)?[t]:[];case"map":return e.length===0||!Array.isArray(t)?[null]:[t.flatMap(h=>c(h,e[0],n))];case"map_values":{if(e.length===0)return[null];if(Array.isArray(t))return[t.flatMap(i=>c(i,e[0],n))];if(t&&typeof t=="object"){let i=Object.create(null);for(let[h,a]of Object.entries(t)){if(!g(h))continue;let y=c(a,e[0],n);y.length>0&&A(i,h,y[0])}return[i]}return[null]}case"has":{if(e.length===0)return[!1];let h=c(t,e[0],n)[0];return Array.isArray(t)&&typeof h=="number"?[h>=0&&h=0&&t0)try{let s=o(t,e[0],n);return s.length>0?[s[0]]:[]}catch(s){if(s instanceof p)throw s;return[]}return Array.isArray(t)&&t.length>0?[t[0]]:[null];case"last":if(e.length>0){let s=c(t,e[0],n);return s.length>0?[s[s.length-1]]:[]}return Array.isArray(t)&&t.length>0?[t[t.length-1]]:[null];case"nth":{if(e.length<1)return[null];let s=c(t,e[0],n);if(e.length>1){for(let i of s)if(i<0)throw new Error("nth doesn't support negative indices");let f;try{f=o(t,e[1],n)}catch(i){if(i instanceof p)throw i;f=[]}return s.flatMap(i=>{let h=i;return h{let i=f;if(i<0)throw new Error("nth doesn't support negative indices");return il.length>=s,i=c(t,e[0],n);if(e.length===1){let l=[];for(let m of i){let b=m;for(let w=0;w0){for(let C=w;Ck;C+=N)if(y.push(C),f(y))return y}}return y}case"limit":return e.length<2?[]:c(t,e[0],n).flatMap(f=>{let i=f;if(i<0)throw new Error("limit doesn't support negative count");if(i===0)return[];let h;try{h=o(t,e[1],n)}catch(a){if(a instanceof p)throw a;h=[]}return h.slice(0,i)});case"isempty":{if(e.length<1)return[!0];try{return[o(t,e[0],n).length===0]}catch(s){if(s instanceof p)throw s;return[!0]}}case"isvalid":{if(e.length<1)return[!0];try{return[c(t,e[0],n).length>0]}catch(s){if(s instanceof p)throw s;return[!1]}}case"skip":return e.length<2?[]:c(t,e[0],n).flatMap(f=>{let i=f;if(i<0)throw new Error("skip doesn't support negative count");return c(t,e[1],n).slice(i)});case"until":{if(e.length<2)return[t];let s=t,f=n.limits.maxIterations;for(let i=0;i=i)throw new p(`jq while: too many iterations (${i}), increase executionLimits.maxJqIterations`,"iterations");return s}case"repeat":{if(e.length===0)return[t];let s=[],f=t,i=n.limits.maxIterations;for(let h=0;h=i)throw new p(`jq repeat: too many iterations (${i}), increase executionLimits.maxJqIterations`,"iterations");return s}default:return null}}function Z(t,r,e,n,c){switch(r){case"now":return[Date.now()/1e3];case"gmtime":{if(typeof t!="number")return[null];let o=new Date(t*1e3),u=o.getUTCFullYear(),p=o.getUTCMonth(),s=o.getUTCDate(),f=o.getUTCHours(),i=o.getUTCMinutes(),h=o.getUTCSeconds(),a=o.getUTCDay(),y=Date.UTC(u,0,1),l=Math.floor((o.getTime()-y)/(1440*60*1e3));return[[u,p,s,f,i,h,a,l]]}case"mktime":{if(!Array.isArray(t))throw new Error("mktime requires parsed datetime inputs");let[o,u,p,s=0,f=0,i=0]=t;if(typeof o!="number"||typeof u!="number")throw new Error("mktime requires parsed datetime inputs");let h=Date.UTC(o,u,p??1,s??0,f??0,i??0);return[Math.floor(h/1e3)]}case"strftime":{if(e.length===0)return[null];let u=c(t,e[0],n)[0];if(typeof u!="string")throw new Error("strftime/1 requires a string format");let p;if(typeof t=="number")p=new Date(t*1e3);else if(Array.isArray(t)){let[a,y,l,m=0,b=0,w=0]=t;if(typeof a!="number"||typeof y!="number")throw new Error("strftime/1 requires parsed datetime inputs");p=new Date(Date.UTC(a,y,l??1,m??0,b??0,w??0))}else throw new Error("strftime/1 requires parsed datetime inputs");let s=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],f=["January","February","March","April","May","June","July","August","September","October","November","December"],i=(a,y=2)=>String(a).padStart(y,"0");return[u.replace(/%Y/g,String(p.getUTCFullYear())).replace(/%m/g,i(p.getUTCMonth()+1)).replace(/%d/g,i(p.getUTCDate())).replace(/%H/g,i(p.getUTCHours())).replace(/%M/g,i(p.getUTCMinutes())).replace(/%S/g,i(p.getUTCSeconds())).replace(/%A/g,s[p.getUTCDay()]).replace(/%B/g,f[p.getUTCMonth()]).replace(/%Z/g,"UTC").replace(/%%/g,"%")]}case"strptime":{if(e.length===0)return[null];if(typeof t!="string")throw new Error("strptime/1 requires a string input");let u=c(t,e[0],n)[0];if(typeof u!="string")throw new Error("strptime/1 requires a string format");if(u==="%Y-%m-%dT%H:%M:%SZ"){let s=t.match(/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})Z$/);if(s){let[,f,i,h,a,y,l]=s.map(Number),m=new Date(Date.UTC(f,i-1,h,a,y,l)),b=m.getUTCDay(),w=Date.UTC(f,0,1),k=Math.floor((m.getTime()-w)/(1440*60*1e3));return[[f,i-1,h,a,y,l,b,k]]}}let p=new Date(t);if(!Number.isNaN(p.getTime())){let s=p.getUTCFullYear(),f=p.getUTCMonth(),i=p.getUTCDate(),h=p.getUTCHours(),a=p.getUTCMinutes(),y=p.getUTCSeconds(),l=p.getUTCDay(),m=Date.UTC(s,0,1),b=Math.floor((p.getTime()-m)/(1440*60*1e3));return[[s,f,i,h,a,y,l,b]]}throw new Error(`Cannot parse date: ${t}`)}case"fromdate":{if(typeof t!="string")throw new Error("fromdate requires a string input");let o=new Date(t);if(Number.isNaN(o.getTime()))throw new Error(`date "${t}" does not match format "%Y-%m-%dT%H:%M:%SZ"`);return[Math.floor(o.getTime()/1e3)]}case"todate":{if(typeof t!="number")throw new Error("todate requires a number input");return[new Date(t*1e3).toISOString().replace(/\.\d{3}Z$/,"Z")]}default:return null}}function S(t){return t!==!1&&t!==null}function I(t,r){return JSON.stringify(t)===JSON.stringify(r)}function U(t,r){return typeof t=="number"&&typeof r=="number"?t-r:typeof t=="string"&&typeof r=="string"?t.localeCompare(r):0}function v(t,r){let e=O(t);for(let n of Object.keys(r)){if(!g(n))continue;let c=T(e,n)?E(e[n]):null,o=E(r[n]);c&&o?A(e,n,v(c,o)):A(e,n,r[n])}return e}function D(t,r=3e3){let e=0,n=t;for(;ep===null?0:typeof p=="boolean"?1:typeof p=="number"?2:typeof p=="string"?3:Array.isArray(p)?4:typeof p=="object"?5:6,n=e(t),c=e(r);if(n!==c)return n-c;if(typeof t=="number"&&typeof r=="number")return t-r;if(typeof t=="string"&&typeof r=="string")return t.localeCompare(r);if(typeof t=="boolean"&&typeof r=="boolean")return(t?1:0)-(r?1:0);if(Array.isArray(t)&&Array.isArray(r)){for(let p=0;pt.some(o=>F(o,c)));let e=E(t),n=E(r);return e&&n?Object.keys(n).every(c=>T(e,c)&&F(e[c],n[c])):!1}var Ot=2e3;function tt(t,r,e){switch(r){case"@base64":return typeof t=="string"?typeof Buffer<"u"?[Buffer.from(t,"utf-8").toString("base64")]:[btoa(t)]:[null];case"@base64d":return typeof t=="string"?typeof Buffer<"u"?[Buffer.from(t,"base64").toString("utf-8")]:[atob(t)]:[null];case"@uri":return typeof t=="string"?[encodeURIComponent(t).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A")]:[null];case"@urid":return typeof t=="string"?[decodeURIComponent(t)]:[null];case"@csv":return Array.isArray(t)?[t.map(c=>{if(c===null)return"";if(typeof c=="boolean")return c?"true":"false";if(typeof c=="number")return String(c);let o=String(c);return o.includes(",")||o.includes('"')||o.includes(` -`)||o.includes("\r")?`"${o.replace(/"/g,'""')}"`:o}).join(",")]:[null];case"@tsv":return Array.isArray(t)?[t.map(n=>String(n??"").replace(/\t/g,"\\t").replace(/\n/g,"\\n")).join(" ")]:[null];case"@json":{let n=e??Ot;return D(t,n+1)>n?[null]:[JSON.stringify(t)]}case"@html":return typeof t=="string"?[t.replace(/&/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""")]:[null];case"@sh":return typeof t=="string"?[`'${t.replace(/'/g,"'\\''")}'`]:[null];case"@text":return typeof t=="string"?[t]:t==null?[""]:[String(t)];default:return null}}function et(t,r,e,n,c,o){switch(r){case"index":return e.length===0?[null]:c(t,e[0],n).map(p=>{if(typeof t=="string"&&typeof p=="string"){if(p===""&&t==="")return null;let s=t.indexOf(p);return s>=0?s:null}if(Array.isArray(t)){if(Array.isArray(p)){for(let f=0;f<=t.length-p.length;f++){let i=!0;for(let h=0;ho(f,p));return s>=0?s:null}return null});case"rindex":return e.length===0?[null]:c(t,e[0],n).map(p=>{if(typeof t=="string"&&typeof p=="string"){let s=t.lastIndexOf(p);return s>=0?s:null}if(Array.isArray(t)){if(Array.isArray(p)){for(let s=t.length-p.length;s>=0;s--){let f=!0;for(let i=0;i=0;s--)if(o(t[s],p))return s;return null}return null});case"indices":return e.length===0?[[]]:c(t,e[0],n).map(p=>{let s=[];if(typeof t=="string"&&typeof p=="string"){let f=t.indexOf(p);for(;f!==-1;)s.push(f),f=t.indexOf(p,f+1)}else if(Array.isArray(t))if(Array.isArray(p)){let f=p.length;if(f===0)for(let i=0;i<=t.length;i++)s.push(i);else for(let i=0;i<=t.length-f;i++){let h=!0;for(let a=0;a{if(y.push(m),Array.isArray(m))for(let b of m)l(b);else if(m&&typeof m=="object")for(let b of Object.keys(m))l(m[b])};return l(t),y}let s=[],f=e.length>=2?e[1]:null,i=1e4,h=0,a=y=>{if(h++>i||f&&!c(y,f,n).some(o))return;s.push(y);let l=c(y,e[0],n);for(let m of l)m!=null&&a(m)};return a(t),s}case"recurse_down":return p(t,"recurse",e,n);case"walk":{if(e.length===0)return[t];let s=new WeakSet,f=i=>{if(i&&typeof i=="object"){if(s.has(i))return i;s.add(i)}let h;if(Array.isArray(i))h=i.map(f);else if(i&&typeof i=="object"){let y=Object.create(null);for(let[l,m]of Object.entries(i))g(l)&&A(y,l,f(m));h=y}else h=i;return c(h,e[0],n)[0]};return[f(t)]}case"transpose":{if(!Array.isArray(t))return[null];if(t.length===0)return[[]];let s=Math.max(...t.map(i=>Array.isArray(i)?i.length:0)),f=[];for(let i=0;iArray.isArray(h)?h[i]:null));return[f]}case"combinations":{if(e.length>0){let h=c(t,e[0],n)[0];if(!Array.isArray(t)||h<0)return[];if(h===0)return[[]];let a=[],y=(l,m)=>{if(m===h){a.push([...l]);return}for(let b of t)l.push(b),y(l,m+1),l.pop()};return y([],0),a}if(!Array.isArray(t))return[];if(t.length===0)return[[]];for(let i of t)if(!Array.isArray(i))return[];let s=[],f=(i,h)=>{if(i===t.length){s.push([...h]);return}let a=t[i];for(let y of a)h.push(y),f(i+1,h),h.pop()};return f(0,[]),s}case"parent":{if(n.root===void 0||n.currentPath===void 0)return[];let s=n.currentPath;if(s.length===0)return[];let f=e.length>0?c(t,e[0],n)[0]:1;if(f>=0){if(f>s.length)return[];let i=s.slice(0,s.length-f);return[u(n.root,i)]}else{let i=-f-1;if(i>=s.length)return[t];let h=s.slice(0,i);return[u(n.root,h)]}}case"parents":{if(n.root===void 0||n.currentPath===void 0)return[[]];let s=n.currentPath,f=[];for(let i=s.length-1;i>=0;i--)f.push(u(n.root,s.slice(0,i)));return[f]}case"root":return n.root!==void 0?[n.root]:[];default:return null}}var Nt=2e3;function st(t,r,e,n,c){switch(r){case"keys":return Array.isArray(t)?[t.map((o,u)=>u)]:t&&typeof t=="object"?[Object.keys(t).sort()]:[null];case"keys_unsorted":return Array.isArray(t)?[t.map((o,u)=>u)]:t&&typeof t=="object"?[Object.keys(t)]:[null];case"length":return typeof t=="string"?[t.length]:Array.isArray(t)?[t.length]:t&&typeof t=="object"?[Object.keys(t).length]:t===null?[0]:typeof t=="number"?[Math.abs(t)]:[null];case"utf8bytelength":{if(typeof t=="string")return[new TextEncoder().encode(t).length];let o=t===null?"null":Array.isArray(t)?"array":typeof t,u=o==="array"||o==="object"?JSON.stringify(t):String(t);throw new Error(`${o} (${u}) only strings have UTF-8 byte length`)}case"to_entries":{let o=E(t);return o?[Object.entries(o).map(([u,p])=>({key:u,value:p}))]:[null]}case"from_entries":if(Array.isArray(t)){let o=Object.create(null);for(let u of t){let p=E(u);if(p){let s=p.key??p.Key??p.name??p.Name??p.k,f=p.value??p.Value??p.v;if(s!==void 0){let i=String(s);g(i)&&A(o,i,f)}}}return[o]}return[null];case"with_entries":{if(e.length===0)return[t];let o=E(t);if(o){let p=Object.entries(o).map(([f,i])=>({key:f,value:i})).flatMap(f=>c(f,e[0],n)),s=Object.create(null);for(let f of p){let i=E(f);if(i){let h=i.key??i.name??i.k,a=i.value??i.v;if(h!==void 0){let y=String(h);g(y)&&A(s,y,a)}}}return[s]}return[null]}case"reverse":return Array.isArray(t)?[[...t].reverse()]:typeof t=="string"?[t.split("").reverse().join("")]:[null];case"flatten":return Array.isArray(t)?(e.length>0?c(t,e[0],n):[Number.POSITIVE_INFINITY]).map(u=>{let p=u;if(p<0)throw new Error("flatten depth must not be negative");return t.flat(p)}):[null];case"unique":if(Array.isArray(t)){let o=new Set,u=[];for(let p of t){let s=JSON.stringify(p);o.has(s)||(o.add(s),u.push(p))}return[u]}return[null];case"tojson":case"tojsonstream":{let o=n.limits.maxDepth??Nt;return D(t,o+1)>o?[null]:[JSON.stringify(t)]}case"fromjson":{if(typeof t=="string"){let o=t.trim().toLowerCase();if(o==="nan")return[Number.NaN];if(o==="inf"||o==="infinity")return[Number.POSITIVE_INFINITY];if(o==="-inf"||o==="-infinity")return[Number.NEGATIVE_INFINITY];try{return[at(JSON.parse(t))]}catch{throw new Error(`Invalid JSON: ${t}`)}}return[t]}case"tostring":return typeof t=="string"?[t]:[JSON.stringify(t)];case"tonumber":if(typeof t=="number")return[t];if(typeof t=="string"){let o=Number(t);if(Number.isNaN(o))throw new Error(`${JSON.stringify(t)} cannot be parsed as a number`);return[o]}throw new Error(`${typeof t} cannot be parsed as a number`);case"toboolean":{if(typeof t=="boolean")return[t];if(typeof t=="string"){if(t==="true")return[!0];if(t==="false")return[!1];throw new Error(`string (${JSON.stringify(t)}) cannot be parsed as a boolean`)}let o=t===null?"null":Array.isArray(t)?"array":typeof t,u=o==="array"||o==="object"?JSON.stringify(t):String(t);throw new Error(`${o} (${u}) cannot be parsed as a boolean`)}case"tostream":{let o=[],u=(p,s)=>{if(p===null||typeof p!="object")o.push([s,p]);else if(Array.isArray(p))if(p.length===0)o.push([s,[]]);else for(let f=0;fo&&u.push([f.slice(o)]);continue}if(s.length===2&&Array.isArray(s[0])){let f=s[0],i=s[1];f.length>o&&u.push([f.slice(o),i])}}return u}default:return null}}function it(t,r,e,n,c,o,u,p,s,f){switch(r){case"getpath":{if(e.length===0)return[null];let i=c(t,e[0],n),h=[];for(let a of i){let y=a,l=t;for(let m of y){if(l==null){l=null;break}if(Array.isArray(l)&&typeof m=="number")l=l[m];else if(typeof m=="string"){let b=E(l);if(!b||!Object.hasOwn(b,m)){l=null;break}l=b[m]}else{l=null;break}}h.push(l)}return h}case"setpath":{if(e.length<2)return[null];let h=c(t,e[0],n)[0],y=c(t,e[1],n)[0];return[u(t,h,y)]}case"delpaths":{if(e.length===0)return[t];let h=c(t,e[0],n)[0],a=t;for(let y of h.sort((l,m)=>m.length-l.length))a=p(a,y);return[a]}case"path":{if(e.length===0)return[[]];let i=[];return f(t,e[0],n,[],i),i}case"del":return e.length===0?[t]:[s(t,e[0],n)];case"pick":{if(e.length===0)return[null];let i=[];for(let a of e)f(t,a,n,[],i);let h=null;for(let a of i){for(let l of a)if(typeof l=="number"&&l<0)throw new Error("Out of bounds negative array index");let y=t;for(let l of a){if(y==null)break;if(Array.isArray(y)&&typeof l=="number")y=y[l];else if(typeof l=="string"){let m=E(y);if(!m||!Object.hasOwn(m,l)){y=null;break}y=m[l]}else{y=null;break}}h=u(h,a,y)}return[h]}case"paths":{let i=[],h=(a,y)=>{if(a&&typeof a=="object")if(Array.isArray(a))for(let l=0;l0?i.filter(a=>{let y=t;for(let m of a)if(Array.isArray(y)&&typeof m=="number")y=y[m];else if(typeof m=="string"){let b=E(y);if(!b||!Object.hasOwn(b,m))return!1;y=b[m]}else return!1;return c(y,e[0],n).some(o)}):i}case"leaf_paths":{let i=[],h=(a,y)=>{if(a===null||typeof a!="object")i.push(y);else if(Array.isArray(a))for(let l=0;lJSON.stringify(f)));for(let f of u)if(s.has(JSON.stringify(f)))return[!0];return[!1]}case"INDEX":{if(e.length===0)return[Object.create(null)];if(e.length===1){let s=c(t,e[0],n),f=Object.create(null);for(let i of s){let h=String(i);g(h)&&A(f,h,i)}return[f]}if(e.length===2){let s=c(t,e[0],n),f=Object.create(null);for(let i of s){let h=c(i,e[1],n);if(h.length>0){let a=String(h[0]);g(a)&&A(f,a,i)}}return[f]}let u=c(t,e[0],n),p=Object.create(null);for(let s of u){let f=c(s,e[1],n),i=c(s,e[2],n);if(f.length>0&&i.length>0){let h=String(f[0]);g(h)&&A(p,h,i[0])}}return[p]}case"JOIN":{if(e.length<2)return[null];let u=E(c(t,e[0],n)[0]);if(!u)return[null];if(!Array.isArray(t))return[null];let p=[];for(let s of t){let f=c(s,e[1],n),i=f.length>0?String(f[0]):"",h=T(u,i)?u[i]:null;p.push([s,h])}return[p]}default:return null}}function ft(t,r,e,n,c){switch(r){case"join":{if(!Array.isArray(t))return[null];let o=e.length>0?c(t,e[0],n):[""];for(let u of t)if(Array.isArray(u)||u!==null&&typeof u=="object")throw new Error("cannot join: contains arrays or objects");return o.map(u=>t.map(p=>p===null?"":typeof p=="string"?p:String(p)).join(String(u)))}case"split":{if(typeof t!="string"||e.length===0)return[null];let o=c(t,e[0],n),u=String(o[0]);return[t.split(u)]}case"splits":{if(typeof t!="string"||e.length===0)return[];let o=c(t,e[0],n),u=String(o[0]);try{let p=e.length>1?String(c(t,e[1],n)[0]):"g";return R(u,p.includes("g")?p:`${p}g`).split(t)}catch{return[]}}case"scan":{if(typeof t!="string"||e.length===0)return[];let o=c(t,e[0],n),u=String(o[0]);try{let p=e.length>1?String(c(t,e[1],n)[0]):"";return[...R(u,p.includes("g")?p:`${p}g`).matchAll(t)].map(i=>i.length>1?i.slice(1):i[0])}catch{return[]}}case"test":{if(typeof t!="string"||e.length===0)return[!1];let o=c(t,e[0],n),u=String(o[0]);try{let p=e.length>1?String(c(t,e[1],n)[0]):"";return[R(u,p).test(t)]}catch{return[!1]}}case"match":{if(typeof t!="string"||e.length===0)return[null];let o=c(t,e[0],n),u=String(o[0]);try{let p=e.length>1?String(c(t,e[1],n)[0]):"",f=R(u,`${p}d`).exec(t);if(!f)return[];let i=f.indices;return[{offset:f.index,length:f[0].length,string:f[0],captures:f.slice(1).map((h,a)=>({offset:i?.[a+1]?.[0]??null,length:h?.length??0,string:h??"",name:null}))}]}catch{return[null]}}case"capture":{if(typeof t!="string"||e.length===0)return[null];let o=c(t,e[0],n),u=String(o[0]);try{let p=e.length>1?String(c(t,e[1],n)[0]):"",f=R(u,p).match(t);return!f||!f.groups?[Object.create(null)]:[f.groups]}catch{return[null]}}case"sub":{if(typeof t!="string"||e.length<2)return[null];let o=c(t,e[0],n),u=c(t,e[1],n),p=String(o[0]),s=String(u[0]);try{let f=e.length>2?String(c(t,e[2],n)[0]):"";return[R(p,f).replace(t,s)]}catch{return[t]}}case"gsub":{if(typeof t!="string"||e.length<2)return[null];let o=c(t,e[0],n),u=c(t,e[1],n),p=String(o[0]),s=String(u[0]);try{let f=e.length>2?String(c(t,e[2],n)[0]):"g",i=f.includes("g")?f:`${f}g`;return[R(p,i).replace(t,s)]}catch{return[t]}}case"ascii_downcase":return typeof t=="string"?[t.replace(/[A-Z]/g,o=>String.fromCharCode(o.charCodeAt(0)+32))]:[null];case"ascii_upcase":return typeof t=="string"?[t.replace(/[a-z]/g,o=>String.fromCharCode(o.charCodeAt(0)-32))]:[null];case"ltrimstr":{if(typeof t!="string"||e.length===0)return[t];let o=c(t,e[0],n),u=String(o[0]);return[t.startsWith(u)?t.slice(u.length):t]}case"rtrimstr":{if(typeof t!="string"||e.length===0)return[t];let o=c(t,e[0],n),u=String(o[0]);return u===""?[t]:[t.endsWith(u)?t.slice(0,-u.length):t]}case"trimstr":{if(typeof t!="string"||e.length===0)return[t];let o=c(t,e[0],n),u=String(o[0]);if(u==="")return[t];let p=t;return p.startsWith(u)&&(p=p.slice(u.length)),p.endsWith(u)&&(p=p.slice(0,-u.length)),[p]}case"trim":if(typeof t=="string")return[t.trim()];throw new Error("trim input must be a string");case"ltrim":if(typeof t=="string")return[t.trimStart()];throw new Error("trim input must be a string");case"rtrim":if(typeof t=="string")return[t.trimEnd()];throw new Error("trim input must be a string");case"startswith":{if(typeof t!="string"||e.length===0)return[!1];let o=c(t,e[0],n);return[t.startsWith(String(o[0]))]}case"endswith":{if(typeof t!="string"||e.length===0)return[!1];let o=c(t,e[0],n);return[t.endsWith(String(o[0]))]}case"ascii":return typeof t=="string"&&t.length>0?[t.charCodeAt(0)]:[null];case"explode":return typeof t=="string"?[Array.from(t).map(o=>o.codePointAt(0))]:[null];case"implode":if(!Array.isArray(t))throw new Error("implode input must be an array");return[t.map(p=>{if(typeof p=="string")throw new Error(`string (${JSON.stringify(p)}) can't be imploded, unicode codepoint needs to be numeric`);if(typeof p!="number"||Number.isNaN(p))throw new Error("number (null) can't be imploded, unicode codepoint needs to be numeric");let s=Math.trunc(p);return s<0||s>1114111||s>=55296&&s<=57343?String.fromCodePoint(65533):String.fromCodePoint(s)}).join("")];default:return null}}function ct(t,r){switch(r){case"type":return t===null?["null"]:Array.isArray(t)?["array"]:typeof t=="boolean"?["boolean"]:typeof t=="number"?["number"]:typeof t=="string"?["string"]:typeof t=="object"?["object"]:["null"];case"infinite":return[Number.POSITIVE_INFINITY];case"nan":return[Number.NaN];case"isinfinite":return[typeof t=="number"&&!Number.isFinite(t)];case"isnan":return[typeof t=="number"&&Number.isNaN(t)];case"isnormal":return[typeof t=="number"&&Number.isFinite(t)&&t!==0];case"isfinite":return[typeof t=="number"&&Number.isFinite(t)];case"numbers":return typeof t=="number"?[t]:[];case"strings":return typeof t=="string"?[t]:[];case"booleans":return typeof t=="boolean"?[t]:[];case"nulls":return t===null?[t]:[];case"arrays":return Array.isArray(t)?[t]:[];case"objects":return t&&typeof t=="object"&&!Array.isArray(t)?[t]:[];case"iterables":return Array.isArray(t)||t&&typeof t=="object"&&!Array.isArray(t)?[t]:[];case"scalars":return!Array.isArray(t)&&!(t&&typeof t=="object")?[t]:[];case"values":return t===null?[]:[t];case"not":return t===!1||t===null?[!0]:[!1];case"null":return[null];case"true":return[!0];case"false":return[!1];case"empty":return[];default:return null}}function K(t,r,e){if(r.length===0)return e;let[n,...c]=r;if(typeof n=="number"){if(t&&typeof t=="object"&&!Array.isArray(t))throw new Error("Cannot index object with number");if(n>536870911)throw new Error("Array index too large");if(n<0)throw new Error("Out of bounds negative array index");let f=Array.isArray(t)?[...t]:[];for(;f.length<=n;)f.push(null);return f[n]=K(f[n],c,e),f}if(Array.isArray(t))throw new Error("Cannot index array with string");if(!g(n))return t??Object.create(null);let o=E(t),u=o?O(o):Object.create(null),p=Object.hasOwn(u,n)?u[n]:void 0;return A(u,n,K(p,c,e)),u}function V(t,r){if(r.length===0)return null;if(r.length===1){let c=r[0];if(Array.isArray(t)&&typeof c=="number"){let o=[...t];return o.splice(c,1),o}if(t&&typeof t=="object"&&!Array.isArray(t)){let o=String(c);if(!g(o))return t;let u=O(t);return delete u[o],u}return t}let[e,...n]=r;if(Array.isArray(t)&&typeof e=="number"){let c=[...t];return c[e]=V(c[e],n),c}if(t&&typeof t=="object"&&!Array.isArray(t)){let c=String(e);if(!g(c))return t;let o=O(t);return Object.hasOwn(o,c)&&A(o,c,V(o[c],n)),o}return t}var P=class t extends Error{label;partialResults;constructor(r,e=[]){super(`break ${r}`),this.label=r,this.partialResults=e,this.name="BreakError"}withPrependedResults(r){return new t(this.label,[...r,...this.partialResults])}},H=class extends Error{value;constructor(r){super(typeof r=="string"?r:JSON.stringify(r)),this.value=r,this.name="JqError"}},St=1e4,bt=2e3,Ct=new Map([["floor",Math.floor],["ceil",Math.ceil],["round",Math.round],["sqrt",Math.sqrt],["log",Math.log],["log10",Math.log10],["log2",Math.log2],["exp",Math.exp],["sin",Math.sin],["cos",Math.cos],["tan",Math.tan],["asin",Math.asin],["acos",Math.acos],["atan",Math.atan],["sinh",Math.sinh],["cosh",Math.cosh],["tanh",Math.tanh],["asinh",Math.asinh],["acosh",Math.acosh],["atanh",Math.atanh],["cbrt",Math.cbrt],["expm1",Math.expm1],["log1p",Math.log1p],["trunc",Math.trunc]]);function Tt(t){return{vars:new Map,limits:{maxIterations:t?.limits?.maxIterations??St,maxDepth:t?.limits?.maxDepth??bt},env:t?.env,coverage:t?.coverage,requireDefenseContext:t?.requireDefenseContext,defenseContextChecked:!1}}function q(t,r,e){let n=new Map(t.vars);return n.set(r,e),{vars:n,limits:t.limits,env:t.env,requireDefenseContext:t.requireDefenseContext,defenseContextChecked:t.defenseContextChecked,root:t.root,currentPath:t.currentPath,funcs:t.funcs,labels:t.labels,coverage:t.coverage}}function L(t,r,e){switch(r.type){case"var":return q(t,r.name,e);case"array":{if(!Array.isArray(e))return null;let n=t;for(let c=0;c0&&r.args[0].type==="Literal"){let n=r.args[0].value;typeof n=="number"&&(e=n)}if(e>=0)return t.slice(0,Math.max(0,t.length-e));{let n=-e-1;return t.slice(0,Math.min(n,t.length))}}if(r.name==="root")return[]}if(r.type==="Field"){let e=M(r);if(e!==null)return[...t,...e]}if(r.type==="Index"&&r.index.type==="Literal"){let e=M(r);if(e!==null)return[...t,...e]}if(r.type==="Pipe"){let e=pt(t,r.left);return e===null?null:pt(e,r.right)}return r.type==="Identity"?t:null}function mt(t,r,e){if(r.type==="Comma"){let n=[];try{n.push(...d(t,r.left,e))}catch(c){if(c instanceof B)throw c;if(n.length>0)return n;throw new Error("evaluation failed")}try{n.push(...d(t,r.right,e))}catch(c){if(c instanceof B)throw c;return n}return n}return d(t,r,e)}function d(t,r,e){let n=e&&"vars"in e?e:Tt(e);switch(n.defenseContextChecked||(yt(n.requireDefenseContext,"query-engine","evaluation"),n={...n,defenseContextChecked:!0}),n.root===void 0&&(n={...n,root:t,currentPath:[]}),n.coverage?.hit(`jq:node:${r.type}`),r.type){case"Identity":return[t];case"Field":return(r.base?d(t,r.base,n):[t]).flatMap(o=>{let u=E(o);if(u){if(!Object.hasOwn(u,r.name))return[null];let s=u[r.name];return[s===void 0?null:s]}if(o===null)return[null];let p=Array.isArray(o)?"array":typeof o;throw new Error(`Cannot index ${p} with string "${r.name}"`)});case"Index":return(r.base?d(t,r.base,n):[t]).flatMap(o=>d(o,r.index,n).flatMap(p=>{if(typeof p=="number"&&Array.isArray(o)){if(Number.isNaN(p))return[null];let s=Math.trunc(p),f=s<0?o.length+s:s;return f>=0&&f{if(o===null)return[null];if(!Array.isArray(o)&&typeof o!="string")throw new Error(`Cannot slice ${typeof o} (${JSON.stringify(o)})`);let u=o.length,p=r.start?d(t,r.start,n):[0],s=r.end?d(t,r.end,n):[u];return p.flatMap(f=>s.map(i=>{let h=f,a=i,y=Number.isNaN(h)?0:Number.isInteger(h)?h:Math.floor(h),l=Number.isNaN(a)?u:Number.isInteger(a)?a:Math.ceil(a),m=dt(y,u),b=dt(l,u);return Array.isArray(o),o.slice(m,b)}))});case"Iterate":return(r.base?d(t,r.base,n):[t]).flatMap(o=>Array.isArray(o)?o:o&&typeof o=="object"?Object.values(o):[]);case"Pipe":{let c=d(t,r.left,n),o=M(r.left),u=[];for(let p of c)try{if(o!==null){let s={...n,currentPath:[...n.currentPath??[],...o]};u.push(...d(p,r.right,s))}else u.push(...d(p,r.right,n))}catch(s){throw s instanceof P?s.withPrependedResults(u):s}return u}case"Comma":{let c=d(t,r.left,n),o=d(t,r.right,n);return[...c,...o]}case"Literal":return[r.value];case"Array":return r.elements?[d(t,r.elements,n)]:[[]];case"Object":{let c=[Object.create(null)];for(let o of r.entries){let u=typeof o.key=="string"?[o.key]:d(t,o.key,n),p=d(t,o.value,n),s=[];for(let f of c)for(let i of u){if(typeof i!="string"){let h=i===null?"null":Array.isArray(i)?"array":typeof i;throw new Error(`Cannot use ${h} (${JSON.stringify(i)}) as object key`)}if(!g(i)){for(let h of p)s.push(O(f));continue}for(let h of p){let a=O(f);A(a,i,h),s.push(a)}}c.length=0,c.push(...s)}return c}case"Paren":return d(t,r.expr,n);case"BinaryOp":return xt(t,r.op,r.left,r.right,n);case"UnaryOp":return d(t,r.operand,n).map(o=>{if(r.op==="-"){if(typeof o=="number")return-o;if(typeof o=="string"){let u=p=>p.length>5?`"${p.slice(0,3)}...`:JSON.stringify(p);throw new Error(`string (${u(o)}) cannot be negated`)}return null}return r.op==="not"?!S(o):null});case"Cond":return d(t,r.cond,n).flatMap(o=>{if(S(o))return d(t,r.then,n);for(let u of r.elifs)if(d(t,u.cond,n).some(S))return d(t,u.then,n);return r.else?d(t,r.else,n):[t]});case"Try":try{return d(t,r.body,n)}catch(c){if(r.catch){let o=c instanceof H?c.value:c instanceof Error?c.message:String(c);return d(o,r.catch,n)}return[]}case"Call":return gt(t,r.name,r.args,n);case"VarBind":return d(t,r.value,n).flatMap(o=>{let u=null,p=[];r.pattern?p.push(r.pattern):r.name&&p.push({type:"var",name:r.name}),r.alternatives&&p.push(...r.alternatives);for(let s of p)if(u=L(n,s,o),u!==null)break;return u===null?[]:d(t,r.body,u)});case"VarRef":{if(r.name==="$ENV")return[n.env?X(n.env):Object.create(null)];let c=n.vars.get(r.name);return c!==void 0?[c]:[null]}case"Recurse":{let c=[],o=new WeakSet,u=p=>{if(p&&typeof p=="object"){if(o.has(p))return;o.add(p)}if(c.push(p),Array.isArray(p))for(let s of p)u(s);else if(p&&typeof p=="object")for(let s of Object.keys(p))u(p[s])};return u(t),c}case"Optional":try{return d(t,r.expr,n)}catch{return[]}case"StringInterp":return[r.parts.map(o=>typeof o=="string"?o:d(t,o,n).map(p=>typeof p=="string"?p:JSON.stringify(p)).join("")).join("")];case"UpdateOp":return[Mt(t,r.path,r.op,r.value,n)];case"Reduce":{let c=d(t,r.expr,n),o=d(t,r.init,n)[0],u=n.limits.maxDepth??bt;for(let p of c){let s;if(r.pattern){if(s=L(n,r.pattern,p),s===null)continue}else s=q(n,r.varName,p);if(o=d(o,r.update,s)[0],D(o,u+1)>u)return[null]}return[o]}case"Foreach":{let c=d(t,r.expr,n),o=d(t,r.init,n)[0],u=[];for(let p of c)try{let s;if(r.pattern){if(s=L(n,r.pattern,p),s===null)continue}else s=q(n,r.varName,p);if(o=d(o,r.update,s)[0],r.extract){let f=d(o,r.extract,s);u.push(...f)}else u.push(o)}catch(s){throw s instanceof P?s.withPrependedResults(u):s}return u}case"Label":try{return d(t,r.body,{...n,labels:new Set([...n.labels??[],r.name])})}catch(c){if(c instanceof P&&c.label===r.name)return c.partialResults;throw c}case"Break":throw new P(r.name);case"Def":{let c=new Map(n.funcs??[]),o=`${r.name}/${r.params.length}`;c.set(o,{params:r.params,body:r.funcBody,closure:new Map(n.funcs??[])});let u={...n,funcs:c};return d(t,r.body,u)}default:{let c=r;throw new Error(`Unknown AST node type: ${c.type}`)}}}function dt(t,r){return t<0?Math.max(0,r+t):Math.min(t,r)}function Mt(t,r,e,n,c){function o(s,f){switch(e){case"=":return f;case"|=":return d(s,n,c)[0]??null;case"+=":return typeof s=="number"&&typeof f=="number"||typeof s=="string"&&typeof f=="string"?s+f:Array.isArray(s)&&Array.isArray(f)?[...s,...f]:s&&f&&typeof s=="object"&&typeof f=="object"?G(s,f):f;case"-=":return typeof s=="number"&&typeof f=="number"?s-f:s;case"*=":return typeof s=="number"&&typeof f=="number"?s*f:s;case"/=":return typeof s=="number"&&typeof f=="number"?s/f:s;case"%=":return typeof s=="number"&&typeof f=="number"?s%f:s;case"//=":return s===null||s===!1?f:s;default:return f}}function u(s,f,i){switch(f.type){case"Identity":return i(s);case"Field":{if(!g(f.name))return s;if(f.base)return u(s,f.base,h=>{if(h&&typeof h=="object"&&!Array.isArray(h)){let a=O(h),y=Object.hasOwn(a,f.name)?a[f.name]:void 0;return A(a,f.name,i(y)),a}return h});if(s&&typeof s=="object"&&!Array.isArray(s)){let h=O(s),a=Object.hasOwn(h,f.name)?h[f.name]:void 0;return A(h,f.name,i(a)),h}return s}case"Index":{let a=d(t,f.index,c)[0];if(typeof a=="number"&&Number.isNaN(a))throw new Error("Cannot set array element at NaN index");if(typeof a=="number"&&!Number.isInteger(a)&&(a=Math.trunc(a)),f.base)return u(s,f.base,y=>{if(typeof a=="number"&&Array.isArray(y)){let l=[...y],m=a<0?l.length+a:a;if(m>=0){for(;l.length<=m;)l.push(null);l[m]=i(l[m])}return l}if(typeof a=="string"&&y&&typeof y=="object"&&!Array.isArray(y)){if(!g(a))return y;let l=O(y),m=Object.hasOwn(l,a)?l[a]:void 0;return A(l,a,i(m)),l}return y});if(typeof a=="number"){if(a>536870911)throw new Error("Array index too large");if(a<0&&(!s||!Array.isArray(s)))throw new Error("Out of bounds negative array index");if(Array.isArray(s)){let l=[...s],m=a<0?l.length+a:a;if(m>=0){for(;l.length<=m;)l.push(null);l[m]=i(l[m])}return l}if(s==null){let l=[];for(;l.length<=a;)l.push(null);return l[a]=i(null),l}return s}if(typeof a=="string"&&s&&typeof s=="object"&&!Array.isArray(s)){if(!g(a))return s;let y=O(s),l=Object.hasOwn(y,a)?y[a]:void 0;return A(y,a,i(l)),y}return s}case"Iterate":{let h=a=>{if(Array.isArray(a))return a.map(y=>i(y));if(a&&typeof a=="object"){let y=Object.create(null);for(let[l,m]of Object.entries(a))g(l)&&A(y,l,i(m));return y}return a};return f.base?u(s,f.base,h):h(s)}case"Pipe":{let h=u(s,f.left,a=>a);return u(h,f.right,i)}default:return i(s)}}return u(t,r,s=>{if(e==="|=")return o(s,s);let f=d(t,n,c);return o(s,f[0]??null)})}function jt(t,r,e){function n(o,u,p){switch(u.type){case"Identity":return p;case"Field":{if(!g(u.name))return o;if(u.base){let s=d(o,u.base,e)[0],f=n(s,{type:"Field",name:u.name},p);return n(o,u.base,f)}if(o&&typeof o=="object"&&!Array.isArray(o)){let s=O(o);return A(s,u.name,p),s}return o}case"Index":{if(u.base){let i=d(o,u.base,e)[0],h=n(i,{type:"Index",index:u.index},p);return n(o,u.base,h)}let f=d(t,u.index,e)[0];if(typeof f=="number"&&Array.isArray(o)){let i=[...o],h=f<0?i.length+f:f;return h>=0&&h=0&&h=0&&NS(s)?d(t,n,c).map(i=>S(i)):[!1]);if(r==="or")return d(t,e,c).flatMap(s=>S(s)?[!0]:d(t,n,c).map(i=>S(i)));if(r==="//"){let s=d(t,e,c).filter(f=>f!=null&&f!==!1);return s.length>0?s:d(t,n,c)}let o=d(t,e,c),u=d(t,n,c);return o.flatMap(p=>u.map(s=>{switch(r){case"+":return p===null?s:s===null?p:typeof p=="number"&&typeof s=="number"||typeof p=="string"&&typeof s=="string"?p+s:Array.isArray(p)&&Array.isArray(s)?[...p,...s]:p&&s&&typeof p=="object"&&typeof s=="object"&&!Array.isArray(p)&&!Array.isArray(s)?G(p,s):null;case"-":if(typeof p=="number"&&typeof s=="number")return p-s;if(Array.isArray(p)&&Array.isArray(s)){let f=new Set(s.map(i=>JSON.stringify(i)));return p.filter(i=>!f.has(JSON.stringify(i)))}if(typeof p=="string"&&typeof s=="string"){let f=i=>i.length>10?`"${i.slice(0,10)}...`:JSON.stringify(i);throw new Error(`string (${f(p)}) and string (${f(s)}) cannot be subtracted`)}return null;case"*":if(typeof p=="number"&&typeof s=="number")return p*s;if(typeof p=="string"&&typeof s=="number")return p.repeat(s);{let f=E(p),i=E(s);if(f&&i)return v(f,i)}return null;case"/":if(typeof p=="number"&&typeof s=="number"){if(s===0)throw new Error(`number (${p}) and number (${s}) cannot be divided because the divisor is zero`);return p/s}return typeof p=="string"&&typeof s=="string"?p.split(s):null;case"%":if(typeof p=="number"&&typeof s=="number"){if(s===0)throw new Error(`number (${p}) and number (${s}) cannot be divided (remainder) because the divisor is zero`);return!Number.isFinite(p)&&!Number.isNaN(p)?!Number.isFinite(s)&&!Number.isNaN(s)&&p<0&&s>0?-1:0:p%s}return null;case"==":return I(p,s);case"!=":return!I(p,s);case"<":return U(p,s)<0;case"<=":return U(p,s)<=0;case">":return U(p,s)>0;case">=":return U(p,s)>=0;default:return null}}))}function gt(t,r,e,n){let c=Ct.get(r);if(c)return typeof t=="number"?[c(t)]:[null];let o=rt(t,r,e,n,d);if(o!==null)return o;let u=ft(t,r,e,n,d);if(u!==null)return u;let p=Z(t,r,e,n,d);if(p!==null)return p;let s=tt(t,r,n.limits.maxDepth);if(s!==null)return s;let f=ct(t,r);if(f!==null)return f;let i=st(t,r,e,n,d);if(i!==null)return i;let h=W(t,r,e,n,d,mt,$,S,F,B);if(h!==null)return h;let a=it(t,r,e,n,d,S,K,V,jt,J);if(a!==null)return a;let y=et(t,r,e,n,d,I);if(y!==null)return y;let l=z(t,r,e,n,d,mt,S,B);if(l!==null)return l;let m=nt(t,r,e,n,d,S,Rt,gt);if(m!==null)return m;let b=ot(t,r,e,n,d,I);if(b!==null)return b;switch(r){case"builtins":return[["add/0","all/0","all/1","all/2","any/0","any/1","any/2","arrays/0","ascii/0","ascii_downcase/0","ascii_upcase/0","booleans/0","bsearch/1","builtins/0","combinations/0","combinations/1","contains/1","debug/0","del/1","delpaths/1","empty/0","env/0","error/0","error/1","explode/0","first/0","first/1","flatten/0","flatten/1","floor/0","from_entries/0","fromdate/0","fromjson/0","getpath/1","gmtime/0","group_by/1","gsub/2","gsub/3","has/1","implode/0","IN/1","IN/2","INDEX/1","INDEX/2","index/1","indices/1","infinite/0","inside/1","isempty/1","isnan/0","isnormal/0","isvalid/1","iterables/0","join/1","keys/0","keys_unsorted/0","last/0","last/1","length/0","limit/2","ltrimstr/1","map/1","map_values/1","match/1","match/2","max/0","max_by/1","min/0","min_by/1","mktime/0","modulemeta/1","nan/0","not/0","nth/1","nth/2","null/0","nulls/0","numbers/0","objects/0","path/1","paths/0","paths/1","pick/1","range/1","range/2","range/3","recurse/0","recurse/1","recurse_down/0","repeat/1","reverse/0","rindex/1","rtrimstr/1","scalars/0","scan/1","scan/2","select/1","setpath/2","skip/2","sort/0","sort_by/1","split/1","splits/1","splits/2","sqrt/0","startswith/1","strftime/1","strings/0","strptime/1","sub/2","sub/3","test/1","test/2","to_entries/0","toboolean/0","todate/0","tojson/0","tostream/0","fromstream/1","truncate_stream/1","tonumber/0","tostring/0","transpose/0","trim/0","ltrim/0","rtrim/0","type/0","unique/0","unique_by/1","until/2","utf8bytelength/0","values/0","walk/1","while/2","with_entries/1"]];case"error":{let w=e.length>0?d(t,e[0],n)[0]:t;throw new H(w)}case"env":return[n.env?X(n.env):Object.create(null)];case"debug":return[t];case"input_line_number":return[1];default:{let w=`${r}/${e.length}`,k=n.funcs?.get(w);if(k){let N=k.closure??n.funcs??new Map,C=new Map(N);C.set(w,k);for(let _=0;_=0;Q--)x={type:"Comma",left:{type:"Literal",value:j[Q]},right:x}}C.set(`${kt}/0`,{params:[],body:x})}}let wt={...n,funcs:C};return d(t,k.body,wt)}throw new Error(`Unknown function: ${r}`)}}}function J(t,r,e,n,c){if(r.type==="Comma"){let p=r;J(t,p.left,e,n,c),J(t,p.right,e,n,c);return}let o=M(r);if(o!==null){c.push([...n,...o]);return}if(r.type==="Iterate"){if(Array.isArray(t))for(let p=0;p{if(c.push([...n,...f]),s&&typeof s=="object")if(Array.isArray(s))for(let i=0;i0&&c.push(n)}var At=new Map([["and","AND"],["or","OR"],["not","NOT"],["if","IF"],["then","THEN"],["elif","ELIF"],["else","ELSE"],["end","END"],["as","AS"],["try","TRY"],["catch","CATCH"],["true","TRUE"],["false","FALSE"],["null","NULL"],["reduce","REDUCE"],["foreach","FOREACH"],["label","LABEL"],["break","BREAK"],["def","DEF"]]),Y=new Set(At.values());function Et(t){let r=[],e=0,n=(f=0)=>t[e+f],c=()=>t[e++],o=()=>e>=t.length,u=f=>f>="0"&&f<="9",p=f=>f>="a"&&f<="z"||f>="A"&&f<="Z"||f==="_",s=f=>p(f)||u(f);for(;!o();){let f=e,i=c();if(!(i===" "||i===" "||i===` -`||i==="\r")){if(i==="#"){for(;!o()&&n()!==` -`;)c();continue}if(i==="."&&n()==="."){c(),r.push({type:"DOTDOT",pos:f});continue}if(i==="="&&n()==="="){c(),r.push({type:"EQ",pos:f});continue}if(i==="!"&&n()==="="){c(),r.push({type:"NE",pos:f});continue}if(i==="<"&&n()==="="){c(),r.push({type:"LE",pos:f});continue}if(i===">"&&n()==="="){c(),r.push({type:"GE",pos:f});continue}if(i==="/"&&n()==="/"){c(),n()==="="?(c(),r.push({type:"UPDATE_ALT",pos:f})):r.push({type:"ALT",pos:f});continue}if(i==="+"&&n()==="="){c(),r.push({type:"UPDATE_ADD",pos:f});continue}if(i==="-"&&n()==="="){c(),r.push({type:"UPDATE_SUB",pos:f});continue}if(i==="*"&&n()==="="){c(),r.push({type:"UPDATE_MUL",pos:f});continue}if(i==="/"&&n()==="="){c(),r.push({type:"UPDATE_DIV",pos:f});continue}if(i==="%"&&n()==="="){c(),r.push({type:"UPDATE_MOD",pos:f});continue}if(i==="="&&n()!=="="){r.push({type:"ASSIGN",pos:f});continue}if(i==="."){r.push({type:"DOT",pos:f});continue}if(i==="|"){n()==="="?(c(),r.push({type:"UPDATE_PIPE",pos:f})):r.push({type:"PIPE",pos:f});continue}if(i===","){r.push({type:"COMMA",pos:f});continue}if(i===":"){r.push({type:"COLON",pos:f});continue}if(i===";"){r.push({type:"SEMICOLON",pos:f});continue}if(i==="("){r.push({type:"LPAREN",pos:f});continue}if(i===")"){r.push({type:"RPAREN",pos:f});continue}if(i==="["){r.push({type:"LBRACKET",pos:f});continue}if(i==="]"){r.push({type:"RBRACKET",pos:f});continue}if(i==="{"){r.push({type:"LBRACE",pos:f});continue}if(i==="}"){r.push({type:"RBRACE",pos:f});continue}if(i==="?"){r.push({type:"QUESTION",pos:f});continue}if(i==="+"){r.push({type:"PLUS",pos:f});continue}if(i==="-"){r.push({type:"MINUS",pos:f});continue}if(i==="*"){r.push({type:"STAR",pos:f});continue}if(i==="/"){r.push({type:"SLASH",pos:f});continue}if(i==="%"){r.push({type:"PERCENT",pos:f});continue}if(i==="<"){r.push({type:"LT",pos:f});continue}if(i===">"){r.push({type:"GT",pos:f});continue}if(u(i)){let h=i;for(;!o()&&(u(n())||n()==="."||n()==="e"||n()==="E");)(n()==="e"||n()==="E")&&(t[e+1]==="+"||t[e+1]==="-")&&(h+=c()),h+=c();r.push({type:"NUMBER",value:Number(h),pos:f});continue}if(i==='"'){let h="",a=0;for(;!o();){let y=n();if(a===0&&y==='"')break;if(a===0&&y==="\\"){if(c(),o())break;let l=c();switch(l){case"n":h+=` -`;break;case"r":h+="\r";break;case"t":h+=" ";break;case"\\":h+="\\";break;case'"':h+='"';break;case"(":h+="\\(",a=1;break;default:h+=l}continue}if(a>0){if(y==='"'){for(h+=c();!o();){let l=n();if(l==="\\"){h+=c(),o()||(h+=c());continue}if(h+=c(),l==='"')break}continue}y==="("?a++:y===")"&&a--,h+=c();continue}h+=c()}o()||c(),r.push({type:"STRING",value:h,pos:f});continue}if(p(i)||i==="$"||i==="@"){let h=i;for(;!o()&&s(n());)h+=c();let a=At.get(h);a?r.push({type:a,value:h,pos:f}):r.push({type:"IDENT",value:h,pos:f});continue}throw new Error(`Unexpected character '${i}' at position ${f}`)}}return r.push({type:"EOF",pos:e}),r}var ut=class t{tokens;pos=0;constructor(r){this.tokens=r}peek(r=0){return this.tokens[this.pos+r]??{type:"EOF",pos:-1}}advance(){return this.tokens[this.pos++]}check(r){return this.peek().type===r}match(...r){for(let e of r)if(this.check(e))return this.advance();return null}expect(r,e){if(!this.check(r))throw new Error(`${e} at position ${this.peek().pos}, got ${this.peek().type}`);return this.advance()}isFieldNameAfterDot(r=0){let e=this.peek(r),n=this.peek(r+1);return n.type==="STRING"?!0:n.type==="IDENT"||Y.has(n.type)?n.pos===e.pos+1:!1}isIdentLike(){let r=this.peek().type;return r==="IDENT"||Y.has(r)}consumeFieldNameAfterDot(r){let e=this.peek();return e.type==="STRING"?this.advance().value:(e.type==="IDENT"||Y.has(e.type))&&e.pos===r.pos+1?this.advance().value:null}parse(){let r=this.parseExpr();if(!this.check("EOF"))throw new Error(`Unexpected token ${this.peek().type} at position ${this.peek().pos}`);return r}parseExpr(){return this.parsePipe()}parsePattern(){if(this.match("LBRACKET")){let n=[];if(!this.check("RBRACKET"))for(n.push(this.parsePattern());this.match("COMMA")&&!this.check("RBRACKET");)n.push(this.parsePattern());return this.expect("RBRACKET","Expected ']' after array pattern"),{type:"array",elements:n}}if(this.match("LBRACE")){let n=[];if(!this.check("RBRACE"))for(n.push(this.parsePatternField());this.match("COMMA")&&!this.check("RBRACE");)n.push(this.parsePatternField());return this.expect("RBRACE","Expected '}' after object pattern"),{type:"object",fields:n}}let r=this.expect("IDENT","Expected variable name in pattern"),e=r.value;if(!e.startsWith("$"))throw new Error(`Variable name must start with $ at position ${r.pos}`);return{type:"var",name:e}}parsePatternField(){if(this.match("LPAREN")){let e=this.parseExpr();this.expect("RPAREN","Expected ')' after computed key"),this.expect("COLON","Expected ':' after computed key");let n=this.parsePattern();return{key:e,pattern:n}}let r=this.peek();if(r.type==="IDENT"||Y.has(r.type)){let e=r.value;if(e.startsWith("$")){if(this.advance(),this.match("COLON")){let n=this.parsePattern();return{key:e.slice(1),pattern:n,keyVar:e}}return{key:e.slice(1),pattern:{type:"var",name:e}}}if(this.advance(),this.match("COLON")){let n=this.parsePattern();return{key:e,pattern:n}}return{key:e,pattern:{type:"var",name:`$${e}`}}}throw new Error(`Expected field name in object pattern at position ${r.pos}`)}parsePipe(){let r=this.parseComma();for(;this.match("PIPE");){let e=this.parseComma();r={type:"Pipe",left:r,right:e}}return r}parseComma(){let r=this.parseVarBind();for(;this.match("COMMA");){let e=this.parseVarBind();r={type:"Comma",left:r,right:e}}return r}parseVarBind(){let r=this.parseUpdate();if(this.match("AS")){let e=this.parsePattern(),n=[];for(;this.check("QUESTION")&&this.peekAhead(1)?.type==="ALT";)this.advance(),this.advance(),n.push(this.parsePattern());this.expect("PIPE","Expected '|' after variable binding");let c=this.parseExpr();return e.type==="var"&&n.length===0?{type:"VarBind",name:e.name,value:r,body:c}:{type:"VarBind",name:e.type==="var"?e.name:"",value:r,body:c,pattern:e.type!=="var"?e:void 0,alternatives:n.length>0?n:void 0}}return r}peekAhead(r){let e=this.pos+r;return e"],["GE",">="]]),n=this.match("EQ","NE","LT","LE","GT","GE");if(n){let c=e.get(n.type);if(c){let o=this.parseAddSub();r={type:"BinaryOp",op:c,left:r,right:o}}}return r}parseAddSub(){let r=this.parseMulDiv();for(;;)if(this.match("PLUS")){let e=this.parseMulDiv();r={type:"BinaryOp",op:"+",left:r,right:e}}else if(this.match("MINUS")){let e=this.parseMulDiv();r={type:"BinaryOp",op:"-",left:r,right:e}}else break;return r}parseMulDiv(){let r=this.parseUnary();for(;;)if(this.match("STAR")){let e=this.parseUnary();r={type:"BinaryOp",op:"*",left:r,right:e}}else if(this.match("SLASH")){let e=this.parseUnary();r={type:"BinaryOp",op:"/",left:r,right:e}}else if(this.match("PERCENT")){let e=this.parseUnary();r={type:"BinaryOp",op:"%",left:r,right:e}}else break;return r}parseUnary(){return this.match("MINUS")?{type:"UnaryOp",op:"-",operand:this.parseUnary()}:this.parsePostfix()}parsePostfix(){let r=this.parsePrimary();for(;;)if(this.match("QUESTION"))r={type:"Optional",expr:r};else if(this.check("DOT")&&this.isFieldNameAfterDot())this.advance(),r={type:"Field",name:this.advance().value,base:r};else if(this.check("LBRACKET"))if(this.advance(),this.match("RBRACKET"))r={type:"Iterate",base:r};else if(this.check("COLON")){this.advance();let e=this.check("RBRACKET")?void 0:this.parseExpr();this.expect("RBRACKET","Expected ']'"),r={type:"Slice",end:e,base:r}}else{let e=this.parseExpr();if(this.match("COLON")){let n=this.check("RBRACKET")?void 0:this.parseExpr();this.expect("RBRACKET","Expected ']'"),r={type:"Slice",start:e,end:n,base:r}}else this.expect("RBRACKET","Expected ']'"),r={type:"Index",index:e,base:r}}else break;return r}parsePrimary(){if(this.match("DOTDOT"))return{type:"Recurse"};if(this.check("DOT")){let r=this.advance();if(this.check("LBRACKET")){if(this.advance(),this.match("RBRACKET"))return{type:"Iterate"};if(this.check("COLON")){this.advance();let c=this.check("RBRACKET")?void 0:this.parseExpr();return this.expect("RBRACKET","Expected ']'"),{type:"Slice",end:c}}let n=this.parseExpr();if(this.match("COLON")){let c=this.check("RBRACKET")?void 0:this.parseExpr();return this.expect("RBRACKET","Expected ']'"),{type:"Slice",start:n,end:c}}return this.expect("RBRACKET","Expected ']'"),{type:"Index",index:n}}let e=this.consumeFieldNameAfterDot(r);return e!==null?{type:"Field",name:e}:{type:"Identity"}}if(this.match("TRUE"))return{type:"Literal",value:!0};if(this.match("FALSE"))return{type:"Literal",value:!1};if(this.match("NULL"))return{type:"Literal",value:null};if(this.check("NUMBER"))return{type:"Literal",value:this.advance().value};if(this.check("STRING")){let e=this.advance().value;return e.includes("\\(")?this.parseStringInterpolation(e):{type:"Literal",value:e}}if(this.match("LBRACKET")){if(this.match("RBRACKET"))return{type:"Array"};let r=this.parseExpr();return this.expect("RBRACKET","Expected ']'"),{type:"Array",elements:r}}if(this.match("LBRACE"))return this.parseObjectConstruction();if(this.match("LPAREN")){let r=this.parseExpr();return this.expect("RPAREN","Expected ')'"),{type:"Paren",expr:r}}if(this.match("IF"))return this.parseIf();if(this.match("TRY")){let r=this.parsePostfix(),e;return this.match("CATCH")&&(e=this.parsePostfix()),{type:"Try",body:r,catch:e}}if(this.match("REDUCE")){let r=this.parseAddSub();this.expect("AS","Expected 'as' after reduce expression");let e=this.parsePattern();this.expect("LPAREN","Expected '(' after variable");let n=this.parseExpr();this.expect("SEMICOLON","Expected ';' after init expression");let c=this.parseExpr();this.expect("RPAREN","Expected ')' after update expression");let o=e.type==="var"?e.name:"";return{type:"Reduce",expr:r,varName:o,init:n,update:c,pattern:e.type!=="var"?e:void 0}}if(this.match("FOREACH")){let r=this.parseAddSub();this.expect("AS","Expected 'as' after foreach expression");let e=this.parsePattern();this.expect("LPAREN","Expected '(' after variable");let n=this.parseExpr();this.expect("SEMICOLON","Expected ';' after init expression");let c=this.parseExpr(),o;this.match("SEMICOLON")&&(o=this.parseExpr()),this.expect("RPAREN","Expected ')' after expressions");let u=e.type==="var"?e.name:"";return{type:"Foreach",expr:r,varName:u,init:n,update:c,extract:o,pattern:e.type!=="var"?e:void 0}}if(this.match("LABEL")){let r=this.expect("IDENT","Expected label name (e.g., $out)"),e=r.value;if(!e.startsWith("$"))throw new Error(`Label name must start with $ at position ${r.pos}`);this.expect("PIPE","Expected '|' after label name");let n=this.parseExpr();return{type:"Label",name:e,body:n}}if(this.match("BREAK")){let r=this.expect("IDENT","Expected label name to break to"),e=r.value;if(!e.startsWith("$"))throw new Error(`Break label must start with $ at position ${r.pos}`);return{type:"Break",name:e}}if(this.match("DEF")){let e=this.expect("IDENT","Expected function name after def").value,n=[];if(this.match("LPAREN")){if(!this.check("RPAREN")){let u=this.expect("IDENT","Expected parameter name");for(n.push(u.value);this.match("SEMICOLON");){let p=this.expect("IDENT","Expected parameter name");n.push(p.value)}}this.expect("RPAREN","Expected ')' after parameters")}this.expect("COLON","Expected ':' after function name");let c=this.parseExpr();this.expect("SEMICOLON","Expected ';' after function body");let o=this.parseExpr();return{type:"Def",name:e,params:n,funcBody:c,body:o}}if(this.match("NOT"))return{type:"Call",name:"not",args:[]};if(this.check("IDENT")){let e=this.advance().value;if(e.startsWith("$"))return{type:"VarRef",name:e};if(this.match("LPAREN")){let n=[];if(!this.check("RPAREN"))for(n.push(this.parseExpr());this.match("SEMICOLON");)n.push(this.parseExpr());return this.expect("RPAREN","Expected ')'"),{type:"Call",name:e,args:n}}return{type:"Call",name:e,args:[]}}throw new Error(`Unexpected token ${this.peek().type} at position ${this.peek().pos}`)}parseObjectConstruction(){let r=[];if(!this.check("RBRACE"))do{let e,n;if(this.match("LPAREN"))e=this.parseExpr(),this.expect("RPAREN","Expected ')'"),this.expect("COLON","Expected ':'"),n=this.parseObjectValue();else if(this.isIdentLike()){let c=this.advance().value;this.match("COLON")?(e=c,n=this.parseObjectValue()):(e=c,n={type:"Field",name:c})}else if(this.check("STRING"))e=this.advance().value,this.expect("COLON","Expected ':'"),n=this.parseObjectValue();else throw new Error(`Expected object key at position ${this.peek().pos}`);r.push({key:e,value:n})}while(this.match("COMMA"));return this.expect("RBRACE","Expected '}'"),{type:"Object",entries:r}}parseObjectValue(){let r=this.parseVarBind();for(;this.match("PIPE");){let e=this.parseVarBind();r={type:"Pipe",left:r,right:e}}return r}parseIf(){let r=this.parseExpr();this.expect("THEN","Expected 'then'");let e=this.parseExpr(),n=[];for(;this.match("ELIF");){let o=this.parseExpr();this.expect("THEN","Expected 'then' after elif");let u=this.parseExpr();n.push({cond:o,then:u})}let c;return this.match("ELSE")&&(c=this.parseExpr()),this.expect("END","Expected 'end'"),{type:"Cond",cond:r,then:e,elifs:n,else:c}}parseStringInterpolation(r){let e=[],n="",c=0;for(;c0;){let f=r[c];if(f==='"'){for(u+=f,c++;c0&&(u+=f),c++}let p=Et(u),s=new t(p);e.push(s.parse())}else n+=r[c],c++;return n&&e.push(n),{type:"StringInterp",parts:e}}};function Ne(t){let r=Et(t);return new ut(r).parse()}export{d as a,Ne as b}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-JA7M2FXG.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-JA7M2FXG.js deleted file mode 100644 index 8857576..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-JA7M2FXG.js +++ /dev/null @@ -1,16 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a as w,b as V}from"./chunk-J3LJZWL2.js";import{d as E}from"./chunk-4WKZNNJK.js";import{a as T,b as M}from"./chunk-KAPG5ONA.js";import{a as F}from"./chunk-VACKIICN.js";import{a as R}from"./chunk-KTPCYKBB.js";import{c as J}from"./chunk-XEKXHOPO.js";import{k as O}from"./chunk-SAI2SPQQ.js";import{a as N}from"./chunk-FOCWZZDE.js";import{a as A,b as L,c as I}from"./chunk-QAYAQNCG.js";function W(t){switch(t){case"\b":return"\\b";case"\f":return"\\f";case` -`:return"\\n";case"\r":return"\\r";case" ":return"\\t";default:return`\\u${t.charCodeAt(0).toString(16).padStart(4,"0")}`}}function _(t){let n="",s=!1,i=!1;for(let a=0;a=i)break;let a=s,r=t[s];if(r==="{"||r==="["){let f=r,c=r==="{"?"}":"]",p=1,m=!1,d=!1;for(s++;s0;){let j=t[s];d?d=!1:j==="\\"?d=!0:j==='"'?m=!m:m||(j===f?p++:j===c&&p--),s++}if(p!==0)throw new Error(`Unexpected end of JSON input at position ${s} (unclosed ${f})`);n.push(E(k(t,a,s)))}else if(r==='"'){let f=!1;for(s++;s="0"&&r<="9"){for(;sC(p,!0,!1,i,a)).join(",")}]`:`[ -${t.map(p=>f.repeat(r+1)+C(p,!1,!1,i,a,r+1)).join(`, -`)} -${f.repeat(r)}]`;if(typeof t=="object"){let c=Object.keys(t);return i&&(c=c.sort()),c.length===0?"{}":n?`{${c.map(m=>`${JSON.stringify(m)}:${C(t[m],!0,!1,i,a)}`).join(",")}}`:`{ -${c.map(m=>{let d=C(t[m],!1,!1,i,a,r+1);return`${f.repeat(r+1)}${JSON.stringify(m)}: ${d}`}).join(`, -`)} -${f.repeat(r)}}`}return String(t)}var re={name:"jq",async execute(t,n){T(n.requireDefenseContext,"jq","execution entry");let s=(o,e)=>M(n.requireDefenseContext,"jq",o,e);if(L(t))return A(X);let i=!1,a=!1,r=!1,f=!1,c=!1,p=!1,m=!1,d=!1,j=!1,D=".",z=!1,x=[];for(let o=0;oR(n,x,{cmdName:"jq",stopOnError:!0}));if(o.exitCode!==0)return{stdout:"",stderr:o.stderr,exitCode:2};S=o.files.map(e=>({source:e.filename||"stdin",content:J(e.content)}))}try{let o=V(D),e=[],l={limits:n.limits?{maxIterations:n.limits.maxJqIterations}:void 0,env:n.env,coverage:n.coverage,requireDefenseContext:n.requireDefenseContext};if(p)e=w(null,o,l);else if(a&&c){let u=S.map(({content:g})=>g).join("");e=w(u,o,l)}else if(a){let u="";for(let{content:g}of S){let h=u+g,y=0,q=h.indexOf(` -`,y);for(;q!==-1;)e.push(...w(h.slice(y,q),o,l)),y=q+1,q=h.indexOf(` -`,y);u=h.slice(y)}u!==""&&e.push(...w(u,o,l))}else if(c){let u=[];for(let{content:g}of S){let h=g.trim();h&&u.push(...B(h))}e=w(u,o,l)}else for(let{content:u}of S){let g=u.trim();if(!g)continue;let h=B(g);for(let y of h)e.push(...w(y,o,l))}let H=e.map(u=>C(u,r,i,d,j)),P=m?"":` -`,b=H.join(P),$=n.limits?.maxStringLength;if($!==void 0&&$>0&&b.length>$)throw new O(`jq: output size limit exceeded (${$} bytes)`,"string_length");let U=f&&(e.length===0||e.every(u=>u==null||u===!1))?1:0;return{stdout:b?m?b:`${b} -`:"",stderr:"",exitCode:U}}catch(o){if(o instanceof F)throw o;if(o instanceof O)return{stdout:"",stderr:`jq: ${N(o.message)} -`,exitCode:O.EXIT_CODE};let e=N(o.message);return e.includes("Unknown function")?{stdout:"",stderr:`jq: error: ${e} -`,exitCode:3}:{stdout:"",stderr:`jq: parse error: ${e} -`,exitCode:5}}}},oe={name:"jq",flags:[{flag:"-R",type:"boolean"},{flag:"-r",type:"boolean"},{flag:"-c",type:"boolean"},{flag:"-e",type:"boolean"},{flag:"-s",type:"boolean"},{flag:"-n",type:"boolean"},{flag:"-j",type:"boolean"},{flag:"-S",type:"boolean"},{flag:"--tab",type:"boolean"}],stdinType:"json",needsArgs:!0};export{re as a,oe as b}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-JNYYVLEL.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-JNYYVLEL.js deleted file mode 100644 index 3a72fe7..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-JNYYVLEL.js +++ /dev/null @@ -1,35 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{f as G}from"./chunk-4WKZNNJK.js";import{a as B,b as U,c as A}from"./chunk-KSBHIW2H.js";import{a as q}from"./chunk-L2UW7DWF.js";import{a as M}from"./chunk-7CSMHFIJ.js";import{c as D}from"./chunk-XEKXHOPO.js";import{a as z,b as E,c as O}from"./chunk-QAYAQNCG.js";var H=G({js:{extensions:[".js",".mjs",".cjs",".jsx"],globs:[]},ts:{extensions:[".ts",".tsx",".mts",".cts"],globs:[]},html:{extensions:[".html",".htm",".xhtml"],globs:[]},css:{extensions:[".css",".scss",".sass",".less"],globs:[]},json:{extensions:[".json",".jsonc",".json5"],globs:[]},xml:{extensions:[".xml",".xsl",".xslt"],globs:[]},c:{extensions:[".c",".h"],globs:[]},cpp:{extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx",".h"],globs:[]},rust:{extensions:[".rs"],globs:[]},go:{extensions:[".go"],globs:[]},zig:{extensions:[".zig"],globs:[]},java:{extensions:[".java"],globs:[]},kotlin:{extensions:[".kt",".kts"],globs:[]},scala:{extensions:[".scala",".sc"],globs:[]},clojure:{extensions:[".clj",".cljc",".cljs",".edn"],globs:[]},py:{extensions:[".py",".pyi",".pyw"],globs:[]},rb:{extensions:[".rb",".rake",".gemspec"],globs:["Rakefile","Gemfile"]},php:{extensions:[".php",".phtml",".php3",".php4",".php5"],globs:[]},perl:{extensions:[".pl",".pm",".pod",".t"],globs:[]},lua:{extensions:[".lua"],globs:[]},sh:{extensions:[".sh",".bash",".zsh",".fish"],globs:[".bashrc",".zshrc",".profile"]},bat:{extensions:[".bat",".cmd"],globs:[]},ps:{extensions:[".ps1",".psm1",".psd1"],globs:[]},yaml:{extensions:[".yaml",".yml"],globs:[]},toml:{extensions:[".toml"],globs:["Cargo.toml","pyproject.toml"]},ini:{extensions:[".ini",".cfg",".conf"],globs:[]},csv:{extensions:[".csv",".tsv"],globs:[]},md:{extensions:[".md",".mdx",".markdown",".mdown",".mkd"],globs:[]},markdown:{extensions:[".md",".mdx",".markdown",".mdown",".mkd"],globs:[]},rst:{extensions:[".rst"],globs:[]},txt:{extensions:[".txt",".text"],globs:[]},tex:{extensions:[".tex",".ltx",".sty",".cls"],globs:[]},sql:{extensions:[".sql"],globs:[]},graphql:{extensions:[".graphql",".gql"],globs:[]},proto:{extensions:[".proto"],globs:[]},make:{extensions:[".mk",".mak"],globs:["Makefile","GNUmakefile","makefile"]},docker:{extensions:[],globs:["Dockerfile","Dockerfile.*","*.dockerfile"]},tf:{extensions:[".tf",".tfvars"],globs:[]}}),$=class{types;constructor(){this.types=new Map(Object.entries(H).map(([t,s])=>[t,{extensions:[...s.extensions],globs:[...s.globs]}]))}addType(t){let s=t.indexOf(":");if(s===-1)return;let n=t.slice(0,s),r=t.slice(s+1);if(r.startsWith("include:")){let l=r.slice(8),i=this.types.get(l);if(i){let o=this.types.get(n)||{extensions:[],globs:[]};o.extensions.push(...i.extensions),o.globs.push(...i.globs),this.types.set(n,o)}}else{let l=this.types.get(n)||{extensions:[],globs:[]};if(r.startsWith("*.")&&!r.slice(2).includes("*")){let i=r.slice(1);l.extensions.includes(i)||l.extensions.push(i)}else l.globs.includes(r)||l.globs.push(r);this.types.set(n,l)}}clearType(t){let s=this.types.get(t);s&&(s.extensions=[],s.globs=[])}getType(t){return this.types.get(t)}getAllTypes(){return this.types}matchesType(t,s){let n=t.toLowerCase();for(let r of s){if(r==="all"){if(this.matchesAnyType(t))return!0;continue}let l=this.types.get(r);if(l){for(let i of l.extensions)if(n.endsWith(i))return!0;for(let i of l.globs)if(i.includes("*")){let o=i.replace(/\./g,"\\.").replace(/\*/g,".*");if(M(`^${o}$`,"i").test(t))return!0}else if(n===i.toLowerCase())return!0}}return!1}matchesAnyType(t){let s=t.toLowerCase();for(let n of this.types.values()){for(let r of n.extensions)if(s.endsWith(r))return!0;for(let r of n.globs)if(r.includes("*")){let l=r.replace(/\./g,"\\.").replace(/\*/g,".*");if(M(`^${l}$`,"i").test(t))return!0}else if(s===r.toLowerCase())return!0}return!1}};function V(){let e=[];for(let[t,s]of Object.entries(H).sort()){let n=[];for(let r of s.extensions)n.push(`*${r}`);for(let r of s.globs)n.push(r);e.push(`${t}: ${n.join(", ")}`)}return`${e.join(` -`)} -`}function Z(){return{ignoreCase:!1,caseSensitive:!1,smartCase:!0,fixedStrings:!1,wordRegexp:!1,lineRegexp:!1,invertMatch:!1,multiline:!1,multilineDotall:!1,patterns:[],patternFiles:[],count:!1,countMatches:!1,files:!1,filesWithMatches:!1,filesWithoutMatch:!1,stats:!1,onlyMatching:!1,maxCount:0,lineNumber:!0,noFilename:!1,withFilename:!1,nullSeparator:!1,byteOffset:!1,column:!1,vimgrep:!1,replace:null,afterContext:0,beforeContext:0,contextSeparator:"--",quiet:!1,heading:!1,passthru:!1,includeZero:!1,sort:"path",json:!1,globs:[],iglobs:[],globCaseInsensitive:!1,types:[],typesNot:[],typeAdd:[],typeClear:[],hidden:!1,noIgnore:!1,noIgnoreDot:!1,noIgnoreVcs:!1,ignoreFiles:[],maxDepth:256,maxFilesize:0,followSymlinks:!1,searchZip:!1,searchBinary:!1,preprocessor:null,preprocessorGlobs:[]}}function se(e){let t=e.match(/^(\d+)([KMG])?$/i);if(!t)return 0;let s=parseInt(t[1],10);switch((t[2]||"").toUpperCase()){case"K":return s*1024;case"M":return s*1024*1024;case"G":return s*1024*1024*1024;default:return s}}function ne(e){return/^\d+[KMG]?$/i.test(e)?null:{stdout:"",stderr:`rg: invalid --max-filesize value: ${e} -`,exitCode:1}}function J(e){return null}var Y=[{short:"g",long:"glob",target:"globs",multi:!0},{long:"iglob",target:"iglobs",multi:!0},{short:"t",long:"type",target:"types",multi:!0,validate:J},{short:"T",long:"type-not",target:"typesNot",multi:!0,validate:J},{long:"type-add",target:"typeAdd",multi:!0},{long:"type-clear",target:"typeClear",multi:!0},{short:"m",long:"max-count",target:"maxCount",parse:parseInt},{short:"e",long:"regexp",target:"patterns",multi:!0},{short:"f",long:"file",target:"patternFiles",multi:!0},{short:"r",long:"replace",target:"replace"},{short:"d",long:"max-depth",target:"maxDepth",parse:parseInt},{long:"max-filesize",target:"maxFilesize",parse:se,validate:ne},{long:"context-separator",target:"contextSeparator"},{short:"j",long:"threads",ignored:!0},{long:"ignore-file",target:"ignoreFiles",multi:!0},{long:"pre",target:"preprocessor"},{long:"pre-glob",target:"preprocessorGlobs",multi:!0}],re=new Map([["i",e=>{e.ignoreCase=!0,e.caseSensitive=!1,e.smartCase=!1}],["--ignore-case",e=>{e.ignoreCase=!0,e.caseSensitive=!1,e.smartCase=!1}],["s",e=>{e.caseSensitive=!0,e.ignoreCase=!1,e.smartCase=!1}],["--case-sensitive",e=>{e.caseSensitive=!0,e.ignoreCase=!1,e.smartCase=!1}],["S",e=>{e.smartCase=!0,e.ignoreCase=!1,e.caseSensitive=!1}],["--smart-case",e=>{e.smartCase=!0,e.ignoreCase=!1,e.caseSensitive=!1}],["F",e=>{e.fixedStrings=!0}],["--fixed-strings",e=>{e.fixedStrings=!0}],["w",e=>{e.wordRegexp=!0}],["--word-regexp",e=>{e.wordRegexp=!0}],["x",e=>{e.lineRegexp=!0}],["--line-regexp",e=>{e.lineRegexp=!0}],["v",e=>{e.invertMatch=!0}],["--invert-match",e=>{e.invertMatch=!0}],["U",e=>{e.multiline=!0}],["--multiline",e=>{e.multiline=!0}],["--multiline-dotall",e=>{e.multilineDotall=!0,e.multiline=!0}],["c",e=>{e.count=!0}],["--count",e=>{e.count=!0}],["--count-matches",e=>{e.countMatches=!0}],["l",e=>{e.filesWithMatches=!0}],["--files",e=>{e.files=!0}],["--files-with-matches",e=>{e.filesWithMatches=!0}],["--files-without-match",e=>{e.filesWithoutMatch=!0}],["--stats",e=>{e.stats=!0}],["o",e=>{e.onlyMatching=!0}],["--only-matching",e=>{e.onlyMatching=!0}],["q",e=>{e.quiet=!0}],["--quiet",e=>{e.quiet=!0}],["N",e=>{e.lineNumber=!1}],["--no-line-number",e=>{e.lineNumber=!1}],["H",e=>{e.withFilename=!0}],["--with-filename",e=>{e.withFilename=!0}],["I",e=>{e.noFilename=!0}],["--no-filename",e=>{e.noFilename=!0}],["0",e=>{e.nullSeparator=!0}],["--null",e=>{e.nullSeparator=!0}],["b",e=>{e.byteOffset=!0}],["--byte-offset",e=>{e.byteOffset=!0}],["--column",e=>{e.column=!0,e.lineNumber=!0}],["--no-column",e=>{e.column=!1}],["--vimgrep",e=>{e.vimgrep=!0,e.column=!0,e.lineNumber=!0}],["--json",e=>{e.json=!0}],["--hidden",e=>{e.hidden=!0}],["--no-ignore",e=>{e.noIgnore=!0}],["--no-ignore-dot",e=>{e.noIgnoreDot=!0}],["--no-ignore-vcs",e=>{e.noIgnoreVcs=!0}],["L",e=>{e.followSymlinks=!0}],["--follow",e=>{e.followSymlinks=!0}],["z",e=>{e.searchZip=!0}],["--search-zip",e=>{e.searchZip=!0}],["a",e=>{e.searchBinary=!0}],["--text",e=>{e.searchBinary=!0}],["--heading",e=>{e.heading=!0}],["--passthru",e=>{e.passthru=!0}],["--include-zero",e=>{e.includeZero=!0}],["--glob-case-insensitive",e=>{e.globCaseInsensitive=!0}]]),ie=new Set(["n","--line-number"]);function le(e){e.hidden?e.searchBinary=!0:e.noIgnore?e.hidden=!0:e.noIgnore=!0}function oe(e,t,s){let n=e[t];for(let r of Y){if(n.startsWith(`--${r.long}=`)){let l=n.slice(`--${r.long}=`.length),i=P(s,r,l);return i?{newIndex:t,error:i}:{newIndex:t}}if(r.short&&n.startsWith(`-${r.short}`)&&n.length>2){let l=n.slice(2),i=P(s,r,l);return i?{newIndex:t,error:i}:{newIndex:t}}if(r.short&&n===`-${r.short}`||n===`--${r.long}`){if(t+1>=e.length)return null;let l=e[t+1],i=P(s,r,l);return i?{newIndex:t+1,error:i}:{newIndex:t+1}}}return null}function ae(e){return Y.find(t=>t.short===e)}function P(e,t,s){if(t.validate){let r=t.validate(s);if(r)return r}if(t.ignored||!t.target)return;let n=t.parse?t.parse(s):s;t.multi?e[t.target].push(n):e[t.target]=n}function ce(e,t){let s=e[t];if(s==="--sort"&&t+1=e.length)return{success:!1,error:O("rg",`-${u}`)};let f=P(t,g,e[c+1]);if(f)return{success:!1,error:f};c++,m=!0;continue}}let w=re.get(u);if(w){w(t);continue}if(u.startsWith("--"))return{success:!1,error:O("rg",u)};if(u.length===1)return{success:!1,error:O("rg",`-${u}`)}}}else s===null&&t.patterns.length===0&&t.patternFiles.length===0?s=a:n.push(a)}return(r>=0||i>=0)&&(t.afterContext=Math.max(r>=0?r:0,i>=0?i:0)),(l>=0||i>=0)&&(t.beforeContext=Math.max(l>=0?l:0,i>=0?i:0)),s!==null&&t.patterns.push(s),(t.column||t.vimgrep)&&(o=!0),{success:!0,options:t,paths:n,explicitLineNumbers:o}}import{gunzipSync as he}from"node:zlib";var T=class{patterns=[];basePath;constructor(t="/"){this.basePath=t}parse(t){let s=t.split(` -`);for(let n of s){let r=n.replace(/\s+$/,"");if(!r||r.startsWith("#"))continue;let l=!1;r.startsWith("!")&&(l=!0,r=r.slice(1));let i=!1;r.endsWith("/")&&(i=!0,r=r.slice(0,-1));let o=!1;r.startsWith("/")?(o=!0,r=r.slice(1)):r.includes("/")&&!r.startsWith("**/")&&(o=!0);let c=this.patternToRegex(r,o);this.patterns.push({pattern:n,regex:c,negated:l,directoryOnly:i,rooted:o})}}patternToRegex(t,s){let n="";s?n="^":n="(?:^|/)";let r=0;for(;r=t.length,n+=".*",r+=2):(n+="[^/]*",r++);else if(l==="?")n+="[^/]",r++;else if(l==="["){let i=r+1;for(i=2&&e[0]===31&&e[1]===139}function pe(e){let t=!1;for(let s=0;sv.length>0);l.push(...d)}catch{return{stdout:"",stderr:`rg: ${g}: No such file or directory -`,exitCode:2}}if(l.length===0)return s.patternFiles.length>0?{stdout:"",stderr:"",exitCode:1}:{stdout:"",stderr:`rg: no pattern given -`,exitCode:2};let i=de(s,l),o,c;try{let g=me(l,s,i);o=g.regex,c=g.kResetGroup}catch{return{stdout:"",stderr:`rg: invalid regex: ${l.join(", ")} -`,exitCode:2}}let a=s.patternFiles.includes("-"),h=D(t.stdin);if(n.length===0&&h.length>0&&!a){let f=B(h,o,{invertMatch:s.invertMatch,showLineNumbers:s.lineNumber,countOnly:s.count,countMatches:s.countMatches,filename:"",onlyMatching:s.onlyMatching,beforeContext:s.beforeContext,afterContext:s.afterContext,maxCount:s.maxCount,contextSeparator:s.contextSeparator,showColumn:s.column,vimgrep:s.vimgrep,showByteOffset:s.byteOffset,replace:s.replace!==null?A(s.replace):null,passthru:s.passthru,multiline:s.multiline,kResetGroup:c});return s.quiet?{stdout:"",stderr:"",exitCode:f.matched?0:1}:s.filesWithMatches?{stdout:f.matched?`(standard input) -`:"",stderr:"",exitCode:f.matched?0:1}:s.filesWithoutMatch?{stdout:f.matched?"":`(standard input) -`,stderr:"",exitCode:f.matched?1:0}:{stdout:f.output,stderr:"",exitCode:f.matched?0:1}}let y=n.length===0?["."]:n,x=null;s.noIgnore||(x=await R(t.fs,t.cwd,s.noIgnoreDot,s.noIgnoreVcs,s.ignoreFiles));let p=new $;for(let g of s.typeClear)p.clearType(g);for(let g of s.typeAdd)p.addType(g);let{files:b,singleExplicitFile:m}=await Q(t,y,s,x,p);if(b.length===0)return{stdout:"",stderr:"",exitCode:1};let u=!s.noFilename&&(s.withFilename||!m||b.length>1),w=s.lineNumber;return r||(m&&b.length===1&&(w=!1),s.onlyMatching&&(w=!1)),we(t,b,o,s,u,w,c)}function de(e,t){return e.caseSensitive?!1:e.ignoreCase?!0:e.smartCase?!t.some(s=>/[A-Z]/.test(s)):!1}function me(e,t,s){let n;return e.length===1?n=e[0]:n=e.map(r=>t.fixedStrings?r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"):`(?:${r})`).join("|"),U(n,{mode:t.fixedStrings&&e.length===1?"fixed":"perl",ignoreCase:s,wholeWord:t.wordRegexp,lineRegexp:t.lineRegexp,multiline:t.multiline,multilineDotall:t.multilineDotall})}async function Q(e,t,s,n,r){let l=[],i=0,o=0;for(let a of t){let h=e.fs.resolvePath(e.cwd,a);try{let y=await e.fs.stat(h);if(y.isFile){if(i++,s.maxFilesize>0&&y.size>s.maxFilesize)continue;te(a,s,n,h,r)&&l.push(a)}else y.isDirectory&&(o++,await ee(e,a,h,0,s,n,r,l))}catch{}}return{files:s.sort==="path"?l.sort():l,singleExplicitFile:i===1&&o===0}}async function ee(e,t,s,n,r,l,i,o){if(!(n>=r.maxDepth)){l&&await l.loadForDirectory(s);try{let c=e.fs.readdirWithFileTypes?await e.fs.readdirWithFileTypes(s):(await e.fs.readdir(s)).map(a=>({name:a,isFile:void 0}));for(let a of c){let h=a.name;if(!r.noIgnore&&N.isCommonIgnored(h))continue;let y=h.startsWith("."),x=t==="."?h:t==="./"?`./${h}`:t.endsWith("/")?`${t}${h}`:`${t}/${h}`,p=e.fs.resolvePath(s,h),b,m,u=!1;if(a.isFile!==void 0&&"isDirectory"in a){let f=a;if(u=f.isSymbolicLink===!0,u&&!r.followSymlinks)continue;if(u&&r.followSymlinks)try{let d=await e.fs.stat(p);b=d.isFile,m=d.isDirectory}catch{continue}else b=f.isFile,m=f.isDirectory}else try{let f=e.fs.lstat?await e.fs.lstat(p):await e.fs.stat(p);if(u=f.isSymbolicLink===!0,u&&!r.followSymlinks)continue;let d=u&&r.followSymlinks?await e.fs.stat(p):f;b=d.isFile,m=d.isDirectory}catch{continue}if(!l?.matches(p,m)&&!(y&&!r.hidden&&!l?.isWhitelisted(p,m))){if(m)await ee(e,x,p,n+1,r,l,i,o);else if(b){if(r.maxFilesize>0)try{if((await e.fs.stat(p)).size>r.maxFilesize)continue}catch{continue}te(x,r,l,p,i)&&o.push(x)}}}}catch{}}}function te(e,t,s,n,r){let l=e.split("/").pop()||e;if(s?.matches(n,!1)||t.types.length>0&&!r.matchesType(l,t.types)||t.typesNot.length>0&&r.matchesType(l,t.typesNot))return!1;if(t.globs.length>0){let i=t.globCaseInsensitive,o=t.globs.filter(a=>!a.startsWith("!")),c=t.globs.filter(a=>a.startsWith("!")).map(a=>a.slice(1));if(o.length>0){let a=!1;for(let h of o)if(C(l,h,i)||C(e,h,i)){a=!0;break}if(!a)return!1}for(let a of c)if(a.startsWith("/")){let h=a.slice(1);if(C(e,h,i))return!1}else if(C(l,a,i)||C(e,a,i))return!1}if(t.iglobs.length>0){let i=t.iglobs.filter(c=>!c.startsWith("!")),o=t.iglobs.filter(c=>c.startsWith("!")).map(c=>c.slice(1));if(i.length>0){let c=!1;for(let a of i)if(C(l,a,!0)||C(e,a,!0)){c=!0;break}if(!c)return!1}for(let c of o)if(c.startsWith("/")){let a=c.slice(1);if(C(e,a,!0))return!1}else if(C(l,c,!0)||C(e,c,!0))return!1}return!0}function C(e,t,s=!1){let n="^";for(let r=0;ra+o).join(""),stderr:"",exitCode:0}}function ye(e,t){if(t.length===0)return!0;for(let s of t)if(C(e,s,!1))return!0;return!1}async function be(e,t,s,n){try{if(n.preprocessor&&e.exec){let i=s.split("/").pop()||s;if(ye(i,n.preprocessorGlobs)){let o=await e.exec(q([n.preprocessor]),{cwd:e.cwd,signal:e.signal,args:[t]});if(o.exitCode===0&&o.stdout){let c=D(o.stdout),a=c.slice(0,8192);return{content:c,isBinary:a.includes("\0")}}}}if(n.searchZip&&s.endsWith(".gz")){let i=await e.fs.readFileBuffer(t);if(ge(i))try{let o=he(i),c=new TextDecoder().decode(o),a=c.slice(0,8192);return{content:c,isBinary:a.includes("\0")}}catch{return null}}let r=await e.fs.readFile(t),l=r.slice(0,8192);return{content:r,isBinary:l.includes("\0")}}catch{return null}}async function we(e,t,s,n,r,l,i){let o="",c=!1,a=[],h=0,y=0,x=0,p=50;e:for(let u=0;u{let d=e.fs.resolvePath(e.cwd,f),v=await be(e,d,f,n);if(!v)return null;let{content:F,isBinary:W}=v;if(x+=F.length,W&&!n.searchBinary)return null;let k=r&&!n.heading?f:"",I=B(F,s,{invertMatch:n.invertMatch,showLineNumbers:l,countOnly:n.count,countMatches:n.countMatches,filename:k,onlyMatching:n.onlyMatching,beforeContext:n.beforeContext,afterContext:n.afterContext,maxCount:n.maxCount,contextSeparator:n.contextSeparator,showColumn:n.column,vimgrep:n.vimgrep,showByteOffset:n.byteOffset,replace:n.replace!==null?A(n.replace):null,passthru:n.passthru,multiline:n.multiline,kResetGroup:i});return n.json&&I.matched?{file:f,result:I,content:F,isBinary:!1}:{file:f,result:I}}));for(let f of g){if(!f)continue;let{file:d,result:v}=f;if(v.matched){if(c=!0,y++,h+=v.matchCount,n.quiet&&!n.json)break e;if(n.json&&!n.quiet){let F=f.content||"";a.push(JSON.stringify({type:"begin",data:{path:{text:d}}}));let W=F.split(` -`);s.lastIndex=0;let k=0;for(let I=0;I0){let S={type:"match",data:{path:{text:d},lines:{text:`${j} -`},line_number:I+1,absolute_offset:k,submatches:L}};a.push(JSON.stringify(S))}k+=j.length+1}a.push(JSON.stringify({type:"end",data:{path:{text:d},binary_offset:null,stats:{elapsed:{secs:0,nanos:0,human:"0s"},searches:1,searches_with_match:1,bytes_searched:F.length,bytes_printed:0,matched_lines:v.matchCount,matches:v.matchCount}}}))}else if(n.filesWithMatches){let F=n.nullSeparator?"\0":` -`;o+=`${d}${F}`}else n.filesWithoutMatch||(n.heading&&!n.noFilename&&(o+=`${d} -`),o+=v.output)}else if(n.filesWithoutMatch){let F=n.nullSeparator?"\0":` -`;o+=`${d}${F}`}else n.includeZero&&(n.count||n.countMatches)&&(o+=v.output)}}n.json&&(a.push(JSON.stringify({type:"summary",data:{elapsed_total:{secs:0,nanos:0,human:"0s"},stats:{elapsed:{secs:0,nanos:0,human:"0s"},searches:t.length,searches_with_match:y,bytes_searched:x,bytes_printed:0,matched_lines:h,matches:h}}})),o=`${a.join(` -`)} -`);let b=n.quiet&&!n.json?"":o;if(n.stats&&!n.json){let u=["",`${h} matches`,`${h} matched lines`,`${y} files contained matches`,`${t.length} files searched`,`${x} bytes searched`].join(` -`);b+=`${u} -`}let m;return n.filesWithoutMatch?m=o.length>0?0:1:m=c?0:1,{stdout:b,stderr:"",exitCode:m}}var ve={name:"rg",summary:"recursively search for a pattern",usage:"rg [OPTIONS] PATTERN [PATH ...]",description:`rg (ripgrep) recursively searches directories for a regex pattern. -Unlike grep, rg is recursive by default and respects .gitignore files. - -EXAMPLES: - rg foo Search for 'foo' in current directory - rg foo src/ Search in src/ directory - rg -i foo Case-insensitive search - rg -w foo Match whole words only - rg -t js foo Search only JavaScript files - rg -g '*.ts' foo Search files matching glob - rg --hidden foo Include hidden files - rg -l foo List files with matches only`,options:["-e, --regexp PATTERN search for PATTERN (can be used multiple times)","-f, --file FILE read patterns from FILE, one per line","-i, --ignore-case case-insensitive search","-s, --case-sensitive case-sensitive search (overrides smart-case)","-S, --smart-case smart case (default: case-insensitive unless pattern has uppercase)","-F, --fixed-strings treat pattern as literal string","-w, --word-regexp match whole words only","-x, --line-regexp match whole lines only","-v, --invert-match select non-matching lines","-r, --replace TEXT replace matches with TEXT","-c, --count print count of matching lines per file"," --count-matches print count of individual matches per file","-l, --files-with-matches print only file names with matches"," --files-without-match print file names without matches"," --files list files that would be searched","-o, --only-matching print only matching parts","-m, --max-count NUM stop after NUM matches per file","-q, --quiet suppress output, exit 0 on match"," --stats print search statistics","-n, --line-number print line numbers (default: on)","-N, --no-line-number do not print line numbers","-I, --no-filename suppress the prefixing of file names","-0, --null use NUL as filename separator","-b, --byte-offset show byte offset of each match"," --column show column number of first match"," --vimgrep show results in vimgrep format"," --json show results in JSON Lines format","-A NUM print NUM lines after each match","-B NUM print NUM lines before each match","-C NUM print NUM lines before and after each match"," --context-separator SEP separator for context groups (default: --)","-U, --multiline match patterns across lines","-z, --search-zip search in compressed files (gzip only)","-g, --glob GLOB include files matching GLOB","-t, --type TYPE only search files of TYPE (e.g., js, py, ts)","-T, --type-not TYPE exclude files of TYPE","-L, --follow follow symbolic links","-u, --unrestricted reduce filtering (-u: no ignore, -uu: +hidden, -uuu: +binary)","-a, --text search binary files as text"," --hidden search hidden files and directories"," --no-ignore don't respect .gitignore/.ignore files","-d, --max-depth NUM maximum search depth"," --sort TYPE sort files (path, none)"," --heading show file path above matches"," --passthru print all lines (non-matches use - separator)"," --include-zero include files with 0 matches in count output"," --type-list list all available file types"," --help display this help and exit"]},Ge={name:"rg",async execute(e,t){if(E(e))return z(ve);if(e.includes("--type-list"))return{stdout:V(),stderr:"",exitCode:0};let s=K(e);return s.success?X({ctx:t,options:s.options,paths:s.paths,explicitLineNumbers:s.explicitLineNumbers}):s.error}},qe={name:"rg",flags:[{flag:"-i",type:"boolean"},{flag:"-s",type:"boolean"},{flag:"-S",type:"boolean"},{flag:"-F",type:"boolean"},{flag:"-w",type:"boolean"},{flag:"-x",type:"boolean"},{flag:"-v",type:"boolean"},{flag:"-c",type:"boolean"},{flag:"-l",type:"boolean"},{flag:"-o",type:"boolean"},{flag:"-n",type:"boolean"},{flag:"-N",type:"boolean"},{flag:"--hidden",type:"boolean"},{flag:"--no-ignore",type:"boolean"},{flag:"-m",type:"value",valueHint:"number"},{flag:"-A",type:"value",valueHint:"number"},{flag:"-B",type:"value",valueHint:"number"},{flag:"-C",type:"value",valueHint:"number"},{flag:"-g",type:"value",valueHint:"pattern"},{flag:"-t",type:"value",valueHint:"string"},{flag:"-T",type:"value",valueHint:"string"}],needsArgs:!0};export{Ge as a,qe as b}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-JTMQLUCH.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-JTMQLUCH.js deleted file mode 100644 index b455fad..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-JTMQLUCH.js +++ /dev/null @@ -1,16 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{b as O}from"./chunk-KTPCYKBB.js";import{c as F}from"./chunk-XEKXHOPO.js";import{a as N,b as w,c as k}from"./chunk-QAYAQNCG.js";var P=new Map([["",1],["k",1024],["m",1048576],["g",1073741824],["t",1099511627776],["p",0x4000000000000],["e",1152921504606847e3]]),D=new Map([["jan",1],["feb",2],["mar",3],["apr",4],["may",5],["jun",6],["jul",7],["aug",8],["sep",9],["oct",10],["nov",11],["dec",12]]);function x(u){let r=u.trim(),e=r.match(/^([+-]?\d*\.?\d+)\s*([kmgtpeKMGTPE])?[iI]?[bB]?$/);if(!e){let n=parseFloat(r);return Number.isNaN(n)?0:n}let l=parseFloat(e[1]),s=(e[2]||"").toLowerCase(),i=P.get(s)??1;return l*i}function M(u){let r=u.trim().toLowerCase().slice(0,3);return D.get(r)??0}function q(u,r){let e=u.split(/(\d+)/),l=r.split(/(\d+)/),s=Math.max(e.length,l.length);for(let i=0;i=s.length)return"";if(r.endField===void 0){let o=s[i]||"";return r.startChar!==void 0&&(o=o.slice(r.startChar-1)),r.ignoreLeading&&(o=o.trimStart()),o}let n=Math.min(r.endField-1,s.length-1),d="";for(let o=i;o<=n&&oi&&(d+=e||" "),d+=c}return r.ignoreLeading&&(d=d.trimStart()),d}function I(u,r,e){let l=u,s=r;if(e.dictionaryOrder&&(l=L(l),s=L(s)),e.ignoreCase&&(l=l.toLowerCase(),s=s.toLowerCase()),e.monthSort){let i=M(l),n=M(s);return i-n}if(e.humanNumeric){let i=x(l),n=x(s);return i-n}if(e.versionSort)return q(l,s);if(e.numeric){let i=parseFloat(l)||0,n=parseFloat(s)||0;return i-n}return l.localeCompare(s)}function B(u){let{keys:r,fieldDelimiter:e,numeric:l,ignoreCase:s,reverse:i,humanNumeric:n,versionSort:d,dictionaryOrder:o,monthSort:c,ignoreLeadingBlanks:t,stable:a}=u;return(f,C)=>{let g=f,b=C;if(t&&(g=g.trimStart(),b=b.trimStart()),r.length===0){let h=I(g,b,{numeric:l,ignoreCase:s,humanNumeric:n,versionSort:d,dictionaryOrder:o,monthSort:c});if(h!==0)return i?-h:h;if(!a){let p=f.localeCompare(C);return i?-p:p}return 0}for(let m of r){let h=v(g,m,e),p=v(b,m,e);m.ignoreLeading&&(h=h.trimStart(),p=p.trimStart());let V={numeric:m.numeric??l,ignoreCase:m.ignoreCase??s,humanNumeric:m.humanNumeric??n,versionSort:m.versionSort??d,dictionaryOrder:m.dictionaryOrder??o,monthSort:m.monthSort??c},A=m.reverse??i,S=I(h,p,V);if(S!==0)return A?-S:S}if(!a){let m=f.localeCompare(C);return i?-m:m}return 0}}function E(u,r){if(r.keys.length===0){if(r.ignoreCase){let s=new Set;return u.filter(i=>{let n=i.toLowerCase();return s.has(n)?!1:(s.add(n),!0)})}return[...new Set(u)]}let e=r.keys[0],l=new Set;return u.filter(s=>{let i=v(s,e,r.fieldDelimiter);return(e.ignoreCase??r.ignoreCase)&&(i=i.toLowerCase()),l.has(i)?!1:(l.add(i),!0)})}function y(u){let r={startField:1},e="",l=u,s=l.match(/([bdfhMnrV]+)$/);s&&(e=s[1],l=l.slice(0,-e.length)),e.includes("n")&&(r.numeric=!0),e.includes("r")&&(r.reverse=!0),e.includes("f")&&(r.ignoreCase=!0),e.includes("b")&&(r.ignoreLeading=!0),e.includes("h")&&(r.humanNumeric=!0),e.includes("V")&&(r.versionSort=!0),e.includes("d")&&(r.dictionaryOrder=!0),e.includes("M")&&(r.monthSort=!0);let i=l.split(",");if(i.length===0||i[0]==="")return null;let n=i[0].split("."),d=parseInt(n[0],10);if(Number.isNaN(d)||d<1)return null;if(r.startField=d,n.length>1&&n[1]){let o=parseInt(n[1],10);!Number.isNaN(o)&&o>=1&&(r.startChar=o)}if(i.length>1&&i[1]){let o=i[1],c=o.match(/([bdfhMnrV]+)$/);if(c){let a=c[1];a.includes("n")&&(r.numeric=!0),a.includes("r")&&(r.reverse=!0),a.includes("f")&&(r.ignoreCase=!0),a.includes("b")&&(r.ignoreLeading=!0),a.includes("h")&&(r.humanNumeric=!0),a.includes("V")&&(r.versionSort=!0),a.includes("d")&&(r.dictionaryOrder=!0),a.includes("M")&&(r.monthSort=!0),o=o.slice(0,-a.length)}let t=o.split(".");if(t[0]){let a=parseInt(t[0],10);if(!Number.isNaN(a)&&a>=1&&(r.endField=a),t.length>1&&t[1]){let f=parseInt(t[1],10);!Number.isNaN(f)&&f>=1&&(r.endChar=f)}}}return r}var H={name:"sort",summary:"sort lines of text files",usage:"sort [OPTION]... [FILE]...",options:["-b, --ignore-leading-blanks ignore leading blanks","-d, --dictionary-order consider only blanks and alphanumeric characters","-f, --ignore-case fold lower case to upper case characters","-h, --human-numeric-sort compare human readable numbers (e.g., 2K 1G)","-M, --month-sort compare (unknown) < 'JAN' < ... < 'DEC'","-n, --numeric-sort compare according to string numerical value","-r, --reverse reverse the result of comparisons","-V, --version-sort natural sort of (version) numbers within text","-c, --check check for sorted input; do not sort","-o, --output=FILE write result to FILE instead of stdout","-s, --stable stabilize sort by disabling last-resort comparison","-u, --unique output only unique lines","-k, --key=KEYDEF sort via a key; KEYDEF gives location and type","-t, --field-separator=SEP use SEP as field separator"," --help display this help and exit"],description:`KEYDEF is F[.C][OPTS][,F[.C][OPTS]] - F is a field number (1-indexed) - C is a character position within the field (1-indexed) - OPTS can be: b d f h M n r V (per-key modifiers) - -Examples: - -k1 sort by first field - -k2,2 sort by second field only - -k1.3 sort by first field starting at 3rd character - -k1,2n sort by fields 1-2 numerically - -k2 -k1 sort by field 2, then by field 1`},R={name:"sort",async execute(u,r){if(w(u))return N(H);let e={reverse:!1,numeric:!1,unique:!1,ignoreCase:!1,humanNumeric:!1,versionSort:!1,dictionaryOrder:!1,monthSort:!1,ignoreLeadingBlanks:!1,stable:!1,checkOnly:!1,outputFile:null,keys:[],fieldDelimiter:null},l=[];for(let c=0;c0&&n[n.length-1]===""&&n.pop();let d=B(e);if(e.checkOnly){let c=l.length>0?l[0]:"-";for(let t=1;t0)return{stdout:"",stderr:`sort: ${c}:${t+1}: disorder: ${n[t]} -`,exitCode:1};return{stdout:"",stderr:"",exitCode:0}}n.sort(d),e.unique&&(n=E(n,e));let o=n.length>0?`${n.join(` -`)} -`:"";if(e.outputFile){let c=r.fs.resolvePath(r.cwd,e.outputFile);return await r.fs.writeFile(c,o),{stdout:"",stderr:"",exitCode:0}}return{stdout:o,stderr:"",exitCode:0}}},Y={name:"sort",flags:[{flag:"-r",type:"boolean"},{flag:"-n",type:"boolean"},{flag:"-u",type:"boolean"},{flag:"-f",type:"boolean"},{flag:"-h",type:"boolean"},{flag:"-V",type:"boolean"},{flag:"-d",type:"boolean"},{flag:"-M",type:"boolean"},{flag:"-b",type:"boolean"},{flag:"-s",type:"boolean"},{flag:"-c",type:"boolean"},{flag:"-k",type:"value",valueHint:"string"},{flag:"-t",type:"value",valueHint:"delimiter"},{flag:"-o",type:"value",valueHint:"path"}],stdinType:"text",needsFiles:!0};export{R as a,Y as b}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-K5JMLDHX.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-K5JMLDHX.js deleted file mode 100644 index 9658971..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-K5JMLDHX.js +++ /dev/null @@ -1,13 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{c as g}from"./chunk-XEKXHOPO.js";import{a as y,b as $,c as F}from"./chunk-QAYAQNCG.js";var b={name:"comm",summary:"compare two sorted files line by line",usage:"comm [OPTION]... FILE1 FILE2",options:["-1 suppress column 1 (lines unique to FILE1)","-2 suppress column 2 (lines unique to FILE2)","-3 suppress column 3 (lines that appear in both files)"," --help display this help and exit"]},E={name:"comm",async execute(m,a){if($(m))return y(b);let r=!1,l=!1,f=!1,i=[];for(let e of m)if(e==="-1")r=!0;else if(e==="-2")l=!0;else if(e==="-3")f=!0;else if(e==="-12"||e==="-21")r=!0,l=!0;else if(e==="-13"||e==="-31")r=!0,f=!0;else if(e==="-23"||e==="-32")l=!0,f=!0;else if(e==="-123"||e==="-132"||e==="-213"||e==="-231"||e==="-312"||e==="-321")r=!0,l=!0,f=!0;else{if(e.startsWith("-")&&e!=="-")return F("comm",e);i.push(e)}if(i.length!==2)return{stdout:"",stderr:`comm: missing operand -Try 'comm --help' for more information. -`,exitCode:1};let p=async e=>{if(e==="-")return g(a.stdin);try{let x=a.fs.resolvePath(a.cwd,e);return await a.fs.readFile(x)}catch{return null}},c=await p(i[0]);if(c===null)return{stdout:"",stderr:`comm: ${i[0]}: No such file or directory -`,exitCode:1};let d=await p(i[1]);if(d===null)return{stdout:"",stderr:`comm: ${i[1]}: No such file or directory -`,exitCode:1};let t=c.split(` -`),s=d.split(` -`);t.length>0&&t[t.length-1]===""&&t.pop(),s.length>0&&s[s.length-1]===""&&s.pop();let n=0,o=0,u="",h=r?"":" ",w=(r?"":" ")+(l?"":" ");for(;n=t.length?(l||(u+=`${h}${s[o]} -`),o++):o>=s.length?(r||(u+=`${t[n]} -`),n++):t[n]s[o]?(l||(u+=`${h}${s[o]} -`),o++):(f||(u+=`${w}${t[n]} -`),n++,o++);return{stdout:u,stderr:"",exitCode:0}}},L={name:"comm",flags:[{flag:"-1",type:"boolean"},{flag:"-2",type:"boolean"},{flag:"-3",type:"boolean"}],needsArgs:!0,minArgs:2};export{E as a,L as b}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-KAPG5ONA.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-KAPG5ONA.js deleted file mode 100644 index 30b8d21..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-KAPG5ONA.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a as s,b as i}from"./chunk-VACKIICN.js";function a(t,e,n){if(!t||i.isInSandboxedContext())return;let r=`${e} ${n} attempted outside defense context`;throw new s(r,{timestamp:Date.now(),type:"missing_defense_context",message:r,path:"DefenseInDepthBox.context",stack:new Error().stack,executionId:i.getCurrentExecutionId()})}async function x(t,e,n,r){a(t,e,`${n} (pre-await)`);let o=await r();return a(t,e,`${n} (post-await)`),o}function d(t,e,n,r){let o=((...c)=>(a(t,e,n),r(...c)));return t?i.bindCurrentContext(o):o}export{a,x as b,d as c}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-KSBHIW2H.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-KSBHIW2H.js deleted file mode 100644 index 41d534c..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-KSBHIW2H.js +++ /dev/null @@ -1,19 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a as B}from"./chunk-7CSMHFIJ.js";function T(t,n){let e=t.ignoreCase?n.toLowerCase():n,i=t.needles;for(let l=0;l]+)>)/g,(e,i,l)=>{if(i==="&")return n[0];if(l!==void 0)return n.groups?.[l]??"";let s=parseInt(i,10);return n[s]??""})}function Q(t,n,e={}){let{invertMatch:i=!1,showLineNumbers:l=!1,countOnly:s=!1,countMatches:a=!1,filename:r="",onlyMatching:x=!1,beforeContext:S=0,afterContext:P=0,maxCount:k=0,contextSeparator:W="--",showColumn:z=!1,vimgrep:N=!1,showByteOffset:v=!1,replace:A=null,passthru:G=!1,multiline:F=!1,kResetGroup:R,preFilter:C}=e;if(F)return X(t,n,{invertMatch:i,showLineNumbers:l,countOnly:s,countMatches:a,filename:r,onlyMatching:x,beforeContext:S,afterContext:P,maxCount:k,contextSeparator:W,showColumn:z,showByteOffset:v,replace:A,kResetGroup:R,preFilter:C});let L=t.split(` -`),O=L.length,Z=O>0&&L[O-1]===""?O-1:O;if(s||a){let h=0,d=(a||x)&&!i;for(let f=0;f0,matchCount:h}}if(S===0&&P===0&&!G){let h=[],d=!1,o=0,f=0;for(let u=0;u0&&o>=k);u++){let m=L[u],M=null;if(C&&!T(C,m)||(n.lastIndex=0,M=n.exec(m)),M!==null!==i)if(d=!0,o++,x)for(let $=M;$!==null;$=n.exec(m)){let y=R!==void 0?$[R]??"":$[0],j=A!==null?D(A,$):y,g=r?`${r}:`:"";v&&(g+=`${f+$.index}:`),l&&(g+=`${u+1}:`),z&&(g+=`${$.index+1}:`),h.push(g+j),$[0].length===0&&n.lastIndex++}else if(N)for(let $=M;$!==null;$=n.exec(m)){let y=r?`${r}:`:"";v&&(y+=`${f+$.index}:`),l&&(y+=`${u+1}:`),z&&(y+=`${$.index+1}:`),h.push(y+m),$[0].length===0&&n.lastIndex++}else{let $=M?M.index+1:1,y=m;A!==null&&(n.lastIndex=0,y=n.replace(m,(...g)=>{if(g[0].length===0)return"";let E=g,_=g[g.length-1];return typeof _=="object"&&_!==null?(E.groups=_,E.input=g[g.length-2],E.index=g[g.length-3]):(E.input=g[g.length-1],E.index=g[g.length-2]),D(A,E)}));let j=r?`${r}:`:"";v&&(j+=`${f+(M?M.index:0)}:`),l&&(j+=`${u+1}:`),z&&(j+=`${$}:`),h.push(j+y)}f+=m.length+1}return{output:h.length>0?`${h.join(` -`)} -`:"",matched:d,matchCount:o}}if(G){let h=[],d=!1,o=0;for(let f=0;f0?`${h.join(` -`)} -`:"",matched:d,matchCount:o}}let p=[],I=0,w=new Set,b=-1,c=[];for(let h=0;h0&&I>=k);h++){let d=L[h],o;C&&!T(C,d)?o=!1:(n.lastIndex=0,o=n.test(d)),o!==i&&(c.push(h),I++)}for(let h of c){let d=Math.max(0,h-S);b>=0&&d>b+1&&p.push(W);for(let f=d;f0?`${p.join(` -`)} -`:"",matched:I>0,matchCount:I}}function X(t,n,e){let{invertMatch:i,showLineNumbers:l,countOnly:s,countMatches:a,filename:r,onlyMatching:x,beforeContext:S,afterContext:P,maxCount:k,contextSeparator:W,showColumn:z,showByteOffset:N,replace:v,kResetGroup:A,preFilter:G}=e;if(G&&!i&&!T(G,t))return s||a?{output:`${r?`${r}:0`:"0"} -`,matched:!1,matchCount:0}:{output:"",matched:!1,matchCount:0};let F=t.split(` -`),R=F.length,C=R>0&&F[R-1]===""?R-1:R,L=[0];for(let c=0;c{let h=0;for(let d=0;dc);d++)h=d;return h},Z=c=>{let h=O(c);return c-L[h]+1},p=[];n.lastIndex=0;for(let c=n.exec(t);c!==null&&!(k>0&&p.length>=k);c=n.exec(t)){let h=O(c.index),d=O(c.index+Math.max(0,c[0].length-1)),o=A!==void 0?c[A]??"":c[0];p.push({startLine:h,endLine:d,byteOffset:c.index,column:Z(c.index),matchText:o}),c[0].length===0&&n.lastIndex++}if(s||a){let c;if(a)c=i?0:p.length;else{let d=new Set;for(let o of p)for(let f=o.startLine;f<=o.endLine;f++)d.add(f);c=i?C-d.size:d.size}return{output:`${r?`${r}:${c}`:String(c)} -`,matched:c>0,matchCount:c}}if(i){let c=new Set;for(let d of p)for(let o=d.startLine;o<=d.endLine;o++)c.add(o);let h=[];for(let d=0;d0?`${h.join(` -`)} -`:"",matched:h.length>0,matchCount:h.length}}if(p.length===0)return{output:"",matched:!1,matchCount:0};let I=new Set,w=-1,b=[];for(let c of p){let h=Math.max(0,c.startLine-S),d=Math.min(C-1,c.endLine+P);w>=0&&h>w+1&&b.push(W);for(let o=h;o0?`${b.join(` -`)} -`:"",matched:!0,matchCount:p.length}}var q=new Map([["alpha","a-zA-Z"],["digit","0-9"],["alnum","a-zA-Z0-9"],["lower","a-z"],["upper","A-Z"],["xdigit","0-9A-Fa-f"],["space"," \\t\\n\\r\\f\\v"],["blank"," \\t"],["punct","!-/:-@\\[-`{-~"],["graph","!-~"],["print"," -~"],["cntrl","\\x00-\\x1F\\x7F"],["ascii","\\x00-\\x7F"],["word","a-zA-Z0-9_"]]);function K(t){let n="",e=0;for(;e:]]"){n+="\\b",e+=7;continue}if(t[e]==="["){let i="[";for(e++,e]+)>/g,"(?<$1>"),n.mode==="perl"){e=ee(e),e=te(e),e=ne(e);let r=oe(e);e=r.pattern,i=r.kResetGroup}break}default:e=K(t),e=he(e);break}n.wholeWord&&(e=`\\b(?:${e})\\b`),n.lineRegexp&&(e=`^${e}$`);let l=/\\u\{[0-9A-Fa-f]+\}/.test(e),s="g"+(n.ignoreCase?"i":"")+(n.multiline?"m":"")+(n.multilineDotall?"s":"")+(l?"u":""),a=J(e,n.ignoreCase??!1);return{regex:B(e,s),kResetGroup:i,preFilter:a??void 0}}function J(t,n){let e=t;if(e.startsWith("\\b(?:")&&e.endsWith(")\\b")?e=e.slice(5,e.length-3):e.startsWith("\\b")&&e.endsWith("\\b")&&e.length>=4&&(e=e.slice(2,e.length-2)),e.length===0)return null;let i=V(e);if(i===null)return null;let l=[];for(let s of i){let a=Y(s);if(a===null||a.length===0)return null;l.push(a)}return l.length===0?null:{needles:n?l.map(s=>s.toLowerCase()):l,ignoreCase:n}}function V(t){let n=[],e=0,i=!1,l=0;for(let s=0;s=0&&n[l]==="\\";l--)i++;i%2===0&&(n=n.slice(0,-1))}if(n.length===0)return null;let e="";for(let i=0;i0&&e+1=0&&t[i]==="\\";)e++,i--;if(e%2===0)return n}n+=2}else n++;return-1}function ce(t){let n=0,e=0;for(;e"),n=n.replace(/\$([a-zA-Z_][a-zA-Z0-9_]*)(?![>0-9])/g,"$$<$1>"),n}function he(t){let n="",e=0,i=!0,l=0;for(;e0&&i[0]!=="-"){let t=i[0].startsWith("/")?i[0]:`${u.cwd}/${i[0]}`;try{p=await m(u.fs,t)}catch{return{stdout:"",stderr:`od: ${i[0]}: No such file or directory -`,exitCode:1}}}let d=r.includes("char");function y(t){return t===0?" \\0":t===7?" \\a":t===8?" \\b":t===9?" \\t":t===10?" \\n":t===11?" \\v":t===12?" \\f":t===13?" \\r":t>=32&&t<127?` ${String.fromCharCode(t)}`:` ${t.toString(8).padStart(3,"0")}`}function S(t){return d?` ${t.toString(16).padStart(2,"0")}`:` ${t.toString(16).padStart(2,"0")}`}function x(t){return` ${t.toString(8).padStart(3,"0")}`}let s=[];for(let t of p)s.push(t.charCodeAt(0));let c=16,f=[];for(let t=0;t0||a==="none")&&(h=a==="none"?"":" "),f.push(h+l.join(""))}}return a!=="none"&&s.length>0&&f.push(s.length.toString(8).padStart(7,"0")),{stdout:f.length>0?`${f.join(` -`)} -`:"",stderr:"",exitCode:0}}var F={name:"od",execute:$},A={name:"od",flags:[{flag:"-c",type:"boolean"},{flag:"-A",type:"value",valueHint:"string"},{flag:"-t",type:"value",valueHint:"string"},{flag:"-N",type:"value",valueHint:"number"}],stdinType:"text",needsFiles:!0};export{F as a,A as b}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-KTPCYKBB.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-KTPCYKBB.js deleted file mode 100644 index c656b2f..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-KTPCYKBB.js +++ /dev/null @@ -1,3 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{e as u,f as m}from"./chunk-XEKXHOPO.js";async function w(t,n,s){let{cmdName:r,allowStdinMarker:d=!0,stopOnError:i=!1,batchSize:f=100}=s;if(n.length===0)return{files:[{filename:"",content:t.stdin}],stderr:"",exitCode:0};let a=[],c="",l=0;for(let o=0;o{if(d&&e==="-")return{filename:"-",content:t.stdin,error:null};try{let C=t.fs.resolvePath(t.cwd,e),y=await m(t.fs,C);return{filename:e,content:y,error:null}}catch{return{filename:e,content:u,error:`${r}: ${e}: No such file or directory -`}}}));for(let e of p)if(e.error){if(c+=e.error,l=1,i)return{files:a,stderr:c,exitCode:l}}else a.push({filename:e.filename,content:e.content})}return{files:a,stderr:c,exitCode:l}}async function T(t,n,s){let r=await w(t,n,{...s,stopOnError:!0});return r.exitCode!==0?{ok:!1,error:{stdout:"",stderr:r.stderr,exitCode:r.exitCode}}:{ok:!0,content:r.files.map(i=>i.content).join("")}}export{w as a,T as b}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-KWGBQNTV.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-KWGBQNTV.js deleted file mode 100644 index b115569..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-KWGBQNTV.js +++ /dev/null @@ -1,32 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a as $}from"./chunk-QIQMJJZ4.js";import{a as z,b as w}from"./chunk-QAYAQNCG.js";import{constants as x,gunzipSync as F,gzipSync as S}from"node:zlib";var O={name:"gzip",summary:"compress or expand files",usage:"gzip [OPTION]... [FILE]...",description:`Compress FILEs (by default, in-place). - -When no FILE is given, or when FILE is -, read from standard input. - -With -d, decompress instead.`,options:["-c, --stdout write to standard output, keep original files","-d, --decompress decompress","-f, --force force overwrite of output file","-k, --keep keep (don't delete) input files","-l, --list list compressed file contents","-n, --no-name do not save or restore the original name and timestamp","-N, --name save or restore the original file name and timestamp","-q, --quiet suppress all warnings","-r, --recursive operate recursively on directories","-S, --suffix=SUF use suffix SUF on compressed files (default: .gz)","-t, --test test compressed file integrity","-v, --verbose verbose mode","-1, --fast compress faster","-9, --best compress better"," --help display this help and exit"]},U={name:"gunzip",summary:"decompress files",usage:"gunzip [OPTION]... [FILE]...",description:`Decompress FILEs (by default, in-place). - -When no FILE is given, or when FILE is -, read from standard input.`,options:["-c, --stdout write to standard output, keep original files","-f, --force force overwrite of output file","-k, --keep keep (don't delete) input files","-l, --list list compressed file contents","-n, --no-name do not restore the original name and timestamp","-N, --name restore the original file name and timestamp","-q, --quiet suppress all warnings","-r, --recursive operate recursively on directories","-S, --suffix=SUF use suffix SUF on compressed files (default: .gz)","-t, --test test compressed file integrity","-v, --verbose verbose mode"," --help display this help and exit"]},D={name:"zcat",summary:"decompress files to stdout",usage:"zcat [OPTION]... [FILE]...",description:`Decompress FILEs to standard output. - -When no FILE is given, or when FILE is -, read from standard input.`,options:["-f, --force force; read compressed data even from a terminal","-l, --list list compressed file contents","-q, --quiet suppress all warnings","-S, --suffix=SUF use suffix SUF on compressed files (default: .gz)","-t, --test test compressed file integrity","-v, --verbose verbose mode"," --help display this help and exit"]},T={stdout:{short:"c",long:"stdout",type:"boolean"},toStdout:{long:"to-stdout",type:"boolean"},decompress:{short:"d",long:"decompress",type:"boolean"},uncompress:{long:"uncompress",type:"boolean"},force:{short:"f",long:"force",type:"boolean"},keep:{short:"k",long:"keep",type:"boolean"},list:{short:"l",long:"list",type:"boolean"},noName:{short:"n",long:"no-name",type:"boolean"},name:{short:"N",long:"name",type:"boolean"},quiet:{short:"q",long:"quiet",type:"boolean"},recursive:{short:"r",long:"recursive",type:"boolean"},suffix:{short:"S",long:"suffix",type:"string",default:".gz"},test:{short:"t",long:"test",type:"boolean"},verbose:{short:"v",long:"verbose",type:"boolean"},fast:{short:"1",long:"fast",type:"boolean"},level2:{short:"2",type:"boolean"},level3:{short:"3",type:"boolean"},level4:{short:"4",type:"boolean"},level5:{short:"5",type:"boolean"},level6:{short:"6",type:"boolean"},level7:{short:"7",type:"boolean"},level8:{short:"8",type:"boolean"},best:{short:"9",long:"best",type:"boolean"}};function E(e){return e.best?x.Z_BEST_COMPRESSION:e.level8?8:e.level7?7:e.level6?6:e.level5?5:e.level4?4:e.level3?3:e.level2?2:e.fast?x.Z_BEST_SPEED:x.Z_DEFAULT_COMPRESSION}function k(e){if(e.length<10)return{originalName:null,mtime:null,headerSize:0};if(e[0]!==31||e[1]!==139)return{originalName:null,mtime:null,headerSize:0};let t=e[3],r=e[4]|e[5]<<8|e[6]<<16|e[7]<<24,o=10;if(t&4){if(o+2>e.length)return{originalName:null,mtime:null,headerSize:0};let n=e[o]|e[o+1]<<8;o+=2+n}let s=null;if(t&8){let n=o;for(;o0?new Date(r*1e3):null,headerSize:o}}function q(e){if(e.length<4)return 0;let t=e.length;return e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24}function b(e){return e.length>=2&&e[0]===31&&e[1]===139}function m(e){return Buffer.from(e).toString("latin1")}function I(e){return e.limits?.maxOutputSize??0}function v(e,t){if(t>0){if(q(e)>t)throw new Error(`decompressed data exceeds limit (${t} bytes)`);return F(e,{maxOutputLength:t})}return F(e)}async function L(e,t,r,o,s,n){let a=r.suffix,f,p,d,c=I(e);if(t==="-"||t==="")if(d=Uint8Array.from(e.stdin,i=>i.charCodeAt(0)),s){if(!b(d))return r.quiet?{stdout:"",stderr:"",exitCode:1}:{stdout:"",stderr:`${o}: stdin: not in gzip format -`,exitCode:1};try{let i=v(d,c);return{stdout:m(i),stderr:"",exitCode:0}}catch(i){let l=i instanceof Error?i.message:"unknown error";return{stdout:"",stderr:`${o}: stdin: ${l} -`,exitCode:1}}}else{let i=E(r),l=S(d,{level:i});return{stdout:m(l),stderr:"",exitCode:0}}f=e.fs.resolvePath(e.cwd,t);try{if((await e.fs.stat(f)).isDirectory)return r.recursive?await P(e,f,r,o,s,n):r.quiet?{stdout:"",stderr:"",exitCode:1}:{stdout:"",stderr:`${o}: ${t}: is a directory -- ignored -`,exitCode:1}}catch{return{stdout:"",stderr:`${o}: ${t}: No such file or directory -`,exitCode:1}}try{d=await e.fs.readFileBuffer(f)}catch{return{stdout:"",stderr:`${o}: ${t}: No such file or directory -`,exitCode:1}}if(s){if(!t.endsWith(a))return r.quiet?{stdout:"",stderr:"",exitCode:1}:{stdout:"",stderr:`${o}: ${t}: unknown suffix -- ignored -`,exitCode:1};if(!b(d))return r.quiet?{stdout:"",stderr:"",exitCode:1}:{stdout:"",stderr:`${o}: ${t}: not in gzip format -`,exitCode:1};let i;try{i=v(d,c)}catch(l){let u=l instanceof Error?l.message:"unknown error";return{stdout:"",stderr:`${o}: ${t}: ${u} -`,exitCode:1}}if(n)return{stdout:m(i),stderr:"",exitCode:0};if(r.name){let l=k(d);l.originalName?p=e.fs.resolvePath(e.cwd,l.originalName):p=f.slice(0,-a.length)}else p=f.slice(0,-a.length);if(!r.force)try{return await e.fs.stat(p),{stdout:"",stderr:`${o}: ${p} already exists; not overwritten -`,exitCode:1}}catch{}if(await e.fs.writeFile(p,i),!r.keep&&!n&&await e.fs.rm(f),r.verbose){let l=d.length>0?((1-d.length/i.length)*100).toFixed(1):"0.0";return{stdout:"",stderr:`${t}: ${l}% -- replaced with ${p.split("/").pop()} -`,exitCode:0}}return{stdout:"",stderr:"",exitCode:0}}else{if(t.endsWith(a))return r.quiet?{stdout:"",stderr:"",exitCode:1}:{stdout:"",stderr:`${o}: ${t} already has ${a} suffix -- unchanged -`,exitCode:1};let i=E(r),l;try{l=S(d,{level:i})}catch(u){let g=u instanceof Error?u.message:"unknown error";return{stdout:"",stderr:`${o}: ${t}: ${g} -`,exitCode:1}}if(n)return{stdout:m(l),stderr:"",exitCode:0};if(p=f+a,!r.force)try{return await e.fs.stat(p),{stdout:"",stderr:`${o}: ${p} already exists; not overwritten -`,exitCode:1}}catch{}if(await e.fs.writeFile(p,l),!r.keep&&!n&&await e.fs.rm(f),r.verbose){let u=d.length>0?((1-l.length/d.length)*100).toFixed(1):"0.0";return{stdout:"",stderr:`${t}: ${u}% -- replaced with ${p.split("/").pop()} -`,exitCode:0}}return{stdout:"",stderr:"",exitCode:0}}}async function P(e,t,r,o,s,n){let a=await e.fs.readdir(t),f="",p="",d=0;for(let c of a){let i=e.fs.resolvePath(t,c),l=await e.fs.stat(i);if(l.isDirectory){let u=await P(e,i,r,o,s,n);f+=u.stdout,p+=u.stderr,u.exitCode!==0&&(d=u.exitCode)}else if(l.isFile){let u=r.suffix;if(s&&!c.endsWith(u)||!s&&c.endsWith(u))continue;let g=i.startsWith(`${e.cwd}/`)?i.slice(e.cwd.length+1):i,y=await L(e,g,r,o,s,n);f+=y.stdout,p+=y.stderr,y.exitCode!==0&&(d=y.exitCode)}}return{stdout:f,stderr:p,exitCode:d}}async function W(e,t,r,o){let s;if(t==="-"||t==="")s=Uint8Array.from(e.stdin,i=>i.charCodeAt(0));else{let i=e.fs.resolvePath(e.cwd,t);try{s=await e.fs.readFileBuffer(i)}catch{return{stdout:"",stderr:`${o}: ${t}: No such file or directory -`,exitCode:1}}}if(!b(s))return r.quiet?{stdout:"",stderr:"",exitCode:1}:{stdout:"",stderr:`${o}: ${t}: not in gzip format -`,exitCode:1};let n=s.length,a=q(s),f=a>0?((1-n/a)*100).toFixed(1):"0.0",d=k(s).originalName||(t==="-"?"":t.replace(/\.gz$/,""));return{stdout:`${n.toString().padStart(10)} ${a.toString().padStart(10)} ${f.padStart(5)}% ${d} -`,stderr:"",exitCode:0}}async function A(e,t,r,o){let s;if(t==="-"||t==="")s=Uint8Array.from(e.stdin,n=>n.charCodeAt(0));else{let n=e.fs.resolvePath(e.cwd,t);try{s=await e.fs.readFileBuffer(n)}catch{return{stdout:"",stderr:`${o}: ${t}: No such file or directory -`,exitCode:1}}}if(!b(s))return r.quiet?{stdout:"",stderr:"",exitCode:1}:{stdout:"",stderr:`${o}: ${t}: not in gzip format -`,exitCode:1};try{return v(s,I(e)),r.verbose?{stdout:"",stderr:`${t}: OK -`,exitCode:0}:{stdout:"",stderr:"",exitCode:0}}catch(n){let a=n instanceof Error?n.message:"invalid";return{stdout:"",stderr:`${o}: ${t}: ${a} -`,exitCode:1}}}async function C(e,t,r){let o=r==="zcat"?D:r==="gunzip"?U:O;if(w(e))return z(o);let s=$(r,e,T);if(!s.ok)return s.error.stderr.includes("unrecognized option"),s.error;let n=s.result.flags,a=s.result.positional,f=r==="gunzip"||r==="zcat"||n.decompress||n.uncompress,p=r==="zcat"||n.stdout||n.toStdout;if(n.list){a.length===0&&(a=["-"]);let l=` compressed uncompressed ratio uncompressed_name -`,u="",g=0;for(let y of a){let h=await W(t,y,n,r);l+=h.stdout,u+=h.stderr,h.exitCode!==0&&(g=h.exitCode)}return{stdout:l,stderr:u,exitCode:g}}if(n.test){a.length===0&&(a=["-"]);let l="",u="",g=0;for(let y of a){let h=await A(t,y,n,r);l+=h.stdout,u+=h.stderr,h.exitCode!==0&&(g=h.exitCode)}return{stdout:l,stderr:u,exitCode:g}}a.length===0&&(a=["-"]);let d="",c="",i=0;for(let l of a){let u=await L(t,l,n,r,f,p);d+=u.stdout,c+=u.stderr,u.exitCode!==0&&(i=u.exitCode)}return{stdout:d,stderr:c,exitCode:i}}var Z={name:"gzip",async execute(e,t){return{...await C(e,t,"gzip"),stdoutEncoding:"binary"}}},R={name:"gunzip",async execute(e,t){return{...await C(e,t,"gunzip"),stdoutEncoding:"binary"}}},K={name:"zcat",async execute(e,t){return{...await C(e,t,"zcat"),stdoutEncoding:"binary"}}},j={name:"gzip",flags:[{flag:"-c",type:"boolean"},{flag:"-d",type:"boolean"},{flag:"-f",type:"boolean"},{flag:"-k",type:"boolean"},{flag:"-l",type:"boolean"},{flag:"-n",type:"boolean"},{flag:"-q",type:"boolean"},{flag:"-r",type:"boolean"},{flag:"-t",type:"boolean"},{flag:"-v",type:"boolean"},{flag:"-1",type:"boolean"},{flag:"-9",type:"boolean"}],stdinType:"binary",needsFiles:!0},J={name:"gunzip",flags:[{flag:"-c",type:"boolean"},{flag:"-f",type:"boolean"},{flag:"-k",type:"boolean"},{flag:"-q",type:"boolean"},{flag:"-v",type:"boolean"}],stdinType:"binary",needsFiles:!0},Q={name:"zcat",flags:[{flag:"-f",type:"boolean"},{flag:"-q",type:"boolean"},{flag:"-v",type:"boolean"}],stdinType:"binary",needsFiles:!0};export{Z as a,R as b,K as c,j as d,J as e,Q as f}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-L2UW7DWF.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-L2UW7DWF.js deleted file mode 100644 index 8a3bf1f..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-L2UW7DWF.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -function n(e){return`'${e.replace(/'/g,"'\\''")}'`}function r(e){return e.map(n).join(" ")}export{r as a}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-LI6PTSPD.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-LI6PTSPD.js deleted file mode 100644 index be837c5..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-LI6PTSPD.js +++ /dev/null @@ -1,9 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -async function c(t,e){if(t.length>0&&t[0]!=="-"){let i=e.fs.resolvePath(e.cwd,t[0]);try{let s=(await e.fs.readFile(i)).split(` -`);s[s.length-1]===""&&s.pop();let r=s.reverse();return{stdout:r.length>0?`${r.join(` -`)} -`:"",stderr:"",exitCode:0}}catch{return{stdout:"",stderr:`tac: ${t[0]}: No such file or directory -`,exitCode:1}}}let n=e.stdin.split(` -`);n[n.length-1]===""&&n.pop();let o=n.reverse();return{stdout:o.length>0?`${o.join(` -`)} -`:"",stderr:"",exitCode:0,stdoutKind:"bytes"}}var u={name:"tac",execute:c},f={name:"tac",flags:[],stdinType:"text",needsFiles:!0};export{u as a,f as b}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-LPJEKUCB.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-LPJEKUCB.js deleted file mode 100644 index 4c9b2cc..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-LPJEKUCB.js +++ /dev/null @@ -1,8 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a as p}from"./chunk-FOCWZZDE.js";import{a as m}from"./chunk-QIQMJJZ4.js";import{a as u}from"./chunk-W5DWRFSU.js";var v={recursive:{short:"r",long:"recursive",type:"boolean"},recursiveUpper:{short:"R",type:"boolean"},force:{short:"f",long:"force",type:"boolean"},verbose:{short:"v",long:"verbose",type:"boolean"}},E={name:"rm",async execute(g,s){let e=m("rm",g,v);if(!e.ok)return e.error;let i=e.result.flags.recursive||e.result.flags.recursiveUpper,a=e.result.flags.force,d=e.result.flags.verbose,c=e.result.positional;if(c.length===0)return a?{stdout:"",stderr:"",exitCode:0}:{stdout:"",stderr:`rm: missing operand -`,exitCode:1};let f="",t="",l=0;for(let r of c)try{let n=s.fs.resolvePath(s.cwd,r);if((await s.fs.stat(n)).isDirectory&&!i){t+=`rm: cannot remove '${r}': Is a directory -`,l=1;continue}await s.fs.rm(n,{recursive:i,force:a}),d&&(f+=`removed '${r}' -`)}catch(n){if(!a){let o=u(n);o.includes("ENOENT")||o.includes("no such file")?t+=`rm: cannot remove '${r}': No such file or directory -`:o.includes("ENOTEMPTY")||o.includes("not empty")?t+=`rm: cannot remove '${r}': Directory not empty -`:t+=`rm: cannot remove '${r}': ${p(o)} -`,l=1}}return{stdout:f,stderr:t,exitCode:l}}},$={name:"rm",flags:[{flag:"-r",type:"boolean"},{flag:"-R",type:"boolean"},{flag:"-f",type:"boolean"},{flag:"-v",type:"boolean"}],needsArgs:!0};export{E as a,$ as b}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-LSLPJOYM.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-LSLPJOYM.js deleted file mode 100644 index f173090..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-LSLPJOYM.js +++ /dev/null @@ -1,3 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a as d}from"./chunk-QIQMJJZ4.js";import{a as p,b as l}from"./chunk-QAYAQNCG.js";var m={name:"tee",summary:"read from stdin and write to stdout and files",usage:"tee [OPTION]... [FILE]...",options:["-a, --append append to the given FILEs, do not overwrite"," --help display this help and exit"]},u={append:{short:"a",long:"append",type:"boolean"}},w={name:"tee",async execute(r,e){if(l(r))return p(m);let t=d("tee",r,u);if(!t.ok)return t.error;let{append:f}=t.result.flags,c=t.result.positional,o=e.stdin,s="",a=0;for(let i of c)try{let n=e.fs.resolvePath(e.cwd,i);f?await e.fs.appendFile(n,o,"binary"):await e.fs.writeFile(n,o,"binary")}catch{s+=`tee: ${i}: No such file or directory -`,a=1}return{stdout:o,stderr:s,exitCode:a,stdoutEncoding:"binary"}}},b={name:"tee",flags:[{flag:"-a",type:"boolean"}],stdinType:"text",needsArgs:!0};export{w as a,b}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-MFDPAVC6.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-MFDPAVC6.js deleted file mode 100644 index 309e664..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-MFDPAVC6.js +++ /dev/null @@ -1,14 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a as c,b as u,c as d}from"./chunk-QAYAQNCG.js";var p={name:"strings",summary:"print the sequences of printable characters in files",usage:"strings [OPTION]... [FILE]...",description:"For each FILE, print the printable character sequences that are at least MIN characters long. If no FILE is specified, standard input is read.",options:["-n MIN Print sequences of at least MIN characters (default: 4)","-t FORMAT Print offset before each string (o=octal, x=hex, d=decimal)","-a Scan the entire file (default behavior)","-e ENCODING Select character encoding (s=7-bit, S=8-bit)"],examples:["strings file.bin # Extract strings (min 4 chars)","strings -n 8 file.bin # Extract strings (min 8 chars)","strings -t x file.bin # Show hex offset","echo 'hello' | strings # Read from stdin"]};function x(n){return n>=32&&n<=126||n===9}function g(n,s){if(s===null)return"";switch(s){case"o":return`${n.toString(8).padStart(7," ")} `;case"x":return`${n.toString(16).padStart(7," ")} `;case"d":return`${n.toString(10).padStart(7," ")} `;default:return s}}function h(n,s){let o=[],r="",i=0,a=typeof n=="string"?new TextEncoder().encode(n):n;for(let l=0;l=s.minLength){let e=g(i,s.offsetFormat);o.push(`${e}${r}`)}r=""}}if(r.length>=s.minLength){let l=g(i,s.offsetFormat);o.push(`${l}${r}`)}return o}var v={name:"strings",execute:async(n,s)=>{if(u(n))return c(p);let o={minLength:4,offsetFormat:null},r=[],i=0;for(;iUint8Array.from(s.stdin??"",t=>t.charCodeAt(0));if(r.length===0){let t=h(l(),o);a=t.length>0?`${t.join(` -`)} -`:""}else for(let t of r){let e;if(t==="-")e=l();else{let m=s.fs.resolvePath(s.cwd,t);try{e=await s.fs.readFileBuffer(m)}catch{return{exitCode:1,stdout:a,stderr:`strings: ${t}: No such file or directory -`}}}let f=h(e,o);f.length>0&&(a+=`${f.join(` -`)} -`)}return{exitCode:0,stdout:a,stderr:""}}},F={name:"strings",flags:[{flag:"-n",type:"value",valueHint:"number"},{flag:"-t",type:"value",valueHint:"string"},{flag:"-a",type:"boolean"},{flag:"-e",type:"value",valueHint:"string"}],stdinType:"text",needsFiles:!0};export{v as a,F as b}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-MFRETFZB.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-MFRETFZB.js deleted file mode 100644 index a453c2e..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-MFRETFZB.js +++ /dev/null @@ -1,6 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a as f}from"./chunk-KTPCYKBB.js";import{a as d}from"./chunk-QIQMJJZ4.js";import{a as m,b as p}from"./chunk-QAYAQNCG.js";var b={name:"cat",summary:"concatenate files and print on the standard output",usage:"cat [OPTION]... [FILE]...",options:["-n, --number number all output lines"," --help display this help and exit"]},g={number:{short:"n",long:"number",type:"boolean"}},L={name:"cat",async execute(t,o){if(p(t))return m(b);let e=d("cat",t,g);if(!e.ok)return e.error;let r=e.result.flags.number,s=e.result.positional,a=await f(o,s,{cmdName:"cat",allowStdinMarker:!0,stopOnError:!1}),n="",l=1;for(let{content:i}of a.files){let u=i;if(r){let c=y(u,l);n+=c.content,l=c.nextLineNumber}else n+=u}return{stdout:n,stderr:a.stderr,exitCode:a.exitCode,stdoutEncoding:"binary"}}};function y(t,o){let e=t.split(` -`),r=t.endsWith(` -`),s=r?e.slice(0,-1):e;return{content:s.map((n,l)=>`${String(o+l).padStart(6," ")} ${n}`).join(` -`)+(r?` -`:""),nextLineNumber:o+s.length}}var T={name:"cat",flags:[{flag:"-n",type:"boolean"},{flag:"-A",type:"boolean"},{flag:"-b",type:"boolean"},{flag:"-s",type:"boolean"},{flag:"-v",type:"boolean"},{flag:"-e",type:"boolean"},{flag:"-t",type:"boolean"}],stdinType:"text",needsFiles:!0};export{L as a,T as b}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-MIZIUC5M.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-MIZIUC5M.js deleted file mode 100644 index b73db2b..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-MIZIUC5M.js +++ /dev/null @@ -1,8 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{c as y}from"./chunk-XEKXHOPO.js";import{a as C}from"./chunk-QIQMJJZ4.js";import{a as F,b as x}from"./chunk-QAYAQNCG.js";var H={name:"column",summary:"columnate lists",usage:"column [OPTION]... [FILE]...",description:"Format input into multiple columns. By default, fills rows first. Use -t to create a table based on whitespace-delimited input.",options:["-t Create a table (determine columns from input)","-s SEP Input field delimiter (default: whitespace)","-o SEP Output field delimiter (default: two spaces)","-c WIDTH Output width for fill mode (default: 80)","-n Don't merge multiple adjacent delimiters"],examples:["ls | column # Fill columns with ls output","cat data | column -t # Format as table","column -t -s ',' file # Format CSV as table","column -c 40 file # Fill 40-char wide columns"]},I={table:{short:"t",long:"table",type:"boolean"},separator:{short:"s",type:"string"},outputSep:{short:"o",type:"string"},width:{short:"c",type:"number",default:80},noMerge:{short:"n",type:"boolean"}};function v(t,e,o){return e?o?t.split(e):t.split(e).filter(n=>n.length>0):o?t.split(/[ \t]/):t.split(/[ \t]+/).filter(n=>n.length>0)}function T(t){let e=[];for(let o of t)for(let n=0;ne[n])&&(e[n]=l)}return e}function W(t,e){if(t.length===0)return"";let o=T(t),n=[];for(let l of t){let c=[];for(let s=0;sa.length)),l=o.length,c=n+l,s=Math.max(1,Math.floor((e+l)/c)),p=Math.ceil(t.length/s),d=[];for(let a=0;a=t.length?i.push(t[m]):i.push(t[m].padEnd(n)))}d.push(i.join(o))}return d.join(` -`)}var S={name:"column",execute:async(t,e)=>{if(x(t))return F(H);let o=C("column",t,I);if(!o.ok)return o.error;let{table:n,separator:l,outputSep:c,width:s,noMerge:p}=o.result.flags,d=o.result.positional,a=c??" ",i;if(d.length===0)i=y(e.stdin)??"";else{let u=[];for(let f of d)if(f==="-")u.push(y(e.stdin)??"");else{let w=e.fs.resolvePath(e.cwd,f),b=await e.fs.readFile(w);if(b===null)return{exitCode:1,stdout:"",stderr:`column: ${f}: No such file or directory -`};u.push(b)}i=u.join("")}if(i===""||i.trim()==="")return{exitCode:0,stdout:"",stderr:""};let r=i.split(` -`);i.endsWith(` -`)&&r[r.length-1]===""&&r.pop();let g=r.filter(u=>u.trim().length>0),h;if(n){let u=g.map(f=>v(f,l,p));h=W(u,a)}else{let u=[];for(let f of g){let w=v(f,l,p);u.push(...w)}h=j(u,s,a)}return h.length>0&&(h+=` -`),{exitCode:0,stdout:h,stderr:""}}},L={name:"column",flags:[{flag:"-t",type:"boolean"},{flag:"-s",type:"value",valueHint:"delimiter"},{flag:"-o",type:"value",valueHint:"string"},{flag:"-c",type:"value",valueHint:"number"},{flag:"-n",type:"boolean"}],stdinType:"text",needsFiles:!0};export{S as a,L as b}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-MJLETYZI.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-MJLETYZI.js deleted file mode 100644 index e68247b..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-MJLETYZI.js +++ /dev/null @@ -1,14 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a as Z}from"./chunk-RBQG6ZUG.js";import{a as _,c as N}from"./chunk-27JIFWUR.js";import{k as A}from"./chunk-SAI2SPQQ.js";import{a as z}from"./chunk-W5DWRFSU.js";import{a as F,b as W}from"./chunk-QAYAQNCG.js";import{sprintf as g}from"sprintf-js";function q(e){let s="",t=0;for(;t=194){let i=(r&31)<<6|e[t+1]&63;s+=String.fromCharCode(i),t+=2;continue}s+=String.fromCharCode(r),t++;continue}if((r&240)===224){if(t+2=55296&&i<=57343){s+=String.fromCharCode(r),t++;continue}s+=String.fromCharCode(i),t+=3;continue}s+=String.fromCharCode(r),t++;continue}if((r&248)===240&&r<=244){if(t+31114111){s+=String.fromCharCode(r),t++;continue}s+=String.fromCodePoint(i),t+=4;continue}s+=String.fromCharCode(r),t++;continue}s+=String.fromCharCode(r),t++}return s}var H={name:"printf",summary:"format and print data",usage:"printf [-v var] FORMAT [ARGUMENT...]",options:[" -v var assign the output to shell variable VAR rather than display it"," --help display this help and exit"],notes:["FORMAT controls the output like in C printf.","Escape sequences: \\n (newline), \\t (tab), \\\\ (backslash)","Format specifiers: %s (string), %d (integer), %f (float), %x (hex), %o (octal), %% (literal %)","Width and precision: %10s (width 10), %.2f (2 decimal places), %010d (zero-padded)","Flags: %- (left-justify), %+ (show sign), %0 (zero-pad)"]},re={name:"printf",async execute(e,s){if(W(e))return F(H);if(e.length===0)return{stdout:"",stderr:`printf: usage: printf format [arguments] -`,exitCode:2};let t=null,r=0;for(;r=e.length)return{stdout:"",stderr:`printf: -v: option requires an argument -`,exitCode:1};if(t=e[r+1],!/^[a-zA-Z_][a-zA-Z0-9_]*(\[[a-zA-Z0-9_@*"'$]+\])?$/.test(t))return{stdout:"",stderr:`printf: \`${t}': not a valid identifier -`,exitCode:2};r+=2}else{if(l.startsWith("-")&&l!=="-")break;break}}if(r>=e.length)return{stdout:"",stderr:`printf: usage: printf format [arguments] -`,exitCode:1};let i=e[r],n=e.slice(r+1);try{let l=N(i),a="",f=0,o=!1,c="",E=s.env.get("TZ"),h=s.limits?.maxStringLength;do{let{result:m,argsConsumed:v,error:u,errMsg:C,stopped:S}=L(l,n,f,E);if(a+=m,h!==void 0&&h>0&&a.length>h)throw new A(`printf: output size limit exceeded (${h} bytes)`,"string_length");if(f+=v,u&&(o=!0,C&&(c=C)),S)break}while(f0);if(f===0&&n.length>0,t){let m=t.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(['"]?)(.+?)\2\]$/);if(m){let v=m[1],u=m[3];u=u.replace(/\$([a-zA-Z_][a-zA-Z0-9_]*)/g,(C,S)=>s.env.get(S)??""),s.env.set(`${v}_${u}`,a)}else s.env.set(t,a);return{stdout:"",stderr:c,exitCode:o?1:0}}return{stdout:a,stderr:c,exitCode:o?1:0}}catch(l){if(l instanceof A)throw l;return{stdout:"",stderr:`printf: ${z(l)} -`,exitCode:1}}}};function L(e,s,t,r){let i="",n=0,l=0,a=!1,f="";for(;n=0&&p.length>b&&(p=p.slice(0,b)),x!==0){let M=Math.abs(x);p.length>>0:n;return{value:T(e.replace("u","d"),l),parseError:r,parseErrMsg:i}}case"x":case"X":{let n=I(t);return r=d,r&&(i=`printf: ${t}: invalid number -`),{value:G(e,n),parseError:r,parseErrMsg:i}}case"e":case"E":case"f":case"F":case"g":case"G":{let n=parseFloat(t)||0;return{value:y(e,s,n),parseError:!1,parseErrMsg:""}}case"c":{if(t==="")return{value:"",parseError:!1,parseErrMsg:""};let a=new TextEncoder().encode(t)[0];return{value:String.fromCharCode(a),parseError:!1,parseErrMsg:""}}case"s":return{value:Q(e,t),parseError:!1,parseErrMsg:""};case"q":return{value:V(e,t),parseError:!1,parseErrMsg:""};case"b":{let n=B(t);return{value:n.value,parseError:!1,parseErrMsg:"",stopped:n.stopped}}default:try{return{value:g(e,t),parseError:!1,parseErrMsg:""}}catch{return{value:"",parseError:!0,parseErrMsg:`printf: [sprintf] unexpected placeholder -`}}}}var d=!1;function I(e){d=!1;let s=e.trimStart(),t=s!==s.trimEnd();if(e=s.trimEnd(),e.startsWith("'")&&e.length>=2||e.startsWith('"')&&e.length>=2)return e.charCodeAt(1);if(e.startsWith("\\'")&&e.length>=3||e.startsWith('\\"')&&e.length>=3)return e.charCodeAt(2);if(e.startsWith("+")&&(e=e.slice(1)),e.startsWith("0x")||e.startsWith("0X")){let r=parseInt(e,16);return Number.isNaN(r)?(d=!0,0):(t&&(d=!0),r)}if(e.startsWith("0")&&e.length>1&&/^-?0[0-7]+$/.test(e))return t&&(d=!0),parseInt(e,8)||0;if(/^\d+#/.test(e)){d=!0;let r=e.match(/^(\d+)#/);return r?parseInt(r[1],10):0}if(e!==""&&!/^-?\d+$/.test(e)){d=!0;let r=parseInt(e,10);return Number.isNaN(r)?0:r}return t&&(d=!0),parseInt(e,10)||0}function T(e,s){let t=e.match(/^%([- +#0']*)(\d*)(\.(\d*))?[diu]$/);if(!t)return g(e.replace(/\.\d*/,""),s);let r=t[1]||"",i=t[2]?parseInt(t[2],10):0,n=t[3]!==void 0?t[4]?parseInt(t[4],10):0:-1,l=s<0,a=Math.abs(s),f=String(a);n>=0&&(f=f.padStart(n,"0"));let o="";l?o="-":r.includes("+")?o="+":r.includes(" ")&&(o=" ");let c=o+f;return i>c.length&&(r.includes("-")?c=c.padEnd(i," "):r.includes("0")&&n<0?c=o+f.padStart(i-o.length,"0"):c=c.padStart(i," ")),c}function D(e,s){let t=e.match(/^%([- +#0']*)(\d*)(\.(\d*))?o$/);if(!t)return g(e,s);let r=t[1]||"",i=t[2]?parseInt(t[2],10):0,n=t[3]!==void 0?t[4]?parseInt(t[4],10):0:-1,l=Math.abs(s).toString(8);n>=0&&(l=l.padStart(n,"0")),r.includes("#")&&!l.startsWith("0")&&(l=`0${l}`);let a=l;return i>a.length&&(r.includes("-")?a=a.padEnd(i," "):r.includes("0")&&n<0?a=a.padStart(i,"0"):a=a.padStart(i," ")),a}function G(e,s){let t=e.includes("X"),r=e.match(/^%([- +#0']*)(\d*)(\.(\d*))?[xX]$/);if(!r)return g(e,s);let i=r[1]||"",n=r[2]?parseInt(r[2],10):0,l=r[3]!==void 0?r[4]?parseInt(r[4],10):0:-1,a=Math.abs(s).toString(16);t&&(a=a.toUpperCase()),l>=0&&(a=a.padStart(l,"0"));let f="";i.includes("#")&&s!==0&&(f=t?"0X":"0x");let o=f+a;return n>o.length&&(i.includes("-")?o=o.padEnd(n," "):i.includes("0")&&l<0?o=f+a.padStart(n-f.length,"0"):o=o.padStart(n," ")),o}function O(e){if(e==="")return"''";if(/^[a-zA-Z0-9_./-]+$/.test(e))return e;if(/[\x00-\x1f\x7f-\xff]/.test(e)){let r="$'";for(let i of e){let n=i.charCodeAt(0);i==="'"?r+="\\'":i==="\\"?r+="\\\\":i===` -`?r+="\\n":i===" "?r+="\\t":i==="\r"?r+="\\r":i==="\x07"?r+="\\a":i==="\b"?r+="\\b":i==="\f"?r+="\\f":i==="\v"?r+="\\v":i==="\x1B"?r+="\\E":n<32||n>=127&&n<=255?r+=`\\${n.toString(8).padStart(3,"0")}`:i==='"'?r+='\\"':r+=i}return r+="'",r}let t="";for(let r of e)" |&;<>()$`\\\"'*?[#~=%!{}".includes(r)?t+=`\\${r}`:t+=r;return t}function Q(e,s){let t=e.match(/^%(-?)(\d*)(\.(\d*))?s$/);if(!t)return g(e.replace(/0+(?=\d)/,""),s);let r=t[1]==="-",i=t[2]?parseInt(t[2],10):0,n=t[3]!==void 0?t[4]?parseInt(t[4],10):0:-1,l=r?-i:i;return _(s,l,n)}function V(e,s){let t=O(s),r=e.match(/^%(-?)(\d*)q$/);if(!r)return t;let i=r[1]==="-",n=r[2]?parseInt(r[2],10):0,l=t;return n>l.length&&(i?l=l.padEnd(n," "):l=l.padStart(n," ")),l}function y(e,s,t){let r=e.match(/^%([- +#0']*)(\d*)(\.(\d*))?[eEfFgG]$/);if(!r)return g(e,t);let i=r[1]||"",n=r[2]?parseInt(r[2],10):0,l=r[3]!==void 0?r[4]?parseInt(r[4],10):0:6,a,f=s.toLowerCase();if(f==="e"?(a=t.toExponential(l),a=a.replace(/e([+-])(\d)$/,"e$10$2"),s==="E"&&(a=a.toUpperCase())):f==="f"?(a=t.toFixed(l),i.includes("#")&&l===0&&!a.includes(".")&&(a+=".")):f==="g"?(a=t.toPrecision(l||1),i.includes("#")||(a=a.replace(/\.?0+$/,""),a=a.replace(/\.?0+e/,"e")),a=a.replace(/e([+-])(\d)$/,"e$10$2"),s==="G"&&(a=a.toUpperCase())):a=t.toString(),t>=0&&(i.includes("+")?a=`+${a}`:i.includes(" ")&&(a=` ${a}`)),n>a.length)if(i.includes("-"))a=a.padEnd(n," ");else if(i.includes("0")){let o=a.match(/^[+ -]/)?.[0]||"",c=o?a.slice(1):a;a=o+c.padStart(n-o.length,"0")}else a=a.padStart(n," ");return a}function B(e){let s="",t=0;for(;t0?(s+=q(i),t=n):(s+="\\x",t+=2);break}case"u":{let i="",n=t+2;for(;ns.has(i));if(o.length>0){e.push(` ${a}:`),e.push(` ${o.join(", ")} -`);for(let i of o)s.delete(i)}}for(let a of s)t.push(a);return t.length>0&&(e.push(" Other:"),e.push(` ${t.sort().join(", ")} -`)),e.push("Use ' --help' for details on a specific command."),`${e.join(` -`)} -`}var h={name:"help",async execute(n,e){if(n.includes("--help")||n.includes("-h"))return{stdout:`help - display available commands - -Usage: help [command] - -Options: - -h, --help Show this help message - -If a command name is provided, shows help for that command. -Otherwise, lists all available commands. -`,stderr:"",exitCode:0};if(n.length>0&&e.exec){let t=n[0];return e.exec(r([t]),{cwd:e.cwd,signal:e.signal,args:["--help"]})}let s=e.getRegisteredCommands?.()??[];return{stdout:d(s),stderr:"",exitCode:0}}},p={name:"help",flags:[]};export{h as a,p as b}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-MTHXXA6H.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-MTHXXA6H.js deleted file mode 100644 index b85b361..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-MTHXXA6H.js +++ /dev/null @@ -1,6 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a as T}from"./chunk-KTPCYKBB.js";import{c as b}from"./chunk-XEKXHOPO.js";import{a as M}from"./chunk-QIQMJJZ4.js";import{a as S,b as F}from"./chunk-QAYAQNCG.js";var H={name:"wc",summary:"print newline, word, and byte counts for each file",usage:"wc [OPTION]... [FILE]...",options:["-c, --bytes print the byte counts","-m, --chars print the character counts","-l, --lines print the newline counts","-w, --words print the word counts"," --help display this help and exit"]},O={lines:{short:"l",long:"lines",type:"boolean"},words:{short:"w",long:"words",type:"boolean"},bytes:{short:"c",long:"bytes",type:"boolean"},chars:{short:"m",long:"chars",type:"boolean"}},N={name:"wc",async execute(a,f){if(F(a))return S(H);let s=M("wc",a,O);if(!s.ok)return s.error;let{lines:o,words:n}=s.result.flags,l=s.result.flags.bytes,e=s.result.flags.chars,t=s.result.positional;!o&&!n&&!l&&!e&&(o=n=l=!0);let c=l||e,i=await T(f,t,{cmdName:"wc",stopOnError:!1});if(t.length===0){let r=C(i.files[0].content,e);return{stdout:`${x(r,o,n,c,"",0)} -`,stderr:"",exitCode:0}}let d=[],m=0,g=0,u=0;for(let{filename:r,content:y}of i.files){let p=C(y,e);m+=p.lines,g+=p.words,u+=p.third,d.push({filename:r,stats:p})}let L=t.length>1?m:Math.max(...d.map(r=>r.stats.lines)),$=t.length>1?g:Math.max(...d.map(r=>r.stats.words)),B=t.length>1?u:Math.max(...d.map(r=>r.stats.third)),h=t.length>1?3:0;o&&(h=Math.max(h,String(L).length)),n&&(h=Math.max(h,String($).length)),c&&(h=Math.max(h,String(B).length));let w="";for(let{filename:r,stats:y}of d)w+=`${x(y,o,n,c,r,h)} -`;return t.length>1&&(w+=`${x({lines:m,words:g,third:u},o,n,c,"total",h)} -`),{stdout:w,stderr:i.stderr,exitCode:i.exitCode}}};function C(a,f){let s=a,o=s.length,n=f?Array.from(b(a)).length:o,l=0,e=0,t=!1;for(let c=0;c1){for(let n of t.slice(1))if(!"0tr".includes(n))return w("xargs",`-${n}`);t.includes("0")&&(h=!0),t.includes("t")&&(x=!0),t.includes("r")&&(y=!0),s=e+1}else if(!t.startsWith("-")){s=e;break}}}let a=l.slice(s);a.length===0&&a.push("echo");let C=v(i.stdin),r;if(h?r=C.split("\0").filter(e=>e.length>0):g!==null?r=C.replace(/\n$/,"").split(g).filter(t=>t.length>0):r=C.split(/\s+/).map(e=>e.trim()).filter(e=>e.length>0),r.length===0)return y?{stdout:"",stderr:"",exitCode:0}:{stdout:"",stderr:"",exitCode:0};let f="",u="",d=0,I=e=>/[\s"'\\$`!*?[\]{}();&|<>#]/.test(e)?`"${e.replace(/([\\"`$])/g,"\\$1")}"`:e,b=async e=>{if(x){let n=e.map(I).join(" ");u+=`${n} -`}return i.exec?i.exec($([e[0]]),{cwd:i.cwd,signal:i.signal,args:e.slice(1)}):{stdout:`${e.map(I).join(" ")} -`,stderr:"",exitCode:0}},A=async e=>{if(o!==null&&o>1)for(let t=0;ta.map(n=>n.replaceAll(m,t)));await A(e)}else if(c!==null){let e=[];for(let t=0;te.days:e.comparison==="less"?s=an,pruned:!1,printed:!1}}case"size":{let n=e.value;switch(e.unit){case"c":n=e.value;break;case"k":n=e.value*1024;break;case"M":n=e.value*1024*1024;break;case"G":n=e.value*1024*1024*1024;break;case"b":n=e.value*512;break}let a;return e.comparison==="more"?a=t.size>n:e.comparison==="less"?a=t.sizei.length>0);if(o.length>=2)for(let i=o.length-2;i>=0;i--){let r=o[i];if(!r.includes("*")&&!r.includes("?")&&!r.includes("[")&&r!=="."&&r!==".."){let p=o[i+1];if(p&&(p.includes("*")||p.includes("?"))){t.terminalDirName=r;let l=p.match(/^\*(\.[a-zA-Z0-9]+)$/);l&&(t.requiredExtension=l[1])}break}}}return t}function Ee(e){let t=[],n=a=>{a.type==="path"?t.push(a.pattern):a.type==="not"?n(a.expr):(a.type==="and"||a.type==="or")&&(n(a.left),n(a.right))};return n(e),t}function Me(e){let t=n=>n.type==="type"&&n.fileType==="f"?!0:n.type==="not"?t(n.expr):n.type==="and"||n.type==="or"?t(n.left)||t(n.right):!1;return t(e)}function he(e){let t=[],n=a=>{a&&(a.type==="newer"?t.push(a.refPath):a.type==="not"?n(a.expr):(a.type==="and"||a.type==="or")&&(n(a.left),n(a.right)))};return n(e),t}function J(e){if(!e)return!0;switch(e.type){case"name":case"path":case"regex":case"type":case"prune":case"print":return!0;case"empty":case"mtime":case"newer":case"size":case"perm":return!1;case"not":return J(e.expr);case"and":case"or":return J(e.left)&&J(e.right)}}function L(e,t,n,a,s){switch(e.type){case"name":{let o=e.pattern,i=o.match(/^\*(\.[a-zA-Z0-9]+)$/);if(i){let r=i[1];if(e.ignoreCase){if(!t.toLowerCase().endsWith(r.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!t.endsWith(r))return{matches:!1,pruned:!1,printed:!1};return{matches:!0,pruned:!1,printed:!1}}return{matches:Y(t,o,e.ignoreCase),pruned:!1,printed:!1}}case"path":{let o=e.pattern,i=o.split("/");for(let p=0;p=e.length)return{expr:null,pathIndex:s,error:"find: missing argument to `-exec'\n",actions:[]};let p=e[s]==="+";a.push({type:"exec",command:r,batchMode:p})}else if(i==="-print")n.push({type:"expr",expr:{type:"print"}}),a.push({type:"print"});else if(i==="-print0")a.push({type:"print0"});else if(i==="-printf"&&s+1=e.length)return null;let r=e[t];if(r.type==="lparen"){t++;let p=n();return tc.type==="print"),O=l.length===0,x=[],ge=l.some(c=>c.type==="printf"),re=[],B="",q=0,we=he(r),U=new Map;for(let c of we){let f=t.fs.resolvePath(t.cwd,c);try{let u=await t.fs.stat(f);U.set(c,u.mtime?.getTime()??Date.now())}catch{}}let De=l.some(c=>{if(c.type!=="printf")return!1;let f=c.format.replace(/%%/g,"");return/%[-+]?[0-9]*\.?[0-9]*(s|m|M|t|T)/.test(f)}),Te=_(r)||De,Ce=j(r),K=ue(r),ae=V(r),Pe=J(r),Se=typeof t.fs.readdirWithFileTypes=="function";for(let c of n){let G=function(h){let $=s===null||h.depth>=s,P=!1;if($&&r!==null){let S=Date.now(),y;if(Pe)y=L(r,h.name,h.relativePath,h.isFile,h.isDirectory);else{let m={name:h.name,relativePath:h.relativePath,isFile:h.isFile,isDirectory:h.isDirectory,isEmpty:h.isEmpty,mtime:h.stat?.mtime?.getTime()??Date.now(),size:h.stat?.size??0,mode:h.stat?.mode??420,newerRefTimes:U};y=k(r,m)}$=y.matches,P=d?y.printed:$,u.evalCalls++,u.evalTime+=Date.now()-S}else $&&(P=!0);return P?{print:!0,printfData:ge?{path:h.relativePath,name:h.name,size:h.stat?.size??0,mtime:h.stat?.mtime?.getTime()??Date.now(),mode:h.stat?.mode??420,isDirectory:h.isDirectory,depth:h.depth,startingPoint:c}:null}:{print:!1,printfData:null}};var We=G;c.length>1&&c.endsWith("/")&&(c=c.slice(0,-1));let f=t.fs.resolvePath(t.cwd,c);try{await t.fs.stat(f)}catch{B+=`find: ${c}: No such file or directory -`,q=1;continue}let u=Ie(),M=Date.now();async function N(h){let{path:b,depth:$,typeInfo:P}=h;if(u.nodeCount++,$>(a??256))return null;let v,S,y;if(P&&!Te)v=P.isFile,S=P.isDirectory;else{try{let A=Date.now();y=await t.fs.stat(b),u.statCalls++,u.statTime+=Date.now()-A}catch{return null}if(!y)return null;v=y.isFile,S=y.isDirectory}let m;b===f?m=c.split("/").pop()||c:m=b.split("/").pop()||"";let g=b===f?c:c==="."?`./${b.slice(f==="/"?f.length:f.length+1)}`:c+b.slice(f.length),T=[],C=null,w=null,D=!1;S&&ae&&!o&&(D=de(r,{name:m,relativePath:g,isFile:v,isDirectory:S}).shouldPrune,D&&u.earlyPrunes++);let F=$>=(a??256),I=K.terminalDirName!==null&&m===K.terminalDirName,Z=!F&&!I&&!D;if(S&&((Z||Ce||I)&&!D)){let A=Date.now();if(Se&&t.fs.readdirWithFileTypes){if(C=await t.fs.readdirWithFileTypes(b),w=C.map(E=>E.name),u.readdirCalls++,u.readdirTime+=Date.now()-A,Z)T=C.map((E,R)=>({path:b==="/"?`/${E.name}`:`${b}/${E.name}`,depth:$+1,typeInfo:{isFile:E.isFile,isDirectory:E.isDirectory},resultIndex:R}));else if(I){let E=K.requiredExtension;T=C.filter(R=>R.isFile&&(!E||R.name.endsWith(E))).map((R,ve)=>({path:b==="/"?`/${R.name}`:`${b}/${R.name}`,depth:$+1,typeInfo:{isFile:R.isFile,isDirectory:R.isDirectory},resultIndex:ve}))}}else w=await t.fs.readdir(b),u.readdirCalls++,u.readdirTime+=Date.now()-A,Z&&(T=w.map((E,R)=>({path:b==="/"?`/${E}`:`${b}/${E}`,depth:$+1,resultIndex:R})))}let Q=v?(y?.size??0)===0:w!==null&&w.length===0,H=D;if(!o&&r!==null&&!D&&ae){let A=Date.now(),E={name:m,relativePath:g,isFile:v,isDirectory:S,isEmpty:Q,mtime:y?.mtime?.getTime()??Date.now(),size:y?.size??0,mode:y?.mode??420,newerRefTimes:U};H=k(r,E).pruned,u.evalCalls++,u.evalTime+=Date.now()-A}return{relativePath:g,name:m,isFile:v,isDirectory:S,isEmpty:Q,stat:y,depth:$,children:H?[]:T,pruned:H}}async function be(){let h={paths:[],printfData:[]};if(o){let y=function(m){let g={paths:[],printfData:[]},T=P[m];if(!T)return g;for(let D of T.childIndices){let F=y(D);g.paths.push(...F.paths),g.printfData.push(...F.printfData)}let{print:C,printfData:w}=G(T.node);return C&&(g.paths.push(T.node.relativePath),w&&g.printfData.push(w)),g};var b=y;let P=[],v=[{item:{path:f,depth:0,resultIndex:0},parentIndex:-1,childOrderInParent:0}],S=new Map;for(;v.length>0;){let m=Date.now(),g=v.splice(0,ye),T=await Promise.all(g.map(C=>N(C.item)));u.batchCount++,u.batchTime+=Date.now()-m;for(let C=0;C=0){let I=S.get(D.parentIndex)||[];I.push(F),S.set(D.parentIndex,I)}P.push({node:w,parentIndex:D.parentIndex,childIndices:[]});for(let I=0;I=0&&m0){let m=y(0);h.paths.push(...m.paths),h.printfData.push(...m.printfData)}}else{let m=function(g){let T=P.get(g);T&&(h.paths.push(T.path),T.printfData&&h.printfData.push(T.printfData));let C=y.get(g);if(C)for(let w of C)m(w)};var $=m;let P=new Map,v=0,S=[{item:{path:f,depth:0,resultIndex:0},orderIndex:v++}],y=new Map;for(;S.length>0;){let g=Date.now(),T=S.splice(0,ye),C=await Promise.all(T.map(async({item:w,orderIndex:D})=>{let F=await N(w);return F?{node:F,orderIndex:D}:null}));u.batchCount++,u.batchTime+=Date.now()-g;for(let w of C){if(!w)continue;let{node:D,orderIndex:F}=w,{print:I,printfData:Z}=G(D);if(I&&P.set(F,{path:D.relativePath,printfData:Z}),D.children.length>0){let ee=[];for(let Q of D.children){let H=v++;ee.push(H),S.push({item:Q,orderIndex:H})}y.set(F,ee)}}}m(0)}return h}let X=await be();if(x.push(...X.paths),re.push(...X.printfData),t.trace){let h=Date.now()-M;xe(t.trace,u,h),t.trace({category:"find",name:"searchPath",durationMs:h,details:{path:c,resultsFound:X.paths.length}})}}let W="";if(l.length>0)for(let c of l)switch(c.type){case"print":W+=x.length>0?`${x.join(` -`)} -`:"";break;case"print0":W+=x.length>0?`${x.join("\0")}\0`:"";break;case"delete":{let f=[...x].sort((u,M)=>M.length-u.length);for(let u of f){let M=t.fs.resolvePath(t.cwd,u);try{await t.fs.rm(M,{recursive:!1})}catch(N){let G=N instanceof Error?N.message:String(N);B+=`find: cannot delete '${u}': ${G} -`,q=1}}break}case"printf":for(let f of re)W+=ke(c.format,f);break;case"exec":if(!t.exec)return{stdout:"",stderr:`find: -exec not supported in this context -`,exitCode:1};if(c.batchMode){let f=[];for(let M of c.command)M==="{}"?f.push(...x):f.push(M);let u=await t.exec(ne([f[0]]),{cwd:t.cwd,signal:t.signal,args:f.slice(1)});W+=u.stdout,B+=u.stderr,u.exitCode!==0&&(q=u.exitCode)}else for(let f of x){let u=c.command.map(N=>N==="{}"?f:N),M=await t.exec(ne([u[0]]),{cwd:t.cwd,signal:t.signal,args:u.slice(1)});W+=M.stdout,B+=M.stderr,M.exitCode!==0&&(q=M.exitCode)}break}else O&&(W=x.length>0?`${x.join(` -`)} -`:"");return{stdout:W,stderr:B,exitCode:q}}};function ke(e,t){let n=ce(e),a="",s=0;for(;s=n.length){a+="%";break}let p=n[s],l;switch(p){case"f":l=t.name,s++;break;case"h":{let d=t.path.lastIndexOf("/");l=d>0?t.path.slice(0,d):".",s++;break}case"p":l=t.path,s++;break;case"P":{let d=t.startingPoint;t.path===d?l="":t.path.startsWith(`${d}/`)?l=t.path.slice(d.length+1):d==="."&&t.path.startsWith("./")?l=t.path.slice(2):l=t.path,s++;break}case"s":l=String(t.size),s++;break;case"d":l=String(t.depth),s++;break;case"m":l=(t.mode&511).toString(8),s++;break;case"M":l=fe(t.mode,t.isDirectory),s++;break;case"t":{let d=new Date(t.mtime);l=Ne(d),s++;break}case"T":{if(s+11,d=0;for(let h=0;h0&&(u+=` -`),u+=b(`==> ${c} <== -`)),u+=s(w),d++}catch{o+=`${r}: ${c}: No such file or directory -`,e=1}}return{stdout:u,stderr:o,exitCode:e,stdoutEncoding:"binary"}}function v(t,i,r){if(r!==null)return t.slice(0,r);if(i===0)return"";let s=0,f=0,l=t.length;for(;s0?t.slice(0,s):""}function C(t,i,r,s){if(r!==null)return t.slice(-r);let f=t.length;if(f===0)return"";if(s){let o=0,e=1;for(;o=0&&no.trim()),t=[];for(let o of i){let e=parseInt(o,10);if(Number.isNaN(e)||e<1)return null;t.push(e)}for(let o=1;on)return t-n;if(i.length>=2){let t=i[i.length-1]-i[i.length-2],o=i[i.length-1],e=Math.floor((n-o)/t)+1;return o+e*t-n}return 1}function b(n,i){let{tabStops:t,leadingOnly:o}=i,e="",r=0,s=!0;for(let a of n)if(a===" ")if(o&&!s)e+=a,r++;else{let l=g(r,t);e+=" ".repeat(l),r+=l}else a!==" "&&a!==" "&&(s=!1),e+=a,r++;return e}function h(n,i){if(n==="")return"";let t=n.split(` -`),o=n.endsWith(` -`)&&t[t.length-1]==="";return o&&t.pop(),t.map(r=>b(r,i)).join(` -`)+(o?` -`:"")}var y={name:"expand",execute:async(n,i)=>{if(c(n))return f(x);let t={tabStops:[8],leadingOnly:!1},o=[],e=0;for(;e2){let a=p(s.slice(2));if(!a)return{exitCode:1,stdout:"",stderr:`expand: invalid tab size: '${s.slice(2)}' -`};t.tabStops=a,e++}else if(s==="--tabs"&&e+1=g){let f=o.keys().next().value;f!==void 0&&o.delete(f)}o.set(i,n)}return n.test(l)}function a(l,c){let t="^";for(let s=0;s0)for(let n of t.description)e+=n?` ${n} -`:` -`}if(t.options&&t.options.length>0){e+=` -Options: -`;for(let n of t.options)e+=` ${n} -`}if(t.examples&&t.examples.length>0){e+=` -Examples: -`;for(let n of t.examples)e+=` ${n} -`}if(t.notes&&t.notes.length>0){e+=` -Notes: -`;for(let n of t.notes)e+=` ${n} -`}return{stdout:e,stderr:"",exitCode:0}}function o(t){return t.includes("--help")}function r(t,e){return{stdout:"",stderr:e.startsWith("--")?`${t}: unrecognized option '${e}' -`:`${t}: invalid option -- '${e.replace(/^-/,"")}' -`,exitCode:1}}export{s as a,o as b,r as c}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-QIQMJJZ4.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-QIQMJJZ4.js deleted file mode 100644 index 22ff1d5..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-QIQMJJZ4.js +++ /dev/null @@ -1,4 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{c as p}from"./chunk-QAYAQNCG.js";function x(a,i,d){let g=new Map,h=new Map;for(let[t,e]of Object.entries(d)){let n={name:t,type:e.type};e.short&&g.set(e.short,n),e.long&&h.set(e.long,n)}let s=Object.create(null);for(let[t,e]of Object.entries(d))e.default!==void 0?s[t]=e.default:e.type==="boolean"&&(s[t]=!1);let b=[],k=!1;for(let t=0;t=i.length)return{ok:!1,error:{stdout:"",stderr:`${a}: option '--${o}' requires an argument -`,exitCode:1}};r=i[++t]}s[f]=u==="number"?parseInt(r,10):r}}else{let n=e.slice(1);for(let o=0;o{var{hasOwnProperty:nn}=Object.prototype,rn=(s,e={})=>{typeof e=="string"&&(e={section:e}),e.align=e.align===!0,e.newline=e.newline===!0,e.sort=e.sort===!0,e.whitespace=e.whitespace===!0||e.align===!0,e.platform=e.platform||typeof process<"u"&&process.platform,e.bracketedArray=e.bracketedArray!==!1;let t=e.platform==="win32"?`\r -`:` -`,n=e.whitespace?" = ":"=",i=[],r=e.sort?Object.keys(s).sort():Object.keys(s),o=0;e.align&&(o=z(r.filter(c=>s[c]===null||Array.isArray(s[c])||typeof s[c]!="object").map(c=>Array.isArray(s[c])?`${c}[]`:c).concat([""]).reduce((c,u)=>z(c).length>=z(u).length?c:u)).length);let a="",l=e.bracketedArray?"[]":"";for(let c of r){let u=s[c];if(u&&Array.isArray(u))for(let f of u)a+=z(`${c}${l}`).padEnd(o," ")+n+z(f)+t;else u&&typeof u=="object"?i.push(c):a+=z(c).padEnd(o," ")+n+z(u)+t}e.section&&a.length&&(a="["+z(e.section)+"]"+(e.newline?t+t:t)+a);for(let c of i){let u=qr(c,".").join("\\."),f=(e.section?e.section+".":"")+u,h=rn(s[c],{...e,section:f});a.length&&h.length&&(a+=t),a+=h}return a};function qr(s,e){var t=0,n=0,i=0,r=[];do if(i=s.indexOf(e,t),i!==-1){if(t=i+e.length,i>0&&s[i-1]==="\\")continue;r.push(s.slice(n,i)),n=i+e.length}while(i!==-1);return r.push(s.slice(n)),r}var Lr=(s,e={})=>{e.bracketedArray=e.bracketedArray!==!1;let t=Object.create(null),n=t,i=null,r=/^\[([^\]]*)\]\s*$|^([^=]+)(=(.*))?$/i,o=s.split(/[\r\n]+/g),a={};for(let c of o){if(!c||c.match(/^\s*[;#]/)||c.match(/^\s*$/))continue;let u=c.match(r);if(!u)continue;if(u[1]!==void 0){if(i=Mt(u[1]),i==="__proto__"){n=Object.create(null);continue}n=t[i]=t[i]||Object.create(null);continue}let f=Mt(u[2]),h;e.bracketedArray?h=f.length>2&&f.slice(-2)==="[]":(a[f]=(a?.[f]||0)+1,h=a[f]>1);let p=h&&f.endsWith("[]")?f.slice(0,-2):f;if(p==="__proto__")continue;let g=u[3]?Mt(u[4]):!0,d=g==="true"||g==="false"||g==="null"?JSON.parse(g):g;h&&(nn.call(n,p)?Array.isArray(n[p])||(n[p]=[n[p]]):n[p]=[]),Array.isArray(n[p])?n[p].push(d):n[p]=d}let l=[];for(let c of Object.keys(t)){if(!nn.call(t,c)||typeof t[c]!="object"||Array.isArray(t[c]))continue;let u=qr(c,".");n=t;let f=u.pop(),h=f.replace(/\\\./g,".");for(let p of u)p!=="__proto__"&&((!nn.call(n,p)||typeof n[p]!="object")&&(n[p]=Object.create(null)),n=n[p]);n===t&&h===f||(n[h]=t[c],l.push(c))}for(let c of l)delete t[c];return t},Pr=s=>s.startsWith('"')&&s.endsWith('"')||s.startsWith("'")&&s.endsWith("'"),z=s=>typeof s!="string"||s.match(/[=\r\n]/)||s.match(/^\[/)||s.length>1&&Pr(s)||s!==s.trim()?JSON.stringify(s):s.split(";").join("\\;").split("#").join("\\#"),Mt=s=>{if(s=(s||"").trim(),Pr(s)){s.charAt(0)==="'"&&(s=s.slice(1,-1));try{s=JSON.parse(s)}catch{}}else{let e=!1,t="";for(let n=0,i=s.length;n{"use strict";var un=Symbol.for("yaml.alias"),Ur=Symbol.for("yaml.document"),jt=Symbol.for("yaml.map"),Kr=Symbol.for("yaml.pair"),fn=Symbol.for("yaml.scalar"),Ut=Symbol.for("yaml.seq"),Q=Symbol.for("yaml.node.type"),zc=s=>!!s&&typeof s=="object"&&s[Q]===un,Qc=s=>!!s&&typeof s=="object"&&s[Q]===Ur,Zc=s=>!!s&&typeof s=="object"&&s[Q]===jt,eu=s=>!!s&&typeof s=="object"&&s[Q]===Kr,Yr=s=>!!s&&typeof s=="object"&&s[Q]===fn,tu=s=>!!s&&typeof s=="object"&&s[Q]===Ut;function Dr(s){if(s&&typeof s=="object")switch(s[Q]){case jt:case Ut:return!0}return!1}function su(s){if(s&&typeof s=="object")switch(s[Q]){case un:case jt:case fn:case Ut:return!0}return!1}var nu=s=>(Yr(s)||Dr(s))&&!!s.anchor;x.ALIAS=un;x.DOC=Ur;x.MAP=jt;x.NODE_TYPE=Q;x.PAIR=Kr;x.SCALAR=fn;x.SEQ=Ut;x.hasAnchor=nu;x.isAlias=zc;x.isCollection=Dr;x.isDocument=Qc;x.isMap=Zc;x.isNode=su;x.isPair=eu;x.isScalar=Yr;x.isSeq=tu});var He=w(hn=>{"use strict";var _=C(),V=Symbol("break visit"),Jr=Symbol("skip children"),H=Symbol("remove node");function Kt(s,e){let t=Gr(e);_.isDocument(s)?ke(null,s.contents,t,Object.freeze([s]))===H&&(s.contents=null):ke(null,s,t,Object.freeze([]))}Kt.BREAK=V;Kt.SKIP=Jr;Kt.REMOVE=H;function ke(s,e,t,n){let i=Wr(s,e,t,n);if(_.isNode(i)||_.isPair(i))return Hr(s,n,i),ke(s,i,t,n);if(typeof i!="symbol"){if(_.isCollection(e)){n=Object.freeze(n.concat(e));for(let r=0;r{"use strict";var Xr=C(),iu=He(),ru={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},ou=s=>s.replace(/[!,[\]{}]/g,e=>ru[e]),Xe=class s{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},s.defaultYaml,e),this.tags=Object.assign({},s.defaultTags,t)}clone(){let e=new s(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new s(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:s.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},s.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:s.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},s.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[r,o]=n;return this.tags[r]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;let[r]=n;if(r==="1.1"||r==="1.2")return this.yaml.version=r,!0;{let o=/^\d+\.\d+$/.test(r);return t(6,`Unsupported YAML version ${r}`,o),!1}}default:return t(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&t("Verbatim tags must end with a >"),o)}let[,n,i]=e.match(/^(.*!)([^!]*)$/s);i||t(`The ${e} tag has no suffix`);let r=this.tags[n];if(r)try{return r+decodeURIComponent(i)}catch(o){return t(String(o)),null}return n==="!"?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+ou(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),i;if(e&&n.length>0&&Xr.isNode(e.contents)){let r={};iu.visit(e.contents,(o,a)=>{Xr.isNode(a)&&a.tag&&(r[a.tag]=!0)}),i=Object.keys(r)}else i=[];for(let[r,o]of n)r==="!!"&&o==="tag:yaml.org,2002:"||(!e||i.some(a=>a.startsWith(o)))&&t.push(`%TAG ${r} ${o}`);return t.join(` -`)}};Xe.defaultYaml={explicit:!1,version:"1.2"};Xe.defaultTags={"!!":"tag:yaml.org,2002:"};zr.Directives=Xe});var Dt=w(ze=>{"use strict";var Qr=C(),au=He();function lu(s){if(/[\x00-\x19\s,[\]{}]/.test(s)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(s)}`;throw new Error(t)}return!0}function Zr(s){let e=new Set;return au.visit(s,{Value(t,n){n.anchor&&e.add(n.anchor)}}),e}function eo(s,e){for(let t=1;;++t){let n=`${s}${t}`;if(!e.has(n))return n}}function cu(s,e){let t=[],n=new Map,i=null;return{onAnchor:r=>{t.push(r),i??(i=Zr(s));let o=eo(e,i);return i.add(o),o},setAnchors:()=>{for(let r of t){let o=n.get(r);if(typeof o=="object"&&o.anchor&&(Qr.isScalar(o.node)||Qr.isCollection(o.node)))o.node.anchor=o.anchor;else{let a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=r,a}}},sourceObjects:n}}ze.anchorIsValid=lu;ze.anchorNames=Zr;ze.createNodeAnchors=cu;ze.findNewAnchor=eo});var pn=w(to=>{"use strict";function Qe(s,e,t,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let i=0,r=n.length;i{"use strict";var uu=C();function so(s,e,t){if(Array.isArray(s))return s.map((n,i)=>so(n,String(i),t));if(s&&typeof s.toJSON=="function"){if(!t||!uu.hasAnchor(s))return s.toJSON(e,t);let n={aliasCount:0,count:1,res:void 0};t.anchors.set(s,n),t.onCreate=r=>{n.res=r,delete t.onCreate};let i=s.toJSON(e,t);return t.onCreate&&t.onCreate(i),i}return typeof s=="bigint"&&!t?.keep?Number(s):s}no.toJS=so});var Jt=w(ro=>{"use strict";var fu=pn(),io=C(),hu=se(),mn=class{constructor(e){Object.defineProperty(this,io.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:i,reviver:r}={}){if(!io.isDocument(e))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},a=hu.toJS(this,"",o);if(typeof i=="function")for(let{count:l,res:c}of o.anchors.values())i(c,l);return typeof r=="function"?fu.applyReviver(r,{"":a},"",a):a}};ro.NodeBase=mn});var Ze=w(oo=>{"use strict";var du=Dt(),pu=He(),Le=C(),mu=Jt(),gu=se(),gn=class extends mu.NodeBase{constructor(e){super(Le.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,t){let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],pu.visit(e,{Node:(r,o)=>{(Le.isAlias(o)||Le.hasAnchor(o))&&n.push(o)}}),t&&(t.aliasResolveCache=n));let i;for(let r of n){if(r===this)break;r.anchor===this.source&&(i=r)}return i}toJSON(e,t){if(!t)return{source:this.source};let{anchors:n,doc:i,maxAliasCount:r}=t,o=this.resolve(i,t);if(!o){let l=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(l)}let a=n.get(o);if(a||(gu.toJS(o,null,t),a=n.get(o)),a?.res===void 0){let l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(r>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=Gt(i,o,n)),a.count*a.aliasCount>r)){let l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}return a.res}toString(e,t,n){let i=`*${this.source}`;if(e){if(du.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let r=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(r)}if(e.implicitKey)return`${i} `}return i}};function Gt(s,e,t){if(Le.isAlias(e)){let n=e.resolve(s),i=t&&n&&t.get(n);return i?i.count*i.aliasCount:0}else if(Le.isCollection(e)){let n=0;for(let i of e.items){let r=Gt(s,i,t);r>n&&(n=r)}return n}else if(Le.isPair(e)){let n=Gt(s,e.key,t),i=Gt(s,e.value,t);return Math.max(n,i)}return 1}oo.Alias=gn});var L=w(yn=>{"use strict";var yu=C(),bu=Jt(),wu=se(),Su=s=>!s||typeof s!="function"&&typeof s!="object",ne=class extends bu.NodeBase{constructor(e){super(yu.SCALAR),this.value=e}toJSON(e,t){return t?.keep?this.value:wu.toJS(this.value,e,t)}toString(){return String(this.value)}};ne.BLOCK_FOLDED="BLOCK_FOLDED";ne.BLOCK_LITERAL="BLOCK_LITERAL";ne.PLAIN="PLAIN";ne.QUOTE_DOUBLE="QUOTE_DOUBLE";ne.QUOTE_SINGLE="QUOTE_SINGLE";yn.Scalar=ne;yn.isScalarValue=Su});var et=w(lo=>{"use strict";var Nu=Ze(),me=C(),ao=L(),Au="tag:yaml.org,2002:";function Eu(s,e,t){if(e){let n=t.filter(r=>r.tag===e),i=n.find(r=>!r.format)??n[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return t.find(n=>n.identify?.(s)&&!n.format)}function vu(s,e,t){if(me.isDocument(s)&&(s=s.contents),me.isNode(s))return s;if(me.isPair(s)){let f=t.schema[me.MAP].createNode?.(t.schema,null,t);return f.items.push(s),f}(s instanceof String||s instanceof Number||s instanceof Boolean||typeof BigInt<"u"&&s instanceof BigInt)&&(s=s.valueOf());let{aliasDuplicateObjects:n,onAnchor:i,onTagObj:r,schema:o,sourceObjects:a}=t,l;if(n&&s&&typeof s=="object"){if(l=a.get(s),l)return l.anchor??(l.anchor=i(s)),new Nu.Alias(l.anchor);l={anchor:null,node:null},a.set(s,l)}e?.startsWith("!!")&&(e=Au+e.slice(2));let c=Eu(s,e,o.tags);if(!c){if(s&&typeof s.toJSON=="function"&&(s=s.toJSON()),!s||typeof s!="object"){let f=new ao.Scalar(s);return l&&(l.node=f),f}c=s instanceof Map?o[me.MAP]:Symbol.iterator in Object(s)?o[me.SEQ]:o[me.MAP]}r&&(r(c),delete t.onTagObj);let u=c?.createNode?c.createNode(t.schema,s,t):typeof c?.nodeClass?.from=="function"?c.nodeClass.from(t.schema,s,t):new ao.Scalar(s);return e?u.tag=e:c.default||(u.tag=c.tag),l&&(l.node=u),u}lo.createNode=vu});var Ht=w(Wt=>{"use strict";var Tu=et(),X=C(),Cu=Jt();function bn(s,e,t){let n=t;for(let i=e.length-1;i>=0;--i){let r=e[i];if(typeof r=="number"&&Number.isInteger(r)&&r>=0){let o=[];o[r]=n,n=o}else n=new Map([[r,n]])}return Tu.createNode(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:s,sourceObjects:new Map})}var co=s=>s==null||typeof s=="object"&&!!s[Symbol.iterator]().next().done,wn=class extends Cu.NodeBase{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(n=>X.isNode(n)||X.isPair(n)?n.clone(e):n),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(co(e))this.add(t);else{let[n,...i]=e,r=this.get(n,!0);if(X.isCollection(r))r.addIn(i,t);else if(r===void 0&&this.schema)this.set(n,bn(this.schema,i,t));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}deleteIn(e){let[t,...n]=e;if(n.length===0)return this.delete(t);let i=this.get(t,!0);if(X.isCollection(i))return i.deleteIn(n);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...i]=e,r=this.get(n,!0);return i.length===0?!t&&X.isScalar(r)?r.value:r:X.isCollection(r)?r.getIn(i,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!X.isPair(t))return!1;let n=t.value;return n==null||e&&X.isScalar(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[t,...n]=e;if(n.length===0)return this.has(t);let i=this.get(t,!0);return X.isCollection(i)?i.hasIn(n):!1}setIn(e,t){let[n,...i]=e;if(i.length===0)this.set(n,t);else{let r=this.get(n,!0);if(X.isCollection(r))r.setIn(i,t);else if(r===void 0&&this.schema)this.set(n,bn(this.schema,i,t));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}};Wt.Collection=wn;Wt.collectionFromPath=bn;Wt.isEmptyPath=co});var tt=w(Xt=>{"use strict";var Ou=s=>s.replace(/^(?!$)(?: $)?/gm,"#");function Sn(s,e){return/^\n+$/.test(s)?s.substring(1):e?s.replace(/^(?! *$)/gm,e):s}var ku=(s,e,t)=>s.endsWith(` -`)?Sn(t,e):t.includes(` -`)?` -`+Sn(t,e):(s.endsWith(" ")?"":" ")+t;Xt.indentComment=Sn;Xt.lineComment=ku;Xt.stringifyComment=Ou});var fo=w(st=>{"use strict";var Iu="flow",Nn="block",zt="quoted";function Lu(s,e,t="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:r=20,onFold:o,onOverflow:a}={}){if(!i||i<0)return s;ii-Math.max(2,r)?c.push(0):f=i-n);let h,p,g=!1,d=-1,m=-1,b=-1;t===Nn&&(d=uo(s,d,e.length),d!==-1&&(f=d+l));for(let A;A=s[d+=1];){if(t===zt&&A==="\\"){switch(m=d,s[d+1]){case"x":d+=3;break;case"u":d+=5;break;case"U":d+=9;break;default:d+=1}b=d}if(A===` -`)t===Nn&&(d=uo(s,d,e.length)),f=d+e.length+l,h=void 0;else{if(A===" "&&p&&p!==" "&&p!==` -`&&p!==" "){let v=s[d+1];v&&v!==" "&&v!==` -`&&v!==" "&&(h=d)}if(d>=f)if(h)c.push(h),f=h+l,h=void 0;else if(t===zt){for(;p===" "||p===" ";)p=A,A=s[d+=1],g=!0;let v=d>b+1?d-2:m-1;if(u[v])return s;c.push(v),u[v]=!0,f=v+l,h=void 0}else g=!0}p=A}if(g&&a&&a(),c.length===0)return s;o&&o();let y=s.slice(0,c[0]);for(let A=0;A{"use strict";var J=L(),ie=fo(),Zt=(s,e)=>({indentAtStart:e?s.indent.length:s.indentAtStart,lineWidth:s.options.lineWidth,minContentWidth:s.options.minContentWidth}),es=s=>/^(%|---|\.\.\.)/m.test(s);function qu(s,e,t){if(!e||e<0)return!1;let n=e-t,i=s.length;if(i<=n)return!1;for(let r=0,o=0;rn)return!0;if(o=r+1,i-o<=n)return!1}return!0}function nt(s,e){let t=JSON.stringify(s);if(e.options.doubleQuotedAsJSON)return t;let{implicitKey:n}=e,i=e.options.doubleQuotedMinMultiLineLength,r=e.indent||(es(s)?" ":""),o="",a=0;for(let l=0,c=t[l];c;c=t[++l])if(c===" "&&t[l+1]==="\\"&&t[l+2]==="n"&&(o+=t.slice(a,l)+"\\ ",l+=1,a=l,c="\\"),c==="\\")switch(t[l+1]){case"u":{o+=t.slice(a,l);let u=t.substr(l+2,4);switch(u){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:u.substr(0,2)==="00"?o+="\\x"+u.substr(2):o+=t.substr(l,6)}l+=5,a=l+1}break;case"n":if(n||t[l+2]==='"'||t.length -`;let f,h;for(h=t.length;h>0;--h){let E=t[h-1];if(E!==` -`&&E!==" "&&E!==" ")break}let p=t.substring(h),g=p.indexOf(` -`);g===-1?f="-":t===p||g!==p.length-1?(f="+",r&&r()):f="",p&&(t=t.slice(0,-p.length),p[p.length-1]===` -`&&(p=p.slice(0,-1)),p=p.replace(En,`$&${c}`));let d=!1,m,b=-1;for(m=0;m{N=!0});let S=ie.foldFlowLines(`${y}${E}${p}`,c,ie.FOLD_BLOCK,O);if(!N)return`>${v} -${c}${S}`}return t=t.replace(/\n+/g,`$&${c}`),`|${v} -${c}${y}${t}${p}`}function Pu(s,e,t,n){let{type:i,value:r}=s,{actualString:o,implicitKey:a,indent:l,indentStep:c,inFlow:u}=e;if(a&&r.includes(` -`)||u&&/[[\]{},]/.test(r))return qe(r,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(r))return a||u||!r.includes(` -`)?qe(r,e):Qt(s,e,t,n);if(!a&&!u&&i!==J.Scalar.PLAIN&&r.includes(` -`))return Qt(s,e,t,n);if(es(r)){if(l==="")return e.forceBlockIndent=!0,Qt(s,e,t,n);if(a&&l===c)return qe(r,e)}let f=r.replace(/\n+/g,`$& -${l}`);if(o){let h=d=>d.default&&d.tag!=="tag:yaml.org,2002:str"&&d.test?.test(f),{compat:p,tags:g}=e.doc.schema;if(g.some(h)||p?.some(h))return qe(r,e)}return a?f:ie.foldFlowLines(f,l,ie.FOLD_FLOW,Zt(e,!1))}function _u(s,e,t,n){let{implicitKey:i,inFlow:r}=e,o=typeof s.value=="string"?s:Object.assign({},s,{value:String(s.value)}),{type:a}=s;a!==J.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=J.Scalar.QUOTE_DOUBLE);let l=u=>{switch(u){case J.Scalar.BLOCK_FOLDED:case J.Scalar.BLOCK_LITERAL:return i||r?qe(o.value,e):Qt(o,e,t,n);case J.Scalar.QUOTE_DOUBLE:return nt(o.value,e);case J.Scalar.QUOTE_SINGLE:return An(o.value,e);case J.Scalar.PLAIN:return Pu(o,e,t,n);default:return null}},c=l(a);if(c===null){let{defaultKeyType:u,defaultStringType:f}=e.options,h=i&&u||f;if(c=l(h),c===null)throw new Error(`Unsupported default string type ${h}`)}return c}ho.stringifyString=_u});var rt=w(vn=>{"use strict";var xu=Dt(),re=C(),Mu=tt(),$u=it();function Ru(s,e){let t=Object.assign({blockQuote:!0,commentString:Mu.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},s.schema.toStringOptions,e),n;switch(t.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:s,flowCollectionPadding:t.flowCollectionPadding?" ":"",indent:"",indentStep:typeof t.indent=="number"?" ".repeat(t.indent):" ",inFlow:n,options:t}}function Fu(s,e){if(e.tag){let i=s.filter(r=>r.tag===e.tag);if(i.length>0)return i.find(r=>r.format===e.format)??i[0]}let t,n;if(re.isScalar(e)){n=e.value;let i=s.filter(r=>r.identify?.(n));if(i.length>1){let r=i.filter(o=>o.test);r.length>0&&(i=r)}t=i.find(r=>r.format===e.format)??i.find(r=>!r.format)}else n=e,t=s.find(i=>i.nodeClass&&n instanceof i.nodeClass);if(!t){let i=n?.constructor?.name??(n===null?"null":typeof n);throw new Error(`Tag not resolved for ${i} value`)}return t}function Bu(s,e,{anchors:t,doc:n}){if(!n.directives)return"";let i=[],r=(re.isScalar(s)||re.isCollection(s))&&s.anchor;r&&xu.anchorIsValid(r)&&(t.add(r),i.push(`&${r}`));let o=s.tag??(e.default?null:e.tag);return o&&i.push(n.directives.tagString(o)),i.join(" ")}function Vu(s,e,t,n){if(re.isPair(s))return s.toString(e,t,n);if(re.isAlias(s)){if(e.doc.directives)return s.toString(e);if(e.resolvedAliases?.has(s))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(s):e.resolvedAliases=new Set([s]),s=s.resolve(e.doc)}let i,r=re.isNode(s)?s:e.doc.createNode(s,{onTagObj:l=>i=l});i??(i=Fu(e.doc.schema.tags,r));let o=Bu(r,i,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);let a=typeof i.stringify=="function"?i.stringify(r,e,t,n):re.isScalar(r)?$u.stringifyString(r,e,t,n):r.toString(e,t,n);return o?re.isScalar(r)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o} -${e.indent}${a}`:a}vn.createStringifyContext=Ru;vn.stringify=Vu});var yo=w(go=>{"use strict";var Z=C(),po=L(),mo=rt(),ot=tt();function ju({key:s,value:e},t,n,i){let{allNullValues:r,doc:o,indent:a,indentStep:l,options:{commentString:c,indentSeq:u,simpleKeys:f}}=t,h=Z.isNode(s)&&s.comment||null;if(f){if(h)throw new Error("With simple keys, key nodes cannot have comments");if(Z.isCollection(s)||!Z.isNode(s)&&typeof s=="object"){let O="With simple keys, collection cannot be used as a key value";throw new Error(O)}}let p=!f&&(!s||h&&e==null&&!t.inFlow||Z.isCollection(s)||(Z.isScalar(s)?s.type===po.Scalar.BLOCK_FOLDED||s.type===po.Scalar.BLOCK_LITERAL:typeof s=="object"));t=Object.assign({},t,{allNullValues:!1,implicitKey:!p&&(f||!r),indent:a+l});let g=!1,d=!1,m=mo.stringify(s,t,()=>g=!0,()=>d=!0);if(!p&&!t.inFlow&&m.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");p=!0}if(t.inFlow){if(r||e==null)return g&&n&&n(),m===""?"?":p?`? ${m}`:m}else if(r&&!f||e==null&&p)return m=`? ${m}`,h&&!g?m+=ot.lineComment(m,t.indent,c(h)):d&&i&&i(),m;g&&(h=null),p?(h&&(m+=ot.lineComment(m,t.indent,c(h))),m=`? ${m} -${a}:`):(m=`${m}:`,h&&(m+=ot.lineComment(m,t.indent,c(h))));let b,y,A;Z.isNode(e)?(b=!!e.spaceBefore,y=e.commentBefore,A=e.comment):(b=!1,y=null,A=null,e&&typeof e=="object"&&(e=o.createNode(e))),t.implicitKey=!1,!p&&!h&&Z.isScalar(e)&&(t.indentAtStart=m.length+1),d=!1,!u&&l.length>=2&&!t.inFlow&&!p&&Z.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(t.indent=t.indent.substring(2));let v=!1,E=mo.stringify(e,t,()=>v=!0,()=>d=!0),N=" ";if(h||b||y){if(N=b?` -`:"",y){let O=c(y);N+=` -${ot.indentComment(O,t.indent)}`}E===""&&!t.inFlow?N===` -`&&A&&(N=` - -`):N+=` -${t.indent}`}else if(!p&&Z.isCollection(e)){let O=E[0],S=E.indexOf(` -`),q=S!==-1,ee=t.inFlow??e.flow??e.items.length===0;if(q||!ee){let Ne=!1;if(q&&(O==="&"||O==="!")){let P=E.indexOf(" ");O==="&"&&P!==-1&&P{"use strict";var bo=Ot("process");function Uu(s,...e){s==="debug"&&console.log(...e)}function Ku(s,e){(s==="debug"||s==="warn")&&(typeof bo.emitWarning=="function"?bo.emitWarning(e):console.warn(e))}Tn.debug=Uu;Tn.warn=Ku});var is=w(ns=>{"use strict";var at=C(),wo=L(),ts="<<",ss={identify:s=>s===ts||typeof s=="symbol"&&s.description===ts,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new wo.Scalar(Symbol(ts)),{addToJSMap:So}),stringify:()=>ts},Yu=(s,e)=>(ss.identify(e)||at.isScalar(e)&&(!e.type||e.type===wo.Scalar.PLAIN)&&ss.identify(e.value))&&s?.doc.schema.tags.some(t=>t.tag===ss.tag&&t.default);function So(s,e,t){if(t=s&&at.isAlias(t)?t.resolve(s.doc):t,at.isSeq(t))for(let n of t.items)On(s,e,n);else if(Array.isArray(t))for(let n of t)On(s,e,n);else On(s,e,t)}function On(s,e,t){let n=s&&at.isAlias(t)?t.resolve(s.doc):t;if(!at.isMap(n))throw new Error("Merge sources must be maps or map aliases");let i=n.toJSON(null,s,Map);for(let[r,o]of i)e instanceof Map?e.has(r)||e.set(r,o):e instanceof Set?e.add(r):Object.prototype.hasOwnProperty.call(e,r)||Object.defineProperty(e,r,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}ns.addMergeToJSMap=So;ns.isMergeKey=Yu;ns.merge=ss});var In=w(Eo=>{"use strict";var Du=Cn(),No=is(),Ju=rt(),Ao=C(),kn=se();function Gu(s,e,{key:t,value:n}){if(Ao.isNode(t)&&t.addToJSMap)t.addToJSMap(s,e,n);else if(No.isMergeKey(s,t))No.addMergeToJSMap(s,e,n);else{let i=kn.toJS(t,"",s);if(e instanceof Map)e.set(i,kn.toJS(n,i,s));else if(e instanceof Set)e.add(i);else{let r=Wu(t,i,s),o=kn.toJS(n,r,s);r in e?Object.defineProperty(e,r,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[r]=o}}return e}function Wu(s,e,t){if(e===null)return"";if(typeof e!="object")return String(e);if(Ao.isNode(s)&&t?.doc){let n=Ju.createStringifyContext(t.doc,{});n.anchors=new Set;for(let r of t.anchors.keys())n.anchors.add(r.anchor);n.inFlow=!0,n.inStringifyKey=!0;let i=s.toString(n);if(!t.mapKeyWarned){let r=JSON.stringify(i);r.length>40&&(r=r.substring(0,36)+'..."'),Du.warn(t.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${r}. Set mapAsMap: true to use object keys.`),t.mapKeyWarned=!0}return i}return JSON.stringify(e)}Eo.addPairToJSMap=Gu});var oe=w(Ln=>{"use strict";var vo=et(),Hu=yo(),Xu=In(),rs=C();function zu(s,e,t){let n=vo.createNode(s,void 0,t),i=vo.createNode(e,void 0,t);return new os(n,i)}var os=class s{constructor(e,t=null){Object.defineProperty(this,rs.NODE_TYPE,{value:rs.PAIR}),this.key=e,this.value=t}clone(e){let{key:t,value:n}=this;return rs.isNode(t)&&(t=t.clone(e)),rs.isNode(n)&&(n=n.clone(e)),new s(t,n)}toJSON(e,t){let n=t?.mapAsMap?new Map:{};return Xu.addPairToJSMap(t,n,this)}toString(e,t,n){return e?.doc?Hu.stringifyPair(this,e,t,n):JSON.stringify(this)}};Ln.Pair=os;Ln.createPair=zu});var qn=w(Co=>{"use strict";var ge=C(),To=rt(),as=tt();function Qu(s,e,t){return(e.inFlow??s.flow?ef:Zu)(s,e,t)}function Zu({comment:s,items:e},t,{blockItemPrefix:n,flowChars:i,itemIndent:r,onChompKeep:o,onComment:a}){let{indent:l,options:{commentString:c}}=t,u=Object.assign({},t,{indent:r,type:null}),f=!1,h=[];for(let g=0;gm=null,()=>f=!0);m&&(b+=as.lineComment(b,r,c(m))),f&&m&&(f=!1),h.push(n+b)}let p;if(h.length===0)p=i.start+i.end;else{p=h[0];for(let g=1;gm=null);c||(c=f.length>u||b.includes(` -`)),g0&&(c||(c=f.reduce((y,A)=>y+A.length+2,2)+(b.length+2)>e.options.lineWidth)),c&&(b+=",")),m&&(b+=as.lineComment(b,n,a(m))),f.push(b),u=f.length}let{start:h,end:p}=t;if(f.length===0)return h+p;if(!c){let g=f.reduce((d,m)=>d+m.length+2,2);c=e.options.lineWidth>0&&g>e.options.lineWidth}if(c){let g=h;for(let d of f)g+=d?` -${r}${i}${d}`:` -`;return`${g} -${i}${p}`}else return`${h}${o}${f.join(" ")}${o}${p}`}function ls({indent:s,options:{commentString:e}},t,n,i){if(n&&i&&(n=n.replace(/^\n+/,"")),n){let r=as.indentComment(e(n),s);t.push(r.trimStart())}}Co.stringifyCollection=Qu});var le=w(_n=>{"use strict";var tf=qn(),sf=In(),nf=Ht(),ae=C(),cs=oe(),rf=L();function lt(s,e){let t=ae.isScalar(e)?e.value:e;for(let n of s)if(ae.isPair(n)&&(n.key===e||n.key===t||ae.isScalar(n.key)&&n.key.value===t))return n}var Pn=class extends nf.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(ae.MAP,e),this.items=[]}static from(e,t,n){let{keepUndefined:i,replacer:r}=n,o=new this(e),a=(l,c)=>{if(typeof r=="function")c=r.call(t,l,c);else if(Array.isArray(r)&&!r.includes(l))return;(c!==void 0||i)&&o.items.push(cs.createPair(l,c,n))};if(t instanceof Map)for(let[l,c]of t)a(l,c);else if(t&&typeof t=="object")for(let l of Object.keys(t))a(l,t[l]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,t){let n;ae.isPair(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new cs.Pair(e,e?.value):n=new cs.Pair(e.key,e.value);let i=lt(this.items,n.key),r=this.schema?.sortMapEntries;if(i){if(!t)throw new Error(`Key ${n.key} already set`);ae.isScalar(i.value)&&rf.isScalarValue(n.value)?i.value.value=n.value:i.value=n.value}else if(r){let o=this.items.findIndex(a=>r(n,a)<0);o===-1?this.items.push(n):this.items.splice(o,0,n)}else this.items.push(n)}delete(e){let t=lt(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let i=lt(this.items,e)?.value;return(!t&&ae.isScalar(i)?i.value:i)??void 0}has(e){return!!lt(this.items,e)}set(e,t){this.add(new cs.Pair(e,t),!0)}toJSON(e,t,n){let i=n?new n:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(i);for(let r of this.items)sf.addPairToJSMap(t,i,r);return i}toString(e,t,n){if(!e)return JSON.stringify(this);for(let i of this.items)if(!ae.isPair(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),tf.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:t})}};_n.YAMLMap=Pn;_n.findPair=lt});var Pe=w(ko=>{"use strict";var of=C(),Oo=le(),af={collection:"map",default:!0,nodeClass:Oo.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(s,e){return of.isMap(s)||e("Expected a mapping for this tag"),s},createNode:(s,e,t)=>Oo.YAMLMap.from(s,e,t)};ko.map=af});var ce=w(Io=>{"use strict";var lf=et(),cf=qn(),uf=Ht(),fs=C(),ff=L(),hf=se(),xn=class extends uf.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(fs.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=us(e);return typeof t!="number"?!1:this.items.splice(t,1).length>0}get(e,t){let n=us(e);if(typeof n!="number")return;let i=this.items[n];return!t&&fs.isScalar(i)?i.value:i}has(e){let t=us(e);return typeof t=="number"&&t=0?e:null}Io.YAMLSeq=xn});var _e=w(qo=>{"use strict";var df=C(),Lo=ce(),pf={collection:"seq",default:!0,nodeClass:Lo.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(s,e){return df.isSeq(s)||e("Expected a sequence for this tag"),s},createNode:(s,e,t)=>Lo.YAMLSeq.from(s,e,t)};qo.seq=pf});var ct=w(Po=>{"use strict";var mf=it(),gf={identify:s=>typeof s=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:s=>s,stringify(s,e,t,n){return e=Object.assign({actualString:!0},e),mf.stringifyString(s,e,t,n)}};Po.string=gf});var hs=w(Mo=>{"use strict";var _o=L(),xo={identify:s=>s==null,createNode:()=>new _o.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new _o.Scalar(null),stringify:({source:s},e)=>typeof s=="string"&&xo.test.test(s)?s:e.options.nullStr};Mo.nullTag=xo});var Mn=w(Ro=>{"use strict";var yf=L(),$o={identify:s=>typeof s=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:s=>new yf.Scalar(s[0]==="t"||s[0]==="T"),stringify({source:s,value:e},t){if(s&&$o.test.test(s)){let n=s[0]==="t"||s[0]==="T";if(e===n)return s}return e?t.options.trueStr:t.options.falseStr}};Ro.boolTag=$o});var xe=w(Fo=>{"use strict";function bf({format:s,minFractionDigits:e,tag:t,value:n}){if(typeof n=="bigint")return String(n);let i=typeof n=="number"?n:Number(n);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let r=Object.is(n,-0)?"-0":JSON.stringify(n);if(!s&&e&&(!t||t==="tag:yaml.org,2002:float")&&/^\d/.test(r)){let o=r.indexOf(".");o<0&&(o=r.length,r+=".");let a=e-(r.length-o-1);for(;a-- >0;)r+="0"}return r}Fo.stringifyNumber=bf});var Rn=w(ds=>{"use strict";var wf=L(),$n=xe(),Sf={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:s=>s.slice(-3).toLowerCase()==="nan"?NaN:s[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:$n.stringifyNumber},Nf={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:s=>parseFloat(s),stringify(s){let e=Number(s.value);return isFinite(e)?e.toExponential():$n.stringifyNumber(s)}},Af={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(s){let e=new wf.Scalar(parseFloat(s)),t=s.indexOf(".");return t!==-1&&s[s.length-1]==="0"&&(e.minFractionDigits=s.length-t-1),e},stringify:$n.stringifyNumber};ds.float=Af;ds.floatExp=Nf;ds.floatNaN=Sf});var Bn=w(ms=>{"use strict";var Bo=xe(),ps=s=>typeof s=="bigint"||Number.isInteger(s),Fn=(s,e,t,{intAsBigInt:n})=>n?BigInt(s):parseInt(s.substring(e),t);function Vo(s,e,t){let{value:n}=s;return ps(n)&&n>=0?t+n.toString(e):Bo.stringifyNumber(s)}var Ef={identify:s=>ps(s)&&s>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(s,e,t)=>Fn(s,2,8,t),stringify:s=>Vo(s,8,"0o")},vf={identify:ps,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(s,e,t)=>Fn(s,0,10,t),stringify:Bo.stringifyNumber},Tf={identify:s=>ps(s)&&s>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(s,e,t)=>Fn(s,2,16,t),stringify:s=>Vo(s,16,"0x")};ms.int=vf;ms.intHex=Tf;ms.intOct=Ef});var Uo=w(jo=>{"use strict";var Cf=Pe(),Of=hs(),kf=_e(),If=ct(),Lf=Mn(),Vn=Rn(),jn=Bn(),qf=[Cf.map,kf.seq,If.string,Of.nullTag,Lf.boolTag,jn.intOct,jn.int,jn.intHex,Vn.floatNaN,Vn.floatExp,Vn.float];jo.schema=qf});var Do=w(Yo=>{"use strict";var Pf=L(),_f=Pe(),xf=_e();function Ko(s){return typeof s=="bigint"||Number.isInteger(s)}var gs=({value:s})=>JSON.stringify(s),Mf=[{identify:s=>typeof s=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:s=>s,stringify:gs},{identify:s=>s==null,createNode:()=>new Pf.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:gs},{identify:s=>typeof s=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:s=>s==="true",stringify:gs},{identify:Ko,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(s,e,{intAsBigInt:t})=>t?BigInt(s):parseInt(s,10),stringify:({value:s})=>Ko(s)?s.toString():JSON.stringify(s)},{identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:s=>parseFloat(s),stringify:gs}],$f={default:!0,tag:"",test:/^/,resolve(s,e){return e(`Unresolved plain scalar ${JSON.stringify(s)}`),s}},Rf=[_f.map,xf.seq].concat(Mf,$f);Yo.schema=Rf});var Kn=w(Jo=>{"use strict";var ut=Ot("buffer"),Un=L(),Ff=it(),Bf={identify:s=>s instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(s,e){if(typeof ut.Buffer=="function")return ut.Buffer.from(s,"base64");if(typeof atob=="function"){let t=atob(s.replace(/[\n\r]/g,"")),n=new Uint8Array(t.length);for(let i=0;i{"use strict";var ys=C(),Yn=oe(),Vf=L(),jf=ce();function Go(s,e){if(ys.isSeq(s))for(let t=0;t1&&e("Each pair must have its own sequence indicator");let i=n.items[0]||new Yn.Pair(new Vf.Scalar(null));if(n.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${n.commentBefore} -${i.key.commentBefore}`:n.commentBefore),n.comment){let r=i.value??i.key;r.comment=r.comment?`${n.comment} -${r.comment}`:n.comment}n=i}s.items[t]=ys.isPair(n)?n:new Yn.Pair(n)}}else e("Expected a sequence for this tag");return s}function Wo(s,e,t){let{replacer:n}=t,i=new jf.YAMLSeq(s);i.tag="tag:yaml.org,2002:pairs";let r=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof n=="function"&&(o=n.call(e,String(r++),o));let a,l;if(Array.isArray(o))if(o.length===2)a=o[0],l=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let c=Object.keys(o);if(c.length===1)a=c[0],l=o[a];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else a=o;i.items.push(Yn.createPair(a,l,t))}return i}var Uf={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Go,createNode:Wo};bs.createPairs=Wo;bs.pairs=Uf;bs.resolvePairs=Go});var Gn=w(Jn=>{"use strict";var Ho=C(),Dn=se(),ft=le(),Kf=ce(),Xo=ws(),ye=class s extends Kf.YAMLSeq{constructor(){super(),this.add=ft.YAMLMap.prototype.add.bind(this),this.delete=ft.YAMLMap.prototype.delete.bind(this),this.get=ft.YAMLMap.prototype.get.bind(this),this.has=ft.YAMLMap.prototype.has.bind(this),this.set=ft.YAMLMap.prototype.set.bind(this),this.tag=s.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t?.onCreate&&t.onCreate(n);for(let i of this.items){let r,o;if(Ho.isPair(i)?(r=Dn.toJS(i.key,"",t),o=Dn.toJS(i.value,r,t)):r=Dn.toJS(i,"",t),n.has(r))throw new Error("Ordered maps must not include duplicate keys");n.set(r,o)}return n}static from(e,t,n){let i=Xo.createPairs(e,t,n),r=new this;return r.items=i.items,r}};ye.tag="tag:yaml.org,2002:omap";var Yf={collection:"seq",identify:s=>s instanceof Map,nodeClass:ye,default:!1,tag:"tag:yaml.org,2002:omap",resolve(s,e){let t=Xo.resolvePairs(s,e),n=[];for(let{key:i}of t.items)Ho.isScalar(i)&&(n.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new ye,t)},createNode:(s,e,t)=>ye.from(s,e,t)};Jn.YAMLOMap=ye;Jn.omap=Yf});var ta=w(Wn=>{"use strict";var zo=L();function Qo({value:s,source:e},t){return e&&(s?Zo:ea).test.test(e)?e:s?t.options.trueStr:t.options.falseStr}var Zo={identify:s=>s===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new zo.Scalar(!0),stringify:Qo},ea={identify:s=>s===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new zo.Scalar(!1),stringify:Qo};Wn.falseTag=ea;Wn.trueTag=Zo});var sa=w(Ss=>{"use strict";var Df=L(),Hn=xe(),Jf={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:s=>s.slice(-3).toLowerCase()==="nan"?NaN:s[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Hn.stringifyNumber},Gf={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:s=>parseFloat(s.replace(/_/g,"")),stringify(s){let e=Number(s.value);return isFinite(e)?e.toExponential():Hn.stringifyNumber(s)}},Wf={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(s){let e=new Df.Scalar(parseFloat(s.replace(/_/g,""))),t=s.indexOf(".");if(t!==-1){let n=s.substring(t+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:Hn.stringifyNumber};Ss.float=Wf;Ss.floatExp=Gf;Ss.floatNaN=Jf});var ia=w(dt=>{"use strict";var na=xe(),ht=s=>typeof s=="bigint"||Number.isInteger(s);function Ns(s,e,t,{intAsBigInt:n}){let i=s[0];if((i==="-"||i==="+")&&(e+=1),s=s.substring(e).replace(/_/g,""),n){switch(t){case 2:s=`0b${s}`;break;case 8:s=`0o${s}`;break;case 16:s=`0x${s}`;break}let o=BigInt(s);return i==="-"?BigInt(-1)*o:o}let r=parseInt(s,t);return i==="-"?-1*r:r}function Xn(s,e,t){let{value:n}=s;if(ht(n)){let i=n.toString(e);return n<0?"-"+t+i.substr(1):t+i}return na.stringifyNumber(s)}var Hf={identify:ht,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(s,e,t)=>Ns(s,2,2,t),stringify:s=>Xn(s,2,"0b")},Xf={identify:ht,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(s,e,t)=>Ns(s,1,8,t),stringify:s=>Xn(s,8,"0")},zf={identify:ht,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(s,e,t)=>Ns(s,0,10,t),stringify:na.stringifyNumber},Qf={identify:ht,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(s,e,t)=>Ns(s,2,16,t),stringify:s=>Xn(s,16,"0x")};dt.int=zf;dt.intBin=Hf;dt.intHex=Qf;dt.intOct=Xf});var Qn=w(zn=>{"use strict";var vs=C(),As=oe(),Es=le(),be=class s extends Es.YAMLMap{constructor(e){super(e),this.tag=s.tag}add(e){let t;vs.isPair(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new As.Pair(e.key,null):t=new As.Pair(e,null),Es.findPair(this.items,t.key)||this.items.push(t)}get(e,t){let n=Es.findPair(this.items,e);return!t&&vs.isPair(n)?vs.isScalar(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=Es.findPair(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new As.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw new Error("Set items must all have null values")}static from(e,t,n){let{replacer:i}=n,r=new this(e);if(t&&Symbol.iterator in Object(t))for(let o of t)typeof i=="function"&&(o=i.call(t,o,o)),r.items.push(As.createPair(o,null,n));return r}};be.tag="tag:yaml.org,2002:set";var Zf={collection:"map",identify:s=>s instanceof Set,nodeClass:be,default:!1,tag:"tag:yaml.org,2002:set",createNode:(s,e,t)=>be.from(s,e,t),resolve(s,e){if(vs.isMap(s)){if(s.hasAllNullValues(!0))return Object.assign(new be,s);e("Set items must all have null values")}else e("Expected a mapping for this tag");return s}};zn.YAMLSet=be;zn.set=Zf});var ei=w(Ts=>{"use strict";var eh=xe();function Zn(s,e){let t=s[0],n=t==="-"||t==="+"?s.substring(1):s,i=o=>e?BigInt(o):Number(o),r=n.replace(/_/g,"").split(":").reduce((o,a)=>o*i(60)+i(a),i(0));return t==="-"?i(-1)*r:r}function ra(s){let{value:e}=s,t=o=>o;if(typeof e=="bigint")t=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return eh.stringifyNumber(s);let n="";e<0&&(n="-",e*=t(-1));let i=t(60),r=[e%i];return e<60?r.unshift(0):(e=(e-r[0])/i,r.unshift(e%i),e>=60&&(e=(e-r[0])/i,r.unshift(e))),n+r.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var th={identify:s=>typeof s=="bigint"||Number.isInteger(s),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(s,e,{intAsBigInt:t})=>Zn(s,t),stringify:ra},sh={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:s=>Zn(s,!1),stringify:ra},oa={identify:s=>s instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(s){let e=s.match(oa.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,t,n,i,r,o,a]=e.map(Number),l=e[7]?Number((e[7]+"00").substr(1,3)):0,c=Date.UTC(t,n-1,i,r||0,o||0,a||0,l),u=e[8];if(u&&u!=="Z"){let f=Zn(u,!1);Math.abs(f)<30&&(f*=60),c-=6e4*f}return new Date(c)},stringify:({value:s})=>s?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};Ts.floatTime=sh;Ts.intTime=th;Ts.timestamp=oa});var ca=w(la=>{"use strict";var nh=Pe(),ih=hs(),rh=_e(),oh=ct(),ah=Kn(),aa=ta(),ti=sa(),Cs=ia(),lh=is(),ch=Gn(),uh=ws(),fh=Qn(),si=ei(),hh=[nh.map,rh.seq,oh.string,ih.nullTag,aa.trueTag,aa.falseTag,Cs.intBin,Cs.intOct,Cs.int,Cs.intHex,ti.floatNaN,ti.floatExp,ti.float,ah.binary,lh.merge,ch.omap,uh.pairs,fh.set,si.intTime,si.floatTime,si.timestamp];la.schema=hh});var wa=w(ri=>{"use strict";var da=Pe(),dh=hs(),pa=_e(),ph=ct(),mh=Mn(),ni=Rn(),ii=Bn(),gh=Uo(),yh=Do(),ma=Kn(),pt=is(),ga=Gn(),ya=ws(),ua=ca(),ba=Qn(),Os=ei(),fa=new Map([["core",gh.schema],["failsafe",[da.map,pa.seq,ph.string]],["json",yh.schema],["yaml11",ua.schema],["yaml-1.1",ua.schema]]),ha={binary:ma.binary,bool:mh.boolTag,float:ni.float,floatExp:ni.floatExp,floatNaN:ni.floatNaN,floatTime:Os.floatTime,int:ii.int,intHex:ii.intHex,intOct:ii.intOct,intTime:Os.intTime,map:da.map,merge:pt.merge,null:dh.nullTag,omap:ga.omap,pairs:ya.pairs,seq:pa.seq,set:ba.set,timestamp:Os.timestamp},bh={"tag:yaml.org,2002:binary":ma.binary,"tag:yaml.org,2002:merge":pt.merge,"tag:yaml.org,2002:omap":ga.omap,"tag:yaml.org,2002:pairs":ya.pairs,"tag:yaml.org,2002:set":ba.set,"tag:yaml.org,2002:timestamp":Os.timestamp};function wh(s,e,t){let n=fa.get(e);if(n&&!s)return t&&!n.includes(pt.merge)?n.concat(pt.merge):n.slice();let i=n;if(!i)if(Array.isArray(s))i=[];else{let r=Array.from(fa.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${r} or define customTags array`)}if(Array.isArray(s))for(let r of s)i=i.concat(r);else typeof s=="function"&&(i=s(i.slice()));return t&&(i=i.concat(pt.merge)),i.reduce((r,o)=>{let a=typeof o=="string"?ha[o]:o;if(!a){let l=JSON.stringify(o),c=Object.keys(ha).map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag ${l}; use one of ${c}`)}return r.includes(a)||r.push(a),r},[])}ri.coreKnownTags=bh;ri.getTags=wh});var li=w(Sa=>{"use strict";var oi=C(),Sh=Pe(),Nh=_e(),Ah=ct(),ks=wa(),Eh=(s,e)=>s.keye.key?1:0,ai=class s{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:i,schema:r,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?ks.getTags(e,"compat"):e?ks.getTags(null,e):null,this.name=typeof r=="string"&&r||"core",this.knownTags=i?ks.coreKnownTags:{},this.tags=ks.getTags(t,this.name,n),this.toStringOptions=a??null,Object.defineProperty(this,oi.MAP,{value:Sh.map}),Object.defineProperty(this,oi.SCALAR,{value:Ah.string}),Object.defineProperty(this,oi.SEQ,{value:Nh.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?Eh:null}clone(){let e=Object.create(s.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};Sa.Schema=ai});var Aa=w(Na=>{"use strict";var vh=C(),ci=rt(),mt=tt();function Th(s,e){let t=[],n=e.directives===!0;if(e.directives!==!1&&s.directives){let l=s.directives.toString(s);l?(t.push(l),n=!0):s.directives.docStart&&(n=!0)}n&&t.push("---");let i=ci.createStringifyContext(s,e),{commentString:r}=i.options;if(s.commentBefore){t.length!==1&&t.unshift("");let l=r(s.commentBefore);t.unshift(mt.indentComment(l,""))}let o=!1,a=null;if(s.contents){if(vh.isNode(s.contents)){if(s.contents.spaceBefore&&n&&t.push(""),s.contents.commentBefore){let u=r(s.contents.commentBefore);t.push(mt.indentComment(u,""))}i.forceBlockIndent=!!s.comment,a=s.contents.comment}let l=a?void 0:()=>o=!0,c=ci.stringify(s.contents,i,()=>a=null,l);a&&(c+=mt.lineComment(c,"",r(a))),(c[0]==="|"||c[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${c}`:t.push(c)}else t.push(ci.stringify(s.contents,i));if(s.directives?.docEnd)if(s.comment){let l=r(s.comment);l.includes(` -`)?(t.push("..."),t.push(mt.indentComment(l,""))):t.push(`... ${l}`)}else t.push("...");else{let l=s.comment;l&&o&&(l=l.replace(/^\n+/,"")),l&&((!o||a)&&t[t.length-1]!==""&&t.push(""),t.push(mt.indentComment(r(l),"")))}return t.join(` -`)+` -`}Na.stringifyDocument=Th});var gt=w(Ea=>{"use strict";var Ch=Ze(),Me=Ht(),Y=C(),Oh=oe(),kh=se(),Ih=li(),Lh=Aa(),ui=Dt(),qh=pn(),Ph=et(),fi=dn(),hi=class s{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Y.NODE_TYPE,{value:Y.DOC});let i=null;typeof t=="function"||Array.isArray(t)?i=t:n===void 0&&t&&(n=t,t=void 0);let r=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},n);this.options=r;let{version:o}=r;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new fi.Directives({version:o}),this.setSchema(o,n),this.contents=e===void 0?null:this.createNode(e,i,n)}clone(){let e=Object.create(s.prototype,{[Y.NODE_TYPE]:{value:Y.DOC}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=Y.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){$e(this.contents)&&this.contents.add(e)}addIn(e,t){$e(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=ui.anchorNames(this);e.anchor=!t||n.has(t)?ui.findNewAnchor(t||"a",n):t}return new Ch.Alias(e.anchor)}createNode(e,t,n){let i;if(typeof t=="function")e=t.call({"":e},"",e),i=t;else if(Array.isArray(t)){let m=y=>typeof y=="number"||y instanceof String||y instanceof Number,b=t.filter(m).map(String);b.length>0&&(t=t.concat(b)),i=t}else n===void 0&&t&&(n=t,t=void 0);let{aliasDuplicateObjects:r,anchorPrefix:o,flow:a,keepUndefined:l,onTagObj:c,tag:u}=n??{},{onAnchor:f,setAnchors:h,sourceObjects:p}=ui.createNodeAnchors(this,o||"a"),g={aliasDuplicateObjects:r??!0,keepUndefined:l??!1,onAnchor:f,onTagObj:c,replacer:i,schema:this.schema,sourceObjects:p},d=Ph.createNode(e,u,g);return a&&Y.isCollection(d)&&(d.flow=!0),h(),d}createPair(e,t,n={}){let i=this.createNode(e,null,n),r=this.createNode(t,null,n);return new Oh.Pair(i,r)}delete(e){return $e(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Me.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):$e(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return Y.isCollection(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return Me.isEmptyPath(e)?!t&&Y.isScalar(this.contents)?this.contents.value:this.contents:Y.isCollection(this.contents)?this.contents.getIn(e,t):void 0}has(e){return Y.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return Me.isEmptyPath(e)?this.contents!==void 0:Y.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=Me.collectionFromPath(this.schema,[e],t):$e(this.contents)&&this.contents.set(e,t)}setIn(e,t){Me.isEmptyPath(e)?this.contents=t:this.contents==null?this.contents=Me.collectionFromPath(this.schema,Array.from(e),t):$e(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e=="number"&&(e=String(e));let n;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new fi.Directives({version:"1.1"}),n={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new fi.Directives({version:e}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{let i=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new Ih.Schema(Object.assign(n,t));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:i,onAnchor:r,reviver:o}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},l=kh.toJS(this.contents,t??"",a);if(typeof r=="function")for(let{count:c,res:u}of a.anchors.values())r(u,c);return typeof o=="function"?qh.applyReviver(o,{"":l},"",l):l}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${t}`)}return Lh.stringifyDocument(this,e)}};function $e(s){if(Y.isCollection(s))return!0;throw new Error("Expected a YAML collection as document contents")}Ea.Document=hi});var wt=w(bt=>{"use strict";var yt=class extends Error{constructor(e,t,n,i){super(),this.name=e,this.code=n,this.message=i,this.pos=t}},di=class extends yt{constructor(e,t,n){super("YAMLParseError",e,t,n)}},pi=class extends yt{constructor(e,t,n){super("YAMLWarning",e,t,n)}},_h=(s,e)=>t=>{if(t.pos[0]===-1)return;t.linePos=t.pos.map(a=>e.linePos(a));let{line:n,col:i}=t.linePos[0];t.message+=` at line ${n}, column ${i}`;let r=i-1,o=s.substring(e.lineStarts[n-1],e.lineStarts[n]).replace(/[\n\r]+$/,"");if(r>=60&&o.length>80){let a=Math.min(r-39,o.length-79);o="\u2026"+o.substring(a),r-=a-1}if(o.length>80&&(o=o.substring(0,79)+"\u2026"),n>1&&/^ *$/.test(o.substring(0,r))){let a=s.substring(e.lineStarts[n-2],e.lineStarts[n-1]);a.length>80&&(a=a.substring(0,79)+`\u2026 -`),o=a+o}if(/[^ ]/.test(o)){let a=1,l=t.linePos[1];l?.line===n&&l.col>i&&(a=Math.max(1,Math.min(l.col-i,80-r)));let c=" ".repeat(r)+"^".repeat(a);t.message+=`: - -${o} -${c} -`}};bt.YAMLError=yt;bt.YAMLParseError=di;bt.YAMLWarning=pi;bt.prettifyError=_h});var St=w(va=>{"use strict";function xh(s,{flow:e,indicator:t,next:n,offset:i,onError:r,parentIndent:o,startOnNewline:a}){let l=!1,c=a,u=a,f="",h="",p=!1,g=!1,d=null,m=null,b=null,y=null,A=null,v=null,E=null;for(let S of s)switch(g&&(S.type!=="space"&&S.type!=="newline"&&S.type!=="comma"&&r(S.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),g=!1),d&&(c&&S.type!=="comment"&&S.type!=="newline"&&r(d,"TAB_AS_INDENT","Tabs are not allowed as indentation"),d=null),S.type){case"space":!e&&(t!=="doc-start"||n?.type!=="flow-collection")&&S.source.includes(" ")&&(d=S),u=!0;break;case"comment":{u||r(S,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let q=S.source.substring(1)||" ";f?f+=h+q:f=q,h="",c=!1;break}case"newline":c?f?f+=S.source:(!v||t!=="seq-item-ind")&&(l=!0):h+=S.source,c=!0,p=!0,(m||b)&&(y=S),u=!0;break;case"anchor":m&&r(S,"MULTIPLE_ANCHORS","A node can have at most one anchor"),S.source.endsWith(":")&&r(S.offset+S.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),m=S,E??(E=S.offset),c=!1,u=!1,g=!0;break;case"tag":{b&&r(S,"MULTIPLE_TAGS","A node can have at most one tag"),b=S,E??(E=S.offset),c=!1,u=!1,g=!0;break}case t:(m||b)&&r(S,"BAD_PROP_ORDER",`Anchors and tags must be after the ${S.source} indicator`),v&&r(S,"UNEXPECTED_TOKEN",`Unexpected ${S.source} in ${e??"collection"}`),v=S,c=t==="seq-item-ind"||t==="explicit-key-ind",u=!1;break;case"comma":if(e){A&&r(S,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),A=S,c=!1,u=!1;break}default:r(S,"UNEXPECTED_TOKEN",`Unexpected ${S.type} token`),c=!1,u=!1}let N=s[s.length-1],O=N?N.offset+N.source.length:i;return g&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!=="")&&r(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),d&&(c&&d.indent<=o||n?.type==="block-map"||n?.type==="block-seq")&&r(d,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:A,found:v,spaceBefore:l,comment:f,hasNewline:p,anchor:m,tag:b,newlineAfterProp:y,end:O,start:E??O}}va.resolveProps=xh});var Is=w(Ta=>{"use strict";function mi(s){if(!s)return null;switch(s.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(s.source.includes(` -`))return!0;if(s.end){for(let e of s.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of s.items){for(let t of e.start)if(t.type==="newline")return!0;if(e.sep){for(let t of e.sep)if(t.type==="newline")return!0}if(mi(e.key)||mi(e.value))return!0}return!1;default:return!0}}Ta.containsNewline=mi});var gi=w(Ca=>{"use strict";var Mh=Is();function $h(s,e,t){if(e?.type==="flow-collection"){let n=e.end[0];n.indent===s&&(n.source==="]"||n.source==="}")&&Mh.containsNewline(e)&&t(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}Ca.flowIndentCheck=$h});var yi=w(ka=>{"use strict";var Oa=C();function Rh(s,e,t){let{uniqueKeys:n}=s.options;if(n===!1)return!1;let i=typeof n=="function"?n:(r,o)=>r===o||Oa.isScalar(r)&&Oa.isScalar(o)&&r.value===o.value;return e.some(r=>i(r.key,t))}ka.mapIncludes=Rh});var xa=w(_a=>{"use strict";var Ia=oe(),Fh=le(),La=St(),Bh=Is(),qa=gi(),Vh=yi(),Pa="All mapping items must start at the same column";function jh({composeNode:s,composeEmptyNode:e},t,n,i,r){let o=r?.nodeClass??Fh.YAMLMap,a=new o(t.schema);t.atRoot&&(t.atRoot=!1);let l=n.offset,c=null;for(let u of n.items){let{start:f,key:h,sep:p,value:g}=u,d=La.resolveProps(f,{indicator:"explicit-key-ind",next:h??p?.[0],offset:l,onError:i,parentIndent:n.indent,startOnNewline:!0}),m=!d.found;if(m){if(h&&(h.type==="block-seq"?i(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in h&&h.indent!==n.indent&&i(l,"BAD_INDENT",Pa)),!d.anchor&&!d.tag&&!p){c=d.end,d.comment&&(a.comment?a.comment+=` -`+d.comment:a.comment=d.comment);continue}(d.newlineAfterProp||Bh.containsNewline(h))&&i(h??f[f.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else d.found?.indent!==n.indent&&i(l,"BAD_INDENT",Pa);t.atKey=!0;let b=d.end,y=h?s(t,h,d,i):e(t,b,f,null,d,i);t.schema.compat&&qa.flowIndentCheck(n.indent,h,i),t.atKey=!1,Vh.mapIncludes(t,a.items,y)&&i(b,"DUPLICATE_KEY","Map keys must be unique");let A=La.resolveProps(p??[],{indicator:"map-value-ind",next:g,offset:y.range[2],onError:i,parentIndent:n.indent,startOnNewline:!h||h.type==="block-scalar"});if(l=A.end,A.found){m&&(g?.type==="block-map"&&!A.hasNewline&&i(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),t.options.strict&&d.start{"use strict";var Uh=ce(),Kh=St(),Yh=gi();function Dh({composeNode:s,composeEmptyNode:e},t,n,i,r){let o=r?.nodeClass??Uh.YAMLSeq,a=new o(t.schema);t.atRoot&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let l=n.offset,c=null;for(let{start:u,value:f}of n.items){let h=Kh.resolveProps(u,{indicator:"seq-item-ind",next:f,offset:l,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!h.found)if(h.anchor||h.tag||f)f?.type==="block-seq"?i(h.end,"BAD_INDENT","All sequence items must start at the same column"):i(l,"MISSING_CHAR","Sequence item without - indicator");else{c=h.end,h.comment&&(a.comment=h.comment);continue}let p=f?s(t,f,h,i):e(t,h.end,u,null,h,i);t.schema.compat&&Yh.flowIndentCheck(n.indent,f,i),l=p.range[2],a.items.push(p)}return a.range=[n.offset,l,c??l],a}Ma.resolveBlockSeq=Dh});var Re=w(Ra=>{"use strict";function Jh(s,e,t,n){let i="";if(s){let r=!1,o="";for(let a of s){let{source:l,type:c}=a;switch(c){case"space":r=!0;break;case"comment":{t&&!r&&n(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=l.substring(1)||" ";i?i+=o+u:i=u,o="";break}case"newline":i&&(o+=l),r=!0;break;default:n(a,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}e+=l.length}}return{comment:i,offset:e}}Ra.resolveEnd=Jh});var ja=w(Va=>{"use strict";var Gh=C(),Wh=oe(),Fa=le(),Hh=ce(),Xh=Re(),Ba=St(),zh=Is(),Qh=yi(),bi="Block collections are not allowed within flow collections",wi=s=>s&&(s.type==="block-map"||s.type==="block-seq");function Zh({composeNode:s,composeEmptyNode:e},t,n,i,r){let o=n.start.source==="{",a=o?"flow map":"flow sequence",l=r?.nodeClass??(o?Fa.YAMLMap:Hh.YAMLSeq),c=new l(t.schema);c.flow=!0;let u=t.atRoot;u&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let f=n.offset+n.start.source.length;for(let m=0;m0){let m=Xh.resolveEnd(g,d,t.options.strict,i);m.comment&&(c.comment?c.comment+=` -`+m.comment:c.comment=m.comment),c.range=[n.offset,d,m.offset]}else c.range=[n.offset,d,d];return c}Va.resolveFlowCollection=Zh});var Ka=w(Ua=>{"use strict";var ed=C(),td=L(),sd=le(),nd=ce(),id=xa(),rd=$a(),od=ja();function Si(s,e,t,n,i,r){let o=t.type==="block-map"?id.resolveBlockMap(s,e,t,n,r):t.type==="block-seq"?rd.resolveBlockSeq(s,e,t,n,r):od.resolveFlowCollection(s,e,t,n,r),a=o.constructor;return i==="!"||i===a.tagName?(o.tag=a.tagName,o):(i&&(o.tag=i),o)}function ad(s,e,t,n,i){let r=n.tag,o=r?e.directives.tagName(r.source,h=>i(r,"TAG_RESOLVE_FAILED",h)):null;if(t.type==="block-seq"){let{anchor:h,newlineAfterProp:p}=n,g=h&&r?h.offset>r.offset?h:r:h??r;g&&(!p||p.offseth.tag===o&&h.collection===a);if(!l){let h=e.schema.knownTags[o];if(h?.collection===a)e.schema.tags.push(Object.assign({},h,{default:!1})),l=h;else return h?i(r,"BAD_COLLECTION_TYPE",`${h.tag} used for ${a} collection, but expects ${h.collection??"scalar"}`,!0):i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),Si(s,e,t,i,o)}let c=Si(s,e,t,i,o,l),u=l.resolve?.(c,h=>i(r,"TAG_RESOLVE_FAILED",h),e.options)??c,f=ed.isNode(u)?u:new td.Scalar(u);return f.range=c.range,f.tag=o,l?.format&&(f.format=l.format),f}Ua.composeCollection=ad});var Ai=w(Ya=>{"use strict";var Ni=L();function ld(s,e,t){let n=e.offset,i=cd(e,s.options.strict,t);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};let r=i.mode===">"?Ni.Scalar.BLOCK_FOLDED:Ni.Scalar.BLOCK_LITERAL,o=e.source?ud(e.source):[],a=o.length;for(let d=o.length-1;d>=0;--d){let m=o[d][1];if(m===""||m==="\r")a=d;else break}if(a===0){let d=i.chomp==="+"&&o.length>0?` -`.repeat(Math.max(1,o.length-1)):"",m=n+i.length;return e.source&&(m+=e.source.length),{value:d,type:r,comment:i.comment,range:[n,m,m]}}let l=e.indent+i.indent,c=e.offset+i.length,u=0;for(let d=0;dl&&(l=m.length);else{m.length=a;--d)o[d][0].length>l&&(a=d+1);let f="",h="",p=!1;for(let d=0;dl||b[0]===" "?(h===" "?h=` -`:!p&&h===` -`&&(h=` - -`),f+=h+m.slice(l)+b,h=` -`,p=!0):b===""?h===` -`?f+=` -`:h=` -`:(f+=h+b,h=" ",p=!1)}switch(i.chomp){case"-":break;case"+":for(let d=a;d{"use strict";var Ei=L(),fd=Re();function hd(s,e,t){let{offset:n,type:i,source:r,end:o}=s,a,l,c=(h,p,g)=>t(n+h,p,g);switch(i){case"scalar":a=Ei.Scalar.PLAIN,l=dd(r,c);break;case"single-quoted-scalar":a=Ei.Scalar.QUOTE_SINGLE,l=pd(r,c);break;case"double-quoted-scalar":a=Ei.Scalar.QUOTE_DOUBLE,l=md(r,c);break;default:return t(s,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[n,n+r.length,n+r.length]}}let u=n+r.length,f=fd.resolveEnd(o,u,e,t);return{value:l,type:a,comment:f.comment,range:[n,u,f.offset]}}function dd(s,e){let t="";switch(s[0]){case" ":t="a tab character";break;case",":t="flow indicator character ,";break;case"%":t="directive indicator character %";break;case"|":case">":{t=`block scalar indicator ${s[0]}`;break}case"@":case"`":{t=`reserved character ${s[0]}`;break}}return t&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${t}`),Da(s)}function pd(s,e){return(s[s.length-1]!=="'"||s.length===1)&&e(s.length,"MISSING_CHAR","Missing closing 'quote"),Da(s.slice(1,-1)).replace(/''/g,"'")}function Da(s){let e,t;try{e=new RegExp(`(.*?)(?r?s.slice(r,n+1):i)}else t+=i}return(s[s.length-1]!=='"'||s.length===1)&&e(s.length,"MISSING_CHAR",'Missing closing "quote'),t}function gd(s,e){let t="",n=s[e+1];for(;(n===" "||n===" "||n===` -`||n==="\r")&&!(n==="\r"&&s[e+2]!==` -`);)n===` -`&&(t+=` -`),e+=1,n=s[e+1];return t||(t=" "),{fold:t,offset:e}}var yd={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:` -`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function bd(s,e,t,n){let i=s.substr(e,t),o=i.length===t&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;if(isNaN(o)){let a=s.substr(e-2,t+2);return n(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}return String.fromCodePoint(o)}Ja.resolveFlowScalar=hd});var Ha=w(Wa=>{"use strict";var we=C(),Ga=L(),wd=Ai(),Sd=vi();function Nd(s,e,t,n){let{value:i,type:r,comment:o,range:a}=e.type==="block-scalar"?wd.resolveBlockScalar(s,e,n):Sd.resolveFlowScalar(e,s.options.strict,n),l=t?s.directives.tagName(t.source,f=>n(t,"TAG_RESOLVE_FAILED",f)):null,c;s.options.stringKeys&&s.atKey?c=s.schema[we.SCALAR]:l?c=Ad(s.schema,i,l,t,n):e.type==="scalar"?c=Ed(s,i,e,n):c=s.schema[we.SCALAR];let u;try{let f=c.resolve(i,h=>n(t??e,"TAG_RESOLVE_FAILED",h),s.options);u=we.isScalar(f)?f:new Ga.Scalar(f)}catch(f){let h=f instanceof Error?f.message:String(f);n(t??e,"TAG_RESOLVE_FAILED",h),u=new Ga.Scalar(i)}return u.range=a,u.source=i,r&&(u.type=r),l&&(u.tag=l),c.format&&(u.format=c.format),o&&(u.comment=o),u}function Ad(s,e,t,n,i){if(t==="!")return s[we.SCALAR];let r=[];for(let a of s.tags)if(!a.collection&&a.tag===t)if(a.default&&a.test)r.push(a);else return a;for(let a of r)if(a.test?.test(e))return a;let o=s.knownTags[t];return o&&!o.collection?(s.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${t}`,t!=="tag:yaml.org,2002:str"),s[we.SCALAR])}function Ed({atKey:s,directives:e,schema:t},n,i,r){let o=t.tags.find(a=>(a.default===!0||s&&a.default==="key")&&a.test?.test(n))||t[we.SCALAR];if(t.compat){let a=t.compat.find(l=>l.default&&l.test?.test(n))??t[we.SCALAR];if(o.tag!==a.tag){let l=e.tagString(o.tag),c=e.tagString(a.tag),u=`Value may be parsed as either ${l} or ${c}`;r(i,"TAG_RESOLVE_FAILED",u,!0)}}return o}Wa.composeScalar=Nd});var za=w(Xa=>{"use strict";function vd(s,e,t){if(e){t??(t=e.length);for(let n=t-1;n>=0;--n){let i=e[n];switch(i.type){case"space":case"comment":case"newline":s-=i.source.length;continue}for(i=e[++n];i?.type==="space";)s+=i.source.length,i=e[++n];break}}return s}Xa.emptyScalarPosition=vd});var el=w(Ci=>{"use strict";var Td=Ze(),Cd=C(),Od=Ka(),Qa=Ha(),kd=Re(),Id=za(),Ld={composeNode:Za,composeEmptyNode:Ti};function Za(s,e,t,n){let i=s.atKey,{spaceBefore:r,comment:o,anchor:a,tag:l}=t,c,u=!0;switch(e.type){case"alias":c=qd(s,e,n),(a||l)&&n(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":c=Qa.composeScalar(s,e,l,n),a&&(c.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{c=Od.composeCollection(Ld,s,e,t,n),a&&(c.anchor=a.source.substring(1))}catch(f){let h=f instanceof Error?f.message:String(f);n(e,"RESOURCE_EXHAUSTION",h)}break;default:{let f=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",f),u=!1}}return c??(c=Ti(s,e.offset,void 0,null,t,n)),a&&c.anchor===""&&n(a,"BAD_ALIAS","Anchor cannot be an empty string"),i&&s.options.stringKeys&&(!Cd.isScalar(c)||typeof c.value!="string"||c.tag&&c.tag!=="tag:yaml.org,2002:str")&&n(l??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),r&&(c.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?c.comment=o:c.commentBefore=o),s.options.keepSourceTokens&&u&&(c.srcToken=e),c}function Ti(s,e,t,n,{spaceBefore:i,comment:r,anchor:o,tag:a,end:l},c){let u={type:"scalar",offset:Id.emptyScalarPosition(e,t,n),indent:-1,source:""},f=Qa.composeScalar(s,u,a,c);return o&&(f.anchor=o.source.substring(1),f.anchor===""&&c(o,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(f.spaceBefore=!0),r&&(f.comment=r,f.range[2]=l),f}function qd({options:s},{offset:e,source:t,end:n},i){let r=new Td.Alias(t.substring(1));r.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),r.source.endsWith(":")&&i(e+t.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=e+t.length,a=kd.resolveEnd(n,o,s.strict,i);return r.range=[e,o,a.offset],a.comment&&(r.comment=a.comment),r}Ci.composeEmptyNode=Ti;Ci.composeNode=Za});var nl=w(sl=>{"use strict";var Pd=gt(),tl=el(),_d=Re(),xd=St();function Md(s,e,{offset:t,start:n,value:i,end:r},o){let a=Object.assign({_directives:e},s),l=new Pd.Document(void 0,a),c={atKey:!1,atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},u=xd.resolveProps(n,{indicator:"doc-start",next:i??r?.[0],offset:t,onError:o,parentIndent:0,startOnNewline:!0});u.found&&(l.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!u.hasNewline&&o(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),l.contents=i?tl.composeNode(c,i,u,o):tl.composeEmptyNode(c,u.end,n,null,u,o);let f=l.contents.range[2],h=_d.resolveEnd(r,f,!1,o);return h.comment&&(l.comment=h.comment),l.range=[t,f,h.offset],l}sl.composeDoc=Md});var ki=w(ol=>{"use strict";var $d=Ot("process"),Rd=dn(),Fd=gt(),Nt=wt(),il=C(),Bd=nl(),Vd=Re();function At(s){if(typeof s=="number")return[s,s+1];if(Array.isArray(s))return s.length===2?s:[s[0],s[1]];let{offset:e,source:t}=s;return[e,e+(typeof t=="string"?t.length:1)]}function rl(s){let e="",t=!1,n=!1;for(let i=0;i{let o=At(t);r?this.warnings.push(new Nt.YAMLWarning(o,n,i)):this.errors.push(new Nt.YAMLParseError(o,n,i))},this.directives=new Rd.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:i}=rl(this.prelude);if(n){let r=e.contents;if(t)e.comment=e.comment?`${e.comment} -${n}`:n;else if(i||e.directives.docStart||!r)e.commentBefore=n;else if(il.isCollection(r)&&!r.flow&&r.items.length>0){let o=r.items[0];il.isPair(o)&&(o=o.key);let a=o.commentBefore;o.commentBefore=a?`${n} -${a}`:n}else{let o=r.commentBefore;r.commentBefore=o?`${n} -${o}`:n}}t?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:rl(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(let i of e)yield*this.next(i);yield*this.end(t,n)}*next(e){switch($d.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(t,n,i)=>{let r=At(e);r[0]+=t,this.onError(r,"BAD_DIRECTIVE",n,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let t=Bd.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new Nt.YAMLParseError(At(e),"UNEXPECTED_TOKEN",t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){let n="Unexpected doc-end without preceding document";this.errors.push(new Nt.YAMLParseError(At(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;let t=Vd.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let n=this.doc.comment;this.doc.comment=n?`${n} -${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new Nt.YAMLParseError(At(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let n=Object.assign({_directives:this.directives},this.options),i=new Fd.Document(void 0,n);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,t,t],this.decorate(i,!1),yield i}}};ol.Composer=Oi});var cl=w(Ls=>{"use strict";var jd=Ai(),Ud=vi(),Kd=wt(),al=it();function Yd(s,e=!0,t){if(s){let n=(i,r,o)=>{let a=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(t)t(a,r,o);else throw new Kd.YAMLParseError([a,a+1],r,o)};switch(s.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Ud.resolveFlowScalar(s,e,n);case"block-scalar":return jd.resolveBlockScalar({options:{strict:e}},s,n)}}return null}function Dd(s,e){let{implicitKey:t=!1,indent:n,inFlow:i=!1,offset:r=-1,type:o="PLAIN"}=e,a=al.stringifyString({type:o,value:s},{implicitKey:t,indent:n>0?" ".repeat(n):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),l=e.end??[{type:"newline",offset:-1,indent:n,source:` -`}];switch(a[0]){case"|":case">":{let c=a.indexOf(` -`),u=a.substring(0,c),f=a.substring(c+1)+` -`,h=[{type:"block-scalar-header",offset:r,indent:n,source:u}];return ll(h,l)||h.push({type:"newline",offset:-1,indent:n,source:` -`}),{type:"block-scalar",offset:r,indent:n,props:h,source:f}}case'"':return{type:"double-quoted-scalar",offset:r,indent:n,source:a,end:l};case"'":return{type:"single-quoted-scalar",offset:r,indent:n,source:a,end:l};default:return{type:"scalar",offset:r,indent:n,source:a,end:l}}}function Jd(s,e,t={}){let{afterKey:n=!1,implicitKey:i=!1,inFlow:r=!1,type:o}=t,a="indent"in s?s.indent:null;if(n&&typeof a=="number"&&(a+=2),!o)switch(s.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{let c=s.props[0];if(c.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o=c.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}let l=al.stringifyString({type:o,value:e},{implicitKey:i||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:r,options:{blockQuote:!0,lineWidth:-1}});switch(l[0]){case"|":case">":Gd(s,l);break;case'"':Ii(s,l,"double-quoted-scalar");break;case"'":Ii(s,l,"single-quoted-scalar");break;default:Ii(s,l,"scalar")}}function Gd(s,e){let t=e.indexOf(` -`),n=e.substring(0,t),i=e.substring(t+1)+` -`;if(s.type==="block-scalar"){let r=s.props[0];if(r.type!=="block-scalar-header")throw new Error("Invalid block scalar header");r.source=n,s.source=i}else{let{offset:r}=s,o="indent"in s?s.indent:-1,a=[{type:"block-scalar-header",offset:r,indent:o,source:n}];ll(a,"end"in s?s.end:void 0)||a.push({type:"newline",offset:-1,indent:o,source:` -`});for(let l of Object.keys(s))l!=="type"&&l!=="offset"&&delete s[l];Object.assign(s,{type:"block-scalar",indent:o,props:a,source:i})}}function ll(s,e){if(e)for(let t of e)switch(t.type){case"space":case"comment":s.push(t);break;case"newline":return s.push(t),!0}return!1}function Ii(s,e,t){switch(s.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":s.type=t,s.source=e;break;case"block-scalar":{let n=s.props.slice(1),i=e.length;s.props[0].type==="block-scalar-header"&&(i-=s.props[0].source.length);for(let r of n)r.offset+=i;delete s.props,Object.assign(s,{type:t,source:e,end:n});break}case"block-map":case"block-seq":{let i={type:"newline",offset:s.offset+e.length,indent:s.indent,source:` -`};delete s.items,Object.assign(s,{type:t,source:e,end:[i]});break}default:{let n="indent"in s?s.indent:-1,i="end"in s&&Array.isArray(s.end)?s.end.filter(r=>r.type==="space"||r.type==="comment"||r.type==="newline"):[];for(let r of Object.keys(s))r!=="type"&&r!=="offset"&&delete s[r];Object.assign(s,{type:t,indent:n,source:e,end:i})}}}Ls.createScalarToken=Dd;Ls.resolveAsScalar=Yd;Ls.setScalarValue=Jd});var fl=w(ul=>{"use strict";var Wd=s=>"type"in s?Ps(s):qs(s);function Ps(s){switch(s.type){case"block-scalar":{let e="";for(let t of s.props)e+=Ps(t);return e+s.source}case"block-map":case"block-seq":{let e="";for(let t of s.items)e+=qs(t);return e}case"flow-collection":{let e=s.start.source;for(let t of s.items)e+=qs(t);for(let t of s.end)e+=t.source;return e}case"document":{let e=qs(s);if(s.end)for(let t of s.end)e+=t.source;return e}default:{let e=s.source;if("end"in s&&s.end)for(let t of s.end)e+=t.source;return e}}}function qs({start:s,key:e,sep:t,value:n}){let i="";for(let r of s)i+=r.source;if(e&&(i+=Ps(e)),t)for(let r of t)i+=r.source;return n&&(i+=Ps(n)),i}ul.stringify=Wd});var ml=w(pl=>{"use strict";var Li=Symbol("break visit"),Hd=Symbol("skip children"),hl=Symbol("remove item");function Se(s,e){"type"in s&&s.type==="document"&&(s={start:s.start,value:s.value}),dl(Object.freeze([]),s,e)}Se.BREAK=Li;Se.SKIP=Hd;Se.REMOVE=hl;Se.itemAtPath=(s,e)=>{let t=s;for(let[n,i]of e){let r=t?.[n];if(r&&"items"in r)t=r.items[i];else return}return t};Se.parentCollection=(s,e)=>{let t=Se.itemAtPath(s,e.slice(0,-1)),n=e[e.length-1][0],i=t?.[n];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function dl(s,e,t){let n=t(e,s);if(typeof n=="symbol")return n;for(let i of["key","value"]){let r=e[i];if(r&&"items"in r){for(let o=0;o{"use strict";var qi=cl(),Xd=fl(),zd=ml(),Pi="\uFEFF",_i="",xi="",Mi="",Qd=s=>!!s&&"items"in s,Zd=s=>!!s&&(s.type==="scalar"||s.type==="single-quoted-scalar"||s.type==="double-quoted-scalar"||s.type==="block-scalar");function ep(s){switch(s){case Pi:return"";case _i:return"";case xi:return"";case Mi:return"";default:return JSON.stringify(s)}}function tp(s){switch(s){case Pi:return"byte-order-mark";case _i:return"doc-mode";case xi:return"flow-error-end";case Mi:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case` -`:case`\r -`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(s[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}j.createScalarToken=qi.createScalarToken;j.resolveAsScalar=qi.resolveAsScalar;j.setScalarValue=qi.setScalarValue;j.stringify=Xd.stringify;j.visit=zd.visit;j.BOM=Pi;j.DOCUMENT=_i;j.FLOW_END=xi;j.SCALAR=Mi;j.isCollection=Qd;j.isScalar=Zd;j.prettyToken=ep;j.tokenType=tp});var Fi=w(yl=>{"use strict";var Et=_s();function G(s){switch(s){case void 0:case" ":case` -`:case"\r":case" ":return!0;default:return!1}}var gl=new Set("0123456789ABCDEFabcdef"),sp=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),xs=new Set(",[]{}"),np=new Set(` ,[]{} -\r `),$i=s=>!s||np.has(s),Ri=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let n=this.next??"stream";for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===" "||t===" ";)t=this.buffer[++e];return!t||t==="#"||t===` -`?!0:t==="\r"?this.buffer[e+1]===` -`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let n=0;for(;t===" ";)t=this.buffer[++n+e];if(t==="\r"){let i=this.buffer[n+e+1];if(i===` -`||!i&&!this.atEnd)return e+n+1}return t===` -`||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if(t==="-"||t==="."){let n=this.buffer.substr(e,3);if((n==="---"||n==="...")&&G(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&ethis.indentValue&&!G(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&G(t)){let n=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=n,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil($i),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,n=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=n=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);let i=this.getLine();if(i===null)return this.setNext("flow");if((n!==-1&&n"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if(t!=="-")break}return yield*this.pushUntil(t=>G(t)||t==="#")}*parseBlockScalar(){let e=this.pos-1,t=0,n;e:for(let r=this.pos;n=this.buffer[r];++r)switch(n){case" ":t+=1;break;case` -`:e=r,t=0;break;case"\r":{let o=this.buffer[r+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===` -`)break}default:break e}if(!n&&!this.atEnd)return this.setNext("block-scalar");if(t>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=t:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let r=this.continueScalar(e+1);if(r===-1)break;e=this.buffer.indexOf(` -`,r)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let i=e+1;for(n=this.buffer[i];n===" ";)n=this.buffer[++i];if(n===" "){for(;n===" "||n===" "||n==="\r"||n===` -`;)n=this.buffer[++i];e=i-1}else if(!this.blockScalarKeep)do{let r=e-1,o=this.buffer[r];o==="\r"&&(o=this.buffer[--r]);let a=r;for(;o===" ";)o=this.buffer[--r];if(o===` -`&&r>=this.pos&&r+1+t>a)e=r;else break}while(!0);return yield Et.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,n=this.pos-1,i;for(;i=this.buffer[++n];)if(i===":"){let r=this.buffer[n+1];if(G(r)||e&&xs.has(r))break;t=n}else if(G(i)){let r=this.buffer[n+1];if(i==="\r"&&(r===` -`?(n+=1,i=` -`,r=this.buffer[n+1]):t=n),r==="#"||e&&xs.has(r))break;if(i===` -`){let o=this.continueScalar(n+1);if(o===-1)break;n=Math.max(n,o-2)}}else{if(e&&xs.has(i))break;t=n}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield Et.SCALAR,yield*this.pushToIndex(t+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil($i))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let e=this.flowLevel>0,t=this.charAt(1);if(G(t)||e&&xs.has(t))return e?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,t=this.buffer[e];for(;!G(t)&&t!==">";)t=this.buffer[++e];return yield*this.pushToIndex(t===">"?e+1:e,!1)}else{let e=this.pos+1,t=this.buffer[e];for(;t;)if(sp.has(t))t=this.buffer[++e];else if(t==="%"&&gl.has(this.buffer[e+1])&&gl.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===` -`?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===` -`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===" "||e&&n===" ");let i=t-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=t),i}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}};yl.Lexer=Ri});var Vi=w(bl=>{"use strict";var Bi=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t>1;this.lineStarts[r]{"use strict";var ip=Ot("process"),wl=_s(),rp=Fi();function ue(s,e){for(let t=0;t=0;)switch(s[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;s[++e]?.type==="space";);return s.splice(e,s.length)}function Nl(s){if(s.start.type==="flow-seq-start")for(let e of s.items)e.sep&&!e.value&&!ue(e.start,"explicit-key-ind")&&!ue(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,Al(e.value)?e.value.end?Array.prototype.push.apply(e.value.end,e.sep):e.value.end=e.sep:Array.prototype.push.apply(e.start,e.sep),delete e.sep)}var ji=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new rp.Lexer,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,t))yield*this.next(n);t||(yield*this.end())}*next(e){if(this.source=e,ip.env.LOG_TOKENS&&console.log("|",wl.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=wl.tokenType(e);if(t)if(t==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*this.step(),t){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let n=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:n,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(!t)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield t;else{let n=this.peek(1);switch(t.type==="block-scalar"?t.indent="indent"in n?n.indent:0:t.type==="flow-collection"&&n.type==="document"&&(t.indent=0),t.type==="flow-collection"&&Nl(t),n.type){case"document":n.value=t;break;case"block-scalar":n.props.push(t);break;case"block-map":{let i=n.items[n.items.length-1];if(i.value){n.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=t;else{Object.assign(i,{key:t,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{let i=n.items[n.items.length-1];i.value?n.items.push({start:[],value:t}):i.value=t;break}case"flow-collection":{let i=n.items[n.items.length-1];!i||i.value?n.items.push({start:[],key:t,sep:[]}):i.sep?i.value=t:Object.assign(i,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((n.type==="document"||n.type==="block-map"||n.type==="block-seq")&&(t.type==="block-map"||t.type==="block-seq")){let i=t.items[t.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&Sl(i.start)===-1&&(t.indent===0||i.start.every(r=>r.type!=="comment"||r.indent=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,i=n&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind",r=[];if(i&&t.sep&&!t.value){let o=[];for(let a=0;ae.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(r=t.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":i||t.value?(r.push(this.sourceToken),e.items.push({start:r}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"explicit-key-ind":!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):i||t.value?(r.push(this.sourceToken),e.items.push({start:r,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(ue(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]});else if(Al(t.key)&&!ue(t.sep,"newline")){let o=Fe(t.start),a=t.key,l=t.sep;l.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:a,sep:l}]})}else r.length>0?t.sep=t.sep.concat(r,this.sourceToken):t.sep.push(this.sourceToken);else if(ue(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let o=Fe(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||i?e.items.push({start:r,key:null,sep:[this.sourceToken]}):ue(t.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let o=this.flowScalar(this.type);i||t.value?(e.items.push({start:r,key:o,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(o):(Object.assign(t,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{let o=this.startBlockValue(e);if(o){if(o.type==="block-seq"){if(!t.explicitKey&&t.sep&&!ue(t.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else n&&e.items.push({start:r});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){let n="end"in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){Array.prototype.push.apply(i,t.start),i.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;t.value||ue(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let n=this.startBlockValue(e);if(n){this.stack.push(n);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let n;do yield*this.pop(),n=this.peek(1);while(n?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case"map-value-ind":!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let i=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:i,sep:[]}):t.sep?this.stack.push(i):Object.assign(t,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let n=this.peek(2);if(n.type==="block-map"&&(this.type==="map-value-ind"&&n.indent===e.indent||this.type==="newline"&&!n.items[n.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&n.type!=="flow-collection"){let i=Ms(n),r=Fe(i);Nl(e);let o=e.end.splice(1,e.end.length);o.push(this.sourceToken);let a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:r,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let t=this.source.indexOf(` -`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(` -`,t)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let t=Ms(e),n=Fe(t);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let t=Ms(e),n=Fe(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!=="comment"||this.indent<=t?!1:e.every(n=>n.type==="newline"||n.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};El.Parser=ji});var kl=w(Tt=>{"use strict";var vl=ki(),op=gt(),vt=wt(),ap=Cn(),lp=C(),cp=Vi(),Tl=Ui();function Cl(s){let e=s.prettyErrors!==!1;return{lineCounter:s.lineCounter||e&&new cp.LineCounter||null,prettyErrors:e}}function up(s,e={}){let{lineCounter:t,prettyErrors:n}=Cl(e),i=new Tl.Parser(t?.addNewLine),r=new vl.Composer(e),o=Array.from(r.compose(i.parse(s)));if(n&&t)for(let a of o)a.errors.forEach(vt.prettifyError(s,t)),a.warnings.forEach(vt.prettifyError(s,t));return o.length>0?o:Object.assign([],{empty:!0},r.streamInfo())}function Ol(s,e={}){let{lineCounter:t,prettyErrors:n}=Cl(e),i=new Tl.Parser(t?.addNewLine),r=new vl.Composer(e),o=null;for(let a of r.compose(i.parse(s),!0,s.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new vt.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&t&&(o.errors.forEach(vt.prettifyError(s,t)),o.warnings.forEach(vt.prettifyError(s,t))),o}function fp(s,e,t){let n;typeof e=="function"?n=e:t===void 0&&e&&typeof e=="object"&&(t=e);let i=Ol(s,t);if(!i)return null;if(i.warnings.forEach(r=>ap.warn(i.options.logLevel,r)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:n},t))}function hp(s,e,t){let n=null;if(typeof e=="function"||Array.isArray(e)?n=e:t===void 0&&e&&(t=e),typeof t=="string"&&(t=t.length),typeof t=="number"){let i=Math.round(t);t=i<1?void 0:i>8?{indent:8}:{indent:i}}if(s===void 0){let{keepUndefined:i}=t??e??{};if(!i)return}return lp.isDocument(s)&&!n?s.toString(t):new op.Document(s,n,t).toString(t)}Tt.parse=fp;Tt.parseAllDocuments=up;Tt.parseDocument=Ol;Tt.stringify=hp});var Ll=w(k=>{"use strict";var dp=ki(),pp=gt(),mp=li(),Ki=wt(),gp=Ze(),fe=C(),yp=oe(),bp=L(),wp=le(),Sp=ce(),Np=_s(),Ap=Fi(),Ep=Vi(),vp=Ui(),$s=kl(),Il=He();k.Composer=dp.Composer;k.Document=pp.Document;k.Schema=mp.Schema;k.YAMLError=Ki.YAMLError;k.YAMLParseError=Ki.YAMLParseError;k.YAMLWarning=Ki.YAMLWarning;k.Alias=gp.Alias;k.isAlias=fe.isAlias;k.isCollection=fe.isCollection;k.isDocument=fe.isDocument;k.isMap=fe.isMap;k.isNode=fe.isNode;k.isPair=fe.isPair;k.isScalar=fe.isScalar;k.isSeq=fe.isSeq;k.Pair=yp.Pair;k.Scalar=bp.Scalar;k.YAMLMap=wp.YAMLMap;k.YAMLSeq=Sp.YAMLSeq;k.CST=Np;k.Lexer=Ap.Lexer;k.LineCounter=Ep.LineCounter;k.Parser=vp.Parser;k.parse=$s.parse;k.parseAllDocuments=$s.parseAllDocuments;k.parseDocument=$s.parseDocument;k.stringify=$s.stringify;k.visit=Il.visit;k.visitAsync=Il.visitAsync});var tr=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",Rl=tr+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",Fl="["+tr+"]["+Rl+"]*",Bl=new RegExp("^"+Fl+"$");function kt(s,e){let t=[],n=e.exec(s);for(;n;){let i=[];i.startIndex=e.lastIndex-n[0].length;let r=n.length;for(let o=0;o"u")};function sr(s){return typeof s<"u"}var Ve=["hasOwnProperty","toString","valueOf","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__"],It=["__proto__","constructor","prototype"];var Vl={allowBooleanAttributes:!1,unpairedTags:[]};function ar(s,e){e=Object.assign({},Vl,e);let t=[],n=!1,i=!1;s[0]==="\uFEFF"&&(s=s.substr(1));for(let r=0;r"&&s[r]!==" "&&s[r]!==" "&&s[r]!==` -`&&s[r]!=="\r";r++)l+=s[r];if(l=l.trim(),l[l.length-1]==="/"&&(l=l.substring(0,l.length-1),r--),!Wl(l)){let f;return l.trim().length===0?f="Invalid space after '<'.":f="Tag '"+l+"' is an invalid name.",I("InvalidTag",f,M(s,r))}let c=Kl(s,r);if(c===!1)return I("InvalidAttr","Attributes for '"+l+"' have open quote.",M(s,r));let u=c.value;if(r=c.index,u[u.length-1]==="/"){let f=r-u.length;u=u.substring(0,u.length-1);let h=or(u,e);if(h===!0)n=!0;else return I(h.err.code,h.err.msg,M(s,f+h.err.line))}else if(a)if(c.tagClosed){if(u.trim().length>0)return I("InvalidTag","Closing tag '"+l+"' can't have attributes or invalid starting.",M(s,o));if(t.length===0)return I("InvalidTag","Closing tag '"+l+"' has not been opened.",M(s,o));{let f=t.pop();if(l!==f.tagName){let h=M(s,f.tagStartPos);return I("InvalidTag","Expected closing tag '"+f.tagName+"' (opened in line "+h.line+", col "+h.col+") instead of closing tag '"+l+"'.",M(s,o))}t.length==0&&(i=!0)}}else return I("InvalidTag","Closing tag '"+l+"' doesn't have proper closing.",M(s,r));else{let f=or(u,e);if(f!==!0)return I(f.err.code,f.err.msg,M(s,r-u.length+f.err.line));if(i===!0)return I("InvalidXml","Multiple possible root nodes found.",M(s,r));e.unpairedTags.indexOf(l)!==-1||t.push({tagName:l,tagStartPos:o}),n=!0}for(r++;r0)return I("InvalidXml","Invalid '"+JSON.stringify(t.map(r=>r.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return I("InvalidXml","Start tag expected.",1);return!0}function nr(s){return s===" "||s===" "||s===` -`||s==="\r"}function ir(s,e){let t=e;for(;e5&&n==="xml")return I("InvalidXml","XML declaration allowed only at the start of the document.",M(s,e));if(s[e]=="?"&&s[e+1]==">"){e++;break}else continue}return e}function rr(s,e){if(s.length>e+5&&s[e+1]==="-"&&s[e+2]==="-"){for(e+=3;e"){e+=2;break}}else if(s.length>e+8&&s[e+1]==="D"&&s[e+2]==="O"&&s[e+3]==="C"&&s[e+4]==="T"&&s[e+5]==="Y"&&s[e+6]==="P"&&s[e+7]==="E"){let t=1;for(e+=8;e"&&(t--,t===0))break}else if(s.length>e+9&&s[e+1]==="["&&s[e+2]==="C"&&s[e+3]==="D"&&s[e+4]==="A"&&s[e+5]==="T"&&s[e+6]==="A"&&s[e+7]==="["){for(e+=8;e"){e+=2;break}}return e}var jl='"',Ul="'";function Kl(s,e){let t="",n="",i=!1;for(;e"&&n===""){i=!0;break}t+=s[e]}return n!==""?!1:{value:t,index:e,tagClosed:i}}var Yl=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function or(s,e){let t=kt(s,Yl),n={};for(let i=0;i",GT:">",quot:'"',QUOT:'"',apos:"'",lsquo:"\u2018",rsquo:"\u2019",ldquo:"\u201C",rdquo:"\u201D",lsquor:"\u201A",rsquor:"\u2019",ldquor:"\u201E",bdquo:"\u201E",comma:",",period:".",colon:":",semi:";",excl:"!",quest:"?",num:"#",dollar:"$",percent:"%",amp:"&",ast:"*",commat:"@",lowbar:"_",verbar:"|",vert:"|",sol:"/",bsol:"\\",lbrace:"{",rbrace:"}",lbrack:"[",rbrack:"]",lpar:"(",rpar:")",nbsp:"\xA0",iexcl:"\xA1",cent:"\xA2",pound:"\xA3",curren:"\xA4",yen:"\xA5",brvbar:"\xA6",sect:"\xA7",uml:"\xA8",copy:"\xA9",COPY:"\xA9",ordf:"\xAA",laquo:"\xAB",not:"\xAC",shy:"\xAD",reg:"\xAE",REG:"\xAE",macr:"\xAF",deg:"\xB0",plusmn:"\xB1",sup2:"\xB2",sup3:"\xB3",acute:"\xB4",micro:"\xB5",para:"\xB6",middot:"\xB7",cedil:"\xB8",sup1:"\xB9",ordm:"\xBA",raquo:"\xBB",frac14:"\xBC",frac12:"\xBD",half:"\xBD",frac34:"\xBE",iquest:"\xBF",times:"\xD7",div:"\xF7",divide:"\xF7"},cr={Agrave:"\xC0",agrave:"\xE0",Aacute:"\xC1",aacute:"\xE1",Acirc:"\xC2",acirc:"\xE2",Atilde:"\xC3",atilde:"\xE3",Auml:"\xC4",auml:"\xE4",Aring:"\xC5",aring:"\xE5",AElig:"\xC6",aelig:"\xE6",Ccedil:"\xC7",ccedil:"\xE7",Egrave:"\xC8",egrave:"\xE8",Eacute:"\xC9",eacute:"\xE9",Ecirc:"\xCA",ecirc:"\xEA",Euml:"\xCB",euml:"\xEB",Igrave:"\xCC",igrave:"\xEC",Iacute:"\xCD",iacute:"\xED",Icirc:"\xCE",icirc:"\xEE",Iuml:"\xCF",iuml:"\xEF",ETH:"\xD0",eth:"\xF0",Ntilde:"\xD1",ntilde:"\xF1",Ograve:"\xD2",ograve:"\xF2",Oacute:"\xD3",oacute:"\xF3",Ocirc:"\xD4",ocirc:"\xF4",Otilde:"\xD5",otilde:"\xF5",Ouml:"\xD6",ouml:"\xF6",Oslash:"\xD8",oslash:"\xF8",Ugrave:"\xD9",ugrave:"\xF9",Uacute:"\xDA",uacute:"\xFA",Ucirc:"\xDB",ucirc:"\xFB",Uuml:"\xDC",uuml:"\xFC",Yacute:"\xDD",yacute:"\xFD",THORN:"\xDE",thorn:"\xFE",szlig:"\xDF",yuml:"\xFF",Yuml:"\u0178"},ur={Amacr:"\u0100",amacr:"\u0101",Abreve:"\u0102",abreve:"\u0103",Aogon:"\u0104",aogon:"\u0105",Cacute:"\u0106",cacute:"\u0107",Ccirc:"\u0108",ccirc:"\u0109",Cdot:"\u010A",cdot:"\u010B",Ccaron:"\u010C",ccaron:"\u010D",Dcaron:"\u010E",dcaron:"\u010F",Dstrok:"\u0110",dstrok:"\u0111",Emacr:"\u0112",emacr:"\u0113",Ecaron:"\u011A",ecaron:"\u011B",Edot:"\u0116",edot:"\u0117",Eogon:"\u0118",eogon:"\u0119",Gcirc:"\u011C",gcirc:"\u011D",Gbreve:"\u011E",gbreve:"\u011F",Gdot:"\u0120",gdot:"\u0121",Gcedil:"\u0122",Hcirc:"\u0124",hcirc:"\u0125",Hstrok:"\u0126",hstrok:"\u0127",Itilde:"\u0128",itilde:"\u0129",Imacr:"\u012A",imacr:"\u012B",Iogon:"\u012E",iogon:"\u012F",Idot:"\u0130",IJlig:"\u0132",ijlig:"\u0133",Jcirc:"\u0134",jcirc:"\u0135",Kcedil:"\u0136",kcedil:"\u0137",kgreen:"\u0138",Lacute:"\u0139",lacute:"\u013A",Lcedil:"\u013B",lcedil:"\u013C",Lcaron:"\u013D",lcaron:"\u013E",Lmidot:"\u013F",lmidot:"\u0140",Lstrok:"\u0141",lstrok:"\u0142",Nacute:"\u0143",nacute:"\u0144",Ncaron:"\u0147",ncaron:"\u0148",Ncedil:"\u0145",ncedil:"\u0146",ENG:"\u014A",eng:"\u014B",Omacr:"\u014C",omacr:"\u014D",Odblac:"\u0150",odblac:"\u0151",OElig:"\u0152",oelig:"\u0153",Racute:"\u0154",racute:"\u0155",Rcaron:"\u0158",rcaron:"\u0159",Rcedil:"\u0156",rcedil:"\u0157",Sacute:"\u015A",sacute:"\u015B",Scirc:"\u015C",scirc:"\u015D",Scedil:"\u015E",scedil:"\u015F",Scaron:"\u0160",scaron:"\u0161",Tcedil:"\u0162",tcedil:"\u0163",Tcaron:"\u0164",tcaron:"\u0165",Tstrok:"\u0166",tstrok:"\u0167",Utilde:"\u0168",utilde:"\u0169",Umacr:"\u016A",umacr:"\u016B",Ubreve:"\u016C",ubreve:"\u016D",Uring:"\u016E",uring:"\u016F",Udblac:"\u0170",udblac:"\u0171",Uogon:"\u0172",uogon:"\u0173",Wcirc:"\u0174",wcirc:"\u0175",Ycirc:"\u0176",ycirc:"\u0177",Zacute:"\u0179",zacute:"\u017A",Zdot:"\u017B",zdot:"\u017C",Zcaron:"\u017D",zcaron:"\u017E"},fr={Alpha:"\u0391",alpha:"\u03B1",Beta:"\u0392",beta:"\u03B2",Gamma:"\u0393",gamma:"\u03B3",Delta:"\u0394",delta:"\u03B4",Epsilon:"\u0395",epsilon:"\u03B5",epsiv:"\u03F5",varepsilon:"\u03F5",Zeta:"\u0396",zeta:"\u03B6",Eta:"\u0397",eta:"\u03B7",Theta:"\u0398",theta:"\u03B8",thetasym:"\u03D1",vartheta:"\u03D1",Iota:"\u0399",iota:"\u03B9",Kappa:"\u039A",kappa:"\u03BA",kappav:"\u03F0",varkappa:"\u03F0",Lambda:"\u039B",lambda:"\u03BB",Mu:"\u039C",mu:"\u03BC",Nu:"\u039D",nu:"\u03BD",Xi:"\u039E",xi:"\u03BE",Omicron:"\u039F",omicron:"\u03BF",Pi:"\u03A0",pi:"\u03C0",piv:"\u03D6",varpi:"\u03D6",Rho:"\u03A1",rho:"\u03C1",rhov:"\u03F1",varrho:"\u03F1",Sigma:"\u03A3",sigma:"\u03C3",sigmaf:"\u03C2",sigmav:"\u03C2",varsigma:"\u03C2",Tau:"\u03A4",tau:"\u03C4",Upsilon:"\u03A5",upsilon:"\u03C5",upsi:"\u03C5",Upsi:"\u03D2",upsih:"\u03D2",Phi:"\u03A6",phi:"\u03C6",phiv:"\u03D5",varphi:"\u03D5",Chi:"\u03A7",chi:"\u03C7",Psi:"\u03A8",psi:"\u03C8",Omega:"\u03A9",omega:"\u03C9",ohm:"\u03A9",Gammad:"\u03DC",gammad:"\u03DD",digamma:"\u03DD"},hr={Afr:"\u{1D504}",afr:"\u{1D51E}",Acy:"\u0410",acy:"\u0430",Bcy:"\u0411",bcy:"\u0431",Vcy:"\u0412",vcy:"\u0432",Gcy:"\u0413",gcy:"\u0433",Dcy:"\u0414",dcy:"\u0434",IEcy:"\u0415",iecy:"\u0435",IOcy:"\u0401",iocy:"\u0451",ZHcy:"\u0416",zhcy:"\u0436",Zcy:"\u0417",zcy:"\u0437",Icy:"\u0418",icy:"\u0438",Jcy:"\u0419",jcy:"\u0439",Kcy:"\u041A",kcy:"\u043A",Lcy:"\u041B",lcy:"\u043B",Mcy:"\u041C",mcy:"\u043C",Ncy:"\u041D",ncy:"\u043D",Ocy:"\u041E",ocy:"\u043E",Pcy:"\u041F",pcy:"\u043F",Rcy:"\u0420",rcy:"\u0440",Scy:"\u0421",scy:"\u0441",Tcy:"\u0422",tcy:"\u0442",Ucy:"\u0423",ucy:"\u0443",Fcy:"\u0424",fcy:"\u0444",KHcy:"\u0425",khcy:"\u0445",TScy:"\u0426",tscy:"\u0446",CHcy:"\u0427",chcy:"\u0447",SHcy:"\u0428",shcy:"\u0448",SHCHcy:"\u0429",shchcy:"\u0449",HARDcy:"\u042A",hardcy:"\u044A",Ycy:"\u042B",ycy:"\u044B",SOFTcy:"\u042C",softcy:"\u044C",Ecy:"\u042D",ecy:"\u044D",YUcy:"\u042E",yucy:"\u044E",YAcy:"\u042F",yacy:"\u044F",DJcy:"\u0402",djcy:"\u0452",GJcy:"\u0403",gjcy:"\u0453",Jukcy:"\u0404",jukcy:"\u0454",DScy:"\u0405",dscy:"\u0455",Iukcy:"\u0406",iukcy:"\u0456",YIcy:"\u0407",yicy:"\u0457",Jsercy:"\u0408",jsercy:"\u0458",LJcy:"\u0409",ljcy:"\u0459",NJcy:"\u040A",njcy:"\u045A",TSHcy:"\u040B",tshcy:"\u045B",KJcy:"\u040C",kjcy:"\u045C",Ubrcy:"\u040E",ubrcy:"\u045E",DZcy:"\u040F",dzcy:"\u045F"},dr={plus:"+",minus:"\u2212",mnplus:"\u2213",mp:"\u2213",pm:"\xB1",times:"\xD7",div:"\xF7",divide:"\xF7",sdot:"\u22C5",star:"\u2606",starf:"\u2605",bigstar:"\u2605",lowast:"\u2217",ast:"*",midast:"*",compfn:"\u2218",smallcircle:"\u2218",bullet:"\u2022",bull:"\u2022",nbsp:"\xA0",hellip:"\u2026",mldr:"\u2026",prime:"\u2032",Prime:"\u2033",tprime:"\u2034",bprime:"\u2035",backprime:"\u2035",minus:"\u2212",minusd:"\u2238",dotminus:"\u2238",plusdo:"\u2214",dotplus:"\u2214",plusmn:"\xB1",minusplus:"\u2213",mnplus:"\u2213",mp:"\u2213",setminus:"\u2216",smallsetminus:"\u2216",Backslash:"\u2216",setmn:"\u2216",ssetmn:"\u2216",lowbar:"_",verbar:"|",vert:"|",VerticalLine:"|",colon:":",Colon:"\u2237",Proportion:"\u2237",ratio:"\u2236",equals:"=",ne:"\u2260",nequiv:"\u2262",equiv:"\u2261",Congruent:"\u2261",sim:"\u223C",thicksim:"\u223C",thksim:"\u223C",sime:"\u2243",simeq:"\u2243",TildeEqual:"\u2243",asymp:"\u2248",approx:"\u2248",thickapprox:"\u2248",thkap:"\u2248",TildeTilde:"\u2248",ncong:"\u2247",cong:"\u2245",TildeFullEqual:"\u2245",asympeq:"\u224D",CupCap:"\u224D",bump:"\u224E",Bumpeq:"\u224E",HumpDownHump:"\u224E",bumpe:"\u224F",bumpeq:"\u224F",HumpEqual:"\u224F",dotminus:"\u2238",minusd:"\u2238",plusdo:"\u2214",dotplus:"\u2214",le:"\u2264",LessEqual:"\u2264",ge:"\u2265",GreaterEqual:"\u2265",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",greater:">",less:"<"},pr={alefsym:"\u2135",aleph:"\u2135",beth:"\u2136",gimel:"\u2137",daleth:"\u2138",forall:"\u2200",ForAll:"\u2200",part:"\u2202",PartialD:"\u2202",exist:"\u2203",Exists:"\u2203",nexist:"\u2204",nexists:"\u2204",empty:"\u2205",emptyset:"\u2205",emptyv:"\u2205",varnothing:"\u2205",nabla:"\u2207",Del:"\u2207",isin:"\u2208",isinv:"\u2208",in:"\u2208",Element:"\u2208",notin:"\u2209",notinva:"\u2209",ni:"\u220B",niv:"\u220B",SuchThat:"\u220B",ReverseElement:"\u220B",notni:"\u220C",notniva:"\u220C",prod:"\u220F",Product:"\u220F",coprod:"\u2210",Coproduct:"\u2210",sum:"\u2211",Sum:"\u2211",minus:"\u2212",mp:"\u2213",plusdo:"\u2214",dotplus:"\u2214",setminus:"\u2216",lowast:"\u2217",radic:"\u221A",Sqrt:"\u221A",prop:"\u221D",propto:"\u221D",Proportional:"\u221D",varpropto:"\u221D",infin:"\u221E",infintie:"\u29DD",ang:"\u2220",angle:"\u2220",angmsd:"\u2221",measuredangle:"\u2221",angsph:"\u2222",mid:"\u2223",VerticalBar:"\u2223",nmid:"\u2224",nsmid:"\u2224",npar:"\u2226",parallel:"\u2225",spar:"\u2225",nparallel:"\u2226",nspar:"\u2226",and:"\u2227",wedge:"\u2227",or:"\u2228",vee:"\u2228",cap:"\u2229",cup:"\u222A",int:"\u222B",Integral:"\u222B",conint:"\u222E",ContourIntegral:"\u222E",Conint:"\u222F",DoubleContourIntegral:"\u222F",Cconint:"\u2230",there4:"\u2234",therefore:"\u2234",Therefore:"\u2234",becaus:"\u2235",because:"\u2235",Because:"\u2235",ratio:"\u2236",Proportion:"\u2237",minusd:"\u2238",dotminus:"\u2238",mDDot:"\u223A",homtht:"\u223B",sim:"\u223C",bsimg:"\u223D",backsim:"\u223D",ac:"\u223E",mstpos:"\u223E",acd:"\u223F",VerticalTilde:"\u2240",wr:"\u2240",wreath:"\u2240",nsime:"\u2244",nsimeq:"\u2244",nsimeq:"\u2244",ncong:"\u2247",simne:"\u2246",ncongdot:"\u2A6D\u0338",ngsim:"\u2275",nsim:"\u2241",napprox:"\u2249",nap:"\u2249",ngeq:"\u2271",nge:"\u2271",nleq:"\u2270",nle:"\u2270",ngtr:"\u226F",ngt:"\u226F",nless:"\u226E",nlt:"\u226E",nprec:"\u2280",npr:"\u2280",nsucc:"\u2281",nsc:"\u2281"},mr={larr:"\u2190",leftarrow:"\u2190",LeftArrow:"\u2190",uarr:"\u2191",uparrow:"\u2191",UpArrow:"\u2191",rarr:"\u2192",rightarrow:"\u2192",RightArrow:"\u2192",darr:"\u2193",downarrow:"\u2193",DownArrow:"\u2193",harr:"\u2194",leftrightarrow:"\u2194",LeftRightArrow:"\u2194",varr:"\u2195",updownarrow:"\u2195",UpDownArrow:"\u2195",nwarr:"\u2196",nwarrow:"\u2196",UpperLeftArrow:"\u2196",nearr:"\u2197",nearrow:"\u2197",UpperRightArrow:"\u2197",searr:"\u2198",searrow:"\u2198",LowerRightArrow:"\u2198",swarr:"\u2199",swarrow:"\u2199",LowerLeftArrow:"\u2199",lArr:"\u21D0",Leftarrow:"\u21D0",uArr:"\u21D1",Uparrow:"\u21D1",rArr:"\u21D2",Rightarrow:"\u21D2",dArr:"\u21D3",Downarrow:"\u21D3",hArr:"\u21D4",Leftrightarrow:"\u21D4",iff:"\u21D4",vArr:"\u21D5",Updownarrow:"\u21D5",lAarr:"\u21DA",Lleftarrow:"\u21DA",rAarr:"\u21DB",Rrightarrow:"\u21DB",lrarr:"\u21C6",leftrightarrows:"\u21C6",rlarr:"\u21C4",rightleftarrows:"\u21C4",lrhar:"\u21CB",leftrightharpoons:"\u21CB",ReverseEquilibrium:"\u21CB",rlhar:"\u21CC",rightleftharpoons:"\u21CC",Equilibrium:"\u21CC",udarr:"\u21C5",UpArrowDownArrow:"\u21C5",duarr:"\u21F5",DownArrowUpArrow:"\u21F5",llarr:"\u21C7",leftleftarrows:"\u21C7",rrarr:"\u21C9",rightrightarrows:"\u21C9",ddarr:"\u21CA",downdownarrows:"\u21CA",har:"\u21BD",lhard:"\u21BD",leftharpoondown:"\u21BD",lharu:"\u21BC",leftharpoonup:"\u21BC",rhard:"\u21C1",rightharpoondown:"\u21C1",rharu:"\u21C0",rightharpoonup:"\u21C0",lsh:"\u21B0",Lsh:"\u21B0",rsh:"\u21B1",Rsh:"\u21B1",ldsh:"\u21B2",rdsh:"\u21B3",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",mapstoleft:"\u21A4",mapstoup:"\u21A5",map:"\u21A6",mapsto:"\u21A6",mapstodown:"\u21A7",crarr:"\u21B5",nwarrow:"\u2196",nearrow:"\u2197",searrow:"\u2198",swarrow:"\u2199",nleftarrow:"\u219A",nleftrightarrow:"\u21AE",nrightarrow:"\u219B",nrarr:"\u219B",larrtl:"\u21A2",rarrtl:"\u21A3",leftarrowtail:"\u21A2",rightarrowtail:"\u21A3",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",Larr:"\u219E",Rarr:"\u21A0",larrhk:"\u21A9",rarrhk:"\u21AA",larrlp:"\u21AB",looparrowleft:"\u21AB",rarrlp:"\u21AC",looparrowright:"\u21AC",harrw:"\u21AD",leftrightsquigarrow:"\u21AD",nrarrw:"\u219D\u0338",rarrw:"\u219D",rightsquigarrow:"\u219D",larrbfs:"\u291F",rarrbfs:"\u2920",nvHarr:"\u2904",nvlArr:"\u2902",nvrArr:"\u2903",larrfs:"\u291D",rarrfs:"\u291E",Map:"\u2905",larrsim:"\u2973",rarrsim:"\u2974",harrcir:"\u2948",Uarrocir:"\u2949",lurdshar:"\u294A",ldrdhar:"\u2967",ldrushar:"\u294B",rdldhar:"\u2969",lrhard:"\u296D",rlhar:"\u21CC",uharr:"\u21BE",uharl:"\u21BF",dharr:"\u21C2",dharl:"\u21C3",Uarr:"\u219F",Darr:"\u21A1",zigrarr:"\u21DD",nwArr:"\u21D6",neArr:"\u21D7",seArr:"\u21D8",swArr:"\u21D9",nharr:"\u21AE",nhArr:"\u21CE",nlarr:"\u219A",nlArr:"\u21CD",nrarr:"\u219B",nrArr:"\u21CF",larrb:"\u21E4",LeftArrowBar:"\u21E4",rarrb:"\u21E5",RightArrowBar:"\u21E5"},gr={square:"\u25A1",Square:"\u25A1",squ:"\u25A1",squf:"\u25AA",squarf:"\u25AA",blacksquar:"\u25AA",blacksquare:"\u25AA",FilledVerySmallSquare:"\u25AA",blk34:"\u2593",blk12:"\u2592",blk14:"\u2591",block:"\u2588",srect:"\u25AD",rect:"\u25AD",sdot:"\u22C5",sdotb:"\u22A1",dotsquare:"\u22A1",triangle:"\u25B5",tri:"\u25B5",trine:"\u25B5",utri:"\u25B5",triangledown:"\u25BF",dtri:"\u25BF",tridown:"\u25BF",triangleleft:"\u25C3",ltri:"\u25C3",triangleright:"\u25B9",rtri:"\u25B9",blacktriangle:"\u25B4",utrif:"\u25B4",blacktriangledown:"\u25BE",dtrif:"\u25BE",blacktriangleleft:"\u25C2",ltrif:"\u25C2",blacktriangleright:"\u25B8",rtrif:"\u25B8",loz:"\u25CA",lozenge:"\u25CA",blacklozenge:"\u29EB",lozf:"\u29EB",bigcirc:"\u25EF",xcirc:"\u25EF",circ:"\u02C6",Circle:"\u25CB",cir:"\u25CB",o:"\u25CB",bullet:"\u2022",bull:"\u2022",hellip:"\u2026",mldr:"\u2026",nldr:"\u2025",boxh:"\u2500",HorizontalLine:"\u2500",boxv:"\u2502",boxdr:"\u250C",boxdl:"\u2510",boxur:"\u2514",boxul:"\u2518",boxvr:"\u251C",boxvl:"\u2524",boxhd:"\u252C",boxhu:"\u2534",boxvh:"\u253C",boxH:"\u2550",boxV:"\u2551",boxdR:"\u2552",boxDr:"\u2553",boxDR:"\u2554",boxDl:"\u2555",boxdL:"\u2556",boxDL:"\u2557",boxuR:"\u2558",boxUr:"\u2559",boxUR:"\u255A",boxUl:"\u255C",boxuL:"\u255B",boxUL:"\u255D",boxvR:"\u255E",boxVr:"\u255F",boxVR:"\u2560",boxVl:"\u2562",boxvL:"\u2561",boxVL:"\u2563",boxHd:"\u2564",boxhD:"\u2565",boxHD:"\u2566",boxHu:"\u2567",boxhU:"\u2568",boxHU:"\u2569",boxvH:"\u256A",boxVh:"\u256B",boxVH:"\u256C"},yr={excl:"!",iexcl:"\xA1",brvbar:"\xA6",sect:"\xA7",uml:"\xA8",copy:"\xA9",ordf:"\xAA",laquo:"\xAB",not:"\xAC",shy:"\xAD",reg:"\xAE",macr:"\xAF",deg:"\xB0",plusmn:"\xB1",sup2:"\xB2",sup3:"\xB3",acute:"\xB4",micro:"\xB5",para:"\xB6",middot:"\xB7",cedil:"\xB8",sup1:"\xB9",ordm:"\xBA",raquo:"\xBB",frac14:"\xBC",frac12:"\xBD",frac34:"\xBE",iquest:"\xBF",nbsp:"\xA0",comma:",",period:".",colon:":",semi:";",vert:"|",Verbar:"\u2016",verbar:"|",dblac:"\u02DD",circ:"\u02C6",caron:"\u02C7",breve:"\u02D8",dot:"\u02D9",ring:"\u02DA",ogon:"\u02DB",tilde:"\u02DC",DiacriticalGrave:"`",DiacriticalAcute:"\xB4",DiacriticalTilde:"\u02DC",DiacriticalDot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",grave:"`",acute:"\xB4"},Lt={cent:"\xA2",pound:"\xA3",curren:"\xA4",yen:"\xA5",euro:"\u20AC",dollar:"$",euro:"\u20AC",fnof:"\u0192",inr:"\u20B9",af:"\u060B",birr:"\u1265\u122D",peso:"\u20B1",rub:"\u20BD",won:"\u20A9",yuan:"\xA5",cedil:"\xB8"},br={frac12:"\xBD",half:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044"},wr={trade:"\u2122",TRADE:"\u2122",telrec:"\u2315",target:"\u2316",ulcorn:"\u231C",ulcorner:"\u231C",urcorn:"\u231D",urcorner:"\u231D",dlcorn:"\u231E",llcorner:"\u231E",drcorn:"\u231F",lrcorner:"\u231F",intercal:"\u22BA",intcal:"\u22BA",oplus:"\u2295",CirclePlus:"\u2295",ominus:"\u2296",CircleMinus:"\u2296",otimes:"\u2297",CircleTimes:"\u2297",osol:"\u2298",odot:"\u2299",CircleDot:"\u2299",oast:"\u229B",circledast:"\u229B",odash:"\u229D",circleddash:"\u229D",ocirc:"\u229A",circledcirc:"\u229A",boxplus:"\u229E",plusb:"\u229E",boxminus:"\u229F",minusb:"\u229F",boxtimes:"\u22A0",timesb:"\u22A0",boxdot:"\u22A1",sdotb:"\u22A1",veebar:"\u22BB",vee:"\u2228",barvee:"\u22BD",and:"\u2227",wedge:"\u2227",Cap:"\u22D2",Cup:"\u22D3",Fork:"\u22D4",pitchfork:"\u22D4",epar:"\u22D5",ltlarr:"\u2976",nvap:"\u224D\u20D2",nvsim:"\u223C\u20D2",nvge:"\u2265\u20D2",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvgt:">\u20D2",nvltrie:"\u22B4\u20D2",nvrtrie:"\u22B5\u20D2",Vdash:"\u22A9",dashv:"\u22A3",vDash:"\u22A8",Vdash:"\u22A9",Vvdash:"\u22AA",nvdash:"\u22AC",nvDash:"\u22AD",nVdash:"\u22AE",nVDash:"\u22AF"},Hl={...lr,...cr,...ur,...fr,...hr,...dr,...pr,...mr,...gr,...yr,...Lt,...br,...wr},Ue={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'},Us={nbsp:"\xA0",copy:"\xA9",reg:"\xAE",trade:"\u2122",mdash:"\u2014",ndash:"\u2013",hellip:"\u2026",laquo:"\xAB",raquo:"\xBB",lsquo:"\u2018",rsquo:"\u2019",ldquo:"\u201C",rdquo:"\u201D",bull:"\u2022",para:"\xB6",sect:"\xA7",deg:"\xB0",frac12:"\xBD",frac14:"\xBC",frac34:"\xBE"};var Xl=new Set("!?\\\\/[]$%{}^&*()<>|+");function Sr(s){if(s[0]==="#")throw new Error(`[EntityReplacer] Invalid character '#' in entity name: "${s}"`);for(let e of s)if(Xl.has(e))throw new Error(`[EntityReplacer] Invalid character '${e}' in entity name: "${s}"`);return s}function Ks(...s){let e=Object.create(null);for(let t of s)if(t)for(let n of Object.keys(t)){let i=t[n];if(typeof i=="string")e[n]=i;else if(i&&typeof i=="object"&&i.val!==void 0){let r=i.val;typeof r=="string"&&(e[n]=r)}}return e}var de="external",qt="base",Ys="all";function zl(s){return!s||s===de?new Set([de]):s===Ys?new Set([Ys]):s===qt?new Set([qt]):Array.isArray(s)?new Set(s):new Set([de])}var $=Object.freeze({allow:0,leave:1,remove:2,throw:3}),Ql=new Set([9,10,13]);function Zl(s){if(!s)return{xmlVersion:1,onLevel:$.allow,nullLevel:$.remove};let e=s.xmlVersion===1.1?1.1:1,t=$[s.onNCR]??$.allow,n=$[s.nullNCR]??$.remove,i=Math.max(n,$.remove);return{xmlVersion:e,onLevel:t,nullLevel:i}}var Ee=class{constructor(e={}){this._limit=e.limit||{},this._maxTotalExpansions=this._limit.maxTotalExpansions||0,this._maxExpandedLength=this._limit.maxExpandedLength||0,this._postCheck=typeof e.postCheck=="function"?e.postCheck:n=>n,this._limitTiers=zl(this._limit.applyLimitsTo??de),this._numericAllowed=e.numericAllowed??!0,this._baseMap=Ks(Ue,e.namedEntities||null),this._externalMap=Object.create(null),this._inputMap=Object.create(null),this._totalExpansions=0,this._expandedLength=0,this._removeSet=new Set(e.remove&&Array.isArray(e.remove)?e.remove:[]),this._leaveSet=new Set(e.leave&&Array.isArray(e.leave)?e.leave:[]);let t=Zl(e.ncr);this._ncrXmlVersion=t.xmlVersion,this._ncrOnLevel=t.onLevel,this._ncrNullLevel=t.nullLevel}setExternalEntities(e){if(e)for(let t of Object.keys(e))Sr(t);this._externalMap=Ks(e)}addExternalEntity(e,t){Sr(e),typeof t=="string"&&t.indexOf("&")===-1&&(this._externalMap[e]=t)}addInputEntities(e){this._totalExpansions=0,this._expandedLength=0,this._inputMap=Ks(e)}reset(){return this._inputMap=Object.create(null),this._totalExpansions=0,this._expandedLength=0,this}setXmlVersion(e){this._ncrXmlVersion=e===1.1?1.1:1}decode(e){if(typeof e!="string"||e.length===0)return e;let t=e,n=[],i=e.length,r=0,o=0,a=this._maxTotalExpansions>0,l=this._maxExpandedLength>0,c=a||l;for(;o=i||e.charCodeAt(f)!==59){o++;continue}let h=e.slice(o+1,f);if(h.length===0){o++;continue}let p,g;if(this._removeSet.has(h))p="",g===void 0&&(g=de);else if(this._leaveSet.has(h)){o++;continue}else if(h.charCodeAt(0)===35){let d=this._resolveNCR(h);if(d===void 0){o++;continue}p=d,g=qt}else{let d=this._resolveName(h);p=d?.value,g=d?.tier}if(p===void 0){o++;continue}if(o>r&&n.push(e.slice(r,o)),n.push(p),r=f+1,o=r,c&&this._tierCounts(g)){if(a&&(this._totalExpansions++,this._totalExpansions>this._maxTotalExpansions))throw new Error(`[EntityReplacer] Entity expansion count limit exceeded: ${this._totalExpansions} > ${this._maxTotalExpansions}`);if(l){let d=p.length-(h.length+2);if(d>0&&(this._expandedLength+=d,this._expandedLength>this._maxExpandedLength))throw new Error(`[EntityReplacer] Expanded content length limit exceeded: ${this._expandedLength} > ${this._maxExpandedLength}`)}}}r=55296&&e<=57343||this._ncrXmlVersion===1&&e>=1&&e<=31&&!Ql.has(e)?$.remove:-1}_applyNCRAction(e,t,n){switch(e){case $.allow:return String.fromCodePoint(n);case $.remove:return"";case $.leave:return;case $.throw:throw new Error(`[EntityDecoder] Prohibited numeric character reference &${t}; (U+${n.toString(16).toUpperCase().padStart(4,"0")})`);default:return String.fromCodePoint(n)}}_resolveNCR(e){let t=e.charCodeAt(1),n;if(t===120||t===88?n=parseInt(e.slice(2),16):n=parseInt(e.slice(1),10),Number.isNaN(n)||n<0||n>1114111)return;let i=this._classifyNCR(n);if(!this._numericAllowed&&i<$.remove)return;let r=i===-1?this._ncrOnLevel:Math.max(this._ncrOnLevel,i);return this._applyNCRAction(r,e,n)}};var Nr=s=>Ve.includes(s)?"__"+s:s,ec={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(s,e){return e},attributeValueProcessor:function(s,e){return e},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,entityDecoder:null,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(s,e,t){return s},captureMetaData:!1,maxNestedTags:100,strictReservedNames:!0,jPath:!0,onDangerousProperty:Nr};function tc(s,e){if(typeof s!="string")return;let t=s.toLowerCase();if(Ve.some(n=>t===n.toLowerCase()))throw new Error(`[SECURITY] Invalid ${e}: "${s}" is a reserved JavaScript keyword that could cause prototype pollution`);if(It.some(n=>t===n.toLowerCase()))throw new Error(`[SECURITY] Invalid ${e}: "${s}" is a reserved JavaScript keyword that could cause prototype pollution`)}function Ar(s,e){return typeof s=="boolean"?{enabled:s,maxEntitySize:1e4,maxExpansionDepth:1e4,maxTotalExpansions:1/0,maxExpandedLength:1e5,maxEntityCount:1e3,allowedTags:null,tagFilter:null,appliesTo:"all"}:typeof s=="object"&&s!==null?{enabled:s.enabled!==!1,maxEntitySize:Math.max(1,s.maxEntitySize??1e4),maxExpansionDepth:Math.max(1,s.maxExpansionDepth??1e4),maxTotalExpansions:Math.max(1,s.maxTotalExpansions??1/0),maxExpandedLength:Math.max(1,s.maxExpandedLength??1e5),maxEntityCount:Math.max(1,s.maxEntityCount??1e3),allowedTags:s.allowedTags??null,tagFilter:s.tagFilter??null,appliesTo:s.appliesTo??"all"}:Ar(!0)}var Er=function(s){let e=Object.assign({},ec,s),t=[{value:e.attributeNamePrefix,name:"attributeNamePrefix"},{value:e.attributesGroupName,name:"attributesGroupName"},{value:e.textNodeName,name:"textNodeName"},{value:e.cdataPropName,name:"cdataPropName"},{value:e.commentPropName,name:"commentPropName"}];for(let{value:n,name:i}of t)n&&tc(n,i);return e.onDangerousProperty===null&&(e.onDangerousProperty=Nr),e.processEntities=Ar(e.processEntities,e.htmlEntities),e.unpairedTagsSet=new Set(e.unpairedTags),e.stopNodes&&Array.isArray(e.stopNodes)&&(e.stopNodes=e.stopNodes.map(n=>typeof n=="string"&&n.startsWith("*.")?".."+n.substring(2):n)),e};var Pt;typeof Symbol!="function"?Pt="@@xmlMetadata":Pt=Symbol("XML Node Metadata");var R=class{constructor(e){this.tagname=e,this.child=[],this[":@"]=Object.create(null)}add(e,t){e==="__proto__"&&(e="#__proto__"),this.child.push({[e]:t})}addChild(e,t){e.tagname==="__proto__"&&(e.tagname="#__proto__"),e[":@"]&&Object.keys(e[":@"]).length>0?this.child.push({[e.tagname]:e.child,":@":e[":@"]}):this.child.push({[e.tagname]:e.child}),t!==void 0&&(this.child[this.child.length-1][Pt]={startIndex:t})}static getMetaDataSymbol(){return Pt}};var Ye=class{constructor(e){this.suppressValidationErr=!e,this.options=e}readDocType(e,t){let n=Object.create(null),i=0;if(e[t+3]==="O"&&e[t+4]==="C"&&e[t+5]==="T"&&e[t+6]==="Y"&&e[t+7]==="P"&&e[t+8]==="E"){t=t+9;let r=1,o=!1,a=!1,l="";for(;t=this.options.maxEntityCount)throw new Error(`Entity count (${i+1}) exceeds maximum allowed (${this.options.maxEntityCount})`);n[c]=u,i++}}else if(o&&pe(e,"!ELEMENT",t)){t+=8;let{index:c}=this.readElementExp(e,t+1);t=c}else if(o&&pe(e,"!ATTLIST",t))t+=8;else if(o&&pe(e,"!NOTATION",t)){t+=9;let{index:c}=this.readNotationExp(e,t+1,this.suppressValidationErr);t=c}else if(pe(e,"!--",t))a=!0;else throw new Error("Invalid DOCTYPE");r++,l=""}else if(e[t]===">"){if(a?e[t-1]==="-"&&e[t-2]==="-"&&(a=!1,r--):r--,r===0)break}else e[t]==="["?o=!0:l+=e[t];if(r!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:n,i:t}}readEntityExp(e,t){t=F(e,t);let n=t;for(;tthis.options.maxEntitySize)throw new Error(`Entity "${i}" size (${r.length}) exceeds maximum allowed size (${this.options.maxEntitySize})`);return t--,[i,r,t]}readNotationExp(e,t){t=F(e,t);let n=t;for(;t{for(;e1||r.length===1&&!a))return s;{let l=Number(t),c=String(l);if(l===0)return l;if(c.search(/[eE]/)!==-1)return e.eNotation?l:s;if(t.indexOf(".")!==-1)return c==="0"||c===o||c===`${i}${o}`?l:s;let u=r?o:t;return r?u===c||i+u===c?l:s:u===c||u===i+c?l:s}}else return s}}else return cc(s,Number(t),e)}var rc=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;function oc(s,e,t){if(!t.eNotation)return s;let n=e.match(rc);if(n){let i=n[1]||"",r=n[3].indexOf("e")===-1?"E":"e",o=n[2],a=i?s[o.length+1]===r:s[o.length]===r;return o.length>1&&a?s:o.length===1&&(n[3].startsWith(`.${r}`)||n[3][0]===r)?Number(e):o.length>0?t.leadingZeros&&!a?(e=(n[1]||"")+n[3],Number(e)):s:Number(e)}else return s}function ac(s){return s&&s.indexOf(".")!==-1&&(s=s.replace(/0+$/,""),s==="."?s="0":s[0]==="."?s="0"+s:s[s.length-1]==="."&&(s=s.substring(0,s.length-1))),s}function lc(s,e){if(parseInt)return parseInt(s,e);if(Number.parseInt)return Number.parseInt(s,e);if(window&&window.parseInt)return window.parseInt(s,e);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}function cc(s,e,t){let n=e===1/0;switch(t.infinity.toLowerCase()){case"null":return null;case"infinity":return e;case"string":return n?"Infinity":"-Infinity";default:return s}}function Js(s){return typeof s=="function"?s:Array.isArray(s)?e=>{for(let t of s)if(typeof t=="string"&&e===t||t instanceof RegExp&&t.test(e))return!0}:()=>!1}var U=class{constructor(e,t={},n){this.pattern=e,this.separator=t.separator||".",this.segments=this._parse(e),this.data=n,this._hasDeepWildcard=this.segments.some(i=>i.type==="deep-wildcard"),this._hasAttributeCondition=this.segments.some(i=>i.attrName!==void 0),this._hasPositionSelector=this.segments.some(i=>i.position!==void 0)}_parse(e){let t=[],n=0,i="";for(;n0?e[e.length-1].tag:void 0}getCurrentNamespace(){let e=this._matcher.path;return e.length>0?e[e.length-1].namespace:void 0}getAttrValue(e){let t=this._matcher.path;if(t.length!==0)return t[t.length-1].values?.[e]}hasAttr(e){let t=this._matcher.path;if(t.length===0)return!1;let n=t[t.length-1];return n.values!==void 0&&e in n.values}getPosition(){let e=this._matcher.path;return e.length===0?-1:e[e.length-1].position??0}getCounter(){let e=this._matcher.path;return e.length===0?-1:e[e.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this._matcher.path.length}toString(e,t=!0){return this._matcher.toString(e,t)}toArray(){return this._matcher.path.map(e=>e.tag)}matches(e){return this._matcher.matches(e)}matchesAny(e){return e.matchesAny(this._matcher)}},W=class{constructor(e={}){this.separator=e.separator||".",this.path=[],this.siblingStacks=[],this._pathStringCache=null,this._view=new Gs(this)}push(e,t=null,n=null){this._pathStringCache=null,this.path.length>0&&(this.path[this.path.length-1].values=void 0);let i=this.path.length;this.siblingStacks[i]||(this.siblingStacks[i]=new Map);let r=this.siblingStacks[i],o=n?`${n}:${e}`:e,a=r.get(o)||0,l=0;for(let u of r.values())l+=u;r.set(o,a+1);let c={tag:e,position:l,counter:a};n!=null&&(c.namespace=n),t!=null&&(c.values=t),this.path.push(c)}pop(){if(this.path.length===0)return;this._pathStringCache=null;let e=this.path.pop();return this.siblingStacks.length>this.path.length+1&&(this.siblingStacks.length=this.path.length+1),e}updateCurrent(e){if(this.path.length>0){let t=this.path[this.path.length-1];e!=null&&(t.values=e)}}getCurrentTag(){return this.path.length>0?this.path[this.path.length-1].tag:void 0}getCurrentNamespace(){return this.path.length>0?this.path[this.path.length-1].namespace:void 0}getAttrValue(e){if(this.path.length!==0)return this.path[this.path.length-1].values?.[e]}hasAttr(e){if(this.path.length===0)return!1;let t=this.path[this.path.length-1];return t.values!==void 0&&e in t.values}getPosition(){return this.path.length===0?-1:this.path[this.path.length-1].position??0}getCounter(){return this.path.length===0?-1:this.path[this.path.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this.path.length}toString(e,t=!0){let n=e||this.separator;if(n===this.separator&&t===!0){if(this._pathStringCache!==null)return this._pathStringCache;let r=this.path.map(o=>o.namespace?`${o.namespace}:${o.tag}`:o.tag).join(n);return this._pathStringCache=r,r}return this.path.map(r=>t&&r.namespace?`${r.namespace}:${r.tag}`:r.tag).join(n)}toArray(){return this.path.map(e=>e.tag)}reset(){this._pathStringCache=null,this.path=[],this.siblingStacks=[]}matches(e){let t=e.segments;return t.length===0?!1:e.hasDeepWildcard()?this._matchWithDeepWildcard(t):this._matchSimple(t)}_matchSimple(e){if(this.path.length!==e.length)return!1;for(let t=0;t=0&&t>=0;){let i=e[n];if(i.type==="deep-wildcard"){if(n--,n<0)return!0;let r=e[n],o=!1;for(let a=t;a>=0;a--)if(this._matchSegment(r,this.path[a],a===this.path.length-1)){t=a-1,n--,o=!0;break}if(!o)return!1}else{if(!this._matchSegment(i,this.path[t],t===this.path.length-1))return!1;t--,n--}}return n<0}_matchSegment(e,t,n){if(e.tag!=="*"&&e.tag!==t.tag||e.namespace!==void 0&&e.namespace!=="*"&&e.namespace!==t.namespace||e.attrName!==void 0&&(!n||!t.values||!(e.attrName in t.values)||e.attrValue!==void 0&&String(t.values[e.attrName])!==String(e.attrValue)))return!1;if(e.position!==void 0){if(!n)return!1;let i=t.counter??0;if(e.position==="first"&&i!==0)return!1;if(e.position==="odd"&&i%2!==1)return!1;if(e.position==="even"&&i%2!==0)return!1;if(e.position==="nth"&&i!==e.positionValue)return!1}return!0}matchesAny(e){return e.matchesAny(this)}snapshot(){return{path:this.path.map(e=>({...e})),siblingStacks:this.siblingStacks.map(e=>new Map(e))}}restore(e){this._pathStringCache=null,this.path=e.path.map(t=>({...t})),this.siblingStacks=e.siblingStacks.map(t=>new Map(t))}readOnly(){return this._view}};function uc(s,e){if(!s)return{};let t=e.attributesGroupName?s[e.attributesGroupName]:s;if(!t)return{};let n={};for(let i in t)if(i.startsWith(e.attributeNamePrefix)){let r=i.substring(e.attributeNamePrefix.length);n[r]=t[i]}else n[i]=t[i];return n}function fc(s){if(!s||typeof s!="string")return;let e=s.indexOf(":");if(e!==-1&&e>0){let t=s.substring(0,e);if(t!=="xmlns")return t}}var De=class{constructor(e,t){this.options=e,this.currentNode=null,this.tagsNodeStack=[],this.parseXml=gc,this.parseTextData=hc,this.resolveNameSpace=dc,this.buildAttributesMap=mc,this.isItStopNode=Sc,this.replaceEntitiesValue=bc,this.readStopNodeData=Ec,this.saveTextToParentTag=wc,this.addChild=yc,this.ignoreAttributesFn=Js(this.options.ignoreAttributes),this.entityExpansionCount=0,this.currentExpandedLength=0;let n={...Ue};this.options.entityDecoder?this.entityDecoder=this.options.entityDecoder:(typeof this.options.htmlEntities=="object"?n=this.options.htmlEntities:this.options.htmlEntities===!0&&(n={...Us,...Lt}),this.entityDecoder=new Ee({namedEntities:{...n,...t},numericAllowed:this.options.htmlEntities,limit:{maxTotalExpansions:this.options.processEntities.maxTotalExpansions,maxExpandedLength:this.options.processEntities.maxExpandedLength,applyLimitsTo:this.options.processEntities.appliesTo}})),this.matcher=new W,this.readonlyMatcher=this.matcher.readOnly(),this.isCurrentNodeStopNode=!1,this.stopNodeExpressionsSet=new ve;let i=this.options.stopNodes;if(i&&i.length>0){for(let r=0;r0)){o||(s=this.replaceEntitiesValue(s,e,t));let l=a.jPath?t.toString():t,c=a.tagValueProcessor(e,s,l,i,r);return c==null?s:typeof c!=typeof s||c!==s?c:a.trimValues||s.trim()===s?Xs(s,a.parseTagValue,a.numberParseOptions):s}}function dc(s){if(this.options.removeNSPrefix){let e=s.split(":"),t=s.charAt(0)==="/"?"/":"";if(e[0]==="xmlns")return"";e.length===2&&(s=t+e[1])}return s}var pc=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function mc(s,e,t,n=!1){let i=this.options;if(n===!0||i.ignoreAttributes!==!0&&typeof s=="string"){let r=kt(s,pc),o=r.length,a={},l=new Array(o),c=!1,u={};for(let p=0;p",a,"Closing Tag is not closed."),f=s.substring(a+2,u).trim();if(i.removeNSPrefix){let p=f.indexOf(":");p!==-1&&(f=f.substr(p+1))}f=Ws(i.transformTagName,f,"",i).tagName,t&&(n=this.saveTextToParentTag(n,t,this.readonlyMatcher));let h=this.matcher.getCurrentTag();if(f&&i.unpairedTagsSet.has(f))throw new Error(`Unpaired tag can not be used as closing tag: `);h&&i.unpairedTagsSet.has(h)&&(this.matcher.pop(),this.tagsNodeStack.pop()),this.matcher.pop(),this.isCurrentNodeStopNode=!1,t=this.tagsNodeStack.pop(),n="",a=u}else if(c===63){let u=Hs(s,a,!1,"?>");if(!u)throw new Error("Pi Tag is not closed.");n=this.saveTextToParentTag(n,t,this.readonlyMatcher);let f=this.buildAttributesMap(u.tagExp,this.matcher,u.tagName,!0);if(f){let h=f[this.options.attributeNamePrefix+"version"];this.entityDecoder.setXmlVersion(Number(h)||1)}if(!(i.ignoreDeclaration&&u.tagName==="?xml"||i.ignorePiTags)){let h=new R(u.tagName);h.add(i.textNodeName,""),u.tagName!==u.tagExp&&u.attrExpPresent&&i.ignoreAttributes!==!0&&(h[":@"]=f),this.addChild(t,h,this.readonlyMatcher,a)}a=u.closeIndex+1}else if(c===33&&s.charCodeAt(a+2)===45&&s.charCodeAt(a+3)===45){let u=Te(s,"-->",a+4,"Comment is not closed.");if(i.commentPropName){let f=s.substring(a+4,u-2);n=this.saveTextToParentTag(n,t,this.readonlyMatcher),t.add(i.commentPropName,[{[i.textNodeName]:f}])}a=u}else if(c===33&&s.charCodeAt(a+2)===68){let u=r.readDocType(s,a);this.entityDecoder.addInputEntities(u.entities),a=u.i}else if(c===33&&s.charCodeAt(a+2)===91){let u=Te(s,"]]>",a,"CDATA is not closed.")-2,f=s.substring(a+9,u);n=this.saveTextToParentTag(n,t,this.readonlyMatcher);let h=this.parseTextData(f,t.tagname,this.readonlyMatcher,!0,!1,!0,!0);h==null&&(h=""),i.cdataPropName?t.add(i.cdataPropName,[{[i.textNodeName]:f}]):t.add(i.textNodeName,h),a=u+2}else{let u=Hs(s,a,i.removeNSPrefix);if(!u){let N=s.substring(Math.max(0,a-50),Math.min(o,a+50));throw new Error(`readTagExp returned undefined at position ${a}. Context: "${N}"`)}let f=u.tagName,h=u.rawTagName,p=u.tagExp,g=u.attrExpPresent,d=u.closeIndex;if({tagName:f,tagExp:p}=Ws(i.transformTagName,f,p,i),i.strictReservedNames&&(f===i.commentPropName||f===i.cdataPropName||f===i.textNodeName||f===i.attributesGroupName))throw new Error(`Invalid tag name: ${f}`);t&&n&&t.tagname!=="!xml"&&(n=this.saveTextToParentTag(n,t,this.readonlyMatcher,!1));let m=t;m&&i.unpairedTagsSet.has(m.tagname)&&(t=this.tagsNodeStack.pop(),this.matcher.pop());let b=!1;p.length>0&&p.lastIndexOf("/")===p.length-1&&(b=!0,f[f.length-1]==="/"?(f=f.substr(0,f.length-1),p=f):p=p.substr(0,p.length-1),g=f!==p);let y=null,A={},v;v=fc(h),f!==e.tagname&&this.matcher.push(f,{},v),f!==p&&g&&(y=this.buildAttributesMap(p,this.matcher,f),y&&(A=uc(y,i))),f!==e.tagname&&(this.isCurrentNodeStopNode=this.isItStopNode());let E=a;if(this.isCurrentNodeStopNode){let N="";if(b)a=u.closeIndex;else if(i.unpairedTagsSet.has(f))a=u.closeIndex;else{let S=this.readStopNodeData(s,h,d+1);if(!S)throw new Error(`Unexpected end of ${h}`);a=S.i,N=S.tagContent}let O=new R(f);y&&(O[":@"]=y),O.add(i.textNodeName,N),this.matcher.pop(),this.isCurrentNodeStopNode=!1,this.addChild(t,O,this.readonlyMatcher,E)}else{if(b){({tagName:f,tagExp:p}=Ws(i.transformTagName,f,p,i));let N=new R(f);y&&(N[":@"]=y),this.addChild(t,N,this.readonlyMatcher,E),this.matcher.pop(),this.isCurrentNodeStopNode=!1}else if(i.unpairedTagsSet.has(f)){let N=new R(f);y&&(N[":@"]=y),this.addChild(t,N,this.readonlyMatcher,E),this.matcher.pop(),this.isCurrentNodeStopNode=!1,a=u.closeIndex;continue}else{let N=new R(f);if(this.tagsNodeStack.length>i.maxNestedTags)throw new Error("Maximum nested tags exceeded");this.tagsNodeStack.push(t),y&&(N[":@"]=y),this.addChild(t,N,this.readonlyMatcher,E),t=N}n="",a=d}}}else n+=s[a];return e.child};function yc(s,e,t,n){this.options.captureMetaData||(n=void 0);let i=this.options.jPath?t.toString():t,r=this.options.updateTag(e.tagname,i,e[":@"]);r===!1||(typeof r=="string"&&(e.tagname=r),s.addChild(e,n))}function bc(s,e,t){let n=this.options.processEntities;if(!n||!n.enabled)return s;if(n.allowedTags){let i=this.options.jPath?t.toString():t;if(!(Array.isArray(n.allowedTags)?n.allowedTags.includes(e):n.allowedTags(e,i)))return s}if(n.tagFilter){let i=this.options.jPath?t.toString():t;if(!n.tagFilter(e,i))return s}return this.entityDecoder.decode(s)}function wc(s,e,t,n){return s&&(n===void 0&&(n=e.child.length===0),s=this.parseTextData(s,e.tagname,t,!1,e[":@"]?Object.keys(e[":@"]).length!==0:!1,n),s!==void 0&&s!==""&&e.add(this.options.textNodeName,s),s=""),s}function Sc(){return this.stopNodeExpressionsSet.size===0?!1:this.matcher.matchesAny(this.stopNodeExpressionsSet)}function Nc(s,e,t=">"){let n=0,i=s.length,r=t.charCodeAt(0),o=t.length>1?t.charCodeAt(1):-1,a="",l=e;for(let c=e;c",t,`${e} is not closed`);if(s.substring(t+2,a).trim()===e&&(i--,i===0))return{tagContent:s.substring(n,t),i:a};t=a}else if(o===63)t=Te(s,"?>",t+1,"StopNode is not closed.");else if(o===33&&s.charCodeAt(t+2)===45&&s.charCodeAt(t+3)===45)t=Te(s,"-->",t+3,"StopNode is not closed.");else if(o===33&&s.charCodeAt(t+2)===91)t=Te(s,"]]>",t,"StopNode is not closed.")-2;else{let a=Hs(s,t,!1);a&&((a&&a.tagName)===e&&a.tagExp[a.tagExp.length-1]!=="/"&&i++,t=a.closeIndex)}}}function Xs(s,e,t){if(e&&typeof s=="string"){let n=s.trim();return n==="true"?!0:n==="false"?!1:Ds(s,t)}else return sr(s)?s:""}function Ws(s,e,t,n){if(s){let i=s(e);t===e&&(t=i),e=i}return e=vr(e,n),{tagName:e,tagExp:t}}function vr(s,e){if(It.includes(s))throw new Error(`[SECURITY] Invalid name: "${s}" is a reserved JavaScript keyword that could cause prototype pollution`);return Ve.includes(s)?e.onDangerousProperty(s):s}var zs=R.getMetaDataSymbol();function vc(s,e){if(!s||typeof s!="object")return{};if(!e)return s;let t={};for(let n in s)if(n.startsWith(e)){let i=n.substring(e.length);t[i]=s[n]}else t[n]=s[n];return t}function Qs(s,e,t,n){return Tr(s,e,t,n)}function Tr(s,e,t,n){let i,r={};for(let o=0;o0&&(r[e.textNodeName]=i):i!==void 0&&(r[e.textNodeName]=i),r}function Tc(s){let e=Object.keys(s);for(let t=0;t/g,"]]]]>")}function te(s){return String(s).replace(/"/g,""").replace(/'/g,"'")}var kc=` -`;function en(s,e){let t="";e.format&&(t=kc);let n=[];if(e.stopNodes&&Array.isArray(e.stopNodes))for(let r=0;re.maxNestedTags)throw new Error("Maximum nested tags exceeded");if(!Array.isArray(s)){if(s!=null){let a=s.toString();return a=Zs(a,e),a}return""}for(let a=0;a`,o=!1,n.pop();continue}else if(c===e.commentPropName){let m=l[c][0][e.textNodeName],b=_t(m);r+=t+``,o=!0,n.pop();continue}else if(c[0]==="?"){let m=Cr(l[":@"],e,f);r+=(c==="?xml"?"":t)+`<${c}${m}?>`,o=!0,n.pop();continue}let h=t;h!==""&&(h+=e.indentBy);let p=Cr(l[":@"],e,f),g=t+`<${c}${p}`,d;f?d=kr(l[c],e):d=Or(l[c],e,h,n,i),e.unpairedTags.indexOf(c)!==-1?e.suppressUnpairedNode?r+=g+">":r+=g+"/>":(!d||d.length===0)&&e.suppressEmptyNode?r+=g+"/>":d&&d.endsWith(">")?r+=g+`>${d}${t}`:(r+=g+">",d&&t!==""&&(d.includes("/>")||d.includes("`),o=!0,n.pop()}return r}function Ic(s,e){if(!s||e.ignoreAttributes)return null;let t={},n=!1;for(let i in s){if(!Object.prototype.hasOwnProperty.call(s,i))continue;let r=i.startsWith(e.attributeNamePrefix)?i.substr(e.attributeNamePrefix.length):i;t[r]=te(s[i]),n=!0}return n?t:null}function kr(s,e){if(!Array.isArray(s))return s!=null?s.toString():"";let t="";for(let n=0;n`:t+=`<${r}${o}>${a}`}}}return t}function Lc(s,e){let t="";if(s&&!e.ignoreAttributes)for(let n in s){if(!Object.prototype.hasOwnProperty.call(s,n))continue;let i=s[n];i===!0&&e.suppressBooleanAttributes?t+=` ${n.substr(e.attributeNamePrefix.length)}`:t+=` ${n.substr(e.attributeNamePrefix.length)}="${te(i)}"`}return t}function Ir(s){let e=Object.keys(s);for(let t=0;t0&&e.processEntities)for(let t=0;t{for(let t of s)if(typeof t=="string"&&e===t||t instanceof RegExp&&t.test(e))return!0}:()=>!1}var Pc={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(s,e){return e},attributeValueProcessor:function(s,e){return e},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&"},{regex:new RegExp(">","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1,maxNestedTags:100,jPath:!0};function B(s){if(this.options=Object.assign({},Pc,s),this.options.stopNodes&&Array.isArray(this.options.stopNodes)&&(this.options.stopNodes=this.options.stopNodes.map(e=>typeof e=="string"&&e.startsWith("*.")?".."+e.substring(2):e)),this.stopNodeExpressions=[],this.options.stopNodes&&Array.isArray(this.options.stopNodes))for(let e=0;e -`,this.newLine=` -`):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}B.prototype.build=function(s){if(this.options.preserveOrder)return en(s,this.options);{Array.isArray(s)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(s={[this.options.arrayNodeName]:s});let e=new W;return this.j2x(s,0,e).val}};B.prototype.j2x=function(s,e,t){let n="",i="";if(this.options.maxNestedTags&&t.getDepth()>=this.options.maxNestedTags)throw new Error("Maximum nested tags exceeded");let r=this.options.jPath?t.toString():t,o=this.checkStopNode(t);for(let a in s)if(Object.prototype.hasOwnProperty.call(s,a))if(typeof s[a]>"u")this.isAttribute(a)&&(i+="");else if(s[a]===null)this.isAttribute(a)||a===this.options.cdataPropName||a===this.options.commentPropName?i+="":a[0]==="?"?i+=this.indentate(e)+"<"+a+"?"+this.tagEndChar:i+=this.indentate(e)+"<"+a+"/"+this.tagEndChar;else if(s[a]instanceof Date)i+=this.buildTextValNode(s[a],a,"",e,t);else if(typeof s[a]!="object"){let l=this.isAttribute(a);if(l&&!this.ignoreAttributesFn(l,r))n+=this.buildAttrPairStr(l,""+s[a],o);else if(!l)if(a===this.options.textNodeName){let c=this.options.tagValueProcessor(a,""+s[a]);i+=this.replaceEntitiesValue(c)}else{t.push(a);let c=this.checkStopNode(t);if(t.pop(),c){let u=""+s[a];u===""?i+=this.indentate(e)+"<"+a+this.closeTag(a)+this.tagEndChar:i+=this.indentate(e)+"<"+a+">"+u+""u"))if(h===null)a[0]==="?"?i+=this.indentate(e)+"<"+a+"?"+this.tagEndChar:i+=this.indentate(e)+"<"+a+"/"+this.tagEndChar;else if(typeof h=="object")if(this.options.oneListGroup){t.push(a);let p=this.j2x(h,e+1,t);t.pop(),c+=p.val,this.options.attributesGroupName&&h.hasOwnProperty(this.options.attributesGroupName)&&(u+=p.attrStr)}else c+=this.processTextOrObjNode(h,a,e,t);else if(this.options.oneListGroup){let p=this.options.tagValueProcessor(a,h);p=this.replaceEntitiesValue(p),c+=p}else{t.push(a);let p=this.checkStopNode(t);if(t.pop(),p){let g=""+h;g===""?c+=this.indentate(e)+"<"+a+this.closeTag(a)+this.tagEndChar:c+=this.indentate(e)+"<"+a+">"+g+"${i}`;else if(typeof i=="object"&&i!==null){let r=this.buildRawContent(i),o=this.buildAttributesForStopNode(i);r===""?e+=`<${t}${o}/>`:e+=`<${t}${o}>${r}`}}else if(typeof n=="object"&&n!==null){let i=this.buildRawContent(n),r=this.buildAttributesForStopNode(n);i===""?e+=`<${t}${r}/>`:e+=`<${t}${r}>${i}`}else e+=`<${t}>${n}`}return e};B.prototype.buildAttributesForStopNode=function(s){if(!s||typeof s!="object")return"";let e="";if(this.options.attributesGroupName&&s[this.options.attributesGroupName]){let t=s[this.options.attributesGroupName];for(let n in t){if(!Object.prototype.hasOwnProperty.call(t,n))continue;let i=n.startsWith(this.options.attributeNamePrefix)?n.substring(this.options.attributeNamePrefix.length):n,r=t[n];r===!0&&this.options.suppressBooleanAttributes?e+=" "+i:e+=" "+i+'="'+r+'"'}}else for(let t in s){if(!Object.prototype.hasOwnProperty.call(s,t))continue;let n=this.isAttribute(t);if(n){let i=s[t];i===!0&&this.options.suppressBooleanAttributes?e+=" "+n:e+=" "+n+'="'+i+'"'}}return e};B.prototype.buildObjectNode=function(s,e,t,n){if(s==="")return e[0]==="?"?this.indentate(n)+"<"+e+t+"?"+this.tagEndChar:this.indentate(n)+"<"+e+t+this.closeTag(e)+this.tagEndChar;if(e[0]==="?")return this.indentate(n)+"<"+e+t+"?"+this.tagEndChar;{let i=""+s+i:this.options.commentPropName!==!1&&e===this.options.commentPropName&&r.length===0?this.indentate(n)+``+this.newLine:this.indentate(n)+"<"+e+t+r+this.tagEndChar+s+this.indentate(n)+i}};B.prototype.closeTag=function(s){let e="";return this.options.unpairedTags.indexOf(s)!==-1?this.options.suppressUnpairedNode||(e="/"):this.options.suppressEmptyNode?e="/":e=`>`+this.newLine}else if(this.options.commentPropName!==!1&&e===this.options.commentPropName){let r=_t(s);return this.indentate(n)+``+this.newLine}else{if(e[0]==="?")return this.indentate(n)+"<"+e+t+"?"+this.tagEndChar;{let r=this.options.tagValueProcessor(e,s);return r=this.replaceEntitiesValue(r),r===""?this.indentate(n)+"<"+e+t+this.closeTag(e)+this.tagEndChar:this.indentate(n)+"<"+e+t+">"+r+"0&&this.options.processEntities)for(let e=0;e-1&&t!=="'"&&Fc(s,e));return e>-1&&(e+=n.length,n.length>1&&(s[e]===t&&e++,s[e]===t&&e++)),e}var Bc=/^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i,Je=class s extends Date{#t=!1;#s=!1;#e=null;constructor(e){let t=!0,n=!0,i="Z";if(typeof e=="string"){let r=e.match(Bc);r?(r[1]||(t=!1,e=`0000-01-01T${e}`),n=!!r[2],n&&e[10]===" "&&(e=e.replace(" ","T")),r[2]&&+r[2]>23?e="":(i=r[3]||null,e=e.toUpperCase(),!i&&n&&(e+="Z"))):e=""}super(e),isNaN(this.getTime())||(this.#t=t,this.#s=n,this.#e=i)}isDateTime(){return this.#t&&this.#s}isLocal(){return!this.#t||!this.#s||!this.#e}isDate(){return this.#t&&!this.#s}isTime(){return this.#s&&!this.#t}isValid(){return this.#t||this.#s}toISOString(){let e=super.toISOString();if(this.isDate())return e.slice(0,10);if(this.isTime())return e.slice(11,23);if(this.#e===null)return e.slice(0,-1);if(this.#e==="Z")return e;let t=+this.#e.slice(1,3)*60+ +this.#e.slice(4,6);return t=this.#e[0]==="-"?t:-t,new Date(this.getTime()-t*6e4).toISOString().slice(0,-1)+this.#e}static wrapAsOffsetDateTime(e,t="Z"){let n=new s(e);return n.#e=t,n}static wrapAsLocalDateTime(e){let t=new s(e);return t.#e=null,t}static wrapAsLocalDate(e){let t=new s(e);return t.#s=!1,t.#e=null,t}static wrapAsLocalTime(e){let t=new s(e);return t.#t=!1,t.#e=null,t}};var Vc=/^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/,jc=/^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/,Uc=/^[+-]?0[0-9_]/,Kc=/^[0-9a-f]{2,8}$/i,$r={b:"\b",t:" ",n:` -`,f:"\f",r:"\r",e:"\x1B",'"':'"',"\\":"\\"};function Ft(s,e=0,t=s.length){let n=s[e]==="'",i=s[e++]===s[e]&&s[e]===s[e+1];i&&(t-=2,s[e+=2]==="\r"&&e++,s[e]===` -`&&e++);let r=0,o,a="",l=e;for(;e-1&&(Oe(s,i),n=n.slice(0,i)),[n.trimEnd(),i]}function Ge(s,e,t,n,i){if(n===0)throw new T("document contains excessively nested structures. aborting.",{toml:s,ptr:e});let r=s[e];if(r==="["||r==="{"){let[l,c]=r==="["?Br(s,e,n,i):Fr(s,e,n,i);if(t){if(c=K(s,c),s[c]===",")c++;else if(s[c]!==t)throw new T("expected comma or end of structure",{toml:s,ptr:c})}return[l,c]}let o;if(r==='"'||r==="'"){o=Rt(s,e);let l=Ft(s,e,o);if(t){if(o=K(s,o),s[o]&&s[o]!==","&&s[o]!==t&&s[o]!==` -`&&s[o]!=="\r")throw new T("unexpected character encountered",{toml:s,ptr:o});o+=+(s[o]===",")}return[l,o]}o=Mr(s,e,",",t);let a=Yc(s,e,o-+(s[o-1]===","));if(!a[0])throw new T("incomplete key-value declaration: no value specified",{toml:s,ptr:e});return t&&a[1]>-1&&(o=K(s,e+a[1]),o+=+(s[o]===",")),[Rr(a[0],s,e,i),o]}var Dc=/^[a-zA-Z0-9-_]+[ \t]*$/;function Bt(s,e,t="="){let n=e-1,i=[],r=s.indexOf(t,e);if(r<0)throw new T("incomplete key-value: cannot find end of key",{toml:s,ptr:e});do{let o=s[e=++n];if(o!==" "&&o!==" ")if(o==='"'||o==="'"){if(o===s[e+1]&&o===s[e+2])throw new T("multiline strings are not allowed in keys",{toml:s,ptr:e});let a=Rt(s,e);if(a<0)throw new T("unfinished string encountered",{toml:s,ptr:e});n=s.indexOf(".",a);let l=s.slice(a,n<0||n>r?r:n),c=$t(l);if(c>-1)throw new T("newlines are not allowed in keys",{toml:s,ptr:e+n+c});if(l.trimStart())throw new T("found extra tokens after the string part",{toml:s,ptr:a});if(rr?r:n);if(!Dc.test(a))throw new T("only letter, numbers, dashes and underscores are allowed in keys",{toml:s,ptr:e});i.push(a.trimEnd())}}while(n+1&&nr===""?null:r});return D(n.parse(t))}case"ini":return D(Rs.parse(t));case"csv":return D(kp(t,e.csvDelimiter,e.csvHeader));case"toml":return D(Vt(t));default:{let n=e.inputFormat;throw new Error(`Invalid input format: ${n}`)}}}function _l(s){return Ct.default.parseAllDocuments(s).map(t=>D(t.toJS({maxAliasCount:100})))}function xl(s){let e=s.trimStart();if(e.startsWith("---")){let t=e.slice(3).match(/\n---(\n|$)/);if(t&&t.index!==void 0){let n=e.slice(3,t.index+3),i=e.slice(t.index+3+t[0].length);return{frontMatter:D(Ct.default.parse(n,{maxAliasCount:100})),content:i}}}if(e.startsWith("+++")){let t=e.slice(3).match(/\n\+\+\+(\n|$)/);if(t&&t.index!==void 0){let n=e.slice(3,t.index+3),i=e.slice(t.index+3+t[0].length);return{frontMatter:D(Vt(n)),content:i}}}if(e.startsWith("{{{")){let t=e.slice(3).match(/\n}}}(\n|$)/);if(t&&t.index!==void 0){let n=e.slice(3,t.index+3),i=e.slice(t.index+3+t[0].length);return{frontMatter:D(JSON.parse(n)),content:i}}}return null}function Ml(s,e){if(s===void 0)return"";switch(e.outputFormat){case"yaml":return Ct.default.stringify(s,{indent:e.indent}).trimEnd();case"json":return e.raw&&typeof s=="string"?s:e.compact?JSON.stringify(s):JSON.stringify(s,null,e.indent);case"xml":return new sn({ignoreAttributes:!1,attributeNamePrefix:e.xmlAttributePrefix,textNodeName:e.xmlContentName,format:e.prettyPrint||!e.compact,indentBy:" ".repeat(e.indent)}).build(s);case"ini":return!s||typeof s!="object"||Array.isArray(s)?"":Rs.stringify(s);case"csv":return Ip(s,e.csvDelimiter);case"toml":return!s||typeof s!="object"||Array.isArray(s)?"":cn(s);default:throw new Error(`Unknown output format: ${e.outputFormat}`)}}var Lp={name:"yq",summary:"command-line YAML/XML/INI/CSV/TOML processor",usage:"yq [OPTIONS] [FILTER] [FILE]",description:`yq uses jq-style expressions to query and transform data in various formats. -Supports YAML, JSON, XML, INI, CSV, and TOML with automatic format conversion. - -EXAMPLES: - # Extract a value from YAML - yq '.name' config.yaml - yq '.users[0].email' data.yaml - - # Filter arrays - yq '.items[] | select(.active == true)' data.yaml - yq '[.users[] | select(.age > 30)]' users.yaml - - # Transform data - yq '.users | map({name, email})' data.yaml - yq '.items | sort_by(.price) | reverse' products.yaml - - # Modify file in-place - yq -i '.version = "2.0"' config.yaml - - # Read JSON, output YAML - yq -p json '.' config.json - - # Read YAML, output JSON - yq -o json '.' config.yaml - yq -o json -c '.' config.yaml # compact JSON - - # Parse TOML config files - yq '.package.name' Cargo.toml - yq -o json '.' pyproject.toml - - # Parse XML (attributes use +@ prefix, text uses +content) - yq -p xml '.root.items.item[].name' data.xml - yq -p xml '.root.user["+@id"]' data.xml # XML attributes - - # Parse INI config files - yq -p ini '.database.host' config.ini - yq -p ini '.server' config.ini -o json - - # Parse CSV/TSV (auto-detects delimiter) - yq -p csv '.[0].name' data.csv - yq '.[0].name' data.tsv # auto-detected as CSV - yq -p csv '[.[] | select(.category == "A")]' data.csv - - # Extract front-matter from markdown/content files - yq --front-matter '.title' post.md - - # Convert between formats - yq -p json -o csv '.users' data.json # JSON to CSV - yq -p csv -o yaml '.' data.csv # CSV to YAML - yq -p ini -o json '.' config.ini # INI to JSON - yq -p xml -o json '.' data.xml # XML to JSON - yq -o toml '.' config.yaml # YAML to TOML - - # Common jq functions work in yq: - yq 'keys' data.yaml # get object keys - yq 'length' data.yaml # array/string length - yq '.items | first' data.yaml # first element - yq '.items | last' data.yaml # last element - yq '.nums | add' data.yaml # sum numbers - yq '.nums | min' data.yaml # minimum - yq '.nums | max' data.yaml # maximum - yq '.items | unique' data.yaml # unique values - yq '.items | group_by(.type)' data.yaml`,options:["-p, --input-format=FMT input format: yaml (default), xml, json, ini, csv, toml","-o, --output-format=FMT output format: yaml (default), json, xml, ini, csv, toml","-i, --inplace modify file in-place","-r, --raw-output output strings without quotes (json only)","-c, --compact compact output (json only)","-e, --exit-status set exit status based on output","-s, --slurp read entire input into array","-n, --null-input don't read any input","-j, --join-output don't print newlines after each output","-f, --front-matter extract and process front-matter only","-P, --prettyPrint pretty print output","-I, --indent=N set indent level (default: 2)"," --xml-attribute-prefix=STR XML attribute prefix (default: +@)"," --xml-content-name=STR XML text content name (default: +content)"," --csv-delimiter=CHAR CSV delimiter (default: auto-detect)"," --csv-header CSV has header row (default: true)"," --help display this help and exit"]};function qp(s){let e={...ql,exitStatus:!1,slurp:!1,nullInput:!1,joinOutput:!1,inplace:!1,frontMatter:!1},t=!1,n=".",i=!1,r=[];for(let o=0;oZi(e.requireDefenseContext,"yq",u,f);if(zi(s))return Xi(Lp);let n=qp(s);if("exitCode"in n)return n;let{options:i,filter:r,files:o,inputFormatExplicit:a}=n;if(!a&&o.length>0&&o[0]!=="-"){let u=Pl(o[0]);u&&(i.inputFormat=u)}if(i.inplace&&(o.length===0||o[0]==="-"))return{stdout:"",stderr:`yq: -i/--inplace requires a file argument -`,exitCode:1};let l,c;if(i.nullInput)l="";else if(o.length===0||o.length===1&&o[0]==="-")l=Hi(e.stdin);else try{let u=e.fs.resolvePath(e.cwd,o[0]);c=u,l=await t("file read",()=>e.fs.readFile(u))}catch(u){if(u instanceof Bs)throw u;return{stdout:"",stderr:`yq: ${o[0]}: No such file or directory -`,exitCode:2}}try{let u=er(r),f,h={limits:e.limits?{maxIterations:e.limits.maxJqIterations}:void 0,env:e.env,coverage:e.coverage,requireDefenseContext:e.requireDefenseContext};if(i.nullInput)f=Be(null,u,h);else if(i.frontMatter){let y=xl(l);if(!y)return{stdout:"",stderr:`yq: no front-matter found -`,exitCode:1};f=Be(y.frontMatter,u,h)}else if(i.slurp){let y;i.inputFormat==="yaml"?y=_l(l):y=[Gi(l,i)],f=Be(y,u,h)}else{let y=Gi(l,i);f=Be(y,u,h)}let p=f.map(y=>Ml(y,i)),g=i.joinOutput?"":` -`,d=p.filter(y=>y!=="").join(g),m=d?i.joinOutput?d:`${d} -`:"";if(i.inplace&&c)return await t("in-place write",()=>e.fs.writeFile(c,m)),{stdout:"",stderr:"",exitCode:0};let b=i.exitStatus&&(f.length===0||f.every(y=>y==null||y===!1))?1:0;return{stdout:m,stderr:"",exitCode:b}}catch(u){if(u instanceof Bs)throw u;if(u instanceof Vs)return{stdout:"",stderr:`yq: ${js(u.message)} -`,exitCode:Vs.EXIT_CODE};let f=js(u.message);return f.includes("Unknown function")?{stdout:"",stderr:`yq: error: ${f} -`,exitCode:3}:{stdout:"",stderr:`yq: parse error: ${f} -`,exitCode:5}}}},By={name:"yq",flags:[{flag:"-r",type:"boolean"},{flag:"-c",type:"boolean"},{flag:"-s",type:"boolean"},{flag:"-i",type:"value",valueHint:"string"},{flag:"-o",type:"value",valueHint:"string"}],stdinType:"text",needsArgs:!0};export{Fy as a,By as b}; -/*! Bundled license information: - -smol-toml/dist/error.js: -smol-toml/dist/util.js: -smol-toml/dist/date.js: -smol-toml/dist/primitive.js: -smol-toml/dist/extract.js: -smol-toml/dist/struct.js: -smol-toml/dist/parse.js: -smol-toml/dist/stringify.js: -smol-toml/dist/index.js: - (*! - * Copyright (c) Squirrel Chat et al., All rights reserved. - * SPDX-License-Identifier: BSD-3-Clause - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the names of its contributors - * may be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *) -*/ diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-R4IFXNY5.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-R4IFXNY5.js deleted file mode 100644 index 4d1c20a..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-R4IFXNY5.js +++ /dev/null @@ -1,28 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a as H}from"./chunk-QIQMJJZ4.js";import{a as x,b as E}from"./chunk-QAYAQNCG.js";import{minimatch as R}from"minimatch";function M(n){if(n<1024)return String(n);if(n<1024*1024){let c=n/1024;return c<10?`${c.toFixed(1)}K`:`${Math.round(c)}K`}if(n<1024*1024*1024){let c=n/1048576;return c<10?`${c.toFixed(1)}M`:`${Math.round(c)}M`}let s=n/(1024*1024*1024);return s<10?`${s.toFixed(1)}G`:`${Math.round(s)}G`}function T(n){let c=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][n.getMonth()],w=String(n.getDate()).padStart(2," "),S=new Date,y=new Date(S.getTime()-4320*60*60*1e3);if(n>y){let b=String(n.getHours()).padStart(2,"0"),g=String(n.getMinutes()).padStart(2,"0");return`${c} ${w} ${b}:${g}`}let P=n.getFullYear();return`${c} ${w} ${P}`}function C(n){return n.isDirectory?"/":n.isSymbolicLink?"@":(n.mode&73)!==0?"*":""}var k={name:"ls",summary:"list directory contents",usage:"ls [OPTION]... [FILE]...",options:["-a, --all do not ignore entries starting with .","-A, --almost-all do not list . and ..","-d, --directory list directories themselves, not their contents","-F, --classify append indicator (one of */=>@) to entries","-h, --human-readable with -l, print sizes like 1K 234M 2G etc.","-l use a long listing format","-r, --reverse reverse order while sorting","-R, --recursive list subdirectories recursively","-S sort by file size, largest first","-t sort by time, newest first","-1 list one file per line"," --help display this help and exit"]},G={showAll:{short:"a",long:"all",type:"boolean"},showAlmostAll:{short:"A",long:"almost-all",type:"boolean"},longFormat:{short:"l",type:"boolean"},humanReadable:{short:"h",long:"human-readable",type:"boolean"},recursive:{short:"R",long:"recursive",type:"boolean"},reverse:{short:"r",long:"reverse",type:"boolean"},sortBySize:{short:"S",type:"boolean"},classifyFiles:{short:"F",long:"classify",type:"boolean"},directoryOnly:{short:"d",long:"directory",type:"boolean"},sortByTime:{short:"t",type:"boolean"},onePerLine:{short:"1",type:"boolean"}},Z={name:"ls",async execute(n,s){if(E(n))return x(k);let c=H("ls",n,G);if(!c.ok)return c.error;let w=c.result.flags.showAll,S=c.result.flags.showAlmostAll,y=c.result.flags.longFormat,P=c.result.flags.humanReadable,b=c.result.flags.recursive,g=c.result.flags.reverse,v=c.result.flags.sortBySize,$=c.result.flags.classifyFiles,A=c.result.flags.directoryOnly,p=c.result.flags.sortByTime;c.result.flags.onePerLine;let r=c.result.positional;r.length===0&&r.push(".");let a="",l="",u=0;for(let f=0;f0&&a&&!a.endsWith(` - -`)&&(a+=` -`),A){let i=s.fs.resolvePath(s.cwd,o);try{let t=await s.fs.stat(i);if(y){let e=t.isDirectory?"drwxr-xr-x":"-rw-r--r--",d=$?C(await s.fs.lstat(i)):t.isDirectory?"/":"",h=t.size??0,m=P?M(h).padStart(5):String(h).padStart(5),z=t.mtime??new Date(0),F=T(z);a+=`${e} 1 user user ${m} ${F} ${o}${d} -`}else{let e=$?C(await s.fs.lstat(i)):"";a+=`${o}${e} -`}}catch{l+=`ls: cannot access '${o}': No such file or directory -`,u=2}continue}if(o.includes("*")||o.includes("?")||o.includes("[")){let i=await _(o,s,w,S,y,g,P,v,$);a+=i.stdout,l+=i.stderr,i.exitCode!==0&&(u=i.exitCode)}else{let i=await O(o,s,w,S,y,b,r.length>1,g,P,v,$);a+=i.stdout,l+=i.stderr,i.exitCode!==0&&(u=i.exitCode)}}return{stdout:a,stderr:l,exitCode:u}}};async function _(n,s,c,w,S,y=!1,P=!1,b=!1,g=!1){let v=c||w,$=s.fs.getAllPaths(),A=s.fs.resolvePath(s.cwd,"."),p=[];for(let r of $){let a=r.startsWith(A)&&r.slice(A.length+1)||r;if(R(a,n)||R(r,n)){let l=a.split("/").pop()||a;if(!v&&l.startsWith("."))continue;p.push(a||r)}}if(p.length===0)return{stdout:"",stderr:`ls: ${n}: No such file or directory -`,exitCode:2};if(b){let r=[];for(let a of p){let l=s.fs.resolvePath(s.cwd,a);try{let u=await s.fs.stat(l);r.push({path:a,size:u.size??0})}catch{r.push({path:a,size:0})}}r.sort((a,l)=>l.size-a.size),p.length=0,p.push(...r.map(a=>a.path))}else p.sort();if(y&&p.reverse(),S){let r=[];for(let a of p){let l=s.fs.resolvePath(s.cwd,a);try{let u=await s.fs.stat(l),f=u.isDirectory?"drwxr-xr-x":"-rw-r--r--",o=g?C(await s.fs.lstat(l)):u.isDirectory?"/":"",i=u.size??0,t=P?M(i).padStart(5):String(i).padStart(5),e=u.mtime??new Date(0),d=T(e);r.push(`${f} 1 user user ${t} ${d} ${a}${o}`)}catch{r.push(`-rw-r--r-- 1 user user 0 Jan 1 00:00 ${a}`)}}return{stdout:`${r.join(` -`)} -`,stderr:"",exitCode:0}}if(g){let r=[];for(let a of p){let l=s.fs.resolvePath(s.cwd,a);try{let u=await s.fs.lstat(l);r.push(`${a}${C(u)}`)}catch{r.push(a)}}return{stdout:`${r.join(` -`)} -`,stderr:"",exitCode:0}}return{stdout:`${p.join(` -`)} -`,stderr:"",exitCode:0}}async function O(n,s,c,w,S,y,P,b=!1,g=!1,v=!1,$=!1,A=!1){let p=c||w,r=s.fs.resolvePath(s.cwd,n);try{let a=await s.fs.stat(r);if(!a.isDirectory){let f=$?C(await s.fs.lstat(r)):"";if(S){let o=a.size??0,i=g?M(o).padStart(5):String(o).padStart(5),t=a.mtime??new Date(0),e=T(t);return{stdout:`-rw-r--r-- 1 user user ${i} ${e} ${n}${f} -`,stderr:"",exitCode:0}}return{stdout:`${n}${f} -`,stderr:"",exitCode:0}}let l=await s.fs.readdir(r);if(p||(l=l.filter(f=>!f.startsWith("."))),v){let f=[];for(let o of l){let i=r==="/"?`/${o}`:`${r}/${o}`;try{let t=await s.fs.stat(i);f.push({name:o,size:t.size??0})}catch{f.push({name:o,size:0})}}f.sort((o,i)=>i.size-o.size),l=f.map(o=>o.name)}else l.sort();c&&(l=[".","..",...l]),b&&l.reverse();let u="";if((y||P)&&(u+=`${n}: -`),S){u+=`total ${l.length} -`;let f=l.filter(e=>e==="."||e===".."),o=l.filter(e=>e!=="."&&e!=="..");for(let e of f)u+=`drwxr-xr-x 1 user user 0 Jan 1 00:00 ${e} -`;let i=[];for(let e=0;e{let z=r==="/"?`/${m}`:`${r}/${m}`;try{let F=await s.fs.stat(z),B=F.isDirectory?"drwxr-xr-x":"-rw-r--r--",J=$?C(await s.fs.lstat(z)):F.isDirectory?"/":"",W=F.size??0,j=g?M(W).padStart(5):String(W).padStart(5),L=F.mtime??new Date(0),N=T(L);return{name:m,line:`${B} 1 user user ${j} ${N} ${m}${J} -`}}catch{return{name:m,line:`-rw-r--r-- 1 user user 0 Jan 1 00:00 ${m} -`}}}));i.push(...h)}let t=new Map(o.map((e,d)=>[e,d]));i.sort((e,d)=>(t.get(e.name)??0)-(t.get(d.name)??0));for(let{line:e}of i)u+=e}else if($){let f=[],o=l.filter(t=>t!=="."&&t!==".."),i=l.filter(t=>t==="."||t==="..");for(let t of i)f.push(`${t}/`);for(let t=0;t{let m=r==="/"?`/${h}`:`${r}/${h}`;try{let z=await s.fs.lstat(m);return`${h}${C(z)}`}catch{return h}}));f.push(...d)}u+=f.join(` -`)+(f.length?` -`:"")}else u+=l.join(` -`)+(l.length?` -`:"");if(y){let f=l.filter(t=>t!=="."&&t!==".."),o=[];if(s.fs.readdirWithFileTypes)o=(await s.fs.readdirWithFileTypes(r)).filter(e=>e.isDirectory&&f.includes(e.name)).map(e=>({name:e.name,isDirectory:!0}));else for(let t=0;t{let m=r==="/"?`/${h}`:`${r}/${h}`;try{let z=await s.fs.stat(m);return{name:h,isDirectory:z.isDirectory}}catch{return{name:h,isDirectory:!1}}}));o.push(...d.filter(h=>h.isDirectory))}o.sort((t,e)=>t.name.localeCompare(e.name)),b&&o.reverse();let i=[];for(let t=0;t{let m=n==="."?`./${h.name}`:`${n}/${h.name}`,z=await O(m,s,c,w,S,y,!1,b,g,v,$,!0);return{name:h.name,result:z}}));i.push(...d)}i.sort((t,e)=>t.name.localeCompare(e.name)),b&&i.reverse();for(let{result:t}of i)u+=` -`,u+=t.stdout}return{stdout:u,stderr:"",exitCode:0}}catch{return{stdout:"",stderr:`ls: ${n}: No such file or directory -`,exitCode:2}}}var q={name:"ls",flags:[{flag:"-a",type:"boolean"},{flag:"-A",type:"boolean"},{flag:"-l",type:"boolean"},{flag:"-h",type:"boolean"},{flag:"-R",type:"boolean"},{flag:"-r",type:"boolean"},{flag:"-S",type:"boolean"},{flag:"-F",type:"boolean"},{flag:"-d",type:"boolean"},{flag:"-t",type:"boolean"},{flag:"-1",type:"boolean"}],needsFiles:!0};export{Z as a,q as b}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-R4QNMLOB.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-R4QNMLOB.js deleted file mode 100644 index 0c76119..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-R4QNMLOB.js +++ /dev/null @@ -1,12 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{c as p}from"./chunk-XEKXHOPO.js";import{a as h,b as w,c as b}from"./chunk-QAYAQNCG.js";var g={name:"fold",summary:"wrap each input line to fit in specified width",usage:"fold [OPTION]... [FILE]...",description:"Wrap input lines in each FILE, writing to standard output. If no FILE is specified, standard input is read.",options:["-w WIDTH Use WIDTH columns instead of 80","-s Break at spaces","-b Count bytes rather than columns"],examples:["fold -w 40 file.txt # Wrap at 40 columns","fold -sw 40 file.txt # Word wrap at 40 columns","echo 'long line' | fold -w 5 # Force wrap at 5"]};function y(s,r,n){return n?new TextEncoder().encode(s).length:s===" "?8-r%8:s==="\b"?-1:1}function N(s,r){if(s.length===0)return s;let{width:n,breakAtSpaces:u,countBytes:i}=r,l=[],e="",t=0,o=-1,f=0;for(let c=0;cn&&e.length>0?u&&o>=0?(l.push(e.slice(0,o+1)),e=e.slice(o+1)+a,t=t-f-1+d,o=-1,f=0):(l.push(e),e=a,t=d,o=-1,f=0):(e+=a,t+=d,(a===" "||a===" ")&&(o=e.length-1,f=t-d))}return e.length>0&&l.push(e),l.join(` -`)}function m(s,r){if(s==="")return"";let n=s.split(` -`),u=s.endsWith(` -`)&&n[n.length-1]==="";return u&&n.pop(),n.map(l=>N(l,r)).join(` -`)+(u?` -`:"")}var I={name:"fold",execute:async(s,r)=>{if(w(s))return h(g);let n={width:80,breakAtSpaces:!1,countBytes:!1},u=[],i=0;for(;i2){let t=parseInt(e.slice(2),10);if(Number.isNaN(t)||t<1)return{exitCode:1,stdout:"",stderr:`fold: invalid number of columns: '${e.slice(2)}' -`};n.width=t,i++}else if(e==="-s")n.breakAtSpaces=!0,i++;else if(e==="-b")n.countBytes=!0,i++;else if(e==="-bs"||e==="-sb")n.breakAtSpaces=!0,n.countBytes=!0,i++;else if(e.match(/^-[sb]+w\d+$/)){e.includes("s")&&(n.breakAtSpaces=!0),e.includes("b")&&(n.countBytes=!0);let t=e.replace(/^-[sb]+w/,""),o=parseInt(t,10);if(Number.isNaN(o)||o<1)return{exitCode:1,stdout:"",stderr:`fold: invalid number of columns: '${t}' -`};n.width=o,i++}else if(e.match(/^-[sb]+w$/)&&i+1t.find(m=>m.type===c)?.value??"",u=new Map([["Sun",0],["Mon",1],["Tue",2],["Wed",3],["Thu",4],["Fri",5],["Sat",6]]),i=n("weekday"),s=(c,m)=>{let y=Number.parseInt(c,10);return Number.isNaN(y)?m:y};return{year:s(n("year"),r.getFullYear()),month:s(n("month"),r.getMonth()+1),day:s(n("day"),r.getDate()),hour:s(n("hour"),r.getHours())%24,minute:s(n("minute"),r.getMinutes()),second:s(n("second"),r.getSeconds()),weekday:u.get(i)??r.getDay()}}catch{return{year:r.getFullYear(),month:r.getMonth()+1,day:r.getDate(),hour:r.getHours(),minute:r.getMinutes(),second:r.getSeconds(),weekday:r.getDay()}}}function S(r,o,a){let e=f(r,a),t=(s,c=2)=>String(s).padStart(c,"0"),n=g(e.year,e.month,e.day),u=d(e.year,e.month,e.day,e.weekday,0),i=d(e.year,e.month,e.day,e.weekday,1);switch(o){case"a":return["Sun","Mon","Tue","Wed","Thu","Fri","Sat"][e.weekday];case"A":return["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][e.weekday];case"b":case"h":return["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.month-1];case"B":return["January","February","March","April","May","June","July","August","September","October","November","December"][e.month-1];case"c":return`${["Sun","Mon","Tue","Wed","Thu","Fri","Sat"][e.weekday]} ${["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.month-1]} ${String(e.day).padStart(2," ")} ${t(e.hour)}:${t(e.minute)}:${t(e.second)} ${e.year}`;case"C":return t(Math.floor(e.year/100));case"d":return t(e.day);case"D":return`${t(e.month)}/${t(e.day)}/${t(e.year%100)}`;case"e":return String(e.day).padStart(2," ");case"F":return`${e.year}-${t(e.month)}-${t(e.day)}`;case"g":return t(h(e.year,e.month,e.day)%100);case"G":return String(h(e.year,e.month,e.day));case"H":return t(e.hour);case"I":return t(e.hour%12||12);case"j":return String(n).padStart(3,"0");case"k":return String(e.hour).padStart(2," ");case"l":return String(e.hour%12||12).padStart(2," ");case"m":return t(e.month);case"M":return t(e.minute);case"n":return` -`;case"N":return"000000000";case"p":return e.hour<12?"AM":"PM";case"P":return e.hour<12?"am":"pm";case"r":return`${t(e.hour%12||12)}:${t(e.minute)}:${t(e.second)} ${e.hour<12?"AM":"PM"}`;case"R":return`${t(e.hour)}:${t(e.minute)}`;case"s":return String(Math.floor(r.getTime()/1e3));case"S":return t(e.second);case"t":return" ";case"T":return`${t(e.hour)}:${t(e.minute)}:${t(e.second)}`;case"u":return String(e.weekday===0?7:e.weekday);case"U":return t(u);case"V":return t($(e.year,e.month,e.day));case"w":return String(e.weekday);case"W":return t(i);case"x":return`${t(e.month)}/${t(e.day)}/${t(e.year%100)}`;case"X":return`${t(e.hour)}:${t(e.minute)}:${t(e.second)}`;case"y":return t(e.year%100);case"Y":return String(e.year);case"z":return l(r,a);case"Z":return p(r,a);case"%":return"%";default:return null}}function l(r,o){if(!o){let u=-r.getTimezoneOffset(),i=u>=0?"+":"-",s=Math.floor(Math.abs(u)/60),c=Math.abs(u)%60;return`${i}${String(s).padStart(2,"0")}${String(c).padStart(2,"0")}`}try{let s=new Intl.DateTimeFormat("en-US",{timeZone:o,timeZoneName:"longOffset"}).formatToParts(r).find(c=>c.type==="timeZoneName");if(s){let c=s.value.match(/GMT([+-])(\d{2}):(\d{2})/);if(c)return`${c[1]}${c[2]}${c[3]}`;if(s.value==="GMT"||s.value==="UTC")return"+0000"}}catch{}let a=-r.getTimezoneOffset(),e=a>=0?"+":"-",t=Math.floor(Math.abs(a)/60),n=Math.abs(a)%60;return`${e}${String(t).padStart(2,"0")}${String(n).padStart(2,"0")}`}function p(r,o){try{return new Intl.DateTimeFormat("en-US",{timeZone:o,timeZoneName:"short"}).formatToParts(r).find(n=>n.type==="timeZoneName")?.value??"UTC"}catch{return"UTC"}}function g(r,o,a){let e=[31,28,31,30,31,30,31,31,30,31,30,31];(r%4===0&&r%100!==0||r%400===0)&&(e[1]=29);let n=a;for(let u=0;u0;case"n":return!1;default:return s}}function h(r,s,i){if(r==="")return{output:"",nextNumber:i};let l=r.split(` -`),t=[],u=i,a=r.endsWith(` -`)&&l[l.length-1]==="";a&&l.pop();for(let n of l)if(v(n,s.bodyStyle)){let e=N(u,s.numberFormat,s.width);t.push(`${e}${s.separator}${n}`),u+=s.increment}else{let e=" ".repeat(s.width);t.push(`${e}${s.separator}${n}`)}return{output:t.join(` -`)+(a?` -`:""),nextNumber:u}}var w={name:"nl",execute:async(r,s)=>{if(c(r))return m(p);let i={bodyStyle:"t",numberFormat:"rn",width:6,separator:" ",startNumber:1,increment:1},l=[],t=0;for(;t{if(c(r))return a(u);let o=[];for(let e of r)if(e==="--"){let t=r.indexOf(e);o.push(...r.slice(t+1));break}else{if(e.startsWith("-")&&e!=="-")return d("rev",e);o.push(e)}let n="",l=e=>{let t=e.split(` -`),i=e.endsWith(` -`)&&t[t.length-1]==="";return i&&t.pop(),t.map(p).join(` -`)+(i?` -`:"")};if(o.length===0){let e=f(s.stdin)??"";n=l(e)}else for(let e of o)if(e==="-"){let t=f(s.stdin)??"";n+=l(t)}else{let t=s.fs.resolvePath(s.cwd,e),i=await s.fs.readFile(t);if(i===null)return{exitCode:1,stdout:n,stderr:`rev: ${e}: No such file or directory -`};n+=l(i)}return{exitCode:0,stdout:n,stderr:""}}},y={name:"rev",flags:[],stdinType:"text",needsFiles:!0};export{g as a,y as b}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-SAI2SPQQ.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-SAI2SPQQ.js deleted file mode 100644 index 2c356e0..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-SAI2SPQQ.js +++ /dev/null @@ -1,8 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -var n=class extends Error{stdout;stderr;constructor(t,s="",e=""){super(t),this.stdout=s,this.stderr=e}prependOutput(t,s){this.stdout=t+this.stdout,this.stderr=s+this.stderr}},c=class extends n{levels;name="BreakError";constructor(t=1,s="",e=""){super("break",s,e),this.levels=t}},a=class extends n{levels;name="ContinueError";constructor(t=1,s="",e=""){super("continue",s,e),this.levels=t}},i=class extends n{exitCode;name="ReturnError";constructor(t=0,s="",e=""){super("return",s,e),this.exitCode=t}},u=class extends n{exitCode;name="ErrexitError";constructor(t,s="",e=""){super(`errexit: command exited with status ${t}`,s,e),this.exitCode=t}},x=class extends n{varName;name="NounsetError";constructor(t,s=""){super(`${t}: unbound variable`,s,`bash: ${t}: unbound variable -`),this.varName=t}},d=class extends n{exitCode;name="ExitError";constructor(t,s="",e=""){super("exit",s,e),this.exitCode=t}},p=class extends n{name="ArithmeticError";fatal;constructor(t,s="",e="",o=!1){super(t,s,e),this.stderr=e||`bash: ${t} -`,this.fatal=o}},l=class extends n{name="BadSubstitutionError";constructor(t,s="",e=""){super(t,s,e),this.stderr=e||`bash: ${t}: bad substitution -`}},h=class extends n{name="GlobError";constructor(t,s="",e=""){super(`no match: ${t}`,s,e),this.stderr=e||`bash: no match: ${t} -`}},m=class extends n{name="BraceExpansionError";constructor(t,s="",e=""){super(t,s,e),this.stderr=e||`bash: ${t} -`}},b=class extends n{limitType;name="ExecutionLimitError";static EXIT_CODE=126;constructor(t,s,e="",o=""){super(t,e,o),this.limitType=s,this.stderr=o||`bash: ${t} -`}},$=class extends n{name="ExecutionAbortedError";constructor(t="",s=""){super("execution aborted",t,s)}},f=class extends n{name="SubshellExitError";constructor(t="",s=""){super("subshell exit",t,s)}};function v(r){return r instanceof c||r instanceof a||r instanceof i}var C=class extends n{exitCode;name="PosixFatalError";constructor(t,s="",e=""){super("posix fatal error",s,e),this.exitCode=t}};export{c as a,a as b,i as c,u as d,x as e,d as f,p as g,l as h,h as i,m as j,b as k,$ as l,f as m,v as n,C as o}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-SBBYKIYU.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-SBBYKIYU.js deleted file mode 100644 index 5b126f2..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-SBBYKIYU.js +++ /dev/null @@ -1,3 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -async function t(e,n){return{stdout:`localhost -`,stderr:"",exitCode:0}}var o={name:"hostname",execute:t},s={name:"hostname",flags:[]};export{o as a,s as b}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-SETW5JBN.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-SETW5JBN.js deleted file mode 100644 index 07cfec8..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-SETW5JBN.js +++ /dev/null @@ -1,9 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a as i}from"./chunk-TDD4NFYE.js";import{a as u}from"./chunk-QIQMJJZ4.js";import{a as g,b as m}from"./chunk-QAYAQNCG.js";var S={name:"stat",summary:"display file or file system status",usage:"stat [OPTION]... FILE...",options:["-c FORMAT use the specified FORMAT instead of the default"," --help display this help and exit"]},$={format:{short:"c",type:"string"}},A={name:"stat",async execute(n,a){if(m(n))return g(S);let o=u("stat",n,$);if(!o.ok)return o.error;let c=o.result.flags.format??null,f=o.result.positional;if(f.length===0)return{stdout:"",stderr:`stat: missing operand -`,exitCode:1};let r="",p="",d=!1;for(let s of f){let h=a.fs.resolvePath(a.cwd,s);try{let e=await a.fs.stat(h);if(c){let t=c,l=e.mode.toString(8),y=i(e.mode,e.isDirectory);t=t.replace(/%n/g,s),t=t.replace(/%N/g,`'${s}'`),t=t.replace(/%s/g,String(e.size)),t=t.replace(/%F/g,e.isDirectory?"directory":"regular file"),t=t.replace(/%a/g,l),t=t.replace(/%A/g,y),t=t.replace(/%u/g,"1000"),t=t.replace(/%U/g,"user"),t=t.replace(/%g/g,"1000"),t=t.replace(/%G/g,"group"),r+=`${t} -`}else{let t=e.mode.toString(8).padStart(4,"0"),l=i(e.mode,e.isDirectory);r+=` File: ${s} -`,r+=` Size: ${e.size} Blocks: ${Math.ceil(e.size/512)} -`,r+=`Access: (${t}/${l}) -`,r+=`Modify: ${e.mtime.toISOString()} -`}}catch{p+=`stat: cannot stat '${s}': No such file or directory -`,d=!0}}return{stdout:r,stderr:p,exitCode:d?1:0}}},M={name:"stat",flags:[{flag:"-c",type:"value",valueHint:"format"},{flag:"-L",type:"boolean"}],needsArgs:!0};export{A as a,M as b}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-SHKOQWO4.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-SHKOQWO4.js deleted file mode 100644 index 5d77daa..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-SHKOQWO4.js +++ /dev/null @@ -1,3 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -var o={name:"pwd",async execute(l,a){let t=!1;for(let e of l)if(e==="-P")t=!0;else if(e==="-L")t=!1;else{if(e==="--")break;e.startsWith("-")}let s=a.cwd;if(t)try{s=await a.fs.realpath(a.cwd)}catch{}return{stdout:`${s} -`,stderr:"",exitCode:0}}},f={name:"pwd",flags:[{flag:"-P",type:"boolean"},{flag:"-L",type:"boolean"}]};export{o as a,f as b}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-SJYEXC2Z.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-SJYEXC2Z.js deleted file mode 100644 index f0916c0..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-SJYEXC2Z.js +++ /dev/null @@ -1,14 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a as p}from"./chunk-QIQMJJZ4.js";import{a as g}from"./chunk-W5DWRFSU.js";var x=`Usage: rmdir [-pv] DIRECTORY... -Remove empty directories. - -Options: - -p, --parents Remove DIRECTORY and its ancestors - -v, --verbose Output a diagnostic for every directory processed`,y={parents:{short:"p",long:"parents",type:"boolean"},verbose:{short:"v",long:"verbose",type:"boolean"},help:{long:"help",type:"boolean"}},D={name:"rmdir",async execute(t,r){let e=p("rmdir",t,y);if(!e.ok)return e.error;if(e.result.flags.help)return{stdout:`${x} -`,stderr:"",exitCode:0};let a=e.result.flags.parents,o=e.result.flags.verbose,s=e.result.positional;if(s.length===0)return{stdout:"",stderr:`rmdir: missing operand -`,exitCode:1};let c="",n="",i=0;for(let u of s){let d=await b(r,u,a,o);c+=d.stdout,n+=d.stderr,d.exitCode!==0&&(i=d.exitCode)}return{stdout:c,stderr:n,exitCode:i}}};async function b(t,r,e,a){let o="",s="",n=t.fs.resolvePath(t.cwd,r),i=await v(t,n,r,a);if(o+=i.stdout,s+=i.stderr,i.exitCode!==0)return{stdout:o,stderr:s,exitCode:i.exitCode};if(e){let u=n,d=r;for(;;){let l=C(u),f=C(d);if(l===u||l==="/"||l==="."||f==="."||f==="")break;let m=await v(t,l,f,a);if(o+=m.stdout,m.exitCode!==0)break;u=l,d=f}}return{stdout:o,stderr:s,exitCode:0}}async function v(t,r,e,a){try{if(!await t.fs.exists(r))return{stdout:"",stderr:`rmdir: failed to remove '${e}': No such file or directory -`,exitCode:1};if(!(await t.fs.stat(r)).isDirectory)return{stdout:"",stderr:`rmdir: failed to remove '${e}': Not a directory -`,exitCode:1};if((await t.fs.readdir(r)).length>0)return{stdout:"",stderr:`rmdir: failed to remove '${e}': Directory not empty -`,exitCode:1};await t.fs.rm(r,{recursive:!1,force:!1});let n="";return a&&(n=`rmdir: removing directory, '${e}' -`),{stdout:n,stderr:"",exitCode:0}}catch(o){let s=g(o);return{stdout:"",stderr:`rmdir: failed to remove '${e}': ${s} -`,exitCode:1}}}function C(t){let r=t.replace(/\/+$/,""),e=r.lastIndexOf("/");return e===-1?".":e===0?"/":r.substring(0,e)}var $={name:"rmdir",flags:[{flag:"-p",type:"boolean"},{flag:"-v",type:"boolean"}],needsArgs:!0};export{D as a,$ as b}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-STHBFACM.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-STHBFACM.js deleted file mode 100644 index b099915..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-STHBFACM.js +++ /dev/null @@ -1 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-SX2HC7SO.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-SX2HC7SO.js deleted file mode 100644 index d8b27dc..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-SX2HC7SO.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -function n(e){let r=e.match(/^(\d+\.?\d*)(s|m|h|d)?$/);if(!r)return null;let t=parseFloat(r[1]);switch(r[2]||"s"){case"s":return t*1e3;case"m":return t*60*1e3;case"h":return t*60*60*1e3;case"d":return t*24*60*60*1e3;default:return null}}export{n as a}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-SY4HAUHP.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-SY4HAUHP.js deleted file mode 100644 index c586e7e..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-SY4HAUHP.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{b as e}from"./chunk-VACKIICN.js";var i=globalThis.setTimeout.bind(globalThis),r=globalThis.clearTimeout.bind(globalThis),s=globalThis.setInterval.bind(globalThis),T=globalThis.clearInterval.bind(globalThis);function l(t){return typeof t!="function"?t:e.bindCurrentContext(t)}var b=((t,n,...o)=>i(l(t),n,...o)),u=r;export{b as a,u as b}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-TA74ENH7.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-TA74ENH7.js deleted file mode 100644 index 882a267..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-TA74ENH7.js +++ /dev/null @@ -1,14 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{c as j,d as y}from"./chunk-XEKXHOPO.js";import{a as g,b as v,c as F}from"./chunk-QAYAQNCG.js";var N={name:"join",summary:"join lines of two files on a common field",usage:"join [OPTION]... FILE1 FILE2",description:"For each pair of input lines with identical join fields, write a line to standard output. The default join field is the first, delimited by blanks.",options:["-1 FIELD Join on this FIELD of file 1 (default: 1)","-2 FIELD Join on this FIELD of file 2 (default: 1)","-t CHAR Use CHAR as input and output field separator","-a FILENUM Also print unpairable lines from file FILENUM (1 or 2)","-v FILENUM Like -a but only output unpairable lines","-e STRING Replace missing fields with STRING","-o FORMAT Output format (comma-separated list of FILENUM.FIELD)","-i Ignore case when comparing fields"],examples:["join file1 file2 # Join on first field","join -1 2 -2 1 file1 file2 # Join file1 col 2 with file2 col 1","join -t ',' file1.csv file2.csv # Join CSV files","join -a 1 file1 file2 # Left outer join"]};function I(i,s){return s?i.split(s):i.split(/[ \t]+/).filter(n=>n.length>0)}function L(i,s,n,f){let e=I(i,s),r=e[n-1]??"";return f&&(r=r.toLowerCase()),{fields:e,joinKey:r,original:i}}function m(i,s,n){let f=n.separator??" ";if(n.outputFormat){let l=[];for(let{file:c,field:p}of n.outputFormat){let a=c===1?i:s;a&&p===0?l.push(a.joinKey):a&&a.fields[p-1]!==void 0?l.push(a.fields[p-1]):l.push(n.emptyString)}return l.join(f)}let e=[],r=i?.joinKey??s?.joinKey??"";if(e.push(r),i)for(let l=0;l{if(v(i))return g(N);let n={field1:1,field2:1,separator:null,printUnpairable:new Set,onlyUnpairable:new Set,emptyString:"",outputFormat:null,ignoreCase:!1},f=[],e=0;for(;e2)n.separator=t.slice(2),e++;else if(t==="-a"&&e+1{let u=t.split(` -`);return t.endsWith(` -`)&&u[u.length-1]===""&&u.pop(),u.filter(h=>h.length>0).map(h=>L(h,n.separator,o,n.ignoreCase))},c=l(r[0],n.field1),p=l(r[1],n.field2),a=new Map;for(let t of p){let o=a.get(t.joinKey);o?o.push(t):a.set(t.joinKey,[t])}let d=[],b=new Set;for(let t of c){let o=a.get(t.joinKey);if(o&&o.length>0){if(b.add(t.joinKey),n.onlyUnpairable.size===0)for(let u of o)d.push(m(t,u,n))}else(n.printUnpairable.has(1)||n.onlyUnpairable.has(1))&&d.push(m(t,null,n))}if(n.printUnpairable.has(2)||n.onlyUnpairable.has(2))for(let t of p)b.has(t.joinKey)||d.push(m(null,t,n));return{exitCode:0,stdout:y(d.length>0?`${d.join(` -`)} -`:""),stderr:"",stdoutEncoding:"binary"}}},H={name:"join",flags:[{flag:"-1",type:"value",valueHint:"number"},{flag:"-2",type:"value",valueHint:"number"},{flag:"-t",type:"value",valueHint:"delimiter"},{flag:"-a",type:"value",valueHint:"number"},{flag:"-v",type:"value",valueHint:"number"},{flag:"-e",type:"value",valueHint:"string"},{flag:"-o",type:"value",valueHint:"format"},{flag:"-i",type:"boolean"}],needsArgs:!0,minArgs:2};export{E as a,H as b}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-TC2WHAIS.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-TC2WHAIS.js deleted file mode 100644 index 8678e22..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-TC2WHAIS.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a as n,b as i,c as r}from"./chunk-PDUL32DM.js";import{a,b as s}from"./chunk-QAYAQNCG.js";var f={name:"head",summary:"output the first part of files",usage:"head [OPTION]... [FILE]...",options:["-c, --bytes=NUM print the first NUM bytes","-n, --lines=NUM print the first NUM lines (default 10)","-q, --quiet never print headers giving file names","-v, --verbose always print headers giving file names"," --help display this help and exit"]},m={name:"head",async execute(t,l){if(s(t))return a(f);let e=n(t,"head");if(!e.ok)return e.error;let{lines:o,bytes:p}=e.options;return i(l,e.options,"head",d=>r(d,o,p))}},g={name:"head",flags:[{flag:"-n",type:"value",valueHint:"number"},{flag:"-c",type:"value",valueHint:"number"},{flag:"-q",type:"boolean"},{flag:"-v",type:"boolean"}],stdinType:"text",needsFiles:!0};export{m as a,g as b}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-TDD4NFYE.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-TDD4NFYE.js deleted file mode 100644 index 331ff83..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-TDD4NFYE.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -function x(r,o){let t=o?"d":"-",n=[r&256?"r":"-",r&128?"w":"-",r&64?"x":"-",r&32?"r":"-",r&16?"w":"-",r&8?"x":"-",r&4?"r":"-",r&2?"w":"-",r&1?"x":"-"];return t+n.join("")}export{x as a}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-UIJUTQPH.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-UIJUTQPH.js deleted file mode 100644 index b379a14..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-UIJUTQPH.js +++ /dev/null @@ -1,3 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a as i,b as l}from"./chunk-QAYAQNCG.js";var p={name:"history",summary:"display command history",usage:"history [n]",options:["-c clear the history list"," --help display this help and exit"]},h="BASH_HISTORY",m={name:"history",async execute(e,s){if(l(e))return i(p);let a=s.env.get(h)||"[]",t;try{t=JSON.parse(a)}catch{t=[]}if(e[0]==="-c")return s.env.set(h,"[]"),{stdout:"",stderr:"",exitCode:0};let n=t.length;e[0]&&/^\d+$/.test(e[0])&&(n=Math.min(parseInt(e[0],10),t.length));let c=t.length-n,r="";for(let o=c;o{}).constructor;e&&e!==Function&&a.push({prop:"constructor",target:Object.getPrototypeOf(async()=>{}),violationType:"async_function_constructor",strategy:"throw",reason:"AsyncFunction constructor allows arbitrary async code execution"})}catch{}try{let e=Object.getPrototypeOf(function*(){}).constructor;e&&e!==Function&&a.push({prop:"constructor",target:Object.getPrototypeOf(function*(){}),violationType:"generator_function_constructor",strategy:"throw",reason:"GeneratorFunction constructor allows arbitrary generator code execution"})}catch{}try{let e=Object.getPrototypeOf(async function*(){}).constructor;e&&e!==Function&&e!==Object.getPrototypeOf(async()=>{}).constructor&&a.push({prop:"constructor",target:Object.getPrototypeOf(async function*(){}),violationType:"async_generator_function_constructor",strategy:"throw",reason:"AsyncGeneratorFunction constructor allows arbitrary async generator code execution"})}catch{}return a.filter(e=>{try{return e.target[e.prop]!==void 0}catch{return!1}})}var g=typeof __BROWSER__<"u"&&__BROWSER__;function w(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,a=>{let e=Math.random()*16|0;return(a==="x"?e:e&3|8).toString(16)})}var x=null;if(!g)try{let{AsyncLocalStorage:a}=f("node:async_hooks");x=a}catch{}var k=` - -This is a defense-in-depth measure and indicates a bug in just-bash. Please report this at security@vercel.com`,d=class extends Error{violation;constructor(e,t){super(e+k),this.violation=t,this.name="SecurityViolationError"}},u=!g&&x?new x:null,T=1e3;function D(a,e,...t){return u.run(a,()=>e(...t))}var m={enabled:!0,auditMode:!1};function E(a){return a===void 0?{...m,enabled:!1}:typeof a=="boolean"?{...m,enabled:a}:{...m,...a}}var _=class a{static instance=null;static importHooksRegistered=!1;static trustedExecutionDepth=new Map;config;refCount=0;patchFailures=[];activeExecutionIds=new Set;contextCache=new Map;originalDescriptors=[];violations=[];activationTime=0;totalActiveTimeMs=0;constructor(e){this.config=e}static getInstance(e){let t=E(e);if(!a.instance)a.instance=new a(t);else{let r=a.instance.config;if(t.enabled!==r.enabled||t.auditMode!==r.auditMode)throw new Error(`DefenseInDepthBox config conflict: requested {enabled: ${t.enabled}, auditMode: ${t.auditMode}} but singleton already has {enabled: ${r.enabled}, auditMode: ${r.auditMode}}. All Bash instances must use the same defense-in-depth security settings, or call DefenseInDepthBox.resetInstance() between incompatible configurations.`)}return a.instance}static resetInstance(){a.instance&&(a.instance.forceDeactivate(),a.instance=null),a.trustedExecutionDepth.clear()}static isInSandboxedContext(){return u?u?.getStore()?.sandboxActive===!0:!1}static getCurrentExecutionId(){if(u)return u?.getStore()?.executionId}static enterTrustedScope(e){let t=a.trustedExecutionDepth.get(e)??0;a.trustedExecutionDepth.set(e,t+1)}static leaveTrustedScope(e){let t=a.trustedExecutionDepth.get(e);if(t){if(t===1){a.trustedExecutionDepth.delete(e);return}a.trustedExecutionDepth.set(e,t-1)}}static isTrustedScopeActive(e){return e?(a.trustedExecutionDepth.get(e)??0)>0:!1}isExecutionIdActive(e){return this.activeExecutionIds.has(e)}getCachedContext(e){let t=this.contextCache.get(e);return t||(t={sandboxActive:!0,executionId:e},this.contextCache.set(e,t)),t}getPreferredActiveExecutionId(){if(this.activeExecutionIds.size!==0)for(let e of this.activeExecutionIds)return e}static bindCurrentContext(e){if(!u)return e;let t=a.instance,r=u.getStore(),s=r?.sandboxActive===!0?r.executionId:t?.getPreferredActiveExecutionId();if(!s)return e;let n=t?.getCachedContext(s)??{sandboxActive:!0,executionId:s};return((...o)=>{let i=a.instance;if(!(i&&!i.isExecutionIdActive(s)&&(i.recordViolation("bound_callback_after_deactivate","bound callback","Bound callback blocked after originating execution was deactivated"),!i.config.auditMode)))return D(n,e,...o)})}isEnabled(){return this.config.enabled===!0&&u!==null&&!g}updateConfig(e){this.config={...this.config,...e}}activate(){if(g||!this.config.enabled||!u){let r=w(),s=!1;return{run:n=>s?Promise.reject(new Error("DefenseInDepthBox handle is deactivated and cannot run new work")):n(),deactivate:()=>{s=!0},executionId:r}}this.refCount++,this.refCount===1&&(this.applyPatches(),this.activationTime=Date.now());let e=w(),t=!1;return{run:r=>t?Promise.reject(new Error("DefenseInDepthBox handle is deactivated and cannot run new work")):(this.activeExecutionIds.add(e),u.run({sandboxActive:!0,executionId:e},r)),deactivate:()=>{t||(t=!0,this.activeExecutionIds.delete(e),this.contextCache.delete(e),this.refCount--,this.refCount===0&&(this.restorePatches(),this.totalActiveTimeMs+=Date.now()-this.activationTime),this.refCount<0&&(this.refCount=0))},executionId:e}}forceDeactivate(){this.refCount>0&&(this.restorePatches(),this.totalActiveTimeMs+=Date.now()-this.activationTime),this.activeExecutionIds.clear(),this.contextCache.clear(),this.refCount=0}isActive(){return this.refCount>0}getStats(){return{violationsBlocked:this.violations.length,violations:[...this.violations],activeTimeMs:this.totalActiveTimeMs+(this.refCount>0?Date.now()-this.activationTime:0),refCount:this.refCount}}getPatchFailures(){return[...this.patchFailures]}clearViolations(){this.violations=[]}getPathForTarget(e,t){return e===globalThis?`globalThis.${t}`:e===process?`process.${t}`:e===Error?`Error.${t}`:e===Function.prototype?`Function.prototype.${t}`:e===Object.prototype?`Object.prototype.${t}`:`.${t}`}static runTrusted(e){if(!u)return e();let t=u.getStore();if(!t)return e();let{executionId:r}=t;return u.run({...t,trusted:!0},()=>{a.enterTrustedScope(r);try{let s=e();return typeof s=="object"&&s!==null&&"finally"in s&&typeof s.finally=="function"?s.finally(()=>{a.leaveTrustedScope(r)}):(a.leaveTrustedScope(r),s)}catch(s){throw a.leaveTrustedScope(r),s}})}static async runTrustedAsync(e){if(!u)return e();let t=u.getStore();if(!t)return e();let{executionId:r}=t;return u.run({...t,trusted:!0},async()=>{a.enterTrustedScope(r);try{return await e()}finally{a.leaveTrustedScope(r)}})}shouldBlock(){if(g||this.config.auditMode||!u)return!1;let e=u?.getStore();return!(e?.sandboxActive!==!0||e.trusted||a.isTrustedScopeActive(e.executionId))}recordViolation(e,t,r){let s={timestamp:Date.now(),type:e,message:r,path:t,stack:new Error().stack,executionId:u?.getStore()?.executionId};if(this.violations.lengthr.includes(n));if(s.length>0)throw this.restorePatches(),new Error(`DefenseInDepthBox: critical patches failed: ${s.join(", ")}`)}protectConstructorChain(){this.patchPrototypeConstructor(Function.prototype,"Function.prototype.constructor","function_constructor");try{let e=Object.getPrototypeOf(async()=>{}).constructor;e&&e!==Function&&this.patchPrototypeConstructor(e.prototype,"AsyncFunction.prototype.constructor","async_function_constructor")}catch(e){this.patchFailures.push("AsyncFunction.prototype.constructor"),console.debug("[DefenseInDepthBox] Could not patch AsyncFunction.prototype.constructor:",e instanceof Error?e.message:e)}try{let e=Object.getPrototypeOf(function*(){}).constructor;e&&e!==Function&&this.patchPrototypeConstructor(e.prototype,"GeneratorFunction.prototype.constructor","generator_function_constructor")}catch(e){this.patchFailures.push("GeneratorFunction.prototype.constructor"),console.debug("[DefenseInDepthBox] Could not patch GeneratorFunction.prototype.constructor:",e instanceof Error?e.message:e)}try{let e=Object.getPrototypeOf(async function*(){}).constructor,t=Object.getPrototypeOf(async()=>{}).constructor;e&&e!==Function&&e!==t&&this.patchPrototypeConstructor(e.prototype,"AsyncGeneratorFunction.prototype.constructor","async_generator_function_constructor")}catch(e){this.patchFailures.push("AsyncGeneratorFunction.prototype.constructor"),console.debug("[DefenseInDepthBox] Could not patch AsyncGeneratorFunction.prototype.constructor:",e instanceof Error?e.message:e)}}protectErrorPrepareStackTrace(){let e=this;try{let t=Object.getOwnPropertyDescriptor(Error,"prepareStackTrace");this.originalDescriptors.push({target:Error,prop:"prepareStackTrace",descriptor:t});let r=t?.value;Object.defineProperty(Error,"prepareStackTrace",{get(){return r},set(s){if(e.shouldBlock()){let n="Error.prepareStackTrace modification is blocked during script execution",o=e.recordViolation("error_prepare_stack_trace","Error.prepareStackTrace",n);throw new d(n,o)}e.config.auditMode&&u?.getStore()?.sandboxActive===!0&&e.recordViolation("error_prepare_stack_trace","Error.prepareStackTrace","Error.prepareStackTrace set (audit mode)"),r=s},configurable:!0})}catch(t){this.patchFailures.push("Error.prepareStackTrace"),console.debug("[DefenseInDepthBox] Could not protect Error.prepareStackTrace:",t instanceof Error?t.message:t)}}protectPromiseThen(){let e=this;try{let n=function(...o){return u.run(this.captured,()=>{if(!this.box.isExecutionIdActive(this.executionId)){if(this.box.recordViolation("promise_then_after_deactivate","Promise.then","Promise.then callback is blocked after defense deactivation"),this.box.config.auditMode)return Reflect.apply(this.cb,void 0,o);if(this.kind==="fulfilled")return o[0];throw o[0]}return Reflect.apply(this.cb,void 0,o)})};var t=n;let r=Object.getOwnPropertyDescriptor(Promise.prototype,"then");this.originalDescriptors.push({target:Promise.prototype,prop:"then",descriptor:r});let s=r?.value;if(typeof s!="function")return;Object.defineProperty(Promise.prototype,"then",{value:function(i,c){if(!u)return Reflect.apply(s,this,[i,c]);let l=u.getStore(),p=l?.sandboxActive===!0&&l.trusted!==!0?l.executionId:void 0;if(!p)return Reflect.apply(s,this,[i,c]);let h=e.getCachedContext(p),y=(b,P)=>typeof b!="function"?b:n.bind({box:e,executionId:p,captured:h,cb:b,kind:P});return Reflect.apply(s,this,[y(i,"fulfilled"),y(c,"rejected")])},writable:!0,configurable:!0})}catch(r){this.patchFailures.push("Promise.prototype.then"),console.debug("[DefenseInDepthBox] Could not protect Promise.prototype.then:",r instanceof Error?r.message:r)}}patchPrototypeConstructor(e,t,r){let s=this;try{let n=Object.getOwnPropertyDescriptor(e,"constructor");this.originalDescriptors.push({target:e,prop:"constructor",descriptor:n});let o=n?.value;Object.defineProperty(e,"constructor",{get(){if(s.shouldBlock()){let i=`${t} access is blocked during script execution`,c=s.recordViolation(r,t,i);throw new d(i,c)}return s.config.auditMode&&u?.getStore()?.sandboxActive===!0&&s.recordViolation(r,t,`${t} accessed (audit mode)`),o},set(i){if(s.shouldBlock()){let c=`${t} modification is blocked during script execution`,l=s.recordViolation(r,t,c);throw new d(c,l)}Object.defineProperty(this,"constructor",{value:i,writable:!0,configurable:!0})},configurable:!0})}catch(n){this.patchFailures.push(t),console.debug(`[DefenseInDepthBox] Could not patch ${t}:`,n instanceof Error?n.message:n)}}protectProcessMainModule(){if(typeof process>"u")return;let e=this;try{let t=Object.getOwnPropertyDescriptor(process,"mainModule");this.originalDescriptors.push({target:process,prop:"mainModule",descriptor:t});let r=t?.value;r!==void 0&&Object.defineProperty(process,"mainModule",{get(){if(e.shouldBlock()){let s="process.mainModule access is blocked during script execution",n=e.recordViolation("process_main_module","process.mainModule",s);throw new d(s,n)}return e.config.auditMode&&u?.getStore()?.sandboxActive===!0&&e.recordViolation("process_main_module","process.mainModule","process.mainModule accessed (audit mode)"),r},set(s){if(e.shouldBlock()){let n="process.mainModule modification is blocked during script execution",o=e.recordViolation("process_main_module","process.mainModule",n);throw new d(n,o)}Object.defineProperty(process,"mainModule",{value:s,writable:!0,configurable:!0})},configurable:!0})}catch(t){this.patchFailures.push("process.mainModule"),console.debug("[DefenseInDepthBox] Could not protect process.mainModule:",t instanceof Error?t.message:t)}}protectProcessExecPath(){if(typeof process>"u")return;let e=this;try{let t=Object.getOwnPropertyDescriptor(process,"execPath");this.originalDescriptors.push({target:process,prop:"execPath",descriptor:t});let r=t?.value??process.execPath;Object.defineProperty(process,"execPath",{get(){if(e.shouldBlock()){let s="process.execPath access is blocked during script execution",n=e.recordViolation("process_exec_path","process.execPath",s);throw new d(s,n)}return e.config.auditMode&&u?.getStore()?.sandboxActive===!0&&e.recordViolation("process_exec_path","process.execPath","process.execPath accessed (audit mode)"),r},set(s){if(e.shouldBlock()){let n="process.execPath modification is blocked during script execution",o=e.recordViolation("process_exec_path","process.execPath",n);throw new d(n,o)}Object.defineProperty(process,"execPath",{value:s,writable:!0,configurable:!0})},configurable:!0})}catch(t){this.patchFailures.push("process.execPath"),console.debug("[DefenseInDepthBox] Could not protect process.execPath:",t instanceof Error?t.message:t)}}lockWellKnownSymbols(){let e=(t,r)=>{try{let s=Object.getOwnPropertyDescriptor(t,r);if(s?.configurable){if("value"in s){Object.defineProperty(t,r,{...s,configurable:!1,writable:!1});return}Object.defineProperty(t,r,{...s,configurable:!1})}}catch{}};for(let t of[Array,Map,Set,RegExp,Promise])e(t,Symbol.species);for(let t of[Array.prototype,String.prototype,Map.prototype,Set.prototype])e(t,Symbol.iterator);e(Symbol.prototype,Symbol.toPrimitive),e(Date.prototype,Symbol.toPrimitive);for(let t of[Symbol.match,Symbol.matchAll,Symbol.replace,Symbol.search,Symbol.split])e(RegExp.prototype,t);e(Function.prototype,Symbol.hasInstance),e(Array.prototype,Symbol.unscopables);for(let t of[Map.prototype,Set.prototype,Promise.prototype,ArrayBuffer.prototype])e(t,Symbol.toStringTag);try{let t=Object.getOwnPropertyDescriptor(Error,"stackTraceLimit");this.originalDescriptors.push({target:Error,prop:"stackTraceLimit",descriptor:t}),Object.defineProperty(Error,"stackTraceLimit",{value:Error.stackTraceLimit,writable:!1,configurable:!0})}catch{}}protectProxyRevocable(){let e=this;try{let t=Proxy.revocable;if(typeof t!="function")return;let r=Object.getOwnPropertyDescriptor(Proxy,"revocable");this.originalDescriptors.push({target:Proxy,prop:"revocable",descriptor:r}),Object.defineProperty(Proxy,"revocable",{value:function(n,o){if(e.shouldBlock()){let i="Proxy.revocable is blocked during script execution",c=e.recordViolation("proxy","Proxy.revocable",i);throw new d(i,c)}return e.config.auditMode&&u?.getStore()?.sandboxActive===!0&&e.recordViolation("proxy","Proxy.revocable","Proxy.revocable called (audit mode)"),t(n,o)},writable:!1,configurable:!0})}catch(t){this.patchFailures.push("Proxy.revocable"),console.debug("[DefenseInDepthBox] Could not protect Proxy.revocable:",t instanceof Error?t.message:t)}}protectDynamicImport(){if(!(g||a.importHooksRegistered))try{let e=this,t=f("node:module"),r=new Set;for(let o of t.builtinModules??[]){let i=o.startsWith("node:")?o.slice(5):o;r.add(i);let c=i.indexOf("/");c>0&&r.add(i.slice(0,c))}let s=o=>{if(o.startsWith("./")||o.startsWith("../")||o.startsWith("/")||o.startsWith("file:")||o.startsWith("data:")||o.startsWith("blob:")||o.startsWith("http:")||o.startsWith("https:"))return!1;let i=o.startsWith("node:")?o.slice(5):o;if(!i)return!1;if(typeof t.isBuiltin=="function"&&t.isBuiltin(i)||r.has(i))return!0;let c=i.indexOf("/");return c>0&&r.has(i.slice(0,c))},n=()=>{let o=u?.getStore();return e.config.auditMode===!0&&o?.sandboxActive===!0&&o.trusted!==!0&&!a.isTrustedScopeActive(o.executionId)};if(typeof t.registerHooks=="function"){t.registerHooks({resolve(o,i,c){if(o.startsWith("data:")||o.startsWith("blob:"))throw new Error(`dynamic import of ${o.startsWith("data:")?"data:":"blob:"} URLs is blocked by defense-in-depth`);if(s(o)){let l=`import(${o})`,p=`dynamic import of Node.js builtin '${o}' is blocked during script execution`;if(e.shouldBlock()){let h=e.recordViolation("dynamic_import_builtin",l,p);throw new d(p,h)}n()&&e.recordViolation("dynamic_import_builtin",l,`dynamic import of Node.js builtin '${o}' called (audit mode)`)}return c(o,i)}}),a.importHooksRegistered=!0;return}if(typeof t.register=="function"){let o=["export async function resolve(specifier, context, nextResolve) {",' if (specifier.startsWith("data:") || specifier.startsWith("blob:")) {',' throw new Error("dynamic import of " + (specifier.startsWith("data:") ? "data:" : "blob:") + " URLs is blocked by defense-in-depth");'," }"," return nextResolve(specifier, context);","}"].join(` -`);t.register(`data:text/javascript,${encodeURIComponent(o)}`),a.importHooksRegistered=!0}}catch(e){console.debug("[DefenseInDepthBox] Could not register import() hooks:",e instanceof Error?e.message:e)}}protectModuleLoad(){if(!g)try{let e=null;if(typeof process<"u"){let o=process.mainModule;o&&typeof o=="object"&&(e=o.constructor)}if(!e&&typeof f<"u"&&typeof f.main<"u"&&(e=f.main.constructor),!e||typeof e._load!="function")return;let t=e._load,r=Object.getOwnPropertyDescriptor(e,"_load");this.originalDescriptors.push({target:e,prop:"_load",descriptor:r});let n=this.createBlockingProxy(t,"Module._load","module_load");Object.defineProperty(e,"_load",{value:n,writable:!0,configurable:!0})}catch(e){this.patchFailures.push("Module._load"),console.debug("[DefenseInDepthBox] Could not protect Module._load:",e instanceof Error?e.message:e)}}protectModuleResolveFilename(){if(!g)try{let e=null;if(typeof process<"u"){let o=process.mainModule;o&&typeof o=="object"&&(e=o.constructor)}if(!e&&typeof f<"u"&&typeof f.main<"u"&&(e=f.main.constructor),!e||typeof e._resolveFilename!="function")return;let t=e._resolveFilename,r=Object.getOwnPropertyDescriptor(e,"_resolveFilename");this.originalDescriptors.push({target:e,prop:"_resolveFilename",descriptor:r});let n=this.createBlockingProxy(t,"Module._resolveFilename","module_resolve_filename");Object.defineProperty(e,"_resolveFilename",{value:n,writable:!0,configurable:!0})}catch(e){this.patchFailures.push("Module._resolveFilename"),console.debug("[DefenseInDepthBox] Could not protect Module._resolveFilename:",e instanceof Error?e.message:e)}}applyPatch(e){let{target:t,prop:r,violationType:s,strategy:n}=e;try{let o=t[r];if(o===void 0)return;let i=Object.getOwnPropertyDescriptor(t,r);if(this.originalDescriptors.push({target:t,prop:r,descriptor:i}),n==="freeze")typeof o=="object"&&o!==null&&Object.freeze(o);else{let c=this.getPathForTarget(t,r),l=typeof o=="function"?this.createBlockingProxy(o,c,s):this.createBlockingObjectProxy(o,c,s,e.allowedKeys);Object.defineProperty(t,r,{value:l,writable:!0,configurable:!0})}}catch(o){let i=this.getPathForTarget(t,r);this.patchFailures.push(i),console.debug(`[DefenseInDepthBox] Could not patch ${i}:`,o instanceof Error?o.message:o)}}restorePatches(){for(let e=this.originalDescriptors.length-1;e>=0;e--){let{target:t,prop:r,descriptor:s}=this.originalDescriptors[e];try{s?Object.defineProperty(t,r,s):delete t[r]}catch(n){let o=this.getPathForTarget(t,r);console.debug(`[DefenseInDepthBox] Could not restore ${o}:`,n instanceof Error?n.message:n)}}this.originalDescriptors=[]}};export{d as a,_ as b}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-VBLMIJON.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-VBLMIJON.js deleted file mode 100644 index b055584..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-VBLMIJON.js +++ /dev/null @@ -1,6 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{c as u}from"./chunk-DLL7UR66.js";import{c as l}from"./chunk-XEKXHOPO.js";import{a as d,b as h}from"./chunk-QAYAQNCG.js";var m={name:"bash",summary:"execute shell commands or scripts",usage:"bash [OPTIONS] [SCRIPT_FILE] [ARGUMENTS...]",options:["-c COMMAND execute COMMAND string"," --help display this help and exit"],notes:["Without -c, reads and executes commands from SCRIPT_FILE.","Arguments are passed as $1, $2, etc. to the script.",'$0 is set to the script name (or "bash" with -c).']},F={name:"bash",async execute(t,e){if(h(t))return d(m);if(t[0]==="-c"&&t.length>=2){let s=t[1],n=t[2]||"bash",c=t.slice(3);return r(s,n,c,e)}if(t.length===0){let s=l(e.stdin);return s.trim()?r(s,"bash",[],e):{stdout:"",stderr:"",exitCode:0}}let o=t[0],i=t.slice(1);try{let s=e.fs.resolvePath(e.cwd,o),n=await e.fs.readFile(s);return r(n,o,i,e)}catch{return{stdout:"",stderr:`bash: ${o}: No such file or directory -`,exitCode:127}}}},P={name:"sh",async execute(t,e){if(h(t))return d({...m,name:"sh",summary:"execute shell commands or scripts (POSIX shell)"});if(t[0]==="-c"&&t.length>=2){let s=t[1],n=t[2]||"sh",c=t.slice(3);return r(s,n,c,e)}if(t.length===0){let s=l(e.stdin);return s.trim()?r(s,"sh",[],e):{stdout:"",stderr:"",exitCode:0}}let o=t[0],i=t.slice(1);try{let s=e.fs.resolvePath(e.cwd,o),n=await e.fs.readFile(s);return r(n,o,i,e)}catch{return{stdout:"",stderr:`sh: ${o}: No such file or directory -`,exitCode:127}}}};async function r(t,e,o,i){if(!i.exec)return{stdout:"",stderr:`bash: internal error: exec function not available -`,exitCode:1};let s=u(i.exportedEnv||{},{0:e,"#":String(o.length),"@":o.join(" "),"*":o.join(" ")});o.forEach((a,p)=>{s[String(p+1)]=a});let n=t;if(n.startsWith("#!")){let a=n.indexOf(` -`);a!==-1&&(n=n.slice(a+1))}return await i.exec(n,{env:s,cwd:i.cwd,stdin:i.stdin,stdinKind:"bytes",signal:i.signal})}var T={name:"bash",flags:[{flag:"-c",type:"value",valueHint:"string"}],stdinType:"text"},v={name:"sh",flags:[{flag:"-c",type:"value",valueHint:"string"}],stdinType:"text"};export{F as a,P as b,T as c,v as d}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-W5DWRFSU.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-W5DWRFSU.js deleted file mode 100644 index 3b24122..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-W5DWRFSU.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -function n(e){return e instanceof Error?e.message:String(e)}export{n as a}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-WKPK7M56.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-WKPK7M56.js deleted file mode 100644 index 9911241..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-WKPK7M56.js +++ /dev/null @@ -1,10 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a as j}from"./chunk-4I3HOE5Z.js";import{c as y}from"./chunk-XEKXHOPO.js";import{e as v}from"./chunk-BZUGFHVS.js";var w=v(j(),1);function C(){return Object.create(null)}function E(e,r,o){e[r]=o}function b(e){let r=C();for(let o of Object.keys(e)){let s=e[o];(typeof s=="string"||typeof s=="number"||typeof s=="boolean"||s===null)&&(r[o]=s)}return r}function S(e){let r=w.default.parse(e.trim(),{header:!0,dynamicTyping:!0,skipEmptyLines:!0}),o=r.data.map(s=>b(s));return{headers:r.meta.fields||[],data:o}}function I(e,r){return r.length===0?`${e.join(",")} -`:`${w.default.unparse(r,{columns:e}).replace(/\r\n/g,` -`)} -`}async function g(e,r){let o=e.find(p=>!p.startsWith("-")),s;if(!o||o==="-")s=y(r.stdin);else try{let p=r.fs.resolvePath(r.cwd,o);s=await r.fs.readFile(p)}catch{return{headers:[],data:[],error:{stdout:"",stderr:`xan: ${o}: No such file or directory -`,exitCode:1}}}let{headers:i,data:f}=S(s);return{headers:i,data:f}}async function N(e,r){let o=0,s=[],i=[];for(let t=0;t0?s.filter(t=>f.includes(t)):f,l=o>0?p.slice(0,o):p,h=Math.max(...c.map(t=>t.length)),a=[],$="\u2500".repeat(80);for(let t=0;t0?f.slice(0,o):f,c=i.map(t=>t.length);for(let t of d)for(let n=0;nh.repeat(t+2)).join("\u252C")}\u2510`);let $=i.map((t,n)=>` ${t.padEnd(c[n])} `).join(a);l.push(`${a}${$}${a}`),l.push(`\u251C${c.map(t=>h.repeat(t+2)).join("\u253C")}\u2524`);for(let t of d){let n=i.map((u,m)=>` ${String(t[u]??"").padEnd(c[m])} `).join(a);l.push(`${a}${n}${a}`)}return l.push(`\u2514${c.map(t=>h.repeat(t+2)).join("\u2534")}\u2518`),{stdout:`${l.join(` -`)} -`,stderr:"",exitCode:0}}export{C as a,E as b,b as c,S as d,I as e,g as f,N as g,A as h}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-WM5IJFMP.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-WM5IJFMP.js deleted file mode 100644 index 1f934c0..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-WM5IJFMP.js +++ /dev/null @@ -1,8 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a as w,b as v,c as $}from"./chunk-QAYAQNCG.js";var R={name:"chmod",summary:"change file mode bits",usage:"chmod [OPTIONS] MODE FILE...",options:["-R change files recursively","-v output a diagnostic for every file processed"," --help display this help and exit"]},C={name:"chmod",async execute(s,a){if(v(s))return w(R);if(s.length<2)return{stdout:"",stderr:`chmod: missing operand -`,exitCode:1};let e=!1,c=!1,i=0;for(;it.charCodeAt(0));if(i==="hex"){let t=new Uint8Array(r.length/2);for(let n=0;ne.charCodeAt(0));let n=new Uint8Array(r.length);for(let e=0;et.toString(16).padStart(2,"0")).join("");if(i==="binary"||i==="latin1"){if(typeof Buffer<"u")return Buffer.from(r).toString(i);let t=65536;if(r.length<=t)return String.fromCharCode(...r);let n="";for(let e=0;e{ye.read=function(i,e,t,r,n){var o,s,a=n*8-r-1,m=(1<>1,c=-7,p=t?n-1:0,u=t?-1:1,d=i[e+p];for(p+=u,o=d&(1<<-c)-1,d>>=-c,c+=a;c>0;o=o*256+i[e+p],p+=u,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=r;c>0;s=s*256+i[e+p],p+=u,c-=8);if(o===0)o=1-f;else{if(o===m)return s?NaN:(d?-1:1)*(1/0);s=s+Math.pow(2,r),o=o-f}return(d?-1:1)*s*Math.pow(2,o-r)};ye.write=function(i,e,t,r,n,o){var s,a,m,f=o*8-n-1,c=(1<>1,u=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:o-1,B=r?1:-1,k=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=c):(s=Math.floor(Math.log(e)/Math.LN2),e*(m=Math.pow(2,-s))<1&&(s--,m*=2),s+p>=1?e+=u/m:e+=u*Math.pow(2,1-p),e*m>=2&&(s++,m/=2),s+p>=c?(a=0,s=c):s+p>=1?(a=(e*m-1)*Math.pow(2,n),s=s+p):(a=e*Math.pow(2,p-1)*Math.pow(2,n),s=0));n>=8;i[t+d]=a&255,d+=B,a/=256,n-=8);for(s=s<0;i[t+d]=s&255,d+=B,s/=256,f-=8);i[t+d-B]|=k*128}});var Je=L((cn,He)=>{var H=1e3,J=H*60,X=J*60,$=X*24,qt=$*7,Ht=$*365.25;He.exports=function(i,e){e=e||{};var t=typeof i;if(t==="string"&&i.length>0)return Jt(i);if(t==="number"&&isFinite(i))return e.long?Qt(i):Xt(i);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(i))};function Jt(i){if(i=String(i),!(i.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(i);if(e){var t=parseFloat(e[1]),r=(e[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return t*Ht;case"weeks":case"week":case"w":return t*qt;case"days":case"day":case"d":return t*$;case"hours":case"hour":case"hrs":case"hr":case"h":return t*X;case"minutes":case"minute":case"mins":case"min":case"m":return t*J;case"seconds":case"second":case"secs":case"sec":case"s":return t*H;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function Xt(i){var e=Math.abs(i);return e>=$?Math.round(i/$)+"d":e>=X?Math.round(i/X)+"h":e>=J?Math.round(i/J)+"m":e>=H?Math.round(i/H)+"s":i+"ms"}function Qt(i){var e=Math.abs(i);return e>=$?fe(i,e,$,"day"):e>=X?fe(i,e,X,"hour"):e>=J?fe(i,e,J,"minute"):e>=H?fe(i,e,H,"second"):i+" ms"}function fe(i,e,t,r){var n=e>=t*1.5;return Math.round(i/t)+" "+r+(n?"s":"")}});var Ce=L((fn,Xe)=>{function Yt(i){t.debug=t,t.default=t,t.coerce=m,t.disable=s,t.enable=n,t.enabled=a,t.humanize=Je(),t.destroy=f,Object.keys(i).forEach(c=>{t[c]=i[c]}),t.names=[],t.skips=[],t.formatters={};function e(c){let p=0;for(let u=0;u{if(he==="%%")return"%";ie++;let Me=t.formatters[Bt];if(typeof Me=="function"){let Dt=E[ie];he=Me.call(P,Dt),E.splice(ie,1),ie--}return he}),t.formatArgs.call(P,E),(P.log||t.log).apply(P,E)}return k.namespace=c,k.useColors=t.useColors(),k.color=t.selectColor(c),k.extend=r,k.destroy=t.destroy,Object.defineProperty(k,"enabled",{enumerable:!0,configurable:!1,get:()=>u!==null?u:(d!==t.namespaces&&(d=t.namespaces,B=t.enabled(c)),B),set:E=>{u=E}}),typeof t.init=="function"&&t.init(k),k}function r(c,p){let u=t(this.namespace+(typeof p>"u"?":":p)+c);return u.log=this.log,u}function n(c){t.save(c),t.namespaces=c,t.names=[],t.skips=[];let p=(typeof c=="string"?c:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let u of p)u[0]==="-"?t.skips.push(u.slice(1)):t.names.push(u)}function o(c,p){let u=0,d=0,B=-1,k=0;for(;u"-"+p)].join(",");return t.enable(""),c}function a(c){for(let p of t.skips)if(o(c,p))return!1;for(let p of t.names)if(o(c,p))return!0;return!1}function m(c){return c instanceof Error?c.stack||c.message:c}function f(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return t.enable(t.load()),t}Xe.exports=Yt});var Qe=L((F,pe)=>{F.formatArgs=ei;F.save=ti;F.load=ii;F.useColors=Kt;F.storage=ri();F.destroy=(()=>{let i=!1;return()=>{i||(i=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();F.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function Kt(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let i;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(i=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(i[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function ei(i){if(i[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+i[0]+(this.useColors?"%c ":" ")+"+"+pe.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;i.splice(1,0,e,"color: inherit");let t=0,r=0;i[0].replace(/%[a-zA-Z%]/g,n=>{n!=="%%"&&(t++,n==="%c"&&(r=t))}),i.splice(r,0,e)}F.log=console.debug||console.log||(()=>{});function ti(i){try{i?F.storage.setItem("debug",i):F.storage.removeItem("debug")}catch{}}function ii(){let i;try{i=F.storage.getItem("debug")||F.storage.getItem("DEBUG")}catch{}return!i&&typeof process<"u"&&"env"in process&&(i=process.env.DEBUG),i}function ri(){try{return localStorage}catch{}}pe.exports=Ce()(F);var{formatters:ni}=pe.exports;ni.j=function(i){try{return JSON.stringify(i)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Ke=L((pn,Ye)=>{"use strict";Ye.exports=(i,e=process.argv)=>{let t=i.startsWith("-")?"":i.length===1?"-":"--",r=e.indexOf(t+i),n=e.indexOf("--");return r!==-1&&(n===-1||r{"use strict";var oi=re("os"),et=re("tty"),T=Ke(),{env:w}=process,U;T("no-color")||T("no-colors")||T("color=false")||T("color=never")?U=0:(T("color")||T("colors")||T("color=true")||T("color=always"))&&(U=1);"FORCE_COLOR"in w&&(w.FORCE_COLOR==="true"?U=1:w.FORCE_COLOR==="false"?U=0:U=w.FORCE_COLOR.length===0?1:Math.min(parseInt(w.FORCE_COLOR,10),3));function Se(i){return i===0?!1:{level:i,hasBasic:!0,has256:i>=2,has16m:i>=3}}function Fe(i,e){if(U===0)return 0;if(T("color=16m")||T("color=full")||T("color=truecolor"))return 3;if(T("color=256"))return 2;if(i&&!e&&U===void 0)return 0;let t=U||0;if(w.TERM==="dumb")return t;if(process.platform==="win32"){let r=oi.release().split(".");return Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in w)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(r=>r in w)||w.CI_NAME==="codeship"?1:t;if("TEAMCITY_VERSION"in w)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(w.TEAMCITY_VERSION)?1:0;if(w.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in w){let r=parseInt((w.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(w.TERM_PROGRAM){case"iTerm.app":return r>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(w.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(w.TERM)||"COLORTERM"in w?1:t}function si(i){let e=Fe(i,i&&i.isTTY);return Se(e)}tt.exports={supportsColor:si,stdout:Se(Fe(!0,et.isatty(1))),stderr:Se(Fe(!0,et.isatty(2)))}});var nt=L((y,ue)=>{var ai=re("tty"),me=re("util");y.init=di;y.log=mi;y.formatArgs=fi;y.save=ui;y.load=li;y.useColors=ci;y.destroy=me.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");y.colors=[6,2,3,4,5,1];try{let i=it();i&&(i.stderr||i).level>=2&&(y.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}y.inspectOpts=Object.keys(process.env).filter(i=>/^debug_/i.test(i)).reduce((i,e)=>{let t=e.substring(6).toLowerCase().replace(/_([a-z])/g,(n,o)=>o.toUpperCase()),r=process.env[e];return/^(yes|on|true|enabled)$/i.test(r)?r=!0:/^(no|off|false|disabled)$/i.test(r)?r=!1:r==="null"?r=null:r=Number(r),i[t]=r,i},{});function ci(){return"colors"in y.inspectOpts?!!y.inspectOpts.colors:ai.isatty(process.stderr.fd)}function fi(i){let{namespace:e,useColors:t}=this;if(t){let r=this.color,n="\x1B[3"+(r<8?r:"8;5;"+r),o=` ${n};1m${e} \x1B[0m`;i[0]=o+i[0].split(` -`).join(` -`+o),i.push(n+"m+"+ue.exports.humanize(this.diff)+"\x1B[0m")}else i[0]=pi()+e+" "+i[0]}function pi(){return y.inspectOpts.hideDate?"":new Date().toISOString()+" "}function mi(...i){return process.stderr.write(me.formatWithOptions(y.inspectOpts,...i)+` -`)}function ui(i){i?process.env.DEBUG=i:delete process.env.DEBUG}function li(){return process.env.DEBUG}function di(i){i.inspectOpts={};let e=Object.keys(y.inspectOpts);for(let t=0;te.trim()).join(" ")};rt.O=function(i){return this.inspectOpts.colors=this.useColors,me.inspect(i,this.inspectOpts)}});var ot=L((un,Ee)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?Ee.exports=Qe():Ee.exports=nt()});var Ot="End-Of-Stream",l=class extends Error{constructor(){super(Ot),this.name="EndOfStreamError"}},N=class extends Error{constructor(e="The operation was aborted"){super(e),this.name="AbortError"}};var j=class{constructor(){this.endOfStream=!1,this.interrupted=!1,this.peekQueue=[]}async peek(e,t=!1){let r=await this.read(e,t);return this.peekQueue.push(e.subarray(0,r)),r}async read(e,t=!1){if(e.length===0)return 0;let r=this.readFromPeekBuffer(e);if(this.endOfStream||(r+=await this.readRemainderFromStream(e.subarray(r),t)),r===0&&!t)throw new l;return r}readFromPeekBuffer(e){let t=e.length,r=0;for(;this.peekQueue.length>0&&t>0;){let n=this.peekQueue.pop();if(!n)throw new Error("peekData should be defined");let o=Math.min(n.length,t);e.set(n.subarray(0,o),r),r+=o,t-=o,o{this.abort()})}async readToken(e,t=this.position){let r=new Uint8Array(e.len);if(await this.readBuffer(r,{position:t})t)return this.position+=t,t}return this.position+=e,e}async close(){await this.abort(),await this.onClose?.()}normalizeOptions(e,t){if(!this.supportsRandomAccess()&&t&&t.position!==void 0&&t.position0)return await this.ignore(n),this.readBuffer(e,t);if(n<0)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");if(r.length===0)return 0;let o=await this.streamReader.read(e.subarray(0,r.length),r.mayBeLess);if(this.position+=o,(!t||!t.mayBeLess)&&o0){let s=new Uint8Array(r.length+o);return n=await this.peekBuffer(s,{mayBeLess:r.mayBeLess}),e.set(s.subarray(o)),n-o}if(o<0)throw new Error("Cannot peek from a negative offset in a stream")}if(r.length>0){try{n=await this.streamReader.peek(e.subarray(0,r.length),r.mayBeLess)}catch(o){if(t?.mayBeLess&&o instanceof l)return 0;throw o}if(!r.mayBeLess&&n{if(await t.close(),n)return n()},new oe(t,r)}function Ne(i,e){return new se(i,e)}function je(i,e){return new ae(i,e)}import{open as Ut}from"node:fs/promises";var V=class i extends A{static async fromFile(e){let t=await Ut(e,"r"),r=await t.stat();return new i(t,{fileInfo:{path:e,size:r.size}})}constructor(e,t){super(t),this.fileHandle=e,this.fileInfo=t.fileInfo}async readBuffer(e,t){let r=this.normalizeOptions(e,t);if(this.position=r.position,r.length===0)return 0;let n=await this.fileHandle.read(e,0,r.length,r.position);if(this.position+=n.bytesRead,n.bytesRead"u"))return ce??(ce=new globalThis.TextDecoder("utf-8"))}var q=32*1024,I=65533;function We(i,e="utf-8"){switch(e.toLowerCase()){case"utf-8":case"utf8":{let t=Nt();return t?t.decode(i):_t(i)}case"utf-16le":return $t(i);case"us-ascii":case"ascii":return Wt(i);case"latin1":case"iso-8859-1":return Gt(i);case"windows-1252":return Zt(i);default:throw new RangeError(`Encoding '${e}' not supported`)}}function ke(i,e){e.length!==0&&(i.push(String.fromCharCode.apply(null,e)),e.length=0)}function g(i,e,t){e.push(t),e.length>=q&&ke(i,e)}function jt(i,e,t){if(t<=65535){g(i,e,t);return}t-=65536,g(i,e,55296+(t>>10)),g(i,e,56320+(t&1023))}function _t(i){let e=[],t=[],r=0;for(i.length>=3&&i[0]===239&&i[1]===187&&i[2]===191&&(r=3);r244){g(e,t,I),r++;continue}if(n<=223){if(r+1>=i.length){g(e,t,I),r++;continue}let c=i[r+1];if((c&192)!==128){g(e,t,I),r++;continue}let p=(n&31)<<6|c&63;g(e,t,p),r+=2;continue}if(n<=239){if(r+2>=i.length){g(e,t,I),r++;continue}let c=i[r+1],p=i[r+2];if(!((c&192)===128&&(p&192)===128&&!(n===224&&c<160)&&!(n===237&&c>=160))){g(e,t,I),r++;continue}let d=(n&15)<<12|(c&63)<<6|p&63;g(e,t,d),r+=3;continue}if(r+3>=i.length){g(e,t,I),r++;continue}let o=i[r+1],s=i[r+2],a=i[r+3];if(!((o&192)===128&&(s&192)===128&&(a&192)===128&&!(n===240&&o<144)&&!(n===244&&o>143))){g(e,t,I),r++;continue}let f=(n&7)<<18|(o&63)<<12|(s&63)<<6|a&63;jt(e,t,f),r+=4}return ke(e,t),e.join("")}function $t(i){let e=[],t=[],r=i.length,n=0;for(;n+1=55296&&o<=56319){if(n+1=56320&&s<=57343?(g(e,t,o),g(e,t,s),n+=2):g(e,t,I)}else g(e,t,I);continue}if(o>=56320&&o<=57343){g(e,t,I);continue}g(e,t,o)}return n=128&&n<=159?$e[n]:void 0;t+=o??String.fromCharCode(n),t.length>=q&&(e.push(t),t="")}return t&&e.push(t),e.join("")}function C(i){return new DataView(i.buffer,i.byteOffset)}var Ze={len:1,get(i,e){return C(i).getUint8(e)},put(i,e,t){return C(i).setUint8(e,t),e+1}},h={len:2,get(i,e){return C(i).getUint16(e,!0)},put(i,e,t){return C(i).setUint16(e,t,!0),e+2}},_={len:2,get(i,e){return C(i).getUint16(e)},put(i,e,t){return C(i).setUint16(e,t),e+2}};var x={len:4,get(i,e){return C(i).getUint32(e,!0)},put(i,e,t){return C(i).setUint32(e,t,!0),e+4}},be={len:4,get(i,e){return C(i).getUint32(e)},put(i,e,t){return C(i).setUint32(e,t),e+4}};var Ve={len:4,get(i,e){return C(i).getInt32(e)},put(i,e,t){return C(i).setInt32(e,t),e+4}};var qe={len:8,get(i,e){return C(i).getBigUint64(e,!0)},put(i,e,t){return C(i).setBigUint64(e,t,!0),e+8}};var S=class{constructor(e,t){this.len=e,this.encoding=t}get(e,t=0){let r=e.subarray(t,t+this.len);return We(r,this.encoding)}};var ft=Le(ot(),1);var W={LocalFileHeader:67324752,DataDescriptor:134695760,CentralFileHeader:33639248,EndOfCentralDirectory:101010256},Te={get(i){return{signature:x.get(i,0),compressedSize:x.get(i,8),uncompressedSize:x.get(i,12)}},len:16},st={get(i){let e=h.get(i,6);return{signature:x.get(i,0),minVersion:h.get(i,4),dataDescriptor:!!(e&8),compressedMethod:h.get(i,8),compressedSize:x.get(i,18),uncompressedSize:x.get(i,22),filenameLength:h.get(i,26),extraFieldLength:h.get(i,28),filename:null}},len:30},at={get(i){return{signature:x.get(i,0),nrOfThisDisk:h.get(i,4),nrOfThisDiskWithTheStart:h.get(i,6),nrOfEntriesOnThisDisk:h.get(i,8),nrOfEntriesOfSize:h.get(i,10),sizeOfCd:x.get(i,12),offsetOfStartOfCd:x.get(i,16),zipFileCommentLength:h.get(i,20)}},len:22},ct={get(i){let e=h.get(i,8);return{signature:x.get(i,0),minVersion:h.get(i,6),dataDescriptor:!!(e&8),compressedMethod:h.get(i,10),compressedSize:x.get(i,20),uncompressedSize:x.get(i,24),filenameLength:h.get(i,28),extraFieldLength:h.get(i,30),fileCommentLength:h.get(i,32),relativeOffsetOfLocalHeader:x.get(i,42),filename:null}},len:46};function pt(i){let e=new Uint8Array(x.len);return x.put(e,0,i),e}var D=(0,ft.default)("tokenizer:inflate"),ve=256*1024,xi=pt(W.DataDescriptor),le=pt(W.EndOfCentralDirectory),G=class i{constructor(e){this.tokenizer=e,this.syncBuffer=new Uint8Array(ve)}async isZip(){return await this.peekSignature()===W.LocalFileHeader}peekSignature(){return this.tokenizer.peekToken(x)}async findEndOfCentralDirectoryLocator(){let e=this.tokenizer,t=Math.min(16*1024,e.fileInfo.size),r=this.syncBuffer.subarray(0,t);await this.tokenizer.readBuffer(r,{position:e.fileInfo.size-t});for(let n=r.length-4;n>=0;n--)if(r[n]===le[0]&&r[n+1]===le[1]&&r[n+2]===le[2]&&r[n+3]===le[3])return e.fileInfo.size-t+n;return-1}async readCentralDirectory(){if(!this.tokenizer.supportsRandomAccess()){D("Cannot reading central-directory without random-read support");return}D("Reading central-directory...");let e=this.tokenizer.position,t=await this.findEndOfCentralDirectoryLocator();if(t>0){D("Central-directory 32-bit signature found");let r=await this.tokenizer.readToken(at,t),n=[];this.tokenizer.setPosition(r.offsetOfStartOfCd);for(let o=0;o=0?f:m;if(o.handler){let p=new Uint8Array(c);await this.tokenizer.readBuffer(p),a.push(p)}else await this.tokenizer.ignore(c)}D(`Found data-descriptor-signature at pos=${this.tokenizer.position}`),o.handler&&await this.inflate(n,gi(a),o.handler)}else o.handler?(D(`Reading compressed-file-data: ${n.compressedSize} bytes`),s=new Uint8Array(n.compressedSize),await this.tokenizer.readBuffer(s),await this.inflate(n,s,o.handler)):(D(`Ignoring compressed-file-data: ${n.compressedSize} bytes`),await this.tokenizer.ignore(n.compressedSize));if(D(`Reading data-descriptor at pos=${this.tokenizer.position}`),n.dataDescriptor&&(await this.tokenizer.readToken(Te)).signature!==134695760)throw new Error(`Expected data-descriptor-signature at position ${this.tokenizer.position-Te.len}`)}while(!r)}async iterateOverCentralDirectory(e,t){for(let r of e){let n=t(r);if(n.handler){this.tokenizer.setPosition(r.relativeOffsetOfLocalHeader);let o=await this.readLocalFileHeader();if(o){await this.tokenizer.ignore(o.extraFieldLength);let s=new Uint8Array(r.compressedSize);await this.tokenizer.readBuffer(s),await this.inflate(o,s,n.handler)}}if(n.stop)break}}async inflate(e,t,r){if(e.compressedMethod===0)return r(t);if(e.compressedMethod!==8)throw new Error(`Unsupported ZIP compression method: ${e.compressedMethod}`);D(`Decompress filename=${e.filename}, compressed-size=${t.length}`);let n=await i.decompressDeflateRaw(t);return r(n)}static async decompressDeflateRaw(e){let t=new ReadableStream({start(o){o.enqueue(e),o.close()}}),r=new DecompressionStream("deflate-raw"),n=t.pipeThrough(r);try{let s=await new Response(n).arrayBuffer();return new Uint8Array(s)}catch(o){let s=o instanceof Error?`Failed to deflate ZIP entry: ${o.message}`:"Unknown decompression error in ZIP entry";throw new TypeError(s)}}async readLocalFileHeader(){let e=await this.tokenizer.peekToken(x);if(e===W.LocalFileHeader){let t=await this.tokenizer.readToken(st);return t.filename=await this.tokenizer.readToken(new S(t.filenameLength,"utf-8")),t}if(e===W.CentralFileHeader)return!1;throw e===3759263696?new Error("Encrypted ZIP"):new Error("Unexpected signature")}};function hi(i,e){let t=i.length,r=e.length;if(r>t)return-1;for(let n=0;n<=t-r;n++){let o=!0;for(let s=0;sn+o.length,0),t=new Uint8Array(e),r=0;for(let n of i)t.set(n,r),r+=n.length;return t}var Y=class{constructor(e){this.tokenizer=e}inflate(){let e=this.tokenizer;return new ReadableStream({async pull(t){let r=new Uint8Array(1024),n=await e.readBuffer(r,{mayBeLess:!0});if(n===0){t.close();return}t.enqueue(r.subarray(0,n))}}).pipeThrough(new DecompressionStream("gzip"))}};var Cn={utf8:new globalThis.TextDecoder("utf8")};var Sn=new globalThis.TextEncoder;var Fn=Array.from({length:256},(i,e)=>e.toString(16).padStart(2,"0"));function Ae(i){let{byteLength:e}=i;if(e===6)return i.getUint16(0)*2**32+i.getUint32(2);if(e===5)return i.getUint8(0)*2**32+i.getUint32(1);if(e===4)return i.getUint32(0);if(e===3)return i.getUint8(0)*2**16+i.getUint16(1);if(e===2)return i.getUint16(0);if(e===1)return i.getUint8(0)}function mt(i,e){if(e==="utf-16le"){let t=[];for(let r=0;r>8&255)}return t}if(e==="utf-16be"){let t=[];for(let r=0;r>8&255,n&255)}return t}return[...i].map(t=>t.charCodeAt(0))}function ut(i,e=0){let t=Number.parseInt(new S(6).get(i,148).replace(/\0.*$/,"").trim(),8);if(Number.isNaN(t))return!1;let r=256;for(let n=e;ni[e+3]&127|i[e+2]<<7|i[e+1]<<14|i[e]<<21,len:4};var dt=["jpg","png","apng","gif","webp","flif","xcf","cr2","cr3","orf","arw","dng","nef","rw2","raf","tif","bmp","icns","jxr","psd","indd","zip","tar","rar","gz","bz2","7z","dmg","mp4","mid","mkv","webm","mov","avi","mpg","mp2","mp3","m4a","oga","ogg","ogv","opus","flac","wav","spx","amr","pdf","epub","elf","macho","exe","swf","rtf","wasm","woff","woff2","eot","ttf","otf","ttc","ico","flv","ps","xz","sqlite","nes","crx","xpi","cab","deb","ar","rpm","Z","lz","cfb","mxf","mts","blend","bpg","docx","pptx","xlsx","3gp","3g2","j2c","jp2","jpm","jpx","mj2","aif","qcp","odt","ods","odp","xml","mobi","heic","cur","ktx","ape","wv","dcm","ics","glb","pcap","dsf","lnk","alias","voc","ac3","m4v","m4p","m4b","f4v","f4p","f4b","f4a","mie","asf","ogm","ogx","mpc","arrow","shp","aac","mp1","it","s3m","xm","skp","avif","eps","lzh","pgp","asar","stl","chm","3mf","zst","jxl","vcf","jls","pst","dwg","parquet","class","arj","cpio","ace","avro","icc","fbx","vsdx","vtt","apk","drc","lz4","potx","xltx","dotx","xltm","ott","ots","otp","odg","otg","xlsm","docm","dotm","potm","pptm","jar","jmp","rm","sav","ppsm","ppsx","tar.gz","reg","dat"],xt=["image/jpeg","image/png","image/gif","image/webp","image/flif","image/x-xcf","image/x-canon-cr2","image/x-canon-cr3","image/tiff","image/bmp","image/vnd.ms-photo","image/vnd.adobe.photoshop","application/x-indesign","application/epub+zip","application/x-xpinstall","application/vnd.ms-powerpoint.slideshow.macroenabled.12","application/vnd.oasis.opendocument.text","application/vnd.oasis.opendocument.spreadsheet","application/vnd.oasis.opendocument.presentation","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.openxmlformats-officedocument.presentationml.slideshow","application/zip","application/x-tar","application/x-rar-compressed","application/gzip","application/x-bzip2","application/x-7z-compressed","application/x-apple-diskimage","application/vnd.apache.arrow.file","video/mp4","audio/midi","video/matroska","video/webm","video/quicktime","video/vnd.avi","audio/wav","audio/qcelp","audio/x-ms-asf","video/x-ms-asf","application/vnd.ms-asf","video/mpeg","video/3gpp","audio/mpeg","audio/mp4","video/ogg","audio/ogg","audio/ogg; codecs=opus","application/ogg","audio/flac","audio/ape","audio/wavpack","audio/amr","application/pdf","application/x-elf","application/x-mach-binary","application/x-msdownload","application/x-shockwave-flash","application/rtf","application/wasm","font/woff","font/woff2","application/vnd.ms-fontobject","font/ttf","font/otf","font/collection","image/x-icon","video/x-flv","application/postscript","application/eps","application/x-xz","application/x-sqlite3","application/x-nintendo-nes-rom","application/x-google-chrome-extension","application/vnd.ms-cab-compressed","application/x-deb","application/x-unix-archive","application/x-rpm","application/x-compress","application/x-lzip","application/x-cfb","application/x-mie","application/mxf","video/mp2t","application/x-blender","image/bpg","image/j2c","image/jp2","image/jpx","image/jpm","image/mj2","audio/aiff","application/xml","application/x-mobipocket-ebook","image/heif","image/heif-sequence","image/heic","image/heic-sequence","image/icns","image/ktx","application/dicom","audio/x-musepack","text/calendar","text/vcard","text/vtt","model/gltf-binary","application/vnd.tcpdump.pcap","audio/x-dsf","application/x.ms.shortcut","application/x.apple.alias","audio/x-voc","audio/vnd.dolby.dd-raw","audio/x-m4a","image/apng","image/x-olympus-orf","image/x-sony-arw","image/x-adobe-dng","image/x-nikon-nef","image/x-panasonic-rw2","image/x-fujifilm-raf","video/x-m4v","video/3gpp2","application/x-esri-shape","audio/aac","audio/x-it","audio/x-s3m","audio/x-xm","video/MP1S","video/MP2P","application/vnd.sketchup.skp","image/avif","application/x-lzh-compressed","application/pgp-encrypted","application/x-asar","model/stl","application/vnd.ms-htmlhelp","model/3mf","image/jxl","application/zstd","image/jls","application/vnd.ms-outlook","image/vnd.dwg","application/vnd.apache.parquet","application/java-vm","application/x-arj","application/x-cpio","application/x-ace-compressed","application/avro","application/vnd.iccprofile","application/x.autodesk.fbx","application/vnd.visio","application/vnd.android.package-archive","application/vnd.google.draco","application/x-lz4","application/vnd.openxmlformats-officedocument.presentationml.template","application/vnd.openxmlformats-officedocument.spreadsheetml.template","application/vnd.openxmlformats-officedocument.wordprocessingml.template","application/vnd.ms-excel.template.macroenabled.12","application/vnd.oasis.opendocument.text-template","application/vnd.oasis.opendocument.spreadsheet-template","application/vnd.oasis.opendocument.presentation-template","application/vnd.oasis.opendocument.graphics","application/vnd.oasis.opendocument.graphics-template","application/vnd.ms-excel.sheet.macroenabled.12","application/vnd.ms-word.document.macroenabled.12","application/vnd.ms-word.template.macroenabled.12","application/vnd.ms-powerpoint.template.macroenabled.12","application/vnd.ms-powerpoint.presentation.macroenabled.12","application/java-archive","application/vnd.rn-realmedia","application/x-spss-sav","application/x-ms-regedit","application/x-ft-windows-registry-hive","application/x-jmp-data"];var K=4100,wi=K-2,z=1024*1024,ht=1024,yi=2**31-1,v=16*1024*1024,xe=z,gt=z,ki=v,bi=1,wt=100,Ie=v,yt=64,kt=xe,Ci=256,Si=512,Fi=v,Ei=512,Ti=512,bt=256,Ct=xe,St=xe,vi=xe,Ft=v,Ai=new Set(["Unexpected signature","Encrypted ZIP","Expected Central-File-Header signature"]),Ii=["ZIP entry count exceeds ","Unsupported ZIP compression method:","ZIP entry compressed data exceeds ","ZIP entry decompressed data exceeds ","Expected data-descriptor-signature at position "],Bi=new Set(["Z_BUF_ERROR","Z_DATA_ERROR","ERR_INVALID_STATE"]),M=class extends Error{};function Di(i){let e=i?.streamReader;if(e?.constructor?.name!=="WebStreamByobReader")return i;let{reader:t}=e,r=async()=>{await t.cancel(),t.releaseLock()};return e.close=r,e.abort=async()=>{e.interrupted=!0,await r()},i}function Oe(i,e,t){if(!Number.isFinite(i)||i<0||i>e)throw new M(`${t} has invalid size ${i} (maximum ${e} bytes)`);return i}async function R(i,e,{maximumLength:t=v,reason:r="skip"}={}){let n=Oe(e,t,r);await i.ignore(n)}async function Be(i,e,t,{maximumLength:r=e.length,reason:n="read"}={}){let o=t?.length??e.length,s=Oe(o,r,n);return i.readBuffer(e,{...t,length:s})}async function Oi(i,{maximumLength:e=z}={}){let n=new ReadableStream({start(f){f.enqueue(i),f.close()}}).pipeThrough(new DecompressionStream("deflate-raw")).getReader(),o=[],s=0;try{for(;;){let{done:f,value:c}=await n.read();if(f)break;if(s+=c.length,s>e)throw await n.cancel(),new Error(`ZIP entry decompressed data exceeds ${e} bytes`);o.push(c)}}finally{n.releaseLock()}let a=new Uint8Array(s),m=0;for(let f of o)a.set(f,m),m+=f.length;return a}var At=134695760,de=16,zi=de-1;function Mi(i,e){if(i.length=0?0:a===n?Math.min(zi,a-1):0,c=m>=0?m:a-f;if(c===0)break;if(s+=c,s>t)throw new Error(`ZIP entry compressed data exceeds ${t} bytes`);if(e){let p=new Uint8Array(c);await i.tokenizer.readBuffer(p),o.push(p)}else await i.tokenizer.ignore(c);if(m>=0)break}if(b(i.tokenizer)||(i.knownSizeDescriptorScannedBytes+=s),!!e)return Ui(o,s)}function Pi(i,e){return b(i.tokenizer)?Math.max(0,v-(i.tokenizer.position-e)):Math.max(0,z-i.knownSizeDescriptorScannedBytes)}async function Ni(i,e,{shouldBuffer:t,maximumDescriptorLength:r=z}={}){if(e.dataDescriptor&&e.compressedSize===0)return Ri(i,{shouldBuffer:t,maximumLength:r});if(!t){await R(i.tokenizer,e.compressedSize,{maximumLength:b(i.tokenizer)?z:i.tokenizer.fileInfo.size,reason:"ZIP entry compressed data"});return}let n=Zi(i.tokenizer);if(!Number.isFinite(e.compressedSize)||e.compressedSize<0||e.compressedSize>n)throw new Error(`ZIP entry compressed data exceeds ${n} bytes`);let o=new Uint8Array(e.compressedSize);return await i.tokenizer.readBuffer(o),o}G.prototype.inflate=async function(i,e,t){if(i.compressedMethod===0)return t(e);if(i.compressedMethod!==8)throw new Error(`Unsupported ZIP compression method: ${i.compressedMethod}`);let r=await Oi(e,{maximumLength:z});return t(r)};G.prototype.unzip=async function(i){let e=!1,t=0,r=this.tokenizer.position;this.knownSizeDescriptorScannedBytes=0;do{if(ee(this.tokenizer,r,v))throw new M(`ZIP stream probing exceeds ${v} bytes`);let n=await this.readLocalFileHeader();if(!n)break;if(t++,t>ht)throw new Error(`ZIP entry count exceeds ${ht}`);let o=i(n);e=!!o.stop,await this.tokenizer.ignore(n.extraFieldLength);let s=await Ni(this,n,{shouldBuffer:!!o.handler,maximumDescriptorLength:Math.min(z,Pi(this,r))});if(o.handler&&await this.inflate(n,s,o.handler),n.dataDescriptor){let a=new Uint8Array(de);if(await this.tokenizer.readBuffer(a),x.get(a,0)!==At)throw new Error(`Expected data-descriptor-signature at position ${this.tokenizer.position-a.length}`)}if(ee(this.tokenizer,r,v))throw new M(`ZIP stream probing exceeds ${v} bytes`)}while(!e)};function ji(i,e){let t=i.getReader(),r=0,n=!1,o=!1,s=async a=>{n||o||(o=!0,await t.cancel(a))};return new ReadableStream({async pull(a){if(r>=e){a.close(),await s();return}let{done:m,value:f}=await t.read();if(m||!f){n=!0,a.close();return}let c=e-r;if(f.length>c){a.enqueue(f.subarray(0,c)),r+=c,a.close(),await s();return}a.enqueue(f),r+=f.length},async cancel(a){await s(a)}})}async function ze(i,e){return new De(e).fromBuffer(i)}function Et(i){switch(i=i.toLowerCase(),i){case"application/epub+zip":return{ext:"epub",mime:i};case"application/vnd.oasis.opendocument.text":return{ext:"odt",mime:i};case"application/vnd.oasis.opendocument.text-template":return{ext:"ott",mime:i};case"application/vnd.oasis.opendocument.spreadsheet":return{ext:"ods",mime:i};case"application/vnd.oasis.opendocument.spreadsheet-template":return{ext:"ots",mime:i};case"application/vnd.oasis.opendocument.presentation":return{ext:"odp",mime:i};case"application/vnd.oasis.opendocument.presentation-template":return{ext:"otp",mime:i};case"application/vnd.oasis.opendocument.graphics":return{ext:"odg",mime:i};case"application/vnd.oasis.opendocument.graphics-template":return{ext:"otg",mime:i};case"application/vnd.openxmlformats-officedocument.presentationml.slideshow":return{ext:"ppsx",mime:i};case"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":return{ext:"xlsx",mime:i};case"application/vnd.ms-excel.sheet.macroenabled":return{ext:"xlsm",mime:"application/vnd.ms-excel.sheet.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.spreadsheetml.template":return{ext:"xltx",mime:i};case"application/vnd.ms-excel.template.macroenabled":return{ext:"xltm",mime:"application/vnd.ms-excel.template.macroenabled.12"};case"application/vnd.ms-powerpoint.slideshow.macroenabled":return{ext:"ppsm",mime:"application/vnd.ms-powerpoint.slideshow.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":return{ext:"docx",mime:i};case"application/vnd.ms-word.document.macroenabled":return{ext:"docm",mime:"application/vnd.ms-word.document.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.wordprocessingml.template":return{ext:"dotx",mime:i};case"application/vnd.ms-word.template.macroenabledtemplate":return{ext:"dotm",mime:"application/vnd.ms-word.template.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.presentationml.template":return{ext:"potx",mime:i};case"application/vnd.ms-powerpoint.template.macroenabled":return{ext:"potm",mime:"application/vnd.ms-powerpoint.template.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.presentationml.presentation":return{ext:"pptx",mime:i};case"application/vnd.ms-powerpoint.presentation.macroenabled":return{ext:"pptm",mime:"application/vnd.ms-powerpoint.presentation.macroenabled.12"};case"application/vnd.ms-visio.drawing":return{ext:"vsdx",mime:"application/vnd.visio"};case"application/vnd.ms-package.3dmanufacturing-3dmodel+xml":return{ext:"3mf",mime:"model/3mf"};default:}}function O(i,e,t){t={offset:0,...t};for(let[r,n]of e.entries())if(t.mask){if(n!==(t.mask[r]&i[r+t.offset]))return!1}else if(n!==i[r+t.offset])return!1;return!0}function _i(i){return Number.isFinite(i)?Math.max(1,Math.trunc(i)):K}function $i(i,e,t){return t===void 0?i.read(e):(t.throwIfAborted(),new Promise((r,n)=>{let o=()=>{t.removeEventListener("abort",s)},s=()=>{let a=t.reason;o(),(async()=>{try{await i.cancel(a)}catch{}})(),n(a)};t.addEventListener("abort",s,{once:!0}),(async()=>{try{let a=await i.read(e);o(),r(a)}catch(a){o(),n(a)}})()}))}function Wi(i){return Number.isFinite(i)?Math.max(0,Math.min(wi,Math.trunc(i))):0}function Gi(i){return Number.isFinite(i)?Math.max(0,i):Number.MAX_SAFE_INTEGER}function b(i){let e=i.fileInfo.size;return!Number.isFinite(e)||e===Number.MAX_SAFE_INTEGER}function ee(i,e,t){return b(i)&&i.position-e>t}function Zi(i){let e=i.fileInfo.size,t=Number.isFinite(e)?Math.max(0,e-i.position):Number.MAX_SAFE_INTEGER;return Math.min(t,yi)}function Vi(i){if(i instanceof l||i instanceof M)return!0;if(!(i instanceof Error))return!1;if(Ai.has(i.message)||Bi.has(i.code))return!0;for(let e of Ii)if(i.message.startsWith(e))return!0;return!1}function Tt(i,e=z){let t=[i.compressedSize,i.uncompressedSize];for(let r of t)if(!Number.isFinite(r)||r<0||r>e)return!1;return!0}function qi(){return{hasContentTypesEntry:!1,hasParsedContentTypesEntry:!1,isParsingContentTypes:!1,hasUnparseableContentTypes:!1,hasWordDirectory:!1,hasPresentationDirectory:!1,hasSpreadsheetDirectory:!1,hasThreeDimensionalModelEntry:!1}}function Hi(i,e){e.startsWith("word/")&&(i.hasWordDirectory=!0),e.startsWith("ppt/")&&(i.hasPresentationDirectory=!0),e.startsWith("xl/")&&(i.hasSpreadsheetDirectory=!0),e.startsWith("3D/")&&e.endsWith(".model")&&(i.hasThreeDimensionalModelEntry=!0)}function vt(i){if(!(!i.hasContentTypesEntry||i.hasUnparseableContentTypes||i.isParsingContentTypes||i.hasParsedContentTypesEntry)){if(i.hasWordDirectory)return{ext:"docx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"};if(i.hasPresentationDirectory)return{ext:"pptx",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation"};if(i.hasSpreadsheetDirectory)return{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"};if(i.hasThreeDimensionalModelEntry)return{ext:"3mf",mime:"model/3mf"}}}function Ji(i){let e=i.indexOf('.main+xml"');if(e===-1){let n="application/vnd.ms-package.3dmanufacturing-3dmodel+xml";return i.includes(`ContentType="${n}"`)?n:void 0}let t=i.slice(0,e),r=t.lastIndexOf('"');return t.slice(r+1)}var De=class i{constructor(e){let t=Wi(e?.mpegOffsetTolerance);this.options={...e,mpegOffsetTolerance:t},this.detectors=[...this.options.customDetectors??[],{id:"core",detect:this.detectConfident},{id:"core.imprecise",detect:this.detectImprecise}],this.tokenizerOptions={abortSignal:this.options.signal},this.gzipProbeDepth=0}getTokenizerOptions(){return{...this.tokenizerOptions}}createTokenizerFromWebStream(e){return Di(Pe(e,this.getTokenizerOptions()))}async parseTokenizer(e,t=0){this.detectionReentryCount=t;let r=e.position;for(let n of this.detectors){let o;try{o=await n.detect(e)}catch(s){if(s instanceof l||s instanceof M)return;throw s}if(o)return o;if(r!==e.position)return}}async fromTokenizer(e){try{return await this.parseTokenizer(e)}finally{await e.close()}}async fromBuffer(e){if(!(e instanceof Uint8Array||e instanceof ArrayBuffer))throw new TypeError(`Expected the \`input\` argument to be of type \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof e}\``);let t=e instanceof Uint8Array?e:new Uint8Array(e);if(t?.length>1)return this.fromTokenizer(Ne(t,this.getTokenizerOptions()))}async fromBlob(e){this.options.signal?.throwIfAborted();let t=je(e,this.getTokenizerOptions());return this.fromTokenizer(t)}async fromStream(e){this.options.signal?.throwIfAborted();let t=this.createTokenizerFromWebStream(e);return this.fromTokenizer(t)}async toDetectionStream(e,t){let r=_i(t?.sampleSize??K),n,o,s=e.getReader({mode:"byob"});try{let{value:f,done:c}=await $i(s,new Uint8Array(r),this.options.signal);if(o=f,!c&&f)try{n=await this.fromBuffer(f.subarray(0,r))}catch(p){if(!(p instanceof l))throw p;n=void 0}o=f}finally{s.releaseLock()}let a=new TransformStream({async start(f){f.enqueue(o)},transform(f,c){c.enqueue(f)}}),m=e.pipeThrough(a);return m.fileType=n,m}async detectGzip(e){if(this.gzipProbeDepth>=bi)return{ext:"gz",mime:"application/gzip"};let t=new Y(e),r=ji(t.inflate(),ki),n=b(e),o,s,a,m;if(n){let f=new AbortController;o=setTimeout(()=>{f.abort(new DOMException(`Operation timed out after ${wt} ms`,"TimeoutError"))},wt),s=this.options.signal===void 0?f.signal:AbortSignal.any([this.options.signal,f.signal]),a=new i({...this.options,signal:s}),a.gzipProbeDepth=this.gzipProbeDepth+1}else this.gzipProbeDepth++;try{m=await(a??this).fromStream(r)}catch(f){if(f?.name==="AbortError"&&s?.reason?.name!=="TimeoutError")throw f}finally{clearTimeout(o),n||this.gzipProbeDepth--}return m?.ext==="tar"?{ext:"tar.gz",mime:"application/gzip"}:{ext:"gz",mime:"application/gzip"}}check(e,t){return O(this.buffer,e,t)}checkString(e,t){return this.check(mt(e,t?.encoding),t)}detectConfident=async e=>{if(this.buffer=new Uint8Array(K),e.fileInfo.size===void 0&&(e.fileInfo.size=Number.MAX_SAFE_INTEGER),this.tokenizer=e,b(e)&&(await e.peekBuffer(this.buffer,{length:3,mayBeLess:!0}),this.check([31,139,8])))return this.detectGzip(e);if(await e.peekBuffer(this.buffer,{length:32,mayBeLess:!0}),this.check([66,77]))return{ext:"bmp",mime:"image/bmp"};if(this.check([11,119]))return{ext:"ac3",mime:"audio/vnd.dolby.dd-raw"};if(this.check([120,1]))return{ext:"dmg",mime:"application/x-apple-diskimage"};if(this.check([77,90]))return{ext:"exe",mime:"application/x-msdownload"};if(this.check([37,33]))return await e.peekBuffer(this.buffer,{length:24,mayBeLess:!0}),this.checkString("PS-Adobe-",{offset:2})&&this.checkString(" EPSF-",{offset:14})?{ext:"eps",mime:"application/eps"}:{ext:"ps",mime:"application/postscript"};if(this.check([31,160])||this.check([31,157]))return{ext:"Z",mime:"application/x-compress"};if(this.check([199,113]))return{ext:"cpio",mime:"application/x-cpio"};if(this.check([96,234]))return{ext:"arj",mime:"application/x-arj"};if(this.check([239,187,191]))return this.detectionReentryCount>=bt?void 0:(this.detectionReentryCount++,await this.tokenizer.ignore(3),this.detectConfident(e));if(this.check([71,73,70]))return{ext:"gif",mime:"image/gif"};if(this.check([73,73,188]))return{ext:"jxr",mime:"image/vnd.ms-photo"};if(this.check([31,139,8]))return this.detectGzip(e);if(this.check([66,90,104]))return{ext:"bz2",mime:"application/x-bzip2"};if(this.checkString("ID3")){await R(e,6,{maximumLength:6,reason:"ID3 header prefix"});let t=await e.readToken(lt),r=b(e);if(!Number.isFinite(t)||t<0||r&&(t>Ie||e.position+t>Ie))return;if(e.position+t>e.fileInfo.size)return r?void 0:{ext:"mp3",mime:"audio/mpeg"};try{await R(e,t,{maximumLength:r?Ie:e.fileInfo.size,reason:"ID3 payload"})}catch(n){if(n instanceof l)return;throw n}return this.detectionReentryCount>=bt?void 0:(this.detectionReentryCount++,this.parseTokenizer(e,this.detectionReentryCount))}if(this.checkString("MP+"))return{ext:"mpc",mime:"audio/x-musepack"};if((this.buffer[0]===67||this.buffer[0]===70)&&this.check([87,83],{offset:1}))return{ext:"swf",mime:"application/x-shockwave-flash"};if(this.check([255,216,255]))return this.check([247],{offset:3})?{ext:"jls",mime:"image/jls"}:{ext:"jpg",mime:"image/jpeg"};if(this.check([79,98,106,1]))return{ext:"avro",mime:"application/avro"};if(this.checkString("FLIF"))return{ext:"flif",mime:"image/flif"};if(this.checkString("8BPS"))return{ext:"psd",mime:"image/vnd.adobe.photoshop"};if(this.checkString("MPCK"))return{ext:"mpc",mime:"audio/x-musepack"};if(this.checkString("FORM"))return{ext:"aif",mime:"audio/aiff"};if(this.checkString("icns",{offset:0}))return{ext:"icns",mime:"image/icns"};if(this.check([80,75,3,4])){let t,r=qi();try{await new G(e).unzip(n=>{Hi(r,n.filename);let o=n.filename==="[Content_Types].xml",s=vt(r);if(!o&&s)return t=s,{stop:!0};switch(n.filename){case"META-INF/mozilla.rsa":return t={ext:"xpi",mime:"application/x-xpinstall"},{stop:!0};case"META-INF/MANIFEST.MF":return t={ext:"jar",mime:"application/java-archive"},{stop:!0};case"mimetype":return Tt(n,gt)?{async handler(a){let m=new TextDecoder("utf-8").decode(a).trim();t=Et(m)},stop:!0}:{};case"[Content_Types].xml":return r.hasContentTypesEntry=!0,Tt(n,gt)?(r.isParsingContentTypes=!0,{async handler(a){let m=new TextDecoder("utf-8").decode(a),f=Ji(m);f&&(t=Et(f)),r.hasParsedContentTypesEntry=!0,r.isParsingContentTypes=!1},stop:!0}):(r.hasUnparseableContentTypes=!0,{});default:return/classes\d*\.dex/.test(n.filename)?(t={ext:"apk",mime:"application/vnd.android.package-archive"},{stop:!0}):{}}})}catch(n){if(!Vi(n))throw n;r.isParsingContentTypes&&(r.isParsingContentTypes=!1,r.hasUnparseableContentTypes=!0)}return t??vt(r)??{ext:"zip",mime:"application/zip"}}if(this.checkString("OggS")){await e.ignore(28);let t=new Uint8Array(8);return await e.readBuffer(t),O(t,[79,112,117,115,72,101,97,100])?{ext:"opus",mime:"audio/ogg; codecs=opus"}:O(t,[128,116,104,101,111,114,97])?{ext:"ogv",mime:"video/ogg"}:O(t,[1,118,105,100,101,111,0])?{ext:"ogm",mime:"video/ogg"}:O(t,[127,70,76,65,67])?{ext:"oga",mime:"audio/ogg"}:O(t,[83,112,101,101,120,32,32])?{ext:"spx",mime:"audio/ogg"}:O(t,[1,118,111,114,98,105,115])?{ext:"ogg",mime:"audio/ogg"}:{ext:"ogx",mime:"application/ogg"}}if(this.check([80,75])&&(this.buffer[2]===3||this.buffer[2]===5||this.buffer[2]===7)&&(this.buffer[3]===4||this.buffer[3]===6||this.buffer[3]===8))return{ext:"zip",mime:"application/zip"};if(this.checkString("MThd"))return{ext:"mid",mime:"audio/midi"};if(this.checkString("wOFF")&&(this.check([0,1,0,0],{offset:4})||this.checkString("OTTO",{offset:4})))return{ext:"woff",mime:"font/woff"};if(this.checkString("wOF2")&&(this.check([0,1,0,0],{offset:4})||this.checkString("OTTO",{offset:4})))return{ext:"woff2",mime:"font/woff2"};if(this.check([212,195,178,161])||this.check([161,178,195,212]))return{ext:"pcap",mime:"application/vnd.tcpdump.pcap"};if(this.checkString("DSD "))return{ext:"dsf",mime:"audio/x-dsf"};if(this.checkString("LZIP"))return{ext:"lz",mime:"application/x-lzip"};if(this.checkString("fLaC"))return{ext:"flac",mime:"audio/flac"};if(this.check([66,80,71,251]))return{ext:"bpg",mime:"image/bpg"};if(this.checkString("wvpk"))return{ext:"wv",mime:"audio/wavpack"};if(this.checkString("%PDF"))return{ext:"pdf",mime:"application/pdf"};if(this.check([0,97,115,109]))return{ext:"wasm",mime:"application/wasm"};if(this.check([73,73])){let t=await this.readTiffHeader(!1);if(t)return t}if(this.check([77,77])){let t=await this.readTiffHeader(!0);if(t)return t}if(this.checkString("MAC "))return{ext:"ape",mime:"audio/ape"};if(this.check([26,69,223,163])){async function t(){let m=await e.peekNumber(Ze),f=128,c=0;for(;(m&f)===0&&f!==0;)++c,f>>=1;let p=new Uint8Array(c+1);return await Be(e,p,void 0,{maximumLength:p.length,reason:"EBML field"}),p}async function r(){let m=await t(),f=await t();f[0]^=128>>f.length-1;let c=Math.min(6,f.length),p=new DataView(m.buffer),u=new DataView(f.buffer,f.length-c,c);return{id:Ae(p),len:Ae(u)}}async function n(m){let f=0;for(;m>0;){if(f++,f>Ci||ee(e,s,v))return;let c=e.position,p=await r();if(p.id===17026){if(p.len>yt)return;let u=Oe(p.len,yt,"EBML DocType");return(await e.readToken(new S(u))).replaceAll(/\00.*$/g,"")}if(b(e)&&(!Number.isFinite(p.len)||p.len<0||p.len>kt)||(await R(e,p.len,{maximumLength:b(e)?kt:e.fileInfo.size,reason:"EBML payload"}),--m,e.position<=c))return}}let o=await r(),s=e.position;switch(await n(o.len)){case"webm":return{ext:"webm",mime:"video/webm"};case"matroska":return{ext:"mkv",mime:"video/matroska"};default:return}}if(this.checkString("SQLi"))return{ext:"sqlite",mime:"application/x-sqlite3"};if(this.check([78,69,83,26]))return{ext:"nes",mime:"application/x-nintendo-nes-rom"};if(this.checkString("Cr24"))return{ext:"crx",mime:"application/x-google-chrome-extension"};if(this.checkString("MSCF")||this.checkString("ISc("))return{ext:"cab",mime:"application/vnd.ms-cab-compressed"};if(this.check([237,171,238,219]))return{ext:"rpm",mime:"application/x-rpm"};if(this.check([197,208,211,198]))return{ext:"eps",mime:"application/eps"};if(this.check([40,181,47,253]))return{ext:"zst",mime:"application/zstd"};if(this.check([127,69,76,70]))return{ext:"elf",mime:"application/x-elf"};if(this.check([33,66,68,78]))return{ext:"pst",mime:"application/vnd.ms-outlook"};if(this.checkString("PAR1")||this.checkString("PARE"))return{ext:"parquet",mime:"application/vnd.apache.parquet"};if(this.checkString("ttcf"))return{ext:"ttc",mime:"font/collection"};if(this.check([254,237,250,206])||this.check([254,237,250,207])||this.check([206,250,237,254])||this.check([207,250,237,254]))return{ext:"macho",mime:"application/x-mach-binary"};if(this.check([4,34,77,24]))return{ext:"lz4",mime:"application/x-lz4"};if(this.checkString("regf"))return{ext:"dat",mime:"application/x-ft-windows-registry-hive"};if(this.checkString("$FL2")||this.checkString("$FL3"))return{ext:"sav",mime:"application/x-spss-sav"};if(this.check([79,84,84,79,0]))return{ext:"otf",mime:"font/otf"};if(this.checkString("#!AMR"))return{ext:"amr",mime:"audio/amr"};if(this.checkString("{\\rtf"))return{ext:"rtf",mime:"application/rtf"};if(this.check([70,76,86,1]))return{ext:"flv",mime:"video/x-flv"};if(this.checkString("IMPM"))return{ext:"it",mime:"audio/x-it"};if(this.checkString("-lh0-",{offset:2})||this.checkString("-lh1-",{offset:2})||this.checkString("-lh2-",{offset:2})||this.checkString("-lh3-",{offset:2})||this.checkString("-lh4-",{offset:2})||this.checkString("-lh5-",{offset:2})||this.checkString("-lh6-",{offset:2})||this.checkString("-lh7-",{offset:2})||this.checkString("-lzs-",{offset:2})||this.checkString("-lz4-",{offset:2})||this.checkString("-lz5-",{offset:2})||this.checkString("-lhd-",{offset:2}))return{ext:"lzh",mime:"application/x-lzh-compressed"};if(this.check([0,0,1,186])){if(this.check([33],{offset:4,mask:[241]}))return{ext:"mpg",mime:"video/MP1S"};if(this.check([68],{offset:4,mask:[196]}))return{ext:"mpg",mime:"video/MP2P"}}if(this.checkString("ITSF"))return{ext:"chm",mime:"application/vnd.ms-htmlhelp"};if(this.check([202,254,186,190])){let t=be.get(this.buffer,4),r=_.get(this.buffer,6);if(t>0&&t<=30)return{ext:"macho",mime:"application/x-mach-binary"};if(r>30)return{ext:"class",mime:"application/java-vm"}}if(this.checkString(".RMF"))return{ext:"rm",mime:"application/vnd.rn-realmedia"};if(this.checkString("DRACO"))return{ext:"drc",mime:"application/vnd.google.draco"};if(this.check([253,55,122,88,90,0]))return{ext:"xz",mime:"application/x-xz"};if(this.checkString("=1e3&&t<=1050)return{ext:"dwg",mime:"image/vnd.dwg"}}if(this.checkString("070707"))return{ext:"cpio",mime:"application/x-cpio"};if(this.checkString("BLENDER"))return{ext:"blend",mime:"application/x-blender"};if(this.checkString("!"))return await e.ignore(8),await e.readToken(new S(13,"ascii"))==="debian-binary"?{ext:"deb",mime:"application/x-deb"}:{ext:"ar",mime:"application/x-unix-archive"};if(this.checkString("WEBVTT")&&[` -`,"\r"," "," ","\0"].some(t=>this.checkString(t,{offset:6})))return{ext:"vtt",mime:"text/vtt"};if(this.check([137,80,78,71,13,10,26,10])){let t={ext:"png",mime:"image/png"},r={ext:"apng",mime:"image/apng"};await e.ignore(8);async function n(){return{length:await e.readToken(Ve),type:await e.readToken(new S(4,"latin1"))}}let o=b(e),s=e.position,a=0,m=!1;do{if(a++,a>Si||ee(e,s,Fi))break;let f=e.position,c=await n();if(c.length<0)return;if(c.type==="IHDR"){if(c.length!==13)return;m=!0}switch(c.type){case"IDAT":return t;case"acTL":return r;default:if(!m&&c.type!=="CgBI")return;if(o&&c.length>Ct)return m&&Li(c.type)?t:void 0;try{await R(e,c.length+4,{maximumLength:o?Ct+4:e.fileInfo.size,reason:"PNG chunk payload"})}catch(p){if(!o&&(p instanceof M||p instanceof l))return t;throw p}}if(e.position<=f)break}while(e.position+8Ei||ee(e,o,v)));){let a=e.position,m=await r(),f=m.size-24;if(!Number.isFinite(f)||f<0){t=!0;break}if(O(m.id,[145,7,220,183,183,169,207,17,142,230,0,192,12,32,83,101])){let c=new Uint8Array(16);if(f-=await Be(e,c,void 0,{maximumLength:c.length,reason:"ASF stream type GUID"}),O(c,[64,158,105,248,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:"asf",mime:"audio/x-ms-asf"};if(O(c,[192,239,25,188,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:"asf",mime:"video/x-ms-asf"};break}if(n&&f>St){t=!0;break}if(await R(e,f,{maximumLength:n?St:e.fileInfo.size,reason:"ASF header payload"}),e.position<=a){t=!0;break}}}catch(r){if(r instanceof l||r instanceof M)b(e)&&(t=!0);else throw r}return t?void 0:{ext:"asf",mime:"application/vnd.ms-asf"}}if(this.check([171,75,84,88,32,49,49,187,13,10,26,10]))return{ext:"ktx",mime:"image/ktx"};if((this.check([126,16,4])||this.check([126,24,4]))&&this.check([48,77,73,69],{offset:4}))return{ext:"mie",mime:"application/x-mie"};if(this.check([39,10,0,0,0,0,0,0,0,0,0,0],{offset:2}))return{ext:"shp",mime:"application/x-esri-shape"};if(this.check([255,79,255,81]))return{ext:"j2c",mime:"image/j2c"};if(this.check([0,0,0,12,106,80,32,32,13,10,135,10]))switch(await e.ignore(20),await e.readToken(new S(4,"ascii"))){case"jp2 ":return{ext:"jp2",mime:"image/jp2"};case"jpx ":return{ext:"jpx",mime:"image/jpx"};case"jpm ":return{ext:"jpm",mime:"image/jpm"};case"mjp2":return{ext:"mj2",mime:"image/mj2"};default:return}if(this.check([255,10])||this.check([0,0,0,12,74,88,76,32,13,10,135,10]))return{ext:"jxl",mime:"image/jxl"};if(this.check([254,255]))return this.checkString("=16){let t=new DataView(this.buffer.buffer).getUint32(12,!0);if(t>12&&this.buffer.length>=t+16)try{let r=new TextDecoder().decode(this.buffer.subarray(16,t+16));if(JSON.parse(r).files)return{ext:"asar",mime:"application/x-asar"}}catch{}}if(this.check([6,14,43,52,2,5,1,1,13,1,2,1,1,2]))return{ext:"mxf",mime:"application/mxf"};if(this.checkString("SCRM",{offset:44}))return{ext:"s3m",mime:"audio/x-s3m"};if(this.check([71])&&this.check([71],{offset:188}))return{ext:"mts",mime:"video/mp2t"};if(this.check([71],{offset:4})&&this.check([71],{offset:196}))return{ext:"mts",mime:"video/mp2t"};if(this.check([66,79,79,75,77,79,66,73],{offset:60}))return{ext:"mobi",mime:"application/x-mobipocket-ebook"};if(this.check([68,73,67,77],{offset:128}))return{ext:"dcm",mime:"application/dicom"};if(this.check([76,0,0,0,1,20,2,0,0,0,0,0,192,0,0,0,0,0,0,70]))return{ext:"lnk",mime:"application/x.ms.shortcut"};if(this.check([98,111,111,107,0,0,0,0,109,97,114,107,0,0,0,0]))return{ext:"alias",mime:"application/x.apple.alias"};if(this.checkString("Kaydara FBX Binary \0"))return{ext:"fbx",mime:"application/x.autodesk.fbx"};if(this.check([76,80],{offset:34})&&(this.check([0,0,1],{offset:8})||this.check([1,0,2],{offset:8})||this.check([2,0,2],{offset:8})))return{ext:"eot",mime:"application/vnd.ms-fontobject"};if(this.check([6,6,237,245,216,29,70,229,189,49,239,231,254,116,183,29]))return{ext:"indd",mime:"application/x-indesign"};if(this.check([255,255,0,0,7,0,0,0,4,0,0,0,1,0,1,0])||this.check([0,0,255,255,0,0,0,7,0,0,0,4,0,1,0,1]))return{ext:"jmp",mime:"application/x-jmp-data"};if(await e.peekBuffer(this.buffer,{length:Math.min(512,e.fileInfo.size),mayBeLess:!0}),this.checkString("ustar",{offset:257})&&(this.checkString("\0",{offset:262})||this.checkString(" ",{offset:262}))||this.check([0,0,0,0,0,0],{offset:257})&&ut(this.buffer))return{ext:"tar",mime:"application/x-tar"};if(this.check([255,254])){let t="utf-16le";return this.checkString("{this.buffer=new Uint8Array(K);let t=Gi(e.fileInfo.size);if(await e.peekBuffer(this.buffer,{length:Math.min(8,t),mayBeLess:!0}),this.check([0,0,1,186])||this.check([0,0,1,179]))return{ext:"mpg",mime:"video/mpeg"};if(this.check([0,1,0,0,0]))return{ext:"ttf",mime:"font/ttf"};if(this.check([0,0,1,0]))return{ext:"ico",mime:"image/x-icon"};if(this.check([0,0,2,0]))return{ext:"cur",mime:"image/x-icon"};if(await e.peekBuffer(this.buffer,{length:Math.min(2+this.options.mpegOffsetTolerance,t),mayBeLess:!0}),this.buffer.length>=2+this.options.mpegOffsetTolerance)for(let r=0;r<=this.options.mpegOffsetTolerance;++r){let n=this.scanMpeg(r);if(n)return n}};async readTiffTag(e){let t=await this.tokenizer.readToken(e?_:h);switch(await this.tokenizer.ignore(10),t){case 50341:return{ext:"arw",mime:"image/x-sony-arw"};case 50706:return{ext:"dng",mime:"image/x-adobe-dng"};default:}}async readTiffIFD(e){let t=await this.tokenizer.readToken(e?_:h);if(!(t>Ti)&&!(b(this.tokenizer)&&2+t*12>Ft))for(let r=0;r=6){if(this.checkString("CR",{offset:8}))return{ext:"cr2",mime:"image/x-canon-cr2"};if(n>=8){let a=(e?_:h).get(this.buffer,8),m=(e?_:h).get(this.buffer,10);if(a===28&&m===254||a===31&&m===11)return{ext:"nef",mime:"image/x-nikon-nef"}}}if(b(this.tokenizer)&&n>vi)return t;let o=b(this.tokenizer)?Ft:this.tokenizer.fileInfo.size;try{await R(this.tokenizer,n,{maximumLength:o,reason:"TIFF IFD offset"})}catch(a){if(a instanceof l)return;throw a}let s;try{s=await this.readTiffIFD(e)}catch(a){if(a instanceof l)return;throw a}return s??t}if(r===43)return t}scanMpeg(e){if(this.check([255,224],{offset:e,mask:[255,224]})){if(this.check([16],{offset:e+1,mask:[22]}))return this.check([8],{offset:e+1,mask:[8]})?{ext:"aac",mime:"audio/aac"}:{ext:"aac",mime:"audio/aac"};if(this.check([2],{offset:e+1,mask:[6]}))return{ext:"mp3",mime:"audio/mpeg"};if(this.check([4],{offset:e+1,mask:[6]}))return{ext:"mp2",mime:"audio/mpeg"};if(this.check([6],{offset:e+1,mask:[6]}))return{ext:"mp1",mime:"audio/mpeg"}}}},Xi=new Set(dt),Qi=new Set(xt);var Yi={name:"file",summary:"determine file type",usage:"file [OPTION]... FILE...",options:["-b, --brief do not prepend filenames to output","-i, --mime output MIME type strings","-L, --dereference follow symlinks"," --help display this help and exit"]},Ki=new Map([[".js",{description:"JavaScript source",mime:"text/javascript"}],[".mjs",{description:"JavaScript module",mime:"text/javascript"}],[".cjs",{description:"CommonJS module",mime:"text/javascript"}],[".ts",{description:"TypeScript source",mime:"text/typescript"}],[".tsx",{description:"TypeScript JSX source",mime:"text/typescript"}],[".jsx",{description:"JavaScript JSX source",mime:"text/javascript"}],[".py",{description:"Python script",mime:"text/x-python"}],[".rb",{description:"Ruby script",mime:"text/x-ruby"}],[".go",{description:"Go source",mime:"text/x-go"}],[".rs",{description:"Rust source",mime:"text/x-rust"}],[".c",{description:"C source",mime:"text/x-c"}],[".h",{description:"C header",mime:"text/x-c"}],[".cpp",{description:"C++ source",mime:"text/x-c++"}],[".hpp",{description:"C++ header",mime:"text/x-c++"}],[".java",{description:"Java source",mime:"text/x-java"}],[".sh",{description:"Bourne-Again shell script",mime:"text/x-shellscript"}],[".bash",{description:"Bourne-Again shell script",mime:"text/x-shellscript"}],[".zsh",{description:"Zsh shell script",mime:"text/x-shellscript"}],[".json",{description:"JSON data",mime:"application/json"}],[".yaml",{description:"YAML data",mime:"text/yaml"}],[".yml",{description:"YAML data",mime:"text/yaml"}],[".xml",{description:"XML document",mime:"application/xml"}],[".csv",{description:"CSV text",mime:"text/csv"}],[".toml",{description:"TOML data",mime:"text/toml"}],[".html",{description:"HTML document",mime:"text/html"}],[".htm",{description:"HTML document",mime:"text/html"}],[".css",{description:"CSS stylesheet",mime:"text/css"}],[".svg",{description:"SVG image",mime:"image/svg+xml"}],[".md",{description:"Markdown document",mime:"text/markdown"}],[".markdown",{description:"Markdown document",mime:"text/markdown"}],[".txt",{description:"ASCII text",mime:"text/plain"}],[".rst",{description:"reStructuredText",mime:"text/x-rst"}],[".env",{description:"ASCII text",mime:"text/plain"}],[".gitignore",{description:"ASCII text",mime:"text/plain"}],[".dockerignore",{description:"ASCII text",mime:"text/plain"}]]),er=new Map([["jpg","JPEG image data"],["jpeg","JPEG image data"],["png","PNG image data"],["gif","GIF image data"],["webp","WebP image data"],["bmp","PC bitmap"],["ico","MS Windows icon resource"],["tif","TIFF image data"],["tiff","TIFF image data"],["psd","Adobe Photoshop Document"],["avif","AVIF image"],["heic","HEIC image"],["heif","HEIF image"],["jxl","JPEG XL image"],["icns","Mac OS X icon"],["svg","SVG Scalable Vector Graphics image"],["pdf","PDF document"],["epub","EPUB document"],["mobi","Mobipocket E-book"],["djvu","DjVu document"],["zip","Zip archive data"],["gz","gzip compressed data"],["gzip","gzip compressed data"],["bz2","bzip2 compressed data"],["xz","XZ compressed data"],["tar","POSIX tar archive"],["rar","RAR archive data"],["7z","7-zip archive data"],["lz","lzip compressed data"],["lzma","LZMA compressed data"],["zst","Zstandard compressed data"],["cab","Microsoft Cabinet archive"],["ar","Unix ar archive"],["rpm","RPM package"],["deb","Debian binary package"],["apk","Android Package"],["dmg","Apple disk image"],["iso","ISO 9660 CD-ROM filesystem data"],["vhd","Microsoft Virtual Hard Disk"],["vhdx","Microsoft Virtual Hard Disk (new format)"],["qcow2","QEMU QCOW Image"],["mp3","Audio file with ID3"],["m4a","MPEG-4 audio"],["aac","AAC audio"],["wav","RIFF (little-endian) data, WAVE audio"],["flac","FLAC audio bitstream data"],["ogg","Ogg data"],["oga","Ogg audio"],["opus","Ogg Opus audio"],["aiff","AIFF audio"],["wma","Windows Media Audio"],["amr","AMR audio"],["mid","MIDI audio"],["midi","MIDI audio"],["ape","Monkey's Audio"],["mp4","ISO Media, MPEG-4"],["m4v","MPEG-4 video"],["webm","WebM"],["avi","RIFF (little-endian) data, AVI"],["mov","ISO Media, Apple QuickTime movie"],["mkv","Matroska data"],["wmv","Windows Media Video"],["flv","Flash Video"],["3gp","3GPP multimedia"],["3g2","3GPP2 multimedia"],["ogv","Ogg video"],["mts","MPEG transport stream"],["m2ts","MPEG transport stream"],["ts","MPEG transport stream"],["mpg","MPEG video"],["mpeg","MPEG video"],["exe","PE32 executable"],["dll","PE32 DLL"],["elf","ELF executable"],["mach","Mach-O executable"],["wasm","WebAssembly (wasm) binary module"],["dex","Android Dalvik executable"],["class","Java class file"],["swf","Adobe Flash"],["doc","Microsoft Word Document"],["docx","Microsoft Word 2007+ Document"],["xls","Microsoft Excel Spreadsheet"],["xlsx","Microsoft Excel 2007+ Spreadsheet"],["ppt","Microsoft PowerPoint Presentation"],["pptx","Microsoft PowerPoint 2007+ Presentation"],["odt","OpenDocument Text"],["ods","OpenDocument Spreadsheet"],["odp","OpenDocument Presentation"],["ttf","TrueType Font"],["otf","OpenType Font"],["woff","Web Open Font Format"],["woff2","Web Open Font Format 2"],["eot","Embedded OpenType font"],["stl","Stereolithography CAD"],["obj","Wavefront 3D Object"],["gltf","GL Transmission Format"],["glb","GL Transmission Format (binary)"],["sqlite","SQLite 3.x database"],["mdb","Microsoft Access Database"],["xml","XML document"],["json","JSON data"],["macho","Mach-O binary"],["ics","iCalendar data"],["vcf","vCard data"],["msi","Microsoft Installer"],["ps","PostScript"],["ai","Adobe Illustrator"],["indd","Adobe InDesign"],["sketch","Sketch design file"],["fig","Figma design file"],["xd","Adobe XD"],["blend","Blender"],["fbx","Autodesk FBX"],["lnk","MS Windows shortcut"],["alias","Mac OS alias"],["torrent","BitTorrent file"],["pcap","pcap capture file"],["arrow","Apache Arrow"],["parquet","Apache Parquet"]]);function tr(i,e){let t=er.get(i);if(t)return t;let[r,n]=e.split("/"),o=n?.split("+")[0]?.replace(/-/g," ")||i;switch(r){case"image":return`${o.toUpperCase()} image data`;case"audio":return`${o.toUpperCase()} audio`;case"video":return`${o.toUpperCase()} video`;case"font":return`${o} font`;case"model":return`${o} 3D model`;case"application":return n?.includes("zip")||n?.includes("compressed")?`${o} archive data`:n?.includes("executable")?`${o} executable`:`${i.toUpperCase()} data`;default:return`${i.toUpperCase()} data`}}function ir(i){let e=i.split("/").pop()||i;if(e.startsWith(".")&&!e.includes(".",1))return e;let t=e.lastIndexOf(".");return t===-1||t===0?"":e.slice(t).toLowerCase()}function rr(i,e){if(i.startsWith("#!")){let f=i.split(` -`)[0];return f.includes("python")?{description:"Python script, ASCII text executable",mime:"text/x-python"}:f.includes("node")||f.includes("bun")||f.includes("deno")?{description:"JavaScript script, ASCII text executable",mime:"text/javascript"}:f.includes("bash")?{description:"Bourne-Again shell script, ASCII text executable",mime:"text/x-shellscript"}:f.includes("sh")?{description:"POSIX shell script, ASCII text executable",mime:"text/x-shellscript"}:f.includes("ruby")?{description:"Ruby script, ASCII text executable",mime:"text/x-ruby"}:f.includes("perl")?{description:"Perl script, ASCII text executable",mime:"text/x-perl"}:{description:"script, ASCII text executable",mime:"text/plain"}}let t=i.trimStart();if(t.startsWith("127){m=!0;break}return m?{description:`UTF-8 Unicode text${o}`,mime:"text/plain; charset=utf-8"}:{description:`ASCII text${o}`,mime:"text/plain"}}async function nr(i,e){if(e.length===0)return{description:"empty",mime:"inode/x-empty"};let t=await ze(e);if(t)return{description:tr(t.ext,t.mime),mime:t.mime};let r=new TextDecoder("utf-8",{fatal:!1}).decode(e);return rr(r,i)}var _n={name:"file",async execute(i,e){if(Re(i))return Ue(Yi);let t=!1,r=!1,n=[];for(let a of i)if(a.startsWith("--")){if(a==="--brief")t=!0;else if(a==="--mime"||a==="--mime-type")r=!0;else if(a!=="--dereference")return ge("file",a)}else if(a.startsWith("-")&&a!=="-"){for(let m of a.slice(1))if(m==="b")t=!0;else if(m==="i")r=!0;else if(m!=="L")return ge("file",`-${m}`)}else n.push(a);if(n.length===0)return{stdout:"",stderr:`Usage: file [-bLi] FILE... -`,exitCode:1};let o="",s=0;for(let a of n)try{let m=e.fs.resolvePath(e.cwd,a);if((await e.fs.stat(m)).isDirectory){let d=r?"inode/directory":"directory";o+=t?`${d} -`:`${a}: ${d} -`;continue}let c=await e.fs.readFileBuffer(m),p=await nr(a,c),u=r?p.mime:p.description;o+=t?`${u} -`:`${a}: ${u} -`}catch{o+=t?`cannot open -`:`${a}: cannot open (No such file or directory) -`,s=1}return{stdout:o,stderr:"",exitCode:s}}},$n={name:"file",flags:[{flag:"-b",type:"boolean"},{flag:"-i",type:"boolean"},{flag:"-L",type:"boolean"}],needsArgs:!0};export{_n as a,$n as b}; -/*! Bundled license information: - -ieee754/index.js: - (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh *) -*/ diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-XEKXHOPO.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-XEKXHOPO.js deleted file mode 100644 index ec5bda5..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-XEKXHOPO.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -var d=new TextDecoder("utf-8",{fatal:!0}),c=new TextEncoder;function a(t){return t}function x(t){return t}function f(t){let e=t;if(!e)return e;let n=!1;for(let r=0;r255)return e;u>127&&(n=!0)}if(!n)return e;let o=new Uint8Array(e.length);for(let r=0;r1&&t!=="--")if(t.startsWith("-k"))i=e+1;else if(t.startsWith("-s"))i=e+1;else return u("timeout",t);else{i=e;break}}}let n=s.slice(i);if(n.length===0)return{stdout:"",stderr:`timeout: missing operand -`,exitCode:1};let m=n[0],d=y(m);if(d===null)return{stdout:"",stderr:`timeout: invalid time interval '${m}' -`,exitCode:1};let o=n.slice(1);if(o.length===0)return{stdout:"",stderr:`timeout: missing operand -`,exitCode:1};if(!r.exec)return{stdout:"",stderr:`timeout: exec not available -`,exitCode:1};let f=new AbortController,a;try{let e=new Promise(l=>{a=c(()=>{f.abort(),l({timedOut:!0})},d)}),t=r.exec(O([o[0]]),{cwd:r.cwd,signal:f.signal,stdin:r.stdin,stdinKind:"bytes",args:o.slice(1)}).then(l=>({timedOut:!1,result:l})),g=await Promise.race([e,t]);return g.timedOut?{stdout:"",stderr:"",exitCode:124}:g.result}finally{a!==void 0&&p(a)}}},T={name:"timeout",flags:[{flag:"-k",type:"value",valueHint:"string"},{flag:"-s",type:"value",valueHint:"string"},{flag:"--preserve-status",type:"boolean"},{flag:"--foreground",type:"boolean"}],needsArgs:!0,minArgs:2};export{I as a,T as b}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-XZUZRAAC.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-XZUZRAAC.js deleted file mode 100644 index fafbce9..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-XZUZRAAC.js +++ /dev/null @@ -1,10 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a as d}from"./chunk-SX2HC7SO.js";import{a as n,b as i}from"./chunk-SY4HAUHP.js";import{a,b as l}from"./chunk-QAYAQNCG.js";var u={name:"sleep",summary:"delay for a specified amount of time",usage:"sleep NUMBER[SUFFIX]",description:`Pause for NUMBER seconds. SUFFIX may be: - s - seconds (default) - m - minutes - h - hours - d - days - -NUMBER may be a decimal number.`,options:[" --help display this help and exit"]},m=36e5,h={name:"sleep",async execute(r,s){if(l(r))return a(u);if(r.length===0)return{stdout:"",stderr:`sleep: missing operand -`,exitCode:1};let t=0;for(let e of r){let o=d(e);if(o===null)return{stdout:"",stderr:`sleep: invalid time interval '${e}' -`,exitCode:1};t+=o}return t>m&&(t=m),s.signal?.aborted?{stdout:"",stderr:"",exitCode:0}:(s.sleep?await s.sleep(t):s.signal?await new Promise(e=>{let o=()=>{i(p),e()},p=n(()=>{s.signal?.removeEventListener("abort",o),e()},t);s.signal?.addEventListener("abort",o,{once:!0})}):await new Promise(e=>n(e,t)),{stdout:"",stderr:"",exitCode:0})}},b={name:"sleep",flags:[],needsArgs:!0};export{h as a,b}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-Y4LIDHSD.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-Y4LIDHSD.js deleted file mode 100644 index 57c8774..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-Y4LIDHSD.js +++ /dev/null @@ -1,7 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -var F={name:"seq",async execute(r){let d=` -`,f=!1,s=[],t=0;for(;t2){d=e.slice(2),t++;continue}if((e==="-ws"||e==="-sw")&&(f=!0,t+1Number.isNaN(parseFloat(n)))}' -`,exitCode:1};if(o===0)return{stdout:"",stderr:`seq: invalid Zero increment value: '0' -`,exitCode:1};let i=[],h=e=>{let n=String(e),u=n.indexOf(".");return u===-1?0:n.length-u-1},c=Math.max(h(l),h(o),h(a)),p=1e5,g=0;if(o>0)for(let e=l;e<=a+1e-10&&!(g++>p);e+=o)i.push(c>0?e.toFixed(c):String(Math.round(e)));else for(let e=l;e>=a-1e-10&&!(g++>p);e+=o)i.push(c>0?e.toFixed(c):String(Math.round(e)));if(f&&i.length>0){let e=Math.max(...i.map(n=>n.replace("-","").length));for(let n=0;nString.fromCharCode(o)).join("").concat("\x7F")],["[:digit:]","0123456789"],["[:graph:]",Array.from({length:94},(r,o)=>String.fromCharCode(33+o)).join("")],["[:lower:]","abcdefghijklmnopqrstuvwxyz"],["[:print:]",Array.from({length:95},(r,o)=>String.fromCharCode(32+o)).join("")],["[:punct:]","!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~"],["[:space:]",` -\r\f\v`],["[:upper:]","ABCDEFGHIJKLMNOPQRSTUVWXYZ"],["[:xdigit:]","0123456789ABCDEFabcdef"]]);function x(r){let o="",e=0;for(;e65536)throw new Error(`tr: character range too large: '${r[e]}-${r[e+2]}'`);for(let l=a;l<=c;l++)o+=String.fromCharCode(l);e+=3;continue}o+=r[e],e++}return o}var z={complement:{short:"c",long:"complement",type:"boolean"},complementUpper:{short:"C",type:"boolean"},delete:{short:"d",long:"delete",type:"boolean"},squeeze:{short:"s",long:"squeeze-repeats",type:"boolean"}},M={name:"tr",async execute(r,o){if(C(r))return m(b);let e=y("tr",r,z);if(!e.ok)return e.error;let a=e.result.flags.complement||e.result.flags.complementUpper,c=e.result.flags.delete,l=e.result.flags.squeeze,p=e.result.positional;if(p.length<1)return{stdout:"",stderr:`tr: missing operand -`,exitCode:1};if(!c&&!l&&p.length<2)return{stdout:"",stderr:`tr: missing operand after SET1 -`,exitCode:1};let d,s;try{d=x(p[0]),s=p.length>1?x(p[1]):""}catch(n){return{stdout:"",stderr:`${S(n.message)} -`,exitCode:1}}let g=u(o.stdin),h=n=>{let t=d.includes(n);return a?!t:t},i="";if(c)for(let n of g)h(n)||(i+=n);else if(l&&p.length===1){let n="";for(let t of g)h(t)&&t===n||(i+=t,n=t)}else{if(a){let n=s.length>0?s[s.length-1]:"";for(let t of g)d.includes(t)?i+=t:i+=n}else{let n=new Map;for(let t=0;t '${i}' -`),{stdout:c,stderr:"",exitCode:0}}},$={name:"ln",flags:[{flag:"-s",type:"boolean"},{flag:"-f",type:"boolean"},{flag:"-n",type:"boolean"},{flag:"-v",type:"boolean"}],needsArgs:!0,minArgs:2};export{v as a,$ as b}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-YWOZZRSK.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-YWOZZRSK.js deleted file mode 100644 index 6889317..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-YWOZZRSK.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a as l,b as n,d as s}from"./chunk-PDUL32DM.js";import{a,b as i}from"./chunk-QAYAQNCG.js";var m={name:"tail",summary:"output the last part of files",usage:"tail [OPTION]... [FILE]...",options:["-c, --bytes=NUM print the last NUM bytes","-n, --lines=NUM print the last NUM lines (default 10)","-n +NUM print starting from line NUM","-q, --quiet never print headers giving file names","-v, --verbose always print headers giving file names"," --help display this help and exit"]},d={name:"tail",async execute(t,r){if(i(t))return a(m);let e=l(t,"tail");if(!e.ok)return e.error;let{lines:o,bytes:p,fromLine:f}=e.options;return n(r,e.options,"tail",u=>s(u,o,p,f??!1))}},c={name:"tail",flags:[{flag:"-n",type:"value",valueHint:"number"},{flag:"-c",type:"value",valueHint:"number"},{flag:"-q",type:"boolean"},{flag:"-v",type:"boolean"}],stdinType:"text",needsFiles:!0};export{d as a,c as b}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-ZDIT6ST5.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-ZDIT6ST5.js deleted file mode 100644 index 1d52726..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-ZDIT6ST5.js +++ /dev/null @@ -1,7 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a as y}from"./chunk-QIQMJJZ4.js";import{a as $}from"./chunk-W5DWRFSU.js";import{a as u,b as h}from"./chunk-QAYAQNCG.js";var C={name:"mv",summary:"move (rename) files",usage:"mv [OPTION]... SOURCE... DEST",options:["-f, --force do not prompt before overwriting","-n, --no-clobber do not overwrite an existing file","-v, --verbose explain what is being done"," --help display this help and exit"]},P={force:{short:"f",long:"force",type:"boolean"},noClobber:{short:"n",long:"no-clobber",type:"boolean"},verbose:{short:"v",long:"verbose",type:"boolean"}},O={name:"mv",async execute(m,t){if(h(m))return u(C);let s=y("mv",m,P);if(!s.ok)return s.error;let p=s.result.flags.force,d=s.result.flags.noClobber,w=s.result.flags.verbose,i=s.result.positional;if(d&&(p=!1),i.length<2)return{stdout:"",stderr:`mv: missing destination file operand -`,exitCode:1};let r=i.pop()??"",g=i,n=t.fs.resolvePath(t.cwd,r),v="",f="",b=0,a=!1;try{a=(await t.fs.stat(n)).isDirectory}catch{}if(g.length>1&&!a)return{stdout:"",stderr:`mv: target '${r}' is not a directory -`,exitCode:1};for(let e of g)try{let c=t.fs.resolvePath(t.cwd,e),o=n;if(a){let l=e.split("/").pop()||e;o=n==="/"?`/${l}`:`${n}/${l}`}if(d)try{await t.fs.stat(o);continue}catch{}if(await t.fs.mv(c,o),w){let l=a?`${r}/${e.split("/").pop()||e}`:r;v+=`renamed '${e}' -> '${l}' -`}}catch(c){let o=$(c);o.includes("ENOENT")||o.includes("no such file")?f+=`mv: cannot stat '${e}': No such file or directory -`:f+=`mv: cannot move '${e}': ${o} -`,b=1}return{stdout:v,stderr:f,exitCode:b}}},x={name:"mv",flags:[{flag:"-f",type:"boolean"},{flag:"-n",type:"boolean"},{flag:"-v",type:"boolean"}],needsArgs:!0,minArgs:2};export{O as a,x as b}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-ZDPFA4L3.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-ZDPFA4L3.js deleted file mode 100644 index f3aeb35..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/chunk-ZDPFA4L3.js +++ /dev/null @@ -1,6 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a as r,b as m}from"./chunk-QAYAQNCG.js";var p={name:"basename",summary:"strip directory and suffix from filenames",usage:`basename NAME [SUFFIX] -basename OPTION... NAME...`,options:["-a, --multiple support multiple arguments","-s, --suffix=SUFFIX remove a trailing SUFFIX"," --help display this help and exit"]},c={name:"basename",async execute(n,u){if(m(n))return r(p);let l=!1,s="",a=[];for(let t=0;t=2&&(s=a.pop()??"");let o=[];for(let t of a){let e=t.replace(/\/+$/,""),i=e.split("/").pop()||e;s&&i.endsWith(s)&&(i=i.slice(0,-s.length)),o.push(i)}return{stdout:`${o.join(` -`)} -`,stderr:"",exitCode:0}}},h={name:"basename",flags:[{flag:"-a",type:"boolean"},{flag:"-s",type:"value",valueHint:"string"}],needsArgs:!0};export{c as a,h as b}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/clear-HKGFEOF6.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/clear-HKGFEOF6.js deleted file mode 100644 index 1465f73..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/clear-HKGFEOF6.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-7EUWTCWK.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{a as clearCommand,b as flagsForFuzzing}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/column-PVOEF65J.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/column-PVOEF65J.js deleted file mode 100644 index 230432f..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/column-PVOEF65J.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-MIZIUC5M.js";import"./chunk-XEKXHOPO.js";import"./chunk-QIQMJJZ4.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{a as column,b as flagsForFuzzing}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/comm-5QMYEAJL.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/comm-5QMYEAJL.js deleted file mode 100644 index e17936b..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/comm-5QMYEAJL.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-K5JMLDHX.js";import"./chunk-XEKXHOPO.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{a as commCommand,b as flagsForFuzzing}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/cp-BISAAS7A.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/cp-BISAAS7A.js deleted file mode 100644 index 0496d80..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/cp-BISAAS7A.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-4JLVZKHC.js";import"./chunk-QIQMJJZ4.js";import"./chunk-W5DWRFSU.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{a as cpCommand,b as flagsForFuzzing}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/curl-PAWGO3EH.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/curl-PAWGO3EH.js deleted file mode 100644 index 62db6fd..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/curl-PAWGO3EH.js +++ /dev/null @@ -1,26 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{b as F}from"./chunk-WNH3HOQA.js";import{d as u}from"./chunk-HBVMHTO5.js";import{a as T}from"./chunk-W5DWRFSU.js";import{a as w,b,c}from"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";function O(s){let e=s.indexOf("=");if(e>=0){let i=s.slice(0,e),r=s.slice(e+1);return i?`${encodeURIComponent(i)}=${encodeURIComponent(r)}`:encodeURIComponent(r)}return encodeURIComponent(s)}function m(s){let e=s.indexOf("=");if(e<0)return null;let i=s.slice(0,e),r=s.slice(e+1),t,a,o=r.match(/;type=([^;]+)$/);o&&(a=o[1],r=r.slice(0,-o[0].length));let n=r.match(/;filename=([^;]+)/);return n&&(t=n[1],r=r.replace(n[0],"")),(r.startsWith("@")||r.startsWith("<"))&&(t=t??r.slice(1).split("/").pop()),{name:i,value:r,filename:t,contentType:a}}function W(s,e){let i=`----CurlFormBoundary${Date.now().toString(36)}`,r=[];for(let t of s){let a=t.value;if(a.startsWith("@")||a.startsWith("<")){let n=a.slice(1);a=e.get(n)??""}let o=`--${i}\r -`;t.filename?(o+=`Content-Disposition: form-data; name="${t.name}"; filename="${t.filename}"\r -`,t.contentType&&(o+=`Content-Type: ${t.contentType}\r -`)):o+=`Content-Disposition: form-data; name="${t.name}"\r -`,o+=`\r -${a}\r -`,r.push(o)}return r.push(`--${i}--\r -`),{body:r.join(""),boundary:i}}var $={name:"curl",summary:"transfer a URL",usage:"curl [OPTIONS] URL",options:["-X, --request METHOD HTTP method (GET, POST, PUT, DELETE, etc.)","-H, --header HEADER Add header (can be used multiple times)","-d, --data DATA HTTP POST data (DATA=@file reads from file, strips newlines)"," --data-raw DATA HTTP POST data (no @ interpretation)"," --data-binary DATA HTTP POST binary data (DATA=@file reads file verbatim)"," --data-urlencode DATA URL-encode and POST data (supports @file and name@file)","-F, --form NAME=VALUE Multipart form data","-u, --user USER:PASS HTTP authentication","-A, --user-agent STR Set User-Agent header","-e, --referer URL Set Referer header","-b, --cookie DATA Send cookies (name=value or @file)","-c, --cookie-jar FILE Save cookies to file","-T, --upload-file FILE Upload file (PUT)","-o, --output FILE Write output to file","-O, --remote-name Write to file named from URL","-I, --head Show headers only (HEAD request)","-i, --include Include response headers in output","-s, --silent Silent mode (no progress)","-S, --show-error Show errors even when silent","-f, --fail Fail silently on HTTP errors (no output)","-L, --location Follow redirects (default)"," --max-redirs NUM Maximum redirects (default: 20)","-m, --max-time SECS Maximum time for request"," --connect-timeout SECS Connection timeout","-w, --write-out FMT Output format after completion","-v, --verbose Verbose output"," --help Display this help and exit","","Note: Network access must be configured via BashEnv network option."," curl is not available by default for security reasons."]};function f(s,e,i){i.allowFile&&e.startsWith("@")?(s.dataFile={mode:i.binary?"binary":"ascii",path:e.slice(1)},s.data=void 0):(s.data=e,s.dataFile=void 0),i.binary&&(s.dataBinary=!0)}function P(s,e){if(e.startsWith("@")){s.urlencodeFiles.push({path:e.slice(1)});return}let i=e.indexOf("@"),r=e.indexOf("=");if(i>0&&(r<0||i0){let n=a.slice(0,o).trim(),l=a.slice(o+1).trim();e.headers.append(n,l)}}}else if(t.startsWith("--header=")){let a=t.slice(9),o=a.indexOf(":");if(o>0){let n=a.slice(0,o).trim(),l=a.slice(o+1).trim();e.headers.append(n,l)}}else if(t==="-d"||t==="--data")f(e,s[++r]??"",{binary:!1,allowFile:!0}),i=!0;else if(t==="--data-raw")f(e,s[++r]??"",{binary:!1,allowFile:!1}),i=!0;else if(t.startsWith("-d"))f(e,t.slice(2),{binary:!1,allowFile:!0}),i=!0;else if(t.startsWith("--data="))f(e,t.slice(7),{binary:!1,allowFile:!0}),i=!0;else if(t.startsWith("--data-raw="))f(e,t.slice(11),{binary:!1,allowFile:!1}),i=!0;else if(t==="--data-binary")f(e,s[++r]??"",{binary:!0,allowFile:!0}),i=!0;else if(t.startsWith("--data-binary="))f(e,t.slice(14),{binary:!0,allowFile:!0}),i=!0;else if(t==="--data-urlencode")P(e,s[++r]??""),i=!0;else if(t.startsWith("--data-urlencode="))P(e,t.slice(17)),i=!0;else if(t==="-F"||t==="--form"){let a=s[++r]??"",o=m(a);o&&e.formFields.push(o),i=!0}else if(t.startsWith("--form=")){let a=t.slice(7),o=m(a);o&&e.formFields.push(o),i=!0}else if(t==="-u"||t==="--user")e.user=s[++r];else if(t.startsWith("-u"))e.user=t.slice(2);else if(t.startsWith("--user="))e.user=t.slice(7);else if(t==="-A"||t==="--user-agent")e.headers.set("User-Agent",s[++r]??"");else if(t.startsWith("-A"))e.headers.set("User-Agent",t.slice(2));else if(t.startsWith("--user-agent="))e.headers.set("User-Agent",t.slice(13));else if(t==="-e"||t==="--referer")e.headers.set("Referer",s[++r]??"");else if(t.startsWith("-e"))e.headers.set("Referer",t.slice(2));else if(t.startsWith("--referer="))e.headers.set("Referer",t.slice(10));else if(t==="-b"||t==="--cookie")e.headers.set("Cookie",s[++r]??"");else if(t.startsWith("-b"))e.headers.set("Cookie",t.slice(2));else if(t.startsWith("--cookie="))e.headers.set("Cookie",t.slice(9));else if(t==="-c"||t==="--cookie-jar")e.cookieJar=s[++r];else if(t.startsWith("--cookie-jar="))e.cookieJar=t.slice(13);else if(t==="-T"||t==="--upload-file")e.uploadFile=s[++r],e.method==="GET"&&(e.method="PUT");else if(t.startsWith("--upload-file="))e.uploadFile=t.slice(14),e.method==="GET"&&(e.method="PUT");else if(t==="-m"||t==="--max-time"){let a=parseFloat(s[++r]??"0");!Number.isNaN(a)&&a>0&&(e.timeoutMs=a*1e3)}else if(t.startsWith("--max-time=")){let a=parseFloat(t.slice(11));!Number.isNaN(a)&&a>0&&(e.timeoutMs=a*1e3)}else if(t==="--connect-timeout"){let a=parseFloat(s[++r]??"0");!Number.isNaN(a)&&a>0&&e.timeoutMs===void 0&&(e.timeoutMs=a*1e3)}else if(t.startsWith("--connect-timeout=")){let a=parseFloat(t.slice(18));!Number.isNaN(a)&&a>0&&e.timeoutMs===void 0&&(e.timeoutMs=a*1e3)}else if(t==="-o"||t==="--output")e.outputFile=s[++r];else if(t.startsWith("--output="))e.outputFile=t.slice(9);else if(t==="-O"||t==="--remote-name")e.useRemoteName=!0;else if(t==="-I"||t==="--head")e.headOnly=!0,e.method="HEAD";else if(t==="-i"||t==="--include")e.includeHeaders=!0;else if(t==="-s"||t==="--silent")e.silent=!0;else if(t==="-S"||t==="--show-error")e.showError=!0;else if(t==="-f"||t==="--fail")e.failSilently=!0;else if(t==="-L"||t==="--location")e.followRedirects=!0;else if(t==="--max-redirs")r++;else if(!t.startsWith("--max-redirs="))if(t==="-w"||t==="--write-out")e.writeOut=s[++r];else if(t.startsWith("--write-out="))e.writeOut=t.slice(12);else if(t==="-v"||t==="--verbose")e.verbose=!0;else{if(t.startsWith("--")&&t!=="--")return c("curl",t);if(t.startsWith("-")&&t!=="-")for(let a of t.slice(1))switch(a){case"s":e.silent=!0;break;case"S":e.showError=!0;break;case"f":e.failSilently=!0;break;case"L":e.followRedirects=!0;break;case"I":e.headOnly=!0,e.method="HEAD";break;case"i":e.includeHeaders=!0;break;case"O":e.useRemoteName=!0;break;case"v":e.verbose=!0;break;default:return c("curl",`-${a}`)}else t.startsWith("-")||(e.url=t)}}return i&&e.method==="GET"&&(e.method="POST"),e}function h(s){return Object.entries(s).map(([e,i])=>`${e}: ${i}`).join(`\r -`)}function S(s){try{return new URL(s).pathname.split("/").pop()||"index.html"}catch{return"index.html"}}function p(s,e){let i=s;return i=i.replace(/%\{http_code\}/g,String(e.status)),i=i.replace(/%\{content_type\}/g,e.headers["content-type"]||""),i=i.replace(/%\{url_effective\}/g,e.url),i=i.replace(/%\{size_download\}/g,String(e.bodyLength)),i=i.replace(/\\n/g,` -`),i}async function A(s,e){if(s.dataFile){let i=e.fs.resolvePath(e.cwd,s.dataFile.path),r=await e.fs.readFile(i);return s.dataFile.mode==="ascii"&&(r=r.replace(/[\r\n]/g,"")),s.data?`${r}&${s.data}`:r}return s.data}async function E(s,e,i){if(s.urlencodeFiles.length===0)return i;let r=i?[i]:[];for(let t of s.urlencodeFiles){let a=e.fs.resolvePath(e.cwd,t.path),o=await e.fs.readFile(a),n=encodeURIComponent(o);r.push(t.name?`${encodeURIComponent(t.name)}=${n}`:n)}return r.join("&")}async function H(s,e){if(s.uploadFile){let r=e.fs.resolvePath(e.cwd,s.uploadFile);return{body:await e.fs.readFile(r)}}if(s.formFields.length>0){let r=new Map;for(let o of s.formFields)if(o.value.startsWith("@")||o.value.startsWith("<")){let n=e.fs.resolvePath(e.cwd,o.value.slice(1));try{let l=await e.fs.readFile(n);r.set(o.value.slice(1),l)}catch{r.set(o.value.slice(1),"")}}let{body:t,boundary:a}=W(s.formFields,r);return{body:t,contentType:`multipart/form-data; boundary=${a}`}}let i=await A(s,e);return i=await E(s,e,i),i!==void 0?{body:i}:{}}function k(s,e){let i=new u(s.headers);if(s.user){let r=Buffer.from(s.user).toString("base64");i.set("Authorization",`Basic ${r}`)}return e&&!i.has("Content-Type")&&i.set("Content-Type",e),i}async function C(s,e,i){if(!s.cookieJar)return;let r=e["set-cookie"];if(!r)return;let t=i.fs.resolvePath(i.cwd,s.cookieJar);await i.fs.writeFile(t,r)}function U(s){return F(s,"binary")}function x(s,e,i){let r="";if(s.verbose){r+=`> ${s.method} ${i} -`;for(let[t,a]of s.headers)r+=`> ${t}: ${a} -`;r+=`> -`,r+=`< HTTP/1.1 ${e.status} ${e.statusText} -`;for(let[t,a]of Object.entries(e.headers))r+=`< ${t}: ${a} -`;r+=`< -`}return s.includeHeaders&&!s.verbose&&(r+=`HTTP/1.1 ${e.status} ${e.statusText}\r -`,r+=h(e.headers),r+=`\r -\r -`),s.headOnly?s.includeHeaders||s.verbose||(r+=`HTTP/1.1 ${e.status} ${e.statusText}\r -`,r+=h(e.headers),r+=`\r -`):r+=U(e.body),s.writeOut&&(r+=p(s.writeOut,{status:e.status,headers:e.headers,url:e.url,bodyLength:e.body.byteLength})),r}var K={name:"curl",async execute(s,e){if(b(s))return w($);let i=v(s);if("exitCode"in i)return i;let r=i;if(!r.url)return{stdout:"",stderr:`curl: no URL specified -`,exitCode:2};if(!e.fetch)return{stdout:"",stderr:`curl: internal error: fetch not available -`,exitCode:1};let t=r.url;t.match(/^https?:\/\//)||(t=`https://${t}`);try{let{body:a,contentType:o}=await H(r,e),n=k(r,o),l=await e.fetch(t,{method:r.method,headers:n,body:a,followRedirects:r.followRedirects,timeoutMs:r.timeoutMs});if(await C(r,l.headers,e),r.failSilently&&l.status>=400)return{stdout:"",stderr:r.showError||!r.silent?`curl: (22) The requested URL returned error: ${l.status} -`:"",exitCode:22};let d=x(r,l,t);if(r.outputFile||r.useRemoteName){let y=r.outputFile||S(t),R=e.fs.resolvePath(e.cwd,y);await e.fs.writeFile(R,r.headOnly?"":l.body),r.verbose||(d=""),r.writeOut&&(d=p(r.writeOut,{status:l.status,headers:l.headers,url:l.url,bodyLength:l.body.byteLength}))}return{stdout:d,stderr:"",exitCode:0,stdoutKind:"bytes"}}catch(a){let o=T(a),n=1;return o.includes("Network access denied")?n=7:o.includes("HTTP method")&&o.includes("not allowed")?n=3:o.includes("Redirect target not in allow-list")||o.includes("Too many redirects")?n=47:o.includes("aborted")&&(n=28),{stdout:"",stderr:!r.silent||r.showError?`curl: (${n}) ${o} -`:"",exitCode:n}}}};export{K as curlCommand}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/cut-NDMV7SPO.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/cut-NDMV7SPO.js deleted file mode 100644 index 9f77ced..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/cut-NDMV7SPO.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-H7WISVP3.js";import"./chunk-KTPCYKBB.js";import"./chunk-XEKXHOPO.js";import"./chunk-STHBFACM.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{a as cutCommand,b as flagsForFuzzing}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/date-XKUEQ4WF.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/date-XKUEQ4WF.js deleted file mode 100644 index 408d3b7..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/date-XKUEQ4WF.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-BU36VZYL.js";import"./chunk-RBQG6ZUG.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{a as dateCommand,b as flagsForFuzzing}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/diff-TT4M7WM3.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/diff-TT4M7WM3.js deleted file mode 100644 index 680e65e..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/diff-TT4M7WM3.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-CJFAMHFC.js";import"./chunk-XEKXHOPO.js";import"./chunk-QIQMJJZ4.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{a as diffCommand,b as flagsForFuzzing}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/dirname-MPHRFUTI.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/dirname-MPHRFUTI.js deleted file mode 100644 index 617ff7e..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/dirname-MPHRFUTI.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-FX4RBUYU.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{a as dirnameCommand,b as flagsForFuzzing}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/du-572XNP42.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/du-572XNP42.js deleted file mode 100644 index f31eef5..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/du-572XNP42.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-2VJJEDV2.js";import"./chunk-STHBFACM.js";import"./chunk-QIQMJJZ4.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{a as duCommand,b as flagsForFuzzing}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/echo-NDWZZHPO.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/echo-NDWZZHPO.js deleted file mode 100644 index 5cad6eb..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/echo-NDWZZHPO.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-6SHYIICL.js";import"./chunk-BZUGFHVS.js";export{a as echoCommand,b as flagsForFuzzing}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/env-DLFRY633.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/env-DLFRY633.js deleted file mode 100644 index fb22b95..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/env-DLFRY633.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b,c,d}from"./chunk-A4R2GWRF.js";import"./chunk-DLL7UR66.js";import"./chunk-XEKXHOPO.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{a as envCommand,c as flagsForFuzzing,b as printenvCommand,d as printenvFlagsForFuzzing}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/expand-T2TH4TBQ.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/expand-T2TH4TBQ.js deleted file mode 100644 index 5b9b319..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/expand-T2TH4TBQ.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-PYDWFCTN.js";import"./chunk-XEKXHOPO.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{a as expand,b as flagsForFuzzing}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/expr-YLACLCSM.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/expr-YLACLCSM.js deleted file mode 100644 index c244ec3..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/expr-YLACLCSM.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-FLMHFDSN.js";import"./chunk-7CSMHFIJ.js";import"./chunk-FOCWZZDE.js";import"./chunk-BZUGFHVS.js";export{a as exprCommand,b as flagsForFuzzing}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/file-IPZJC3FQ.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/file-IPZJC3FQ.js deleted file mode 100644 index 3697385..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/file-IPZJC3FQ.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-WVRWIZF5.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{a as fileCommand,b as flagsForFuzzing}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/find-T5TGGXUU.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/find-T5TGGXUU.js deleted file mode 100644 index a5214b8..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/find-T5TGGXUU.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-OVH44QKR.js";import"./chunk-TDD4NFYE.js";import"./chunk-QAJKDPNS.js";import"./chunk-L2UW7DWF.js";import"./chunk-7CSMHFIJ.js";import"./chunk-27JIFWUR.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{a as findCommand,b as flagsForFuzzing}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/flag-coverage-OHLSWDU5.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/flag-coverage-OHLSWDU5.js deleted file mode 100644 index 97e49ab..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/flag-coverage-OHLSWDU5.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{b as yr}from"./chunk-HAIOEUEV.js";import{b as Ar}from"./chunk-QM4DZQWX.js";import{b as $r}from"./chunk-6Y4TGEZL.js";import"./chunk-WKPK7M56.js";import"./chunk-4I3HOE5Z.js";import{c as Sr}from"./chunk-55LZFN6S.js";import{b as wr}from"./chunk-H2TS57O5.js";import{b as xr}from"./chunk-MQKGGNPS.js";import{b as vr}from"./chunk-2SMD2AUA.js";import{b as kr}from"./chunk-LI6PTSPD.js";import{b as qr}from"./chunk-SBBYKIYU.js";import{b as Cr}from"./chunk-4MZPEZTU.js";import{b as br}from"./chunk-KTL5PAHY.js";import{d as Ir,e as Mr,f as jr}from"./chunk-KWGBQNTV.js";import{b as tr}from"./chunk-XPK7ZFVA.js";import{b as lr}from"./chunk-2VDTE5BV.js";import{b as ur}from"./chunk-Y4LIDHSD.js";import{b as pr}from"./chunk-FLMHFDSN.js";import{b as er}from"./chunk-CQV3EITV.js";import{b as dr}from"./chunk-DVJY2RAX.js";import{b as cr}from"./chunk-GHB6M7KA.js";import"./chunk-AXMYAPFA.js";import{b as hr}from"./chunk-WVRWIZF5.js";import{c as or,d as ar}from"./chunk-HDRAUQK2.js";import{b as sr}from"./chunk-7EUWTCWK.js";import{c as ir,d as gr}from"./chunk-VBLMIJON.js";import{b as mr}from"./chunk-JA7M2FXG.js";import"./chunk-J3LJZWL2.js";import{b as Fr}from"./chunk-CN5XGDNN.js";import{b as zr}from"./chunk-CJFAMHFC.js";import{b as fr}from"./chunk-BU36VZYL.js";import{b as nr}from"./chunk-XZUZRAAC.js";import"./chunk-SX2HC7SO.js";import{b as R}from"./chunk-ZDPFA4L3.js";import{b as U}from"./chunk-FX4RBUYU.js";import{b as V}from"./chunk-7AISL3XV.js";import{b as W}from"./chunk-2VJJEDV2.js";import{c as X,d as Y}from"./chunk-A4R2GWRF.js";import{c as Z,d as _}from"./chunk-FHC24QSK.js";import{b as N}from"./chunk-UIJUTQPH.js";import{b as rr}from"./chunk-NGPDJCUE.js";import{b as G}from"./chunk-PYDWFCTN.js";import{b as H}from"./chunk-AAGO7IQ5.js";import{b as J}from"./chunk-MFDPAVC6.js";import{b as K}from"./chunk-6L65G6A7.js";import{b as L}from"./chunk-MIZIUC5M.js";import{b as O}from"./chunk-TA74ENH7.js";import{b as P}from"./chunk-LSLPJOYM.js";import{b as Q}from"./chunk-OVH44QKR.js";import{b as y}from"./chunk-5MV7Q5QB.js";import{b as A}from"./chunk-K5JMLDHX.js";import{b as $}from"./chunk-H7WISVP3.js";import{b as S}from"./chunk-6NYPZ4NX.js";import{b as T}from"./chunk-YRNR2VHY.js";import{b as B}from"./chunk-S2BIZAWY.js";import{b as D}from"./chunk-RCXNPPJY.js";import{b as E}from"./chunk-R4QNMLOB.js";import{b as w}from"./chunk-YWOZZRSK.js";import{b as x}from"./chunk-MTHXXA6H.js";import{b as v}from"./chunk-SETW5JBN.js";import"./chunk-TDD4NFYE.js";import{d as k,e as q,f as C}from"./chunk-GE6OQDB2.js";import"./chunk-QAJKDPNS.js";import{b}from"./chunk-JNYYVLEL.js";import"./chunk-4WKZNNJK.js";import"./chunk-KSBHIW2H.js";import{b as I}from"./chunk-IZ6KBTV7.js";import{b as M}from"./chunk-GRQJA2J7.js";import{b as j}from"./chunk-JTMQLUCH.js";import{b as t}from"./chunk-LPJEKUCB.js";import{b as l}from"./chunk-4JLVZKHC.js";import{b as u}from"./chunk-ZDIT6ST5.js";import{b as p}from"./chunk-YS4NUBYX.js";import{b as e}from"./chunk-WM5IJFMP.js";import{b as d}from"./chunk-SHKOQWO4.js";import{b as c}from"./chunk-WPGQVBSY.js";import{b as h}from"./chunk-TC2WHAIS.js";import"./chunk-PDUL32DM.js";import"./chunk-HBVMHTO5.js";import"./chunk-SY4HAUHP.js";import"./chunk-L2UW7DWF.js";import"./chunk-DLL7UR66.js";import"./chunk-KAPG5ONA.js";import"./chunk-VACKIICN.js";import"./chunk-7CSMHFIJ.js";import{b as i}from"./chunk-6SHYIICL.js";import{b as g}from"./chunk-MFRETFZB.js";import"./chunk-KTPCYKBB.js";import"./chunk-XEKXHOPO.js";import{b as m}from"./chunk-MJLETYZI.js";import"./chunk-RBQG6ZUG.js";import"./chunk-27JIFWUR.js";import"./chunk-SAI2SPQQ.js";import{b as F}from"./chunk-R4IFXNY5.js";import"./chunk-STHBFACM.js";import{b as z}from"./chunk-MLIO3BK2.js";import"./chunk-FOCWZZDE.js";import{b as f}from"./chunk-SJYEXC2Z.js";import"./chunk-QIQMJJZ4.js";import{b as n}from"./chunk-FZRQOL3C.js";import"./chunk-W5DWRFSU.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";var Er=[i,g,m,F,z,f,n,t,l,u,p,e,d,c,h,w,x,v,k,q,C,b,I,M,j,y,A,$,S,T,B,D,E,G,H,J,K,L,O,P,Q,R,U,V,W,X,Y,Z,_,N,rr,or,ar,sr,ir,gr,mr,Fr,zr,fr,nr,tr,lr,ur,pr,er,dr,cr,hr,wr,xr,vr,kr,qr,Cr,br,Ir,Mr,jr,yr,Ar,$r,Sr];function Tr(){return Er}var Br=new Map;for(let r of Tr())Br.set(r.name,new Set(r.flags.map(o=>o.flag)));function Fa(r,o,Dr){let a=Br.get(o);if(!(!a||a.size===0))for(let s of Dr)a.has(s)&&r.hit(`cmd:flag:${o}:${s}`)}export{Fa as emitFlagCoverage}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/fold-XR2JMFCW.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/fold-XR2JMFCW.js deleted file mode 100644 index d7fa9c9..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/fold-XR2JMFCW.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-R4QNMLOB.js";import"./chunk-XEKXHOPO.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{b as flagsForFuzzing,a as fold}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/grep-VUESTEZ7.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/grep-VUESTEZ7.js deleted file mode 100644 index c1e8ab8..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/grep-VUESTEZ7.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b,c,d,e,f}from"./chunk-GE6OQDB2.js";import"./chunk-QAJKDPNS.js";import"./chunk-KSBHIW2H.js";import"./chunk-7CSMHFIJ.js";import"./chunk-XEKXHOPO.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{c as egrepCommand,f as egrepFlagsForFuzzing,b as fgrepCommand,e as fgrepFlagsForFuzzing,d as flagsForFuzzing,a as grepCommand}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/gzip-HF3D26QX.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/gzip-HF3D26QX.js deleted file mode 100644 index 4a46389..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/gzip-HF3D26QX.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b,c,d,e,f}from"./chunk-KWGBQNTV.js";import"./chunk-XEKXHOPO.js";import"./chunk-QIQMJJZ4.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{d as flagsForFuzzing,b as gunzipCommand,e as gunzipFlagsForFuzzing,a as gzipCommand,c as zcatCommand,f as zcatFlagsForFuzzing}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/head-AEMOMQSZ.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/head-AEMOMQSZ.js deleted file mode 100644 index f55e1e9..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/head-AEMOMQSZ.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-TC2WHAIS.js";import"./chunk-PDUL32DM.js";import"./chunk-XEKXHOPO.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{b as flagsForFuzzing,a as headCommand}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/help-HZ6M2CKN.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/help-HZ6M2CKN.js deleted file mode 100644 index 34ed783..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/help-HZ6M2CKN.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-MQKGGNPS.js";import"./chunk-L2UW7DWF.js";import"./chunk-BZUGFHVS.js";export{b as flagsForFuzzing,a as helpCommand}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/history-WYYKSLSZ.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/history-WYYKSLSZ.js deleted file mode 100644 index e9da2d6..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/history-WYYKSLSZ.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-UIJUTQPH.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{b as flagsForFuzzing,a as historyCommand}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/hostname-C4HQXXUP.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/hostname-C4HQXXUP.js deleted file mode 100644 index b9bc998..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/hostname-C4HQXXUP.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-SBBYKIYU.js";import"./chunk-BZUGFHVS.js";export{b as flagsForFuzzing,a as hostname}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/html-to-markdown-LXXMVQ3V.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/html-to-markdown-LXXMVQ3V.js deleted file mode 100644 index 699692a..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/html-to-markdown-LXXMVQ3V.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-H2TS57O5.js";import"./chunk-XEKXHOPO.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{b as flagsForFuzzing,a as htmlToMarkdownCommand}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/join-YIABB6WR.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/join-YIABB6WR.js deleted file mode 100644 index 54faa07..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/join-YIABB6WR.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-TA74ENH7.js";import"./chunk-XEKXHOPO.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{b as flagsForFuzzing,a as join}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/jq-OPEF5OPR.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/jq-OPEF5OPR.js deleted file mode 100644 index 44b1c48..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/jq-OPEF5OPR.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-JA7M2FXG.js";import"./chunk-J3LJZWL2.js";import"./chunk-4WKZNNJK.js";import"./chunk-DLL7UR66.js";import"./chunk-KAPG5ONA.js";import"./chunk-VACKIICN.js";import"./chunk-7CSMHFIJ.js";import"./chunk-KTPCYKBB.js";import"./chunk-XEKXHOPO.js";import"./chunk-SAI2SPQQ.js";import"./chunk-STHBFACM.js";import"./chunk-FOCWZZDE.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{b as flagsForFuzzing,a as jqCommand}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/js-exec-SR6IMNWM.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/js-exec-SR6IMNWM.js deleted file mode 100644 index e1e7cdf..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/js-exec-SR6IMNWM.js +++ /dev/null @@ -1,97 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a as C,b as F}from"./chunk-AX2X3SZS.js";import"./chunk-WNH3HOQA.js";import"./chunk-HBVMHTO5.js";import{a as w,b as g}from"./chunk-SY4HAUHP.js";import"./chunk-L2UW7DWF.js";import{a as j}from"./chunk-DLL7UR66.js";import{b as v}from"./chunk-VACKIICN.js";import{c as S}from"./chunk-XEKXHOPO.js";import{a as b,b as h}from"./chunk-FOCWZZDE.js";import{a as k}from"./chunk-W5DWRFSU.js";import{b as E}from"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";import{AsyncLocalStorage as O}from"node:async_hooks";import{randomBytes as R}from"node:crypto";import{fileURLToPath as _}from"node:url";import{Worker as L}from"node:worker_threads";var U=1e4,I=6e4,A=new O,M=`js-exec - Sandboxed JavaScript/TypeScript runtime with Node.js-compatible APIs - -Usage: js-exec [OPTIONS] [-c CODE | FILE] [ARGS...] - -Options: - -c CODE Execute inline code - -m, --module Enable ES module mode (import/export) - --strip-types Strip TypeScript type annotations - --version, -V Show version - --help Show this help - -Examples: - js-exec -c "console.log(1 + 2)" - js-exec script.js - js-exec app.ts - echo 'console.log("hello")' | js-exec - -File Extension Auto-Detection: - .js script mode (module mode if top-level await detected) - .mjs ES module mode - .ts, .mts ES module mode + TypeScript stripping - -Node.js Compatibility: - Code written for Node.js largely works here. Both require and import - are supported, the node: prefix works, and standard globals like process, - console, and fetch are available. All I/O is synchronous. - - Available modules: - fs, path, child_process, process, console, - os, url, assert, util, events, buffer, stream, - string_decoder, querystring - - fs (global, require('fs'), or import from 'node:fs'): - readFileSync, writeFileSync, appendFileSync, copyFileSync, renameSync - readdirSync, mkdirSync, rmSync, unlinkSync, rmdirSync - statSync, lstatSync, existsSync, realpathSync, chmodSync - symlinkSync, readlinkSync, readFileBuffer - fs.promises.readFile, fs.promises.writeFile, fs.promises.access, ... - - path: join, resolve, dirname, basename, extname, normalize, - relative, isAbsolute, parse, format, sep, delimiter - - child_process: - execSync(cmd) throws on non-zero exit, returns stdout - spawnSync(cmd, args) returns { stdout, stderr, status } - - process (also global): argv, cwd(), exit(), env, platform, arch, - version, versions - - os: platform(), arch(), homedir(), tmpdir(), type(), hostname(), - EOL, cpus(), endianness() - - url: URL, URLSearchParams, parse(), format() - - assert: ok(), equal(), strictEqual(), deepEqual(), throws(), - doesNotThrow(), fail() - - util: format(), inspect(), promisify(), types, inherits() - - events: EventEmitter (on, once, emit, off, removeListener, ...) - - buffer: Buffer.from(), Buffer.alloc(), Buffer.concat(), - Buffer.isBuffer(), toString(), slice(), equals() - - stream: Readable, Writable, Duplex, Transform, PassThrough, pipeline - - string_decoder: StringDecoder (write, end) - - querystring: parse(), stringify(), escape(), unescape() - -Other Globals: - console log (stdout), error/warn (stderr) - fetch(url, opts) HTTP; returns Promise (Web Fetch API) - URL, URLSearchParams, Headers, Request, Response - Buffer Buffer.from(), Buffer.alloc(), etc. - -Not Available: - http, https, net, tls, crypto, zlib, dns, cluster, worker_threads, - vm, v8, readline, and other Node.js built-in modules that require - native bindings. Use fetch() for HTTP requests. - -Limits: - Memory: 64 MB per execution - Timeout: 10 s (60 s with network; configurable via maxJsTimeoutMs) - Engine: QuickJS (compiled to WebAssembly) -`;function J(t){let e={code:null,scriptFile:null,showVersion:!1,scriptArgs:[],isModule:!1,stripTypes:!1};if(t.length===0)return e;for(let r=0;r=t.length?{stdout:"",stderr:`js-exec: option requires an argument -- 'c' -`,exitCode:2}:(e.code=t[r+1],e.scriptArgs=t.slice(r+2),e);if(s==="--version"||s==="-V")return e.showVersion=!0,e;if(s.startsWith("-")&&s!=="-"&&s!=="--")return{stdout:"",stderr:`js-exec: unrecognized option '${s}' -`,exitCode:2};if(s==="--")return r+10&&u[0].canceled;)u.shift();if(n||u.length===0)return;let t=u.shift();if(!t)return;n=t,H().postMessage(n.input)}function N(t,e){if(!t||typeof t!="object")return{success:!1,error:"Malformed worker response"};let r=t;return typeof r.protocolToken!="string"||r.protocolToken!==e?{success:!1,error:"Malformed worker response: invalid protocol token"}:typeof r.success!="boolean"?{success:!1,error:"Malformed worker response: missing success flag"}:r.success?{success:!0}:{success:!1,error:typeof r.error=="string"&&r.error.length>0?r.error:"Worker execution failed"}}function H(){if(y&&(g(y),y=null),c)return c;let t=v.runTrusted(()=>new L(D));return c=t,t.on("message",e=>{if(c===t){if(n){let r=N(e,n.input.protocolToken);n.resolve(r),n=null}u.length>0?p():z()}}),t.on("error",e=>{if(c===t){if(n){let r=h(k(e));n.resolve({success:!1,error:r}),n=null}for(let r of u)r.resolve({success:!1,error:"Worker crashed"});u.length=0,c=null}}),t.on("exit",()=>{c===t&&(c=null,n&&(n.resolve({success:!1,error:"Worker exited unexpectedly"}),n=null),u.length>0&&p())}),t}function z(){y=w(()=>{c&&!n&&u.length===0&&(c.terminate(),c=null)},5e3)}async function $(t,e,r,s=[],o,i,a){return A.getStore()?{stdout:"",stderr:`js-exec: recursive invocation is not supported -`,exitCode:1}:G(t,e,r,s,o,i,a)}async function V(t,e,r){let s,o=new Promise(l=>{s=l}),i={input:t,resolve:()=>{}},a=w(()=>{if(n===i){let l=c;l&&(c=null,l.terminate()),n=null,p()}else i.canceled=!0,n||p();i.resolve({success:!1,error:`Execution timeout: exceeded ${r}ms limit`})},r);i.resolve=l=>{g(a),s(l)},u.push(i),p();let[f,d]=await Promise.all([e.run(r),o.catch(l=>({success:!1,error:h(k(l))}))]);return{bridgeOutput:f,workerResult:d}}function Q(t){let e=t.limits?.maxJsTimeoutMs??U;return t.fetch?Math.max(e,I):e}async function G(t,e,r,s=[],o,i,a){let f=C(),d=e.exec,l=d?(P,q)=>A.run(!0,()=>d(P,q)):void 0,W=new F(f,e.fs,e.cwd,"js-exec",e.fetch,e.limits?.maxOutputSize??0,l,e.invokeTool),T=Q(e),B={protocolToken:R(16).toString("hex"),sharedBuffer:f,jsCode:t,cwd:e.cwd,env:j(e.env),args:s,scriptPath:r,bootstrapCode:o,isModule:i,stripTypes:a,timeoutMs:T,hasInvokeTool:e.invokeTool!==void 0},{bridgeOutput:m,workerResult:x}=await V(B,W,T);return!x.success&&x.error?{stdout:m.stdout,stderr:`${m.stderr}js-exec: ${h(x.error)} -`,exitCode:m.exitCode||1}:{...m}}var ae={name:"js-exec",async execute(t,e){if(E(t))return{stdout:M,stderr:"",exitCode:0};let r=J(t);if("exitCode"in r)return r;if(r.showVersion)return{stdout:`QuickJS (quickjs-emscripten) -`,stderr:"",exitCode:0};let s,o;if(r.code!==null)s=r.code,o="-c";else if(r.scriptFile!==null){let d=e.fs.resolvePath(e.cwd,r.scriptFile);if(!await e.fs.exists(d))return{stdout:"",stderr:`js-exec: can't open file '${r.scriptFile}': No such file or directory -`,exitCode:2};try{s=await e.fs.readFile(d),o=d}catch(l){return{stdout:"",stderr:`js-exec: can't open file '${r.scriptFile}': ${b(l.message)} -`,exitCode:2}}}else if(S(e.stdin).trim())s=S(e.stdin),o="";else return{stdout:"",stderr:`js-exec: no input provided (use -c CODE or provide a script file) -`,exitCode:2};let i=r.isModule,a=r.stripTypes;o&&o!=="-c"&&o!==""&&((o.endsWith(".mjs")||o.endsWith(".mts")||o.endsWith(".ts"))&&(i=!0),(o.endsWith(".ts")||o.endsWith(".mts"))&&(a=!0)),!i&&/\bawait\s+[\w([`]/.test(s)&&(i=!0);let f=e.jsBootstrapCode;return $(s,e,o,r.scriptArgs,f,i,a)}},de={name:"node",async execute(){return{stdout:"",stderr:`node: this sandbox uses js-exec instead of node - -${M}`,exitCode:1}}};export{ae as jsExecCommand,de as nodeStubCommand}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/js-exec-worker.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/js-exec-worker.js deleted file mode 100644 index 490c456..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/js-exec-worker.js +++ /dev/null @@ -1,4640 +0,0 @@ -var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { - get: (a, b) => (typeof require !== "undefined" ? require : a)[b] -}) : x)(function(x) { - if (typeof require !== "undefined") return require.apply(this, arguments); - throw Error('Dynamic require of "' + x + '" is not supported'); -}); - -// src/commands/js-exec/js-exec-worker.ts -import { stripTypeScriptTypes } from "node:module"; -import { parentPort } from "node:worker_threads"; -import { - getQuickJS -} from "quickjs-emscripten"; - -// src/security/blocked-globals.ts -function getBlockedGlobals() { - const globals = [ - // Direct code execution vectors - { - prop: "Function", - target: globalThis, - violationType: "function_constructor", - strategy: "throw", - reason: "Function constructor allows arbitrary code execution" - }, - { - prop: "eval", - target: globalThis, - violationType: "eval", - strategy: "throw", - reason: "eval() allows arbitrary code execution" - }, - // Timer functions with string argument allow code execution - { - prop: "setTimeout", - target: globalThis, - violationType: "setTimeout", - strategy: "throw", - reason: "setTimeout with string argument allows code execution" - }, - { - prop: "setInterval", - target: globalThis, - violationType: "setInterval", - strategy: "throw", - reason: "setInterval with string argument allows code execution" - }, - { - prop: "setImmediate", - target: globalThis, - violationType: "setImmediate", - strategy: "throw", - reason: "setImmediate could be used to escape sandbox context" - }, - // Note: We intentionally do NOT block `process` entirely because: - // 1. Node.js internals (Promise resolution, etc.) use process.nextTick - // 2. Blocking process entirely breaks normal async operation - // 3. The primary code execution vectors (Function, eval) are already blocked - // However, we DO block specific dangerous process properties. - { - prop: "env", - target: process, - violationType: "process_env", - strategy: "throw", - reason: "process.env could leak sensitive environment variables", - // Node.js internals and bundled dependencies read these env vars - // during module loading, file watching, and I/O within the - // AsyncLocalStorage context. None are user secrets. - allowedKeys: /* @__PURE__ */ new Set([ - // Node.js core - "NODE_V8_COVERAGE", - "NODE_DEBUG", - "NODE_DEBUG_NATIVE", - "NODE_COMPILE_CACHE", - "WATCH_REPORT_DEPENDENCIES", - // Dependencies - "FORCE_COLOR", - // chalk/supports-color - "DEBUG", - // debug package - "UNDICI_NO_FG", - // undici (Node.js fetch) - "JEST_WORKER_ID", - // jest/vitest worker detection - "__MINIMATCH_TESTING_PLATFORM__", - // minimatch - "LOG_TOKENS", - // query engine debug logging - "LOG_STREAM" - // query engine debug logging - ]) - }, - { - prop: "binding", - target: process, - violationType: "process_binding", - strategy: "throw", - reason: "process.binding provides access to native Node.js modules" - }, - { - prop: "_linkedBinding", - target: process, - violationType: "process_binding", - strategy: "throw", - reason: "process._linkedBinding provides access to native Node.js modules" - }, - { - prop: "dlopen", - target: process, - violationType: "process_dlopen", - strategy: "throw", - reason: "process.dlopen allows loading native addons" - }, - { - prop: "getBuiltinModule", - target: process, - violationType: "process_get_builtin_module", - strategy: "throw", - reason: "process.getBuiltinModule allows loading native Node.js modules (fs, child_process, vm)" - }, - // Note: process.mainModule is handled specially in defense-in-depth-box.ts - // and worker-defense-in-depth.ts because it may be undefined in ESM contexts - // but we still want to block both reading and setting it. - // Process control vectors - { - prop: "exit", - target: process, - violationType: "process_exit", - strategy: "throw", - reason: "process.exit could terminate the interpreter" - }, - { - prop: "abort", - target: process, - violationType: "process_exit", - strategy: "throw", - reason: "process.abort could crash the interpreter" - }, - { - prop: "kill", - target: process, - violationType: "process_kill", - strategy: "throw", - reason: "process.kill could signal other processes" - }, - // Privilege escalation vectors - { - prop: "setuid", - target: process, - violationType: "process_setuid", - strategy: "throw", - reason: "process.setuid could escalate privileges" - }, - { - prop: "setgid", - target: process, - violationType: "process_setuid", - strategy: "throw", - reason: "process.setgid could escalate privileges" - }, - { - prop: "seteuid", - target: process, - violationType: "process_setuid", - strategy: "throw", - reason: "process.seteuid could escalate effective user privileges" - }, - { - prop: "setegid", - target: process, - violationType: "process_setuid", - strategy: "throw", - reason: "process.setegid could escalate effective group privileges" - }, - { - prop: "initgroups", - target: process, - violationType: "process_setuid", - strategy: "throw", - reason: "process.initgroups could modify supplementary group IDs" - }, - { - prop: "setgroups", - target: process, - violationType: "process_setuid", - strategy: "throw", - reason: "process.setgroups could modify supplementary group IDs" - }, - // File permission manipulation - { - prop: "umask", - target: process, - violationType: "process_umask", - strategy: "throw", - reason: "process.umask could modify file creation permissions" - }, - // Information disclosure vectors - // Note: process.argv is an array (object) so gets an object proxy - { - prop: "argv", - target: process, - violationType: "process_argv", - strategy: "throw", - reason: "process.argv may contain secrets in CLI arguments" - }, - // Note: process.execPath is a string primitive, handled specially - // in defense-in-depth-box.ts and worker-defense-in-depth.ts - // Note: process.connected is a boolean primitive, handled specially - // in defense-in-depth-box.ts and worker-defense-in-depth.ts - // Working directory access/manipulation - { - prop: "cwd", - target: process, - violationType: "process_chdir", - strategy: "throw", - reason: "process.cwd could disclose real host working directory path" - }, - { - prop: "chdir", - target: process, - violationType: "process_chdir", - strategy: "throw", - reason: "process.chdir could confuse the interpreter's CWD tracking" - }, - // Diagnostic report (leaks full environment, host paths, system info) - { - prop: "report", - target: process, - violationType: "process_report", - strategy: "throw", - reason: "process.report could disclose full environment, host paths, and system info" - }, - // Environment file loading (Node 21.7+) - { - prop: "loadEnvFile", - target: process, - violationType: "process_env", - strategy: "throw", - reason: "process.loadEnvFile could load env files bypassing env proxy" - }, - // Exception handler manipulation - { - prop: "setUncaughtExceptionCaptureCallback", - target: process, - violationType: "process_exception_handler", - strategy: "throw", - reason: "setUncaughtExceptionCaptureCallback could intercept security errors" - }, - // IPC communication vectors (may be undefined in non-IPC contexts) - { - prop: "send", - target: process, - violationType: "process_send", - strategy: "throw", - reason: "process.send could communicate with parent process in IPC contexts" - }, - { - prop: "channel", - target: process, - violationType: "process_channel", - strategy: "throw", - reason: "process.channel could access IPC channel to parent process" - }, - // Timing side-channel vectors - { - prop: "cpuUsage", - target: process, - violationType: "process_timing", - strategy: "throw", - reason: "process.cpuUsage could enable timing side-channel attacks" - }, - { - prop: "memoryUsage", - target: process, - violationType: "process_timing", - strategy: "throw", - reason: "process.memoryUsage could enable timing side-channel attacks" - }, - { - prop: "hrtime", - target: process, - violationType: "process_timing", - strategy: "throw", - reason: "process.hrtime could enable timing side-channel attacks" - }, - // We also don't block `require` because: - // 1. It may not exist in all environments (ESM) - // 2. import() is the modern escape vector and can't be blocked this way - // Reference leak vectors - { - prop: "WeakRef", - target: globalThis, - violationType: "weak_ref", - strategy: "throw", - reason: "WeakRef could be used to leak references outside sandbox" - }, - { - prop: "FinalizationRegistry", - target: globalThis, - violationType: "finalization_registry", - strategy: "throw", - reason: "FinalizationRegistry could be used to leak references outside sandbox" - }, - // Introspection/interception vectors (freeze instead of throw) - // SECURITY RATIONALE: Reflect is frozen (not blocked) because: - // 1. Defense infrastructure uses Reflect.apply/get/set/construct internally - // 2. Frozen Reflect cannot be mutated but remains fully functional - // 3. Reflect.construct(Function, ['code']) IS safe because globalThis.Function - // is replaced with a blocking proxy — Reflect.construct receives the proxy - // 4. Security depends on NEVER leaking original Function/eval references. - // If an unpatched Function ref leaked, Reflect.construct would bypass defense. - { - prop: "Reflect", - target: globalThis, - violationType: "reflect", - strategy: "freeze", - reason: "Reflect provides introspection capabilities" - }, - { - prop: "Proxy", - target: globalThis, - violationType: "proxy", - strategy: "throw", - reason: "Proxy allows intercepting and modifying object behavior" - }, - // WebAssembly allows arbitrary code execution - { - prop: "WebAssembly", - target: globalThis, - violationType: "webassembly", - strategy: "throw", - reason: "WebAssembly allows executing arbitrary compiled code" - }, - // SharedArrayBuffer and Atomics can enable side-channel attacks - { - prop: "SharedArrayBuffer", - target: globalThis, - violationType: "shared_array_buffer", - strategy: "throw", - reason: "SharedArrayBuffer could enable side-channel communication or timing attacks" - }, - { - prop: "Atomics", - target: globalThis, - violationType: "atomics", - strategy: "throw", - reason: "Atomics could enable side-channel communication or timing attacks" - }, - // Note: Error.prepareStackTrace is handled specially in defense-in-depth-box.ts - // because we only want to block SETTING it, not reading (V8 reads it internally) - // Timing side-channel: performance.now() provides sub-millisecond resolution - // Note: Date.now() is intentionally NOT blocked — it's used for $SECONDS, - // date command, and has only ~1ms resolution (vs process.hrtime at ns). - { - prop: "performance", - target: globalThis, - violationType: "performance_timing", - strategy: "throw", - reason: "performance.now() provides sub-millisecond timing for side-channel attacks" - }, - // Block direct access to process.stdout and process.stderr to prevent - // writing to the host's actual stdout/stderr, bypassing the interpreter's - // output accumulation. - { - prop: "stdout", - target: process, - violationType: "process_stdout", - strategy: "throw", - reason: "process.stdout could bypass interpreter output to write to host stdout" - }, - { - prop: "stderr", - target: process, - violationType: "process_stderr", - strategy: "throw", - reason: "process.stderr could bypass interpreter output to write to host stderr" - }, - // Prototype pollution vectors - { - prop: "__defineGetter__", - target: Object.prototype, - violationType: "prototype_mutation", - strategy: "throw", - reason: "__defineGetter__ allows prototype pollution via getter injection" - }, - { - prop: "__defineSetter__", - target: Object.prototype, - violationType: "prototype_mutation", - strategy: "throw", - reason: "__defineSetter__ allows prototype pollution via setter injection" - }, - { - prop: "__lookupGetter__", - target: Object.prototype, - violationType: "prototype_mutation", - strategy: "throw", - reason: "__lookupGetter__ enables introspection for prototype pollution attacks" - }, - { - prop: "__lookupSetter__", - target: Object.prototype, - violationType: "prototype_mutation", - strategy: "throw", - reason: "__lookupSetter__ enables introspection for prototype pollution attacks" - }, - // Freeze JSON and Math to prevent mutation of built-in utility objects - { - prop: "JSON", - target: globalThis, - violationType: "json_mutation", - strategy: "freeze", - reason: "Freeze JSON to prevent mutation of parsing/serialization" - }, - { - prop: "Math", - target: globalThis, - violationType: "math_mutation", - strategy: "freeze", - reason: "Freeze Math to prevent mutation of math utilities" - } - ]; - try { - const AsyncFunction = Object.getPrototypeOf(async () => { - }).constructor; - if (AsyncFunction && AsyncFunction !== Function) { - globals.push({ - prop: "constructor", - target: Object.getPrototypeOf(async () => { - }), - violationType: "async_function_constructor", - strategy: "throw", - reason: "AsyncFunction constructor allows arbitrary async code execution" - }); - } - } catch { - } - try { - const GeneratorFunction = Object.getPrototypeOf( - function* () { - } - ).constructor; - if (GeneratorFunction && GeneratorFunction !== Function) { - globals.push({ - prop: "constructor", - target: Object.getPrototypeOf(function* () { - }), - violationType: "generator_function_constructor", - strategy: "throw", - reason: "GeneratorFunction constructor allows arbitrary generator code execution" - }); - } - } catch { - } - try { - const AsyncGeneratorFunction = Object.getPrototypeOf( - async function* () { - } - ).constructor; - if (AsyncGeneratorFunction && AsyncGeneratorFunction !== Function && AsyncGeneratorFunction !== Object.getPrototypeOf(async () => { - }).constructor) { - globals.push({ - prop: "constructor", - target: Object.getPrototypeOf(async function* () { - }), - violationType: "async_generator_function_constructor", - strategy: "throw", - reason: "AsyncGeneratorFunction constructor allows arbitrary async generator code execution" - }); - } - } catch { - } - return globals.filter((g) => { - try { - return g.target[g.prop] !== void 0; - } catch { - return false; - } - }); -} - -// src/security/defense-in-depth-box.ts -var IS_BROWSER = typeof __BROWSER__ !== "undefined" && __BROWSER__; -var AsyncLocalStorageClass = null; -if (!IS_BROWSER) { - try { - const { AsyncLocalStorage } = __require("node:async_hooks"); - AsyncLocalStorageClass = AsyncLocalStorage; - } catch { - } -} -var executionContext = !IS_BROWSER && AsyncLocalStorageClass ? new AsyncLocalStorageClass() : null; - -// src/security/worker-defense-in-depth.ts -var DEFENSE_IN_DEPTH_NOTICE = "\n\nThis is a defense-in-depth measure and indicates a bug in just-bash. Please report this at security@vercel.com"; -var WorkerSecurityViolationError = class extends Error { - constructor(message, violation) { - super(message + DEFENSE_IN_DEPTH_NOTICE); - this.violation = violation; - this.name = "WorkerSecurityViolationError"; - } - violation; -}; -var MAX_STORED_VIOLATIONS = 1e3; -function generateExecutionId() { - if (typeof crypto !== "undefined" && crypto.randomUUID) { - return crypto.randomUUID(); - } - return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => { - const r = Math.random() * 16 | 0; - const v = c === "x" ? r : r & 3 | 8; - return v.toString(16); - }); -} -var WorkerDefenseInDepth = class { - config; - isActivated = false; - originalDescriptors = []; - violations = []; - executionId; - /** - * Original Proxy constructor, captured before patching. - * This is captured at instance creation time to ensure we get the unpatched version. - */ - originalProxy; - /** - * Recursion guard to prevent infinite loops when proxy traps trigger - * code that accesses the same proxied object (e.g., process.env). - */ - inTrap = false; - /** - * Create and activate the worker defense layer. - * - * @param config - Configuration for the defense layer - */ - constructor(config) { - this.originalProxy = Proxy; - this.config = config; - this.executionId = generateExecutionId(); - if (config.enabled !== false) { - this.activate(); - } - } - /** - * Get statistics about the defense layer. - */ - getStats() { - return { - violationsBlocked: this.violations.length, - violations: [...this.violations], - isActive: this.isActivated - }; - } - /** - * Clear stored violations. Useful for testing. - */ - clearViolations() { - this.violations = []; - } - /** - * Get the execution ID for this worker. - */ - getExecutionId() { - return this.executionId; - } - /** - * Deactivate the defense layer and restore original globals. - * Typically only needed for testing. - */ - deactivate() { - if (!this.isActivated) { - return; - } - this.restorePatches(); - this.isActivated = false; - } - /** - * Activate the defense layer by applying patches. - */ - activate() { - if (this.isActivated) { - return; - } - this.applyPatches(); - this.isActivated = true; - } - /** - * Get a human-readable path for a target object and property. - */ - getPathForTarget(target, prop) { - if (target === globalThis) { - return `globalThis.${prop}`; - } - if (typeof process !== "undefined" && target === process) { - return `process.${prop}`; - } - if (target === Error) { - return `Error.${prop}`; - } - if (target === Function.prototype) { - return `Function.prototype.${prop}`; - } - if (target === Object.prototype) { - return `Object.prototype.${prop}`; - } - return `.${prop}`; - } - /** - * Record a violation and invoke the callback. - * In worker context, blocking always happens (no audit mode context check). - */ - recordViolation(type, path, message) { - const violation = { - timestamp: Date.now(), - type, - message, - path, - stack: new Error().stack, - executionId: this.executionId - }; - if (this.violations.length < MAX_STORED_VIOLATIONS) { - this.violations.push(violation); - } - if (this.config.onViolation) { - try { - this.config.onViolation(violation); - } catch (e) { - console.debug( - "[WorkerDefenseInDepth] onViolation callback threw:", - e instanceof Error ? e.message : e - ); - } - } - return violation; - } - /** - * Create a blocking proxy for a function. - * In worker context, always blocks (no context check needed). - */ - createBlockingProxy(original, path, violationType) { - const self = this; - const auditMode = this.config.auditMode; - return new this.originalProxy(original, { - apply(target, thisArg, args) { - const message = `${path} is blocked in worker context`; - const violation = self.recordViolation(violationType, path, message); - if (!auditMode) { - throw new WorkerSecurityViolationError(message, violation); - } - return Reflect.apply(target, thisArg, args); - }, - construct(target, args, newTarget) { - const message = `${path} constructor is blocked in worker context`; - const violation = self.recordViolation(violationType, path, message); - if (!auditMode) { - throw new WorkerSecurityViolationError(message, violation); - } - return Reflect.construct(target, args, newTarget); - } - }); - } - /** - * Create a blocking proxy for an object (blocks all property access). - */ - createBlockingObjectProxy(original, path, violationType, allowedKeys) { - const self = this; - const auditMode = this.config.auditMode; - return new this.originalProxy(original, { - get(target, prop, receiver) { - if (self.inTrap) { - return Reflect.get(target, prop, receiver); - } - if (allowedKeys && typeof prop === "string" && allowedKeys.has(prop)) { - return Reflect.get(target, prop, receiver); - } - self.inTrap = true; - try { - const fullPath = `${path}.${String(prop)}`; - const message = `${fullPath} is blocked in worker context`; - const violation = self.recordViolation( - violationType, - fullPath, - message - ); - if (!auditMode) { - throw new WorkerSecurityViolationError(message, violation); - } - return Reflect.get(target, prop, receiver); - } finally { - self.inTrap = false; - } - }, - set(target, prop, value, receiver) { - const setValue = () => path === "process.env" && prop === "DEBUG" ? Reflect.set(target, prop, value) : Reflect.set(target, prop, value, receiver); - if (self.inTrap) { - return setValue(); - } - self.inTrap = true; - try { - const fullPath = `${path}.${String(prop)}`; - const message = `${fullPath} modification is blocked in worker context`; - const violation = self.recordViolation( - violationType, - fullPath, - message - ); - if (!auditMode) { - throw new WorkerSecurityViolationError(message, violation); - } - return setValue(); - } finally { - self.inTrap = false; - } - }, - ownKeys(target) { - if (self.inTrap) { - return Reflect.ownKeys(target); - } - self.inTrap = true; - try { - const message = `${path} enumeration is blocked in worker context`; - const violation = self.recordViolation(violationType, path, message); - if (!auditMode) { - throw new WorkerSecurityViolationError(message, violation); - } - return Reflect.ownKeys(target); - } finally { - self.inTrap = false; - } - }, - getOwnPropertyDescriptor(target, prop) { - if (self.inTrap) { - return Reflect.getOwnPropertyDescriptor(target, prop); - } - self.inTrap = true; - try { - const fullPath = `${path}.${String(prop)}`; - const message = `${fullPath} descriptor access is blocked in worker context`; - const violation = self.recordViolation( - violationType, - fullPath, - message - ); - if (!auditMode) { - throw new WorkerSecurityViolationError(message, violation); - } - return Reflect.getOwnPropertyDescriptor(target, prop); - } finally { - self.inTrap = false; - } - }, - has(target, prop) { - if (self.inTrap) { - return Reflect.has(target, prop); - } - self.inTrap = true; - try { - const fullPath = `${path}.${String(prop)}`; - const message = `${fullPath} existence check is blocked in worker context`; - const violation = self.recordViolation( - violationType, - fullPath, - message - ); - if (!auditMode) { - throw new WorkerSecurityViolationError(message, violation); - } - return Reflect.has(target, prop); - } finally { - self.inTrap = false; - } - }, - deleteProperty(target, prop) { - if (self.inTrap) { - return Reflect.deleteProperty(target, prop); - } - self.inTrap = true; - try { - const fullPath = `${path}.${String(prop)}`; - const message = `${fullPath} deletion is blocked in worker context`; - const violation = self.recordViolation( - violationType, - fullPath, - message - ); - if (!auditMode) { - throw new WorkerSecurityViolationError(message, violation); - } - return Reflect.deleteProperty(target, prop); - } finally { - self.inTrap = false; - } - }, - setPrototypeOf(target, proto) { - if (self.inTrap) { - return Reflect.setPrototypeOf(target, proto); - } - self.inTrap = true; - try { - const message = `${path} setPrototypeOf is blocked in worker context`; - const violation = self.recordViolation(violationType, path, message); - if (!auditMode) { - throw new WorkerSecurityViolationError(message, violation); - } - return Reflect.setPrototypeOf(target, proto); - } finally { - self.inTrap = false; - } - }, - defineProperty(target, prop, descriptor) { - if (self.inTrap) { - return Reflect.defineProperty(target, prop, descriptor); - } - self.inTrap = true; - try { - const fullPath = `${path}.${String(prop)}`; - const message = `${fullPath} defineProperty is blocked in worker context`; - const violation = self.recordViolation( - violationType, - fullPath, - message - ); - if (!auditMode) { - throw new WorkerSecurityViolationError(message, violation); - } - return Reflect.defineProperty(target, prop, descriptor); - } finally { - self.inTrap = false; - } - } - }); - } - /** - * Apply security patches to dangerous globals. - */ - applyPatches() { - const blockedGlobals = getBlockedGlobals(); - const excludeTypes = new Set(this.config.excludeViolationTypes ?? []); - for (const blocked of blockedGlobals) { - if (excludeTypes.has(blocked.violationType)) { - continue; - } - this.applyPatch(blocked); - } - if (!excludeTypes.has("function_constructor")) { - this.protectConstructorChain(excludeTypes); - } - if (!excludeTypes.has("error_prepare_stack_trace")) { - this.protectErrorPrepareStackTrace(); - } - if (!excludeTypes.has("module_load")) { - this.protectModuleLoad(); - } - if (!excludeTypes.has("module_resolve_filename")) { - this.protectModuleResolveFilename(); - } - if (!excludeTypes.has("process_main_module")) { - this.protectProcessMainModule(); - } - if (!excludeTypes.has("process_exec_path")) { - this.protectProcessExecPath(); - } - if (!excludeTypes.has("process_connected")) { - this.protectProcessConnected(); - } - this.lockWellKnownSymbols(); - if (!excludeTypes.has("proxy")) { - this.protectProxyRevocable(); - } - } - /** - * Lock well-known Symbol properties on built-in constructors/prototypes. - */ - lockWellKnownSymbols() { - const lock = (obj, sym) => { - try { - const desc = Object.getOwnPropertyDescriptor(obj, sym); - if (desc?.configurable) { - if ("value" in desc) { - Object.defineProperty(obj, sym, { - ...desc, - configurable: false, - writable: false - }); - return; - } - Object.defineProperty(obj, sym, { ...desc, configurable: false }); - } - } catch { - } - }; - for (const ctor of [Array, Map, Set, RegExp, Promise]) { - lock(ctor, Symbol.species); - } - for (const proto of [ - Array.prototype, - String.prototype, - Map.prototype, - Set.prototype - ]) { - lock(proto, Symbol.iterator); - } - lock(Symbol.prototype, Symbol.toPrimitive); - lock(Date.prototype, Symbol.toPrimitive); - for (const sym of [ - Symbol.match, - Symbol.matchAll, - Symbol.replace, - Symbol.search, - Symbol.split - ]) { - lock(RegExp.prototype, sym); - } - lock(Function.prototype, Symbol.hasInstance); - lock(Array.prototype, Symbol.unscopables); - for (const proto of [ - Map.prototype, - Set.prototype, - Promise.prototype, - ArrayBuffer.prototype - ]) { - lock(proto, Symbol.toStringTag); - } - try { - const stackDesc = Object.getOwnPropertyDescriptor( - Error, - "stackTraceLimit" - ); - this.originalDescriptors.push({ - target: Error, - prop: "stackTraceLimit", - descriptor: stackDesc - }); - Object.defineProperty(Error, "stackTraceLimit", { - value: Error.stackTraceLimit, - writable: false, - configurable: true - }); - } catch { - } - } - /** - * Block Proxy.revocable to prevent bypassing Proxy constructor blocking. - * - * Proxy.revocable internally uses the real Proxy constructor, so it bypasses - * our blocking proxy on globalThis.Proxy. We replace it with a wrapper that - * always blocks in worker context. - */ - protectProxyRevocable() { - const self = this; - const auditMode = this.config.auditMode; - try { - const originalRevocable = this.originalProxy.revocable; - if (typeof originalRevocable !== "function") return; - const descriptor = Object.getOwnPropertyDescriptor( - this.originalProxy, - "revocable" - ); - this.originalDescriptors.push({ - target: this.originalProxy, - prop: "revocable", - descriptor - }); - Object.defineProperty(this.originalProxy, "revocable", { - value: function revocable(_target, _handler) { - const message = "Proxy.revocable is blocked in worker context"; - const violation = self.recordViolation( - "proxy", - "Proxy.revocable", - message - ); - if (!auditMode) { - throw new WorkerSecurityViolationError(message, violation); - } - return originalRevocable(_target, _handler); - }, - writable: false, - configurable: true - // Must be configurable for restoration - }); - } catch { - } - } - /** - * Protect against .constructor.constructor escape vector. - * @param excludeTypes - Set of violation types to skip - */ - protectConstructorChain(excludeTypes) { - let AsyncFunction = null; - let GeneratorFunction = null; - let AsyncGeneratorFunction = null; - try { - AsyncFunction = Object.getPrototypeOf(async () => { - }).constructor; - } catch { - } - try { - GeneratorFunction = Object.getPrototypeOf(function* () { - }).constructor; - } catch { - } - try { - AsyncGeneratorFunction = Object.getPrototypeOf( - async function* () { - } - ).constructor; - } catch { - } - this.patchPrototypeConstructor( - Function.prototype, - "Function.prototype.constructor", - "function_constructor" - ); - if (!excludeTypes.has("async_function_constructor") && AsyncFunction && AsyncFunction !== Function) { - this.patchPrototypeConstructor( - AsyncFunction.prototype, - "AsyncFunction.prototype.constructor", - "async_function_constructor" - ); - } - if (!excludeTypes.has("generator_function_constructor") && GeneratorFunction && GeneratorFunction !== Function) { - this.patchPrototypeConstructor( - GeneratorFunction.prototype, - "GeneratorFunction.prototype.constructor", - "generator_function_constructor" - ); - } - if (!excludeTypes.has("async_generator_function_constructor") && AsyncGeneratorFunction && AsyncGeneratorFunction !== Function && AsyncGeneratorFunction !== AsyncFunction) { - this.patchPrototypeConstructor( - AsyncGeneratorFunction.prototype, - "AsyncGeneratorFunction.prototype.constructor", - "async_generator_function_constructor" - ); - } - } - /** - * Protect Error.prepareStackTrace from being set. - */ - protectErrorPrepareStackTrace() { - const self = this; - const auditMode = this.config.auditMode; - try { - const originalDescriptor = Object.getOwnPropertyDescriptor( - Error, - "prepareStackTrace" - ); - this.originalDescriptors.push({ - target: Error, - prop: "prepareStackTrace", - descriptor: originalDescriptor - }); - let currentValue = originalDescriptor?.value; - Object.defineProperty(Error, "prepareStackTrace", { - get() { - return currentValue; - }, - set(value) { - const message = "Error.prepareStackTrace modification is blocked in worker context"; - const violation = self.recordViolation( - "error_prepare_stack_trace", - "Error.prepareStackTrace", - message - ); - if (!auditMode) { - throw new WorkerSecurityViolationError(message, violation); - } - currentValue = value; - }, - configurable: true - }); - } catch { - } - } - /** - * Patch a prototype's constructor property. - * - * Returns a proxy that allows reading properties (like .name) but blocks - * calling the constructor as a function (which would allow code execution). - */ - patchPrototypeConstructor(prototype, path, violationType) { - const self = this; - const auditMode = this.config.auditMode; - try { - const originalDescriptor = Object.getOwnPropertyDescriptor( - prototype, - "constructor" - ); - this.originalDescriptors.push({ - target: prototype, - prop: "constructor", - descriptor: originalDescriptor - }); - const originalValue = originalDescriptor?.value; - const constructorProxy = originalValue && typeof originalValue === "function" ? new this.originalProxy(originalValue, { - apply(_target, _thisArg, _args) { - const message = `${path} invocation is blocked in worker context`; - const violation = self.recordViolation( - violationType, - path, - message - ); - if (!auditMode) { - throw new WorkerSecurityViolationError(message, violation); - } - return void 0; - }, - construct(_target, _args, _newTarget) { - const message = `${path} construction is blocked in worker context`; - const violation = self.recordViolation( - violationType, - path, - message - ); - if (!auditMode) { - throw new WorkerSecurityViolationError(message, violation); - } - return {}; - }, - // Allow all property access (like .name, .prototype, etc.) - get(target, prop, receiver) { - return Reflect.get(target, prop, receiver); - }, - getPrototypeOf(target) { - return Reflect.getPrototypeOf(target); - }, - has(target, prop) { - return Reflect.has(target, prop); - }, - ownKeys(target) { - return Reflect.ownKeys(target); - }, - getOwnPropertyDescriptor(target, prop) { - return Reflect.getOwnPropertyDescriptor(target, prop); - } - }) : originalValue; - Object.defineProperty(prototype, "constructor", { - get() { - return constructorProxy; - }, - set(value) { - const message = `${path} modification is blocked in worker context`; - const violation = self.recordViolation(violationType, path, message); - if (!auditMode) { - throw new WorkerSecurityViolationError(message, violation); - } - Object.defineProperty(this, "constructor", { - value, - writable: true, - configurable: true - }); - }, - configurable: true - }); - } catch { - } - } - /** - * Protect process.mainModule from being accessed or set. - * - * The attack vector is: - * ``` - * process.mainModule.require('child_process').execSync('whoami') - * process.mainModule.constructor._load('vm') - * ``` - * - * process.mainModule may be undefined in ESM contexts but could exist in - * CommonJS workers. We block both reading and setting. - */ - protectProcessMainModule() { - if (typeof process === "undefined") return; - const self = this; - const auditMode = this.config.auditMode; - try { - const originalDescriptor = Object.getOwnPropertyDescriptor( - process, - "mainModule" - ); - this.originalDescriptors.push({ - target: process, - prop: "mainModule", - descriptor: originalDescriptor - }); - const currentValue = originalDescriptor?.value; - if (currentValue !== void 0) { - Object.defineProperty(process, "mainModule", { - get() { - const message = "process.mainModule access is blocked in worker context"; - const violation = self.recordViolation( - "process_main_module", - "process.mainModule", - message - ); - if (!auditMode) { - throw new WorkerSecurityViolationError(message, violation); - } - return currentValue; - }, - set(value) { - const message = "process.mainModule modification is blocked in worker context"; - const violation = self.recordViolation( - "process_main_module", - "process.mainModule", - message - ); - if (!auditMode) { - throw new WorkerSecurityViolationError(message, violation); - } - Object.defineProperty(process, "mainModule", { - value, - writable: true, - configurable: true - }); - }, - configurable: true - }); - } - } catch { - } - } - /** - * Protect process.execPath from being read or set in worker context. - * - * process.execPath is a string primitive (not an object), so it cannot be - * proxied via the normal blocked globals mechanism. We use Object.defineProperty - * with getter/setter (same pattern as protectProcessMainModule). - */ - protectProcessExecPath() { - if (typeof process === "undefined") return; - const self = this; - const auditMode = this.config.auditMode; - try { - const originalDescriptor = Object.getOwnPropertyDescriptor( - process, - "execPath" - ); - this.originalDescriptors.push({ - target: process, - prop: "execPath", - descriptor: originalDescriptor - }); - const currentValue = originalDescriptor?.value ?? process.execPath; - Object.defineProperty(process, "execPath", { - get() { - const message = "process.execPath access is blocked in worker context"; - const violation = self.recordViolation( - "process_exec_path", - "process.execPath", - message - ); - if (!auditMode) { - throw new WorkerSecurityViolationError(message, violation); - } - return currentValue; - }, - set(value) { - const message = "process.execPath modification is blocked in worker context"; - const violation = self.recordViolation( - "process_exec_path", - "process.execPath", - message - ); - if (!auditMode) { - throw new WorkerSecurityViolationError(message, violation); - } - Object.defineProperty(process, "execPath", { - value, - writable: true, - configurable: true - }); - }, - configurable: true - }); - } catch { - } - } - /** - * Protect process.connected from being read or set in worker context. - * - * process.connected is a boolean primitive (not an object), so it cannot be - * proxied via the normal blocked globals mechanism. We use Object.defineProperty - * with getter/setter (same pattern as protectProcessExecPath). - * - * Only protects if process.connected exists (IPC contexts). - */ - protectProcessConnected() { - if (typeof process === "undefined") return; - if (process.connected === void 0) return; - const self = this; - const auditMode = this.config.auditMode; - try { - const originalDescriptor = Object.getOwnPropertyDescriptor( - process, - "connected" - ); - this.originalDescriptors.push({ - target: process, - prop: "connected", - descriptor: originalDescriptor - }); - const currentValue = originalDescriptor?.value ?? process.connected; - Object.defineProperty(process, "connected", { - get() { - const message = "process.connected access is blocked in worker context"; - const violation = self.recordViolation( - "process_connected", - "process.connected", - message - ); - if (!auditMode) { - throw new WorkerSecurityViolationError(message, violation); - } - return currentValue; - }, - set(value) { - const message = "process.connected modification is blocked in worker context"; - const violation = self.recordViolation( - "process_connected", - "process.connected", - message - ); - if (!auditMode) { - throw new WorkerSecurityViolationError(message, violation); - } - Object.defineProperty(process, "connected", { - value, - writable: true, - configurable: true - }); - }, - configurable: true - }); - } catch { - } - } - /** - * Protect Module._load from being called. - * - * The attack vector is: - * ``` - * module.constructor._load('child_process') - * require.main.constructor._load('vm') - * ``` - * - * We access the Module class and replace _load with a blocking proxy. - */ - protectModuleLoad() { - const self = this; - const auditMode = this.config.auditMode; - try { - let ModuleClass = null; - if (typeof process !== "undefined") { - const mainModule = process.mainModule; - if (mainModule && typeof mainModule === "object") { - ModuleClass = mainModule.constructor; - } - } - if (!ModuleClass && typeof __require !== "undefined" && typeof __require.main !== "undefined") { - ModuleClass = __require.main.constructor; - } - if (!ModuleClass || typeof ModuleClass._load !== "function") { - return; - } - const original = ModuleClass._load; - const descriptor = Object.getOwnPropertyDescriptor(ModuleClass, "_load"); - this.originalDescriptors.push({ - target: ModuleClass, - prop: "_load", - descriptor - }); - const path = "Module._load"; - const proxy = new this.originalProxy(original, { - apply(_target, _thisArg, _args) { - const message = `${path} is blocked in worker context`; - const violation = self.recordViolation("module_load", path, message); - if (!auditMode) { - throw new WorkerSecurityViolationError(message, violation); - } - return Reflect.apply(_target, _thisArg, _args); - } - }); - Object.defineProperty(ModuleClass, "_load", { - value: proxy, - writable: true, - configurable: true - }); - } catch { - } - } - /** - * Protect Module._resolveFilename from being called in worker context. - * - * Module._resolveFilename is called for both require() and import() resolution. - * Blocking it catches file-based import() specifiers. - * - * data: and blob: URLs are handled by ESM loader hooks registered - * in the main thread (DefenseInDepthBox.protectDynamicImport). - */ - protectModuleResolveFilename() { - const self = this; - const auditMode = this.config.auditMode; - try { - let ModuleClass = null; - if (typeof process !== "undefined") { - const mainModule = process.mainModule; - if (mainModule && typeof mainModule === "object") { - ModuleClass = mainModule.constructor; - } - } - if (!ModuleClass && typeof __require !== "undefined" && typeof __require.main !== "undefined") { - ModuleClass = __require.main.constructor; - } - if (!ModuleClass || typeof ModuleClass._resolveFilename !== "function") { - return; - } - const original = ModuleClass._resolveFilename; - const descriptor = Object.getOwnPropertyDescriptor( - ModuleClass, - "_resolveFilename" - ); - this.originalDescriptors.push({ - target: ModuleClass, - prop: "_resolveFilename", - descriptor - }); - const path = "Module._resolveFilename"; - const proxy = new this.originalProxy(original, { - apply(_target, _thisArg, _args) { - const message = `${path} is blocked in worker context`; - const violation = self.recordViolation( - "module_resolve_filename", - path, - message - ); - if (!auditMode) { - throw new WorkerSecurityViolationError(message, violation); - } - return Reflect.apply(_target, _thisArg, _args); - } - }); - Object.defineProperty(ModuleClass, "_resolveFilename", { - value: proxy, - writable: true, - configurable: true - }); - } catch { - } - } - /** - * Apply a single patch to a blocked global. - */ - applyPatch(blocked) { - const { target, prop, violationType, strategy } = blocked; - try { - const original = target[prop]; - if (original === void 0) { - return; - } - const descriptor = Object.getOwnPropertyDescriptor(target, prop); - this.originalDescriptors.push({ target, prop, descriptor }); - if (strategy === "freeze") { - if (typeof original === "object" && original !== null) { - Object.freeze(original); - } - } else { - const path = this.getPathForTarget(target, prop); - const proxy = typeof original === "function" ? this.createBlockingProxy( - original, - path, - violationType - ) : this.createBlockingObjectProxy( - original, - path, - violationType, - blocked.allowedKeys - ); - Object.defineProperty(target, prop, { - value: proxy, - writable: true, - configurable: true - }); - } - } catch { - } - } - /** - * Restore all original values. - */ - restorePatches() { - for (let i = this.originalDescriptors.length - 1; i >= 0; i--) { - const { target, prop, descriptor } = this.originalDescriptors[i]; - try { - if (descriptor) { - Object.defineProperty(target, prop, descriptor); - } else { - delete target[prop]; - } - } catch { - } - } - this.originalDescriptors = []; - } -}; - -// src/security/trusted-globals.ts -var _SharedArrayBuffer = globalThis.SharedArrayBuffer; -var _Atomics = globalThis.Atomics; -var _performanceNow = performance.now.bind(performance); -var _Headers = globalThis.Headers; - -// src/commands/worker-bridge/protocol.ts -var OpCode = { - NOOP: 0, - READ_FILE: 1, - WRITE_FILE: 2, - STAT: 3, - READDIR: 4, - MKDIR: 5, - RM: 6, - EXISTS: 7, - APPEND_FILE: 8, - SYMLINK: 9, - READLINK: 10, - LSTAT: 11, - CHMOD: 12, - REALPATH: 13, - RENAME: 14, - COPY_FILE: 15, - // Special operations for I/O - WRITE_STDOUT: 100, - WRITE_STDERR: 101, - EXIT: 102, - // HTTP operations - HTTP_REQUEST: 200, - // Sub-shell execution - EXEC_COMMAND: 300, - // Tool invocation (executor mode) - INVOKE_TOOL: 400 -}; -var Status = { - PENDING: 0, - READY: 1, - SUCCESS: 2, - ERROR: 3 -}; -var ErrorCode = { - NONE: 0, - NOT_FOUND: 1, - IS_DIRECTORY: 2, - NOT_DIRECTORY: 3, - EXISTS: 4, - PERMISSION_DENIED: 5, - INVALID_PATH: 6, - IO_ERROR: 7, - TIMEOUT: 8, - NETWORK_ERROR: 9, - NETWORK_NOT_CONFIGURED: 10 -}; -var Offset = { - OP_CODE: 0, - STATUS: 4, - PATH_LENGTH: 8, - DATA_LENGTH: 12, - RESULT_LENGTH: 16, - ERROR_CODE: 20, - FLAGS: 24, - MODE: 28, - PATH_BUFFER: 32, - DATA_BUFFER: 4128 - // 32 + 4096 -}; -var Size = { - CONTROL_REGION: 32, - PATH_BUFFER: 4096, - // 8MB limit for FS read/write, HTTP responses, and tool invocation results. - // Sized to handle typical OpenAPI/GraphQL responses (paginated lists, batch queries). - // Still well under the 64MB QuickJS memory limit per execution. - DATA_BUFFER: 8388608, - TOTAL: 8392736 - // 32 + 4096 + 8MB -}; -var Flags = { - NONE: 0, - RECURSIVE: 1, - FORCE: 2, - MKDIR_RECURSIVE: 1 -}; -var StatLayout = { - IS_FILE: 0, - IS_DIRECTORY: 1, - IS_SYMLINK: 2, - MODE: 4, - SIZE: 8, - MTIME: 16, - TOTAL: 24 -}; -var ProtocolBuffer = class { - int32View; - uint8View; - dataView; - constructor(buffer) { - this.int32View = new Int32Array(buffer); - this.uint8View = new Uint8Array(buffer); - this.dataView = new DataView(buffer); - } - getOpCode() { - return _Atomics.load(this.int32View, Offset.OP_CODE / 4); - } - setOpCode(code) { - _Atomics.store(this.int32View, Offset.OP_CODE / 4, code); - } - getStatus() { - return _Atomics.load(this.int32View, Offset.STATUS / 4); - } - setStatus(status) { - _Atomics.store(this.int32View, Offset.STATUS / 4, status); - } - getPathLength() { - return _Atomics.load(this.int32View, Offset.PATH_LENGTH / 4); - } - setPathLength(length) { - _Atomics.store(this.int32View, Offset.PATH_LENGTH / 4, length); - } - getDataLength() { - return _Atomics.load(this.int32View, Offset.DATA_LENGTH / 4); - } - setDataLength(length) { - _Atomics.store(this.int32View, Offset.DATA_LENGTH / 4, length); - } - getResultLength() { - return _Atomics.load(this.int32View, Offset.RESULT_LENGTH / 4); - } - setResultLength(length) { - _Atomics.store(this.int32View, Offset.RESULT_LENGTH / 4, length); - } - getErrorCode() { - return _Atomics.load( - this.int32View, - Offset.ERROR_CODE / 4 - ); - } - setErrorCode(code) { - _Atomics.store(this.int32View, Offset.ERROR_CODE / 4, code); - } - getFlags() { - return _Atomics.load(this.int32View, Offset.FLAGS / 4); - } - setFlags(flags) { - _Atomics.store(this.int32View, Offset.FLAGS / 4, flags); - } - getMode() { - return _Atomics.load(this.int32View, Offset.MODE / 4); - } - setMode(mode) { - _Atomics.store(this.int32View, Offset.MODE / 4, mode); - } - getPath() { - const length = this.getPathLength(); - const bytes = this.uint8View.slice( - Offset.PATH_BUFFER, - Offset.PATH_BUFFER + length - ); - return new TextDecoder().decode(bytes); - } - setPath(path) { - const encoded = new TextEncoder().encode(path); - if (encoded.length > Size.PATH_BUFFER) { - throw new Error(`Path too long: ${encoded.length} > ${Size.PATH_BUFFER}`); - } - this.uint8View.set(encoded, Offset.PATH_BUFFER); - this.setPathLength(encoded.length); - } - getData() { - const length = this.getDataLength(); - return this.uint8View.slice( - Offset.DATA_BUFFER, - Offset.DATA_BUFFER + length - ); - } - setData(data) { - if (data.length > Size.DATA_BUFFER) { - throw new Error(`Data too large: ${data.length} > ${Size.DATA_BUFFER}`); - } - this.uint8View.set(data, Offset.DATA_BUFFER); - this.setDataLength(data.length); - } - getDataAsString() { - const data = this.getData(); - return new TextDecoder().decode(data); - } - setDataFromString(str) { - const encoded = new TextEncoder().encode(str); - this.setData(encoded); - } - getResult() { - const length = this.getResultLength(); - return this.uint8View.slice( - Offset.DATA_BUFFER, - Offset.DATA_BUFFER + length - ); - } - setResult(data) { - if (data.length > Size.DATA_BUFFER) { - throw new Error(`Result too large: ${data.length} > ${Size.DATA_BUFFER}`); - } - this.uint8View.set(data, Offset.DATA_BUFFER); - this.setResultLength(data.length); - } - getResultAsString() { - const result = this.getResult(); - return new TextDecoder().decode(result); - } - setResultFromString(str) { - const encoded = new TextEncoder().encode(str); - this.setResult(encoded); - } - encodeStat(stat) { - this.uint8View[Offset.DATA_BUFFER + StatLayout.IS_FILE] = stat.isFile ? 1 : 0; - this.uint8View[Offset.DATA_BUFFER + StatLayout.IS_DIRECTORY] = stat.isDirectory ? 1 : 0; - this.uint8View[Offset.DATA_BUFFER + StatLayout.IS_SYMLINK] = stat.isSymbolicLink ? 1 : 0; - this.dataView.setInt32( - Offset.DATA_BUFFER + StatLayout.MODE, - stat.mode, - true - ); - const size = Math.min(stat.size, Number.MAX_SAFE_INTEGER); - this.dataView.setFloat64(Offset.DATA_BUFFER + StatLayout.SIZE, size, true); - this.dataView.setFloat64( - Offset.DATA_BUFFER + StatLayout.MTIME, - stat.mtime.getTime(), - true - ); - this.setResultLength(StatLayout.TOTAL); - } - decodeStat() { - return { - isFile: this.uint8View[Offset.DATA_BUFFER + StatLayout.IS_FILE] === 1, - isDirectory: this.uint8View[Offset.DATA_BUFFER + StatLayout.IS_DIRECTORY] === 1, - isSymbolicLink: this.uint8View[Offset.DATA_BUFFER + StatLayout.IS_SYMLINK] === 1, - mode: this.dataView.getInt32(Offset.DATA_BUFFER + StatLayout.MODE, true), - size: this.dataView.getFloat64( - Offset.DATA_BUFFER + StatLayout.SIZE, - true - ), - mtime: new Date( - this.dataView.getFloat64(Offset.DATA_BUFFER + StatLayout.MTIME, true) - ) - }; - } - waitForReady(timeout) { - return _Atomics.wait( - this.int32View, - Offset.STATUS / 4, - Status.PENDING, - timeout - ); - } - waitForReadyAsync(timeout) { - return _Atomics.waitAsync( - this.int32View, - Offset.STATUS / 4, - Status.PENDING, - timeout - ); - } - /** - * Wait for status to become READY. - * Returns immediately if status is already READY, or waits until it changes. - */ - async waitUntilReady(timeout) { - const startTime = Date.now(); - while (true) { - const status = this.getStatus(); - if (status === Status.READY) { - return true; - } - const elapsed = Date.now() - startTime; - if (elapsed >= timeout) { - return false; - } - const remainingMs = timeout - elapsed; - const result = _Atomics.waitAsync( - this.int32View, - Offset.STATUS / 4, - status, - remainingMs - ); - if (result.async) { - const waitResult = await result.value; - if (waitResult === "timed-out") { - return false; - } - } - } - } - waitForResult(timeout) { - return _Atomics.wait( - this.int32View, - Offset.STATUS / 4, - Status.READY, - timeout - ); - } - notify() { - return _Atomics.notify(this.int32View, Offset.STATUS / 4); - } - reset() { - this.setOpCode(OpCode.NOOP); - this.setStatus(Status.PENDING); - this.setPathLength(0); - this.setDataLength(0); - this.setResultLength(0); - this.setErrorCode(ErrorCode.NONE); - this.setFlags(Flags.NONE); - this.setMode(0); - } -}; - -// src/commands/worker-bridge/sync-backend.ts -var SyncBackend = class { - protocol; - operationTimeoutMs; - constructor(sharedBuffer, operationTimeoutMs = 3e4) { - this.protocol = new ProtocolBuffer(sharedBuffer); - this.operationTimeoutMs = operationTimeoutMs; - } - execSync(opCode, path, data, flags = 0, mode = 0) { - this.protocol.reset(); - this.protocol.setOpCode(opCode); - this.protocol.setPath(path); - this.protocol.setFlags(flags); - this.protocol.setMode(mode); - if (data) { - this.protocol.setData(data); - } - this.protocol.setStatus(Status.READY); - this.protocol.notify(); - const waitResult = this.protocol.waitForResult(this.operationTimeoutMs); - if (waitResult === "timed-out") { - return { success: false, error: "Operation timed out" }; - } - const status = this.protocol.getStatus(); - if (status === Status.SUCCESS) { - return { success: true, result: this.protocol.getResult() }; - } - return { - success: false, - error: this.protocol.getResultAsString() || `Error code: ${this.protocol.getErrorCode()}` - }; - } - readFile(path) { - const result = this.execSync(OpCode.READ_FILE, path); - if (!result.success) { - throw new Error(result.error || "Failed to read file"); - } - return result.result ?? new Uint8Array(0); - } - writeFile(path, data) { - const result = this.execSync(OpCode.WRITE_FILE, path, data); - if (!result.success) { - throw new Error(result.error || "Failed to write file"); - } - } - stat(path) { - const result = this.execSync(OpCode.STAT, path); - if (!result.success) { - throw new Error(result.error || "Failed to stat"); - } - return this.protocol.decodeStat(); - } - lstat(path) { - const result = this.execSync(OpCode.LSTAT, path); - if (!result.success) { - throw new Error(result.error || "Failed to lstat"); - } - return this.protocol.decodeStat(); - } - readdir(path) { - const result = this.execSync(OpCode.READDIR, path); - if (!result.success) { - throw new Error(result.error || "Failed to readdir"); - } - return JSON.parse(this.protocol.getResultAsString()); - } - mkdir(path, recursive = false) { - const flags = recursive ? Flags.MKDIR_RECURSIVE : 0; - const result = this.execSync(OpCode.MKDIR, path, void 0, flags); - if (!result.success) { - throw new Error(result.error || "Failed to mkdir"); - } - } - rm(path, recursive = false, force = false) { - let flags = 0; - if (recursive) flags |= Flags.RECURSIVE; - if (force) flags |= Flags.FORCE; - const result = this.execSync(OpCode.RM, path, void 0, flags); - if (!result.success) { - throw new Error(result.error || "Failed to rm"); - } - } - exists(path) { - const result = this.execSync(OpCode.EXISTS, path); - if (!result.success) { - return false; - } - return result.result?.[0] === 1; - } - appendFile(path, data) { - const result = this.execSync(OpCode.APPEND_FILE, path, data); - if (!result.success) { - throw new Error(result.error || "Failed to append file"); - } - } - symlink(target, linkPath) { - const targetData = new TextEncoder().encode(target); - const result = this.execSync(OpCode.SYMLINK, linkPath, targetData); - if (!result.success) { - throw new Error(result.error || "Failed to symlink"); - } - } - readlink(path) { - const result = this.execSync(OpCode.READLINK, path); - if (!result.success) { - throw new Error(result.error || "Failed to readlink"); - } - return this.protocol.getResultAsString(); - } - chmod(path, mode) { - const result = this.execSync(OpCode.CHMOD, path, void 0, 0, mode); - if (!result.success) { - throw new Error(result.error || "Failed to chmod"); - } - } - realpath(path) { - const result = this.execSync(OpCode.REALPATH, path); - if (!result.success) { - throw new Error(result.error || "Failed to realpath"); - } - return this.protocol.getResultAsString(); - } - rename(oldPath, newPath) { - const newPathData = new TextEncoder().encode(newPath); - const result = this.execSync(OpCode.RENAME, oldPath, newPathData); - if (!result.success) { - throw new Error(result.error || "Failed to rename"); - } - } - copyFile(src, dest) { - const destData = new TextEncoder().encode(dest); - const result = this.execSync(OpCode.COPY_FILE, src, destData); - if (!result.success) { - throw new Error(result.error || "Failed to copyFile"); - } - } - writeStdout(data) { - const encoded = new TextEncoder().encode(data); - const result = this.execSync(OpCode.WRITE_STDOUT, "", encoded); - if (!result.success) { - throw new Error(result.error || "Failed to write stdout"); - } - } - writeStderr(data) { - const encoded = new TextEncoder().encode(data); - const result = this.execSync(OpCode.WRITE_STDERR, "", encoded); - if (!result.success) { - throw new Error(result.error || "Failed to write stderr"); - } - } - exit(code) { - this.execSync(OpCode.EXIT, "", void 0, code); - } - /** - * Make an HTTP request through the main thread's secureFetch. - * Returns the response as a parsed object. - */ - httpRequest(url, options) { - const requestData = options ? new TextEncoder().encode(JSON.stringify(options)) : void 0; - const result = this.execSync(OpCode.HTTP_REQUEST, url, requestData); - if (!result.success) { - throw new Error(result.error || "HTTP request failed"); - } - const responseJson = new TextDecoder().decode(result.result); - const parsed = JSON.parse(responseJson); - const bodyBase64 = parsed.bodyBase64 ?? ""; - const body = atob(bodyBase64); - return { - status: parsed.status, - statusText: parsed.statusText, - headers: parsed.headers, - url: parsed.url, - body, - bodyBase64 - }; - } - /** - * Execute a shell command through the main thread's exec function. - * Returns the result as { stdout, stderr, exitCode }. - */ - execCommand(command, stdin) { - const requestData = stdin ? new TextEncoder().encode(JSON.stringify({ stdin })) : void 0; - const result = this.execSync(OpCode.EXEC_COMMAND, command, requestData); - if (!result.success) { - throw new Error(result.error || "Command execution failed"); - } - const responseJson = new TextDecoder().decode(result.result); - return JSON.parse(responseJson); - } - /** - * Execute a shell command with structured args (shell-escaped on the main thread). - * Prevents command injection from unsanitized args. - */ - execCommandArgs(command, args) { - const requestData = new TextEncoder().encode(JSON.stringify({ args })); - const result = this.execSync(OpCode.EXEC_COMMAND, command, requestData); - if (!result.success) { - throw new Error(result.error || "Command execution failed"); - } - const responseJson = new TextDecoder().decode(result.result); - return JSON.parse(responseJson); - } - /** - * Invoke a tool through the main thread's invokeTool hook. - * Returns the JSON-serialized result. - */ - invokeTool(path, argsJson) { - const requestData = argsJson ? new TextEncoder().encode(argsJson) : void 0; - const result = this.execSync(OpCode.INVOKE_TOOL, path, requestData); - if (!result.success) { - throw new Error(result.error || "Tool invocation failed"); - } - return new TextDecoder().decode(result.result); - } -}; - -// src/commands/js-exec/fetch-polyfill.ts -var FETCH_POLYFILL_SOURCE = ` -(function() { - // --- URLSearchParams --- - function URLSearchParams(init) { - this._entries = []; - if (!init) return; - if (typeof init === 'string') { - var s = init; - if (s.charAt(0) === '?') s = s.slice(1); - var pairs = s.split('&'); - for (var i = 0; i < pairs.length; i++) { - var pair = pairs[i]; - if (pair === '') continue; - var eq = pair.indexOf('='); - if (eq === -1) { - this._entries.push([decodeURIComponent(pair), '']); - } else { - this._entries.push([ - decodeURIComponent(pair.slice(0, eq)), - decodeURIComponent(pair.slice(eq + 1)) - ]); - } - } - } else if (typeof init === 'object' && init !== null) { - if (init instanceof URLSearchParams) { - this._entries = init._entries.slice(); - } else { - var keys = Object.keys(init); - for (var i = 0; i < keys.length; i++) { - this._entries.push([keys[i], String(init[keys[i]])]); - } - } - } - } - - URLSearchParams.prototype.append = function(name, value) { - this._entries.push([String(name), String(value)]); - }; - - URLSearchParams.prototype.delete = function(name) { - var n = String(name); - this._entries = this._entries.filter(function(e) { return e[0] !== n; }); - }; - - URLSearchParams.prototype.get = function(name) { - var n = String(name); - for (var i = 0; i < this._entries.length; i++) { - if (this._entries[i][0] === n) return this._entries[i][1]; - } - return null; - }; - - URLSearchParams.prototype.getAll = function(name) { - var n = String(name); - var result = []; - for (var i = 0; i < this._entries.length; i++) { - if (this._entries[i][0] === n) result.push(this._entries[i][1]); - } - return result; - }; - - URLSearchParams.prototype.has = function(name) { - var n = String(name); - for (var i = 0; i < this._entries.length; i++) { - if (this._entries[i][0] === n) return true; - } - return false; - }; - - URLSearchParams.prototype.set = function(name, value) { - var n = String(name); - var v = String(value); - var found = false; - var newEntries = []; - for (var i = 0; i < this._entries.length; i++) { - if (this._entries[i][0] === n) { - if (!found) { - newEntries.push([n, v]); - found = true; - } - } else { - newEntries.push(this._entries[i]); - } - } - if (!found) newEntries.push([n, v]); - this._entries = newEntries; - }; - - URLSearchParams.prototype.sort = function() { - this._entries.sort(function(a, b) { - if (a[0] < b[0]) return -1; - if (a[0] > b[0]) return 1; - return 0; - }); - }; - - URLSearchParams.prototype.toString = function() { - return this._entries.map(function(e) { - return encodeURIComponent(e[0]) + '=' + encodeURIComponent(e[1]); - }).join('&'); - }; - - URLSearchParams.prototype.forEach = function(callback, thisArg) { - for (var i = 0; i < this._entries.length; i++) { - callback.call(thisArg, this._entries[i][1], this._entries[i][0], this); - } - }; - - URLSearchParams.prototype.entries = function() { - var idx = 0; - var entries = this._entries; - return { - next: function() { - if (idx >= entries.length) return { done: true, value: undefined }; - return { done: false, value: entries[idx++].slice() }; - }, - [Symbol.iterator]: function() { return this; } - }; - }; - - URLSearchParams.prototype.keys = function() { - var idx = 0; - var entries = this._entries; - return { - next: function() { - if (idx >= entries.length) return { done: true, value: undefined }; - return { done: false, value: entries[idx++][0] }; - }, - [Symbol.iterator]: function() { return this; } - }; - }; - - URLSearchParams.prototype.values = function() { - var idx = 0; - var entries = this._entries; - return { - next: function() { - if (idx >= entries.length) return { done: true, value: undefined }; - return { done: false, value: entries[idx++][1] }; - }, - [Symbol.iterator]: function() { return this; } - }; - }; - - URLSearchParams.prototype[Symbol.iterator] = URLSearchParams.prototype.entries; - - Object.defineProperty(URLSearchParams.prototype, 'size', { - get: function() { return this._entries.length; } - }); - - // --- URL --- - var urlRegex = /^([a-zA-Z][a-zA-Z0-9+.-]*):(?:\\/\\/(?:([^:@/?#]*)(?::([^@/?#]*))?@)?([^:/?#]*)(?::([0-9]+))?)?(\\/[^?#]*)?(?:\\?([^#]*))?(?:#(.*))?$/; - - function URL(url, base) { - var input = String(url); - - if (base !== undefined) { - var baseUrl = (base instanceof URL) ? base : new URL(String(base)); - // Resolve relative URL against base - if (/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(input)) { - // Absolute URL - parse as-is - } else if (input.charAt(0) === '/' && input.charAt(1) === '/') { - // Protocol-relative - input = baseUrl.protocol + input; - } else if (input.charAt(0) === '/') { - // Absolute path - input = baseUrl.origin + input; - } else if (input.charAt(0) === '?' || input.charAt(0) === '#') { - // Query or hash only - var basePath = baseUrl.protocol + '//' + baseUrl.host + baseUrl.pathname; - if (input.charAt(0) === '#') { - input = basePath + baseUrl.search + input; - } else { - input = basePath + input; - } - } else { - // Relative path - var basePath = baseUrl.protocol + '//' + baseUrl.host; - var dirPath = baseUrl.pathname; - var lastSlash = dirPath.lastIndexOf('/'); - if (lastSlash >= 0) dirPath = dirPath.slice(0, lastSlash + 1); - else dirPath = '/'; - input = basePath + dirPath + input; - } - } - - var m = urlRegex.exec(input); - if (!m) throw new TypeError("Invalid URL: " + String(url)); - - this.protocol = m[1].toLowerCase() + ':'; - this.username = m[2] ? decodeURIComponent(m[2]) : ''; - this.password = m[3] ? decodeURIComponent(m[3]) : ''; - this.hostname = m[4] || ''; - this.port = m[5] || ''; - this.pathname = m[6] || '/'; - this.hash = m[8] ? '#' + m[8] : ''; - - // Normalize pathname (resolve . and ..) - var parts = this.pathname.split('/'); - var resolved = []; - for (var i = 0; i < parts.length; i++) { - if (parts[i] === '..') { if (resolved.length > 1) resolved.pop(); } - else if (parts[i] !== '.') resolved.push(parts[i]); - } - this.pathname = resolved.join('/') || '/'; - - // searchParams is live - this._searchParamsStr = m[7] || ''; - this.searchParams = new URLSearchParams(this._searchParamsStr); - } - - Object.defineProperty(URL.prototype, 'search', { - get: function() { - var s = this.searchParams.toString(); - return s ? '?' + s : ''; - }, - set: function(v) { - this.searchParams = new URLSearchParams(String(v)); - } - }); - - Object.defineProperty(URL.prototype, 'host', { - get: function() { - return this.port ? this.hostname + ':' + this.port : this.hostname; - } - }); - - Object.defineProperty(URL.prototype, 'origin', { - get: function() { - return this.protocol + '//' + this.host; - } - }); - - Object.defineProperty(URL.prototype, 'href', { - get: function() { - var auth = ''; - if (this.username) { - auth = this.username; - if (this.password) auth += ':' + this.password; - auth += '@'; - } - return this.protocol + '//' + auth + this.host + this.pathname + this.search + this.hash; - }, - set: function(v) { - var parsed = new URL(String(v)); - this.protocol = parsed.protocol; - this.username = parsed.username; - this.password = parsed.password; - this.hostname = parsed.hostname; - this.port = parsed.port; - this.pathname = parsed.pathname; - this.searchParams = parsed.searchParams; - this.hash = parsed.hash; - } - }); - - URL.prototype.toString = function() { return this.href; }; - URL.prototype.toJSON = function() { return this.href; }; - - // --- Headers --- - function Headers(init) { - this._map = {}; - if (!init) return; - if (init instanceof Headers) { - var keys = Object.keys(init._map); - for (var i = 0; i < keys.length; i++) { - this._map[keys[i]] = init._map[keys[i]].slice(); - } - } else if (typeof init === 'object') { - var keys = Object.keys(init); - for (var i = 0; i < keys.length; i++) { - this._map[keys[i].toLowerCase()] = [String(init[keys[i]])]; - } - } - } - - Headers.prototype.append = function(name, value) { - var key = String(name).toLowerCase(); - if (!this._map[key]) this._map[key] = []; - this._map[key].push(String(value)); - }; - - Headers.prototype.delete = function(name) { - delete this._map[String(name).toLowerCase()]; - }; - - Headers.prototype.get = function(name) { - var vals = this._map[String(name).toLowerCase()]; - return vals ? vals.join(', ') : null; - }; - - Headers.prototype.has = function(name) { - return String(name).toLowerCase() in this._map; - }; - - Headers.prototype.set = function(name, value) { - this._map[String(name).toLowerCase()] = [String(value)]; - }; - - Headers.prototype.forEach = function(callback, thisArg) { - var keys = Object.keys(this._map).sort(); - for (var i = 0; i < keys.length; i++) { - callback.call(thisArg, this._map[keys[i]].join(', '), keys[i], this); - } - }; - - Headers.prototype.entries = function() { - var keys = Object.keys(this._map).sort(); - var map = this._map; - var idx = 0; - return { - next: function() { - if (idx >= keys.length) return { done: true, value: undefined }; - var k = keys[idx++]; - return { done: false, value: [k, map[k].join(', ')] }; - }, - [Symbol.iterator]: function() { return this; } - }; - }; - - Headers.prototype.keys = function() { - var keys = Object.keys(this._map).sort(); - var idx = 0; - return { - next: function() { - if (idx >= keys.length) return { done: true, value: undefined }; - return { done: false, value: keys[idx++] }; - }, - [Symbol.iterator]: function() { return this; } - }; - }; - - Headers.prototype.values = function() { - var keys = Object.keys(this._map).sort(); - var map = this._map; - var idx = 0; - return { - next: function() { - if (idx >= keys.length) return { done: true, value: undefined }; - return { done: false, value: map[keys[idx++]].join(', ') }; - }, - [Symbol.iterator]: function() { return this; } - }; - }; - - Headers.prototype[Symbol.iterator] = Headers.prototype.entries; - - // --- Response --- - function Response(body, init) { - if (init === undefined) init = {}; - this.status = init.status !== undefined ? init.status : 200; - this.statusText = init.statusText !== undefined ? init.statusText : ''; - this.headers = init.headers instanceof Headers ? init.headers : new Headers(init.headers); - this.body = body !== undefined && body !== null ? String(body) : ''; - this.ok = this.status >= 200 && this.status <= 299; - this.url = ''; - this.redirected = false; - this.type = 'basic'; - this.bodyUsed = false; - } - - Response.prototype.text = function() { - this.bodyUsed = true; - return Promise.resolve(this.body); - }; - - Response.prototype.json = function() { - this.bodyUsed = true; - try { - return Promise.resolve(JSON.parse(this.body)); - } catch (e) { - return Promise.reject(e); - } - }; - - Response.prototype.clone = function() { - var r = new Response(this.body, { - status: this.status, - statusText: this.statusText, - headers: new Headers(this.headers) - }); - r.url = this.url; - r.redirected = this.redirected; - r.type = this.type; - return r; - }; - - Response.json = function(data, init) { - if (init === undefined) init = {}; - var headers = init.headers instanceof Headers ? init.headers : new Headers(init.headers); - if (!headers.has('content-type')) { - headers.set('content-type', 'application/json'); - } - return new Response(JSON.stringify(data), { - status: init.status !== undefined ? init.status : 200, - statusText: init.statusText || '', - headers: headers - }); - }; - - Response.error = function() { - var r = new Response(null, { status: 0, statusText: '' }); - r.type = 'error'; - r.ok = false; - return r; - }; - - Response.redirect = function(url, status) { - if (status === undefined) status = 302; - var r = new Response(null, { - status: status, - statusText: '', - headers: new Headers({ location: String(url) }) - }); - r.redirected = true; - return r; - }; - - // --- Request --- - function Request(input, init) { - if (init === undefined) init = {}; - if (input instanceof Request) { - this.url = input.url; - this.method = input.method; - this.headers = new Headers(input.headers); - this.body = input.body; - } else { - this.url = String(input); - this.method = 'GET'; - this.headers = new Headers(); - this.body = null; - } - if (init.method !== undefined) this.method = String(init.method).toUpperCase(); - if (init.headers !== undefined) this.headers = init.headers instanceof Headers ? init.headers : new Headers(init.headers); - if (init.body !== undefined) this.body = init.body !== null ? String(init.body) : null; - } - - Request.prototype.clone = function() { - return new Request(this); - }; - - // --- Assign to globalThis --- - globalThis.URLSearchParams = URLSearchParams; - globalThis.URL = URL; - globalThis.Headers = Headers; - globalThis.Response = Response; - globalThis.Request = Request; - - // --- Wrap native fetch --- - var _nativeFetch = globalThis[Symbol.for('jb:fetch')]; - globalThis.fetch = function fetch(input, init) { - try { - var url, method, headers, body; - - if (input instanceof Request) { - url = input.url; - method = input.method; - headers = {}; - input.headers.forEach(function(v, k) { headers[k] = v; }); - body = input.body; - } else { - url = String(input); - method = undefined; - headers = undefined; - body = undefined; - } - - if (init) { - if (init.method !== undefined) method = String(init.method).toUpperCase(); - if (init.headers !== undefined) { - var h = init.headers instanceof Headers ? init.headers : new Headers(init.headers); - headers = {}; - h.forEach(function(v, k) { headers[k] = v; }); - } - if (init.body !== undefined) body = init.body !== null ? String(init.body) : undefined; - } - - var opts = Object.create(null); - if (method) opts.method = method; - if (headers) opts.headers = headers; - if (body) opts.body = body; - - var raw = _nativeFetch(url, opts); - - var respHeaders = new Headers(raw.headers || {}); - var response = new Response(raw.body, { - status: raw.status, - statusText: raw.statusText || '', - headers: respHeaders - }); - response.url = raw.url || url; - - return Promise.resolve(response); - } catch (e) { - return Promise.reject(new TypeError(e.message || 'fetch failed')); - } - }; -})(); -`; - -// src/commands/js-exec/module-shims.ts -var EVENTS_MODULE_SOURCE = ` -var EventEmitter = (function() { - function EE() { - this._events = {}; - this._maxListeners = 10; - } - EE.prototype.on = function(event, listener) { - if (!this._events[event]) this._events[event] = []; - this._events[event].push(listener); - return this; - }; - EE.prototype.addListener = EE.prototype.on; - EE.prototype.once = function(event, listener) { - var self = this; - function wrapper() { - self.removeListener(event, wrapper); - listener.apply(this, arguments); - } - wrapper._original = listener; - return this.on(event, wrapper); - }; - EE.prototype.off = function(event, listener) { - return this.removeListener(event, listener); - }; - EE.prototype.removeListener = function(event, listener) { - var list = this._events[event]; - if (list) { - this._events[event] = list.filter(function(fn) { - return fn !== listener && fn._original !== listener; - }); - } - return this; - }; - EE.prototype.removeAllListeners = function(event) { - if (event) delete this._events[event]; - else this._events = {}; - return this; - }; - EE.prototype.emit = function(event) { - var list = this._events[event]; - if (!list || list.length === 0) return false; - var args = Array.prototype.slice.call(arguments, 1); - var fns = list.slice(); - for (var i = 0; i < fns.length; i++) fns[i].apply(this, args); - return true; - }; - EE.prototype.listeners = function(event) { - return (this._events[event] || []).slice(); - }; - EE.prototype.listenerCount = function(event) { - return (this._events[event] || []).length; - }; - EE.prototype.setMaxListeners = function(n) { - this._maxListeners = n; - return this; - }; - EE.prototype.eventNames = function() { - return Object.keys(this._events); - }; - EE.prototype.prependListener = function(event, listener) { - if (!this._events[event]) this._events[event] = []; - this._events[event].unshift(listener); - return this; - }; - return EE; -})(); -globalThis[Symbol.for('jb:events')] = { EventEmitter: EventEmitter }; -`; -var OS_MODULE_SOURCE = ` -var _os = { - platform: function() { return globalThis.process.platform; }, - arch: function() { return globalThis.process.arch; }, - homedir: function() { return '/home/user'; }, - tmpdir: function() { return '/tmp'; }, - type: function() { return 'Linux'; }, - hostname: function() { return 'sandbox'; }, - EOL: '\\n', - cpus: function() { return []; }, - totalmem: function() { return 0; }, - freemem: function() { return 0; }, - endianness: function() { return 'LE'; } -}; -globalThis[Symbol.for('jb:os')] = _os; -`; -var URL_MODULE_SOURCE = ` -var _urlMod = { - URL: globalThis.URL, - URLSearchParams: globalThis.URLSearchParams, - parse: function(urlStr) { - try { - var u = new URL(urlStr); - return { - protocol: u.protocol, host: u.host, hostname: u.hostname, - port: u.port, pathname: u.pathname, search: u.search, - hash: u.hash, href: u.href, path: u.pathname + u.search - }; - } catch(e) { - return { - protocol: null, host: null, hostname: null, port: null, - pathname: urlStr, search: '', hash: '', href: urlStr, path: urlStr - }; - } - }, - format: function(obj) { - if (typeof obj === 'string') return obj; - if (obj instanceof URL) return obj.href; - var auth = obj.auth ? obj.auth + '@' : ''; - var host = obj.host || ((obj.hostname || '') + (obj.port ? ':' + obj.port : '')); - return (obj.protocol ? obj.protocol + '//' : '') + auth + host + - (obj.pathname || '/') + (obj.search || '') + (obj.hash || ''); - } -}; -globalThis[Symbol.for('jb:url')] = _urlMod; -`; -var ASSERT_MODULE_SOURCE = ` -var _deepEqual = function(a, b) { - if (a === b) return true; - if (a === null || b === null || typeof a !== 'object' || typeof b !== 'object') return false; - if (Array.isArray(a) !== Array.isArray(b)) return false; - var ka = Object.keys(a), kb = Object.keys(b); - if (ka.length !== kb.length) return false; - for (var i = 0; i < ka.length; i++) { - if (!_deepEqual(a[ka[i]], b[ka[i]])) return false; - } - return true; -}; -var _assert = function(val, msg) { - if (!val) throw new Error(msg || 'AssertionError: expected truthy value'); -}; -_assert.ok = _assert; -_assert.equal = function(a, b, msg) { - if (a != b) throw new Error(msg || 'AssertionError: ' + a + ' != ' + b); -}; -_assert.notEqual = function(a, b, msg) { - if (a == b) throw new Error(msg || 'AssertionError: ' + a + ' == ' + b); -}; -_assert.strictEqual = function(a, b, msg) { - if (a !== b) throw new Error(msg || 'AssertionError: ' + a + ' !== ' + b); -}; -_assert.notStrictEqual = function(a, b, msg) { - if (a === b) throw new Error(msg || 'AssertionError: ' + a + ' === ' + b); -}; -_assert.deepEqual = function(a, b, msg) { - if (!_deepEqual(a, b)) throw new Error(msg || 'AssertionError: objects not deep equal'); -}; -_assert.deepStrictEqual = _assert.deepEqual; -_assert.notDeepEqual = function(a, b, msg) { - if (_deepEqual(a, b)) throw new Error(msg || 'AssertionError: objects are deep equal'); -}; -_assert.throws = function(fn, expected, msg) { - var threw = false; - try { fn(); } catch(e) { - threw = true; - if (expected instanceof RegExp && !expected.test(e.message)) - throw new Error(msg || 'AssertionError: error message did not match'); - } - if (!threw) throw new Error(msg || 'AssertionError: function did not throw'); -}; -_assert.doesNotThrow = function(fn, msg) { - // @banned-pattern-ignore: sandbox-internal assertion helper; e.message is from user code inside QuickJS, not host details - try { fn(); } catch(e) { - throw new Error(msg || 'AssertionError: function threw: ' + e.message); - } -}; -_assert.fail = function(msg) { - throw new Error(msg || 'AssertionError: assert.fail()'); -}; -globalThis[Symbol.for('jb:assert')] = _assert; -`; -var UTIL_MODULE_SOURCE = ` -var _util = { - format: function() { - var args = Array.prototype.slice.call(arguments); - if (args.length === 0) return ''; - var fmt = args[0]; - if (typeof fmt !== 'string') { - return args.map(function(a) { - return typeof a === 'string' ? a : JSON.stringify(a); - }).join(' '); - } - var i = 1; - var str = fmt.replace(/%[sdjifoO%]/g, function(m) { - if (m === '%%') return '%'; - if (i >= args.length) return m; - var v = args[i++]; - if (m === '%s') return String(v); - if (m === '%d') return Number(v).toString(); - if (m === '%i') { var n = Number(v); return (isNaN(n) ? 'NaN' : Math.trunc(n)).toString(); } - if (m === '%j') return JSON.stringify(v); - if (m === '%f') return parseFloat(v).toString(); - if (m === '%o' || m === '%O') return JSON.stringify(v); - return m; - }); - while (i < args.length) { - str += ' ' + (typeof args[i] === 'string' ? args[i] : JSON.stringify(args[i])); - i++; - } - return str; - }, - inspect: function(obj, opts) { - if (obj === null) return 'null'; - if (obj === undefined) return 'undefined'; - if (typeof obj === 'string') return "'" + obj + "'"; - if (typeof obj === 'function') return '[Function: ' + (obj.name || 'anonymous') + ']'; - var seen = []; - try { - return JSON.stringify(obj, function(key, val) { - if (typeof val === 'object' && val !== null) { - if (seen.indexOf(val) !== -1) return '[Circular]'; - seen.push(val); - } - return val; - }); - } catch(e) { return String(obj); } - }, - promisify: function(fn) { - return function() { - var args = Array.prototype.slice.call(arguments); - return new Promise(function(resolve, reject) { - args.push(function(err, val) { if (err) reject(err); else resolve(val); }); - fn.apply(null, args); - }); - }; - }, - types: { - isDate: function(v) { return v instanceof Date; }, - isRegExp: function(v) { return v instanceof RegExp; }, - isArray: function(v) { return Array.isArray(v); }, - isMap: function(v) { return typeof Map !== 'undefined' && v instanceof Map; }, - isSet: function(v) { return typeof Set !== 'undefined' && v instanceof Set; } - }, - inherits: function(ctor, superCtor) { - ctor.prototype = Object.create(superCtor.prototype); - ctor.prototype.constructor = ctor; - } -}; -globalThis[Symbol.for('jb:util')] = _util; -`; -var BUFFER_MODULE_SOURCE = ` -function _utf8Encode(str) { - var bytes = []; - for (var i = 0; i < str.length; i++) { - var c = str.charCodeAt(i); - if (c < 0x80) { - bytes.push(c); - } else if (c < 0x800) { - bytes.push(0xC0 | (c >> 6), 0x80 | (c & 0x3F)); - } else if (c >= 0xD800 && c <= 0xDBFF && i + 1 < str.length) { - var lo = str.charCodeAt(++i); - var cp = ((c - 0xD800) * 0x400) + (lo - 0xDC00) + 0x10000; - bytes.push(0xF0 | (cp >> 18), 0x80 | ((cp >> 12) & 0x3F), 0x80 | ((cp >> 6) & 0x3F), 0x80 | (cp & 0x3F)); - } else { - bytes.push(0xE0 | (c >> 12), 0x80 | ((c >> 6) & 0x3F), 0x80 | (c & 0x3F)); - } - } - return bytes; -} -function _utf8Decode(bytes) { - var str = ''; - var i = 0; - while (i < bytes.length) { - var b = bytes[i]; - if (b < 0x80) { str += String.fromCharCode(b); i++; } - else if ((b & 0xE0) === 0xC0) { str += String.fromCharCode(((b & 0x1F) << 6) | (bytes[i+1] & 0x3F)); i += 2; } - else if ((b & 0xF0) === 0xE0) { str += String.fromCharCode(((b & 0x0F) << 12) | ((bytes[i+1] & 0x3F) << 6) | (bytes[i+2] & 0x3F)); i += 3; } - else if ((b & 0xF8) === 0xF0) { var cp = ((b & 0x07) << 18) | ((bytes[i+1] & 0x3F) << 12) | ((bytes[i+2] & 0x3F) << 6) | (bytes[i+3] & 0x3F); cp -= 0x10000; str += String.fromCharCode((cp >> 10) + 0xD800, (cp & 0x3FF) + 0xDC00); i += 4; } - else { i++; } - } - return str; -} -// _utf8Encode/_utf8Decode are IIFE-local vars, available to all module shims -// IMPORTANT: round-trip tests (encode then decode) mask broken encodings -// because both sides become no-ops. Encoding tests MUST assert the encoded -// constant directly. -function _normEnc(enc) { - if (enc === undefined || enc === null) return 'utf8'; - var e = String(enc).toLowerCase(); - if (e === 'utf8' || e === 'utf-8') return 'utf8'; - if (e === 'utf16le' || e === 'utf-16le' || e === 'ucs2' || e === 'ucs-2') return 'utf16le'; - if (e === 'latin1' || e === 'binary') return 'latin1'; - if (e === 'ascii') return 'ascii'; - if (e === 'base64') return 'base64'; - if (e === 'base64url') return 'base64url'; - if (e === 'hex') return 'hex'; - return undefined; -} -function _badEnc(enc) { - throw new TypeError("Unknown encoding: " + enc); -} -var _HEX = '0123456789abcdef'; -function _hexEncode(bytes) { - var s = ''; - for (var i = 0; i < bytes.length; i++) { - var b = bytes[i] & 0xff; - s += _HEX.charAt(b >> 4) + _HEX.charAt(b & 0x0f); - } - return s; -} -function _hexDecode(str) { - var out = []; - for (var i = 0; i + 1 < str.length; i += 2) { - var hi = _hexVal(str.charCodeAt(i)); - var lo = _hexVal(str.charCodeAt(i + 1)); - if (hi < 0 || lo < 0) break; - out.push((hi << 4) | lo); - } - return out; -} -function _hexVal(c) { - if (c >= 48 && c <= 57) return c - 48; - if (c >= 97 && c <= 102) return c - 87; - if (c >= 65 && c <= 70) return c - 55; - return -1; -} -function _rawEncode(str) { - var out = new Array(str.length); - for (var i = 0; i < str.length; i++) out[i] = str.charCodeAt(i) & 0xff; - return out; -} -function _latin1Decode(bytes) { - var s = ''; - for (var i = 0; i < bytes.length; i++) s += String.fromCharCode(bytes[i] & 0xff); - return s; -} -function _asciiDecode(bytes) { - var s = ''; - for (var i = 0; i < bytes.length; i++) s += String.fromCharCode(bytes[i] & 0x7f); - return s; -} -function _utf16leEncode(str) { - var out = new Array(str.length * 2); - for (var i = 0; i < str.length; i++) { - var c = str.charCodeAt(i); - out[i * 2] = c & 0xff; - out[i * 2 + 1] = (c >> 8) & 0xff; - } - return out; -} -function _utf16leDecode(bytes) { - var s = ''; - var end = bytes.length & ~1; - for (var i = 0; i < end; i += 2) { - s += String.fromCharCode(bytes[i] | (bytes[i + 1] << 8)); - } - return s; -} -var _B64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; -var _B64DEC = null; -function _b64DecTable() { - if (_B64DEC) return _B64DEC; - var t = new Array(256); - for (var i = 0; i < 256; i++) t[i] = -1; - for (var j = 0; j < 64; j++) t[_B64.charCodeAt(j)] = j; - t[45] = 62; - t[95] = 63; - _B64DEC = t; - return t; -} -function _b64Encode(bytes) { - var s = ''; - var i = 0, len = bytes.length; - while (i + 2 < len) { - var n = (bytes[i] << 16) | (bytes[i + 1] << 8) | bytes[i + 2]; - s += _B64.charAt((n >> 18) & 63) + _B64.charAt((n >> 12) & 63) - + _B64.charAt((n >> 6) & 63) + _B64.charAt(n & 63); - i += 3; - } - var rem = len - i; - if (rem === 1) { - var n1 = bytes[i] << 16; - s += _B64.charAt((n1 >> 18) & 63) + _B64.charAt((n1 >> 12) & 63) + '=='; - } else if (rem === 2) { - var n2 = (bytes[i] << 16) | (bytes[i + 1] << 8); - s += _B64.charAt((n2 >> 18) & 63) + _B64.charAt((n2 >> 12) & 63) - + _B64.charAt((n2 >> 6) & 63) + '='; - } - return s; -} -function _b64UrlEncode(bytes) { - var s = _b64Encode(bytes); - return s.replace(/=+$/, '').replace(/\\+/g, '-').replace(/\\//g, '_'); -} -function _b64Decode(str) { - var t = _b64DecTable(); - var out = []; - var buf = 0, bits = 0; - for (var i = 0; i < str.length; i++) { - var c = str.charCodeAt(i); - if (c === 61) break; - var v = c < 256 ? t[c] : -1; - if (v < 0) continue; - buf = (buf << 6) | v; - bits += 6; - if (bits >= 8) { - bits -= 8; - out.push((buf >> bits) & 0xff); - } - } - return out; -} - -function Buffer(arg) { - if (typeof arg === 'number') { - this._data = new Uint8Array(arg); - } else if (arg instanceof ArrayBuffer) { - this._data = new Uint8Array(arg); - } else if (arg instanceof Uint8Array) { - this._data = new Uint8Array(arg); - } else if (Array.isArray(arg)) { - this._data = new Uint8Array(arg); - } else { - this._data = new Uint8Array(0); - } - this.length = this._data.length; -} -Buffer.from = function(data, encoding) { - if (typeof data === 'string') { - var enc = _normEnc(encoding); - if (enc === undefined) _badEnc(encoding); - if (enc === 'utf8') return new Buffer(_utf8Encode(data)); - if (enc === 'utf16le') return new Buffer(_utf16leEncode(data)); - if (enc === 'latin1') return new Buffer(_rawEncode(data)); - if (enc === 'ascii') return new Buffer(_rawEncode(data)); - if (enc === 'hex') return new Buffer(_hexDecode(data)); - if (enc === 'base64' || enc === 'base64url') return new Buffer(_b64Decode(data)); - } - if (data instanceof ArrayBuffer) { - var off = typeof encoding === 'number' ? encoding : 0; - var len = arguments.length > 2 ? arguments[2] : undefined; - var view = len === undefined ? new Uint8Array(data, off) : new Uint8Array(data, off, len); - var buf = Object.create(Buffer.prototype); - buf._data = view; - buf.length = view.length; - return buf; - } - if (data instanceof Uint8Array) return new Buffer(data); - if (Array.isArray(data)) return new Buffer(data); - if (data && data._data) return new Buffer(data._data.slice()); - return new Buffer(0); -}; -Buffer.alloc = function(size, fill) { - var buf = new Buffer(size); - if (fill !== undefined) { - var fillByte = typeof fill === 'number' ? fill : 0; - buf._data.fill(fillByte); - } - return buf; -}; -Buffer.allocUnsafe = Buffer.alloc; -Buffer.isBuffer = function(obj) { return obj instanceof Buffer; }; -Buffer.concat = function(list, totalLength) { - if (!totalLength) { - totalLength = 0; - for (var i = 0; i < list.length; i++) totalLength += list[i].length; - } - var result = new Uint8Array(totalLength); - var offset = 0; - for (var i = 0; i < list.length; i++) { - result.set(list[i]._data, offset); - offset += list[i].length; - } - return new Buffer(result); -}; -Buffer.byteLength = function(value, encoding) { - if (typeof value !== 'string') { - if (value && value._data) return value._data.length; - if (value instanceof Uint8Array || value instanceof ArrayBuffer) { - return value.byteLength; - } - throw new TypeError('The "string" argument must be of type string or an instance of Buffer or ArrayBuffer. Received type ' + typeof value + ' (' + value + ')'); - } - var enc = _normEnc(encoding); - if (enc === undefined) _badEnc(encoding); - if (enc === 'utf8') return _utf8Encode(value).length; - if (enc === 'utf16le') return value.length * 2; - if (enc === 'latin1' || enc === 'ascii') return value.length; - if (enc === 'hex') return (value.length / 2) | 0; - if (enc === 'base64' || enc === 'base64url') { - var clean = value.replace(/[^A-Za-z0-9+/=_-]/g, '').replace(/=+$/, ''); - return Math.floor(clean.length * 3 / 4); - } -}; -Buffer.prototype.toString = function(encoding, start, end) { - var bytes = this._data; - if (start !== undefined || end !== undefined) { - var len = bytes.length; - var s = start === undefined ? 0 : (start < 0 ? 0 : (start > len ? len : start | 0)); - var e = end === undefined ? len : (end < 0 ? 0 : (end > len ? len : end | 0)); - bytes = e <= s ? bytes.subarray(0, 0) : bytes.subarray(s, e); - } - var enc = _normEnc(encoding); - if (enc === undefined) _badEnc(encoding); - if (enc === 'utf8') return _utf8Decode(bytes); - if (enc === 'utf16le') return _utf16leDecode(bytes); - if (enc === 'latin1') return _latin1Decode(bytes); - if (enc === 'ascii') return _asciiDecode(bytes); - if (enc === 'hex') return _hexEncode(bytes); - if (enc === 'base64') return _b64Encode(bytes); - if (enc === 'base64url') return _b64UrlEncode(bytes); -}; -Buffer.prototype.toJSON = function() { - return { type: 'Buffer', data: Array.from(this._data) }; -}; -Buffer.prototype.slice = function(start, end) { - return new Buffer(this._data.slice(start, end)); -}; -Buffer.prototype.copy = function(target, targetStart, sourceStart, sourceEnd) { - targetStart = targetStart || 0; - sourceStart = sourceStart || 0; - sourceEnd = sourceEnd || this.length; - var sub = this._data.subarray(sourceStart, sourceEnd); - target._data.set(sub, targetStart); - return sub.length; -}; -Buffer.prototype.write = function(str, offset, length, encoding) { - if (typeof offset === 'string') { encoding = offset; offset = 0; length = undefined; } - else if (typeof length === 'string') { encoding = length; length = undefined; } - offset = offset | 0; - if (offset < 0 || offset > this._data.length) { - throw new RangeError('The value of "offset" is out of range. It must be >= 0 && <= ' + this._data.length + '. Received ' + offset); - } - var enc = _normEnc(encoding); - if (enc === undefined) _badEnc(encoding); - var bytes; - if (enc === 'utf8') bytes = _utf8Encode(str); - else if (enc === 'utf16le') bytes = _utf16leEncode(str); - else if (enc === 'latin1') bytes = _rawEncode(str); - else if (enc === 'ascii') bytes = _rawEncode(str); - else if (enc === 'hex') bytes = _hexDecode(str); - else bytes = _b64Decode(str); - var max = this._data.length - offset; - if (length !== undefined) { - length = length | 0; - if (length < 0 || length > this._data.length) { - throw new RangeError('The value of "length" is out of range. It must be >= 0 && <= ' + this._data.length + '. Received ' + length); - } - } - var write = Math.min(length === undefined ? max : length, bytes.length, max); - for (var i = 0; i < write; i++) this._data[offset + i] = bytes[i]; - return write; -}; -Buffer.prototype.fill = function(val, offset, end) { - this._data.fill(typeof val === 'number' ? val : 0, offset, end); - return this; -}; -Buffer.prototype.equals = function(other) { - if (this.length !== other.length) return false; - for (var i = 0; i < this.length; i++) { - if (this._data[i] !== other._data[i]) return false; - } - return true; -}; -Buffer.prototype.readUInt8 = function(offset) { return this._data[offset]; }; -Buffer.prototype.writeUInt8 = function(value, offset) { this._data[offset] = value; return offset + 1; }; -globalThis[Symbol.for('jb:buffer')] = { Buffer: Buffer }; -globalThis.Buffer = Buffer; -`; -var STREAM_MODULE_SOURCE = ` -var _EE = globalThis[Symbol.for('jb:events')].EventEmitter; - -function Stream() { _EE.call(this); } -Stream.prototype = Object.create(_EE.prototype); -Stream.prototype.constructor = Stream; -Stream.prototype.pipe = function(dest) { - this.on('data', function(chunk) { dest.write(chunk); }); - this.on('end', function() { if (dest.end) dest.end(); }); - return dest; -}; - -function Readable(opts) { - Stream.call(this); - this.readable = true; - this._readableState = { ended: false, buffer: [] }; -} -Readable.prototype = Object.create(Stream.prototype); -Readable.prototype.constructor = Readable; -Readable.prototype.read = function() { return null; }; -Readable.prototype.push = function(chunk) { - if (chunk === null) { this._readableState.ended = true; this.emit('end'); return false; } - this.emit('data', chunk); - return true; -}; -Readable.prototype.destroy = function() { this.emit('close'); return this; }; - -function Writable(opts) { - Stream.call(this); - this.writable = true; - this._writableState = { ended: false }; -} -Writable.prototype = Object.create(Stream.prototype); -Writable.prototype.constructor = Writable; -Writable.prototype.write = function(chunk) { return true; }; -Writable.prototype.end = function(chunk) { - if (chunk) this.write(chunk); - this._writableState.ended = true; - this.emit('finish'); - return this; -}; -Writable.prototype.destroy = function() { this.emit('close'); return this; }; - -function Duplex(opts) { - Readable.call(this, opts); - Writable.call(this, opts); -} -Duplex.prototype = Object.create(Readable.prototype); -var _wKeys = Object.keys(Writable.prototype); -for (var _wi = 0; _wi < _wKeys.length; _wi++) { - if (!Duplex.prototype[_wKeys[_wi]]) Duplex.prototype[_wKeys[_wi]] = Writable.prototype[_wKeys[_wi]]; -} -Duplex.prototype.constructor = Duplex; - -function Transform(opts) { Duplex.call(this, opts); } -Transform.prototype = Object.create(Duplex.prototype); -Transform.prototype.constructor = Transform; -Transform.prototype._transform = function(chunk, encoding, cb) { if (cb) cb(null, chunk); }; - -function PassThrough(opts) { Transform.call(this, opts); } -PassThrough.prototype = Object.create(Transform.prototype); -PassThrough.prototype.constructor = PassThrough; - -function pipeline() { - var streams = Array.prototype.slice.call(arguments); - var cb = typeof streams[streams.length - 1] === 'function' ? streams.pop() : null; - for (var i = 0; i < streams.length - 1; i++) streams[i].pipe(streams[i + 1]); - if (cb) { - var last = streams[streams.length - 1]; - last.on('finish', function() { cb(null); }); - last.on('error', function(e) { cb(e); }); - } - return streams[streams.length - 1]; -} - -globalThis[Symbol.for('jb:stream')] = { - Stream: Stream, Readable: Readable, Writable: Writable, - Duplex: Duplex, Transform: Transform, PassThrough: PassThrough, - pipeline: pipeline -}; -`; -var STRING_DECODER_MODULE_SOURCE = ` -function StringDecoder(encoding) { - this.encoding = (encoding || 'utf-8').toLowerCase(); - if (this.encoding === 'utf8') this.encoding = 'utf-8'; -} -StringDecoder.prototype.write = function(buf) { - if (typeof buf === 'string') return buf; - var data = buf instanceof Uint8Array ? buf : (buf && buf._data ? buf._data : new Uint8Array(0)); - return _utf8Decode(data); -}; -StringDecoder.prototype.end = function(buf) { - if (buf) return this.write(buf); - return ''; -}; -globalThis[Symbol.for('jb:string_decoder')] = { StringDecoder: StringDecoder }; -`; -var QUERYSTRING_MODULE_SOURCE = ` -var _qs = { - parse: function(str, sep, eq) { - sep = sep || '&'; eq = eq || '='; - var result = Object.create(null); - if (!str || typeof str !== 'string') return result; - var pairs = str.split(sep); - for (var i = 0; i < pairs.length; i++) { - var idx = pairs[i].indexOf(eq); - var key, val; - if (idx >= 0) { - key = decodeURIComponent(pairs[i].slice(0, idx).replace(/\\+/g, ' ')); - val = decodeURIComponent(pairs[i].slice(idx + 1).replace(/\\+/g, ' ')); - } else { - key = decodeURIComponent(pairs[i].replace(/\\+/g, ' ')); - val = ''; - } - if (result[key] !== undefined) { - if (Array.isArray(result[key])) result[key].push(val); - else result[key] = [result[key], val]; - } else { - result[key] = val; - } - } - return result; - }, - stringify: function(obj, sep, eq) { - sep = sep || '&'; eq = eq || '='; - var pairs = []; - var keys = Object.keys(obj); - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - var val = obj[key]; - if (Array.isArray(val)) { - for (var j = 0; j < val.length; j++) { - pairs.push(encodeURIComponent(key) + eq + encodeURIComponent(val[j])); - } - } else { - pairs.push(encodeURIComponent(key) + eq + encodeURIComponent(val)); - } - } - return pairs.join(sep); - }, - escape: function(str) { return encodeURIComponent(str); }, - unescape: function(str) { return decodeURIComponent(str); } -}; -_qs.decode = _qs.parse; -_qs.encode = _qs.stringify; -globalThis[Symbol.for('jb:querystring')] = _qs; -`; -var UNSUPPORTED_MODULES = Object.assign( - /* @__PURE__ */ Object.create(null), - { - http: "Use fetch() for HTTP requests.", - https: "Use fetch() for HTTP requests.", - http2: "Use fetch() for HTTP requests.", - net: "Network socket APIs are not supported.", - tls: "Network socket APIs are not supported.", - dgram: "Network socket APIs are not supported.", - dns: "DNS APIs are not supported.", - cluster: "Cluster APIs are not supported.", - worker_threads: "Worker thread APIs are not supported.", - vm: "VM APIs are not supported.", - v8: "V8 APIs are not supported.", - inspector: "Inspector APIs are not supported.", - readline: "Readline APIs are not supported.", - repl: "REPL APIs are not supported.", - module: "Module APIs are not supported.", - perf_hooks: "Performance hooks are not supported.", - async_hooks: "Async hooks are not supported.", - diagnostics_channel: "Diagnostics channel is not supported.", - trace_events: "Trace events are not supported.", - crypto: "Crypto APIs are not available in this sandbox.", - zlib: "Compression APIs are not supported.", - tty: "TTY APIs are not supported.", - domain: "Domain APIs are not supported." - } -); - -// src/commands/js-exec/path-polyfill.ts -var PATH_MODULE_SOURCE = ` -(function() { - var sep = '/'; - var delimiter = ':'; - - function normalize(p) { - if (p === '') return '.'; - var isAbs = p.charCodeAt(0) === 47; - var trailingSlash = p.charCodeAt(p.length - 1) === 47; - var parts = p.split('/'); - var out = []; - for (var i = 0; i < parts.length; i++) { - var seg = parts[i]; - if (seg === '' || seg === '.') continue; - if (seg === '..') { - if (out.length > 0 && out[out.length - 1] !== '..') out.pop(); - else if (!isAbs) out.push('..'); - } else { - out.push(seg); - } - } - var result = out.join('/'); - if (isAbs) result = '/' + result; - if (trailingSlash && result[result.length - 1] !== '/') result += '/'; - return result || (isAbs ? '/' : '.'); - } - - function join() { - var joined = ''; - for (var i = 0; i < arguments.length; i++) { - var arg = arguments[i]; - if (typeof arg !== 'string') throw new TypeError('Path must be a string'); - if (arg.length > 0) { - if (joined.length > 0) joined += '/' + arg; - else joined = arg; - } - } - if (joined.length === 0) return '.'; - return normalize(joined); - } - - function resolve() { - var resolved = ''; - var resolvedAbsolute = false; - for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) { - var path = i >= 0 ? arguments[i] : globalThis.process.cwd(); - if (typeof path !== 'string') throw new TypeError('Path must be a string'); - if (path.length === 0) continue; - if (resolved.length > 0) resolved = path + '/' + resolved; - else resolved = path; - resolvedAbsolute = path.charCodeAt(0) === 47; - } - resolved = normalize(resolved); - if (resolvedAbsolute) return '/' + resolved.replace(/^\\/+/, ''); - return resolved.length > 0 ? resolved : '.'; - } - - function isAbsolute(p) { - return typeof p === 'string' && p.length > 0 && p.charCodeAt(0) === 47; - } - - function dirname(p) { - if (p.length === 0) return '.'; - var hasRoot = p.charCodeAt(0) === 47; - var end = -1; - for (var i = p.length - 1; i >= 1; i--) { - if (p.charCodeAt(i) === 47) { end = i; break; } - } - if (end === -1) return hasRoot ? '/' : '.'; - if (hasRoot && end === 0) return '/'; - return p.slice(0, end); - } - - function basename(p, ext) { - var start = 0; - for (var i = p.length - 1; i >= 0; i--) { - if (p.charCodeAt(i) === 47) { start = i + 1; break; } - } - var base = p.slice(start); - if (ext && base.endsWith(ext)) { - base = base.slice(0, base.length - ext.length); - } - return base; - } - - function extname(p) { - var startDot = -1; - var startPart = 0; - for (var i = p.length - 1; i >= 0; i--) { - var code = p.charCodeAt(i); - if (code === 47) { startPart = i + 1; break; } - if (code === 46 && startDot === -1) startDot = i; - } - if (startDot === -1 || startDot === startPart || - (startDot === startPart + 1 && p.charCodeAt(startPart) === 46)) { - return ''; - } - return p.slice(startDot); - } - - function relative(from, to) { - if (from === to) return ''; - from = resolve(from); - to = resolve(to); - if (from === to) return ''; - var fromParts = from.split('/').filter(Boolean); - var toParts = to.split('/').filter(Boolean); - var common = 0; - var length = Math.min(fromParts.length, toParts.length); - for (var i = 0; i < length; i++) { - if (fromParts[i] !== toParts[i]) break; - common++; - } - var ups = []; - for (var i = common; i < fromParts.length; i++) ups.push('..'); - return ups.concat(toParts.slice(common)).join('/') || '.'; - } - - function parse(p) { - var root = p.charCodeAt(0) === 47 ? '/' : ''; - var dir = dirname(p); - var base = basename(p); - var ext = extname(p); - var name = ext ? base.slice(0, base.length - ext.length) : base; - return { root: root, dir: dir, base: base, ext: ext, name: name }; - } - - function format(obj) { - var dir = obj.dir || obj.root || ''; - var base = obj.base || ((obj.name || '') + (obj.ext || '')); - if (!dir) return base; - if (dir === obj.root) return dir + base; - return dir + '/' + base; - } - - var posix = { sep: sep, delimiter: delimiter, join: join, resolve: resolve, normalize: normalize, isAbsolute: isAbsolute, dirname: dirname, basename: basename, extname: extname, relative: relative, parse: parse, format: format }; - posix.posix = posix; - - globalThis[Symbol.for('jb:path')] = posix; -})(); -`; - -// src/commands/js-exec/js-exec-worker.ts -var quickjsModule = null; -var quickjsLoading = null; -async function getQuickJSModule() { - if (quickjsModule) { - return quickjsModule; - } - if (quickjsLoading) { - return quickjsLoading; - } - quickjsLoading = getQuickJS(); - quickjsModule = await quickjsLoading; - return quickjsModule; -} -var MEMORY_LIMIT = 64 * 1024 * 1024; -var INTERRUPT_CYCLES = 1e5; -function formatError(errorVal) { - if (typeof errorVal === "object" && errorVal !== null && "message" in errorVal) { - const err = errorVal; - const msg = err.message; - if (err.stack) { - const lines = err.stack.split("\n"); - for (const line of lines) { - const trimmed = line.trim(); - if (trimmed.startsWith("at ")) { - const cleaned = trimmed.replace(/^at \((\/.+)\)$/, "at $1"); - return `${cleaned}: ${msg}`; - } - } - } - return msg; - } - return String(errorVal); -} -function throwError(context, message) { - return { error: context.newError(message) }; -} -function jsToHandle(context, value) { - if (value === null || value === void 0) { - return context.undefined; - } - if (typeof value === "string") { - return context.newString(value); - } - if (typeof value === "number") { - return context.newNumber(value); - } - if (typeof value === "boolean") { - return value ? context.true : context.false; - } - if (Array.isArray(value)) { - const arr = context.newArray(); - for (let i = 0; i < value.length; i++) { - const elemHandle = jsToHandle(context, value[i]); - context.setProp(arr, i, elemHandle); - elemHandle.dispose(); - } - return arr; - } - if (typeof value === "object") { - const obj = context.newObject(); - for (const [k, v] of Object.entries(value)) { - const valHandle = jsToHandle(context, v); - context.setProp(obj, k, valHandle); - valHandle.dispose(); - } - return obj; - } - return context.undefined; -} -function resolveModulePath(name, fromFile, cwd) { - if (name.startsWith("/")) return name; - const base = fromFile ? fromFile.substring(0, fromFile.lastIndexOf("/")) || "/" : cwd; - const parts = `${base}/${name}`.split("/").filter(Boolean); - const resolved = []; - for (const p of parts) { - if (p === "..") resolved.pop(); - else if (p !== ".") resolved.push(p); - } - return `/${resolved.join("/")}`; -} -var VIRTUAL_MODULES = Object.assign( - /* @__PURE__ */ Object.create(null), - { - fs: ` - const _fs = globalThis.fs; - export const readFile = _fs.readFile; - export const readFileSync = function(path, opts) { return _fs.readFileSync(path, opts); }; - export const readFileBuffer = _fs.readFileBuffer; - export const writeFile = _fs.writeFile; - export const writeFileSync = _fs.writeFileSync; - export const stat = _fs.stat; - export const statSync = _fs.statSync; - export const lstat = _fs.lstat; - export const lstatSync = _fs.lstatSync; - export const readdir = _fs.readdir; - export const readdirSync = _fs.readdirSync; - export const mkdir = _fs.mkdir; - export const mkdirSync = _fs.mkdirSync; - export const rm = _fs.rm; - export const rmSync = _fs.rmSync; - export const exists = _fs.exists; - export const existsSync = _fs.existsSync; - export const appendFile = _fs.appendFile; - export const appendFileSync = _fs.appendFileSync; - export const symlink = _fs.symlink; - export const symlinkSync = _fs.symlinkSync; - export const readlink = _fs.readlink; - export const readlinkSync = _fs.readlinkSync; - export const chmod = _fs.chmod; - export const chmodSync = _fs.chmodSync; - export const realpath = _fs.realpath; - export const realpathSync = _fs.realpathSync; - export const rename = _fs.rename; - export const renameSync = _fs.renameSync; - export const copyFile = _fs.copyFile; - export const copyFileSync = _fs.copyFileSync; - export const unlinkSync = _fs.unlinkSync; - export const unlink = _fs.unlink; - export const rmdirSync = _fs.rmdirSync; - export const rmdir = _fs.rmdir; - export const promises = _fs.promises; - export default _fs; - `, - path: `${PATH_MODULE_SOURCE} - const _path = globalThis[Symbol.for('jb:path')]; - export const join = _path.join; - export const resolve = _path.resolve; - export const normalize = _path.normalize; - export const isAbsolute = _path.isAbsolute; - export const dirname = _path.dirname; - export const basename = _path.basename; - export const extname = _path.extname; - export const relative = _path.relative; - export const parse = _path.parse; - export const format = _path.format; - export const sep = _path.sep; - export const delimiter = _path.delimiter; - export const posix = _path.posix; - export default _path; - `, - process: ` - const _process = globalThis.process; - export const argv = _process.argv; - export const cwd = _process.cwd; - export const exit = _process.exit; - export const env = _process.env; - export const platform = _process.platform; - export const arch = _process.arch; - export const versions = _process.versions; - export const version = _process.version; - export default _process; - `, - child_process: ` - const _exec = globalThis[Symbol.for('jb:exec')]; - const _execArgs = globalThis[Symbol.for('jb:execArgs')]; - export function execSync(cmd, opts) { - var r = _exec(cmd, opts); - if (r.exitCode !== 0) { - var e = new Error('Command failed: ' + cmd); - e.status = r.exitCode; - e.stderr = r.stderr; - e.stdout = r.stdout; - throw e; - } - return r.stdout; - } - export function exec(cmd, opts) { return _exec(cmd, opts); } - export function spawnSync(cmd, args, opts) { - var r = _execArgs(cmd, args || []); - return { stdout: r.stdout, stderr: r.stderr, status: r.exitCode }; - } - export default { exec: exec, execSync: execSync, spawnSync: spawnSync }; - `, - os: ` - const _os = globalThis[Symbol.for('jb:os')]; - export const platform = _os.platform; - export const arch = _os.arch; - export const homedir = _os.homedir; - export const tmpdir = _os.tmpdir; - export const type = _os.type; - export const hostname = _os.hostname; - export const EOL = _os.EOL; - export const cpus = _os.cpus; - export const totalmem = _os.totalmem; - export const freemem = _os.freemem; - export const endianness = _os.endianness; - export default _os; - `, - url: ` - const _url = globalThis[Symbol.for('jb:url')]; - export const URL = _url.URL; - export const URLSearchParams = _url.URLSearchParams; - export const parse = _url.parse; - export const format = _url.format; - export default _url; - `, - assert: ` - const _assert = globalThis[Symbol.for('jb:assert')]; - export const ok = _assert.ok; - export const equal = _assert.equal; - export const notEqual = _assert.notEqual; - export const strictEqual = _assert.strictEqual; - export const notStrictEqual = _assert.notStrictEqual; - export const deepEqual = _assert.deepEqual; - export const deepStrictEqual = _assert.deepStrictEqual; - export const notDeepEqual = _assert.notDeepEqual; - export const throws = _assert.throws; - export const doesNotThrow = _assert.doesNotThrow; - export const fail = _assert.fail; - export default _assert; - `, - util: ` - const _util = globalThis[Symbol.for('jb:util')]; - export const format = _util.format; - export const inspect = _util.inspect; - export const promisify = _util.promisify; - export const types = _util.types; - export const inherits = _util.inherits; - export default _util; - `, - events: ` - const _events = globalThis[Symbol.for('jb:events')]; - export const EventEmitter = _events.EventEmitter; - export default _events; - `, - buffer: ` - const _buffer = globalThis[Symbol.for('jb:buffer')]; - export const Buffer = _buffer.Buffer; - export default _buffer; - `, - stream: ` - const _stream = globalThis[Symbol.for('jb:stream')]; - export const Stream = _stream.Stream; - export const Readable = _stream.Readable; - export const Writable = _stream.Writable; - export const Duplex = _stream.Duplex; - export const Transform = _stream.Transform; - export const PassThrough = _stream.PassThrough; - export const pipeline = _stream.pipeline; - export default _stream; - `, - string_decoder: ` - const _sd = globalThis[Symbol.for('jb:string_decoder')]; - export const StringDecoder = _sd.StringDecoder; - export default _sd; - `, - querystring: ` - const _qs = globalThis[Symbol.for('jb:querystring')]; - export const parse = _qs.parse; - export const stringify = _qs.stringify; - export const escape = _qs.escape; - export const unescape = _qs.unescape; - export const decode = _qs.decode; - export const encode = _qs.encode; - export default _qs; - ` - } -); -for (const [name, hint] of Object.entries(UNSUPPORTED_MODULES)) { - VIRTUAL_MODULES[name] = `throw new Error("Module '${name}' is not available in the js-exec sandbox. ${hint} Run 'js-exec --help' for available modules.");`; -} -function setupContext(context, backend, input) { - const consoleObj = context.newObject(); - const logFn = context.newFunction("log", (...args) => { - const parts = args.map((a) => { - const val = context.dump(a); - return typeof val === "string" ? val : JSON.stringify(val); - }); - try { - backend.writeStdout(`${parts.join(" ")} -`); - } catch (e) { - return throwError(context, e.message || "write failed"); - } - return context.undefined; - }); - context.setProp(consoleObj, "log", logFn); - logFn.dispose(); - const errorFn = context.newFunction("error", (...args) => { - const parts = args.map((a) => { - const val = context.dump(a); - return typeof val === "string" ? val : JSON.stringify(val); - }); - try { - backend.writeStderr(`${parts.join(" ")} -`); - } catch (e) { - return throwError(context, e.message || "write failed"); - } - return context.undefined; - }); - context.setProp(consoleObj, "error", errorFn); - errorFn.dispose(); - const warnFn = context.newFunction("warn", (...args) => { - const parts = args.map((a) => { - const val = context.dump(a); - return typeof val === "string" ? val : JSON.stringify(val); - }); - try { - backend.writeStderr(`${parts.join(" ")} -`); - } catch (e) { - return throwError(context, e.message || "write failed"); - } - return context.undefined; - }); - context.setProp(consoleObj, "warn", warnFn); - warnFn.dispose(); - context.setProp(context.global, "console", consoleObj); - consoleObj.dispose(); - const fsObj = context.newObject(); - const readFileFn = context.newFunction( - "readFile", - (pathHandle) => { - const path = context.getString(pathHandle); - try { - const data = backend.readFile(path); - return context.newString(new TextDecoder().decode(data)); - } catch (e) { - return throwError(context, e.message || "readFile failed"); - } - } - ); - context.setProp(fsObj, "readFile", readFileFn); - readFileFn.dispose(); - const readFileBufferFn = context.newFunction( - "readFileBuffer", - (pathHandle) => { - const path = context.getString(pathHandle); - try { - const data = backend.readFile(path); - return context.newArrayBuffer( - data.buffer.slice(data.byteOffset, data.byteOffset + data.byteLength) - ); - } catch (e) { - return throwError( - context, - e.message || "readFileBuffer failed" - ); - } - } - ); - context.setProp(fsObj, "readFileBuffer", readFileBufferFn); - readFileBufferFn.dispose(); - const writeFileFn = context.newFunction( - "writeFile", - (pathHandle, dataHandle) => { - const path = context.getString(pathHandle); - const data = context.getString(dataHandle); - try { - backend.writeFile(path, new TextEncoder().encode(data)); - return context.undefined; - } catch (e) { - return throwError(context, e.message || "writeFile failed"); - } - } - ); - context.setProp(fsObj, "writeFile", writeFileFn); - writeFileFn.dispose(); - const statFn = context.newFunction("stat", (pathHandle) => { - const path = context.getString(pathHandle); - try { - const stat = backend.stat(path); - return jsToHandle(context, { - isFile: stat.isFile, - isDirectory: stat.isDirectory, - isSymbolicLink: stat.isSymbolicLink, - mode: stat.mode, - size: stat.size, - mtime: stat.mtime.toISOString() - }); - } catch (e) { - return throwError(context, e.message || "stat failed"); - } - }); - context.setProp(fsObj, "stat", statFn); - statFn.dispose(); - const readdirFn = context.newFunction( - "readdir", - (pathHandle) => { - const path = context.getString(pathHandle); - try { - const entries = backend.readdir(path); - return jsToHandle(context, entries); - } catch (e) { - return throwError(context, e.message || "readdir failed"); - } - } - ); - context.setProp(fsObj, "readdir", readdirFn); - readdirFn.dispose(); - const mkdirFn = context.newFunction( - "mkdir", - (pathHandle, optsHandle) => { - const path = context.getString(pathHandle); - let recursive = false; - if (optsHandle) { - const opts = context.dump(optsHandle); - if (opts && typeof opts === "object" && "recursive" in opts) { - recursive = Boolean(opts.recursive); - } - } - try { - backend.mkdir(path, recursive); - return context.undefined; - } catch (e) { - return throwError(context, e.message || "mkdir failed"); - } - } - ); - context.setProp(fsObj, "mkdir", mkdirFn); - mkdirFn.dispose(); - const rmFn = context.newFunction( - "rm", - (pathHandle, optsHandle) => { - const path = context.getString(pathHandle); - let recursive = false; - let force = false; - if (optsHandle) { - const opts = context.dump(optsHandle); - if (opts && typeof opts === "object") { - if ("recursive" in opts) recursive = Boolean(opts.recursive); - if ("force" in opts) force = Boolean(opts.force); - } - } - try { - backend.rm(path, recursive, force); - return context.undefined; - } catch (e) { - return throwError(context, e.message || "rm failed"); - } - } - ); - context.setProp(fsObj, "rm", rmFn); - rmFn.dispose(); - const existsFn = context.newFunction( - "exists", - (pathHandle) => { - const path = context.getString(pathHandle); - return backend.exists(path) ? context.true : context.false; - } - ); - context.setProp(fsObj, "exists", existsFn); - existsFn.dispose(); - const appendFileFn = context.newFunction( - "appendFile", - (pathHandle, dataHandle) => { - const path = context.getString(pathHandle); - const data = context.getString(dataHandle); - try { - backend.appendFile(path, new TextEncoder().encode(data)); - return context.undefined; - } catch (e) { - return throwError(context, e.message || "appendFile failed"); - } - } - ); - context.setProp(fsObj, "appendFile", appendFileFn); - appendFileFn.dispose(); - const lstatFn = context.newFunction("lstat", (pathHandle) => { - const path = context.getString(pathHandle); - try { - const s = backend.lstat(path); - return jsToHandle(context, { - isFile: s.isFile, - isDirectory: s.isDirectory, - isSymbolicLink: s.isSymbolicLink, - mode: s.mode, - size: s.size, - mtime: s.mtime.toISOString() - }); - } catch (e) { - return throwError(context, e.message || "lstat failed"); - } - }); - context.setProp(fsObj, "lstat", lstatFn); - lstatFn.dispose(); - const symlinkFn = context.newFunction( - "symlink", - (targetHandle, pathHandle) => { - const target = context.getString(targetHandle); - const linkPath = context.getString(pathHandle); - try { - backend.symlink(target, linkPath); - return context.undefined; - } catch (e) { - return throwError(context, e.message || "symlink failed"); - } - } - ); - context.setProp(fsObj, "symlink", symlinkFn); - symlinkFn.dispose(); - const readlinkFn = context.newFunction( - "readlink", - (pathHandle) => { - const path = context.getString(pathHandle); - try { - const target = backend.readlink(path); - return context.newString(target); - } catch (e) { - return throwError(context, e.message || "readlink failed"); - } - } - ); - context.setProp(fsObj, "readlink", readlinkFn); - readlinkFn.dispose(); - const chmodFn = context.newFunction( - "chmod", - (pathHandle, modeHandle) => { - const path = context.getString(pathHandle); - const mode = context.dump(modeHandle); - try { - backend.chmod(path, typeof mode === "number" ? mode : 0); - return context.undefined; - } catch (e) { - return throwError(context, e.message || "chmod failed"); - } - } - ); - context.setProp(fsObj, "chmod", chmodFn); - chmodFn.dispose(); - const realpathFn = context.newFunction( - "realpath", - (pathHandle) => { - const path = context.getString(pathHandle); - try { - const resolved = backend.realpath(path); - return context.newString(resolved); - } catch (e) { - return throwError(context, e.message || "realpath failed"); - } - } - ); - context.setProp(fsObj, "realpath", realpathFn); - realpathFn.dispose(); - const renameFn = context.newFunction( - "rename", - (oldHandle, newHandle) => { - const oldPath = context.getString(oldHandle); - const newPath = context.getString(newHandle); - try { - backend.rename(oldPath, newPath); - return context.undefined; - } catch (e) { - return throwError(context, e.message || "rename failed"); - } - } - ); - context.setProp(fsObj, "rename", renameFn); - renameFn.dispose(); - const copyFileFn = context.newFunction( - "copyFile", - (srcHandle, destHandle) => { - const src = context.getString(srcHandle); - const dest = context.getString(destHandle); - try { - backend.copyFile(src, dest); - return context.undefined; - } catch (e) { - return throwError(context, e.message || "copyFile failed"); - } - } - ); - context.setProp(fsObj, "copyFile", copyFileFn); - copyFileFn.dispose(); - context.setProp(context.global, "fs", fsObj); - fsObj.dispose(); - const fetchFn = context.newFunction( - "fetch", - (urlHandle, optsHandle) => { - const url = context.getString(urlHandle); - let options; - if (optsHandle) { - options = context.dump(optsHandle); - } - try { - const result = backend.httpRequest(url, { - method: options?.method, - headers: options?.headers, - body: options?.body - }); - return jsToHandle(context, result); - } catch (e) { - return throwError(context, e.message || "fetch failed"); - } - } - ); - context.setProp(context.global, "__fetch", fetchFn); - fetchFn.dispose(); - const execFn = context.newFunction( - "exec", - (cmdHandle, optsHandle) => { - const command = context.getString(cmdHandle); - let stdin; - if (optsHandle) { - const opts = context.dump(optsHandle); - if (opts?.stdin) { - stdin = String(opts.stdin); - } - } - try { - const result = backend.execCommand(command, stdin); - return jsToHandle(context, result); - } catch (e) { - return throwError(context, e.message || "exec failed"); - } - } - ); - context.setProp(context.global, "__exec", execFn); - execFn.dispose(); - const execArgsFn = context.newFunction( - "execArgs", - (cmdHandle, argsHandle) => { - const command = context.getString(cmdHandle); - const args = context.dump(argsHandle); - try { - const result = backend.execCommandArgs(command, args); - return jsToHandle(context, result); - } catch (e) { - return throwError(context, e.message || "exec failed"); - } - } - ); - context.setProp(context.global, "__execArgs", execArgsFn); - execArgsFn.dispose(); - if (input.hasInvokeTool) { - const invokeToolFn = context.newFunction( - "__invokeTool", - (pathHandle, argsHandle) => { - const path = context.getString(pathHandle); - const argsJson = context.getString(argsHandle); - try { - const resultJson = backend.invokeTool(path, argsJson); - return context.newString(resultJson); - } catch (e) { - return throwError( - context, - e.message || "tool invocation failed" - ); - } - } - ); - context.setProp(context.global, "__invokeTool", invokeToolFn); - invokeToolFn.dispose(); - } - const envObj = jsToHandle(context, input.env); - context.setProp(context.global, "env", envObj); - envObj.dispose(); - const processObj = context.newObject(); - const argv = [input.scriptPath || "js-exec", ...input.args]; - const argvHandle = jsToHandle(context, argv); - context.setProp(processObj, "argv", argvHandle); - argvHandle.dispose(); - const cwdFn = context.newFunction("cwd", () => { - return context.newString(input.cwd); - }); - context.setProp(processObj, "cwd", cwdFn); - cwdFn.dispose(); - const exitFn = context.newFunction("exit", (codeHandle) => { - let code = 0; - if (codeHandle) { - const val = context.dump(codeHandle); - code = typeof val === "number" ? val : 0; - } - backend.exit(code); - return throwError(context, "__EXIT__"); - }); - context.setProp(processObj, "exit", exitFn); - exitFn.dispose(); - context.setProp(context.global, "process", processObj); - processObj.dispose(); - const compatResult = context.evalCode( - `(function() { - // Bridge native handles from string keys (set by QuickJS setProp) to symbol keys - globalThis[Symbol.for('jb:fetch')] = globalThis.__fetch; - globalThis[Symbol.for('jb:exec')] = globalThis.__exec; - globalThis[Symbol.for('jb:execArgs')] = globalThis.__execArgs; - delete globalThis.__fetch; - delete globalThis.__exec; - delete globalThis.__execArgs; - - var _fs = globalThis.fs; - // Save original native functions - var orig = Object.create(null); - var allNames = [ - 'readFile', 'readFileBuffer', 'writeFile', 'stat', 'lstat', 'readdir', - 'mkdir', 'rm', 'exists', 'appendFile', 'symlink', 'readlink', - 'chmod', 'realpath', 'rename', 'copyFile' - ]; - for (var i = 0; i < allNames.length; i++) { - orig[allNames[i]] = _fs[allNames[i]]; - } - - // Wrap async-style methods to always throw (matching Node.js which requires a callback). - // In Node.js, calling fs.readFile() without a callback throws TypeError. - // We don't support callbacks, so the async form always errors. - function wrapCb(fn, name) { - return function() { - throw new Error( - "fs." + name + "() with callbacks is not supported. " + - "Use fs." + name + "Sync() or fs.promises." + name + "() instead." - ); - }; - } - var cbNames = [ - 'readFile', 'writeFile', 'stat', 'lstat', 'readdir', 'mkdir', - 'rm', 'appendFile', 'symlink', 'readlink', 'chmod', 'realpath', - 'rename', 'copyFile' - ]; - for (var i = 0; i < cbNames.length; i++) { - if (orig[cbNames[i]]) _fs[cbNames[i]] = wrapCb(orig[cbNames[i]], cbNames[i]); - } - // exists: callback is especially common in legacy Node.js - _fs.exists = wrapCb(orig.exists, 'exists'); - - // readFileSync: match Node.js behavior - // - No encoding: return Buffer - // - With encoding (e.g. 'utf8'): return string - _fs.readFileSync = function(path, opts) { - var encoding = typeof opts === 'string' ? opts : (opts && opts.encoding); - if (encoding) return orig.readFile(path); - return Buffer.from(orig.readFileBuffer(path)); - }; - _fs.writeFileSync = orig.writeFile; - _fs.statSync = orig.stat; - _fs.lstatSync = orig.lstat; - _fs.readdirSync = orig.readdir; - _fs.mkdirSync = orig.mkdir; - _fs.rmSync = orig.rm; - _fs.existsSync = orig.exists; - _fs.appendFileSync = orig.appendFile; - _fs.symlinkSync = orig.symlink; - _fs.readlinkSync = orig.readlink; - _fs.chmodSync = orig.chmod; - _fs.realpathSync = orig.realpath; - _fs.renameSync = orig.rename; - _fs.copyFileSync = orig.copyFile; - _fs.unlinkSync = orig.rm; - _fs.rmdirSync = orig.rm; - _fs.unlink = wrapCb(orig.rm, 'unlink'); - _fs.rmdir = wrapCb(orig.rm, 'rmdir'); - - // promises namespace - _fs.promises = {}; - for (var i = 0; i < allNames.length; i++) { - var m = allNames[i]; - (function(fn) { - _fs.promises[m] = function() { - try { return Promise.resolve(fn.apply(null, arguments)); } - catch(e) { return Promise.reject(e); } - }; - })(orig[m]); - } - // Override promises.readFile to match Node.js behavior (Buffer vs string) - _fs.promises.readFile = function(path, opts) { - var encoding = typeof opts === 'string' ? opts : (opts && opts.encoding); - try { - if (encoding) return Promise.resolve(orig.readFile(path)); - return Promise.resolve(Buffer.from(orig.readFileBuffer(path))); - } catch(e) { return Promise.reject(e); } - }; - _fs.promises.unlink = _fs.promises.rm; - _fs.promises.rmdir = _fs.promises.rm; - _fs.promises.access = function(p) { - return orig.exists(p) ? Promise.resolve() : Promise.reject(new Error('ENOENT: no such file or directory: ' + p)); - }; - - // process enhancements - var _p = globalThis.process; - _p.env = globalThis.env; - _p.platform = 'linux'; - _p.arch = 'x64'; - _p.versions = { node: '22.0.0', quickjs: '2024' }; - _p.version = 'v22.0.0'; - - // Initialize path module on globalThis so require('path') works - ${PATH_MODULE_SOURCE} - - // Initialize fetch polyfill (URL, Headers, Request, Response, fetch) - ${FETCH_POLYFILL_SOURCE} - - // Initialize additional module shims - ${EVENTS_MODULE_SOURCE} - ${OS_MODULE_SOURCE} - ${URL_MODULE_SOURCE} - ${ASSERT_MODULE_SOURCE} - ${UTIL_MODULE_SOURCE} - ${BUFFER_MODULE_SOURCE} - ${STREAM_MODULE_SOURCE} - ${STRING_DECODER_MODULE_SOURCE} - ${QUERYSTRING_MODULE_SOURCE} - - // Wrap console methods to auto-stringify Buffer arguments. - // In Node.js, console.log(buffer) calls util.inspect \u2192 toString(). - (function() { - var _cl = console.log; - var _ce = console.error; - var _cw = console.warn; - function fix(a) { return a instanceof Buffer ? a.toString() : a; } - function wrap(fn) { - return function() { - var a = []; - for (var i = 0; i < arguments.length; i++) a.push(fix(arguments[i])); - return fn.apply(console, a); - }; - } - console.log = wrap(_cl); - console.error = wrap(_ce); - console.warn = wrap(_cw); - })(); - - // require() shim for CommonJS compatibility - var _execFn = globalThis[Symbol.for('jb:exec')]; - var _execArgsFn = globalThis[Symbol.for('jb:execArgs')]; - var _childProcess = { - exec: function(cmd, opts) { return _execFn(cmd, opts); }, - execSync: function(cmd, opts) { - var r = _execFn(cmd, opts); - if (r.exitCode !== 0) { - var e = new Error('Command failed: ' + cmd); - e.status = r.exitCode; - e.stderr = r.stderr; - e.stdout = r.stdout; - throw e; - } - return r.stdout; - }, - spawnSync: function(cmd, args, opts) { - var r = _execArgsFn(cmd, args || []); - return { stdout: r.stdout, stderr: r.stderr, status: r.exitCode }; - } - }; - - var _modules = Object.create(null); - _modules.fs = _fs; - _modules.path = globalThis[Symbol.for('jb:path')]; - _modules.child_process = _childProcess; - _modules.process = _p; - _modules.console = globalThis.console; - _modules.os = globalThis[Symbol.for('jb:os')]; - _modules.url = globalThis[Symbol.for('jb:url')]; - _modules.assert = globalThis[Symbol.for('jb:assert')]; - _modules.util = globalThis[Symbol.for('jb:util')]; - _modules.events = globalThis[Symbol.for('jb:events')]; - _modules.buffer = globalThis[Symbol.for('jb:buffer')]; - _modules.stream = globalThis[Symbol.for('jb:stream')]; - _modules.string_decoder = globalThis[Symbol.for('jb:string_decoder')]; - _modules.querystring = globalThis[Symbol.for('jb:querystring')]; - - var _unsupported = Object.create(null); - var _unsupportedRaw = ${JSON.stringify(UNSUPPORTED_MODULES)}; - Object.keys(_unsupportedRaw).forEach(function(_key) { - _unsupported[_key] = _unsupportedRaw[_key]; - }); - - globalThis.require = function(name) { - if (name.startsWith('node:')) name = name.slice(5); - if (Object.prototype.hasOwnProperty.call(_modules, name)) { - return _modules[name]; - } - if (Object.prototype.hasOwnProperty.call(_unsupported, name)) { - var hint = _unsupported[name]; - throw new Error("Module '" + name + "' is not available in the js-exec sandbox. " + hint + " Run 'js-exec --help' for available modules."); - } - throw new Error("Cannot find module '" + name + "'. Run 'js-exec --help' for available modules."); - }; - globalThis.require.resolve = function(name) { return name; }; -})();`, - "" - ); - if (compatResult.error) { - compatResult.error.dispose(); - } else { - compatResult.value.dispose(); - } -} -var originalProcessExit = process.exit.bind(process); -process.on("uncaughtException", () => { - originalProcessExit(1); -}); -var defense = null; -async function initializeWithDefense() { - await getQuickJSModule(); - try { - stripTypeScriptTypes("const x = 1;"); - } catch { - } - await new Promise((r) => setTimeout(r, 0)); - defense = new WorkerDefenseInDepth({ - excludeViolationTypes: [ - // SharedArrayBuffer/Atomics: Used by sync-backend for synchronous - // filesystem communication between the worker and main thread. - "shared_array_buffer", - "atomics", - // process.stdout/stderr: Emscripten (quickjs-emscripten) routes WASM - // stdout/stderr through Node.js console which uses process.stdout/stderr. - // User code runs inside QuickJS with no access to Node.js process. - "process_stdout", - "process_stderr" - ] - }); -} -var TOOLS_PROXY_SETUP_SOURCE = `(function() { - globalThis.tools = (function makeProxy(path) { - return new Proxy(function(){}, { - get: function(_t, prop) { - if (prop === 'then' || typeof prop === 'symbol') return undefined; - return makeProxy(path.concat([String(prop)])); - }, - apply: function(_t, _this, args) { - var toolPath = path.join('.'); - if (!toolPath) throw new Error('Tool path missing in invocation'); - var argsJson = args.length > 0 ? JSON.stringify(args[0]) : ''; - if (argsJson === undefined) argsJson = ''; - var resultJson = globalThis.__invokeTool(toolPath, argsJson); - return resultJson !== undefined && resultJson !== '' ? JSON.parse(resultJson) : undefined; - } - }); - })([]); -})();`; -async function executeCode(input) { - const qjs = await getQuickJSModule(); - const backend = new SyncBackend(input.sharedBuffer, input.timeoutMs); - let runtime; - let context; - try { - runtime = qjs.newRuntime(); - runtime.setMemoryLimit(MEMORY_LIMIT); - let interruptCount = 0; - runtime.setInterruptHandler(() => { - interruptCount++; - return interruptCount > INTERRUPT_CYCLES; - }); - context = runtime.newContext(); - setupContext(context, backend, input); - { - const initResult = context.evalCode( - `{ - // --- Block dynamic code compilation --- - // @banned-pattern-ignore: intentional sandbox hardening \u2014 removes eval/Function inside QuickJS guest, not the host - Object.defineProperty(globalThis, 'eval', { - value: undefined, - writable: false, - configurable: false, - }); - const BlockedFunction = function () { - throw new TypeError('Function constructor is not allowed'); - }; - const OrigFunction = Function; - BlockedFunction.prototype = OrigFunction.prototype; - - // Capture function-type constructors before we patch them - const AsyncFunction = (async function(){}).constructor; - const GeneratorFunction = (function*(){}).constructor; - const AsyncGeneratorFunction = (async function*(){}).constructor; - - // Patch .constructor on all function-type prototypes - for (const proto of [ - OrigFunction.prototype, - AsyncFunction.prototype, - GeneratorFunction.prototype, - AsyncGeneratorFunction.prototype, - ]) { - Object.defineProperty(proto, 'constructor', { - value: BlockedFunction, - writable: false, - configurable: false, - }); - } - // @banned-pattern-ignore: intentional sandbox hardening \u2014 replaces Function constructor inside QuickJS guest - Object.defineProperty(globalThis, 'Function', { - value: BlockedFunction, - writable: false, - configurable: false, - }); - - // --- Freeze all intrinsic prototypes --- - // Prevents prototype pollution (e.g. Array.prototype.x = ...). - // Only language intrinsics \u2014 not sandbox-injected objects - // (process, console, require) which need to stay mutable. - // Error prototypes are excluded: freezing them makes the inherited - // "message" property non-writable, which prevents new Error instances - // from having their own "message" set (JS spec OrdinarySet step 4). - const g = globalThis; - const toFreeze = [ - Object, Object.prototype, - OrigFunction, OrigFunction.prototype, - AsyncFunction, AsyncFunction.prototype, - GeneratorFunction, GeneratorFunction.prototype, - AsyncGeneratorFunction, AsyncGeneratorFunction.prototype, - Array, Array.prototype, - String, String.prototype, - Number, Number.prototype, - Boolean, Boolean.prototype, - g.Symbol, g.Symbol && g.Symbol.prototype, - RegExp, RegExp.prototype, - Date, Date.prototype, - Map, Map.prototype, - Set, Set.prototype, - WeakMap, WeakMap.prototype, - WeakSet, WeakSet.prototype, - g.WeakRef, g.WeakRef && g.WeakRef.prototype, - Promise, Promise.prototype, - ArrayBuffer, ArrayBuffer.prototype, - g.SharedArrayBuffer, g.SharedArrayBuffer && g.SharedArrayBuffer.prototype, - g.DataView, g.DataView && g.DataView.prototype, - JSON, Math, g.Reflect, g.Proxy, g.Atomics, - g.BigInt, g.BigInt && g.BigInt.prototype, - BlockedFunction, - ]; - // TypedArrays (guard against missing globals in QuickJS) - for (const name of [ - 'Int8Array','Uint8Array','Uint8ClampedArray', - 'Int16Array','Uint16Array','Int32Array','Uint32Array', - 'Float32Array','Float64Array', - 'BigInt64Array','BigUint64Array', - ]) { - if (g[name]) { - toFreeze.push(g[name], g[name].prototype); - } - } - // %TypedArray% intrinsic (shared base) - if (g.Uint8Array) { - const taProto = Object.getPrototypeOf(g.Uint8Array.prototype); - if (taProto && taProto !== Object.prototype) toFreeze.push(taProto); - const taCtor = Object.getPrototypeOf(g.Uint8Array); - if (taCtor && taCtor !== OrigFunction.prototype) toFreeze.push(taCtor); - } - // Iterator prototypes - try { - const arrIterProto = Object.getPrototypeOf( - Object.getPrototypeOf([][Symbol.iterator]()) - ); - if (arrIterProto) { - toFreeze.push(arrIterProto); - const iterProto = Object.getPrototypeOf(arrIterProto); - if (iterProto) toFreeze.push(iterProto); - } - } catch {} - try { - toFreeze.push(Object.getPrototypeOf(new Map()[Symbol.iterator]())); - } catch {} - try { - toFreeze.push(Object.getPrototypeOf(new Set()[Symbol.iterator]())); - } catch {} - try { - toFreeze.push(Object.getPrototypeOf(''[Symbol.iterator]())); - } catch {} - try { - const genObj = (function*(){})(); - toFreeze.push(Object.getPrototypeOf(genObj)); - toFreeze.push(Object.getPrototypeOf(Object.getPrototypeOf(genObj))); - } catch {} - try { - const asyncGenObj = (async function*(){})(); - toFreeze.push(Object.getPrototypeOf(asyncGenObj)); - toFreeze.push(Object.getPrototypeOf(Object.getPrototypeOf(asyncGenObj))); - } catch {} - - for (const obj of toFreeze) { - if (obj != null) { - try { Object.freeze(obj); } catch {} - } - } - }`, - "" - ); - if (initResult.error) { - const errVal = context.dump(initResult.error); - initResult.error.dispose(); - const msg = typeof errVal === "object" && errVal !== null && "message" in errVal ? errVal.message : String(errVal); - backend.writeStderr(`js-exec: sandbox hardening failed: ${msg} -`); - backend.exit(1); - return { success: true }; - } - initResult.value.dispose(); - } - if (input.isModule) { - runtime.setModuleLoader( - (moduleName) => { - if (Object.hasOwn(VIRTUAL_MODULES, moduleName)) { - return VIRTUAL_MODULES[moduleName]; - } - try { - const data = backend.readFile(moduleName); - let source = new TextDecoder().decode(data); - if (moduleName.endsWith(".ts") || moduleName.endsWith(".mts")) { - source = stripTypeScriptTypes(source); - } - return source; - } catch (e) { - return { - error: new Error( - `Cannot find module '${moduleName}': ${e.message}` - ) - }; - } - }, - (baseModuleName, requestedName) => { - if (requestedName.startsWith("node:")) { - requestedName = requestedName.slice(5); - } - if (!requestedName.startsWith("./") && !requestedName.startsWith("../") && !requestedName.startsWith("/")) { - return requestedName; - } - const fromFile = baseModuleName === "" ? void 0 : baseModuleName; - return resolveModulePath(requestedName, fromFile, input.cwd); - } - ); - } - if (input.bootstrapCode) { - const bootstrapResult = context.evalCode( - input.bootstrapCode, - "bootstrap.js" - ); - if (bootstrapResult.error) { - const errorVal = context.dump(bootstrapResult.error); - bootstrapResult.error.dispose(); - const errorMsg = formatError(errorVal); - backend.writeStderr(`js-exec: bootstrap error: ${errorMsg} -`); - backend.exit(1); - return { success: true }; - } - bootstrapResult.value.dispose(); - } - if (input.hasInvokeTool) { - const toolsSetupResult = context.evalCode( - TOOLS_PROXY_SETUP_SOURCE, - "" - ); - if (toolsSetupResult.error) { - toolsSetupResult.error.dispose(); - } else { - toolsSetupResult.value.dispose(); - } - } - const filename = input.scriptPath || ""; - let jsCode = input.jsCode; - if (input.stripTypes) { - jsCode = stripTypeScriptTypes(jsCode); - } - const result = input.isModule ? context.evalCode(jsCode, filename, { type: "module" }) : context.evalCode(jsCode, filename); - if (result.error) { - const errorVal = context.dump(result.error); - result.error.dispose(); - const rawMsg = typeof errorVal === "object" && errorVal !== null && "message" in errorVal ? errorVal.message : String(errorVal); - if (rawMsg === "__EXIT__") { - return { success: true }; - } - const errorMsg = formatError(errorVal); - try { - backend.writeStderr(`${errorMsg} -`); - } catch { - } - backend.exit(1); - return { success: true }; - } - { - const pendingResult = runtime.executePendingJobs(); - if ("error" in pendingResult && pendingResult.error) { - const errorVal = context.dump(pendingResult.error); - pendingResult.error.dispose(); - const rawPendingMsg = typeof errorVal === "object" && errorVal !== null && "message" in errorVal ? errorVal.message : String(errorVal); - if (rawPendingMsg !== "__EXIT__") { - const errorMsg = formatError(errorVal); - try { - backend.writeStderr(`${errorMsg} -`); - } catch { - } - backend.exit(1); - return { success: true }; - } - return { success: true }; - } - } - result.value.dispose(); - backend.exit(0); - return { - success: true, - defenseStats: defense?.getStats() - }; - } catch (e) { - const message = e instanceof Error ? e.message : String(e); - try { - backend.writeStderr(`js-exec: ${message} -`); - } catch { - } - try { - backend.exit(1); - } catch { - return { success: false, error: message }; - } - return { success: true }; - } finally { - context?.dispose(); - runtime?.dispose(); - } -} -var initPromise = initializeWithDefense().catch((e) => { - parentPort?.postMessage({ - success: false, - // @banned-pattern-ignore: worker-internal init error; message stays within worker protocol, sanitized by js-exec.ts before user output - error: e.message, - defenseStats: defense?.getStats() - }); -}); -parentPort?.on("message", async (input) => { - try { - await initPromise; - const result = await executeCode(input); - result.defenseStats = defense?.getStats(); - result.protocolToken = input.protocolToken; - parentPort?.postMessage(result); - } catch (e) { - parentPort?.postMessage({ - protocolToken: input.protocolToken, - success: false, - // @banned-pattern-ignore: worker-internal error; message stays within worker protocol, sanitized by js-exec.ts before user output - error: e.message, - defenseStats: defense?.getStats() - }); - } -}); diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/ln-4LGSXXGD.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/ln-4LGSXXGD.js deleted file mode 100644 index f758b76..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/ln-4LGSXXGD.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-YS4NUBYX.js";import"./chunk-FOCWZZDE.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{b as flagsForFuzzing,a as lnCommand}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/ls-ZJGQER7M.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/ls-ZJGQER7M.js deleted file mode 100644 index 9278dca..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/ls-ZJGQER7M.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-R4IFXNY5.js";import"./chunk-STHBFACM.js";import"./chunk-QIQMJJZ4.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{b as flagsForFuzzing,a as lsCommand}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/md5sum-LU7RVIB7.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/md5sum-LU7RVIB7.js deleted file mode 100644 index 81511ee..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/md5sum-LU7RVIB7.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-CQV3EITV.js";import"./chunk-AXMYAPFA.js";import"./chunk-XEKXHOPO.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{b as flagsForFuzzing,a as md5sumCommand}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/mkdir-MEPGZOB6.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/mkdir-MEPGZOB6.js deleted file mode 100644 index f0e38d3..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/mkdir-MEPGZOB6.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-MLIO3BK2.js";import"./chunk-FOCWZZDE.js";import"./chunk-QIQMJJZ4.js";import"./chunk-W5DWRFSU.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{b as flagsForFuzzing,a as mkdirCommand}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/mv-W5BIQ646.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/mv-W5BIQ646.js deleted file mode 100644 index e44abe8..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/mv-W5BIQ646.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-ZDIT6ST5.js";import"./chunk-QIQMJJZ4.js";import"./chunk-W5DWRFSU.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{b as flagsForFuzzing,a as mvCommand}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/nl-Q2L5XQWZ.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/nl-Q2L5XQWZ.js deleted file mode 100644 index db9cdc8..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/nl-Q2L5XQWZ.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-RCXNPPJY.js";import"./chunk-XEKXHOPO.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{b as flagsForFuzzing,a as nl}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/od-RDSM4TQJ.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/od-RDSM4TQJ.js deleted file mode 100644 index 7979d20..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/od-RDSM4TQJ.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-KTL5PAHY.js";import"./chunk-XEKXHOPO.js";import"./chunk-BZUGFHVS.js";export{b as flagsForFuzzing,a as od}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/paste-ABCY7E6C.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/paste-ABCY7E6C.js deleted file mode 100644 index ab3d936..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/paste-ABCY7E6C.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-6NYPZ4NX.js";import"./chunk-XEKXHOPO.js";import"./chunk-QIQMJJZ4.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{b as flagsForFuzzing,a as pasteCommand}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/printf-JPOOWRJC.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/printf-JPOOWRJC.js deleted file mode 100644 index 55de164..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/printf-JPOOWRJC.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-MJLETYZI.js";import"./chunk-RBQG6ZUG.js";import"./chunk-27JIFWUR.js";import"./chunk-SAI2SPQQ.js";import"./chunk-W5DWRFSU.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{b as flagsForFuzzing,a as printfCommand}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/pwd-WE6EN5AV.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/pwd-WE6EN5AV.js deleted file mode 100644 index 63a3a57..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/pwd-WE6EN5AV.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-SHKOQWO4.js";import"./chunk-BZUGFHVS.js";export{b as flagsForFuzzing,a as pwdCommand}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/python3-JPCH6LLN.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/python3-JPCH6LLN.js deleted file mode 100644 index 74ab2b0..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/python3-JPCH6LLN.js +++ /dev/null @@ -1,12 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a as O,b as A}from"./chunk-AX2X3SZS.js";import"./chunk-WNH3HOQA.js";import"./chunk-HBVMHTO5.js";import{a as T,b}from"./chunk-SY4HAUHP.js";import"./chunk-L2UW7DWF.js";import{a as _}from"./chunk-DLL7UR66.js";import{c as y}from"./chunk-KAPG5ONA.js";import{b as v}from"./chunk-VACKIICN.js";import{c as E}from"./chunk-XEKXHOPO.js";import{a as D,b as c}from"./chunk-FOCWZZDE.js";import{a as w}from"./chunk-W5DWRFSU.js";import{a as P,b as M}from"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";import{randomBytes as Q}from"node:crypto";import{fileURLToPath as R}from"node:url";import{Worker as U}from"node:worker_threads";var H=1e4,I=6e4,L={name:"python3",summary:"Execute Python code via CPython Emscripten",usage:"python3 [OPTIONS] [-c CODE | -m MODULE | FILE] [ARGS...]",description:["Execute Python code using CPython compiled to WebAssembly via Emscripten.","","This command runs Python in an isolated environment with access to","the virtual filesystem. Standard library modules are available."],options:["-c CODE Execute CODE as Python script","-m MODULE Run library module as a script","--version Show Python version","--help Show this help"],examples:['python3 -c "print(1 + 2)"','python3 -c "import sys; print(sys.version)"',"python3 script.py","python3 script.py arg1 arg2",`echo 'print("hello")' | python3`],notes:["CPython runs in WebAssembly, so execution may be slower than native Python.","Standard library modules are available (no pip install).","Maximum execution time is 30 seconds by default."]};function z(r){let e={code:null,module:null,scriptFile:null,showVersion:!1,scriptArgs:[]};if(r.length===0)return e;let t=r.findIndex(o=>!o.startsWith("-")||o==="-"||o==="--");for(let o=0;o<(t===-1?r.length:t);o++){let s=r[o];if(s==="-c")return o+1>=r.length?{stdout:"",stderr:`python3: option requires an argument -- 'c' -`,exitCode:2}:(e.code=r[o+1],e.scriptArgs=r.slice(o+2),e);if(s==="-m")return o+1>=r.length?{stdout:"",stderr:`python3: option requires an argument -- 'm' -`,exitCode:2}:(e.module=r[o+1],e.scriptArgs=r.slice(o+2),e);if(s==="--version"||s==="-V")return e.showVersion=!0,e;if(s.startsWith("-")&&s!=="-")return{stdout:"",stderr:`python3: unrecognized option '${s}' -`,exitCode:2}}if(t!==-1){let o=r[t];o==="--"?t+10?t.error:"Worker execution failed"}}function a(r){if(r.isExecuting||r.executionQueue.length===0)return;for(;r.executionQueue.length>0&&r.executionQueue[0].canceled;)r.executionQueue.shift();if(r.executionQueue.length===0)return;let e=r.executionQueue.shift();if(!e)return;r.isExecuting=!0;let t;try{t=v.runTrusted(()=>new U(B,{workerData:e.input}))}catch(n){let i=n instanceof Error?n.message:String(n);e.resolve({success:!1,error:c(i)}),r.isExecuting=!1,a(r);return}e.workerRef&&(e.workerRef.current=t);let o=y(e.requireDefenseContext,"python3","worker message callback",n=>{e.resolve(j(n,e.input.protocolToken)),r.isExecuting=!1,t.terminate(),a(r)}),s=y(e.requireDefenseContext,"python3","worker error callback",n=>{let i=c(w(n));e.resolve({success:!1,error:i}),r.isExecuting=!1,a(r)}),p=y(e.requireDefenseContext,"python3","worker exit callback",()=>{r.isExecuting&&(e.resolve({success:!1,error:"Worker exited unexpectedly"}),r.isExecuting=!1,a(r))}),f=n=>{try{o(n)}catch(i){let m=i instanceof Error?i.message:String(i);e.resolve({success:!1,error:c(m)}),r.isExecuting=!1,t.terminate(),a(r)}},l=n=>{try{s(n)}catch(i){let m=i instanceof Error?i.message:String(i);e.resolve({success:!1,error:c(m)}),r.isExecuting=!1,a(r)}},g=()=>{try{p()}catch(n){let i=n instanceof Error?n.message:String(n);e.resolve({success:!1,error:c(i)}),r.isExecuting=!1,a(r)}};t.on("message",f),t.on("error",l),t.on("exit",g)}async function Y(r,e,t,o=[]){let s=O(),p=new A(s,e.fs,e.cwd,"python3",e.fetch,e.limits?.maxOutputSize??0),f=e.limits?.maxPythonTimeoutMs??H,l=e.fetch?Math.max(f,I):f,g=N(e.fs),n={protocolToken:V(),sharedBuffer:s,pythonCode:r,cwd:e.cwd,env:_(e.env),args:o,scriptPath:t,timeoutMs:l},i={current:null},m=new Promise(u=>{let d={input:n,resolve:()=>{},workerRef:i,requireDefenseContext:e.requireDefenseContext},F=y(e.requireDefenseContext,"python3","worker timeout callback",()=>{i.current?i.current.terminate():d.canceled=!0,u({success:!1,error:`Execution timeout: exceeded ${l}ms limit`})}),W=T(()=>{try{F()}catch(h){let $=h instanceof Error?h.message:String(h);u({success:!1,error:c($)})}},l);d.resolve=h=>{b(W),u(h)},g.executionQueue.push(d),a(g)}),[x,k]=await Promise.all([p.run(l).catch(u=>({stdout:"",stderr:`python3: bridge error: ${c(w(u))} -`,exitCode:1})),m.catch(u=>({success:!1,error:c(w(u))}))]);if(!k.success&&k.error){let u=c(k.error);return{stdout:x.stdout,stderr:`${x.stderr}python3: ${u} -`,exitCode:x.exitCode||1}}return{...x}}var Z={name:"python3",async execute(r,e){if(M(r))return P(L);let t=z(r);if("exitCode"in t)return t;if(t.showVersion)return{stdout:`Python 3.13.2 (Emscripten) -`,stderr:"",exitCode:0};let o,s;if(t.code!==null)o=t.code,s="-c";else if(t.module!==null){if(!/^[a-zA-Z_][a-zA-Z0-9_.]*$/.test(t.module))return{stdout:"",stderr:`python3: No module named '${t.module.slice(0,200)}' -`,exitCode:1};o=`import runpy; runpy.run_module('${t.module}', run_name='__main__')`,s=t.module}else if(t.scriptFile==="-")o=E(e.stdin),s="-";else if(t.scriptFile!==null){let p=e.fs.resolvePath(e.cwd,t.scriptFile);if(!await e.fs.exists(p))return{stdout:"",stderr:`python3: can't open file '${t.scriptFile}': [Errno 2] No such file or directory -`,exitCode:2};try{o=await e.fs.readFile(p),s=t.scriptFile}catch(f){let l=D(f.message);return{stdout:"",stderr:`python3: can't open file '${t.scriptFile}': ${l} -`,exitCode:2}}}else if(E(e.stdin).trim())o=E(e.stdin),s="";else return{stdout:"",stderr:`python3: no input provided (use -c CODE, -m MODULE, or provide a script file) -`,exitCode:2};return Y(o,e,s,t.scriptArgs)}},le={name:"python",async execute(r,e){return Z.execute(r,e)}};export{ue as _resetExecutionQueue,Z as python3Command,le as pythonCommand}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/readlink-OPJF4DL5.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/readlink-OPJF4DL5.js deleted file mode 100644 index e9b5a77..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/readlink-OPJF4DL5.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-WPGQVBSY.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{b as flagsForFuzzing,a as readlinkCommand}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/rev-GCV6X22K.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/rev-GCV6X22K.js deleted file mode 100644 index 1bb1837..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/rev-GCV6X22K.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-S2BIZAWY.js";import"./chunk-XEKXHOPO.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{b as flagsForFuzzing,a as rev}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/rg-EBMD72T4.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/rg-EBMD72T4.js deleted file mode 100644 index f6331af..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/rg-EBMD72T4.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-JNYYVLEL.js";import"./chunk-4WKZNNJK.js";import"./chunk-KSBHIW2H.js";import"./chunk-L2UW7DWF.js";import"./chunk-7CSMHFIJ.js";import"./chunk-XEKXHOPO.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{b as flagsForFuzzing,a as rgCommand}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/rm-SSGETQVQ.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/rm-SSGETQVQ.js deleted file mode 100644 index dc65409..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/rm-SSGETQVQ.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-LPJEKUCB.js";import"./chunk-FOCWZZDE.js";import"./chunk-QIQMJJZ4.js";import"./chunk-W5DWRFSU.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{b as flagsForFuzzing,a as rmCommand}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/rmdir-OC4ZLPYA.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/rmdir-OC4ZLPYA.js deleted file mode 100644 index 7061d64..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/rmdir-OC4ZLPYA.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-SJYEXC2Z.js";import"./chunk-QIQMJJZ4.js";import"./chunk-W5DWRFSU.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{b as flagsForFuzzing,a as rmdirCommand}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/sed-DX2SGXMF.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/sed-DX2SGXMF.js deleted file mode 100644 index 1c32208..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/sed-DX2SGXMF.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-IZ6KBTV7.js";import"./chunk-KAPG5ONA.js";import"./chunk-VACKIICN.js";import"./chunk-7CSMHFIJ.js";import"./chunk-XEKXHOPO.js";import"./chunk-SAI2SPQQ.js";import"./chunk-FOCWZZDE.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{b as flagsForFuzzing,a as sedCommand}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/seq-M5EC7Q57.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/seq-M5EC7Q57.js deleted file mode 100644 index 4d4bcb0..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/seq-M5EC7Q57.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-Y4LIDHSD.js";import"./chunk-BZUGFHVS.js";export{b as flagsForFuzzing,a as seqCommand}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/sha1sum-O6DM3TPQ.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/sha1sum-O6DM3TPQ.js deleted file mode 100644 index ac8841c..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/sha1sum-O6DM3TPQ.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-DVJY2RAX.js";import"./chunk-AXMYAPFA.js";import"./chunk-XEKXHOPO.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{b as flagsForFuzzing,a as sha1sumCommand}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/sha256sum-WPVZLZPS.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/sha256sum-WPVZLZPS.js deleted file mode 100644 index f83cc4c..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/sha256sum-WPVZLZPS.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-GHB6M7KA.js";import"./chunk-AXMYAPFA.js";import"./chunk-XEKXHOPO.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{b as flagsForFuzzing,a as sha256sumCommand}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/sleep-HZ4QEFOK.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/sleep-HZ4QEFOK.js deleted file mode 100644 index be439ad..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/sleep-HZ4QEFOK.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-XZUZRAAC.js";import"./chunk-SX2HC7SO.js";import"./chunk-SY4HAUHP.js";import"./chunk-VACKIICN.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{b as flagsForFuzzing,a as sleepCommand}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/sort-VW2NIZHW.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/sort-VW2NIZHW.js deleted file mode 100644 index 63fbb84..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/sort-VW2NIZHW.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-JTMQLUCH.js";import"./chunk-KTPCYKBB.js";import"./chunk-XEKXHOPO.js";import"./chunk-STHBFACM.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{b as flagsForFuzzing,a as sortCommand}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/split-NBMH43M2.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/split-NBMH43M2.js deleted file mode 100644 index efd7b36..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/split-NBMH43M2.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-6L65G6A7.js";import"./chunk-XEKXHOPO.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{b as flagsForFuzzing,a as split}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/sqlite3-UE3PJTDQ.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/sqlite3-UE3PJTDQ.js deleted file mode 100644 index 1ddf30a..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/sqlite3-UE3PJTDQ.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b,c}from"./chunk-55LZFN6S.js";import"./chunk-SY4HAUHP.js";import"./chunk-KAPG5ONA.js";import"./chunk-VACKIICN.js";import"./chunk-XEKXHOPO.js";import"./chunk-FOCWZZDE.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{a as _internals,c as flagsForFuzzing,b as sqlite3Command}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/stat-CD34IZ4P.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/stat-CD34IZ4P.js deleted file mode 100644 index 6a92c4a..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/stat-CD34IZ4P.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-SETW5JBN.js";import"./chunk-TDD4NFYE.js";import"./chunk-QIQMJJZ4.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{b as flagsForFuzzing,a as statCommand}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/strings-MCXFXPDL.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/strings-MCXFXPDL.js deleted file mode 100644 index 0608465..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/strings-MCXFXPDL.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-MFDPAVC6.js";import"./chunk-XEKXHOPO.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{b as flagsForFuzzing,a as strings}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/tac-BQ7EDZW2.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/tac-BQ7EDZW2.js deleted file mode 100644 index 0289be8..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/tac-BQ7EDZW2.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-LI6PTSPD.js";import"./chunk-XEKXHOPO.js";import"./chunk-BZUGFHVS.js";export{b as flagsForFuzzing,a as tac}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/tail-GJMTLMNE.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/tail-GJMTLMNE.js deleted file mode 100644 index 7598292..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/tail-GJMTLMNE.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-YWOZZRSK.js";import"./chunk-PDUL32DM.js";import"./chunk-XEKXHOPO.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{b as flagsForFuzzing,a as tailCommand}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/tar-WIZ3PDF4.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/tar-WIZ3PDF4.js deleted file mode 100644 index f87bf48..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/tar-WIZ3PDF4.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-HAIOEUEV.js";import"./chunk-TDD4NFYE.js";import"./chunk-VACKIICN.js";import"./chunk-7CSMHFIJ.js";import"./chunk-XEKXHOPO.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{b as flagsForFuzzing,a as tarCommand}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/tee-SGANDVNY.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/tee-SGANDVNY.js deleted file mode 100644 index 7752bf0..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/tee-SGANDVNY.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-LSLPJOYM.js";import"./chunk-XEKXHOPO.js";import"./chunk-QIQMJJZ4.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{b as flagsForFuzzing,a as teeCommand}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/time-FCZCDIAM.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/time-FCZCDIAM.js deleted file mode 100644 index dadf2cb..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/time-FCZCDIAM.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-2VDTE5BV.js";import"./chunk-HBVMHTO5.js";import"./chunk-L2UW7DWF.js";import"./chunk-DLL7UR66.js";import"./chunk-XEKXHOPO.js";import"./chunk-FOCWZZDE.js";import"./chunk-BZUGFHVS.js";export{b as flagsForFuzzing,a as timeCommand}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/timeout-VDIEAB4R.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/timeout-VDIEAB4R.js deleted file mode 100644 index 5a200ef..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/timeout-VDIEAB4R.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-XPK7ZFVA.js";import"./chunk-SX2HC7SO.js";import"./chunk-SY4HAUHP.js";import"./chunk-L2UW7DWF.js";import"./chunk-VACKIICN.js";import"./chunk-XEKXHOPO.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{b as flagsForFuzzing,a as timeoutCommand}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/touch-UA33VN3N.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/touch-UA33VN3N.js deleted file mode 100644 index c8269ce..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/touch-UA33VN3N.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-FZRQOL3C.js";import"./chunk-W5DWRFSU.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{b as flagsForFuzzing,a as touchCommand}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/tr-JNNR5JMS.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/tr-JNNR5JMS.js deleted file mode 100644 index 3b5bf2a..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/tr-JNNR5JMS.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-YRNR2VHY.js";import"./chunk-XEKXHOPO.js";import"./chunk-FOCWZZDE.js";import"./chunk-QIQMJJZ4.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{b as flagsForFuzzing,a as trCommand}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/tree-YLD52CNT.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/tree-YLD52CNT.js deleted file mode 100644 index c417a54..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/tree-YLD52CNT.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-7AISL3XV.js";import"./chunk-STHBFACM.js";import"./chunk-QIQMJJZ4.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{b as flagsForFuzzing,a as treeCommand}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/true-FHQXJXBE.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/true-FHQXJXBE.js deleted file mode 100644 index cc9576e..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/true-FHQXJXBE.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b,c,d}from"./chunk-HDRAUQK2.js";import"./chunk-BZUGFHVS.js";export{b as falseCommand,d as falseFlagsForFuzzing,c as flagsForFuzzing,a as trueCommand}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/unexpand-2TKXAENW.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/unexpand-2TKXAENW.js deleted file mode 100644 index 3d4ce1c..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/unexpand-2TKXAENW.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-AAGO7IQ5.js";import"./chunk-XEKXHOPO.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{b as flagsForFuzzing,a as unexpand}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/uniq-DMFKT3AB.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/uniq-DMFKT3AB.js deleted file mode 100644 index bd07d15..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/uniq-DMFKT3AB.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-5MV7Q5QB.js";import"./chunk-KTPCYKBB.js";import"./chunk-XEKXHOPO.js";import"./chunk-STHBFACM.js";import"./chunk-QIQMJJZ4.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{b as flagsForFuzzing,a as uniqCommand}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/wc-TZFYWFLA.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/wc-TZFYWFLA.js deleted file mode 100644 index 3941fa5..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/wc-TZFYWFLA.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-MTHXXA6H.js";import"./chunk-KTPCYKBB.js";import"./chunk-XEKXHOPO.js";import"./chunk-STHBFACM.js";import"./chunk-QIQMJJZ4.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{b as flagsForFuzzing,a as wcCommand}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/which-XEM24D5D.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/which-XEM24D5D.js deleted file mode 100644 index 88e23c5..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/which-XEM24D5D.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-2SMD2AUA.js";import"./chunk-QIQMJJZ4.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{b as flagsForFuzzing,a as whichCommand}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/whoami-XMTX52VE.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/whoami-XMTX52VE.js deleted file mode 100644 index a30cbdf..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/whoami-XMTX52VE.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-4MZPEZTU.js";import"./chunk-BZUGFHVS.js";export{b as flagsForFuzzing,a as whoami}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/worker.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/worker.js deleted file mode 100644 index a599645..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/worker.js +++ /dev/null @@ -1,3151 +0,0 @@ -var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { - get: (a, b) => (typeof require !== "undefined" ? require : a)[b] -}) : x)(function(x) { - if (typeof require !== "undefined") return require.apply(this, arguments); - throw Error('Dynamic require of "' + x + '" is not supported'); -}); - -// src/commands/python3/worker.ts -import { createRequire } from "node:module"; -import { dirname } from "node:path"; -import { parentPort, workerData } from "node:worker_threads"; - -// src/fs/sanitize-error.ts -function sanitizeWithUnixPrefixes(message, includeHostRuntimePrefixes, includeFileUrls) { - if (!message) return message; - let sanitized = message.replace(/\n\s+at\s.*/g, ""); - if (includeFileUrls) { - sanitized = sanitized.replace(/\bfile:\/\/\/?[^\s'",)}\]:]+/g, ""); - } - sanitized = sanitized.replace( - includeHostRuntimePrefixes ? /(?:\/(?:Users|home|private|var|opt|Library|System|usr|etc|tmp|nix|snap|workspace|root|srv|mnt|app))\b[^\s'",)}\]:]*/g : /(?:\/(?:Users|home|private|var|opt|Library|System|usr|etc|tmp|nix|snap))\b[^\s'",)}\]:]*/g, - "" - ); - sanitized = sanitized.replace(/node:internal\/[^\s'",)}\]:]+/g, ""); - sanitized = sanitized.replace(/[A-Z]:\\[^\s'",)}\]:]+/g, ""); - if (includeFileUrls) { - sanitized = sanitized.replace(/\\\\[^\s\\]+\\[^\s'",)}\]:]+/g, ""); - } - return sanitized; -} -function sanitizeErrorMessage(message) { - return sanitizeWithUnixPrefixes(message, false, false); -} -function sanitizeHostErrorMessage(message) { - return sanitizeWithUnixPrefixes(message, true, true); -} - -// src/security/blocked-globals.ts -function getBlockedGlobals() { - const globals = [ - // Direct code execution vectors - { - prop: "Function", - target: globalThis, - violationType: "function_constructor", - strategy: "throw", - reason: "Function constructor allows arbitrary code execution" - }, - { - prop: "eval", - target: globalThis, - violationType: "eval", - strategy: "throw", - reason: "eval() allows arbitrary code execution" - }, - // Timer functions with string argument allow code execution - { - prop: "setTimeout", - target: globalThis, - violationType: "setTimeout", - strategy: "throw", - reason: "setTimeout with string argument allows code execution" - }, - { - prop: "setInterval", - target: globalThis, - violationType: "setInterval", - strategy: "throw", - reason: "setInterval with string argument allows code execution" - }, - { - prop: "setImmediate", - target: globalThis, - violationType: "setImmediate", - strategy: "throw", - reason: "setImmediate could be used to escape sandbox context" - }, - // Note: We intentionally do NOT block `process` entirely because: - // 1. Node.js internals (Promise resolution, etc.) use process.nextTick - // 2. Blocking process entirely breaks normal async operation - // 3. The primary code execution vectors (Function, eval) are already blocked - // However, we DO block specific dangerous process properties. - { - prop: "env", - target: process, - violationType: "process_env", - strategy: "throw", - reason: "process.env could leak sensitive environment variables", - // Node.js internals and bundled dependencies read these env vars - // during module loading, file watching, and I/O within the - // AsyncLocalStorage context. None are user secrets. - allowedKeys: /* @__PURE__ */ new Set([ - // Node.js core - "NODE_V8_COVERAGE", - "NODE_DEBUG", - "NODE_DEBUG_NATIVE", - "NODE_COMPILE_CACHE", - "WATCH_REPORT_DEPENDENCIES", - // Dependencies - "FORCE_COLOR", - // chalk/supports-color - "DEBUG", - // debug package - "UNDICI_NO_FG", - // undici (Node.js fetch) - "JEST_WORKER_ID", - // jest/vitest worker detection - "__MINIMATCH_TESTING_PLATFORM__", - // minimatch - "LOG_TOKENS", - // query engine debug logging - "LOG_STREAM" - // query engine debug logging - ]) - }, - { - prop: "binding", - target: process, - violationType: "process_binding", - strategy: "throw", - reason: "process.binding provides access to native Node.js modules" - }, - { - prop: "_linkedBinding", - target: process, - violationType: "process_binding", - strategy: "throw", - reason: "process._linkedBinding provides access to native Node.js modules" - }, - { - prop: "dlopen", - target: process, - violationType: "process_dlopen", - strategy: "throw", - reason: "process.dlopen allows loading native addons" - }, - { - prop: "getBuiltinModule", - target: process, - violationType: "process_get_builtin_module", - strategy: "throw", - reason: "process.getBuiltinModule allows loading native Node.js modules (fs, child_process, vm)" - }, - // Note: process.mainModule is handled specially in defense-in-depth-box.ts - // and worker-defense-in-depth.ts because it may be undefined in ESM contexts - // but we still want to block both reading and setting it. - // Process control vectors - { - prop: "exit", - target: process, - violationType: "process_exit", - strategy: "throw", - reason: "process.exit could terminate the interpreter" - }, - { - prop: "abort", - target: process, - violationType: "process_exit", - strategy: "throw", - reason: "process.abort could crash the interpreter" - }, - { - prop: "kill", - target: process, - violationType: "process_kill", - strategy: "throw", - reason: "process.kill could signal other processes" - }, - // Privilege escalation vectors - { - prop: "setuid", - target: process, - violationType: "process_setuid", - strategy: "throw", - reason: "process.setuid could escalate privileges" - }, - { - prop: "setgid", - target: process, - violationType: "process_setuid", - strategy: "throw", - reason: "process.setgid could escalate privileges" - }, - { - prop: "seteuid", - target: process, - violationType: "process_setuid", - strategy: "throw", - reason: "process.seteuid could escalate effective user privileges" - }, - { - prop: "setegid", - target: process, - violationType: "process_setuid", - strategy: "throw", - reason: "process.setegid could escalate effective group privileges" - }, - { - prop: "initgroups", - target: process, - violationType: "process_setuid", - strategy: "throw", - reason: "process.initgroups could modify supplementary group IDs" - }, - { - prop: "setgroups", - target: process, - violationType: "process_setuid", - strategy: "throw", - reason: "process.setgroups could modify supplementary group IDs" - }, - // File permission manipulation - { - prop: "umask", - target: process, - violationType: "process_umask", - strategy: "throw", - reason: "process.umask could modify file creation permissions" - }, - // Information disclosure vectors - // Note: process.argv is an array (object) so gets an object proxy - { - prop: "argv", - target: process, - violationType: "process_argv", - strategy: "throw", - reason: "process.argv may contain secrets in CLI arguments" - }, - // Note: process.execPath is a string primitive, handled specially - // in defense-in-depth-box.ts and worker-defense-in-depth.ts - // Note: process.connected is a boolean primitive, handled specially - // in defense-in-depth-box.ts and worker-defense-in-depth.ts - // Working directory access/manipulation - { - prop: "cwd", - target: process, - violationType: "process_chdir", - strategy: "throw", - reason: "process.cwd could disclose real host working directory path" - }, - { - prop: "chdir", - target: process, - violationType: "process_chdir", - strategy: "throw", - reason: "process.chdir could confuse the interpreter's CWD tracking" - }, - // Diagnostic report (leaks full environment, host paths, system info) - { - prop: "report", - target: process, - violationType: "process_report", - strategy: "throw", - reason: "process.report could disclose full environment, host paths, and system info" - }, - // Environment file loading (Node 21.7+) - { - prop: "loadEnvFile", - target: process, - violationType: "process_env", - strategy: "throw", - reason: "process.loadEnvFile could load env files bypassing env proxy" - }, - // Exception handler manipulation - { - prop: "setUncaughtExceptionCaptureCallback", - target: process, - violationType: "process_exception_handler", - strategy: "throw", - reason: "setUncaughtExceptionCaptureCallback could intercept security errors" - }, - // IPC communication vectors (may be undefined in non-IPC contexts) - { - prop: "send", - target: process, - violationType: "process_send", - strategy: "throw", - reason: "process.send could communicate with parent process in IPC contexts" - }, - { - prop: "channel", - target: process, - violationType: "process_channel", - strategy: "throw", - reason: "process.channel could access IPC channel to parent process" - }, - // Timing side-channel vectors - { - prop: "cpuUsage", - target: process, - violationType: "process_timing", - strategy: "throw", - reason: "process.cpuUsage could enable timing side-channel attacks" - }, - { - prop: "memoryUsage", - target: process, - violationType: "process_timing", - strategy: "throw", - reason: "process.memoryUsage could enable timing side-channel attacks" - }, - { - prop: "hrtime", - target: process, - violationType: "process_timing", - strategy: "throw", - reason: "process.hrtime could enable timing side-channel attacks" - }, - // We also don't block `require` because: - // 1. It may not exist in all environments (ESM) - // 2. import() is the modern escape vector and can't be blocked this way - // Reference leak vectors - { - prop: "WeakRef", - target: globalThis, - violationType: "weak_ref", - strategy: "throw", - reason: "WeakRef could be used to leak references outside sandbox" - }, - { - prop: "FinalizationRegistry", - target: globalThis, - violationType: "finalization_registry", - strategy: "throw", - reason: "FinalizationRegistry could be used to leak references outside sandbox" - }, - // Introspection/interception vectors (freeze instead of throw) - // SECURITY RATIONALE: Reflect is frozen (not blocked) because: - // 1. Defense infrastructure uses Reflect.apply/get/set/construct internally - // 2. Frozen Reflect cannot be mutated but remains fully functional - // 3. Reflect.construct(Function, ['code']) IS safe because globalThis.Function - // is replaced with a blocking proxy — Reflect.construct receives the proxy - // 4. Security depends on NEVER leaking original Function/eval references. - // If an unpatched Function ref leaked, Reflect.construct would bypass defense. - { - prop: "Reflect", - target: globalThis, - violationType: "reflect", - strategy: "freeze", - reason: "Reflect provides introspection capabilities" - }, - { - prop: "Proxy", - target: globalThis, - violationType: "proxy", - strategy: "throw", - reason: "Proxy allows intercepting and modifying object behavior" - }, - // WebAssembly allows arbitrary code execution - { - prop: "WebAssembly", - target: globalThis, - violationType: "webassembly", - strategy: "throw", - reason: "WebAssembly allows executing arbitrary compiled code" - }, - // SharedArrayBuffer and Atomics can enable side-channel attacks - { - prop: "SharedArrayBuffer", - target: globalThis, - violationType: "shared_array_buffer", - strategy: "throw", - reason: "SharedArrayBuffer could enable side-channel communication or timing attacks" - }, - { - prop: "Atomics", - target: globalThis, - violationType: "atomics", - strategy: "throw", - reason: "Atomics could enable side-channel communication or timing attacks" - }, - // Note: Error.prepareStackTrace is handled specially in defense-in-depth-box.ts - // because we only want to block SETTING it, not reading (V8 reads it internally) - // Timing side-channel: performance.now() provides sub-millisecond resolution - // Note: Date.now() is intentionally NOT blocked — it's used for $SECONDS, - // date command, and has only ~1ms resolution (vs process.hrtime at ns). - { - prop: "performance", - target: globalThis, - violationType: "performance_timing", - strategy: "throw", - reason: "performance.now() provides sub-millisecond timing for side-channel attacks" - }, - // Block direct access to process.stdout and process.stderr to prevent - // writing to the host's actual stdout/stderr, bypassing the interpreter's - // output accumulation. - { - prop: "stdout", - target: process, - violationType: "process_stdout", - strategy: "throw", - reason: "process.stdout could bypass interpreter output to write to host stdout" - }, - { - prop: "stderr", - target: process, - violationType: "process_stderr", - strategy: "throw", - reason: "process.stderr could bypass interpreter output to write to host stderr" - }, - // Prototype pollution vectors - { - prop: "__defineGetter__", - target: Object.prototype, - violationType: "prototype_mutation", - strategy: "throw", - reason: "__defineGetter__ allows prototype pollution via getter injection" - }, - { - prop: "__defineSetter__", - target: Object.prototype, - violationType: "prototype_mutation", - strategy: "throw", - reason: "__defineSetter__ allows prototype pollution via setter injection" - }, - { - prop: "__lookupGetter__", - target: Object.prototype, - violationType: "prototype_mutation", - strategy: "throw", - reason: "__lookupGetter__ enables introspection for prototype pollution attacks" - }, - { - prop: "__lookupSetter__", - target: Object.prototype, - violationType: "prototype_mutation", - strategy: "throw", - reason: "__lookupSetter__ enables introspection for prototype pollution attacks" - }, - // Freeze JSON and Math to prevent mutation of built-in utility objects - { - prop: "JSON", - target: globalThis, - violationType: "json_mutation", - strategy: "freeze", - reason: "Freeze JSON to prevent mutation of parsing/serialization" - }, - { - prop: "Math", - target: globalThis, - violationType: "math_mutation", - strategy: "freeze", - reason: "Freeze Math to prevent mutation of math utilities" - } - ]; - try { - const AsyncFunction = Object.getPrototypeOf(async () => { - }).constructor; - if (AsyncFunction && AsyncFunction !== Function) { - globals.push({ - prop: "constructor", - target: Object.getPrototypeOf(async () => { - }), - violationType: "async_function_constructor", - strategy: "throw", - reason: "AsyncFunction constructor allows arbitrary async code execution" - }); - } - } catch { - } - try { - const GeneratorFunction = Object.getPrototypeOf( - function* () { - } - ).constructor; - if (GeneratorFunction && GeneratorFunction !== Function) { - globals.push({ - prop: "constructor", - target: Object.getPrototypeOf(function* () { - }), - violationType: "generator_function_constructor", - strategy: "throw", - reason: "GeneratorFunction constructor allows arbitrary generator code execution" - }); - } - } catch { - } - try { - const AsyncGeneratorFunction = Object.getPrototypeOf( - async function* () { - } - ).constructor; - if (AsyncGeneratorFunction && AsyncGeneratorFunction !== Function && AsyncGeneratorFunction !== Object.getPrototypeOf(async () => { - }).constructor) { - globals.push({ - prop: "constructor", - target: Object.getPrototypeOf(async function* () { - }), - violationType: "async_generator_function_constructor", - strategy: "throw", - reason: "AsyncGeneratorFunction constructor allows arbitrary async generator code execution" - }); - } - } catch { - } - return globals.filter((g) => { - try { - return g.target[g.prop] !== void 0; - } catch { - return false; - } - }); -} - -// src/security/defense-in-depth-box.ts -var IS_BROWSER = typeof __BROWSER__ !== "undefined" && __BROWSER__; -var AsyncLocalStorageClass = null; -if (!IS_BROWSER) { - try { - const { AsyncLocalStorage } = __require("node:async_hooks"); - AsyncLocalStorageClass = AsyncLocalStorage; - } catch { - } -} -var executionContext = !IS_BROWSER && AsyncLocalStorageClass ? new AsyncLocalStorageClass() : null; - -// src/security/worker-defense-in-depth.ts -var DEFENSE_IN_DEPTH_NOTICE = "\n\nThis is a defense-in-depth measure and indicates a bug in just-bash. Please report this at security@vercel.com"; -var WorkerSecurityViolationError = class extends Error { - constructor(message, violation) { - super(message + DEFENSE_IN_DEPTH_NOTICE); - this.violation = violation; - this.name = "WorkerSecurityViolationError"; - } - violation; -}; -var MAX_STORED_VIOLATIONS = 1e3; -function generateExecutionId() { - if (typeof crypto !== "undefined" && crypto.randomUUID) { - return crypto.randomUUID(); - } - return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => { - const r = Math.random() * 16 | 0; - const v = c === "x" ? r : r & 3 | 8; - return v.toString(16); - }); -} -var WorkerDefenseInDepth = class { - config; - isActivated = false; - originalDescriptors = []; - violations = []; - executionId; - /** - * Original Proxy constructor, captured before patching. - * This is captured at instance creation time to ensure we get the unpatched version. - */ - originalProxy; - /** - * Recursion guard to prevent infinite loops when proxy traps trigger - * code that accesses the same proxied object (e.g., process.env). - */ - inTrap = false; - /** - * Create and activate the worker defense layer. - * - * @param config - Configuration for the defense layer - */ - constructor(config) { - this.originalProxy = Proxy; - this.config = config; - this.executionId = generateExecutionId(); - if (config.enabled !== false) { - this.activate(); - } - } - /** - * Get statistics about the defense layer. - */ - getStats() { - return { - violationsBlocked: this.violations.length, - violations: [...this.violations], - isActive: this.isActivated - }; - } - /** - * Clear stored violations. Useful for testing. - */ - clearViolations() { - this.violations = []; - } - /** - * Get the execution ID for this worker. - */ - getExecutionId() { - return this.executionId; - } - /** - * Deactivate the defense layer and restore original globals. - * Typically only needed for testing. - */ - deactivate() { - if (!this.isActivated) { - return; - } - this.restorePatches(); - this.isActivated = false; - } - /** - * Activate the defense layer by applying patches. - */ - activate() { - if (this.isActivated) { - return; - } - this.applyPatches(); - this.isActivated = true; - } - /** - * Get a human-readable path for a target object and property. - */ - getPathForTarget(target, prop) { - if (target === globalThis) { - return `globalThis.${prop}`; - } - if (typeof process !== "undefined" && target === process) { - return `process.${prop}`; - } - if (target === Error) { - return `Error.${prop}`; - } - if (target === Function.prototype) { - return `Function.prototype.${prop}`; - } - if (target === Object.prototype) { - return `Object.prototype.${prop}`; - } - return `.${prop}`; - } - /** - * Record a violation and invoke the callback. - * In worker context, blocking always happens (no audit mode context check). - */ - recordViolation(type, path, message) { - const violation = { - timestamp: Date.now(), - type, - message, - path, - stack: new Error().stack, - executionId: this.executionId - }; - if (this.violations.length < MAX_STORED_VIOLATIONS) { - this.violations.push(violation); - } - if (this.config.onViolation) { - try { - this.config.onViolation(violation); - } catch (e) { - console.debug( - "[WorkerDefenseInDepth] onViolation callback threw:", - e instanceof Error ? e.message : e - ); - } - } - return violation; - } - /** - * Create a blocking proxy for a function. - * In worker context, always blocks (no context check needed). - */ - createBlockingProxy(original, path, violationType) { - const self = this; - const auditMode = this.config.auditMode; - return new this.originalProxy(original, { - apply(target, thisArg, args) { - const message = `${path} is blocked in worker context`; - const violation = self.recordViolation(violationType, path, message); - if (!auditMode) { - throw new WorkerSecurityViolationError(message, violation); - } - return Reflect.apply(target, thisArg, args); - }, - construct(target, args, newTarget) { - const message = `${path} constructor is blocked in worker context`; - const violation = self.recordViolation(violationType, path, message); - if (!auditMode) { - throw new WorkerSecurityViolationError(message, violation); - } - return Reflect.construct(target, args, newTarget); - } - }); - } - /** - * Create a blocking proxy for an object (blocks all property access). - */ - createBlockingObjectProxy(original, path, violationType, allowedKeys) { - const self = this; - const auditMode = this.config.auditMode; - return new this.originalProxy(original, { - get(target, prop, receiver) { - if (self.inTrap) { - return Reflect.get(target, prop, receiver); - } - if (allowedKeys && typeof prop === "string" && allowedKeys.has(prop)) { - return Reflect.get(target, prop, receiver); - } - self.inTrap = true; - try { - const fullPath = `${path}.${String(prop)}`; - const message = `${fullPath} is blocked in worker context`; - const violation = self.recordViolation( - violationType, - fullPath, - message - ); - if (!auditMode) { - throw new WorkerSecurityViolationError(message, violation); - } - return Reflect.get(target, prop, receiver); - } finally { - self.inTrap = false; - } - }, - set(target, prop, value, receiver) { - const setValue = () => path === "process.env" && prop === "DEBUG" ? Reflect.set(target, prop, value) : Reflect.set(target, prop, value, receiver); - if (self.inTrap) { - return setValue(); - } - self.inTrap = true; - try { - const fullPath = `${path}.${String(prop)}`; - const message = `${fullPath} modification is blocked in worker context`; - const violation = self.recordViolation( - violationType, - fullPath, - message - ); - if (!auditMode) { - throw new WorkerSecurityViolationError(message, violation); - } - return setValue(); - } finally { - self.inTrap = false; - } - }, - ownKeys(target) { - if (self.inTrap) { - return Reflect.ownKeys(target); - } - self.inTrap = true; - try { - const message = `${path} enumeration is blocked in worker context`; - const violation = self.recordViolation(violationType, path, message); - if (!auditMode) { - throw new WorkerSecurityViolationError(message, violation); - } - return Reflect.ownKeys(target); - } finally { - self.inTrap = false; - } - }, - getOwnPropertyDescriptor(target, prop) { - if (self.inTrap) { - return Reflect.getOwnPropertyDescriptor(target, prop); - } - self.inTrap = true; - try { - const fullPath = `${path}.${String(prop)}`; - const message = `${fullPath} descriptor access is blocked in worker context`; - const violation = self.recordViolation( - violationType, - fullPath, - message - ); - if (!auditMode) { - throw new WorkerSecurityViolationError(message, violation); - } - return Reflect.getOwnPropertyDescriptor(target, prop); - } finally { - self.inTrap = false; - } - }, - has(target, prop) { - if (self.inTrap) { - return Reflect.has(target, prop); - } - self.inTrap = true; - try { - const fullPath = `${path}.${String(prop)}`; - const message = `${fullPath} existence check is blocked in worker context`; - const violation = self.recordViolation( - violationType, - fullPath, - message - ); - if (!auditMode) { - throw new WorkerSecurityViolationError(message, violation); - } - return Reflect.has(target, prop); - } finally { - self.inTrap = false; - } - }, - deleteProperty(target, prop) { - if (self.inTrap) { - return Reflect.deleteProperty(target, prop); - } - self.inTrap = true; - try { - const fullPath = `${path}.${String(prop)}`; - const message = `${fullPath} deletion is blocked in worker context`; - const violation = self.recordViolation( - violationType, - fullPath, - message - ); - if (!auditMode) { - throw new WorkerSecurityViolationError(message, violation); - } - return Reflect.deleteProperty(target, prop); - } finally { - self.inTrap = false; - } - }, - setPrototypeOf(target, proto) { - if (self.inTrap) { - return Reflect.setPrototypeOf(target, proto); - } - self.inTrap = true; - try { - const message = `${path} setPrototypeOf is blocked in worker context`; - const violation = self.recordViolation(violationType, path, message); - if (!auditMode) { - throw new WorkerSecurityViolationError(message, violation); - } - return Reflect.setPrototypeOf(target, proto); - } finally { - self.inTrap = false; - } - }, - defineProperty(target, prop, descriptor) { - if (self.inTrap) { - return Reflect.defineProperty(target, prop, descriptor); - } - self.inTrap = true; - try { - const fullPath = `${path}.${String(prop)}`; - const message = `${fullPath} defineProperty is blocked in worker context`; - const violation = self.recordViolation( - violationType, - fullPath, - message - ); - if (!auditMode) { - throw new WorkerSecurityViolationError(message, violation); - } - return Reflect.defineProperty(target, prop, descriptor); - } finally { - self.inTrap = false; - } - } - }); - } - /** - * Apply security patches to dangerous globals. - */ - applyPatches() { - const blockedGlobals = getBlockedGlobals(); - const excludeTypes = new Set(this.config.excludeViolationTypes ?? []); - for (const blocked of blockedGlobals) { - if (excludeTypes.has(blocked.violationType)) { - continue; - } - this.applyPatch(blocked); - } - if (!excludeTypes.has("function_constructor")) { - this.protectConstructorChain(excludeTypes); - } - if (!excludeTypes.has("error_prepare_stack_trace")) { - this.protectErrorPrepareStackTrace(); - } - if (!excludeTypes.has("module_load")) { - this.protectModuleLoad(); - } - if (!excludeTypes.has("module_resolve_filename")) { - this.protectModuleResolveFilename(); - } - if (!excludeTypes.has("process_main_module")) { - this.protectProcessMainModule(); - } - if (!excludeTypes.has("process_exec_path")) { - this.protectProcessExecPath(); - } - if (!excludeTypes.has("process_connected")) { - this.protectProcessConnected(); - } - this.lockWellKnownSymbols(); - if (!excludeTypes.has("proxy")) { - this.protectProxyRevocable(); - } - } - /** - * Lock well-known Symbol properties on built-in constructors/prototypes. - */ - lockWellKnownSymbols() { - const lock = (obj, sym) => { - try { - const desc = Object.getOwnPropertyDescriptor(obj, sym); - if (desc?.configurable) { - if ("value" in desc) { - Object.defineProperty(obj, sym, { - ...desc, - configurable: false, - writable: false - }); - return; - } - Object.defineProperty(obj, sym, { ...desc, configurable: false }); - } - } catch { - } - }; - for (const ctor of [Array, Map, Set, RegExp, Promise]) { - lock(ctor, Symbol.species); - } - for (const proto of [ - Array.prototype, - String.prototype, - Map.prototype, - Set.prototype - ]) { - lock(proto, Symbol.iterator); - } - lock(Symbol.prototype, Symbol.toPrimitive); - lock(Date.prototype, Symbol.toPrimitive); - for (const sym of [ - Symbol.match, - Symbol.matchAll, - Symbol.replace, - Symbol.search, - Symbol.split - ]) { - lock(RegExp.prototype, sym); - } - lock(Function.prototype, Symbol.hasInstance); - lock(Array.prototype, Symbol.unscopables); - for (const proto of [ - Map.prototype, - Set.prototype, - Promise.prototype, - ArrayBuffer.prototype - ]) { - lock(proto, Symbol.toStringTag); - } - try { - const stackDesc = Object.getOwnPropertyDescriptor( - Error, - "stackTraceLimit" - ); - this.originalDescriptors.push({ - target: Error, - prop: "stackTraceLimit", - descriptor: stackDesc - }); - Object.defineProperty(Error, "stackTraceLimit", { - value: Error.stackTraceLimit, - writable: false, - configurable: true - }); - } catch { - } - } - /** - * Block Proxy.revocable to prevent bypassing Proxy constructor blocking. - * - * Proxy.revocable internally uses the real Proxy constructor, so it bypasses - * our blocking proxy on globalThis.Proxy. We replace it with a wrapper that - * always blocks in worker context. - */ - protectProxyRevocable() { - const self = this; - const auditMode = this.config.auditMode; - try { - const originalRevocable = this.originalProxy.revocable; - if (typeof originalRevocable !== "function") return; - const descriptor = Object.getOwnPropertyDescriptor( - this.originalProxy, - "revocable" - ); - this.originalDescriptors.push({ - target: this.originalProxy, - prop: "revocable", - descriptor - }); - Object.defineProperty(this.originalProxy, "revocable", { - value: function revocable(_target, _handler) { - const message = "Proxy.revocable is blocked in worker context"; - const violation = self.recordViolation( - "proxy", - "Proxy.revocable", - message - ); - if (!auditMode) { - throw new WorkerSecurityViolationError(message, violation); - } - return originalRevocable(_target, _handler); - }, - writable: false, - configurable: true - // Must be configurable for restoration - }); - } catch { - } - } - /** - * Protect against .constructor.constructor escape vector. - * @param excludeTypes - Set of violation types to skip - */ - protectConstructorChain(excludeTypes) { - let AsyncFunction = null; - let GeneratorFunction = null; - let AsyncGeneratorFunction = null; - try { - AsyncFunction = Object.getPrototypeOf(async () => { - }).constructor; - } catch { - } - try { - GeneratorFunction = Object.getPrototypeOf(function* () { - }).constructor; - } catch { - } - try { - AsyncGeneratorFunction = Object.getPrototypeOf( - async function* () { - } - ).constructor; - } catch { - } - this.patchPrototypeConstructor( - Function.prototype, - "Function.prototype.constructor", - "function_constructor" - ); - if (!excludeTypes.has("async_function_constructor") && AsyncFunction && AsyncFunction !== Function) { - this.patchPrototypeConstructor( - AsyncFunction.prototype, - "AsyncFunction.prototype.constructor", - "async_function_constructor" - ); - } - if (!excludeTypes.has("generator_function_constructor") && GeneratorFunction && GeneratorFunction !== Function) { - this.patchPrototypeConstructor( - GeneratorFunction.prototype, - "GeneratorFunction.prototype.constructor", - "generator_function_constructor" - ); - } - if (!excludeTypes.has("async_generator_function_constructor") && AsyncGeneratorFunction && AsyncGeneratorFunction !== Function && AsyncGeneratorFunction !== AsyncFunction) { - this.patchPrototypeConstructor( - AsyncGeneratorFunction.prototype, - "AsyncGeneratorFunction.prototype.constructor", - "async_generator_function_constructor" - ); - } - } - /** - * Protect Error.prepareStackTrace from being set. - */ - protectErrorPrepareStackTrace() { - const self = this; - const auditMode = this.config.auditMode; - try { - const originalDescriptor = Object.getOwnPropertyDescriptor( - Error, - "prepareStackTrace" - ); - this.originalDescriptors.push({ - target: Error, - prop: "prepareStackTrace", - descriptor: originalDescriptor - }); - let currentValue = originalDescriptor?.value; - Object.defineProperty(Error, "prepareStackTrace", { - get() { - return currentValue; - }, - set(value) { - const message = "Error.prepareStackTrace modification is blocked in worker context"; - const violation = self.recordViolation( - "error_prepare_stack_trace", - "Error.prepareStackTrace", - message - ); - if (!auditMode) { - throw new WorkerSecurityViolationError(message, violation); - } - currentValue = value; - }, - configurable: true - }); - } catch { - } - } - /** - * Patch a prototype's constructor property. - * - * Returns a proxy that allows reading properties (like .name) but blocks - * calling the constructor as a function (which would allow code execution). - */ - patchPrototypeConstructor(prototype, path, violationType) { - const self = this; - const auditMode = this.config.auditMode; - try { - const originalDescriptor = Object.getOwnPropertyDescriptor( - prototype, - "constructor" - ); - this.originalDescriptors.push({ - target: prototype, - prop: "constructor", - descriptor: originalDescriptor - }); - const originalValue = originalDescriptor?.value; - const constructorProxy = originalValue && typeof originalValue === "function" ? new this.originalProxy(originalValue, { - apply(_target, _thisArg, _args) { - const message = `${path} invocation is blocked in worker context`; - const violation = self.recordViolation( - violationType, - path, - message - ); - if (!auditMode) { - throw new WorkerSecurityViolationError(message, violation); - } - return void 0; - }, - construct(_target, _args, _newTarget) { - const message = `${path} construction is blocked in worker context`; - const violation = self.recordViolation( - violationType, - path, - message - ); - if (!auditMode) { - throw new WorkerSecurityViolationError(message, violation); - } - return {}; - }, - // Allow all property access (like .name, .prototype, etc.) - get(target, prop, receiver) { - return Reflect.get(target, prop, receiver); - }, - getPrototypeOf(target) { - return Reflect.getPrototypeOf(target); - }, - has(target, prop) { - return Reflect.has(target, prop); - }, - ownKeys(target) { - return Reflect.ownKeys(target); - }, - getOwnPropertyDescriptor(target, prop) { - return Reflect.getOwnPropertyDescriptor(target, prop); - } - }) : originalValue; - Object.defineProperty(prototype, "constructor", { - get() { - return constructorProxy; - }, - set(value) { - const message = `${path} modification is blocked in worker context`; - const violation = self.recordViolation(violationType, path, message); - if (!auditMode) { - throw new WorkerSecurityViolationError(message, violation); - } - Object.defineProperty(this, "constructor", { - value, - writable: true, - configurable: true - }); - }, - configurable: true - }); - } catch { - } - } - /** - * Protect process.mainModule from being accessed or set. - * - * The attack vector is: - * ``` - * process.mainModule.require('child_process').execSync('whoami') - * process.mainModule.constructor._load('vm') - * ``` - * - * process.mainModule may be undefined in ESM contexts but could exist in - * CommonJS workers. We block both reading and setting. - */ - protectProcessMainModule() { - if (typeof process === "undefined") return; - const self = this; - const auditMode = this.config.auditMode; - try { - const originalDescriptor = Object.getOwnPropertyDescriptor( - process, - "mainModule" - ); - this.originalDescriptors.push({ - target: process, - prop: "mainModule", - descriptor: originalDescriptor - }); - const currentValue = originalDescriptor?.value; - if (currentValue !== void 0) { - Object.defineProperty(process, "mainModule", { - get() { - const message = "process.mainModule access is blocked in worker context"; - const violation = self.recordViolation( - "process_main_module", - "process.mainModule", - message - ); - if (!auditMode) { - throw new WorkerSecurityViolationError(message, violation); - } - return currentValue; - }, - set(value) { - const message = "process.mainModule modification is blocked in worker context"; - const violation = self.recordViolation( - "process_main_module", - "process.mainModule", - message - ); - if (!auditMode) { - throw new WorkerSecurityViolationError(message, violation); - } - Object.defineProperty(process, "mainModule", { - value, - writable: true, - configurable: true - }); - }, - configurable: true - }); - } - } catch { - } - } - /** - * Protect process.execPath from being read or set in worker context. - * - * process.execPath is a string primitive (not an object), so it cannot be - * proxied via the normal blocked globals mechanism. We use Object.defineProperty - * with getter/setter (same pattern as protectProcessMainModule). - */ - protectProcessExecPath() { - if (typeof process === "undefined") return; - const self = this; - const auditMode = this.config.auditMode; - try { - const originalDescriptor = Object.getOwnPropertyDescriptor( - process, - "execPath" - ); - this.originalDescriptors.push({ - target: process, - prop: "execPath", - descriptor: originalDescriptor - }); - const currentValue = originalDescriptor?.value ?? process.execPath; - Object.defineProperty(process, "execPath", { - get() { - const message = "process.execPath access is blocked in worker context"; - const violation = self.recordViolation( - "process_exec_path", - "process.execPath", - message - ); - if (!auditMode) { - throw new WorkerSecurityViolationError(message, violation); - } - return currentValue; - }, - set(value) { - const message = "process.execPath modification is blocked in worker context"; - const violation = self.recordViolation( - "process_exec_path", - "process.execPath", - message - ); - if (!auditMode) { - throw new WorkerSecurityViolationError(message, violation); - } - Object.defineProperty(process, "execPath", { - value, - writable: true, - configurable: true - }); - }, - configurable: true - }); - } catch { - } - } - /** - * Protect process.connected from being read or set in worker context. - * - * process.connected is a boolean primitive (not an object), so it cannot be - * proxied via the normal blocked globals mechanism. We use Object.defineProperty - * with getter/setter (same pattern as protectProcessExecPath). - * - * Only protects if process.connected exists (IPC contexts). - */ - protectProcessConnected() { - if (typeof process === "undefined") return; - if (process.connected === void 0) return; - const self = this; - const auditMode = this.config.auditMode; - try { - const originalDescriptor = Object.getOwnPropertyDescriptor( - process, - "connected" - ); - this.originalDescriptors.push({ - target: process, - prop: "connected", - descriptor: originalDescriptor - }); - const currentValue = originalDescriptor?.value ?? process.connected; - Object.defineProperty(process, "connected", { - get() { - const message = "process.connected access is blocked in worker context"; - const violation = self.recordViolation( - "process_connected", - "process.connected", - message - ); - if (!auditMode) { - throw new WorkerSecurityViolationError(message, violation); - } - return currentValue; - }, - set(value) { - const message = "process.connected modification is blocked in worker context"; - const violation = self.recordViolation( - "process_connected", - "process.connected", - message - ); - if (!auditMode) { - throw new WorkerSecurityViolationError(message, violation); - } - Object.defineProperty(process, "connected", { - value, - writable: true, - configurable: true - }); - }, - configurable: true - }); - } catch { - } - } - /** - * Protect Module._load from being called. - * - * The attack vector is: - * ``` - * module.constructor._load('child_process') - * require.main.constructor._load('vm') - * ``` - * - * We access the Module class and replace _load with a blocking proxy. - */ - protectModuleLoad() { - const self = this; - const auditMode = this.config.auditMode; - try { - let ModuleClass = null; - if (typeof process !== "undefined") { - const mainModule = process.mainModule; - if (mainModule && typeof mainModule === "object") { - ModuleClass = mainModule.constructor; - } - } - if (!ModuleClass && typeof __require !== "undefined" && typeof __require.main !== "undefined") { - ModuleClass = __require.main.constructor; - } - if (!ModuleClass || typeof ModuleClass._load !== "function") { - return; - } - const original = ModuleClass._load; - const descriptor = Object.getOwnPropertyDescriptor(ModuleClass, "_load"); - this.originalDescriptors.push({ - target: ModuleClass, - prop: "_load", - descriptor - }); - const path = "Module._load"; - const proxy = new this.originalProxy(original, { - apply(_target, _thisArg, _args) { - const message = `${path} is blocked in worker context`; - const violation = self.recordViolation("module_load", path, message); - if (!auditMode) { - throw new WorkerSecurityViolationError(message, violation); - } - return Reflect.apply(_target, _thisArg, _args); - } - }); - Object.defineProperty(ModuleClass, "_load", { - value: proxy, - writable: true, - configurable: true - }); - } catch { - } - } - /** - * Protect Module._resolveFilename from being called in worker context. - * - * Module._resolveFilename is called for both require() and import() resolution. - * Blocking it catches file-based import() specifiers. - * - * data: and blob: URLs are handled by ESM loader hooks registered - * in the main thread (DefenseInDepthBox.protectDynamicImport). - */ - protectModuleResolveFilename() { - const self = this; - const auditMode = this.config.auditMode; - try { - let ModuleClass = null; - if (typeof process !== "undefined") { - const mainModule = process.mainModule; - if (mainModule && typeof mainModule === "object") { - ModuleClass = mainModule.constructor; - } - } - if (!ModuleClass && typeof __require !== "undefined" && typeof __require.main !== "undefined") { - ModuleClass = __require.main.constructor; - } - if (!ModuleClass || typeof ModuleClass._resolveFilename !== "function") { - return; - } - const original = ModuleClass._resolveFilename; - const descriptor = Object.getOwnPropertyDescriptor( - ModuleClass, - "_resolveFilename" - ); - this.originalDescriptors.push({ - target: ModuleClass, - prop: "_resolveFilename", - descriptor - }); - const path = "Module._resolveFilename"; - const proxy = new this.originalProxy(original, { - apply(_target, _thisArg, _args) { - const message = `${path} is blocked in worker context`; - const violation = self.recordViolation( - "module_resolve_filename", - path, - message - ); - if (!auditMode) { - throw new WorkerSecurityViolationError(message, violation); - } - return Reflect.apply(_target, _thisArg, _args); - } - }); - Object.defineProperty(ModuleClass, "_resolveFilename", { - value: proxy, - writable: true, - configurable: true - }); - } catch { - } - } - /** - * Apply a single patch to a blocked global. - */ - applyPatch(blocked) { - const { target, prop, violationType, strategy } = blocked; - try { - const original = target[prop]; - if (original === void 0) { - return; - } - const descriptor = Object.getOwnPropertyDescriptor(target, prop); - this.originalDescriptors.push({ target, prop, descriptor }); - if (strategy === "freeze") { - if (typeof original === "object" && original !== null) { - Object.freeze(original); - } - } else { - const path = this.getPathForTarget(target, prop); - const proxy = typeof original === "function" ? this.createBlockingProxy( - original, - path, - violationType - ) : this.createBlockingObjectProxy( - original, - path, - violationType, - blocked.allowedKeys - ); - Object.defineProperty(target, prop, { - value: proxy, - writable: true, - configurable: true - }); - } - } catch { - } - } - /** - * Restore all original values. - */ - restorePatches() { - for (let i = this.originalDescriptors.length - 1; i >= 0; i--) { - const { target, prop, descriptor } = this.originalDescriptors[i]; - try { - if (descriptor) { - Object.defineProperty(target, prop, descriptor); - } else { - delete target[prop]; - } - } catch { - } - } - this.originalDescriptors = []; - } -}; - -// src/security/wasm-callback.ts -function sanitizeUnknownError(error) { - const message = error instanceof Error ? error.message : String(error); - return sanitizeErrorMessage(message); -} -function wrapWasmCallback(component, phase, callback) { - return (...args) => { - try { - return callback(...args); - } catch (error) { - const message = sanitizeUnknownError(error); - throw new Error(`${component} ${phase} callback failed: ${message}`); - } - }; -} - -// src/security/trusted-globals.ts -var _SharedArrayBuffer = globalThis.SharedArrayBuffer; -var _Atomics = globalThis.Atomics; -var _performanceNow = performance.now.bind(performance); -var _Headers = globalThis.Headers; - -// src/commands/worker-bridge/protocol.ts -var OpCode = { - NOOP: 0, - READ_FILE: 1, - WRITE_FILE: 2, - STAT: 3, - READDIR: 4, - MKDIR: 5, - RM: 6, - EXISTS: 7, - APPEND_FILE: 8, - SYMLINK: 9, - READLINK: 10, - LSTAT: 11, - CHMOD: 12, - REALPATH: 13, - RENAME: 14, - COPY_FILE: 15, - // Special operations for I/O - WRITE_STDOUT: 100, - WRITE_STDERR: 101, - EXIT: 102, - // HTTP operations - HTTP_REQUEST: 200, - // Sub-shell execution - EXEC_COMMAND: 300, - // Tool invocation (executor mode) - INVOKE_TOOL: 400 -}; -var Status = { - PENDING: 0, - READY: 1, - SUCCESS: 2, - ERROR: 3 -}; -var ErrorCode = { - NONE: 0, - NOT_FOUND: 1, - IS_DIRECTORY: 2, - NOT_DIRECTORY: 3, - EXISTS: 4, - PERMISSION_DENIED: 5, - INVALID_PATH: 6, - IO_ERROR: 7, - TIMEOUT: 8, - NETWORK_ERROR: 9, - NETWORK_NOT_CONFIGURED: 10 -}; -var Offset = { - OP_CODE: 0, - STATUS: 4, - PATH_LENGTH: 8, - DATA_LENGTH: 12, - RESULT_LENGTH: 16, - ERROR_CODE: 20, - FLAGS: 24, - MODE: 28, - PATH_BUFFER: 32, - DATA_BUFFER: 4128 - // 32 + 4096 -}; -var Size = { - CONTROL_REGION: 32, - PATH_BUFFER: 4096, - // 8MB limit for FS read/write, HTTP responses, and tool invocation results. - // Sized to handle typical OpenAPI/GraphQL responses (paginated lists, batch queries). - // Still well under the 64MB QuickJS memory limit per execution. - DATA_BUFFER: 8388608, - TOTAL: 8392736 - // 32 + 4096 + 8MB -}; -var Flags = { - NONE: 0, - RECURSIVE: 1, - FORCE: 2, - MKDIR_RECURSIVE: 1 -}; -var StatLayout = { - IS_FILE: 0, - IS_DIRECTORY: 1, - IS_SYMLINK: 2, - MODE: 4, - SIZE: 8, - MTIME: 16, - TOTAL: 24 -}; -var ProtocolBuffer = class { - int32View; - uint8View; - dataView; - constructor(buffer) { - this.int32View = new Int32Array(buffer); - this.uint8View = new Uint8Array(buffer); - this.dataView = new DataView(buffer); - } - getOpCode() { - return _Atomics.load(this.int32View, Offset.OP_CODE / 4); - } - setOpCode(code) { - _Atomics.store(this.int32View, Offset.OP_CODE / 4, code); - } - getStatus() { - return _Atomics.load(this.int32View, Offset.STATUS / 4); - } - setStatus(status) { - _Atomics.store(this.int32View, Offset.STATUS / 4, status); - } - getPathLength() { - return _Atomics.load(this.int32View, Offset.PATH_LENGTH / 4); - } - setPathLength(length) { - _Atomics.store(this.int32View, Offset.PATH_LENGTH / 4, length); - } - getDataLength() { - return _Atomics.load(this.int32View, Offset.DATA_LENGTH / 4); - } - setDataLength(length) { - _Atomics.store(this.int32View, Offset.DATA_LENGTH / 4, length); - } - getResultLength() { - return _Atomics.load(this.int32View, Offset.RESULT_LENGTH / 4); - } - setResultLength(length) { - _Atomics.store(this.int32View, Offset.RESULT_LENGTH / 4, length); - } - getErrorCode() { - return _Atomics.load( - this.int32View, - Offset.ERROR_CODE / 4 - ); - } - setErrorCode(code) { - _Atomics.store(this.int32View, Offset.ERROR_CODE / 4, code); - } - getFlags() { - return _Atomics.load(this.int32View, Offset.FLAGS / 4); - } - setFlags(flags) { - _Atomics.store(this.int32View, Offset.FLAGS / 4, flags); - } - getMode() { - return _Atomics.load(this.int32View, Offset.MODE / 4); - } - setMode(mode) { - _Atomics.store(this.int32View, Offset.MODE / 4, mode); - } - getPath() { - const length = this.getPathLength(); - const bytes = this.uint8View.slice( - Offset.PATH_BUFFER, - Offset.PATH_BUFFER + length - ); - return new TextDecoder().decode(bytes); - } - setPath(path) { - const encoded = new TextEncoder().encode(path); - if (encoded.length > Size.PATH_BUFFER) { - throw new Error(`Path too long: ${encoded.length} > ${Size.PATH_BUFFER}`); - } - this.uint8View.set(encoded, Offset.PATH_BUFFER); - this.setPathLength(encoded.length); - } - getData() { - const length = this.getDataLength(); - return this.uint8View.slice( - Offset.DATA_BUFFER, - Offset.DATA_BUFFER + length - ); - } - setData(data) { - if (data.length > Size.DATA_BUFFER) { - throw new Error(`Data too large: ${data.length} > ${Size.DATA_BUFFER}`); - } - this.uint8View.set(data, Offset.DATA_BUFFER); - this.setDataLength(data.length); - } - getDataAsString() { - const data = this.getData(); - return new TextDecoder().decode(data); - } - setDataFromString(str) { - const encoded = new TextEncoder().encode(str); - this.setData(encoded); - } - getResult() { - const length = this.getResultLength(); - return this.uint8View.slice( - Offset.DATA_BUFFER, - Offset.DATA_BUFFER + length - ); - } - setResult(data) { - if (data.length > Size.DATA_BUFFER) { - throw new Error(`Result too large: ${data.length} > ${Size.DATA_BUFFER}`); - } - this.uint8View.set(data, Offset.DATA_BUFFER); - this.setResultLength(data.length); - } - getResultAsString() { - const result = this.getResult(); - return new TextDecoder().decode(result); - } - setResultFromString(str) { - const encoded = new TextEncoder().encode(str); - this.setResult(encoded); - } - encodeStat(stat) { - this.uint8View[Offset.DATA_BUFFER + StatLayout.IS_FILE] = stat.isFile ? 1 : 0; - this.uint8View[Offset.DATA_BUFFER + StatLayout.IS_DIRECTORY] = stat.isDirectory ? 1 : 0; - this.uint8View[Offset.DATA_BUFFER + StatLayout.IS_SYMLINK] = stat.isSymbolicLink ? 1 : 0; - this.dataView.setInt32( - Offset.DATA_BUFFER + StatLayout.MODE, - stat.mode, - true - ); - const size = Math.min(stat.size, Number.MAX_SAFE_INTEGER); - this.dataView.setFloat64(Offset.DATA_BUFFER + StatLayout.SIZE, size, true); - this.dataView.setFloat64( - Offset.DATA_BUFFER + StatLayout.MTIME, - stat.mtime.getTime(), - true - ); - this.setResultLength(StatLayout.TOTAL); - } - decodeStat() { - return { - isFile: this.uint8View[Offset.DATA_BUFFER + StatLayout.IS_FILE] === 1, - isDirectory: this.uint8View[Offset.DATA_BUFFER + StatLayout.IS_DIRECTORY] === 1, - isSymbolicLink: this.uint8View[Offset.DATA_BUFFER + StatLayout.IS_SYMLINK] === 1, - mode: this.dataView.getInt32(Offset.DATA_BUFFER + StatLayout.MODE, true), - size: this.dataView.getFloat64( - Offset.DATA_BUFFER + StatLayout.SIZE, - true - ), - mtime: new Date( - this.dataView.getFloat64(Offset.DATA_BUFFER + StatLayout.MTIME, true) - ) - }; - } - waitForReady(timeout) { - return _Atomics.wait( - this.int32View, - Offset.STATUS / 4, - Status.PENDING, - timeout - ); - } - waitForReadyAsync(timeout) { - return _Atomics.waitAsync( - this.int32View, - Offset.STATUS / 4, - Status.PENDING, - timeout - ); - } - /** - * Wait for status to become READY. - * Returns immediately if status is already READY, or waits until it changes. - */ - async waitUntilReady(timeout) { - const startTime = Date.now(); - while (true) { - const status = this.getStatus(); - if (status === Status.READY) { - return true; - } - const elapsed = Date.now() - startTime; - if (elapsed >= timeout) { - return false; - } - const remainingMs = timeout - elapsed; - const result = _Atomics.waitAsync( - this.int32View, - Offset.STATUS / 4, - status, - remainingMs - ); - if (result.async) { - const waitResult = await result.value; - if (waitResult === "timed-out") { - return false; - } - } - } - } - waitForResult(timeout) { - return _Atomics.wait( - this.int32View, - Offset.STATUS / 4, - Status.READY, - timeout - ); - } - notify() { - return _Atomics.notify(this.int32View, Offset.STATUS / 4); - } - reset() { - this.setOpCode(OpCode.NOOP); - this.setStatus(Status.PENDING); - this.setPathLength(0); - this.setDataLength(0); - this.setResultLength(0); - this.setErrorCode(ErrorCode.NONE); - this.setFlags(Flags.NONE); - this.setMode(0); - } -}; - -// src/commands/worker-bridge/sync-backend.ts -var SyncBackend = class { - protocol; - operationTimeoutMs; - constructor(sharedBuffer, operationTimeoutMs = 3e4) { - this.protocol = new ProtocolBuffer(sharedBuffer); - this.operationTimeoutMs = operationTimeoutMs; - } - execSync(opCode, path, data, flags = 0, mode = 0) { - this.protocol.reset(); - this.protocol.setOpCode(opCode); - this.protocol.setPath(path); - this.protocol.setFlags(flags); - this.protocol.setMode(mode); - if (data) { - this.protocol.setData(data); - } - this.protocol.setStatus(Status.READY); - this.protocol.notify(); - const waitResult = this.protocol.waitForResult(this.operationTimeoutMs); - if (waitResult === "timed-out") { - return { success: false, error: "Operation timed out" }; - } - const status = this.protocol.getStatus(); - if (status === Status.SUCCESS) { - return { success: true, result: this.protocol.getResult() }; - } - return { - success: false, - error: this.protocol.getResultAsString() || `Error code: ${this.protocol.getErrorCode()}` - }; - } - readFile(path) { - const result = this.execSync(OpCode.READ_FILE, path); - if (!result.success) { - throw new Error(result.error || "Failed to read file"); - } - return result.result ?? new Uint8Array(0); - } - writeFile(path, data) { - const result = this.execSync(OpCode.WRITE_FILE, path, data); - if (!result.success) { - throw new Error(result.error || "Failed to write file"); - } - } - stat(path) { - const result = this.execSync(OpCode.STAT, path); - if (!result.success) { - throw new Error(result.error || "Failed to stat"); - } - return this.protocol.decodeStat(); - } - lstat(path) { - const result = this.execSync(OpCode.LSTAT, path); - if (!result.success) { - throw new Error(result.error || "Failed to lstat"); - } - return this.protocol.decodeStat(); - } - readdir(path) { - const result = this.execSync(OpCode.READDIR, path); - if (!result.success) { - throw new Error(result.error || "Failed to readdir"); - } - return JSON.parse(this.protocol.getResultAsString()); - } - mkdir(path, recursive = false) { - const flags = recursive ? Flags.MKDIR_RECURSIVE : 0; - const result = this.execSync(OpCode.MKDIR, path, void 0, flags); - if (!result.success) { - throw new Error(result.error || "Failed to mkdir"); - } - } - rm(path, recursive = false, force = false) { - let flags = 0; - if (recursive) flags |= Flags.RECURSIVE; - if (force) flags |= Flags.FORCE; - const result = this.execSync(OpCode.RM, path, void 0, flags); - if (!result.success) { - throw new Error(result.error || "Failed to rm"); - } - } - exists(path) { - const result = this.execSync(OpCode.EXISTS, path); - if (!result.success) { - return false; - } - return result.result?.[0] === 1; - } - appendFile(path, data) { - const result = this.execSync(OpCode.APPEND_FILE, path, data); - if (!result.success) { - throw new Error(result.error || "Failed to append file"); - } - } - symlink(target, linkPath) { - const targetData = new TextEncoder().encode(target); - const result = this.execSync(OpCode.SYMLINK, linkPath, targetData); - if (!result.success) { - throw new Error(result.error || "Failed to symlink"); - } - } - readlink(path) { - const result = this.execSync(OpCode.READLINK, path); - if (!result.success) { - throw new Error(result.error || "Failed to readlink"); - } - return this.protocol.getResultAsString(); - } - chmod(path, mode) { - const result = this.execSync(OpCode.CHMOD, path, void 0, 0, mode); - if (!result.success) { - throw new Error(result.error || "Failed to chmod"); - } - } - realpath(path) { - const result = this.execSync(OpCode.REALPATH, path); - if (!result.success) { - throw new Error(result.error || "Failed to realpath"); - } - return this.protocol.getResultAsString(); - } - rename(oldPath, newPath) { - const newPathData = new TextEncoder().encode(newPath); - const result = this.execSync(OpCode.RENAME, oldPath, newPathData); - if (!result.success) { - throw new Error(result.error || "Failed to rename"); - } - } - copyFile(src, dest) { - const destData = new TextEncoder().encode(dest); - const result = this.execSync(OpCode.COPY_FILE, src, destData); - if (!result.success) { - throw new Error(result.error || "Failed to copyFile"); - } - } - writeStdout(data) { - const encoded = new TextEncoder().encode(data); - const result = this.execSync(OpCode.WRITE_STDOUT, "", encoded); - if (!result.success) { - throw new Error(result.error || "Failed to write stdout"); - } - } - writeStderr(data) { - const encoded = new TextEncoder().encode(data); - const result = this.execSync(OpCode.WRITE_STDERR, "", encoded); - if (!result.success) { - throw new Error(result.error || "Failed to write stderr"); - } - } - exit(code) { - this.execSync(OpCode.EXIT, "", void 0, code); - } - /** - * Make an HTTP request through the main thread's secureFetch. - * Returns the response as a parsed object. - */ - httpRequest(url, options) { - const requestData = options ? new TextEncoder().encode(JSON.stringify(options)) : void 0; - const result = this.execSync(OpCode.HTTP_REQUEST, url, requestData); - if (!result.success) { - throw new Error(result.error || "HTTP request failed"); - } - const responseJson = new TextDecoder().decode(result.result); - const parsed = JSON.parse(responseJson); - const bodyBase64 = parsed.bodyBase64 ?? ""; - const body = atob(bodyBase64); - return { - status: parsed.status, - statusText: parsed.statusText, - headers: parsed.headers, - url: parsed.url, - body, - bodyBase64 - }; - } - /** - * Execute a shell command through the main thread's exec function. - * Returns the result as { stdout, stderr, exitCode }. - */ - execCommand(command, stdin) { - const requestData = stdin ? new TextEncoder().encode(JSON.stringify({ stdin })) : void 0; - const result = this.execSync(OpCode.EXEC_COMMAND, command, requestData); - if (!result.success) { - throw new Error(result.error || "Command execution failed"); - } - const responseJson = new TextDecoder().decode(result.result); - return JSON.parse(responseJson); - } - /** - * Execute a shell command with structured args (shell-escaped on the main thread). - * Prevents command injection from unsanitized args. - */ - execCommandArgs(command, args) { - const requestData = new TextEncoder().encode(JSON.stringify({ args })); - const result = this.execSync(OpCode.EXEC_COMMAND, command, requestData); - if (!result.success) { - throw new Error(result.error || "Command execution failed"); - } - const responseJson = new TextDecoder().decode(result.result); - return JSON.parse(responseJson); - } - /** - * Invoke a tool through the main thread's invokeTool hook. - * Returns the JSON-serialized result. - */ - invokeTool(path, argsJson) { - const requestData = argsJson ? new TextEncoder().encode(argsJson) : void 0; - const result = this.execSync(OpCode.INVOKE_TOOL, path, requestData); - if (!result.success) { - throw new Error(result.error || "Tool invocation failed"); - } - return new TextDecoder().decode(result.result); - } -}; - -// src/commands/python3/worker.ts -import { readFileSync } from "node:fs"; -var require2 = createRequire(import.meta.url); -var CPYTHON_ENTRY_BASENAME = "/vendor/cpython-emscripten/python.cjs"; -var CPYTHON_STDLIB_BASENAME = "/vendor/cpython-emscripten/python313.zip"; -var moduleLoadGuardInstalled = false; -function normalizePath(path) { - return path.replace(/\\/g, "/"); -} -function isApprovedCpythonEntryPath(path) { - return normalizePath(path).endsWith(CPYTHON_ENTRY_BASENAME); -} -function isApprovedStdlibZipPath(path) { - return normalizePath(path).endsWith(CPYTHON_STDLIB_BASENAME); -} -function assertApprovedPath(path, kind) { - const ok = kind === "cpython-entry" ? isApprovedCpythonEntryPath(path) : isApprovedStdlibZipPath(path); - if (!ok) { - throw new Error( - `[Defense-in-depth] rejected ${kind} path outside approved vendor bundle: ${path}` - ); - } -} -try { - const NodeModule = require2("node:module"); - if (typeof NodeModule._load === "function") { - const originalLoad = NodeModule._load; - const blockedModules = /* @__PURE__ */ new Set([ - "child_process", - "node:child_process", - "cluster", - "node:cluster", - "dgram", - "node:dgram", - "dns", - "node:dns", - "net", - "node:net", - "tls", - "node:tls", - "vm", - "node:vm", - "v8", - "node:v8", - "inspector", - "node:inspector", - "inspector/promises", - "node:inspector/promises", - "trace_events", - "node:trace_events", - "perf_hooks", - "node:perf_hooks", - "worker_threads", - "node:worker_threads" - ]); - NodeModule._load = function(request, ...rest) { - if (blockedModules.has(request)) { - throw new Error( - `[Defense-in-depth] require('${request}') is blocked in worker context` - ); - } - return originalLoad.apply(this, [request, ...rest]); - }; - moduleLoadGuardInstalled = true; - } -} catch { -} -var cpythonEntryPath; -try { - cpythonEntryPath = require2.resolve( - "../../../vendor/cpython-emscripten/python.cjs" - ); -} catch (_e) { - cpythonEntryPath = dirname(import.meta.url).replace("file://", "") + "/../../../vendor/cpython-emscripten/python.cjs"; -} -assertApprovedPath(cpythonEntryPath, "cpython-entry"); -var cpythonDir = dirname(cpythonEntryPath); -var stdlibZipPath = `${cpythonDir}/python313.zip`; -assertApprovedPath(stdlibZipPath, "cpython-stdlib"); -function createHOSTFS(backend, FS, PATH) { - const ERRNO_CODES = Object.assign( - /* @__PURE__ */ Object.create(null), - { - EPERM: 63, - ENOENT: 44, - EIO: 29, - EBADF: 8, - EAGAIN: 6, - EACCES: 2, - EBUSY: 10, - EEXIST: 20, - ENOTDIR: 54, - EISDIR: 31, - EINVAL: 28, - EMFILE: 33, - ENOSPC: 51, - ESPIPE: 70, - EROFS: 69, - ENOTEMPTY: 55, - ENOSYS: 52, - ENOTSUP: 138, - ENODATA: 42 - } - ); - function realPath(node) { - const parts = []; - while (node.parent !== node) { - parts.push(node.name); - node = node.parent; - } - parts.push(node.mount.opts.root); - parts.reverse(); - return PATH.join(...parts); - } - function tryFSOperation(f) { - try { - return f(); - } catch (e) { - const msg = e?.message?.toLowerCase() || (typeof e === "string" ? e.toLowerCase() : ""); - let code = ERRNO_CODES.EIO; - if (msg.includes("no such file") || msg.includes("not found")) { - code = ERRNO_CODES.ENOENT; - } else if (msg.includes("is a directory")) { - code = ERRNO_CODES.EISDIR; - } else if (msg.includes("not a directory")) { - code = ERRNO_CODES.ENOTDIR; - } else if (msg.includes("already exists")) { - code = ERRNO_CODES.EEXIST; - } else if (msg.includes("permission")) { - code = ERRNO_CODES.EACCES; - } else if (msg.includes("not empty")) { - code = ERRNO_CODES.ENOTEMPTY; - } - throw new FS.ErrnoError(code); - } - } - function getMode(path) { - return tryFSOperation(() => { - const stat = backend.stat(path); - let mode = stat.mode & 511; - if (stat.isDirectory) { - mode |= 16384; - } else if (stat.isSymbolicLink) { - mode |= 40960; - } else { - mode |= 32768; - } - return mode; - }); - } - const HOSTFS = { - mount(_mount) { - return HOSTFS.createNode(null, "/", 16877, 0); - }, - createNode(parent, name, mode, dev) { - if (!FS.isDir(mode) && !FS.isFile(mode) && !FS.isLink(mode)) { - throw new FS.ErrnoError(ERRNO_CODES.EINVAL); - } - const node = FS.createNode(parent, name, mode, dev); - node.node_ops = HOSTFS.node_ops; - node.stream_ops = HOSTFS.stream_ops; - return node; - }, - node_ops: { - getattr(node) { - const path = realPath(node); - return tryFSOperation(() => { - const stat = backend.stat(path); - let mode = stat.mode & 511; - if (stat.isDirectory) { - mode |= 16384; - } else if (stat.isSymbolicLink) { - mode |= 40960; - } else { - mode |= 32768; - } - return { - dev: 1, - ino: node.id, - mode, - nlink: 1, - uid: 0, - gid: 0, - rdev: 0, - size: stat.size, - atime: stat.mtime, - mtime: stat.mtime, - ctime: stat.mtime, - blksize: 4096, - blocks: Math.ceil(stat.size / 512) - }; - }); - }, - setattr(node, attr) { - const path = realPath(node); - const mode = attr.mode; - if (mode !== void 0) { - tryFSOperation(() => backend.chmod(path, mode)); - node.mode = mode; - } - if (attr.size !== void 0) { - tryFSOperation(() => { - const content = backend.readFile(path); - const newContent = content.slice(0, attr.size); - backend.writeFile(path, newContent); - }); - } - }, - lookup(parent, name) { - const path = PATH.join2(realPath(parent), name); - const mode = getMode(path); - return HOSTFS.createNode(parent, name, mode); - }, - mknod(parent, name, mode, _dev) { - const node = HOSTFS.createNode(parent, name, mode, _dev); - const path = realPath(node); - tryFSOperation(() => { - if (FS.isDir(node.mode)) { - backend.mkdir(path, false); - } else { - backend.writeFile(path, new Uint8Array(0)); - } - }); - return node; - }, - rename(oldNode, newDir, newName) { - const oldPath = realPath(oldNode); - const newPath = PATH.join2(realPath(newDir), newName); - tryFSOperation(() => { - const content = backend.readFile(oldPath); - backend.writeFile(newPath, content); - backend.rm(oldPath, false, false); - }); - oldNode.name = newName; - }, - unlink(parent, name) { - const path = PATH.join2(realPath(parent), name); - tryFSOperation(() => backend.rm(path, false, false)); - }, - rmdir(parent, name) { - const path = PATH.join2(realPath(parent), name); - tryFSOperation(() => backend.rm(path, false, false)); - }, - readdir(node) { - const path = realPath(node); - return tryFSOperation(() => backend.readdir(path)); - }, - symlink(parent, newName, oldPath) { - const newPath = PATH.join2(realPath(parent), newName); - tryFSOperation(() => backend.symlink(oldPath, newPath)); - }, - readlink(node) { - const path = realPath(node); - return tryFSOperation(() => backend.readlink(path)); - } - }, - stream_ops: { - open(stream) { - const path = realPath(stream.node); - const flags = stream.flags; - const O_WRONLY = 1; - const O_RDWR = 2; - const O_CREAT = 64; - const O_TRUNC = 512; - const O_APPEND = 1024; - const accessMode = flags & 3; - const isWrite = accessMode === O_WRONLY || accessMode === O_RDWR; - const isCreate = (flags & O_CREAT) !== 0; - const isTruncate = (flags & O_TRUNC) !== 0; - const isAppend = (flags & O_APPEND) !== 0; - if (FS.isDir(stream.node.mode)) { - return; - } - let content; - try { - if (isTruncate && isWrite) { - content = new Uint8Array(0); - } else { - content = backend.readFile(path); - } - } catch (_e) { - if (isCreate && isWrite) { - content = new Uint8Array(0); - } else { - throw new FS.ErrnoError(ERRNO_CODES.ENOENT); - } - } - stream.hostContent = content; - stream.hostModified = isTruncate && isWrite; - stream.hostPath = path; - if (isAppend) { - stream.position = content.length; - } - }, - close(stream) { - const hostPath = stream.hostPath; - const hostContent = stream.hostContent; - if (stream.hostModified && hostContent && hostPath) { - tryFSOperation(() => backend.writeFile(hostPath, hostContent)); - } - delete stream.hostContent; - delete stream.hostModified; - delete stream.hostPath; - }, - read(stream, buffer, offset, length, position) { - const content = stream.hostContent; - if (!content) return 0; - const size = content.length; - if (position >= size) return 0; - const bytesToRead = Math.min(length, size - position); - buffer.set(content.subarray(position, position + bytesToRead), offset); - return bytesToRead; - }, - write(stream, buffer, offset, length, position) { - let content = stream.hostContent || new Uint8Array(0); - const newSize = Math.max(content.length, position + length); - if (newSize > content.length) { - const newContent = new Uint8Array(newSize); - newContent.set(content); - content = newContent; - stream.hostContent = content; - } - content.set(buffer.subarray(offset, offset + length), position); - stream.hostModified = true; - return length; - }, - llseek(stream, offset, whence) { - const SEEK_CUR = 1; - const SEEK_END = 2; - let position = offset; - if (whence === SEEK_CUR) { - position += stream.position; - } else if (whence === SEEK_END) { - if (FS.isFile(stream.node.mode)) { - const content = stream.hostContent; - position += content ? content.length : 0; - } - } - if (position < 0) { - throw new FS.ErrnoError(ERRNO_CODES.EINVAL); - } - return position; - } - } - }; - return HOSTFS; -} -function generateSetupCode(input) { - const envSetup = Object.entries(input.env).map(([key, value]) => { - return `os.environ[${JSON.stringify(key)}] = ${JSON.stringify(value)}`; - }).join("\n"); - const argv0 = input.scriptPath || "python3"; - const argvList = [argv0, ...input.args].map((arg) => JSON.stringify(arg)).join(", "); - return ` -import os -import sys -import json - -${envSetup} - -sys.argv = [${argvList}] - -# Path redirection: redirect /absolute paths to /host mount -def _should_redirect(path): - return (isinstance(path, str) and - path.startswith('/') and - not path.startswith('/lib') and - not path.startswith('/proc') and - not path.startswith('/host') and - not path.startswith('/_jb_http')) - -# builtins.open -import builtins -_orig_open = builtins.open -def _redir_open(path, mode='r', *args, **kwargs): - if _should_redirect(path): - path = '/host' + path - return _orig_open(path, mode, *args, **kwargs) -builtins.open = _redir_open - -# os file operations -_orig_listdir = os.listdir -def _redir_listdir(path='.'): - if _should_redirect(path): - path = '/host' + path - return _orig_listdir(path) -os.listdir = _redir_listdir - -_orig_exists = os.path.exists -def _redir_exists(path): - if _should_redirect(path): - path = '/host' + path - return _orig_exists(path) -os.path.exists = _redir_exists - -_orig_isfile = os.path.isfile -def _redir_isfile(path): - if _should_redirect(path): - path = '/host' + path - return _orig_isfile(path) -os.path.isfile = _redir_isfile - -_orig_isdir = os.path.isdir -def _redir_isdir(path): - if _should_redirect(path): - path = '/host' + path - return _orig_isdir(path) -os.path.isdir = _redir_isdir - -_orig_stat = os.stat -def _redir_stat(path, *args, **kwargs): - if _should_redirect(path): - path = '/host' + path - return _orig_stat(path, *args, **kwargs) -os.stat = _redir_stat - -_orig_mkdir = os.mkdir -def _redir_mkdir(path, *args, **kwargs): - if _should_redirect(path): - path = '/host' + path - return _orig_mkdir(path, *args, **kwargs) -os.mkdir = _redir_mkdir - -_orig_makedirs = os.makedirs -def _redir_makedirs(path, *args, **kwargs): - if _should_redirect(path): - path = '/host' + path - return _orig_makedirs(path, *args, **kwargs) -os.makedirs = _redir_makedirs - -_orig_remove = os.remove -def _redir_remove(path, *args, **kwargs): - if _should_redirect(path): - path = '/host' + path - return _orig_remove(path, *args, **kwargs) -os.remove = _redir_remove - -_orig_rmdir = os.rmdir -def _redir_rmdir(path, *args, **kwargs): - if _should_redirect(path): - path = '/host' + path - return _orig_rmdir(path, *args, **kwargs) -os.rmdir = _redir_rmdir - -_orig_getcwd = os.getcwd -def _redir_getcwd(): - cwd = _orig_getcwd() - if cwd.startswith('/host'): - return cwd[5:] - return cwd -os.getcwd = _redir_getcwd - -_orig_chdir = os.chdir -def _redir_chdir(path): - if _should_redirect(path): - path = '/host' + path - return _orig_chdir(path) -os.chdir = _redir_chdir - -# glob -import glob as _glob_module -_orig_glob = _glob_module.glob -def _redir_glob(pathname, *args, **kwargs): - if _should_redirect(pathname): - pathname = '/host' + pathname - return _orig_glob(pathname, *args, **kwargs) -_glob_module.glob = _redir_glob - -_orig_iglob = _glob_module.iglob -def _redir_iglob(pathname, *args, **kwargs): - if _should_redirect(pathname): - pathname = '/host' + pathname - return _orig_iglob(pathname, *args, **kwargs) -_glob_module.iglob = _redir_iglob - -# os.walk -_orig_walk = os.walk -def _redir_walk(top, *args, **kwargs): - redirected = False - if _should_redirect(top): - top = '/host' + top - redirected = True - for dirpath, dirnames, filenames in _orig_walk(top, *args, **kwargs): - if redirected and dirpath.startswith('/host'): - dirpath = dirpath[5:] if len(dirpath) > 5 else '/' - yield dirpath, dirnames, filenames -os.walk = _redir_walk - -# os.scandir -_orig_scandir = os.scandir -def _redir_scandir(path='.'): - if _should_redirect(path): - path = '/host' + path - return _orig_scandir(path) -os.scandir = _redir_scandir - -# io.open -import io as _io_module -_io_module.open = builtins.open - -# shutil -import shutil as _shutil_module - -_orig_shutil_copy = _shutil_module.copy -def _redir_shutil_copy(src, dst, *args, **kwargs): - if _should_redirect(src): src = '/host' + src - if _should_redirect(dst): dst = '/host' + dst - return _orig_shutil_copy(src, dst, *args, **kwargs) -_shutil_module.copy = _redir_shutil_copy - -_orig_shutil_copy2 = _shutil_module.copy2 -def _redir_shutil_copy2(src, dst, *args, **kwargs): - if _should_redirect(src): src = '/host' + src - if _should_redirect(dst): dst = '/host' + dst - return _orig_shutil_copy2(src, dst, *args, **kwargs) -_shutil_module.copy2 = _redir_shutil_copy2 - -_orig_shutil_copyfile = _shutil_module.copyfile -def _redir_shutil_copyfile(src, dst, *args, **kwargs): - if _should_redirect(src): src = '/host' + src - if _should_redirect(dst): dst = '/host' + dst - return _orig_shutil_copyfile(src, dst, *args, **kwargs) -_shutil_module.copyfile = _redir_shutil_copyfile - -_orig_shutil_copytree = _shutil_module.copytree -def _redir_shutil_copytree(src, dst, *args, **kwargs): - if _should_redirect(src): src = '/host' + src - if _should_redirect(dst): dst = '/host' + dst - return _orig_shutil_copytree(src, dst, *args, **kwargs) -_shutil_module.copytree = _redir_shutil_copytree - -_orig_shutil_move = _shutil_module.move -def _redir_shutil_move(src, dst, *args, **kwargs): - if _should_redirect(src): src = '/host' + src - if _should_redirect(dst): dst = '/host' + dst - return _orig_shutil_move(src, dst, *args, **kwargs) -_shutil_module.move = _redir_shutil_move - -_orig_shutil_rmtree = _shutil_module.rmtree -def _redir_shutil_rmtree(path, *args, **kwargs): - if _should_redirect(path): path = '/host' + path - return _orig_shutil_rmtree(path, *args, **kwargs) -_shutil_module.rmtree = _redir_shutil_rmtree - -# pathlib.Path -from pathlib import Path - -def _redirect_path(p): - s = str(p) - if _should_redirect(s): - return Path('/host' + s) - return p - -Path._orig_stat = Path.stat -def _path_stat(self, *args, **kwargs): - return _redirect_path(self)._orig_stat(*args, **kwargs) -Path.stat = _path_stat - -Path._orig_exists = Path.exists -def _path_exists(self): - return _redirect_path(self)._orig_exists() -Path.exists = _path_exists - -Path._orig_is_file = Path.is_file -def _path_is_file(self): - return _redirect_path(self)._orig_is_file() -Path.is_file = _path_is_file - -Path._orig_is_dir = Path.is_dir -def _path_is_dir(self): - return _redirect_path(self)._orig_is_dir() -Path.is_dir = _path_is_dir - -Path._orig_open = Path.open -def _path_open(self, *args, **kwargs): - return _redirect_path(self)._orig_open(*args, **kwargs) -Path.open = _path_open - -Path._orig_read_text = Path.read_text -def _path_read_text(self, *args, **kwargs): - return _redirect_path(self)._orig_read_text(*args, **kwargs) -Path.read_text = _path_read_text - -Path._orig_read_bytes = Path.read_bytes -def _path_read_bytes(self): - return _redirect_path(self)._orig_read_bytes() -Path.read_bytes = _path_read_bytes - -Path._orig_write_text = Path.write_text -def _path_write_text(self, *args, **kwargs): - return _redirect_path(self)._orig_write_text(*args, **kwargs) -Path.write_text = _path_write_text - -Path._orig_write_bytes = Path.write_bytes -def _path_write_bytes(self, data): - return _redirect_path(self)._orig_write_bytes(data) -Path.write_bytes = _path_write_bytes - -Path._orig_mkdir = Path.mkdir -def _path_mkdir(self, *args, **kwargs): - return _redirect_path(self)._orig_mkdir(*args, **kwargs) -Path.mkdir = _path_mkdir - -Path._orig_rmdir = Path.rmdir -def _path_rmdir(self): - return _redirect_path(self)._orig_rmdir() -Path.rmdir = _path_rmdir - -Path._orig_unlink = Path.unlink -def _path_unlink(self, *args, **kwargs): - return _redirect_path(self)._orig_unlink(*args, **kwargs) -Path.unlink = _path_unlink - -Path._orig_iterdir = Path.iterdir -def _path_iterdir(self): - redirected = _redirect_path(self) - for p in redirected._orig_iterdir(): - s = str(p) - if s.startswith('/host'): - yield Path(s[5:]) - else: - yield p -Path.iterdir = _path_iterdir - -Path._orig_glob = Path.glob -def _path_glob(self, pattern): - redirected = _redirect_path(self) - for p in redirected._orig_glob(pattern): - s = str(p) - if s.startswith('/host'): - yield Path(s[5:]) - else: - yield p -Path.glob = _path_glob - -Path._orig_rglob = Path.rglob -def _path_rglob(self, pattern): - redirected = _redirect_path(self) - for p in redirected._orig_rglob(pattern): - s = str(p) - if s.startswith('/host'): - yield Path(s[5:]) - else: - yield p -Path.rglob = _path_rglob - -# Set cwd to host mount -os.chdir('/host' + ${JSON.stringify(input.cwd)}) -`; -} -function createHTTPFS(backend, FS) { - let lastResponse = null; - const encoder = new TextEncoder(); - const decoder = new TextDecoder(); - const HTTPFS = { - mount(_mount) { - return HTTPFS.createNode(null, "/", 16877, 0); - }, - createNode(parent, name, mode, dev) { - const node = FS.createNode(parent, name, mode, dev); - node.node_ops = HTTPFS.node_ops; - node.stream_ops = HTTPFS.stream_ops; - return node; - }, - node_ops: { - getattr(node) { - const isDir = node.name === "/" || node.parent === node; - return { - dev: 1, - ino: node.id, - mode: isDir ? 16877 : 33206, - nlink: 1, - uid: 0, - gid: 0, - rdev: 0, - size: lastResponse ? lastResponse.length : 0, - atime: /* @__PURE__ */ new Date(), - mtime: /* @__PURE__ */ new Date(), - ctime: /* @__PURE__ */ new Date(), - blksize: 4096, - blocks: 0 - }; - }, - setattr(_node, _attr) { - }, - lookup(parent, name) { - return HTTPFS.createNode(parent, name, 33206); - }, - mknod(parent, name, mode, _dev) { - return HTTPFS.createNode(parent, name, mode); - }, - rename() { - }, - unlink() { - }, - rmdir() { - }, - readdir(_node) { - return ["request"]; - }, - symlink() { - }, - readlink(_node) { - return ""; - } - }, - stream_ops: { - open(stream) { - delete stream.hostContent; - stream.hostModified = false; - const accessMode = stream.flags & 3; - const isRead = accessMode === 0; - if (isRead && lastResponse) { - stream.hostContent = lastResponse; - } - }, - close(stream) { - if (stream.hostModified && stream.hostContent) { - const reqJson = decoder.decode(stream.hostContent); - try { - const req = JSON.parse(reqJson); - const result = backend.httpRequest(req.url, { - method: req.method || "GET", - headers: req.headers || void 0, - body: req.body || void 0 - }); - lastResponse = encoder.encode(JSON.stringify(result)); - } catch (e) { - const message = sanitizeHostErrorMessage(e.message); - lastResponse = encoder.encode(JSON.stringify({ error: message })); - } - } - delete stream.hostContent; - delete stream.hostModified; - }, - read(stream, buffer, offset, length, position) { - const content = stream.hostContent; - if (!content) return 0; - const size = content.length; - if (position >= size) return 0; - const bytesToRead = Math.min(length, size - position); - buffer.set(content.subarray(position, position + bytesToRead), offset); - return bytesToRead; - }, - write(stream, buffer, offset, length, position) { - let content = stream.hostContent || new Uint8Array(0); - const newSize = Math.max(content.length, position + length); - if (newSize > content.length) { - const newContent = new Uint8Array(newSize); - newContent.set(content); - content = newContent; - stream.hostContent = content; - } - content.set(buffer.subarray(offset, offset + length), position); - stream.hostModified = true; - return length; - }, - llseek(stream, offset, whence) { - let position = offset; - if (whence === 1) - position += stream.position; - else if (whence === 2) { - const content = stream.hostContent; - position += content ? content.length : 0; - } - if (position < 0) throw new FS.ErrnoError(28); - return position; - } - } - }; - return HTTPFS; -} -function generateHttpBridgeCode() { - return ` -# HTTP bridge: jb_http module -# Write request JSON to /_jb_http/request (custom FS triggers HTTP via SharedArrayBuffer) -# Then read response JSON from same path. - -import base64 as _base64 - -class _JbHttpResponse: - """HTTP response object similar to requests.Response""" - def __init__(self, data): - self.status_code = data.get('status', 0) - self.reason = data.get('statusText', '') - # @banned-pattern-ignore: Python code, not JavaScript - self.headers = data.get('headers', {}) - self.url = data.get('url', '') - self._error = data.get('error') - b64 = data.get('bodyBase64') - if b64 is not None: - self.content = _base64.b64decode(b64) - self.text = self.content.decode('utf-8', errors='replace') - else: - self.content = b'' - self.text = data.get('body', '') - - @property - def ok(self): - return 200 <= self.status_code < 300 - - def json(self): - return json.loads(self.text) - - def raise_for_status(self): - if self._error: - raise Exception(self._error) - if not self.ok: - raise Exception(f"HTTP {self.status_code}: {self.reason}") - -class _JbHttp: - """HTTP client that bridges to just-bash's secureFetch via custom FS""" - def _do_request(self, method, url, headers=None, body=None): - import json as _json - req = _json.dumps({'url': url, 'method': method, 'headers': headers, 'body': body}) - # Write request to HTTPFS \u2014 close triggers the HTTP call synchronously - with _orig_open('/_jb_http/request', 'w') as f: - f.write(req) - # Read response (cached by HTTPFS from the HTTP call above) - with _orig_open('/_jb_http/request', 'r') as f: - return _json.loads(f.read()) - - def request(self, method, url, headers=None, data=None, json_data=None): - if json_data is not None: - data = json.dumps(json_data) - headers = headers or {} - headers['Content-Type'] = 'application/json' - result = self._do_request(method, url, headers, data) - if 'error' in result and result.get('status') is None: - raise Exception(result['error']) - return _JbHttpResponse(result) - - def get(self, url, headers=None, **kwargs): - return self.request('GET', url, headers=headers, **kwargs) - - def post(self, url, headers=None, data=None, json=None, **kwargs): - return self.request('POST', url, headers=headers, data=data, json_data=json, **kwargs) - - def put(self, url, headers=None, data=None, json=None, **kwargs): - return self.request('PUT', url, headers=headers, data=data, json_data=json, **kwargs) - - def delete(self, url, headers=None, **kwargs): - return self.request('DELETE', url, headers=headers, **kwargs) - - def head(self, url, headers=None, **kwargs): - return self.request('HEAD', url, headers=headers, **kwargs) - - def patch(self, url, headers=None, data=None, json=None, **kwargs): - return self.request('PATCH', url, headers=headers, data=data, json_data=json, **kwargs) - -import types -jb_http = types.ModuleType('jb_http') -jb_http._client = _JbHttp() -jb_http.get = jb_http._client.get -jb_http.post = jb_http._client.post -jb_http.put = jb_http._client.put -jb_http.delete = jb_http._client.delete -jb_http.head = jb_http._client.head -jb_http.patch = jb_http._client.patch -jb_http.request = jb_http._client.request -jb_http.Response = _JbHttpResponse -sys.modules['jb_http'] = jb_http -`; -} -var cachedStdlibZip = new Uint8Array(readFileSync(stdlibZipPath)); -function wrapWorkerMessage(protocolToken, message) { - const wrapped = /* @__PURE__ */ Object.create(null); - if (!message || typeof message !== "object") { - wrapped.success = false; - wrapped.error = "Worker attempted to post non-object message"; - wrapped.protocolToken = protocolToken; - return wrapped; - } - for (const [key, value] of Object.entries(message)) - wrapped[key] = value; - wrapped.protocolToken = protocolToken; - return wrapped; -} -function postWorkerMessage(protocolToken, message) { - try { - parentPort?.postMessage(wrapWorkerMessage(protocolToken, message)); - } catch (error) { - console.debug( - "[python3-worker] failed to post worker message:", - sanitizeUnknownError(error) - ); - } -} -async function runPython(input) { - if (!moduleLoadGuardInstalled) { - return { - success: false, - error: "Defense-in-depth module-loader guard failed to initialize; refusing to execute Python worker" - }; - } - const backend = new SyncBackend(input.sharedBuffer, input.timeoutMs); - assertApprovedPath(cpythonEntryPath, "cpython-entry"); - const createPythonModule = require2(cpythonEntryPath); - let moduleReady = false; - const pendingStdout = []; - const pendingStderr = []; - let Module; - try { - const onPreRun = wrapWasmCallback( - "python3-worker", - "preRun", - (mod) => { - mod.FS.mkdirTree("/lib"); - mod.FS.writeFile("/lib/python313.zip", cachedStdlibZip); - mod.ENV.PYTHONHOME = "/"; - mod.ENV.PYTHONPATH = "/lib/python313.zip"; - } - ); - const onPrint = wrapWasmCallback( - "python3-worker", - "print", - (text) => { - if (moduleReady) { - backend.writeStdout(`${text} -`); - } else { - pendingStdout.push(`${text} -`); - } - } - ); - const onPrintErr = wrapWasmCallback( - "python3-worker", - "printErr", - (text) => { - if (typeof text === "string" && (text.includes("Could not find platform") || text.includes("LLVM Profile Error"))) { - return; - } - if (moduleReady) { - backend.writeStderr(`${text} -`); - } else { - pendingStderr.push(`${text} -`); - } - } - ); - Module = await createPythonModule({ - noInitialRun: true, - preRun: [onPreRun], - print: onPrint, - printErr: onPrintErr - }); - } catch (e) { - const message = sanitizeHostErrorMessage(e.message); - return { - success: false, - error: `Failed to load CPython: ${message}` - }; - } - activateDefense(input.protocolToken); - moduleReady = true; - for (const text of pendingStdout) backend.writeStdout(text); - for (const text of pendingStderr) backend.writeStderr(text); - const HOSTFS = createHOSTFS(backend, Module.FS, Module.PATH); - try { - Module.FS.mkdir("/host"); - Module.FS.mount(HOSTFS, { root: "/" }, "/host"); - } catch (e) { - const message = sanitizeHostErrorMessage(e.message); - return { - success: false, - error: `Failed to mount HOSTFS: ${message}` - }; - } - const HTTPFS = createHTTPFS(backend, Module.FS); - try { - Module.FS.mkdir("/_jb_http"); - Module.FS.mount(HTTPFS, { root: "/" }, "/_jb_http"); - } catch (e) { - const message = sanitizeHostErrorMessage(e.message); - return { - success: false, - error: `Failed to mount HTTPFS: ${message}` - }; - } - const setupCode = generateSetupCode(input); - const httpBridgeCode = generateHttpBridgeCode(); - const wrappedCode = ` -import sys -_jb_exit_code = 0 -try: -${setupCode.split("\n").map((line) => ` ${line}`).join("\n")} -${httpBridgeCode.split("\n").map((line) => ` ${line}`).join("\n")} -${input.pythonCode.split("\n").map((line) => ` ${line}`).join("\n")} -except SystemExit as e: - _jb_exit_code = e.code if isinstance(e.code, int) else (1 if e.code else 0) -except Exception as e: - import traceback - traceback.print_exc() - _jb_exit_code = 1 -sys.exit(_jb_exit_code) -`; - try { - Module.FS.mkdir("/tmp"); - } catch (_e) { - } - const encoder = new TextEncoder(); - const scriptPath = "/tmp/_jb_script.py"; - const scriptData = encoder.encode(wrappedCode); - Module.FS.writeFile(scriptPath, scriptData); - try { - const ret = Module.callMain([scriptPath]); - const exitCode = (typeof ret === "number" ? ret : 0) || process.exitCode || 0; - backend.exit(exitCode); - return { success: true }; - } catch (e) { - const error = e; - const exitCode = error.status ?? process.exitCode ?? 1; - backend.exit(exitCode); - return { success: true }; - } -} -var defense = null; -function activateDefense(protocolToken) { - if (defense) return; - const _DateNow = Date.now; - const degraded = { now: () => _DateNow(), timeOrigin: _DateNow() }; - Object.defineProperty(globalThis, "performance", { - value: degraded, - writable: true, - configurable: true - }); - const onViolation = wrapWasmCallback( - "python3-worker", - "onViolation", - (v) => { - postWorkerMessage(protocolToken, { - type: "security-violation", - violation: v - }); - } - ); - defense = new WorkerDefenseInDepth({ - excludeViolationTypes: [ - // SharedArrayBuffer/Atomics: Used by sync-fs-backend.ts for synchronous - // filesystem communication between the WASM thread and the main thread. - "shared_array_buffer", - "atomics", - // performance: Excluded because we replaced it above with a ms-precision - // stub. Defense doesn't need to block it — it's already degraded. - "performance_timing" - ], - onViolation - }); -} -process.on("uncaughtException", (e) => { - if (!activeProtocolToken) { - return; - } - const message = sanitizeHostErrorMessage(e.message); - postWorkerMessage(activeProtocolToken, { - success: false, - error: `Worker uncaught exception: ${message}` - }); -}); -var activeProtocolToken = null; -if (parentPort) { - if (workerData) { - const input = workerData; - activeProtocolToken = input.protocolToken; - runPython(input).then((result) => { - result.defenseStats = defense?.getStats(); - postWorkerMessage(input.protocolToken, result); - }).catch((e) => { - const message = sanitizeUnknownError(e); - postWorkerMessage(input.protocolToken, { - success: false, - error: message, - defenseStats: defense?.getStats() - }); - }); - } -} diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/xan-LKYWG2QQ.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/xan-LKYWG2QQ.js deleted file mode 100644 index a579dcd..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/xan-LKYWG2QQ.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-6Y4TGEZL.js";import"./chunk-WKPK7M56.js";import"./chunk-4I3HOE5Z.js";import"./chunk-J3LJZWL2.js";import"./chunk-4WKZNNJK.js";import"./chunk-DLL7UR66.js";import"./chunk-KAPG5ONA.js";import"./chunk-VACKIICN.js";import"./chunk-7CSMHFIJ.js";import"./chunk-KTPCYKBB.js";import"./chunk-XEKXHOPO.js";import"./chunk-SAI2SPQQ.js";import"./chunk-STHBFACM.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{b as flagsForFuzzing,a as xanCommand}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/xan-view-YATJ4KAA.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/xan-view-YATJ4KAA.js deleted file mode 100644 index 63b317c..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/xan-view-YATJ4KAA.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{g as a,h as b}from"./chunk-WKPK7M56.js";import"./chunk-4I3HOE5Z.js";import"./chunk-XEKXHOPO.js";import"./chunk-BZUGFHVS.js";export{a as cmdFlatten,b as cmdView}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/xargs-VDP7DLOU.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/xargs-VDP7DLOU.js deleted file mode 100644 index af9f405..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/xargs-VDP7DLOU.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-NGPDJCUE.js";import"./chunk-L2UW7DWF.js";import"./chunk-XEKXHOPO.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{b as flagsForFuzzing,a as xargsCommand}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/chunks/yq-TVZ7R3O7.js b/.output/server/node_modules/just-bash/dist/bundle/chunks/yq-TVZ7R3O7.js deleted file mode 100644 index 726d7ff..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/chunks/yq-TVZ7R3O7.js +++ /dev/null @@ -1,2 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a,b}from"./chunk-QM4DZQWX.js";import"./chunk-4I3HOE5Z.js";import"./chunk-J3LJZWL2.js";import"./chunk-4WKZNNJK.js";import"./chunk-DLL7UR66.js";import"./chunk-KAPG5ONA.js";import"./chunk-VACKIICN.js";import"./chunk-7CSMHFIJ.js";import"./chunk-XEKXHOPO.js";import"./chunk-SAI2SPQQ.js";import"./chunk-FOCWZZDE.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{b as flagsForFuzzing,a as yqCommand}; diff --git a/.output/server/node_modules/just-bash/dist/bundle/index.js b/.output/server/node_modules/just-bash/dist/bundle/index.js deleted file mode 100644 index 2137934..0000000 --- a/.output/server/node_modules/just-bash/dist/bundle/index.js +++ /dev/null @@ -1,785 +0,0 @@ -import{createRequire} from"node:module";const require=createRequire(import.meta.url); -import{a as ft,b as dt,c as je}from"./chunks/chunk-WNH3HOQA.js";import{c as Bn}from"./chunks/chunk-HBVMHTO5.js";import{a as ks,b as Ns}from"./chunks/chunk-SY4HAUHP.js";import{a as zn}from"./chunks/chunk-L2UW7DWF.js";import{a as bt,b as qe,c as cs}from"./chunks/chunk-DLL7UR66.js";import{a as ls,b as Di}from"./chunks/chunk-KAPG5ONA.js";import{a as gt,b as Ie}from"./chunks/chunk-VACKIICN.js";import{a as le}from"./chunks/chunk-7CSMHFIJ.js";import{a as os,b as _s,c as xc,d as yt,e as Cc,f as xs,g as Dc,h as Cs,i as Vn,j as Rc,k as Ic}from"./chunks/chunk-XEKXHOPO.js";import{a as Oe,b as Te,c as ke,d as ze,e as Le,f as Z,g as se,h as Me,i as wt,j as Ds,k as X,l as Rs,m as Et,n as Is,o as Be}from"./chunks/chunk-SAI2SPQQ.js";import"./chunks/chunk-STHBFACM.js";import{a as ut}from"./chunks/chunk-FOCWZZDE.js";import{a as ct}from"./chunks/chunk-W5DWRFSU.js";import{a as Fn}from"./chunks/chunk-BZUGFHVS.js";var Rt=[{name:"echo",load:async()=>(await import("./chunks/echo-NDWZZHPO.js")).echoCommand},{name:"cat",load:async()=>(await import("./chunks/cat-LPZ6XNHG.js")).catCommand},{name:"printf",load:async()=>(await import("./chunks/printf-JPOOWRJC.js")).printfCommand},{name:"ls",load:async()=>(await import("./chunks/ls-ZJGQER7M.js")).lsCommand},{name:"mkdir",load:async()=>(await import("./chunks/mkdir-MEPGZOB6.js")).mkdirCommand},{name:"rmdir",load:async()=>(await import("./chunks/rmdir-OC4ZLPYA.js")).rmdirCommand},{name:"touch",load:async()=>(await import("./chunks/touch-UA33VN3N.js")).touchCommand},{name:"rm",load:async()=>(await import("./chunks/rm-SSGETQVQ.js")).rmCommand},{name:"cp",load:async()=>(await import("./chunks/cp-BISAAS7A.js")).cpCommand},{name:"mv",load:async()=>(await import("./chunks/mv-W5BIQ646.js")).mvCommand},{name:"ln",load:async()=>(await import("./chunks/ln-4LGSXXGD.js")).lnCommand},{name:"chmod",load:async()=>(await import("./chunks/chmod-TFEPA42X.js")).chmodCommand},{name:"pwd",load:async()=>(await import("./chunks/pwd-WE6EN5AV.js")).pwdCommand},{name:"readlink",load:async()=>(await import("./chunks/readlink-OPJF4DL5.js")).readlinkCommand},{name:"head",load:async()=>(await import("./chunks/head-AEMOMQSZ.js")).headCommand},{name:"tail",load:async()=>(await import("./chunks/tail-GJMTLMNE.js")).tailCommand},{name:"wc",load:async()=>(await import("./chunks/wc-TZFYWFLA.js")).wcCommand},{name:"stat",load:async()=>(await import("./chunks/stat-CD34IZ4P.js")).statCommand},{name:"grep",load:async()=>(await import("./chunks/grep-VUESTEZ7.js")).grepCommand},{name:"fgrep",load:async()=>(await import("./chunks/grep-VUESTEZ7.js")).fgrepCommand},{name:"egrep",load:async()=>(await import("./chunks/grep-VUESTEZ7.js")).egrepCommand},{name:"rg",load:async()=>(await import("./chunks/rg-EBMD72T4.js")).rgCommand},{name:"sed",load:async()=>(await import("./chunks/sed-DX2SGXMF.js")).sedCommand},{name:"awk",load:async()=>(await import("./chunks/awk2-SREAOJRG.js")).awkCommand2},{name:"sort",load:async()=>(await import("./chunks/sort-VW2NIZHW.js")).sortCommand},{name:"uniq",load:async()=>(await import("./chunks/uniq-DMFKT3AB.js")).uniqCommand},{name:"comm",load:async()=>(await import("./chunks/comm-5QMYEAJL.js")).commCommand},{name:"cut",load:async()=>(await import("./chunks/cut-NDMV7SPO.js")).cutCommand},{name:"paste",load:async()=>(await import("./chunks/paste-ABCY7E6C.js")).pasteCommand},{name:"tr",load:async()=>(await import("./chunks/tr-JNNR5JMS.js")).trCommand},{name:"rev",load:async()=>(await import("./chunks/rev-GCV6X22K.js")).rev},{name:"nl",load:async()=>(await import("./chunks/nl-Q2L5XQWZ.js")).nl},{name:"fold",load:async()=>(await import("./chunks/fold-XR2JMFCW.js")).fold},{name:"expand",load:async()=>(await import("./chunks/expand-T2TH4TBQ.js")).expand},{name:"unexpand",load:async()=>(await import("./chunks/unexpand-2TKXAENW.js")).unexpand},{name:"strings",load:async()=>(await import("./chunks/strings-MCXFXPDL.js")).strings},{name:"split",load:async()=>(await import("./chunks/split-NBMH43M2.js")).split},{name:"column",load:async()=>(await import("./chunks/column-PVOEF65J.js")).column},{name:"join",load:async()=>(await import("./chunks/join-YIABB6WR.js")).join},{name:"tee",load:async()=>(await import("./chunks/tee-SGANDVNY.js")).teeCommand},{name:"find",load:async()=>(await import("./chunks/find-T5TGGXUU.js")).findCommand},{name:"basename",load:async()=>(await import("./chunks/basename-UB3CIYNI.js")).basenameCommand},{name:"dirname",load:async()=>(await import("./chunks/dirname-MPHRFUTI.js")).dirnameCommand},{name:"tree",load:async()=>(await import("./chunks/tree-YLD52CNT.js")).treeCommand},{name:"du",load:async()=>(await import("./chunks/du-572XNP42.js")).duCommand},{name:"env",load:async()=>(await import("./chunks/env-DLFRY633.js")).envCommand},{name:"printenv",load:async()=>(await import("./chunks/env-DLFRY633.js")).printenvCommand},{name:"alias",load:async()=>(await import("./chunks/alias-RTYYYW3D.js")).aliasCommand},{name:"unalias",load:async()=>(await import("./chunks/alias-RTYYYW3D.js")).unaliasCommand},{name:"history",load:async()=>(await import("./chunks/history-WYYKSLSZ.js")).historyCommand},{name:"xargs",load:async()=>(await import("./chunks/xargs-VDP7DLOU.js")).xargsCommand},{name:"true",load:async()=>(await import("./chunks/true-FHQXJXBE.js")).trueCommand},{name:"false",load:async()=>(await import("./chunks/true-FHQXJXBE.js")).falseCommand},{name:"clear",load:async()=>(await import("./chunks/clear-HKGFEOF6.js")).clearCommand},{name:"bash",load:async()=>(await import("./chunks/bash-F4KHPMTX.js")).bashCommand},{name:"sh",load:async()=>(await import("./chunks/bash-F4KHPMTX.js")).shCommand},{name:"jq",load:async()=>(await import("./chunks/jq-OPEF5OPR.js")).jqCommand},{name:"base64",load:async()=>(await import("./chunks/base64-WIGL46P3.js")).base64Command},{name:"diff",load:async()=>(await import("./chunks/diff-TT4M7WM3.js")).diffCommand},{name:"date",load:async()=>(await import("./chunks/date-XKUEQ4WF.js")).dateCommand},{name:"sleep",load:async()=>(await import("./chunks/sleep-HZ4QEFOK.js")).sleepCommand},{name:"timeout",load:async()=>(await import("./chunks/timeout-VDIEAB4R.js")).timeoutCommand},{name:"time",load:async()=>(await import("./chunks/time-FCZCDIAM.js")).timeCommand},{name:"seq",load:async()=>(await import("./chunks/seq-M5EC7Q57.js")).seqCommand},{name:"expr",load:async()=>(await import("./chunks/expr-YLACLCSM.js")).exprCommand},{name:"md5sum",load:async()=>(await import("./chunks/md5sum-LU7RVIB7.js")).md5sumCommand},{name:"sha1sum",load:async()=>(await import("./chunks/sha1sum-O6DM3TPQ.js")).sha1sumCommand},{name:"sha256sum",load:async()=>(await import("./chunks/sha256sum-WPVZLZPS.js")).sha256sumCommand},{name:"file",load:async()=>(await import("./chunks/file-IPZJC3FQ.js")).fileCommand},{name:"html-to-markdown",load:async()=>(await import("./chunks/html-to-markdown-LXXMVQ3V.js")).htmlToMarkdownCommand},{name:"help",load:async()=>(await import("./chunks/help-HZ6M2CKN.js")).helpCommand},{name:"which",load:async()=>(await import("./chunks/which-XEM24D5D.js")).whichCommand},{name:"tac",load:async()=>(await import("./chunks/tac-BQ7EDZW2.js")).tac},{name:"hostname",load:async()=>(await import("./chunks/hostname-C4HQXXUP.js")).hostname},{name:"whoami",load:async()=>(await import("./chunks/whoami-XMTX52VE.js")).whoami},{name:"od",load:async()=>(await import("./chunks/od-RDSM4TQJ.js")).od},{name:"gzip",load:async()=>(await import("./chunks/gzip-HF3D26QX.js")).gzipCommand},{name:"gunzip",load:async()=>(await import("./chunks/gzip-HF3D26QX.js")).gunzipCommand},{name:"zcat",load:async()=>(await import("./chunks/gzip-HF3D26QX.js")).zcatCommand}];(typeof __BROWSER__>"u"||!__BROWSER__)&&(Rt.push({name:"tar",load:async()=>(await import("./chunks/tar-WIZ3PDF4.js")).tarCommand}),Rt.push({name:"yq",load:async()=>(await import("./chunks/yq-TVZ7R3O7.js")).yqCommand}),Rt.push({name:"xan",load:async()=>(await import("./chunks/xan-LKYWG2QQ.js")).xanCommand}),Rt.push({name:"sqlite3",load:async()=>(await import("./chunks/sqlite3-UE3PJTDQ.js")).sqlite3Command}));var Os=[];(typeof __BROWSER__>"u"||!__BROWSER__)&&(Os.push({name:"python3",load:async()=>(await import("./chunks/python3-JPCH6LLN.js")).python3Command}),Os.push({name:"python",load:async()=>(await import("./chunks/python3-JPCH6LLN.js")).pythonCommand}));var Ts=[];(typeof __BROWSER__>"u"||!__BROWSER__)&&(Ts.push({name:"js-exec",load:async()=>(await import("./chunks/js-exec-SR6IMNWM.js")).jsExecCommand}),Ts.push({name:"node",load:async()=>(await import("./chunks/js-exec-SR6IMNWM.js")).nodeStubCommand}));var Ii=[{name:"curl",load:async()=>(await import("./chunks/curl-PAWGO3EH.js")).curlCommand}],Ri=new Map;function Ls(e){return{name:e.name,async execute(t,s){let r=Ri.get(e.name);if(r||(r=await Ie.runTrustedAsync(()=>e.load()),Ri.set(e.name,r)),s.coverage&&(typeof __BROWSER__>"u"||!__BROWSER__)){let{emitFlagCoverage:n}=await import("./chunks/flag-coverage-OHLSWDU5.js");n(s.coverage,e.name,t)}return r.execute(t,s)}}}function Oc(){return Rt.map(e=>e.name)}function Tc(){return Ii.map(e=>e.name)}function Oi(e){return(e?Rt.filter(s=>e.includes(s.name)):Rt).map(Ls)}function Ti(){return Ii.map(Ls)}function Lc(){return Os.map(e=>e.name)}function Li(){return Os.map(Ls)}function Mc(){return Ts.map(e=>e.name)}function Mi(){return Ts.map(Ls)}function Wi(e){return"load"in e&&typeof e.load=="function"}function Wc(e,t){return{name:e,trusted:!0,execute:t}}function Fi(e){let t=null;return{name:e.name,trusted:!0,async execute(s,r){return t||(t=await e.load()),t.execute(s,r)}}}function L(e){if(!e||e==="/")return"/";let t=e.endsWith("/")&&e!=="/"?e.slice(0,-1):e;t.startsWith("/")||(t=`/${t}`);let s=t.split("/").filter(n=>n&&n!=="."),r=[];for(let n of s)n===".."?r.pop():r.push(n);return`/${r.join("/")}`||"/"}function M(e,t){if(e.includes("\0"))throw new Error(`ENOENT: path contains null byte, ${t} '${e}'`)}function It(e){let t=L(e);if(t==="/")return"/";let s=t.lastIndexOf("/");return s===0?"/":t.slice(0,s)}function vt(e,t){if(t.startsWith("/"))return L(t);let s=e==="/"?`/${t}`:`${e}/${t}`;return L(s)}function St(e,t){return e==="/"?`/${t}`:`${e}/${t}`}function zt(e,t){if(t.startsWith("/"))return L(t);let s=It(e);return L(St(s,t))}var Bt=new TextEncoder;function Fc(e){return typeof e=="object"&&e!==null&&!(e instanceof Uint8Array)&&"content"in e}var ht=class{data=new Map;constructor(t){if(this.data.set("/",{type:"directory",mode:493,mtime:new Date}),t)for(let[s,r]of Object.entries(t))typeof r=="function"?this.writeFileLazy(s,r):Fc(r)?this.writeFileSync(s,r.content,void 0,{mode:r.mode,mtime:r.mtime}):this.writeFileSync(s,r)}ensureParentDirs(t){let s=It(t);s!=="/"&&(this.data.has(s)||(this.ensureParentDirs(s),this.data.set(s,{type:"directory",mode:493,mtime:new Date})))}writeFileSync(t,s,r,n){M(t,"write");let i=L(t);this.ensureParentDirs(i);let a=je(r),l=ft(s,a);this.data.set(i,{type:"file",content:l,mode:n?.mode??420,mtime:n?.mtime??new Date})}writeFileLazy(t,s,r){M(t,"write");let n=L(t);this.ensureParentDirs(n),this.data.set(n,{type:"file",lazy:s,mode:r?.mode??420,mtime:r?.mtime??new Date})}async materializeLazy(t,s){let r=await s.lazy(),i={type:"file",content:typeof r=="string"?Bt.encode(r):r,mode:s.mode,mtime:s.mtime};return this.data.set(t,i),i}async readFile(t,s){let r=await this.readFileBuffer(t),n=je(s);return dt(r,n)}async readFileBytes(t){let s=await this.readFileBuffer(t);return dt(s,"binary")}async readFileBuffer(t){M(t,"open");let s=this.resolvePathWithSymlinks(t),r=this.data.get(s);if(!r)throw new Error(`ENOENT: no such file or directory, open '${t}'`);if(r.type!=="file")throw new Error(`EISDIR: illegal operation on a directory, read '${t}'`);if("lazy"in r){let n=await this.materializeLazy(s,r);return n.content instanceof Uint8Array?n.content:Bt.encode(n.content)}return r.content instanceof Uint8Array?r.content:Bt.encode(r.content)}async writeFile(t,s,r){this.writeFileSync(t,s,r)}async appendFile(t,s,r){M(t,"append");let n=L(t),i=this.data.get(n);if(i&&i.type==="directory")throw new Error(`EISDIR: illegal operation on a directory, write '${t}'`);let a=je(r),l=ft(s,a);if(i?.type==="file"){let o=i;"lazy"in o&&(o=await this.materializeLazy(n,o));let u="content"in o&&o.content instanceof Uint8Array?o.content:Bt.encode("content"in o?o.content:""),c=new Uint8Array(u.length+l.length);c.set(u),c.set(l,u.length),this.data.set(n,{type:"file",content:c,mode:o.mode,mtime:new Date})}else this.writeFileSync(t,s,r)}async exists(t){if(t.includes("\0"))return!1;try{let s=this.resolvePathWithSymlinks(t);return this.data.has(s)}catch{return!1}}async stat(t){M(t,"stat");let s=this.resolvePathWithSymlinks(t),r=this.data.get(s);if(!r)throw new Error(`ENOENT: no such file or directory, stat '${t}'`);r.type==="file"&&"lazy"in r&&(r=await this.materializeLazy(s,r));let n=0;return r.type==="file"&&"content"in r&&r.content&&(r.content instanceof Uint8Array?n=r.content.length:n=Bt.encode(r.content).length),{isFile:r.type==="file",isDirectory:r.type==="directory",isSymbolicLink:!1,mode:r.mode,size:n,mtime:r.mtime||new Date}}async lstat(t){M(t,"lstat");let s=this.resolveIntermediateSymlinks(t),r=this.data.get(s);if(!r)throw new Error(`ENOENT: no such file or directory, lstat '${t}'`);if(r.type==="symlink")return{isFile:!1,isDirectory:!1,isSymbolicLink:!0,mode:r.mode,size:r.target.length,mtime:r.mtime||new Date};r.type==="file"&&"lazy"in r&&(r=await this.materializeLazy(s,r));let n=0;return r.type==="file"&&"content"in r&&r.content&&(r.content instanceof Uint8Array?n=r.content.length:n=Bt.encode(r.content).length),{isFile:r.type==="file",isDirectory:r.type==="directory",isSymbolicLink:!1,mode:r.mode,size:n,mtime:r.mtime||new Date}}resolveIntermediateSymlinks(t){let s=L(t);if(s==="/")return"/";let r=s.slice(1).split("/");if(r.length<=1)return s;let n="",i=new Set;for(let a=0;a=c)throw new Error(`ELOOP: too many levels of symbolic links, lstat '${t}'`)}return`${n}/${r[r.length-1]}`}resolvePathWithSymlinks(t){let s=L(t);if(s==="/")return"/";let r=s.slice(1).split("/"),n="",i=new Set;for(let a of r){n=`${n}/${a}`;let l=this.data.get(n),o=0,u=40;for(;l&&l.type==="symlink"&&o=u)throw new Error(`ELOOP: too many levels of symbolic links, open '${t}'`)}return n}async mkdir(t,s){this.mkdirSync(t,s)}mkdirSync(t,s){M(t,"mkdir");let r=L(t);if(this.data.has(r)){if(this.data.get(r)?.type==="file")throw new Error(`EEXIST: file already exists, mkdir '${t}'`);if(!s?.recursive)throw new Error(`EEXIST: directory already exists, mkdir '${t}'`);return}let n=It(r);if(n!=="/"&&!this.data.has(n))if(s?.recursive)this.mkdirSync(n,{recursive:!0});else throw new Error(`ENOENT: no such file or directory, mkdir '${t}'`);this.data.set(r,{type:"directory",mode:493,mtime:new Date})}async readdir(t){return(await this.readdirWithFileTypes(t)).map(r=>r.name)}async readdirWithFileTypes(t){M(t,"scandir");let s=L(t),r=this.data.get(s);if(!r)throw new Error(`ENOENT: no such file or directory, scandir '${t}'`);let n=new Set;for(;r&&r.type==="symlink";){if(n.has(s))throw new Error(`ELOOP: too many levels of symbolic links, scandir '${t}'`);n.add(s),s=zt(s,r.target),r=this.data.get(s)}if(!r)throw new Error(`ENOENT: no such file or directory, scandir '${t}'`);if(r.type!=="directory")throw new Error(`ENOTDIR: not a directory, scandir '${t}'`);let i=s==="/"?"/":`${s}/`,a=new Map;for(let[l,o]of this.data.entries())if(l!==s&&l.startsWith(i)){let u=l.slice(i.length),c=u.split("/")[0];c&&!u.includes("/",c.length)&&!a.has(c)&&a.set(c,{name:c,isFile:o.type==="file",isDirectory:o.type==="directory",isSymbolicLink:o.type==="symlink"})}return Array.from(a.values()).sort((l,o)=>l.nameo.name?1:0)}async rm(t,s){M(t,"rm");let r=L(t),n=this.data.get(r);if(!n){if(s?.force)return;throw new Error(`ENOENT: no such file or directory, rm '${t}'`)}if(n.type==="directory"){let i=await this.readdir(r);if(i.length>0){if(!s?.recursive)throw new Error(`ENOTEMPTY: directory not empty, rm '${t}'`);for(let a of i){let l=St(r,a);await this.rm(l,s)}}}this.data.delete(r)}async cp(t,s,r){M(t,"cp"),M(s,"cp");let n=L(t),i=L(s),a=this.data.get(n);if(!a)throw new Error(`ENOENT: no such file or directory, cp '${t}'`);if(a.type==="file")if(this.ensureParentDirs(i),"content"in a){let l=a.content instanceof Uint8Array?new Uint8Array(a.content):a.content;this.data.set(i,{...a,content:l})}else this.data.set(i,{...a});else if(a.type==="symlink")this.ensureParentDirs(i),this.data.set(i,{...a});else if(a.type==="directory"){if(!r?.recursive)throw new Error(`EISDIR: is a directory, cp '${t}'`);await this.mkdir(i,{recursive:!0});let l=await this.readdir(n);for(let o of l){let u=St(n,o),c=St(i,o);await this.cp(u,c,r)}}}async mv(t,s){await this.cp(t,s,{recursive:!0}),await this.rm(t,{recursive:!0})}getAllPaths(){return Array.from(this.data.keys())}resolvePath(t,s){return vt(t,s)}async chmod(t,s){M(t,"chmod");let r=L(t),n=this.data.get(r);if(!n)throw new Error(`ENOENT: no such file or directory, chmod '${t}'`);n.mode=s}async symlink(t,s){M(s,"symlink");let r=L(s);if(this.data.has(r))throw new Error(`EEXIST: file already exists, symlink '${s}'`);this.ensureParentDirs(r),this.data.set(r,{type:"symlink",target:t,mode:511,mtime:new Date})}async link(t,s){M(t,"link"),M(s,"link");let r=L(t),n=L(s),i=this.data.get(r);if(!i)throw new Error(`ENOENT: no such file or directory, link '${t}'`);if(i.type!=="file")throw new Error(`EPERM: operation not permitted, link '${t}'`);if(this.data.has(n))throw new Error(`EEXIST: file already exists, link '${s}'`);let a=i;"lazy"in a&&(a=await this.materializeLazy(r,a)),this.ensureParentDirs(n),this.data.set(n,{type:"file",content:a.content,mode:a.mode,mtime:a.mtime})}async readlink(t){M(t,"readlink");let s=L(t),r=this.data.get(s);if(!r)throw new Error(`ENOENT: no such file or directory, readlink '${t}'`);if(r.type!=="symlink")throw new Error(`EINVAL: invalid argument, readlink '${t}'`);return r.target}async realpath(t){M(t,"realpath");let s=this.resolvePathWithSymlinks(t);if(!this.data.has(s))throw new Error(`ENOENT: no such file or directory, realpath '${t}'`);return s}async utimes(t,s,r){M(t,"utimes");let n=L(t),i=this.resolvePathWithSymlinks(n),a=this.data.get(i);if(!a)throw new Error(`ENOENT: no such file or directory, utimes '${t}'`);a.mtime=r}};var Vi="5.1.0(1)-release",zi="Linux version 5.15.0-generic (just-bash) #1 SMP PREEMPT";function jn(e){let{pid:t,ppid:s,uid:r,gid:n}=e;return`Name: bash -State: R (running) -Pid: ${t} -PPid: ${s} -Uid: ${r} ${r} ${r} ${r} -Gid: ${n} ${n} ${n} ${n} -`}function Vc(e){let t=e;return typeof t.mkdirSync=="function"&&typeof t.writeFileSync=="function"}function zc(e,t){e.mkdirSync("/bin",{recursive:!0}),e.mkdirSync("/usr/bin",{recursive:!0}),t&&(e.mkdirSync("/home/user",{recursive:!0}),e.mkdirSync("/tmp",{recursive:!0}))}function Bc(e){e.mkdirSync("/dev",{recursive:!0}),e.writeFileSync("/dev/null",""),e.writeFileSync("/dev/zero",new Uint8Array(0)),e.writeFileSync("/dev/stdin",""),e.writeFileSync("/dev/stdout",""),e.writeFileSync("/dev/stderr","")}function qc(e,t){e.mkdirSync("/proc/self/fd",{recursive:!0}),e.writeFileSync("/proc/version",`${zi} -`),e.writeFileSync("/proc/self/exe","/bin/bash"),e.writeFileSync("/proc/self/cmdline","bash\0"),e.writeFileSync("/proc/self/comm",`bash -`),e.writeFileLazy?e.writeFileLazy("/proc/self/status",()=>jn(t)):e.writeFileSync("/proc/self/status",jn(t)),e.writeFileSync("/proc/self/fd/0","/dev/stdin"),e.writeFileSync("/proc/self/fd/1","/dev/stdout"),e.writeFileSync("/proc/self/fd/2","/dev/stderr")}function Bi(e,t,s={pid:1,ppid:0,uid:1e3,gid:1e3}){Vc(e)&&(zc(e,t),Bc(e),qc(e,s))}var jc=["allexport","errexit","noglob","noclobber","noexec","nounset","pipefail","posix","verbose","xtrace"],Uc=["braceexpand","hashall","interactive-comments"];function Un(e){let t=[],s=[...Uc.map(r=>({name:r,enabled:!0})),...jc.map(r=>({name:r,enabled:e[r]}))].sort((r,n)=>r.name.localeCompare(n.name));for(let r of s)r.enabled&&t.push(r.name);return t.join(":")}function jt(e){e.state.env.set("SHELLOPTS",Un(e.state.options))}var Zc=["dotglob","expand_aliases","extglob","failglob","globskipdots","globstar","lastpipe","nocaseglob","nocasematch","nullglob","xpg_echo"];function Zn(e){let t=[];for(let s of Zc)e[s]&&t.push(s);return t.join(":")}function Gn(e){e.state.env.set("BASHOPTS",Zn(e.state.shoptOptions))}var I={script(e){return{type:"Script",statements:e}},statement(e,t=[],s=!1,r,n){let i={type:"Statement",pipelines:e,operators:t,background:s};return r&&(i.deferredError=r),n!==void 0&&(i.sourceText=n),i},pipeline(e,t=!1,s=!1,r=!1,n){return{type:"Pipeline",commands:e,negated:t,timed:s,timePosix:r,pipeStderr:n}},simpleCommand(e,t=[],s=[],r=[]){return{type:"SimpleCommand",name:e,args:t,assignments:s,redirections:r}},word(e){return{type:"Word",parts:e}},literal(e){return{type:"Literal",value:e}},singleQuoted(e){return{type:"SingleQuoted",value:e}},doubleQuoted(e){return{type:"DoubleQuoted",parts:e}},escaped(e){return{type:"Escaped",value:e}},parameterExpansion(e,t=null){return{type:"ParameterExpansion",parameter:e,operation:t}},commandSubstitution(e,t=!1){return{type:"CommandSubstitution",body:e,legacy:t}},arithmeticExpansion(e){return{type:"ArithmeticExpansion",expression:e}},assignment(e,t,s=!1,r=null){return{type:"Assignment",name:e,value:t,append:s,array:r}},redirection(e,t,s=null,r){let n={type:"Redirection",fd:s,operator:e,target:t};return r&&(n.fdVariable=r),n},hereDoc(e,t,s=!1,r=!1){return{type:"HereDoc",delimiter:e,content:t,stripTabs:s,quoted:r}},ifNode(e,t=null,s=[]){return{type:"If",clauses:e,elseBody:t,redirections:s}},forNode(e,t,s,r=[]){return{type:"For",variable:e,words:t,body:s,redirections:r}},whileNode(e,t,s=[]){return{type:"While",condition:e,body:t,redirections:s}},untilNode(e,t,s=[]){return{type:"Until",condition:e,body:t,redirections:s}},caseNode(e,t,s=[]){return{type:"Case",word:e,items:t,redirections:s}},caseItem(e,t,s=";;"){return{type:"CaseItem",patterns:e,body:t,terminator:s}},subshell(e,t=[]){return{type:"Subshell",body:e,redirections:t}},group(e,t=[]){return{type:"Group",body:e,redirections:t}},functionDef(e,t,s=[],r){return{type:"FunctionDef",name:e,body:t,redirections:s,sourceFile:r}},conditionalCommand(e,t=[],s){return{type:"ConditionalCommand",expression:e,redirections:t,line:s}},arithmeticCommand(e,t=[],s){return{type:"ArithmeticCommand",expression:e,redirections:t,line:s}}};function qi(e,t){let s=e.length,r=t+3,n=2,i=!1,a=!1;for(;r0;){let l=e[r];if(i){l==="'"&&(i=!1),r++;continue}if(a){if(l==="\\"){r+=2;continue}l==='"'&&(a=!1),r++;continue}if(l==="'"){i=!0,r++;continue}if(l==='"'){a=!0,r++;continue}if(l==="\\"){r+=2;continue}if(l==="("){n++,r++;continue}if(l===")"){if(n--,n===1){let o=r+1;return!(oi===" "||i===" "||i===` -`||i===";"||i==="&"||i==="|"||i==="<"||i===">"||i==="("||i===")";for(;r=e.length)return e.length;let a=e.indexOf(` -`,r);a===-1&&(a=e.length);let l=e.slice(r,a);if(i&&(l=l.replace(/^\t+/,"")),l===n){r=a+1;break}if(a>=e.length)return e.length;r=a+1}return Math.min(r,e.length)}function ji(e,t,s,r){let n=t+2,i=1,a=n,l=!1,o=!1,u=0,c=!1,f="",d=[],h=0;for(;a0;){let b=e[a];if(l)b==="'"&&(l=!1);else if(o)b==="\\"&&a+10&&h--,h===0&&b==="<"&&e[a+1]==="<"&&e[a+2]!=="<"){let v=a+2,E=!1;for(e[v]==="-"&&(E=!0,v++);e[v]===" "||e[v]===" ";)v++;let{delim:w,endPos:S}=Hn(e,v);if(w.length>0){d.push({delim:w,stripTabs:E}),f="",a=S;continue}}if(b===` -`&&d.length>0){let v=Gc(e,a,d);d.length=0,f="",a=v;continue}b==="'"?(l=!0,f=""):b==='"'?(o=!0,f=""):b==="\\"&&a+10?c=!0:f==="esac"&&u>0&&(u--,c=!1),f="",b==="("?a>0&&e[a-1]==="$"?i++:c||i++:b===")"?c?c=!1:i--:b===";"&&u>0&&a+10&&a++}i>0&&r("unexpected EOF while looking for matching `)'");let m=e.slice(n,a),y=s().parse(m);return{part:I.commandSubstitution(y,!1),endIndex:a+1}}function Ui(e,t,s,r,n){let a=t+1,l="";for(;a=e.length&&n("unexpected EOF while looking for matching ``'");let u=r().parse(l);return{part:I.commandSubstitution(u,!0),endIndex:a+1}}var Hc=10485760,g;(function(e){e.EOF="EOF",e.NEWLINE="NEWLINE",e.SEMICOLON="SEMICOLON",e.AMP="AMP",e.PIPE="PIPE",e.PIPE_AMP="PIPE_AMP",e.AND_AND="AND_AND",e.OR_OR="OR_OR",e.BANG="BANG",e.LESS="LESS",e.GREAT="GREAT",e.DLESS="DLESS",e.DGREAT="DGREAT",e.LESSAND="LESSAND",e.GREATAND="GREATAND",e.LESSGREAT="LESSGREAT",e.DLESSDASH="DLESSDASH",e.CLOBBER="CLOBBER",e.TLESS="TLESS",e.AND_GREAT="AND_GREAT",e.AND_DGREAT="AND_DGREAT",e.LPAREN="LPAREN",e.RPAREN="RPAREN",e.LBRACE="LBRACE",e.RBRACE="RBRACE",e.DSEMI="DSEMI",e.SEMI_AND="SEMI_AND",e.SEMI_SEMI_AND="SEMI_SEMI_AND",e.DBRACK_START="DBRACK_START",e.DBRACK_END="DBRACK_END",e.DPAREN_START="DPAREN_START",e.DPAREN_END="DPAREN_END",e.IF="IF",e.THEN="THEN",e.ELSE="ELSE",e.ELIF="ELIF",e.FI="FI",e.FOR="FOR",e.WHILE="WHILE",e.UNTIL="UNTIL",e.DO="DO",e.DONE="DONE",e.CASE="CASE",e.ESAC="ESAC",e.IN="IN",e.FUNCTION="FUNCTION",e.SELECT="SELECT",e.TIME="TIME",e.COPROC="COPROC",e.WORD="WORD",e.NAME="NAME",e.NUMBER="NUMBER",e.ASSIGNMENT_WORD="ASSIGNMENT_WORD",e.FD_VARIABLE="FD_VARIABLE",e.COMMENT="COMMENT",e.HEREDOC_CONTENT="HEREDOC_CONTENT"})(g||(g={}));var At=class extends Error{line;column;constructor(t,s,r){super(`line ${s}: ${t}`),this.line=s,this.column=r,this.name="LexerError"}},Zi=new Map([["if",g.IF],["then",g.THEN],["else",g.ELSE],["elif",g.ELIF],["fi",g.FI],["for",g.FOR],["while",g.WHILE],["until",g.UNTIL],["do",g.DO],["done",g.DONE],["case",g.CASE],["esac",g.ESAC],["in",g.IN],["function",g.FUNCTION],["select",g.SELECT],["time",g.TIME],["coproc",g.COPROC]]);function Gi(e){let t=e.match(/^[a-zA-Z_][a-zA-Z0-9_]*/);if(!t)return!1;let s=e.slice(t[0].length);if(s===""||s==="+")return!0;if(s[0]==="["){let r=0,n=0;for(;n=s.length)return!1;let i=s.slice(n+1);return i===""||i==="+"}return!1}function Hi(e){let t=0;for(let s=0;s",">",g.AND_DGREAT]],Kc=[["[","[",g.DBRACK_START],["]","]",g.DBRACK_END],["(","(",g.DPAREN_START],[")",")",g.DPAREN_END],["&","&",g.AND_AND],["|","|",g.OR_OR],[";",";",g.DSEMI],[";","&",g.SEMI_AND],["|","&",g.PIPE_AMP],[">",">",g.DGREAT],["<","&",g.LESSAND],[">","&",g.GREATAND],["<",">",g.LESSGREAT],[">","|",g.CLOBBER],["&",">",g.AND_GREAT]],Xc=new Map([["|",g.PIPE],["&",g.AMP],[";",g.SEMICOLON],["(",g.LPAREN],[")",g.RPAREN],["<",g.LESS],[">",g.GREAT]]);function Yc(e){return/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(e)}function Qi(e){return e===" "||e===" "||e===` -`||e===";"||e==="&"||e==="|"||e==="("||e===")"||e==="<"||e===">"}var Ws=class{input;pos=0;line=1;column=1;tokens=[];pendingHeredocs=[];dparenDepth=0;maxHeredocSize;constructor(t,s){this.input=t,this.maxHeredocSize=s?.maxHeredocSize??Hc}tokenize(){let s=this.input.length,r=this.tokens,n=this.pendingHeredocs;for(;this.pos0&&r.length>0&&r[r.length-1].type===g.NEWLINE){this.readHeredocContent();continue}if(this.skipWhitespace(),this.pos>=s)break;let i=this.nextToken();i&&r.push(i)}return r.push({type:g.EOF,value:"",start:this.pos,end:this.pos,line:this.line,column:this.column}),r}skipWhitespace(){let t=this.input,s=t.length,r=this.pos,n=this.column,i=this.line;for(;r0?(this.pos=s+1,this.column=n+1,this.dparenDepth++,this.makeToken(g.LPAREN,"(",s,r,n)):this.looksLikeNestedSubshells(s+2)||this.dparenClosesWithSpacedParens(s+2)?(this.pos=s+1,this.column=n+1,this.makeToken(g.LPAREN,"(",s,r,n)):(this.pos=s+2,this.column=n+2,this.dparenDepth=1,this.makeToken(g.DPAREN_START,"((",s,r,n));if(i===")"&&a===")")return this.dparenDepth===1?(this.pos=s+2,this.column=n+2,this.dparenDepth=0,this.makeToken(g.DPAREN_END,"))",s,r,n)):this.dparenDepth>1?(this.pos=s+1,this.column=n+1,this.dparenDepth--,this.makeToken(g.RPAREN,")",s,r,n)):(this.pos=s+1,this.column=n+1,this.makeToken(g.RPAREN,")",s,r,n));for(let[u,c,f]of Kc)if(!(u==="("&&c==="("||u===")"&&c===")")&&!(this.dparenDepth>0&&u===";"&&(f===g.DSEMI||f===g.SEMI_AND||f===g.SEMI_SEMI_AND))&&i===u&&a===c){if(f===g.DBRACK_START||f===g.DBRACK_END){let d=t[s+2];if(d!==void 0&&d!==" "&&d!==" "&&d!==` -`&&d!==";"&&d!=="&"&&d!=="|"&&d!=="("&&d!==")"&&d!=="<"&&d!==">")break}return this.pos=s+2,this.column=n+2,this.makeToken(f,u+c,s,r,n)}if(i==="("&&this.dparenDepth>0)return this.pos=s+1,this.column=n+1,this.dparenDepth++,this.makeToken(g.LPAREN,"(",s,r,n);if(i===")"&&this.dparenDepth>1)return this.pos=s+1,this.column=n+1,this.dparenDepth--,this.makeToken(g.RPAREN,")",s,r,n);let o=Xc.get(i);if(o!==void 0)return this.pos=s+1,this.column=n+1,this.makeToken(o,i,s,r,n);if(i==="{"){let u=this.scanFdVariable(s);return u!==null?(this.pos=u.end,this.column=n+(u.end-s),{type:g.FD_VARIABLE,value:u.varname,start:s,end:u.end,line:r,column:n}):a==="}"?(this.pos=s+2,this.column=n+2,{type:g.WORD,value:"{}",start:s,end:s+2,line:r,column:n,quoted:!1,singleQuoted:!1}):this.scanBraceExpansion(s)!==null?this.readWordWithBraceExpansion(s,r,n):this.scanLiteralBraceWord(s)!==null?this.readWordWithBraceExpansion(s,r,n):a!==void 0&&a!==" "&&a!==" "&&a!==` -`?this.readWord(s,r,n):(this.pos=s+1,this.column=n+1,this.makeToken(g.LBRACE,"{",s,r,n))}return i==="}"?this.isWordCharFollowing(s+1)?this.readWord(s,r,n):(this.pos=s+1,this.column=n+1,this.makeToken(g.RBRACE,"}",s,r,n)):i==="!"?a==="="?(this.pos=s+2,this.column=n+2,this.makeToken(g.WORD,"!=",s,r,n)):(this.pos=s+1,this.column=n+1,this.makeToken(g.BANG,"!",s,r,n)):this.readWord(s,r,n)}looksLikeNestedSubshells(t){let s=this.input,r=s.length,n=t;for(;n=r)return!1;let i=s[n];if(i==="(")return this.looksLikeNestedSubshells(n+1);let a=/[a-zA-Z_]/.test(i),l=i==="!"||i==="[";if(!a&&!l)return!1;let o=n;for(;o=r)return!1;let c=s[u];if(c==="="&&s[u+1]!=="="||c===` -`||o===u&&/[+\-*/%<>&|^!~?:]/.test(c)&&c!=="-"||c===")"&&s[u+1]===")")return!1;if(u>o&&(c==="-"||c==='"'||c==="'"||c==="$"||/[a-zA-Z_/.]/.test(c))){let f=u;for(;f"||E==="'"||E==='"'||E==="\\"||E==="$"||E==="`"||E==="{"||E==="}"||E==="~"||E==="*"||E==="?"||E==="[")break;a++}if(a>l){let E=n[a];if(!(E==="("&&a>l&&"@*+?!".includes(n[a-1]))){if(a>=i||E===" "||E===" "||E===` -`||E===";"||E==="&"||E==="|"||E==="("||E===")"||E==="<"||E===">"){let w=n.slice(l,a);this.pos=a,this.column=r+(a-l);let S=Zi.get(w);if(S!==void 0)return{type:S,value:w,start:t,end:a,line:s,column:r};let A=Hi(w);return A>0&&Gi(w.slice(0,A))?{type:g.ASSIGNMENT_WORD,value:w,start:t,end:a,line:s,column:r}:/^[0-9]+$/.test(w)?{type:g.NUMBER,value:w,start:t,end:a,line:s,column:r}:/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(w)?{type:g.NAME,value:w,start:t,end:a,line:s,column:r,quoted:!1,singleQuoted:!1}:{type:g.WORD,value:w,start:t,end:a,line:s,column:r,quoted:!1,singleQuoted:!1}}}}a=this.pos;let o=this.column,u=this.line,c="",f=!1,d=!1,h=!1,m=!1,p=n[a]==='"'||n[a]==="'",y=!1,b=0;for(;a0&&"@*+?!".includes(c[c.length-1])){let w=this.scanExtglobPattern(a);if(w!==null){c+=w.content,a=w.end,o+=w.content.length;continue}}if(E==="["&&b===0){if(/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(c)){let w=a+10){c.length>0&&c[c.length-1]!=="\\"&&b++,c+=E,a++,o++;continue}else if(E==="]"&&b>0){c.length>0&&c[c.length-1]!=="\\"&&b--,c+=E,a++,o++;continue}if(b>0){if(E===` -`)break;c+=E,a++,o++;continue}if(E===" "||E===" "||E===` -`||E===";"||E==="&"||E==="|"||E==="("||E===")"||E==="<"||E===">")break}if(E==="$"&&a+10&&a0&&x--,x===0&&D==="<"&&n[a+1]==="<"&&n[a+2]!=="<"){let P=a+2,O=!1;for(n[P]==="-"&&(O=!0,P++);n[P]===" "||n[P]===" ";)P++;let{delim:z,endPos:U}=Hn(n,P);if(z.length>0){c+=n.slice(a+1,U),o+=U-a,F.push({delim:z,stripTabs:O}),a=U;continue}}if(D===` -`&&F.length>0){u++,o=0;let P=a+1;for(let{delim:O,stripTabs:z}of F)for(;!(P>=i);){let U=n.indexOf(` -`,P);U===-1&&(U=i);let ee=n.slice(P,U),fe=z?ee.replace(/^\t+/,""):ee;c+=n.slice(P,Math.min(U+1,i)),U=i;if(P=U+1,fe===O||ge)break}F.length=0,o=0,a=Math.min(P,i);continue}if(D==="'")S=!0,C="";else if(D==='"')A=!0,C="";else if(D==="\\"&&a+10&&a0?R=!0:C==="esac"&&$>0&&($--,R=!1),C="",D==="("?a>0&&n[a-1]==="$"?w++:R||w++:D===")"?R?R=!1:w--:D===";"&&$>0&&(a+10&&a0&&a="0"&&w<="9"){c+=E+w,a+=2,o+=2;continue}}if(E==="`"&&!h){for(c+=E,a++,o++;a=2){if(c[0]==="'"&&c[c.length-1]==="'"){let E=c.slice(1,-1);!E.includes("'")&&!E.includes('"')&&(c=E,f=!0,d=!0)}else if(c[0]==='"'&&c[c.length-1]==='"'){let E=c.slice(1,-1),w=!1;for(let S=0;S0&&Gi(c.slice(0,E)))return{type:g.ASSIGNMENT_WORD,value:c,start:t,end:a,line:s,column:r,quoted:f,singleQuoted:d}}return/^[0-9]+$/.test(c)?{type:g.NUMBER,value:c,start:t,end:a,line:s,column:r}:Yc(c)?{type:g.NAME,value:c,start:t,end:a,line:s,column:r,quoted:f,singleQuoted:d}:{type:g.WORD,value:c,start:t,end:a,line:s,column:r,quoted:f,singleQuoted:d}}readHeredocContent(){for(;this.pendingHeredocs.length>0;){let t=this.pendingHeredocs.shift();if(!t)break;let s=this.pos,r=this.line,n=this.column,i="";for(;this.posthis.maxHeredocSize)throw new At(`Heredoc size limit exceeded (${this.maxHeredocSize} bytes)`,r,n);this.pos&|()]/.test(a))break;if(a==="'"||a==='"'){i=!0;let l=a;for(this.pos++,this.column++;this.pos=this.input.length)return!1;let s=this.input[t];return!(s===" "||s===" "||s===` -`||s===";"||s==="&"||s==="|"||s==="("||s===")"||s==="<"||s===">")}readWordWithBraceExpansion(t,s,r){let n=this.input,i=n.length,a=t,l=r;for(;a")break;if(u==="{"){if(this.scanBraceExpansion(a)!==null){let f=1;for(a++,l++;a0;)n[a]==="{"?f++:n[a]==="}"&&f--,a++,l++;continue}a++,l++;continue}if(u==="}"){a++,l++;continue}if(u==="$"&&a+10&&a0&&a0;){let o=s[n];if(o==="{")i++,n++;else if(o==="}")i--,n++;else if(o===","&&i===1)a=!0,n++;else if(o==="."&&n+10;){let a=s[n];if(a==="{")i++,n++;else if(a==="}"){if(i--,i===0)return s.slice(t,n+1);n++}else{if(a===" "||a===" "||a===` -`||a===";"||a==="&"||a==="|")return null;n++}}return null}scanExtglobPattern(t){let s=this.input,r=s.length,n=t+1,i=1;for(;n0;){let a=s[n];if(a==="\\"&&n+1="a"&&c<="z"||c>="A"&&c<="Z"||c==="_"))return null}else if(!(c>="a"&&c<="z"||c>="A"&&c<="Z"||c>="0"&&c<="9"||c==="_"))break;n++}if(n===i)return null;let a=s.slice(i,n);if(n>=r||s[n]!=="}"||(n++,n>=r))return null;let l=s[n],o=n+1"||l==="<"||l==="&"&&(o===">"||o==="<")?{varname:a,end:n}:null}dollarDparenIsSubshell(t){let s=this.input,r=s.length,n=t+1,i=2,a=!1,l=!1,o=!1;for(;n0;){let u=s[n];if(a){u==="'"&&(a=!1),u===` -`&&(o=!0),n++;continue}if(l){if(u==="\\"){n+=2;continue}u==='"'&&(l=!1),u===` -`&&(o=!0),n++;continue}if(u==="'"){a=!0,n++;continue}if(u==='"'){l=!0,n++;continue}if(u==="\\"){n+=2;continue}if(u===` -`&&(o=!0),u==="("){i++,n++;continue}if(u===")"){if(i--,i===1){let c=n+1;if(c0;){let o=s[n];if(a){o==="'"&&(a=!1),n++;continue}if(l){if(o==="\\"){n+=2;continue}o==='"'&&(l=!1),n++;continue}if(o==="'"){a=!0,n++;continue}if(o==='"'){l=!0,n++;continue}if(o==="\\"){n+=2;continue}if(o==="("){i++,n++;continue}if(o===")"){if(i--,i===1){let u=n+1;if(u>=","&=","|=","^="];function us(e){if(e.includes("#")){let[s,r]=e.split("#"),n=Number.parseInt(s,10);if(n<2||n>64)return Number.NaN;if(n<=36){let a=Number.parseInt(r,n);return a>Number.MAX_SAFE_INTEGER?Number.MAX_SAFE_INTEGER:a}let i=0;for(let a of r){let l;if(/[0-9]/.test(a))l=a.charCodeAt(0)-48;else if(/[a-z]/.test(a))l=a.charCodeAt(0)-97+10;else if(/[A-Z]/.test(a))l=a.charCodeAt(0)-65+36;else if(a==="@")l=62;else if(a==="_")l=63;else return Number.NaN;if(l>=n)return Number.NaN;if(i=i*n+l,i>Number.MAX_SAFE_INTEGER)return Number.MAX_SAFE_INTEGER}return i}if(e.startsWith("0x")||e.startsWith("0X")){let s=Number.parseInt(e.slice(2),16);return s>Number.MAX_SAFE_INTEGER?Number.MAX_SAFE_INTEGER:s}if(e.startsWith("0")&&e.length>1&&/^[0-9]+$/.test(e)){if(/[89]/.test(e))return Number.NaN;let s=Number.parseInt(e,8);return s>Number.MAX_SAFE_INTEGER?Number.MAX_SAFE_INTEGER:s}let t=Number.parseInt(e,10);return t>Number.MAX_SAFE_INTEGER?Number.MAX_SAFE_INTEGER:t}function ea(e,t,s,r){if(s.slice(r,r+3)!=="$((")return null;let n=r+3,i=1,a=n;for(;n0;)s[n]==="("&&s[n+1]==="("?(i++,n+=2):s[n]===")"&&s[n+1]===")"?(i--,i>0&&(n+=2)):n++;let l=s.slice(a,n),{expr:o}=e(t,l,0);return n+=2,{expr:{type:"ArithNested",expression:o},pos:n}}function ta(e,t){if(e.slice(t,t+2)!=="$'")return null;let s=t+2,r="";for(;s=e.length}function We(e,t,s){return eu(e,t,s)}function eu(e,t,s){let{expr:r,pos:n}=fs(e,t,s);for(n=ce(t,n);t[n]===",";){if(n++,xe(t,n))return _e(",",n);let{expr:a,pos:l}=fs(e,t,n);r={type:"ArithBinary",operator:",",left:r,right:a},n=ce(t,l)}return{expr:r,pos:n}}function fs(e,t,s){let{expr:r,pos:n}=tu(e,t,s);if(n=ce(t,n),t[n]==="?"){n++;let{expr:i,pos:a}=We(e,t,n);if(n=ce(t,a),t[n]===":"){n++;let{expr:l,pos:o}=We(e,t,n);return{expr:{type:"ArithTernary",condition:r,consequent:i,alternate:l},pos:o}}}return{expr:r,pos:n}}function tu(e,t,s){let{expr:r,pos:n}=na(e,t,s);for(;n=ce(t,n),t.slice(n,n+2)==="||";){if(n+=2,xe(t,n))return _e("||",n);let{expr:a,pos:l}=na(e,t,n);r={type:"ArithBinary",operator:"||",left:r,right:a},n=l}return{expr:r,pos:n}}function na(e,t,s){let{expr:r,pos:n}=ra(e,t,s);for(;n=ce(t,n),t.slice(n,n+2)==="&&";){if(n+=2,xe(t,n))return _e("&&",n);let{expr:a,pos:l}=ra(e,t,n);r={type:"ArithBinary",operator:"&&",left:r,right:a},n=l}return{expr:r,pos:n}}function ra(e,t,s){let{expr:r,pos:n}=ia(e,t,s);for(;n=ce(t,n),t[n]==="|"&&t[n+1]!=="|";){if(n++,xe(t,n))return _e("|",n);let{expr:a,pos:l}=ia(e,t,n);r={type:"ArithBinary",operator:"|",left:r,right:a},n=l}return{expr:r,pos:n}}function ia(e,t,s){let{expr:r,pos:n}=aa(e,t,s);for(;n=ce(t,n),t[n]==="^";){if(n++,xe(t,n))return _e("^",n);let{expr:a,pos:l}=aa(e,t,n);r={type:"ArithBinary",operator:"^",left:r,right:a},n=l}return{expr:r,pos:n}}function aa(e,t,s){let{expr:r,pos:n}=oa(e,t,s);for(;n=ce(t,n),t[n]==="&"&&t[n+1]!=="&";){if(n++,xe(t,n))return _e("&",n);let{expr:a,pos:l}=oa(e,t,n);r={type:"ArithBinary",operator:"&",left:r,right:a},n=l}return{expr:r,pos:n}}function oa(e,t,s){let{expr:r,pos:n}=la(e,t,s);for(;n=ce(t,n),t.slice(n,n+2)==="=="||t.slice(n,n+2)==="!=";){let i=t.slice(n,n+2);if(n+=2,xe(t,n))return _e(i,n);let{expr:a,pos:l}=la(e,t,n);r={type:"ArithBinary",operator:i,left:r,right:a},n=l}return{expr:r,pos:n}}function la(e,t,s){let{expr:r,pos:n}=Yn(e,t,s);for(;;)if(n=ce(t,n),t.slice(n,n+2)==="<="||t.slice(n,n+2)===">="){let i=t.slice(n,n+2);if(n+=2,xe(t,n))return _e(i,n);let{expr:a,pos:l}=Yn(e,t,n);r={type:"ArithBinary",operator:i,left:r,right:a},n=l}else if(t[n]==="<"||t[n]===">"){let i=t[n];if(n++,xe(t,n))return _e(i,n);let{expr:a,pos:l}=Yn(e,t,n);r={type:"ArithBinary",operator:i,left:r,right:a},n=l}else break;return{expr:r,pos:n}}function Yn(e,t,s){let{expr:r,pos:n}=ca(e,t,s);for(;n=ce(t,n),t.slice(n,n+2)==="<<"||t.slice(n,n+2)===">>";){let i=t.slice(n,n+2);if(n+=2,xe(t,n))return _e(i,n);let{expr:a,pos:l}=ca(e,t,n);r={type:"ArithBinary",operator:i,left:r,right:a},n=l}return{expr:r,pos:n}}function ca(e,t,s){let{expr:r,pos:n}=ua(e,t,s);for(;n=ce(t,n),(t[n]==="+"||t[n]==="-")&&t[n+1]!==t[n];){let i=t[n];if(n++,xe(t,n))return _e(i,n);let{expr:a,pos:l}=ua(e,t,n);r={type:"ArithBinary",operator:i,left:r,right:a},n=l}return{expr:r,pos:n}}function ua(e,t,s){let{expr:r,pos:n}=Vs(e,t,s);for(;;)if(n=ce(t,n),t[n]==="*"&&t[n+1]!=="*"){if(n++,xe(t,n))return _e("*",n);let{expr:a,pos:l}=Vs(e,t,n);r={type:"ArithBinary",operator:"*",left:r,right:a},n=l}else if(t[n]==="/"||t[n]==="%"){let i=t[n];if(n++,xe(t,n))return _e(i,n);let{expr:a,pos:l}=Vs(e,t,n);r={type:"ArithBinary",operator:i,left:r,right:a},n=l}else break;return{expr:r,pos:n}}function Vs(e,t,s){let{expr:r,pos:n}=Jn(e,t,s),i=ce(t,n);if(t.slice(i,i+2)==="**"){if(i+=2,xe(t,i))return _e("**",i);let{expr:l,pos:o}=Vs(e,t,i);return{expr:{type:"ArithBinary",operator:"**",left:r,right:l},pos:o}}return{expr:r,pos:n}}function Jn(e,t,s){let r=ce(t,s);if(t.slice(r,r+2)==="++"||t.slice(r,r+2)==="--"){let n=t.slice(r,r+2);r+=2;let{expr:i,pos:a}=Jn(e,t,r);return{expr:{type:"ArithUnary",operator:n,operand:i,prefix:!0},pos:a}}if(t[r]==="+"||t[r]==="-"||t[r]==="!"||t[r]==="~"){let n=t[r];r++;let{expr:i,pos:a}=Jn(e,t,r);return{expr:{type:"ArithUnary",operator:n,operand:i,prefix:!0},pos:a}}return nu(e,t,r)}function su(e,t){let s=e[t];return s==="$"||s==="`"}function nu(e,t,s){let{expr:r,pos:n}=fa(e,t,s,!1),i=[r];for(;su(t,n);){let{expr:l,pos:o}=fa(e,t,n,!0);i.push(l),n=o}i.length>1&&(r={type:"ArithConcat",parts:i});let a;if(t[n]==="["&&r.type==="ArithConcat"){n++;let{expr:l,pos:o}=We(e,t,n);a=l,n=o,t[n]==="]"&&n++}if(a&&r.type==="ArithConcat"&&(r={type:"ArithDynamicElement",nameExpr:r,subscript:a},a=void 0),n=ce(t,n),r.type==="ArithConcat"||r.type==="ArithVariable"||r.type==="ArithDynamicElement"){for(let l of Fs)if(t.slice(n,n+l.length)===l&&t.slice(n,n+l.length+1)!=="=="){n+=l.length;let{expr:o,pos:u}=fs(e,t,n);return r.type==="ArithDynamicElement"?{expr:{type:"ArithDynamicAssignment",operator:l,target:r.nameExpr,subscript:r.subscript,value:o},pos:u}:r.type==="ArithConcat"?{expr:{type:"ArithDynamicAssignment",operator:l,target:r,value:o},pos:u}:{expr:{type:"ArithAssignment",operator:l,variable:r.name,value:o},pos:u}}}if(t.slice(n,n+2)==="++"||t.slice(n,n+2)==="--"){let l=t.slice(n,n+2);return n+=2,{expr:{type:"ArithUnary",operator:l,operand:r,prefix:!1},pos:n}}return{expr:r,pos:n}}function fa(e,t,s,r=!1){let n=ce(t,s),i=ea(We,e,t,n);if(i)return i;let a=ta(t,n);if(a)return a;let l=sa(t,n);if(l)return l;if(t.slice(n,n+2)==="$("&&t[n+2]!=="("){n+=2;let u=1,c=n;for(;n0;)t[n]==="("?u++:t[n]===")"&&u--,u>0&&n++;let f=t.slice(c,n);return n++,{expr:{type:"ArithCommandSubst",command:f},pos:n}}if(t[n]==="`"){n++;let u=n;for(;n0;)t[f]==="{"?c++:t[f]==="}"&&c--,c>0&&f++;let d=t.slice(u,f),h=f+1;if(t[h]==="#"){let m=h+1;for(;m=194){let n=(r&31)<<6|e[s+1]&63;t+=String.fromCharCode(n),s+=2;continue}t+=String.fromCharCode(r),s++;continue}if((r&240)===224){if(s+2=55296&&n<=57343){t+=String.fromCharCode(r),s++;continue}t+=String.fromCharCode(n),s+=3;continue}t+=String.fromCharCode(r),s++;continue}if((r&248)===240&&r<=244){if(s+31114111){t+=String.fromCharCode(r),s++;continue}t+=String.fromCodePoint(n),s+=4;continue}t+=String.fromCharCode(r),s++;continue}t+=String.fromCharCode(r),s++}return t}function pa(e,t,s){let r=s+1;for(;r0;)t[a]===r?i++:t[a]===n&&i--,i>0&&a++;return i===0?a:-1}function Ot(e,t,s){let r=s,n=1;for(;r0;){let i=t[r];if(i==="\\"&&r+10&&r++}return r}function ma(e,t,s){let r=s,n=!1;for(;r0)l.push(c),o+=2+u.length;else break}l.length>0?(r+=ru(l),n=o):(r+="\\x",n+=2);break}case"u":{let l=t.slice(n+2,n+6),o=parseInt(l,16);Number.isNaN(o)?(r+="\\u",n+=2):(r+=String.fromCharCode(o),n+=6);break}case"c":{if(n+2({type:"Word",word:I.word(r(e,c,!1,!1,!1))}))},endIndex:n+1}:i.includes(",")?{part:{type:"BraceExpansion",items:ha(i).map(c=>({type:"Word",word:I.word([I.literal(c)])}))},endIndex:n+1}:null}function sr(e,t){let s="";for(let r of t.parts)switch(r.type){case"Literal":s+=r.value;break;case"SingleQuoted":s+=`'${r.value}'`;break;case"Escaped":s+=r.value;break;case"DoubleQuoted":s+='"';for(let n of r.parts)n.type==="Literal"||n.type==="Escaped"?s+=n.value:n.type==="ParameterExpansion"&&(s+=`\${${n.parameter}}`);s+='"';break;case"ParameterExpansion":s+=`\${${r.parameter}}`;break;case"Glob":s+=r.pattern;break;case"TildeExpansion":s+="~",r.user&&(s+=r.user);break;case"BraceExpansion":{s+="{";let n=[];for(let i of r.items)if(i.type==="Range"){let a=i.startStr??String(i.start),l=i.endStr??String(i.end);i.step!==void 0?n.push(`${a}..${l}..${i.step}`):n.push(`${a}..${l}`)}else n.push(sr(e,i.word));n.length===1&&r.items[0].type==="Range"?s+=n[0]:s+=n.join(","),s+="}";break}default:s+=r.type}return s}function Ea(e,t){return{[g.LESS]:"<",[g.GREAT]:">",[g.DGREAT]:">>",[g.LESSAND]:"<&",[g.GREATAND]:">&",[g.LESSGREAT]:"<>",[g.CLOBBER]:">|",[g.TLESS]:"<<<",[g.AND_GREAT]:"&>",[g.AND_DGREAT]:"&>>",[g.DLESS]:"<",[g.DLESSDASH]:"<"}[t]||">"}function zs(e){let t=e.current(),s=t.type;if(s===g.NUMBER){let r=e.peek(1);return t.end!==r.start?!1:Yi.has(r.type)}if(s===g.FD_VARIABLE){let r=e.peek(1);return Ji.has(r.type)}return Xi.has(s)}function Bs(e){let t=null,s;e.check(g.NUMBER)?t=Number.parseInt(e.advance().value,10):e.check(g.FD_VARIABLE)&&(s=e.advance().value);let r=e.advance(),n=Ea(e,r.type);if(r.type===g.DLESS||r.type===g.DLESSDASH)return au(e,n,t,r.type===g.DLESSDASH);e.isWord()||e.error("Expected redirection target");let i=e.parseWord();return I.redirection(n,i,t,s)}function au(e,t,s,r){e.isWord()||e.error("Expected here-document delimiter");let n=e.advance(),i=n.value,a=n.quoted||!1;(i.startsWith("'")&&i.endsWith("'")||i.startsWith('"')&&i.endsWith('"'))&&(i=i.slice(1,-1));let l=I.redirection(r?"<<-":"<<",I.hereDoc(i,I.word([]),r,a),s);return e.addPendingHeredoc(l,i,r,a),l}function va(e){let t=e.current().line,s=[],r=null,n=[],i=[];for(;e.check(g.ASSIGNMENT_WORD)||zs(e);)e.checkIterationLimit(),e.check(g.ASSIGNMENT_WORD)?s.push(ou(e)):i.push(Bs(e));if(e.isWord())r=e.parseWord();else if(s.length>0&&(e.check(g.DBRACK_START)||e.check(g.DPAREN_START))){let l=e.advance();r=I.word([I.literal(l.value)])}for(;(!e.isStatementEnd()||e.check(g.RBRACE))&&!e.check(g.PIPE,g.PIPE_AMP);)if(e.checkIterationLimit(),zs(e))i.push(Bs(e));else if(e.check(g.RBRACE)){let l=e.advance();n.push(e.parseWordFromString(l.value,!1,!1))}else if(e.check(g.LBRACE)){let l=e.advance();n.push(e.parseWordFromString(l.value,!1,!1))}else if(e.check(g.DBRACK_END)){let l=e.advance();n.push(e.parseWordFromString(l.value,!1,!1))}else if(e.isWord())n.push(e.parseWord());else if(e.check(g.ASSIGNMENT_WORD)){let l=e.advance(),o=l.value,u=o.endsWith("="),c=o.endsWith("=(");if((u||c)&&(c||e.check(g.LPAREN))){let f=c?o.slice(0,-2):o.slice(0,-1);c||e.expect(g.LPAREN);let d=nr(e);e.expect(g.RPAREN);let h=d.map(p=>sr(e,p)),m=`${f}=(${h.join(" ")})`;n.push(e.parseWordFromString(m,!1,!1))}else n.push(e.parseWordFromString(o,l.quoted,l.singleQuoted))}else if(e.check(g.LPAREN))e.error("syntax error near unexpected token `('");else break;let a=I.simpleCommand(r,n,s,i);return a.line=t,a}function ou(e){let t=e.expect(g.ASSIGNMENT_WORD),s=t.value,r=s.match(/^[a-zA-Z_][a-zA-Z0-9_]*/);r||e.error(`Invalid assignment: ${s}`);let n=r[0],i,a=n.length;if(s[a]==="["){let f=0,d=a+1;for(;a2)break}else f.value==="("&&o++,f.value===")"&&o--,a[l]+=f.value}e.expect(g.DPAREN_END),a[0].trim()&&(r=Y(e,a[0].trim())),a[1].trim()&&(n=Y(e,a[1].trim())),a[2].trim()&&(i=Y(e,a[2].trim())),e.skipNewlines(),e.check(g.SEMICOLON)&&e.advance(),e.skipNewlines();let u;e.check(g.LBRACE)?(e.advance(),u=e.parseCompoundList(),e.expect(g.RBRACE)):(e.expect(g.DO),u=e.parseCompoundList(),e.expect(g.DONE));let c=t?.skipRedirections?[]:e.parseOptionalRedirections();return{type:"CStyleFor",init:r,condition:n,update:i,body:u,redirections:c,line:s}}function ar(e,t){e.expect(g.WHILE);let s=e.parseCompoundList();e.expect(g.DO);let r=e.parseCompoundList();r.length===0&&e.error("syntax error near unexpected token `done'"),e.expect(g.DONE);let n=t?.skipRedirections?[]:e.parseOptionalRedirections();return I.whileNode(s,r,n)}function or(e,t){e.expect(g.UNTIL);let s=e.parseCompoundList();e.expect(g.DO);let r=e.parseCompoundList();r.length===0&&e.error("syntax error near unexpected token `done'"),e.expect(g.DONE);let n=t?.skipRedirections?[]:e.parseOptionalRedirections();return I.untilNode(s,r,n)}function lr(e,t){e.expect(g.CASE),e.isWord()||e.error("Expected word after 'case'");let s=e.parseWord();e.skipNewlines(),e.expect(g.IN),e.skipNewlines();let r=[];for(;!e.check(g.ESAC,g.EOF);){e.checkIterationLimit();let i=e.getPos(),a=fu(e);if(a&&r.push(a),e.skipNewlines(),e.getPos()===i&&!a)break}e.expect(g.ESAC);let n=t?.skipRedirections?[]:e.parseOptionalRedirections();return I.caseNode(s,r,n)}function fu(e){e.check(g.LPAREN)&&e.advance();let t=[];for(;e.isWord()&&(t.push(e.parseWord()),e.check(g.PIPE));)e.advance();if(t.length===0)return null;e.expect(g.RPAREN),e.skipNewlines();let s=[];for(;!e.check(g.DSEMI,g.SEMI_AND,g.SEMI_SEMI_AND,g.ESAC,g.EOF);){e.checkIterationLimit(),e.isWord()&&e.peek(1).type===g.RPAREN&&e.error("syntax error near unexpected token `)'"),e.check(g.LPAREN)&&e.peek(1).type===g.WORD&&e.error(`syntax error near unexpected token \`${e.peek(1).value}'`);let n=e.getPos(),i=e.parseStatement();if(i&&s.push(i),e.skipSeparators(!1),e.getPos()===n&&!i)break}let r=";;";return e.check(g.DSEMI)?(e.advance(),r=";;"):e.check(g.SEMI_AND)?(e.advance(),r=";&"):e.check(g.SEMI_SEMI_AND)&&(e.advance(),r=";;&"),I.caseItem(t,s,r)}function cr(e,t){e.expect(g.LPAREN);let s=e.parseCompoundList();e.expect(g.RPAREN);let r=t?.skipRedirections?[]:e.parseOptionalRedirections();return I.subshell(s,r)}function ur(e,t){e.expect(g.LBRACE);let s=e.parseCompoundList();e.expect(g.RBRACE);let r=t?.skipRedirections?[]:e.parseOptionalRedirections();return I.group(s,r)}var hu=["-a","-b","-c","-d","-e","-f","-g","-h","-k","-p","-r","-s","-t","-u","-w","-x","-G","-L","-N","-O","-S","-z","-n","-o","-v","-R"],pu=["==","!=","=~","<",">","-eq","-ne","-lt","-le","-gt","-ge","-nt","-ot","-ef"];function Sa(e){return e.isWord()||e.check(g.LBRACE)||e.check(g.RBRACE)||e.check(g.ASSIGNMENT_WORD)}function Aa(e){if(e.check(g.BANG)&&e.peek(1).type===g.LPAREN){e.advance(),e.advance();let t=1,s="!(";for(;t>0&&!e.check(g.EOF);)if(e.check(g.LPAREN))t++,s+="(",e.advance();else if(e.check(g.RPAREN))t--,t>0&&(s+=")"),e.advance();else if(e.isWord())s+=e.advance().value;else if(e.check(g.PIPE))s+="|",e.advance();else break;return s+=")",e.parseWordFromString(s,!1,!1,!1,!1,!0)}return e.parseWordNoBraceExpansion()}function dr(e){return e.skipNewlines(),mu(e)}function mu(e){let t=$a(e);for(e.skipNewlines();e.check(g.OR_OR);){e.advance(),e.skipNewlines();let s=$a(e);t={type:"CondOr",left:t,right:s},e.skipNewlines()}return t}function $a(e){let t=fr(e);for(e.skipNewlines();e.check(g.AND_AND);){e.advance(),e.skipNewlines();let s=fr(e);t={type:"CondAnd",left:t,right:s},e.skipNewlines()}return t}function fr(e){return e.skipNewlines(),e.check(g.BANG)?(e.advance(),e.skipNewlines(),{type:"CondNot",operand:fr(e)}):gu(e)}function gu(e){if(e.check(g.LPAREN)){e.advance();let t=dr(e);return e.expect(g.RPAREN),{type:"CondGroup",expression:t}}if(Sa(e)){let t=e.current(),s=t.value;if(hu.includes(s)&&!t.quoted){if(e.advance(),e.check(g.DBRACK_END)&&e.error(`Expected operand after ${s}`),Sa(e)){let i=e.parseWordNoBraceExpansion();return{type:"CondUnary",operator:s,operand:i}}let n=e.current();e.error(`unexpected argument \`${n.value}' to conditional unary operator`)}let r=e.parseWordNoBraceExpansion();if(e.isWord()&&pu.includes(e.current().value)){let n=e.advance().value,i;return n==="=~"?i=yu(e):n==="=="||n==="!="?i=Aa(e):i=e.parseWordNoBraceExpansion(),{type:"CondBinary",operator:n,left:r,right:i}}if(e.check(g.LESS)){e.advance();let n=e.parseWordNoBraceExpansion();return{type:"CondBinary",operator:"<",left:r,right:n}}if(e.check(g.GREAT)){e.advance();let n=e.parseWordNoBraceExpansion();return{type:"CondBinary",operator:">",left:r,right:n}}if(e.isWord()&&e.current().value==="="){e.advance();let n=Aa(e);return{type:"CondBinary",operator:"==",left:r,right:n}}return{type:"CondWord",word:r}}e.error("Expected conditional expression")}function yu(e){let t=[],s=0,r=-1,n=e.getInput(),i=()=>e.check(g.DBRACK_END)||e.check(g.AND_AND)||e.check(g.OR_OR)||e.check(g.NEWLINE)||e.check(g.EOF);for(;!i();){let a=e.current(),l=r>=0&&a.start>r;if(s===0&&l)break;if(s>0&&l){let o=n.slice(r,a.start);t.push({type:"Literal",value:o})}if(e.isWord()||e.check(g.ASSIGNMENT_WORD)){let o=e.parseWordForRegex();t.push(...o.parts),r=e.peek(-1).end}else if(e.check(g.LPAREN)){let o=e.advance();t.push({type:"Literal",value:"("}),s++,r=o.end}else if(e.check(g.DPAREN_START)){let o=e.advance();t.push({type:"Literal",value:"(("}),s+=2,r=o.end}else if(e.check(g.DPAREN_END))if(s>=2){let o=e.advance();t.push({type:"Literal",value:"))"}),s-=2,r=o.end}else{if(s===1)break;break}else if(e.check(g.RPAREN))if(s>0){let o=e.advance();t.push({type:"Literal",value:")"}),s--,r=o.end}else break;else if(e.check(g.PIPE)){let o=e.advance();t.push({type:"Literal",value:"|"}),r=o.end}else if(e.check(g.SEMICOLON))if(s>0){let o=e.advance();t.push({type:"Literal",value:";"}),r=o.end}else break;else if(s>0&&e.check(g.LESS)){let o=e.advance();t.push({type:"Literal",value:"<"}),r=o.end}else if(s>0&&e.check(g.GREAT)){let o=e.advance();t.push({type:"Literal",value:">"}),r=o.end}else if(s>0&&e.check(g.DGREAT)){let o=e.advance();t.push({type:"Literal",value:">>"}),r=o.end}else if(s>0&&e.check(g.DLESS)){let o=e.advance();t.push({type:"Literal",value:"<<"}),r=o.end}else if(s>0&&e.check(g.LESSAND)){let o=e.advance();t.push({type:"Literal",value:"<&"}),r=o.end}else if(s>0&&e.check(g.GREATAND)){let o=e.advance();t.push({type:"Literal",value:">&"}),r=o.end}else if(s>0&&e.check(g.LESSGREAT)){let o=e.advance();t.push({type:"Literal",value:"<>"}),r=o.end}else if(s>0&&e.check(g.CLOBBER)){let o=e.advance();t.push({type:"Literal",value:">|"}),r=o.end}else if(s>0&&e.check(g.TLESS)){let o=e.advance();t.push({type:"Literal",value:"<<<"}),r=o.end}else if(s>0&&e.check(g.AMP)){let o=e.advance();t.push({type:"Literal",value:"&"}),r=o.end}else if(s>0&&e.check(g.LBRACE)){let o=e.advance();t.push({type:"Literal",value:"{"}),r=o.end}else if(s>0&&e.check(g.RBRACE)){let o=e.advance();t.push({type:"Literal",value:"}"}),r=o.end}else break}return t.length===0&&e.error("Expected regex pattern after =~"),{type:"Word",parts:t}}function ds(e){return e.length>0?e:[I.literal("")]}function Eu(e,t){let s=1,r=t+1;for(;r0;){let n=e[r];if(n==="\\"){r+=2;continue}if("@*+?!".includes(n)&&r+10;)t[d]==="{"?f++:t[d]==="}"&&f--,f>0&&d++;let h=t.slice(s+2,d);return{part:I.parameterExpansion("",{type:"BadSubstitution",text:h}),endIndex:d+1}}}if(l===""&&!i&&!a&&t[n]!=="}"){let c=1,f=n;for(;f0;)t[f]==="{"?c++:t[f]==="}"&&c--,c>0&&f++;if(c>0)throw new Ee("unexpected EOF while looking for matching '}'",0,0);let d=t.slice(s+2,f);return{part:I.parameterExpansion("",{type:"BadSubstitution",text:d}),endIndex:f+1}}let u=null;if(i){let c=l.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[([@*])\]$/);if(c)if(n=t.length)throw new Ee("unexpected EOF while looking for matching '}'",0,0);return{part:I.parameterExpansion(l,u),endIndex:n+1}}function hr(e,t,s,r,n=!1){let i=s,a=t[i],l=t[i+1]||"";if(a===":"){let o=l;if("-=?+".includes(o)){i+=2;let b=Ot(e,t,i),v=t.slice(i,b),E=$t(e,v,!1,!1,!0,!1,n,!1,!1,!0),w=I.word(ds(E));if(o==="-")return{operation:{type:"DefaultValue",word:w,checkEmpty:!0},endIndex:b};if(o==="=")return{operation:{type:"AssignDefault",word:w,checkEmpty:!0},endIndex:b};if(o==="?")return{operation:{type:"ErrorIfUnset",word:w,checkEmpty:!0},endIndex:b};if(o==="+")return{operation:{type:"UseAlternative",word:w,checkEmpty:!0},endIndex:b}}i++;let u=Ot(e,t,i),c=t.slice(i,u),f=-1,d=0,h=0;for(let y=0;y0)h--;else{f=y;break}}let m=f>=0?c.slice(0,f):c,p=f>=0?c.slice(f+1):null;return{operation:{type:"Substring",offset:tr(e,m),length:p!==null?tr(e,p):null},endIndex:u}}if("-=?+".includes(a)){i++;let o=Ot(e,t,i),u=t.slice(i,o),c=$t(e,u,!1,!1,!0,!1,n,!1,!1,!0),f=I.word(ds(c));if(a==="-")return{operation:{type:"DefaultValue",word:f,checkEmpty:!1},endIndex:o};if(a==="=")return{operation:{type:"AssignDefault",word:f,checkEmpty:!1},endIndex:o};if(a==="?")return{operation:{type:"ErrorIfUnset",word:u?f:null,checkEmpty:!1},endIndex:o};if(a==="+")return{operation:{type:"UseAlternative",word:f,checkEmpty:!1},endIndex:o}}if(a==="#"||a==="%"){let o=l===a,u=a==="#"?"prefix":"suffix";i+=o?2:1;let c=Ot(e,t,i),f=t.slice(i,c),d=$t(e,f,!1,!1,!1);return{operation:{type:"PatternRemoval",pattern:I.word(ds(d)),side:u,greedy:o},endIndex:c}}if(a==="/"){let o=l==="/";i+=o?2:1;let u=null;t[i]==="#"?(u="start",i++):t[i]==="%"&&(u="end",i++);let c;u!==null&&(t[i]==="/"||t[i]==="}")?c=i:c=ma(e,t,i);let f=t.slice(i,c),d=$t(e,f,!1,!1,!1),h=I.word(ds(d)),m=null,p=c;if(t[c]==="/"){let y=c+1,b=Ot(e,t,y),v=t.slice(y,b),E=$t(e,v,!1,!1,!1);m=I.word(ds(E)),p=b}return{operation:{type:"PatternReplacement",pattern:h,replacement:m,all:o,anchor:u},endIndex:p}}if(a==="^"||a===","){let o=l===a,u=a==="^"?"upper":"lower";i+=o?2:1;let c=Ot(e,t,i),f=t.slice(i,c),d=f?I.word([I.literal(f)]):null;return{operation:{type:"CaseModification",direction:u,all:o,pattern:d},endIndex:c}}return a==="@"&&/[QPaAEKkuUL]/.test(l)?{operation:{type:"Transform",operator:l},endIndex:i+2}:{operation:null,endIndex:i}}function pr(e,t,s,r=!1){let n=s+1;if(n>=t.length)return{part:I.literal("$"),endIndex:n};let i=t[n];if(i==="("&&t[n+1]==="(")return e.isDollarDparenSubshell(t,s)?e.parseCommandSubstitution(t,s):e.parseArithmeticExpansion(t,s);if(i==="["){let a=1,l=n+1;for(;l0;)t[l]==="["?a++:t[l]==="]"&&a--,a>0&&l++;if(a===0){let o=t.slice(n+1,l),u=Y(e,o);return{part:I.arithmeticExpansion(u),endIndex:l+1}}}return i==="("?e.parseCommandSubstitution(t,s):i==="{"?vu(e,t,s,r):/[a-zA-Z_0-9@*#?$!-]/.test(i)?bu(e,t,s):{part:I.literal("$"),endIndex:n}}function Pa(e,t){let s=[],r=0,n="",i=()=>{n&&(s.push(I.literal(n)),n="")};for(;r{i&&(r.push(I.literal(i)),i="")};for(;n=2&&t[0]==='"'&&t[t.length-1]==='"'){let m=t.slice(1,-1),p=!1;for(let y=0;y{d&&(c.push(I.literal(d)),d="")};for(;f0?t[f-1]:"";if(f===0||p==="="||n&&p===":"){let b=pa(e,t,f),v=t[b];if(v===void 0||v==="/"||v===":"){h();let E=t.slice(f+1,b)||null;c.push({type:"TildeExpansion",user:E}),f=b;continue}}}if("@*+?!".includes(m)&&f+1Ki)throw new Ee("Maximum parse iterations exceeded (possible infinite loop)",this.current().line,this.current().column)}enterDepth(){if(this.parseDepth++,this.parseDepth>Xn)throw new Ee(`Maximum parser nesting depth exceeded (${Xn})`,this.current().line,this.current().column);return()=>{this.parseDepth--}}parse(t,s){if(t.length>Qn)throw new Ee(`Input too large: ${t.length} bytes exceeds limit of ${Qn}`,1,1);this._input=t;let r=new Ws(t,s);if(this.tokens=r.tokenize(),this.tokens.length>Kn)throw new Ee(`Too many tokens: ${this.tokens.length} exceeds limit of ${Kn}`,1,1);return this.pos=0,this.pendingHeredocs=[],this.parseIterations=0,this.parseDepth=0,this.parseScript()}parseTokens(t){return this.tokens=t,this.pos=0,this.pendingHeredocs=[],this.parseIterations=0,this.parseDepth=0,this.parseScript()}current(){return this.tokens[this.pos]||this.tokens[this.tokens.length-1]}peek(t=0){return this.tokens[this.pos+t]||this.tokens[this.tokens.length-1]}advance(){let t=this.current();return this.pos0?i.includes(a):!1}expect(t,s){if(this.check(t))return this.advance();let r=this.current();throw new Ee(s||`Expected ${t}, got ${r.type}`,r.line,r.column,r)}error(t){let s=this.current();throw new Ee(t,s.line,s.column,s)}skipNewlines(){for(;this.check(g.NEWLINE,g.COMMENT);)this.check(g.NEWLINE)?(this.advance(),this.processHeredocs()):this.advance()}skipSeparators(t=!0){for(;;){if(this.check(g.NEWLINE)){this.advance(),this.processHeredocs();continue}if(this.check(g.SEMICOLON,g.COMMENT)){this.advance();continue}if(t&&this.check(g.DSEMI,g.SEMI_AND,g.SEMI_SEMI_AND)){this.advance();continue}break}}addPendingHeredoc(t,s,r,n){this.pendingHeredocs.push({redirect:t,delimiter:s,stripTabs:r,quoted:n})}processHeredocs(){for(let t of this.pendingHeredocs)if(this.check(g.HEREDOC_CONTENT)){let s=this.advance(),r;t.quoted?r=I.word([I.literal(s.value)]):r=this.parseWordFromString(s.value,!1,!1,!1,!0),t.redirect.target=I.hereDoc(t.delimiter,r,t.stripTabs,t.quoted)}this.pendingHeredocs=[]}isStatementEnd(){return this.check(g.EOF,g.NEWLINE,g.SEMICOLON,g.AMP,g.AND_AND,g.OR_OR,g.RPAREN,g.RBRACE,g.DSEMI,g.SEMI_AND,g.SEMI_SEMI_AND)}isCommandStart(){let t=this.current().type;return t===g.WORD||t===g.NAME||t===g.NUMBER||t===g.ASSIGNMENT_WORD||t===g.IF||t===g.FOR||t===g.WHILE||t===g.UNTIL||t===g.CASE||t===g.LPAREN||t===g.LBRACE||t===g.DPAREN_START||t===g.DBRACK_START||t===g.FUNCTION||t===g.BANG||t===g.TIME||t===g.IN||t===g.LESS||t===g.GREAT||t===g.DLESS||t===g.DGREAT||t===g.LESSAND||t===g.GREATAND||t===g.LESSGREAT||t===g.DLESSDASH||t===g.CLOBBER||t===g.TLESS||t===g.AND_GREAT||t===g.AND_DGREAT}parseScript(){let t=[],r=0;for(this.skipNewlines();!this.check(g.EOF);){r++,r>1e4&&this.error("Parser stuck: too many iterations (>10000)");let n=this.checkUnexpectedToken();if(n){t.push(n),this.skipSeparators(!1);continue}let i=this.pos,a=this.parseStatement();a&&t.push(a),this.skipSeparators(!1),this.check(g.DSEMI,g.SEMI_AND,g.SEMI_SEMI_AND)&&this.error(`syntax error near unexpected token \`${this.current().value}'`),this.pos===i&&!this.check(g.EOF)&&this.advance()}return I.script(t)}checkUnexpectedToken(){let t=this.current().type,s=this.current().value;if((t===g.DO||t===g.DONE||t===g.THEN||t===g.ELSE||t===g.ELIF||t===g.FI||t===g.ESAC)&&this.error(`syntax error near unexpected token \`${s}'`),t===g.RBRACE||t===g.RPAREN){let r=`syntax error near unexpected token \`${s}'`;return this.advance(),I.statement([I.pipeline([I.simpleCommand(null,[],[],[])])],[],!1,{message:r,token:s})}return(t===g.DSEMI||t===g.SEMI_AND||t===g.SEMI_SEMI_AND)&&this.error(`syntax error near unexpected token \`${s}'`),t===g.SEMICOLON&&this.error(`syntax error near unexpected token \`${s}'`),(t===g.PIPE||t===g.PIPE_AMP)&&this.error(`syntax error near unexpected token \`${s}'`),null}parseStatement(){if(this.skipNewlines(),!this.isCommandStart())return null;let t=this.current().start,s=[],r=[],n=!1,i=this.parsePipeline();for(s.push(i);this.check(g.AND_AND,g.OR_OR);){let o=this.advance();r.push(o.type===g.AND_AND?"&&":"||"),this.skipNewlines();let u=this.parsePipeline();s.push(u)}this.check(g.AMP)&&(this.advance(),n=!0);let a=this.pos>0?this.tokens[this.pos-1].end:t,l=this._input.slice(t,a);return I.statement(s,r,n,void 0,l)}parsePipeline(){let t=!1,s=!1;this.check(g.TIME)&&(this.advance(),t=!0,this.check(g.WORD,g.NAME)&&this.current().value==="-p"&&(this.advance(),s=!0));let r=0;for(;this.check(g.BANG);)this.advance(),r++;let n=r%2===1,i=[],a=[],l=this.parseCommand();for(i.push(l);this.check(g.PIPE,g.PIPE_AMP);){let o=this.advance();this.skipNewlines(),a.push(o.type===g.PIPE_AMP);let u=this.parseCommand();i.push(u)}return I.pipeline(i,n,t,s,a.length>0?a:void 0)}parseCommand(){return this.check(g.IF)?rr(this):this.check(g.FOR)?ir(this):this.check(g.WHILE)?ar(this):this.check(g.UNTIL)?or(this):this.check(g.CASE)?lr(this):this.check(g.LPAREN)?cr(this):this.check(g.LBRACE)?ur(this):this.check(g.DPAREN_START)?this.dparenClosesWithSpacedParens()?this.parseNestedSubshellsFromDparen():this.parseArithmeticCommand():this.check(g.DBRACK_START)?this.parseConditionalCommand():this.check(g.FUNCTION)?this.parseFunctionDef():this.check(g.NAME,g.WORD)&&this.peek(1).type===g.LPAREN&&this.peek(2).type===g.RPAREN?this.parseFunctionDef():va(this)}dparenClosesWithSpacedParens(){let t=1,s=1;for(;snew e,r=>this.error(r))}parseBacktickSubstitution(t,s,r=!1){return Ui(t,s,r,()=>new e,n=>this.error(n))}isDollarDparenSubshell(t,s){return qi(t,s)}parseArithmeticExpansion(t,s){let r=s+3,n=1,i=0,a=r;for(;a0;)t[a]==="$"&&t[a+1]==="("?t[a+2]==="("?(n++,a+=3):(i++,a+=2):t[a]==="("&&t[a+1]==="("?(n++,a+=2):t[a]===")"&&t[a+1]===")"?i>0?(i--,a++):(n--,n>0&&(a+=2)):t[a]==="("?(i++,a++):(t[a]===")"&&i>0&&i--,a++);let l=t.slice(r,a),o=this.parseArithmeticExpression(l);return{part:I.arithmeticExpansion(o),endIndex:a+2}}parseArithmeticCommand(){let t=this.expect(g.DPAREN_START),s="",r=1,n=0,i=!1,a=!1;for(;r>0&&!this.check(g.EOF);){if(i){if(i=!1,n>0){n--,s+=")";continue}if(this.check(g.RPAREN)){r--,a=!0,this.advance();continue}if(this.check(g.DPAREN_END)){r--,a=!0;continue}s+=")";continue}if(this.check(g.DPAREN_START))r++,s+="((",this.advance();else if(this.check(g.DPAREN_END))n>=2?(n-=2,s+="))",this.advance()):n===1?(n--,s+=")",i=!0,this.advance()):(r--,a=!0,r>0&&(s+="))"),this.advance());else if(this.check(g.LPAREN))n++,s+="(",this.advance();else if(this.check(g.RPAREN))n>0&&n--,s+=")",this.advance();else{let u=this.current().value,c=s.length>0?s[s.length-1]:"";s.length>0&&!s.endsWith(" ")&&!(u==="="&&/[|&^+\-*/%<>]$/.test(s))&&!(u==="<"&&c==="<")&&!(u===">"&&c===">")&&(s+=" "),s+=u,this.advance()}}a||this.expect(g.DPAREN_END);let l=this.parseArithmeticExpression(s.trim()),o=this.parseOptionalRedirections();return I.arithmeticCommand(l,o,t.line)}parseConditionalCommand(){let t=this.expect(g.DBRACK_START),s=dr(this);this.expect(g.DBRACK_END);let r=this.parseOptionalRedirections();return I.conditionalCommand(s,r,t.line)}parseFunctionDef(){let t;if(this.check(g.FUNCTION)){if(this.advance(),this.check(g.NAME)||this.check(g.WORD))t=this.advance().value;else{let n=this.current();throw new Ee("Expected function name",n.line,n.column,n)}this.check(g.LPAREN)&&(this.advance(),this.expect(g.RPAREN))}else t=this.advance().value,t.includes("$")&&this.error(`\`${t}': not a valid identifier`),this.expect(g.LPAREN),this.expect(g.RPAREN);this.skipNewlines();let s=this.parseCompoundCommandBody({forFunctionBody:!0}),r=this.parseOptionalRedirections();return I.functionDef(t,s,r)}parseCompoundCommandBody(t){let s=t?.forFunctionBody;if(this.check(g.LBRACE))return ur(this,{skipRedirections:s});if(this.check(g.LPAREN))return cr(this,{skipRedirections:s});if(this.check(g.IF))return rr(this,{skipRedirections:s});if(this.check(g.FOR))return ir(this,{skipRedirections:s});if(this.check(g.WHILE))return ar(this,{skipRedirections:s});if(this.check(g.UNTIL))return or(this,{skipRedirections:s});if(this.check(g.CASE))return lr(this,{skipRedirections:s});this.error("Expected compound command for function body")}parseCompoundList(){let t=this.enterDepth(),s=[];for(this.skipNewlines();!this.check(g.EOF,g.FI,g.ELSE,g.ELIF,g.THEN,g.DO,g.DONE,g.ESAC,g.RPAREN,g.RBRACE,g.DSEMI,g.SEMI_AND,g.SEMI_SEMI_AND)&&this.isCommandStart();){this.checkIterationLimit();let r=this.pos,n=this.parseStatement();if(n&&s.push(n),this.skipSeparators(),this.pos===r&&!n)break}return t(),s}parseOptionalRedirections(){let t=[];for(;zs(this);){this.checkIterationLimit();let s=this.pos;if(t.push(Bs(this)),this.pos===s)break}return t}parseArithmeticExpression(t){return Y(this,t)}};function Ce(e,t){return new q().parse(e,t)}var $u="BASH_ALIAS_";function ka(e){return e.parts.length!==1?!1:e.parts[0].type==="Literal"}function Na(e){if(e.parts.length!==1)return null;let t=e.parts[0];return t.type==="Literal"?t.value:null}function _a(e,t){return e.env.get(`${$u}${t}`)}function mr(e,t,s){if(!t.name||!ka(t.name))return t;let r=Na(t.name);if(!r)return t;let n=_a(e,r);if(!n||s.has(r))return t;try{s.add(r);let i=new q,a=n,l=n.endsWith(" ");if(!l)for(let f of t.args){let d=Ca(f);a+=` ${d}`}let o;try{o=i.parse(a)}catch(f){if(f instanceof Ee)throw f;return t}if(o.statements.length!==1||o.statements[0].pipelines.length!==1||o.statements[0].pipelines[0].commands.length!==1)return xa(t,n);let u=o.statements[0].pipelines[0].commands[0];if(u.type!=="SimpleCommand")return xa(t,n);let c={...u,assignments:[...t.assignments,...u.assignments],redirections:[...u.redirections,...t.redirections],line:t.line};if(l&&t.args.length>0&&(c={...c,args:[...c.args,...t.args]},c.args.length>0)){let f=c.args[0];if(ka(f)){let d=Na(f);if(d&&_a(e,d)){let h={type:"SimpleCommand",name:f,args:c.args.slice(1),assignments:[],redirections:[]},m=mr(e,h,s);m!==h&&(c={...c,name:m.name,args:[...m.args]})}}}return c}catch(i){throw s.delete(r),i}}function xa(e,t){let s=t;for(let a of e.args){let l=Ca(a);s+=` ${l}`}let r=new q,n=r.parseWordFromString("eval",!1,!1),i=r.parseWordFromString(`'${s.replace(/'/g,"'\\''")}'`,!1,!1);return{type:"SimpleCommand",name:n,args:[i],assignments:e.assignments,redirections:e.redirections,line:e.line}}function Ca(e){let t="";for(let s of e.parts)switch(s.type){case"Literal":t+=s.value.replace(/([\s"'$`\\*?[\]{}()<>|&;#!])/g,"\\$1");break;case"SingleQuoted":t+=`'${s.value}'`;break;case"DoubleQuoted":t+=`"${s.parts.map(r=>r.type==="Literal"?r.value:`$${r.type}`).join("")}"`;break;case"ParameterExpansion":t+=`\${${s.parameter}}`;break;case"CommandSubstitution":t+="$(...)";break;case"ArithmeticExpansion":t+=`$((${s.expression}))`;break;case"Glob":t+=s.pattern;break;default:break}return t}var Pu=new Map([["alnum","a-zA-Z0-9"],["alpha","a-zA-Z"],["ascii","\\x00-\\x7F"],["blank"," \\t"],["cntrl","\\x00-\\x1F\\x7F"],["digit","0-9"],["graph","!-~"],["lower","a-z"],["print"," -~"],["punct","!-/:-@\\[-`{-~"],["space"," \\t\\n\\r\\f\\v"],["upper","A-Z"],["word","a-zA-Z0-9_"],["xdigit","0-9a-fA-F"]]);function gr(e){return Pu.get(e)??""}function Da(e){let t=[],s="",r=0;for(;r0;){let n=e[r];if(n==="\\"){r+=2;continue}if(n==="(")s++;else if(n===")"&&(s--,s===0))return r;r++}return-1}function wr(e){let t=[],s="",r=0,n=!1,i=0;for(;ithis.maxOps)throw new X(`Glob operation limit exceeded (${this.maxOps})`,"glob_operations")}hasNullglob(){return this.nullglob}hasFailglob(){return this.failglob}filterGlobignore(t){return!this.hasGlobignore&&!this.globskipdots?t:t.filter(s=>{let r=s.split("/").pop()||s;if((this.hasGlobignore||this.globskipdots)&&(r==="."||r===".."))return!1;if(this.hasGlobignore){for(let n of this.globignorePatterns)if(this.matchGlobignorePattern(s,n))return!1}return!0})}matchGlobignorePattern(t,s){return Ra(s).test(t)}isGlobPattern(t){return!!(t.includes("*")||t.includes("?")||/\[.*\]/.test(t)||this.extglob&&/[@*+?!]\(/.test(t))}async expandArgs(t,s){let r=t.map((a,l)=>(s?.[l]??!1)||!this.isGlobPattern(a)?null:this.expand(a)),n=await Promise.all(r.map(a=>a||Promise.resolve(null))),i=[];for(let a=0;a0?i.push(...l):i.push(t[a])}return i}async expand(t){if(this.globstar){let r=t.split("/"),n=0;for(let i of r)if(i==="**"&&(n++,n>Ia))throw new X(`Glob pattern has too many ** segments (max ${Ia})`,"glob_operations")}let s;if(t.includes("**")&&this.globstar&&this.isGlobstarValid(t))s=await this.expandRecursive(t);else{let r=t.replace(/\*\*+/g,"*");s=await this.expandSimple(r)}return this.filterGlobignore(s)}isGlobstarValid(t){let s=t.split("/");for(let r of s)if(r.includes("**")&&r!=="**")return!1;return!0}hasGlobChars(t){return!!(t.includes("*")||t.includes("?")||/\[.*\]/.test(t)||this.extglob&&/[@*+?!]\(/.test(t))}async expandSimple(t){let s=t.startsWith("/"),r=t.split("/").filter(u=>u!==""),n=-1;for(let u=0;um.name==="."),h=l.some(m=>m.name==="..");d||u.push({name:".",isFile:!1,isDirectory:!0,isSymbolicLink:!1}),h||u.push({name:"..",isFile:!1,isDirectory:!0,isSymbolicLink:!1})}for(let d of u)if(!(d.name.startsWith(".")&&!n.startsWith(".")&&!c)&&this.matchPattern(d.name,n)){let h=t==="/"?`/${d.name}`:`${t}/${d.name}`,m;s===""?m=d.name:s==="/"?m=`/${d.name}`:m=`${s}/${d.name}`,i.length===0?o.push(Promise.resolve([m])):d.isDirectory&&o.push(this.expandSegments(h,m,i))}let f=await Promise.all(o);for(let d of f)a.push(...d)}else{this.checkOpsLimit();let l=await this.fs.readdir(t),o=[],u=[...l],c=this.dotglob||this.hasGlobignore;(n.startsWith(".")||this.dotglob)&&(l.includes(".")||u.push("."),l.includes("..")||u.push(".."));for(let d of u)if(!(d.startsWith(".")&&!n.startsWith(".")&&!c)&&this.matchPattern(d,n)){let h=t==="/"?`/${d}`:`${t}/${d}`,m;s===""?m=d:s==="/"?m=`/${d}`:m=`${s}/${d}`,i.length===0?o.push(Promise.resolve([m])):o.push((async()=>{try{if(this.checkOpsLimit(),(await this.fs.stat(h)).isDirectory)return this.expandSegments(h,m,i)}catch(p){if(p instanceof X)throw p}return[]})())}let f=await Promise.all(o);for(let d of f)a.push(...d)}}catch(l){if(l instanceof X)throw l}return a}async expandRecursive(t){let s=[],r=t.indexOf("**"),n=t.slice(0,r).replace(/\/$/,"")||".",a=t.slice(r+2).replace(/^\//,"");return a.includes("**")&&this.isGlobstarValid(a)?(await this.walkDirectoryMultiGlobstar(n,a,s),[...new Set(s)].sort()):(await this.walkDirectory(n,a,s),s.sort())}async walkDirectoryMultiGlobstar(t,s,r){this.checkOpsLimit();let n=this.fs.resolvePath(this.cwd,t);try{this.checkOpsLimit();let i=this.fs.readdirWithFileTypes?await this.fs.readdirWithFileTypes(n):null;if(i){let a=[];for(let u of i){let c=t==="."?u.name:`${t}/${u.name}`;u.isDirectory&&a.push(c)}let l=t==="."?s:`${t}/${s}`,o=await this.expandRecursive(l);r.push(...o);for(let u=0;uthis.walkDirectoryMultiGlobstar(f,s,r)))}}else{this.checkOpsLimit();let a=await this.fs.readdir(n),l=[];for(let c of a){let f=t==="."?c:`${t}/${c}`,d=this.fs.resolvePath(this.cwd,f);try{this.checkOpsLimit(),(await this.fs.stat(d)).isDirectory&&l.push(f)}catch(h){if(h instanceof X)throw h}}let o=t==="."?s:`${t}/${s}`,u=await this.expandRecursive(o);r.push(...u);for(let c=0;cthis.walkDirectoryMultiGlobstar(d,s,r)))}}}catch(i){if(i instanceof X)throw i}}async walkDirectory(t,s,r){this.checkOpsLimit();let n=this.fs.resolvePath(this.cwd,t);try{if(this.fs.readdirWithFileTypes){this.checkOpsLimit();let i=await this.fs.readdirWithFileTypes(n),a=[],l=[];for(let o of i){let u=t==="."?o.name:`${t}/${o.name}`;o.isDirectory?l.push(u):s&&this.matchPattern(o.name,s)&&a.push(u)}r.push(...a);for(let o=0;othis.walkDirectory(c,s,r)))}}else{this.checkOpsLimit();let i=await this.fs.readdir(n),a=[];for(let o=0;o{let d=t==="."?f:`${t}/${f}`,h=this.fs.resolvePath(this.cwd,d);try{this.checkOpsLimit();let m=await this.fs.stat(h);return{name:f,path:d,isDirectory:m.isDirectory}}catch(m){if(m instanceof X)throw m;return null}}));a.push(...c.filter(f=>f!==null))}for(let o of a)!o.isDirectory&&s&&this.matchPattern(o.name,s)&&r.push(o.path);let l=a.filter(o=>o.isDirectory);for(let o=0;othis.walkDirectory(c.path,s,r)))}}}catch(i){if(i instanceof X)throw i}}matchPattern(t,s){return this.patternToRegex(s).test(t)}patternToRegex(t){let s=this.patternToRegexStr(t);return le(`^${s}$`)}patternToRegexStr(t){let s="",r=!1;for(let n=0;nthis.patternToRegexStr(f)),c=u.length>0?u.join("|"):"(?:)";if(i==="@")s+=`(?:${c})`;else if(i==="*")s+=`(?:${c})*`;else if(i==="+")s+=`(?:${c})+`;else if(i==="?")s+=`(?:${c})?`;else if(i==="!")if(athis.computePatternLength(m));if(d.every(m=>m!==null)&&d.every(m=>m===d[0])&&d[0]!==null){let m=d[0];if(m===0)s+="(?:.+)";else{let p=[];m>0&&p.push(`.{0,${m-1}}`),p.push(`.{${m+1},}`),p.push(`(?!(?:${c})).{${m}}`),s+=`(?:${p.join("|")})`}}else s+=`(?:(?!(?:${c})).)*?`}else s+=`(?!(?:${c})$).*`;n=a;continue}}if(i==="*")s+=".*";else if(i==="?")s+=".";else if(i==="["){let a=n+1,l="[";athis.computePatternLength(c));if(u.every(c=>c!==null)&&u.every(c=>c===u[0])){s+=u[0],r=a+1;continue}return null}return null}}if(i==="*")return null;if(i==="?"){s+=1,r++;continue}if(i==="["){let a=t.indexOf("]",r+1);if(a!==-1){s+=1,r=a+1;continue}s+=1,r++;continue}if(i==="\\"){s+=1,r+=2;continue}s+=1,r++}return s}};function Er(e){for(let t=0;tn-i)}function tt(e,t){let s=`${t}_`;for(let r of e.state.env.keys())r.startsWith(s)&&e.state.env.delete(r)}function Ge(e,t){let s=`${t}_`,r=`${t}__length`,n=[];for(let i of e.state.env.keys())if(i!==r&&i.startsWith(s)){let a=i.slice(s.length);if(a.startsWith("_length"))continue;n.push(a)}return n.sort()}function qs(e){return e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}function br(e){if(e.parts.length<2)return null;let t=e.parts[0],s=e.parts[1];if(t.type!=="Glob"||!t.pattern.startsWith("["))return null;let r,n=s,i=1;if(s.type==="Literal"&&s.value.startsWith("]")){let f=s.value.slice(1);if(f.startsWith("+=")||f.startsWith("="))r=t.pattern.slice(1);else if(f===""){if(e.parts.length<3)return null;let d=e.parts[2];if(d.type!=="Literal"||!d.value.startsWith("=")&&!d.value.startsWith("+="))return null;r=t.pattern.slice(1),n=d,i=2}else return null}else if(t.pattern==="["&&(s.type==="DoubleQuoted"||s.type==="SingleQuoted")){if(e.parts.length<3)return null;let f=e.parts[2];if(f.type!=="Literal"||!f.value.startsWith("]=")&&!f.value.startsWith("]+="))return null;if(s.type==="SingleQuoted")r=s.value;else{r="";for(let d of s.parts)(d.type==="Literal"||d.type==="Escaped")&&(r+=d.value)}n=f,i=2}else if(t.pattern.endsWith("]")){if(s.type!=="Literal"||!s.value.startsWith("=")&&!s.value.startsWith("+="))return null;r=t.pattern.slice(1,-1)}else return null;r=qs(r);let a;if(n.type!=="Literal")return null;n.value.startsWith("]=")||n.value.startsWith("]+=")?a=n.value.slice(1):a=n.value;let l=a.startsWith("+=");if(!l&&!a.startsWith("="))return null;let o=[],u=l?2:1,c=a.slice(u);c&&o.push({type:"Literal",value:c});for(let f=i+1;f{if(s.type==="Range"){let r=s.startStr??String(s.start),n=s.endStr??String(s.end),i=`${r}..${n}`;return s.step&&(i+=`..${s.step}`),i}return Ut(s.word)}).join(",")}}`}function Ut(e){let t="";for(let s of e.parts)switch(s.type){case"Literal":t+=s.value;break;case"Glob":t+=s.pattern;break;case"SingleQuoted":t+=s.value;break;case"DoubleQuoted":for(let r of s.parts)(r.type==="Literal"||r.type==="Escaped")&&(t+=r.value);break;case"Escaped":t+=s.value;break;case"BraceExpansion":t+="{",t+=s.items.map(r=>r.type==="Range"?`${r.startStr}..${r.endStr}${r.step?`..${r.step}`:""}`:Ut(r.word)).join(","),t+="}";break;case"TildeExpansion":t+="~",s.user&&(t+=s.user);break}return t}function me(e){return e.get("IFS")??` -`}function ve(e){return e.get("IFS")===""}function js(e){let t=me(e);if(t==="")return!0;for(let s of t)if(s!==" "&&s!==" "&&s!==` -`)return!1;return!0}function Ta(e){let t=!1,s=[];for(let r of e.split(""))r==="-"?t=!0:/[\\^$.*+?()[\]{}|]/.test(r)?s.push(`\\${r}`):r===" "?s.push("\\t"):r===` -`?s.push("\\n"):s.push(r);return t&&s.push("\\-"),s.join("")}function j(e){let t=e.get("IFS");return t===void 0?" ":t[0]||""}var _u=` -`;function xu(e){return _u.includes(e)}function vr(e){let t=new Set,s=new Set;for(let r of e)xu(r)?t.add(r):s.add(r);return{whitespace:t,nonWhitespace:s}}function Sr(e,t,s,r){if(t==="")return e===""?{words:[],wordStarts:[]}:{words:[e],wordStarts:[0]};let{whitespace:n,nonWhitespace:i}=vr(t),a=[],l=[],o=0;for(;o=e.length)return{words:[],wordStarts:[]};if(i.has(e[o]))for(a.push(""),l.push(o),o++;o=s);){let u=o;for(l.push(u);o=e.length)break;for(;o=s);)for(a.push(""),l.push(o),o++;oo&&(a=!0),i>=e.length)return{words:[],hadLeadingDelimiter:!0,hadTrailingDelimiter:!0};if(r.has(e[i]))for(n.push(""),i++;i=e.length){l=!1;break}let c=i;for(;i=e.length&&i>c&&(l=!0)}return{words:n,hadLeadingDelimiter:a,hadTrailingDelimiter:l}}function re(e,t){return Us(e,t).words}function Cu(e,t){for(let s of e)if(t.has(s))return!0;return!1}function La(e,t,s){if(t==="")return e;let{whitespace:r,nonWhitespace:n}=vr(t),i=e.length;for(;i>0&&r.has(e[i-1]);){if(!s&&i>=2){let l=0,o=i-2;for(;o>=0&&e[o]==="\\";)l++,o--;if(l%2===1)break}i--}let a=e.substring(0,i);if(a.length>=1&&n.has(a[a.length-1])){if(!s&&a.length>=2){let o=0,u=a.length-2;for(;u>=0&&a[u]==="\\";)o++,u--;if(o%2===1)return a}let l=a.substring(0,a.length-1);if(!Cu(l,n))return l}return a}function te(e,t){return e.state.namerefs?.has(t)??!1}function pt(e,t){e.state.namerefs??=new Set,e.state.namerefs.add(t)}function Ma(e,t){e.state.namerefs?.delete(t),e.state.boundNamerefs?.delete(t),e.state.invalidNamerefs?.delete(t)}function Wa(e,t){e.state.invalidNamerefs??=new Set,e.state.invalidNamerefs.add(t)}function Fa(e,t){return e.state.invalidNamerefs?.has(t)??!1}function Ar(e,t){e.state.boundNamerefs??=new Set,e.state.boundNamerefs.add(t)}function Zs(e,t){let s=t.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(.+)\]$/);if(s){let n=s[1],i=Array.from(e.state.env.keys()).some(l=>l.startsWith(`${n}_`)&&!l.includes("__")),a=e.state.associativeArrays?.has(n)??!1;return i||a}return Array.from(e.state.env.keys()).some(n=>n.startsWith(`${t}_`)&&!n.includes("__"))?!0:e.state.env.has(t)}function $e(e,t,s=100){if(!te(e,t)||Fa(e,t))return t;let r=new Set,n=t;for(;s-- >0;){if(r.has(n))return;if(r.add(n),!te(e,n))return n;let i=e.state.env.get(n);if(i===void 0||i===""||!/^[a-zA-Z_][a-zA-Z0-9_]*(\[.+\])?$/.test(i))return n;n=i}}function Tt(e,t){if(te(e,t))return e.state.env.get(t)}function Va(e,t,s,r=100){if(!te(e,t)||Fa(e,t))return t;let n=new Set,i=t;for(;r-- >0;){if(n.has(i))return;if(n.add(i),!te(e,i))return i;let a=e.state.env.get(i);if(a===void 0||a==="")return s!==void 0?/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(s)&&Zs(e,s)?i:null:i;if(!/^[a-zA-Z_][a-zA-Z0-9_]*(\[.+\])?$/.test(a))return i;i=a}}function Du(e,t){let s=t.replace(/\$\{([a-zA-Z_][a-zA-Z0-9_]*)\}/g,(r,n)=>e.state.env.get(n)??"");return s=s.replace(/\$([a-zA-Z_][a-zA-Z0-9_]*)/g,(r,n)=>e.state.env.get(n)??""),s}function B(e,t){return t==="FUNCNAME"?(e.state.funcNameStack??[]).map((i,a)=>[a,i]):t==="BASH_LINENO"?(e.state.callLineStack??[]).map((i,a)=>[a,String(i)]):t==="BASH_SOURCE"?(e.state.sourceStack??[]).map((i,a)=>[a,i]):e.state.associativeArrays?.has(t)?Ge(e,t).map(i=>[i,e.state.env.get(`${t}_${i}`)??""]):he(e,t).map(n=>[n,e.state.env.get(`${t}_${n}`)??""])}function He(e,t){return t==="FUNCNAME"?(e.state.funcNameStack?.length??0)>0:t==="BASH_LINENO"?(e.state.callLineStack?.length??0)>0:t==="BASH_SOURCE"?(e.state.sourceStack?.length??0)>0:e.state.associativeArrays?.has(t)?Ge(e,t).length>0:he(e,t).length>0}async function J(e,t,s=!0,r=!1){switch(t){case"?":return String(e.state.lastExitCode);case"$":return String(e.state.virtualPid);case"#":return e.state.env.get("#")||"0";case"@":return e.state.env.get("@")||"";case"_":return e.state.lastArg;case"-":{let a="";return a+="h",e.state.options.errexit&&(a+="e"),e.state.options.noglob&&(a+="f"),e.state.options.nounset&&(a+="u"),e.state.options.verbose&&(a+="v"),e.state.options.xtrace&&(a+="x"),a+="B",e.state.options.noclobber&&(a+="C"),a+="s",a}case"*":{let a=Number.parseInt(e.state.env.get("#")||"0",10);if(a===0)return"";let l=[];for(let o=1;o<=a;o++)l.push(e.state.env.get(String(o))||"");return l.join(j(e.state.env))}case"0":return e.state.env.get("0")||"bash";case"PWD":return e.state.env.get("PWD")??"";case"OLDPWD":return e.state.env.get("OLDPWD")??"";case"PPID":return String(e.state.virtualPpid);case"UID":return String(e.state.virtualUid);case"EUID":return String(e.state.virtualUid);case"RANDOM":return String(Math.floor(Math.random()*32768));case"SECONDS":return String(Math.floor((Date.now()-e.state.startTime)/1e3));case"BASH_VERSION":return Vi;case"!":return String(e.state.lastBackgroundPid);case"BASHPID":return String(e.state.bashPid);case"LINENO":return String(e.state.currentLine);case"FUNCNAME":{let a=e.state.funcNameStack?.[0];if(a!==void 0)return a;if(s&&e.state.options.nounset)throw new Le("FUNCNAME");return""}case"BASH_LINENO":{let a=e.state.callLineStack?.[0];if(a!==void 0)return String(a);if(s&&e.state.options.nounset)throw new Le("BASH_LINENO");return""}case"BASH_SOURCE":{let a=e.state.sourceStack?.[0];if(a!==void 0)return a;if(s&&e.state.options.nounset)throw new Le("BASH_SOURCE");return""}}if(/^[a-zA-Z_][a-zA-Z0-9_]*\[\]$/.test(t))throw new Me(`\${${t}}`);let n=t.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(.+)\]$/);if(n){let a=n[1],l=n[2];if(te(e,a)){let f=$e(e,a);if(f&&f!==a){if(f.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(.+)\]$/))return"";a=f}}if(l==="@"||l==="*"){let f=B(e,a);if(f.length>0)return f.map(([,h])=>h).join(" ");let d=e.state.env.get(a);return d!==void 0?d:""}if(a==="FUNCNAME"){let f=Number.parseInt(l,10);return!Number.isNaN(f)&&f>=0?e.state.funcNameStack?.[f]??"":""}if(a==="BASH_LINENO"){let f=Number.parseInt(l,10);if(!Number.isNaN(f)&&f>=0){let d=e.state.callLineStack?.[f];return d!==void 0?String(d):""}return""}if(a==="BASH_SOURCE"){let f=Number.parseInt(l,10);return!Number.isNaN(f)&&f>=0?e.state.sourceStack?.[f]??"":""}if(e.state.associativeArrays?.has(a)){let f=qs(l);f=Du(e,f);let d=e.state.env.get(`${a}_${f}`);if(d===void 0&&s&&e.state.options.nounset)throw new Le(`${a}[${l}]`);return d||""}let u;if(/^-?\d+$/.test(l))u=Number.parseInt(l,10);else try{let f=new q,d=Y(f,l);u=await T(e,d.expression)}catch{let f=e.state.env.get(l);u=f?Number.parseInt(f,10):0,Number.isNaN(u)&&(u=0)}if(u<0){let f=B(e,a),d=e.state.currentLine;if(f.length===0)return e.state.expansionStderr=(e.state.expansionStderr||"")+`bash: line ${d}: ${a}: bad array subscript -`,"";let m=Math.max(...f.map(([y])=>typeof y=="number"?y:0))+1+u;return m<0?(e.state.expansionStderr=(e.state.expansionStderr||"")+`bash: line ${d}: ${a}: bad array subscript -`,""):e.state.env.get(`${a}_${m}`)||""}let c=e.state.env.get(`${a}_${u}`);if(c!==void 0)return c;if(u===0){let f=e.state.env.get(a);if(f!==void 0)return f}if(s&&e.state.options.nounset)throw new Le(`${a}[${u}]`);return""}if(/^[1-9][0-9]*$/.test(t)){let a=e.state.env.get(t);if(a===void 0&&s&&e.state.options.nounset)throw new Le(t);return a||""}if(te(e,t)){let a=$e(e,t);if(a===void 0)return"";if(a!==t)return await J(e,a,s,r);let l=e.state.env.get(t);if((l===void 0||l==="")&&s&&e.state.options.nounset)throw new Le(t);return l||""}let i=e.state.env.get(t);if(i!==void 0)return e.state.tempEnvBindings?.some(a=>a.has(t))&&(e.state.accessedTempEnvVars=e.state.accessedTempEnvVars||new Set,e.state.accessedTempEnvVars.add(t)),i;if(He(e,t)){let a=e.state.env.get(`${t}_0`);return a!==void 0?a:""}if(s&&e.state.options.nounset)throw new Le(t);return""}async function st(e,t){if(new Set(["?","$","#","_","-","0","PPID","UID","EUID","RANDOM","SECONDS","BASH_VERSION","!","BASHPID","LINENO"]).has(t))return!0;if(t==="@"||t==="*")return Number.parseInt(e.state.env.get("#")||"0",10)>0;if(t==="PWD"||t==="OLDPWD")return e.state.env.has(t);let r=t.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(.+)\]$/);if(r){let n=r[1],i=r[2];if(te(e,n)){let o=$e(e,n);if(o&&o!==n){if(o.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(.+)\]$/))return!1;n=o}}if(i==="@"||i==="*")return B(e,n).length>0?!0:e.state.env.has(n);if(e.state.associativeArrays?.has(n)){let o=qs(i);return e.state.env.has(`${n}_${o}`)}let l;if(/^-?\d+$/.test(i))l=Number.parseInt(i,10);else try{let o=new q,u=Y(o,i);l=await T(e,u.expression)}catch{let o=e.state.env.get(i);l=o?Number.parseInt(o,10):0,Number.isNaN(l)&&(l=0)}if(l<0){let o=B(e,n);if(o.length===0)return!1;let c=Math.max(...o.map(([f])=>typeof f=="number"?f:0))+1+l;return c<0?!1:e.state.env.has(`${n}_${c}`)}return e.state.env.has(`${n}_${l}`)}if(te(e,t)){let n=$e(e,t);return n===void 0||n===t?e.state.env.has(t):st(e,n)}return!!(e.state.env.has(t)||He(e,t))}async function za(e,t){let s="",r=0;for(;r0;)t[i]==="{"?n++:t[i]==="}"&&n--,i++;s+=t.slice(r,i),r=i;continue}if(t[r+1]==="("){let n=1,i=r+2;for(;i0;)t[i]==="("?n++:t[i]===")"&&n--,i++;s+=t.slice(r,i),r=i;continue}if(/[a-zA-Z_]/.test(t[r+1]||"")){let n=r+1;for(;n0;)s[o]==="("&&s[o-1]==="$"||s[o]==="("?l++:s[o]===")"&&l--,o++;let u=s.slice(a+2,o-1);if(e.execFn){let c=await e.execFn(u,{signal:e.state.signal});i+=c.stdout.replace(/\n+$/,""),c.stderr&&(e.state.expansionStderr=(e.state.expansionStderr||"")+c.stderr)}a=o}else if(s[a+1]==="{"){let l=1,o=a+2;for(;o0;)s[o]==="{"?l++:s[o]==="}"&&l--,o++;let u=s.slice(a+2,o-1),c=await J(e,u);i+=c,a=o}else if(/[a-zA-Z_]/.test(s[a+1]||"")){let l=a+1;for(;l{if(o>0){let f=c<0,d=String(Math.abs(c)).padStart(o,"0");return f?`-${d}`:d}return String(c)};if(e<=t)for(let c=e,f=0;c<=t&&f=t&&f="A"&&e<="Z",o=e>="a"&&e<="z",u=t>="A"&&t<="Z",c=t>="a"&&t<="z";if(l&&c||o&&u){let d=s!==void 0?`..${s}`:"";throw new Ds(`{${e}..${t}${d}}: invalid sequence`)}let f=[];if(n<=i)for(let d=n,h=0;d<=i&&h=i&&hG(f,t,s)),c=u.length>0?u.join("|"):"(?:)";i==="@"?r+=`(?:${c})`:i==="*"?r+=`(?:${c})*`:i==="+"?r+=`(?:${c})+`:i==="?"?r+=`(?:${c})?`:i==="!"&&(r+=`(?!(?:${c})$).*`),n=a+1;continue}}if(i==="\\")if(n+10;){let n=e[r];if(n==="\\"){r+=2;continue}if(n==="(")s++;else if(n===")"&&(s--,s===0))return r;r++}return-1}function Tu(e){let t=[],s="",r=0,n=0;for(;n0&&s=0;i--){let a=e.slice(i);if(n.test(a))return e.slice(0,i)}return e}function Zt(e,t){let s=Array.from(e.state.env.keys()),r=new Set,n=e.state.associativeArrays??new Set,i=new Set;for(let l of s){let o=l.match(/^([a-zA-Z_][a-zA-Z0-9_]*)_\d+$/);o&&i.add(o[1]);let u=l.match(/^([a-zA-Z_][a-zA-Z0-9_]*)__length$/);u&&i.add(u[1])}let a=l=>{for(let o of n){let u=`${o}_`;if(l.startsWith(u)&&l!==o)return!0}return!1};for(let l of s)if(l.startsWith(t))if(l.includes("__")){let o=l.match(/^([a-zA-Z_][a-zA-Z0-9_]*)__length$/);o?.[1].startsWith(t)&&r.add(o[1])}else if(/_\d+$/.test(l)){let o=l.match(/^([a-zA-Z_][a-zA-Z0-9_]*)_\d+$/);o?.[1].startsWith(t)&&r.add(o[1])}else a(l)||r.add(l);return[...r].sort()}function Vu(e,t){let s=(i,a=2)=>String(i).padStart(a,"0");if(e===""){let i=s(t.getHours()),a=s(t.getMinutes()),l=s(t.getSeconds());return`${i}:${a}:${l}`}let r="",n=0;for(;n=e.length){r+="%",n++;continue}let i=e[n+1];switch(i){case"H":r+=s(t.getHours());break;case"M":r+=s(t.getMinutes());break;case"S":r+=s(t.getSeconds());break;case"d":r+=s(t.getDate());break;case"m":r+=s(t.getMonth()+1);break;case"Y":r+=t.getFullYear();break;case"y":r+=s(t.getFullYear()%100);break;case"I":{let a=t.getHours()%12;a===0&&(a=12),r+=s(a);break}case"p":r+=t.getHours()<12?"AM":"PM";break;case"P":r+=t.getHours()<12?"am":"pm";break;case"%":r+="%";break;case"a":{r+=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"][t.getDay()];break}case"b":{r+=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][t.getMonth()];break}default:r+=`%${i}`}n+=2}else r+=e[n],n++;return r}function ms(e,t){let s="",r=0,n=e.state.env.get("USER")||e.state.env.get("LOGNAME")||"user",i=e.state.env.get("HOSTNAME")||"localhost",a=i.split(".")[0],l=e.state.env.get("PWD")||"/",o=e.state.env.get("HOME")||"/",u=l.startsWith(o)?`~${l.slice(o.length)}`:l,c=l.split("/").pop()||l,f=new Date,d=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],h=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],m=e.state.env.get("__COMMAND_NUMBER")||"1";for(;r=t.length){s+="\\",r++;continue}let y=t[r+1];if(y>="0"&&y<="7"){let b="",v=r+1;for(;v="0"&&t[v]<="7";)b+=t[v],v++;let E=Number.parseInt(b,8)%256;s+=String.fromCharCode(E),r=v;continue}switch(y){case"\\":s+="\\",r+=2;break;case"a":s+="\x07",r+=2;break;case"e":s+="\x1B",r+=2;break;case"n":s+=` -`,r+=2;break;case"r":s+="\r",r+=2;break;case"$":s+="$",r+=2;break;case"[":case"]":r+=2;break;case"u":s+=n,r+=2;break;case"h":s+=a,r+=2;break;case"H":s+=i,r+=2;break;case"w":s+=u,r+=2;break;case"W":s+=c,r+=2;break;case"d":{let b=String(f.getDate()).padStart(2," ");s+=`${d[f.getDay()]} ${h[f.getMonth()]} ${b}`,r+=2;break}case"t":{let b=String(f.getHours()).padStart(2,"0"),v=String(f.getMinutes()).padStart(2,"0"),E=String(f.getSeconds()).padStart(2,"0");s+=`${b}:${v}:${E}`,r+=2;break}case"T":{let b=f.getHours()%12;b===0&&(b=12);let v=String(b).padStart(2,"0"),E=String(f.getMinutes()).padStart(2,"0"),w=String(f.getSeconds()).padStart(2,"0");s+=`${v}:${E}:${w}`,r+=2;break}case"@":{let b=f.getHours()%12;b===0&&(b=12);let v=String(b).padStart(2,"0"),E=String(f.getMinutes()).padStart(2,"0"),w=f.getHours()<12?"AM":"PM";s+=`${v}:${E} ${w}`,r+=2;break}case"A":{let b=String(f.getHours()).padStart(2,"0"),v=String(f.getMinutes()).padStart(2,"0");s+=`${b}:${v}`,r+=2;break}case"D":if(r+20&&e.state.localScopes[e.state.localScopes.length-1].has(t)&&!s){for(e.state.localExportedVars||(e.state.localExportedVars=[]);e.state.localExportedVars.lengthi.startsWith(`${t}_`)&&/^[0-9]+$/.test(i.slice(t.length+1))),n=e.state.associativeArrays?.has(t)??!1;return r&&!n&&(s+="a"),n&&(s+="A"),e.state.integerVars?.has(t)&&(s+="i"),te(e,t)&&(s+="n"),rt(e,t)&&(s+="r"),e.state.exportedVars?.has(t)&&(s+="x"),s}async function qa(e,t,s,r){return e.coverage?.hit("bash:expansion:default_value"),(s.isUnset||t.checkEmpty&&s.isEmpty)&&t.word?r(e,t.word.parts,s.inDoubleQuotes):s.effectiveValue}async function ja(e,t,s,r,n){if(e.coverage?.hit("bash:expansion:assign_default"),(r.isUnset||s.checkEmpty&&r.isEmpty)&&s.word){let a=await n(e,s.word.parts,r.inDoubleQuotes),l=t.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(.+)\]$/);if(l){let[,o,u]=l,c;if(/^\d+$/.test(u))c=Number.parseInt(u,10);else{try{let d=new q,h=Y(d,u);c=await T(e,h.expression)}catch{let d=e.state.env.get(u);c=d?Number.parseInt(d,10):0}Number.isNaN(c)&&(c=0)}e.state.env.set(`${o}_${c}`,a);let f=Number.parseInt(e.state.env.get(`${o}__length`)||"0",10);c>=f&&e.state.env.set(`${o}__length`,String(c+1))}else e.state.env.set(t,a);return a}return r.effectiveValue}async function Ua(e,t,s,r,n){if(e.coverage?.hit("bash:expansion:error_if_unset"),r.isUnset||s.checkEmpty&&r.isEmpty){let a=s.word?await n(e,s.word.parts,r.inDoubleQuotes):`${t}: parameter null or not set`;throw new Z(1,"",`bash: ${a} -`)}return r.effectiveValue}async function Za(e,t,s,r){return e.coverage?.hit("bash:expansion:use_alternative"),!(s.isUnset||t.checkEmpty&&s.isEmpty)&&t.word?r(e,t.word.parts,s.inDoubleQuotes):""}async function Ga(e,t,s,r,n){e.coverage?.hit("bash:expansion:pattern_removal");let i="",a=e.state.shoptOptions.extglob;if(s.pattern)for(let o of s.pattern.parts)if(o.type==="Glob")i+=G(o.pattern,s.greedy,a);else if(o.type==="Literal")i+=G(o.value,s.greedy,a);else if(o.type==="SingleQuoted"||o.type==="Escaped")i+=Q(o.value);else if(o.type==="DoubleQuoted"){let u=await r(e,o.parts);i+=Q(u)}else if(o.type==="ParameterExpansion"){let u=await n(e,o);i+=G(u,s.greedy,a)}else{let u=await n(e,o);i+=Q(u)}if(s.side==="prefix")return le(`^${i}`,"s").replace(t,"");let l=le(`${i}$`,"s");if(s.greedy)return l.replace(t,"");for(let o=t.length;o>=0;o--){let u=t.slice(o);if(l.test(u))return t.slice(0,o)}return t}async function Ha(e,t,s,r,n){e.coverage?.hit("bash:expansion:pattern_replacement");let i="",a=e.state.shoptOptions.extglob;if(s.pattern)for(let u of s.pattern.parts)if(u.type==="Glob")i+=G(u.pattern,!0,a);else if(u.type==="Literal")i+=G(u.value,!0,a);else if(u.type==="SingleQuoted"||u.type==="Escaped")i+=Q(u.value);else if(u.type==="DoubleQuoted"){let c=await r(e,u.parts);i+=Q(c)}else if(u.type==="ParameterExpansion"){let c=await n(e,u);i+=G(c,!0,a)}else{let c=await n(e,u);i+=Q(c)}let l=s.replacement?await r(e,s.replacement.parts):"";if(s.anchor==="start"?i=`^${i}`:s.anchor==="end"&&(i=`${i}$`),i==="")return t;let o=s.all?"gs":"s";try{let u=le(i,o);if(s.all){let c="",f=0,d=0,h=e.limits.maxStringLength,m=u.exec(t);for(;m!==null&&!(m[0].length===0&&m.index===t.length);){if(c+=t.slice(f,m.index)+l,f=m.index+m[0].length,m[0].length===0&&f++,d++,d%100===0&&c.length>h)throw new X(`pattern replacement: string length limit exceeded (${h} bytes)`,"string_length");m=u.exec(t)}return c+=t.slice(f),c}return u.replace(t,l)}catch(u){if(u instanceof X)throw u;return t}}function Qa(e,t,s){e.coverage?.hit("bash:expansion:length");let r=t.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[[@*]\]$/);if(r){let n=r[1],i=B(e,n);return i.length>0?String(i.length):e.state.env.get(n)!==void 0?"1":"0"}if(/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(t)&&He(e,t)){if(t==="FUNCNAME"){let i=e.state.funcNameStack?.[0]||"";return String([...i].length)}if(t==="BASH_LINENO"){let i=e.state.callLineStack?.[0];return String(i!==void 0?[...String(i)].length:0)}let n=e.state.env.get(`${t}_0`)||"";return String([...n].length)}return String([...s].length)}async function Ka(e,t,s,r){e.coverage?.hit("bash:expansion:substring");let n=await T(e,r.offset.expression),i=r.length?await T(e,r.length.expression):void 0;if(t==="@"||t==="*"){let u=Number.parseInt(e.state.env.get("#")||"0",10),c=[];for(let m=1;m<=u;m++)c.push(e.state.env.get(String(m))||"");let f=e.state.env.get("0")||"bash",d,h;if(n<=0)if(d=[f,...c],n<0){if(h=d.length+n,h<0)return""}else h=0;else d=c,h=n-1;if(h<0||h>=d.length)return"";if(i!==void 0){let m=i<0?d.length+i:h+i;return d.slice(h,Math.max(h,m)).join(" ")}return d.slice(h).join(" ")}let a=t.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[[@*]\]$/);if(a){let u=a[1];if(e.state.associativeArrays?.has(u))throw new Z(1,"",`bash: \${${u}[@]: 0: 3}: bad substitution -`);let c=B(e,u),f=0;if(n<0){if(c.length>0){let d=c[c.length-1][0],m=(typeof d=="number"?d:0)+1+n;if(m<0||(f=c.findIndex(([p])=>typeof p=="number"&&p>=m),f<0))return""}}else if(f=c.findIndex(([d])=>typeof d=="number"&&d>=n),f<0)return"";if(i!==void 0){if(i<0)throw new se(`${a[1]}[@]: substring expression < 0`);return c.slice(f,f+i).map(([,d])=>d).join(" ")}return c.slice(f).map(([,d])=>d).join(" ")}let l=[...s],o=n;if(o<0&&(o=Math.max(0,l.length+o)),i!==void 0){if(i<0){let u=l.length+i;return l.slice(o,Math.max(o,u)).join("")}return l.slice(o,o+i).join("")}return l.slice(o).join("")}async function Xa(e,t,s,r,n){if(e.coverage?.hit("bash:expansion:case_modification"),s.pattern){let i=e.state.shoptOptions.extglob,a="";for(let f of s.pattern.parts)if(f.type==="Glob")a+=G(f.pattern,!0,i);else if(f.type==="Literal")a+=G(f.value,!0,i);else if(f.type==="SingleQuoted"||f.type==="Escaped")a+=Q(f.value);else if(f.type==="DoubleQuoted"){let d=await r(e,f.parts);a+=Q(d)}else if(f.type==="ParameterExpansion"){let d=await n(e,f);a+=G(d,!0,i)}let l=le(`^(?:${a})$`),o=s.direction==="upper"?f=>f.toUpperCase():f=>f.toLowerCase(),u="",c=!1;for(let f of t)!s.all&&c?u+=f:l.test(f)?(u+=o(f),c=!0):u+=f;return u}return s.direction==="upper"?s.all?t.toUpperCase():t.charAt(0).toUpperCase()+t.slice(1):s.all?t.toLowerCase():t.charAt(0).toLowerCase()+t.slice(1)}function Ya(e,t,s,r,n){e.coverage?.hit("bash:expansion:transform");let i=t.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[[@*]\]$/);if(i&&n.operator==="Q")return B(e,i[1]).map(([,u])=>kt(u)).join(" ");if(i&&n.operator==="a")return Nt(e,i[1]);let a=t.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[.+\]$/);if(a&&n.operator==="a")return Nt(e,a[1]);switch(n.operator){case"Q":return r?"":kt(s);case"P":return ms(e,s);case"a":return Nt(e,t);case"A":return r?"":`${t}=${kt(s)}`;case"E":return s.replace(/\\([\\abefnrtv'"?])/g,(l,o)=>{switch(o){case"\\":return"\\";case"a":return"\x07";case"b":return"\b";case"e":return"\x1B";case"f":return"\f";case"n":return` -`;case"r":return"\r";case"t":return" ";case"v":return"\v";case"'":return"'";case'"':return'"';case"?":return"?";default:return o}});case"K":case"k":return r?"":kt(s);case"u":return s.charAt(0).toUpperCase()+s.slice(1);case"U":return s.toUpperCase();case"L":return s.toLowerCase();default:return s}}async function Ja(e,t,s,r,n,i,a=!1){if(e.coverage?.hit("bash:expansion:indirection"),te(e,t))return Tt(e,t)||"";let l=/^[a-zA-Z_][a-zA-Z0-9_]*\[([@*])\]$/.test(t);if(r){if(n.innerOp?.type==="UseAlternative")return"";throw new Me(`\${!${t}}`)}let o=s;if(l&&(o===""||o.includes(" ")))throw new Me(`\${!${t}}`);let u=o.match(/^[a-zA-Z_][a-zA-Z0-9_]*\[(.+)\]$/);if(u&&u[1].includes("~"))throw new Me(`\${!${t}}`);if(n.innerOp){let c={type:"ParameterExpansion",parameter:o,operation:n.innerOp};return i(e,c,a)}return await J(e,o)}function eo(e,t){e.coverage?.hit("bash:expansion:array_keys");let r=B(e,t.array).map(([n])=>String(n));return t.star?r.join(j(e.state.env)):r.join(" ")}function to(e,t){e.coverage?.hit("bash:expansion:var_name_prefix");let s=Zt(e,t.prefix);return t.star?s.join(j(e.state.env)):s.join(" ")}function so(e,t,s,r){let n=Number.parseInt(e.state.env.get("#")||"0",10),i=t.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[([@*])\]$/);if(t==="*")return{isEmpty:n===0,effectiveValue:s};if(t==="@")return{isEmpty:n===0||n===1&&e.state.env.get("1")==="",effectiveValue:s};if(i){let[,a,l]=i,o=B(e,a);if(o.length===0)return{isEmpty:!0,effectiveValue:""};if(l==="*"){let u=j(e.state.env),c=o.map(([,f])=>f).join(u);return{isEmpty:r?c==="":!1,effectiveValue:c}}return{isEmpty:o.length===1&&o.every(([,u])=>u===""),effectiveValue:o.map(([,u])=>u).join(" ")}}return{isEmpty:s==="",effectiveValue:s}}function no(e){let t=0;for(;t0;){let a=e[r];if(a==="\\"&&!n&&r+1y);if(c.length===0){let y=e.state.env.get(l);y!==void 0&&f.push(y)}if(f.length===0)return{values:[],quoted:!0};let d="";u.pattern&&(d=await qu(e,u.pattern,s,r));let h=u.replacement?await s(e,u.replacement.parts):"",m=d;u.anchor==="start"?m=`^${d}`:u.anchor==="end"&&(m=`${d}$`);let p=[];try{let y=le(m,u.all?"g":"");for(let b of f)p.push(y.replace(b,h))}catch{p.push(...f)}if(o){let y=j(e.state.env);return{values:[p.join(y)],quoted:!0}}return{values:p,quoted:!0}}async function lo(e,t,s,r){if(t.length!==1||t[0].type!=="DoubleQuoted")return null;let n=t[0];if(n.parts.length!==1||n.parts[0].type!=="ParameterExpansion"||n.parts[0].operation?.type!=="PatternRemoval")return null;let i=n.parts[0],a=i.parameter.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[([@*])\]$/);if(!a)return null;let l=a[1],o=a[2]==="*",u=i.operation,c=B(e,l),f=c.map(([,p])=>p);if(c.length===0){let p=e.state.env.get(l);p!==void 0&&f.push(p)}if(f.length===0)return{values:[],quoted:!0};let d="",h=e.state.shoptOptions.extglob;if(u.pattern)for(let p of u.pattern.parts)if(p.type==="Glob")d+=G(p.pattern,u.greedy,h);else if(p.type==="Literal")d+=G(p.value,u.greedy,h);else if(p.type==="SingleQuoted"||p.type==="Escaped")d+=Q(p.value);else if(p.type==="DoubleQuoted"){let y=await s(e,p.parts);d+=Q(y)}else if(p.type==="ParameterExpansion"){let y=await r(e,p);d+=G(y,u.greedy,h)}else{let y=await r(e,p);d+=Q(y)}let m=[];for(let p of f)m.push(mt(p,d,u.side,u.greedy));if(o){let p=j(e.state.env);return{values:[m.join(p)],quoted:!0}}return{values:m,quoted:!0}}async function co(e,t){if(t.length!==1||t[0].type!=="DoubleQuoted")return null;let s=t[0];if(s.parts.length!==1||s.parts[0].type!=="ParameterExpansion"||s.parts[0].operation?.type!=="DefaultValue"&&s.parts[0].operation?.type!=="UseAlternative"&&s.parts[0].operation?.type!=="AssignDefault")return null;let r=s.parts[0],n=r.operation,i=r.parameter.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[([@*])\]$/),a,l=!1;if(i){let o=i[1];l=i[2]==="*";let u=B(e,o),c=u.length>0||e.state.env.has(o),f=u.length===0||u.length===1&&u.every(([,h])=>h===""),d=n.checkEmpty??!1;if(n.type==="UseAlternative"?a=c&&!(d&&f):a=!c||d&&f,!a){if(u.length>0){let m=u.map(([,p])=>p);if(l){let p=j(e.state.env);return{values:[m.join(p)],quoted:!0}}return{values:m,quoted:!0}}let h=e.state.env.get(o);return h!==void 0?{values:[h],quoted:!0}:{values:[],quoted:!0}}}else{let o=r.parameter,u=await st(e,o),c=await J(e,o),f=c==="",d=n.checkEmpty??!1;if(n.type==="UseAlternative"?a=u&&!(d&&f):a=!u||d&&f,!a)return{values:[c],quoted:!0}}if(a&&n.word){let o=n.word.parts,u=null,c=!1;for(let f of o)if(f.type==="ParameterExpansion"&&!f.operation){let d=f.parameter.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[([@*])\]$/);if(d){u=d[1],c=d[2]==="*";break}}if(u){let f=B(e,u);if(f.length>0){let h=f.map(([,m])=>m);if(c||l){let m=j(e.state.env);return{values:[h.join(m)],quoted:!0}}return{values:h,quoted:!0}}let d=e.state.env.get(u);return d!==void 0?{values:[d],quoted:!0}:{values:[],quoted:!0}}}return null}async function uo(e,t,s,r,n){if(!s||t.length!==1||t[0].type!=="DoubleQuoted")return null;let i=t[0],a=-1,l="",o=!1,u=null;for(let p=0;pp);if(d.length===0){let p=e.state.env.get(l);if(p!==void 0)h=[p];else{if(o)return{values:[c+f],quoted:!0};let y=c+f;return{values:y?[y]:[],quoted:!0}}}if(u?.type==="PatternRemoval"){let p=u,y="",b=e.state.shoptOptions.extglob;if(p.pattern)for(let v of p.pattern.parts)if(v.type==="Glob")y+=G(v.pattern,p.greedy,b);else if(v.type==="Literal")y+=G(v.value,p.greedy,b);else if(v.type==="SingleQuoted"||v.type==="Escaped")y+=Q(v.value);else if(v.type==="DoubleQuoted"){let E=await n(e,v.parts);y+=Q(E)}else if(v.type==="ParameterExpansion"){let E=await r(e,v);y+=G(E,p.greedy,b)}else{let E=await r(e,v);y+=Q(E)}h=h.map(v=>mt(v,y,p.side,p.greedy))}else if(u?.type==="PatternReplacement"){let p=u,y="";if(p.pattern)for(let E of p.pattern.parts)if(E.type==="Glob")y+=G(E.pattern,!0,e.state.shoptOptions.extglob);else if(E.type==="Literal")y+=G(E.value,!0,e.state.shoptOptions.extglob);else if(E.type==="SingleQuoted"||E.type==="Escaped")y+=Q(E.value);else if(E.type==="DoubleQuoted"){let w=await n(e,E.parts);y+=Q(w)}else if(E.type==="ParameterExpansion"){let w=await r(e,E);y+=G(w,!0,e.state.shoptOptions.extglob)}else{let w=await r(e,E);y+=Q(w)}let b=p.replacement?await n(e,p.replacement.parts):"",v=y;p.anchor==="start"?v=`^${y}`:p.anchor==="end"&&(v=`${y}$`);try{let E=le(v,p.all?"g":"");h=h.map(w=>E.replace(w,b))}catch{}}if(o){let p=j(e.state.env);return{values:[c+h.join(p)+f],quoted:!0}}return h.length===1?{values:[c+h[0]+f],quoted:!0}:{values:[c+h[0],...h.slice(1,-1),h[h.length-1]+f],quoted:!0}}async function fo(e,t,s,r){if(!s||t.length!==1||t[0].type!=="DoubleQuoted")return null;let n=t[0],i=-1,a="",l=!1;for(let h=0;hh);if(c.length===0){let h=e.state.env.get(a);if(h!==void 0)return{values:[o+h+u],quoted:!0};if(l)return{values:[o+u],quoted:!0};let m=o+u;return{values:m?[m]:[],quoted:!0}}if(l){let h=j(e.state.env);return{values:[o+f.join(h)+u],quoted:!0}}return f.length===1?{values:[o+f[0]+u],quoted:!0}:{values:[o+f[0],...f.slice(1,-1),f[f.length-1]+u],quoted:!0}}async function ho(e,t,s){if(t.length!==1||t[0].type!=="DoubleQuoted")return null;let r=t[0];if(r.parts.length!==1||r.parts[0].type!=="ParameterExpansion"||r.parts[0].operation?.type!=="Substring")return null;let n=r.parts[0],i=n.parameter.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[([@*])\]$/);if(!i)return null;let a=i[1],l=i[2]==="*",o=n.operation;if(e.state.associativeArrays?.has(a))throw new Z(1,"",`bash: \${${a}[@]: 0: 3}: bad substitution -`);let u=o.offset?await s(e,o.offset.expression):0,c=o.length?await s(e,o.length.expression):void 0,f=B(e,a),d=0;if(u<0){if(f.length>0){let m=f[f.length-1][0],y=(typeof m=="number"?m:0)+1+u;if(y<0)return{values:[],quoted:!0};d=f.findIndex(([b])=>typeof b=="number"&&b>=y),d<0&&(d=f.length)}}else d=f.findIndex(([m])=>typeof m=="number"&&m>=u),d<0&&(d=f.length);let h;if(c!==void 0){if(c<0)throw new se(`${a}[@]: substring expression < 0`);h=f.slice(d,d+c).map(([,m])=>m)}else h=f.slice(d).map(([,m])=>m);if(h.length===0)return{values:[],quoted:!0};if(l){let m=j(e.state.env);return{values:[h.join(m)],quoted:!0}}return{values:h,quoted:!0}}function po(e,t){if(t.length!==1||t[0].type!=="DoubleQuoted")return null;let s=t[0];if(s.parts.length!==1||s.parts[0].type!=="ParameterExpansion"||s.parts[0].operation?.type!=="Transform")return null;let r=s.parts[0],n=r.parameter.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[([@*])\]$/);if(!n)return null;let i=n[1],a=n[2]==="*",l=r.operation,o=B(e,i);if(o.length===0){let f=e.state.env.get(i);if(f!==void 0){let d;switch(l.operator){case"a":d="";break;case"P":d=ms(e,f);break;case"Q":d=kt(f);break;default:d=f}return{values:[d],quoted:!0}}return a?{values:[""],quoted:!0}:{values:[],quoted:!0}}let u=Nt(e,i),c;switch(l.operator){case"a":c=o.map(()=>u);break;case"P":c=o.map(([,f])=>ms(e,f));break;case"Q":c=o.map(([,f])=>kt(f));break;case"u":c=o.map(([,f])=>f.charAt(0).toUpperCase()+f.slice(1));break;case"U":c=o.map(([,f])=>f.toUpperCase());break;case"L":c=o.map(([,f])=>f.toLowerCase());break;default:c=o.map(([,f])=>f)}if(a){let f=j(e.state.env);return{values:[c.join(f)],quoted:!0}}return{values:c,quoted:!0}}function mo(e,t){if(t.length!==1||t[0].type!=="DoubleQuoted")return null;let s=t[0];if(s.parts.length!==1||s.parts[0].type!=="ParameterExpansion")return null;let r=s.parts[0];if(r.operation)return null;let n=r.parameter.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(@)\]$/);if(!n)return null;let i=n[1];if(te(e,i)){let o=Tt(e,i);if(o?.endsWith("[@]")||o?.endsWith("[*]"))return{values:[],quoted:!0}}let a=B(e,i);if(a.length>0)return{values:a.map(([,o])=>o),quoted:!0};let l=e.state.env.get(i);return l!==void 0?{values:[l],quoted:!0}:{values:[],quoted:!0}}function go(e,t){if(t.length!==1||t[0].type!=="DoubleQuoted")return null;let s=t[0];if(s.parts.length!==1||s.parts[0].type!=="ParameterExpansion"||s.parts[0].operation)return null;let n=s.parts[0].parameter;if(!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(n)||!te(e,n))return null;let i=Tt(e,n);if(!i)return null;let a=i.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(@)\]$/);if(!a)return null;let l=a[1],o=B(e,l);if(o.length>0)return{values:o.map(([,c])=>c),quoted:!0};let u=e.state.env.get(l);return u!==void 0?{values:[u],quoted:!0}:{values:[],quoted:!0}}async function yo(e,t,s,r,n){if(!s||t.length!==1||t[0].type!=="DoubleQuoted")return null;let i=t[0];if(i.parts.length!==1||i.parts[0].type!=="ParameterExpansion"||i.parts[0].operation?.type!=="Indirection")return null;let a=i.parts[0],l=a.operation,o=await J(e,a.parameter),u=o.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[([@*])\]$/);if(!u){if(!l.innerOp&&(o==="@"||o==="*")){let m=Number.parseInt(e.state.env.get("#")||"0",10),p=[];for(let y=1;y<=m;y++)p.push(e.state.env.get(String(y))||"");return o==="*"?{values:[p.join(j(e.state.env))],quoted:!0}:{values:p,quoted:!0}}return null}let c=u[1],f=u[2]==="*",d=B(e,c);if(l.innerOp){if(l.innerOp.type==="Substring")return ju(e,d,c,f,l.innerOp);if(l.innerOp.type==="DefaultValue"||l.innerOp.type==="UseAlternative"||l.innerOp.type==="AssignDefault"||l.innerOp.type==="ErrorIfUnset")return Uu(e,d,c,f,l.innerOp,n);if(l.innerOp.type==="Transform"&&l.innerOp.operator==="a"){let p=Nt(e,c),y=d.map(()=>p);return f?{values:[y.join(j(e.state.env))],quoted:!0}:{values:y,quoted:!0}}let m=[];for(let[,p]of d){let y={type:"ParameterExpansion",parameter:"_indirect_elem_",operation:l.innerOp},b=e.state.env.get("_indirect_elem_");e.state.env.set("_indirect_elem_",p);try{let v=await r(e,y,!0);m.push(v)}finally{b!==void 0?e.state.env.set("_indirect_elem_",b):e.state.env.delete("_indirect_elem_")}}return f?{values:[m.join(j(e.state.env))],quoted:!0}:{values:m,quoted:!0}}if(d.length>0){let m=d.map(([,p])=>p);return f?{values:[m.join(j(e.state.env))],quoted:!0}:{values:m,quoted:!0}}let h=e.state.env.get(c);return h!==void 0?{values:[h],quoted:!0}:{values:[],quoted:!0}}async function ju(e,t,s,r,n){let i=n.offset?await T(e,n.offset.expression):0,a=n.length?await T(e,n.length.expression):void 0,l=0;if(i<0){if(t.length>0){let c=t[t.length-1][0],d=(typeof c=="number"?c:0)+1+i;if(d<0)return{values:[],quoted:!0};if(l=t.findIndex(([h])=>typeof h=="number"&&h>=d),l<0)return{values:[],quoted:!0}}}else if(l=t.findIndex(([c])=>typeof c=="number"&&c>=i),l<0)return{values:[],quoted:!0};let o;if(a!==void 0){if(a<0)throw new se(`${s}[@]: substring expression < 0`);o=t.slice(l,l+a)}else o=t.slice(l);let u=o.map(([,c])=>c);return r?{values:[u.join(j(e.state.env))],quoted:!0}:{values:u,quoted:!0}}async function Uu(e,t,s,r,n,i){let a=n.checkEmpty??!1,l=t.map(([,c])=>c),o=t.length===0,u=t.length===0;if(n.type==="UseAlternative")return!u&&!(a&&o)&&n.word?{values:[await i(e,n.word.parts,!0)],quoted:!0}:{values:[],quoted:!0};if(n.type==="DefaultValue")return(u||a&&o)&&n.word?{values:[await i(e,n.word.parts,!0)],quoted:!0}:r?{values:[l.join(j(e.state.env))],quoted:!0}:{values:l,quoted:!0};if(n.type==="AssignDefault"){if((u||a&&o)&&n.word){let f=await i(e,n.word.parts,!0);return e.state.env.set(`${s}_0`,f),e.state.env.set(`${s}__length`,"1"),{values:[f],quoted:!0}}return r?{values:[l.join(j(e.state.env))],quoted:!0}:{values:l,quoted:!0}}return r?{values:[l.join(j(e.state.env))],quoted:!0}:{values:l,quoted:!0}}async function wo(e,t){if(t.length!==1||t[0].type!=="ParameterExpansion"||t[0].operation?.type!=="UseAlternative"&&t[0].operation?.type!=="DefaultValue")return null;let s=t[0],r=s.operation,n=r?.word;if(!n||n.parts.length!==1||n.parts[0].type!=="DoubleQuoted")return null;let i=n.parts[0];if(i.parts.length!==1||i.parts[0].type!=="ParameterExpansion"||i.parts[0].operation?.type!=="Indirection")return null;let a=i.parts[0],o=(await J(e,a.parameter)).match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[([@*])\]$/);if(!o)return null;let u=await st(e,s.parameter),c=await J(e,s.parameter)==="",f=r.checkEmpty??!1,d;if(r.type==="UseAlternative"?d=u&&!(f&&c):d=!u||f&&c,d){let h=o[1],m=o[2]==="*",p=B(e,h);if(p.length>0){let b=p.map(([,v])=>v);return m?{values:[b.join(j(e.state.env))],quoted:!0}:{values:b,quoted:!0}}let y=e.state.env.get(h);return y!==void 0?{values:[y],quoted:!0}:{values:[],quoted:!0}}return{values:[],quoted:!1}}async function Eo(e,t){if(t.length!==1||t[0].type!=="ParameterExpansion"||t[0].operation?.type!=="Indirection")return null;let s=t[0],n=s.operation.innerOp;if(!n||n.type!=="UseAlternative"&&n.type!=="DefaultValue")return null;let i=n.word;if(!i||i.parts.length!==1||i.parts[0].type!=="DoubleQuoted")return null;let a=i.parts[0];if(a.parts.length!==1||a.parts[0].type!=="ParameterExpansion"||a.parts[0].operation?.type!=="Indirection")return null;let l=a.parts[0],u=(await J(e,l.parameter)).match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[([@*])\]$/);if(!u)return null;let c=await J(e,s.parameter),f=await st(e,s.parameter),d=c==="",h=n.checkEmpty??!1,m;if(n.type==="UseAlternative"?m=f&&!(h&&d):m=!f||h&&d,m){let p=u[1],y=u[2]==="*",b=B(e,p);if(b.length>0){let E=b.map(([,w])=>w);return y?{values:[E.join(j(e.state.env))],quoted:!0}:{values:E,quoted:!0}}let v=e.state.env.get(p);return v!==void 0?{values:[v],quoted:!0}:{values:[],quoted:!0}}return{values:[],quoted:!1}}function bo(e){let t=Number.parseInt(e.state.env.get("#")||"0",10),s=[];for(let r=1;r<=t;r++)s.push(e.state.env.get(String(r))||"");return s}async function vo(e,t,s,r){if(t.length!==1||t[0].type!=="DoubleQuoted")return null;let n=t[0],i=-1,a=!1;for(let v=0;v=d.length)m=[];else if(c!==void 0){let E=c<0?d.length+c:v+c;m=d.slice(v,Math.max(v,E))}else m=d.slice(v)}let p="";for(let v=0;v0)r.push(...i);else{if(s.hasFailglob())throw new wt(n);s.hasNullglob()||r.push(n)}}else r.push(n);return r}async function Po(e,t,s,r){let n=-1,i="",a=!1;for(let v=0;vv);if(u.length===0){let v=e.state.env.get(i);v!==void 0&&(c=[v])}if(c.length===0)return{values:[],quoted:!1};let f="";if(o.pattern)for(let v of o.pattern.parts)if(v.type==="Glob")f+=G(v.pattern,!0,e.state.shoptOptions.extglob);else if(v.type==="Literal")f+=G(v.value,!0,e.state.shoptOptions.extglob);else if(v.type==="SingleQuoted"||v.type==="Escaped")f+=Q(v.value);else if(v.type==="DoubleQuoted"){let E=await s(e,v.parts);f+=Q(E)}else if(v.type==="ParameterExpansion"){let E=await r(e,v);f+=G(E,!0,e.state.shoptOptions.extglob)}else{let E=await r(e,v);f+=Q(E)}let d=o.replacement?await s(e,o.replacement.parts):"",h=f;o.anchor==="start"?h=`^${f}`:o.anchor==="end"&&(h=`${f}$`);let m=[];try{let v=le(h,o.all?"g":"");for(let E of c)m.push(v.replace(E,d))}catch{m.push(...c)}let p=me(e.state.env),y=ve(e.state.env);if(a){let v=j(e.state.env),E=m.join(v);return y?{values:E?[E]:[],quoted:!1}:{values:re(E,p),quoted:!1}}if(y)return{values:m,quoted:!1};let b=[];for(let v of m)v===""?b.push(""):b.push(...re(v,p));return{values:b,quoted:!1}}async function ko(e,t,s,r){let n=-1,i="",a=!1;for(let b=0;bb);if(u.length===0){let b=e.state.env.get(i);b!==void 0&&(c=[b])}if(c.length===0)return{values:[],quoted:!1};let f="",d=e.state.shoptOptions.extglob;if(o.pattern)for(let b of o.pattern.parts)if(b.type==="Glob")f+=G(b.pattern,o.greedy,d);else if(b.type==="Literal")f+=G(b.value,o.greedy,d);else if(b.type==="SingleQuoted"||b.type==="Escaped")f+=Q(b.value);else if(b.type==="DoubleQuoted"){let v=await s(e,b.parts);f+=Q(v)}else if(b.type==="ParameterExpansion"){let v=await r(e,b);f+=G(v,o.greedy,d)}else{let v=await r(e,b);f+=Q(v)}let h=[];for(let b of c)h.push(mt(b,f,o.side,o.greedy));let m=me(e.state.env),p=ve(e.state.env);if(a){let b=j(e.state.env),v=h.join(b);return p?{values:v?[v]:[],quoted:!1}:{values:re(v,m),quoted:!1}}if(p)return{values:h,quoted:!1};let y=[];for(let b of h)b===""?y.push(""):y.push(...re(b,m));return{values:y,quoted:!1}}async function No(e,t,s,r){let n=-1,i=!1;for(let y=0;y=f.length)h=[];else if(u!==void 0){let w=u<0?f.length+u:E+u;h=f.slice(E,Math.max(E,w))}else h=f.slice(E)}let m="";for(let E=0;Eu!=="");else{let u=j(e.state.env),c=n.join(u);o=re(c,i)}else if(a)o=n.filter(u=>u!=="");else if(l){o=[];for(let u of n){if(u==="")continue;let c=re(u,i);o.push(...c)}}else{o=[];for(let u of n)if(u==="")o.push("");else{let c=re(u,i);o.push(...c)}for(;o.length>0&&o[o.length-1]==="";)o.pop()}return{values:await Ks(e,o),quoted:!1}}async function Co(e,t){if(t.length!==1||t[0].type!=="ParameterExpansion"||t[0].operation)return null;let s=t[0].parameter.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[([@*])\]$/);if(!s)return null;let r=s[1],n=s[2]==="*",i=B(e,r),a;if(i.length===0){let f=e.state.env.get(r);if(f!==void 0)a=[f];else return{values:[],quoted:!1}}else a=i.map(([,f])=>f);let l=me(e.state.env),o=ve(e.state.env),u=js(e.state.env),c;if(n)if(o)c=a.filter(f=>f!=="");else{let f=j(e.state.env),d=a.join(f);c=re(d,l)}else if(o)c=a.filter(f=>f!=="");else if(u){c=[];for(let f of a){if(f==="")continue;let d=re(f,l);c.push(...d)}}else{c=[];for(let f of a)if(f==="")c.push("");else{let d=re(f,l);c.push(...d)}for(;c.length>0&&c[c.length-1]==="";)c.pop()}return{values:await Ks(e,c),quoted:!1}}function Do(e,t){if(t.length!==1||t[0].type!=="ParameterExpansion"||t[0].operation?.type!=="VarNamePrefix")return null;let s=t[0].operation,r=Zt(e,s.prefix);if(r.length===0)return{values:[],quoted:!1};let n=me(e.state.env),i=ve(e.state.env),a;if(s.star)if(i)a=r;else{let l=j(e.state.env),o=r.join(l);a=re(o,n)}else if(i)a=r;else{a=[];for(let l of r){let o=re(l,n);a.push(...o)}}return{values:a,quoted:!1}}function Ro(e,t){if(t.length!==1||t[0].type!=="ParameterExpansion"||t[0].operation?.type!=="ArrayKeys")return null;let s=t[0].operation,n=B(e,s.array).map(([o])=>String(o));if(n.length===0)return{values:[],quoted:!1};let i=me(e.state.env),a=ve(e.state.env),l;if(s.star)if(a)l=n;else{let o=j(e.state.env),u=n.join(o);l=re(u,i)}else if(a)l=n;else{l=[];for(let o of n){let u=re(o,i);l.push(...u)}}return{values:l,quoted:!1}}async function Io(e,t,s){let r=-1;for(let d=0;dh!=="");else if(c){f=[];for(let h of d){if(h==="")continue;let m=re(h,o);f.push(...m)}}else{f=[];for(let h of d)if(h==="")f.push("");else{let m=re(h,o);f.push(...m)}for(;f.length>0&&f[f.length-1]==="";)f.pop()}}return f.length===0?{values:[],quoted:!1}:{values:await Ks(e,f),quoted:!1}}async function Lo(e,t,s){e.coverage?.hit("bash:expansion:word_glob");let r=t.parts,{hasQuoted:n,hasCommandSub:i,hasArrayVar:a,hasArrayAtExpansion:l,hasParamExpansion:o,hasVarNamePrefixExpansion:u,hasIndirection:c}=hs(r),d=s.hasBraceExpansion(r)?await s.expandWordWithBracesAsync(e,t):null;if(d&&d.length>1)return Gu(e,d,n);let h=await Hu(e,r,l,u,c,s);if(h!==null)return h;let m=await Ku(e,r,s);if(m!==null)return m;let p=await Xu(e,r,s);if(p!==null)return p;let y=await Ju(e,r,s.expandPart);if(y!==null)return To(e,y);if((i||a||o)&&!ve(e.state.env)){let v=me(e.state.env),E=s.buildIfsCharClassPattern(v),w=await s.smartWordSplit(e,r,v,E,s.expandPart);return To(e,w)}let b=await s.expandWordAsync(e,t);return ef(e,t,r,b,n,s.expandWordForGlobbing)}async function Gu(e,t,s){let r=[];for(let n of t)if(!(!s&&n===""))if(!s&&!e.state.options.noglob&&nt(n,e.state.shoptOptions.extglob)){let i=await Xs(e,n);r.push(...i)}else r.push(n);return{values:r,quoted:!1}}async function Hu(e,t,s,r,n,i){if(s){let a=mo(e,t);if(a!==null)return a}{let a=go(e,t);if(a!==null)return a}{let a=await co(e,t);if(a!==null)return a}{let a=await uo(e,t,s,i.expandPart,i.expandWordPartsAsync);if(a!==null)return a}{let a=await fo(e,t,s,i.expandPart);if(a!==null)return a}{let a=await ho(e,t,i.evaluateArithmetic);if(a!==null)return a}{let a=po(e,t);if(a!==null)return a}{let a=await oo(e,t,i.expandWordPartsAsync,i.expandPart);if(a!==null)return a}{let a=await lo(e,t,i.expandWordPartsAsync,i.expandPart);if(a!==null)return a}if(r&&t.length===1&&t[0].type==="DoubleQuoted"){let a=Qu(e,t);if(a!==null)return a}{let a=await yo(e,t,n,i.expandParameterAsync,i.expandWordPartsAsync);if(a!==null)return a}{let a=await wo(e,t);if(a!==null)return a}{let a=await Eo(e,t);if(a!==null)return a}return null}function Qu(e,t){let s=t[0];if(s.type!=="DoubleQuoted")return null;if(s.parts.length===1&&s.parts[0].type==="ParameterExpansion"&&s.parts[0].operation?.type==="VarNamePrefix"){let r=s.parts[0].operation,n=Zt(e,r.prefix);return r.star?{values:[n.join(j(e.state.env))],quoted:!0}:{values:n,quoted:!0}}if(s.parts.length===1&&s.parts[0].type==="ParameterExpansion"&&s.parts[0].operation?.type==="ArrayKeys"){let r=s.parts[0].operation,i=B(e,r.array).map(([a])=>String(a));return r.star?{values:[i.join(j(e.state.env))],quoted:!0}:{values:i,quoted:!0}}return null}async function Ku(e,t,s){{let r=await vo(e,t,s.evaluateArithmetic,s.expandPart);if(r!==null)return r}{let r=await So(e,t,s.expandPart,s.expandWordPartsAsync);if(r!==null)return r}{let r=await Ao(e,t,s.expandPart,s.expandWordPartsAsync);if(r!==null)return r}{let r=await $o(e,t,s.expandPart);if(r!==null)return r}return null}async function Xu(e,t,s){{let r=await Po(e,t,s.expandWordPartsAsync,s.expandPart);if(r!==null)return r}{let r=await ko(e,t,s.expandWordPartsAsync,s.expandPart);if(r!==null)return r}{let r=await No(e,t,s.expandWordPartsAsync,s.expandPart);if(r!==null)return r}{let r=await _o(e,t,s.evaluateArithmetic,s.expandPart);if(r!==null)return r}{let r=await xo(e,t);if(r!==null)return r}{let r=await Co(e,t);if(r!==null)return r}{let r=Do(e,t);if(r!==null)return r}{let r=Ro(e,t);if(r!==null)return r}{let r=await Io(e,t,s.expandPart);if(r!==null)return r}return null}function Oo(e){if(e.type!=="DoubleQuoted")return null;for(let t=0;to),a.length===0){let o=e.state.env.get(s.name);o!==void 0&&(a=[o])}}else{let l=Number.parseInt(e.state.env.get("#")||"0",10);a=[];for(let o=1;o<=l;o++)a.push(e.state.env.get(String(o))||"")}if(s.isStar){let l=j(e.state.env),o=a.join(l);return[n+o+i]}if(a.length===0){let l=n+i;return l?[l]:[]}return a.length===1?[n+a[0]+i]:[n+a[0],...a.slice(1,-1),a[a.length-1]+i]}async function Ju(e,t,s){if(t.length<2)return null;let r=!1;for(let o of t)if(Oo(o)){r=!0;break}if(!r)return null;let n=me(e.state.env),i=ve(e.state.env),a=[];for(let o of t){let u=Oo(o);if(u&&o.type==="DoubleQuoted"){let c=await Yu(e,o,u,s);a.push(c)}else if(o.type==="DoubleQuoted"||o.type==="SingleQuoted"){let c=await s(e,o);a.push([c])}else if(o.type==="Literal")a.push([o.value]);else if(o.type==="ParameterExpansion"){let c=await s(e,o);if(i)a.push(c?[c]:[]);else{let f=re(c,n);a.push(f)}}else{let c=await s(e,o);if(i)a.push(c?[c]:[]);else{let f=re(c,n);a.push(f)}}}let l=[];for(let o of a)if(o.length!==0)if(l.length===0)l.push(...o);else{let u=l.length-1;l[u]=l[u]+o[0];for(let c=1;c0)return r;if(s.hasFailglob())throw new wt(t);return s.hasNullglob()?[]:[t]}async function ef(e,t,s,r,n,i){let a=s.some(l=>l.type==="Glob");if(!e.state.options.noglob&&a){let l=await i(e,t);if(nt(l,e.state.shoptOptions.extglob)){let u=await Xs(e,l);if(u.length>0&&u[0]!==l)return{values:u,quoted:!1};if(u.length===0)return{values:[],quoted:!1}}let o=kr(r);if(!ve(e.state.env)){let u=me(e.state.env);return{values:re(o,u),quoted:!1}}return{values:[o],quoted:!1}}if(!n&&!e.state.options.noglob&&nt(r,e.state.shoptOptions.extglob)){let l=await i(e,t);if(nt(l,e.state.shoptOptions.extglob)){let o=await Xs(e,l);if(o.length>0&&o[0]!==l)return{values:o,quoted:!1}}}if(r===""&&!n)return{values:[],quoted:!1};if(a&&!n){let l=kr(r);if(!ve(e.state.env)){let o=me(e.state.env);return{values:re(l,o),quoted:!1}}return{values:[l],quoted:!1}}return{values:[r],quoted:n}}async function Wo(e,t){let s=t.operation;if(!s||s.type!=="DefaultValue"&&s.type!=="AssignDefault"&&s.type!=="UseAlternative")return null;let r=s.word;if(!r||r.parts.length===0)return null;let n=await st(e,t.parameter),a=await J(e,t.parameter,!1)==="",l=s.checkEmpty??!1,o;return s.type==="UseAlternative"?o=n&&!(l&&a):o=!n||l&&a,o?r.parts:null}function tf(e){return e.type==="SingleQuoted"?!0:e.type==="DoubleQuoted"?e.parts.every(s=>s.type==="Literal"):!1}async function sf(e,t){if(t.type!=="ParameterExpansion")return null;let s=await Wo(e,t);if(!s||s.length<=1)return null;let r=s.some(i=>tf(i)),n=s.some(i=>i.type==="Literal"||i.type==="ParameterExpansion"||i.type==="CommandSubstitution"||i.type==="ArithmeticExpansion");return r&&n?s:null}function nf(e){return e.type==="DoubleQuoted"||e.type==="SingleQuoted"||e.type==="Literal"?!1:e.type==="Glob"?Er(e.pattern):!(!(e.type==="ParameterExpansion"||e.type==="CommandSubstitution"||e.type==="ArithmeticExpansion")||e.type==="ParameterExpansion"&&Oa(e))}async function Fo(e,t,s,r,n){if(e.coverage?.hit("bash:expansion:word_split"),t.length===1&&t[0].type==="ParameterExpansion"){let d=t[0],h=await Wo(e,d);if(h&&h.length>0&&h.length>1&&h.some(p=>p.type==="DoubleQuoted"||p.type==="SingleQuoted")&&h.some(p=>p.type==="Literal"||p.type==="ParameterExpansion"||p.type==="CommandSubstitution"||p.type==="ArithmeticExpansion"))return Mo(e,h,s,r,n)}let i=[],a=!1;for(let d of t){let h=nf(d),m=d.type==="DoubleQuoted"||d.type==="SingleQuoted",p=h?await sf(e,d):null,y=await n(e,d);i.push({value:y,isSplittable:h,isQuoted:m,mixedDefaultParts:p??void 0}),h&&(a=!0)}if(!a){let d=i.map(h=>h.value).join("");return d?[d]:[]}let l=[],o="",u=!1,c=!1,f=!1;for(let d of i)if(!d.isSplittable)c?d.isQuoted&&d.value===""?(o!==""&&l.push(o),l.push(""),u=!0,o="",c=!1,f=!0):d.value!==""?(o!==""&&l.push(o),o=d.value,c=!1,f=!1):(o+=d.value,f=!1):(o+=d.value,f=d.isQuoted&&d.value==="");else if(d.mixedDefaultParts){let h=await Mo(e,d.mixedDefaultParts,s,r,n);if(h.length!==0)if(h.length===1)o+=h[0],u=!0;else{o+=h[0],l.push(o),u=!0;for(let m=1;m0&&t.includes(e[0])}async function Mo(e,t,s,r,n){let i=[];for(let c of t){let d=!(c.type==="DoubleQuoted"||c.type==="SingleQuoted"),h=await n(e,c);i.push({value:h,isSplittable:d})}let a=[],l="",o=!1,u=!1;for(let c of i)if(!c.isSplittable)u&&c.value!==""?(l!==""&&a.push(l),l=c.value,u=!1):l+=c.value;else{rf(c.value,s)&&l!==""&&(a.push(l),l="",o=!0);let{words:d,hadTrailingDelimiter:h}=Us(c.value,s);if(d.length===0)h&&(u=!0);else if(d.length===1)l+=d[0],o=!0,u=h;else{l+=d[0],a.push(l),o=!0;for(let m=1;mt)throw new X(`${s}: string length limit exceeded (${t} bytes)`,"string_length")}async function Ke(e,t,s=!1){let r=[];for(let n of t)r.push(await Ve(e,n,s));return r.join("")}function af(e){return zo(e)}function Bo(e){if(e.parts.length===0)return!0;for(let t of e.parts)if(!af(t))return!1;return!0}function of(e,t,s=!1){let r=Vo(t);if(r!==null)return r;switch(t.type){case"TildeExpansion":return s?t.user===null?"~":`~${t.user}`:(e.coverage?.hit("bash:expansion:tilde"),t.user===null?e.state.env.get("HOME")??"/home/user":t.user==="root"?"/root":`~${t.user}`);case"Glob":return Nr(e,t.pattern);default:return null}}async function V(e,t){return xr(e,t)}async function qo(e,t){let s=[];for(let r of t.parts)if(r.type==="Escaped")s.push(`\\${r.value}`);else if(r.type==="SingleQuoted")s.push(r.value);else if(r.type==="DoubleQuoted"){let n=await Ke(e,r.parts);s.push(n)}else if(r.type==="TildeExpansion"){let n=await Ve(e,r);s.push(ps(n))}else s.push(await Ve(e,r));return s.join("")}async function jo(e,t){let s=[];for(let r of t.parts)if(r.type==="Escaped"){let n=r.value;"()|*?[]".includes(n)?s.push(`\\${n}`):s.push(n)}else if(r.type==="SingleQuoted")s.push(Fe(r.value));else if(r.type==="DoubleQuoted"){let n=await Ke(e,r.parts);s.push(Fe(n))}else s.push(await Ve(e,r));return s.join("")}async function Uo(e,t){let s=[];for(let r of t.parts)if(r.type==="SingleQuoted")s.push(Fe(r.value));else if(r.type==="Escaped"){let n=r.value;"*?[]\\()|".includes(n)?s.push(`\\${n}`):s.push(n)}else if(r.type==="DoubleQuoted"){let n=await Ke(e,r.parts);s.push(Fe(n))}else r.type==="Glob"?no(r.pattern)?s.push(await io(e,r.pattern)):s.push(Nr(e,r.pattern)):r.type==="Literal"?s.push(r.value):s.push(await Ve(e,r));return s.join("")}function Js(e){for(let t of e)if(t.type==="BraceExpansion"||t.type==="DoubleQuoted"&&Js(t.parts))return!0;return!1}var _r=1e5;async function Zo(e,t,s={count:0}){if(s.count>_r)return[[]];let r=[[]];for(let n of t)if(n.type==="BraceExpansion"){let i=[],a=!1,l="";for(let c of n.items)if(c.type==="Range"){let f=Pr(c.start,c.end,c.step,c.startStr,c.endStr);if(f.expanded)for(let d of f.expanded)s.count++,i.push(d);else{a=!0,l=f.literal;break}}else{let f=await Zo(e,c.word.parts,s);for(let d of f){s.count++;let h=[];for(let m of d)typeof m=="string"?h.push(m):h.push(await Ve(e,m));i.push(h.join(""))}}if(a){for(let c of r)s.count++,c.push(l);continue}if(r.length*i.length>e.limits.maxBraceExpansionResults||s.count>_r)return r;let u=[];for(let c of r)for(let f of i){if(s.count++,s.count>_r)return u.length>0?u:r;u.push([...c,f])}r=u}else for(let i of r)s.count++,i.push(n);return r}async function Go(e,t){let s=t.parts;if(!Js(s))return[await V(e,t)];let r=await Zo(e,s),n=[];for(let i of r){let a=[];for(let l of i)typeof l=="string"?a.push(l):a.push(await Ve(e,l));n.push(ao(e,a.join("")))}return n}function lf(){return{expandWordAsync:xr,expandWordForGlobbing:Uo,expandWordWithBracesAsync:Go,expandWordPartsAsync:Ke,expandPart:Ve,expandParameterAsync:Ys,hasBraceExpansion:Js,evaluateArithmetic:T,buildIfsCharClassPattern:Ta,smartWordSplit:Fo}}async function it(e,t){return Lo(e,t,lf())}function cf(e){for(let t of e){if(t.type==="ParameterExpansion")return t.parameter;if(t.type==="Literal")return t.value}return""}function en(e,t){if(Number.parseInt(e.state.env.get("#")||"0",10)<2)return!1;function r(n){for(let i of n)if(i.type==="DoubleQuoted"){for(let a of i.parts)if(a.type==="ParameterExpansion"&&a.parameter==="@"&&!a.operation)return!0}return!1}return r(t.parts)}async function tn(e,t){if(en(e,t))return{error:`bash: $@: ambiguous redirect -`};let s=t.parts,{hasQuoted:r}=hs(s);if(Js(s)&&(await Go(e,t)).length>1)return{error:`bash: ${s.map(h=>h.type==="Literal"?h.value:h.type==="BraceExpansion"?`{${h.items.map(p=>{if(p.type==="Range"){let y=p.step?`..${p.step}`:"";return`${p.startStr??p.start}..${p.endStr??p.end}${y}`}return p.word.parts.map(y=>y.type==="Literal"?y.value:"").join("")}).join(",")}}`:"").join("")}: ambiguous redirect -`};let n=await xr(e,t),{hasParamExpansion:i,hasCommandSub:a}=hs(s);if((i||a)&&!r&&!ve(e.state.env)){let f=me(e.state.env);if(re(n,f).length>1)return{error:`bash: $${cf(s)}: ambiguous redirect -`}}if(r||e.state.options.noglob)return{target:n};let o=await Uo(e,t);if(!nt(o,e.state.shoptOptions.extglob))return{target:n};let u=new Pt(e.fs,e.state.cwd,e.state.env,{globstar:e.state.shoptOptions.globstar,nullglob:e.state.shoptOptions.nullglob,failglob:e.state.shoptOptions.failglob,dotglob:e.state.shoptOptions.dotglob,extglob:e.state.shoptOptions.extglob,globskipdots:e.state.shoptOptions.globskipdots,maxGlobOperations:e.limits.maxGlobOperations}),c=await u.expand(o);return c.length===0?u.hasFailglob()?{error:`bash: no match: ${n} -`}:{target:n}:c.length===1?{target:c[0]}:{error:`bash: ${n}: ambiguous redirect -`}}async function xr(e,t){let s=t.parts,r=s.length;if(r===1){let a=await Ve(e,s[0]);return _t(a,e.limits.maxStringLength,"word expansion"),a}let n=[];for(let a=0;a=a)throw new X(`Command substitution nesting limit exceeded (${a})`,"substitution_depth");let l=e.substitutionDepth;e.substitutionDepth=i+1;let o=e.state.bashPid;e.state.bashPid=e.state.nextVirtualPid++;let u=new Map(e.state.env),c=e.state.cwd,f=e.state.suppressVerbose;e.state.suppressVerbose=!0;try{let d=await e.executeScript(t.body),h=d.exitCode;e.state.env=u,e.state.cwd=c,e.state.suppressVerbose=f,e.state.lastExitCode=h,e.state.env.set("?",String(h)),d.stderr&&(e.state.expansionStderr=(e.state.expansionStderr||"")+d.stderr),e.state.bashPid=o,e.substitutionDepth=l;let m=d.stdout.replace(/\n+$/,"");return _t(m,e.limits.maxStringLength,"command substitution"),m}catch(d){if(e.state.env=u,e.state.cwd=c,e.state.bashPid=o,e.substitutionDepth=l,e.state.suppressVerbose=f,d instanceof X)throw d;if(d instanceof Z){e.state.lastExitCode=d.exitCode,e.state.env.set("?",String(d.exitCode)),d.stderr&&(e.state.expansionStderr=(e.state.expansionStderr||"")+d.stderr);let h=d.stdout.replace(/\n+$/,"");return _t(h,e.limits.maxStringLength,"command substitution"),h}throw d}}case"ArithmeticExpansion":{let n=t.expression.originalText;if(n&&/\$[a-zA-Z_][a-zA-Z0-9_]*(?![{[(])/.test(n)){let a=await za(e,n),l=new q,o=Y(l,a);return String(await T(e,o.expression,!0))}return String(await T(e,t.expression.expression,!0))}case"BraceExpansion":{let n=[];for(let i of t.items)if(i.type==="Range"){let a=Pr(i.start,i.end,i.step,i.startStr,i.endStr);if(a.expanded)n.push(...a.expanded);else return a.literal}else n.push(await V(e,i.word));return n.join(" ")}default:return""}}async function Ys(e,t,s=!1){let{parameter:r}=t,{operation:n}=t,i=r.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(.+)\]$/);if(i){let[,d,h]=i;if(e.state.associativeArrays?.has(d)||h.includes("$(")||h.includes("`")||h.includes("${")){let p=await $r(e,h);r=`${d}[${p}]`}}else if(/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(r)&&te(e,r)){let d=$e(e,r);if(d&&d!==r){let h=d.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(.+)\]$/);if(h){let[,m,p]=h;if(e.state.associativeArrays?.has(m)||p.includes("$(")||p.includes("`")||p.includes("${")){let b=await $r(e,p);r=`${m}[${b}]`}}}}let a=n&&(n.type==="DefaultValue"||n.type==="AssignDefault"||n.type==="UseAlternative"||n.type==="ErrorIfUnset"),l=await J(e,r,!a);if(!n)return l;let o=!await st(e,r),{isEmpty:u,effectiveValue:c}=so(e,r,l,s),f={value:l,isUnset:o,isEmpty:u,effectiveValue:c,inDoubleQuotes:s};switch(n.type){case"DefaultValue":return qa(e,n,f,Ke);case"AssignDefault":return ja(e,r,n,f,Ke);case"ErrorIfUnset":return Ua(e,r,n,f,Ke);case"UseAlternative":return Za(e,n,f,Ke);case"PatternRemoval":{let d=await Ga(e,l,n,Ke,Ve);return _t(d,e.limits.maxStringLength,"pattern removal"),d}case"PatternReplacement":{let d=await Ha(e,l,n,Ke,Ve);return _t(d,e.limits.maxStringLength,"pattern replacement"),d}case"Length":return Qa(e,r,l);case"LengthSliceError":throw new Me(r);case"BadSubstitution":throw new Me(n.text);case"Substring":return Ka(e,r,l,n);case"CaseModification":{let d=await Xa(e,l,n,Ke,Ys);return _t(d,e.limits.maxStringLength,"case modification"),d}case"Transform":return Ya(e,r,l,o,n);case"Indirection":return Ja(e,r,l,o,n,Ys,s);case"ArrayKeys":return eo(e,n);case"VarNamePrefix":return to(e,n);default:return l}}function uf(e,t,s){switch(s){case"+":return e+t;case"-":return e-t;case"*":return e*t;case"/":if(t===0)throw new se("division by 0");return Math.trunc(e/t);case"%":if(t===0)throw new se("division by 0");return e%t;case"**":if(t<0)throw new se("exponent less than 0");return e**t;case"<<":return e<>":return e>>t;case"<":return e":return e>t?1:0;case">=":return e>=t?1:0;case"==":return e===t?1:0;case"!=":return e!==t?1:0;case"&":return e&t;case"|":return e|t;case"^":return e^t;case",":return t;default:return 0}}function Ho(e,t,s){switch(s){case"=":return t;case"+=":return e+t;case"-=":return e-t;case"*=":return e*t;case"/=":return t!==0?Math.trunc(e/t):0;case"%=":return t!==0?e%t:0;case"<<=":return e<>=":return e>>t;case"&=":return e&t;case"|=":return e|t;case"^=":return e^t;default:return t}}function ff(e,t){switch(t){case"-":return-e;case"+":return+e;case"!":return e===0?1:0;case"~":return~e;default:return e}}async function df(e,t){let s=e.state.env.get(t);if(s!==void 0)return s;let r=e.state.env.get(`${t}_0`);return r!==void 0?r:await J(e,t)}function hf(e){if(!e)return 0;let t=Number.parseInt(e,10);if(!Number.isNaN(t)&&/^-?\d+$/.test(e.trim()))return t;let s=e.trim();if(!s)return 0;try{let r=new q,{expr:n,pos:i}=We(r,s,0);if(i100)throw new se("maximum variable indirection depth exceeded");if(s.has(t))return 0;s.add(t);let n=await df(e,t);if(!n)return 0;let i=Number.parseInt(n,10);if(!Number.isNaN(i)&&/^-?\d+$/.test(n.trim()))return i;let a=n.trim();if(/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(a))return await Dr(e,a,s,r+1);let l=new q,{expr:o,pos:u}=We(l,a,0);if(u0&&(r===-1||d64)return 0;let i=`${n}#${t.value}`;return us(i)}case"ArithDynamicNumber":{let n=await sn(e,t.prefix)+t.suffix;return us(n)}case"ArithArrayElement":{let r=e.state.associativeArrays?.has(t.array),n=async i=>{let a=e.state.env.get(i);return a!==void 0?await Cr(e,a):0};if(t.stringKey!==void 0)return await n(`${t.array}_${t.stringKey}`);if(r&&t.index?.type==="ArithVariable"&&!t.index.hasDollarPrefix)return await n(`${t.array}_${t.index.name}`);if(r&&t.index?.type==="ArithVariable"&&t.index.hasDollarPrefix){let i=await J(e,t.index.name);return await n(`${t.array}_${i}`)}if(t.index){let i=await T(e,t.index,s);if(i<0){let o=B(e,t.array),u=e.state.currentLine;if(o.length===0)return e.state.expansionStderr=(e.state.expansionStderr||"")+`bash: line ${u}: ${t.array}: bad array subscript -`,0;let f=Math.max(...o.map(([d])=>typeof d=="number"?d:0))+1+i;if(f<0)return e.state.expansionStderr=(e.state.expansionStderr||"")+`bash: line ${u}: ${t.array}: bad array subscript -`,0;i=f}let a=`${t.array}_${i}`,l=e.state.env.get(a);if(l!==void 0)return Cr(e,l);if(i===0){let o=e.state.env.get(t.array);if(o!==void 0)return Cr(e,o)}if(e.state.options.nounset&&!Array.from(e.state.env.keys()).some(u=>u===t.array||u.startsWith(`${t.array}_`)))throw new Le(`${t.array}[${i}]`);return 0}return 0}case"ArithDoubleSubscript":throw new se("double subscript","","");case"ArithNumberSubscript":throw new se(`${t.number}${t.errorToken}: syntax error: invalid arithmetic operator (error token is "${t.errorToken}")`);case"ArithSyntaxError":throw new se(t.message,"","",!0);case"ArithSingleQuote":{if(s)throw new se(`syntax error: operand expected (error token is "'${t.content}'")`);return t.value}case"ArithBinary":{if(t.operator==="||")return await T(e,t.left,s)||await T(e,t.right,s)?1:0;if(t.operator==="&&")return await T(e,t.left,s)&&await T(e,t.right,s)?1:0;let r=await T(e,t.left,s),n=await T(e,t.right,s);return uf(r,n,t.operator)}case"ArithUnary":{let r=await T(e,t.operand,s);if(t.operator==="++"||t.operator==="--"){if(t.operand.type==="ArithVariable"){let n=t.operand.name,i=Number.parseInt(await J(e,n),10)||0,a=t.operator==="++"?i+1:i-1;return e.state.env.set(n,String(a)),t.prefix?a:i}if(t.operand.type==="ArithArrayElement"){let n=t.operand.array,i=e.state.associativeArrays?.has(n),a;if(t.operand.stringKey!==void 0)a=`${n}_${t.operand.stringKey}`;else if(i&&t.operand.index?.type==="ArithVariable"&&!t.operand.index.hasDollarPrefix)a=`${n}_${t.operand.index.name}`;else if(i&&t.operand.index?.type==="ArithVariable"&&t.operand.index.hasDollarPrefix){let u=await J(e,t.operand.index.name);a=`${n}_${u}`}else if(t.operand.index){let u=await T(e,t.operand.index,s);a=`${n}_${u}`}else return r;let l=Number.parseInt(e.state.env.get(a)||"0",10)||0,o=t.operator==="++"?l+1:l-1;return e.state.env.set(a,String(o)),t.prefix?o:l}if(t.operand.type==="ArithConcat"){let n="";for(let i of t.operand.parts)n+=await Gt(e,i,s);if(n&&/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(n)){let i=Number.parseInt(e.state.env.get(n)||"0",10)||0,a=t.operator==="++"?i+1:i-1;return e.state.env.set(n,String(a)),t.prefix?a:i}}if(t.operand.type==="ArithDynamicElement"){let n="";if(t.operand.nameExpr.type==="ArithConcat")for(let i of t.operand.nameExpr.parts)n+=await Gt(e,i,s);else t.operand.nameExpr.type==="ArithVariable"&&(n=t.operand.nameExpr.hasDollarPrefix?await J(e,t.operand.nameExpr.name):t.operand.nameExpr.name);if(n&&/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(n)){let i=await T(e,t.operand.subscript,s),a=`${n}_${i}`,l=Number.parseInt(e.state.env.get(a)||"0",10)||0,o=t.operator==="++"?l+1:l-1;return e.state.env.set(a,String(o)),t.prefix?o:l}}return r}return ff(r,t.operator)}case"ArithTernary":return await T(e,t.condition,s)?await T(e,t.consequent,s):await T(e,t.alternate,s);case"ArithAssignment":{let r=t.variable,n=r;if(t.stringKey!==void 0)n=`${r}_${t.stringKey}`;else if(t.subscript){let o=e.state.associativeArrays?.has(r);if(o&&t.subscript.type==="ArithVariable"&&!t.subscript.hasDollarPrefix)n=`${r}_${t.subscript.name}`;else if(o&&t.subscript.type==="ArithVariable"&&t.subscript.hasDollarPrefix){let u=await J(e,t.subscript.name);n=`${r}_${u||"\\"}`}else if(o){let u=await T(e,t.subscript,s);n=`${r}_${u}`}else{let u=await T(e,t.subscript,s);if(u<0){let c=B(e,r);c.length>0&&(u=Math.max(...c.map(([d])=>typeof d=="number"?d:0))+1+u)}n=`${r}_${u}`}}let i=Number.parseInt(e.state.env.get(n)||"0",10)||0,a=await T(e,t.value,s),l=Ho(i,a,t.operator);return e.state.env.set(n,String(l)),l}case"ArithGroup":return await T(e,t.expression,s);case"ArithConcat":{let r="";for(let n of t.parts)r+=await Gt(e,n,s);return/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(r)?await Dr(e,r):Number.parseInt(r,10)||0}case"ArithDynamicAssignment":{let r="";if(t.target.type==="ArithConcat")for(let o of t.target.parts)r+=await Gt(e,o,s);else t.target.type==="ArithVariable"&&(r=t.target.hasDollarPrefix?await J(e,t.target.name):t.target.name);if(!r||!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(r))return 0;let n=r;if(t.subscript){let o=await T(e,t.subscript,s);n=`${r}_${o}`}let i=Number.parseInt(e.state.env.get(n)||"0",10)||0,a=await T(e,t.value,s),l=Ho(i,a,t.operator);return e.state.env.set(n,String(l)),l}case"ArithDynamicElement":{let r="";if(t.nameExpr.type==="ArithConcat")for(let l of t.nameExpr.parts)r+=await Gt(e,l,s);else t.nameExpr.type==="ArithVariable"&&(r=t.nameExpr.hasDollarPrefix?await J(e,t.nameExpr.name):t.nameExpr.name);if(!r||!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(r))return 0;let n=await T(e,t.subscript,s),i=`${r}_${n}`,a=e.state.env.get(i);return a!==void 0?hf(a):0}default:return 0}}async function Gt(e,t,s=!1){switch(t.type){case"ArithNumber":return String(t.value);case"ArithSingleQuote":return String(await T(e,t,s));case"ArithVariable":return t.hasDollarPrefix?await J(e,t.name):t.name;case"ArithSpecialVar":return await J(e,t.name);case"ArithBracedExpansion":return await sn(e,t.content);case"ArithCommandSubst":return e.execFn?(await e.execFn(t.command,{signal:e.state.signal})).stdout.trim():"0";case"ArithConcat":{let r="";for(let n of t.parts)r+=await Gt(e,n,s);return r}default:return String(await T(e,t,s))}}async function Qo(e,t){let s=t.parts.map(c=>c.type==="Literal"?c.value:"\0").join(""),r=s.match(/^([a-zA-Z_][a-zA-Z0-9_]*)=\(/);if(!r||!s.endsWith(")"))return null;let n=r[1],i=[],a=!1,l="",o=!1;for(let c of t.parts)if(c.type==="Literal"){let f=c.value;if(!a){let d=f.indexOf("=(");d!==-1&&(a=!0,f=f.slice(d+2))}if(a){f.endsWith(")")&&(f=f.slice(0,-1));let d=f.split(/(\s+)/);for(let h of d)/^\s+$/.test(h)?(l||o)&&(i.push(l),l="",o=!1):h&&(l+=h)}}else if(a)if(c.type==="BraceExpansion")if(/^\[.+\]=/.test(l))l+=Ut({type:"Word",parts:[c]});else{(l||o)&&(i.push(l),l="",o=!1);let d=await it(e,{type:"Word",parts:[c]});i.push(...d.values)}else{(c.type==="SingleQuoted"||c.type==="DoubleQuoted"||c.type==="Escaped")&&(o=!0);let f=await V(e,{type:"Word",parts:[c]});l+=f}(l||o)&&i.push(l);let u=i.map(c=>/^\[.+\]=/.test(c)?c:c===""?"''":/[\s"'\\$`!*?[\]{}|&;<>()]/.test(c)&&!c.startsWith("'")&&!c.startsWith('"')?`'${c.replace(/'/g,"'\\''")}'`:c);return`${n}=(${u.join(" ")})`}async function Ko(e,t){let s=-1,r=-1,n=!1;for(let p=0;p0?await V(e,d):"";return`${f}${n?"+=":"="}${h}`}var pf=["tar","yq","xan","sqlite3","python3","python"];function Xo(e){return pf.includes(e)}var K=Object.freeze({stdout:"",stderr:"",exitCode:0});function H(e=""){return{stdout:e,stderr:"",exitCode:0}}function N(e,t=1){return{stdout:"",stderr:e,exitCode:t}}function _(e,t,s){return{stdout:e,stderr:t,exitCode:s}}function pe(e){return{stdout:"",stderr:"",exitCode:e?0:1}}function at(e,t,s="",r=""){throw new X(e,t,s,r)}function Ae(e){let t=e.state.fileDescriptors;if(t&&t.size>=e.limits.maxFileDescriptors)throw new X(`too many open file descriptors (max ${e.limits.maxFileDescriptors})`,"file_descriptors")}function Rr(e,t){if(e.state.loopDepth===0){if(e.state.parentHasLoopContext)throw new Et;return K}if(t.length>1)throw new Z(1,"",`bash: break: too many arguments -`);let s=1;if(t.length>0){let r=Number.parseInt(t[0],10);if(Number.isNaN(r)||r<1)throw new Z(128,"",`bash: break: ${t[0]}: numeric argument required -`);s=r}throw new Oe(s)}async function Ir(e,t){let s,r=!1,n=!1,i=0;for(;ih);for(let h of d){let m=h.startsWith("/")?`${h}/${s}`:`${e.state.cwd}/${h}/${s}`;try{if((await e.fs.stat(m)).isDirectory){s=m,r=!0;break}}catch{}}}}let o=(s.startsWith("/")?s:`${e.state.cwd}/${s}`).split("/").filter(f=>f&&f!=="."),u="";for(let f of o)if(f==="..")u=u.split("/").slice(0,-1).join("/")||"/";else{u=u?`${u}/${f}`:`/${f}`;try{if(!(await e.fs.stat(u)).isDirectory)return N(`bash: cd: ${s}: Not a directory -`)}catch{return N(`bash: cd: ${s}: No such file or directory -`)}}let c=u||"/";if(n)try{c=await e.fs.realpath(c)}catch{}return e.state.previousDir=e.state.cwd,e.state.cwd=c,e.state.env.set("PWD",e.state.cwd),e.state.env.set("OLDPWD",e.state.previousDir),H(r?`${c} -`:"")}function Or(e,t){return e.fs.resolvePath(e.state.cwd,t)}var mf=["-e","-a","-f","-d","-r","-w","-x","-s","-L","-h","-k","-g","-u","-G","-O","-b","-c","-p","-S","-t","-N"];function nn(e){return mf.includes(e)}async function rn(e,t,s){let r=Or(e,s);switch(t){case"-e":case"-a":return e.fs.exists(r);case"-f":return await e.fs.exists(r)?(await e.fs.stat(r)).isFile:!1;case"-d":return await e.fs.exists(r)?(await e.fs.stat(r)).isDirectory:!1;case"-r":return await e.fs.exists(r)?((await e.fs.stat(r)).mode&256)!==0:!1;case"-w":return await e.fs.exists(r)?((await e.fs.stat(r)).mode&128)!==0:!1;case"-x":return await e.fs.exists(r)?((await e.fs.stat(r)).mode&64)!==0:!1;case"-s":return await e.fs.exists(r)?(await e.fs.stat(r)).size>0:!1;case"-L":case"-h":try{return(await e.fs.lstat(r)).isSymbolicLink}catch{return!1}case"-k":return await e.fs.exists(r)?((await e.fs.stat(r)).mode&512)!==0:!1;case"-g":return await e.fs.exists(r)?((await e.fs.stat(r)).mode&1024)!==0:!1;case"-u":return await e.fs.exists(r)?((await e.fs.stat(r)).mode&2048)!==0:!1;case"-G":case"-O":return e.fs.exists(r);case"-b":return!1;case"-c":return["/dev/null","/dev/zero","/dev/random","/dev/urandom","/dev/tty","/dev/stdin","/dev/stdout","/dev/stderr"].includes(r);case"-p":return!1;case"-S":return!1;case"-t":return!1;case"-N":return e.fs.exists(r);default:return!1}}var gf=["-nt","-ot","-ef"];function an(e){return gf.includes(e)}async function on(e,t,s,r){let n=Or(e,s),i=Or(e,r);switch(t){case"-nt":try{let a=await e.fs.stat(n),l=await e.fs.stat(i);return a.mtime>l.mtime}catch{return!1}case"-ot":try{let a=await e.fs.stat(n),l=await e.fs.stat(i);return a.mtimes;case"-ge":return t>=s}}function gs(e){return e==="="||e==="=="||e==="!="}function un(e,t,s,r=!1,n=!1,i=!1){if(r){let l=Ht(t,s,n,i);return e==="!="?!l:l}if(n){let l=t.toLowerCase()===s.toLowerCase();return e==="!="?!l:l}let a=t===s;return e==="!="?!a:a}var wf=new Set(["-z","-n"]);function fn(e){return wf.has(e)}function dn(e,t){switch(e){case"-z":return t==="";case"-n":return t!==""}}async function hn(e,t){let s=t.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(.+)\]$/);if(s){let r=s[1],n=s[2];if(e.state.associativeArrays?.has(r)){let l=n;return(l.startsWith("'")&&l.endsWith("'")||l.startsWith('"')&&l.endsWith('"'))&&(l=l.slice(1,-1)),l=l.replace(/\$([a-zA-Z_][a-zA-Z0-9_]*)/g,(o,u)=>e.state.env.get(u)||""),e.state.env.has(`${r}_${l}`)}let a;try{let l=new q,o=Y(l,n);a=await T(e,o.expression)}catch{if(/^-?\d+$/.test(n))a=Number.parseInt(n,10);else{let l=e.state.env.get(n);a=l?Number.parseInt(l,10):0}}if(a<0){let l=he(e,r),o=e.state.currentLine;if(l.length===0)return e.state.expansionStderr=(e.state.expansionStderr||"")+`bash: line ${o}: ${r}: bad array subscript -`,!1;if(a=Math.max(...l)+1+a,a<0)return e.state.expansionStderr=(e.state.expansionStderr||"")+`bash: line ${o}: ${r}: bad array subscript -`,!1}return e.state.env.has(`${r}_${a}`)}return e.state.env.has(t)?!0:e.state.associativeArrays?.has(t)?Ge(e,t).length>0:he(e,t).length>0}async function xt(e,t){switch(t.type){case"CondBinary":{let s=await V(e,t.left),r=t.right.parts.length>0&&t.right.parts.every(i=>i.type==="SingleQuoted"||i.type==="DoubleQuoted"||i.type==="Escaped"&&t.operator!=="=~"),n;if(t.operator==="=~")if(r){let i=await V(e,t.right);n=ps(i)}else n=await qo(e,t.right);else gs(t.operator)&&!r?n=await jo(e,t.right):n=await V(e,t.right);if(gs(t.operator)){let i=e.state.shoptOptions.nocasematch;return un(t.operator,s,n,!r,i,!0)}if(ln(t.operator))return cn(t.operator,await Jo(e,s),await Jo(e,n));if(an(t.operator))return on(e,t.operator,s,n);switch(t.operator){case"=~":try{let i=e.state.shoptOptions.nocasematch,a=Sf(n),o=le(a,i?"i":"").match(s);if(tt(e,"BASH_REMATCH"),o)for(let u=0;u":return s>n;default:return!1}}case"CondUnary":{let s=await V(e,t.operand);return nn(t.operator)?rn(e,t.operator,s):fn(t.operator)?dn(t.operator,s):t.operator==="-v"?await hn(e,s):t.operator==="-o"?Lr(e,s):!1}case"CondNot":return e.state.shoptOptions.extglob&&t.operand.type==="CondGroup"&&t.operand.expression.type==="CondWord"?`!(${await V(e,t.operand.expression.word)})`!=="":!await xt(e,t.operand);case"CondAnd":return await xt(e,t.left)?await xt(e,t.right):!1;case"CondOr":return await xt(e,t.left)?!0:await xt(e,t.right);case"CondGroup":return await xt(e,t.expression);case"CondWord":return await V(e,t.word)!=="";default:return!1}}async function ys(e,t){if(t.length===0)return _("","",1);if(t.length===1)return pe(!!t[0]);if(t.length===2){let r=t[0],n=t[1];return r==="("?N(`test: '(' without matching ')' -`,2):nn(r)?pe(await rn(e,r,n)):fn(r)?pe(dn(r,n)):r==="!"?pe(!n):r==="-v"?pe(await hn(e,n)):r==="-o"?pe(Lr(e,n)):r==="="||r==="=="||r==="!="||r==="<"||r===">"||r==="-eq"||r==="-ne"||r==="-lt"||r==="-le"||r==="-gt"||r==="-ge"||r==="-nt"||r==="-ot"||r==="-ef"?N(`test: ${r}: unary operator expected -`,2):_("","",1)}if(t.length===3){let r=t[0],n=t[1],i=t[2];if(gs(n))return pe(un(n,r,i));if(ln(n)){let a=pn(r),l=pn(i);return!a.valid||!l.valid?_("","",2):pe(cn(n,a.value,l.value))}if(an(n))return pe(await on(e,n,r,i));switch(n){case"-a":return pe(r!==""&&i!=="");case"-o":return pe(r!==""||i!=="");case">":return pe(r>i);case"<":return pe(rsl(c,t)),u=o.length>0?o.join("|"):"(?:)";if(n==="@")s+=`(?:${u})`;else if(n==="*")s+=`(?:${u})*`;else if(n==="+")s+=`(?:${u})+`;else if(n==="?")s+=`(?:${u})?`;else if(n==="!")if(iil(h,t));if(f.every(h=>h!==null)&&f.every(h=>h===f[0])&&f[0]!==null){let h=f[0];if(h===0)s+="(?:.+)";else{let m=[];h>0&&m.push(`.{0,${h-1}}`),m.push(`.{${h+1},}`),m.push(`(?!(?:${u})).{${h}}`),s+=`(?:${m.join("|")})`}}else s+=`(?:(?!(?:${u})).)*?`}else s+=`(?!(?:${u})$).*`;r=i;continue}}if(n==="\\")if(r+10;){let n=e[r];if(n==="\\"){r+=2;continue}if(n==="(")s++;else if(n===")"&&(s--,s===0))return r;r++}return-1}function rl(e){let t=[],s="",r=0,n=0;for(;nil(u,t));if(o.every(u=>u!==null)&&o.every(u=>u===o[0])){s+=o[0],r=i+1;continue}return null}return null}}if(n==="*")return null;if(n==="?"){s+=1,r++;continue}if(n==="["){let i=e.indexOf("]",r+1);if(i!==-1){s+=1,r=i+1;continue}s+=1,r++;continue}if(n==="\\"){s+=1,r+=2;continue}s+=1,r++}return s}function Lr(e,t){let r=new Map([["errexit",()=>e.state.options.errexit===!0],["nounset",()=>e.state.options.nounset===!0],["pipefail",()=>e.state.options.pipefail===!0],["xtrace",()=>e.state.options.xtrace===!0],["e",()=>e.state.options.errexit===!0],["u",()=>e.state.options.nounset===!0],["x",()=>e.state.options.xtrace===!0]]).get(t);return r?r():!1}async function Jo(e,t){if(t=t.trim(),t==="")return 0;if(/^[+-]?(\d+#[a-zA-Z0-9@_]+|0[xX][0-9a-fA-F]+|0[0-7]+|\d+)$/.test(t))return el(t);try{let s=new q,r=Y(s,t);return await T(e,r.expression)}catch{return el(t)}}function vf(e,t){let s=0;for(let r of e){let n;if(r>="0"&&r<="9")n=r.charCodeAt(0)-48;else if(r>="a"&&r<="z")n=r.charCodeAt(0)-97+10;else if(r>="A"&&r<="Z")n=r.charCodeAt(0)-65+36;else if(r==="@")n=62;else if(r==="_")n=63;else return Number.NaN;if(n>=t)return Number.NaN;s=s*t+n}return s}function el(e){if(e=e.trim(),e==="")return 0;let t=!1;e.startsWith("-")?(t=!0,e=e.slice(1)):e.startsWith("+")&&(e=e.slice(1));let s,r=e.match(/^(\d+)#([a-zA-Z0-9@_]+)$/);if(r){let n=Number.parseInt(r[1],10);n>=2&&n<=64?s=vf(r[2],n):s=0}else/^0[xX][0-9a-fA-F]+$/.test(e)?s=Number.parseInt(e,16):/^0[0-7]+$/.test(e)?s=Number.parseInt(e,8):s=Number.parseInt(e,10);return Number.isNaN(s)&&(s=0),t?-s:s}function pn(e){if(e=e.trim(),e==="")return{value:0,valid:!0};let t=!1;if(e.startsWith("-")?(t=!0,e=e.slice(1)):e.startsWith("+")&&(e=e.slice(1)),!/^\d+$/.test(e))return{value:0,valid:!1};let s=Number.parseInt(e,10);return Number.isNaN(s)?{value:0,valid:!1}:{value:t?-s:s,valid:!0}}function Sf(e){let t="",s=0;for(;s=e.length)break;if(e[s]!=="["){s++;continue}s++;let r="";if(e[s]==="'"||e[s]==='"'){let i=e[s];for(s++;s=f&&e.state.env.set(`${r}__length`,String(c+1))}else a!==void 0&&e.state.env.set(r,a);return o&&De(e,r),null}function Ct(e,t){e.state.localVarDepth=e.state.localVarDepth||new Map,e.state.localVarDepth.set(t,e.state.callDepth)}function Qt(e,t){return e.state.localVarDepth?.get(t)}function gn(e,t){e.state.localVarDepth?.delete(t)}function ll(e,t,s){e.state.localVarStack=e.state.localVarStack||new Map;let r=e.state.localVarStack.get(t)||[];r.push({value:s,scopeIndex:e.state.localScopes.length-1}),e.state.localVarStack.set(t,r)}function yn(e,t){let s=e.state.localVarStack?.get(t);if(!(!s||s.length===0))return s.pop()}function cl(e,t){if(e.state.localVarStack)for(let[s,r]of e.state.localVarStack.entries()){for(;r.length>0&&r[r.length-1].scopeIndex===t;)r.pop();r.length===0&&e.state.localVarStack.delete(s)}}var Mr=new Set([":",".","break","continue","eval","exec","exit","export","readonly","return","set","shift","trap","unset"]);function ul(e){return Mr.has(e)}var Wr=new Set(["if","then","else","elif","fi","case","esac","for","select","while","until","do","done","in","function","{","}","time","[[","]]","!"]),Kt=new Set([":","true","false","cd","export","unset","exit","local","set","break","continue","return","eval","shift","getopts","compgen","complete","compopt","pushd","popd","dirs","source",".","read","mapfile","readarray","declare","typeset","readonly","let","command","shopt","exec","test","[","echo","printf","pwd","alias","unalias","type","hash","ulimit","umask","trap","times","wait","kill","jobs","fg","bg","disown","suspend","fc","history","help","enable","builtin","caller"]);async function wn(e,t,s,r){try{if((await e.fs.stat(t)).isDirectory)return`bash: ${s}: Is a directory -`;if(r.checkNoclobber&&e.state.options.noclobber&&!r.isClobber&&s!=="/dev/null")return`bash: ${s}: cannot overwrite existing file -`}catch{}return null}function Xt(e){let s=Math.min(e.length,8192);for(let r=0;r127)return"utf8";return"binary"}function kf(e){if(!e.startsWith("__rw__:"))return null;let t=e.slice(7),s=t.indexOf(":");if(s===-1)return null;let r=Number.parseInt(t.slice(0,s),10);if(Number.isNaN(r)||r<0)return null;let n=s+1,i=t.slice(n,n+r),a=n+r+1,l=t.slice(a),o=l.indexOf(":");if(o===-1)return null;let u=Number.parseInt(l.slice(0,o),10);if(Number.isNaN(u)||u<0)return null;let c=l.slice(o+1);return{path:i,position:u,content:c}}async function fl(e,t){let s=new Map;for(let r=0;r&"||n.operator==="<&"){if(en(e,n.target))return{targets:s,error:`bash: $@: ambiguous redirect -`};s.set(r,await V(e,n.target))}else{let a=await tn(e,n.target);if("error"in a)return{targets:s,error:a.error};s.set(r,a.target)}}return{targets:s}}function Nf(e){e.state.nextFd===void 0&&(e.state.nextFd=10);let t=e.state.nextFd,s=e.limits.maxFileDescriptors;if(t>=s)throw new Error(`bash: cannot allocate file descriptor: too many open files (max ${s})`);return e.state.nextFd++,t}async function En(e,t){for(let s of t){if(!s.fdVariable)continue;if(e.state.fileDescriptors||(e.state.fileDescriptors=new Map),(s.operator===">&"||s.operator==="<&")&&s.target.type==="Word"&&await V(e,s.target)==="-"){let i=e.state.env.get(s.fdVariable);if(i!==void 0){let a=Number.parseInt(i,10);Number.isNaN(a)||e.state.fileDescriptors.delete(a)}continue}let r=Nf(e);if(e.state.env.set(s.fdVariable,String(r)),s.target.type==="Word"){let n=await V(e,s.target);if(s.operator===">&"||s.operator==="<&"){let i=Number.parseInt(n,10);if(!Number.isNaN(i)){let a=e.state.fileDescriptors.get(i);a!==void 0&&(Ae(e),e.state.fileDescriptors.set(r,a));continue}}if(s.operator===">"||s.operator===">>"||s.operator===">|"||s.operator==="&>"||s.operator==="&>>"){let i=e.fs.resolvePath(e.state.cwd,n);(s.operator===">"||s.operator===">|"||s.operator==="&>")&&await e.fs.writeFile(i,"","binary"),Ae(e),e.state.fileDescriptors.set(r,`__file__:${i}`)}else if(s.operator==="<<<")Ae(e),e.state.fileDescriptors.set(r,`${n} -`);else if(s.operator==="<"||s.operator==="<>")try{let i=e.fs.resolvePath(e.state.cwd,n),a=await e.fs.readFile(i);Ae(e),e.state.fileDescriptors.set(r,a)}catch{return _("",`bash: ${n}: No such file or directory -`,1)}}}return null}async function lt(e,t){for(let s of t){if(s.target.type==="HereDoc")continue;let r=s.operator===">&";if(s.operator!==">"&&s.operator!==">|"&&s.operator!=="&>"&&!r)continue;let n;if(r){if(n=await V(e,s.target),n==="-"||!Number.isNaN(Number.parseInt(n,10))||s.fd!=null)continue}else{let l=await tn(e,s.target);if("error"in l)return _("",l.error,1);n=l.target}let i=e.fs.resolvePath(e.state.cwd,n),a=s.operator===">|";if(i.includes("\0"))return _("",`bash: ${n}: No such file or directory -`,1);try{let l=await e.fs.stat(i);if(l.isDirectory)return _("",`bash: ${n}: Is a directory -`,1);if(e.state.options.noclobber&&!a&&!l.isDirectory&&n!=="/dev/null")return _("",`bash: ${n}: cannot overwrite existing file -`,1)}catch{}if(n!=="/dev/null"&&n!=="/dev/stdout"&&n!=="/dev/stderr"&&n!=="/dev/full"&&await e.fs.writeFile(i,"","binary"),n==="/dev/full")return _("",`bash: /dev/full: No space left on device -`,1)}return null}async function ue(e,t,s,r){let{stdout:n,stderr:i,exitCode:a}=t,o=t.stdoutKind==="bytes"||t.stdoutKind===void 0&&t.stdoutEncoding==="binary"?"binary":"utf8",u=p=>o,c={kind:"live-stdout"},f={kind:"live-stderr"};for(let p=0;p&"||y.operator==="<&"){if(en(e,y.target)){i+=`bash: $@: ambiguous redirect -`,a=1,n="";continue}b=await V(e,y.target)}else{let w=await tn(e,y.target);if("error"in w){i+=w.error,a=1,n="";continue}b=w.target}if(!y.fdVariable){if(b.includes("\0")){i+=`bash: ${b.replace(/\0/g,"")}: No such file or directory -`,a=1,n="";continue}switch(y.operator){case">":case">|":case">>":{let E=y.fd??1;if(E!==1&&E!==2)break;let w=y.operator===">>",S=y.operator===">|";if(b==="/dev/stdout"){E===2&&(f=c);break}if(b==="/dev/stderr"){E===1&&(c=f);break}if(b==="/dev/full"){i+=`bash: echo: write error: No space left on device -`,a=1,E===1&&(n="");break}if(b==="/dev/null"&&E===2){f={kind:"discard"};break}let A=e.fs.resolvePath(e.state.cwd,b),$=await wn(e,A,b,{...w?{}:{checkNoclobber:!0,isClobber:S}});if($){i+=$,a=1,E===1&&(n="");break}w?await e.fs.appendFile(A,"","binary"):await e.fs.writeFile(A,"","binary"),E===1?c={kind:"file",path:A,append:w}:f={kind:"file",path:A,append:w};break}case">&":case"<&":{let E=y.fd??1;if(b==="-")break;if(b.endsWith("-")){let w=b.slice(0,-1),S=Number.parseInt(w,10);if(!Number.isNaN(S)){let A=e.state.fileDescriptors?.get(S);A!==void 0?(e.state.fileDescriptors||(e.state.fileDescriptors=new Map),e.state.fileDescriptors.set(E,A),S>=3&&e.state.fileDescriptors?.delete(S)):S===1||S===2?(e.state.fileDescriptors||(e.state.fileDescriptors=new Map),e.state.fileDescriptors.set(E,`__dupout__:${S}`)):S===0?(e.state.fileDescriptors||(e.state.fileDescriptors=new Map),e.state.fileDescriptors.set(E,`__dupin__:${S}`)):S>=3&&(i+=`bash: ${S}: Bad file descriptor -`,a=1)}break}if(b==="2"||b==="&2")E===1&&(c=f);else if(b==="1"||b==="&1")E===2?f=c:(n+=i,i="");else{let w=Number.parseInt(b,10);if(Number.isNaN(w)){if(y.operator===">&"){let S=e.fs.resolvePath(e.state.cwd,b),A=await wn(e,S,b,{checkNoclobber:!0});if(A){i=A,a=1,n="";break}await e.fs.writeFile(S,"","binary"),y.fd==null?(c={kind:"file",path:S,append:!1},f=c):E===1?c={kind:"file",path:S,append:!1}:E===2&&(f={kind:"file",path:S,append:!1})}}else{let S=e.state.fileDescriptors?.get(w);if(S?.startsWith("__file__:")){let A=S.slice(9);E===1?(await e.fs.appendFile(A,n,u(n)),n=""):E===2&&(await e.fs.appendFile(A,i,Xt(i)),i="")}else if(S?.startsWith("__rw__:")){let A=kf(S);A&&(E===1?(await e.fs.appendFile(A.path,n,u(n)),n=""):E===2&&(await e.fs.appendFile(A.path,i,Xt(i)),i=""))}else if(S?.startsWith("__dupout__:")){let A=Number.parseInt(S.slice(11),10);if(A!==1)if(A===2)E===1&&(i+=n,n="");else{let $=e.state.fileDescriptors?.get(A);if($?.startsWith("__file__:")){let R=$.slice(9);E===1?(await e.fs.appendFile(R,n,u(n)),n=""):E===2&&(await e.fs.appendFile(R,i,Xt(i)),i="")}}}else S?.startsWith("__dupin__:")?(i+=`bash: ${w}: Bad file descriptor -`,a=1,n=""):w>=3&&(i+=`bash: ${w}: Bad file descriptor -`,a=1,n="")}}break}case"&>":{if(b==="/dev/full"){i=`bash: echo: write error: No space left on device -`,a=1,n="";break}let E=e.fs.resolvePath(e.state.cwd,b),w=await wn(e,E,b,{checkNoclobber:!0});if(w){i=w,a=1,n="";break}await e.fs.writeFile(E,"","binary"),c={kind:"file",path:E,append:!1},f=c;break}case"&>>":{if(b==="/dev/full"){i=`bash: echo: write error: No space left on device -`,a=1,n="";break}let E=e.fs.resolvePath(e.state.cwd,b),w=await wn(e,E,b,{});if(w){i=w,a=1,n="";break}await e.fs.appendFile(E,"","binary"),c={kind:"file",path:E,append:!0},f=c;break}}}}if(n!==""||i!==""){let p=n,y=i;n="",i="";let b=async(v,E,w)=>{v.append?await e.fs.appendFile(v.path,E,w):await e.fs.writeFile(v.path,E,w)};if(c===f&&c.kind==="file"){let v=p+y;v!==""&&await b(c,v,u(v))}else for(let[v,E,w]of[[p,c,!0],[y,f,!1]])if(v!=="")switch(E.kind){case"live-stdout":n+=v;break;case"live-stderr":i+=v;break;case"file":await b(E,v,w?u(v):Xt(v));break;case"discard":break}}let d=e.state.fileDescriptors?.get(1);if(d){if(d==="__dupout__:2")i+=n,n="";else if(d.startsWith("__file__:")){let p=d.slice(9);await e.fs.appendFile(p,n,u(n)),n=""}else if(d.startsWith("__file_append__:")){let p=d.slice(16);await e.fs.appendFile(p,n,u(n)),n=""}}let h=e.state.fileDescriptors?.get(2);if(h){if(h==="__dupout__:1")n+=i,i="";else if(h.startsWith("__file__:")){let p=h.slice(9);await e.fs.appendFile(p,i,Xt(i)),i=""}else if(h.startsWith("__file_append__:")){let p=h.slice(16);await e.fs.appendFile(p,i,Xt(i)),i=""}}let m=_(n,i,a);return t.stdoutKind&&(m.stdoutKind=t.stdoutKind),t.stdoutEncoding==="binary"&&(m.stdoutEncoding="binary"),m}function dl(e,t){if(e.state.options.posix&&Mr.has(t.name)){let r=`bash: line ${e.state.currentLine}: \`${t.name}': is a special builtin -`;throw new Z(2,"",r)}let s={...t,sourceFile:t.sourceFile??e.state.currentSource??"main"};return e.state.functions.set(t.name,s),K}async function _f(e,t){let s="";for(let r of t)if((r.operator==="<<"||r.operator==="<<-")&&r.target.type==="HereDoc"){let n=r.target,i=await V(e,n.content);n.stripTabs&&(i=i.split(` -`).map(l=>l.replace(/^\t+/,"")).join(` -`)),(r.fd??0)===0&&(s=i)}else if(r.operator==="<<<"&&r.target.type==="Word")s=`${await V(e,r.target)} -`;else if(r.operator==="<"&&r.target.type==="Word"){let n=await V(e,r.target),i=e.fs.resolvePath(e.state.cwd,n);try{s=await e.fs.readFile(i)}catch{}}return s}async function bn(e,t,s,r="",n){e.state.callDepth++,e.state.callDepth>e.limits.maxCallDepth&&(e.state.callDepth--,at(`${t.name}: maximum recursion depth (${e.limits.maxCallDepth}) exceeded, increase executionLimits.maxCallDepth`,"recursion")),e.state.funcNameStack||(e.state.funcNameStack=[]),e.state.callLineStack||(e.state.callLineStack=[]),e.state.sourceStack||(e.state.sourceStack=[]),e.state.funcNameStack.unshift(t.name),e.state.callLineStack.unshift(n??e.state.currentLine),e.state.sourceStack.unshift(t.sourceFile??"main"),e.state.localScopes.push(new Map),e.state.localExportedVars||(e.state.localExportedVars=[]),e.state.localExportedVars.push(new Set);let i=new Map;for(let u=0;u{let u=e.state.localScopes.length-1,c=e.state.localScopes.pop();if(c)for(let[f,d]of c)d===void 0?e.state.env.delete(f):e.state.env.set(f,d);if(cl(e,u),e.state.fullyUnsetLocals)for(let[f,d]of e.state.fullyUnsetLocals.entries())d===u&&e.state.fullyUnsetLocals.delete(f);if(e.state.localExportedVars&&e.state.localExportedVars.length>0){let f=e.state.localExportedVars.pop();if(f)for(let d of f)e.state.exportedVars?.delete(d)}for(let[f,d]of i)d===void 0?e.state.env.delete(f):e.state.env.set(f,d);e.state.funcNameStack?.shift(),e.state.callLineStack?.shift(),e.state.sourceStack?.shift(),e.state.callDepth--},{targets:l,error:o}=await fl(e,t.redirections);if(o)return a(),_("",o,1);try{let u=await _f(e,t.redirections),c=r||u,f=await e.executeCommand(t.body,c);return a(),ue(e,f,t.redirections,l)}catch(u){if(a(),u instanceof ke){let c=_(u.stdout,u.stderr,u.exitCode);return ue(e,c,t.redirections,l)}throw u}}var pl=["!","[[","]]","case","do","done","elif","else","esac","fi","for","function","if","in","then","time","until","while","{","}"],Vr=[".",":","[","alias","bg","bind","break","builtin","caller","cd","command","compgen","complete","compopt","continue","declare","dirs","disown","echo","enable","eval","exec","exit","export","false","fc","fg","getopts","hash","help","history","jobs","kill","let","local","logout","mapfile","popd","printf","pushd","pwd","read","readarray","readonly","return","set","shift","shopt","source","suspend","test","times","trap","true","type","typeset","ulimit","umask","unalias","unset","wait"],xf=["autocd","assoc_expand_once","cdable_vars","cdspell","checkhash","checkjobs","checkwinsize","cmdhist","compat31","compat32","compat40","compat41","compat42","compat43","compat44","complete_fullquote","direxpand","dirspell","dotglob","execfail","expand_aliases","extdebug","extglob","extquote","failglob","force_fignore","globasciiranges","globstar","gnu_errfmt","histappend","histreedit","histverify","hostcomplete","huponexit","inherit_errexit","interactive_comments","lastpipe","lithist","localvar_inherit","localvar_unset","login_shell","mailwarn","no_empty_cmd_completion","nocaseglob","nocasematch","nullglob","progcomp","progcomp_alias","promptvars","restricted_shell","shift_verbose","sourcepath","xpg_echo"],Cf=Vr;async function zr(e,t){let s=[],r=null,n="",i="",a=null,l=!1,o=!1,u=!1,c=null,f=null,d=null,h=[],m=["alias","arrayvar","binding","builtin","command","directory","disabled","enabled","export","file","function","group","helptopic","hostname","job","keyword","running","service","setopt","shopt","signal","stopped","user","variable"];for(let w=0;w=t.length)return N(`compgen: -A: option requires an argument -`,2);let A=t[w];if(!m.includes(A))return N(`compgen: ${A}: invalid action name -`,2);s.push(A)}else if(S==="-W"){if(w++,w>=t.length)return N(`compgen: -W: option requires an argument -`,2);r=t[w]}else if(S==="-P"){if(w++,w>=t.length)return N(`compgen: -P: option requires an argument -`,2);n=t[w]}else if(S==="-S"){if(w++,w>=t.length)return N(`compgen: -S: option requires an argument -`,2);i=t[w]}else if(S==="-o"){if(w++,w>=t.length)return N(`compgen: -o: option requires an argument -`,2);let A=t[w];if(A==="plusdirs")l=!0;else if(A==="dirnames")o=!0;else if(A==="default")u=!0;else if(!(A==="filenames"||A==="nospace"||A==="bashdefault"||A==="noquote"))return N(`compgen: ${A}: invalid option name -`,2)}else if(S==="-F"){if(w++,w>=t.length)return N(`compgen: -F: option requires an argument -`,2);f=t[w]}else if(S==="-C"){if(w++,w>=t.length)return N(`compgen: -C: option requires an argument -`,2);d=t[w]}else if(S==="-X"){if(w++,w>=t.length)return N(`compgen: -X: option requires an argument -`,2);c=t[w]}else if(S==="-G"){if(w++,w>=t.length)return N(`compgen: -G: option requires an argument -`,2)}else if(S==="--"){h.push(...t.slice(w+1));break}else S.startsWith("-")||h.push(S)}a=h[0]??null;let p=[];if(o){let w=await Fr(e,a);p.push(...w)}if(u){let w=await hl(e,a);p.push(...w)}for(let w of s)if(w==="variable"){let S=Df(e,a);p.push(...S)}else if(w==="export"){let S=Rf(e,a);p.push(...S)}else if(w==="function"){let S=If(e,a);p.push(...S)}else if(w==="builtin"){let S=Of(a);p.push(...S)}else if(w==="keyword"){let S=Tf(a);p.push(...S)}else if(w==="alias"){let S=Lf(e,a);p.push(...S)}else if(w==="shopt"){let S=Mf(a);p.push(...S)}else if(w==="helptopic"){let S=Wf(a);p.push(...S)}else if(w==="directory"){let S=await Fr(e,a);p.push(...S)}else if(w==="file"){let S=await hl(e,a);p.push(...S)}else if(w==="user"){let S=Ff(a);p.push(...S)}else if(w==="command"){let S=await Vf(e,a);p.push(...S)}if(r!==null)try{let w=await zf(e,r),S=Bf(e,w);for(let A of S)(a===null||A.startsWith(a))&&p.push(A)}catch{return _("","",1)}if(l){let w=await Fr(e,a);for(let S of w)p.includes(S)||p.push(S)}let y="";if(f!==null){let w=e.state.functions.get(f);if(w){let S=new Map;S.set("COMP_WORDS__length",e.state.env.get("COMP_WORDS__length")),e.state.env.set("COMP_WORDS__length","0"),S.set("COMP_CWORD",e.state.env.get("COMP_CWORD")),e.state.env.set("COMP_CWORD","-1"),S.set("COMP_LINE",e.state.env.get("COMP_LINE")),e.state.env.set("COMP_LINE",""),S.set("COMP_POINT",e.state.env.get("COMP_POINT")),e.state.env.set("COMP_POINT","0");let A=new Map;for(let R of e.state.env.keys())(R==="COMPREPLY"||R.startsWith("COMPREPLY_")||R==="COMPREPLY__length")&&(A.set(R,e.state.env.get(R)),e.state.env.delete(R));let $=["compgen",h[0]??"",""];try{let R=await bn(e,w,$,"");if(R.exitCode!==0)return Yt(e,S),Yt(e,A),_("",R.stderr,1);y=R.stdout;let C=qf(e);p.push(...C)}catch{return Yt(e,S),Yt(e,A),_("","",1)}Yt(e,S),Yt(e,A)}}if(d!==null)try{let w=Ce(d),S=await e.executeScript(w);if(S.exitCode!==0)return _("",S.stderr,S.exitCode);if(S.stdout){let A=S.stdout.split(` -`);for(let $ of A)$.length>0&&p.push($)}}catch(w){if(w.name==="ParseException")return N(`compgen: -C: ${w.message} -`,2);throw w}let b=p;if(c!==null){let w=c.startsWith("!"),S=w?c.slice(1):c;b=p.filter(A=>{let $=Ht(A,S,!1,!0);return w?$:!$})}if(b.length===0&&a!==null)return _(y,"",1);let v=b.map(w=>`${n}${w}${i}`).join(` -`),E=y+(v?`${v} -`:"");return H(E)}function Df(e,t){let s=new Set;for(let n of e.state.env.keys()){if(n.includes("_")&&/^[a-zA-Z_][a-zA-Z0-9_]*_\d+$/.test(n)||n.endsWith("__length"))continue;let i=n.split("_")[0];/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(n)?s.add(n):i&&/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(i)&&e.state.env.has(`${i}__length`)&&s.add(i)}let r=Array.from(s);return t!==null&&(r=r.filter(n=>n.startsWith(t))),r.sort()}function Rf(e,t){let s=e.state.exportedVars??new Set,r=Array.from(s);return t!==null&&(r=r.filter(n=>n.startsWith(t))),r=r.filter(n=>n.includes("_")&&/^[a-zA-Z_][a-zA-Z0-9_]*_\d+$/.test(n)||n.endsWith("__length")?!1:e.state.env.has(n)),r.sort()}function If(e,t){let s=Array.from(e.state.functions.keys());return t!==null&&(s=s.filter(r=>r.startsWith(t))),s.sort()}function Of(e){let t=[...Vr];return e!==null&&(t=t.filter(s=>s.startsWith(e))),t.sort()}function Tf(e){let t=[...pl];return e!==null&&(t=t.filter(s=>s.startsWith(e))),t.sort()}function Lf(e,t){let s=[];for(let n of e.state.env.keys())if(n.startsWith("BASH_ALIAS_")){let i=n.slice(11);s.push(i)}let r=s;return t!==null&&(r=r.filter(n=>n.startsWith(t))),r.sort()}function Mf(e){let t=[...xf];return e!==null&&(t=t.filter(s=>s.startsWith(e))),t.sort()}function Wf(e){let t=[...Cf];return e!==null&&(t=t.filter(s=>s.startsWith(e))),t.sort()}async function Fr(e,t){let s=[];try{let r=e.state.cwd,n=t??"";if(t){let a=t.lastIndexOf("/");if(a!==-1){let l=t.slice(0,a)||"/";n=t.slice(a+1),l.startsWith("/")?r=l:r=`${e.state.cwd}/${l}`}}let i=await e.fs.readdir(r);for(let a of i){let l=`${r}/${a}`;try{if((await e.fs.stat(l)).isDirectory&&(!n||a.startsWith(n)))if(t?.includes("/")){let u=t.lastIndexOf("/"),c=t.slice(0,u+1);s.push(c+a)}else s.push(a)}catch{}}}catch{}return s.sort()}async function hl(e,t){let s=[];try{let r=e.state.cwd,n=t??"";if(t){let a=t.lastIndexOf("/");if(a!==-1){let l=t.slice(0,a)||"/";n=t.slice(a+1),l.startsWith("/")?r=l:r=`${e.state.cwd}/${l}`}}let i=await e.fs.readdir(r);for(let a of i)if(!n||a.startsWith(n))if(t?.includes("/")){let l=t.lastIndexOf("/"),o=t.slice(0,l+1);s.push(o+a)}else s.push(a)}catch{}return s.sort()}function Ff(e){return["root","nobody"]}async function Vf(e,t){let s=new Set;for(let i of Vr)s.add(i);for(let i of e.state.functions.keys())s.add(i);for(let i of e.state.env.keys())i.startsWith("BASH_ALIAS_")&&s.add(i.slice(11));for(let i of pl)s.add(i);let r=e.state.env.get("PATH")??"/usr/bin:/bin";for(let i of r.split(":"))if(i)try{let a=await e.fs.readdir(i);for(let l of a)s.add(l)}catch{}let n=Array.from(s);return t!==null&&(n=n.filter(i=>i.startsWith(t))),n.sort()}async function zf(e,t){let r=new q().parseWordFromString(t,!1,!1);return await V(e,r)}function Bf(e,t){let s=e.state.env.get("IFS")??` -`;if(s.length===0)return[t];let r=new Set(s.split("")),n=[],i="",a=0;for(;a0&&(n.push(i),i=""),a++):(i+=l,a++)}return i.length>0&&n.push(i),n}function Yt(e,t){for(let[s,r]of t)r===void 0?e.state.env.delete(s):e.state.env.set(s,r)}function qf(e){let t=[];if(e.state.env.get("COMPREPLY__length")!==void 0){let n=B(e,"COMPREPLY");for(let[,i]of n)t.push(i)}else{let n=e.state.env.get("COMPREPLY");n!==void 0&&t.push(n)}return t}var jf=["bashdefault","default","dirnames","filenames","noquote","nosort","nospace","plusdirs"];function qr(e,t){e.state.completionSpecs||(e.state.completionSpecs=new Map);let s=!1,r=!1,n=!1,i,a,l,o=[],u=[],c=[];for(let f=0;f=t.length)return N(`complete: -W: option requires an argument -`,2);i=t[f]}else if(d==="-F"){if(f++,f>=t.length)return N(`complete: -F: option requires an argument -`,2);a=t[f]}else if(d==="-o"){if(f++,f>=t.length)return N(`complete: -o: option requires an argument -`,2);let h=t[f];if(!jf.includes(h))return N(`complete: ${h}: invalid option name -`,2);o.push(h)}else if(d==="-A"){if(f++,f>=t.length)return N(`complete: -A: option requires an argument -`,2);u.push(t[f])}else if(d==="-C"){if(f++,f>=t.length)return N(`complete: -C: option requires an argument -`,2);l=t[f]}else if(d==="-G"){if(f++,f>=t.length)return N(`complete: -G: option requires an argument -`,2)}else if(d==="-P"){if(f++,f>=t.length)return N(`complete: -P: option requires an argument -`,2)}else if(d==="-S"){if(f++,f>=t.length)return N(`complete: -S: option requires an argument -`,2)}else if(d==="-X"){if(f++,f>=t.length)return N(`complete: -X: option requires an argument -`,2)}else if(d==="--"){c.push(...t.slice(f+1));break}else d.startsWith("-")||c.push(d)}if(r){if(c.length===0)return e.state.completionSpecs.clear(),H("");for(let f of c)e.state.completionSpecs.delete(f);return H("")}if(s)return c.length===0?Br(e):Br(e,c);if(t.length===0||c.length===0&&!i&&!a&&!l&&o.length===0&&u.length===0&&!n)return Br(e);if(a&&c.length===0&&!n)return N(`complete: -F: option requires a command name -`,2);if(n){let f={isDefault:!0};return i!==void 0&&(f.wordlist=i),a!==void 0&&(f.function=a),l!==void 0&&(f.command=l),o.length>0&&(f.options=o),u.length>0&&(f.actions=u),e.state.completionSpecs.set("__default__",f),H("")}for(let f of c){let d=Object.create(null);i!==void 0&&(d.wordlist=i),a!==void 0&&(d.function=a),l!==void 0&&(d.command=l),o.length>0&&(d.options=o),u.length>0&&(d.actions=u),e.state.completionSpecs.set(f,d)}return H("")}function Br(e,t){let s=e.state.completionSpecs;if(!s||s.size===0){if(t&&t.length>0){let i="";for(let a of t)i+=`complete: ${a}: no completion specification -`;return _("",i,1)}return H("")}let r=[],n=t||Array.from(s.keys());for(let i of n){if(i==="__default__")continue;let a=s.get(i);if(!a){if(t)return _(r.join(` -`)+(r.length>0?` -`:""),`complete: ${i}: no completion specification -`,1);continue}let l="complete";if(a.options)for(let o of a.options)l+=` -o ${o}`;if(a.actions)for(let o of a.actions)l+=` -A ${o}`;a.wordlist!==void 0&&(a.wordlist.includes(" ")||a.wordlist.includes("'")?l+=` -W '${a.wordlist}'`:l+=` -W ${a.wordlist}`),a.function!==void 0&&(l+=` -F ${a.function}`),a.isDefault&&(l+=" -D"),l+=` ${i}`,r.push(l)}return r.length===0?H(""):H(`${r.join(` -`)} -`)}var ml=["bashdefault","default","dirnames","filenames","noquote","nosort","nospace","plusdirs"];function jr(e,t){e.state.completionSpecs||(e.state.completionSpecs=new Map);let s=!1,r=!1,n=[],i=[],a=[];for(let l=0;l=t.length)return N(`compopt: -o: option requires an argument -`,2);let u=t[l];if(!ml.includes(u))return N(`compopt: ${u}: invalid option name -`,2);n.push(u)}else if(o==="+o"){if(l++,l>=t.length)return N(`compopt: +o: option requires an argument -`,2);let u=t[l];if(!ml.includes(u))return N(`compopt: ${u}: invalid option name -`,2);i.push(u)}else if(o==="--"){a.push(...t.slice(l+1));break}else!o.startsWith("-")&&!o.startsWith("+")&&a.push(o)}if(s){let l=e.state.completionSpecs.get("__default__")??{isDefault:!0},o=new Set(l.options??[]);for(let u of n)o.add(u);for(let u of i)o.delete(u);return l.options=o.size>0?Array.from(o):void 0,e.state.completionSpecs.set("__default__",l),H("")}if(r){let l=e.state.completionSpecs.get("__empty__")??{},o=new Set(l.options??[]);for(let u of n)o.add(u);for(let u of i)o.delete(u);return l.options=o.size>0?Array.from(o):void 0,e.state.completionSpecs.set("__empty__",l),H("")}if(a.length>0){for(let l of a){let o=e.state.completionSpecs.get(l)??{},u=new Set(o.options??[]);for(let c of n)u.add(c);for(let c of i)u.delete(c);o.options=u.size>0?Array.from(u):void 0,e.state.completionSpecs.set(l,o)}return H("")}return N(`compopt: not currently executing completion function -`,1)}function Ur(e,t){if(e.state.loopDepth===0){if(e.state.parentHasLoopContext)throw new Et;return K}if(t.length>1)throw new Z(1,"",`bash: continue: too many arguments -`);let s=1;if(t.length>0){let r=Number.parseInt(t[0],10);if(Number.isNaN(r)||r<1)throw new Z(1,"",`bash: continue: ${t[0]}: numeric argument required -`);s=r}throw new Te(s)}function de(e,t){let s=e.state.env.get("HOME")||"/home/user";return t.split(":").map(i=>i==="~"?s:i==="~root"?"/root":i.startsWith("~/")?s+i.slice(1):i.startsWith("~root/")?`/root${i.slice(5)}`:i).join(":")}function Zr(e){for(let t=0;t{let h=e.state.env.get(`${i}_${d}`)??"",m=Qr(h);return`['${d}']=${m}`});s+=`declare -A ${i}=(${f.join(" ")}) -`}continue}let o=he(e,i);if(o.length>0){let c=o.map(f=>{let d=e.state.env.get(`${i}_${f}`)??"";return`[${f}]=${Lt(d)}`});s+=`declare -a ${i}=(${c.join(" ")}) -`;continue}if(e.state.env.has(`${i}__length`)){s+=`declare -a ${i}=() -`;continue}let u=e.state.env.get(i);if(u!==void 0)s+=`declare ${a} ${i}=${Hr(u)} -`;else{let c=e.state.declaredVars?.has(i),f=e.state.localVarDepth?.has(i);c||f?s+=`declare ${a} ${i} -`:(r+=`bash: declare: ${i}: not found -`,n=!0)}}return _(s,r,n?1:0)}function wl(e,t){let{filterExport:s,filterReadonly:r,filterNameref:n,filterIndexedArray:i,filterAssocArray:a}=t,l=s||r||n||i||a,o="",u=new Set;for(let f of e.state.env.keys()){if(f.startsWith("BASH_"))continue;if(f.endsWith("__length")){let h=f.slice(0,-8);u.add(h);continue}let d=f.lastIndexOf("_");if(d>0){let h=f.slice(0,d),m=f.slice(d+1);if(/^\d+$/.test(m)||e.state.associativeArrays?.has(h)){u.add(h);continue}}u.add(f)}if(e.state.localVarDepth)for(let f of e.state.localVarDepth.keys())u.add(f);if(e.state.associativeArrays)for(let f of e.state.associativeArrays)u.add(f);let c=Array.from(u).sort();for(let f of c){let d=gl(e,f),h=e.state.associativeArrays?.has(f),m=he(e,f),p=!h&&(m.length>0||e.state.env.has(`${f}__length`));if(l&&(a&&!h||i&&!p||s&&!e.state.exportedVars?.has(f)||r&&!e.state.readonlyVars?.has(f)||n&&!te(e,f)))continue;if(h){let b=Ge(e,f);if(b.length===0)o+=`declare -A ${f}=() -`;else{let v=b.map(E=>{let w=e.state.env.get(`${f}_${E}`)??"",S=Qr(w);return`['${E}']=${S}`});o+=`declare -A ${f}=(${v.join(" ")}) -`}continue}if(m.length>0){let b=m.map(v=>{let E=e.state.env.get(`${f}_${v}`)??"";return`[${v}]=${Lt(E)}`});o+=`declare -a ${f}=(${b.join(" ")}) -`;continue}if(e.state.env.has(`${f}__length`)){o+=`declare -a ${f}=() -`;continue}let y=e.state.env.get(f);y!==void 0&&(o+=`declare ${d} ${f}=${Hr(y)} -`)}return H(o)}function El(e){let t="",s=Array.from(e.state.associativeArrays??[]).sort();for(let r of s){let n=Ge(e,r);if(n.length===0)t+=`declare -A ${r}=() -`;else{let i=n.map(a=>{let l=e.state.env.get(`${r}_${a}`)??"",o=Qr(l);return`['${a}']=${o}`});t+=`declare -A ${r}=(${i.join(" ")}) -`}}return H(t)}function bl(e){let t="",s=new Set;for(let n of e.state.env.keys()){if(n.startsWith("BASH_"))continue;if(n.endsWith("__length")){let a=n.slice(0,-8);e.state.associativeArrays?.has(a)||s.add(a);continue}let i=n.lastIndexOf("_");if(i>0){let a=n.slice(0,i),l=n.slice(i+1);/^\d+$/.test(l)&&(e.state.associativeArrays?.has(a)||s.add(a))}}let r=Array.from(s).sort();for(let n of r){let i=he(e,n);if(i.length===0)t+=`declare -a ${n}=() -`;else{let a=i.map(l=>{let o=e.state.env.get(`${n}_${l}`)??"";return`[${l}]=${Lt(o)}`});t+=`declare -a ${n}=(${a.join(" ")}) -`}}return H(t)}function vl(e){let t="",s=new Set;for(let n of e.state.env.keys()){if(n.startsWith("BASH_"))continue;if(n.endsWith("__length")){let a=n.slice(0,-8);s.add(a);continue}let i=n.lastIndexOf("_");if(i>0){let a=n.slice(0,i),l=n.slice(i+1);if(/^\d+$/.test(l)||e.state.associativeArrays?.has(a)){s.add(a);continue}}s.add(n)}let r=Array.from(s).sort();for(let n of r){if(e.state.associativeArrays?.has(n)||he(e,n).length>0||e.state.env.has(`${n}__length`))continue;let l=e.state.env.get(n);l!==void 0&&(t+=`${n}=${vn(l)} -`)}return H(t)}function Kr(e,t){e.state.integerVars??=new Set,e.state.integerVars.add(t)}function ws(e,t){return e.state.integerVars?.has(t)??!1}function Xr(e,t){e.state.lowercaseVars??=new Set,e.state.lowercaseVars.add(t),e.state.uppercaseVars?.delete(t)}function Uf(e,t){return e.state.lowercaseVars?.has(t)??!1}function Yr(e,t){e.state.uppercaseVars??=new Set,e.state.uppercaseVars.add(t),e.state.lowercaseVars?.delete(t)}function Zf(e,t){return e.state.uppercaseVars?.has(t)??!1}function Jt(e,t,s){return Uf(e,t)?s.toLowerCase():Zf(e,t)?s.toUpperCase():s}async function Sl(e,t){try{let s=new q,r=Y(s,t),n=await T(e,r.expression);return String(n)}catch{return"0"}}function Gf(e){let t=e.match(/^[a-zA-Z_][a-zA-Z0-9_]*/);if(!t)return null;let s=t[0],r=s.length;if(e[r]!=="[")return null;let n=0,i=r+1;for(;r0&&!y,w=C=>{if(!E)return;let F=e.state.localScopes[e.state.localScopes.length-1];F.has(C)||F.set(C,e.state.env.get(C))},S=C=>{if(!E)return;let F=e.state.localScopes[e.state.localScopes.length-1];F.has(C)||F.set(C,e.state.env.get(C));let k=`${C}_`;for(let D of e.state.env.keys())D.startsWith(k)&&!D.includes("__")&&(F.has(D)||F.set(D,e.state.env.get(D)));let x=`${C}__length`;e.state.env.has(x)&&!F.has(x)&&F.set(x,e.state.env.get(x))},A=C=>{E&&Ct(e,C)};if(p){if(b.length===0){let k=Array.from(e.state.functions.keys()).sort(),x="";for(let D of k)x+=`declare -f ${D} -`;return H(x)}let C=!0,F="";for(let k of b)e.state.functions.has(k)?F+=`${k} -`:C=!1;return _(F,"",C?0:1)}if(m){if(b.length===0){let F="",k=Array.from(e.state.functions.keys()).sort();for(let x of k)F+=`${x} () -{ - # function body -} -`;return H(F)}let C=!0;for(let F of b)e.state.functions.has(F)||(C=!1);return _("","",C?0:1)}if(a&&b.length>0)return yl(e,b);if(a&&b.length===0)return wl(e,{filterExport:i,filterReadonly:n,filterNameref:l,filterIndexedArray:s,filterAssocArray:r});if(b.length===0&&r&&!a)return El(e);if(b.length===0&&s&&!a)return bl(e);if(b.length===0&&!a)return vl(e);let $="",R=0;for(let C of b){let F=C.match(/^([a-zA-Z_][a-zA-Z0-9_]*)=\((.*)\)$/s);if(F&&!u){let P=F[1],O=F[2];if(r&&he(e,P).length>0){$+=`bash: declare: ${P}: cannot convert indexed to associative array -`,R=1;continue}if((s||!r&&!s)&&e.state.associativeArrays?.has(P)){$+=`bash: declare: ${P}: cannot convert associative to indexed array -`,R=1;continue}if(S(P),r&&(e.state.associativeArrays??=new Set,e.state.associativeArrays.add(P)),tt(e,P),e.state.env.delete(P),e.state.env.delete(`${P}__length`),r&&O.includes("[")){let z=mn(O);for(let[U,ee]of z){let fe=de(e,ee);e.state.env.set(`${P}_${U}`,fe)}}else if(r){let z=ot(O);for(let U=0;U/^\[[^\]]+\]=/.test(ee))){let ee=0;for(let fe of z){let ge=fe.match(/^\[([^\]]+)\]=(.*)$/);if(ge){let Re=ge[1],Vt=ge[2],kc=de(e,Vt),as;if(/^-?\d+$/.test(Re))as=Number.parseInt(Re,10);else try{let Nc=new q,_c=Y(Nc,Re);as=await T(e,_c.expression)}catch{as=0}e.state.env.set(`${P}_${as}`,kc),ee=as+1}else{let Re=de(e,fe);e.state.env.set(`${P}_${ee}`,Re),ee++}}}else{for(let ee=0;ee=fe&&e.state.env.set(`${P}__length`,String(ee+1)),A(P),n&&De(e,P),i&&Qe(e,P);continue}let x=C.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\+=\((.*)\)$/s);if(x&&!u){let P=x[1],O=x[2],z=ye(e,P);if(z)return z;S(P);let U=ot(O);if(e.state.associativeArrays?.has(P)){let ee=mn(O);for(let[fe,ge]of ee){let Re=de(e,ge);e.state.env.set(`${P}_${fe}`,Re)}}else{let ee=he(e,P),fe=0,ge=e.state.env.get(P);ee.length===0&&ge!==void 0?(e.state.env.set(`${P}_0`,ge),e.state.env.delete(P),fe=1):ee.length>0&&(fe=Math.max(...ee)+1);for(let Vt=0;Vt0||e.state.associativeArrays?.has(P);if(ws(e,P)){let fe=e.state.env.get(P)??"0",ge=parseInt(fe,10)||0,Re=parseInt(await Sl(e,O),10)||0;O=String(ge+Re),e.state.env.set(P,O)}else if(ee){O=Jt(e,P,O);let fe=`${P}_0`,ge=e.state.env.get(fe)??"";e.state.env.set(fe,ge+O)}else{O=Jt(e,P,O);let fe=e.state.env.get(P)??"";e.state.env.set(P,fe+O)}A(P),n&&De(e,P),i&&Qe(e,P),e.state.options.allexport&&!c&&(e.state.exportedVars=e.state.exportedVars||new Set,e.state.exportedVars.add(P));continue}if(C.includes("=")){let P=C.indexOf("="),O=C.slice(0,P),z=C.slice(P+1);if(!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(O)){$+=`bash: typeset: \`${O}': not a valid identifier -`,R=1;continue}let U=ye(e,O);if(U)return U;if(w(O),l){if(z!==""&&!/^[a-zA-Z_][a-zA-Z0-9_]*(\[.+\])?$/.test(z)){$+=`bash: declare: \`${z}': invalid variable name for name reference -`,R=1;continue}e.state.env.set(O,z),pt(e,O),z!==""&&Zs(e,z)&&Ar(e,O),A(O),n&&De(e,O),i&&Qe(e,O);continue}if(f&&Kr(e,O),d&&Xr(e,O),h&&Yr(e,O),ws(e,O)&&(z=await Sl(e,z)),z=Jt(e,O,z),te(e,O)){let ee=$e(e,O);ee&&ee!==O?e.state.env.set(ee,z):e.state.env.set(O,z)}else e.state.env.set(O,z);A(O),n&&De(e,O),i&&Qe(e,O),e.state.options.allexport&&!c&&(e.state.exportedVars=e.state.exportedVars||new Set,e.state.exportedVars.add(O))}else{let P=C;if(!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(P)){$+=`bash: typeset: \`${P}': not a valid identifier -`,R=1;continue}if(s||r?S(P):w(P),l){pt(e,P);let z=e.state.env.get(P);z!==void 0&&z!==""&&!/^[a-zA-Z_][a-zA-Z0-9_]*(\[.+\])?$/.test(z)?Wa(e,P):z&&Zs(e,z)&&Ar(e,P),A(P),n&&De(e,P),i&&Qe(e,P);continue}if(f&&Kr(e,P),d&&Xr(e,P),h&&Yr(e,P),r){if(he(e,P).length>0){$+=`bash: declare: ${P}: cannot convert indexed to associative array -`,R=1;continue}e.state.associativeArrays??=new Set,e.state.associativeArrays.add(P)}let O=Array.from(e.state.env.keys()).some(z=>z.startsWith(`${P}_`)&&!z.startsWith(`${P}__length`));!e.state.env.has(P)&&!O&&(s||r?e.state.env.set(`${P}__length`,"0"):(e.state.declaredVars??=new Set,e.state.declaredVars.add(P))),A(P),n&&De(e,P),i&&Qe(e,P)}}return _("",$,R)}async function ei(e,t){let s=!1,r=!1,n=!1,i=[];for(let a=0;a0&&(y=Math.max(...p)+1);for(let E=0;Er&&r!=="."),s=[];for(let r of t)r===".."?s.pop():s.push(r);return`/${s.join("/")}`}async function si(e,t){let s=ti(e),r;for(let l=0;lo);l.pop(),n=`/${l.join("/")}`}else r==="."?n=e.state.cwd:r.startsWith("~")?n=(e.state.env.get("HOME")||"/")+r.slice(1):n=`${e.state.cwd}/${r}`;n=Hf(n);try{if(!(await e.fs.stat(n)).isDirectory)return N(`bash: pushd: ${r}: Not a directory -`,1)}catch{return N(`bash: pushd: ${r}: No such file or directory -`,1)}s.unshift(e.state.cwd),e.state.previousDir=e.state.cwd,e.state.cwd=n,e.state.env.set("PWD",n),e.state.env.set("OLDPWD",e.state.previousDir);let i=e.state.env.get("HOME")||"",a=`${[n,...s].map(l=>Es(l,i)).join(" ")} -`;return H(a)}function ni(e,t){let s=ti(e);for(let a of t)if(a!=="--")return a.startsWith("-")&&a!=="-"?N(`bash: popd: ${a}: invalid option -`,2):N(`bash: popd: too many arguments -`,2);if(s.length===0)return N(`bash: popd: directory stack empty -`,1);let r=s.shift();if(!r)return N(`bash: popd: directory stack empty -`,1);e.state.previousDir=e.state.cwd,e.state.cwd=r,e.state.env.set("PWD",r),e.state.env.set("OLDPWD",e.state.previousDir);let n=e.state.env.get("HOME")||"",i=`${[r,...s].map(a=>Es(a,n)).join(" ")} -`;return H(i)}function ri(e,t){let s=ti(e),r=!1,n=!1,i=!1,a=!1;for(let c of t)if(c!=="--")if(c.startsWith("-"))for(let f of c.slice(1))if(f==="c")r=!0;else if(f==="l")n=!0;else if(f==="p")i=!0;else if(f==="v")i=!0,a=!0;else return N(`bash: dirs: -${f}: invalid option -`,2);else return N(`bash: dirs: too many arguments -`,1);if(r)return e.state.directoryStack=[],K;let l=[e.state.cwd,...s],o=e.state.env.get("HOME")||"",u;return a?(u=l.map((c,f)=>{let d=n?c:Es(c,o);return` ${f} ${d}`}).join(` -`),u+=` -`):i?u=l.map(c=>n?c:Es(c,o)).join(` -`)+` -`:u=l.map(c=>n?c:Es(c,o)).join(" ")+` -`,H(u)}async function Sn(e,t,s){let r=t;if(r.length>0){let l=r[0];if(l==="--")r=r.slice(1);else if(l.startsWith("-")&&l!=="-"&&l.length>1)return N(`bash: eval: ${l}: invalid option -eval: usage: eval [arg ...] -`,2)}if(r.length===0)return K;let n=r.join(" ");if(n.trim()==="")return K;let i=e.state.groupStdin,a=s??e.state.groupStdin;a!==void 0&&(e.state.groupStdin=a);try{let l=Ce(n);return await e.executeScript(l)}catch(l){if(l instanceof Oe||l instanceof Te||l instanceof ke||l instanceof Z)throw l;if(l.name==="ParseException")return N(`bash: eval: ${l.message} -`);throw l}finally{e.state.groupStdin=i}}function ii(e,t){let s,r="";if(t.length===0)s=e.state.lastExitCode;else{let n=t[0],i=Number.parseInt(n,10);n===""||Number.isNaN(i)||!/^-?\d+$/.test(n)?(r=`bash: exit: ${n}: numeric argument required -`,s=2):s=(i%256+256)%256}throw new Z(s,"",r)}function ai(e,t){let s=!1,r=[];for(let a of t)a==="-n"?s=!0:a==="-p"||a==="--"||r.push(a);if(r.length===0&&!s){let a="",l=e.state.exportedVars??new Set,o=Array.from(l).sort();for(let u of o){let c=e.state.env.get(u);if(c!==void 0){let f=c.replace(/\\/g,"\\\\").replace(/"/g,'\\"');a+=`declare -x ${u}="${f}" -`}}return H(a)}if(s){for(let a of r){let l,o;if(a.includes("=")){let u=a.indexOf("=");l=a.slice(0,u),o=de(e,a.slice(u+1)),e.state.env.set(l,o)}else l=a;Hs(e,l)}return K}let n="",i=0;for(let a of r){let l,o,u=!1,c=a.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\+=(.*)$/);if(c)l=c[1],o=de(e,c[2]),u=!0;else if(a.includes("=")){let f=a.indexOf("=");l=a.slice(0,f),o=de(e,a.slice(f+1))}else l=a;if(!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(l)){n+=`bash: export: \`${a}': not a valid identifier -`,i=1;continue}if(o!==void 0)if(u){let f=e.state.env.get(l)??"";e.state.env.set(l,f+o)}else e.state.env.set(l,o);else e.state.env.has(l)||e.state.env.set(l,"");Qe(e,l)}return _("",n,i)}function An(e,t){if(t.length<2)return N(`bash: getopts: usage: getopts optstring name [arg ...] -`);let s=t[0],r=t[1],n=!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(r),i=s.startsWith(":"),a=i?s.slice(1):s,l;if(t.length>2)l=t.slice(2);else{let p=Number.parseInt(e.state.env.get("#")||"0",10);l=[];for(let y=1;y<=p;y++)l.push(e.state.env.get(String(y))||"")}let o=Number.parseInt(e.state.env.get("OPTIND")||"1",10);o<1&&(o=1);let u=Number.parseInt(e.state.env.get("__GETOPTS_CHARINDEX")||"0",10);if(e.state.env.set("OPTARG",""),o>l.length)return n||e.state.env.set(r,"?"),e.state.env.set("OPTIND",String(l.length+1)),e.state.env.set("__GETOPTS_CHARINDEX","0"),{exitCode:n?2:1,stdout:"",stderr:""};let c=l[o-1];if(!c||c==="-"||!c.startsWith("-"))return n||e.state.env.set(r,"?"),{exitCode:n?2:1,stdout:"",stderr:""};if(c==="--")return e.state.env.set("OPTIND",String(o+1)),e.state.env.set("__GETOPTS_CHARINDEX","0"),n||e.state.env.set(r,"?"),{exitCode:n?2:1,stdout:"",stderr:""};let f=u===0?1:u,d=c[f];if(!d)return e.state.env.set("OPTIND",String(o+1)),e.state.env.set("__GETOPTS_CHARINDEX","0"),An(e,t);let h=a.indexOf(d);if(h===-1){let p="";return i?e.state.env.set("OPTARG",d):p=`bash: illegal option -- ${d} -`,n||e.state.env.set(r,"?"),f+1=l.length){let p="";return i?(e.state.env.set("OPTARG",d),n||e.state.env.set(r,":")):(p=`bash: option requires an argument -- ${d} -`,n||e.state.env.set(r,"?")),e.state.env.set("OPTIND",String(o+1)),e.state.env.set("__GETOPTS_CHARINDEX","0"),{exitCode:n?2:0,stdout:"",stderr:p}}e.state.env.set("OPTARG",l[o]),e.state.env.set("OPTIND",String(o+2)),e.state.env.set("__GETOPTS_CHARINDEX","0")}else f+1=t.length)return N(`bash: hash: -p: option requires an argument -`,1);l=t[u],u++}else if(m.startsWith("-")&&m.length>1){for(let p of m.slice(1))if(p==="r")s=!0;else if(p==="d")r=!0;else if(p==="l")n=!0;else if(p==="t")a=!0;else return p==="p"?N(`bash: hash: -p: option requires an argument -`,1):N(`bash: hash: -${p}: invalid option -`,1);u++}else o.push(m),u++}if(s)return e.state.hashTable.clear(),K;if(r){if(o.length===0)return N(`bash: hash: -d: option requires an argument -`,1);let m=!1,p="";for(let y of o)e.state.hashTable.has(y)?e.state.hashTable.delete(y):(p+=`bash: hash: ${y}: not found -`,m=!0);return m?N(p,1):K}if(a){if(o.length===0)return N(`bash: hash: -t: option requires an argument -`,1);let m="",p=!1,y="";for(let b of o){let v=e.state.hashTable.get(b);v?o.length>1?m+=`${b} ${v} -`:m+=`${v} -`:(y+=`bash: hash: ${b}: not found -`,p=!0)}return p?{exitCode:1,stdout:m,stderr:y}:H(m)}if(i){if(o.length===0)return N(`bash: hash: usage: hash [-lr] [-p pathname] [-dt] [name ...] -`,1);let m=o[0];return e.state.hashTable.set(m,l),K}if(o.length===0){if(e.state.hashTable.size===0)return H(`hash: hash table empty -`);let m="";if(n)for(let[p,y]of e.state.hashTable)m+=`builtin hash -p ${y} ${p} -`;else{m=`hits command -`;for(let[,p]of e.state.hashTable)m+=` 1 ${p} -`}return H(m)}let c=!1,f="",h=(e.state.env.get("PATH")||"/usr/bin:/bin").split(":");for(let m of o){if(m.includes("/")){f+=`bash: hash: ${m}: cannot use / in name -`,c=!0;continue}let p=!1;for(let y of h){if(!y)continue;let b=`${y}/${m}`;if(await e.fs.exists(b)){e.state.hashTable.set(m,b),p=!0;break}}p||(f+=`bash: hash: ${m}: not found -`,c=!0)}return c?N(f,1):K}var Al=new Map([[":",[": [arguments]",`Null command. - No effect; the command does nothing. - Exit Status: - Always succeeds.`]],[".",[". filename [arguments]",`Execute commands from a file in the current shell. - Read and execute commands from FILENAME in the current shell. - The entries in $PATH are used to find the directory containing FILENAME. - Exit Status: - Returns the status of the last command executed in FILENAME.`]],["[",["[ arg... ]",`Evaluate conditional expression. - This is a synonym for the "test" builtin, but the last argument must - be a literal \`]', to match the opening \`['.`]],["alias",["alias [-p] [name[=value] ... ]",`Define or display aliases. - Without arguments, \`alias' prints the list of aliases in the reusable - form \`alias NAME=VALUE' on standard output. - Exit Status: - alias returns true unless a NAME is supplied for which no alias has been - defined.`]],["bg",["bg [job_spec ...]",`Move jobs to the background. - Place the jobs identified by each JOB_SPEC in the background, as if they - had been started with \`&'.`]],["break",["break [n]",`Exit for, while, or until loops. - Exit a FOR, WHILE or UNTIL loop. If N is specified, break N enclosing - loops. - Exit Status: - The exit status is 0 unless N is not greater than or equal to 1.`]],["builtin",["builtin [shell-builtin [arg ...]]",`Execute shell builtins. - Execute SHELL-BUILTIN with arguments ARGs without performing command - lookup. This is useful when you wish to reimplement a shell builtin - as a shell function, but need to execute the builtin within the function. - Exit Status: - Returns the exit status of SHELL-BUILTIN, or false if SHELL-BUILTIN is - not a shell builtin.`]],["caller",["caller [expr]",`Return the context of the current subroutine call. - Without EXPR, returns "$line $filename". With EXPR, returns - "$line $subroutine $filename"; this extra information can be used to - provide a stack trace. - Exit Status: - Returns 0 unless the shell is not executing a subroutine call or - EXPR is invalid.`]],["cd",["cd [-L|-P] [dir]",`Change the shell working directory. - Change the current directory to DIR. The default DIR is the value of the - HOME shell variable. - - The variable CDPATH defines the search path for the directory containing - DIR. Alternative directory names in CDPATH are separated by a colon (:). - A null directory name is the same as the current directory. If DIR begins - with a slash (/), then CDPATH is not used. - - If the directory is not found, and the shell option \`cdable_vars' is set, - the word is assumed to be a variable name. If that variable has a value, - its value is used for DIR. - - Options: - -L force symbolic links to be followed - -P use the physical directory structure without following symbolic - links - - The default is to follow symbolic links, as if \`-L' were specified. - - Exit Status: - Returns 0 if the directory is changed; non-zero otherwise.`]],["command",["command [-pVv] command [arg ...]",`Execute a simple command or display information about commands. - Runs COMMAND with ARGS suppressing shell function lookup, or display - information about the specified COMMANDs. - - Options: - -p use a default value for PATH that is guaranteed to find all of - the standard utilities - -v print a description of COMMAND similar to the \`type' builtin - -V print a more verbose description of each COMMAND - - Exit Status: - Returns exit status of COMMAND, or failure if COMMAND is not found.`]],["compgen",["compgen [-abcdefgjksuv] [-o option] [-A action] [-G globpat] [-W wordlist] [-F function] [-C command] [-X filterpat] [-P prefix] [-S suffix] [word]",`Display possible completions depending on the options. - Intended to be used from within a shell function generating possible - completions. If the optional WORD argument is supplied, matches against - WORD are generated. - Exit Status: - Returns success unless an invalid option is supplied or an error occurs.`]],["complete",["complete [-abcdefgjksuv] [-pr] [-DEI] [-o option] [-A action] [-G globpat] [-W wordlist] [-F function] [-C command] [-X filterpat] [-P prefix] [-S suffix] [name ...]",`Specify how arguments are to be completed. - For each NAME, specify how arguments are to be completed. - Exit Status: - Returns success unless an invalid option is supplied or an error occurs.`]],["continue",["continue [n]",`Resume for, while, or until loops. - Resumes the next iteration of the enclosing FOR, WHILE or UNTIL loop. - If N is specified, resumes the Nth enclosing loop. - Exit Status: - The exit status is 0 unless N is not greater than or equal to 1.`]],["declare",["declare [-aAfFgilnrtux] [-p] [name[=value] ...]",`Set variable values and attributes. - Declare variables and give them attributes. If no NAMEs are given, - display the attributes and values of all variables. - - Options: - -a to make NAMEs indexed arrays (if supported) - -A to make NAMEs associative arrays (if supported) - -i to make NAMEs have the \`integer' attribute - -l to convert the value of each NAME to lower case on assignment - -n make NAME a reference to the variable named by its value - -r to make NAMEs readonly - -t to make NAMEs have the \`trace' attribute - -u to convert the value of each NAME to upper case on assignment - -x to make NAMEs export - - Exit Status: - Returns success unless an invalid option is supplied or a variable - assignment error occurs.`]],["dirs",["dirs [-clpv] [+N] [-N]",`Display directory stack. - Display the list of currently remembered directories. Directories - find their way onto the list with the \`pushd' command; you can get - back up through the list with the \`popd' command. - Exit Status: - Returns success unless an invalid option is supplied or an error occurs.`]],["disown",["disown [-h] [-ar] [jobspec ...]",`Remove jobs from current shell. - Without any JOBSPECs, remove the current job.`]],["echo",["echo [-neE] [arg ...]",`Write arguments to the standard output. - Display the ARGs, separated by a single space character and followed by a - newline, on the standard output. - - Options: - -n do not append a newline - -e enable interpretation of the following backslash escapes - -E explicitly suppress interpretation of backslash escapes - - Exit Status: - Returns success unless a write error occurs.`]],["enable",["enable [-a] [-dnps] [-f filename] [name ...]",`Enable and disable shell builtins. - Enables and disables builtin shell commands. - Exit Status: - Returns success unless NAME is not a shell builtin or an error occurs.`]],["eval",["eval [arg ...]",`Execute arguments as a shell command. - Combine ARGs into a single string, use the result as input to the shell, - and execute the resulting commands. - Exit Status: - Returns exit status of command or success if command is null.`]],["exec",["exec [-cl] [-a name] [command [arguments ...]] [redirection ...]",`Replace the shell with the given command. - Execute COMMAND, replacing this shell with the specified program. - ARGUMENTS become the arguments to COMMAND. If COMMAND is not specified, - any redirections take effect in the current shell. - Exit Status: - Returns success unless COMMAND is not found or a redirection error occurs.`]],["exit",["exit [n]",`Exit the shell. - Exits the shell with a status of N. If N is omitted, the exit status - is that of the last command executed.`]],["export",["export [-fn] [name[=value] ...] or export -p",`Set export attribute for shell variables. - Marks each NAME for automatic export to the environment of subsequently - executed commands. If VALUE is supplied, assign VALUE before exporting. - - Options: - -f refer to shell functions - -n remove the export property from each NAME - -p display a list of all exported variables and functions - - Exit Status: - Returns success unless an invalid option is given or NAME is invalid.`]],["false",["false",`Return an unsuccessful result. - Exit Status: - Always fails.`]],["fc",["fc [-e ename] [-lnr] [first] [last] or fc -s [pat=rep] [command]",`Display or execute commands from the history list. - Exit Status: - Returns success or status of executed command.`]],["fg",["fg [job_spec]",`Move job to the foreground. - Place the job identified by JOB_SPEC in the foreground, making it the - current job.`]],["getopts",["getopts optstring name [arg]",`Parse option arguments. - Getopts is used by shell procedures to parse positional parameters - as options. - - OPTSTRING contains the option letters to be recognized; if a letter - is followed by a colon, the option is expected to have an argument, - which should be separated from it by white space. - Exit Status: - Returns success if an option is found; fails if the end of options is - encountered or an error occurs.`]],["hash",["hash [-lr] [-p pathname] [-dt] [name ...]",`Remember or display program locations. - Determine and remember the full pathname of each command NAME. - Exit Status: - Returns success unless NAME is not found or an invalid option is given.`]],["help",["help [-s] [pattern ...]",`Display information about builtin commands. - Displays brief summaries of builtin commands. If PATTERN is - specified, gives detailed help on all commands matching PATTERN, - otherwise the list of help topics is printed. - - Options: - -s output only a short usage synopsis for each topic matching - PATTERN - - Exit Status: - Returns success unless PATTERN is not found.`]],["history",["history [-c] [-d offset] [n] or history -anrw [filename] or history -ps arg [arg...]",`Display or manipulate the history list. - Display the history list with line numbers, prefixing each modified - entry with a \`*'. - Exit Status: - Returns success unless an invalid option is given or an error occurs.`]],["jobs",["jobs [-lnprs] [jobspec ...] or jobs -x command [args]",`Display status of jobs. - Lists the active jobs. - Exit Status: - Returns success unless an invalid option is given or an error occurs.`]],["kill",["kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]",`Send a signal to a job. - Send the processes identified by PID or JOBSPEC the signal named by - SIGSPEC or SIGNUM. - Exit Status: - Returns success unless an invalid option is given or an error occurs.`]],["let",["let arg [arg ...]",`Evaluate arithmetic expressions. - Evaluate each ARG as an arithmetic expression. Evaluation is done in - fixed-width integers with no check for overflow, though division by 0 - is trapped and flagged as an error. - Exit Status: - If the last ARG evaluates to 0, let returns 1; 0 is returned otherwise.`]],["local",["local [option] name[=value] ...",`Define local variables. - Create a local variable called NAME, and give it VALUE. OPTION can - be any option accepted by \`declare'. - - Local can only be used within a function; it makes the variable NAME - have a visible scope restricted to that function and its children. - Exit Status: - Returns success unless an invalid option is supplied, a variable - assignment error occurs, or the shell is not executing a function.`]],["logout",["logout [n]",`Exit a login shell. - Exits a login shell with exit status N. Returns an error if not executed - in a login shell.`]],["mapfile",["mapfile [-d delim] [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c quantum] [array]",`Read lines from the standard input into an indexed array variable. - Read lines from the standard input into the indexed array variable ARRAY, - or from file descriptor FD if the -u option is supplied. - - Options: - -d delim Use DELIM to terminate lines, instead of newline - -n count Copy at most COUNT lines - -O origin Begin assigning to ARRAY at index ORIGIN - -s count Discard the first COUNT lines read - -t Remove a trailing DELIM from each line read (default newline) - -u fd Read lines from file descriptor FD instead of standard input - - Exit Status: - Returns success unless an invalid option is given or ARRAY is readonly.`]],["popd",["popd [-n] [+N | -N]",`Remove directories from stack. - Removes entries from the directory stack. - Exit Status: - Returns success unless an invalid argument is supplied or the directory - change fails.`]],["printf",["printf [-v var] format [arguments]",`Formats and prints ARGUMENTS under control of the FORMAT. - - Options: - -v var assign the output to shell variable VAR rather than - display it on the standard output - - FORMAT is a character string which contains three types of objects: plain - characters, which are simply copied to standard output; character escape - sequences, which are converted and copied to the standard output; and - format specifications, each of which causes printing of the next successive - argument. - Exit Status: - Returns success unless an invalid option is given or a write or assignment - error occurs.`]],["pushd",["pushd [-n] [+N | -N | dir]",`Add directories to stack. - Adds a directory to the top of the directory stack, or rotates - the stack, making the new top of the stack the current working - directory. - Exit Status: - Returns success unless an invalid argument is supplied or the directory - change fails.`]],["pwd",["pwd [-LP]",`Print the name of the current working directory. - - Options: - -L print the value of $PWD if it names the current working - directory - -P print the physical directory, without any symbolic links - - By default, \`pwd' behaves as if \`-L' were specified. - Exit Status: - Returns 0 unless an invalid option is given or the current directory - cannot be read.`]],["read",["read [-ers] [-a array] [-d delim] [-i text] [-n nchars] [-N nchars] [-p prompt] [-t timeout] [-u fd] [name ...]",`Read a line from the standard input and split it into fields. - Reads a single line from the standard input, or from file descriptor FD - if the -u option is supplied. The line is split into fields as with word - splitting, and the first word is assigned to the first NAME, the second - word to the second NAME, and so on, with any leftover words assigned to - the last NAME. - Exit Status: - The return code is zero, unless end-of-file is encountered, read times out, - or an invalid file descriptor is supplied as the argument to -u.`]],["readarray",["readarray [-d delim] [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c quantum] [array]","Read lines from a file into an array variable.\n A synonym for `mapfile'."]],["readonly",["readonly [-aAf] [name[=value] ...] or readonly -p",`Mark shell variables as unchangeable. - Mark each NAME as read-only; the values of these NAMEs may not be - changed by subsequent assignment. - Exit Status: - Returns success unless an invalid option is given or NAME is invalid.`]],["return",["return [n]",`Return from a shell function. - Causes a function or sourced script to exit with the return value - specified by N. If N is omitted, the return status is that of the - last command executed within the function or script. - Exit Status: - Returns N, or failure if the shell is not executing a function or script.`]],["set",["set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]",`Set or unset values of shell options and positional parameters. - Change the value of shell attributes and positional parameters, or - display the names and values of shell variables. - - Options: - -e Exit immediately if a command exits with a non-zero status. - -u Treat unset variables as an error when substituting. - -x Print commands and their arguments as they are executed. - -o option-name - Set the variable corresponding to option-name - - Exit Status: - Returns success unless an invalid option is given.`]],["shift",["shift [n]",`Shift positional parameters. - Rename the positional parameters $N+1,$N+2 ... to $1,$2 ... If N is - not given, it is assumed to be 1. - Exit Status: - Returns success unless N is negative or greater than $#.`]],["shopt",["shopt [-pqsu] [-o] [optname ...]",`Set and unset shell options. - Change the setting of each shell option OPTNAME. Without any option - arguments, list each supplied OPTNAME, or all shell options if no - OPTNAMEs are given, with an indication of whether or not each is set. - - Options: - -o restrict OPTNAMEs to those defined for use with \`set -o' - -p print each shell option with an indication of its status - -q suppress output - -s enable (set) each OPTNAME - -u disable (unset) each OPTNAME - - Exit Status: - Returns success if OPTNAME is enabled; fails if an invalid option is - given or OPTNAME is disabled.`]],["source",["source filename [arguments]",`Execute commands from a file in the current shell. - Read and execute commands from FILENAME in the current shell. - The entries in $PATH are used to find the directory containing FILENAME. - Exit Status: - Returns the status of the last command executed in FILENAME.`]],["suspend",["suspend [-f]",`Suspend shell execution. - Suspend the execution of this shell until it receives a SIGCONT signal.`]],["test",["test [expr]",`Evaluate conditional expression. - Exits with a status of 0 (true) or 1 (false) depending on - the evaluation of EXPR. Expressions may be unary or binary. - Exit Status: - Returns success if EXPR evaluates to true; fails if EXPR evaluates to - false or an invalid argument is given.`]],["times",["times",`Display process times. - Prints the accumulated user and system times for the shell and all of its - child processes. - Exit Status: - Always succeeds.`]],["trap",["trap [-lp] [[arg] signal_spec ...]",`Trap signals and other events. - Defines and activates handlers to be run when the shell receives signals - or other conditions. - Exit Status: - Returns success unless a SIGSPEC is invalid or an invalid option is given.`]],["true",["true",`Return a successful result. - Exit Status: - Always succeeds.`]],["type",["type [-afptP] name [name ...]",`Display information about command type. - For each NAME, indicate how it would be interpreted if used as a - command name. - - Options: - -a display all locations containing an executable named NAME - -f suppress shell function lookup - -P force a PATH search for each NAME, even if it is an alias, - builtin, or function, and returns the name of the disk file - that would be executed - -p returns either the name of the disk file that would be executed, - or nothing if \`type -t NAME' would not return \`file' - -t output a single word which is one of \`alias', \`keyword', - \`function', \`builtin', \`file' or \`', if NAME is an alias, - shell reserved word, shell function, shell builtin, disk file, - or not found, respectively - - Exit Status: - Returns success if all of the NAMEs are found; fails if any are not found.`]],["typeset",["typeset [-aAfFgilnrtux] [-p] name[=value] ...","Set variable values and attributes.\n A synonym for `declare'."]],["ulimit",["ulimit [-SHabcdefiklmnpqrstuvxPT] [limit]",`Modify shell resource limits. - Provides control over the resources available to the shell and processes - it creates, on systems that allow such control. - Exit Status: - Returns success unless an invalid option is supplied or an error occurs.`]],["umask",["umask [-p] [-S] [mode]",`Display or set file mode mask. - Sets the user file-creation mask to MODE. If MODE is omitted, prints - the current value of the mask. - Exit Status: - Returns success unless MODE is invalid or an invalid option is given.`]],["unalias",["unalias [-a] name [name ...]",`Remove each NAME from the list of defined aliases. - Exit Status: - Returns success unless a NAME is not an existing alias.`]],["unset",["unset [-f] [-v] [-n] [name ...]",`Unset values and attributes of shell variables and functions. - For each NAME, remove the corresponding variable or function. - - Options: - -f treat each NAME as a shell function - -v treat each NAME as a shell variable - -n treat each NAME as a name reference and unset the variable itself - rather than the variable it references - - Without options, unset first tries to unset a variable, and if that fails, - tries to unset a function. - Exit Status: - Returns success unless an invalid option is given or a NAME is read-only.`]],["wait",["wait [-fn] [id ...]",`Wait for job completion and return exit status. - Waits for each process identified by an ID, which may be a process ID or a - job specification, and reports its termination status. - Exit Status: - Returns the status of the last ID; fails if ID is invalid or an invalid - option is given.`]]]),$l=[...Al.keys()].sort();function li(e,t){let s=!1,r=[],n=0;for(;n1){for(let u=1;us.test(r))}function Kf(){let e=[];e.push("just-bash shell builtins"),e.push("These shell commands are defined internally. Type `help' to see this list."),e.push("Type `help name' to find out more about the function `name'."),e.push("");let t=36,s=$l.slice(),r=Math.ceil(s.length/2);for(let n=0;n0&&a.pipelines[0].commands.length>0){let l=a.pipelines[0].commands[0];l.type==="ArithmeticCommand"&&(r=await T(e,l.expression.expression))}}catch(i){return N(`bash: let: ${n}: ${i.message} -`)}return _("","",r===0?1:0)}async function ui(e,t){if(e.state.localScopes.length===0)return N(`bash: local: can only be used in a function -`);let s=e.state.localScopes[e.state.localScopes.length-1],r="",n=0,i=!1,a=!1,l=!1,o=[];for(let u of t)if(u==="-n")i=!0;else if(u==="-a")a=!0;else if(u==="-p")l=!0;else if(u.startsWith("-")&&!u.includes("="))for(let c of u.slice(1))c==="n"?i=!0:c==="a"?a=!0:c==="p"&&(l=!0);else o.push(u);if(o.length===0){let u="",c=Array.from(s.keys()).filter(f=>!f.includes("_")||!f.match(/_\d+$/)).filter(f=>!f.includes("__length")).sort();for(let f of c){let d=e.state.env.get(f);d!==void 0&&(u+=`${f}=${d} -`)}return _(u,"",0)}for(let u of o){let c,f,d=u.match(/^([a-zA-Z_][a-zA-Z0-9_]*)=\((.*)\)$/s);if(d){c=d[1];let b=d[2];if(!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(c)){r+=`bash: local: \`${u}': not a valid identifier -`,n=1;continue}if(ye(e,c,"bash"),!s.has(c)){s.set(c,e.state.env.get(c));let w=`${c}_`;for(let S of e.state.env.keys())S.startsWith(w)&&!S.includes("__")&&(s.has(S)||s.set(S,e.state.env.get(S)))}let v=`${c}_`;for(let w of e.state.env.keys())w.startsWith(v)&&!w.includes("__")&&e.state.env.delete(w);let E=ot(b);for(let w=0;w0&&(w=Math.max(...E)+1);for(let $=0;$=w&&e.state.env.set(`${c}__length`,String(E+1)),Ct(e,c),i&&pt(e,c);continue}if(u.includes("=")){let b=u.indexOf("=");c=u.slice(0,b),f=de(e,u.slice(b+1))}else c=u;if(!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(c)){r+=`bash: local: \`${u}': not a valid identifier -`,n=1;continue}let y=s.has(c);if(f!==void 0){let b=e.state.env.get(c);if(e.state.tempEnvBindings){let v=e.state.accessedTempEnvVars?.has(c),E=e.state.mutatedTempEnvVars?.has(c);if(!v&&!E)for(let w=e.state.tempEnvBindings.length-1;w>=0;w--){let S=e.state.tempEnvBindings[w];if(S.has(c)){b=S.get(c);break}}}ll(e,c,b)}if(!y){let b=e.state.env.get(c);if(e.state.tempEnvBindings)for(let v=e.state.tempEnvBindings.length-1;v>=0;v--){let E=e.state.tempEnvBindings[v];if(E.has(c)){b=E.get(c);break}}if(s.set(c,b),a){let v=`${c}_`;for(let w of e.state.env.keys())w.startsWith(v)&&!w.includes("__")&&(s.has(w)||s.set(w,e.state.env.get(w)));let E=`${c}__length`;e.state.env.has(E)&&!s.has(E)&&s.set(E,e.state.env.get(E))}}if(a&&f===void 0){let b=`${c}_`;for(let v of e.state.env.keys())v.startsWith(b)&&!v.includes("__")&&e.state.env.delete(v);e.state.env.set(`${c}__length`,"0")}else if(f!==void 0){if(ye(e,c,"bash"),i&&f!==""&&!/^[a-zA-Z_][a-zA-Z0-9_]*(\[.+\])?$/.test(f)){r+=`bash: local: \`${f}': invalid variable name for name reference -`,n=1;continue}e.state.env.set(c,f),e.state.options.allexport&&(e.state.exportedVars=e.state.exportedVars||new Set,e.state.exportedVars.add(c))}else{let b=e.state.tempEnvBindings?.some(v=>v.has(c));!y&&!b&&e.state.env.delete(c)}Ct(e,c),i&&pt(e,c)}return _("",r,n)}function fi(e,t,s){let r=` -`,n=0,i=0,a=0,l=!1,o="MAPFILE",u=0;for(;u0;){let v=d.indexOf(r);if(v===-1){if(d.length>0){if(m=p)return _("",`mapfile: array element limit exceeded (${p}) -`,1);let S=d,A=S.indexOf("\0");A!==-1&&(S=S.substring(0,A)),f.push(S),h++}}break}let E=d.substring(0,v),w=E.indexOf("\0");if(w!==-1&&(E=E.substring(0,w)),!l&&r!=="\0"&&(E+=r),d=d.substring(v+r.length),m0&&h>=n)break;if(i+h>=p)return _("",`mapfile: array element limit exceeded (${p}) -`,1);f.push(E),h++}i===0&&tt(e,o);for(let v=0;v{let D=1;for(;D1&&k!=="--"){let x=p(k,h);if(x.nextArgIndex===-1)return{stdout:"",stderr:"",exitCode:2};if(x.nextArgIndex===-2)return{stdout:"",stderr:"",exitCode:1};h=x.nextArgIndex}else if(k==="--")for(h++;h=0?e.state.fileDescriptors?y=e.state.fileDescriptors.get(c)||"":y="":!y&&e.state.groupStdin!==void 0&&(y=e.state.groupStdin);let b=i===""?"\0":i,v="",E=0,w=!0,S=k=>{if(c>=0&&e.state.fileDescriptors)e.state.fileDescriptors.set(c,y.substring(k));else if(r>=0&&e.state.fileDescriptors){let x=e.state.fileDescriptors.get(r);if(x?.startsWith("__rw__:")){let D=Yf(x);if(D){let P=D.position+k;e.state.fileDescriptors.set(r,Jf(D.path,P,D.content))}}}else e.state.groupStdin!==void 0&&!s&&(e.state.groupStdin=y.substring(k))};if(o>=0){let k=Math.min(o,y.length);v=y.substring(0,k),E=k,w=k>=o,S(E);let x=d[0]||"REPLY";e.state.env.set(x,v);for(let D=1;D=0){let k=0,x=0,D=!1;for(;x=l||D,S(E)}else{E=0;let k=0;for(;k=y.length&&(w=!1,E=k,v.length===0&&y.length===0)){for(let x of d)e.state.env.set(x,"");return u&&tt(e,u),_("","",1)}S(E)}b===` -`&&v.endsWith(` -`)&&(v=v.slice(0,-1));let A=k=>n?k:k.replace(/\\(.)/g,"$1");if(d.length===1&&d[0]==="REPLY")return e.state.env.set("REPLY",A(v)),_("","",w?0:1);let $=me(e.state.env);if(u){let{words:k}=Sr(v,$,void 0,n),x=e.limits?.maxArrayElements??1e5;if(k.length>x)return _("",`read: array element limit exceeded (${x}) -`,1);tt(e,u);for(let D=0;D0){let r=t[0],n=Number.parseInt(r,10);if(r===""||Number.isNaN(n)||!/^-?\d+$/.test(r))return N(`bash: return: ${r}: numeric argument required -`,2);s=(n%256+256)%256}throw new ke(s)}var bs=`set: usage: set [-eux] [+eux] [-o option] [+o option] -Options: - -e Exit immediately if a command exits with non-zero status - +e Disable -e - -u Treat unset variables as an error when substituting - +u Disable -u - -x Print commands and their arguments as they are executed - +x Disable -x - -o errexit Same as -e - +o errexit Disable errexit - -o nounset Same as -u - +o nounset Disable nounset - -o pipefail Return status of last failing command in pipeline - +o pipefail Disable pipefail - -o xtrace Same as -x - +o xtrace Disable xtrace -`,Pl=new Map([["e","errexit"],["u","nounset"],["x","xtrace"],["v","verbose"],["f","noglob"],["C","noclobber"],["a","allexport"],["n","noexec"],["h",null],["b",null],["m",null],["B",null],["H",null],["P",null],["T",null],["E",null],["p",null]]),$n=new Map([["errexit","errexit"],["pipefail","pipefail"],["nounset","nounset"],["xtrace","xtrace"],["verbose","verbose"],["noclobber","noclobber"],["noglob","noglob"],["allexport","allexport"],["noexec","noexec"],["posix","posix"],["vi","vi"],["emacs","emacs"],["notify",null],["monitor",null],["braceexpand",null],["histexpand",null],["physical",null],["functrace",null],["errtrace",null],["privileged",null],["hashall",null],["ignoreeof",null],["interactive-comments",null],["keyword",null],["onecmd",null]]),_l=["errexit","nounset","pipefail","verbose","xtrace","posix","allexport","noclobber","noglob","noexec","vi","emacs"],xl=["braceexpand","errtrace","functrace","hashall","histexpand","history","ignoreeof","interactive-comments","keyword","monitor","nolog","notify","onecmd","physical","privileged"];function pi(e,t,s){t!==null&&(s&&(t==="vi"?e.state.options.emacs=!1:t==="emacs"&&(e.state.options.vi=!1)),e.state.options[t]=s,jt(e))}function ed(e,t){return t+1{let i=e.state.env.get(`${t}_${n}`)??"";return`[${n}]=${Lt(i)}`});return`${t}=(${r.join(" ")})`}function sd(e){return/^[a-zA-Z0-9_]+$/.test(e)?e:`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function nd(e,t){let s=Ge(e,t);if(s.length===0)return`${t}=()`;let r=s.map(n=>{let i=e.state.env.get(`${t}_${n}`)??"";return`[${sd(n)}]=${Lt(i)}`});return`${t}=(${r.join(" ")} )`}function rd(e){let t=new Set,s=e.state.associativeArrays??new Set;for(let r of e.state.env.keys()){let n=r.match(/^([a-zA-Z_][a-zA-Z0-9_]*)_(\d+)$/);if(n){let i=n[1];s.has(i)||t.add(i)}}return t}function id(e){return e.state.associativeArrays??new Set}function kl(e){let t=_l.map(r=>`${r.padEnd(16)}${e.state.options[r]?"on":"off"}`),s=xl.map(r=>`${r.padEnd(16)}off`);return`${[...t,...s].sort().join(` -`)} -`}function Nl(e){let t=_l.map(r=>`set ${e.state.options[r]?"-o":"+o"} ${r}`),s=xl.map(r=>`set +o ${r}`);return`${[...t,...s].sort().join(` -`)} -`}function gi(e,t){if(t.includes("--help"))return H(bs);if(t.length===0){let i=rd(e),a=id(e),l=c=>{for(let f of a){let d=`${f}_`,h=`${f}__length`;if(c!==h&&c.startsWith(d)){if(c.slice(d.length).startsWith("_length"))continue;return!0}}return!1},o=[];for(let[c,f]of e.state.env){if(!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(c)||i.has(c)||a.has(c))continue;let d=c.match(/^([a-zA-Z_][a-zA-Z0-9_]*)_(\d+)$/);if(d&&i.has(d[1]))continue;let h=c.match(/^([a-zA-Z_][a-zA-Z0-9_]*)__length$/);h&&i.has(h[1])||l(c)||h&&a.has(h[1])||o.push([c,f])}let u=[];for(let[c,f]of o.sort(([d],[h])=>dh?1:0))u.push(`${c}=${vn(f)}`);for(let c of[...i].sort((f,d)=>fd?1:0))u.push(td(e,c));for(let c of[...a].sort((f,d)=>fd?1:0))u.push(nd(e,c));return u.sort((c,f)=>{let d=c.split("=")[0],h=f.split("=")[0];return dh?1:0}),H(u.length>0?`${u.join(` -`)} -`:"")}let s=[],r=()=>s.length>0?H(s.join("")):K,n=0;for(;n1&&(i[0]==="-"||i[0]==="+")&&i[1]!=="-"){let a=i[0]==="-",l=0;for(let o=1;o0){let a=Number.parseInt(t[0],10);if(Number.isNaN(a)||a<0){let l=`bash: shift: ${t[0]}: numeric argument required -`;if(e.state.options.posix)throw new Be(1,"",l);return N(l)}s=a}let r=Number.parseInt(e.state.env.get("#")||"0",10);if(s>r){let a=`bash: shift: shift count out of range -`;if(e.state.options.posix)throw new Be(1,"",a);return N(a)}if(s===0)return K;let n=[];for(let a=1;a<=r;a++)n.push(e.state.env.get(String(a))||"");let i=n.slice(s);for(let a=1;a<=r;a++)e.state.env.delete(String(a));for(let a=0;a0&&s[0]==="--"&&(s=s.slice(1)),s.length===0)return _("",`bash: source: filename argument required -`,2);let r=s[0],n=null,i=null;if(r.includes("/")){let u=e.fs.resolvePath(e.state.cwd,r);try{i=await e.fs.readFile(u),n=u}catch{}}else{let c=(e.state.env.get("PATH")||"").split(":").filter(f=>f);for(let f of c){let d=e.fs.resolvePath(e.state.cwd,`${f}/${r}`);try{if((await e.fs.stat(d)).isDirectory)continue;i=await e.fs.readFile(d),n=d;break}catch{}}if(i===null){let f=e.fs.resolvePath(e.state.cwd,r);try{i=await e.fs.readFile(f),n=f}catch{}}}if(i===null)return N(`bash: ${r}: No such file or directory -`);let a=new Map;if(s.length>1){for(let c=1;c<=9;c++)a.set(String(c),e.state.env.get(String(c)));a.set("#",e.state.env.get("#")),a.set("@",e.state.env.get("@"));let u=s.slice(1);e.state.env.set("#",String(u.length)),e.state.env.set("@",u.join(" "));for(let c=0;c{if(e.state.sourceDepth--,e.state.currentSource=l,s.length>1)for(let[u,c]of a)c===void 0?e.state.env.delete(u):e.state.env.set(u,c)};if(e.state.sourceDepth++,e.state.sourceDepth>e.limits.maxSourceDepth)throw e.state.sourceDepth--,new X(`source: maximum nesting depth (${e.limits.maxSourceDepth}) exceeded, increase executionLimits.maxSourceDepth`,"recursion");e.state.currentSource=r;try{let u=Ce(i),c=await e.executeScript(u);return o(),c}catch(u){if(o(),u instanceof Z)throw u;if(u instanceof ke)return _(u.stdout,u.stderr,u.exitCode);if(u.name==="ParseException")return N(`bash: ${r}: ${u.message} -`);throw u}}function Cl(e){return/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(e)}function ad(e){return e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"')}async function Dl(e,t){if(ad(t))return null;try{let s=new q,r=Y(s,t);return await T(e,r.expression)}catch{let s=parseInt(t,10);return Number.isNaN(s)?0:s}}function Rl(e,t){if(e.state.localVarStack?.has(t)){let r=yn(e,t);if(r){r.value===void 0?e.state.env.delete(t):e.state.env.set(t,r.value);let n=e.state.localVarStack?.get(t);if(!n||n.length===0)gn(e,t),e.state.localVarStack?.delete(t),e.state.fullyUnsetLocals=e.state.fullyUnsetLocals||new Map,e.state.fullyUnsetLocals.set(t,r.scopeIndex),Ei(e,t);else{let i=n[n.length-1];e.state.localVarDepth=e.state.localVarDepth||new Map,e.state.localVarDepth.set(t,i.scopeIndex+1)}return!0}return e.state.env.delete(t),gn(e,t),e.state.localVarStack?.delete(t),e.state.fullyUnsetLocals=e.state.fullyUnsetLocals||new Map,e.state.fullyUnsetLocals.set(t,0),!0}for(let r=e.state.localScopes.length-1;r>=0;r--){let n=e.state.localScopes[r];if(n.has(t)){let i=n.get(t);i===void 0?e.state.env.delete(t):e.state.env.set(t,i),n.delete(t);let a=!1;for(let l=r-1;l>=0;l--)if(e.state.localScopes[l].has(t)){e.state.localVarDepth&&e.state.localVarDepth.set(t,l+1),a=!0;break}return a||gn(e,t),!0}}return!1}function Ei(e,t){if(!e.state.tempEnvBindings||e.state.tempEnvBindings.length===0)return!1;for(let s=e.state.tempEnvBindings.length-1;s>=0;s--){let r=e.state.tempEnvBindings[s];if(r.has(t)){let n=r.get(t);return n===void 0?e.state.env.delete(t):e.state.env.set(t,n),r.delete(t),!0}}return!1}async function Il(e,t){if(t.startsWith("'")&&t.endsWith("'"))return t.slice(1,-1);if(t.startsWith('"')&&t.endsWith('"')){let s=t.slice(1,-1),n=new q().parseWordFromString(s,!0,!1);return V(e,n)}if(t.includes("$")){let r=new q().parseWordFromString(t,!1,!1);return V(e,r)}return t}async function bi(e,t){let s="both",r="",n=0;for(let i of t){if(i==="-v"){s="variable";continue}if(i==="-f"){s="function";continue}if(s==="function"){e.state.functions.delete(i);continue}if(s==="variable"){let u=i.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(.+)\]$/);if(u){let d=u[1],h=u[2];if(h==="@"||h==="*"){let E=B(e,d);for(let[w]of E)e.state.env.delete(`${d}_${w}`);e.state.env.delete(d);continue}let m=e.state.associativeArrays?.has(d);if(m){let E=await Il(e,h);e.state.env.delete(`${d}_${E}`);continue}let p=He(e,d),y=e.state.declaredVars?.has(d);if((e.state.env.has(d)||y)&&!p&&!m){r+=`bash: unset: ${d}: not an array variable -`,n=1;continue}let v=await Dl(e,h);if(v===null&&p){r+=`bash: unset: ${h}: not a valid identifier -`,n=1;continue}if(v===null)continue;if(v<0){let E=B(e,d),w=E.length,S=e.state.currentLine;if(w===0){r+=`bash: line ${S}: unset: [${v}]: bad array subscript -`,n=1;continue}let A=w+v;if(A<0){r+=`bash: line ${S}: unset: [${v}]: bad array subscript -`,n=1;continue}let $=E[A][0];e.state.env.delete(`${d}_${$}`);continue}e.state.env.delete(`${d}_${v}`);continue}if(!Cl(i)){r+=`bash: unset: \`${i}': not a valid identifier -`,n=1;continue}let c=i;if(te(e,i)){let d=$e(e,i);d&&d!==i&&(c=d)}if(rt(e,c)){r+=`bash: unset: ${c}: cannot unset: readonly variable -`,n=1;continue}let f=Qt(e,c);if(f!==void 0&&f!==e.state.callDepth)Rl(e,c);else if(e.state.fullyUnsetLocals?.has(c))e.state.env.delete(c);else if(f!==void 0){let d=e.state.accessedTempEnvVars?.has(c),h=e.state.mutatedTempEnvVars?.has(c);if((d||h)&&e.state.localVarStack?.has(c)){let m=yn(e,c);m?m.value===void 0?e.state.env.delete(c):e.state.env.set(c,m.value):e.state.env.delete(c)}else e.state.env.delete(c)}else Ei(e,c)||e.state.env.delete(c);e.state.exportedVars?.delete(c);continue}let a=i.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(.+)\]$/);if(a){let u=a[1],c=a[2];if(c==="@"||c==="*"){let p=B(e,u);for(let[y]of p)e.state.env.delete(`${u}_${y}`);e.state.env.delete(u);continue}let f=e.state.associativeArrays?.has(u);if(f){let p=await Il(e,c);e.state.env.delete(`${u}_${p}`);continue}let d=He(e,u);if(e.state.env.has(u)&&!d&&!f){r+=`bash: unset: ${u}: not an array variable -`,n=1;continue}let m=await Dl(e,c);if(m===null&&d){r+=`bash: unset: ${c}: not a valid identifier -`,n=1;continue}if(m===null)continue;if(m<0){let p=B(e,u),y=p.length,b=e.state.currentLine;if(y===0){r+=`bash: line ${b}: unset: [${m}]: bad array subscript -`,n=1;continue}let v=y+m;if(v<0){r+=`bash: line ${b}: unset: [${m}]: bad array subscript -`,n=1;continue}let E=p[v][0];e.state.env.delete(`${u}_${E}`);continue}e.state.env.delete(`${u}_${m}`);continue}if(!Cl(i)){r+=`bash: unset: \`${i}': not a valid identifier -`,n=1;continue}let l=i;if(te(e,i)){let u=$e(e,i);u&&u!==i&&(l=u)}if(rt(e,l)){r+=`bash: unset: ${l}: cannot unset: readonly variable -`,n=1;continue}let o=Qt(e,l);if(o!==void 0&&o!==e.state.callDepth)Rl(e,l);else if(e.state.fullyUnsetLocals?.has(l))e.state.env.delete(l);else if(o!==void 0){let u=e.state.accessedTempEnvVars?.has(l),c=e.state.mutatedTempEnvVars?.has(l);if((u||c)&&e.state.localVarStack?.has(l)){let f=yn(e,l);f?f.value===void 0?e.state.env.delete(l):e.state.env.set(l,f.value):e.state.env.delete(l)}else e.state.env.delete(l)}else Ei(e,l)||e.state.env.delete(l);e.state.exportedVars?.delete(l),e.state.functions.delete(i)}return _("",r,n)}var vi=["extglob","dotglob","nullglob","failglob","globstar","globskipdots","nocaseglob","nocasematch","expand_aliases","lastpipe","xpg_echo"],od=["autocd","cdable_vars","cdspell","checkhash","checkjobs","checkwinsize","cmdhist","compat31","compat32","compat40","compat41","compat42","compat43","compat44","complete_fullquote","direxpand","dirspell","execfail","extdebug","extquote","force_fignore","globasciiranges","gnu_errfmt","histappend","histreedit","histverify","hostcomplete","huponexit","inherit_errexit","interactive_comments","lithist","localvar_inherit","localvar_unset","login_shell","mailwarn","no_empty_cmd_completion","progcomp","progcomp_alias","promptvars","restricted_shell","shift_verbose","sourcepath"];function Pn(e){return vi.includes(e)}function ld(e){return od.includes(e)}function Ol(e,t){let s=!1,r=!1,n=!1,i=!1,a=!1,l=[],o=0;for(;o1){for(let h=1;h0?`${h.join(` -`)} -`:"",stderr:""}}let d=[];for(let h of vi){let m=e.state.shoptOptions[h];d.push(n?`shopt ${m?"-s":"-u"} ${h}`:`${h} ${m?"on":"off"}`)}return{exitCode:0,stdout:`${d.join(` -`)} -`,stderr:""}}let u=!1,c="",f=[];for(let d of l){if(!Pn(d)&&!ld(d)){c+=`shopt: ${d}: invalid shell option name -`,u=!0;continue}if(s)Pn(d)&&(e.state.shoptOptions[d]=!0,Gn(e));else if(r)Pn(d)&&(e.state.shoptOptions[d]=!1,Gn(e));else if(Pn(d)){let h=e.state.shoptOptions[d];i?h||(u=!0):n?(f.push(`shopt ${h?"-s":"-u"} ${d}`),h||(u=!0)):(f.push(`${d} ${h?"on":"off"}`),h||(u=!0))}else i?u=!0:n?(f.push(`shopt -u ${d}`),u=!0):(f.push(`${d} off`),u=!0)}return{exitCode:u?1:0,stdout:f.length>0?`${f.join(` -`)} -`:"",stderr:c}}function cd(e,t,s,r,n,i){let a=new Map([["errexit","errexit"],["pipefail","pipefail"],["nounset","nounset"],["xtrace","xtrace"],["verbose","verbose"],["posix","posix"],["allexport","allexport"],["noclobber","noclobber"],["noglob","noglob"],["noexec","noexec"],["vi","vi"],["emacs","emacs"]]),l=["braceexpand","errtrace","functrace","hashall","histexpand","history","ignoreeof","interactive-comments","keyword","monitor","nolog","notify","onecmd","physical","privileged"],o=[...a.keys(),...l].sort();if(t.length===0){let d=[];for(let h of o){let m=l.includes(h),p=a.get(h),y=m||!p?!1:e.state.options[p];s&&!y||r&&y||d.push(n?`set ${y?"-o":"+o"} ${h}`:`${h} ${y?"on":"off"}`)}return{exitCode:0,stdout:d.length>0?`${d.join(` -`)} -`:"",stderr:""}}let u=!1,c="",f=[];for(let d of t){let h=a.has(d),m=l.includes(d);if(!h&&!m){c+=`shopt: ${d}: invalid option name -`,u=!0;continue}if(m){s||r||(i?u=!0:n?(f.push(`set +o ${d}`),u=!0):(f.push(`${d} off`),u=!0));continue}let p=a.get(d);if(p)if(s)p==="vi"?e.state.options.emacs=!1:p==="emacs"&&(e.state.options.vi=!1),e.state.options[p]=!0,jt(e);else if(r)e.state.options[p]=!1,jt(e);else{let y=e.state.options[p];i?y||(u=!0):n?(f.push(`set ${y?"-o":"+o"} ${d}`),y||(u=!0)):(f.push(`${d} ${y?"on":"off"}`),y||(u=!0))}}return{exitCode:u?1:0,stdout:f.length>0?`${f.join(` -`)} -`:"",stderr:c}}async function Tl(e,t,s){if(t.includes("/")){let a=e.fs.resolvePath(e.state.cwd,t);if(!await e.fs.exists(a))return{error:"not_found",path:a};let l=a.split("/").pop()||t,o=e.commands.get(l);try{let u=await e.fs.stat(a);return u.isDirectory?{error:"permission_denied",path:a}:o?{cmd:o,path:a}:(u.mode&73)!==0?{script:!0,path:a}:{error:"permission_denied",path:a}}catch{return{error:"not_found",path:a}}}if(!s&&e.state.hashTable){let a=e.state.hashTable.get(t);if(a)if(await e.fs.exists(a)){let l=e.commands.get(t);if(l)return{cmd:l,path:a};try{let o=await e.fs.stat(a);if(!o.isDirectory&&(o.mode&73)!==0)return{script:!0,path:a}}catch{}}else e.state.hashTable.delete(t)}let n=(s??e.state.env.get("PATH")??"/usr/bin:/bin").split(":");for(let a of n){if(!a)continue;let o=`${a.startsWith("/")?a:e.fs.resolvePath(e.state.cwd,a)}/${t}`;if(await e.fs.exists(o))try{let u=await e.fs.stat(o);if(u.isDirectory)continue;let c=(u.mode&73)!==0,f=e.commands.get(t),d=a==="/bin"||a==="/usr/bin";if(f&&d)return{cmd:f,path:o};if(c){if(f&&!d)return{script:!0,path:o};if(!f)return{script:!0,path:o}}}catch{}}if(!await e.fs.exists("/usr/bin")){let a=e.commands.get(t);if(a)return{cmd:a,path:`/usr/bin/${t}`}}return null}async function kn(e,t){let s=[];if(t.includes("/")){let i=e.fs.resolvePath(e.state.cwd,t);if(await e.fs.exists(i))try{let a=await e.fs.stat(i);a.isDirectory||(a.mode&73)!==0&&s.push(t)}catch{}return s}let n=(e.state.env.get("PATH")||"/usr/bin:/bin").split(":");for(let i of n){if(!i)continue;let l=`${i.startsWith("/")?i:e.fs.resolvePath(e.state.cwd,i)}/${t}`;if(await e.fs.exists(l)){try{if((await e.fs.stat(l)).isDirectory)continue}catch{continue}s.push(i.startsWith("/")?l:`${i}/${t}`)}}return s}function ud(e){return e!==null&&typeof e=="object"&&"then"in e&&typeof e.then=="function"}function oe(e,t,s,r){return((...n)=>{ls(t,s,`${r} call`);let i=e(...n);return ud(i)?i.then(a=>(ls(t,s,`${r} post-await`),a),a=>{throw ls(t,s,`${r} post-await`),a}):(ls(t,s,`${r} return`),i)})}function fd(e,t,s){let r={readFile:oe(e.readFile.bind(e),t,s,"fs.readFile"),...typeof e.readFileBytes=="function"?{readFileBytes:oe(e.readFileBytes.bind(e),t,s,"fs.readFileBytes")}:Object.create(null),readFileBuffer:oe(e.readFileBuffer.bind(e),t,s,"fs.readFileBuffer"),writeFile:oe(e.writeFile.bind(e),t,s,"fs.writeFile"),appendFile:oe(e.appendFile.bind(e),t,s,"fs.appendFile"),exists:oe(e.exists.bind(e),t,s,"fs.exists"),stat:oe(e.stat.bind(e),t,s,"fs.stat"),mkdir:oe(e.mkdir.bind(e),t,s,"fs.mkdir"),readdir:oe(e.readdir.bind(e),t,s,"fs.readdir"),rm:oe(e.rm.bind(e),t,s,"fs.rm"),cp:oe(e.cp.bind(e),t,s,"fs.cp"),mv:oe(e.mv.bind(e),t,s,"fs.mv"),resolvePath:oe(e.resolvePath.bind(e),t,s,"fs.resolvePath"),getAllPaths:oe(e.getAllPaths.bind(e),t,s,"fs.getAllPaths"),chmod:oe(e.chmod.bind(e),t,s,"fs.chmod"),symlink:oe(e.symlink.bind(e),t,s,"fs.symlink"),link:oe(e.link.bind(e),t,s,"fs.link"),readlink:oe(e.readlink.bind(e),t,s,"fs.readlink"),lstat:oe(e.lstat.bind(e),t,s,"fs.lstat"),realpath:oe(e.realpath.bind(e),t,s,"fs.realpath"),utimes:oe(e.utimes.bind(e),t,s,"fs.utimes")};return e.readdirWithFileTypes&&(r.readdirWithFileTypes=oe(e.readdirWithFileTypes.bind(e),t,s,"fs.readdirWithFileTypes")),r}function Ll(e,t){if(!e.requireDefenseContext)return e;let s=`command:${t}`,r={...e,fs:fd(e.fs,e.requireDefenseContext,s)};return e.exec&&(r.exec=oe(e.exec,e.requireDefenseContext,s,"exec")),e.fetch&&(r.fetch=oe(e.fetch,e.requireDefenseContext,s,"fetch")),e.sleep&&(r.sleep=oe(e.sleep,e.requireDefenseContext,s,"sleep")),e.getRegisteredCommands&&(r.getRegisteredCommands=oe(e.getRegisteredCommands,e.requireDefenseContext,s,"getRegisteredCommands")),r}async function Vl(e,t,s,r){let n=!1,i=!1,a=!1,l=!1,o=!1,u=[];for(let p of t)if(p.startsWith("-")&&p.length>1)for(let y of p.slice(1))y==="t"?n=!0:y==="p"?i=!0:y==="P"?a=!0:y==="a"?l=!0:y==="f"&&(o=!0);else u.push(p);let c="",f="",d=0,h=!1,m=!1;for(let p of u){let y=!1;if(a){if(l){let A=await r(p);if(A.length>0){for(let $ of A)c+=`${$} -`;h=!0,y=!0}}else{let A=await s(p);A&&(c+=`${A} -`,h=!0,y=!0)}y||(m=!0);continue}let b=!o&&e.state.functions.has(p);if(l&&b){if(!i)if(n)c+=`function -`;else{let A=e.state.functions.get(p),$=A?Ml(p,A):`${p} is a function -`;c+=$}y=!0}let v=e.state.env.get(`BASH_ALIAS_${p}`);if(v!==void 0&&(l||!y)&&(i||(n?c+=`alias -`:c+=`${p} is aliased to \`${v}' -`),y=!0,!l)||Wr.has(p)&&(l||!y)&&(i||(n?c+=`keyword -`:c+=`${p} is a shell keyword -`),y=!0,!l))continue;if(!l&&b&&!y){if(!i)if(n)c+=`function -`;else{let A=e.state.functions.get(p),$=A?Ml(p,A):`${p} is a function -`;c+=$}y=!0;continue}if(!(Kt.has(p)&&(l||!y)&&(i||(n?c+=`builtin -`:c+=`${p} is a shell builtin -`),y=!0,!l))){if(l){let A=await r(p);for(let $ of A)i?c+=`${$} -`:n?c+=`file -`:c+=`${p} is ${$} -`,h=!0,y=!0}else if(!y){let A=await s(p);A&&(i?c+=`${A} -`:n?c+=`file -`:c+=`${p} is ${A} -`,h=!0,y=!0)}if(!y&&(m=!0,!n&&!i)){let A=!0;if(p.includes("/")){let $=e.fs.resolvePath(e.state.cwd,p);await e.fs.exists($)&&(A=!1)}A&&(f+=`bash: type: ${p}: not found -`)}}}return i?d=m&&!h?1:0:d=m?1:0,_(c,f,d)}function Ml(e,t){let s;return t.body.type==="Group"?s=t.body.body.map(n=>vs(n)).join("; "):s=vs(t.body),`${e} is a function -${e} () -{ - ${s} -} -`}function vs(e){if(Array.isArray(e))return e.map(t=>vs(t)).join("; ");if(e.type==="Statement"){let t=[];for(let s=0;svs(r)).join("; ")}; }`:"..."}function dd(e){let t=e.commands.map(s=>vs(s));return(e.negated?"! ":"")+t.join(" | ")}function Wl(e){let t="";for(let s of e.parts)s.type==="Literal"?t+=s.value:s.type==="DoubleQuoted"?t+=`"${s.parts.map(r=>Fl(r)).join("")}"`:s.type==="SingleQuoted"?t+=`'${s.value}'`:t+=Fl(s);return t}function Fl(e){let t=e;return t.type==="Literal"?t.value??"":t.type==="Variable"?`$${t.name}`:""}async function zl(e,t,s,r){let n="",i="",a=0;for(let l of t){if(!l){a=1;continue}let o=e.state.env.get(`BASH_ALIAS_${l}`);if(o!==void 0)r?n+=`${l} is an alias for "${o}" -`:n+=`alias ${l}='${o}' -`;else if(Wr.has(l))r?n+=`${l} is a shell keyword -`:n+=`${l} -`;else if(Kt.has(l))r?n+=`${l} is a shell builtin -`:n+=`${l} -`;else if(e.state.functions.has(l))r?n+=`${l} is a function -`:n+=`${l} -`;else if(l.includes("/")){let u=e.fs.resolvePath(e.state.cwd,l),c=!1;if(await e.fs.exists(u))try{let f=await e.fs.stat(u);f.isDirectory||(f.mode&73)!==0&&(r?n+=`${l} is ${l} -`:n+=`${l} -`,c=!0)}catch{}c||(r&&(i+=`${l}: not found -`),a=1)}else if(e.commands.has(l)){let c=(e.state.env.get("PATH")??"/usr/bin:/bin").split(":"),f=null;for(let d of c){if(!d)continue;let h=`${d}/${l}`;try{let m=await e.fs.stat(h);if(!m.isDirectory&&(m.mode&73)!==0){f=h;break}}catch{}}f||(f=`/usr/bin/${l}`),r?n+=`${l} is ${f} -`:n+=`${f} -`}else r&&(i+=`${l}: not found -`),a=1}return _(n,i,a)}async function Bl(e,t){if(t.includes("/")){let n=e.fs.resolvePath(e.state.cwd,t);if(await e.fs.exists(n)){try{let i=await e.fs.stat(n);if(i.isDirectory||!((i.mode&73)!==0))return null}catch{return null}return t}return null}let r=(e.state.env.get("PATH")??"/usr/bin:/bin").split(":");for(let n of r){if(!n)continue;let a=`${n.startsWith("/")?n:e.fs.resolvePath(e.state.cwd,n)}/${t}`;if(await e.fs.exists(a)){try{if((await e.fs.stat(a)).isDirectory)continue}catch{continue}return`${n}/${t}`}}if(e.commands.has(t)){for(let n of r)if(n==="/usr/bin"||n==="/bin")return`${n}/${t}`;return`/usr/bin/${t}`}return null}async function ql(e,t,s,r,n,i,a,l){let{ctx:o,runCommand:u}=e;if(o.coverage&&Kt.has(t)&&o.coverage.hit(`bash:builtin:${t}`),t==="export")return ai(o,s);if(t==="unset")return bi(o,s);if(t==="exit")return ii(o,s);if(t==="local")return ui(o,s);if(t==="set")return gi(o,s);if(t==="break")return Rr(o,s);if(t==="continue")return Ur(o,s);if(t==="return")return hi(o,s);if(t==="eval"&&o.state.options.posix)return Sn(o,s,n);if(t==="shift")return yi(o,s);if(t==="getopts")return An(o,s);if(t==="compgen")return zr(o,s);if(t==="complete")return qr(o,s);if(t==="compopt")return jr(o,s);if(t==="pushd")return await si(o,s);if(t==="popd")return ni(o,s);if(t==="dirs")return ri(o,s);if(t==="source"||t===".")return wi(o,s);if(t==="read")return di(o,s,n,l);if(t==="mapfile"||t==="readarray")return fi(o,s,n);if(t==="declare"||t==="typeset")return Jr(o,s);if(t==="readonly")return ei(o,s);if(!i){let c=o.state.functions.get(t);if(c)return bn(o,c,s,n)}if(t==="eval")return Sn(o,s,n);if(t==="cd")return await Ir(o,s);if(t===":"||t==="true")return K;if(t==="false")return pe(!1);if(t==="let")return ci(o,s);if(t==="command")return hd(e,s,n);if(t==="builtin")return pd(e,s,n);if(t==="shopt")return Ol(o,s);if(t==="exec"){if(s.length===0)return K;let[c,...f]=s;return u(c,f,[],n,!1,!1,-1)}if(t==="wait")return K;if(t==="type")return await Vl(o,s,c=>Bl(o,c),c=>kn(o,c));if(t==="hash")return oi(o,s);if(t==="help")return li(o,s);if(t==="["||t==="test"){let c=s;if(t==="["){if(s[s.length-1]!=="]")return N("[: missing `]'\n",2);c=s.slice(0,-1)}return ys(o,c)}return null}async function hd(e,t,s){let{ctx:r,runCommand:n}=e;if(t.length===0)return K;let i=!1,a=!1,l=!1,o=t;for(;o.length>0&&o[0].startsWith("-");){let f=o[0];if(f==="--"){o=o.slice(1);break}for(let d of f.slice(1))d==="p"?i=!0:d==="V"?a=!0:d==="v"&&(l=!0);o=o.slice(1)}if(o.length===0)return K;if(l||a)return await zl(r,o,l,a);let[u,...c]=o;return n(u,c,[],s,!0,i,-1)}async function pd(e,t,s){let{runCommand:r}=e;if(t.length===0)return K;let n=t;if(n[0]==="--"&&(n=n.slice(1),n.length===0))return K;let i=n[0];if(!Kt.has(i))return N(`bash: builtin: ${i}: not a shell builtin -`);let[,...a]=n;return r(i,a,[],s,!0,!1,-1)}async function jl(e,t,s,r,n){let{ctx:i,buildExportedEnv:a,executeUserScript:l}=e,u=await Tl(i,t,n?"/usr/bin:/bin":void 0);if(!u)return Xo(t)?N(`bash: ${t}: command not available in browser environments. Exclude '${t}' from your commands or use the Node.js bundle. -`,127):N(`bash: ${t}: command not found -`,127);if("error"in u)return u.error==="permission_denied"?N(`bash: ${t}: Permission denied -`,126):N(`bash: ${t}: No such file or directory -`,127);if("script"in u)return t.includes("/")||(i.state.hashTable||(i.state.hashTable=new Map),i.state.hashTable.set(t,u.path)),await l(u.path,s,r);let{cmd:c,path:f}=u;t.includes("/")||(i.state.hashTable||(i.state.hashTable=new Map),i.state.hashTable.set(t,f));let d=r||i.state.groupStdin||"",h=a(),m={fs:i.fs,cwd:i.state.cwd,env:i.state.env,exportedEnv:h,stdin:d,limits:i.limits,exec:i.execFn,fetch:i.fetch,getRegisteredCommands:()=>Array.from(i.commands.keys()),sleep:i.sleep,trace:i.trace,fileDescriptors:i.state.fileDescriptors,xpgEcho:i.state.shoptOptions.xpg_echo,coverage:i.coverage,signal:i.state.signal,requireDefenseContext:i.requireDefenseContext,jsBootstrapCode:i.jsBootstrapCode,invokeTool:i.invokeTool},p=Ll(m,t);try{let y=()=>Di(i.requireDefenseContext,"command",`${t} execution`,()=>c.execute(s,p));return c.trusted?await Ie.runTrustedAsync(()=>y()):await y()}catch(y){if(y instanceof X||y instanceof gt)throw y;return N(`${t}: ${ut(ct(y))} -`)}}async function Si(e,t){let s=e.state.inCondition;e.state.inCondition=!0;let r="",n="",i=0;try{for(let a of t){let l=await e.executeStatement(a);r+=l.stdout,n+=l.stderr,i=l.exitCode}}finally{e.state.inCondition=s}return{stdout:r,stderr:n,exitCode:i}}function Ss(e,t,s,r){if(e instanceof Oe)return t+=e.stdout,s+=e.stderr,e.levels>1&&r>1?(e.levels--,e.stdout=t,e.stderr=s,{action:"rethrow",stdout:t,stderr:s,error:e}):{action:"break",stdout:t,stderr:s};if(e instanceof Te)return t+=e.stdout,s+=e.stderr,e.levels>1&&r>1?(e.levels--,e.stdout=t,e.stderr=s,{action:"rethrow",stdout:t,stderr:s,error:e}):{action:"continue",stdout:t,stderr:s};if(e instanceof ke||e instanceof ze||e instanceof Z||e instanceof X)return e.prependOutput(t,s),{action:"rethrow",stdout:t,stderr:s,error:e};let n=ct(e);return{action:"error",stdout:t,stderr:`${s}${n} -`,exitCode:1}}async function Nn(e,t,s="",r=""){let n=s,i=r,a=0;try{for(let l of t){let o=await e.executeStatement(l);n+=o.stdout,i+=o.stderr,a=o.exitCode}}catch(l){if(Is(l)||l instanceof ze||l instanceof Z||l instanceof X||l instanceof Et)throw l.prependOutput(n,i),l;return{stdout:n,stderr:`${i}${ct(l)} -`,exitCode:1}}return{stdout:n,stderr:i,exitCode:a}}async function Ul(e,t){let s="",r="";for(let n of t.clauses){let i=await Si(e,n.condition);if(s+=i.stdout,r+=i.stderr,i.exitCode===0)return Nn(e,n.body,s,r)}return t.elseBody?Nn(e,t.elseBody,s,r):_(s,r,0)}async function Zl(e,t){let s=await lt(e,t.redirections);if(s)return s;let r="",n="",i=0,a=0;if(!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(t.variable))return N(`bash: \`${t.variable}': not a valid identifier -`);let l=[];if(t.words===null)l=(e.state.env.get("@")||"").split(" ").filter(Boolean);else if(t.words.length===0)l=[];else try{for(let u of t.words){let c=await it(e,u);l.push(...c.values)}}catch(u){if(u instanceof wt)return{stdout:"",stderr:u.stderr,exitCode:1};throw u}e.state.loopDepth++;try{for(let u of l){a++,a>e.limits.maxLoopIterations&&at(`for loop: too many iterations (${e.limits.maxLoopIterations}), increase executionLimits.maxLoopIterations`,"iterations",r,n),e.state.env.set(t.variable,u);try{for(let c of t.body){let f=await e.executeStatement(c);r+=f.stdout,n+=f.stderr,i=f.exitCode}}catch(c){let f=Ss(c,r,n,e.state.loopDepth);if(r=f.stdout,n=f.stderr,f.action==="break")break;if(f.action==="continue")continue;if(f.action==="error"){let d=_(r,n,f.exitCode??1);return ue(e,d,t.redirections)}throw f.error}}}finally{e.state.loopDepth--}let o=_(r,n,i);return ue(e,o,t.redirections)}async function Gl(e,t){let s=await lt(e,t.redirections);if(s)return s;let r=t.line;r!==void 0&&(e.state.currentLine=r);let n="",i="",a=0,l=0;t.init&&await T(e,t.init.expression),e.state.loopDepth++;try{for(;l++,l>e.limits.maxLoopIterations&&at(`for loop: too many iterations (${e.limits.maxLoopIterations}), increase executionLimits.maxLoopIterations`,"iterations",n,i),!(t.condition&&(r!==void 0&&(e.state.currentLine=r),await T(e,t.condition.expression)===0));){try{for(let u of t.body){let c=await e.executeStatement(u);n+=c.stdout,i+=c.stderr,a=c.exitCode}}catch(u){let c=Ss(u,n,i,e.state.loopDepth);if(n=c.stdout,i=c.stderr,c.action==="break")break;if(c.action==="continue"){t.update&&await T(e,t.update.expression);continue}if(c.action==="error"){let f=_(n,i,c.exitCode??1);return ue(e,f,t.redirections)}throw c.error}t.update&&await T(e,t.update.expression)}}finally{e.state.loopDepth--}let o=_(n,i,a);return ue(e,o,t.redirections)}async function Hl(e,t,s=""){let r="",n="",i=0,a=0,l=s;for(let u of t.redirections)if((u.operator==="<<"||u.operator==="<<-")&&u.target.type==="HereDoc"){let c=u.target,f=await V(e,c.content);c.stripTabs&&(f=f.split(` -`).map(d=>d.replace(/^\t+/,"")).join(` -`)),l=f}else if(u.operator==="<<<"&&u.target.type==="Word")l=`${await V(e,u.target)} -`;else if(u.operator==="<"&&u.target.type==="Word")try{let c=await V(e,u.target),f=e.fs.resolvePath(e.state.cwd,c);l=await e.fs.readFile(f)}catch{let c=await V(e,u.target);return N(`bash: ${c}: No such file or directory -`)}let o=e.state.groupStdin;l&&(e.state.groupStdin=l),e.state.loopDepth++;try{for(;;){a++,a>e.limits.maxLoopIterations&&at(`while loop: too many iterations (${e.limits.maxLoopIterations}), increase executionLimits.maxLoopIterations`,"iterations",r,n);let u=0,c=!1,f=!1,d=e.state.inCondition;e.state.inCondition=!0;try{for(let h of t.condition){let m=await e.executeStatement(h);r+=m.stdout,n+=m.stderr,u=m.exitCode}}catch(h){if(h instanceof Oe){if(r+=h.stdout,n+=h.stderr,h.levels>1&&e.state.loopDepth>1)throw h.levels--,h.stdout=r,h.stderr=n,e.state.inCondition=d,h;c=!0}else if(h instanceof Te){if(r+=h.stdout,n+=h.stderr,h.levels>1&&e.state.loopDepth>1)throw h.levels--,h.stdout=r,h.stderr=n,e.state.inCondition=d,h;f=!0}else throw e.state.inCondition=d,h}finally{e.state.inCondition=d}if(c)break;if(!f){if(u!==0)break;try{for(let h of t.body){let m=await e.executeStatement(h);r+=m.stdout,n+=m.stderr,i=m.exitCode}}catch(h){let m=Ss(h,r,n,e.state.loopDepth);if(r=m.stdout,n=m.stderr,m.action==="break")break;if(m.action==="continue")continue;if(m.action==="error")return _(r,n,m.exitCode??1);throw m.error}}}}finally{e.state.loopDepth--,e.state.groupStdin=o}return _(r,n,i)}async function Ql(e,t){let s="",r="",n=0,i=0;e.state.loopDepth++;try{for(;;){i++,i>e.limits.maxLoopIterations&&at(`until loop: too many iterations (${e.limits.maxLoopIterations}), increase executionLimits.maxLoopIterations`,"iterations",s,r);let a=await Si(e,t.condition);if(s+=a.stdout,r+=a.stderr,a.exitCode===0)break;try{for(let l of t.body){let o=await e.executeStatement(l);s+=o.stdout,r+=o.stderr,n=o.exitCode}}catch(l){let o=Ss(l,s,r,e.state.loopDepth);if(s=o.stdout,r=o.stderr,o.action==="break")break;if(o.action==="continue")continue;if(o.action==="error")return _(s,r,o.exitCode??1);throw o.error}}}finally{e.state.loopDepth--}return _(s,r,n)}async function Kl(e,t){let s=await lt(e,t.redirections);if(s)return s;let r="",n="",i=0,a=await V(e,t.word),l=!1;for(let u=0;ugd(t)).join(" ")}function gd(e){if(e==="")return"''";if(!/[\s'"\\$`!*?[\]{}|&;<>()~#\n\t]/.test(e))return e;let s=/[\x00-\x1f\x7f]/.test(e),r=e.includes(` -`),n=e.includes(" "),i=e.includes("\\"),a=e.includes("'");if(s||r||n||i){let o="";for(let u of e){let c=u.charCodeAt(0);u===` -`?o+="\\n":u===" "?o+="\\t":u==="\\"?o+="\\\\":u==="'"?o+="'":u==='"'?o+='"':c<32||c===127?c<256?o+=`\\x${c.toString(16).padStart(2,"0")}`:o+=`\\u${c.toString(16).padStart(4,"0")}`:o+=u}return`$'${o}'`}return a?`"${e.replace(/([\\$`"])/g,"\\$1")}"`:`'${e}'`}async function ec(e,t,s){if(!e.state.options.xtrace)return"";let r=await Jl(e),n=[t,...s],i=md(n);return`${r}${i} -`}async function tc(e,t,s){return e.state.options.xtrace?`${await Jl(e)}${t}=${s} -`:""}async function sc(e,t,s){let r=t.timed?Bn():0,n="",i=K,a=0,l=[],o="",u=t.commands.length>1,c=e.state.lastArg;for(let d=0;d1)v={stdout:E.stdout,stderr:E.stderr,exitCode:E.exitCode};else if(E instanceof ze&&t.commands.length>1)v={stdout:E.stdout,stderr:E.stderr,exitCode:E.exitCode};else throw b&&(e.state.env=b),E}b&&(e.state.env=b),l.push(v.exitCode),v.exitCode!==0&&(a=v.exitCode),m?i=v:(t.pipeStderr?.[d]??!1?n=yt(v.stderr)+Cs(v):(n=Cs(v),o+=v.stderr),i={stdout:"",stderr:"",exitCode:v.exitCode})}if(o&&(i={...i,stderr:o+i.stderr}),t.commands.length>1||t.commands.length===1&&t.commands[0].type==="SimpleCommand"){for(let d of e.state.env.keys())d.startsWith("PIPESTATUS_")&&e.state.env.delete(d);for(let d=0;d{let c=`${s}_`;for(let f of e.state.env.keys())f.startsWith(c)&&!f.includes("__")&&e.state.env.delete(f);e.state.env.delete(s)};if(l&&o?await Ed(e,t,s,r,n,u,c=>{a+=c}):o?await bd(e,s,r,n,u):await vd(e,s,r,n,u),t.name){i.set(s,e.state.env.get(s));let f=`(${r.map(d=>Ut(d)).join(" ")})`;e.state.env.set(s,f)}return{continueToNext:!0,xtraceOutput:a}}function wd(e){return e.some(t=>{if(t.parts.length>=2){let s=t.parts[0],r=t.parts[1];if(s.type!=="Glob"||!s.pattern.startsWith("["))return!1;if(s.pattern==="["&&(r.type==="DoubleQuoted"||r.type==="SingleQuoted")){if(t.parts.length<3)return!1;let n=t.parts[2];return n.type!=="Literal"?!1:n.value.startsWith("]=")||n.value.startsWith("]+=")}return r.type!=="Literal"?!1:r.value.startsWith("]")?r.value.startsWith("]=")||r.value.startsWith("]+="):s.pattern.endsWith("]")?r.value.startsWith("=")||r.value.startsWith("+="):!1}return!1})}async function Ed(e,t,s,r,n,i,a){let l=[];for(let o of r){let u=br(o);if(u){let{key:c,valueParts:f,append:d}=u,h;f.length>0?h=await V(e,{type:"Word",parts:f}):h="",h=de(e,h),l.push({type:"keyed",key:c,value:h,append:d})}else{let c=await V(e,o);l.push({type:"invalid",expandedValue:c})}}n||i();for(let o of l)if(o.type==="keyed")if(o.append){let u=e.state.env.get(`${s}_${o.key}`)??"";e.state.env.set(`${s}_${o.key}`,u+o.value)}else e.state.env.set(`${s}_${o.key}`,o.value);else{let u=t.line??e.state.currentLine??1;a(`bash: line ${u}: ${s}: ${o.expandedValue}: must use subscript when assigning associative array -`)}}async function bd(e,t,s,r,n){let i=[];for(let l of s){let o=br(l);if(o){let{key:u,valueParts:c,append:f}=o,d;c.length>0?d=await V(e,{type:"Word",parts:c}):d="",d=de(e,d),i.push({type:"keyed",indexExpr:u,value:d,append:f})}else{let u=await it(e,l);i.push({type:"non-keyed",values:u.values})}}r||n();let a=0;for(let l of i)if(l.type==="keyed"){let o;try{let u=new q,c=Y(u,l.indexExpr);o=await T(e,c.expression,!1)}catch{if(/^-?\d+$/.test(l.indexExpr))o=Number.parseInt(l.indexExpr,10);else{let u=e.state.env.get(l.indexExpr);o=u?Number.parseInt(u,10):0,Number.isNaN(o)&&(o=0)}}if(l.append){let u=e.state.env.get(`${t}_${o}`)??"";e.state.env.set(`${t}_${o}`,u+l.value)}else e.state.env.set(`${t}_${o}`,l.value);a=o+1}else for(let o of l.values)e.state.env.set(`${t}_${a++}`,o)}async function vd(e,t,s,r,n){let i=[];for(let l of s){let o=await it(e,l);i.push(...o.values)}let a=0;if(r){let l=B(e,t);if(l.length>0)a=Math.max(...l.map(([u])=>typeof u=="number"?u:0))+1;else{let o=e.state.env.get(t);o!==void 0&&(e.state.env.set(`${t}_0`,o),e.state.env.delete(t),a=1)}}else n();for(let l=0;l0){let d=e.state.localScopes[e.state.localScopes.length-1];d.has(u)||d.set(u,e.state.env.get(u))}e.state.env.set(u,c)}return{continueToNext:!0,xtraceOutput:""}}async function rc(e,t,s){let r;if(s.startsWith("'")&&s.endsWith("'"))r=s.slice(1,-1);else if(s.startsWith('"')&&s.endsWith('"')){let n=s.slice(1,-1),a=new q().parseWordFromString(n,!0,!1);r=await V(e,a)}else if(s.includes("$")){let i=new q().parseWordFromString(s,!1,!1);r=await V(e,i)}else r=s;return`${t}_${r}`}async function Ad(e,t,s){let r=s;s.startsWith('"')&&s.endsWith('"')&&s.length>=2&&(r=s.slice(1,-1));let n;if(/^-?\d+$/.test(r))n=Number.parseInt(r,10);else{try{let i=new q,a=Y(i,r);n=await T(e,a.expression,!1)}catch(i){if(i instanceof se){let o=`bash: line ${e.state.currentLine}: ${s}: ${i.message} -`;if(i.fatal)throw new Z(1,"",o);return{index:0,error:_("",o,1)}}let a=e.state.env.get(s);n=a?Number.parseInt(a,10):0}Number.isNaN(n)&&(n=0)}if(n<0){let i=B(e,t);if(i.length===0){let l=e.state.currentLine;return{index:0,error:_("",`bash: line ${l}: ${t}[${s}]: bad array subscript -`,1)}}if(n=Math.max(...i.map(([l])=>typeof l=="number"?l:0))+1+n,n<0){let l=e.state.currentLine;return{index:0,error:_("",`bash: line ${l}: ${t}[${s}]: bad array subscript -`,1)}}}return{index:n}}async function $d(e,t,s,r,n,i){let a="",l=s,o=null;if(te(e,s)){let f=Va(e,s,r);if(f===void 0)return{continueToNext:!1,xtraceOutput:"",error:_("",`bash: ${s}: circular name reference -`,1)};if(f===null)return{continueToNext:!0,xtraceOutput:""};l=f;let d=l.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(.+)\]$/);d&&(o={arrayName:d[1],subscriptExpr:d[2]},l=d[1])}if(rt(e,l)){if(t.name)return a+=`bash: ${l}: readonly variable -`,{continueToNext:!0,xtraceOutput:a};let f=ye(e,l);if(f)return{continueToNext:!1,xtraceOutput:"",error:f}}let u;if(ws(e,l))try{let f=new q;if(n){let h=`(${e.state.env.get(l)||"0"}) + (${r})`,m=Y(f,h);u=String(await T(e,m.expression))}else{let d=Y(f,r);u=String(await T(e,d.expression))}}catch{u="0"}else{let f=He(e,l)?`${l}_0`:l;u=n?(e.state.env.get(f)||"")+r:r}u=Jt(e,l,u),a+=await tc(e,l,u);let c=l;return o?c=await Pd(e,o):He(e,l)&&(c=`${l}_0`),t.name?(i.set(c,e.state.env.get(c)),e.state.env.set(c,u)):(e.state.env.set(c,u),e.state.options.allexport&&(e.state.exportedVars=e.state.exportedVars||new Set,e.state.exportedVars.add(l)),e.state.tempEnvBindings?.some(f=>f.has(l))&&(e.state.mutatedTempEnvVars=e.state.mutatedTempEnvVars||new Set,e.state.mutatedTempEnvVars.add(l))),{continueToNext:!1,xtraceOutput:a}}async function Pd(e,t){let{arrayName:s,subscriptExpr:r}=t;if(e.state.associativeArrays?.has(s))return rc(e,s,r);let i;if(/^-?\d+$/.test(r))i=Number.parseInt(r,10);else{try{let a=new q,l=Y(a,r);i=await T(e,l.expression,!1)}catch{let a=e.state.env.get(r);i=a?Number.parseInt(a,10):0}Number.isNaN(i)&&(i=0)}if(i<0){let a=B(e,s);a.length>0&&(i=Math.max(...a.map(o=>o[0]))+1+i)}return`${s}_${i}`}async function ic(e,t,s,r){let n=await lt(e,t.redirections);if(n)return n;let i=new Map(e.state.env),a=e.state.cwd,l={...e.state.options},o=new Map(e.state.functions),u=e.state.localScopes,c=e.state.localVarStack,f=e.state.localVarDepth,d=e.state.fullyUnsetLocals;if(e.state.localScopes=u.map($=>new Map($)),c){e.state.localVarStack=new Map;for(let[$,R]of c.entries())e.state.localVarStack.set($,R.map(C=>({...C})))}f&&(e.state.localVarDepth=new Map(f)),d&&(e.state.fullyUnsetLocals=new Map(d));let h=e.state.loopDepth,m=e.state.parentHasLoopContext;e.state.parentHasLoopContext=h>0,e.state.loopDepth=0;let p=e.state.lastArg,y=e.state.bashPid;e.state.bashPid=e.state.nextVirtualPid++;let b=e.state.groupStdin;s&&(e.state.groupStdin=s);let v="",E="",w=0,S=()=>{e.state.env=i,e.state.cwd=a,e.state.options=l,e.state.functions=o,e.state.localScopes=u,e.state.localVarStack=c,e.state.localVarDepth=f,e.state.fullyUnsetLocals=d,e.state.loopDepth=h,e.state.parentHasLoopContext=m,e.state.groupStdin=b,e.state.bashPid=y,e.state.lastArg=p};try{for(let $ of t.body){let R=await r($);v+=R.stdout,E+=R.stderr,w=R.exitCode}}catch($){if(S(),$ instanceof X)throw $;if($ instanceof Et){v+=$.stdout,E+=$.stderr;let C=_(v,E,0);return ue(e,C,t.redirections)}if($ instanceof Oe||$ instanceof Te){v+=$.stdout,E+=$.stderr;let C=_(v,E,0);return ue(e,C,t.redirections)}if($ instanceof Z){v+=$.stdout,E+=$.stderr;let C=_(v,E,$.exitCode);return ue(e,C,t.redirections)}if($ instanceof ke){v+=$.stdout,E+=$.stderr;let C=_(v,E,$.exitCode);return ue(e,C,t.redirections)}if($ instanceof ze){let C=_(v+$.stdout,E+$.stderr,$.exitCode);return ue(e,C,t.redirections)}let R=_(v,`${E}${ct($)} -`,1);return ue(e,R,t.redirections)}S();let A=_(v,E,w);return ue(e,A,t.redirections)}async function ac(e,t,s,r){let n="",i="",a=0,l=await En(e,t.redirections);if(l)return l;let o=s;for(let f of t.redirections)if((f.operator==="<<"||f.operator==="<<-")&&f.target.type==="HereDoc"){let d=f.target,h=await V(e,d.content);d.stripTabs&&(h=h.split(` -`).map(p=>p.replace(/^\t+/,"")).join(` -`));let m=f.fd??0;m!==0?(e.state.fileDescriptors||(e.state.fileDescriptors=new Map),Ae(e),e.state.fileDescriptors.set(m,h)):o=h}else if(f.operator==="<<<"&&f.target.type==="Word")o=`${await V(e,f.target)} -`;else if(f.operator==="<"&&f.target.type==="Word")try{let d=await V(e,f.target),h=e.fs.resolvePath(e.state.cwd,d);o=await e.fs.readFile(h)}catch{let d=await V(e,f.target);return _("",`bash: ${d}: No such file or directory -`,1)}let u=e.state.groupStdin;o&&(e.state.groupStdin=o);try{for(let f of t.body){let d=await r(f);n+=d.stdout,i+=d.stderr,a=d.exitCode}}catch(f){if(e.state.groupStdin=u,f instanceof X)throw f;if(Is(f)||f instanceof ze||f instanceof Z)throw f.prependOutput(n,i),f;return _(n,`${i}${ct(f)} -`,1)}e.state.groupStdin=u;let c=_(n,i,a);return ue(e,c,t.redirections)}async function oc(e,t,s,r,n){let i;try{i=await e.fs.readFile(t)}catch{return N(`bash: ${t}: No such file or directory -`,127)}if(i.startsWith("#!")){let y=i.indexOf(` -`);y!==-1&&(i=i.slice(y+1))}let a=new Map(e.state.env),l=e.state.cwd,o={...e.state.options},u=e.state.loopDepth,c=e.state.parentHasLoopContext,f=e.state.lastArg,d=e.state.bashPid,h=e.state.groupStdin,m=e.state.currentSource;e.state.parentHasLoopContext=u>0,e.state.loopDepth=0,e.state.bashPid=e.state.nextVirtualPid++,r&&(e.state.groupStdin=r),e.state.currentSource=t,e.state.env.set("0",t),e.state.env.set("#",String(s.length)),e.state.env.set("@",s.join(" ")),e.state.env.set("*",s.join(" "));for(let y=0;y{e.state.env=a,e.state.cwd=l,e.state.options=o,e.state.loopDepth=u,e.state.parentHasLoopContext=c,e.state.lastArg=f,e.state.bashPid=d,e.state.groupStdin=h,e.state.currentSource=m};try{let b=new q().parse(i),v=await n(b);return p(),v}catch(y){if(p(),y instanceof Z||y instanceof X)throw y;if(y.name==="ParseException")return N(`bash: ${t}: ${y.message} -`);throw y}}var As=class{ctx;constructor(t,s){this.ctx={state:s,fs:t.fs,commands:t.commands,limits:t.limits,execFn:t.exec,executeScript:this.executeScript.bind(this),executeStatement:this.executeStatement.bind(this),executeCommand:this.executeCommand.bind(this),fetch:t.fetch,sleep:t.sleep,trace:t.trace,coverage:t.coverage,requireDefenseContext:t.requireDefenseContext??!1,jsBootstrapCode:t.jsBootstrapCode,invokeTool:t.invokeTool}}assertDefenseContext(t){if(!this.ctx.requireDefenseContext||Ie.isInSandboxedContext())return;let s=`interpreter ${t} attempted outside defense context`;throw new gt(s,{timestamp:Date.now(),type:"missing_defense_context",message:s,path:"DefenseInDepthBox.context",stack:new Error().stack,executionId:Ie.getCurrentExecutionId()})}buildExportedEnv(){let t=this.ctx.state.exportedVars,s=this.ctx.state.tempExportedVars,r=new Set;if(t)for(let i of t)r.add(i);if(s)for(let i of s)r.add(i);if(r.size===0)return Object.create(null);let n=Object.create(null);for(let i of r){let a=this.ctx.state.env.get(i);a!==void 0&&(n[i]=a)}return n}async executeScript(t){this.assertDefenseContext("execution");let s="",r="",n=0,i=this.ctx.limits.maxOutputSize,a=(l,o)=>{s.length+r.length+l.length+o.length>i&&at(`total output size exceeded (>${i} bytes), increase executionLimits.maxOutputSize`,"output_size"),s+=l,r+=o};for(let l of t.statements)try{let o=await this.executeStatement(l);a(Vn(o),o.stderr),n=o.exitCode,this.ctx.state.lastExitCode=n,this.ctx.state.env.set("?",String(n))}catch(o){if(o instanceof Z)throw o.prependOutput(s,r),o;if(o instanceof Be)return a(o.stdout,o.stderr),n=o.exitCode,this.ctx.state.lastExitCode=n,this.ctx.state.env.set("?",String(n)),{stdout:s,stderr:r,exitCode:n,env:bt(this.ctx.state.env)};if(o instanceof X)throw o;if(o instanceof ze)return a(o.stdout,o.stderr),n=o.exitCode,this.ctx.state.lastExitCode=n,this.ctx.state.env.set("?",String(n)),{stdout:s,stderr:r,exitCode:n,env:bt(this.ctx.state.env)};if(o instanceof Le)return a(o.stdout,o.stderr),n=1,this.ctx.state.lastExitCode=n,this.ctx.state.env.set("?",String(n)),{stdout:s,stderr:r,exitCode:n,env:bt(this.ctx.state.env)};if(o instanceof Me)return a(o.stdout,o.stderr),n=1,this.ctx.state.lastExitCode=n,this.ctx.state.env.set("?",String(n)),{stdout:s,stderr:r,exitCode:n,env:bt(this.ctx.state.env)};if(o instanceof se){a(o.stdout,o.stderr),n=1,this.ctx.state.lastExitCode=n,this.ctx.state.env.set("?",String(n));continue}if(o instanceof Ds){a(o.stdout,o.stderr),n=1,this.ctx.state.lastExitCode=n,this.ctx.state.env.set("?",String(n));continue}if(o instanceof Oe||o instanceof Te){if(this.ctx.state.loopDepth>0)throw o.prependOutput(s,r),o;a(o.stdout,o.stderr);continue}throw o instanceof ke&&o.prependOutput(s,r),o}return{stdout:s,stderr:r,exitCode:n,env:bt(this.ctx.state.env)}}async executeUserScript(t,s,r=""){return oc(this.ctx,t,s,r,n=>this.executeScript(n))}async executeStatement(t){if(this.assertDefenseContext("statement"),this.ctx.state.signal?.aborted)throw new Rs;if(this.ctx.state.commandCount++,this.ctx.state.commandCount>this.ctx.limits.maxCommandCount&&at(`too many commands executed (>${this.ctx.limits.maxCommandCount}), increase executionLimits.maxCommandCount`,"commands"),t.deferredError)throw new Ee(t.deferredError.message,t.line??1,1);if(this.ctx.state.options.noexec)return K;this.ctx.state.errexitSafe=!1;let s="",r="";this.ctx.state.options.verbose&&!this.ctx.state.suppressVerbose&&t.sourceText&&(r+=`${t.sourceText} -`);let n=0,i=-1,a=!1;for(let u=0;u0?t.operators[u-1]:null;if(f==="&&"&&n!==0||f==="||"&&n===0)continue;let d=await this.executePipeline(c);s+=Vn(d),r+=d.stderr,n=d.exitCode,i=u,a=c.negated,this.ctx.state.lastExitCode=n,this.ctx.state.env.set("?",String(n))}let l=ithis.executeCommand(s,r))}async executeCommand(t,s){switch(this.assertDefenseContext("command"),this.ctx.coverage?.hit(`bash:cmd:${t.type}`),t.type){case"SimpleCommand":return this.executeSimpleCommand(t,s);case"If":return Ul(this.ctx,t);case"For":return Zl(this.ctx,t);case"CStyleFor":return Gl(this.ctx,t);case"While":return Hl(this.ctx,t,s);case"Until":return Ql(this.ctx,t);case"Case":return Kl(this.ctx,t);case"Subshell":return this.executeSubshell(t,s);case"Group":return this.executeGroup(t,s);case"FunctionDef":return dl(this.ctx,t);case"ArithmeticCommand":return this.executeArithmeticCommand(t);case"ConditionalCommand":return this.executeConditionalCommand(t);default:return K}}async executeSimpleCommand(t,s){try{return await this.executeSimpleCommandInner(t,s)}catch(r){if(r instanceof wt)return N(r.stderr);throw r}}async executeSimpleCommandInner(t,s){if(t.line!==void 0&&(this.ctx.state.currentLine=t.line),this.ctx.state.shoptOptions.expand_aliases&&t.name){let w=t,S=100;for(;S>0;){let A=this.expandAlias(w);if(A===w)break;w=A,S--}this.aliasExpansionStack.clear(),w!==t&&(t=w)}this.ctx.state.expansionStderr="";let r=await nc(this.ctx,t);if(r.error)return r.error;let n=r.tempAssignments,i=r.xtraceOutput;if(!t.name){if(t.redirections.length>0){let S=await lt(this.ctx,t.redirections);if(S)return S;let A=_("",i,0);return ue(this.ctx,A,t.redirections)}this.ctx.state.lastArg="";let w=(this.ctx.state.expansionStderr||"")+i;return this.ctx.state.expansionStderr="",_("",w,this.ctx.state.lastExitCode)}let a=t.name&&Ai(t.name,["local","declare","typeset","export","readonly"]),l=Array.from(n.keys());if(l.length>0&&!a){this.ctx.state.tempExportedVars=this.ctx.state.tempExportedVars||new Set;for(let w of l)this.ctx.state.tempExportedVars.add(w)}let o=await En(this.ctx,t.redirections);if(o){for(let[w,S]of n)S===void 0?this.ctx.state.env.delete(w):this.ctx.state.env.set(w,S);return o}let u=-1;for(let w of t.redirections){if((w.operator==="<<"||w.operator==="<<-")&&w.target.type==="HereDoc"){let S=w.target,A=await V(this.ctx,S.content);S.stripTabs&&(A=A.split(` -`).map(R=>R.replace(/^\t+/,"")).join(` -`)),A=yt(A);let $=w.fd??0;$!==0?(this.ctx.state.fileDescriptors||(this.ctx.state.fileDescriptors=new Map),Ae(this.ctx),this.ctx.state.fileDescriptors.set($,A)):s=A;continue}if(w.operator==="<<<"&&w.target.type==="Word"){s=yt(`${await V(this.ctx,w.target)} -`);continue}if(w.operator==="<"&&w.target.type==="Word")try{let S=await V(this.ctx,w.target),A=this.ctx.fs.resolvePath(this.ctx.state.cwd,S);s=await xs(this.ctx.fs,A)}catch{let S=await V(this.ctx,w.target);for(let[A,$]of n)$===void 0?this.ctx.state.env.delete(A):this.ctx.state.env.set(A,$);return N(`bash: ${S}: No such file or directory -`)}if(w.operator==="<&"&&w.target.type==="Word"){let S=await V(this.ctx,w.target),A=Number.parseInt(S,10);if(!Number.isNaN(A)&&this.ctx.state.fileDescriptors){let $=this.ctx.state.fileDescriptors.get(A);if($!==void 0)if($.startsWith("__rw__:")){let R=Xl($);R&&(s=R.content.slice(R.position),u=A)}else $.startsWith("__file__:")||$.startsWith("__file_append__:")||(s=$)}}}let c=await V(this.ctx,t.name),f=[],d=[];if(Ai(t.name,["local","declare","typeset","export","readonly"])&&(c==="local"||c==="declare"||c==="typeset"||c==="export"||c==="readonly"))for(let w of t.args){let S=await Qo(this.ctx,w);if(S)f.push(S),d.push(!0);else{let A=await Ko(this.ctx,w);if(A!==null)f.push(A),d.push(!0);else{let $=await it(this.ctx,w);for(let R of $.values)f.push(R),d.push($.quoted)}}}else for(let w of t.args){let S=await it(this.ctx,w);for(let A of S.values)f.push(A),d.push(S.quoted)}if(!c){if(t.name.parts.every(S=>S.type==="CommandSubstitution"||S.type==="ParameterExpansion"||S.type==="ArithmeticExpansion")){if(f.length>0){let S=f.shift();return d.shift(),await this.runCommand(S,f,d,s,!1,!1,u)}return _("","",this.ctx.state.lastExitCode)}return N(`bash: : command not found -`,127)}if(c==="exec"&&(f.length===0||f[0]==="--")){for(let w of t.redirections){if(w.target.type==="HereDoc"||w.fdVariable)continue;let S=await V(this.ctx,w.target),A=w.fd??(w.operator==="<"||w.operator==="<>"?0:1);switch(this.ctx.state.fileDescriptors||(this.ctx.state.fileDescriptors=new Map),w.operator){case">":case">|":{let $=this.ctx.fs.resolvePath(this.ctx.state.cwd,S);await this.ctx.fs.writeFile($,"","utf8"),Ae(this.ctx),this.ctx.state.fileDescriptors.set(A,`__file__:${$}`);break}case">>":{let $=this.ctx.fs.resolvePath(this.ctx.state.cwd,S);Ae(this.ctx),this.ctx.state.fileDescriptors.set(A,`__file_append__:${$}`);break}case"<":{let $=this.ctx.fs.resolvePath(this.ctx.state.cwd,S);try{let R=await this.ctx.fs.readFile($);Ae(this.ctx),this.ctx.state.fileDescriptors.set(A,R)}catch{return N(`bash: ${S}: No such file or directory -`)}break}case"<>":{let $=this.ctx.fs.resolvePath(this.ctx.state.cwd,S);try{let R=await this.ctx.fs.readFile($);Ae(this.ctx),this.ctx.state.fileDescriptors.set(A,`__rw__:${$.length}:${$}:0:${R}`)}catch{await this.ctx.fs.writeFile($,"","utf8"),Ae(this.ctx),this.ctx.state.fileDescriptors.set(A,`__rw__:${$.length}:${$}:0:`)}break}case">&":{if(S==="-")this.ctx.state.fileDescriptors.delete(A);else if(S.endsWith("-")){let $=S.slice(0,-1),R=Number.parseInt($,10);if(!Number.isNaN(R)){let C=this.ctx.state.fileDescriptors.get(R);C!==void 0?this.ctx.state.fileDescriptors.set(A,C):this.ctx.state.fileDescriptors.set(A,`__dupout__:${R}`),this.ctx.state.fileDescriptors.delete(R)}}else{let $=Number.parseInt(S,10);Number.isNaN($)||(Ae(this.ctx),this.ctx.state.fileDescriptors.set(A,`__dupout__:${$}`))}break}case"<&":{if(S==="-")this.ctx.state.fileDescriptors.delete(A);else if(S.endsWith("-")){let $=S.slice(0,-1),R=Number.parseInt($,10);if(!Number.isNaN(R)){let C=this.ctx.state.fileDescriptors.get(R);C!==void 0?this.ctx.state.fileDescriptors.set(A,C):this.ctx.state.fileDescriptors.set(A,`__dupin__:${R}`),this.ctx.state.fileDescriptors.delete(R)}}else{let $=Number.parseInt(S,10);Number.isNaN($)||(Ae(this.ctx),this.ctx.state.fileDescriptors.set(A,`__dupin__:${$}`))}break}}}for(let[w,S]of n)S===void 0?this.ctx.state.env.delete(w):this.ctx.state.env.set(w,S);if(this.ctx.state.tempExportedVars)for(let w of n.keys())this.ctx.state.tempExportedVars.delete(w);return K}if(this.ctx.state.extraArgs){f.push(...this.ctx.state.extraArgs);for(let w=0;w0&&(this.ctx.state.tempEnvBindings=this.ctx.state.tempEnvBindings||[],this.ctx.state.tempEnvBindings.push(new Map(n)));let p,y=null;try{p=await this.runCommand(c,f,d,s,!1,!1,u)}catch(w){if(w instanceof Oe||w instanceof Te)y=w,p=K;else throw w}let b=i+m;if(b&&(p={...p,stderr:b+p.stderr}),p=await ue(this.ctx,p,t.redirections),y)throw y;if(f.length>0){let w=f[f.length-1];if((c==="declare"||c==="local"||c==="typeset")&&/^[a-zA-Z_][a-zA-Z0-9_]*=\(/.test(w)){let S=w.match(/^([a-zA-Z_][a-zA-Z0-9_]*)=\(/);S&&(w=S[1])}this.ctx.state.lastArg=w}else this.ctx.state.lastArg=c;let v=ul(c)&&c!=="unset"&&c!=="eval";if(!this.ctx.state.options.posix||!v)for(let[w,S]of n)this.ctx.state.fullyUnsetLocals?.has(w)||(S===void 0?this.ctx.state.env.delete(w):this.ctx.state.env.set(w,S));if(this.ctx.state.tempExportedVars)for(let w of n.keys())this.ctx.state.tempExportedVars.delete(w);return n.size>0&&this.ctx.state.tempEnvBindings&&this.ctx.state.tempEnvBindings.pop(),this.ctx.state.expansionStderr&&(p={...p,stderr:this.ctx.state.expansionStderr+p.stderr},this.ctx.state.expansionStderr=""),p}async runCommand(t,s,r,n,i=!1,a=!1,l=-1){let o={ctx:this.ctx,runCommand:(c,f,d,h,m,p,y)=>this.runCommand(c,f,d,h,m,p,y),buildExportedEnv:()=>this.buildExportedEnv(),executeUserScript:(c,f,d)=>this.executeUserScript(c,f,d)},u=await ql(o,t,s,r,n,i,a,l);return u!==null?u:jl(o,t,s,n,a)}aliasExpansionStack=new Set;expandAlias(t){return mr(this.ctx.state,t,this.aliasExpansionStack)}async findCommandInPath(t){return kn(this.ctx,t)}async executeSubshell(t,s=""){return ic(this.ctx,t,s,r=>this.executeStatement(r))}async executeGroup(t,s=""){return ac(this.ctx,t,s,r=>this.executeStatement(r))}async executeArithmeticCommand(t){t.line!==void 0&&(this.ctx.state.currentLine=t.line);let s=await lt(this.ctx,t.redirections);if(s)return s;try{let r=await T(this.ctx,t.expression.expression),n=pe(r!==0);return this.ctx.state.expansionStderr&&(n={...n,stderr:this.ctx.state.expansionStderr+n.stderr},this.ctx.state.expansionStderr=""),ue(this.ctx,n,t.redirections)}catch(r){let n=N(`bash: arithmetic expression: ${r.message} -`);return ue(this.ctx,n,t.redirections)}}async executeConditionalCommand(t){t.line!==void 0&&(this.ctx.state.currentLine=t.line);let s=await lt(this.ctx,t.redirections);if(s)return s;try{let r=await xt(this.ctx,t.expression),n=pe(r);return this.ctx.state.expansionStderr&&(n={...n,stderr:this.ctx.state.expansionStderr+n.stderr},this.ctx.state.expansionStderr=""),ue(this.ctx,n,t.redirections)}catch(r){let n=r instanceof se?1:2,i=N(`bash: conditional expression: ${r.message} -`,n);return ue(this.ctx,i,t.redirections)}}};var we={maxCallDepth:100,maxCommandCount:1e4,maxLoopIterations:1e4,maxAwkIterations:1e4,maxSedIterations:1e4,maxJqIterations:1e4,maxSqliteTimeoutMs:5e3,maxPythonTimeoutMs:1e4,maxJsTimeoutMs:1e4,maxGlobOperations:1e5,maxStringLength:10485760,maxArrayElements:1e5,maxHeredocSize:10485760,maxSubstitutionDepth:50,maxBraceExpansionResults:1e4,maxOutputSize:10485760,maxFileDescriptors:1024,maxSourceDepth:100};function lc(e){return e?{maxCallDepth:e.maxCallDepth??we.maxCallDepth,maxCommandCount:e.maxCommandCount??we.maxCommandCount,maxLoopIterations:e.maxLoopIterations??we.maxLoopIterations,maxAwkIterations:e.maxAwkIterations??we.maxAwkIterations,maxSedIterations:e.maxSedIterations??we.maxSedIterations,maxJqIterations:e.maxJqIterations??we.maxJqIterations,maxSqliteTimeoutMs:e.maxSqliteTimeoutMs??we.maxSqliteTimeoutMs,maxPythonTimeoutMs:e.maxPythonTimeoutMs??we.maxPythonTimeoutMs,maxJsTimeoutMs:e.maxJsTimeoutMs??we.maxJsTimeoutMs,maxGlobOperations:e.maxGlobOperations??we.maxGlobOperations,maxStringLength:e.maxStringLength??we.maxStringLength,maxArrayElements:e.maxArrayElements??we.maxArrayElements,maxHeredocSize:e.maxHeredocSize??we.maxHeredocSize,maxSubstitutionDepth:e.maxSubstitutionDepth??we.maxSubstitutionDepth,maxBraceExpansionResults:e.maxBraceExpansionResults??we.maxBraceExpansionResults,maxOutputSize:e.maxOutputSize??we.maxOutputSize,maxFileDescriptors:e.maxFileDescriptors??we.maxFileDescriptors,maxSourceDepth:e.maxSourceDepth??we.maxSourceDepth}:{...we}}import{lookup as Td}from"node:dns";function $i(e){try{let t=new URL(e);return{origin:t.origin,pathname:t.pathname,href:t.href}}catch{return null}}function kd(e){let t=$i(e);return t?{origin:t.origin,pathPrefix:t.pathname}:null}function cc(e){if(e.includes("\\"))return!0;let t=e.toLowerCase();return t.includes("%2f")||t.includes("%5c")}function Nd(e,t){return t==="/"||t===""?!0:t.endsWith("/")?e.startsWith(t):e===t||e.startsWith(`${t}/`)}function Pi(e,t){let s=$i(e);if(!s)return!1;let r=kd(t);return!r||s.origin!==r.origin||r.pathPrefix!=="/"&&r.pathPrefix!==""&&cc(s.pathname)?!1:Nd(s.pathname,r.pathPrefix)}function uc(e){return typeof e=="string"?e:e.url}function fc(e,t){return!t||t.length===0?!1:t.some(s=>Pi(e,uc(s)))}function ki(e){let t=_d(e);if(t==="localhost"||t.endsWith(".localhost"))return!0;let s=dc(t);if(s)return _n(s);let r=Cd(t);return r?Dd(r):!1}function _d(e){let t=e.trim().toLowerCase();return t.startsWith("[")&&t.endsWith("]")?t.slice(1,-1):t}function xd(e){if(!e)return null;let t=10,s=e;if(s.startsWith("0x")||s.startsWith("0X")?(t=16,s=s.slice(2)):s.length>1&&s.startsWith("0")&&(t=8),!s||t===16&&!/^[0-9a-fA-F]+$/.test(s)||t===10&&!/^\d+$/.test(s)||t===8&&!/^[0-7]+$/.test(s))return null;let r=Number.parseInt(s,t);return!Number.isFinite(r)||r<0?null:r}function dc(e){let t=e.split(".");if(t.length===0||t.length>4)return null;let s=t.map(o=>xd(o));if(s.some(o=>o===null))return null;let r=s;if(t.length===1){let o=r[0];return o>4294967295?null:[o>>>24&255,o>>>16&255,o>>>8&255,o&255]}if(t.length===2){let[o,u]=r;return o>255||u>16777215?null:[o,u>>>16&255,u>>>8&255,u&255]}if(t.length===3){let[o,u,c]=r;return o>255||u>255||c>65535?null:[o,u,c>>>8&255,c&255]}let[n,i,a,l]=r;return n>255||i>255||a>255||l>255?null:[n,i,a,l]}function Cd(e){let t=e,s=null;if(t.includes(".")){let p=t.lastIndexOf(":");if(p<0)return null;let y=t.slice(p+1),b=dc(y);if(!b)return null;s=b,t=t.slice(0,p)}let r=t.includes("::")?t.split("::").length-1:0;if(r>1)return null;let[n,i]=t.split("::"),a=n?n.split(":").filter(Boolean):[],l=i?i.split(":").filter(Boolean):[],o=p=>/^[0-9a-f]{1,4}$/i.test(p)?Number.parseInt(p,16):null,u=a.map(o),c=l.map(o);if(u.some(p=>p===null)||c.some(p=>p===null))return null;let f=s?2:0,d=u.length+c.length+f,h=0;if(r===1){if(h=8-d,h<0)return null}else if(d!==8)return null;let m=[...u,...new Array(h).fill(0),...c];return s&&(m.push(s[0]<<8|s[1]),m.push(s[2]<<8|s[3])),m.length===8?m:null}function _n(e){let[t,s]=e;return t===127||t===10||t===172&&s>=16&&s<=31||t===192&&s===168||t===169&&s===254||t===0||t===100&&s>=64&&s<=127||t===198&&(s===18||s===19)||t===192&&s===0&&e[2]===0||t===192&&s===0&&e[2]===2||t===198&&s===51&&e[2]===100||t===203&&s===0&&e[2]===113||t>=240}function Dd(e){if(e.every(n=>n===0)||e.slice(0,7).every(n=>n===0)&&e[7]===1||(e[0]&65472)===65152||(e[0]&65024)===64512)return!0;if(e[0]===0&&e[1]===0&&e[2]===0&&e[3]===0&&e[4]===0&&e[5]===65535){let n=[e[6]>>>8&255,e[6]&255,e[7]>>>8&255,e[7]&255];return _n(n)}if(e[0]===8193&&e[1]===3512)return!0;if(e[0]===100&&e[1]===65435&&e[2]===0&&e[3]===0&&e[4]===0&&e[5]===0){let n=[e[6]>>>8&255,e[6]&255,e[7]>>>8&255,e[7]&255];return _n(n)}if(e[0]===100&&e[1]===65435&&e[2]===1)return!0;if(e[0]===8194){let n=[e[1]>>>8&255,e[1]&255,e[2]>>>8&255,e[2]&255];return _n(n)}return!1}function hc(e){let t=[];for(let s of e){if(typeof s!="string"&&(s===null||typeof s!="object"||!("url"in s)||typeof s.url!="string")){t.push('Invalid allow-list entry: must be a string URL or an object with a "url" string property');continue}let r=uc(s);if(!$i(r)){t.push(`Invalid URL in allow-list: "${r}" - must be a valid URL with scheme and host (e.g., "https://example.com")`);continue}let i=new URL(r);if(i.protocol!=="http:"&&i.protocol!=="https:"){t.push(`Only http and https URLs are allowed in allow-list: "${r}"`);continue}if(!i.hostname){t.push(`Allow-list entry must include a hostname: "${r}"`);continue}if(i.pathname!=="/"&&i.pathname!==""&&cc(i.pathname)){t.push(`Allow-list entry contains ambiguous path separators: "${r}"`);continue}(i.search||i.hash)&&t.push(`Query strings and fragments are ignored in allow-list entries: "${r}"`)}return t}var Rd=typeof __BROWSER__<"u"&&__BROWSER__,es=null,xn=null,pc=!1;function Id(){if(es===null&&!Rd)try{let e=Fn("node:async_hooks");xn=Fn("node:dns"),es=new e.AsyncLocalStorage}catch{}}function Od(){if(pc||(Id(),!es||!xn))return;pc=!0;let e=es,t=xn.lookup;function s(...r){let n=r[0],i=e.getStore();if(typeof n!="string"||!i||i.hostname.toLowerCase()!==n.toLowerCase())return t.apply(this,r);let a={},l;if(r.length===2)l=r[1];else if(r.length>=3){let u=r[1];typeof u=="number"?a={family:u}:u&&typeof u=="object"&&(a=u),l=r[2]}if(typeof l!="function")return t.apply(this,r);let o=l;if(a.family!==void 0&&a.family!==0&&a.family!==i.family){let u=new Error(`ENOTFOUND ${n}`);u.code="ENOTFOUND",u.errno=-3008,u.syscall="getaddrinfo",u.hostname=n,process.nextTick(()=>o(u));return}process.nextTick(()=>{a.all?o(null,[{address:i.address,family:i.family}]):o(null,i.address,i.family)})}Object.defineProperty(xn,"lookup",{value:s,writable:!0,configurable:!0})}function mc(e,t){return Od(),es?es.run(e,t):t()}var Xe=class extends Error{constructor(t,s){let r=s??"URL not in allow-list";super(`Network access denied: ${r}: ${t}`),this.name="NetworkAccessDeniedError"}},ts=class extends Error{constructor(t){super(`Too many redirects (max: ${t})`),this.name="TooManyRedirectsError"}},ss=class extends Error{constructor(t){super(`Redirect target not in allow-list: ${t}`),this.name="RedirectNotAllowedError"}},Cn=class extends Error{constructor(t,s){super(`HTTP method '${t}' not allowed. Allowed methods: ${s.join(", ")}`),this.name="MethodNotAllowedError"}},ns=class extends Error{constructor(t){super(`Response body too large (max: ${t} bytes)`),this.name="ResponseTooLargeError"}};function Ld(e){return new Promise((t,s)=>{Td(e,{all:!0},(r,n)=>{r?s(r):t(n)})})}var Md=20,Wd=3e4,Fd=10485760,Vd=["GET","HEAD"],zd=new Set(["GET","HEAD","OPTIONS"]),Bd=new Set([301,302,303,307,308]);function Ni(e){let t=e.allowedUrlPrefixes??[];if(!e.dangerouslyAllowFullInternetAccess){let h=hc(t);if(h.length>0)throw new Error(`Invalid network allow-list: -${h.join(` -`)}`)}let s=[];for(let h of t)typeof h=="object"&&h.transform&&h.transform.length>0&&s.push(h);function r(h){if(s.length===0)return null;let m=null;for(let p of s)if(Pi(h,p.url)&&p.transform){m||(m=new Headers);for(let y of p.transform)for(let[b,v]of Object.entries(y.headers))m.set(b,v)}return m}let n=e.maxRedirects??Md,i=e.timeoutMs??Wd,a=e.maxResponseSize??Fd,l=e.dangerouslyAllowFullInternetAccess?["GET","HEAD","POST","PUT","DELETE","PATCH","OPTIONS"]:e.allowedMethods??Vd,o=e.denyPrivateRanges??(typeof process<"u"&&process.env?.NODE_ENV==="production"),u=e._dnsResolve??Ld;async function c(h){if(!e.dangerouslyAllowFullInternetAccess&&!fc(h,t))throw new Xe(h);if(o)try{let m=new URL(h);if(ki(m.hostname))throw new Xe(h,"private/loopback IP address blocked");let p=m.hostname;if(/[a-zA-Z]/.test(p))try{let b=await u(p);for(let{address:E}of b)if(ki(E))throw new Xe(h,"hostname resolves to private/loopback IP address");let v=b[0];if(v)return{hostname:p,address:v.address,family:v.family===6?6:4}}catch(b){if(b instanceof Xe)throw b;let v=b?.code;if(!(v==="ENOTFOUND"||v==="ENODATA"))throw new Xe(h,"DNS resolution failed for private IP check")}}catch(m){if(m instanceof Xe)throw m}return null}function f(h){if(e.dangerouslyAllowFullInternetAccess)return;let m=h.toUpperCase();if(!l.includes(m))throw new Cn(m,l)}async function d(h,m={}){let p=m.method?.toUpperCase()??"GET",y=await c(h);f(p);let b=h,v=0,E=m.followRedirects??!0,w=m.timeoutMs!==void 0?Math.min(m.timeoutMs,i):i;for(;;){let S=new AbortController,A=ks(()=>S.abort(),w);try{let $=await Ie.runTrustedAsync(()=>{let R=r(b),C=qd(m.headers,R),F={method:p,headers:C,signal:S.signal,redirect:"manual"};return m.body&&!zd.has(p)&&(F.body=m.body),y?mc(y,()=>fetch(b,F)):fetch(b,F)});if(Bd.has($.status)&&E){let R=$.headers.get("location");if(!R)return await gc($,b,a);let C=new URL(R,b).href;try{y=await c(C)}catch{throw new ss(C)}if(v++,v>n)throw new ts(n);b=C;continue}return await gc($,b,a)}finally{Ns(A)}}}return d}function qd(e,t){if(!e&&!t)return;if(!t)return e;let s=e instanceof Headers?new Headers(e):new Headers(e);for(let[r,n]of t)s.set(r,n);return s}async function gc(e,t,s){let r=Object.create(null);if(e.headers.forEach((i,a)=>{r[a.toLowerCase()]=i}),s>0){let i=e.headers.get("content-length");if(i){let a=parseInt(i,10);if(!Number.isNaN(a)&&a>s)throw new ns(s)}}let n;if(s>0&&e.body){let i=e.body.getReader(),a=[],l=0;for(;;){let{done:u,value:c}=await i.read();if(u)break;if(c){if(l+=c.byteLength,l>s)throw i.cancel(),new ns(s);a.push(c)}}n=new Uint8Array(l);let o=0;for(let u of a)n.set(u,o),o+=u.byteLength}else{let i=await e.arrayBuffer();if(s>0&&i.byteLength>s)throw new ns(s);n=new Uint8Array(i)}return{status:e.status,statusText:e.statusText,headers:r,body:n,url:t}}function $s(e){return Wt(e)}function Wt(e){return e.statements.map(yc).join(` -`)}function yc(e){let t=[];for(let r=0;r0?`${t.join(" ")} `:"")+s.join(" ")}function wc(e){switch(e.type){case"SimpleCommand":return Ud(e);case"If":return eh(e);case"For":return th(e);case"CStyleFor":return sh(e);case"While":return nh(e);case"Until":return rh(e);case"Case":return ih(e);case"Subshell":return oh(e);case"Group":return lh(e);case"ArithmeticCommand":return ch(e);case"ConditionalCommand":return uh(e);case"FunctionDef":return fh(e);default:{let t=e;throw new Error(`Unsupported command type: ${t.type}`)}}}function Ud(e){let t=[];for(let s of e.assignments)t.push(Zd(s));e.name&&t.push(be(e.name));for(let s of e.args)t.push(be(s));for(let s of e.redirections)t.push(vc(s));return t.join(" ")}function Zd(e){let t=e.append?"+=":"=";if(e.array){let s=e.array.map(be).join(" ");return`${e.name}${t}(${s})`}return e.value?`${e.name}${t}${be(e.value)}`:`${e.name}${t}`}function be(e){return e.parts.map(t=>Dn(t,!1)).join("")}function Dt(e){return e.parts.map(t=>Dn(t,!0)).join("")}function Dn(e,t){switch(e.type){case"Literal":return t?Hd(e.value):Gd(e.value);case"SingleQuoted":return`'${e.value}'`;case"DoubleQuoted":return`"${e.parts.map(s=>Dn(s,!0)).join("")}"`;case"Escaped":return`\\${e.value}`;case"ParameterExpansion":return Ec(e);case"CommandSubstitution":return e.legacy?`\`${Wt(e.body)}\``:`$(${Wt(e.body)})`;case"ArithmeticExpansion":return`$((${ie(e.expression.expression)}))`;case"ProcessSubstitution":return e.direction==="input"?`<(${Wt(e.body)})`:`>(${Wt(e.body)})`;case"BraceExpansion":return Yd(e);case"TildeExpansion":return e.user!==null?`~${e.user}`:"~";case"Glob":return e.pattern;default:{let s=e;throw new Error(`Unsupported word part type: ${s.type}`)}}}function Gd(e){return e.replace(/[\s\\'"`!|&;()<>{}[\]*?~#]/g,"\\$&")}function Hd(e){return e.replace(/[$`"\\]/g,"\\$&")}function Qd(e,t){return e.parts.map(s=>Kd(s,t)).join("")}function Kd(e,t){switch(e.type){case"Literal":return t?e.value:e.value.replace(/[$`]/g,"\\$&");case"Escaped":return`\\${e.value}`;case"ParameterExpansion":return Ec(e);case"CommandSubstitution":return e.legacy?`\`${Wt(e.body)}\``:`$(${Wt(e.body)})`;case"ArithmeticExpansion":return`$((${ie(e.expression.expression)}))`;default:return Dn(e,!1)}}function Ec(e){return e.operation?`\${${bc(e.parameter,e.operation)}}`:Xd(e.parameter)?`\${${e.parameter}}`:`$${e.parameter}`}function Xd(e){return!(/^[?#@*$!\-0-9]$/.test(e)||/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(e))}function bc(e,t){switch(t.type){case"Length":return`#${e}`;case"LengthSliceError":return`#${e}:`;case"BadSubstitution":return t.text;case"DefaultValue":return`${e}${t.checkEmpty?":":""}-${Dt(t.word)}`;case"AssignDefault":return`${e}${t.checkEmpty?":":""}=${Dt(t.word)}`;case"ErrorIfUnset":return`${e}${t.checkEmpty?":":""}?${t.word?Dt(t.word):""}`;case"UseAlternative":return`${e}${t.checkEmpty?":":""}+${Dt(t.word)}`;case"Substring":{let s=ie(t.offset.expression);return t.length?`${e}:${s}:${ie(t.length.expression)}`:`${e}:${s}`}case"PatternRemoval":{let s=t.side==="prefix"?"#":"%",r=t.greedy?`${s}${s}`:s;return`${e}${r}${Dt(t.pattern)}`}case"PatternReplacement":{let s="/";t.all?s="//":t.anchor==="start"?s="/#":t.anchor==="end"&&(s="/%");let r=t.replacement?`/${Dt(t.replacement)}`:"";return`${e}${s}${Dt(t.pattern)}${r}`}case"CaseModification":{let s=t.direction==="upper"?"^":",",r=t.all?`${s}${s}`:s,n=t.pattern?Dt(t.pattern):"";return`${e}${r}${n}`}case"Transform":return`${e}@${t.operator}`;case"Indirection":return t.innerOp?`!${bc(e,t.innerOp)}`:`!${e}`;case"ArrayKeys":return`!${t.array}[${t.star?"*":"@"}]`;case"VarNamePrefix":return`!${t.prefix}${t.star?"*":"@"}`;default:{let s=t;throw new Error(`Unsupported parameter operation type: ${s.type}`)}}}function Yd(e){return`{${e.items.map(Jd).join(",")}}`}function Jd(e){if(e.type==="Word")return be(e.word);let t=e.startStr??String(e.start),s=e.endStr??String(e.end);return e.step!==void 0?`${t}..${s}..${e.step}`:`${t}..${s}`}function vc(e){let t=e.fdVariable?`{${e.fdVariable}}`:e.fd!==null?String(e.fd):"";if(e.operator==="<<"||e.operator==="<<-"){let s=e.target,r=s.quoted?`'${s.delimiter}'`:s.delimiter,n=Qd(s.content,s.quoted);return`${t}${e.operator}${r} -${n}${s.delimiter}`}return e.operator==="<<<"?`${t}<<< ${be(e.target)}`:e.operator==="&>"||e.operator==="&>>"?`${e.operator} ${be(e.target)}`:`${t}${e.operator} ${be(e.target)}`}function Ye(e){return e.length===0?"":` ${e.map(vc).join(" ")}`}function Ue(e){return e.map(yc).join(` -`)}function eh(e){let t=[];for(let s=0;sthis.limits.maxCommandCount)return{stdout:"",stderr:`bash: maximum command count (${this.limits.maxCommandCount}) exceeded (possible infinite loop). Increase with executionLimits.maxCommandCount option. -`,exitCode:1,env:qe(this.state.env,s?.env)};if(!t.trim())return{stdout:"",stderr:"",exitCode:0,env:qe(this.state.env,s?.env)};this.logger?.info("exec",{command:t});let r=s?.cwd??this.state.cwd,n,i=r;if(s?.cwd)if(s.env&&"PWD"in s.env)n=s.env.PWD;else if(s?.env&&!("PWD"in s.env))try{n=await this.fs.realpath(r),i=n}catch{n=r}else n=r;let a=s?.replaceEnv?new Map:new Map(this.state.env);if(s?.env)for(let[f,d]of Object.entries(s.env))a.set(f,d);n!==void 0&&a.set("PWD",n);let l={...this.state,env:a,cwd:i,functions:new Map(this.state.functions),localScopes:[...this.state.localScopes],options:{...this.state.options},hashTable:this.state.hashTable,groupStdin:ph(s?.stdin,s?.stdinKind),signal:s?.signal,extraArgs:s?.args},o=t;s?.rawScript||(o=Sc(t));let u=this.defenseInDepthConfig?Ie.getInstance(this.defenseInDepthConfig):null,c=u?.activate();try{let f=async()=>{let d=Ce(o,{maxHeredocSize:this.limits.maxHeredocSize}),h;if(this.transformPlugins.length>0){let v=Object.create(null);for(let E of this.transformPlugins){let w=E.transform({ast:d,metadata:v});d=w.ast,w.metadata&&(v=cs(v,w.metadata))}h=v}let m={fs:this.fs,commands:this.commands,limits:this.limits,exec:this.exec.bind(this),fetch:this.secureFetch,sleep:this.sleepFn,trace:this.traceFn,coverage:this.coverageWriter,requireDefenseContext:u?.isEnabled()===!0,jsBootstrapCode:this.jsBootstrapCode,invokeTool:this.invokeToolFn},b=await new As(m,l).executeScript(d);return h&&(b.metadata=h),this.logResult(b)};return c?await c.run(f):await f()}catch(f){if(f instanceof Z)return this.logResult({stdout:f.stdout,stderr:f.stderr,exitCode:f.exitCode,env:qe(this.state.env,s?.env)});if(f instanceof Be)return this.logResult({stdout:f.stdout,stderr:f.stderr,exitCode:f.exitCode,env:qe(this.state.env,s?.env)});if(f instanceof se)return this.logResult({stdout:f.stdout,stderr:f.stderr,exitCode:1,env:qe(this.state.env,s?.env)});if(f instanceof Rs)return this.logResult({stdout:f.stdout,stderr:f.stderr,exitCode:124,env:qe(this.state.env,s?.env)});if(f instanceof X)return this.logResult({stdout:f.stdout,stderr:ut(f.stderr),exitCode:X.EXIT_CODE,env:qe(this.state.env,s?.env)});if(f instanceof gt)return this.logResult({stdout:"",stderr:`bash: security violation: ${ut(f.message)} -`,exitCode:1,env:qe(this.state.env,s?.env)});if(f.name==="ParseException")return this.logResult({stdout:"",stderr:`bash: syntax error: ${ut(f.message)} -`,exitCode:2,env:qe(this.state.env,s?.env)});if(f instanceof At)return this.logResult({stdout:"",stderr:`bash: ${ut(f.message)} -`,exitCode:2,env:qe(this.state.env,s?.env)});if(f instanceof RangeError)return this.logResult({stdout:"",stderr:`bash: ${ut(f.message)} -`,exitCode:1,env:qe(this.state.env,s?.env)});throw f}finally{c?.deactivate()}}async readFile(t){return this.fs.readFile(this.fs.resolvePath(this.state.cwd,t))}async writeFile(t,s){return this.fs.writeFile(this.fs.resolvePath(this.state.cwd,t),s)}getCwd(){return this.state.cwd}getEnv(){return bt(this.state.env)}registerTransformPlugin(t){this.transformPlugins.push(t)}transform(t){let s=Sc(t),r=Ce(s,{maxHeredocSize:this.limits.maxHeredocSize}),n=Object.create(null);for(let i of this.transformPlugins){let a=i.transform({ast:r,metadata:n});r=a.ast,a.metadata&&(n=cs(n,a.metadata))}return{script:$s(r),ast:r,metadata:n}}};function dh(e,t){let s=t;for(let r=0;r0){let c=r[r.length-1];if((c.stripTabs?a.replace(/^\t+/,""):a)===c.delimiter){s.push(a.trimStart()),r.pop();continue}s.push(a);continue}let l=n,o=l==="none"?a.trimStart():a;if(s.push(o),n=dh(a,l),l!=="none")continue;let u=/<<(-?)\s*(['"]?)([\w-]+)\2/g;for(let c of o.matchAll(u)){let f=c[1]==="-",d=c[3];r.push({delimiter:d,stripTabs:f})}}return s.join(` -`)}var hh=new TextDecoder("utf-8",{fatal:!0});function Ac(e){if(!e)return e;let t=!1;for(let r=0;r255)return e;n>127&&(t=!0)}if(!t)return e;let s=new Uint8Array(e.length);for(let r=0;r({mountPoint:t.mountPoint,filesystem:t.filesystem}))}isMountPoint(t){let s=L(t);return this.mounts.has(s)}validateMountPath(t){let s=t.split("/");for(let r of s)if(r==="."||r==="..")throw new Error(`Invalid mount point '${t}': contains '.' or '..' segments`)}validateMount(t){if(t==="/")throw new Error("Cannot mount at root '/'");for(let s of this.mounts.keys())if(s!==t){if(t.startsWith(`${s}/`))throw new Error(`Cannot mount at '${t}': inside existing mount '${s}'`);if(s.startsWith(`${t}/`))throw new Error(`Cannot mount at '${t}': would contain existing mount '${s}'`)}}routePath(t){M(t,"access");let s=L(t),r=null,n=0;for(let i of this.mounts.values()){let a=i.mountPoint;if(s===a)return{fs:i.filesystem,relativePath:"/"};s.startsWith(`${a}/`)&&a.length>n&&(r=i,n=a.length)}if(r){let i=s.slice(n);return{fs:r.filesystem,relativePath:i||"/"}}return{fs:this.baseFs,relativePath:s}}getChildMountPoints(t){let s=L(t),r=s==="/"?"/":`${s}/`,n=[];for(let i of this.mounts.keys())if(i.startsWith(r)){let l=i.slice(r.length).split("/")[0];l&&!n.includes(l)&&n.push(l)}return n}async readFile(t,s){let{fs:r,relativePath:n}=this.routePath(t);return r.readFile(n,s)}async readFileBytes(t){let{fs:s,relativePath:r}=this.routePath(t);return xs(s,r)}async readFileBuffer(t){let{fs:s,relativePath:r}=this.routePath(t);return s.readFileBuffer(r)}async writeFile(t,s,r){let{fs:n,relativePath:i}=this.routePath(t);return n.writeFile(i,s,r)}async appendFile(t,s,r){let{fs:n,relativePath:i}=this.routePath(t);return n.appendFile(i,s,r)}async exists(t){let s=L(t);if(this.mounts.has(s)||this.getChildMountPoints(s).length>0)return!0;let{fs:n,relativePath:i}=this.routePath(t);return n.exists(i)}async stat(t){let s=L(t),r=this.mounts.get(s);if(r)try{return await r.filesystem.stat("/")}catch{return{isFile:!1,isDirectory:!0,isSymbolicLink:!1,mode:493,size:0,mtime:new Date}}if(this.getChildMountPoints(s).length>0)try{return await this.baseFs.stat(s)}catch{return{isFile:!1,isDirectory:!0,isSymbolicLink:!1,mode:493,size:0,mtime:new Date}}let{fs:i,relativePath:a}=this.routePath(t);return i.stat(a)}async lstat(t){let s=L(t),r=this.mounts.get(s);if(r)try{return await r.filesystem.lstat("/")}catch{return{isFile:!1,isDirectory:!0,isSymbolicLink:!1,mode:493,size:0,mtime:new Date}}if(this.getChildMountPoints(s).length>0)try{return await this.baseFs.lstat(s)}catch{return{isFile:!1,isDirectory:!0,isSymbolicLink:!1,mode:493,size:0,mtime:new Date}}let{fs:i,relativePath:a}=this.routePath(t);return i.lstat(a)}async mkdir(t,s){let r=L(t);if(this.mounts.has(r)){if(s?.recursive)return;throw new Error(`EEXIST: directory already exists, mkdir '${t}'`)}if(this.getChildMountPoints(r).length>0&&s?.recursive)return;let{fs:i,relativePath:a}=this.routePath(t);return i.mkdir(a,s)}async readdir(t){let s=L(t),r=new Set,n=null,{fs:i,relativePath:a}=this.routePath(t);try{let o=await i.readdir(a);for(let u of o)r.add(u)}catch(o){let u=o.code,c=o.message||"";if(u!=="ENOENT"&&!c.includes("ENOENT"))throw o;n=o}let l=this.getChildMountPoints(s);for(let o of l)r.add(o);if(r.size===0&&n&&!this.mounts.has(s))throw n;return Array.from(r).sort()}async rm(t,s){let r=L(t);if(this.mounts.has(r))throw new Error(`EBUSY: mount point, cannot remove '${t}'`);if(this.getChildMountPoints(r).length>0)throw new Error(`EBUSY: contains mount points, cannot remove '${t}'`);let{fs:i,relativePath:a}=this.routePath(t);return i.rm(a,s)}async cp(t,s,r){let n=this.routePath(t),i=this.routePath(s);return n.fs===i.fs?n.fs.cp(n.relativePath,i.relativePath,r):this.crossMountCopy(t,s,r)}async mv(t,s){let r=L(t);if(this.mounts.has(r))throw new Error(`EBUSY: mount point, cannot move '${t}'`);let n=this.routePath(t),i=this.routePath(s);if(n.fs===i.fs)return n.fs.mv(n.relativePath,i.relativePath);await this.cp(t,s,{recursive:!0}),await this.rm(t,{recursive:!0})}resolvePath(t,s){return vt(t,s)}getAllPaths(){let t=new Set;for(let s of this.baseFs.getAllPaths())t.add(s);for(let s of this.mounts.keys()){let r=s.split("/").filter(Boolean),n="";for(let a of r)n=`${n}/${a}`,t.add(n);let i=this.mounts.get(s);if(i)for(let a of i.filesystem.getAllPaths())a==="/"?t.add(s):t.add(`${s}${a}`)}return Array.from(t).sort()}async chmod(t,s){let r=L(t),n=this.mounts.get(r);if(n)return n.filesystem.chmod("/",s);let{fs:i,relativePath:a}=this.routePath(t);return i.chmod(a,s)}async symlink(t,s){let{fs:r,relativePath:n}=this.routePath(s);return r.symlink(t,n)}async link(t,s){let r=this.routePath(t),n=this.routePath(s);if(r.fs!==n.fs)throw new Error(`EXDEV: cross-device link not permitted, link '${t}' -> '${s}'`);return r.fs.link(r.relativePath,n.relativePath)}async readlink(t){let{fs:s,relativePath:r}=this.routePath(t);return s.readlink(r)}async realpath(t){let s=L(t);if(this.mounts.get(s))return s;let{fs:n,relativePath:i}=this.routePath(t),a=await n.realpath(i);for(let[l,o]of this.mounts)if(s===l||s.startsWith(`${l}/`))return a==="/"?l:`${l}${a}`;return a}async crossMountCopy(t,s,r){let n=await this.lstat(t);if(n.isFile){let i=await this.readFileBuffer(t);await this.writeFile(s,i),await this.chmod(s,n.mode)}else if(n.isDirectory){if(!r?.recursive)throw new Error(`cp: ${t} is a directory (not copied)`);await this.mkdir(s,{recursive:!0});let i=await this.readdir(t);for(let a of i){let l=St(t,a),o=St(s,a);await this.crossMountCopy(l,o,r)}}else if(n.isSymbolicLink){let i=await this.readlink(t);await this.symlink(i,s)}}async utimes(t,s,r){let{fs:n,relativePath:i}=this.routePath(t);return n.utimes(i,s,r)}};import*as ae from"node:fs";import*as Se from"node:path";import*as Ze from"node:fs";import*as Pe from"node:path";function Je(e,t){if(e===t)return!0;let s=e[t.length];return(s==="/"||s==="\\")&&e.startsWith(t)}function Ft(e,t){try{let s=Ze.realpathSync(e);return Je(s,t)?s:null}catch(s){if(s.code==="ENOENT"){let r=Pe.dirname(e);if(r===e)return null;let n=Ft(r,t);if(n===null)return null;try{if(Ze.lstatSync(e).isSymbolicLink()){let a=Ze.readlinkSync(e),l=Pe.isAbsolute(a)?a:Pe.resolve(Pe.dirname(e),a);if(Ft(l,t)===null)return null}}catch{}return Pe.join(n,Pe.basename(e))}return null}}function In(e,t,s){let r=Ft(e,s);if(r===null)return null;let n=Pe.resolve(e),i=n.slice(t.length),a=r.slice(s.length);if(i!==a)return null;try{if(Ze.lstatSync(n).isSymbolicLink())return null}catch{}return r}function On(e,t){if(!Ze.existsSync(e))throw new Error(`${t} root does not exist`);if(!Ze.statSync(e).isDirectory())throw new Error(`${t} root is not a directory`)}function $c(e,t){if(!Pe.isAbsolute(e))return{withinRoot:!0,relativePath:e};let s;try{s=Ze.realpathSync(e)}catch{s=Pe.resolve(e)}return Je(s,t)?{withinRoot:!0,relativePath:s.slice(t.length).replace(/\\/g,"/")||"/"}:{withinRoot:!1,safeName:Pe.basename(e)}}function Tn(e,t,s,r){let n=e;if(n.path===void 0){for(let a of r)if(n.message?.includes(a))throw e}let i=n.code||"EIO";throw new Error(`${i}: ${s} '${t}'`)}var mh=["ELOOP","EFBIG","EPERM"],gh="/home/user/project",rs=class{root;canonicalRoot;mountPoint;readOnly;maxFileReadSize;allowSymlinks;memory=new Map;deleted=new Set;constructor(t){this.root=Se.resolve(t.root);let s=t.mountPoint??gh;if(this.mountPoint=s==="/"?"/":s.replace(/\/+$/,""),!this.mountPoint.startsWith("/"))throw new Error(`Mount point must be an absolute path: ${s}`);this.readOnly=t.readOnly??!1,this.maxFileReadSize=t.maxFileReadSize??10485760,this.allowSymlinks=t.allowSymlinks??!1,On(this.root,"OverlayFs"),this.canonicalRoot=ae.realpathSync(this.root),this.createMountPointDirs()}assertWritable(t){if(this.readOnly)throw new Error(`EROFS: read-only file system, ${t}`)}createMountPointDirs(){let t=this.mountPoint.split("/").filter(Boolean),s="";for(let r of t)s+=`/${r}`,this.memory.has(s)||this.memory.set(s,{type:"directory",mode:493,mtime:new Date});this.memory.has("/")||this.memory.set("/",{type:"directory",mode:493,mtime:new Date})}getMountPoint(){return this.mountPoint}mkdirSync(t,s){let n=L(t).split("/").filter(Boolean),i="";for(let a of n)i+=`/${a}`,this.memory.has(i)||this.memory.set(i,{type:"directory",mode:493,mtime:new Date})}writeFileSync(t,s){let r=L(t),n=this.getDirname(r);n!=="/"&&this.mkdirSync(n);let i=s instanceof Uint8Array?s:new TextEncoder().encode(s);this.memory.set(r,{type:"file",content:i,mode:420,mtime:new Date})}getDirname(t){let s=t.lastIndexOf("/");return s===0?"/":t.slice(0,s)}getRelativeToMount(t){return this.mountPoint==="/"?t:t===this.mountPoint?"/":t.startsWith(`${this.mountPoint}/`)?t.slice(this.mountPoint.length):null}toRealPath(t){let s=L(t),r=this.getRelativeToMount(s);if(r===null)return null;let n=Se.join(this.root,r),i=Se.resolve(n);return Je(i,this.root)?i:null}resolveRealPath_(t){return t?this.allowSymlinks?Ft(t,this.canonicalRoot):In(t,this.root,this.canonicalRoot):null}resolveRealPathParent_(t){if(!t)return null;let s=Se.dirname(t),r=this.resolveRealPath_(s);return r===null?null:Se.join(r,Se.basename(t))}sanitizeError(t,s,r){Tn(t,s,r,mh)}ensureParentDirs(t){let s=It(t);s!=="/"&&(this.memory.has(s)||(this.ensureParentDirs(s),this.memory.set(s,{type:"directory",mode:493,mtime:new Date})),this.deleted.delete(s))}async existsInOverlay(t){let s=L(t);if(this.deleted.has(s))return!1;if(this.memory.has(s))return!0;let r=this.resolveRealPathParent_(this.toRealPath(s));if(!r)return!1;try{return await ae.promises.lstat(r),!0}catch{return!1}}async readFile(t,s){let r=await this.readFileBuffer(t),n=je(s);return dt(r,n)}async readFileBytes(t){let s=await this.readFileBuffer(t);return dt(s,"binary")}async readFileBuffer(t,s=new Set){M(t,"open");let r=L(t);if(s.has(r))throw new Error(`ELOOP: too many levels of symbolic links, open '${t}'`);if(s.add(r),this.deleted.has(r))throw new Error(`ENOENT: no such file or directory, open '${t}'`);let n=this.memory.get(r);if(n){if(n.type==="symlink"){let a=this.resolveSymlink(r,n.target);return this.readFileBuffer(a,s)}if(n.type!=="file")throw new Error(`EISDIR: illegal operation on a directory, read '${t}'`);return n.content}let i=this.resolveRealPath_(this.toRealPath(r));if(!i)throw new Error(`ENOENT: no such file or directory, open '${t}'`);try{let a=await ae.promises.lstat(i);if(a.isSymbolicLink()){if(!this.allowSymlinks)throw new Error(`ENOENT: no such file or directory, open '${t}'`);let u=await ae.promises.readlink(i),c=this.realTargetToVirtual(r,u),f=this.resolveSymlink(r,c);return this.readFileBuffer(f,s)}if(a.isDirectory())throw new Error(`EISDIR: illegal operation on a directory, read '${t}'`);if(this.maxFileReadSize>0&&a.size>this.maxFileReadSize)throw new Error(`EFBIG: file too large, read '${t}' (${a.size} bytes, max ${this.maxFileReadSize})`);let l=this.allowSymlinks?ae.constants.O_RDONLY:ae.constants.O_RDONLY|ae.constants.O_NOFOLLOW,o=await ae.promises.open(i,l);try{let u=await o.readFile();return new Uint8Array(u)}finally{await o.close()}}catch(a){let l=a.code;if(l==="ENOENT")throw new Error(`ENOENT: no such file or directory, open '${t}'`);if(l==="ELOOP")throw new Error(`ENOENT: no such file or directory, open '${t}'`);this.sanitizeError(a,t,"open")}}async writeFile(t,s,r){M(t,"write"),this.assertWritable(`write '${t}'`);let n=L(t);this.ensureParentDirs(n);let i=je(r),a=ft(s,i);this.memory.set(n,{type:"file",content:a,mode:420,mtime:new Date}),this.deleted.delete(n)}async appendFile(t,s,r){M(t,"append"),this.assertWritable(`append '${t}'`);let n=L(t),i=je(r),a=ft(s,i),l;try{l=await this.readFileBuffer(n)}catch{l=new Uint8Array(0)}let o=new Uint8Array(l.length+a.length);o.set(l),o.set(a,l.length),this.ensureParentDirs(n),this.memory.set(n,{type:"file",content:o,mode:420,mtime:new Date}),this.deleted.delete(n)}async exists(t){return t.includes("\0")?!1:this.existsInOverlay(t)}async stat(t,s=new Set){M(t,"stat");let r=L(t);if(s.has(r))throw new Error(`ELOOP: too many levels of symbolic links, stat '${t}'`);if(s.add(r),this.deleted.has(r))throw new Error(`ENOENT: no such file or directory, stat '${t}'`);let n=this.memory.get(r);if(n){if(n.type==="symlink"){let l=this.resolveSymlink(r,n.target);return this.stat(l,s)}let a=0;return n.type==="file"&&(a=n.content.length),{isFile:n.type==="file",isDirectory:n.type==="directory",isSymbolicLink:!1,mode:n.mode,size:a,mtime:n.mtime}}let i=this.resolveRealPath_(this.toRealPath(r));if(!i)throw new Error(`ENOENT: no such file or directory, stat '${t}'`);try{let a=await ae.promises.lstat(i);if(a.isSymbolicLink()){if(!this.allowSymlinks)throw new Error(`ENOENT: no such file or directory, stat '${t}'`);let l=await ae.promises.readlink(i),o=this.realTargetToVirtual(r,l),u=this.resolveSymlink(r,o);return this.stat(u,s)}return{isFile:a.isFile(),isDirectory:a.isDirectory(),isSymbolicLink:!1,mode:a.mode,size:a.size,mtime:a.mtime}}catch(a){if(a.code==="ENOENT")throw new Error(`ENOENT: no such file or directory, stat '${t}'`);this.sanitizeError(a,t,"stat")}}async lstat(t){M(t,"lstat");let s=L(t);if(this.deleted.has(s))throw new Error(`ENOENT: no such file or directory, lstat '${t}'`);let r=this.memory.get(s);if(r){if(r.type==="symlink")return{isFile:!1,isDirectory:!1,isSymbolicLink:!0,mode:r.mode,size:r.target.length,mtime:r.mtime};let i=0;return r.type==="file"&&(i=r.content.length),{isFile:r.type==="file",isDirectory:r.type==="directory",isSymbolicLink:!1,mode:r.mode,size:i,mtime:r.mtime}}let n=this.resolveRealPathParent_(this.toRealPath(s));if(!n)throw new Error(`ENOENT: no such file or directory, lstat '${t}'`);try{let i=await ae.promises.lstat(n);return{isFile:i.isFile(),isDirectory:i.isDirectory(),isSymbolicLink:i.isSymbolicLink(),mode:i.mode,size:i.size,mtime:i.mtime}}catch(i){if(i.code==="ENOENT")throw new Error(`ENOENT: no such file or directory, lstat '${t}'`);this.sanitizeError(i,t,"lstat")}}resolveSymlink(t,s){return zt(t,s)}realTargetToVirtual(t,s){let r=$c(s,this.canonicalRoot);if(r.withinRoot){if(!Se.isAbsolute(s))return s;let n=r.relativePath;return this.mountPoint==="/"?n:`${this.mountPoint}${n}`}return r.safeName}async mkdir(t,s){M(t,"mkdir"),this.assertWritable(`mkdir '${t}'`);let r=L(t);if(await this.existsInOverlay(r)){if(!s?.recursive)throw new Error(`EEXIST: file already exists, mkdir '${t}'`);return}let i=It(r);if(i!=="/"&&!await this.existsInOverlay(i))if(s?.recursive)await this.mkdir(i,{recursive:!0});else throw new Error(`ENOENT: no such file or directory, mkdir '${t}'`);this.memory.set(r,{type:"directory",mode:493,mtime:new Date}),this.deleted.delete(r)}async readdirCore(t,s){if(this.deleted.has(s))throw new Error(`ENOENT: no such file or directory, scandir '${t}'`);let r=new Map,n=new Set,i=s==="/"?"/":`${s}/`;for(let l of this.deleted)if(l.startsWith(i)){let o=l.slice(i.length),u=o.split("/")[0];u&&!o.includes("/",u.length)&&n.add(u)}for(let[l,o]of this.memory)if(l!==s&&l.startsWith(i)){let u=l.slice(i.length),c=u.split("/")[0];c&&!n.has(c)&&!u.includes("/",1)&&r.set(c,{name:c,isFile:o.type==="file",isDirectory:o.type==="directory",isSymbolicLink:o.type==="symlink"})}let a=this.resolveRealPath_(this.toRealPath(s));if(a)try{if(!this.allowSymlinks&&(await ae.promises.lstat(a)).isSymbolicLink()){if(!this.memory.has(s))throw new Error(`ENOENT: no such file or directory, scandir '${t}'`);return r}let l=await ae.promises.readdir(a,{withFileTypes:!0});for(let o of l)!n.has(o.name)&&!r.has(o.name)&&r.set(o.name,{name:o.name,isFile:o.isFile(),isDirectory:o.isDirectory(),isSymbolicLink:o.isSymbolicLink()})}catch(l){if(l.code==="ENOENT"){if(!this.memory.has(s))throw new Error(`ENOENT: no such file or directory, scandir '${t}'`)}else l.code!=="ENOTDIR"&&this.sanitizeError(l,t,"scandir")}return r}async resolveForReaddir(t,s=!1){let r=L(t),n=new Set,i=s,a=this.memory.get(r);for(;a&&a.type==="symlink";){if(n.has(r))throw new Error(`ELOOP: too many levels of symbolic links, scandir '${t}'`);n.add(r),i=!0,r=this.resolveSymlink(r,a.target),a=this.memory.get(r)}if(a)return{normalized:r,outsideOverlay:!1};if(this.getRelativeToMount(r)===null)return{normalized:r,outsideOverlay:!0};let o=this.resolveRealPath_(this.toRealPath(r));if(!o)return{normalized:r,outsideOverlay:!0};try{if((await ae.promises.lstat(o)).isSymbolicLink()){if(!this.allowSymlinks)return{normalized:r,outsideOverlay:!0};let c=await ae.promises.readlink(o),f=this.realTargetToVirtual(r,c),d=this.resolveSymlink(r,f);return this.resolveForReaddir(d,!0)}return{normalized:r,outsideOverlay:!1}}catch{return i?{normalized:r,outsideOverlay:!0}:{normalized:r,outsideOverlay:!1}}}async readdir(t){M(t,"scandir");let{normalized:s,outsideOverlay:r}=await this.resolveForReaddir(t);if(r)return[];let n=await this.readdirCore(t,s);return Array.from(n.keys()).sort((i,a)=>ia?1:0)}async readdirWithFileTypes(t){M(t,"scandir");let{normalized:s,outsideOverlay:r}=await this.resolveForReaddir(t);if(r)return[];let n=await this.readdirCore(t,s);return Array.from(n.values()).sort((i,a)=>i.namea.name?1:0)}async rm(t,s){M(t,"rm"),this.assertWritable(`rm '${t}'`);let r=L(t);if(!await this.existsInOverlay(r)){if(s?.force)return;throw new Error(`ENOENT: no such file or directory, rm '${t}'`)}try{if((await this.stat(r)).isDirectory){let a=await this.readdir(r);if(a.length>0){if(!s?.recursive)throw new Error(`ENOTEMPTY: directory not empty, rm '${t}'`);for(let l of a){let o=r==="/"?`/${l}`:`${r}/${l}`;await this.rm(o,s)}}}}catch(i){if(i instanceof Error&&(i.message.includes("ENOTEMPTY")||i.message.includes("EISDIR")))throw i}this.memory.delete(r),this.existsOnRealFs(r)&&this.deleted.add(r)}existsOnRealFs(t){let s=this.toRealPath(t),r=this.resolveRealPathParent_(s);if(!r)return!1;try{return ae.lstatSync(r),!0}catch{return!1}}async cp(t,s,r){M(t,"cp"),M(s,"cp"),this.assertWritable(`cp '${s}'`);let n=L(t),i=L(s);if(!await this.existsInOverlay(n))throw new Error(`ENOENT: no such file or directory, cp '${t}'`);let l=await this.stat(n);if(l.isFile){let o=await this.readFileBuffer(n);await this.writeFile(i,o)}else if(l.isDirectory){if(!r?.recursive)throw new Error(`EISDIR: is a directory, cp '${t}'`);await this.mkdir(i,{recursive:!0});let o=await this.readdir(n);for(let u of o){let c=n==="/"?`/${u}`:`${n}/${u}`,f=i==="/"?`/${u}`:`${i}/${u}`;await this.cp(c,f,r)}}}async mv(t,s){this.assertWritable(`mv '${s}'`),await this.cp(t,s,{recursive:!0}),await this.rm(t,{recursive:!0})}resolvePath(t,s){return vt(t,s)}getAllPaths(){let t=new Set(this.memory.keys());for(let s of this.deleted)t.delete(s);return this.scanRealFs("/",t),Array.from(t)}scanRealFs(t,s){if(this.deleted.has(t))return;let r=this.resolveRealPath_(this.toRealPath(t));if(r)try{let n=ae.readdirSync(r);for(let i of n){let a=t==="/"?`/${i}`:`${t}/${i}`;if(this.deleted.has(a))continue;s.add(a);let l=Se.join(r,i);ae.lstatSync(l).isDirectory()&&this.scanRealFs(a,s)}}catch{}}async chmod(t,s){M(t,"chmod"),this.assertWritable(`chmod '${t}'`);let r=L(t);if(!await this.existsInOverlay(r))throw new Error(`ENOENT: no such file or directory, chmod '${t}'`);let i=this.memory.get(r);if(i){i.mode=s;return}let a=await this.stat(r);if(a.isFile){let l=await this.readFileBuffer(r);this.memory.set(r,{type:"file",content:l,mode:s,mtime:new Date})}else a.isDirectory&&this.memory.set(r,{type:"directory",mode:s,mtime:new Date})}async symlink(t,s){if(!this.allowSymlinks)throw new Error(`EPERM: operation not permitted, symlink '${s}'`);M(s,"symlink"),this.assertWritable(`symlink '${s}'`);let r=L(s);if(await this.existsInOverlay(r))throw new Error(`EEXIST: file already exists, symlink '${s}'`);this.ensureParentDirs(r),this.memory.set(r,{type:"symlink",target:t,mode:511,mtime:new Date}),this.deleted.delete(r)}async link(t,s){M(t,"link"),M(s,"link"),this.assertWritable(`link '${s}'`);let r=L(t),n=L(s);if(!await this.existsInOverlay(r))throw new Error(`ENOENT: no such file or directory, link '${t}'`);let a=await this.stat(r);if(!a.isFile)throw new Error(`EPERM: operation not permitted, link '${t}'`);if(await this.existsInOverlay(n))throw new Error(`EEXIST: file already exists, link '${s}'`);let o=await this.readFileBuffer(r);this.ensureParentDirs(n),this.memory.set(n,{type:"file",content:o,mode:a.mode,mtime:new Date}),this.deleted.delete(n)}async readlink(t){M(t,"readlink");let s=L(t);if(this.deleted.has(s))throw new Error(`ENOENT: no such file or directory, readlink '${t}'`);let r=this.memory.get(s);if(r){if(r.type!=="symlink")throw new Error(`EINVAL: invalid argument, readlink '${t}'`);return r.target}let n=this.resolveRealPathParent_(this.toRealPath(s));if(!n)throw new Error(`ENOENT: no such file or directory, readlink '${t}'`);try{let i=await ae.promises.readlink(n);if(!Se.isAbsolute(i)){let a=Se.resolve(Se.dirname(n),i),l;try{l=ae.realpathSync(a)}catch{l=a}if(!Je(l,this.canonicalRoot))return Se.basename(i)}return this.realTargetToVirtual(s,i)}catch(i){if(i.code==="ENOENT")throw new Error(`ENOENT: no such file or directory, readlink '${t}'`);if(i.code==="EINVAL")throw new Error(`EINVAL: invalid argument, readlink '${t}'`);this.sanitizeError(i,t,"readlink")}}async realpath(t){M(t,"realpath");let s=L(t),r=new Set,n=async l=>{let o=l==="/"?[]:l.slice(1).split("/"),u="";for(let c of o){if(u=`${u}/${c}`,r.has(u))throw new Error(`ELOOP: too many levels of symbolic links, realpath '${t}'`);if(this.deleted.has(u))throw new Error(`ENOENT: no such file or directory, realpath '${t}'`);let f=this.memory.get(u),d=0,h=40;for(;f&&f.type==="symlink"&&d=h)throw new Error(`ELOOP: too many levels of symbolic links, realpath '${t}'`);if(!f){let m=this.toRealPath(u),p=this.resolveRealPath_(m);if(p)try{if((await ae.promises.lstat(p)).isSymbolicLink()){if(!this.allowSymlinks)throw new Error(`ENOENT: no such file or directory, realpath '${t}'`);let b=await ae.promises.readlink(p),v=this.realTargetToVirtual(u,b);return r.add(u),u=this.resolveSymlink(u,v),n(u)}}catch(y){if(y.code==="ENOENT")throw new Error(`ENOENT: no such file or directory, realpath '${t}'`);this.sanitizeError(y,t,"realpath")}else if(!this.allowSymlinks){let y=this.resolveRealPathParent_(m);if(y)try{if((await ae.promises.lstat(y)).isSymbolicLink())throw new Error(`ENOENT: no such file or directory, realpath '${t}'`)}catch(b){if(b.message?.includes("ENOENT")||b.message?.includes("ELOOP"))throw new Error(`ENOENT: no such file or directory, realpath '${t}'`);this.sanitizeError(b,t,"realpath")}}}}return u||"/"},i=await n(s);if(!await this.existsInOverlay(i))throw new Error(`ENOENT: no such file or directory, realpath '${t}'`);return i}async utimes(t,s,r){M(t,"utimes"),this.assertWritable(`utimes '${t}'`);let n=L(t);if(!await this.existsInOverlay(n))throw new Error(`ENOENT: no such file or directory, utimes '${t}'`);let a=this.memory.get(n);if(a){a.mtime=r;return}let l=await this.stat(n);if(l.isFile){let o=await this.readFileBuffer(n);this.memory.set(n,{type:"file",content:o,mode:l.mode,mtime:r})}else l.isDirectory&&this.memory.set(n,{type:"directory",mode:l.mode,mtime:r})}};import*as W from"node:fs";import*as ne from"node:path";var yh=["EACCES","escaping sandbox","EFBIG"],Ln=class{root;canonicalRoot;maxFileReadSize;allowSymlinks;constructor(t){this.root=ne.resolve(t.root),this.maxFileReadSize=t.maxFileReadSize??10485760,this.allowSymlinks=t.allowSymlinks??!1,On(this.root,"ReadWriteFs"),this.canonicalRoot=W.realpathSync(this.root)}resolveAndValidate(t,s){let r=this.allowSymlinks?Ft(t,this.canonicalRoot):In(t,this.root,this.canonicalRoot);if(r===null)throw new Error(`EACCES: permission denied, '${s}' resolves outside sandbox`);return r}validateParent(t,s){let r=ne.dirname(t),n=this.resolveAndValidate(r,s);return ne.join(n,ne.basename(t))}toRealPath(t){let s=L(t),r=ne.join(this.root,s);return ne.resolve(r)}async readFile(t,s){let r=await this.readFileBuffer(t),n=je(s);return dt(r,n)}async readFileBytes(t){let s=await this.readFileBuffer(t);return dt(s,"binary")}async readFileBuffer(t){M(t,"open");let s=this.toRealPath(t),r=this.resolveAndValidate(s,t);try{let n=this.allowSymlinks?W.constants.O_RDONLY:W.constants.O_RDONLY|W.constants.O_NOFOLLOW,i=await W.promises.open(r,n);try{if(this.maxFileReadSize>0){let l=await i.stat();if(l.size>this.maxFileReadSize)throw new Error(`EFBIG: file too large, read '${t}' (${l.size} bytes, max ${this.maxFileReadSize})`)}let a=await i.readFile();return new Uint8Array(a)}finally{await i.close()}}catch(n){let i=n;if(i.code==="ENOENT")throw new Error(`ENOENT: no such file or directory, open '${t}'`);if(i.code==="EISDIR")throw new Error(`EISDIR: illegal operation on a directory, read '${t}'`);if(i.code==="ELOOP")throw new Error(`EACCES: permission denied, '${t}' is a symlink`);this.sanitizeError(n,t,"open")}}async writeFile(t,s,r){M(t,"write");let n=this.toRealPath(t),i=this.resolveAndValidate(n,t),a=je(r),l=ft(s,a),o=ne.dirname(i);try{await W.promises.mkdir(o,{recursive:!0}),i=this.resolveAndValidate(n,t);let u=this.allowSymlinks?0:W.constants.O_NOFOLLOW,c=W.constants.O_WRONLY|W.constants.O_CREAT|W.constants.O_TRUNC|u,f=await W.promises.open(i,c,438);try{await f.writeFile(l)}finally{await f.close()}}catch(u){if(u.code==="ELOOP")throw new Error(`EACCES: permission denied, '${t}' is a symlink`);this.sanitizeError(u,t,"write")}}async appendFile(t,s,r){M(t,"append");let n=this.toRealPath(t),i=this.resolveAndValidate(n,t),a=je(r),l=ft(s,a),o=ne.dirname(i);try{await W.promises.mkdir(o,{recursive:!0}),i=this.resolveAndValidate(n,t);let u=this.allowSymlinks?0:W.constants.O_NOFOLLOW,c=W.constants.O_WRONLY|W.constants.O_CREAT|W.constants.O_APPEND|u,f=await W.promises.open(i,c,438);try{await f.writeFile(l)}finally{await f.close()}}catch(u){if(u.code==="ELOOP")throw new Error(`EACCES: permission denied, '${t}' is a symlink`);this.sanitizeError(u,t,"append")}}async exists(t){if(t.includes("\0"))return!1;let s=this.toRealPath(t);try{let r=this.resolveAndValidate(s,t);return await W.promises.access(r),!0}catch{return!1}}async stat(t){M(t,"stat");let s=this.toRealPath(t),r=this.resolveAndValidate(s,t);try{let n=await W.promises.lstat(r);if(!this.allowSymlinks&&n.isSymbolicLink())throw new Error(`EACCES: permission denied, '${t}' is a symlink`);return{isFile:n.isFile(),isDirectory:n.isDirectory(),isSymbolicLink:n.isSymbolicLink(),mode:n.mode,size:n.size,mtime:n.mtime}}catch(n){if(n.code==="ENOENT")throw new Error(`ENOENT: no such file or directory, stat '${t}'`);this.sanitizeError(n,t,"stat")}}async lstat(t){M(t,"lstat");let s=this.toRealPath(t),r=this.validateParent(s,t);try{let n=await W.promises.lstat(r);return{isFile:n.isFile(),isDirectory:n.isDirectory(),isSymbolicLink:n.isSymbolicLink(),mode:n.mode,size:n.size,mtime:n.mtime}}catch(n){if(n.code==="ENOENT")throw new Error(`ENOENT: no such file or directory, lstat '${t}'`);this.sanitizeError(n,t,"lstat")}}async mkdir(t,s){M(t,"mkdir");let r=this.toRealPath(t),n=this.resolveAndValidate(r,t);try{await W.promises.mkdir(n,{recursive:s?.recursive})}catch(i){let a=i;if(a.code==="EEXIST")throw new Error(`EEXIST: file already exists, mkdir '${t}'`);if(a.code==="ENOENT")throw new Error(`ENOENT: no such file or directory, mkdir '${t}'`);this.sanitizeError(i,t,"mkdir")}}async readdir(t){return(await this.readdirWithFileTypes(t)).map(r=>r.name)}async readdirWithFileTypes(t){M(t,"scandir");let s=this.toRealPath(t),r=this.resolveAndValidate(s,t);try{if(!this.allowSymlinks&&(await W.promises.lstat(r)).isSymbolicLink())throw new Error(`EACCES: permission denied, '${t}' is a symlink`);return(await W.promises.readdir(r,{withFileTypes:!0})).map(i=>({name:i.name,isFile:i.isFile(),isDirectory:i.isDirectory(),isSymbolicLink:i.isSymbolicLink()})).sort((i,a)=>i.namea.name?1:0)}catch(n){let i=n;if(i.code==="ENOENT")throw new Error(`ENOENT: no such file or directory, scandir '${t}'`);if(i.code==="ENOTDIR")throw new Error(`ENOTDIR: not a directory, scandir '${t}'`);this.sanitizeError(n,t,"scandir")}}async rm(t,s){M(t,"rm");let r=this.toRealPath(t),n=this.resolveAndValidate(r,t);try{await W.promises.rm(n,{recursive:s?.recursive??!1,force:s?.force??!1})}catch(i){let a=i;if(a.code==="ENOENT"&&!s?.force)throw new Error(`ENOENT: no such file or directory, rm '${t}'`);if(a.code==="ENOTEMPTY")throw new Error(`ENOTEMPTY: directory not empty, rm '${t}'`);this.sanitizeError(i,t,"rm")}}async cp(t,s,r){M(t,"cp"),M(s,"cp");let n=this.toRealPath(t),i=this.toRealPath(s),a=this.resolveAndValidate(n,t),l=this.resolveAndValidate(i,s);try{await W.promises.cp(a,l,{recursive:r?.recursive??!1,filter:async o=>{try{if(W.lstatSync(o).isSymbolicLink()){let c=await W.promises.realpath(o).catch(()=>null);return c===null?!1:Je(c,this.canonicalRoot)}return!0}catch(u){return u.code==="ENOENT"}}})}catch(o){let u=o;if(u.code==="ENOENT")throw new Error(`ENOENT: no such file or directory, cp '${t}'`);if(u.code==="EISDIR")throw new Error(`EISDIR: is a directory, cp '${t}'`);this.sanitizeError(o,t,"cp")}}async mv(t,s){M(t,"mv"),M(s,"mv");let r=this.toRealPath(t),n=this.toRealPath(s),i=this.validateParent(r,t),a=this.validateParent(n,s);try{if((await W.promises.lstat(i)).isSymbolicLink()){let u=await W.promises.readlink(i),c=ne.resolve(ne.dirname(a),u),f=await W.promises.realpath(c).catch(()=>c);if(!Je(f,this.canonicalRoot))throw new Error(`EACCES: permission denied, mv '${t}' -> '${s}' would create symlink escaping sandbox`)}}catch(o){let u=o;if(u.code==="ENOENT")throw new Error(`ENOENT: no such file or directory, mv '${t}'`);if(u.message?.includes("EACCES")||u.message?.includes("escaping sandbox"))throw o}let l=ne.dirname(a);try{await W.promises.mkdir(l,{recursive:!0})}catch(o){this.sanitizeError(o,s,"mv")}try{await W.promises.rename(i,a)}catch(o){let u=o;if(u.code==="ENOENT")throw new Error(`ENOENT: no such file or directory, mv '${t}'`);if(u.code==="EXDEV"){await this.cp(t,s,{recursive:!0}),await this.rm(t,{recursive:!0});return}this.sanitizeError(o,t,"mv")}try{if(W.lstatSync(a).isDirectory()&&this.findEscapingSymlinks(a).length>0)throw await W.promises.rename(a,i),new Error(`EACCES: permission denied, mv '${t}' -> '${s}' would create symlinks escaping sandbox`)}catch(o){if(o.message?.includes("EACCES")||o.message?.includes("escaping sandbox"))throw o}}resolvePath(t,s){return vt(t,s)}getAllPaths(){let t=[];return this.scanDir("/",t),t}sanitizeError(t,s,r){Tn(t,s,r,yh)}findEscapingSymlinks(t){let s=[];try{let r=W.readdirSync(t);for(let n of r){let i=ne.join(t,n);try{let a=W.lstatSync(i);if(a.isSymbolicLink()){let l=W.readlinkSync(i),o=ne.resolve(t,l),u;try{u=W.realpathSync(o)}catch{u=o}Je(u,this.canonicalRoot)||s.push(i)}else a.isDirectory()&&s.push(...this.findEscapingSymlinks(i))}catch{}}}catch{}return s}scanDir(t,s){let r=this.toRealPath(t),n;try{n=this.resolveAndValidate(r,t)}catch{return}try{let i=W.readdirSync(n);for(let a of i){let l=t==="/"?`/${a}`:`${t}/${a}`;s.push(l);let o=ne.join(n,a);W.lstatSync(o).isDirectory()&&this.scanDir(l,s)}}catch{}}async chmod(t,s){M(t,"chmod");let r=this.toRealPath(t),n=this.resolveAndValidate(r,t);try{let i=this.allowSymlinks?W.constants.O_RDONLY:W.constants.O_RDONLY|W.constants.O_NOFOLLOW,a=await W.promises.open(n,i);try{await a.chmod(s)}finally{await a.close()}}catch(i){let a=i;if(a.code==="ENOENT")throw new Error(`ENOENT: no such file or directory, chmod '${t}'`);if(a.code==="ELOOP")throw new Error(`EACCES: permission denied, '${t}' is a symlink`);this.sanitizeError(i,t,"chmod")}}async symlink(t,s){if(!this.allowSymlinks)throw new Error(`EPERM: operation not permitted, symlink '${s}'`);M(s,"symlink");let r=this.toRealPath(s),n=this.validateParent(r,s),i=L(s),a=L(ne.dirname(i)),l=t.startsWith("/")?L(t):L(a==="/"?`/${t}`:`${a}/${t}`),o=ne.join(this.canonicalRoot,l),u=ne.dirname(n),c=t.startsWith("/")?o:ne.relative(u,o)||".";try{await W.promises.symlink(c,n)}catch(f){if(f.code==="EEXIST")throw new Error(`EEXIST: file already exists, symlink '${s}'`);this.sanitizeError(f,s,"symlink")}}async link(t,s){M(t,"link"),M(s,"link");let r=this.toRealPath(t),n=this.toRealPath(s),i=this.resolveAndValidate(r,t),a=this.resolveAndValidate(n,s);try{await W.promises.link(i,a)}catch(l){let o=l;if(o.code==="ENOENT")throw new Error(`ENOENT: no such file or directory, link '${t}'`);if(o.code==="EEXIST")throw new Error(`EEXIST: file already exists, link '${s}'`);if(o.code==="EPERM")throw new Error(`EPERM: operation not permitted, link '${t}'`);this.sanitizeError(l,t,"link")}}async readlink(t){M(t,"readlink");let s=this.toRealPath(t),r=this.validateParent(s,t);try{let n=await W.promises.readlink(r),i=L(t),a=ne.dirname(i),l=ne.isAbsolute(n)?n:ne.resolve(ne.dirname(r),n),o=await W.promises.realpath(l).catch(()=>l);if(Je(o,this.canonicalRoot)){let u=o.slice(this.canonicalRoot.length)||"/";return a==="/"?u.startsWith("/")?u.slice(1)||".":u:ne.relative(a,u)}return ne.basename(n)}catch(n){let i=n;if(i.code==="ENOENT")throw new Error(`ENOENT: no such file or directory, readlink '${t}'`);if(i.code==="EINVAL")throw new Error(`EINVAL: invalid argument, readlink '${t}'`);this.sanitizeError(n,t,"readlink")}}async realpath(t){M(t,"realpath");let s=this.toRealPath(t);try{this.resolveAndValidate(s,t)}catch{throw new Error(`ENOENT: no such file or directory, realpath '${t}'`)}let r;try{r=await W.promises.realpath(s)}catch(n){let i=n;if(i.code==="ENOENT")throw new Error(`ENOENT: no such file or directory, realpath '${t}'`);if(i.code==="ELOOP")throw new Error(`ELOOP: too many levels of symbolic links, realpath '${t}'`);this.sanitizeError(n,t,"realpath")}if(Je(r,this.canonicalRoot))return r.slice(this.canonicalRoot.length)||"/";throw new Error(`ENOENT: no such file or directory, realpath '${t}'`)}async utimes(t,s,r){M(t,"utimes");let n=this.toRealPath(t),i=this.resolveAndValidate(n,t);try{let a=this.allowSymlinks?W.constants.O_RDONLY:W.constants.O_RDONLY|W.constants.O_NOFOLLOW,l=await W.promises.open(i,a);try{await l.utimes(s,r)}finally{await l.close()}}catch(a){let l=a;if(l.code==="ENOENT")throw new Error(`ENOENT: no such file or directory, utimes '${t}'`);if(l.code==="ELOOP")throw new Error(`EACCES: permission denied, '${t}' is a symlink`);this.sanitizeError(a,t,"utimes")}}};var is=class{cmdId;cwd;startedAt;exitCode;bashEnv;cmdLine;env;explicitCwd;signal;timeoutMs;abortController=new AbortController;timeoutId;externalAbortListener;resultPromise;constructor(t,s,r,n,i=!1,a,l){this.cmdId=crypto.randomUUID(),this.cwd=r,this.startedAt=new Date,this.bashEnv=t,this.cmdLine=s,this.env=n,this.explicitCwd=i,this.signal=a,this.timeoutMs=l,this.setupCancellation(),this.resultPromise=this.execute()}setupCancellation(){if(this.signal&&(this.signal.aborted?this.abortController.abort(this.signal.reason):(this.externalAbortListener=()=>{this.abortController.abort(this.signal?.reason)},this.signal.addEventListener("abort",this.externalAbortListener,{once:!0}))),this.timeoutMs!==void 0){let t=Math.max(0,this.timeoutMs);this.timeoutId=ks(()=>{this.abortController.abort(new Error(`sandbox command timeout after ${t}ms`))},t)}}cleanupCancellation(){this.timeoutId!==void 0&&(Ns(this.timeoutId),this.timeoutId=void 0),this.signal&&this.externalAbortListener&&(this.signal.removeEventListener("abort",this.externalAbortListener),this.externalAbortListener=void 0)}async execute(){let t={cwd:this.explicitCwd?this.cwd:void 0,env:this.env,signal:this.abortController.signal};try{let s=await this.bashEnv.exec(this.cmdLine,t);return this.exitCode=s.exitCode,s}finally{this.cleanupCancellation()}}async*logs(){let t=await this.resultPromise;t.stdout&&(yield{type:"stdout",data:t.stdout,timestamp:new Date}),t.stderr&&(yield{type:"stderr",data:t.stderr,timestamp:new Date})}async wait(){return await this.resultPromise,this}async output(){let t=await this.resultPromise;return t.stdout+t.stderr}async stdout(){return(await this.resultPromise).stdout}async stderr(){return(await this.resultPromise).stderr}async kill(){this.abortController.abort(new Error("command killed"))}};var Mn=class e{bashEnv;timeoutMs;constructor(t,s){this.bashEnv=t,this.timeoutMs=s}static async create(t){let s=t?.fs;if(t?.overlayRoot){if(t?.fs)throw new Error("Cannot specify both 'fs' and 'overlayRoot' options");s=new rs({root:t.overlayRoot})}let r=new Ps({env:t?.env,cwd:t?.cwd,fs:s,maxCallDepth:t?.maxCallDepth,maxCommandCount:t?.maxCommandCount,maxLoopIterations:t?.maxLoopIterations,network:t?.network,defenseInDepth:t?.defenseInDepth,python:t?.python,javascript:t?.javascript,commands:t?.commands,customCommands:t?.customCommands,fetch:t?.fetch});return new e(r,t?.timeoutMs)}async runCommand(t,s,r){let n,i,a,l,o=!1,u,c;if(typeof t=="object"){let p=t,y=[p.cmd,...p.args??[]];n=zn(y),i=p.cwd,a=p.env,l=p.signal,o=p.detached??!1,u=p.stdout,c=p.stderr}else if(Array.isArray(s)){let p=r;n=zn([t,...s]),l=p?.signal}else{n=t;let p=s;i=p?.cwd,a=p?.env}let f=i??this.bashEnv.getCwd(),d=i!==void 0,h=new is(this.bashEnv,n,f,a,d,l,this.timeoutMs);if(o)return h;let m=await h.wait();if(u){let p=await h.stdout();p&&u.write(p)}if(c){let p=await h.stderr();p&&c.write(p)}return m}async writeFiles(t){let s=this.bashEnv.getCwd();for(let[r,n]of Object.entries(t)){let i;typeof n=="string"?i=n:n.encoding==="base64"?i=Buffer.from(n.content,"base64").toString("utf-8"):i=n.content;let a=this.bashEnv.fs.resolvePath(s,r),l=a.substring(0,a.lastIndexOf("/"))||"/";l!=="/"&&await this.bashEnv.fs.mkdir(l,{recursive:!0}),await this.bashEnv.writeFile(a,i)}}async readFile(t,s){let r=await this.bashEnv.readFile(t);return s==="base64"?Buffer.from(r).toString("base64"):r}async mkDir(t,s){let r=this.bashEnv.fs.resolvePath(this.bashEnv.getCwd(),t);await this.bashEnv.fs.mkdir(r,{recursive:s?.recursive??!1})}async stop(){}async extendTimeout(t){}get domain(){}get bashEnvInstance(){return this.bashEnv}};var Wn=class{violations=[];violationsByType=new Map;options;constructor(t={}){this.options={maxViolationsPerType:t.maxViolationsPerType??100,maxViolationsTotal:t.maxViolationsTotal??1e3,includeStackTraces:t.includeStackTraces??!0,onViolation:t.onViolation??(()=>{}),logToConsole:t.logToConsole??!1}}record(t){let s=this.options.includeStackTraces?t:{...t,stack:void 0};this.violations.unshift(s),this.violations.length>this.options.maxViolationsTotal&&(this.violations.length=this.options.maxViolationsTotal);let r=this.violationsByType.get(t.type);r||(r=[],this.violationsByType.set(t.type,r)),r.lengthr.count-s.count),t}getTotalCount(){return this.violations.length}hasViolations(){return this.violations.length>0}clear(){this.violations=[],this.violationsByType.clear()}createCallback(){return t=>this.record(t)}};function Pc(){return e=>{console.warn("[DefenseInDepth] Security violation detected:",` - Type: ${e.type}`,` - Path: ${e.path}`,` - Message: ${e.message}`,e.executionId?` - ExecutionId: ${e.executionId}`:"")}}var _i=class{plugins=[];use(t){return this.plugins.push(t),this}transform(t){let s=Ce(t),r=Object.create(null);for(let n of this.plugins){let i=n.transform({ast:s,metadata:r});s=i.ast,i.metadata&&(r=cs(r,i.metadata))}return{script:$s(s),ast:s,metadata:r}}};var xi=class{name="command-collector";transform(t){let s=new Set;return this.walkScript(t.ast,s),{ast:t.ast,metadata:{commands:[...s].sort()}}}walkScript(t,s){for(let r of t.statements)this.walkStatement(r,s)}walkStatement(t,s){for(let r of t.pipelines)this.walkPipeline(r,s)}walkPipeline(t,s){for(let r of t.commands)this.walkCommand(r,s)}walkCommand(t,s){switch(t.type){case"SimpleCommand":if(t.name){let r=this.extractName(t.name);r&&s.add(r)}t.name&&this.walkWordParts(t.name.parts,s);for(let r of t.args)this.walkWordParts(r.parts,s);for(let r of t.assignments)if(r.value&&this.walkWordParts(r.value.parts,s),r.array)for(let n of r.array)this.walkWordParts(n.parts,s);break;case"If":for(let r of t.clauses){for(let n of r.condition)this.walkStatement(n,s);for(let n of r.body)this.walkStatement(n,s)}if(t.elseBody)for(let r of t.elseBody)this.walkStatement(r,s);break;case"For":if(t.words)for(let r of t.words)this.walkWordParts(r.parts,s);for(let r of t.body)this.walkStatement(r,s);break;case"CStyleFor":for(let r of t.body)this.walkStatement(r,s);break;case"While":case"Until":for(let r of t.condition)this.walkStatement(r,s);for(let r of t.body)this.walkStatement(r,s);break;case"Case":this.walkWordParts(t.word.parts,s);for(let r of t.items)for(let n of r.body)this.walkStatement(n,s);break;case"Subshell":case"Group":for(let r of t.body)this.walkStatement(r,s);break;case"ArithmeticCommand":case"ConditionalCommand":break;case"FunctionDef":this.walkCommand(t.body,s);break}}walkWordParts(t,s){for(let r of t)switch(r.type){case"CommandSubstitution":this.walkScript(r.body,s);break;case"ProcessSubstitution":this.walkScript(r.body,s);break;case"DoubleQuoted":this.walkWordParts(r.parts,s);break;case"ParameterExpansion":r.operation&&this.walkParameterOp(r.operation,s);break}}walkParameterOp(t,s){switch(t.type){case"DefaultValue":case"AssignDefault":case"UseAlternative":this.walkWordParts(t.word.parts,s);break;case"ErrorIfUnset":t.word&&this.walkWordParts(t.word.parts,s);break;case"PatternRemoval":this.walkWordParts(t.pattern.parts,s);break;case"PatternReplacement":this.walkWordParts(t.pattern.parts,s),t.replacement&&this.walkWordParts(t.replacement.parts,s);break;case"CaseModification":t.pattern&&this.walkWordParts(t.pattern.parts,s);break;case"Indirection":t.innerOp&&this.walkParameterOp(t.innerOp,s);break}}extractName(t){return t.parts.length===1&&t.parts[0].type==="Literal"?t.parts[0].value:null}};var Ci=class{name="tee";options;counter=0;constructor(t){this.options=t}transform(t){let s=[],r=this.options.timestamp??new Date;return{ast:this.transformScript(t.ast,s,r),metadata:{teeFiles:s}}}formatTimestamp(t){return t.toISOString().replace(/:/g,"-")}generateStdoutPath(t,s,r){let n=this.formatTimestamp(r),i=String(t).padStart(3,"0");return`${this.options.outputDir}/${n}-${i}-${s}.stdout.txt`}transformScript(t,s,r){return{...t,statements:t.statements.map(n=>this.transformStatement(n,s,r))}}transformStatement(t,s,r){let n=[],i=[];for(let a=0;a0&&i.push(t.operators[a-1]);let o=this.transformPipeline(l,s,r);if(n.push(o.pipeline),o.origCmdNewIndices!==null){let u=o.origCmdNewIndices;i.push(";"),n.push(this.makePipestatusSave(u)),i.push(";"),n.push(this.makePipestatusRestore(u.length,o.negated))}}return{...t,pipelines:n,operators:i}}transformPipeline(t,s,r){if(t.commands.length<=1)return{pipeline:t,origCmdNewIndices:null,negated:!1};let n=[],i=[],a=[],l=!1;for(let o=0;o0?i:void 0},origCmdNewIndices:a,negated:t.negated}:{pipeline:t,origCmdNewIndices:null,negated:!1}}makePipestatusSave(t){return{type:"Pipeline",commands:[{type:"SimpleCommand",assignments:t.map((s,r)=>({type:"Assignment",name:`__tps${r}`,value:{type:"Word",parts:[{type:"ParameterExpansion",parameter:`PIPESTATUS[${s}]`,operation:null}]},append:!1,array:null})),name:null,args:[],redirections:[]}],negated:!1}}makePipestatusRestore(t,s){let r=[];for(let n=0;n/d' AGENTS.npm.md > dist/AGENTS.md", - "build:clean": "find dist -name '*.test.js' -delete && find dist -name '*.test.d.ts' -delete", - "build:worker": "esbuild src/commands/python3/worker.ts --bundle --platform=node --format=esm --outfile=src/commands/python3/worker.js --external:../../../vendor/cpython-emscripten/* && cp src/commands/python3/worker.js dist/commands/python3/worker.js && mkdir -p dist/bin/chunks && cp src/commands/python3/worker.js dist/bin/chunks/worker.js && mkdir -p dist/bundle/chunks && cp src/commands/python3/worker.js dist/bundle/chunks/worker.js && esbuild src/commands/js-exec/js-exec-worker.ts --bundle --platform=node --format=esm --outfile=src/commands/js-exec/js-exec-worker.js --external:quickjs-emscripten && cp src/commands/js-exec/js-exec-worker.js dist/commands/js-exec/js-exec-worker.js && cp src/commands/js-exec/js-exec-worker.js dist/bin/chunks/js-exec-worker.js && cp src/commands/js-exec/js-exec-worker.js dist/bundle/chunks/js-exec-worker.js && esbuild src/commands/sqlite3/worker.ts --bundle --platform=node --format=esm --outfile=src/commands/sqlite3/worker.js --external:sql.js && mkdir -p dist/commands/sqlite3 && cp src/commands/sqlite3/worker.js dist/commands/sqlite3/worker.js && cp src/commands/sqlite3/worker.js dist/bin/chunks/sqlite3-worker.js && cp src/commands/sqlite3/worker.js dist/bundle/chunks/sqlite3-worker.js", - "build:lib": "esbuild dist/index.js --bundle --splitting --platform=node --format=esm --minify --outdir=dist/bundle --chunk-names=chunks/[name]-[hash] --banner:js='import{createRequire} from\"node:module\";const require=createRequire(import.meta.url);' --external:diff --external:minimatch --external:sprintf-js --external:turndown --external:sql.js --external:quickjs-emscripten --external:@mongodb-js/zstd --external:node-liblzma --external:seek-bzip", - "build:lib:cjs": "esbuild dist/index.js --bundle --platform=node --format=cjs --minify --outfile=dist/bundle/index.cjs --external:diff --external:minimatch --external:sprintf-js --external:turndown --external:sql.js --external:quickjs-emscripten --external:@mongodb-js/zstd --external:node-liblzma --external:seek-bzip", - "build:browser": "esbuild dist/browser.js --bundle --platform=browser --format=esm --minify --outfile=dist/bundle/browser.js --external:diff --external:minimatch --external:sprintf-js --external:turndown --external:node:zlib --external:@mongodb-js/zstd --external:node-liblzma --external:seek-bzip --define:__BROWSER__=true --alias:node:dns=./src/shims/browser-unsupported.js", - "build:cli": "esbuild dist/cli/just-bash.js --bundle --splitting --platform=node --format=esm --minify --outdir=dist/bin --entry-names=[name] --chunk-names=chunks/[name]-[hash] --banner:js='#!/usr/bin/env node\nimport{createRequire} from\"node:module\";const require=createRequire(import.meta.url);' --external:sql.js --external:quickjs-emscripten --external:@mongodb-js/zstd --external:node-liblzma --external:seek-bzip", - "build:shell": "esbuild dist/cli/shell.js --bundle --splitting --platform=node --format=esm --minify --outdir=dist/bin/shell --entry-names=[name] --chunk-names=chunks/[name]-[hash] --banner:js='#!/usr/bin/env node\nimport{createRequire} from\"node:module\";const require=createRequire(import.meta.url);' --external:sql.js --external:quickjs-emscripten --external:@mongodb-js/zstd --external:node-liblzma --external:seek-bzip", - "validate": "pnpm lint && pnpm knip && pnpm typecheck && pnpm build && pnpm check:worker-sync && pnpm test:run && pnpm test:wasm && pnpm test:dist", - "typecheck": "tsc --noEmit", - "lint": "pnpm lint:banned", - "check:worker-sync": "node scripts/check-worker-sync.js", - "lint:banned": "node scripts/check-banned-patterns.js", - "lint:fix": "pnpm --workspace-root lint:fix", - "knip": "knip", - "test": "vitest", - "test:run": "vitest run --exclude src/security/fuzzing/ --exclude src/commands/python3/ --exclude src/commands/sqlite3/ --exclude src/commands/js-exec/ --exclude src/agent-examples/python-scripting.test.ts", - "test:dist": "vitest run src/cli/just-bash.bundle.test.ts", - "test:unit": "vitest run --config vitest.unit.config.ts", - "test:wasm": "vitest run --config vitest.wasm.config.ts", - "test:comparison": "vitest run --config vitest.comparison.config.ts", - "test:comparison:record": "RECORD_FIXTURES=1 vitest run --config vitest.comparison.config.ts", - "test:coverage": "vitest run --coverage", - "test:coverage:unit": "vitest run --config vitest.unit.config.ts --coverage", - "test:fuzz": "vitest run src/security/fuzzing/", - "test:fuzz:long": "FUZZ_RUNS=10000 vitest run src/security/fuzzing/", - "shell": "npx tsx src/cli/shell.ts", - "dev:exec": "npx tsx src/cli/exec.ts" - } -} \ No newline at end of file diff --git a/.output/server/node_modules/minimatch/dist/esm/assert-valid-pattern.js b/.output/server/node_modules/minimatch/dist/esm/assert-valid-pattern.js deleted file mode 100644 index 7b534fc..0000000 --- a/.output/server/node_modules/minimatch/dist/esm/assert-valid-pattern.js +++ /dev/null @@ -1,10 +0,0 @@ -const MAX_PATTERN_LENGTH = 1024 * 64; -export const assertValidPattern = (pattern) => { - if (typeof pattern !== 'string') { - throw new TypeError('invalid pattern'); - } - if (pattern.length > MAX_PATTERN_LENGTH) { - throw new TypeError('pattern is too long'); - } -}; -//# sourceMappingURL=assert-valid-pattern.js.map \ No newline at end of file diff --git a/.output/server/node_modules/minimatch/dist/esm/ast.js b/.output/server/node_modules/minimatch/dist/esm/ast.js deleted file mode 100644 index f639546..0000000 --- a/.output/server/node_modules/minimatch/dist/esm/ast.js +++ /dev/null @@ -1,841 +0,0 @@ -// parse a single path portion -var _a; -import { parseClass } from './brace-expressions.js'; -import { unescape } from './unescape.js'; -const types = new Set(['!', '?', '+', '*', '@']); -const isExtglobType = (c) => types.has(c); -const isExtglobAST = (c) => isExtglobType(c.type); -// Map of which extglob types can adopt the children of a nested extglob -// -// anything but ! can adopt a matching type: -// +(a|+(b|c)|d) => +(a|b|c|d) -// *(a|*(b|c)|d) => *(a|b|c|d) -// @(a|@(b|c)|d) => @(a|b|c|d) -// ?(a|?(b|c)|d) => ?(a|b|c|d) -// -// * can adopt anything, because 0 or repetition is allowed -// *(a|?(b|c)|d) => *(a|b|c|d) -// *(a|+(b|c)|d) => *(a|b|c|d) -// *(a|@(b|c)|d) => *(a|b|c|d) -// -// + can adopt @, because 1 or repetition is allowed -// +(a|@(b|c)|d) => +(a|b|c|d) -// -// + and @ CANNOT adopt *, because 0 would be allowed -// +(a|*(b|c)|d) => would match "", on *(b|c) -// @(a|*(b|c)|d) => would match "", on *(b|c) -// -// + and @ CANNOT adopt ?, because 0 would be allowed -// +(a|?(b|c)|d) => would match "", on ?(b|c) -// @(a|?(b|c)|d) => would match "", on ?(b|c) -// -// ? can adopt @, because 0 or 1 is allowed -// ?(a|@(b|c)|d) => ?(a|b|c|d) -// -// ? and @ CANNOT adopt * or +, because >1 would be allowed -// ?(a|*(b|c)|d) => would match bbb on *(b|c) -// @(a|*(b|c)|d) => would match bbb on *(b|c) -// ?(a|+(b|c)|d) => would match bbb on +(b|c) -// @(a|+(b|c)|d) => would match bbb on +(b|c) -// -// ! CANNOT adopt ! (nothing else can either) -// !(a|!(b|c)|d) => !(a|b|c|d) would fail to match on b (not not b|c) -// -// ! can adopt @ -// !(a|@(b|c)|d) => !(a|b|c|d) -// -// ! CANNOT adopt * -// !(a|*(b|c)|d) => !(a|b|c|d) would match on bbb, not allowed -// -// ! CANNOT adopt + -// !(a|+(b|c)|d) => !(a|b|c|d) would match on bbb, not allowed -// -// ! CANNOT adopt ? -// x!(a|?(b|c)|d) => x!(a|b|c|d) would fail to match "x" -const adoptionMap = new Map([ - ['!', ['@']], - ['?', ['?', '@']], - ['@', ['@']], - ['*', ['*', '+', '?', '@']], - ['+', ['+', '@']], -]); -// nested extglobs that can be adopted in, but with the addition of -// a blank '' element. -const adoptionWithSpaceMap = new Map([ - ['!', ['?']], - ['@', ['?']], - ['+', ['?', '*']], -]); -// union of the previous two maps -const adoptionAnyMap = new Map([ - ['!', ['?', '@']], - ['?', ['?', '@']], - ['@', ['?', '@']], - ['*', ['*', '+', '?', '@']], - ['+', ['+', '@', '?', '*']], -]); -// Extglobs that can take over their parent if they are the only child -// the key is parent, value maps child to resulting extglob parent type -// '@' is omitted because it's a special case. An `@` extglob with a single -// member can always be usurped by that subpattern. -const usurpMap = new Map([ - ['!', new Map([['!', '@']])], - [ - '?', - new Map([ - ['*', '*'], - ['+', '*'], - ]), - ], - [ - '@', - new Map([ - ['!', '!'], - ['?', '?'], - ['@', '@'], - ['*', '*'], - ['+', '+'], - ]), - ], - [ - '+', - new Map([ - ['?', '*'], - ['*', '*'], - ]), - ], -]); -// Patterns that get prepended to bind to the start of either the -// entire string, or just a single path portion, to prevent dots -// and/or traversal patterns, when needed. -// Exts don't need the ^ or / bit, because the root binds that already. -const startNoTraversal = '(?!(?:^|/)\\.\\.?(?:$|/))'; -const startNoDot = '(?!\\.)'; -// characters that indicate a start of pattern needs the "no dots" bit, -// because a dot *might* be matched. ( is not in the list, because in -// the case of a child extglob, it will handle the prevention itself. -const addPatternStart = new Set(['[', '.']); -// cases where traversal is A-OK, no dot prevention needed -const justDots = new Set(['..', '.']); -const reSpecials = new Set('().*{}+?[]^$\\!'); -const regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); -// any single thing other than / -const qmark = '[^/]'; -// * => any number of characters -const star = qmark + '*?'; -// use + when we need to ensure that *something* matches, because the * is -// the only thing in the path portion. -const starNoEmpty = qmark + '+?'; -// remove the \ chars that we added if we end up doing a nonmagic compare -// const deslash = (s: string) => s.replace(/\\(.)/g, '$1') -let ID = 0; -export class AST { - type; - #root; - #hasMagic; - #uflag = false; - #parts = []; - #parent; - #parentIndex; - #negs; - #filledNegs = false; - #options; - #toString; - // set to true if it's an extglob with no children - // (which really means one child of '') - #emptyExt = false; - id = ++ID; - get depth() { - return (this.#parent?.depth ?? -1) + 1; - } - [Symbol.for('nodejs.util.inspect.custom')]() { - return { - '@@type': 'AST', - id: this.id, - type: this.type, - root: this.#root.id, - parent: this.#parent?.id, - depth: this.depth, - partsLength: this.#parts.length, - parts: this.#parts, - }; - } - constructor(type, parent, options = {}) { - this.type = type; - // extglobs are inherently magical - if (type) - this.#hasMagic = true; - this.#parent = parent; - this.#root = this.#parent ? this.#parent.#root : this; - this.#options = this.#root === this ? options : this.#root.#options; - this.#negs = this.#root === this ? [] : this.#root.#negs; - if (type === '!' && !this.#root.#filledNegs) - this.#negs.push(this); - this.#parentIndex = this.#parent ? this.#parent.#parts.length : 0; - } - get hasMagic() { - /* c8 ignore start */ - if (this.#hasMagic !== undefined) - return this.#hasMagic; - /* c8 ignore stop */ - for (const p of this.#parts) { - if (typeof p === 'string') - continue; - if (p.type || p.hasMagic) - return (this.#hasMagic = true); - } - // note: will be undefined until we generate the regexp src and find out - return this.#hasMagic; - } - // reconstructs the pattern - toString() { - return (this.#toString !== undefined ? this.#toString - : !this.type ? - (this.#toString = this.#parts.map(p => String(p)).join('')) - : (this.#toString = - this.type + - '(' + - this.#parts.map(p => String(p)).join('|') + - ')')); - } - #fillNegs() { - /* c8 ignore start */ - if (this !== this.#root) - throw new Error('should only call on root'); - if (this.#filledNegs) - return this; - /* c8 ignore stop */ - // call toString() once to fill this out - this.toString(); - this.#filledNegs = true; - let n; - while ((n = this.#negs.pop())) { - if (n.type !== '!') - continue; - // walk up the tree, appending everthing that comes AFTER parentIndex - let p = n; - let pp = p.#parent; - while (pp) { - for (let i = p.#parentIndex + 1; !pp.type && i < pp.#parts.length; i++) { - for (const part of n.#parts) { - /* c8 ignore start */ - if (typeof part === 'string') { - throw new Error('string part in extglob AST??'); - } - /* c8 ignore stop */ - part.copyIn(pp.#parts[i]); - } - } - p = pp; - pp = p.#parent; - } - } - return this; - } - push(...parts) { - for (const p of parts) { - if (p === '') - continue; - /* c8 ignore start */ - if (typeof p !== 'string' && - !(p instanceof _a && p.#parent === this)) { - throw new Error('invalid part: ' + p); - } - /* c8 ignore stop */ - this.#parts.push(p); - } - } - toJSON() { - const ret = this.type === null ? - this.#parts - .slice() - .map(p => (typeof p === 'string' ? p : p.toJSON())) - : [this.type, ...this.#parts.map(p => p.toJSON())]; - if (this.isStart() && !this.type) - ret.unshift([]); - if (this.isEnd() && - (this === this.#root || - (this.#root.#filledNegs && this.#parent?.type === '!'))) { - ret.push({}); - } - return ret; - } - isStart() { - if (this.#root === this) - return true; - // if (this.type) return !!this.#parent?.isStart() - if (!this.#parent?.isStart()) - return false; - if (this.#parentIndex === 0) - return true; - // if everything AHEAD of this is a negation, then it's still the "start" - const p = this.#parent; - for (let i = 0; i < this.#parentIndex; i++) { - const pp = p.#parts[i]; - if (!(pp instanceof _a && pp.type === '!')) { - return false; - } - } - return true; - } - isEnd() { - if (this.#root === this) - return true; - if (this.#parent?.type === '!') - return true; - if (!this.#parent?.isEnd()) - return false; - if (!this.type) - return this.#parent?.isEnd(); - // if not root, it'll always have a parent - /* c8 ignore start */ - const pl = this.#parent ? this.#parent.#parts.length : 0; - /* c8 ignore stop */ - return this.#parentIndex === pl - 1; - } - copyIn(part) { - if (typeof part === 'string') - this.push(part); - else - this.push(part.clone(this)); - } - clone(parent) { - const c = new _a(this.type, parent); - for (const p of this.#parts) { - c.copyIn(p); - } - return c; - } - static #parseAST(str, ast, pos, opt, extDepth) { - const maxDepth = opt.maxExtglobRecursion ?? 2; - let escaping = false; - let inBrace = false; - let braceStart = -1; - let braceNeg = false; - if (ast.type === null) { - // outside of a extglob, append until we find a start - let i = pos; - let acc = ''; - while (i < str.length) { - const c = str.charAt(i++); - // still accumulate escapes at this point, but we do ignore - // starts that are escaped - if (escaping || c === '\\') { - escaping = !escaping; - acc += c; - continue; - } - if (inBrace) { - if (i === braceStart + 1) { - if (c === '^' || c === '!') { - braceNeg = true; - } - } - else if (c === ']' && !(i === braceStart + 2 && braceNeg)) { - inBrace = false; - } - acc += c; - continue; - } - else if (c === '[') { - inBrace = true; - braceStart = i; - braceNeg = false; - acc += c; - continue; - } - // we don't have to check for adoption here, because that's - // done at the other recursion point. - const doRecurse = !opt.noext && - isExtglobType(c) && - str.charAt(i) === '(' && - extDepth <= maxDepth; - if (doRecurse) { - ast.push(acc); - acc = ''; - const ext = new _a(c, ast); - i = _a.#parseAST(str, ext, i, opt, extDepth + 1); - ast.push(ext); - continue; - } - acc += c; - } - ast.push(acc); - return i; - } - // some kind of extglob, pos is at the ( - // find the next | or ) - let i = pos + 1; - let part = new _a(null, ast); - const parts = []; - let acc = ''; - while (i < str.length) { - const c = str.charAt(i++); - // still accumulate escapes at this point, but we do ignore - // starts that are escaped - if (escaping || c === '\\') { - escaping = !escaping; - acc += c; - continue; - } - if (inBrace) { - if (i === braceStart + 1) { - if (c === '^' || c === '!') { - braceNeg = true; - } - } - else if (c === ']' && !(i === braceStart + 2 && braceNeg)) { - inBrace = false; - } - acc += c; - continue; - } - else if (c === '[') { - inBrace = true; - braceStart = i; - braceNeg = false; - acc += c; - continue; - } - const doRecurse = !opt.noext && - isExtglobType(c) && - str.charAt(i) === '(' && - /* c8 ignore start - the maxDepth is sufficient here */ - (extDepth <= maxDepth || (ast && ast.#canAdoptType(c))); - /* c8 ignore stop */ - if (doRecurse) { - const depthAdd = ast && ast.#canAdoptType(c) ? 0 : 1; - part.push(acc); - acc = ''; - const ext = new _a(c, part); - part.push(ext); - i = _a.#parseAST(str, ext, i, opt, extDepth + depthAdd); - continue; - } - if (c === '|') { - part.push(acc); - acc = ''; - parts.push(part); - part = new _a(null, ast); - continue; - } - if (c === ')') { - if (acc === '' && ast.#parts.length === 0) { - ast.#emptyExt = true; - } - part.push(acc); - acc = ''; - ast.push(...parts, part); - return i; - } - acc += c; - } - // unfinished extglob - // if we got here, it was a malformed extglob! not an extglob, but - // maybe something else in there. - ast.type = null; - ast.#hasMagic = undefined; - ast.#parts = [str.substring(pos - 1)]; - return i; - } - #canAdoptWithSpace(child) { - return this.#canAdopt(child, adoptionWithSpaceMap); - } - #canAdopt(child, map = adoptionMap) { - if (!child || - typeof child !== 'object' || - child.type !== null || - child.#parts.length !== 1 || - this.type === null) { - return false; - } - const gc = child.#parts[0]; - if (!gc || typeof gc !== 'object' || gc.type === null) { - return false; - } - return this.#canAdoptType(gc.type, map); - } - #canAdoptType(c, map = adoptionAnyMap) { - return !!map.get(this.type)?.includes(c); - } - #adoptWithSpace(child, index) { - const gc = child.#parts[0]; - const blank = new _a(null, gc, this.options); - blank.#parts.push(''); - gc.push(blank); - this.#adopt(child, index); - } - #adopt(child, index) { - const gc = child.#parts[0]; - this.#parts.splice(index, 1, ...gc.#parts); - for (const p of gc.#parts) { - if (typeof p === 'object') - p.#parent = this; - } - this.#toString = undefined; - } - #canUsurpType(c) { - const m = usurpMap.get(this.type); - return !!m?.has(c); - } - #canUsurp(child) { - if (!child || - typeof child !== 'object' || - child.type !== null || - child.#parts.length !== 1 || - this.type === null || - this.#parts.length !== 1) { - return false; - } - const gc = child.#parts[0]; - if (!gc || typeof gc !== 'object' || gc.type === null) { - return false; - } - return this.#canUsurpType(gc.type); - } - #usurp(child) { - const m = usurpMap.get(this.type); - const gc = child.#parts[0]; - const nt = m?.get(gc.type); - /* c8 ignore start - impossible */ - if (!nt) - return false; - /* c8 ignore stop */ - this.#parts = gc.#parts; - for (const p of this.#parts) { - if (typeof p === 'object') { - p.#parent = this; - } - } - this.type = nt; - this.#toString = undefined; - this.#emptyExt = false; - } - static fromGlob(pattern, options = {}) { - const ast = new _a(null, undefined, options); - _a.#parseAST(pattern, ast, 0, options, 0); - return ast; - } - // returns the regular expression if there's magic, or the unescaped - // string if not. - toMMPattern() { - // should only be called on root - /* c8 ignore start */ - if (this !== this.#root) - return this.#root.toMMPattern(); - /* c8 ignore stop */ - const glob = this.toString(); - const [re, body, hasMagic, uflag] = this.toRegExpSource(); - // if we're in nocase mode, and not nocaseMagicOnly, then we do - // still need a regular expression if we have to case-insensitively - // match capital/lowercase characters. - const anyMagic = hasMagic || - this.#hasMagic || - (this.#options.nocase && - !this.#options.nocaseMagicOnly && - glob.toUpperCase() !== glob.toLowerCase()); - if (!anyMagic) { - return body; - } - const flags = (this.#options.nocase ? 'i' : '') + (uflag ? 'u' : ''); - return Object.assign(new RegExp(`^${re}$`, flags), { - _src: re, - _glob: glob, - }); - } - get options() { - return this.#options; - } - // returns the string match, the regexp source, whether there's magic - // in the regexp (so a regular expression is required) and whether or - // not the uflag is needed for the regular expression (for posix classes) - // TODO: instead of injecting the start/end at this point, just return - // the BODY of the regexp, along with the start/end portions suitable - // for binding the start/end in either a joined full-path makeRe context - // (where we bind to (^|/), or a standalone matchPart context (where - // we bind to ^, and not /). Otherwise slashes get duped! - // - // In part-matching mode, the start is: - // - if not isStart: nothing - // - if traversal possible, but not allowed: ^(?!\.\.?$) - // - if dots allowed or not possible: ^ - // - if dots possible and not allowed: ^(?!\.) - // end is: - // - if not isEnd(): nothing - // - else: $ - // - // In full-path matching mode, we put the slash at the START of the - // pattern, so start is: - // - if first pattern: same as part-matching mode - // - if not isStart(): nothing - // - if traversal possible, but not allowed: /(?!\.\.?(?:$|/)) - // - if dots allowed or not possible: / - // - if dots possible and not allowed: /(?!\.) - // end is: - // - if last pattern, same as part-matching mode - // - else nothing - // - // Always put the (?:$|/) on negated tails, though, because that has to be - // there to bind the end of the negated pattern portion, and it's easier to - // just stick it in now rather than try to inject it later in the middle of - // the pattern. - // - // We can just always return the same end, and leave it up to the caller - // to know whether it's going to be used joined or in parts. - // And, if the start is adjusted slightly, can do the same there: - // - if not isStart: nothing - // - if traversal possible, but not allowed: (?:/|^)(?!\.\.?$) - // - if dots allowed or not possible: (?:/|^) - // - if dots possible and not allowed: (?:/|^)(?!\.) - // - // But it's better to have a simpler binding without a conditional, for - // performance, so probably better to return both start options. - // - // Then the caller just ignores the end if it's not the first pattern, - // and the start always gets applied. - // - // But that's always going to be $ if it's the ending pattern, or nothing, - // so the caller can just attach $ at the end of the pattern when building. - // - // So the todo is: - // - better detect what kind of start is needed - // - return both flavors of starting pattern - // - attach $ at the end of the pattern when creating the actual RegExp - // - // Ah, but wait, no, that all only applies to the root when the first pattern - // is not an extglob. If the first pattern IS an extglob, then we need all - // that dot prevention biz to live in the extglob portions, because eg - // +(*|.x*) can match .xy but not .yx. - // - // So, return the two flavors if it's #root and the first child is not an - // AST, otherwise leave it to the child AST to handle it, and there, - // use the (?:^|/) style of start binding. - // - // Even simplified further: - // - Since the start for a join is eg /(?!\.) and the start for a part - // is ^(?!\.), we can just prepend (?!\.) to the pattern (either root - // or start or whatever) and prepend ^ or / at the Regexp construction. - toRegExpSource(allowDot) { - const dot = allowDot ?? !!this.#options.dot; - if (this.#root === this) { - this.#flatten(); - this.#fillNegs(); - } - if (!isExtglobAST(this)) { - const noEmpty = this.isStart() && - this.isEnd() && - !this.#parts.some(s => typeof s !== 'string'); - const src = this.#parts - .map(p => { - const [re, _, hasMagic, uflag] = typeof p === 'string' ? - _a.#parseGlob(p, this.#hasMagic, noEmpty) - : p.toRegExpSource(allowDot); - this.#hasMagic = this.#hasMagic || hasMagic; - this.#uflag = this.#uflag || uflag; - return re; - }) - .join(''); - let start = ''; - if (this.isStart()) { - if (typeof this.#parts[0] === 'string') { - // this is the string that will match the start of the pattern, - // so we need to protect against dots and such. - // '.' and '..' cannot match unless the pattern is that exactly, - // even if it starts with . or dot:true is set. - const dotTravAllowed = this.#parts.length === 1 && justDots.has(this.#parts[0]); - if (!dotTravAllowed) { - const aps = addPatternStart; - // check if we have a possibility of matching . or .., - // and prevent that. - const needNoTrav = - // dots are allowed, and the pattern starts with [ or . - (dot && aps.has(src.charAt(0))) || - // the pattern starts with \., and then [ or . - (src.startsWith('\\.') && aps.has(src.charAt(2))) || - // the pattern starts with \.\., and then [ or . - (src.startsWith('\\.\\.') && aps.has(src.charAt(4))); - // no need to prevent dots if it can't match a dot, or if a - // sub-pattern will be preventing it anyway. - const needNoDot = !dot && !allowDot && aps.has(src.charAt(0)); - start = - needNoTrav ? startNoTraversal - : needNoDot ? startNoDot - : ''; - } - } - } - // append the "end of path portion" pattern to negation tails - let end = ''; - if (this.isEnd() && - this.#root.#filledNegs && - this.#parent?.type === '!') { - end = '(?:$|\\/)'; - } - const final = start + src + end; - return [ - final, - unescape(src), - (this.#hasMagic = !!this.#hasMagic), - this.#uflag, - ]; - } - // We need to calculate the body *twice* if it's a repeat pattern - // at the start, once in nodot mode, then again in dot mode, so a - // pattern like *(?) can match 'x.y' - const repeated = this.type === '*' || this.type === '+'; - // some kind of extglob - const start = this.type === '!' ? '(?:(?!(?:' : '(?:'; - let body = this.#partsToRegExp(dot); - if (this.isStart() && this.isEnd() && !body && this.type !== '!') { - // invalid extglob, has to at least be *something* present, if it's - // the entire path portion. - const s = this.toString(); - const me = this; - me.#parts = [s]; - me.type = null; - me.#hasMagic = undefined; - return [s, unescape(this.toString()), false, false]; - } - let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot ? - '' - : this.#partsToRegExp(true); - if (bodyDotAllowed === body) { - bodyDotAllowed = ''; - } - if (bodyDotAllowed) { - body = `(?:${body})(?:${bodyDotAllowed})*?`; - } - // an empty !() is exactly equivalent to a starNoEmpty - let final = ''; - if (this.type === '!' && this.#emptyExt) { - final = (this.isStart() && !dot ? startNoDot : '') + starNoEmpty; - } - else { - const close = this.type === '!' ? - // !() must match something,but !(x) can match '' - '))' + - (this.isStart() && !dot && !allowDot ? startNoDot : '') + - star + - ')' - : this.type === '@' ? ')' - : this.type === '?' ? ')?' - : this.type === '+' && bodyDotAllowed ? ')' - : this.type === '*' && bodyDotAllowed ? `)?` - : `)${this.type}`; - final = start + body + close; - } - return [ - final, - unescape(body), - (this.#hasMagic = !!this.#hasMagic), - this.#uflag, - ]; - } - #flatten() { - if (!isExtglobAST(this)) { - for (const p of this.#parts) { - if (typeof p === 'object') { - p.#flatten(); - } - } - } - else { - // do up to 10 passes to flatten as much as possible - let iterations = 0; - let done = false; - do { - done = true; - for (let i = 0; i < this.#parts.length; i++) { - const c = this.#parts[i]; - if (typeof c === 'object') { - c.#flatten(); - if (this.#canAdopt(c)) { - done = false; - this.#adopt(c, i); - } - else if (this.#canAdoptWithSpace(c)) { - done = false; - this.#adoptWithSpace(c, i); - } - else if (this.#canUsurp(c)) { - done = false; - this.#usurp(c); - } - } - } - } while (!done && ++iterations < 10); - } - this.#toString = undefined; - } - #partsToRegExp(dot) { - return this.#parts - .map(p => { - // extglob ASTs should only contain parent ASTs - /* c8 ignore start */ - if (typeof p === 'string') { - throw new Error('string type in extglob ast??'); - } - /* c8 ignore stop */ - // can ignore hasMagic, because extglobs are already always magic - const [re, _, _hasMagic, uflag] = p.toRegExpSource(dot); - this.#uflag = this.#uflag || uflag; - return re; - }) - .filter(p => !(this.isStart() && this.isEnd()) || !!p) - .join('|'); - } - static #parseGlob(glob, hasMagic, noEmpty = false) { - let escaping = false; - let re = ''; - let uflag = false; - // multiple stars that aren't globstars coalesce into one * - let inStar = false; - for (let i = 0; i < glob.length; i++) { - const c = glob.charAt(i); - if (escaping) { - escaping = false; - re += (reSpecials.has(c) ? '\\' : '') + c; - continue; - } - if (c === '*') { - if (inStar) - continue; - inStar = true; - re += noEmpty && /^[*]+$/.test(glob) ? starNoEmpty : star; - hasMagic = true; - continue; - } - else { - inStar = false; - } - if (c === '\\') { - if (i === glob.length - 1) { - re += '\\\\'; - } - else { - escaping = true; - } - continue; - } - if (c === '[') { - const [src, needUflag, consumed, magic] = parseClass(glob, i); - if (consumed) { - re += src; - uflag = uflag || needUflag; - i += consumed - 1; - hasMagic = hasMagic || magic; - continue; - } - } - if (c === '?') { - re += qmark; - hasMagic = true; - continue; - } - re += regExpEscape(c); - } - return [re, unescape(glob), !!hasMagic, uflag]; - } -} -_a = AST; -//# sourceMappingURL=ast.js.map \ No newline at end of file diff --git a/.output/server/node_modules/minimatch/dist/esm/brace-expressions.js b/.output/server/node_modules/minimatch/dist/esm/brace-expressions.js deleted file mode 100644 index 4b49d40..0000000 --- a/.output/server/node_modules/minimatch/dist/esm/brace-expressions.js +++ /dev/null @@ -1,146 +0,0 @@ -// translate the various posix character classes into unicode properties -// this works across all unicode locales -// { : [, /u flag required, negated] -const posixClasses = { - '[:alnum:]': ['\\p{L}\\p{Nl}\\p{Nd}', true], - '[:alpha:]': ['\\p{L}\\p{Nl}', true], - '[:ascii:]': ['\\x' + '00-\\x' + '7f', false], - '[:blank:]': ['\\p{Zs}\\t', true], - '[:cntrl:]': ['\\p{Cc}', true], - '[:digit:]': ['\\p{Nd}', true], - '[:graph:]': ['\\p{Z}\\p{C}', true, true], - '[:lower:]': ['\\p{Ll}', true], - '[:print:]': ['\\p{C}', true], - '[:punct:]': ['\\p{P}', true], - '[:space:]': ['\\p{Z}\\t\\r\\n\\v\\f', true], - '[:upper:]': ['\\p{Lu}', true], - '[:word:]': ['\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}', true], - '[:xdigit:]': ['A-Fa-f0-9', false], -}; -// only need to escape a few things inside of brace expressions -// escapes: [ \ ] - -const braceEscape = (s) => s.replace(/[[\]\\-]/g, '\\$&'); -// escape all regexp magic characters -const regexpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); -// everything has already been escaped, we just have to join -const rangesToString = (ranges) => ranges.join(''); -// takes a glob string at a posix brace expression, and returns -// an equivalent regular expression source, and boolean indicating -// whether the /u flag needs to be applied, and the number of chars -// consumed to parse the character class. -// This also removes out of order ranges, and returns ($.) if the -// entire class just no good. -export const parseClass = (glob, position) => { - const pos = position; - /* c8 ignore start */ - if (glob.charAt(pos) !== '[') { - throw new Error('not in a brace expression'); - } - /* c8 ignore stop */ - const ranges = []; - const negs = []; - let i = pos + 1; - let sawStart = false; - let uflag = false; - let escaping = false; - let negate = false; - let endPos = pos; - let rangeStart = ''; - WHILE: while (i < glob.length) { - const c = glob.charAt(i); - if ((c === '!' || c === '^') && i === pos + 1) { - negate = true; - i++; - continue; - } - if (c === ']' && sawStart && !escaping) { - endPos = i + 1; - break; - } - sawStart = true; - if (c === '\\') { - if (!escaping) { - escaping = true; - i++; - continue; - } - // escaped \ char, fall through and treat like normal char - } - if (c === '[' && !escaping) { - // either a posix class, a collation equivalent, or just a [ - for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) { - if (glob.startsWith(cls, i)) { - // invalid, [a-[] is fine, but not [a-[:alpha]] - if (rangeStart) { - return ['$.', false, glob.length - pos, true]; - } - i += cls.length; - if (neg) - negs.push(unip); - else - ranges.push(unip); - uflag = uflag || u; - continue WHILE; - } - } - } - // now it's just a normal character, effectively - escaping = false; - if (rangeStart) { - // throw this range away if it's not valid, but others - // can still match. - if (c > rangeStart) { - ranges.push(braceEscape(rangeStart) + '-' + braceEscape(c)); - } - else if (c === rangeStart) { - ranges.push(braceEscape(c)); - } - rangeStart = ''; - i++; - continue; - } - // now might be the start of a range. - // can be either c-d or c-] or c] or c] at this point - if (glob.startsWith('-]', i + 1)) { - ranges.push(braceEscape(c + '-')); - i += 2; - continue; - } - if (glob.startsWith('-', i + 1)) { - rangeStart = c; - i += 2; - continue; - } - // not the start of a range, just a single character - ranges.push(braceEscape(c)); - i++; - } - if (endPos < i) { - // didn't see the end of the class, not a valid class, - // but might still be valid as a literal match. - return ['', false, 0, false]; - } - // if we got no ranges and no negates, then we have a range that - // cannot possibly match anything, and that poisons the whole glob - if (!ranges.length && !negs.length) { - return ['$.', false, glob.length - pos, true]; - } - // if we got one positive range, and it's a single character, then that's - // not actually a magic pattern, it's just that one literal character. - // we should not treat that as "magic", we should just return the literal - // character. [_] is a perfectly valid way to escape glob magic chars. - if (negs.length === 0 && - ranges.length === 1 && - /^\\?.$/.test(ranges[0]) && - !negate) { - const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0]; - return [regexpEscape(r), false, endPos - pos, false]; - } - const sranges = '[' + (negate ? '^' : '') + rangesToString(ranges) + ']'; - const snegs = '[' + (negate ? '' : '^') + rangesToString(negs) + ']'; - const comb = ranges.length && negs.length ? '(' + sranges + '|' + snegs + ')' - : ranges.length ? sranges - : snegs; - return [comb, uflag, endPos - pos, true]; -}; -//# sourceMappingURL=brace-expressions.js.map \ No newline at end of file diff --git a/.output/server/node_modules/minimatch/dist/esm/escape.js b/.output/server/node_modules/minimatch/dist/esm/escape.js deleted file mode 100644 index 46d0ec8..0000000 --- a/.output/server/node_modules/minimatch/dist/esm/escape.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Escape all magic characters in a glob pattern. - * - * If the {@link MinimatchOptions.windowsPathsNoEscape} - * option is used, then characters are escaped by wrapping in `[]`, because - * a magic character wrapped in a character class can only be satisfied by - * that exact character. In this mode, `\` is _not_ escaped, because it is - * not interpreted as a magic character, but instead as a path separator. - * - * If the {@link MinimatchOptions.magicalBraces} option is used, - * then braces (`{` and `}`) will be escaped. - */ -export const escape = (s, { windowsPathsNoEscape = false, magicalBraces = false, } = {}) => { - // don't need to escape +@! because we escape the parens - // that make those magic, and escaping ! as [!] isn't valid, - // because [!]] is a valid glob class meaning not ']'. - if (magicalBraces) { - return windowsPathsNoEscape ? - s.replace(/[?*()[\]{}]/g, '[$&]') - : s.replace(/[?*()[\]\\{}]/g, '\\$&'); - } - return windowsPathsNoEscape ? - s.replace(/[?*()[\]]/g, '[$&]') - : s.replace(/[?*()[\]\\]/g, '\\$&'); -}; -//# sourceMappingURL=escape.js.map \ No newline at end of file diff --git a/.output/server/node_modules/minimatch/dist/esm/index.js b/.output/server/node_modules/minimatch/dist/esm/index.js deleted file mode 100644 index a5e6fa8..0000000 --- a/.output/server/node_modules/minimatch/dist/esm/index.js +++ /dev/null @@ -1,1114 +0,0 @@ -import { expand } from 'brace-expansion'; -import { assertValidPattern } from './assert-valid-pattern.js'; -import { AST } from './ast.js'; -import { escape } from './escape.js'; -import { unescape } from './unescape.js'; -export const minimatch = (p, pattern, options = {}) => { - assertValidPattern(pattern); - // shortcut: comments match nothing. - if (!options.nocomment && pattern.charAt(0) === '#') { - return false; - } - return new Minimatch(pattern, options).match(p); -}; -// Optimized checking for the most common glob patterns. -const starDotExtRE = /^\*+([^+@!?*[(]*)$/; -const starDotExtTest = (ext) => (f) => !f.startsWith('.') && f.endsWith(ext); -const starDotExtTestDot = (ext) => (f) => f.endsWith(ext); -const starDotExtTestNocase = (ext) => { - ext = ext.toLowerCase(); - return (f) => !f.startsWith('.') && f.toLowerCase().endsWith(ext); -}; -const starDotExtTestNocaseDot = (ext) => { - ext = ext.toLowerCase(); - return (f) => f.toLowerCase().endsWith(ext); -}; -const starDotStarRE = /^\*+\.\*+$/; -const starDotStarTest = (f) => !f.startsWith('.') && f.includes('.'); -const starDotStarTestDot = (f) => f !== '.' && f !== '..' && f.includes('.'); -const dotStarRE = /^\.\*+$/; -const dotStarTest = (f) => f !== '.' && f !== '..' && f.startsWith('.'); -const starRE = /^\*+$/; -const starTest = (f) => f.length !== 0 && !f.startsWith('.'); -const starTestDot = (f) => f.length !== 0 && f !== '.' && f !== '..'; -const qmarksRE = /^\?+([^+@!?*[(]*)?$/; -const qmarksTestNocase = ([$0, ext = '']) => { - const noext = qmarksTestNoExt([$0]); - if (!ext) - return noext; - ext = ext.toLowerCase(); - return (f) => noext(f) && f.toLowerCase().endsWith(ext); -}; -const qmarksTestNocaseDot = ([$0, ext = '']) => { - const noext = qmarksTestNoExtDot([$0]); - if (!ext) - return noext; - ext = ext.toLowerCase(); - return (f) => noext(f) && f.toLowerCase().endsWith(ext); -}; -const qmarksTestDot = ([$0, ext = '']) => { - const noext = qmarksTestNoExtDot([$0]); - return !ext ? noext : (f) => noext(f) && f.endsWith(ext); -}; -const qmarksTest = ([$0, ext = '']) => { - const noext = qmarksTestNoExt([$0]); - return !ext ? noext : (f) => noext(f) && f.endsWith(ext); -}; -const qmarksTestNoExt = ([$0]) => { - const len = $0.length; - return (f) => f.length === len && !f.startsWith('.'); -}; -const qmarksTestNoExtDot = ([$0]) => { - const len = $0.length; - return (f) => f.length === len && f !== '.' && f !== '..'; -}; -/* c8 ignore start */ -const defaultPlatform = (typeof process === 'object' && process ? - (typeof process.env === 'object' && - process.env && - process.env.__MINIMATCH_TESTING_PLATFORM__) || - process.platform - : 'posix'); -const path = { - win32: { sep: '\\' }, - posix: { sep: '/' }, -}; -/* c8 ignore stop */ -export const sep = defaultPlatform === 'win32' ? path.win32.sep : path.posix.sep; -minimatch.sep = sep; -export const GLOBSTAR = Symbol('globstar **'); -minimatch.GLOBSTAR = GLOBSTAR; -// any single thing other than / -// don't need to escape / when using new RegExp() -const qmark = '[^/]'; -// * => any number of characters -const star = qmark + '*?'; -// ** when dots are allowed. Anything goes, except .. and . -// not (^ or / followed by one or two dots followed by $ or /), -// followed by anything, any number of times. -const twoStarDot = '(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?'; -// not a ^ or / followed by a dot, -// followed by anything, any number of times. -const twoStarNoDot = '(?:(?!(?:\\/|^)\\.).)*?'; -export const filter = (pattern, options = {}) => (p) => minimatch(p, pattern, options); -minimatch.filter = filter; -const ext = (a, b = {}) => Object.assign({}, a, b); -export const defaults = (def) => { - if (!def || typeof def !== 'object' || !Object.keys(def).length) { - return minimatch; - } - const orig = minimatch; - const m = (p, pattern, options = {}) => orig(p, pattern, ext(def, options)); - return Object.assign(m, { - Minimatch: class Minimatch extends orig.Minimatch { - constructor(pattern, options = {}) { - super(pattern, ext(def, options)); - } - static defaults(options) { - return orig.defaults(ext(def, options)).Minimatch; - } - }, - AST: class AST extends orig.AST { - /* c8 ignore start */ - constructor(type, parent, options = {}) { - super(type, parent, ext(def, options)); - } - /* c8 ignore stop */ - static fromGlob(pattern, options = {}) { - return orig.AST.fromGlob(pattern, ext(def, options)); - } - }, - unescape: (s, options = {}) => orig.unescape(s, ext(def, options)), - escape: (s, options = {}) => orig.escape(s, ext(def, options)), - filter: (pattern, options = {}) => orig.filter(pattern, ext(def, options)), - defaults: (options) => orig.defaults(ext(def, options)), - makeRe: (pattern, options = {}) => orig.makeRe(pattern, ext(def, options)), - braceExpand: (pattern, options = {}) => orig.braceExpand(pattern, ext(def, options)), - match: (list, pattern, options = {}) => orig.match(list, pattern, ext(def, options)), - sep: orig.sep, - GLOBSTAR: GLOBSTAR, - }); -}; -minimatch.defaults = defaults; -// Brace expansion: -// a{b,c}d -> abd acd -// a{b,}c -> abc ac -// a{0..3}d -> a0d a1d a2d a3d -// a{b,c{d,e}f}g -> abg acdfg acefg -// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg -// -// Invalid sets are not expanded. -// a{2..}b -> a{2..}b -// a{b}c -> a{b}c -export const braceExpand = (pattern, options = {}) => { - assertValidPattern(pattern); - // Thanks to Yeting Li for - // improving this regexp to avoid a ReDOS vulnerability. - if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { - // shortcut. no need to expand. - return [pattern]; - } - return expand(pattern, { max: options.braceExpandMax }); -}; -minimatch.braceExpand = braceExpand; -// parse a component of the expanded set. -// At this point, no pattern may contain "/" in it -// so we're going to return a 2d array, where each entry is the full -// pattern, split on '/', and then turned into a regular expression. -// A regexp is made at the end which joins each array with an -// escaped /, and another full one which joins each regexp with |. -// -// Following the lead of Bash 4.1, note that "**" only has special meaning -// when it is the *only* thing in a path portion. Otherwise, any series -// of * is equivalent to a single *. Globstar behavior is enabled by -// default, and can be disabled by setting options.noglobstar. -export const makeRe = (pattern, options = {}) => new Minimatch(pattern, options).makeRe(); -minimatch.makeRe = makeRe; -export const match = (list, pattern, options = {}) => { - const mm = new Minimatch(pattern, options); - list = list.filter(f => mm.match(f)); - if (mm.options.nonull && !list.length) { - list.push(pattern); - } - return list; -}; -minimatch.match = match; -// replace stuff like \* with * -const globMagic = /[?*]|[+@!]\(.*?\)|\[|\]/; -const regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); -export class Minimatch { - options; - set; - pattern; - windowsPathsNoEscape; - nonegate; - negate; - comment; - empty; - preserveMultipleSlashes; - partial; - globSet; - globParts; - nocase; - isWindows; - platform; - windowsNoMagicRoot; - maxGlobstarRecursion; - regexp; - constructor(pattern, options = {}) { - assertValidPattern(pattern); - options = options || {}; - this.options = options; - this.maxGlobstarRecursion = options.maxGlobstarRecursion ?? 200; - this.pattern = pattern; - this.platform = options.platform || defaultPlatform; - this.isWindows = this.platform === 'win32'; - // avoid the annoying deprecation flag lol - const awe = ('allowWindow' + 'sEscape'); - this.windowsPathsNoEscape = - !!options.windowsPathsNoEscape || options[awe] === false; - if (this.windowsPathsNoEscape) { - this.pattern = this.pattern.replace(/\\/g, '/'); - } - this.preserveMultipleSlashes = !!options.preserveMultipleSlashes; - this.regexp = null; - this.negate = false; - this.nonegate = !!options.nonegate; - this.comment = false; - this.empty = false; - this.partial = !!options.partial; - this.nocase = !!this.options.nocase; - this.windowsNoMagicRoot = - options.windowsNoMagicRoot !== undefined ? - options.windowsNoMagicRoot - : !!(this.isWindows && this.nocase); - this.globSet = []; - this.globParts = []; - this.set = []; - // make the set of regexps etc. - this.make(); - } - hasMagic() { - if (this.options.magicalBraces && this.set.length > 1) { - return true; - } - for (const pattern of this.set) { - for (const part of pattern) { - if (typeof part !== 'string') - return true; - } - } - return false; - } - debug(..._) { } - make() { - const pattern = this.pattern; - const options = this.options; - // empty patterns and comments match nothing. - if (!options.nocomment && pattern.charAt(0) === '#') { - this.comment = true; - return; - } - if (!pattern) { - this.empty = true; - return; - } - // step 1: figure out negation, etc. - this.parseNegate(); - // step 2: expand braces - this.globSet = [...new Set(this.braceExpand())]; - if (options.debug) { - //oxlint-disable-next-line no-console - this.debug = (...args) => console.error(...args); - } - this.debug(this.pattern, this.globSet); - // step 3: now we have a set, so turn each one into a series of - // path-portion matching patterns. - // These will be regexps, except in the case of "**", which is - // set to the GLOBSTAR object for globstar behavior, - // and will not contain any / characters - // - // First, we preprocess to make the glob pattern sets a bit simpler - // and deduped. There are some perf-killing patterns that can cause - // problems with a glob walk, but we can simplify them down a bit. - const rawGlobParts = this.globSet.map(s => this.slashSplit(s)); - this.globParts = this.preprocess(rawGlobParts); - this.debug(this.pattern, this.globParts); - // glob --> regexps - let set = this.globParts.map((s, _, __) => { - if (this.isWindows && this.windowsNoMagicRoot) { - // check if it's a drive or unc path. - const isUNC = s[0] === '' && - s[1] === '' && - (s[2] === '?' || !globMagic.test(s[2])) && - !globMagic.test(s[3]); - const isDrive = /^[a-z]:/i.test(s[0]); - if (isUNC) { - return [ - ...s.slice(0, 4), - ...s.slice(4).map(ss => this.parse(ss)), - ]; - } - else if (isDrive) { - return [s[0], ...s.slice(1).map(ss => this.parse(ss))]; - } - } - return s.map(ss => this.parse(ss)); - }); - this.debug(this.pattern, set); - // filter out everything that didn't compile properly. - this.set = set.filter(s => s.indexOf(false) === -1); - // do not treat the ? in UNC paths as magic - if (this.isWindows) { - for (let i = 0; i < this.set.length; i++) { - const p = this.set[i]; - if (p[0] === '' && - p[1] === '' && - this.globParts[i][2] === '?' && - typeof p[3] === 'string' && - /^[a-z]:$/i.test(p[3])) { - p[2] = '?'; - } - } - } - this.debug(this.pattern, this.set); - } - // various transforms to equivalent pattern sets that are - // faster to process in a filesystem walk. The goal is to - // eliminate what we can, and push all ** patterns as far - // to the right as possible, even if it increases the number - // of patterns that we have to process. - preprocess(globParts) { - // if we're not in globstar mode, then turn ** into * - if (this.options.noglobstar) { - for (const partset of globParts) { - for (let j = 0; j < partset.length; j++) { - if (partset[j] === '**') { - partset[j] = '*'; - } - } - } - } - const { optimizationLevel = 1 } = this.options; - if (optimizationLevel >= 2) { - // aggressive optimization for the purpose of fs walking - globParts = this.firstPhasePreProcess(globParts); - globParts = this.secondPhasePreProcess(globParts); - } - else if (optimizationLevel >= 1) { - // just basic optimizations to remove some .. parts - globParts = this.levelOneOptimize(globParts); - } - else { - // just collapse multiple ** portions into one - globParts = this.adjascentGlobstarOptimize(globParts); - } - return globParts; - } - // just get rid of adjascent ** portions - adjascentGlobstarOptimize(globParts) { - return globParts.map(parts => { - let gs = -1; - while (-1 !== (gs = parts.indexOf('**', gs + 1))) { - let i = gs; - while (parts[i + 1] === '**') { - i++; - } - if (i !== gs) { - parts.splice(gs, i - gs); - } - } - return parts; - }); - } - // get rid of adjascent ** and resolve .. portions - levelOneOptimize(globParts) { - return globParts.map(parts => { - parts = parts.reduce((set, part) => { - const prev = set[set.length - 1]; - if (part === '**' && prev === '**') { - return set; - } - if (part === '..') { - if (prev && prev !== '..' && prev !== '.' && prev !== '**') { - set.pop(); - return set; - } - } - set.push(part); - return set; - }, []); - return parts.length === 0 ? [''] : parts; - }); - } - levelTwoFileOptimize(parts) { - if (!Array.isArray(parts)) { - parts = this.slashSplit(parts); - } - let didSomething = false; - do { - didSomething = false; - //
    // -> 
    /
    -            if (!this.preserveMultipleSlashes) {
    -                for (let i = 1; i < parts.length - 1; i++) {
    -                    const p = parts[i];
    -                    // don't squeeze out UNC patterns
    -                    if (i === 1 && p === '' && parts[0] === '')
    -                        continue;
    -                    if (p === '.' || p === '') {
    -                        didSomething = true;
    -                        parts.splice(i, 1);
    -                        i--;
    -                    }
    -                }
    -                if (parts[0] === '.' &&
    -                    parts.length === 2 &&
    -                    (parts[1] === '.' || parts[1] === '')) {
    -                    didSomething = true;
    -                    parts.pop();
    -                }
    -            }
    -            // 
    /

    /../ ->

    /
    -            let dd = 0;
    -            while (-1 !== (dd = parts.indexOf('..', dd + 1))) {
    -                const p = parts[dd - 1];
    -                if (p &&
    -                    p !== '.' &&
    -                    p !== '..' &&
    -                    p !== '**' &&
    -                    !(this.isWindows && /^[a-z]:$/i.test(p))) {
    -                    didSomething = true;
    -                    parts.splice(dd - 1, 2);
    -                    dd -= 2;
    -                }
    -            }
    -        } while (didSomething);
    -        return parts.length === 0 ? [''] : parts;
    -    }
    -    // First phase: single-pattern processing
    -    // 
     is 1 or more portions
    -    //  is 1 or more portions
    -    // 

    is any portion other than ., .., '', or ** - // is . or '' - // - // **/.. is *brutal* for filesystem walking performance, because - // it effectively resets the recursive walk each time it occurs, - // and ** cannot be reduced out by a .. pattern part like a regexp - // or most strings (other than .., ., and '') can be. - // - //

    /**/../

    /

    / -> {

    /../

    /

    /,

    /**/

    /

    /} - //

    // -> 
    /
    -    // 
    /

    /../ ->

    /
    -    // **/**/ -> **/
    -    //
    -    // **/*/ -> */**/ <== not valid because ** doesn't follow
    -    // this WOULD be allowed if ** did follow symlinks, or * didn't
    -    firstPhasePreProcess(globParts) {
    -        let didSomething = false;
    -        do {
    -            didSomething = false;
    -            // 
    /**/../

    /

    / -> {

    /../

    /

    /,

    /**/

    /

    /} - for (let parts of globParts) { - let gs = -1; - while (-1 !== (gs = parts.indexOf('**', gs + 1))) { - let gss = gs; - while (parts[gss + 1] === '**') { - //

    /**/**/ -> 
    /**/
    -                        gss++;
    -                    }
    -                    // eg, if gs is 2 and gss is 4, that means we have 3 **
    -                    // parts, and can remove 2 of them.
    -                    if (gss > gs) {
    -                        parts.splice(gs + 1, gss - gs);
    -                    }
    -                    let next = parts[gs + 1];
    -                    const p = parts[gs + 2];
    -                    const p2 = parts[gs + 3];
    -                    if (next !== '..')
    -                        continue;
    -                    if (!p ||
    -                        p === '.' ||
    -                        p === '..' ||
    -                        !p2 ||
    -                        p2 === '.' ||
    -                        p2 === '..') {
    -                        continue;
    -                    }
    -                    didSomething = true;
    -                    // edit parts in place, and push the new one
    -                    parts.splice(gs, 1);
    -                    const other = parts.slice(0);
    -                    other[gs] = '**';
    -                    globParts.push(other);
    -                    gs--;
    -                }
    -                // 
    // -> 
    /
    -                if (!this.preserveMultipleSlashes) {
    -                    for (let i = 1; i < parts.length - 1; i++) {
    -                        const p = parts[i];
    -                        // don't squeeze out UNC patterns
    -                        if (i === 1 && p === '' && parts[0] === '')
    -                            continue;
    -                        if (p === '.' || p === '') {
    -                            didSomething = true;
    -                            parts.splice(i, 1);
    -                            i--;
    -                        }
    -                    }
    -                    if (parts[0] === '.' &&
    -                        parts.length === 2 &&
    -                        (parts[1] === '.' || parts[1] === '')) {
    -                        didSomething = true;
    -                        parts.pop();
    -                    }
    -                }
    -                // 
    /

    /../ ->

    /
    -                let dd = 0;
    -                while (-1 !== (dd = parts.indexOf('..', dd + 1))) {
    -                    const p = parts[dd - 1];
    -                    if (p && p !== '.' && p !== '..' && p !== '**') {
    -                        didSomething = true;
    -                        const needDot = dd === 1 && parts[dd + 1] === '**';
    -                        const splin = needDot ? ['.'] : [];
    -                        parts.splice(dd - 1, 2, ...splin);
    -                        if (parts.length === 0)
    -                            parts.push('');
    -                        dd -= 2;
    -                    }
    -                }
    -            }
    -        } while (didSomething);
    -        return globParts;
    -    }
    -    // second phase: multi-pattern dedupes
    -    // {
    /*/,
    /

    /} ->

    /*/
    -    // {
    /,
    /} -> 
    /
    -    // {
    /**/,
    /} -> 
    /**/
    -    //
    -    // {
    /**/,
    /**/

    /} ->

    /**/
    -    // ^-- not valid because ** doens't follow symlinks
    -    secondPhasePreProcess(globParts) {
    -        for (let i = 0; i < globParts.length - 1; i++) {
    -            for (let j = i + 1; j < globParts.length; j++) {
    -                const matched = this.partsMatch(globParts[i], globParts[j], !this.preserveMultipleSlashes);
    -                if (matched) {
    -                    globParts[i] = [];
    -                    globParts[j] = matched;
    -                    break;
    -                }
    -            }
    -        }
    -        return globParts.filter(gs => gs.length);
    -    }
    -    partsMatch(a, b, emptyGSMatch = false) {
    -        let ai = 0;
    -        let bi = 0;
    -        let result = [];
    -        let which = '';
    -        while (ai < a.length && bi < b.length) {
    -            if (a[ai] === b[bi]) {
    -                result.push(which === 'b' ? b[bi] : a[ai]);
    -                ai++;
    -                bi++;
    -            }
    -            else if (emptyGSMatch && a[ai] === '**' && b[bi] === a[ai + 1]) {
    -                result.push(a[ai]);
    -                ai++;
    -            }
    -            else if (emptyGSMatch && b[bi] === '**' && a[ai] === b[bi + 1]) {
    -                result.push(b[bi]);
    -                bi++;
    -            }
    -            else if (a[ai] === '*' &&
    -                b[bi] &&
    -                (this.options.dot || !b[bi].startsWith('.')) &&
    -                b[bi] !== '**') {
    -                if (which === 'b')
    -                    return false;
    -                which = 'a';
    -                result.push(a[ai]);
    -                ai++;
    -                bi++;
    -            }
    -            else if (b[bi] === '*' &&
    -                a[ai] &&
    -                (this.options.dot || !a[ai].startsWith('.')) &&
    -                a[ai] !== '**') {
    -                if (which === 'a')
    -                    return false;
    -                which = 'b';
    -                result.push(b[bi]);
    -                ai++;
    -                bi++;
    -            }
    -            else {
    -                return false;
    -            }
    -        }
    -        // if we fall out of the loop, it means they two are identical
    -        // as long as their lengths match
    -        return a.length === b.length && result;
    -    }
    -    parseNegate() {
    -        if (this.nonegate)
    -            return;
    -        const pattern = this.pattern;
    -        let negate = false;
    -        let negateOffset = 0;
    -        for (let i = 0; i < pattern.length && pattern.charAt(i) === '!'; i++) {
    -            negate = !negate;
    -            negateOffset++;
    -        }
    -        if (negateOffset)
    -            this.pattern = pattern.slice(negateOffset);
    -        this.negate = negate;
    -    }
    -    // set partial to true to test if, for example,
    -    // "/a/b" matches the start of "/*/b/*/d"
    -    // Partial means, if you run out of file before you run
    -    // out of pattern, then that's fine, as long as all
    -    // the parts match.
    -    matchOne(file, pattern, partial = false) {
    -        let fileStartIndex = 0;
    -        let patternStartIndex = 0;
    -        // UNC paths like //?/X:/... can match X:/... and vice versa
    -        // Drive letters in absolute drive or unc paths are always compared
    -        // case-insensitively.
    -        if (this.isWindows) {
    -            const fileDrive = typeof file[0] === 'string' && /^[a-z]:$/i.test(file[0]);
    -            const fileUNC = !fileDrive &&
    -                file[0] === '' &&
    -                file[1] === '' &&
    -                file[2] === '?' &&
    -                /^[a-z]:$/i.test(file[3]);
    -            const patternDrive = typeof pattern[0] === 'string' && /^[a-z]:$/i.test(pattern[0]);
    -            const patternUNC = !patternDrive &&
    -                pattern[0] === '' &&
    -                pattern[1] === '' &&
    -                pattern[2] === '?' &&
    -                typeof pattern[3] === 'string' &&
    -                /^[a-z]:$/i.test(pattern[3]);
    -            const fdi = fileUNC ? 3
    -                : fileDrive ? 0
    -                    : undefined;
    -            const pdi = patternUNC ? 3
    -                : patternDrive ? 0
    -                    : undefined;
    -            if (typeof fdi === 'number' && typeof pdi === 'number') {
    -                const [fd, pd] = [
    -                    file[fdi],
    -                    pattern[pdi],
    -                ];
    -                // start matching at the drive letter index of each
    -                if (fd.toLowerCase() === pd.toLowerCase()) {
    -                    pattern[pdi] = fd;
    -                    patternStartIndex = pdi;
    -                    fileStartIndex = fdi;
    -                }
    -            }
    -        }
    -        // resolve and reduce . and .. portions in the file as well.
    -        // don't need to do the second phase, because it's only one string[]
    -        const { optimizationLevel = 1 } = this.options;
    -        if (optimizationLevel >= 2) {
    -            file = this.levelTwoFileOptimize(file);
    -        }
    -        if (pattern.includes(GLOBSTAR)) {
    -            return this.#matchGlobstar(file, pattern, partial, fileStartIndex, patternStartIndex);
    -        }
    -        return this.#matchOne(file, pattern, partial, fileStartIndex, patternStartIndex);
    -    }
    -    #matchGlobstar(file, pattern, partial, fileIndex, patternIndex) {
    -        // split the pattern into head, tail, and middle of ** delimited parts
    -        const firstgs = pattern.indexOf(GLOBSTAR, patternIndex);
    -        const lastgs = pattern.lastIndexOf(GLOBSTAR);
    -        // split the pattern up into globstar-delimited sections
    -        // the tail has to be at the end, and the others just have
    -        // to be found in order from the head.
    -        const [head, body, tail] = partial ?
    -            [
    -                pattern.slice(patternIndex, firstgs),
    -                pattern.slice(firstgs + 1),
    -                [],
    -            ]
    -            : [
    -                pattern.slice(patternIndex, firstgs),
    -                pattern.slice(firstgs + 1, lastgs),
    -                pattern.slice(lastgs + 1),
    -            ];
    -        // check the head, from the current file/pattern index.
    -        if (head.length) {
    -            const fileHead = file.slice(fileIndex, fileIndex + head.length);
    -            if (!this.#matchOne(fileHead, head, partial, 0, 0)) {
    -                return false;
    -            }
    -            fileIndex += head.length;
    -            patternIndex += head.length;
    -        }
    -        // now we know the head matches!
    -        // if the last portion is not empty, it MUST match the end
    -        // check the tail
    -        let fileTailMatch = 0;
    -        if (tail.length) {
    -            // if head + tail > file, then we cannot possibly match
    -            if (tail.length + fileIndex > file.length)
    -                return false;
    -            // try to match the tail
    -            let tailStart = file.length - tail.length;
    -            if (this.#matchOne(file, tail, partial, tailStart, 0)) {
    -                fileTailMatch = tail.length;
    -            }
    -            else {
    -                // affordance for stuff like a/**/* matching a/b/
    -                // if the last file portion is '', and there's more to the pattern
    -                // then try without the '' bit.
    -                if (file[file.length - 1] !== '' ||
    -                    fileIndex + tail.length === file.length) {
    -                    return false;
    -                }
    -                tailStart--;
    -                if (!this.#matchOne(file, tail, partial, tailStart, 0)) {
    -                    return false;
    -                }
    -                fileTailMatch = tail.length + 1;
    -            }
    -        }
    -        // now we know the tail matches!
    -        // the middle is zero or more portions wrapped in **, possibly
    -        // containing more ** sections.
    -        // so a/**/b/**/c/**/d has become **/b/**/c/**
    -        // if it's empty, it means a/**/b, just verify we have no bad dots
    -        // if there's no tail, so it ends on /**, then we must have *something*
    -        // after the head, or it's not a matc
    -        if (!body.length) {
    -            let sawSome = !!fileTailMatch;
    -            for (let i = fileIndex; i < file.length - fileTailMatch; i++) {
    -                const f = String(file[i]);
    -                sawSome = true;
    -                if (f === '.' ||
    -                    f === '..' ||
    -                    (!this.options.dot && f.startsWith('.'))) {
    -                    return false;
    -                }
    -            }
    -            // in partial mode, we just need to get past all file parts
    -            return partial || sawSome;
    -        }
    -        // now we know that there's one or more body sections, which can
    -        // be matched anywhere from the 0 index (because the head was pruned)
    -        // through to the length-fileTailMatch index.
    -        // split the body up into sections, and note the minimum index it can
    -        // be found at (start with the length of all previous segments)
    -        // [section, before, after]
    -        const bodySegments = [[[], 0]];
    -        let currentBody = bodySegments[0];
    -        let nonGsParts = 0;
    -        const nonGsPartsSums = [0];
    -        for (const b of body) {
    -            if (b === GLOBSTAR) {
    -                nonGsPartsSums.push(nonGsParts);
    -                currentBody = [[], 0];
    -                bodySegments.push(currentBody);
    -            }
    -            else {
    -                currentBody[0].push(b);
    -                nonGsParts++;
    -            }
    -        }
    -        let i = bodySegments.length - 1;
    -        const fileLength = file.length - fileTailMatch;
    -        for (const b of bodySegments) {
    -            b[1] = fileLength - (nonGsPartsSums[i--] + b[0].length);
    -        }
    -        return !!this.#matchGlobStarBodySections(file, bodySegments, fileIndex, 0, partial, 0, !!fileTailMatch);
    -    }
    -    // return false for "nope, not matching"
    -    // return null for "not matching, cannot keep trying"
    -    #matchGlobStarBodySections(file, 
    -    // pattern section, last possible position for it
    -    bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) {
    -        // take the first body segment, and walk from fileIndex to its "after"
    -        // value at the end
    -        // If it doesn't match at that position, we increment, until we hit
    -        // that final possible position, and give up.
    -        // If it does match, then advance and try to rest.
    -        // If any of them fail we keep walking forward.
    -        // this is still a bit recursively painful, but it's more constrained
    -        // than previous implementations, because we never test something that
    -        // can't possibly be a valid matching condition.
    -        const bs = bodySegments[bodyIndex];
    -        if (!bs) {
    -            // just make sure that there's no bad dots
    -            for (let i = fileIndex; i < file.length; i++) {
    -                sawTail = true;
    -                const f = file[i];
    -                if (f === '.' ||
    -                    f === '..' ||
    -                    (!this.options.dot && f.startsWith('.'))) {
    -                    return false;
    -                }
    -            }
    -            return sawTail;
    -        }
    -        // have a non-globstar body section to test
    -        const [body, after] = bs;
    -        while (fileIndex <= after) {
    -            const m = this.#matchOne(file.slice(0, fileIndex + body.length), body, partial, fileIndex, 0);
    -            // if limit exceeded, no match. intentional false negative,
    -            // acceptable break in correctness for security.
    -            if (m && globStarDepth < this.maxGlobstarRecursion) {
    -                // match! see if the rest match. if so, we're done!
    -                const sub = this.#matchGlobStarBodySections(file, bodySegments, fileIndex + body.length, bodyIndex + 1, partial, globStarDepth + 1, sawTail);
    -                if (sub !== false) {
    -                    return sub;
    -                }
    -            }
    -            const f = file[fileIndex];
    -            if (f === '.' ||
    -                f === '..' ||
    -                (!this.options.dot && f.startsWith('.'))) {
    -                return false;
    -            }
    -            fileIndex++;
    -        }
    -        // walked off. no point continuing
    -        return partial || null;
    -    }
    -    #matchOne(file, pattern, partial, fileIndex, patternIndex) {
    -        let fi;
    -        let pi;
    -        let pl;
    -        let fl;
    -        for (fi = fileIndex,
    -            pi = patternIndex,
    -            fl = file.length,
    -            pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
    -            this.debug('matchOne loop');
    -            let p = pattern[pi];
    -            let f = file[fi];
    -            this.debug(pattern, p, f);
    -            // should be impossible.
    -            // some invalid regexp stuff in the set.
    -            /* c8 ignore start */
    -            if (p === false || p === GLOBSTAR) {
    -                return false;
    -            }
    -            /* c8 ignore stop */
    -            // something other than **
    -            // non-magic patterns just have to match exactly
    -            // patterns with magic have been turned into regexps.
    -            let hit;
    -            if (typeof p === 'string') {
    -                hit = f === p;
    -                this.debug('string match', p, f, hit);
    -            }
    -            else {
    -                hit = p.test(f);
    -                this.debug('pattern match', p, f, hit);
    -            }
    -            if (!hit)
    -                return false;
    -        }
    -        // Note: ending in / means that we'll get a final ""
    -        // at the end of the pattern.  This can only match a
    -        // corresponding "" at the end of the file.
    -        // If the file ends in /, then it can only match a
    -        // a pattern that ends in /, unless the pattern just
    -        // doesn't have any more for it. But, a/b/ should *not*
    -        // match "a/b/*", even though "" matches against the
    -        // [^/]*? pattern, except in partial mode, where it might
    -        // simply not be reached yet.
    -        // However, a/b/ should still satisfy a/*
    -        // now either we fell off the end of the pattern, or we're done.
    -        if (fi === fl && pi === pl) {
    -            // ran out of pattern and filename at the same time.
    -            // an exact hit!
    -            return true;
    -        }
    -        else if (fi === fl) {
    -            // ran out of file, but still had pattern left.
    -            // this is ok if we're doing the match as part of
    -            // a glob fs traversal.
    -            return partial;
    -        }
    -        else if (pi === pl) {
    -            // ran out of pattern, still have file left.
    -            // this is only acceptable if we're on the very last
    -            // empty segment of a file with a trailing slash.
    -            // a/* should match a/b/
    -            return fi === fl - 1 && file[fi] === '';
    -            /* c8 ignore start */
    -        }
    -        else {
    -            // should be unreachable.
    -            throw new Error('wtf?');
    -        }
    -        /* c8 ignore stop */
    -    }
    -    braceExpand() {
    -        return braceExpand(this.pattern, this.options);
    -    }
    -    parse(pattern) {
    -        assertValidPattern(pattern);
    -        const options = this.options;
    -        // shortcuts
    -        if (pattern === '**')
    -            return GLOBSTAR;
    -        if (pattern === '')
    -            return '';
    -        // far and away, the most common glob pattern parts are
    -        // *, *.*, and *.  Add a fast check method for those.
    -        let m;
    -        let fastTest = null;
    -        if ((m = pattern.match(starRE))) {
    -            fastTest = options.dot ? starTestDot : starTest;
    -        }
    -        else if ((m = pattern.match(starDotExtRE))) {
    -            fastTest = (options.nocase ?
    -                options.dot ?
    -                    starDotExtTestNocaseDot
    -                    : starDotExtTestNocase
    -                : options.dot ? starDotExtTestDot
    -                    : starDotExtTest)(m[1]);
    -        }
    -        else if ((m = pattern.match(qmarksRE))) {
    -            fastTest = (options.nocase ?
    -                options.dot ?
    -                    qmarksTestNocaseDot
    -                    : qmarksTestNocase
    -                : options.dot ? qmarksTestDot
    -                    : qmarksTest)(m);
    -        }
    -        else if ((m = pattern.match(starDotStarRE))) {
    -            fastTest = options.dot ? starDotStarTestDot : starDotStarTest;
    -        }
    -        else if ((m = pattern.match(dotStarRE))) {
    -            fastTest = dotStarTest;
    -        }
    -        const re = AST.fromGlob(pattern, this.options).toMMPattern();
    -        if (fastTest && typeof re === 'object') {
    -            // Avoids overriding in frozen environments
    -            Reflect.defineProperty(re, 'test', { value: fastTest });
    -        }
    -        return re;
    -    }
    -    makeRe() {
    -        if (this.regexp || this.regexp === false)
    -            return this.regexp;
    -        // at this point, this.set is a 2d array of partial
    -        // pattern strings, or "**".
    -        //
    -        // It's better to use .match().  This function shouldn't
    -        // be used, really, but it's pretty convenient sometimes,
    -        // when you just want to work with a regex.
    -        const set = this.set;
    -        if (!set.length) {
    -            this.regexp = false;
    -            return this.regexp;
    -        }
    -        const options = this.options;
    -        const twoStar = options.noglobstar ? star
    -            : options.dot ? twoStarDot
    -                : twoStarNoDot;
    -        const flags = new Set(options.nocase ? ['i'] : []);
    -        // regexpify non-globstar patterns
    -        // if ** is only item, then we just do one twoStar
    -        // if ** is first, and there are more, prepend (\/|twoStar\/)? to next
    -        // if ** is last, append (\/twoStar|) to previous
    -        // if ** is in the middle, append (\/|\/twoStar\/) to previous
    -        // then filter out GLOBSTAR symbols
    -        let re = set
    -            .map(pattern => {
    -            const pp = pattern.map(p => {
    -                if (p instanceof RegExp) {
    -                    for (const f of p.flags.split(''))
    -                        flags.add(f);
    -                }
    -                return (typeof p === 'string' ? regExpEscape(p)
    -                    : p === GLOBSTAR ? GLOBSTAR
    -                        : p._src);
    -            });
    -            pp.forEach((p, i) => {
    -                const next = pp[i + 1];
    -                const prev = pp[i - 1];
    -                if (p !== GLOBSTAR || prev === GLOBSTAR) {
    -                    return;
    -                }
    -                if (prev === undefined) {
    -                    if (next !== undefined && next !== GLOBSTAR) {
    -                        pp[i + 1] = '(?:\\/|' + twoStar + '\\/)?' + next;
    -                    }
    -                    else {
    -                        pp[i] = twoStar;
    -                    }
    -                }
    -                else if (next === undefined) {
    -                    pp[i - 1] = prev + '(?:\\/|\\/' + twoStar + ')?';
    -                }
    -                else if (next !== GLOBSTAR) {
    -                    pp[i - 1] = prev + '(?:\\/|\\/' + twoStar + '\\/)' + next;
    -                    pp[i + 1] = GLOBSTAR;
    -                }
    -            });
    -            const filtered = pp.filter(p => p !== GLOBSTAR);
    -            // For partial matches, we need to make the pattern match
    -            // any prefix of the full path. We do this by generating
    -            // alternative patterns that match progressively longer prefixes.
    -            if (this.partial && filtered.length >= 1) {
    -                const prefixes = [];
    -                for (let i = 1; i <= filtered.length; i++) {
    -                    prefixes.push(filtered.slice(0, i).join('/'));
    -                }
    -                return '(?:' + prefixes.join('|') + ')';
    -            }
    -            return filtered.join('/');
    -        })
    -            .join('|');
    -        // need to wrap in parens if we had more than one thing with |,
    -        // otherwise only the first will be anchored to ^ and the last to $
    -        const [open, close] = set.length > 1 ? ['(?:', ')'] : ['', ''];
    -        // must match entire pattern
    -        // ending in a * or ** will make it less strict.
    -        re = '^' + open + re + close + '$';
    -        // In partial mode, '/' should always match as it's a valid prefix for any pattern
    -        if (this.partial) {
    -            re = '^(?:\\/|' + open + re.slice(1, -1) + close + ')$';
    -        }
    -        // can match anything, as long as it's not this.
    -        if (this.negate)
    -            re = '^(?!' + re + ').+$';
    -        try {
    -            this.regexp = new RegExp(re, [...flags].join(''));
    -            /* c8 ignore start */
    -        }
    -        catch {
    -            // should be impossible
    -            this.regexp = false;
    -        }
    -        /* c8 ignore stop */
    -        return this.regexp;
    -    }
    -    slashSplit(p) {
    -        // if p starts with // on windows, we preserve that
    -        // so that UNC paths aren't broken.  Otherwise, any number of
    -        // / characters are coalesced into one, unless
    -        // preserveMultipleSlashes is set to true.
    -        if (this.preserveMultipleSlashes) {
    -            return p.split('/');
    -        }
    -        else if (this.isWindows && /^\/\/[^/]+/.test(p)) {
    -            // add an extra '' for the one we lose
    -            return ['', ...p.split(/\/+/)];
    -        }
    -        else {
    -            return p.split(/\/+/);
    -        }
    -    }
    -    match(f, partial = this.partial) {
    -        this.debug('match', f, this.pattern);
    -        // short-circuit in the case of busted things.
    -        // comments, etc.
    -        if (this.comment) {
    -            return false;
    -        }
    -        if (this.empty) {
    -            return f === '';
    -        }
    -        if (f === '/' && partial) {
    -            return true;
    -        }
    -        const options = this.options;
    -        // windows: need to use /, not \
    -        if (this.isWindows) {
    -            f = f.split('\\').join('/');
    -        }
    -        // treat the test path as a set of pathparts.
    -        const ff = this.slashSplit(f);
    -        this.debug(this.pattern, 'split', ff);
    -        // just ONE of the pattern sets in this.set needs to match
    -        // in order for it to be valid.  If negating, then just one
    -        // match means that we have failed.
    -        // Either way, return on the first hit.
    -        const set = this.set;
    -        this.debug(this.pattern, 'set', set);
    -        // Find the basename of the path by looking for the last non-empty segment
    -        let filename = ff[ff.length - 1];
    -        if (!filename) {
    -            for (let i = ff.length - 2; !filename && i >= 0; i--) {
    -                filename = ff[i];
    -            }
    -        }
    -        for (const pattern of set) {
    -            let file = ff;
    -            if (options.matchBase && pattern.length === 1) {
    -                file = [filename];
    -            }
    -            const hit = this.matchOne(file, pattern, partial);
    -            if (hit) {
    -                if (options.flipNegate) {
    -                    return true;
    -                }
    -                return !this.negate;
    -            }
    -        }
    -        // didn't get any hits.  this is success if it's a negative
    -        // pattern, failure otherwise.
    -        if (options.flipNegate) {
    -            return false;
    -        }
    -        return this.negate;
    -    }
    -    static defaults(def) {
    -        return minimatch.defaults(def).Minimatch;
    -    }
    -}
    -/* c8 ignore start */
    -export { AST } from './ast.js';
    -export { escape } from './escape.js';
    -export { unescape } from './unescape.js';
    -/* c8 ignore stop */
    -minimatch.AST = AST;
    -minimatch.Minimatch = Minimatch;
    -minimatch.escape = escape;
    -minimatch.unescape = unescape;
    -//# sourceMappingURL=index.js.map
    \ No newline at end of file
    diff --git a/.output/server/node_modules/minimatch/dist/esm/package.json b/.output/server/node_modules/minimatch/dist/esm/package.json
    deleted file mode 100644
    index 3dbc1ca..0000000
    --- a/.output/server/node_modules/minimatch/dist/esm/package.json
    +++ /dev/null
    @@ -1,3 +0,0 @@
    -{
    -  "type": "module"
    -}
    diff --git a/.output/server/node_modules/minimatch/dist/esm/unescape.js b/.output/server/node_modules/minimatch/dist/esm/unescape.js
    deleted file mode 100644
    index 19ce86e..0000000
    --- a/.output/server/node_modules/minimatch/dist/esm/unescape.js
    +++ /dev/null
    @@ -1,34 +0,0 @@
    -/**
    - * Un-escape a string that has been escaped with {@link escape}.
    - *
    - * If the {@link MinimatchOptions.windowsPathsNoEscape} option is used, then
    - * square-bracket escapes are removed, but not backslash escapes.
    - *
    - * For example, it will turn the string `'[*]'` into `*`, but it will not
    - * turn `'\\*'` into `'*'`, because `\` is a path separator in
    - * `windowsPathsNoEscape` mode.
    - *
    - * When `windowsPathsNoEscape` is not set, then both square-bracket escapes and
    - * backslash escapes are removed.
    - *
    - * Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped
    - * or unescaped.
    - *
    - * When `magicalBraces` is not set, escapes of braces (`{` and `}`) will not be
    - * unescaped.
    - */
    -export const unescape = (s, { windowsPathsNoEscape = false, magicalBraces = true, } = {}) => {
    -    if (magicalBraces) {
    -        return windowsPathsNoEscape ?
    -            s.replace(/\[([^/\\])\]/g, '$1')
    -            : s
    -                .replace(/((?!\\).|^)\[([^/\\])\]/g, '$1$2')
    -                .replace(/\\([^/])/g, '$1');
    -    }
    -    return windowsPathsNoEscape ?
    -        s.replace(/\[([^/\\{}])\]/g, '$1')
    -        : s
    -            .replace(/((?!\\).|^)\[([^/\\{}])\]/g, '$1$2')
    -            .replace(/\\([^/{}])/g, '$1');
    -};
    -//# sourceMappingURL=unescape.js.map
    \ No newline at end of file
    diff --git a/.output/server/node_modules/minimatch/package.json b/.output/server/node_modules/minimatch/package.json
    deleted file mode 100644
    index ce6e6f5..0000000
    --- a/.output/server/node_modules/minimatch/package.json
    +++ /dev/null
    @@ -1,73 +0,0 @@
    -{
    -  "author": "Isaac Z. Schlueter  (http://blog.izs.me)",
    -  "name": "minimatch",
    -  "description": "a glob matcher in javascript",
    -  "version": "10.2.5",
    -  "repository": {
    -    "type": "git",
    -    "url": "git@github.com:isaacs/minimatch"
    -  },
    -  "main": "./dist/commonjs/index.js",
    -  "types": "./dist/commonjs/index.d.ts",
    -  "exports": {
    -    "./package.json": "./package.json",
    -    ".": {
    -      "import": {
    -        "types": "./dist/esm/index.d.ts",
    -        "default": "./dist/esm/index.js"
    -      },
    -      "require": {
    -        "types": "./dist/commonjs/index.d.ts",
    -        "default": "./dist/commonjs/index.js"
    -      }
    -    }
    -  },
    -  "files": [
    -    "dist"
    -  ],
    -  "scripts": {
    -    "preversion": "npm test",
    -    "postversion": "npm publish",
    -    "prepublishOnly": "git push origin --follow-tags",
    -    "prepare": "tshy",
    -    "pretest": "npm run prepare",
    -    "presnap": "npm run prepare",
    -    "test": "tap",
    -    "snap": "tap",
    -    "format": "prettier --write .",
    -    "benchmark": "node benchmark/index.js",
    -    "typedoc": "typedoc --tsconfig .tshy/esm.json ./src/*.ts",
    -    "lint": "oxlint --fix src test",
    -    "postsnap": "npm run lint",
    -    "postlint": "npm run format"
    -  },
    -  "engines": {
    -    "node": "18 || 20 || >=22"
    -  },
    -  "devDependencies": {
    -    "@types/node": "^25.5.0",
    -    "mkdirp": "^3.0.1",
    -    "oxlint": "^1.57.0",
    -    "oxlint-tsgolint": "^0.18.1",
    -    "prettier": "^3.8.1",
    -    "tap": "^21.6.2",
    -    "tshy": "^4.0.0",
    -    "typedoc": "^0.28.18"
    -  },
    -  "funding": {
    -    "url": "https://github.com/sponsors/isaacs"
    -  },
    -  "license": "BlueOak-1.0.0",
    -  "tshy": {
    -    "exports": {
    -      "./package.json": "./package.json",
    -      ".": "./src/index.ts"
    -    },
    -    "selfLink": false
    -  },
    -  "type": "module",
    -  "module": "./dist/esm/index.js",
    -  "dependencies": {
    -    "brace-expansion": "^5.0.5"
    -  }
    -}
    \ No newline at end of file
    diff --git a/.output/server/node_modules/quickjs-emscripten-core/dist/chunk-TAV5CUKK.mjs b/.output/server/node_modules/quickjs-emscripten-core/dist/chunk-TAV5CUKK.mjs
    deleted file mode 100644
    index 2745843..0000000
    --- a/.output/server/node_modules/quickjs-emscripten-core/dist/chunk-TAV5CUKK.mjs
    +++ /dev/null
    @@ -1,2 +0,0 @@
    -import{Lifetime,QuickJSContext,QuickJSNotImplemented,QuickJSRuntime,QuickJSWASMModule,Scope,applyBaseRuntimeOptions,applyModuleEvalRuntimeOptions,evalOptionsToFlags,intrinsicsToFlags}from"./chunk-V2S4ZYJR.mjs";var QuickJSAsyncContext=class extends QuickJSContext{async evalCodeAsync(code,filename="eval.js",options){let detectModule=options===void 0?1:0,flags=evalOptionsToFlags(options),resultPtr=0;try{resultPtr=await this.memory.newHeapCharPointer(code).consume(charHandle=>this.ffi.QTS_Eval_MaybeAsync(this.ctx.value,charHandle.value.ptr,charHandle.value.strlen,filename,detectModule,flags))}catch(error){throw this.runtime.debugLog("QTS_Eval_MaybeAsync threw",error),error}let errorPtr=this.ffi.QTS_ResolveException(this.ctx.value,resultPtr);return errorPtr?(this.ffi.QTS_FreeValuePointer(this.ctx.value,resultPtr),this.fail(this.memory.heapValueHandle(errorPtr))):this.success(this.memory.heapValueHandle(resultPtr))}newAsyncifiedFunction(name,fn){return this.newFunction(name,fn)}};var QuickJSAsyncRuntime=class extends QuickJSRuntime{constructor(args){super(args)}newContext(options={}){let intrinsics=intrinsicsToFlags(options.intrinsics),ctx=new Lifetime(this.ffi.QTS_NewContext(this.rt.value,intrinsics),void 0,ctx_ptr=>{this.contextMap.delete(ctx_ptr),this.callbacks.deleteContext(ctx_ptr),this.ffi.QTS_FreeContext(ctx_ptr)}),context=new QuickJSAsyncContext({module:this.module,ctx,ffi:this.ffi,rt:this.rt,ownedLifetimes:[],runtime:this,callbacks:this.callbacks});return this.contextMap.set(ctx.value,context),context}setModuleLoader(moduleLoader,moduleNormalizer){super.setModuleLoader(moduleLoader,moduleNormalizer)}setMaxStackSize(stackSize){return super.setMaxStackSize(stackSize)}};var QuickJSAsyncWASMModule=class extends QuickJSWASMModule{constructor(module,ffi){super(module,ffi);this.ffi=ffi,this.module=module}newRuntime(options={}){let rt=new Lifetime(this.ffi.QTS_NewRuntime(),void 0,rt_ptr=>{this.callbacks.deleteRuntime(rt_ptr),this.ffi.QTS_FreeRuntime(rt_ptr)}),runtime=new QuickJSAsyncRuntime({module:this.module,ffi:this.ffi,rt,callbacks:this.callbacks});return applyBaseRuntimeOptions(runtime,options),options.moduleLoader&&runtime.setModuleLoader(options.moduleLoader),runtime}newContext(options={}){let runtime=this.newRuntime(),lifetimes=options.ownedLifetimes?options.ownedLifetimes.concat([runtime]):[runtime],context=runtime.newContext({...options,ownedLifetimes:lifetimes});return runtime.context=context,context}evalCode(){throw new QuickJSNotImplemented("QuickJSWASMModuleAsyncify.evalCode: use evalCodeAsync instead")}evalCodeAsync(code,options){return Scope.withScopeAsync(async scope=>{let vm=scope.manage(this.newContext());applyModuleEvalRuntimeOptions(vm.runtime,options);let result=await vm.evalCodeAsync(code,"eval.js");if(options.memoryLimitBytes!==void 0&&vm.runtime.setMemoryLimit(-1),result.error)throw vm.dump(scope.manage(result.error));return vm.dump(scope.manage(result.value))})}};export{QuickJSAsyncContext,QuickJSAsyncRuntime,QuickJSAsyncWASMModule};
    -//# sourceMappingURL=chunk-TAV5CUKK.mjs.map
    \ No newline at end of file
    diff --git a/.output/server/node_modules/quickjs-emscripten-core/dist/chunk-V2S4ZYJR.mjs b/.output/server/node_modules/quickjs-emscripten-core/dist/chunk-V2S4ZYJR.mjs
    deleted file mode 100644
    index 785117b..0000000
    --- a/.output/server/node_modules/quickjs-emscripten-core/dist/chunk-V2S4ZYJR.mjs
    +++ /dev/null
    @@ -1,7 +0,0 @@
    -var __defProp=Object.defineProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})};var QTS_DEBUG=!1;function setDebugMode(enabled=!0){QTS_DEBUG=enabled}function debugLog(...args){QTS_DEBUG&&console.log("quickjs-emscripten:",...args)}var errors_exports={};__export(errors_exports,{QuickJSAsyncifyError:()=>QuickJSAsyncifyError,QuickJSAsyncifySuspended:()=>QuickJSAsyncifySuspended,QuickJSEmptyGetOwnPropertyNames:()=>QuickJSEmptyGetOwnPropertyNames,QuickJSEmscriptenModuleError:()=>QuickJSEmscriptenModuleError,QuickJSHostRefInvalid:()=>QuickJSHostRefInvalid,QuickJSHostRefRangeExceeded:()=>QuickJSHostRefRangeExceeded,QuickJSMemoryLeakDetected:()=>QuickJSMemoryLeakDetected,QuickJSNotImplemented:()=>QuickJSNotImplemented,QuickJSPromisePending:()=>QuickJSPromisePending,QuickJSUnknownIntrinsic:()=>QuickJSUnknownIntrinsic,QuickJSUnwrapError:()=>QuickJSUnwrapError,QuickJSUseAfterFree:()=>QuickJSUseAfterFree,QuickJSWrongOwner:()=>QuickJSWrongOwner});var QuickJSUnwrapError=class extends Error{constructor(cause,context){let message=typeof cause=="object"&&cause&&"message"in cause?String(cause.message):String(cause);super(message);this.cause=cause;this.context=context;this.name="QuickJSUnwrapError"}},QuickJSWrongOwner=class extends Error{constructor(){super(...arguments);this.name="QuickJSWrongOwner"}},QuickJSUseAfterFree=class extends Error{constructor(){super(...arguments);this.name="QuickJSUseAfterFree"}},QuickJSNotImplemented=class extends Error{constructor(){super(...arguments);this.name="QuickJSNotImplemented"}},QuickJSAsyncifyError=class extends Error{constructor(){super(...arguments);this.name="QuickJSAsyncifyError"}},QuickJSAsyncifySuspended=class extends Error{constructor(){super(...arguments);this.name="QuickJSAsyncifySuspended"}},QuickJSMemoryLeakDetected=class extends Error{constructor(){super(...arguments);this.name="QuickJSMemoryLeakDetected"}},QuickJSEmscriptenModuleError=class extends Error{constructor(){super(...arguments);this.name="QuickJSEmscriptenModuleError"}},QuickJSUnknownIntrinsic=class extends TypeError{constructor(){super(...arguments);this.name="QuickJSUnknownIntrinsic"}},QuickJSPromisePending=class extends Error{constructor(){super(...arguments);this.name="QuickJSPromisePending"}},QuickJSEmptyGetOwnPropertyNames=class extends Error{constructor(){super(...arguments);this.name="QuickJSEmptyGetOwnPropertyNames"}},QuickJSHostRefRangeExceeded=class extends Error{constructor(){super(...arguments);this.name="QuickJSHostRefRangeExceeded"}},QuickJSHostRefInvalid=class extends Error{constructor(){super(...arguments);this.name="QuickJSHostRefInvalid"}};function*awaitYield(value){return yield value}function awaitYieldOf(generator){return awaitYield(awaitEachYieldedPromise(generator))}var AwaitYield=awaitYield;AwaitYield.of=awaitYieldOf;function maybeAsyncFn(that,fn){return(...args)=>{let generator=fn.call(that,AwaitYield,...args);return awaitEachYieldedPromise(generator)}}function maybeAsync(that,startGenerator){let generator=startGenerator.call(that,AwaitYield);return awaitEachYieldedPromise(generator)}function awaitEachYieldedPromise(gen){function handleNextStep(step){return step.done?step.value:step.value instanceof Promise?step.value.then(value=>handleNextStep(gen.next(value)),error=>handleNextStep(gen.throw(error))):handleNextStep(gen.next(step.value))}return handleNextStep(gen.next())}var UsingDisposable=class{[Symbol.dispose](){return this.dispose()}},SymbolDispose=Symbol.dispose??Symbol.for("Symbol.dispose"),prototypeAsAny=UsingDisposable.prototype;prototypeAsAny[SymbolDispose]||(prototypeAsAny[SymbolDispose]=function(){return this.dispose()});var Lifetime=class _Lifetime extends UsingDisposable{constructor(_value,copier,disposer,_owner){super();this._value=_value;this.copier=copier;this.disposer=disposer;this._owner=_owner;this._alive=!0;this._constructorStack=QTS_DEBUG?new Error("Lifetime constructed").stack:void 0}get alive(){return this._alive}get value(){return this.assertAlive(),this._value}get owner(){return this._owner}get dupable(){return!!this.copier}dup(){if(this.assertAlive(),!this.copier)throw new Error("Non-dupable lifetime");return new _Lifetime(this.copier(this._value),this.copier,this.disposer,this._owner)}consume(map){this.assertAlive();let result=map(this);return this.dispose(),result}map(map){return this.assertAlive(),map(this)}tap(fn){return fn(this),this}dispose(){this.assertAlive(),this.disposer&&this.disposer(this._value),this._alive=!1}assertAlive(){if(!this.alive)throw this._constructorStack?new QuickJSUseAfterFree(`Lifetime not alive
    -${this._constructorStack}
    -Lifetime used`):new QuickJSUseAfterFree("Lifetime not alive")}},StaticLifetime=class extends Lifetime{constructor(value,owner){super(value,void 0,void 0,owner)}get dupable(){return!0}dup(){return this}dispose(){}},WeakLifetime=class extends Lifetime{constructor(value,copier,disposer,owner){super(value,copier,disposer,owner)}dispose(){this._alive=!1}};function scopeFinally(scope,blockError){let disposeError;try{scope.dispose()}catch(error){disposeError=error}if(blockError&&disposeError)throw Object.assign(blockError,{message:`${blockError.message}
    - Then, failed to dispose scope: ${disposeError.message}`,disposeError}),blockError;if(blockError||disposeError)throw blockError||disposeError}var Scope=class _Scope extends UsingDisposable{constructor(){super(...arguments);this._disposables=new Lifetime(new Set);this.manage=lifetime=>(this._disposables.value.add(lifetime),lifetime)}static withScope(block){let scope=new _Scope,blockError;try{return block(scope)}catch(error){throw blockError=error,error}finally{scopeFinally(scope,blockError)}}static withScopeMaybeAsync(_this,block){return maybeAsync(void 0,function*(awaited){let scope=new _Scope,blockError;try{return yield*awaited.of(block.call(_this,awaited,scope))}catch(error){throw blockError=error,error}finally{scopeFinally(scope,blockError)}})}static async withScopeAsync(block){let scope=new _Scope,blockError;try{return await block(scope)}catch(error){throw blockError=error,error}finally{scopeFinally(scope,blockError)}}get alive(){return this._disposables.alive}dispose(){let lifetimes=Array.from(this._disposables.value.values()).reverse();for(let lifetime of lifetimes)lifetime.alive&&lifetime.dispose();this._disposables.dispose()}};function createDisposableArray(items){let array=items?Array.from(items):[];function disposeAlive(){return array.forEach(disposable=>disposable.alive?disposable.dispose():void 0)}function someIsAlive(){return array.some(disposable=>disposable.alive)}return Object.defineProperty(array,SymbolDispose,{configurable:!0,enumerable:!1,value:disposeAlive}),Object.defineProperty(array,"dispose",{configurable:!0,enumerable:!1,value:disposeAlive}),Object.defineProperty(array,"alive",{configurable:!0,enumerable:!1,get:someIsAlive}),array}function isDisposable(value){return!!(value&&(typeof value=="object"||typeof value=="function")&&"alive"in value&&typeof value.alive=="boolean"&&"dispose"in value&&typeof value.dispose=="function")}var AbstractDisposableResult=class _AbstractDisposableResult extends UsingDisposable{static success(value){return new DisposableSuccess(value)}static fail(error,onUnwrap){return new DisposableFail(error,onUnwrap)}static is(result){return result instanceof _AbstractDisposableResult}},DisposableSuccess=class extends AbstractDisposableResult{constructor(value){super();this.value=value}get alive(){return isDisposable(this.value)?this.value.alive:!0}dispose(){isDisposable(this.value)&&this.value.dispose()}unwrap(){return this.value}unwrapOr(_fallback){return this.value}},DisposableFail=class extends AbstractDisposableResult{constructor(error,onUnwrap){super();this.error=error;this.onUnwrap=onUnwrap}get alive(){return isDisposable(this.error)?this.error.alive:!0}dispose(){isDisposable(this.error)&&this.error.dispose()}unwrap(){throw this.onUnwrap(this),this.error}unwrapOr(fallback){return fallback}},DisposableResult=AbstractDisposableResult;import{IsEqualOp,JSPromiseStateEnum}from"@jitl/quickjs-ffi-types";var QuickJSDeferredPromise=class extends UsingDisposable{constructor(args){super();this.resolve=value=>{this.resolveHandle.alive&&(this.context.unwrapResult(this.context.callFunction(this.resolveHandle,this.context.undefined,value||this.context.undefined)).dispose(),this.disposeResolvers(),this.onSettled())};this.reject=value=>{this.rejectHandle.alive&&(this.context.unwrapResult(this.context.callFunction(this.rejectHandle,this.context.undefined,value||this.context.undefined)).dispose(),this.disposeResolvers(),this.onSettled())};this.dispose=()=>{this.handle.alive&&this.handle.dispose(),this.disposeResolvers()};this.context=args.context,this.owner=args.context.runtime,this.handle=args.promiseHandle,this.settled=new Promise(resolve=>{this.onSettled=resolve}),this.resolveHandle=args.resolveHandle,this.rejectHandle=args.rejectHandle}get alive(){return this.handle.alive||this.resolveHandle.alive||this.rejectHandle.alive}disposeResolvers(){this.resolveHandle.alive&&this.resolveHandle.dispose(),this.rejectHandle.alive&&this.rejectHandle.dispose()}};var ModuleMemory=class{constructor(module){this.module=module}toPointerArray(handleArray){let typedArray=new Int32Array(handleArray.map(handle=>handle.value)),numBytes=typedArray.length*typedArray.BYTES_PER_ELEMENT,ptr=this.module._malloc(numBytes);return new Uint8Array(this.module.HEAPU8.buffer,ptr,numBytes).set(new Uint8Array(typedArray.buffer)),new Lifetime(ptr,void 0,ptr2=>this.module._free(ptr2))}newTypedArray(kind,length){let zeros=new kind(new Array(length).fill(0)),numBytes=zeros.length*zeros.BYTES_PER_ELEMENT,ptr=this.module._malloc(numBytes),typedArray=new kind(this.module.HEAPU8.buffer,ptr,length);return typedArray.set(zeros),new Lifetime({typedArray,ptr},void 0,value=>this.module._free(value.ptr))}newMutablePointerArray(length){return this.newTypedArray(Int32Array,length)}newHeapCharPointer(string){let strlen=this.module.lengthBytesUTF8(string),dataBytes=strlen+1,ptr=this.module._malloc(dataBytes);return this.module.stringToUTF8(string,ptr,dataBytes),new Lifetime({ptr,strlen},void 0,value=>this.module._free(value.ptr))}newHeapBufferPointer(buffer){let numBytes=buffer.byteLength,ptr=this.module._malloc(numBytes);return this.module.HEAPU8.set(buffer,ptr),new Lifetime({pointer:ptr,numBytes},void 0,value=>this.module._free(value.pointer))}consumeHeapCharPointer(ptr){let str=this.module.UTF8ToString(ptr);return this.module._free(ptr),str}};import{EvalFlags,GetOwnPropertyNamesFlags,IntrinsicsFlags}from"@jitl/quickjs-ffi-types";var UnstableSymbol=Symbol("Unstable"),DefaultIntrinsics=Object.freeze({BaseObjects:!0,Date:!0,Eval:!0,StringNormalize:!0,RegExp:!0,JSON:!0,Proxy:!0,MapSet:!0,TypedArrays:!0,Promise:!0});function intrinsicsToFlags(intrinsics){if(!intrinsics)return 0;let result=0;for(let[maybeIntrinsicName,enabled]of Object.entries(intrinsics)){if(!(maybeIntrinsicName in IntrinsicsFlags))throw new QuickJSUnknownIntrinsic(maybeIntrinsicName);enabled&&(result|=IntrinsicsFlags[maybeIntrinsicName])}return result}function evalOptionsToFlags(evalOptions){if(typeof evalOptions=="number")return evalOptions;if(evalOptions===void 0)return 0;let{type,strict,strip,compileOnly,backtraceBarrier}=evalOptions,flags=0;return type==="global"&&(flags|=EvalFlags.JS_EVAL_TYPE_GLOBAL),type==="module"&&(flags|=EvalFlags.JS_EVAL_TYPE_MODULE),strict&&(flags|=EvalFlags.JS_EVAL_FLAG_STRICT),strip&&(flags|=EvalFlags.JS_EVAL_FLAG_STRIP),compileOnly&&(flags|=EvalFlags.JS_EVAL_FLAG_COMPILE_ONLY),backtraceBarrier&&(flags|=EvalFlags.JS_EVAL_FLAG_BACKTRACE_BARRIER),flags}function getOwnPropertyNamesOptionsToFlags(options){if(typeof options=="number")return options;if(options===void 0)return 0;let{strings:includeStrings,symbols:includeSymbols,quickjsPrivate:includePrivate,onlyEnumerable,numbers:includeNumbers,numbersAsStrings}=options,flags=0;return includeStrings&&(flags|=GetOwnPropertyNamesFlags.JS_GPN_STRING_MASK),includeSymbols&&(flags|=GetOwnPropertyNamesFlags.JS_GPN_SYMBOL_MASK),includePrivate&&(flags|=GetOwnPropertyNamesFlags.JS_GPN_PRIVATE_MASK),onlyEnumerable&&(flags|=GetOwnPropertyNamesFlags.JS_GPN_ENUM_ONLY),includeNumbers&&(flags|=GetOwnPropertyNamesFlags.QTS_GPN_NUMBER_MASK),numbersAsStrings&&(flags|=GetOwnPropertyNamesFlags.QTS_STANDARD_COMPLIANT_NUMBER),flags}function concat(...values){let result=[];for(let value of values)value!==void 0&&(result=result.concat(value));return result}var QuickJSIterator=class extends UsingDisposable{constructor(handle,context){super();this.handle=handle;this.context=context;this._isDone=!1;this.owner=context.runtime}[Symbol.iterator](){return this}next(value){if(!this.alive||this._isDone)return{done:!0,value:void 0};let nextMethod=this._next??(this._next=this.context.getProp(this.handle,"next"));return this.callIteratorMethod(nextMethod,value)}return(value){if(!this.alive)return{done:!0,value:void 0};let returnMethod=this.context.getProp(this.handle,"return");if(returnMethod===this.context.undefined&&value===void 0)return this.dispose(),{done:!0,value:void 0};let result=this.callIteratorMethod(returnMethod,value);return returnMethod.dispose(),this.dispose(),result}throw(e){if(!this.alive)return{done:!0,value:void 0};let errorHandle=e instanceof Lifetime?e:this.context.newError(e),throwMethod=this.context.getProp(this.handle,"throw"),result=this.callIteratorMethod(throwMethod,e);return errorHandle.alive&&errorHandle.dispose(),throwMethod.dispose(),this.dispose(),result}get alive(){return this.handle.alive}dispose(){this._isDone=!0,this.handle.dispose(),this._next?.dispose()}callIteratorMethod(method,input){let callResult=input?this.context.callFunction(method,this.handle,input):this.context.callFunction(method,this.handle);if(callResult.error)return this.dispose(),{value:callResult};let done=this.context.getProp(callResult.value,"done").consume(v=>this.context.dump(v)),value=this.context.getProp(callResult.value,"value");return callResult.value.dispose(),done&&this.dispose(),{value:DisposableResult.success(value),done}}};var INT32_MIN=-2147483648,INT32_MAX=2147483647,INVALID_HOST_REF_ID=0;function getGroupId(id){return id>>8}var HostRefMap=class{constructor(){this.nextId=INT32_MIN;this.freelist=[];this.groups=new Map}put(value){let id=this.allocateId(),groupId=getGroupId(id),group=this.groups.get(groupId);return group||(group=new Map,this.groups.set(groupId,group)),group.set(id,value),id}get(id){if(id===INVALID_HOST_REF_ID)throw new QuickJSHostRefInvalid("no host reference id defined");let groupId=getGroupId(id),group=this.groups.get(groupId);if(!group)throw new QuickJSHostRefInvalid(`host reference id ${id} is not defined`);let value=group.get(id);if(!value)throw new QuickJSHostRefInvalid(`host reference id ${id} is not defined`);return value}delete(id){if(id===INVALID_HOST_REF_ID)throw new QuickJSHostRefInvalid("no host reference id defined");let groupId=getGroupId(id),group=this.groups.get(groupId);if(!group)throw new QuickJSHostRefInvalid(`host reference id ${id} is not defined`);group.delete(id),group.size===0&&this.groups.delete(groupId),this.freelist.push(id)}allocateId(){if(this.freelist.length>0)return this.freelist.shift();if(this.nextId===INVALID_HOST_REF_ID&&this.nextId++,this.nextId>INT32_MAX)throw new QuickJSHostRefRangeExceeded(`HostRefMap: too many host refs created without disposing. Max simultaneous host refs: ${INT32_MAX-INT32_MIN}`);return this.nextId++}},HostRef=class extends UsingDisposable{constructor(runtime,handle,id){if(id===INVALID_HOST_REF_ID)throw new QuickJSHostRefInvalid("cannot create HostRef with undefined id");super();this.runtime=runtime;this.handle=handle;this.id=id}get alive(){return this.handle.alive}dispose(){this.handle.dispose()}get value(){return this.runtime.hostRefs.get(this.id)}};var ContextMemory=class extends ModuleMemory{constructor(args){super(args.module);this.scope=new Scope;this.copyJSValue=ptr=>this.ffi.QTS_DupValuePointer(this.ctx.value,ptr);this.freeJSValue=ptr=>{this.ffi.QTS_FreeValuePointer(this.ctx.value,ptr)};args.ownedLifetimes?.forEach(lifetime=>this.scope.manage(lifetime)),this.owner=args.owner,this.module=args.module,this.ffi=args.ffi,this.rt=args.rt,this.ctx=this.scope.manage(args.ctx)}get alive(){return this.scope.alive}dispose(){return this.scope.dispose()}[Symbol.dispose](){return this.dispose()}manage(lifetime){return this.scope.manage(lifetime)}consumeJSCharPointer(ptr){let str=this.module.UTF8ToString(ptr);return this.ffi.QTS_FreeCString(this.ctx.value,ptr),str}heapValueHandle(ptr,extraDispose){let dispose=extraDispose?val=>{extraDispose(),this.freeJSValue(val)}:this.freeJSValue;return new Lifetime(ptr,this.copyJSValue,dispose,this.owner)}staticHeapValueHandle(ptr){return this.manage(this.heapValueHandle(ptr)),new StaticLifetime(ptr,this.owner)}},QuickJSContext=class extends UsingDisposable{constructor(args){super();this._undefined=void 0;this._null=void 0;this._false=void 0;this._true=void 0;this._global=void 0;this._BigInt=void 0;this._Symbol=void 0;this._SymbolIterator=void 0;this._SymbolAsyncIterator=void 0;this.cToHostCallbacks={callFunction:(ctx,this_ptr,argc,argv,fn_id)=>{if(ctx!==this.ctx.value)throw new Error("QuickJSContext instance received C -> JS call with mismatched ctx");let fn=this.getFunction(fn_id);return Scope.withScopeMaybeAsync(this,function*(awaited,scope){let thisHandle=scope.manage(new WeakLifetime(this_ptr,this.memory.copyJSValue,this.memory.freeJSValue,this.runtime)),argHandles=new Array(argc);for(let i=0;ithis.ffi.QTS_Throw(this.ctx.value,errorHandle.value))}})}};this.runtime=args.runtime,this.module=args.module,this.ffi=args.ffi,this.rt=args.rt,this.ctx=args.ctx,this.memory=new ContextMemory({...args,owner:this.runtime}),args.callbacks.setContextCallbacks(this.ctx.value,this.cToHostCallbacks),this.dump=this.dump.bind(this),this.getString=this.getString.bind(this),this.getNumber=this.getNumber.bind(this),this.resolvePromise=this.resolvePromise.bind(this),this.uint32Out=this.memory.manage(this.memory.newTypedArray(Uint32Array,1))}get alive(){return this.memory.alive}dispose(){this.memory.dispose()}get undefined(){if(this._undefined)return this._undefined;let ptr=this.ffi.QTS_GetUndefined();return this._undefined=new StaticLifetime(ptr)}get null(){if(this._null)return this._null;let ptr=this.ffi.QTS_GetNull();return this._null=new StaticLifetime(ptr)}get true(){if(this._true)return this._true;let ptr=this.ffi.QTS_GetTrue();return this._true=new StaticLifetime(ptr)}get false(){if(this._false)return this._false;let ptr=this.ffi.QTS_GetFalse();return this._false=new StaticLifetime(ptr)}get global(){if(this._global)return this._global;let ptr=this.ffi.QTS_GetGlobalObject(this.ctx.value);return this._global=this.memory.staticHeapValueHandle(ptr),this._global}newNumber(num){return this.memory.heapValueHandle(this.ffi.QTS_NewFloat64(this.ctx.value,num))}newString(str){let ptr=this.memory.newHeapCharPointer(str).consume(charHandle=>this.ffi.QTS_NewString(this.ctx.value,charHandle.value.ptr));return this.memory.heapValueHandle(ptr)}newUniqueSymbol(description){let key=(typeof description=="symbol"?description.description:description)??"",ptr=this.memory.newHeapCharPointer(key).consume(charHandle=>this.ffi.QTS_NewSymbol(this.ctx.value,charHandle.value.ptr,0));return this.memory.heapValueHandle(ptr)}newSymbolFor(key){let description=(typeof key=="symbol"?key.description:key)??"",ptr=this.memory.newHeapCharPointer(description).consume(charHandle=>this.ffi.QTS_NewSymbol(this.ctx.value,charHandle.value.ptr,1));return this.memory.heapValueHandle(ptr)}getWellKnownSymbol(name){return this._Symbol??(this._Symbol=this.memory.manage(this.getProp(this.global,"Symbol"))),this.getProp(this._Symbol,name)}newBigInt(num){if(!this._BigInt){let bigIntHandle2=this.getProp(this.global,"BigInt");this.memory.manage(bigIntHandle2),this._BigInt=new StaticLifetime(bigIntHandle2.value,this.runtime)}let bigIntHandle=this._BigInt,asString=String(num);return this.newString(asString).consume(handle=>this.unwrapResult(this.callFunction(bigIntHandle,this.undefined,handle)))}newObject(prototype){prototype&&this.runtime.assertOwned(prototype);let ptr=prototype?this.ffi.QTS_NewObjectProto(this.ctx.value,prototype.value):this.ffi.QTS_NewObject(this.ctx.value);return this.memory.heapValueHandle(ptr)}newArray(){let ptr=this.ffi.QTS_NewArray(this.ctx.value);return this.memory.heapValueHandle(ptr)}newArrayBuffer(buffer){let array=new Uint8Array(buffer),handle=this.memory.newHeapBufferPointer(array),ptr=this.ffi.QTS_NewArrayBuffer(this.ctx.value,handle.value.pointer,array.length);return this.memory.heapValueHandle(ptr)}newPromise(value){let deferredPromise=Scope.withScope(scope=>{let mutablePointerArray=scope.manage(this.memory.newMutablePointerArray(2)),promisePtr=this.ffi.QTS_NewPromiseCapability(this.ctx.value,mutablePointerArray.value.ptr),promiseHandle=this.memory.heapValueHandle(promisePtr),[resolveHandle,rejectHandle]=Array.from(mutablePointerArray.value.typedArray).map(jsvaluePtr=>this.memory.heapValueHandle(jsvaluePtr));return new QuickJSDeferredPromise({context:this,promiseHandle,resolveHandle,rejectHandle})});return value&&typeof value=="function"&&(value=new Promise(value)),value&&Promise.resolve(value).then(deferredPromise.resolve,error=>error instanceof Lifetime?deferredPromise.reject(error):this.newError(error).consume(deferredPromise.reject)),deferredPromise}newFunction(nameOrFn,maybeFn){let fn=typeof nameOrFn=="function"?nameOrFn:maybeFn;if(!fn)throw new TypeError("Expected a function");return this.newFunctionWithOptions({name:typeof nameOrFn=="string"?nameOrFn:void 0,length:fn.length,isConstructor:!1,fn})}newConstructorFunction(nameOrFn,maybeFn){let fn=typeof nameOrFn=="function"?nameOrFn:maybeFn;if(!fn)throw new TypeError("Expected a function");return this.newFunctionWithOptions({name:typeof nameOrFn=="string"?nameOrFn:void 0,length:fn.length,isConstructor:!0,fn})}newFunctionWithOptions(args){let{name,length,isConstructor,fn}=args,refId=this.runtime.hostRefs.put(fn);try{return this.memory.heapValueHandle(this.ffi.QTS_NewFunction(this.ctx.value,name??"",length,isConstructor,refId))}catch(error){throw this.runtime.hostRefs.delete(refId),error}}newError(error){let errorHandle=this.memory.heapValueHandle(this.ffi.QTS_NewError(this.ctx.value));return error&&typeof error=="object"?(error.name!==void 0&&this.newString(error.name).consume(handle=>this.setProp(errorHandle,"name",handle)),error.message!==void 0&&this.newString(error.message).consume(handle=>this.setProp(errorHandle,"message",handle))):typeof error=="string"?this.newString(error).consume(handle=>this.setProp(errorHandle,"message",handle)):error!==void 0&&this.newString(String(error)).consume(handle=>this.setProp(errorHandle,"message",handle)),errorHandle}newHostRef(value){let id=this.runtime.hostRefs.put(value);try{let handle=this.memory.heapValueHandle(this.ffi.QTS_NewHostRef(this.ctx.value,id));return new HostRef(this.runtime,handle,id)}catch(error){throw this.runtime.hostRefs.delete(id),error}}toHostRef(handle){let id=this.ffi.QTS_GetHostRefId(handle.value);if(id!==0)return this.runtime.hostRefs.get(id),new HostRef(this.runtime,handle.dup(),id)}unwrapHostRef(handle){let id=this.ffi.QTS_GetHostRefId(handle.value);if(id===0)throw new QuickJSHostRefInvalid("handle is not a HostRef");return this.runtime.hostRefs.get(id)}typeof(handle){return this.runtime.assertOwned(handle),this.memory.consumeHeapCharPointer(this.ffi.QTS_Typeof(this.ctx.value,handle.value))}getNumber(handle){return this.runtime.assertOwned(handle),this.ffi.QTS_GetFloat64(this.ctx.value,handle.value)}getString(handle){return this.runtime.assertOwned(handle),this.memory.consumeJSCharPointer(this.ffi.QTS_GetString(this.ctx.value,handle.value))}getSymbol(handle){this.runtime.assertOwned(handle);let key=this.memory.consumeJSCharPointer(this.ffi.QTS_GetSymbolDescriptionOrKey(this.ctx.value,handle.value));return this.ffi.QTS_IsGlobalSymbol(this.ctx.value,handle.value)?Symbol.for(key):Symbol(key)}getBigInt(handle){this.runtime.assertOwned(handle);let asString=this.getString(handle);return BigInt(asString)}getArrayBuffer(handle){this.runtime.assertOwned(handle);let len=this.ffi.QTS_GetArrayBufferLength(this.ctx.value,handle.value),ptr=this.ffi.QTS_GetArrayBuffer(this.ctx.value,handle.value);if(!ptr)throw new Error("Couldn't allocate memory to get ArrayBuffer");return new Lifetime(this.module.HEAPU8.subarray(ptr,ptr+len),void 0,()=>this.module._free(ptr))}getPromiseState(handle){this.runtime.assertOwned(handle);let state=this.ffi.QTS_PromiseState(this.ctx.value,handle.value);if(state<0)return{type:"fulfilled",value:handle,notAPromise:!0};if(state===JSPromiseStateEnum.Pending)return{type:"pending",get error(){return new QuickJSPromisePending("Cannot unwrap a pending promise")}};let ptr=this.ffi.QTS_PromiseResult(this.ctx.value,handle.value),result=this.memory.heapValueHandle(ptr);if(state===JSPromiseStateEnum.Fulfilled)return{type:"fulfilled",value:result};if(state===JSPromiseStateEnum.Rejected)return{type:"rejected",error:result};throw result.dispose(),new Error(`Unknown JSPromiseStateEnum: ${state}`)}resolvePromise(promiseLikeHandle){this.runtime.assertOwned(promiseLikeHandle);let vmResolveResult=Scope.withScope(scope=>{let vmPromise=scope.manage(this.getProp(this.global,"Promise")),vmPromiseResolve=scope.manage(this.getProp(vmPromise,"resolve"));return this.callFunction(vmPromiseResolve,vmPromise,promiseLikeHandle)});return vmResolveResult.error?Promise.resolve(vmResolveResult):new Promise(resolve=>{Scope.withScope(scope=>{let resolveHandle=scope.manage(this.newFunction("resolve",value=>{resolve(this.success(value&&value.dup()))})),rejectHandle=scope.manage(this.newFunction("reject",error=>{resolve(this.fail(error&&error.dup()))})),promiseHandle=scope.manage(vmResolveResult.value),promiseThenHandle=scope.manage(this.getProp(promiseHandle,"then"));this.callFunction(promiseThenHandle,promiseHandle,resolveHandle,rejectHandle).unwrap().dispose()})})}isEqual(a,b,equalityType=IsEqualOp.IsStrictlyEqual){if(a===b)return!0;this.runtime.assertOwned(a),this.runtime.assertOwned(b);let result=this.ffi.QTS_IsEqual(this.ctx.value,a.value,b.value,equalityType);if(result===-1)throw new QuickJSNotImplemented("WASM variant does not expose equality");return!!result}eq(handle,other){return this.isEqual(handle,other,IsEqualOp.IsStrictlyEqual)}sameValue(handle,other){return this.isEqual(handle,other,IsEqualOp.IsSameValue)}sameValueZero(handle,other){return this.isEqual(handle,other,IsEqualOp.IsSameValueZero)}getProp(handle,key){this.runtime.assertOwned(handle);let ptr;return typeof key=="number"&&key>=0?ptr=this.ffi.QTS_GetPropNumber(this.ctx.value,handle.value,key):ptr=this.borrowPropertyKey(key).consume(quickJSKey=>this.ffi.QTS_GetProp(this.ctx.value,handle.value,quickJSKey.value)),this.memory.heapValueHandle(ptr)}getLength(handle){if(this.runtime.assertOwned(handle),!(this.ffi.QTS_GetLength(this.ctx.value,this.uint32Out.value.ptr,handle.value)<0))return this.uint32Out.value.typedArray[0]}getOwnPropertyNames(handle,options={strings:!0,numbersAsStrings:!0}){this.runtime.assertOwned(handle),handle.value;let flags=getOwnPropertyNamesOptionsToFlags(options);if(flags===0)throw new QuickJSEmptyGetOwnPropertyNames("No options set, will return an empty array");return Scope.withScope(scope=>{let outPtr=scope.manage(this.memory.newMutablePointerArray(1)),errorPtr=this.ffi.QTS_GetOwnPropertyNames(this.ctx.value,outPtr.value.ptr,this.uint32Out.value.ptr,handle.value,flags);if(errorPtr)return this.fail(this.memory.heapValueHandle(errorPtr));let len=this.uint32Out.value.typedArray[0],ptr=outPtr.value.typedArray[0],pointerArray=new Uint32Array(this.module.HEAP8.buffer,ptr,len),handles=Array.from(pointerArray).map(ptr2=>this.memory.heapValueHandle(ptr2));return this.ffi.QTS_FreeVoidPointer(this.ctx.value,ptr),this.success(createDisposableArray(handles))})}getIterator(iterableHandle){let SymbolIterator=this._SymbolIterator??(this._SymbolIterator=this.memory.manage(this.getWellKnownSymbol("iterator")));return Scope.withScope(scope=>{let methodHandle=scope.manage(this.getProp(iterableHandle,SymbolIterator)),iteratorCallResult=this.callFunction(methodHandle,iterableHandle);return iteratorCallResult.error?iteratorCallResult:this.success(new QuickJSIterator(iteratorCallResult.value,this))})}setProp(handle,key,value){this.runtime.assertOwned(handle),this.borrowPropertyKey(key).consume(quickJSKey=>this.ffi.QTS_SetProp(this.ctx.value,handle.value,quickJSKey.value,value.value))}defineProp(handle,key,descriptor){this.runtime.assertOwned(handle),Scope.withScope(scope=>{let quickJSKey=scope.manage(this.borrowPropertyKey(key)),value=descriptor.value||this.undefined,configurable=!!descriptor.configurable,enumerable=!!descriptor.enumerable,hasValue=!!descriptor.value,get=descriptor.get?scope.manage(this.newFunction(descriptor.get.name,descriptor.get)):this.undefined,set=descriptor.set?scope.manage(this.newFunction(descriptor.set.name,descriptor.set)):this.undefined;this.ffi.QTS_DefineProp(this.ctx.value,handle.value,quickJSKey.value,value.value,get.value,set.value,configurable,enumerable,hasValue)})}callFunction(func,thisVal,...restArgs){this.runtime.assertOwned(func);let args,firstArg=restArgs[0];firstArg===void 0||Array.isArray(firstArg)?args=firstArg??[]:args=restArgs;let resultPtr=this.memory.toPointerArray(args).consume(argsArrayPtr=>this.ffi.QTS_Call(this.ctx.value,func.value,thisVal.value,args.length,argsArrayPtr.value)),errorPtr=this.ffi.QTS_ResolveException(this.ctx.value,resultPtr);return errorPtr?(this.ffi.QTS_FreeValuePointer(this.ctx.value,resultPtr),this.fail(this.memory.heapValueHandle(errorPtr))):this.success(this.memory.heapValueHandle(resultPtr))}callMethod(thisHandle,key,args=[]){return this.getProp(thisHandle,key).consume(func=>this.callFunction(func,thisHandle,args))}evalCode(code,filename="eval.js",options){let detectModule=options===void 0?1:0,flags=evalOptionsToFlags(options),resultPtr=this.memory.newHeapCharPointer(code).consume(charHandle=>this.ffi.QTS_Eval(this.ctx.value,charHandle.value.ptr,charHandle.value.strlen,filename,detectModule,flags)),errorPtr=this.ffi.QTS_ResolveException(this.ctx.value,resultPtr);return errorPtr?(this.ffi.QTS_FreeValuePointer(this.ctx.value,resultPtr),this.fail(this.memory.heapValueHandle(errorPtr))):this.success(this.memory.heapValueHandle(resultPtr))}throw(error){return this.errorToHandle(error).consume(handle=>this.ffi.QTS_Throw(this.ctx.value,handle.value))}borrowPropertyKey(key){return typeof key=="number"?this.newNumber(key):typeof key=="string"?this.newString(key):new StaticLifetime(key.value,this.runtime)}getMemory(rt){if(rt===this.rt.value)return this.memory;throw new Error("Private API. Cannot get memory from a different runtime")}dump(handle){this.runtime.assertOwned(handle);let type=this.typeof(handle);if(type==="string")return this.getString(handle);if(type==="number")return this.getNumber(handle);if(type==="bigint")return this.getBigInt(handle);if(type==="undefined")return;if(type==="symbol")return this.getSymbol(handle);let asPromiseState=this.getPromiseState(handle);if(asPromiseState.type==="fulfilled"&&!asPromiseState.notAPromise)return handle.dispose(),{type:asPromiseState.type,value:asPromiseState.value.consume(this.dump)};if(asPromiseState.type==="pending")return handle.dispose(),{type:asPromiseState.type};if(asPromiseState.type==="rejected")return handle.dispose(),{type:asPromiseState.type,error:asPromiseState.error.consume(this.dump)};let str=this.memory.consumeJSCharPointer(this.ffi.QTS_Dump(this.ctx.value,handle.value));try{return JSON.parse(str)}catch{return str}}unwrapResult(result){if(result.error){let context="context"in result.error?result.error.context:this,cause=result.error.consume(error=>this.dump(error));if(cause&&typeof cause=="object"&&typeof cause.message=="string"){let{message,name,stack,...rest}=cause,exception=new QuickJSUnwrapError(cause,context);typeof name=="string"&&(exception.name=cause.name),exception.message=message;let hostStack=exception.stack;throw typeof stack=="string"&&(exception.stack=`${name}: ${message}
    -${cause.stack}Host: ${hostStack}`),Object.assign(exception,rest),exception}throw new QuickJSUnwrapError(cause)}return result.value}[Symbol.for("nodejs.util.inspect.custom")](){return this.alive?`${this.constructor.name} { ctx: ${this.ctx.value} rt: ${this.rt.value} }`:`${this.constructor.name} { disposed }`}getFunction(fn_id){let fn=this.runtime.hostRefs.get(fn_id);if(typeof fn!="function")throw new Error(`Host reference ${fn_id} is not a function`);return fn}errorToHandle(error){return error instanceof Lifetime?error:this.newError(error)}encodeBinaryJSON(handle){let ptr=this.ffi.QTS_bjson_encode(this.ctx.value,handle.value);return this.memory.heapValueHandle(ptr)}decodeBinaryJSON(handle){let ptr=this.ffi.QTS_bjson_decode(this.ctx.value,handle.value);return this.memory.heapValueHandle(ptr)}success(value){return DisposableResult.success(value)}fail(error){return DisposableResult.fail(error,error2=>this.unwrapResult(error2))}};var QuickJSRuntime=class extends UsingDisposable{constructor(args){super();this.scope=new Scope;this.contextMap=new Map;this.hostRefs=new HostRefMap;this._debugMode=!1;this.cToHostCallbacks={freeHostRef:(rt,host_ref_id)=>{if(rt!==this.rt.value)throw new Error("Runtime pointer mismatch");this.hostRefs.delete(host_ref_id)},shouldInterrupt:rt=>{if(rt!==this.rt.value)throw new Error("QuickJSContext instance received C -> JS interrupt with mismatched rt");let fn=this.interruptHandler;if(!fn)throw new Error("QuickJSContext had no interrupt handler");return fn(this)?1:0},loadModuleSource:maybeAsyncFn(this,function*(awaited,rt,ctx,moduleName){let moduleLoader=this.moduleLoader;if(!moduleLoader)throw new Error("Runtime has no module loader");if(rt!==this.rt.value)throw new Error("Runtime pointer mismatch");let context=this.contextMap.get(ctx)??this.newContext({contextPointer:ctx});try{let result=yield*awaited(moduleLoader(moduleName,context));if(typeof result=="object"&&"error"in result&&result.error)throw this.debugLog("cToHostLoadModule: loader returned error",result.error),result.error;let moduleSource=typeof result=="string"?result:"value"in result?result.value:result;return this.memory.newHeapCharPointer(moduleSource).value.ptr}catch(error){return this.debugLog("cToHostLoadModule: caught error",error),context.throw(error),0}}),normalizeModule:maybeAsyncFn(this,function*(awaited,rt,ctx,baseModuleName,moduleNameRequest){let moduleNormalizer=this.moduleNormalizer;if(!moduleNormalizer)throw new Error("Runtime has no module normalizer");if(rt!==this.rt.value)throw new Error("Runtime pointer mismatch");let context=this.contextMap.get(ctx)??this.newContext({contextPointer:ctx});try{let result=yield*awaited(moduleNormalizer(baseModuleName,moduleNameRequest,context));if(typeof result=="object"&&"error"in result&&result.error)throw this.debugLog("cToHostNormalizeModule: normalizer returned error",result.error),result.error;let name=typeof result=="string"?result:result.value;return context.getMemory(this.rt.value).newHeapCharPointer(name).value.ptr}catch(error){return this.debugLog("normalizeModule: caught error",error),context.throw(error),0}})};args.ownedLifetimes?.forEach(lifetime=>this.scope.manage(lifetime)),this.module=args.module,this.memory=new ModuleMemory(this.module),this.ffi=args.ffi,this.rt=args.rt,this.callbacks=args.callbacks,this.scope.manage(this.rt),this.callbacks.setRuntimeCallbacks(this.rt.value,this.cToHostCallbacks),this.executePendingJobs=this.executePendingJobs.bind(this),QTS_DEBUG&&this.setDebugMode(!0)}get alive(){return this.scope.alive}dispose(){return this.scope.dispose()}newContext(options={}){let intrinsics=intrinsicsToFlags(options.intrinsics),ctx=new Lifetime(options.contextPointer||this.ffi.QTS_NewContext(this.rt.value,intrinsics),void 0,ctx_ptr=>{this.contextMap.delete(ctx_ptr),this.callbacks.deleteContext(ctx_ptr),this.ffi.QTS_FreeContext(ctx_ptr)}),context=new QuickJSContext({module:this.module,ctx,ffi:this.ffi,rt:this.rt,ownedLifetimes:options.ownedLifetimes,runtime:this,callbacks:this.callbacks});return this.contextMap.set(ctx.value,context),context}setModuleLoader(moduleLoader,moduleNormalizer){this.moduleLoader=moduleLoader,this.moduleNormalizer=moduleNormalizer,this.ffi.QTS_RuntimeEnableModuleLoader(this.rt.value,this.moduleNormalizer?1:0)}removeModuleLoader(){this.moduleLoader=void 0,this.ffi.QTS_RuntimeDisableModuleLoader(this.rt.value)}hasPendingJob(){return!!this.ffi.QTS_IsJobPending(this.rt.value)}setInterruptHandler(cb){let prevInterruptHandler=this.interruptHandler;this.interruptHandler=cb,prevInterruptHandler||this.ffi.QTS_RuntimeEnableInterruptHandler(this.rt.value)}removeInterruptHandler(){this.interruptHandler&&(this.ffi.QTS_RuntimeDisableInterruptHandler(this.rt.value),this.interruptHandler=void 0)}executePendingJobs(maxJobsToExecute=-1){let ctxPtrOut=this.memory.newMutablePointerArray(1),valuePtr=this.ffi.QTS_ExecutePendingJob(this.rt.value,maxJobsToExecute??-1,ctxPtrOut.value.ptr),ctxPtr=ctxPtrOut.value.typedArray[0];if(ctxPtrOut.dispose(),ctxPtr===0)return this.ffi.QTS_FreeValuePointerRuntime(this.rt.value,valuePtr),DisposableResult.success(0);let context=this.contextMap.get(ctxPtr)??this.newContext({contextPointer:ctxPtr}),resultValue=context.getMemory(this.rt.value).heapValueHandle(valuePtr);if(context.typeof(resultValue)==="number"){let executedJobs=context.getNumber(resultValue);return resultValue.dispose(),DisposableResult.success(executedJobs)}else{let error=Object.assign(resultValue,{context});return DisposableResult.fail(error,error2=>context.unwrapResult(error2))}}setMemoryLimit(limitBytes){if(limitBytes<0&&limitBytes!==-1)throw new Error("Cannot set memory limit to negative number. To unset, pass -1");this.ffi.QTS_RuntimeSetMemoryLimit(this.rt.value,limitBytes)}computeMemoryUsage(){let serviceContextMemory=this.getSystemContext().getMemory(this.rt.value);return serviceContextMemory.heapValueHandle(this.ffi.QTS_RuntimeComputeMemoryUsage(this.rt.value,serviceContextMemory.ctx.value))}dumpMemoryUsage(){return this.memory.consumeHeapCharPointer(this.ffi.QTS_RuntimeDumpMemoryUsage(this.rt.value))}setMaxStackSize(stackSize){if(stackSize<0)throw new Error("Cannot set memory limit to negative number. To unset, pass 0.");this.ffi.QTS_RuntimeSetMaxStackSize(this.rt.value,stackSize)}assertOwned(handle){if(handle.owner&&handle.owner.rt!==this.rt)throw new QuickJSWrongOwner(`Handle is not owned by this runtime: ${handle.owner.rt.value} != ${this.rt.value}`)}setDebugMode(enabled){this._debugMode=enabled,this.ffi.DEBUG&&this.rt.alive&&this.ffi.QTS_SetDebugLogEnabled(this.rt.value,enabled?1:0)}isDebugMode(){return this._debugMode}debugLog(...msg){this._debugMode&&console.log("quickjs-emscripten:",...msg)}[Symbol.for("nodejs.util.inspect.custom")](){return this.alive?`${this.constructor.name} { rt: ${this.rt.value} }`:`${this.constructor.name} { disposed }`}getSystemContext(){return this.context||(this.context=this.scope.manage(this.newContext())),this.context}};var QuickJSEmscriptenModuleCallbacks=class{constructor(args){this.freeHostRef=args.freeHostRef,this.callFunction=args.callFunction,this.shouldInterrupt=args.shouldInterrupt,this.loadModuleSource=args.loadModuleSource,this.normalizeModule=args.normalizeModule}},QuickJSModuleCallbacks=class{constructor(module){this.contextCallbacks=new Map;this.runtimeCallbacks=new Map;this.suspendedCount=0;this.cToHostCallbacks=new QuickJSEmscriptenModuleCallbacks({freeHostRef:(_asyncify,rt,host_ref_id)=>{let runtimeCallbacks=this.runtimeCallbacks.get(rt);if(!runtimeCallbacks)throw new Error(`QuickJSRuntime(rt = ${rt}) not found when trying to free HostRef(id = ${host_ref_id})`);runtimeCallbacks.freeHostRef(rt,host_ref_id)},callFunction:(asyncify,ctx,this_ptr,argc,argv,fn_id)=>this.handleAsyncify(asyncify,()=>{try{let vm=this.contextCallbacks.get(ctx);if(!vm)throw new Error(`QuickJSContext(ctx = ${ctx}) not found for C function call "${fn_id}"`);return vm.callFunction(ctx,this_ptr,argc,argv,fn_id)}catch(error){return console.error("[C to host error: returning null]",error),0}}),shouldInterrupt:(asyncify,rt)=>this.handleAsyncify(asyncify,()=>{try{let vm=this.runtimeCallbacks.get(rt);if(!vm)throw new Error(`QuickJSRuntime(rt = ${rt}) not found for C interrupt`);return vm.shouldInterrupt(rt)}catch(error){return console.error("[C to host interrupt: returning error]",error),1}}),loadModuleSource:(asyncify,rt,ctx,moduleName)=>this.handleAsyncify(asyncify,()=>{try{let runtimeCallbacks=this.runtimeCallbacks.get(rt);if(!runtimeCallbacks)throw new Error(`QuickJSRuntime(rt = ${rt}) not found for C module loader`);let loadModule=runtimeCallbacks.loadModuleSource;if(!loadModule)throw new Error(`QuickJSRuntime(rt = ${rt}) does not support module loading`);return loadModule(rt,ctx,moduleName)}catch(error){return console.error("[C to host module loader error: returning null]",error),0}}),normalizeModule:(asyncify,rt,ctx,moduleBaseName,moduleName)=>this.handleAsyncify(asyncify,()=>{try{let runtimeCallbacks=this.runtimeCallbacks.get(rt);if(!runtimeCallbacks)throw new Error(`QuickJSRuntime(rt = ${rt}) not found for C module loader`);let normalizeModule=runtimeCallbacks.normalizeModule;if(!normalizeModule)throw new Error(`QuickJSRuntime(rt = ${rt}) does not support module loading`);return normalizeModule(rt,ctx,moduleBaseName,moduleName)}catch(error){return console.error("[C to host module loader error: returning null]",error),0}})});this.module=module,this.module.callbacks=this.cToHostCallbacks}setRuntimeCallbacks(rt,callbacks){this.runtimeCallbacks.set(rt,callbacks)}deleteRuntime(rt){this.runtimeCallbacks.delete(rt)}setContextCallbacks(ctx,callbacks){this.contextCallbacks.set(ctx,callbacks)}deleteContext(ctx){this.contextCallbacks.delete(ctx)}handleAsyncify(asyncify,fn){if(asyncify)return asyncify.handleSleep(done=>{try{let result=fn();if(!(result instanceof Promise)){debugLog("asyncify.handleSleep: not suspending:",result),done(result);return}if(this.suspended)throw new QuickJSAsyncifyError(`Already suspended at: ${this.suspended.stack}
    -Attempted to suspend at:`);this.suspended=new QuickJSAsyncifySuspended(`(${this.suspendedCount++})`),debugLog("asyncify.handleSleep: suspending:",this.suspended),result.then(resolvedResult=>{this.suspended=void 0,debugLog("asyncify.handleSleep: resolved:",resolvedResult),done(resolvedResult)},error=>{debugLog("asyncify.handleSleep: rejected:",error),console.error("QuickJS: cannot handle error in suspended function",error),this.suspended=void 0})}catch(error){throw debugLog("asyncify.handleSleep: error:",error),this.suspended=void 0,error}});let value=fn();if(value instanceof Promise)throw new Error("Promise return value not supported in non-asyncify context.");return value}};function applyBaseRuntimeOptions(runtime,options){options.interruptHandler&&runtime.setInterruptHandler(options.interruptHandler),options.maxStackSizeBytes!==void 0&&runtime.setMaxStackSize(options.maxStackSizeBytes),options.memoryLimitBytes!==void 0&&runtime.setMemoryLimit(options.memoryLimitBytes)}function applyModuleEvalRuntimeOptions(runtime,options){options.moduleLoader&&runtime.setModuleLoader(options.moduleLoader),options.shouldInterrupt&&runtime.setInterruptHandler(options.shouldInterrupt),options.memoryLimitBytes!==void 0&&runtime.setMemoryLimit(options.memoryLimitBytes),options.maxStackSizeBytes!==void 0&&runtime.setMaxStackSize(options.maxStackSizeBytes)}var QuickJSWASMModule=class{constructor(module,ffi){this.module=module,this.ffi=ffi,this.callbacks=new QuickJSModuleCallbacks(module)}newRuntime(options={}){let rt=new Lifetime(this.ffi.QTS_NewRuntime(),void 0,rt_ptr=>{this.ffi.QTS_FreeRuntime(rt_ptr),this.callbacks.deleteRuntime(rt_ptr)}),runtime=new QuickJSRuntime({module:this.module,callbacks:this.callbacks,ffi:this.ffi,rt});return applyBaseRuntimeOptions(runtime,options),options.moduleLoader&&runtime.setModuleLoader(options.moduleLoader),runtime}newContext(options={}){let runtime=this.newRuntime(),context=runtime.newContext({...options,ownedLifetimes:concat(runtime,options.ownedLifetimes)});return runtime.context=context,context}evalCode(code,options={}){return Scope.withScope(scope=>{let vm=scope.manage(this.newContext());applyModuleEvalRuntimeOptions(vm.runtime,options);let result=vm.evalCode(code,"eval.js");if(options.memoryLimitBytes!==void 0&&vm.runtime.setMemoryLimit(-1),result.error)throw vm.dump(scope.manage(result.error));return vm.dump(scope.manage(result.value))})}getWasmMemory(){let memory=this.module.quickjsEmscriptenInit?.(()=>{})?.getWasmMemory?.();if(!memory)throw new Error("Variant does not support getting WebAssembly.Memory");return memory}getFFI(){return this.ffi}};export{setDebugMode,debugLog,QuickJSNotImplemented,QuickJSMemoryLeakDetected,QuickJSEmscriptenModuleError,errors_exports,UsingDisposable,Lifetime,StaticLifetime,WeakLifetime,Scope,createDisposableArray,DisposableSuccess,DisposableFail,DisposableResult,QuickJSDeferredPromise,DefaultIntrinsics,intrinsicsToFlags,evalOptionsToFlags,QuickJSContext,QuickJSRuntime,QuickJSModuleCallbacks,applyBaseRuntimeOptions,applyModuleEvalRuntimeOptions,QuickJSWASMModule};
    -//# sourceMappingURL=chunk-V2S4ZYJR.mjs.map
    \ No newline at end of file
    diff --git a/.output/server/node_modules/quickjs-emscripten-core/dist/index.mjs b/.output/server/node_modules/quickjs-emscripten-core/dist/index.mjs
    deleted file mode 100644
    index 57102f2..0000000
    --- a/.output/server/node_modules/quickjs-emscripten-core/dist/index.mjs
    +++ /dev/null
    @@ -1,2 +0,0 @@
    -import{QuickJSAsyncContext,QuickJSAsyncRuntime,QuickJSAsyncWASMModule}from"./chunk-TAV5CUKK.mjs";import{DefaultIntrinsics,DisposableFail,DisposableResult,DisposableSuccess,Lifetime,QuickJSContext,QuickJSDeferredPromise,QuickJSEmscriptenModuleError,QuickJSMemoryLeakDetected,QuickJSRuntime,QuickJSWASMModule,Scope,StaticLifetime,UsingDisposable,WeakLifetime,createDisposableArray,debugLog,errors_exports,setDebugMode}from"./chunk-V2S4ZYJR.mjs";export*from"@jitl/quickjs-ffi-types";async function newQuickJSWASMModuleFromVariant(variantOrPromise){let variant=smartUnwrap(await variantOrPromise),[wasmModuleLoader,QuickJSFFI,{QuickJSWASMModule:QuickJSWASMModule2}]=await Promise.all([variant.importModuleLoader().then(smartUnwrap),variant.importFFI(),import("./module-ES6BEMUI.mjs").then(smartUnwrap)]),wasmModule=await wasmModuleLoader();wasmModule.type="sync";let ffi=new QuickJSFFI(wasmModule);return new QuickJSWASMModule2(wasmModule,ffi)}async function newQuickJSAsyncWASMModuleFromVariant(variantOrPromise){let variant=smartUnwrap(await variantOrPromise),[wasmModuleLoader,QuickJSAsyncFFI,{QuickJSAsyncWASMModule:QuickJSAsyncWASMModule2}]=await Promise.all([variant.importModuleLoader().then(smartUnwrap),variant.importFFI(),import("./module-asyncify-2EFITU5U.mjs").then(smartUnwrap)]),wasmModule=await wasmModuleLoader();wasmModule.type="async";let ffi=new QuickJSAsyncFFI(wasmModule);return new QuickJSAsyncWASMModule2(wasmModule,ffi)}function memoizePromiseFactory(fn){let promise;return()=>promise??(promise=fn())}function smartUnwrap(val){return val&&"default"in val&&val.default?val.default&&"default"in val.default&&val.default.default?val.default.default:val.default:val}function newVariant(baseVariant,options){return{...baseVariant,async importModuleLoader(){let moduleLoader=smartUnwrap(await baseVariant.importModuleLoader());return async function(){let moduleLoaderArg=options.emscriptenModule?{...options.emscriptenModule}:{},log=options.log??((...args)=>debugLog("newVariant moduleLoader:",...args)),tapValue=(message,val)=>(log(...message,val),val),force=val=>typeof val=="function"?val():val;(options.wasmLocation||options.wasmSourceMapLocation||options.locateFile)&&(moduleLoaderArg.locateFile=(fileName,relativeTo)=>{let args={fileName,relativeTo};if(fileName.endsWith(".wasm")&&options.wasmLocation!==void 0)return tapValue(["locateFile .wasm: provide wasmLocation",args],options.wasmLocation);if(fileName.endsWith(".map")){if(options.wasmSourceMapLocation!==void 0)return tapValue(["locateFile .map: provide wasmSourceMapLocation",args],options.wasmSourceMapLocation);if(options.wasmLocation&&!options.locateFile)return tapValue(["locateFile .map: infer from wasmLocation",args],options.wasmLocation+".map")}return options.locateFile?tapValue(["locateFile: use provided fn",args],options.locateFile(fileName,relativeTo)):tapValue(["locateFile: unhandled, passthrough",args],fileName)}),options.wasmBinary&&(moduleLoaderArg.wasmBinary=await force(options.wasmBinary)),options.wasmMemory&&(moduleLoaderArg.wasmMemory=await force(options.wasmMemory));let optionsWasmModule=options.wasmModule,modulePromise;optionsWasmModule&&(moduleLoaderArg.instantiateWasm=async(imports,onSuccess)=>{modulePromise??(modulePromise=Promise.resolve(force(optionsWasmModule)));let wasmModule=await modulePromise;if(!wasmModule)throw new QuickJSEmscriptenModuleError(`options.wasmModule returned ${String(wasmModule)}`);let instance=await WebAssembly.instantiate(wasmModule,imports);return onSuccess(instance),instance.exports}),moduleLoaderArg.monitorRunDependencies=left=>{log("monitorRunDependencies:",left)},moduleLoaderArg.quickjsEmscriptenInit=()=>newMockExtensions(log);let resultPromise=moduleLoader(moduleLoaderArg),extensions=moduleLoaderArg.quickjsEmscriptenInit?.(log);if(optionsWasmModule&&extensions?.receiveWasmOffsetConverter&&!extensions.existingWasmOffsetConverter){let wasmBinary=await force(options.wasmBinary)??new ArrayBuffer(0);modulePromise??(modulePromise=Promise.resolve(force(optionsWasmModule)));let wasmModule=await modulePromise;if(!wasmModule)throw new QuickJSEmscriptenModuleError(`options.wasmModule returned ${String(wasmModule)}`);extensions.receiveWasmOffsetConverter(wasmBinary,wasmModule)}if(extensions?.receiveSourceMapJSON){let loadedSourceMapData=await force(options.wasmSourceMapData);typeof loadedSourceMapData=="string"?extensions.receiveSourceMapJSON(JSON.parse(loadedSourceMapData)):loadedSourceMapData?extensions.receiveSourceMapJSON(loadedSourceMapData):extensions.receiveSourceMapJSON({version:3,names:[],sources:[],mappings:""})}return resultPromise}}}}function newMockExtensions(log){let mockMessage="mock called, emscripten module may not be initialized yet";return{mock:!0,removeRunDependency(name){log(`${mockMessage}: removeRunDependency called:`,name)},receiveSourceMapJSON(data){log(`${mockMessage}: receiveSourceMapJSON called:`,data)},WasmOffsetConverter:void 0,receiveWasmOffsetConverter(bytes,mod){log(`${mockMessage}: receiveWasmOffsetConverter called:`,bytes,mod)}}}function isSuccess(successOrFail){return!("error"in successOrFail)}function isFail(successOrFail){return"error"in successOrFail}function shouldInterruptAfterDeadline(deadline){let deadlineAsNumber=typeof deadline=="number"?deadline:deadline.getTime();return function(){return Date.now()>deadlineAsNumber}}var TestQuickJSWASMModule=class{constructor(parent){this.parent=parent;this.contexts=new Set;this.runtimes=new Set}newRuntime(options){let runtime=this.parent.newRuntime({...options,ownedLifetimes:[new Lifetime(void 0,void 0,()=>this.runtimes.delete(runtime)),...options?.ownedLifetimes??[]]});return this.runtimes.add(runtime),runtime}newContext(options){let context=this.parent.newContext({...options,ownedLifetimes:[new Lifetime(void 0,void 0,()=>this.contexts.delete(context)),...options?.ownedLifetimes??[]]});return this.contexts.add(context),context}evalCode(code,options){return this.parent.evalCode(code,options)}disposeAll(){let allDisposables=[...this.contexts,...this.runtimes];this.runtimes.clear(),this.contexts.clear(),allDisposables.forEach(d=>{d.alive&&d.dispose()})}assertNoMemoryAllocated(){if(this.getFFI().QTS_RecoverableLeakCheck())throw new QuickJSMemoryLeakDetected("Leak sanitizer detected un-freed memory");if(this.contexts.size>0)throw new QuickJSMemoryLeakDetected(`${this.contexts.size} contexts leaked`);if(this.runtimes.size>0)throw new QuickJSMemoryLeakDetected(`${this.runtimes.size} runtimes leaked`)}getWasmMemory(){return this.parent.getWasmMemory()}getFFI(){return this.parent.getFFI()}};export{DefaultIntrinsics,DisposableFail,DisposableResult,DisposableSuccess,Lifetime,QuickJSAsyncContext,QuickJSAsyncRuntime,QuickJSAsyncWASMModule,QuickJSContext,QuickJSDeferredPromise,QuickJSRuntime,QuickJSWASMModule,Scope,StaticLifetime,TestQuickJSWASMModule,UsingDisposable,WeakLifetime,createDisposableArray,debugLog,errors_exports as errors,isFail,isSuccess,memoizePromiseFactory,newQuickJSAsyncWASMModuleFromVariant,newQuickJSWASMModuleFromVariant,newVariant,setDebugMode,shouldInterruptAfterDeadline};
    -//# sourceMappingURL=index.mjs.map
    \ No newline at end of file
    diff --git a/.output/server/node_modules/quickjs-emscripten-core/dist/module-ES6BEMUI.mjs b/.output/server/node_modules/quickjs-emscripten-core/dist/module-ES6BEMUI.mjs
    deleted file mode 100644
    index 0a6ccad..0000000
    --- a/.output/server/node_modules/quickjs-emscripten-core/dist/module-ES6BEMUI.mjs
    +++ /dev/null
    @@ -1,2 +0,0 @@
    -import{QuickJSModuleCallbacks,QuickJSWASMModule,applyBaseRuntimeOptions,applyModuleEvalRuntimeOptions}from"./chunk-V2S4ZYJR.mjs";export{QuickJSModuleCallbacks,QuickJSWASMModule,applyBaseRuntimeOptions,applyModuleEvalRuntimeOptions};
    -//# sourceMappingURL=module-ES6BEMUI.mjs.map
    \ No newline at end of file
    diff --git a/.output/server/node_modules/quickjs-emscripten-core/dist/module-asyncify-2EFITU5U.mjs b/.output/server/node_modules/quickjs-emscripten-core/dist/module-asyncify-2EFITU5U.mjs
    deleted file mode 100644
    index 5961421..0000000
    --- a/.output/server/node_modules/quickjs-emscripten-core/dist/module-asyncify-2EFITU5U.mjs
    +++ /dev/null
    @@ -1,2 +0,0 @@
    -import{QuickJSAsyncWASMModule}from"./chunk-TAV5CUKK.mjs";import"./chunk-V2S4ZYJR.mjs";export{QuickJSAsyncWASMModule};
    -//# sourceMappingURL=module-asyncify-2EFITU5U.mjs.map
    \ No newline at end of file
    diff --git a/.output/server/node_modules/quickjs-emscripten-core/package.json b/.output/server/node_modules/quickjs-emscripten-core/package.json
    deleted file mode 100644
    index 1e02982..0000000
    --- a/.output/server/node_modules/quickjs-emscripten-core/package.json
    +++ /dev/null
    @@ -1,49 +0,0 @@
    -{
    -  "name": "quickjs-emscripten-core",
    -  "version": "0.32.0",
    -  "sideEffects": false,
    -  "license": "MIT",
    -  "type": "commonjs",
    -  "keywords": [
    -    "eval",
    -    "quickjs",
    -    "vm",
    -    "interpreter",
    -    "runtime",
    -    "safe",
    -    "emscripten",
    -    "wasm"
    -  ],
    -  "author": {
    -    "name": "Jake Teton-Landis",
    -    "url": "https://jake.tl"
    -  },
    -  "repository": {
    -    "type": "git",
    -    "url": "https://github.com/justjake/quickjs-emscripten"
    -  },
    -  "files": [
    -    "LICENSE",
    -    "dist/**/*",
    -    "!dist/*.test.js",
    -    "!dist/*.tsbuildinfo"
    -  ],
    -  "types": "./dist/index.d.ts",
    -  "main": "./dist/index.js",
    -  "module": "./dist/index.mjs",
    -  "exports": {
    -    ".": {
    -      "types": "./dist/index.d.ts",
    -      "import": "./dist/index.mjs",
    -      "require": "./dist/index.js"
    -    }
    -  },
    -  "scripts": {
    -    "tsc": "npx tsc -p . --noEmit",
    -    "test": "npx vitest run",
    -    "build": "npx tsup"
    -  },
    -  "dependencies": {
    -    "@jitl/quickjs-ffi-types": "0.32.0"
    -  }
    -}
    \ No newline at end of file
    diff --git a/.output/server/node_modules/quickjs-emscripten/dist/chunk-OHAYRCBA.mjs b/.output/server/node_modules/quickjs-emscripten/dist/chunk-OHAYRCBA.mjs
    deleted file mode 100644
    index b004330..0000000
    --- a/.output/server/node_modules/quickjs-emscripten/dist/chunk-OHAYRCBA.mjs
    +++ /dev/null
    @@ -1,2 +0,0 @@
    -import{newQuickJSWASMModuleFromVariant,newQuickJSAsyncWASMModuleFromVariant}from"quickjs-emscripten-core";import DEBUG_SYNC from"@jitl/quickjs-wasmfile-debug-sync";import RELEASE_SYNC from"@jitl/quickjs-wasmfile-release-sync";import DEBUG_ASYNC from"@jitl/quickjs-wasmfile-debug-asyncify";import RELEASE_ASYNC from"@jitl/quickjs-wasmfile-release-asyncify";async function newQuickJSWASMModule(variantOrPromise=RELEASE_SYNC){return newQuickJSWASMModuleFromVariant(variantOrPromise)}async function newQuickJSAsyncWASMModule(variantOrPromise=RELEASE_ASYNC){return newQuickJSAsyncWASMModuleFromVariant(variantOrPromise)}export{DEBUG_SYNC,RELEASE_SYNC,DEBUG_ASYNC,RELEASE_ASYNC,newQuickJSWASMModule,newQuickJSAsyncWASMModule};
    -//# sourceMappingURL=chunk-OHAYRCBA.mjs.map
    \ No newline at end of file
    diff --git a/.output/server/node_modules/quickjs-emscripten/dist/index.mjs b/.output/server/node_modules/quickjs-emscripten/dist/index.mjs
    deleted file mode 100644
    index 4310a69..0000000
    --- a/.output/server/node_modules/quickjs-emscripten/dist/index.mjs
    +++ /dev/null
    @@ -1,2 +0,0 @@
    -import{DEBUG_ASYNC,DEBUG_SYNC,RELEASE_ASYNC,RELEASE_SYNC,newQuickJSAsyncWASMModule,newQuickJSWASMModule}from"./chunk-OHAYRCBA.mjs";export*from"quickjs-emscripten-core";var singleton,singletonPromise;async function getQuickJS(){return singletonPromise??(singletonPromise=newQuickJSWASMModule().then(instance=>(singleton=instance,instance))),await singletonPromise}function getQuickJSSync(){if(!singleton)throw new Error("QuickJS not initialized. Await getQuickJS() at least once.");return singleton}async function newAsyncRuntime(options){return(await newQuickJSAsyncWASMModule()).newRuntime(options)}async function newAsyncContext(options){return(await newQuickJSAsyncWASMModule()).newContext(options)}export{DEBUG_ASYNC,DEBUG_SYNC,RELEASE_ASYNC,RELEASE_SYNC,getQuickJS,getQuickJSSync,newAsyncContext,newAsyncRuntime,newQuickJSAsyncWASMModule,newQuickJSWASMModule};
    -//# sourceMappingURL=index.mjs.map
    \ No newline at end of file
    diff --git a/.output/server/node_modules/quickjs-emscripten/package.json b/.output/server/node_modules/quickjs-emscripten/package.json
    deleted file mode 100644
    index 87d5f69..0000000
    --- a/.output/server/node_modules/quickjs-emscripten/package.json
    +++ /dev/null
    @@ -1,69 +0,0 @@
    -{
    -  "name": "quickjs-emscripten",
    -  "version": "0.32.0",
    -  "sideEffects": false,
    -  "license": "MIT",
    -  "type": "commonjs",
    -  "keywords": [
    -    "eval",
    -    "quickjs",
    -    "vm",
    -    "interpreter",
    -    "runtime",
    -    "safe",
    -    "emscripten",
    -    "wasm"
    -  ],
    -  "repository": {
    -    "type": "git",
    -    "url": "https://github.com/justjake/quickjs-emscripten"
    -  },
    -  "author": {
    -    "name": "Jake Teton-Landis",
    -    "url": "https://jake.tl"
    -  },
    -  "files": [
    -    "LICENSE",
    -    "dist/**/*",
    -    "!dist/*.test.js",
    -    "!dist/*.tsbuildinfo"
    -  ],
    -  "scripts": {
    -    "build": "npx tsup",
    -    "clean": "git clean -fx dist .output",
    -    "tsc": "npx tsc -p . --noEmit",
    -    "test:vi": "VITEST=1 npx vitest run",
    -    "test:node": "npx tsc -p tsconfig.build.json && ./makeTestPackageJson.ts && node --experimental-import-meta-resolve -r source-map-support/register --test ./.output/*node-test*.*js",
    -    "test": "npm run test:vi && npm run test:node"
    -  },
    -  "types": "./dist/index.d.ts",
    -  "main": "./dist/index.js",
    -  "module": "./dist/index.mjs",
    -  "exports": {
    -    ".": {
    -      "types": "./dist/index.d.ts",
    -      "import": "./dist/index.mjs",
    -      "require": "./dist/index.js"
    -    },
    -    "./variants": {
    -      "types": "./dist/variants.d.ts",
    -      "import": "./dist/variants.mjs",
    -      "require": "./dist/variants.js"
    -    },
    -    "./package.json": "./package.json"
    -  },
    -  "dependencies": {
    -    "@jitl/quickjs-wasmfile-debug-asyncify": "0.32.0",
    -    "@jitl/quickjs-wasmfile-debug-sync": "0.32.0",
    -    "@jitl/quickjs-wasmfile-release-asyncify": "0.32.0",
    -    "@jitl/quickjs-wasmfile-release-sync": "0.32.0",
    -    "quickjs-emscripten-core": "0.32.0"
    -  },
    -  "devDependencies": {
    -    "@jitl/quickjs-singlefile-cjs-release-asyncify": "0.32.0",
    -    "@jitl/quickjs-singlefile-cjs-release-sync": "0.32.0"
    -  },
    -  "engines": {
    -    "node": ">=16.0.0"
    -  }
    -}
    \ No newline at end of file
    diff --git a/.output/server/node_modules/seek-bzip/lib/bitreader.js b/.output/server/node_modules/seek-bzip/lib/bitreader.js
    deleted file mode 100644
    index 7bcb396..0000000
    --- a/.output/server/node_modules/seek-bzip/lib/bitreader.js
    +++ /dev/null
    @@ -1,94 +0,0 @@
    -/*
    -node-bzip - a pure-javascript Node.JS module for decoding bzip2 data
    -
    -Copyright (C) 2012 Eli Skeggs
    -
    -Permission is hereby granted, free of charge, to any person obtaining
    -a copy of this software and associated documentation files (the
    -"Software"), to deal in the Software without restriction, including
    -without limitation the rights to use, copy, modify, merge, publish,
    -distribute, sublicense, and/or sell copies of the Software, and to
    -permit persons to whom the Software is furnished to do so, subject to
    -the following conditions:
    -
    -The above copyright notice and this permission notice shall be
    -included in all copies or substantial portions of the Software.
    -
    -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
    -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
    -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
    -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
    -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
    -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
    -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
    -
    -Adapted from bzip2.js, copyright 2011 antimatter15 (antimatter15@gmail.com).
    -
    -Based on micro-bunzip by Rob Landley (rob@landley.net).
    -
    -Based on bzip2 decompression code by Julian R Seward (jseward@acm.org),
    -which also acknowledges contributions by Mike Burrows, David Wheeler,
    -Peter Fenwick, Alistair Moffat, Radford Neal, Ian H. Witten,
    -Robert Sedgewick, and Jon L. Bentley.
    -*/
    -
    -var BITMASK = [0x00, 0x01, 0x03, 0x07, 0x0F, 0x1F, 0x3F, 0x7F, 0xFF];
    -
    -// offset in bytes
    -var BitReader = function(stream) {
    -  this.stream = stream;
    -  this.bitOffset = 0;
    -  this.curByte = 0;
    -  this.hasByte = false;
    -};
    -
    -BitReader.prototype._ensureByte = function() {
    -  if (!this.hasByte) {
    -    this.curByte = this.stream.readByte();
    -    this.hasByte = true;
    -  }
    -};
    -
    -// reads bits from the buffer
    -BitReader.prototype.read = function(bits) {
    -  var result = 0;
    -  while (bits > 0) {
    -    this._ensureByte();
    -    var remaining = 8 - this.bitOffset;
    -    // if we're in a byte
    -    if (bits >= remaining) {
    -      result <<= remaining;
    -      result |= BITMASK[remaining] & this.curByte;
    -      this.hasByte = false;
    -      this.bitOffset = 0;
    -      bits -= remaining;
    -    } else {
    -      result <<= bits;
    -      var shift = remaining - bits;
    -      result |= (this.curByte & (BITMASK[bits] << shift)) >> shift;
    -      this.bitOffset += bits;
    -      bits = 0;
    -    }
    -  }
    -  return result;
    -};
    -
    -// seek to an arbitrary point in the buffer (expressed in bits)
    -BitReader.prototype.seek = function(pos) {
    -  var n_bit = pos % 8;
    -  var n_byte = (pos - n_bit) / 8;
    -  this.bitOffset = n_bit;
    -  this.stream.seek(n_byte);
    -  this.hasByte = false;
    -};
    -
    -// reads 6 bytes worth of data using the read method
    -BitReader.prototype.pi = function() {
    -  var buf = new Buffer(6), i;
    -  for (i = 0; i < buf.length; i++) {
    -    buf[i] = this.read(8);
    -  }
    -  return buf.toString('hex');
    -};
    -
    -module.exports = BitReader;
    diff --git a/.output/server/node_modules/seek-bzip/lib/crc32.js b/.output/server/node_modules/seek-bzip/lib/crc32.js
    deleted file mode 100644
    index 8c9a169..0000000
    --- a/.output/server/node_modules/seek-bzip/lib/crc32.js
    +++ /dev/null
    @@ -1,104 +0,0 @@
    -/* CRC32, used in Bzip2 implementation.
    - * This is a port of CRC32.java from the jbzip2 implementation at
    - *   https://code.google.com/p/jbzip2
    - * which is:
    - *   Copyright (c) 2011 Matthew Francis
    - *
    - *   Permission is hereby granted, free of charge, to any person
    - *   obtaining a copy of this software and associated documentation
    - *   files (the "Software"), to deal in the Software without
    - *   restriction, including without limitation the rights to use,
    - *   copy, modify, merge, publish, distribute, sublicense, and/or sell
    - *   copies of the Software, and to permit persons to whom the
    - *   Software is furnished to do so, subject to the following
    - *   conditions:
    - *
    - *   The above copyright notice and this permission notice shall be
    - *   included in all copies or substantial portions of the Software.
    - *
    - *   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
    - *   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
    - *   OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
    - *   NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
    - *   HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
    - *   WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
    - *   FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
    - *   OTHER DEALINGS IN THE SOFTWARE.
    - * This JavaScript implementation is:
    - *   Copyright (c) 2013 C. Scott Ananian
    - * with the same licensing terms as Matthew Francis' original implementation.
    - */
    -module.exports = (function() {
    -
    -  /**
    -   * A static CRC lookup table
    -   */
    -  var crc32Lookup = new Uint32Array([
    -    0x00000000, 0x04c11db7, 0x09823b6e, 0x0d4326d9, 0x130476dc, 0x17c56b6b, 0x1a864db2, 0x1e475005,
    -    0x2608edb8, 0x22c9f00f, 0x2f8ad6d6, 0x2b4bcb61, 0x350c9b64, 0x31cd86d3, 0x3c8ea00a, 0x384fbdbd,
    -    0x4c11db70, 0x48d0c6c7, 0x4593e01e, 0x4152fda9, 0x5f15adac, 0x5bd4b01b, 0x569796c2, 0x52568b75,
    -    0x6a1936c8, 0x6ed82b7f, 0x639b0da6, 0x675a1011, 0x791d4014, 0x7ddc5da3, 0x709f7b7a, 0x745e66cd,
    -    0x9823b6e0, 0x9ce2ab57, 0x91a18d8e, 0x95609039, 0x8b27c03c, 0x8fe6dd8b, 0x82a5fb52, 0x8664e6e5,
    -    0xbe2b5b58, 0xbaea46ef, 0xb7a96036, 0xb3687d81, 0xad2f2d84, 0xa9ee3033, 0xa4ad16ea, 0xa06c0b5d,
    -    0xd4326d90, 0xd0f37027, 0xddb056fe, 0xd9714b49, 0xc7361b4c, 0xc3f706fb, 0xceb42022, 0xca753d95,
    -    0xf23a8028, 0xf6fb9d9f, 0xfbb8bb46, 0xff79a6f1, 0xe13ef6f4, 0xe5ffeb43, 0xe8bccd9a, 0xec7dd02d,
    -    0x34867077, 0x30476dc0, 0x3d044b19, 0x39c556ae, 0x278206ab, 0x23431b1c, 0x2e003dc5, 0x2ac12072,
    -    0x128e9dcf, 0x164f8078, 0x1b0ca6a1, 0x1fcdbb16, 0x018aeb13, 0x054bf6a4, 0x0808d07d, 0x0cc9cdca,
    -    0x7897ab07, 0x7c56b6b0, 0x71159069, 0x75d48dde, 0x6b93dddb, 0x6f52c06c, 0x6211e6b5, 0x66d0fb02,
    -    0x5e9f46bf, 0x5a5e5b08, 0x571d7dd1, 0x53dc6066, 0x4d9b3063, 0x495a2dd4, 0x44190b0d, 0x40d816ba,
    -    0xaca5c697, 0xa864db20, 0xa527fdf9, 0xa1e6e04e, 0xbfa1b04b, 0xbb60adfc, 0xb6238b25, 0xb2e29692,
    -    0x8aad2b2f, 0x8e6c3698, 0x832f1041, 0x87ee0df6, 0x99a95df3, 0x9d684044, 0x902b669d, 0x94ea7b2a,
    -    0xe0b41de7, 0xe4750050, 0xe9362689, 0xedf73b3e, 0xf3b06b3b, 0xf771768c, 0xfa325055, 0xfef34de2,
    -    0xc6bcf05f, 0xc27dede8, 0xcf3ecb31, 0xcbffd686, 0xd5b88683, 0xd1799b34, 0xdc3abded, 0xd8fba05a,
    -    0x690ce0ee, 0x6dcdfd59, 0x608edb80, 0x644fc637, 0x7a089632, 0x7ec98b85, 0x738aad5c, 0x774bb0eb,
    -    0x4f040d56, 0x4bc510e1, 0x46863638, 0x42472b8f, 0x5c007b8a, 0x58c1663d, 0x558240e4, 0x51435d53,
    -    0x251d3b9e, 0x21dc2629, 0x2c9f00f0, 0x285e1d47, 0x36194d42, 0x32d850f5, 0x3f9b762c, 0x3b5a6b9b,
    -    0x0315d626, 0x07d4cb91, 0x0a97ed48, 0x0e56f0ff, 0x1011a0fa, 0x14d0bd4d, 0x19939b94, 0x1d528623,
    -    0xf12f560e, 0xf5ee4bb9, 0xf8ad6d60, 0xfc6c70d7, 0xe22b20d2, 0xe6ea3d65, 0xeba91bbc, 0xef68060b,
    -    0xd727bbb6, 0xd3e6a601, 0xdea580d8, 0xda649d6f, 0xc423cd6a, 0xc0e2d0dd, 0xcda1f604, 0xc960ebb3,
    -    0xbd3e8d7e, 0xb9ff90c9, 0xb4bcb610, 0xb07daba7, 0xae3afba2, 0xaafbe615, 0xa7b8c0cc, 0xa379dd7b,
    -    0x9b3660c6, 0x9ff77d71, 0x92b45ba8, 0x9675461f, 0x8832161a, 0x8cf30bad, 0x81b02d74, 0x857130c3,
    -    0x5d8a9099, 0x594b8d2e, 0x5408abf7, 0x50c9b640, 0x4e8ee645, 0x4a4ffbf2, 0x470cdd2b, 0x43cdc09c,
    -    0x7b827d21, 0x7f436096, 0x7200464f, 0x76c15bf8, 0x68860bfd, 0x6c47164a, 0x61043093, 0x65c52d24,
    -    0x119b4be9, 0x155a565e, 0x18197087, 0x1cd86d30, 0x029f3d35, 0x065e2082, 0x0b1d065b, 0x0fdc1bec,
    -    0x3793a651, 0x3352bbe6, 0x3e119d3f, 0x3ad08088, 0x2497d08d, 0x2056cd3a, 0x2d15ebe3, 0x29d4f654,
    -    0xc5a92679, 0xc1683bce, 0xcc2b1d17, 0xc8ea00a0, 0xd6ad50a5, 0xd26c4d12, 0xdf2f6bcb, 0xdbee767c,
    -    0xe3a1cbc1, 0xe760d676, 0xea23f0af, 0xeee2ed18, 0xf0a5bd1d, 0xf464a0aa, 0xf9278673, 0xfde69bc4,
    -    0x89b8fd09, 0x8d79e0be, 0x803ac667, 0x84fbdbd0, 0x9abc8bd5, 0x9e7d9662, 0x933eb0bb, 0x97ffad0c,
    -    0xafb010b1, 0xab710d06, 0xa6322bdf, 0xa2f33668, 0xbcb4666d, 0xb8757bda, 0xb5365d03, 0xb1f740b4
    -  ]);
    -
    -  var CRC32 = function() {
    -    /**
    -     * The current CRC
    -     */
    -    var crc = 0xffffffff;
    -
    -    /**
    -     * @return The current CRC
    -     */
    -    this.getCRC = function() {
    -      return (~crc) >>> 0; // return an unsigned value
    -    };
    -
    -    /**
    -     * Update the CRC with a single byte
    -     * @param value The value to update the CRC with
    -     */
    -    this.updateCRC = function(value) {
    -      crc = (crc << 8) ^ crc32Lookup[((crc >>> 24) ^ value) & 0xff];
    -    };
    -
    -    /**
    -     * Update the CRC with a sequence of identical bytes
    -     * @param value The value to update the CRC with
    -     * @param count The number of bytes
    -     */
    -    this.updateCRCRun = function(value, count) {
    -      while (count-- > 0) {
    -        crc = (crc << 8) ^ crc32Lookup[((crc >>> 24) ^ value) & 0xff];
    -      }
    -    };
    -  };
    -  return CRC32;
    -})();
    diff --git a/.output/server/node_modules/seek-bzip/lib/index.js b/.output/server/node_modules/seek-bzip/lib/index.js
    deleted file mode 100644
    index f3bab49..0000000
    --- a/.output/server/node_modules/seek-bzip/lib/index.js
    +++ /dev/null
    @@ -1,605 +0,0 @@
    -/*
    -seek-bzip - a pure-javascript module for seeking within bzip2 data
    -
    -Copyright (C) 2013 C. Scott Ananian
    -Copyright (C) 2012 Eli Skeggs
    -Copyright (C) 2011 Kevin Kwok
    -
    -Permission is hereby granted, free of charge, to any person obtaining
    -a copy of this software and associated documentation files (the
    -"Software"), to deal in the Software without restriction, including
    -without limitation the rights to use, copy, modify, merge, publish,
    -distribute, sublicense, and/or sell copies of the Software, and to
    -permit persons to whom the Software is furnished to do so, subject to
    -the following conditions:
    -
    -The above copyright notice and this permission notice shall be
    -included in all copies or substantial portions of the Software.
    -
    -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
    -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
    -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
    -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
    -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
    -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
    -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
    -
    -Adapted from node-bzip, copyright 2012 Eli Skeggs.
    -Adapted from bzip2.js, copyright 2011 Kevin Kwok (antimatter15@gmail.com).
    -
    -Based on micro-bunzip by Rob Landley (rob@landley.net).
    -
    -Based on bzip2 decompression code by Julian R Seward (jseward@acm.org),
    -which also acknowledges contributions by Mike Burrows, David Wheeler,
    -Peter Fenwick, Alistair Moffat, Radford Neal, Ian H. Witten,
    -Robert Sedgewick, and Jon L. Bentley.
    -*/
    -
    -var BitReader = require('./bitreader');
    -var Stream = require('./stream');
    -var CRC32 = require('./crc32');
    -var pjson = require('../package.json');
    -
    -var MAX_HUFCODE_BITS = 20;
    -var MAX_SYMBOLS = 258;
    -var SYMBOL_RUNA = 0;
    -var SYMBOL_RUNB = 1;
    -var MIN_GROUPS = 2;
    -var MAX_GROUPS = 6;
    -var GROUP_SIZE = 50;
    -
    -var WHOLEPI = "314159265359";
    -var SQRTPI = "177245385090";
    -
    -var mtf = function(array, index) {
    -  var src = array[index], i;
    -  for (i = index; i > 0; i--) {
    -    array[i] = array[i-1];
    -  }
    -  array[0] = src;
    -  return src;
    -};
    -
    -var Err = {
    -  OK: 0,
    -  LAST_BLOCK: -1,
    -  NOT_BZIP_DATA: -2,
    -  UNEXPECTED_INPUT_EOF: -3,
    -  UNEXPECTED_OUTPUT_EOF: -4,
    -  DATA_ERROR: -5,
    -  OUT_OF_MEMORY: -6,
    -  OBSOLETE_INPUT: -7,
    -  END_OF_BLOCK: -8
    -};
    -var ErrorMessages = {};
    -ErrorMessages[Err.LAST_BLOCK] =            "Bad file checksum";
    -ErrorMessages[Err.NOT_BZIP_DATA] =         "Not bzip data";
    -ErrorMessages[Err.UNEXPECTED_INPUT_EOF] =  "Unexpected input EOF";
    -ErrorMessages[Err.UNEXPECTED_OUTPUT_EOF] = "Unexpected output EOF";
    -ErrorMessages[Err.DATA_ERROR] =            "Data error";
    -ErrorMessages[Err.OUT_OF_MEMORY] =         "Out of memory";
    -ErrorMessages[Err.OBSOLETE_INPUT] = "Obsolete (pre 0.9.5) bzip format not supported.";
    -
    -var _throw = function(status, optDetail) {
    -  var msg = ErrorMessages[status] || 'unknown error';
    -  if (optDetail) { msg += ': '+optDetail; }
    -  var e = new TypeError(msg);
    -  e.errorCode = status;
    -  throw e;
    -};
    -
    -var Bunzip = function(inputStream, outputStream) {
    -  this.writePos = this.writeCurrent = this.writeCount = 0;
    -
    -  this._start_bunzip(inputStream, outputStream);
    -};
    -Bunzip.prototype._init_block = function() {
    -  var moreBlocks = this._get_next_block();
    -  if ( !moreBlocks ) {
    -    this.writeCount = -1;
    -    return false; /* no more blocks */
    -  }
    -  this.blockCRC = new CRC32();
    -  return true;
    -};
    -/* XXX micro-bunzip uses (inputStream, inputBuffer, len) as arguments */
    -Bunzip.prototype._start_bunzip = function(inputStream, outputStream) {
    -  /* Ensure that file starts with "BZh['1'-'9']." */
    -  var buf = new Buffer(4);
    -  if (inputStream.read(buf, 0, 4) !== 4 ||
    -      String.fromCharCode(buf[0], buf[1], buf[2]) !== 'BZh')
    -    _throw(Err.NOT_BZIP_DATA, 'bad magic');
    -
    -  var level = buf[3] - 0x30;
    -  if (level < 1 || level > 9)
    -    _throw(Err.NOT_BZIP_DATA, 'level out of range');
    -
    -  this.reader = new BitReader(inputStream);
    -
    -  /* Fourth byte (ascii '1'-'9'), indicates block size in units of 100k of
    -     uncompressed data.  Allocate intermediate buffer for block. */
    -  this.dbufSize = 100000 * level;
    -  this.nextoutput = 0;
    -  this.outputStream = outputStream;
    -  this.streamCRC = 0;
    -};
    -Bunzip.prototype._get_next_block = function() {
    -  var i, j, k;
    -  var reader = this.reader;
    -  // this is get_next_block() function from micro-bunzip:
    -  /* Read in header signature and CRC, then validate signature.
    -     (last block signature means CRC is for whole file, return now) */
    -  var h = reader.pi();
    -  if (h === SQRTPI) { // last block
    -    return false; /* no more blocks */
    -  }
    -  if (h !== WHOLEPI)
    -    _throw(Err.NOT_BZIP_DATA);
    -  this.targetBlockCRC = reader.read(32) >>> 0; // (convert to unsigned)
    -  this.streamCRC = (this.targetBlockCRC ^
    -                    ((this.streamCRC << 1) | (this.streamCRC>>>31))) >>> 0;
    -  /* We can add support for blockRandomised if anybody complains.  There was
    -     some code for this in busybox 1.0.0-pre3, but nobody ever noticed that
    -     it didn't actually work. */
    -  if (reader.read(1))
    -    _throw(Err.OBSOLETE_INPUT);
    -  var origPointer = reader.read(24);
    -  if (origPointer > this.dbufSize)
    -    _throw(Err.DATA_ERROR, 'initial position out of bounds');
    -  /* mapping table: if some byte values are never used (encoding things
    -     like ascii text), the compression code removes the gaps to have fewer
    -     symbols to deal with, and writes a sparse bitfield indicating which
    -     values were present.  We make a translation table to convert the symbols
    -     back to the corresponding bytes. */
    -  var t = reader.read(16);
    -  var symToByte = new Buffer(256), symTotal = 0;
    -  for (i = 0; i < 16; i++) {
    -    if (t & (1 << (0xF - i))) {
    -      var o = i * 16;
    -      k = reader.read(16);
    -      for (j = 0; j < 16; j++)
    -        if (k & (1 << (0xF - j)))
    -          symToByte[symTotal++] = o + j;
    -    }
    -  }
    -
    -  /* How many different huffman coding groups does this block use? */
    -  var groupCount = reader.read(3);
    -  if (groupCount < MIN_GROUPS || groupCount > MAX_GROUPS)
    -    _throw(Err.DATA_ERROR);
    -  /* nSelectors: Every GROUP_SIZE many symbols we select a new huffman coding
    -     group.  Read in the group selector list, which is stored as MTF encoded
    -     bit runs.  (MTF=Move To Front, as each value is used it's moved to the
    -     start of the list.) */
    -  var nSelectors = reader.read(15);
    -  if (nSelectors === 0)
    -    _throw(Err.DATA_ERROR);
    -
    -  var mtfSymbol = new Buffer(256);
    -  for (i = 0; i < groupCount; i++)
    -    mtfSymbol[i] = i;
    -
    -  var selectors = new Buffer(nSelectors); // was 32768...
    -
    -  for (i = 0; i < nSelectors; i++) {
    -    /* Get next value */
    -    for (j = 0; reader.read(1); j++)
    -      if (j >= groupCount) _throw(Err.DATA_ERROR);
    -    /* Decode MTF to get the next selector */
    -    selectors[i] = mtf(mtfSymbol, j);
    -  }
    -
    -  /* Read the huffman coding tables for each group, which code for symTotal
    -     literal symbols, plus two run symbols (RUNA, RUNB) */
    -  var symCount = symTotal + 2;
    -  var groups = [], hufGroup;
    -  for (j = 0; j < groupCount; j++) {
    -    var length = new Buffer(symCount), temp = new Uint16Array(MAX_HUFCODE_BITS + 1);
    -    /* Read huffman code lengths for each symbol.  They're stored in
    -       a way similar to mtf; record a starting value for the first symbol,
    -       and an offset from the previous value for everys symbol after that. */
    -    t = reader.read(5); // lengths
    -    for (i = 0; i < symCount; i++) {
    -      for (;;) {
    -        if (t < 1 || t > MAX_HUFCODE_BITS) _throw(Err.DATA_ERROR);
    -        /* If first bit is 0, stop.  Else second bit indicates whether
    -           to increment or decrement the value. */
    -        if(!reader.read(1))
    -          break;
    -        if(!reader.read(1))
    -          t++;
    -        else
    -          t--;
    -      }
    -      length[i] = t;
    -    }
    -
    -    /* Find largest and smallest lengths in this group */
    -    var minLen,  maxLen;
    -    minLen = maxLen = length[0];
    -    for (i = 1; i < symCount; i++) {
    -      if (length[i] > maxLen)
    -        maxLen = length[i];
    -      else if (length[i] < minLen)
    -        minLen = length[i];
    -    }
    -
    -    /* Calculate permute[], base[], and limit[] tables from length[].
    -     *
    -     * permute[] is the lookup table for converting huffman coded symbols
    -     * into decoded symbols.  base[] is the amount to subtract from the
    -     * value of a huffman symbol of a given length when using permute[].
    -     *
    -     * limit[] indicates the largest numerical value a symbol with a given
    -     * number of bits can have.  This is how the huffman codes can vary in
    -     * length: each code with a value>limit[length] needs another bit.
    -     */
    -    hufGroup = {};
    -    groups.push(hufGroup);
    -    hufGroup.permute = new Uint16Array(MAX_SYMBOLS);
    -    hufGroup.limit = new Uint32Array(MAX_HUFCODE_BITS + 2);
    -    hufGroup.base = new Uint32Array(MAX_HUFCODE_BITS + 1);
    -    hufGroup.minLen = minLen;
    -    hufGroup.maxLen = maxLen;
    -    /* Calculate permute[].  Concurently, initialize temp[] and limit[]. */
    -    var pp = 0;
    -    for (i = minLen; i <= maxLen; i++) {
    -      temp[i] = hufGroup.limit[i] = 0;
    -      for (t = 0; t < symCount; t++)
    -        if (length[t] === i)
    -          hufGroup.permute[pp++] = t;
    -    }
    -    /* Count symbols coded for at each bit length */
    -    for (i = 0; i < symCount; i++)
    -      temp[length[i]]++;
    -    /* Calculate limit[] (the largest symbol-coding value at each bit
    -     * length, which is (previous limit<<1)+symbols at this level), and
    -     * base[] (number of symbols to ignore at each bit length, which is
    -     * limit minus the cumulative count of symbols coded for already). */
    -    pp = t = 0;
    -    for (i = minLen; i < maxLen; i++) {
    -      pp += temp[i];
    -      /* We read the largest possible symbol size and then unget bits
    -         after determining how many we need, and those extra bits could
    -         be set to anything.  (They're noise from future symbols.)  At
    -         each level we're really only interested in the first few bits,
    -         so here we set all the trailing to-be-ignored bits to 1 so they
    -         don't affect the value>limit[length] comparison. */
    -      hufGroup.limit[i] = pp - 1;
    -      pp <<= 1;
    -      t += temp[i];
    -      hufGroup.base[i + 1] = pp - t;
    -    }
    -    hufGroup.limit[maxLen + 1] = Number.MAX_VALUE; /* Sentinal value for reading next sym. */
    -    hufGroup.limit[maxLen] = pp + temp[maxLen] - 1;
    -    hufGroup.base[minLen] = 0;
    -  }
    -  /* We've finished reading and digesting the block header.  Now read this
    -     block's huffman coded symbols from the file and undo the huffman coding
    -     and run length encoding, saving the result into dbuf[dbufCount++]=uc */
    -
    -  /* Initialize symbol occurrence counters and symbol Move To Front table */
    -  var byteCount = new Uint32Array(256);
    -  for (i = 0; i < 256; i++)
    -    mtfSymbol[i] = i;
    -  /* Loop through compressed symbols. */
    -  var runPos = 0, dbufCount = 0, selector = 0, uc;
    -  var dbuf = this.dbuf = new Uint32Array(this.dbufSize);
    -  symCount = 0;
    -  for (;;) {
    -    /* Determine which huffman coding group to use. */
    -    if (!(symCount--)) {
    -      symCount = GROUP_SIZE - 1;
    -      if (selector >= nSelectors) { _throw(Err.DATA_ERROR); }
    -      hufGroup = groups[selectors[selector++]];
    -    }
    -    /* Read next huffman-coded symbol. */
    -    i = hufGroup.minLen;
    -    j = reader.read(i);
    -    for (;;i++) {
    -      if (i > hufGroup.maxLen) { _throw(Err.DATA_ERROR); }
    -      if (j <= hufGroup.limit[i])
    -        break;
    -      j = (j << 1) | reader.read(1);
    -    }
    -    /* Huffman decode value to get nextSym (with bounds checking) */
    -    j -= hufGroup.base[i];
    -    if (j < 0 || j >= MAX_SYMBOLS) { _throw(Err.DATA_ERROR); }
    -    var nextSym = hufGroup.permute[j];
    -    /* We have now decoded the symbol, which indicates either a new literal
    -       byte, or a repeated run of the most recent literal byte.  First,
    -       check if nextSym indicates a repeated run, and if so loop collecting
    -       how many times to repeat the last literal. */
    -    if (nextSym === SYMBOL_RUNA || nextSym === SYMBOL_RUNB) {
    -      /* If this is the start of a new run, zero out counter */
    -      if (!runPos){
    -        runPos = 1;
    -        t = 0;
    -      }
    -      /* Neat trick that saves 1 symbol: instead of or-ing 0 or 1 at
    -         each bit position, add 1 or 2 instead.  For example,
    -         1011 is 1<<0 + 1<<1 + 2<<2.  1010 is 2<<0 + 2<<1 + 1<<2.
    -         You can make any bit pattern that way using 1 less symbol than
    -         the basic or 0/1 method (except all bits 0, which would use no
    -         symbols, but a run of length 0 doesn't mean anything in this
    -         context).  Thus space is saved. */
    -      if (nextSym === SYMBOL_RUNA)
    -        t += runPos;
    -      else
    -        t += 2 * runPos;
    -      runPos <<= 1;
    -      continue;
    -    }
    -    /* When we hit the first non-run symbol after a run, we now know
    -       how many times to repeat the last literal, so append that many
    -       copies to our buffer of decoded symbols (dbuf) now.  (The last
    -       literal used is the one at the head of the mtfSymbol array.) */
    -    if (runPos){
    -      runPos = 0;
    -      if (dbufCount + t > this.dbufSize) { _throw(Err.DATA_ERROR); }
    -      uc = symToByte[mtfSymbol[0]];
    -      byteCount[uc] += t;
    -      while (t--)
    -        dbuf[dbufCount++] = uc;
    -    }
    -    /* Is this the terminating symbol? */
    -    if (nextSym > symTotal)
    -      break;
    -    /* At this point, nextSym indicates a new literal character.  Subtract
    -       one to get the position in the MTF array at which this literal is
    -       currently to be found.  (Note that the result can't be -1 or 0,
    -       because 0 and 1 are RUNA and RUNB.  But another instance of the
    -       first symbol in the mtf array, position 0, would have been handled
    -       as part of a run above.  Therefore 1 unused mtf position minus
    -       2 non-literal nextSym values equals -1.) */
    -    if (dbufCount >= this.dbufSize) { _throw(Err.DATA_ERROR); }
    -    i = nextSym - 1;
    -    uc = mtf(mtfSymbol, i);
    -    uc = symToByte[uc];
    -    /* We have our literal byte.  Save it into dbuf. */
    -    byteCount[uc]++;
    -    dbuf[dbufCount++] = uc;
    -  }
    -  /* At this point, we've read all the huffman-coded symbols (and repeated
    -     runs) for this block from the input stream, and decoded them into the
    -     intermediate buffer.  There are dbufCount many decoded bytes in dbuf[].
    -     Now undo the Burrows-Wheeler transform on dbuf.
    -     See http://dogma.net/markn/articles/bwt/bwt.htm
    -  */
    -  if (origPointer < 0 || origPointer >= dbufCount) { _throw(Err.DATA_ERROR); }
    -  /* Turn byteCount into cumulative occurrence counts of 0 to n-1. */
    -  j = 0;
    -  for (i = 0; i < 256; i++) {
    -    k = j + byteCount[i];
    -    byteCount[i] = j;
    -    j = k;
    -  }
    -  /* Figure out what order dbuf would be in if we sorted it. */
    -  for (i = 0; i < dbufCount; i++) {
    -    uc = dbuf[i] & 0xff;
    -    dbuf[byteCount[uc]] |= (i << 8);
    -    byteCount[uc]++;
    -  }
    -  /* Decode first byte by hand to initialize "previous" byte.  Note that it
    -     doesn't get output, and if the first three characters are identical
    -     it doesn't qualify as a run (hence writeRunCountdown=5). */
    -  var pos = 0, current = 0, run = 0;
    -  if (dbufCount) {
    -    pos = dbuf[origPointer];
    -    current = (pos & 0xff);
    -    pos >>= 8;
    -    run = -1;
    -  }
    -  this.writePos = pos;
    -  this.writeCurrent = current;
    -  this.writeCount = dbufCount;
    -  this.writeRun = run;
    -
    -  return true; /* more blocks to come */
    -};
    -/* Undo burrows-wheeler transform on intermediate buffer to produce output.
    -   If start_bunzip was initialized with out_fd=-1, then up to len bytes of
    -   data are written to outbuf.  Return value is number of bytes written or
    -   error (all errors are negative numbers).  If out_fd!=-1, outbuf and len
    -   are ignored, data is written to out_fd and return is RETVAL_OK or error.
    -*/
    -Bunzip.prototype._read_bunzip = function(outputBuffer, len) {
    -    var copies, previous, outbyte;
    -    /* james@jamestaylor.org: writeCount goes to -1 when the buffer is fully
    -       decoded, which results in this returning RETVAL_LAST_BLOCK, also
    -       equal to -1... Confusing, I'm returning 0 here to indicate no
    -       bytes written into the buffer */
    -  if (this.writeCount < 0) { return 0; }
    -
    -  var gotcount = 0;
    -  var dbuf = this.dbuf, pos = this.writePos, current = this.writeCurrent;
    -  var dbufCount = this.writeCount, outputsize = this.outputsize;
    -  var run = this.writeRun;
    -
    -  while (dbufCount) {
    -    dbufCount--;
    -    previous = current;
    -    pos = dbuf[pos];
    -    current = pos & 0xff;
    -    pos >>= 8;
    -    if (run++ === 3){
    -      copies = current;
    -      outbyte = previous;
    -      current = -1;
    -    } else {
    -      copies = 1;
    -      outbyte = current;
    -    }
    -    this.blockCRC.updateCRCRun(outbyte, copies);
    -    while (copies--) {
    -      this.outputStream.writeByte(outbyte);
    -      this.nextoutput++;
    -    }
    -    if (current != previous)
    -      run = 0;
    -  }
    -  this.writeCount = dbufCount;
    -  // check CRC
    -  if (this.blockCRC.getCRC() !== this.targetBlockCRC) {
    -    _throw(Err.DATA_ERROR, "Bad block CRC "+
    -           "(got "+this.blockCRC.getCRC().toString(16)+
    -           " expected "+this.targetBlockCRC.toString(16)+")");
    -  }
    -  return this.nextoutput;
    -};
    -
    -var coerceInputStream = function(input) {
    -  if ('readByte' in input) { return input; }
    -  var inputStream = new Stream();
    -  inputStream.pos = 0;
    -  inputStream.readByte = function() { return input[this.pos++]; };
    -  inputStream.seek = function(pos) { this.pos = pos; };
    -  inputStream.eof = function() { return this.pos >= input.length; };
    -  return inputStream;
    -};
    -var coerceOutputStream = function(output) {
    -  var outputStream = new Stream();
    -  var resizeOk = true;
    -  if (output) {
    -    if (typeof(output)==='number') {
    -      outputStream.buffer = new Buffer(output);
    -      resizeOk = false;
    -    } else if ('writeByte' in output) {
    -      return output;
    -    } else {
    -      outputStream.buffer = output;
    -      resizeOk = false;
    -    }
    -  } else {
    -    outputStream.buffer = new Buffer(16384);
    -  }
    -  outputStream.pos = 0;
    -  outputStream.writeByte = function(_byte) {
    -    if (resizeOk && this.pos >= this.buffer.length) {
    -      var newBuffer = new Buffer(this.buffer.length*2);
    -      this.buffer.copy(newBuffer);
    -      this.buffer = newBuffer;
    -    }
    -    this.buffer[this.pos++] = _byte;
    -  };
    -  outputStream.getBuffer = function() {
    -    // trim buffer
    -    if (this.pos !== this.buffer.length) {
    -      if (!resizeOk)
    -        throw new TypeError('outputsize does not match decoded input');
    -      var newBuffer = new Buffer(this.pos);
    -      this.buffer.copy(newBuffer, 0, 0, this.pos);
    -      this.buffer = newBuffer;
    -    }
    -    return this.buffer;
    -  };
    -  outputStream._coerced = true;
    -  return outputStream;
    -};
    -
    -/* Static helper functions */
    -Bunzip.Err = Err;
    -// 'input' can be a stream or a buffer
    -// 'output' can be a stream or a buffer or a number (buffer size)
    -Bunzip.decode = function(input, output, multistream) {
    -  // make a stream from a buffer, if necessary
    -  var inputStream = coerceInputStream(input);
    -  var outputStream = coerceOutputStream(output);
    -
    -  var bz = new Bunzip(inputStream, outputStream);
    -  while (true) {
    -    if ('eof' in inputStream && inputStream.eof()) break;
    -    if (bz._init_block()) {
    -      bz._read_bunzip();
    -    } else {
    -      var targetStreamCRC = bz.reader.read(32) >>> 0; // (convert to unsigned)
    -      if (targetStreamCRC !== bz.streamCRC) {
    -        _throw(Err.DATA_ERROR, "Bad stream CRC "+
    -               "(got "+bz.streamCRC.toString(16)+
    -               " expected "+targetStreamCRC.toString(16)+")");
    -      }
    -      if (multistream &&
    -          'eof' in inputStream &&
    -          !inputStream.eof()) {
    -        // note that start_bunzip will also resync the bit reader to next byte
    -        bz._start_bunzip(inputStream, outputStream);
    -      } else break;
    -    }
    -  }
    -  if ('getBuffer' in outputStream)
    -    return outputStream.getBuffer();
    -};
    -Bunzip.decodeBlock = function(input, pos, output) {
    -  // make a stream from a buffer, if necessary
    -  var inputStream = coerceInputStream(input);
    -  var outputStream = coerceOutputStream(output);
    -  var bz = new Bunzip(inputStream, outputStream);
    -  bz.reader.seek(pos);
    -  /* Fill the decode buffer for the block */
    -  var moreBlocks = bz._get_next_block();
    -  if (moreBlocks) {
    -    /* Init the CRC for writing */
    -    bz.blockCRC = new CRC32();
    -
    -    /* Zero this so the current byte from before the seek is not written */
    -    bz.writeCopies = 0;
    -
    -    /* Decompress the block and write to stdout */
    -    bz._read_bunzip();
    -    // XXX keep writing?
    -  }
    -  if ('getBuffer' in outputStream)
    -    return outputStream.getBuffer();
    -};
    -/* Reads bzip2 file from stream or buffer `input`, and invoke
    - * `callback(position, size)` once for each bzip2 block,
    - * where position gives the starting position (in *bits*)
    - * and size gives uncompressed size of the block (in *bytes*). */
    -Bunzip.table = function(input, callback, multistream) {
    -  // make a stream from a buffer, if necessary
    -  var inputStream = new Stream();
    -  inputStream.delegate = coerceInputStream(input);
    -  inputStream.pos = 0;
    -  inputStream.readByte = function() {
    -    this.pos++;
    -    return this.delegate.readByte();
    -  };
    -  if (inputStream.delegate.eof) {
    -    inputStream.eof = inputStream.delegate.eof.bind(inputStream.delegate);
    -  }
    -  var outputStream = new Stream();
    -  outputStream.pos = 0;
    -  outputStream.writeByte = function() { this.pos++; };
    -
    -  var bz = new Bunzip(inputStream, outputStream);
    -  var blockSize = bz.dbufSize;
    -  while (true) {
    -    if ('eof' in inputStream && inputStream.eof()) break;
    -
    -    var position = inputStream.pos*8 + bz.reader.bitOffset;
    -    if (bz.reader.hasByte) { position -= 8; }
    -
    -    if (bz._init_block()) {
    -      var start = outputStream.pos;
    -      bz._read_bunzip();
    -      callback(position, outputStream.pos - start);
    -    } else {
    -      var crc = bz.reader.read(32); // (but we ignore the crc)
    -      if (multistream &&
    -          'eof' in inputStream &&
    -          !inputStream.eof()) {
    -        // note that start_bunzip will also resync the bit reader to next byte
    -        bz._start_bunzip(inputStream, outputStream);
    -        console.assert(bz.dbufSize === blockSize,
    -                       "shouldn't change block size within multistream file");
    -      } else break;
    -    }
    -  }
    -};
    -
    -Bunzip.Stream = Stream;
    -
    -Bunzip.version = pjson.version;
    -Bunzip.license = pjson.license;
    -
    -module.exports = Bunzip;
    diff --git a/.output/server/node_modules/seek-bzip/lib/stream.js b/.output/server/node_modules/seek-bzip/lib/stream.js
    deleted file mode 100644
    index 90f6155..0000000
    --- a/.output/server/node_modules/seek-bzip/lib/stream.js
    +++ /dev/null
    @@ -1,42 +0,0 @@
    -/* very simple input/output stream interface */
    -var Stream = function() {
    -};
    -
    -// input streams //////////////
    -/** Returns the next byte, or -1 for EOF. */
    -Stream.prototype.readByte = function() {
    -  throw new Error("abstract method readByte() not implemented");
    -};
    -/** Attempts to fill the buffer; returns number of bytes read, or
    - *  -1 for EOF. */
    -Stream.prototype.read = function(buffer, bufOffset, length) {
    -  var bytesRead = 0;
    -  while (bytesRead < length) {
    -    var c = this.readByte();
    -    if (c < 0) { // EOF
    -      return (bytesRead===0) ? -1 : bytesRead;
    -    }
    -    buffer[bufOffset++] = c;
    -    bytesRead++;
    -  }
    -  return bytesRead;
    -};
    -Stream.prototype.seek = function(new_pos) {
    -  throw new Error("abstract method seek() not implemented");
    -};
    -
    -// output streams ///////////
    -Stream.prototype.writeByte = function(_byte) {
    -  throw new Error("abstract method readByte() not implemented");
    -};
    -Stream.prototype.write = function(buffer, bufOffset, length) {
    -  var i;
    -  for (i=0; i",
    -  "main": "src/sprintf.js",
    -  "scripts": {
    -    "test": "mocha test/*.js",
    -    "pretest": "npm run lint",
    -    "lint": "eslint .",
    -    "lint:fix": "eslint --fix ."
    -  },
    -  "repository": {
    -    "type": "git",
    -    "url": "https://github.com/alexei/sprintf.js.git"
    -  },
    -  "license": "BSD-3-Clause",
    -  "readmeFilename": "README.md",
    -  "devDependencies": {
    -    "benchmark": "^2.1.4",
    -    "eslint": "^5.10.0",
    -    "gulp": "^3.9.1",
    -    "gulp-benchmark": "^1.1.1",
    -    "gulp-eslint": "^5.0.0",
    -    "gulp-header": "^2.0.5",
    -    "gulp-mocha": "^6.0.0",
    -    "gulp-rename": "^1.4.0",
    -    "gulp-sourcemaps": "^2.6.4",
    -    "gulp-uglify": "^3.0.1",
    -    "mocha": "^5.2.0"
    -  },
    -  "overrides": {
    -    "graceful-fs": "^4.2.11"
    -  }
    -}
    \ No newline at end of file
    diff --git a/.output/server/node_modules/sprintf-js/src/sprintf.js b/.output/server/node_modules/sprintf-js/src/sprintf.js
    deleted file mode 100644
    index 65d6324..0000000
    --- a/.output/server/node_modules/sprintf-js/src/sprintf.js
    +++ /dev/null
    @@ -1,231 +0,0 @@
    -/* global window, exports, define */
    -
    -!function() {
    -    'use strict'
    -
    -    var re = {
    -        not_string: /[^s]/,
    -        not_bool: /[^t]/,
    -        not_type: /[^T]/,
    -        not_primitive: /[^v]/,
    -        number: /[diefg]/,
    -        numeric_arg: /[bcdiefguxX]/,
    -        json: /[j]/,
    -        not_json: /[^j]/,
    -        text: /^[^\x25]+/,
    -        modulo: /^\x25{2}/,
    -        placeholder: /^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,
    -        key: /^([a-z_][a-z_\d]*)/i,
    -        key_access: /^\.([a-z_][a-z_\d]*)/i,
    -        index_access: /^\[(\d+)\]/,
    -        sign: /^[+-]/
    -    }
    -
    -    function sprintf(key) {
    -        // `arguments` is not an array, but should be fine for this call
    -        return sprintf_format(sprintf_parse(key), arguments)
    -    }
    -
    -    function vsprintf(fmt, argv) {
    -        return sprintf.apply(null, [fmt].concat(argv || []))
    -    }
    -
    -    function sprintf_format(parse_tree, argv) {
    -        var cursor = 1, tree_length = parse_tree.length, arg, output = '', i, k, ph, pad, pad_character, pad_length, is_positive, sign
    -        for (i = 0; i < tree_length; i++) {
    -            if (typeof parse_tree[i] === 'string') {
    -                output += parse_tree[i]
    -            }
    -            else if (typeof parse_tree[i] === 'object') {
    -                ph = parse_tree[i] // convenience purposes only
    -                if (ph.keys) { // keyword argument
    -                    arg = argv[cursor]
    -                    for (k = 0; k < ph.keys.length; k++) {
    -                        if (arg == undefined) {
    -                            throw new Error(sprintf('[sprintf] Cannot access property "%s" of undefined value "%s"', ph.keys[k], ph.keys[k-1]))
    -                        }
    -                        arg = arg[ph.keys[k]]
    -                    }
    -                }
    -                else if (ph.param_no) { // positional argument (explicit)
    -                    arg = argv[ph.param_no]
    -                }
    -                else { // positional argument (implicit)
    -                    arg = argv[cursor++]
    -                }
    -
    -                if (re.not_type.test(ph.type) && re.not_primitive.test(ph.type) && arg instanceof Function) {
    -                    arg = arg()
    -                }
    -
    -                if (re.numeric_arg.test(ph.type) && (typeof arg !== 'number' && isNaN(arg))) {
    -                    throw new TypeError(sprintf('[sprintf] expecting number but found %T', arg))
    -                }
    -
    -                if (re.number.test(ph.type)) {
    -                    is_positive = arg >= 0
    -                }
    -
    -                switch (ph.type) {
    -                    case 'b':
    -                        arg = parseInt(arg, 10).toString(2)
    -                        break
    -                    case 'c':
    -                        arg = String.fromCharCode(parseInt(arg, 10))
    -                        break
    -                    case 'd':
    -                    case 'i':
    -                        arg = parseInt(arg, 10)
    -                        break
    -                    case 'j':
    -                        arg = JSON.stringify(arg, null, ph.width ? parseInt(ph.width) : 0)
    -                        break
    -                    case 'e':
    -                        arg = ph.precision ? parseFloat(arg).toExponential(ph.precision) : parseFloat(arg).toExponential()
    -                        break
    -                    case 'f':
    -                        arg = ph.precision ? parseFloat(arg).toFixed(ph.precision) : parseFloat(arg)
    -                        break
    -                    case 'g':
    -                        arg = ph.precision ? String(Number(arg.toPrecision(ph.precision))) : parseFloat(arg)
    -                        break
    -                    case 'o':
    -                        arg = (parseInt(arg, 10) >>> 0).toString(8)
    -                        break
    -                    case 's':
    -                        arg = String(arg)
    -                        arg = (ph.precision ? arg.substring(0, ph.precision) : arg)
    -                        break
    -                    case 't':
    -                        arg = String(!!arg)
    -                        arg = (ph.precision ? arg.substring(0, ph.precision) : arg)
    -                        break
    -                    case 'T':
    -                        arg = Object.prototype.toString.call(arg).slice(8, -1).toLowerCase()
    -                        arg = (ph.precision ? arg.substring(0, ph.precision) : arg)
    -                        break
    -                    case 'u':
    -                        arg = parseInt(arg, 10) >>> 0
    -                        break
    -                    case 'v':
    -                        arg = arg.valueOf()
    -                        arg = (ph.precision ? arg.substring(0, ph.precision) : arg)
    -                        break
    -                    case 'x':
    -                        arg = (parseInt(arg, 10) >>> 0).toString(16)
    -                        break
    -                    case 'X':
    -                        arg = (parseInt(arg, 10) >>> 0).toString(16).toUpperCase()
    -                        break
    -                }
    -                if (re.json.test(ph.type)) {
    -                    output += arg
    -                }
    -                else {
    -                    if (re.number.test(ph.type) && (!is_positive || ph.sign)) {
    -                        sign = is_positive ? '+' : '-'
    -                        arg = arg.toString().replace(re.sign, '')
    -                    }
    -                    else {
    -                        sign = ''
    -                    }
    -                    pad_character = ph.pad_char ? ph.pad_char === '0' ? '0' : ph.pad_char.charAt(1) : ' '
    -                    pad_length = ph.width - (sign + arg).length
    -                    pad = ph.width ? (pad_length > 0 ? pad_character.repeat(pad_length) : '') : ''
    -                    output += ph.align ? sign + arg + pad : (pad_character === '0' ? sign + pad + arg : pad + sign + arg)
    -                }
    -            }
    -        }
    -        return output
    -    }
    -
    -    var sprintf_cache = Object.create(null)
    -
    -    function sprintf_parse(fmt) {
    -        if (sprintf_cache[fmt]) {
    -            return sprintf_cache[fmt]
    -        }
    -
    -        var _fmt = fmt, match, parse_tree = [], arg_names = 0
    -        while (_fmt) {
    -            if ((match = re.text.exec(_fmt)) !== null) {
    -                parse_tree.push(match[0])
    -            }
    -            else if ((match = re.modulo.exec(_fmt)) !== null) {
    -                parse_tree.push('%')
    -            }
    -            else if ((match = re.placeholder.exec(_fmt)) !== null) {
    -                if (match[2]) {
    -                    arg_names |= 1
    -                    var field_list = [], replacement_field = match[2], field_match = []
    -                    if ((field_match = re.key.exec(replacement_field)) !== null) {
    -                        field_list.push(field_match[1])
    -                        while ((replacement_field = replacement_field.substring(field_match[0].length)) !== '') {
    -                            if ((field_match = re.key_access.exec(replacement_field)) !== null) {
    -                                field_list.push(field_match[1])
    -                            }
    -                            else if ((field_match = re.index_access.exec(replacement_field)) !== null) {
    -                                field_list.push(field_match[1])
    -                            }
    -                            else {
    -                                throw new SyntaxError('[sprintf] failed to parse named argument key')
    -                            }
    -                        }
    -                    }
    -                    else {
    -                        throw new SyntaxError('[sprintf] failed to parse named argument key')
    -                    }
    -                    match[2] = field_list
    -                }
    -                else {
    -                    arg_names |= 2
    -                }
    -                if (arg_names === 3) {
    -                    throw new Error('[sprintf] mixing positional and named placeholders is not (yet) supported')
    -                }
    -
    -                parse_tree.push(
    -                    {
    -                        placeholder: match[0],
    -                        param_no:    match[1],
    -                        keys:        match[2],
    -                        sign:        match[3],
    -                        pad_char:    match[4],
    -                        align:       match[5],
    -                        width:       match[6],
    -                        precision:   match[7],
    -                        type:        match[8]
    -                    }
    -                )
    -            }
    -            else {
    -                throw new SyntaxError('[sprintf] unexpected placeholder')
    -            }
    -            _fmt = _fmt.substring(match[0].length)
    -        }
    -        return sprintf_cache[fmt] = parse_tree
    -    }
    -
    -    /**
    -     * export to either browser or node.js
    -     */
    -    /* eslint-disable quote-props */
    -    if (typeof exports !== 'undefined') {
    -        exports['sprintf'] = sprintf
    -        exports['vsprintf'] = vsprintf
    -    }
    -    if (typeof window !== 'undefined') {
    -        window['sprintf'] = sprintf
    -        window['vsprintf'] = vsprintf
    -
    -        if (typeof define === 'function' && define['amd']) {
    -            define(function() {
    -                return {
    -                    'sprintf': sprintf,
    -                    'vsprintf': vsprintf
    -                }
    -            })
    -        }
    -    }
    -    /* eslint-enable quote-props */
    -}(); // eslint-disable-line
    diff --git a/.output/server/node_modules/sql.js/dist/sql-wasm.js b/.output/server/node_modules/sql.js/dist/sql-wasm.js
    deleted file mode 100644
    index 7695c3f..0000000
    --- a/.output/server/node_modules/sql.js/dist/sql-wasm.js
    +++ /dev/null
    @@ -1,185 +0,0 @@
    -
    -// We are modularizing this manually because the current modularize setting in Emscripten has some issues:
    -// https://github.com/kripken/emscripten/issues/5820
    -// In addition, When you use emcc's modularization, it still expects to export a global object called `Module`,
    -// which is able to be used/called before the WASM is loaded.
    -// The modularization below exports a promise that loads and resolves to the actual sql.js module.
    -// That way, this module can't be used before the WASM is finished loading.
    -
    -// We are going to define a function that a user will call to start loading initializing our Sql.js library
    -// However, that function might be called multiple times, and on subsequent calls, we don't actually want it to instantiate a new instance of the Module
    -// Instead, we want to return the previously loaded module
    -
    -// TODO: Make this not declare a global if used in the browser
    -var initSqlJsPromise = undefined;
    -
    -var initSqlJs = function (moduleConfig) {
    -
    -    if (initSqlJsPromise){
    -      return initSqlJsPromise;
    -    }
    -    // If we're here, we've never called this function before
    -    initSqlJsPromise = new Promise(function (resolveModule, reject) {
    -
    -        // We are modularizing this manually because the current modularize setting in Emscripten has some issues:
    -        // https://github.com/kripken/emscripten/issues/5820
    -
    -        // The way to affect the loading of emcc compiled modules is to create a variable called `Module` and add
    -        // properties to it, like `preRun`, `postRun`, etc
    -        // We are using that to get notified when the WASM has finished loading.
    -        // Only then will we return our promise
    -
    -        // If they passed in a moduleConfig object, use that
    -        // Otherwise, initialize Module to the empty object
    -        var Module = typeof moduleConfig !== 'undefined' ? moduleConfig : {};
    -
    -        // EMCC only allows for a single onAbort function (not an array of functions)
    -        // So if the user defined their own onAbort function, we remember it and call it
    -        var originalOnAbortFunction = Module['onAbort'];
    -        Module['onAbort'] = function (errorThatCausedAbort) {
    -            reject(new Error(errorThatCausedAbort));
    -            if (originalOnAbortFunction){
    -              originalOnAbortFunction(errorThatCausedAbort);
    -            }
    -        };
    -
    -        Module['postRun'] = Module['postRun'] || [];
    -        Module['postRun'].push(function () {
    -            // When Emscripted calls postRun, this promise resolves with the built Module
    -            resolveModule(Module);
    -        });
    -
    -        // There is a section of code in the emcc-generated code below that looks like this:
    -        // (Note that this is lowercase `module`)
    -        // if (typeof module !== 'undefined') {
    -        //     module['exports'] = Module;
    -        // }
    -        // When that runs, it's going to overwrite our own modularization export efforts in shell-post.js!
    -        // The only way to tell emcc not to emit it is to pass the MODULARIZE=1 or MODULARIZE_INSTANCE=1 flags,
    -        // but that carries with it additional unnecessary baggage/bugs we don't want either.
    -        // So, we have three options:
    -        // 1) We undefine `module`
    -        // 2) We remember what `module['exports']` was at the beginning of this function and we restore it later
    -        // 3) We write a script to remove those lines of code as part of the Make process.
    -        //
    -        // Since those are the only lines of code that care about module, we will undefine it. It's the most straightforward
    -        // of the options, and has the side effect of reducing emcc's efforts to modify the module if its output were to change in the future.
    -        // That's a nice side effect since we're handling the modularization efforts ourselves
    -        module = undefined;
    -
    -        // The emcc-generated code and shell-post.js code goes below,
    -        // meaning that all of it runs inside of this promise. If anything throws an exception, our promise will abort
    -var k;k||=typeof Module != 'undefined' ? Module : {};var aa=!!globalThis.window,ba=!!globalThis.WorkerGlobalScope,ca=globalThis.process?.versions?.node&&"renderer"!=globalThis.process?.type;
    -k.onRuntimeInitialized=function(){function a(f,l){switch(typeof l){case "boolean":bc(f,l?1:0);break;case "number":cc(f,l);break;case "string":dc(f,l,-1,-1);break;case "object":if(null===l)lb(f);else if(null!=l.length){var n=da(l.length);m.set(l,n);ec(f,n,l.length,-1);ea(n)}else sa(f,"Wrong API use : tried to return a value of an unknown type ("+l+").",-1);break;default:lb(f)}}function b(f,l){for(var n=[],p=0;p>>0);if(null!=f){var l=this.filename,n="/",p=l;n&&(n="string"==typeof n?n:ha(n),p=l?ia(n+"/"+l):n);l=ja(!0,!0);p=ka(p,
    -l);if(f){if("string"==typeof f){n=Array(f.length);for(var u=0,v=f.length;uNumber.MAX_SAFE_INTEGER)throw"rowId too big to fit inside a Number";f(l,p,u,Number(v))},"viiiij");vb(this.db,this.Za,0);return this};c.prototype.bind=c.prototype.bind;c.prototype.step=c.prototype.step;c.prototype.get=c.prototype.get;c.prototype.getColumnNames=c.prototype.qb;c.prototype.getAsObject=c.prototype.zb;c.prototype.getSQL=c.prototype.Sb;c.prototype.getNormalizedSQL=c.prototype.Pb;c.prototype.run=c.prototype.run;c.prototype.reset=c.prototype.reset;c.prototype.freemem=
    -c.prototype.freemem;c.prototype.free=c.prototype.Ya;d.prototype.next=d.prototype.next;d.prototype.getRemainingSQL=d.prototype.Qb;e.prototype.run=e.prototype.run;e.prototype.exec=e.prototype.exec;e.prototype.each=e.prototype.Mb;e.prototype.prepare=e.prototype.tb;e.prototype.iterateStatements=e.prototype.Ub;e.prototype["export"]=e.prototype.Nb;e.prototype.close=e.prototype.close;e.prototype.handleError=e.prototype.handleError;e.prototype.getRowsModified=e.prototype.Rb;e.prototype.create_function=e.prototype.Kb;
    -e.prototype.create_aggregate=e.prototype.Jb;e.prototype.updateHook=e.prototype.Zb;k.Database=e};var wa="./this.program",xa=(a,b)=>{throw b;},ya=globalThis.document?.currentScript?.src;"undefined"!=typeof __filename?ya=__filename:ba&&(ya=self.location.href);var za="",Aa,Ba;
    -if(ca){var fs=require("node:fs");za=__dirname+"/";Ba=a=>{a=Ca(a)?new URL(a):a;return fs.readFileSync(a)};Aa=async a=>{a=Ca(a)?new URL(a):a;return fs.readFileSync(a,void 0)};1{process.exitCode=a;throw b;}}else if(aa||ba){try{za=(new URL(".",ya)).href}catch{}ba&&(Ba=a=>{var b=new XMLHttpRequest;b.open("GET",a,!1);b.responseType="arraybuffer";b.send(null);return new Uint8Array(b.response)});
    -Aa=async a=>{if(Ca(a))return new Promise((c,d)=>{var e=new XMLHttpRequest;e.open("GET",a,!0);e.responseType="arraybuffer";e.onload=()=>{200==e.status||0==e.status&&e.response?c(e.response):d(e.status)};e.onerror=d;e.send(null)});var b=await fetch(a,{credentials:"same-origin"});if(b.ok)return b.arrayBuffer();throw Error(b.status+" : "+b.url);}}var Da=console.log.bind(console),B=console.error.bind(console),Ea,Fa=!1,Ga,Ca=a=>a.startsWith("file://"),m,C,Ha,E,F,Ia,Ja,G;
    -function Ka(){var a=La.buffer;m=new Int8Array(a);Ha=new Int16Array(a);C=new Uint8Array(a);new Uint16Array(a);E=new Int32Array(a);F=new Uint32Array(a);Ia=new Float32Array(a);Ja=new Float64Array(a);G=new BigInt64Array(a);new BigUint64Array(a)}function Ma(a){k.onAbort?.(a);a="Aborted("+a+")";B(a);Fa=!0;throw new WebAssembly.RuntimeError(a+". Build with -sASSERTIONS for more info.");}var Na;
    -async function Oa(a){if(!Ea)try{var b=await Aa(a);return new Uint8Array(b)}catch{}if(a==Na&&Ea)a=new Uint8Array(Ea);else if(Ba)a=Ba(a);else throw"both async and sync fetching of the wasm failed";return a}async function Qa(a,b){try{var c=await Oa(a);return await WebAssembly.instantiate(c,b)}catch(d){B(`failed to asynchronously prepare wasm: ${d}`),Ma(d)}}
    -async function Ra(a){var b=Na;if(!Ea&&!Ca(b)&&!ca)try{var c=fetch(b,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(c,a)}catch(d){B(`wasm streaming compile failed: ${d}`),B("falling back to ArrayBuffer instantiation")}return Qa(b,a)}class Sa{name="ExitStatus";constructor(a){this.message=`Program terminated with exit(${a})`;this.status=a}}var Ta=a=>{for(;0{var a=k.preRun.shift();Va.push(a)},J=0,Xa=null;
    -function r(a,b="i8"){b.endsWith("*")&&(b="*");switch(b){case "i1":return m[a];case "i8":return m[a];case "i16":return Ha[a>>1];case "i32":return E[a>>2];case "i64":return G[a>>3];case "float":return Ia[a>>2];case "double":return Ja[a>>3];case "*":return F[a>>2];default:Ma(`invalid type for getValue: ${b}`)}}var Ya=!0;
    -function qa(a){var b="i32";b.endsWith("*")&&(b="*");switch(b){case "i1":m[a]=0;break;case "i8":m[a]=0;break;case "i16":Ha[a>>1]=0;break;case "i32":E[a>>2]=0;break;case "i64":G[a>>3]=BigInt(0);break;case "float":Ia[a>>2]=0;break;case "double":Ja[a>>3]=0;break;case "*":F[a>>2]=0;break;default:Ma(`invalid type for setValue: ${b}`)}}
    -var Za=new TextDecoder,$a=(a,b,c,d)=>{c=b+c;if(d)return c;for(;a[b]&&!(b>=c);)++b;return b},z=(a,b,c)=>a?Za.decode(C.subarray(a,$a(C,a,b,c))):"",ab=(a,b)=>{for(var c=0,d=a.length-1;0<=d;d--){var e=a[d];"."===e?a.splice(d,1):".."===e?(a.splice(d,1),c++):c&&(a.splice(d,1),c--)}if(b)for(;c;c--)a.unshift("..");return a},ia=a=>{var b="/"===a.charAt(0),c="/"===a.slice(-1);(a=ab(a.split("/").filter(d=>!!d),!b).join("/"))||b||(a=".");a&&c&&(a+="/");return(b?"/":"")+a},bb=a=>{var b=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(a).slice(1);
    -a=b[0];b=b[1];if(!a&&!b)return".";b&&=b.slice(0,-1);return a+b},cb=a=>a&&a.match(/([^\/]+|\/)\/*$/)[1],db=()=>{if(ca){var a=require("node:crypto");return b=>a.randomFillSync(b)}return b=>crypto.getRandomValues(b)},eb=a=>{(eb=db())(a)},fb=(...a)=>{for(var b="",c=!1,d=a.length-1;-1<=d&&!c;d--){c=0<=d?a[d]:"/";if("string"!=typeof c)throw new TypeError("Arguments to path.resolve must be strings");if(!c)return"";b=c+"/"+b;c="/"===c.charAt(0)}b=ab(b.split("/").filter(e=>!!e),!c).join("/");return(c?"/":
    -"")+b||"."},gb=a=>{var b=$a(a,0);return Za.decode(a.buffer?a.subarray(0,b):new Uint8Array(a.slice(0,b)))},hb=[],ib=a=>{for(var b=0,c=0;c=d?b++:2047>=d?b+=2:55296<=d&&57343>=d?(b+=4,++c):b+=3}return b},M=(a,b,c,d)=>{if(!(0=h){if(c>=d)break;b[c++]=h}else if(2047>=h){if(c+1>=d)break;b[c++]=192|h>>6;b[c++]=128|h&63}else if(65535>=h){if(c+2>=d)break;b[c++]=224|h>>12;b[c++]=128|
    -h>>6&63;b[c++]=128|h&63}else{if(c+3>=d)break;b[c++]=240|h>>18;b[c++]=128|h>>12&63;b[c++]=128|h>>6&63;b[c++]=128|h&63;g++}}b[c]=0;return c-e},jb=[];function kb(a,b){jb[a]={input:[],output:[],eb:b};mb(a,nb)}
    -var nb={open(a){var b=jb[a.node.rdev];if(!b)throw new N(43);a.tty=b;a.seekable=!1},close(a){a.tty.eb.fsync(a.tty)},fsync(a){a.tty.eb.fsync(a.tty)},read(a,b,c,d){if(!a.tty||!a.tty.eb.Bb)throw new N(60);for(var e=0,g=0;g=a.node.Ra)return 0;a=Math.min(a.node.Ra-e,d);if(8=g||(g=Math.max(g,h*(1048576>h?2:1.125)>>>0),0!=h&&(g=Math.max(g,256)),h=a.Na,a.Na=new Uint8Array(g),0b)throw new N(28);
    -return b},jb(a,b,c,d,e){if(32768!==(a.node.mode&61440))throw new N(43);a=a.node.Na;if(e&2||!a||a.buffer!==m.buffer){e=!0;d=65536*Math.ceil(b/65536);var g=Bb(65536,d);g&&C.fill(0,g,g+d);d=g;if(!d)throw new N(48);if(a){if(0{var c=0;a&&(c|=365);b&&(c|=146);return c},Cb=null,Db={},Eb=[],Fb=1,R=null,Gb=!1,
    -Hb=!0,N=class{name="ErrnoError";constructor(a){this.Pa=a}},Ib=class{hb={};node=null;get flags(){return this.hb.flags}set flags(a){this.hb.flags=a}get position(){return this.hb.position}set position(a){this.hb.position=a}},Jb=class{La={};Ma={};bb=null;constructor(a,b,c,d){a||=this;this.parent=a;this.Xa=a.Xa;this.id=Fb++;this.name=b;this.mode=c;this.rdev=d;this.atime=this.mtime=this.ctime=Date.now()}get read(){return 365===(this.mode&365)}set read(a){a?this.mode|=365:this.mode&=-366}get write(){return 146===
    -(this.mode&146)}set write(a){a?this.mode|=146:this.mode&=-147}};
    -function S(a,b={}){if(!a)throw new N(44);b.pb??(b.pb=!0);"/"===a.charAt(0)||(a="//"+a);var c=0;a:for(;40>c;c++){a=a.split("/").filter(q=>!!q);for(var d=Cb,e="/",g=0;g>>0)%R.length}
    -function Ab(a){var b=Kb(a.parent.id,a.name);if(R[b]===a)R[b]=a.cb;else for(b=R[b];b;){if(b.cb===a){b.cb=a.cb;break}b=b.cb}}function Q(a,b){var c=P(a.mode)?(c=Lb(a,"x"))?c:a.La.lookup?0:2:54;if(c)throw new N(c);for(c=R[Kb(a.id,b)];c;c=c.cb){var d=c.name;if(c.parent.id===a.id&&d===b)return c}return a.La.lookup(a,b)}function zb(a,b,c,d){a=new Jb(a,b,c,d);b=Kb(a.parent.id,a.name);a.cb=R[b];return R[b]=a}function P(a){return 16384===(a&61440)}
    -function Lb(a,b){return Hb?0:b.includes("r")&&!(a.mode&292)||b.includes("w")&&!(a.mode&146)||b.includes("x")&&!(a.mode&73)?2:0}function Mb(a,b){if(!P(a.mode))return 54;try{return Q(a,b),20}catch(c){}return Lb(a,"wx")}function Nb(a,b,c){try{var d=Q(a,b)}catch(e){return e.Pa}if(a=Lb(a,"wx"))return a;if(c){if(!P(d.mode))return 54;if(d===d.parent||"/"===ha(d))return 10}else if(P(d.mode))return 31;return 0}function Ob(a){if(!a)throw new N(63);return a}
    -function T(a){a=Eb[a];if(!a)throw new N(8);return a}function Pb(a,b=-1){a=Object.assign(new Ib,a);if(-1==b)a:{for(b=0;4096>=b;b++)if(!Eb[b])break a;throw new N(33);}a.fd=b;return Eb[b]=a}function Qb(a,b=-1){a=Pb(a,b);a.Ma?.ec?.(a);return a}function Rb(a,b,c){var d=a?.Ma.Ua;a=d?a:b;d??=b.La.Ua;Ob(d);d(a,c)}var yb={open(a){a.Ma=Db[a.node.rdev].Ma;a.Ma.open?.(a)},Va(){throw new N(70);}};function mb(a,b){Db[a]={Ma:b}}
    -function Sb(a,b){var c="/"===b;if(c&&Cb)throw new N(10);if(!c&&b){var d=S(b,{pb:!1});b=d.path;d=d.node;if(d.bb)throw new N(10);if(!P(d.mode))throw new N(54);}b={type:a,kc:{},Db:b,Vb:[]};a=a.Xa(b);a.Xa=b;b.root=a;c?Cb=a:d&&(d.bb=b,d.Xa&&d.Xa.Vb.push(b))}function Tb(a,b,c){var d=S(a,{parent:!0}).node;a=cb(a);if(!a)throw new N(28);if("."===a||".."===a)throw new N(20);var e=Mb(d,a);if(e)throw new N(e);if(!d.La.ib)throw new N(63);return d.La.ib(d,a,b,c)}
    -function ka(a,b=438){return Tb(a,b&4095|32768,0)}function U(a,b=511){return Tb(a,b&1023|16384,0)}function Ub(a,b,c){"undefined"==typeof c&&(c=b,b=438);Tb(a,b|8192,c)}function Vb(a,b){if(!fb(a))throw new N(44);var c=S(b,{parent:!0}).node;if(!c)throw new N(44);b=cb(b);var d=Mb(c,b);if(d)throw new N(d);if(!c.La.symlink)throw new N(63);c.La.symlink(c,b,a)}
    -function Wb(a){var b=S(a,{parent:!0}).node;a=cb(a);var c=Q(b,a),d=Nb(b,a,!0);if(d)throw new N(d);if(!b.La.rmdir)throw new N(63);if(c.bb)throw new N(10);b.La.rmdir(b,a);Ab(c)}function ua(a){var b=S(a,{parent:!0}).node;if(!b)throw new N(44);a=cb(a);var c=Q(b,a),d=Nb(b,a,!1);if(d)throw new N(d);if(!b.La.unlink)throw new N(63);if(c.bb)throw new N(10);b.La.unlink(b,a);Ab(c)}function Xb(a,b){a=S(a,{ab:!b}).node;return Ob(a.La.Ta)(a)}
    -function Yb(a,b,c,d){Rb(a,b,{mode:c&4095|b.mode&-4096,ctime:Date.now(),Lb:d})}function la(a,b){a="string"==typeof a?S(a,{ab:!0}).node:a;Yb(null,a,b)}function Zb(a,b,c){if(P(b.mode))throw new N(31);if(32768!==(b.mode&61440))throw new N(28);var d=Lb(b,"w");if(d)throw new N(d);Rb(a,b,{size:c,timestamp:Date.now()})}
    -function ma(a,b,c=438){if(""===a)throw new N(44);if("string"==typeof b){var d={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[b];if("undefined"==typeof d)throw Error(`Unknown file open mode: ${b}`);b=d}c=b&64?c&4095|32768:0;if("object"==typeof a)d=a;else{var e=a.endsWith("/");var g=S(a,{ab:!(b&131072),Wb:!0});d=g.node;a=g.path}g=!1;if(b&64)if(d){if(b&128)throw new N(20);}else{if(e)throw new N(31);d=Tb(a,c|511,0);g=!0}if(!d)throw new N(44);8192===(d.mode&61440)&&(b&=-513);if(b&65536&&!P(d.mode))throw new N(54);
    -if(!g&&(d?40960===(d.mode&61440)?e=32:(e=["r","w","rw"][b&3],b&512&&(e+="w"),e=P(d.mode)&&("r"!==e||b&576)?31:Lb(d,e)):e=44,e))throw new N(e);b&512&&!g&&(e=d,e="string"==typeof e?S(e,{ab:!0}).node:e,Zb(null,e,0));b=Pb({node:d,path:ha(d),flags:b&-131713,seekable:!0,position:0,Ma:d.Ma,Yb:[],error:!1});b.Ma.open&&b.Ma.open(b);g&&la(d,c&511);return b}function oa(a){if(null===a.fd)throw new N(8);a.rb&&(a.rb=null);try{a.Ma.close&&a.Ma.close(a)}catch(b){throw b;}finally{Eb[a.fd]=null}a.fd=null}
    -function $b(a,b,c){if(null===a.fd)throw new N(8);if(!a.seekable||!a.Ma.Va)throw new N(70);if(0!=c&&1!=c&&2!=c)throw new N(28);a.position=a.Ma.Va(a,b,c);a.Yb=[]}function ac(a,b,c,d,e){if(0>d||0>e)throw new N(28);if(null===a.fd)throw new N(8);if(1===(a.flags&2097155))throw new N(8);if(P(a.node.mode))throw new N(31);if(!a.Ma.read)throw new N(28);var g="undefined"!=typeof e;if(!g)e=a.position;else if(!a.seekable)throw new N(70);b=a.Ma.read(a,b,c,d,e);g||(a.position+=b);return b}
    -function na(a,b,c,d,e){if(0>d||0>e)throw new N(28);if(null===a.fd)throw new N(8);if(0===(a.flags&2097155))throw new N(8);if(P(a.node.mode))throw new N(31);if(!a.Ma.write)throw new N(28);a.seekable&&a.flags&1024&&$b(a,0,2);var g="undefined"!=typeof e;if(!g)e=a.position;else if(!a.seekable)throw new N(70);b=a.Ma.write(a,b,c,d,e,void 0);g||(a.position+=b);return b}
    -function ta(a){var b=b||0;var c="binary";"utf8"!==c&&"binary"!==c&&Ma(`Invalid encoding type "${c}"`);b=ma(a,b);a=Xb(a).size;var d=new Uint8Array(a);ac(b,d,0,a,0);"utf8"===c&&(d=gb(d));oa(b);return d}
    -function W(a,b,c){a=ia("/dev/"+a);var d=ja(!!b,!!c);W.Cb??(W.Cb=64);var e=W.Cb++<<8|0;mb(e,{open(g){g.seekable=!1},close(){c?.buffer?.length&&c(10)},read(g,h,q,w){for(var t=0,x=0;x>2]=b.dev;F[a+4>>2]=b.mode;F[a+8>>2]=b.nlink;F[a+12>>2]=b.uid;F[a+16>>2]=b.gid;F[a+20>>2]=b.rdev;G[a+24>>3]=BigInt(b.size);E[a+32>>2]=4096;E[a+36>>2]=b.blocks;var c=b.atime.getTime(),d=b.mtime.getTime(),e=b.ctime.getTime();G[a+40>>3]=BigInt(Math.floor(c/1E3));F[a+48>>2]=c%1E3*1E6;G[a+56>>3]=BigInt(Math.floor(d/1E3));F[a+64>>2]=d%1E3*1E6;G[a+72>>3]=BigInt(Math.floor(e/1E3));F[a+80>>2]=e%1E3*1E6;G[a+88>>3]=BigInt(b.ino);return 0}
    -var Cc=void 0,Ec=()=>{var a=E[+Cc>>2];Cc+=4;return a},Fc=0,Gc=[0,31,60,91,121,152,182,213,244,274,305,335],Hc=[0,31,59,90,120,151,181,212,243,273,304,334],Ic={},Jc=a=>{Ga=a;Ya||0{if(!Fa)try{a()}catch(b){b instanceof Sa||"unwind"==b||xa(1,b)}finally{if(!(Ya||0{if(!Mc){var a={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(globalThis.navigator?.language??
    -"C").replace("-","_")+".UTF-8",_:wa||"./this.program"},b;for(b in Lc)void 0===Lc[b]?delete a[b]:a[b]=Lc[b];var c=[];for(b in a)c.push(`${b}=${a[b]}`);Mc=c}return Mc},Mc,Oc=(a,b,c,d)=>{var e={string:t=>{var x=0;if(null!==t&&void 0!==t&&0!==t){x=ib(t)+1;var D=y(x);M(t,C,D,x);x=D}return x},array:t=>{var x=y(t.length);m.set(t,x);return x}};a=k["_"+a];var g=[],h=0;if(d)for(var q=0;q{var b=ib(a)+1,c=da(b);c&&M(a,C,c,b);return c},Pc,Qc=[],A=a=>{Pc.delete(Z.get(a));Z.set(a,null);Qc.push(a)},Rc=a=>{const b=a.length;return[b%128|128,b>>7,...a]},Sc={i:127,p:127,j:126,f:125,d:124,e:111},Tc=a=>Rc(Array.from(a,b=>Sc[b])),va=(a,b)=>{if(!Pc){Pc=new WeakMap;var c=Z.length;if(Pc)for(var d=0;d<0+c;d++){var e=Z.get(d);e&&Pc.set(e,d)}}if(c=Pc.get(a)||0)return c;c=Qc.length?Qc.pop():Z.grow(1);try{Z.set(c,a)}catch(g){if(!(g instanceof TypeError))throw g;
    -b=Uint8Array.of(0,97,115,109,1,0,0,0,1,...Rc([1,96,...Tc(b.slice(1)),...Tc("v"===b[0]?"":b[0])]),2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0);b=new WebAssembly.Module(b);b=(new WebAssembly.Instance(b,{e:{f:a}})).exports.f;Z.set(c,b)}Pc.set(a,c);return c};R=Array(4096);Sb(O,"/");U("/tmp");U("/home");U("/home/web_user");
    -(function(){U("/dev");mb(259,{read:()=>0,write:(d,e,g,h)=>h,Va:()=>0});Ub("/dev/null",259);kb(1280,wb);kb(1536,xb);Ub("/dev/tty",1280);Ub("/dev/tty1",1536);var a=new Uint8Array(1024),b=0,c=()=>{0===b&&(eb(a),b=a.byteLength);return a[--b]};W("random",c);W("urandom",c);U("/dev/shm");U("/dev/shm/tmp")})();
    -(function(){U("/proc");var a=U("/proc/self");U("/proc/self/fd");Sb({Xa(){var b=zb(a,"fd",16895,73);b.Ma={Va:O.Ma.Va};b.La={lookup(c,d){c=+d;var e=T(c);c={parent:null,Xa:{Db:"fake"},La:{readlink:()=>e.path},id:c+1};return c.parent=c},readdir(){return Array.from(Eb.entries()).filter(([,c])=>c).map(([c])=>c.toString())}};return b}},"/proc/self/fd")})();k.noExitRuntime&&(Ya=k.noExitRuntime);k.print&&(Da=k.print);k.printErr&&(B=k.printErr);k.wasmBinary&&(Ea=k.wasmBinary);k.thisProgram&&(wa=k.thisProgram);
    -if(k.preInit)for("function"==typeof k.preInit&&(k.preInit=[k.preInit]);0pa();k.stackRestore=a=>ra(a);k.stackAlloc=a=>y(a);k.cwrap=(a,b,c,d)=>{var e=!c||c.every(g=>"number"===g||"boolean"===g);return"string"!==b&&e&&!d?k["_"+a]:(...g)=>Oc(a,b,c,g)};k.addFunction=va;k.removeFunction=A;k.UTF8ToString=z;k.stringToNewUTF8=fa;k.writeArrayToMemory=(a,b)=>{m.set(a,b)};
    -var da,ea,Bb,Uc,ra,y,pa,La,Z,Vc={a:(a,b,c,d)=>Ma(`Assertion failed: ${z(a)}, at: `+[b?z(b):"unknown filename",c,d?z(d):"unknown function"]),i:function(a,b){try{return a=z(a),la(a,b),0}catch(c){if("undefined"==typeof X||"ErrnoError"!==c.name)throw c;return-c.Pa}},L:function(a,b,c){try{b=z(b);b=Y(a,b);if(c&-8)return-28;var d=S(b,{ab:!0}).node;if(!d)return-44;a="";c&4&&(a+="r");c&2&&(a+="w");c&1&&(a+="x");return a&&Lb(d,a)?-2:0}catch(e){if("undefined"==typeof X||"ErrnoError"!==e.name)throw e;return-e.Pa}},
    -j:function(a,b){try{var c=T(a);Yb(c,c.node,b,!1);return 0}catch(d){if("undefined"==typeof X||"ErrnoError"!==d.name)throw d;return-d.Pa}},h:function(a){try{var b=T(a);Rb(b,b.node,{timestamp:Date.now(),Lb:!1});return 0}catch(c){if("undefined"==typeof X||"ErrnoError"!==c.name)throw c;return-c.Pa}},b:function(a,b,c){Cc=c;try{var d=T(a);switch(b){case 0:var e=Ec();if(0>e)break;for(;Eb[e];)e++;return Qb(d,e).fd;case 1:case 2:return 0;case 3:return d.flags;case 4:return e=Ec(),d.flags|=e,0;case 12:return e=
    -Ec(),Ha[e+0>>1]=2,0;case 13:case 14:return 0}return-28}catch(g){if("undefined"==typeof X||"ErrnoError"!==g.name)throw g;return-g.Pa}},g:function(a,b){try{var c=T(a),d=c.node,e=c.Ma.Ta;a=e?c:d;e??=d.La.Ta;Ob(e);var g=e(a);return kc(b,g)}catch(h){if("undefined"==typeof X||"ErrnoError"!==h.name)throw h;return-h.Pa}},H:function(a,b){b=-9007199254740992>b||9007199254740992b||0===(c.flags&2097155))throw new N(28);Zb(c,c.node,b);return 0}catch(d){if("undefined"==
    -typeof X||"ErrnoError"!==d.name)throw d;return-d.Pa}},G:function(a,b){try{if(0===b)return-28;var c=ib("/")+1;if(b=d)return-28;var e=S(b).node;if(!e)throw new N(44);if(!e.La.readlink)throw new N(28);var g=e.La.readlink(e);var h=Math.min(d,ib(g)),q=m[c+h];M(g,
    -C,c,d+1);m[c+h]=q;return h}catch(w){if("undefined"==typeof X||"ErrnoError"!==w.name)throw w;return-w.Pa}},u:function(a){try{return a=z(a),Wb(a),0}catch(b){if("undefined"==typeof X||"ErrnoError"!==b.name)throw b;return-b.Pa}},f:function(a,b){try{return a=z(a),kc(b,Xb(a))}catch(c){if("undefined"==typeof X||"ErrnoError"!==c.name)throw c;return-c.Pa}},r:function(a,b,c){try{b=z(b);b=Y(a,b);if(c)if(512===c)Wb(b);else return-28;else ua(b);return 0}catch(d){if("undefined"==typeof X||"ErrnoError"!==d.name)throw d;
    -return-d.Pa}},q:function(a,b,c){try{b=z(b);b=Y(a,b,!0);var d=Date.now(),e,g;if(c){var h=F[c>>2]+4294967296*E[c+4>>2],q=E[c+8>>2];1073741823==q?e=d:1073741822==q?e=null:e=1E3*h+q/1E6;c+=16;h=F[c>>2]+4294967296*E[c+4>>2];q=E[c+8>>2];1073741823==q?g=d:1073741822==q?g=null:g=1E3*h+q/1E6}else g=e=d;if(null!==(g??e)){a=e;var w=S(b,{ab:!0}).node;Ob(w.La.Ua)(w,{atime:a,mtime:g})}return 0}catch(t){if("undefined"==typeof X||"ErrnoError"!==t.name)throw t;return-t.Pa}},m:()=>Ma(""),l:()=>{Ya=!1;Fc=0},A:function(a,
    -b){a=-9007199254740992>a||9007199254740992>2]=a.getSeconds();E[b+4>>2]=a.getMinutes();E[b+8>>2]=a.getHours();E[b+12>>2]=a.getDate();E[b+16>>2]=a.getMonth();E[b+20>>2]=a.getFullYear()-1900;E[b+24>>2]=a.getDay();var c=a.getFullYear();E[b+28>>2]=(0!==c%4||0===c%100&&0!==c%400?Hc:Gc)[a.getMonth()]+a.getDate()-1|0;E[b+36>>2]=-(60*a.getTimezoneOffset());c=(new Date(a.getFullYear(),6,1)).getTimezoneOffset();var d=(new Date(a.getFullYear(),0,1)).getTimezoneOffset();
    -E[b+32>>2]=(c!=d&&a.getTimezoneOffset()==Math.min(d,c))|0},y:function(a,b,c,d,e,g,h){e=-9007199254740992>e||9007199254740992>2]=w.Eb;F[h>>2]=t;return 0}catch(x){if("undefined"==typeof X||"ErrnoError"!==x.name)throw x;return-x.Pa}},z:function(a,b,c,d,e,g){g=-9007199254740992>g||
    -9007199254740992{Ic[a]&&(clearTimeout(Ic[a].id),delete Ic[a]);if(!b)return 0;var c=setTimeout(()=>{delete Ic[a];Kc(()=>Uc(a,performance.now()))},b);Ic[a]={id:c,lc:b};return 0},B:(a,b,c,d)=>{var e=(new Date).getFullYear(),g=(new Date(e,0,1)).getTimezoneOffset();
    -e=(new Date(e,6,1)).getTimezoneOffset();F[a>>2]=60*Math.max(g,e);E[b>>2]=Number(g!=e);b=h=>{var q=Math.abs(h);return`UTC${0<=h?"-":"+"}${String(Math.floor(q/60)).padStart(2,"0")}${String(q%60).padStart(2,"0")}`};a=b(g);b=b(e);eDate.now(),s:()=>2147483648,c:()=>performance.now(),o:a=>{var b=C.length;a>>>=0;if(2147483648=c;c*=2){var d=b*(1+.2/c);d=Math.min(d,a+100663296);a:{d=(Math.min(2147483648,65536*Math.ceil(Math.max(a,
    -d)/65536))-La.buffer.byteLength+65535)/65536|0;try{La.grow(d);Ka();var e=1;break a}catch(g){}e=void 0}if(e)return!0}return!1},E:(a,b)=>{var c=0,d=0,e;for(e of Nc()){var g=b+c;F[a+d>>2]=g;c+=M(e,C,g,Infinity)+1;d+=4}return 0},F:(a,b)=>{var c=Nc();F[a>>2]=c.length;a=0;for(var d of c)a+=ib(d)+1;F[b>>2]=a;return 0},e:function(a){try{var b=T(a);oa(b);return 0}catch(c){if("undefined"==typeof X||"ErrnoError"!==c.name)throw c;return c.Pa}},p:function(a,b){try{var c=T(a);m[b]=c.tty?2:P(c.mode)?3:40960===(c.mode&
    -61440)?7:4;Ha[b+2>>1]=0;G[b+8>>3]=BigInt(0);G[b+16>>3]=BigInt(0);return 0}catch(d){if("undefined"==typeof X||"ErrnoError"!==d.name)throw d;return d.Pa}},w:function(a,b,c,d){try{a:{var e=T(a);a=b;for(var g,h=b=0;h>2],w=F[a+4>>2];a+=8;var t=ac(e,m,q,w,g);if(0>t){var x=-1;break a}b+=t;if(t>2]=x;return 0}catch(D){if("undefined"==typeof X||"ErrnoError"!==D.name)throw D;return D.Pa}},D:function(a,b,c,d){b=-9007199254740992>b||9007199254740992<
    -b?NaN:Number(b);try{if(isNaN(b))return 61;var e=T(a);$b(e,b,c);G[d>>3]=BigInt(e.position);e.rb&&0===b&&0===c&&(e.rb=null);return 0}catch(g){if("undefined"==typeof X||"ErrnoError"!==g.name)throw g;return g.Pa}},I:function(a){try{var b=T(a);return b.Ma?.fsync?.(b)}catch(c){if("undefined"==typeof X||"ErrnoError"!==c.name)throw c;return c.Pa}},t:function(a,b,c,d){try{a:{var e=T(a);a=b;for(var g,h=b=0;h>2],w=F[a+4>>2];a+=8;var t=na(e,m,q,w,g);if(0>t){var x=-1;break a}b+=t;if(t>2]=x;return 0}catch(D){if("undefined"==typeof X||"ErrnoError"!==D.name)throw D;return D.Pa}},k:Jc};
    -function Wc(){function a(){k.calledRun=!0;if(!Fa){if(!k.noFSInit&&!Gb){var b,c;Gb=!0;b??=k.stdin;c??=k.stdout;d??=k.stderr;b?W("stdin",b):Vb("/dev/tty","/dev/stdin");c?W("stdout",null,c):Vb("/dev/tty","/dev/stdout");d?W("stderr",null,d):Vb("/dev/tty1","/dev/stderr");ma("/dev/stdin",0);ma("/dev/stdout",1);ma("/dev/stderr",1)}Xc.N();Hb=!1;k.onRuntimeInitialized?.();if(k.postRun)for("function"==typeof k.postRun&&(k.postRun=[k.postRun]);k.postRun.length;){var d=k.postRun.shift();Ua.push(d)}Ta(Ua)}}if(0<
    -J)Xa=Wc;else{if(k.preRun)for("function"==typeof k.preRun&&(k.preRun=[k.preRun]);k.preRun.length;)Wa();Ta(Va);0{setTimeout(()=>k.setStatus(""),1);a()},1)):a()}}var Xc;
    -(async function(){function a(c){c=Xc=c.exports;k._sqlite3_free=c.P;k._sqlite3_value_text=c.Q;k._sqlite3_prepare_v2=c.R;k._sqlite3_step=c.S;k._sqlite3_reset=c.T;k._sqlite3_exec=c.U;k._sqlite3_finalize=c.V;k._sqlite3_column_name=c.W;k._sqlite3_column_text=c.X;k._sqlite3_column_type=c.Y;k._sqlite3_errmsg=c.Z;k._sqlite3_clear_bindings=c._;k._sqlite3_value_blob=c.$;k._sqlite3_value_bytes=c.aa;k._sqlite3_value_double=c.ba;k._sqlite3_value_int=c.ca;k._sqlite3_value_type=c.da;k._sqlite3_result_blob=c.ea;
    -k._sqlite3_result_double=c.fa;k._sqlite3_result_error=c.ga;k._sqlite3_result_int=c.ha;k._sqlite3_result_int64=c.ia;k._sqlite3_result_null=c.ja;k._sqlite3_result_text=c.ka;k._sqlite3_aggregate_context=c.la;k._sqlite3_column_count=c.ma;k._sqlite3_data_count=c.na;k._sqlite3_column_blob=c.oa;k._sqlite3_column_bytes=c.pa;k._sqlite3_column_double=c.qa;k._sqlite3_bind_blob=c.ra;k._sqlite3_bind_double=c.sa;k._sqlite3_bind_int=c.ta;k._sqlite3_bind_text=c.ua;k._sqlite3_bind_parameter_index=c.va;k._sqlite3_sql=
    -c.wa;k._sqlite3_normalized_sql=c.xa;k._sqlite3_changes=c.ya;k._sqlite3_close_v2=c.za;k._sqlite3_create_function_v2=c.Aa;k._sqlite3_update_hook=c.Ba;k._sqlite3_open=c.Ca;da=k._malloc=c.Da;ea=k._free=c.Ea;k._RegisterExtensionFunctions=c.Fa;Bb=c.Ga;Uc=c.Ha;ra=c.Ia;y=c.Ja;pa=c.Ka;La=c.M;Z=c.O;Ka();J--;k.monitorRunDependencies?.(J);0==J&&Xa&&(c=Xa,Xa=null,c());return Xc}J++;k.monitorRunDependencies?.(J);var b={a:Vc};if(k.instantiateWasm)return new Promise(c=>{k.instantiateWasm(b,(d,e)=>{c(a(d,e))})});
    -Na??=k.locateFile?k.locateFile("sql-wasm.wasm",za):za+"sql-wasm.wasm";return a((await Ra(b)).instance)})();Wc();
    -
    -
    -        // The shell-pre.js and emcc-generated code goes above
    -        return Module;
    -    }); // The end of the promise being returned
    -
    -  return initSqlJsPromise;
    -} // The end of our initSqlJs function
    -
    -// This bit below is copied almost exactly from what you get when you use the MODULARIZE=1 flag with emcc
    -// However, we don't want to use the emcc modularization. See shell-pre.js
    -if (typeof exports === 'object' && typeof module === 'object'){
    -    module.exports = initSqlJs;
    -    // This will allow the module to be used in ES6 or CommonJS
    -    module.exports.default = initSqlJs;
    -}
    -else if (typeof define === 'function' && define['amd']) {
    -    define([], function() { return initSqlJs; });
    -}
    -else if (typeof exports === 'object'){
    -    exports["Module"] = initSqlJs;
    -}
    diff --git a/.output/server/node_modules/sql.js/package.json b/.output/server/node_modules/sql.js/package.json
    deleted file mode 100644
    index 1b0c795..0000000
    --- a/.output/server/node_modules/sql.js/package.json
    +++ /dev/null
    @@ -1,58 +0,0 @@
    -{
    -  "name": "sql.js",
    -  "version": "1.14.1",
    -  "description": "SQLite library with support for opening and writing databases, prepared statements, and more. This SQLite library is in pure javascript (compiled with emscripten).",
    -  "keywords": [
    -    "sql",
    -    "sqlite",
    -    "stand-alone",
    -    "relational",
    -    "database",
    -    "RDBMS",
    -    "data",
    -    "query",
    -    "statement",
    -    "emscripten",
    -    "asm",
    -    "asm.js"
    -  ],
    -  "license": "MIT",
    -  "main": "./dist/sql-wasm.js",
    -  "exports": {
    -    ".": {
    -      "browser": "./dist/sql-wasm-browser.js",
    -      "default": "./dist/sql-wasm.js"
    -    },
    -    "./dist/*": "./dist/*"
    -  },
    -  "scripts": {
    -    "build": "make",
    -    "rebuild": "npm run clean && npm run build",
    -    "clean": "make clean",
    -    "test": "npm run lint && npm run test-asm && npm run test-asm-debug && npm run test-wasm && npm run test-wasm-debug && npm run test-wasm-browser && npm run test-asm-memory-growth",
    -    "lint": "eslint .",
    -    "prettify": "eslint . --fix",
    -    "test-asm": "node --unhandled-rejections=strict test/all.js asm",
    -    "test-asm-debug": "node --unhandled-rejections=strict test/all.js asm-debug",
    -    "test-asm-memory-growth": "node --unhandled-rejections=strict test/all.js asm-memory-growth",
    -    "test-wasm": "node --unhandled-rejections=strict test/all.js wasm",
    -    "test-wasm-debug": "node --unhandled-rejections=strict test/all.js wasm-debug",
    -    "test-wasm-browser": "node --unhandled-rejections=strict test/all.js wasm-browser",
    -    "doc": "jsdoc -c .jsdoc.config.json"
    -  },
    -  "homepage": "http://github.com/sql-js/sql.js",
    -  "repository": {
    -    "type": "git",
    -    "url": "http://github.com/sql-js/sql.js.git"
    -  },
    -  "bugs": {
    -    "url": "https://github.com/sql-js/sql.js/issues"
    -  },
    -  "devDependencies": {
    -    "@eslint/js": "^10.0.0",
    -    "clean-jsdoc-theme": "^4.2.0",
    -    "eslint": "^10.0.0",
    -    "globals": "^16.4.0",
    -    "jsdoc": "^4.0.2"
    -  }
    -}
    \ No newline at end of file
    diff --git a/.output/server/node_modules/turndown/lib/turndown.cjs.js b/.output/server/node_modules/turndown/lib/turndown.cjs.js
    deleted file mode 100644
    index 8488044..0000000
    --- a/.output/server/node_modules/turndown/lib/turndown.cjs.js
    +++ /dev/null
    @@ -1,774 +0,0 @@
    -'use strict';
    -
    -function extend(destination) {
    -  for (var i = 1; i < arguments.length; i++) {
    -    var source = arguments[i];
    -    for (var key in source) {
    -      if (Object.prototype.hasOwnProperty.call(source, key)) destination[key] = source[key];
    -    }
    -  }
    -  return destination;
    -}
    -function repeat(character, count) {
    -  return Array(count + 1).join(character);
    -}
    -function trimLeadingNewlines(string) {
    -  return string.replace(/^\n*/, '');
    -}
    -function trimTrailingNewlines(string) {
    -  // avoid match-at-end regexp bottleneck, see #370
    -  var indexEnd = string.length;
    -  while (indexEnd > 0 && string[indexEnd - 1] === '\n') indexEnd--;
    -  return string.substring(0, indexEnd);
    -}
    -function trimNewlines(string) {
    -  return trimTrailingNewlines(trimLeadingNewlines(string));
    -}
    -var blockElements = ['ADDRESS', 'ARTICLE', 'ASIDE', 'AUDIO', 'BLOCKQUOTE', 'BODY', 'CANVAS', 'CENTER', 'DD', 'DIR', 'DIV', 'DL', 'DT', 'FIELDSET', 'FIGCAPTION', 'FIGURE', 'FOOTER', 'FORM', 'FRAMESET', 'H1', 'H2', 'H3', 'H4', 'H5', 'H6', 'HEADER', 'HGROUP', 'HR', 'HTML', 'ISINDEX', 'LI', 'MAIN', 'MENU', 'NAV', 'NOFRAMES', 'NOSCRIPT', 'OL', 'OUTPUT', 'P', 'PRE', 'SECTION', 'TABLE', 'TBODY', 'TD', 'TFOOT', 'TH', 'THEAD', 'TR', 'UL'];
    -function isBlock(node) {
    -  return is(node, blockElements);
    -}
    -var voidElements = ['AREA', 'BASE', 'BR', 'COL', 'COMMAND', 'EMBED', 'HR', 'IMG', 'INPUT', 'KEYGEN', 'LINK', 'META', 'PARAM', 'SOURCE', 'TRACK', 'WBR'];
    -function isVoid(node) {
    -  return is(node, voidElements);
    -}
    -function hasVoid(node) {
    -  return has(node, voidElements);
    -}
    -var meaningfulWhenBlankElements = ['A', 'TABLE', 'THEAD', 'TBODY', 'TFOOT', 'TH', 'TD', 'IFRAME', 'SCRIPT', 'AUDIO', 'VIDEO'];
    -function isMeaningfulWhenBlank(node) {
    -  return is(node, meaningfulWhenBlankElements);
    -}
    -function hasMeaningfulWhenBlank(node) {
    -  return has(node, meaningfulWhenBlankElements);
    -}
    -function is(node, tagNames) {
    -  return tagNames.indexOf(node.nodeName) >= 0;
    -}
    -function has(node, tagNames) {
    -  return node.getElementsByTagName && tagNames.some(function (tagName) {
    -    return node.getElementsByTagName(tagName).length;
    -  });
    -}
    -var markdownEscapes = [[/\\/g, '\\\\'], [/\*/g, '\\*'], [/^-/g, '\\-'], [/^\+ /g, '\\+ '], [/^(=+)/g, '\\$1'], [/^(#{1,6}) /g, '\\$1 '], [/`/g, '\\`'], [/^~~~/g, '\\~~~'], [/\[/g, '\\['], [/\]/g, '\\]'], [/^>/g, '\\>'], [/_/g, '\\_'], [/^(\d+)\. /g, '$1\\. ']];
    -function escapeMarkdown(string) {
    -  return markdownEscapes.reduce(function (accumulator, escape) {
    -    return accumulator.replace(escape[0], escape[1]);
    -  }, string);
    -}
    -
    -var rules = {};
    -rules.paragraph = {
    -  filter: 'p',
    -  replacement: function (content) {
    -    return '\n\n' + content + '\n\n';
    -  }
    -};
    -rules.lineBreak = {
    -  filter: 'br',
    -  replacement: function (content, node, options) {
    -    return options.br + '\n';
    -  }
    -};
    -rules.heading = {
    -  filter: ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'],
    -  replacement: function (content, node, options) {
    -    var hLevel = Number(node.nodeName.charAt(1));
    -    if (options.headingStyle === 'setext' && hLevel < 3) {
    -      var underline = repeat(hLevel === 1 ? '=' : '-', content.length);
    -      return '\n\n' + content + '\n' + underline + '\n\n';
    -    } else {
    -      return '\n\n' + repeat('#', hLevel) + ' ' + content + '\n\n';
    -    }
    -  }
    -};
    -rules.blockquote = {
    -  filter: 'blockquote',
    -  replacement: function (content) {
    -    content = trimNewlines(content).replace(/^/gm, '> ');
    -    return '\n\n' + content + '\n\n';
    -  }
    -};
    -rules.list = {
    -  filter: ['ul', 'ol'],
    -  replacement: function (content, node) {
    -    var parent = node.parentNode;
    -    if (parent.nodeName === 'LI' && parent.lastElementChild === node) {
    -      return '\n' + content;
    -    } else {
    -      return '\n\n' + content + '\n\n';
    -    }
    -  }
    -};
    -rules.listItem = {
    -  filter: 'li',
    -  replacement: function (content, node, options) {
    -    var prefix = options.bulletListMarker + '   ';
    -    var parent = node.parentNode;
    -    if (parent.nodeName === 'OL') {
    -      var start = parent.getAttribute('start');
    -      var index = Array.prototype.indexOf.call(parent.children, node);
    -      prefix = (start ? Number(start) + index : index + 1) + '.  ';
    -    }
    -    var isParagraph = /\n$/.test(content);
    -    content = trimNewlines(content) + (isParagraph ? '\n' : '');
    -    content = content.replace(/\n/gm, '\n' + ' '.repeat(prefix.length)); // indent
    -    return prefix + content + (node.nextSibling ? '\n' : '');
    -  }
    -};
    -rules.indentedCodeBlock = {
    -  filter: function (node, options) {
    -    return options.codeBlockStyle === 'indented' && node.nodeName === 'PRE' && node.firstChild && node.firstChild.nodeName === 'CODE';
    -  },
    -  replacement: function (content, node, options) {
    -    return '\n\n    ' + node.firstChild.textContent.replace(/\n/g, '\n    ') + '\n\n';
    -  }
    -};
    -rules.fencedCodeBlock = {
    -  filter: function (node, options) {
    -    return options.codeBlockStyle === 'fenced' && node.nodeName === 'PRE' && node.firstChild && node.firstChild.nodeName === 'CODE';
    -  },
    -  replacement: function (content, node, options) {
    -    var className = node.firstChild.getAttribute('class') || '';
    -    var language = (className.match(/language-(\S+)/) || [null, ''])[1];
    -    var code = node.firstChild.textContent;
    -    var fenceChar = options.fence.charAt(0);
    -    var fenceSize = 3;
    -    var fenceInCodeRegex = new RegExp('^' + fenceChar + '{3,}', 'gm');
    -    var match;
    -    while (match = fenceInCodeRegex.exec(code)) {
    -      if (match[0].length >= fenceSize) {
    -        fenceSize = match[0].length + 1;
    -      }
    -    }
    -    var fence = repeat(fenceChar, fenceSize);
    -    return '\n\n' + fence + language + '\n' + code.replace(/\n$/, '') + '\n' + fence + '\n\n';
    -  }
    -};
    -rules.horizontalRule = {
    -  filter: 'hr',
    -  replacement: function (content, node, options) {
    -    return '\n\n' + options.hr + '\n\n';
    -  }
    -};
    -rules.inlineLink = {
    -  filter: function (node, options) {
    -    return options.linkStyle === 'inlined' && node.nodeName === 'A' && node.getAttribute('href');
    -  },
    -  replacement: function (content, node) {
    -    var href = escapeLinkDestination(node.getAttribute('href'));
    -    var title = escapeLinkTitle(cleanAttribute(node.getAttribute('title')));
    -    var titlePart = title ? ' "' + title + '"' : '';
    -    return '[' + content + '](' + href + titlePart + ')';
    -  }
    -};
    -rules.referenceLink = {
    -  filter: function (node, options) {
    -    return options.linkStyle === 'referenced' && node.nodeName === 'A' && node.getAttribute('href');
    -  },
    -  replacement: function (content, node, options) {
    -    var href = escapeLinkDestination(node.getAttribute('href'));
    -    var title = cleanAttribute(node.getAttribute('title'));
    -    if (title) title = ' "' + escapeLinkTitle(title) + '"';
    -    var replacement;
    -    var reference;
    -    switch (options.linkReferenceStyle) {
    -      case 'collapsed':
    -        replacement = '[' + content + '][]';
    -        reference = '[' + content + ']: ' + href + title;
    -        break;
    -      case 'shortcut':
    -        replacement = '[' + content + ']';
    -        reference = '[' + content + ']: ' + href + title;
    -        break;
    -      default:
    -        var id = this.references.length + 1;
    -        replacement = '[' + content + '][' + id + ']';
    -        reference = '[' + id + ']: ' + href + title;
    -    }
    -    this.references.push(reference);
    -    return replacement;
    -  },
    -  references: [],
    -  append: function (options) {
    -    var references = '';
    -    if (this.references.length) {
    -      references = '\n\n' + this.references.join('\n') + '\n\n';
    -      this.references = []; // Reset references
    -    }
    -    return references;
    -  }
    -};
    -rules.emphasis = {
    -  filter: ['em', 'i'],
    -  replacement: function (content, node, options) {
    -    if (!content.trim()) return '';
    -    return options.emDelimiter + content + options.emDelimiter;
    -  }
    -};
    -rules.strong = {
    -  filter: ['strong', 'b'],
    -  replacement: function (content, node, options) {
    -    if (!content.trim()) return '';
    -    return options.strongDelimiter + content + options.strongDelimiter;
    -  }
    -};
    -rules.code = {
    -  filter: function (node) {
    -    var hasSiblings = node.previousSibling || node.nextSibling;
    -    var isCodeBlock = node.parentNode.nodeName === 'PRE' && !hasSiblings;
    -    return node.nodeName === 'CODE' && !isCodeBlock;
    -  },
    -  replacement: function (content) {
    -    if (!content) return '';
    -    content = content.replace(/\r?\n|\r/g, ' ');
    -    var extraSpace = /^`|^ .*?[^ ].* $|`$/.test(content) ? ' ' : '';
    -    var delimiter = '`';
    -    var matches = content.match(/`+/gm) || [];
    -    while (matches.indexOf(delimiter) !== -1) delimiter = delimiter + '`';
    -    return delimiter + extraSpace + content + extraSpace + delimiter;
    -  }
    -};
    -rules.image = {
    -  filter: 'img',
    -  replacement: function (content, node) {
    -    var alt = escapeMarkdown(cleanAttribute(node.getAttribute('alt')));
    -    var src = escapeLinkDestination(node.getAttribute('src') || '');
    -    var title = cleanAttribute(node.getAttribute('title'));
    -    var titlePart = title ? ' "' + escapeLinkTitle(title) + '"' : '';
    -    return src ? '![' + alt + ']' + '(' + src + titlePart + ')' : '';
    -  }
    -};
    -function cleanAttribute(attribute) {
    -  return attribute ? attribute.replace(/(\n+\s*)+/g, '\n') : '';
    -}
    -function escapeLinkDestination(destination) {
    -  var escaped = destination.replace(/([<>()])/g, '\\$1');
    -  return escaped.indexOf(' ') >= 0 ? '<' + escaped + '>' : escaped;
    -}
    -function escapeLinkTitle(title) {
    -  return title.replace(/"/g, '\\"');
    -}
    -
    -/**
    - * Manages a collection of rules used to convert HTML to Markdown
    - */
    -
    -function Rules(options) {
    -  this.options = options;
    -  this._keep = [];
    -  this._remove = [];
    -  this.blankRule = {
    -    replacement: options.blankReplacement
    -  };
    -  this.keepReplacement = options.keepReplacement;
    -  this.defaultRule = {
    -    replacement: options.defaultReplacement
    -  };
    -  this.array = [];
    -  for (var key in options.rules) this.array.push(options.rules[key]);
    -}
    -Rules.prototype = {
    -  add: function (key, rule) {
    -    this.array.unshift(rule);
    -  },
    -  keep: function (filter) {
    -    this._keep.unshift({
    -      filter: filter,
    -      replacement: this.keepReplacement
    -    });
    -  },
    -  remove: function (filter) {
    -    this._remove.unshift({
    -      filter: filter,
    -      replacement: function () {
    -        return '';
    -      }
    -    });
    -  },
    -  forNode: function (node) {
    -    if (node.isBlank) return this.blankRule;
    -    var rule;
    -    if (rule = findRule(this.array, node, this.options)) return rule;
    -    if (rule = findRule(this._keep, node, this.options)) return rule;
    -    if (rule = findRule(this._remove, node, this.options)) return rule;
    -    return this.defaultRule;
    -  },
    -  forEach: function (fn) {
    -    for (var i = 0; i < this.array.length; i++) fn(this.array[i], i);
    -  }
    -};
    -function findRule(rules, node, options) {
    -  for (var i = 0; i < rules.length; i++) {
    -    var rule = rules[i];
    -    if (filterValue(rule, node, options)) return rule;
    -  }
    -  return undefined;
    -}
    -function filterValue(rule, node, options) {
    -  var filter = rule.filter;
    -  if (typeof filter === 'string') {
    -    if (filter === node.nodeName.toLowerCase()) return true;
    -  } else if (Array.isArray(filter)) {
    -    if (filter.indexOf(node.nodeName.toLowerCase()) > -1) return true;
    -  } else if (typeof filter === 'function') {
    -    if (filter.call(rule, node, options)) return true;
    -  } else {
    -    throw new TypeError('`filter` needs to be a string, array, or function');
    -  }
    -}
    -
    -/**
    - * The collapseWhitespace function is adapted from collapse-whitespace
    - * by Luc Thevenard.
    - *
    - * The MIT License (MIT)
    - *
    - * Copyright (c) 2014 Luc Thevenard 
    - *
    - * Permission is hereby granted, free of charge, to any person obtaining a copy
    - * of this software and associated documentation files (the "Software"), to deal
    - * in the Software without restriction, including without limitation the rights
    - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    - * copies of the Software, and to permit persons to whom the Software is
    - * furnished to do so, subject to the following conditions:
    - *
    - * The above copyright notice and this permission notice shall be included in
    - * all copies or substantial portions of the Software.
    - *
    - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
    - * THE SOFTWARE.
    - */
    -
    -/**
    - * collapseWhitespace(options) removes extraneous whitespace from an the given element.
    - *
    - * @param {Object} options
    - */
    -function collapseWhitespace(options) {
    -  var element = options.element;
    -  var isBlock = options.isBlock;
    -  var isVoid = options.isVoid;
    -  var isPre = options.isPre || function (node) {
    -    return node.nodeName === 'PRE';
    -  };
    -  if (!element.firstChild || isPre(element)) return;
    -  var prevText = null;
    -  var keepLeadingWs = false;
    -  var prev = null;
    -  var node = next(prev, element, isPre);
    -  while (node !== element) {
    -    if (node.nodeType === 3 || node.nodeType === 4) {
    -      // Node.TEXT_NODE or Node.CDATA_SECTION_NODE
    -      var text = node.data.replace(/[ \r\n\t]+/g, ' ');
    -      if ((!prevText || / $/.test(prevText.data)) && !keepLeadingWs && text[0] === ' ') {
    -        text = text.substr(1);
    -      }
    -
    -      // `text` might be empty at this point.
    -      if (!text) {
    -        node = remove(node);
    -        continue;
    -      }
    -      node.data = text;
    -      prevText = node;
    -    } else if (node.nodeType === 1) {
    -      // Node.ELEMENT_NODE
    -      if (isBlock(node) || node.nodeName === 'BR') {
    -        if (prevText) {
    -          prevText.data = prevText.data.replace(/ $/, '');
    -        }
    -        prevText = null;
    -        keepLeadingWs = false;
    -      } else if (isVoid(node) || isPre(node)) {
    -        // Avoid trimming space around non-block, non-BR void elements and inline PRE.
    -        prevText = null;
    -        keepLeadingWs = true;
    -      } else if (prevText) {
    -        // Drop protection if set previously.
    -        keepLeadingWs = false;
    -      }
    -    } else {
    -      node = remove(node);
    -      continue;
    -    }
    -    var nextNode = next(prev, node, isPre);
    -    prev = node;
    -    node = nextNode;
    -  }
    -  if (prevText) {
    -    prevText.data = prevText.data.replace(/ $/, '');
    -    if (!prevText.data) {
    -      remove(prevText);
    -    }
    -  }
    -}
    -
    -/**
    - * remove(node) removes the given node from the DOM and returns the
    - * next node in the sequence.
    - *
    - * @param {Node} node
    - * @return {Node} node
    - */
    -function remove(node) {
    -  var next = node.nextSibling || node.parentNode;
    -  node.parentNode.removeChild(node);
    -  return next;
    -}
    -
    -/**
    - * next(prev, current, isPre) returns the next node in the sequence, given the
    - * current and previous nodes.
    - *
    - * @param {Node} prev
    - * @param {Node} current
    - * @param {Function} isPre
    - * @return {Node}
    - */
    -function next(prev, current, isPre) {
    -  if (prev && prev.parentNode === current || isPre(current)) {
    -    return current.nextSibling || current.parentNode;
    -  }
    -  return current.firstChild || current.nextSibling || current.parentNode;
    -}
    -
    -/*
    - * Set up window for Node.js
    - */
    -
    -var root = typeof window !== 'undefined' ? window : {};
    -
    -/*
    - * Parsing HTML strings
    - */
    -
    -function canParseHTMLNatively() {
    -  var Parser = root.DOMParser;
    -  var canParse = false;
    -
    -  // Adapted from https://gist.github.com/1129031
    -  // Firefox/Opera/IE throw errors on unsupported types
    -  try {
    -    // WebKit returns null on unsupported types
    -    if (new Parser().parseFromString('', 'text/html')) {
    -      canParse = true;
    -    }
    -  } catch (e) {}
    -  return canParse;
    -}
    -function createHTMLParser() {
    -  var Parser = function () {};
    -  {
    -    var domino = require('@mixmark-io/domino');
    -    Parser.prototype.parseFromString = function (string) {
    -      return domino.createDocument(string);
    -    };
    -  }
    -  return Parser;
    -}
    -var HTMLParser = canParseHTMLNatively() ? root.DOMParser : createHTMLParser();
    -
    -function RootNode(input, options) {
    -  var root;
    -  if (typeof input === 'string') {
    -    var doc = htmlParser().parseFromString(
    -    // DOM parsers arrange elements in the  and .
    -    // Wrapping in a custom element ensures elements are reliably arranged in
    -    // a single element.
    -    '' + input + '', 'text/html');
    -    root = doc.getElementById('turndown-root');
    -  } else {
    -    root = input.cloneNode(true);
    -  }
    -  collapseWhitespace({
    -    element: root,
    -    isBlock: isBlock,
    -    isVoid: isVoid,
    -    isPre: options.preformattedCode ? isPreOrCode : null
    -  });
    -  return root;
    -}
    -var _htmlParser;
    -function htmlParser() {
    -  _htmlParser = _htmlParser || new HTMLParser();
    -  return _htmlParser;
    -}
    -function isPreOrCode(node) {
    -  return node.nodeName === 'PRE' || node.nodeName === 'CODE';
    -}
    -
    -function Node(node, options) {
    -  node.isBlock = isBlock(node);
    -  node.isCode = node.nodeName === 'CODE' || node.parentNode.isCode;
    -  node.isBlank = isBlank(node);
    -  node.flankingWhitespace = flankingWhitespace(node, options);
    -  return node;
    -}
    -function isBlank(node) {
    -  return !isVoid(node) && !isMeaningfulWhenBlank(node) && /^\s*$/i.test(node.textContent) && !hasVoid(node) && !hasMeaningfulWhenBlank(node);
    -}
    -function flankingWhitespace(node, options) {
    -  if (node.isBlock || options.preformattedCode && node.isCode) {
    -    return {
    -      leading: '',
    -      trailing: ''
    -    };
    -  }
    -  var edges = edgeWhitespace(node.textContent);
    -
    -  // abandon leading ASCII WS if left-flanked by ASCII WS
    -  if (edges.leadingAscii && isFlankedByWhitespace('left', node, options)) {
    -    edges.leading = edges.leadingNonAscii;
    -  }
    -
    -  // abandon trailing ASCII WS if right-flanked by ASCII WS
    -  if (edges.trailingAscii && isFlankedByWhitespace('right', node, options)) {
    -    edges.trailing = edges.trailingNonAscii;
    -  }
    -  return {
    -    leading: edges.leading,
    -    trailing: edges.trailing
    -  };
    -}
    -function edgeWhitespace(string) {
    -  var m = string.match(/^(([ \t\r\n]*)(\s*))(?:(?=\S)[\s\S]*\S)?((\s*?)([ \t\r\n]*))$/);
    -  return {
    -    leading: m[1],
    -    // whole string for whitespace-only strings
    -    leadingAscii: m[2],
    -    leadingNonAscii: m[3],
    -    trailing: m[4],
    -    // empty for whitespace-only strings
    -    trailingNonAscii: m[5],
    -    trailingAscii: m[6]
    -  };
    -}
    -function isFlankedByWhitespace(side, node, options) {
    -  var sibling;
    -  var regExp;
    -  var isFlanked;
    -  if (side === 'left') {
    -    sibling = node.previousSibling;
    -    regExp = / $/;
    -  } else {
    -    sibling = node.nextSibling;
    -    regExp = /^ /;
    -  }
    -  if (sibling) {
    -    if (sibling.nodeType === 3) {
    -      isFlanked = regExp.test(sibling.nodeValue);
    -    } else if (options.preformattedCode && sibling.nodeName === 'CODE') {
    -      isFlanked = false;
    -    } else if (sibling.nodeType === 1 && !isBlock(sibling)) {
    -      isFlanked = regExp.test(sibling.textContent);
    -    }
    -  }
    -  return isFlanked;
    -}
    -
    -var reduce = Array.prototype.reduce;
    -function TurndownService(options) {
    -  if (!(this instanceof TurndownService)) return new TurndownService(options);
    -  var defaults = {
    -    rules: rules,
    -    headingStyle: 'setext',
    -    hr: '* * *',
    -    bulletListMarker: '*',
    -    codeBlockStyle: 'indented',
    -    fence: '```',
    -    emDelimiter: '_',
    -    strongDelimiter: '**',
    -    linkStyle: 'inlined',
    -    linkReferenceStyle: 'full',
    -    br: '  ',
    -    preformattedCode: false,
    -    blankReplacement: function (content, node) {
    -      return node.isBlock ? '\n\n' : '';
    -    },
    -    keepReplacement: function (content, node) {
    -      return node.isBlock ? '\n\n' + node.outerHTML + '\n\n' : node.outerHTML;
    -    },
    -    defaultReplacement: function (content, node) {
    -      return node.isBlock ? '\n\n' + content + '\n\n' : content;
    -    }
    -  };
    -  this.options = extend({}, defaults, options);
    -  this.rules = new Rules(this.options);
    -}
    -TurndownService.prototype = {
    -  /**
    -   * The entry point for converting a string or DOM node to Markdown
    -   * @public
    -   * @param {String|HTMLElement} input The string or DOM node to convert
    -   * @returns A Markdown representation of the input
    -   * @type String
    -   */
    -
    -  turndown: function (input) {
    -    if (!canConvert(input)) {
    -      throw new TypeError(input + ' is not a string, or an element/document/fragment node.');
    -    }
    -    if (input === '') return '';
    -    var output = process.call(this, new RootNode(input, this.options));
    -    return postProcess.call(this, output);
    -  },
    -  /**
    -   * Add one or more plugins
    -   * @public
    -   * @param {Function|Array} plugin The plugin or array of plugins to add
    -   * @returns The Turndown instance for chaining
    -   * @type Object
    -   */
    -
    -  use: function (plugin) {
    -    if (Array.isArray(plugin)) {
    -      for (var i = 0; i < plugin.length; i++) this.use(plugin[i]);
    -    } else if (typeof plugin === 'function') {
    -      plugin(this);
    -    } else {
    -      throw new TypeError('plugin must be a Function or an Array of Functions');
    -    }
    -    return this;
    -  },
    -  /**
    -   * Adds a rule
    -   * @public
    -   * @param {String} key The unique key of the rule
    -   * @param {Object} rule The rule
    -   * @returns The Turndown instance for chaining
    -   * @type Object
    -   */
    -
    -  addRule: function (key, rule) {
    -    this.rules.add(key, rule);
    -    return this;
    -  },
    -  /**
    -   * Keep a node (as HTML) that matches the filter
    -   * @public
    -   * @param {String|Array|Function} filter The unique key of the rule
    -   * @returns The Turndown instance for chaining
    -   * @type Object
    -   */
    -
    -  keep: function (filter) {
    -    this.rules.keep(filter);
    -    return this;
    -  },
    -  /**
    -   * Remove a node that matches the filter
    -   * @public
    -   * @param {String|Array|Function} filter The unique key of the rule
    -   * @returns The Turndown instance for chaining
    -   * @type Object
    -   */
    -
    -  remove: function (filter) {
    -    this.rules.remove(filter);
    -    return this;
    -  },
    -  /**
    -   * Escapes Markdown syntax
    -   * @public
    -   * @param {String} string The string to escape
    -   * @returns A string with Markdown syntax escaped
    -   * @type String
    -   */
    -
    -  escape: function (string) {
    -    return escapeMarkdown(string);
    -  }
    -};
    -
    -/**
    - * Reduces a DOM node down to its Markdown string equivalent
    - * @private
    - * @param {HTMLElement} parentNode The node to convert
    - * @returns A Markdown representation of the node
    - * @type String
    - */
    -
    -function process(parentNode) {
    -  var self = this;
    -  return reduce.call(parentNode.childNodes, function (output, node) {
    -    node = new Node(node, self.options);
    -    var replacement = '';
    -    if (node.nodeType === 3) {
    -      replacement = node.isCode ? node.nodeValue : self.escape(node.nodeValue);
    -    } else if (node.nodeType === 1) {
    -      replacement = replacementForNode.call(self, node);
    -    }
    -    return join(output, replacement);
    -  }, '');
    -}
    -
    -/**
    - * Appends strings as each rule requires and trims the output
    - * @private
    - * @param {String} output The conversion output
    - * @returns A trimmed version of the ouput
    - * @type String
    - */
    -
    -function postProcess(output) {
    -  var self = this;
    -  this.rules.forEach(function (rule) {
    -    if (typeof rule.append === 'function') {
    -      output = join(output, rule.append(self.options));
    -    }
    -  });
    -  return output.replace(/^[\t\r\n]+/, '').replace(/[\t\r\n\s]+$/, '');
    -}
    -
    -/**
    - * Converts an element node to its Markdown equivalent
    - * @private
    - * @param {HTMLElement} node The node to convert
    - * @returns A Markdown representation of the node
    - * @type String
    - */
    -
    -function replacementForNode(node) {
    -  var rule = this.rules.forNode(node);
    -  var content = process.call(this, node);
    -  var whitespace = node.flankingWhitespace;
    -  if (whitespace.leading || whitespace.trailing) content = content.trim();
    -  return whitespace.leading + rule.replacement(content, node, this.options) + whitespace.trailing;
    -}
    -
    -/**
    - * Joins replacement to the current output with appropriate number of new lines
    - * @private
    - * @param {String} output The current conversion output
    - * @param {String} replacement The string to append to the output
    - * @returns Joined output
    - * @type String
    - */
    -
    -function join(output, replacement) {
    -  var s1 = trimTrailingNewlines(output);
    -  var s2 = trimLeadingNewlines(replacement);
    -  var nls = Math.max(output.length - s1.length, replacement.length - s2.length);
    -  var separator = '\n\n'.substring(0, nls);
    -  return s1 + separator + s2;
    -}
    -
    -/**
    - * Determines whether an input can be converted
    - * @private
    - * @param {String|HTMLElement} input Describe this parameter
    - * @returns Describe what it returns
    - * @type String|Object|Array|Boolean|Number
    - */
    -
    -function canConvert(input) {
    -  return input != null && (typeof input === 'string' || input.nodeType && (input.nodeType === 1 || input.nodeType === 9 || input.nodeType === 11));
    -}
    -
    -module.exports = TurndownService;
    diff --git a/.output/server/node_modules/turndown/package.json b/.output/server/node_modules/turndown/package.json
    deleted file mode 100644
    index b1b5b66..0000000
    --- a/.output/server/node_modules/turndown/package.json
    +++ /dev/null
    @@ -1,59 +0,0 @@
    -{
    -  "name": "turndown",
    -  "description": "A library that converts HTML to Markdown",
    -  "version": "7.2.4",
    -  "author": "Dom Christie",
    -  "main": "lib/turndown.cjs.js",
    -  "module": "lib/turndown.es.js",
    -  "jsnext:main": "lib/turndown.es.js",
    -  "browser": {
    -    "@mixmark-io/domino": false,
    -    "./lib/turndown.cjs.js": "./lib/turndown.browser.cjs.js",
    -    "./lib/turndown.es.js": "./lib/turndown.browser.es.js",
    -    "./lib/turndown.umd.js": "./lib/turndown.browser.umd.js"
    -  },
    -  "dependencies": {
    -    "@mixmark-io/domino": "^2.2.0"
    -  },
    -  "devDependencies": {
    -    "@babel/core": "^7.29.0",
    -    "@babel/plugin-transform-block-scoping": "^7.28.6",
    -    "@babel/plugin-transform-shorthand-properties": "^7.27.1",
    -    "@rollup/plugin-babel": "^7.0.0",
    -    "@rollup/plugin-commonjs": "^29.0.0",
    -    "@rollup/plugin-node-resolve": "^16.0.3",
    -    "@rollup/plugin-replace": "^6.0.3",
    -    "rewire": "^6.0.0",
    -    "rollup": "^4.59.0",
    -    "standard": "^17.0.0",
    -    "turndown-attendant": "0.0.3"
    -  },
    -  "engines": {
    -    "node": ">=18",
    -    "npm": ">=9"
    -  },
    -  "files": [
    -    "lib",
    -    "dist"
    -  ],
    -  "keywords": [
    -    "converter",
    -    "html",
    -    "markdown"
    -  ],
    -  "license": "MIT",
    -  "repository": {
    -    "type": "git",
    -    "url": "https://github.com/mixmark-io/turndown.git"
    -  },
    -  "scripts": {
    -    "build": "npm run build-cjs && npm run build-es && npm run build-umd && npm run build-iife",
    -    "build-cjs": "rollup -c config/rollup.config.cjs.mjs && rollup -c config/rollup.config.browser.cjs.mjs",
    -    "build-es": "rollup -c config/rollup.config.es.mjs && rollup -c config/rollup.config.browser.es.mjs",
    -    "build-umd": "rollup -c config/rollup.config.umd.mjs && rollup -c config/rollup.config.browser.umd.mjs",
    -    "build-iife": "rollup -c config/rollup.config.iife.mjs",
    -    "build-test": "rollup -c config/rollup.config.test.mjs",
    -    "prepare": "npm run build",
    -    "test": "npm run build && npm run build-test && standard ./src/**/*.js && node test/internals-test.js && node test/turndown-test.js"
    -  }
    -}
    \ No newline at end of file
    diff --git a/.output/server/package.json b/.output/server/package.json
    deleted file mode 100644
    index fec3492..0000000
    --- a/.output/server/package.json
    +++ /dev/null
    @@ -1,26 +0,0 @@
    -{
    -  "name": "traced-node-modules",
    -  "version": "1.0.0",
    -  "type": "module",
    -  "private": true,
    -  "dependencies": {
    -    "@jitl/quickjs-ffi-types": "0.32.0",
    -    "@jitl/quickjs-wasmfile-debug-asyncify": "0.32.0",
    -    "@jitl/quickjs-wasmfile-debug-sync": "0.32.0",
    -    "@jitl/quickjs-wasmfile-release-asyncify": "0.32.0",
    -    "@jitl/quickjs-wasmfile-release-sync": "0.32.0",
    -    "@mixmark-io/domino": "2.2.0",
    -    "@mongodb-js/zstd": "7.0.0",
    -    "balanced-match": "4.0.4",
    -    "brace-expansion": "5.0.7",
    -    "diff": "8.0.4",
    -    "just-bash": "3.1.0",
    -    "minimatch": "10.2.5",
    -    "quickjs-emscripten": "0.32.0",
    -    "quickjs-emscripten-core": "0.32.0",
    -    "seek-bzip": "2.0.0",
    -    "sprintf-js": "1.1.3",
    -    "sql.js": "1.14.1",
    -    "turndown": "7.2.4"
    -  }
    -}
    \ No newline at end of file
    diff --git a/.workflow-data/.locks/hooks/hook_01KXJTH845WNPD9MC53BS00TSE.disposed b/.workflow-data/.locks/hooks/hook_01KXJTH845WNPD9MC53BS00TSE.disposed
    deleted file mode 100644
    index e69de29..0000000
    diff --git a/.workflow-data/.locks/hooks/hook_01KXJTH845WNPD9MC53BS00TSF.disposed b/.workflow-data/.locks/hooks/hook_01KXJTH845WNPD9MC53BS00TSF.disposed
    deleted file mode 100644
    index e69de29..0000000
    diff --git a/.workflow-data/.locks/hooks/hook_01KXJTH845WNPD9MC53BS00TSG.disposed b/.workflow-data/.locks/hooks/hook_01KXJTH845WNPD9MC53BS00TSG.disposed
    deleted file mode 100644
    index e69de29..0000000
    diff --git a/.workflow-data/.locks/hooks/hook_01KXJTH8BXKCJT8Q2301PKTFGQ.disposed b/.workflow-data/.locks/hooks/hook_01KXJTH8BXKCJT8Q2301PKTFGQ.disposed
    deleted file mode 100644
    index e69de29..0000000
    diff --git a/.workflow-data/.locks/steps/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-step_01KXJTH845WNPD9MC53BS00TSD.created b/.workflow-data/.locks/steps/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-step_01KXJTH845WNPD9MC53BS00TSD.created
    deleted file mode 100644
    index e69de29..0000000
    diff --git a/.workflow-data/.locks/steps/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-step_01KXJTH845WNPD9MC53BS00TSD.terminal b/.workflow-data/.locks/steps/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-step_01KXJTH845WNPD9MC53BS00TSD.terminal
    deleted file mode 100644
    index e69de29..0000000
    diff --git a/.workflow-data/.locks/steps/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-step_01KXJTH845WNPD9MC53BS00TSH.created b/.workflow-data/.locks/steps/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-step_01KXJTH845WNPD9MC53BS00TSH.created
    deleted file mode 100644
    index e69de29..0000000
    diff --git a/.workflow-data/.locks/steps/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-step_01KXJTH845WNPD9MC53BS00TSH.terminal b/.workflow-data/.locks/steps/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-step_01KXJTH845WNPD9MC53BS00TSH.terminal
    deleted file mode 100644
    index e69de29..0000000
    diff --git a/.workflow-data/.locks/steps/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-step_01KXJTH845WNPD9MC53BS00TSJ.created b/.workflow-data/.locks/steps/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-step_01KXJTH845WNPD9MC53BS00TSJ.created
    deleted file mode 100644
    index e69de29..0000000
    diff --git a/.workflow-data/.locks/steps/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-step_01KXJTH845WNPD9MC53BS00TSJ.terminal b/.workflow-data/.locks/steps/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-step_01KXJTH845WNPD9MC53BS00TSJ.terminal
    deleted file mode 100644
    index e69de29..0000000
    diff --git a/.workflow-data/.locks/steps/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-step_01KXJTH845WNPD9MC53BS00TSK.created b/.workflow-data/.locks/steps/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-step_01KXJTH845WNPD9MC53BS00TSK.created
    deleted file mode 100644
    index e69de29..0000000
    diff --git a/.workflow-data/.locks/steps/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-step_01KXJTH845WNPD9MC53BS00TSK.terminal b/.workflow-data/.locks/steps/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-step_01KXJTH845WNPD9MC53BS00TSK.terminal
    deleted file mode 100644
    index e69de29..0000000
    diff --git a/.workflow-data/.locks/steps/wrun_01KXJTH8BX5EJ42KPQQBCSC9SE-step_01KXJTH8BXKCJT8Q2301PKTFGR.created b/.workflow-data/.locks/steps/wrun_01KXJTH8BX5EJ42KPQQBCSC9SE-step_01KXJTH8BXKCJT8Q2301PKTFGR.created
    deleted file mode 100644
    index e69de29..0000000
    diff --git a/.workflow-data/.locks/steps/wrun_01KXJTH8BX5EJ42KPQQBCSC9SE-step_01KXJTH8BXKCJT8Q2301PKTFGR.terminal b/.workflow-data/.locks/steps/wrun_01KXJTH8BX5EJ42KPQQBCSC9SE-step_01KXJTH8BXKCJT8Q2301PKTFGR.terminal
    deleted file mode 100644
    index e69de29..0000000
    diff --git a/.workflow-data/.locks/steps/wrun_01KXJTH8BX5EJ42KPQQBCSC9SE-step_01KXJTH8BXKCJT8Q2301PKTFGS.created b/.workflow-data/.locks/steps/wrun_01KXJTH8BX5EJ42KPQQBCSC9SE-step_01KXJTH8BXKCJT8Q2301PKTFGS.created
    deleted file mode 100644
    index e69de29..0000000
    diff --git a/.workflow-data/.locks/steps/wrun_01KXJTH8BX5EJ42KPQQBCSC9SE-step_01KXJTH8BXKCJT8Q2301PKTFGS.terminal b/.workflow-data/.locks/steps/wrun_01KXJTH8BX5EJ42KPQQBCSC9SE-step_01KXJTH8BXKCJT8Q2301PKTFGS.terminal
    deleted file mode 100644
    index e69de29..0000000
    diff --git a/.workflow-data/events/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-evnt_01KXJTH84Q6BHJ9Z1TX269CVHB.json b/.workflow-data/events/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-evnt_01KXJTH84Q6BHJ9Z1TX269CVHB.json
    deleted file mode 100644
    index f055e31..0000000
    --- a/.workflow-data/events/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-evnt_01KXJTH84Q6BHJ9Z1TX269CVHB.json
    +++ /dev/null
    @@ -1,28 +0,0 @@
    -{
    -  "eventType": "run_created",
    -  "specVersion": 5,
    -  "eventData": {
    -    "deploymentId": "dpl_local@1.0.0",
    -    "workflowName": "workflow//eve//workflowEntry",
    -    "input": {
    -      "__type": "Uint8Array",
    -      "data": "ZGV2bFtbMV0seyJpbnB1dCI6Miwic2VyaWFsaXplZENvbnRleHQiOjR9LHsibWVzc2FnZSI6MywiY29udGV4dCI6LTEsIm91dHB1dFNjaGVtYSI6LTF9LCJSdW4gdGhlIFNFTyBpbXByb3ZlciBvbmNlIGZvciBRUk1hc3Rlci4iLHsiZXZlLmJ1bmRsZSI6NSwiZXZlLmNoYW5uZWwiOjgsImV2ZS5jaGFubmVsSW5zdHJ1bWVudGF0aW9uIjoxMSwiZXZlLmNvbnRpbnVhdGlvblRva2VuIjoxNCwiZXZlLm1vZGUiOjE1LCJldmUuYXV0aCI6MTYsImV2ZS5pbml0aWF0b3JBdXRoIjoxNiwiZXZlLmNhcGFiaWxpdGllcyI6MTl9LHsibm9kZUlkIjotMSwic291cmNlIjo2fSx7ImtpbmQiOjd9LCJidW5kbGVkIix7ImtpbmQiOjksInN0YXRlIjoxMH0sImh0dHAiLHt9LHsia2luZCI6MTIsIm1ldGFkYXRhIjoxM30sImNoYW5uZWw6ZXZlIix7fSwiZXZlOmV2ZTozMzQzODE3NS1hYjU0LTRkZDItYjE2Yi02YmMxZGMxNTc0OGMiLCJjb252ZXJzYXRpb24iLHsiYXR0cmlidXRlcyI6MTcsImF1dGhlbnRpY2F0b3IiOjE4LCJwcmluY2lwYWxJZCI6MTgsInByaW5jaXBhbFR5cGUiOjE4fSx7fSwibG9jYWwtZGV2Iix7InJlcXVlc3RJbnB1dCI6MjB9LHRydWVd"
    -    },
    -    "executionContext": {
    -      "traceCarrier": {},
    -      "workflowCoreVersion": "5.0.0-beta.24",
    -      "features": {
    -        "encryption": false
    -      }
    -    },
    -    "attributes": {
    -      "$eve.type": "session",
    -      "$eve.trigger": "http",
    -      "$eve.title": "Run the SEO improver once for QRMaster."
    -    },
    -    "allowReservedAttributes": true
    -  },
    -  "runId": "wrun_01KXJTH845B37ZAB3DJCPQ48Z8",
    -  "eventId": "evnt_01KXJTH84Q6BHJ9Z1TX269CVHB",
    -  "createdAt": "2026-07-15T12:02:57.815Z"
    -}
    \ No newline at end of file
    diff --git a/.workflow-data/events/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-evnt_01KXJTH85D1TEJA5J29HJZ2KV7.json b/.workflow-data/events/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-evnt_01KXJTH85D1TEJA5J29HJZ2KV7.json
    deleted file mode 100644
    index df930ea..0000000
    --- a/.workflow-data/events/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-evnt_01KXJTH85D1TEJA5J29HJZ2KV7.json
    +++ /dev/null
    @@ -1,7 +0,0 @@
    -{
    -  "eventType": "run_started",
    -  "specVersion": 5,
    -  "runId": "wrun_01KXJTH845B37ZAB3DJCPQ48Z8",
    -  "eventId": "evnt_01KXJTH85D1TEJA5J29HJZ2KV7",
    -  "createdAt": "2026-07-15T12:02:57.837Z"
    -}
    \ No newline at end of file
    diff --git a/.workflow-data/events/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-evnt_01KXJTH870TX2SW02PM4KCCT51.json b/.workflow-data/events/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-evnt_01KXJTH870TX2SW02PM4KCCT51.json
    deleted file mode 100644
    index b4b87ff..0000000
    --- a/.workflow-data/events/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-evnt_01KXJTH870TX2SW02PM4KCCT51.json
    +++ /dev/null
    @@ -1,12 +0,0 @@
    -{
    -  "eventType": "step_started",
    -  "specVersion": 5,
    -  "correlationId": "step_01KXJTH845WNPD9MC53BS00TSD",
    -  "eventData": {
    -    "stepName": "step//eve@0.16.2//createSessionStep",
    -    "workflowName": "workflow//eve//workflowEntry"
    -  },
    -  "runId": "wrun_01KXJTH845B37ZAB3DJCPQ48Z8",
    -  "eventId": "evnt_01KXJTH870TX2SW02PM4KCCT51",
    -  "createdAt": "2026-07-15T12:02:57.888Z"
    -}
    \ No newline at end of file
    diff --git a/.workflow-data/events/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-evnt_01KXJTH878SS11YYST6VMMVC4H.json b/.workflow-data/events/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-evnt_01KXJTH878SS11YYST6VMMVC4H.json
    deleted file mode 100644
    index f2fcf75..0000000
    --- a/.workflow-data/events/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-evnt_01KXJTH878SS11YYST6VMMVC4H.json
    +++ /dev/null
    @@ -1,15 +0,0 @@
    -{
    -  "eventType": "step_created",
    -  "runId": "wrun_01KXJTH845B37ZAB3DJCPQ48Z8",
    -  "eventId": "evnt_01KXJTH878SS11YYST6VMMVC4H",
    -  "createdAt": "2026-07-15T12:02:57.888Z",
    -  "specVersion": 5,
    -  "correlationId": "step_01KXJTH845WNPD9MC53BS00TSD",
    -  "eventData": {
    -    "stepName": "step//eve@0.16.2//createSessionStep",
    -    "input": {
    -      "__type": "Uint8Array",
    -      "data": "ZGV2bFt7ImFyZ3MiOjEsImNsb3N1cmVWYXJzIjotMSwidGhpc1ZhbCI6LTF9LFsyXSx7ImNvbXBpbGVkQXJ0aWZhY3RzU291cmNlIjozLCJjb250aW51YXRpb25Ub2tlbiI6NSwibm9kZUlkIjotMSwib3V0cHV0U2NoZW1hIjotMSwicm9vdFNlc3Npb25JZCI6LTEsInNlc3Npb25JZCI6Nn0seyJraW5kIjo0fSwiYnVuZGxlZCIsImV2ZTpldmU6MzM0MzgxNzUtYWI1NC00ZGQyLWIxNmItNmJjMWRjMTU3NDhjIiwid3J1bl8wMUtYSlRIODQ1QjM3WkFCM0RKQ1BRNDhaOCJd"
    -    }
    -  }
    -}
    \ No newline at end of file
    diff --git a/.workflow-data/events/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-evnt_01KXJTH880FSS9M690VNN7E83P.json b/.workflow-data/events/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-evnt_01KXJTH880FSS9M690VNN7E83P.json
    deleted file mode 100644
    index 4e4ab83..0000000
    --- a/.workflow-data/events/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-evnt_01KXJTH880FSS9M690VNN7E83P.json
    +++ /dev/null
    @@ -1,16 +0,0 @@
    -{
    -  "eventType": "step_completed",
    -  "specVersion": 5,
    -  "correlationId": "step_01KXJTH845WNPD9MC53BS00TSD",
    -  "eventData": {
    -    "stepName": "step//eve@0.16.2//createSessionStep",
    -    "workflowName": "workflow//eve//workflowEntry",
    -    "result": {
    -      "__type": "Uint8Array",
    -      "data": "enN0ZCi1L/1gdSgFlABatOgePTBr1BzAwMDAwMDAgCUFXPsUIdJkSok7JVGrXLKTyM2P4VSK/gA/LLtD7IFYvYWaKkUUxSdlgNd7c5kREYLyAccB2gG+2k4TO59S8+GM4OveLqPvllxfm6QLM3aVEV7TfSPUDQLCY/Nk2WNPCIh/Ky2kTokgjvJp51Ty1NwJ+Bk2wwkCIhcExENAJFPBnWw69Hhh9NltWdd2X9tJS/muDm70ErYRS8kulf+xbznjh9lOnhKmTpTLkdgt9DRi2Z+vjdm2XL7PvnAjKhdG15WSmbpdar7OF2EuCXfScJI4LUzYyKe5UDM2hojKvVYeRq9T/ttsT7OnhQm1k/DwFOajOr3BRp9Swyd3wnCbQ/56fr9kvMGmqpVkWwlTyJHMY5W6ZUbE71vgvqsEMywURUVEMD79R8lUD3da1/7aIiMGdTdeB+wgQFES4uc1U56tBA2nVBQALCYkJGLH63hgh3QW4fvDgKwKHEQYiLTvlU9EGEgF+52jFYkwkH8LqUSEgUQWBMIDECgWyLA44GJCQsUDAkxIeEABgQLHAQ4gEJHweBFSkAWBLIm17vRZFQQA439sexjTvkPWAway7G3M0Pah/gYFC8IgUAjwIMJahDkBKE4AEUdx0BqFQvHAUeWBABEIExQTE8xOFrIqGICBfEc+6XPIgsBA4E4gSwAG0jDWIYuCgfj7xgyr8XF6GNVHwwzXCLImNl6zO0sLWQ4YyFtJc7zm1/j4XzMIBauCCAPZ13cIBRC4ybb5DhXn4pROpPBsQDqdepm6aZ8ldrmvTn87DVcjF6+gYMGRUWGRO3Ht6/W/jT7qVDm5opTLpWfJif4LQX2FNKddBBY6xxJ3lHYZYSf91E3/mPo3bVN+Ysg2dKIHbHsL4TrVUEJWQI8d6uSeP5fH1/fM4OCgkAt6VCpgYeOAiAY2LHI12/o1uRoHI2vSo6cv9RHELrL9WOmjnfbU9a2DNPufrNy/deyMoaNPPp1w33M5bAg3YWfbCRh29FFf5M0Ho3p+cWqHdKz0uk5HFKQjnTlycacleHK9o09PX+/pY/MxctlqUihXiq4nmasbb/Q7aUfTlzpmn7J9Ta/DfiR9+WwjxjQl6MHe2TW5tIVxVbBykr0n1eCwyOWMHUtm2VPnDVz3Z+OMv3L61MM9KrgxAwOPauhxi449zpWhMWEjonYdbqXu+XeSmsEuAPaT0Uf42V5sCD0vCfYDd0qHVEcNNluY1UOdlHfIzzqo24B0ZiAgKqgSwymdISByec1wn4dbajpcyp9mxHSb+lyP6ctgbE99vciGhuXXP99GF3LxdZOkH+sbnU5ypeiuF7ms4yf96Zz6Jaydk03jnDAmbPt2mjTK55RUEeVZafs8m22f7fSxEWslbMa9AYUv2Iw34ItcJpZDEDsVcnGQ+U8ldvuSkeKEXCKZTQK1AtMmLYrkabMJ5PIQacgGlep3yPZ20uTSvLqnSdgTta/J1bRtlrNpmmZ5THDdYzkYPZbHWisnzpqmyVQUBYMLMshm4qxJhXmmDz/UCx+njxYat3x1CWwqF2/A7u06uRONoObzr8d4A7gN5BIAp+/rhL+lXebIZSUqZb/TB1vzhN10o/U4Tar0KxUERGrluHIwsv7lTh/EnsrrKZ9pAbk8aA//cOSPXbrvW6fvDsqycith9yDllhHUqUrZXuxr44hxRGWEal+v8wnYqcPvqQW1L3qm8ll/pYhdmBE+OvmganBYRBBTWCJ8O88JZeqPKExlW4+sn5RwoFBYkP/OLRm+kpkMpVGCXNvYp5iMdWFbft99GCMXCgmJSOx0bp/qaULqCsilvfg8rTRsuah9ud7bJZNALhMPvjC+bgIaDORySAeGzsWMXBzwZFvEOmXtHhpsdlhribwIJ/xWUD9nfeePzRf75YORS9v2evKF2VSiciX+Jkmt77blfpykZmYfu3V1KmULuT1+bymXV+TSRBBwcaFUqKBgwIABQ4TS6xHeZHzPyIYGqt06SbV7AhFEAMGCPLiHhwfUXaBlHfJhp+xUzmHObYoSfxcZhqmA2jqqn+QtlLCdpap3ASOjAiOjIsOiQraNoNiQ+cf24w0NzsH07ebWOXV18vVz+WN+F6V0zinDdSdWvA4OVseU57sNgg21PKkc65McM2C0x0/j1OQxJ7mqZ8f5kerImXKkEkGRL8oUFSbi32o0EQ1POJYXYcN8sa3yOpbp5BLYF17H61h8Pz6W3BSbaa6TzcWOHus/Vik1I1CrkbHOlKt7cad9FjQy+mlkZKWhLIP9eJxSgaxar/sGThlBjQV1C1/MVwn2szCCewOtkMsD3H+V/jV8HLiokMshvW1DQGNlozsrTbaIPYWOLmS5etrfJ6GzyMXBxJKNXJa3Xb7ctyn6KzG6juWkkhPd7UYukQvP6/jpt5CLMz9uIuBqKM16aCKocUiMBCz6I1encXZOnBIyU+se4NqoYOEdpTq4Z1PtnKY/SDtJDSeHbMxj5adeCK7Ek/gYxicbykol52TXd1GfbVlJeHBwKrKhoR/E6b+QR40+NrNyTuMzrciFJ6/Zw448JXVl3pBpVq7bTEhIKBgqLCZcOJCQUDQ4LCISEsoEBDA0ODYUCxM2LjDy/Wn0bd22lhK2stY56lgn+qLuRFlKyOUBC4S/qDMIyp4GIVOIRGQ0SZIOIxCAgADCwkMTKqls/RNAlusTaQ4yZ4ZkFBSkJCXJsBmZyusy+OHE1P56yWo7siy55kIFRpqpyOwp61IDXt5+QOuDRmrrfIZCRJzJZkfyxnNZ2421yE2noSLBJygr/qQHCZYno4KFS9P7IUGo4TWuAkB/Lrh8A6CJl9KGlmbfFGC689OiqkqueL/zQMhpClK3ciAjxXgP1Xo+gNognI1Oq2ewJfU9YSWjuyQuF+w9R68lKJlQuLckaJSN1cSl9apLY0C9nx/uvDvLOdM975fKGy32mPTgVXb4EDi5KSHE+trCF331DxBuIxCsVOO74SJjD5oOMpsJvpKbtJUlH4E9adKzRJobLWazkqYDhu9BID0LkXqjbJj5OCmlxFHjfsAEqzQyfyUtzd9aqU12b7ArulfiXb7QldPjLTwqvrOcV1KaW17D/vfbMbAifO3B2GhZfNbRV7TPvX8arceIvd8SAMyynd565jvjPrMeWmiznRABzYt8oigCQPQhdFWqNxWS4GZB2vWp9YW7rBOLOjsLHmG+JRIhF+bOwACtMx53W3kxLgDNE0uZ0zofWDWjT8Phw+bjYy9V0j/xKV/56EBPcBCYV7MThPVKCOz+gPnTF9XIUWLA+IJPTRaWZe7MmRGvRDpPoboktKAIu/4/+xqLyvfzDxWzJuA+Pa0f+TQro7q0UfYJ1fGTPHmqbq5gHcFPb4rGnOBbAYPer9BVHYZ1Gn4vu2Rr4rBNMJvC8YHC/2mERdjkHoTORxNIt2EmXVgkrKcDT8SU30LWWfX9y4zuucSRWvfiiFRwg5fuPtVhWRtY2UcN3cBJrB2gsgMt2TFdF4ma7PwhmVpjqG+YrQDsEpk8VuhHSgldRL+2aGOyjnM5RC6hzR4QhlGYHIhjy9i8yDKURYaSZ8FPe1nn2yyQBkMgJFDphQOCx4zh0nG1IH2GQE9olADA7p9lkw4ioY+PT6Bi1U4uovSJQ2XfEQcimX6PL89EB9PWRK/VUXuV0L8l9snia8daZL4Rqbl2vnCm0NPaZEqzpmCuk+helxdbcJdhpRTZhu+PH45mhldZd/3Wss7txppxCaeatLlDWfFPhUYpXdJmQ7lxagpCI+W0f2rNJDsQRUMEAaCx/HphJJKEMZFyQEKojMWzUJa1fdgP4scWajiWreEs6tCTqedyv8cG9/eSpMp/hOKw/DG99zg886il5h/0CDDOLZqFCa3EhExD2hCoN9ZalwaogphmC6kC/pOFXmrANIvPpMZxmYnUynunfAkscPOPc2BxlUmhqKByHZuyyPzEaCxNZ/eVMHwoGQiXTg5m5G3nE6gYGf7AmlOu9baLibQpB+aEhinjN/lYIp5zs7cZyrlivfAOw4kWFtMro9QRBMF971LcsB2tnChT26m2f+EnBG2swMgwkYzlXrSZo4glkQsOG89J6Y6Gp7BxmUfAF1tjsvR5RRmPrTREhpEamuvxmAnM92KgjUUbV2joCEMSbHceyzdlGHaM2zvEcAjxxelowhhS24zwNa0F0eP1xcHTOId+NTZgktMP38MJnRtnXVH2LBSGlKeIo6CZ9zQHSilqSWL9MJO8UJOtd7b35YOGRgkjnU8F3xp2ReprbAaxuO04K1bijzNpDl9GsdyTjD/ILlCv2CdZnJJp9+66dd3GS2dlK5MYAFVY9mfARCJrsq2hbIQDirqXDtQ8KORZOJyDW3MaDa01519sRwDS6WBxK/G+YXiWVYGNQ4BqHxHe7UMOeeMmDRb/4pYmacoC4xbf1lGQY42Fl5d1p3pZA43ZApQzZ2qyrmHmTfdI0b9eTTW16WyB/KAnWFOhikJYctQ6QwcuvjuGPRVApqhkihZXYr7wYDhNV0FOP7qOcRhp+DnEa8igY9OjjkBvYpnTmK87xzIpI0wIh9OuCcsRr63jXtUTS3AtBLOeL0mFKX3h14e8xKorCKrZbyxuvRboqwtLbV49GFjoW/joSdYuFASafUX3Uooehb+YNC1EUcGEj8utyHsDOr+rsiXNooZhc3IHbV2ZgzvDbWnEy/cmqZ7sWZeO7r7ixKoH4GicFOOrcOHnLfQjtLY5HrII4GHYpQFsERMpPfZr7ouiEIZ96L6hwxiVFqEUkwoETsAb+iRRouwKpFhww/wvAgZDNPzbsKVjjr3GscVrt3oT2B9qS51PiNsdCEzCqXZ2L0NuKpHm26bKAAYG/dPjuwqZiRy4oJ/r95S9AoNYLV/01IDkIY5Hb2M8B7xaXTJYzk6DFlzRKoSjT5UkB3OIBCzqKwpDcbPXUwmW9OOhc8nCK3btWDz9iiH9xew4BACdstjmGw+hR9VYF45cJMmaUqY7vxaKEP9vLhP2nPwqsro1FgFSK9Koy7EcXJDBtRtUxmiJjuhOB6Pv/hV+uP0Iye4uJwi2vOToLUleQNNbUIVoG1fmYZyCz2pOu5sSPwz4I8EOEoCk2jIH8TGS2LXXaNdjPXRDHZMRScrPUmhCyoRXhVoNkbAZ0e9C/6aZ83Vu1yPoqgObd5K1UgmkoSxxuFqHk2AOJNgQ8zasFSzj9XV6Wls/kokI6Gf8SOLggLfdyA4W6VuWpmfSBuj0fQHsOADd/LfakwTLTh+D8Ldp2dy1FNT9QD5HAjdz7hF1Ouk7A4mVaBXO4i30HywjamCCQRiWwS+gvDEpVMwSd5qPweLrgYLACPuvGeCWSxNdeZUm8CCbQTFkjDkf5iT6Ov5lJQ1e26woQcDvvJCDORv570aPJuODkKw2wpZnPqrfTvmYcJwAZEr+//CwsDSluLfUtIM6o7r/GQ8BYzGPg8EENGy93+uoHaRV23QzLyhoEzufJrnAxG6nChCWrE1B/XmG5QK1EFk1Hq2jyFLe+8PeUhrI8duM0XdvuKdZ1oNSKDLd+mQzZ5slGMSqE26ghplobNiVU1Mh2mBxBU4nFO+Zf9EAouuqK4w7/n5Y6vyJbWjQtKEidtUOD1i0Ar4Dqmk4GWc1d+JdZHS0EU5Adg31IxfxEtAOSlNHuHFJ717Cs5361Bmqt3sOUHAJWmanSKKD3EOZsrXIX6kP+amOhyonwOrjQRwVfCNYXrZ0Cv5p76J+JTLKGKwFMb53DJDLyjhg1WSVNyvmWJHodrhgkOg123gBEheLjMliO1364wbFKqZzVI04MOBAeaZhjorrcSqpOp9kDGUOTDyXhUqcRrWoxjUAyCpFxjXmk1zYIACnb9XUnnKduqVRglPBJbbU4XoDlrOGo4j2jG8auNnM5iSwHvSgwbwT5nOhMcMgnEqkXMgUCADA0HZpL1Q+CB6lgD+nWGTeaLQcw4N6tfdRzCFiXTnhgKX6hM5NWUq5pJOMmQoZLV2JuFxbGFzKQnC20j9AvbfeavsGlwNKavaywDB7rHLyLaXhAS1nRVjCWkuB9G3nLc6WJJOuDfeSaZAc2SilA00ApJFkYy5zdjuSOFSmYB0tooBp2YmGXINMpwr03yco+f/Ns9jcl46K1QUYydIISUSr8V+zvDkln8maaFX9WdQ1KYqLVKw021T/V1nVSZaoxHONMwir05oRnhQPPp9292ztvdBvKkwel/MZbLVkfH5UdeC5DN0gc0UOfMBTyPkiEME6UjO2bKBIn4PPoS2miAEQ1feMFrThw1CkXdz50DcNFx+5/KS4i6GT5tDYFQ=="
    -    }
    -  },
    -  "runId": "wrun_01KXJTH845B37ZAB3DJCPQ48Z8",
    -  "eventId": "evnt_01KXJTH880FSS9M690VNN7E83P",
    -  "createdAt": "2026-07-15T12:02:57.920Z"
    -}
    \ No newline at end of file
    diff --git a/.workflow-data/events/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-evnt_01KXJTH89BDQNMCFDPHD3Z42WQ.json b/.workflow-data/events/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-evnt_01KXJTH89BDQNMCFDPHD3Z42WQ.json
    deleted file mode 100644
    index d7dd49b..0000000
    --- a/.workflow-data/events/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-evnt_01KXJTH89BDQNMCFDPHD3Z42WQ.json
    +++ /dev/null
    @@ -1,12 +0,0 @@
    -{
    -  "eventType": "hook_created",
    -  "specVersion": 5,
    -  "correlationId": "hook_01KXJTH845WNPD9MC53BS00TSE",
    -  "eventData": {
    -    "token": "wrun_01KXJTH845B37ZAB3DJCPQ48Z8:auth",
    -    "isWebhook": false
    -  },
    -  "runId": "wrun_01KXJTH845B37ZAB3DJCPQ48Z8",
    -  "eventId": "evnt_01KXJTH89BDQNMCFDPHD3Z42WQ",
    -  "createdAt": "2026-07-15T12:02:57.963Z"
    -}
    \ No newline at end of file
    diff --git a/.workflow-data/events/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-evnt_01KXJTH89BDQNMCFDPHD3Z42WR.json b/.workflow-data/events/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-evnt_01KXJTH89BDQNMCFDPHD3Z42WR.json
    deleted file mode 100644
    index a6b6cec..0000000
    --- a/.workflow-data/events/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-evnt_01KXJTH89BDQNMCFDPHD3Z42WR.json
    +++ /dev/null
    @@ -1,12 +0,0 @@
    -{
    -  "eventType": "hook_created",
    -  "specVersion": 5,
    -  "correlationId": "hook_01KXJTH845WNPD9MC53BS00TSF",
    -  "eventData": {
    -    "token": "eve:eve:33438175-ab54-4dd2-b16b-6bc1dc15748c",
    -    "isWebhook": false
    -  },
    -  "runId": "wrun_01KXJTH845B37ZAB3DJCPQ48Z8",
    -  "eventId": "evnt_01KXJTH89BDQNMCFDPHD3Z42WR",
    -  "createdAt": "2026-07-15T12:02:57.963Z"
    -}
    \ No newline at end of file
    diff --git a/.workflow-data/events/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-evnt_01KXJTH8ATC6GHAGN2P3A16GP9.json b/.workflow-data/events/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-evnt_01KXJTH8ATC6GHAGN2P3A16GP9.json
    deleted file mode 100644
    index 89fd71b..0000000
    --- a/.workflow-data/events/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-evnt_01KXJTH8ATC6GHAGN2P3A16GP9.json
    +++ /dev/null
    @@ -1,12 +0,0 @@
    -{
    -  "eventType": "hook_created",
    -  "specVersion": 5,
    -  "correlationId": "hook_01KXJTH845WNPD9MC53BS00TSG",
    -  "eventData": {
    -    "token": "wrun_01KXJTH845B37ZAB3DJCPQ48Z8:turn-control:0",
    -    "isWebhook": false
    -  },
    -  "runId": "wrun_01KXJTH845B37ZAB3DJCPQ48Z8",
    -  "eventId": "evnt_01KXJTH8ATC6GHAGN2P3A16GP9",
    -  "createdAt": "2026-07-15T12:02:58.010Z"
    -}
    \ No newline at end of file
    diff --git a/.workflow-data/events/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-evnt_01KXJTH8B5F4797F3XM7XFJMRC.json b/.workflow-data/events/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-evnt_01KXJTH8B5F4797F3XM7XFJMRC.json
    deleted file mode 100644
    index 1b2ffff..0000000
    --- a/.workflow-data/events/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-evnt_01KXJTH8B5F4797F3XM7XFJMRC.json
    +++ /dev/null
    @@ -1,12 +0,0 @@
    -{
    -  "eventType": "step_started",
    -  "specVersion": 5,
    -  "correlationId": "step_01KXJTH845WNPD9MC53BS00TSH",
    -  "eventData": {
    -    "stepName": "step//eve@0.16.2//dispatchTurnStep",
    -    "workflowName": "workflow//eve//workflowEntry"
    -  },
    -  "runId": "wrun_01KXJTH845B37ZAB3DJCPQ48Z8",
    -  "eventId": "evnt_01KXJTH8B5F4797F3XM7XFJMRC",
    -  "createdAt": "2026-07-15T12:02:58.021Z"
    -}
    \ No newline at end of file
    diff --git a/.workflow-data/events/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-evnt_01KXJTH8BAAG33XBTR56MB1X7H.json b/.workflow-data/events/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-evnt_01KXJTH8BAAG33XBTR56MB1X7H.json
    deleted file mode 100644
    index 159eb47..0000000
    --- a/.workflow-data/events/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-evnt_01KXJTH8BAAG33XBTR56MB1X7H.json
    +++ /dev/null
    @@ -1,15 +0,0 @@
    -{
    -  "eventType": "step_created",
    -  "runId": "wrun_01KXJTH845B37ZAB3DJCPQ48Z8",
    -  "eventId": "evnt_01KXJTH8BAAG33XBTR56MB1X7H",
    -  "createdAt": "2026-07-15T12:02:58.021Z",
    -  "specVersion": 5,
    -  "correlationId": "step_01KXJTH845WNPD9MC53BS00TSH",
    -  "eventData": {
    -    "stepName": "step//eve@0.16.2//dispatchTurnStep",
    -    "input": {
    -      "__type": "Uint8Array",
    -      "data": "enN0ZCi1L/1g2St1oABqw8QhPkBp1BzDMAzDMAzDwzhuRzukT5pMkbpTUuwkEZJCNh8Grphyb5iPKVe2YTwEy7GKGhq19n8XAO42SOkoCjABMgLqAQACXS1Mqd0Eh6cwn9XpDaiGUe6E4baG/PX8ftl4g21d65FtPSCFG9k8VqpbYkD8PgpGwFiWBQHReDbXw63Wtb+uyAmCuhqPA3IEsCwpcfTQQtCwymUBoEISERE5HocDN6RDCssQQdIo1L5fHiHR7zxNvJUUgqRRIExRWARbdxqxDBKSj23volqJ5G2MoO3DB5JG+Z680idRWIRIxvXREMN1UhiEKWWybXEKtVMyTFTXhtOKocewUthEpFEg/rcKgxD5+DD8V2hCAoIDCNQg0PNgeR5AniXSmsQi4eDRxQEEyIREQiJpdrJNpFH0tekvpTBJZAKmVP+TwjJAIhGRprAME5AMECAY27f1ixChgP3Kz48fRBpl+qgOIhof/+tIpPm3VITv7yICpFHcvqcTxB60Fx9mJwvXYwcF3xWWQYLSJ4EwhdKFr6E4wBR1uBOFgfuuFTISSNhRLvQ64U4aVhSnBQoaudPnixlK7QRpfKw+doSk7ktFcIApjU00ijdtd0FolPbYQ5mAKRGNa/ivoeXB+M1EAxMSCWBUFGAhmUDRAATJBAcSEwRsFMCAAZCIjhehpbCN8FkGiUb5WL2L940RLFQmYBkiJI2yr6/xmt0dQBrlP/ZfV7SVgJ0yXFdYxD36DC/8W6iVwiCQRtnWlMIeNMoFd8Jum8IcNMpbj954zb+uohpSmKRRfPnZ8aOVQsoE7IGIAyyD0wWcp1cYZGkUh7rAwujtIIVBGsUlqMoEDrjJtlAr9/zJPL6+J8bGBgHJpGclAhY0CoBYQKMimeMkcxyMkJMePX2tnyR2EdqPpT76aU9d3zpJsz/Ky/1bxw4fjTLqhPuezGFDuAk7Yb/Im9HF9fxi1a5wLPW6T0+WwpHOG8n40xAkjN7Tp6evd/Wx+RfJ7FWplEtF15NM1o13+p30o+lMm30K7XN6HXaUD+0EQZoU7IDe2TnJtGUXvJ5k70ozNiqSOcQOymahp84buO5PxyH+y+nTDu+44MYIFHhWS49bdNDjZBgZFDQma9fhXuqef2ELMH2En+3FhtIzo2BHcKt0aPXUYEML83qo1fIOOVondQ+Qzs3DwwWVYlil88NDMq85N4q4pabDtfxpTpBuW5/rMT311SIZMGB+/fPtdCEZ14/1jU4nuVR0V4tk1nGUHnVW/R5QuycdxzlhTNj2bVXplM/pcU2W56XO2lYVO69SM+KU4OveLqfvppzShRn7Sgmv6b5R6vbw4LF5srBiz4eHf0utpG6ZJJ4yaueU8tRcCfgZNsPq4SHZw8M/PGSz6dLjhdNnN2Zd231tJ03luzq403tAO0HpsWvlf+xjDnHE0FaeHpA+U7KHYrdS9udrY2hbMt9nX7iTlbpUNlW3S83X+SJM5mku1IyNAeJyr5eH02uV/zbb0wzOHpCMA4RBNqhWf0O2txMnGefVRU7Crqx9TjKnrbOcjuM4rKOC6x3MwdjBOhhjOXHIcZzMZVksqOCCdCYOObk0D2nED/WCheYesK1kvAG7t/vkTnSCms/PXuMN4C6QzANO39cJf1O7vJHMeiiV/U4fbM0TdtOd1mNV6dK/XA8PqZfjy8EI9TN3+iT2XF5X+ZAKkIyD5vART/7Ypfu+dfreoFBebj3YPUm5pQR161JoLfa18QTxZKWEa1+v84ff0wpr3/Rs5bP+UhC7MCV8fPJBzdiomCQmgJHw7TwlS9UPWdjKth6hjjIiskhQkP/OLRn+kpmNpRGCZNvYq5gQ68K2/L4b8UUyEhERkNjp3EbX05TUCZBMezGKemnYkln7kr23y+aAZCQOvjC+7gEZCiRryAaGzkWMZCI82QaxDg02NzDGQF6EFH4vqZ+zvvPH5ov9MrpIpm17XfnCbEpZuRR/o6jWd9tyP1ZUc7OP3bo+Ci3klq/83lSyh/pOkYwDEYCFxVKhwoIBAwYMEEuvQ7iT8Z0dLkYyYGC12yetdlEuzsUqn0jA8wDptOqF1FX7TLHLfX36+2m4Gck4BQEVGxgUFbkT185es1bXkyxSyZx6pp7ovxLUV0mz2jVgoXPs4c+SEnbST131j61/1bblK4aQhk60gG1vIVy3Gk5ICumxBw884ABTHLyjowPqMhKzDRmxU34u90DOrYoe/i42TUMhtXVWP4+3UsJ+1rrehQsMigsMCoyKCtl2kmJDyD+2I2fAwDmYvt3cOqeuT75+Mn/M7yKVzj2R4nFssDpoeb7bJOhYy5PLsXKM4KI9jhy3Ko85SXblR6snh3Qjl0manFmquDQQ/zbDgXB4ssG8CBvmi9PH5XEspJV7wL7wOB4H4/vxMeWq2JDmPtlc7Omx/mOlUlOCtRkY62y5uhe32mchA6NfBkZeGctCsCOPVSKQV+t178AqJ8mxoG7hi/lKwY4WSvDoDbRCMg5w/5X61zBiwKJCsob0tk4AjZeN7rw42SboKXx0IZSsq/2NErqKZCIVe2gkw7wtc+a+bdFfqtF1UFZKPdHdaiQDufC8jqN+C8k482MHAu6zOjMWhzk4k+Q05MUBFf2T6+M4uydWzNY6B8g0KlR4T6kN7tlWO6fpDtRWVMOqIVvzePmqV4JL8eQxjFG2lJdSzsmu76JG2/Ka4NDwUCQDBv0kTv+VPOr0sZmXcxofUopk+GFPnpS6Qt4Q0rxc15FERCwYKCooWEQiIpaMjQpIRMRCwYCLjA2NxQIFDYuL9KfTt3UJe2GOdaIv6k4UygnJOIA2ijbbPrTVx0IwlrAb9wYSzmA33oAtkpEwf19J4qdCMpHMf0qx25cNFSkkA8lsHlArQNooZvF4GoUhqDMIwp4moWOIRkaSFAqNASMQkEDCwoMTKqFu/AETQJfLA2ENMoaGZCQoKChISZI2A5nK6zH4gcT0/LqlahOyLNzmwgVGqioq8SlTqW/C9D7c6wMlFeu8DqOIMM70R3LGn7KWnbXUTweh7OMT2ohD6a3CSmTUG7Cj6RWZIF7xur0AKDmXGWgARGJY2rDTbH0HmKtlWpRWyQ3vtx4IOD1S6pCHZaQIw0OF6gdwDNKzIWx1BHs2vfOqZH6VxEbBpOeAtbQj3xTOS7JG2VuNXKKu+h4D6v2ycSewk2UzzeedUDkXREonvURlTh8+ITclRFpfsfCtrn4bRG8EkxUAfO+5yMKDy0OdzYuuxE6aZUmMwFKahEMizI2Wc69kygHEOyVoz8IbXigb3i3OKiXQl6Cufp4Ep5qDv88W5k9VRiG7ibVbvHfgCYWO0RypTh+3ULjAJku8El05+hr2v99uYILwtf2MjZGFZ52/cuFc6SmLHlnscUs9MHfj9Loy3xZX4XoooM1nQuNpvvJJfBEOokMhsGTU3EaCBQsa05NaD91fnTB1qiy4wvJtmQiZMG1GBzTYeNxw9Qra2hgHepThl3ml8/VXI/I09z5MPj5cpar80zLliB8o9DYBAdF753rNzCCuKyGwiwMGLH0rRl4nBuMHSOpp2AE5uzPsvzbSaTY1ldA1E67+wfo1WpVv4J9yZiDgeXoSH2nSyEWtaOvrCpXJkwXyrm42z1aBH5KoGdMCb/0NRr++VYUCCxg+hF2iC9ywtDCbcZya4f+OYnFoIoIY5GMd0jvMjS+sEnb6gJ8z5bIp56zAPleM3l+CpNbt4hUqUIOXd58OsKxpWIdEzbTBIdf+oOKbllAxTTFJJu28ol9a06hPTlVAZgm1eZTrI6UERUSZtplj4h91HWIupM16CIOkcDjAY0PyMh5Z/LJmKN2s/bRfdT7EAp9gLJEE0l45QDA04x4dLRdUzhboBPoRgKb9EzZp5hLk8ScSCK3a2EXMP8FQ2VGEayTRbxY5Fcbr9vVER9UhexXcH4X0cctX+GtRSYNQs/F84U9htLXZoGRNYq5ZonudF7vgrmQlarL97A83HG0GV1mz+oWyButGOuNGndqOuSdlDZ+aGyV90nhC6efUHkKT7TR/ak2SdBFFIYI8oE3/AWEELskaov+ARFWZgedZWVL4MDWIgS3TcKRcQ3fU+TiTzuKOHDbM76mUqu3RDId8xvDes9WM9paZfZASBDj3NUtDKBQTIRlmQ8LeaGZdukAj4mstFAv4T+6YU8+STH87rpzoGdyb6kvTIpXfbAdmUBmWCJsoh7Op+sxRnJkU0znESkI+lhmoSmcCM5Rt5SYwcoRQwZrDrjW2m4mnKQNzPoYyozb5dEQB58ZdMzx3RWThW8NZLGymt1HqdgEBIO6ydjg+IpzIUCFTbU9BT+h5rH7YsDYzFkm05UeBg64FscazpPRN+zZYjMwbQNHWlB31XuGMh3K0vmFcDE3YPCYHc7BSunXR6hQkOmKoCfl1Hub7KQyt434OAaPQ8GXyaAoP0sFs9RisheqJ+uLwNJ5Dh42hMinpbd9xoTPorGhgJ8pcAJUTJWbE1dACPW4DGxa1QWJ5mCnevZAtVLYv5rNDI4VRhE+Db43uKaby2QaD1fb0SLwSvyuTQPwyJBYcM4WWZj9QXVTFujRgJ1mcQYbtPXOrkcYbZQ0pU8wIBF/6zyiLzNpk2UPJDAc0an06VPNQzk9xWAludWnUsvaGr7cdHkjzgxWuxPOG1VjmB/4NGdceRqi1DzBkDzdpWjqaWwxJfwsat3nbjkIea9pcZoKEu4FCbB2FmUObJNdY96azaMa/pqZYattsp/xAD9YsUIURNnmpFYL+K1QcQ04FJtNIMqXFtT6feTDkhKsgRz/KwTiMaUQ1BHpI4bA3okpAbsQG0JiyP8cPoVFvIg7Erv3laK0tXA3nCTUwLgTXnm9ai019/9FnvIRhSjVU82xQ0voogFZ3OLWHdx4x7BvikVl0SSgiGuQqYk4ueJR3MVQs0ksFER4utyJNDGj97mCLMySKcyiGDenObAOnXptDOLttRcSL/oarnlxZhxEdtSLF2geAoFEXwz5AwnNN6Me1fjvGZmnDc69rA2ghBj599HfjSz4hvH1YvmHFMTaIUK9JBsIm4Nj6sChl7BaOWKDBRCICCgc0MLehoQz6GNvuDx7ZaqNI/RF/6goPAHf8IYlE7dh7AXn/RPPfypgBOgwfTwt1NX4mLnDdODe8p1EV7LGifNFKw7eGqAi9zNkcKOVqx2AJOX0uuEMrLxwXqpBzGCcStRisiJFi4l5DSlBKP4XOlGWtONUxNvj1POmz25ESAKLL8s6XHRKBKmIXC+lMEg6onLS8AIqG919iJgg50avu62YsCkkNq1Frxzc4N4nEEQnVKCNGeXKEO8JHP/wb+uHAI2V2FJy3YpXIaVuqXoabuCCEzTYg4GmcAs3Vgna7ESfk/EG24wWYqpbMARaNpHatNe0Ira1u4mLyTJLQWZIxIZ7wElB/NBKGEUS7QN5C5nye25oIVjsQxh2DViGAIMp6Ua7AYQniMNmGP9JmiYLhePmngbVRRypElv0seUnQHpCxEzaDffrWvKFU2ig6+2qgWRwe3YQL/JaEy64hZsvbgN7c3BQKfvB+LoGT4Qwhao7Pv4Y0lVZjCFNaTI/+7GXkGSgw3vsyRsI7NCYaFSvgTvNtWCw/sP8Zff/iCex6aaMLBGUSHqNmLcYGc+ZluYFek79EoAF5K+skiPo7g+WA1Easd2NYk34gpOSN6MkzKx3oU64pHKmCjG45H84KMFcQ7qucRvm02aU9oxAUJ6Z9GPSAxk29whYSNNuMmseFa5M7eyYxgXkXeJbITQFL2JZxwST30huun496SwXvS3h7duB8t43YtzBxz8ut0VMMw43vk9MukuW81VMnnEMNkWj809pSr0KgYM8KZC5k7cl+0QUC7Ko7Jrt1/2urhaM7MeOGINMuYqja/AFDK/N34D4Zc2avHmG8LYymdkQTZF1iP3TUS/y51fIOXFMZnuzJ9wTBa04tdVpAMD0wKLgFWmIn/aLj7qGaroh/ismVQCB/r4O5SiZY0pgAVIBwEH+KsAFZzoB0zP80fxG4mhpVpXZeMajtuM4+yShi1fqVc9aKg/DoKlwDkEjOF3hhOxe7xgyxHWH+8hVFFetyeEDUDMBSDqdhbQ3p2coeOH9sDBMOQDxOy1Sc6LC4xrUBEDqM5Daxk5aw64C1bXsqTfGMujSVPqqIiA0x6mt4PadwPtHa59uEm90slAM9+fmVVNcJS7lHZijo2ykSWWQCBB4wY7u0FAoc9IpSKJ5DMTJnNPPHAKhZRsUABC5OEF8XOoGvEr0UEtJdsWxrbuXJdqPSu9KZggvJD0NYJGrKMjD/qAqON20t/lIbcF+Y1CxlEYBZUuXId0rro5bjOEFGYTPR+hGS0eapOCGT7PxES3jPSTmyr0MnTYSQaczGVTpN6IjKmrBSf2RCi+CM2j3RENtAoCkf/qGhKYH5zVuq1XdHt9QpN48yiYeIVt23ZvA5VaaxUyEoYqkSEFUnNe1ipKtymEb8CrOeLBKVZifn2zkgCzo9hVfLj91CCT09Ygy+ayXsKerHEquHSXxWKmRyH8pP2su4wgbCOGZOiEPPRecicb7Wy1guZHRQGEKMo6+Ot203SEXGmy88CtBuj6Xx1roYmY8v4VG7VO+SFbDAYqONNuShPD5IM2EtAOFFVse7aGHvdOeOns4l75w/Tlyvb71adaoSbArp/VoT/Q1PyMChr6hfDPuEIq5KQpicpoWugRjDHseK9n53XbvV9rUXgaNKXdDbad/3In/MnKbpm0EDhHafHL2JdzeDQBfNnFOKJxNs/0YTI5Pr1QMA8GBIVESqEBo6db9J2XmZ49vMEcDXIu/L62hEnRMpky70oYvu7QKov+gG"
    -    }
    -  }
    -}
    \ No newline at end of file
    diff --git a/.workflow-data/events/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-evnt_01KXJTH8CG3R587CZ51B1GV6VA.json b/.workflow-data/events/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-evnt_01KXJTH8CG3R587CZ51B1GV6VA.json
    deleted file mode 100644
    index aa3b146..0000000
    --- a/.workflow-data/events/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-evnt_01KXJTH8CG3R587CZ51B1GV6VA.json
    +++ /dev/null
    @@ -1,16 +0,0 @@
    -{
    -  "eventType": "step_completed",
    -  "specVersion": 5,
    -  "correlationId": "step_01KXJTH845WNPD9MC53BS00TSH",
    -  "eventData": {
    -    "stepName": "step//eve@0.16.2//dispatchTurnStep",
    -    "workflowName": "workflow//eve//workflowEntry",
    -    "result": {
    -      "__type": "Uint8Array",
    -      "data": "ZGV2bFt7InJ1bklkIjoxfSwid3J1bl8wMUtYSlRIOEJYNUVKNDJLUFFRQkNTQzlTRSJd"
    -    }
    -  },
    -  "runId": "wrun_01KXJTH845B37ZAB3DJCPQ48Z8",
    -  "eventId": "evnt_01KXJTH8CG3R587CZ51B1GV6VA",
    -  "createdAt": "2026-07-15T12:02:58.064Z"
    -}
    \ No newline at end of file
    diff --git a/.workflow-data/events/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-evnt_01KXJTH8NXCD022ADW68TSHQG3.json b/.workflow-data/events/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-evnt_01KXJTH8NXCD022ADW68TSHQG3.json
    deleted file mode 100644
    index fe133af..0000000
    --- a/.workflow-data/events/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-evnt_01KXJTH8NXCD022ADW68TSHQG3.json
    +++ /dev/null
    @@ -1,15 +0,0 @@
    -{
    -  "eventType": "hook_received",
    -  "specVersion": 5,
    -  "correlationId": "hook_01KXJTH845WNPD9MC53BS00TSG",
    -  "eventData": {
    -    "token": "wrun_01KXJTH845B37ZAB3DJCPQ48Z8:turn-control:0",
    -    "payload": {
    -      "__type": "Uint8Array",
    -      "data": "enN0ZCi1L/1gHStdngAKwUwhPkBp1BzDMAzDMAzDwzhuR6vcv5tMKXGnpNhJIiSFbD4MXDHl3jAfU65MZ2EQLMeOhmq0335SALjbIKWjKMAEJALmAfoBk5ULo+tS2VTdLjVf54swmYQ7aVhRnBYmaOTTXKgZG0PE5V4vD6fXKv9ttqfZ1cKU2kl4eArzWZ3OYKdPqmGUO2G4zSF/Pb9fNt5gW9d6ZFsPSOFGNo+V6pYYEb+PgfuuFMzAWJYVEdF4NtfDrda1v67ICYK6Go8DcgiwLClx9BpaHloIGla5LABUSCCQyPE4HtghXWEbIpJGofb9conko5/21CUkjXLBfucJ8lbSACQaJcIgbN1pxDZIYPyPbe+iWgcSb2OGtg/1NXrySp8r7IFE00CiUTzj+miI4TopbIIpCAQiad57iohoFAgNQJhIAKOiAAuJBIoGHkgkNJiAQGGjAAYMiEA6XoSWwjbCZxsgEu/ifWOGhZNti1Oo3QYI1bXhtGLoMawUBiHSKBD/W4U9iHx8GP6rw528hhSmQBAmHjSIQC0CPQ6Wx0HkWSRam1gmGjy6NHgQgSCZkEianWwTaRR9bfpLKUwiooEp1f+ksA2QiCssAKVteOCgURaCsbf1k5BoFAcVWFcJHpA+zqlEo7SLACLPjh+tFKKA/crPjx1EGmX6qJFG2dbUxHr0Rnz8ryP6b6kI398FhEZx+55OEGvQKOvaiw+zk1U0MEVhyr5uCtsgkWiUfX2N1+y+rrCJRvmP/dcVbSNgpwzXYUM4wVlhkkb5WH1shUloYBsaSBqlPfZQWGRpFF+GO2G3Fm3hRlF8FBZplNf8kCoaHHCTbQGu+sfWv2rb8hVDSEMnWkB7C+G61VBCUkiPHWrlnj+Zx9f3xNjYoJBMelYiYEGjgIgFNCqSOU4yx8EIOenR09f6SWIXof1YSt86SbM/ysv9W8cOH40y6oT7nsw3YSfsF3kzurieX6zaFY6lXvfpyVI40nkjGX8agijXe/r09PWuPjb/Ipm9KpVyqeh6ksm68U6/k340nWmzT6F9Tq/Djih9+dBOEKRJwQ7onZ2TTFsY2QWvJ9m70oyNimQOsYOyWeipcwau+9NxiP9y+rTDOy64MYMCz2rpcYsOepwMI2OCxmTtOtxL3fNvRTUEewDYUU4f4Wd7saH0zCjYEdwqHVo9NdjQwrwearW8Q47WSd0EpHMDAXFBpRhW6QwBkcxrzn/cUtPhWv40J0i3rc/1mJ76apELFjC//vl2upCMr6so/Vjf6HSSS0V3tUhmHUfpUWfV7wG1e9JxnBPGhG3fVpVO+Zwe12R5XuqsbVWx8yo1I84Ivu7tcvpuyildmLGvjPCa7hulbhAQHpsnCz32hID4t9RK6pZJ4imjdk4pT82NgJ9hM6wgIJJBQDwERDYX3MmmS48XTp/dmHVt97WdNJXv6uBO7wHtBKXHrpX/sY85xBFDW3lOyR6K3UrZn6+NoW3JfJ994Qbs9mVDxQnJRDKbB9QKkDaKWTyeOntAMg+RBdmgWv0O2d5OnGScVxc5Cbuy9jnJnLbOcjqO47COCq53MAdjB+tgjOXEIcdxMpdloWCCCtKZOOTk0jykET/UCxYat3x1D9hWMs6A3dt9cic6Qc3nZ69xBnAXSMYBp+/rhL+pXd5IZj2Uyn6nD7bmCbvpTuuxqnTpXy4IiNTLMYQR6mfu9Ensubyu8iEdIJkG7eEjnvyxS/d96/TdQaG83Hqwe5Jyywjq1qXQWuxr4wniycoI175e5w+/pxXWvunZymf9pSJ2YUb4+OSDmrFRMUlMgYnw7TwlS9UfWdjKth6hjhIisUxIkP/OLRn+kpmNpRGCZNvYq5gQ68K2/L4b8UUyExBIJHY6t9H1NCV1AyTTXoyiXhq2ZNa+ZO/tsjkgGcmDL4yve0CGAskc0oGhcxEjGQmebIvYhwabHRhjIi/CCb+X1M9Z3/lj88V+GV0k07a9rnxhNqWsXIq/UVTru225HyuqudnHbl2fS6GF3B6/N5XMKZJxIgSwsFgqVFgwYMCAIWLp9Qh3Mr6zw8XIBQusdvuk1S7KxblY5RMpPBOQTqteSF21zxS73Nenv5+Gm5GMU1Co2MCgqMiduHb2mrW6nmSRSubUM/VE/5Wgvkqa1a4Bb6Fz7OHP0i4j7KSfBg8o76IvXJyLj22YkDSKooE94ABTHryjowPqMhKzDhmxU34u90DOrYoe/i42TUMhtXVWP4+3UsJ+1rrehQsMigsMCoyKCtl2kmJDyD+2I1+wwDmYvt3cOqeuT75+Mn/M7yKVzj2R4nFssDpoeb7bJOhYy5PLsXLMcNEeR45blce8omRXfrR0I5dJmpxZqrg0Ef82w4lweLLBvAgb5ovTx+VxLKSVe8C+8DgeB+P78THlqtiQ5j7ZXOzpsf5jpVIzgrUZGOtsuboXt9pnIQOjXwZGXhnLQrAjj1UikFfrde/AKifJsaBu4Yv5SsGOFkZwZ6AVknmA+6/Uv4YRAxYVkjmkt3UEaLxsdOfFyTZBT+GjC6FkXe1vlNBVJCNRsYdGMszbMmfu2xb9pRpdB2Wl1BPdrUYykQvP6zjqt5CMMz92IuBmLA57cCbJcciLAyr6J9fHcXZPrBIyW+seINOoUJFtUx3cs612TtMfqK2ohpVDtubx8lWvBJfiSXwMY5Qt5aWUc7Lru6jRtrwkPDg8FLlgQT+J038ljzp9bOblnMaHlCL5YU+elLpC3hDSvFzXkUAgCwaKigkWEhDIkrFREYFAlgkGXGRsaCwWJmhYXOT70+nbuoS9sHWPOtaJvqg7USglJNMA2ijabPvQVh8bwVjCbtwZTDiD3TgDtkhGwvx9JYmfCslIZP5TKoUOqCP4yZ4GIWRqZiRJClLoIxCQQALDQyMioWz7ARMAl+sTZQ0yhoRkFBQUFKQkGTYDs+iql7i+F12buS5gdbXMxHg9BT8BTJ6vb6x285a1YC5QMlK+olJPSZVa5aXuQ78+QNKyTiQwI4JrZjiSG4fJCm2sZXM6DZVNn6CQeJEeeKxKRhqOhabvR4IQ4PUjAkB6Lg+zAVDEImgDStPiBxh6zrSoqhIG76t5YHASsdThH4BIGf2HKvYHUDYos9HWah7sFbsnW8mkkEQcgpnnnLUUrywUhi5JHwWyGtxyXgV5DNz9psSdc6eaMx3PS1LZD4k8Jj2zyhAfMCU3a4hQX5XwUV09AYRkBPcVGXzHv0izB4tDKZsDrkROGmTJmMCgmnSxRMJtSrNdScgBu3cSWJ8Fft4UGxYgzo5SepSnn3SCw02kPyAL62+qVyS7VNmN3kviqYUOTILK0y9aGFkEnAVcSVcmpIbP3G9egEWItaFj68uCWQe+AnzO+ikgPTr2bpYcMEtxermbLxTXfz1E0WYqIWE0v/lEvggP0f0QU+lpYiIJFBZYrC9a37nbOkHUqVuwWfHtmwifMDpGDOhy48HCtRa0tREOJCtDLvN45w+lZpRp9j7cEXxopQr9JzTlmB8ToKMkV9NJWpLXbApCuZINbE/A1NKXauRGYhh+UlH3Sac0pXjOy1mBXAvpJIGaVCjA9Czx3/Aa/cq3+OcCQxbgKD0FGelsxK462iw7AZXlkwt5tm6TZ5zB73Rqx8TUWzMDsF+LVRWG5Rq+wO6kC31YcZidcDww8P88wiJucgBR56MEUnyYgRdWI0wLQCAyJbgQcNZFryFGZ12eptZwcSEqaOD116dALMsX1mFRM3Cw5bUpqAKipYOYPkcCFTvPkCStPdRLZ6qAGolRHsP6jlLSJiJB2zVjUscoHIRzaLN5hAEiDBvc2Fo2d2S5y6KhPFkJTHvV+SsLxIIxFhJYes0JAsaMx+nYXSA6L0A76McAHPuXu8lzlGDjn1WgVrUhF3H8RKazmxGUSDS/v882scL0I9FDdS68Su6fNfAh1Ff01CJII6VmVb4kHKGDtWmmZc3TuR6lexQv5uuukZV+sh3fHzIcpll1ZXH1m2Vt1I06486dcpq5O2UJn+oWZaSkgQ/ltal5hSar0/SpvcgSMYoSCIkAbfQXhhGtZKSJigOIU6UWz1xZ5vDhZ0AdW2jCAYEGXFBnV5mqBLcDbCC+pyNV6CMAHFwYK/IeSjMDW5L4QYbg59yerCshnpim1J0NYXqDnHVtgJoIlrSQKCg/mZrjAJhmQZqoOS6WiPG6t8GXyIKYf9gDu6tMCEU9lyPYFAPm7kYTdTr3qtTjw5iBpXRcMMPR9mcCCZHkPazF3PC/bWIiw5SKOWcD7VEQfACR+7nbsRkXuuIt/BJxLgv76XUgddFAoOq7fE44HBmcuKlpVG2hwCWU9lhtbGgyjKXxtEWj6iUBBMMaf0hpgAYGsHSZJcAsWyNJmnnFiN+OFFPDyBqaZXlMBsz3sngvRAtWMHWE1CX4derMNy0Mk8YtOoTZsPEV9GgjNVJ3Nvbp1QLnyX0h83SloduNQZns6Y8vUdBxNRX/VHiU3QMFP+VYxIHS0j1PA00UtQyxXJiHXqTKVkW2N/PRopGeccon7d2avSbGZX4GJaXtbQopcXaZBMmXVbFoxJT9Kv6B6meHYjlkOWGm3fvn1hmN18iCKUOmGlSz2p9BEzmByWqHKjscMuqzOvDzIH7X9DiMxi0njfysdeG7bccXUvtgDiuZuaERy57AyCGn2pMI//vghdT9Jp0tg+dWTlKTBdrNprVRwGENhxQdSEA1EM7Ww1XmSE3bNWS86RLd+9euaUZtji2eH2qINVJU8QmbiFp90Bxl8zEYqxgw/WomBnEZ5aM5mAnjVxDXD687Tmk0FBmCHlI0scOotCB6Qh4bguzqSPZo1M2JA921oxxVaxuroX5CCJaHICfzHeSjqO+BhwlfYrG1Mqr7Nsa1ThbQ1SOe2pganFj2LfsIKrotFBctuWKlpzCPTl4scAshqiClz1etCBcDHr8L2aI4qUedDWHPyx1O/ZkDf1bb0sVLfpOqHkSsU49OsurEGw9wovEphkFgHWc39INagzp+srTA885tA+AnBnj65LeUr0ohaPvQfkMTY5QVoZLJAgRSwBz6/FXe2C0AWFBgEhJRAi8aENuAUMZ9LG0fBE9v0VTE/vAvdZ8QtjvuPclq7ax7iPzPRJxv18sAEgZFTwvqqngmEnABE5AuMK4VdLHq9cVshtwLkQm9n7EcoNbqeLAddppZsIlWbjgEqrg50yUStZisCEvF2r0kRFCkvwhdL2uqWKpjf/81H+nN2DEIwAlk4eabHKKPqtguE+lPErpeeeP5ViiK+G9UJjRw4lbN6/4sGpTaRSNfx+0gbDLFwinRCD9GqzjedrKNpvvX0sPyI3d2BDn77aolJ7Zkf82bUkEwattEWU/zFLSvZu3aRzzU9gfOzghQn2pvDjY/kuZaxbQTtta6qTUmOpI8ZEnVBCAKT406uCO5GaHv4nh3mIP03OmNYMaBkneEaKUJpKCs8XJ9hx0/B4dtiHbbyAtW4nU2La2tOxJDlPyzaEpSYQGGnYIMFvkbrI0Y0v6jExICWXHgdRNdoFISLLsmDPHeRsvmns04+wfqc+W4k/ORqMnZPmJIjmGVB7jF4hX6QyyD3ECHkbqW0VfAfDFxqrg4d5ovxGL1QAvZBvsvZ+CVSx5dZSgr4LFtNjHSMDGX5778Ov9FTBocFVkvggzfCW0OEm0UbzfPmrIHLmXaCLc889VTmXKRwrEryCz+8nC9wHSlcN8Ptop1Vt3WMwTBNmLmh0EgNI56oei6xpAu2oZkeenTtuYcTUQEJtMgWYI8ReydKkYKKAv2MV37HTUpHd6z/K2mgZXf5mff4SRZ+K3fSuHzOoRO1rsELHuPUFY4RhqqpfFDg5WKCqEFmyuooXAIPcClliBynLqf2rv3M6nOm1hjQ4bJFjFGbfIg0crtOpCqBm2XTWGhMEs5Kryk9JDNWPpBLl7G/2Q2O5Smfg9nyd7HENApLRyi6xzqVjxSWrgAjWTnzdFJ3UOa7pHDybErGZLP1FGt8h4sMe5HBfe5hWntdYytcVu2lHRj8wm66L+KGCXY61AxuNyBqT3JeL+qJMqdifm66Lrw3ANIfM+EeBGyihXHnIQdhv8OB0UOUzhyIJoNcFBK0xCmwvV2T7mcvzKGPgdsPJRlRpzeLkrjSADzkwKAmukkLmxkgL/tYEpGuUwdcZRQVHUQG2Q40ajL6eEmofXAxxCOfrO5DuTa6Wio0gk6uM2YtaAaJiQVlUkI6MCkd0km1D8ID6aonhM4JK5r1ByDglpx7yzekKeuO2FVrNKQTn6yRHOZJ4sbFd8i/UO5tv4wJDYPX71B7s8o50Kr7TBVbYNiz9GauyxkmDeqIHxLaRCelg50bO1fq5PE2i8VJ7YkEa2JCQX7Axu5tKMjTyykjZANM3P6itEQqNjXvkXeipAY7ZJovDawdKqIv/fkpN/RJIu9PkxUmp2VER0guCKt4S+aCc/5fKaCRD/VGaLipLVuDHVVDtPU7+v5RC1QJXJgXV+5p4GodBIO4YkC4jP77+LE/Uu9w4W9oaCQ3Z8IqmekUZtDyygd8CmEy2elmp0zbYmBJq9DmF+DAH2+atWz/oGE5DqNuucGqwd7YVh7eC9W7iiMSAvOB9/5gY73rXF1xg3BQ4ZafmS6cYM1AmKZzYnOP6QVaHQuK6G/alxiu7Vhr6bcaX2IdymB/+KSP2KkrMexwmfJkMujgDKjbIr4YpHKje88C1eBEzIpjFdcK0W5dNpISYXUP1A/Ufe13/a5BXrm6ozPjw9ypK7888FpEQTXFTauS/1nVDc="
    -    }
    -  },
    -  "runId": "wrun_01KXJTH845B37ZAB3DJCPQ48Z8",
    -  "eventId": "evnt_01KXJTH8NXCD022ADW68TSHQG3",
    -  "createdAt": "2026-07-15T12:02:58.365Z"
    -}
    \ No newline at end of file
    diff --git a/.workflow-data/events/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-evnt_01KXJTH8PKRP0VRWJ1T9FJTNYW.json b/.workflow-data/events/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-evnt_01KXJTH8PKRP0VRWJ1T9FJTNYW.json
    deleted file mode 100644
    index be1992b..0000000
    --- a/.workflow-data/events/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-evnt_01KXJTH8PKRP0VRWJ1T9FJTNYW.json
    +++ /dev/null
    @@ -1,11 +0,0 @@
    -{
    -  "eventType": "hook_disposed",
    -  "specVersion": 5,
    -  "correlationId": "hook_01KXJTH845WNPD9MC53BS00TSG",
    -  "eventData": {
    -    "token": "wrun_01KXJTH845B37ZAB3DJCPQ48Z8:turn-control:0"
    -  },
    -  "runId": "wrun_01KXJTH845B37ZAB3DJCPQ48Z8",
    -  "eventId": "evnt_01KXJTH8PKRP0VRWJ1T9FJTNYW",
    -  "createdAt": "2026-07-15T12:02:58.387Z"
    -}
    \ No newline at end of file
    diff --git a/.workflow-data/events/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-evnt_01KXJTH8PZ9940GMKQZ2AR7XBE.json b/.workflow-data/events/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-evnt_01KXJTH8PZ9940GMKQZ2AR7XBE.json
    deleted file mode 100644
    index f7bd4d0..0000000
    --- a/.workflow-data/events/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-evnt_01KXJTH8PZ9940GMKQZ2AR7XBE.json
    +++ /dev/null
    @@ -1,12 +0,0 @@
    -{
    -  "eventType": "step_started",
    -  "specVersion": 5,
    -  "correlationId": "step_01KXJTH845WNPD9MC53BS00TSJ",
    -  "eventData": {
    -    "stepName": "step//eve@0.16.2//fireSessionCallbackStep",
    -    "workflowName": "workflow//eve//workflowEntry"
    -  },
    -  "runId": "wrun_01KXJTH845B37ZAB3DJCPQ48Z8",
    -  "eventId": "evnt_01KXJTH8PZ9940GMKQZ2AR7XBE",
    -  "createdAt": "2026-07-15T12:02:58.399Z"
    -}
    \ No newline at end of file
    diff --git a/.workflow-data/events/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-evnt_01KXJTH8Q5760J3VRE30Z1MABJ.json b/.workflow-data/events/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-evnt_01KXJTH8Q5760J3VRE30Z1MABJ.json
    deleted file mode 100644
    index b3cab06..0000000
    --- a/.workflow-data/events/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-evnt_01KXJTH8Q5760J3VRE30Z1MABJ.json
    +++ /dev/null
    @@ -1,15 +0,0 @@
    -{
    -  "eventType": "step_created",
    -  "runId": "wrun_01KXJTH845B37ZAB3DJCPQ48Z8",
    -  "eventId": "evnt_01KXJTH8Q5760J3VRE30Z1MABJ",
    -  "createdAt": "2026-07-15T12:02:58.399Z",
    -  "specVersion": 5,
    -  "correlationId": "step_01KXJTH845WNPD9MC53BS00TSJ",
    -  "eventData": {
    -    "stepName": "step//eve@0.16.2//fireSessionCallbackStep",
    -    "input": {
    -      "__type": "Uint8Array",
    -      "data": "ZGV2bFt7ImFyZ3MiOjEsImNsb3N1cmVWYXJzIjotMSwidGhpc1ZhbCI6LTF9LFsyXSx7ImVycm9yIjotMSwib3V0cHV0IjozLCJzZXJpYWxpemVkQ29udGV4dCI6NCwic3RhdHVzIjoyM30sIiIseyJldmUuYnVuZGxlIjo1LCJldmUuY2hhbm5lbCI6OCwiZXZlLmNoYW5uZWxJbnN0cnVtZW50YXRpb24iOjExLCJldmUuY29udGludWF0aW9uVG9rZW4iOjE0LCJldmUubW9kZSI6MTUsImV2ZS5hdXRoIjoxNiwiZXZlLmluaXRpYXRvckF1dGgiOjE2LCJldmUuY2FwYWJpbGl0aWVzIjoxOSwiZXZlLnNlc3Npb25JZCI6MjEsImV2ZS5jYWxsYmFja0Jhc2VVcmwiOjIyfSx7Im5vZGVJZCI6LTEsInNvdXJjZSI6Nn0seyJraW5kIjo3fSwiYnVuZGxlZCIseyJraW5kIjo5LCJzdGF0ZSI6MTB9LCJodHRwIix7fSx7ImtpbmQiOjEyLCJtZXRhZGF0YSI6MTN9LCJjaGFubmVsOmV2ZSIse30sImV2ZTpldmU6MzM0MzgxNzUtYWI1NC00ZGQyLWIxNmItNmJjMWRjMTU3NDhjIiwiY29udmVyc2F0aW9uIix7ImF0dHJpYnV0ZXMiOjE3LCJhdXRoZW50aWNhdG9yIjoxOCwicHJpbmNpcGFsSWQiOjE4LCJwcmluY2lwYWxUeXBlIjoxOH0se30sImxvY2FsLWRldiIseyJyZXF1ZXN0SW5wdXQiOjIwfSx0cnVlLCJ3cnVuXzAxS1hKVEg4NDVCMzdaQUIzREpDUFE0OFo4IiwiaHR0cDovL2xvY2FsaG9zdDozMDAwIiwiY29tcGxldGVkIl0="
    -    }
    -  }
    -}
    \ No newline at end of file
    diff --git a/.workflow-data/events/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-evnt_01KXJTH8QQ34X7BGABRKR1S2RZ.json b/.workflow-data/events/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-evnt_01KXJTH8QQ34X7BGABRKR1S2RZ.json
    deleted file mode 100644
    index b8316d6..0000000
    --- a/.workflow-data/events/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-evnt_01KXJTH8QQ34X7BGABRKR1S2RZ.json
    +++ /dev/null
    @@ -1,16 +0,0 @@
    -{
    -  "eventType": "step_completed",
    -  "specVersion": 5,
    -  "correlationId": "step_01KXJTH845WNPD9MC53BS00TSJ",
    -  "eventData": {
    -    "stepName": "step//eve@0.16.2//fireSessionCallbackStep",
    -    "workflowName": "workflow//eve//workflowEntry",
    -    "result": {
    -      "__type": "Uint8Array",
    -      "data": "ZGV2bC0x"
    -    }
    -  },
    -  "runId": "wrun_01KXJTH845B37ZAB3DJCPQ48Z8",
    -  "eventId": "evnt_01KXJTH8QQ34X7BGABRKR1S2RZ",
    -  "createdAt": "2026-07-15T12:02:58.423Z"
    -}
    \ No newline at end of file
    diff --git a/.workflow-data/events/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-evnt_01KXJTH8RKPB309XZK5Y4BYMZ1.json b/.workflow-data/events/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-evnt_01KXJTH8RKPB309XZK5Y4BYMZ1.json
    deleted file mode 100644
    index 37c58d9..0000000
    --- a/.workflow-data/events/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-evnt_01KXJTH8RKPB309XZK5Y4BYMZ1.json
    +++ /dev/null
    @@ -1,12 +0,0 @@
    -{
    -  "eventType": "step_started",
    -  "specVersion": 5,
    -  "correlationId": "step_01KXJTH845WNPD9MC53BS00TSK",
    -  "eventData": {
    -    "stepName": "step//eve@0.16.2//notifyDelegatedParentStep",
    -    "workflowName": "workflow//eve//workflowEntry"
    -  },
    -  "runId": "wrun_01KXJTH845B37ZAB3DJCPQ48Z8",
    -  "eventId": "evnt_01KXJTH8RKPB309XZK5Y4BYMZ1",
    -  "createdAt": "2026-07-15T12:02:58.451Z"
    -}
    \ No newline at end of file
    diff --git a/.workflow-data/events/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-evnt_01KXJTH8RR01RSZXV1DZJZF5Z0.json b/.workflow-data/events/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-evnt_01KXJTH8RR01RSZXV1DZJZF5Z0.json
    deleted file mode 100644
    index 35fa1c6..0000000
    --- a/.workflow-data/events/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-evnt_01KXJTH8RR01RSZXV1DZJZF5Z0.json
    +++ /dev/null
    @@ -1,15 +0,0 @@
    -{
    -  "eventType": "step_created",
    -  "runId": "wrun_01KXJTH845B37ZAB3DJCPQ48Z8",
    -  "eventId": "evnt_01KXJTH8RR01RSZXV1DZJZF5Z0",
    -  "createdAt": "2026-07-15T12:02:58.451Z",
    -  "specVersion": 5,
    -  "correlationId": "step_01KXJTH845WNPD9MC53BS00TSK",
    -  "eventData": {
    -    "stepName": "step//eve@0.16.2//notifyDelegatedParentStep",
    -    "input": {
    -      "__type": "Uint8Array",
    -      "data": "ZGV2bFt7ImFyZ3MiOjEsImNsb3N1cmVWYXJzIjotMSwidGhpc1ZhbCI6LTF9LFsyXSx7InJlc3VsdCI6LTEsInNlcmlhbGl6ZWRDb250ZXh0IjozfSx7ImV2ZS5idW5kbGUiOjQsImV2ZS5jaGFubmVsIjo3LCJldmUuY2hhbm5lbEluc3RydW1lbnRhdGlvbiI6MTAsImV2ZS5jb250aW51YXRpb25Ub2tlbiI6MTMsImV2ZS5tb2RlIjoxNCwiZXZlLmF1dGgiOjE1LCJldmUuaW5pdGlhdG9yQXV0aCI6MTUsImV2ZS5jYXBhYmlsaXRpZXMiOjE4LCJldmUuc2Vzc2lvbklkIjoyMCwiZXZlLmNhbGxiYWNrQmFzZVVybCI6MjF9LHsibm9kZUlkIjotMSwic291cmNlIjo1fSx7ImtpbmQiOjZ9LCJidW5kbGVkIix7ImtpbmQiOjgsInN0YXRlIjo5fSwiaHR0cCIse30seyJraW5kIjoxMSwibWV0YWRhdGEiOjEyfSwiY2hhbm5lbDpldmUiLHt9LCJldmU6ZXZlOjMzNDM4MTc1LWFiNTQtNGRkMi1iMTZiLTZiYzFkYzE1NzQ4YyIsImNvbnZlcnNhdGlvbiIseyJhdHRyaWJ1dGVzIjoxNiwiYXV0aGVudGljYXRvciI6MTcsInByaW5jaXBhbElkIjoxNywicHJpbmNpcGFsVHlwZSI6MTd9LHt9LCJsb2NhbC1kZXYiLHsicmVxdWVzdElucHV0IjoxOX0sdHJ1ZSwid3J1bl8wMUtYSlRIODQ1QjM3WkFCM0RKQ1BRNDhaOCIsImh0dHA6Ly9sb2NhbGhvc3Q6MzAwMCJd"
    -    }
    -  }
    -}
    \ No newline at end of file
    diff --git a/.workflow-data/events/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-evnt_01KXJTH8S7ZHYXJ2BVSCN6CTCK.json b/.workflow-data/events/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-evnt_01KXJTH8S7ZHYXJ2BVSCN6CTCK.json
    deleted file mode 100644
    index 23b3038..0000000
    --- a/.workflow-data/events/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-evnt_01KXJTH8S7ZHYXJ2BVSCN6CTCK.json
    +++ /dev/null
    @@ -1,16 +0,0 @@
    -{
    -  "eventType": "step_completed",
    -  "specVersion": 5,
    -  "correlationId": "step_01KXJTH845WNPD9MC53BS00TSK",
    -  "eventData": {
    -    "stepName": "step//eve@0.16.2//notifyDelegatedParentStep",
    -    "workflowName": "workflow//eve//workflowEntry",
    -    "result": {
    -      "__type": "Uint8Array",
    -      "data": "ZGV2bC0x"
    -    }
    -  },
    -  "runId": "wrun_01KXJTH845B37ZAB3DJCPQ48Z8",
    -  "eventId": "evnt_01KXJTH8S7ZHYXJ2BVSCN6CTCK",
    -  "createdAt": "2026-07-15T12:02:58.471Z"
    -}
    \ No newline at end of file
    diff --git a/.workflow-data/events/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-evnt_01KXJTH8T4GR6JF31P4AGQBQ02.json b/.workflow-data/events/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-evnt_01KXJTH8T4GR6JF31P4AGQBQ02.json
    deleted file mode 100644
    index 4058498..0000000
    --- a/.workflow-data/events/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-evnt_01KXJTH8T4GR6JF31P4AGQBQ02.json
    +++ /dev/null
    @@ -1,11 +0,0 @@
    -{
    -  "eventType": "hook_disposed",
    -  "specVersion": 5,
    -  "correlationId": "hook_01KXJTH845WNPD9MC53BS00TSE",
    -  "eventData": {
    -    "token": "wrun_01KXJTH845B37ZAB3DJCPQ48Z8:auth"
    -  },
    -  "runId": "wrun_01KXJTH845B37ZAB3DJCPQ48Z8",
    -  "eventId": "evnt_01KXJTH8T4GR6JF31P4AGQBQ02",
    -  "createdAt": "2026-07-15T12:02:58.500Z"
    -}
    \ No newline at end of file
    diff --git a/.workflow-data/events/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-evnt_01KXJTH8T4GR6JF31P4AGQBQ03.json b/.workflow-data/events/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-evnt_01KXJTH8T4GR6JF31P4AGQBQ03.json
    deleted file mode 100644
    index 4fa01ec..0000000
    --- a/.workflow-data/events/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-evnt_01KXJTH8T4GR6JF31P4AGQBQ03.json
    +++ /dev/null
    @@ -1,11 +0,0 @@
    -{
    -  "eventType": "hook_disposed",
    -  "specVersion": 5,
    -  "correlationId": "hook_01KXJTH845WNPD9MC53BS00TSF",
    -  "eventData": {
    -    "token": "eve:eve:33438175-ab54-4dd2-b16b-6bc1dc15748c"
    -  },
    -  "runId": "wrun_01KXJTH845B37ZAB3DJCPQ48Z8",
    -  "eventId": "evnt_01KXJTH8T4GR6JF31P4AGQBQ03",
    -  "createdAt": "2026-07-15T12:02:58.500Z"
    -}
    \ No newline at end of file
    diff --git a/.workflow-data/events/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-evnt_01KXJTH8V1GZVBWZZE28KSXE5X.json b/.workflow-data/events/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-evnt_01KXJTH8V1GZVBWZZE28KSXE5X.json
    deleted file mode 100644
    index f90bb05..0000000
    --- a/.workflow-data/events/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-evnt_01KXJTH8V1GZVBWZZE28KSXE5X.json
    +++ /dev/null
    @@ -1,13 +0,0 @@
    -{
    -  "eventType": "run_completed",
    -  "specVersion": 5,
    -  "eventData": {
    -    "output": {
    -      "__type": "Uint8Array",
    -      "data": "ZGV2bFt7Im91dHB1dCI6MX0sIiJd"
    -    }
    -  },
    -  "runId": "wrun_01KXJTH845B37ZAB3DJCPQ48Z8",
    -  "eventId": "evnt_01KXJTH8V1GZVBWZZE28KSXE5X",
    -  "createdAt": "2026-07-15T12:02:58.529Z"
    -}
    \ No newline at end of file
    diff --git a/.workflow-data/events/wrun_01KXJTH8BX5EJ42KPQQBCSC9SE-evnt_01KXJTH8C0Y67BDBTSW467JRNP.json b/.workflow-data/events/wrun_01KXJTH8BX5EJ42KPQQBCSC9SE-evnt_01KXJTH8C0Y67BDBTSW467JRNP.json
    deleted file mode 100644
    index ac70168..0000000
    --- a/.workflow-data/events/wrun_01KXJTH8BX5EJ42KPQQBCSC9SE-evnt_01KXJTH8C0Y67BDBTSW467JRNP.json
    +++ /dev/null
    @@ -1,28 +0,0 @@
    -{
    -  "eventType": "run_created",
    -  "specVersion": 5,
    -  "eventData": {
    -    "deploymentId": "dpl_local@1.0.0",
    -    "workflowName": "workflow//eve//turnWorkflow",
    -    "input": {
    -      "__type": "Uint8Array",
    -      "data": "enN0ZCi1L/1gICxNoQB6xPQhPkBp1BzDMAzDMAzDwzhuRzukT5pMkbpTEmmTqJEUsvkwiNIp94b5mHJlOguDHltBE6EI7befFADua6R0FAWYNgLuAQAC7SI8PIX5rE5nQDWUcptD/np+v3S8wbaupWRbSqSQI53HSnXLjIjfR8EIGsuyIiIcT+d6uNW69tcWOUVQd+N1wA4BGCYnLH20EDSskmEAsJBAILHjdTywQ3o04SzUvl8uMeEsF+x3niATzvJvJxqAxFkibFkYhK07lViGBoxiG4XkbYyg7cMHEmf5nrzS5wubkDiLa1wfDTNcp4VJmKpsY5YMkericFpx9BhWC4tInCXif7swiOQjxPBfowcTDigiUYtEUAMGahCBGInWJpgJCkgZCgeRB5IJicTZyjoSzqKvTX+phTWYgC3V/7SwDBMSS5OASDjLRjC2b+vXoAL2Kz8/lnCW6aM+kND4+F9TSDgRvj8MCQlncfueThELoL0INVvZBtJEBnAatfNwVVvY4tGDghkc/Fvqalc1iLwIF0ZB6ZuIsIXShb+xYGBLA/ddKWgokLCl3Oh1wq00rCjOChI2cqfPFzWU2ina+Fh97IVFmIm6LxXBwBa3bWEZIoyzNAaJOIs3bXcF4CztMUVC4iz7+hv+IOIs/7H/2qKtBOyU4frCJBFnWQfpM7Twb6FWC3vA+jpaPhp6GMsEbIE4ruG/jpgH4zsPHHgwoUCGhQEXkggVDjiQRKCYeDCBw4AGDohAPF6E1sI2wmcZJO8bI1i4TMAyOJA4y2t2uJWFOXCWj9XDqPZ9YQ2cZVtTC6OwgFth2BY24SxvKc3xmn9dRXW0MAln8eVnx5BWGi0TsAciGDC4yraeGRwcE5JNnpUJVNgwIIKBDYtkz5PscTBGT3r09LV+mrCL0X4s9dFQe+r61k00+6W83L917BBSKaVOuO/JHDaEm7AT9ou8KWFczy9W7UvHUq8L9WQtHenMkY1DDUHC6D19evp6Vx+bj5HNXpVOcqnoupLJuvFOv5WGNJ2ps0+jfU+vw5byo52iSJOCHtE7uyebtuyCF5TsXakGh0Uyj9hF6Wz01DkD1/35eMR/OX3q4R4X3BjBAs/qyeMWXfQ4WYaGhI3J2nW4l7rcCj//wiZg+gg/24sNJ8+Mgi3BrdKh1VODHS3M66FWzDtkad2ku4B0diAgLqgUwyqdISCyec25ksQtNR2u5U9zinTb+lyP6amvF9nQ0Pz659vJQjauH+sbnVZyqeiuF9msYyld6qz6KVE7KJ/HOWFM2PZtVemUz0m5JsvzUmdtq4qdV6kpcULwdW+X03dTTunCjH0lhNd03zjpBgHhsbmysGJPCIh/S+1EHTNNeEqpnVPKU3Ml4GfYDCsIiGQQEA8Bkc4Ft7Lpk8cLp89uzbq2+9pWmsp3dXCnp0Q7RUnZtfI/9jGPWOJoK09KpNCUDKLY7ST787VxtC2Z77Mv3MnKhdF1qXSqbpear/NFmM3TXKgZ+0LE5V4zD6fXKv9ttqfZ1cKcBJGGbFCtfodsbytPNs+rk56EXVn7nmRP22c5n+d5mEcF1z2Yg9GDeTDGsuLR8zyZDMNYUMEF+VQ8epJxPlKJH6qFCs0psK1snAG7twvlVnSCms/PnuMM4DKQTQNO39cKf1O7zJHNUpTKfqcPtuYJu+lO67GqlOlnLgiI1Mvx5WCM+pk7fRP2ZF5X+ZESkA1Fe3iJJ3/s0n3fOn130CgvtxR2b6LcEoK6dWm0F/vaeIp4shLCta/XOcTvqYW1b3q28ll/qYhdmBA+QvmganBYTBOe0ED4dp4SpuqPMGxlW49RSwmRYCYoyH/nlgyfyUzH0ghBsm3sVcyIdWFbft+VGCObCQgkEjudW+l6mhN1BGTTXpSkZhq2ZNa+ZO/t0kEgG8mDL4yvi4DGAskc0oGhczEjGwmubIvYhwabHRhrIi9CCb/XpJ+zvvPH5ov9UsLIpm17XfnCbEpZuRR/o6jWd9tyP1ZUs7OP3bpCGi3klq/83lSyh/pekc0TIcDFBUOBAnPhwoULEUyvR/iT8T0jGxqsdgul1U5KxrlYJRQnPBeQTqveSF21zxS73Feov6GGq5GNV0yw4MiosMituHb2mrW6oGSRSubUMwVF/51AfZ1oVrsHLHSOKQ4xCWEr/dRV/9j6V21jvmIYbWhFDdj2FsJ1q2GErJg8dqiVe/5kHl8/DzyAgS0P7uHhAXWbSbMOKbFThi4HRc6tihR/Fx3HqZi0dVY/yttJwobWup4FjIwKjIyKDAsK2XaaxIaRf2xL3tDgHEzfbm6dU1coXz+ZP+Z3kUrnoFjxOjhYXcQ8320T+FjLlcuxcowAoz2WHrcqj1lJduVHqyePlCOZaTJ5w1SRcSL+rcYT8XCFo3kRNswXp4/M69hIK6fAtvA6Xkfj+/Ex5arYkeZC2Vzs6bH+Y6VSE4K1GhnrbLm6F7faV0Ejo59GRl4azEawJY9VJpBX63X/wCqnyVNB3cIX85WCLS2E4M5AKWTzAPdfqX8NpQYuKCRzSG/7CNCY2ejOzJNtip5CSBdGybraXymhs8hGomLKRjbM2zJn7tsY/aUcXRdlpRQU3e1GNhELz+tY6q+QjTM/fiLgPqtTg3nYwzNNHofEQMCif3KFHmcHxYrZWvcA2QYFC+8p1cE922rnNP2B2opqWDlkcx4zX/VO4FJceQyjlD3JSynnZNd3UaVteUV4cIAqsqGh34TTfycedfrYzMs5jR9pRTb8sCdPSl0jbxhpXq77SCAQ5kKFhYQLCQiE0eCwiEAgjIQDMDQ4NpgKEjYuMNKfTt/WJWyGOdaKvqhb0SgjZEMRrSRttv1oq4+NYCxhO+4MJpzBdpwBX2QjYf6+kwlDFLKRyPynFLt96VBRQjaRzEaBSiHSRjUM5emzCGTzEIUnqCMIypwGoWOIRmYkKUg6IxCQQAIDZBMqnWz8AROA16sDYQ0yhoZkFBQUFKQkGTYDmcrrJvhhxvT6OtFq+7csEefCLUaCKnr2lH6pUMP8PsDpA5Nk61SALCJuy0BHsnF6WayHtVymS1Dw4xN+ihfp7YK1yCiAY6DpCZcg9Hj9HAFwnAs7ZgA6sWfa2NDEeQGmm58WUqvkg3e6PZA4PUDq+gc/Ul7noXLbA3gHCdkYt5AEu0Hu26NkHUniisHaczW1RCY/FCZLwkbpWw1ZIlf9GQPifspx59FZGjM9561S2aVFfCV9RWU3HyaTGxdCUl+58PmuXgOhZIT7Sja+I17k4YHs4cnmia/EJg1gyUBgAJr0LNHmRsEMruTigP29AQJnQTSvZBumFqdLibun0KqfvASTjcffZEvtb6s1kt207IrvvXjphYbgi9rTT1oYthDOsl+JR3akhrXdb1pQQTi2r2MLy5ZZf1+ZOpf4FDc9PvY8lgYw+3F6k5uvFBd/PSTRZjGhVTSF+CSvCDjR7pCvVNKEJAGPBZLohdYj97ZOLHXoFtzD+VZKhIIwHJsB9G887HC9gvbbKAN6yPCSudT5ZqwheBoHP/wXH3ypxv3znXKDjwk6I0HA//pZXrMnCPpKNNg3DgOmr5mRv8T48HcAdRFsv1yos4BeTek0QNVIaBEkgfna4hrtlQ/5lzHGLABweqozZmuytU7ahvQA1dSTP+lBt7RjmYBfrZQMs/S35oO/X4NVTYYFG/7CTqULbdhxmGVwzGDw/zjC4m1SADHlAwRSb5j9C3sTBrMBImJKuCl41tFeekavLuGn1uRiMxUY4hWgTzNYli+scaJGzsGE15agCo6WADHFi1RBdu6hH1orUE+eUwFEEpk8VugLSAlNRIe2HcdUjp44BEeQzb4JI9biQ+DH5tRplCyDsioo1Szgaa90PpYFZjAkRwLV3jhA0JpxBB3lC+LnB+gM/TYA8v3TbNI3JLbxeSkQo1rPiyB+8kfZ5QglksNvLOaEKGG6k+iruhhexfc/DXwS6qs4tTDauNR8kS/hpJDq2lRzWXM012/o3ueLd7grs3KDbOX0BwJHNNuuLFL9sKxXdSPIuFqnsNfcc1kgT6VDqVHSZkM5OTVdQmN32jW1TpIFjCI6ggnQuH4uYCQggQHRO2D0VMbgSS9Lbz68BgDGllY4dqiBHOqAmUlnuSGMjeN7NqSKe2TGQZ8xde/ZN9OjZaAfNAhKnDvJ6hFKxVRKkdhQ+Rs/sC43UAwiAi1UCuROOs4xs/gmPh5XS+TU7535JWqF5GPhgQmrDCzCvpd7NlVn5h7PbNt0RislLh9FBjalo8YMuW3jCRSMtGVYy+paZgsy8TXlxpzSsH2Ucp9CVO7cRWjGOa7oCj9WOMnClvRqlbo9EIjzLj8f3kc9JzIqKKotLrgJxRorZg67TGPxjXbD0YjRsOCw8YyUrmiXCkuTmQA8tLWZ4oHX2PFJjiJgGBVDIz6PTYP5VCzfpWiRCl5HNnqCX2eyfFfDEHXcqkOMDzO+Vo4uc0Dqzdn+z1qQPLAv0DwVY+i+xqhMcvrlC33ogJ69E92NsvWhvqUsiTgn7XYPZCAPUbNVLAJzivdq2XLPdkA+djTyMmb5dPbWYDhlWxtnkEW0PQSEQYmry6Qtv0yIpTQ+60bHDw4eUbFXvDdBFmTN0L37bv1K49WycsrE24Buq/kzRyKrNNnUUObCQUWdUAdLHmLz9jicxq04jVDWsvLbbScOUouD/Su55IZblt7AY0NIte0irOxDEzLHTbIWIMCtoqQyC6Jbv61RWGCN0Cm7IkHWQDRbpavMsZqwa3i8yRDR9q+pqVRtum04P3sM1pCo4hP2S7Wq0PnLKcegrAKQKeaZFuLKkq9wMJwDraCmH/x2DAIauD8EPmTLsZGocKBBAjc2ot3ckU/WqJuGQ4prk3IaayugrcIEMBwPQQrJF1aCk75Z65te4vYlOKoLNma3XhfA1cGS2vSeP1j3Lf7oqbsRihdNvoo1JyQelV0MMBaxUiHqj1isCDMG7H7fsEU5Ur46Y8POupO3wVcvzeGeibaE4jW8QVZPJdepRVdYCXHWA4RoHIpBFlDMMyb681r3O7pZ2OEZ7ZIBDBPLkX77tfXFTwjTPszfoNAYKU5obXIE0RGQAH1IFnJ24ygs4GDeESFBgAZqG76U8Y9F5UmLd7feL1x/JjN1EYWBO+KQZKV29n2AvJ5E6m/ZzwBuDKiexuhqeSYw4GIvR9TTwxWCsWr64knDYYc4AX2b8xzwzWphsEg7DV1wZqsSDjpV4pw4EWmxqFYUL8VlL/AQLKQfQ2cpa6lYp2OR+quGdAizYxKAtWX5zRc2RIGq1K4TmUuSHnd5tflaKEL4f1ImLXDSq/jrPiwESs1FI0XHOTBv8vMHWdhAAKPFOYa7iUfP+/fmYfkjZXYVOW/sMiaHtmR4DU28INPTNnnKc3qKTKtB7VorfiD4o2bHCvCn2jqH0h9Jca1jtSuzzrrhjokQSapnyWSC0oSnQp3jSNOMoHdxvC/MsT/3vkUw4kC9OyW1Egq5UJYWrq1DdpyDBhta3xY9Bdt4GZnO1saPhBHd9DOrksBeQGxH0wc7/r2peQ1pSXSaXOBWHAbdeBfoKAlgJwez/Ldpydz3FEL+QH9ODg/ifDNqo9inD0k3rJbuhbFIhn4Sy0A1CGLAl8v4CW9iTIRVlJQ7zddgcXygEDbX/U0x8OKSFl2IlEh4NM2hGBFmzlnk5H7t/wVOgwvcrIMgsO+8NodCNpLajaYm+mOVFG2ECs98lTea8mnhlBHk/pb0cLqgzDK5T+Q0mK8dXfKMHQFGMefDIB4aeuq1+CHFsA2+t2xT25qzM4kB5sfZ8QFgCekU+Go6ASwA50AedE121Kv0vVf3258Gon3bHX1jhntnljVXChVOY3Sy3ZlhiXt2tcIv0nAljaXartRXCCZYXUEThQo9tC8iQlTA6spsj+8n2/72FEmcq8HPEER0VRs/gNTqkA4UjxFkgtURjIfLUVVH4gAZyNKPdnl5XF3d7IA0VRCctfHOJ7TXqaVOGwia584LMEBT7BxOdJt7VNMzAgkt5EqK5DN1VKu8A0sc/50KJP0UWkI3IssTSff+T6EukleERpm4rlSM9B16v+cZ9a7apnJW1AIqOl0G92oS2RnJXtyx4uOY0r6j9r8YUbhjj9P2iIIBKZRTNexXtt40FGina2NbcxjGk1l+j3OaxWpsgwD/2pBn0zAJhq0bMMjWpXQosagrcemXit7YZEbBxo9nDwc/2ji+djgqmhXsQCk6rZQ3nNCJe5NZAZk/QKKoTJcAB0y0l2JCuYOAeIrrOYkmiUc0hCEC6tBPtOIREuoGJ7Sq68WBY7oYyOLNxZ2EhlQQC+lN5NKUw0DWiNgbheoPqXBZ3iZej18DVodUzd4WOMwSVQ4+oVSl1LLkC4wOdsytMyHvdjVFSp2Ezs+B9xh22CNbIHXwBDAzLdq4BaeojEhUVGppaAqcCD6ppYSNdA0imLLVj+b4HPGshRZWfUU0MHsmBcaL6PxpXf/arDyn85m0iSJVs4pymKJp7NrqBKW2X9azY3Mi6uzaWvsbhKujzQhzilCo0Xc54q4Lsm+pp3TMHzD6GVRkeD15YHrQ2MMXkpVqpaEqSvz9+ZzVd3s3eXj9oYwWSwwe42VQcGnkAGQIlzNmbhfoJIFYwyFzJFhPzgaJfyL+fySsBPrJYMR2zSaQ7N8EKoNArx4M9uGow8QQzTtsmwa2nyLDtkgIyqyh/O0nbAna4da/hzapk7uPeOXAckQ1aQVIEiemiQsUV1L91U9pBwk5ZaF6rtlzilY4WsUr6gJixziejxB1gOERoK3iCSkEVWDaf9aeU+5V5HKj86A265kIa6GlnQtRF2i7zJYtA3UB1VBTErXkQk0cniGeL5tz0T6N8JVJUSsRasXdBZ62Con5ubVXFwyAus6F8nYF"
    -    },
    -    "executionContext": {
    -      "traceCarrier": {},
    -      "workflowCoreVersion": "5.0.0-beta.24",
    -      "features": {
    -        "encryption": false
    -      }
    -    },
    -    "attributes": {
    -      "$eve.type": "turn",
    -      "$eve.parent": "wrun_01KXJTH845B37ZAB3DJCPQ48Z8",
    -      "$eve.root": "wrun_01KXJTH845B37ZAB3DJCPQ48Z8"
    -    },
    -    "allowReservedAttributes": true
    -  },
    -  "runId": "wrun_01KXJTH8BX5EJ42KPQQBCSC9SE",
    -  "eventId": "evnt_01KXJTH8C0Y67BDBTSW467JRNP",
    -  "createdAt": "2026-07-15T12:02:58.048Z"
    -}
    \ No newline at end of file
    diff --git a/.workflow-data/events/wrun_01KXJTH8BX5EJ42KPQQBCSC9SE-evnt_01KXJTH8C3XE3AAVY8RX6TE2F5.json b/.workflow-data/events/wrun_01KXJTH8BX5EJ42KPQQBCSC9SE-evnt_01KXJTH8C3XE3AAVY8RX6TE2F5.json
    deleted file mode 100644
    index 3fe03e7..0000000
    --- a/.workflow-data/events/wrun_01KXJTH8BX5EJ42KPQQBCSC9SE-evnt_01KXJTH8C3XE3AAVY8RX6TE2F5.json
    +++ /dev/null
    @@ -1,7 +0,0 @@
    -{
    -  "eventType": "run_started",
    -  "specVersion": 5,
    -  "runId": "wrun_01KXJTH8BX5EJ42KPQQBCSC9SE",
    -  "eventId": "evnt_01KXJTH8C3XE3AAVY8RX6TE2F5",
    -  "createdAt": "2026-07-15T12:02:58.051Z"
    -}
    \ No newline at end of file
    diff --git a/.workflow-data/events/wrun_01KXJTH8BX5EJ42KPQQBCSC9SE-evnt_01KXJTH8DS0GFPGA37B51HT1VC.json b/.workflow-data/events/wrun_01KXJTH8BX5EJ42KPQQBCSC9SE-evnt_01KXJTH8DS0GFPGA37B51HT1VC.json
    deleted file mode 100644
    index b3e6033..0000000
    --- a/.workflow-data/events/wrun_01KXJTH8BX5EJ42KPQQBCSC9SE-evnt_01KXJTH8DS0GFPGA37B51HT1VC.json
    +++ /dev/null
    @@ -1,12 +0,0 @@
    -{
    -  "eventType": "hook_created",
    -  "specVersion": 5,
    -  "correlationId": "hook_01KXJTH8BXKCJT8Q2301PKTFGQ",
    -  "eventData": {
    -    "token": "wrun_01KXJTH845B37ZAB3DJCPQ48Z8:turn-control:0:inbox",
    -    "isWebhook": false
    -  },
    -  "runId": "wrun_01KXJTH8BX5EJ42KPQQBCSC9SE",
    -  "eventId": "evnt_01KXJTH8DS0GFPGA37B51HT1VC",
    -  "createdAt": "2026-07-15T12:02:58.105Z"
    -}
    \ No newline at end of file
    diff --git a/.workflow-data/events/wrun_01KXJTH8BX5EJ42KPQQBCSC9SE-evnt_01KXJTH8EHK9FRT1AGKVTWQ7PG.json b/.workflow-data/events/wrun_01KXJTH8BX5EJ42KPQQBCSC9SE-evnt_01KXJTH8EHK9FRT1AGKVTWQ7PG.json
    deleted file mode 100644
    index bc859da..0000000
    --- a/.workflow-data/events/wrun_01KXJTH8BX5EJ42KPQQBCSC9SE-evnt_01KXJTH8EHK9FRT1AGKVTWQ7PG.json
    +++ /dev/null
    @@ -1,12 +0,0 @@
    -{
    -  "eventType": "step_started",
    -  "specVersion": 5,
    -  "correlationId": "step_01KXJTH8BXKCJT8Q2301PKTFGR",
    -  "eventData": {
    -    "stepName": "step//eve@0.16.2//turnStep",
    -    "workflowName": "workflow//eve//turnWorkflow"
    -  },
    -  "runId": "wrun_01KXJTH8BX5EJ42KPQQBCSC9SE",
    -  "eventId": "evnt_01KXJTH8EHK9FRT1AGKVTWQ7PG",
    -  "createdAt": "2026-07-15T12:02:58.129Z"
    -}
    \ No newline at end of file
    diff --git a/.workflow-data/events/wrun_01KXJTH8BX5EJ42KPQQBCSC9SE-evnt_01KXJTH8ERP5MNT51YFQ3AGWTN.json b/.workflow-data/events/wrun_01KXJTH8BX5EJ42KPQQBCSC9SE-evnt_01KXJTH8ERP5MNT51YFQ3AGWTN.json
    deleted file mode 100644
    index 88973ec..0000000
    --- a/.workflow-data/events/wrun_01KXJTH8BX5EJ42KPQQBCSC9SE-evnt_01KXJTH8ERP5MNT51YFQ3AGWTN.json
    +++ /dev/null
    @@ -1,15 +0,0 @@
    -{
    -  "eventType": "step_created",
    -  "runId": "wrun_01KXJTH8BX5EJ42KPQQBCSC9SE",
    -  "eventId": "evnt_01KXJTH8ERP5MNT51YFQ3AGWTN",
    -  "createdAt": "2026-07-15T12:02:58.129Z",
    -  "specVersion": 5,
    -  "correlationId": "step_01KXJTH8BXKCJT8Q2301PKTFGR",
    -  "eventData": {
    -    "stepName": "step//eve@0.16.2//turnStep",
    -    "input": {
    -      "__type": "Uint8Array",
    -      "data": "enN0ZCi1L/1gpCuFoADaxAgiPkBp1BzDMAzDMAzDwzhuR6vcv5tMKXGnpNhJIiSFbD4MonTKvWE+plyZzsKgx1bQRChC++KTAsDdBikdRQEmOALvAQICMKV2ER6ewnxWpzOgGka5E4bbHPLX8/tl4w22dS1ItgWBFHZk81ipbqkR8fsomIGxLCsiovFsrodbrWt/fZETBHU5ngf0EGBZUuLoNbQ8tBA0rHJZALiQSEhEj+fxwA7pkKRRqH2/XIKiUS7Y7zyxB28ldSBplAhTFCbB1p1GbAOFBMYP2fYyqn3J25ih7cMGPXmlzxVWIWkmJI3iG1dIQw3XSWERpjSwjfDZhgAmJtuWDQ6qq8NpxdBjWCnMwUSjQPxvFdbg48PwXx3uRIEeUDioiEAtAj0NlqdB5FkmWqNYKCoeXSocRB5IKCSSZifbTDSKvjb9pRQWmdDAlOp/UtiGACJKU9iGBpEKCMb2bf0eTDSKLz87frRSyAL2Kz8/rpholOmjTjTKtqYkC9Id8fG/lpholNf8GuH7y3AQaRS37+kEMYpIe/FhdrKKBqZIMBJMZACnULsPVzWFKS9CS/H48cCBBxQKaFwYgCGJYOGAA0mECooHEzoMaOCAiMQHBd8VtmEi8pa62lWRyItQYRKRRllKXwBMoXThcygYmMLAfVcKGwok7CgXep1wJw0rirOCBI7c6fPFDaV2gjg+Vh8bUpiDRllJ3ZdqgIEpcCfstikt431jhoUKq2gUb9ruomiU9hhE0cA2SEgaZV+f4zW7SyKN8iH7ry/aRsBOGa4r7EGjrHv0GVr4t1ArhUka5WP1WNHAHpjAwDY4ZcB5eoVFlkZxqAwsjN4OUlikUVyCqmjA4CbbAq/vqdHRMSGZ9KxMoAKHAREMcFwkc5xkjoMRctKjp6/1k8QuQhuyVEg/7anrWydp9kd5uX/r2OGjUUadcN+TOWwIN2En7Bd5M8q4nl+s2hWPpV736clSPNK5Ixl/GoKE0Xv69PT1rkI2PyOZvSqVcqnoepLJuvFOv5N+NJ1ps0+hfU6vw47yoZ0gSJOCH9A7OyeZtjCyC15PsnelGx0XyRxiB2Wz0FPnDFz3p+MQ/+X06Yd/XHBjhgWe1dLjFh30OJnGhgSOydp1uJe659+Kagg2AdNH+NlebCg9Mwp2BLdKh1ZPDTa0MK+HWi3vkKN1UncB6dxAQFxQKYZVOkNAJPOac6OIW2o6XMuf5gTptvW5HtNTXzFywQLm1z/fThaS8XUVpSHrG51OcqnorhjJrOMoPeqs+kGgdk86jnPCmLDt26rSKZ8T5Josz0udta0qdl6lZsQJwde9XU7fTTmlCzP2lRBe032j1A0CwmPzZGHFnhAQ/5ZaSd0ySTxl1M4p5am5EfAzbIYVBEQyCIiHgMjmgjvZdOnxwumzG7Ou7b62k6byXR3c6UGgnaAE2bXyQ/YxhzhiaCtPEEifKdlDsVsp+/O1MbQtme+zL9zJSl0qm6rbpebrfBEm8zQXasa+EHG518vD6bXKf5vtaXa1AQ+RBdmgWv0O2d5OnGScVxc5Cbuy9jnJnLbOcjqO47CPCq5/MAfjB/tgjOXEIcdxMpdloWCCCtKZOOTk0jykET9UCxWag8C2knEG7N7ukzvRCWo+P3uNM4DLQDINOH1fJ/xN7XJHMguiVPY7fbA1T9hNd1qPVaVL/3JBQKReji8HI9TP3OmT2HN5XeVDSkAyFe3hI578sUv3fev03UGhvNyCsHuScksI6tal0GLsa+MJ4slKCNe+XucPv6cX1r7p2cpn/aUidmFC+Pjkg7rRcTFJPIGB8O08JUvVH1nYyrYeoY5SYmKhkCD/nVsy/CUzG0sjBMm2sVcxIdaFbfl9N+KMZCgkJCKx07mNrqcpqSMgmfZiFPXSsCWz9iV7b5cNAslIHnxhfF0ENhZI5pAODJ2LGslM8GRbxD402OzAGBN5EUr4vaR+zvrOIZsv9ssoI5m27XXlC7MpZeVS/I2iWt9ty/1YUc3NPnbr+ii0kFu+8ntTyR7qu0UyToQAGBgLBQrLhQsXLkQsvR7hTsZ3drgauWCB1W6ftNpFuTgXq3zihOcC0mnVC6mr9plil/v69PfTcDeScYsJFx0aFhe5E9fOXrNW15MsUsmceqae6L8S1FdJs9o9YKFzDOLPkhB20k9d9Y+tf9W25SuGEIdO1IBtbyFctxpGSAvpsUOt3PMn8xgPPICBKQ/+8fEBdRmJWYeM2Ck/l3sg51ZFEH8Xm6axkNo6qx/IWylhP2tdz0KGhkWGhoXGBYVsO0mxIeQh25EvWOAcTN9ubp1T1ydfP5k/5neRSueeaPE8OlgdtDzfbRJ0rOXJ5Vg5ZshojyPHrcpjTpJd+dHqySHtyGWSJmeWKi5NxL/dcCIcnnQwL8KG+eL0cXkeC2nlILAtPI/nwfh+fEy5KjakuU82F3t6rP9YqdSEYO2Gxjpbru7FrfZV2NDot6GR18ayEOzIY5UJ5NV63TuwyklyKqhb+GK+UrCjhRA8OgOlkMwD3H+l/jWMGsCgkMwhva0jQONlozsvTrYJegofXQgl62p/o4TuIpmJikE4kmHeljlz37boL9XoOigrpZ7objmSiVh4XsdRf4VknPmxEwH3WZ0bi8MenElyHDIDgYv+yfVxnN0TK2Zr3QNkHBQuvKdUB/dsq53T9AdqK6ph5ZCtebx81SvBpXjyGMYoW8pLKedk13dRo215RXhweCxywYJ+Eqf/Sh51CtnMyzmND6lFMvywJ09KXSFvCGlerutIJCSWCxYXEjAmJCSWjY6LiITEIuGAjI0OjqWCBA6MjPSn07d1CXthjnWiL+pOFMoIyVRAG0WbbR/aKmQjGEvYjTsDCmewG2fAGMlImL+vJPFDIZmJzH9KsduXDRUlJBPJbCBQKUDaKGYBeeosAskEhRmoMwjCnAahY4hmRpIUJB0jEJBAwgKEAyqhbPwBEwDX6wNlDTKGhkQUFBQUpCQZNgOZyusp+OXEhPw6pGq7tawF5sIFRmIqKveUdqkawgA+iOpDMRXr/IEqIvrKRkc645GsrZe1rE0XQRnTJ/SIC+l1hYXJyI/BZtMnQoI48JoVAdA8F5nZAEjibNoAp3lxBphrflq0VYkY7+seGDplWOqOh1ukJOBDgeoHsA1SszFotQw2ob4TqWRllEQGg7nnorWkSQYUCpWkHYW2mmKZXIU4BsT9/OHOb+eQM73Mq1LZOYosJn1bZegf7i43awhIXw3wkV59E0RlBNOVX3zvusirB8IDL5uaruQn7WXJQWAQmnRYoshNDbNZScgB+7cQUJ+FWt4gG14pThtKifGhkn72BLeag79n6+NPVacgu4HbtdzL4i2FzpwcSU+vtNCyAJQlX0mhnEMNd71ffrBB+LVPx/aTfbPevgJ0bvopID167OGWJDBbf3pfme8Xl8h6mKfNQ0IzNLn45GwREqJ1IaKkbx4nAZcFlutZ6yV3XCcudQYWPJX5FkWET5hUKw600Xj4cJ0FrXoEA/3LkMnM0PmsUTPbNJ8f7gwfVqmG/ROfctgPAXRfQUBRo3KtZj+I65UI2H8Ao6UvqJHbxMDwKSu1FazBnKazr1xP6QShylYoAMSq9NzwGrGVZ/DPCwxIwAp6sjFqa5Smctpo9gJVw5MbebJuhmMbwc/YlIZ5lLcCgq9f01UNgoUa/sBOtAtt2HCYZXHMzPD/OMLibdIHMeaDDlI8zMALqxOmawEmMiXcFDrrSK8uRq8v41JrevGOClTwqtandizrDlaFUSMAcJVrI6iip6WDmDpMAlU719EvrTHUS7NUQEeJbB7D+o5SUiOiQFuHY8rHtI6ve2az+oQhB5wbkNiQuBtLlrPsIJQ862Ha453/YYE2GBYigaVXHBA8ZjSXjuUFuTMG+oSWBqC0fyub5HCJNn4uBYJVq72I7E8uJ/sZ0Y8E/P48e2Fc3z4g0Yk6HV7F628NfCTqqzW1EN4IqVmUL+hMWHRtmsyseTZXf+he4otB3DWysoFsx/SHAsc3+6gsX/1iWf92I2dcjFPl69xNWaineoUyOWmJoRQ7NRmhOThNK7UhSVxHERIhBtAW/JowIpewMfEdYPoql/BcLEs+H84HHrHFYDiy1qA46hiVqa249cNG+L2LUiU9EuHg5tjde76awdDypw9qCXycW8tKCXHEtKetbMjLG6Osaws0QLy0hU5B4UnIeMpZgqkSx2UTdQf3Zn/pW7vzZPHAqlVmGGGq5QCbdirziGfmcTo3rVKJDzMDvdLhwIzVNtIEqCKsBNY66ZpjqzHxMqXEnGVgNWq2z0t0dG68asYzVzwLP3g424Wh9GqWui8QyOddPicsjwxO5NQ0VptK6BNiHyvSGsb1xhId7bZRQqil4NT4LinTadkG25SZHAiytXxHs9fk8TxHk2uYjaH9II89wOxbP+9NtDeFp440UkKtTsV8M4Vh7LiVQ7AUFr5SHu3hQXqYhP6HtaA8YV8Eng5/6E5jECY0PeO7mdBBmG2utI2yeUA1o9SMOAWNRQ9gIKuiZlYsFuatFwLZwp1tfz4ONEIwJvgknq1ZP4W5yMagoWh7SREHEteXSRR+2RRLQwxXmNYP9TdWsXcPcIks8Mz4vd9u1W7j5bLwyugIANVW5meORVZ1sumhWoSDivqzDlMeDOSxcRiOW2oaCVA7wz+1nSuk9oOtVrLshjOWjYGZQ0y1QSL874MLqftNclkEw62UpGYLghtWO6Pwx5qCJt6QAGwglG0tXeZITcs1QryhENH5F61pV22O7ZQfZoY1UVTxCIuiWv/QA0veYyhVIWO6ceYN4hLOrzkYQmNUUNMPrm8cmDSSYgh6SL2xUVFlQSViRDem7s+xBmv0m4UDiWtXOTprG6thXEItfA3BseSbdoFK34v1mS9x0VID1eAbarWuFLjVj5Dapc0PLPqWffSE3ReKg4ZeaZgTQI8uXnxMi/+qgMxHrFaEewNav0vZIhQlAV4JYUu5c9rQpHvm8M6gtkbwKrwpUU+e16Wj8602seYBdmg8xEDhsfNsCf0+rd2Oslkq8Vxy3wCciWVPv/++82UsBHwfyG+YaIyIIFQx+YHACfhJH7nKO7sFCQssTEEiRqFBw7gNIcq4x/DswuPlrRcQtj98Sh1FD+WOeydRrZ11DyGng2j/bR0ygI8B6mmkrrbPBAguDsbx9fSpQnusmi8+byjWEAOhyxmfA0ZY3TBYwk67FjyyVYWjkipZDhCJtFkUK0qL4rSXMQhS0s+h88k6VHx0LPH8Ckm6TXZEPkBysjznux3iRlWmq4ickYS2XmaaXxFFqPyRLhPCndYquroTC/hSs2sUwlEMDpsUW0R8NtqEURYdwV3x0bL/lfMw9RGYnT/nW285yDFbct6HJl+Qp7WNKfUwTwH7aqVd+YhHFX9QsAMDqKq256AmimS79jXtiqy3biLFZEeSellyNQF84bVQX1okNCPCu1DfLnNmnxtlEYxxoOMdTq08CjmUBQ6u2CHyzSGBDQPV1uaCoXgpmlbWhhkpE8352TSSTG/AfPdADNb8+1tjnbRQdLJ2oFwcHt0EF2gtCYZdEgygb2uuc28piPFB/rwsnsh5O+rot18YUhKzGg6Mb5Ez/SSXgd3AhLFwlsEX3o6YKFScOHeUj8ui/kBRbDb792NgyqUZXZgqI/BgNQMxVuyae8lR+3r9BVINwoosDIJw3/FmDoNs5LSbU03hA5ScboRyPOPVUyPlIsI5JMi4LefhXAGyCuY+0mn5uS/d+gwOAXMxdwwDD2gEqdcIQfphG3kT+qc2SWdqYj5gOgDFEk5T/AI7DywAnyPd6hpylG2pew8nb98MBNO2z/v+GPeJrXWsFFLOBudkoHPLcvP2aIWZpCFSGk+0TampEHSwu4KOCs575F3UgNja1k3ejt3vsWUda5Q4UsOXgYuIqzZ9oNCK9R0QTkaUmVbfFm+Xo1cdUQRkmqUf2eVluOKy2SHd1JJuZuNdnGCwU486DRDUHiwUfoAWspOY6FD3kKawSIbAoCvFyFfqyKsyB9Y7/j8VSA2CGOVq8JZzLR0zP/FflK5AjVqjXVcMbjvus1czily1TuWk+gUqWLoKx7gk6vMBXvjLxZMxY2wHm79LReHB+BySEa8BgJQwNFxSEz3XqsRPGIzlmwOOx8HyihOTF9L4YwBY38HQxnZSC5M64JobT+lQjlJH7RKI6itiiw3HNDCfdjgftEnxMcKZb1bLget96lz+csKwXCCzH3R8ilRRmVACaBiFXuIKhQed6xSq55ASGUWaycaAo2JEBiSOkF+3PGFTpYUmBNMVgqxtruVJN6RiX0gfRC42DkNmz2oPGa4/P4I3vu1/ZQoNdBThNXtbSDAbVjn7ktJyQC1naGz3X4+EhO1DikZ0ksfPE/oELuwjS9d19IQINCHZuDPHVIyqOCuO0+CMLxHjUlsIG+saTDKFrf+K+chkRfuW9H1E9Bf7XVxsF7H503p83Ew2p+Uzr4lMqnuKKpka0xi0dQhKR7/jyaP+RI7WmQjuKYixTijh1aJgW6GFRm44lOp80H0XesaDCeMgkP2zDKnnyphObyiIEUEeniQkkGeMuVFZUJMM0B9oOh1Sb2dxv+ogGYC6GW8xZ+Px5SrSyYeQewaoG0rC055/qjmGTckVTmLM3U6P6n7Vgpod6rJmP7xAzoYepRRm0KFfb4vcxui3jZVUFpLOoJzLQ31Gr4tPoyiRQO4lwyA7l+KoJ3RscMmivqUIjySlBJpXh/nteLJB3QsrXq7iXu6OBIYdrZim6Z6OFweM4zeJSQ0OniZxUgJOQlEs0lBlth96r4lyMiAUwb2n/45+6/xlJVSl/wPsueyFS4oQrYp3AdYxdAM="
    -    }
    -  }
    -}
    \ No newline at end of file
    diff --git a/.workflow-data/events/wrun_01KXJTH8BX5EJ42KPQQBCSC9SE-evnt_01KXJTH8M7SEBEN6VWA5J4A5KF.json b/.workflow-data/events/wrun_01KXJTH8BX5EJ42KPQQBCSC9SE-evnt_01KXJTH8M7SEBEN6VWA5J4A5KF.json
    deleted file mode 100644
    index c9b8e9b..0000000
    --- a/.workflow-data/events/wrun_01KXJTH8BX5EJ42KPQQBCSC9SE-evnt_01KXJTH8M7SEBEN6VWA5J4A5KF.json
    +++ /dev/null
    @@ -1,16 +0,0 @@
    -{
    -  "eventType": "step_completed",
    -  "specVersion": 5,
    -  "correlationId": "step_01KXJTH8BXKCJT8Q2301PKTFGR",
    -  "eventData": {
    -    "stepName": "step//eve@0.16.2//turnStep",
    -    "workflowName": "workflow//eve//turnWorkflow",
    -    "result": {
    -      "__type": "Uint8Array",
    -      "data": "enN0ZCi1L/1g4SotnQBKv/wgPkBp1BzDMAzDMAzDwzhuR6vcv5tMKXGnJNImiZAUsvkwcMWUe8N8TLkynYVBsBw7GqrRvvikAHC3QUpHUYAJHQLiAfUBjaFtyXyffeFOVi6MrktlU3W71HydL8JkEu6kYUVxWpiwkU9zoWZsDBGXe708nF6r/LfZnmZXC1NqJ+HhKcxndTqDnT6phlHuhOE2h/z1/H7ZeINtXSvJthJIIUc2j5XqlhkRv4+B+64UzMBYlhUR0Xg218Ot1rW/tsgJgrobrwN2CLAsKXH0GloeWggaVrksAFhEJCRix+t4YId0hW2QiDQKte+XT0Q++mlPHRJplAv2O08BvJUUwkSjQJgEW3casQ0w/se2h1Ftg4m3MUPbh/obPXmlzxXmYKKhmGgU17g+Gma4TgqLMCUhIRFp3nuKiGgUCA1AoEggw6KAi4iEigYeRCQ0oIBAgaMABgyASHi8CC2FbYTPNgQAeRjvGzMsnGxbnELtNjyoLg6nFUOPYaWwB5BGgfjfKszBx4fhvzrcyWtIYQoEgeJBAwjUINDjYHkcQJ5lojWKhaLBo0uDBxAIEYpIpNnJNpBG0demv5TCIBANTKn+J4VtCMAVBkFpCtvgoFHaY0mDRlkIxt7WT9HANkAmGsVBBdZVggTSxzmdaJSGAQHSKL787PjRSqEK2K/8/LgBpFGmjwpplG1NRVbSHPHxv5bQf0tF+P4wHjSK2/d0ghhFo6xrLz7MTlbRwBSFKfu6KWzDxESj7OtvvGb3SKP8x/5ri7YRsFOG6wqDLI0CG8IJzgqbaJSP1cdWGKRRXvNDqmhwwE22BTvpp676x9a/atvyFUNoQydawLa3EK5bDSVkhfTYoVbu+ZN5fH3PDA4OCsmkZyUCFjYKiFhgwyKZ4yRzHIyQkx49fa2fJHYR2o+l9K2TNPujvNy/dezw0SijTrjvyXwTdsJ+kTcjjOv5xapd6VjqdZ+eLKUjnTmS8achiHK9p09PX+/qY/MxktmrUimXiq4nmawb7/Q76UfTmbpmn0L7nF6HHVH68qGdIEiTgh7QOzsnmbYwsgteT7J3pRocFskcYgdls9BT5wxc96fjEP/l9KmHe1xwYwYFntXS4xYd9DhZhsaEjcnadbiXuuffimoI9gCwo5w+ws/2YkPpmVGwI7hVOrR6arChhXk91Gp5hxytk7oJSOcGAuKCSjGs0hkCIpnXDDeKuKWmw7X8aU6Qbluf6zE99fUiFyxgfv3z7XQhGV9XUfqxvtHpJJeK7nqRzDqO0qPOql8CtXvScZwTxoRt31aVTvmckmuyPC911raq2HmVmhFnBF/3djl9N+WULszYV0Z4TfeNUjcICI/Nk4Uee0JA/FtqJXXLJPGUUTunlKfmRsDPsBlWEBDJICAeAiKbC+5k06XHC6fPbsy6tvvaTprKd3Vwp5dAO0Ep2bXyP/YxhzhiaCvPKdlDsVsp+/M1+7Kh4oRkIJlNArUCpI1iFslTZw9I5gGyIBtUq98h29uJk4zz6iInYVfWPieZ09ZZTsdxHOZRwXUP5mD0YB6MsZw45DhO5rIsFExQQToTh5xcmoc04od6wULjlq8ugW0l4wzYvd0nd6IT1Hx+9hpnAHeBZBxw+r5O+JvaZY5kVqJU9jt9sDVP2E13Wo9VpUv/ckFApF6OLwcj1M/c6ZPYc3ld5UM6QDIN2sNHPPljl+771um7g0J5uZWwe5Jyywjq1qXQXuxr4wniycoI175e5w+/pxbWvunZymf9pSJ2YUb4+OSDqsFhMUlMgYnw7TwjS9UPWdjKth6hjlJiYqGQIP+dWzL8JTMbSyMEybaxVzEh1oVt+X03YoxkKCQkILHTuY2upympGyCZ9mIU9dKwJbP2JXtvl80ByUQefGF83QM0FEjmkA4MnYsZyUzwZFvEPjTY7MAYA3kRTvi9pH7O+s4fmy/2ywgjmbbtdeULsyll5VL8jaJa323L/VhRzc0+duv6XAot5Pb4valkXpGMEyHAxcVSocKCAQMGDBFLr0e4k/GdHW5GLlhgtdsnrXZRLs7FKp9I4ZmAdFr1QuqqfabY5b4+/f00XI1kvIKCBUdGhUXuxLWz16zV9SSLVDKnnqkn+q8E9VXSrHYNWOgcS/xZ2mWEDzgXH9sQiTSKooE94ABTHtzDwwPqMhKzDhmxU34u90DOrYoSfxebpqmQ2jqrn+StlLCfta53ASOjAiOjIsOiQradpNgQ8o/tyBcscA6mbze3zqnrk6+fzB/zu0ilc0+seB0crA5anu82CTrW8uRyrBwzYLTHkeNW5TEnya78aClHLpM0ObNUcWki/q2GE+HwhIN5ETbMF6ePy+tYSCuXwL7wOl4H4/vxMeWq2JDmPtlc7Omx/mOlUjOCtRoZ62y5uhe32mdBI6OfRkZeGstCsCOPVSKQV+t178AqJ8mxoG7hi/lKwY4WRnBnoBWSeYD7r9S/hhEDFxWSOaS3dQRovGx058XJNkFP4aMLoWRd7W+U0FkkM1GxZCMZ5m2ZM/dti/5Sja6DslLqie52IxnIhed1HPVbSMaZHzsRcDUWhz04k+Q4JMYBFv2T6+M4uydWCZmtdQ+QbVSwyLapDu7ZVjun6Q/UVlTDyiFb83j5qleCS/EkPoYxypbyUso52fVd1GhbXhIeHJ6KXLCgn8Tpv5JHnT4283JO40NakfywJ09KXSFvCGlerutEJCQWDBUWEy4mJCQWDQ4LiITEMsEADA2OjcXChI0LjHx/On1bl7AXtu5RxzrRF3UnCqWEZBpAG0WbbR/a6mMjGEvYjTsDCmewG2fAF8lEmL+vJPFTIZmJzH9KsQuFCKhD+MmeBiFkakaSJIUMByMQkEDCAmQjKqFq/AETAJfrE2UNMoaEZBQUFBSkJBk2A/3oAnN1etOVbibg6yX49WOqv/5mtQNZ1qC5IICRbiqKfMpJqQov1z8k9cGSqHXCQzIibue7I6NxriyWyVqupmuobPAJb8Se9BhjKTIKKPjR9FokCBG8flYAvJ8LizYAPXEjbSxp4uwA00GfFlKr5Iv3Bx5onEwidX1jGCmm+VDo7QFMB8lsuLXKgu1F7ktQsqpL4g7BynNOLdGVLQVhJfFGka2GX96rAB4Ddz9IuFvbmcpMQ/MeVFYbwo9J764yzgePy00SItNXJHzQVy8AUTIC80otvvMvUuQB8xBns6grCSVtsiRNYCNNkiYRdevyLFYydkD+/gTus9jG696GC8T5U3KNwtnPnWCzAfGXbGH+R4WqZXe8Xci9BJ5a6MBGkOL0ZwsvC6CzxCspzcGs4TL3yw02CH+7dGx7WTPr4SvB5qidCtJjYY9uiQMzVKfnk/nCcV2vhynaQCVEhGYWn4gUASkaFwpLRU0QJEhYsHL9aD3nXunEqg7dgs2Wb1dEqIUhtXGgzY6HD9db0P6PctBEGSKZizvfcDWTpon5YSf43EsV5D/hKd/8sEDfFQQsR0ugmrFBaFfCgT3HMEX60hu5TAydfzxqcZLyTLkpJ3B+pysonSpQGwntDFXrv5tfY67yDv55oQEJWEtPRka9jdpVTlvNHqKqfJIlz+q2eaYt+HWZcpiYeatnAPSLuapiWI3hi+wsd8EPK4ZZCMclHf/PKRZxEwuIKR+lkHbDbLiwO2FPDY4iU+oXMp5V7DVg9NalCdVaLzamAgdern1q3LJ+YD0eNQgDnLx2ApVAtASMaYKkU7HzH8nQWod6xmAF0pQI57Gk93FKbiICtF0zpj560SE4ZTbbTxj/x7ZBE9vC5k2WmawUlCOLWNprnWdlwSwYYyXBqGdOEDBmHKSO2AXg2QF6RXsIwEv/Pps8Fwl9/LEKdKjW5CKInsBTdiAiGInn9+gzTAQwvUh0oe6NV9n93SQftHy9Sy2MNBxqbuTLxypcvDbMbNYYznVo3Uv94tfumqy8lC1R+uOGA5pFVdZfP1LWR93oMm7MqaYwd6es4VNdoJyUNMlQrp7aU2hbnDaf2ousI6KIgUAcaEZ+IYyyJGdHZB4QHCph8PSXpTcfnoOD2IImHAg09Io6v8J0pbmzwwbie7hSpT4iwCGCWLD3iJoZsKWJDxoEfM5dzKIQ6sVkStjZEKc3SlqXB+iIbGkLlQLhE2QeNmA0i2mK5rj2RMTk3oZfYguyPAIeGExlTikqudzBplkxbzoaadPZdyWPD2AG3tJ5wYxH2/8JLEaUz7A2ecP5tsdET1MO5s4G32Mh+kgi1nNrz2Zc6Iql8MvHSRampfeH1MeAYFV3GZwwOQI50VPVqNrWApZQ67Hy1lAkGcuiaJ9H30qCCMoaX0g5AE0MYXeZPcBYtjaSdPOyHv8daSPDxBpapPEYEJjhhclmihascOhI6U347cSb72IYnsdNOAQyoeELxNFFPCTLbOxRqwXO8/sCxFPuQ381tjLh01NfYqCjQir+qfAoswrqPsqwiBOhaXiQBp4gahtivTAbvWnJ1mW2t+WjQSM+I7VPHbY1blae6j4MSlbbxYshcfaZFI0vu2MJiKn7Kv6h6mBYxXLJAroZZu+/WyE0niMLrgwZKJDvbn/mJrIEJtsOVXY4mKhP69DMgyhYU3AYA7fWNNJX28rn2y4/pK+DFVd67oaALHUCL4eUa58i7NgHP6Rum2RZBMUtnqSkC5Zbb2uikMMaCS+5kdBuoIzth1vmxE3bNUJ7UyWi+69WU43aXlssP9WONdKo4hNWcbX+oFmU1McQUSFjuknmbOIKzr85mCBhqaCuH1x3rBxoJDUEPaSpsCdQOaB2Qso3KL+vo8ejUTc7DiXXvnKc1JZ2Q/XEEjwZghzLV42FqL4A6BtfEpCVOqo5bIhsfSiwq18otSmZH1j0jfsoqrtBKA5aumKhp6AeRV58qBbDUCFrnq9YkR4GPH6fsGUxUoU6G8OGkzuUOjaH/Yy0lYIX9KaaeopY1x7ddGWJOR6gQGNSjMdCW89/9Be1BnXUZXmJJ4WLBuAnRlh65pe8r5MQ/H1Iv+GtMZI+obVJEEQtoBz6qF1q7AaMWJDCPCTiFBY0JLZBTWc+Vrcfjee3MCxif/qTOhUV6h3wnmSldvH9hfwHIs63rMuAEoZkpwN3VTwTKrgGM9fX03OFErFqvoic4UAhTog+5jwHjbBaOViNnf4sOLJVE86PKkrOaRAJWFRXpKXidq+rESTSH0L3lzVXjNkxffqVS/rv7RgNQDJZfPNNDvGhSqLLQHKQxG8qb/xfG0XZ+hGZSd1OfRVB3YoFQakpapThqAzKTSKBcEY0xofRSo73HepoNv/KfZh6dGV3CKd4WVbkwJb+7wnTXdBGZRtV4HmcIrbVSLv3EZ/M/qi0cwKgq9bmwIaN5Lv2Se2KrZNu0mIyuSQtWUI3YajCA1ATYCQ2RgS7ON5p5iY9d8oRVHXg7R1grTwCCZRVGq7PIebD4aANXdW2oIK18RJPz2vLjhSIkv2sMkkkMmCwu0AGu/xdcwO0tD50WmIgOw6Zbu630psEw24ZE/y3a8ncsBTA/IB9/oyfOReNmp3yn43EqFZbgF0sRqI/8DIMDLYYqnMZ/QLSEZOniohz5/hGLPYPVLAm3F95BVa5xNBlhtIMj02zi+HHFnN5DvvX6i+haQDYynITBPjOWDkAtdHcu/nWhD9iafNGuvXMUU/ulI0vHNuAzOVPD/MKRFUKd5Vgs6Lz41rPKAj6EDNnGAhC49SLiE7bAMnONvHlZW9trc7EhARgsgaSJacpyu+U0VBQ5bKvwLX/UdVS4r3Ft7QOpN42//VNfu5IlnXyFD2vc/Hkzilg6ZsIow/LUEMrGhu22NSoECxYsIJbEwLtGV9kgxCi6lbi7r2/IXWexPwNgiZLRJlqlweoVm/uQGIb4wxazb94OxvdfEmjyFq5foxoLyMy2c07tExl4DPJ3jeE1qkHHOI6S3UpnmUVhoHm22m06Ejt4Ux7ZHBy2JXoyL91uFZJD5Yd56CiXm5TWds75takLO+XTuw/RV2UX82MKqk6pBgddwx+TzJaWDWQch7EeCkyXTx3HBJBczFejITixTErvdOkP2BQ7LENRyLE2QAfpSgastZYD1hpgPOfsfY5dOKZLTHinHtBG0cAlJsUGKhRTerDBgHsbQdSIwo06oaqFK9qh9iiw5FGDKcLVwEtZj4mcPeb3XWgY2dCQ7VO8MdNyCyAYgqQ2iWTJJABwwZLN6HeoH0ABfAczyd2p3nfGFVUintrcYIgdf0JrBtVtnTwkBWcuzVJrqjwXOnYwkWrgMGYZ6+z7f85DrxH2t+R6mygozhSs7fFBNNyFahvKBVi1bJYxLaJawGRWBtOsWJMYvUasVBTF4Ajm0h0pgnKGImxYS7n+49OQVU9/VnUIoKlaplKY62BRKca+v2TafzCBlvm971R3OopjuAG8dC0wn16JiLnI5hrirDVdkflSb9cHGNd2KYKv9T/EbOIT3SHXUV554Ao6KYKQtgFbGP218mp+5V6iIvhoaA9MxERtI9Iqm63kFEyzqeSKJ5pP7fIdKsIlPkOWHz+/TlIxTJm/xsKy0WaVU+atME+mK0tBBdu7rqNzAMr/Cb4wdj3rKeVnG8wD+fTn4GJusbQC0DiGpyTZ3zrgREYoQRfpyGhLb4GfFpxoxILf5RE1oW/7t1CsPnND7DK4rr8CTAoygZ9rSzSWOgqzN+ZaRSbjSpLdWnkykgwOAvFmR+PcFpygFHLmWY1EusGxXPnYSF56noivXQF"
    -    }
    -  },
    -  "runId": "wrun_01KXJTH8BX5EJ42KPQQBCSC9SE",
    -  "eventId": "evnt_01KXJTH8M7SEBEN6VWA5J4A5KF",
    -  "createdAt": "2026-07-15T12:02:58.311Z"
    -}
    \ No newline at end of file
    diff --git a/.workflow-data/events/wrun_01KXJTH8BX5EJ42KPQQBCSC9SE-evnt_01KXJTH8N3G1J64NM20KCSB9B0.json b/.workflow-data/events/wrun_01KXJTH8BX5EJ42KPQQBCSC9SE-evnt_01KXJTH8N3G1J64NM20KCSB9B0.json
    deleted file mode 100644
    index cfd2a39..0000000
    --- a/.workflow-data/events/wrun_01KXJTH8BX5EJ42KPQQBCSC9SE-evnt_01KXJTH8N3G1J64NM20KCSB9B0.json
    +++ /dev/null
    @@ -1,12 +0,0 @@
    -{
    -  "eventType": "step_started",
    -  "specVersion": 5,
    -  "correlationId": "step_01KXJTH8BXKCJT8Q2301PKTFGS",
    -  "eventData": {
    -    "stepName": "step//eve@0.16.2//sendTurnControlStep",
    -    "workflowName": "workflow//eve//turnWorkflow"
    -  },
    -  "runId": "wrun_01KXJTH8BX5EJ42KPQQBCSC9SE",
    -  "eventId": "evnt_01KXJTH8N3G1J64NM20KCSB9B0",
    -  "createdAt": "2026-07-15T12:02:58.339Z"
    -}
    \ No newline at end of file
    diff --git a/.workflow-data/events/wrun_01KXJTH8BX5EJ42KPQQBCSC9SE-evnt_01KXJTH8N8N4STHMH4WZ4E1QM6.json b/.workflow-data/events/wrun_01KXJTH8BX5EJ42KPQQBCSC9SE-evnt_01KXJTH8N8N4STHMH4WZ4E1QM6.json
    deleted file mode 100644
    index 3202642..0000000
    --- a/.workflow-data/events/wrun_01KXJTH8BX5EJ42KPQQBCSC9SE-evnt_01KXJTH8N8N4STHMH4WZ4E1QM6.json
    +++ /dev/null
    @@ -1,15 +0,0 @@
    -{
    -  "eventType": "step_created",
    -  "runId": "wrun_01KXJTH8BX5EJ42KPQQBCSC9SE",
    -  "eventId": "evnt_01KXJTH8N8N4STHMH4WZ4E1QM6",
    -  "createdAt": "2026-07-15T12:02:58.339Z",
    -  "specVersion": 5,
    -  "correlationId": "step_01KXJTH8BXKCJT8Q2301PKTFGS",
    -  "eventData": {
    -    "stepName": "step//eve@0.16.2//sendTurnControlStep",
    -    "input": {
    -      "__type": "Uint8Array",
    -      "data": "enN0ZCi1L/1gnitNoABaw7whPkBp1BzDMAzDMAzDwzhuBxvcv5tMKXGnJNImUSMpZPNh4Iop94b5mHJlOguDYDl2NFSj/faTAsB9jZSOogATLwLsAQECFGcFCRr5NBdqxr4QcbnXzMPptcp/m+1pdrUwJ+0iPDyF+axOX7DTJ9VQyq0w3OaQv57fLx1vsK1rKdmWEincSOexUt0SI+L3NXDflYIYGsuyIiIcT+d6uNW69tcVOUVQV+NxQA4BGCYnLH20EDSskmEAqJBAIJHjcTywQ/rCPhhInIXa98sdSDwaak+9gcRZLtjvPE28nahE4iwRBmHrTiX24cBj27uoFiJ5GzG0faivIXGW78krfRIngIzLoyGG67SwB0xBIBLnvaeICGfZCJ99TEi8i/eNGBZWtjFOo3YfEtW14bTi6DGsFiYh4SwR/9uFRSQ+Qgz/1eFW2BI9mHDAIBK1SAQ1YKAGEYiRaG2CmWAAKcPAQeSBZEIicbayTsRZ9LXpL7WwBhnYUv1PEV+YZGkfkQgkgrG39Wsg4SwOKrCuESiRQs6phLO0C4nEs2NIK40oYL/y82OIhLNMHzXiLNuaehCJj/81g4j+WyrC93chEXEWt+/pFLEAnGVdexFqtrILW/Z1W9iHAwln2dfXeM3uD5zlPfZfV7SNgJ0yXF8YbAglOC/MgbN8rD72whpkYB8BSJylPaYsw62wW4u2cCUpQgtj4Cyv+SNdMrAF4jAPxnceNPBgIgGMigIsJBEoGnAgicBg4sGEjQIYMCAC6XgRWgv7mHCWpu0urRYmcZa3lN5wDf91tGRgD0g4wD6cLuA8/cIijLM41AUWRm8XLSziLD6BumRwwFW2BVrRAtpbCNethhGSYvLYoVbu+ZN5fH1PjI2NCckmz0oEKmgUELGARkWy50n2OBijJz16+lo/TdjFaD2W0rduotkv5eX+rWOHkEopdcJ9T+absBP2i7wpXVzPL1btC8dSrwv1ZC0c6byRjUMNgZTrPX16+npXHpt/kc1elU5yqei6ksm68U6/lYY0namzT6N9T6/Dlih9+dFOUaRJwY7ond2TTVt2wQtK9q40Y6MimUfsonQ2eup8gev+fDziv5w+7fCOC27EoMCzevK4RRc9ToaRIUFjsnYd7qXu+beiOoI9AGwpp4/ws73YcPLMKNgS3CodWj012NHCvB5qxbxDltZNuglIZwcC4oJKMazSGQIim9ec/7ilpsO1/GlOkW5bn+sxPfXVIhsaml//fDtZyMbXVZR6rG90WsmlortaZLOOpXSps+qnRO2gfB7nhDFh27dVpVM+J+WaLM9LnbWtKnZepabECcHXvV1O3005pQsz9pUQXtN946QbBITH5spGjz0hIP4ttRN1zDThKaV2TilPzY2An2EzrCAgkkFAPAREOhfcyqZPHi+cPrs169rua1tpKt/VwZ2eEu0UJWXXyvfYxzxiiaOtPKdkEMVuJ9mfr42jbcl8n33hTlbqUulU3S41X+eLMJuEW2lYBVSUkE0ks1GgUoi0UQ1DefrsAdk8RBqyQbX6HbK9rTzZPK9OehJ2Ze17kj1tn+V8nudhHRVc72AOxg7WwRjLikfP82QyDEPBBBXkU/HoScb5SCV+qBYqNG756hTYVja+gN3bhXIrOkHN52fP8QVwF8imAafva4W/qV3eyGYpSmW/0wdb84TddKf1WFXK9DMXBETq5RjCGPUzd/om7Mm8rvIjHSAbBu3hJZ78sUv3fev03UGjvNxS2L2JcksI6tal0Vrsa+Mp4slKCNe+XucQv6cV1r7p2cpn/aUidmFC+Ajlg5qxUTFNeEID4dt5SpiqP8KwlW09Ri0lRIKZkCD/nVsyfCYzHUsjBMm2sVcxI9aFbfl9V+KLbCYgkEjsdG6l62lO1A2QTXtRkppp2JJZ+5K9t0vngGwkD74wvu4BGQokc0gHhs5FjGwkuLItYh8abHZgrIm8CCX8XpN+zvrOHpsv9kvpIpu27XXlC7MpZeVS/I2iWt9ty/1YUc3OPnbrCl0aLeT2+L2pZE6RzRMhgIUFQ4ECc+HChQsRTK9H+JPxnR0uRjY0WO0WSqudlIxzsUooTngmIJ1WvZG6ap8pdrmvUH9DDTcjG6eYULGBQVGRW3Ht7DVrdUHJIpXMqWcKiv47gfo60ax2DXgLnWOKQ0xC2Eo/ddU/tv5V25ivGEYaAQ8s76IvZJyLj308kDiLA2x58I6ODqjbTJp1SImdMnQ5KHJuVaT4u+g4DsWkrbP6Ud5OEja01vUsXGBQXGBQYFRQyLbTJDaM3GNb8oYG52D6dnPrnLpC+frJ/DG/i1Q6B0WKx7HB6iLm+W6bwMdarlyOlSOGi/ZYetyqPOYlJbvyo6UbyUyTyRumiowT8W8znoiHKxvNi7Bhvjh9ZB7HRlo5BbaFx/E4Gt+PjylXxY40F8rmYk+P9R8rlZoQrM3AWGfL1b241b4KGRj9MjDyymA2gi15rBKBvFqv+wdWOU2eCuoWvpivFGxpIQSPvkApZPMA91+pfw0lBiwoJHNIb/sI0JjZ6M7Mk22KnkJIF0bJutpfKaGryEaiYopGNszbMmfu2xj9pRxdF2WlFBTdrUY2EQvP61jqr5CNMz9+IuBmMA97eKbJ45AXB1T0T67Q4+ygWCVkttY9QKZBoSLbpjq4Z1vtnKY/UFtRDSuHbM5j5qveCVyKK/ExjFL2JC+lnJNd30WVtuUV4cEBosiGhn4TTv+deNTJYzMv5zR+pBTJldfRw548KXWNvGGkebnuI4FAmAsUFRIsJCAQJmOjIgKBMBIMuMjY0GAqSNCwuMj3p9O3dQmbYesgdawVfVG3olFGyIZBtJK02fajrTw2grGE7bgvmHAG2/EFbJGNhPn7TiYMUchGIvOfUuz2pROFHKgz+MmeBqFjakZkJEkKjQEjEJBAwsJDMyqdbvsBE8CW6xNlDTKGhGQkKCgoSEmSNgOz6KqXuKwXXdO5rm9Xl8PD9kyC15/gd8Jk9PWLau/SsvDmAiEjbVQk95SSUmdegn7I1gdOWtZJgnxEZMwfR0rjTFmsyFromn6haukTrogj6Z3C4sgIdOC76TeQIBq8nk8ANM9ldhuAkpiXNug0ce8Ac7WcFj+qpMS7dQ/UTppc6gDGQaQs4qFm7AG0DoJsxLccBJt19xgrWdAlUYxgyXPUWjokL4WeSiKjYK3mWi6uLh0D+35puGPUyd9Mg3mbVKZW8d+kf6yy7gcA5UYNYelrHb7hq9eBMBuhcQUc37kukuiB4TBn886VtElLWLIlsLIm0SCRu0XhvK6k6ID2RguOWXi0t2TD34wTU/ofBeznlGC0OfD3ZqH9mwoYsptDu457Ox6n0ACioPT0TguxFl9Z6pUYyk7V8Kj7FQDeCMM2Zmw7WTnr91eWzbmeXqvHxF7dkgZmCU9vcfOd4pqthxraGCVEiuY5n7QXwSc6HEIuRU3UIQHKAmn0pnWBO6QThTpAC4YgvsUS4SMM1FYDmj8eQrgqQZs5rgSdZejKXO981q5JNM3HD3/Cp3Spdv9Zn3Klj1nQcyJrLpyW02vWghhcyYCtFTAR6Vs08ioxGN/1qNPkzpvSLmdwJvFXVjrtqMYVugzheR8yu0aN8lf+qduMBNyip5vjEs3Qqo02ub1AVfFkTHLTjY1YVODnMwXBbO+t8CDrl+6qVrDkhl/YieiCDGseZlscVzP8X1MsuiYvIGg+RkNKDbPswtaESQ3IoUypXEg9K98XwOihy0XVui/GTgXoeG3t0/yWFYKVZtTIC9jKtQVU5WnJIKaDkqLWzgGSWWuG+vrJFYhUopbHg55SSqaKaNNWc0z40Yij7MrZrJYwMg8fA3dshs05WayyXihHVry063a+woL+YCCBBJKeOUEgNONaHc0LhpwZ6Ae0G4Ch/StsEtQlrPGVFGitWsJFwD15Otl/RD+S5ffxrAijcXvERK/qZH+V3m9u91Gor7PUImjDUnNMvkSVQg1r00HLmvVcW6V7+C9uxF3Gyi6ytdYfF5zuTLayYvVTsvbrxiPjfJzCq3OnslCfuhhl06SthrLwqfVCg8Rp79RWZDUcRRiELaCt+GvC6EDSIInzAVxWyYEnSFli+HBoIANbquFwuYbwqKNaTDuNOxk20N/LlSr3ESoOnI2Ve4+nGYUtT/igI0BwbmkWmBAhJk4yxoaWvSHQuuSARsS/WkgW0J+s8zYDzGfxTMKPq0jUqe+N+gW1HucN4IHFVAaMov7KcWxqNvO2o0mfTm1VkuGDyUC5dFYxY2erN4HNET4C1py5YZYtYSJjShdzmCHw6LY+OhHauYe5GdhcMSq8N+OUC0vpNUHqQECgh7ucFTaPGCfeqMNQbX4BTOjzWBHZMIwZCw5pd0dpSyIIOhs/SLkGLTpguzI/AIq25iap9to3vhwpYYZxGhoM8Vg2mOkK6Q1Eq1dAdKTEE3Dg9Jbv0zA0jDs4hPfCwZebo/MYUoRp6zNbC8YT9gXjaRyG/htzZzLSl777Qmc/qSxRdjnUrJTPiK9NI/eoDoxc1LSOhcDc9G4sW/DZts+HgEYCxgWf2nNrhpuYlE8Mhv62YxRT4qIy6QJfZsUCH+8U1vzDoIZpinWShVKZdu+hW1NvfFXWuDKTGRDCLn6mIrKcJ/sMVcFwqKgD6iDOQ3dev+IwPm6RNFqvlop/tZ0ySDEPRq8Ezw1vLMsC04fY1wZEuLoPK2SQbdKwWJ1bkpIiFjxuhNaOggJrPE9yAglRA9HYJkRnzt5EXaOkNw6Rsn+ZmjJqw9pC+flWsWaJKpawOasVCI212D2GVSqeTBXKJC8uvHy+g4ELYgV5/Sh14xSgAf0hniHBjB1ETQAVEAqwIZgujmNWjbppcMi5pi2nprZK+skmMuAACMqPfGFBlOob/jD3S2i6BqNK/YZ/rc8CbHUGqS25SYS9vtmPQGYXQpGhUVer9ITo0byL0d5iuSoM/KzPiihkwO93K1vKJoKqUzHsiN0x14E5cGe0rSF43W/S1UPjupbohKtaLPAAHRoNxYhMtHjWoF+kNXbHYZZPeFK6bwAsxPqm33+R+UoKgdwHxzd0HSO/Eao0GUEcCwipz8GLhV02EhZMmNlE5GFBg3wbfJTRHzPX4cfbrQcQrj8CSt1EnsgdIZHkc+3ovRi5ayLet0WVAVMM8U/HdRU0E2twtQjAGBiOCmyxYvki9oZAh9gIHc3cHBjl6sdgYTo9LDhDqyucDapEctAnErS4rAhSxca9+kWwTT+Hri4rUHHTMQj79RDpf+0YQgB6ysLONx0SiSpYFxG5IokOspz0vyCKfuyvYibMONmr7HUjFpWlRtQIvuM8QDb5XOIo0vAiRlNyNDs5R8v6F/nh3CNcdt44EdQqJ0e2tH37mGZBzljb/KyH5BSbVpPabUfcUPHHzA4TIE21xBzIPpLBtaVqt8RadEM6JpGSBJOllgl2he+FepeREjKCsgv0HWGO7bk5H8GYA0vdCdNqbRBUWbPh6h3e+ByibRiNtpcU7OIFaRq3tpdISfTvZ6+SpA8CPruUMFjMd4TNH2nD0ImrgeZxmHSDXHBPElp2khj43p7i535mBPyD/HNC/D7nz1H/yr5kSDOzqgnwpcVu+uNZxt0AiYGZLUMqYCEx6aq4F3cGH2PR4oGyyjD7mxcw8KUWXQQpZ/B4mm0xfkw31+Zu/cr/ZRINRv8sgCAT37kzBxhtdLYbaU3ZA5dqbkRbnlnqHJPyF+F4D2Q7/sPhWoEcSuFuBWxzdP7c5hkSAeFiNgyD/tC4eh2iOx0gQbQNZHkppy3O2Zo4E8xvgLHE2RS4nWJJFSAW7GO7ijsqKF28X9vbbwNnuW3JvvFJwvJb00ph9zp2Toa6u1kmjxCssIs05KWxqf6UmhbiB3srwKRwKj3nUw8QBH9dSN4/98+2q9V6El9u8BrtIjrVhh+AtLKiA7nHiHZ1FLYZk5ajgZd4D1lxqB/g4iVzVUa2A8vUEUlm5nsgAjgVgcMrnaUO1hO2wmOgJXb6J7r+PR5TIYIrOXelZPK/OhKqrAarjiejYvNujdcaHONsZJabli6OnkpdVK9QRhmbTkSMrB26Zp8yWqwaTTmZYrwSge6d8x+JfrO2F9lT8cKY09+x058nKOiwhSM9YtUAhDJ2DR/rSw/+BKSzeWOlcADGs1swxMmS5W4MBLAFKX73xpjUhqUM2O/Op+SUA6ijkVIplWJiA0exGxLOPxwWWsh8ZHBgmR32wJidGg03nlApN5WZAqGeIvGoTJIANoxFlvpCzUHLdQrpOawhTV1jhDHEqBx742IEkuuqEzAGVATSeVV2Nvd7UrpRSS7SLZSLOochPPN6xB1o/qjTHJfaItZqb5BQmVmzlEUOpmEVeJ8p1RWlZRUdy3JrpUig/YPi0kuy09ozoQZ5jiN78eikCUk37tmwbMdvR1ZEFRTaWMRIRLBrF0TjbYN6puj32yf2/85NWSzuE6Oc07kZCQGiKdJK8cTMfE7xYTIkkq9+G90HiumRGCtVm2r9qpxPdhFOxI3ZuZX3DshFp3fhpRAdsyJ+YPboFOm9RP0vxqcRcJYpOdHRo7ZRU0HLoAyvrySaRxnP3JnGoCFMxwWGPcD7297QgZUNrq3ZUEgua3w8b6Ile/62Fn9/UbtA7uoowODf4y9ymPqab7V9ZhvUw941A53i7ecN/QqcOzggYt9aX2mJLiaQCqml5RyJssloKBNvQHJLZS8o+cuMBIA0gNoRE59yhDpjEWfCQphKxUUtGK22Sdqei33a3C1EXxOmCkcqkqASW3rP5CJC+iNEn6jM27P7Hf98FYR+kl0P0Lp7RwsxLEJFObh0Mo2emnnXByyUKLhYDK0LoIehGw=="
    -    }
    -  }
    -}
    \ No newline at end of file
    diff --git a/.workflow-data/events/wrun_01KXJTH8BX5EJ42KPQQBCSC9SE-evnt_01KXJTH8P3RBXRPNEQSHMT5HHA.json b/.workflow-data/events/wrun_01KXJTH8BX5EJ42KPQQBCSC9SE-evnt_01KXJTH8P3RBXRPNEQSHMT5HHA.json
    deleted file mode 100644
    index caf6d68..0000000
    --- a/.workflow-data/events/wrun_01KXJTH8BX5EJ42KPQQBCSC9SE-evnt_01KXJTH8P3RBXRPNEQSHMT5HHA.json
    +++ /dev/null
    @@ -1,16 +0,0 @@
    -{
    -  "eventType": "step_completed",
    -  "specVersion": 5,
    -  "correlationId": "step_01KXJTH8BXKCJT8Q2301PKTFGS",
    -  "eventData": {
    -    "stepName": "step//eve@0.16.2//sendTurnControlStep",
    -    "workflowName": "workflow//eve//turnWorkflow",
    -    "result": {
    -      "__type": "Uint8Array",
    -      "data": "ZGV2bC0x"
    -    }
    -  },
    -  "runId": "wrun_01KXJTH8BX5EJ42KPQQBCSC9SE",
    -  "eventId": "evnt_01KXJTH8P3RBXRPNEQSHMT5HHA",
    -  "createdAt": "2026-07-15T12:02:58.371Z"
    -}
    \ No newline at end of file
    diff --git a/.workflow-data/events/wrun_01KXJTH8BX5EJ42KPQQBCSC9SE-evnt_01KXJTH8PS7V3E6DX2WRCK810C.json b/.workflow-data/events/wrun_01KXJTH8BX5EJ42KPQQBCSC9SE-evnt_01KXJTH8PS7V3E6DX2WRCK810C.json
    deleted file mode 100644
    index 7baa8df..0000000
    --- a/.workflow-data/events/wrun_01KXJTH8BX5EJ42KPQQBCSC9SE-evnt_01KXJTH8PS7V3E6DX2WRCK810C.json
    +++ /dev/null
    @@ -1,11 +0,0 @@
    -{
    -  "eventType": "hook_disposed",
    -  "specVersion": 5,
    -  "correlationId": "hook_01KXJTH8BXKCJT8Q2301PKTFGQ",
    -  "eventData": {
    -    "token": "wrun_01KXJTH845B37ZAB3DJCPQ48Z8:turn-control:0:inbox"
    -  },
    -  "runId": "wrun_01KXJTH8BX5EJ42KPQQBCSC9SE",
    -  "eventId": "evnt_01KXJTH8PS7V3E6DX2WRCK810C",
    -  "createdAt": "2026-07-15T12:02:58.393Z"
    -}
    \ No newline at end of file
    diff --git a/.workflow-data/events/wrun_01KXJTH8BX5EJ42KPQQBCSC9SE-evnt_01KXJTH8Q1QNPF9JSYSBVQD0RT.json b/.workflow-data/events/wrun_01KXJTH8BX5EJ42KPQQBCSC9SE-evnt_01KXJTH8Q1QNPF9JSYSBVQD0RT.json
    deleted file mode 100644
    index 5c06131..0000000
    --- a/.workflow-data/events/wrun_01KXJTH8BX5EJ42KPQQBCSC9SE-evnt_01KXJTH8Q1QNPF9JSYSBVQD0RT.json
    +++ /dev/null
    @@ -1,13 +0,0 @@
    -{
    -  "eventType": "run_completed",
    -  "specVersion": 5,
    -  "eventData": {
    -    "output": {
    -      "__type": "Uint8Array",
    -      "data": "ZGV2bC0x"
    -    }
    -  },
    -  "runId": "wrun_01KXJTH8BX5EJ42KPQQBCSC9SE",
    -  "eventId": "evnt_01KXJTH8Q1QNPF9JSYSBVQD0RT",
    -  "createdAt": "2026-07-15T12:02:58.401Z"
    -}
    \ No newline at end of file
    diff --git a/.workflow-data/runs/wrun_01KXJTH845B37ZAB3DJCPQ48Z8.json b/.workflow-data/runs/wrun_01KXJTH845B37ZAB3DJCPQ48Z8.json
    deleted file mode 100644
    index 58f72d9..0000000
    --- a/.workflow-data/runs/wrun_01KXJTH845B37ZAB3DJCPQ48Z8.json
    +++ /dev/null
    @@ -1,31 +0,0 @@
    -{
    -  "runId": "wrun_01KXJTH845B37ZAB3DJCPQ48Z8",
    -  "deploymentId": "dpl_local@1.0.0",
    -  "workflowName": "workflow//eve//workflowEntry",
    -  "specVersion": 5,
    -  "executionContext": {
    -    "traceCarrier": {},
    -    "workflowCoreVersion": "5.0.0-beta.24",
    -    "features": {
    -      "encryption": false
    -    }
    -  },
    -  "input": {
    -    "__type": "Uint8Array",
    -    "data": "ZGV2bFtbMV0seyJpbnB1dCI6Miwic2VyaWFsaXplZENvbnRleHQiOjR9LHsibWVzc2FnZSI6MywiY29udGV4dCI6LTEsIm91dHB1dFNjaGVtYSI6LTF9LCJSdW4gdGhlIFNFTyBpbXByb3ZlciBvbmNlIGZvciBRUk1hc3Rlci4iLHsiZXZlLmJ1bmRsZSI6NSwiZXZlLmNoYW5uZWwiOjgsImV2ZS5jaGFubmVsSW5zdHJ1bWVudGF0aW9uIjoxMSwiZXZlLmNvbnRpbnVhdGlvblRva2VuIjoxNCwiZXZlLm1vZGUiOjE1LCJldmUuYXV0aCI6MTYsImV2ZS5pbml0aWF0b3JBdXRoIjoxNiwiZXZlLmNhcGFiaWxpdGllcyI6MTl9LHsibm9kZUlkIjotMSwic291cmNlIjo2fSx7ImtpbmQiOjd9LCJidW5kbGVkIix7ImtpbmQiOjksInN0YXRlIjoxMH0sImh0dHAiLHt9LHsia2luZCI6MTIsIm1ldGFkYXRhIjoxM30sImNoYW5uZWw6ZXZlIix7fSwiZXZlOmV2ZTozMzQzODE3NS1hYjU0LTRkZDItYjE2Yi02YmMxZGMxNTc0OGMiLCJjb252ZXJzYXRpb24iLHsiYXR0cmlidXRlcyI6MTcsImF1dGhlbnRpY2F0b3IiOjE4LCJwcmluY2lwYWxJZCI6MTgsInByaW5jaXBhbFR5cGUiOjE4fSx7fSwibG9jYWwtZGV2Iix7InJlcXVlc3RJbnB1dCI6MjB9LHRydWVd"
    -  },
    -  "createdAt": "2026-07-15T12:02:57.815Z",
    -  "startedAt": "2026-07-15T12:02:57.837Z",
    -  "status": "completed",
    -  "output": {
    -    "__type": "Uint8Array",
    -    "data": "ZGV2bFt7Im91dHB1dCI6MX0sIiJd"
    -  },
    -  "completedAt": "2026-07-15T12:02:58.529Z",
    -  "updatedAt": "2026-07-15T12:02:58.529Z",
    -  "attributes": {
    -    "$eve.type": "session",
    -    "$eve.trigger": "http",
    -    "$eve.title": "Run the SEO improver once for QRMaster."
    -  }
    -}
    \ No newline at end of file
    diff --git a/.workflow-data/runs/wrun_01KXJTH8BX5EJ42KPQQBCSC9SE.json b/.workflow-data/runs/wrun_01KXJTH8BX5EJ42KPQQBCSC9SE.json
    deleted file mode 100644
    index de6eae7..0000000
    --- a/.workflow-data/runs/wrun_01KXJTH8BX5EJ42KPQQBCSC9SE.json
    +++ /dev/null
    @@ -1,31 +0,0 @@
    -{
    -  "runId": "wrun_01KXJTH8BX5EJ42KPQQBCSC9SE",
    -  "deploymentId": "dpl_local@1.0.0",
    -  "workflowName": "workflow//eve//turnWorkflow",
    -  "specVersion": 5,
    -  "executionContext": {
    -    "traceCarrier": {},
    -    "workflowCoreVersion": "5.0.0-beta.24",
    -    "features": {
    -      "encryption": false
    -    }
    -  },
    -  "input": {
    -    "__type": "Uint8Array",
    -    "data": "enN0ZCi1L/1gICxNoQB6xPQhPkBp1BzDMAzDMAzDwzhuRzukT5pMkbpTEmmTqJEUsvkwiNIp94b5mHJlOguDHltBE6EI7befFADua6R0FAWYNgLuAQAC7SI8PIX5rE5nQDWUcptD/np+v3S8wbaupWRbSqSQI53HSnXLjIjfR8EIGsuyIiIcT+d6uNW69tcWOUVQd+N1wA4BGCYnLH20EDSskmEAsJBAILHjdTywQ3o04SzUvl8uMeEsF+x3niATzvJvJxqAxFkibFkYhK07lViGBoxiG4XkbYyg7cMHEmf5nrzS5wubkDiLa1wfDTNcp4VJmKpsY5YMkericFpx9BhWC4tInCXif7swiOQjxPBfowcTDigiUYtEUAMGahCBGInWJpgJCkgZCgeRB5IJicTZyjoSzqKvTX+phTWYgC3V/7SwDBMSS5OASDjLRjC2b+vXoAL2Kz8/lnCW6aM+kND4+F9TSDgRvj8MCQlncfueThELoL0INVvZBtJEBnAatfNwVVvY4tGDghkc/Fvqalc1iLwIF0ZB6ZuIsIXShb+xYGBLA/ddKWgokLCl3Oh1wq00rCjOChI2cqfPFzWU2ina+Fh97IVFmIm6LxXBwBa3bWEZIoyzNAaJOIs3bXcF4CztMUVC4iz7+hv+IOIs/7H/2qKtBOyU4frCJBFnWQfpM7Twb6FWC3vA+jpaPhp6GMsEbIE4ruG/jpgH4zsPHHgwoUCGhQEXkggVDjiQRKCYeDCBw4AGDohAPF6E1sI2wmcZJO8bI1i4TMAyOJA4y2t2uJWFOXCWj9XDqPZ9YQ2cZVtTC6OwgFth2BY24SxvKc3xmn9dRXW0MAln8eVnx5BWGi0TsAciGDC4yraeGRwcE5JNnpUJVNgwIIKBDYtkz5PscTBGT3r09LV+mrCL0X4s9dFQe+r61k00+6W83L917BBSKaVOuO/JHDaEm7AT9ou8KWFczy9W7UvHUq8L9WQtHenMkY1DDUHC6D19evp6Vx+bj5HNXpVOcqnoupLJuvFOv5WGNJ2ps0+jfU+vw5byo52iSJOCHtE7uyebtuyCF5TsXakGh0Uyj9hF6Wz01DkD1/35eMR/OX3q4R4X3BjBAs/qyeMWXfQ4WYaGhI3J2nW4l7rcCj//wiZg+gg/24sNJ8+Mgi3BrdKh1VODHS3M66FWzDtkad2ku4B0diAgLqgUwyqdISCyec25ksQtNR2u5U9zinTb+lyP6amvF9nQ0Pz659vJQjauH+sbnVZyqeiuF9msYyld6qz6KVE7KJ/HOWFM2PZtVemUz0m5JsvzUmdtq4qdV6kpcULwdW+X03dTTunCjH0lhNd03zjpBgHhsbmysGJPCIh/S+1EHTNNeEqpnVPKU3Ml4GfYDCsIiGQQEA8Bkc4Ft7Lpk8cLp89uzbq2+9pWmsp3dXCnp0Q7RUnZtfI/9jGPWOJoK09KpNCUDKLY7ST787VxtC2Z77Mv3MnKhdF1qXSqbpear/NFmM3TXKgZ+0LE5V4zD6fXKv9ttqfZ1cKcBJGGbFCtfodsbytPNs+rk56EXVn7nmRP22c5n+d5mEcF1z2Yg9GDeTDGsuLR8zyZDMNYUMEF+VQ8epJxPlKJH6qFCs0psK1snAG7twvlVnSCms/PnuMM4DKQTQNO39cKf1O7zJHNUpTKfqcPtuYJu+lO67GqlOlnLgiI1Mvx5WCM+pk7fRP2ZF5X+ZESkA1Fe3iJJ3/s0n3fOn130CgvtxR2b6LcEoK6dWm0F/vaeIp4shLCta/XOcTvqYW1b3q28ll/qYhdmBA+QvmganBYTBOe0ED4dp4SpuqPMGxlW49RSwmRYCYoyH/nlgyfyUzH0ghBsm3sVcyIdWFbft+VGCObCQgkEjudW+l6mhN1BGTTXpSkZhq2ZNa+ZO/t0kEgG8mDL4yvi4DGAskc0oGhczEjGwmubIvYhwabHRhrIi9CCb/XpJ+zvvPH5ov9UsLIpm17XfnCbEpZuRR/o6jWd9tyP1ZUs7OP3bpCGi3klq/83lSyh/pekc0TIcDFBUOBAnPhwoULEUyvR/iT8T0jGxqsdgul1U5KxrlYJRQnPBeQTqveSF21zxS73Feov6GGq5GNV0yw4MiosMituHb2mrW6oGSRSubUMwVF/51AfZ1oVrsHLHSOKQ4xCWEr/dRV/9j6V21jvmIYbWhFDdj2FsJ1q2GErJg8dqiVe/5kHl8/DzyAgS0P7uHhAXWbSbMOKbFThi4HRc6tihR/Fx3HqZi0dVY/yttJwobWup4FjIwKjIyKDAsK2XaaxIaRf2xL3tDgHEzfbm6dU1coXz+ZP+Z3kUrnoFjxOjhYXcQ8320T+FjLlcuxcowAoz2WHrcqj1lJduVHqyePlCOZaTJ5w1SRcSL+rcYT8XCFo3kRNswXp4/M69hIK6fAtvA6Xkfj+/Ex5arYkeZC2Vzs6bH+Y6VSE4K1GhnrbLm6F7faV0Ejo59GRl4azEawJY9VJpBX63X/wCqnyVNB3cIX85WCLS2E4M5AKWTzAPdfqX8NpQYuKCRzSG/7CNCY2ejOzJNtip5CSBdGybraXymhs8hGomLKRjbM2zJn7tsY/aUcXRdlpRQU3e1GNhELz+tY6q+QjTM/fiLgPqtTg3nYwzNNHofEQMCif3KFHmcHxYrZWvcA2QYFC+8p1cE922rnNP2B2opqWDlkcx4zX/VO4FJceQyjlD3JSynnZNd3UaVteUV4cIAqsqGh34TTfycedfrYzMs5jR9pRTb8sCdPSl0jbxhpXq77SCAQ5kKFhYQLCQiE0eCwiEAgjIQDMDQ4NpgKEjYuMNKfTt/WJWyGOdaKvqhb0SgjZEMRrSRttv1oq4+NYCxhO+4MJpzBdpwBX2QjYf6+kwlDFLKRyPynFLt96VBRQjaRzEaBSiHSRjUM5emzCGTzEIUnqCMIypwGoWOIRmYkKUg6IxCQQAIDZBMqnWz8AROA16sDYQ0yhoZkFBQUFKQkGTYDmcrrJvhhxvT6OtFq+7csEefCLUaCKnr2lH6pUMP8PsDpA5Nk61SALCJuy0BHsnF6WayHtVymS1Dw4xN+ihfp7YK1yCiAY6DpCZcg9Hj9HAFwnAs7ZgA6sWfa2NDEeQGmm58WUqvkg3e6PZA4PUDq+gc/Ul7noXLbA3gHCdkYt5AEu0Hu26NkHUniisHaczW1RCY/FCZLwkbpWw1ZIlf9GQPifspx59FZGjM9561S2aVFfCV9RWU3HyaTGxdCUl+58PmuXgOhZIT7Sja+I17k4YHs4cnmia/EJg1gyUBgAJr0LNHmRsEMruTigP29AQJnQTSvZBumFqdLibun0KqfvASTjcffZEvtb6s1kt207IrvvXjphYbgi9rTT1oYthDOsl+JR3akhrXdb1pQQTi2r2MLy5ZZf1+ZOpf4FDc9PvY8lgYw+3F6k5uvFBd/PSTRZjGhVTSF+CSvCDjR7pCvVNKEJAGPBZLohdYj97ZOLHXoFtzD+VZKhIIwHJsB9G887HC9gvbbKAN6yPCSudT5ZqwheBoHP/wXH3ypxv3znXKDjwk6I0HA//pZXrMnCPpKNNg3DgOmr5mRv8T48HcAdRFsv1yos4BeTek0QNVIaBEkgfna4hrtlQ/5lzHGLABweqozZmuytU7ahvQA1dSTP+lBt7RjmYBfrZQMs/S35oO/X4NVTYYFG/7CTqULbdhxmGVwzGDw/zjC4m1SADHlAwRSb5j9C3sTBrMBImJKuCl41tFeekavLuGn1uRiMxUY4hWgTzNYli+scaJGzsGE15agCo6WADHFi1RBdu6hH1orUE+eUwFEEpk8VugLSAlNRIe2HcdUjp44BEeQzb4JI9biQ+DH5tRplCyDsioo1Szgaa90PpYFZjAkRwLV3jhA0JpxBB3lC+LnB+gM/TYA8v3TbNI3JLbxeSkQo1rPiyB+8kfZ5QglksNvLOaEKGG6k+iruhhexfc/DXwS6qs4tTDauNR8kS/hpJDq2lRzWXM012/o3ueLd7grs3KDbOX0BwJHNNuuLFL9sKxXdSPIuFqnsNfcc1kgT6VDqVHSZkM5OTVdQmN32jW1TpIFjCI6ggnQuH4uYCQggQHRO2D0VMbgSS9Lbz68BgDGllY4dqiBHOqAmUlnuSGMjeN7NqSKe2TGQZ8xde/ZN9OjZaAfNAhKnDvJ6hFKxVRKkdhQ+Rs/sC43UAwiAi1UCuROOs4xs/gmPh5XS+TU7535JWqF5GPhgQmrDCzCvpd7NlVn5h7PbNt0RislLh9FBjalo8YMuW3jCRSMtGVYy+paZgsy8TXlxpzSsH2Ucp9CVO7cRWjGOa7oCj9WOMnClvRqlbo9EIjzLj8f3kc9JzIqKKotLrgJxRorZg67TGPxjXbD0YjRsOCw8YyUrmiXCkuTmQA8tLWZ4oHX2PFJjiJgGBVDIz6PTYP5VCzfpWiRCl5HNnqCX2eyfFfDEHXcqkOMDzO+Vo4uc0Dqzdn+z1qQPLAv0DwVY+i+xqhMcvrlC33ogJ69E92NsvWhvqUsiTgn7XYPZCAPUbNVLAJzivdq2XLPdkA+djTyMmb5dPbWYDhlWxtnkEW0PQSEQYmry6Qtv0yIpTQ+60bHDw4eUbFXvDdBFmTN0L37bv1K49WycsrE24Buq/kzRyKrNNnUUObCQUWdUAdLHmLz9jicxq04jVDWsvLbbScOUouD/Su55IZblt7AY0NIte0irOxDEzLHTbIWIMCtoqQyC6Jbv61RWGCN0Cm7IkHWQDRbpavMsZqwa3i8yRDR9q+pqVRtum04P3sM1pCo4hP2S7Wq0PnLKcegrAKQKeaZFuLKkq9wMJwDraCmH/x2DAIauD8EPmTLsZGocKBBAjc2ot3ckU/WqJuGQ4prk3IaayugrcIEMBwPQQrJF1aCk75Z65te4vYlOKoLNma3XhfA1cGS2vSeP1j3Lf7oqbsRihdNvoo1JyQelV0MMBaxUiHqj1isCDMG7H7fsEU5Ur46Y8POupO3wVcvzeGeibaE4jW8QVZPJdepRVdYCXHWA4RoHIpBFlDMMyb681r3O7pZ2OEZ7ZIBDBPLkX77tfXFTwjTPszfoNAYKU5obXIE0RGQAH1IFnJ24ygs4GDeESFBgAZqG76U8Y9F5UmLd7feL1x/JjN1EYWBO+KQZKV29n2AvJ5E6m/ZzwBuDKiexuhqeSYw4GIvR9TTwxWCsWr64knDYYc4AX2b8xzwzWphsEg7DV1wZqsSDjpV4pw4EWmxqFYUL8VlL/AQLKQfQ2cpa6lYp2OR+quGdAizYxKAtWX5zRc2RIGq1K4TmUuSHnd5tflaKEL4f1ImLXDSq/jrPiwESs1FI0XHOTBv8vMHWdhAAKPFOYa7iUfP+/fmYfkjZXYVOW/sMiaHtmR4DU28INPTNnnKc3qKTKtB7VorfiD4o2bHCvCn2jqH0h9Jca1jtSuzzrrhjokQSapnyWSC0oSnQp3jSNOMoHdxvC/MsT/3vkUw4kC9OyW1Egq5UJYWrq1DdpyDBhta3xY9Bdt4GZnO1saPhBHd9DOrksBeQGxH0wc7/r2peQ1pSXSaXOBWHAbdeBfoKAlgJwez/Ldpydz3FEL+QH9ODg/ifDNqo9inD0k3rJbuhbFIhn4Sy0A1CGLAl8v4CW9iTIRVlJQ7zddgcXygEDbX/U0x8OKSFl2IlEh4NM2hGBFmzlnk5H7t/wVOgwvcrIMgsO+8NodCNpLajaYm+mOVFG2ECs98lTea8mnhlBHk/pb0cLqgzDK5T+Q0mK8dXfKMHQFGMefDIB4aeuq1+CHFsA2+t2xT25qzM4kB5sfZ8QFgCekU+Go6ASwA50AedE121Kv0vVf3258Gon3bHX1jhntnljVXChVOY3Sy3ZlhiXt2tcIv0nAljaXartRXCCZYXUEThQo9tC8iQlTA6spsj+8n2/72FEmcq8HPEER0VRs/gNTqkA4UjxFkgtURjIfLUVVH4gAZyNKPdnl5XF3d7IA0VRCctfHOJ7TXqaVOGwia584LMEBT7BxOdJt7VNMzAgkt5EqK5DN1VKu8A0sc/50KJP0UWkI3IssTSff+T6EukleERpm4rlSM9B16v+cZ9a7apnJW1AIqOl0G92oS2RnJXtyx4uOY0r6j9r8YUbhjj9P2iIIBKZRTNexXtt40FGina2NbcxjGk1l+j3OaxWpsgwD/2pBn0zAJhq0bMMjWpXQosagrcemXit7YZEbBxo9nDwc/2ji+djgqmhXsQCk6rZQ3nNCJe5NZAZk/QKKoTJcAB0y0l2JCuYOAeIrrOYkmiUc0hCEC6tBPtOIREuoGJ7Sq68WBY7oYyOLNxZ2EhlQQC+lN5NKUw0DWiNgbheoPqXBZ3iZej18DVodUzd4WOMwSVQ4+oVSl1LLkC4wOdsytMyHvdjVFSp2Ezs+B9xh22CNbIHXwBDAzLdq4BaeojEhUVGppaAqcCD6ppYSNdA0imLLVj+b4HPGshRZWfUU0MHsmBcaL6PxpXf/arDyn85m0iSJVs4pymKJp7NrqBKW2X9azY3Mi6uzaWvsbhKujzQhzilCo0Xc54q4Lsm+pp3TMHzD6GVRkeD15YHrQ2MMXkpVqpaEqSvz9+ZzVd3s3eXj9oYwWSwwe42VQcGnkAGQIlzNmbhfoJIFYwyFzJFhPzgaJfyL+fySsBPrJYMR2zSaQ7N8EKoNArx4M9uGow8QQzTtsmwa2nyLDtkgIyqyh/O0nbAna4da/hzapk7uPeOXAckQ1aQVIEiemiQsUV1L91U9pBwk5ZaF6rtlzilY4WsUr6gJixziejxB1gOERoK3iCSkEVWDaf9aeU+5V5HKj86A265kIa6GlnQtRF2i7zJYtA3UB1VBTErXkQk0cniGeL5tz0T6N8JVJUSsRasXdBZ62Con5ubVXFwyAus6F8nYF"
    -  },
    -  "createdAt": "2026-07-15T12:02:58.048Z",
    -  "startedAt": "2026-07-15T12:02:58.051Z",
    -  "status": "completed",
    -  "output": {
    -    "__type": "Uint8Array",
    -    "data": "ZGV2bC0x"
    -  },
    -  "completedAt": "2026-07-15T12:02:58.401Z",
    -  "updatedAt": "2026-07-15T12:02:58.401Z",
    -  "attributes": {
    -    "$eve.type": "turn",
    -    "$eve.parent": "wrun_01KXJTH845B37ZAB3DJCPQ48Z8",
    -    "$eve.root": "wrun_01KXJTH845B37ZAB3DJCPQ48Z8"
    -  }
    -}
    \ No newline at end of file
    diff --git a/.workflow-data/steps/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-step_01KXJTH845WNPD9MC53BS00TSD.json b/.workflow-data/steps/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-step_01KXJTH845WNPD9MC53BS00TSD.json
    deleted file mode 100644
    index a005b20..0000000
    --- a/.workflow-data/steps/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-step_01KXJTH845WNPD9MC53BS00TSD.json
    +++ /dev/null
    @@ -1,20 +0,0 @@
    -{
    -  "runId": "wrun_01KXJTH845B37ZAB3DJCPQ48Z8",
    -  "stepId": "step_01KXJTH845WNPD9MC53BS00TSD",
    -  "stepName": "step//eve@0.16.2//createSessionStep",
    -  "status": "completed",
    -  "input": {
    -    "__type": "Uint8Array",
    -    "data": "ZGV2bFt7ImFyZ3MiOjEsImNsb3N1cmVWYXJzIjotMSwidGhpc1ZhbCI6LTF9LFsyXSx7ImNvbXBpbGVkQXJ0aWZhY3RzU291cmNlIjozLCJjb250aW51YXRpb25Ub2tlbiI6NSwibm9kZUlkIjotMSwib3V0cHV0U2NoZW1hIjotMSwicm9vdFNlc3Npb25JZCI6LTEsInNlc3Npb25JZCI6Nn0seyJraW5kIjo0fSwiYnVuZGxlZCIsImV2ZTpldmU6MzM0MzgxNzUtYWI1NC00ZGQyLWIxNmItNmJjMWRjMTU3NDhjIiwid3J1bl8wMUtYSlRIODQ1QjM3WkFCM0RKQ1BRNDhaOCJd"
    -  },
    -  "attempt": 1,
    -  "startedAt": "2026-07-15T12:02:57.888Z",
    -  "createdAt": "2026-07-15T12:02:57.888Z",
    -  "updatedAt": "2026-07-15T12:02:57.920Z",
    -  "specVersion": 5,
    -  "output": {
    -    "__type": "Uint8Array",
    -    "data": "enN0ZCi1L/1gdSgFlABatOgePTBr1BzAwMDAwMDAgCUFXPsUIdJkSok7JVGrXLKTyM2P4VSK/gA/LLtD7IFYvYWaKkUUxSdlgNd7c5kREYLyAccB2gG+2k4TO59S8+GM4OveLqPvllxfm6QLM3aVEV7TfSPUDQLCY/Nk2WNPCIh/Ky2kTokgjvJp51Ty1NwJ+Bk2wwkCIhcExENAJFPBnWw69Hhh9NltWdd2X9tJS/muDm70ErYRS8kulf+xbznjh9lOnhKmTpTLkdgt9DRi2Z+vjdm2XL7PvnAjKhdG15WSmbpdar7OF2EuCXfScJI4LUzYyKe5UDM2hojKvVYeRq9T/ttsT7OnhQm1k/DwFOajOr3BRp9Swyd3wnCbQ/56fr9kvMGmqpVkWwlTyJHMY5W6ZUbE71vgvqsEMywURUVEMD79R8lUD3da1/7aIiMGdTdeB+wgQFES4uc1U56tBA2nVBQALCYkJGLH63hgh3QW4fvDgKwKHEQYiLTvlU9EGEgF+52jFYkwkH8LqUSEgUQWBMIDECgWyLA44GJCQsUDAkxIeEABgQLHAQ4gEJHweBFSkAWBLIm17vRZFQQA439sexjTvkPWAway7G3M0Pah/gYFC8IgUAjwIMJahDkBKE4AEUdx0BqFQvHAUeWBABEIExQTE8xOFrIqGICBfEc+6XPIgsBA4E4gSwAG0jDWIYuCgfj7xgyr8XF6GNVHwwzXCLImNl6zO0sLWQ4YyFtJc7zm1/j4XzMIBauCCAPZ13cIBRC4ybb5DhXn4pROpPBsQDqdepm6aZ8ldrmvTn87DVcjF6+gYMGRUWGRO3Ht6/W/jT7qVDm5opTLpWfJif4LQX2FNKddBBY6xxJ3lHYZYSf91E3/mPo3bVN+Ysg2dKIHbHsL4TrVUEJWQI8d6uSeP5fH1/fM4OCgkAt6VCpgYeOAiAY2LHI12/o1uRoHI2vSo6cv9RHELrL9WOmjnfbU9a2DNPufrNy/deyMoaNPPp1w33M5bAg3YWfbCRh29FFf5M0Ho3p+cWqHdKz0uk5HFKQjnTlycacleHK9o09PX+/pY/MxctlqUihXiq4nmasbb/Q7aUfTlzpmn7J9Ta/DfiR9+WwjxjQl6MHe2TW5tIVxVbBykr0n1eCwyOWMHUtm2VPnDVz3Z+OMv3L61MM9KrgxAwOPauhxi449zpWhMWEjonYdbqXu+XeSmsEuAPaT0Uf42V5sCD0vCfYDd0qHVEcNNluY1UOdlHfIzzqo24B0ZiAgKqgSwymdISByec1wn4dbajpcyp9mxHSb+lyP6ctgbE99vciGhuXXP99GF3LxdZOkH+sbnU5ypeiuF7ms4yf96Zz6Jaydk03jnDAmbPt2mjTK55RUEeVZafs8m22f7fSxEWslbMa9AYUv2Iw34ItcJpZDEDsVcnGQ+U8ldvuSkeKEXCKZTQK1AtMmLYrkabMJ5PIQacgGlep3yPZ20uTSvLqnSdgTta/J1bRtlrNpmmZ5THDdYzkYPZbHWisnzpqmyVQUBYMLMshm4qxJhXmmDz/UCx+njxYat3x1CWwqF2/A7u06uRONoObzr8d4A7gN5BIAp+/rhL+lXebIZSUqZb/TB1vzhN10o/U4Tar0KxUERGrluHIwsv7lTh/EnsrrKZ9pAbk8aA//cOSPXbrvW6fvDsqycith9yDllhHUqUrZXuxr44hxRGWEal+v8wnYqcPvqQW1L3qm8ll/pYhdmBE+OvmganBYRBBTWCJ8O88JZeqPKExlW4+sn5RwoFBYkP/OLRm+kpkMpVGCXNvYp5iMdWFbft99GCMXCgmJSOx0bp/qaULqCsilvfg8rTRsuah9ud7bJZNALhMPvjC+bgIaDORySAeGzsWMXBzwZFvEOmXtHhpsdlhribwIJ/xWUD9nfeePzRf75YORS9v2evKF2VSiciX+Jkmt77blfpykZmYfu3V1KmULuT1+bymXV+TSRBBwcaFUqKBgwIABQ4TS6xHeZHzPyIYGqt06SbV7AhFEAMGCPLiHhwfUXaBlHfJhp+xUzmHObYoSfxcZhqmA2jqqn+QtlLCdpap3ASOjAiOjIsOiQraNoNiQ+cf24w0NzsH07ebWOXV18vVz+WN+F6V0zinDdSdWvA4OVseU57sNgg21PKkc65McM2C0x0/j1OQxJ7mqZ8f5kerImXKkEkGRL8oUFSbi32o0EQ1POJYXYcN8sa3yOpbp5BLYF17H61h8Pz6W3BSbaa6TzcWOHus/Vik1I1CrkbHOlKt7cad9FjQy+mlkZKWhLIP9eJxSgaxar/sGThlBjQV1C1/MVwn2szCCewOtkMsD3H+V/jV8HLiokMshvW1DQGNlozsrTbaIPYWOLmS5etrfJ6GzyMXBxJKNXJa3Xb7ctyn6KzG6juWkkhPd7UYukQvP6/jpt5CLMz9uIuBqKM16aCKocUiMBCz6I1encXZOnBIyU+se4NqoYOEdpTq4Z1PtnKY/SDtJDSeHbMxj5adeCK7Ek/gYxicbykol52TXd1GfbVlJeHBwKrKhoR/E6b+QR40+NrNyTuMzrciFJ6/Zw448JXVl3pBpVq7bTEhIKBgqLCZcOJCQUDQ4LCISEsoEBDA0ODYUCxM2LjDy/Wn0bd22lhK2stY56lgn+qLuRFlKyOUBC4S/qDMIyp4GIVOIRGQ0SZIOIxCAgADCwkMTKqls/RNAlusTaQ4yZ4ZkFBSkJCXJsBmZyusy+OHE1P56yWo7siy55kIFRpqpyOwp61IDXt5+QOuDRmrrfIZCRJzJZkfyxnNZ2421yE2noSLBJygr/qQHCZYno4KFS9P7IUGo4TWuAkB/Lrh8A6CJl9KGlmbfFGC689OiqkqueL/zQMhpClK3ciAjxXgP1Xo+gNognI1Oq2ewJfU9YSWjuyQuF+w9R68lKJlQuLckaJSN1cSl9apLY0C9nx/uvDvLOdM975fKGy32mPTgVXb4EDi5KSHE+trCF331DxBuIxCsVOO74SJjD5oOMpsJvpKbtJUlH4E9adKzRJobLWazkqYDhu9BID0LkXqjbJj5OCmlxFHjfsAEqzQyfyUtzd9aqU12b7ArulfiXb7QldPjLTwqvrOcV1KaW17D/vfbMbAifO3B2GhZfNbRV7TPvX8arceIvd8SAMyynd565jvjPrMeWmiznRABzYt8oigCQPQhdFWqNxWS4GZB2vWp9YW7rBOLOjsLHmG+JRIhF+bOwACtMx53W3kxLgDNE0uZ0zofWDWjT8Phw+bjYy9V0j/xKV/56EBPcBCYV7MThPVKCOz+gPnTF9XIUWLA+IJPTRaWZe7MmRGvRDpPoboktKAIu/4/+xqLyvfzDxWzJuA+Pa0f+TQro7q0UfYJ1fGTPHmqbq5gHcFPb4rGnOBbAYPer9BVHYZ1Gn4vu2Rr4rBNMJvC8YHC/2mERdjkHoTORxNIt2EmXVgkrKcDT8SU30LWWfX9y4zuucSRWvfiiFRwg5fuPtVhWRtY2UcN3cBJrB2gsgMt2TFdF4ma7PwhmVpjqG+YrQDsEpk8VuhHSgldRL+2aGOyjnM5RC6hzR4QhlGYHIhjy9i8yDKURYaSZ8FPe1nn2yyQBkMgJFDphQOCx4zh0nG1IH2GQE9olADA7p9lkw4ioY+PT6Bi1U4uovSJQ2XfEQcimX6PL89EB9PWRK/VUXuV0L8l9snia8daZL4Rqbl2vnCm0NPaZEqzpmCuk+helxdbcJdhpRTZhu+PH45mhldZd/3Wss7txppxCaeatLlDWfFPhUYpXdJmQ7lxagpCI+W0f2rNJDsQRUMEAaCx/HphJJKEMZFyQEKojMWzUJa1fdgP4scWajiWreEs6tCTqedyv8cG9/eSpMp/hOKw/DG99zg886il5h/0CDDOLZqFCa3EhExD2hCoN9ZalwaogphmC6kC/pOFXmrANIvPpMZxmYnUynunfAkscPOPc2BxlUmhqKByHZuyyPzEaCxNZ/eVMHwoGQiXTg5m5G3nE6gYGf7AmlOu9baLibQpB+aEhinjN/lYIp5zs7cZyrlivfAOw4kWFtMro9QRBMF971LcsB2tnChT26m2f+EnBG2swMgwkYzlXrSZo4glkQsOG89J6Y6Gp7BxmUfAF1tjsvR5RRmPrTREhpEamuvxmAnM92KgjUUbV2joCEMSbHceyzdlGHaM2zvEcAjxxelowhhS24zwNa0F0eP1xcHTOId+NTZgktMP38MJnRtnXVH2LBSGlKeIo6CZ9zQHSilqSWL9MJO8UJOtd7b35YOGRgkjnU8F3xp2ReprbAaxuO04K1bijzNpDl9GsdyTjD/ILlCv2CdZnJJp9+66dd3GS2dlK5MYAFVY9mfARCJrsq2hbIQDirqXDtQ8KORZOJyDW3MaDa01519sRwDS6WBxK/G+YXiWVYGNQ4BqHxHe7UMOeeMmDRb/4pYmacoC4xbf1lGQY42Fl5d1p3pZA43ZApQzZ2qyrmHmTfdI0b9eTTW16WyB/KAnWFOhikJYctQ6QwcuvjuGPRVApqhkihZXYr7wYDhNV0FOP7qOcRhp+DnEa8igY9OjjkBvYpnTmK87xzIpI0wIh9OuCcsRr63jXtUTS3AtBLOeL0mFKX3h14e8xKorCKrZbyxuvRboqwtLbV49GFjoW/joSdYuFASafUX3Uooehb+YNC1EUcGEj8utyHsDOr+rsiXNooZhc3IHbV2ZgzvDbWnEy/cmqZ7sWZeO7r7ixKoH4GicFOOrcOHnLfQjtLY5HrII4GHYpQFsERMpPfZr7ouiEIZ96L6hwxiVFqEUkwoETsAb+iRRouwKpFhww/wvAgZDNPzbsKVjjr3GscVrt3oT2B9qS51PiNsdCEzCqXZ2L0NuKpHm26bKAAYG/dPjuwqZiRy4oJ/r95S9AoNYLV/01IDkIY5Hb2M8B7xaXTJYzk6DFlzRKoSjT5UkB3OIBCzqKwpDcbPXUwmW9OOhc8nCK3btWDz9iiH9xew4BACdstjmGw+hR9VYF45cJMmaUqY7vxaKEP9vLhP2nPwqsro1FgFSK9Koy7EcXJDBtRtUxmiJjuhOB6Pv/hV+uP0Iye4uJwi2vOToLUleQNNbUIVoG1fmYZyCz2pOu5sSPwz4I8EOEoCk2jIH8TGS2LXXaNdjPXRDHZMRScrPUmhCyoRXhVoNkbAZ0e9C/6aZ83Vu1yPoqgObd5K1UgmkoSxxuFqHk2AOJNgQ8zasFSzj9XV6Wls/kokI6Gf8SOLggLfdyA4W6VuWpmfSBuj0fQHsOADd/LfakwTLTh+D8Ldp2dy1FNT9QD5HAjdz7hF1Ouk7A4mVaBXO4i30HywjamCCQRiWwS+gvDEpVMwSd5qPweLrgYLACPuvGeCWSxNdeZUm8CCbQTFkjDkf5iT6Ov5lJQ1e26woQcDvvJCDORv570aPJuODkKw2wpZnPqrfTvmYcJwAZEr+//CwsDSluLfUtIM6o7r/GQ8BYzGPg8EENGy93+uoHaRV23QzLyhoEzufJrnAxG6nChCWrE1B/XmG5QK1EFk1Hq2jyFLe+8PeUhrI8duM0XdvuKdZ1oNSKDLd+mQzZ5slGMSqE26ghplobNiVU1Mh2mBxBU4nFO+Zf9EAouuqK4w7/n5Y6vyJbWjQtKEidtUOD1i0Ar4Dqmk4GWc1d+JdZHS0EU5Adg31IxfxEtAOSlNHuHFJ717Cs5361Bmqt3sOUHAJWmanSKKD3EOZsrXIX6kP+amOhyonwOrjQRwVfCNYXrZ0Cv5p76J+JTLKGKwFMb53DJDLyjhg1WSVNyvmWJHodrhgkOg123gBEheLjMliO1364wbFKqZzVI04MOBAeaZhjorrcSqpOp9kDGUOTDyXhUqcRrWoxjUAyCpFxjXmk1zYIACnb9XUnnKduqVRglPBJbbU4XoDlrOGo4j2jG8auNnM5iSwHvSgwbwT5nOhMcMgnEqkXMgUCADA0HZpL1Q+CB6lgD+nWGTeaLQcw4N6tfdRzCFiXTnhgKX6hM5NWUq5pJOMmQoZLV2JuFxbGFzKQnC20j9AvbfeavsGlwNKavaywDB7rHLyLaXhAS1nRVjCWkuB9G3nLc6WJJOuDfeSaZAc2SilA00ApJFkYy5zdjuSOFSmYB0tooBp2YmGXINMpwr03yco+f/Ns9jcl46K1QUYydIISUSr8V+zvDkln8maaFX9WdQ1KYqLVKw021T/V1nVSZaoxHONMwir05oRnhQPPp9292ztvdBvKkwel/MZbLVkfH5UdeC5DN0gc0UOfMBTyPkiEME6UjO2bKBIn4PPoS2miAEQ1feMFrThw1CkXdz50DcNFx+5/KS4i6GT5tDYFQ=="
    -  },
    -  "completedAt": "2026-07-15T12:02:57.920Z"
    -}
    \ No newline at end of file
    diff --git a/.workflow-data/steps/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-step_01KXJTH845WNPD9MC53BS00TSH.json b/.workflow-data/steps/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-step_01KXJTH845WNPD9MC53BS00TSH.json
    deleted file mode 100644
    index c8e8d77..0000000
    --- a/.workflow-data/steps/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-step_01KXJTH845WNPD9MC53BS00TSH.json
    +++ /dev/null
    @@ -1,20 +0,0 @@
    -{
    -  "runId": "wrun_01KXJTH845B37ZAB3DJCPQ48Z8",
    -  "stepId": "step_01KXJTH845WNPD9MC53BS00TSH",
    -  "stepName": "step//eve@0.16.2//dispatchTurnStep",
    -  "status": "completed",
    -  "input": {
    -    "__type": "Uint8Array",
    -    "data": "enN0ZCi1L/1g2St1oABqw8QhPkBp1BzDMAzDMAzDwzhuRzukT5pMkbpTUuwkEZJCNh8Grphyb5iPKVe2YTwEy7GKGhq19n8XAO42SOkoCjABMgLqAQACXS1Mqd0Eh6cwn9XpDaiGUe6E4baG/PX8ftl4g21d65FtPSCFG9k8VqpbYkD8PgpGwFiWBQHReDbXw63Wtb+uyAmCuhqPA3IEsCwpcfTQQtCwymUBoEISERE5HocDN6RDCssQQdIo1L5fHiHR7zxNvJUUgqRRIExRWARbdxqxDBKSj23volqJ5G2MoO3DB5JG+Z680idRWIRIxvXREMN1UhiEKWWybXEKtVMyTFTXhtOKocewUthEpFEg/rcKgxD5+DD8V2hCAoIDCNQg0PNgeR5AniXSmsQi4eDRxQEEyIREQiJpdrJNpFH0tekvpTBJZAKmVP+TwjJAIhGRprAME5AMECAY27f1ixChgP3Kz48fRBpl+qgOIhof/+tIpPm3VITv7yICpFHcvqcTxB60Fx9mJwvXYwcF3xWWQYLSJ4EwhdKFr6E4wBR1uBOFgfuuFTISSNhRLvQ64U4aVhSnBQoaudPnixlK7QRpfKw+doSk7ktFcIApjU00ijdtd0FolPbYQ5mAKRGNa/ivoeXB+M1EAxMSCWBUFGAhmUDRAATJBAcSEwRsFMCAAZCIjhehpbCN8FkGiUb5WL2L940RLFQmYBkiJI2yr6/xmt0dQBrlP/ZfV7SVgJ0yXFdYxD36DC/8W6iVwiCQRtnWlMIeNMoFd8Jum8IcNMpbj954zb+uohpSmKRRfPnZ8aOVQsoE7IGIAyyD0wWcp1cYZGkUh7rAwujtIIVBGsUlqMoEDrjJtlAr9/zJPL6+J8bGBgHJpGclAhY0CoBYQKMimeMkcxyMkJMePX2tnyR2EdqPpT76aU9d3zpJsz/Ky/1bxw4fjTLqhPuezGFDuAk7Yb/Im9HF9fxi1a5wLPW6T0+WwpHOG8n40xAkjN7Tp6evd/Wx+RfJ7FWplEtF15NM1o13+p30o+lMm30K7XN6HXaUD+0EQZoU7IDe2TnJtGUXvJ5k70ozNiqSOcQOymahp84buO5PxyH+y+nTDu+44MYIFHhWS49bdNDjZBgZFDQma9fhXuqef2ELMH2En+3FhtIzo2BHcKt0aPXUYEML83qo1fIOOVondQ+Qzs3DwwWVYlil88NDMq85N4q4pabDtfxpTpBuW5/rMT311SIZMGB+/fPtdCEZ14/1jU4nuVR0V4tk1nGUHnVW/R5QuycdxzlhTNj2bVXplM/pcU2W56XO2lYVO69SM+KU4OveLqfvppzShRn7Sgmv6b5R6vbw4LF5srBiz4eHf0utpG6ZJJ4yaueU8tRcCfgZNsPq4SHZw8M/PGSz6dLjhdNnN2Zd231tJ03luzq403tAO0HpsWvlf+xjDnHE0FaeHpA+U7KHYrdS9udrY2hbMt9nX7iTlbpUNlW3S83X+SJM5mku1IyNAeJyr5eH02uV/zbb0wzOHpCMA4RBNqhWf0O2txMnGefVRU7Crqx9TjKnrbOcjuM4rKOC6x3MwdjBOhhjOXHIcZzMZVksqOCCdCYOObk0D2nED/WCheYesK1kvAG7t/vkTnSCms/PXuMN4C6QzANO39cJf1O7vJHMeiiV/U4fbM0TdtOd1mNV6dK/XA8PqZfjy8EI9TN3+iT2XF5X+ZAKkIyD5vART/7Ypfu+dfreoFBebj3YPUm5pQR161JoLfa18QTxZKWEa1+v84ff0wpr3/Rs5bP+UhC7MCV8fPJBzdiomCQmgJHw7TwlS9UPWdjKth6hjjIiskhQkP/OLRn+kpmNpRGCZNvYq5gQ68K2/L4b8UUyEhERkNjp3EbX05TUCZBMezGKemnYkln7kr23y+aAZCQOvjC+7gEZCiRryAaGzkWMZCI82QaxDg02NzDGQF6EFH4vqZ+zvvPH5ov9MrpIpm17XfnCbEpZuRR/o6jWd9tyP1ZUc7OP3bo+Ci3klq/83lSyh/pOkYwDEYCFxVKhwoIBAwYMEEuvQ7iT8Z0dLkYyYGC12yetdlEuzsUqn0jA8wDptOqF1FX7TLHLfX36+2m4Gck4BQEVGxgUFbkT185es1bXkyxSyZx6pp7ovxLUV0mz2jVgoXPs4c+SEnbST131j61/1bblK4aQhk60gG1vIVy3Gk5ICumxBw884ABTHLyjowPqMhKzDRmxU34u90DOrYoe/i42TUMhtXVWP4+3UsJ+1rrehQsMigsMCoyKCtl2kmJDyD+2I2fAwDmYvt3cOqeuT75+Mn/M7yKVzj2R4nFssDpoeb7bJOhYy5PLsXKM4KI9jhy3Ko85SXblR6snh3Qjl0manFmquDQQ/zbDgXB4ssG8CBvmi9PH5XEspJV7wL7wOB4H4/vxMeWq2JDmPtlc7Omx/mOlUlOCtRkY62y5uhe32mchA6NfBkZeGctCsCOPVSKQV+t178AqJ8mxoG7hi/lKwY4WSvDoDbRCMg5w/5X61zBiwKJCsob0tk4AjZeN7rw42SboKXx0IZSsq/2NErqKZCIVe2gkw7wtc+a+bdFfqtF1UFZKPdHdaiQDufC8jqN+C8k482MHAu6zOjMWhzk4k+Q05MUBFf2T6+M4uydWzNY6B8g0KlR4T6kN7tlWO6fpDtRWVMOqIVvzePmqV4JL8eQxjFG2lJdSzsmu76JG2/Ka4NDwUCQDBv0kTv+VPOr0sZmXcxofUopk+GFPnpS6Qt4Q0rxc15FERCwYKCooWEQiIpaMjQpIRMRCwYCLjA2NxQIFDYuL9KfTt3UJe2GOdaIv6k4UygnJOIA2ijbbPrTVx0IwlrAb9wYSzmA33oAtkpEwf19J4qdCMpHMf0qx25cNFSkkA8lsHlArQNooZvF4GoUhqDMIwp4moWOIRkaSFAqNASMQkEDCwoMTKqFu/AETQJfLA2ENMoaGZCQoKChISZI2A5nK6zH4gcT0/LqlahOyLNzmwgVGqioq8SlTqW/C9D7c6wMlFeu8DqOIMM70R3LGn7KWnbXUTweh7OMT2ohD6a3CSmTUG7Cj6RWZIF7xur0AKDmXGWgARGJY2rDTbH0HmKtlWpRWyQ3vtx4IOD1S6pCHZaQIw0OF6gdwDNKzIWx1BHs2vfOqZH6VxEbBpOeAtbQj3xTOS7JG2VuNXKKu+h4D6v2ycSewk2UzzeedUDkXREonvURlTh8+ITclRFpfsfCtrn4bRG8EkxUAfO+5yMKDy0OdzYuuxE6aZUmMwFKahEMizI2Wc69kygHEOyVoz8IbXigb3i3OKiXQl6Cufp4Ep5qDv88W5k9VRiG7ibVbvHfgCYWO0RypTh+3ULjAJku8El05+hr2v99uYILwtf2MjZGFZ52/cuFc6SmLHlnscUs9MHfj9Loy3xZX4XoooM1nQuNpvvJJfBEOokMhsGTU3EaCBQsa05NaD91fnTB1qiy4wvJtmQiZMG1GBzTYeNxw9Qra2hgHepThl3ml8/VXI/I09z5MPj5cpar80zLliB8o9DYBAdF753rNzCCuKyGwiwMGLH0rRl4nBuMHSOpp2AE5uzPsvzbSaTY1ldA1E67+wfo1WpVv4J9yZiDgeXoSH2nSyEWtaOvrCpXJkwXyrm42z1aBH5KoGdMCb/0NRr++VYUCCxg+hF2iC9ywtDCbcZya4f+OYnFoIoIY5GMd0jvMjS+sEnb6gJ8z5bIp56zAPleM3l+CpNbt4hUqUIOXd58OsKxpWIdEzbTBIdf+oOKbllAxTTFJJu28ol9a06hPTlVAZgm1eZTrI6UERUSZtplj4h91HWIupM16CIOkcDjAY0PyMh5Z/LJmKN2s/bRfdT7EAp9gLJEE0l45QDA04x4dLRdUzhboBPoRgKb9EzZp5hLk8ScSCK3a2EXMP8FQ2VGEayTRbxY5Fcbr9vVER9UhexXcH4X0cctX+GtRSYNQs/F84U9htLXZoGRNYq5ZonudF7vgrmQlarL97A83HG0GV1mz+oWyButGOuNGndqOuSdlDZ+aGyV90nhC6efUHkKT7TR/ak2SdBFFIYI8oE3/AWEELskaov+ARFWZgedZWVL4MDWIgS3TcKRcQ3fU+TiTzuKOHDbM76mUqu3RDId8xvDes9WM9paZfZASBDj3NUtDKBQTIRlmQ8LeaGZdukAj4mstFAv4T+6YU8+STH87rpzoGdyb6kvTIpXfbAdmUBmWCJsoh7Op+sxRnJkU0znESkI+lhmoSmcCM5Rt5SYwcoRQwZrDrjW2m4mnKQNzPoYyozb5dEQB58ZdMzx3RWThW8NZLGymt1HqdgEBIO6ydjg+IpzIUCFTbU9BT+h5rH7YsDYzFkm05UeBg64FscazpPRN+zZYjMwbQNHWlB31XuGMh3K0vmFcDE3YPCYHc7BSunXR6hQkOmKoCfl1Hub7KQyt434OAaPQ8GXyaAoP0sFs9RisheqJ+uLwNJ5Dh42hMinpbd9xoTPorGhgJ8pcAJUTJWbE1dACPW4DGxa1QWJ5mCnevZAtVLYv5rNDI4VRhE+Db43uKaby2QaD1fb0SLwSvyuTQPwyJBYcM4WWZj9QXVTFujRgJ1mcQYbtPXOrkcYbZQ0pU8wIBF/6zyiLzNpk2UPJDAc0an06VPNQzk9xWAludWnUsvaGr7cdHkjzgxWuxPOG1VjmB/4NGdceRqi1DzBkDzdpWjqaWwxJfwsat3nbjkIea9pcZoKEu4FCbB2FmUObJNdY96azaMa/pqZYattsp/xAD9YsUIURNnmpFYL+K1QcQ04FJtNIMqXFtT6feTDkhKsgRz/KwTiMaUQ1BHpI4bA3okpAbsQG0JiyP8cPoVFvIg7Erv3laK0tXA3nCTUwLgTXnm9ai019/9FnvIRhSjVU82xQ0voogFZ3OLWHdx4x7BvikVl0SSgiGuQqYk4ueJR3MVQs0ksFER4utyJNDGj97mCLMySKcyiGDenObAOnXptDOLttRcSL/oarnlxZhxEdtSLF2geAoFEXwz5AwnNN6Me1fjvGZmnDc69rA2ghBj599HfjSz4hvH1YvmHFMTaIUK9JBsIm4Nj6sChl7BaOWKDBRCICCgc0MLehoQz6GNvuDx7ZaqNI/RF/6goPAHf8IYlE7dh7AXn/RPPfypgBOgwfTwt1NX4mLnDdODe8p1EV7LGifNFKw7eGqAi9zNkcKOVqx2AJOX0uuEMrLxwXqpBzGCcStRisiJFi4l5DSlBKP4XOlGWtONUxNvj1POmz25ESAKLL8s6XHRKBKmIXC+lMEg6onLS8AIqG919iJgg50avu62YsCkkNq1Frxzc4N4nEEQnVKCNGeXKEO8JHP/wb+uHAI2V2FJy3YpXIaVuqXoabuCCEzTYg4GmcAs3Vgna7ESfk/EG24wWYqpbMARaNpHatNe0Ira1u4mLyTJLQWZIxIZ7wElB/NBKGEUS7QN5C5nye25oIVjsQxh2DViGAIMp6Ua7AYQniMNmGP9JmiYLhePmngbVRRypElv0seUnQHpCxEzaDffrWvKFU2ig6+2qgWRwe3YQL/JaEy64hZsvbgN7c3BQKfvB+LoGT4Qwhao7Pv4Y0lVZjCFNaTI/+7GXkGSgw3vsyRsI7NCYaFSvgTvNtWCw/sP8Zff/iCex6aaMLBGUSHqNmLcYGc+ZluYFek79EoAF5K+skiPo7g+WA1Easd2NYk34gpOSN6MkzKx3oU64pHKmCjG45H84KMFcQ7qucRvm02aU9oxAUJ6Z9GPSAxk29whYSNNuMmseFa5M7eyYxgXkXeJbITQFL2JZxwST30huun496SwXvS3h7duB8t43YtzBxz8ut0VMMw43vk9MukuW81VMnnEMNkWj809pSr0KgYM8KZC5k7cl+0QUC7Ko7Jrt1/2urhaM7MeOGINMuYqja/AFDK/N34D4Zc2avHmG8LYymdkQTZF1iP3TUS/y51fIOXFMZnuzJ9wTBa04tdVpAMD0wKLgFWmIn/aLj7qGaroh/ismVQCB/r4O5SiZY0pgAVIBwEH+KsAFZzoB0zP80fxG4mhpVpXZeMajtuM4+yShi1fqVc9aKg/DoKlwDkEjOF3hhOxe7xgyxHWH+8hVFFetyeEDUDMBSDqdhbQ3p2coeOH9sDBMOQDxOy1Sc6LC4xrUBEDqM5Daxk5aw64C1bXsqTfGMujSVPqqIiA0x6mt4PadwPtHa59uEm90slAM9+fmVVNcJS7lHZijo2ykSWWQCBB4wY7u0FAoc9IpSKJ5DMTJnNPPHAKhZRsUABC5OEF8XOoGvEr0UEtJdsWxrbuXJdqPSu9KZggvJD0NYJGrKMjD/qAqON20t/lIbcF+Y1CxlEYBZUuXId0rro5bjOEFGYTPR+hGS0eapOCGT7PxES3jPSTmyr0MnTYSQaczGVTpN6IjKmrBSf2RCi+CM2j3RENtAoCkf/qGhKYH5zVuq1XdHt9QpN48yiYeIVt23ZvA5VaaxUyEoYqkSEFUnNe1ipKtymEb8CrOeLBKVZifn2zkgCzo9hVfLj91CCT09Ygy+ayXsKerHEquHSXxWKmRyH8pP2su4wgbCOGZOiEPPRecicb7Wy1guZHRQGEKMo6+Ot203SEXGmy88CtBuj6Xx1roYmY8v4VG7VO+SFbDAYqONNuShPD5IM2EtAOFFVse7aGHvdOeOns4l75w/Tlyvb71adaoSbArp/VoT/Q1PyMChr6hfDPuEIq5KQpicpoWugRjDHseK9n53XbvV9rUXgaNKXdDbad/3In/MnKbpm0EDhHafHL2JdzeDQBfNnFOKJxNs/0YTI5Pr1QMA8GBIVESqEBo6db9J2XmZ49vMEcDXIu/L62hEnRMpky70oYvu7QKov+gG"
    -  },
    -  "attempt": 1,
    -  "startedAt": "2026-07-15T12:02:58.021Z",
    -  "createdAt": "2026-07-15T12:02:58.021Z",
    -  "updatedAt": "2026-07-15T12:02:58.064Z",
    -  "specVersion": 5,
    -  "output": {
    -    "__type": "Uint8Array",
    -    "data": "ZGV2bFt7InJ1bklkIjoxfSwid3J1bl8wMUtYSlRIOEJYNUVKNDJLUFFRQkNTQzlTRSJd"
    -  },
    -  "completedAt": "2026-07-15T12:02:58.064Z"
    -}
    \ No newline at end of file
    diff --git a/.workflow-data/steps/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-step_01KXJTH845WNPD9MC53BS00TSJ.json b/.workflow-data/steps/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-step_01KXJTH845WNPD9MC53BS00TSJ.json
    deleted file mode 100644
    index 0f06276..0000000
    --- a/.workflow-data/steps/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-step_01KXJTH845WNPD9MC53BS00TSJ.json
    +++ /dev/null
    @@ -1,20 +0,0 @@
    -{
    -  "runId": "wrun_01KXJTH845B37ZAB3DJCPQ48Z8",
    -  "stepId": "step_01KXJTH845WNPD9MC53BS00TSJ",
    -  "stepName": "step//eve@0.16.2//fireSessionCallbackStep",
    -  "status": "completed",
    -  "input": {
    -    "__type": "Uint8Array",
    -    "data": "ZGV2bFt7ImFyZ3MiOjEsImNsb3N1cmVWYXJzIjotMSwidGhpc1ZhbCI6LTF9LFsyXSx7ImVycm9yIjotMSwib3V0cHV0IjozLCJzZXJpYWxpemVkQ29udGV4dCI6NCwic3RhdHVzIjoyM30sIiIseyJldmUuYnVuZGxlIjo1LCJldmUuY2hhbm5lbCI6OCwiZXZlLmNoYW5uZWxJbnN0cnVtZW50YXRpb24iOjExLCJldmUuY29udGludWF0aW9uVG9rZW4iOjE0LCJldmUubW9kZSI6MTUsImV2ZS5hdXRoIjoxNiwiZXZlLmluaXRpYXRvckF1dGgiOjE2LCJldmUuY2FwYWJpbGl0aWVzIjoxOSwiZXZlLnNlc3Npb25JZCI6MjEsImV2ZS5jYWxsYmFja0Jhc2VVcmwiOjIyfSx7Im5vZGVJZCI6LTEsInNvdXJjZSI6Nn0seyJraW5kIjo3fSwiYnVuZGxlZCIseyJraW5kIjo5LCJzdGF0ZSI6MTB9LCJodHRwIix7fSx7ImtpbmQiOjEyLCJtZXRhZGF0YSI6MTN9LCJjaGFubmVsOmV2ZSIse30sImV2ZTpldmU6MzM0MzgxNzUtYWI1NC00ZGQyLWIxNmItNmJjMWRjMTU3NDhjIiwiY29udmVyc2F0aW9uIix7ImF0dHJpYnV0ZXMiOjE3LCJhdXRoZW50aWNhdG9yIjoxOCwicHJpbmNpcGFsSWQiOjE4LCJwcmluY2lwYWxUeXBlIjoxOH0se30sImxvY2FsLWRldiIseyJyZXF1ZXN0SW5wdXQiOjIwfSx0cnVlLCJ3cnVuXzAxS1hKVEg4NDVCMzdaQUIzREpDUFE0OFo4IiwiaHR0cDovL2xvY2FsaG9zdDozMDAwIiwiY29tcGxldGVkIl0="
    -  },
    -  "attempt": 1,
    -  "startedAt": "2026-07-15T12:02:58.399Z",
    -  "createdAt": "2026-07-15T12:02:58.399Z",
    -  "updatedAt": "2026-07-15T12:02:58.423Z",
    -  "specVersion": 5,
    -  "output": {
    -    "__type": "Uint8Array",
    -    "data": "ZGV2bC0x"
    -  },
    -  "completedAt": "2026-07-15T12:02:58.423Z"
    -}
    \ No newline at end of file
    diff --git a/.workflow-data/steps/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-step_01KXJTH845WNPD9MC53BS00TSK.json b/.workflow-data/steps/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-step_01KXJTH845WNPD9MC53BS00TSK.json
    deleted file mode 100644
    index 32d047a..0000000
    --- a/.workflow-data/steps/wrun_01KXJTH845B37ZAB3DJCPQ48Z8-step_01KXJTH845WNPD9MC53BS00TSK.json
    +++ /dev/null
    @@ -1,20 +0,0 @@
    -{
    -  "runId": "wrun_01KXJTH845B37ZAB3DJCPQ48Z8",
    -  "stepId": "step_01KXJTH845WNPD9MC53BS00TSK",
    -  "stepName": "step//eve@0.16.2//notifyDelegatedParentStep",
    -  "status": "completed",
    -  "input": {
    -    "__type": "Uint8Array",
    -    "data": "ZGV2bFt7ImFyZ3MiOjEsImNsb3N1cmVWYXJzIjotMSwidGhpc1ZhbCI6LTF9LFsyXSx7InJlc3VsdCI6LTEsInNlcmlhbGl6ZWRDb250ZXh0IjozfSx7ImV2ZS5idW5kbGUiOjQsImV2ZS5jaGFubmVsIjo3LCJldmUuY2hhbm5lbEluc3RydW1lbnRhdGlvbiI6MTAsImV2ZS5jb250aW51YXRpb25Ub2tlbiI6MTMsImV2ZS5tb2RlIjoxNCwiZXZlLmF1dGgiOjE1LCJldmUuaW5pdGlhdG9yQXV0aCI6MTUsImV2ZS5jYXBhYmlsaXRpZXMiOjE4LCJldmUuc2Vzc2lvbklkIjoyMCwiZXZlLmNhbGxiYWNrQmFzZVVybCI6MjF9LHsibm9kZUlkIjotMSwic291cmNlIjo1fSx7ImtpbmQiOjZ9LCJidW5kbGVkIix7ImtpbmQiOjgsInN0YXRlIjo5fSwiaHR0cCIse30seyJraW5kIjoxMSwibWV0YWRhdGEiOjEyfSwiY2hhbm5lbDpldmUiLHt9LCJldmU6ZXZlOjMzNDM4MTc1LWFiNTQtNGRkMi1iMTZiLTZiYzFkYzE1NzQ4YyIsImNvbnZlcnNhdGlvbiIseyJhdHRyaWJ1dGVzIjoxNiwiYXV0aGVudGljYXRvciI6MTcsInByaW5jaXBhbElkIjoxNywicHJpbmNpcGFsVHlwZSI6MTd9LHt9LCJsb2NhbC1kZXYiLHsicmVxdWVzdElucHV0IjoxOX0sdHJ1ZSwid3J1bl8wMUtYSlRIODQ1QjM3WkFCM0RKQ1BRNDhaOCIsImh0dHA6Ly9sb2NhbGhvc3Q6MzAwMCJd"
    -  },
    -  "attempt": 1,
    -  "startedAt": "2026-07-15T12:02:58.451Z",
    -  "createdAt": "2026-07-15T12:02:58.451Z",
    -  "updatedAt": "2026-07-15T12:02:58.471Z",
    -  "specVersion": 5,
    -  "output": {
    -    "__type": "Uint8Array",
    -    "data": "ZGV2bC0x"
    -  },
    -  "completedAt": "2026-07-15T12:02:58.471Z"
    -}
    \ No newline at end of file
    diff --git a/.workflow-data/steps/wrun_01KXJTH8BX5EJ42KPQQBCSC9SE-step_01KXJTH8BXKCJT8Q2301PKTFGR.json b/.workflow-data/steps/wrun_01KXJTH8BX5EJ42KPQQBCSC9SE-step_01KXJTH8BXKCJT8Q2301PKTFGR.json
    deleted file mode 100644
    index b6897af..0000000
    --- a/.workflow-data/steps/wrun_01KXJTH8BX5EJ42KPQQBCSC9SE-step_01KXJTH8BXKCJT8Q2301PKTFGR.json
    +++ /dev/null
    @@ -1,20 +0,0 @@
    -{
    -  "runId": "wrun_01KXJTH8BX5EJ42KPQQBCSC9SE",
    -  "stepId": "step_01KXJTH8BXKCJT8Q2301PKTFGR",
    -  "stepName": "step//eve@0.16.2//turnStep",
    -  "status": "completed",
    -  "input": {
    -    "__type": "Uint8Array",
    -    "data": "enN0ZCi1L/1gpCuFoADaxAgiPkBp1BzDMAzDMAzDwzhuR6vcv5tMKXGnpNhJIiSFbD4MonTKvWE+plyZzsKgx1bQRChC++KTAsDdBikdRQEmOALvAQICMKV2ER6ewnxWpzOgGka5E4bbHPLX8/tl4w22dS1ItgWBFHZk81ipbqkR8fsomIGxLCsiovFsrodbrWt/fZETBHU5ngf0EGBZUuLoNbQ8tBA0rHJZALiQSEhEj+fxwA7pkKRRqH2/XIKiUS7Y7zyxB28ldSBplAhTFCbB1p1GbAOFBMYP2fYyqn3J25ih7cMGPXmlzxVWIWkmJI3iG1dIQw3XSWERpjSwjfDZhgAmJtuWDQ6qq8NpxdBjWCnMwUSjQPxvFdbg48PwXx3uRIEeUDioiEAtAj0NlqdB5FkmWqNYKCoeXSocRB5IKCSSZifbTDSKvjb9pRQWmdDAlOp/UtiGACJKU9iGBpEKCMb2bf0eTDSKLz87frRSyAL2Kz8/rpholOmjTjTKtqYkC9Id8fG/lpholNf8GuH7y3AQaRS37+kEMYpIe/FhdrKKBqZIMBJMZACnULsPVzWFKS9CS/H48cCBBxQKaFwYgCGJYOGAA0mECooHEzoMaOCAiMQHBd8VtmEi8pa62lWRyItQYRKRRllKXwBMoXThcygYmMLAfVcKGwok7CgXep1wJw0rirOCBI7c6fPFDaV2gjg+Vh8bUpiDRllJ3ZdqgIEpcCfstikt431jhoUKq2gUb9ruomiU9hhE0cA2SEgaZV+f4zW7SyKN8iH7ry/aRsBOGa4r7EGjrHv0GVr4t1ArhUka5WP1WNHAHpjAwDY4ZcB5eoVFlkZxqAwsjN4OUlikUVyCqmjA4CbbAq/vqdHRMSGZ9KxMoAKHAREMcFwkc5xkjoMRctKjp6/1k8QuQhuyVEg/7anrWydp9kd5uX/r2OGjUUadcN+TOWwIN2En7Bd5M8q4nl+s2hWPpV736clSPNK5Ixl/GoKE0Xv69PT1rkI2PyOZvSqVcqnoepLJuvFOv5N+NJ1ps0+hfU6vw47yoZ0gSJOCH9A7OyeZtjCyC15PsnelGx0XyRxiB2Wz0FPnDFz3p+MQ/+X06Yd/XHBjhgWe1dLjFh30OJnGhgSOydp1uJe659+Kagg2AdNH+NlebCg9Mwp2BLdKh1ZPDTa0MK+HWi3vkKN1UncB6dxAQFxQKYZVOkNAJPOac6OIW2o6XMuf5gTptvW5HtNTXzFywQLm1z/fThaS8XUVpSHrG51OcqnorhjJrOMoPeqs+kGgdk86jnPCmLDt26rSKZ8T5Josz0udta0qdl6lZsQJwde9XU7fTTmlCzP2lRBe032j1A0CwmPzZGHFnhAQ/5ZaSd0ySTxl1M4p5am5EfAzbIYVBEQyCIiHgMjmgjvZdOnxwumzG7Ou7b62k6byXR3c6UGgnaAE2bXyQ/YxhzhiaCtPEEifKdlDsVsp+/O1MbQtme+zL9zJSl0qm6rbpebrfBEm8zQXasa+EHG518vD6bXKf5vtaXa1AQ+RBdmgWv0O2d5OnGScVxc5Cbuy9jnJnLbOcjqO47CPCq5/MAfjB/tgjOXEIcdxMpdloWCCCtKZOOTk0jykET9UCxWag8C2knEG7N7ukzvRCWo+P3uNM4DLQDINOH1fJ/xN7XJHMguiVPY7fbA1T9hNd1qPVaVL/3JBQKReji8HI9TP3OmT2HN5XeVDSkAyFe3hI578sUv3fev03UGhvNyCsHuScksI6tal0GLsa+MJ4slKCNe+XucPv6cX1r7p2cpn/aUidmFC+Pjkg7rRcTFJPIGB8O08JUvVH1nYyrYeoY5SYmKhkCD/nVsy/CUzG0sjBMm2sVcxIdaFbfl9N+KMZCgkJCKx07mNrqcpqSMgmfZiFPXSsCWz9iV7b5cNAslIHnxhfF0ENhZI5pAODJ2LGslM8GRbxD402OzAGBN5EUr4vaR+zvrOIZsv9ssoI5m27XXlC7MpZeVS/I2iWt9ty/1YUc3NPnbr+ii0kFu+8ntTyR7qu0UyToQAGBgLBQrLhQsXLkQsvR7hTsZ3drgauWCB1W6ftNpFuTgXq3zihOcC0mnVC6mr9plil/v69PfTcDeScYsJFx0aFhe5E9fOXrNW15MsUsmceqae6L8S1FdJs9o9YKFzDOLPkhB20k9d9Y+tf9W25SuGEIdO1IBtbyFctxpGSAvpsUOt3PMn8xgPPICBKQ/+8fEBdRmJWYeM2Ck/l3sg51ZFEH8Xm6axkNo6qx/IWylhP2tdz0KGhkWGhoXGBYVsO0mxIeQh25EvWOAcTN9ubp1T1ydfP5k/5neRSueeaPE8OlgdtDzfbRJ0rOXJ5Vg5ZshojyPHrcpjTpJd+dHqySHtyGWSJmeWKi5NxL/dcCIcnnQwL8KG+eL0cXkeC2nlILAtPI/nwfh+fEy5KjakuU82F3t6rP9YqdSEYO2Gxjpbru7FrfZV2NDot6GR18ayEOzIY5UJ5NV63TuwyklyKqhb+GK+UrCjhRA8OgOlkMwD3H+l/jWMGsCgkMwhva0jQONlozsvTrYJegofXQgl62p/o4TuIpmJikE4kmHeljlz37boL9XoOigrpZ7objmSiVh4XsdRf4VknPmxEwH3WZ0bi8MenElyHDIDgYv+yfVxnN0TK2Zr3QNkHBQuvKdUB/dsq53T9AdqK6ph5ZCtebx81SvBpXjyGMYoW8pLKedk13dRo215RXhweCxywYJ+Eqf/Sh51CtnMyzmND6lFMvywJ09KXSFvCGlerutIJCSWCxYXEjAmJCSWjY6LiITEIuGAjI0OjqWCBA6MjPSn07d1CXthjnWiL+pOFMoIyVRAG0WbbR/aKmQjGEvYjTsDCmewG2fAGMlImL+vJPFDIZmJzH9KsduXDRUlJBPJbCBQKUDaKGYBeeosAskEhRmoMwjCnAahY4hmRpIUJB0jEJBAwgKEAyqhbPwBEwDX6wNlDTKGhkQUFBQUpCQZNgOZyusp+OXEhPw6pGq7tawF5sIFRmIqKveUdqkawgA+iOpDMRXr/IEqIvrKRkc645GsrZe1rE0XQRnTJ/SIC+l1hYXJyI/BZtMnQoI48JoVAdA8F5nZAEjibNoAp3lxBphrflq0VYkY7+seGDplWOqOh1ukJOBDgeoHsA1SszFotQw2ob4TqWRllEQGg7nnorWkSQYUCpWkHYW2mmKZXIU4BsT9/OHOb+eQM73Mq1LZOYosJn1bZegf7i43awhIXw3wkV59E0RlBNOVX3zvusirB8IDL5uaruQn7WXJQWAQmnRYoshNDbNZScgB+7cQUJ+FWt4gG14pThtKifGhkn72BLeag79n6+NPVacgu4HbtdzL4i2FzpwcSU+vtNCyAJQlX0mhnEMNd71ffrBB+LVPx/aTfbPevgJ0bvopID167OGWJDBbf3pfme8Xl8h6mKfNQ0IzNLn45GwREqJ1IaKkbx4nAZcFlutZ6yV3XCcudQYWPJX5FkWET5hUKw600Xj4cJ0FrXoEA/3LkMnM0PmsUTPbNJ8f7gwfVqmG/ROfctgPAXRfQUBRo3KtZj+I65UI2H8Ao6UvqJHbxMDwKSu1FazBnKazr1xP6QShylYoAMSq9NzwGrGVZ/DPCwxIwAp6sjFqa5Smctpo9gJVw5MbebJuhmMbwc/YlIZ5lLcCgq9f01UNgoUa/sBOtAtt2HCYZXHMzPD/OMLibdIHMeaDDlI8zMALqxOmawEmMiXcFDrrSK8uRq8v41JrevGOClTwqtandizrDlaFUSMAcJVrI6iip6WDmDpMAlU719EvrTHUS7NUQEeJbB7D+o5SUiOiQFuHY8rHtI6ve2az+oQhB5wbkNiQuBtLlrPsIJQ862Ha453/YYE2GBYigaVXHBA8ZjSXjuUFuTMG+oSWBqC0fyub5HCJNn4uBYJVq72I7E8uJ/sZ0Y8E/P48e2Fc3z4g0Yk6HV7F628NfCTqqzW1EN4IqVmUL+hMWHRtmsyseTZXf+he4otB3DWysoFsx/SHAsc3+6gsX/1iWf92I2dcjFPl69xNWaineoUyOWmJoRQ7NRmhOThNK7UhSVxHERIhBtAW/JowIpewMfEdYPoql/BcLEs+H84HHrHFYDiy1qA46hiVqa249cNG+L2LUiU9EuHg5tjde76awdDypw9qCXycW8tKCXHEtKetbMjLG6Osaws0QLy0hU5B4UnIeMpZgqkSx2UTdQf3Zn/pW7vzZPHAqlVmGGGq5QCbdirziGfmcTo3rVKJDzMDvdLhwIzVNtIEqCKsBNY66ZpjqzHxMqXEnGVgNWq2z0t0dG68asYzVzwLP3g424Wh9GqWui8QyOddPicsjwxO5NQ0VptK6BNiHyvSGsb1xhId7bZRQqil4NT4LinTadkG25SZHAiytXxHs9fk8TxHk2uYjaH9II89wOxbP+9NtDeFp440UkKtTsV8M4Vh7LiVQ7AUFr5SHu3hQXqYhP6HtaA8YV8Eng5/6E5jECY0PeO7mdBBmG2utI2yeUA1o9SMOAWNRQ9gIKuiZlYsFuatFwLZwp1tfz4ONEIwJvgknq1ZP4W5yMagoWh7SREHEteXSRR+2RRLQwxXmNYP9TdWsXcPcIks8Mz4vd9u1W7j5bLwyugIANVW5meORVZ1sumhWoSDivqzDlMeDOSxcRiOW2oaCVA7wz+1nSuk9oOtVrLshjOWjYGZQ0y1QSL874MLqftNclkEw62UpGYLghtWO6Pwx5qCJt6QAGwglG0tXeZITcs1QryhENH5F61pV22O7ZQfZoY1UVTxCIuiWv/QA0veYyhVIWO6ceYN4hLOrzkYQmNUUNMPrm8cmDSSYgh6SL2xUVFlQSViRDem7s+xBmv0m4UDiWtXOTprG6thXEItfA3BseSbdoFK34v1mS9x0VID1eAbarWuFLjVj5Dapc0PLPqWffSE3ReKg4ZeaZgTQI8uXnxMi/+qgMxHrFaEewNav0vZIhQlAV4JYUu5c9rQpHvm8M6gtkbwKrwpUU+e16Wj8602seYBdmg8xEDhsfNsCf0+rd2Oslkq8Vxy3wCciWVPv/++82UsBHwfyG+YaIyIIFQx+YHACfhJH7nKO7sFCQssTEEiRqFBw7gNIcq4x/DswuPlrRcQtj98Sh1FD+WOeydRrZ11DyGng2j/bR0ygI8B6mmkrrbPBAguDsbx9fSpQnusmi8+byjWEAOhyxmfA0ZY3TBYwk67FjyyVYWjkipZDhCJtFkUK0qL4rSXMQhS0s+h88k6VHx0LPH8Ckm6TXZEPkBysjznux3iRlWmq4ickYS2XmaaXxFFqPyRLhPCndYquroTC/hSs2sUwlEMDpsUW0R8NtqEURYdwV3x0bL/lfMw9RGYnT/nW285yDFbct6HJl+Qp7WNKfUwTwH7aqVd+YhHFX9QsAMDqKq256AmimS79jXtiqy3biLFZEeSellyNQF84bVQX1okNCPCu1DfLnNmnxtlEYxxoOMdTq08CjmUBQ6u2CHyzSGBDQPV1uaCoXgpmlbWhhkpE8352TSSTG/AfPdADNb8+1tjnbRQdLJ2oFwcHt0EF2gtCYZdEgygb2uuc28piPFB/rwsnsh5O+rot18YUhKzGg6Mb5Ez/SSXgd3AhLFwlsEX3o6YKFScOHeUj8ui/kBRbDb792NgyqUZXZgqI/BgNQMxVuyae8lR+3r9BVINwoosDIJw3/FmDoNs5LSbU03hA5ScboRyPOPVUyPlIsI5JMi4LefhXAGyCuY+0mn5uS/d+gwOAXMxdwwDD2gEqdcIQfphG3kT+qc2SWdqYj5gOgDFEk5T/AI7DywAnyPd6hpylG2pew8nb98MBNO2z/v+GPeJrXWsFFLOBudkoHPLcvP2aIWZpCFSGk+0TampEHSwu4KOCs575F3UgNja1k3ejt3vsWUda5Q4UsOXgYuIqzZ9oNCK9R0QTkaUmVbfFm+Xo1cdUQRkmqUf2eVluOKy2SHd1JJuZuNdnGCwU486DRDUHiwUfoAWspOY6FD3kKawSIbAoCvFyFfqyKsyB9Y7/j8VSA2CGOVq8JZzLR0zP/FflK5AjVqjXVcMbjvus1czily1TuWk+gUqWLoKx7gk6vMBXvjLxZMxY2wHm79LReHB+BySEa8BgJQwNFxSEz3XqsRPGIzlmwOOx8HyihOTF9L4YwBY38HQxnZSC5M64JobT+lQjlJH7RKI6itiiw3HNDCfdjgftEnxMcKZb1bLget96lz+csKwXCCzH3R8ilRRmVACaBiFXuIKhQed6xSq55ASGUWaycaAo2JEBiSOkF+3PGFTpYUmBNMVgqxtruVJN6RiX0gfRC42DkNmz2oPGa4/P4I3vu1/ZQoNdBThNXtbSDAbVjn7ktJyQC1naGz3X4+EhO1DikZ0ksfPE/oELuwjS9d19IQINCHZuDPHVIyqOCuO0+CMLxHjUlsIG+saTDKFrf+K+chkRfuW9H1E9Bf7XVxsF7H503p83Ew2p+Uzr4lMqnuKKpka0xi0dQhKR7/jyaP+RI7WmQjuKYixTijh1aJgW6GFRm44lOp80H0XesaDCeMgkP2zDKnnyphObyiIEUEeniQkkGeMuVFZUJMM0B9oOh1Sb2dxv+ogGYC6GW8xZ+Px5SrSyYeQewaoG0rC055/qjmGTckVTmLM3U6P6n7Vgpod6rJmP7xAzoYepRRm0KFfb4vcxui3jZVUFpLOoJzLQ31Gr4tPoyiRQO4lwyA7l+KoJ3RscMmivqUIjySlBJpXh/nteLJB3QsrXq7iXu6OBIYdrZim6Z6OFweM4zeJSQ0OniZxUgJOQlEs0lBlth96r4lyMiAUwb2n/45+6/xlJVSl/wPsueyFS4oQrYp3AdYxdAM="
    -  },
    -  "attempt": 1,
    -  "startedAt": "2026-07-15T12:02:58.129Z",
    -  "createdAt": "2026-07-15T12:02:58.129Z",
    -  "updatedAt": "2026-07-15T12:02:58.311Z",
    -  "specVersion": 5,
    -  "output": {
    -    "__type": "Uint8Array",
    -    "data": "enN0ZCi1L/1g4SotnQBKv/wgPkBp1BzDMAzDMAzDwzhuR6vcv5tMKXGnJNImiZAUsvkwcMWUe8N8TLkynYVBsBw7GqrRvvikAHC3QUpHUYAJHQLiAfUBjaFtyXyffeFOVi6MrktlU3W71HydL8JkEu6kYUVxWpiwkU9zoWZsDBGXe708nF6r/LfZnmZXC1NqJ+HhKcxndTqDnT6phlHuhOE2h/z1/H7ZeINtXSvJthJIIUc2j5XqlhkRv4+B+64UzMBYlhUR0Xg218Ot1rW/tsgJgrobrwN2CLAsKXH0GloeWggaVrksAFhEJCRix+t4YId0hW2QiDQKte+XT0Q++mlPHRJplAv2O08BvJUUwkSjQJgEW3casQ0w/se2h1Ftg4m3MUPbh/obPXmlzxXmYKKhmGgU17g+Gma4TgqLMCUhIRFp3nuKiGgUCA1AoEggw6KAi4iEigYeRCQ0oIBAgaMABgyASHi8CC2FbYTPNgQAeRjvGzMsnGxbnELtNjyoLg6nFUOPYaWwB5BGgfjfKszBx4fhvzrcyWtIYQoEgeJBAwjUINDjYHkcQJ5lojWKhaLBo0uDBxAIEYpIpNnJNpBG0demv5TCIBANTKn+J4VtCMAVBkFpCtvgoFHaY0mDRlkIxt7WT9HANkAmGsVBBdZVggTSxzmdaJSGAQHSKL787PjRSqEK2K/8/LgBpFGmjwpplG1NRVbSHPHxv5bQf0tF+P4wHjSK2/d0ghhFo6xrLz7MTlbRwBSFKfu6KWzDxESj7OtvvGb3SKP8x/5ri7YRsFOG6wqDLI0CG8IJzgqbaJSP1cdWGKRRXvNDqmhwwE22BTvpp676x9a/atvyFUNoQydawLa3EK5bDSVkhfTYoVbu+ZN5fH3PDA4OCsmkZyUCFjYKiFhgwyKZ4yRzHIyQkx49fa2fJHYR2o+l9K2TNPujvNy/dezw0SijTrjvyXwTdsJ+kTcjjOv5xapd6VjqdZ+eLKUjnTmS8achiHK9p09PX+/qY/MxktmrUimXiq4nmawb7/Q76UfTmbpmn0L7nF6HHVH68qGdIEiTgh7QOzsnmbYwsgteT7J3pRocFskcYgdls9BT5wxc96fjEP/l9KmHe1xwYwYFntXS4xYd9DhZhsaEjcnadbiXuuffimoI9gCwo5w+ws/2YkPpmVGwI7hVOrR6arChhXk91Gp5hxytk7oJSOcGAuKCSjGs0hkCIpnXDDeKuKWmw7X8aU6Qbluf6zE99fUiFyxgfv3z7XQhGV9XUfqxvtHpJJeK7nqRzDqO0qPOql8CtXvScZwTxoRt31aVTvmckmuyPC911raq2HmVmhFnBF/3djl9N+WULszYV0Z4TfeNUjcICI/Nk4Uee0JA/FtqJXXLJPGUUTunlKfmRsDPsBlWEBDJICAeAiKbC+5k06XHC6fPbsy6tvvaTprKd3Vwp5dAO0Ep2bXyP/YxhzhiaCvPKdlDsVsp+/M1+7Kh4oRkIJlNArUCpI1iFslTZw9I5gGyIBtUq98h29uJk4zz6iInYVfWPieZ09ZZTsdxHOZRwXUP5mD0YB6MsZw45DhO5rIsFExQQToTh5xcmoc04od6wULjlq8ugW0l4wzYvd0nd6IT1Hx+9hpnAHeBZBxw+r5O+JvaZY5kVqJU9jt9sDVP2E13Wo9VpUv/ckFApF6OLwcj1M/c6ZPYc3ld5UM6QDIN2sNHPPljl+771um7g0J5uZWwe5Jyywjq1qXQXuxr4wniycoI175e5w+/pxbWvunZymf9pSJ2YUb4+OSDqsFhMUlMgYnw7TwjS9UPWdjKth6hjlJiYqGQIP+dWzL8JTMbSyMEybaxVzEh1oVt+X03YoxkKCQkILHTuY2upympGyCZ9mIU9dKwJbP2JXtvl80ByUQefGF83QM0FEjmkA4MnYsZyUzwZFvEPjTY7MAYA3kRTvi9pH7O+s4fmy/2ywgjmbbtdeULsyll5VL8jaJa323L/VhRzc0+duv6XAot5Pb4valkXpGMEyHAxcVSocKCAQMGDBFLr0e4k/GdHW5GLlhgtdsnrXZRLs7FKp9I4ZmAdFr1QuqqfabY5b4+/f00XI1kvIKCBUdGhUXuxLWz16zV9SSLVDKnnqkn+q8E9VXSrHYNWOgcS/xZ2mWEDzgXH9sQiTSKooE94ABTHtzDwwPqMhKzDhmxU34u90DOrYoSfxebpqmQ2jqrn+StlLCfta53ASOjAiOjIsOiQradpNgQ8o/tyBcscA6mbze3zqnrk6+fzB/zu0ilc0+seB0crA5anu82CTrW8uRyrBwzYLTHkeNW5TEnya78aClHLpM0ObNUcWki/q2GE+HwhIN5ETbMF6ePy+tYSCuXwL7wOl4H4/vxMeWq2JDmPtlc7Omx/mOlUjOCtRoZ62y5uhe32mdBI6OfRkZeGstCsCOPVSKQV+t178AqJ8mxoG7hi/lKwY4WRnBnoBWSeYD7r9S/hhEDFxWSOaS3dQRovGx058XJNkFP4aMLoWRd7W+U0FkkM1GxZCMZ5m2ZM/dti/5Sja6DslLqie52IxnIhed1HPVbSMaZHzsRcDUWhz04k+Q4JMYBFv2T6+M4uydWCZmtdQ+QbVSwyLapDu7ZVjun6Q/UVlTDyiFb83j5qleCS/EkPoYxypbyUso52fVd1GhbXhIeHJ6KXLCgn8Tpv5JHnT4283JO40NakfywJ09KXSFvCGlerutEJCQWDBUWEy4mJCQWDQ4LiITEMsEADA2OjcXChI0LjHx/On1bl7AXtu5RxzrRF3UnCqWEZBpAG0WbbR/a6mMjGEvYjTsDCmewG2fAF8lEmL+vJPFTIZmJzH9KsQuFCKhD+MmeBiFkakaSJIUMByMQkEDCAmQjKqFq/AETAJfrE2UNMoaEZBQUFBSkJBk2A/3oAnN1etOVbibg6yX49WOqv/5mtQNZ1qC5IICRbiqKfMpJqQov1z8k9cGSqHXCQzIibue7I6NxriyWyVqupmuobPAJb8Se9BhjKTIKKPjR9FokCBG8flYAvJ8LizYAPXEjbSxp4uwA00GfFlKr5Iv3Bx5onEwidX1jGCmm+VDo7QFMB8lsuLXKgu1F7ktQsqpL4g7BynNOLdGVLQVhJfFGka2GX96rAB4Ddz9IuFvbmcpMQ/MeVFYbwo9J764yzgePy00SItNXJHzQVy8AUTIC80otvvMvUuQB8xBns6grCSVtsiRNYCNNkiYRdevyLFYydkD+/gTus9jG696GC8T5U3KNwtnPnWCzAfGXbGH+R4WqZXe8Xci9BJ5a6MBGkOL0ZwsvC6CzxCspzcGs4TL3yw02CH+7dGx7WTPr4SvB5qidCtJjYY9uiQMzVKfnk/nCcV2vhynaQCVEhGYWn4gUASkaFwpLRU0QJEhYsHL9aD3nXunEqg7dgs2Wb1dEqIUhtXGgzY6HD9db0P6PctBEGSKZizvfcDWTpon5YSf43EsV5D/hKd/8sEDfFQQsR0ugmrFBaFfCgT3HMEX60hu5TAydfzxqcZLyTLkpJ3B+pysonSpQGwntDFXrv5tfY67yDv55oQEJWEtPRka9jdpVTlvNHqKqfJIlz+q2eaYt+HWZcpiYeatnAPSLuapiWI3hi+wsd8EPK4ZZCMclHf/PKRZxEwuIKR+lkHbDbLiwO2FPDY4iU+oXMp5V7DVg9NalCdVaLzamAgdern1q3LJ+YD0eNQgDnLx2ApVAtASMaYKkU7HzH8nQWod6xmAF0pQI57Gk93FKbiICtF0zpj560SE4ZTbbTxj/x7ZBE9vC5k2WmawUlCOLWNprnWdlwSwYYyXBqGdOEDBmHKSO2AXg2QF6RXsIwEv/Pps8Fwl9/LEKdKjW5CKInsBTdiAiGInn9+gzTAQwvUh0oe6NV9n93SQftHy9Sy2MNBxqbuTLxypcvDbMbNYYznVo3Uv94tfumqy8lC1R+uOGA5pFVdZfP1LWR93oMm7MqaYwd6es4VNdoJyUNMlQrp7aU2hbnDaf2ousI6KIgUAcaEZ+IYyyJGdHZB4QHCph8PSXpTcfnoOD2IImHAg09Io6v8J0pbmzwwbie7hSpT4iwCGCWLD3iJoZsKWJDxoEfM5dzKIQ6sVkStjZEKc3SlqXB+iIbGkLlQLhE2QeNmA0i2mK5rj2RMTk3oZfYguyPAIeGExlTikqudzBplkxbzoaadPZdyWPD2AG3tJ5wYxH2/8JLEaUz7A2ecP5tsdET1MO5s4G32Mh+kgi1nNrz2Zc6Iql8MvHSRampfeH1MeAYFV3GZwwOQI50VPVqNrWApZQ67Hy1lAkGcuiaJ9H30qCCMoaX0g5AE0MYXeZPcBYtjaSdPOyHv8daSPDxBpapPEYEJjhhclmihascOhI6U347cSb72IYnsdNOAQyoeELxNFFPCTLbOxRqwXO8/sCxFPuQ381tjLh01NfYqCjQir+qfAoswrqPsqwiBOhaXiQBp4gahtivTAbvWnJ1mW2t+WjQSM+I7VPHbY1blae6j4MSlbbxYshcfaZFI0vu2MJiKn7Kv6h6mBYxXLJAroZZu+/WyE0niMLrgwZKJDvbn/mJrIEJtsOVXY4mKhP69DMgyhYU3AYA7fWNNJX28rn2y4/pK+DFVd67oaALHUCL4eUa58i7NgHP6Rum2RZBMUtnqSkC5Zbb2uikMMaCS+5kdBuoIzth1vmxE3bNUJ7UyWi+69WU43aXlssP9WONdKo4hNWcbX+oFmU1McQUSFjuknmbOIKzr85mCBhqaCuH1x3rBxoJDUEPaSpsCdQOaB2Qso3KL+vo8ejUTc7DiXXvnKc1JZ2Q/XEEjwZghzLV42FqL4A6BtfEpCVOqo5bIhsfSiwq18otSmZH1j0jfsoqrtBKA5aumKhp6AeRV58qBbDUCFrnq9YkR4GPH6fsGUxUoU6G8OGkzuUOjaH/Yy0lYIX9KaaeopY1x7ddGWJOR6gQGNSjMdCW89/9Be1BnXUZXmJJ4WLBuAnRlh65pe8r5MQ/H1Iv+GtMZI+obVJEEQtoBz6qF1q7AaMWJDCPCTiFBY0JLZBTWc+Vrcfjee3MCxif/qTOhUV6h3wnmSldvH9hfwHIs63rMuAEoZkpwN3VTwTKrgGM9fX03OFErFqvoic4UAhTog+5jwHjbBaOViNnf4sOLJVE86PKkrOaRAJWFRXpKXidq+rESTSH0L3lzVXjNkxffqVS/rv7RgNQDJZfPNNDvGhSqLLQHKQxG8qb/xfG0XZ+hGZSd1OfRVB3YoFQakpapThqAzKTSKBcEY0xofRSo73HepoNv/KfZh6dGV3CKd4WVbkwJb+7wnTXdBGZRtV4HmcIrbVSLv3EZ/M/qi0cwKgq9bmwIaN5Lv2Se2KrZNu0mIyuSQtWUI3YajCA1ATYCQ2RgS7ON5p5iY9d8oRVHXg7R1grTwCCZRVGq7PIebD4aANXdW2oIK18RJPz2vLjhSIkv2sMkkkMmCwu0AGu/xdcwO0tD50WmIgOw6Zbu630psEw24ZE/y3a8ncsBTA/IB9/oyfOReNmp3yn43EqFZbgF0sRqI/8DIMDLYYqnMZ/QLSEZOniohz5/hGLPYPVLAm3F95BVa5xNBlhtIMj02zi+HHFnN5DvvX6i+haQDYynITBPjOWDkAtdHcu/nWhD9iafNGuvXMUU/ulI0vHNuAzOVPD/MKRFUKd5Vgs6Lz41rPKAj6EDNnGAhC49SLiE7bAMnONvHlZW9trc7EhARgsgaSJacpyu+U0VBQ5bKvwLX/UdVS4r3Ft7QOpN42//VNfu5IlnXyFD2vc/Hkzilg6ZsIow/LUEMrGhu22NSoECxYsIJbEwLtGV9kgxCi6lbi7r2/IXWexPwNgiZLRJlqlweoVm/uQGIb4wxazb94OxvdfEmjyFq5foxoLyMy2c07tExl4DPJ3jeE1qkHHOI6S3UpnmUVhoHm22m06Ejt4Ux7ZHBy2JXoyL91uFZJD5Yd56CiXm5TWds75takLO+XTuw/RV2UX82MKqk6pBgddwx+TzJaWDWQch7EeCkyXTx3HBJBczFejITixTErvdOkP2BQ7LENRyLE2QAfpSgastZYD1hpgPOfsfY5dOKZLTHinHtBG0cAlJsUGKhRTerDBgHsbQdSIwo06oaqFK9qh9iiw5FGDKcLVwEtZj4mcPeb3XWgY2dCQ7VO8MdNyCyAYgqQ2iWTJJABwwZLN6HeoH0ABfAczyd2p3nfGFVUintrcYIgdf0JrBtVtnTwkBWcuzVJrqjwXOnYwkWrgMGYZ6+z7f85DrxH2t+R6mygozhSs7fFBNNyFahvKBVi1bJYxLaJawGRWBtOsWJMYvUasVBTF4Ajm0h0pgnKGImxYS7n+49OQVU9/VnUIoKlaplKY62BRKca+v2TafzCBlvm971R3OopjuAG8dC0wn16JiLnI5hrirDVdkflSb9cHGNd2KYKv9T/EbOIT3SHXUV554Ao6KYKQtgFbGP218mp+5V6iIvhoaA9MxERtI9Iqm63kFEyzqeSKJ5pP7fIdKsIlPkOWHz+/TlIxTJm/xsKy0WaVU+atME+mK0tBBdu7rqNzAMr/Cb4wdj3rKeVnG8wD+fTn4GJusbQC0DiGpyTZ3zrgREYoQRfpyGhLb4GfFpxoxILf5RE1oW/7t1CsPnND7DK4rr8CTAoygZ9rSzSWOgqzN+ZaRSbjSpLdWnkykgwOAvFmR+PcFpygFHLmWY1EusGxXPnYSF56noivXQF"
    -  },
    -  "completedAt": "2026-07-15T12:02:58.311Z"
    -}
    \ No newline at end of file
    diff --git a/.workflow-data/steps/wrun_01KXJTH8BX5EJ42KPQQBCSC9SE-step_01KXJTH8BXKCJT8Q2301PKTFGS.json b/.workflow-data/steps/wrun_01KXJTH8BX5EJ42KPQQBCSC9SE-step_01KXJTH8BXKCJT8Q2301PKTFGS.json
    deleted file mode 100644
    index b12fd22..0000000
    --- a/.workflow-data/steps/wrun_01KXJTH8BX5EJ42KPQQBCSC9SE-step_01KXJTH8BXKCJT8Q2301PKTFGS.json
    +++ /dev/null
    @@ -1,20 +0,0 @@
    -{
    -  "runId": "wrun_01KXJTH8BX5EJ42KPQQBCSC9SE",
    -  "stepId": "step_01KXJTH8BXKCJT8Q2301PKTFGS",
    -  "stepName": "step//eve@0.16.2//sendTurnControlStep",
    -  "status": "completed",
    -  "input": {
    -    "__type": "Uint8Array",
    -    "data": "enN0ZCi1L/1gnitNoABaw7whPkBp1BzDMAzDMAzDwzhuBxvcv5tMKXGnJNImUSMpZPNh4Iop94b5mHJlOguDYDl2NFSj/faTAsB9jZSOogATLwLsAQECFGcFCRr5NBdqxr4QcbnXzMPptcp/m+1pdrUwJ+0iPDyF+axOX7DTJ9VQyq0w3OaQv57fLx1vsK1rKdmWEincSOexUt0SI+L3NXDflYIYGsuyIiIcT+d6uNW69tcVOUVQV+NxQA4BGCYnLH20EDSskmEAqJBAIJHjcTywQ/rCPhhInIXa98sdSDwaak+9gcRZLtjvPE28nahE4iwRBmHrTiX24cBj27uoFiJ5GzG0faivIXGW78krfRIngIzLoyGG67SwB0xBIBLnvaeICGfZCJ99TEi8i/eNGBZWtjFOo3YfEtW14bTi6DGsFiYh4SwR/9uFRSQ+Qgz/1eFW2BI9mHDAIBK1SAQ1YKAGEYiRaG2CmWAAKcPAQeSBZEIicbayTsRZ9LXpL7WwBhnYUv1PEV+YZGkfkQgkgrG39Wsg4SwOKrCuESiRQs6phLO0C4nEs2NIK40oYL/y82OIhLNMHzXiLNuaehCJj/81g4j+WyrC93chEXEWt+/pFLEAnGVdexFqtrILW/Z1W9iHAwln2dfXeM3uD5zlPfZfV7SNgJ0yXF8YbAglOC/MgbN8rD72whpkYB8BSJylPaYsw62wW4u2cCUpQgtj4Cyv+SNdMrAF4jAPxnceNPBgIgGMigIsJBEoGnAgicBg4sGEjQIYMCAC6XgRWgv7mHCWpu0urRYmcZa3lN5wDf91tGRgD0g4wD6cLuA8/cIijLM41AUWRm8XLSziLD6BumRwwFW2BVrRAtpbCNethhGSYvLYoVbu+ZN5fH1PjI2NCckmz0oEKmgUELGARkWy50n2OBijJz16+lo/TdjFaD2W0rduotkv5eX+rWOHkEopdcJ9T+absBP2i7wpXVzPL1btC8dSrwv1ZC0c6byRjUMNgZTrPX16+npXHpt/kc1elU5yqei6ksm68U6/lYY0namzT6N9T6/Dlih9+dFOUaRJwY7ond2TTVt2wQtK9q40Y6MimUfsonQ2eup8gev+fDziv5w+7fCOC27EoMCzevK4RRc9ToaRIUFjsnYd7qXu+beiOoI9AGwpp4/ws73YcPLMKNgS3CodWj012NHCvB5qxbxDltZNuglIZwcC4oJKMazSGQIim9ec/7ilpsO1/GlOkW5bn+sxPfXVIhsaml//fDtZyMbXVZR6rG90WsmlortaZLOOpXSps+qnRO2gfB7nhDFh27dVpVM+J+WaLM9LnbWtKnZepabECcHXvV1O3005pQsz9pUQXtN946QbBITH5spGjz0hIP4ttRN1zDThKaV2TilPzY2An2EzrCAgkkFAPAREOhfcyqZPHi+cPrs169rua1tpKt/VwZ2eEu0UJWXXyvfYxzxiiaOtPKdkEMVuJ9mfr42jbcl8n33hTlbqUulU3S41X+eLMJuEW2lYBVSUkE0ks1GgUoi0UQ1DefrsAdk8RBqyQbX6HbK9rTzZPK9OehJ2Ze17kj1tn+V8nudhHRVc72AOxg7WwRjLikfP82QyDEPBBBXkU/HoScb5SCV+qBYqNG756hTYVja+gN3bhXIrOkHN52fP8QVwF8imAafva4W/qV3eyGYpSmW/0wdb84TddKf1WFXK9DMXBETq5RjCGPUzd/om7Mm8rvIjHSAbBu3hJZ78sUv3fev03UGjvNxS2L2JcksI6tal0Vrsa+Mp4slKCNe+XucQv6cV1r7p2cpn/aUidmFC+Ajlg5qxUTFNeEID4dt5SpiqP8KwlW09Ri0lRIKZkCD/nVsyfCYzHUsjBMm2sVcxI9aFbfl9V+KLbCYgkEjsdG6l62lO1A2QTXtRkppp2JJZ+5K9t0vngGwkD74wvu4BGQokc0gHhs5FjGwkuLItYh8abHZgrIm8CCX8XpN+zvrOHpsv9kvpIpu27XXlC7MpZeVS/I2iWt9ty/1YUc3OPnbrCl0aLeT2+L2pZE6RzRMhgIUFQ4ECc+HChQsRTK9H+JPxnR0uRjY0WO0WSqudlIxzsUooTngmIJ1WvZG6ap8pdrmvUH9DDTcjG6eYULGBQVGRW3Ht7DVrdUHJIpXMqWcKiv47gfo60ax2DXgLnWOKQ0xC2Eo/ddU/tv5V25ivGEYaAQ8s76IvZJyLj308kDiLA2x58I6ODqjbTJp1SImdMnQ5KHJuVaT4u+g4DsWkrbP6Ud5OEja01vUsXGBQXGBQYFRQyLbTJDaM3GNb8oYG52D6dnPrnLpC+frJ/DG/i1Q6B0WKx7HB6iLm+W6bwMdarlyOlSOGi/ZYetyqPOYlJbvyo6UbyUyTyRumiowT8W8znoiHKxvNi7Bhvjh9ZB7HRlo5BbaFx/E4Gt+PjylXxY40F8rmYk+P9R8rlZoQrM3AWGfL1b241b4KGRj9MjDyymA2gi15rBKBvFqv+wdWOU2eCuoWvpivFGxpIQSPvkApZPMA91+pfw0lBiwoJHNIb/sI0JjZ6M7Mk22KnkJIF0bJutpfKaGryEaiYopGNszbMmfu2xj9pRxdF2WlFBTdrUY2EQvP61jqr5CNMz9+IuBmMA97eKbJ45AXB1T0T67Q4+ygWCVkttY9QKZBoSLbpjq4Z1vtnKY/UFtRDSuHbM5j5qveCVyKK/ExjFL2JC+lnJNd30WVtuUV4cEBosiGhn4TTv+deNTJYzMv5zR+pBTJldfRw548KXWNvGGkebnuI4FAmAsUFRIsJCAQJmOjIgKBMBIMuMjY0GAqSNCwuMj3p9O3dQmbYesgdawVfVG3olFGyIZBtJK02fajrTw2grGE7bgvmHAG2/EFbJGNhPn7TiYMUchGIvOfUuz2pROFHKgz+MmeBqFjakZkJEkKjQEjEJBAwsJDMyqdbvsBE8CW6xNlDTKGhGQkKCgoSEmSNgOz6KqXuKwXXdO5rm9Xl8PD9kyC15/gd8Jk9PWLau/SsvDmAiEjbVQk95SSUmdegn7I1gdOWtZJgnxEZMwfR0rjTFmsyFromn6haukTrogj6Z3C4sgIdOC76TeQIBq8nk8ANM9ldhuAkpiXNug0ce8Ac7WcFj+qpMS7dQ/UTppc6gDGQaQs4qFm7AG0DoJsxLccBJt19xgrWdAlUYxgyXPUWjokL4WeSiKjYK3mWi6uLh0D+35puGPUyd9Mg3mbVKZW8d+kf6yy7gcA5UYNYelrHb7hq9eBMBuhcQUc37kukuiB4TBn886VtElLWLIlsLIm0SCRu0XhvK6k6ID2RguOWXi0t2TD34wTU/ofBeznlGC0OfD3ZqH9mwoYsptDu457Ox6n0ACioPT0TguxFl9Z6pUYyk7V8Kj7FQDeCMM2Zmw7WTnr91eWzbmeXqvHxF7dkgZmCU9vcfOd4pqthxraGCVEiuY5n7QXwSc6HEIuRU3UIQHKAmn0pnWBO6QThTpAC4YgvsUS4SMM1FYDmj8eQrgqQZs5rgSdZejKXO981q5JNM3HD3/Cp3Spdv9Zn3Klj1nQcyJrLpyW02vWghhcyYCtFTAR6Vs08ioxGN/1qNPkzpvSLmdwJvFXVjrtqMYVugzheR8yu0aN8lf+qduMBNyip5vjEs3Qqo02ub1AVfFkTHLTjY1YVODnMwXBbO+t8CDrl+6qVrDkhl/YieiCDGseZlscVzP8X1MsuiYvIGg+RkNKDbPswtaESQ3IoUypXEg9K98XwOihy0XVui/GTgXoeG3t0/yWFYKVZtTIC9jKtQVU5WnJIKaDkqLWzgGSWWuG+vrJFYhUopbHg55SSqaKaNNWc0z40Yij7MrZrJYwMg8fA3dshs05WayyXihHVry063a+woL+YCCBBJKeOUEgNONaHc0LhpwZ6Ae0G4Ch/StsEtQlrPGVFGitWsJFwD15Otl/RD+S5ffxrAijcXvERK/qZH+V3m9u91Gor7PUImjDUnNMvkSVQg1r00HLmvVcW6V7+C9uxF3Gyi6ytdYfF5zuTLayYvVTsvbrxiPjfJzCq3OnslCfuhhl06SthrLwqfVCg8Rp79RWZDUcRRiELaCt+GvC6EDSIInzAVxWyYEnSFli+HBoIANbquFwuYbwqKNaTDuNOxk20N/LlSr3ESoOnI2Ve4+nGYUtT/igI0BwbmkWmBAhJk4yxoaWvSHQuuSARsS/WkgW0J+s8zYDzGfxTMKPq0jUqe+N+gW1HucN4IHFVAaMov7KcWxqNvO2o0mfTm1VkuGDyUC5dFYxY2erN4HNET4C1py5YZYtYSJjShdzmCHw6LY+OhHauYe5GdhcMSq8N+OUC0vpNUHqQECgh7ucFTaPGCfeqMNQbX4BTOjzWBHZMIwZCw5pd0dpSyIIOhs/SLkGLTpguzI/AIq25iap9to3vhwpYYZxGhoM8Vg2mOkK6Q1Eq1dAdKTEE3Dg9Jbv0zA0jDs4hPfCwZebo/MYUoRp6zNbC8YT9gXjaRyG/htzZzLSl777Qmc/qSxRdjnUrJTPiK9NI/eoDoxc1LSOhcDc9G4sW/DZts+HgEYCxgWf2nNrhpuYlE8Mhv62YxRT4qIy6QJfZsUCH+8U1vzDoIZpinWShVKZdu+hW1NvfFXWuDKTGRDCLn6mIrKcJ/sMVcFwqKgD6iDOQ3dev+IwPm6RNFqvlop/tZ0ySDEPRq8Ezw1vLMsC04fY1wZEuLoPK2SQbdKwWJ1bkpIiFjxuhNaOggJrPE9yAglRA9HYJkRnzt5EXaOkNw6Rsn+ZmjJqw9pC+flWsWaJKpawOasVCI212D2GVSqeTBXKJC8uvHy+g4ELYgV5/Sh14xSgAf0hniHBjB1ETQAVEAqwIZgujmNWjbppcMi5pi2nprZK+skmMuAACMqPfGFBlOob/jD3S2i6BqNK/YZ/rc8CbHUGqS25SYS9vtmPQGYXQpGhUVer9ITo0byL0d5iuSoM/KzPiihkwO93K1vKJoKqUzHsiN0x14E5cGe0rSF43W/S1UPjupbohKtaLPAAHRoNxYhMtHjWoF+kNXbHYZZPeFK6bwAsxPqm33+R+UoKgdwHxzd0HSO/Eao0GUEcCwipz8GLhV02EhZMmNlE5GFBg3wbfJTRHzPX4cfbrQcQrj8CSt1EnsgdIZHkc+3ovRi5ayLet0WVAVMM8U/HdRU0E2twtQjAGBiOCmyxYvki9oZAh9gIHc3cHBjl6sdgYTo9LDhDqyucDapEctAnErS4rAhSxca9+kWwTT+Hri4rUHHTMQj79RDpf+0YQgB6ysLONx0SiSpYFxG5IokOspz0vyCKfuyvYibMONmr7HUjFpWlRtQIvuM8QDb5XOIo0vAiRlNyNDs5R8v6F/nh3CNcdt44EdQqJ0e2tH37mGZBzljb/KyH5BSbVpPabUfcUPHHzA4TIE21xBzIPpLBtaVqt8RadEM6JpGSBJOllgl2he+FepeREjKCsgv0HWGO7bk5H8GYA0vdCdNqbRBUWbPh6h3e+ByibRiNtpcU7OIFaRq3tpdISfTvZ6+SpA8CPruUMFjMd4TNH2nD0ImrgeZxmHSDXHBPElp2khj43p7i535mBPyD/HNC/D7nz1H/yr5kSDOzqgnwpcVu+uNZxt0AiYGZLUMqYCEx6aq4F3cGH2PR4oGyyjD7mxcw8KUWXQQpZ/B4mm0xfkw31+Zu/cr/ZRINRv8sgCAT37kzBxhtdLYbaU3ZA5dqbkRbnlnqHJPyF+F4D2Q7/sPhWoEcSuFuBWxzdP7c5hkSAeFiNgyD/tC4eh2iOx0gQbQNZHkppy3O2Zo4E8xvgLHE2RS4nWJJFSAW7GO7ijsqKF28X9vbbwNnuW3JvvFJwvJb00ph9zp2Toa6u1kmjxCssIs05KWxqf6UmhbiB3srwKRwKj3nUw8QBH9dSN4/98+2q9V6El9u8BrtIjrVhh+AtLKiA7nHiHZ1FLYZk5ajgZd4D1lxqB/g4iVzVUa2A8vUEUlm5nsgAjgVgcMrnaUO1hO2wmOgJXb6J7r+PR5TIYIrOXelZPK/OhKqrAarjiejYvNujdcaHONsZJabli6OnkpdVK9QRhmbTkSMrB26Zp8yWqwaTTmZYrwSge6d8x+JfrO2F9lT8cKY09+x058nKOiwhSM9YtUAhDJ2DR/rSw/+BKSzeWOlcADGs1swxMmS5W4MBLAFKX73xpjUhqUM2O/Op+SUA6ijkVIplWJiA0exGxLOPxwWWsh8ZHBgmR32wJidGg03nlApN5WZAqGeIvGoTJIANoxFlvpCzUHLdQrpOawhTV1jhDHEqBx742IEkuuqEzAGVATSeVV2Nvd7UrpRSS7SLZSLOochPPN6xB1o/qjTHJfaItZqb5BQmVmzlEUOpmEVeJ8p1RWlZRUdy3JrpUig/YPi0kuy09ozoQZ5jiN78eikCUk37tmwbMdvR1ZEFRTaWMRIRLBrF0TjbYN6puj32yf2/85NWSzuE6Oc07kZCQGiKdJK8cTMfE7xYTIkkq9+G90HiumRGCtVm2r9qpxPdhFOxI3ZuZX3DshFp3fhpRAdsyJ+YPboFOm9RP0vxqcRcJYpOdHRo7ZRU0HLoAyvrySaRxnP3JnGoCFMxwWGPcD7297QgZUNrq3ZUEgua3w8b6Ile/62Fn9/UbtA7uoowODf4y9ymPqab7V9ZhvUw941A53i7ecN/QqcOzggYt9aX2mJLiaQCqml5RyJssloKBNvQHJLZS8o+cuMBIA0gNoRE59yhDpjEWfCQphKxUUtGK22Sdqei33a3C1EXxOmCkcqkqASW3rP5CJC+iNEn6jM27P7Hf98FYR+kl0P0Lp7RwsxLEJFObh0Mo2emnnXByyUKLhYDK0LoIehGw=="
    -  },
    -  "attempt": 1,
    -  "startedAt": "2026-07-15T12:02:58.339Z",
    -  "createdAt": "2026-07-15T12:02:58.339Z",
    -  "updatedAt": "2026-07-15T12:02:58.371Z",
    -  "specVersion": 5,
    -  "output": {
    -    "__type": "Uint8Array",
    -    "data": "ZGV2bC0x"
    -  },
    -  "completedAt": "2026-07-15T12:02:58.371Z"
    -}
    \ No newline at end of file
    diff --git a/.workflow-data/streams/chunks/strm_01KXJTH845B37ZAB3DJCPQ48Z8_user-chnk_01KXJTH8G6DMT75WA31VA65JN3.bin b/.workflow-data/streams/chunks/strm_01KXJTH845B37ZAB3DJCPQ48Z8_user-chnk_01KXJTH8G6DMT75WA31VA65JN3.bin
    deleted file mode 100644
    index 32901de..0000000
    Binary files a/.workflow-data/streams/chunks/strm_01KXJTH845B37ZAB3DJCPQ48Z8_user-chnk_01KXJTH8G6DMT75WA31VA65JN3.bin and /dev/null differ
    diff --git a/.workflow-data/streams/chunks/strm_01KXJTH845B37ZAB3DJCPQ48Z8_user-chnk_01KXJTH8H6QPPQJ1AW572AH6JP.bin b/.workflow-data/streams/chunks/strm_01KXJTH845B37ZAB3DJCPQ48Z8_user-chnk_01KXJTH8H6QPPQJ1AW572AH6JP.bin
    deleted file mode 100644
    index f7bc4c3..0000000
    Binary files a/.workflow-data/streams/chunks/strm_01KXJTH845B37ZAB3DJCPQ48Z8_user-chnk_01KXJTH8H6QPPQJ1AW572AH6JP.bin and /dev/null differ
    diff --git a/.workflow-data/streams/chunks/strm_01KXJTH845B37ZAB3DJCPQ48Z8_user-chnk_01KXJTH8HNEJ7V8SNMCTPR3JPH.bin b/.workflow-data/streams/chunks/strm_01KXJTH845B37ZAB3DJCPQ48Z8_user-chnk_01KXJTH8HNEJ7V8SNMCTPR3JPH.bin
    deleted file mode 100644
    index 40e15c7..0000000
    Binary files a/.workflow-data/streams/chunks/strm_01KXJTH845B37ZAB3DJCPQ48Z8_user-chnk_01KXJTH8HNEJ7V8SNMCTPR3JPH.bin and /dev/null differ
    diff --git a/.workflow-data/streams/chunks/strm_01KXJTH845B37ZAB3DJCPQ48Z8_user-chnk_01KXJTH8JC4ANRR53JAYYASGJ1.bin b/.workflow-data/streams/chunks/strm_01KXJTH845B37ZAB3DJCPQ48Z8_user-chnk_01KXJTH8JC4ANRR53JAYYASGJ1.bin
    deleted file mode 100644
    index 15e6ce5..0000000
    Binary files a/.workflow-data/streams/chunks/strm_01KXJTH845B37ZAB3DJCPQ48Z8_user-chnk_01KXJTH8JC4ANRR53JAYYASGJ1.bin and /dev/null differ
    diff --git a/.workflow-data/streams/chunks/strm_01KXJTH845B37ZAB3DJCPQ48Z8_user-chnk_01KXJTH8K4PC6EM9EAY07636P2.bin b/.workflow-data/streams/chunks/strm_01KXJTH845B37ZAB3DJCPQ48Z8_user-chnk_01KXJTH8K4PC6EM9EAY07636P2.bin
    deleted file mode 100644
    index 2c08be3..0000000
    Binary files a/.workflow-data/streams/chunks/strm_01KXJTH845B37ZAB3DJCPQ48Z8_user-chnk_01KXJTH8K4PC6EM9EAY07636P2.bin and /dev/null differ
    diff --git a/.workflow-data/streams/chunks/strm_01KXJTH845B37ZAB3DJCPQ48Z8_user-chnk_01KXJTH8KKSZ2H86B2WFDKMF82.bin b/.workflow-data/streams/chunks/strm_01KXJTH845B37ZAB3DJCPQ48Z8_user-chnk_01KXJTH8KKSZ2H86B2WFDKMF82.bin
    deleted file mode 100644
    index e8f260f..0000000
    Binary files a/.workflow-data/streams/chunks/strm_01KXJTH845B37ZAB3DJCPQ48Z8_user-chnk_01KXJTH8KKSZ2H86B2WFDKMF82.bin and /dev/null differ
    diff --git a/.workflow-data/streams/chunks/strm_01KXJTH845B37ZAB3DJCPQ48Z8_user-chnk_01KXJTH8M28XVD4SJ0FTGVM722.bin b/.workflow-data/streams/chunks/strm_01KXJTH845B37ZAB3DJCPQ48Z8_user-chnk_01KXJTH8M28XVD4SJ0FTGVM722.bin
    deleted file mode 100644
    index 4853e16..0000000
    Binary files a/.workflow-data/streams/chunks/strm_01KXJTH845B37ZAB3DJCPQ48Z8_user-chnk_01KXJTH8M28XVD4SJ0FTGVM722.bin and /dev/null differ
    diff --git a/.workflow-data/streams/chunks/strm_01KXJTH845B37ZAB3DJCPQ48Z8_user-chnk_01KXJTH8M5M3CJ44Y8YFT94413.bin b/.workflow-data/streams/chunks/strm_01KXJTH845B37ZAB3DJCPQ48Z8_user-chnk_01KXJTH8M5M3CJ44Y8YFT94413.bin
    deleted file mode 100644
    index 6b2aaa7..0000000
    --- a/.workflow-data/streams/chunks/strm_01KXJTH845B37ZAB3DJCPQ48Z8_user-chnk_01KXJTH8M5M3CJ44Y8YFT94413.bin
    +++ /dev/null
    @@ -1 +0,0 @@
    -
    \ No newline at end of file
    diff --git a/.workflow-data/streams/runs/wrun_01KXJTH845B37ZAB3DJCPQ48Z8.json b/.workflow-data/streams/runs/wrun_01KXJTH845B37ZAB3DJCPQ48Z8.json
    deleted file mode 100644
    index 9d36305..0000000
    --- a/.workflow-data/streams/runs/wrun_01KXJTH845B37ZAB3DJCPQ48Z8.json
    +++ /dev/null
    @@ -1,5 +0,0 @@
    -{
    -  "streams": [
    -    "strm_01KXJTH845B37ZAB3DJCPQ48Z8_user"
    -  ]
    -}
    \ No newline at end of file